dealpos 25.25.8 → 25.26.0
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.
- package/browser/chunk-2K53NANB.js +111 -0
- package/browser/{chunk-LFAF37GU.js → chunk-2Z34SOFS.js} +1 -1
- package/browser/{chunk-2CTP4BMQ.js → chunk-32HO32MS.js} +1 -1
- package/browser/{chunk-AIMIIWWW.js → chunk-343IZ54O.js} +1 -1
- package/browser/{chunk-SQIDFTCB.js → chunk-36VM7L56.js} +1 -1
- package/browser/{chunk-ZHZOWX2Z.js → chunk-3ES5JNFS.js} +1 -1
- package/browser/{chunk-ZJCIND63.js → chunk-3GVN7QRU.js} +1 -1
- package/browser/{chunk-4OKTQRJC.js → chunk-3MNL3EI2.js} +1 -1
- package/browser/{chunk-N4OVYFKN.js → chunk-4LYLV4UI.js} +1 -1
- package/browser/{chunk-CHCPAVCF.js → chunk-57AL3WNT.js} +1 -1
- package/browser/{chunk-LZNPZHLT.js → chunk-5L3PEABR.js} +1 -1
- package/browser/{chunk-DXQEWBJH.js → chunk-65UGRJH4.js} +1 -1
- package/browser/{chunk-WVOMH4RM.js → chunk-67UENVPK.js} +1 -1
- package/browser/{chunk-ODX3UNLF.js → chunk-6ATMCBY4.js} +1 -1
- package/browser/{chunk-W7W6YBLW.js → chunk-6C2COETD.js} +1 -1
- package/browser/{chunk-QZ2RZRIW.js → chunk-6VUJL4LU.js} +1 -1
- package/browser/{chunk-2X44VTT6.js → chunk-7AMRS42I.js} +1 -1
- package/browser/{chunk-24AGTB57.js → chunk-7LJNIQNR.js} +1 -1
- package/browser/chunk-7PTSJNYV.js +12 -0
- package/browser/{chunk-QTJVEI6G.js → chunk-ASHA4GLO.js} +3 -3
- package/browser/{chunk-RUC77VBU.js → chunk-B2IZPSLV.js} +1 -1
- package/browser/chunk-C26IBDXB.js +1 -0
- package/browser/{chunk-H7M7JMCO.js → chunk-CEQNLAZS.js} +1 -1
- package/browser/chunk-CFIJUX7Z.js +2 -0
- package/browser/chunk-CM5V2L75.js +1 -0
- package/browser/{chunk-IANGJ67X.js → chunk-CXSGN2PY.js} +1 -1
- package/browser/{chunk-CYXLAY2W.js → chunk-DEO5VMC6.js} +1 -1
- package/browser/{chunk-2UBDM3M2.js → chunk-EANLYRTZ.js} +1 -1
- package/browser/{chunk-VTKZB2GM.js → chunk-EEDCYSP2.js} +1 -1
- package/browser/{chunk-GCWZD5VV.js → chunk-FAGTPNT7.js} +1 -1
- package/browser/{chunk-25VO7XLY.js → chunk-FIIHHJIE.js} +1 -1
- package/browser/{chunk-ARVYBSZC.js → chunk-FM76Y7ZT.js} +1 -1
- package/browser/{chunk-UM323GOR.js → chunk-FR5YNRHR.js} +1 -1
- package/browser/chunk-GJRSUQ7M.js +1 -0
- package/browser/{chunk-QIV7GLIC.js → chunk-GLRAPUOE.js} +1 -1
- package/browser/{chunk-3WLUDHBB.js → chunk-H6OFU7D5.js} +1 -1
- package/browser/{chunk-WOXU4D62.js → chunk-ILUSO3BI.js} +1 -1
- package/browser/{chunk-D32LWZ67.js → chunk-JL4KAM7I.js} +1 -1
- package/browser/{chunk-DZX5FC5R.js → chunk-K4OIK5GR.js} +1 -1
- package/browser/{chunk-EYS6A6UY.js → chunk-KEHXGY4R.js} +1 -1
- package/browser/{chunk-SBQKZJJI.js → chunk-KHHQTUYH.js} +1 -1
- package/browser/{chunk-NNBJAKVZ.js → chunk-KTOFTSVL.js} +1 -1
- package/browser/{chunk-77XQSPJJ.js → chunk-LYVADBYB.js} +1 -1
- package/browser/{chunk-X75HQCJN.js → chunk-MACLMUUI.js} +1 -1
- package/browser/{chunk-JPXHIIV7.js → chunk-NE3IJIBI.js} +1 -1
- package/browser/{chunk-NRJS7XML.js → chunk-NKP3QVCT.js} +2 -2
- package/browser/{chunk-42UO4ZOW.js → chunk-NT7WNBUA.js} +1 -1
- package/browser/{chunk-I5QSITC4.js → chunk-NTNBHQYG.js} +1 -1
- package/browser/{chunk-UXRNMYOS.js → chunk-OOXLOH2J.js} +12 -12
- package/browser/{chunk-P4H7GXEF.js → chunk-PLQADJX7.js} +1 -1
- package/browser/{chunk-USSN34DS.js → chunk-PMKLCODP.js} +1 -1
- package/browser/{chunk-JQSHWQ3R.js → chunk-PUHMUI3O.js} +2 -2
- package/browser/{chunk-QJGH3MJD.js → chunk-PWYMQKUZ.js} +1 -1
- package/browser/{chunk-QA2MMCO5.js → chunk-Q2UNUVGB.js} +1 -1
- package/browser/{chunk-NEQUZAZB.js → chunk-RHDJ4XBX.js} +1 -1
- package/browser/{chunk-PPUZGMFA.js → chunk-RWQ6Y4QT.js} +1 -1
- package/browser/{chunk-KPG7CWQ5.js → chunk-S2ZU2E7R.js} +1 -1
- package/browser/{chunk-WYMROC3F.js → chunk-SHIBJMTC.js} +1 -1
- package/browser/{chunk-ZXZXRKGW.js → chunk-SMT6565M.js} +1 -1
- package/browser/{chunk-PJADOMCM.js → chunk-TBVCBKY2.js} +1 -1
- package/browser/{chunk-CCVRUH2O.js → chunk-TQTF2TBN.js} +1 -1
- package/browser/{chunk-VY3T4DIY.js → chunk-UI2HOASK.js} +1 -1
- package/browser/{chunk-WYPXMTES.js → chunk-UYQE7UNJ.js} +1 -1
- package/browser/{chunk-FSFKAXQT.js → chunk-VRF2VN25.js} +1 -1
- package/browser/{chunk-6WENUCPL.js → chunk-W6UDTSSU.js} +4 -4
- package/browser/{chunk-EJD3UWVT.js → chunk-WCQRQ4A4.js} +1 -1
- package/browser/{chunk-VGCAJNUT.js → chunk-WDPD6NWE.js} +1 -1
- package/browser/{chunk-LO3S3LTC.js → chunk-YGSY77NI.js} +2 -2
- package/browser/{chunk-O3FHMTVT.js → chunk-YSBOMERO.js} +1 -1
- package/browser/{chunk-KFRHKBKI.js → chunk-ZE5AV6BW.js} +1 -1
- package/browser/{chunk-MMG6O5AW.js → chunk-ZNCG2YIW.js} +1 -1
- package/browser/{chunk-5ZH662M2.js → chunk-ZSUQ4OJZ.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-MJQHDWT4.js → main-ASEQ7DDE.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-5T6KY25Z.js +0 -2
- package/browser/chunk-ERHZ5GLQ.js +0 -12
- package/browser/chunk-F22VHBVS.js +0 -1
- package/browser/chunk-TUGLCZMJ.js +0 -111
- package/browser/chunk-WSRK2JBZ.js +0 -1
- package/browser/chunk-ZZJZIUJ6.js +0 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import{a as ii,b as Xr}from"./chunk-V5P4ETFK.js";import{a as mn}from"./chunk-JL4KAM7I.js";import{a as $r,b as eo}from"./chunk-BWP2RYBS.js";import{a as ti}from"./chunk-KM7UGGFM.js";import{a as Et,b as Zr}from"./chunk-LUDBROT5.js";import{a as Nt,b as Jr}from"./chunk-XP5YHSQ4.js";import{a as he}from"./chunk-ZSUQ4OJZ.js";import{a as pn}from"./chunk-OTGSFODJ.js";import{a as to}from"./chunk-C26IBDXB.js";import{a as Qe}from"./chunk-OHODOO6S.js";import{a as Qr,b as jr,c as Yr,d as qr,e as Ur,f as Kr}from"./chunk-6ATMCBY4.js";import"./chunk-L3UJIWOL.js";import"./chunk-S2ZU2E7R.js";import"./chunk-VMIIT3DH.js";import{a as It}from"./chunk-JPNG373C.js";import"./chunk-PQMX3XMU.js";import"./chunk-QNMWDWFV.js";import{a as Ji}from"./chunk-32HO32MS.js";import{b as Mr}from"./chunk-UJWW7MMH.js";import{a as Cr}from"./chunk-UPVRETVP.js";import"./chunk-OTUMJKE7.js";import{a as H}from"./chunk-H7IXECIL.js";import{a as hi}from"./chunk-JXLHCASC.js";import{a as X}from"./chunk-4TJP3I23.js";import{a as io,b as no,d as ao,g as ro}from"./chunk-RWENVQX2.js";import"./chunk-KHIVRNUW.js";import"./chunk-D7J7QKYR.js";import"./chunk-6CWHLMOD.js";import"./chunk-ICTX5LEL.js";import{a as ln,b as Gr,c as Hr,d as K,e as xi}from"./chunk-AXOSPMYL.js";import{a as br,b as Zi}from"./chunk-XQ5HEQCX.js";import"./chunk-3RK6DDJD.js";import{a as Ir}from"./chunk-I5GQBAR7.js";import"./chunk-4VIAIZPL.js";import{a as xr,b as hr,c as Sr,f as vr,g as wr,h as Tr,p as zi,q as Xi}from"./chunk-OD6P52Q2.js";import"./chunk-GV52FU6D.js";import"./chunk-IVKU5KXP.js";import{e as Er}from"./chunk-XVI7M66W.js";import"./chunk-S7ZNAMPJ.js";import"./chunk-4NHG4RRM.js";import"./chunk-YAFVFDTG.js";import{a as zr}from"./chunk-V7UEUV6F.js";import{d as Nr,f as fe}from"./chunk-YGSY77NI.js";import"./chunk-UCQSNFCM.js";import"./chunk-SALTMO4O.js";import"./chunk-NLT6IBFZ.js";import{a as bt,b as Ar}from"./chunk-UE2ZCYF6.js";import{b as q}from"./chunk-PNFIBZRI.js";import{a as ae,b as ge,c as fr}from"./chunk-ZHMTPS2Z.js";import{a as ie}from"./chunk-YSBOMERO.js";import{a as gr}from"./chunk-RWQ6Y4QT.js";import{c as Fr,d as we,e as on}from"./chunk-L5UFTIVL.js";import"./chunk-YU36NQ57.js";import{c as Vr}from"./chunk-5OZ6RYZX.js";import"./chunk-R4BNPX7T.js";import"./chunk-PECLRH37.js";import"./chunk-UBVLAOUK.js";import"./chunk-EBC6YN66.js";import"./chunk-375PELC6.js";import{a as Z}from"./chunk-CZDMIN7T.js";import"./chunk-NXF2KNQV.js";import"./chunk-UWAYE735.js";import{a as Br,b as He}from"./chunk-M3ZVAEY4.js";import{a as Q}from"./chunk-TTBTOS3B.js";import{e as Wr,h as N,i as Ci}from"./chunk-H6OFU7D5.js";import"./chunk-6VUJL4LU.js";import{b as W}from"./chunk-PMKLCODP.js";import"./chunk-RZN6NBPT.js";import"./chunk-CJJZJDMF.js";import{C as gi,D as $t,E as en,K as an,N as Le,O as rn,j as yr,m as Dr,t as Pr,u as Zt,v as Jt,w as Y}from"./chunk-MWMKT4YA.js";import{ga as le,ha as Ki}from"./chunk-ZK4PRXMK.js";import{A as Lr,B as nn,C as Rr,D as ei,L as fi,O as kr,g as re,o as Or,s as tn}from"./chunk-OTTXNYU5.js";import"./chunk-BSKYOCR4.js";import"./chunk-GIKR6Y2K.js";import{a as $i,d as z}from"./chunk-KXV5M2KV.js";import{b as qi}from"./chunk-LAO3WZ2T.js";import{a as ur,b as _r}from"./chunk-DHDHZ4XD.js";import{a as dr}from"./chunk-KAD4FFMP.js";import{a as _i}from"./chunk-2FWFPV5I.js";import{ja as sr,ka as Ui,sa as cr}from"./chunk-XQ7RY4AB.js";import{D as Xt,E as mr,a as or,b as lr,c as Ge,h as O,o as L,q as pr}from"./chunk-L57WBNZV.js";import"./chunk-WDPD6NWE.js";import"./chunk-ZNCG2YIW.js";import{a as V,d as G}from"./chunk-4CRH5QZU.js";import"./chunk-67UENVPK.js";import{a as B}from"./chunk-RMEXQU4K.js";import{$ as Oa,$c as Yi,Aa as Li,Cb as Wi,Cc as M,Db as Ra,E as ri,Ea as Ri,Fb as Fi,Gb as Ii,Hb as n,Hc as ir,I as Ti,Ib as a,J as Ka,Jb as I,Jc as ji,Kb as se,Kc as nr,L as za,La as Ct,Lb as ce,Mb as er,Mc as bi,Md as Oe,Nb as F,Od as ui,P as Oi,Pb as T,Pd as A,Qb as s,Rd as Ei,Tb as ot,Tc as Ae,Td as Ke,Ua as Pe,Va as ki,Vc as j,Wc as k,X as Rt,Yb as Ni,Zb as Ai,Zc as ar,_a as r,_b as Gi,bd as ee,cb as D,cc as lt,dc as p,dd as te,ea as kt,ec as w,fc as v,gc as Kt,gd as zt,ha as Xa,ia as Za,ic as C,ja as si,jb as E,jc as x,kb as ci,kc as h,ma as Ye,mc as Hi,nb as R,nc as b,o as mi,oc as U,pb as g,pc as de,qc as st,rc as Qt,sc as Qi,t as Gt,tb as Ht,tc as tr,u as Ba,ua as u,ub as m,ud as rr,va as _,vb as Ja,wb as Pi,wc as d,xc as f,ya as La,yb as $a,yc as y,zc as di}from"./chunk-2PTKV6NN.js";import{a as Ze,b as $e,e as Jo,g as Ut}from"./chunk-7DCB7DB2.js";var Qa=Jo((RI,ha)=>{(function(i){typeof ha=="object"&&ha.exports?(i.default=i,ha.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(o,t,l,S){o.hasOwnProperty(t)||(o[t]=S.apply(null,l),typeof CustomEvent=="function"&&i.win.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:o[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 o(l,S,P,Ee,xt,dt){let Vt=(dt-S)*(P-l)-(Ee-S)*(xt-l);return Vt>0||!(Vt<0)}function t(l,S,P,Ee,xt,dt,Vt,Wt){return o(l,S,xt,dt,Vt,Wt)!==o(P,Ee,xt,dt,Vt,Wt)&&o(l,S,P,Ee,xt,dt)!==o(l,S,P,Ee,Vt,Wt)}return{boxIntersectLine:function(l,S,P,Ee,xt,dt,Vt,Wt){return t(l,S,l+P,S,xt,dt,Vt,Wt)||t(l+P,S,l+P,S+Ee,xt,dt,Vt,Wt)||t(l,S+Ee,l+P,S+Ee,xt,dt,Vt,Wt)||t(l,S,l,S+Ee,xt,dt,Vt,Wt)},intersectRect:function(l,S){return!(S.left>l.right||S.right<l.left||S.top>l.bottom||S.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(o,t,l,S,P,Ee,xt){let{animObject:dt}=o,{format:Vt}=t,{setOptions:Wt}=l,{composed:qo}=S,{boxIntersectLine:ja,intersectRect:Uo}=Ee,{addEvent:Ya,extend:qa,fireEvent:Ko,isNumber:Vi,pick:jt,pushUnique:zo,syncTimeout:Xo}=xt;function li(ct,Me,nt,ve,Tt){let et=ct.chart,$=ct.options.label||{},ze=jt($.onArea,!!ct.area),je=ze||$.connectorAllowed,pt=et.boxesToAvoid,Bt=Number.MAX_VALUE,Pt=Number.MAX_VALUE,ht,ut,_t,Yt,Ft,Xe,be;for(Xe=0;pt&&Xe<pt.length;Xe+=1)if(Uo(pt[Xe],{left:Me,right:Me+ve.width,top:nt,bottom:nt+ve.height}))return!1;for(Xe=0;Xe<et.series.length;Xe+=1){let at=et.series[Xe],Ve=at.interpolatedPoints&&[...at.interpolatedPoints];if(at.visible&&Ve){let Ue=et.plotHeight/10;for(let Je=et.plotTop;Je<=et.plotTop+et.plotHeight;Je+=Ue)Ve.unshift({chartX:et.plotLeft,chartY:Je}),Ve.push({chartX:et.plotLeft+et.plotWidth,chartY:Je});for(be=1;be<Ve.length;be+=1){if(Ve[be].chartX>=Me-16&&Ve[be-1].chartX<=Me+ve.width+16){if(ja(Me,nt,ve.width,ve.height,Ve[be-1].chartX,Ve[be-1].chartY,Ve[be].chartX,Ve[be].chartY))return!1;ct===at&&!_t&&Tt&&(_t=ja(Me-16,nt-16,ve.width+32,ve.height+32,Ve[be-1].chartX,Ve[be-1].chartY,Ve[be].chartX,Ve[be].chartY))}(je||_t)&&(ct!==at||ze)&&(Bt=Math.min(Bt,(Yt=Me+ve.width/2-Ve[be].chartX)*Yt+(Ft=nt+ve.height/2-Ve[be].chartY)*Ft))}if(!ze&&je&&ct===at&&(Tt&&!_t||Bt<Math.pow($.connectorNeighbourDistance||1,2))){for(be=1;be<Ve.length;be+=1)(ht=Math.min(Math.pow(Me+ve.width/2-Ve[be].chartX,2)+Math.pow(nt+ve.height/2-Ve[be].chartY,2),Math.pow(Me-Ve[be].chartX,2)+Math.pow(nt-Ve[be].chartY,2),Math.pow(Me+ve.width-Ve[be].chartX,2)+Math.pow(nt-Ve[be].chartY,2),Math.pow(Me+ve.width-Ve[be].chartX,2)+Math.pow(nt+ve.height-Ve[be].chartY,2),Math.pow(Me-Ve[be].chartX,2)+Math.pow(nt+ve.height-Ve[be].chartY,2)))<Pt&&(Pt=ht,ut=Ve[be]);_t=!0}}}return(!Tt||!!_t)&&{x:Me,y:nt,weight:Bt-(ut?Pt:0),connectorPoint:ut}}function Ua(ct){if(this.renderer){let Me=this,nt=dt(Me.renderer.globalAnimation).duration;Me.labelSeries=[],Me.labelSeriesMaxSum=0,Me.seriesLabelTimer&&xt.clearTimeout(Me.seriesLabelTimer),Me.series.forEach(function(ve){let Tt=ve.options.label||{},et=ve.labelBySeries,$=et&&et.closest;Tt.enabled&&ve.visible&&(ve.graph||ve.area)&&!ve.boosted&&Me.labelSeries&&(Me.labelSeries.push(ve),Tt.minFontSize&&Tt.maxFontSize&&ve.yData&&(ve.sum=ve.yData.reduce((ze,je)=>(ze||0)+(je||0),0),Me.labelSeriesMaxSum=Math.max(Me.labelSeriesMaxSum||0,ve.sum||0)),ct.type==="load"&&(nt=Math.max(nt,dt(ve.options.animation).duration)),$&&($[0].plotX!==void 0?et.animate({x:$[0].plotX+$[1],y:$[0].plotY+$[2]}):et.attr({opacity:0})))}),Me.seriesLabelTimer=Xo(function(){Me.series&&Me.labelSeries&&function(ve){ve.boxesToAvoid=[];let Tt=ve.labelSeries||[],et=ve.boxesToAvoid;ve.series.forEach($=>($.points||[]).forEach(ze=>(ze.dataLabels||[]).forEach(je=>{let{width:pt,height:Bt}=je.getBBox(),Pt=(je.translateX||0)+($.xAxis?$.xAxis.pos:$.chart.plotLeft),ht=(je.translateY||0)+($.yAxis?$.yAxis.pos:$.chart.plotTop);et.push({left:Pt,top:ht,right:Pt+pt,bottom:ht+Bt})}))),Tt.forEach(function($){let ze=$.options.label||{};$.interpolatedPoints=function(je){let pt,Bt,Pt,ht,ut;if(!je.xAxis&&!je.yAxis)return;let _t=je.points,Yt=[],Ft=je.graph||je.area,Xe=Ft&&Ft.element,be=je.chart.inverted,at=je.xAxis,Ve=je.yAxis,Ue=be?Ve.pos:at.pos,Je=be?at.pos:Ve.pos,Dt=be?at.len:Ve.len,wi=be?Ve.len:at.len,gt=jt((je.options.label||{}).onArea,!!je.area),We=Ve.getThreshold(je.options.threshold),vt={},qt=be?"chartCenterX":"chartCenterY";function ai(tt){let St=Math.round((tt.plotX||0)/8)+","+Math.round((tt.plotY||0)/8);vt[St]||(vt[St]=1,Yt.push(tt))}if(je.getPointSpline&&Xe&&Xe.getPointAtLength&&!gt&&_t.length<(je.chart.plotSizeX||0)/16){let tt=Ft.toD&&Ft.attr("d");for(Ft.toD&&Ft.attr({d:Ft.toD}),Pt=Xe.getTotalLength(),pt=0;pt<Pt;pt+=16){let Lt=Xe.getPointAtLength(pt),ft=be?wi-Lt.y:Lt.x,mt=be?Dt-Lt.x:Lt.y;ai({chartX:Ue+ft,chartY:Je+mt,plotX:ft,plotY:mt})}tt&&Ft.attr({d:tt});let St=_t[_t.length-1].pos();ai({chartX:Ue+(St?.[0]||0),chartY:Je+(St?.[1]||0)})}else{let tt;for(pt=0,Pt=_t.length;pt<Pt;pt+=1){let St=_t[pt],[Lt,ft]=St.pos()||[],{plotHigh:mt}=St;if(Vi(Lt)&&Vi(ft)){let rt={plotX:Lt,plotY:ft,chartX:Ue+Lt,chartY:Je+ft};if(gt&&(mt&&(rt.plotY=mt,rt.chartY=Je+mt),be?rt.chartCenterX=Ue+wi-((mt||St.plotY||0)+jt(St.yBottom,We))/2:rt.chartCenterY=Je+((mt||ft)+jt(St.yBottom,We))/2),tt&&(Bt=Math.max(Math.abs(rt.chartX-tt.chartX),Math.abs(rt.chartY-tt.chartY)))>16)for(ut=1,ht=Math.ceil(Bt/16);ut<ht;ut+=1)ai({chartX:tt.chartX+(rt.chartX-tt.chartX)*(ut/ht),chartY:tt.chartY+(rt.chartY-tt.chartY)*(ut/ht),[qt]:(tt[qt]||0)+((rt[qt]||0)-(tt[qt]||0))*(ut/ht),plotX:(tt.plotX||0)+(Lt-(tt.plotX||0))*(ut/ht),plotY:(tt.plotY||0)+(ft-(tt.plotY||0))*(ut/ht)});ai(rt),tt=rt}}}return Yt}($),et.push(...ze.boxesToAvoid||[])}),ve.series.forEach(function($){let ze=$.options.label;if(!ze||!$.xAxis&&!$.yAxis)return;let je="highcharts-color-"+jt($.colorIndex,"none"),pt=!$.labelBySeries,Bt=ze.minFontSize,Pt=ze.maxFontSize,ht=ve.inverted,ut=ht?$.yAxis.pos:$.xAxis.pos,_t=ht?$.xAxis.pos:$.yAxis.pos,Yt=ve.inverted?$.yAxis.len:$.xAxis.len,Ft=ve.inverted?$.xAxis.len:$.yAxis.len,Xe=$.interpolatedPoints,be=jt(ze.onArea,!!$.area),at=[],Ve=$.xData||[],Ue,Je,Dt,wi,gt,We,vt=$.labelBySeries,qt,ai,tt;function St(ft,mt,rt){let Bi=Math.max(ut,jt(ai,-1/0)),pi=Math.min(ut+Yt,jt(tt,1/0));return ft>Bi&&ft<=pi-rt.width&&mt>=_t&&mt<=_t+Ft-rt.height}function Lt(){vt&&($.labelBySeries=vt.destroy())}if(be&&!ht&&(qt=[$.xAxis.toPixels(Ve[0]),$.xAxis.toPixels(Ve[Ve.length-1])],ai=Math.min.apply(Math,qt),tt=Math.max.apply(Math,qt)),$.visible&&!$.boosted&&Xe){if(!vt){let ft=$.name;if(typeof ze.format=="string"?ft=Vt(ze.format,$,ve):ze.formatter&&(ft=ze.formatter.call($)),$.labelBySeries=vt=ve.renderer.label(ft,0,0,"connector",0,0,ze.useHTML).addClass("highcharts-series-label highcharts-series-label-"+$.index+" "+($.options.className||"")+" "+je),!ve.renderer.styledMode){let mt=typeof $.color=="string"?$.color:"#666666";vt.css(qa({color:be?ve.renderer.getContrast(mt):mt},ze.style||{})),vt.attr({opacity:ve.renderer.forExport?1:0,stroke:$.color,"stroke-width":1})}Bt&&Pt&&vt.css({fontSize:Bt+($.sum||0)/($.chart.labelSeriesMaxSum||0)*(Pt-Bt)+"px"}),vt.attr({padding:0,zIndex:3}).add()}for((Ue=vt.getBBox()).width=Math.round(Ue.width),gt=Xe.length-1;gt>0;gt-=1)be?St(Je=(Xe[gt].chartCenterX??Xe[gt].chartX)-Ue.width/2,Dt=(Xe[gt].chartCenterY??Xe[gt].chartY)-Ue.height/2,Ue)&&(We=li($,Je,Dt,Ue)):(St(Je=Xe[gt].chartX+3,Dt=Xe[gt].chartY-Ue.height-3,Ue)&&(We=li($,Je,Dt,Ue,!0)),We&&at.push(We),St(Je=Xe[gt].chartX+3,Dt=Xe[gt].chartY+3,Ue)&&(We=li($,Je,Dt,Ue,!0)),We&&at.push(We),St(Je=Xe[gt].chartX-Ue.width-3,Dt=Xe[gt].chartY+3,Ue)&&(We=li($,Je,Dt,Ue,!0)),We&&at.push(We),St(Je=Xe[gt].chartX-Ue.width-3,Dt=Xe[gt].chartY-Ue.height-3,Ue)&&(We=li($,Je,Dt,Ue,!0))),We&&at.push(We);if(ze.connectorAllowed&&!at.length&&!be)for(Je=ut+Yt-Ue.width;Je>=ut;Je-=16)for(Dt=_t;Dt<_t+Ft-Ue.height;Dt+=16)(wi=li($,Je,Dt,Ue,!0))&&at.push(wi);if(at.length){at.sort((mt,rt)=>rt.weight-mt.weight),We=at[0],(ve.boxesToAvoid||[]).push({left:We.x,right:We.x+Ue.width,top:We.y,bottom:We.y+Ue.height});let ft=Math.sqrt(Math.pow(Math.abs(We.x-(vt.x||0)),2)+Math.pow(Math.abs(We.y-(vt.y||0)),2));if(ft&&$.labelBySeries){let mt,rt={opacity:ve.renderer.forExport?1:0,x:We.x,y:We.y},Bi={opacity:1};ft<=10&&(Bi={x:rt.x,y:rt.y},rt={}),pt&&(mt=dt($.options.animation),mt.duration*=.2),$.labelBySeries.attr(qa(rt,{anchorX:We.connectorPoint&&(We.connectorPoint.plotX||0)+ut,anchorY:We.connectorPoint&&(We.connectorPoint.plotY||0)+_t})).animate(Bi,mt),$.options.kdNow=!0,$.buildKDTree();let pi=$.searchPoint({chartX:We.x,chartY:We.y},!0);pi&&(vt.closest=[pi,We.x-(pi.plotX||0),We.y-(pi.plotY||0)])}}else Lt()}else Lt()}),Ko(ve,"afterDrawSeriesLabels")}(Me)},Me.renderer.forExport||!nt?0:nt)}}function Zo(ct,Me,nt,ve,Tt){let et=Tt&&Tt.anchorX,$=Tt&&Tt.anchorY,ze,je,pt=nt/2;return Vi(et)&&Vi($)&&(ze=[["M",et,$]],(je=Me-$)<0&&(je=-ve-je),je<nt&&(pt=et<ct+nt/2?je:nt-je),$>Me+ve?ze.push(["L",ct+pt,Me+ve]):$<Me?ze.push(["L",ct+pt,Me]):et<ct?ze.push(["L",ct,Me+ve/2]):et>ct+nt&&ze.push(["L",ct+nt,Me+ve/2])),ze||[]}return{compose:function(ct,Me){zo(qo,"SeriesLabel")&&(Ya(ct,"load",Ua),Ya(ct,"redraw",Ua),Me.prototype.symbols.connector=Zo,Wt({plotOptions:{series:{label:P}}}))}}}),e(c,"masters/modules/series-label.src.js",[c["Core/Globals.js"],c["Extensions/SeriesLabel/SeriesLabel.js"]],function(o,t){return t.compose(o.Chart,o.SVGRenderer),o})})});var oo=(i,c)=>({"text-success":i,"text-danger":c});function $o(i,c){if(i&1&&(se(0),n(1,"span"),p(2),d(3,"number"),a(),ce()),i&2){let e=c.ngIf;r(2),v(" ",y(3,1,e.Quantity,"1.0-0")," ")}}function el(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 tl(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;r(7),v(" ",f(8,2,e.Cost)," "),r(4),v(" ",y(12,4,e.CostRatio,"1.0-2"),"% ")}}function il(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;r(6),m("ngClass",de(9,oo,e.Profit>0,e.Profit<0)),r(),v(" ",f(8,4,e.Profit)," "),r(3),m("ngClass",de(12,oo,e.ProfitRatio>0,e.ProfitRatio<0)),r(),v("",y(12,6,e.ProfitRatio,"1.0-2"),"%")}}function nl(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,$o,4,4,"ng-container",6),d(25,"async"),g(26,el,2,0,"ng-template",null,0,M),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,tl,13,7,"ng-container",3)(74,il,13,15,"ng-container",3),a()(),ce()),i&2){let e=c.ngIf,o=lt(27),t=s();r(8),w(f(9,12,e.Orders)),r(8),w(f(17,14,e.Quantity)),r(8),m("ngIf",f(25,16,t.complementaryQuantity$))("ngIfElse",o),r(10),w(f(35,18,e.GrossSales)),r(9),v(" ",f(44,20,e.Discount)," "),r(4),v(" ",y(48,22,e.DiscountRatio,"1.0-2"),"% "),r(7),w(f(55,25,e.Sales)),r(8),w(f(63,27,e.Tax)),r(8),w(f(71,29,e.SalesWithTax)),r(3),m("ngIf",t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost),r(),m("ngIf",t.roleService.report.Profit)}}var sn=class i{constructor(c,e,o,t){this.httpService=c;this.roleService=e;this.dialogRef=o;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(Gt(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 gi,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,o){let t=0;return this.data?.IncludeTax&&(e+=o),e!=0&&(t=c/e*100),t}profitRatioCalculation(c,e,o){let t=0;return this.data?.IncludeTax&&(e+=o),e!=0&&(t=c/e*100),t}discountPercentageCalc(c=0,e=0,o=0){return c/(e-o)*100}loadComplementaryQuantity(){this.complementaryQuantity$=this.httpService.post("/api/Report/ReportDetailComplementaryQuantity",this.data.Filter).pipe(Rt())}static \u0275fac=function(e){return new(e||i)(D(B),D(G),D(Zt),D(Jt))};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,o){e&1&&(n(0,"modal-material",1),T("onClose",function(){return o.dialogRef.close()}),n(1,"content")(2,"div",2),g(3,nl,75,31,"ng-container",3),d(4,"async"),a()()()),e&2&&(m("config",o.modalConfig),r(3),m("ngIf",f(4,2,o.reportSummary$)))},dependencies:[Ae,k,$t,Yi,te,X,Z],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 al=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],lo=i=>({ID:i});function rl(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 ol(i,c){if(i&1&&(n(0,"div",4),g(1,rl,3,0,"button",5),a()),i&2){let e=s();r(),m("ngIf",e.roleService.global.Export)}}function ll(i,c){if(i&1){let e=F();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",11),h("dateChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",15),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",16),h("modelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",17),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",18),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",19),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",20),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",22),h("modelChange",function(t){u(e);let l=s();return x(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),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",25),h("modelChange",function(t){u(e);let l=s();return x(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();r(3),m("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("ngModel",e.pageData.Filter.CustomerID),r(3),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.SalesID),r(3),m("items",e.pageData.Options.ContactGroups),C("ngModel",e.pageData.Filter.ContactGroupID),r(3),C("model",e.pageData.Filter.Bin),r(3),m("items",e.pageData.Options.Types),C("ngModel",e.pageData.Filter.TypeID),r(3),m("items",e.pageData.Options.Currencies),C("ngModel",e.pageData.Filter.CurrencyID),r(3),m("items",e.pageData.Options.Deliveries),C("ngModel",e.pageData.Filter.DeliveryStateID),r(3),C("ngModel",e.pageData.Filter.PaymentStateID),m("items",e.pageData.Options==null?null:e.pageData.Options.States),r(3),C("ngModel",e.pageData.Filter.CreatorID),m("renderThumbnail",!1),r(3),C("model",e.pageData.Filter.NoteVisible),r(4),m("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),C("ngModel",e.pageData.Filter.QueryOption),r(3),C("model",e.pageData.Filter.DefaultFilterColumn),m("options",e.pageData.Options.DefaultFilterColumnOptions)}}function pl(i,c){i&1&&(n(0,"th",44),p(1," @ Cost "),a())}function ml(i,c){if(i&1&&(n(0,"small",60),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;r(),w(y(2,1,e.CustomerNameDisplay," - {0}"))}}function sl(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;r(),w(y(2,1,e.SalesName," - Sales: {0}"))}}function cl(i,c){if(i&1&&(n(0,"span",60),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;r(),v(" "," - Profit: "+f(2,1,e.Profit)," ")}}function dl(i,c){if(i&1&&(n(0,"i",61),p(1),a()),i&2){let e=s().$implicit;r(),v(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function ul(i,c){if(i&1&&(n(0,"span",62),p(1),a()),i&2){let e=s().$implicit;r(),v(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function _l(i,c){i&1&&(n(0,"span"),p(1,"-"),a())}function gl(i,c){if(i&1&&(se(0),I(1,"div",63),d(2,"newlines"),ce()),i&2){let e=s().$implicit;r(),m("innerHTML",f(2,1,e.SONote),Pe)}}function fl(i,c){if(i&1&&(se(0),n(1,"div")(2,"a",64),p(3),a()(),ce()),i&2){let e=s().$implicit;r(2),m("queryParams",U(2,lo,e.ReferenceInvoiceID)),r(),v(" Return ",e.ReferenceInvoiceNumber," ")}}function Cl(i,c){if(i&1&&(n(0,"i",78),p(1),a()),i&2){let e=s().$implicit;r(),v(" sold by ",e.Commissions.SalesName," ")}}function xl(i,c){if(i&1&&(n(0,"th",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e==null?null:e.UnitCost)," ")}}function hl(i,c){if(i&1&&(n(0,"tr",65)(1,"th",30)(2,"div",66)(3,"span",67),p(4),a(),g(5,Cl,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,xl,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,o=s(3);r(4),w(e==null?null:e.Name),r(),m("ngIf",(e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName),r(),m("innerHtml",e==null?null:e.Note,Pe),r(2),v(" ",e==null?null:e.Code," "),r(2),v(" ",f(11,11,e==null?null:e.Quantity)," "),r(3),v(" ",e==null?null:e.UOMName," "),r(),m("ngIf",o.roleService.product.Cost),r(2),v(" ",f(17,13,e==null?null:e.UnitPrice)," "),r(4),v(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),r(2),v(" ",(e==null?null:e.DiscountAmount)==0?"":f(23,15,e==null?null:e.DiscountAmount)," "),r(3),v(" ",f(26,17,e==null?null:e.Total)," ")}}function Sl(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;r(3),v("",e.Label," :"),r(2),v(" ",e.CurrencySymbol," "),r(2),v(" ",f(8,3,e.Amount)," ")}}function yl(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,ml,3,4,"small",50),a()(),n(13,"div",51)(14,"strong",52),p(15),g(16,sl,3,4,"span",3),a(),g(17,cl,3,3,"span",50)(18,dl,2,1,"i",53)(19,ul,2,1,"span",54)(20,_l,2,0,"span",3),a(),g(21,gl,3,3,"ng-container",3)(22,fl,4,4,"ng-container",3),a(),n(23,"div",55),p(24),a()(),n(25,"table",56)(26,"tbody",57),g(27,hl,27,19,"tr",58),a()(),n(28,"table",59),g(29,Sl,9,5,"ng-container",37),a()()),i&2){let e=c.$implicit,o=s(2);r(4),m("routerLink",b(23,al))("queryParams",U(24,lo,e.ID)),r(2),v(" ",e.EntityName+" # "+e.Number,""),r(2),v(" "," - "+y(9,17,e.Date,"dd MMM yyyy")," "),r(2),m("innerHtml","("+y(11,20,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Pe),r(2),m("ngIf",o.isNotEmpty(e.CustomerNameDisplay)),r(3),v(" ","[Q: "+e.TotalItemQuantity+"]"," "),r(),m("ngIf",o.isNotEmpty(e.SalesName)),r(),m("ngIf",o.roleService.report.Profit),r(),m("ngIf",o.isNotEmpty(e.DeliveryOutlet)),r(),m("ngIf",o.isNotEmpty(e.PromotionCoupon)),r(),m("ngIf",e.SONote&&e.PromotionCoupon),r(),m("ngIf",o.isNotEmpty(e.SONote)),r(),m("ngIf",o.isNotEmpty(e.ReferenceInvoiceID)),r(2),v(" ",e.PaymentStateLabel," "),r(3),m("ngForOf",e.Items),r(2),m("ngForOf",e.Aggregate)}}function Dl(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 vl(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);r(),w(f(2,1,e.listTotal))}}function wl(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 Tl(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,pl,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,yl,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,Dl,3,0,"span",43)(34,vl,3,3,"span",3),p(35),a()(),g(36,wl,4,0,"div",2),a()()()}if(i&2){let e=s();r(14),m("ngIf",e.roleService.product.Cost),r(9),Ht("colspan",e.roleService.product.Cost?8:7),r(),m("ngForOf",e.infiniteList),r(7),v(" Showing 1 - ",f(32,8,e.infiniteList.length)," of "),r(2),m("ngIf",!e.pageData.HideStoreApiCount),r(),m("ngIf",e.pageData.HideStoreApiCount),r(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),r(),m("ngIf",e.nextPageDisabled)}}var cn=class i extends he{constructor(e,o,t,l,S,P,Ee,xt){super(e,o,"Report/ReportDetail","ReportLoader/ReportDetail",null,S);this.csvConverter=t;this.datePipe=l;this.activatedRoute=S;this.matDialog=P;this.toaster=Ee;this.roleService=xt}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,V.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),V.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),V.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return V.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To);this.matDialog.open(q,{data:{title:"Sales by Transaction",exportTypes:[{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"},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns"},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(sn,{data:this.pageData})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(ee),D(Oe),D(Y),D(Ke),D(G))};static \u0275cmp=E({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[R],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn-group",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["name","Bin",3,"modelChange","model"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Fulfillment",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","NoteVisible",3,"modelChange","model"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],["class","text-end","style","width: 80px",4,"ngIf"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[4,"ngFor","ngForOf"],[1,"text-center"],["role","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"text-end",2,"width","80px"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],["class","fw-bold",4,"ngIf"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote",4,"ngIf"],["class","d-inline-block fst-italic",4,"ngIf"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],["class","border-start border-end",4,"ngFor","ngForOf"],[1,"table","table-sm","table-borderless"],[1,"fw-bold"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"border-start","border-end"],[1,"lh-base"],[1,"fw-normal"],["class","text-warning inlineMarginLeft",4,"ngIf"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],["class","fw-normal text-end border-start border-end","style","width: 80px",4,"ngIf"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %",1,"text-danger"],["matTooltipPosition","above","matTooltip","Disc Amount",1,"text-danger"],[1,"text-warning","inlineMarginLeft"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,ol,2,1,"div",2),a(),n(3,"filters"),g(4,ll,46,26,"ng-template",null,0,M),a(),g(6,Tl,37,10,"content",3),a()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService.global.Export),r(4),m("ngIf",t.data))},dependencies:[N,j,k,A,z,K,O,L,le,we,Le,Q,Qe,Or,tn,te,ee,X,Z],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 dn=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 gi;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(D(Zt),D(Jt))};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,o){e&1&&(n(0,"modal-material",0),T("onOk",function(){return o.onOk()})("onCancel",function(){return o._dialogRef.close()})("onClose",function(){return o._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),h("ngModelChange",function(l){return x(o.ExportPageNumber,l)||(o.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),h("ngModelChange",function(l){return x(o.ExportRowCount,l)||(o.ExportRowCount=l),l}),a()()()()()),e&2&&(m("title","Export Report")("config",o.modalConfig),r(6),C("ngModel",o.ExportPageNumber),r(4),C("ngModel",o.ExportRowCount),m("max",1e4))},dependencies:[Ge,O,L,He,$t],encapsulation:2})};var Fl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],po=i=>({ID:i}),Il=()=>["/menu/Contacts/Contact/Customers/Info"],bl=(i,c,e)=>({"text-success":i,"text-warning":c,"text-danger":e});function El(i,c){if(i&1){let e=F();n(0,"button",15),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",16),p(2," Export "),a()}}function Ml(i,c){if(i&1){let e=F();se(0),n(1,"div",29)(2,"div",30)(3,"datepicker",31),h("dateChange",function(t){u(e);let l=s(3);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s(3);return _(t.onFilterFromDate())}),a()(),n(4,"div",32)(5,"app-timepicker",33),h("timeChange",function(t){u(e);let l=s(3);return x(l.timeFrom,t)||(l.timeFrom=t),_(t)}),T("timeChange",function(t){u(e);let l=s(3);return _(l.timeFromChange(t))}),a()()(),n(6,"div",34)(7,"div",30)(8,"datepicker",35),h("dateChange",function(t){u(e);let l=s(3);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s(3);return _(t.onFilterFromDate())}),a()(),n(9,"div",32)(10,"app-timepicker",33),h("timeChange",function(t){u(e);let l=s(3);return x(l.timeTo,t)||(l.timeTo=t),_(t)}),T("timeChange",function(t){u(e);let l=s(3);return _(l.timeToChange(t))}),a()()(),ce()}if(i&2){let e=s(3);r(3),C("date",e.pageData.Filter.From),r(2),C("time",e.timeFrom),r(3),C("date",e.pageData.Filter.To),r(2),C("time",e.timeTo)}}function Vl(i,c){if(i&1){let e=F();n(0,"datepicker",36),h("dateChange",function(t){u(e);let l=s(3);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s(3);return _(t.onFilterFromDate())}),a(),n(1,"div",37)(2,"datepicker",38),h("dateChange",function(t){u(e);let l=s(3);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s(3);return _(t.onFilterToDate())}),a()()}if(i&2){let e=s(3);C("date",e.pageData.Filter.From),m("appearance","outline")("width",100),r(2),C("date",e.pageData.Filter.To),m("appearance","outline")("width",100)}}function Bl(i,c){if(i&1){let e=F();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",20),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",21),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",22),h("modelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),g(18,Ml,11,4,"ng-container",23)(19,Vl,3,6,"ng-template",null,1,M),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",24),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(24,"h6"),p(25,"Customer Groups"),a(),n(26,"ng-select",25),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",26),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",27),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",28),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=lt(20),o=s(2);r(3),m("accessType",2)("multiple",!0),C("ngModel",o.pageData.Filter.ListIDs),m("outlets",o.pageData.Options==null?null:o.pageData.Options.Entities),r(3),C("ngModel",o.pageData.Filter.CustomerID),m("inputTextValue",o.pageData.CustomerName),r(3),C("ngModel",o.pageData.Filter.SalesID),r(3),C("ngModel",o.pageData.Filter.SalesOrderTagID),m("items",o.pageData.Options.SalesOrderTags),r(3),m("options",o.pageData.Options.DefaultFilterColumnOptions),C("model",o.pageData.Filter.DefaultFilterColumn),r(3),m("ngIf",o.pageData.Filter.isCreated)("ngIfElse",e),r(5),C("ngModel",o.pageData.Filter.RegisterID),m("items",o.pageData.Options.Registers),r(3),C("ngModel",o.pageData.Filter.CustomerGroupID),m("items",o.pageData.Options.Groups),r(3),C("ngModel",o.pageData.Filter.PaymentState),m("items",o.pageData.Options.States),r(3),C("ngModel",o.pageData.Filter.CreatorID),r(3),m("max",1e4),C("ngModel",o.pageData.Filter.RowCount)}}function Ol(i,c){i&1&&(n(0,"th",56),p(1,"DATE"),a())}function Ll(i,c){i&1&&(n(0,"th",57),p(1," CUSTOMER "),a())}function Rl(i,c){i&1&&(n(0,"th",58),p(1," SALES PERSON "),a())}function kl(i,c){i&1&&(n(0,"th",59),p(1," COST "),a())}function Wl(i,c){i&1&&(n(0,"th",60),p(1," GROSS "),a())}function Nl(i,c){i&1&&(n(0,"th",61),p(1," SALES "),a())}function Al(i,c){i&1&&(n(0,"th",62),p(1," TAX "),a())}function Gl(i,c){i&1&&(n(0,"th",63),p(1," SURCHARGE "),a())}function Hl(i,c){i&1&&(n(0,"th",64),p(1," TOTAL "),a())}function Ql(i,c){i&1&&(n(0,"th",65),p(1," PAYMENT "),a())}function jl(i,c){i&1&&I(0,"br")}function Yl(i,c){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=s().$implicit;r(),w(e.Note)}}function ql(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;r(2),v(" ",y(3,2,e.Date,"dd MMM yy")," "),r(3),v(" ",y(6,5,e.Created,"HH:mm")," ")}}function Ul(i,c){if(i&1&&(n(0,"td")(1,"a",71),p(2),a()()),i&2){let e=s().$implicit;r(),m("routerLink",b(3,Il))("queryParams",U(4,po,e.CustomerID)),r(),w(e.CustomerName)}}function Kl(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;r(),v(" ",e.SalesName," ")}}function zl(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Cost)," ")}}function Xl(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Gross)," ")}}function Zl(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Sales)," ")}}function Jl(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Tax)," ")}}function $l(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.SurchargeAmount)," ")}}function ep(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.SalesNSurcharge)," ")}}function tp(i,c){if(i&1&&(n(0,"td",75),p(1),a()),i&2){let e=s().$implicit;m("ngClass",st(2,bl,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),r(),v(" ",e.PaymentStateString," ")}}function ip(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",66),p(5),a(),g(6,jl,1,0,"br",11)(7,Yl,2,1,"i",11),a(),g(8,ql,7,8,"td",11)(9,Ul,3,6,"td",11)(10,Kl,2,1,"td",11)(11,zl,3,3,"td",67)(12,Xl,3,3,"td",68)(13,Zl,3,3,"td",68)(14,Jl,3,3,"td",69)(15,$l,3,3,"td",68)(16,ep,3,3,"td",68)(17,tp,2,6,"td",70),a()),i&2){let e=c.$implicit,o=s(3);r(2),w(e.EntityName),r(2),m("routerLink",b(16,Fl))("queryParams",U(17,po,e.ID)),r(),v(" ",e.Number," "),r(),m("ngIf",e.Note),r(),m("ngIf",e.Note),r(),m("ngIf",o.column.Date.selected),r(),m("ngIf",o.column.Customer.selected),r(),m("ngIf",o.column.SalesPerson.selected),r(),m("ngIf",o.roleService.product.Cost&&o.column.Cost.selected),r(),m("ngIf",o.column.Gross.selected),r(),m("ngIf",o.column.Sales.selected),r(),m("ngIf",o.data.TaxVisible&&o.column.Tax.selected),r(),m("ngIf",o.data.SurchargeVisible),r(),m("ngIf",o.column.Total.selected),r(),m("ngIf",o.column.Payment.selected)}}function np(i,c){i&1&&I(0,"td",78)}function ap(i,c){i&1&&I(0,"td",78)}function rp(i,c){i&1&&I(0,"td",78)}function op(i,c){i&1&&(n(0,"td",81),p(1," Total: "),a())}function lp(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);r(),v(" ",f(3,4,y(2,1,e.infiniteList,"Cost"))," ")}}function pp(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);r(),v(" ",f(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function mp(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);r(),v(" ",f(3,4,y(2,1,e.infiniteList,"Sales"))," ")}}function sp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);r(),v(" ",f(3,4,y(2,1,e.infiniteList,"Tax"))," ")}}function cp(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);r(),v(" ",f(3,4,y(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function dp(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);r(),v(" ",f(3,4,y(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function up(i,c){if(i&1&&(n(0,"tfoot",76)(1,"tr",77),I(2,"td",78),g(3,np,1,0,"td",79)(4,ap,1,0,"td",79)(5,rp,1,0,"td",79)(6,op,2,0,"td",80)(7,lp,4,6,"td",67)(8,pp,4,6,"td",68)(9,mp,4,6,"td",68)(10,sp,4,6,"td",69)(11,cp,4,6,"td",68)(12,dp,4,6,"td",68),a()()),i&2){let e=s(3);r(3),m("ngIf",e.column.Date.selected),r(),m("ngIf",e.column.Customer.selected),r(),m("ngIf",e.column.SalesPerson.selected),r(),m("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),r(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),r(),m("ngIf",e.column.Gross.selected),r(),m("ngIf",e.column.Sales.selected),r(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),r(),m("ngIf",e.data.SurchargeVisible),r(),m("ngIf",e.column.Total.selected)}}function _p(i,c){if(i&1){let e=F();n(0,"div",39)(1,"table",40),T("matSortChange",function(t){u(e);let l=s(2);return _(l.sortData(t))}),n(2,"thead",41)(3,"tr")(4,"th",42),p(5,"OUTLET"),a(),n(6,"th",43),p(7,"NUMBER"),a(),g(8,Ol,2,0,"th",44)(9,Ll,2,0,"th",45)(10,Rl,2,0,"th",46)(11,kl,2,0,"th",47)(12,Wl,2,0,"th",48)(13,Nl,2,0,"th",49)(14,Al,2,0,"th",50)(15,Gl,2,0,"th",51)(16,Hl,2,0,"th",52)(17,Ql,2,0,"th",53),a()(),n(18,"tbody"),g(19,ip,18,19,"tr",54),a(),g(20,up,13,10,"tfoot",55),a()()}if(i&2){let e=s(2);r(8),m("ngIf",e.column.Date.selected),r(),m("ngIf",e.column.Customer.selected),r(),m("ngIf",e.column.SalesPerson.selected),r(),m("ngIf",e.column.Cost.role&&e.column.Cost.selected),r(),m("ngIf",e.column.Gross.selected),r(),m("ngIf",e.column.Sales.selected),r(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),r(),m("ngIf",e.data.SurchargeVisible),r(),m("ngIf",e.column.Total.selected),r(),m("ngIf",e.column.Payment.selected),r(2),m("ngForOf",e.infiniteList),r(),m("ngIf",e.data)}}function gp(i,c){if(i&1){let e=F();n(0,"span",82),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",83),p(2,"?"),a()()}}function fp(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);r(),w(f(2,1,e.listTotal))}}function Cp(i,c){if(i&1){let e=F();n(0,"a",84),T("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),I(1,"i",85),p(2," Next"),a()}}function xp(i,c){if(i&1){let e=F();n(0,"a",86),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),I(1,"i",87),p(2," Last"),a()}}function hp(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",3),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),T("onChangeColumnCheckbox",function(){u(e);let t=s();return _(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,El,3,0,"button",4),a(),n(3,"filters"),g(4,Bl,36,22,"ng-template",null,0,M),a(),n(6,"content")(7,"div",5),g(8,_p,21,12,"div",6),n(9,"div",7)(10,"div",8)(11,"div",9),p(12),d(13,"number"),g(14,gp,3,0,"span",10)(15,fp,3,3,"span",11),p(16),a()(),n(17,"div",12),g(18,Cp,3,0,"a",13)(19,xp,3,0,"a",14),a()()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),m("column",e.column),r(2),m("ngIf",e.roleService.global.Export),r(6),m("ngIf",e.data),r(4),v(" Showing 1 - ",f(13,13,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),r(2),m("ngIf",!e.pageData.HideStoreApiCount),r(),m("ngIf",e.pageData.HideStoreApiCount),r(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),r(2),m("ngIf",e.nextPageDisabled&&!e.goToLast),r(),m("ngIf",e.nextPageDisabled&&!e.goToLast)}}var un=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=o;this.csvConverter=t;this._matDialog=S}roleService=Ye(G);columnService=Ye(It);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},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;filterInvoiceBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];isShowGross=!1;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("EntityIDs"),o=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:o,To:t})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}preInitList(){this.route.snapshot.queryParams.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let o=this.route.snapshot.queryParamMap.get("CustomerID");V.IsNotEmpty(o)&&(this.pageData.Filter.From=V.MinDate,this.pageData.Filter.To=V.MinDate)}afterPostInit(e){this.checkForAdvancedColumn()}openItemModal(e,o){this._matDialog.open(dn,{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,o),this.pageData.Filter.RowCount=0)})}sortData(e){let o=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=o;return}this.infiniteList=o.sort((t,l)=>{let S=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.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),S);case"number":return this.compare(t.Number,l.Number,S);case"date":return this.compare(t.Date,l.Date,S);case"customer":return this.compare(t.CustomerName.toLocaleLowerCase(),l.CustomerName.toLocaleLowerCase(),S);case"salesPerson":return this.compare(t.SalesName.toLocaleLowerCase(),l.SalesName.toLocaleLowerCase(),S);case"cost":return this.compare(t.Cost,l.Cost,S);case"gross":return this.compare(t.Gross,l.Gross,S);case"sales":return this.compare(t.Sales,l.Sales,S);case"tax":return this.compare(t.Tax,l.Tax,S);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,S);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,S);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,S);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:"Sales Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Sales Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Sales Summary with Taxable & TaxExempt"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(Oe),D(Y))};static \u0275cmp=E({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],["DATEONLY",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","column","onSubmit","filterChange","onChangeColumnCheckbox",4,"ngIf"],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[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"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more for 500 variants",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],[1,"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,"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","salesPerson",4,"ngIf"],["mat-sort-header","cost","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","gross","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","sales","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","tax","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","surcharge","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","total","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","payment","style","width: 50px",4,"ngIf"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","date"],["mat-sort-header","customer"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["mat-sort-header","total","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],["target","_blank",3,"routerLink","queryParams"],["class","text-end text-danger",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-start",3,"ngClass",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-start",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],["class","empty-column",4,"ngIf"],["class","text-end empty-column",4,"ngIf"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more for 500 variants",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(o,t){o&1&&g(0,hp,20,15,"mainpanel-cmp",2),o&2&&m("ngIf",t.data)},dependencies:[N,Ae,j,k,A,z,K,Ge,O,L,le,ae,ge,He,we,Le,hi,Q,Qe,re,te,ee,X],encapsulation:2})};var Sp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],yp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],Dp=()=>["/menu/Products/Setup/Brand/Brand_Form"],vp=i=>({ID:i}),wp=(i,c)=>({BrandID:i,Name:c});function Tp(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 Pp(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function Fp(i,c){i&1&&(n(0,"th",24),p(1,"Code"),a())}function Ip(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;r(),w(e.Code)}}function bp(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",25),p(3),a()(),g(4,Ip,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;r(2),m("routerLink",b(11,Dp))("queryParams",U(12,vp,e.ID)),r(),v("",e.BrandName," "),r(),m("ngIf",e.Countcode>0),r(2),m("queryParams",de(14,wp,e.ID,e.BrandName)),r(),w(f(8,7,e.Quantity)),r(3),w(f(11,9,e.Total))}}function Ep(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,Fp,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,bp,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();r(6),m("ngIf",e.data.Countcode>0),r(6),m("ngForOf",e.data.Data),r(6),w(f(20,7,y(19,4,e.data.Data,"Quantity"))),r(4),w(f(24,12,y(23,9,e.data.Data,"Total")))}}var _n=class i extends he{constructor(e,o,t,l,S,P){super(e,o,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=o;this.csvConverter=t;this.roleService=S;this.matDialog=P}sortData(e){let o=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,S);case"Code":return this.compare(t.Code,l.Code,S);case"Quantity":return this.compare(t.Quantity,l.Quantity,S);case"Total":return this.compare(t.Total,l.Total,S);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(o){return new(o||i)(D(W),D(B),D(H),D(Oe),D(G),D(Y))};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(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,Tp,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,Pp,9,6,"ng-template",null,0,M),a(),n(16,"content"),g(17,Ep,25,14,"div",7),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService.global.Export),r(6),m("routerLink",b(8,Sp)),r(3),m("routerLink",b(9,yp)),r(6),m("ngIf",t.data))},dependencies:[N,j,k,A,K,O,L,le,ae,ge,Q,re,X,Z],encapsulation:2})};function Mp(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,o=s();r(),m("value",e.ID)("checked",o.IDGroups.indexOf(e.ID)>-1),r(2),w(e.Name)}}var gn=class i{constructor(c,e){this.dialogRef=c;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(o=>{this.IDGroups.push(o.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(c){let e=this.IDGroups.indexOf(c);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(c)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(D(Zt),D(Jt))};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,o){e&1&&(n(0,"modal-material",0),T("onOk",function(){return o.onOk()})("onCancel",function(){return o.dialogRef.close()}),n(1,"content")(2,"div",1),g(3,Mp,4,3,"label",2),a()()()),e&2&&(m("title","Edit Groups"),r(3),m("ngForOf",o.options))},dependencies:[j,$t],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var Vp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Bp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Op=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Lp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Rp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],kp=()=>["/menu/Contacts/Contact/Customers/Info"],Wp=i=>({ID:i});function Np(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 Ap(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),m("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function Gp(i,c){i&1&&(n(0,"th",31),p(1," ORDERS "),a())}function Hp(i,c){i&1&&(n(0,"th",32),p(1," QTY "),a())}function Qp(i,c){i&1&&(se(0),n(1,"th",33),p(2," COST "),a(),ce())}function jp(i,c){i&1&&(n(0,"th",34),p(1," SALES "),a())}function Yp(i,c){i&1&&(n(0,"th",35),p(1," TAX "),a())}function qp(i,c){i&1&&(n(0,"th",36),p(1," SALES + TAX "),a())}function Up(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,o=c.index;r(2),w(o==0?"":" , "),r(2),w(e.GroupName)}}function Kp(i,c){if(i&1&&(n(0,"span"),g(1,Up,5,2,"span",38),a()),i&2){let e=s().$implicit;r(),m("ngForOf",e.Groups)}}function zp(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 Xp(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Orders)," ")}}function Zp(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Quantity)," ")}}function Jp(i,c){if(i&1&&(se(0),n(1,"td",47),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s().$implicit;r(2),v(" ",f(3,1,e.Cost)," ")}}function $p(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Sales)," ")}}function em(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Tax)," ")}}function tm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Sales+e.Tax)," ")}}function im(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",39),p(3),a(),n(4,"div",40),g(5,Kp,2,1,"span",25)(6,zp,2,0,"a",41),a()(),n(7,"td")(8,"span",42),p(9),a()(),g(10,Xp,3,3,"td",43)(11,Zp,3,3,"td",43)(12,Jp,4,3,"ng-container",25)(13,$p,3,3,"td",43)(14,em,3,3,"td",44)(15,tm,3,3,"td",43),a()),i&2){let e=c.$implicit,o=s(3);r(2),m("routerLink",b(13,kp))("queryParams",U(14,Wp,e.CustomerID)),r(),v(" ",e.Name+" "+(e.Title?e.Title:"")," "),r(2),m("ngIf",e.Groups.length>0),r(),m("ngIf",!(e.Groups.length>0)),r(2),m("matTooltip",o.maskingFields!=null&&o.maskingFields.Code&&!o.roleService.global.SensitiveField?o.maskingFieldMsg:""),r(),v("",e.Code," "),r(),m("ngIf",o.column.Orders.selected),r(),m("ngIf",o.column.QTY.selected),r(),m("ngIf",o.roleService.product.Cost&&o.column.Cost.selected),r(),m("ngIf",o.column.Sales.selected),r(),m("ngIf",o.column.Tax.selected),r(),m("ngIf",o.column.SalesNTax.selected)}}function nm(i,c){if(i&1&&(n(0,"tbody",37),g(1,im,16,16,"tr",38),a()),i&2){let e=s(2);r(),m("ngForOf",e.data.Data)}}function am(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,Gp,2,0,"th",23)(10,Hp,2,0,"th",24)(11,Qp,3,0,"ng-container",25)(12,jp,2,0,"th",26)(13,Yp,2,0,"th",27)(14,qp,2,0,"th",28),a()(),g(15,nm,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();r(9),m("ngIf",e.column.Orders.selected),r(),m("ngIf",e.column.QTY.selected),r(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),r(),m("ngIf",e.column.Sales.selected),r(),m("ngIf",e.column.Tax.selected),r(),m("ngIf",e.column.SalesNTax.selected),r(),m("ngIf",e.data.Data),r(),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 fn=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=o;this.csvConverter=t;this.datePipe=l;this.matDialog=S}roleService=Ye(G);columnService=Ye(It);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=an.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(Rt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let o=this.originalData;if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,S);case"Code":return this.compare(t.Code,l.Code,S);case"Orders":return this.compare(t.Orders,l.Orders,S);case"Quantity":return this.compare(t.Quantity,l.Quantity,S);case"Sales":return this.compare(t.Sales,l.Sales,S);case"Tax":return this.compare(t.Tax,l.Tax,S);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,S);case"Cost":return this.compare(t.Cost,l.Cost,S);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,o){this.matDialog.open(gn,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let S={ContactID:o,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",S).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(o){return new(o||i)(D(W),D(B),D(H),D(ee),D(Y))};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(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Np,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,Ap,16,10,"ng-template",null,0,M),a(),n(26,"content"),g(27,am,17,13,"div",7),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),m("column",t.column),r(2),m("ngIf",t.roleService.global.Export),r(6),m("routerLink",b(12,Vp)),r(3),m("routerLink",b(13,Bp)),r(3),m("routerLink",b(14,Op)),r(3),m("routerLink",b(15,Lp)),r(4),m("routerLink",b(16,Rp)),r(6),m("ngIf",t.data))},dependencies:[N,j,k,A,z,K,Ge,O,L,le,ae,ge,He,Q,ti,te,X,Z],encapsulation:2})};var rm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],om=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],lm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],pm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],mm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function sm(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 cm(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function dm(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;r(2),v(" ",e.Name," "),r(2),w(f(5,4,e.TotalOrders)),r(3),w(f(8,6,e.TotalCost)),r(3),w(f(11,8,e.TotalAmount))}}function um(i,c){if(i&1&&(n(0,"tbody",24),g(1,dm,12,10,"tr",25),a()),i&2){let e=s(2);r(),m("ngForOf",e.data.Data)}}function _m(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,um,2,1,"tbody",23),a()()}if(i&2){let e=s();r(12),m("ngIf",e.data.Data)}}var Cn=class i extends he{constructor(e,o,t,l,S,P){super(e,o,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S;this.datePipe=P}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,S);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,S);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,S);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,S);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(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y),D(ee))};static \u0275cmp=E({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[R],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],["class","border-bottom",4,"ngIf"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[1,"text-end"],[1,"text-end","text-success"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,sm,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,cm,13,8,"ng-template",null,0,M),a(),n(25,"content"),g(26,_m,13,1,"div",7),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(6),m("routerLink",b(11,rm)),r(3),m("routerLink",b(12,om)),r(3),m("routerLink",b(13,lm)),r(3),m("routerLink",b(14,pm)),r(3),m("routerLink",b(15,mm)),r(6),m("ngIf",t.data))},dependencies:[N,j,k,A,z,K,O,L,ae,ge,Q,te,X],encapsulation:2})};var gm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],fm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Cm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],xm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],hm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Sm(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 ym(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function Dm(i,c){i&1&&(n(0,"th",25),p(1," ORDERS"),a())}function vm(i,c){i&1&&(n(0,"th",26),p(1," QUANTITY"),a())}function wm(i,c){i&1&&(n(0,"th",27),p(1," AMOUNT"),a())}function Tm(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;r(),w(f(2,1,e.TotalOrders))}}function Pm(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.TotalQuantity)," ")}}function Fm(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),w(f(2,1,e.TotalAmount))}}function Im(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),g(3,Tm,3,3,"td",28)(4,Pm,3,3,"td",28)(5,Fm,3,3,"td",29),a()),i&2){let e=c.$implicit,o=s(2);r(2),v(" ",e.Name," "),r(),m("ngIf",o.column.Orders.selected),r(),m("ngIf",o.column.QTY.selected),r(),m("ngIf",o.column.Amount.selected)}}function bm(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,Dm,2,0,"th",20)(7,vm,2,0,"th",21)(8,wm,2,0,"th",22),a()(),n(9,"tbody",23),g(10,Im,6,4,"tr",24),a()()()}if(i&2){let e=s();r(6),m("ngIf",e.column.Orders.selected),r(),m("ngIf",e.column.QTY.selected),r(),m("ngIf",e.column.Amount.selected),r(2),m("ngForOf",e.data==null?null:e.data.Data)}}var xn=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=o;this.csvConverter=t;this.matDialog=l;this.datePipe=S}roleService=Ye(G);columnService=Ye(It);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let o=this.data.slice();if(!e.active||e.direction===""){this.data=o;return}this.data=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,S);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,S);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,S);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,S);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(Rt(1))}openExportModal(){this.matDialog.open(q,{data:{title:"Top Gender customer",exportTypes:[{ID:"ReportExport/CustomerGenderRank",Value:"Default",FileName:"Top Gender customer "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(Y),D(ee))};static \u0275cmp=E({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[R],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["style","width: 75px","mat-sort-header","Orders","arrowPosition","before","class","flex-right",4,"ngIf"],["style","width: 75px","mat-sort-header","Quantity","arrowPosition","before","class","flex-right",4,"ngIf"],["style","width: 135px","mat-sort-header","Total","arrowPosition","before","class","flex-right",4,"ngIf"],[1,"border-bottom"],[4,"ngFor","ngForOf"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],["class","text-end",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[1,"text-end"],[1,"text-end","text-success"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Sm,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,ym,13,8,"ng-template",null,0,M),a(),n(25,"content"),g(26,bm,11,4,"div",7),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),m("column",t.column),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(6),m("routerLink",b(12,gm)),r(3),m("routerLink",b(13,fm)),r(3),m("routerLink",b(14,Cm)),r(3),m("routerLink",b(15,xm)),r(3),m("routerLink",b(16,hm)),r(6),m("ngIf",t.data))},dependencies:[N,j,k,A,z,K,O,L,ae,ge,Q,te,X,Z],encapsulation:2})};var so=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Em=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Mm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Vm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Bm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Om=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Lm=()=>["/menu/Contacts/Contact/Suppliers/Info"],Rm=i=>({ID:i}),km=(i,c,e)=>({From:i,SupplierID:c,To:e});function Wm(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 Nm(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Group),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),m("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function Am(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,o=s(2);r(2),w(e.Rank),r(2),m("routerLink",b(19,Lm))("queryParams",U(20,Rm,e.SupplierID)),r(),w(e.Name),r(2),w(e.Code),r(2),v(" ",f(10,9,e.Quantity)," "),r(3),m("routerLink",b(22,so))("queryParams",st(23,km,y(13,11,o.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,y(14,14,o.pageData.Filter.To,"yyyy-MM-dd"))),r(3),v(" ",f(16,17,e.Total),"")}}function Gm(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);r(10),w(e.data.TotalQty),r(2),w(e.data.TotalSales)}}function Hm(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,Am,17,27,"tr",25),a(),g(16,Gm,13,2,"tfoot"),a()()}if(i&2){let e=s();r(15),m("ngForOf",e.data.Data),r(),Wi((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?16:-1)}}var hn=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,S);case"Supplier":return this.compare(t.Name,l.Name,S);case"Code":return this.compare(t.Code,l.Code,S);case"Quantity":return this.compare(t.Quantity,l.Quantity,S);case"Total":return this.compare(t.Total,l.Total,S);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(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};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(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,Wm,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,Nm,16,10,"ng-template",null,0,M),a(),n(28,"content"),g(29,Hm,17,2,"div",7),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(6),m("routerLink",b(12,so)),r(3),m("routerLink",b(13,Em)),r(3),m("routerLink",b(14,Mm)),r(3),m("routerLink",b(15,Vm)),r(3),m("routerLink",b(16,Bm)),r(3),m("routerLink",b(17,Om)),r(6),m("ngIf",t.data))},dependencies:[N,j,k,A,z,K,Ge,O,L,ae,ge,He,Q,ee,X,Z],encapsulation:2})};var co=Ut(ln());var jm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Ym=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],qm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Um=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Km=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],zm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Xm=(i,c,e,o,t)=>({From:i,To:c,ListIDs:e,ListVariantID:o,GroupByVariant:t}),Zm=i=>[i],Jm=i=>({ID:i}),$m=(i,c,e,o,t,l)=>({ID:i,From:c,To:e,ListIDs:o,ListVariantID:t,GroupByVariant:l}),uo=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],es=(i,c,e)=>({VariantID:i,From:c,To:e}),ts=(i,c,e)=>({ProductID:i,From:c,To:e});function is(i,c){if(i&1&&(n(0,"a",28),I(1,"i",29),p(2," Compare Qty Sold "),a()),i&2){let e=s(2);m("queryParams",Qi(1,Xm,e.convertToDateString(e.pageData.Filter.From),e.convertToDateString(e.pageData.Filter.To),e.JSONstringify(e.pageData.Filter.ListIDs),e.variantIDChecked(),e.pageData.Filter.GroupByVariant))}}function ns(i,c){if(i&1){let e=F();n(0,"button",30),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",31),p(2," Export "),a()}}function as(i,c){if(i&1){let e=F();n(0,"div",32)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",33),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",34),h("selectedCategoryIDChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",35),h("dateChange",function(t){u(e);let l=s(2);return x(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(10,"div",36)(11,"datepicker",37),h("dateChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",38),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(15,"h6"),p(16,"Product Tag"),a(),n(17,"ng-select",39),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(18,"h6"),p(19,"Sales Person"),a(),n(20,"sales-person-selector",40),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",41),h("modelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),T("modelChange",function(){u(e);let t=s(2);return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",42),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(27,"h6"),p(28,"Logistics Service"),a(),n(29,"ng-select",43),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",44),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(33,"h6"),p(34,"Customer Group"),a(),n(35,"ng-select",45),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",46),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Product Type"),a(),n(41,"radio-options",47),h("modelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(42,"h6"),p(43,"Multiply Unit Quantity"),a(),n(44,"radio-options",48),h("modelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s(2);r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),r(3),C("date",e.pageData.Filter.From),m("showClearBtn",!0)("showTodayBtn",!0),r(2),C("date",e.pageData.Filter.To),m("showClearBtn",!0)("showTodayBtn",!0),r(3),m("multiple",!0),C("ngModel",e.pageData.Filter.BrandIDs),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),r(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Tags),C("ngModel",e.pageData.Filter.TagID),r(3),C("ngModel",e.pageData.Filter.SalesID),r(3),C("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter),r(3),C("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),r(3),C("ngModel",e.pageData.Filter.LogisticsServiceID),m("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),r(3),C("ngModel",e.pageData.Filter.SupplierID),m("inputTextValue",e.pageData.supplierName),r(3),m("items",e.pageData.Options.ContactGroups),C("ngModel",e.pageData.Filter.ContactGroupID),r(3),C("ngModel",e.pageData.Filter.CustomerID),r(3),C("model",e.pageData.Filter.ProductType),m("options",e.pageData.Options.ProductTypes),r(3),C("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function rs(i,c){if(i&1){let e=F();n(0,"th",49)(1,"div",50)(2,"input",51),T("change",function(t){u(e);let l=s(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=s(2);r(2),m("checked",e.isAllCheckBoxChecked())}}function os(i,c){if(i&1&&(n(0,"th",52),p(1," Qty "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Quantity.start)}}function ls(i,c){i&1&&(n(0,"th",53),p(1," On Hand "),a())}function ps(i,c){i&1&&(n(0,"th",54),p(1," COST "),a())}function ms(i,c){i&1&&(n(0,"th",55),p(1," GROSS "),a())}function ss(i,c){if(i&1&&(n(0,"th",56),p(1," Sales "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Sales.start)}}function cs(i,c){i&1&&(n(0,"th",57),p(1," Tax "),a())}function ds(i,c){if(i&1&&(n(0,"th",58),p(1," Sales + Tax "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Sales.start)}}function us(i,c){i&1&&(n(0,"th",59),p(1," PROFIT "),a())}function _s(i,c){i&1&&(n(0,"th",60),p(1," % "),a())}function gs(i,c){if(i&1){let e=F();n(0,"td")(1,"div",50)(2,"input",72),h("ngModelChange",function(t){u(e);let l=s().$implicit;return x(l.checked,t)||(l.checked=t),_(t)}),a()()()}if(i&2){let e=s().$implicit;r(2),ot("value",e.ID),C("ngModel",e.checked)}}function fs(i,c){if(i&1){let e=F();se(0),n(1,"img",73),T("click",function(t){u(e);let l=s().$implicit,S=s(2);return _(S.openBigPicture(l==null?null:l.ImageURL,t))}),a(),ce()}if(i&2){let e=s().$implicit;r(),m("src",e.ThumbnailUrl,ki)}}function Cs(i,c){if(i&1){let e=F();n(0,"a",74)(1,"img",75),T("click",function(t){u(e);let l=s().$implicit,S=s(2);return _(S.openBigPicture(l,t))}),a()()}if(i&2){let e=s(3);m("target",e.pageData.LinkTarget)}}function xs(i,c){if(i&1&&(n(0,"td",76)(1,"a",77),p(2),d(3,"quantityFraction"),a()()),i&2){let e=s().$implicit,o=s(2);r(),m("queryParams",tr(4,$m,e.ID,o.convertToDateString(o.pageData.Filter.From),o.convertToDateString(o.pageData.Filter.To),o.JSONstringify(o.pageData.Filter.ListIDs),o.variantIDChecked(),o.pageData.Filter.GroupByVariant)),r(),w(f(3,2,e.Quantity))}}function hs(i,c){if(i&1&&(n(0,"td",76),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.OnHand)," ")}}function Ss(i,c){if(i&1&&(n(0,"td",78),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.UnitCost)," ")}}function ys(i,c){if(i&1&&(n(0,"td",76),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Gross)," ")}}function Ds(i,c){if(i&1&&(n(0,"a",66),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,o=s(2);m("routerLink",b(11,uo))("queryParams",st(12,es,e.ID,y(1,3,o.pageData.Filter.From,"ddMMyyyy"),y(2,6,o.pageData.Filter.To,"ddMMyyyy"))),r(3),w(f(4,9,e.Sales))}}function vs(i,c){if(i&1&&(n(0,"a",66),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,o=s(2);m("routerLink",b(11,uo))("queryParams",st(12,ts,e.ID,y(1,3,o.pageData.Filter.From,"ddMMyyyy"),y(2,6,o.pageData.Filter.To,"ddMMyyyy"))),r(3),w(f(4,9,e.Sales))}}function ws(i,c){if(i&1&&(n(0,"td",76),g(1,Ds,5,16,"a",79)(2,vs,5,16,"a",79),a()),i&2){let e=s(3);r(),m("ngIf",e.pageData.Filter.GroupByVariant),r(),m("ngIf",!e.pageData.Filter.GroupByVariant)}}function Ts(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Tax)," ")}}function Ps(i,c){if(i&1&&(n(0,"td",76),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.SalesNTax)," ")}}function Fs(i,c){if(i&1&&(n(0,"td",81),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Profit>=0?"text-success":"text-danger"),r(),v(" ",f(2,2,e.Profit)," ")}}function Is(i,c){if(i&1&&(n(0,"td",81),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Margin>=0?"text-success":"text-danger"),r(),v(" ",f(2,2,e.Margin)," ")}}function bs(i,c){if(i&1&&(n(0,"tr",61),g(1,gs,3,2,"td",26),n(2,"td"),p(3),a(),n(4,"td")(5,"div",62)(6,"div",63),g(7,fs,2,1,"ng-container",26)(8,Cs,2,1,"a",64),a(),n(9,"div",65)(10,"a",66),p(11),a(),n(12,"small",67),p(13),a()()()(),g(14,xs,4,11,"td",68)(15,hs,3,3,"td",68)(16,Ss,3,3,"td",69)(17,ys,3,3,"td",68)(18,ws,3,2,"td",68)(19,Ts,3,3,"td",70)(20,Ps,3,3,"td",68)(21,Fs,3,4,"td",71)(22,Is,3,4,"td",71),a()),i&2){let e=c.$implicit,o=c.index,t=s(2);r(),m("ngIf",t.column.CompareQtySold.selected),r(2),w(o+1),r(4),m("ngIf",e.ImageURL),r(),m("ngIf",!e.ImageURL),r(2),m("routerLink",U(17,Zm,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(19,Jm,e.ID)),r(),w(e.Name),r(2),w(e.Code),r(),m("ngIf",t.column.QTY.selected),r(),m("ngIf",t.column.OnHand.selected),r(),m("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),r(),m("ngIf",t.column.Gross.selected),r(),m("ngIf",t.column.Sales.selected),r(),m("ngIf",t.column.Tax.selected),r(),m("ngIf",t.column.SalesNTax.selected),r(),m("ngIf",t.roleService.report.Profit&&t.column.Profit.selected),r(),m("ngIf",t.roleService.report.Profit&&t.column.Margin.selected)}}function Es(i,c){i&1&&I(0,"td",76)}function Ms(i,c){i&1&&(n(0,"td",76),p(1," Total : "),a())}function Vs(i,c){if(i&1&&(n(0,"td",76),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(3);r(),v(" ",f(3,4,y(2,1,e.infiniteList,"Quantity"))," ")}}function Bs(i,c){if(i&1&&(n(0,"td",76),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(3);r(),v(" ",f(3,4,y(2,1,e.infiniteList,"OnHand"))," ")}}function Os(i,c){if(i&1&&(n(0,"td",78),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);r(),v(" ",f(3,4,y(2,1,e.infiniteList,"UnitCost"))," ")}}function Ls(i,c){if(i&1&&(n(0,"td",76),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);r(),v(" ",f(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function Rs(i,c){if(i&1&&(n(0,"td",84)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);r(2),w(f(4,4,y(3,1,e.infiniteList,"Sales")))}}function ks(i,c){if(i&1&&(n(0,"td",80)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);r(2),w(f(4,4,y(3,1,e.infiniteList,"Tax")))}}function Ws(i,c){if(i&1&&(n(0,"td",84)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);r(2),w(f(4,4,y(3,1,e.infiniteList,"SalesNTax")))}}function Ns(i,c){if(i&1&&(n(0,"td",81),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"),r(2),v(" ",f(4,8,y(3,5,e.infiniteList,"Profit"))," ")}}function As(i,c){if(i&1&&(n(0,"td",81),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"),r(3),v(" ",f(6,14,y(4,8,e.infiniteList,"Profit")/y(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function Gs(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",82),I(2,"td",76),g(3,Es,1,0,"td",68)(4,Ms,2,0,"td",68)(5,Vs,4,6,"td",68)(6,Bs,4,6,"td",68)(7,Os,4,6,"td",69)(8,Ls,4,6,"td",68)(9,Rs,5,6,"td",83)(10,ks,5,6,"td",70)(11,Ws,5,6,"td",83)(12,Ns,5,10,"td",71)(13,As,7,16,"td",71),a()()),i&2){let e=s(2);r(3),m("ngIf",e.column.CompareQtySold.selected),r(),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),r(),m("ngIf",e.column.QTY.selected),r(),m("ngIf",e.column.OnHand.selected),r(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),r(),m("ngIf",e.column.Gross.selected),r(),m("ngIf",e.column.Sales.selected),r(),m("ngIf",e.column.Tax.selected),r(),m("ngIf",e.column.SalesNTax.selected),r(),m("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),r(),m("ngIf",e.roleService.report.Profit&&e.column.Margin.selected)}}function Hs(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),h("textChange",function(t){u(e);let l=s();return x(l.pageData.Filter.Text,t)||(l.pageData.Filter.Text=t),_(t)}),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),T("onChangeColumnCheckbox",function(){u(e);let t=s();return _(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,is,3,7,"a",3)(3,ns,3,0,"button",4),n(4,"div",5)(5,"button",6),p(6," More "),a(),n(7,"ul",7)(8,"li")(9,"a",8),p(10," Compare by Outlet "),a()(),n(11,"li")(12,"a",8),p(13," Compare by Month "),a()(),n(14,"li")(15,"a",8),p(16," Compare with Transfer Order "),a()(),n(17,"li")(18,"a",8),p(19," Product Tags Analysis "),a()(),n(20,"li")(21,"a",8),p(22," Top Suppliers "),a()(),n(23,"li")(24,"a",8),p(25," Quantity Sold Chart "),a()()()()(),n(26,"filters"),g(27,as,45,35,"ng-template",null,0,M),a(),n(29,"content")(30,"div",9)(31,"div",10)(32,"table",11),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(33,"thead",12)(34,"tr"),g(35,rs,3,1,"th",13),n(36,"th",14),p(37,"No"),a(),n(38,"th",15),p(39,"NAME"),a(),g(40,os,2,1,"th",16)(41,ls,2,0,"th",17)(42,ps,2,0,"th",18)(43,ms,2,0,"th",19)(44,ss,2,1,"th",20)(45,cs,2,0,"th",21)(46,ds,2,1,"th",22)(47,us,2,0,"th",23)(48,_s,2,0,"th",24),a()(),n(49,"tbody"),g(50,bs,23,21,"tr",25),a(),g(51,Gs,14,11,"tfoot",26),a()(),n(52,"infinite-pagination",27),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();m("pageData",e.menuData),C("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),m("column",e.column),r(2),m("ngIf",e.isAnyItemChecked),r(),m("ngIf",e.roleService.global.Export),r(6),m("routerLink",b(31,jm)),r(3),m("routerLink",b(32,Ym)),r(3),m("routerLink",b(33,qm)),r(3),m("routerLink",b(34,Um)),r(3),m("routerLink",b(35,Km)),r(3),m("routerLink",b(36,zm)),r(11),m("ngIf",e.column.CompareQtySold.selected),r(5),m("ngIf",e.column.QTY.selected),r(),m("ngIf",e.column.OnHand.selected),r(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),r(),m("ngIf",e.column.Gross.selected),r(),m("ngIf",e.column.Sales.selected),r(),m("ngIf",e.column.Tax.selected),r(),m("ngIf",e.column.SalesNTax.selected),r(),m("ngIf",e.column.Profit.role&&e.column.Profit.selected),r(),m("ngIf",e.column.Profit.role&&e.column.Margin.selected),r(2),m("ngForOf",e.infiniteList),r(),m("ngIf",e.data),r(),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 U3=BiggerPicture({target:document.body}),Sn=class i extends he{constructor(e,o,t,l,S,P,Ee){super(e,o,"Report/ProductSales","ReportLoader/ProductSales",null,S);this.httpService=o;this.csvConverter=t;this.toasterService=l;this.activatedRoute=S;this.matDialog=P;this.bigPicture=Ee}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Ye(G);columnService=Ye(It);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"},Gross:{selected:!0,name:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;router=Ye(ui);variantID=Ct([]);variantIDChecked=bi(()=>this.variantID().join(","));preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=$e(Ze({},this.data),{Data:e.Data.map(t=>$e(Ze({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=$e(Ze({},this.currentServerSortState[t]),{start:"desc"});let o=e.Sort.column;this.currentServerSortState[o]=$e(Ze({},this.currentServerSortState[o]),{start:e.Sort.direction==="desc"?"asc":"desc"}),console.log(this.currentServerSortState)}ngAfterViewChecked(){if(this.infiniteList&&this.infiniteList.length){let e=this.infiniteList.filter(o=>o.checked).map(o=>o.ID);this.variantID.set(e)}}checkAllCheckBox(e){let o=e.target;this.infiniteList=[...this.infiniteList.map(t=>$e(Ze({},t),{checked:o.checked}))]}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;V.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandID=e.BrandID),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}openBigPicture(e,o){this.bigPicture.openBiggerPicture(o,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 o={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",o).subscribe(t=>{this.toasterService.success(t,_i.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=$e(Ze({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let o=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=o;return}this.infiniteList=o.sort((t,l)=>{let S=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),S);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),S);case"Brand":return V.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),S);case"Quantity":return V.compare(t.Quantity,l.Quantity,S);case"Total_Cost":return V.compare(t.UnitCost,l.UnitCost,S);case"Inventory":return V.compare(t.OnHand,l.OnHand,S);case"Total_Sales":return V.compare(t.Total,l.Total,S);case"Total_Tax":return V.compare(t.Tax,l.Tax,S);case"Total_Tax_Sales":return V.compare(t.SalesNTax,l.SalesNTax,S);case"ReOrder":return V.compare(t.MinStock,l.MinStock,S);case"Gross":return V.compare(t.Gross,l.Gross,S);case"Margin":return V.compare(t.Margin,l.Margin,S);case"Profit":return V.compare(t.Profit,l.Profit,S);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}onQtySoldChartHandler(){this.infiniteList&&Array.isArray(this.infiniteList)&&(this.infiniteList.filter(o=>o.checked).length<=5?this.router.navigate(["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],{queryParams:{From:new Date(this.pageData.Filter.From).toISOString(),To:new Date(this.pageData.Filter.To).toISOString(),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter.ListIDs.join(","),ListVariantID:this.variantIDChecked()}}):this.toasterService.warning("Please select maximum 5 items",_i.Warning))}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,co.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(Ke),D(Oe),D(Y),D(pn))};static \u0275cmp=E({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","column","textChange","onSubmit","filterChange","onChangeColumnCheckbox",4,"ngIf"],[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"],[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"],[4,"ngIf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],["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-simple"],[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"],[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(o,t){o&1&&g(0,Hs,53,37,"mainpanel-cmp",1),o&2&&m("ngIf",t.data)},dependencies:[N,Ae,j,k,A,z,K,lr,O,L,le,ae,ge,we,Le,fe,Q,Qe,ti,re,ee,X,Z],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var Qs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],js=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Ys=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],qs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Us=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Ks=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],zs=i=>({ID:i});function Xs(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 Zs(i,c){if(i&1){let e=F();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(10,"h6"),p(11,"Brand"),a(),n(12,"ng-select",21),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(13,"h6"),p(14,"Supplier"),a(),n(15,"autocompleteV2",22),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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),h("modelChange",function(t){u(e);let l=s();return x(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();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("ngModel",e.pageData.Filter.SalesID),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),C("ngModel",e.pageData.Filter.BrandID),r(3),C("ngModel",e.pageData.Filter.SupplierID),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function Js(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e,o=c.$implicit;ot("matTooltip",o.Name),r(),v(" ",(e=o.Code)!==null&&e!==void 0?e:o.Name," ")}}function $s(i,c){if(i&1&&(n(0,"td",13),p(1),a()),i&2){let e=c.$implicit;r(),v(" ",e," ")}}function e0(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,$s,2,1,"td",31),n(7,"td",13),p(8),a()()),i&2){let e=c.$implicit,o=s();r(2),m("routerLink",o.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",U(6,zs,e.ID)),r(),v(" ",e.Name,""),r(2),w(e.Code),r(),m("ngForOf",e.Quantities),r(2),w(e.Total)}}var yn=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=o;this.csvConverter=t;this.matDialog=l;this.roleService=S}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(o){return new(o||i)(D(W),D(B),D(H),D(Y),D(G))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[R],decls:42,vars:19,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%","text-align","right"],["class","text-end","matTooltipPosition","above",3,"matTooltip",4,"ngFor","ngForOf"],[1,"text-end"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"border-bottom"],[3,"routerLink","queryParams"],[2,"text-align","right"],["class","text-end",4,"ngFor","ngForOf"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),h("textChange",function(P){return u(l),x(t.pageData.Filter.Text,P)||(t.pageData.Filter.Text=P),_(P)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,Xs,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,Zs,25,14,"ng-template",null,0,M),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),n(35,"th",11),p(36,"Code"),a(),g(37,Js,2,2,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,e0,9,8,"tr",14),a()()()()()}o&2&&(m("pageData",t.menuData),C("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(6),m("routerLink",b(13,Qs)),r(3),m("routerLink",b(14,js)),r(3),m("routerLink",b(15,Ys)),r(3),m("routerLink",b(16,qs)),r(3),m("routerLink",b(17,Us)),r(3),m("routerLink",b(18,Ks)),r(14),m("ngForOf",t.data==null?null:t.data.Outlet),r(4),m("ngForOf",t.data==null?null:t.data.Data))},dependencies:[N,j,k,A,z,K,O,L,le,we,Le,fe,Q,Qe],encapsulation:2})};var t0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],i0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],n0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],a0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],r0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],o0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],l0=i=>[i],p0=i=>({ID:i});function m0(i,c){if(i&1){let e=F();n(0,"a",16),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",17),p(2," Export"),a()}}function s0(i,c){if(i&1){let e=F();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Compare Month From"),a(),n(9,"ng-select",21),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a(),n(10,"h6"),p(11,"Compare Month To"),a(),n(12,"ng-select",22),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a(),n(13,"h6"),p(14,"Year"),a(),n(15,"ng-select",23),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",24),h("modelChange",function(t){u(e);let l=s();return x(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();r(3),m("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.pageData.Filter.MonthFrom),m("items",e.months),r(3),C("ngModel",e.pageData.Filter.MonthTo),m("items",e.months),r(3),C("ngModel",e.pageData.Filter.Year),m("items",e.years),r(3),C("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter)}}function c0(i,c){if(i&1&&(n(0,"th",25),p(1),a()),i&2){let e=c.$implicit,o=s();r(),v(" ",o.months[e.Month-1].ColumnLabel," ")}}function d0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,o=s().$implicit,t=s();r(),v(" ",t.findKey(o.Sold,e.Month)?y(2,1,t.findKey(o.Sold,e.Month),t.pageData.FractionDigit):""," ")}}function u0(i,c){if(i&1&&(n(0,"tr",26)(1,"td")(2,"a",27),p(3),a()(),n(4,"td"),p(5),a(),g(6,d0,3,4,"td",28),n(7,"td",29),p(8),d(9,"sum"),d(10,"number"),a()()),i&2){let e=c.$implicit,o=s();r(2),m("routerLink",U(12,l0,o.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(14,p0,e.ID)),r(),v(" ",e.Name," "),r(2),w(e.Code),r(),m("ngForOf",o.data==null?null:o.data.MonthlySales),r(2),v(" ",y(10,9,y(9,6,e.Sold,"Value"),o.pageData.FractionDigit)," ")}}function _0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,o=s(2);r(),v(" ",y(2,1,e.Sold,o.pageData.FractionDigit)," ")}}function g0(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",30),I(2,"td")(3,"td"),g(4,_0,3,4,"td",28),n(5,"td",29),p(6),d(7,"sum"),d(8,"number"),a()()()),i&2){let e=s();r(4),m("ngForOf",e.data==null?null:e.data.MonthlySales),r(2),v(" ",y(8,5,y(7,2,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}var Dn=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",null,null,!0);this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}years=V.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,o){let t=null;return e.forEach(l=>{l.Key==o&&(t=l.Value)}),t}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=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(),S);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),S);default:return 0}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[R],decls:43,vars:20,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["mat-sort-header","Code",1,"align-left",2,"width","120px"],["class","text-end small","style","width: 70px",4,"ngFor","ngForOf"],[1,"text-end",2,"width","75px"],["class","border-bottom",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month From",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month To",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["name","Scope",3,"modelChange","model","options"],[1,"text-end","small",2,"width","70px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["class","text-end",4,"ngFor","ngForOf"],[1,"text-end"],[1,"table","table-borderless"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,m0,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by 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,s0,19,14,"ng-template",null,0,M),a(),n(28,"content")(29,"div",7)(30,"table",8),T("matSortChange",function(P){return u(l),_(t.sortData(P))}),n(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),n(35,"th",11),p(36,"Code"),a(),g(37,c0,2,1,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,u0,11,16,"tr",14),a(),g(42,g0,9,8,"tfoot",15),a()()()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(6),m("routerLink",b(14,t0)),r(3),m("routerLink",b(15,i0)),r(3),m("routerLink",b(16,n0)),r(3),m("routerLink",b(17,a0)),r(3),m("routerLink",b(18,r0)),r(3),m("routerLink",b(19,o0)),r(14),m("ngForOf",t.data==null?null:t.data.MonthlySales),r(4),m("ngForOf",t.data==null?null:t.data.Data),r(),m("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[N,j,k,A,z,O,L,ae,ge,we,fe,Q,re,te],encapsulation:2})};var f0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],C0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],x0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],h0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],S0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],y0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],D0=i=>[i],v0=i=>({ID:i});function w0(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 T0(i,c){if(i&1){let e=F();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",21),h("dateChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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),h("modelChange",function(t){u(e);let l=s();return x(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();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function P0(i,c){if(i&1&&(n(0,"th",26),p(1),a()),i&2){let e=c.$implicit;r(),w(e)}}function F0(i,c){if(i&1&&(n(0,"tr"),I(1,"th")(2,"th"),g(3,P0,2,1,"th",25),a()),i&2){let e=s();r(3),m("ngForOf",e.data==null?null:e.data.Outlet)}}function I0(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e=c.$implicit;r(),v(" ",e,"")}}function b0(i,c){if(i&1&&(se(0),n(1,"a",29),p(2),a(),ce()),i&2){let e=s().$implicit,o=s().$implicit,t=s();r(),m("routerLink",U(3,D0,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",U(5,v0,o[1])),r(),w(o[e])}}function E0(i,c){if(i&1&&p(0),i&2){let e=s().$implicit,o=s().$implicit;v(" ",o[e]," ")}}function M0(i,c){if(i&1&&(n(0,"td",13),g(1,b0,3,7,"ng-container",28)(2,E0,1,1,"ng-template",null,1,M),a()),i&2){let e=c.index,o=lt(3);r(),m("ngIf",e===0)("ngIfElse",o)}}function V0(i,c){if(i&1&&(n(0,"tr",13),g(1,M0,4,2,"td",15),a()),i&2){let e=c.$implicit,o=s();r(),m("ngForOf",o.getFilteredKeys(e))}}var vn=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(o=>+o!=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(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};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(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",2),h("textChange",function(P){return u(l),x(t.pageData.Filter.Text,P)||(t.pageData.Filter.Text=P),_(P)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,w0,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,T0,16,10,"ng-template",null,0,M),a(),n(28,"content")(29,"div",8)(30,"table",9)(31,"thead",10),g(32,F0,4,1,"tr",11),n(33,"tr")(34,"th",12),p(35,"Name"),a(),n(36,"th",13),p(37,"Code"),a(),g(38,I0,2,1,"th",14),a()(),n(39,"tbody"),g(40,V0,2,1,"tr",15),a()()()()()}o&2&&(m("pageData",t.menuData),C("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService.global.Export),r(6),m("routerLink",b(14,f0)),r(3),m("routerLink",b(15,C0)),r(3),m("routerLink",b(16,x0)),r(3),m("routerLink",b(17,h0)),r(3),m("routerLink",b(18,S0)),r(3),m("routerLink",b(19,y0)),r(9),m("ngIf",(t.data==null?null:t.data.Outlet.length)>0),r(6),m("ngForOf",t.data==null?null:t.data.Header),r(2),m("ngForOf",t.data==null?null:t.data.Data))},dependencies:[N,j,k,A,K,O,L,we,fe,Q],encapsulation:2})};var B0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],O0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],L0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],R0=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),_o=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],k0=(i,c,e)=>({CategoryID:i,From:c,To:e}),W0=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],go=i=>({CategoryID:i});function N0(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 A0(i,c){if(i&1&&(n(0,"span",22),p(1),a()),i&2){let e=c.item;ot("matTooltip",e.Value),r(),w(e.Value)}}function G0(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),g(10,A0,2,2,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),h("dateChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",20),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(26,"h6"),p(27,"Exclude Zero"),a(),n(28,"radio-options",21),h("modelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),C("ngModel",e.pageData.Filter.BrandID),r(5),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.SalesID),r(3),C("ngModel",e.pageData.Filter.CustomerID),r(3),C("ngModel",e.pageData.Filter.CalculationDiscount),m("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),r(3),C("model",e.pageData.Filter.ExcludeZero)}}function H0(i,c){i&1&&(n(0,"th",42),p(1," Cost "),I(2,"p-treeTableSortIcon",43),a())}function Q0(i,c){i&1&&(n(0,"th",44),p(1," Profit "),I(2,"p-treeTableSortIcon",45),a())}function j0(i,c){i&1&&(n(0,"th",46),p(1," % "),I(2,"p-treeTableSortIcon",47),a())}function Y0(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,H0,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,Q0,3,0,"th",40)(18,j0,3,0,"th",41),a()),i&2){let e=s(2);r(7),m("ngIf",e.roleService.product.Cost),r(10),m("ngIf",e.roleService.report.Profit),r(),m("ngIf",e.roleService.report.Profit)}}function q0(i,c){if(i&1&&(n(0,"td",55)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().rowData;r(),ot("matTooltip",e.CostInDirect&&e.Cost?"Direct ("+f(2,2,e.Cost)+") Indirect ("+f(3,4,e.CostInDirect)+")":""),r(3),w(f(5,6,e.DisplayedCost))}}function U0(i,c){if(i&1&&(n(0,"td",59)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().rowData;r(),ot("matTooltip",e.ProfitInDirect&&e.Profit?"Direct ("+f(2,2,e.Profit)+") Indirect ("+f(3,4,e.ProfitInDirect)+")":""),r(3),w(f(5,6,e.DisplayedProfit))}}function K0(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;ot("matTooltip",e.PercentageInDirect&&e.Percentage?"Direct ("+y(1,2,e.Percentage,"1.0-2")+") Indirect ("+y(2,5,e.PercentageInDirect,"1.0-2")+")":""),r(3),v("",f(4,8,e.DisplayedPercentage),"%")}}function z0(i,c){if(i&1&&(n(0,"td",60),g(1,K0,5,10,"span",61),a()),i&2){let e=s(3);r(),m("ngIf",e.roleService.report.Profit)}}function X0(i,c){if(i&1&&(n(0,"tr",48)(1,"td",49),I(2,"p-treeTableToggler",50),n(3,"a",51),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td",52)(8,"span",22),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),g(13,q0,6,8,"td",53),n(14,"td",54)(15,"span",22),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",55)(21,"a",56),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",54)(27,"span",22),d(28,"number"),d(29,"number"),n(30,"a",51),p(31),d(32,"amountFraction"),a()()(),g(33,U0,6,8,"td",57)(34,z0,2,1,"td",58),a()),i&2){let e=c.$implicit,o=c.rowData,t=s(2);m("ttRow",e),r(2),m("rowNode",e),r(),m("routerLink",b(50,_o))("queryParams",st(51,k0,o.ID,y(4,20,t.pageData.Filter.From,"yyyy-MM-dd"),y(5,23,t.pageData.Filter.To,"yyyy-MM-dd"))),r(3),w(o.Name),r(2),ot("matTooltip",o.QuantityIndirect&&o.Quantity?"Direct ("+f(9,26,o.Quantity)+") Indirect ("+f(10,28,o.QuantityIndirect)+")":""),r(3),w(f(12,30,o.DisplayedQuantity)),r(2),m("ngIf",t.roleService.product.Cost),r(2),ot("matTooltip",o.GrossIndirect&&o.GrossSales?"Direct ("+f(16,32,o.GrossSales)+") Indirect ("+f(17,34,o.GrossIndirect)+")":""),r(3),w(f(19,36,o.DisplayedGross)),r(3),ot("matTooltip",o.DiscountIndirect&&o.Discount?"Direct ("+f(22,38,o.Discount)+") Indirect ("+f(23,40,o.DiscountIndirect)+")":""),m("routerLink",b(55,W0))("queryParams",U(56,go,o.ID)),r(3),w(f(25,42,o.DisplayedTotalDiscount)),r(3),ot("matTooltip",o.NetSalesIndirect&&o.Sales?"Direct ("+f(28,44,o.Sales)+") Indirect ("+f(29,46,o.NetSalesIndirect)+")":""),r(3),m("routerLink",b(58,_o))("queryParams",U(59,go,o.ID)),r(),w(f(32,48,o.DisplayedNetSales)),r(2),m("ngIf",t.roleService.report.Profit),r(),m("ngIf",t.roleService.report.Profit)}}function Z0(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);r(),v(" ",f(2,1,e.data.Aggregate.TotalCost)," ")}}function J0(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);r(),v(" ",f(2,1,e.data.Aggregate.TotalProfit)," ")}}function $0(i,c){if(i&1&&(n(0,"td",68),p(1),d(2,"number"),a()),i&2){let e=s(3);r(),v(" ",f(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function ec(i,c){if(i&1&&(n(0,"tr",62)(1,"td",63),p(2,"Total :"),a(),n(3,"td",64),p(4),d(5,"quantityFraction"),a(),g(6,Z0,3,3,"td",65),n(7,"td",66)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",64),p(12),d(13,"amountFraction"),a(),n(14,"td",66),p(15),d(16,"amountFraction"),a(),g(17,J0,3,3,"td",65)(18,$0,3,3,"td",67),a()),i&2){let e=s(2);r(4),v(" ",f(5,7,e.data.Aggregate.TotalQuantity)," "),r(2),m("ngIf",e.roleService.product.Cost),r(3),w(f(10,9,e.data.Aggregate.TotalGross)),r(3),v(" ",f(13,11,e.data.Aggregate.TotalDiscount)," "),r(3),v(" ",f(16,13,e.data.Aggregate.TotalNetSales)," "),r(2),m("ngIf",e.roleService.report.Profit),r(),m("ngIf",e.roleService.report.Profit)}}function tc(i,c){if(i&1&&(n(0,"div",23)(1,"p-treeTable",24),g(2,Y0,19,3,"ng-template",25)(3,X0,35,61,"ng-template",26)(4,ec,19,15,"ng-template",27),a()()),i&2){let e=s();r(),m("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",b(4,R0))}}var wn=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}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(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category-sales"]],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"],["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",2,"width","250px"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase",2,"width","120px"],["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",2,"width","120px"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedProfit",4,"ngIf"],["style","width: 100px","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",2,"width","100px"],["field","DisplayedPercentage"],[3,"ttRow"],[2,"width","250px"],[3,"rowNode"],[3,"routerLink","queryParams"],[2,"width","120px"],["style","width: 120px","class","text-danger",4,"ngIf"],[2,"width","150px"],[1,"text-danger",2,"width","120px"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],["style","width: 120px","class","text-success",4,"ngIf"],["style","width: 100px",4,"ngIf"],[1,"text-success",2,"width","120px"],[2,"width","100px"],["matTooltipPosition","above",3,"matTooltip",4,"ngIf"],[1,"table-footer"],[1,"text-end",2,"width","250px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","150px"],["style","width: 100px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","100px"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),h("textChange",function(P){return u(l),x(t.pageData.Filter.Number,P)||(t.pageData.Filter.Number=P),_(P)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,N0,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,G0,29,15,"ng-template",null,0,M),a(),n(19,"content"),g(20,tc,5,5,"div",7),a()()}o&2&&(m("pageData",t.menuData),C("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService.global.Export),r(6),m("routerLink",b(10,B0)),r(3),m("routerLink",b(11,O0)),r(3),m("routerLink",b(12,L0)),r(6),m("ngIf",t.data))},dependencies:[N,k,A,z,K,O,L,le,we,Le,Qr,sr,Ur,jr,Yr,qr,fe,Q,Qe,$i,te,ee,X,Z],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 ic=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],nc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],ac=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function rc(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 oc(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.CustomerID)}}function lc(i,c){if(i&1&&(n(0,"th",23),p(1),a()),i&2){let e=c.$implicit;m("mat-sort-header",e),r(),w(e)}}function pc(i,c){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=s().$implicit;r(),w(e.Value)}}function mc(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),w(f(2,1,e.Value))}}function sc(i,c){if(i&1&&(n(0,"td"),g(1,pc,2,1,"span",22)(2,mc,3,3,"span",22),a()),i&2){let e=c.$implicit;r(),m("ngIf",e.Key=="Category"),r(),m("ngIf",e.Key!="Category")}}function cc(i,c){if(i&1&&(n(0,"tr"),g(1,sc,3,2,"td",21),a()),i&2){let e=c.$implicit;r(),m("ngForOf",e)}}function dc(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;r(),v(" ",f(2,1,e),"")}}function uc(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",24)(2,"td"),p(3,"Total : "),a(),g(4,dc,3,3,"td",21),a()()),i&2){let e=s(2);r(4),m("ngForOf",e.data.Sum)}}function _c(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,lc,2,2,"th",20),a()(),n(5,"tbody"),g(6,cc,2,1,"tr",21),a(),g(7,uc,5,1,"tfoot",22),a()()}if(i&2){let e=s();r(4),m("ngForOf",e.data.Dataheader),r(2),m("ngForOf",e.data.Data),r(),m("ngIf",e.data.Data.length>0)}}var Tn=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}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 o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";for(let P=0;P<this.data.Dataheader.length;P++)if(e.active==this.data.Dataheader[P]){let Ee=t.find(dt=>dt.Key===[this.data.Dataheader[P]].toString()).Value,xt=l.find(dt=>dt.Key===[this.data.Dataheader[P]].toString()).Value;return this.compare(Ee,xt,S)}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};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(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),h("textChange",function(P){return u(l),x(t.pageData.Filter.Number,P)||(t.pageData.Filter.Number=P),_(P)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,rc,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," 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,oc,16,9,"ng-template",null,0,M),a(),n(19,"content"),g(20,_c,8,3,"div",7),a()()}o&2&&(m("pageData",t.menuData),C("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(6),m("routerLink",b(10,ic)),r(3),m("routerLink",b(11,nc)),r(3),m("routerLink",b(12,ac)),r(6),m("ngIf",t.data))},dependencies:[N,j,k,A,K,O,L,ae,ge,Le,fe,Q,X],encapsulation:2})};var gc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],fc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Cc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function xc(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=s();r(3),C("ngModel",e.pageData.Filter.Month),m("items",e.Months),r(3),C("ngModel",e.pageData.Filter.Year),m("items",e.Years),r(3),C("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies)}}function hc(i,c){if(i&1&&(n(0,"div",11),I(1,"POS-pie-chart",12),a()),i&2){let e=s();r(),m("config",e.pieConfig)("data",e.PieData)}}var Pn=class i extends ie{constructor(e,o){super(e,o,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=o}Months=V.Months;Years=V.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.GrossSales}))}static \u0275fac=function(o){return new(o||i)(D(W),D(B))};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(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),h("textChange",function(P){return u(l),x(t.pageData.Filter.Number,P)||(t.pageData.Filter.Number=P),_(P)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),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,xc,10,6,"ng-template",null,0,M),a(),n(18,"content"),g(19,hc,2,2,"div",6),a()()}o&2&&(m("pageData",t.menuData),C("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(7),m("routerLink",b(8,gc)),r(3),m("routerLink",b(9,fc)),r(3),m("routerLink",b(10,Cc)),r(6),m("ngIf",t.data))},dependencies:[N,k,A,z,O,L,ii],encapsulation:2})};var Sc=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function yc(i,c){if(i&1){let e=F();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),m("items",e.pageData.Options.SalesOrderTagIDs),C("ngModel",e.pageData.Filter.SalesOrderTagIDs),m("multiple",!0)}}function Dc(i,c){if(i&1&&(n(0,"div",11)(1,"div",12)(2,"div",13)(3,"div",14)(4,"div",15)(5,"div",16)(6,"p",17),p(7,"Transaction Per Hour"),a()(),n(8,"div",18),I(9,"POS-line-chart",19),a()()()(),n(10,"div",13)(11,"div",14)(12,"div",15)(13,"div",16)(14,"p",17),p(15,"Transaction Per Session"),a()(),n(16,"div",18),I(17,"POS-pie-chart",19),a()()()()()()),i&2){let e=s();r(9),m("config",e.chartConfig)("data",e.ChartData),r(8),m("config",e.pieConfig)("data",e.PieData)}}var Fn=class i extends he{constructor(e,o,t){super(e,o,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=o;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,o=[],t=[];this.data.Data.forEach(l=>{o.push(l.Name);let S={name:l.Name+": "+l.Description,y:l.Transaction};t.push(S)}),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,S){return l+"<br/>"+S.series.name+": <b>"+S.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(G))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[R],decls:10,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["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(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions")(2,"a",2),I(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),g(6,yc,13,9,"ng-template",null,0,M),a(),n(8,"content"),g(9,Dc,18,4,"div",4),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("routerLink",b(6,Sc)),r(7),m("ngIf",t.data))},dependencies:[N,k,A,z,K,O,L,ii,Et,Q],encapsulation:2})};function vc(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 wc(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",8),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function Tc(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;r(2),w(f(3,5,e.Visitor)),r(3),w(f(6,7,e.Orders)),r(3),w(f(9,9,e.TotalVisitor)),r(3),w(f(12,11,e.Sales)),r(3),w(f(15,13,e.Sales/(e.Visitor*e.Orders)))}}function Pc(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,Tc,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();r(15),m("ngForOf",e.data),r(6),w(f(23,8,y(22,5,e.data,"Orders"))),r(4),w(f(27,13,y(26,10,e.data,"TotalVisitor"))),r(4),w(f(31,18,y(30,15,e.data,"Sales"))),r(4),w(f(34,20,e.getSpendingPerPersonSum(e.data)))}}var In=class i extends ie{constructor(e,o,t,l,S){super(e,o,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}getSpendingPerPersonSum(e){return e.reduce((o,t)=>o+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(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};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(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,vc,3,0,"a",2),a(),n(3,"filters"),g(4,wc,10,6,"ng-template",null,0,M),a(),n(6,"content"),g(7,Pc,35,22,"div",3),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(5),m("ngIf",t.data))},dependencies:[N,j,k,K,O,L,Q,re,te,X],encapsulation:2})};var Fc=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function Ic(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 bc(i,c){if(i&1){let e=F();n(0,"div",20)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",21),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function Ec(i,c){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Mc(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),w(f(2,1,e.Revenue))}}function Vc(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,Mc,3,3,"td",17),a()),i&2){let e=c.$implicit,o=s();r(2),w(e.TimeFormat),r(2),w(f(5,7,e.Count)),r(3),w(f(8,9,e.Quantity)),r(3),w(f(11,11,e.Sales)),r(3),w(f(15,15,f(14,13,e.Tax))),r(4),w(f(19,19,f(18,17,e.SalesWithTax))),r(3),m("ngIf",o.roleService.product.Cost||o.roleService.report.Profit)}}function Bc(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s();r(),w(f(3,4,y(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var bn=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}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(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};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(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,Ic,3,0,"a",2),n(3,"a",3),I(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),g(7,bc,10,6,"ng-template",null,0,M),a(),n(9,"content")(10,"div",5)(11,"table",6)(12,"thead",7)(13,"tr")(14,"th",8),p(15,"Time"),a(),n(16,"th",9),p(17,"Orders"),a(),n(18,"th",9),p(19,"Quantity"),a(),n(20,"th",10),p(21,"Sales"),a(),n(22,"th",10),p(23,"Tax"),a(),n(24,"th",10),p(25,"Sales + Tax"),a(),g(26,Ec,2,0,"th",11),a()(),n(27,"tbody"),g(28,Vc,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,Bc,4,6,"td",17),a()()()()()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(),m("routerLink",b(43,Fc)),r(23),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit),r(2),m("ngForOf",t.data==null?null:t.data.Data),r(5),w(f(35,17,y(34,14,t.data==null?null:t.data.Data,"Count"))),r(4),w(f(39,22,y(38,19,t.data==null?null:t.data.Data,"Quantity"))),r(4),w(f(43,27,y(42,24,t.data==null?null:t.data.Data,"Sales"))),r(4),w(f(48,34,f(47,32,y(46,29,t.data==null?null:t.data.Data,"Tax")))),r(5),w(f(53,41,f(52,39,y(51,36,t.data==null?null:t.data.Data,"SalesWithTax")))),r(4),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit))},dependencies:[N,j,k,A,K,O,L,Q,re,Lr,te,X,Z],encapsulation:2})};var Oc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],Na=(i,c)=>({From:i,To:c}),Lc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Rc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function kc(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),T("dateChange",function(t){u(e);let l=s();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=s();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),r(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function Wc(i,c){if(i&1&&(n(0,"div",12),I(1,"POS-line-chart",13),a()),i&2){let e=s();r(),m("config",e.chartConfig)("data",e.ChartData)}}var En=class i extends ie{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(c,e,o){super(c,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,o),this.initValidateFilterDate()}preInitList(){let c=this.route.snapshot.queryParams;c.From&&(this.pageData.Filter.From=c.From,this.pageData.Filter.To=c.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let c=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return V.getDatesInRange(c,e).map(l=>`${l.getDate()} ${V.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(c){this.pageData.Filter.From=c.from,this.pageData.Filter.To=c.to}static \u0275fac=function(e){return new(e||i)(D(W),D(B),D(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[R],decls:20,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"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,o){if(e&1){let t=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(t),_(o.searchFromPageOne())}),h("filterChange",function(S){return u(t),x(o.pageData.Filter,S)||(o.pageData.Filter=S),_(S)}),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,kc,13,11,"ng-template",null,0,M),a(),n(18,"content"),g(19,Wc,2,2,"div",6),a()()}e&2&&(m("pageData",o.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",o.pageData.Filter),r(7),m("routerLink",b(11,Oc))("queryParams",de(12,Na,o.pageData.Filter==null?null:o.pageData.Filter.From,o.pageData.Filter==null?null:o.pageData.Filter.To)),r(3),m("routerLink",b(15,Lc))("queryParams",de(16,Na,o.pageData.Filter==null?null:o.pageData.Filter.From,o.pageData.Filter==null?null:o.pageData.Filter.To)),r(3),m("routerLink",b(19,Rc))("queryParams",de(20,Na,o.pageData.Filter==null?null:o.pageData.Filter.From,o.pageData.Filter==null?null:o.pageData.Filter.To)),r(6),m("ngIf",o.data))},dependencies:[N,k,A,z,O,L,Et,Nt,fe,Q],encapsulation:2})};var Nc={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},oi=class i{date;dateChange=new Ri;width;minDate=V.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(c,e){let o=null;c&&(o=c.toDate(),o.setHours(0,0,0,0)),this.date=o,this.dateChange.emit(o),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")}}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:[Hi([{provide:hr,useClass:Hr,deps:[xr,Gr]},{provide:Sr,useValue:Nc}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"monthSelected","opened","closed"]],template:function(e,o){if(e&1){let t=F();n(0,"mat-form-field",1)(1,"input",2),T("dateChange",function(S){return u(t),_(o.onDateChange(S.value))}),a(),I(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),T("monthSelected",function(S){u(t);let P=lt(4);return _(o.setMonthAndYear(S,P))})("opened",function(){return u(t),_(o.onOpenDatepicker())})("closed",function(){return u(t),_(o.onCloseDatepicker())}),a()()}if(e&2){let t=lt(4);Ja("width",o.width||100,"%"),r(),m("matDatepicker",t)("value",o.date==o.minDate?null:o.date),r(),m("for",t)}},dependencies:[Xt,Xi,zi,vr,wr,Tr,Zi,br,Dr,yr,Ir],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
2
|
+
`],encapsulation:2})};var Gc=()=>["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"];function Hc(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker-year-month",8),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(10,"h6"),p(11,"Compare To Year"),a(),n(12,"ng-select",10),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.LastYear,t)||(l.pageData.Filter.LastYear=t),_(t)}),a(),n(13,"h6"),p(14,"Category"),a(),n(15,"POS-product-category-select",11),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",12),h("ngModelChange",function(t){u(e);let l=s();return x(l.currency,t)||(l.currency=t),_(t)}),T("change",function(){u(e);let t=s();return _(t.checkFilterCurrency())}),a()()}if(i&2){let e=s();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.LastYear),m("items",e.optionsCompareYear),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.currency),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function Qc(i,c){if(i&1&&(n(0,"div",13),I(1,"POS-line-chart",14),a()),i&2){let e=s();r(),m("config",e.chartConfig)("data",e.chartData)}}var Vn=class i extends ie{constructor(e,o,t){super(e,o,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance");this.httpService=o;this.csvConverter=t}chartData={Series:[]};chartConfig;currency=-1;optionsCompareYear=[{value:1,label:"Last one year"},{value:2,label:"Last two year"}];onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=this.generateSeries();this.chartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:void 0},labels:{formatter:function(){return V.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let o,t="",l=Math.abs(this.total);return l>999&&l<1e10?(t="K",o=(l/1e3).toFixed(0)):l>=1e10?(t="M",o=(l/1e6).toFixed(0)):l<999&&(o=l.toString()),this.total<0&&(o="-"+o),o.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 o=this.series.chart.series,t=this.point?.stackTotal;o=o.filter(Ee=>this.series?.name==Ee?.name);let l=[],S="",P=this.point.index;return o.forEach(Ee=>{Ee.options.stack===this.point.series.options.stack&&(l=Ee.name.split(" "),S+=`
|
|
3
|
+
<b>${this.point.category}</b></br>Total:
|
|
4
|
+
${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(t)}</br>${l[0]}:
|
|
5
|
+
${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(Ee.points[P].y)}</br>
|
|
6
|
+
`)}),S}}}}generateSeries(){let e,o=[];return o=this.data.MonthlySalesRank.map(t=>(e={name:`${t.Name} ${t.CompareYear}`,data:t.Sales,stack:t.Year},e)),o}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-monthly-sales"]],standalone:!1,features:[R],decls:11,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"dateChange","date"],[1,"mt-4"],["appendTo","body","bindValue","value","bindLabel","label","placeholder","Compare To Year",3,"ngModelChange","ngModel","items"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions")(2,"div",2)(3,"a",3),I(4,"i",4),p(5,"Table View"),a()()(),n(6,"filters"),g(7,Hc,19,12,"ng-template",null,0,M),a(),n(9,"content"),g(10,Qc,2,2,"div",5),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(3),m("routerLink",b(6,Gc)),r(7),m("ngIf",t.data))},dependencies:[N,k,A,z,O,L,le,Et,oi,fe,Q],encapsulation:2})};var jc=()=>["/menu/Reports/Sales_Report/Standard/Yearly"],Yc=(i,c)=>({"text-success":i,"text-danger":c}),fo=(i,c)=>({"text-success fw-bold":i,"text-danger fw-bold":c});function qc(i,c){if(i&1){let e=F();n(0,"a",6),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",7),p(2," Export "),a()}}function Uc(i,c){if(i&1){let e=F();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year to Compare"),a(),n(12,"div",12)(13,"div",13)(14,"ng-select",14),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.FromYear,t)||(l.pageData.Filter.FromYear=t),_(t)}),a()(),n(15,"div",13)(16,"ng-select",15),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ToYear,t)||(l.pageData.Filter.ToYear=t),_(t)}),a()()(),n(17,"h6"),p(18,"Sales Order Tag"),a(),n(19,"ng-select",16),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(20,"h6"),p(21,"Currency"),a(),n(22,"ng-select",17),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Option.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.pageData.Filter.SalesID),r(5),C("ngModel",e.pageData.Filter.FromYear),m("items",e.Years),r(2),C("ngModel",e.pageData.Filter.ToYear),m("items",e.Years),r(3),C("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Option==null?null:e.pageData.Option.Types),r(3),C("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Option.Currencies)}}function Kc(i,c){if(i&1&&(n(0,"th",29),d(1,"GetChildrenArray"),d(2,"sum"),p(3),a()),i&2){let e=c.$implicit,o=s(2);m("colSpan",y(2,5,o.filterSales(y(1,2,o.data.Data,"Sales"),"Year",e),"Tax")==0?1:3),r(3),v(" ",e,"")}}function zc(i,c){i&1&&(n(0,"th",33),p(1," Sales"),a())}function Xc(i,c){i&1&&(n(0,"th",32),p(1," Tax"),a())}function Zc(i,c){if(i&1&&(se(0),g(1,zc,2,0,"th",30),d(2,"GetChildrenArray"),d(3,"sum"),g(4,Xc,2,0,"th",31),d(5,"GetChildrenArray"),d(6,"sum"),n(7,"th",32),p(8," Sales + Tax"),a(),ce()),i&2){let e=c.$implicit,o=s(2);r(),m("ngIf",y(3,5,o.filterSales(y(2,2,o.data.Data,"Sales"),"Year",e),"Tax")!=0),r(3),m("ngIf",y(6,11,o.filterSales(y(5,8,o.data.Data,"Sales"),"Year",e),"Tax")!=0)}}function Jc(i,c){if(i&1&&(n(0,"td",32),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s().$implicit,o=s().$implicit,t=s(2);r(),v(" ",f(3,4,y(2,1,t.filterSales(o.Sales,"Year",e),"Sales")),"")}}function $c(i,c){if(i&1&&(n(0,"td",32),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s().$implicit,o=s().$implicit,t=s(2);r(),v(" ",f(3,4,y(2,1,t.filterSales(o.Sales,"Year",e),"Tax"))," ")}}function ed(i,c){if(i&1&&(se(0),g(1,Jc,4,6,"td",31),d(2,"GetChildrenArray"),d(3,"sum"),g(4,$c,4,6,"td",31),d(5,"GetChildrenArray"),d(6,"sum"),n(7,"td",32),p(8),d(9,"sum"),d(10,"amountFraction"),a(),ce()),i&2){let e=c.$implicit,o=s().$implicit,t=s(2);r(),m("ngIf",y(3,6,t.filterSales(y(2,3,t.data.Data,"Sales"),"Year",e),"Tax")!=0),r(3),m("ngIf",y(6,12,t.filterSales(y(5,9,t.data.Data,"Sales"),"Year",e),"Tax")!=0),r(4),v(" ",f(10,18,y(9,15,t.filterSales(o.Sales,"Year",e),"SalesWithTax")),"")}}function td(i,c){if(i&1&&(n(0,"tr",34)(1,"td"),p(2),d(3,"Month"),a(),g(4,ed,11,20,"ng-container",24),n(5,"td",28),d(6,"sum"),d(7,"sum"),p(8),d(9,"sum"),d(10,"number"),a(),n(11,"td",28),d(12,"sum"),d(13,"sum"),p(14),d(15,"sum"),d(16,"number"),a()()),i&2){let e=c.$implicit,o=s(2);r(2),w(f(3,6,e.Month)),r(2),m("ngForOf",o.data.HeaderList),r(),m("ngClass",de(30,fo,y(6,8,o.filterSales(e.Difference,"Month",e.Month),"Difference")>0,y(7,11,o.filterSales(e.Difference,"Month",e.Month),"Difference")<0)),r(3),v(" ",f(10,17,y(9,14,o.filterSales(e.Difference,"Month",e.Month),"Difference"))," "),r(3),m("ngClass",de(33,fo,y(12,19,o.filterSales(e.Difference,"Month",e.Month),"Percentage")>0,y(13,22,o.filterSales(e.Difference,"Month",e.Month),"Percentage")<0)),r(3),v(" ",f(16,28,y(15,25,o.filterSales(e.Difference,"Month",e.Month),"Percentage"))," ")}}function id(i,c){if(i&1&&(n(0,"td",37),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s().$implicit,o=s(2);r(),v(" ",f(4,7,y(3,4,o.filterSales(y(2,1,o.data.Data,"Sales"),"Year",e),"Sales")),"")}}function nd(i,c){if(i&1&&(n(0,"td",38),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s().$implicit,o=s(2);r(),v(" ",f(4,7,y(3,4,o.filterSales(y(2,1,o.data.Data,"Sales"),"Year",e),"Tax")),"")}}function ad(i,c){if(i&1&&(se(0),g(1,id,5,9,"td",35),d(2,"GetChildrenArray"),d(3,"sum"),g(4,nd,5,9,"td",36),d(5,"GetChildrenArray"),d(6,"sum"),n(7,"td",37),p(8),d(9,"GetChildrenArray"),d(10,"sum"),d(11,"amountFraction"),a(),ce()),i&2){let e=c.$implicit,o=s(2);r(),m("ngIf",y(3,6,o.filterSales(y(2,3,o.data.Data,"Sales"),"Year",e),"Tax")!=0),r(3),m("ngIf",y(6,12,o.filterSales(y(5,9,o.data.Data,"Sales"),"Year",e),"Tax")!=0),r(4),v(" ",f(11,21,y(10,18,o.filterSales(y(9,15,o.data.Data,"Sales"),"Year",e),"SalesWithTax")),"")}}function rd(i,c){if(i&1&&(n(0,"div",18)(1,"table",19)(2,"thead",20)(3,"tr")(4,"th",21),p(5,"Month"),a(),g(6,Kc,4,8,"th",22),n(7,"th",23),p(8,"Diff"),a(),n(9,"th",23),p(10,"%"),a()(),n(11,"tr"),g(12,Zc,9,14,"ng-container",24),a()(),n(13,"tbody"),g(14,td,17,36,"tr",25),a(),n(15,"tfoot",26)(16,"tr")(17,"td",27),p(18,"Total :"),a(),g(19,ad,12,23,"ng-container",24),n(20,"td",28),p(21),d(22,"number"),a()()()()()),i&2){let e=s();r(6),m("ngForOf",e.data.HeaderList),r(6),m("ngForOf",e.data.HeaderList),r(2),m("ngForOf",e.data.Data),r(5),m("ngForOf",e.data.HeaderList),r(),m("ngClass",de(8,Yc,e.data.TotalDiff>0,e.data.TotalDiff<0)),r(),v(" ",f(22,6,e.data.TotalDiff),"")}}var Bn=class i extends ie{constructor(e,o,t,l,S){super(e,o,"Report/YearlySalesList","ReportLoader/YearlyReportSales");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}subheader=["Sales","Tax","Sales+Tax"];prop=["Sales","Tax","SalesWithTax"];Years=V.GenerateYears(new Date().getFullYear(),11,!0);filterSales(e,o,t){return e.filter(function(l){return l[o]==t})}openExportModal(){this.matDialog.open(q,{data:{title:"Yearly",exportTypes:[{ID:"ReportExport/YearlySalesList",Value:"Default",FileName:"Yearly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-yearly"]],standalone:!1,features:[R],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[1,"row"],[1,"col-6"],["appendTo","body","placeholder","Choose Year From",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year To",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["rowspan","2"],["class"," text-center border-start border-end",3,"colSpan",4,"ngFor","ngForOf"],["rowspan","2",1,"text-end"],[4,"ngFor","ngForOf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"fw-bold","text-success"],[1,"text-end",3,"ngClass"],[1,"text-center","border-start","border-end",3,"colSpan"],["class","text-end border-start",4,"ngIf"],["class","text-end",4,"ngIf"],[1,"text-end"],[1,"text-end","border-start"],[1,"border-bottom"],["class","text-end text-success",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"text-end","text-success"],[1,"text-end","text-warning-emphasis"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,qc,3,0,"a",2),n(3,"a",3),I(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),g(7,Uc,23,15,"ng-template",null,0,M),a(),n(9,"content"),g(10,rd,23,11,"div",5),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(),m("routerLink",b(7,jc)),r(7),m("ngIf",t.data))},dependencies:[N,Ae,j,k,A,z,O,L,le,fe,Q,Qe,re,nn,Rr,te,X],encapsulation:2})};var od=()=>["/menu/Reports/Sales_Report/Standard/Daily"],Aa=(i,c)=>({From:i,To:c}),ld=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],pd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"],Co=i=>({"is-weekend":i});function md(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 sd(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=s();return x(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),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",13),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",14),T("dateChange",function(t){u(e);let l=s();return _(l.onFilterDateChange(t))}),a(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",15),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",16),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(19,"h6"),p(20,"Sales Order Tag"),a(),n(21,"ng-select",17),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.pageData.Filter.SalesID),r(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate),r(3),C("ngModel",e.pageData.Filter.DeliveryID),m("items",e.pageData.Options==null?null:e.pageData.Options.Deliveries),r(3),C("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),r(3),C("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function cd(i,c){i&1&&(n(0,"th",39),p(1," Tax "),a())}function dd(i,c){i&1&&(n(0,"th",40),p(1,"Net Sales + Tax"),a())}function ud(i,c){i&1&&(n(0,"th",41),p(1,"Cost"),a())}function _d(i,c){i&1&&(n(0,"th",42),p(1," Profit "),a())}function gd(i,c){i&1&&(n(0,"th",43),p(1," Profit + Tax Include "),a())}function fd(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),w(f(2,1,e.Tax))}}function Cd(i,c){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v("",f(2,1,e.SalesNetWithTax)," ")}}function xd(i,c){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Cost),"")}}function hd(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Profit>=0?"text-success":"text-danger"),r(),v(" ",f(2,2,e.Profit),"")}}function Sd(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.ProfitWithTax>=0?"text-success":"text-danger"),r(),v(" ",f(2,2,e.ProfitWithTax),"")}}function yd(i,c){if(i&1&&(n(0,"tr",44)(1,"td",44),p(2),d(3,"date"),a(),n(4,"td"),p(5),d(6,"date"),a(),n(7,"td",34),p(8),d(9,"number"),a(),n(10,"td",34),p(11),d(12,"quantityFraction"),a(),n(13,"td",34),p(14),d(15,"amountFraction"),a(),n(16,"td",34),p(17),d(18,"amountFraction"),a(),g(19,fd,3,3,"td",45)(20,Cd,3,3,"td",35)(21,xd,3,3,"td",36)(22,hd,3,4,"td",38)(23,Sd,3,4,"td",38),a()),i&2){let e=c.$implicit,o=s(2);m("ngClass",U(27,Co,o.data.DayOfWeekend)),r(),m("ngClass",U(29,Co,e.DayOfWeekend)),r(),v(" ",y(3,13,e.Day,"EEEE")," "),r(3),w(y(6,16,e.Day,"dd")),r(3),w(f(9,19,e.Count)),r(3),w(f(12,21,e.Quantity)),r(3),w(f(15,23,e.Gross)),r(3),w(f(18,25,e.SalesNet)),r(2),m("ngIf",o.data.ShowTax),r(),m("ngIf",o.data.ShowTax),r(),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.pageData.Config.IgnoreTax&&o.roleService.report.Profit&&o.roleService.product.Cost),r(),m("ngIf",!o.pageData.Config.IgnoreTax&&o.roleService.report.Profit&&o.roleService.product.Cost)}}function Dd(i,c){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Tax")),"")}}function vd(i,c){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"SalesNetWithTax")),"")}}function wd(i,c){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Cost")),"")}}function Td(i,c){if(i&1&&(n(0,"td",49),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",y(1,2,e.data.Data,"Profit")>=0?"text-success":"text-danger"),r(2),v(" ",f(4,8,y(3,5,e.data.Data,"Profit")),"")}}function Pd(i,c){if(i&1&&(n(0,"td",48),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",y(1,2,e.data.Data,"ProfitWithTax")>=0?"text-success":"text-danger"),r(2),v(" ",f(4,8,y(3,5,e.data.Data,"ProfitWithTax")),"")}}function Fd(i,c){if(i&1){let e=F();n(0,"div",18)(1,"table",19),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",20)(3,"tr")(4,"th",21),p(5,"Day"),a(),n(6,"th",22),p(7,"Dt."),a(),n(8,"th",23),p(9,"Orders "),a(),n(10,"th",24),p(11," Quantity"),a(),n(12,"th",25),p(13," Gross"),a(),n(14,"th",26),p(15," Net Sales"),a(),g(16,cd,2,0,"th",27)(17,dd,2,0,"th",28)(18,ud,2,0,"th",29)(19,_d,2,0,"th",30)(20,gd,2,0,"th",31),a()(),n(21,"tbody"),g(22,yd,24,31,"tr",32),a(),n(23,"tfoot")(24,"tr"),I(25,"td",33)(26,"td",33),n(27,"td",34),p(28),d(29,"sum"),d(30,"number"),a(),n(31,"td",34),p(32),d(33,"sum"),d(34,"quantityFraction"),a(),n(35,"td",34),p(36),d(37,"sum"),d(38,"amountFraction"),a(),n(39,"td",34),p(40),d(41,"sum"),d(42,"amountFraction"),a(),g(43,Dd,4,6,"td",35)(44,vd,4,6,"td",35)(45,wd,4,6,"td",36)(46,Td,5,10,"td",37)(47,Pd,5,10,"td",38),a()()()()}if(i&2){let e=s();r(16),m("ngIf",e.data.ShowTax),r(),m("ngIf",e.data.ShowTax),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost),r(),m("ngIf",!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost),r(2),m("ngForOf",e.data.Data),r(6),w(f(30,18,y(29,15,e.data.Data,"Count"))),r(4),w(f(34,23,y(33,20,e.data.Data,"Quantity"))),r(4),w(f(38,28,y(37,25,e.data.Data,"Gross"))),r(4),w(f(42,33,y(41,30,e.data.Data,"SalesNet"))),r(3),m("ngIf",e.data.ShowTax),r(),m("ngIf",e.data.ShowTax),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost),r(),m("ngIf",!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost)}}var On=class i extends ie{constructor(e,o,t,l,S,P){super(e,o,"Report/DailySalesList","ReportLoader/DailyReportSales",null,P);this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S;this.activatedRoute=P}maxFilterDate=new Date;originalData;hideMore=!0;postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data}preInitList(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";return this.compare(t[e.active],l[e.active],S)})}onFilterDateChange(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to}openExportModal(){this.matDialog.open(q,{data:{title:"Daily Sales Report",exportTypes:[{ID:"ReportExport/DailySalesExport",Value:"Default",FileName:"Daily Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y),D(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-daily"]],standalone:!1,features:[R],decls:21,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to","maxDate"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid","api","Report/DailySalesList","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Day",2,"width","90px"],["mat-sort-header","Date",1,"align-left",2,"width","42px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Gross","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","120px"],["style","width: 120px","class"," flex-right","mat-sort-header","Tax","arrowPosition","before",4,"ngIf"],["style","width: 120px","class"," flex-right","mat-sort-header","SalesNetWithTax","arrowPosition","before",4,"ngIf"],["style","width: 120px","class"," flex-right","mat-sort-header","Cost","arrowPosition","before",4,"ngIf"],["style","width: 120px","class"," flex-right","mat-sort-header","Profit","arrowPosition","before",4,"ngIf"],["style","width: 160px","class"," flex-right","mat-sort-header","ProfitWithTax","arrowPosition","before",4,"ngIf"],[3,"ngClass",4,"ngFor","ngForOf"],[1,"empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-danger",3,"ngClass",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNetWithTax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","ProfitWithTax","arrowPosition","before",1,"flex-right",2,"width","160px"],[3,"ngClass"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"],[1,"text-end","text-danger",3,"ngClass"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,md,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Sales Chart "),a()(),n(10,"li")(11,"a",6),p(12," Daily Quantity Sold "),a()(),n(13,"li")(14,"a",6),p(15," Monthly Quantity Sold "),a()()()()(),n(16,"filters"),g(17,sd,22,16,"ng-template",null,0,M),a(),n(19,"content"),g(20,Fd,48,35,"div",7),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(6),m("routerLink",b(12,od))("queryParams",de(13,Aa,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),r(3),m("routerLink",b(16,ld))("queryParams",de(17,Aa,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),r(3),m("routerLink",b(20,pd))("queryParams",de(21,Aa,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),r(6),m("ngIf",t.data))},dependencies:[N,Ae,j,k,A,z,O,L,ae,ge,Nt,fe,Q,Qe,re,te,ee,X,Z],encapsulation:2})};var Id=()=>["/menu/Reports/Sales_Report/Standard/Monthly"];function bd(i,c){if(i&1){let e=F();n(0,"a",6),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",7),p(2," Export "),a()}}function Ed(i,c){if(i&1){let e=F();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),h("ngModelChange",function(t){u(e);let l=s();return x(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",10),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year"),a(),n(12,"ng-select",12),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(13,"h6"),p(14,"Currency"),a(),n(15,"ng-select",13),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(16,"h6"),p(17,"Sales Order Tag"),a(),n(18,"ng-select",14),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(19,"h6"),p(20,"Multiply Unit Qty"),a(),n(21,"radio-options",15),h("modelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.pageData.Filter.SalesID),r(3),C("ngModel",e.pageData.Filter.Year),m("items",e.Years),r(3),C("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),r(3),C("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),r(3),C("model",e.pageData.Filter.MultiplyUnitQuantity)}}function Md(i,c){i&1&&(n(0,"th",21),p(1,"Tax"),a())}function Vd(i,c){i&1&&(n(0,"th",21),p(1,"Sales + Tax"),a())}function Bd(i,c){i&1&&(n(0,"th",21),p(1,"Cost"),a())}function Od(i,c){i&1&&(n(0,"th",21),p(1,"Profit"),a())}function Ld(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),w(f(2,1,e.Tax))}}function Rd(i,c){if(i&1&&(n(0,"td",32),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),w(f(2,1,e.SalesNetWithTax))}}function kd(i,c){if(i&1&&(n(0,"td",33),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Cost)," ")}}function Wd(i,c){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Profit)," ")}}function Nd(i,c){if(i&1&&(n(0,"tr",30)(1,"td"),p(2),d(3,"Month"),a(),n(4,"td",25),p(5),d(6,"number"),a(),n(7,"td",25),p(8),d(9,"quantityFraction"),a(),n(10,"td",25),p(11),d(12,"amountFraction"),a(),n(13,"td",25),p(14),d(15,"amountFraction"),a(),g(16,Ld,3,3,"td",26)(17,Rd,3,3,"td",27)(18,kd,3,3,"td",28)(19,Wd,3,3,"td",29),a()),i&2){let e=c.$implicit,o=s(2);r(2),w(f(3,9,e.Month)),r(3),w(f(6,11,e.Count)),r(3),w(f(9,13,e.Quantity)),r(3),w(f(12,15,e.Gross)),r(3),w(f(15,17,e.Sales)),r(2),m("ngIf",o.data.ShowTax),r(),m("ngIf",o.data.ShowTax),r(),m("ngIf",o.roleService.product.Cost&&o.roleService.report.Profit),r(),m("ngIf",o.roleService.product.Cost&&o.roleService.report.Profit)}}function Ad(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Tax")),"")}}function Gd(i,c){if(i&1&&(n(0,"td",32),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"SalesNetWithTax")),"")}}function Hd(i,c){if(i&1&&(n(0,"td",33),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Cost")),"")}}function Qd(i,c){if(i&1&&(n(0,"td",25),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Profit")),"")}}function jd(i,c){if(i&1&&(n(0,"div",16)(1,"table",17)(2,"thead",18)(3,"tr")(4,"th",19),p(5,"Month"),a(),n(6,"th",20),p(7,"Orders"),a(),n(8,"th",21),p(9,"Quantity"),a(),n(10,"th",21),p(11,"Gross"),a(),n(12,"th",21),p(13,"Net Sales"),a(),g(14,Md,2,0,"th",22)(15,Vd,2,0,"th",22)(16,Bd,2,0,"th",22)(17,Od,2,0,"th",22),a()(),n(18,"tbody"),g(19,Nd,20,19,"tr",23),a(),n(20,"tfoot")(21,"tr",24),I(22,"td"),n(23,"td",25),p(24),d(25,"sum"),d(26,"number"),a(),n(27,"td",25),p(28),d(29,"sum"),d(30,"quantityFraction"),a(),n(31,"td",25),p(32),d(33,"sum"),d(34,"amountFraction"),a(),n(35,"td",25),p(36),d(37,"sum"),d(38,"amountFraction"),a(),g(39,Ad,4,6,"td",26)(40,Gd,4,6,"td",27)(41,Hd,4,6,"td",28)(42,Qd,4,6,"td",29),a()()()()),i&2){let e=s();r(14),m("ngIf",e.data.ShowTax),r(),m("ngIf",e.data.ShowTax),r(),m("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),r(),m("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),r(2),m("ngForOf",e.data.Data),r(5),v("",f(26,16,y(25,13,e.data.Data,"Count"))," "),r(4),w(f(30,21,y(29,18,e.data.Data,"Quantity"))),r(4),v("",f(34,26,y(33,23,e.data.Data,"Gross"))," "),r(4),v("",f(38,31,y(37,28,e.data.Data,"Sales"))," "),r(3),m("ngIf",e.data.ShowTax),r(),m("ngIf",e.data.ShowTax),r(),m("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),r(),m("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit)}}var Ln=class i extends ie{constructor(e,o,t,l,S){super(e,o,"Report/MonthlySalesList","ReportLoader/MonthlyReportSales");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}Years=V.GenerateYears(new Date().getFullYear(),11,!0);preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(q,{data:{title:"Monthly",exportTypes:[{ID:"ReportExport/MonthlySalesList",Value:"Default",FileName:"Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-monthly"]],standalone:!1,features:[R],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Inventory",3,"modelChange","model"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","90px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class"," text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","text-success"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[1,"border-bottom"],[1,"text-end","text-warning-emphasis"],[1,"text-end"],[1,"text-end","text-danger"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),h("textChange",function(P){return u(l),x(t.pageData.Filter.Number,P)||(t.pageData.Filter.Number=P),_(P)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,bd,3,0,"a",2),n(3,"a",3),I(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),g(7,Ed,22,14,"ng-template",null,0,M),a(),n(9,"content"),g(10,jd,43,33,"div",5),a()()}o&2&&(m("pageData",t.menuData),C("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(),m("routerLink",b(7,Id)),r(7),m("ngIf",t.data))},dependencies:[N,j,k,A,z,O,L,le,we,fe,Q,Qe,re,nn,te,X,Z],encapsulation:2})};var Yd=()=>["/menu/Reports/Sales_Report/Standard/Daily"],xo=(i,c)=>({From:i,To:c}),qd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],Ud=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function Kd(i,c){if(i&1){let e=F();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",11),h("ngModelChange",function(t){u(e);let l=s();return x(l.currency,t)||(l.currency=t),_(t)}),T("change",function(){u(e);let t=s();return _(t.checkFilterCurrency())}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",12),T("dateChange",function(t){u(e);let l=s();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=s();r(3),m("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.currency),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),r(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)("minDate",e.minFilterDate)}}function zd(i,c){if(i&1&&(n(0,"div",13),I(1,"POS-line-chart",14),a()),i&2){let e=s();r(),m("config",e.chartConfig)("data",e.ChartData)}}var Rn=class i extends ie{constructor(e,o,t,l){super(e,o,"Report/DailySalesVolume","ReportLoader/DailyReportSales",null,l);this.httpService=o;this.csvConverter=t;this.initValidateFilterDate()}maxFilterDate;minFilterDate;Years=V.GenerateYears(new Date().getFullYear(),11,!0);chartConfig;currency=-1;Months=V.Months;ChartData={};initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,45)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.getQueryParams(),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}getQueryParams(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To)}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){this.menuData.H=this.data.PageTitle,this.initChart()}initChart(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},yAxis:{title:{text:""}},xAxis:{categories:this.generateChartCategories()},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let e=new Date(this.pageData.Filter.From),o=new Date(this.pageData.Filter.To);return V.getDatesInRange(e,o).map(S=>`${S.getDate()} ${V.Months[S.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(e){this.pageData.Filter.From=e.from?.toISOString(),this.pageData.Filter.To=e.to?.toISOString()}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-sales-volume"]],standalone:!1,features:[R],decls:20,vars:19,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"dateChange","from","to","maxDate","minDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",6),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),g(16,Kd,13,12,"ng-template",null,0,M),a(),n(18,"content"),g(19,zd,2,2,"div",7),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(7),m("routerLink",b(10,Yd))("queryParams",de(11,xo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),r(3),m("routerLink",b(14,qd))("queryParams",de(15,xo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),r(3),m("routerLink",b(18,Ud)),r(6),m("ngIf",t.data))},dependencies:[N,k,A,z,O,L,Et,Nt,fe,Q],encapsulation:2})};var Xd=()=>["/menu/Reports/Sales_Report/Standard/Daily"],Zd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],Jd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"];function $d(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Year"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",11),h("ngModelChange",function(t){u(e);let l=s();return x(l.currency,t)||(l.currency=t),_(t)}),T("change",function(){u(e);let t=s();return _(t.checkFilterCurrency())}),a()()}if(i&2){let e=s();r(3),m("accessType",2),C("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.pageData.Filter.Year),m("items",e.Years),r(3),C("ngModel",e.currency),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function eu(i,c){if(i&1&&(n(0,"div",12),I(1,"POS-line-chart",13),a()),i&2){let e=s();r(),m("config",e.chartConfig)("data",e.ChartData)}}var kn=class i extends ie{constructor(e,o,t){super(e,o,"Report/MonthtlySalesVolume","ReportLoader/MonthlySalesVolume");this.httpService=o;this.csvConverter=t}currency=-1;Years=V.GenerateYears(new Date().getFullYear(),11,!0);ChartData={};chartConfig;preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=[];this.data.MonthlySalesRank.forEach(o=>{let t=o.Sales.map(S=>parseInt(S)),l={name:o.Name,data:t};e.push(l)}),this.ChartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-monthly-volume"]],standalone:!1,features:[R],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",5),p(14," Daily Quantity Sold "),a()()()()(),n(15,"filters"),g(16,$d,13,9,"ng-template",null,0,M),a(),n(18,"content"),g(19,eu,2,2,"div",6),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(7),m("routerLink",b(8,Xd)),r(3),m("routerLink",b(9,Zd)),r(3),m("routerLink",b(10,Jd)),r(6),m("ngIf",t.data))},dependencies:[N,k,A,z,O,L,Et,fe,Q],encapsulation:2})};var tu=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],iu=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],nu=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"];function au(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",10),h("dateChange",function(t){u(e);let l=s();return x(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",11)(12,"datepicker",12),h("dateChange",function(t){u(e);let l=s();return x(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();r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function ru(i,c){if(i&1&&(n(0,"div",13),I(1,"POS-pie-chart",14),a()),i&2){let e=s();r(),m("config",e.pieConfig)("data",e.PieData)}}var Wn=class i extends ie{constructor(e,o){super(e,o,"Report/OutletPerformanceCart","ReportLoader/OutletPerformance");this.httpService=o}PieData={};pieConfig={title:"",dataLabels:!0,labelTooltips:"Sales",height:400,legend:{}};postInit(){this.getPieData(),this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getPieData(){let e=[],o=[];this.data.DataWithoutCategory.length>0&&this.data.DataWithoutCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};o.push(l)}),this.data.DataWithCategory.length>0&&this.data.DataWithCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};o.push(l)}),this.PieData=o}static \u0275fac=function(o){return new(o||i)(D(W),D(B))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-outlet-graphic"]],standalone:!1,features:[R],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Outlet Performance "),a()(),n(9,"li")(10,"a",5),p(11," Compare by Outlet Group "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Month "),a()()()()(),n(15,"filters"),g(16,au,13,6,"ng-template",null,0,M),a(),n(18,"content"),g(19,ru,2,2,"div",6),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(7),m("routerLink",b(8,tu)),r(3),m("routerLink",b(9,iu)),r(3),m("routerLink",b(10,nu)),r(6),m("ngIf",t.data))},dependencies:[N,k,A,z,K,O,L,ii,fe],encapsulation:2})};var Ga=Ut(ln());var ou=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],lu=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],pu=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],mu=(i,c)=>({rankDown:i,rankUp:c,"number key":!0}),su=(i,c,e)=>({EntityIDs:i,From:c,To:e}),yi=(i,c)=>({"text-danger":i,"text-success":c}),cu=()=>["/menu/Reports/Sales_Report/Standard/Summary"],du=(i,c,e)=>({EntityID:i,From:c,To:e}),ho=(i,c)=>({"text-warning":i,"text-success":c,"text-end":!0}),So=(i,c)=>({"text-success":i,"text-danger":c});function uu(i,c){if(i&1){let e=F();n(0,"a",12),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",13),p(2," Export "),a()}}function _u(i,c){if(i&1){let e=F();n(0,"div",14)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",15),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",16),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.TagIDs,t)||(l.pageData.Filter.TagIDs=t),_(t)}),a(),n(7,"h6"),p(8,"Outlet Group"),a(),n(9,"POS-outlet-group-tree-select",17),h("selectedOutletGroupIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"datepicker",18),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(14,"div",19)(15,"datepicker",20),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(16,"h6"),p(17,"Brand"),a(),n(18,"ng-select",21),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(19,"h6"),p(20,"Product Type"),a(),n(21,"radio-options",22),h("modelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(22,"h6"),p(23," Query Option "),I(24,"i",23),a(),n(25,"ng-select",24),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a()()}if(i&2){let e=s();r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),C("ngModel",e.pageData.Filter.TagIDs),r(3),m("showClear",!0),C("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),m("multiple",!0),C("ngModel",e.pageData.Filter.BrandIDs),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),r(3),C("model",e.pageData.Filter.ProductType),m("options",e.pageData.Options.ProductTypes),r(4),m("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),C("ngModel",e.pageData.Filter.QueryOption)}}function gu(i,c){i&1&&(n(0,"th",55),p(1," Prev "),a())}function fu(i,c){i&1&&(n(0,"th",56),p(1," Now "),a())}function Cu(i,c){i&1&&(n(0,"th",57),p(1," Orders "),a())}function xu(i,c){i&1&&(n(0,"th",58),p(1," Qty "),a())}function hu(i,c){i&1&&(n(0,"th",59),p(1," Gross "),a())}function Su(i,c){i&1&&(n(0,"th",60),p(1," Basket Size "),a())}function yu(i,c){i&1&&(n(0,"th",61),p(1," Sales "),a())}function Du(i,c){i&1&&(n(0,"th",62),p(1," Avg Daily Sales "),a())}function vu(i,c){i&1&&(n(0,"th",63),p(1," Inventory "),a())}function wu(i,c){i&1&&(se(0),n(1,"th",64),p(2," Target "),a(),ce())}function Tu(i,c){i&1&&(n(0,"th",66),p(1," Ach(%) "),a())}function Pu(i,c){if(i&1&&(se(0),g(1,Tu,2,0,"th",65),d(2,"HideSumZero"),d(3,"HideSumZero"),ce()),i&2){let e=s(2);r(),m("ngIf",y(2,1,e.data.Data,"AchievementWithTax")||y(3,4,e.data.Data,"Achievement"))}}function Fu(i,c){i&1&&(n(0,"th",67),p(1," Daily Target "),a())}function Iu(i,c){i&1&&(n(0,"th",68),p(1," Tax "),a())}function bu(i,c){if(i&1&&(n(0,"th",69),p(1," Sales + Tax "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Eu(i,c){i&1&&(n(0,"th",70),p(1,"\xB1 (%)"),a())}function Mu(i,c){i&1&&(n(0,"th",71),p(1," Cost "),a())}function Vu(i,c){if(i&1&&(n(0,"th",69),p(1," Profit "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function Bu(i,c){i&1&&(n(0,"th",72),p(1," Expense "),a())}function Ou(i,c){if(i&1&&(n(0,"td",75),p(1),a()),i&2){let e=s().$implicit;r(),v(" ",e.PrevIndex," ")}}function Lu(i,c){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=s(),o=e.$implicit,t=e.index;m("ngClass",de(2,mu,o.PrevIndex<t+1,o.PrevIndex>t+1)),r(),v(" ",o.CurrentIndex," ")}}function Ru(i,c){if(i&1&&(n(0,"td",70)(1,"a",77),p(2),d(3,"number"),a()()),i&2){let e=s().$implicit,o=s(2);r(),m("queryParams",st(5,su,e.EntityID,o.convertToDateString(o.pageData.Filter.From),o.convertFromDateString(o.pageData.Filter.To))),r(),w(y(3,2,e.Count,"1.0-0"))}}function ku(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Quantity)," ")}}function Wu(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Gross)," ")}}function Nu(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;r(),v(" ",y(2,1,e.BasketSize,"1.0-2")," ")}}function Au(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Sales)," ")}}function Gu(i,c){if(i&1&&(n(0,"td",70)(1,"div"),p(2),d(3,"amountFraction"),a()()),i&2){let e=s().$implicit;r(2),w(f(3,1,e.AverageDailySales))}}function Hu(i,c){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=s().$implicit;r(2),w(f(3,1,e.InventoryValue))}}function Qu(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.RangeSalesTarget)," ")}}function ju(i,c){if(i&1&&(se(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s(2).$implicit;r(),m("ngClass",de(4,yi,e.AchievementWithTax<100,e.AchievementWithTax>100)),r(),v(" ",f(3,2,e.AchievementWithTax)," ")}}function Yu(i,c){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;m("ngClass",de(4,yi,e.Achievement<100,e.Achievement>100)),r(),v(" ",f(2,2,e.Achievement)," ")}}function qu(i,c){if(i&1&&(n(0,"td",70),g(1,ju,4,7,"ng-container",78)(2,Yu,3,7,"ng-template",null,1,M),a()),i&2){let e=lt(3),o=s(3);r(),m("ngIf",!o.pageData.IgnoreTax)("ngIfElse",e)}}function Uu(i,c){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=s().$implicit;r(2),w(f(3,1,e.SalesTarget))}}function Ku(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Tax)," ")}}function zu(i,c){if(i&1&&(n(0,"td",70)(1,"a",81),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=s().$implicit,o=s(2);r(),m("routerLink",b(11,cu))("queryParams",st(12,du,e.EntityID,y(2,3,o.pageData.Filter.From,"yyyy-MM-dd"),y(3,6,o.pageData.Filter.To,"yyyy-MM-dd"))),r(4),w(f(6,9,e.SalesWithTax))}}function Xu(i,c){if(i&1&&(se(0),p(1),d(2,"number"),ce()),i&2){let e=s(2).$implicit;r(),v(" ",y(2,1,e.Increase,"1.0-0")," ")}}function Zu(i,c){if(i&1&&p(0),i&2){let e=s(2).$implicit;v(" ",e.Increase," ")}}function Ju(i,c){if(i&1&&(n(0,"td",79),g(1,Xu,3,4,"ng-container",78)(2,Zu,1,1,"ng-template",null,2,M),a()),i&2){let e=lt(3),o=s().$implicit;m("ngClass",de(3,ho,o.IsNegative,o.IsPositive)),r(),m("ngIf",o.Increase!=="-")("ngIfElse",e)}}function $u(i,c){if(i&1&&(n(0,"td",82),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Cost)," ")}}function e_(i,c){if(i&1&&(se(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s(2).$implicit;r(),m("ngClass",de(4,yi,e.ProfitWithTax<0,e.ProfitWithTax>0)),r(),v(" ",f(3,2,e.ProfitWithTax),"")}}function t_(i,c){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;m("ngClass",de(4,yi,e.Profit<0,e.Profit>0)),r(),v(" ",f(2,2,e.Profit),"")}}function i_(i,c){if(i&1&&(n(0,"td",70),g(1,e_,4,7,"ng-container",78)(2,t_,3,7,"ng-template",null,3,M),a()),i&2){let e=lt(3),o=s(3);r(),m("ngIf",!o.pageData.IgnoreTax)("ngIfElse",e)}}function n_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Expense)," ")}}function a_(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",48),p(4),a(),g(5,Ou,2,1,"td",73)(6,Lu,2,5,"td",74)(7,Ru,4,9,"td",43)(8,ku,3,3,"td",43)(9,Wu,3,3,"td",43)(10,Nu,3,4,"td",43)(11,Au,3,3,"td",43)(12,Gu,4,3,"td",43)(13,Hu,4,3,"td",43)(14,Qu,3,3,"td",43),se(15),g(16,qu,4,2,"td",43),d(17,"HideSumZero"),d(18,"HideSumZero"),ce(),g(19,Uu,4,3,"td",43)(20,Ku,3,3,"td",51)(21,zu,7,16,"td",43)(22,Ju,4,6,"td",53)(23,$u,3,3,"td",54)(24,i_,4,2,"td",43)(25,n_,3,3,"td",43),d(26,"sum"),a()),i&2){let e=c.$implicit,o=c.index,t=s(2);r(2),w(o+1),r(2),w(e.Name),r(),m("ngIf",t.showCompareColumn),r(),m("ngIf",t.showCompareColumn),r(),m("ngIf",t.column.Orders.selected),r(),m("ngIf",t.column.QTY.selected),r(),m("ngIf",t.column.Gross.selected),r(),m("ngIf",t.column.QTY.selected),r(),m("ngIf",t.column.Sales.selected),r(),m("ngIf",t.column.AvgDaily.selected),r(),m("ngIf",t.column.Inventory.selected),r(),m("ngIf",t.column.TargetDaily.selected),r(2),m("ngIf",y(17,20,t.data.Data,"AchievementWithTax")||y(18,23,t.data.Data,"Achievement")),r(3),m("ngIf",t.column.DailyTarget.selected),r(),m("ngIf",t.column.Tax.selected),r(),m("ngIf",t.column.SalesNTax.selected),r(),m("ngIf",t.showCompareColumn),r(),m("ngIf",(t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost)&&t.column.Cost.selected),r(),m("ngIf",t.roleService.report.Profit&&t.column.Profit.selected),r(),m("ngIf",t.roleService.product.Expense&&t.column.QTY.selected&&y(26,26,t.data.Data,"Expense")!=0)}}function r_(i,c){i&1&&I(0,"td",50)}function o_(i,c){i&1&&I(0,"td",50)}function l_(i,c){if(i&1&&(n(0,"td",70)(1,"a",83),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=s(2);r(2),v(" ",y(4,4,y(3,1,e.data.Data,"Count"),"1.0-0"),"")}}function p_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Quantity"))," ")}}function m_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Gross"))," ")}}function s_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);r(),v(" ",y(3,4,y(2,1,e.data.Data,"BasketSize")/(e.data==null||e.data.Data==null?null:e.data.Data.length),"1.0-2")," ")}}function c_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Sales"))," ")}}function d_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"AverageDailySales"))," ")}}function u_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"InventoryValue"))," ")}}function __(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"RangeSalesTarget"))," ")}}function g_(i,c){if(i&1&&(se(0),n(1,"span",79),d(2,"sum"),d(3,"sum"),p(4),d(5,"sum"),d(6,"amountFraction"),a(),ce()),i&2){let e=s(3);r(),m("ngClass",de(13,yi,y(2,2,e.data.Data,"AchievementWithTax")<100,y(3,5,e.data.Data,"AchievementWithTax")>100)),r(3),v(" ",f(6,11,y(5,8,e.data.Data,"AchievementWithTax")/(e.data==null||e.data.Data==null?null:e.data.Data.length))," ")}}function f_(i,c){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(13,yi,y(1,2,e.data.Data,"Achievement")<100,y(2,5,e.data.Data,"Achievement")>100)),r(3),v(" ",f(5,11,y(4,8,e.data.Data,"Achievement")/(e.data==null||e.data.Data==null?null:e.data.Data.length)),"")}}function C_(i,c){if(i&1&&(n(0,"td",70),g(1,g_,7,16,"ng-container",78)(2,f_,6,16,"ng-template",null,4,M),a()),i&2){let e=lt(3),o=s(2);r(),m("ngIf",!o.pageData.IgnoreTax)("ngIfElse",e)}}function x_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"SalesTarget"))," ")}}function h_(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Tax"))," ")}}function S_(i,c){if(i&1&&(n(0,"td",84)(1,"a",85),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(2);r(2),w(f(4,4,y(3,1,e.data.Data,"SalesWithTax")))}}function y_(i,c){if(i&1&&(n(0,"td",79),p(1),d(2,"number"),a()),i&2){let e=s(2);m("ngClass",de(5,ho,e.comparation<0,e.comparation>0)),r(),v(" ",y(2,2,e.comparation,"1.0-0")," ")}}function D_(i,c){if(i&1&&(n(0,"td",82),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Cost"))," ")}}function v_(i,c){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(13,So,y(1,2,e.data.Data,"Profit")>0,y(2,5,e.data.Data,"Profit")<0)),r(3),w(f(5,11,y(4,8,e.data.Data,"Profit")))}}function w_(i,c){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(13,So,y(1,2,e.data.Data,"ProfitWithTax")>0,y(2,5,e.data.Data,"ProfitWithTax")<0)),r(3),v("",f(5,11,y(4,8,e.data.Data,"ProfitWithTax"))," ")}}function T_(i,c){if(i&1&&(n(0,"td",70),g(1,v_,6,16,"span",53)(2,w_,6,16,"span",53),a()),i&2){let e=s(2);r(),m("ngIf",e.pageData.IgnoreTax),r(),m("ngIf",!e.pageData.IgnoreTax)}}function P_(i,c){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Expense"))," ")}}function F_(i,c){if(i&1){let e=F();n(0,"div",25)(1,"table",26),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",27)(3,"tr")(4,"th",28),p(5,"No"),a(),n(6,"th",29),p(7," Outlet "),a(),g(8,gu,2,0,"th",30)(9,fu,2,0,"th",31)(10,Cu,2,0,"th",32)(11,xu,2,0,"th",33)(12,hu,2,0,"th",34)(13,Su,2,0,"th",35)(14,yu,2,0,"th",36)(15,Du,2,0,"th",37)(16,vu,2,0,"th",38)(17,wu,3,0,"ng-container",39)(18,Pu,4,7,"ng-container",39)(19,Fu,2,0,"th",40)(20,Iu,2,0,"th",41)(21,bu,2,1,"th",42)(22,Eu,2,0,"th",43)(23,Mu,2,0,"th",44)(24,Vu,2,1,"th",42)(25,Bu,2,0,"th",45),d(26,"sum"),a()(),n(27,"tbody"),g(28,a_,27,29,"tr",46),a(),n(29,"tfoot")(30,"tr",47),I(31,"td",48),g(32,r_,1,0,"td",49)(33,o_,1,0,"td",49),I(34,"td",50),g(35,l_,5,7,"td",43)(36,p_,4,6,"td",43)(37,m_,4,6,"td",43)(38,s_,4,7,"td",43)(39,c_,4,6,"td",43)(40,d_,4,6,"td",43)(41,u_,4,6,"td",43)(42,__,4,6,"td",43),se(43),g(44,C_,4,2,"td",43),d(45,"HideSumZero"),d(46,"HideSumZero"),ce(),g(47,x_,4,6,"td",43)(48,h_,4,6,"td",51)(49,S_,5,6,"td",52)(50,y_,3,8,"td",53)(51,D_,4,6,"td",54)(52,T_,3,2,"td",43)(53,P_,4,6,"td",43),d(54,"sum"),a()()()()}if(i&2){let e=s();r(8),m("ngIf",e.showCompareColumn),r(),m("ngIf",e.showCompareColumn),r(),m("ngIf",e.column.Orders.selected),r(),m("ngIf",e.column.QTY.selected),r(),m("ngIf",e.column.Gross.selected),r(),m("ngIf",e.column.QTY.selected),r(),m("ngIf",e.column.Sales.selected),r(),m("ngIf",e.column.AvgDaily.selected),r(),m("ngIf",e.column.Inventory.selected),r(),m("ngIf",e.column.TargetDaily.selected),r(),m("ngIf",e.isShowOutletTarget),r(),m("ngIf",e.column.DailyTarget.selected),r(),m("ngIf",e.column.Tax.selected),r(),m("ngIf",e.column.SalesNTax.selected),r(),m("ngIf",e.showCompareColumn),r(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),r(),m("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),r(),m("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&y(26,37,e.data.Data,"Expense")!=0),r(3),m("ngForOf",e.data.Data),r(4),m("ngIf",e.showCompareColumn),r(),m("ngIf",e.showCompareColumn),r(2),m("ngIf",e.column.Orders.selected),r(),m("ngIf",e.column.QTY.selected),r(),m("ngIf",e.column.Gross.selected),r(),m("ngIf",e.column.QTY.selected),r(),m("ngIf",e.column.Sales.selected),r(),m("ngIf",e.column.AvgDaily.selected),r(),m("ngIf",e.column.Inventory.selected),r(),m("ngIf",e.column.TargetDaily.selected),r(2),m("ngIf",y(45,40,e.data.Data,"AchievementWithTax")||y(46,43,e.data.Data,"Achievement")),r(3),m("ngIf",e.column.DailyTarget.selected),r(),m("ngIf",e.column.Tax.selected),r(),m("ngIf",e.column.SalesNTax.selected),r(),m("ngIf",e.showCompareColumn),r(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),r(),m("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),r(),m("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&y(54,46,e.data.Data,"Expense")!=0)}}var Nn=class i extends ie{constructor(e,o,t,l,S){super(e,o,"Report/OutletPerformanceDetail","ReportLoader/OutletPerformance");this.httpService=o;this.csvConverter=t;this.matDialog=l;this.datePipe=S}roleService=Ye(G);columnService=Ye(It);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Quantity",responseProperty:"Quantity"},Gross:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Gross",responseProperty:"Gross"},Sales:{selected:!0},AvgDaily:{selected:!1,name:"Avg Daily Sales"},Inventory:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_InventoryValue",responseProperty:"InventoryValue"},TargetDaily:{selected:!1,name:"Target"},DailyTarget:{selected:!1,name:"Daily Target"},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:!0},Profit:{selected:!0,role:this.roleService.report.Profit}};isCompare=!1;showCompareColumn=!1;totalDays=1;selectetOutletGroup;isShowOutletTarget=!0;postInit(e){this.menuData.H=e.PageTitle;var o=new Date(this.pageData.Filter.To),t=new Date(this.pageData.Filter.From);this.totalDays=V.differentInDays(t,o)+1,this.initShowSalesTarget(),this.checkForAdvancedColumn(),this.onCompareData(),this.data.Data=this.data.Data.map(l=>(l.AverageDailySales=l.Sales/this.totalDays,l.BasketSize=l.Quantity/l.Count,l.Achievement=this.calculateAchievement(l.SalesTarget,l.Sales,this.totalDays),l.AchievementWithTax=this.calculateAchievement(l.SalesTarget,l.SalesWithTax,this.totalDays),l)),this.hideTaxRelatedColumn(e.Data)}hideTaxRelatedColumn(e){e.map(t=>t.Tax).reduce((t,l)=>t+l,0)==0&&(this.column.Tax.selected=!1,this.column.SalesNTax.selected=!1)}calculateAchievement(e=0,o=0,t=1){let l=0;return e!=0&&o!=0&&(l=o/(e*t)*100),l}initShowSalesTarget(){let e=this.data.Data.reduce((o,t)=>o+t.SalesTarget,0);this.isShowOutletTarget=e>0}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,S);case"Count":return this.compare(t.Count,l.Count,S);case"Quantity":return this.compare(t.Quantity,l.Quantity,S);case"Gross":return this.compare(t.Gross,l.Gross,S);case"Sales":return this.compare(t.Sales,l.Sales,S);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,S);case"Tax":return this.compare(t.Tax,l.Tax,S);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,S);case"Cost":return this.compare(t.Cost,l.Cost,S);case"Profit":return this.compare(t.Profit,l.Profit,S);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,S);case"Expense":return this.compare(t.Expense,l.Expense,S);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,S);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,S);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,S);case"Achievement":return this.compare(t.Achievement,l.Achievement,S);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,S);case"AverageDailySales":return this.compare(t.AverageDailySales,l.AverageDailySales,S);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Performance Detail",exportTypes:[{ID:"ReportExport/OutletPerformanceDetail",Value:"Default",FileName:"Outlet Performance Detail "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}onSelectOutletGroup(e){this.pageData.Filter.OutletGroupID=e?.id,this.selectetOutletGroup=e}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data.map(e=>{let o=e;return o.ID=e.EntityID,o}),this.pageData.Filter,"ID",()=>{this.data.Data=this.data.Data.map(e=>(e.AverageDailySales=e.Sales/this.totalDays,e.BasketSize=e.Quantity/e.Count,e.Achievement=this.calculateAchievement(e.SalesTarget,e.Sales,this.totalDays),e.AchievementWithTax=this.calculateAchievement(e.SalesTarget,e.SalesWithTax,this.totalDays),e))})}get entityIDs(){return this.data&&Object.prototype.hasOwnProperty.call(this.data,"Data")&&this.data.Data.length>0?this.data.Data.map(e=>e.EntityID).join(","):null}convertToDateString(e){return(0,Ga.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}convertFromDateString(e){return(0,Ga.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(Y),D(ee))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-detail-outlet-performance"]],standalone:!1,features:[R],decls:21,vars:13,consts:[["pageFilterTemplate",""],["IGNORE_TAX_ITEM",""],["INCREASE",""],["IGNORE_PROFIT_TAX",""],["IGNORE_TAX",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","multiple","ngModel"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["name","render-ProductType",3,"modelChange","model","options"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["mat-sort-header","Name",1,"align-left","freeze","header"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Gross","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","AverageDailySales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",4,"ngIf"],[4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","arrowPosition","before","class","text-end",4,"ngIf"],["arrowPosition","before","class","text-end",3,"mat-sort-header",4,"ngIf"],["class","text-end",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Expense","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end"],["mat-sort-header","AverageDailySales","arrowPosition","before",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",1,"text-end"],["matTooltip","Daily Target * Number of Days","matTooltipPosition","above","mat-sort-header","Target","arrowPosition","before",1,"text-end"],["mat-sort-header","Achievement","arrowPosition","before","class","text-end","matTooltipPosition","above","matTooltip","Achievement",4,"ngIf"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before",1,"text-end"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end"],["arrowPosition","before",1,"text-end",3,"mat-sort-header"],[1,"text-end"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end"],["mat-sort-header","Expense","arrowPosition","before",1,"text-end"],["style","width: 35px; text-align: center",4,"ngIf"],["style","width: 35px; text-align: center",3,"ngClass",4,"ngIf"],[2,"width","35px","text-align","center"],[2,"width","35px","text-align","center",3,"ngClass"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary","target","_blank",3,"queryParams"],[4,"ngIf","ngIfElse"],[3,"ngClass"],[1,"text-end","text-warning-emphasis"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary","target","_blank"],[1,"text-end","text-primary"],[1,"fw-bold"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",5),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,uu,3,0,"a",6),n(3,"div",7)(4,"button",8),p(5," More "),a(),n(6,"ul",9)(7,"li")(8,"a",10),p(9," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",10),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",10),p(15," Pie Chart "),a()()()()(),n(16,"filters"),g(17,_u,26,16,"ng-template",null,0,M),a(),n(19,"content"),g(20,F_,55,49,"div",11),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),m("column",t.column),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(6),m("routerLink",b(10,ou)),r(3),m("routerLink",b(11,lu)),r(3),m("routerLink",b(12,pu)),r(6),m("ngIf",t.data))},dependencies:[N,Ae,j,k,A,z,K,O,L,le,ae,ge,we,fe,mn,re,ei,te,ee,X,Z],styles:["table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{width:0!important}"]})};var I_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],b_=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],E_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],M_=(i,c)=>({rankDown:i,rankUp:c,"number key":!0}),yo=(i,c)=>({"text-danger":i,"text-success":c,"text-end":!0});function V_(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 B_(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",11),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(5,"div",12)(6,"datepicker",13),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",14),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(10,"h6"),p(11,"Compare with Prev Month"),a(),n(12,"radio-options",15),h("modelChange",function(t){u(e);let l=s();return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=s();r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),r(3),C("model",e.isCompare)}}function O_(i,c){i&1&&(n(0,"th",41),p(1," Prev "),a())}function L_(i,c){i&1&&(n(0,"th",42),p(1," Now "),a())}function R_(i,c){i&1&&(n(0,"th",43),p(1," \xB1 (%) "),a())}function k_(i,c){i&1&&(n(0,"th",44),p(1," Cost "),a())}function W_(i,c){if(i&1&&(n(0,"th",26),p(1," Profit "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function N_(i,c){if(i&1&&(n(0,"td",35),p(1),a()),i&2){let e=s().$implicit;r(),v(" ",e.PrevIndex," ")}}function A_(i,c){if(i&1&&(n(0,"td",47),p(1),a()),i&2){let e=s(),o=e.$implicit,t=e.index;m("ngClass",de(2,M_,o.PrevIndex<t+1,o.PrevIndex>t+1)),r(),v(" ",o.CurrentIndex," ")}}function G_(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",de(4,yo,e.IsNegative,e.IsPositive)),r(),v(" ",f(2,2,e.Increase)," ")}}function H_(i,c){if(i&1&&(n(0,"td",49),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Cost)," ")}}function Q_(i,c){if(i&1&&(n(0,"td",50),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit,o=s(2);r(),v(" ",f(2,1,o.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function j_(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),g(3,N_,2,1,"td",45)(4,A_,2,5,"td",46),n(5,"td",35),p(6),d(7,"number"),a(),n(8,"td",35),p(9),d(10,"quantityFraction"),a(),n(11,"td",35),p(12),d(13,"amountFraction"),a(),n(14,"td",35),p(15),d(16,"amountFraction"),a(),n(17,"td",36),p(18),d(19,"amountFraction"),a(),n(20,"td",37),p(21),d(22,"amountFraction"),a(),g(23,G_,3,7,"td",38)(24,H_,3,3,"td",39)(25,Q_,3,3,"td",40),a()),i&2){let e=c.$implicit,o=s(2);r(2),w(e.Name),r(),m("ngIf",o.showCompareColumn),r(),m("ngIf",o.showCompareColumn),r(2),w(y(7,12,e.Count,".0-0")),r(3),w(f(10,15,e.Quantity)),r(3),w(f(13,17,e.Gross)),r(3),w(f(16,19,e.SalesNet)),r(3),v(" ",f(19,21,e.Tax)," "),r(3),v(" ",f(22,23,e.SalesWithTax)," "),r(2),m("ngIf",o.showCompareColumn&&o.roleService.report.Profit),r(),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.report.Profit)}}function Y_(i,c){i&1&&I(0,"td",34)}function q_(i,c){i&1&&I(0,"td",34)}function U_(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"number"),a()),i&2){let e=s(2);m("ngClass",de(5,yo,e.comparation,e.comparation)),r(),v(" ",y(2,2,e.comparation,".0-0")," ")}}function K_(i,c){if(i&1&&(n(0,"td",49),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data==null?null:e.data.Data,"Cost"))," ")}}function z_(i,c){if(i&1&&(n(0,"td",50),p(1),d(2,"sum"),d(3,"amountFraction"),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",e.pageData.IgnoreTax?f(3,4,y(2,1,e.data==null?null:e.data.Data,"Profit")):f(5,9,y(4,6,e.data==null?null:e.data.Data,"ProfitWithTax"))," ")}}function X_(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,"Outlet"),a(),g(6,O_,2,0,"th",20)(7,L_,2,0,"th",21),n(8,"th",22),p(9," Orders "),a(),n(10,"th",23),p(11," Quantity "),a(),n(12,"th",24),p(13," Gross "),a(),n(14,"th",25),p(15," Sales "),a(),n(16,"th",26),p(17," Tax "),a(),n(18,"th",27),p(19," Sales + Tax "),a(),g(20,R_,2,0,"th",28)(21,k_,2,0,"th",29)(22,W_,2,1,"th",30),a()(),n(23,"tbody"),g(24,j_,26,25,"tr",31),a(),n(25,"tfoot")(26,"tr",32),g(27,Y_,1,0,"td",33)(28,q_,1,0,"td",33),I(29,"td",34),n(30,"td",35),p(31),d(32,"sum"),d(33,"number"),a(),n(34,"td",35),p(35),d(36,"sum"),d(37,"quantityFraction"),a(),n(38,"td",35),p(39),d(40,"sum"),d(41,"amountFraction"),a(),n(42,"td",35),p(43),d(44,"sum"),d(45,"amountFraction"),a(),n(46,"td",36),p(47),d(48,"sum"),d(49,"amountFraction"),a(),n(50,"td",37)(51,"a"),p(52),d(53,"sum"),d(54,"amountFraction"),a()(),g(55,U_,3,8,"td",38)(56,K_,4,6,"td",39)(57,z_,6,11,"td",40),a()()()()}if(i&2){let e=s();r(6),m("ngIf",e.showCompareColumn),r(),m("ngIf",e.showCompareColumn),r(9),m("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesTaxNet"),r(2),ot("altpropcond",e.pageData.IgnoreTax),r(2),m("ngIf",e.showCompareColumn&&e.roleService.report.Profit),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.report.Profit),r(2),m("ngForOf",e.data==null?null:e.data.Data),r(3),m("ngIf",e.showCompareColumn),r(),m("ngIf",e.showCompareColumn),r(3),v(" ",y(33,22,y(32,19,e.data==null?null:e.data.Data,"Count"),".0-0")," "),r(4),v(" ",f(37,28,y(36,25,e.data==null?null:e.data.Data,"Quantity"))," "),r(4),v(" ",f(41,33,y(40,30,e.data==null?null:e.data.Data,"Gross"))," "),r(4),v(" ",f(45,38,y(44,35,e.data==null?null:e.data.Data,"SalesNet"))," "),r(4),v(" ",f(49,43,y(48,40,e.data==null?null:e.data.Data,"Tax"))," "),r(5),w(f(54,48,y(53,45,e.data==null?null:e.data.Data,"SalesWithTax"))),r(3),m("ngIf",e.showCompareColumn&&e.roleService.report.Profit),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.report.Profit)}}var An=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/OutletGroupPerformance","ReportLoader/OutletPerformance");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}isCompare=!1;showCompareColumn=!1;postInit(e){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}sortData(e){let o=this.data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data=o.sort((t,l)=>{let S=e.direction==="asc";switch(t.Name=t.Name?t.Name:"",l.Name=l.Name?l.Name:"",e.active){case"Name":return this.compare(t.Name,l.Name,S);case"Count":return this.compare(t.Count,l.Count,S);case"Quantity":return this.compare(t.Quantity,l.Quantity,S);case"Gross":return this.compare(t.Gross,l.Gross,S);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,S);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,S);case"Tax":return this.compare(t.Tax,l.Tax,S);case"SalesTaxNet":return this.compare(t.SalesTaxNet,l.SalesTaxNet,S);case"Cost":return this.compare(t.Cost,l.Cost,S);case"Profit":return this.compare(t.Profit,l.Profit,S);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,S);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Group Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformance",Value:"Default",FileName:"Outlet Group Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-outlet-group-performance"]],standalone:!1,features:[R],decls:21,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Compare",3,"modelChange","model"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["class","text-end","style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["class","text-end","style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px"],["arrowPosition","before",1,"text-end",2,"width","120px",3,"mat-sort-header"],["mat-sort-header","SalesWithTax","altprop","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px",3,"altpropcond"],["style","width: 60px","class","text-end",4,"ngIf"],["mat-sort-header","Cost","style","width: 100px","arrowPosition","before","class","text-end",4,"ngIf"],["style","width: 120px","arrowPosition","before","class","text-end",3,"mat-sort-header",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-primary"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],[1,"text-end",2,"width","60px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","100px"],["class","text-end",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,V_,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),g(17,B_,13,5,"ng-template",null,0,M),a(),n(19,"content"),g(20,X_,58,50,"div",7),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(6),m("routerLink",b(9,I_)),r(3),m("routerLink",b(10,b_)),r(3),m("routerLink",b(11,E_)),r(6),m("ngIf",t.data))},dependencies:[N,Ae,j,k,A,z,K,O,L,le,ae,ge,we,re,te,X,Z],encapsulation:2})};var Z_=()=>["/menu/Reports/Sales_Report/Standard/Compare"],J_=i=>({"flex-right":i});function $_(i,c){if(i&1){let e=F();n(0,"a",5),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",6),p(2," Export "),a()}}function eg(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Sales Person"),a(),n(3,"sales-person-selector",8),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=s();r(3),C("ngModel",e.pageData.Filter.SalesID),r(3),C("ngModel",e.pageData.Filter.Year),m("items",e.Years),r(3),C("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function tg(i,c){if(i&1&&(n(0,"th",17),p(1),a()),i&2){let e=c.$implicit,o=c.index;ot("arrowPosition",o?"before":"after"),m("mat-sort-header",e)("ngClass",U(4,J_,e!="Outlet")),r(),v(" ",e,"")}}function ig(i,c){if(i&1&&(n(0,"div",20),p(1),a()),i&2){let e=s().$implicit,o=s().$implicit;r(),w(o[e])}}function ng(i,c){if(i&1&&(n(0,"div",21),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit,o=s().$implicit;r(),v("",f(2,1,o[e])," ")}}function ag(i,c){if(i&1&&(n(0,"td"),g(1,ig,2,1,"div",18)(2,ng,3,3,"div",19),a()),i&2){let e=c.$implicit;r(),m("ngIf",e=="Outlet"),r(),m("ngIf",e!="Outlet")}}function rg(i,c){if(i&1&&(n(0,"tr"),g(1,ag,3,2,"td",15),a()),i&2){let e=c.$implicit,o=s(2);r(),m("ngForOf",o.getKeys(e))}}function og(i,c){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;r(),w(f(2,1,e))}}function lg(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",22)(2,"td"),p(3,"Total : "),a(),g(4,og,3,3,"td",23),a()()),i&2){let e=s(2);r(4),m("ngForOf",e.data.DataFooter)}}function pg(i,c){if(i&1){let e=F();n(0,"div",11)(1,"table",12),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",13)(3,"tr"),g(4,tg,2,6,"th",14),a()(),n(5,"tbody"),g(6,rg,2,1,"tr",15),a(),g(7,lg,5,1,"tfoot",16),a()()}if(i&2){let e=s();r(4),m("ngForOf",e.data.Dataheader),r(2),m("ngForOf",e.data.Data),r(),m("ngIf",e.data.Data.length>0)}}var Gn=class i extends ie{constructor(e,o,t,l,S){super(e,o,"Report/MonthlyOutletPerformance","ReportLoader/MonthlyReportSales");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}Years=V.GenerateYears(new Date().getFullYear(),11,!0);getKeys(e){return Object.keys(e)}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";for(let P=0;P<this.data.Dataheader.length;P++)if(e.active==this.data.Dataheader[P])return this.compare(t[this.data.Dataheader[P]],l[this.data.Dataheader[P]],S)})}openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Monthly Comparison",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformance",Value:"Default",FileName:"Outlet Monthly Comparison"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-outlet-monthly-performance"]],standalone:!1,features:[R],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Range Compare",1,"btn","btn-outline-secondary",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"table-light","sticky-top-thead"],[3,"mat-sort-header","arrowPosition","ngClass",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"mat-sort-header","arrowPosition","ngClass"],["style","color: black",4,"ngIf"],["style","color: black;text-align:right",4,"ngIf"],[2,"color","black"],[2,"color","black","text-align","right"],[1,"table-footer"],["class","text-end",4,"ngFor","ngForOf"],[1,"text-end"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,$_,3,0,"a",2),n(3,"a",3),p(4," View Range"),a()(),n(5,"filters"),g(6,eg,10,5,"ng-template",null,0,M),a(),n(8,"content"),g(9,pg,8,3,"div",4),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(),m("routerLink",b(7,Z_)),r(6),m("ngIf",t.data))},dependencies:[N,Ae,j,k,A,z,O,L,le,ae,ge,Qe,X],encapsulation:2})};var mg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],sg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],cg=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],dg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],ug=(i,c)=>({From:i,To:c}),_g=()=>["/menu/Contacts/Contact/Sales_Person/Info"],gg=i=>({ID:i}),fg=()=>["/menu/Reports/Sales_Report/Standard/Detail"],Cg=(i,c,e,o,t)=>({SalesPersonID:i,From:c,To:e,ListIDs:o,IncludeComplementary:t}),xg=(i,c,e,o)=>({ID:i,from:c,to:e,IncludeComplementary:o}),hg=i=>({SalesID:i});function Sg(i,c){if(i&1){let e=F();n(0,"button",10),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",11),p(2," Export"),a()}}function yg(i,c){if(i&1){let e=F();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),h("ngModelChange",function(t){u(e);let l=s();return x(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 Person Group"),a(),n(6,"ng-select",14),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SalesGroupID,t)||(l.pageData.Filter.SalesGroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",15),h("dateChange",function(t){u(e);let l=s();return x(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",16)(12,"datepicker",17),h("dateChange",function(t){u(e);let l=s();return x(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,"Delivery"),a(),n(15,"ng-select",18),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Sales Order Tag"),a(),n(18,"ng-select",19),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(19,"h6"),p(20,"Include Zero Amount Transaction"),a(),n(21,"radio-options",20),h("modelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.IncludeZeroAmountTransaction,t)||(l.pageData.Filter.IncludeZeroAmountTransaction=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData==null||e.pageData.List==null?null:e.pageData.List.Entities),r(3),C("ngModel",e.pageData.Filter.SalesGroupID),m("items",e.pageData.List==null?null:e.pageData.List.SalesGroup),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.DeliveryID),m("items",e.pageData.List==null?null:e.pageData.List.Deliveries),r(3),C("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.List==null?null:e.pageData.List.Types),r(3),C("model",e.pageData.Filter.IncludeZeroAmountTransaction)}}function Dg(i,c){i&1&&(n(0,"th",46),p(1," Sales Group"),a())}function vg(i,c){i&1&&(n(0,"th",47),p(1," Orders"),a())}function wg(i,c){i&1&&(n(0,"th",48),p(1," Sales"),a())}function Tg(i,c){i&1&&(se(0),n(1,"th",49),p(2,"Avg. Daily"),a(),ce())}function Pg(i,c){i&1&&(n(0,"th",50),p(1,"Tax "),a())}function Fg(i,c){i&1&&(n(0,"th",51),p(1," Sales + Tax "),a())}function Ig(i,c){i&1&&(n(0,"th",52),p(1," Cost "),a())}function bg(i,c){i&1&&(n(0,"th",53),p(1," Profit "),a())}function Eg(i,c){i&1&&(n(0,"th",56),p(1,"Target "),a())}function Mg(i,c){i&1&&(n(0,"th",57),p(1,"Ach(%) "),a())}function Vg(i,c){if(i&1&&(se(0),g(1,Eg,2,0,"th",54)(2,Mg,2,0,"th",55),ce()),i&2){let e=s(2);r(),m("ngIf",e.data.ShowSalesTarget),r(),m("ngIf",e.data.ShowSalesTarget)}}function Bg(i,c){i&1&&(n(0,"th",58),p(1,"Quantity"),a())}function Og(i,c){i&1&&(n(0,"th",59),p(1,"Basket Size"),a())}function Lg(i,c){i&1&&(n(0,"th",60),p(1," Product Commission "),a())}function Rg(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;r(),w(e.Group)}}function kg(i,c){if(i&1&&(n(0,"td",63)(1,"a",62),d(2,"date"),d(3,"date"),p(4),d(5,"number"),a()()),i&2){let e=s().$implicit,o=s(2);r(),m("routerLink",b(12,fg))("queryParams",Qi(13,Cg,e.ID,y(2,3,o.pageData.Filter.From,"ddMMyyyy"),y(3,6,o.pageData.Filter.To,"ddMMyyyy"),o.pageData.Filter.ListIDs,o.pageData.Filter.IncludeComplementary)),r(3),w(y(5,9,e.Orders,".0-0"))}}function Wg(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),w(f(2,1,e.Sales))}}function Ng(i,c){if(i&1&&(se(0),n(1,"td",64),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s().$implicit;r(2),w(f(3,1,e.AvgDailySales))}}function Ag(i,c){if(i&1&&(n(0,"td",65),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Tax),"")}}function Gg(i,c){if(i&1&&(n(0,"td",63)(1,"a",66),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().$implicit,o=s(2);r(),m("queryParams",Qt(10,xg,e.ID,y(2,2,o.pageData.Filter.From,"ddMMyyyy"),y(3,5,o.pageData.Filter.To,"ddMMyyyy"),o.pageData.Filter.IncludeComplementary)),r(3),v(" ",f(5,8,e.SalesNTax)," ")}}function Hg(i,c){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),w(f(2,1,e.Cost))}}function Qg(i,c){if(i&1&&(n(0,"td",68),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v("",f(2,1,e.Profit)," ")}}function jg(i,c){if(i&1&&(n(0,"td",68),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;r(),v(" ",f(2,1,e.Target)," ")}}function Yg(i,c){if(i&1&&(n(0,"td",68),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;r(),v(" ",f(2,1,e.Achievement),"")}}function qg(i,c){if(i&1&&(se(0),g(1,jg,3,3,"td",45)(2,Yg,3,3,"td",45),ce()),i&2){let e=s(3);r(),m("ngIf",e.data.ShowSalesTarget),r(),m("ngIf",e.data.ShowSalesTarget)}}function Ug(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;r(),v(" ",y(2,1,e.Quantity,"1.0-2")," ")}}function Kg(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;r(),v(" ",y(2,1,e.BasketSize,"1.0-2")," ")}}function zg(i,c){if(i&1&&(n(0,"td",64)(1,"span")(2,"a",69),p(3),d(4,"amountFraction"),a()()()),i&2){let e=s().$implicit;r(2),m("queryParams",U(4,hg,e.ID)),r(),w(f(4,2,e.Commission))}}function Xg(i,c){if(i&1&&(n(0,"tr")(1,"td",61)(2,"a",62),p(3),a()(),g(4,Rg,2,1,"td",30)(5,kg,6,19,"td",41)(6,Wg,3,3,"td",42),d(7,"HideSumZero"),g(8,Ng,4,3,"ng-container",30)(9,Ag,3,3,"td",43),d(10,"HideSumZero"),g(11,Gg,6,15,"td",41)(12,Hg,3,3,"td",44)(13,Qg,3,3,"td",45)(14,qg,3,2,"ng-container",30)(15,Ug,3,4,"td",42)(16,Kg,3,4,"td",42)(17,zg,5,6,"td",42),a()),i&2){let e=c.$implicit,o=s(2);r(2),m("routerLink",b(21,_g))("queryParams",U(22,gg,e.ID)),r(),w(e.Name),r(),m("ngIf",o.data.Show),r(),m("ngIf",o.column.Orders.selected),r(),m("ngIf",y(7,15,o.data.List,"Tax")&&o.column.Sales.selected),r(2),m("ngIf",o.isShowOutletTarget),r(),m("ngIf",y(10,18,o.data.List,"Tax")&&o.column.Tax.selected),r(2),m("ngIf",o.column.SalesNTax.selected),r(),m("ngIf",o.roleService.product.Cost&&o.column.Cost.selected),r(),m("ngIf",o.roleService.report.Profit&&o.column.Profit.selected),r(),m("ngIf",o.isShowOutletTarget),r(),m("ngIf",o.column.QTY.selected),r(),m("ngIf",o.column.QTY.selected),r(),m("ngIf",o.column.Commission.selected)}}function Zg(i,c){i&1&&I(0,"td")}function Jg(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);r(),w(y(3,4,y(2,1,e.data.List,"Orders"),".0-0"))}}function $g(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),w(f(3,4,y(2,1,e.data.List,"Sales")))}}function e1(i,c){if(i&1&&(se(0),n(1,"td",64),p(2),d(3,"sum"),d(4,"amountFraction"),a(),ce()),i&2){let e=s(2);r(2),v(" ",f(4,4,y(3,1,e.data.List,"AvgDailySales"))," ")}}function t1(i,c){if(i&1&&(n(0,"td",65),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);r(),v(" ",y(3,4,y(2,1,e.data.List,"Tax"),e.pageData.FractionDigit),"")}}function i1(i,c){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v("",f(3,4,y(2,1,e.data.List,"SalesNTax"))," ")}}function n1(i,c){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.List,"Cost")),"")}}function a1(i,c){if(i&1&&(n(0,"td",68),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.List,"Profit")),"")}}function r1(i,c){if(i&1&&(n(0,"td",68),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);r(),v(" ",f(3,4,y(2,1,e.data.List,"Target")),"")}}function o1(i,c){if(i&1&&(n(0,"td",68),p(1),d(2,"sum"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s(3);r(),v(" ",f(4,7,y(2,1,e.data.List,"Sales")/y(3,4,e.data.List,"Target")*100)," ")}}function l1(i,c){if(i&1&&(se(0),g(1,r1,4,6,"td",45)(2,o1,5,9,"td",45),ce()),i&2){let e=s(2);r(),m("ngIf",e.data.ShowSalesTarget),r(),m("ngIf",e.data.ShowSalesTarget)}}function p1(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);r(),v(" ",y(3,4,y(2,1,e.data.List,"Quantity"),"1.0-2"),"")}}function m1(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);r(),v(" ",y(3,4,y(2,1,e.data.List,"BasketSize"),"1.0-2"),"")}}function s1(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.List,"Commission")),"")}}function c1(i,c){if(i&1){let e=F();n(0,"div",21)(1,"div",22)(2,"table",23),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",24)(4,"tr",25)(5,"th",26),p(6,"Sales Person"),a(),g(7,Dg,2,0,"th",27)(8,vg,2,0,"th",28)(9,wg,2,0,"th",29),d(10,"HideSumZero"),g(11,Tg,3,0,"ng-container",30)(12,Pg,2,0,"th",31),d(13,"HideSumZero"),g(14,Fg,2,0,"th",32)(15,Ig,2,0,"th",33)(16,bg,2,0,"th",34)(17,Vg,3,2,"ng-container",30)(18,Bg,2,0,"th",35)(19,Og,2,0,"th",36)(20,Lg,2,0,"th",37),a()(),n(21,"tbody"),g(22,Xg,18,24,"tr",38),a(),n(23,"tfoot")(24,"tr",39),g(25,Zg,1,0,"td",30),n(26,"td",40),p(27,"Total:"),a(),g(28,Jg,4,7,"td",41)(29,$g,4,6,"td",42),d(30,"HideSumZero"),g(31,e1,5,6,"ng-container",30)(32,t1,4,7,"td",43),d(33,"HideSumZero"),g(34,i1,4,6,"td",41)(35,n1,4,6,"td",44)(36,a1,4,6,"td",45)(37,l1,3,2,"ng-container",30)(38,p1,4,7,"td",42)(39,m1,4,7,"td",42)(40,s1,4,6,"td",42),a()()()()()}if(i&2){let e=s();r(7),m("ngIf",e.data.Show),r(),m("ngIf",e.column.Orders.selected),r(),m("ngIf",y(10,25,e.data.List,"Tax")&&e.column.Sales.selected),r(2),m("ngIf",e.isShowOutletTarget),r(),m("ngIf",y(13,28,e.data.List,"Tax")&&e.column.Tax.selected),r(2),m("ngIf",e.column.SalesNTax.selected),r(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),r(),m("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),r(),m("ngIf",e.isShowOutletTarget),r(),m("ngIf",e.column.QTY.selected),r(),m("ngIf",e.column.QTY.selected),r(),m("ngIf",e.column.Commission.selected),r(2),m("ngForOf",e.data.List),r(3),m("ngIf",e.data.Show),r(3),m("ngIf",e.column.Orders.selected),r(),m("ngIf",y(30,31,e.data.List,"Tax")&&e.column.Sales.selected),r(2),m("ngIf",e.isShowOutletTarget),r(),m("ngIf",y(33,34,e.data.List,"Tax")&&e.column.Tax.selected),r(2),m("ngIf",e.column.SalesNTax.selected),r(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),r(),m("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),r(),m("ngIf",e.isShowOutletTarget),r(),m("ngIf",e.column.QTY.selected),r(),m("ngIf",e.column.QTY.selected),r(),m("ngIf",e.column.Commission.selected)}}var Hn=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/SalesPerson","ReportLoader/SalesPerson");this.httpService=o;this.csvConverter=t;this.reportFilterService=l;this.matDialog=S}isShowCommission=!1;roleService=Ye(G);columnService=Ye(It);column={Orders:{selected:!0},Sales:{selected:!0},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/SalesPersonOrderQuantity",responseProperty:"Quantity"},Commission:{selected:!1,advanced:!0,endpoint:"/api/Report/SalesPersonOrderCommission",responseProperty:"Commission"},Profit:{selected:!0,role:this.roleService.report.Profit}};isShowOutletTarget=!0;postInit(){this.menuData.H=this.data.PageTitle,this.isShowCommission=!1,this.initShowSalesTarget();let e=this.getTotalDays();this.data.List=this.data.List.map(o=>(o.AvgDailySales=o.Sales/e,o)),this.checkForAdvancedColumn()}initShowSalesTarget(){let e=this.data?.List?.reduce((o,t)=>o+t.Target,0);this.isShowOutletTarget=e>0}getTotalDays(){let e=new Date(this.pageData.Filter.From),o=new Date(this.pageData.Filter.To);return V.differentInDays(e,o)+1}sortData(e){let o=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=o;return}this.data.List=o.sort((t,l)=>{let S=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.Group=t.Group==null?"":t.Group,l.Group=l.Group==null?"":l.Group,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),S);case"Group":return this.compare(t.Group.toLocaleLowerCase(),l.Group.toLocaleLowerCase(),S);case"Orders":return this.compare(t.Orders,l.Orders,S);case"Tax":return this.compare(t.Tax,l.Tax,S);case"Quantity":return this.compare(t.Quantity,l.Quantity,S);case"Cost":return this.compare(t.Cost,l.Cost,S);case"Profit":return this.compare(t.Profit,l.Profit,S);case"Sales":return this.compare(t.Sales,l.Sales,S);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,S);case"Target":return this.compare(t.Target,l.Target,S);case"Achievement":return this.compare(t.Achievement,l.Achievement,S);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,S);case"AvgDailySales":return this.compare(t.AvgDailySales,l.AvgDailySales,S);case"Commission":return this.compare(t.Commission,l.Commission,S);default:return 0}})}getCommission(){this.httpService.post("/api/Report/SalesPersonComission",this.pageData.Filter).pipe(Gt(e=>e?.List)).subscribe(e=>{let o=0;this.data.List=this.data.List.map(t=>(o=e.findIndex(l=>l.SalesPersonID===t.ID),o!=-1&&(t.Commission=e[o].Commission,t.Quantity=e[o].Quantity),t)),this.isShowCommission=!0})}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Sales Person",exportTypes:[{ID:"ReportExport/SalesPerson",Value:"Default",FileName:"Sales by Sales Person"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.List,this.pageData.Filter,"ID",()=>{this.data.List=this.data.List.map(e=>$e(Ze({},e),{BasketSize:e.Quantity/e.Orders}))})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(gr),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-sales-person"]],standalone:!1,features:[R],decls:27,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"d-flex"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Person Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Transaction",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left"],["mat-sort-header","Group","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Orders","style","width: 80px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","style","width: 120px;","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngIf"],["mat-sort-header","Tax","style","width: 90px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesNTax","style","width: 120px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Cost","style","width: 120px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Profit","style","width: 120px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","style","width: 100px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","style","width: 110px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Commission","style","width: 200px;","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column","text-end"],["class","text-end text-primary",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["mat-sort-header","Group","arrowPosition","before",1,"text-end"],["mat-sort-header","Orders","arrowPosition","before",1,"text-end",2,"width","80px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","AvgDailySales","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Target","style","width: 120px;","arrowPosition","before","class","align-l",4,"ngIf"],["mat-sort-header","Achievement","style","width: 60px;","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Target","arrowPosition","before",1,"align-l",2,"width","120px"],["mat-sort-header","Achievement","arrowPosition","before",1,"text-end",2,"width","60px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end",2,"width","110px"],["mat-sort-header","Commission","arrowPosition","before",1,"text-end",2,"width","200px"],[1,"text-primary"],[3,"routerLink","queryParams"],[1,"text-end","text-primary"],[1,"text-end"],[1,"text-end","text-warning"],["routerLink","Commission_Report",3,"queryParams"],[1,"text-end","text-danger"],[1,"text-end","text-success"],["routerLink","/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",3,"queryParams"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions")(2,"div",2),g(3,Sg,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"By Outlet"),a()(),n(11,"li")(12,"a",7),p(13,"By Employee"),a()(),n(14,"li")(15,"a",7),p(16,"By Sales Group"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),g(23,yg,22,13,"ng-template",null,0,M),a(),n(25,"content"),g(26,c1,41,37,"div",9),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),m("column",t.column),r(3),m("ngIf",t.roleService.global.Export),r(6),m("routerLink",b(18,mg)),r(3),m("routerLink",b(19,sg)),r(3),m("routerLink",b(20,cg)),r(3),m("routerLink",b(21,dg))("queryParams",de(22,ug,y(19,12,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),y(20,15,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),r(8),m("ngIf",t.data))},dependencies:[N,j,k,A,z,K,O,L,le,ae,ge,we,Q,re,ei,te,ee,X],encapsulation:2})};var d1=()=>["/menu/Reports/Sales_Report/Standard/Person"],u1=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],_1=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],g1=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],f1=(i,c)=>({From:i,To:c}),Do=i=>({ID:i}),vo=(i,c,e,o)=>({SalesID:i,From:c,To:e,VariantName:o});function C1(i,c){if(i&1){let e=F();n(0,"a",16),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",17),p(2," Export "),a()}}function x1(i,c){if(i&1){let e=F();se(0),n(1,"div",23)(2,"div",24)(3,"datepicker",25),h("dateChange",function(t){u(e);let l=s(3);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(4,"div",26)(5,"app-timepicker",27),h("timeChange",function(t){u(e);let l=s(3);return x(l.timeFrom,t)||(l.timeFrom=t),_(t)}),T("timeChange",function(t){u(e);let l=s(3);return _(l.timeFromChange(t))}),a()()(),n(6,"div",28)(7,"div",24)(8,"datepicker",29),h("dateChange",function(t){u(e);let l=s(3);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"div",26)(10,"app-timepicker",27),h("timeChange",function(t){u(e);let l=s(3);return x(l.timeTo,t)||(l.timeTo=t),_(t)}),T("timeChange",function(t){u(e);let l=s(3);return _(l.timeToChange(t))}),a()()(),ce()}if(i&2){let e=s(3);r(3),m("width",100),C("date",e.pageData.Filter.From),r(2),C("time",e.timeFrom),r(3),m("width",100),C("date",e.pageData.Filter.To),r(2),C("time",e.timeTo)}}function h1(i,c){if(i&1){let e=F();n(0,"div")(1,"datepicker",30),h("dateChange",function(t){u(e);let l=s(3);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s(3);return _(t.onFilterFromDate())}),a()(),n(2,"div",31)(3,"datepicker",32),h("dateChange",function(t){u(e);let l=s(3);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s(3);return _(t.onFilterToDate())}),a()()}if(i&2){let e=s(3);r(),C("date",e.pageData.Filter.From),m("width",100),r(2),C("date",e.pageData.Filter.To),m("width",100)}}function S1(i,c){if(i&1){let e=F();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",20),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ID,t)||(l.pageData.Filter.ID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),g(9,x1,11,6,"ng-container",21)(10,h1,4,4,"ng-template",null,1,M),n(12,"h6"),p(13,"Filter Invoice By"),a(),n(14,"radio-options",22),h("modelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.isCreated,t)||(l.pageData.Filter.isCreated=t),_(t)}),a()()}if(i&2){let e=lt(11),o=s(2);r(3),m("accessType",2)("multiple",!0),C("ngModel",o.pageData.Filter.ListIDs),m("outlets",o.pageData.Options==null?null:o.pageData.Options.Entities),r(3),C("ngModel",o.pageData.Filter.ID),r(3),m("ngIf",o.pageData.Filter.isCreated)("ngIfElse",e),r(5),m("options",o.filterInvoiceBy),C("model",o.pageData.Filter.isCreated)}}function y1(i,c){i&1&&(n(0,"th",41),p(1," Commission "),a())}function D1(i,c){i&1&&(n(0,"th",41),p(1," Total Commission "),a())}function v1(i,c){if(i&1&&(n(0,"thead",36)(1,"tr",37)(2,"th",38)(3,"h2")(4,"a",39),p(5),a()()()(),n(6,"tr")(7,"th",40),p(8,"Product"),a(),n(9,"th",41),p(10,"Qty"),a(),n(11,"th",41),p(12,"Sales"),a(),g(13,y1,2,0,"th",42)(14,D1,2,0,"th",42),a()()),i&2){let e=s().$implicit,o=s(2);r(4),m("queryParams",U(5,Do,e.ID)),r(),Kt("",e.Name," - ",e.Code,""),r(8),m("ngIf",o.roleService.product.CommissionView),r(),m("ngIf",o.roleService.product.CommissionView)}}function w1(i,c){if(i&1&&(n(0,"div")(1,"a",48),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s(2).$implicit,o=s(4);Pi("text-decoration-line-through",e.VariantCommission&&e.GroupCommission)("text-danger",e.VariantCommission&&e.GroupCommission),r(),m("queryParams",Qt(14,vo,e.SalesID,y(2,6,o.pageData.Filter.From,"ddMMyyyy"),y(3,9,o.pageData.Filter.To,"ddMMyyyy"),e.Name)),r(3),w(f(5,12,e.VariantCommission))}}function T1(i,c){if(i&1&&(n(0,"div")(1,"a",49),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s(2).$implicit,o=s(4);r(),m("queryParams",Qt(10,vo,e.SalesID,y(2,2,o.pageData.Filter.From,"ddMMyyyy"),y(3,5,o.pageData.Filter.To,"ddMMyyyy"),e.Name)),r(3),w(f(5,8,e.GroupCommission))}}function P1(i,c){if(i&1&&(n(0,"td",45),g(1,w1,6,19,"div",47)(2,T1,6,15,"div",35),a()),i&2){let e=s().$implicit;r(),m("ngIf",e.VariantCommission||!e.GroupCommission),r(),m("ngIf",e.GroupCommission)}}function F1(i,c){if(i&1&&(n(0,"td",45),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.TotalCommission)," ")}}function I1(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",44),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",45),p(7),d(8,"quantityFraction"),a(),n(9,"td",45),p(10),d(11,"amountFraction"),a(),g(12,P1,3,2,"td",46)(13,F1,3,3,"td",46),a()),i&2){let e=c.$implicit,o=s(4);r(2),m("queryParams",U(11,Do,e.VariantID)),r(),w(e.Name),r(2),w(e.Code),r(2),w(f(8,7,e.Quantity)),r(3),w(f(11,9,e.NettSales)),r(2),m("ngIf",o.roleService.product.CommissionView),r(),m("ngIf",o.roleService.product.CommissionView)}}function b1(i,c){if(i&1&&(n(0,"tbody"),g(1,I1,14,13,"tr",43),a()),i&2){let e=s().$implicit;r(),m("ngForOf",e.Item)}}function E1(i,c){if(i&1&&(n(0,"div"),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),n(5,"span",51),p(6),d(7,"sum"),d(8,"amountFraction"),a()()),i&2){let e=s(3).$implicit;Pi("text-decoration-line-through",y(1,5,e.Item,"VariantCommission")&&y(2,8,e.Item,"GroupCommission"))("text-danger",y(3,11,e.Item,"VariantCommission")&&y(4,14,e.Item,"GroupCommission")),r(6),w(f(8,20,y(7,17,e.Item,"VariantCommission")))}}function M1(i,c){if(i&1&&(n(0,"div"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3).$implicit;r(),v(" ",f(3,4,y(2,1,e.Item,"GroupCommission"))," ")}}function V1(i,c){if(i&1&&(n(0,"td",45),g(1,E1,9,22,"div",47),d(2,"sum"),d(3,"sum"),g(4,M1,4,6,"div",35),d(5,"sum"),a()),i&2){let e=s(2).$implicit;r(),m("ngIf",y(2,2,e.Item,"VariantCommission")||!y(3,5,e.Item,"GroupCommission")),r(3),m("ngIf",y(5,8,e.Item,"GroupCommission"))}}function B1(i,c){if(i&1&&(n(0,"td",45),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2).$implicit;r(),v(" ",f(3,4,y(2,1,e.Item,"TotalCommission"))," ")}}function O1(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",50)(2,"td"),p(3,"Total"),a(),n(4,"td",45),p(5),d(6,"sum"),d(7,"quantityFraction"),a(),n(8,"td",45),p(9),d(10,"sum"),d(11,"amountFraction"),a(),g(12,V1,6,11,"td",46)(13,B1,4,6,"td",46),a()()),i&2){let e=s().$implicit,o=s(2);r(5),v(" ",f(7,7,y(6,4,e.Item,"Quantity"))," "),r(4),v(" ",f(11,12,y(10,9,e.Item,"NettSales"))," "),r(3),m("ngIf",o.roleService.product.CommissionView),r(),m("ngIf",o.roleService.product.CommissionView)}}function L1(i,c){if(i&1&&(n(0,"table",33),g(1,v1,15,7,"thead",34)(2,b1,2,1,"tbody",35)(3,O1,14,14,"tfoot",35),a()),i&2){let e=c.$implicit;r(),m("ngIf",e.Name),r(),m("ngIf",e.Name),r(),m("ngIf",e.Name)}}function R1(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",3),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",4)(3,"a",5),T("click",function(){u(e);let t=s();return _(t.print())}),I(4,"i",6),p(5," Print"),a(),g(6,C1,3,0,"a",7),n(7,"div",8)(8,"button",9),p(9," More "),a(),n(10,"ul",10)(11,"li")(12,"a",11),p(13,"Summary"),a()(),n(14,"li")(15,"a",11),p(16,"By Outlet"),a()(),n(17,"li")(18,"a",11),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",12),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),g(26,S1,15,9,"ng-template",null,0,M),a(),n(28,"content")(29,"div",13)(30,"div",14),g(31,L1,4,3,"table",15),a()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),r(6),m("ngIf",e.roleService==null?null:e.roleService.global.Export),r(6),m("routerLink",b(17,d1)),r(3),m("routerLink",b(18,u1)),r(3),m("routerLink",b(19,_1)),r(3),m("routerLink",b(20,g1))("queryParams",de(21,f1,y(22,11,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),y(23,14,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),r(10),m("ngForOf",e.data.Data)}}var Qn=class i extends he{constructor(e,o,t,l,S,P){super(e,o,"Report/GetSalesPersonCommissionGroupByProduct","ReportLoader/SalesCommissionLoader",null,P);this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S;this.activatedRoute=P}filterInvoiceBy=[{Key:!1,Value:"Date"},{Key:!0,Value:"Created"}];timeFrom;timeTo;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(q,{data:{title:"Employee Commission Report",exportTypes:[{ID:"ReportExport/SalesPersonGroupByProduct",Value:"Default",FileName:"Employee Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To),this.onFilterToDate()}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From),this.onFilterFromDate()}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y),D(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-commision-report"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],["DATEONLY",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],["class","btn btn-outline-secondary ms-3",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid","class","table border-bottom mb-10",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],[4,"ngIf","ngIfElse"],["name","Is Created",3,"modelChange","options","model"],[1,"w-100","d-flex","mt-2","align-items-center"],[1,"w-100"],["name","From","appearance","outline",3,"dateChange","width","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","mt-4"],["name","To","appearance","outline",3,"dateChange","width","date"],["name","From","appearance","outline",3,"dateChange","date","width"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date","width"],["id","tableGrid",1,"table","border-bottom","mb-10"],["class","thead-light",4,"ngIf"],[4,"ngIf"],[1,"thead-light"],[2,"border","none !important"],["colspan","5",1,"text-center","bg-white","border-none"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],[2,"width","200px"],[1,"text-end",2,"width","100px"],["style","width: 100px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"text-decoration-line-through","text-danger",4,"ngIf"],["routerLink","Commission_Report_Detail","matTooltipPosition","above","matTooltip","variant commission",3,"queryParams"],["routerLink","Commission_Report_Detail",3,"queryParams"],[1,"table-footer","fw-bold"],["matTooltipPosition","above","matTooltip","Total variant commission"]],template:function(o,t){o&1&&g(0,R1,32,24,"mainpanel-cmp",2),o&2&&m("ngIf",t.data)},dependencies:[N,j,k,A,K,O,L,le,we,hi,Q,Qe,re,ee,X,Z],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}} datepicker.timepicker>mat-form-field{width:140px!important}"]})};var k1=()=>["/menu/Reports/Sales_Report/Standard/Person"],W1=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],N1=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],A1=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],G1=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],H1=i=>({ID:i});function Q1(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 j1(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=s();return x(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 Person"),a(),n(6,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),h("dateChange",function(t){u(e);let l=s();return x(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),h("dateChange",function(t){u(e);let l=s();return x(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();r(3),m("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Outlets),r(3),C("ngModel",e.pageData.Filter.SalesID),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function Y1(i,c){i&1&&(n(0,"th",21),p(1," Commission "),a())}function q1(i,c){i&1&&(n(0,"th",21),p(1," Total Commission "),a())}function U1(i,c){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=s().$implicit,o=s(2);r(),v(" ",y(2,1,e.SalesCommission,o.pageData.FractionDigit)," ")}}function K1(i,c){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=s().$implicit,o=s(2);r(),v(" ",y(2,1,e.Total,o.pageData.FractionDigit)," ")}}function z1(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"date"),a(),n(4,"td"),p(5),a(),n(6,"td")(7,"a",35),p(8),a()(),n(9,"td"),p(10),a(),n(11,"td"),p(12),a(),n(13,"td",26),p(14),d(15,"number"),a(),g(16,U1,3,4,"td",36)(17,K1,3,4,"td",36),a()),i&2){let e=c.$implicit,o=s(2);r(2),w(y(3,10,e.Date,"dd MMM yyyy")),r(3),w(e.EntityName),r(2),m("routerLink",b(15,G1))("queryParams",U(16,H1,e.ID)),r(),w(e.Number),r(2),w(e.VariantName),r(2),w(e.SalesName),r(2),w(f(15,13,e.Quantity)),r(2),m("ngIf",o.roleService.product.CommissionView),r(),m("ngIf",o.roleService.product.CommissionView)}}function X1(i,c){if(i&1&&(n(0,"td",37),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);r(),v(" ",y(3,4,y(2,1,e.data.Data,"SalesCommission"),e.pageData.FractionDigit)," ")}}function Z1(i,c){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);r(),v(" ",y(3,4,y(2,1,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function J1(i,c){if(i&1){let e=F();n(0,"span",39),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail"))}),n(1,"i",40),p(2,"?"),a()()}}function $1(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"quantityFraction"),a()),i&2){let e=s(2);r(),w(f(2,1,e.listTotal))}}function ef(i,c){if(i&1){let e=F();n(0,"div",41)(1,"a",42),T("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),I(2,"i",43),p(3," Next"),a(),n(4,"a",44),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail",!0))}),I(5,"i",45),p(6," Show All"),a()()}}function tf(i,c){if(i&1&&(n(0,"div",16)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),p(5,"Date"),a(),n(6,"th",20),p(7,"Outlet"),a(),n(8,"th",20),p(9,"Number"),a(),n(10,"th"),p(11,"Name"),a(),n(12,"th"),p(13,"Sales Person"),a(),n(14,"th",21),p(15,"Quantity"),a(),g(16,Y1,2,0,"th",22)(17,q1,2,0,"th",22),a()(),n(18,"tbody"),g(19,z1,18,18,"tr",23),a(),n(20,"tfoot")(21,"tr",24)(22,"td",25),p(23,"Total:"),a(),n(24,"td",26),p(25),d(26,"sum"),d(27,"number"),a(),g(28,X1,4,7,"td",27)(29,Z1,4,7,"td",28),a()()(),n(30,"div",29)(31,"div",30)(32,"div",31),p(33),d(34,"number"),g(35,J1,3,0,"span",32)(36,$1,3,3,"span",33),p(37),a()(),g(38,ef,7,0,"div",34),a()()),i&2){let e=s();r(16),m("ngIf",e.roleService.product.CommissionView),r(),m("ngIf",e.roleService.product.CommissionView),r(2),m("ngForOf",e.infiniteList),r(6),v(" ",f(27,14,y(26,11,e.data.Data,"Quantity"))," "),r(3),m("ngIf",e.roleService.product.CommissionView),r(),m("ngIf",e.roleService.product.CommissionView),r(4),v(" Showing 1 - ",f(34,16,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),r(2),m("ngIf",!e.pageData.HideStoreApiCount),r(),m("ngIf",e.pageData.HideStoreApiCount),r(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),r(),m("ngIf",e.nextPageDisabled&&!e.goToLast)}}var jn=class i extends he{constructor(e,o,t,l,S,P,Ee){super(e,o,"Report/GetSalesPersonCommissionDetail","ReportLoader/SalesCommissionDetailLoader",null,S);this.httpService=o;this.csvConverter=t;this.datePipe=l;this.activatedRoute=S;this.roleService=P;this.matDialog=Ee}datasource=[];transformDate(e,o){return this.datePipe.transform(e,o)}getFilterData(e){this.infiniteList=this.originalData.filter(o=>Object.keys(o).some(t=>o[t]==null?!1:o[t].toString().toLowerCase().includes(e.toLowerCase())))}openExportModal(){this.matDialog.open(q,{data:{title:"Commission Report Detail",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionDetail",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountSalesPersonCommissionDetail",pagination:!0}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(ee),D(Oe),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-commision-report-detail"]],standalone:!1,features:[R],decls:24,vars:14,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","120px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end"],[1,"text-end","text-success"],["class","text-end text-success","colspan","1",4,"ngIf"],["class","text-end text-success","colspan","2",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],["class","btn-group",4,"ngIf"],["h","",3,"routerLink","queryParams"],["class","text-end text-success",4,"ngIf"],["colspan","1",1,"text-end","text-success"],["colspan","2",1,"text-end","text-success"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),h("textChange",function(P){return u(l),x(t.pageData.Filter.VariantName,P)||(t.pageData.Filter.VariantName=P),_(P)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())})("textChange",function(P){return u(l),_(t.getFilterData(P))}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,Q1,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9,"Summary"),a()(),n(10,"li")(11,"a",6),p(12,"By Outlet"),a()(),n(13,"li")(14,"a",6),p(15,"By Employee"),a()(),n(16,"li")(17,"a",6),p(18,"By Sales Group"),a()()()()(),n(19,"filters"),g(20,j1,13,7,"ng-template",null,0,M),a(),n(22,"content"),g(23,tf,39,18,"div",7),a()()}o&2&&(m("pageData",t.menuData),C("text",t.pageData.Filter.VariantName),m("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(6),m("routerLink",b(10,k1)),r(3),m("routerLink",b(11,W1)),r(3),m("routerLink",b(12,N1)),r(3),m("routerLink",b(13,A1)),r(6),m("ngIf",t.infiniteList))},dependencies:[N,j,k,A,K,O,L,le,Q,Qe,re,te,ee,Z],encapsulation:2})};var wo=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],To=i=>({ID:i});function nf(i,c){if(i&1){let e=F();n(0,"button",19),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",20),p(2," Export "),a()}}function af(i,c){if(i&1){let e=F();n(0,"div")(1,"div",21)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",22),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",23),h("selectedCategoryIDChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Supplier"),a(),n(10,"autocompleteV2",24),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",25),h("dateChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",26)(16,"datepicker",27),h("dateChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Currency"),a(),n(19,"ng-select",28),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(20,"h6"),p(21,"Sort"),a(),n(22,"radio-options",29),h("modelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.IsDesc,t)||(l.pageData.Filter.IsDesc=t),_(t)}),a(),n(23,"h6"),p(24,"Purchase Order Tag"),a(),n(25,"ng-select",30),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Note Visible"),a(),n(28,"radio-options",31),h("modelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(29,"h6"),p(30,"Order By"),a(),n(31,"radio-options",32),h("modelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),T("modelChange",function(){u(e);let t=s(2);return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=s(2);r(4),m("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.pageData.Filter.SupplierID),r(4),m("isFloatingLabel",!1),C("date",e.pageData.Filter.From),r(2),m("isFloatingLabel",!1),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies),r(3),C("model",e.pageData.Filter.IsDesc),m("options",e.AscDscRadio),r(3),m("items",e.pageData.Options.Tags),C("ngModel",e.pageData.Filter.TagID),r(3),C("model",e.pageData.Filter.NoteVisible),r(3),C("model",e.pageData.Filter.DefaultFilterColumn),m("options",e.pageData.Options.DefaultFilterColumnOptions)}}function rf(i,c){if(i&1&&(n(0,"th",33),p(1),a()),i&2){let e=s(2);r(),v(" Cost(",e.data.Symbol,") ")}}function of(i,c){i&1&&(n(0,"th",34),p(1," Disc "),a())}function lf(i,c){if(i&1&&(n(0,"th",35),p(1),a()),i&2){let e=s(2);r(),v(" Total(",e.data.Symbol,") ")}}function pf(i,c){i&1&&(n(0,"span"),p(1," /"),a())}function mf(i,c){if(i&1&&(n(0,"a",38)(1,"span",49),p(2),a()()),i&2){let e=s().$implicit;m("routerLink",b(3,wo))("queryParams",U(4,To,e.Data.ID)),r(2),w("#"+e.PONumber)}}function sf(i,c){if(i&1&&(n(0,"th",60),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e==null?null:e.UnitPrice)," ")}}function cf(i,c){if(i&1&&(n(0,"div",63),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;r(),v(" ",f(2,1,e==null?null:e.DiscountAmount)," ")}}function df(i,c){if(i&1&&(n(0,"th",61),p(1),d(2,"amountFraction"),g(3,cf,3,3,"div",62),a()),i&2){let e=s().$implicit;r(),v(" ",(e==null?null:e.Discount)==0?"":f(2,2,e==null?null:e.Discount)+"%"," "),r(2),m("ngIf",(e==null?null:e.DiscountAmount)>0)}}function uf(i,c){if(i&1&&(n(0,"th",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e==null?null:e.Total)," ")}}function _f(i,c){if(i&1&&(n(0,"tr")(1,"th",50)(2,"div",51)(3,"span"),p(4),a(),I(5,"small",52),a()(),n(6,"th",53),p(7),a(),n(8,"th",54),p(9),d(10,"quantityFraction"),a(),n(11,"th",55),p(12),d(13,"quantityFraction"),a(),n(14,"th",56),p(15),a(),g(16,sf,3,3,"th",57)(17,df,4,4,"th",58)(18,uf,3,3,"th",59),a()),i&2){let e=c.$implicit,o=s(3);r(4),w(e==null?null:e.Name),r(),m("innerHtml",e==null?null:e.Note,Pe),r(2),v(" ",e==null?null:e.Code," "),r(2),v(" ",f(10,9,e==null?null:e.QtyRequested)," "),r(3),v(" ",f(13,11,e==null?null:e.Quantity)," "),r(3),v(" ",e==null?null:e.UOMName," "),r(),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.product.Cost)}}function gf(i,c){if(i&1&&(se(0),n(1,"tr")(2,"th",71),p(3),a(),n(4,"th",72),p(5),a(),n(6,"th",73),p(7),d(8,"amountFraction"),a()(),ce()),i&2){let e=c.$implicit;r(3),v("",e.Label," :"),r(2),v(" ",e==null?null:e.CurrencySymbol," "),r(2),v(" ",f(8,3,e==null?null:e.Amount)," ")}}function ff(i,c){if(i&1&&(n(0,"table",65),g(1,gf,9,5,"ng-container",17),a()),i&2){let e=s(2).$implicit;r(),m("ngForOf",e==null?null:e.Aggregate)}}function Cf(i,c){if(i&1&&(n(0,"tfoot",65)(1,"tr",66)(2,"td",67),p(3,"Total"),a(),n(4,"td",68)(5,"b"),p(6),d(7,"sum"),d(8,"quantityFraction"),a()(),I(9,"td",69),n(10,"td",70),g(11,ff,2,1,"table",48),a()()()),i&2){let e=s().$implicit,o=s(2);r(6),w(f(8,5,y(7,2,e.Items,"Quantity"))),r(5),m("ngIf",o.roleService.product.Cost)}}function xf(i,c){if(i&1&&(n(0,"div")(1,"div",36)(2,"div",37)(3,"a",38)(4,"span",39),p(5),a()(),g(6,pf,2,0,"span",40)(7,mf,3,6,"a",41),n(8,"span"),p(9),d(10,"date"),a(),I(11,"span",10),n(12,"strong",42),p(13),d(14,"sum"),d(15,"sum"),d(16,"quantityFraction"),a(),I(17,"small",43),a(),n(18,"div",44)(19,"label",45),p(20),a()()(),n(21,"table",46),I(22,"thead"),n(23,"tbody",47),g(24,_f,19,13,"tr",17),a(),g(25,Cf,12,7,"tfoot",48),a()()),i&2){let e=c.$implicit,o=s(2);r(3),m("routerLink",b(22,wo))("queryParams",U(23,To,e.Data.ID)),r(2),w(e.Data.EntityName+" #"+e.Data.Number),r(),m("ngIf",o.pageData.DualReceiptNumber),r(),m("ngIf",o.pageData.DualReceiptNumber),r(2),w(" - "+y(10,11,e.Data.Date,"dd MMM yyyy")+(e.Data.Name==null?"":" : "+e.Data.Name)),r(4),v(" ","[Q: "+y(14,14,e.Items,"Quantity")+", T: "+f(16,20,y(15,17,e.Items,"Total"))+"]"," "),r(4),m("innerHtml",e==null||e.Data==null?null:e.Data.Note,Pe),r(3),w(e.Data==null?null:e.Data.PaymentStateLabel),r(4),m("ngForOf",e.Items),r(),m("ngIf",o.roleService.product.Cost)}}function hf(i,c){if(i&1&&(n(0,"div",76)(1,"div")(2,"strong"),p(3,"Tax Added"),a(),n(4,"span",71),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Purchases with Tax"),a(),n(10,"span",71),p(11),d(12,"amountFraction"),a()()()),i&2){let e=s(3);r(5),w(f(6,2,e.data.Aggregate.TaxAdd)),r(6),w(f(12,4,e.data.Aggregate.PurchaseWithTax))}}function Sf(i,c){if(i&1&&(n(0,"div",76)(1,"div")(2,"strong"),p(3,"Gross Purchase"),a(),n(4,"span",71),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Discount"),a(),n(10,"span",71),p(11),d(12,"amountFraction"),a()(),n(13,"div")(14,"strong"),p(15,"Tax Incl."),a(),n(16,"span",71),p(17),d(18,"amountFraction"),a()(),n(19,"div")(20,"strong"),p(21,"Net Purchase"),a(),n(22,"span",71),p(23),d(24,"amountFraction"),a()()()),i&2){let e=s(3);r(5),w(f(6,4,e.data.Aggregate.Gross)),r(6),w(f(12,6,e.data.Aggregate.Discount)),r(6),w(f(18,8,e.data.Aggregate.TaxInclude)),r(6),w(f(24,10,e.data.Aggregate.NetPurchase))}}function yf(i,c){if(i&1&&(n(0,"div",74),g(1,hf,13,6,"div",75),n(2,"div",76)(3,"div")(4,"strong"),p(5,"Orders"),a(),n(6,"span",71),p(7),d(8,"amountFraction"),a()(),n(9,"div")(10,"strong"),p(11,"Qty"),a(),n(12,"span",71),p(13),d(14,"quantityFraction"),a()()(),g(15,Sf,25,12,"div",75),a()),i&2){let e=s(2);r(),m("ngIf",e.roleService.product.Cost),r(6),w(f(8,4,e.data.Aggregate.TotalTransaction)),r(6),w(f(14,6,e.data.Aggregate.UnitQuantity)),r(2),m("ngIf",e.roleService.product.Cost)}}function Df(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,nf,3,0,"button",3),a(),n(3,"filters"),g(4,af,32,20,"ng-template",null,0,M),a(),n(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th",7),p(12,"Name"),a(),n(13,"th",8),p(14,"Code"),a(),n(15,"th",9)(16,"span",10),p(17,"Requested"),a(),p(18," qty "),a(),n(19,"th",11),p(20,"Qty"),a(),n(21,"th",12),p(22,"UOM"),a(),g(23,rf,2,1,"th",13)(24,of,2,0,"th",14)(25,lf,2,1,"th",15),a()(),n(26,"tbody")(27,"tr")(28,"td",16),g(29,xf,26,25,"div",17),a()()()(),g(30,yf,16,8,"div",18),a()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),r(2),m("ngIf",e.roleService.global.Export),r(21),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(3),Ht("colspan",e.roleService.product.Cost?8:6),r(),m("ngForOf",e.data.Data),r(),m("ngIf",e.data.Data.length>0)}}var Yn=class i extends ie{constructor(e,o,t,l,S,P){super(e,o,"Report/GetPurchaseTransactionDetail","ReportLoader/GetPurchaseTransactionDetail");this.httpService=o;this.csvConverter=t;this.datePipe=l;this.roleService=S;this.matDialog=P}hideMore=!0;AscDscRadio=[{Key:!1,Value:"Asc"},{Key:!0,Value:"Desc"}];SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];openExportModal(){this.matDialog.open(q,{data:{title:"Product Transaction Detail",exportTypes:[{ID:"ReportExport/ReportPurchaseDetail",Value:"Default",FileName:"Product Transaction Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty),this.datePipe.transform(this.pageData.Filter.From,"MMM")===this.datePipe.transform(this.pageData.Filter.To,"MMM")&&this.datePipe.transform(this.pageData.Filter.From,"yyyy")===this.datePipe.transform(this.pageData.Filter.To,"yyyy")?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d")}`:this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`,this.pageData.Filter.From==this.pageData.Filter.To?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`:this.menuData.H+=` - ${this.datePipe.transform(this.pageData.Filter.To,"d MMM yyyy")}`,this.menuData.H+=" ]"}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(ee),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-detail"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","355px"],[2,"width","50px"],[1,"text-end",2,"width","55px"],[1,"d-block"],[1,"text-end",2,"width","33px"],[1,"fst-italic","small",2,"width","40px"],["class","text-end","style","width: 80px",4,"ngIf"],["class","red","style","width: 30px",4,"ngIf"],["class","text-end","style","width: 150px",4,"ngIf"],[1,"px-0","border-bottom-0"],[4,"ngFor","ngForOf"],["class","row justify-content-end",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],[1,"mt-4"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","AscDesc",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","items","ngModel"],["name","NoteVisible",3,"modelChange","model"],["name","Sort",3,"modelChange","model","options"],[1,"text-end",2,"width","80px"],[1,"red",2,"width","30px"],[1,"text-end",2,"width","150px"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","mt-2","mb-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-3"],[4,"ngIf"],["class","h5 text-primary fw-bold",3,"routerLink","queryParams",4,"ngIf"],[1,"text-danger","ms-3"],[1,"d-block","fw-normal","fst-italic","ms-3",2,"word-break","break-all",3,"innerHtml"],[1,"d-lg-block","mt-2","me-5","fw-bold","fst-italic"],["runat","server",1,"status"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],["class","table table-sm table-borderless",4,"ngIf"],["id","PONumber"],[1,"fw-normal","border-start","border-end",2,"width","325px"],[1,"lh-base"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","50px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","65px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","30px"],[1,"fst-italic","border-start","border-end","small",2,"width","40px"],["class","fw-normal border-start border-end text-end","style","width: 80px",4,"ngIf"],["class","fw-normal border-start border-end text-end text-danger","style","width: 30px",4,"ngIf"],["class","fw-normal border-start border-end text-end","style","width: 140px",4,"ngIf"],[1,"fw-normal","border-start","border-end","text-end",2,"width","80px"],[1,"fw-normal","border-start","border-end","text-end","text-danger",2,"width","30px"],["class","text-danger",4,"ngIf"],[1,"text-danger"],[1,"fw-normal","border-start","border-end","text-end",2,"width","140px"],[1,"table","table-sm","table-borderless"],[1,"grid_footer"],["colspan","2",1,"text-end","fw-bold"],["colspan","2",1,"text-end"],["colspan","3"],[1,"text-end","d-flex","justify-content-end","fw-bold"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[1,"row","justify-content-end"],["class","zebra col-auto",4,"ngIf"],[1,"zebra","col-auto"]],template:function(o,t){o&1&&g(0,Df,31,11,"mainpanel-cmp",1),o&2&&m("ngIf",t.data)},dependencies:[N,j,k,A,z,K,O,L,we,Le,fe,Q,re,ee,X,Z],encapsulation:2})};var Po=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Ha=i=>({ID:i}),vf=()=>["/menu/Contacts/Contact/Suppliers/Info"];function wf(i,c){if(i&1){let e=F();n(0,"button",26),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",27),p(2," Export "),a()}}function Tf(i,c){if(i&1){let e=F();n(0,"div")(1,"div",28)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",29),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",30),h("dateChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",31)(10,"datepicker",32),h("dateChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Payment"),a(),n(13,"ng-select",33),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.StateID,t)||(l.pageData.Filter.StateID=t),_(t)}),a(),n(14,"h6"),p(15,"Supplier"),a(),n(16,"autocompleteV2",34),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(17,"h6"),p(18,"RowCount"),a(),n(19,"input",35),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(20,"h6"),p(21,"Order By"),a(),n(22,"radio-options",36),h("modelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),T("modelChange",function(){u(e);let t=s(2);return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=s(2);r(4),m("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.StateID),m("items",e.pageData.Options==null?null:e.pageData.Options.States),r(3),C("ngModel",e.pageData.Filter.SupplierID),m("inputTextValue",e.contactDisplay),r(3),m("max",1e4),C("ngModel",e.pageData.Filter.RowCount),r(3),C("model",e.pageData.Filter.DefaultFilterColumn),m("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Pf(i,c){i&1&&(n(0,"th",37),p(1," Purchase "),a())}function Ff(i,c){i&1&&(n(0,"th",38),p(1," Tax "),a())}function If(i,c){i&1&&(n(0,"th",39),p(1," Total Amount "),a())}function bf(i,c){i&1&&(n(0,"th",40),p(1," Payment "),a())}function Ef(i,c){i&1&&I(0,"br")}function Mf(i,c){if(i&1&&(n(0,"a",41),p(1),a()),i&2){let e=s().$implicit;m("routerLink",b(3,Po))("queryParams",U(4,Ha,e.PurchaseOrderID)),r(),w(e.PONumber)}}function Vf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Sales)," ")}}function Bf(i,c){if(i&1&&(n(0,"td",44),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Tax)," ")}}function Of(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.TotalAmount)," ")}}function Lf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.PaymentAmount)," ")}}function Rf(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",41),p(5),a(),g(6,Ef,1,0,"br",42)(7,Mf,2,6,"a",43),a(),n(8,"td"),p(9),d(10,"date"),a(),n(11,"td")(12,"a",41),p(13),a()(),n(14,"td",22),p(15),d(16,"quantityFraction"),a(),g(17,Vf,3,3,"td",23)(18,Bf,3,3,"td",24)(19,Of,3,3,"td",23)(20,Lf,3,3,"td",23),n(21,"td"),p(22),a()()),i&2){let e=c.$implicit,o=s(2);r(2),w(e.EntityName),r(2),m("routerLink",b(25,Po))("queryParams",U(26,Ha,e.ID)),r(),w(e.Number),r(),m("ngIf",o.pageData.DualNumber),r(),m("ngIf",o.pageData.DualNumber),r(2),w(y(10,20,e.Date,"dd MMM yyyy")),r(3),m("routerLink",b(28,vf))("queryParams",U(29,Ha,e.SupplierID)),r(),v(" ",e.SupplierNameDisplay," "),r(2),v(" ",f(16,23,e.TotalItemQuantity)," "),r(2),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.product.Cost),r(),Pi("text-danger",e.PaymentStateLabel==="Unpaid")("text-success",e.PaymentStateLabel==="Paid"),r(),v(" ",e.PaymentStateLabel," ")}}function kf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Sales"))," ")}}function Wf(i,c){if(i&1&&(n(0,"td",44),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Tax"))," ")}}function Nf(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"TotalAmount"))," ")}}function Af(i,c){if(i&1&&(n(0,"td",22),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"PaymentAmount"))," ")}}function Gf(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),h("textChange",function(t){u(e);let l=s();return x(l.pageData.Filter.Number,t)||(l.pageData.Filter.Number=t),_(t)}),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,wf,3,0,"button",3),a(),n(3,"filters"),g(4,Tf,23,14,"ng-template",null,0,M),a(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Outlet"),a(),n(14,"th",9),p(15,"Number"),a(),n(16,"th",10),p(17,"Date"),a(),n(18,"th",11),p(19," Supplier "),a(),n(20,"th",12),p(21," Qty "),a(),g(22,Pf,2,0,"th",13)(23,Ff,2,0,"th",14)(24,If,2,0,"th",15)(25,bf,2,0,"th",16),n(26,"th",17),p(27,"State"),a()()(),n(28,"tbody"),g(29,Rf,23,31,"tr",18),a(),n(30,"tfoot")(31,"tr",19),I(32,"td",20),n(33,"td",21),p(34,"Total:"),a(),n(35,"td",22),p(36),d(37,"sum"),d(38,"quantityFraction"),a(),g(39,kf,4,6,"td",23)(40,Wf,4,6,"td",24)(41,Nf,4,6,"td",23)(42,Af,4,6,"td",23),I(43,"td",25),a()()()()()()()}if(i&2){let e=s();m("pageData",e.menuData),C("text",e.pageData.Filter.Number),m("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),r(2),m("ngIf",e.roleService.global.Export),r(20),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(4),m("ngForOf",e.data.Data),r(7),v(" ",f(38,18,y(37,15,e.data.Data,"TotalItemQuantity"))," "),r(3),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost)}}var qn=class i extends ie{constructor(e,o,t,l,S,P){super(e,o,"Report/ReportPurchaseSummary","ReportLoader/GetReportPurchaseSummary",null,l);this.httpService=o;this.csvConverter=t;this.url=l;this.roleService=S;this.matDialog=P}contactDisplay;preInitLoader(){let e=this.loaderPayload.ListIDs;typeof e=="string"&&V.IsNotEmpty(e)&&(this.loaderPayload.ListIDs=[e])}openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Report Summary",exportTypes:[{ID:"ReportExport/ReportPurchaseSummary",Value:"Default",FileName:"Purchase Report Summary"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.menuData.H=e.PageTitle}preInitList(){V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null),V.IsNotEmpty(this.pageData.Filter.SupplierID)&&(this.pageData.Filter.From=V.MinDate),V.IsNotEmpty(this.pageData.SupplierName)&&(this.contactDisplay=this.pageData.SupplierName)}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,t.SupplierNameDisplay=t.SupplierNameDisplay==null?"":t.SupplierNameDisplay,l.SupplierNameDisplay=l.SupplierNameDisplay==null?"":l.SupplierNameDisplay,e.active){case"EntityName":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),S);case"Number":return this.compare(t.Number,l.Number,S);case"Date":return this.compare(t.Date,l.Date,S);case"SupplierNameDisplay":return this.compare(t.SupplierNameDisplay.toLocaleLowerCase(),l.SupplierNameDisplay.toLocaleLowerCase(),S);case"TotalItemQuantity":return this.compare(t.TotalItemQuantity,l.TotalItemQuantity,S);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,S);case"Sales":return this.compare(t.Sales,l.Sales,S);case"Tax":return this.compare(t.Tax,l.Tax,S);case"PaymentAmount":return this.compare(t.PaymentAmount,l.PaymentAmount,S);case"PaymentState":return this.compare(t.PaymentStateLabel,l.PaymentStateLabel,S);default:return 0}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(Oe),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-detail-summary"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName"],["mat-sort-header","Number"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","SupplierNameDisplay",2,"width","118px"],["mat-sort-header","TotalItemQuantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Sales","arrowPosition","before","class","flex-right","style","width: 118px",4,"ngIf"],["mat-sort-header","Tax","arrowPosition","before","class","flex-right","style","width: 118px",4,"ngIf"],["mat-sort-header","Total","arrowPosition","before","class","flex-right","style","width: 118px",4,"ngIf"],["mat-sort-header","PaymentAmount","arrowPosition","before","class","flex-right","style","width: 118px",4,"ngIf"],["mat-sort-header","PaymentState",2,"width","70px"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end","empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"empty-column"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Sort",3,"modelChange","model","options"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","PaymentAmount","arrowPosition","before",1,"flex-right",2,"width","118px"],[3,"routerLink","queryParams"],[4,"ngIf"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"]],template:function(o,t){o&1&&g(0,Gf,44,20,"mainpanel-cmp",1),o&2&&m("ngIf",t.data)},dependencies:[N,j,k,A,z,K,Ge,O,L,ae,ge,He,we,Le,Q,re,ee,X,Z],encapsulation:2})};var Hf=()=>["/menu/Contacts/Contact/Suppliers/Info"],Qf=i=>({ID:i}),jf=(i,c,e)=>({SupplierID:i,From:c,To:e}),Yf=()=>["/menu/Reports/Purchases_Report/Summary"];function qf(i,c){if(i&1){let e=F();n(0,"button",20),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",21),p(2," Export "),a()}}function Uf(i,c){if(i&1){let e=F();n(0,"div")(1,"div",22)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",23),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier Group"),a(),n(7,"ng-select",24),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",25),h("dateChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",26)(13,"datepicker",27),h("dateChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",28),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=s(2);r(4),m("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Group),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),m("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function Kf(i,c){i&1&&(n(0,"th",29),p(1," Purchase "),a())}function zf(i,c){if(i&1&&(n(0,"td",16)(1,"a",34),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().$implicit,o=s(2);r(),m("queryParams",st(11,jf,e.SupplierID,y(2,3,o.pageData.Filter.From,"yyyy-MM-dd"),y(3,6,o.pageData.Filter.To,"yyyy-MM-dd")))("routerLink",b(15,Yf)),r(3),w(f(5,9,e.Total))}}function Xf(i,c){if(i&1&&(n(0,"tr",30)(1,"td"),p(2),a(),n(3,"td",31)(4,"a",32),p(5),a()(),n(6,"td",16),p(7),a(),n(8,"td",33),p(9),d(10,"quantityFraction"),a(),g(11,zf,6,16,"td",17),a()),i&2){let e=c.$implicit,o=s(2);r(2),w(e.Rank),r(2),m("routerLink",b(9,Hf))("queryParams",U(10,Qf,e.SupplierID)),r(),w(e.Name),r(2),w(e.Code),r(2),v(" ",f(10,7,e.Quantity)," "),r(2),m("ngIf",o.roleService.product.Cost)}}function Zf(i,c){i&1&&(n(0,"th",16),p(1," Total Purchase "),a())}function Jf(i,c){if(i&1&&(n(0,"td",16),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(2,1,e.data.TotalSales)," ")}}function $f(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,qf,3,0,"button",3),a(),n(3,"filters"),g(4,Uf,17,11,"ng-template",null,0,M),a(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Rank"),a(),n(14,"th",9),p(15,"Supplier"),a(),n(16,"th",10),p(17," Code "),a(),n(18,"th",11),p(19," Quantity "),a(),g(20,Kf,2,0,"th",12),a()(),n(21,"tbody"),g(22,Xf,12,12,"tr",13),a(),n(23,"tfoot")(24,"tr",14),I(25,"th",15),n(26,"th",16),p(27,"Total Quantity"),a(),g(28,Zf,2,0,"th",17),a(),n(29,"tr"),I(30,"td",18),n(31,"td",16),p(32),d(33,"quantityFraction"),a(),g(34,Jf,3,3,"td",17),a()()(),n(35,"POS-complex-pagination",19),T("jumpToPage",function(){u(e);let t=s();return _(t.getListData())})("previousPage",function(){u(e);let t=s();return _(t.getListData())})("nextPage",function(){u(e);let t=s();return _(t.getListData())}),a()()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),r(2),m("ngIf",e.roleService.global.Export),r(18),m("ngIf",e.roleService.product.Cost),r(2),m("ngForOf",e.data.Data),r(6),m("ngIf",e.roleService.product.Cost),r(4),w(f(33,12,e.data.TotalQty)),r(2),m("ngIf",e.roleService.product.Cost),r(),m("total",e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var Un=class i extends ie{constructor(e,o,t,l,S){super(e,o,"Report/TopSupplier","ReportLoader/TopSupplierLoader");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}openExportModal(){this.matDialog.open(q,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopPurchaseExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/TopSupplierCount",pagination:!0}})}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,S);case"Code":return this.compare(t.Code,l.Code,S);case"Quantity":return this.compare(t.Quantity,l.Quantity,S);case"Total":return this.compare(t.Total,l.Total,S);default:return 0}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-top-supplier"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","35px"],["mat-sort-header","Name"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","style","width: 120px","arrowPosition","before","class","flex-right",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"thead-light"],["colspan","3"],[1,"text-end"],["class","text-end",4,"ngIf"],["colspan","3",1,"bg-white","border-top-0"],["api","Report/TopSupplierCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end","text-success"],[3,"queryParams","routerLink"]],template:function(o,t){o&1&&g(0,$f,36,14,"mainpanel-cmp",1),o&2&&m("ngIf",t.data)},dependencies:[N,j,k,A,z,K,Ge,O,L,ae,ge,He,bt,Q,ee,X,Z],encapsulation:2})};var eC=i=>[i],tC=i=>({ID:i}),iC=(i,c,e,o)=>({VariantID:i,ProductID:c,From:e,To:o});function nC(i,c){if(i&1){let e=F();n(0,"button",20),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",21),p(2," Export "),a()}}function aC(i,c){if(i&1){let e=F();n(0,"div")(1,"div",22)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",23),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s(2);return _(t.onFilterOutlets())}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",24),h("selectedCategoryIDChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Currency"),a(),n(10,"ng-select",25),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",26),h("dateChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",27)(16,"datepicker",28),h("dateChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Group By"),a(),n(19,"radio-options",29),h("modelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(20,"h6"),p(21,"Brand"),a(),n(22,"ng-select",30),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()()}if(i&2){let e=s(2);r(4),m("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("model",e.pageData.Filter.GroupByProduct),m("options",e.GroupByRadio),r(3),m("multiple",!1),C("ngModel",e.pageData.Filter.BrandID),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function rC(i,c){i&1&&(n(0,"th",31),p(1," Amount "),a())}function oC(i,c){i&1&&(n(0,"th",32),p(1," Avg Cost "),a())}function lC(i,c){if(i&1&&(n(0,"td",17)(1,"a",34),p(2),d(3,"amountFraction"),a()()),i&2){let e=s().$implicit,o=s(2);r(),m("queryParams",Qt(4,iC,o.pageData.Filter.GroupByProduct?null:e.ID,o.pageData.Filter.GroupByProduct?e.ID:null,o.dateFromString(),o.dateToString())),r(),w(f(3,2,e.Total))}}function pC(i,c){if(i&1&&(n(0,"td",17),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.AvgPrice)," ")}}function mC(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",33),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td",17),p(9),d(10,"number"),a(),n(11,"td",17),p(12),d(13,"quantityFraction"),a(),g(14,lC,4,9,"td",18)(15,pC,3,3,"td",18),a()),i&2){let e=c.$implicit,o=c.index,t=s(2);r(2),w(o+1),r(2),m("routerLink",U(13,eC,t.pageData.Filter.GroupByProduct?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",U(15,tC,e.ID)),r(),w(e.Name),r(2),w(e.Code),r(2),w(f(10,9,e.Order)),r(3),w(f(13,11,e.Quantity)),r(2),m("ngIf",t.roleService.product.Cost),r(),m("ngIf",t.roleService.product.Cost)}}function sC(i,c){if(i&1&&(n(0,"td",17),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.infiniteList,"Total"))," ")}}function cC(i,c){if(i&1&&(n(0,"td",17),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.infiniteList,"AvgPrice"))," ")}}function dC(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),h("textChange",function(t){u(e);let l=s();return x(l.pageData.Filter.Text,t)||(l.pageData.Filter.Text=t),_(t)}),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,nC,3,0,"button",3),a(),n(3,"filters"),g(4,aC,23,15,"ng-template",null,0,M),a(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7),T("matSortChange",function(t){u(e);let l=s();return _(l.onSortChange(t))}),n(11,"tr")(12,"th",8),p(13,"No"),a(),n(14,"th"),p(15,"Name"),a(),n(16,"th",9),p(17,"Code"),a(),n(18,"th",10),p(19," Orders "),a(),n(20,"th",11),p(21," Quantity "),a(),g(22,rC,2,0,"th",12)(23,oC,2,0,"th",13),a()(),n(24,"tbody"),g(25,mC,16,17,"tr",14),a(),n(26,"tfoot")(27,"tr",15),I(28,"td")(29,"td",16),n(30,"td"),p(31,"Total :"),a(),n(32,"td",17),p(33),d(34,"sum"),d(35,"number"),a(),n(36,"td",17),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),g(40,sC,4,6,"td",18)(41,cC,4,6,"td",18),a()()()(),n(42,"infinite-pagination",19),T("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount",!0))}),a()()()()}if(i&2){let e=s();m("pageData",e.menuData),C("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),r(2),m("ngIf",e.roleService.global.Export),r(20),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(2),m("ngForOf",e.infiniteList),r(8),v(" ",f(35,21,y(34,18,e.infiniteList,"Order"))," "),r(4),v(" ",f(39,26,y(38,23,e.infiniteList,"Quantity"))," "),r(3),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(),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 Kn=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/PurchasesByProductList","ReportLoader/PurchasesByProductLoader");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}GroupByRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];dateFromString=bi(()=>{let e=this.pageData.Filter.From;return e?new Date(e).toJSON():null});dateToString=bi(()=>{let e=this.pageData.Filter.To;return e?new Date(e).toJSON():null});openExportModal(){this.matDialog.open(q,{data:{title:"Product Bought Report",exportTypes:[{ID:"ReportExport/PurchasesByProductExport",Value:"Default",FileName:"Product Bought Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}onSortChange(e){let o=this.infiniteList.slice();if(!e.active||e.direction===""){this.infiniteList=this.originalData;return}this.infiniteList=o.sort((t,l)=>{let S=e.direction==="asc";return this.compare(t[e.active],l[e.active],S)})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-bought"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],["matSort","",1,"thead-light","sticky-top-thead",3,"matSortChange"],[2,"width","10px"],[2,"width","100px"],["mat-sort-header","Order","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","120px"],["style","width: 140px","class","text-end","mat-sort-header","Total","arrowPosition","before",4,"ngIf"],["style","width: 120px","class","text-end","mat-sort-header","AvgPrice","arrowPosition","before",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","GroupBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["mat-sort-header","Total","arrowPosition","before",1,"text-end",2,"width","140px"],["mat-sort-header","AvgPrice","arrowPosition","before",1,"text-end",2,"width","120px"],[3,"routerLink","queryParams"],["routerLink","/menu/Reports/Purchases_Report/History",3,"queryParams"]],template:function(o,t){o&1&&g(0,dC,43,28,"mainpanel-cmp",1),o&2&&m("ngIf",t.data)},dependencies:[N,j,k,A,z,K,O,L,ae,ge,we,fe,Q,ti,re,te,X,Z],encapsulation:2})};var uC=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],zn=i=>({ID:i}),_C=()=>["/menu/Contacts/Contact/Suppliers/Info"],gC=()=>["/menu/Products/Catalog/Variants/Info"],fC=()=>["/menu/Products/Catalog/Products/Info"];function CC(i,c){if(i&1){let e=F();n(0,"button",4),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function xC(i,c){if(i&1){let e=F();n(0,"div")(1,"h6"),p(2,"Product"),a(),n(3,"autocompleteV2",17),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=s(2);r(3),C("ngModel",e.pageData.Filter.ProductID),m("inputTextValue",e.pageData.ProductName)}}function hC(i,c){if(i&1){let e=F();n(0,"div")(1,"h6"),p(2,"Variant"),a(),n(3,"autocompleteV2",18),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=s(2);r(3),C("ngModel",e.pageData.Filter.VariantID),m("renderThumbnail",!0)("inputTextValue",e.pageData.VariantName)}}function SC(i,c){if(i&1){let e=F();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier"),a(),n(7,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(8,"h6"),p(9,"Scope"),a(),n(10,"radio-options",9),h("modelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ByProduct,t)||(l.pageData.Filter.ByProduct=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()(),g(11,xC,4,2,"div",10)(12,hC,4,3,"div",10),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",11),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(17,"div",12)(18,"datepicker",13),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(19,"h6"),p(20,"Order By"),a(),n(21,"radio-options",14),h("modelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.OrderByNumber,t)||(l.pageData.Filter.OrderByNumber=t),_(t)}),a(),n(22,"h6"),p(23,"Currency"),a(),n(24,"ng-select",15),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(25,"h6"),p(26,"Brand"),a(),n(27,"ng-select",16),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()}if(i&2){let e=s();r(4),m("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("ngModel",e.pageData.Filter.SupplierID),r(3),C("model",e.pageData.Filter.ByProduct),m("options",e.ScopeRadio),r(),m("ngIf",e.pageData.Filter.ByProduct),r(),m("ngIf",!e.pageData.Filter.ByProduct),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("model",e.pageData.Filter.OrderByNumber),m("options",e.OrderByRadio),r(3),C("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),r(3),m("multiple",!1),C("ngModel",e.pageData.Filter.BrandID),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function yC(i,c){i&1&&(n(0,"th"),p(1,"Product"),a())}function DC(i,c){i&1&&(n(0,"th"),p(1,"Variant"),a())}function vC(i,c){i&1&&(n(0,"th",39),p(1," Measurement "),a())}function wC(i,c){i&1&&(n(0,"th",40),p(1," Cost "),a())}function TC(i,c){i&1&&(n(0,"th",26),p(1," Item(%) "),a())}function PC(i,c){i&1&&(n(0,"th",41),p(1," Item Disc "),a())}function FC(i,c){i&1&&(n(0,"th",26),p(1," Bill(%) "),a())}function IC(i,c){i&1&&(n(0,"th",41),p(1," Bill Disc "),a())}function bC(i,c){if(i&1&&(n(0,"th",42),p(1),a()),i&2){let e=s(2);r(),v(" Total(",e.data.CurrencySymbol,") ")}}function EC(i,c){if(i&1&&(n(0,"a",44),p(1),a()),i&2){let e=s().$implicit;m("routerLink",b(3,gC))("queryParams",U(4,zn,e.VariantID)),r(),w(e.Name)}}function MC(i,c){if(i&1&&(n(0,"a",44),p(1),a()),i&2){let e=s().$implicit;m("routerLink",b(3,fC))("queryParams",U(4,zn,e.ProductID)),r(),w(e.Name)}}function VC(i,c){if(i&1&&(n(0,"td",35),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.VariantUnitQuantity)," ")}}function BC(i,c){if(i&1&&(n(0,"td",49),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.SumUnitPrice)," ")}}function OC(i,c){if(i&1&&(n(0,"td",35),p(1),a()),i&2){let e=s().$implicit;r(),v(" ",e.Discount>0?e.Discount:""," ")}}function LC(i,c){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",e.ItemDiscountAmount>0?f(2,1,e.ItemDiscountAmount):""," ")}}function RC(i,c){if(i&1&&(n(0,"td",35),p(1),a()),i&2){let e=s().$implicit;r(),v(" ",e.DiscountInvoice>0?e.DiscountInvoice:""," ")}}function kC(i,c){if(i&1&&(n(0,"td",35),p(1),a()),i&2){let e=s().$implicit;r(),v(" ",e.OrderDiscountAmount>0?e.OrderDiscountAmount:""," ")}}function WC(i,c){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Total)," ")}}function NC(i,c){if(i&1&&(n(0,"tr",43)(1,"td"),p(2),d(3,"date"),a(),n(4,"td"),p(5),a(),n(6,"td")(7,"a",44),p(8),a()(),n(9,"td"),p(10),a(),n(11,"td")(12,"a",44),p(13),a()(),n(14,"td"),g(15,EC,2,6,"a",45)(16,MC,2,6,"a",45),a(),I(17,"td",46),n(18,"td",35),p(19),d(20,"quantityFraction"),a(),g(21,VC,3,3,"td",47)(22,BC,3,3,"td",48)(23,OC,2,1,"td",47)(24,LC,3,3,"td",47)(25,RC,2,1,"td",47)(26,kC,2,1,"td",47)(27,WC,3,3,"td",47),a()),i&2){let e=c.$implicit,o=s(2);r(2),w(y(3,20,e.Date,"dd MMM yyyy")),r(3),w(e.EntityName),r(2),m("routerLink",b(25,uC))("queryParams",U(26,zn,e.ID)),r(),v(" ",e.Number," "),r(2),w(e.DeliveryStatus),r(2),m("routerLink",b(28,_C))("queryParams",U(29,zn,e.SupplierID)),r(),w(e.SupplierName),r(2),m("ngIf",!o.pageData.Filter.ByProduct),r(),m("ngIf",o.pageData.Filter.ByProduct),r(),m("innerHTML",e.Note,Pe),r(2),w(f(20,23,e.Quantity)),r(2),m("ngIf",(e==null||e.Data==null?null:e.Data.VariantQuantity)>1),r(),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.product.Cost)}}function AC(i,c){i&1&&I(0,"td",50)}function GC(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Total"))," ")}}function HC(i,c){if(i&1){let e=F();n(0,"div",19)(1,"div",20)(2,"table",21)(3,"thead",22)(4,"tr")(5,"th",23),p(6,"Date"),a(),n(7,"th",24),p(8,"Outlet"),a(),n(9,"th",25),p(10,"Number"),a(),n(11,"th",24),p(12,"Fulfillment"),a(),n(13,"th"),p(14,"Supplier"),a(),g(15,yC,2,0,"th",10)(16,DC,2,0,"th",10),n(17,"th"),p(18,"Item Note"),a(),n(19,"th",26),p(20,"Qty"),a(),g(21,vC,2,0,"th",27)(22,wC,2,0,"th",28)(23,TC,2,0,"th",29)(24,PC,2,0,"th",30)(25,FC,2,0,"th",29)(26,IC,2,0,"th",30)(27,bC,2,1,"th",31),a()(),n(28,"tbody"),g(29,NC,28,31,"tr",32),a(),n(30,"tfoot")(31,"tr",33),I(32,"td",34),n(33,"td",35),p(34,"Total :"),a(),n(35,"td",35),p(36),d(37,"sum"),d(38,"quantityFraction"),a(),g(39,AC,1,0,"td",36)(40,GC,4,6,"td",37),a()()()(),n(41,"POS-complex-pagination",38),T("jumpToPage",function(){u(e);let t=s();return _(t.getListData())})("previousPage",function(){u(e);let t=s();return _(t.getListData())})("nextPage",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();r(15),m("ngIf",e.pageData.Filter.ByProduct),r(),m("ngIf",!e.pageData.Filter.ByProduct),r(5),m("ngIf",(e.data==null||e.data.Data==null?null:e.data.Data.VariantQuantity)>1),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(2),m("ngForOf",e.data.Data),r(7),v(" ",f(38,18,y(37,15,e.data.Data,"Quantity"))," "),r(3),m("ngIf",(e.data==null||e.data.Data==null?null:e.data.Data.VariantQuantity)>1),r(),m("ngIf",e.roleService.product.Cost),r(),m("total",e.data.Data.length)("pageData",e.pageData)}}var Xn=class i extends ie{constructor(e,o,t,l,S,P){super(e,o,"Report/ProductPurchaseHistory","ReportLoader/ProductPurchaseHistoryLoader",null,l);this.httpService=o;this.csvConverter=t;this.activatedRoute=l;this.roleService=S;this.matDialog=P}ScopeRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];OrderByRadio=[{Key:!0,Value:"Date & Number"},{Key:!1,Value:"Supplier"}];hideMore=!0;openExportModal(){this.matDialog.open(q,{data:{title:"Product Purchase History",exportTypes:[{ID:"ReportExport/ProductPurchaseHistory",Value:"Default",FileName:"Product Purchase History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){let e=this.activatedRoute.snapshot?.queryParams;this.pageData.Filter.From=e.From??this.pageData.Filter.From,this.pageData.Filter.To=e.To??this.pageData.Filter.To,this.pageData.Filter.VariantID=V.IsNotEmpty(e.VariantID)?e.VariantID:V.GuidEmpty,this.pageData.Filter.ProductID=V.IsNotEmpty(e.ProductID)?e.ProductID:V.GuidEmpty,this.pageData.Filter.ByProduct=V.IsNotEmpty(e.ProductID),V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(Oe),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-purchase-history"]],standalone:!1,features:[R],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["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",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],[4,"ngIf"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","OrderBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search Product",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail","inputTextValue"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","100px"],[2,"width","80px"],[2,"width","70px"],[1,"text-end",2,"width","50px"],["style","width: 60px","class","text-end",4,"ngIf"],["style","width: 75px","class","text-end",4,"ngIf"],["style","width: 50px","class","text-end",4,"ngIf"],["style","width: 70px","class","text-end",4,"ngIf"],["style","width: 80px","class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","6",1,"empty-column"],[1,"text-end"],["class","empty-column",4,"ngIf"],["class","text-end","colspan","6",4,"ngIf"],["api","report/ProductPurchaseHistoryCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"text-end",2,"width","60px"],[1,"text-end",2,"width","75px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","80px"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"routerLink","queryParams",4,"ngIf"],[3,"innerHTML"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],[1,"text-end","text-danger"],[1,"empty-column"],["colspan","6",1,"text-end"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,CC,3,0,"button",2),a(),n(3,"filters"),g(4,SC,28,18,"ng-template",null,0,M),a(),n(6,"content"),g(7,HC,42,20,"div",3),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService.global.Export),r(5),m("ngIf",t.data))},dependencies:[N,j,k,A,z,K,O,L,we,Le,bt,Q,re,ee,X,Z],encapsulation:2})};var QC=()=>["/menu/Reports/Purchases_Report/Daily/Monthly"];function jC(i,c){if(i&1){let e=F();n(0,"button",13),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",14),p(2," Export "),a()}}function YC(i,c){if(i&1){let e=F();n(0,"div")(1,"div",15)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",16),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",17),h("selectedCategoryIDChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",18),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Month"),a(),n(13,"ng-select",19),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(14,"h6"),p(15,"Currency"),a(),n(16,"ng-select",20),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(17,"h6"),p(18,"Multiply Unit Qty"),a(),n(19,"radio-options",21),h("modelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()()}if(i&2){let e=s(2);r(4),m("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.pageData.Filter.Year),m("items",e.Years),r(3),C("ngModel",e.pageData.Filter.Month),m("items",e.Months),r(3),C("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies),r(3),C("model",e.pageData.Filter.MultiplyUnitQuantity),m("options",e.YesNoRadio)}}function qC(i,c){i&1&&(n(0,"th",9),p(1," Purchases "),a())}function UC(i,c){if(i&1&&(n(0,"td",9),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.PurchaseTotal)," ")}}function KC(i,c){if(i&1&&(n(0,"tr",22)(1,"td"),p(2),d(3,"date"),a(),n(4,"td",9),p(5),d(6,"number"),a(),n(7,"td",9),p(8),d(9,"quantityFraction"),a(),g(10,UC,3,3,"td",10),a()),i&2){let e=c.$implicit,o=s(2);r(2),w(y(3,4,e.Date,"EEEE")),r(3),w(f(6,7,e.Day)),r(3),w(f(9,9,e.Quantity)),r(2),m("ngIf",o.roleService.product.Cost)}}function zC(i,c){if(i&1&&(n(0,"td",9),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"PurchaseTotal"))," ")}}function XC(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,jC,3,0,"button",3),n(3,"a",4),p(4,"View Month"),a()(),n(5,"filters"),g(6,YC,20,14,"ng-template",null,0,M),a(),n(8,"content")(9,"div",5)(10,"div",6)(11,"table",7)(12,"thead",8)(13,"tr")(14,"th"),p(15,"Day"),a(),n(16,"th",9),p(17,"Date (Day)"),a(),n(18,"th",9),p(19,"Quantity"),a(),g(20,qC,2,0,"th",10),a()(),n(21,"tbody"),g(22,KC,11,11,"tr",11),a(),n(23,"tr")(24,"td",12),p(25,"Total"),a(),n(26,"td",9),p(27),d(28,"sum"),d(29,"quantityFraction"),a(),g(30,zC,4,6,"td",10),a()()()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),r(2),m("ngIf",e.roleService.global.Export),r(),m("routerLink",b(15,QC)),r(17),m("ngIf",e.roleService.product.Cost),r(2),m("ngForOf",e.data.Data),r(5),v(" ",f(29,13,y(28,10,e.data.Data,"Quantity"))," "),r(3),m("ngIf",e.roleService.product.Cost)}}var Zn=class i extends ie{constructor(e,o,t,l,S){super(e,o,"Report/GetPurchasePeriodDaily","ReportLoader/GetReportPurchaseDaily");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S;let P=new Date;this.Years=V.GenerateYears(P.getFullYear(),11,!0),this.Months=V.Months}Years=[];Months=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Daily",exportTypes:[{ID:"ReportExport/DailyPurchaseReport",Value:"Default",FileName:"Purchase Daily"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-daily-purchases"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["colspan","2",1,"text-end"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Month","bindLabel","Label","bindValue","ID",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],[1,"border-bottom"]],template:function(o,t){o&1&&g(0,XC,31,16,"mainpanel-cmp",1),o&2&&m("ngIf",t.data)},dependencies:[N,j,k,A,z,O,L,le,we,fe,Q,re,te,ee,X,Z],encapsulation:2})};var ZC=()=>["/menu/Reports/Purchases_Report/Daily"];function JC(i,c){if(i&1){let e=F();n(0,"button",13),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",14),p(2," Export "),a()}}function $C(i,c){if(i&1){let e=F();n(0,"div")(1,"div",15)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",16),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",17),h("selectedCategoryIDChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",18),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Currency"),a(),n(13,"ng-select",19),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(14,"h6"),p(15,"Multiply Unit Qty"),a(),n(16,"radio-options",20),h("modelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a(),n(17,"h6"),p(18,"Supplier"),a(),n(19,"autocompleteV2",21),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a()()()}if(i&2){let e=s(2);r(4),m("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.pageData.Filter.Year),m("items",e.Years),r(3),C("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies),r(3),C("model",e.pageData.Filter.MultiplyUnitQuantity),m("options",e.YesNoRadio),r(3),C("ngModel",e.pageData.Filter.SupplierID)}}function ex(i,c){i&1&&(n(0,"th",8),p(1,"Purchases"),a())}function tx(i,c){if(i&1&&(n(0,"td",8),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Income)," ")}}function ix(i,c){if(i&1&&(n(0,"tr",22)(1,"td"),p(2),a(),n(3,"td",8),p(4),d(5,"quantityFraction"),a(),g(6,tx,3,3,"td",9),a()),i&2){let e=c.$implicit,o=s(2);r(2),w(e.MonthLabel),r(2),w(f(5,3,e.Quantity)),r(2),m("ngIf",o.roleService.product.Cost)}}function nx(i,c){if(i&1&&(n(0,"td",8),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Income"))," ")}}function ax(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,JC,3,0,"button",3),n(3,"a",4),p(4,"View Daily"),a()(),n(5,"filters"),g(6,$C,20,13,"ng-template",null,0,M),a(),n(8,"content")(9,"div",5)(10,"table",6)(11,"thead",7)(12,"tr")(13,"th"),p(14,"Month"),a(),n(15,"th",8),p(16,"Quantity"),a(),g(17,ex,2,0,"th",9),a()(),n(18,"tbody"),g(19,ix,7,5,"tr",10),a(),n(20,"tr",11)(21,"td",12),p(22,"Total"),a(),n(23,"td",8),p(24),d(25,"sum"),d(26,"quantityFraction"),a(),g(27,nx,4,6,"td",9),a()()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),r(2),m("ngIf",e.roleService.global.Export),r(),m("routerLink",b(15,ZC)),r(14),m("ngIf",e.roleService.product.Cost),r(2),m("ngForOf",e.data.Data),r(5),v(" ",f(26,13,y(25,10,e.data.Data,"Quantity"))," "),r(3),m("ngIf",e.roleService.product.Cost)}}var Jn=class i extends ie{constructor(e,o,t,l,S){super(e,o,"Report/GetPurchasePeriodMonthly","ReportLoader/GetReportPurchaseMonthly");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S;let P=new Date;this.Years=V.GenerateYears(P.getFullYear(),11,!0)}Years=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Monthly",exportTypes:[{ID:"ReportExport/MonthlyPurchaseReport",Value:"Default",FileName:"Purchase Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-monthly-purchase"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","1",1,"fw-bold","text-start","ps-4"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"border-bottom"]],template:function(o,t){o&1&&g(0,ax,28,16,"mainpanel-cmp",1),o&2&&m("ngIf",t.data)},dependencies:[N,j,k,A,z,O,L,le,we,Le,fe,Q,re,X,Z],encapsulation:2})};function rx(i,c){if(i&1){let e=F();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",8),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a()()()}if(i&2){let e=s(2);r(4),m("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.pageData.Filter.Year),m("items",e.Years)}}function ox(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),I(1,"actions"),n(2,"filters"),g(3,rx,11,8,"ng-template",null,0,M),a(),n(5,"content")(6,"div",3),I(7,"POS-line-chart",4),a()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),r(7),m("config",e.chartConfig)("data",e.ChartData)}}var $n=class i extends ie{constructor(e,o,t){super(e,o,"Report/MonthlyPurchasesVolume","ReportLoader/GetMonthlyPurchaseVolume");this.httpService=o;let l=new Date;this.Years=V.GenerateYears(l.getFullYear(),11,!0)}Years=[];ChartData={};chartConfig;preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}preInitList(){let e={ID:0,Symbol:"All"};this.pageData.Options.Currencies.unshift(e),this.pageData.Filter.CurrencyID=0}postInit(){let e=[];this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.Data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}},this.data.PageTitle!=null&&(this.menuData.H=this.data.PageTitle),this.data.Data.MonthlySalesRank.forEach((o,t)=>{let l={name:this.data.Data.MonthName[t],data:o.Sales};e.push(l)}),this.ChartData={series:e}}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-volume"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"container-fluid","mt-5"],[3,"config","data"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet","appendTo","body",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"]],template:function(o,t){o&1&&g(0,ox,8,6,"mainpanel-cmp",1),o&2&&m("ngIf",t.data)},dependencies:[N,k,z,O,L,Et,fe,Q],encapsulation:2})};var lx=()=>["/menu/Products/Catalog/Products/Info"],px=i=>({ID:i});function mx(i,c){if(i&1){let e=F();n(0,"button",13),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",14),p(2," Export"),a()}}function sx(i,c){if(i&1){let e=F();n(0,"div")(1,"div",15)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",16),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",17),h("selectedCategoryIDChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",18),h("dateChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",19)(13,"datepicker",20),h("dateChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",21),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=s(2);r(4),m("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),m("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),m("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function cx(i,c){if(i&1&&(n(0,"tr",22)(1,"td"),p(2),a(),n(3,"td")(4,"a",23),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td",24),p(9),d(10,"quantityFraction"),a(),n(11,"td",24),p(12),d(13,"quantityFraction"),a(),n(14,"td",25),p(15),d(16,"number"),a()()),i&2){let e=c.$implicit,o=c.index;r(2),w(o+1),r(2),m("routerLink",b(14,lx))("queryParams",U(15,px,e.ID)),r(),v(" ",e.Name," "),r(2),w(e.Code),r(2),w(f(10,8,e.PurchaseQuantity)),r(3),w(f(13,10,e.SellQuantity)),r(3),w(f(16,12,e.Ratio))}}function dx(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,mx,3,0,"button",3),a(),n(3,"filters"),g(4,sx,17,10,"ng-template",null,0,M),a(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),p(13," Now "),a(),n(14,"th",9),p(15,"Name"),a(),n(16,"th",10),p(17,"Code"),a(),n(18,"th",11),p(19,"Purchase"),a(),n(20,"th",11),p(21,"Sold"),a(),n(22,"th",11),p(23,"Sold Percentage(%)"),a()()(),n(24,"tbody"),g(25,cx,17,17,"tr",12),a()()()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),r(2),m("ngIf",e.roleService.global.Export),r(23),m("ngForOf",e.data.Data)}}var ea=class i extends ie{constructor(e,o,t,l,S){super(e,o,"Report/PruchasedSalesReportList","ReportLoader/PurchaseSalesReportLoader");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}GroupRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Sales Report",exportTypes:[{ID:"ReportExport/PurchasedSalesReportList",Value:"Default",FileName:"Purchase Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-sales-report"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","55px"],[2,"width","320px"],[2,"width","100px"],[1,"text-end",2,"width","80px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"border-bottom"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"]],template:function(o,t){o&1&&g(0,dx,26,6,"mainpanel-cmp",1),o&2&&m("ngIf",t.data)},dependencies:[N,j,k,A,K,Ge,O,L,He,fe,Q,te,Z],encapsulation:2})};var ux=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"],_x=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],gx=(i,c)=>({rankDown:i,rankUp:c,"number key":!0}),fx=(i,c,e)=>({EntityID:i,From:c,To:e}),Cx=()=>["/menu/Reports/Purchases_Report/Summary"];function xx(i,c){if(i&1){let e=F();n(0,"button",27),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",28),p(2," Export "),a()}}function hx(i,c){if(i&1){let e=F();n(0,"div")(1,"h6"),p(2,"Compare with Prev Month"),a(),n(3,"radio-options",35),h("modelChange",function(t){u(e);let l=s(3);return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=s(3);r(3),C("model",e.isCompare)}}function Sx(i,c){if(i&1){let e=F();n(0,"div")(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",36),h("dateChange",function(t){u(e);let l=s(3);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(5,"div",37)(6,"datepicker",38),h("dateChange",function(t){u(e);let l=s(3);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s(3);r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function yx(i,c){if(i&1){let e=F();n(0,"div")(1,"h6"),p(2,"Year - Month"),a(),n(3,"div",39)(4,"div",40)(5,"ng-select",41),h("ngModelChange",function(t){u(e);let l=s(3);return x(l.Year,t)||(l.Year=t),_(t)}),T("change",function(){u(e);let t=s(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(3);return _(t.Year=null)}),a()(),n(6,"div",42)(7,"ng-select",43),h("ngModelChange",function(t){u(e);let l=s(3);return x(l.Month,t)||(l.Month=t),_(t)}),T("change",function(){u(e);let t=s(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(3);return _(t.Month=null)}),a()()()()}if(i&2){let e=s(3);r(5),C("ngModel",e.Year),m("items",e.Years),r(2),C("ngModel",e.Month),m("items",e.Months)}}function Dx(i,c){if(i&1){let e=F();n(0,"div",29)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",30),h("selectedCategoryIDChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Purchase Order Tag"),a(),n(6,"ng-select",31),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"Date Filter"),a(),n(9,"radio-options",32),h("modelChange",function(t){u(e);let l=s(2);return x(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),T("modelChange",function(){u(e);let t=s(2);return _(t.YearMonthToDateRange())}),a(),g(10,hx,4,1,"div",33)(11,Sx,7,2,"div",33)(12,yx,8,4,"div",33),n(13,"h6"),p(14,"Exclude Complementary"),a(),n(15,"radio-options",34),h("modelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ExcludeComplementary,t)||(l.pageData.Filter.ExcludeComplementary=t),_(t)}),a()()}if(i&2){let e=s(2);r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),r(3),C("model",e.IsPredefined),m("options",e.RadioDateFilterType),r(),m("ngIf",e.IsPredefined),r(),m("ngIf",!e.IsPredefined),r(),m("ngIf",e.IsPredefined),r(3),C("model",e.pageData.Filter.ExcludeComplementary)}}function vx(i,c){i&1&&(n(0,"th",44),p(1," Prev "),a())}function wx(i,c){i&1&&(n(0,"th",45),p(1," Now "),a())}function Tx(i,c){i&1&&(n(0,"th",46),p(1," Orders "),a())}function Px(i,c){i&1&&(n(0,"th",47),p(1," Purchase "),a())}function Fx(i,c){if(i&1&&(n(0,"th",48),p(1," Tax "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet")}}function Ix(i,c){if(i&1&&(n(0,"th",49),p(1," Purchase + Tax "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function bx(i,c){if(i&1&&(n(0,"td",25),p(1),a()),i&2){let e=s().$implicit;r(),v(" ",e.PrevIndex," ")}}function Ex(i,c){if(i&1&&(n(0,"td",51),p(1),a()),i&2){let e=s(),o=e.$implicit,t=e.index;m("ngClass",de(2,gx,o.PrevIndex<t+1,o.PrevIndex>t+1)),r(),v(" ",o.CurrentIndex," ")}}function Mx(i,c){if(i&1&&(n(0,"td",25),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;r(),v(" ",y(2,1,e.Count,".0-0")," ")}}function Vx(i,c){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Sales)," ")}}function Bx(i,c){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Tax)," ")}}function Ox(i,c){if(i&1&&(n(0,"td",25)(1,"a",53),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=s().$implicit,o=s(2);r(),m("queryParams",st(11,fx,e.EntityID,y(2,3,o.pageData.Filter.From,"ddMMyyyy"),y(3,6,o.pageData.Filter.To,"ddMMyyyy")))("routerLink",b(15,Cx)),r(4),w(f(6,9,e.SalesWithTax))}}function Lx(i,c){if(i&1&&(n(0,"tr")(1,"td",22),p(2),a(),g(3,bx,2,1,"td",24)(4,Ex,2,5,"td",50)(5,Mx,3,4,"td",24),n(6,"td",25),p(7),d(8,"quantityFraction"),a(),g(9,Vx,3,3,"td",24)(10,Bx,3,3,"td",26),d(11,"HideSumZero"),g(12,Ox,7,16,"td",24),a()),i&2){let e=c.$implicit,o=s(2);r(2),w(e.Name),r(),m("ngIf",o.showCompareColumn),r(),m("ngIf",o.showCompareColumn),r(),m("ngIf",!o.data.WithCategory),r(2),w(f(8,8,e.Quantity)),r(2),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",!o.data.WithCategory&&y(11,10,o.data.Data,"Tax")&&o.roleService.product.Cost),r(2),m("ngIf",!o.data.WithCategory&&o.roleService.product.Cost)}}function Rx(i,c){i&1&&I(0,"td",54)}function kx(i,c){i&1&&I(0,"td",54)}function Wx(i,c){if(i&1&&(n(0,"td",25),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);r(),v(" ",y(3,4,y(2,1,e.data.Data,"Count"),".0-0")," ")}}function Nx(i,c){if(i&1&&(n(0,"td",25),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Sales"))," ")}}function Ax(i,c){if(i&1&&(n(0,"td",52),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Tax"))," ")}}function Gx(i,c){if(i&1&&(n(0,"td",25)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(2);r(2),w(f(4,4,y(3,1,e.data.Data,"SalesWithTax")))}}function Hx(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,xx,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," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Month "),a()()()()(),n(13,"filters"),g(14,Dx,16,10,"ng-template",null,0,M),a(),n(16,"content")(17,"div",8)(18,"div",9)(19,"table",10),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(20,"thead",11)(21,"tr")(22,"th",12),p(23,"Outlet"),a(),g(24,vx,2,0,"th",13)(25,wx,2,0,"th",14)(26,Tx,2,0,"th",15),n(27,"th",16),p(28," Qty "),a(),g(29,Px,2,0,"th",17)(30,Fx,2,1,"th",18),d(31,"HideSumZero"),g(32,Ix,2,1,"th",19),a()(),n(33,"tbody"),g(34,Lx,13,13,"tr",20),a(),n(35,"tfoot")(36,"tr",21),I(37,"td",22),g(38,Rx,1,0,"td",23)(39,kx,1,0,"td",23)(40,Wx,4,7,"td",24),n(41,"td",25),p(42),d(43,"sum"),d(44,"quantityFraction"),a(),g(45,Nx,4,6,"td",24)(46,Ax,4,6,"td",26),d(47,"HideSumZero"),g(48,Gx,5,6,"td",24),a()()()()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),r(2),m("ngIf",e.roleService.global.Export),r(6),m("routerLink",b(32,ux)),r(3),m("routerLink",b(33,_x)),r(13),m("ngIf",e.showCompareColumn),r(),m("ngIf",e.showCompareColumn),r(),m("ngIf",!e.data.WithCategory),r(3),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",!e.data.WithCategory&&y(31,21,e.data.Data,"Tax")&&e.roleService.product.Cost),r(2),m("ngIf",!e.data.WithCategory&&e.roleService.product.Cost),r(2),m("ngForOf",e.data.Data),r(4),m("ngIf",e.showCompareColumn),r(),m("ngIf",e.showCompareColumn),r(),m("ngIf",!e.data.WithCategory),r(2),v(" ",f(44,27,y(43,24,e.data.Data,"Quantity"))," "),r(3),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",!e.data.WithCategory&&y(47,29,e.data.Data,"Tax")&&e.roleService.product.Cost),r(2),m("ngIf",!e.data.WithCategory&&e.roleService.product.Cost)}}var ta=class i extends ie{constructor(e,o,t,l,S){super(e,o,"Report/OutletPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S;let P=new Date;this.Years=V.GenerateYears(P.getFullYear(),11,!0),this.Year=P.getFullYear(),this.Month=P.getMonth()+1,this.Months=V.Months,this.Months.forEach(Ee=>Ee.Label=Ee.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Comparison=0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Purchase Performance",exportTypes:[{ID:"ReportExport/OutletPerformancePurchase",Value:"Default",FileName:"Outlet Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){this.YearMonthToDateRange()}postInit(e){this.menuData.H=e?.PageTitle,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month-1,1),this.pageData.Filter.To=new Date(this.Year,this.Month,0)}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),S);case"Count":return V.compare(t.Count,l.Count,S);case"SalesWithTax":return V.compare(t.SalesWithTax,l.SalesWithTax,S);case"Quantity":return V.compare(t.Quantity,l.Quantity,S);case"SalesNet":return V.compare(t.Sales,l.Sales,S);case"SalesTaxNet":return V.compare(t.Sales,l.Sales,S);case"Tax":return V.compare(t.Tax,l.Tax,S);default:return 0}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-outlet-performance"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"freeze","header"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above","style","width: 100px","class","text-end",4,"ngIf"],["style","width: 100px","class","text-end","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before","class","flex-right","style","width: 100px",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","SalesNet","arrowPosition","before","style","width: 100px","class","flex-right",4,"ngIf"],["style","width: 100px","arrowPosition","before","class","flex-right",3,"mat-sort-header",4,"ngIf"],["style","width: 150px","arrowPosition","before","class","flex-right",3,"mat-sort-header",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],["class","text-end",4,"ngIf"],[1,"text-end"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","Date Filter",3,"modelChange","model","options"],[4,"ngIf"],["name","complementary",3,"modelChange","model"],["name","compare",3,"modelChange","model"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","100px"],["arrowPosition","before",1,"flex-right",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"flex-right",2,"width","150px",3,"mat-sort-header"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],[1,"text-end","text-warning-emphasis"],[3,"queryParams","routerLink"],[1,"empty-column"]],template:function(o,t){o&1&&g(0,Hx,49,34,"mainpanel-cmp",1),o&2&&m("ngIf",t.data)},dependencies:[N,Ae,j,k,A,z,K,O,L,le,ae,ge,we,fe,re,ei,te,ee,X,Z],encapsulation:2})};var Qx=()=>["/menu/Reports/Purchases_Report/Outlet"],jx=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],Yx=(i,c)=>({rankDown:i,rankUp:c,"number key":!0}),qx=(i,c)=>({"text-danger":i,"text-success":c,"text-end":!0});function Ux(i,c){if(i&1){let e=F();n(0,"button",27),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",28),p(2," Export"),a()}}function Kx(i,c){if(i&1){let e=F();se(0),n(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",32),h("dateChange",function(t){u(e);let l=s(3);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(5,"div",33)(6,"datepicker",34),h("dateChange",function(t){u(e);let l=s(3);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),ce()}if(i&2){let e=s(3);r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function zx(i,c){if(i&1){let e=F();se(0),n(1,"h6"),p(2,"Year - Month"),a(),n(3,"div",35)(4,"div",36)(5,"ng-select",37),h("ngModelChange",function(t){u(e);let l=s(3);return x(l.Year,t)||(l.Year=t),_(t)}),T("change",function(){u(e);let t=s(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(3);return _(t.Year=null)}),a()(),n(6,"div",38)(7,"ng-select",39),h("ngModelChange",function(t){u(e);let l=s(3);return x(l.Month,t)||(l.Month=t),_(t)}),T("change",function(){u(e);let t=s(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(3);return _(t.Month=null)}),a()()(),ce()}if(i&2){let e=s(3);r(5),C("ngModel",e.Year),m("items",e.Years),r(2),C("ngModel",e.Month),m("items",e.Months)}}function Xx(i,c){if(i&1){let e=F();se(0),n(1,"h6"),p(2,"Compare with Prev Month"),a(),n(3,"radio-options",40),h("modelChange",function(t){u(e);let l=s(3);return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a(),ce()}if(i&2){let e=s(3);r(3),C("model",e.isCompare)}}function Zx(i,c){if(i&1){let e=F();n(0,"div")(1,"div",29)(2,"h6"),p(3,"Date Filter"),a(),n(4,"radio-options",30),h("modelChange",function(t){u(e);let l=s(2);return x(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),a(),g(5,Kx,7,2,"ng-container",25)(6,zx,8,4,"ng-container",25),n(7,"h6"),p(8,"Purchase Order Tag"),a(),n(9,"ng-select",31),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),g(10,Xx,4,1,"ng-container",25),a()()}if(i&2){let e=s(2);r(4),C("model",e.IsPredefined),m("options",e.RadioDateFilterType),r(),m("ngIf",!e.IsPredefined),r(),m("ngIf",e.IsPredefined),r(3),C("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),r(),m("ngIf",e.IsPredefined)}}function Jx(i,c){i&1&&(n(0,"th",41),p(1,"Prev"),a())}function $x(i,c){i&1&&(n(0,"th",42),p(1,"Now"),a())}function eh(i,c){i&1&&(n(0,"th",43),p(1," \xB1 (%) "),a())}function th(i,c){if(i&1&&(n(0,"td",24),p(1),a()),i&2){let e=s().$implicit;r(),v(" ",e.PrevIndex," ")}}function ih(i,c){if(i&1&&(n(0,"td",47),p(1),a()),i&2){let e=s(),o=e.$implicit,t=e.index;m("ngClass",de(2,Yx,o.PrevIndex<t+1,o.PrevIndex>t+1)),r(),v(" ",o.CurrentIndex," ")}}function nh(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;m("ngClass",de(5,qx,e.IsNegative,e.IsPositive)),r(),v(" ",y(2,2,e.Increase,".0-0")," ")}}function ah(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),g(3,th,2,1,"td",44)(4,ih,2,5,"td",45),n(5,"td",24),p(6),d(7,"number"),a(),n(8,"td",24),p(9),d(10,"quantityFraction"),a(),n(11,"td",24),p(12),d(13,"amountFraction"),a(),g(14,nh,3,8,"td",46),n(15,"td",26),p(16),d(17,"amountFraction"),a(),n(18,"td",24),p(19),d(20,"amountFraction"),a()()),i&2){let e=c.$implicit,o=s(2);r(2),w(e.Name),r(),m("ngIf",o.showCompareColumn),r(),m("ngIf",o.showCompareColumn),r(2),w(y(7,9,e.Count,".0-0")),r(3),w(f(10,12,e.Quantity)),r(3),w(f(13,14,e.Sales)),r(2),m("ngIf",o.showCompareColumn),r(2),w(f(17,16,e.Tax)),r(3),v(" ",f(20,18,e.SalesWithTax)," ")}}function rh(i,c){i&1&&I(0,"td",23)}function oh(i,c){i&1&&I(0,"td",23)}function lh(i,c){i&1&&I(0,"td")}function ph(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,Ux,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Month "),a()()()()(),n(13,"filters"),g(14,Zx,11,7,"ng-template",null,0,M),a(),n(16,"content")(17,"div",8)(18,"table",9),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr")(21,"th",11),p(22,"Outlet"),a(),g(23,Jx,2,0,"th",12)(24,$x,2,0,"th",13),n(25,"th",14),p(26,"Orders "),a(),n(27,"th",15),p(28," Quantity"),a(),n(29,"th",16),p(30," Purchase"),a(),g(31,eh,2,0,"th",17),n(32,"th",18),p(33,"Tax"),a(),n(34,"th",19),p(35,"Purchase + Tax"),a()()(),n(36,"tbody"),g(37,ah,21,20,"tr",20),a(),n(38,"tfoot")(39,"tr",21),g(40,rh,1,0,"td",22)(41,oh,1,0,"td",22),I(42,"td",23),n(43,"td",24),p(44),d(45,"sum"),d(46,"number"),a(),n(47,"td",24),p(48),d(49,"sum"),d(50,"quantityFraction"),a(),n(51,"td",24),p(52),d(53,"sum"),d(54,"amountFraction"),a(),g(55,lh,1,0,"td",25),n(56,"td",26),p(57),d(58,"sum"),d(59,"amountFraction"),a(),n(60,"td",24)(61,"a"),p(62),d(63,"sum"),d(64,"amountFraction"),a()()()()()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),r(2),m("ngIf",e.roleService.global.Export),r(6),m("routerLink",b(47,Qx)),r(3),m("routerLink",b(48,jx)),r(12),m("ngIf",e.showCompareColumn),r(),m("ngIf",e.showCompareColumn),r(7),m("ngIf",e.showCompareColumn),r(),m("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet"),r(2),m("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet"),r(3),m("ngForOf",e.data==null?null:e.data.Data),r(3),m("ngIf",e.showCompareColumn),r(),m("ngIf",e.showCompareColumn),r(3),w(y(46,24,y(45,21,e.data==null?null:e.data.Data,"Count"),".0-0")),r(4),w(f(50,30,y(49,27,e.data==null?null:e.data.Data,"Quantity"))),r(4),v(" ",f(54,35,y(53,32,e.data==null?null:e.data.Data,"Sales"))," "),r(3),m("ngIf",e.showCompareColumn),r(2),v(" ",f(59,40,y(58,37,e.data==null?null:e.data.Data,"Tax"))," "),r(5),w(f(64,45,y(63,42,e.data==null?null:e.data.Data,"SalesWithTax")))}}var ia=class i extends ie{constructor(e,o,t,l,S){super(e,o,"Report/OutletGroupPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S;let P=new Date;this.Years=V.GenerateYears(P.getFullYear(),11,!0),this.Year=P.getFullYear(),this.Month=P.getMonth(),this.Months=V.Months,this.Months.forEach(Ee=>Ee.Label=Ee.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}];first=!0;openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Group Purchase Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformancePurchase",Value:"Default",FileName:"Outlet Group Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.first&&(this.YearMonthToDateRange(),this.first=!1)}postInit(){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}sortData(e){let o=this.data.slice();if(!e.active||e.direction===""){this.data=o;return}this.data=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,S);case"Count":return this.compare(t.Count,l.Count,S);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,S);case"Quantity":return this.compare(t.Quantity,l.Quantity,S);case"Sales":return this.compare(t.Sales,l.Sales,S);case"SalesNet":return this.compare(t.Sales,l.Sales,S);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,S);case"Tax":return this.compare(t.Tax,l.Tax,S);default:return 0}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-outlet-group-performance"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["style","width: 100px;","class","text-end","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["style","width: 100px;","class","text-end","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],["style","width: 100px;","class","text-end",4,"ngIf"],["arrowPosition","before",1,"text-end",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"text-end",2,"width","150px",3,"mat-sort-header"],[4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],[1,"text-end"],[4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","Date Filter",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModelChange","change","clear","ngModel","items"],["name","compare",3,"modelChange","model"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],[1,"text-end",2,"width","100px"],["class","text-end",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],[3,"ngClass"]],template:function(o,t){o&1&&g(0,ph,65,49,"mainpanel-cmp",1),o&2&&m("ngIf",t.data)},dependencies:[N,Ae,j,k,A,z,K,O,L,le,ae,ge,we,re,te,X,Z],encapsulation:2})};var mh=()=>["/menu/Reports/Purchases_Report/Outlet"],sh=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"];function ch(i,c){if(i&1){let e=F();n(0,"button",14),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",15),p(2," Export"),a()}}function dh(i,c){if(i&1){let e=F();n(0,"div")(1,"div",16)(2,"h6"),p(3,"Year"),a(),n(4,"ng-select",17),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(5,"h6"),p(6,"Purchase Order Tag"),a(),n(7,"ng-select",18),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()()}if(i&2){let e=s(2);r(4),C("ngModel",e.pageData.Filter.Year),m("items",e.Years),r(3),C("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function uh(i,c){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=c.$implicit;m("mat-sort-header",e),r(),w(e)}}function _h(i,c){if(i&1&&(n(0,"p",21),p(1),a()),i&2){let e=s().$implicit,o=s().$implicit;r(),w(o[e])}}function gh(i,c){if(i&1&&(n(0,"p",21),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit,o=s().$implicit;r(),w(f(2,1,o[e]))}}function fh(i,c){if(i&1&&(n(0,"td"),g(1,_h,2,1,"p",20)(2,gh,3,3,"p",20),a()),i&2){let e=c.$implicit;r(),m("ngIf",e=="Outlet"),r(),m("ngIf",e!="Outlet")}}function Ch(i,c){if(i&1&&(n(0,"tr"),g(1,fh,3,2,"td",12),a()),i&2){let e=c.$implicit,o=s(2);r(),m("ngForOf",o.getKey(e))}}function xh(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;r(),w(f(2,1,e))}}function hh(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",22)(2,"td"),p(3,"Total : "),a(),g(4,xh,3,3,"td",12),a()()),i&2){let e=s(2);r(4),m("ngForOf",e.data.DataFooter)}}function Sh(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,ch,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," Outlet Report By "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Outlet Group "),a()()()()(),n(13,"filters"),g(14,dh,8,4,"ng-template",null,0,M),a(),n(16,"content")(17,"div",8)(18,"table",9),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr"),g(21,uh,2,2,"th",11),a()(),n(22,"tbody"),g(23,Ch,2,1,"tr",12),a(),g(24,hh,5,1,"tfoot",13),a()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),r(2),m("ngIf",e.roleService.global.Export),r(6),m("routerLink",b(10,mh)),r(3),m("routerLink",b(11,sh)),r(10),m("ngForOf",e.data.Dataheader),r(2),m("ngForOf",e.data.Data),r(),m("ngIf",e.data.Data.length>0)}}var na=class i extends ie{constructor(e,o,t,l,S){super(e,o,"Report/MonthlyOutletPerformancePurchase","ReportLoader/MonthlyReportPurchase");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S;let P=new Date;this.Years=V.GenerateYears(P.getFullYear(),11,!0)}Years;openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Group Monthly Purchase Performance",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformancePurchase",Value:"Default",FileName:"Outlet Group Monthly Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getKey(e){return Object.keys(e)}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((l,S)=>{let P=e.direction==="asc";for(let Ee=0;Ee<this.data.Dataheader.length;Ee++)if(e.active==this.data.Dataheader[Ee])return typeof l[this.data.Dataheader[Ee]]=="string"?t(l[this.data.Dataheader[Ee]].toLocaleLowerCase(),S[this.data.Dataheader[Ee]].toLocaleLowerCase(),P):t(l[this.data.Dataheader[Ee]],S[this.data.Dataheader[Ee]],P)});function t(l,S,P){return(l<S?-1:1)*(P?1:-1)}}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-outlet-monthly-performance"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","","id","tableGrid",1,"table",3,"matSortChange"],[1,"table-light"],[3,"mat-sort-header",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],[3,"mat-sort-header"],["style","color: black;",4,"ngIf"],[2,"color","black"],[1,"table-footer"]],template:function(o,t){o&1&&g(0,Sh,25,12,"mainpanel-cmp",1),o&2&&m("ngIf",t.data)},dependencies:[N,j,k,A,z,O,L,ae,ge,X],encapsulation:2})};var yh=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Dh=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],vh=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],wh=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Th=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],Ph=i=>({ID:i});function Fh(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 Ih(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",11),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",13)(8,"datepicker",14),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a(),n(9,"div")(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",15),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()()()}if(i&2){let e=s();r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(4),C("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function bh(i,c){if(i&1&&(n(0,"a",31),p(1),a()),i&2){let e=s().$implicit;m("queryParams",U(2,Ph,e.CityID)),r(),w(e.CityName)}}function Eh(i,c){if(i&1&&(se(0),p(1),ce()),i&2){let e=s().$implicit;r(),v(" ",e.CityName," ")}}function Mh(i,c){if(i&1&&(n(0,"tr"),I(1,"td",27),n(2,"td"),g(3,bh,2,4,"a",28)(4,Eh,2,1,"ng-container",29),a(),I(5,"td",30),d(6,"number"),I(7,"td",30),d(8,"number"),I(9,"td",30),d(10,"number"),a()),i&2){let e=c.$implicit;r(),m("innerHtml",e.CityCode,Pe),r(2),m("ngIf",e.CityID),r(),m("ngIf",!e.CityID),r(),m("innerHtml",f(6,6,e.Quantity),Pe),r(2),m("innerHtml",f(8,8,e.Total),Pe),r(2),m("innerHtml",f(10,10,e.Average),Pe)}}function Vh(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,"Code"),a(),n(6,"th",20),p(7," Regional Name "),a(),n(8,"th",21),p(9," Quantity "),a(),n(10,"th",22),p(11," Total "),a(),n(12,"th",23),p(13," Avg. Price "),a()()(),n(14,"tbody"),g(15,Mh,11,12,"tr",24),a(),n(16,"tfoot")(17,"tr",25),I(18,"td",26),n(19,"td",26),p(20,"Total :"),a(),n(21,"td",26),p(22),d(23,"sum"),d(24,"quantityFraction"),a(),n(25,"td",26),p(26),d(27,"sum"),d(28,"amountFraction"),a(),n(29,"td",26),p(30),d(31,"sum"),d(32,"sum"),d(33,"amountFraction"),a()()()()()}if(i&2){let e=s();r(15),m("ngForOf",e.data.List),r(7),v(" ",f(24,7,y(23,4,e.data.List,"Quantity"))," "),r(4),v(" ",f(28,12,y(27,9,e.data.List,"Total"))," "),r(4),v(" ",f(33,20,y(31,14,e.data.List,"Total")/y(32,17,e.data.List,"Quantity"))," ")}}var aa=class i extends ie{constructor(e,o,t,l,S,P){super(e,o,"Report/CitySales","ReportLoader/CitySalesLoader",t);this.httpService=o;this.csvConverter=l;this.roleService=S;this.matDialog=P}postInit(e){this.menuData.H=e.PageTitle}sortData(e){let o=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=o;return}this.data.List=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"CityCode":return this.compare(t.CityCode,l.CityCode,S);case"CityName":return this.compare(t.CityName,l.CityName,S);case"Quantity":return this.compare(t.Quantity,l.Quantity,S);case"Average":return this.compare(t.Average,l.Average,S);case"Total":return this.compare(t.Total,l.Total,S);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"City Report",exportTypes:[{ID:"ReportExport/CitySalesExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(Ke),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-city"]],standalone:!1,features:[R],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["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"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","CityCode",2,"width","80px"],["mat-sort-header","CityName",2,"width","220px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Average","arrowPosition","before",1,"flex-right",2,"width","100px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[3,"innerHtml"],["routerLink","/menu/Contacts/Option_Values/City/Form",3,"queryParams",4,"ngIf"],[4,"ngIf"],[1,"text-end",3,"innerHtml"],["routerLink","/menu/Contacts/Option_Values/City/Form",3,"queryParams"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,Fh,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),g(23,Ih,13,6,"ng-template",null,0,M),a(),n(25,"content"),g(26,Vh,34,22,"div",7),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(6),m("routerLink",b(11,yh)),r(3),m("routerLink",b(12,Dh)),r(3),m("routerLink",b(13,vh)),r(3),m("routerLink",b(14,wh)),r(3),m("routerLink",b(15,Th)),r(6),m("ngIf",t.data))},dependencies:[N,j,k,A,z,K,O,L,ae,ge,fe,re,te,X,Z],encapsulation:2})};var Bh=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Oh=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Lh=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Rh=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],kh=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Wh(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 Nh(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",13)(8,"datepicker",14),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();r(3),m("accessType",2),C("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function Ah(i,c){i&1&&(n(0,"th",21),p(1,"Cost"),a())}function Gh(i,c){i&1&&(n(0,"th",21),p(1,"Profit"),a())}function Hh(i,c){if(i&1&&(I(0,"td",34),d(1,"amountFraction")),i&2){let e=s().$implicit;m("innerHtml",f(1,1,e.Cost),Pe)}}function Qh(i,c){if(i&1&&(I(0,"td",31),d(1,"amountFraction")),i&2){let e=s().$implicit;m("innerHtml",f(1,1,e.Profit),Pe)}}function jh(i,c){if(i&1&&(n(0,"tr"),I(1,"td",29)(2,"td",30),d(3,"number"),I(4,"td",30),d(5,"quantityFraction"),I(6,"td",30),d(7,"amountFraction"),I(8,"td",31),d(9,"amountFraction"),g(10,Hh,2,3,"td",32)(11,Qh,2,3,"td",33),a()),i&2){let e=c.$implicit,o=s(2);r(),m("innerHtml",e.GroupName,Pe),r(),m("innerHtml",f(3,7,e.Count),Pe),r(2),m("innerHtml",f(5,9,e.Quantity),Pe),r(2),m("innerHtml",f(7,11,e.Gross),Pe),r(2),m("innerHtml",f(9,13,e.Sales),Pe),r(2),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.report.Profit)}}function Yh(i,c){if(i&1&&(n(0,"td",35),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),w(f(3,4,y(2,1,e.data.Data,"Cost")))}}function qh(i,c){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),w(f(3,4,y(2,1,e.data.Data,"Profit")))}}function Uh(i,c){if(i&1){let e=F();n(0,"div",15)(1,"div",16)(2,"table",17),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",18)(4,"tr")(5,"th",19),p(6,"Group Name"),a(),n(7,"th",20),p(8,"Orders"),a(),n(9,"th",21),p(10,"Quantity"),a(),n(11,"th",21),p(12,"Gross"),a(),n(13,"th",21),p(14,"Sales"),a(),g(15,Ah,2,0,"th",22)(16,Gh,2,0,"th",22),a()(),n(17,"tbody"),g(18,jh,12,15,"tr",23),a(),n(19,"tfoot")(20,"tr",24),I(21,"td",25),n(22,"td",25),p(23),d(24,"sum"),d(25,"number"),a(),n(26,"td",25),p(27),d(28,"sum"),d(29,"quantityFraction"),a(),n(30,"td",25),p(31),d(32,"sum"),d(33,"amountFraction"),a(),n(34,"td",26),p(35),d(36,"sum"),d(37,"amountFraction"),a(),g(38,Yh,4,6,"td",27)(39,qh,4,6,"td",28),a()()()()()}if(i&2){let e=s();r(15),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.report.Profit),r(2),m("ngForOf",e.data.Data),r(5),w(f(25,12,y(24,9,e.data.Data,"Count"))),r(4),w(f(29,17,y(28,14,e.data.Data,"Quantity"))),r(4),w(f(33,22,y(32,19,e.data.Data,"Gross"))),r(4),w(f(37,27,y(36,24,e.data.Data,"Sales"))),r(3),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.report.Profit)}}var ra=class i extends ie{constructor(e,o,t,l,S,P){super(e,o,"Report/CustomerGroup","ReportLoader/CustomerGroupLoader",t);this.httpService=o;this.csvConverter=l;this.roleService=S;this.matDialog=P}first=!0;openExportModal(){this.matDialog.open(q,{data:{title:"Customer Group",exportTypes:[{ID:"ReportExport/CustomerGroup",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){if(this.first){let e=new Date,o=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,o,1).toDateString(),this.pageData.Filter.To=new Date(t,o+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let o=new Date,t=o.getMonth(),l=o.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let o=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=o;return}this.data.List=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"GroupName":return this.compare(t.GroupName,l.GroupName,S);case"Trans":return this.compare(t.Trans,l.Trans,S);case"Quantity":return this.compare(t.Quantity,l.Quantity,S);case"Gross":return this.compare(t.Gross,l.Gross,S);case"Sales":return this.compare(t.Sales,l.Sales,S);case"Cost":return this.compare(t.Cost,l.Cost,S);case"Profit":return this.compare(t.Profit,l.Profit,S);default:return 0}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(Ke),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-customer-group"]],standalone:!1,features:[R],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],["style","width: 120px;","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],[1,"text-end","text-success",3,"innerHtml"],["class","text-end text-danger",3,"innerHtml",4,"ngIf"],["class","text-end text-success",3,"innerHtml",4,"ngIf"],[1,"text-end","text-danger",3,"innerHtml"],[1,"text-end","text-danger"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,Wh,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),g(23,Nh,9,5,"ng-template",null,0,M),a(),n(25,"content"),g(26,Uh,40,29,"div",7),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(6),m("routerLink",b(11,Bh)),r(3),m("routerLink",b(12,Oh)),r(3),m("routerLink",b(13,Lh)),r(3),m("routerLink",b(14,Rh)),r(3),m("routerLink",b(15,kh)),r(6),m("ngIf",t.data))},dependencies:[N,j,k,A,K,O,L,ae,Q,re,te,X,Z],encapsulation:2})};var Kh=()=>["/menu/Reports/Sales_Report/Standard/Person"],zh=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],Xh=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],Zh=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],Jh=(i,c)=>({From:i,To:c});function $h(i,c){if(i&1){let e=F();n(0,"a",10),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",11),p(2," Export "),a()}}function eS(i,c){if(i&1){let e=F();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",14),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",15)(8,"datepicker",16),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();r(3),m("accessType",2),C("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function tS(i,c){i&1&&(n(0,"th",22),p(1,"Profit"),a())}function iS(i,c){if(i&1&&(I(0,"td",32),d(1,"amountFraction")),i&2){let e=s().$implicit;m("innerHtml",f(1,1,e.ActualProfit),Pe)}}function nS(i,c){if(i&1&&(n(0,"tr"),I(1,"td",29)(2,"td",30),d(3,"number"),I(4,"td",30),d(5,"amountFraction"),I(6,"td",30),d(7,"amountFraction"),I(8,"td",30),g(9,iS,2,3,"td",31),a()),i&2){let e=c.$implicit,o=s(2);r(),m("innerHtml",e.Name,Pe),r(),m("innerHtml",f(3,6,e.InvoiceCount),Pe),r(2),m("innerHtml",f(5,8,e.NetRevenue),Pe),r(2),m("innerHtml",f(7,10,e.SalesTarget),Pe),r(2),m("innerHtml",e.Percentage+"%",Pe),r(),m("ngIf",o.roleService.report.Profit)}}function aS(i,c){if(i&1&&(n(0,"td",27),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"ActualProfit")),"")}}function rS(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",21)(5,"th"),p(6,"Group Name"),a(),n(7,"th",22),p(8,"Count"),a(),n(9,"th",22),p(10,"Actual"),a(),n(11,"th",22),p(12,"Target"),a(),n(13,"th",22),p(14,"Percentage"),a(),g(15,tS,2,0,"th",23),a()(),n(16,"tbody"),g(17,nS,10,12,"tr",24),a(),n(18,"tfoot")(19,"tr",25),I(20,"td",26)(21,"td",26),n(22,"td",27),p(23),d(24,"sum"),d(25,"amountFraction"),a(),I(26,"td",26)(27,"td",26),g(28,aS,4,6,"td",28),a()()()()()}if(i&2){let e=s();r(15),m("ngIf",e.roleService.report.Profit),r(2),m("ngForOf",e.data.Data),r(6),w(f(25,7,y(24,4,e.data.Data,"GrossRevenue"))),r(5),m("ngIf",e.roleService.report.Profit)}}var oa=class i extends ie{constructor(e,o,t,l,S,P){super(e,o,"Report/SalesGroup","ReportLoader/SalesGroupLoader",t);this.httpService=o;this.csvConverter=l;this.roleService=S;this.matDialog=P}first=!0;preGetList(){if(this.first){let e=new Date,o=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,o,1).toDateString(),this.pageData.Filter.To=new Date(t,o+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let o=new Date,t=o.getMonth(),l=o.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let o=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=o;return}}openExportModal(){this.matDialog.open(q,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/SalesGroup",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(Ke),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-sales-group"]],standalone:!1,features:[R],decls:27,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end",2,"width","120px"],["style","width: 120px;","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end"],["class","text-end ",4,"ngIf"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],["class","text-end text-success",3,"innerHtml",4,"ngIf"],[1,"text-end","text-success",3,"innerHtml"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions")(2,"div",2),g(3,$h,3,0,"a",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"Summary"),a()(),n(11,"li")(12,"a",7),p(13,"By Outlet"),a()(),n(14,"li")(15,"a",7),p(16,"By Employee"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),g(23,eS,9,5,"ng-template",null,0,M),a(),n(25,"content"),g(26,rS,29,9,"div",9),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(3),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(6),m("routerLink",b(17,Kh)),r(3),m("routerLink",b(18,zh)),r(3),m("routerLink",b(19,Xh)),r(3),m("routerLink",b(20,Zh))("queryParams",de(21,Jh,y(19,11,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),y(20,14,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),r(8),m("ngIf",t.data))},dependencies:[N,j,k,A,K,O,L,le,ae,Q,re,te,ee,X],encapsulation:2})};var oS=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report/By_Outlet"],lS=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],pS=i=>({ID:i});function mS(i,c){i&1&&(n(0,"a",5),p(1,"By Outlet"),a()),i&2&&m("routerLink",b(1,oS))}function sS(i,c){if(i&1){let e=F();n(0,"a",6),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",7),p(2," Export "),a()}}function cS(i,c){if(i&1){let e=F();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div",10)(7,"div",11)(8,"datepicker",12),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()()(),n(9,"div",13)(10,"div",11)(11,"datepicker",14),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()(),n(12,"h6"),p(13,"Tax"),a(),n(14,"ng-select",15),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(15,"h6"),p(16,"Page Size"),a(),n(17,"input",16),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(5),C("date",e.pageData.Filter.From),r(3),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),r(3),m("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function dS(i,c){if(i&1&&I(0,"th",42),i&2){let e=c.$implicit;m("innerHtml",e.Label+" ("+e.Rate+"%)",Pe)}}function uS(i,c){if(i&1&&(I(0,"td",47),d(1,"TaxDefault"),d(2,"amountFraction")),i&2){let e=c.index,o=s().$implicit,t=s(2);m("innerHtml",f(2,5,di(1,1,t.data.Compenents,o,e)),Pe)}}function _S(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",43),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td"),p(9),a(),n(10,"td"),p(11),d(12,"date"),a(),n(13,"td",44),p(14),d(15,"amountFraction"),a(),n(16,"td",45),p(17),d(18,"amountFraction"),a(),g(19,uS,3,7,"td",46),a()),i&2){let e=c.$implicit,o=s(2);r(2),w(e.EntityName),r(2),m("routerLink",b(17,lS))("queryParams",U(18,pS,e.ID)),r(),w(e.Number),r(2),w(e.Name),r(2),w(e.TaxName),r(2),w(y(12,10,e.Date,"dd MMM yyyy")),r(3),w(f(15,13,e.Sales)),r(3),v(" ",f(18,15,e.Tax)," "),r(2),m("ngForOf",o.getComponent(o.data))}}function gS(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;r(),v(" ",f(2,1,e.SumTaxAmount)," ")}}function fS(i,c){if(i&1){let e=F();n(0,"span",49),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport"))}),n(1,"i",50),p(2,"?"),a()()}}function CS(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);r(),w(f(2,1,e.listTotal))}}function xS(i,c){if(i&1){let e=F();n(0,"a",51),T("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),I(1,"i",52),p(2," Next"),a()}}function hS(i,c){if(i&1){let e=F();n(0,"a",53),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport",!0))}),I(1,"i",54),p(2," Show All"),a()}}function SS(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,"Outlet"),a(),n(7,"th",22),p(8,"Number"),a(),n(9,"th",23),p(10,"Name"),a(),n(11,"th",24),p(12," Type "),a(),n(13,"th",25),p(14,"Date"),a(),n(15,"th",26),p(16," Sales "),a(),n(17,"th",27),p(18," Tax "),a(),g(19,dS,1,1,"th",28),a()(),n(20,"tbody"),g(21,_S,20,20,"tr",29),a(),n(22,"tfoot")(23,"tr",30),I(24,"td",31),n(25,"td",32),p(26),d(27,"sum"),d(28,"amountFraction"),a(),n(29,"td",32),p(30),d(31,"sum"),d(32,"amountFraction"),a(),g(33,gS,3,3,"td",33),a()()()(),n(34,"div",34)(35,"div",35)(36,"div",36),p(37),d(38,"number"),g(39,fS,3,0,"span",37)(40,CS,3,3,"span",38),p(41),a()(),n(42,"div",39),g(43,xS,3,0,"a",40)(44,hS,3,0,"a",41),a()()()}if(i&2){let e=s();r(19),m("ngForOf",e.data.Compenents),r(2),m("ngForOf",e.infiniteList),r(5),v(" ",f(28,14,y(27,11,e.infiniteList,"Sales"))," "),r(4),v(" ",f(32,19,y(31,16,e.infiniteList,"Tax"))," "),r(3),m("ngForOf",e.data.Compenents),r(4),v(" Showing 1 - ",f(38,21,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),r(2),m("ngIf",!e.pageData.HideStoreApiCount),r(),m("ngIf",e.pageData.HideStoreApiCount),r(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),r(2),m("ngIf",e.nextPageDisabled&&!e.goToLast),r(),m("ngIf",e.nextPageDisabled&&!e.goToLast)}}var la=class i extends Ji{constructor(e,o,t,l,S,P){super(e,o,"Report/GetSalesTaxReport","ReportLoader/GetTaxReport",P);this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S;this.toastrService=P}timeTo;timeFrom;getComponent(e){return e.Component=[],this.data.Compenents.forEach((o,t)=>{e.Tax!=0?(o.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,o.SalesTax=t==0?o.SalesTax:o.SalesTax+o.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=o.SalesTax*o.Rate/100,o.SumTaxAmount=o.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),S);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),S);case"Number":return this.compare(t.Number,l.Number,S);case"Date":return this.compare(t.Date,l.Date,S);case"Sales":return this.compare(t.Sales,l.Sales,S);case"Tax":return this.compare(t.Tax,l.Tax,S);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Tax Report",exportTypes:[{ID:"ReportExport/GetSalesTaxReport",Value:"Default",FileName:"Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y),D(Ke))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-tax-report"]],standalone:!1,features:[R],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3","matTooltipPosition","above","matTooltip","Tax Report By Outlet",3,"routerLink",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-3",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],["style","width: 150px","class","align-right text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],[1,"text-end","text-success"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load next page",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end",2,"width","150px"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),h("textChange",function(P){return u(l),x(t.pageData.Filter.Number,P)||(t.pageData.Filter.Number=P),_(P)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,mS,2,2,"a",2)(3,sS,3,0,"a",3),a(),n(4,"filters"),g(5,cS,18,10,"ng-template",null,0,M),a(),n(7,"content"),g(8,SS,45,23,"div",4),a()()}o&2&&(m("pageData",t.menuData),C("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService.global.Export),r(),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(5),m("ngIf",t.data))},dependencies:[N,j,k,A,z,K,Ge,O,L,le,ae,ge,He,Q,re,fi,te,ee,X],encapsulation:2})};var yS=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report"];function DS(i,c){if(i&1){let e=F();n(0,"a",5),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",6),p(2," Export "),a()}}function vS(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",9),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",10)(8,"datepicker",11),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Tax"),a(),n(11,"ng-select",12),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("accessType",2),C("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)("clearable",!1)}}function wS(i,c){i&1&&(n(0,"th",26),p(1,"Total Tax"),a())}function TS(i,c){if(i&1&&I(0,"th",27),i&2){let e=c.$implicit;m("innerHtml",e.Label+" ("+e.Rate+"%)",Pe)}}function PS(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"number"),a()),i&2){let e=s().$implicit,o=s(2);r(),w(y(2,1,e.Tax,o.pageData.FractionDigit))}}function FS(i,c){if(i&1&&(I(0,"td",27),d(1,"TaxDefault"),d(2,"number")),i&2){let e=c.index,o=s().$implicit,t=s(2);m("innerHtml",y(2,5,di(1,1,t.data.Compenents,o,e),t.pageData.FractionDigit),Pe)}}function IS(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",28),p(4),d(5,"number"),a(),g(6,PS,3,4,"td",29)(7,FS,3,8,"td",30),a()),i&2){let e=c.$implicit,o=s(2);r(2),w(e.EntityName),r(2),w(y(5,4,e.Sales,o.pageData.FractionDigit)),r(2),m("ngIf",o.data.Compenents.length==0),r(),m("ngForOf",o.getComponent(e))}}function bS(i,c){if(i&1&&(n(0,"td",23),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);r(),v(" ",y(3,4,y(2,1,e.data.Data,"Tax"),e.pageData.FractionDigit),"")}}function ES(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,o=s(2);r(),v(" ",y(2,1,e.SumTaxAmount,o.pageData.FractionDigit)," ")}}function MS(i,c){if(i&1){let e=F();n(0,"div",13)(1,"table",14),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",15)(3,"tr")(4,"th",16),p(5,"Outlet"),a(),n(6,"th",17),p(7,"Sales"),a(),g(8,wS,2,0,"th",18)(9,TS,1,1,"th",19),a()(),n(10,"tbody"),g(11,IS,8,7,"tr",20),a(),n(12,"tfoot")(13,"tr",21),I(14,"td",22),n(15,"td",23),p(16),d(17,"sum"),d(18,"number"),a(),g(19,bS,4,7,"td",24)(20,ES,3,4,"td",25),a()()()()}if(i&2){let e=s();r(8),m("ngIf",e.data.Compenents.length==0),r(),m("ngForOf",e.data.Compenents),r(2),m("ngForOf",e.data.Data),r(5),w(y(18,9,y(17,6,e.data.Data,"Sales"),e.pageData.FractionDigit)),r(3),m("ngIf",e.data.Compenents.length==0),r(),m("ngForOf",e.data.Compenents)}}var pa=class i extends ie{constructor(e,o,t,l,S,P){super(e,o,"Report/GetTaxReportbyOutlet","ReportLoader/GetTaxReport",t);this.httpService=o;this.csvConverter=l;this.roleService=S;this.matDialog=P}openExportModal(){this.matDialog.open(q,{data:{title:"Tax Report by Outlet",exportTypes:[{ID:"ReportExport/GetTaxReportbyOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((o,t)=>{o.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,o.SalesTax=t==0?o.SalesTax:o.SalesTax+o.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=o.SalesTax*o.Rate/100,o.SumTaxAmount=o.SumTaxAmount+e.Component[t]}),e.Component}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.EntityName,l.EntityName,S);case"Sales":return this.compare(t.Sales,l.Sales,S);case"Tax":return this.compare(t.Tax,l.Tax,S);default:return 0}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(Ke),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-tax-report-by-outlet"]],standalone:!1,features:[R],decls:10,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-6",3,"routerLink"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items","clearable"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],["style","width: 150px","class","text-end flex-right","mat-sort-header","Tax","arrowPosition","before",4,"ngIf"],["style","width: 150px","class","text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end","text-success"],["class","text-end text-success",4,"ngIf"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end",2,"width","150px"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),h("textChange",function(P){return u(l),x(t.pageData.Filter.Number,P)||(t.pageData.Filter.Number=P),_(P)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions")(2,"a",2),p(3,"Tax Report"),a(),g(4,DS,3,0,"a",3),a(),n(5,"filters"),g(6,vS,12,8,"ng-template",null,0,M),a(),n(8,"content"),g(9,MS,21,12,"div",4),a()()}o&2&&(m("pageData",t.menuData),C("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("routerLink",b(8,yS)),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(5),m("ngIf",t.data))},dependencies:[N,j,k,A,z,K,O,L,le,ae,ge,Q,re,fi,te],encapsulation:2})};var VS=()=>["/menu/Products/Catalog/Variants/Info"],BS=i=>({ID:i});function OS(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 LS(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("accessType",2),C("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.SalesID)}}function RS(i,c){i&1&&(n(0,"th",25),p(1," Category "),a())}function kS(i,c){i&1&&(n(0,"th",26),p(1,"Code"),a())}function WS(i,c){i&1&&(n(0,"th",27),p(1," Release Date "),a())}function NS(i,c){i&1&&(n(0,"th",28),p(1," Days Count "),a())}function AS(i,c){i&1&&(n(0,"th",29),p(1," Last Sold "),a())}function GS(i,c){i&1&&(n(0,"th",30),p(1," Last Purchased "),a())}function HS(i,c){i&1&&(n(0,"th",31),p(1," Qty "),a())}function QS(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;r(),w(e.Category)}}function jS(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;r(),w(e.Code)}}function YS(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;r(),v(" ",e.Released?y(2,1,e.Released,"dd MMM yyyy"):"-"," ")}}function qS(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;r(),v(" ",e.DaysCount!=null?f(2,1,e.DaysCount):"-"," ")}}function US(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;r(),v(" ",e.LastSold?y(2,1,e.LastSold,"dd MMM yyyy"):"-"," ")}}function KS(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;r(),v(" ",e.LastPurchased?y(2,1,e.LastPurchased,"dd MMM yyyy"):"-"," ")}}function zS(i,c){if(i&1&&(n(0,"td",36),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Quantity)," ")}}function XS(i,c){if(i&1&&(n(0,"tr",32),g(1,QS,2,1,"td",33),n(2,"td")(3,"a",34),p(4),a()(),g(5,jS,2,1,"td",33)(6,YS,3,4,"td",33)(7,qS,3,3,"td",33)(8,US,3,4,"td",33)(9,KS,3,4,"td",33)(10,zS,3,3,"td",35),a()),i&2){let e=c.$implicit,o=s(2);r(),m("ngIf",o.column.Category.selected),r(2),m("routerLink",b(10,VS))("queryParams",U(11,BS,e.ID)),r(),w(e.Name),r(),m("ngIf",o.column.Code.selected),r(),m("ngIf",o.column.ReleaseDate.selected),r(),m("ngIf",o.column.DaysCount.selected),r(),m("ngIf",o.column.LastSold.selected),r(),m("ngIf",o.column.LastPurchased.selected),r(),m("ngIf",o.column.QTY.selected)}}function ZS(i,c){if(i&1){let e=F();n(0,"div",13)(1,"table",14),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",15)(3,"tr"),g(4,RS,2,0,"th",16),n(5,"th",17),p(6,"Name"),a(),g(7,kS,2,0,"th",18)(8,WS,2,0,"th",19)(9,NS,2,0,"th",20)(10,AS,2,0,"th",21)(11,GS,2,0,"th",22)(12,HS,2,0,"th",23),a()(),n(13,"tbody"),g(14,XS,11,13,"tr",24),a()()()}if(i&2){let e=s();r(4),m("ngIf",e.column.Category.selected),r(3),m("ngIf",e.column.Code.selected),r(),m("ngIf",e.column.ReleaseDate.selected),r(),m("ngIf",e.column.DaysCount.selected),r(),m("ngIf",e.column.LastSold.selected),r(),m("ngIf",e.column.LastPurchased.selected),r(),m("ngIf",e.column.QTY.selected),r(2),m("ngForOf",e.data)}}var ma=class i extends ie{constructor(e,o,t,l,S){super(e,o,"Report/ProductLifeCycle","ReportLoader/ProductLifeCycle",S);this.httpService=o;this.csvConverter=t;this.matDialog=l;this.toastrService=S}roleService=Ye(G);columnService=Ye(It);column={Category:{selected:!1,name:"Category"},Code:{selected:!0,name:"Code"},ReleaseDate:{selected:!0,name:"Release Date"},DaysCount:{selected:!1,name:"Days Count"},LastSold:{selected:!0,name:"Last Sold"},LastPurchased:{selected:!0,name:"Last Purchased"},QTY:{selected:!0,name:"Quantity"}};oriData;sortData(e){let o=this.data.slice();if(!e.active||e.direction===""){this.data=this.oriData;return}this.data=o.sort((t,l)=>{let S=e.direction==="asc",P=typeof t[e.active];switch(V.IsEmpty(t.Code)&&(t.Code=""),V.IsEmpty(l.Code)&&(l.Code=""),V.IsEmpty(t.Released)&&(t.Release=""),V.IsEmpty(l.Released)&&(l.Release=""),V.IsEmpty(t.LastPurchased)&&(t.LastPurchased=""),V.IsEmpty(l.LastPurchased)&&(l.LastPurchased=""),V.IsEmpty(t.LastSold)&&(t.LastSold=""),V.IsEmpty(l.LastSold)&&(l.LastSold=""),P){case"string":return this.compare(t[e.active].toLocaleLowerCase(),l[e.active].toLocaleLowerCase(),S);case"number":return this.compare(t[e.active],l[e.active],S);default:return 0}})}preGetList(){this.pageData.Filter.EntityID||delete this.pageData.Filter.EntityID}postInit(e){this.oriData=e}openExportModal(){this.matDialog.open(q,{data:{title:"Product Life Cycle",exportTypes:[{ID:"ReportExport/ProductLifeCycle",Value:"Default",FileName:"Product Life Cycle"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data,this.pageData.Filter)}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(Y),D(Ke))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-life-cycle"]],standalone:!1,features:[R],decls:8,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["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"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Category",4,"ngIf"],["mat-sort-header","Name"],["mat-sort-header","Code",4,"ngIf"],["mat-sort-header","Released",4,"ngIf"],["mat-sort-header","DaysCount",4,"ngIf"],["mat-sort-header","LastSold",4,"ngIf"],["mat-sort-header","LastPurchased",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","flex-right text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["mat-sort-header","Category"],["mat-sort-header","Code"],["mat-sort-header","Released"],["mat-sort-header","DaysCount"],["mat-sort-header","LastSold"],["mat-sort-header","LastPurchased"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right","text-end"],[1,"border-bottom"],[4,"ngIf"],[3,"routerLink","queryParams"],["class","text-end",4,"ngIf"],[1,"text-end"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,OS,3,0,"a",2),a(),n(3,"filters"),g(4,LS,15,8,"ng-template",null,0,M),a(),n(6,"content"),g(7,ZS,15,8,"div",3),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),m("column",t.column),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(5),m("ngIf",t.data))},dependencies:[N,j,k,A,K,O,L,ae,ge,fe,Q,Qe,te,ee,Z],encapsulation:2})};function JS(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 $S(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Supplier"),a(),n(14,"autocompleteV2",12),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(15,"h6"),p(16,"Row Count"),a(),n(17,"input",13),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("accessType",2),C("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.SupplierID),r(3),m("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function ey(i,c){i&1&&(n(0,"th",22),p(1,"Total Cost"),a())}function ty(i,c){i&1&&(n(0,"th",22),p(1,"Total profit"),a())}function iy(i,c){if(i&1&&(n(0,"td",32),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),w(f(2,1,e.TotalCost))}}function ny(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),w(f(2,1,e.TotalProfit))}}function ay(i,c){if(i&1&&(n(0,"tr",27)(1,"td",28),p(2),a(),n(3,"td",28),p(4),a(),n(5,"td"),p(6),a(),n(7,"td"),p(8),a(),n(9,"td",29),p(10),d(11,"quantityFraction"),a(),n(12,"td",29),p(13),d(14,"quantityFraction"),a(),n(15,"td",29),p(16),d(17,"amountFraction"),a(),g(18,iy,3,3,"td",30)(19,ny,3,3,"td",31),n(20,"td",29),p(21),d(22,"amountFraction"),a()()),i&2){let e=c.$implicit,o=s(2);r(2),w(e.PrevRank||"-"),r(2),w(e.Rank),r(2),w(e.Name),r(2),w(e.Code),r(2),w(f(11,10,e.Quantity)),r(3),w(f(14,12,e.OnHand)),r(3),w(f(17,14,e.TotalAmount)),r(2),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.report.Profit),r(2),w(f(22,16,e.Margin))}}function ry(i,c){if(i&1&&(n(0,"td",35),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);r(),w(f(3,4,y(2,1,e.data,"TotalCost")))}}function oy(i,c){if(i&1&&(n(0,"td",35),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);r(),w(f(3,4,y(2,1,e.data,"TotalProfit")))}}function ly(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",33),I(2,"td",34),n(3,"td",35),p(4,"Total:"),a(),n(5,"td",35),p(6),d(7,"sum"),d(8,"quantityFraction"),a(),n(9,"td",35),p(10),d(11,"sum"),d(12,"quantityFraction"),a(),n(13,"td",35),p(14),d(15,"sum"),d(16,"amountFraction"),a(),g(17,ry,4,6,"td",36)(18,oy,4,6,"td",36),a()()),i&2){let e=s(2);r(6),w(f(8,8,y(7,5,e.data,"Quantity"))),r(4),w(f(12,13,y(11,10,e.data,"OnHand"))),r(4),w(f(16,18,y(15,15,e.data,"TotalAmount"))),r(3),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.report.Profit)}}function py(i,c){if(i&1){let e=F();n(0,"div",14)(1,"div",15)(2,"table",16),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",17)(4,"tr")(5,"th",18),p(6,"Prev"),a(),n(7,"th",18),p(8,"Now"),a(),n(9,"th",19),p(10,"Name"),a(),n(11,"th",20),p(12,"Code"),a(),n(13,"th",18),p(14,"Sold"),a(),n(15,"th",21),p(16,"On Hand"),a(),n(17,"th",22),p(18,"Total Amount"),a(),g(19,ey,2,0,"th",23)(20,ty,2,0,"th",23),n(21,"th",24),p(22,"%"),a()()(),n(23,"tbody"),g(24,ay,23,18,"tr",25),a(),g(25,ly,19,20,"tfoot",26),a()()()}if(i&2){let e=s();r(19),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.report.Profit),r(4),m("ngForOf",e.data.Data),r(),m("ngIf",e.data.length>0)}}var sa=class i extends ie{constructor(e,o,t,l,S,P){super(e,o,"Report/GetReportProductProfit","ReportLoader/GetReportProductProfit",P);this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S;this.toastrService=P}RadioGroupBy=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];originalData;openExportModal(){this.matDialog.open(q,{data:{title:"Product Profit Report",exportTypes:[{ID:"ReportExport/GetReportProductProfit",Value:"Default",FileName:"Product Profit Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.originalData=e.Data}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";return this.compare(t[e.active],l[e.active],S)})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y),D(Ke))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-profit"]],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"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","100px"],[2,"width","600px"],[2,"width","100px"],["matTooltip","On Hand Inventory",1,"text-end",2,"width","200px"],[1,"text-end",2,"width","200px"],["style","width: 200px","class","text-end",4,"ngIf"],["mat-sort-header","Margin",1,"text-end","align-right",2,"width","200px"],["class","border-bottom",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"border-bottom"],[1,"text-end",2,"width","35px"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[1,"text-end","text-danger"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,JS,3,0,"a",2),a(),n(3,"filters"),g(4,$S,18,10,"ng-template",null,0,M),a(),n(6,"content"),g(7,py,26,4,"div",3),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(5),m("ngIf",t.data))},dependencies:[N,j,k,K,Ge,O,L,le,ae,ge,He,Le,fe,Q,re,X,Z],encapsulation:2})};var my=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],sy=i=>({ID:i});function cy(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 dy(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();r(3),m("accessType",2),C("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function uy(i,c){if(i&1&&(n(0,"tr",16)(1,"td")(2,"a",17),p(3),a()(),n(4,"td"),p(5),a(),n(6,"td"),p(7),a(),n(8,"td"),p(9),d(10,"quantityFraction"),a(),n(11,"td"),p(12),d(13,"amountFraction"),a()()),i&2){let e=c.$implicit;r(2),m("routerLink",b(11,my))("queryParams",U(12,sy,e.ID)),r(),w(e.InvoiceNumber),r(2),w(e.Name),r(2),w(e.Code),r(2),w(f(10,7,e.Quantity)),r(3),w(f(13,9,e.Price))}}function _y(i,c){if(i&1&&(n(0,"div",12)(1,"table",13)(2,"thead",14)(3,"tr")(4,"th"),p(5,"Number"),a(),n(6,"th"),p(7,"Name"),a(),n(8,"th"),p(9,"Code"),a(),n(10,"th"),p(11,"Quantity"),a(),n(12,"th"),p(13,"Price"),a()()(),n(14,"tbody"),g(15,uy,14,14,"tr",15),a()()()),i&2){let e=s();r(15),m("ngForOf",e.data.Data)}}var ca=class i extends ie{constructor(e,o,t,l,S,P){super(e,o,"Report/GetExchangedSales","ReportLoader/GetExchangedSales",P);this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S;this.toastrService=P}openExportModal(){this.matDialog.open(q,{data:{title:"Exchanged Sales Report",exportTypes:[{ID:"ReportExport/GetExchangedSales",Value:"Default",FileName:"Exchanged Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y),D(Ke))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-exchanged-sales"]],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"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[3,"routerLink","queryParams"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,cy,3,0,"a",2),a(),n(3,"filters"),g(4,dy,12,7,"ng-template",null,0,M),a(),n(6,"content"),g(7,_y,16,1,"div",3),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(5),m("ngIf",t.data))},dependencies:[N,j,k,A,K,O,L,fe,Q,X,Z],encapsulation:2})};function gy(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 fy(i,c){if(i&1){let e=F();n(0,"div")(1,"h6"),p(2,"Product by Name"),a(),n(3,"autocompleteV2",14),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=s(2);r(3),C("ngModel",e.pageData.Filter.ProductID)}}function Cy(i,c){if(i&1){let e=F();n(0,"div")(1,"h6"),p(2,"Product by Code"),a(),n(3,"autocompleteV2",15),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=s(2);r(3),C("ngModel",e.pageData.Filter.ProductID)}}function xy(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",8),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",9)(8,"datepicker",10),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Search By"),a(),n(11,"radio-options",11),h("modelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SearchBy,t)||(l.pageData.Filter.SearchBy=t),_(t)}),a(),g(12,fy,4,1,"div",12)(13,Cy,4,1,"div",12),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",13),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("accessType",2),C("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("model",e.pageData.Filter.SearchBy),m("options",e.RadioSearchBy),r(),m("ngIf",e.pageData.Filter.SearchBy),r(),m("ngIf",!e.pageData.Filter.SearchBy),r(3),m("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function hy(i,c){if(i&1&&(n(0,"tr",23)(1,"td",24),p(2),a(),n(3,"td"),p(4),a(),n(5,"td",24),p(6),d(7,"quantityFraction"),a(),n(8,"td",25),p(9),d(10,"quantityFraction"),a()()),i&2){let e=c.$implicit;r(2),w(e.Rank),r(2),w(e.Name),r(2),w(f(7,4,e.Quantity)),r(3),w(f(10,6,e.OnHand))}}function Sy(i,c){if(i&1&&(n(0,"div",16)(1,"table",17)(2,"thead",18)(3,"tr")(4,"th",19),p(5,"Rank"),a(),n(6,"th",20),p(7,"Name"),a(),n(8,"th",21),p(9,"Sold"),a(),n(10,"th",21),p(11,"Inventory"),a()()(),n(12,"tbody"),g(13,hy,11,8,"tr",22),a()()()),i&2){let e=s();r(13),m("ngForOf",e.data.Data)}}var da=class i extends ie{constructor(e,o,t,l,S,P){super(e,o,"Report/GetSalesRankByVariantModel","ReportLoader/GetSalesRankByVariantModel",P);this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S;this.toastrService=P}RadioSearchBy=[{Key:!0,Value:"Name"},{Key:!1,Value:"Code"}];openExportModal(){this.matDialog.open(q,{data:{title:"Variant Model Rank Report",exportTypes:[{ID:"ReportExport/GetSalesRankByVariantModel",Value:"Default",FileName:"Variant Model Rank Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y),D(Ke))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-variant-model-rank"]],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"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Search By",3,"modelChange","model","options"],[4,"ngIf"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestion","placeholder","Search by Name",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCode","placeholder","Search by Code",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","70px"],[2,"width","800px"],[1,"text-end",2,"width","100px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[1,"text-end"],[1,"text-success","text-end"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,gy,3,0,"a",2),a(),n(3,"filters"),g(4,xy,17,11,"ng-template",null,0,M),a(),n(6,"content"),g(7,Sy,14,1,"div",3),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(5),m("ngIf",t.data))},dependencies:[N,j,k,K,Ge,O,L,He,we,Le,Q,Z],encapsulation:2})};var yy=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Dy=i=>({ID:i});function vy(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 wy(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();r(3),m("accessType",2),C("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("ngModel",e.pageData.Filter.CustomerID),r(3),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function Ty(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",22),p(5),a()(),n(6,"td"),p(7),d(8,"date"),a(),n(9,"td"),p(10),a(),n(11,"td"),p(12),a(),n(13,"td",17),p(14),d(15,"quantityFraction"),a(),n(16,"td",17),p(17),d(18,"amountFraction"),a(),n(19,"td",23),p(20),a(),n(21,"td",17),p(22),d(23,"amountFraction"),a()()),i&2){let e=c.$implicit;r(2),w(e.EntityName),r(2),m("routerLink",b(20,yy))("queryParams",U(21,Dy,e.InvoiceID)),r(),w(e.Number),r(2),w(y(8,11,e.Date,"dd MMM yyyy")),r(3),w(e.Name),r(2),w(e.Code),r(2),v("(",f(15,14,e.Quantity),")"),r(3),w(f(18,16,e.UnitPrice)),r(3),v("",e.Discount&&e.Discount!=0?-e.Discount+"%":""," "),r(2),v("(",f(23,18,e.Total),")")}}function Py(i,c){if(i&1&&(n(0,"div",12)(1,"div",13)(2,"table",14)(3,"thead",15)(4,"tr")(5,"th"),p(6,"Outlet"),a(),n(7,"th",16),p(8,"Number"),a(),n(9,"th"),p(10,"Date"),a(),n(11,"th"),p(12,"Name"),a(),n(13,"th"),p(14,"Code"),a(),n(15,"th",17),p(16,"Quantity"),a(),n(17,"th",17),p(18),a(),n(19,"th",18),p(20,"%"),a(),n(21,"th",17),p(22),a()()(),n(23,"tbody"),g(24,Ty,24,23,"tr",19),a(),n(25,"tfoot")(26,"tr",20),I(27,"td",21)(28,"td",21)(29,"td",21)(30,"td",21)(31,"td",21),n(32,"td",17),p(33),d(34,"sum"),d(35,"quantityFraction"),a(),I(36,"td",21)(37,"td",21),n(38,"td",17),p(39),d(40,"sum"),d(41,"amountFraction"),a()()()()()()),i&2){let e=s();r(18),v("Price (",e.data.CurrencySymbol,")"),r(4),v("Total(",e.data.CurrencySymbol,")"),r(2),m("ngForOf",e.data.Data),r(9),w(f(35,8,y(34,5,e.data.Data,"Quantity"))),r(6),w(f(41,13,y(40,10,e.data.Data,"Total")))}}var ua=class i extends ie{constructor(e,o,t,l,S,P){super(e,o,"Report/SalesReturnList","ReportLoader/ReturnReportLoader",t);this.httpService=o;this.csvConverter=l;this.roleService=S;this.matDialog=P}month;year;openExportModal(){this.matDialog.open(q,{data:{title:"Sales Return",exportTypes:[{ID:"ReportExport/SalesReturnExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.menuData.H=e.PageTitle}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(Ke),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-sales-return"]],standalone:!1,features:[R],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end"],[2,"width","30px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[3,"routerLink","queryParams"],[1,"text-danger"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,vy,3,0,"a",2),a(),n(3,"filters"),g(4,wy,12,6,"ng-template",null,0,M),a(),n(6,"content"),g(7,Py,42,15,"div",3),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(5),m("ngIf",t.data))},dependencies:[N,j,k,A,K,O,L,Le,Q,re,ee,X,Z],encapsulation:2})};var Fy=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Iy=i=>({ID:i});function by(i,c){if(i&1){let e=F();n(0,"a",13),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",14),p(2," Export "),a()}}function Ey(i,c){if(i&1){let e=F();n(0,"div",15)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",16),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Supplier"),a(),n(6,"autocompleteV2",17),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",18),h("dateChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",19)(11,"datepicker",20),h("dateChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s(2);r(3),m("accessType",2),C("ngModel",e.pageData.Filter.EntityID),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("ngModel",e.pageData.Filter.SupplierID),r(3),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function My(i,c){i&1&&(n(0,"th",8),p(1,"Unit Cost"),a())}function Vy(i,c){if(i&1&&(I(0,"td",43),d(1,"amountFraction")),i&2){let e=s().$implicit;m("innerHtml",f(1,1,e.UnitPrice),Pe)}}function By(i,c){if(i&1&&(n(0,"tr",35)(1,"td",36),I(2,"span",37),a(),I(3,"td",38),n(4,"td",39),p(5),d(6,"quantityFraction"),a(),I(7,"td",40),g(8,Vy,2,3,"td",41),n(9,"td",42),p(10),d(11,"amountFraction"),a(),I(12,"td",43),d(13,"amountFraction"),a()),i&2){let e=c.$implicit,o=s(3);r(2),m("innerHtml",e.Name,Pe),r(),m("innerHtml",e.Code,Pe),r(2),v("(",f(6,7,e.Quantity),")"),r(2),m("innerHtml",e.UOMName,Pe),r(),m("ngIf",o.roleService.product.Cost),r(2),v(" ",e.Discount==0?"":"-"+f(11,9,e.Discount)+"%",""),r(2),m("innerHtml",f(13,11,e.Total),Pe)}}function Oy(i,c){i&1&&(n(0,"td",31),p(1,"\xA0"),a())}function Ly(i,c){if(i&1&&(n(0,"div")(1,"div",21)(2,"a",22),I(3,"span",23),d(4,"date"),d(5,"date"),a(),n(6,"span"),p(7),d(8,"showIfNotNullOrEmptyString"),a()(),I(9,"span",24),n(10,"div",25)(11,"div")(12,"table",26),I(13,"thead"),n(14,"tbody"),g(15,By,14,13,"tr",27),a()()()(),n(16,"table",28)(17,"thead")(18,"tr",29)(19,"td",30),p(20,"Total"),a(),n(21,"td",31),p(22,"\xA0"),a(),n(23,"td",8),p(24),d(25,"sum"),d(26,"quantityFraction"),a(),I(27,"td",32),g(28,Oy,2,0,"td",33),n(29,"td",34),p(30,"\xA0"),a(),n(31,"td",8),p(32),d(33,"sum"),d(34,"amountFraction"),a()()()()()),i&2){let e=c.$implicit,o=s(2);r(2),m("routerLink",b(28,Fy))("queryParams",U(29,Iy,e.InvoiceID)),r(),m("innerHtml",e.EntityName+" #"+e.Number+" - "+y(4,9,e.Date,"dd MMM yyyy")+" ("+y(5,12,e.Created,"HH:mm")+")",Pe),r(4),v(" ",y(8,15,e.CustomerNameDisplay," - {0}")," "),r(2),m("innerHtml",e.Note,Pe),r(6),m("ngForOf",e.Item),r(9),v("",f(26,21,y(25,18,e.Item,"Quantity")),"\xA0"),r(4),m("ngIf",o.roleService.product.Cost),r(4),v("",f(34,26,y(33,23,e.Item,"Total")),"\xA0")}}function Ry(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),g(2,by,3,0,"a",3),a(),n(3,"filters"),g(4,Ey,12,6,"ng-template",null,0,M),a(),n(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th"),p(12,"Name"),a(),n(13,"th",7),p(14,"Code"),a(),n(15,"th",8),p(16,"Quantity"),a(),n(17,"th",9),p(18,"UOM"),a(),g(19,My,2,0,"th",10),n(20,"th",11),p(21,"%"),a(),n(22,"th",8),p(23,"Total(Rp.)"),a()()()(),g(24,Ly,35,31,"div",12),a()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),r(2),m("ngIf",e.roleService==null?null:e.roleService.global.Export),r(17),m("ngIf",e.roleService.product.Cost),r(5),m("ngForOf",e.data.Data)}}var _a=class i extends ie{constructor(e,o,t,l,S){super(e,o,"Report/PurchaseReturnList","ReportLoader/ReturnReportLoader");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Return",exportTypes:[{ID:"ReportExport/PurchaseReturnList",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}postInit(){this.menuData.H=this.data.PageTitle}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-purchase-return"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"UOMWidth",2,"width","50px"],["style","width: 10%","class","text-end",4,"ngIf"],[2,"width","5%"],[4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"mt-7"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHtml"],[1,"mt-3","mb-3",3,"innerHtml"],[1,"items"],["cellspacing","0",1,"table","table-sm"],["class","border-top",4,"ngFor","ngForOf"],[1,"w-100"],[1,"table-footer"],[1,"empty-column"],[1,"empty-column",2,"width","10%"],[1,"empty-column",2,"width","50px"],["style","width: 10%","class","empty-column",4,"ngIf"],[1,"empty-column",2,"width","5%"],[1,"border-top"],[1,"border-start","border-end"],[3,"innerHtml"],[1,"border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%"],[1,"UOMWidth","border-start","border-end",2,"width","50px",3,"innerHtml"],["class","text-end border-start border-end","style","width: 10%;",3,"innerHtml",4,"ngIf"],[1,"small","text-danger","border-start","border-end",2,"width","5%"],[1,"text-end","border-start","border-end",2,"width","10%",3,"innerHtml"]],template:function(o,t){o&1&&g(0,Ry,25,7,"mainpanel-cmp",1),o&2&&m("ngIf",t.data)},dependencies:[N,j,k,A,K,O,L,Le,Q,re,tn,ee,X,Z],encapsulation:2})};var ky=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Wy=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Fo=i=>({ID:i});function Ny(i,c){if(i&1){let e=F();n(0,"a",5),T("click",function(){u(e);let t=s();return _(t.exportCSV(t.csvConverter,"Report/ProductSalesByInvoice","Invoice_Item_Details.csv"))}),I(1,"i",6),p(2," Export"),a()}}function Ay(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",10),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Customer"),a(),n(12,"autocompleteV2",11),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(13,"h6"),p(14,"Page Size"),a(),n(15,"input",12),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",13),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(20,"div",14)(21,"datepicker",15),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(22,"h6"),p(23,"Product"),a(),n(24,"autocompleteV2",16),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a(),n(25,"h6"),p(26,"Variant"),a(),n(27,"autocompleteV2",17),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.pageData.Filter.SalesID),r(3),C("ngModel",e.pageData.Filter.CustomerID),r(3),C("ngModel",e.pageData.Filter.RowCount),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),m("inputTextValue",e.pageData.Filter.ProductName),C("ngModel",e.pageData.Filter.ProductID),r(3),m("inputTextValue",e.pageData.Filter.VariantName)("renderThumbnail",!0),C("ngModel",e.pageData.Filter.VariantID)}}function Gy(i,c){i&1&&(se(0),n(1,"th",34),p(2," Batch Number "),a(),ce())}function Hy(i,c){i&1&&(n(0,"th",35),p(1," Cost "),a())}function Qy(i,c){if(i&1&&(se(0),n(1,"td"),p(2),a(),ce()),i&2){let e=s().$implicit;r(2),w(e.SerialBatchNumber)}}function jy(i,c){if(i&1&&(n(0,"td",40),p(1),d(2,"number"),a()),i&2){let e=s().$implicit,o=s(2);r(),v(" ",y(2,1,e.UnitCost,o.pageData.FractionDigit)," ")}}function Yy(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td"),p(4),d(5,"date"),a(),n(6,"td")(7,"a",36),p(8),a()(),g(9,Qy,3,1,"ng-container",24),n(10,"td")(11,"div",37)(12,"a",38),p(13),a(),n(14,"small",39),p(15),a()()(),n(16,"td"),p(17),a(),n(18,"td",40),p(19),d(20,"number"),a(),g(21,jy,3,4,"td",41),n(22,"td",40),p(23),d(24,"number"),a(),n(25,"td",40),p(26),d(27,"number"),a()()),i&2){let e=c.$implicit,o=s(2);r(2),w(e.Outlet),r(2),w(y(5,16,e.Date,"dd MMM yy")),r(3),m("routerLink",b(27,Wy))("queryParams",U(28,Fo,e.InvoiceID)),r(),w(e.Number),r(),m("ngIf",o.showBatchNumber),r(3),m("queryParams",U(30,Fo,e.CustomerID)),r(),w(e.CustomerName),r(),m("matTooltip",o.maskingFields!=null&&o.maskingFields.Code&&!o.roleService.global.SensitiveField?o.maskingFieldMsg:""),r(),w(e.Code),r(2),w(e.SalesPerson),r(2),Kt(" ",f(20,19,e.Quantity),"",e.UnitQuantity!=1?" x "+e.UnitQuantity:""," "),r(2),m("ngIf",o.roleService.product.Cost),r(2),v(" ",y(24,21,e.UnitPrice,o.pageData.FractionDigit)," "),r(3),v(" ",y(27,24,e.Total,o.pageData.FractionDigit)," ")}}function qy(i,c){i&1&&I(0,"td",45)}function Uy(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",42)(2,"td",43),p(3," Total: "),a(),n(4,"td",40),p(5),d(6,"sum"),d(7,"number"),a(),g(8,qy,1,0,"td",44),I(9,"td",45),n(10,"td",40),p(11),d(12,"sum"),d(13,"number"),a()()()),i&2){let e=s(2);r(2),m("colSpan",e.showBatchNumber?6:5),r(3),w(f(7,7,y(6,4,e.data.Data,"Quantity"))),r(3),m("ngIf",e.roleService.product.Cost),r(3),v(" ",y(13,12,y(12,9,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function Ky(i,c){if(i&1){let e=F();n(0,"div",18)(1,"table",19),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",20)(3,"tr")(4,"th",21),p(5," Outlet "),a(),n(6,"th",22),p(7," Date "),a(),n(8,"th",23),p(9," Invoice # "),a(),g(10,Gy,3,0,"ng-container",24),n(11,"th",25),p(12,"Customer"),a(),n(13,"th",26),p(14," SALES PERSON "),a(),n(15,"th",27),p(16," Qty "),a(),g(17,Hy,2,0,"th",28),n(18,"th",29),p(19," Price "),a(),n(20,"th",30),p(21," Total "),a()()(),n(22,"tbody"),g(23,Yy,28,32,"tr",31),a(),g(24,Uy,14,15,"tfoot",24),a(),n(25,"div",32)(26,"POS-complex-pagination",33),T("jumpToPage",function(){u(e);let t=s();return _(t.getListData())})("previousPage",function(){u(e);let t=s();return _(t.getListData())})("nextPage",function(){u(e);let t=s();return _(t.getListData())}),a()()()}if(i&2){let e=s();r(10),m("ngIf",e.showBatchNumber),r(7),m("ngIf",e.roleService.product.Cost),r(6),m("ngForOf",e.data.Data),r(),m("ngIf",e.data.Data.length>0),r(2),m("total",e.data.Data.length)("pageData",e.pageData)}}var ga=class i extends ie{constructor(e,o,t,l,S){super(e,o,"Report/ProductSalesByInvoice","ReportLoader/ProductSalesByInvoice",null,l);this.httpService=o;this.csvConverter=t;this.activatedRoute=l;this.roleService=S}originalData;showBatchNumber=!0;maskingFields;maskingFieldMsg=an.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.menuData.H=this.pageData.PageTitle,this.originalData=e.Data,this.initShowBatchNumber()}initShowBatchNumber(){let e=this.data?.Data[0]?.SerialBatchNumber;this.showBatchNumber=e!=null}sortData(e){let o=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.Outlet,l.Outlet,S);case"Date":return this.compare(t.Date,l.Date,S);case"Number":return this.compare(t.Number,l.Number,S);case"SerialBatchNumber":return this.compare(t.SerialBatchNumber,l.SerialBatchNumber,S);case"CustomerName":return this.compare(t.CustomerName,l.CustomerName,S);case"SalesPerson":return this.compare(t.SalesPerson,l.SalesPerson,S);case"UnitCost":return this.compare(t.UnitCost,l.UnitCost,S);case"UnitPrice":return this.compare(t.UnitPrice,l.UnitPrice,S);case"Quantity":return this.compare(t.Quantity,l.Quantity,S);case"Discount":return this.compare(t.Discount,l.Discount,S);case"Total":return this.compare(t.TotalAfterDiscount,l.TotalAfterDiscount,S);default:return 0}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(Oe),D(G))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-invoice-items"]],standalone:!1,features:[R],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary me-6",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100",3,"ngModelChange","ngModel"],["type","text","autoNum","","min","0",1,"w-100",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search by Product",1,"w-100",3,"ngModelChange","inputTextValue","ngModel"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search by Variant",1,"w-100",3,"ngModelChange","inputTextValue","renderThumbnail","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet","width","100px",1,"align-left"],["mat-sort-header","Date",1,"align-left",2,"width","80px"],["mat-sort-header","Number",1,"align-left",2,"width","120px"],[4,"ngIf"],["mat-sort-header","CustomerName",1,"align-left"],["mat-sort-header","SalesPerson",1,"align-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","60px"],["mat-sort-header","UnitCost","style","width: 120px","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"d-sm-block","mt-2"],["api","Report/ProductSalesByInvoiceCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["mat-sort-header","SerialBatchNumber",1,"align-left"],["mat-sort-header","UnitCost","arrowPosition","before",1,"flex-right",2,"width","120px"],["target","_blank",3,"routerLink","queryParams"],[1,"w-100"],["routerLink","/menu/Contacts/Contact/Customers/Info","target","_blank",1,"d-block",3,"queryParams"],["matTooltipPosition","above",1,"opacity-75","d-inline",3,"matTooltip"],[1,"text-end"],["class","text-end",4,"ngIf"],[1,"table-footer"],[1,"text-end","empty-column",3,"colSpan"],["class","empty-column",4,"ngIf"],[1,"empty-column"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),h("textChange",function(P){return u(l),x(t.pageData.Filter.Number,P)||(t.pageData.Filter.Number=P),_(P)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,Ny,3,0,"a",2),n(3,"a",3),p(4,"Group by Product"),a()(),n(5,"filters"),g(6,Ay,28,16,"ng-template",null,0,M),a(),n(8,"content"),g(9,Ky,27,6,"div",4),a()()}o&2&&(m("pageData",t.menuData),C("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService.global.Export),r(),m("routerLink",b(7,ky)),r(6),m("ngIf",t.data))},dependencies:[N,j,k,A,K,Ge,O,L,le,ae,ge,He,Le,bt,fe,Q,Qe,re,te,ee],encapsulation:2})};var zy=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],Xy=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],Zy=()=>["/menu/Contacts/Contact/Customers/Info"],Jy=i=>({ID:i}),Io=(i,c)=>({"text-danger":i,"text-success":c});function $y(i,c){if(i&1){let e=F();n(0,"a",10),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",11),p(2," Export "),a()}}function e2(i,c){if(i&1){let e=F();n(0,"div",12)(1,"h6"),p(2,"Brand"),a(),n(3,"ng-select",13),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ListBrandID,t)||(l.pageData.Filter.ListBrandID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",14),h("dateChange",function(t){u(e);let l=s();return x(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",15)(9,"datepicker",16),h("dateChange",function(t){u(e);let l=s();return x(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,"Row Count"),a(),n(12,"input",17),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("multiple",!0),C("ngModel",e.pageData.Filter.ListBrandID),m("items",e.pageData.Options==null?null:e.pageData.Options.Brand),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),m("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function t2(i,c){i&1&&(n(0,"th",32),p(1,"Total Cost "),a())}function i2(i,c){i&1&&(n(0,"th",33),p(1,"Profit"),a())}function n2(i,c){if(i&1&&(n(0,"td",44),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.TotalCost?e.TotalCost:0),"")}}function a2(i,c){if(i&1&&(n(0,"td",45),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",de(4,Io,e.Profit<0,e.Profit>0)),r(),v(" ",f(2,2,e.Profit),"")}}function r2(i,c){if(i&1&&(n(0,"tr")(1,"td",39),p(2),a(),n(3,"td",40),p(4),d(5,"quantityFraction"),a(),n(6,"td",41),p(7),d(8,"amountFraction"),a(),g(9,n2,3,3,"td",42)(10,a2,3,7,"td",43),a()),i&2){let e=c.$implicit,o=s(3);r(2),v("",e.BrandName," "),r(2),v(" ",f(5,5,e.Quantity?e.Quantity:0),""),r(3),v(" ",f(8,7,e.TotalSales?e.TotalSales:0),""),r(2),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.report.Profit)}}function o2(i,c){if(i&1&&(n(0,"tr",34)(1,"td")(2,"a",35),p(3),a()(),n(4,"td",22),p(5),a(),n(6,"td",23),p(7),a(),n(8,"td",24),p(9),a(),n(10,"td",36)(11,"table",37),g(12,r2,11,9,"tr",38),a()()()),i&2){let e=c.$implicit;r(2),m("routerLink",b(8,Zy))("queryParams",U(9,Jy,e.CustomerID)),r(),Kt(" ",e.Name," ",e.Title," "),r(2),w(e.Email),r(2),w(e.Mobile),r(2),w(e.City),r(3),m("ngForOf",e.Detail)}}function l2(i,c){if(i&1&&(n(0,"td",51),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);r(),v(" ",f(2,1,e.data.Total.TotalCost)," ")}}function p2(i,c){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(4,Io,e.data.Total.Profit<0,e.data.Total.Profit>0)),r(),v(" ",f(2,2,e.data.Total.Profit)," ")}}function m2(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",46),I(2,"td",47),n(3,"td",48),p(4),d(5,"quantityFraction"),a(),n(6,"td",48),p(7),d(8,"amountFraction"),a(),g(9,l2,3,3,"td",49)(10,p2,3,7,"td",50),a()()),i&2){let e=s(2);r(4),v(" ",f(5,4,e.data.Total.Quantity)," "),r(3),v(" ",f(8,6,e.data.Total.TotalSales)," "),r(2),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.report.Profit)}}function s2(i,c){if(i&1){let e=F();n(0,"div",18)(1,"table",19),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",20)(3,"tr")(4,"th",21),p(5,"Customer "),a(),n(6,"th",22),p(7,"Email"),a(),n(8,"th",23),p(9,"Mobile"),a(),n(10,"th",24),p(11,"City"),a(),n(12,"th",25),p(13,"Brand"),a(),n(14,"th",26),p(15," Qty "),a(),n(16,"th",27),p(17,"Total Sales "),a(),g(18,t2,2,0,"th",28)(19,i2,2,0,"th",29),a()(),n(20,"tbody"),g(21,o2,13,11,"tr",30),a(),g(22,m2,11,8,"tfoot",31),a()()}if(i&2){let e=s();r(18),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.report.Profit),r(2),m("ngForOf",e.data.Data),r(),m("ngIf",e.data)}}var fa=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/CustomerBrand","ReportLoader/CustomerBrand");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),S);case"Quantity":return this.compare(t.Quantity,l.Quantity,S);default:return 0}}),this.data.Detail=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"SalesNTax":return this.compare(t.TotalSales,l.TotalSales,S);case"Cost":return this.compare(t.TotalCost,l.TotalCost,S);case"Profit":return this.compare(t.Profit,l.Profit,S);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Brand Sales Analysis",exportTypes:[{ID:"ReportExport/CustomerBrand",Value:"Default",FileName:"Brand Sales Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"SalesReport/CustomerBrandCount",pagination:!0}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-brand-sales-analysis"]],standalone:!1,features:[R],decls:20,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],["api","SalesReport/CustomerBrandCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Brand",1,"ng-select-multiple",3,"ngModelChange","multiple","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name","text","Customer",1,"align-left",2,"width","280px"],[2,"width","190px"],[2,"width","155px"],[2,"width","130px"],[2,"min-width","124px"],["mat-sort-header","Quantity","text","Qty",1,"align-left","text-end",2,"min-width","66px"],["mat-sort-header","SalesNTax","text","Total Sales","arrowPosition","before",1,"flex-right","text-end",2,"min-width","112px"],["mat-sort-header","Cost","text","Total Cost","arrowPosition","before","class","flex-right text-end","style","min-width: 113px",4,"ngIf"],["mat-sort-header","Profit","text","Profit","arrowPosition","before","class","flex-right text-end","style","min-width: 114px",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[4,"ngIf"],["mat-sort-header","Cost","text","Total Cost","arrowPosition","before",1,"flex-right","text-end",2,"min-width","113px"],["mat-sort-header","Profit","text","Profit","arrowPosition","before",1,"flex-right","text-end",2,"min-width","114px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["colspan","5",1,"p-0"],[1,"w-100","border-top-0"],[4,"ngFor","ngForOf"],[1,"border-top-0","text-start",2,"min-width","124px"],[1,"border-top-0","text-end",2,"min-width","66px"],[1,"border-top-0","text-end",2,"min-width","112px"],["class","border-top-0 text-end text-danger","style","min-width: 113px",4,"ngIf"],["class","border-top-0 text-end","style","min-width: 114px",3,"ngClass",4,"ngIf"],[1,"border-top-0","text-end","text-danger",2,"min-width","113px"],[1,"border-top-0","text-end",2,"min-width","114px",3,"ngClass"],[1,"footer"],["colspan","5"],[1,"text-end"],["class","text-end text-danger",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,$y,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Brand "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()()()()(),n(13,"filters"),g(14,e2,13,7,"ng-template",null,0,M),a(),n(16,"content")(17,"div",7),g(18,s2,23,4,"div",8),n(19,"POS-complex-pagination",9),T("jumpToPage",function(){return u(l),_(t.getListData())})("previousPage",function(){return u(l),_(t.getListData())})("nextPage",function(){return u(l),_(t.getListData())}),a()()()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(6),m("routerLink",b(10,zy)),r(3),m("routerLink",b(11,Xy)),r(7),m("ngIf",t.data),r(),m("total",t.data.TransactionCount)("pageData",t.pageData))},dependencies:[N,Ae,j,k,A,z,K,Ge,O,L,ae,ge,He,bt,X,Z],encapsulation:2})};var c2=(i,c)=>({rankDown:i,rankUp:c,"number key":!0}),d2=()=>["/menu/Reports/Sales_Report/Standard/Detail"],u2=(i,c,e)=>({From:i,To:c,TypeID:e}),bo=(i,c)=>({"text-warning":i,"text-success":c,"text-end":!0}),xa=(i,c)=>({"text-danger":i,"text-success":c});function _2(i,c){if(i&1){let e=F();n(0,"button",4),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export"),a()}}function g2(i,c){if(i&1){let e=F();se(0),n(1,"h6"),p(2,"Year - Month"),a(),n(3,"div",14)(4,"div",15)(5,"ng-select",16),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.Year,t)||(l.Year=t),_(t)}),T("change",function(){u(e);let t=s(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(2);return _(t.Year=null)}),a()(),n(6,"div",17)(7,"ng-select",18),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.Month,t)||(l.Month=t),_(t)}),T("change",function(){u(e);let t=s(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=s(2);return _(t.Month=null)}),a()()(),ce()}if(i&2){let e=s(2);r(5),C("ngModel",e.Year),m("items",e.Years),r(2),C("ngModel",e.Month),m("items",e.Months)}}function f2(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=s();return x(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 Order Tag"),a(),n(6,"ng-select",8),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",9),h("dateChange",function(t){u(e);let l=s();return x(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",10)(12,"datepicker",11),h("dateChange",function(t){u(e);let l=s();return x(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,"Compare with Prev Month"),a(),n(15,"radio-options",12),h("modelChange",function(t){u(e);let l=s();return x(l.isCompare,t)||(l.isCompare=t),_(t)}),a(),g(16,g2,8,4,"ng-container",13),a()}if(i&2){let e=s();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("model",e.isCompare),r(),m("ngIf",e.isCompare)}}function C2(i,c){i&1&&(n(0,"th",45),p(1,"Prev"),a())}function x2(i,c){i&1&&(n(0,"th",46),p(1,"Now"),a())}function h2(i,c){i&1&&(n(0,"th",47),p(1," Trans "),a())}function S2(i,c){i&1&&(n(0,"th",48),p(1,"Qty"),a())}function y2(i,c){i&1&&(n(0,"th",49),p(1,"Tax"),a())}function D2(i,c){if(i&1&&(n(0,"th",50),p(1," Sales + Tax "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function v2(i,c){i&1&&(n(0,"th",39),p(1,"\xB1 (%)"),a())}function w2(i,c){i&1&&(n(0,"th",51),p(1,"Cost"),a())}function T2(i,c){if(i&1&&(n(0,"th",50),p(1," Profit "),a()),i&2){let e=s(2);m("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function P2(i,c){i&1&&(n(0,"th",52),p(1," Target "),a())}function F2(i,c){i&1&&(n(0,"th",53),p(1," Ach(%) "),a())}function I2(i,c){if(i&1&&(n(0,"td",39),p(1),a()),i&2){let e=s().$implicit;r(),w(e.PrevIndex)}}function b2(i,c){if(i&1&&(n(0,"td",55),p(1),a()),i&2){let e=s(),o=e.$implicit,t=e.index;m("ngClass",de(2,c2,o.PrevIndex<t+1,o.PrevIndex>t+1)),r(),v(" ",o.CurrentIndex," ")}}function E2(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;r(),w(f(2,1,e.Quantity))}}function M2(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;r(),w(y(2,1,e.Count,".0-0"))}}function V2(i,c){if(i&1&&(n(0,"td",56),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Tax)," ")}}function B2(i,c){if(i&1&&(n(0,"td",39)(1,"a",57),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=s().$implicit,o=s(2);r(),m("routerLink",b(11,d2))("queryParams",st(12,u2,y(2,3,o.pageData.Filter.From,"ddMMyyyy"),y(3,6,o.pageData.Filter.To,"ddMMyyyy"),e.TypeID)),r(4),w(f(6,9,e.SalesWithTax))}}function O2(i,c){if(i&1&&(n(0,"td",58),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",de(4,bo,e.IsNegative,e.IsPositive)),r(),v(" ",f(2,2,e.Increase)," ")}}function L2(i,c){if(i&1&&(n(0,"td",59),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Cost)," ")}}function R2(i,c){if(i&1&&(n(0,"td",60),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit,o=s(2);r(),v(" ",f(2,1,o.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function k2(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.SalesTarget)," ")}}function W2(i,c){if(i&1&&(n(0,"span",58),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;m("ngClass",de(4,xa,e.Achievement<0,e.Achievement>0)),r(),v(" ",f(2,2,e.Achievement)," ")}}function N2(i,c){if(i&1&&(n(0,"span",58),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2).$implicit;m("ngClass",de(4,xa,e.AchievementWithTax<0,e.AchievementWithTax>0)),r(),v(" ",f(2,2,e.AchievementWithTax)," ")}}function A2(i,c){if(i&1&&(n(0,"td",39),g(1,W2,3,7,"span",42)(2,N2,3,7,"span",42),a()),i&2){let e=s(3);r(),m("ngIf",!e.pageData.IgnoreTax),r(),m("ngIf",e.pageData.IgnoreTax)}}function G2(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",37),p(4),a(),g(5,I2,2,1,"td",31)(6,b2,2,5,"td",54)(7,E2,3,3,"td",31)(8,M2,3,4,"td",31),n(9,"td",39),p(10),d(11,"amountFraction"),a(),g(12,V2,3,3,"td",40),d(13,"HideSumZero"),g(14,B2,7,16,"td",31)(15,O2,3,7,"td",42)(16,L2,3,3,"td",43)(17,R2,3,3,"td",44)(18,k2,3,3,"td",31),d(19,"HideSumZero"),g(20,A2,3,2,"td",31),d(21,"HideSumZero"),d(22,"HideSumZero"),a()),i&2){let e=c.$implicit,o=c.index,t=s(2);r(2),w(o+1),r(2),w(e.Name),r(),m("ngIf",t.showCompareColumn),r(),m("ngIf",t.showCompareColumn),r(),m("ngIf",t.data.WithCategory),r(),m("ngIf",!t.data.WithCategory),r(2),w(f(11,14,e.SalesNet)),r(2),m("ngIf",!t.data.WithCategory&&y(13,16,t.data.Data,"Tax")),r(2),m("ngIf",!t.data.WithCategory),r(),m("ngIf",t.showCompareColumn),r(),m("ngIf",t.roleService.product.Cost),r(),m("ngIf",t.roleService.report.Profit),r(),m("ngIf",y(19,19,t.data.Data,"SalesTarget")),r(2),m("ngIf",y(21,22,t.roleService.report.Profit&&t.data.Data,"AchievementWithTax")||y(22,25,t.data.Data,"Achievement"))}}function H2(i,c){i&1&&I(0,"td",61)}function Q2(i,c){i&1&&I(0,"td",61)}function j2(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=s(2);r(),v(" ",y(3,4,y(2,1,e.data.Data,"Count"),".0-0")," ")}}function Y2(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Quantity"))," ")}}function q2(i,c){if(i&1&&(n(0,"td",56),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Tax"))," ")}}function U2(i,c){if(i&1&&(n(0,"td",62)(1,"a",63),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(2);r(2),w(f(4,4,y(3,1,e.data.Data,"SalesWithTax")))}}function K2(i,c){if(i&1&&(n(0,"td",58),p(1),d(2,"number"),a()),i&2){let e=s(2);m("ngClass",de(5,bo,e.comparation<0,e.comparation>0)),r(),v(" ",y(2,2,e.comparation,".0-0")," ")}}function z2(i,c){if(i&1&&(n(0,"td",59),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Cost"))," ")}}function X2(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);r(),w(f(3,4,y(2,1,e.data.Data,"Profit")))}}function Z2(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);r(),v(" ",f(3,4,y(2,1,e.data.Data,"ProfitWithTax"))," ")}}function J2(i,c){if(i&1&&(n(0,"td",60),g(1,X2,4,6,"span",13)(2,Z2,4,6,"span",13),a()),i&2){let e=s(2);r(),m("ngIf",e.pageData.IgnoreTax),r(),m("ngIf",!e.pageData.IgnoreTax)}}function $2(i,c){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(3,4,y(2,1,e.data.Data,"Expense"))," ")}}function eD(i,c){if(i&1&&(n(0,"span",58),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(22,xa,y(1,2,e.data.Data,"Sales")/y(2,5,e.data.Data,"SalesTarget")<0,y(3,8,e.data.Data,"Sales")/y(4,11,e.data.Data,"SalesTarget")>0)),r(5),v(" ",f(8,20,y(6,14,e.data.Data,"Sales")/y(7,17,e.data.Data,"SalesTarget"))," ")}}function tD(i,c){if(i&1&&(n(0,"span",58),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",de(22,xa,y(1,2,e.data.Data,"SalesWithTax")/y(2,5,e.data.Data,"SalesTarget")<0,y(3,8,e.data.Data,"SalesWithTax")/y(4,11,e.data.Data,"SalesTarget")>0)),r(5),v(" ",f(8,20,y(6,14,e.data.Data,"SalesWithTax")/y(7,17,e.data.Data,"SalesTarget"))," ")}}function iD(i,c){if(i&1&&(n(0,"td",39),g(1,eD,9,25,"span",42)(2,tD,9,25,"span",42),a()),i&2){let e=s(2);r(),m("ngIf",!e.pageData.IgnoreTax),r(),m("ngIf",e.pageData.IgnoreTax)}}function nD(i,c){if(i&1){let e=F();n(0,"div",19)(1,"div",20)(2,"table",21),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",22)(4,"tr")(5,"th"),p(6,"No."),a(),n(7,"th",23),p(8,"Tag"),a(),g(9,C2,2,0,"th",24)(10,x2,2,0,"th",25)(11,h2,2,0,"th",26)(12,S2,2,0,"th",27),n(13,"th",28),p(14,"Sales"),a(),g(15,y2,2,0,"th",29),d(16,"HideSumZero"),g(17,D2,2,1,"th",30)(18,v2,2,0,"th",31)(19,w2,2,0,"th",32)(20,T2,2,1,"th",30)(21,P2,2,0,"th",33),d(22,"HideSumZero"),g(23,F2,2,0,"th",34),d(24,"HideSumZero"),d(25,"HideSumZero"),a()(),n(26,"tbody"),g(27,G2,23,28,"tr",35),a(),n(28,"tfoot")(29,"tr",36),I(30,"td")(31,"td",37),g(32,H2,1,0,"td",38)(33,Q2,1,0,"td",38)(34,j2,4,7,"td",31)(35,Y2,4,6,"td",31),n(36,"td",39),p(37),d(38,"sum"),d(39,"amountFraction"),a(),g(40,q2,4,6,"td",40),d(41,"HideSumZero"),g(42,U2,5,6,"td",41)(43,K2,3,8,"td",42)(44,z2,4,6,"td",43)(45,J2,3,2,"td",44)(46,$2,4,6,"td",31),d(47,"HideSumZero"),g(48,iD,3,2,"td",31),d(49,"HideSumZero"),d(50,"HideSumZero"),a()()()()()}if(i&2){let e=s();r(9),m("ngIf",e.showCompareColumn),r(),m("ngIf",e.showCompareColumn),r(),m("ngIf",!e.data.WithCategory),r(),m("ngIf",e.data.WithCategory),r(3),m("ngIf",!e.data.WithCategory&&y(16,24,e.data.Data,"Tax")),r(2),m("ngIf",!e.data.WithCategory),r(),m("ngIf",e.showCompareColumn),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.report.Profit),r(),m("ngIf",y(22,27,e.data.Data,"SalesTarget")),r(2),m("ngIf",y(24,30,e.data.Data,"AchievementWithTax")||y(25,33,e.data.Data,"Achievement")&&e.roleService.report.Profit),r(4),m("ngForOf",e.data.Data),r(5),m("ngIf",e.showCompareColumn),r(),m("ngIf",e.showCompareColumn),r(),m("ngIf",!e.data.WithCategory),r(),m("ngIf",e.data.WithCategory),r(2),v(" ",f(39,39,y(38,36,e.data.Data,"SalesNet"))," "),r(3),m("ngIf",!e.data.WithCategory&&y(41,41,e.data.Data,"Tax")),r(2),m("ngIf",!e.data.WithCategory),r(),m("ngIf",e.showCompareColumn),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.report.Profit),r(),m("ngIf",e.roleService.product.Expense&&y(47,44,e.data.Data,"Expense")),r(2),m("ngIf",y(49,47,e.roleService.report.Profit&&e.data.Data,"AchievementWithTax")||y(50,50,e.data.Data,"Achievement"))}}var Ca=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/OutletPerformanceByType","ReportLoader/OutletPerformance");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S;let P=new Date;this.Year=P.getFullYear(),this.Month=P.getMonth()}isCompare=!1;showCompareColumn=!1;DateFilterType=!1;Year;Month;Months=[{ID:0,Label:"Jan"},{ID:1,Label:"Feb"},{ID:2,Label:"Mar"},{ID:3,Label:"Apr"},{ID:4,Label:"May"},{ID:5,Label:"Jun"},{ID:6,Label:"Jul"},{ID:7,Label:"Aug"},{ID:8,Label:"Sep"},{ID:9,Label:"Oct"},{ID:10,Label:"Nov"},{ID:11,Label:"Dec"}];Years=V.GenerateYears(new Date().getFullYear(),11,!0);RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];postInit(e){this.originalData=e.Data,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1).toDateString(),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0).toDateString()}sortData(e){let o=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,S);case"Count":return this.compare(t.Count,l.Count,S);case"Quantity":return this.compare(t.Quantity,l.Quantity,S);case"Gross":return this.compare(t.Gross,l.Gross,S);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,S);case"SalesTaxNet":return this.compare(t.SalesNet,l.SalesNet,S);case"Tax":return this.compare(t.Tax,l.Tax,S);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,S);case"Cost":return this.compare(t.Cost,l.Cost,S);case"Profit":return this.compare(t.Profit,l.Profit,S);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,S);case"Expense":return this.compare(t.Expense,l.Expense,S);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,S);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,S);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,S);case"Achievement":return this.compare(t.Achievement,l.Achievement,S);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Sales Order Tag",exportTypes:[{ID:"ReportExport/OutletPerformanceByType",Value:"Default",FileName:"Sales Order Tag"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-by-sales-order-type"]],standalone:!1,features:[R],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Compare",3,"modelChange","model"],[4,"ngIf"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["style","width: 35px;","class","text-end","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["style","width: 35px;","class","text-end","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","class","flex-left","arrowPosition","before",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","align-left",4,"ngIf"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-left"],["mat-sort-header","Tax","arrowPosition","before","class","flex-left",4,"ngIf"],["arrowPosition","before","class","flex-left",3,"mat-sort-header",4,"ngIf"],["class","text-end",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before","class","flex-left",4,"ngIf"],["mat-sort-header","Target","arrowPosition","before","class","align-left",4,"ngIf"],["mat-sort-header","Achievement","arrowPosition","before","class","align-left","matTooltipPosition","above","matTooltip","Achievement",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"text-end"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"align-left"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left"],["arrowPosition","before",1,"flex-left",3,"mat-sort-header"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left"],["mat-sort-header","Target","arrowPosition","before",1,"align-left"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"align-left"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],[1,"text-end","text-warning-emphasis"],[3,"routerLink","queryParams"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"empty-column"],[1,"text-end","text-primary"],[1,"fw-bold"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,_2,3,0,"button",2),a(),n(3,"filters"),g(4,f2,17,10,"ng-template",null,0,M),a(),n(6,"content"),g(7,nD,51,53,"div",3),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService.global.Export),r(5),m("ngIf",t.data))},dependencies:[N,Ae,j,k,A,z,K,O,L,le,ae,ge,we,Q,re,ei,te,ee,X,Z],encapsulation:2})};var Eo=Ut(zr()),Mo=Ut(Qa());function aD(i,c){if(i&1){let e=F();n(0,"div",4)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",5),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Date From - To"),a(),n(6,"div",6)(7,"div",7)(8,"datepicker",8),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(9,"div",7)(10,"datepicker",9),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()(),n(11,"h6"),p(12,"Price Range"),a(),n(13,"input",10),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.PriceRange,t)||(l.pageData.Filter.PriceRange=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),C("ngModel",e.pageData.Filter.ListIDs),r(5),C("ngModel",e.pageData.Filter.From),m("showClearBtn",!0)("showTodayBtn",!0),r(2),C("ngModel",e.pageData.Filter.To),m("showClearBtn",!0)("showTodayBtn",!0),r(3),C("ngModel",e.pageData.Filter.PriceRange)}}function rD(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 oD(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),d(4,"number"),a(),n(5,"td",23),p(6),d(7,"quantityFraction"),a(),n(8,"td",23),p(9),d(10,"quantityFraction"),a()()),i&2){let e=c.$implicit;r(2),Kt(" ",f(3,4,e.KeyValue.Key.StartNumber)," - ",f(4,6,e.KeyValue.Key.EndNumber)," "),r(4),v(" ",e.KeyValue.Value!=0?f(7,8,e.KeyValue.Value):"-"," "),r(3),w(f(10,10,e.Sales))}}function lD(i,c){if(i&1&&(n(0,"div",13)(1,"div",6)(2,"div",7)(3,"table",14)(4,"thead",15)(5,"tr",16)(6,"th",17),p(7,"Price"),a(),n(8,"th",18),p(9,"Qty"),a(),n(10,"th"),p(11,"Sales"),a()()(),n(12,"tbody"),g(13,oD,11,12,"tr",19),a()()(),n(14,"div",7)(15,"div",20)(16,"div",21),I(17,"highcharts-chart",22),a()()()()()),i&2){let e=s();r(13),m("ngForOf",e.data.Data),r(4),m("Highcharts",e.Highcharts)("options",e.chartOptions())}}(0,Mo.default)(Eo);var Sa=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/UnitPriceAnalysis","ReportLoader/PriceAnalysis",void 0,void 0,!0);this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}Highcharts=Eo;chartOptions=Ct(null);openExportModal(){this.matDialog.open(q,{data:{title:"Price Analysis",exportTypes:[{ID:"ReportExport/PriceAnalysis",Value:"Default",FileName:"Price Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){super.postInit(e),this.chartOptions.set({chart:{type:"pie",style:{fontFamily:'"Roboto-Slab", sans-serif'}},title:{text:"Price Analysis Chart"},credits:{enabled:!1},tooltip:{headerFormat:"",pointFormat:'<span style="color:{point.color}">\u25CF</span> {point.name}: <b>{point.y:.1f}</b>'},plotOptions:{pie:{allowPointSelect:!0,borderWidth:2,cursor:"pointer",dataLabels:{enabled:!0,format:"<b>{point.name}</b><br>{point.y}",distance:20},showInLegend:!0}},series:[{type:"pie",data:[...e.PieChartData.map(o=>({name:o.Name,y:o.Qty}))]}]})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-price-analysis"]],standalone:!1,features:[R],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"row"],[1,"col-6"],["appearance","outline","name","From",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["appearance","outline","name","To",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","table-bordered"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","250px"],[2,"width","150px"],[4,"ngFor","ngForOf"],[1,"card"],[1,"card-body"],[2,"width","100%","height","400px","display","block",3,"Highcharts","options"],[1,"text-end"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"filters"),g(2,aD,14,11,"ng-template",null,0,M),a(),n(4,"actions"),g(5,rD,3,0,"button",2),a(),n(6,"content"),g(7,lD,18,3,"div",3),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(5),m("ngIf",t.roleService.global.Export),r(2),m("ngIf",t.data))},dependencies:[N,j,k,K,Ge,O,L,He,Q,$r,te,Z],encapsulation:2})};var pD=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Vo=i=>({ID:i});function mD(i,c){if(i&1){let e=F();n(0,"button",4),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function sD(i,c){if(i&1){let e=F();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",8),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",9)(10,"datepicker",10),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Tax"),a(),n(13,"ng-select",11),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(14,"h6"),p(15,"Page Size"),a(),n(16,"input",12),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=s();r(4),m("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),r(3),m("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function cD(i,c){i&1&&(n(0,"th",38),p(1," Purchase "),a())}function dD(i,c){i&1&&(n(0,"th",39),p(1," Tax "),a())}function uD(i,c){if(i&1&&I(0,"th",40),i&2){let e=c.$implicit;m("innerHtml",e.Label+" ("+e.Rate+"%)",Pe)}}function _D(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Sales)," ")}}function gD(i,c){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Tax)," ")}}function fD(i,c){if(i&1&&(I(0,"td",48),d(1,"TaxDefault"),d(2,"number")),i&2){let e=c.index,o=s().$implicit,t=s(2);m("innerHtml",f(2,5,di(1,1,t.data.Compenents,o,e)),Pe)}}function CD(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",41),p(5),a()(),n(6,"td")(7,"a",42),p(8),a()(),n(9,"td"),p(10),a(),n(11,"td"),p(12),d(13,"date"),a(),g(14,_D,3,3,"td",43)(15,gD,3,3,"td",44)(16,fD,3,7,"td",45),a()),i&2){let e=c.$implicit,o=s(2);r(2),w(e.EntityName),r(2),m("routerLink",b(14,pD))("queryParams",U(15,Vo,e.ID)),r(),w(e.Number),r(2),m("queryParams",U(17,Vo,e.SupplierID)),r(),v(" ",e.Name," "),r(2),w(e.TaxName),r(2),w(y(13,11,e.Date,"dd MMM yyyy")),r(2),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.product.Cost),r(),m("ngForOf",o.getComponent(o.data))}}function xD(i,c){if(i&1&&(n(0,"td",49)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(2);r(2),w(f(4,4,y(3,1,e.infiniteList,"Sales")))}}function hD(i,c){if(i&1&&(n(0,"td",49)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(2);r(2),w(f(4,4,y(3,1,e.infiniteList,"Tax")))}}function SD(i,c){if(i&1&&(n(0,"td",50),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;r(),v(" ",f(2,1,e.SumTaxAmount)," ")}}function yD(i,c){if(i&1){let e=F();n(0,"span",51),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport"))}),n(1,"i",52),p(2,"?"),a()()}}function DD(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);r(),w(f(2,1,e.listTotal))}}function vD(i,c){if(i&1){let e=F();n(0,"a",53),T("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),I(1,"i",54),p(2," Next"),a()}}function wD(i,c){if(i&1){let e=F();n(0,"a",55),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport",!0))}),I(1,"i",56),p(2," Show All"),a()}}function TD(i,c){if(i&1){let e=F();n(0,"div",13)(1,"div",14)(2,"table",15),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",16)(4,"tr")(5,"th",17),p(6,"Outlet"),a(),n(7,"th",18),p(8,"Number"),a(),n(9,"th",19),p(10,"Supplier"),a(),n(11,"th",20),p(12," Type "),a(),n(13,"th",21),p(14,"Date"),a(),g(15,cD,2,0,"th",22)(16,dD,2,0,"th",23)(17,uD,1,1,"th",24),a()(),n(18,"tbody"),g(19,CD,17,19,"tr",25),a(),n(20,"tfoot")(21,"tr",26),I(22,"td",27),g(23,xD,5,6,"td",28)(24,hD,5,6,"td",28)(25,SD,3,3,"td",29),a()()()(),n(26,"div",30)(27,"div",31)(28,"div",32),p(29),d(30,"number"),g(31,yD,3,0,"span",33)(32,DD,3,3,"span",34),p(33),a()(),n(34,"div",35),g(35,vD,3,0,"a",36)(36,wD,3,0,"a",37),a()()()}if(i&2){let e=s();r(15),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngForOf",e.data.Compenents),r(2),m("ngForOf",e.infiniteList),r(4),m("ngIf",e.roleService.product.Cost),r(),m("ngIf",e.roleService.product.Cost),r(),m("ngForOf",e.data.Compenents),r(4),v(" Showing 1 - ",f(30,13,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),r(2),m("ngIf",!e.pageData.HideStoreApiCount),r(),m("ngIf",e.pageData.HideStoreApiCount),r(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),r(2),m("ngIf",e.nextPageDisabled&&!e.goToLast),r(),m("ngIf",e.nextPageDisabled&&!e.goToLast)}}var ya=class i extends Ji{constructor(e,o,t,l,S,P){super(e,o,"Report/GetPurchaseTaxReport","ReportLoader/GetTaxReport",t);this.httpService=o;this.csvConverter=l;this.roleService=S;this.matDialog=P}openExportModal(){this.matDialog.open(q,{data:{title:"Purchase Tax Report",exportTypes:[{ID:"ReportExport/GetPurchaseTaxReport",Value:"Default",FileName:"Purchase Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountPurchaseTaxReport",pagination:!0}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((o,t)=>{e.Tax!=0?(o.TaxTax=t==0?e.Tax:this.data.Compenents[t-1].TaxTax,o.TaxTax=t==0?o.TaxTax:o.TaxTax+o.TaxTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=o.TaxTax*o.Rate/100,o.SumTaxAmount=o.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),S);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),S);case"Number":return this.compare(t.Number,l.Number,S);case"Date":return this.compare(t.Date,l.Date,S);case"Tax":return this.compare(t.Tax,l.Tax,S);default:return 0}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(Ke),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["POS-purchase-tax-report"]],standalone:!1,features:[R],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["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"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["style","width: 150px","mat-sort-header","Sales","arrowPosition","before","class","flex-right",4,"ngIf"],["style","width: 150px","mat-sort-header","Tax","arrowPosition","before","class","flex-right text-end","matTooltip","Tax Amount",4,"ngIf"],["style","width: 150px","class","align-right text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],["class","text-end text-success",4,"ngIf"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load next page",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],["routerLink","/menu/Contacts/Contact/Suppliers/Info","target","_blank",3,"queryParams"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end","text-success"],[1,"text-end",2,"width","150px"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),h("textChange",function(P){return u(l),x(t.pageData.Filter.Number,P)||(t.pageData.Filter.Number=P),_(P)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,mD,3,0,"button",2),a(),n(3,"filters"),g(4,sD,17,10,"ng-template",null,0,M),a(),n(6,"content"),g(7,TD,37,15,"div",3),a()()}o&2&&(m("pageData",t.menuData),C("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService.global.Export),r(5),m("ngIf",t.data))},dependencies:[N,j,k,A,z,K,Ge,O,L,le,ae,ge,He,Q,re,fi,te,ee,X],encapsulation:2})};var PD=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],FD=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"];function ID(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=s();return x(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",9),h("dateChange",function(t){u(e);let l=s();return x(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",10)(9,"datepicker",11),h("dateChange",function(t){u(e);let l=s();return x(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();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function bD(i,c){if(i&1&&(n(0,"div",12),I(1,"POS-pie-chart",13),a()),i&2){let e=s();r(),m("config",e.chartConfig)("data",e.chartData)}}var Da=class i extends he{constructor(e,o,t){super(e,o,"Report/BrandRank","ReportLoader/BrandRank",null,t);this.httpService=o}chartData;chartConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};postInit(){this.menuData.H=this.data.PageTitle,this.initChartSeries()}initChartSeries(){let e=[];this.data?.Data?.forEach(o=>{let t={name:o.BrandName,y:o.Total};e.push(t)}),this.chartData=e}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(Oe))};static \u0275cmp=E({type:i,selectors:[["app-top-brand-chart"]],standalone:!1,features:[R],decls:17,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),h("textChange",function(P){return u(l),x(t.pageData.Filter.Number,P)||(t.pageData.Filter.Number=P),_(P)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Top Brand "),a()(),n(9,"li")(10,"a",5),p(11," Brand Sales Analysis "),a()()()()(),n(12,"filters"),g(13,ID,10,6,"ng-template",null,0,M),a(),n(15,"content"),g(16,bD,2,2,"div",6),a()()}o&2&&(m("pageData",t.menuData),C("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(7),m("routerLink",b(7,PD)),r(3),m("routerLink",b(8,FD)),r(6),m("ngIf",t.data))},dependencies:[N,k,A,K,O,L,ii,Q],encapsulation:2})};var ED=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],vi=i=>[i],Bo=(i,c)=>({"text-danger":i,"text-success":c});function MD(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 VD(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),T("dateChange",function(t){u(e);let l=s();return _(l.onChangeFilterDate1(t))}),a(),n(13,"h6"),p(14,"Compare With"),a(),n(15,"app-datepicker-range",11),T("dateChange",function(t){u(e);let l=s();return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=s();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),m("multiple",!0),C("ngModel",e.pageData.Filter.SalesOrderTagIDs),m("items",e.pageData.Options==null?null:e.pageData.Options.SalesOrderTags),r(3),m("from",e.pageData.Filter.From_range1)("to",e.pageData.Filter.To_range1),r(3),m("from",e.pageData.Filter.From_range2)("to",e.pageData.Filter.To_range2)}}function BD(i,c){if(i&1&&(n(0,"th",29),p(1),a()),i&2){let e=s(2);r(),v(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function OD(i,c){if(i&1&&(n(0,"th",30),p(1),a()),i&2){let e=s(2);r(),v(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function LD(i,c){i&1&&(n(0,"th",31),p(1," Profit "),a())}function RD(i,c){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.NetProfit1)," ")}}function kD(i,c){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.NetProfit2)," ")}}function WD(i,c){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",de(4,Bo,e.Growth<0,e.Growth>0)),r(),v(" ",f(2,2,e.Growth),"% ")}}function ND(i,c){if(i&1&&(n(0,"tr")(1,"td",32),p(2),a(),n(3,"td",33),p(4),d(5,"amountFraction"),a(),g(6,RD,3,3,"td",34),n(7,"td",33),p(8),d(9,"amountFraction"),a(),g(10,kD,3,3,"td",34),n(11,"td",35),p(12),d(13,"amountFraction"),a(),g(14,WD,3,7,"td",36),a()),i&2){let e=c.$implicit,o=s(2);r(2),w(e.EntityName),r(),m("colSpan",o.roleService.report.Profit?1:2),r(),v(" ",f(5,10,e.SalesNTax1)," "),r(2),m("ngIf",o.roleService.report.Profit),r(),m("colSpan",o.roleService.report.Profit?1:2),r(),v(" ",f(9,12,e.SalesNTax2)," "),r(2),m("ngIf",o.roleService.report.Profit),r(),m("ngClass",de(16,Bo,e.Revenue<0,e.Revenue>0)),r(),v(" ",f(13,14,e.Revenue),"% "),r(2),m("ngIf",o.roleService.report.Profit)}}function AD(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",U(4,vi,e.netProfit1Total>0?"text-success":"text-danger")),r(),v(" ",f(2,2,e.netProfit1Total)," ")}}function GD(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",U(4,vi,e.netProfit2Total>0?"text-success":"text-danger")),r(),v(" ",f(2,2,e.netProfit2Total)," ")}}function HD(i,c){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",U(4,vi,e.profitPercentage>0?"text-success":"text-danger")),r(),v(" ",f(2,2,e.profitPercentage),"% ")}}function QD(i,c){if(i&1){let e=F();n(0,"div",12)(1,"table",13),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",14)(3,"tr")(4,"th",15),p(5," Outlet "),a(),n(6,"th",16)(7,"span"),p(8),d(9,"date"),a(),p(10," - "),n(11,"span"),p(12),d(13,"date"),a()(),n(14,"th",17)(15,"span"),p(16),d(17,"date"),a(),p(18," - "),n(19,"span"),p(20),d(21,"date"),a()(),n(22,"th",17),p(23,"YOY Growth"),a()(),n(24,"tr",18)(25,"th",19),p(26),a(),g(27,BD,2,1,"th",20),n(28,"th",21),p(29),a(),g(30,OD,2,1,"th",22),n(31,"th",23),p(32,"Revenue"),a(),g(33,LD,2,0,"th",24),a()(),n(34,"tbody"),g(35,ND,15,19,"tr",25),a(),n(36,"tfoot")(37,"tr"),I(38,"td"),n(39,"td",26),p(40),d(41,"amountFraction"),a(),g(42,AD,3,6,"td",27),n(43,"td",26),p(44),d(45,"amountFraction"),a(),g(46,GD,3,6,"td",27),n(47,"td",28),p(48),d(49,"amountFraction"),a(),g(50,HD,3,6,"td",27),a()()()()}if(i&2){let e=s();r(8),w(y(9,23,e.pageData.Filter.From_range1,"dd MMMM yyyy")),r(4),w(y(13,26,e.pageData.Filter.To_range1,"dd MMMM yyyy")),r(4),w(y(17,29,e.pageData.Filter.From_range2,"dd MMMM yyyy")),r(4),w(y(21,32,e.pageData.Filter.To_range2,"dd MMMM yyyy")),r(5),m("colSpan",e.roleService.report.Profit?1:2),r(),v(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),r(),m("ngIf",e.roleService.report.Profit),r(),m("colSpan",e.roleService.report.Profit?1:2),r(),v(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),r(),m("ngIf",e.roleService.report.Profit),r(3),m("ngIf",e.roleService.report.Profit),r(2),m("ngForOf",e.data),r(4),m("colSpan",e.roleService.report.Profit?1:2)("ngClass",U(41,vi,e.salesNTax1Total>0?"text-success":"text-danger")),r(),v(" ",f(41,35,e.salesNTax1Total)," "),r(2),m("ngIf",e.roleService.report.Profit),r(),m("colSpan",e.roleService.report.Profit?1:2)("ngClass",U(43,vi,e.salesNTax2Total>0?"text-success":"text-danger")),r(),v(" ",f(45,37,e.salesNTax2Total)," "),r(2),m("ngIf",e.roleService.report.Profit),r(),m("ngClass",U(45,vi,e.salesNTaxPercentage>0?"text-success":"text-danger")),r(),v(" ",f(49,39,e.salesNTaxPercentage),"% "),r(2),m("ngIf",e.roleService.report.Profit)}}var va=class i extends ie{constructor(e,o,t,l,S,P){super(t,l,"Report/SalesCompareByRange","ReportLoader/SalesCompareByRange");this.csvConverter=e;this.roleService=o;this.sumPipe=S;this.matDialog=P}salesNTax1Total=0;salesNTax2Total=0;netProfit1Total=0;netProfit2Total=0;salesNTaxPercentage=0;profitPercentage=0;originalData;ngOnInit(){}postInit(e){this.menuData.H="Sales Compare By Outlet",this.salesNTax1Total=this.sumPipe.transform(this.data,"SalesNTax1"),this.salesNTax2Total=this.sumPipe.transform(this.data,"SalesNTax2"),this.netProfit1Total=this.sumPipe.transform(this.data,"NetProfit1"),this.netProfit2Total=this.sumPipe.transform(this.data,"NetProfit2"),this.salesNTaxPercentage=this.calculatePercentage(this.salesNTax1Total,this.salesNTax2Total),this.profitPercentage=this.calculatePercentage(this.netProfit1Total,this.netProfit2Total),this.originalData=e}calculatePercentage(e,o){return(o-e)/e*100}preGetList(){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.PageNumber}onChangeFilterDate1(e){this.pageData.Filter.From_range1=e.from,this.pageData.Filter.To_range1=e.to}onChangeFilterDate2(e){this.pageData.Filter.From_range2=e.from,this.pageData.Filter.To_range2=e.to}sortData(e){let o=this.data.slice();if(!e.active||e.direction===""){this.data=this.originalData;return}this.data=o.sort((t,l)=>{let S=e.direction==="asc";switch(typeof t[e.active]){case"number":return this.compare(t[e.active],l[e.active],S);case"string":return this.compare(t[e.active],l[e.active],S);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Sales Compare by Outlet",exportTypes:[{ID:"ReportExport/SalesCompareByRange",Value:"Default",FileName:"Sales Compare by Outlet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(D(H),D(G),D(W),D(B),D(re),D(Y))};static \u0275cmp=E({type:i,selectors:[["app-sales-compare-by-outlet"]],standalone:!1,features:[R],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","12 Months Compare",1,"btn","btn-outline-secondary",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindValue","ID","bindLabel","Name","placeholder","Choose Sales Order Tag",3,"ngModelChange","multiple","ngModel","items"],[3,"dateChange","from","to"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-header"],["rowspan","2","colspan","1","mat-sort-header","EntityName",1,"border-end","text-center"],["colspan","2",1,"text-center"],["colspan","2",1,"text-center","border-start"],[1,"border-top-2"],["mat-sort-header","SalesNTax1",1,"align-center",3,"colSpan"],["class","align-center border-end","mat-sort-header","NetProfit1",4,"ngIf"],["mat-sort-header","SalesNTax2",1,"align-center",3,"colSpan"],["class","align-center border-end","mat-sort-header","NetProfit2",4,"ngIf"],["mat-sort-header","Revenue",1,"align-center"],["class","align-center","mat-sort-header","Growth",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"text-end",3,"colSpan","ngClass"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],["mat-sort-header","NetProfit1",1,"align-center","border-end"],["mat-sort-header","NetProfit2",1,"align-center","border-end"],["mat-sort-header","Growth",1,"align-center"],[1,"border-start","border-end"],[1,"text-end","border-end",3,"colSpan"],["class","text-end border-end",4,"ngIf"],[1,"text-end","border-end",3,"ngClass"],["class","text-end border-end",3,"ngClass",4,"ngIf"],[1,"text-end","border-end"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,MD,3,0,"button",2),n(3,"a",3),p(4," View Monthly"),a()(),n(5,"filters"),g(6,VD,16,13,"ng-template",null,0,M),a(),n(8,"content"),g(9,QD,51,47,"div",4),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService.global.Export),r(),m("routerLink",b(7,ED)),r(6),m("ngIf",t.data))},dependencies:[N,Ae,j,k,A,z,O,L,le,ae,ge,Nt,fe,Q,ee,X],styles:["thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:60px;z-index:1020}@media only screen and (max-width: 768px){thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1020}}"]})};var jD=()=>["/menu/Reports/Sales_Report/Standard/Yearly/Comparison"];function YD(i,c){if(i&1){let e=F();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",8),h("ngModelChange",function(t){u(e);let l=s();return x(l.currency,t)||(l.currency=t),_(t)}),T("change",function(){u(e);let t=s();return _(t.checkFilterCurrency())}),a()()}if(i&2){let e=s();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.currency),m("items",e.pageData.Options.Currencies)}}function qD(i,c){if(i&1&&(n(0,"div",9),I(1,"POS-line-chart",10),a()),i&2){let e=s();r(),m("config",e.chartConfig)("data",e.chartData)}}var wa=class i extends ie{constructor(e,o,t,l){super(e,o,"SalesReport/YearlySalesListChart","ReportLoader/MonthlySalesPerformance");this.httpService=o;this.csvConverter=t;this.role=l}chartData={series:[]};chartConfig;currency=-1;ngOnInit(){}preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}preGetList(){delete this.pageData.Filter?.From,delete this.pageData.Filter?.To,delete this.pageData.Filter?.PageNumber}postInit(e){this.chartData={series:this.generateSeries()},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.XAxis},yAxis:{title:{text:""},labels:{formatter:function(){return V.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let o=this.axis.chart,t=o.userOptions.total,l,S="",P=Math.abs(t[this.x]?t[this.x]:0);return P>999&&P<1e10?(S="K",l=(P/1e3).toFixed(0)):P>=1e10?(S="M",l=(P/1e6).toFixed(0)):P<999&&(l=P.toString()),this.total<0&&(l="-"+l),l.replace(/\B(?=(\d{3})+(?!\d))/g,",")+S}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let o=this.series.chart.series;o=o.filter(P=>this.series?.name?.includes("Cost")?P?.name?.includes("Cost"):P?.name?.includes("Cost")==!1);let t=[],l="",S=this.point.index;return o.forEach(P=>{P.options.stack===this.point.series.options.stack&&(t=P.name.split(" "),l+=`<b>${t[0]}</b> <br/><br/>
|
|
7
|
+
${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(P.points[S]?.y)} <br/><br/>`)}),l}},total:this.generateStackTotal()}}generateStackTotal(){let e=[];return this.data.Series.filter(t=>t.Name=="Sales").forEach(t=>{e=[...e,t.Amount]}),e}generateSeries(){let e=[],o=this.data.Series.filter(S=>S.Name=="Sales").map(S=>S.Amount),t=this.data.Series.filter(S=>S.Name=="Profit").map(S=>S.Amount),l=this.data.Series.filter(S=>S.Name=="Cost").map(S=>S.Amount);return e=[{name:"Sales",data:o},{name:"Profit",data:t,visible:!1,showInLegend:!1},{name:"Cost",data:l}],this.role.report.Profit||e.splice(1,1),e}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G))};static \u0275cmp=E({type:i,selectors:[["app-yearly-bar-chart"]],standalone:!1,features:[R],decls:10,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.getListData())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions")(2,"a",2),I(3,"i",3),p(4,"Table View"),a()(),n(5,"filters"),g(6,YD,10,8,"ng-template",null,0,M),a(),n(8,"content"),g(9,qD,2,2,"div",4),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("routerLink",b(6,jD)),r(7),m("ngIf",t.data))},dependencies:[N,k,A,z,O,L,le,Et,fe,Q],encapsulation:2})};var UD=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],KD=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],zD=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],XD=i=>({id:i}),ZD=i=>[i],Oo=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],JD=(i,c,e)=>({CategoryID:i,From:c,To:e}),Lo=i=>({CategoryID:i}),$D=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"];function ev(i,c){if(i&1){let e=F();n(0,"button",9),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",10),p(2," Export "),a()}}function tv(i,c){if(i&1&&(n(0,"span",24),p(1),a()),i&2){let e=c.item;ot("matTooltip",e.Value),r(),w(e.Value)}}function iv(i,c){if(i&1){let e=F();n(0,"div",11)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",12),h("ngModelChange",function(t){u(e);let l=s();return x(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",13),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",14),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),g(10,tv,2,2,"ng-template",15),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",16),h("dateChange",function(t){u(e);let l=s();return x(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",17)(16,"datepicker",18),h("dateChange",function(t){u(e);let l=s();return x(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",19),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",20),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Sales Order Tag"),a(),n(25,"ng-select",21),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Discount Calculation"),a(),n(28,"ng-select",22),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(29,"h6"),p(30,"Exclude Zero"),a(),n(31,"radio-options",23),h("modelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("categories",U(21,ZD,U(19,XD,e.pageData.Filter.CategoryID)))("isInitializedCategoryLabel",!0)("showClear",!0),r(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),C("ngModel",e.pageData.Filter.BrandID),r(5),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.SalesID),r(3),C("ngModel",e.pageData.Filter.CustomerID),r(3),C("ngModel",e.pageData.Filter.TagID),m("items",e.pageData.Options==null?null:e.pageData.Options.Tags),r(3),C("ngModel",e.pageData.Filter.CalculationDiscount),m("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),r(3),C("model",e.pageData.Filter.ExcludeZero)}}function nv(i,c){i&1&&(n(0,"th",47),p(1," DISCOUNT "),a())}function av(i,c){i&1&&(n(0,"th",48),p(1," DISCOUNT (%) "),a(),n(2,"th",49),p(3," DISCOUNT (AMOUNT) "),a())}function rv(i,c){i&1&&(n(0,"th",50),p(1," COST "),a())}function ov(i,c){i&1&&(n(0,"th",51),p(1," PROFIT "),a())}function lv(i,c){i&1&&(n(0,"th",52),p(1," % "),a())}function pv(i,c){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;r(),v(" ",f(2,1,e.Cost)," ")}}function mv(i,c){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Profit>=0?"text-success":"text-danger"),r(),v(" ",f(2,2,e.Profit)," ")}}function sv(i,c){if(i&1&&(n(0,"td",55),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;m("ngClass",e.Percentage>=0?"text-success":"text-danger"),r(),v(" ",f(2,2,e.Percentage),"% ")}}function cv(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",53),d(3,"date"),d(4,"date"),p(5),a()(),n(6,"td",41),p(7),d(8,"quantityFraction"),a(),n(9,"td",41)(10,"a",53),p(11),d(12,"amountFraction"),a()(),n(13,"td",41)(14,"a",53),p(15),d(16,"amountFraction"),a()(),n(17,"td",41),p(18),d(19,"amountFraction"),a(),n(20,"td",43),p(21),d(22,"amountFraction"),a(),n(23,"td",41),p(24),d(25,"amountFraction"),a(),g(26,pv,3,3,"td",44)(27,mv,3,4,"td",45)(28,sv,3,4,"td",45),a()),i&2){let e=c.$implicit,o=s(2);r(2),m("routerLink",b(34,Oo))("queryParams",st(35,JD,e.ID,y(3,16,o.pageData.Filter.From,"yyyy-MM-dd"),y(4,19,o.pageData.Filter.To,"yyyy-MM-dd"))),r(3),w(e.Name),r(2),w(f(8,22,e.Quantity)),r(3),m("routerLink",b(39,Oo))("queryParams",U(40,Lo,e.ID)),r(),v(" ",f(12,24,e.GrossSales)," "),r(3),m("routerLink",b(42,$D))("queryParams",U(43,Lo,e.ID)),r(),w(f(16,26,e.Discount)),r(3),w(f(19,28,e.Sales)),r(3),v(" ",f(22,30,e.Tax)," "),r(3),w(f(25,32,e.SalesNTax)),r(2),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.report.Profit),r(),m("ngIf",o.roleService.report.Profit)}}function dv(i,c){if(i&1&&(n(0,"td",54),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);r(),v(" ",f(2,1,e.data.Aggregate.TotalCost)," ")}}function uv(i,c){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=s(2);m("ngClass",e.data.Aggregate.TotalProfit>=0?"text-success":"text-danger"),r(),v(" ",f(2,2,e.data.Aggregate.TotalProfit)," ")}}function _v(i,c){if(i&1&&(n(0,"td",55),p(1),d(2,"number"),a()),i&2){let e=s(2);m("ngClass",e.data.Aggregate.TotalPercentage>=0?"text-success":"text-danger"),r(),v(" ",f(2,2,e.data.Aggregate.TotalPercentage),"% ")}}function gv(i,c){if(i&1){let e=F();n(0,"div",25)(1,"div",26)(2,"table",27),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",28)(4,"tr")(5,"th",29),p(6,"CATEGORY"),a(),n(7,"th",30),p(8," QUANTITY "),a(),n(9,"th",31),p(10," GROSS SALES "),a(),g(11,nv,2,0,"th",32)(12,av,4,0,"ng-template",null,1,M),n(14,"th",33),p(15," NET SALES "),a(),n(16,"th",34),p(17," Tax "),a(),n(18,"th",35),p(19," Sales + Tax "),a(),g(20,rv,2,0,"th",36)(21,ov,2,0,"th",37)(22,lv,2,0,"th",38),a()(),n(23,"tbody"),g(24,cv,29,45,"tr",39),a(),n(25,"tfoot")(26,"tr",40)(27,"td",41),p(28,"Total :"),a(),n(29,"td",41),p(30),d(31,"quantityFraction"),a(),n(32,"td",42)(33,"a"),p(34),d(35,"amountFraction"),a()(),n(36,"td",41),p(37),d(38,"amountFraction"),a(),n(39,"td",41),p(40),d(41,"amountFraction"),a(),n(42,"td",43),p(43),d(44,"amountFraction"),a(),n(45,"td",41),p(46),d(47,"amountFraction"),a(),g(48,dv,3,3,"td",44)(49,uv,3,4,"td",45)(50,_v,3,4,"td",45),a()()()(),n(51,"POS-complex-pagination",46),T("jumpToPage",function(){u(e);let t=s();return _(t.getListData())})("previousPage",function(){u(e);let t=s();return _(t.getListData())})("nextPage",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=lt(13),o=s();r(11),m("ngIf",!o.pageData.Filter.BreakdownDiscountAmount)("ngIfElse",e),r(9),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.report.Profit),r(),m("ngIf",o.roleService.report.Profit),r(2),m("ngForOf",o.data.Data),r(6),v(" ",f(31,17,o.data.Aggregate.TotalQuantity)," "),r(4),w(f(35,19,o.data.Aggregate.TotalGross)),r(3),v(" ",f(38,21,o.data.Aggregate.TotalDiscount)," "),r(3),v(" ",f(41,23,o.data.Aggregate.TotalNetSales)," "),r(3),v(" ",f(44,25,o.data.Aggregate.TotalTax)," "),r(3),v(" ",f(47,27,o.data.Aggregate.TotalSalesNTax)," "),r(2),m("ngIf",o.roleService.product.Cost),r(),m("ngIf",o.roleService.report.Profit),r(),m("ngIf",o.roleService.report.Profit),r(),m("total",o.data.Count)("pageData",o.pageData)}}var Ta=class i extends he{constructor(e,o,t,l,S){super(e,o,"Report/CategorySales","ReportLoader/CategorySales");this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,S);case"Total":return this.compare(t.Total,l.Total,S);case"Quantity":return this.compare(t.Quantity,l.Quantity,S);case"Discount":return this.compare(t.Discount,l.Discount,S);case"NetSales":return this.compare(t.NetSales,l.NetSales,S);case"Cost":return this.compare(t.Cost,l.Cost,S);case"Profit":return this.compare(t.Profit,l.Profit,S);case"Percentage":return this.compare(t.Percentage,l.Percentage,S);case"Tax":return this.compare(t.Tax,l.Tax,S);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,S);case"GrossSales":return this.compare(t.GrossSales,l.GrossSales,S);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["POS-category-sales-table"]],standalone:!1,features:[R],decls:21,vars:13,consts:[["pageFilterTemplate",""],["BREAKDOWN_HEADER",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["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","categories","isInitializedCategoryLabel","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"text-start"],["arrowPosition","before","mat-sort-header","Quantity",1,"flex-right",2,"width","120px"],["mat-sort-header","GrossSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["class","flex-right","style","width: 120px","mat-sort-header","Discount","arrowPosition","before",4,"ngIf","ngIfElse"],["mat-sort-header","NetSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-right",2,"width","150px"],["class","flex-right","style","width: 120px","mat-sort-header","Cost","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 120px","mat-sort-header","Profit","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 80px","mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-primary"],[1,"text-end","text-warning-emphasis"],["class","text-end text-danger",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["api","Report/GetTotalCountCategorySales",3,"jumpToPage","previousPage","nextPage","total","pageData"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","DiscountAmount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",1,"flex-right",2,"width","80px"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",2),h("textChange",function(P){return u(l),x(t.pageData.Filter.Number,P)||(t.pageData.Filter.Number=P),_(P)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,ev,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Tree View "),a()(),n(10,"li")(11,"a",7),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",7),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),g(17,iv,32,23,"ng-template",null,0,M),a(),n(19,"content"),g(20,gv,52,29,"div",8),a()()}o&2&&(m("pageData",t.menuData),C("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService.global.Export),r(6),m("routerLink",b(10,UD)),r(3),m("routerLink",b(11,KD)),r(3),m("routerLink",b(12,zD)),r(6),m("ngIf",t.data))},dependencies:[N,Ae,j,k,A,z,K,O,L,le,ae,ge,we,Le,bt,fe,Q,Qe,$i,te,ee,X,Z],encapsulation:2})};var ko=(i,c)=>({"text-danger":i,"text-success":c}),fv=()=>["/menu/Products/Catalog/Variants/Info"],Ro=i=>({ID:i}),Cv=()=>["/menu/Orders/Orders/Customer_Invoice/Info"];function xv(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 hv(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),h("ngModelChange",function(t){u(e);let l=s();return x(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",8),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Discount Comparator"),a(),n(9,"ng-select",9),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CompareDifference,t)||(l.pageData.Filter.CompareDifference=t),_(t)}),a(),n(10,"h6"),p(11,"Variant"),a(),n(12,"autocompleteV2",10),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a(),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",11),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(17,"div",12)(18,"datepicker",13),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(19,"h6"),p(20,"Note"),a(),n(21,"input",14),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.Note,t)||(l.pageData.Filter.Note=t),_(t)}),a(),n(22,"h6"),p(23,"Disc %"),a(),n(24,"div",15)(25,"input",16),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.DiscountFrom,t)||(l.pageData.Filter.DiscountFrom=t),_(t)}),a(),n(26,"input",16),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.DiscountTo,t)||(l.pageData.Filter.DiscountTo=t),_(t)}),a()()()}if(i&2){let e=s();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),r(3),C("ngModel",e.pageData.Filter.CompareDifference),m("clearable",!1)("items",e.pageData.Options==null?null:e.pageData.Options.DiscountReportCompareType),r(3),C("ngModel",e.pageData.Filter.VariantID),m("renderThumbnail",!0),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To),r(3),C("ngModel",e.pageData.Filter.Note),r(4),C("ngModel",e.pageData.Filter.DiscountFrom),r(),C("ngModel",e.pageData.Filter.DiscountTo)}}function Sv(i,c){i&1&&(se(0),n(1,"th",39),p(2,"Cost"),a(),ce())}function yv(i,c){if(i&1&&(se(0),n(1,"td",37),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s().$implicit;r(2),w(f(3,1,e.UnitCost))}}function Dv(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",40),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td")(9,"a",40),p(10),a(),I(11,"span",41),a(),n(12,"td"),p(13),d(14,"date"),a(),n(15,"td",35),p(16),d(17,"quantityFraction"),a(),g(18,yv,4,3,"ng-container",27),n(19,"td",35),p(20),d(21,"amountFraction"),a(),n(22,"td",35),p(23),d(24,"amountFraction"),a(),n(25,"td",36),p(26),d(27,"amountFraction"),a(),n(28,"td",37),p(29),d(30,"amountFraction"),a(),n(31,"td",38),p(32),d(33,"amountFraction"),a()()),i&2){let e=c.$implicit,o=s(2);r(2),w(e.EntityName),r(2),m("routerLink",b(33,fv))("queryParams",U(34,Ro,e.ID)),r(),w(e.Name),r(2),w(e.Code),r(2),m("routerLink",b(36,Cv))("queryParams",U(37,Ro,e.InvoiceID)),r(),w(e.Number),r(),m("innerHTML",e.Note,Pe),r(2),w(y(14,18,e.Date,"dd MMM yyyy")),r(3),w(f(17,21,e.Quantity)),r(2),m("ngIf",o.roleService.product.Cost),r(2),w(f(21,23,e.UnitPriceOriginal)),r(3),w(f(24,25,e.UnitPrice)),r(2),m("ngClass",de(39,ko,!e.NetPriceIsGreaterThanOriginalPrice,e.NetPriceIsGreaterThanOriginalPrice)),r(),v(" ",f(27,27,e.Discount),""),r(3),v(" ",f(30,29,e.DiscountPercentage),"% "),r(3),w(f(33,31,e.Sales))}}function vv(i,c){if(i&1&&(se(0),n(1,"td",37),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s(2);r(2),w(f(3,1,e.data.Aggregate.TotalUnitCost))}}function wv(i,c){if(i&1){let e=F();se(0),n(1,"POS-complex-pagination",42),T("jumpToPage",function(){u(e);let t=s(2);return _(t.getListData())})("previousPage",function(){u(e);let t=s(2);return _(t.getListData())})("nextPage",function(){u(e);let t=s(2);return _(t.getListData())}),a(),ce()}if(i&2){let e=s(2);r(),m("total",e.data.Data.length)("pageData",e.pageData)}}function Tv(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,"Outlet"),a(),n(7,"th",22),p(8,"Variant"),a(),n(9,"th",23),p(10,"Code"),a(),n(11,"th",24),p(12,"Number / Note"),a(),n(13,"th",25),p(14,"Date"),a(),n(15,"th",26),p(16,"Quantity"),a(),g(17,Sv,3,0,"ng-container",27),n(18,"th",28),p(19," Original Price"),a(),n(20,"th",29),p(21,"Price"),a(),n(22,"th",30),p(23,"Discount"),a(),n(24,"th",31),p(25," Disc%"),a(),n(26,"th",32),p(27,"Net Sales "),a()()(),n(28,"tbody"),g(29,Dv,34,42,"tr",33),a(),n(30,"tfoot")(31,"tr"),I(32,"td",34),n(33,"td",35),p(34,"Total :"),a(),n(35,"td",35),p(36),d(37,"quantityFraction"),a(),g(38,vv,4,3,"ng-container",27),n(39,"td",35),p(40),d(41,"amountFraction"),a(),n(42,"td",35),p(43),d(44,"amountFraction"),a(),n(45,"td",36),p(46),d(47,"amountFraction"),a(),n(48,"td",37),p(49),d(50,"amountFraction"),a(),n(51,"td",38),p(52),d(53,"amountFraction"),a()()()()(),g(54,wv,2,2,"ng-container",27),a()}if(i&2){let e=s();r(17),m("ngIf",e.roleService.product.Cost),r(12),m("ngForOf",e.data.Data),r(7),w(f(37,11,e.data.Aggregate.TotalQuantity)),r(2),m("ngIf",e.roleService.product.Cost),r(2),w(f(41,13,e.data.Aggregate.TotalUnitPriceOriginal)),r(3),w(f(44,15,e.data.Aggregate.TotalUnitPrice)),r(2),m("ngClass",de(23,ko,e.data.Aggregate.TotalDiscount>0,e.data.Aggregate.TotalDiscount<0)),r(),v(" ",f(47,17,e.data.Aggregate.TotalDiscount<0?e.data.Aggregate.TotalDiscount*-1:e.data.Aggregate.TotalDiscount),""),r(3),v(" ",f(50,19,e.data.Aggregate.DiscountPercentage),"% "),r(3),w(f(53,21,e.data.Aggregate.TotalNetSales)),r(2),m("ngIf",(e.data==null||e.data.Data==null?null:e.data.Data.length)>0)}}var Pa=class i extends he{constructor(e,o,t,l,S){super(e,o,"SalesReport/Discount","SalesReportLoader/DiscountLoader",null,t);this.roleService=l;this.dialog=S}postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data,this.initDiscountPercentage()}initDiscountPercentage(){this.data.Aggregate.DiscountPercentage=0;for(let e of this.data.Data)this.data.Aggregate.DiscountPercentage+=e.DiscountPercentage}sortData(e){let o=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=o;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";switch(e.active){case"EntityName":return V.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),S);case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),S);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),S);case"Number":return V.compare(t.Number,l.Number,S);case"Date":return V.compare(t.Date,l.Date,S);case"Quantity":return V.compare(t.Quantity,l.Quantity,S);case"UnitCost":return V.compare(t.UnitCost,l.UnitCost,S);case"UnitPriceOriginal":return V.compare(t.UnitPriceOriginal,l.UnitPriceOriginal,S);case"UnitPrice":return V.compare(t.UnitPrice,l.UnitPrice,S);case"Discount":return V.compare(t.Discount,l.Discount,S);case"Sales":return V.compare(t.Sales,l.Sales,S);case"DiscountPercentage":return V.compare(t.DiscountPercentage,l.DiscountPercentage,S);case"Note":return V.compare(t.Note,l.Note,S);default:return 0}})}openExportModal(){this.dialog.open(q,{data:{title:"Discounted Report",exportTypes:[{ID:"SalesReportExport/Discount",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(Oe),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["app-discount-sales"]],standalone:!1,features:[R],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose Discount Comparator",3,"ngModelChange","ngModel","clearable","items"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"d-flex",2,"column-gap","10px"],["type","text","autoNum","","percentage","",1,"form-control","w-100",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName",2,"width","150px"],["mat-sort-header","Name",2,"width","150px"],["mat-sort-header","Code",2,"width","100px"],["mat-sort-header","Number",2,"width","100px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],[4,"ngIf"],["mat-sort-header","UnitPriceOriginal","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Discount","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","DiscountPercentage","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],[4,"ngFor","ngForOf"],["colspan","4"],[1,"text-end"],[1,"text-end",3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],["mat-sort-header","UnitCost","arrowPosition","before",1,"text-end",2,"width","100px"],["target","_blank",3,"routerLink","queryParams"],[1,"d-block",3,"innerHTML"],["api","SalesReport/TotalDiscount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,xv,3,0,"a",2),a(),n(3,"filters"),g(4,hv,27,16,"ng-template",null,0,M),a(),n(6,"content"),g(7,Tv,55,26,"div",3),a()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(5),m("ngIf",t.data))},dependencies:[N,Ae,j,k,A,z,K,Ge,O,L,ae,ge,He,Le,bt,fe,Q,ee,X,Z],encapsulation:2})};var Pv=()=>["/menu/Reports/Sales_Report/Standard/Person"],Fv=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],Iv=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],bv=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],Ev=(i,c)=>({From:i,To:c}),No=i=>({ID:i}),Wo=i=>[i],Mv=(i,c)=>({SalesPersonID:i,ListIDs:c}),Vv=(i,c,e,o)=>({SalesPersonID:i,ListIDs:c,From:e,To:o});function Bv(i,c){if(i&1){let e=F();n(0,"a",15),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",16),p(2," Export "),a()}}function Ov(i,c){if(i&1){let e=F();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",19),h("ngModelChange",function(t){u(e);let l=s(2);return x(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Date"),a(),n(9,"app-datepicker-range",20),T("dateChange",function(t){u(e);let l=s(2);return _(l.onChangeFilterDate1(t))}),a(),n(10,"h6",21),p(11,"Compare With"),a(),n(12,"app-datepicker-range",20),T("dateChange",function(t){u(e);let l=s(2);return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=s(2);r(3),m("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),r(3),C("ngModel",e.pageData.Filter.SalesID),r(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To),r(3),m("from",e.pageData.Filter.CompareFrom)("to",e.pageData.Filter.CompareTo)}}function Lv(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",39),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",38)(7,"a",40),p(8),d(9,"number"),a()(),n(10,"td",38),p(11),d(12,"quantityFraction"),a(),n(13,"td",38),p(14),d(15,"quantityFraction"),a(),n(16,"td",38),p(17),d(18,"quantityFraction"),a(),n(19,"td",38),p(20),d(21,"amountFraction"),a(),n(22,"td",38),p(23),d(24,"amountFraction"),a(),n(25,"td",38)(26,"a",40),d(27,"date"),d(28,"date"),p(29),d(30,"quantityFraction"),a()(),n(31,"td",38),p(32),d(33,"quantityFraction"),a(),n(34,"td",38),p(35),d(36,"quantityFraction"),a(),n(37,"td",38),p(38),d(39,"quantityFraction"),a(),n(40,"td",38),p(41),d(42,"amountFraction"),a(),n(43,"td",38),p(44),d(45,"amountFraction"),a()()),i&2){let e=c.$implicit,o=s().$implicit,t=s(2);r(2),m("queryParams",U(47,No,e.PersonID)),r(),w(e.PersonName),r(2),w(e.PersonCode),r(2),m("queryParams",de(51,Mv,e.PersonID,U(49,Wo,o.EntityID))),r(),w(f(9,17,e.CountOrder)),r(3),w(f(12,19,e.Quantity)),r(3),w(f(15,21,e.BasketSize)),r(3),w(f(18,23,e.BasketValue)),r(3),w(f(21,25,e.Sales)),r(3),w(f(24,27,e.AverageDailySales)),r(3),m("queryParams",Qt(56,Vv,e.PersonID,U(54,Wo,o.EntityID),y(27,29,t.pageData.Filter.CompareFrom,"ddMMyyyy"),y(28,32,t.pageData.Filter.CompareTo,"ddMMyyyy"))),r(3),v(" ",f(30,35,e.CountOrder1),""),r(3),w(f(33,37,e.Quantity1)),r(3),w(f(36,39,e.BasketSize1)),r(3),w(f(39,41,e.BasketValue1)),r(3),w(f(42,43,e.Sales1)),r(3),w(f(45,45,e.AverageDailySales1))}}function Rv(i,c){if(i&1&&(n(0,"table",22)(1,"thead",23)(2,"tr",24)(3,"th",25)(4,"h2")(5,"a",26),p(6),a()()()(),n(7,"tr")(8,"th",27),p(9," Sales Person"),a(),n(10,"th",28)(11,"span"),p(12),d(13,"date"),a(),p(14," - "),n(15,"span"),p(16),d(17,"date"),a()(),n(18,"th",29)(19,"span"),p(20),d(21,"date"),a(),p(22," - "),n(23,"span"),p(24),d(25,"date"),a()()(),n(26,"tr",30)(27,"th",31),p(28," Ordr"),a(),n(29,"th",32),p(30,"Qty"),a(),n(31,"th",32),I(32,"i",33),a(),n(33,"th",34),p(34,"Basket Value"),a(),n(35,"th",34),p(36,"Sales"),a(),n(37,"th",34),p(38,"Avg Daily"),a(),n(39,"th",35),p(40,"Ordr"),a(),n(41,"th",32),p(42,"Qty"),a(),n(43,"th",32),I(44,"i",33),a(),n(45,"th",34),p(46,"Basket Value"),a(),n(47,"th",34),p(48,"Sales"),a(),n(49,"th",34),p(50,"Avg Daily"),a()()(),n(51,"tbody"),g(52,Lv,46,61,"tr",36),a(),n(53,"tfoot")(54,"tr",37)(55,"td"),p(56,"Total"),a(),n(57,"td",38),p(58),d(59,"sum"),d(60,"number"),a(),n(61,"td",38),p(62),d(63,"sum"),d(64,"quantityFraction"),a(),n(65,"td",38),p(66),d(67,"sum"),d(68,"quantityFraction"),a(),n(69,"td",38),p(70),d(71,"sum"),d(72,"quantityFraction"),a(),n(73,"td",38),p(74),d(75,"sum"),d(76,"amountFraction"),a(),n(77,"td",38),p(78),d(79,"sum"),d(80,"amountFraction"),a(),n(81,"td",38),p(82),d(83,"sum"),d(84,"number"),a(),n(85,"td",38),p(86),d(87,"sum"),d(88,"quantityFraction"),a(),n(89,"td",38),p(90),d(91,"sum"),d(92,"quantityFraction"),a(),n(93,"td",38),p(94),d(95,"sum"),d(96,"quantityFraction"),a(),n(97,"td",38),p(98),d(99,"sum"),d(100,"amountFraction"),a(),n(101,"td",38),p(102),d(103,"sum"),d(104,"amountFraction"),a()()()()),i&2){let e=c.$implicit,o=s(2);r(5),m("queryParams",U(91,No,e.EntityID)),r(),w(e.EntityName),r(6),w(y(13,19,o.pageData.Filter.From,"dd MMMM yyyy")),r(4),w(y(17,22,o.pageData.Filter.To,"dd MMMM yyyy")),r(4),w(y(21,25,o.pageData.Filter.CompareFrom,"dd MMMM yyyy")),r(4),w(y(25,28,o.pageData.Filter.CompareTo,"dd MMMM yyyy")),r(28),m("ngForOf",e.SalesCommison),r(6),w(f(60,34,y(59,31,e.SalesCommison,"CountOrder"))),r(4),w(f(64,39,y(63,36,e.SalesCommison,"Quantity"))),r(4),w(f(68,44,y(67,41,e.SalesCommison,"BasketSize"))),r(4),w(f(72,49,y(71,46,e.SalesCommison,"BasketValue"))),r(4),w(f(76,54,y(75,51,e.SalesCommison,"Sales"))),r(4),w(f(80,59,y(79,56,e.SalesCommison,"AverageDailySales"))),r(4),w(f(84,64,y(83,61,e.SalesCommison,"CountOrder1"))),r(4),w(f(88,69,y(87,66,e.SalesCommison,"Quantity1"))),r(4),w(f(92,74,y(91,71,e.SalesCommison,"BasketSize1"))),r(4),w(f(96,79,y(95,76,e.SalesCommison,"BasketValue1"))),r(4),w(f(100,84,y(99,81,e.SalesCommison,"Sales1"))),r(4),w(f(104,89,y(103,86,e.SalesCommison,"AverageDailySales1")))}}function kv(i,c){if(i&1){let e=F();n(0,"mainpanel-cmp",2),T("onSubmit",function(){u(e);let t=s();return _(t.searchFromPageOne())}),h("filterChange",function(t){u(e);let l=s();return x(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",3)(3,"a",4),T("click",function(){u(e);let t=s();return _(t.print())}),I(4,"i",5),p(5," Print"),a(),g(6,Bv,3,0,"a",6),n(7,"div",7)(8,"button",8),p(9," More "),a(),n(10,"ul",9)(11,"li")(12,"a",10),p(13,"Summary"),a()(),n(14,"li")(15,"a",10),p(16,"By Employee"),a()(),n(17,"li")(18,"a",10),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",11),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),g(26,Ov,13,9,"ng-template",null,0,M),a(),n(28,"content")(29,"div",12)(30,"div",13),g(31,Rv,105,93,"table",14),a()()()()}if(i&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),r(6),m("ngIf",e.roleService==null?null:e.roleService.global.Export),r(6),m("routerLink",b(17,Pv)),r(3),m("routerLink",b(18,Fv)),r(3),m("routerLink",b(19,Iv)),r(3),m("routerLink",b(20,bv))("queryParams",de(21,Ev,y(22,11,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),y(23,14,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),r(10),m("ngForOf",e.data==null?null:e.data.Data)}}var Fa=class i extends he{constructor(e,o,t,l,S,P){super(e,o,"Report/GetSalesPersonCommissionGroupByOutlet","ReportLoader/GetSalesPersonCommissionGroupByOutlet",null,P);this.httpService=o;this.csvConverter=t;this.roleService=l;this.matDialog=S}preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.loaderPayload.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(q,{data:{title:"Outlet Commission Report",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionGroupByOutlet",Value:"Default",FileName:"Outlet Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}onChangeFilterDate1(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to,this.onFilterFromDate(),this.onFilterToDate()}onChangeFilterDate2(e){this.pageData.Filter.CompareFrom=e.from,this.pageData.Filter.CompareTo=e.to}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(H),D(G),D(Y),D(Oe))};static \u0275cmp=E({type:i,selectors:[["POS-sales-person-by-outlet"]],standalone:!1,features:[R],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],["class","btn btn-outline-secondary ms-3",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid","class","table border-bottom mb-10",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to"],[1,"mt-0"],["id","tableGrid",1,"table","border-bottom","mb-10"],[1,"thead-light"],[2,"border","none !important"],["colspan","14",1,"text-center","bg-white","border-none"],["routerLink","/menu/Outlets/Master/Outlets/Info",3,"queryParams"],["rowspan","2","colspan","1",1,"border-end","text-center",2,"width","280px"],["colspan","6",1,"text-center"],["colspan","6",1,"text-center","border-start"],[1,"border-top-2"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end",2,"width","50px"],[1,"text-end",2,"width","50px"],["matTooltip","Basket Size","matTooltipPosition","above",1,"fa-solid","fa-cart-shopping"],[1,"text-end",2,"width","100px"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end","border-start",2,"width","50px"],[4,"ngFor","ngForOf"],[1,"table-footer","fw-bold"],[1,"text-end"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],["routerLink","/menu/Reports/Sales_Report/Standard/Detail",3,"queryParams"]],template:function(o,t){o&1&&g(0,kv,32,24,"mainpanel-cmp",1),o&2&&m("ngIf",t.data)},dependencies:[N,j,k,A,O,L,le,Nt,Q,Qe,re,te,ee,X,Z],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}}"]})};var Wv=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Nv=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Av=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Gv=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Hv=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Qv=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Ao=i=>({ID:i});function jv(i,c){if(i&1){let e=F();n(0,"div",21)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",22),h("ngModelChange",function(t){u(e);let l=s();return x(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",23),h("selectedCategoryIDChange",function(t){u(e);let l=s();return x(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Product Tag"),a(),n(9,"ng-select",24),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ListTagID,t)||(l.pageData.Filter.ListTagID=t),_(t)}),a(),n(10,"h6"),p(11,"Release Date"),a(),n(12,"div",25)(13,"datepicker",26),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ReleasedFrom,t)||(l.pageData.Filter.ReleasedFrom=t),_(t)}),a(),n(14,"datepicker",27),h("dateChange",function(t){u(e);let l=s();return x(l.pageData.Filter.ReleasedTo,t)||(l.pageData.Filter.ReleasedTo=t),_(t)}),a()(),n(15,"h6",28)(16,"div",29),p(17,"Number Of Interval"),a(),n(18,"div",29),p(19,"Interval Of"),a()(),n(20,"div",30)(21,"input",31),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.IntervalCount,t)||(l.pageData.Filter.IntervalCount=t),_(t)}),a(),n(22,"div",32)(23,"input",33),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.IntervalDays,t)||(l.pageData.Filter.IntervalDays=t),_(t)}),a(),n(24,"span",34),p(25,"Days"),a()()(),n(26,"h6"),p(27,"Page Size"),a(),n(28,"input",35),h("ngModelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(29,"h6"),p(30,"Purchased"),a(),n(31,"radio-options",36),h("modelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.PurchaseType,t)||(l.pageData.Filter.PurchaseType=t),_(t)}),a(),n(32,"h6"),p(33,"Scope"),a(),n(34,"radio-options",36),h("modelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(35,"h6"),p(36,"Options"),a(),n(37,"radio-options",37),h("modelChange",function(t){u(e);let l=s();return x(l.pageData.Filter.HideZero,t)||(l.pageData.Filter.HideZero=t),_(t)}),a()()}if(i&2){let e=s();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),m("isInitializedCategoryLabel",!0)("showClear",!0),r(3),m("multiple",!0)("items",e.pageData.Options.Tags),C("ngModel",e.pageData.Filter.ListTagID),r(4),C("date",e.pageData.Filter.ReleasedFrom),r(),C("date",e.pageData.Filter.ReleasedTo),r(7),C("ngModel",e.pageData.Filter.IntervalCount),r(2),C("ngModel",e.pageData.Filter.IntervalDays),r(5),m("max",1e3),C("ngModel",e.pageData.Filter.RowCount),r(3),C("model",e.pageData.Filter.PurchaseType),m("options",e.pageData.Options==null?null:e.pageData.Options.PurchaseType),r(3),C("model",e.pageData.Filter.GroupByProduct),m("options",e.scopeFilter),r(3),C("model",e.pageData.Filter.HideZero),m("options",e.hideZeroOptions)}}function Yv(i,c){if(i&1){let e=F();n(0,"button",38),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",39),p(2," Export "),a()}}function qv(i,c){if(i&1&&(n(0,"th",40),p(1),a(),n(2,"th",41),p(3," % "),a()),i&2){let e=c.$index,o=s();m("mat-sort-header","Interval"+e)("matTooltip"," Quantity Sold "+(e*o.intervalDays()+1)+" - "+(e+1)*o.intervalDays()+" Days since Release Date"),r(),v(" ",e*o.intervalDays()+1+"-"+(e+1)*o.intervalDays()," "),r(),m("mat-sort-header","Percentage"+e)("matTooltip"," Percentage Sold "+(e*o.intervalDays()+1)+" - "+(e+1)*o.intervalDays()+" Days since Release Date")}}function Uv(i,c){if(i&1&&(se(0),n(1,"th",42),d(2,"date"),d(3,"date"),p(4," TOT "),a(),n(5,"th",43),d(6,"date"),d(7,"date"),p(8," % "),a(),ce()),i&2){let e=s();r(),m("matTooltip","Total items sold"+(e.pageData.Filter.ReleasedFrom&&e.pageData.Filter.ReleasedTo?` in this period
|
|
8
|
+
`+y(2,2,e.pageData.Filter.ReleasedFrom,"dd MMM yyyy")+" - "+y(3,5,e.pageData.Filter.ReleasedTo,"dd MMM yyyy"):"")),r(4),m("matTooltip","Total Percentage items sold"+(e.pageData.Filter.ReleasedFrom&&e.pageData.Filter.ReleasedTo?` in this period
|
|
9
|
+
`+y(6,8,e.pageData.Filter.ReleasedFrom,"dd MMM yyyy")+" - "+y(7,11,e.pageData.Filter.ReleasedTo,"dd MMM yyyy"):""))}}function Kv(i,c){i&1&&er(0)}function zv(i,c){i&1&&I(0,"img",53)}function Xv(i,c){if(i&1&&(se(0),n(1,"a",54),p(2),a(),ce()),i&2){let e=s().$implicit;r(),m("queryParams",U(2,Ao,e.ID)),r(),w(e.Name)}}function Zv(i,c){if(i&1&&(n(0,"a",55),p(1),a()),i&2){let e=s().$implicit;m("queryParams",U(2,Ao,e.ID)),r(),w(e.Name)}}function Jv(i,c){if(i&1&&(n(0,"td",51)(1,"span",56),d(2,"date"),d(3,"date"),p(4),d(5,"number"),a()(),n(6,"td",52)(7,"small"),p(8),d(9,"number"),a()()),i&2){let e=c.$implicit;r(),m("matTooltip","From : "+y(2,3,e.From,"dd MMM yyyy")+`
|
|
10
|
+
To : `+y(3,6,e.To,"dd MMM yyyy")),r(3),v(" ",f(5,9,e.Value)," "),r(4),v(" ",y(9,11,e.Percentage,"1.0-0"),"%")}}function $v(i,c){if(i&1&&(se(0),n(1,"td",51)(2,"span"),p(3),d(4,"number"),a()(),n(5,"td",57)(6,"small"),p(7),d(8,"number"),a()(),ce()),i&2){let e=s(2).$implicit;r(3),w(f(4,2,e==null?null:e.IntervalTotal)),r(4),v("",y(8,4,e==null?null:e.IntervalPercentage,"1.0-0"),"%")}}function ew(i,c){if(i&1&&g(0,$v,9,7,"ng-container",18),i&2){let e=s().$implicit;m("ngIf",(e==null||e.Intervals==null?null:e.Intervals.length)>0)}}function tw(i,c){if(i&1){let e=F();n(0,"tr")(1,"td")(2,"div",44)(3,"div",45),g(4,Kv,1,0,"ng-container",46),n(5,"img",47),T("click",function(t){u(e);let l=s();return _(l.onZoomImage(t,t))}),a(),g(6,zv,1,0,"ng-template",null,1,M),a(),n(8,"div",48),g(9,Xv,3,4,"ng-container",46)(10,Zv,2,4,"ng-template",null,2,M),n(12,"small",49),p(13),a()()()(),n(14,"td")(15,"div",48)(16,"div"),p(17),d(18,"date"),a(),n(19,"small",50),d(20,"date"),d(21,"date"),p(22),d(23,"number"),a()()(),n(24,"td",51),p(25),d(26,"number"),a(),Fi(27,Jv,10,14,null,null,Ra),n(29,"td",51)(30,"span"),p(31),d(32,"number"),a()(),n(33,"td",52)(34,"small"),p(35),d(36,"number"),a()(),g(37,ew,1,1,"ng-container"),n(38,"td",51),p(39),d(40,"number"),a()()}if(i&2){let e=c.$implicit,o=lt(7),t=lt(11),l=s();r(4),m("ngIf",e.ThumbnailUrl)("ngIfElse",o),r(),ot("src",e.ThumbnailUrl,ki),r(4),m("ngIf",l.pageData==null||l.pageData.Filter==null?null:l.pageData.Filter.GroupByProduct)("ngIfElse",t),r(4),w(e.Code),r(4),v(" ",y(18,14,e.Released,"dd MMM yyyy")," "),r(2),m("matTooltip",y(20,17,e.Released,"dd MMM yyyy")+" - "+y(21,20,l.today,"dd MMM yyyy")),r(3),v("",f(23,23,e.ReleasedDays)," days"),r(3),w(f(26,25,e.Purchased)),r(2),Ii(e==null?null:e.Intervals),r(4),w(f(32,27,e==null||e.SoldUntilNow==null?null:e.SoldUntilNow.Value)),r(4),v(" ",y(36,29,e==null?null:e.SoldUntilNowPercentage,"1.0-0"),"%"),r(2),Wi((e==null||e.Intervals==null?null:e.Intervals.length)>0?37:-1),r(2),w(f(40,32,e.Inventory))}}function iw(i,c){if(i&1){let e=F();se(0),n(1,"POS-complex-pagination",58),T("jumpToPage",function(){u(e);let t=s();return _(t.getListData())})("previousPage",function(){u(e);let t=s();return _(t.getListData())})("nextPage",function(){u(e);let t=s();return _(t.getListData())}),a(),ce()}if(i&2){let e=s();r(),m("total",e.data==null||e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var Ia=class i extends he{constructor(e,o,t,l,S,P){super(e,o,"Report/ProductTags","ReportLoader/ProductTags",null,t,!0);this.biggerPictureService=l;this.role=S;this.dialog=P}intervalDays=Ct(30);today=new Date;hideZeroOptions=[{Key:!1,Value:"All"},{Key:!0,Value:"Hide Zero"}];scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];postInit(e){let o=JSON.parse(JSON.stringify(e));this.data.Data=o.Data.map((t,l)=>(t.Intervals=t?.Intervals.map((S,P)=>(t[`Interval${P}`]=S.Value,S.Percentage=this.calculatePercentage(S.Value,t.Purchased),t[`Percentage${P}`]=S.Percentage,S)),t.SoldUntilNowPercentage=this.calculatePercentage(t.SoldUntilNow?.Value,t.Purchased),t.IntervalTotal=t?.Intervals?.reduce((S,P)=>S+P.Value,t?.SoldUntilNow?.Value),t.IntervalPercentage=this.calculatePercentage(t.IntervalTotal,t.Purchased),t.ReleasedDays=this.calculateReleasedDate(t.Released),t.SoldNow=t.SoldUntilNow?.Value,t)),this.originalData=JSON.parse(JSON.stringify(this.data.Data)),this.intervalDays.set(this.pageData.Filter.IntervalDays)}calculateReleasedDate(e){let o=0;if(e){let t=new Date,l=new Date(e);o=V.differentInDays(l,t)}return o}calculatePercentage(e,o){let t=0;return o!==0&&(t=e/o*100),t}preInitList(){this.pageData.Filter.ListIDs=this.loaderPayload.ListIDs,this.pageData.Filter.ReleasedFrom=null,this.pageData.Filter.ReleasedTo=null}onZoomImage(e,o){this.biggerPictureService.openBiggerPicture(e,o)}sortData(e){let o=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=o.sort((t,l)=>{let S=e.direction==="asc";return this.compare(t[e.active],l[e.active],S)})}openExportModal(){this.dialog.open(q,{data:{title:"Product Tags",exportTypes:[{ID:"ReportExport/ProductTags",Value:"Default",FileName:"Product Tags"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ProductTagsCount",pagination:!0}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(Oe),D(pn),D(G),D(Y))};static \u0275cmp=E({type:i,selectors:[["POS-products-tags"]],standalone:!1,features:[R],decls:52,vars:24,consts:[["pageFilterTemplate",""],["NO_IMAGE",""],["SCPOPE_VARIANT",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","hideSearchBox"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["mat-sort-header","ReleasedDays",2,"width","90px"],["matTooltip","Total number of Quantity Ordered since Created","matTooltipPosition","above",1,"text-end",2,"width","90px"],["mat-sort-header","SoldNow","arrowPosition","before","matTooltipPosition","above",1,"text-end",2,"width","58px",3,"matTooltip"],["mat-sort-header","Percentage","arrowPosition","before","matTooltipPosition","above",1,"text-end","border-end",2,"width","10px",3,"matTooltip"],[4,"ngIf"],["mat-sort-header","Inventory","arrowPosition","before","matTooltip","Total On Hand Inventory Now",1,"text-end",2,"width","60px"],[4,"ngFor","ngForOf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["required","true","message","Category is Required",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","isInitializedCategoryLabel","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","multiple","items","ngModel"],[1,"d-flex",2,"column-gap","4%"],["name","RelesedFrom",2,"width","48%",3,"dateChange","date"],["name","RelesedTo",2,"width","48%",3,"dateChange","date"],[1,"d-flex","align-items-start",2,"column-gap","19px"],[1,"w-100"],[1,"d-flex","align-items-center",2,"column-gap","4%"],["type","number","name","QuantityFrom",1,"form-control","input-filter",2,"width","93.5%",3,"ngModelChange","ngModel"],[1,"input-group"],["type","number","name","QuantityTo",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"input-group-text","rounded-end-1","input-filter","bg-body-tertiary"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Scope",3,"modelChange","model","options"],[3,"modelChange","model","options"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["arrowPosition","before","matTooltipPosition","above",1,"text-end",2,"width","70px",3,"mat-sort-header","matTooltip"],["arrowPosition","before","matTooltipPosition","above",1,"text-end","border-end",2,"width","10px",3,"mat-sort-header","matTooltip"],["mat-sort-header","IntervalTotal","arrowPosition","before","matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",1,"text-end",2,"width","60px",3,"matTooltip"],["mat-sort-header","IntervalPercentage","arrowPosition","before","matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",1,"text-end",2,"width","10px",3,"matTooltip"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],[4,"ngIf","ngIfElse"],["matTooltipPosition","above","matTooltip","Click to zoom",2,"width","40px",3,"click","src"],[1,"lh-base"],[1,"d-block"],["matTooltipPosition","above",1,"text-success",3,"matTooltip"],[1,"text-end"],[1,"text-end","border-end","text-success"],["src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px"],["routerLink","/menu/Products/Catalog/Products/Info","target","_blank",3,"queryParams"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],["matTooltipPosition","above","matTooltipClass","multiline-mat-tooltip",3,"matTooltip"],[1,"text-end","text-success"],["api","Report/ProductTagsCount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",3),h("textChange",function(P){return u(l),x(t.pageData.Filter.Text,P)||(t.pageData.Filter.Text=P),_(P)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"filters"),g(2,jv,38,22,"ng-template",null,0,M),a(),n(4,"actions"),g(5,Yv,3,0,"button",4),n(6,"div",5)(7,"button",6),p(8," More "),a(),n(9,"ul",7)(10,"li")(11,"a",8),p(12," Product Sold "),a()(),n(13,"li")(14,"a",8),p(15," Compare by Outlet "),a()(),n(16,"li")(17,"a",8),p(18," Compare by Month "),a()(),n(19,"li")(20,"a",8),p(21," Compare with Transfer Order "),a()(),n(22,"li")(23,"a",8),p(24," Top Suppliers "),a()(),n(25,"li")(26,"a",8),p(27," Quantity Sold Chart "),a()()()()(),n(28,"content")(29,"div",9)(30,"div",10)(31,"table",11),T("matSortChange",function(P){return u(l),_(t.sortData(P))}),n(32,"thead",12)(33,"tr")(34,"th",13),p(35,"Name"),a(),n(36,"th",14),p(37," Released "),a(),n(38,"th",15),p(39," Purchased "),a(),Fi(40,qv,4,5,null,null,Ra),n(42,"th",16),p(43),a(),n(44,"th",17),p(45," % "),a(),g(46,Uv,9,14,"ng-container",18),n(47,"th",19),p(48," On Hand "),a()()(),n(49,"tbody"),g(50,tw,41,34,"tr",20),a()()(),g(51,iw,2,2,"ng-container",18),a()()()}o&2&&(m("pageData",t.menuData),C("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),m("hideSearchBox",!0),r(5),m("ngIf",t.role==null||t.role.global==null?null:t.role.global.Export),r(6),m("routerLink",b(18,Wv)),r(3),m("routerLink",b(19,Nv)),r(3),m("routerLink",b(20,Av)),r(3),m("routerLink",b(21,Gv)),r(3),m("routerLink",b(22,Hv)),r(3),m("routerLink",b(23,Qv)),r(14),Ii(t.data==null||t.data.Data[0]==null?null:t.data.Data[0].Intervals),r(2),m("matTooltip"," Quantity Sold "+((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()+1)+" - Today since Release Date"),r(),v(" > ",(t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()," "),r(),m("matTooltip"," Percentage Sold "+((t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)*t.intervalDays()+1)+" - Today since Release Date"),r(2),m("ngIf",(t.data==null||t.data.Data[0]==null||t.data.Data[0].Intervals==null?null:t.data.Data[0].Intervals.length)>0),r(4),m("ngForOf",t.data==null?null:t.data.Data),r(),m("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[N,j,k,A,z,K,Ge,pr,O,L,le,ae,ge,He,we,bt,fe,Q,te,ee],encapsulation:2})};var nw=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],aw=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],rw=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],ow=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],lw=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],pw=()=>["/menu/Contacts/Contact/Customers/Info"],mw=i=>({ID:i}),sw=()=>["/menu/Reports/Sales_Report/Standard/Summary"],cw=i=>({CustomerID:i});function dw(i,c){if(i&1){let e=F();n(0,"a",12),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",13),p(2," Export "),a()}}function uw(i,c){if(i&1){let e=F();n(0,"div",14)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",15),h("ngModelChange",function(t){u(e);let l=s();return x(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",16),h("dateChange",function(t){u(e);let l=s();return x(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",17)(9,"datepicker",18),h("dateChange",function(t){u(e);let l=s();return x(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();r(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),r(4),C("date",e.pageData.Filter.From),r(2),C("date",e.pageData.Filter.To)}}function _w(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",21),p(3),a()(),n(4,"td"),p(5),d(6,"date"),a(),n(7,"td"),p(8),d(9,"date"),a(),n(10,"td"),p(11),a(),n(12,"td")(13,"a",21),p(14),a()(),n(15,"td"),p(16),d(17,"number"),a()()),i&2){let e=c.$implicit;r(2),m("routerLink",b(18,pw))("queryParams",U(19,mw,e.CustomerID)),r(),w(e.Name),r(2),w(y(6,10,e.FirstPurchase,"dd/MM/yyyy")),r(3),w(y(9,13,e.LastPurchase,"dd/MM/yyyy")),r(3),w(e.Days),r(2),m("routerLink",b(21,sw))("queryParams",U(22,cw,e.CustomerID)),r(),w(e.Orders),r(2),w(f(17,16,e.Amount))}}function gw(i,c){if(i&1&&(n(0,"tbody",19),g(1,_w,18,24,"tr",20),a()),i&2){let e=s();r(),m("ngForOf",e.data.Data)}}var ba=class i extends he{constructor(e,o,t,l,S){super(e,o,"SalesReport/CustomerLastPurchase");this.httpService=o;this.matDialog=t;this.datePipe=l;this.roleService=S}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}openExportModal(){this.matDialog.open(q,{data:{title:"Customer Last Purchase",exportTypes:[{ID:"ReportExport/CustomerLastPurchase",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(o){return new(o||i)(D(W),D(B),D(Y),D(ee),D(G))};static \u0275cmp=E({type:i,selectors:[["POS-last-purchase"]],standalone:!1,features:[R],decls:43,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["matTooltipPosition","above","matTooltip","(Todays - last purchase date)"],["class","border-bottom",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[3,"routerLink","queryParams"]],template:function(o,t){if(o&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),h("filterChange",function(P){return u(l),x(t.pageData.Filter,P)||(t.pageData.Filter=P),_(P)}),n(1,"actions"),g(2,dw,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Customer Group "),a()()()()(),n(22,"filters"),g(23,uw,10,6,"ng-template",null,0,M),a(),n(25,"content")(26,"div",7)(27,"table",8)(28,"thead",9)(29,"tr")(30,"th"),p(31,"Name"),a(),n(32,"th"),p(33,"First Purchase"),a(),n(34,"th"),p(35,"Last Purchase"),a(),n(36,"th",10),p(37,"Days Ago"),a(),n(38,"th"),p(39,"Orders"),a(),n(40,"th"),p(41,"Amount"),a()()(),g(42,gw,2,1,"tbody",11),a()()()()}o&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),r(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),r(6),m("routerLink",b(11,nw)),r(3),m("routerLink",b(12,aw)),r(3),m("routerLink",b(13,rw)),r(3),m("routerLink",b(14,ow)),r(3),m("routerLink",b(15,lw)),r(22),m("ngIf",t.data))},dependencies:[N,j,k,A,K,O,L,le,Q,te,ee],encapsulation:2})};var Mi=Ut(zr()),Go=Ut(Qa());var At=Ut(ln());var fw=["outletSelectorRef"],Cw=(i,c)=>c.Key;function xw(i,c){if(i&1){let e=F();n(0,"mat-chip",9),T("removed",function(){let t=u(e).$implicit,l=s();return _(l.onRemoveHandler(t))}),n(1,"span",10),p(2),a(),n(3,"button",11),I(4,"i",12),a()()}if(i&2){let e=c.$implicit;r(2),w(e.Value)}}var Ea=class i{constructor(c){this._dialogRef=c;this.modalConfig.title="Filter",this.modalConfig.customWidth="450px",this.modalConfig.headerType=_i.Success,this.pageData.set(this.data.pageData)}modalConfig=new gi;data=Ye(Jt);pageData=Ct(null);injector=Ye(Li);variant$;#e=Ye(B);listVariantSelected=Ct([]);toastr=Ye(Ke);route=Ye(Oe);outletSelector;itemHashMap=new Map;router=Ye(ui);productOrVarariantAPIURL=Ct("");minDateFrom=Ct((0,At.default)().subtract(90,"days"));maxDateFrom=Ct((0,At.default)().subtract(2,"days"));minDateTo=Ct((0,At.default)().subtract(90,"days"));maxDateTo=Ct((0,At.default)());scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];ngOnInit(){this.initializePageData(),this.handleQueryParams(),this.fetchVariantItems()}ngAfterViewChecked(){}get tooltipMessage(){return this.pageData()?this.pageData().Filter.GroupByVariant?"Max input 5 Variant":"Max input 5 Product":""}initializePageData(){qi(this.pageData,{injector:this.injector}).pipe(ri(c=>!!c),Oi(),kt(c=>{let e=c.Filter.GroupByVariant?"/API/AC/GetVariantSuggestionByCodeNName":"/api/ac/GetProductSuggestionByCodeNName";this.productOrVarariantAPIURL.set(e)})).subscribe()}handleQueryParams(){this.route.queryParamMap.pipe(kt(c=>{c.keys.length>0?this.pageData.update(e=>$e(Ze({},e),{Filter:$e(Ze({},e.Filter),{From:c.get("From"),To:c.get("To"),ListIDs:c.get("ListIDs")?c.get("ListIDs").split(","):[],ListVariantID:c.get("ListVariantID")?c.get("ListVariantID").split(","):[],GroupByVariant:JSON.parse(c.get("GroupByVariant"))||!1})})):(this.maxDateFrom.set((0,At.default)().subtract(2,"days")),this.minDateFrom.set((0,At.default)().subtract(90,"days")),this.pageData.update(e=>$e(Ze({},e),{Filter:$e(Ze({},e.Filter),{From:(0,At.default)().subtract(7,"days").format("YYYY-MM-DDTHH:mm:ss.SSS")})}))),this.listVariantSelected.set([])})).subscribe()}mergeAndReplaceWithSet(c,e,o){let t=[...c,...e];return Array.from(new Set(t.map(S=>S[o]))).map(S=>t.find(P=>P[o]===S))}fetchVariantItems(){this.route.queryParamMap.pipe(ri(c=>c&&c.keys.length>0),Ka(c=>{let o=[...c.get("ListVariantID").split(","),c.get("ID")].filter(S=>S),t=JSON.parse(c.get("GroupByVariant"))?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID",l={[JSON.parse(c.get("GroupByVariant"))?"ListVariantID":"ListProductID"]:[...new Set(o)]};return this.#e.post(t,l).pipe(Ti(()=>mi(null)))}),ri(c=>!!c),kt(c=>{this.listVariantSelected.set(this.mergeAndReplaceWithSet(this.listVariantSelected(),c,"Key"))})).subscribe()}onVariantSelected(c){let e=this.pageData().Filter.GroupByVariant?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID",o={[this.pageData().Filter.GroupByVariant?"ListVariantID":"ListProductID"]:[JSON.parse(c).Key]};this.#e.post(e,o).pipe(Ti(()=>mi(null)),kt(t=>{this.listVariantSelected.set(this.mergeAndReplaceWithSet(this.listVariantSelected(),t,"Key"))})).subscribe()}onScopeChange(c){this.pageData.update(e=>$e(Ze({},e),{Filter:$e(Ze({},e.Filter),{GroupByVariant:c})})),this.listVariantSelected.set([])}onRemoveHandler(c){this.listVariantSelected.set(this.listVariantSelected().filter(e=>e.Key!==c.Key))}onOk(){if(Array.isArray(this.listVariantSelected())&&this.listVariantSelected().length<=0){this.toastr.warning("Please select at least one variant",_i.Warning);return}this.pageData.update(e=>$e(Ze({},e),{Filter:$e(Ze({},e.Filter),{ListVariantID:[...this.listVariantSelected().map(o=>o.Key)]})})),this._dialogRef.close({role:"OK",data:Ze({},this.pageData())}),this.router.navigate(["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],{queryParams:{From:(0,At.default)(this.pageData().Filter.From).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,At.default)(this.pageData().Filter.To).format("YYYY-MM-DDTHH:mm:ss.SSS"),GroupByVariant:JSON.stringify(this.pageData().Filter.GroupByVariant),ListIDs:this.pageData().Filter.ListIDs.join(","),ListVariantID:this.pageData().Filter.ListVariantID.join(",")},queryParamsHandling:"merge",replaceUrl:!0})}close(){this._dialogRef.close({role:"close",data:null})}static \u0275fac=function(e){return new(e||i)(D(Zt))};static \u0275cmp=E({type:i,selectors:[["pos-dialog-prod-sales-qty-chart"]],viewQuery:function(e,o){if(e&1&&Ni(fw,5),e&2){let t;Ai(t=Gi())&&(o.outletSelector=t.first)}},decls:22,vars:17,consts:[[3,"onOk","onCancel","onClose","config"],[1,"d-flex","flex-column","gap-4"],[1,"d-flex","flex-column","gap-2"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["inputID","Key","placeholder","Search an Variant or Product",1,"w-100",3,"optionSelected","matTooltip","readonly","requestUrl","clearOnSelect"],["aria-label","Fish selection"],["name","From",3,"dateChange","maxDateValidation","minDateValidation","date"],["name","To",3,"dateChange","maxDateValidation","minDateValidation","date"],["name","Scope",3,"modelChange","model","options"],[3,"removed"],[1,"d-inline-block","text-truncate",2,"max-width","150px"],["matChipRemove",""],[1,"fa-solid","fa-circle-xmark"]],template:function(e,o){e&1&&(n(0,"modal-material",0),T("onOk",function(){return o.onOk()})("onCancel",function(){return o.close()})("onClose",function(){return o.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",3),h("ngModelChange",function(l){return x(o.pageData().Filter.ListIDs,l)||(o.pageData().Filter.ListIDs=l),l}),a()(),n(7,"div",2)(8,"h6"),p(9,"Product to Analyze"),a(),n(10,"autocompleteV2",4),T("optionSelected",function(l){return o.onVariantSelected(l)}),a(),n(11,"mat-chip-set",5),Fi(12,xw,5,1,"mat-chip",null,Cw),a()(),n(14,"div",2)(15,"h6"),p(16,"From - To"),a(),n(17,"datepicker",6),h("dateChange",function(l){return x(o.pageData().Filter.From,l)||(o.pageData().Filter.From=l),l}),a(),n(18,"datepicker",7),h("dateChange",function(l){return x(o.pageData().Filter.To,l)||(o.pageData().Filter.To=l),l}),a()(),n(19,"h6"),p(20,"Scope"),a(),n(21,"radio-options",8),T("modelChange",function(l){return o.onScopeChange(l)}),a()()()()),e&2&&(m("config",o.modalConfig),r(6),m("multiple",!0)("accessType",2)("outlets",o.pageData().Options.Entities),C("ngModel",o.pageData().Filter.ListIDs),r(4),m("matTooltip",o.tooltipMessage)("readonly",o.listVariantSelected().length>=5)("requestUrl",o.productOrVarariantAPIURL())("clearOnSelect",!0),r(2),Ii(o.listVariantSelected()),r(5),m("maxDateValidation",o.maxDateFrom())("minDateValidation",o.minDateFrom()),C("date",o.pageData().Filter.From),r(),m("maxDateValidation",o.maxDateTo())("minDateValidation",o.minDateTo()),C("date",o.pageData().Filter.To),r(3),m("model",o.pageData().Filter.GroupByVariant)("options",o.scopeFilter))},dependencies:[zt,Xt,O,L,Ci,en,$t,Q,xi,K,ro,no,io,ao,on,we,rn,Le,Ki,le],styles:["[_nghost-%COMP%]{display:block}"]})};var ni=Ut(ln());var hw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Sw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],yw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Dw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],vw=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ww=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"];function Tw(i,c){}(0,Go.default)(Mi.default);var Ma=class i{constructor(c,e,o,t,l,S,P,Ee,xt){this.route=c;this.httpService=e;this.pageSetupService=o;this.matDialog=t;this.toastr=l;this.title=S;this.cdr=P;this.injector=Ee;this.router=xt}loader$;chartData$;dialogOpened=!1;colorsChart=["#FF0060","#131010","#00DFA2","#fcbf49","#0079FF"];seriesData=Ct(null);Highcharts=Ct(Mi.default);variantOrProductItems=Ct([]);menu$;ngOnInit(){this.initializeLoader(),this.pageSetupService.setMenu$(),this.handleVariantOrProductItems(),this.handleChartQuantitySold(),this.loadInitialData()}ngAfterViewInit(){this.updateChartOptions()}initializeLoader(){if(this.route.snapshot.queryParamMap.keys.length>0){let e=this.route.snapshot.queryParamMap.get("From"),o=this.route.snapshot.queryParamMap.get("To"),t=(0,ni.default)(e).isSame((0,ni.default)(o),"day");this.router.navigate([],{queryParams:{From:t?(0,ni.default)(o).subtract(6,"days").format("YYYY-MM-DDTHH:mm:ss.SSS"):(0,ni.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,ni.default)(this.route.snapshot.queryParamMap.get("To")).format("YYYY-MM-DDTHH:mm:ss.SSS")},queryParamsHandling:"merge",replaceUrl:!0})}this.loader$=this.httpService.post("/API/SalesReportLoader/GetChartQuantitySold",{}).pipe(Rt(1))}parseQueryParams(c){let e=c.get("ID")?[c.get("ID")]:c.get("ListVariantID")?[...c.get("ListVariantID").split(",")]:[];return{ListVariantID:[...new Set(e)],GroupByVariant:JSON.parse(c.get("GroupByVariant")||"false"),From:(0,ni.default)(c.get("From")).format("YYYY-MM-DDTHH:mm:ss.SSS"),To:(0,ni.default)(c.get("To")).format("YYYY-MM-DDTHH:mm:ss.SSS"),ListIDs:c.get("ListIDs")?c.get("ListIDs").split(","):[]}}fetchVariantOrProductItems(c,e){let o=e?"/api/catalog/variant/GetListVariantNameByListID":"/api/catalog/Product/GetListProductNameByListID";return this.httpService.post(o,{[e?"ListVariantID":"ListProductID"]:c}).pipe(ri(t=>!!t),Gt(t=>({Key:t.Key,Value:t.Value})),Rt(1))}fetchChartQuantitySold(c){return this.httpService.post("/API/SalesReport/GetChartQuantitySold",c).pipe(Gt(e=>$e(Ze({},e),{chart:{type:"spline"},series:e.Data.Series.map((o,t)=>$e(Ze({},o),{data:o.data,name:o.name,color:this.colorsChart[t]}))})),kt(e=>{Object.prototype.hasOwnProperty.call(e,"ErrorMessage")&&this.toastr.error(e.ErrorMessage,"API Error - 400")}),Ti(e=>mi(null)),Rt(1))}handleVariantOrProductItems(){let c=this.route.snapshot.queryParamMap,{ListVariantID:e,GroupByVariant:o}=this.parseQueryParams(c);this.fetchVariantOrProductItems(e,o).pipe(kt(t=>{this.variantOrProductItems.set([...this.variantOrProductItems(),t])})).subscribe()}handleChartQuantitySold(){this.chartData$=this.loader$.pipe(za(100),Oa(c=>{let e=this.route.snapshot.queryParamMap;if(e&&e.keys.length>0){let o=this.parseQueryParams(e);return this.fetchChartQuantitySold(o)}else return this.dialogOpened||(this.openDialogFilter(),this.dialogOpened=!0),this.fetchChartQuantitySold(c.Filter)}),Rt(1)),Ba([this.chartData$,this.pageSetupService.menu$]).pipe(Gt(([c,e])=>({chartData:c,menu:$e(Ze({},e),{H:c.FullPageTitle,T:e.T.replace("undefined",c.FullPageTitle)})})),kt(({chartData:c,menu:e})=>{this.menu$=mi(e),this.seriesData.set(c.Data),this.title.setTitle(e.T),this.cdr.markForCheck()})).subscribe()}loadInitialData(){this.chartData$.subscribe()}getCookie(c){let e=document.cookie.match(new RegExp("(?:^|; )"+c.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}updateChartOptions(){qi(this.seriesData,{injector:this.injector}).pipe(ri(c=>!!c),Oi(),kt(c=>Mi.default.chart("chart-container",{time:{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},chart:{type:"spline",style:{fontFamily:"Roboto Slab, sans-serif"}},title:{text:""},tooltip:{enabled:!0,xDateFormat:"%e %b",shared:!0},credits:{enabled:!1},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom",backgroundColor:Mi.default.defaultOptions.legend.backgroundColor||"#FFFFFF"},yAxis:{title:{text:""}},xAxis:{type:"datetime",dateTimeLabelFormats:{day:"%e %b",week:"%e %m",month:"%e %m",year:"%e %m"},labels:{format:"{value:%e %b}"}},plotOptions:{series:{label:{enabled:!0},pointStart:new Date(c.From).getTime(),pointInterval:24*3600*1e3},line:{dataLabels:{enabled:!0,filter:{property:"y",operator:">",value:0}}}},series:c.Series.map((e,o)=>$e(Ze({},e),{color:this.colorsChart[o]}))}))).subscribe()}openDialogFilter(){Ba([this.loader$]).pipe(Gt(([c])=>({loader:c})),Oa(({loader:c})=>{let e=this.getCookie("ReportFilter")?JSON.parse(this.getCookie("ReportFilter")):null,o=$e(Ze({},c),{Filter:$e(Ze({},c.Filter),{From:e?e.from:c.Filter.From,To:e?e.to:c.Filter.To})});return this.matDialog.open(Ea,{data:{pageData:o}}).afterClosed()}),kt(()=>{this.handleChartQuantitySold()})).subscribe()}static \u0275fac=function(e){return new(e||i)(D(Oe),D(B),D(W),D(Y),D(Ke),D(rr),D(ir),D(Li),D(ui))};static \u0275cmp=E({type:i,selectors:[["pos-product-sales-qty-chart"]],decls:35,vars:17,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","custom-header",5,["custom-header"]],[1,"d-flex","align-items-center","gap-4",2,"margin","0.6rem 0"],[1,"d-flex","pe-auto",2,"cursor","pointer",3,"click"],[1,"fa","fa-filter"],[1,"fa-solid","fa-caret-down"],["ngProjectAs","actions",5,["actions"]],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["filters",""],["id","chart-container",2,"margin","1.5rem 0.3rem"]],template:function(e,o){if(e&1){let t=F();n(0,"mainpanel-cmp",1),d(1,"async"),se(2,2),n(3,"nav",3)(4,"div",4),T("click",function(){return u(t),_(o.openDialogFilter())}),I(5,"i",5)(6,"i",6),a()(),ce(),se(7,7),n(8,"div",8)(9,"button",9),p(10," More "),a(),n(11,"ul",10)(12,"li")(13,"a",11),p(14," Product Sold "),a()(),n(15,"li")(16,"a",11),p(17," Compare by Outlet "),a()(),n(18,"li")(19,"a",11),p(20," Compare by Month "),a()(),n(21,"li")(22,"a",11),p(23," Compare with Transfer Order "),a()(),n(24,"li")(25,"a",11),p(26," Product Tags Analysis "),a()(),n(27,"li")(28,"a",11),p(29," Top Suppliers "),a()()()(),ce(),se(30,12),g(31,Tw,0,0,"ng-template",null,0,M),ce(),n(33,"content"),I(34,"div",13),a()()}e&2&&(m("pageData",f(1,9,o.menu$))("hideSearchBox",!0)("hideSearchDropdown",!0),r(13),m("routerLink",b(11,hw)),r(3),m("routerLink",b(12,Sw)),r(3),m("routerLink",b(13,yw)),r(3),m("routerLink",b(14,Dw)),r(3),m("routerLink",b(15,vw)),r(3),m("routerLink",b(16,ww)))},dependencies:[zt,Yi,Ei,A,Ci,N,xi,Xt],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var Pw=[{path:"Sales_Report/Standard/Detail",component:cn},{path:"Sales_Report/Standard/Summary",component:un},{path:"Sales_Report/Standard/Top_Brand",component:_n},{path:"Sales_Report/Standard/Top_Brand/Top_Brand_Chart",component:Da},{path:"Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis",component:fa},{path:"Sales_Report/Standard/Top_Customers",component:fn},{path:"Sales_Report/Standard/Top_Customers/By_Last_Purchase",component:ba},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Age",component:Cn},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender",component:xn},{path:"Sales_Report/Standard/Products_Sold/Top_Suppliers",component:hn},{path:"Sales_Report/Standard/Top_Customers/City",component:aa},{path:"Sales_Report/Standard/Top_Customers/Customer_Group",component:ra},{path:"Sales_Report/Standard/Products_Sold",component:Sn},{path:"Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",component:Ma},{path:"Sales_Report/Standard/Products_Sold/Products_Tags",component:Ia},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet",component:yn},{path:"Sales_Report/Standard/Products_Sold/Product_Sales",component:Dn},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics",component:vn},{path:"Sales_Report/Standard/Category_Sold",component:Ta},{path:"Sales_Report/Standard/Category_Sold/Category_Sales_Tree",component:wn},{path:"Sales_Report/Standard/Category_Sold/Category_By_Outlet",component:Tn},{path:"Sales_Report/Standard/Category_Sold/Category",component:Pn},{path:"Sales_Report/Standard/Peak",component:Fn},{path:"Sales_Report/Standard/Peak/Peak",component:bn},{path:"Sales_Report/Standard/Daily",component:En},{path:"Sales_Report/Standard/Daily/Daily_Table",component:On},{path:"Sales_Report/Standard/Monthly",component:Vn},{path:"Sales_Report/Standard/Monthly/Monthly_Table",component:Ln},{path:"Sales_Report/Standard/Yearly",component:wa},{path:"Sales_Report/Standard/Yearly/Comparison",component:Bn},{path:"Sales_Report/Standard/Daily/Daily_Quantity",component:Rn},{path:"Sales_Report/Standard/Daily/Daily_Quantity/Monthly",component:kn},{path:"Sales_Report/Standard/Outlet_Performance",component:Nn},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Graphic",component:Wn},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance",component:An},{path:"Sales_Report/Standard/Sales_Order_Tag",component:Ca},{path:"Sales_Report/Standard/Person",component:Hn},{path:"Sales_Report/Standard/Person/Commission_Outlet",component:Fa},{path:"Sales_Report/Standard/Person/Commission_Report",component:Qn},{path:"Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",component:jn},{path:"Sales_Report/Standard/Person/Sales_Group",component:oa},{path:"Sales_Report/Standard/Discounted_Sales",component:Pa},{path:"Purchases_Report/Detail",component:Yn},{path:"Purchases_Report/Summary",component:qn},{path:"Purchases_Report/Supplier",component:Un},{path:"Purchases_Report/Product",component:Kn},{path:"Purchases_Report/History",component:Xn},{path:"Purchases_Report/Daily",component:Zn},{path:"Purchases_Report/Daily/Monthly",component:Jn},{path:"Purchases_Report/Volume",component:$n},{path:"Purchases_Report/Sales",component:ea},{path:"Purchases_Report/Tax",component:ya},{path:"Purchases_Report/Outlet",component:ta},{path:"Purchases_Report/Outlet/Outlet_Group_Performance",component:ia},{path:"Purchases_Report/Outlet/Outlet_Monthly_Perfomance",component:na},{path:"Sales_Report/Standard/Compare",component:va},{path:"Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance",component:Gn},{path:"Sales_Report/Advanced/Tax_Report",component:la},{path:"Sales_Report/Advanced/Visitor",component:In},{path:"Sales_Report/Advanced/Tax_Report/By_Outlet",component:pa},{path:"Sales_Report/Advanced/Product_Life_Cycle",component:ma},{path:"Sales_Report/Advanced/Product_Profit",component:sa},{path:"Sales_Report/Advanced/Exchanged_Sales",component:ca},{path:"Sales_Report/Advanced/Variant_Model_Rank",component:da},{path:"Sales_Report/Advanced/Logistics_Service",component:to},{path:"Return/Sales_Return",component:ua},{path:"Return/Purchase_Return",component:_a},{path:"Sales_Report/Standard/Products_Sold/Invoice_Items",component:ga},{path:"Sales_Report/Standard/Price_Analysis",component:Sa},{path:"",redirectTo:"Sales_Report/Standard/Products_Sold",pathMatch:"full"}],Va=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=ci({type:i});static \u0275inj=si({imports:[Ei.forChild(Pw),Ei]})};var Fw=["input"],Iw=({dt:i})=>`
|
|
11
|
+
.p-toggleswitch {
|
|
12
|
+
display: inline-block;
|
|
13
|
+
width: ${i("toggleswitch.width")};
|
|
14
|
+
height: ${i("toggleswitch.height")};
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.p-toggleswitch-input {
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
appearance: none;
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0;
|
|
23
|
+
left: 0;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
padding: 0;
|
|
27
|
+
margin: 0;
|
|
28
|
+
opacity: 0;
|
|
29
|
+
z-index: 1;
|
|
30
|
+
outline: 0 none;
|
|
31
|
+
border-radius: ${i("toggleswitch.border.radius")};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.p-toggleswitch-slider {
|
|
35
|
+
display: inline-block;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
border-width: ${i("toggleswitch.border.width")};
|
|
40
|
+
border-style: solid;
|
|
41
|
+
border-color: ${i("toggleswitch.border.color")};
|
|
42
|
+
background: ${i("toggleswitch.background")};
|
|
43
|
+
transition: background ${i("toggleswitch.transition.duration")}, color ${i("toggleswitch.transition.duration")}, border-color ${i("toggleswitch.transition.duration")}, outline-color ${i("toggleswitch.transition.duration")}, box-shadow ${i("toggleswitch.transition.duration")};
|
|
44
|
+
border-radius: ${i("toggleswitch.border.radius")};
|
|
45
|
+
outline-color: transparent;
|
|
46
|
+
box-shadow: ${i("toggleswitch.shadow")};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.p-toggleswitch-slider:before {
|
|
50
|
+
position: absolute;
|
|
51
|
+
content: "";
|
|
52
|
+
top: 50%;
|
|
53
|
+
background: ${i("toggleswitch.handle.background")};
|
|
54
|
+
width: ${i("toggleswitch.handle.size")};
|
|
55
|
+
height: ${i("toggleswitch.handle.size")};
|
|
56
|
+
left: ${i("toggleswitch.gap")};
|
|
57
|
+
margin-top: calc(-1 * calc(${i("toggleswitch.handle.size")} / 2));
|
|
58
|
+
border-radius: ${i("toggleswitch.handle.border.radius")};
|
|
59
|
+
transition: background ${i("toggleswitch.transition.duration")}, left ${i("toggleswitch.slide.duration")};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-slider {
|
|
63
|
+
background: ${i("toggleswitch.checked.background")};
|
|
64
|
+
border-color: ${i("toggleswitch.checked.border.color")};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.p-toggleswitch.p-toggleswitch-checked .p-toggleswitch-slider:before {
|
|
68
|
+
background: ${i("toggleswitch.handle.checked.background")};
|
|
69
|
+
left: calc(${i("toggleswitch.width")} - calc(${i("toggleswitch.handle.size")} + ${i("toggleswitch.gap")}));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover) .p-toggleswitch-slider {
|
|
73
|
+
background: ${i("toggleswitch.hover.background")};
|
|
74
|
+
border-color: ${i("toggleswitch.hover.border.color")};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover) .p-toggleswitch-slider:before {
|
|
78
|
+
background: ${i("toggleswitch.handle.hover.background")};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover).p-toggleswitch-checked .p-toggleswitch-slider {
|
|
82
|
+
background: ${i("toggleswitch.checked.hover.background")};
|
|
83
|
+
border-color: ${i("toggleswitch.checked.hover.border.color")};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:hover).p-toggleswitch-checked .p-toggleswitch-slider:before {
|
|
87
|
+
background: ${i("toggleswitch.handle.checked.hover.background")};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.p-toggleswitch:not(.p-disabled):has(.p-toggleswitch-input:focus-visible) .p-toggleswitch-slider {
|
|
91
|
+
box-shadow: ${i("toggleswitch.focus.ring.shadow")};
|
|
92
|
+
outline: ${i("toggleswitch.focus.ring.width")} ${i("toggleswitch.focus.ring.style")} ${i("toggleswitch.focus.ring.color")};
|
|
93
|
+
outline-offset: ${i("toggleswitch.focus.ring.offset")};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.p-toggleswitch.p-invalid > .p-toggleswitch-slider {
|
|
97
|
+
border-color: ${i("toggleswitch.invalid.border.color")};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.p-toggleswitch.p-disabled {
|
|
101
|
+
opacity: 1;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.p-toggleswitch.p-disabled .p-toggleswitch-slider {
|
|
105
|
+
background: ${i("toggleswitch.disabled.background")};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.p-toggleswitch.p-disabled .p-toggleswitch-slider:before {
|
|
109
|
+
background: ${i("toggleswitch.handle.disabled.background")};
|
|
110
|
+
}
|
|
111
|
+
`,bw={root:{position:"relative"}},Ew={root:({instance:i})=>({"p-toggleswitch p-component":!0,"p-toggleswitch-checked":i.checked(),"p-disabled":i.disabled,"p-invalid":i.invalid}),input:"p-toggleswitch-input",slider:"p-toggleswitch-slider"},Ho=(()=>{class i extends cr{name="toggleswitch";theme=Iw;classes=Ew;inlineStyles=bw;static \u0275fac=(()=>{let e;return function(t){return(e||(e=La(i)))(t||i)}})();static \u0275prov=Za({token:i,factory:i.\u0275fac})}return i})(),Mw={provide:or,useExisting:Xa(()=>Qo),multi:!0},Qo=(()=>{class i extends dr{style;styleClass;tabindex;inputId;name;disabled;readonly;trueValue=!0;falseValue=!1;ariaLabel;ariaLabelledBy;autofocus;onChange=new Ri;input;modelValue=!1;focused=!1;onModelChange=()=>{};onModelTouched=()=>{};_componentStyle=Ye(Ho);onClick(e){!this.disabled&&!this.readonly&&(this.modelValue=this.checked()?this.falseValue:this.trueValue,this.onModelChange(this.modelValue),this.onChange.emit({originalEvent:e,checked:this.modelValue}),this.input.nativeElement.focus())}onFocus(){this.focused=!0}onBlur(){this.focused=!1,this.onModelTouched()}writeValue(e){this.modelValue=e,this.cd.markForCheck()}registerOnChange(e){this.onModelChange=e}registerOnTouched(e){this.onModelTouched=e}setDisabledState(e){this.disabled=e,this.cd.markForCheck()}checked(){return this.modelValue===this.trueValue}static \u0275fac=(()=>{let e;return function(t){return(e||(e=La(i)))(t||i)}})();static \u0275cmp=E({type:i,selectors:[["p-inputSwitch"],["p-inputswitch"]],viewQuery:function(o,t){if(o&1&&Ni(Fw,5),o&2){let l;Ai(l=Gi())&&(t.input=l.first)}},inputs:{style:"style",styleClass:"styleClass",tabindex:[2,"tabindex","tabindex",nr],inputId:"inputId",name:"name",disabled:[2,"disabled","disabled",ji],readonly:[2,"readonly","readonly",ji],trueValue:"trueValue",falseValue:"falseValue",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",autofocus:[2,"autofocus","autofocus",ji]},outputs:{onChange:"onChange"},features:[Hi([Mw,Ho]),R],decls:5,vars:22,consts:[["input",""],[3,"click","ngClass","ngStyle"],[1,"p-hidden-accessible"],["type","checkbox","role","switch",3,"focus","blur","ngClass","checked","disabled","pAutoFocus"],[3,"ngClass"]],template:function(o,t){if(o&1){let l=F();n(0,"div",1),T("click",function(P){return u(l),_(t.onClick(P))}),n(1,"div",2)(2,"input",3,0),T("focus",function(){return u(l),_(t.onFocus())})("blur",function(){return u(l),_(t.onBlur())}),a()(),I(4,"span",4),a()}o&2&&($a(t.styleClass),m("ngClass",t.cx("root"))("ngStyle",t.sx("root"))("ngStyle",t.style),Ht("data-pc-name","inputswitch")("data-pc-section","root"),r(),Ht("data-pc-section","hiddenInputWrapper")("data-p-hidden-accessible",!0),r(),m("ngClass",t.cx("input"))("checked",t.checked())("disabled",t.disabled)("pAutoFocus",t.autofocus),Ht("id",t.inputId)("aria-checked",t.checked())("aria-labelledby",t.ariaLabelledBy)("aria-label",t.ariaLabel)("name",t.name)("tabindex",t.tabindex)("data-pc-section","hiddenInput"),r(2),m("ngClass",t.cx("slider")),Ht("data-pc-section","slider"))},dependencies:[zt,Ae,ar,_r,ur,Ui],encapsulation:2,changeDetection:0})}return i})(),jo=(()=>{class i{static \u0275fac=function(o){return new(o||i)};static \u0275mod=ci({type:i});static \u0275inj=si({imports:[Qo,Ui,Ui]})}return i})();var Yo=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=ci({type:i});static \u0275inj=si({providers:[ee],imports:[Ci,kr,zt,Va,z,xi,Xt,mr,zi,Xi,Fr,Zi,Pr,Er,Ki,Mr,Vr,z,fr,Cr,Br,en,on,Xr,Zr,rn,Ar,Jr,q,hi,oi,Kr,oi,fe,Q,Nr,Qe,ti,jo,Wr,eo,mn]})};export{Yo as ReportsModule};
|