dealpos 25.43.4 → 25.43.5
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-SYYCPGJV.js → chunk-2NSWFY4O.js} +2 -2
- package/browser/{chunk-O7K75UXY.js → chunk-2X76TSLU.js} +1 -1
- package/browser/{chunk-UYLL2WJ3.js → chunk-35IS2425.js} +2 -2
- package/browser/{chunk-7UXE6WII.js → chunk-3TEHZXBK.js} +1 -1
- package/browser/{chunk-TNHTZU3G.js → chunk-3VHY7PL5.js} +1 -1
- package/browser/{chunk-EIHE3QN4.js → chunk-3Z2GEEIO.js} +1 -1
- package/browser/{chunk-IAZFUBFX.js → chunk-43CYJJ7R.js} +1 -1
- package/browser/{chunk-3VT5D6VK.js → chunk-4IUHVTY7.js} +1 -1
- package/browser/{chunk-MDD6TFTM.js → chunk-4M3KCZZ5.js} +1 -1
- package/browser/{chunk-SEGFXGKG.js → chunk-4Z2LLSIT.js} +1 -1
- package/browser/{chunk-JGK2MYOQ.js → chunk-5A6FE72F.js} +1 -1
- package/browser/{chunk-75SMG4SF.js → chunk-5BQ6KDM5.js} +1 -1
- package/browser/{chunk-AVQXAEMG.js → chunk-6KLHZ2R7.js} +1 -1
- package/browser/{chunk-TS5DD7F4.js → chunk-74R4FSP3.js} +1 -1
- package/browser/{chunk-YI4JLNCJ.js → chunk-7JEDHJS2.js} +1 -1
- package/browser/{chunk-G7SZYW63.js → chunk-7V5KJ4YX.js} +1 -1
- package/browser/{chunk-VT2H5BYD.js → chunk-7XM2TUQG.js} +1 -1
- package/browser/{chunk-2PLXQ6DN.js → chunk-ADVARNRM.js} +1 -1
- package/browser/{chunk-C7XXRU25.js → chunk-AWKQHHQM.js} +1 -1
- package/browser/{chunk-J3IQVJI4.js → chunk-BJYMTBNH.js} +1 -1
- package/browser/{chunk-F3T2SC5Q.js → chunk-CCMSV4DH.js} +1 -1
- package/browser/chunk-CF7JD6YG.js +1 -0
- package/browser/{chunk-5FDHNE6C.js → chunk-CHFKBGOU.js} +1 -1
- package/browser/{chunk-YFL7VFWC.js → chunk-CVPJMH3U.js} +1 -1
- package/browser/{chunk-E72S2LHD.js → chunk-D7I2I6EI.js} +1 -1
- package/browser/{chunk-UCJKQICE.js → chunk-DAY7JXRT.js} +1 -1
- package/browser/{chunk-NRWPQAB7.js → chunk-DBKK22BI.js} +1 -1
- package/browser/{chunk-JEAH4FYM.js → chunk-DFCEUPLP.js} +1 -1
- package/browser/{chunk-2EP24RI6.js → chunk-DL47T6O3.js} +1 -1
- package/browser/{chunk-KA4TOHBS.js → chunk-DUDVUYJM.js} +1 -1
- package/browser/{chunk-4DMEBTIA.js → chunk-DUSLRINU.js} +1 -1
- package/browser/{chunk-FMDB67TU.js → chunk-EBZNSKXW.js} +1 -1
- package/browser/{chunk-Z65FTA7V.js → chunk-ESIVNWIY.js} +1 -1
- package/browser/{chunk-A5ZLOGOJ.js → chunk-EW5HSVJX.js} +2 -2
- package/browser/{chunk-AROOOSPE.js → chunk-EXMUBZ3C.js} +1 -1
- package/browser/{chunk-PX65TDN3.js → chunk-F2O5MYHK.js} +1 -1
- package/browser/{chunk-BLOA2A3C.js → chunk-FZBSFWQQ.js} +1 -1
- package/browser/{chunk-XZJ645Q5.js → chunk-FZZDSNKY.js} +2 -2
- package/browser/chunk-GCBG44YQ.js +1 -0
- package/browser/{chunk-O2OM4KZ4.js → chunk-H273QYYR.js} +1 -1
- package/browser/{chunk-NWXWPE73.js → chunk-H7UX7GPF.js} +1 -1
- package/browser/{chunk-HIYIS7P2.js → chunk-IVKRPJNP.js} +1 -1
- package/browser/{chunk-WDQOMZAV.js → chunk-IVSDRZEF.js} +1 -1
- package/browser/{chunk-EFKIYD2S.js → chunk-JPEAUVYZ.js} +1 -1
- package/browser/{chunk-HZ2U3RGD.js → chunk-JR5K2R42.js} +1 -1
- package/browser/{chunk-FBXL7ZXR.js → chunk-KRU4LBHD.js} +1 -1
- package/browser/{chunk-B2ZLN3DU.js → chunk-KU6QQB26.js} +1 -1
- package/browser/{chunk-YQLHHLTC.js → chunk-L2XNTRDO.js} +1 -1
- package/browser/{chunk-PWJVQMES.js → chunk-L375MXQY.js} +1 -1
- package/browser/{chunk-NISY7IAG.js → chunk-L3VXMESJ.js} +1 -1
- package/browser/{chunk-G2MU6LQ2.js → chunk-LEA3AHYR.js} +1 -1
- package/browser/{chunk-AGUT25WD.js → chunk-LTWO3DBC.js} +1 -1
- package/browser/{chunk-GFJYKJED.js → chunk-M63U56OM.js} +1 -1
- package/browser/{chunk-4V3WJ77K.js → chunk-MB6KJ2T5.js} +1 -1
- package/browser/{chunk-CMKDM3YB.js → chunk-MBCN2CLL.js} +2 -2
- package/browser/{chunk-IQBTWGJY.js → chunk-MHCEZ7DC.js} +1 -1
- package/browser/{chunk-M4F2UJHF.js → chunk-MJR3ALOY.js} +1 -1
- package/browser/{chunk-2RGZUU27.js → chunk-MNRW7SXU.js} +1 -1
- package/browser/{chunk-F5XHOC4H.js → chunk-MO72A7CV.js} +1 -1
- package/browser/{chunk-SH2AVVL5.js → chunk-NKMWM4KR.js} +1 -1
- package/browser/{chunk-6W6BB6FZ.js → chunk-O4MMSLYA.js} +1 -1
- package/browser/{chunk-YGCPZSCL.js → chunk-OC3ZOSYU.js} +1 -1
- package/browser/{chunk-WZS6HHV3.js → chunk-PC4Z6IGY.js} +1 -1
- package/browser/{chunk-S3ZJOM5T.js → chunk-PJDSTOKD.js} +1 -1
- package/browser/{chunk-NUJC3NPK.js → chunk-PY5J4HAL.js} +1 -1
- package/browser/{chunk-5H2362GA.js → chunk-Q2FJJI5G.js} +1 -1
- package/browser/{chunk-7HSR3LT6.js → chunk-QWAX56GV.js} +1 -1
- package/browser/{chunk-XBC5WNSH.js → chunk-QXMFQYKM.js} +1 -1
- package/browser/{chunk-DLQL5GPU.js → chunk-RO5GNGWL.js} +2 -2
- package/browser/{chunk-ITGJPMDT.js → chunk-RUSRJ52M.js} +1 -1
- package/browser/{chunk-RNH5CWRS.js → chunk-SG7VALIZ.js} +14 -14
- package/browser/{chunk-FHJG45VQ.js → chunk-SZWUK47J.js} +2 -2
- package/browser/{chunk-ZYI3XMBD.js → chunk-TDLN5ER3.js} +1 -1
- package/browser/{chunk-INQBV4VC.js → chunk-TDOLMY4J.js} +1 -1
- package/browser/{chunk-CVI22GXH.js → chunk-TEDYOKSU.js} +1 -1
- package/browser/{chunk-GSISS3SC.js → chunk-TQX7L2IB.js} +1 -1
- package/browser/{chunk-XRZ7VBID.js → chunk-TTUGEY43.js} +1 -1
- package/browser/{chunk-3Z2WREJH.js → chunk-TU5L2JCD.js} +1 -1
- package/browser/{chunk-5YFCA5PL.js → chunk-U5EFHDLM.js} +1 -1
- package/browser/{chunk-ONEB5DHN.js → chunk-UFJZASJM.js} +2 -2
- package/browser/{chunk-MZPJH3AH.js → chunk-USFYL7EO.js} +1 -1
- package/browser/{chunk-EP6KOZ4E.js → chunk-VPJ7T6EZ.js} +1 -1
- package/browser/{chunk-R4KZHFTX.js → chunk-XPHETFTU.js} +1 -1
- package/browser/chunk-XQOLOZQF.js +1 -0
- package/browser/{chunk-66K27OF2.js → chunk-XVQOAPVN.js} +1 -1
- package/browser/{chunk-3RWAC4XP.js → chunk-YJL3WVWM.js} +1 -1
- package/browser/{chunk-5QQG3XAT.js → chunk-YMLIT7VX.js} +1 -1
- package/browser/{chunk-272PZZGG.js → chunk-ZK73H7ER.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-SAUYF5DW.js → main-52FO32Z7.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-5QXTT2Q4.js +0 -1
- package/browser/chunk-HOM424UE.js +0 -1
- package/browser/chunk-YGHO5ZLV.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ni,b as dr}from"./chunk-NVWJ6HZD.js";import{a as gr,b as fr}from"./chunk-SEFALU4U.js";import{a as Cr}from"./chunk-7UXE6WII.js";import"./chunk-4NHG4RRM.js";import{a as Et,b as ur}from"./chunk-KHILQH3P.js";import{a as Gt,b as _r}from"./chunk-FRDFUCRO.js";import"./chunk-YAFVFDTG.js";import{a as cr}from"./chunk-V7UEUV6F.js";import{a as ii}from"./chunk-TAVO3B4U.js";import{a as he}from"./chunk-C7XXRU25.js";import{a as Ye}from"./chunk-4JM455M6.js";import{a as Dn}from"./chunk-42T2PR4J.js";import{a as vt}from"./chunk-OXQJYOVG.js";import{a as ko}from"./chunk-5HX73JZ3.js";import{b as Go}from"./chunk-EOVI4KWG.js";import"./chunk-XJ7SOVB2.js";import{a as yn}from"./chunk-TNHTZU3G.js";import"./chunk-DAIHPIA2.js";import{a as sr}from"./chunk-BXQFYW4R.js";import{a as rr,b as lr,d as pr,g as mr}from"./chunk-4UYZJCFI.js";import"./chunk-BYXBJQAS.js";import{a as yi}from"./chunk-XKUQPHUA.js";import"./chunk-Q4CKRRGM.js";import"./chunk-PIYM2FOP.js";import"./chunk-2OWHEMAL.js";import"./chunk-XZELBTQR.js";import{e as Ao}from"./chunk-RHUDY63D.js";import{a as er,b as tr,c as ir,d as nr,e as ar,f as or}from"./chunk-J3IQVJI4.js";import"./chunk-B5SDXVDR.js";import"./chunk-S3ZJOM5T.js";import"./chunk-L7YSVT7G.js";import"./chunk-RX7JS4CO.js";import{a as Oi,b as $o,c as Sn,d as K,e as Si}from"./chunk-GIDGCFLX.js";import{a as cn,b as fi}from"./chunk-XBRBYCWJ.js";import"./chunk-3RK6DDJD.js";import{a as sn}from"./chunk-FP4HFB5J.js";import{a as en,b as tn,c as nn,f as rn,g as ln,h as pn,p as gi,q as mn}from"./chunk-H3OZSV6V.js";import"./chunk-YEDKRNXU.js";import"./chunk-VZEPVRCY.js";import"./chunk-7QWJJPNG.js";import{c as No,d as De,e as hn}from"./chunk-6647Y35T.js";import"./chunk-VHAM2DWK.js";import{a as J}from"./chunk-JPXXXD26.js";import{a as X}from"./chunk-WO3LDDSF.js";import{a as dn}from"./chunk-CVI22GXH.js";import{a as ae,b as ge,c as Ro}from"./chunk-VQBXUZ6U.js";import{a as bt,b as Zo}from"./chunk-BBGWXLHJ.js";import{d as zo,f as fe}from"./chunk-G2MU6LQ2.js";import{a as Xo,b as Jo,c as Q}from"./chunk-6W6BB6FZ.js";import{b as q}from"./chunk-QHBWVJIQ.js";import{a as ne}from"./chunk-IQBTWGJY.js";import{a as Lo}from"./chunk-75SMG4SF.js";import"./chunk-6JAL37Y4.js";import"./chunk-4QQTEPQT.js";import{a as H}from"./chunk-XZR3IMWZ.js";import{e as N,f as hi}from"./chunk-EFKIYD2S.js";import"./chunk-ITGJPMDT.js";import"./chunk-5JJSLRVS.js";import{c as Ho}from"./chunk-B6LPY2IZ.js";import"./chunk-CWITQVZH.js";import"./chunk-QHRP323Q.js";import"./chunk-WDQ4UKKY.js";import"./chunk-MFCXEITE.js";import{a as Qo,c as Qe}from"./chunk-MUJ6277G.js";import"./chunk-LMJVRREP.js";import"./chunk-3LBZDIW2.js";import"./chunk-KTCV3KOE.js";import"./chunk-KZDE63UL.js";import{e as Ko}from"./chunk-JGK2MYOQ.js";import{b as W}from"./chunk-WZS6HHV3.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import{C as Cn,F as Le,G as xn,j as an,m as on,t as Wo,u as Ci,v as ei,w as _n}from"./chunk-H7F34T25.js";import{b as pe,c as $i}from"./chunk-JOXTERIM.js";import{A as fn,B as qo,C as ti,K as xi,N as Uo,g as oe,o as Yo,s as gn,z as jo}from"./chunk-TSIYPTYI.js";import{a as un,d as z}from"./chunk-XYB3YDKL.js";import"./chunk-7VKFVS7K.js";import"./chunk-ZVDY66SR.js";import{b as Ji,e as Zt,f as $t,g as j}from"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import{a as Bo,b as Oo}from"./chunk-VFTGIP5A.js";import{a as Vo}from"./chunk-LE3BKIDY.js";import{a as Bi}from"./chunk-2FWFPV5I.js";import{la as Eo,ma as Zi,ua as Mo}from"./chunk-EEEAUYZ6.js";import{F as At,G as Xi,a as To,b as Po,c as ke,h as B,l as Fo,o as L,q as Io,s as bo}from"./chunk-RVXZOIFQ.js";import"./chunk-SH2AVVL5.js";import"./chunk-UCJKQICE.js";import{a as M,d as G}from"./chunk-ZZGSAFGO.js";import"./chunk-SEGFXGKG.js";import{$a as o,$b as ji,Ac as C,Ba as Ai,Bc as y,Cc as _i,Db as Nt,E as ri,Eb as Xa,Fa as Gi,Fc as V,Gb as Ei,Hb as Mi,I as Ii,Ib as n,Jb as a,K as mo,Kb as I,Kc as So,Lb as se,M as so,Ma as mt,Mb as ce,Mc as Ui,Nb as xo,Nc as yo,Ob as F,Od as Oe,Pc as Ja,Q as Ni,Qb as T,Qc as Do,Qd as zi,Rb as s,Rd as A,Td as Vi,Ub as dt,Va as Pe,Vd as Ke,Wa as Hi,Wc as He,Y as Rt,Yc as Y,Yd as O,Zb as Qi,Zc as k,_b as Yi,aa as Ka,ad as vo,cd as Ki,db as D,dc as Ze,ec as p,ed as ee,fa as kt,fc as P,gc as v,gd as ie,hc as Xt,ia as co,ib as _o,ja as uo,jc as x,jd as Jt,ka as ci,kb as E,kc as h,lb as di,lc as S,mb as go,na as Ge,o as si,ob as R,pc as ui,qb as g,qc as b,rc as U,sc as de,t as Yt,tc as st,u as Ua,ub as jt,uc as qt,va as u,vb as m,vc as qi,wa as _,wb as fo,wc as ho,wd as wo,xb as bi,za,zb as Co,zc as d}from"./chunk-UXRO4UFY.js";import{a as Je,b as et,e as sl,g as Qt}from"./chunk-7DCB7DB2.js";var ao=sl((gb,Va)=>{(function(i){typeof Va=="object"&&Va.exports?(i.default=i,Va.exports=i):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts"],function(c){return i(c),i.Highcharts=c,i}):i(typeof Highcharts<"u"?Highcharts:void 0)})(function(i){"use strict";var c=i?i._modules:{};function e(r,t,l,f){r.hasOwnProperty(t)||(r[t]=f.apply(null,l),typeof CustomEvent=="function"&&i.win.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:r[t]}})))}e(c,"Extensions/SeriesLabel/SeriesLabelDefaults.js",[],function(){return{enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]}}),e(c,"Extensions/SeriesLabel/SeriesLabelUtilities.js",[],function(){function r(l,f,w,Ee,xt,ut){let Vt=(ut-f)*(w-l)-(Ee-f)*(xt-l);return Vt>0||!(Vt<0)}function t(l,f,w,Ee,xt,ut,Vt,Wt){return r(l,f,xt,ut,Vt,Wt)!==r(w,Ee,xt,ut,Vt,Wt)&&r(l,f,w,Ee,xt,ut)!==r(l,f,w,Ee,Vt,Wt)}return{boxIntersectLine:function(l,f,w,Ee,xt,ut,Vt,Wt){return t(l,f,l+w,f,xt,ut,Vt,Wt)||t(l+w,f,l+w,f+Ee,xt,ut,Vt,Wt)||t(l,f+Ee,l+w,f+Ee,xt,ut,Vt,Wt)||t(l,f,l,f+Ee,xt,ut,Vt,Wt)},intersectRect:function(l,f){return!(f.left>l.right||f.right<l.left||f.top>l.bottom||f.bottom<l.top)}}}),e(c,"Extensions/SeriesLabel/SeriesLabel.js",[c["Core/Animation/AnimationUtilities.js"],c["Core/Templating.js"],c["Core/Defaults.js"],c["Core/Globals.js"],c["Extensions/SeriesLabel/SeriesLabelDefaults.js"],c["Extensions/SeriesLabel/SeriesLabelUtilities.js"],c["Core/Utilities.js"]],function(r,t,l,f,w,Ee,xt){let{animObject:ut}=r,{format:Vt}=t,{setOptions:Wt}=l,{composed:al}=f,{boxIntersectLine:oo,intersectRect:ol}=Ee,{addEvent:ro,extend:lo,fireEvent:rl,isNumber:ki,pick:Ut,pushUnique:ll,syncTimeout:pl}=xt;function pi(ct,Me,at,we,Pt){let it=ct.chart,$=ct.options.label||{},ze=Ut($.onArea,!!ct.area),je=ze||$.connectorAllowed,lt=it.boxesToAvoid,Bt=Number.MAX_VALUE,Ft=Number.MAX_VALUE,ht,_t,gt,Kt,It,Xe,be;for(Xe=0;lt&&Xe<lt.length;Xe+=1)if(ol(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(oo(Me,at,we.width,we.height,Ve[be-1].chartX,Ve[be-1].chartY,Ve[be].chartX,Ve[be].chartY))return!1;ct===ot&&!gt&&Pt&&(gt=oo(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)&&(ct!==ot||ze)&&(Bt=Math.min(Bt,(Kt=Me+we.width/2-Ve[be].chartX)*Kt+(It=at+we.height/2-Ve[be].chartY)*It))}if(!ze&&je&&ct===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)))<Ft&&(Ft=ht,_t=Ve[be]);gt=!0}}}return(!Pt||!!gt)&&{x:Me,y:at,weight:Bt-(_t?Ft:0),connectorPoint:_t}}function po(ct){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)),ct.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=pl(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(),Ft=(je.translateX||0)+($.xAxis?$.xAxis.pos:$.chart.plotLeft),ht=(je.translateY||0)+($.yAxis?$.yAxis.pos:$.chart.plotTop);it.push({left:Ft,top:ht,right:Ft+lt,bottom:ht+Bt})}))),Pt.forEach(function($){let ze=$.options.label||{};$.interpolatedPoints=function(je){let lt,Bt,Ft,ht,_t;if(!je.xAxis&&!je.yAxis)return;let gt=je.points,Kt=[],It=je.graph||je.area,Xe=It&&It.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,Fi=be?Ve.len:ot.len,ft=Ut((je.options.label||{}).onArea,!!je.area),Ne=Ve.getThreshold(je.options.threshold),wt={},zt=be?"chartCenterX":"chartCenterY";function oi(nt){let St=Math.round((nt.plotX||0)/8)+","+Math.round((nt.plotY||0)/8);wt[St]||(wt[St]=1,Kt.push(nt))}if(je.getPointSpline&&Xe&&Xe.getPointAtLength&&!ft&>.length<(je.chart.plotSizeX||0)/16){let nt=It.toD&&It.attr("d");for(It.toD&&It.attr({d:It.toD}),Ft=Xe.getTotalLength(),lt=0;lt<Ft;lt+=16){let Lt=Xe.getPointAtLength(lt),Ct=be?Fi-Lt.y:Lt.x,pt=be?Dt-Lt.x:Lt.y;oi({chartX:Ue+Ct,chartY:$e+pt,plotX:Ct,plotY:pt})}nt&&It.attr({d:nt});let St=gt[gt.length-1].pos();oi({chartX:Ue+(St?.[0]||0),chartY:$e+(St?.[1]||0)})}else{let nt;for(lt=0,Ft=gt.length;lt<Ft;lt+=1){let St=gt[lt],[Lt,Ct]=St.pos()||[],{plotHigh:pt}=St;if(ki(Lt)&&ki(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+Fi-((pt||St.plotY||0)+Ut(St.yBottom,Ne))/2:rt.chartCenterY=$e+((pt||Ct)+Ut(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)oi({chartX:nt.chartX+(rt.chartX-nt.chartX)*(_t/ht),chartY:nt.chartY+(rt.chartY-nt.chartY)*(_t/ht),[zt]:(nt[zt]||0)+((rt[zt]||0)-(nt[zt]||0))*(_t/ht),plotX:(nt.plotX||0)+(Lt-(nt.plotX||0))*(_t/ht),plotY:(nt.plotY||0)+(Ct-(nt.plotY||0))*(_t/ht)});oi(rt),nt=rt}}}return Kt}($),it.push(...ze.boxesToAvoid||[])}),we.series.forEach(function($){let ze=$.options.label;if(!ze||!$.xAxis&&!$.yAxis)return;let je="highcharts-color-"+Ut($.colorIndex,"none"),lt=!$.labelBySeries,Bt=ze.minFontSize,Ft=ze.maxFontSize,ht=we.inverted,_t=ht?$.yAxis.pos:$.xAxis.pos,gt=ht?$.xAxis.pos:$.yAxis.pos,Kt=we.inverted?$.yAxis.len:$.xAxis.len,It=we.inverted?$.xAxis.len:$.yAxis.len,Xe=$.interpolatedPoints,be=Ut(ze.onArea,!!$.area),ot=[],Ve=$.xData||[],Ue,$e,Dt,Fi,ft,Ne,wt=$.labelBySeries,zt,oi,nt;function St(Ct,pt,rt){let Wi=Math.max(_t,Ut(oi,-1/0)),mi=Math.min(_t+Kt,Ut(nt,1/0));return Ct>Wi&&Ct<=mi-rt.width&&pt>=gt&&pt<=gt+It-rt.height}function Lt(){wt&&($.labelBySeries=wt.destroy())}if(be&&!ht&&(zt=[$.xAxis.toPixels(Ve[0]),$.xAxis.toPixels(Ve[Ve.length-1])],oi=Math.min.apply(Math,zt),nt=Math.max.apply(Math,zt)),$.visible&&!$.boosted&&Xe){if(!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(lo({color:be?we.renderer.getContrast(pt):pt},ze.style||{})),wt.attr({opacity:we.renderer.forExport?1:0,stroke:$.color,"stroke-width":1})}Bt&&Ft&&wt.css({fontSize:Bt+($.sum||0)/($.chart.labelSeriesMaxSum||0)*(Ft-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=pi($,$e,Dt,Ue)):(St($e=Xe[ft].chartX+3,Dt=Xe[ft].chartY-Ue.height-3,Ue)&&(Ne=pi($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX+3,Dt=Xe[ft].chartY+3,Ue)&&(Ne=pi($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX-Ue.width-3,Dt=Xe[ft].chartY+3,Ue)&&(Ne=pi($,$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=pi($,$e,Dt,Ue,!0))),Ne&&ot.push(Ne);if(ze.connectorAllowed&&!ot.length&&!be)for($e=_t+Kt-Ue.width;$e>=_t;$e-=16)for(Dt=gt;Dt<gt+It-Ue.height;Dt+=16)(Fi=pi($,$e,Dt,Ue,!0))&&ot.push(Fi);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},Wi={opacity:1};Ct<=10&&(Wi={x:rt.x,y:rt.y},rt={}),lt&&(pt=ut($.options.animation),pt.duration*=.2),$.labelBySeries.attr(lo(rt,{anchorX:Ne.connectorPoint&&(Ne.connectorPoint.plotX||0)+_t,anchorY:Ne.connectorPoint&&(Ne.connectorPoint.plotY||0)+gt})).animate(Wi,pt),$.options.kdNow=!0,$.buildKDTree();let mi=$.searchPoint({chartX:Ne.x,chartY:Ne.y},!0);mi&&(wt.closest=[mi,Ne.x-(mi.plotX||0),Ne.y-(mi.plotY||0)])}}else Lt()}else Lt()}),rl(we,"afterDrawSeriesLabels")}(Me)},Me.renderer.forExport||!at?0:at)}}function ml(ct,Me,at,we,Pt){let it=Pt&&Pt.anchorX,$=Pt&&Pt.anchorY,ze,je,lt=at/2;return ki(it)&&ki($)&&(ze=[["M",it,$]],(je=Me-$)<0&&(je=-we-je),je<at&&(lt=it<ct+at/2?je:at-je),$>Me+we?ze.push(["L",ct+lt,Me+we]):$<Me?ze.push(["L",ct+lt,Me]):it<ct?ze.push(["L",ct,Me+we/2]):it>ct+at&&ze.push(["L",ct+at,Me+we/2])),ze||[]}return{compose:function(ct,Me){ll(al,"SeriesLabel")&&(ro(ct,"load",po),ro(ct,"redraw",po),Me.prototype.symbols.connector=ml,Wt({plotOptions:{series:{label:w}}}))}}}),e(c,"masters/modules/series-label.src.js",[c["Core/Globals.js"],c["Extensions/SeriesLabel/SeriesLabel.js"]],function(r,t){return t.compose(r.Chart,r.SVGRenderer),r})})});var xr=(i,c)=>({"text-success":i,"text-danger":c});function cl(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 dl(i,c){if(i&1){let e=F();n(0,"span",8),T("click",function(){u(e);let t=s(2);return _(t.loadComplementaryQuantity())}),I(1,"i",9),a()}}function ul(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 _l(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,xr,e.Profit>0,e.Profit<0)),o(),v(" ",C(8,4,e.Profit)," "),o(3),m("ngClass",de(12,xr,e.ProfitRatio>0,e.ProfitRatio<0)),o(),v("",y(12,6,e.ProfitRatio,"1.0-2"),"%")}}function gl(i,c){if(i&1&&(se(0),n(1,"table",4)(2,"tbody")(3,"tr")(4,"td")(5,"span",5),p(6,"Orders"),a()(),n(7,"td"),p(8),d(9,"number"),a(),I(10,"td"),a(),n(11,"tr")(12,"td")(13,"span",5),p(14," Quantity "),a()(),n(15,"td"),p(16),d(17,"quantityFraction"),a(),I(18,"td"),a(),n(19,"tr")(20,"td")(21,"span",5),p(22," Complementary "),a()(),n(23,"td"),g(24,cl,4,4,"ng-container",6),d(25,"async"),g(26,dl,2,0,"ng-template",null,0,V),a(),I(28,"td"),a(),n(29,"tr")(30,"td")(31,"span",5),p(32," Gross Sales "),a()(),n(33,"td"),p(34),d(35,"amountFraction"),a(),I(36,"td"),a(),n(37,"tr")(38,"td")(39,"span",5),p(40," Discount "),a()(),n(41,"td")(42,"span",7),p(43),d(44,"amountFraction"),a()(),n(45,"td")(46,"span",7),p(47),d(48,"number"),a()()(),n(49,"tr")(50,"td")(51,"span",5),p(52," Sales "),a()(),n(53,"td"),p(54),d(55,"amountFraction"),a(),I(56,"td"),a(),n(57,"tr")(58,"td")(59,"span",5),p(60," Tax "),a()(),n(61,"td"),p(62),d(63,"amountFraction"),a(),I(64,"td"),a(),n(65,"tr")(66,"td")(67,"span",5),p(68," Sales + Tax "),a()(),n(69,"td"),p(70),d(71,"amountFraction"),a(),I(72,"td"),a(),g(73,ul,13,7,"ng-container",3)(74,_l,13,15,"ng-container",3),a()(),ce()),i&2){let e=c.ngIf,r=Ze(27),t=s();o(8),P(C(9,12,e.Orders)),o(8),P(C(17,14,e.Quantity)),o(8),m("ngIf",C(25,16,t.complementaryQuantity$))("ngIfElse",r),o(10),P(C(35,18,e.GrossSales)),o(9),v(" ",C(44,20,e.Discount)," "),o(4),v(" ",y(48,22,e.DiscountRatio,"1.0-2"),"% "),o(7),P(C(55,25,e.Sales)),o(8),P(C(63,27,e.Tax)),o(8),P(C(71,29,e.SalesWithTax)),o(3),m("ngIf",t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost),o(),m("ngIf",t.roleService.report.Profit)}}var vn=class i{constructor(c,e,r,t){this.httpService=c;this.roleService=e;this.dialogRef=r;this.data=t;this.fractionDigit=this.data.FractionDigit}modalConfig;reportSummary$;fractionDigit;filter;complementaryQuantity$;ngOnInit(){this.reportSummary$=this.httpService.post("/api/Report/ReportDetailFooter",this.data.Filter).pipe(Yt(c=>(c.ProfitRatio=this.profitRatioCalculation(c.Profit,c.Sales,c.Tax),c.CostRatio=this.costRatioCalculation(c.Cost,c.Sales,c.Tax),c.DiscountRatio=this.discountPercentageCalc(c.Discount,c.GrossSales,c.Tax),c))),this.initModalConfig()}initModalConfig(){this.modalConfig=new Ci,this.modalConfig.title="Sales Detail Summary",this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.customWidth="400px",this.modalConfig.hideFooter=!0}costRatioCalculation(c,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=c/e*100),t}profitRatioCalculation(c,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=c/e*100),t}discountPercentageCalc(c=0,e=0,r=0){return c/(e-r)*100}loadComplementaryQuantity(){this.complementaryQuantity$=this.httpService.post("/api/Report/ReportDetailComplementaryQuantity",this.data.Filter).pipe(Rt())}static \u0275fac=function(e){return new(e||i)(D(O),D(G),D(Zt),D($t))};static \u0275cmp=E({type:i,selectors:[["app-modal-sales-detail-summary"]],standalone:!1,decls:5,vars:4,consts:[["Load_Qty",""],[3,"onClose","config"],[1,"p-3"],[4,"ngIf"],[1,"table","table-bordered","table-sm"],[1,"fw-bold"],[4,"ngIf","ngIfElse"],[1,"text-danger"],[3,"click"],[1,"fa-solid","fa-circle-question","cursor","text-primary","fa-lg"],[3,"ngClass"],[1,"text-success",3,"ngClass"]],template:function(e,r){e&1&&(n(0,"modal-material",1),T("onClose",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",2),g(3,gl,75,31,"ng-container",3),d(4,"async"),a()()()),e&2&&(m("config",r.modalConfig),o(3),m("ngIf",C(4,2,r.reportSummary$)))},dependencies:[He,k,ei,Ki,ie,X,J],styles:["table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:first-child{width:110px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(2){text-align:right;width:100px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(3){text-align:right;width:56px}"]})};var fl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],hr=i=>({ID:i});function Cl(i,c){if(i&1){let e=F();n(0,"button",6),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",7),p(2," Export "),a()}}function xl(i,c){if(i&1&&(n(0,"div",4),g(1,Cl,3,0,"button",5),a()),i&2){let e=s();o(),m("ngIf",e.roleService.global.Export)}}function hl(i,c){if(i&1){let e=F();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",12)(11,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",16),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",22),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),I(41,"i",23),a(),n(42,"ng-select",24),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",25),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("model",e.pageData.Filter.Bin),o(3),m("items",e.pageData.Options.Types),x("ngModel",e.pageData.Filter.TypeID),o(3),m("items",e.pageData.Options.Currencies),x("ngModel",e.pageData.Filter.CurrencyID),o(3),m("items",e.pageData.Options.Deliveries),x("ngModel",e.pageData.Filter.DeliveryStateID),o(3),x("ngModel",e.pageData.Filter.PaymentStateID),m("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),x("ngModel",e.pageData.Filter.CreatorID),m("renderThumbnail",!1),o(3),x("model",e.pageData.Filter.NoteVisible),o(4),m("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),x("ngModel",e.pageData.Filter.QueryOption),o(3),x("model",e.pageData.Filter.DefaultFilterColumn),m("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Sl(i,c){i&1&&(n(0,"th",44),p(1," @ Cost "),a())}function yl(i,c){if(i&1&&(n(0,"small",60),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),P(y(2,1,e.CustomerNameDisplay," - {0}"))}}function Dl(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),P(y(2,1,e.SalesName," - Sales: {0}"))}}function vl(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 wl(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 Tl(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 Pl(i,c){i&1&&(n(0,"span"),p(1,"-"),a())}function Fl(i,c){if(i&1&&(se(0),I(1,"div",63),d(2,"newlines"),ce()),i&2){let e=s().$implicit;o(),m("innerHTML",C(2,1,e.SONote),Pe)}}function Il(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,hr,e.ReferenceInvoiceID)),o(),v(" Return ",e.ReferenceInvoiceNumber," ")}}function bl(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 El(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 Ml(i,c){if(i&1&&(n(0,"tr",65)(1,"th",30)(2,"div",66)(3,"span",67),p(4),a(),g(5,bl,2,1,"i",68),I(6,"small",69),a()(),n(7,"th",70),p(8),a(),n(9,"th",71),p(10),d(11,"quantityFraction"),a(),n(12,"th",72),p(13),a(),g(14,El,3,3,"th",73),n(15,"th",74),p(16),d(17,"amountFraction"),a(),n(18,"th",75)(19,"div",76),p(20),a(),n(21,"div",77),p(22),d(23,"amountFraction"),a()(),n(24,"th",74),p(25),d(26,"amountFraction"),a()()),i&2){let e=c.$implicit,r=s(3);o(4),P(e==null?null:e.Name),o(),m("ngIf",(e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName),o(),m("innerHtml",e==null?null:e.Note,Pe),o(2),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",r.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 Vl(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 Bl(i,c){if(i&1&&(n(0,"div")(1,"div",45)(2,"div",46)(3,"div")(4,"a",47)(5,"span",48),p(6),a()(),n(7,"span"),p(8),d(9,"date"),I(10,"small",49),d(11,"date"),g(12,yl,3,4,"small",50),a()(),n(13,"div",51)(14,"strong",52),p(15),g(16,Dl,3,4,"span",3),a(),g(17,vl,3,3,"span",50)(18,wl,2,1,"i",53)(19,Tl,2,1,"span",54)(20,Pl,2,0,"span",3),a(),g(21,Fl,3,3,"ng-container",3)(22,Il,4,4,"ng-container",3),a(),n(23,"div",55),p(24),a()(),n(25,"table",56)(26,"tbody",57),g(27,Ml,27,19,"tr",58),a()(),n(28,"table",59),g(29,Vl,9,5,"ng-container",37),a()()),i&2){let e=c.$implicit,r=s(2);o(4),m("routerLink",b(23,fl))("queryParams",U(24,hr,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",r.isNotEmpty(e.CustomerNameDisplay)),o(3),v(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),m("ngIf",r.isNotEmpty(e.SalesName)),o(),m("ngIf",r.roleService.report.Profit),o(),m("ngIf",r.isNotEmpty(e.DeliveryOutlet)),o(),m("ngIf",r.isNotEmpty(e.PromotionCoupon)),o(),m("ngIf",e.SONote&&e.PromotionCoupon),o(),m("ngIf",r.isNotEmpty(e.SONote)),o(),m("ngIf",r.isNotEmpty(e.ReferenceInvoiceID)),o(2),v(" ",e.PaymentStateLabel," "),o(3),m("ngForOf",e.Items),o(2),m("ngForOf",e.Aggregate)}}function Ol(i,c){if(i&1){let e=F();n(0,"span",83),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",84),p(2,"?"),a()()}}function Ll(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),P(C(2,1,e.listTotal))}}function Rl(i,c){if(i&1){let e=F();n(0,"div",4)(1,"a",85),T("click",function(){u(e);let t=s(2);return t.currentRowCount=100,_(t.NextPage(!0))}),I(2,"i",86),p(3," Next 100"),a()()}}function kl(i,c){if(i&1){let e=F();n(0,"content")(1,"div",26)(2,"div",27)(3,"table",28)(4,"thead",29)(5,"tr")(6,"th",30),p(7,"Name"),a(),n(8,"th",31),p(9,"Code"),a(),n(10,"th",32),p(11,"Qty"),a(),n(12,"th",33),p(13,"UOM"),a(),g(14,Sl,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,Bl,30,26,"div",37),a()()()()(),n(25,"div",38)(26,"button",39),T("click",function(){u(e);let t=s();return _(t.showSummaryReport())}),p(27," View Report Summary "),a()(),n(28,"div",40)(29,"div",41)(30,"div",42),p(31),d(32,"number"),g(33,Ol,3,0,"span",43)(34,Ll,3,3,"span",3),p(35),a()(),g(36,Rl,4,0,"div",2),a()()()}if(i&2){let e=s();o(14),m("ngIf",e.roleService.product.Cost),o(9),jt("colspan",e.roleService.product.Cost?8:7),o(),m("ngForOf",e.infiniteList),o(7),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,r,t,l,f,w,Ee,xt){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,f);this.csvConverter=t;this.datePipe=l;this.activatedRoute=f;this.matDialog=w;this.toaster=Ee;this.roleService=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,M.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),M.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),M.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return M.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(f=>f):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(q,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(vn,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,xl,2,1,"div",2),a(),n(3,"filters"),g(4,hl,46,26,"ng-template",null,0,V),a(),g(6,kl,37,10,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,pe,De,Le,Q,Ye,Yo,gn,ie,ee,X,J],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media (max-width: 992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var Tn=class i{constructor(c,e){this._dialogRef=c;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Ci;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(D(Zt),D($t))};static \u0275cmp=E({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),T("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),S("ngModelChange",function(l){return h(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),S("ngModelChange",function(l){return h(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(m("title","Export Report")("config",r.modalConfig),o(6),x("ngModel",r.ExportPageNumber),o(4),x("ngModel",r.ExportRowCount),m("max",1e4))},dependencies:[ke,B,L,Qe,ei],encapsulation:2})};var Nl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Sr=i=>({ID:i}),Al=()=>["/menu/Contacts/Contact/Customers/Info"],Gl=(i,c,e)=>({"text-success":i,"text-warning":c,"text-danger":e});function Hl(i,c){if(i&1){let e=F();n(0,"button",5),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",6),p(2," Export "),a()}}function Ql(i,c){if(i&1){let e=F();se(0),n(1,"div",19)(2,"div",20)(3,"datepicker",21),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(4,"div",22)(5,"app-timepicker",23),S("timeChange",function(t){u(e);let l=s(2);return h(l.timeFrom,t)||(l.timeFrom=t),_(t)}),T("timeChange",function(t){u(e);let l=s(2);return _(l.timeFromChange(t))}),a()()(),n(6,"div",24)(7,"div",20)(8,"datepicker",25),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(9,"div",22)(10,"app-timepicker",23),S("timeChange",function(t){u(e);let l=s(2);return h(l.timeTo,t)||(l.timeTo=t),_(t)}),T("timeChange",function(t){u(e);let l=s(2);return _(l.timeToChange(t))}),a()()(),ce()}if(i&2){let e=s(2);o(3),x("date",e.pageData.Filter.From),o(2),x("time",e.timeFrom),o(3),x("date",e.pageData.Filter.To),o(2),x("time",e.timeTo)}}function Yl(i,c){if(i&1){let e=F();n(0,"datepicker",26),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a(),n(1,"div",27)(2,"datepicker",28),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterToDate())}),a()()}if(i&2){let e=s(2);x("date",e.pageData.Filter.From),m("appearance","outline")("width",100),o(2),x("date",e.pageData.Filter.To),m("appearance","outline")("width",100)}}function jl(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",12),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),g(18,Ql,11,4,"ng-container",13)(19,Yl,3,6,"ng-template",null,1,V),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(24,"h6"),p(25,"Customer Groups"),a(),n(26,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=Ze(20),r=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",r.pageData.Filter.ListIDs),m("outlets",r.pageData.Options==null?null:r.pageData.Options.Entities),o(3),x("ngModel",r.pageData.Filter.CustomerID),m("inputTextValue",r.pageData.CustomerName),o(3),x("ngModel",r.pageData.Filter.SalesID),o(3),x("ngModel",r.pageData.Filter.SalesOrderTagID),m("items",r.pageData.Options.SalesOrderTags),o(3),m("options",r.pageData.Options.DefaultFilterColumnOptions),x("model",r.pageData.Filter.DefaultFilterColumn),o(3),m("ngIf",r.pageData.Filter.isCreated)("ngIfElse",e),o(5),x("ngModel",r.pageData.Filter.RegisterID),m("items",r.pageData.Options.Registers),o(3),x("ngModel",r.pageData.Filter.CustomerGroupID),m("items",r.pageData.Options.Groups),o(3),x("ngModel",r.pageData.Filter.PaymentState),m("items",r.pageData.Options.States),o(3),x("ngModel",r.pageData.Filter.CreatorID),o(3),m("max",1e4),x("ngModel",r.pageData.Filter.RowCount)}}function ql(i,c){i&1&&(n(0,"th",57),p(1,"DATE"),a())}function Ul(i,c){i&1&&(n(0,"th",58),p(1," CUSTOMER "),a())}function Kl(i,c){i&1&&(n(0,"th",45),p(1,"JOIN DATE"),a())}function zl(i,c){i&1&&(n(0,"th",46),p(1,"GROUPS"),a())}function Xl(i,c){i&1&&(n(0,"th",59),p(1," SALES PERSON "),a())}function Jl(i,c){i&1&&(n(0,"th",60),p(1," COST "),a())}function Zl(i,c){i&1&&(n(0,"th",61),p(1," GROSS "),a())}function $l(i,c){i&1&&(n(0,"th",62),p(1," SALES "),a())}function ep(i,c){i&1&&(n(0,"th",63),p(1," TAX "),a())}function tp(i,c){i&1&&(n(0,"th",64),p(1," SURCHARGE "),a())}function ip(i,c){i&1&&(n(0,"th",65),p(1," TOTAL "),a())}function np(i,c){i&1&&(n(0,"th",66),p(1," PAYMENT "),a())}function ap(i,c){i&1&&I(0,"br")}function op(i,c){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=s().$implicit;o(),P(e.Note)}}function rp(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 lp(i,c){if(i&1&&(n(0,"td")(1,"a",72),p(2),a()()),i&2){let e=s().$implicit;o(),m("routerLink",b(3,Al))("queryParams",U(4,Sr,e.CustomerID)),o(),P(e.CustomerName)}}function pp(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;o(),v(" ",e.JoinDate!=="0001-01-01T00:00:00"?y(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function mp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.Groups," ")}}function sp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.SalesName," ")}}function cp(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.Cost)," ")}}function dp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Gross)," ")}}function up(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function _p(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.Tax)," ")}}function gp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SurchargeAmount)," ")}}function fp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SalesNSurcharge)," ")}}function Cp(i,c){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=s().$implicit;m("ngClass",st(2,Gl,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),v(" ",e.PaymentStateString," ")}}function xp(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",67),p(5),a(),g(6,ap,1,0,"br",4)(7,op,2,1,"i",4),a(),g(8,rp,7,8,"td",4)(9,lp,3,6,"td",4)(10,pp,3,4,"td")(11,mp,2,1,"td")(12,sp,2,1,"td",4)(13,cp,3,3,"td",68)(14,dp,3,3,"td",69)(15,up,3,3,"td",69)(16,_p,3,3,"td",70)(17,gp,3,3,"td",69)(18,fp,3,3,"td",69)(19,Cp,2,6,"td",71),a()),i&2){let e=c.$implicit,r=s(3);o(2),P(e.EntityName),o(2),m("routerLink",b(18,Nl))("queryParams",U(19,Sr,e.ID)),o(),v(" ",e.Number," "),o(),m("ngIf",e.Note),o(),m("ngIf",e.Note),o(),m("ngIf",r.column.Date.selected),o(),m("ngIf",r.column.Customer.selected),o(),Nt(r.column.JoinDate.selected?10:-1),o(),Nt(r.column.Groups.selected?11:-1),o(),m("ngIf",r.column.SalesPerson.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.column.Gross.selected),o(),m("ngIf",r.column.Sales.selected),o(),m("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),m("ngIf",r.data.SurchargeVisible),o(),m("ngIf",r.column.Total.selected),o(),m("ngIf",r.column.Payment.selected)}}function hp(i,c){i&1&&I(0,"td",79)}function Sp(i,c){i&1&&I(0,"td",79)}function yp(i,c){i&1&&I(0,"td",79)}function Dp(i,c){i&1&&(n(0,"td",82),p(1," Total: "),a())}function vp(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,"Cost"))," ")}}function wp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function Tp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Sales"))," ")}}function Pp(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Tax"))," ")}}function Fp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function Ip(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function bp(i,c){if(i&1&&(n(0,"tfoot",77)(1,"tr",78),I(2,"td",79),g(3,hp,1,0,"td",80)(4,Sp,1,0,"td",80)(5,yp,1,0,"td",80)(6,Dp,2,0,"td",81)(7,vp,4,6,"td",68)(8,wp,4,6,"td",69)(9,Tp,4,6,"td",69)(10,Pp,4,6,"td",70)(11,Fp,4,6,"td",69)(12,Ip,4,6,"td",69),a()()),i&2){let e=s(3);o(3),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected)}}function Ep(i,c){if(i&1){let e=F();n(0,"div",38)(1,"table",39),T("matSortChange",function(t){u(e);let l=s(2);return _(l.sortData(t))}),n(2,"thead",40)(3,"tr")(4,"th",41),p(5,"OUTLET"),a(),n(6,"th",42),p(7,"NUMBER"),a(),g(8,ql,2,0,"th",43)(9,Ul,2,0,"th",44)(10,Kl,2,0,"th",45)(11,zl,2,0,"th",46)(12,Xl,2,0,"th",47)(13,Jl,2,0,"th",48)(14,Zl,2,0,"th",49)(15,$l,2,0,"th",50)(16,ep,2,0,"th",51)(17,tp,2,0,"th",52)(18,ip,2,0,"th",53)(19,np,2,0,"th",54),a()(),n(20,"tbody"),g(21,xp,20,21,"tr",55),a(),g(22,bp,13,10,"tfoot",56),a()()}if(i&2){let e=s(2);o(8),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),Nt(e.column.JoinDate.selected?10:-1),o(),Nt(e.column.Groups.selected?11:-1),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected),o(),m("ngIf",e.column.Payment.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data)}}function Mp(i,c){if(i&1){let e=F();n(0,"span",83),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",84),p(2,"?"),a()()}}function Vp(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),P(C(2,1,e.listTotal))}}function Bp(i,c){if(i&1){let e=F();n(0,"a",85),T("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),I(1,"i",86),p(2," Next"),a()}}function Op(i,c){if(i&1){let e=F();n(0,"a",87),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),I(1,"i",88),p(2," Last"),a()}}function Lp(i,c){if(i&1&&(n(0,"content")(1,"div",29),g(2,Ep,23,14,"div",30),n(3,"div",31)(4,"div",32)(5,"div",33),p(6),d(7,"number"),g(8,Mp,3,0,"span",34)(9,Vp,3,3,"span",4),p(10),a()(),n(11,"div",35),g(12,Bp,3,0,"a",36)(13,Op,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,r,t,l,f){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=f}roleService=Ge(G);columnService=Ge(vt);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>M.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(Tn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,l.CustomerName=l.CustomerName==null?"":l.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,l.SalesName=l.SalesName==null?"":l.SalesName,e.active){case"outlet":return this.compare(t.EntityName?.toLowerCase(),l.EntityName?.toLowerCase(),f);case"number":return this.compare(t.Number,l.Number,f);case"date":return this.compare(t.Date,l.Date,f);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),f);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),f);case"cost":return this.compare(t.Cost,l.Cost,f);case"gross":return this.compare(t.Gross,l.Gross,f);case"sales":return this.compare(t.Sales,l.Sales,f);case"tax":return this.compare(t.Tax,l.Tax,f);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,f);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,f);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,f);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,f);case"groups":return this.compare(t.Groups,l.Groups,f);default:return 0}})}openExportModal(){this._matDialog.open(q,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=M.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=M.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");M.IsNotEmpty(r)&&(this.pageData.Filter.From=M.MinDate,this.pageData.Filter.To=M.MinDate),(e.From=="01010001"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(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 forders",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","outlet",2,"width","100px"],["mat-sort-header","number"],["mat-sort-header","date",4,"ngIf"],["mat-sort-header","customer",4,"ngIf"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson",4,"ngIf"],["mat-sort-header","cost","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","gross","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","sales","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","tax","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","surcharge","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","total","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","payment","style","width: 50px",4,"ngIf"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","date"],["mat-sort-header","customer"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["mat-sort-header","total","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],["target","_blank",3,"routerLink","queryParams"],["class","text-end text-danger",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-start",3,"ngClass",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-start",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],["class","empty-column",4,"ngIf"],["class","text-end empty-column",4,"ngIf"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",2),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Hl,3,0,"button",3),a(),n(3,"filters"),g(4,jl,36,22,"ng-template",null,0,V),a(),g(6,Lp,14,9,"content",4),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,De,Le,yi,Q,Ye,oe,ie,ee,X],encapsulation:2})};var Rp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],kp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],Wp=()=>["/menu/Products/Setup/Brand/Brand_Form"],Np=i=>({ID:i}),Ap=(i,c)=>({BrandID:i,Name:c});function Gp(i,c){if(i&1){let e=F();n(0,"button",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export"),a()}}function Hp(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Qp(i,c){i&1&&(n(0,"th",24),p(1,"Code"),a())}function Yp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),P(e.Code)}}function jp(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",25),p(3),a()(),g(4,Yp,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,Wp))("queryParams",U(12,Np,e.ID)),o(),v("",e.BrandName," "),o(),m("ngIf",e.Countcode>0),o(2),m("queryParams",de(14,Ap,e.ID,e.BrandName)),o(),P(C(8,7,e.Quantity)),o(3),P(C(11,9,e.Total))}}function qp(i,c){if(i&1){let e=F();n(0,"div",15)(1,"table",16),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"Brand"),a(),g(6,Qp,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,jp,12,17,"tr",22),a(),n(13,"tfoot")(14,"tr",23)(15,"td"),p(16,"Total"),a(),n(17,"td"),p(18),d(19,"sum"),d(20,"quantityFraction"),a(),n(21,"td"),p(22),d(23,"sum"),d(24,"amountFraction"),a()()()()()}if(i&2){let e=s();o(6),m("ngIf",e.data.Countcode>0),o(6),m("ngForOf",e.data.Data),o(6),P(C(20,7,y(19,4,e.data.Data,"Quantity"))),o(4),P(C(24,12,y(23,9,e.data.Data,"Total")))}}var Fn=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=f;this.matDialog=w}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,f);case"Code":return this.compare(t.Code,l.Code,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Gp,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,Hp,9,6,"ng-template",null,0,V),a(),n(16,"content"),g(17,qp,25,14,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(8,Rp)),o(3),m("routerLink",b(9,kp)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,pe,ae,ge,Q,oe,X,J],encapsulation:2})};function Up(i,c){if(i&1){let e=F();n(0,"label",3),T("click",function(){let t=u(e).$implicit,l=s();return _(l.updateSelectedGroups(t.ID))}),I(1,"input",4),n(2,"span"),p(3),a()()}if(i&2){let e=c.$implicit,r=s();o(),m("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),P(e.Name)}}var In=class i{constructor(c,e){this.dialogRef=c;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(c){let e=this.IDGroups.indexOf(c);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(c)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(D(Zt),D($t))};static \u0275cmp=E({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:4,vars:2,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),T("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),g(3,Up,4,3,"label",2),a()()()),e&2&&(m("title","Edit Groups"),o(3),m("ngForOf",r.options))},dependencies:[Y,ei],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var Kp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],zp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Xp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Jp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Zp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],$p=()=>["/menu/Contacts/Contact/Customers/Info"],em=i=>({ID:i});function tm(i,c){if(i&1){let e=F();n(0,"button",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function im(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function nm(i,c){i&1&&(n(0,"th",31),p(1," ORDERS "),a())}function am(i,c){i&1&&(n(0,"th",32),p(1," QTY "),a())}function om(i,c){i&1&&(se(0),n(1,"th",33),p(2," COST "),a(),ce())}function rm(i,c){i&1&&(n(0,"th",34),p(1," SALES "),a())}function lm(i,c){i&1&&(n(0,"th",35),p(1," TAX "),a())}function pm(i,c){i&1&&(n(0,"th",36),p(1," SALES + TAX "),a())}function mm(i,c){if(i&1){let e=F();n(0,"span")(1,"span"),p(2),a(),n(3,"a",45),T("click",function(){u(e);let t=s(2).$implicit,l=s(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=c.$implicit,r=c.index;o(2),P(r==0?"":" , "),o(2),P(e.GroupName)}}function sm(i,c){if(i&1&&(n(0,"span"),g(1,mm,5,2,"span",38),a()),i&2){let e=s().$implicit;o(),m("ngForOf",e.Groups)}}function cm(i,c){if(i&1){let e=F();n(0,"a",45),T("click",function(){u(e);let t=s().$implicit,l=s(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function dm(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 um(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 _m(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 gm(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 fm(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 Cm(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 xm(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",39),p(3),a(),n(4,"div",40),g(5,sm,2,1,"span",25)(6,cm,2,0,"a",41),a()(),n(7,"td")(8,"span",42),p(9),a()(),g(10,dm,3,3,"td",43)(11,um,3,3,"td",43)(12,_m,4,3,"ng-container",25)(13,gm,3,3,"td",43)(14,fm,3,3,"td",44)(15,Cm,3,3,"td",43),a()),i&2){let e=c.$implicit,r=s(3);o(2),m("routerLink",b(13,$p))("queryParams",U(14,em,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",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),v("",e.Code," "),o(),m("ngIf",r.column.Orders.selected),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.column.Sales.selected),o(),m("ngIf",r.column.Tax.selected),o(),m("ngIf",r.column.SalesNTax.selected)}}function hm(i,c){if(i&1&&(n(0,"tbody",37),g(1,xm,16,16,"tr",38),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function Sm(i,c){if(i&1){let e=F();n(0,"div",17)(1,"div",18)(2,"table",19),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",20)(4,"tr")(5,"th",21),p(6,"CUSTOMER"),a(),n(7,"th",22),p(8," CODE "),a(),g(9,nm,2,0,"th",23)(10,am,2,0,"th",24)(11,om,3,0,"ng-container",25)(12,rm,2,0,"th",26)(13,lm,2,0,"th",27)(14,pm,2,0,"th",28),a()(),g(15,hm,2,1,"tbody",29),a()(),n(16,"infinite-pagination",30),T("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=s();o(9),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.column.Tax.selected),o(),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.data.Data),o(),m("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var bn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=f}roleService=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=M.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(Rt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Code":return this.compare(t.Code,l.Code,f);case"Orders":return this.compare(t.Orders,l.Orders,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,f);case"Cost":return this.compare(t.Cost,l.Cost,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(In,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let f={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",f).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(q,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,tm,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," By Age "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),I(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),g(24,im,16,10,"ng-template",null,0,V),a(),n(26,"content"),g(27,Sm,17,13,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(12,Kp)),o(3),m("routerLink",b(13,zp)),o(3),m("routerLink",b(14,Xp)),o(3),m("routerLink",b(15,Jp)),o(4),m("routerLink",b(16,Zp)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,Q,ii,ie,X,J],encapsulation:2})};var ym=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Dm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],vm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],wm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Tm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Pm(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function Fm(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Im(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),P(C(5,4,e.TotalOrders)),o(3),P(C(8,6,e.TotalCost)),o(3),P(C(11,8,e.TotalAmount))}}function bm(i,c){if(i&1&&(n(0,"tbody",24),g(1,Im,12,10,"tr",25),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function Em(i,c){if(i&1){let e=F();n(0,"div",16)(1,"table",17),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"AGE"),a(),n(6,"th",20),p(7," ORDERS"),a(),n(8,"th",21),p(9," COST"),a(),n(10,"th",22),p(11," AMOUNT"),a()()(),g(12,bm,2,1,"tbody",23),a()()}if(i&2){let e=s();o(12),m("ngIf",e.data.Data)}}var En=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.datePipe=w}preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,f);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,f);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,f);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(q,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Pm,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,Fm,13,8,"ng-template",null,0,V),a(),n(25,"content"),g(26,Em,13,1,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(11,ym)),o(3),m("routerLink",b(12,Dm)),o(3),m("routerLink",b(13,vm)),o(3),m("routerLink",b(14,wm)),o(3),m("routerLink",b(15,Tm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,Q,ie,X],encapsulation:2})};var Mm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Vm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Bm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Om=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Lm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Rm(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function km(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Wm(i,c){i&1&&(n(0,"th",25),p(1," ORDERS"),a())}function Nm(i,c){i&1&&(n(0,"th",26),p(1," QUANTITY"),a())}function Am(i,c){i&1&&(n(0,"th",27),p(1," AMOUNT"),a())}function Gm(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.TotalOrders))}}function Hm(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 Qm(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.TotalAmount))}}function Ym(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),g(3,Gm,3,3,"td",28)(4,Hm,3,3,"td",28)(5,Qm,3,3,"td",29),a()),i&2){let e=c.$implicit,r=s(2);o(2),v(" ",e.Name," "),o(),m("ngIf",r.column.Orders.selected),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.column.Amount.selected)}}function jm(i,c){if(i&1){let e=F();n(0,"div",16)(1,"table",17),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"GENDER"),a(),g(6,Wm,2,0,"th",20)(7,Nm,2,0,"th",21)(8,Am,2,0,"th",22),a()(),n(9,"tbody",23),g(10,Ym,6,4,"tr",24),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Amount.selected),o(2),m("ngForOf",e.data==null?null:e.data.Data)}}var Mn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=f}roleService=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(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,f);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,f);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,f);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,f);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(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(r){return new(r||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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Rm,3,0,"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,km,13,8,"ng-template",null,0,V),a(),n(25,"content"),g(26,jm,11,4,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Mm)),o(3),m("routerLink",b(13,Vm)),o(3),m("routerLink",b(14,Bm)),o(3),m("routerLink",b(15,Om)),o(3),m("routerLink",b(16,Lm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,Q,ie,X,J],encapsulation:2})};var Dr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],qm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Um=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Km=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],zm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Xm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Jm=()=>["/menu/Contacts/Contact/Suppliers/Info"],Zm=i=>({ID:i}),$m=(i,c,e)=>({From:i,SupplierID:c,To:e});function es(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function ts(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function is(i,c){if(i&1&&(n(0,"tr",26)(1,"td"),p(2),a(),n(3,"td",27)(4,"a",28),p(5),a()(),n(6,"td",29),p(7),a(),n(8,"td",30),p(9),d(10,"quantityFraction"),a(),n(11,"td",29)(12,"a",28),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=c.$implicit,r=s(2);o(2),P(e.Rank),o(2),m("routerLink",b(19,Jm))("queryParams",U(20,Zm,e.SupplierID)),o(),P(e.Name),o(2),P(e.Code),o(2),v(" ",C(10,9,e.Quantity)," "),o(3),m("routerLink",b(22,Dr))("queryParams",st(23,$m,y(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,y(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),v(" ",C(16,17,e.Total),"")}}function ns(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",31),I(2,"th",32),n(3,"th",29),p(4,"Total Quantity"),a(),n(5,"th",29),p(6,"Total Sales"),a()(),n(7,"tr"),I(8,"td",33),n(9,"td",29),p(10),a(),n(11,"td",29),p(12),a()()()),i&2){let e=s(2);o(10),P(e.data.TotalQty),o(2),P(e.data.TotalSales)}}function as(i,c){if(i&1){let e=F();n(0,"div",17)(1,"table",18),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"RANK"),a(),n(6,"th",21),p(7,"SUPPLIER"),a(),n(8,"th",22),p(9," CODE "),a(),n(10,"th",23),p(11," QUANTITY "),a(),n(12,"th",24),p(13," TOTAL "),a()()(),n(14,"tbody"),g(15,is,17,27,"tr",25),a(),g(16,ns,13,2,"tfoot"),a()()}if(i&2){let e=s();o(15),m("ngForOf",e.data.Data),o(),Nt((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?16:-1)}}var Vn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,f);case"Supplier":return this.compare(t.Name,l.Name,f);case"Code":return this.compare(t.Code,l.Code,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,es,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,ts,16,10,"ng-template",null,0,V),a(),n(28,"content"),g(29,as,17,2,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Dr)),o(3),m("routerLink",b(13,qm)),o(3),m("routerLink",b(14,Um)),o(3),m("routerLink",b(15,Km)),o(3),m("routerLink",b(16,zm)),o(3),m("routerLink",b(17,Xm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,ae,ge,Qe,Q,ee,X,J],encapsulation:2})};var vr=Qt(Oi());var rs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],ls=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],ps=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],ms=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ss=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],cs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],ds=(i,c,e,r,t)=>({From:i,To:c,ListIDs:e,ListVariantID:r,GroupByVariant:t}),us=i=>[i],_s=i=>({ID:i}),gs=(i,c,e,r,t,l)=>({ID:i,From:c,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),wr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],fs=(i,c,e)=>({VariantID:i,From:c,To:e}),Cs=(i,c,e)=>({ProductID:i,From:c,To:e});function xs(i,c){if(i&1&&(n(0,"a",9),I(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=s();m("queryParams",qi(1,ds,(e=r.queryParams())==null?null:e.From,(e=r.queryParams())==null?null:e.To,(e=r.queryParams())==null?null:e.ListIDs,(e=r.queryParams())==null?null:e.ListVariantID,(e=r.queryParams())==null?null:e.GroupByVariant))}}function hs(i,c){if(i&1){let e=F();n(0,"button",11),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",12),p(2," Export "),a()}}function Ss(i,c){if(i&1){let e=F();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(15,"h6"),p(16,"Product Tag"),a(),n(17,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(18,"h6"),p(19,"Sales Person"),a(),n(20,"sales-person-selector",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(27,"h6"),p(28,"Logistics Service"),a(),n(29,"ng-select",24),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(33,"h6"),p(34,"Customer Group"),a(),n(35,"ng-select",26),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Product Type"),a(),n(41,"radio-options",28),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(42,"h6"),p(43,"Multiply Unit Quantity"),a(),n(44,"radio-options",29),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),x("date",e.pageData.Filter.From),m("showClearBtn",!0)("showTodayBtn",!0),o(2),x("date",e.pageData.Filter.To),m("showClearBtn",!0)("showTodayBtn",!0),o(3),m("multiple",!0)("multiple",!0),x("ngModel",e.pageData.Filter.BrandIDs),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Tags),x("ngModel",e.pageData.Filter.TagID),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),x("ngModel",e.pageData.Filter.LogisticsServiceID),m("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),x("ngModel",e.pageData.Filter.SupplierID),m("inputTextValue",e.pageData.supplierName),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("model",e.pageData.Filter.ProductType),m("options",e.pageData.Options.ProductTypes),o(3),x("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function ys(i,c){if(i&1){let e=F();n(0,"th",48)(1,"div",49)(2,"input",50),T("change",function(t){u(e);let l=s(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=s(2);o(2),m("checked",e.isAllCheckBoxChecked())}}function Ds(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 vs(i,c){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function ws(i,c){i&1&&(n(0,"th",53),p(1," Cost "),a())}function Ts(i,c){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function Ps(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 Fs(i,c){i&1&&(n(0,"th",56),p(1," Tax "),a())}function Is(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 bs(i,c){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function Es(i,c){i&1&&(n(0,"th",59),p(1," % "),a())}function Ms(i,c){if(i&1){let e=F();n(0,"td")(1,"div",49)(2,"input",71),S("ngModelChange",function(t){u(e);let l=s().$implicit;return h(l.checked,t)||(l.checked=t),_(t)}),T("ngModelChange",function(){u(e);let t=s(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=s().$implicit;o(2),m("value",e.ID),x("ngModel",e.checked)}}function Vs(i,c){if(i&1){let e=F();se(0),n(1,"img",72),T("click",function(t){u(e);let l=s().$implicit,f=s(2);return _(f.openBigPicture(l==null?null:l.ImageURL,t))}),a(),ce()}if(i&2){let e=s().$implicit;o(),m("src",e.ThumbnailUrl,Hi)}}function Bs(i,c){if(i&1){let e=F();n(0,"a",73)(1,"img",74),T("click",function(t){u(e);let l=s().$implicit,f=s(2);return _(f.openBigPicture(l,t))}),a()()}if(i&2){let e=s(3);m("target",e.pageData.LinkTarget)}}function Os(i,c){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=s().$implicit,t=s(2);o(),m("queryParams",ho(4,gs,r.ID,(e=t.queryParams())==null?null:e.From,(e=t.queryParams())==null?null:e.To,(e=t.queryParams())==null?null:e.ListIDs,(e=t.queryParams())==null?null:e.ListVariantID,(e=t.queryParams())==null?null:e.GroupByVariant)),o(),P(C(3,2,r.Quantity))}}function 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.OnHand)," ")}}function Rs(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 ks(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 Ws(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,r=s(2);m("routerLink",b(11,wr))("queryParams",st(12,fs,e.ID,y(1,3,r.pageData.Filter.From,"ddMMyyyy"),y(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),P(C(4,9,e.Sales))}}function Ns(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,r=s(2);m("routerLink",b(11,wr))("queryParams",st(12,Cs,e.ID,y(1,3,r.pageData.Filter.From,"ddMMyyyy"),y(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),P(C(4,9,e.Sales))}}function As(i,c){if(i&1&&(n(0,"td",75),g(1,Ws,5,16,"a",78)(2,Ns,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 Gs(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 Hs(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 Qs(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 Ys(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 js(i,c){if(i&1&&(n(0,"tr",60),g(1,Ms,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),g(7,Vs,2,1,"ng-container",8)(8,Bs,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),g(14,Os,4,11,"td",67)(15,Ls,3,3,"td",67)(16,Rs,3,3,"td",68)(17,ks,3,3,"td",67)(18,As,3,2,"td",67)(19,Gs,3,3,"td",69)(20,Hs,3,3,"td",67)(21,Qs,3,4,"td",70)(22,Ys,3,4,"td",70),a()),i&2){let e=c.$implicit,r=c.index,t=s(2);o(),m("ngIf",t.column.CompareQtySold.selected),o(2),P(r+1),o(4),m("ngIf",e.ImageURL),o(),m("ngIf",!e.ImageURL),o(2),m("routerLink",U(17,us,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(19,_s,e.ID)),o(),P(e.Name),o(2),P(e.Code),o(),m("ngIf",t.column.QTY.selected),o(),m("ngIf",t.column.OnHand.selected),o(),m("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function qs(i,c){i&1&&I(0,"td",75)}function Us(i,c){i&1&&(n(0,"td",75),p(1," Total : "),a())}function Ks(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 zs(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 Xs(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 Js(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 Zs(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),P(C(4,4,y(3,1,e.infiniteList,"Sales")))}}function $s(i,c){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),P(C(4,4,y(3,1,e.infiniteList,"Tax")))}}function e0(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),P(C(4,4,y(3,1,e.infiniteList,"SalesNTax")))}}function t0(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 i0(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 n0(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",81),I(2,"td",75),g(3,qs,1,0,"td",67)(4,Us,2,0,"td",67)(5,Ks,4,6,"td",67)(6,zs,4,6,"td",67)(7,Xs,4,6,"td",68)(8,Js,4,6,"td",67)(9,Zs,5,6,"td",82)(10,$s,5,6,"td",69)(11,e0,5,6,"td",82)(12,t0,5,10,"td",70)(13,i0,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 a0(i,c){if(i&1){let e=F();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",33)(5,"tr"),g(6,ys,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),g(11,Ds,2,1,"th",37)(12,vs,2,0,"th",38)(13,ws,2,0,"th",39)(14,Ts,2,0,"th",40)(15,Ps,2,1,"th",41)(16,Fs,2,0,"th",42)(17,Is,2,1,"th",43)(18,bs,2,0,"th",44)(19,Es,2,0,"th",45),a()(),n(20,"tbody"),g(21,js,23,21,"tr",46),a(),g(22,n0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),T("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.CompareQtySold.selected),o(5),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.OnHand.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data),o(),m("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Bn=class i extends he{constructor(e,r,t,l,f,w,Ee){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,f);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=f;this.matDialog=w;this.bigPicture=Ee}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=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=mt([]);queryParams=mt(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=et(Je({},this.data),{Data:e.Data.map(t=>et(Je({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=et(Je({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=et(Je({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>et(Je({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;M.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,Bi.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=et(Je({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return M.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Code":return M.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),f);case"Brand":return M.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),f);case"Quantity":return M.compare(t.Quantity,l.Quantity,f);case"Total_Cost":return M.compare(t.UnitCost,l.UnitCost,f);case"Inventory":return M.compare(t.OnHand,l.OnHand,f);case"Total_Sales":return M.compare(t.Total,l.Total,f);case"Total_Tax":return M.compare(t.Tax,l.Tax,f);case"Total_Tax_Sales":return M.compare(t.SalesNTax,l.SalesNTax,f);case"ReOrder":return M.compare(t.MinStock,l.MinStock,f);case"Gross":return M.compare(t.Gross,l.Gross,f);case"Margin":return M.compare(t.Margin,l.Margin,f);case"Profit":return M.compare(t.Profit,l.Profit,f);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,vr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Ke),D(Oe),D(j),D(Dn))};static \u0275cmp=E({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[R],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,xs,3,7,"a",2)(3,hs,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,Ss,45,36,"ng-template",null,0,V),a(),g(29,a0,24,18,"content",8),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.isAnyItemChecked),o(),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,rs)),o(3),m("routerLink",b(15,ls)),o(3),m("routerLink",b(16,ps)),o(3),m("routerLink",b(17,ms)),o(3),m("routerLink",b(18,ss)),o(3),m("routerLink",b(19,cs)),o(5),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,Po,B,L,pe,ae,ge,De,Le,fe,Q,Ye,ii,oe,ee,X,J],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var o0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],r0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],l0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],p0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],m0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],s0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],c0=i=>({ID:i});function d0(i,c){if(i&1){let e=F();n(0,"a",15),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",16),p(2," Export "),a()}}function u0(i,c){if(i&1){let e=F();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales"),a(),n(6,"sales-person-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Category"),a(),n(9,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(10,"h6"),p(11,"Brand"),a(),n(12,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(13,"h6"),p(14,"Supplier"),a(),n(15,"autocompleteV2",22),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",23),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(20,"div",24)(21,"datepicker",25),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(22,"h6"),p(23,"Scope"),a(),n(24,"radio-options",26),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function _0(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e,r=c.$implicit;dt("matTooltip",r.Name),o(),v(" ",(e=r.Code)!==null&&e!==void 0?e:r.Name," ")}}function g0(i,c){if(i&1&&(n(0,"td",13),p(1),a()),i&2){let e=c.$implicit;o(),v(" ",e," ")}}function f0(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,g0,2,1,"td",31),n(7,"td",13),p(8),a()()),i&2){let e=c.$implicit,r=s();o(2),m("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",U(6,c0,e.ID)),o(),v(" ",e.Name,""),o(2),P(e.Code),o(),m("ngForOf",e.Quantities),o(2),P(e.Total)}}var On=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,d0,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,u0,25,14,"ng-template",null,0,V),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),n(35,"th",11),p(36,"Code"),a(),g(37,_0,2,2,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,f0,9,8,"tr",14),a()()()()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(13,o0)),o(3),m("routerLink",b(14,r0)),o(3),m("routerLink",b(15,l0)),o(3),m("routerLink",b(16,p0)),o(3),m("routerLink",b(17,m0)),o(3),m("routerLink",b(18,s0)),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 C0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],x0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],h0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],S0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],y0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],D0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],v0=i=>[i],w0=i=>({ID:i});function T0(i,c){if(i&1){let e=F();n(0,"a",16),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",17),p(2," Export"),a()}}function P0(i,c){if(i&1){let e=F();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Compare Month From"),a(),n(9,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a(),n(10,"h6"),p(11,"Compare Month To"),a(),n(12,"ng-select",22),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MonthTo,t)||(l.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 l=s();return h(l.pageData.Filter.Year,t)||(l.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 l=s();return h(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.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 F0(i,c){if(i&1&&(n(0,"th",25),p(1),a()),i&2){let e=c.$implicit,r=s();o(),v(" ",r.months[e.Month-1].ColumnLabel," ")}}function I0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,r=s().$implicit,t=s();o(),v(" ",t.findKey(r.Sold,e.Month)?y(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):""," ")}}function b0(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,I0,3,4,"td",28),n(7,"td",29),p(8),d(9,"sum"),d(10,"number"),a()()),i&2){let e=c.$implicit,r=s();o(2),m("routerLink",U(12,v0,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(14,w0,e.ID)),o(),v(" ",e.Name," "),o(2),P(e.Code),o(),m("ngForOf",r.data==null?null:r.data.MonthlySales),o(2),v(" ",y(10,9,y(9,6,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function E0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,r=s(2);o(),v(" ",y(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function M0(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",30),I(2,"td")(3,"td"),g(4,E0,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,r,t,l,f){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}years=M.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),f);default:return 0}})}static \u0275fac=function(r){return new(r||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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,T0,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,P0,19,14,"ng-template",null,0,V),a(),n(28,"content")(29,"div",7)(30,"table",8),T("matSortChange",function(w){return u(l),_(t.sortData(w))}),n(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),n(35,"th",11),p(36,"Code"),a(),g(37,F0,2,1,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,b0,11,16,"tr",14),a(),g(42,M0,9,8,"tfoot",15),a()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(14,C0)),o(3),m("routerLink",b(15,x0)),o(3),m("routerLink",b(16,h0)),o(3),m("routerLink",b(17,S0)),o(3),m("routerLink",b(18,y0)),o(3),m("routerLink",b(19,D0)),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 V0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],B0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],O0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],L0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],R0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],k0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],W0=i=>[i],N0=i=>({ID:i});function A0(i,c){if(i&1){let e=F();n(0,"button",16),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",17),p(2," Export"),a()}}function G0(i,c){if(i&1){let e=F();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",21),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",22)(12,"datepicker",23),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",24),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function H0(i,c){if(i&1&&(n(0,"th",26),p(1),a()),i&2){let e=c.$implicit;o(),P(e)}}function Q0(i,c){if(i&1&&(n(0,"tr"),I(1,"th")(2,"th"),g(3,H0,2,1,"th",25),a()),i&2){let e=s();o(3),m("ngForOf",e.data==null?null:e.data.Outlet)}}function Y0(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e=c.$implicit;o(),v(" ",e,"")}}function j0(i,c){if(i&1&&(se(0),n(1,"a",29),p(2),a(),ce()),i&2){let e=s().$implicit,r=s().$implicit,t=s();o(),m("routerLink",U(3,W0,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",U(5,N0,r[1])),o(),P(r[e])}}function q0(i,c){if(i&1&&p(0),i&2){let e=s().$implicit,r=s().$implicit;v(" ",r[e]," ")}}function U0(i,c){if(i&1&&(n(0,"td",13),g(1,j0,3,7,"ng-container",28)(2,q0,1,1,"ng-template",null,1,V),a()),i&2){let e=c.index,r=Ze(3);o(),m("ngIf",e===0)("ngIfElse",r)}}function K0(i,c){if(i&1&&(n(0,"tr",13),g(1,U0,4,2,"td",15),a()),i&2){let e=c.$implicit,r=s();o(),m("ngForOf",r.getFilteredKeys(e))}}var Rn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",2),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,A0,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,G0,16,10,"ng-template",null,0,V),a(),n(28,"content")(29,"div",8)(30,"table",9)(31,"thead",10),g(32,Q0,4,1,"tr",11),n(33,"tr")(34,"th",12),p(35,"Name"),a(),n(36,"th",13),p(37,"Code"),a(),g(38,Y0,2,1,"th",14),a()(),n(39,"tbody"),g(40,K0,2,1,"tr",15),a()()()()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,V0)),o(3),m("routerLink",b(15,B0)),o(3),m("routerLink",b(16,O0)),o(3),m("routerLink",b(17,L0)),o(3),m("routerLink",b(18,R0)),o(3),m("routerLink",b(19,k0)),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 z0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],X0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],J0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],Z0=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),Tr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],$0=(i,c,e)=>({CategoryID:i,From:c,To:e}),ec=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],Pr=i=>({CategoryID:i});function tc(i,c){if(i&1){let e=F();n(0,"button",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function ic(i,c){if(i&1&&(n(0,"span",22),p(1),a()),i&2){let e=c.item;dt("matTooltip",e.Value),o(),P(e.Value)}}function nc(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),g(10,ic,2,2,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(26,"h6"),p(27,"Hide Zero & Negative"),a(),n(28,"radio-options",21),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(5),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("ngModel",e.pageData.Filter.CalculationDiscount),m("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),x("model",e.pageData.Filter.ExcludeZero)}}function ac(i,c){i&1&&(n(0,"th",42),p(1," Cost "),I(2,"p-treeTableSortIcon",43),a())}function oc(i,c){i&1&&(n(0,"th",44),p(1," Profit "),I(2,"p-treeTableSortIcon",45),a())}function rc(i,c){i&1&&(n(0,"th",46),p(1," % "),I(2,"p-treeTableSortIcon",47),a())}function lc(i,c){if(i&1&&(n(0,"tr",28)(1,"th",29),p(2," Category "),I(3,"p-treeTableSortIcon",30),a(),n(4,"th",31),p(5," Qty "),I(6,"p-treeTableSortIcon",32),a(),g(7,ac,3,0,"th",33),n(8,"th",34),p(9," Gross "),I(10,"p-treeTableSortIcon",35),a(),n(11,"th",36),p(12," Disc "),I(13,"p-treeTableSortIcon",37),a(),n(14,"th",38),p(15," Sales "),I(16,"p-treeTableSortIcon",39),a(),g(17,oc,3,0,"th",40)(18,rc,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 pc(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),P(C(5,6,e.DisplayedCost))}}function mc(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),P(C(5,6,e.DisplayedProfit))}}function sc(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 cc(i,c){if(i&1&&(n(0,"td"),g(1,sc,5,10,"span",58),a()),i&2){let e=s(3);o(),m("ngIf",e.roleService.report.Profit)}}function dc(i,c){if(i&1&&(n(0,"tr",48)(1,"td"),I(2,"p-treeTableToggler",49),n(3,"a",50),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",22),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),g(13,pc,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,mc,6,8,"td",55)(34,cc,2,1,"td",7),a()),i&2){let e=c.$implicit,r=c.rowData,t=s(2);m("ttRow",e),o(2),m("rowNode",e),o(),m("routerLink",b(50,Tr))("queryParams",st(51,$0,r.ID,y(4,20,t.pageData.Filter.From,"yyyy-MM-dd"),y(5,23,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),P(r.Name),o(2),dt("matTooltip",r.QuantityIndirect&&r.Quantity?"Direct ("+C(9,26,r.Quantity)+") Indirect ("+C(10,28,r.QuantityIndirect)+")":""),o(3),P(C(12,30,r.DisplayedQuantity)),o(2),m("ngIf",t.roleService.product.Cost),o(2),dt("matTooltip",r.GrossIndirect&&r.GrossSales?"Direct ("+C(16,32,r.GrossSales)+") Indirect ("+C(17,34,r.GrossIndirect)+")":""),o(3),P(C(19,36,r.DisplayedGross)),o(3),dt("matTooltip",r.DiscountIndirect&&r.Discount?"Direct ("+C(22,38,r.Discount)+") Indirect ("+C(23,40,r.DiscountIndirect)+")":""),m("routerLink",b(55,ec))("queryParams",U(56,Pr,r.ID)),o(3),P(C(25,42,r.DisplayedTotalDiscount)),o(3),dt("matTooltip",r.NetSalesIndirect&&r.Sales?"Direct ("+C(28,44,r.Sales)+") Indirect ("+C(29,46,r.NetSalesIndirect)+")":""),o(3),m("routerLink",b(58,Tr))("queryParams",U(59,Pr,r.ID)),o(),P(C(32,48,r.DisplayedNetSales)),o(2),m("ngIf",t.roleService.report.Profit),o(),m("ngIf",t.roleService.report.Profit)}}function uc(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 _c(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 gc(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 fc(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,uc,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,_c,3,3,"td",61)(18,gc,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),P(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 Cc(i,c){if(i&1&&(n(0,"content")(1,"div",23)(2,"p-treeTable",24),g(3,lc,19,3,"ng-template",25)(4,dc,35,61,"ng-template",26)(5,fc,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,Z0))}}var kn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,tc,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,nc,29,15,"ng-template",null,0,V),a(),g(19,Cc,6,5,"content",7),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(10,z0)),o(3),m("routerLink",b(11,X0)),o(3),m("routerLink",b(12,J0)),o(5),m("ngIf",t.data))},dependencies:[N,k,A,z,K,B,L,pe,De,Le,er,Eo,ar,tr,ir,nr,fe,Q,Ye,un,ie,ee,X,J],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var xc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],hc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Sc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function yc(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function Dc(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.CustomerID)}}function vc(i,c){if(i&1&&(n(0,"th",23),p(1),a()),i&2){let e=c.$implicit;m("mat-sort-header",e),o(),P(e)}}function wc(i,c){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=s().$implicit;o(),P(e.Value)}}function Tc(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.Value))}}function Pc(i,c){if(i&1&&(n(0,"td"),g(1,wc,2,1,"span",22)(2,Tc,3,3,"span",22),a()),i&2){let e=c.$implicit;o(),m("ngIf",e.Key=="Category"),o(),m("ngIf",e.Key!="Category")}}function Fc(i,c){if(i&1&&(n(0,"tr"),g(1,Pc,3,2,"td",21),a()),i&2){let e=c.$implicit;o(),m("ngForOf",e)}}function Ic(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 bc(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",24)(2,"td"),p(3,"Total : "),a(),g(4,Ic,3,3,"td",21),a()()),i&2){let e=s(2);o(4),m("ngForOf",e.data.Sum)}}function Ec(i,c){if(i&1){let e=F();n(0,"div",17)(1,"table",18),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr"),g(4,vc,2,2,"th",20),a()(),n(5,"tbody"),g(6,Fc,2,1,"tr",21),a(),g(7,bc,5,1,"tfoot",22),a()()}if(i&2){let e=s();o(4),m("ngForOf",e.data.Dataheader),o(2),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0)}}var Wn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}openExportModal(){this.matDialog.open(q,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";for(let w=0;w<this.data.Dataheader.length;w++)if(e.active==this.data.Dataheader[w]){let Ee=t.find(ut=>ut.Key===[this.data.Dataheader[w]].toString()).Value,xt=l.find(ut=>ut.Key===[this.data.Dataheader[w]].toString()).Value;return this.compare(Ee,xt,f)}})}static \u0275fac=function(r){return new(r||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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,yc,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,Dc,16,9,"ng-template",null,0,V),a(),n(19,"content"),g(20,Ec,8,3,"div",7),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(10,xc)),o(3),m("routerLink",b(11,hc)),o(3),m("routerLink",b(12,Sc)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,ae,ge,Le,fe,Q,X],encapsulation:2})};var Mc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Vc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Bc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function Oc(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=s();o(3),x("ngModel",e.pageData.Filter.Month),m("items",e.Months),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies)}}function Lc(i,c){if(i&1&&(n(0,"div",11),I(1,"POS-pie-chart",12),a()),i&2){let e=s();o(),m("config",e.pieConfig)("data",e.PieData)}}var Nn=class i extends ne{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=M.Months;Years=M.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),g(16,Oc,10,6,"ng-template",null,0,V),a(),n(18,"content"),g(19,Lc,2,2,"div",6),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(8,Mc)),o(3),m("routerLink",b(9,Vc)),o(3),m("routerLink",b(10,Bc)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,B,L,ni],encapsulation:2})};var Rc=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function kc(i,c){if(i&1){let e=F();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",7),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",8)(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("items",e.pageData.Options.SalesOrderTagIDs),x("ngModel",e.pageData.Filter.SalesOrderTagIDs),m("multiple",!0)}}function Wc(i,c){if(i&1&&(n(0,"content")(1,"div",11)(2,"div",12)(3,"div",13)(4,"div",14)(5,"div",15)(6,"div",16)(7,"p",17),p(8,"Transaction Per Hour"),a()(),n(9,"div",18),I(10,"POS-line-chart",19),a()()()(),n(11,"div",13)(12,"div",14)(13,"div",15)(14,"div",16)(15,"p",17),p(16,"Transaction Per Session"),a()(),n(17,"div",18),I(18,"POS-pie-chart",19),a()()()()()()()),i&2){let e=s();o(10),m("config",e.chartConfig)("data",e.ChartData),o(8),m("config",e.pieConfig)("data",e.PieData)}}var An=class i extends he{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let f={name:l.Name+": "+l.Description,y:l.Transaction};t.push(f)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(l,f){return l+"<br/>"+f.series.name+": <b>"+f.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"a",2),I(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),g(6,kc,13,9,"ng-template",null,0,V),a(),g(8,Wc,19,4,"content",4),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("routerLink",b(6,Rc)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,K,B,L,ni,Et,Q],encapsulation:2})};function Nc(i,c){if(i&1){let e=F();n(0,"a",4),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function Ac(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",8),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Gc(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",19),p(5),d(6,"number"),a(),n(7,"td",19),p(8),d(9,"number"),a(),n(10,"td",19),p(11),d(12,"amountFraction"),a(),n(13,"td",19),p(14),d(15,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),P(C(3,5,e.Visitor)),o(3),P(C(6,7,e.Orders)),o(3),P(C(9,9,e.TotalVisitor)),o(3),P(C(12,11,e.Sales)),o(3),P(C(15,13,e.Sales/(e.Visitor*e.Orders)))}}function Hc(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,Gc,16,15,"tr",17),a(),n(16,"tfoot")(17,"tr",18)(18,"td",19),p(19,"Total"),a(),n(20,"td",19),p(21),d(22,"sum"),d(23,"number"),a(),n(24,"td",19),p(25),d(26,"sum"),d(27,"number"),a(),n(28,"td",19),p(29),d(30,"sum"),d(31,"amountFraction"),a(),n(32,"td",19),p(33),d(34,"amountFraction"),a()()()()()),i&2){let e=s();o(15),m("ngForOf",e.data),o(6),P(C(23,8,y(22,5,e.data,"Orders"))),o(4),P(C(27,13,y(26,10,e.data,"TotalVisitor"))),o(4),P(C(31,18,y(30,15,e.data,"Sales"))),o(4),P(C(34,20,e.getSpendingPerPersonSum(e.data)))}}var Gn=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(q,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Nc,3,0,"a",2),a(),n(3,"filters"),g(4,Ac,10,6,"ng-template",null,0,V),a(),n(6,"content"),g(7,Hc,35,22,"div",3),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,K,B,L,Q,oe,ie,X],encapsulation:2})};var Qc=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function Yc(i,c){if(i&1){let e=F();n(0,"a",18),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",19),p(2," Export "),a()}}function jc(i,c){if(i&1){let e=F();n(0,"div",20)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",22),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",23)(9,"datepicker",24),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function qc(i,c){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Uc(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.Revenue))}}function Kc(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,Uc,3,3,"td",17),a()),i&2){let e=c.$implicit,r=s();o(2),P(e.TimeFormat),o(2),P(C(5,7,e.Count)),o(3),P(C(8,9,e.Quantity)),o(3),P(C(11,11,e.Sales)),o(3),P(C(15,15,C(14,13,e.Tax))),o(4),P(C(19,19,C(18,17,e.SalesWithTax))),o(3),m("ngIf",r.roleService.product.Cost||r.roleService.report.Profit)}}function zc(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s();o(),P(C(3,4,y(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var Hn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(q,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Yc,3,0,"a",2),n(3,"a",3),I(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),g(7,jc,10,6,"ng-template",null,0,V),a(),n(9,"content")(10,"div",5)(11,"table",6)(12,"thead",7)(13,"tr")(14,"th",8),p(15,"Time"),a(),n(16,"th",9),p(17,"Orders"),a(),n(18,"th",9),p(19,"Quantity"),a(),n(20,"th",10),p(21,"Sales"),a(),n(22,"th",10),p(23,"Tax"),a(),n(24,"th",10),p(25,"Sales + Tax"),a(),g(26,qc,2,0,"th",11),a()(),n(27,"tbody"),g(28,Kc,21,21,"tr",12),a(),n(29,"tfoot")(30,"tr",13),I(31,"td",14),n(32,"td",15),p(33),d(34,"sum"),d(35,"number"),a(),n(36,"td",15),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),n(40,"td",15),p(41),d(42,"sum"),d(43,"amountFraction"),a(),n(44,"td",16),p(45),d(46,"sum"),d(47,"RoundUp"),d(48,"amountFraction"),a(),n(49,"td",15),p(50),d(51,"sum"),d(52,"RoundUp"),d(53,"amountFraction"),a(),g(54,zc,4,6,"td",17),a()()()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(),m("routerLink",b(43,Qc)),o(23),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit),o(2),m("ngForOf",t.data==null?null:t.data.Data),o(5),P(C(35,17,y(34,14,t.data==null?null:t.data.Data,"Count"))),o(4),P(C(39,22,y(38,19,t.data==null?null:t.data.Data,"Quantity"))),o(4),P(C(43,27,y(42,24,t.data==null?null:t.data.Data,"Sales"))),o(4),P(C(48,34,C(47,32,y(46,29,t.data==null?null:t.data.Data,"Tax")))),o(5),P(C(53,41,C(52,39,y(51,36,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit))},dependencies:[N,Y,k,A,K,B,L,Q,oe,jo,ie,X,J],encapsulation:2})};var Xc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],eo=(i,c)=>({From:i,To:c}),Jc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Zc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function $c(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),T("dateChange",function(t){u(e);let l=s();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function ed(i,c){if(i&1&&(n(0,"content")(1,"div",12),I(2,"POS-line-chart",13),a()()),i&2){let e=s();o(2),m("config",e.chartConfig)("data",e.ChartData)}}var Qn=class i extends ne{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(c,e,r){super(c,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let c=this.route.snapshot.queryParams;c.From&&(this.pageData.Filter.From=c.From,this.pageData.Filter.To=c.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=M.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let c=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return M.getDatesInRange(c,e).map(l=>`${l.getDate()} ${M.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(c){this.pageData.Filter.From=c.from,this.pageData.Filter.To=c.to}static \u0275fac=function(e){return new(e||i)(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,r){if(e&1){let t=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(t),_(r.searchFromPageOne())}),S("filterChange",function(f){return u(t),h(r.pageData.Filter,f)||(r.pageData.Filter=f),_(f)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),g(16,$c,13,11,"ng-template",null,0,V),a(),g(18,ed,3,2,"content",6),a()}e&2&&(m("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",r.pageData.Filter),o(7),m("routerLink",b(11,Xc))("queryParams",de(12,eo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),m("routerLink",b(15,Jc))("queryParams",de(16,eo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),m("routerLink",b(19,Zc))("queryParams",de(20,eo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),m("ngIf",r.data))},dependencies:[N,k,A,z,B,L,Et,Gt,fe,Q],encapsulation:2})};var ad={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},li=class i{date;dateChange=new Gi;width;minDate=M.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(c,e){let r=null;c&&(r=c.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(c){let e=null;c&&(e=c.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(c,e){let r=new Date(c.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[ui([{provide:tn,useClass:Sn,deps:[en,$o]},{provide:nn,useValue:ad}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,r){if(e&1){let t=F();n(0,"mat-form-field",1)(1,"input",2),T("dateChange",function(f){return u(t),_(r.onDateChange(f.value))}),a(),I(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),T("yearSelected",function(f){u(t);let w=Ze(4);return _(r.chosenYearHandler(f,w))})("monthSelected",function(f){u(t);let w=Ze(4);return _(r.setMonthAndYear(f,w))})("opened",function(){return u(t),_(r.onOpenDatepicker())})("closed",function(){return u(t),_(r.onCloseDatepicker())}),a()()}if(e&2){let t=Ze(4);fo("width",r.width||100,"%"),o(),m("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),m("for",t)}},dependencies:[At,mn,gi,rn,ln,pn,fi,cn,on,an,sn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
1
|
+
import{a as ni,b as dr}from"./chunk-NVWJ6HZD.js";import{a as gr,b as fr}from"./chunk-SEFALU4U.js";import{a as Cr}from"./chunk-3TEHZXBK.js";import"./chunk-4NHG4RRM.js";import{a as Et,b as ur}from"./chunk-KHILQH3P.js";import{a as Gt,b as _r}from"./chunk-FRDFUCRO.js";import"./chunk-YAFVFDTG.js";import{a as cr}from"./chunk-V7UEUV6F.js";import{a as ii}from"./chunk-TAVO3B4U.js";import{a as he}from"./chunk-AWKQHHQM.js";import{a as Ye}from"./chunk-4JM455M6.js";import{a as Dn}from"./chunk-42T2PR4J.js";import{a as vt}from"./chunk-OXQJYOVG.js";import{a as ko}from"./chunk-5HX73JZ3.js";import{b as Go}from"./chunk-EOVI4KWG.js";import"./chunk-XJ7SOVB2.js";import{a as yn}from"./chunk-3VHY7PL5.js";import"./chunk-DAIHPIA2.js";import{a as sr}from"./chunk-BXQFYW4R.js";import{a as rr,b as lr,d as pr,g as mr}from"./chunk-4UYZJCFI.js";import"./chunk-BYXBJQAS.js";import{a as yi}from"./chunk-XKUQPHUA.js";import"./chunk-Q4CKRRGM.js";import"./chunk-PIYM2FOP.js";import"./chunk-2OWHEMAL.js";import"./chunk-XZELBTQR.js";import{e as Ao}from"./chunk-RHUDY63D.js";import{a as er,b as tr,c as ir,d as nr,e as ar,f as or}from"./chunk-BJYMTBNH.js";import"./chunk-B5SDXVDR.js";import"./chunk-PJDSTOKD.js";import"./chunk-L7YSVT7G.js";import"./chunk-RX7JS4CO.js";import{a as Oi,b as $o,c as Sn,d as K,e as Si}from"./chunk-GIDGCFLX.js";import{a as cn,b as fi}from"./chunk-XBRBYCWJ.js";import"./chunk-3RK6DDJD.js";import{a as sn}from"./chunk-FP4HFB5J.js";import{a as en,b as tn,c as nn,f as rn,g as ln,h as pn,p as gi,q as mn}from"./chunk-H3OZSV6V.js";import"./chunk-YEDKRNXU.js";import"./chunk-VZEPVRCY.js";import"./chunk-7QWJJPNG.js";import{c as No,d as De,e as hn}from"./chunk-6647Y35T.js";import"./chunk-VHAM2DWK.js";import{a as J}from"./chunk-JPXXXD26.js";import{a as X}from"./chunk-WO3LDDSF.js";import{a as dn}from"./chunk-TEDYOKSU.js";import{a as ae,b as ge,c as Ro}from"./chunk-VQBXUZ6U.js";import{a as bt,b as Zo}from"./chunk-BBGWXLHJ.js";import{d as zo,f as fe}from"./chunk-LEA3AHYR.js";import{a as Xo,b as Jo,c as Q}from"./chunk-O4MMSLYA.js";import{b as q}from"./chunk-QHBWVJIQ.js";import{a as ne}from"./chunk-MHCEZ7DC.js";import{a as Lo}from"./chunk-5BQ6KDM5.js";import"./chunk-6JAL37Y4.js";import"./chunk-4QQTEPQT.js";import{a as H}from"./chunk-XZR3IMWZ.js";import{e as N,f as hi}from"./chunk-JPEAUVYZ.js";import"./chunk-RUSRJ52M.js";import"./chunk-5JJSLRVS.js";import{c as Ho}from"./chunk-B6LPY2IZ.js";import"./chunk-CWITQVZH.js";import"./chunk-QHRP323Q.js";import"./chunk-WDQ4UKKY.js";import"./chunk-MFCXEITE.js";import{a as Qo,c as Qe}from"./chunk-MUJ6277G.js";import"./chunk-LMJVRREP.js";import"./chunk-3LBZDIW2.js";import"./chunk-KTCV3KOE.js";import"./chunk-KZDE63UL.js";import{e as Ko}from"./chunk-5A6FE72F.js";import{b as W}from"./chunk-PC4Z6IGY.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import{C as Cn,F as Le,G as xn,j as an,m as on,t as Wo,u as Ci,v as ei,w as _n}from"./chunk-H7F34T25.js";import{b as pe,c as $i}from"./chunk-JOXTERIM.js";import{A as fn,B as qo,C as ti,K as xi,N as Uo,g as oe,o as Yo,s as gn,z as jo}from"./chunk-TSIYPTYI.js";import{a as un,d as z}from"./chunk-XYB3YDKL.js";import"./chunk-7VKFVS7K.js";import"./chunk-ZVDY66SR.js";import{b as Ji,e as Zt,f as $t,g as j}from"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import{a as Bo,b as Oo}from"./chunk-VFTGIP5A.js";import{a as Vo}from"./chunk-LE3BKIDY.js";import{a as Bi}from"./chunk-2FWFPV5I.js";import{la as Eo,ma as Zi,ua as Mo}from"./chunk-EEEAUYZ6.js";import{F as At,G as Xi,a as To,b as Po,c as ke,h as B,l as Fo,o as L,q as Io,s as bo}from"./chunk-RVXZOIFQ.js";import"./chunk-NKMWM4KR.js";import"./chunk-DAY7JXRT.js";import{a as M,d as G}from"./chunk-ZZGSAFGO.js";import"./chunk-4Z2LLSIT.js";import{$a as o,$b as ji,Ac as C,Ba as Ai,Bc as y,Cc as _i,Db as Nt,E as ri,Eb as Xa,Fa as Gi,Fc as V,Gb as Ei,Hb as Mi,I as Ii,Ib as n,Jb as a,K as mo,Kb as I,Kc as So,Lb as se,M as so,Ma as mt,Mb as ce,Mc as Ui,Nb as xo,Nc as yo,Ob as F,Od as Oe,Pc as Ja,Q as Ni,Qb as T,Qc as Do,Qd as zi,Rb as s,Rd as A,Td as Vi,Ub as dt,Va as Pe,Vd as Ke,Wa as Hi,Wc as He,Y as Rt,Yc as Y,Yd as O,Zb as Qi,Zc as k,_b as Yi,aa as Ka,ad as vo,cd as Ki,db as D,dc as Ze,ec as p,ed as ee,fa as kt,fc as P,gc as v,gd as ie,hc as Xt,ia as co,ib as _o,ja as uo,jc as x,jd as Jt,ka as ci,kb as E,kc as h,lb as di,lc as S,mb as go,na as Ge,o as si,ob as R,pc as ui,qb as g,qc as b,rc as U,sc as de,t as Yt,tc as st,u as Ua,ub as jt,uc as qt,va as u,vb as m,vc as qi,wa as _,wb as fo,wc as ho,wd as wo,xb as bi,za,zb as Co,zc as d}from"./chunk-UXRO4UFY.js";import{a as Je,b as et,e as sl,g as Qt}from"./chunk-7DCB7DB2.js";var ao=sl((gb,Va)=>{(function(i){typeof Va=="object"&&Va.exports?(i.default=i,Va.exports=i):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts"],function(c){return i(c),i.Highcharts=c,i}):i(typeof Highcharts<"u"?Highcharts:void 0)})(function(i){"use strict";var c=i?i._modules:{};function e(r,t,l,f){r.hasOwnProperty(t)||(r[t]=f.apply(null,l),typeof CustomEvent=="function"&&i.win.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:r[t]}})))}e(c,"Extensions/SeriesLabel/SeriesLabelDefaults.js",[],function(){return{enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]}}),e(c,"Extensions/SeriesLabel/SeriesLabelUtilities.js",[],function(){function r(l,f,w,Ee,xt,ut){let Vt=(ut-f)*(w-l)-(Ee-f)*(xt-l);return Vt>0||!(Vt<0)}function t(l,f,w,Ee,xt,ut,Vt,Wt){return r(l,f,xt,ut,Vt,Wt)!==r(w,Ee,xt,ut,Vt,Wt)&&r(l,f,w,Ee,xt,ut)!==r(l,f,w,Ee,Vt,Wt)}return{boxIntersectLine:function(l,f,w,Ee,xt,ut,Vt,Wt){return t(l,f,l+w,f,xt,ut,Vt,Wt)||t(l+w,f,l+w,f+Ee,xt,ut,Vt,Wt)||t(l,f+Ee,l+w,f+Ee,xt,ut,Vt,Wt)||t(l,f,l,f+Ee,xt,ut,Vt,Wt)},intersectRect:function(l,f){return!(f.left>l.right||f.right<l.left||f.top>l.bottom||f.bottom<l.top)}}}),e(c,"Extensions/SeriesLabel/SeriesLabel.js",[c["Core/Animation/AnimationUtilities.js"],c["Core/Templating.js"],c["Core/Defaults.js"],c["Core/Globals.js"],c["Extensions/SeriesLabel/SeriesLabelDefaults.js"],c["Extensions/SeriesLabel/SeriesLabelUtilities.js"],c["Core/Utilities.js"]],function(r,t,l,f,w,Ee,xt){let{animObject:ut}=r,{format:Vt}=t,{setOptions:Wt}=l,{composed:al}=f,{boxIntersectLine:oo,intersectRect:ol}=Ee,{addEvent:ro,extend:lo,fireEvent:rl,isNumber:ki,pick:Ut,pushUnique:ll,syncTimeout:pl}=xt;function pi(ct,Me,at,we,Pt){let it=ct.chart,$=ct.options.label||{},ze=Ut($.onArea,!!ct.area),je=ze||$.connectorAllowed,lt=it.boxesToAvoid,Bt=Number.MAX_VALUE,Ft=Number.MAX_VALUE,ht,_t,gt,Kt,It,Xe,be;for(Xe=0;lt&&Xe<lt.length;Xe+=1)if(ol(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(oo(Me,at,we.width,we.height,Ve[be-1].chartX,Ve[be-1].chartY,Ve[be].chartX,Ve[be].chartY))return!1;ct===ot&&!gt&&Pt&&(gt=oo(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)&&(ct!==ot||ze)&&(Bt=Math.min(Bt,(Kt=Me+we.width/2-Ve[be].chartX)*Kt+(It=at+we.height/2-Ve[be].chartY)*It))}if(!ze&&je&&ct===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)))<Ft&&(Ft=ht,_t=Ve[be]);gt=!0}}}return(!Pt||!!gt)&&{x:Me,y:at,weight:Bt-(_t?Ft:0),connectorPoint:_t}}function po(ct){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)),ct.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=pl(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(),Ft=(je.translateX||0)+($.xAxis?$.xAxis.pos:$.chart.plotLeft),ht=(je.translateY||0)+($.yAxis?$.yAxis.pos:$.chart.plotTop);it.push({left:Ft,top:ht,right:Ft+lt,bottom:ht+Bt})}))),Pt.forEach(function($){let ze=$.options.label||{};$.interpolatedPoints=function(je){let lt,Bt,Ft,ht,_t;if(!je.xAxis&&!je.yAxis)return;let gt=je.points,Kt=[],It=je.graph||je.area,Xe=It&&It.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,Fi=be?Ve.len:ot.len,ft=Ut((je.options.label||{}).onArea,!!je.area),Ne=Ve.getThreshold(je.options.threshold),wt={},zt=be?"chartCenterX":"chartCenterY";function oi(nt){let St=Math.round((nt.plotX||0)/8)+","+Math.round((nt.plotY||0)/8);wt[St]||(wt[St]=1,Kt.push(nt))}if(je.getPointSpline&&Xe&&Xe.getPointAtLength&&!ft&>.length<(je.chart.plotSizeX||0)/16){let nt=It.toD&&It.attr("d");for(It.toD&&It.attr({d:It.toD}),Ft=Xe.getTotalLength(),lt=0;lt<Ft;lt+=16){let Lt=Xe.getPointAtLength(lt),Ct=be?Fi-Lt.y:Lt.x,pt=be?Dt-Lt.x:Lt.y;oi({chartX:Ue+Ct,chartY:$e+pt,plotX:Ct,plotY:pt})}nt&&It.attr({d:nt});let St=gt[gt.length-1].pos();oi({chartX:Ue+(St?.[0]||0),chartY:$e+(St?.[1]||0)})}else{let nt;for(lt=0,Ft=gt.length;lt<Ft;lt+=1){let St=gt[lt],[Lt,Ct]=St.pos()||[],{plotHigh:pt}=St;if(ki(Lt)&&ki(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+Fi-((pt||St.plotY||0)+Ut(St.yBottom,Ne))/2:rt.chartCenterY=$e+((pt||Ct)+Ut(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)oi({chartX:nt.chartX+(rt.chartX-nt.chartX)*(_t/ht),chartY:nt.chartY+(rt.chartY-nt.chartY)*(_t/ht),[zt]:(nt[zt]||0)+((rt[zt]||0)-(nt[zt]||0))*(_t/ht),plotX:(nt.plotX||0)+(Lt-(nt.plotX||0))*(_t/ht),plotY:(nt.plotY||0)+(Ct-(nt.plotY||0))*(_t/ht)});oi(rt),nt=rt}}}return Kt}($),it.push(...ze.boxesToAvoid||[])}),we.series.forEach(function($){let ze=$.options.label;if(!ze||!$.xAxis&&!$.yAxis)return;let je="highcharts-color-"+Ut($.colorIndex,"none"),lt=!$.labelBySeries,Bt=ze.minFontSize,Ft=ze.maxFontSize,ht=we.inverted,_t=ht?$.yAxis.pos:$.xAxis.pos,gt=ht?$.xAxis.pos:$.yAxis.pos,Kt=we.inverted?$.yAxis.len:$.xAxis.len,It=we.inverted?$.xAxis.len:$.yAxis.len,Xe=$.interpolatedPoints,be=Ut(ze.onArea,!!$.area),ot=[],Ve=$.xData||[],Ue,$e,Dt,Fi,ft,Ne,wt=$.labelBySeries,zt,oi,nt;function St(Ct,pt,rt){let Wi=Math.max(_t,Ut(oi,-1/0)),mi=Math.min(_t+Kt,Ut(nt,1/0));return Ct>Wi&&Ct<=mi-rt.width&&pt>=gt&&pt<=gt+It-rt.height}function Lt(){wt&&($.labelBySeries=wt.destroy())}if(be&&!ht&&(zt=[$.xAxis.toPixels(Ve[0]),$.xAxis.toPixels(Ve[Ve.length-1])],oi=Math.min.apply(Math,zt),nt=Math.max.apply(Math,zt)),$.visible&&!$.boosted&&Xe){if(!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(lo({color:be?we.renderer.getContrast(pt):pt},ze.style||{})),wt.attr({opacity:we.renderer.forExport?1:0,stroke:$.color,"stroke-width":1})}Bt&&Ft&&wt.css({fontSize:Bt+($.sum||0)/($.chart.labelSeriesMaxSum||0)*(Ft-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=pi($,$e,Dt,Ue)):(St($e=Xe[ft].chartX+3,Dt=Xe[ft].chartY-Ue.height-3,Ue)&&(Ne=pi($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX+3,Dt=Xe[ft].chartY+3,Ue)&&(Ne=pi($,$e,Dt,Ue,!0)),Ne&&ot.push(Ne),St($e=Xe[ft].chartX-Ue.width-3,Dt=Xe[ft].chartY+3,Ue)&&(Ne=pi($,$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=pi($,$e,Dt,Ue,!0))),Ne&&ot.push(Ne);if(ze.connectorAllowed&&!ot.length&&!be)for($e=_t+Kt-Ue.width;$e>=_t;$e-=16)for(Dt=gt;Dt<gt+It-Ue.height;Dt+=16)(Fi=pi($,$e,Dt,Ue,!0))&&ot.push(Fi);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},Wi={opacity:1};Ct<=10&&(Wi={x:rt.x,y:rt.y},rt={}),lt&&(pt=ut($.options.animation),pt.duration*=.2),$.labelBySeries.attr(lo(rt,{anchorX:Ne.connectorPoint&&(Ne.connectorPoint.plotX||0)+_t,anchorY:Ne.connectorPoint&&(Ne.connectorPoint.plotY||0)+gt})).animate(Wi,pt),$.options.kdNow=!0,$.buildKDTree();let mi=$.searchPoint({chartX:Ne.x,chartY:Ne.y},!0);mi&&(wt.closest=[mi,Ne.x-(mi.plotX||0),Ne.y-(mi.plotY||0)])}}else Lt()}else Lt()}),rl(we,"afterDrawSeriesLabels")}(Me)},Me.renderer.forExport||!at?0:at)}}function ml(ct,Me,at,we,Pt){let it=Pt&&Pt.anchorX,$=Pt&&Pt.anchorY,ze,je,lt=at/2;return ki(it)&&ki($)&&(ze=[["M",it,$]],(je=Me-$)<0&&(je=-we-je),je<at&&(lt=it<ct+at/2?je:at-je),$>Me+we?ze.push(["L",ct+lt,Me+we]):$<Me?ze.push(["L",ct+lt,Me]):it<ct?ze.push(["L",ct,Me+we/2]):it>ct+at&&ze.push(["L",ct+at,Me+we/2])),ze||[]}return{compose:function(ct,Me){ll(al,"SeriesLabel")&&(ro(ct,"load",po),ro(ct,"redraw",po),Me.prototype.symbols.connector=ml,Wt({plotOptions:{series:{label:w}}}))}}}),e(c,"masters/modules/series-label.src.js",[c["Core/Globals.js"],c["Extensions/SeriesLabel/SeriesLabel.js"]],function(r,t){return t.compose(r.Chart,r.SVGRenderer),r})})});var xr=(i,c)=>({"text-success":i,"text-danger":c});function cl(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 dl(i,c){if(i&1){let e=F();n(0,"span",8),T("click",function(){u(e);let t=s(2);return _(t.loadComplementaryQuantity())}),I(1,"i",9),a()}}function ul(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 _l(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,xr,e.Profit>0,e.Profit<0)),o(),v(" ",C(8,4,e.Profit)," "),o(3),m("ngClass",de(12,xr,e.ProfitRatio>0,e.ProfitRatio<0)),o(),v("",y(12,6,e.ProfitRatio,"1.0-2"),"%")}}function gl(i,c){if(i&1&&(se(0),n(1,"table",4)(2,"tbody")(3,"tr")(4,"td")(5,"span",5),p(6,"Orders"),a()(),n(7,"td"),p(8),d(9,"number"),a(),I(10,"td"),a(),n(11,"tr")(12,"td")(13,"span",5),p(14," Quantity "),a()(),n(15,"td"),p(16),d(17,"quantityFraction"),a(),I(18,"td"),a(),n(19,"tr")(20,"td")(21,"span",5),p(22," Complementary "),a()(),n(23,"td"),g(24,cl,4,4,"ng-container",6),d(25,"async"),g(26,dl,2,0,"ng-template",null,0,V),a(),I(28,"td"),a(),n(29,"tr")(30,"td")(31,"span",5),p(32," Gross Sales "),a()(),n(33,"td"),p(34),d(35,"amountFraction"),a(),I(36,"td"),a(),n(37,"tr")(38,"td")(39,"span",5),p(40," Discount "),a()(),n(41,"td")(42,"span",7),p(43),d(44,"amountFraction"),a()(),n(45,"td")(46,"span",7),p(47),d(48,"number"),a()()(),n(49,"tr")(50,"td")(51,"span",5),p(52," Sales "),a()(),n(53,"td"),p(54),d(55,"amountFraction"),a(),I(56,"td"),a(),n(57,"tr")(58,"td")(59,"span",5),p(60," Tax "),a()(),n(61,"td"),p(62),d(63,"amountFraction"),a(),I(64,"td"),a(),n(65,"tr")(66,"td")(67,"span",5),p(68," Sales + Tax "),a()(),n(69,"td"),p(70),d(71,"amountFraction"),a(),I(72,"td"),a(),g(73,ul,13,7,"ng-container",3)(74,_l,13,15,"ng-container",3),a()(),ce()),i&2){let e=c.ngIf,r=Ze(27),t=s();o(8),P(C(9,12,e.Orders)),o(8),P(C(17,14,e.Quantity)),o(8),m("ngIf",C(25,16,t.complementaryQuantity$))("ngIfElse",r),o(10),P(C(35,18,e.GrossSales)),o(9),v(" ",C(44,20,e.Discount)," "),o(4),v(" ",y(48,22,e.DiscountRatio,"1.0-2"),"% "),o(7),P(C(55,25,e.Sales)),o(8),P(C(63,27,e.Tax)),o(8),P(C(71,29,e.SalesWithTax)),o(3),m("ngIf",t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost),o(),m("ngIf",t.roleService.report.Profit)}}var vn=class i{constructor(c,e,r,t){this.httpService=c;this.roleService=e;this.dialogRef=r;this.data=t;this.fractionDigit=this.data.FractionDigit}modalConfig;reportSummary$;fractionDigit;filter;complementaryQuantity$;ngOnInit(){this.reportSummary$=this.httpService.post("/api/Report/ReportDetailFooter",this.data.Filter).pipe(Yt(c=>(c.ProfitRatio=this.profitRatioCalculation(c.Profit,c.Sales,c.Tax),c.CostRatio=this.costRatioCalculation(c.Cost,c.Sales,c.Tax),c.DiscountRatio=this.discountPercentageCalc(c.Discount,c.GrossSales,c.Tax),c))),this.initModalConfig()}initModalConfig(){this.modalConfig=new Ci,this.modalConfig.title="Sales Detail Summary",this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.customWidth="400px",this.modalConfig.hideFooter=!0}costRatioCalculation(c,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=c/e*100),t}profitRatioCalculation(c,e,r){let t=0;return this.data?.IncludeTax&&(e+=r),e!=0&&(t=c/e*100),t}discountPercentageCalc(c=0,e=0,r=0){return c/(e-r)*100}loadComplementaryQuantity(){this.complementaryQuantity$=this.httpService.post("/api/Report/ReportDetailComplementaryQuantity",this.data.Filter).pipe(Rt())}static \u0275fac=function(e){return new(e||i)(D(O),D(G),D(Zt),D($t))};static \u0275cmp=E({type:i,selectors:[["app-modal-sales-detail-summary"]],standalone:!1,decls:5,vars:4,consts:[["Load_Qty",""],[3,"onClose","config"],[1,"p-3"],[4,"ngIf"],[1,"table","table-bordered","table-sm"],[1,"fw-bold"],[4,"ngIf","ngIfElse"],[1,"text-danger"],[3,"click"],[1,"fa-solid","fa-circle-question","cursor","text-primary","fa-lg"],[3,"ngClass"],[1,"text-success",3,"ngClass"]],template:function(e,r){e&1&&(n(0,"modal-material",1),T("onClose",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",2),g(3,gl,75,31,"ng-container",3),d(4,"async"),a()()()),e&2&&(m("config",r.modalConfig),o(3),m("ngIf",C(4,2,r.reportSummary$)))},dependencies:[He,k,ei,Ki,ie,X,J],styles:["table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:first-child{width:110px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(2){text-align:right;width:100px}table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:nth-child(3){text-align:right;width:56px}"]})};var fl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],hr=i=>({ID:i});function Cl(i,c){if(i&1){let e=F();n(0,"button",6),T("click",function(){u(e);let t=s(2);return _(t.openExportModal())}),I(1,"i",7),p(2," Export "),a()}}function xl(i,c){if(i&1&&(n(0,"div",4),g(1,Cl,3,0,"button",5),a()),i&2){let e=s();o(),m("ngIf",e.roleService.global.Export)}}function hl(i,c){if(i&1){let e=F();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",11),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",12)(11,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",16),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",22),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),I(41,"i",23),a(),n(42,"ng-select",24),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",25),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("model",e.pageData.Filter.Bin),o(3),m("items",e.pageData.Options.Types),x("ngModel",e.pageData.Filter.TypeID),o(3),m("items",e.pageData.Options.Currencies),x("ngModel",e.pageData.Filter.CurrencyID),o(3),m("items",e.pageData.Options.Deliveries),x("ngModel",e.pageData.Filter.DeliveryStateID),o(3),x("ngModel",e.pageData.Filter.PaymentStateID),m("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),x("ngModel",e.pageData.Filter.CreatorID),m("renderThumbnail",!1),o(3),x("model",e.pageData.Filter.NoteVisible),o(4),m("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),x("ngModel",e.pageData.Filter.QueryOption),o(3),x("model",e.pageData.Filter.DefaultFilterColumn),m("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Sl(i,c){i&1&&(n(0,"th",44),p(1," @ Cost "),a())}function yl(i,c){if(i&1&&(n(0,"small",60),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),P(y(2,1,e.CustomerNameDisplay," - {0}"))}}function Dl(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=s().$implicit;o(),P(y(2,1,e.SalesName," - Sales: {0}"))}}function vl(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 wl(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 Tl(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 Pl(i,c){i&1&&(n(0,"span"),p(1,"-"),a())}function Fl(i,c){if(i&1&&(se(0),I(1,"div",63),d(2,"newlines"),ce()),i&2){let e=s().$implicit;o(),m("innerHTML",C(2,1,e.SONote),Pe)}}function Il(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,hr,e.ReferenceInvoiceID)),o(),v(" Return ",e.ReferenceInvoiceNumber," ")}}function bl(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 El(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 Ml(i,c){if(i&1&&(n(0,"tr",65)(1,"th",30)(2,"div",66)(3,"span",67),p(4),a(),g(5,bl,2,1,"i",68),I(6,"small",69),a()(),n(7,"th",70),p(8),a(),n(9,"th",71),p(10),d(11,"quantityFraction"),a(),n(12,"th",72),p(13),a(),g(14,El,3,3,"th",73),n(15,"th",74),p(16),d(17,"amountFraction"),a(),n(18,"th",75)(19,"div",76),p(20),a(),n(21,"div",77),p(22),d(23,"amountFraction"),a()(),n(24,"th",74),p(25),d(26,"amountFraction"),a()()),i&2){let e=c.$implicit,r=s(3);o(4),P(e==null?null:e.Name),o(),m("ngIf",(e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName),o(),m("innerHtml",e==null?null:e.Note,Pe),o(2),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",r.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 Vl(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 Bl(i,c){if(i&1&&(n(0,"div")(1,"div",45)(2,"div",46)(3,"div")(4,"a",47)(5,"span",48),p(6),a()(),n(7,"span"),p(8),d(9,"date"),I(10,"small",49),d(11,"date"),g(12,yl,3,4,"small",50),a()(),n(13,"div",51)(14,"strong",52),p(15),g(16,Dl,3,4,"span",3),a(),g(17,vl,3,3,"span",50)(18,wl,2,1,"i",53)(19,Tl,2,1,"span",54)(20,Pl,2,0,"span",3),a(),g(21,Fl,3,3,"ng-container",3)(22,Il,4,4,"ng-container",3),a(),n(23,"div",55),p(24),a()(),n(25,"table",56)(26,"tbody",57),g(27,Ml,27,19,"tr",58),a()(),n(28,"table",59),g(29,Vl,9,5,"ng-container",37),a()()),i&2){let e=c.$implicit,r=s(2);o(4),m("routerLink",b(23,fl))("queryParams",U(24,hr,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",r.isNotEmpty(e.CustomerNameDisplay)),o(3),v(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),m("ngIf",r.isNotEmpty(e.SalesName)),o(),m("ngIf",r.roleService.report.Profit),o(),m("ngIf",r.isNotEmpty(e.DeliveryOutlet)),o(),m("ngIf",r.isNotEmpty(e.PromotionCoupon)),o(),m("ngIf",e.SONote&&e.PromotionCoupon),o(),m("ngIf",r.isNotEmpty(e.SONote)),o(),m("ngIf",r.isNotEmpty(e.ReferenceInvoiceID)),o(2),v(" ",e.PaymentStateLabel," "),o(3),m("ngForOf",e.Items),o(2),m("ngForOf",e.Aggregate)}}function Ol(i,c){if(i&1){let e=F();n(0,"span",83),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",84),p(2,"?"),a()()}}function Ll(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),P(C(2,1,e.listTotal))}}function Rl(i,c){if(i&1){let e=F();n(0,"div",4)(1,"a",85),T("click",function(){u(e);let t=s(2);return t.currentRowCount=100,_(t.NextPage(!0))}),I(2,"i",86),p(3," Next 100"),a()()}}function kl(i,c){if(i&1){let e=F();n(0,"content")(1,"div",26)(2,"div",27)(3,"table",28)(4,"thead",29)(5,"tr")(6,"th",30),p(7,"Name"),a(),n(8,"th",31),p(9,"Code"),a(),n(10,"th",32),p(11,"Qty"),a(),n(12,"th",33),p(13,"UOM"),a(),g(14,Sl,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,Bl,30,26,"div",37),a()()()()(),n(25,"div",38)(26,"button",39),T("click",function(){u(e);let t=s();return _(t.showSummaryReport())}),p(27," View Report Summary "),a()(),n(28,"div",40)(29,"div",41)(30,"div",42),p(31),d(32,"number"),g(33,Ol,3,0,"span",43)(34,Ll,3,3,"span",3),p(35),a()(),g(36,Rl,4,0,"div",2),a()()()}if(i&2){let e=s();o(14),m("ngIf",e.roleService.product.Cost),o(9),jt("colspan",e.roleService.product.Cost?8:7),o(),m("ngForOf",e.infiniteList),o(7),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,r,t,l,f,w,Ee,xt){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,f);this.csvConverter=t;this.datePipe=l;this.activatedRoute=f;this.matDialog=w;this.toaster=Ee;this.roleService=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,M.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),M.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),M.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return M.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(f=>f):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(q,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(vn,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,xl,2,1,"div",2),a(),n(3,"filters"),g(4,hl,46,26,"ng-template",null,0,V),a(),g(6,kl,37,10,"content",3),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,pe,De,Le,Q,Ye,Yo,gn,ie,ee,X,J],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media (max-width: 992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var Tn=class i{constructor(c,e){this._dialogRef=c;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Ci;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(D(Zt),D($t))};static \u0275cmp=E({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),T("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),S("ngModelChange",function(l){return h(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),S("ngModelChange",function(l){return h(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(m("title","Export Report")("config",r.modalConfig),o(6),x("ngModel",r.ExportPageNumber),o(4),x("ngModel",r.ExportRowCount),m("max",1e4))},dependencies:[ke,B,L,Qe,ei],encapsulation:2})};var Nl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Sr=i=>({ID:i}),Al=()=>["/menu/Contacts/Contact/Customers/Info"],Gl=(i,c,e)=>({"text-success":i,"text-warning":c,"text-danger":e});function Hl(i,c){if(i&1){let e=F();n(0,"button",5),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",6),p(2," Export "),a()}}function Ql(i,c){if(i&1){let e=F();se(0),n(1,"div",19)(2,"div",20)(3,"datepicker",21),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(4,"div",22)(5,"app-timepicker",23),S("timeChange",function(t){u(e);let l=s(2);return h(l.timeFrom,t)||(l.timeFrom=t),_(t)}),T("timeChange",function(t){u(e);let l=s(2);return _(l.timeFromChange(t))}),a()()(),n(6,"div",24)(7,"div",20)(8,"datepicker",25),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a()(),n(9,"div",22)(10,"app-timepicker",23),S("timeChange",function(t){u(e);let l=s(2);return h(l.timeTo,t)||(l.timeTo=t),_(t)}),T("timeChange",function(t){u(e);let l=s(2);return _(l.timeToChange(t))}),a()()(),ce()}if(i&2){let e=s(2);o(3),x("date",e.pageData.Filter.From),o(2),x("time",e.timeFrom),o(3),x("date",e.pageData.Filter.To),o(2),x("time",e.timeTo)}}function Yl(i,c){if(i&1){let e=F();n(0,"datepicker",26),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterFromDate())}),a(),n(1,"div",27)(2,"datepicker",28),S("dateChange",function(t){u(e);let l=s(2);return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s(2);return _(t.onFilterToDate())}),a()()}if(i&2){let e=s(2);x("date",e.pageData.Filter.From),m("appearance","outline")("width",100),o(2),x("date",e.pageData.Filter.To),m("appearance","outline")("width",100)}}function jl(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesOrderTagID,t)||(l.pageData.Filter.SalesOrderTagID=t),_(t)}),a(),n(13,"h6"),p(14,"Order By"),a(),n(15,"radio-options",12),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),g(18,Ql,11,4,"ng-container",13)(19,Yl,3,6,"ng-template",null,1,V),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RegisterID,t)||(l.pageData.Filter.RegisterID=t),_(t)}),a(),n(24,"h6"),p(25,"Customer Groups"),a(),n(26,"ng-select",15),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",17),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=Ze(20),r=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",r.pageData.Filter.ListIDs),m("outlets",r.pageData.Options==null?null:r.pageData.Options.Entities),o(3),x("ngModel",r.pageData.Filter.CustomerID),m("inputTextValue",r.pageData.CustomerName),o(3),x("ngModel",r.pageData.Filter.SalesID),o(3),x("ngModel",r.pageData.Filter.SalesOrderTagID),m("items",r.pageData.Options.SalesOrderTags),o(3),m("options",r.pageData.Options.DefaultFilterColumnOptions),x("model",r.pageData.Filter.DefaultFilterColumn),o(3),m("ngIf",r.pageData.Filter.isCreated)("ngIfElse",e),o(5),x("ngModel",r.pageData.Filter.RegisterID),m("items",r.pageData.Options.Registers),o(3),x("ngModel",r.pageData.Filter.CustomerGroupID),m("items",r.pageData.Options.Groups),o(3),x("ngModel",r.pageData.Filter.PaymentState),m("items",r.pageData.Options.States),o(3),x("ngModel",r.pageData.Filter.CreatorID),o(3),m("max",1e4),x("ngModel",r.pageData.Filter.RowCount)}}function ql(i,c){i&1&&(n(0,"th",57),p(1,"DATE"),a())}function Ul(i,c){i&1&&(n(0,"th",58),p(1," CUSTOMER "),a())}function Kl(i,c){i&1&&(n(0,"th",45),p(1,"JOIN DATE"),a())}function zl(i,c){i&1&&(n(0,"th",46),p(1,"GROUPS"),a())}function Xl(i,c){i&1&&(n(0,"th",59),p(1," SALES PERSON "),a())}function Jl(i,c){i&1&&(n(0,"th",60),p(1," COST "),a())}function Zl(i,c){i&1&&(n(0,"th",61),p(1," GROSS "),a())}function $l(i,c){i&1&&(n(0,"th",62),p(1," SALES "),a())}function ep(i,c){i&1&&(n(0,"th",63),p(1," TAX "),a())}function tp(i,c){i&1&&(n(0,"th",64),p(1," SURCHARGE "),a())}function ip(i,c){i&1&&(n(0,"th",65),p(1," TOTAL "),a())}function np(i,c){i&1&&(n(0,"th",66),p(1," PAYMENT "),a())}function ap(i,c){i&1&&I(0,"br")}function op(i,c){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=s().$implicit;o(),P(e.Note)}}function rp(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 lp(i,c){if(i&1&&(n(0,"td")(1,"a",72),p(2),a()()),i&2){let e=s().$implicit;o(),m("routerLink",b(3,Al))("queryParams",U(4,Sr,e.CustomerID)),o(),P(e.CustomerName)}}function pp(i,c){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=s().$implicit;o(),v(" ",e.JoinDate!=="0001-01-01T00:00:00"?y(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function mp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.Groups," ")}}function sp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),v(" ",e.SalesName," ")}}function cp(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.Cost)," ")}}function dp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Gross)," ")}}function up(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.Sales)," ")}}function _p(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.Tax)," ")}}function gp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SurchargeAmount)," ")}}function fp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),v(" ",C(2,1,e.SalesNSurcharge)," ")}}function Cp(i,c){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=s().$implicit;m("ngClass",st(2,Gl,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),v(" ",e.PaymentStateString," ")}}function xp(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",67),p(5),a(),g(6,ap,1,0,"br",4)(7,op,2,1,"i",4),a(),g(8,rp,7,8,"td",4)(9,lp,3,6,"td",4)(10,pp,3,4,"td")(11,mp,2,1,"td")(12,sp,2,1,"td",4)(13,cp,3,3,"td",68)(14,dp,3,3,"td",69)(15,up,3,3,"td",69)(16,_p,3,3,"td",70)(17,gp,3,3,"td",69)(18,fp,3,3,"td",69)(19,Cp,2,6,"td",71),a()),i&2){let e=c.$implicit,r=s(3);o(2),P(e.EntityName),o(2),m("routerLink",b(18,Nl))("queryParams",U(19,Sr,e.ID)),o(),v(" ",e.Number," "),o(),m("ngIf",e.Note),o(),m("ngIf",e.Note),o(),m("ngIf",r.column.Date.selected),o(),m("ngIf",r.column.Customer.selected),o(),Nt(r.column.JoinDate.selected?10:-1),o(),Nt(r.column.Groups.selected?11:-1),o(),m("ngIf",r.column.SalesPerson.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.column.Gross.selected),o(),m("ngIf",r.column.Sales.selected),o(),m("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),m("ngIf",r.data.SurchargeVisible),o(),m("ngIf",r.column.Total.selected),o(),m("ngIf",r.column.Payment.selected)}}function hp(i,c){i&1&&I(0,"td",79)}function Sp(i,c){i&1&&I(0,"td",79)}function yp(i,c){i&1&&I(0,"td",79)}function Dp(i,c){i&1&&(n(0,"td",82),p(1," Total: "),a())}function vp(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,"Cost"))," ")}}function wp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Gross"))," ")}}function Tp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Sales"))," ")}}function Pp(i,c){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"Tax"))," ")}}function Fp(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function Ip(i,c){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s(4);o(),v(" ",C(3,4,y(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function bp(i,c){if(i&1&&(n(0,"tfoot",77)(1,"tr",78),I(2,"td",79),g(3,hp,1,0,"td",80)(4,Sp,1,0,"td",80)(5,yp,1,0,"td",80)(6,Dp,2,0,"td",81)(7,vp,4,6,"td",68)(8,wp,4,6,"td",69)(9,Tp,4,6,"td",69)(10,Pp,4,6,"td",70)(11,Fp,4,6,"td",69)(12,Ip,4,6,"td",69),a()()),i&2){let e=s(3);o(3),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected)}}function Ep(i,c){if(i&1){let e=F();n(0,"div",38)(1,"table",39),T("matSortChange",function(t){u(e);let l=s(2);return _(l.sortData(t))}),n(2,"thead",40)(3,"tr")(4,"th",41),p(5,"OUTLET"),a(),n(6,"th",42),p(7,"NUMBER"),a(),g(8,ql,2,0,"th",43)(9,Ul,2,0,"th",44)(10,Kl,2,0,"th",45)(11,zl,2,0,"th",46)(12,Xl,2,0,"th",47)(13,Jl,2,0,"th",48)(14,Zl,2,0,"th",49)(15,$l,2,0,"th",50)(16,ep,2,0,"th",51)(17,tp,2,0,"th",52)(18,ip,2,0,"th",53)(19,np,2,0,"th",54),a()(),n(20,"tbody"),g(21,xp,20,21,"tr",55),a(),g(22,bp,13,10,"tfoot",56),a()()}if(i&2){let e=s(2);o(8),m("ngIf",e.column.Date.selected),o(),m("ngIf",e.column.Customer.selected),o(),Nt(e.column.JoinDate.selected?10:-1),o(),Nt(e.column.Groups.selected?11:-1),o(),m("ngIf",e.column.SalesPerson.selected),o(),m("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),m("ngIf",e.column.Gross.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),m("ngIf",e.data.SurchargeVisible),o(),m("ngIf",e.column.Total.selected),o(),m("ngIf",e.column.Payment.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data)}}function Mp(i,c){if(i&1){let e=F();n(0,"span",83),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",84),p(2,"?"),a()()}}function Vp(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=s(2);o(),P(C(2,1,e.listTotal))}}function Bp(i,c){if(i&1){let e=F();n(0,"a",85),T("click",function(){u(e);let t=s(2);return _(t.NextPage(!0))}),I(1,"i",86),p(2," Next"),a()}}function Op(i,c){if(i&1){let e=F();n(0,"a",87),T("click",function(){u(e);let t=s(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),I(1,"i",88),p(2," Last"),a()}}function Lp(i,c){if(i&1&&(n(0,"content")(1,"div",29),g(2,Ep,23,14,"div",30),n(3,"div",31)(4,"div",32)(5,"div",33),p(6),d(7,"number"),g(8,Mp,3,0,"span",34)(9,Vp,3,3,"span",4),p(10),a()(),n(11,"div",35),g(12,Bp,3,0,"a",36)(13,Op,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,r,t,l,f){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=f}roleService=Ge(G);columnService=Ge(vt);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>M.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(Tn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.CustomerName=t.CustomerName==null?"":t.CustomerName,l.CustomerName=l.CustomerName==null?"":l.CustomerName,t.SalesName=t.SalesName==null?"":t.SalesName,l.SalesName=l.SalesName==null?"":l.SalesName,e.active){case"outlet":return this.compare(t.EntityName?.toLowerCase(),l.EntityName?.toLowerCase(),f);case"number":return this.compare(t.Number,l.Number,f);case"date":return this.compare(t.Date,l.Date,f);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),f);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),f);case"cost":return this.compare(t.Cost,l.Cost,f);case"gross":return this.compare(t.Gross,l.Gross,f);case"sales":return this.compare(t.Sales,l.Sales,f);case"tax":return this.compare(t.Tax,l.Tax,f);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,f);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,f);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,f);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,f);case"groups":return this.compare(t.Groups,l.Groups,f);default:return 0}})}openExportModal(){this._matDialog.open(q,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=M.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=M.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");M.IsNotEmpty(r)&&(this.pageData.Filter.From=M.MinDate,this.pageData.Filter.To=M.MinDate),(e.From=="01010001"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(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 forders",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all orders",3,"click",4,"ngIf"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","outlet",2,"width","100px"],["mat-sort-header","number"],["mat-sort-header","date",4,"ngIf"],["mat-sort-header","customer",4,"ngIf"],["mat-sort-header","joinDate"],["mat-sort-header","groups"],["mat-sort-header","salesPerson",4,"ngIf"],["mat-sort-header","cost","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","gross","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","sales","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","tax","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","surcharge","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","total","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","payment","style","width: 50px",4,"ngIf"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","date"],["mat-sort-header","customer"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["mat-sort-header","total","arrowPosition","before",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],["target","_blank",3,"routerLink","queryParams"],["class","text-end text-danger",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-start",3,"ngClass",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-start",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],["class","empty-column",4,"ngIf"],["class","text-end empty-column",4,"ngIf"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more forders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all orders",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",2),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Hl,3,0,"button",3),a(),n(3,"filters"),g(4,jl,36,22,"ng-template",null,0,V),a(),g(6,Lp,14,9,"content",4),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(4),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,De,Le,yi,Q,Ye,oe,ie,ee,X],encapsulation:2})};var Rp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],kp=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],Wp=()=>["/menu/Products/Setup/Brand/Brand_Form"],Np=i=>({ID:i}),Ap=(i,c)=>({BrandID:i,Name:c});function Gp(i,c){if(i&1){let e=F();n(0,"button",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export"),a()}}function Hp(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Qp(i,c){i&1&&(n(0,"th",24),p(1,"Code"),a())}function Yp(i,c){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=s().$implicit;o(),P(e.Code)}}function jp(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",25),p(3),a()(),g(4,Yp,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,Wp))("queryParams",U(12,Np,e.ID)),o(),v("",e.BrandName," "),o(),m("ngIf",e.Countcode>0),o(2),m("queryParams",de(14,Ap,e.ID,e.BrandName)),o(),P(C(8,7,e.Quantity)),o(3),P(C(11,9,e.Total))}}function qp(i,c){if(i&1){let e=F();n(0,"div",15)(1,"table",16),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"Brand"),a(),g(6,Qp,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,jp,12,17,"tr",22),a(),n(13,"tfoot")(14,"tr",23)(15,"td"),p(16,"Total"),a(),n(17,"td"),p(18),d(19,"sum"),d(20,"quantityFraction"),a(),n(21,"td"),p(22),d(23,"sum"),d(24,"amountFraction"),a()()()()()}if(i&2){let e=s();o(6),m("ngIf",e.data.Countcode>0),o(6),m("ngForOf",e.data.Data),o(6),P(C(20,7,y(19,4,e.data.Data,"Quantity"))),o(4),P(C(24,12,y(23,9,e.data.Data,"Total")))}}var Fn=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=f;this.matDialog=w}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,f);case"Code":return this.compare(t.Code,l.Code,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Gp,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,Hp,9,6,"ng-template",null,0,V),a(),n(16,"content"),g(17,qp,25,14,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(8,Rp)),o(3),m("routerLink",b(9,kp)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,pe,ae,ge,Q,oe,X,J],encapsulation:2})};function Up(i,c){if(i&1){let e=F();n(0,"label",3),T("click",function(){let t=u(e).$implicit,l=s();return _(l.updateSelectedGroups(t.ID))}),I(1,"input",4),n(2,"span"),p(3),a()()}if(i&2){let e=c.$implicit,r=s();o(),m("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),P(e.Name)}}var In=class i{constructor(c,e){this.dialogRef=c;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(c){let e=this.IDGroups.indexOf(c);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(c)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(D(Zt),D($t))};static \u0275cmp=E({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:4,vars:2,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),T("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),g(3,Up,4,3,"label",2),a()()()),e&2&&(m("title","Edit Groups"),o(3),m("ngForOf",r.options))},dependencies:[Y,ei],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var Kp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],zp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Xp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Jp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Zp=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],$p=()=>["/menu/Contacts/Contact/Customers/Info"],em=i=>({ID:i});function tm(i,c){if(i&1){let e=F();n(0,"button",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function im(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function nm(i,c){i&1&&(n(0,"th",31),p(1," ORDERS "),a())}function am(i,c){i&1&&(n(0,"th",32),p(1," QTY "),a())}function om(i,c){i&1&&(se(0),n(1,"th",33),p(2," COST "),a(),ce())}function rm(i,c){i&1&&(n(0,"th",34),p(1," SALES "),a())}function lm(i,c){i&1&&(n(0,"th",35),p(1," TAX "),a())}function pm(i,c){i&1&&(n(0,"th",36),p(1," SALES + TAX "),a())}function mm(i,c){if(i&1){let e=F();n(0,"span")(1,"span"),p(2),a(),n(3,"a",45),T("click",function(){u(e);let t=s(2).$implicit,l=s(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=c.$implicit,r=c.index;o(2),P(r==0?"":" , "),o(2),P(e.GroupName)}}function sm(i,c){if(i&1&&(n(0,"span"),g(1,mm,5,2,"span",38),a()),i&2){let e=s().$implicit;o(),m("ngForOf",e.Groups)}}function cm(i,c){if(i&1){let e=F();n(0,"a",45),T("click",function(){u(e);let t=s().$implicit,l=s(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function dm(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 um(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 _m(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 gm(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 fm(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 Cm(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 xm(i,c){if(i&1&&(n(0,"tr")(1,"td")(2,"a",39),p(3),a(),n(4,"div",40),g(5,sm,2,1,"span",25)(6,cm,2,0,"a",41),a()(),n(7,"td")(8,"span",42),p(9),a()(),g(10,dm,3,3,"td",43)(11,um,3,3,"td",43)(12,_m,4,3,"ng-container",25)(13,gm,3,3,"td",43)(14,fm,3,3,"td",44)(15,Cm,3,3,"td",43),a()),i&2){let e=c.$implicit,r=s(3);o(2),m("routerLink",b(13,$p))("queryParams",U(14,em,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",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),v("",e.Code," "),o(),m("ngIf",r.column.Orders.selected),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),m("ngIf",r.column.Sales.selected),o(),m("ngIf",r.column.Tax.selected),o(),m("ngIf",r.column.SalesNTax.selected)}}function hm(i,c){if(i&1&&(n(0,"tbody",37),g(1,xm,16,16,"tr",38),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function Sm(i,c){if(i&1){let e=F();n(0,"div",17)(1,"div",18)(2,"table",19),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(3,"thead",20)(4,"tr")(5,"th",21),p(6,"CUSTOMER"),a(),n(7,"th",22),p(8," CODE "),a(),g(9,nm,2,0,"th",23)(10,am,2,0,"th",24)(11,om,3,0,"ng-container",25)(12,rm,2,0,"th",26)(13,lm,2,0,"th",27)(14,pm,2,0,"th",28),a()(),g(15,hm,2,1,"tbody",29),a()(),n(16,"infinite-pagination",30),T("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=s();o(9),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.column.Sales.selected),o(),m("ngIf",e.column.Tax.selected),o(),m("ngIf",e.column.SalesNTax.selected),o(),m("ngIf",e.data.Data),o(),m("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var bn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=f}roleService=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=M.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(Rt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,f);case"Code":return this.compare(t.Code,l.Code,f);case"Orders":return this.compare(t.Orders,l.Orders,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Sales":return this.compare(t.Sales,l.Sales,f);case"Tax":return this.compare(t.Tax,l.Tax,f);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,f);case"Cost":return this.compare(t.Cost,l.Cost,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(In,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let f={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",f).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(q,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,tm,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," By Age "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),I(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),g(24,im,16,10,"ng-template",null,0,V),a(),n(26,"content"),g(27,Sm,17,13,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(12,Kp)),o(3),m("routerLink",b(13,zp)),o(3),m("routerLink",b(14,Xp)),o(3),m("routerLink",b(15,Jp)),o(4),m("routerLink",b(16,Zp)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,pe,ae,ge,Qe,Q,ii,ie,X,J],encapsulation:2})};var ym=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Dm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],vm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],wm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Tm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Pm(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function Fm(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Im(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),P(C(5,4,e.TotalOrders)),o(3),P(C(8,6,e.TotalCost)),o(3),P(C(11,8,e.TotalAmount))}}function bm(i,c){if(i&1&&(n(0,"tbody",24),g(1,Im,12,10,"tr",25),a()),i&2){let e=s(2);o(),m("ngForOf",e.data.Data)}}function Em(i,c){if(i&1){let e=F();n(0,"div",16)(1,"table",17),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"AGE"),a(),n(6,"th",20),p(7," ORDERS"),a(),n(8,"th",21),p(9," COST"),a(),n(10,"th",22),p(11," AMOUNT"),a()()(),g(12,bm,2,1,"tbody",23),a()()}if(i&2){let e=s();o(12),m("ngIf",e.data.Data)}}var En=class i extends he{constructor(e,r,t,l,f,w){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f;this.datePipe=w}preInitList(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,f);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,f);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,f);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,f);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(q,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Pm,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,Fm,13,8,"ng-template",null,0,V),a(),n(25,"content"),g(26,Em,13,1,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(11,ym)),o(3),m("routerLink",b(12,Dm)),o(3),m("routerLink",b(13,vm)),o(3),m("routerLink",b(14,wm)),o(3),m("routerLink",b(15,Tm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,Q,ie,X],encapsulation:2})};var Mm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],Vm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],Bm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Om=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Lm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Rm(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function km(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Wm(i,c){i&1&&(n(0,"th",25),p(1," ORDERS"),a())}function Nm(i,c){i&1&&(n(0,"th",26),p(1," QUANTITY"),a())}function Am(i,c){i&1&&(n(0,"th",27),p(1," AMOUNT"),a())}function Gm(i,c){if(i&1&&(n(0,"td",30),p(1),d(2,"number"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.TotalOrders))}}function Hm(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 Qm(i,c){if(i&1&&(n(0,"td",31),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.TotalAmount))}}function Ym(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),g(3,Gm,3,3,"td",28)(4,Hm,3,3,"td",28)(5,Qm,3,3,"td",29),a()),i&2){let e=c.$implicit,r=s(2);o(2),v(" ",e.Name," "),o(),m("ngIf",r.column.Orders.selected),o(),m("ngIf",r.column.QTY.selected),o(),m("ngIf",r.column.Amount.selected)}}function jm(i,c){if(i&1){let e=F();n(0,"div",16)(1,"table",17),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"GENDER"),a(),g(6,Wm,2,0,"th",20)(7,Nm,2,0,"th",21)(8,Am,2,0,"th",22),a()(),n(9,"tbody",23),g(10,Ym,6,4,"tr",24),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.Orders.selected),o(),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.Amount.selected),o(2),m("ngForOf",e.data==null?null:e.data.Data)}}var Mn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=f}roleService=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(){M.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,f);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,f);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,f);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,f);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(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(r){return new(r||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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,Rm,3,0,"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,km,13,8,"ng-template",null,0,V),a(),n(25,"content"),g(26,jm,11,4,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Mm)),o(3),m("routerLink",b(13,Vm)),o(3),m("routerLink",b(14,Bm)),o(3),m("routerLink",b(15,Om)),o(3),m("routerLink",b(16,Lm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,B,L,ae,ge,Q,ie,X,J],encapsulation:2})};var Dr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],qm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Um=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Km=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],zm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Xm=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Jm=()=>["/menu/Contacts/Contact/Suppliers/Info"],Zm=i=>({ID:i}),$m=(i,c,e)=>({From:i,SupplierID:c,To:e});function es(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function ts(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.GroupID),m("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("max",1e4),x("ngModel",e.pageData.Filter.RowCount)}}function is(i,c){if(i&1&&(n(0,"tr",26)(1,"td"),p(2),a(),n(3,"td",27)(4,"a",28),p(5),a()(),n(6,"td",29),p(7),a(),n(8,"td",30),p(9),d(10,"quantityFraction"),a(),n(11,"td",29)(12,"a",28),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=c.$implicit,r=s(2);o(2),P(e.Rank),o(2),m("routerLink",b(19,Jm))("queryParams",U(20,Zm,e.SupplierID)),o(),P(e.Name),o(2),P(e.Code),o(2),v(" ",C(10,9,e.Quantity)," "),o(3),m("routerLink",b(22,Dr))("queryParams",st(23,$m,y(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,y(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),v(" ",C(16,17,e.Total),"")}}function ns(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",31),I(2,"th",32),n(3,"th",29),p(4,"Total Quantity"),a(),n(5,"th",29),p(6,"Total Sales"),a()(),n(7,"tr"),I(8,"td",33),n(9,"td",29),p(10),a(),n(11,"td",29),p(12),a()()()),i&2){let e=s(2);o(10),P(e.data.TotalQty),o(2),P(e.data.TotalSales)}}function as(i,c){if(i&1){let e=F();n(0,"div",17)(1,"table",18),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"RANK"),a(),n(6,"th",21),p(7,"SUPPLIER"),a(),n(8,"th",22),p(9," CODE "),a(),n(10,"th",23),p(11," QUANTITY "),a(),n(12,"th",24),p(13," TOTAL "),a()()(),n(14,"tbody"),g(15,is,17,27,"tr",25),a(),g(16,ns,13,2,"tfoot"),a()()}if(i&2){let e=s();o(15),m("ngForOf",e.data.Data),o(),Nt((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?16:-1)}}var Vn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,f);case"Supplier":return this.compare(t.Name,l.Name,f);case"Code":return this.compare(t.Code,l.Code,f);case"Quantity":return this.compare(t.Quantity,l.Quantity,f);case"Total":return this.compare(t.Total,l.Total,f);default:return 0}})}openExportModal(){this.matDialog.open(q,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,es,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,ts,16,10,"ng-template",null,0,V),a(),n(28,"content"),g(29,as,17,2,"div",7),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(12,Dr)),o(3),m("routerLink",b(13,qm)),o(3),m("routerLink",b(14,Um)),o(3),m("routerLink",b(15,Km)),o(3),m("routerLink",b(16,zm)),o(3),m("routerLink",b(17,Xm)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,z,K,ke,B,L,ae,ge,Qe,Q,ee,X,J],encapsulation:2})};var vr=Qt(Oi());var rs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],ls=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],ps=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],ms=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ss=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],cs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],ds=(i,c,e,r,t)=>({From:i,To:c,ListIDs:e,ListVariantID:r,GroupByVariant:t}),us=i=>[i],_s=i=>({ID:i}),gs=(i,c,e,r,t,l)=>({ID:i,From:c,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),wr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],fs=(i,c,e)=>({VariantID:i,From:c,To:e}),Cs=(i,c,e)=>({ProductID:i,From:c,To:e});function xs(i,c){if(i&1&&(n(0,"a",9),I(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=s();m("queryParams",qi(1,ds,(e=r.queryParams())==null?null:e.From,(e=r.queryParams())==null?null:e.To,(e=r.queryParams())==null?null:e.ListIDs,(e=r.queryParams())==null?null:e.ListVariantID,(e=r.queryParams())==null?null:e.GroupByVariant))}}function hs(i,c){if(i&1){let e=F();n(0,"button",11),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",12),p(2," Export "),a()}}function Ss(i,c){if(i&1){let e=F();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(15,"h6"),p(16,"Product Tag"),a(),n(17,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(18,"h6"),p(19,"Sales Person"),a(),n(20,"sales-person-selector",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(27,"h6"),p(28,"Logistics Service"),a(),n(29,"ng-select",24),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(33,"h6"),p(34,"Customer Group"),a(),n(35,"ng-select",26),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(39,"h6"),p(40,"Product Type"),a(),n(41,"radio-options",28),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(42,"h6"),p(43,"Multiply Unit Quantity"),a(),n(44,"radio-options",29),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),x("date",e.pageData.Filter.From),m("showClearBtn",!0)("showTodayBtn",!0),o(2),x("date",e.pageData.Filter.To),m("showClearBtn",!0)("showTodayBtn",!0),o(3),m("multiple",!0)("multiple",!0),x("ngModel",e.pageData.Filter.BrandIDs),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Tags),x("ngModel",e.pageData.Filter.TagID),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("model",e.pageData.Filter.GroupByVariant),m("options",e.scopeFilter),o(3),x("ngModel",e.pageData.Filter.TypeID),m("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),x("ngModel",e.pageData.Filter.LogisticsServiceID),m("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),x("ngModel",e.pageData.Filter.SupplierID),m("inputTextValue",e.pageData.supplierName),o(3),m("items",e.pageData.Options.ContactGroups),x("ngModel",e.pageData.Filter.ContactGroupID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("model",e.pageData.Filter.ProductType),m("options",e.pageData.Options.ProductTypes),o(3),x("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function ys(i,c){if(i&1){let e=F();n(0,"th",48)(1,"div",49)(2,"input",50),T("change",function(t){u(e);let l=s(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=s(2);o(2),m("checked",e.isAllCheckBoxChecked())}}function Ds(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 vs(i,c){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function ws(i,c){i&1&&(n(0,"th",53),p(1," Cost "),a())}function Ts(i,c){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function Ps(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 Fs(i,c){i&1&&(n(0,"th",56),p(1," Tax "),a())}function Is(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 bs(i,c){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function Es(i,c){i&1&&(n(0,"th",59),p(1," % "),a())}function Ms(i,c){if(i&1){let e=F();n(0,"td")(1,"div",49)(2,"input",71),S("ngModelChange",function(t){u(e);let l=s().$implicit;return h(l.checked,t)||(l.checked=t),_(t)}),T("ngModelChange",function(){u(e);let t=s(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=s().$implicit;o(2),m("value",e.ID),x("ngModel",e.checked)}}function Vs(i,c){if(i&1){let e=F();se(0),n(1,"img",72),T("click",function(t){u(e);let l=s().$implicit,f=s(2);return _(f.openBigPicture(l==null?null:l.ImageURL,t))}),a(),ce()}if(i&2){let e=s().$implicit;o(),m("src",e.ThumbnailUrl,Hi)}}function Bs(i,c){if(i&1){let e=F();n(0,"a",73)(1,"img",74),T("click",function(t){u(e);let l=s().$implicit,f=s(2);return _(f.openBigPicture(l,t))}),a()()}if(i&2){let e=s(3);m("target",e.pageData.LinkTarget)}}function Os(i,c){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=s().$implicit,t=s(2);o(),m("queryParams",ho(4,gs,r.ID,(e=t.queryParams())==null?null:e.From,(e=t.queryParams())==null?null:e.To,(e=t.queryParams())==null?null:e.ListIDs,(e=t.queryParams())==null?null:e.ListVariantID,(e=t.queryParams())==null?null:e.GroupByVariant)),o(),P(C(3,2,r.Quantity))}}function 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.OnHand)," ")}}function Rs(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 ks(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 Ws(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,r=s(2);m("routerLink",b(11,wr))("queryParams",st(12,fs,e.ID,y(1,3,r.pageData.Filter.From,"ddMMyyyy"),y(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),P(C(4,9,e.Sales))}}function Ns(i,c){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=s(2).$implicit,r=s(2);m("routerLink",b(11,wr))("queryParams",st(12,Cs,e.ID,y(1,3,r.pageData.Filter.From,"ddMMyyyy"),y(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),P(C(4,9,e.Sales))}}function As(i,c){if(i&1&&(n(0,"td",75),g(1,Ws,5,16,"a",78)(2,Ns,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 Gs(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 Hs(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 Qs(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 Ys(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 js(i,c){if(i&1&&(n(0,"tr",60),g(1,Ms,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),g(7,Vs,2,1,"ng-container",8)(8,Bs,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),g(14,Os,4,11,"td",67)(15,Ls,3,3,"td",67)(16,Rs,3,3,"td",68)(17,ks,3,3,"td",67)(18,As,3,2,"td",67)(19,Gs,3,3,"td",69)(20,Hs,3,3,"td",67)(21,Qs,3,4,"td",70)(22,Ys,3,4,"td",70),a()),i&2){let e=c.$implicit,r=c.index,t=s(2);o(),m("ngIf",t.column.CompareQtySold.selected),o(2),P(r+1),o(4),m("ngIf",e.ImageURL),o(),m("ngIf",!e.ImageURL),o(2),m("routerLink",U(17,us,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(19,_s,e.ID)),o(),P(e.Name),o(2),P(e.Code),o(),m("ngIf",t.column.QTY.selected),o(),m("ngIf",t.column.OnHand.selected),o(),m("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),m("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),m("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function qs(i,c){i&1&&I(0,"td",75)}function Us(i,c){i&1&&(n(0,"td",75),p(1," Total : "),a())}function Ks(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 zs(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 Xs(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 Js(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 Zs(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),P(C(4,4,y(3,1,e.infiniteList,"Sales")))}}function $s(i,c){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),P(C(4,4,y(3,1,e.infiniteList,"Tax")))}}function e0(i,c){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=s(3);o(2),P(C(4,4,y(3,1,e.infiniteList,"SalesNTax")))}}function t0(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 i0(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 n0(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",81),I(2,"td",75),g(3,qs,1,0,"td",67)(4,Us,2,0,"td",67)(5,Ks,4,6,"td",67)(6,zs,4,6,"td",67)(7,Xs,4,6,"td",68)(8,Js,4,6,"td",67)(9,Zs,5,6,"td",82)(10,$s,5,6,"td",69)(11,e0,5,6,"td",82)(12,t0,5,10,"td",70)(13,i0,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 a0(i,c){if(i&1){let e=F();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(4,"thead",33)(5,"tr"),g(6,ys,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),g(11,Ds,2,1,"th",37)(12,vs,2,0,"th",38)(13,ws,2,0,"th",39)(14,Ts,2,0,"th",40)(15,Ps,2,1,"th",41)(16,Fs,2,0,"th",42)(17,Is,2,1,"th",43)(18,bs,2,0,"th",44)(19,Es,2,0,"th",45),a()(),n(20,"tbody"),g(21,js,23,21,"tr",46),a(),g(22,n0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),T("nextPage",function(){u(e);let t=s();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=s();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=s();o(6),m("ngIf",e.column.CompareQtySold.selected),o(5),m("ngIf",e.column.QTY.selected),o(),m("ngIf",e.column.OnHand.selected),o(),m("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),m("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),m("ngForOf",e.infiniteList),o(),m("ngIf",e.data),o(),m("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Bn=class i extends he{constructor(e,r,t,l,f,w,Ee){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,f);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=f;this.matDialog=w;this.bigPicture=Ee}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=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=mt([]);queryParams=mt(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=et(Je({},this.data),{Data:e.Data.map(t=>et(Je({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=et(Je({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=et(Je({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>et(Je({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;M.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||M.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||M.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,Bi.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=et(Je({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return M.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Code":return M.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),f);case"Brand":return M.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),f);case"Quantity":return M.compare(t.Quantity,l.Quantity,f);case"Total_Cost":return M.compare(t.UnitCost,l.UnitCost,f);case"Inventory":return M.compare(t.OnHand,l.OnHand,f);case"Total_Sales":return M.compare(t.Total,l.Total,f);case"Total_Tax":return M.compare(t.Tax,l.Tax,f);case"Total_Tax_Sales":return M.compare(t.SalesNTax,l.SalesNTax,f);case"ReOrder":return M.compare(t.MinStock,l.MinStock,f);case"Gross":return M.compare(t.Gross,l.Gross,f);case"Margin":return M.compare(t.Margin,l.Margin,f);case"Profit":return M.compare(t.Profit,l.Profit,f);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,vr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(D(W),D(O),D(H),D(Ke),D(Oe),D(j),D(Dn))};static \u0275cmp=E({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[R],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),T("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),g(2,xs,3,7,"a",2)(3,hs,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,Ss,45,36,"ng-template",null,0,V),a(),g(29,a0,24,18,"content",8),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),m("column",t.column),o(2),m("ngIf",t.isAnyItemChecked),o(),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,rs)),o(3),m("routerLink",b(15,ls)),o(3),m("routerLink",b(16,ps)),o(3),m("routerLink",b(17,ms)),o(3),m("routerLink",b(18,ss)),o(3),m("routerLink",b(19,cs)),o(5),m("ngIf",t.data))},dependencies:[N,He,Y,k,A,z,K,Po,B,L,pe,ae,ge,De,Le,fe,Q,Ye,ii,oe,ee,X,J],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var o0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],r0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],l0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],p0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],m0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],s0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],c0=i=>({ID:i});function d0(i,c){if(i&1){let e=F();n(0,"a",15),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",16),p(2," Export "),a()}}function u0(i,c){if(i&1){let e=F();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales"),a(),n(6,"sales-person-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Category"),a(),n(9,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(10,"h6"),p(11,"Brand"),a(),n(12,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(13,"h6"),p(14,"Supplier"),a(),n(15,"autocompleteV2",22),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",23),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(20,"div",24)(21,"datepicker",25),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(22,"h6"),p(23,"Scope"),a(),n(24,"radio-options",26),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(3),x("ngModel",e.pageData.Filter.SupplierID),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function _0(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e,r=c.$implicit;dt("matTooltip",r.Name),o(),v(" ",(e=r.Code)!==null&&e!==void 0?e:r.Name," ")}}function g0(i,c){if(i&1&&(n(0,"td",13),p(1),a()),i&2){let e=c.$implicit;o(),v(" ",e," ")}}function f0(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,g0,2,1,"td",31),n(7,"td",13),p(8),a()()),i&2){let e=c.$implicit,r=s();o(2),m("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",U(6,c0,e.ID)),o(),v(" ",e.Name,""),o(2),P(e.Code),o(),m("ngForOf",e.Quantities),o(2),P(e.Total)}}var On=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,d0,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,u0,25,14,"ng-template",null,0,V),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),n(35,"th",11),p(36,"Code"),a(),g(37,_0,2,2,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,f0,9,8,"tr",14),a()()()()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(13,o0)),o(3),m("routerLink",b(14,r0)),o(3),m("routerLink",b(15,l0)),o(3),m("routerLink",b(16,p0)),o(3),m("routerLink",b(17,m0)),o(3),m("routerLink",b(18,s0)),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 C0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],x0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],h0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],S0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],y0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],D0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],v0=i=>[i],w0=i=>({ID:i});function T0(i,c){if(i&1){let e=F();n(0,"a",16),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",17),p(2," Export"),a()}}function P0(i,c){if(i&1){let e=F();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Compare Month From"),a(),n(9,"ng-select",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a(),n(10,"h6"),p(11,"Compare Month To"),a(),n(12,"ng-select",22),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MonthTo,t)||(l.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 l=s();return h(l.pageData.Filter.Year,t)||(l.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 l=s();return h(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.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 F0(i,c){if(i&1&&(n(0,"th",25),p(1),a()),i&2){let e=c.$implicit,r=s();o(),v(" ",r.months[e.Month-1].ColumnLabel," ")}}function I0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,r=s().$implicit,t=s();o(),v(" ",t.findKey(r.Sold,e.Month)?y(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):""," ")}}function b0(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,I0,3,4,"td",28),n(7,"td",29),p(8),d(9,"sum"),d(10,"number"),a()()),i&2){let e=c.$implicit,r=s();o(2),m("routerLink",U(12,v0,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",U(14,w0,e.ID)),o(),v(" ",e.Name," "),o(2),P(e.Code),o(),m("ngForOf",r.data==null?null:r.data.MonthlySales),o(2),v(" ",y(10,9,y(9,6,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function E0(i,c){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=c.$implicit,r=s(2);o(),v(" ",y(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function M0(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",30),I(2,"td")(3,"td"),g(4,E0,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,r,t,l,f){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}years=M.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),f);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),f);default:return 0}})}static \u0275fac=function(r){return new(r||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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,T0,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,P0,19,14,"ng-template",null,0,V),a(),n(28,"content")(29,"div",7)(30,"table",8),T("matSortChange",function(w){return u(l),_(t.sortData(w))}),n(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),n(35,"th",11),p(36,"Code"),a(),g(37,F0,2,1,"th",12),n(38,"th",13),p(39,"Total"),a()()(),n(40,"tbody"),g(41,b0,11,16,"tr",14),a(),g(42,M0,9,8,"tfoot",15),a()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(14,C0)),o(3),m("routerLink",b(15,x0)),o(3),m("routerLink",b(16,h0)),o(3),m("routerLink",b(17,S0)),o(3),m("routerLink",b(18,y0)),o(3),m("routerLink",b(19,D0)),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 V0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],B0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],O0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],L0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],R0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],k0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],W0=i=>[i],N0=i=>({ID:i});function A0(i,c){if(i&1){let e=F();n(0,"button",16),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",17),p(2," Export"),a()}}function G0(i,c){if(i&1){let e=F();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",21),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",22)(12,"datepicker",23),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",24),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),T("modelChange",function(){u(e);let t=s();return _(t.getListData())}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("model",e.pageData.Filter.Product),m("options",e.scopeFilter)}}function H0(i,c){if(i&1&&(n(0,"th",26),p(1),a()),i&2){let e=c.$implicit;o(),P(e)}}function Q0(i,c){if(i&1&&(n(0,"tr"),I(1,"th")(2,"th"),g(3,H0,2,1,"th",25),a()),i&2){let e=s();o(3),m("ngForOf",e.data==null?null:e.data.Outlet)}}function Y0(i,c){if(i&1&&(n(0,"th",27),p(1),a()),i&2){let e=c.$implicit;o(),v(" ",e,"")}}function j0(i,c){if(i&1&&(se(0),n(1,"a",29),p(2),a(),ce()),i&2){let e=s().$implicit,r=s().$implicit,t=s();o(),m("routerLink",U(3,W0,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",U(5,N0,r[1])),o(),P(r[e])}}function q0(i,c){if(i&1&&p(0),i&2){let e=s().$implicit,r=s().$implicit;v(" ",r[e]," ")}}function U0(i,c){if(i&1&&(n(0,"td",13),g(1,j0,3,7,"ng-container",28)(2,q0,1,1,"ng-template",null,1,V),a()),i&2){let e=c.index,r=Ze(3);o(),m("ngIf",e===0)("ngIfElse",r)}}function K0(i,c){if(i&1&&(n(0,"tr",13),g(1,U0,4,2,"td",15),a()),i&2){let e=c.$implicit,r=s();o(),m("ngForOf",r.getFilteredKeys(e))}}var Rn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(q,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",2),S("textChange",function(w){return u(l),h(t.pageData.Filter.Text,w)||(t.pageData.Filter.Text=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,A0,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,G0,16,10,"ng-template",null,0,V),a(),n(28,"content")(29,"div",8)(30,"table",9)(31,"thead",10),g(32,Q0,4,1,"tr",11),n(33,"tr")(34,"th",12),p(35,"Name"),a(),n(36,"th",13),p(37,"Code"),a(),g(38,Y0,2,1,"th",14),a()(),n(39,"tbody"),g(40,K0,2,1,"tr",15),a()()()()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(14,V0)),o(3),m("routerLink",b(15,B0)),o(3),m("routerLink",b(16,O0)),o(3),m("routerLink",b(17,L0)),o(3),m("routerLink",b(18,R0)),o(3),m("routerLink",b(19,k0)),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 z0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],X0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],J0=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],Z0=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),Tr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],$0=(i,c,e)=>({CategoryID:i,From:c,To:e}),ec=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],Pr=i=>({CategoryID:i});function tc(i,c){if(i&1){let e=F();n(0,"button",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function ic(i,c){if(i&1&&(n(0,"span",22),p(1),a()),i&2){let e=c.item;dt("matTooltip",e.Value),o(),P(e.Value)}}function nc(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),g(10,ic,2,2,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Discount Calculation"),a(),n(25,"ng-select",20),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(26,"h6"),p(27,"Hide Zero & Negative"),a(),n(28,"radio-options",21),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Brands),x("ngModel",e.pageData.Filter.BrandID),o(5),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.SalesID),o(3),x("ngModel",e.pageData.Filter.CustomerID),o(3),x("ngModel",e.pageData.Filter.CalculationDiscount),m("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),x("model",e.pageData.Filter.ExcludeZero)}}function ac(i,c){i&1&&(n(0,"th",42),p(1," Cost "),I(2,"p-treeTableSortIcon",43),a())}function oc(i,c){i&1&&(n(0,"th",44),p(1," Profit "),I(2,"p-treeTableSortIcon",45),a())}function rc(i,c){i&1&&(n(0,"th",46),p(1," % "),I(2,"p-treeTableSortIcon",47),a())}function lc(i,c){if(i&1&&(n(0,"tr",28)(1,"th",29),p(2," Category "),I(3,"p-treeTableSortIcon",30),a(),n(4,"th",31),p(5," Qty "),I(6,"p-treeTableSortIcon",32),a(),g(7,ac,3,0,"th",33),n(8,"th",34),p(9," Gross "),I(10,"p-treeTableSortIcon",35),a(),n(11,"th",36),p(12," Disc "),I(13,"p-treeTableSortIcon",37),a(),n(14,"th",38),p(15," Sales "),I(16,"p-treeTableSortIcon",39),a(),g(17,oc,3,0,"th",40)(18,rc,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 pc(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),P(C(5,6,e.DisplayedCost))}}function mc(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),P(C(5,6,e.DisplayedProfit))}}function sc(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 cc(i,c){if(i&1&&(n(0,"td"),g(1,sc,5,10,"span",58),a()),i&2){let e=s(3);o(),m("ngIf",e.roleService.report.Profit)}}function dc(i,c){if(i&1&&(n(0,"tr",48)(1,"td"),I(2,"p-treeTableToggler",49),n(3,"a",50),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",22),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),g(13,pc,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,mc,6,8,"td",55)(34,cc,2,1,"td",7),a()),i&2){let e=c.$implicit,r=c.rowData,t=s(2);m("ttRow",e),o(2),m("rowNode",e),o(),m("routerLink",b(50,Tr))("queryParams",st(51,$0,r.ID,y(4,20,t.pageData.Filter.From,"yyyy-MM-dd"),y(5,23,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),P(r.Name),o(2),dt("matTooltip",r.QuantityIndirect&&r.Quantity?"Direct ("+C(9,26,r.Quantity)+") Indirect ("+C(10,28,r.QuantityIndirect)+")":""),o(3),P(C(12,30,r.DisplayedQuantity)),o(2),m("ngIf",t.roleService.product.Cost),o(2),dt("matTooltip",r.GrossIndirect&&r.GrossSales?"Direct ("+C(16,32,r.GrossSales)+") Indirect ("+C(17,34,r.GrossIndirect)+")":""),o(3),P(C(19,36,r.DisplayedGross)),o(3),dt("matTooltip",r.DiscountIndirect&&r.Discount?"Direct ("+C(22,38,r.Discount)+") Indirect ("+C(23,40,r.DiscountIndirect)+")":""),m("routerLink",b(55,ec))("queryParams",U(56,Pr,r.ID)),o(3),P(C(25,42,r.DisplayedTotalDiscount)),o(3),dt("matTooltip",r.NetSalesIndirect&&r.Sales?"Direct ("+C(28,44,r.Sales)+") Indirect ("+C(29,46,r.NetSalesIndirect)+")":""),o(3),m("routerLink",b(58,Tr))("queryParams",U(59,Pr,r.ID)),o(),P(C(32,48,r.DisplayedNetSales)),o(2),m("ngIf",t.roleService.report.Profit),o(),m("ngIf",t.roleService.report.Profit)}}function uc(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 _c(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 gc(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 fc(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,uc,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,_c,3,3,"td",61)(18,gc,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),P(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 Cc(i,c){if(i&1&&(n(0,"content")(1,"div",23)(2,"p-treeTable",24),g(3,lc,19,3,"ng-template",25)(4,dc,35,61,"ng-template",26)(5,fc,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,Z0))}}var kn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(q,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,tc,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,nc,29,15,"ng-template",null,0,V),a(),g(19,Cc,6,5,"content",7),a()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService.global.Export),o(6),m("routerLink",b(10,z0)),o(3),m("routerLink",b(11,X0)),o(3),m("routerLink",b(12,J0)),o(5),m("ngIf",t.data))},dependencies:[N,k,A,z,K,B,L,pe,De,Le,er,Eo,ar,tr,ir,nr,fe,Q,Ye,un,ie,ee,X,J],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var xc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],hc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Sc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function yc(i,c){if(i&1){let e=F();n(0,"a",8),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",9),p(2," Export "),a()}}function Dc(i,c){if(i&1){let e=F();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("accessType",2)("multiple",!0),x("ngModel",e.pageData.Filter.ListIDs),m("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.CustomerID)}}function vc(i,c){if(i&1&&(n(0,"th",23),p(1),a()),i&2){let e=c.$implicit;m("mat-sort-header",e),o(),P(e)}}function wc(i,c){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=s().$implicit;o(),P(e.Value)}}function Tc(i,c){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.Value))}}function Pc(i,c){if(i&1&&(n(0,"td"),g(1,wc,2,1,"span",22)(2,Tc,3,3,"span",22),a()),i&2){let e=c.$implicit;o(),m("ngIf",e.Key=="Category"),o(),m("ngIf",e.Key!="Category")}}function Fc(i,c){if(i&1&&(n(0,"tr"),g(1,Pc,3,2,"td",21),a()),i&2){let e=c.$implicit;o(),m("ngForOf",e)}}function Ic(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 bc(i,c){if(i&1&&(n(0,"tfoot")(1,"tr",24)(2,"td"),p(3,"Total : "),a(),g(4,Ic,3,3,"td",21),a()()),i&2){let e=s(2);o(4),m("ngForOf",e.data.Sum)}}function Ec(i,c){if(i&1){let e=F();n(0,"div",17)(1,"table",18),T("matSortChange",function(t){u(e);let l=s();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr"),g(4,vc,2,2,"th",20),a()(),n(5,"tbody"),g(6,Fc,2,1,"tr",21),a(),g(7,bc,5,1,"tfoot",22),a()()}if(i&2){let e=s();o(4),m("ngForOf",e.data.Dataheader),o(2),m("ngForOf",e.data.Data),o(),m("ngIf",e.data.Data.length>0)}}var Wn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}openExportModal(){this.matDialog.open(q,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let f=e.direction==="asc";for(let w=0;w<this.data.Dataheader.length;w++)if(e.active==this.data.Dataheader[w]){let Ee=t.find(ut=>ut.Key===[this.data.Dataheader[w]].toString()).Value,xt=l.find(ut=>ut.Key===[this.data.Dataheader[w]].toString()).Value;return this.compare(Ee,xt,f)}})}static \u0275fac=function(r){return new(r||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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,yc,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,Dc,16,9,"ng-template",null,0,V),a(),n(19,"content"),g(20,Ec,8,3,"div",7),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),m("routerLink",b(10,xc)),o(3),m("routerLink",b(11,hc)),o(3),m("routerLink",b(12,Sc)),o(6),m("ngIf",t.data))},dependencies:[N,Y,k,A,K,B,L,ae,ge,Le,fe,Q,X],encapsulation:2})};var Mc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Vc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Bc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function Oc(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=s();o(3),x("ngModel",e.pageData.Filter.Month),m("items",e.Months),o(3),x("ngModel",e.pageData.Filter.Year),m("items",e.Years),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options.Currencies)}}function Lc(i,c){if(i&1&&(n(0,"div",11),I(1,"POS-pie-chart",12),a()),i&2){let e=s();o(),m("config",e.pieConfig)("data",e.PieData)}}var Nn=class i extends ne{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=M.Months;Years=M.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),S("textChange",function(w){return u(l),h(t.pageData.Filter.Number,w)||(t.pageData.Filter.Number=w),_(w)}),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),g(16,Oc,10,6,"ng-template",null,0,V),a(),n(18,"content"),g(19,Lc,2,2,"div",6),a()()}r&2&&(m("pageData",t.menuData),x("text",t.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(7),m("routerLink",b(8,Mc)),o(3),m("routerLink",b(9,Vc)),o(3),m("routerLink",b(10,Bc)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,B,L,ni],encapsulation:2})};var Rc=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function kc(i,c){if(i&1){let e=F();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",7),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",8)(9,"datepicker",9),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),m("items",e.pageData.Options.SalesOrderTagIDs),x("ngModel",e.pageData.Filter.SalesOrderTagIDs),m("multiple",!0)}}function Wc(i,c){if(i&1&&(n(0,"content")(1,"div",11)(2,"div",12)(3,"div",13)(4,"div",14)(5,"div",15)(6,"div",16)(7,"p",17),p(8,"Transaction Per Hour"),a()(),n(9,"div",18),I(10,"POS-line-chart",19),a()()()(),n(11,"div",13)(12,"div",14)(13,"div",15)(14,"div",16)(15,"p",17),p(16,"Transaction Per Session"),a()(),n(17,"div",18),I(18,"POS-pie-chart",19),a()()()()()()()),i&2){let e=s();o(10),m("config",e.chartConfig)("data",e.ChartData),o(8),m("config",e.pieConfig)("data",e.PieData)}}var An=class i extends he{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let f={name:l.Name+": "+l.Description,y:l.Transaction};t.push(f)}),this.PieData=t,this.ChartData={series:this.data.series},this.categories=this.data.categories,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(l,f){return l+"<br/>"+f.series.name+": <b>"+f.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions")(2,"a",2),I(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),g(6,kc,13,9,"ng-template",null,0,V),a(),g(8,Wc,19,4,"content",4),a()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("routerLink",b(6,Rc)),o(6),m("ngIf",t.data))},dependencies:[N,k,A,z,K,B,L,ni,Et,Q],encapsulation:2})};function Nc(i,c){if(i&1){let e=F();n(0,"a",4),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",5),p(2," Export "),a()}}function Ac(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",8),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function Gc(i,c){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",19),p(5),d(6,"number"),a(),n(7,"td",19),p(8),d(9,"number"),a(),n(10,"td",19),p(11),d(12,"amountFraction"),a(),n(13,"td",19),p(14),d(15,"amountFraction"),a()()),i&2){let e=c.$implicit;o(2),P(C(3,5,e.Visitor)),o(3),P(C(6,7,e.Orders)),o(3),P(C(9,9,e.TotalVisitor)),o(3),P(C(12,11,e.Sales)),o(3),P(C(15,13,e.Sales/(e.Visitor*e.Orders)))}}function Hc(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,Gc,16,15,"tr",17),a(),n(16,"tfoot")(17,"tr",18)(18,"td",19),p(19,"Total"),a(),n(20,"td",19),p(21),d(22,"sum"),d(23,"number"),a(),n(24,"td",19),p(25),d(26,"sum"),d(27,"number"),a(),n(28,"td",19),p(29),d(30,"sum"),d(31,"amountFraction"),a(),n(32,"td",19),p(33),d(34,"amountFraction"),a()()()()()),i&2){let e=s();o(15),m("ngForOf",e.data),o(6),P(C(23,8,y(22,5,e.data,"Orders"))),o(4),P(C(27,13,y(26,10,e.data,"TotalVisitor"))),o(4),P(C(31,18,y(30,15,e.data,"Sales"))),o(4),P(C(34,20,e.getSpendingPerPersonSum(e.data)))}}var Gn=class i extends ne{constructor(e,r,t,l,f){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(q,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Nc,3,0,"a",2),a(),n(3,"filters"),g(4,Ac,10,6,"ng-template",null,0,V),a(),n(6,"content"),g(7,Hc,35,22,"div",3),a()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(5),m("ngIf",t.data))},dependencies:[N,Y,k,K,B,L,Q,oe,ie,X],encapsulation:2})};var Qc=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function Yc(i,c){if(i&1){let e=F();n(0,"a",18),T("click",function(){u(e);let t=s();return _(t.openExportModal())}),I(1,"i",19),p(2," Export "),a()}}function jc(i,c){if(i&1){let e=F();n(0,"div",20)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",21),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",22),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterFromDate())}),a()(),n(8,"div",23)(9,"datepicker",24),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),T("dateChange",function(){u(e);let t=s();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To)}}function qc(i,c){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Uc(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"amountFraction"),a()),i&2){let e=s().$implicit;o(),P(C(2,1,e.Revenue))}}function Kc(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,Uc,3,3,"td",17),a()),i&2){let e=c.$implicit,r=s();o(2),P(e.TimeFormat),o(2),P(C(5,7,e.Count)),o(3),P(C(8,9,e.Quantity)),o(3),P(C(11,11,e.Sales)),o(3),P(C(15,15,C(14,13,e.Tax))),o(4),P(C(19,19,C(18,17,e.SalesWithTax))),o(3),m("ngIf",r.roleService.product.Cost||r.roleService.report.Profit)}}function zc(i,c){if(i&1&&(n(0,"td",15),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=s();o(),P(C(3,4,y(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var Hn=class i extends he{constructor(e,r,t,l,f){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=f}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(q,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(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(r,t){if(r&1){let l=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),S("filterChange",function(w){return u(l),h(t.pageData.Filter,w)||(t.pageData.Filter=w),_(w)}),n(1,"actions"),g(2,Yc,3,0,"a",2),n(3,"a",3),I(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),g(7,jc,10,6,"ng-template",null,0,V),a(),n(9,"content")(10,"div",5)(11,"table",6)(12,"thead",7)(13,"tr")(14,"th",8),p(15,"Time"),a(),n(16,"th",9),p(17,"Orders"),a(),n(18,"th",9),p(19,"Quantity"),a(),n(20,"th",10),p(21,"Sales"),a(),n(22,"th",10),p(23,"Tax"),a(),n(24,"th",10),p(25,"Sales + Tax"),a(),g(26,qc,2,0,"th",11),a()(),n(27,"tbody"),g(28,Kc,21,21,"tr",12),a(),n(29,"tfoot")(30,"tr",13),I(31,"td",14),n(32,"td",15),p(33),d(34,"sum"),d(35,"number"),a(),n(36,"td",15),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),n(40,"td",15),p(41),d(42,"sum"),d(43,"amountFraction"),a(),n(44,"td",16),p(45),d(46,"sum"),d(47,"RoundUp"),d(48,"amountFraction"),a(),n(49,"td",15),p(50),d(51,"sum"),d(52,"RoundUp"),d(53,"amountFraction"),a(),g(54,zc,4,6,"td",17),a()()()()()()}r&2&&(m("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",t.pageData.Filter),o(2),m("ngIf",t.roleService==null?null:t.roleService.global.Export),o(),m("routerLink",b(43,Qc)),o(23),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit),o(2),m("ngForOf",t.data==null?null:t.data.Data),o(5),P(C(35,17,y(34,14,t.data==null?null:t.data.Data,"Count"))),o(4),P(C(39,22,y(38,19,t.data==null?null:t.data.Data,"Quantity"))),o(4),P(C(43,27,y(42,24,t.data==null?null:t.data.Data,"Sales"))),o(4),P(C(48,34,C(47,32,y(46,29,t.data==null?null:t.data.Data,"Tax")))),o(5),P(C(53,41,C(52,39,y(51,36,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),m("ngIf",t.roleService.product.Cost||t.roleService.report.Profit))},dependencies:[N,Y,k,A,K,B,L,Q,oe,jo,ie,X,J],encapsulation:2})};var Xc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],eo=(i,c)=>({From:i,To:c}),Jc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Zc=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function $c(i,c){if(i&1){let e=F();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),T("dateChange",function(t){u(e);let l=s();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.pageData.Filter.CurrencyID),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),m("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function ed(i,c){if(i&1&&(n(0,"content")(1,"div",12),I(2,"POS-line-chart",13),a()()),i&2){let e=s();o(2),m("config",e.chartConfig)("data",e.ChartData)}}var Qn=class i extends ne{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(c,e,r){super(c,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let c=this.route.snapshot.queryParams;c.From&&(this.pageData.Filter.From=c.From,this.pageData.Filter.To=c.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=M.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let c=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return M.getDatesInRange(c,e).map(l=>`${l.getDate()} ${M.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(c){this.pageData.Filter.From=c.from,this.pageData.Filter.To=c.to}static \u0275fac=function(e){return new(e||i)(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,r){if(e&1){let t=F();n(0,"mainpanel-cmp",1),T("onSubmit",function(){return u(t),_(r.searchFromPageOne())}),S("filterChange",function(f){return u(t),h(r.pageData.Filter,f)||(r.pageData.Filter=f),_(f)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),g(16,$c,13,11,"ng-template",null,0,V),a(),g(18,ed,3,2,"content",6),a()}e&2&&(m("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),x("filter",r.pageData.Filter),o(7),m("routerLink",b(11,Xc))("queryParams",de(12,eo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),m("routerLink",b(15,Jc))("queryParams",de(16,eo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),m("routerLink",b(19,Zc))("queryParams",de(20,eo,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),m("ngIf",r.data))},dependencies:[N,k,A,z,B,L,Et,Gt,fe,Q],encapsulation:2})};var ad={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},li=class i{date;dateChange=new Gi;width;minDate=M.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(c,e){let r=null;c&&(r=c.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(c){let e=null;c&&(e=c.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let c=document.getElementById("dropdown-filter");if(c){var e=new bootstrap.Dropdown(c);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(c,e){let r=new Date(c.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[ui([{provide:tn,useClass:Sn,deps:[en,$o]},{provide:nn,useValue:ad}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,r){if(e&1){let t=F();n(0,"mat-form-field",1)(1,"input",2),T("dateChange",function(f){return u(t),_(r.onDateChange(f.value))}),a(),I(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),T("yearSelected",function(f){u(t);let w=Ze(4);return _(r.chosenYearHandler(f,w))})("monthSelected",function(f){u(t);let w=Ze(4);return _(r.setMonthAndYear(f,w))})("opened",function(){return u(t),_(r.onOpenDatepicker())})("closed",function(){return u(t),_(r.onCloseDatepicker())}),a()()}if(e&2){let t=Ze(4);fo("width",r.width||100,"%"),o(),m("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),m("for",t)}},dependencies:[At,mn,gi,rn,ln,pn,fi,cn,on,an,sn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
2
2
|
`],encapsulation:2})};var rd=()=>["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"];function ld(i,c){if(i&1){let e=F();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),T("ngModelChange",function(){u(e);let t=s();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker-year-month",8),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker-year-month",8),S("dateChange",function(t){u(e);let l=s();return h(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(10,"h6"),p(11,"Compare To Year"),a(),n(12,"ng-select",10),S("ngModelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.LastYear,t)||(l.pageData.Filter.LastYear=t),_(t)}),a(),n(13,"h6"),p(14,"Category"),a(),n(15,"POS-product-category-select",11),S("selectedCategoryIDChange",function(t){u(e);let l=s();return h(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",12),S("ngModelChange",function(t){u(e);let l=s();return h(l.currency,t)||(l.currency=t),_(t)}),T("change",function(){u(e);let t=s();return _(t.checkFilterCurrency())}),a(),n(19,"h6"),p(20,"Multiply Unit Qty"),a(),n(21,"radio-options",13),S("modelChange",function(t){u(e);let l=s();return h(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=s();o(3),m("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.ListIDs),o(4),x("date",e.pageData.Filter.From),o(2),x("date",e.pageData.Filter.To),o(3),x("ngModel",e.pageData.Filter.LastYear),m("items",e.optionsCompareYear),o(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),o(3),x("ngModel",e.currency),m("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),x("model",e.pageData.Filter.MultiplyUnitQuantity)}}function pd(i,c){if(i&1&&(n(0,"div",14),I(1,"POS-line-chart",15),a()),i&2){let e=s();o(),m("config",e.chartConfig)("data",e.chartData)}}var jn=class i extends ne{constructor(e,r,t){super(e,r,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance");this.httpService=r;this.csvConverter=t}chartData={Series:[]};chartConfig;currency=-1;optionsCompareYear=[{value:1,label:"Last one year"},{value:2,label:"Last two year"}];onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=this.generateSeries();this.chartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:void 0},labels:{formatter:function(){return M.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r,t="",l=Math.abs(this.total);return l>999&&l<1e10?(t="K",r=(l/1e3).toFixed(0)):l>=1e10?(t="M",r=(l/1e6).toFixed(0)):l<999&&(r=l.toString()),this.total<0&&(r="-"+r),r.replace(/\B(?=(\d{3})+(?!\d))/g,",")+t}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series,t=this.point?.stackTotal;r=r.filter(Ee=>this.series?.name==Ee?.name);let l=[],f="",w=this.point.index;return r.forEach(Ee=>{Ee.options.stack===this.point.series.options.stack&&(l=Ee.name.split(" "),f+=`
|
|
3
3
|
<b>${this.point.category}</b></br>Total:
|
|
4
4
|
${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(t)}</br>${l[0]}:
|