dealpos 25.41.2 → 25.41.3
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-O3HYW3PV.js → chunk-2DQBDX5E.js} +1 -1
- package/browser/{chunk-LDEAORXA.js → chunk-2E4PNSTT.js} +1 -1
- package/browser/{chunk-X4LYU5XA.js → chunk-3C6ELYCG.js} +1 -1
- package/browser/{chunk-FBH7LG5C.js → chunk-3HGQ6VA3.js} +1 -1
- package/browser/{chunk-5PE5X2VB.js → chunk-3XIXVYS4.js} +1 -1
- package/browser/{chunk-SO3422SX.js → chunk-4DT4J5SA.js} +1 -1
- package/browser/{chunk-NA7ZJQET.js → chunk-4VQWWUZQ.js} +1 -1
- package/browser/{chunk-RP636SRQ.js → chunk-5BY3OQNX.js} +1 -1
- package/browser/{chunk-V3YO2TDM.js → chunk-5FMYOBKP.js} +1 -1
- package/browser/{chunk-I45IV26L.js → chunk-5YEXNQCT.js} +1 -1
- package/browser/{chunk-XHAPRGGF.js → chunk-6LQ6DVZN.js} +1 -1
- package/browser/{chunk-Y4MHZTLF.js → chunk-6MYRWSZC.js} +1 -1
- package/browser/{chunk-KMA5VOEA.js → chunk-6WKUSM4P.js} +1 -1
- package/browser/{chunk-RZFAYPJW.js → chunk-6YPVUOD7.js} +1 -1
- package/browser/{chunk-YDXY6QHK.js → chunk-6ZRIMZHA.js} +1 -1
- package/browser/{chunk-AKTKAREU.js → chunk-7KSMBMSW.js} +1 -1
- package/browser/{chunk-D5LBI5TH.js → chunk-ABSSU2NG.js} +1 -1
- package/browser/{chunk-Z3OYXF5N.js → chunk-AMNMXSBW.js} +1 -1
- package/browser/{chunk-MFIRFGE2.js → chunk-BAXQFKT2.js} +1 -1
- package/browser/{chunk-FZNAOCWZ.js → chunk-BJQ54S6Z.js} +2 -2
- package/browser/{chunk-PPWXHE7X.js → chunk-BWWKUWPU.js} +1 -1
- package/browser/{chunk-M7G3WT32.js → chunk-BYDCQMR7.js} +1 -1
- package/browser/{chunk-AAR4B3HZ.js → chunk-C5J6BILV.js} +1 -1
- package/browser/{chunk-UBMYMSUW.js → chunk-CEWIZH2D.js} +1 -1
- package/browser/{chunk-QJWMNNK6.js → chunk-EHW56RWW.js} +2 -2
- package/browser/{chunk-QE22VQQ7.js → chunk-ET53BRO2.js} +1 -1
- package/browser/{chunk-FRO3O6SU.js → chunk-EUZWX7OP.js} +1 -1
- package/browser/{chunk-PZID6T4A.js → chunk-EV7CDK2S.js} +1 -1
- package/browser/{chunk-GZ2EJLH3.js → chunk-FUQBPPS7.js} +1 -1
- package/browser/{chunk-QHX74QID.js → chunk-G6ZQA47T.js} +1 -1
- package/browser/{chunk-65CKGM2C.js → chunk-GA554R72.js} +1 -1
- package/browser/{chunk-ZFNJGBST.js → chunk-GAZ6XT73.js} +1 -1
- package/browser/{chunk-DE2STA2G.js → chunk-GPCFKZB6.js} +2 -2
- package/browser/{chunk-BZHL4W7T.js → chunk-GYJUMROD.js} +1 -1
- package/browser/{chunk-BAL3IIDS.js → chunk-H4CCCG5S.js} +1 -1
- package/browser/{chunk-HBC5DBVS.js → chunk-HKHEVZ4F.js} +1 -1
- package/browser/{chunk-PQUVDF3D.js → chunk-ITQTUFNF.js} +1 -1
- package/browser/{chunk-VP42CBUF.js → chunk-IVUIJMPR.js} +1 -1
- package/browser/chunk-JQ5JMDRA.js +1 -0
- package/browser/{chunk-N22LFPQL.js → chunk-JSMI5ZR4.js} +2 -2
- package/browser/{chunk-LID6CN6L.js → chunk-JVR63RQB.js} +1 -1
- package/browser/{chunk-GVI4QM2F.js → chunk-KLNPXOJ5.js} +1 -1
- package/browser/{chunk-ZC4V4XIM.js → chunk-LCACDZMC.js} +1 -1
- package/browser/{chunk-IXHBD564.js → chunk-LDYXX7R3.js} +1 -1
- package/browser/{chunk-TNLZPCYK.js → chunk-M3WKPJ2B.js} +1 -1
- package/browser/{chunk-4VMXYBU3.js → chunk-MACI2QKN.js} +2 -2
- package/browser/{chunk-3MDUYQJU.js → chunk-MSKOV2RA.js} +1 -1
- package/browser/{chunk-ZIQAYIU4.js → chunk-MVI65ECT.js} +1 -1
- package/browser/{chunk-HVMUCZ5I.js → chunk-MWQQC4XE.js} +1 -1
- package/browser/{chunk-SQC25JWL.js → chunk-NHP3HQCR.js} +1 -1
- package/browser/{chunk-ZKRFSVUW.js → chunk-NKHFNNJE.js} +2 -2
- package/browser/{chunk-UERDXH3W.js → chunk-O3EERFQN.js} +1 -1
- package/browser/{chunk-SSE7KV5S.js → chunk-OGM24Q2D.js} +1 -1
- package/browser/{chunk-2EQ7Y56O.js → chunk-PVWFJKSW.js} +2 -2
- package/browser/{chunk-JY5XX3QX.js → chunk-PZRVUFEQ.js} +2 -2
- package/browser/chunk-Q3AG7LWW.js +1 -0
- package/browser/{chunk-EYV7AZ42.js → chunk-Q6WPU7FA.js} +1 -1
- package/browser/{chunk-5MZEP3D7.js → chunk-QTEEAYLA.js} +1 -1
- package/browser/{chunk-6BXO4MVU.js → chunk-RDWRQIJV.js} +1 -1
- package/browser/{chunk-H54MTXKN.js → chunk-SFCQJQF3.js} +1 -1
- package/browser/{chunk-W4BJ4JBG.js → chunk-SMW5YQZJ.js} +1 -1
- package/browser/{chunk-AFYPHUZX.js → chunk-SWF5BE5P.js} +1 -1
- package/browser/{chunk-6IIF7CKF.js → chunk-T4K6XLBG.js} +1 -1
- package/browser/{chunk-E4R5MW6J.js → chunk-UCIQAWIS.js} +1 -1
- package/browser/{chunk-G7VSP6EW.js → chunk-V7USIKBO.js} +1 -1
- package/browser/{chunk-LGCRFIIA.js → chunk-VFFCV3EX.js} +1 -1
- package/browser/{chunk-34DMF3QT.js → chunk-VV7L7X33.js} +1 -1
- package/browser/{chunk-QHYHGORX.js → chunk-WRHYTFLY.js} +1 -1
- package/browser/{chunk-OFGVLEEZ.js → chunk-X44SOZNW.js} +1 -1
- package/browser/{chunk-GMX2JWEW.js → chunk-XXCIMR5I.js} +1 -1
- package/browser/{chunk-7S5F6JOF.js → chunk-YAO3JFMU.js} +1 -1
- package/browser/{chunk-TLWH7QTW.js → chunk-YHDEAPG3.js} +1 -1
- package/browser/{chunk-GVSOBS5Q.js → chunk-YMA57E2M.js} +2 -2
- package/browser/{chunk-K3367VWX.js → chunk-Z2U7HIL5.js} +1 -1
- package/browser/{chunk-SDADDOK4.js → chunk-ZEDVQYXH.js} +1 -1
- package/browser/{chunk-F4FAZ5ZL.js → chunk-ZEYY4NI2.js} +1 -1
- package/browser/{chunk-GHLCUW72.js → chunk-ZKO7GVNO.js} +1 -1
- package/browser/{chunk-CIEDGY7H.js → chunk-ZUQOVN3G.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-6UNPCULN.js → main-JSZQET37.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-7E6SMB44.js +0 -1
- package/browser/chunk-EZCQYLCW.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ii,b as or}from"./chunk-Z76AR3IW.js";import{a as mr,b as sr}from"./chunk-WUDGY4TW.js";import{a as Dn}from"./chunk-FRO3O6SU.js";import"./chunk-4NHG4RRM.js";import{a as Et,b as rr}from"./chunk-KVCJJEYJ.js";import{a as At,b as lr}from"./chunk-BAORXMVG.js";import"./chunk-YAFVFDTG.js";import{a as ar}from"./chunk-V7UEUV6F.js";import{a as ti}from"./chunk-BAL3IIDS.js";import{a as he}from"./chunk-KMA5VOEA.js";import{a as yn}from"./chunk-ATYFAKRP.js";import{a as cr}from"./chunk-AKTKAREU.js";import{a as Ye}from"./chunk-B56YVUVP.js";import{a as vt}from"./chunk-ZHDKGVTO.js";import{a as Lo}from"./chunk-LKFDM7AC.js";import{b as No}from"./chunk-L2PLXSAS.js";import"./chunk-XU5SOTZS.js";import{a as pr}from"./chunk-QGNOVY53.js";import{a as Si}from"./chunk-I6E6PXQU.js";import"./chunk-BYXBJQAS.js";import{a as dr,b as ur,d as _r,g as gr}from"./chunk-R5IO2SN4.js";import"./chunk-BADUP5JT.js";import"./chunk-OPCIBNIJ.js";import"./chunk-G6C75N4Q.js";import"./chunk-PRKAXHSJ.js";import"./chunk-WOZLNXGI.js";import{e as Wo}from"./chunk-6CJCT6YT.js";import{a as Jo,b as $o,c as er,d as tr,e as ir,f as nr}from"./chunk-6BXO4MVU.js";import"./chunk-KVJTNXOJ.js";import"./chunk-Z3OYXF5N.js";import"./chunk-2GQKEX5I.js";import"./chunk-XZQMVGBQ.js";import{c as ko,d as De,e as hn}from"./chunk-HV6ZFQAQ.js";import{a as X}from"./chunk-GOLWWX2Q.js";import{a as Bi,b as Zo,c as Sn,d as K,e as hi}from"./chunk-Z7LRKY4R.js";import{a as cn,b as gi}from"./chunk-SN3DTCGO.js";import"./chunk-3RK6DDJD.js";import{a as sn}from"./chunk-7UFQPOGN.js";import{a as Z}from"./chunk-GZAARWM2.js";import{a as en,b as tn,c as nn,f as rn,g as ln,h as pn,p as _i,q as mn}from"./chunk-2F5STFEV.js";import"./chunk-DWOLAWQN.js";import"./chunk-Y3CUYCSX.js";import"./chunk-T2PXIPKB.js";import"./chunk-QMCAG2HX.js";import{a as dn}from"./chunk-GMX2JWEW.js";import{d as Uo,f as fe}from"./chunk-34DMF3QT.js";import{a as bt,b as Xo}from"./chunk-NHTMJTLV.js";import{a as ae,b as ge,c as Oo}from"./chunk-3XMWVJ2L.js";import{a as Ko,b as zo,c as Q}from"./chunk-W4BJ4JBG.js";import{b as q}from"./chunk-ILF7FISN.js";import{a as ne}from"./chunk-65CKGM2C.js";import{a as Bo}from"./chunk-5MZEP3D7.js";import"./chunk-NW73SHIZ.js";import{a as H}from"./chunk-NDM2ODJP.js";import{d as N,e as xi}from"./chunk-H54MTXKN.js";import"./chunk-MFIRFGE2.js";import"./chunk-OMVUFMMZ.js";import"./chunk-HPLAMF75.js";import{e as qo}from"./chunk-QHYHGORX.js";import"./chunk-T6MTT57B.js";import{c as Ao}from"./chunk-4CRQAT4Y.js";import"./chunk-4L5G4WC4.js";import"./chunk-3NJFM55L.js";import"./chunk-2LFFOWKW.js";import"./chunk-OQCGVZVB.js";import"./chunk-UAI7BPPY.js";import"./chunk-6IW4MVP2.js";import{b as W}from"./chunk-XHAPRGGF.js";import"./chunk-OI2RWAOV.js";import"./chunk-7LXPGNYF.js";import{a as Go,c as Qe}from"./chunk-CN5SHMHF.js";import"./chunk-3M5M2T4L.js";import{C as Cn,F as Le,G as xn,j as an,m as on,t as Ro,u as fi,v as $t,w as _n}from"./chunk-45BASVRZ.js";import{b as pe,c as $i}from"./chunk-XOQ4SW2R.js";import{A as fn,B as Yo,C as ei,K as Ci,N as jo,g as oe,o as Ho,s as gn,z as Qo}from"./chunk-4SOJX57D.js";import"./chunk-GHC4BCCW.js";import"./chunk-GIKR6Y2K.js";import{a as un,d as z}from"./chunk-3GV7FUAX.js";import{b as Zi,e as Zt,f as Jt,g as j}from"./chunk-6BL2JKZG.js";import"./chunk-REQUYIUO.js";import{a as Mo,b as Vo}from"./chunk-QCBXPOJL.js";import{a as Eo}from"./chunk-T2PMKO3M.js";import{a as Vi}from"./chunk-2FWFPV5I.js";import{la as Fo,ma as Ji,ua as bo}from"./chunk-OE7PM4Y4.js";import{F as Nt,G as Xi,a as vo,b as wo,c as ke,h as B,l as To,o as L,q as Po,s as Io}from"./chunk-CB33ZMNF.js";import"./chunk-TLWH7QTW.js";import"./chunk-TNLZPCYK.js";import{a as V,d as G}from"./chunk-TYBAV5LT.js";import"./chunk-O3HYW3PV.js";import{$a as o,$b as ji,Ac as C,Ba as Ni,Bc as y,Cc as ui,Db as Hi,E as oi,Eb as za,Fa as Ai,Fc as M,Gb as bi,Hb as Ei,I as Ii,Ib as n,Jb as a,K as po,Kb as F,Kc as xo,Lb as se,M as mo,Ma as ct,Mb as ce,Mc as Ui,Nb as fo,Nc as ho,Ob as I,Od as Oe,Pc as Xa,Q as Wi,Qb as P,Qc as So,Qd as zi,Rb as s,Rd as A,Td as Mi,Ub as dt,Va as Pe,Vd as Ke,Wa as Gi,Wc as He,Y as Rt,Yc as Y,Yd as O,Zb as Qi,Zc as k,_b as Yi,aa as Ua,ad as yo,cd as Ki,db as D,dc as Je,ec as p,ed as ee,fa as kt,fc as T,gc as v,gd as ie,hc as zt,ia as so,ib as uo,ja as co,jc as x,jd as Xt,ka as si,kb as E,kc as h,lb as ci,lc as S,na as Ge,o as mi,ob as R,pc as di,qb as g,qc as b,rc as U,sc as de,t as Qt,tc as mt,u as qa,ub as Yt,uc as jt,va as u,vb as m,vc as qi,wa as _,wb as _o,wc as Co,wd as Do,xb as Fi,za as Ka,zb as go,zc as d}from"./chunk-DJOHANFC.js";import{a as Ze,b as et,e as ll,g as Ht}from"./chunk-7DCB7DB2.js";var no=ll((pb,Va)=>{(function(i){typeof Va=="object"&&Va.exports?(i.default=i,Va.exports=i):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts"],function(c){return i(c),i.Highcharts=c,i}):i(typeof Highcharts<"u"?Highcharts:void 0)})(function(i){"use strict";var c=i?i._modules:{};function e(l,t,r,f){l.hasOwnProperty(t)||(l[t]=f.apply(null,r),typeof CustomEvent=="function"&&i.win.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:l[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 l(r,f,w,Ee,xt,ut){let Vt=(ut-f)*(w-r)-(Ee-f)*(xt-r);return Vt>0||!(Vt<0)}function t(r,f,w,Ee,xt,ut,Vt,Wt){return l(r,f,xt,ut,Vt,Wt)!==l(w,Ee,xt,ut,Vt,Wt)&&l(r,f,w,Ee,xt,ut)!==l(r,f,w,Ee,Vt,Wt)}return{boxIntersectLine:function(r,f,w,Ee,xt,ut,Vt,Wt){return t(r,f,r+w,f,xt,ut,Vt,Wt)||t(r+w,f,r+w,f+Ee,xt,ut,Vt,Wt)||t(r,f+Ee,r+w,f+Ee,xt,ut,Vt,Wt)||t(r,f,r,f+Ee,xt,ut,Vt,Wt)},intersectRect:function(r,f){return!(f.left>r.right||f.right<r.left||f.top>r.bottom||f.bottom<r.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(l,t,r,f,w,Ee,xt){let{animObject:ut}=l,{format:Vt}=t,{setOptions:Wt}=r,{composed:tl}=f,{boxIntersectLine:ao,intersectRect:il}=Ee,{addEvent:oo,extend:ro,fireEvent:nl,isNumber:Ri,pick:qt,pushUnique:al,syncTimeout:ol}=xt;function li(st,Me,at,we,Pt){let it=st.chart,$=st.options.label||{},ze=qt($.onArea,!!st.area),je=ze||$.connectorAllowed,lt=it.boxesToAvoid,Bt=Number.MAX_VALUE,It=Number.MAX_VALUE,ht,_t,gt,Ut,Ft,Xe,be;for(Xe=0;lt&&Xe<lt.length;Xe+=1)if(il(lt[Xe],{left:Me,right:Me+we.width,top:at,bottom:at+we.height}))return!1;for(Xe=0;Xe<it.series.length;Xe+=1){let ot=it.series[Xe],Ve=ot.interpolatedPoints&&[...ot.interpolatedPoints];if(ot.visible&&Ve){let Ue=it.plotHeight/10;for(let $e=it.plotTop;$e<=it.plotTop+it.plotHeight;$e+=Ue)Ve.unshift({chartX:it.plotLeft,chartY:$e}),Ve.push({chartX:it.plotLeft+it.plotWidth,chartY:$e});for(be=1;be<Ve.length;be+=1){if(Ve[be].chartX>=Me-16&&Ve[be-1].chartX<=Me+we.width+16){if(ao(Me,at,we.width,we.height,Ve[be-1].chartX,Ve[be-1].chartY,Ve[be].chartX,Ve[be].chartY))return!1;st===ot&&!gt&&Pt&&(gt=ao(Me-16,at-16,we.width+32,we.height+32,Ve[be-1].chartX,Ve[be-1].chartY,Ve[be].chartX,Ve[be].chartY))}(je||gt)&&(st!==ot||ze)&&(Bt=Math.min(Bt,(Ut=Me+we.width/2-Ve[be].chartX)*Ut+(Ft=at+we.height/2-Ve[be].chartY)*Ft))}if(!ze&&je&&st===ot&&(Pt&&!gt||Bt<Math.pow($.connectorNeighbourDistance||1,2))){for(be=1;be<Ve.length;be+=1)(ht=Math.min(Math.pow(Me+we.width/2-Ve[be].chartX,2)+Math.pow(at+we.height/2-Ve[be].chartY,2),Math.pow(Me-Ve[be].chartX,2)+Math.pow(at-Ve[be].chartY,2),Math.pow(Me+we.width-Ve[be].chartX,2)+Math.pow(at-Ve[be].chartY,2),Math.pow(Me+we.width-Ve[be].chartX,2)+Math.pow(at+we.height-Ve[be].chartY,2),Math.pow(Me-Ve[be].chartX,2)+Math.pow(at+we.height-Ve[be].chartY,2)))<It&&(It=ht,_t=Ve[be]);gt=!0}}}return(!Pt||!!gt)&&{x:Me,y:at,weight:Bt-(_t?It:0),connectorPoint:_t}}function lo(st){if(this.renderer){let Me=this,at=ut(Me.renderer.globalAnimation).duration;Me.labelSeries=[],Me.labelSeriesMaxSum=0,Me.seriesLabelTimer&&xt.clearTimeout(Me.seriesLabelTimer),Me.series.forEach(function(we){let Pt=we.options.label||{},it=we.labelBySeries,$=it&&it.closest;Pt.enabled&&we.visible&&(we.graph||we.area)&&!we.boosted&&Me.labelSeries&&(Me.labelSeries.push(we),Pt.minFontSize&&Pt.maxFontSize&&we.yData&&(we.sum=we.yData.reduce((ze,je)=>(ze||0)+(je||0),0),Me.labelSeriesMaxSum=Math.max(Me.labelSeriesMaxSum||0,we.sum||0)),st.type==="load"&&(at=Math.max(at,ut(we.options.animation).duration)),$&&($[0].plotX!==void 0?it.animate({x:$[0].plotX+$[1],y:$[0].plotY+$[2]}):it.attr({opacity:0})))}),Me.seriesLabelTimer=ol(function(){Me.series&&Me.labelSeries&&function(we){we.boxesToAvoid=[];let Pt=we.labelSeries||[],it=we.boxesToAvoid;we.series.forEach($=>($.points||[]).forEach(ze=>(ze.dataLabels||[]).forEach(je=>{let{width:lt,height:Bt}=je.getBBox(),It=(je.translateX||0)+($.xAxis?$.xAxis.pos:$.chart.plotLeft),ht=(je.translateY||0)+($.yAxis?$.yAxis.pos:$.chart.plotTop);it.push({left:It,top:ht,right:It+lt,bottom:ht+Bt})}))),Pt.forEach(function($){let ze=$.options.label||{};$.interpolatedPoints=function(je){let lt,Bt,It,ht,_t;if(!je.xAxis&&!je.yAxis)return;let gt=je.points,Ut=[],Ft=je.graph||je.area,Xe=Ft&&Ft.element,be=je.chart.inverted,ot=je.xAxis,Ve=je.yAxis,Ue=be?Ve.pos:ot.pos,$e=be?ot.pos:Ve.pos,Dt=be?ot.len:Ve.len,Pi=be?Ve.len:ot.len,ft=qt((je.options.label||{}).onArea,!!je.area),Ne=Ve.getThreshold(je.options.threshold),wt={},Kt=be?"chartCenterX":"chartCenterY";function ai(nt){let St=Math.round((nt.plotX||0)/8)+","+Math.round((nt.plotY||0)/8);wt[St]||(wt[St]=1,Ut.push(nt))}if(je.getPointSpline&&Xe&&Xe.getPointAtLength&&!ft&>.length<(je.chart.plotSizeX||0)/16){let nt=Ft.toD&&Ft.attr("d");for(Ft.toD&&Ft.attr({d:Ft.toD}),It=Xe.getTotalLength(),lt=0;lt<It;lt+=16){let Lt=Xe.getPointAtLength(lt),Ct=be?Pi-Lt.y:Lt.x,pt=be?Dt-Lt.x:Lt.y;ai({chartX:Ue+Ct,chartY:$e+pt,plotX:Ct,plotY:pt})}nt&&Ft.attr({d:nt});let St=gt[gt.length-1].pos();ai({chartX:Ue+(St?.[0]||0),chartY:$e+(St?.[1]||0)})}else{let nt;for(lt=0,It=gt.length;lt<It;lt+=1){let St=gt[lt],[Lt,Ct]=St.pos()||[],{plotHigh:pt}=St;if(Ri(Lt)&&Ri(Ct)){let rt={plotX:Lt,plotY:Ct,chartX:Ue+Lt,chartY:$e+Ct};if(ft&&(pt&&(rt.plotY=pt,rt.chartY=$e+pt),be?rt.chartCenterX=Ue+Pi-((pt||St.plotY||0)+qt(St.yBottom,Ne))/2:rt.chartCenterY=$e+((pt||Ct)+qt(St.yBottom,Ne))/2),nt&&(Bt=Math.max(Math.abs(rt.chartX-nt.chartX),Math.abs(rt.chartY-nt.chartY)))>16)for(_t=1,ht=Math.ceil(Bt/16);_t<ht;_t+=1)ai({chartX:nt.chartX+(rt.chartX-nt.chartX)*(_t/ht),chartY:nt.chartY+(rt.chartY-nt.chartY)*(_t/ht),[Kt]:(nt[Kt]||0)+((rt[Kt]||0)-(nt[Kt]||0))*(_t/ht),plotX:(nt.plotX||0)+(Lt-(nt.plotX||0))*(_t/ht),plotY:(nt.plotY||0)+(Ct-(nt.plotY||0))*(_t/ht)});ai(rt),nt=rt}}}return Ut}($),it.push(...ze.boxesToAvoid||[])}),we.series.forEach(function($){let ze=$.options.label;if(!ze||!$.xAxis&&!$.yAxis)return;let je="highcharts-color-"+qt($.colorIndex,"none"),lt=!$.labelBySeries,Bt=ze.minFontSize,It=ze.maxFontSize,ht=we.inverted,_t=ht?$.yAxis.pos:$.xAxis.pos,gt=ht?$.xAxis.pos:$.yAxis.pos,Ut=we.inverted?$.yAxis.len:$.xAxis.len,Ft=we.inverted?$.xAxis.len:$.yAxis.len,Xe=$.interpolatedPoints,be=qt(ze.onArea,!!$.area),ot=[],Ve=$.xData||[],Ue,$e,Dt,Pi,ft,Ne,wt=$.labelBySeries,Kt,ai,nt;function St(Ct,pt,rt){let ki=Math.max(_t,qt(ai,-1/0)),pi=Math.min(_t+Ut,qt(nt,1/0));return Ct>ki&&Ct<=pi-rt.width&&pt>=gt&&pt<=gt+Ft-rt.height}function Lt(){wt&&($.labelBySeries=wt.destroy())}if(be&&!ht&&(Kt=[$.xAxis.toPixels(Ve[0]),$.xAxis.toPixels(Ve[Ve.length-1])],ai=Math.min.apply(Math,Kt),nt=Math.max.apply(Math,Kt)),$.visible&&!$.boosted&&Xe){if(!wt){let Ct=$.name;if(typeof ze.format=="string"?Ct=Vt(ze.format,$,we):ze.formatter&&(Ct=ze.formatter.call($)),$.labelBySeries=wt=we.renderer.label(Ct,0,0,"connector",0,0,ze.useHTML).addClass("highcharts-series-label highcharts-series-label-"+$.index+" "+($.options.className||"")+" "+je),!we.renderer.styledMode){let pt=typeof $.color=="string"?$.color:"#666666";wt.css(ro({color:be?we.renderer.getContrast(pt):pt},ze.style||{})),wt.attr({opacity:we.renderer.forExport?1:0,stroke:$.color,"stroke-width":1})}Bt&&It&&wt.css({fontSize:Bt+($.sum||0)/($.chart.labelSeriesMaxSum||0)*(It-Bt)+"px"}),wt.attr({padding:0,zIndex:3}).add()}for((Ue=wt.getBBox()).width=Math.round(Ue.width),ft=Xe.length-1;ft>0;ft-=1)be?St($e=(Xe[ft].chartCenterX??Xe[ft].chartX)-Ue.width/2,Dt=(Xe[ft].chartCenterY??Xe[ft].chartY)-Ue.height/2,Ue)&&(Ne=li($,$e,Dt,Ue)):(St($e=Xe[ft].chartX+3,Dt=Xe[ft].chartY-Ue.height-3,Ue)&&(Ne=li($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX+3,Dt=Xe[ft].chartY+3,Ue)&&(Ne=li($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX-Ue.width-3,Dt=Xe[ft].chartY+3,Ue)&&(Ne=li($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX-Ue.width-3,Dt=Xe[ft].chartY-Ue.height-3,Ue)&&(Ne=li($,$e,Dt,Ue,!0))),Ne&&ot.push(Ne);if(ze.connectorAllowed&&!ot.length&&!be)for($e=_t+Ut-Ue.width;$e>=_t;$e-=16)for(Dt=gt;Dt<gt+Ft-Ue.height;Dt+=16)(Pi=li($,$e,Dt,Ue,!0))&&ot.push(Pi);if(ot.length){ot.sort((pt,rt)=>rt.weight-pt.weight),Ne=ot[0],(we.boxesToAvoid||[]).push({left:Ne.x,right:Ne.x+Ue.width,top:Ne.y,bottom:Ne.y+Ue.height});let Ct=Math.sqrt(Math.pow(Math.abs(Ne.x-(wt.x||0)),2)+Math.pow(Math.abs(Ne.y-(wt.y||0)),2));if(Ct&&$.labelBySeries){let pt,rt={opacity:we.renderer.forExport?1:0,x:Ne.x,y:Ne.y},ki={opacity:1};Ct<=10&&(ki={x:rt.x,y:rt.y},rt={}),lt&&(pt=ut($.options.animation),pt.duration*=.2),$.labelBySeries.attr(ro(rt,{anchorX:Ne.connectorPoint&&(Ne.connectorPoint.plotX||0)+_t,anchorY:Ne.connectorPoint&&(Ne.connectorPoint.plotY||0)+gt})).animate(ki,pt),$.options.kdNow=!0,$.buildKDTree();let pi=$.searchPoint({chartX:Ne.x,chartY:Ne.y},!0);pi&&(wt.closest=[pi,Ne.x-(pi.plotX||0),Ne.y-(pi.plotY||0)])}}else Lt()}else Lt()}),nl(we,"afterDrawSeriesLabels")}(Me)},Me.renderer.forExport||!at?0:at)}}function rl(st,Me,at,we,Pt){let it=Pt&&Pt.anchorX,$=Pt&&Pt.anchorY,ze,je,lt=at/2;return Ri(it)&&Ri($)&&(ze=[["M",it,$]],(je=Me-$)<0&&(je=-we-je),je<at&&(lt=it<st+at/2?je:at-je),$>Me+we?ze.push(["L",st+lt,Me+we]):$<Me?ze.push(["L",st+lt,Me]):it<st?ze.push(["L",st,Me+we/2]):it>st+at&&ze.push(["L",st+at,Me+we/2])),ze||[]}return{compose:function(st,Me){al(tl,"SeriesLabel")&&(oo(st,"load",lo),oo(st,"redraw",lo),Me.prototype.symbols.connector=rl,Wt({plotOptions:{series:{label:w}}}))}}}),e(c,"masters/modules/series-label.src.js",[c["Core/Globals.js"],c["Extensions/SeriesLabel/SeriesLabel.js"]],function(l,t){return t.compose(l.Chart,l.SVGRenderer),l})})});var fr=(i,c)=>({"text-success":i,"text-danger":c});function pl(i,c){if(i&1&&(se(0),n(1,"span"),p(2),d(3,"number"),a(),ce()),i&2){let e=c.ngIf;o(2),v(" ",y(3,1,e.Quantity,"1.0-0")," ")}}function ml(i,c){if(i&1){let e=I();n(0,"span",8),P("click",function(){u(e);let t=s(2);return _(t.loadComplementaryQuantity())}),F(1,"i",9),a()}}function sl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"td")(3,"span",5),p(4," Cost "),a()(),n(5,"td")(6,"span",7),p(7),d(8,"amountFraction"),a()(),n(9,"td")(10,"span",7),p(11),d(12,"number"),a()()(),ce()),i&2){let e=s().ngIf;o(7),v(" ",C(8,2,e.Cost)," "),o(4),v(" ",y(12,4,e.CostRatio,"1.0-2"),"% ")}}function cl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"td")(3,"span",5),p(4," Profit "),a()(),n(5,"td")(6,"span",10),p(7),d(8,"amountFraction"),a()(),n(9,"td")(10,"span",11),p(11),d(12,"number"),a()()(),ce()),i&2){let e=s().ngIf;o(6),m("ngClass",de(9,fr,e.Profit>0,e.Profit<0)),o(),v(" ",C(8,4,e.Profit)," "),o(3),m("ngClass",de(12,fr,e.ProfitRatio>0,e.ProfitRatio<0)),o(),v("",y(12,6,e.ProfitRatio,"1.0-2"),"%")}}function dl(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(),F(10,"td"),a(),n(11,"tr")(12,"td")(13,"span",5),p(14," Quantity "),a()(),n(15,"td"),p(16),d(17,"quantityFraction"),a(),F(18,"td"),a(),n(19,"tr")(20,"td")(21,"span",5),p(22," Complementary "),a()(),n(23,"td"),g(24,pl,4,4,"ng-container",6),d(25,"async"),g(26,ml,2,0,"ng-template",null,0,M),a(),F(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(),F(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(),F(56,"td"),a(),n(57,"tr")(58,"td")(59,"span",5),p(60," Tax "),a()(),n(61,"td"),p(62),d(63,"amountFraction"),a(),F(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(),F(72,"td"),a(),g(73,sl,13,7,"ng-container",3)(74,cl,13,15,"ng-container",3),a()(),ce()),i&2){let e=c.ngIf,l=Je(27),t=s();o(8),T(C(9,12,e.Orders)),o(8),T(C(17,14,e.Quantity)),o(8),m("ngIf",C(25,16,t.complementaryQuantity$))("ngIfElse",l),o(10),T(C(35,18,e.GrossSales)),o(9),v(" ",C(44,20,e.Discount)," "),o(4),v(" ",y(48,22,e.DiscountRatio,"1.0-2"),"% "),o(7),T(C(55,25,e.Sales)),o(8),T(C(63,27,e.Tax)),o(8),T(C(71,29,e.SalesWithTax)),o(3),m("ngIf",t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost),o(),m("ngIf",t.roleService.report.Profit)}}var vn=class i{constructor(c,e,l,t){this.httpService=c;this.roleService=e;this.dialogRef=l;this.data=t;this.fractionDigit=this.data.FractionDigit}modalConfig;reportSummary$;fractionDigit;filter;complementaryQuantity$;ngOnInit(){this.reportSummary$=this.httpService.post("/api/Report/ReportDetailFooter",this.data.Filter).pipe(Qt(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 fi,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,l){let t=0;return this.data?.IncludeTax&&(e+=l),e!=0&&(t=c/e*100),t}profitRatioCalculation(c,e,l){let t=0;return this.data?.IncludeTax&&(e+=l),e!=0&&(t=c/e*100),t}discountPercentageCalc(c=0,e=0,l=0){return c/(e-l)*100}loadComplementaryQuantity(){this.complementaryQuantity$=this.httpService.post("/api/Report/ReportDetailComplementaryQuantity",this.data.Filter).pipe(Rt())}static \u0275fac=function(e){return new(e||i)(D(O),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,l){e&1&&(n(0,"modal-material",1),P("onClose",function(){return l.dialogRef.close()}),n(1,"content")(2,"div",2),g(3,dl,75,31,"ng-container",3),d(4,"async"),a()()()),e&2&&(m("config",l.modalConfig),o(3),m("ngIf",C(4,2,l.reportSummary$)))},dependencies:[He,k,$t,Ki,ie,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 ul=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Cr=i=>({ID:i});function _l(i,c){if(i&1){let e=I();n(0,"button",6),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),F(1,"i",7),p(2," Export "),a()}}function gl(i,c){if(i&1&&(n(0,"div",4),g(1,_l,3,0,"button",5),a()),i&2){let e=s();o(),m("ngIf",e.roleService.global.Export)}}function fl(i,c){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",10),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CustomerID,t)||(r.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",11),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",12)(11,"datepicker",13),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",14),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SalesID,t)||(r.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",15),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ContactGroupID,t)||(r.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",16),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.Bin,t)||(r.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",17),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.TypeID,t)||(r.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",18),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CurrencyID,t)||(r.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",19),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.DeliveryStateID,t)||(r.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",20),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.PaymentStateID,t)||(r.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",21),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CreatorID,t)||(r.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",22),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.NoteVisible,t)||(r.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),F(41,"i",23),a(),n(42,"ng-select",24),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.QueryOption,t)||(r.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",25),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.DefaultFilterColumn,t)||(r.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("model",e.pageData.Filter.Bin),o(3),m("items",e.pageData.Options.Types),x("ngModel",e.pageData.Filter.TypeID),o(3),m("items",e.pageData.Options.Currencies),x("ngModel",e.pageData.Filter.CurrencyID),o(3),m("items",e.pageData.Options.Deliveries),x("ngModel",e.pageData.Filter.DeliveryStateID),o(3),x("ngModel",e.pageData.Filter.PaymentStateID),m("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),x("ngModel",e.pageData.Filter.CreatorID),m("renderThumbnail",!1),o(3),x("model",e.pageData.Filter.NoteVisible),o(4),m("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),x("ngModel",e.pageData.Filter.QueryOption),o(3),x("model",e.pageData.Filter.DefaultFilterColumn),m("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Cl(i,c){i&1&&(n(0,"th",44),p(1," @ Cost "),a())}function xl(i,c){if(i&1&&(n(0,"small",60),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),T(y(2,1,e.CustomerNameDisplay," - {0}"))}}function hl(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),T(y(2,1,e.SalesName," - Sales: {0}"))}}function Sl(i,c){if(i&1&&(n(0,"span",60),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" "," - Profit: "+C(2,1,e.Profit)," ")}}function yl(i,c){if(i&1&&(n(0,"i",61),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function Dl(i,c){if(i&1&&(n(0,"span",62),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function vl(i,c){i&1&&(n(0,"span"),p(1,"-"),a())}function wl(i,c){if(i&1&&(se(0),F(1,"div",63),d(2,"newlines"),ce()),i&2){let e=s().$implicit;o(),m("innerHTML",C(2,1,e.SONote),Pe)}}function Tl(i,c){if(i&1&&(se(0),n(1,"div")(2,"a",64),p(3),a()(),ce()),i&2){let e=s().$implicit;o(2),m("queryParams",U(2,Cr,e.ReferenceInvoiceID)),o(),v(" Return ",e.ReferenceInvoiceNumber," ")}}function Pl(i,c){if(i&1&&(n(0,"i",78),p(1),a()),i&2){let e=s().$implicit;o(),v(" sold by ",e.Commissions.SalesName," ")}}function Il(i,c){if(i&1&&(n(0,"th",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e==null?null:e.UnitCost)," ")}}function Fl(i,c){if(i&1&&(n(0,"tr",65)(1,"th",30)(2,"div",66)(3,"span",67),p(4),a(),g(5,Pl,2,1,"i",68),F(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,Il,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,l=s(3);o(4),T(e==null?null:e.Name),o(),m("ngIf",(e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName),o(),m("innerHtml",e==null?null:e.Note,Pe),o(2),v(" ",e==null?null:e.Code," "),o(2),v(" ",C(11,11,e==null?null:e.Quantity)," "),o(3),v(" ",e==null?null:e.UOMName," "),o(),m("ngIf",l.roleService.product.Cost),o(2),v(" ",C(17,13,e==null?null:e.UnitPrice)," "),o(4),v(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),v(" ",(e==null?null:e.DiscountAmount)==0?"":C(23,15,e==null?null:e.DiscountAmount)," "),o(3),v(" ",C(26,17,e==null?null:e.Total)," ")}}function bl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"th",80),p(3),a(),n(4,"th",81),p(5),a(),n(6,"th",82),p(7),d(8,"amountFraction"),a()(),ce()),i&2){let e=c.$implicit;o(3),v("",e.Label," :"),o(2),v(" ",e.CurrencySymbol," "),o(2),v(" ",C(8,3,e.Amount)," ")}}function El(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"),F(10,"small",49),d(11,"date"),g(12,xl,3,4,"small",50),a()(),n(13,"div",51)(14,"strong",52),p(15),g(16,hl,3,4,"span",3),a(),g(17,Sl,3,3,"span",50)(18,yl,2,1,"i",53)(19,Dl,2,1,"span",54)(20,vl,2,0,"span",3),a(),g(21,wl,3,3,"ng-container",3)(22,Tl,4,4,"ng-container",3),a(),n(23,"div",55),p(24),a()(),n(25,"table",56)(26,"tbody",57),g(27,Fl,27,19,"tr",58),a()(),n(28,"table",59),g(29,bl,9,5,"ng-container",37),a()()),i&2){let e=c.$implicit,l=s(2);o(4),m("routerLink",b(23,ul))("queryParams",U(24,Cr,e.ID)),o(2),v(" ",e.EntityName+" # "+e.Number,""),o(2),v(" "," - "+y(9,17,e.Date,"dd MMM yyyy")," "),o(2),m("innerHtml","("+y(11,20,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Pe),o(2),m("ngIf",l.isNotEmpty(e.CustomerNameDisplay)),o(3),v(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),m("ngIf",l.isNotEmpty(e.SalesName)),o(),m("ngIf",l.roleService.report.Profit),o(),m("ngIf",l.isNotEmpty(e.DeliveryOutlet)),o(),m("ngIf",l.isNotEmpty(e.PromotionCoupon)),o(),m("ngIf",e.SONote&&e.PromotionCoupon),o(),m("ngIf",l.isNotEmpty(e.SONote)),o(),m("ngIf",l.isNotEmpty(e.ReferenceInvoiceID)),o(2),v(" ",e.PaymentStateLabel," "),o(3),m("ngForOf",e.Items),o(2),m("ngForOf",e.Aggregate)}}function Ml(i,c){if(i&1){let e=I();n(0,"span",83),P("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);o(),T(C(2,1,e.listTotal))}}function Bl(i,c){if(i&1){let e=I();n(0,"div",4)(1,"a",85),P("click",function(){u(e);let t=s(2);return t.currentRowCount=100,_(t.NextPage(!0))}),F(2,"i",86),p(3," Next 100"),a()()}}function Ol(i,c){if(i&1){let e=I();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,Cl,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,El,30,26,"div",37),a()()()()(),n(25,"div",38)(26,"button",39),P("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,Ml,3,0,"span",43)(34,Vl,3,3,"span",3),p(35),a()(),g(36,Bl,4,0,"div",2),a()()()}if(i&2){let e=s();o(14),m("ngIf",e.roleService.product.Cost),o(9),Yt("colspan",e.roleService.product.Cost?8:7),o(),m("ngForOf",e.infiniteList),o(7),v(" Showing 1 - ",C(32,8,e.infiniteList.length)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),m("ngIf",e.nextPageDisabled)}}var wn=class i extends he{constructor(e,l,t,r,f,w,Ee,xt){super(e,l,"Report/ReportDetail","ReportLoader/ReportDetail",null,f);this.csvConverter=t;this.datePipe=r;this.activatedRoute=f;this.matDialog=w;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),l=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(r=>r.Roles?r.Roles.every(f=>f):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(q,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(vn,{data:this.pageData})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(ee),D(Oe),D(j),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(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,gl,2,1,"div",2),a(),n(3,"filters"),g(4,fl,46,26,"ng-template",null,0,M),a(),g(6,Ol,37,10,"content",3),a()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,pe,De,Le,Q,Ye,Ho,gn,ie,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 Tn=class i{constructor(c,e){this._dialogRef=c;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new fi;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(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,l){e&1&&(n(0,"modal-material",0),P("onOk",function(){return l.onOk()})("onCancel",function(){return l._dialogRef.close()})("onClose",function(){return l._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),S("ngModelChange",function(r){return h(l.ExportPageNumber,r)||(l.ExportPageNumber=r),r}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),S("ngModelChange",function(r){return h(l.ExportRowCount,r)||(l.ExportRowCount=r),r}),a()()()()()),e&2&&(m("title","Export Report")("config",l.modalConfig),o(6),x("ngModel",l.ExportPageNumber),o(4),x("ngModel",l.ExportRowCount),m("max",1e4))},dependencies:[ke,B,L,Qe,$t],encapsulation:2})};var Rl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],xr=i=>({ID:i}),kl=()=>["/menu/Contacts/Contact/Customers/Info"],Wl=(i,c,e)=>({"text-success":i,"text-warning":c,"text-danger":e});function Nl(i,c){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",6),p(2," Export "),a()}}function Al(i,c){if(i&1){let e=I();se(0),n(1,"div",19)(2,"div",20)(3,"datepicker",21),S("dateChange",function(t){u(e);let r=s(2);return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(4,"div",22)(5,"app-timepicker",23),S("timeChange",function(t){u(e);let r=s(2);return h(r.timeFrom,t)||(r.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let r=s(2);return _(r.timeFromChange(t))}),a()()(),n(6,"div",24)(7,"div",20)(8,"datepicker",25),S("dateChange",function(t){u(e);let r=s(2);return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(9,"div",22)(10,"app-timepicker",23),S("timeChange",function(t){u(e);let r=s(2);return h(r.timeTo,t)||(r.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let r=s(2);return _(r.timeToChange(t))}),a()()(),ce()}if(i&2){let e=s(2);o(3),x("date",e.pageData.Filter.From),o(2),x("time",e.timeFrom),o(3),x("date",e.pageData.Filter.To),o(2),x("time",e.timeTo)}}function Gl(i,c){if(i&1){let e=I();n(0,"datepicker",26),S("dateChange",function(t){u(e);let r=s(2);return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a(),n(1,"div",27)(2,"datepicker",28),S("dateChange",function(t){u(e);let r=s(2);return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterToDate())}),a()()}if(i&2){let e=s(2);x("date",e.pageData.Filter.From),m("appearance","outline")("width",100),o(2),x("date",e.pageData.Filter.To),m("appearance","outline")("width",100)}}function Hl(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",9),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CustomerID,t)||(r.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",10),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SalesID,t)||(r.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SalesOrderTagID,t)||(r.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",12),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.DefaultFilterColumn,t)||(r.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),g(18,Al,11,4,"ng-container",13)(19,Gl,3,6,"ng-template",null,1,M),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",14),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.RegisterID,t)||(r.pageData.Filter.RegisterID=t),_(t)}),a(),n(24,"h6"),p(25,"Customer Groups"),a(),n(26,"ng-select",15),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CustomerGroupID,t)||(r.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",16),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.PaymentState,t)||(r.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",17),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CreatorID,t)||(r.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",18),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.RowCount,t)||(r.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=Je(20),l=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",l.pageData.Filter.ListIDs),m("outlets",l.pageData.Options==null?null:l.pageData.Options.Entities),o(3),x("ngModel",l.pageData.Filter.CustomerID),m("inputTextValue",l.pageData.CustomerName),o(3),x("ngModel",l.pageData.Filter.SalesID),o(3),x("ngModel",l.pageData.Filter.SalesOrderTagID),m("items",l.pageData.Options.SalesOrderTags),o(3),m("options",l.pageData.Options.DefaultFilterColumnOptions),x("model",l.pageData.Filter.DefaultFilterColumn),o(3),m("ngIf",l.pageData.Filter.isCreated)("ngIfElse",e),o(5),x("ngModel",l.pageData.Filter.RegisterID),m("items",l.pageData.Options.Registers),o(3),x("ngModel",l.pageData.Filter.CustomerGroupID),m("items",l.pageData.Options.Groups),o(3),x("ngModel",l.pageData.Filter.PaymentState),m("items",l.pageData.Options.States),o(3),x("ngModel",l.pageData.Filter.CreatorID),o(3),m("max",1e4),x("ngModel",l.pageData.Filter.RowCount)}}function Ql(i,c){i&1&&(n(0,"th",55),p(1,"DATE"),a())}function Yl(i,c){i&1&&(n(0,"th",56),p(1," CUSTOMER "),a())}function jl(i,c){i&1&&(n(0,"th",57),p(1," SALES PERSON "),a())}function ql(i,c){i&1&&(n(0,"th",58),p(1," COST "),a())}function Ul(i,c){i&1&&(n(0,"th",59),p(1," GROSS "),a())}function Kl(i,c){i&1&&(n(0,"th",60),p(1," SALES "),a())}function zl(i,c){i&1&&(n(0,"th",61),p(1," TAX "),a())}function Xl(i,c){i&1&&(n(0,"th",62),p(1," SURCHARGE "),a())}function Zl(i,c){i&1&&(n(0,"th",63),p(1," TOTAL "),a())}function Jl(i,c){i&1&&(n(0,"th",64),p(1," PAYMENT "),a())}function $l(i,c){i&1&&F(0,"br")}function ep(i,c){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Note)}}function tp(i,c){if(i&1&&(n(0,"td")(1,"div"),p(2),d(3,"date"),a(),n(4,"div"),p(5),d(6,"date"),a()()),i&2){let e=s().$implicit;o(2),v(" ",y(3,2,e.Date,"dd MMM yy")," "),o(3),v(" ",y(6,5,e.Created,"HH:mm")," ")}}function ip(i,c){if(i&1&&(n(0,"td")(1,"a",70),p(2),a()()),i&2){let e=s().$implicit;o(),m("routerLink",b(3,kl))("queryParams",U(4,xr,e.CustomerID)),o(),T(e.CustomerName)}}function np(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.SalesName," ")}}function ap(i,c){if(i&1&&(n(0,"td",71),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost)," ")}}function op(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Gross)," ")}}function rp(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function lp(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function pp(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SurchargeAmount)," ")}}function mp(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SalesNSurcharge)," ")}}function sp(i,c){if(i&1&&(n(0,"td",74),p(1),a()),i&2){let e=s().$implicit;m("ngClass",mt(2,Wl,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),v(" ",e.PaymentStateString," ")}}function cp(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",65),p(5),a(),g(6,$l,1,0,"br",4)(7,ep,2,1,"i",4),a(),g(8,tp,7,8,"td",4)(9,ip,3,6,"td",4)(10,np,2,1,"td",4)(11,ap,3,3,"td",66)(12,op,3,3,"td",67)(13,rp,3,3,"td",67)(14,lp,3,3,"td",68)(15,pp,3,3,"td",67)(16,mp,3,3,"td",67)(17,sp,2,6,"td",69),a()),i&2){let e=c.$implicit,l=s(3);o(2),T(e.EntityName),o(2),m("routerLink",b(16,Rl))("queryParams",U(17,xr,e.ID)),o(),v(" ",e.Number," "),o(),m("ngIf",e.Note),o(),m("ngIf",e.Note),o(),m("ngIf",l.column.Date.selected),o(),m("ngIf",l.column.Customer.selected),o(),m("ngIf",l.column.SalesPerson.selected),o(),m("ngIf",l.roleService.product.Cost&&l.column.Cost.selected),o(),m("ngIf",l.column.Gross.selected),o(),m("ngIf",l.column.Sales.selected),o(),m("ngIf",l.data.TaxVisible&&l.column.Tax.selected),o(),m("ngIf",l.data.SurchargeVisible),o(),m("ngIf",l.column.Total.selected),o(),m("ngIf",l.column.Payment.selected)}}function dp(i,c){i&1&&F(0,"td",77)}function up(i,c){i&1&&F(0,"td",77)}function _p(i,c){i&1&&F(0,"td",77)}function gp(i,c){i&1&&(n(0,"td",80),p(1," Total: "),a())}function fp(i,c){if(i&1&&(n(0,"td",71),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Cost"))," ")}}function Cp(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function xp(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Sales"))," ")}}function hp(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Tax"))," ")}}function Sp(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function yp(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function Dp(i,c){if(i&1&&(n(0,"tfoot",75)(1,"tr",76),F(2,"td",77),g(3,dp,1,0,"td",78)(4,up,1,0,"td",78)(5,_p,1,0,"td",78)(6,gp,2,0,"td",79)(7,fp,4,6,"td",66)(8,Cp,4,6,"td",67)(9,xp,4,6,"td",67)(10,hp,4,6,"td",68)(11,Sp,4,6,"td",67)(12,yp,4,6,"td",67),a()()),i&2){let e=s(3);o(3),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected)}}function vp(i,c){if(i&1){let e=I();n(0,"div",38)(1,"table",39),P("matSortChange",function(t){u(e);let r=s(2);return _(r.sortData(t))}),n(2,"thead",40)(3,"tr")(4,"th",41),p(5,"OUTLET"),a(),n(6,"th",42),p(7,"NUMBER"),a(),g(8,Ql,2,0,"th",43)(9,Yl,2,0,"th",44)(10,jl,2,0,"th",45)(11,ql,2,0,"th",46)(12,Ul,2,0,"th",47)(13,Kl,2,0,"th",48)(14,zl,2,0,"th",49)(15,Xl,2,0,"th",50)(16,Zl,2,0,"th",51)(17,Jl,2,0,"th",52),a()(),n(18,"tbody"),g(19,cp,18,19,"tr",53),a(),g(20,Dp,13,10,"tfoot",54),a()()}if(i&2){let e=s(2);o(8),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected),o(),m("ngIf",e.column.Payment.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data)}}function wp(i,c){if(i&1){let e=I();n(0,"span",81),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",82),p(2,"?"),a()()}}function Tp(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),T(C(2,1,e.listTotal))}}function Pp(i,c){if(i&1){let e=I();n(0,"a",83),P("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),F(1,"i",84),p(2," Next"),a()}}function Ip(i,c){if(i&1){let e=I();n(0,"a",85),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),F(1,"i",86),p(2," Last"),a()}}function Fp(i,c){if(i&1&&(n(0,"content")(1,"div",29),g(2,vp,21,12,"div",30),n(3,"div",31)(4,"div",32)(5,"div",33),p(6),d(7,"number"),g(8,wp,3,0,"span",34)(9,Tp,3,3,"span",4),p(10),a()(),n(11,"div",35),g(12,Pp,3,0,"a",36)(13,Ip,3,0,"a",37),a()()()()),i&2){let e=s();o(2),m("ngIf",e.data),o(4),v(" Showing 1 - ",C(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),m("ngIf",e.nextPageDisabled&&!e.goToLast),o(),m("ngIf",e.nextPageDisabled&&!e.goToLast)}}var Pn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/ReportSummary","ReportLoader/ReportSummary",null,r);this.httpService=l;this.csvConverter=t;this._matDialog=f}roleService=Ge(G);columnService=Ge(vt);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"),l=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:l,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 l=this.route.snapshot.queryParamMap.get("CustomerID");V.IsNotEmpty(l)&&(this.pageData.Filter.From=V.MinDate,this.pageData.Filter.To=V.MinDate)}afterPostInit(e){this.checkForAdvancedColumn()}openItemModal(e,l){this._matDialog.open(Tn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(r=>{r&&(this.pageData.Filter.ExportPageNumber=r.ExportPageNumber,this.pageData.Filter.ExportRowCount=r.ExportRowCount,this.exportCSV(this.csvConverter,e,l),this.pageData.Filter.RowCount=0)})}sortData(e){let l=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=l;return}this.infiniteList=l.sort((t,r)=>{let f=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,r.CustomerName=r.CustomerName==null?"":r.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,r.SalesName=r.SalesName==null?"":r.SalesName,e.active){case"outlet":return this.compare(t.EntityName.toLocaleLowerCase(),r.EntityName.toLocaleLowerCase(),f);case"number":return this.compare(t.Number,r.Number,f);case"date":return this.compare(t.Date,r.Date,f);case"customer":return this.compare(t.CustomerName.toLocaleLowerCase(),r.CustomerName.toLocaleLowerCase(),f);case"salesPerson":return this.compare(t.SalesName.toLocaleLowerCase(),r.SalesName.toLocaleLowerCase(),f);case"cost":return this.compare(t.Cost,r.Cost,f);case"gross":return this.compare(t.Gross,r.Gross,f);case"sales":return this.compare(t.Sales,r.Sales,f);case"tax":return this.compare(t.Tax,r.Tax,f);case"surcharge":return this.compare(t.SurchargeAmount,r.SurchargeAmount,f);case"total":return this.compare(t.SalesNSurcharge,r.SalesNSurcharge,f);case"payment":return this.compare(t.PaymentStateString,r.PaymentStateString,f);default:return 0}})}openExportModal(){this._matDialog.open(q,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"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(l){return new(l||i)(D(W),D(O),D(H),D(Oe),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[R],decls:7,vars:7,consts:[["pageFilterTemplate",""],["DATEONLY",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["placeholder","Search Customer","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Is Created",3,"modelChange","options","model"],[4,"ngIf","ngIfElse"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["name","From",3,"dateChange","date","appearance","width"],[1,"mt-4"],["name","To",3,"dateChange","date","appearance","width"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more 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,"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(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(r),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Nl,3,0,"button",3),a(),n(3,"filters"),g(4,Hl,36,22,"ng-template",null,0,M),a(),g(6,Fp,14,9,"content",4),a()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,De,Le,Si,Q,Ye,oe,ie,ee,X],encapsulation:2})};var bp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],Ep=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],Mp=()=>["/menu/Products/Setup/Brand/Brand_Form"],Vp=i=>({ID:i}),Bp=(i,c)=>({BrandID:i,Name:c});function Op(i,c){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export"),a()}}function Lp(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Rp(i,c){i&1&&(n(0,"th",24),p(1,"Code"),a())}function kp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Code)}}function Wp(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",25),p(3),a()(),g(4,kp,2,1,"td",26),n(5,"td",27)(6,"a",28),p(7),d(8,"quantityFraction"),a()(),n(9,"td",27),p(10),d(11,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),m("routerLink",b(11,Mp))("queryParams",U(12,Vp,e.ID)),o(),v("",e.BrandName," "),o(),m("ngIf",e.Countcode>0),o(2),m("queryParams",de(14,Bp,e.ID,e.BrandName)),o(),T(C(8,7,e.Quantity)),o(3),T(C(11,9,e.Total))}}function Np(i,c){if(i&1){let e=I();n(0,"div",15)(1,"table",16),P("matSortChange",function(t){u(e);let r=s();return _(r.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"Brand"),a(),g(6,Rp,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,Wp,12,17,"tr",22),a(),n(13,"tfoot")(14,"tr",23)(15,"td"),p(16,"Total"),a(),n(17,"td"),p(18),d(19,"sum"),d(20,"quantityFraction"),a(),n(21,"td"),p(22),d(23,"sum"),d(24,"amountFraction"),a()()()()()}if(i&2){let e=s();o(6),m("ngIf",e.data.Countcode>0),o(6),m("ngForOf",e.data.Data),o(6),T(C(20,7,y(19,4,e.data.Data,"Quantity"))),o(4),T(C(24,12,y(23,9,e.data.Data,"Total")))}}var In=class i extends he{constructor(e,l,t,r,f,w){super(e,l,"Report/BrandRank","ReportLoader/BrandRank",null,r);this.httpService=l;this.csvConverter=t;this.roleService=f;this.matDialog=w}sortData(e){let l=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=l;return}this.data.Data=l.sort((t,r)=>{let f=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,r.BrandName,f);case"Code":return this.compare(t.Code,r.Code,f);case"Quantity":return this.compare(t.Quantity,r.Quantity,f);case"Total":return this.compare(t.Total,r.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(Oe),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[R],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["style","width: 120px;","mat-sort-header","Code","arrowPosition","before","class","align-left",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"footer","text-end","fw-bold"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],[3,"routerLink","queryParams"],[4,"ngIf"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Op,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,Lp,9,6,"ng-template",null,0,M),a(),n(16,"content"),g(17,Np,25,14,"div",7),a()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(8,bp)),o(3),m("routerLink",b(9,Ep)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,pe,ae,ge,Q,oe,X,Z],encapsulation:2})};function Ap(i,c){if(i&1){let e=I();n(0,"label",3),P("click",function(){let t=u(e).$implicit,r=s();return _(r.updateSelectedGroups(t.ID))}),F(1,"input",4),n(2,"span"),p(3),a()()}if(i&2){let e=c.$implicit,l=s();o(),m("value",e.ID)("checked",l.IDGroups.indexOf(e.ID)>-1),o(2),T(e.Name)}}var Fn=class i{constructor(c,e){this.dialogRef=c;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(l=>{this.IDGroups.push(l.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,l){e&1&&(n(0,"modal-material",0),P("onOk",function(){return l.onOk()})("onCancel",function(){return l.dialogRef.close()}),n(1,"content")(2,"div",1),g(3,Ap,4,3,"label",2),a()()()),e&2&&(m("title","Edit Groups"),o(3),m("ngForOf",l.options))},dependencies:[Y,$t],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var Gp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Hp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Qp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Yp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],jp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],qp=()=>["/menu/Contacts/Contact/Customers/Info"],Up=i=>({ID:i});function Kp(i,c){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function zp(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.GroupID,t)||(r.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.RowCount,t)||(r.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function Xp(i,c){i&1&&(n(0,"th",31),p(1," ORDERS "),a())}function Zp(i,c){i&1&&(n(0,"th",32),p(1," QTY "),a())}function Jp(i,c){i&1&&(se(0),n(1,"th",33),p(2," COST "),a(),ce())}function $p(i,c){i&1&&(n(0,"th",34),p(1," SALES "),a())}function em(i,c){i&1&&(n(0,"th",35),p(1," TAX "),a())}function tm(i,c){i&1&&(n(0,"th",36),p(1," SALES + TAX "),a())}function im(i,c){if(i&1){let e=I();n(0,"span")(1,"span"),p(2),a(),n(3,"a",45),P("click",function(){u(e);let t=s(2).$implicit,r=s(3);return _(r.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=c.$implicit,l=c.index;o(2),T(l==0?"":" , "),o(2),T(e.GroupName)}}function nm(i,c){if(i&1&&(n(0,"span"),g(1,im,5,2,"span",38),a()),i&2){let e=s().$implicit;o(),m("ngForOf",e.Groups)}}function am(i,c){if(i&1){let e=I();n(0,"a",45),P("click",function(){u(e);let t=s().$implicit,r=s(3);return _(r.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function om(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Orders)," ")}}function rm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Quantity)," ")}}function lm(i,c){if(i&1&&(se(0),n(1,"td",47),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s().$implicit;o(2),v(" ",C(3,1,e.Cost)," ")}}function pm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function mm(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function sm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales+e.Tax)," ")}}function cm(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",39),p(3),a(),n(4,"div",40),g(5,nm,2,1,"span",25)(6,am,2,0,"a",41),a()(),n(7,"td")(8,"span",42),p(9),a()(),g(10,om,3,3,"td",43)(11,rm,3,3,"td",43)(12,lm,4,3,"ng-container",25)(13,pm,3,3,"td",43)(14,mm,3,3,"td",44)(15,sm,3,3,"td",43),a()),i&2){let e=c.$implicit,l=s(3);o(2),m("routerLink",b(13,qp))("queryParams",U(14,Up,e.CustomerID)),o(),v(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),m("ngIf",e.Groups.length>0),o(),m("ngIf",!(e.Groups.length>0)),o(2),m("matTooltip",l.maskingFields!=null&&l.maskingFields.Code&&!l.roleService.global.SensitiveField?l.maskingFieldMsg:""),o(),v("",e.Code," "),o(),m("ngIf",l.column.Orders.selected),o(),m("ngIf",l.column.QTY.selected),o(),m("ngIf",l.roleService.product.Cost&&l.column.Cost.selected),o(),m("ngIf",l.column.Sales.selected),o(),m("ngIf",l.column.Tax.selected),o(),m("ngIf",l.column.SalesNTax.selected)}}function dm(i,c){if(i&1&&(n(0,"tbody",37),g(1,cm,16,16,"tr",38),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function um(i,c){if(i&1){let e=I();n(0,"div",17)(1,"div",18)(2,"table",19),P("matSortChange",function(t){u(e);let r=s();return _(r.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,Xp,2,0,"th",23)(10,Zp,2,0,"th",24)(11,Jp,3,0,"ng-container",25)(12,$p,2,0,"th",26)(13,em,2,0,"th",27)(14,tm,2,0,"th",28),a()(),g(15,dm,2,1,"tbody",29),a()(),n(16,"infinite-pagination",30),P("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=s();o(9),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.column.Tax.selected),o(),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.data.Data),o(),m("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var bn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=l;this.csvConverter=t;this.datePipe=r;this.matDialog=f}roleService=Ge(G);columnService=Ge(vt);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=Cn.maskingField;postInit(e){this.maskingFields=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 l=this.originalData;if(!e.active||e.direction===""){this.data.Data=l;return}this.data.Data=l.sort((t,r)=>{let f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,r.Name,f);case"Code":return this.compare(t.Code,r.Code,f);case"Orders":return this.compare(t.Orders,r.Orders,f);case"Quantity":return this.compare(t.Quantity,r.Quantity,f);case"Sales":return this.compare(t.Sales,r.Sales,f);case"Tax":return this.compare(t.Tax,r.Tax,f);case"SalesNTax":return this.compare(t.Sales+t.Tax,r.Sales+r.Tax,f);case"Cost":return this.compare(t.Cost,r.Cost,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,l){this.matDialog.open(Fn,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(r=>{if(r){let f={ContactID:l,GroupIDs:r.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",f).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(q,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(ee),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[R],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["style","width: 75px","mat-sort-header","Orders","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 75px","mat-sort-header","Quantity","arrowPosition","before","class","flex-left",4,"ngIf"],[4,"ngIf"],["style","width: 135px","mat-sort-header","Sales","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 135px","mat-sort-header","Tax","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 135px","mat-sort-header","SalesNTax","arrowPosition","before","class","flex-left",4,"ngIf"],["class","border-bottom",4,"ngIf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"pointer"],["class","text-primary",3,"click",4,"ngIf"],["matTooltipPosition","above",3,"matTooltip"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"text-primary",3,"click"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(r),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Kp,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),F(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,zp,16,10,"ng-template",null,0,M),a(),n(26,"content"),g(27,um,17,13,"div",7),a()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(12,Gp)),o(3),m("routerLink",b(13,Hp)),o(3),m("routerLink",b(14,Qp)),o(3),m("routerLink",b(15,Yp)),o(4),m("routerLink",b(16,jp)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,Q,ti,ie,X,Z],encapsulation:2})};var _m=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],gm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],fm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Cm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],xm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function hm(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function Sm(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.GroupID,t)||(r.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function ym(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",26),p(4),d(5,"number"),a(),n(6,"td",26),p(7),d(8,"amountFraction"),a(),n(9,"td",27),p(10),d(11,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),v(" ",e.Name," "),o(2),T(C(5,4,e.TotalOrders)),o(3),T(C(8,6,e.TotalCost)),o(3),T(C(11,8,e.TotalAmount))}}function Dm(i,c){if(i&1&&(n(0,"tbody",24),g(1,ym,12,10,"tr",25),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function vm(i,c){if(i&1){let e=I();n(0,"div",16)(1,"table",17),P("matSortChange",function(t){u(e);let r=s();return _(r.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,Dm,2,1,"tbody",23),a()()}if(i&2){let e=s();o(12),m("ngIf",e.data.Data)}}var En=class i extends he{constructor(e,l,t,r,f,w){super(e,l,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f;this.datePipe=w}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 l=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=l;return}this.data.Data=l.sort((t,r)=>{let f=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,r.Name,f);case"Orders":return this.compare(t.TotalOrders,r.TotalOrders,f);case"Quantity":return this.compare(t.TotalCost,r.TotalCost,f);case"Total":return this.compare(t.TotalAmount,r.TotalAmount,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(q,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j),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(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,hm,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,Sm,13,8,"ng-template",null,0,M),a(),n(25,"content"),g(26,vm,13,1,"div",7),a()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(11,_m)),o(3),m("routerLink",b(12,gm)),o(3),m("routerLink",b(13,fm)),o(3),m("routerLink",b(14,Cm)),o(3),m("routerLink",b(15,xm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,Q,ie,X],encapsulation:2})};var wm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Tm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Pm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Im=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Fm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function bm(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function Em(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.GroupID,t)||(r.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Mm(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 Bm(i,c){i&1&&(n(0,"th",27),p(1," AMOUNT"),a())}function Om(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.TotalOrders))}}function Lm(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.TotalQuantity)," ")}}function Rm(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.TotalAmount))}}function km(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),g(3,Om,3,3,"td",28)(4,Lm,3,3,"td",28)(5,Rm,3,3,"td",29),a()),i&2){let e=c.$implicit,l=s(2);o(2),v(" ",e.Name," "),o(),m("ngIf",l.column.Orders.selected),o(),m("ngIf",l.column.QTY.selected),o(),m("ngIf",l.column.Amount.selected)}}function Wm(i,c){if(i&1){let e=I();n(0,"div",16)(1,"table",17),P("matSortChange",function(t){u(e);let r=s();return _(r.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"GENDER"),a(),g(6,Mm,2,0,"th",20)(7,Vm,2,0,"th",21)(8,Bm,2,0,"th",22),a()(),n(9,"tbody",23),g(10,km,6,4,"tr",24),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Amount.selected),o(2),m("ngForOf",e.data==null?null:e.data.Data)}}var Mn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=l;this.csvConverter=t;this.matDialog=r;this.datePipe=f}roleService=Ge(G);columnService=Ge(vt);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 l=this.data.slice();if(!e.active||e.direction===""){this.data=l;return}this.data=l.sort((t,r)=>{let f=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,r.Name,f);case"Orders":return this.compare(t.TotalOrders,r.TotalOrders,f);case"Quantity":return this.compare(t.TotalQuantity,r.TotalQuantity,f);case"Total":return this.compare(t.TotalAmount,r.TotalAmount,f);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(l){return new(l||i)(D(W),D(O),D(H),D(j),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(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(r),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,bm,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,Em,13,8,"ng-template",null,0,M),a(),n(25,"content"),g(26,Wm,11,4,"div",7),a()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,wm)),o(3),m("routerLink",b(13,Tm)),o(3),m("routerLink",b(14,Pm)),o(3),m("routerLink",b(15,Im)),o(3),m("routerLink",b(16,Fm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,Q,ie,X,Z],encapsulation:2})};var Sr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Nm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Am=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Gm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Hm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Qm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Ym=()=>["/menu/Contacts/Contact/Suppliers/Info"],jm=i=>({ID:i}),qm=(i,c,e)=>({From:i,SupplierID:c,To:e});function Um(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function Km(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.GroupID,t)||(r.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.RowCount,t)||(r.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function zm(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,l=s(2);o(2),T(e.Rank),o(2),m("routerLink",b(19,Ym))("queryParams",U(20,jm,e.SupplierID)),o(),T(e.Name),o(2),T(e.Code),o(2),v(" ",C(10,9,e.Quantity)," "),o(3),m("routerLink",b(22,Sr))("queryParams",mt(23,qm,y(13,11,l.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,y(14,14,l.pageData.Filter.To,"yyyy-MM-dd"))),o(3),v(" ",C(16,17,e.Total),"")}}function Xm(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",31),F(2,"th",32),n(3,"th",29),p(4,"Total Quantity"),a(),n(5,"th",29),p(6,"Total Sales"),a()(),n(7,"tr"),F(8,"td",33),n(9,"td",29),p(10),a(),n(11,"td",29),p(12),a()()()),i&2){let e=s(2);o(10),T(e.data.TotalQty),o(2),T(e.data.TotalSales)}}function Zm(i,c){if(i&1){let e=I();n(0,"div",17)(1,"table",18),P("matSortChange",function(t){u(e);let r=s();return _(r.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,zm,17,27,"tr",25),a(),g(16,Xm,13,2,"tfoot"),a()()}if(i&2){let e=s();o(15),m("ngForOf",e.data.Data),o(),Hi((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?16:-1)}}var Vn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f}sortData(e){let l=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=l;return}this.data.Data=l.sort((t,r)=>{let f=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,r.Rank,f);case"Supplier":return this.compare(t.Name,r.Name,f);case"Code":return this.compare(t.Code,r.Code,f);case"Quantity":return this.compare(t.Quantity,r.Quantity,f);case"Total":return this.compare(t.Total,r.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[R],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Um,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,Km,16,10,"ng-template",null,0,M),a(),n(28,"content"),g(29,Zm,17,2,"div",7),a()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Sr)),o(3),m("routerLink",b(13,Nm)),o(3),m("routerLink",b(14,Am)),o(3),m("routerLink",b(15,Gm)),o(3),m("routerLink",b(16,Hm)),o(3),m("routerLink",b(17,Qm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,ae,ge,Qe,Q,ee,X,Z],encapsulation:2})};var yr=Ht(Bi());var $m=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],es=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],ts=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],is=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ns=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],as=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],os=(i,c,e,l,t)=>({From:i,To:c,ListIDs:e,ListVariantID:l,GroupByVariant:t}),rs=i=>[i],ls=i=>({ID:i}),ps=(i,c,e,l,t,r)=>({ID:i,From:c,To:e,ListIDs:l,ListVariantID:t,GroupByVariant:r}),Dr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],ms=(i,c,e)=>({VariantID:i,From:c,To:e}),ss=(i,c,e)=>({ProductID:i,From:c,To:e});function cs(i,c){if(i&1&&(n(0,"a",9),F(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,l=s();m("queryParams",qi(1,os,(e=l.queryParams())==null?null:e.From,(e=l.queryParams())==null?null:e.To,(e=l.queryParams())==null?null:e.ListIDs,(e=l.queryParams())==null?null:e.ListVariantID,(e=l.queryParams())==null?null:e.GroupByVariant))}}function ds(i,c){if(i&1){let e=I();n(0,"button",11),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",12),p(2," Export "),a()}}function us(i,c){if(i&1){let e=I();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),S("selectedCategoryIDChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CategoryID,t)||(r.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.BrandIDs,t)||(r.pageData.Filter.BrandIDs=t),_(t)}),a(),n(15,"h6"),p(16,"Product Tag"),a(),n(17,"ng-select",20),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.TagID,t)||(r.pageData.Filter.TagID=t),_(t)}),a(),n(18,"h6"),p(19,"Sales Person"),a(),n(20,"sales-person-selector",21),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SalesID,t)||(r.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.GroupByVariant,t)||(r.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.TypeID,t)||(r.pageData.Filter.TypeID=t),_(t)}),a(),n(27,"h6"),p(28,"Logistics Service"),a(),n(29,"ng-select",24),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.LogisticsServiceID,t)||(r.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SupplierID,t)||(r.pageData.Filter.SupplierID=t),_(t)}),a(),n(33,"h6"),p(34,"Customer Group"),a(),n(35,"ng-select",26),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ContactGroupID,t)||(r.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CustomerID,t)||(r.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Product Type"),a(),n(41,"radio-options",28),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ProductType,t)||(r.pageData.Filter.ProductType=t),_(t)}),a(),n(42,"h6"),p(43,"Multiply Unit Quantity"),a(),n(44,"radio-options",29),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.NeedMultiplyUnitQuantity,t)||(r.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),x("date",e.pageData.Filter.From),m("showClearBtn",!0)("showTodayBtn",!0),o(2),x("date",e.pageData.Filter.To),m("showClearBtn",!0)("showTodayBtn",!0),o(3),m("multiple",!0)("multiple",!0),x("ngModel",e.pageData.Filter.BrandIDs),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Tags),x("ngModel",e.pageData.Filter.TagID),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),x("ngModel",e.pageData.Filter.LogisticsServiceID),m("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),x("ngModel",e.pageData.Filter.SupplierID),m("inputTextValue",e.pageData.supplierName),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("model",e.pageData.Filter.ProductType),m("options",e.pageData.Options.ProductTypes),o(3),x("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function _s(i,c){if(i&1){let e=I();n(0,"th",48)(1,"div",49)(2,"input",50),P("change",function(t){u(e);let r=s(2);return _(r.checkAllCheckBox(t))}),a()()()}if(i&2){let e=s(2);o(2),m("checked",e.isAllCheckBoxChecked())}}function gs(i,c){if(i&1&&(n(0,"th",51),p(1," Qty "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Quantity.start)}}function fs(i,c){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function Cs(i,c){i&1&&(n(0,"th",53),p(1," Cost "),a())}function xs(i,c){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function hs(i,c){if(i&1&&(n(0,"th",55),p(1," Sales "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Sales.start)}}function Ss(i,c){i&1&&(n(0,"th",56),p(1," Tax "),a())}function ys(i,c){if(i&1&&(n(0,"th",57),p(1," Sales + Tax "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Sales.start)}}function Ds(i,c){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function vs(i,c){i&1&&(n(0,"th",59),p(1," % "),a())}function ws(i,c){if(i&1){let e=I();n(0,"td")(1,"div",49)(2,"input",71),S("ngModelChange",function(t){u(e);let r=s().$implicit;return h(r.checked,t)||(r.checked=t),_(t)}),P("ngModelChange",function(){u(e);let t=s(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=s().$implicit;o(2),m("value",e.ID),x("ngModel",e.checked)}}function Ts(i,c){if(i&1){let e=I();se(0),n(1,"img",72),P("click",function(t){u(e);let r=s().$implicit,f=s(2);return _(f.openBigPicture(r==null?null:r.ImageURL,t))}),a(),ce()}if(i&2){let e=s().$implicit;o(),m("src",e.ThumbnailUrl,Gi)}}function Ps(i,c){if(i&1){let e=I();n(0,"a",73)(1,"img",74),P("click",function(t){u(e);let r=s().$implicit,f=s(2);return _(f.openBigPicture(r,t))}),a()()}if(i&2){let e=s(3);m("target",e.pageData.LinkTarget)}}function Is(i,c){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,l=s().$implicit,t=s(2);o(),m("queryParams",Co(4,ps,l.ID,(e=t.queryParams())==null?null:e.From,(e=t.queryParams())==null?null:e.To,(e=t.queryParams())==null?null:e.ListIDs,(e=t.queryParams())==null?null:e.ListVariantID,(e=t.queryParams())==null?null:e.GroupByVariant)),o(),T(C(3,2,l.Quantity))}}function Fs(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.OnHand)," ")}}function bs(i,c){if(i&1&&(n(0,"td",77),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.UnitCost)," ")}}function Es(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Gross)," ")}}function Ms(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,l=s(2);m("routerLink",b(11,Dr))("queryParams",mt(12,ms,e.ID,y(1,3,l.pageData.Filter.From,"ddMMyyyy"),y(2,6,l.pageData.Filter.To,"ddMMyyyy"))),o(3),T(C(4,9,e.Sales))}}function Vs(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,l=s(2);m("routerLink",b(11,Dr))("queryParams",mt(12,ss,e.ID,y(1,3,l.pageData.Filter.From,"ddMMyyyy"),y(2,6,l.pageData.Filter.To,"ddMMyyyy"))),o(3),T(C(4,9,e.Sales))}}function Bs(i,c){if(i&1&&(n(0,"td",75),g(1,Ms,5,16,"a",78)(2,Vs,5,16,"a",78),a()),i&2){let e=s(3);o(),m("ngIf",e.pageData.Filter.GroupByVariant),o(),m("ngIf",!e.pageData.Filter.GroupByVariant)}}function Os(i,c){if(i&1&&(n(0,"td",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function Ls(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SalesNTax)," ")}}function Rs(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.Profit)," ")}}function ks(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.Margin)," ")}}function Ws(i,c){if(i&1&&(n(0,"tr",60),g(1,ws,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),g(7,Ts,2,1,"ng-container",8)(8,Ps,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),g(14,Is,4,11,"td",67)(15,Fs,3,3,"td",67)(16,bs,3,3,"td",68)(17,Es,3,3,"td",67)(18,Bs,3,2,"td",67)(19,Os,3,3,"td",69)(20,Ls,3,3,"td",67)(21,Rs,3,4,"td",70)(22,ks,3,4,"td",70),a()),i&2){let e=c.$implicit,l=c.index,t=s(2);o(),m("ngIf",t.column.CompareQtySold.selected),o(2),T(l+1),o(4),m("ngIf",e.ImageURL),o(),m("ngIf",!e.ImageURL),o(2),m("routerLink",U(17,rs,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(19,ls,e.ID)),o(),T(e.Name),o(2),T(e.Code),o(),m("ngIf",t.column.QTY.selected),o(),m("ngIf",t.column.OnHand.selected),o(),m("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function Ns(i,c){i&1&&F(0,"td",75)}function As(i,c){i&1&&(n(0,"td",75),p(1," Total : "),a())}function Gs(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Quantity"))," ")}}function Hs(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"OnHand"))," ")}}function Qs(i,c){if(i&1&&(n(0,"td",77),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"UnitCost"))," ")}}function Ys(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function js(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),T(C(4,4,y(3,1,e.infiniteList,"Sales")))}}function qs(i,c){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),T(C(4,4,y(3,1,e.infiniteList,"Tax")))}}function Us(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),T(C(4,4,y(3,1,e.infiniteList,"SalesNTax")))}}function Ks(i,c){if(i&1&&(n(0,"td",80),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",y(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),v(" ",C(4,8,y(3,5,e.infiniteList,"Profit"))," ")}}function zs(i,c){if(i&1&&(n(0,"td",80),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",y(1,2,e.infiniteList,"Profit")/y(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),v(" ",C(6,14,y(4,8,e.infiniteList,"Profit")/y(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function Xs(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",81),F(2,"td",75),g(3,Ns,1,0,"td",67)(4,As,2,0,"td",67)(5,Gs,4,6,"td",67)(6,Hs,4,6,"td",67)(7,Qs,4,6,"td",68)(8,Ys,4,6,"td",67)(9,js,5,6,"td",82)(10,qs,5,6,"td",69)(11,Us,5,6,"td",82)(12,Ks,5,10,"td",70)(13,zs,7,16,"td",70),a()()),i&2){let e=s(2);o(3),m("ngIf",e.column.CompareQtySold.selected),o(),m("ngIf",e.column.CompareQtySold.selected||e.column.QTY.selected||e.column.OnHand.selected||e.column.Cost.selected||e.column.Gross.selected||e.column.Sales.selected||e.column.SalesNTax.selected||e.column.Tax.selected||e.column.Profit.selected&&e.column.Profit.role||e.column.Margin.selected&&e.column.Profit.role),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.OnHand.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),m("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function Zs(i,c){if(i&1){let e=I();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),P("matSortChange",function(t){u(e);let r=s();return _(r.sortData(t))}),n(4,"thead",33)(5,"tr"),g(6,_s,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),g(11,gs,2,1,"th",37)(12,fs,2,0,"th",38)(13,Cs,2,0,"th",39)(14,xs,2,0,"th",40)(15,hs,2,1,"th",41)(16,Ss,2,0,"th",42)(17,ys,2,1,"th",43)(18,Ds,2,0,"th",44)(19,vs,2,0,"th",45),a()(),n(20,"tbody"),g(21,Ws,23,21,"tr",46),a(),g(22,Xs,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),P("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.CompareQtySold.selected),o(5),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.OnHand.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data),o(),m("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Bn=class i extends he{constructor(e,l,t,r,f,w,Ee){super(e,l,"Report/ProductSales","ReportLoader/ProductSales",null,f);this.httpService=l;this.csvConverter=t;this.toasterService=r;this.activatedRoute=f;this.matDialog=w;this.bigPicture=Ee}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Ge(G);columnService=Ge(vt);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!0,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=ct([]);queryParams=ct(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=et(Ze({},this.data),{Data:e.Data.map(t=>et(Ze({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=et(Ze({},this.currentServerSortState[t]),{start:"desc"});let l=e.Sort.column;this.currentServerSortState[l]=et(Ze({},this.currentServerSortState[l]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let l=e.target;this.infiniteList=[...this.infiniteList.map(t=>et(Ze({},t),{checked:l.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(l=>l.checked).map(l=>l.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;V.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,l){this.bigPicture.openBiggerPicture(l,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let r={VariantID:t.ID,MinStock:t.NewMinStock};e.push(r)}}),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 l={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",l).subscribe(t=>{this.toasterService.success(t,Vi.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=et(Ze({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let l=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=l;return}this.infiniteList=l.sort((t,r)=>{let f=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,r.Code=r.Code==null?"":r.Code,t.BrandName=t.BrandName==null?"":t.BrandName,r.BrandName=r.BrandName==null?"":r.BrandName,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),r.Name.toLocaleLowerCase(),f);case"Code":return V.compare(t.Code.toLocaleLowerCase(),r.Code.toLocaleLowerCase(),f);case"Brand":return V.compare(t.BrandName.toLocaleLowerCase(),r.BrandName.toLocaleLowerCase(),f);case"Quantity":return V.compare(t.Quantity,r.Quantity,f);case"Total_Cost":return V.compare(t.UnitCost,r.UnitCost,f);case"Inventory":return V.compare(t.OnHand,r.OnHand,f);case"Total_Sales":return V.compare(t.Total,r.Total,f);case"Total_Tax":return V.compare(t.Tax,r.Tax,f);case"Total_Tax_Sales":return V.compare(t.SalesNTax,r.SalesNTax,f);case"ReOrder":return V.compare(t.MinStock,r.MinStock,f);case"Gross":return V.compare(t.Gross,r.Gross,f);case"Margin":return V.compare(t.Margin,r.Margin,f);case"Profit":return V.compare(t.Profit,r.Profit,f);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,yr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(Ke),D(Oe),D(j),D(yn))};static \u0275cmp=E({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[R],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-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"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(r),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(r),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,cs,3,7,"a",2)(3,ds,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10," Compare by Outlet "),a()(),n(11,"li")(12,"a",7),p(13," Compare by Month "),a()(),n(14,"li")(15,"a",7),p(16," Compare with Transfer Order "),a()(),n(17,"li")(18,"a",7),p(19," Product Tags Analysis "),a()(),n(20,"li")(21,"a",7),p(22," Top Suppliers "),a()(),n(23,"li")(24,"a",7),p(25," Quantity Sold Chart "),a()()()()(),n(26,"filters"),g(27,us,45,36,"ng-template",null,0,M),a(),g(29,Zs,24,18,"content",8),a()}l&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.isAnyItemChecked),o(),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,$m)),o(3),m("routerLink",b(15,es)),o(3),m("routerLink",b(16,ts)),o(3),m("routerLink",b(17,is)),o(3),m("routerLink",b(18,ns)),o(3),m("routerLink",b(19,as)),o(5),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,wo,B,L,pe,ae,ge,De,Le,fe,Q,Ye,ti,oe,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 Js=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],$s=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],e0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],t0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],i0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],n0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],a0=i=>({ID:i});function o0(i,c){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",16),p(2," Export "),a()}}function r0(i,c){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales"),a(),n(6,"sales-person-selector",19),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SalesID,t)||(r.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Category"),a(),n(9,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CategoryID,t)||(r.pageData.Filter.CategoryID=t),_(t)}),a(),n(10,"h6"),p(11,"Brand"),a(),n(12,"ng-select",21),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.BrandID,t)||(r.pageData.Filter.BrandID=t),_(t)}),a(),n(13,"h6"),p(14,"Supplier"),a(),n(15,"autocompleteV2",22),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SupplierID,t)||(r.pageData.Filter.SupplierID=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",23),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(20,"div",24)(21,"datepicker",25),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(22,"h6"),p(23,"Scope"),a(),n(24,"radio-options",26),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.Product,t)||(r.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function l0(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e,l=c.$implicit;dt("matTooltip",l.Name),o(),v(" ",(e=l.Code)!==null&&e!==void 0?e:l.Name," ")}}function p0(i,c){if(i&1&&(n(0,"td",13),p(1),a()),i&2){let e=c.$implicit;o(),v(" ",e," ")}}function m0(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,p0,2,1,"td",31),n(7,"td",13),p(8),a()()),i&2){let e=c.$implicit,l=s();o(2),m("routerLink",l.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",U(6,a0,e.ID)),o(),v(" ",e.Name,""),o(2),T(e.Code),o(),m("ngForOf",e.Quantities),o(2),T(e.Total)}}var On=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=l;this.csvConverter=t;this.matDialog=r;this.roleService=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(j),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(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(r),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,o0,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,r0,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,l0,2,2,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,m0,9,8,"tr",14),a()()()()()}l&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(13,Js)),o(3),m("routerLink",b(14,$s)),o(3),m("routerLink",b(15,e0)),o(3),m("routerLink",b(16,t0)),o(3),m("routerLink",b(17,i0)),o(3),m("routerLink",b(18,n0)),o(14),m("ngForOf",t.data==null?null:t.data.Outlet),o(4),m("ngForOf",t.data==null?null:t.data.Data))},dependencies:[N,Y,k,A,z,K,B,L,pe,De,Le,fe,Q,Ye],encapsulation:2})};var s0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],c0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],d0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],u0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],_0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],g0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],f0=i=>[i],C0=i=>({ID:i});function x0(i,c){if(i&1){let e=I();n(0,"a",16),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",17),p(2," Export"),a()}}function h0(i,c){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CategoryID,t)||(r.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Compare Month From"),a(),n(9,"ng-select",21),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.MonthFrom,t)||(r.pageData.Filter.MonthFrom=t),_(t)}),a(),n(10,"h6"),p(11,"Compare Month To"),a(),n(12,"ng-select",22),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.MonthTo,t)||(r.pageData.Filter.MonthTo=t),_(t)}),a(),n(13,"h6"),p(14,"Year"),a(),n(15,"ng-select",23),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.Year,t)||(r.pageData.Filter.Year=t),_(t)}),a(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",24),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.GroupByVariant,t)||(r.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.MonthFrom),m("items",e.months),o(3),x("ngModel",e.pageData.Filter.MonthTo),m("items",e.months),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.years),o(3),x("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter)}}function S0(i,c){if(i&1&&(n(0,"th",25),p(1),a()),i&2){let e=c.$implicit,l=s();o(),v(" ",l.months[e.Month-1].ColumnLabel," ")}}function y0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,l=s().$implicit,t=s();o(),v(" ",t.findKey(l.Sold,e.Month)?y(2,1,t.findKey(l.Sold,e.Month),t.pageData.FractionDigit):""," ")}}function D0(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,y0,3,4,"td",28),n(7,"td",29),p(8),d(9,"sum"),d(10,"number"),a()()),i&2){let e=c.$implicit,l=s();o(2),m("routerLink",U(12,f0,l.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(14,C0,e.ID)),o(),v(" ",e.Name," "),o(2),T(e.Code),o(),m("ngForOf",l.data==null?null:l.data.MonthlySales),o(2),v(" ",y(10,9,y(9,6,e.Sold,"Value"),l.pageData.FractionDigit)," ")}}function v0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,l=s(2);o(),v(" ",y(2,1,e.Sold,l.pageData.FractionDigit)," ")}}function w0(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",30),F(2,"td")(3,"td"),g(4,v0,3,4,"td",28),n(5,"td",29),p(6),d(7,"sum"),d(8,"number"),a()()()),i&2){let e=s();o(4),m("ngForOf",e.data==null?null:e.data.MonthlySales),o(2),v(" ",y(8,5,y(7,2,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}var Ln=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",null,null,!0);this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f}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,l){let t=null;return e.forEach(r=>{r.Key==l&&(t=r.Value)}),t}sortData(e){let l=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=l;return}this.data.Data=l.sort((t,r)=>{let f=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,r.Code=r.Code==null?"":r.Code,t.Name=t.Name==null?"":t.Name,r.Name=r.Name==null?"":r.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),r.Name.toLocaleLowerCase(),f);case"Code":return this.compare(t.Code.toLocaleLowerCase(),r.Code.toLocaleLowerCase(),f);default:return 0}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j))};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(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,x0,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,h0,19,14,"ng-template",null,0,M),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(w){return u(r),_(t.sortData(w))}),n(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),n(35,"th",11),p(36,"Code"),a(),g(37,S0,2,1,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,D0,11,16,"tr",14),a(),g(42,w0,9,8,"tfoot",15),a()()()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(14,s0)),o(3),m("routerLink",b(15,c0)),o(3),m("routerLink",b(16,d0)),o(3),m("routerLink",b(17,u0)),o(3),m("routerLink",b(18,_0)),o(3),m("routerLink",b(19,g0)),o(14),m("ngForOf",t.data==null?null:t.data.MonthlySales),o(4),m("ngForOf",t.data==null?null:t.data.Data),o(),m("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[N,Y,k,A,z,B,L,ae,ge,De,fe,Q,oe,ie],encapsulation:2})};var T0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],P0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],I0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],F0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],b0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],E0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],M0=i=>[i],V0=i=>({ID:i});function B0(i,c){if(i&1){let e=I();n(0,"button",16),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",17),p(2," Export"),a()}}function O0(i,c){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CategoryID,t)||(r.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",21),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",22)(12,"datepicker",23),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",24),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.Product,t)||(r.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function L0(i,c){if(i&1&&(n(0,"th",26),p(1),a()),i&2){let e=c.$implicit;o(),T(e)}}function R0(i,c){if(i&1&&(n(0,"tr"),F(1,"th")(2,"th"),g(3,L0,2,1,"th",25),a()),i&2){let e=s();o(3),m("ngForOf",e.data==null?null:e.data.Outlet)}}function k0(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e=c.$implicit;o(),v(" ",e,"")}}function W0(i,c){if(i&1&&(se(0),n(1,"a",29),p(2),a(),ce()),i&2){let e=s().$implicit,l=s().$implicit,t=s();o(),m("routerLink",U(3,M0,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",U(5,V0,l[1])),o(),T(l[e])}}function N0(i,c){if(i&1&&p(0),i&2){let e=s().$implicit,l=s().$implicit;v(" ",l[e]," ")}}function A0(i,c){if(i&1&&(n(0,"td",13),g(1,W0,3,7,"ng-container",28)(2,N0,1,1,"ng-template",null,1,M),a()),i&2){let e=c.index,l=Je(3);o(),m("ngIf",e===0)("ngIfElse",l)}}function G0(i,c){if(i&1&&(n(0,"tr",13),g(1,A0,4,2,"td",15),a()),i&2){let e=c.$implicit,l=s();o(),m("ngForOf",l.getFilteredKeys(e))}}var Rn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(l=>+l!=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(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[R],decls:41,vars:20,consts:[["pageFilterTemplate",""],["ELSE_BLOCK",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],[1,"border",2,"width","15%"],[1,"border"],["class","border","style","width: 10%",4,"ngFor","ngForOf"],["class","border",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2","class","text-center border",4,"ngFor","ngForOf"],["colspan","2",1,"text-center","border"],[1,"border",2,"width","10%"],[4,"ngIf","ngIfElse"],[3,"routerLink","queryParams"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",2),S("textChange",function(w){return u(r),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,B0,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,O0,16,10,"ng-template",null,0,M),a(),n(28,"content")(29,"div",8)(30,"table",9)(31,"thead",10),g(32,R0,4,1,"tr",11),n(33,"tr")(34,"th",12),p(35,"Name"),a(),n(36,"th",13),p(37,"Code"),a(),g(38,k0,2,1,"th",14),a()(),n(39,"tbody"),g(40,G0,2,1,"tr",15),a()()()()()}l&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,T0)),o(3),m("routerLink",b(15,P0)),o(3),m("routerLink",b(16,I0)),o(3),m("routerLink",b(17,F0)),o(3),m("routerLink",b(18,b0)),o(3),m("routerLink",b(19,E0)),o(9),m("ngIf",(t.data==null?null:t.data.Outlet.length)>0),o(6),m("ngForOf",t.data==null?null:t.data.Header),o(2),m("ngForOf",t.data==null?null:t.data.Data))},dependencies:[N,Y,k,A,K,B,L,De,fe,Q],encapsulation:2})};var H0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Q0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],Y0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],j0=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),vr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],q0=(i,c,e)=>({CategoryID:i,From:c,To:e}),U0=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],wr=i=>({CategoryID:i});function K0(i,c){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function z0(i,c){if(i&1&&(n(0,"span",22),p(1),a()),i&2){let e=c.item;dt("matTooltip",e.Value),o(),T(e.Value)}}function X0(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CategoryID,t)||(r.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.BrandID,t)||(r.pageData.Filter.BrandID=t),_(t)}),g(10,z0,2,2,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SalesID,t)||(r.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CustomerID,t)||(r.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",20),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CalculationDiscount,t)||(r.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(26,"h6"),p(27,"Exclude Zero"),a(),n(28,"radio-options",21),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ExcludeZero,t)||(r.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(5),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("ngModel",e.pageData.Filter.CalculationDiscount),m("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),x("model",e.pageData.Filter.ExcludeZero)}}function Z0(i,c){i&1&&(n(0,"th",42),p(1," Cost "),F(2,"p-treeTableSortIcon",43),a())}function J0(i,c){i&1&&(n(0,"th",44),p(1," Profit "),F(2,"p-treeTableSortIcon",45),a())}function $0(i,c){i&1&&(n(0,"th",46),p(1," % "),F(2,"p-treeTableSortIcon",47),a())}function ec(i,c){if(i&1&&(n(0,"tr",28)(1,"th",29),p(2," Category "),F(3,"p-treeTableSortIcon",30),a(),n(4,"th",31),p(5," Qty "),F(6,"p-treeTableSortIcon",32),a(),g(7,Z0,3,0,"th",33),n(8,"th",34),p(9," Gross "),F(10,"p-treeTableSortIcon",35),a(),n(11,"th",36),p(12," Disc "),F(13,"p-treeTableSortIcon",37),a(),n(14,"th",38),p(15," Sales "),F(16,"p-treeTableSortIcon",39),a(),g(17,J0,3,0,"th",40)(18,$0,3,0,"th",41),a()),i&2){let e=s(2);o(7),m("ngIf",e.roleService.product.Cost),o(10),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",e.roleService.report.Profit)}}function tc(i,c){if(i&1&&(n(0,"td",56)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().rowData;o(),dt("matTooltip",e.CostInDirect&&e.Cost?"Direct ("+C(2,2,e.Cost)+") Indirect ("+C(3,4,e.CostInDirect)+")":""),o(3),T(C(5,6,e.DisplayedCost))}}function ic(i,c){if(i&1&&(n(0,"td",57)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().rowData;o(),dt("matTooltip",e.ProfitInDirect&&e.Profit?"Direct ("+C(2,2,e.Profit)+") Indirect ("+C(3,4,e.ProfitInDirect)+")":""),o(3),T(C(5,6,e.DisplayedProfit))}}function nc(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;dt("matTooltip",e.PercentageInDirect&&e.Percentage?"Direct ("+y(1,2,e.Percentage,"1.0-2")+") Indirect ("+y(2,5,e.PercentageInDirect,"1.0-2")+")":""),o(3),v("",C(4,8,e.DisplayedPercentage),"%")}}function ac(i,c){if(i&1&&(n(0,"td"),g(1,nc,5,10,"span",58),a()),i&2){let e=s(3);o(),m("ngIf",e.roleService.report.Profit)}}function oc(i,c){if(i&1&&(n(0,"tr",48)(1,"td"),F(2,"p-treeTableToggler",49),n(3,"a",50),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",22),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),g(13,tc,6,8,"td",51),n(14,"td",52)(15,"span",22),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",53)(21,"a",54),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",52)(27,"span",22),d(28,"number"),d(29,"number"),n(30,"a",50),p(31),d(32,"amountFraction"),a()()(),g(33,ic,6,8,"td",55)(34,ac,2,1,"td",7),a()),i&2){let e=c.$implicit,l=c.rowData,t=s(2);m("ttRow",e),o(2),m("rowNode",e),o(),m("routerLink",b(50,vr))("queryParams",mt(51,q0,l.ID,y(4,20,t.pageData.Filter.From,"yyyy-MM-dd"),y(5,23,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),T(l.Name),o(2),dt("matTooltip",l.QuantityIndirect&&l.Quantity?"Direct ("+C(9,26,l.Quantity)+") Indirect ("+C(10,28,l.QuantityIndirect)+")":""),o(3),T(C(12,30,l.DisplayedQuantity)),o(2),m("ngIf",t.roleService.product.Cost),o(2),dt("matTooltip",l.GrossIndirect&&l.GrossSales?"Direct ("+C(16,32,l.GrossSales)+") Indirect ("+C(17,34,l.GrossIndirect)+")":""),o(3),T(C(19,36,l.DisplayedGross)),o(3),dt("matTooltip",l.DiscountIndirect&&l.Discount?"Direct ("+C(22,38,l.Discount)+") Indirect ("+C(23,40,l.DiscountIndirect)+")":""),m("routerLink",b(55,U0))("queryParams",U(56,wr,l.ID)),o(3),T(C(25,42,l.DisplayedTotalDiscount)),o(3),dt("matTooltip",l.NetSalesIndirect&&l.Sales?"Direct ("+C(28,44,l.Sales)+") Indirect ("+C(29,46,l.NetSalesIndirect)+")":""),o(3),m("routerLink",b(58,vr))("queryParams",U(59,wr,l.ID)),o(),T(C(32,48,l.DisplayedNetSales)),o(2),m("ngIf",t.roleService.report.Profit),o(),m("ngIf",t.roleService.report.Profit)}}function rc(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(2,1,e.data.Aggregate.TotalCost)," ")}}function lc(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(2,1,e.data.Aggregate.TotalProfit)," ")}}function pc(i,c){if(i&1&&(n(0,"td",60),p(1),d(2,"number"),a()),i&2){let e=s(3);o(),v(" ",C(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function mc(i,c){if(i&1&&(n(0,"tr",59)(1,"td",60),p(2,"Total :"),a(),n(3,"td",60),p(4),d(5,"quantityFraction"),a(),g(6,rc,3,3,"td",61),n(7,"td",62)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",60),p(12),d(13,"amountFraction"),a(),n(14,"td",62),p(15),d(16,"amountFraction"),a(),g(17,lc,3,3,"td",61)(18,pc,3,3,"td",63),a()),i&2){let e=s(2);o(4),v(" ",C(5,7,e.data.Aggregate.TotalQuantity)," "),o(2),m("ngIf",e.roleService.product.Cost),o(3),T(C(10,9,e.data.Aggregate.TotalGross)),o(3),v(" ",C(13,11,e.data.Aggregate.TotalDiscount)," "),o(3),v(" ",C(16,13,e.data.Aggregate.TotalNetSales)," "),o(2),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",e.roleService.report.Profit)}}function sc(i,c){if(i&1&&(n(0,"content")(1,"div",23)(2,"p-treeTable",24),g(3,ec,19,3,"ng-template",25)(4,oc,35,61,"ng-template",26)(5,mc,19,15,"ng-template",27),a()()()),i&2){let e=s();o(2),m("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",b(4,j0))}}var kn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[R],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedProfit",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["style","width: 120px","class","text-danger",4,"ngIf"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],["style","width: 120px","class","text-success",4,"ngIf"],[1,"text-danger",2,"width","120px"],[1,"text-success",2,"width","120px"],["matTooltipPosition","above",3,"matTooltip",4,"ngIf"],[1,"table-footer"],[1,"text-end"],["style","width: 120px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","150px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","120px"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(r),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,K0,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,X0,29,15,"ng-template",null,0,M),a(),g(19,sc,6,5,"content",7),a()}l&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(10,H0)),o(3),m("routerLink",b(11,Q0)),o(3),m("routerLink",b(12,Y0)),o(5),m("ngIf",t.data))},dependencies:[N,k,A,z,K,B,L,pe,De,Le,Jo,Fo,ir,$o,er,tr,fe,Q,Ye,un,ie,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 cc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],dc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],uc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function _c(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function gc(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CategoryID,t)||(r.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CustomerID,t)||(r.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.CustomerID)}}function fc(i,c){if(i&1&&(n(0,"th",23),p(1),a()),i&2){let e=c.$implicit;m("mat-sort-header",e),o(),T(e)}}function Cc(i,c){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Value)}}function xc(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Value))}}function hc(i,c){if(i&1&&(n(0,"td"),g(1,Cc,2,1,"span",22)(2,xc,3,3,"span",22),a()),i&2){let e=c.$implicit;o(),m("ngIf",e.Key=="Category"),o(),m("ngIf",e.Key!="Category")}}function Sc(i,c){if(i&1&&(n(0,"tr"),g(1,hc,3,2,"td",21),a()),i&2){let e=c.$implicit;o(),m("ngForOf",e)}}function yc(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;o(),v(" ",C(2,1,e),"")}}function Dc(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",24)(2,"td"),p(3,"Total : "),a(),g(4,yc,3,3,"td",21),a()()),i&2){let e=s(2);o(4),m("ngForOf",e.data.Sum)}}function vc(i,c){if(i&1){let e=I();n(0,"div",17)(1,"table",18),P("matSortChange",function(t){u(e);let r=s();return _(r.sortData(t))}),n(2,"thead",19)(3,"tr"),g(4,fc,2,2,"th",20),a()(),n(5,"tbody"),g(6,Sc,2,1,"tr",21),a(),g(7,Dc,5,1,"tfoot",22),a()()}if(i&2){let e=s();o(4),m("ngForOf",e.data.Dataheader),o(2),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0)}}var Wn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f}openExportModal(){this.matDialog.open(q,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let l=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=l;return}this.data.Data=l.sort((t,r)=>{let f=e.direction==="asc";for(let w=0;w<this.data.Dataheader.length;w++)if(e.active==this.data.Dataheader[w]){let Ee=t.find(ut=>ut.Key===[this.data.Dataheader[w]].toString()).Value,xt=r.find(ut=>ut.Key===[this.data.Dataheader[w]].toString()).Value;return this.compare(Ee,xt,f)}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[R],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(r),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,_c,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,gc,16,9,"ng-template",null,0,M),a(),n(19,"content"),g(20,vc,8,3,"div",7),a()()}l&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(10,cc)),o(3),m("routerLink",b(11,dc)),o(3),m("routerLink",b(12,uc)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,ae,ge,Le,fe,Q,X],encapsulation:2})};var wc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Tc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Pc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function Ic(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.Month,t)||(r.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.Year,t)||(r.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CurrencyID,t)||(r.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=s();o(3),x("ngModel",e.pageData.Filter.Month),m("items",e.Months),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies)}}function Fc(i,c){if(i&1&&(n(0,"div",11),F(1,"POS-pie-chart",12),a()),i&2){let e=s();o(),m("config",e.pieConfig)("data",e.PieData)}}var Nn=class i extends ne{constructor(e,l){super(e,l,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=l}Months=V.Months;Years=V.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(l){return new(l||i)(D(W),D(O))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[R],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(r),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),g(16,Ic,10,6,"ng-template",null,0,M),a(),n(18,"content"),g(19,Fc,2,2,"div",6),a()()}l&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(8,wc)),o(3),m("routerLink",b(9,Tc)),o(3),m("routerLink",b(10,Pc)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,B,L,ii],encapsulation:2})};var bc=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Ec(i,c){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",7),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",8)(9,"datepicker",9),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",10),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SalesOrderTagIDs,t)||(r.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("items",e.pageData.Options.SalesOrderTagIDs),x("ngModel",e.pageData.Filter.SalesOrderTagIDs),m("multiple",!0)}}function Mc(i,c){if(i&1&&(n(0,"content")(1,"div",11)(2,"div",12)(3,"div",13)(4,"div",14)(5,"div",15)(6,"div",16)(7,"p",17),p(8,"Transaction Per Hour"),a()(),n(9,"div",18),F(10,"POS-line-chart",19),a()()()(),n(11,"div",13)(12,"div",14)(13,"div",15)(14,"div",16)(15,"p",17),p(16,"Transaction Per Session"),a()(),n(17,"div",18),F(18,"POS-pie-chart",19),a()()()()()()()),i&2){let e=s();o(10),m("config",e.chartConfig)("data",e.ChartData),o(8),m("config",e.pieConfig)("data",e.PieData)}}var An=class i extends he{constructor(e,l,t){super(e,l,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=l;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,l=[],t=[];this.data.Data.forEach(r=>{l.push(r.Name);let f={name:r.Name+": "+r.Description,y:r.Transaction};t.push(f)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(r,f){return r+"<br/>"+f.series.name+": <b>"+f.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(G))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[R],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"a",2),F(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),g(6,Ec,13,9,"ng-template",null,0,M),a(),g(8,Mc,19,4,"content",4),a()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("routerLink",b(6,bc)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,K,B,L,ii,Et,Q],encapsulation:2})};function Vc(i,c){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export "),a()}}function Bc(i,c){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",8),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Oc(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",19),p(5),d(6,"number"),a(),n(7,"td",19),p(8),d(9,"number"),a(),n(10,"td",19),p(11),d(12,"amountFraction"),a(),n(13,"td",19),p(14),d(15,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),T(C(3,5,e.Visitor)),o(3),T(C(6,7,e.Orders)),o(3),T(C(9,9,e.TotalVisitor)),o(3),T(C(12,11,e.Sales)),o(3),T(C(15,13,e.Sales/(e.Visitor*e.Orders)))}}function Lc(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,Oc,16,15,"tr",17),a(),n(16,"tfoot")(17,"tr",18)(18,"td",19),p(19,"Total"),a(),n(20,"td",19),p(21),d(22,"sum"),d(23,"number"),a(),n(24,"td",19),p(25),d(26,"sum"),d(27,"number"),a(),n(28,"td",19),p(29),d(30,"sum"),d(31,"amountFraction"),a(),n(32,"td",19),p(33),d(34,"amountFraction"),a()()()()()),i&2){let e=s();o(15),m("ngForOf",e.data),o(6),T(C(23,8,y(22,5,e.data,"Orders"))),o(4),T(C(27,13,y(26,10,e.data,"TotalVisitor"))),o(4),T(C(31,18,y(30,15,e.data,"Sales"))),o(4),T(C(34,20,e.getSpendingPerPersonSum(e.data)))}}var Gn=class i extends ne{constructor(e,l,t,r,f){super(e,l,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f}getSpendingPerPersonSum(e){return e.reduce((l,t)=>l+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(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[R],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Vc,3,0,"a",2),a(),n(3,"filters"),g(4,Bc,10,6,"ng-template",null,0,M),a(),n(6,"content"),g(7,Lc,35,22,"div",3),a()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,K,B,L,Q,oe,ie,X],encapsulation:2})};var Rc=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function kc(i,c){if(i&1){let e=I();n(0,"a",18),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",19),p(2," Export "),a()}}function Wc(i,c){if(i&1){let e=I();n(0,"div",20)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",21),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",22),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",23)(9,"datepicker",24),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Nc(i,c){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Ac(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Revenue))}}function Gc(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,Ac,3,3,"td",17),a()),i&2){let e=c.$implicit,l=s();o(2),T(e.TimeFormat),o(2),T(C(5,7,e.Count)),o(3),T(C(8,9,e.Quantity)),o(3),T(C(11,11,e.Sales)),o(3),T(C(15,15,C(14,13,e.Tax))),o(4),T(C(19,19,C(18,17,e.SalesWithTax))),o(3),m("ngIf",l.roleService.product.Cost||l.roleService.report.Profit)}}function Hc(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s();o(),T(C(3,4,y(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var Hn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(q,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[R],decls:55,vars:44,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class"," text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],["class","text-end",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,kc,3,0,"a",2),n(3,"a",3),F(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),g(7,Wc,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,Nc,2,0,"th",11),a()(),n(27,"tbody"),g(28,Gc,21,21,"tr",12),a(),n(29,"tfoot")(30,"tr",13),F(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,Hc,4,6,"td",17),a()()()()()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(),m("routerLink",b(43,Rc)),o(23),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit),o(2),m("ngForOf",t.data==null?null:t.data.Data),o(5),T(C(35,17,y(34,14,t.data==null?null:t.data.Data,"Count"))),o(4),T(C(39,22,y(38,19,t.data==null?null:t.data.Data,"Quantity"))),o(4),T(C(43,27,y(42,24,t.data==null?null:t.data.Data,"Sales"))),o(4),T(C(48,34,C(47,32,y(46,29,t.data==null?null:t.data.Data,"Tax")))),o(5),T(C(53,41,C(52,39,y(51,36,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit))},dependencies:[N,Y,k,A,K,B,L,Q,oe,Qo,ie,X,Z],encapsulation:2})};var Qc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],$a=(i,c)=>({From:i,To:c}),Yc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],jc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function qc(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CategoryID,t)||(r.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CurrencyID,t)||(r.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let r=s();return _(r.onFilterDateChange(t))}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function Uc(i,c){if(i&1&&(n(0,"content")(1,"div",12),F(2,"POS-line-chart",13),a()()),i&2){let e=s();o(2),m("config",e.chartConfig)("data",e.ChartData)}}var Qn=class i extends ne{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(c,e,l){super(c,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,l),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(r=>`${r.getDate()} ${V.Months[r.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(O),D(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[R],decls:19,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,l){if(e&1){let t=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(t),_(l.searchFromPageOne())}),S("filterChange",function(f){return u(t),h(l.pageData.Filter,f)||(l.pageData.Filter=f),_(f)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),g(16,qc,13,11,"ng-template",null,0,M),a(),g(18,Uc,3,2,"content",6),a()}e&2&&(m("pageData",l.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",l.pageData.Filter),o(7),m("routerLink",b(11,Qc))("queryParams",de(12,$a,l.pageData.Filter==null?null:l.pageData.Filter.From,l.pageData.Filter==null?null:l.pageData.Filter.To)),o(3),m("routerLink",b(15,Yc))("queryParams",de(16,$a,l.pageData.Filter==null?null:l.pageData.Filter.From,l.pageData.Filter==null?null:l.pageData.Filter.To)),o(3),m("routerLink",b(19,jc))("queryParams",de(20,$a,l.pageData.Filter==null?null:l.pageData.Filter.From,l.pageData.Filter==null?null:l.pageData.Filter.To)),o(5),m("ngIf",l.data))},dependencies:[N,k,A,z,B,L,Et,At,fe,Q],encapsulation:2})};var Zc={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},ri=class i{date;dateChange=new Ai;width;minDate=V.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(c,e){let l=null;c&&(l=c.toDate(),l.setHours(0,0,0,0)),this.date=l,this.dateChange.emit(l),e.close()}onDateChange(c){let e=null;c&&(e=c.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(c,e){let l=new Date(c.getFullYear(),0,1);this.date=l.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[di([{provide:tn,useClass:Sn,deps:[en,Zo]},{provide:nn,useValue:Zc}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,l){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(f){return u(t),_(l.onDateChange(f.value))}),a(),F(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(f){u(t);let w=Je(4);return _(l.chosenYearHandler(f,w))})("monthSelected",function(f){u(t);let w=Je(4);return _(l.setMonthAndYear(f,w))})("opened",function(){return u(t),_(l.onOpenDatepicker())})("closed",function(){return u(t),_(l.onCloseDatepicker())}),a()()}if(e&2){let t=Je(4);_o("width",l.width||100,"%"),o(),m("matDatepicker",t)("value",l.date==l.minDate?null:l.date),o(),m("for",t)}},dependencies:[Nt,mn,_i,rn,ln,pn,gi,cn,on,an,sn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
1
|
+
import{a as ii,b as or}from"./chunk-Z76AR3IW.js";import{a as mr,b as sr}from"./chunk-WUDGY4TW.js";import{a as Dn}from"./chunk-EUZWX7OP.js";import"./chunk-4NHG4RRM.js";import{a as Et,b as rr}from"./chunk-KVCJJEYJ.js";import{a as At,b as lr}from"./chunk-BAORXMVG.js";import"./chunk-YAFVFDTG.js";import{a as ar}from"./chunk-V7UEUV6F.js";import{a as ti}from"./chunk-H4CCCG5S.js";import{a as he}from"./chunk-6WKUSM4P.js";import{a as yn}from"./chunk-ATYFAKRP.js";import{a as cr}from"./chunk-7KSMBMSW.js";import{a as Ye}from"./chunk-B56YVUVP.js";import{a as vt}from"./chunk-ZHDKGVTO.js";import{a as Lo}from"./chunk-LKFDM7AC.js";import{b as No}from"./chunk-L2PLXSAS.js";import"./chunk-XU5SOTZS.js";import{a as pr}from"./chunk-QGNOVY53.js";import{a as Si}from"./chunk-I6E6PXQU.js";import"./chunk-BYXBJQAS.js";import{a as dr,b as ur,d as _r,g as gr}from"./chunk-R5IO2SN4.js";import"./chunk-BADUP5JT.js";import"./chunk-OPCIBNIJ.js";import"./chunk-G6C75N4Q.js";import"./chunk-PRKAXHSJ.js";import"./chunk-WOZLNXGI.js";import{e as Wo}from"./chunk-6CJCT6YT.js";import{a as Jo,b as $o,c as er,d as tr,e as ir,f as nr}from"./chunk-RDWRQIJV.js";import"./chunk-KVJTNXOJ.js";import"./chunk-AMNMXSBW.js";import"./chunk-2GQKEX5I.js";import"./chunk-XZQMVGBQ.js";import{c as ko,d as De,e as hn}from"./chunk-HV6ZFQAQ.js";import{a as X}from"./chunk-GOLWWX2Q.js";import{a as Bi,b as Zo,c as Sn,d as K,e as hi}from"./chunk-Z7LRKY4R.js";import{a as cn,b as gi}from"./chunk-SN3DTCGO.js";import"./chunk-3RK6DDJD.js";import{a as sn}from"./chunk-7UFQPOGN.js";import{a as Z}from"./chunk-GZAARWM2.js";import{a as en,b as tn,c as nn,f as rn,g as ln,h as pn,p as _i,q as mn}from"./chunk-2F5STFEV.js";import"./chunk-DWOLAWQN.js";import"./chunk-Y3CUYCSX.js";import"./chunk-T2PXIPKB.js";import"./chunk-QMCAG2HX.js";import{a as dn}from"./chunk-XXCIMR5I.js";import{d as Uo,f as fe}from"./chunk-VV7L7X33.js";import{a as bt,b as Xo}from"./chunk-NHTMJTLV.js";import{a as ae,b as ge,c as Oo}from"./chunk-3XMWVJ2L.js";import{a as Ko,b as zo,c as Q}from"./chunk-SMW5YQZJ.js";import{b as q}from"./chunk-ILF7FISN.js";import{a as ne}from"./chunk-GA554R72.js";import{a as Bo}from"./chunk-QTEEAYLA.js";import"./chunk-NW73SHIZ.js";import{a as H}from"./chunk-NDM2ODJP.js";import{d as N,e as xi}from"./chunk-SFCQJQF3.js";import"./chunk-BAXQFKT2.js";import"./chunk-OMVUFMMZ.js";import"./chunk-HPLAMF75.js";import{e as qo}from"./chunk-WRHYTFLY.js";import"./chunk-T6MTT57B.js";import{c as Ao}from"./chunk-4CRQAT4Y.js";import"./chunk-4L5G4WC4.js";import"./chunk-3NJFM55L.js";import"./chunk-2LFFOWKW.js";import"./chunk-OQCGVZVB.js";import"./chunk-UAI7BPPY.js";import"./chunk-6IW4MVP2.js";import{b as W}from"./chunk-6LQ6DVZN.js";import"./chunk-OI2RWAOV.js";import"./chunk-7LXPGNYF.js";import{a as Go,c as Qe}from"./chunk-CN5SHMHF.js";import"./chunk-3M5M2T4L.js";import{C as Cn,F as Le,G as xn,j as an,m as on,t as Ro,u as fi,v as $t,w as _n}from"./chunk-45BASVRZ.js";import{b as pe,c as $i}from"./chunk-XOQ4SW2R.js";import{A as fn,B as Yo,C as ei,K as Ci,N as jo,g as oe,o as Ho,s as gn,z as Qo}from"./chunk-4SOJX57D.js";import"./chunk-GHC4BCCW.js";import"./chunk-GIKR6Y2K.js";import{a as un,d as z}from"./chunk-3GV7FUAX.js";import{b as Zi,e as Zt,f as Jt,g as j}from"./chunk-6BL2JKZG.js";import"./chunk-REQUYIUO.js";import{a as Mo,b as Vo}from"./chunk-QCBXPOJL.js";import{a as Eo}from"./chunk-T2PMKO3M.js";import{a as Vi}from"./chunk-2FWFPV5I.js";import{la as Fo,ma as Ji,ua as bo}from"./chunk-OE7PM4Y4.js";import{F as Nt,G as Xi,a as vo,b as wo,c as ke,h as B,l as To,o as L,q as Po,s as Io}from"./chunk-CB33ZMNF.js";import"./chunk-YHDEAPG3.js";import"./chunk-M3WKPJ2B.js";import{a as V,d as G}from"./chunk-TYBAV5LT.js";import"./chunk-2DQBDX5E.js";import{$a as o,$b as ji,Ac as C,Ba as Ni,Bc as y,Cc as ui,Db as Hi,E as oi,Eb as za,Fa as Ai,Fc as M,Gb as bi,Hb as Ei,I as Ii,Ib as n,Jb as a,K as po,Kb as F,Kc as xo,Lb as se,M as mo,Ma as ct,Mb as ce,Mc as Ui,Nb as fo,Nc as ho,Ob as I,Od as Oe,Pc as Xa,Q as Wi,Qb as P,Qc as So,Qd as zi,Rb as s,Rd as A,Td as Mi,Ub as dt,Va as Pe,Vd as Ke,Wa as Gi,Wc as He,Y as Rt,Yc as Y,Yd as O,Zb as Qi,Zc as k,_b as Yi,aa as Ua,ad as yo,cd as Ki,db as D,dc as Je,ec as p,ed as ee,fa as kt,fc as T,gc as v,gd as ie,hc as zt,ia as so,ib as uo,ja as co,jc as x,jd as Xt,ka as si,kb as E,kc as h,lb as ci,lc as S,na as Ge,o as mi,ob as R,pc as di,qb as g,qc as b,rc as U,sc as de,t as Qt,tc as mt,u as qa,ub as Yt,uc as jt,va as u,vb as m,vc as qi,wa as _,wb as _o,wc as Co,wd as Do,xb as Fi,za as Ka,zb as go,zc as d}from"./chunk-DJOHANFC.js";import{a as Ze,b as et,e as ll,g as Ht}from"./chunk-7DCB7DB2.js";var no=ll((pb,Va)=>{(function(i){typeof Va=="object"&&Va.exports?(i.default=i,Va.exports=i):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts"],function(c){return i(c),i.Highcharts=c,i}):i(typeof Highcharts<"u"?Highcharts:void 0)})(function(i){"use strict";var c=i?i._modules:{};function e(l,t,r,f){l.hasOwnProperty(t)||(l[t]=f.apply(null,r),typeof CustomEvent=="function"&&i.win.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:l[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 l(r,f,w,Ee,xt,ut){let Vt=(ut-f)*(w-r)-(Ee-f)*(xt-r);return Vt>0||!(Vt<0)}function t(r,f,w,Ee,xt,ut,Vt,Wt){return l(r,f,xt,ut,Vt,Wt)!==l(w,Ee,xt,ut,Vt,Wt)&&l(r,f,w,Ee,xt,ut)!==l(r,f,w,Ee,Vt,Wt)}return{boxIntersectLine:function(r,f,w,Ee,xt,ut,Vt,Wt){return t(r,f,r+w,f,xt,ut,Vt,Wt)||t(r+w,f,r+w,f+Ee,xt,ut,Vt,Wt)||t(r,f+Ee,r+w,f+Ee,xt,ut,Vt,Wt)||t(r,f,r,f+Ee,xt,ut,Vt,Wt)},intersectRect:function(r,f){return!(f.left>r.right||f.right<r.left||f.top>r.bottom||f.bottom<r.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(l,t,r,f,w,Ee,xt){let{animObject:ut}=l,{format:Vt}=t,{setOptions:Wt}=r,{composed:tl}=f,{boxIntersectLine:ao,intersectRect:il}=Ee,{addEvent:oo,extend:ro,fireEvent:nl,isNumber:Ri,pick:qt,pushUnique:al,syncTimeout:ol}=xt;function li(st,Me,at,we,Pt){let it=st.chart,$=st.options.label||{},ze=qt($.onArea,!!st.area),je=ze||$.connectorAllowed,lt=it.boxesToAvoid,Bt=Number.MAX_VALUE,It=Number.MAX_VALUE,ht,_t,gt,Ut,Ft,Xe,be;for(Xe=0;lt&&Xe<lt.length;Xe+=1)if(il(lt[Xe],{left:Me,right:Me+we.width,top:at,bottom:at+we.height}))return!1;for(Xe=0;Xe<it.series.length;Xe+=1){let ot=it.series[Xe],Ve=ot.interpolatedPoints&&[...ot.interpolatedPoints];if(ot.visible&&Ve){let Ue=it.plotHeight/10;for(let $e=it.plotTop;$e<=it.plotTop+it.plotHeight;$e+=Ue)Ve.unshift({chartX:it.plotLeft,chartY:$e}),Ve.push({chartX:it.plotLeft+it.plotWidth,chartY:$e});for(be=1;be<Ve.length;be+=1){if(Ve[be].chartX>=Me-16&&Ve[be-1].chartX<=Me+we.width+16){if(ao(Me,at,we.width,we.height,Ve[be-1].chartX,Ve[be-1].chartY,Ve[be].chartX,Ve[be].chartY))return!1;st===ot&&!gt&&Pt&&(gt=ao(Me-16,at-16,we.width+32,we.height+32,Ve[be-1].chartX,Ve[be-1].chartY,Ve[be].chartX,Ve[be].chartY))}(je||gt)&&(st!==ot||ze)&&(Bt=Math.min(Bt,(Ut=Me+we.width/2-Ve[be].chartX)*Ut+(Ft=at+we.height/2-Ve[be].chartY)*Ft))}if(!ze&&je&&st===ot&&(Pt&&!gt||Bt<Math.pow($.connectorNeighbourDistance||1,2))){for(be=1;be<Ve.length;be+=1)(ht=Math.min(Math.pow(Me+we.width/2-Ve[be].chartX,2)+Math.pow(at+we.height/2-Ve[be].chartY,2),Math.pow(Me-Ve[be].chartX,2)+Math.pow(at-Ve[be].chartY,2),Math.pow(Me+we.width-Ve[be].chartX,2)+Math.pow(at-Ve[be].chartY,2),Math.pow(Me+we.width-Ve[be].chartX,2)+Math.pow(at+we.height-Ve[be].chartY,2),Math.pow(Me-Ve[be].chartX,2)+Math.pow(at+we.height-Ve[be].chartY,2)))<It&&(It=ht,_t=Ve[be]);gt=!0}}}return(!Pt||!!gt)&&{x:Me,y:at,weight:Bt-(_t?It:0),connectorPoint:_t}}function lo(st){if(this.renderer){let Me=this,at=ut(Me.renderer.globalAnimation).duration;Me.labelSeries=[],Me.labelSeriesMaxSum=0,Me.seriesLabelTimer&&xt.clearTimeout(Me.seriesLabelTimer),Me.series.forEach(function(we){let Pt=we.options.label||{},it=we.labelBySeries,$=it&&it.closest;Pt.enabled&&we.visible&&(we.graph||we.area)&&!we.boosted&&Me.labelSeries&&(Me.labelSeries.push(we),Pt.minFontSize&&Pt.maxFontSize&&we.yData&&(we.sum=we.yData.reduce((ze,je)=>(ze||0)+(je||0),0),Me.labelSeriesMaxSum=Math.max(Me.labelSeriesMaxSum||0,we.sum||0)),st.type==="load"&&(at=Math.max(at,ut(we.options.animation).duration)),$&&($[0].plotX!==void 0?it.animate({x:$[0].plotX+$[1],y:$[0].plotY+$[2]}):it.attr({opacity:0})))}),Me.seriesLabelTimer=ol(function(){Me.series&&Me.labelSeries&&function(we){we.boxesToAvoid=[];let Pt=we.labelSeries||[],it=we.boxesToAvoid;we.series.forEach($=>($.points||[]).forEach(ze=>(ze.dataLabels||[]).forEach(je=>{let{width:lt,height:Bt}=je.getBBox(),It=(je.translateX||0)+($.xAxis?$.xAxis.pos:$.chart.plotLeft),ht=(je.translateY||0)+($.yAxis?$.yAxis.pos:$.chart.plotTop);it.push({left:It,top:ht,right:It+lt,bottom:ht+Bt})}))),Pt.forEach(function($){let ze=$.options.label||{};$.interpolatedPoints=function(je){let lt,Bt,It,ht,_t;if(!je.xAxis&&!je.yAxis)return;let gt=je.points,Ut=[],Ft=je.graph||je.area,Xe=Ft&&Ft.element,be=je.chart.inverted,ot=je.xAxis,Ve=je.yAxis,Ue=be?Ve.pos:ot.pos,$e=be?ot.pos:Ve.pos,Dt=be?ot.len:Ve.len,Pi=be?Ve.len:ot.len,ft=qt((je.options.label||{}).onArea,!!je.area),Ne=Ve.getThreshold(je.options.threshold),wt={},Kt=be?"chartCenterX":"chartCenterY";function ai(nt){let St=Math.round((nt.plotX||0)/8)+","+Math.round((nt.plotY||0)/8);wt[St]||(wt[St]=1,Ut.push(nt))}if(je.getPointSpline&&Xe&&Xe.getPointAtLength&&!ft&>.length<(je.chart.plotSizeX||0)/16){let nt=Ft.toD&&Ft.attr("d");for(Ft.toD&&Ft.attr({d:Ft.toD}),It=Xe.getTotalLength(),lt=0;lt<It;lt+=16){let Lt=Xe.getPointAtLength(lt),Ct=be?Pi-Lt.y:Lt.x,pt=be?Dt-Lt.x:Lt.y;ai({chartX:Ue+Ct,chartY:$e+pt,plotX:Ct,plotY:pt})}nt&&Ft.attr({d:nt});let St=gt[gt.length-1].pos();ai({chartX:Ue+(St?.[0]||0),chartY:$e+(St?.[1]||0)})}else{let nt;for(lt=0,It=gt.length;lt<It;lt+=1){let St=gt[lt],[Lt,Ct]=St.pos()||[],{plotHigh:pt}=St;if(Ri(Lt)&&Ri(Ct)){let rt={plotX:Lt,plotY:Ct,chartX:Ue+Lt,chartY:$e+Ct};if(ft&&(pt&&(rt.plotY=pt,rt.chartY=$e+pt),be?rt.chartCenterX=Ue+Pi-((pt||St.plotY||0)+qt(St.yBottom,Ne))/2:rt.chartCenterY=$e+((pt||Ct)+qt(St.yBottom,Ne))/2),nt&&(Bt=Math.max(Math.abs(rt.chartX-nt.chartX),Math.abs(rt.chartY-nt.chartY)))>16)for(_t=1,ht=Math.ceil(Bt/16);_t<ht;_t+=1)ai({chartX:nt.chartX+(rt.chartX-nt.chartX)*(_t/ht),chartY:nt.chartY+(rt.chartY-nt.chartY)*(_t/ht),[Kt]:(nt[Kt]||0)+((rt[Kt]||0)-(nt[Kt]||0))*(_t/ht),plotX:(nt.plotX||0)+(Lt-(nt.plotX||0))*(_t/ht),plotY:(nt.plotY||0)+(Ct-(nt.plotY||0))*(_t/ht)});ai(rt),nt=rt}}}return Ut}($),it.push(...ze.boxesToAvoid||[])}),we.series.forEach(function($){let ze=$.options.label;if(!ze||!$.xAxis&&!$.yAxis)return;let je="highcharts-color-"+qt($.colorIndex,"none"),lt=!$.labelBySeries,Bt=ze.minFontSize,It=ze.maxFontSize,ht=we.inverted,_t=ht?$.yAxis.pos:$.xAxis.pos,gt=ht?$.xAxis.pos:$.yAxis.pos,Ut=we.inverted?$.yAxis.len:$.xAxis.len,Ft=we.inverted?$.xAxis.len:$.yAxis.len,Xe=$.interpolatedPoints,be=qt(ze.onArea,!!$.area),ot=[],Ve=$.xData||[],Ue,$e,Dt,Pi,ft,Ne,wt=$.labelBySeries,Kt,ai,nt;function St(Ct,pt,rt){let ki=Math.max(_t,qt(ai,-1/0)),pi=Math.min(_t+Ut,qt(nt,1/0));return Ct>ki&&Ct<=pi-rt.width&&pt>=gt&&pt<=gt+Ft-rt.height}function Lt(){wt&&($.labelBySeries=wt.destroy())}if(be&&!ht&&(Kt=[$.xAxis.toPixels(Ve[0]),$.xAxis.toPixels(Ve[Ve.length-1])],ai=Math.min.apply(Math,Kt),nt=Math.max.apply(Math,Kt)),$.visible&&!$.boosted&&Xe){if(!wt){let Ct=$.name;if(typeof ze.format=="string"?Ct=Vt(ze.format,$,we):ze.formatter&&(Ct=ze.formatter.call($)),$.labelBySeries=wt=we.renderer.label(Ct,0,0,"connector",0,0,ze.useHTML).addClass("highcharts-series-label highcharts-series-label-"+$.index+" "+($.options.className||"")+" "+je),!we.renderer.styledMode){let pt=typeof $.color=="string"?$.color:"#666666";wt.css(ro({color:be?we.renderer.getContrast(pt):pt},ze.style||{})),wt.attr({opacity:we.renderer.forExport?1:0,stroke:$.color,"stroke-width":1})}Bt&&It&&wt.css({fontSize:Bt+($.sum||0)/($.chart.labelSeriesMaxSum||0)*(It-Bt)+"px"}),wt.attr({padding:0,zIndex:3}).add()}for((Ue=wt.getBBox()).width=Math.round(Ue.width),ft=Xe.length-1;ft>0;ft-=1)be?St($e=(Xe[ft].chartCenterX??Xe[ft].chartX)-Ue.width/2,Dt=(Xe[ft].chartCenterY??Xe[ft].chartY)-Ue.height/2,Ue)&&(Ne=li($,$e,Dt,Ue)):(St($e=Xe[ft].chartX+3,Dt=Xe[ft].chartY-Ue.height-3,Ue)&&(Ne=li($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX+3,Dt=Xe[ft].chartY+3,Ue)&&(Ne=li($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX-Ue.width-3,Dt=Xe[ft].chartY+3,Ue)&&(Ne=li($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX-Ue.width-3,Dt=Xe[ft].chartY-Ue.height-3,Ue)&&(Ne=li($,$e,Dt,Ue,!0))),Ne&&ot.push(Ne);if(ze.connectorAllowed&&!ot.length&&!be)for($e=_t+Ut-Ue.width;$e>=_t;$e-=16)for(Dt=gt;Dt<gt+Ft-Ue.height;Dt+=16)(Pi=li($,$e,Dt,Ue,!0))&&ot.push(Pi);if(ot.length){ot.sort((pt,rt)=>rt.weight-pt.weight),Ne=ot[0],(we.boxesToAvoid||[]).push({left:Ne.x,right:Ne.x+Ue.width,top:Ne.y,bottom:Ne.y+Ue.height});let Ct=Math.sqrt(Math.pow(Math.abs(Ne.x-(wt.x||0)),2)+Math.pow(Math.abs(Ne.y-(wt.y||0)),2));if(Ct&&$.labelBySeries){let pt,rt={opacity:we.renderer.forExport?1:0,x:Ne.x,y:Ne.y},ki={opacity:1};Ct<=10&&(ki={x:rt.x,y:rt.y},rt={}),lt&&(pt=ut($.options.animation),pt.duration*=.2),$.labelBySeries.attr(ro(rt,{anchorX:Ne.connectorPoint&&(Ne.connectorPoint.plotX||0)+_t,anchorY:Ne.connectorPoint&&(Ne.connectorPoint.plotY||0)+gt})).animate(ki,pt),$.options.kdNow=!0,$.buildKDTree();let pi=$.searchPoint({chartX:Ne.x,chartY:Ne.y},!0);pi&&(wt.closest=[pi,Ne.x-(pi.plotX||0),Ne.y-(pi.plotY||0)])}}else Lt()}else Lt()}),nl(we,"afterDrawSeriesLabels")}(Me)},Me.renderer.forExport||!at?0:at)}}function rl(st,Me,at,we,Pt){let it=Pt&&Pt.anchorX,$=Pt&&Pt.anchorY,ze,je,lt=at/2;return Ri(it)&&Ri($)&&(ze=[["M",it,$]],(je=Me-$)<0&&(je=-we-je),je<at&&(lt=it<st+at/2?je:at-je),$>Me+we?ze.push(["L",st+lt,Me+we]):$<Me?ze.push(["L",st+lt,Me]):it<st?ze.push(["L",st,Me+we/2]):it>st+at&&ze.push(["L",st+at,Me+we/2])),ze||[]}return{compose:function(st,Me){al(tl,"SeriesLabel")&&(oo(st,"load",lo),oo(st,"redraw",lo),Me.prototype.symbols.connector=rl,Wt({plotOptions:{series:{label:w}}}))}}}),e(c,"masters/modules/series-label.src.js",[c["Core/Globals.js"],c["Extensions/SeriesLabel/SeriesLabel.js"]],function(l,t){return t.compose(l.Chart,l.SVGRenderer),l})})});var fr=(i,c)=>({"text-success":i,"text-danger":c});function pl(i,c){if(i&1&&(se(0),n(1,"span"),p(2),d(3,"number"),a(),ce()),i&2){let e=c.ngIf;o(2),v(" ",y(3,1,e.Quantity,"1.0-0")," ")}}function ml(i,c){if(i&1){let e=I();n(0,"span",8),P("click",function(){u(e);let t=s(2);return _(t.loadComplementaryQuantity())}),F(1,"i",9),a()}}function sl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"td")(3,"span",5),p(4," Cost "),a()(),n(5,"td")(6,"span",7),p(7),d(8,"amountFraction"),a()(),n(9,"td")(10,"span",7),p(11),d(12,"number"),a()()(),ce()),i&2){let e=s().ngIf;o(7),v(" ",C(8,2,e.Cost)," "),o(4),v(" ",y(12,4,e.CostRatio,"1.0-2"),"% ")}}function cl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"td")(3,"span",5),p(4," Profit "),a()(),n(5,"td")(6,"span",10),p(7),d(8,"amountFraction"),a()(),n(9,"td")(10,"span",11),p(11),d(12,"number"),a()()(),ce()),i&2){let e=s().ngIf;o(6),m("ngClass",de(9,fr,e.Profit>0,e.Profit<0)),o(),v(" ",C(8,4,e.Profit)," "),o(3),m("ngClass",de(12,fr,e.ProfitRatio>0,e.ProfitRatio<0)),o(),v("",y(12,6,e.ProfitRatio,"1.0-2"),"%")}}function dl(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(),F(10,"td"),a(),n(11,"tr")(12,"td")(13,"span",5),p(14," Quantity "),a()(),n(15,"td"),p(16),d(17,"quantityFraction"),a(),F(18,"td"),a(),n(19,"tr")(20,"td")(21,"span",5),p(22," Complementary "),a()(),n(23,"td"),g(24,pl,4,4,"ng-container",6),d(25,"async"),g(26,ml,2,0,"ng-template",null,0,M),a(),F(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(),F(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(),F(56,"td"),a(),n(57,"tr")(58,"td")(59,"span",5),p(60," Tax "),a()(),n(61,"td"),p(62),d(63,"amountFraction"),a(),F(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(),F(72,"td"),a(),g(73,sl,13,7,"ng-container",3)(74,cl,13,15,"ng-container",3),a()(),ce()),i&2){let e=c.ngIf,l=Je(27),t=s();o(8),T(C(9,12,e.Orders)),o(8),T(C(17,14,e.Quantity)),o(8),m("ngIf",C(25,16,t.complementaryQuantity$))("ngIfElse",l),o(10),T(C(35,18,e.GrossSales)),o(9),v(" ",C(44,20,e.Discount)," "),o(4),v(" ",y(48,22,e.DiscountRatio,"1.0-2"),"% "),o(7),T(C(55,25,e.Sales)),o(8),T(C(63,27,e.Tax)),o(8),T(C(71,29,e.SalesWithTax)),o(3),m("ngIf",t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost),o(),m("ngIf",t.roleService.report.Profit)}}var vn=class i{constructor(c,e,l,t){this.httpService=c;this.roleService=e;this.dialogRef=l;this.data=t;this.fractionDigit=this.data.FractionDigit}modalConfig;reportSummary$;fractionDigit;filter;complementaryQuantity$;ngOnInit(){this.reportSummary$=this.httpService.post("/api/Report/ReportDetailFooter",this.data.Filter).pipe(Qt(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 fi,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,l){let t=0;return this.data?.IncludeTax&&(e+=l),e!=0&&(t=c/e*100),t}profitRatioCalculation(c,e,l){let t=0;return this.data?.IncludeTax&&(e+=l),e!=0&&(t=c/e*100),t}discountPercentageCalc(c=0,e=0,l=0){return c/(e-l)*100}loadComplementaryQuantity(){this.complementaryQuantity$=this.httpService.post("/api/Report/ReportDetailComplementaryQuantity",this.data.Filter).pipe(Rt())}static \u0275fac=function(e){return new(e||i)(D(O),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,l){e&1&&(n(0,"modal-material",1),P("onClose",function(){return l.dialogRef.close()}),n(1,"content")(2,"div",2),g(3,dl,75,31,"ng-container",3),d(4,"async"),a()()()),e&2&&(m("config",l.modalConfig),o(3),m("ngIf",C(4,2,l.reportSummary$)))},dependencies:[He,k,$t,Ki,ie,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 ul=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Cr=i=>({ID:i});function _l(i,c){if(i&1){let e=I();n(0,"button",6),P("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),F(1,"i",7),p(2," Export "),a()}}function gl(i,c){if(i&1&&(n(0,"div",4),g(1,_l,3,0,"button",5),a()),i&2){let e=s();o(),m("ngIf",e.roleService.global.Export)}}function fl(i,c){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",10),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CustomerID,t)||(r.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",11),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",12)(11,"datepicker",13),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",14),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SalesID,t)||(r.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",15),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ContactGroupID,t)||(r.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",16),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.Bin,t)||(r.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",17),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.TypeID,t)||(r.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",18),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CurrencyID,t)||(r.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",19),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.DeliveryStateID,t)||(r.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",20),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.PaymentStateID,t)||(r.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",21),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CreatorID,t)||(r.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",22),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.NoteVisible,t)||(r.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),F(41,"i",23),a(),n(42,"ng-select",24),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.QueryOption,t)||(r.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",25),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.DefaultFilterColumn,t)||(r.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("model",e.pageData.Filter.Bin),o(3),m("items",e.pageData.Options.Types),x("ngModel",e.pageData.Filter.TypeID),o(3),m("items",e.pageData.Options.Currencies),x("ngModel",e.pageData.Filter.CurrencyID),o(3),m("items",e.pageData.Options.Deliveries),x("ngModel",e.pageData.Filter.DeliveryStateID),o(3),x("ngModel",e.pageData.Filter.PaymentStateID),m("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),x("ngModel",e.pageData.Filter.CreatorID),m("renderThumbnail",!1),o(3),x("model",e.pageData.Filter.NoteVisible),o(4),m("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),x("ngModel",e.pageData.Filter.QueryOption),o(3),x("model",e.pageData.Filter.DefaultFilterColumn),m("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Cl(i,c){i&1&&(n(0,"th",44),p(1," @ Cost "),a())}function xl(i,c){if(i&1&&(n(0,"small",60),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),T(y(2,1,e.CustomerNameDisplay," - {0}"))}}function hl(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),T(y(2,1,e.SalesName," - Sales: {0}"))}}function Sl(i,c){if(i&1&&(n(0,"span",60),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" "," - Profit: "+C(2,1,e.Profit)," ")}}function yl(i,c){if(i&1&&(n(0,"i",61),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function Dl(i,c){if(i&1&&(n(0,"span",62),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function vl(i,c){i&1&&(n(0,"span"),p(1,"-"),a())}function wl(i,c){if(i&1&&(se(0),F(1,"div",63),d(2,"newlines"),ce()),i&2){let e=s().$implicit;o(),m("innerHTML",C(2,1,e.SONote),Pe)}}function Tl(i,c){if(i&1&&(se(0),n(1,"div")(2,"a",64),p(3),a()(),ce()),i&2){let e=s().$implicit;o(2),m("queryParams",U(2,Cr,e.ReferenceInvoiceID)),o(),v(" Return ",e.ReferenceInvoiceNumber," ")}}function Pl(i,c){if(i&1&&(n(0,"i",78),p(1),a()),i&2){let e=s().$implicit;o(),v(" sold by ",e.Commissions.SalesName," ")}}function Il(i,c){if(i&1&&(n(0,"th",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e==null?null:e.UnitCost)," ")}}function Fl(i,c){if(i&1&&(n(0,"tr",65)(1,"th",30)(2,"div",66)(3,"span",67),p(4),a(),g(5,Pl,2,1,"i",68),F(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,Il,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,l=s(3);o(4),T(e==null?null:e.Name),o(),m("ngIf",(e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName),o(),m("innerHtml",e==null?null:e.Note,Pe),o(2),v(" ",e==null?null:e.Code," "),o(2),v(" ",C(11,11,e==null?null:e.Quantity)," "),o(3),v(" ",e==null?null:e.UOMName," "),o(),m("ngIf",l.roleService.product.Cost),o(2),v(" ",C(17,13,e==null?null:e.UnitPrice)," "),o(4),v(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),v(" ",(e==null?null:e.DiscountAmount)==0?"":C(23,15,e==null?null:e.DiscountAmount)," "),o(3),v(" ",C(26,17,e==null?null:e.Total)," ")}}function bl(i,c){if(i&1&&(se(0),n(1,"tr")(2,"th",80),p(3),a(),n(4,"th",81),p(5),a(),n(6,"th",82),p(7),d(8,"amountFraction"),a()(),ce()),i&2){let e=c.$implicit;o(3),v("",e.Label," :"),o(2),v(" ",e.CurrencySymbol," "),o(2),v(" ",C(8,3,e.Amount)," ")}}function El(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"),F(10,"small",49),d(11,"date"),g(12,xl,3,4,"small",50),a()(),n(13,"div",51)(14,"strong",52),p(15),g(16,hl,3,4,"span",3),a(),g(17,Sl,3,3,"span",50)(18,yl,2,1,"i",53)(19,Dl,2,1,"span",54)(20,vl,2,0,"span",3),a(),g(21,wl,3,3,"ng-container",3)(22,Tl,4,4,"ng-container",3),a(),n(23,"div",55),p(24),a()(),n(25,"table",56)(26,"tbody",57),g(27,Fl,27,19,"tr",58),a()(),n(28,"table",59),g(29,bl,9,5,"ng-container",37),a()()),i&2){let e=c.$implicit,l=s(2);o(4),m("routerLink",b(23,ul))("queryParams",U(24,Cr,e.ID)),o(2),v(" ",e.EntityName+" # "+e.Number,""),o(2),v(" "," - "+y(9,17,e.Date,"dd MMM yyyy")," "),o(2),m("innerHtml","("+y(11,20,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Pe),o(2),m("ngIf",l.isNotEmpty(e.CustomerNameDisplay)),o(3),v(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),m("ngIf",l.isNotEmpty(e.SalesName)),o(),m("ngIf",l.roleService.report.Profit),o(),m("ngIf",l.isNotEmpty(e.DeliveryOutlet)),o(),m("ngIf",l.isNotEmpty(e.PromotionCoupon)),o(),m("ngIf",e.SONote&&e.PromotionCoupon),o(),m("ngIf",l.isNotEmpty(e.SONote)),o(),m("ngIf",l.isNotEmpty(e.ReferenceInvoiceID)),o(2),v(" ",e.PaymentStateLabel," "),o(3),m("ngForOf",e.Items),o(2),m("ngForOf",e.Aggregate)}}function Ml(i,c){if(i&1){let e=I();n(0,"span",83),P("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);o(),T(C(2,1,e.listTotal))}}function Bl(i,c){if(i&1){let e=I();n(0,"div",4)(1,"a",85),P("click",function(){u(e);let t=s(2);return t.currentRowCount=100,_(t.NextPage(!0))}),F(2,"i",86),p(3," Next 100"),a()()}}function Ol(i,c){if(i&1){let e=I();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,Cl,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,El,30,26,"div",37),a()()()()(),n(25,"div",38)(26,"button",39),P("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,Ml,3,0,"span",43)(34,Vl,3,3,"span",3),p(35),a()(),g(36,Bl,4,0,"div",2),a()()()}if(i&2){let e=s();o(14),m("ngIf",e.roleService.product.Cost),o(9),Yt("colspan",e.roleService.product.Cost?8:7),o(),m("ngForOf",e.infiniteList),o(7),v(" Showing 1 - ",C(32,8,e.infiniteList.length)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),m("ngIf",e.nextPageDisabled)}}var wn=class i extends he{constructor(e,l,t,r,f,w,Ee,xt){super(e,l,"Report/ReportDetail","ReportLoader/ReportDetail",null,f);this.csvConverter=t;this.datePipe=r;this.activatedRoute=f;this.matDialog=w;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),l=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(r=>r.Roles?r.Roles.every(f=>f):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(q,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(vn,{data:this.pageData})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(ee),D(Oe),D(j),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(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,gl,2,1,"div",2),a(),n(3,"filters"),g(4,fl,46,26,"ng-template",null,0,M),a(),g(6,Ol,37,10,"content",3),a()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,pe,De,Le,Q,Ye,Ho,gn,ie,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 Tn=class i{constructor(c,e){this._dialogRef=c;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new fi;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(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,l){e&1&&(n(0,"modal-material",0),P("onOk",function(){return l.onOk()})("onCancel",function(){return l._dialogRef.close()})("onClose",function(){return l._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),S("ngModelChange",function(r){return h(l.ExportPageNumber,r)||(l.ExportPageNumber=r),r}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),S("ngModelChange",function(r){return h(l.ExportRowCount,r)||(l.ExportRowCount=r),r}),a()()()()()),e&2&&(m("title","Export Report")("config",l.modalConfig),o(6),x("ngModel",l.ExportPageNumber),o(4),x("ngModel",l.ExportRowCount),m("max",1e4))},dependencies:[ke,B,L,Qe,$t],encapsulation:2})};var Rl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],xr=i=>({ID:i}),kl=()=>["/menu/Contacts/Contact/Customers/Info"],Wl=(i,c,e)=>({"text-success":i,"text-warning":c,"text-danger":e});function Nl(i,c){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",6),p(2," Export "),a()}}function Al(i,c){if(i&1){let e=I();se(0),n(1,"div",19)(2,"div",20)(3,"datepicker",21),S("dateChange",function(t){u(e);let r=s(2);return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(4,"div",22)(5,"app-timepicker",23),S("timeChange",function(t){u(e);let r=s(2);return h(r.timeFrom,t)||(r.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let r=s(2);return _(r.timeFromChange(t))}),a()()(),n(6,"div",24)(7,"div",20)(8,"datepicker",25),S("dateChange",function(t){u(e);let r=s(2);return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(9,"div",22)(10,"app-timepicker",23),S("timeChange",function(t){u(e);let r=s(2);return h(r.timeTo,t)||(r.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let r=s(2);return _(r.timeToChange(t))}),a()()(),ce()}if(i&2){let e=s(2);o(3),x("date",e.pageData.Filter.From),o(2),x("time",e.timeFrom),o(3),x("date",e.pageData.Filter.To),o(2),x("time",e.timeTo)}}function Gl(i,c){if(i&1){let e=I();n(0,"datepicker",26),S("dateChange",function(t){u(e);let r=s(2);return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a(),n(1,"div",27)(2,"datepicker",28),S("dateChange",function(t){u(e);let r=s(2);return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s(2);return _(t.onFilterToDate())}),a()()}if(i&2){let e=s(2);x("date",e.pageData.Filter.From),m("appearance","outline")("width",100),o(2),x("date",e.pageData.Filter.To),m("appearance","outline")("width",100)}}function Hl(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",9),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CustomerID,t)||(r.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",10),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SalesID,t)||(r.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SalesOrderTagID,t)||(r.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",12),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.DefaultFilterColumn,t)||(r.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),g(18,Al,11,4,"ng-container",13)(19,Gl,3,6,"ng-template",null,1,M),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",14),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.RegisterID,t)||(r.pageData.Filter.RegisterID=t),_(t)}),a(),n(24,"h6"),p(25,"Customer Groups"),a(),n(26,"ng-select",15),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CustomerGroupID,t)||(r.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",16),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.PaymentState,t)||(r.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",17),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CreatorID,t)||(r.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",18),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.RowCount,t)||(r.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=Je(20),l=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",l.pageData.Filter.ListIDs),m("outlets",l.pageData.Options==null?null:l.pageData.Options.Entities),o(3),x("ngModel",l.pageData.Filter.CustomerID),m("inputTextValue",l.pageData.CustomerName),o(3),x("ngModel",l.pageData.Filter.SalesID),o(3),x("ngModel",l.pageData.Filter.SalesOrderTagID),m("items",l.pageData.Options.SalesOrderTags),o(3),m("options",l.pageData.Options.DefaultFilterColumnOptions),x("model",l.pageData.Filter.DefaultFilterColumn),o(3),m("ngIf",l.pageData.Filter.isCreated)("ngIfElse",e),o(5),x("ngModel",l.pageData.Filter.RegisterID),m("items",l.pageData.Options.Registers),o(3),x("ngModel",l.pageData.Filter.CustomerGroupID),m("items",l.pageData.Options.Groups),o(3),x("ngModel",l.pageData.Filter.PaymentState),m("items",l.pageData.Options.States),o(3),x("ngModel",l.pageData.Filter.CreatorID),o(3),m("max",1e4),x("ngModel",l.pageData.Filter.RowCount)}}function Ql(i,c){i&1&&(n(0,"th",55),p(1,"DATE"),a())}function Yl(i,c){i&1&&(n(0,"th",56),p(1," CUSTOMER "),a())}function jl(i,c){i&1&&(n(0,"th",57),p(1," SALES PERSON "),a())}function ql(i,c){i&1&&(n(0,"th",58),p(1," COST "),a())}function Ul(i,c){i&1&&(n(0,"th",59),p(1," GROSS "),a())}function Kl(i,c){i&1&&(n(0,"th",60),p(1," SALES "),a())}function zl(i,c){i&1&&(n(0,"th",61),p(1," TAX "),a())}function Xl(i,c){i&1&&(n(0,"th",62),p(1," SURCHARGE "),a())}function Zl(i,c){i&1&&(n(0,"th",63),p(1," TOTAL "),a())}function Jl(i,c){i&1&&(n(0,"th",64),p(1," PAYMENT "),a())}function $l(i,c){i&1&&F(0,"br")}function ep(i,c){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Note)}}function tp(i,c){if(i&1&&(n(0,"td")(1,"div"),p(2),d(3,"date"),a(),n(4,"div"),p(5),d(6,"date"),a()()),i&2){let e=s().$implicit;o(2),v(" ",y(3,2,e.Date,"dd MMM yy")," "),o(3),v(" ",y(6,5,e.Created,"HH:mm")," ")}}function ip(i,c){if(i&1&&(n(0,"td")(1,"a",70),p(2),a()()),i&2){let e=s().$implicit;o(),m("routerLink",b(3,kl))("queryParams",U(4,xr,e.CustomerID)),o(),T(e.CustomerName)}}function np(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.SalesName," ")}}function ap(i,c){if(i&1&&(n(0,"td",71),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Cost)," ")}}function op(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Gross)," ")}}function rp(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function lp(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function pp(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SurchargeAmount)," ")}}function mp(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SalesNSurcharge)," ")}}function sp(i,c){if(i&1&&(n(0,"td",74),p(1),a()),i&2){let e=s().$implicit;m("ngClass",mt(2,Wl,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),v(" ",e.PaymentStateString," ")}}function cp(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",65),p(5),a(),g(6,$l,1,0,"br",4)(7,ep,2,1,"i",4),a(),g(8,tp,7,8,"td",4)(9,ip,3,6,"td",4)(10,np,2,1,"td",4)(11,ap,3,3,"td",66)(12,op,3,3,"td",67)(13,rp,3,3,"td",67)(14,lp,3,3,"td",68)(15,pp,3,3,"td",67)(16,mp,3,3,"td",67)(17,sp,2,6,"td",69),a()),i&2){let e=c.$implicit,l=s(3);o(2),T(e.EntityName),o(2),m("routerLink",b(16,Rl))("queryParams",U(17,xr,e.ID)),o(),v(" ",e.Number," "),o(),m("ngIf",e.Note),o(),m("ngIf",e.Note),o(),m("ngIf",l.column.Date.selected),o(),m("ngIf",l.column.Customer.selected),o(),m("ngIf",l.column.SalesPerson.selected),o(),m("ngIf",l.roleService.product.Cost&&l.column.Cost.selected),o(),m("ngIf",l.column.Gross.selected),o(),m("ngIf",l.column.Sales.selected),o(),m("ngIf",l.data.TaxVisible&&l.column.Tax.selected),o(),m("ngIf",l.data.SurchargeVisible),o(),m("ngIf",l.column.Total.selected),o(),m("ngIf",l.column.Payment.selected)}}function dp(i,c){i&1&&F(0,"td",77)}function up(i,c){i&1&&F(0,"td",77)}function _p(i,c){i&1&&F(0,"td",77)}function gp(i,c){i&1&&(n(0,"td",80),p(1," Total: "),a())}function fp(i,c){if(i&1&&(n(0,"td",71),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Cost"))," ")}}function Cp(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function xp(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Sales"))," ")}}function hp(i,c){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Tax"))," ")}}function Sp(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function yp(i,c){if(i&1&&(n(0,"td",72),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function Dp(i,c){if(i&1&&(n(0,"tfoot",75)(1,"tr",76),F(2,"td",77),g(3,dp,1,0,"td",78)(4,up,1,0,"td",78)(5,_p,1,0,"td",78)(6,gp,2,0,"td",79)(7,fp,4,6,"td",66)(8,Cp,4,6,"td",67)(9,xp,4,6,"td",67)(10,hp,4,6,"td",68)(11,Sp,4,6,"td",67)(12,yp,4,6,"td",67),a()()),i&2){let e=s(3);o(3),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected)}}function vp(i,c){if(i&1){let e=I();n(0,"div",38)(1,"table",39),P("matSortChange",function(t){u(e);let r=s(2);return _(r.sortData(t))}),n(2,"thead",40)(3,"tr")(4,"th",41),p(5,"OUTLET"),a(),n(6,"th",42),p(7,"NUMBER"),a(),g(8,Ql,2,0,"th",43)(9,Yl,2,0,"th",44)(10,jl,2,0,"th",45)(11,ql,2,0,"th",46)(12,Ul,2,0,"th",47)(13,Kl,2,0,"th",48)(14,zl,2,0,"th",49)(15,Xl,2,0,"th",50)(16,Zl,2,0,"th",51)(17,Jl,2,0,"th",52),a()(),n(18,"tbody"),g(19,cp,18,19,"tr",53),a(),g(20,Dp,13,10,"tfoot",54),a()()}if(i&2){let e=s(2);o(8),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected),o(),m("ngIf",e.column.Payment.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data)}}function wp(i,c){if(i&1){let e=I();n(0,"span",81),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",82),p(2,"?"),a()()}}function Tp(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),T(C(2,1,e.listTotal))}}function Pp(i,c){if(i&1){let e=I();n(0,"a",83),P("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),F(1,"i",84),p(2," Next "),a()}}function Ip(i,c){if(i&1){let e=I();n(0,"a",85),P("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),F(1,"i",86),p(2," Show All "),a()}}function Fp(i,c){if(i&1&&(n(0,"content")(1,"div",29),g(2,vp,21,12,"div",30),n(3,"div",31)(4,"div",32)(5,"div",33),p(6),d(7,"number"),g(8,wp,3,0,"span",34)(9,Tp,3,3,"span",4),p(10),a()(),n(11,"div",35),g(12,Pp,3,0,"a",36)(13,Ip,3,0,"a",37),a()()()()),i&2){let e=s();o(2),m("ngIf",e.data),o(4),v(" Showing 1 - ",C(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),m("ngIf",!e.pageData.HideStoreApiCount),o(),m("ngIf",e.pageData.HideStoreApiCount),o(),v(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),m("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),m("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Pn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/ReportSummary","ReportLoader/ReportSummary",null,r);this.httpService=l;this.csvConverter=t;this._matDialog=f}roleService=Ge(G);columnService=Ge(vt);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"),l=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:l,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 l=this.route.snapshot.queryParamMap.get("CustomerID");V.IsNotEmpty(l)&&(this.pageData.Filter.From=V.MinDate,this.pageData.Filter.To=V.MinDate)}afterPostInit(e){this.checkForAdvancedColumn()}openItemModal(e,l){this._matDialog.open(Tn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(r=>{r&&(this.pageData.Filter.ExportPageNumber=r.ExportPageNumber,this.pageData.Filter.ExportRowCount=r.ExportRowCount,this.exportCSV(this.csvConverter,e,l),this.pageData.Filter.RowCount=0)})}sortData(e){let l=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=l;return}this.infiniteList=l.sort((t,r)=>{let f=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,r.CustomerName=r.CustomerName==null?"":r.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,r.SalesName=r.SalesName==null?"":r.SalesName,e.active){case"outlet":return this.compare(t.EntityName.toLocaleLowerCase(),r.EntityName.toLocaleLowerCase(),f);case"number":return this.compare(t.Number,r.Number,f);case"date":return this.compare(t.Date,r.Date,f);case"customer":return this.compare(t.CustomerName.toLocaleLowerCase(),r.CustomerName.toLocaleLowerCase(),f);case"salesPerson":return this.compare(t.SalesName.toLocaleLowerCase(),r.SalesName.toLocaleLowerCase(),f);case"cost":return this.compare(t.Cost,r.Cost,f);case"gross":return this.compare(t.Gross,r.Gross,f);case"sales":return this.compare(t.Sales,r.Sales,f);case"tax":return this.compare(t.Tax,r.Tax,f);case"surcharge":return this.compare(t.SurchargeAmount,r.SurchargeAmount,f);case"total":return this.compare(t.SalesNSurcharge,r.SalesNSurcharge,f);case"payment":return this.compare(t.PaymentStateString,r.PaymentStateString,f);default:return 0}})}openExportModal(){this._matDialog.open(q,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"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(l){return new(l||i)(D(W),D(O),D(H),D(Oe),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[R],decls:7,vars:7,consts:[["pageFilterTemplate",""],["DATEONLY",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["placeholder","Search Customer","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Is Created",3,"modelChange","options","model"],[4,"ngIf","ngIfElse"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Register",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["name","From",3,"dateChange","date","appearance","width"],[1,"mt-4"],["name","To",3,"dateChange","date","appearance","width"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more orders",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","outlet",2,"width","100px"],["mat-sort-header","number"],["mat-sort-header","date",4,"ngIf"],["mat-sort-header","customer",4,"ngIf"],["mat-sort-header","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 orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(r),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Nl,3,0,"button",3),a(),n(3,"filters"),g(4,Hl,36,22,"ng-template",null,0,M),a(),g(6,Fp,14,9,"content",4),a()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,De,Le,Si,Q,Ye,oe,ie,ee,X],encapsulation:2})};var bp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],Ep=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],Mp=()=>["/menu/Products/Setup/Brand/Brand_Form"],Vp=i=>({ID:i}),Bp=(i,c)=>({BrandID:i,Name:c});function Op(i,c){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export"),a()}}function Lp(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Rp(i,c){i&1&&(n(0,"th",24),p(1,"Code"),a())}function kp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Code)}}function Wp(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",25),p(3),a()(),g(4,kp,2,1,"td",26),n(5,"td",27)(6,"a",28),p(7),d(8,"quantityFraction"),a()(),n(9,"td",27),p(10),d(11,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),m("routerLink",b(11,Mp))("queryParams",U(12,Vp,e.ID)),o(),v("",e.BrandName," "),o(),m("ngIf",e.Countcode>0),o(2),m("queryParams",de(14,Bp,e.ID,e.BrandName)),o(),T(C(8,7,e.Quantity)),o(3),T(C(11,9,e.Total))}}function Np(i,c){if(i&1){let e=I();n(0,"div",15)(1,"table",16),P("matSortChange",function(t){u(e);let r=s();return _(r.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"Brand"),a(),g(6,Rp,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,Wp,12,17,"tr",22),a(),n(13,"tfoot")(14,"tr",23)(15,"td"),p(16,"Total"),a(),n(17,"td"),p(18),d(19,"sum"),d(20,"quantityFraction"),a(),n(21,"td"),p(22),d(23,"sum"),d(24,"amountFraction"),a()()()()()}if(i&2){let e=s();o(6),m("ngIf",e.data.Countcode>0),o(6),m("ngForOf",e.data.Data),o(6),T(C(20,7,y(19,4,e.data.Data,"Quantity"))),o(4),T(C(24,12,y(23,9,e.data.Data,"Total")))}}var In=class i extends he{constructor(e,l,t,r,f,w){super(e,l,"Report/BrandRank","ReportLoader/BrandRank",null,r);this.httpService=l;this.csvConverter=t;this.roleService=f;this.matDialog=w}sortData(e){let l=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=l;return}this.data.Data=l.sort((t,r)=>{let f=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,r.BrandName,f);case"Code":return this.compare(t.Code,r.Code,f);case"Quantity":return this.compare(t.Quantity,r.Quantity,f);case"Total":return this.compare(t.Total,r.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(Oe),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[R],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["style","width: 120px;","mat-sort-header","Code","arrowPosition","before","class","align-left",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"footer","text-end","fw-bold"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],[3,"routerLink","queryParams"],[4,"ngIf"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Op,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,Lp,9,6,"ng-template",null,0,M),a(),n(16,"content"),g(17,Np,25,14,"div",7),a()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(8,bp)),o(3),m("routerLink",b(9,Ep)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,pe,ae,ge,Q,oe,X,Z],encapsulation:2})};function Ap(i,c){if(i&1){let e=I();n(0,"label",3),P("click",function(){let t=u(e).$implicit,r=s();return _(r.updateSelectedGroups(t.ID))}),F(1,"input",4),n(2,"span"),p(3),a()()}if(i&2){let e=c.$implicit,l=s();o(),m("value",e.ID)("checked",l.IDGroups.indexOf(e.ID)>-1),o(2),T(e.Name)}}var Fn=class i{constructor(c,e){this.dialogRef=c;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(l=>{this.IDGroups.push(l.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,l){e&1&&(n(0,"modal-material",0),P("onOk",function(){return l.onOk()})("onCancel",function(){return l.dialogRef.close()}),n(1,"content")(2,"div",1),g(3,Ap,4,3,"label",2),a()()()),e&2&&(m("title","Edit Groups"),o(3),m("ngForOf",l.options))},dependencies:[Y,$t],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var Gp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Hp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Qp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Yp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],jp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],qp=()=>["/menu/Contacts/Contact/Customers/Info"],Up=i=>({ID:i});function Kp(i,c){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function zp(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.GroupID,t)||(r.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.RowCount,t)||(r.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function Xp(i,c){i&1&&(n(0,"th",31),p(1," ORDERS "),a())}function Zp(i,c){i&1&&(n(0,"th",32),p(1," QTY "),a())}function Jp(i,c){i&1&&(se(0),n(1,"th",33),p(2," COST "),a(),ce())}function $p(i,c){i&1&&(n(0,"th",34),p(1," SALES "),a())}function em(i,c){i&1&&(n(0,"th",35),p(1," TAX "),a())}function tm(i,c){i&1&&(n(0,"th",36),p(1," SALES + TAX "),a())}function im(i,c){if(i&1){let e=I();n(0,"span")(1,"span"),p(2),a(),n(3,"a",45),P("click",function(){u(e);let t=s(2).$implicit,r=s(3);return _(r.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=c.$implicit,l=c.index;o(2),T(l==0?"":" , "),o(2),T(e.GroupName)}}function nm(i,c){if(i&1&&(n(0,"span"),g(1,im,5,2,"span",38),a()),i&2){let e=s().$implicit;o(),m("ngForOf",e.Groups)}}function am(i,c){if(i&1){let e=I();n(0,"a",45),P("click",function(){u(e);let t=s().$implicit,r=s(3);return _(r.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function om(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Orders)," ")}}function rm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Quantity)," ")}}function lm(i,c){if(i&1&&(se(0),n(1,"td",47),p(2),d(3,"amountFraction"),a(),ce()),i&2){let e=s().$implicit;o(2),v(" ",C(3,1,e.Cost)," ")}}function pm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function mm(i,c){if(i&1&&(n(0,"td",48),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function sm(i,c){if(i&1&&(n(0,"td",46),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales+e.Tax)," ")}}function cm(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",39),p(3),a(),n(4,"div",40),g(5,nm,2,1,"span",25)(6,am,2,0,"a",41),a()(),n(7,"td")(8,"span",42),p(9),a()(),g(10,om,3,3,"td",43)(11,rm,3,3,"td",43)(12,lm,4,3,"ng-container",25)(13,pm,3,3,"td",43)(14,mm,3,3,"td",44)(15,sm,3,3,"td",43),a()),i&2){let e=c.$implicit,l=s(3);o(2),m("routerLink",b(13,qp))("queryParams",U(14,Up,e.CustomerID)),o(),v(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),m("ngIf",e.Groups.length>0),o(),m("ngIf",!(e.Groups.length>0)),o(2),m("matTooltip",l.maskingFields!=null&&l.maskingFields.Code&&!l.roleService.global.SensitiveField?l.maskingFieldMsg:""),o(),v("",e.Code," "),o(),m("ngIf",l.column.Orders.selected),o(),m("ngIf",l.column.QTY.selected),o(),m("ngIf",l.roleService.product.Cost&&l.column.Cost.selected),o(),m("ngIf",l.column.Sales.selected),o(),m("ngIf",l.column.Tax.selected),o(),m("ngIf",l.column.SalesNTax.selected)}}function dm(i,c){if(i&1&&(n(0,"tbody",37),g(1,cm,16,16,"tr",38),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function um(i,c){if(i&1){let e=I();n(0,"div",17)(1,"div",18)(2,"table",19),P("matSortChange",function(t){u(e);let r=s();return _(r.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,Xp,2,0,"th",23)(10,Zp,2,0,"th",24)(11,Jp,3,0,"ng-container",25)(12,$p,2,0,"th",26)(13,em,2,0,"th",27)(14,tm,2,0,"th",28),a()(),g(15,dm,2,1,"tbody",29),a()(),n(16,"infinite-pagination",30),P("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=s();o(9),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.column.Tax.selected),o(),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.data.Data),o(),m("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var bn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=l;this.csvConverter=t;this.datePipe=r;this.matDialog=f}roleService=Ge(G);columnService=Ge(vt);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=Cn.maskingField;postInit(e){this.maskingFields=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 l=this.originalData;if(!e.active||e.direction===""){this.data.Data=l;return}this.data.Data=l.sort((t,r)=>{let f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,r.Name,f);case"Code":return this.compare(t.Code,r.Code,f);case"Orders":return this.compare(t.Orders,r.Orders,f);case"Quantity":return this.compare(t.Quantity,r.Quantity,f);case"Sales":return this.compare(t.Sales,r.Sales,f);case"Tax":return this.compare(t.Tax,r.Tax,f);case"SalesNTax":return this.compare(t.Sales+t.Tax,r.Sales+r.Tax,f);case"Cost":return this.compare(t.Cost,r.Cost,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,l){this.matDialog.open(Fn,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(r=>{if(r){let f={ContactID:l,GroupIDs:r.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",f).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(q,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(ee),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[R],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["style","width: 75px","mat-sort-header","Orders","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 75px","mat-sort-header","Quantity","arrowPosition","before","class","flex-left",4,"ngIf"],[4,"ngIf"],["style","width: 135px","mat-sort-header","Sales","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 135px","mat-sort-header","Tax","arrowPosition","before","class","flex-left",4,"ngIf"],["style","width: 135px","mat-sort-header","SalesNTax","arrowPosition","before","class","flex-left",4,"ngIf"],["class","border-bottom",4,"ngIf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"pointer"],["class","text-primary",3,"click",4,"ngIf"],["matTooltipPosition","above",3,"matTooltip"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],[1,"text-primary",3,"click"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(r),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Kp,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),F(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,zp,16,10,"ng-template",null,0,M),a(),n(26,"content"),g(27,um,17,13,"div",7),a()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(12,Gp)),o(3),m("routerLink",b(13,Hp)),o(3),m("routerLink",b(14,Qp)),o(3),m("routerLink",b(15,Yp)),o(4),m("routerLink",b(16,jp)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,Q,ti,ie,X,Z],encapsulation:2})};var _m=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],gm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],fm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Cm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],xm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function hm(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function Sm(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.GroupID,t)||(r.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function ym(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",26),p(4),d(5,"number"),a(),n(6,"td",26),p(7),d(8,"amountFraction"),a(),n(9,"td",27),p(10),d(11,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),v(" ",e.Name," "),o(2),T(C(5,4,e.TotalOrders)),o(3),T(C(8,6,e.TotalCost)),o(3),T(C(11,8,e.TotalAmount))}}function Dm(i,c){if(i&1&&(n(0,"tbody",24),g(1,ym,12,10,"tr",25),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function vm(i,c){if(i&1){let e=I();n(0,"div",16)(1,"table",17),P("matSortChange",function(t){u(e);let r=s();return _(r.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,Dm,2,1,"tbody",23),a()()}if(i&2){let e=s();o(12),m("ngIf",e.data.Data)}}var En=class i extends he{constructor(e,l,t,r,f,w){super(e,l,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f;this.datePipe=w}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 l=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=l;return}this.data.Data=l.sort((t,r)=>{let f=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,r.Name,f);case"Orders":return this.compare(t.TotalOrders,r.TotalOrders,f);case"Quantity":return this.compare(t.TotalCost,r.TotalCost,f);case"Total":return this.compare(t.TotalAmount,r.TotalAmount,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(q,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j),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(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,hm,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,Sm,13,8,"ng-template",null,0,M),a(),n(25,"content"),g(26,vm,13,1,"div",7),a()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(11,_m)),o(3),m("routerLink",b(12,gm)),o(3),m("routerLink",b(13,fm)),o(3),m("routerLink",b(14,Cm)),o(3),m("routerLink",b(15,xm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,Q,ie,X],encapsulation:2})};var wm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Tm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Pm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Im=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Fm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function bm(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function Em(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.GroupID,t)||(r.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Mm(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 Bm(i,c){i&1&&(n(0,"th",27),p(1," AMOUNT"),a())}function Om(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.TotalOrders))}}function Lm(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"quantityFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.TotalQuantity)," ")}}function Rm(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.TotalAmount))}}function km(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),g(3,Om,3,3,"td",28)(4,Lm,3,3,"td",28)(5,Rm,3,3,"td",29),a()),i&2){let e=c.$implicit,l=s(2);o(2),v(" ",e.Name," "),o(),m("ngIf",l.column.Orders.selected),o(),m("ngIf",l.column.QTY.selected),o(),m("ngIf",l.column.Amount.selected)}}function Wm(i,c){if(i&1){let e=I();n(0,"div",16)(1,"table",17),P("matSortChange",function(t){u(e);let r=s();return _(r.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"GENDER"),a(),g(6,Mm,2,0,"th",20)(7,Vm,2,0,"th",21)(8,Bm,2,0,"th",22),a()(),n(9,"tbody",23),g(10,km,6,4,"tr",24),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Amount.selected),o(2),m("ngForOf",e.data==null?null:e.data.Data)}}var Mn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=l;this.csvConverter=t;this.matDialog=r;this.datePipe=f}roleService=Ge(G);columnService=Ge(vt);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 l=this.data.slice();if(!e.active||e.direction===""){this.data=l;return}this.data=l.sort((t,r)=>{let f=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,r.Name,f);case"Orders":return this.compare(t.TotalOrders,r.TotalOrders,f);case"Quantity":return this.compare(t.TotalQuantity,r.TotalQuantity,f);case"Total":return this.compare(t.TotalAmount,r.TotalAmount,f);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(l){return new(l||i)(D(W),D(O),D(H),D(j),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(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(r),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,bm,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,Em,13,8,"ng-template",null,0,M),a(),n(25,"content"),g(26,Wm,11,4,"div",7),a()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,wm)),o(3),m("routerLink",b(13,Tm)),o(3),m("routerLink",b(14,Pm)),o(3),m("routerLink",b(15,Im)),o(3),m("routerLink",b(16,Fm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,Q,ie,X,Z],encapsulation:2})};var Sr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Nm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Am=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Gm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Hm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Qm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Ym=()=>["/menu/Contacts/Contact/Suppliers/Info"],jm=i=>({ID:i}),qm=(i,c,e)=>({From:i,SupplierID:c,To:e});function Um(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function Km(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.GroupID,t)||(r.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.RowCount,t)||(r.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function zm(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,l=s(2);o(2),T(e.Rank),o(2),m("routerLink",b(19,Ym))("queryParams",U(20,jm,e.SupplierID)),o(),T(e.Name),o(2),T(e.Code),o(2),v(" ",C(10,9,e.Quantity)," "),o(3),m("routerLink",b(22,Sr))("queryParams",mt(23,qm,y(13,11,l.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,y(14,14,l.pageData.Filter.To,"yyyy-MM-dd"))),o(3),v(" ",C(16,17,e.Total),"")}}function Xm(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",31),F(2,"th",32),n(3,"th",29),p(4,"Total Quantity"),a(),n(5,"th",29),p(6,"Total Sales"),a()(),n(7,"tr"),F(8,"td",33),n(9,"td",29),p(10),a(),n(11,"td",29),p(12),a()()()),i&2){let e=s(2);o(10),T(e.data.TotalQty),o(2),T(e.data.TotalSales)}}function Zm(i,c){if(i&1){let e=I();n(0,"div",17)(1,"table",18),P("matSortChange",function(t){u(e);let r=s();return _(r.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,zm,17,27,"tr",25),a(),g(16,Xm,13,2,"tfoot"),a()()}if(i&2){let e=s();o(15),m("ngForOf",e.data.Data),o(),Hi((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?16:-1)}}var Vn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f}sortData(e){let l=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=l;return}this.data.Data=l.sort((t,r)=>{let f=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,r.Rank,f);case"Supplier":return this.compare(t.Name,r.Name,f);case"Code":return this.compare(t.Code,r.Code,f);case"Quantity":return this.compare(t.Quantity,r.Quantity,f);case"Total":return this.compare(t.Total,r.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[R],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Um,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,Km,16,10,"ng-template",null,0,M),a(),n(28,"content"),g(29,Zm,17,2,"div",7),a()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Sr)),o(3),m("routerLink",b(13,Nm)),o(3),m("routerLink",b(14,Am)),o(3),m("routerLink",b(15,Gm)),o(3),m("routerLink",b(16,Hm)),o(3),m("routerLink",b(17,Qm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,ae,ge,Qe,Q,ee,X,Z],encapsulation:2})};var yr=Ht(Bi());var $m=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],es=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],ts=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],is=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ns=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],as=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],os=(i,c,e,l,t)=>({From:i,To:c,ListIDs:e,ListVariantID:l,GroupByVariant:t}),rs=i=>[i],ls=i=>({ID:i}),ps=(i,c,e,l,t,r)=>({ID:i,From:c,To:e,ListIDs:l,ListVariantID:t,GroupByVariant:r}),Dr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],ms=(i,c,e)=>({VariantID:i,From:c,To:e}),ss=(i,c,e)=>({ProductID:i,From:c,To:e});function cs(i,c){if(i&1&&(n(0,"a",9),F(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,l=s();m("queryParams",qi(1,os,(e=l.queryParams())==null?null:e.From,(e=l.queryParams())==null?null:e.To,(e=l.queryParams())==null?null:e.ListIDs,(e=l.queryParams())==null?null:e.ListVariantID,(e=l.queryParams())==null?null:e.GroupByVariant))}}function ds(i,c){if(i&1){let e=I();n(0,"button",11),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",12),p(2," Export "),a()}}function us(i,c){if(i&1){let e=I();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),S("selectedCategoryIDChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CategoryID,t)||(r.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.BrandIDs,t)||(r.pageData.Filter.BrandIDs=t),_(t)}),a(),n(15,"h6"),p(16,"Product Tag"),a(),n(17,"ng-select",20),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.TagID,t)||(r.pageData.Filter.TagID=t),_(t)}),a(),n(18,"h6"),p(19,"Sales Person"),a(),n(20,"sales-person-selector",21),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SalesID,t)||(r.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.GroupByVariant,t)||(r.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.TypeID,t)||(r.pageData.Filter.TypeID=t),_(t)}),a(),n(27,"h6"),p(28,"Logistics Service"),a(),n(29,"ng-select",24),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.LogisticsServiceID,t)||(r.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SupplierID,t)||(r.pageData.Filter.SupplierID=t),_(t)}),a(),n(33,"h6"),p(34,"Customer Group"),a(),n(35,"ng-select",26),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ContactGroupID,t)||(r.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CustomerID,t)||(r.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Product Type"),a(),n(41,"radio-options",28),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ProductType,t)||(r.pageData.Filter.ProductType=t),_(t)}),a(),n(42,"h6"),p(43,"Multiply Unit Quantity"),a(),n(44,"radio-options",29),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.NeedMultiplyUnitQuantity,t)||(r.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),x("date",e.pageData.Filter.From),m("showClearBtn",!0)("showTodayBtn",!0),o(2),x("date",e.pageData.Filter.To),m("showClearBtn",!0)("showTodayBtn",!0),o(3),m("multiple",!0)("multiple",!0),x("ngModel",e.pageData.Filter.BrandIDs),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Tags),x("ngModel",e.pageData.Filter.TagID),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),x("ngModel",e.pageData.Filter.LogisticsServiceID),m("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),x("ngModel",e.pageData.Filter.SupplierID),m("inputTextValue",e.pageData.supplierName),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("model",e.pageData.Filter.ProductType),m("options",e.pageData.Options.ProductTypes),o(3),x("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function _s(i,c){if(i&1){let e=I();n(0,"th",48)(1,"div",49)(2,"input",50),P("change",function(t){u(e);let r=s(2);return _(r.checkAllCheckBox(t))}),a()()()}if(i&2){let e=s(2);o(2),m("checked",e.isAllCheckBoxChecked())}}function gs(i,c){if(i&1&&(n(0,"th",51),p(1," Qty "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Quantity.start)}}function fs(i,c){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function Cs(i,c){i&1&&(n(0,"th",53),p(1," Cost "),a())}function xs(i,c){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function hs(i,c){if(i&1&&(n(0,"th",55),p(1," Sales "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Sales.start)}}function Ss(i,c){i&1&&(n(0,"th",56),p(1," Tax "),a())}function ys(i,c){if(i&1&&(n(0,"th",57),p(1," Sales + Tax "),a()),i&2){let e=s(2);m("start",e.currentServerSortState.Sales.start)}}function Ds(i,c){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function vs(i,c){i&1&&(n(0,"th",59),p(1," % "),a())}function ws(i,c){if(i&1){let e=I();n(0,"td")(1,"div",49)(2,"input",71),S("ngModelChange",function(t){u(e);let r=s().$implicit;return h(r.checked,t)||(r.checked=t),_(t)}),P("ngModelChange",function(){u(e);let t=s(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=s().$implicit;o(2),m("value",e.ID),x("ngModel",e.checked)}}function Ts(i,c){if(i&1){let e=I();se(0),n(1,"img",72),P("click",function(t){u(e);let r=s().$implicit,f=s(2);return _(f.openBigPicture(r==null?null:r.ImageURL,t))}),a(),ce()}if(i&2){let e=s().$implicit;o(),m("src",e.ThumbnailUrl,Gi)}}function Ps(i,c){if(i&1){let e=I();n(0,"a",73)(1,"img",74),P("click",function(t){u(e);let r=s().$implicit,f=s(2);return _(f.openBigPicture(r,t))}),a()()}if(i&2){let e=s(3);m("target",e.pageData.LinkTarget)}}function Is(i,c){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,l=s().$implicit,t=s(2);o(),m("queryParams",Co(4,ps,l.ID,(e=t.queryParams())==null?null:e.From,(e=t.queryParams())==null?null:e.To,(e=t.queryParams())==null?null:e.ListIDs,(e=t.queryParams())==null?null:e.ListVariantID,(e=t.queryParams())==null?null:e.GroupByVariant)),o(),T(C(3,2,l.Quantity))}}function Fs(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.OnHand)," ")}}function bs(i,c){if(i&1&&(n(0,"td",77),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.UnitCost)," ")}}function Es(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Gross)," ")}}function Ms(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,l=s(2);m("routerLink",b(11,Dr))("queryParams",mt(12,ms,e.ID,y(1,3,l.pageData.Filter.From,"ddMMyyyy"),y(2,6,l.pageData.Filter.To,"ddMMyyyy"))),o(3),T(C(4,9,e.Sales))}}function Vs(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,l=s(2);m("routerLink",b(11,Dr))("queryParams",mt(12,ss,e.ID,y(1,3,l.pageData.Filter.From,"ddMMyyyy"),y(2,6,l.pageData.Filter.To,"ddMMyyyy"))),o(3),T(C(4,9,e.Sales))}}function Bs(i,c){if(i&1&&(n(0,"td",75),g(1,Ms,5,16,"a",78)(2,Vs,5,16,"a",78),a()),i&2){let e=s(3);o(),m("ngIf",e.pageData.Filter.GroupByVariant),o(),m("ngIf",!e.pageData.Filter.GroupByVariant)}}function Os(i,c){if(i&1&&(n(0,"td",79),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Tax)," ")}}function Ls(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SalesNTax)," ")}}function Rs(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.Profit)," ")}}function ks(i,c){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;m("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),v(" ",C(2,2,e.Margin)," ")}}function Ws(i,c){if(i&1&&(n(0,"tr",60),g(1,ws,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),g(7,Ts,2,1,"ng-container",8)(8,Ps,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),g(14,Is,4,11,"td",67)(15,Fs,3,3,"td",67)(16,bs,3,3,"td",68)(17,Es,3,3,"td",67)(18,Bs,3,2,"td",67)(19,Os,3,3,"td",69)(20,Ls,3,3,"td",67)(21,Rs,3,4,"td",70)(22,ks,3,4,"td",70),a()),i&2){let e=c.$implicit,l=c.index,t=s(2);o(),m("ngIf",t.column.CompareQtySold.selected),o(2),T(l+1),o(4),m("ngIf",e.ImageURL),o(),m("ngIf",!e.ImageURL),o(2),m("routerLink",U(17,rs,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(19,ls,e.ID)),o(),T(e.Name),o(2),T(e.Code),o(),m("ngIf",t.column.QTY.selected),o(),m("ngIf",t.column.OnHand.selected),o(),m("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function Ns(i,c){i&1&&F(0,"td",75)}function As(i,c){i&1&&(n(0,"td",75),p(1," Total : "),a())}function Gs(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Quantity"))," ")}}function Hs(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"OnHand"))," ")}}function Qs(i,c){if(i&1&&(n(0,"td",77),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"UnitCost"))," ")}}function Ys(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function js(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),T(C(4,4,y(3,1,e.infiniteList,"Sales")))}}function qs(i,c){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),T(C(4,4,y(3,1,e.infiniteList,"Tax")))}}function Us(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),T(C(4,4,y(3,1,e.infiniteList,"SalesNTax")))}}function Ks(i,c){if(i&1&&(n(0,"td",80),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",y(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),v(" ",C(4,8,y(3,5,e.infiniteList,"Profit"))," ")}}function zs(i,c){if(i&1&&(n(0,"td",80),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=s(3);m("ngClass",y(1,2,e.infiniteList,"Profit")/y(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),v(" ",C(6,14,y(4,8,e.infiniteList,"Profit")/y(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function Xs(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",81),F(2,"td",75),g(3,Ns,1,0,"td",67)(4,As,2,0,"td",67)(5,Gs,4,6,"td",67)(6,Hs,4,6,"td",67)(7,Qs,4,6,"td",68)(8,Ys,4,6,"td",67)(9,js,5,6,"td",82)(10,qs,5,6,"td",69)(11,Us,5,6,"td",82)(12,Ks,5,10,"td",70)(13,zs,7,16,"td",70),a()()),i&2){let e=s(2);o(3),m("ngIf",e.column.CompareQtySold.selected),o(),m("ngIf",e.column.CompareQtySold.selected||e.column.QTY.selected||e.column.OnHand.selected||e.column.Cost.selected||e.column.Gross.selected||e.column.Sales.selected||e.column.SalesNTax.selected||e.column.Tax.selected||e.column.Profit.selected&&e.column.Profit.role||e.column.Margin.selected&&e.column.Profit.role),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.OnHand.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),m("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function Zs(i,c){if(i&1){let e=I();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),P("matSortChange",function(t){u(e);let r=s();return _(r.sortData(t))}),n(4,"thead",33)(5,"tr"),g(6,_s,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),g(11,gs,2,1,"th",37)(12,fs,2,0,"th",38)(13,Cs,2,0,"th",39)(14,xs,2,0,"th",40)(15,hs,2,1,"th",41)(16,Ss,2,0,"th",42)(17,ys,2,1,"th",43)(18,Ds,2,0,"th",44)(19,vs,2,0,"th",45),a()(),n(20,"tbody"),g(21,Ws,23,21,"tr",46),a(),g(22,Xs,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),P("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.CompareQtySold.selected),o(5),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.OnHand.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data),o(),m("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Bn=class i extends he{constructor(e,l,t,r,f,w,Ee){super(e,l,"Report/ProductSales","ReportLoader/ProductSales",null,f);this.httpService=l;this.csvConverter=t;this.toasterService=r;this.activatedRoute=f;this.matDialog=w;this.bigPicture=Ee}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Ge(G);columnService=Ge(vt);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!0,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=ct([]);queryParams=ct(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=et(Ze({},this.data),{Data:e.Data.map(t=>et(Ze({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=et(Ze({},this.currentServerSortState[t]),{start:"desc"});let l=e.Sort.column;this.currentServerSortState[l]=et(Ze({},this.currentServerSortState[l]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let l=e.target;this.infiniteList=[...this.infiniteList.map(t=>et(Ze({},t),{checked:l.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(l=>l.checked).map(l=>l.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;V.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,l){this.bigPicture.openBiggerPicture(l,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let r={VariantID:t.ID,MinStock:t.NewMinStock};e.push(r)}}),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 l={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",l).subscribe(t=>{this.toasterService.success(t,Vi.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=et(Ze({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let l=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=l;return}this.infiniteList=l.sort((t,r)=>{let f=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,r.Code=r.Code==null?"":r.Code,t.BrandName=t.BrandName==null?"":t.BrandName,r.BrandName=r.BrandName==null?"":r.BrandName,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),r.Name.toLocaleLowerCase(),f);case"Code":return V.compare(t.Code.toLocaleLowerCase(),r.Code.toLocaleLowerCase(),f);case"Brand":return V.compare(t.BrandName.toLocaleLowerCase(),r.BrandName.toLocaleLowerCase(),f);case"Quantity":return V.compare(t.Quantity,r.Quantity,f);case"Total_Cost":return V.compare(t.UnitCost,r.UnitCost,f);case"Inventory":return V.compare(t.OnHand,r.OnHand,f);case"Total_Sales":return V.compare(t.Total,r.Total,f);case"Total_Tax":return V.compare(t.Tax,r.Tax,f);case"Total_Tax_Sales":return V.compare(t.SalesNTax,r.SalesNTax,f);case"ReOrder":return V.compare(t.MinStock,r.MinStock,f);case"Gross":return V.compare(t.Gross,r.Gross,f);case"Margin":return V.compare(t.Margin,r.Margin,f);case"Profit":return V.compare(t.Profit,r.Profit,f);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,yr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(Ke),D(Oe),D(j),D(yn))};static \u0275cmp=E({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[R],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-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"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(r),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),P("onChangeColumnCheckbox",function(){return u(r),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,cs,3,7,"a",2)(3,ds,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10," Compare by Outlet "),a()(),n(11,"li")(12,"a",7),p(13," Compare by Month "),a()(),n(14,"li")(15,"a",7),p(16," Compare with Transfer Order "),a()(),n(17,"li")(18,"a",7),p(19," Product Tags Analysis "),a()(),n(20,"li")(21,"a",7),p(22," Top Suppliers "),a()(),n(23,"li")(24,"a",7),p(25," Quantity Sold Chart "),a()()()()(),n(26,"filters"),g(27,us,45,36,"ng-template",null,0,M),a(),g(29,Zs,24,18,"content",8),a()}l&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.isAnyItemChecked),o(),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,$m)),o(3),m("routerLink",b(15,es)),o(3),m("routerLink",b(16,ts)),o(3),m("routerLink",b(17,is)),o(3),m("routerLink",b(18,ns)),o(3),m("routerLink",b(19,as)),o(5),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,wo,B,L,pe,ae,ge,De,Le,fe,Q,Ye,ti,oe,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 Js=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],$s=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],e0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],t0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],i0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],n0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],a0=i=>({ID:i});function o0(i,c){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",16),p(2," Export "),a()}}function r0(i,c){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales"),a(),n(6,"sales-person-selector",19),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SalesID,t)||(r.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Category"),a(),n(9,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CategoryID,t)||(r.pageData.Filter.CategoryID=t),_(t)}),a(),n(10,"h6"),p(11,"Brand"),a(),n(12,"ng-select",21),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.BrandID,t)||(r.pageData.Filter.BrandID=t),_(t)}),a(),n(13,"h6"),p(14,"Supplier"),a(),n(15,"autocompleteV2",22),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SupplierID,t)||(r.pageData.Filter.SupplierID=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",23),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(20,"div",24)(21,"datepicker",25),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(22,"h6"),p(23,"Scope"),a(),n(24,"radio-options",26),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.Product,t)||(r.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function l0(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e,l=c.$implicit;dt("matTooltip",l.Name),o(),v(" ",(e=l.Code)!==null&&e!==void 0?e:l.Name," ")}}function p0(i,c){if(i&1&&(n(0,"td",13),p(1),a()),i&2){let e=c.$implicit;o(),v(" ",e," ")}}function m0(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,p0,2,1,"td",31),n(7,"td",13),p(8),a()()),i&2){let e=c.$implicit,l=s();o(2),m("routerLink",l.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",U(6,a0,e.ID)),o(),v(" ",e.Name,""),o(2),T(e.Code),o(),m("ngForOf",e.Quantities),o(2),T(e.Total)}}var On=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=l;this.csvConverter=t;this.matDialog=r;this.roleService=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(j),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(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(r),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,o0,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,r0,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,l0,2,2,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,m0,9,8,"tr",14),a()()()()()}l&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(13,Js)),o(3),m("routerLink",b(14,$s)),o(3),m("routerLink",b(15,e0)),o(3),m("routerLink",b(16,t0)),o(3),m("routerLink",b(17,i0)),o(3),m("routerLink",b(18,n0)),o(14),m("ngForOf",t.data==null?null:t.data.Outlet),o(4),m("ngForOf",t.data==null?null:t.data.Data))},dependencies:[N,Y,k,A,z,K,B,L,pe,De,Le,fe,Q,Ye],encapsulation:2})};var s0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],c0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],d0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],u0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],_0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],g0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],f0=i=>[i],C0=i=>({ID:i});function x0(i,c){if(i&1){let e=I();n(0,"a",16),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",17),p(2," Export"),a()}}function h0(i,c){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CategoryID,t)||(r.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Compare Month From"),a(),n(9,"ng-select",21),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.MonthFrom,t)||(r.pageData.Filter.MonthFrom=t),_(t)}),a(),n(10,"h6"),p(11,"Compare Month To"),a(),n(12,"ng-select",22),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.MonthTo,t)||(r.pageData.Filter.MonthTo=t),_(t)}),a(),n(13,"h6"),p(14,"Year"),a(),n(15,"ng-select",23),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.Year,t)||(r.pageData.Filter.Year=t),_(t)}),a(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",24),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.GroupByVariant,t)||(r.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.MonthFrom),m("items",e.months),o(3),x("ngModel",e.pageData.Filter.MonthTo),m("items",e.months),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.years),o(3),x("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter)}}function S0(i,c){if(i&1&&(n(0,"th",25),p(1),a()),i&2){let e=c.$implicit,l=s();o(),v(" ",l.months[e.Month-1].ColumnLabel," ")}}function y0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,l=s().$implicit,t=s();o(),v(" ",t.findKey(l.Sold,e.Month)?y(2,1,t.findKey(l.Sold,e.Month),t.pageData.FractionDigit):""," ")}}function D0(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,y0,3,4,"td",28),n(7,"td",29),p(8),d(9,"sum"),d(10,"number"),a()()),i&2){let e=c.$implicit,l=s();o(2),m("routerLink",U(12,f0,l.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(14,C0,e.ID)),o(),v(" ",e.Name," "),o(2),T(e.Code),o(),m("ngForOf",l.data==null?null:l.data.MonthlySales),o(2),v(" ",y(10,9,y(9,6,e.Sold,"Value"),l.pageData.FractionDigit)," ")}}function v0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,l=s(2);o(),v(" ",y(2,1,e.Sold,l.pageData.FractionDigit)," ")}}function w0(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",30),F(2,"td")(3,"td"),g(4,v0,3,4,"td",28),n(5,"td",29),p(6),d(7,"sum"),d(8,"number"),a()()()),i&2){let e=s();o(4),m("ngForOf",e.data==null?null:e.data.MonthlySales),o(2),v(" ",y(8,5,y(7,2,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}var Ln=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",null,null,!0);this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f}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,l){let t=null;return e.forEach(r=>{r.Key==l&&(t=r.Value)}),t}sortData(e){let l=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=l;return}this.data.Data=l.sort((t,r)=>{let f=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,r.Code=r.Code==null?"":r.Code,t.Name=t.Name==null?"":t.Name,r.Name=r.Name==null?"":r.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),r.Name.toLocaleLowerCase(),f);case"Code":return this.compare(t.Code.toLocaleLowerCase(),r.Code.toLocaleLowerCase(),f);default:return 0}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j))};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(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,x0,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,h0,19,14,"ng-template",null,0,M),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(w){return u(r),_(t.sortData(w))}),n(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),n(35,"th",11),p(36,"Code"),a(),g(37,S0,2,1,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,D0,11,16,"tr",14),a(),g(42,w0,9,8,"tfoot",15),a()()()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(14,s0)),o(3),m("routerLink",b(15,c0)),o(3),m("routerLink",b(16,d0)),o(3),m("routerLink",b(17,u0)),o(3),m("routerLink",b(18,_0)),o(3),m("routerLink",b(19,g0)),o(14),m("ngForOf",t.data==null?null:t.data.MonthlySales),o(4),m("ngForOf",t.data==null?null:t.data.Data),o(),m("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[N,Y,k,A,z,B,L,ae,ge,De,fe,Q,oe,ie],encapsulation:2})};var T0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],P0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],I0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],F0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],b0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],E0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],M0=i=>[i],V0=i=>({ID:i});function B0(i,c){if(i&1){let e=I();n(0,"button",16),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",17),p(2," Export"),a()}}function O0(i,c){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CategoryID,t)||(r.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",21),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",22)(12,"datepicker",23),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",24),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.Product,t)||(r.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function L0(i,c){if(i&1&&(n(0,"th",26),p(1),a()),i&2){let e=c.$implicit;o(),T(e)}}function R0(i,c){if(i&1&&(n(0,"tr"),F(1,"th")(2,"th"),g(3,L0,2,1,"th",25),a()),i&2){let e=s();o(3),m("ngForOf",e.data==null?null:e.data.Outlet)}}function k0(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e=c.$implicit;o(),v(" ",e,"")}}function W0(i,c){if(i&1&&(se(0),n(1,"a",29),p(2),a(),ce()),i&2){let e=s().$implicit,l=s().$implicit,t=s();o(),m("routerLink",U(3,M0,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",U(5,V0,l[1])),o(),T(l[e])}}function N0(i,c){if(i&1&&p(0),i&2){let e=s().$implicit,l=s().$implicit;v(" ",l[e]," ")}}function A0(i,c){if(i&1&&(n(0,"td",13),g(1,W0,3,7,"ng-container",28)(2,N0,1,1,"ng-template",null,1,M),a()),i&2){let e=c.index,l=Je(3);o(),m("ngIf",e===0)("ngIfElse",l)}}function G0(i,c){if(i&1&&(n(0,"tr",13),g(1,A0,4,2,"td",15),a()),i&2){let e=c.$implicit,l=s();o(),m("ngForOf",l.getFilteredKeys(e))}}var Rn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(l=>+l!=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(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[R],decls:41,vars:20,consts:[["pageFilterTemplate",""],["ELSE_BLOCK",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],[1,"border",2,"width","15%"],[1,"border"],["class","border","style","width: 10%",4,"ngFor","ngForOf"],["class","border",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2","class","text-center border",4,"ngFor","ngForOf"],["colspan","2",1,"text-center","border"],[1,"border",2,"width","10%"],[4,"ngIf","ngIfElse"],[3,"routerLink","queryParams"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",2),S("textChange",function(w){return u(r),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,B0,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,O0,16,10,"ng-template",null,0,M),a(),n(28,"content")(29,"div",8)(30,"table",9)(31,"thead",10),g(32,R0,4,1,"tr",11),n(33,"tr")(34,"th",12),p(35,"Name"),a(),n(36,"th",13),p(37,"Code"),a(),g(38,k0,2,1,"th",14),a()(),n(39,"tbody"),g(40,G0,2,1,"tr",15),a()()()()()}l&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,T0)),o(3),m("routerLink",b(15,P0)),o(3),m("routerLink",b(16,I0)),o(3),m("routerLink",b(17,F0)),o(3),m("routerLink",b(18,b0)),o(3),m("routerLink",b(19,E0)),o(9),m("ngIf",(t.data==null?null:t.data.Outlet.length)>0),o(6),m("ngForOf",t.data==null?null:t.data.Header),o(2),m("ngForOf",t.data==null?null:t.data.Data))},dependencies:[N,Y,k,A,K,B,L,De,fe,Q],encapsulation:2})};var H0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Q0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],Y0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],j0=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),vr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],q0=(i,c,e)=>({CategoryID:i,From:c,To:e}),U0=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],wr=i=>({CategoryID:i});function K0(i,c){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function z0(i,c){if(i&1&&(n(0,"span",22),p(1),a()),i&2){let e=c.item;dt("matTooltip",e.Value),o(),T(e.Value)}}function X0(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CategoryID,t)||(r.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.BrandID,t)||(r.pageData.Filter.BrandID=t),_(t)}),g(10,z0,2,2,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SalesID,t)||(r.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CustomerID,t)||(r.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",20),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CalculationDiscount,t)||(r.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(26,"h6"),p(27,"Exclude Zero"),a(),n(28,"radio-options",21),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ExcludeZero,t)||(r.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(5),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("ngModel",e.pageData.Filter.CalculationDiscount),m("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),x("model",e.pageData.Filter.ExcludeZero)}}function Z0(i,c){i&1&&(n(0,"th",42),p(1," Cost "),F(2,"p-treeTableSortIcon",43),a())}function J0(i,c){i&1&&(n(0,"th",44),p(1," Profit "),F(2,"p-treeTableSortIcon",45),a())}function $0(i,c){i&1&&(n(0,"th",46),p(1," % "),F(2,"p-treeTableSortIcon",47),a())}function ec(i,c){if(i&1&&(n(0,"tr",28)(1,"th",29),p(2," Category "),F(3,"p-treeTableSortIcon",30),a(),n(4,"th",31),p(5," Qty "),F(6,"p-treeTableSortIcon",32),a(),g(7,Z0,3,0,"th",33),n(8,"th",34),p(9," Gross "),F(10,"p-treeTableSortIcon",35),a(),n(11,"th",36),p(12," Disc "),F(13,"p-treeTableSortIcon",37),a(),n(14,"th",38),p(15," Sales "),F(16,"p-treeTableSortIcon",39),a(),g(17,J0,3,0,"th",40)(18,$0,3,0,"th",41),a()),i&2){let e=s(2);o(7),m("ngIf",e.roleService.product.Cost),o(10),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",e.roleService.report.Profit)}}function tc(i,c){if(i&1&&(n(0,"td",56)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().rowData;o(),dt("matTooltip",e.CostInDirect&&e.Cost?"Direct ("+C(2,2,e.Cost)+") Indirect ("+C(3,4,e.CostInDirect)+")":""),o(3),T(C(5,6,e.DisplayedCost))}}function ic(i,c){if(i&1&&(n(0,"td",57)(1,"span",22),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=s().rowData;o(),dt("matTooltip",e.ProfitInDirect&&e.Profit?"Direct ("+C(2,2,e.Profit)+") Indirect ("+C(3,4,e.ProfitInDirect)+")":""),o(3),T(C(5,6,e.DisplayedProfit))}}function nc(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;dt("matTooltip",e.PercentageInDirect&&e.Percentage?"Direct ("+y(1,2,e.Percentage,"1.0-2")+") Indirect ("+y(2,5,e.PercentageInDirect,"1.0-2")+")":""),o(3),v("",C(4,8,e.DisplayedPercentage),"%")}}function ac(i,c){if(i&1&&(n(0,"td"),g(1,nc,5,10,"span",58),a()),i&2){let e=s(3);o(),m("ngIf",e.roleService.report.Profit)}}function oc(i,c){if(i&1&&(n(0,"tr",48)(1,"td"),F(2,"p-treeTableToggler",49),n(3,"a",50),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",22),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),g(13,tc,6,8,"td",51),n(14,"td",52)(15,"span",22),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",53)(21,"a",54),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",52)(27,"span",22),d(28,"number"),d(29,"number"),n(30,"a",50),p(31),d(32,"amountFraction"),a()()(),g(33,ic,6,8,"td",55)(34,ac,2,1,"td",7),a()),i&2){let e=c.$implicit,l=c.rowData,t=s(2);m("ttRow",e),o(2),m("rowNode",e),o(),m("routerLink",b(50,vr))("queryParams",mt(51,q0,l.ID,y(4,20,t.pageData.Filter.From,"yyyy-MM-dd"),y(5,23,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),T(l.Name),o(2),dt("matTooltip",l.QuantityIndirect&&l.Quantity?"Direct ("+C(9,26,l.Quantity)+") Indirect ("+C(10,28,l.QuantityIndirect)+")":""),o(3),T(C(12,30,l.DisplayedQuantity)),o(2),m("ngIf",t.roleService.product.Cost),o(2),dt("matTooltip",l.GrossIndirect&&l.GrossSales?"Direct ("+C(16,32,l.GrossSales)+") Indirect ("+C(17,34,l.GrossIndirect)+")":""),o(3),T(C(19,36,l.DisplayedGross)),o(3),dt("matTooltip",l.DiscountIndirect&&l.Discount?"Direct ("+C(22,38,l.Discount)+") Indirect ("+C(23,40,l.DiscountIndirect)+")":""),m("routerLink",b(55,U0))("queryParams",U(56,wr,l.ID)),o(3),T(C(25,42,l.DisplayedTotalDiscount)),o(3),dt("matTooltip",l.NetSalesIndirect&&l.Sales?"Direct ("+C(28,44,l.Sales)+") Indirect ("+C(29,46,l.NetSalesIndirect)+")":""),o(3),m("routerLink",b(58,vr))("queryParams",U(59,wr,l.ID)),o(),T(C(32,48,l.DisplayedNetSales)),o(2),m("ngIf",t.roleService.report.Profit),o(),m("ngIf",t.roleService.report.Profit)}}function rc(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(2,1,e.data.Aggregate.TotalCost)," ")}}function lc(i,c){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=s(3);o(),v(" ",C(2,1,e.data.Aggregate.TotalProfit)," ")}}function pc(i,c){if(i&1&&(n(0,"td",60),p(1),d(2,"number"),a()),i&2){let e=s(3);o(),v(" ",C(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function mc(i,c){if(i&1&&(n(0,"tr",59)(1,"td",60),p(2,"Total :"),a(),n(3,"td",60),p(4),d(5,"quantityFraction"),a(),g(6,rc,3,3,"td",61),n(7,"td",62)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",60),p(12),d(13,"amountFraction"),a(),n(14,"td",62),p(15),d(16,"amountFraction"),a(),g(17,lc,3,3,"td",61)(18,pc,3,3,"td",63),a()),i&2){let e=s(2);o(4),v(" ",C(5,7,e.data.Aggregate.TotalQuantity)," "),o(2),m("ngIf",e.roleService.product.Cost),o(3),T(C(10,9,e.data.Aggregate.TotalGross)),o(3),v(" ",C(13,11,e.data.Aggregate.TotalDiscount)," "),o(3),v(" ",C(16,13,e.data.Aggregate.TotalNetSales)," "),o(2),m("ngIf",e.roleService.report.Profit),o(),m("ngIf",e.roleService.report.Profit)}}function sc(i,c){if(i&1&&(n(0,"content")(1,"div",23)(2,"p-treeTable",24),g(3,ec,19,3,"ng-template",25)(4,oc,35,61,"ng-template",26)(5,mc,19,15,"ng-template",27),a()()()),i&2){let e=s();o(2),m("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",b(4,j0))}}var kn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[R],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedProfit",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["style","width: 120px","class","text-danger",4,"ngIf"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],["style","width: 120px","class","text-success",4,"ngIf"],[1,"text-danger",2,"width","120px"],[1,"text-success",2,"width","120px"],["matTooltipPosition","above",3,"matTooltip",4,"ngIf"],[1,"table-footer"],[1,"text-end"],["style","width: 120px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","150px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","120px"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(r),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,K0,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,X0,29,15,"ng-template",null,0,M),a(),g(19,sc,6,5,"content",7),a()}l&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(10,H0)),o(3),m("routerLink",b(11,Q0)),o(3),m("routerLink",b(12,Y0)),o(5),m("ngIf",t.data))},dependencies:[N,k,A,z,K,B,L,pe,De,Le,Jo,Fo,ir,$o,er,tr,fe,Q,Ye,un,ie,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 cc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],dc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],uc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function _c(i,c){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",9),p(2," Export "),a()}}function gc(i,c){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CategoryID,t)||(r.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CustomerID,t)||(r.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.CustomerID)}}function fc(i,c){if(i&1&&(n(0,"th",23),p(1),a()),i&2){let e=c.$implicit;m("mat-sort-header",e),o(),T(e)}}function Cc(i,c){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=s().$implicit;o(),T(e.Value)}}function xc(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Value))}}function hc(i,c){if(i&1&&(n(0,"td"),g(1,Cc,2,1,"span",22)(2,xc,3,3,"span",22),a()),i&2){let e=c.$implicit;o(),m("ngIf",e.Key=="Category"),o(),m("ngIf",e.Key!="Category")}}function Sc(i,c){if(i&1&&(n(0,"tr"),g(1,hc,3,2,"td",21),a()),i&2){let e=c.$implicit;o(),m("ngForOf",e)}}function yc(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=c.$implicit;o(),v(" ",C(2,1,e),"")}}function Dc(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",24)(2,"td"),p(3,"Total : "),a(),g(4,yc,3,3,"td",21),a()()),i&2){let e=s(2);o(4),m("ngForOf",e.data.Sum)}}function vc(i,c){if(i&1){let e=I();n(0,"div",17)(1,"table",18),P("matSortChange",function(t){u(e);let r=s();return _(r.sortData(t))}),n(2,"thead",19)(3,"tr"),g(4,fc,2,2,"th",20),a()(),n(5,"tbody"),g(6,Sc,2,1,"tr",21),a(),g(7,Dc,5,1,"tfoot",22),a()()}if(i&2){let e=s();o(4),m("ngForOf",e.data.Dataheader),o(2),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0)}}var Wn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f}openExportModal(){this.matDialog.open(q,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let l=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=l;return}this.data.Data=l.sort((t,r)=>{let f=e.direction==="asc";for(let w=0;w<this.data.Dataheader.length;w++)if(e.active==this.data.Dataheader[w]){let Ee=t.find(ut=>ut.Key===[this.data.Dataheader[w]].toString()).Value,xt=r.find(ut=>ut.Key===[this.data.Dataheader[w]].toString()).Value;return this.compare(Ee,xt,f)}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[R],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(r),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,_c,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,gc,16,9,"ng-template",null,0,M),a(),n(19,"content"),g(20,vc,8,3,"div",7),a()()}l&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(10,cc)),o(3),m("routerLink",b(11,dc)),o(3),m("routerLink",b(12,uc)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,ae,ge,Le,fe,Q,X],encapsulation:2})};var wc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Tc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Pc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function Ic(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.Month,t)||(r.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.Year,t)||(r.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CurrencyID,t)||(r.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=s();o(3),x("ngModel",e.pageData.Filter.Month),m("items",e.Months),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies)}}function Fc(i,c){if(i&1&&(n(0,"div",11),F(1,"POS-pie-chart",12),a()),i&2){let e=s();o(),m("config",e.pieConfig)("data",e.PieData)}}var Nn=class i extends ne{constructor(e,l){super(e,l,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=l}Months=V.Months;Years=V.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(l){return new(l||i)(D(W),D(O))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[R],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(r),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),g(16,Ic,10,6,"ng-template",null,0,M),a(),n(18,"content"),g(19,Fc,2,2,"div",6),a()()}l&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(8,wc)),o(3),m("routerLink",b(9,Tc)),o(3),m("routerLink",b(10,Pc)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,B,L,ii],encapsulation:2})};var bc=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Ec(i,c){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",7),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",8)(9,"datepicker",9),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",10),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.SalesOrderTagIDs,t)||(r.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("items",e.pageData.Options.SalesOrderTagIDs),x("ngModel",e.pageData.Filter.SalesOrderTagIDs),m("multiple",!0)}}function Mc(i,c){if(i&1&&(n(0,"content")(1,"div",11)(2,"div",12)(3,"div",13)(4,"div",14)(5,"div",15)(6,"div",16)(7,"p",17),p(8,"Transaction Per Hour"),a()(),n(9,"div",18),F(10,"POS-line-chart",19),a()()()(),n(11,"div",13)(12,"div",14)(13,"div",15)(14,"div",16)(15,"p",17),p(16,"Transaction Per Session"),a()(),n(17,"div",18),F(18,"POS-pie-chart",19),a()()()()()()()),i&2){let e=s();o(10),m("config",e.chartConfig)("data",e.ChartData),o(8),m("config",e.pieConfig)("data",e.PieData)}}var An=class i extends he{constructor(e,l,t){super(e,l,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=l;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,l=[],t=[];this.data.Data.forEach(r=>{l.push(r.Name);let f={name:r.Name+": "+r.Description,y:r.Transaction};t.push(f)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(r,f){return r+"<br/>"+f.series.name+": <b>"+f.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(G))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[R],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"a",2),F(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),g(6,Ec,13,9,"ng-template",null,0,M),a(),g(8,Mc,19,4,"content",4),a()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("routerLink",b(6,bc)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,K,B,L,ii,Et,Q],encapsulation:2})};function Vc(i,c){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",5),p(2," Export "),a()}}function Bc(i,c){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",8),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Oc(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",19),p(5),d(6,"number"),a(),n(7,"td",19),p(8),d(9,"number"),a(),n(10,"td",19),p(11),d(12,"amountFraction"),a(),n(13,"td",19),p(14),d(15,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),T(C(3,5,e.Visitor)),o(3),T(C(6,7,e.Orders)),o(3),T(C(9,9,e.TotalVisitor)),o(3),T(C(12,11,e.Sales)),o(3),T(C(15,13,e.Sales/(e.Visitor*e.Orders)))}}function Lc(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,Oc,16,15,"tr",17),a(),n(16,"tfoot")(17,"tr",18)(18,"td",19),p(19,"Total"),a(),n(20,"td",19),p(21),d(22,"sum"),d(23,"number"),a(),n(24,"td",19),p(25),d(26,"sum"),d(27,"number"),a(),n(28,"td",19),p(29),d(30,"sum"),d(31,"amountFraction"),a(),n(32,"td",19),p(33),d(34,"amountFraction"),a()()()()()),i&2){let e=s();o(15),m("ngForOf",e.data),o(6),T(C(23,8,y(22,5,e.data,"Orders"))),o(4),T(C(27,13,y(26,10,e.data,"TotalVisitor"))),o(4),T(C(31,18,y(30,15,e.data,"Sales"))),o(4),T(C(34,20,e.getSpendingPerPersonSum(e.data)))}}var Gn=class i extends ne{constructor(e,l,t,r,f){super(e,l,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f}getSpendingPerPersonSum(e){return e.reduce((l,t)=>l+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(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[R],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Vc,3,0,"a",2),a(),n(3,"filters"),g(4,Bc,10,6,"ng-template",null,0,M),a(),n(6,"content"),g(7,Lc,35,22,"div",3),a()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,K,B,L,Q,oe,ie,X],encapsulation:2})};var Rc=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function kc(i,c){if(i&1){let e=I();n(0,"a",18),P("click",function(){u(e);let t=s();return _(t.openExportModal())}),F(1,"i",19),p(2," Export "),a()}}function Wc(i,c){if(i&1){let e=I();n(0,"div",20)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",21),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",22),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",23)(9,"datepicker",24),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Nc(i,c){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Ac(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),T(C(2,1,e.Revenue))}}function Gc(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,Ac,3,3,"td",17),a()),i&2){let e=c.$implicit,l=s();o(2),T(e.TimeFormat),o(2),T(C(5,7,e.Count)),o(3),T(C(8,9,e.Quantity)),o(3),T(C(11,11,e.Sales)),o(3),T(C(15,15,C(14,13,e.Tax))),o(4),T(C(19,19,C(18,17,e.SalesWithTax))),o(3),m("ngIf",l.roleService.product.Cost||l.roleService.report.Profit)}}function Hc(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s();o(),T(C(3,4,y(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var Hn=class i extends he{constructor(e,l,t,r,f){super(e,l,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=l;this.csvConverter=t;this.roleService=r;this.matDialog=f}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(q,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(l){return new(l||i)(D(W),D(O),D(H),D(G),D(j))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[R],decls:55,vars:44,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class"," text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],["class","text-end",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(l,t){if(l&1){let r=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(r),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(r),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,kc,3,0,"a",2),n(3,"a",3),F(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),g(7,Wc,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,Nc,2,0,"th",11),a()(),n(27,"tbody"),g(28,Gc,21,21,"tr",12),a(),n(29,"tfoot")(30,"tr",13),F(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,Hc,4,6,"td",17),a()()()()()()}l&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(),m("routerLink",b(43,Rc)),o(23),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit),o(2),m("ngForOf",t.data==null?null:t.data.Data),o(5),T(C(35,17,y(34,14,t.data==null?null:t.data.Data,"Count"))),o(4),T(C(39,22,y(38,19,t.data==null?null:t.data.Data,"Quantity"))),o(4),T(C(43,27,y(42,24,t.data==null?null:t.data.Data,"Sales"))),o(4),T(C(48,34,C(47,32,y(46,29,t.data==null?null:t.data.Data,"Tax")))),o(5),T(C(53,41,C(52,39,y(51,36,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit))},dependencies:[N,Y,k,A,K,B,L,Q,oe,Qo,ie,X,Z],encapsulation:2})};var Qc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],$a=(i,c)=>({From:i,To:c}),Yc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],jc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function qc(i,c){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CategoryID,t)||(r.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CurrencyID,t)||(r.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let r=s();return _(r.onFilterDateChange(t))}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function Uc(i,c){if(i&1&&(n(0,"content")(1,"div",12),F(2,"POS-line-chart",13),a()()),i&2){let e=s();o(2),m("config",e.chartConfig)("data",e.ChartData)}}var Qn=class i extends ne{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(c,e,l){super(c,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,l),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(r=>`${r.getDate()} ${V.Months[r.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(O),D(Oe))};static \u0275cmp=E({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[R],decls:19,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,l){if(e&1){let t=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(t),_(l.searchFromPageOne())}),S("filterChange",function(f){return u(t),h(l.pageData.Filter,f)||(l.pageData.Filter=f),_(f)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),g(16,qc,13,11,"ng-template",null,0,M),a(),g(18,Uc,3,2,"content",6),a()}e&2&&(m("pageData",l.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",l.pageData.Filter),o(7),m("routerLink",b(11,Qc))("queryParams",de(12,$a,l.pageData.Filter==null?null:l.pageData.Filter.From,l.pageData.Filter==null?null:l.pageData.Filter.To)),o(3),m("routerLink",b(15,Yc))("queryParams",de(16,$a,l.pageData.Filter==null?null:l.pageData.Filter.From,l.pageData.Filter==null?null:l.pageData.Filter.To)),o(3),m("routerLink",b(19,jc))("queryParams",de(20,$a,l.pageData.Filter==null?null:l.pageData.Filter.From,l.pageData.Filter==null?null:l.pageData.Filter.To)),o(5),m("ngIf",l.data))},dependencies:[N,k,A,z,B,L,Et,At,fe,Q],encapsulation:2})};var Zc={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},ri=class i{date;dateChange=new Ai;width;minDate=V.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(c,e){let l=null;c&&(l=c.toDate(),l.setHours(0,0,0,0)),this.date=l,this.dateChange.emit(l),e.close()}onDateChange(c){let e=null;c&&(e=c.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(c,e){let l=new Date(c.getFullYear(),0,1);this.date=l.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[di([{provide:tn,useClass:Sn,deps:[en,Zo]},{provide:nn,useValue:Zc}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,l){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(f){return u(t),_(l.onDateChange(f.value))}),a(),F(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(f){u(t);let w=Je(4);return _(l.chosenYearHandler(f,w))})("monthSelected",function(f){u(t);let w=Je(4);return _(l.setMonthAndYear(f,w))})("opened",function(){return u(t),_(l.onOpenDatepicker())})("closed",function(){return u(t),_(l.onCloseDatepicker())}),a()()}if(e&2){let t=Je(4);_o("width",l.width||100,"%"),o(),m("matDatepicker",t)("value",l.date==l.minDate?null:l.date),o(),m("for",t)}},dependencies:[Nt,mn,_i,rn,ln,pn,gi,cn,on,an,sn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
2
2
|
`],encapsulation:2})};var $c=()=>["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"];function ed(i,c){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.ListIDs,t)||(r.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker-year-month",8),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.From,t)||(r.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker-year-month",8),S("dateChange",function(t){u(e);let r=s();return h(r.pageData.Filter.To,t)||(r.pageData.Filter.To=t),_(t)}),a()(),n(10,"h6"),p(11,"Compare To Year"),a(),n(12,"ng-select",10),S("ngModelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.LastYear,t)||(r.pageData.Filter.LastYear=t),_(t)}),a(),n(13,"h6"),p(14,"Category"),a(),n(15,"POS-product-category-select",11),S("selectedCategoryIDChange",function(t){u(e);let r=s();return h(r.pageData.Filter.CategoryID,t)||(r.pageData.Filter.CategoryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",12),S("ngModelChange",function(t){u(e);let r=s();return h(r.currency,t)||(r.currency=t),_(t)}),P("change",function(){u(e);let t=s();return _(t.checkFilterCurrency())}),a(),n(19,"h6"),p(20,"Multiply Unit Qty"),a(),n(21,"radio-options",13),S("modelChange",function(t){u(e);let r=s();return h(r.pageData.Filter.MultiplyUnitQuantity,t)||(r.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.LastYear),m("items",e.optionsCompareYear),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.currency),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),x("model",e.pageData.Filter.MultiplyUnitQuantity)}}function td(i,c){if(i&1&&(n(0,"div",14),F(1,"POS-line-chart",15),a()),i&2){let e=s();o(),m("config",e.chartConfig)("data",e.chartData)}}var jn=class i extends ne{constructor(e,l,t){super(e,l,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance");this.httpService=l;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 l,t="",r=Math.abs(this.total);return r>999&&r<1e10?(t="K",l=(r/1e3).toFixed(0)):r>=1e10?(t="M",l=(r/1e6).toFixed(0)):r<999&&(l=r.toString()),this.total<0&&(l="-"+l),l.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 l=this.series.chart.series,t=this.point?.stackTotal;l=l.filter(Ee=>this.series?.name==Ee?.name);let r=[],f="",w=this.point.index;return l.forEach(Ee=>{Ee.options.stack===this.point.series.options.stack&&(r=Ee.name.split(" "),f+=`
|
|
3
3
|
<b>${this.point.category}</b></br>Total:
|
|
4
4
|
${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(t)}</br>${r[0]}:
|