dealpos 25.49.4 → 25.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-WYRHUSXS.js → chunk-2ENLMKGR.js} +1 -1
- package/browser/{chunk-QS32TZGB.js → chunk-2FJNMKCN.js} +1 -1
- package/browser/{chunk-OYEU5L3I.js → chunk-2ITJBRJU.js} +1 -1
- package/browser/{chunk-34X4ZZD5.js → chunk-2KI73XNT.js} +1 -1
- package/browser/{chunk-T4E5A3KH.js → chunk-2SZZVWQD.js} +11 -11
- package/browser/{chunk-JZFX4FNK.js → chunk-3AZAILT2.js} +1 -1
- package/browser/{chunk-INWLOCX3.js → chunk-3CUT73ZP.js} +1 -1
- package/browser/{chunk-D2OMTDKS.js → chunk-3ZWJMFYL.js} +1 -1
- package/browser/{chunk-SY463GX6.js → chunk-4KYROBKJ.js} +1 -1
- package/browser/{chunk-IFKUMLMD.js → chunk-4MQZXTMM.js} +1 -1
- package/browser/{chunk-KWFL5YOV.js → chunk-4YZVDERU.js} +1 -1
- package/browser/{chunk-F3YWM4BJ.js → chunk-5SIEW7SH.js} +1 -1
- package/browser/{chunk-FTZZHFXM.js → chunk-7L5VMLEF.js} +1 -1
- package/browser/{chunk-P2R2O6GD.js → chunk-7MJWZXSK.js} +2 -2
- package/browser/{chunk-ROVDZJVT.js → chunk-A5CTHLE4.js} +1 -1
- package/browser/{chunk-C777CYT4.js → chunk-A6Z5ZHVO.js} +1 -1
- package/browser/{chunk-SFXDXOSB.js → chunk-B7BVEOOI.js} +1 -1
- package/browser/{chunk-LNZY3GKF.js → chunk-BFNGPKGX.js} +1 -1
- package/browser/{chunk-52ONOTHS.js → chunk-BLEJLNEO.js} +1 -1
- package/browser/{chunk-QOCGWG6L.js → chunk-BQ7QT5RB.js} +1 -1
- package/browser/chunk-BZ3GMUQ7.js +14 -0
- package/browser/{chunk-Y4XWHUVX.js → chunk-CB6QEEJX.js} +1 -1
- package/browser/{chunk-ASHEF37H.js → chunk-CCJ6SHBL.js} +1 -1
- package/browser/{chunk-7V6NCJRQ.js → chunk-COL56R4A.js} +1 -1
- package/browser/chunk-CXWICNFP.js +1 -0
- package/browser/{chunk-TLLI6Z5X.js → chunk-CZHWPDAM.js} +1 -1
- package/browser/{chunk-XOQUXJ6S.js → chunk-DYBRYTEM.js} +1 -1
- package/browser/{chunk-SO3RL6QR.js → chunk-EAEOJMTA.js} +1 -1
- package/browser/{chunk-LI6G74I7.js → chunk-F765TCAS.js} +1 -1
- package/browser/{chunk-RGO36X34.js → chunk-FMKY4THI.js} +1 -1
- package/browser/{chunk-KJ5BS7KR.js → chunk-FSOHJLXB.js} +1 -1
- package/browser/{chunk-APHRANVH.js → chunk-FV4MYFQI.js} +1 -1
- package/browser/{chunk-7V2CY4DW.js → chunk-G3DZI5XK.js} +1 -1
- package/browser/{chunk-YTXYAEFO.js → chunk-G5JGQBAG.js} +1 -1
- package/browser/{chunk-BVMFVFGN.js → chunk-GBSRXCWH.js} +1 -1
- package/browser/{chunk-BSV3Y4MG.js → chunk-GDQGP7DV.js} +1 -1
- package/browser/{chunk-TAVEJBKL.js → chunk-GESNWWTD.js} +2 -2
- package/browser/{chunk-3Y2TKGP4.js → chunk-GRLVYPPM.js} +1 -1
- package/browser/{chunk-WZWXE6GT.js → chunk-HFDJ5XSI.js} +1 -1
- package/browser/{chunk-NTCQH6TH.js → chunk-HFOJZ3B5.js} +1 -1
- package/browser/{chunk-ADQOH7YA.js → chunk-HFZ437GH.js} +1 -1
- package/browser/{chunk-OXMLRZZ4.js → chunk-IPPIH4F4.js} +1 -1
- package/browser/{chunk-RULBTV6L.js → chunk-ISN5K6K2.js} +1 -1
- package/browser/{chunk-V45WTUQ2.js → chunk-ISQHQTAS.js} +1 -1
- package/browser/chunk-JCLYKROE.js +1 -0
- package/browser/chunk-KUF3JPB2.js +1 -0
- package/browser/{chunk-743523SK.js → chunk-KZBVWICA.js} +1 -1
- package/browser/{chunk-CLO7U3RB.js → chunk-LIX7XJ55.js} +1 -1
- package/browser/{chunk-ZEI66KM2.js → chunk-LIXEWT4U.js} +3 -3
- package/browser/{chunk-XTU3LHA6.js → chunk-M2HEFQUY.js} +1 -1
- package/browser/{chunk-HOZ6XJ4Z.js → chunk-MFJH22SW.js} +1 -1
- package/browser/{chunk-NFODKKJI.js → chunk-MZSJCSUV.js} +2 -2
- package/browser/{chunk-6H5XBM35.js → chunk-O3ENARQZ.js} +1 -1
- package/browser/{chunk-QE5OFO56.js → chunk-OZ3MKU4C.js} +1 -1
- package/browser/chunk-PHYDJ3P5.js +1 -0
- package/browser/{chunk-HCMW3RC5.js → chunk-PIAQ4TBN.js} +1 -1
- package/browser/{chunk-N7M4OSQZ.js → chunk-PLR55YR2.js} +1 -1
- package/browser/{chunk-CD6ZWSFG.js → chunk-PMDFKXZY.js} +1 -1
- package/browser/{chunk-XFJYJSZU.js → chunk-PV4YHZX5.js} +1 -1
- package/browser/chunk-PVBS6SYW.js +3 -0
- package/browser/{chunk-WFSJDUCV.js → chunk-PXIMA665.js} +2 -2
- package/browser/{chunk-OETRAGYY.js → chunk-Q3DS2RLM.js} +1 -1
- package/browser/chunk-QWB3USYP.js +3 -0
- package/browser/{chunk-K3V25WUQ.js → chunk-QZRMHLML.js} +1 -1
- package/browser/{chunk-XWXXETJY.js → chunk-RE6SQEP6.js} +1 -1
- package/browser/{chunk-GT5IX3D6.js → chunk-S4D5UGSM.js} +1 -1
- package/browser/{chunk-IQ5KAZ7I.js → chunk-S65MPEJS.js} +1 -1
- package/browser/{chunk-46D5QBZT.js → chunk-SBTTKQ4L.js} +1 -1
- package/browser/{chunk-UJ63ZNAO.js → chunk-SK6Y77W4.js} +4 -4
- package/browser/{chunk-XBRNDXDZ.js → chunk-SOW7VMSU.js} +1 -1
- package/browser/{chunk-R2Y4JAXW.js → chunk-T3ZHKT2K.js} +1 -1
- package/browser/{chunk-WP2FVSCM.js → chunk-T7PBUS2H.js} +1 -1
- package/browser/{chunk-FD7ICK7T.js → chunk-TTCSYFRX.js} +1 -1
- package/browser/{chunk-3YFVIHNY.js → chunk-UZN4OKOJ.js} +2 -2
- package/browser/{chunk-TBBZ7RAN.js → chunk-WXYXGYFH.js} +1 -1
- package/browser/{chunk-H4U5GDQZ.js → chunk-X2GHGFH2.js} +2 -2
- package/browser/{chunk-LX26RD3F.js → chunk-XFAV2VZL.js} +1 -1
- package/browser/{chunk-YZY45SFB.js → chunk-XSZJISVJ.js} +1 -1
- package/browser/{chunk-5DNDULL7.js → chunk-Y5DX5U5Q.js} +1 -1
- package/browser/{chunk-GNIF2YD2.js → chunk-Y7KCHRMM.js} +1 -1
- package/browser/{chunk-3RQ35Y7Q.js → chunk-YBUERVXV.js} +1 -1
- package/browser/{chunk-V3KYBOFM.js → chunk-YLEKN2EU.js} +1 -1
- package/browser/{chunk-QVI22QDX.js → chunk-YUILNWDI.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-DAVMX2B6.js → main-4PHVOJ3C.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-3PJCCDIY.js +0 -14
- package/browser/chunk-6LSNTX2C.js +0 -1
- package/browser/chunk-FQVYXDHS.js +0 -3
- package/browser/chunk-KJF3M7DY.js +0 -1
- package/browser/chunk-N6JQHXKN.js +0 -3
- package/browser/chunk-NZBKYR7R.js +0 -1
- package/browser/chunk-OWK34F6X.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{a as ii,b as Nr}from"./chunk-C3STDN73.js";import{a as Wr}from"./chunk-KB4247J2.js";import{a as Mt,b as Ar}from"./chunk-RSNEHVIM.js";import{a as Gt,b as Gr}from"./chunk-4ZITX27A.js";import{a as ti}from"./chunk-MLBTUOHX.js";import{a as De}from"./chunk-3RQ35Y7Q.js";import{a as An}from"./chunk-GTPQNPNO.js";import{a as Hr}from"./chunk-D2OMTDKS.js";import{a as ze}from"./chunk-KYXB2UQI.js";import{a as Gn,b as Bi}from"./chunk-GDRHD33K.js";import{a as gt}from"./chunk-3HZIDGPN.js";import{a as pr}from"./chunk-VVWAYTKN.js";import{b as dr}from"./chunk-COA4UL2V.js";import"./chunk-32QBWLTN.js";import{a as Vi}from"./chunk-ROVDZJVT.js";import"./chunk-WKM2QOAU.js";import{a as kr}from"./chunk-ZMJLTU5O.js";import{a as Br,b as Or,d as Lr,g as Rr}from"./chunk-PRVQ3NAP.js";import"./chunk-BYXBJQAS.js";import{a as Mi}from"./chunk-4SRWAPD4.js";import{a as Tr,b as Pr}from"./chunk-4OEDK7YE.js";import"./chunk-GWKBJZYT.js";import"./chunk-B5IABJO5.js";import{e as cr}from"./chunk-O2VVATBW.js";import{a as Fr,b as Ir,c as br,d as Er,e as Mr,f as Vr}from"./chunk-XOQUXJ6S.js";import"./chunk-PHH2AA3W.js";import"./chunk-GNIF2YD2.js";import"./chunk-DTVCBHPA.js";import"./chunk-5USF4MRW.js";import{a as ne}from"./chunk-363IDTE3.js";import{a as Z}from"./chunk-QZZ2NRA3.js";import"./chunk-FAED643P.js";import{a as bi,b as wr,c as Nn,d as J,e as Ei}from"./chunk-WMZLH4YK.js";import{a as En,b as Di}from"./chunk-72RZBOHX.js";import"./chunk-3RK6DDJD.js";import{a as bn}from"./chunk-M3DKYPGC.js";import{a as Sn,b as yn,c as Dn,f as Tn,g as Pn,h as Fn,p as yi,q as In}from"./chunk-6WATOQG3.js";import"./chunk-VM4K4MNV.js";import"./chunk-XTCEZONP.js";import"./chunk-LNDHYAFW.js";import{c as sr,d as Te,e as Wn}from"./chunk-5ZD6KTDH.js";import"./chunk-ZZBF7AOW.js";import{a as vi}from"./chunk-3Y2TKGP4.js";import{a as pe,b as ge,c as lr}from"./chunk-AQW4VS3Y.js";import{a as Et,b as vr}from"./chunk-4W3WYXI2.js";import{d as Sr,f as Ce}from"./chunk-BVMFVFGN.js";import{a as yr,b as Dr,c as U}from"./chunk-SFXDXOSB.js";import{b as K}from"./chunk-VXPORXGI.js";import{a as me}from"./chunk-R2Y4JAXW.js";import{a as rr}from"./chunk-NTCQH6TH.js";import"./chunk-L6PKNRWO.js";import"./chunk-SIQZO2WM.js";import{a as q}from"./chunk-J6M7UWVR.js";import{e as A,f as Ii}from"./chunk-LNZY3GKF.js";import"./chunk-7V2CY4DW.js";import"./chunk-7YUPYNWQ.js";import"./chunk-2CL5FM3P.js";import"./chunk-LGINK7BD.js";import{c as ur}from"./chunk-IKKPP4JS.js";import"./chunk-QPAUI5EG.js";import"./chunk-45E6XCHN.js";import"./chunk-SIDUUVNA.js";import"./chunk-KZFNI67M.js";import"./chunk-4BXCIT62.js";import{a as _r,c as Ue}from"./chunk-D4FCXEV4.js";import"./chunk-6P2ASCNY.js";import{d as hr}from"./chunk-QE5OFO56.js";import{b as N}from"./chunk-KJF3M7DY.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import{C as Rn,F as Ae,G as kn,j as vn,m as wn,t as mr,u as Vn,v as Pi,w as Bn}from"./chunk-26YFRPR2.js";import{b as ie,c as hn}from"./chunk-JBS5UYZC.js";import{A as Ln,B as fr,C as ei,K as Fi,N as xr,g as se,o as gr,s as On,z as Cr}from"./chunk-TEGIL5RZ.js";import"./chunk-B7AC4RMR.js";import"./chunk-EQLHPWVB.js";import{a as Mn,d as $}from"./chunk-THT6CY5E.js";import{b as Cn,e as wi,f as Ti,g as z}from"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import{a as nr}from"./chunk-S7FOJJP2.js";import{c as ir,j as ar,k as Ki,l as or}from"./chunk-FU2ZGMX4.js";import{a as zi}from"./chunk-2FWFPV5I.js";import{oa as fn,pa as xn,xa as tr}from"./chunk-SLX34TWD.js";import{F as At,G as gn,a as Xo,b as Jo,c as Qe,h as L,l as Zo,o as R,q as $o,s as er}from"./chunk-DWZ5JTI2.js";import"./chunk-743523SK.js";import"./chunk-46D5QBZT.js";import"./chunk-36GWLMZX.js";import{b as j}from"./chunk-WFQIMZGL.js";import{a as V}from"./chunk-WUV22SZ4.js";import"./chunk-SO3RL6QR.js";import{p as qe,s as k}from"./chunk-LGOSIAUC.js";import{$c as fo,Ab as y,Ac as _t,Bb as Yi,Bc as Ut,Ca as dt,Cb as Y,Cc as cn,Db as G,Dc as Ao,E as ri,Eb as H,Fb as c,Fc as d,Gb as n,Gc as g,Hb as a,Hc as v,I as Qi,Ia as go,Ib as b,Ic as fi,Ja as Ro,Jd as Ko,K as Vo,Lc as O,M as Bo,Ma as ko,Mb as pt,Nb as mt,Nc as Go,Nd as Ne,Ob as Wo,Oc as xi,Pb as I,Pc as dn,Pd as _n,Q as nn,Qa as Ee,Qd as Q,Sa as rn,Sb as P,Sc as Ho,Sd as Ui,Tc as hi,Ub as m,Xa as o,Xb as Co,Xc as un,Y as jt,Ya as ln,Yb as sn,Zb as _i,Zc as Qo,_b as gi,aa as _o,ad as Yo,bd as jo,cc as Dt,dc as qt,eb as w,ec as ji,fa as Nt,fc as No,gc as qi,gd as tt,hc as p,ib as B,ic as F,id as st,jb as ui,jc as D,jd as it,ka as Oo,kb as pn,kc as $t,la as an,ma as di,mb as W,mc as C,na as Zt,nb as mn,nc as f,nd as qo,o as ci,ob as E,oc as x,od as Uo,pa as Pe,qd as oe,sc as Ct,sd as re,t as oi,ta as u,u as uo,ua as _,vd as Si,wb as li,wc as Ci,xa as on,xc as M,xd as zo,yb as S,yc as X,za as Lo,zc as fe}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import{a as et,b as nt,f as Gl,h as Jt,k as Hi}from"./chunk-SNAKHGZS.js";var Po=Gl((Xi,To)=>{(function(i,s){typeof Xi=="object"&&typeof To=="object"?To.exports=s(i._Highcharts,i._Highcharts.Templating):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts/highcharts"],function(e){return s(e,e.Templating)}):typeof Xi=="object"?Xi["highcharts/modules/series-label"]=s(i._Highcharts,i._Highcharts.Templating):i.Highcharts=s(i.Highcharts,i.Highcharts.Templating)})(typeof window>"u"?Xi:window,(i,s)=>(()=>{"use strict";var e={944:ye=>{ye.exports=i},984:ye=>{ye.exports=s}},r={};function t(ye){var ae=r[ye];if(ae!==void 0)return ae.exports;var Ve=r[ye]={exports:{}};return e[ye](Ve,Ve.exports,t),Ve.exports}t.n=ye=>{var ae=ye&&ye.__esModule?()=>ye.default:()=>ye;return t.d(ae,{a:ae}),ae},t.d=(ye,ae)=>{for(var Ve in ae)t.o(ae,Ve)&&!t.o(ye,Ve)&&Object.defineProperty(ye,Ve,{enumerable:!0,get:ae[Ve]})},t.o=(ye,ae)=>Object.prototype.hasOwnProperty.call(ye,ae);var l={};t.d(l,{default:()=>Al});var h=t(944),T=t.n(h),Ze=t(984),Ni=t.n(Ze);let Ai={enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]};function Zi(ye,ae,Ve,he,at,Ge){let ee=(Ge-ae)*(Ve-ye)-(he-ae)*(at-ye);return ee>0||!(ee<0)}function $i(ye,ae,Ve,he,at,Ge,ee,Le){return Zi(ye,ae,at,Ge,ee,Le)!==Zi(Ve,he,at,Ge,ee,Le)&&Zi(ye,ae,Ve,he,at,Ge)!==Zi(ye,ae,Ve,he,ee,Le)}let{animObject:co}=T(),{format:Vl}=Ni(),{setOptions:Bl}=T(),{composed:Ol}=T(),{boxIntersectLine:Fo,intersectRect:Ll}={boxIntersectLine:function(ye,ae,Ve,he,at,Ge,ee,Le){return $i(ye,ae,ye+Ve,ae,at,Ge,ee,Le)||$i(ye+Ve,ae,ye+Ve,ae+he,at,Ge,ee,Le)||$i(ye,ae+he,ye+Ve,ae+he,at,Ge,ee,Le)||$i(ye,ae,ye,ae+he,at,Ge,ee,Le)},intersectRect:function(ye,ae){return!(ae.left>ye.right||ae.right<ye.left||ae.top>ye.bottom||ae.bottom<ye.top)}},{addEvent:Io,extend:bo,fireEvent:Rl,isNumber:en,pick:zt,pushUnique:kl,syncTimeout:Wl}=T();function mi(ye,ae,Ve,he,at){let Ge=ye.chart,ee=ye.options.label||{},Le=zt(ee.onArea,!!ye.area),Ke=Le||ee.connectorAllowed,ct=Ge.boxesToAvoid,Bt=Number.MAX_VALUE,Ft=Number.MAX_VALUE,St,ft,xt,Kt,It,$e,Be;for($e=0;ct&&$e<ct.length;$e+=1)if(Ll(ct[$e],{left:ae,right:ae+he.width,top:Ve,bottom:Ve+he.height}))return!1;for($e=0;$e<Ge.series.length;$e+=1){let ut=Ge.series[$e],Re=ut.interpolatedPoints&&[...ut.interpolatedPoints];if(ut.visible&&Re){let Je=Ge.plotHeight/10;for(let ot=Ge.plotTop;ot<=Ge.plotTop+Ge.plotHeight;ot+=Je)Re.unshift({chartX:Ge.plotLeft,chartY:ot}),Re.push({chartX:Ge.plotLeft+Ge.plotWidth,chartY:ot});for(Be=1;Be<Re.length;Be+=1){if(Re[Be].chartX>=ae-16&&Re[Be-1].chartX<=ae+he.width+16){if(Fo(ae,Ve,he.width,he.height,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))return!1;ye===ut&&!xt&&at&&(xt=Fo(ae-16,Ve-16,he.width+32,he.height+32,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))}(Ke||xt)&&(ye!==ut||Le)&&(Bt=Math.min(Bt,(Kt=ae+he.width/2-Re[Be].chartX)*Kt+(It=Ve+he.height/2-Re[Be].chartY)*It))}if(!Le&&Ke&&ye===ut&&(at&&!xt||Bt<Math.pow(ee.connectorNeighbourDistance||1,2))){for(Be=1;Be<Re.length;Be+=1)(St=Math.min(Math.pow(ae+he.width/2-Re[Be].chartX,2)+Math.pow(Ve+he.height/2-Re[Be].chartY,2),Math.pow(ae-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(ae+he.width-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(ae+he.width-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2),Math.pow(ae-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2)))<Ft&&(Ft=St,ft=Re[Be]);xt=!0}}}return(!at||!!xt)&&{x:ae,y:Ve,weight:Bt-(ft?Ft:0),connectorPoint:ft}}function Eo(ye){if(this.renderer){let ae=this,Ve=co(ae.renderer.globalAnimation).duration;ae.labelSeries=[],ae.labelSeriesMaxSum=0,ae.seriesLabelTimer&&T().clearTimeout(ae.seriesLabelTimer),ae.series.forEach(function(he){let at=he.options.label||{},Ge=he.labelBySeries,ee=Ge&&Ge.closest,Le=he.getColumn("y");at.enabled&&he.visible&&(he.graph||he.area)&&!he.boosted&&ae.labelSeries&&(ae.labelSeries.push(he),at.minFontSize&&at.maxFontSize&&Le.length&&(he.sum=Le.reduce((Ke,ct)=>(Ke||0)+(ct||0),0),ae.labelSeriesMaxSum=Math.max(ae.labelSeriesMaxSum||0,he.sum||0)),ye.type==="load"&&(Ve=Math.max(Ve,co(he.options.animation).duration)),ee&&(ee[0].plotX!==void 0?Ge.animate({x:ee[0].plotX+ee[1],y:ee[0].plotY+ee[2]}):Ge.attr({opacity:0})))}),ae.seriesLabelTimer=Wl(function(){ae.series&&ae.labelSeries&&(function(he){he.boxesToAvoid=[];let at=he.labelSeries||[],Ge=he.boxesToAvoid;he.series.forEach(ee=>(ee.points||[]).forEach(Le=>(Le.dataLabels||[]).forEach(Ke=>{let{width:ct,height:Bt}=Ke.getBBox(),Ft=(Ke.translateX||0)+(ee.xAxis?ee.xAxis.pos:ee.chart.plotLeft),St=(Ke.translateY||0)+(ee.yAxis?ee.yAxis.pos:ee.chart.plotTop);Ge.push({left:Ft,top:St,right:Ft+ct,bottom:St+Bt})}))),at.forEach(function(ee){let Le=ee.options.label||{};ee.interpolatedPoints=(function(Ke){let ct,Bt,Ft,St,ft;if(!Ke.xAxis&&!Ke.yAxis)return;let xt=Ke.points,Kt=[],It=Ke.graph||Ke.area,$e=It&&It.element,Be=Ke.chart.inverted,ut=Ke.xAxis,Re=Ke.yAxis,Je=Be?Re.pos:ut.pos,ot=Be?ut.pos:Re.pos,wt=Be?ut.len:Re.len,Gi=Be?Re.len:ut.len,ht=zt((Ke.options.label||{}).onArea,!!Ke.area),je=Re.getThreshold(Ke.options.threshold),Tt={},Xt=Be?"chartCenterX":"chartCenterY";function ai(lt){let yt=Math.round((lt.plotX||0)/8)+","+Math.round((lt.plotY||0)/8);Tt[yt]||(Tt[yt]=1,Kt.push(lt))}if(Ke.getPointSpline&&$e&&$e.getPointAtLength&&!ht&&xt.length<(Ke.chart.plotSizeX||0)/16){let lt=It.toD&&It.attr("d");for(It.toD&&It.attr({d:It.toD}),Ft=$e.getTotalLength(),ct=0;ct<Ft;ct+=16){let Lt=$e.getPointAtLength(ct),Rt=Be?Gi-Lt.y:Lt.x,kt=Be?wt-Lt.x:Lt.y;ai({chartX:Je+Rt,chartY:ot+kt,plotX:Rt,plotY:kt})}lt&&It.attr({d:lt});let yt=xt[xt.length-1].pos();ai({chartX:Je+(yt?.[0]||0),chartY:ot+(yt?.[1]||0)})}else{let lt;for(ct=0,Ft=xt.length;ct<Ft;ct+=1){let yt=xt[ct],[Lt,Rt]=yt.pos()||[],{plotHigh:kt}=yt;if(en(Lt)&&en(Rt)){let bt={plotX:Lt,plotY:Rt,chartX:Je+Lt,chartY:ot+Rt};if(ht&&(kt&&(bt.plotY=kt,bt.chartY=ot+kt),Be?bt.chartCenterX=Je+Gi-((kt||yt.plotY||0)+zt(yt.yBottom,je))/2:bt.chartCenterY=ot+((kt||Rt)+zt(yt.yBottom,je))/2),lt&&(Bt=Math.max(Math.abs(bt.chartX-lt.chartX),Math.abs(bt.chartY-lt.chartY)))>16&&Bt<999)for(ft=1,St=Math.ceil(Bt/16);ft<St;ft+=1)ai({chartX:lt.chartX+(bt.chartX-lt.chartX)*(ft/St),chartY:lt.chartY+(bt.chartY-lt.chartY)*(ft/St),[Xt]:(lt[Xt]||0)+((bt[Xt]||0)-(lt[Xt]||0))*(ft/St),plotX:(lt.plotX||0)+(Lt-(lt.plotX||0))*(ft/St),plotY:(lt.plotY||0)+(Rt-(lt.plotY||0))*(ft/St)});ai(bt),lt=bt}}}return Kt})(ee),Ge.push(...Le.boxesToAvoid||[])}),he.series.forEach(function(ee){let Le=ee.options.label;if(!Le||!ee.xAxis&&!ee.yAxis)return;let Ke="highcharts-color-"+zt(ee.colorIndex,"none"),ct=!ee.labelBySeries,Bt=Le.minFontSize,Ft=Le.maxFontSize,St=he.inverted,ft=St?ee.yAxis.pos:ee.xAxis.pos,xt=St?ee.xAxis.pos:ee.yAxis.pos,Kt=he.inverted?ee.yAxis.len:ee.xAxis.len,It=he.inverted?ee.xAxis.len:ee.yAxis.len,$e=ee.interpolatedPoints,Be=zt(Le.onArea,!!ee.area),ut=[],Re=ee.getColumn("x"),Je,ot,wt,Gi,ht,je,Tt=ee.labelBySeries,Xt,ai,lt;function yt(Qt,Wt,Yt){let tn=Math.max(ft,zt(ai,-1/0)),si=Math.min(ft+Kt,zt(lt,1/0));return Qt>tn&&Qt<=si-Yt.width&&Wt>=xt&&Wt<=xt+It-Yt.height}function Lt(){Tt&&(ee.labelBySeries=Tt.destroy())}if(Be&&!St&&(Xt=[ee.xAxis.toPixels(Re[0]),ee.xAxis.toPixels(Re[Re.length-1])],ai=Math.min.apply(Math,Xt),lt=Math.max.apply(Math,Xt)),ee.visible&&!ee.boosted&&$e){if(!Tt){var Rt,kt,bt;let Qt=ee.name;if(typeof Le.format=="string"?Qt=Vl(Le.format,ee,he):Le.formatter&&(Qt=Le.formatter.call(ee)),ee.labelBySeries=Tt=he.renderer.label(Qt,0,0,"connector",0,0,Le.useHTML).addClass("highcharts-series-label highcharts-series-label-"+ee.index+" "+(ee.options.className||"")+" "+Ke),!he.renderer.styledMode){let Wt=typeof ee.color=="string"?ee.color:"#666666";Tt.css(bo({color:Be?he.renderer.getContrast(Wt):Wt},Le.style||{})),Tt.attr({opacity:+!!he.renderer.forExport,stroke:ee.color,"stroke-width":1})}Bt&&Ft&&Tt.css({fontSize:(Rt=ee,kt=Bt,bt=Ft,kt+(Rt.sum||0)/(Rt.chart.labelSeriesMaxSum||0)*(bt-kt)+"px")}),Tt.attr({padding:0,zIndex:3}).add()}for((Je=Tt.getBBox()).width=Math.round(Je.width),ht=$e.length-1;ht>0;ht-=1)Be?yt(ot=($e[ht].chartCenterX??$e[ht].chartX)-Je.width/2,wt=($e[ht].chartCenterY??$e[ht].chartY)-Je.height/2,Je)&&(je=mi(ee,ot,wt,Je)):(yt(ot=$e[ht].chartX+3,wt=$e[ht].chartY-Je.height-3,Je)&&(je=mi(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX+3,wt=$e[ht].chartY+3,Je)&&(je=mi(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX-Je.width-3,wt=$e[ht].chartY+3,Je)&&(je=mi(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX-Je.width-3,wt=$e[ht].chartY-Je.height-3,Je)&&(je=mi(ee,ot,wt,Je,!0))),je&&ut.push(je);if(Le.connectorAllowed&&!ut.length&&!Be)for(ot=ft+Kt-Je.width;ot>=ft;ot-=16)for(wt=xt;wt<xt+It-Je.height;wt+=16)(Gi=mi(ee,ot,wt,Je,!0))&&ut.push(Gi);if(ut.length){ut.sort((Wt,Yt)=>Yt.weight-Wt.weight),je=ut[0],(he.boxesToAvoid||[]).push({left:je.x,right:je.x+Je.width,top:je.y,bottom:je.y+Je.height});let Qt=Math.sqrt(Math.pow(Math.abs(je.x-(Tt.x||0)),2)+Math.pow(Math.abs(je.y-(Tt.y||0)),2));if(Qt&&ee.labelBySeries){let Wt,Yt={opacity:+!!he.renderer.forExport,x:je.x,y:je.y},tn={opacity:1};Qt<=10&&(tn={x:Yt.x,y:Yt.y},Yt={}),ct&&(Wt=co(ee.options.animation),Wt.duration*=.2),ee.labelBySeries.attr(bo(Yt,{anchorX:je.connectorPoint&&(je.connectorPoint.plotX||0)+ft,anchorY:je.connectorPoint&&(je.connectorPoint.plotY||0)+xt})).animate(tn,Wt),ee.options.kdNow=!0,ee.buildKDTree();let si=ee.searchPoint({chartX:je.x,chartY:je.y},!0);si&&(Tt.closest=[si,je.x-(si.plotX||0),je.y-(si.plotY||0)])}}else Lt()}else Lt()}),Rl(he,"afterDrawSeriesLabels")})(ae)},ae.renderer.forExport||!Ve?0:Ve)}}function Nl(ye,ae,Ve,he,at){let Ge=at&&at.anchorX,ee=at&&at.anchorY,Le,Ke,ct=Ve/2;return en(Ge)&&en(ee)&&(Le=[["M",Ge,ee]],(Ke=ae-ee)<0&&(Ke=-he-Ke),Ke<Ve&&(ct=Ge<ye+Ve/2?Ke:Ve-Ke),ee>ae+he?Le.push(["L",ye+ct,ae+he]):ee<ae?Le.push(["L",ye+ct,ae]):Ge<ye?Le.push(["L",ye,ae+he/2]):Ge>ye+Ve&&Le.push(["L",ye+Ve,ae+he/2])),Le||[]}let Mo=T();({compose:function(ye,ae){kl(Ol,"SeriesLabel")&&(Io(ye,"load",Eo),Io(ye,"redraw",Eo),ae.prototype.symbols.connector=Nl,Bl({plotOptions:{series:{label:Ai}}}))}}).compose(Mo.Chart,Mo.SVGRenderer);let Al=T();return l.default})())});var Hl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Qr=i=>({ID:i});function Ql(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Yl(i,s){if(i&1&&(n(0,"div",2),S(1,Ql,3,0,"button",3),a()),i&2){let e=m();o(),y(e.roleService.global.Export?1:-1)}}function jl(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",10)(11,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",14),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",18),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",19),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",20),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),b(41,"i",21),a(),n(42,"ng-select",22),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",23),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),c("items",e.pageData.Options.ContactGroups),C("ngModel",e.pageData.Filter.ContactGroupID),o(3),C("model",e.pageData.Filter.Bin),o(3),c("items",e.pageData.Options.Types),C("ngModel",e.pageData.Filter.TypeID),o(3),c("items",e.pageData.Options.Currencies),C("ngModel",e.pageData.Filter.CurrencyID),o(3),c("items",e.pageData.Options.Deliveries),C("ngModel",e.pageData.Filter.DeliveryStateID),o(3),C("ngModel",e.pageData.Filter.PaymentStateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),C("ngModel",e.pageData.Filter.CreatorID),c("renderThumbnail",!1),o(3),C("model",e.pageData.Filter.NoteVisible),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),C("ngModel",e.pageData.Filter.QueryOption),o(3),C("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function ql(i,s){i&1&&(n(0,"th",32),p(1," @ Cost "),a())}function Ul(i,s){if(i&1&&(n(0,"small",46),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.CustomerNameDisplay," - {0}"))}}function zl(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.SalesName," - Sales: {0}"))}}function Kl(i,s){if(i&1&&(n(0,"span",46),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" "," - Profit: "+g(2,1,e.Profit)," ")}}function Xl(i,s){if(i&1&&(n(0,"i",49),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function Jl(i,s){if(i&1&&(n(0,"span",50),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function Zl(i,s){i&1&&(n(0,"span"),p(1,"-"),a())}function $l(i,s){if(i&1&&(b(0,"div",51),d(1,"newlines")),i&2){let e=m().$implicit;c("innerHTML",g(1,1,e.SONote),Ee)}}function ep(i,s){if(i&1&&(n(0,"div")(1,"a",57),p(2),a()()),i&2){let e=m().$implicit;o(),c("queryParams",X(2,Qr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function tp(i,s){if(i&1&&(n(0,"i",60),p(1),a()),i&2){let e=m().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function ip(i,s){if(i&1&&(n(0,"th",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitCost)," ")}}function np(i,s){if(i&1&&(n(0,"tr",55)(1,"th",28)(2,"div",58)(3,"span",59),p(4),a(),S(5,tp,2,1,"i",60),b(6,"small",61),a()(),n(7,"th",62),p(8),a(),n(9,"th",63),p(10),d(11,"quantityFraction"),a(),n(12,"th",64),p(13),a(),S(14,ip,3,3,"th",65),n(15,"th",66),p(16),d(17,"amountFraction"),a(),n(18,"th",67)(19,"div",68),p(20),a(),n(21,"div",69),p(22),d(23,"amountFraction"),a()(),n(24,"th",66),p(25),d(26,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),y((e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName?5:-1),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(11,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?14:-1),o(2),D(" ",g(17,13,e==null?null:e.UnitPrice)," "),o(4),D(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),D(" ",(e==null?null:e.DiscountAmount)==0?"":g(23,15,e==null?null:e.DiscountAmount)," "),o(3),D(" ",g(26,17,e==null?null:e.Total)," ")}}function ap(i,s){if(i&1&&(n(0,"tr")(1,"th",70),p(2),a(),n(3,"th",71),p(4),a(),n(5,"th",72),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e.CurrencySymbol," "),o(2),D(" ",g(7,3,e.Amount)," ")}}function op(i,s){if(i&1&&(n(0,"div")(1,"div",41)(2,"div",42)(3,"div")(4,"a",43)(5,"span",44),p(6),a()(),n(7,"span"),p(8),d(9,"date"),b(10,"small",45),d(11,"date"),S(12,Ul,3,4,"small",46),a()(),n(13,"div",47)(14,"strong",48),p(15),S(16,zl,3,4,"span"),a(),S(17,Kl,3,3,"span",46),S(18,Xl,2,1,"i",49),S(19,Jl,2,1,"span",50),S(20,Zl,2,0,"span"),a(),S(21,$l,2,3,"div",51),S(22,ep,3,4,"div"),a(),n(23,"div",52),p(24),a()(),n(25,"table",53)(26,"tbody",54),G(27,np,27,19,"tr",55,Y),a()(),n(29,"table",56),G(30,ap,8,5,"tr",null,Y),a()()),i&2){let e=s.$implicit,r=m(2);o(4),c("routerLink",M(21,Hl))("queryParams",X(22,Qr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number),o(2),D(" "," - "+v(9,15,e.Date,"dd MMM yyyy")," "),o(2),c("innerHtml","("+v(11,18,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Ee),o(2),y(r.isNotEmpty(e.CustomerNameDisplay)?12:-1),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),y(r.isNotEmpty(e.SalesName)?16:-1),o(),y(r.roleService.report.Profit?17:-1),o(),y(r.isNotEmpty(e.DeliveryOutlet)?18:-1),o(),y(r.isNotEmpty(e.PromotionCoupon)?19:-1),o(),y(e.SONote&&e.PromotionCoupon?20:-1),o(),y(r.isNotEmpty(e.SONote)?21:-1),o(),y(r.isNotEmpty(e.ReferenceInvoiceID)?22:-1),o(2),D(" ",e.PaymentStateLabel," "),o(3),H(e.Items),o(3),H(e.Aggregate)}}function rp(i,s){if(i&1){let e=I();n(0,"span",73),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",74),p(2,"?"),a()()}}function lp(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function pp(i,s){if(i&1){let e=I();n(0,"div",2)(1,"a",75),P("click",function(){u(e);let t=m(2);return t.currentRowCount=100,_(t.NextPage(!0))}),b(2,"i",76),p(3," Next 100"),a()()}}function mp(i,s){if(i&1){let e=I();n(0,"content")(1,"div",24)(2,"div",25)(3,"table",26)(4,"thead",27)(5,"tr")(6,"th",28),p(7,"Name"),a(),n(8,"th",29),p(9,"Code"),a(),n(10,"th",30),p(11,"Qty"),a(),n(12,"th",31),p(13,"UOM"),a(),S(14,ql,2,0,"th",32),n(15,"th",33),p(16,"@ Price"),a(),n(17,"th",30),p(18,"Disc."),a(),n(19,"th",33),p(20,"Total"),a()()(),n(21,"tbody")(22,"tr")(23,"td",34),G(24,op,32,24,"div",null,Y),a()()()()(),n(26,"div",35)(27,"button",36),P("click",function(){u(e);let t=m();return _(t.showSummaryReport())}),p(28," View Report Summary "),a()(),n(29,"div",37)(30,"div",38)(31,"div",39),p(32),d(33,"number"),S(34,rp,3,0,"span",40),S(35,lp,3,3,"span"),p(36),a()(),S(37,pp,4,0,"div",2),a()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(9),li("colspan",e.roleService.product.Cost?8:7),o(),H(e.infiniteList),o(8),D(" Showing 1 - ",g(33,7,e.infiniteList.length)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:34),o(),y(e.pageData.HideStoreApiCount?35:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),y(e.nextPageDisabled?37:-1)}}var Hn=class i extends De{constructor(e,r,t,l,h,T,Ze,Ni){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,h);this.csvConverter=t;this.datePipe=l;this.activatedRoute=h;this.matDialog=T;this.toaster=Ze;this.roleService=Ni}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,V.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),V.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),V.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return V.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(h=>h):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(K,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(Wr,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(Ne),w(z),w(qe),w(j))};static \u0275cmp=B({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["name","Bin",3,"modelChange","model"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Fulfillment",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","NoteVisible",3,"modelChange","model"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[1,"text-center"],["role","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],[1,"fw-bold"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table","table-sm","table-borderless"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"lh-base"],[1,"fw-normal"],[1,"text-warning","inlineMarginLeft"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %",1,"text-danger"],["matTooltipPosition","above","matTooltip","Disc Amount",1,"text-danger"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Yl,2,1,"div",2),a(),n(3,"filters"),E(4,jl,46,26,"ng-template",null,0,O),a(),S(6,mp,38,9,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,ie,Te,Ae,U,ze,gr,On,re,oe,Z,ne],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media (max-width: 992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var Qn=class i{constructor(s,e){this._dialogRef=s;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Vn;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(w(wi),w(Ti))};static \u0275cmp=B({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),x("ngModelChange",function(l){return f(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),x("ngModelChange",function(l){return f(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(c("title","Export Report")("config",r.modalConfig),o(6),C("ngModel",r.ExportPageNumber),o(4),C("ngModel",r.ExportRowCount),c("max",1e4))},dependencies:[Qe,L,R,Ue,Pi],encapsulation:2})};var cp=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],jr=i=>({ID:i}),dp=()=>["/menu/Contacts/Contact/Customers/Info"],up=(i,s,e)=>({"text-success":i,"text-warning":s,"text-danger":e});function _p(i,s){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function gp(i,s){if(i&1){let e=I();pt(0),n(1,"div",19)(2,"div",20)(3,"datepicker",21),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a()(),n(4,"div",22)(5,"app-timepicker",23),x("timeChange",function(t){u(e);let l=m(2);return f(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=m(2);return _(l.timeFromChange(t))}),a()()(),n(6,"div",24)(7,"div",20)(8,"datepicker",25),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a()(),n(9,"div",22)(10,"app-timepicker",23),x("timeChange",function(t){u(e);let l=m(2);return f(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=m(2);return _(l.timeToChange(t))}),a()()(),mt()}if(i&2){let e=m(2);o(3),C("date",e.pageData.Filter.From),o(2),C("time",e.timeFrom),o(3),C("date",e.pageData.Filter.To),o(2),C("time",e.timeTo)}}function Cp(i,s){if(i&1){let e=I();n(0,"datepicker",26),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a(),n(1,"div",27)(2,"datepicker",28),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterToDate())}),a()()}if(i&2){let e=m(2);C("date",e.pageData.Filter.From),c("appearance","outline")("width",100),o(2),C("date",e.pageData.Filter.To),c("appearance","outline")("width",100)}}function fp(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",9),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),E(18,gp,11,4,"ng-container",13)(19,Cp,3,6,"ng-template",null,1,O),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",18),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=Dt(20),r=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",r.pageData.Filter.ListIDs),c("outlets",r.pageData.Options==null?null:r.pageData.Options.Entities),o(3),C("ngModel",r.pageData.Filter.CustomerID),c("inputTextValue",r.pageData.CustomerName),o(3),C("ngModel",r.pageData.Filter.SalesID),o(3),C("ngModel",r.pageData.Filter.SalesOrderTagID),c("items",r.pageData.Options.SalesOrderTags),o(3),c("options",r.pageData.Options.DefaultFilterColumnOptions),C("model",r.pageData.Filter.DefaultFilterColumn),o(3),c("ngIf",r.pageData.Filter.isCreated)("ngIfElse",e),o(5),C("ngModel",r.pageData.Filter.RegisterID),c("items",r.pageData.Options.Registers),o(3),C("ngModel",r.pageData.Filter.CustomerGroupID),c("items",r.pageData.Options.Groups),o(3),C("ngModel",r.pageData.Filter.PaymentState),c("items",r.pageData.Options.States),o(3),C("ngModel",r.pageData.Filter.CreatorID),o(3),c("max",1e4),C("ngModel",r.pageData.Filter.RowCount)}}function xp(i,s){i&1&&(n(0,"th",57),p(1,"DATE"),a())}function hp(i,s){i&1&&(n(0,"th",58),p(1," CUSTOMER "),a())}function Sp(i,s){i&1&&(n(0,"th",45),p(1,"JOIN DATE"),a())}function yp(i,s){i&1&&(n(0,"th",46),p(1,"GROUPS"),a())}function Dp(i,s){i&1&&(n(0,"th",59),p(1," SALES PERSON "),a())}function vp(i,s){i&1&&(n(0,"th",60),p(1," COST "),a())}function wp(i,s){i&1&&(n(0,"th",61),p(1," GROSS "),a())}function Tp(i,s){i&1&&(n(0,"th",62),p(1," SALES "),a())}function Pp(i,s){i&1&&(n(0,"th",63),p(1," TAX "),a())}function Fp(i,s){i&1&&(n(0,"th",64),p(1," SURCHARGE "),a())}function Ip(i,s){i&1&&(n(0,"th",65),p(1," TOTAL "),a())}function bp(i,s){i&1&&(n(0,"th",66),p(1," PAYMENT "),a())}function Ep(i,s){i&1&&b(0,"br")}function Mp(i,s){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Note)}}function Vp(i,s){if(i&1&&(n(0,"td")(1,"div"),p(2),d(3,"date"),a(),n(4,"div"),p(5),d(6,"date"),a()()),i&2){let e=m().$implicit;o(2),D(" ",v(3,2,e.Date,"dd MMM yy")," "),o(3),D(" ",v(6,5,e.Created,"HH:mm")," ")}}function Bp(i,s){if(i&1&&(n(0,"td")(1,"a",72),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,dp))("queryParams",X(4,jr,e.CustomerID)),o(),F(e.CustomerName)}}function Op(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.JoinDate!=="0001-01-01T00:00:00"?v(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function Lp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Groups," ")}}function Rp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.SalesName," ")}}function kp(i,s){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Wp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function Np(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Ap(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Gp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SurchargeAmount)," ")}}function Hp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNSurcharge)," ")}}function Qp(i,s){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=m().$implicit;c("ngClass",_t(2,up,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function Yp(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",67),p(5),a(),E(6,Ep,1,0,"br",4)(7,Mp,2,1,"i",4),a(),E(8,Vp,7,8,"td",4)(9,Bp,3,6,"td",4),S(10,Op,3,4,"td"),S(11,Lp,2,1,"td"),E(12,Rp,2,1,"td",4)(13,kp,3,3,"td",68)(14,Wp,3,3,"td",69)(15,Np,3,3,"td",69)(16,Ap,3,3,"td",70)(17,Gp,3,3,"td",69)(18,Hp,3,3,"td",69)(19,Qp,2,6,"td",71),a()),i&2){let e=s.$implicit,r=m(3);o(2),F(e.EntityName),o(2),c("routerLink",M(18,cp))("queryParams",X(19,jr,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",e.Note),o(),c("ngIf",e.Note),o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Customer.selected),o(),y(r.column.JoinDate.selected?10:-1),o(),y(r.column.Groups.selected?11:-1),o(),c("ngIf",r.column.SalesPerson.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.column.Gross.selected),o(),c("ngIf",r.column.Sales.selected),o(),c("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),c("ngIf",r.data.SurchargeVisible),o(),c("ngIf",r.column.Total.selected),o(),c("ngIf",r.column.Payment.selected)}}function jp(i,s){i&1&&b(0,"td",79)}function qp(i,s){i&1&&b(0,"td",79)}function Up(i,s){i&1&&b(0,"td",79)}function zp(i,s){i&1&&(n(0,"td",82),p(1," Total: "),a())}function Kp(i,s){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Cost"))," ")}}function Xp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function Jp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function Zp(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function $p(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function em(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function tm(i,s){if(i&1&&(n(0,"tfoot",77)(1,"tr",78),b(2,"td",79),E(3,jp,1,0,"td",80)(4,qp,1,0,"td",80)(5,Up,1,0,"td",80)(6,zp,2,0,"td",81)(7,Kp,4,6,"td",68)(8,Xp,4,6,"td",69)(9,Jp,4,6,"td",69)(10,Zp,4,6,"td",70)(11,$p,4,6,"td",69)(12,em,4,6,"td",69),a()()),i&2){let e=m(3);o(3),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected)}}function im(i,s){if(i&1){let e=I();n(0,"div",38)(1,"table",39),P("matSortChange",function(t){u(e);let l=m(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(),E(8,xp,2,0,"th",43)(9,hp,2,0,"th",44),S(10,Sp,2,0,"th",45),S(11,yp,2,0,"th",46),E(12,Dp,2,0,"th",47)(13,vp,2,0,"th",48)(14,wp,2,0,"th",49)(15,Tp,2,0,"th",50)(16,Pp,2,0,"th",51)(17,Fp,2,0,"th",52)(18,Ip,2,0,"th",53)(19,bp,2,0,"th",54),a()(),n(20,"tbody"),E(21,Yp,20,21,"tr",55),a(),E(22,tm,13,10,"tfoot",56),a()()}if(i&2){let e=m(2);o(8),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),y(e.column.JoinDate.selected?10:-1),o(),y(e.column.Groups.selected?11:-1),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected),o(),c("ngIf",e.column.Payment.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data)}}function nm(i,s){if(i&1){let e=I();n(0,"span",83),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",84),p(2,"?"),a()()}}function am(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function om(i,s){if(i&1){let e=I();n(0,"a",85),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",86),p(2," Next"),a()}}function rm(i,s){if(i&1){let e=I();n(0,"a",87),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),b(1,"i",88),p(2," Show All"),a()}}function lm(i,s){if(i&1&&(n(0,"content")(1,"div",29),E(2,im,23,14,"div",30),n(3,"div",31)(4,"div",32)(5,"div",33),p(6),d(7,"number"),E(8,nm,3,0,"span",34)(9,am,3,3,"span",4),p(10),a()(),n(11,"div",35),E(12,om,3,0,"a",36)(13,rm,3,0,"a",37),a()()()()),i&2){let e=m();o(2),c("ngIf",e.data),o(4),D(" Showing 1 - ",g(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Yn=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=h}roleService=Pe(j);columnService=Pe(gt);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>V.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(Qn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let h=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(),h);case"number":return this.compare(t.Number,l.Number,h);case"date":return this.compare(t.Date,l.Date,h);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),h);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),h);case"cost":return this.compare(t.Cost,l.Cost,h);case"gross":return this.compare(t.Gross,l.Gross,h);case"sales":return this.compare(t.Sales,l.Sales,h);case"tax":return this.compare(t.Tax,l.Tax,h);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,h);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,h);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,h);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,h);case"groups":return this.compare(t.Groups,l.Groups,h);default:return 0}})}openExportModal(){this._matDialog.open(K,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");V.IsNotEmpty(r)&&(this.pageData.Filter.From=V.MinDate,this.pageData.Filter.To=V.MinDate),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],["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=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,_p,3,0,"button",3),a(),n(3,"filters"),E(4,fp,36,22,"ng-template",null,0,O),a(),E(6,lm,14,9,"content",4),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,Qe,L,R,ie,pe,ge,Ue,Te,Ae,Mi,U,ze,se,re,oe,Z],encapsulation:2})};var pm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],mm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],sm=()=>["/menu/Products/Setup/Brand/Brand_Form"],cm=i=>({ID:i}),dm=(i,s)=>({BrandID:i,Name:s});function um(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export"),a()}}function _m(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function gm(i,s){i&1&&(n(0,"th",18),p(1,"Code"),a())}function Cm(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function fm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",22),p(3),a()(),S(4,Cm,2,1,"td"),n(5,"td",23)(6,"a",24),p(7),d(8,"quantityFraction"),a()(),n(9,"td",23),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(11,sm))("queryParams",X(12,cm,e.ID)),o(),D("",e.BrandName," "),o(),y(e.Countcode>0?4:-1),o(2),c("queryParams",fe(14,dm,e.ID,e.BrandName)),o(),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.Total))}}function xm(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",15),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",16)(3,"tr")(4,"th",17),p(5,"Brand"),a(),S(6,gm,2,0,"th",18),n(7,"th",19),p(8,"Sold"),a(),n(9,"th",20),p(10,"Total"),a()()(),n(11,"tbody"),G(12,fm,12,17,"tr",null,Y),a(),n(14,"tfoot")(15,"tr",21)(16,"td"),p(17,"Total"),a(),n(18,"td"),p(19),d(20,"sum"),d(21,"quantityFraction"),a(),n(22,"td"),p(23),d(24,"sum"),d(25,"amountFraction"),a()()()()()}if(i&2){let e=m();o(6),y(e.data.Countcode>0?6:-1),o(6),H(e.data.Data),o(7),F(g(21,6,v(20,3,e.data.Data,"Quantity"))),o(4),F(g(25,11,v(24,8,e.data.Data,"Total")))}}var jn=class i extends De{constructor(e,r,t,l,h,T){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=h;this.matDialog=T}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,h);case"Code":return this.compare(t.Code,l.Code,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Total":return this.compare(t.Total,l.Total,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[W],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[1,"footer","text-end","fw-bold"],[3,"routerLink","queryParams"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,um,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Pie Chart "),a()(),n(10,"li")(11,"a",6),p(12," Brand Sales Analysis "),a()()()()(),n(13,"filters"),E(14,_m,9,6,"ng-template",null,0,O),a(),n(16,"content"),S(17,xm,26,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,pm)),o(3),c("routerLink",M(9,mm)),o(6),y(t.data?17:-1))},dependencies:[A,Q,J,L,R,ie,pe,ge,U,se,Z,ne],encapsulation:2})};function hm(i,s){if(i&1){let e=I();n(0,"label",2),P("click",function(){let t=u(e).$implicit,l=m();return _(l.updateSelectedGroups(t.ID))}),b(1,"input",3),n(2,"span"),p(3),a()()}if(i&2){let e=s.$implicit,r=m();o(),c("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),F(e.Name)}}var qn=class i{constructor(s,e){this.dialogRef=s;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(s){let e=this.IDGroups.indexOf(s);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(s)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(w(wi),w(Ti))};static \u0275cmp=B({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:5,vars:1,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),G(3,hm,4,3,"label",null,Y),a()()()),e&2&&(c("title","Edit Groups"),o(3),H(r.options))},dependencies:[Pi],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var Sm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],ym=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Dm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],vm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],wm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],Tm=()=>["/menu/Contacts/Contact/Customers/Info"],Pm=i=>({ID:i});function Fm(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Im(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function bm(i,s){i&1&&(n(0,"th",22),p(1," ORDERS "),a())}function Em(i,s){i&1&&(n(0,"th",23),p(1," QTY "),a())}function Mm(i,s){i&1&&(n(0,"th",24),p(1," COST "),a())}function Vm(i,s){i&1&&(n(0,"th",25),p(1," SALES "),a())}function Bm(i,s){i&1&&(n(0,"th",26),p(1," TAX "),a())}function Om(i,s){i&1&&(n(0,"th",27),p(1," SALES + TAX "),a())}function Lm(i,s){if(i&1){let e=I();n(0,"span")(1,"span"),p(2),a(),n(3,"a",37),P("click",function(){u(e);let t=m(2).$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=s.$implicit,r=s.$index;o(2),F(r==0?"":" , "),o(2),F(e.GroupName)}}function Rm(i,s){if(i&1&&(n(0,"span"),G(1,Lm,5,2,"span",null,Y),a()),i&2){let e=m().$implicit;o(),H(e.Groups)}}function km(i,s){if(i&1){let e=I();n(0,"a",37),P("click",function(){u(e);let t=m().$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function Wm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Orders)," ")}}function Nm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Am(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Gm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Hm(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Qm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales+e.Tax)," ")}}function Ym(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",30),p(3),a(),n(4,"div",31),S(5,Rm,3,0,"span"),S(6,km,2,0,"a",32),a()(),n(7,"td")(8,"span",33),p(9),a()(),S(10,Wm,3,3,"td",34),S(11,Nm,3,3,"td",34),S(12,Am,3,3,"td",35),S(13,Gm,3,3,"td",34),S(14,Hm,3,3,"td",36),S(15,Qm,3,3,"td",34),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("routerLink",M(13,Tm))("queryParams",X(14,Pm,e.CustomerID)),o(),D(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),y(e.Groups.length>0?5:-1),o(),y(e.Groups.length>0?-1:6),o(2),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),D("",e.Code," "),o(),y(r.column.Orders.selected?10:-1),o(),y(r.column.QTY.selected?11:-1),o(),y(r.roleService.product.Cost&&r.column.Cost.selected?12:-1),o(),y(r.column.Sales.selected?13:-1),o(),y(r.column.Tax.selected?14:-1),o(),y(r.column.SalesNTax.selected?15:-1)}}function jm(i,s){if(i&1&&(n(0,"tbody",28),G(1,Ym,16,16,"tr",null,Y),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function qm(i,s){if(i&1){let e=I();n(0,"div",7)(1,"div",17)(2,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",19)(4,"tr")(5,"th",20),p(6,"CUSTOMER"),a(),n(7,"th",21),p(8," CODE "),a(),S(9,bm,2,0,"th",22),S(10,Em,2,0,"th",23),S(11,Mm,2,0,"th",24),S(12,Vm,2,0,"th",25),S(13,Bm,2,0,"th",26),S(14,Om,2,0,"th",27),a()(),S(15,jm,3,0,"tbody",28),a()(),n(16,"infinite-pagination",29),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=m();o(9),y(e.column.Orders.selected?9:-1),o(),y(e.column.QTY.selected?10:-1),o(),y(e.roleService.product.Cost&&e.column.Cost.selected?11:-1),o(),y(e.column.Sales.selected?12:-1),o(),y(e.column.Tax.selected?13:-1),o(),y(e.column.SalesNTax.selected?14:-1),o(),y(e.data.Data?15:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",!e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Un=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=h}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=Rn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(jt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Code":return this.compare(t.Code,l.Code,h);case"Orders":return this.compare(t.Orders,l.Orders,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,h);case"Cost":return this.compare(t.Cost,l.Cost,h);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(qn,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let h={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",h).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(K,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[W],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],[1,"pointer"],[1,"text-primary"],["matTooltipPosition","above",3,"matTooltip"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"],[1,"text-primary",3,"click"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,Fm,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," By Age "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),b(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),E(24,Im,16,10,"ng-template",null,0,O),a(),n(26,"content"),S(27,qm,17,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Sm)),o(3),c("routerLink",M(13,ym)),o(3),c("routerLink",M(14,Dm)),o(3),c("routerLink",M(15,vm)),o(4),c("routerLink",M(16,wm)),o(6),y(t.data?27:-1))},dependencies:[A,Q,$,J,Qe,L,R,ie,pe,ge,Ue,U,ti,re,Z,ne],encapsulation:2})};var Um=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],zm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Xm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Jm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Zm(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function $m(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function es(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),n(6,"td",23),p(7),d(8,"amountFraction"),a(),n(9,"td",24),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D(" ",e.Name," "),o(2),F(g(5,4,e.TotalOrders)),o(3),F(g(8,6,e.TotalCost)),o(3),F(g(11,8,e.TotalAmount))}}function ts(i,s){if(i&1&&(n(0,"tbody",22),G(1,es,12,10,"tr",null,Y),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function is(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"AGE"),a(),n(6,"th",19),p(7," ORDERS"),a(),n(8,"th",20),p(9," COST"),a(),n(10,"th",21),p(11," AMOUNT"),a()()(),S(12,ts,3,0,"tbody",22),a()()}if(i&2){let e=m();o(12),y(e.data.Data?12:-1)}}var zn=class i extends De{constructor(e,r,t,l,h,T){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.datePipe=T}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,h);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,h);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,h);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,h);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[W],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Zm,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,$m,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,is,13,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,Um)),o(3),c("routerLink",M(12,zm)),o(3),c("routerLink",M(13,Km)),o(3),c("routerLink",M(14,Xm)),o(3),c("routerLink",M(15,Jm)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,U,re,Z],encapsulation:2})};var ns=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],as=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],os=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],rs=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],ls=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function ps(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function ms(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function ss(i,s){i&1&&(n(0,"th",19),p(1," ORDERS"),a())}function cs(i,s){i&1&&(n(0,"th",20),p(1," QUANTITY"),a())}function ds(i,s){i&1&&(n(0,"th",21),p(1," AMOUNT"),a())}function us(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalOrders))}}function _s(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalQuantity)," ")}}function gs(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalAmount))}}function Cs(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,us,3,3,"td",23),S(4,_s,3,3,"td",23),S(5,gs,3,3,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),D(" ",e.Name," "),o(),y(r.column.Orders.selected?3:-1),o(),y(r.column.QTY.selected?4:-1),o(),y(r.column.Amount.selected?5:-1)}}function fs(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"GENDER"),a(),S(6,ss,2,0,"th",19),S(7,cs,2,0,"th",20),S(8,ds,2,0,"th",21),a()(),n(9,"tbody",22),G(10,Cs,6,4,"tr",null,Y),a()()()}if(i&2){let e=m();o(6),y(e.column.Orders.selected?6:-1),o(),y(e.column.QTY.selected?7:-1),o(),y(e.column.Amount.selected?8:-1),o(2),H(e.data==null?null:e.data.Data)}}var Kn=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=h}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,h);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,h);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,h);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,h);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(jt(1))}openExportModal(){this.matDialog.open(K,{data:{title:"Top Gender customer",exportTypes:[{ID:"ReportExport/CustomerGenderRank",Value:"Default",FileName:"Top Gender customer "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[W],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,ps,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,ms,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,fs,12,3,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,ns)),o(3),c("routerLink",M(13,as)),o(3),c("routerLink",M(14,os)),o(3),c("routerLink",M(15,rs)),o(3),c("routerLink",M(16,ls)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,U,re,Z,ne],encapsulation:2})};var Ur=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],xs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],hs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Ss=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],ys=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Ds=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],vs=()=>["/menu/Contacts/Contact/Suppliers/Info"],ws=i=>({ID:i}),Ts=(i,s,e)=>({From:i,SupplierID:s,To:e});function Ps(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Fs(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function Is(i,s){if(i&1&&(n(0,"tr",24)(1,"td"),p(2),a(),n(3,"td",25)(4,"a",26),p(5),a()(),n(6,"td",27),p(7),a(),n(8,"td",28),p(9),d(10,"quantityFraction"),a(),n(11,"td",27)(12,"a",26),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",M(19,vs))("queryParams",X(20,ws,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,9,e.Quantity)," "),o(3),c("routerLink",M(22,Ur))("queryParams",_t(23,Ts,v(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,v(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),D(" ",g(16,17,e.Total))}}function bs(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",29),b(2,"th",30),n(3,"th",27),p(4,"Total Quantity"),a(),n(5,"th",27),p(6,"Total Sales"),a()(),n(7,"tr"),b(8,"td",31),n(9,"td",27),p(10),a(),n(11,"td",27),p(12),a()()()),i&2){let e=m(2);o(10),F(e.data.TotalQty),o(2),F(e.data.TotalSales)}}function Es(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"RANK"),a(),n(6,"th",20),p(7,"SUPPLIER"),a(),n(8,"th",21),p(9," CODE "),a(),n(10,"th",22),p(11," QUANTITY "),a(),n(12,"th",23),p(13," TOTAL "),a()()(),n(14,"tbody"),G(15,Is,17,27,"tr",24,Y),a(),S(17,bs,13,2,"tfoot"),a()()}if(i&2){let e=m();o(15),H(e.data.Data),o(2),y((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?17:-1)}}var Xn=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}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 h=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,h);case"Supplier":return this.compare(t.Name,l.Name,h);case"Code":return this.compare(t.Code,l.Code,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Total":return this.compare(t.Total,l.Total,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[W],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Ps,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Compare with Transfer Order "),a()(),n(19,"li")(20,"a",6),p(21," Product Tags Analysis "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Fs,16,10,"ng-template",null,0,O),a(),n(28,"content"),S(29,Es,18,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Ur)),o(3),c("routerLink",M(13,xs)),o(3),c("routerLink",M(14,hs)),o(3),c("routerLink",M(15,Ss)),o(3),c("routerLink",M(16,ys)),o(3),c("routerLink",M(17,Ds)),o(6),y(t.data?29:-1))},dependencies:[A,Q,$,J,Qe,L,R,pe,ge,Ue,U,oe,Z,ne],encapsulation:2})};var zr=Jt(bi());var Vs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Bs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Os=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Ls=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Rs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],ks=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Ws=(i,s,e,r,t)=>({From:i,To:s,ListIDs:e,ListVariantID:r,GroupByVariant:t}),Ns=i=>[i],As=i=>({ID:i}),Gs=(i,s,e,r,t,l)=>({ID:i,From:s,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Kr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],Hs=(i,s,e)=>({VariantID:i,From:s,To:e}),Qs=(i,s,e)=>({ProductID:i,From:s,To:e});function Ys(i,s){if(i&1&&(n(0,"a",9),b(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=m();c("queryParams",cn(1,Ws,(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 js(i,s){if(i&1){let e=I();n(0,"button",11),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",12),p(2," Export "),a()}}function qs(i,s){if(i&1){let e=I();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("modelChange",function(t){u(e);let l=m();return f(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),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),C("date",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(2),C("date",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(3),c("multiple",!0)("multiple",!0),C("ngModel",e.pageData.Filter.BrandIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Tags),C("ngModel",e.pageData.Filter.TagID),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),C("ngModel",e.pageData.Filter.LogisticsServiceID),c("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),C("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.pageData.supplierName),o(3),c("items",e.pageData.Options.ContactGroups),C("ngModel",e.pageData.Filter.ContactGroupID),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(3),C("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function Us(i,s){if(i&1){let e=I();n(0,"th",48)(1,"div",49)(2,"input",50),P("change",function(t){u(e);let l=m(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=m(2);o(2),c("checked",e.isAllCheckBoxChecked())}}function zs(i,s){if(i&1&&(n(0,"th",51),p(1," Qty "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Quantity.start)}}function Ks(i,s){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function Xs(i,s){i&1&&(n(0,"th",53),p(1," Cost "),a())}function Js(i,s){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function Zs(i,s){if(i&1&&(n(0,"th",55),p(1," Sales "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function $s(i,s){i&1&&(n(0,"th",56),p(1," Tax "),a())}function e0(i,s){if(i&1&&(n(0,"th",57),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function t0(i,s){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function i0(i,s){i&1&&(n(0,"th",59),p(1," % "),a())}function n0(i,s){if(i&1){let e=I();n(0,"td")(1,"div",49)(2,"input",71),x("ngModelChange",function(t){u(e);let l=m().$implicit;return f(l.checked,t)||(l.checked=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=m().$implicit;o(2),c("value",e.ID),C("ngModel",e.checked)}}function a0(i,s){if(i&1){let e=I();pt(0),n(1,"img",72),P("click",function(t){u(e);let l=m().$implicit,h=m(2);return _(h.openBigPicture(l==null?null:l.ImageURL,t))}),a(),mt()}if(i&2){let e=m().$implicit;o(),c("src",e.ThumbnailUrl,rn)}}function o0(i,s){if(i&1){let e=I();n(0,"a",73)(1,"img",74),P("click",function(t){u(e);let l=m().$implicit,h=m(2);return _(h.openBigPicture(l,t))}),a()()}if(i&2){let e=m(3);c("target",e.pageData.LinkTarget)}}function r0(i,s){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=m().$implicit,t=m(2);o(),c("queryParams",Ao(4,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(),F(g(3,2,r.Quantity))}}function l0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.OnHand)," ")}}function p0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.UnitCost)," ")}}function m0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function s0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Kr))("queryParams",_t(12,Hs,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function c0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Kr))("queryParams",_t(12,Qs,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function d0(i,s){if(i&1&&(n(0,"td",75),E(1,s0,5,16,"a",78)(2,c0,5,16,"a",78),a()),i&2){let e=m(3);o(),c("ngIf",e.pageData.Filter.GroupByVariant),o(),c("ngIf",!e.pageData.Filter.GroupByVariant)}}function u0(i,s){if(i&1&&(n(0,"td",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function _0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNTax)," ")}}function g0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit)," ")}}function C0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Margin)," ")}}function f0(i,s){if(i&1&&(n(0,"tr",60),E(1,n0,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),E(7,a0,2,1,"ng-container",8)(8,o0,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),E(14,r0,4,11,"td",67)(15,l0,3,3,"td",67)(16,p0,3,3,"td",68)(17,m0,3,3,"td",67)(18,d0,3,2,"td",67)(19,u0,3,3,"td",69)(20,_0,3,3,"td",67)(21,g0,3,4,"td",70)(22,C0,3,4,"td",70),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(),c("ngIf",t.column.CompareQtySold.selected),o(2),F(r+1),o(4),c("ngIf",e.ImageURL),o(),c("ngIf",!e.ImageURL),o(2),c("routerLink",X(17,Ns,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(19,As,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.OnHand.selected),o(),c("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function x0(i,s){i&1&&b(0,"td",75)}function h0(i,s){i&1&&(n(0,"td",75),p(1," Total : "),a())}function S0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Quantity"))," ")}}function y0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"OnHand"))," ")}}function D0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"UnitCost"))," ")}}function v0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function w0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Sales")))}}function T0(i,s){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Tax")))}}function P0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"SalesNTax")))}}function F0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.infiniteList,"Profit"))," ")}}function I0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")/v(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),D(" ",g(6,14,v(4,8,e.infiniteList,"Profit")/v(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function b0(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",81),b(2,"td",75),E(3,x0,1,0,"td",67)(4,h0,2,0,"td",67)(5,S0,4,6,"td",67)(6,y0,4,6,"td",67)(7,D0,4,6,"td",68)(8,v0,4,6,"td",67)(9,w0,5,6,"td",82)(10,T0,5,6,"td",69)(11,P0,5,6,"td",82)(12,F0,5,10,"td",70)(13,I0,7,16,"td",70),a()()),i&2){let e=m(2);o(3),c("ngIf",e.column.CompareQtySold.selected),o(),c("ngIf",e.column.CompareQtySold.selected||e.column.QTY.selected||e.column.OnHand.selected||e.column.Cost.selected||e.column.Gross.selected||e.column.Sales.selected||e.column.SalesNTax.selected||e.column.Tax.selected||e.column.Profit.selected&&e.column.Profit.role||e.column.Margin.selected&&e.column.Profit.role),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function E0(i,s){if(i&1){let e=I();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",33)(5,"tr"),E(6,Us,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),E(11,zs,2,1,"th",37)(12,Ks,2,0,"th",38)(13,Xs,2,0,"th",39)(14,Js,2,0,"th",40)(15,Zs,2,1,"th",41)(16,$s,2,0,"th",42)(17,e0,2,1,"th",43)(18,t0,2,0,"th",44)(19,i0,2,0,"th",45),a()(),n(20,"tbody"),E(21,f0,23,21,"tr",46),a(),E(22,b0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.CompareQtySold.selected),o(5),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Jn=class i extends De{constructor(e,r,t,l,h,T,Ze){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,h);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=h;this.matDialog=T;this.bigPicture=Ze}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Pe(j);columnService=Pe(gt);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=dt([]);queryParams=dt(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=nt(et({},this.data),{Data:e.Data.map(t=>nt(et({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=nt(et({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=nt(et({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>nt(et({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;V.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,zi.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=nt(et({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),h);case"Brand":return V.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),h);case"Quantity":return V.compare(t.Quantity,l.Quantity,h);case"Total_Cost":return V.compare(t.UnitCost,l.UnitCost,h);case"Inventory":return V.compare(t.OnHand,l.OnHand,h);case"Total_Sales":return V.compare(t.Total,l.Total,h);case"Total_Tax":return V.compare(t.Tax,l.Tax,h);case"Total_Tax_Sales":return V.compare(t.SalesNTax,l.SalesNTax,h);case"ReOrder":return V.compare(t.MinStock,l.MinStock,h);case"Gross":return V.compare(t.Gross,l.Gross,h);case"Margin":return V.compare(t.Margin,l.Margin,h);case"Profit":return V.compare(t.Profit,l.Profit,h);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,zr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(qe),w(Ne),w(z),w(An))};static \u0275cmp=B({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[W],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,Ys,3,7,"a",2),S(3,js,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10," Compare by Outlet "),a()(),n(11,"li")(12,"a",7),p(13," Compare by Month "),a()(),n(14,"li")(15,"a",7),p(16," Compare with Transfer Order "),a()(),n(17,"li")(18,"a",7),p(19," Product Tags Analysis "),a()(),n(20,"li")(21,"a",7),p(22," Top Suppliers "),a()(),n(23,"li")(24,"a",7),p(25," Quantity Sold Chart "),a()()()()(),n(26,"filters"),E(27,qs,45,36,"ng-template",null,0,O),a(),E(29,E0,24,18,"content",8),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.isAnyItemChecked),o(),y(t.roleService.global.Export?3:-1),o(6),c("routerLink",M(14,Vs)),o(3),c("routerLink",M(15,Bs)),o(3),c("routerLink",M(16,Os)),o(3),c("routerLink",M(17,Ls)),o(3),c("routerLink",M(18,Rs)),o(3),c("routerLink",M(19,ks)),o(5),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,Jo,L,R,ie,pe,ge,Te,Ae,Ce,U,ze,ti,se,oe,Z,ne],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var V0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],B0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],O0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],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=>({ID:i}),N0=(i,s)=>s.Name,A0=(i,s)=>s.ID;function G0(i,s){if(i&1){let e=I();n(0,"a",16),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",17),p(2," Export "),a()}}function H0(i,s){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet Group"),a(),n(3,"POS-outlet-group-tree-select",19),x("selectedOutletGroupIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",20),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",21),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Category"),a(),n(12,"POS-product-category-select",22),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(13,"h6"),p(14,"Brand"),a(),n(15,"ng-select",23),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(16,"h6"),p(17,"Supplier"),a(),n(18,"autocompleteV2",24),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(19,"h6"),p(20,"Product Tags"),a(),n(21,"ng-select",25),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ProductTagID,t)||(l.pageData.Filter.ProductTagID=t),_(t)}),a(),n(22,"h6"),p(23,"From - To"),a(),n(24,"div")(25,"datepicker",26),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(26,"div",27)(27,"datepicker",28),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(28,"h6"),p(29,"Scope"),a(),n(30,"radio-options",29),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("showClear",!0),C("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),C("ngModel",e.pageData.Filter.BrandID),o(3),C("ngModel",e.pageData.Filter.SupplierID),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.ProductTags),C("ngModel",e.pageData.Filter.ProductTagID),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function Q0(i,s){i&1&&(n(0,"th",30),p(1,"Code"),a()),i&2&&qt("text-align","right")}function Y0(i,s){i&1&&(n(0,"th",31),p(1,"Cost"),a()),i&2&&qt("text-align","right")}function j0(i,s){i&1&&(n(0,"th",31),p(1,"Sales"),a()),i&2&&qt("text-align","right")}function q0(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit;c("matTooltip",Ct(e.Name)),o(),D(" ",e.Code??e.Name," ")}}function U0(i,s){i&1&&(n(0,"th",14),p(1,"Total"),a())}function z0(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),F(e.Code)}}function K0(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),D(" ",g(2,3,e.UnitCost)," ")}}function X0(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),D(" ",g(2,3,e.UnitPrice)," ")}}function J0(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e," ")}}function Z0(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Total)}}function $0(i,s){if(i&1&&(n(0,"tr",15)(1,"td")(2,"a",32),p(3),a()(),S(4,z0,2,3,"td",33),S(5,K0,3,5,"td",33),S(6,X0,3,5,"td",33),G(7,J0,2,1,"td",14,Yi),S(9,Z0,2,1,"td",14),a()),i&2){let e=s.$implicit,r=m();o(2),c("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",X(7,W0,e.ID)),o(),D(" ",e.Name),o(),y(r.column.code.selected?4:-1),o(),y(r.column.cost&&r.column.cost.selected?5:-1),o(),y(r.column.sales&&r.column.sales.selected?6:-1),o(),H(e.Quantities),o(2),y(r.column.total.selected?9:-1)}}var Zn=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=h}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];column={code:{selected:!0,name:"Code"},cost:{selected:!1,name:"Cost"},sales:{selected:!1,name:"Sales"},total:{selected:!0,name:"Total"}};openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}submit(){this.pageData.Filter.Product?(delete this.column.cost,delete this.column.sales):(this.column.cost={selected:!1,name:"Cost"},this.column.sales={selected:!1,name:"Sales"}),super.searchFromPageOne()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[W],decls:44,vars:22,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%",3,"text-align"],[1,"text-end",2,"width","10%",3,"text-align"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"text-end"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[3,"routerLink","queryParams"],[3,"text-align"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.submit())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,G0,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,H0,31,18,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),S(35,Q0,2,2,"th",11),S(36,Y0,2,2,"th",12),S(37,j0,2,2,"th",12),G(38,q0,2,3,"th",13,N0),S(40,U0,2,0,"th",14),a()(),n(41,"tbody"),G(42,$0,10,9,"tr",15,A0),a()()()()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(16,V0)),o(3),c("routerLink",M(17,B0)),o(3),c("routerLink",M(18,O0)),o(3),c("routerLink",M(19,L0)),o(3),c("routerLink",M(20,R0)),o(3),c("routerLink",M(21,k0)),o(12),y(t.column.code.selected?35:-1),o(),y(t.column.cost&&t.column.cost.selected?36:-1),o(),y(t.column.sales&&t.column.sales.selected?37:-1),o(),H(t.data==null?null:t.data.Outlet),o(2),y(t.column.total.selected?40:-1),o(2),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,$,J,L,R,ie,Te,Ae,Ce,U,ze,Vi,Z],encapsulation:2})};var xo=Jt(bi());var ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],tc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],ic=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],nc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ac=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],oc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Xr=()=>({standalone:!0}),Jr=()=>({overflow:"visible"}),rc=i=>[i],lc=i=>({ID:i});function pc(i,s){if(i&1){let e=I();n(0,"a",17),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",18),p(2," Export"),a()}}function mc(i,s){if(i&1){let e=I();n(0,"div",19)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",20),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListOutletID,t)||(l.pageData.Filter.ListOutletID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",21),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",22)(8,"div",23)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",24),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a()(),n(12,"div",25)(13,"h6"),p(14,"Compare Month To"),a(),n(15,"p-datepicker",24),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",26),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListOutletID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(5),C("ngModel",e.pageData.Filter.MonthFrom),c("ngModelOptions",M(18,Xr))("contentStyle",M(19,Jr))("appendTo","body")("baseZIndex",99999),o(4),C("ngModel",e.pageData.Filter.MonthTo),c("ngModelOptions",M(20,Xr))("contentStyle",M(21,Jr))("appendTo","body")("baseZIndex",99999),o(3),C("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter)}}function sc(i,s){i&1&&(n(0,"th",11),p(1," Name "),a())}function cc(i,s){i&1&&(n(0,"th",12),p(1," Code "),a())}function dc(i,s){i&1&&(n(0,"th",13)(1,"span",27),p(2," On Hand "),a()())}function uc(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=m();o(),D(" ",r.months[e.Month-1].ColumnLabel," ")}}function _c(i,s){i&1&&(n(0,"th",13)(1,"span",28),p(2," Total "),a()())}function gc(i,s){if(i&1&&(n(0,"td")(1,"a",31),p(2),a()()),i&2){let e=m().$implicit,r=m();o(),c("routerLink",X(3,rc,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(5,lc,e.ID)),o(),D(" ",e.Name," ")}}function Cc(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function fc(i,s){if(i&1&&(n(0,"td",29)(1,"span",27),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",e.OnHand?v(3,1,e.OnHand,r.pageData.FractionDigit):"0"," ")}}function xc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m();o(),D(" ",t.findKey(r.Sold,e.Month)?v(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):"0"," ")}}function hc(i,s){if(i&1&&(n(0,"td",29)(1,"span",28),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",v(4,4,v(3,1,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function Sc(i,s){if(i&1&&(n(0,"tr"),S(1,gc,3,7,"td"),S(2,Cc,2,1,"td"),S(3,fc,4,4,"td",29),E(4,xc,3,4,"td",30),S(5,hc,5,7,"td",29),a()),i&2){let e=m();o(),y(e.column.name.selected?1:-1),o(),y(e.column.code.selected?2:-1),o(),y(e.column.OnHand.selected?3:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?5:-1)}}function yc(i,s){i&1&&b(0,"td")}function Dc(i,s){i&1&&(n(0,"td",29),p(1,"Total :"),a())}function vc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),D(" ",v(2,1,e.getOnHandTotal(),e.pageData.FractionDigit)," ")}}function wc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function Tc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}function Pc(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",32),S(2,yc,1,0,"td"),S(3,Dc,2,0,"td",29),S(4,vc,3,4,"td",29),E(5,wc,3,4,"td",30),S(6,Tc,4,7,"td",29),a()()),i&2){let e=m();o(2),y(e.column.name.selected?2:-1),o(),y(e.column.code.selected?3:-1),o(),y(e.column.OnHand.selected?4:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?6:-1)}}var $n=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date().getFullYear(),Ze=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(T,Ze)}_toastrService=Pe(qe);columnService=Pe(gt);years=V.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];column={name:{selected:!0,name:"Name"},code:{selected:!0,name:"Code"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/GetProductSalesMonthlyOnHand",responseProperty:"OnHand"},total:{selected:!0,name:"Total"}};MonthFrom;MonthTo;preGetList(){if(this.pageData&&this.pageData.Filter&&this.pageData.Filter.MonthFrom&&this.pageData.Filter.MonthTo){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs;return}super.preGetList()}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=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(),h);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),h);default:return 0}})}preInitList(){super.preInitList?.(),this.pageData.Filter.MonthFrom=new Date(this.pageData.Filter.MonthFrom),this.pageData.Filter.MonthTo=new Date(this.pageData.Filter.MonthTo)}onSubmit(){delete this.pageData.Filter.ListDynamicID;let e=(0,xo.default)(this.pageData.Filter.MonthFrom),r=(0,xo.default)(this.pageData.Filter.MonthTo);if(r.diff(e,"months")>5)this._toastrService.warning("Selected month range exceeds the maximum of 6 months.","Warning");else{let l=e.format("YYYY-MM")+"-01",h=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(h),delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs,this.searchFromPageOne()}}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.pageData.Filter.ListDynamicID=this.infiniteList.map(e=>e.ID),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter,"OnHand",e=>this.mappingDataOnAdvancedColumn(e))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList.map(r=>{let t=e.find(l=>l.ID==r.ID);return t&&(r.OnHand=t.OnHand),r}))}getOnHandTotal(){return!this.infiniteList||this.infiniteList.length===0?0:this.infiniteList.reduce((r,t)=>{let l=Number(t.OnHand)||0;return r+l},0)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[W],decls:41,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table","table-fixed","table-bordered",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left","border-end",2,"width","250px"],["mat-sort-header","Code",1,"align-left","border-end",2,"width","150px"],[1,"text-end","border-end",2,"width","90px"],["class","text-end border-end","style","width: 90px",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[1,"row",2,"margin-top","15px"],[1,"col-6","pe-2"],["view","month","dateFormat","M yy",3,"ngModelChange","ngModel","ngModelOptions","contentStyle","appendTo","baseZIndex"],[1,"col-6"],["name","Scope",3,"modelChange","model","options"],["matTooltip","Current OnHand Inventory","matTooltipPosition","left",1,"cursor-pointer"],["matTooltip","Total Quantity Sold Based on Filtered Month","matTooltipPosition","left",1,"cursor-pointer"],[1,"text-end"],["class","text-end",4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.onSubmit())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,pc,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,mc,19,22,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(T){return u(l),_(t.sortData(T))}),n(31,"thead",9)(32,"tr",10),S(33,sc,2,0,"th",11),S(34,cc,2,0,"th",12),S(35,dc,3,0,"th",13),E(36,uc,2,1,"th",14),S(37,_c,3,0,"th",13),a()(),n(38,"tbody"),E(39,Sc,6,5,"tr",15),a(),E(40,Pc,7,5,"tfoot",16),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(19,ec)),o(3),c("routerLink",M(20,tc)),o(3),c("routerLink",M(21,ic)),o(3),c("routerLink",M(22,nc)),o(3),c("routerLink",M(23,ac)),o(3),c("routerLink",M(24,oc)),o(10),y(t.column.name.selected?33:-1),o(),y(t.column.code.selected?34:-1),o(),y(t.column.OnHand.selected?35:-1),o(),c("ngForOf",t.data==null?null:t.data.MonthlySales),o(),y(t.column.total.selected?37:-1),o(2),c("ngForOf",t.data==null?null:t.data.Data),o(),c("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[A,st,it,Q,L,R,ie,pe,ge,Te,Ce,U,Tr,se,re],encapsulation:2})};var Fc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Ic=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],bc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Mc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Vc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Bc=i=>[i],Oc=i=>({ID:i});function Lc(i,s){if(i&1){let e=I();n(0,"button",13),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",14),p(2," Export"),a()}}function Rc(i,s){if(i&1){let e=I();n(0,"div",15)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",17),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",18),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",19)(12,"datepicker",20),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",21),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function kc(i,s){if(i&1&&(n(0,"th",22),p(1),a()),i&2){let e=s.$implicit;o(),F(e)}}function Wc(i,s){if(i&1&&(n(0,"tr"),b(1,"th")(2,"th"),G(3,kc,2,1,"th",22,Y),a()),i&2){let e=m();o(3),H(e.data==null?null:e.data.Outlet)}}function Nc(i,s){if(i&1&&(n(0,"th",12),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e)}}function Ac(i,s){if(i&1&&(n(0,"a",23),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m();c("routerLink",X(3,Bc,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(5,Oc,r[1])),o(),F(r[e])}}function Gc(i,s){if(i&1&&p(0),i&2){let e=m().$implicit,r=m().$implicit;D(" ",r[e]," ")}}function Hc(i,s){if(i&1&&(n(0,"td",11),S(1,Ac,2,7,"a",23)(2,Gc,1,1),a()),i&2){let e=s.$index;o(),y(e===0?1:2)}}function Qc(i,s){if(i&1&&(n(0,"tr",11),G(1,Hc,3,1,"td",11,Y),a()),i&2){let e=s.$implicit,r=m();o(),H(r.getFilteredKeys(e))}}var ea=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[W],decls:43,vars:18,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border",2,"width","15%"],[1,"border"],[1,"border",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2",1,"text-center","border"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Lc,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Rc,16,10,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9),S(32,Wc,5,0,"tr"),n(33,"tr")(34,"th",10),p(35,"Name"),a(),n(36,"th",11),p(37,"Code"),a(),G(38,Nc,2,1,"th",12,Y),a()(),n(40,"tbody"),G(41,Qc,3,0,"tr",11,Y),a()()()()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Fc)),o(3),c("routerLink",M(13,Ic)),o(3),c("routerLink",M(14,bc)),o(3),c("routerLink",M(15,Ec)),o(3),c("routerLink",M(16,Mc)),o(3),c("routerLink",M(17,Vc)),o(9),y((t.data==null?null:t.data.Outlet.length)>0?32:-1),o(6),H(t.data==null?null:t.data.Header),o(3),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,J,L,R,Te,Ce,U],encapsulation:2})};var Yc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],jc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],qc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],Uc=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),Zr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],zc=(i,s,e)=>({CategoryID:i,From:s,To:e}),Kc=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],$r=i=>({CategoryID:i});function Xc(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Jc(i,s){if(i&1&&(n(0,"span",23),p(1),a()),i&2){let e=s.item;c("matTooltip",Ct(e.Value)),o(),F(e.Value)}}function Zc(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),E(10,Jc,2,3,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a(),n(29,"h6"),p(30,"Product Type"),a(),n(31,"radio-options",22),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),C("ngModel",e.pageData.Filter.BrandID),o(5),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),C("model",e.pageData.Filter.ExcludeZero),o(3),C("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes)}}function $c(i,s){i&1&&(n(0,"th",43),p(1," Cost "),b(2,"p-treeTableSortIcon",44),a())}function ed(i,s){i&1&&(n(0,"th",45),p(1," Profit "),b(2,"p-treeTableSortIcon",46),a())}function td(i,s){i&1&&(n(0,"th",47),p(1," % "),b(2,"p-treeTableSortIcon",48),a())}function id(i,s){if(i&1&&(n(0,"tr",29)(1,"th",30),p(2," Category "),b(3,"p-treeTableSortIcon",31),a(),n(4,"th",32),p(5," Qty "),b(6,"p-treeTableSortIcon",33),a(),E(7,$c,3,0,"th",34),n(8,"th",35),p(9," Gross "),b(10,"p-treeTableSortIcon",36),a(),n(11,"th",37),p(12," Disc "),b(13,"p-treeTableSortIcon",38),a(),n(14,"th",39),p(15," Sales "),b(16,"p-treeTableSortIcon",40),a(),E(17,ed,3,0,"th",41)(18,td,3,0,"th",42),a()),i&2){let e=m(2);o(7),c("ngIf",e.roleService.product.Cost),o(10),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function nd(i,s){if(i&1&&(n(0,"td",57)(1,"span",23),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.CostInDirect&&e.Cost?"Direct ("+g(2,3,e.Cost)+") Indirect ("+g(3,5,e.CostInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedCost))}}function ad(i,s){if(i&1&&(n(0,"td",58)(1,"span",23),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.ProfitInDirect&&e.Profit?"Direct ("+g(2,3,e.Profit)+") Indirect ("+g(3,5,e.ProfitInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedProfit))}}function od(i,s){if(i&1&&(n(0,"span",23),d(1,"number"),d(2,"number"),p(3),d(4,"number"),a()),i&2){let e=m(2).rowData;c("matTooltip",Ct(e.PercentageInDirect&&e.Percentage?"Direct ("+v(1,3,e.Percentage,"1.0-2")+") Indirect ("+v(2,6,e.PercentageInDirect,"1.0-2")+")":"")),o(3),D("",g(4,9,e.DisplayedPercentage),"%")}}function rd(i,s){if(i&1&&(n(0,"td"),E(1,od,5,11,"span",59),a()),i&2){let e=m(3);o(),c("ngIf",e.roleService.report.Profit)}}function ld(i,s){if(i&1&&(n(0,"tr",49)(1,"td"),b(2,"p-treeTableToggler",50),n(3,"a",51),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",23),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),E(13,nd,6,9,"td",52),n(14,"td",53)(15,"span",23),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",54)(21,"a",55),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",53)(27,"span",23),d(28,"number"),d(29,"number"),n(30,"a",51),p(31),d(32,"amountFraction"),a()()(),E(33,ad,6,9,"td",56)(34,rd,2,1,"td",7),a()),i&2){let e=s.$implicit,r=s.rowData,t=m(2);c("ttRow",e),o(2),c("rowNode",e),o(),c("routerLink",M(54,Zr))("queryParams",_t(55,zc,r.ID,v(4,24,t.pageData.Filter.From,"yyyy-MM-dd"),v(5,27,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(r.Name),o(2),c("matTooltip",Ct(r.QuantityIndirect&&r.Quantity?"Direct ("+g(9,30,r.Quantity)+") Indirect ("+g(10,32,r.QuantityIndirect)+")":"")),o(3),F(g(12,34,r.DisplayedQuantity)),o(2),c("ngIf",t.roleService.product.Cost),o(2),c("matTooltip",Ct(r.GrossIndirect&&r.GrossSales?"Direct ("+g(16,36,r.GrossSales)+") Indirect ("+g(17,38,r.GrossIndirect)+")":"")),o(3),F(g(19,40,r.DisplayedGross)),o(3),c("matTooltip",Ct(r.DiscountIndirect&&r.Discount?"Direct ("+g(22,42,r.Discount)+") Indirect ("+g(23,44,r.DiscountIndirect)+")":""))("routerLink",M(59,Kc))("queryParams",X(60,$r,r.ID)),o(3),F(g(25,46,r.DisplayedTotalDiscount)),o(3),c("matTooltip",Ct(r.NetSalesIndirect&&r.Sales?"Direct ("+g(28,48,r.Sales)+") Indirect ("+g(29,50,r.NetSalesIndirect)+")":"")),o(3),c("routerLink",M(62,Zr))("queryParams",X(63,$r,r.ID)),o(),F(g(32,52,r.DisplayedNetSales)),o(2),c("ngIf",t.roleService.report.Profit),o(),c("ngIf",t.roleService.report.Profit)}}function pd(i,s){if(i&1&&(n(0,"td",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalCost)," ")}}function md(i,s){if(i&1&&(n(0,"td",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalProfit)," ")}}function sd(i,s){if(i&1&&(n(0,"td",61),p(1),d(2,"number"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function cd(i,s){if(i&1&&(n(0,"tr",60)(1,"td",61),p(2,"Total :"),a(),n(3,"td",61),p(4),d(5,"quantityFraction"),a(),E(6,pd,3,3,"td",62),n(7,"td",63)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",61),p(12),d(13,"amountFraction"),a(),n(14,"td",63),p(15),d(16,"amountFraction"),a(),E(17,md,3,3,"td",62)(18,sd,3,3,"td",64),a()),i&2){let e=m(2);o(4),D(" ",g(5,7,e.data.Aggregate.TotalQuantity)," "),o(2),c("ngIf",e.roleService.product.Cost),o(3),F(g(10,9,e.data.Aggregate.TotalGross)),o(3),D(" ",g(13,11,e.data.Aggregate.TotalDiscount)," "),o(3),D(" ",g(16,13,e.data.Aggregate.TotalNetSales)," "),o(2),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function dd(i,s){if(i&1&&(n(0,"content")(1,"div",24)(2,"p-treeTable",25),E(3,id,19,3,"ng-template",26)(4,ld,35,65,"ng-template",27)(5,cd,19,15,"ng-template",28),a()()()),i&2){let e=m();o(2),c("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",M(4,Uc))}}var ta=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[W],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["name","render-ProductType",3,"modelChange","model","options"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedProfit",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["style","width: 120px","class","text-danger",4,"ngIf"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],["style","width: 120px","class","text-success",4,"ngIf"],[1,"text-danger",2,"width","120px"],[1,"text-success",2,"width","120px"],["matTooltipPosition","above",3,"matTooltip",4,"ngIf"],[1,"table-footer"],[1,"text-end"],["style","width: 120px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","150px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","120px"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,Xc,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," List View "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),E(17,Zc,32,17,"ng-template",null,0,O),a(),E(19,dd,6,5,"content",7),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(10,Yc)),o(3),c("routerLink",M(11,jc)),o(3),c("routerLink",M(12,qc)),o(5),c("ngIf",t.data))},dependencies:[A,it,Q,$,J,L,R,ie,Te,Ae,Fr,fn,Mr,Ir,br,Er,Ce,U,ze,Mn,re,oe,Z,ne],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var ud=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],_d=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],gd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function Cd(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function fd(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(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),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.CustomerID)}}function xd(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function hd(i,s){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Value)}}function Sd(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Value))}}function yd(i,s){if(i&1&&(n(0,"td"),S(1,hd,2,1,"span"),S(2,Sd,3,3,"span"),a()),i&2){let e=s.$implicit;o(),y(e.Key=="Category"?1:-1),o(),y(e.Key!="Category"?2:-1)}}function Dd(i,s){if(i&1&&(n(0,"tr"),G(1,yd,3,2,"td",null,Y),a()),i&2){let e=s.$implicit;o(),H(e)}}function vd(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e))}}function wd(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",20)(2,"td"),p(3,"Total : "),a(),G(4,vd,3,3,"td",null,Y),a()()),i&2){let e=m(2);o(4),H(e.data.Sum)}}function Td(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr"),G(4,xd,2,2,"th",19,Y),a()(),n(6,"tbody"),G(7,Dd,3,0,"tr",null,Y),a(),S(9,wd,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var ia=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}openExportModal(){this.matDialog.open(K,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T]){let Ze=t.find(Ai=>Ai.Key===[this.data.Dataheader[T]].toString()).Value,Ni=l.find(Ai=>Ai.Key===[this.data.Dataheader[T]].toString()).Value;return this.compare(Ze,Ni,h)}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Cd,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Tree View "),a()(),n(10,"li")(11,"a",6),p(12," List View "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,fd,16,9,"ng-template",null,0,O),a(),n(19,"content"),S(20,Td,10,1,"div",7),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(10,ud)),o(3),c("routerLink",M(11,_d)),o(3),c("routerLink",M(12,gd)),o(6),y(t.data?20:-1))},dependencies:[A,Q,J,L,R,pe,ge,Ae,Ce,U,Z],encapsulation:2})};var Pd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Fd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Id=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function bd(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),C("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies)}}function Ed(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",11),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var na=class i extends me{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=V.Months;Years=V.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(w(N),w(k))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),E(16,bd,10,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,Ed,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(7),c("routerLink",M(8,Pd)),o(3),c("routerLink",M(9,Fd)),o(3),c("routerLink",M(10,Id)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,R,ii],encapsulation:2})};var Md=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Vd(i,s){if(i&1){let e=I();n(0,"div",4)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",5),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",6),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",7)(9,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("items",e.pageData.Options.SalesOrderTagIDs),C("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("multiple",!0)}}function Bd(i,s){if(i&1&&(n(0,"content")(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div",14)(6,"div",15)(7,"p",16),p(8,"Transaction Per Hour"),a()(),n(9,"div",17),b(10,"POS-line-chart",18),a()()()(),n(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",15)(15,"p",16),p(16,"Transaction Per Session"),a()(),n(17,"div",17),b(18,"POS-pie-chart",18),a()()()()()()()),i&2){let e=m();o(10),c("config",e.chartConfig)("data",e.ChartData),o(8),c("config",e.pieConfig)("data",e.PieData)}}var aa=class i extends De{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let h={name:l.Name+": "+l.Description,y:l.Transaction};t.push(h)}),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,h){return l+"<br/>"+h.series.name+": <b>"+h.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[W],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),b(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),E(6,Vd,13,9,"ng-template",null,0,O),a(),S(8,Bd,19,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("routerLink",M(6,Md)),o(6),y(t.data?8:-1))},dependencies:[A,Q,$,J,L,R,ii,Mt,U],encapsulation:2})};function Od(i,s){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Ld(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function Rd(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"number"),a(),n(10,"td",17),p(11),d(12,"amountFraction"),a(),n(13,"td",17),p(14),d(15,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(g(3,5,e.Visitor)),o(3),F(g(6,7,e.Orders)),o(3),F(g(9,9,e.TotalVisitor)),o(3),F(g(12,11,e.Sales)),o(3),F(g(15,13,e.Sales/(e.Visitor*e.Orders)))}}function kd(i,s){if(i&1&&(n(0,"div",3)(1,"table",11)(2,"thead",12)(3,"tr")(4,"th",13),p(5,"Number of Person"),a(),n(6,"th",14),p(7,"Orders"),a(),n(8,"th",14),p(9,"Total Visitor"),a(),n(10,"th",14),p(11,"Sales"),a(),n(12,"th",15),p(13,"Average Spending"),a()()(),n(14,"tbody"),G(15,Rd,16,15,"tr",null,Y),a(),n(17,"tfoot")(18,"tr",16)(19,"td",17),p(20,"Total"),a(),n(21,"td",17),p(22),d(23,"sum"),d(24,"number"),a(),n(25,"td",17),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",17),p(30),d(31,"sum"),d(32,"amountFraction"),a(),n(33,"td",17),p(34),d(35,"amountFraction"),a()()()()()),i&2){let e=m();o(15),H(e.data),o(7),F(g(24,7,v(23,4,e.data,"Orders"))),o(4),F(g(28,12,v(27,9,e.data,"TotalVisitor"))),o(4),F(g(32,17,v(31,14,e.data,"Sales"))),o(4),F(g(35,19,e.getSpendingPerPersonSum(e.data)))}}var oa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(K,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Od,3,0,"a",2),a(),n(3,"filters"),E(4,Ld,10,6,"ng-template",null,0,O),a(),n(6,"content"),S(7,kd,36,21,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,J,L,R,U,se,re,Z],encapsulation:2})};var Wd=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function Nd(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function Ad(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",19),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",20)(9,"datepicker",21),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function Gd(i,s){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Hd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Revenue))}}function Qd(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",13),p(4),d(5,"number"),a(),n(6,"td",13),p(7),d(8,"quantityFraction"),a(),n(9,"td",13),p(10),d(11,"amountFraction"),a(),n(12,"td",14),p(13),d(14,"RoundUp"),d(15,"amountFraction"),a(),n(16,"td",13),p(17),d(18,"RoundUp"),d(19,"amountFraction"),a(),S(20,Hd,3,3,"td",13),a()),i&2){let e=s.$implicit,r=m();o(2),F(e.TimeFormat),o(2),F(g(5,7,e.Count)),o(3),F(g(8,9,e.Quantity)),o(3),F(g(11,11,e.Sales)),o(3),F(g(15,15,g(14,13,e.Tax))),o(4),F(g(19,19,g(18,17,e.SalesWithTax))),o(3),y(r.roleService.product.Cost||r.roleService.report.Profit?20:-1)}}function Yd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m();o(),F(g(3,4,v(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var ra=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(K,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[W],decls:56,vars:43,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Nd,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Ad,10,6,"ng-template",null,0,O),a(),n(9,"content")(10,"div",5)(11,"table",6)(12,"thead",7)(13,"tr")(14,"th",8),p(15,"Time"),a(),n(16,"th",9),p(17,"Orders"),a(),n(18,"th",9),p(19,"Quantity"),a(),n(20,"th",10),p(21,"Sales"),a(),n(22,"th",10),p(23,"Tax"),a(),n(24,"th",10),p(25,"Sales + Tax"),a(),S(26,Gd,2,0,"th",10),a()(),n(27,"tbody"),G(28,Qd,21,21,"tr",null,Y),a(),n(30,"tfoot")(31,"tr",11),b(32,"td",12),n(33,"td",13),p(34),d(35,"sum"),d(36,"number"),a(),n(37,"td",13),p(38),d(39,"sum"),d(40,"quantityFraction"),a(),n(41,"td",13),p(42),d(43,"sum"),d(44,"amountFraction"),a(),n(45,"td",14),p(46),d(47,"sum"),d(48,"RoundUp"),d(49,"amountFraction"),a(),n(50,"td",13),p(51),d(52,"sum"),d(53,"RoundUp"),d(54,"amountFraction"),a(),S(55,Yd,4,6,"td",13),a()()()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(42,Wd)),o(23),y(t.roleService.product.Cost||t.roleService.report.Profit?26:-1),o(2),H(t.data==null?null:t.data.Data),o(6),F(g(36,16,v(35,13,t.data==null?null:t.data.Data,"Count"))),o(4),F(g(40,21,v(39,18,t.data==null?null:t.data.Data,"Quantity"))),o(4),F(g(44,26,v(43,23,t.data==null?null:t.data.Data,"Sales"))),o(4),F(g(49,33,g(48,31,v(47,28,t.data==null?null:t.data.Data,"Tax")))),o(5),F(g(54,40,g(53,38,v(52,35,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),y(t.roleService.product.Cost||t.roleService.report.Profit?55:-1))},dependencies:[A,Q,J,L,R,U,se,Cr,re,Z,ne],encapsulation:2})};var jd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],So=(i,s)=>({From:i,To:s}),qd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Ud=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function zd(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",10),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function Kd(i,s){if(i&1&&(n(0,"content")(1,"div",11),b(2,"POS-line-chart",12),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var la=class i extends me{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(s,e,r){super(s,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let s=this.route.snapshot.queryParams;s.From&&(this.pageData.Filter.From=s.From,this.pageData.Filter.To=s.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let s=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return V.getDatesInRange(s,e).map(l=>`${l.getDate()} ${V.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(s){this.pageData.Filter.From=s.from,this.pageData.Filter.To=s.to}static \u0275fac=function(e){return new(e||i)(w(N),w(k),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[W],decls:19,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,r){if(e&1){let t=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(t),_(r.searchFromPageOne())}),x("filterChange",function(h){return u(t),f(r.pageData.Filter,h)||(r.pageData.Filter=h),_(h)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),E(16,zd,13,11,"ng-template",null,0,O),a(),S(18,Kd,3,2,"content"),a()}e&2&&(c("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",r.pageData.Filter),o(7),c("routerLink",M(11,jd))("queryParams",fe(12,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(15,qd))("queryParams",fe(16,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(19,Ud))("queryParams",fe(20,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),y(r.data?18:-1))},dependencies:[A,Q,$,L,R,Mt,Gt,Ce,U],encapsulation:2})};var $d={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},pi=class i{date;dateChange=new ln;width;minDate=V.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(s,e){let r=null;s&&(r=s.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(s){let e=null;s&&(e=s.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(s,e){let r=new Date(s.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[Ci([{provide:yn,useClass:Nn,deps:[Sn,wr]},{provide:Dn,useValue:$d}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(h){return u(t),_(r.onDateChange(h.value))}),a(),b(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(h){u(t);let T=Dt(4);return _(r.chosenYearHandler(h,T))})("monthSelected",function(h){u(t);let T=Dt(4);return _(r.setMonthAndYear(h,T))})("opened",function(){return u(t),_(r.onOpenDatepicker())})("closed",function(){return u(t),_(r.onCloseDatepicker())}),a()()}if(e&2){let t=Dt(4);qt("width",r.width||100,"%"),o(),c("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),c("for",t)}},dependencies:[At,In,yi,Tn,Pn,Fn,Di,En,wn,vn,bn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
1
|
+
import{a as ii,b as Nr}from"./chunk-C3STDN73.js";import{a as Wr}from"./chunk-KB4247J2.js";import{a as Mt,b as Ar}from"./chunk-RSNEHVIM.js";import{a as Gt,b as Gr}from"./chunk-4ZITX27A.js";import{a as ti}from"./chunk-MLBTUOHX.js";import{a as De}from"./chunk-YBUERVXV.js";import{a as An}from"./chunk-GTPQNPNO.js";import{a as Hr}from"./chunk-3ZWJMFYL.js";import{a as ze}from"./chunk-KYXB2UQI.js";import{a as Gn,b as Bi}from"./chunk-GDRHD33K.js";import{a as gt}from"./chunk-3HZIDGPN.js";import{a as pr}from"./chunk-VVWAYTKN.js";import{b as dr}from"./chunk-COA4UL2V.js";import"./chunk-32QBWLTN.js";import{a as Vi}from"./chunk-A5CTHLE4.js";import"./chunk-WKM2QOAU.js";import{a as kr}from"./chunk-ZMJLTU5O.js";import{a as Br,b as Or,d as Lr,g as Rr}from"./chunk-PRVQ3NAP.js";import"./chunk-BYXBJQAS.js";import{a as Mi}from"./chunk-4SRWAPD4.js";import{a as Tr,b as Pr}from"./chunk-4OEDK7YE.js";import"./chunk-GWKBJZYT.js";import"./chunk-B5IABJO5.js";import{e as cr}from"./chunk-O2VVATBW.js";import{a as Fr,b as Ir,c as br,d as Er,e as Mr,f as Vr}from"./chunk-DYBRYTEM.js";import"./chunk-PHH2AA3W.js";import"./chunk-Y7KCHRMM.js";import"./chunk-DTVCBHPA.js";import"./chunk-5USF4MRW.js";import{a as ne}from"./chunk-363IDTE3.js";import{a as Z}from"./chunk-QZZ2NRA3.js";import"./chunk-FAED643P.js";import{a as bi,b as wr,c as Nn,d as J,e as Ei}from"./chunk-WMZLH4YK.js";import{a as En,b as Di}from"./chunk-72RZBOHX.js";import"./chunk-3RK6DDJD.js";import{a as bn}from"./chunk-M3DKYPGC.js";import{a as Sn,b as yn,c as Dn,f as Tn,g as Pn,h as Fn,p as yi,q as In}from"./chunk-6WATOQG3.js";import"./chunk-VM4K4MNV.js";import"./chunk-XTCEZONP.js";import"./chunk-LNDHYAFW.js";import{c as sr,d as Te,e as Wn}from"./chunk-5ZD6KTDH.js";import"./chunk-ZZBF7AOW.js";import{a as vi}from"./chunk-GRLVYPPM.js";import{a as pe,b as ge,c as lr}from"./chunk-AQW4VS3Y.js";import{a as Et,b as vr}from"./chunk-4W3WYXI2.js";import{d as Sr,f as Ce}from"./chunk-GBSRXCWH.js";import{a as yr,b as Dr,c as U}from"./chunk-B7BVEOOI.js";import{b as K}from"./chunk-VXPORXGI.js";import{a as me}from"./chunk-T3ZHKT2K.js";import{a as rr}from"./chunk-HFOJZ3B5.js";import"./chunk-L6PKNRWO.js";import"./chunk-SIQZO2WM.js";import{a as q}from"./chunk-J6M7UWVR.js";import{e as A,f as Ii}from"./chunk-BFNGPKGX.js";import"./chunk-G3DZI5XK.js";import"./chunk-7YUPYNWQ.js";import"./chunk-2CL5FM3P.js";import"./chunk-LGINK7BD.js";import{c as ur}from"./chunk-IKKPP4JS.js";import"./chunk-QPAUI5EG.js";import"./chunk-45E6XCHN.js";import"./chunk-SIDUUVNA.js";import"./chunk-KZFNI67M.js";import"./chunk-4BXCIT62.js";import{a as _r,c as Ue}from"./chunk-D4FCXEV4.js";import"./chunk-6P2ASCNY.js";import{d as hr}from"./chunk-OZ3MKU4C.js";import{b as N}from"./chunk-JCLYKROE.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import{C as Rn,F as Ae,G as kn,j as vn,m as wn,t as mr,u as Vn,v as Pi,w as Bn}from"./chunk-26YFRPR2.js";import{b as ie,c as hn}from"./chunk-JBS5UYZC.js";import{A as Ln,B as fr,C as ei,K as Fi,N as xr,g as se,o as gr,s as On,z as Cr}from"./chunk-TEGIL5RZ.js";import"./chunk-B7AC4RMR.js";import"./chunk-EQLHPWVB.js";import{a as Mn,d as $}from"./chunk-THT6CY5E.js";import{b as Cn,e as wi,f as Ti,g as z}from"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import{a as nr}from"./chunk-S7FOJJP2.js";import{c as ir,j as ar,k as Ki,l as or}from"./chunk-FU2ZGMX4.js";import{a as zi}from"./chunk-2FWFPV5I.js";import{oa as fn,pa as xn,xa as tr}from"./chunk-SLX34TWD.js";import{F as At,G as gn,a as Xo,b as Jo,c as Qe,h as L,l as Zo,o as R,q as $o,s as er}from"./chunk-DWZ5JTI2.js";import"./chunk-KZBVWICA.js";import"./chunk-SBTTKQ4L.js";import"./chunk-36GWLMZX.js";import{b as j}from"./chunk-WFQIMZGL.js";import{a as V}from"./chunk-WUV22SZ4.js";import"./chunk-EAEOJMTA.js";import{p as qe,s as k}from"./chunk-LGOSIAUC.js";import{$c as fo,Ab as y,Ac as _t,Bb as Yi,Bc as Ut,Ca as dt,Cb as Y,Cc as cn,Db as G,Dc as Ao,E as ri,Eb as H,Fb as c,Fc as d,Gb as n,Gc as g,Hb as a,Hc as v,I as Qi,Ia as go,Ib as b,Ic as fi,Ja as Ro,Jd as Ko,K as Vo,Lc as O,M as Bo,Ma as ko,Mb as pt,Nb as mt,Nc as Go,Nd as Ne,Ob as Wo,Oc as xi,Pb as I,Pc as dn,Pd as _n,Q as nn,Qa as Ee,Qd as Q,Sa as rn,Sb as P,Sc as Ho,Sd as Ui,Tc as hi,Ub as m,Xa as o,Xb as Co,Xc as un,Y as jt,Ya as ln,Yb as sn,Zb as _i,Zc as Qo,_b as gi,aa as _o,ad as Yo,bd as jo,cc as Dt,dc as qt,eb as w,ec as ji,fa as Nt,fc as No,gc as qi,gd as tt,hc as p,ib as B,ic as F,id as st,jb as ui,jc as D,jd as it,ka as Oo,kb as pn,kc as $t,la as an,ma as di,mb as W,mc as C,na as Zt,nb as mn,nc as f,nd as qo,o as ci,ob as E,oc as x,od as Uo,pa as Pe,qd as oe,sc as Ct,sd as re,t as oi,ta as u,u as uo,ua as _,vd as Si,wb as li,wc as Ci,xa as on,xc as M,xd as zo,yb as S,yc as X,za as Lo,zc as fe}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import{a as et,b as nt,f as Gl,h as Jt,k as Hi}from"./chunk-SNAKHGZS.js";var Po=Gl((Xi,To)=>{(function(i,s){typeof Xi=="object"&&typeof To=="object"?To.exports=s(i._Highcharts,i._Highcharts.Templating):typeof define=="function"&&define.amd?define("highcharts/modules/series-label",["highcharts/highcharts"],function(e){return s(e,e.Templating)}):typeof Xi=="object"?Xi["highcharts/modules/series-label"]=s(i._Highcharts,i._Highcharts.Templating):i.Highcharts=s(i.Highcharts,i.Highcharts.Templating)})(typeof window>"u"?Xi:window,(i,s)=>(()=>{"use strict";var e={944:ye=>{ye.exports=i},984:ye=>{ye.exports=s}},r={};function t(ye){var ae=r[ye];if(ae!==void 0)return ae.exports;var Ve=r[ye]={exports:{}};return e[ye](Ve,Ve.exports,t),Ve.exports}t.n=ye=>{var ae=ye&&ye.__esModule?()=>ye.default:()=>ye;return t.d(ae,{a:ae}),ae},t.d=(ye,ae)=>{for(var Ve in ae)t.o(ae,Ve)&&!t.o(ye,Ve)&&Object.defineProperty(ye,Ve,{enumerable:!0,get:ae[Ve]})},t.o=(ye,ae)=>Object.prototype.hasOwnProperty.call(ye,ae);var l={};t.d(l,{default:()=>Al});var h=t(944),T=t.n(h),Ze=t(984),Ni=t.n(Ze);let Ai={enabled:!0,connectorAllowed:!1,connectorNeighbourDistance:24,format:void 0,formatter:void 0,minFontSize:null,maxFontSize:null,onArea:null,style:{fontSize:"0.8em",fontWeight:"bold"},useHTML:!1,boxesToAvoid:[]};function Zi(ye,ae,Ve,he,at,Ge){let ee=(Ge-ae)*(Ve-ye)-(he-ae)*(at-ye);return ee>0||!(ee<0)}function $i(ye,ae,Ve,he,at,Ge,ee,Le){return Zi(ye,ae,at,Ge,ee,Le)!==Zi(Ve,he,at,Ge,ee,Le)&&Zi(ye,ae,Ve,he,at,Ge)!==Zi(ye,ae,Ve,he,ee,Le)}let{animObject:co}=T(),{format:Vl}=Ni(),{setOptions:Bl}=T(),{composed:Ol}=T(),{boxIntersectLine:Fo,intersectRect:Ll}={boxIntersectLine:function(ye,ae,Ve,he,at,Ge,ee,Le){return $i(ye,ae,ye+Ve,ae,at,Ge,ee,Le)||$i(ye+Ve,ae,ye+Ve,ae+he,at,Ge,ee,Le)||$i(ye,ae+he,ye+Ve,ae+he,at,Ge,ee,Le)||$i(ye,ae,ye,ae+he,at,Ge,ee,Le)},intersectRect:function(ye,ae){return!(ae.left>ye.right||ae.right<ye.left||ae.top>ye.bottom||ae.bottom<ye.top)}},{addEvent:Io,extend:bo,fireEvent:Rl,isNumber:en,pick:zt,pushUnique:kl,syncTimeout:Wl}=T();function mi(ye,ae,Ve,he,at){let Ge=ye.chart,ee=ye.options.label||{},Le=zt(ee.onArea,!!ye.area),Ke=Le||ee.connectorAllowed,ct=Ge.boxesToAvoid,Bt=Number.MAX_VALUE,Ft=Number.MAX_VALUE,St,ft,xt,Kt,It,$e,Be;for($e=0;ct&&$e<ct.length;$e+=1)if(Ll(ct[$e],{left:ae,right:ae+he.width,top:Ve,bottom:Ve+he.height}))return!1;for($e=0;$e<Ge.series.length;$e+=1){let ut=Ge.series[$e],Re=ut.interpolatedPoints&&[...ut.interpolatedPoints];if(ut.visible&&Re){let Je=Ge.plotHeight/10;for(let ot=Ge.plotTop;ot<=Ge.plotTop+Ge.plotHeight;ot+=Je)Re.unshift({chartX:Ge.plotLeft,chartY:ot}),Re.push({chartX:Ge.plotLeft+Ge.plotWidth,chartY:ot});for(Be=1;Be<Re.length;Be+=1){if(Re[Be].chartX>=ae-16&&Re[Be-1].chartX<=ae+he.width+16){if(Fo(ae,Ve,he.width,he.height,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))return!1;ye===ut&&!xt&&at&&(xt=Fo(ae-16,Ve-16,he.width+32,he.height+32,Re[Be-1].chartX,Re[Be-1].chartY,Re[Be].chartX,Re[Be].chartY))}(Ke||xt)&&(ye!==ut||Le)&&(Bt=Math.min(Bt,(Kt=ae+he.width/2-Re[Be].chartX)*Kt+(It=Ve+he.height/2-Re[Be].chartY)*It))}if(!Le&&Ke&&ye===ut&&(at&&!xt||Bt<Math.pow(ee.connectorNeighbourDistance||1,2))){for(Be=1;Be<Re.length;Be+=1)(St=Math.min(Math.pow(ae+he.width/2-Re[Be].chartX,2)+Math.pow(Ve+he.height/2-Re[Be].chartY,2),Math.pow(ae-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(ae+he.width-Re[Be].chartX,2)+Math.pow(Ve-Re[Be].chartY,2),Math.pow(ae+he.width-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2),Math.pow(ae-Re[Be].chartX,2)+Math.pow(Ve+he.height-Re[Be].chartY,2)))<Ft&&(Ft=St,ft=Re[Be]);xt=!0}}}return(!at||!!xt)&&{x:ae,y:Ve,weight:Bt-(ft?Ft:0),connectorPoint:ft}}function Eo(ye){if(this.renderer){let ae=this,Ve=co(ae.renderer.globalAnimation).duration;ae.labelSeries=[],ae.labelSeriesMaxSum=0,ae.seriesLabelTimer&&T().clearTimeout(ae.seriesLabelTimer),ae.series.forEach(function(he){let at=he.options.label||{},Ge=he.labelBySeries,ee=Ge&&Ge.closest,Le=he.getColumn("y");at.enabled&&he.visible&&(he.graph||he.area)&&!he.boosted&&ae.labelSeries&&(ae.labelSeries.push(he),at.minFontSize&&at.maxFontSize&&Le.length&&(he.sum=Le.reduce((Ke,ct)=>(Ke||0)+(ct||0),0),ae.labelSeriesMaxSum=Math.max(ae.labelSeriesMaxSum||0,he.sum||0)),ye.type==="load"&&(Ve=Math.max(Ve,co(he.options.animation).duration)),ee&&(ee[0].plotX!==void 0?Ge.animate({x:ee[0].plotX+ee[1],y:ee[0].plotY+ee[2]}):Ge.attr({opacity:0})))}),ae.seriesLabelTimer=Wl(function(){ae.series&&ae.labelSeries&&(function(he){he.boxesToAvoid=[];let at=he.labelSeries||[],Ge=he.boxesToAvoid;he.series.forEach(ee=>(ee.points||[]).forEach(Le=>(Le.dataLabels||[]).forEach(Ke=>{let{width:ct,height:Bt}=Ke.getBBox(),Ft=(Ke.translateX||0)+(ee.xAxis?ee.xAxis.pos:ee.chart.plotLeft),St=(Ke.translateY||0)+(ee.yAxis?ee.yAxis.pos:ee.chart.plotTop);Ge.push({left:Ft,top:St,right:Ft+ct,bottom:St+Bt})}))),at.forEach(function(ee){let Le=ee.options.label||{};ee.interpolatedPoints=(function(Ke){let ct,Bt,Ft,St,ft;if(!Ke.xAxis&&!Ke.yAxis)return;let xt=Ke.points,Kt=[],It=Ke.graph||Ke.area,$e=It&&It.element,Be=Ke.chart.inverted,ut=Ke.xAxis,Re=Ke.yAxis,Je=Be?Re.pos:ut.pos,ot=Be?ut.pos:Re.pos,wt=Be?ut.len:Re.len,Gi=Be?Re.len:ut.len,ht=zt((Ke.options.label||{}).onArea,!!Ke.area),je=Re.getThreshold(Ke.options.threshold),Tt={},Xt=Be?"chartCenterX":"chartCenterY";function ai(lt){let yt=Math.round((lt.plotX||0)/8)+","+Math.round((lt.plotY||0)/8);Tt[yt]||(Tt[yt]=1,Kt.push(lt))}if(Ke.getPointSpline&&$e&&$e.getPointAtLength&&!ht&&xt.length<(Ke.chart.plotSizeX||0)/16){let lt=It.toD&&It.attr("d");for(It.toD&&It.attr({d:It.toD}),Ft=$e.getTotalLength(),ct=0;ct<Ft;ct+=16){let Lt=$e.getPointAtLength(ct),Rt=Be?Gi-Lt.y:Lt.x,kt=Be?wt-Lt.x:Lt.y;ai({chartX:Je+Rt,chartY:ot+kt,plotX:Rt,plotY:kt})}lt&&It.attr({d:lt});let yt=xt[xt.length-1].pos();ai({chartX:Je+(yt?.[0]||0),chartY:ot+(yt?.[1]||0)})}else{let lt;for(ct=0,Ft=xt.length;ct<Ft;ct+=1){let yt=xt[ct],[Lt,Rt]=yt.pos()||[],{plotHigh:kt}=yt;if(en(Lt)&&en(Rt)){let bt={plotX:Lt,plotY:Rt,chartX:Je+Lt,chartY:ot+Rt};if(ht&&(kt&&(bt.plotY=kt,bt.chartY=ot+kt),Be?bt.chartCenterX=Je+Gi-((kt||yt.plotY||0)+zt(yt.yBottom,je))/2:bt.chartCenterY=ot+((kt||Rt)+zt(yt.yBottom,je))/2),lt&&(Bt=Math.max(Math.abs(bt.chartX-lt.chartX),Math.abs(bt.chartY-lt.chartY)))>16&&Bt<999)for(ft=1,St=Math.ceil(Bt/16);ft<St;ft+=1)ai({chartX:lt.chartX+(bt.chartX-lt.chartX)*(ft/St),chartY:lt.chartY+(bt.chartY-lt.chartY)*(ft/St),[Xt]:(lt[Xt]||0)+((bt[Xt]||0)-(lt[Xt]||0))*(ft/St),plotX:(lt.plotX||0)+(Lt-(lt.plotX||0))*(ft/St),plotY:(lt.plotY||0)+(Rt-(lt.plotY||0))*(ft/St)});ai(bt),lt=bt}}}return Kt})(ee),Ge.push(...Le.boxesToAvoid||[])}),he.series.forEach(function(ee){let Le=ee.options.label;if(!Le||!ee.xAxis&&!ee.yAxis)return;let Ke="highcharts-color-"+zt(ee.colorIndex,"none"),ct=!ee.labelBySeries,Bt=Le.minFontSize,Ft=Le.maxFontSize,St=he.inverted,ft=St?ee.yAxis.pos:ee.xAxis.pos,xt=St?ee.xAxis.pos:ee.yAxis.pos,Kt=he.inverted?ee.yAxis.len:ee.xAxis.len,It=he.inverted?ee.xAxis.len:ee.yAxis.len,$e=ee.interpolatedPoints,Be=zt(Le.onArea,!!ee.area),ut=[],Re=ee.getColumn("x"),Je,ot,wt,Gi,ht,je,Tt=ee.labelBySeries,Xt,ai,lt;function yt(Qt,Wt,Yt){let tn=Math.max(ft,zt(ai,-1/0)),si=Math.min(ft+Kt,zt(lt,1/0));return Qt>tn&&Qt<=si-Yt.width&&Wt>=xt&&Wt<=xt+It-Yt.height}function Lt(){Tt&&(ee.labelBySeries=Tt.destroy())}if(Be&&!St&&(Xt=[ee.xAxis.toPixels(Re[0]),ee.xAxis.toPixels(Re[Re.length-1])],ai=Math.min.apply(Math,Xt),lt=Math.max.apply(Math,Xt)),ee.visible&&!ee.boosted&&$e){if(!Tt){var Rt,kt,bt;let Qt=ee.name;if(typeof Le.format=="string"?Qt=Vl(Le.format,ee,he):Le.formatter&&(Qt=Le.formatter.call(ee)),ee.labelBySeries=Tt=he.renderer.label(Qt,0,0,"connector",0,0,Le.useHTML).addClass("highcharts-series-label highcharts-series-label-"+ee.index+" "+(ee.options.className||"")+" "+Ke),!he.renderer.styledMode){let Wt=typeof ee.color=="string"?ee.color:"#666666";Tt.css(bo({color:Be?he.renderer.getContrast(Wt):Wt},Le.style||{})),Tt.attr({opacity:+!!he.renderer.forExport,stroke:ee.color,"stroke-width":1})}Bt&&Ft&&Tt.css({fontSize:(Rt=ee,kt=Bt,bt=Ft,kt+(Rt.sum||0)/(Rt.chart.labelSeriesMaxSum||0)*(bt-kt)+"px")}),Tt.attr({padding:0,zIndex:3}).add()}for((Je=Tt.getBBox()).width=Math.round(Je.width),ht=$e.length-1;ht>0;ht-=1)Be?yt(ot=($e[ht].chartCenterX??$e[ht].chartX)-Je.width/2,wt=($e[ht].chartCenterY??$e[ht].chartY)-Je.height/2,Je)&&(je=mi(ee,ot,wt,Je)):(yt(ot=$e[ht].chartX+3,wt=$e[ht].chartY-Je.height-3,Je)&&(je=mi(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX+3,wt=$e[ht].chartY+3,Je)&&(je=mi(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX-Je.width-3,wt=$e[ht].chartY+3,Je)&&(je=mi(ee,ot,wt,Je,!0)),je&&ut.push(je),yt(ot=$e[ht].chartX-Je.width-3,wt=$e[ht].chartY-Je.height-3,Je)&&(je=mi(ee,ot,wt,Je,!0))),je&&ut.push(je);if(Le.connectorAllowed&&!ut.length&&!Be)for(ot=ft+Kt-Je.width;ot>=ft;ot-=16)for(wt=xt;wt<xt+It-Je.height;wt+=16)(Gi=mi(ee,ot,wt,Je,!0))&&ut.push(Gi);if(ut.length){ut.sort((Wt,Yt)=>Yt.weight-Wt.weight),je=ut[0],(he.boxesToAvoid||[]).push({left:je.x,right:je.x+Je.width,top:je.y,bottom:je.y+Je.height});let Qt=Math.sqrt(Math.pow(Math.abs(je.x-(Tt.x||0)),2)+Math.pow(Math.abs(je.y-(Tt.y||0)),2));if(Qt&&ee.labelBySeries){let Wt,Yt={opacity:+!!he.renderer.forExport,x:je.x,y:je.y},tn={opacity:1};Qt<=10&&(tn={x:Yt.x,y:Yt.y},Yt={}),ct&&(Wt=co(ee.options.animation),Wt.duration*=.2),ee.labelBySeries.attr(bo(Yt,{anchorX:je.connectorPoint&&(je.connectorPoint.plotX||0)+ft,anchorY:je.connectorPoint&&(je.connectorPoint.plotY||0)+xt})).animate(tn,Wt),ee.options.kdNow=!0,ee.buildKDTree();let si=ee.searchPoint({chartX:je.x,chartY:je.y},!0);si&&(Tt.closest=[si,je.x-(si.plotX||0),je.y-(si.plotY||0)])}}else Lt()}else Lt()}),Rl(he,"afterDrawSeriesLabels")})(ae)},ae.renderer.forExport||!Ve?0:Ve)}}function Nl(ye,ae,Ve,he,at){let Ge=at&&at.anchorX,ee=at&&at.anchorY,Le,Ke,ct=Ve/2;return en(Ge)&&en(ee)&&(Le=[["M",Ge,ee]],(Ke=ae-ee)<0&&(Ke=-he-Ke),Ke<Ve&&(ct=Ge<ye+Ve/2?Ke:Ve-Ke),ee>ae+he?Le.push(["L",ye+ct,ae+he]):ee<ae?Le.push(["L",ye+ct,ae]):Ge<ye?Le.push(["L",ye,ae+he/2]):Ge>ye+Ve&&Le.push(["L",ye+Ve,ae+he/2])),Le||[]}let Mo=T();({compose:function(ye,ae){kl(Ol,"SeriesLabel")&&(Io(ye,"load",Eo),Io(ye,"redraw",Eo),ae.prototype.symbols.connector=Nl,Bl({plotOptions:{series:{label:Ai}}}))}}).compose(Mo.Chart,Mo.SVGRenderer);let Al=T();return l.default})())});var Hl=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Qr=i=>({ID:i});function Ql(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Yl(i,s){if(i&1&&(n(0,"div",2),S(1,Ql,3,0,"button",3),a()),i&2){let e=m();o(),y(e.roleService.global.Export?1:-1)}}function jl(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",10)(11,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(15,"h6"),p(16,"Customer Group"),a(),n(17,"ng-select",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(18,"h6"),p(19,"Bin"),a(),n(20,"radio-options",14),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Bin,t)||(l.pageData.Filter.Bin=t),_(t)}),a(),n(21,"h6"),p(22,"Sales Order Tag"),a(),n(23,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(24,"h6"),p(25,"Currency"),a(),n(26,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(27,"h6"),p(28,"Fulfillment"),a(),n(29,"ng-select",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DeliveryStateID,t)||(l.pageData.Filter.DeliveryStateID=t),_(t)}),a(),n(30,"h6"),p(31,"Payment"),a(),n(32,"ng-select",18),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.PaymentStateID,t)||(l.pageData.Filter.PaymentStateID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(33,"h6"),p(34,"Creator"),a(),n(35,"autocompleteV2",19),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(36,"h6"),p(37,"Note Visible"),a(),n(38,"radio-options",20),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(39,"h6"),p(40," Query Option "),b(41,"i",21),a(),n(42,"ng-select",22),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a(),n(43,"h6"),p(44,"Order By"),a(),n(45,"radio-options",23),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),c("items",e.pageData.Options.ContactGroups),C("ngModel",e.pageData.Filter.ContactGroupID),o(3),C("model",e.pageData.Filter.Bin),o(3),c("items",e.pageData.Options.Types),C("ngModel",e.pageData.Filter.TypeID),o(3),c("items",e.pageData.Options.Currencies),C("ngModel",e.pageData.Filter.CurrencyID),o(3),c("items",e.pageData.Options.Deliveries),C("ngModel",e.pageData.Filter.DeliveryStateID),o(3),C("ngModel",e.pageData.Filter.PaymentStateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),C("ngModel",e.pageData.Filter.CreatorID),c("renderThumbnail",!1),o(3),C("model",e.pageData.Filter.NoteVisible),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),C("ngModel",e.pageData.Filter.QueryOption),o(3),C("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function ql(i,s){i&1&&(n(0,"th",32),p(1," @ Cost "),a())}function Ul(i,s){if(i&1&&(n(0,"small",46),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.CustomerNameDisplay," - {0}"))}}function zl(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"showIfNotNullOrEmptyString"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.SalesName," - Sales: {0}"))}}function Kl(i,s){if(i&1&&(n(0,"span",46),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" "," - Profit: "+g(2,1,e.Profit)," ")}}function Xl(i,s){if(i&1&&(n(0,"i",49),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryOutlet==null?"":": Delivered from "+e.DeliveryOutlet," ")}}function Jl(i,s){if(i&1&&(n(0,"span",50),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PromotionCoupon==null?"":": "+e.PromotionCoupon," ")}}function Zl(i,s){i&1&&(n(0,"span"),p(1,"-"),a())}function $l(i,s){if(i&1&&(b(0,"div",51),d(1,"newlines")),i&2){let e=m().$implicit;c("innerHTML",g(1,1,e.SONote),Ee)}}function ep(i,s){if(i&1&&(n(0,"div")(1,"a",57),p(2),a()()),i&2){let e=m().$implicit;o(),c("queryParams",X(2,Qr,e.ReferenceInvoiceID)),o(),D(" Return ",e.ReferenceInvoiceNumber," ")}}function tp(i,s){if(i&1&&(n(0,"i",60),p(1),a()),i&2){let e=m().$implicit;o(),D(" sold by ",e.Commissions.SalesName," ")}}function ip(i,s){if(i&1&&(n(0,"th",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitCost)," ")}}function np(i,s){if(i&1&&(n(0,"tr",55)(1,"th",28)(2,"div",58)(3,"span",59),p(4),a(),S(5,tp,2,1,"i",60),b(6,"small",61),a()(),n(7,"th",62),p(8),a(),n(9,"th",63),p(10),d(11,"quantityFraction"),a(),n(12,"th",64),p(13),a(),S(14,ip,3,3,"th",65),n(15,"th",66),p(16),d(17,"amountFraction"),a(),n(18,"th",67)(19,"div",68),p(20),a(),n(21,"div",69),p(22),d(23,"amountFraction"),a()(),n(24,"th",66),p(25),d(26,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),y((e==null?null:e.Commissions.Quantity)!=0&&e.Commissions.SalesName?5:-1),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(11,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?14:-1),o(2),D(" ",g(17,13,e==null?null:e.UnitPrice)," "),o(4),D(" ",(e==null?null:e.Discount)==0?"":(e==null?null:e.Discount)+"%"," "),o(2),D(" ",(e==null?null:e.DiscountAmount)==0?"":g(23,15,e==null?null:e.DiscountAmount)," "),o(3),D(" ",g(26,17,e==null?null:e.Total)," ")}}function ap(i,s){if(i&1&&(n(0,"tr")(1,"th",70),p(2),a(),n(3,"th",71),p(4),a(),n(5,"th",72),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e.CurrencySymbol," "),o(2),D(" ",g(7,3,e.Amount)," ")}}function op(i,s){if(i&1&&(n(0,"div")(1,"div",41)(2,"div",42)(3,"div")(4,"a",43)(5,"span",44),p(6),a()(),n(7,"span"),p(8),d(9,"date"),b(10,"small",45),d(11,"date"),S(12,Ul,3,4,"small",46),a()(),n(13,"div",47)(14,"strong",48),p(15),S(16,zl,3,4,"span"),a(),S(17,Kl,3,3,"span",46),S(18,Xl,2,1,"i",49),S(19,Jl,2,1,"span",50),S(20,Zl,2,0,"span"),a(),S(21,$l,2,3,"div",51),S(22,ep,3,4,"div"),a(),n(23,"div",52),p(24),a()(),n(25,"table",53)(26,"tbody",54),G(27,np,27,19,"tr",55,Y),a()(),n(29,"table",56),G(30,ap,8,5,"tr",null,Y),a()()),i&2){let e=s.$implicit,r=m(2);o(4),c("routerLink",M(21,Hl))("queryParams",X(22,Qr,e.ID)),o(2),D(" ",e.EntityName+" # "+e.Number),o(2),D(" "," - "+v(9,15,e.Date,"dd MMM yyyy")," "),o(2),c("innerHtml","("+v(11,18,e.Created,"HH:mm")+(e.Order!=null&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",Ee),o(2),y(r.isNotEmpty(e.CustomerNameDisplay)?12:-1),o(3),D(" ","[Q: "+e.TotalItemQuantity+"]"," "),o(),y(r.isNotEmpty(e.SalesName)?16:-1),o(),y(r.roleService.report.Profit?17:-1),o(),y(r.isNotEmpty(e.DeliveryOutlet)?18:-1),o(),y(r.isNotEmpty(e.PromotionCoupon)?19:-1),o(),y(e.SONote&&e.PromotionCoupon?20:-1),o(),y(r.isNotEmpty(e.SONote)?21:-1),o(),y(r.isNotEmpty(e.ReferenceInvoiceID)?22:-1),o(2),D(" ",e.PaymentStateLabel," "),o(3),H(e.Items),o(3),H(e.Aggregate)}}function rp(i,s){if(i&1){let e=I();n(0,"span",73),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),n(1,"i",74),p(2,"?"),a()()}}function lp(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function pp(i,s){if(i&1){let e=I();n(0,"div",2)(1,"a",75),P("click",function(){u(e);let t=m(2);return t.currentRowCount=100,_(t.NextPage(!0))}),b(2,"i",76),p(3," Next 100"),a()()}}function mp(i,s){if(i&1){let e=I();n(0,"content")(1,"div",24)(2,"div",25)(3,"table",26)(4,"thead",27)(5,"tr")(6,"th",28),p(7,"Name"),a(),n(8,"th",29),p(9,"Code"),a(),n(10,"th",30),p(11,"Qty"),a(),n(12,"th",31),p(13,"UOM"),a(),S(14,ql,2,0,"th",32),n(15,"th",33),p(16,"@ Price"),a(),n(17,"th",30),p(18,"Disc."),a(),n(19,"th",33),p(20,"Total"),a()()(),n(21,"tbody")(22,"tr")(23,"td",34),G(24,op,32,24,"div",null,Y),a()()()()(),n(26,"div",35)(27,"button",36),P("click",function(){u(e);let t=m();return _(t.showSummaryReport())}),p(28," View Report Summary "),a()(),n(29,"div",37)(30,"div",38)(31,"div",39),p(32),d(33,"number"),S(34,rp,3,0,"span",40),S(35,lp,3,3,"span"),p(36),a()(),S(37,pp,4,0,"div",2),a()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(9),li("colspan",e.roleService.product.Cost?8:7),o(),H(e.infiniteList),o(8),D(" Showing 1 - ",g(33,7,e.infiniteList.length)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:34),o(),y(e.pageData.HideStoreApiCount?35:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),y(e.nextPageDisabled?37:-1)}}var Hn=class i extends De{constructor(e,r,t,l,h,T,Ze,Ni){super(e,r,"Report/ReportDetail","ReportLoader/ReportDetail",null,h);this.csvConverter=t;this.datePipe=l;this.activatedRoute=h;this.matDialog=T;this.toaster=Ze;this.roleService=Ni}SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];currentRowCount;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true",this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter([]))}preInitList(){this.currentRowCount=this.pageData.Filter.RowCount,V.IsEmpty(this.route.snapshot.queryParams.ListIDs)&&(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)),V.IsEmpty(this.route.snapshot.queryParams.From)&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),V.IsEmpty(this.route.snapshot.queryParams.To)&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}afterPostInit(e){this.nextPageDisabled=e.NextPage}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}isNotEmpty(e){return V.IsNotEmpty(e)}openExportModal(){let e=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To),r=[this.roleService.contact.View,this.roleService.report.Advanced,this.roleService.payment.View],t=[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+e,Tooltip:"Export with Default Columns"},{ID:"ReportExport/ReportDetailWithContact",Value:"With Customer Information",FileName:"Sales Transaction with Contact"+e,Tooltip:"Default Columns + Customer Details",Roles:[this.roleService.contact.View]},{ID:"ReportExport/ReportDetailComplete",Value:"With Complete Detail",FileName:"Sales Complete Transaction"+e,Tooltip:"File with Most Columns",Roles:[this.roleService.report.Advanced]},{ID:"ReportExport/ReportDetailWithPaymentMethod",Value:"With Payment Method",FileName:"Sales Complete Transaction"+e,Tooltip:"Default Columns + Payment Method",Roles:[this.roleService.payment.View]}].filter(l=>l.Roles?l.Roles.every(h=>h):!0);if(t.length===0){this.toaster.warning("You do not have permission to export any reports.","Permission Denied");return}this.matDialog.open(K,{data:{title:"Sales by Transaction",exportTypes:t,filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}showSummaryReport(){this.matDialog.open(Wr,{data:this.pageData})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(Ne),w(z),w(qe),w(j))};static \u0275cmp=B({type:i,selectors:[["POS-sales-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["name","Bin",3,"modelChange","model"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Fulfillment",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetUserSuggestion","placeholder","Search User/Creator",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","NoteVisible",3,"modelChange","model"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[1,"text-center"],["role","button",1,"btn","btn-outline-primary",3,"click"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],[1,"fw-bold"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table","table-sm","table-borderless"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"lh-base"],[1,"fw-normal"],[1,"text-warning","inlineMarginLeft"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %",1,"text-danger"],["matTooltipPosition","above","matTooltip","Disc Amount",1,"text-danger"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Yl,2,1,"div",2),a(),n(3,"filters"),E(4,jl,46,26,"ng-template",null,0,O),a(),S(6,mp,38,9,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,ie,Te,Ae,U,ze,gr,On,re,oe,Z,ne],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{line-height:13px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:20px!important}@media (max-width: 992px){.aggregate-detail[_ngcontent-%COMP%]{overflow-x:scroll;overflow-y:hidden;width:100%}div.zebra[_ngcontent-%COMP%] > div[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{height:40px}}"]})};var Qn=class i{constructor(s,e){this._dialogRef=s;this.data=e;this.ExportPageNumber=e.ExportPageNumber,this.ExportRowCount=e.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}modalConfig=new Vn;ExportPageNumber;ExportRowCount;ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}static \u0275fac=function(e){return new(e||i)(w(wi),w(Ti))};static \u0275cmp=B({type:i,selectors:[["modal-export-summary"]],standalone:!1,decls:11,vars:5,consts:[[3,"onOk","onCancel","onClose","title","config"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r._dialogRef.close()})("onClose",function(){return r._dialogRef.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"label"),p(5,"Page Number"),a(),n(6,"input",3),x("ngModelChange",function(l){return f(r.ExportPageNumber,l)||(r.ExportPageNumber=l),l}),a()(),n(7,"div",2)(8,"label"),p(9,"Page Size"),a(),n(10,"input",4),x("ngModelChange",function(l){return f(r.ExportRowCount,l)||(r.ExportRowCount=l),l}),a()()()()()),e&2&&(c("title","Export Report")("config",r.modalConfig),o(6),C("ngModel",r.ExportPageNumber),o(4),C("ngModel",r.ExportRowCount),c("max",1e4))},dependencies:[Qe,L,R,Ue,Pi],encapsulation:2})};var cp=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],jr=i=>({ID:i}),dp=()=>["/menu/Contacts/Contact/Customers/Info"],up=(i,s,e)=>({"text-success":i,"text-warning":s,"text-danger":e});function _p(i,s){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function gp(i,s){if(i&1){let e=I();pt(0),n(1,"div",19)(2,"div",20)(3,"datepicker",21),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a()(),n(4,"div",22)(5,"app-timepicker",23),x("timeChange",function(t){u(e);let l=m(2);return f(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=m(2);return _(l.timeFromChange(t))}),a()()(),n(6,"div",24)(7,"div",20)(8,"datepicker",25),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a()(),n(9,"div",22)(10,"app-timepicker",23),x("timeChange",function(t){u(e);let l=m(2);return f(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=m(2);return _(l.timeToChange(t))}),a()()(),mt()}if(i&2){let e=m(2);o(3),C("date",e.pageData.Filter.From),o(2),C("time",e.timeFrom),o(3),C("date",e.pageData.Filter.To),o(2),C("time",e.timeTo)}}function Cp(i,s){if(i&1){let e=I();n(0,"datepicker",26),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterFromDate())}),a(),n(1,"div",27)(2,"datepicker",28),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(2);return _(t.onFilterToDate())}),a()()}if(i&2){let e=m(2);C("date",e.pageData.Filter.From),c("appearance","outline")("width",100),o(2),C("date",e.pageData.Filter.To),c("appearance","outline")("width",100)}}function fp(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",9),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),E(18,gp,11,4,"ng-container",13)(19,Cp,3,6,"ng-template",null,1,O),n(21,"h6"),p(22,"Register"),a(),n(23,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerGroupID,t)||(l.pageData.Filter.CustomerGroupID=t),_(t)}),a(),n(27,"h6"),p(28,"Payment"),a(),n(29,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.PaymentState,t)||(l.pageData.Filter.PaymentState=t),_(t)}),a(),n(30,"h6"),p(31,"Creator"),a(),n(32,"autocompleteV2",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CreatorID,t)||(l.pageData.Filter.CreatorID=t),_(t)}),a(),n(33,"h6"),p(34,"RowCount"),a(),n(35,"input",18),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=Dt(20),r=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",r.pageData.Filter.ListIDs),c("outlets",r.pageData.Options==null?null:r.pageData.Options.Entities),o(3),C("ngModel",r.pageData.Filter.CustomerID),c("inputTextValue",r.pageData.CustomerName),o(3),C("ngModel",r.pageData.Filter.SalesID),o(3),C("ngModel",r.pageData.Filter.SalesOrderTagID),c("items",r.pageData.Options.SalesOrderTags),o(3),c("options",r.pageData.Options.DefaultFilterColumnOptions),C("model",r.pageData.Filter.DefaultFilterColumn),o(3),c("ngIf",r.pageData.Filter.isCreated)("ngIfElse",e),o(5),C("ngModel",r.pageData.Filter.RegisterID),c("items",r.pageData.Options.Registers),o(3),C("ngModel",r.pageData.Filter.CustomerGroupID),c("items",r.pageData.Options.Groups),o(3),C("ngModel",r.pageData.Filter.PaymentState),c("items",r.pageData.Options.States),o(3),C("ngModel",r.pageData.Filter.CreatorID),o(3),c("max",1e4),C("ngModel",r.pageData.Filter.RowCount)}}function xp(i,s){i&1&&(n(0,"th",57),p(1,"DATE"),a())}function hp(i,s){i&1&&(n(0,"th",58),p(1," CUSTOMER "),a())}function Sp(i,s){i&1&&(n(0,"th",45),p(1,"JOIN DATE"),a())}function yp(i,s){i&1&&(n(0,"th",46),p(1,"GROUPS"),a())}function Dp(i,s){i&1&&(n(0,"th",59),p(1," SALES PERSON "),a())}function vp(i,s){i&1&&(n(0,"th",60),p(1," COST "),a())}function wp(i,s){i&1&&(n(0,"th",61),p(1," GROSS "),a())}function Tp(i,s){i&1&&(n(0,"th",62),p(1," SALES "),a())}function Pp(i,s){i&1&&(n(0,"th",63),p(1," TAX "),a())}function Fp(i,s){i&1&&(n(0,"th",64),p(1," SURCHARGE "),a())}function Ip(i,s){i&1&&(n(0,"th",65),p(1," TOTAL "),a())}function bp(i,s){i&1&&(n(0,"th",66),p(1," PAYMENT "),a())}function Ep(i,s){i&1&&b(0,"br")}function Mp(i,s){if(i&1&&(n(0,"i"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Note)}}function Vp(i,s){if(i&1&&(n(0,"td")(1,"div"),p(2),d(3,"date"),a(),n(4,"div"),p(5),d(6,"date"),a()()),i&2){let e=m().$implicit;o(2),D(" ",v(3,2,e.Date,"dd MMM yy")," "),o(3),D(" ",v(6,5,e.Created,"HH:mm")," ")}}function Bp(i,s){if(i&1&&(n(0,"td")(1,"a",72),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,dp))("queryParams",X(4,jr,e.CustomerID)),o(),F(e.CustomerName)}}function Op(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.JoinDate!=="0001-01-01T00:00:00"?v(2,1,e.JoinDate,"dd MMM yy"):""," ")}}function Lp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.Groups," ")}}function Rp(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.SalesName," ")}}function kp(i,s){if(i&1&&(n(0,"td",73),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Wp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function Np(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Ap(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Gp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SurchargeAmount)," ")}}function Hp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNSurcharge)," ")}}function Qp(i,s){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=m().$implicit;c("ngClass",_t(2,up,e.PaymentStateID==3,e.PaymentStateID==2,e.PaymentStateID==1)),o(),D(" ",e.PaymentStateString," ")}}function Yp(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",67),p(5),a(),E(6,Ep,1,0,"br",4)(7,Mp,2,1,"i",4),a(),E(8,Vp,7,8,"td",4)(9,Bp,3,6,"td",4),S(10,Op,3,4,"td"),S(11,Lp,2,1,"td"),E(12,Rp,2,1,"td",4)(13,kp,3,3,"td",68)(14,Wp,3,3,"td",69)(15,Np,3,3,"td",69)(16,Ap,3,3,"td",70)(17,Gp,3,3,"td",69)(18,Hp,3,3,"td",69)(19,Qp,2,6,"td",71),a()),i&2){let e=s.$implicit,r=m(3);o(2),F(e.EntityName),o(2),c("routerLink",M(18,cp))("queryParams",X(19,jr,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",e.Note),o(),c("ngIf",e.Note),o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Customer.selected),o(),y(r.column.JoinDate.selected?10:-1),o(),y(r.column.Groups.selected?11:-1),o(),c("ngIf",r.column.SalesPerson.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.column.Gross.selected),o(),c("ngIf",r.column.Sales.selected),o(),c("ngIf",r.data.TaxVisible&&r.column.Tax.selected),o(),c("ngIf",r.data.SurchargeVisible),o(),c("ngIf",r.column.Total.selected),o(),c("ngIf",r.column.Payment.selected)}}function jp(i,s){i&1&&b(0,"td",79)}function qp(i,s){i&1&&b(0,"td",79)}function Up(i,s){i&1&&b(0,"td",79)}function zp(i,s){i&1&&(n(0,"td",82),p(1," Total: "),a())}function Kp(i,s){if(i&1&&(n(0,"td",73),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Cost"))," ")}}function Xp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function Jp(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function Zp(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function $p(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SurchargeAmount"))," ")}}function em(i,s){if(i&1&&(n(0,"td",74),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(4);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"SalesNSurcharge"))," ")}}function tm(i,s){if(i&1&&(n(0,"tfoot",77)(1,"tr",78),b(2,"td",79),E(3,jp,1,0,"td",80)(4,qp,1,0,"td",80)(5,Up,1,0,"td",80)(6,zp,2,0,"td",81)(7,Kp,4,6,"td",68)(8,Xp,4,6,"td",69)(9,Jp,4,6,"td",69)(10,Zp,4,6,"td",70)(11,$p,4,6,"td",69)(12,em,4,6,"td",69),a()()),i&2){let e=m(3);o(3),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Gross.selected||e.column.Cost.selected||e.column.Sales.selected||e.column.Tax.selected||e.column.Total.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected)}}function im(i,s){if(i&1){let e=I();n(0,"div",38)(1,"table",39),P("matSortChange",function(t){u(e);let l=m(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(),E(8,xp,2,0,"th",43)(9,hp,2,0,"th",44),S(10,Sp,2,0,"th",45),S(11,yp,2,0,"th",46),E(12,Dp,2,0,"th",47)(13,vp,2,0,"th",48)(14,wp,2,0,"th",49)(15,Tp,2,0,"th",50)(16,Pp,2,0,"th",51)(17,Fp,2,0,"th",52)(18,Ip,2,0,"th",53)(19,bp,2,0,"th",54),a()(),n(20,"tbody"),E(21,Yp,20,21,"tr",55),a(),E(22,tm,13,10,"tfoot",56),a()()}if(i&2){let e=m(2);o(8),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Customer.selected),o(),y(e.column.JoinDate.selected?10:-1),o(),y(e.column.Groups.selected?11:-1),o(),c("ngIf",e.column.SalesPerson.selected),o(),c("ngIf",e.column.Cost.role&&e.column.Cost.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.data.TaxVisible&&e.column.Tax.selected),o(),c("ngIf",e.data.SurchargeVisible),o(),c("ngIf",e.column.Total.selected),o(),c("ngIf",e.column.Payment.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data)}}function nm(i,s){if(i&1){let e=I();n(0,"span",83),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),n(1,"i",84),p(2,"?"),a()()}}function am(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function om(i,s){if(i&1){let e=I();n(0,"a",85),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",86),p(2," Next"),a()}}function rm(i,s){if(i&1){let e=I();n(0,"a",87),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),b(1,"i",88),p(2," Show All"),a()}}function lm(i,s){if(i&1&&(n(0,"content")(1,"div",29),E(2,im,23,14,"div",30),n(3,"div",31)(4,"div",32)(5,"div",33),p(6),d(7,"number"),E(8,nm,3,0,"span",34)(9,am,3,3,"span",4),p(10),a()(),n(11,"div",35),E(12,om,3,0,"a",36)(13,rm,3,0,"a",37),a()()()()),i&2){let e=m();o(2),c("ngIf",e.data),o(4),D(" Showing 1 - ",g(7,7,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Yn=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/ReportSummary","ReportLoader/ReportSummary",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this._matDialog=h}roleService=Pe(j);columnService=Pe(gt);column={Date:{selected:!0,name:"Date"},Customer:{selected:!0,name:"Customer"},JoinDate:{selected:!1,name:"Join Date",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"JoinDate"},Groups:{selected:!1,name:"Customer Groups",advanced:!0,endpoint:"/api/Report/ReportSummaryContactJoinDate",responseProperty:"Groups"},SalesPerson:{selected:!0,name:"Sales Person"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",advanced:!0,endpoint:"/api/Report/ReportSummaryGross",responseProperty:"Gross"},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},Total:{selected:!0,name:"Total"},Payment:{selected:!0,name:"Payment"}};timeTo;timeFrom;preInitLoader(){let e=this.route.snapshot.queryParamMap.get("ListIDs"),r=this.route.snapshot.queryParamMap.get("From"),t=this.route.snapshot.queryParamMap.get("To");e&&(this.loaderPayload={ListIDs:e.split(","),From:r,To:t})}checkForAdvancedColumn(){if(!this.infiniteList||this.infiniteList.length===0)return;let e=this.pageData.Filter;(this.column.JoinDate.selected||this.column.Groups.selected)&&(e.CustomerIDs=this.infiniteList?.filter(r=>V.IsNotEmpty(r.CustomerID))?.map(r=>r.CustomerID)),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,e,"ID",r=>this.mappingDataOnAdvancedColumn(r))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList?.map(r=>{let t=e.find(l=>l.ContactID===r.CustomerID);return t&&(r.JoinDate=t.JoinDate,r.Groups=t?.Groups?.map(l=>l?.GroupName)?.join(", ")),r}))}preInitList(){this.handlingQueryParams()}afterPostInit(e){super.afterPostInit(e),this.checkForAdvancedColumn()}openItemModal(e,r){this._matDialog.open(Qn,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(l=>{l&&(this.pageData.Filter.ExportPageNumber=l.ExportPageNumber,this.pageData.Filter.ExportRowCount=l.ExportRowCount,this.exportCSV(this.csvConverter,e,r),this.pageData.Filter.RowCount=0)})}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let h=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(),h);case"number":return this.compare(t.Number,l.Number,h);case"date":return this.compare(t.Date,l.Date,h);case"customer":return this.compare(t.CustomerName?.toLowerCase(),l.CustomerName?.toLowerCase(),h);case"salesPerson":return this.compare(t.SalesName?.toLowerCase(),l.SalesName?.toLowerCase(),h);case"cost":return this.compare(t.Cost,l.Cost,h);case"gross":return this.compare(t.Gross,l.Gross,h);case"sales":return this.compare(t.Sales,l.Sales,h);case"tax":return this.compare(t.Tax,l.Tax,h);case"surcharge":return this.compare(t.SurchargeAmount,l.SurchargeAmount,h);case"total":return this.compare(t.SalesNSurcharge,l.SalesNSurcharge,h);case"payment":return this.compare(t.PaymentStateString,l.PaymentStateString,h);case"joinDate":return this.compare(t.JoinDate,l.JoinDate,h);case"groups":return this.compare(t.Groups,l.Groups,h);default:return 0}})}openExportModal(){this._matDialog.open(K,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Selected Payment",FileName:"Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"All Payment Method Columns",FileName:"Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Quantity & Gross Sales",FileName:"Summary with Taxable & TaxExempt"},{ID:"ReportExport/ReportSummaryWithContactDetail",Value:"Customer Details",FileName:"Summary with Customer Details"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;e.EntityID||(this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs));let r=this.route.snapshot.queryParamMap.get("CustomerID");V.IsNotEmpty(r)&&(this.pageData.Filter.From=V.MinDate,this.pageData.Filter.To=V.MinDate),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-sales-summary"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],["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=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,_p,3,0,"button",3),a(),n(3,"filters"),E(4,fp,36,22,"ng-template",null,0,O),a(),E(6,lm,14,9,"content",4),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,Qe,L,R,ie,pe,ge,Ue,Te,Ae,Mi,U,ze,se,re,oe,Z],encapsulation:2})};var pm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],mm=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"],sm=()=>["/menu/Products/Setup/Brand/Brand_Form"],cm=i=>({ID:i}),dm=(i,s)=>({BrandID:i,Name:s});function um(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export"),a()}}function _m(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",12),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(7,"div",13)(8,"datepicker",14),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function gm(i,s){i&1&&(n(0,"th",18),p(1,"Code"),a())}function Cm(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function fm(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",22),p(3),a()(),S(4,Cm,2,1,"td"),n(5,"td",23)(6,"a",24),p(7),d(8,"quantityFraction"),a()(),n(9,"td",23),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(11,sm))("queryParams",X(12,cm,e.ID)),o(),D("",e.BrandName," "),o(),y(e.Countcode>0?4:-1),o(2),c("queryParams",fe(14,dm,e.ID,e.BrandName)),o(),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.Total))}}function xm(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",15),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",16)(3,"tr")(4,"th",17),p(5,"Brand"),a(),S(6,gm,2,0,"th",18),n(7,"th",19),p(8,"Sold"),a(),n(9,"th",20),p(10,"Total"),a()()(),n(11,"tbody"),G(12,fm,12,17,"tr",null,Y),a(),n(14,"tfoot")(15,"tr",21)(16,"td"),p(17,"Total"),a(),n(18,"td"),p(19),d(20,"sum"),d(21,"quantityFraction"),a(),n(22,"td"),p(23),d(24,"sum"),d(25,"amountFraction"),a()()()()()}if(i&2){let e=m();o(6),y(e.data.Countcode>0?6:-1),o(6),H(e.data.Data),o(7),F(g(21,6,v(20,3,e.data.Data,"Quantity"))),o(4),F(g(25,11,v(24,8,e.data.Data,"Total")))}}var jn=class i extends De{constructor(e,r,t,l,h,T){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,l);this.httpService=r;this.csvConverter=t;this.roleService=h;this.matDialog=T}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Brand":return this.compare(t.BrandName,l.BrandName,h);case"Code":return this.compare(t.Code,l.Code,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Total":return this.compare(t.Total,l.Total,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Brand"]],standalone:!1,features:[W],decls:18,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before","matTooltip","Gross Sales",1,"flex-right",2,"width","120px"],[1,"footer","text-end","fw-bold"],[3,"routerLink","queryParams"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,um,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Pie Chart "),a()(),n(10,"li")(11,"a",6),p(12," Brand Sales Analysis "),a()()()()(),n(13,"filters"),E(14,_m,9,6,"ng-template",null,0,O),a(),n(16,"content"),S(17,xm,26,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,pm)),o(3),c("routerLink",M(9,mm)),o(6),y(t.data?17:-1))},dependencies:[A,Q,J,L,R,ie,pe,ge,U,se,Z,ne],encapsulation:2})};function hm(i,s){if(i&1){let e=I();n(0,"label",2),P("click",function(){let t=u(e).$implicit,l=m();return _(l.updateSelectedGroups(t.ID))}),b(1,"input",3),n(2,"span"),p(3),a()()}if(i&2){let e=s.$implicit,r=m();o(),c("value",e.ID)("checked",r.IDGroups.indexOf(e.ID)>-1),o(2),F(e.Name)}}var qn=class i{constructor(s,e){this.dialogRef=s;this.data=e;this.options=e.options,this.model=e.model,this.model.forEach(r=>{this.IDGroups.push(r.GroupID)})}options;model;IDGroups=[];ngOnInit(){}updateSelectedGroups(s){let e=this.IDGroups.indexOf(s);e>-1?this.IDGroups.splice(e,1):this.IDGroups.push(s)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}static \u0275fac=function(e){return new(e||i)(w(wi),w(Ti))};static \u0275cmp=B({type:i,selectors:[["POS-modal-edit-group"]],standalone:!1,decls:5,vars:1,consts:[[3,"onOk","onCancel","title"],[1,"container-fluid","pt-6"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(e,r){e&1&&(n(0,"modal-material",0),P("onOk",function(){return r.onOk()})("onCancel",function(){return r.dialogRef.close()}),n(1,"content")(2,"div",1),G(3,hm,4,3,"label",null,Y),a()()()),e&2&&(c("title","Edit Groups"),o(3),H(r.options))},dependencies:[Pi],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})};var Sm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],ym=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Dm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],vm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],wm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],Tm=()=>["/menu/Contacts/Contact/Customers/Info"],Pm=i=>({ID:i});function Fm(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Im(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function bm(i,s){i&1&&(n(0,"th",22),p(1," ORDERS "),a())}function Em(i,s){i&1&&(n(0,"th",23),p(1," QTY "),a())}function Mm(i,s){i&1&&(n(0,"th",24),p(1," COST "),a())}function Vm(i,s){i&1&&(n(0,"th",25),p(1," SALES "),a())}function Bm(i,s){i&1&&(n(0,"th",26),p(1," TAX "),a())}function Om(i,s){i&1&&(n(0,"th",27),p(1," SALES + TAX "),a())}function Lm(i,s){if(i&1){let e=I();n(0,"span")(1,"span"),p(2),a(),n(3,"a",37),P("click",function(){u(e);let t=m(2).$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(4),a()()}if(i&2){let e=s.$implicit,r=s.$index;o(2),F(r==0?"":" , "),o(2),F(e.GroupName)}}function Rm(i,s){if(i&1&&(n(0,"span"),G(1,Lm,5,2,"span",null,Y),a()),i&2){let e=m().$implicit;o(),H(e.Groups)}}function km(i,s){if(i&1){let e=I();n(0,"a",37),P("click",function(){u(e);let t=m().$implicit,l=m(3);return _(l.showModalEditGroup(t.Groups,t.CustomerID))}),p(1," No group assigned "),a()}}function Wm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Orders)," ")}}function Nm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Am(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Gm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Hm(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Qm(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales+e.Tax)," ")}}function Ym(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",30),p(3),a(),n(4,"div",31),S(5,Rm,3,0,"span"),S(6,km,2,0,"a",32),a()(),n(7,"td")(8,"span",33),p(9),a()(),S(10,Wm,3,3,"td",34),S(11,Nm,3,3,"td",34),S(12,Am,3,3,"td",35),S(13,Gm,3,3,"td",34),S(14,Hm,3,3,"td",36),S(15,Qm,3,3,"td",34),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("routerLink",M(13,Tm))("queryParams",X(14,Pm,e.CustomerID)),o(),D(" ",e.Name+" "+(e.Title?e.Title:"")," "),o(2),y(e.Groups.length>0?5:-1),o(),y(e.Groups.length>0?-1:6),o(2),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),D("",e.Code," "),o(),y(r.column.Orders.selected?10:-1),o(),y(r.column.QTY.selected?11:-1),o(),y(r.roleService.product.Cost&&r.column.Cost.selected?12:-1),o(),y(r.column.Sales.selected?13:-1),o(),y(r.column.Tax.selected?14:-1),o(),y(r.column.SalesNTax.selected?15:-1)}}function jm(i,s){if(i&1&&(n(0,"tbody",28),G(1,Ym,16,16,"tr",null,Y),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function qm(i,s){if(i&1){let e=I();n(0,"div",7)(1,"div",17)(2,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",19)(4,"tr")(5,"th",20),p(6,"CUSTOMER"),a(),n(7,"th",21),p(8," CODE "),a(),S(9,bm,2,0,"th",22),S(10,Em,2,0,"th",23),S(11,Mm,2,0,"th",24),S(12,Vm,2,0,"th",25),S(13,Bm,2,0,"th",26),S(14,Om,2,0,"th",27),a()(),S(15,jm,3,0,"tbody",28),a()(),n(16,"infinite-pagination",29),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/CustomerRankCount",!0))}),a()()}if(i&2){let e=m();o(9),y(e.column.Orders.selected?9:-1),o(),y(e.column.QTY.selected?10:-1),o(),y(e.roleService.product.Cost&&e.column.Cost.selected?11:-1),o(),y(e.column.Sales.selected?12:-1),o(),y(e.column.Tax.selected?13:-1),o(),y(e.column.SalesNTax.selected?14:-1),o(),y(e.data.Data?15:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",!e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Un=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CustomerRank","ReportLoader/CustomerRank");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.matDialog=h}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0,name:"Orders"},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/API/Report/CustomerRankGetQuantity",responseProperty:"Quantity"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Sales:{selected:!0,name:"Sales"},Tax:{selected:!0,name:"Tax"},SalesNTax:{selected:!0,name:"Sales + Tax"}};customerRankQty$;showCustomerRankQty=!1;maskingFields;maskingFieldMsg=Rn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.originalData=e.Data}getCustomerRankQty(){this.pageData.Filter.ListCustomerID=[];for(let e of this.data.Data)this.pageData.Filter.ListCustomerID.push(e.CustomerID);this.customerRankQty$=this.httpService.post("/API/Report/CustomerRankGetQuantity",this.pageData.Filter).pipe(jt(1))}preGetList(){this.showCustomerRankQty=!1}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.originalData;if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Code":return this.compare(t.Code,l.Code,h);case"Orders":return this.compare(t.Orders,l.Orders,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"SalesNTax":return this.compare(t.Sales+t.Tax,l.Sales+l.Tax,h);case"Cost":return this.compare(t.Cost,l.Cost,h);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,r){this.matDialog.open(qn,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(l=>{if(l){let h={ContactID:r,GroupIDs:l.groupIDs};this.httpService.post("/API/Report/UpdateContactGroups",h).subscribe(()=>{this.getListData()})}})}openExportModal(){let e=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(K,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+e}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-Top-Customers"]],standalone:!1,features:[W],decls:28,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left",2,"width","135px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],[1,"pointer"],[1,"text-primary"],["matTooltipPosition","above",3,"matTooltip"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-warning-emphasis"],[1,"text-primary",3,"click"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,Fm,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," By Age "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),b(18,"l"),p(19,"By Customer Group "),a()(),n(20,"li")(21,"a",6),p(22," By Last Purchase "),a()()()()(),n(23,"filters"),E(24,Im,16,10,"ng-template",null,0,O),a(),n(26,"content"),S(27,qm,17,13,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Sm)),o(3),c("routerLink",M(13,ym)),o(3),c("routerLink",M(14,Dm)),o(3),c("routerLink",M(15,vm)),o(4),c("routerLink",M(16,wm)),o(6),y(t.data?27:-1))},dependencies:[A,Q,$,J,Qe,L,R,ie,pe,ge,Ue,U,ti,re,Z,ne],encapsulation:2})};var Um=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],zm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],Km=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],Xm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],Jm=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function Zm(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function $m(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function es(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),n(6,"td",23),p(7),d(8,"amountFraction"),a(),n(9,"td",24),p(10),d(11,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D(" ",e.Name," "),o(2),F(g(5,4,e.TotalOrders)),o(3),F(g(8,6,e.TotalCost)),o(3),F(g(11,8,e.TotalAmount))}}function ts(i,s){if(i&1&&(n(0,"tbody",22),G(1,es,12,10,"tr",null,Y),a()),i&2){let e=m(2);o(),H(e.data.Data)}}function is(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"AGE"),a(),n(6,"th",19),p(7," ORDERS"),a(),n(8,"th",20),p(9," COST"),a(),n(10,"th",21),p(11," AMOUNT"),a()()(),S(12,ts,3,0,"tbody",22),a()()}if(i&2){let e=m();o(12),y(e.data.Data?12:-1)}}var zn=class i extends De{constructor(e,r,t,l,h,T){super(e,r,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.datePipe=T}preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Age":return this.compare(t.Name,l.Name,h);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,h);case"Quantity":return this.compare(t.TotalCost,l.TotalCost,h);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,h);default:return 0}})}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-age"]],standalone:!1,features:[W],decls:27,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Zm,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Gender "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,$m,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,is,13,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,Um)),o(3),c("routerLink",M(12,zm)),o(3),c("routerLink",M(13,Km)),o(3),c("routerLink",M(14,Xm)),o(3),c("routerLink",M(15,Jm)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,U,re,Z],encapsulation:2})};var ns=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],as=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],os=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],rs=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],ls=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function ps(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function ms(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Customer Group"),a(),n(6,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Groups),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function ss(i,s){i&1&&(n(0,"th",19),p(1," ORDERS"),a())}function cs(i,s){i&1&&(n(0,"th",20),p(1," QUANTITY"),a())}function ds(i,s){i&1&&(n(0,"th",21),p(1," AMOUNT"),a())}function us(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalOrders))}}function _s(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalQuantity)," ")}}function gs(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalAmount))}}function Cs(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,us,3,3,"td",23),S(4,_s,3,3,"td",23),S(5,gs,3,3,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),D(" ",e.Name," "),o(),y(r.column.Orders.selected?3:-1),o(),y(r.column.QTY.selected?4:-1),o(),y(r.column.Amount.selected?5:-1)}}function fs(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"GENDER"),a(),S(6,ss,2,0,"th",19),S(7,cs,2,0,"th",20),S(8,ds,2,0,"th",21),a()(),n(9,"tbody",22),G(10,Cs,6,4,"tr",null,Y),a()()()}if(i&2){let e=m();o(6),y(e.column.Orders.selected?6:-1),o(),y(e.column.QTY.selected?7:-1),o(),y(e.column.Amount.selected?8:-1),o(2),H(e.data==null?null:e.data.Data)}}var Kn=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=h}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/CustomerGenderRankQuantity",responseProperty:"TotalQuantity"},Amount:{selected:!0}};customerRankQty$;showCustomerRankQty=!1;preInitList(){V.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Gender":return this.compare(t.Name,l.Name,h);case"Orders":return this.compare(t.TotalOrders,l.TotalOrders,h);case"Quantity":return this.compare(t.TotalQuantity,l.TotalQuantity,h);case"Total":return this.compare(t.TotalAmount,l.TotalAmount,h);default:return 0}})}getCustomerRankQty(){this.customerRankQty$=this.httpService.post("/API/Report/CustomerGenderRankQuantity",this.pageData.Filter).pipe(jt(1))}openExportModal(){this.matDialog.open(K,{data:{title:"Top Gender customer",exportTypes:[{ID:"ReportExport/CustomerGenderRank",Value:"Default",FileName:"Top Gender customer "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["POS-top-customers-by-gender"]],standalone:!1,features:[W],decls:27,vars:17,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),S(2,ps,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By City "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,ms,13,8,"ng-template",null,0,O),a(),n(25,"content"),S(26,fs,12,3,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,ns)),o(3),c("routerLink",M(13,as)),o(3),c("routerLink",M(14,os)),o(3),c("routerLink",M(15,rs)),o(3),c("routerLink",M(16,ls)),o(6),y(t.data?26:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,U,re,Z,ne],encapsulation:2})};var Ur=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],xs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],hs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Ss=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],ys=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Ds=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],vs=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],ws=i=>({ID:i}),Ts=(i,s,e)=>({From:i,SupplierID:s,To:e});function Ps(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Fs(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Supplier Group"),a(),n(6,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Row Count"),a(),n(15,"input",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function Is(i,s){if(i&1&&(n(0,"tr",24)(1,"td"),p(2),a(),n(3,"td",25)(4,"a",26),p(5),a()(),n(6,"td",27),p(7),a(),n(8,"td",28),p(9),d(10,"quantityFraction"),a(),n(11,"td",27)(12,"a",26),d(13,"date"),d(14,"date"),p(15),d(16,"amountFraction"),a()()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",M(19,vs))("queryParams",X(20,ws,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,9,e.Quantity)," "),o(3),c("routerLink",M(22,Ur))("queryParams",_t(23,Ts,v(13,11,r.pageData.Filter.From,"yyyy-MM-dd"),e.SupplierID,v(14,14,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),D(" ",g(16,17,e.Total))}}function bs(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",29),b(2,"th",30),n(3,"th",27),p(4,"Total Quantity"),a(),n(5,"th",27),p(6,"Total Sales"),a()(),n(7,"tr"),b(8,"td",31),n(9,"td",27),p(10),a(),n(11,"td",27),p(12),a()()()),i&2){let e=m(2);o(10),F(e.data.TotalQty),o(2),F(e.data.TotalSales)}}function Es(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr")(4,"th",19),p(5,"RANK"),a(),n(6,"th",20),p(7,"SUPPLIER"),a(),n(8,"th",21),p(9," CODE "),a(),n(10,"th",22),p(11," QUANTITY "),a(),n(12,"th",23),p(13," TOTAL "),a()()(),n(14,"tbody"),G(15,Is,17,27,"tr",24,Y),a(),S(17,bs,13,2,"tfoot"),a()()}if(i&2){let e=m();o(15),H(e.data.Data),o(2),y((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?17:-1)}}var Xn=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}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 h=e.direction==="asc";switch(e.active){case"Rank":return this.compare(t.Rank,l.Rank,h);case"Supplier":return this.compare(t.Name,l.Name,h);case"Code":return this.compare(t.Code,l.Code,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Total":return this.compare(t.Total,l.Total,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-top-suppliers"]],standalone:!1,features:[W],decls:30,vars:18,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"],[1,"thead-light"],["colspan","3"],["colspan","3",1,"bg-white","border-top-0"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Ps,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Compare with Transfer Order "),a()(),n(19,"li")(20,"a",6),p(21," Product Tags Analysis "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Fs,16,10,"ng-template",null,0,O),a(),n(28,"content"),S(29,Es,18,1,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Ur)),o(3),c("routerLink",M(13,xs)),o(3),c("routerLink",M(14,hs)),o(3),c("routerLink",M(15,Ss)),o(3),c("routerLink",M(16,ys)),o(3),c("routerLink",M(17,Ds)),o(6),y(t.data?29:-1))},dependencies:[A,Q,$,J,Qe,L,R,pe,ge,Ue,U,oe,Z,ne],encapsulation:2})};var zr=Jt(bi());var Vs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],Bs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Os=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],Ls=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Rs=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],ks=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Ws=(i,s,e,r,t)=>({From:i,To:s,ListIDs:e,ListVariantID:r,GroupByVariant:t}),Ns=i=>[i],As=i=>({ID:i}),Gs=(i,s,e,r,t,l)=>({ID:i,From:s,To:e,ListIDs:r,ListVariantID:t,GroupByVariant:l}),Kr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"],Hs=(i,s,e)=>({VariantID:i,From:s,To:e}),Qs=(i,s,e)=>({ProductID:i,From:s,To:e});function Ys(i,s){if(i&1&&(n(0,"a",9),b(1,"i",10),p(2," Compare Qty Sold "),a()),i&2){let e,r=m();c("queryParams",cn(1,Ws,(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 js(i,s){if(i&1){let e=I();n(0,"button",11),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",12),p(2," Export "),a()}}function qs(i,s){if(i&1){let e=I();n(0,"div",13)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",15),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",16),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a(),n(10,"div",17)(11,"datepicker",18),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(12,"h6"),p(13,"Brand"),a(),n(14,"ng-select",19),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(21,"h6"),p(22,"Scope"),a(),n(23,"radio-options",22),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a(),n(24,"h6"),p(25,"Sales Order Tag"),a(),n(26,"ng-select",23),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.LogisticsServiceID,t)||(l.pageData.Filter.LogisticsServiceID=t),_(t)}),a(),n(30,"h6"),p(31,"Supplier"),a(),n(32,"autocompleteV2",25),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ContactGroupID,t)||(l.pageData.Filter.ContactGroupID=t),_(t)}),a(),n(36,"h6"),p(37,"Customer"),a(),n(38,"autocompleteV2",27),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("modelChange",function(t){u(e);let l=m();return f(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),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.NeedMultiplyUnitQuantity,t)||(l.pageData.Filter.NeedMultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",e.pageData.Options.Categories)("isInitializedCategoryLabel",!0)("showClear",!0),o(3),C("date",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(2),C("date",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(3),c("multiple",!0)("multiple",!0),C("ngModel",e.pageData.Filter.BrandIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Tags),C("ngModel",e.pageData.Filter.TagID),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),o(3),C("ngModel",e.pageData.Filter.LogisticsServiceID),c("items",e.pageData.Options==null?null:e.pageData.Options.ServicesLogistics),o(3),C("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.pageData.supplierName),o(3),c("items",e.pageData.Options.ContactGroups),C("ngModel",e.pageData.Filter.ContactGroupID),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(3),C("model",e.pageData.Filter.NeedMultiplyUnitQuantity)}}function Us(i,s){if(i&1){let e=I();n(0,"th",48)(1,"div",49)(2,"input",50),P("change",function(t){u(e);let l=m(2);return _(l.checkAllCheckBox(t))}),a()()()}if(i&2){let e=m(2);o(2),c("checked",e.isAllCheckBoxChecked())}}function zs(i,s){if(i&1&&(n(0,"th",51),p(1," Qty "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Quantity.start)}}function Ks(i,s){i&1&&(n(0,"th",52),p(1," On Hand "),a())}function Xs(i,s){i&1&&(n(0,"th",53),p(1," Cost "),a())}function Js(i,s){i&1&&(n(0,"th",54),p(1," GROSS "),a())}function Zs(i,s){if(i&1&&(n(0,"th",55),p(1," Sales "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function $s(i,s){i&1&&(n(0,"th",56),p(1," Tax "),a())}function e0(i,s){if(i&1&&(n(0,"th",57),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("start",e.currentServerSortState.Sales.start)}}function t0(i,s){i&1&&(n(0,"th",58),p(1," PROFIT "),a())}function i0(i,s){i&1&&(n(0,"th",59),p(1," % "),a())}function n0(i,s){if(i&1){let e=I();n(0,"td")(1,"div",49)(2,"input",71),x("ngModelChange",function(t){u(e);let l=m().$implicit;return f(l.checked,t)||(l.checked=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(3);return _(t.filterSelectedVariantIds())}),a()()()}if(i&2){let e=m().$implicit;o(2),c("value",e.ID),C("ngModel",e.checked)}}function a0(i,s){if(i&1){let e=I();pt(0),n(1,"img",72),P("click",function(t){u(e);let l=m().$implicit,h=m(2);return _(h.openBigPicture(l==null?null:l.ImageURL,t))}),a(),mt()}if(i&2){let e=m().$implicit;o(),c("src",e.ThumbnailUrl,rn)}}function o0(i,s){if(i&1){let e=I();n(0,"a",73)(1,"img",74),P("click",function(t){u(e);let l=m().$implicit,h=m(2);return _(h.openBigPicture(l,t))}),a()()}if(i&2){let e=m(3);c("target",e.pageData.LinkTarget)}}function r0(i,s){if(i&1&&(n(0,"td",75)(1,"a",76),p(2),d(3,"quantityFraction"),a()()),i&2){let e,r=m().$implicit,t=m(2);o(),c("queryParams",Ao(4,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(),F(g(3,2,r.Quantity))}}function l0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.OnHand)," ")}}function p0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.UnitCost)," ")}}function m0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function s0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Kr))("queryParams",_t(12,Hs,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function c0(i,s){if(i&1&&(n(0,"a",65),d(1,"date"),d(2,"date"),p(3),d(4,"amountFraction"),a()),i&2){let e=m(2).$implicit,r=m(2);c("routerLink",M(11,Kr))("queryParams",_t(12,Qs,e.ID,v(1,3,r.pageData.Filter.From,"ddMMyyyy"),v(2,6,r.pageData.Filter.To,"ddMMyyyy"))),o(3),F(g(4,9,e.Sales))}}function d0(i,s){if(i&1&&(n(0,"td",75),E(1,s0,5,16,"a",78)(2,c0,5,16,"a",78),a()),i&2){let e=m(3);o(),c("ngIf",e.pageData.Filter.GroupByVariant),o(),c("ngIf",!e.pageData.Filter.GroupByVariant)}}function u0(i,s){if(i&1&&(n(0,"td",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function _0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesNTax)," ")}}function g0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit)," ")}}function C0(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Margin>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Margin)," ")}}function f0(i,s){if(i&1&&(n(0,"tr",60),E(1,n0,3,2,"td",8),n(2,"td"),p(3),a(),n(4,"td")(5,"div",61)(6,"div",62),E(7,a0,2,1,"ng-container",8)(8,o0,2,1,"a",63),a(),n(9,"div",64)(10,"a",65),p(11),a(),n(12,"small",66),p(13),a()()()(),E(14,r0,4,11,"td",67)(15,l0,3,3,"td",67)(16,p0,3,3,"td",68)(17,m0,3,3,"td",67)(18,d0,3,2,"td",67)(19,u0,3,3,"td",69)(20,_0,3,3,"td",67)(21,g0,3,4,"td",70)(22,C0,3,4,"td",70),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(),c("ngIf",t.column.CompareQtySold.selected),o(2),F(r+1),o(4),c("ngIf",e.ImageURL),o(),c("ngIf",!e.ImageURL),o(2),c("routerLink",X(17,Ns,t.pageData.Filter.GroupByVariant==!0?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(19,As,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.OnHand.selected),o(),c("ngIf",t.roleService.product.Cost&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Gross.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Sales.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.Tax.selected),o(),c("ngIf",t.roleService.report.Price&&t.column.SalesNTax.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.report.Price&&t.roleService.report.Profit&&t.column.Margin.selected)}}function x0(i,s){i&1&&b(0,"td",75)}function h0(i,s){i&1&&(n(0,"td",75),p(1," Total : "),a())}function S0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Quantity"))," ")}}function y0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"OnHand"))," ")}}function D0(i,s){if(i&1&&(n(0,"td",77),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"UnitCost"))," ")}}function v0(i,s){if(i&1&&(n(0,"td",75),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function w0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Sales")))}}function T0(i,s){if(i&1&&(n(0,"td",79)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"Tax")))}}function P0(i,s){if(i&1&&(n(0,"td",83)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(3);o(2),F(g(4,4,v(3,1,e.infiniteList,"SalesNTax")))}}function F0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.infiniteList,"Profit"))," ")}}function I0(i,s){if(i&1&&(n(0,"td",80),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"sum"),d(6,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",v(1,2,e.infiniteList,"Profit")/v(2,5,e.infiniteList,"SalesNTax")*100>=0?"text-success":"text-danger"),o(3),D(" ",g(6,14,v(4,8,e.infiniteList,"Profit")/v(5,11,e.infiniteList,"SalesNTax")*100)," ")}}function b0(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",81),b(2,"td",75),E(3,x0,1,0,"td",67)(4,h0,2,0,"td",67)(5,S0,4,6,"td",67)(6,y0,4,6,"td",67)(7,D0,4,6,"td",68)(8,v0,4,6,"td",67)(9,w0,5,6,"td",82)(10,T0,5,6,"td",69)(11,P0,5,6,"td",82)(12,F0,5,10,"td",70)(13,I0,7,16,"td",70),a()()),i&2){let e=m(2);o(3),c("ngIf",e.column.CompareQtySold.selected),o(),c("ngIf",e.column.CompareQtySold.selected||e.column.QTY.selected||e.column.OnHand.selected||e.column.Cost.selected||e.column.Gross.selected||e.column.Sales.selected||e.column.SalesNTax.selected||e.column.Tax.selected||e.column.Profit.selected&&e.column.Profit.role||e.column.Margin.selected&&e.column.Profit.role),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.roleService.report.Profit&&e.column.Margin.selected)}}function E0(i,s){if(i&1){let e=I();n(0,"content")(1,"div",30)(2,"div",31)(3,"table",32),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",33)(5,"tr"),E(6,Us,3,1,"th",34),n(7,"th",35),p(8,"No"),a(),n(9,"th",36),p(10,"Name"),a(),E(11,zs,2,1,"th",37)(12,Ks,2,0,"th",38)(13,Xs,2,0,"th",39)(14,Js,2,0,"th",40)(15,Zs,2,1,"th",41)(16,$s,2,0,"th",42)(17,e0,2,1,"th",43)(18,t0,2,0,"th",44)(19,i0,2,0,"th",45),a()(),n(20,"tbody"),E(21,f0,23,21,"tr",46),a(),E(22,b0,14,11,"tfoot",8),a()(),n(23,"infinite-pagination",47),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.CompareQtySold.selected),o(5),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.OnHand.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Gross.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Sales.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Tax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Profit.selected),o(),c("ngIf",e.roleService.report.Price&&e.column.Profit.role&&e.column.Margin.selected),o(2),c("ngForOf",e.infiniteList),o(),c("ngIf",e.data),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Jn=class i extends De{constructor(e,r,t,l,h,T,Ze){super(e,r,"Report/ProductSales","ReportLoader/ProductSales",null,h);this.httpService=r;this.csvConverter=t;this.toasterService=l;this.activatedRoute=h;this.matDialog=T;this.bigPicture=Ze}currentServerSortState={Quantity:{start:"desc"},Sales:{start:"desc"}};roleService=Pe(j);columnService=Pe(gt);column={CompareQtySold:{selected:!1,name:"Checkbox"},QTY:{selected:!0,name:"Qty"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/ProductSalesInventory",responseProperty:"OnHand"},Cost:{selected:!0,name:"Cost",role:this.roleService.product.Cost},Gross:{selected:!1,name:"Gross",role:this.roleService.report.Price},Sales:{selected:!0,name:"Sales",role:this.roleService.report.Price},Tax:{selected:!0,name:"Tax",role:this.roleService.report.Price},SalesNTax:{selected:!0,name:"Sales + Tax",role:this.roleService.report.Price},Profit:{selected:!0,name:"Profit",role:this.roleService.report.Profit&&this.roleService.report.Price},Margin:{selected:!0,name:"Margin",role:this.roleService.report.Profit&&this.roleService.report.Price}};scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];brandName;selectedVariantIds=dt([]);queryParams=dt(null);preInitList(){this.handlingQueryParams()}postInit(e){super.postInit(e),this.data=nt(et({},this.data),{Data:e.Data.map(t=>nt(et({},t),{checked:!1}))});for(let[t]of Object.entries(this.currentServerSortState))this.currentServerSortState[t]=nt(et({},this.currentServerSortState[t]),{start:"desc"});let r=e.Sort.column;this.currentServerSortState[r]=nt(et({},this.currentServerSortState[r]),{start:e.Sort.direction==="desc"?"asc":"desc"}),this.menuData.H=this.data.PageTitle,this.menuData.SH=this.data.PageSubTitle,this.generateQueryParams()}checkAllCheckBox(e){let r=e.target;this.infiniteList=[...this.infiniteList.map(t=>nt(et({},t),{checked:r.checked}))],this.filterSelectedVariantIds()}filterSelectedVariantIds(){let e=this.infiniteList.filter(r=>r.checked).map(r=>r.ID);this.selectedVariantIds.set(e),this.generateQueryParams()}isAllCheckBoxChecked(){return this.infiniteList&&this.infiniteList.length>0?this.infiniteList.every(e=>e.checked):!1}preSearchFromPageOne(){this.goToLast&&(this.goToLast=!1,this.pageData.Filter.RowCount=100)}handlingQueryParams(){let e=this.activatedRoute?.snapshot?.queryParams;V.IsNotEmpty(e.BrandID)&&(this.brandName=e.Name,this.pageData.Filter.BrandIDs=[e.BrandID]),this.pageData.Filter.CategoryID=e?.CategoryID,this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),(e.From=="01010001"||V.IsEmpty(e.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),(e.To=="01010001"||V.IsEmpty(e.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}generateQueryParams(){let e=this.selectedVariantIds()?.join(",");this.queryParams.set({From:this.convertToDateString(this.pageData.Filter.From),To:this.convertToDateString(this.pageData.Filter.To),GroupByVariant:this.pageData.Filter.GroupByVariant,ListIDs:this.pageData.Filter?.ListIDs?.join(","),ListVariantID:e})}openBigPicture(e,r){this.bigPicture.openBiggerPicture(r,e)}updateMinstock(){let e=[];if(this.infiniteList.forEach(t=>{if(t.NewMinStock!=t.MinStock){let l={VariantID:t.ID,MinStock:t.NewMinStock};e.push(l)}}),this.pageData.Filter.ListIDs.length==0)return alert("Outlet is required"),!1;if(this.pageData.Filter.ListIDs.length>1)return alert("Only support 1 Outlet"),!1;let r={EntityID:this.pageData.Filter.ListIDs[0],Items:e};this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",r).subscribe(t=>{this.toasterService.success(t,zi.Success),this.getListData()})}sortData(e){if(console.log(e),e.active==="Quantity"||e.active==="Total_Sales"||e.active==="Total_Tax_Sales"){let t="Sales";e.active==="Quantity"&&(t="Quantity"),this.pageData.Filter=nt(et({},this.pageData.Filter),{Sort:{column:t,direction:e.direction}}),this.searchFromPageOne()}let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Code=t.Code==null?"":t.Code,l.Code=l.Code==null?"":l.Code,t.BrandName=t.BrandName==null?"":t.BrandName,l.BrandName=l.BrandName==null?"":l.BrandName,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),h);case"Brand":return V.compare(t.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),h);case"Quantity":return V.compare(t.Quantity,l.Quantity,h);case"Total_Cost":return V.compare(t.UnitCost,l.UnitCost,h);case"Inventory":return V.compare(t.OnHand,l.OnHand,h);case"Total_Sales":return V.compare(t.Total,l.Total,h);case"Total_Tax":return V.compare(t.Tax,l.Tax,h);case"Total_Tax_Sales":return V.compare(t.SalesNTax,l.SalesNTax,h);case"ReOrder":return V.compare(t.MinStock,l.MinStock,h);case"Gross":return V.compare(t.Gross,l.Gross,h);case"Margin":return V.compare(t.Margin,l.Margin,h);case"Profit":return V.compare(t.Profit,l.Profit,h);default:return 0}})}get itemsChecked(){return this.infiniteList?JSON.stringify(this.data.Data.filter(e=>e.checked).map(e=>e.ID)):JSON.stringify([])}get isAnyItemChecked(){return this.infiniteList&&Array.isArray(this.infiniteList)?this.infiniteList.filter(e=>e.checked).length>=2:-1}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Product",exportTypes:[{ID:"ReportExport/ProductSales",Value:"Default",FileName:"Product Sales"},{ID:"ReportExport/ProductSalesExportWithDescription",Value:"Description",FileName:"Product Sales with Description"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter)}JSONstringify(e){return e&&Array.isArray(e)?e.join(","):JSON.stringify(e)}convertToDateString(e){return(0,zr.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(qe),w(Ne),w(z),w(An))};static \u0275cmp=B({type:i,selectors:[["POS-product-sales"]],standalone:!1,features:[W],decls:30,vars:20,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","onChangeColumnCheckbox","pageData","text","isFilterOnDropdown","filter","column"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart","class","btn btn-outline-secondary me-3",3,"queryParams",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"btn","btn-outline-secondary","me-3",3,"queryParams"],[1,"fa-solid","fa-chart-mixed"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appearance","outline","name","From",3,"dateChange","date","showClearBtn","showTodayBtn"],[1,"mt-4"],["appearance","outline","name","To",3,"dateChange","date","showClearBtn","showTodayBtn"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Product Tag",3,"ngModelChange","items","ngModel"],[3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items","multiple"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Customer Group",3,"ngModelChange","items","ngModel"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","render-ProductType",3,"modelChange","model","options"],["name","render-NeedMultiplyUnitQuantity ",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 15px",4,"ngIf"],[2,"width","10px"],["mat-sort-header","Name"],["style","width: 50px","arrowPosition","before","mat-sort-header","Quantity",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Gross",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Sales",3,"start",4,"ngIf"],["style","width: 100px","arrowPosition","before","mat-sort-header","Total_Tax",4,"ngIf"],["style","width: 150px","arrowPosition","before","mat-sort-header","Total_Tax_Sales",3,"start",4,"ngIf"],["arrowPosition","before","mat-sort-header","Profit","style","width: 7.5rem",4,"ngIf"],["arrowPosition","before","mat-sort-header","Margin","style","width: 2.5rem","matTooltip","Gross Profit Margin",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[2,"width","15px"],[1,"form-check"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"change","checked"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","50px",3,"start"],["arrowPosition","before","mat-sort-header","Inventory","matTooltip","On Hand Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Gross",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px",3,"start"],["arrowPosition","before","mat-sort-header","Total_Tax",2,"width","100px"],["arrowPosition","before","mat-sort-header","Total_Tax_Sales",2,"width","150px",3,"start"],["arrowPosition","before","mat-sort-header","Profit",2,"width","7.5rem"],["arrowPosition","before","mat-sort-header","Margin","matTooltip","Gross Profit Margin",2,"width","2.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[1,"lh-base"],[3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["type","checkbox","id","flexCheckChecked",1,"form-check-input",3,"ngModelChange","value","ngModel"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"cursor-pointer",2,"width","40px",3,"click","src"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom","src","https://cdn.dealpos.app/template/products_thumb.png",1,"border","rounded",2,"width","40px",3,"click"],[1,"text-end"],["target","_blank","routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart",1,"pe-auto",2,"cursor","pointer",3,"queryParams"],[1,"text-end","text-danger"],[3,"routerLink","queryParams",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["class","text-end text-primary",4,"ngIf"],[1,"text-end","text-primary"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,Ys,3,7,"a",2),S(3,js,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10," Compare by Outlet "),a()(),n(11,"li")(12,"a",7),p(13," Compare by Month "),a()(),n(14,"li")(15,"a",7),p(16," Compare with Transfer Order "),a()(),n(17,"li")(18,"a",7),p(19," Product Tags Analysis "),a()(),n(20,"li")(21,"a",7),p(22," Top Suppliers "),a()(),n(23,"li")(24,"a",7),p(25," Quantity Sold Chart "),a()()()()(),n(26,"filters"),E(27,qs,45,36,"ng-template",null,0,O),a(),E(29,E0,24,18,"content",8),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.isAnyItemChecked),o(),y(t.roleService.global.Export?3:-1),o(6),c("routerLink",M(14,Vs)),o(3),c("routerLink",M(15,Bs)),o(3),c("routerLink",M(16,Os)),o(3),c("routerLink",M(17,Ls)),o(3),c("routerLink",M(18,Rs)),o(3),c("routerLink",M(19,ks)),o(5),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,Jo,L,R,ie,pe,ge,Te,Ae,Ce,U,ze,ti,se,oe,Z,ne],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})};var V0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],B0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],O0=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],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=>({ID:i}),N0=(i,s)=>s.Name,A0=(i,s)=>s.ID;function G0(i,s){if(i&1){let e=I();n(0,"a",16),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",17),p(2," Export "),a()}}function H0(i,s){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet Group"),a(),n(3,"POS-outlet-group-tree-select",19),x("selectedOutletGroupIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(4,"h6"),p(5,"Outlet"),a(),n(6,"outlet-selector",20),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",21),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Category"),a(),n(12,"POS-product-category-select",22),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(13,"h6"),p(14,"Brand"),a(),n(15,"ng-select",23),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a(),n(16,"h6"),p(17,"Supplier"),a(),n(18,"autocompleteV2",24),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(19,"h6"),p(20,"Product Tags"),a(),n(21,"ng-select",25),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ProductTagID,t)||(l.pageData.Filter.ProductTagID=t),_(t)}),a(),n(22,"h6"),p(23,"From - To"),a(),n(24,"div")(25,"datepicker",26),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(26,"div",27)(27,"datepicker",28),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(28,"h6"),p(29,"Scope"),a(),n(30,"radio-options",29),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("showClear",!0),C("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),C("ngModel",e.pageData.Filter.BrandID),o(3),C("ngModel",e.pageData.Filter.SupplierID),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.ProductTags),C("ngModel",e.pageData.Filter.ProductTagID),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function Q0(i,s){i&1&&(n(0,"th",30),p(1,"Code"),a()),i&2&&qt("text-align","right")}function Y0(i,s){i&1&&(n(0,"th",31),p(1,"Cost"),a()),i&2&&qt("text-align","right")}function j0(i,s){i&1&&(n(0,"th",31),p(1,"Sales"),a()),i&2&&qt("text-align","right")}function q0(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit;c("matTooltip",Ct(e.Name)),o(),D(" ",e.Code??e.Name," ")}}function U0(i,s){i&1&&(n(0,"th",14),p(1,"Total"),a())}function z0(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),F(e.Code)}}function K0(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),D(" ",g(2,3,e.UnitCost)," ")}}function X0(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;qt("text-align","right"),o(),D(" ",g(2,3,e.UnitPrice)," ")}}function J0(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e," ")}}function Z0(i,s){if(i&1&&(n(0,"td",14),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Total)}}function $0(i,s){if(i&1&&(n(0,"tr",15)(1,"td")(2,"a",32),p(3),a()(),S(4,z0,2,3,"td",33),S(5,K0,3,5,"td",33),S(6,X0,3,5,"td",33),G(7,J0,2,1,"td",14,Yi),S(9,Z0,2,1,"td",14),a()),i&2){let e=s.$implicit,r=m();o(2),c("routerLink",r.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info")("queryParams",X(7,W0,e.ID)),o(),D(" ",e.Name),o(),y(r.column.code.selected?4:-1),o(),y(r.column.cost&&r.column.cost.selected?5:-1),o(),y(r.column.sales&&r.column.sales.selected?6:-1),o(),H(e.Quantities),o(2),y(r.column.total.selected?9:-1)}}var Zn=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.roleService=h}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];column={code:{selected:!0,name:"Code"},cost:{selected:!1,name:"Cost"},sales:{selected:!1,name:"Sales"},total:{selected:!0,name:"Total"}};openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Outlet",exportTypes:[{ID:"ReportExport/ReportSalesProductByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}submit(){this.pageData.Filter.Product?(delete this.column.cost,delete this.column.sales):(this.column.cost={selected:!1,name:"Cost"},this.column.sales={selected:!1,name:"Sales"}),super.searchFromPageOne()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-outlet"]],standalone:!1,features:[W],decls:44,vars:22,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%",3,"text-align"],[1,"text-end",2,"width","10%",3,"text-align"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"text-end"],[1,"border-bottom"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"ngModelChange","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModelChange","items","ngModel"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[3,"routerLink","queryParams"],[3,"text-align"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.submit())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,G0,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,H0,31,18,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9)(32,"tr")(33,"th",10),p(34,"Name"),a(),S(35,Q0,2,2,"th",11),S(36,Y0,2,2,"th",12),S(37,j0,2,2,"th",12),G(38,q0,2,3,"th",13,N0),S(40,U0,2,0,"th",14),a()(),n(41,"tbody"),G(42,$0,10,9,"tr",15,A0),a()()()()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(16,V0)),o(3),c("routerLink",M(17,B0)),o(3),c("routerLink",M(18,O0)),o(3),c("routerLink",M(19,L0)),o(3),c("routerLink",M(20,R0)),o(3),c("routerLink",M(21,k0)),o(12),y(t.column.code.selected?35:-1),o(),y(t.column.cost&&t.column.cost.selected?36:-1),o(),y(t.column.sales&&t.column.sales.selected?37:-1),o(),H(t.data==null?null:t.data.Outlet),o(2),y(t.column.total.selected?40:-1),o(2),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,$,J,L,R,ie,Te,Ae,Ce,U,ze,Vi,Z],encapsulation:2})};var xo=Jt(bi());var ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],tc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],ic=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],nc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],ac=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],oc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Xr=()=>({standalone:!0}),Jr=()=>({overflow:"visible"}),rc=i=>[i],lc=i=>({ID:i});function pc(i,s){if(i&1){let e=I();n(0,"a",17),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",18),p(2," Export"),a()}}function mc(i,s){if(i&1){let e=I();n(0,"div",19)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",20),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListOutletID,t)||(l.pageData.Filter.ListOutletID=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",21),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"div",22)(8,"div",23)(9,"h6"),p(10,"Compare Month From"),a(),n(11,"p-datepicker",24),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.MonthFrom,t)||(l.pageData.Filter.MonthFrom=t),_(t)}),a()(),n(12,"div",25)(13,"h6"),p(14,"Compare Month To"),a(),n(15,"p-datepicker",24),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.MonthTo,t)||(l.pageData.Filter.MonthTo=t),_(t)}),a()()(),n(16,"h6"),p(17,"Scope"),a(),n(18,"radio-options",26),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupByVariant,t)||(l.pageData.Filter.GroupByVariant=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListOutletID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(5),C("ngModel",e.pageData.Filter.MonthFrom),c("ngModelOptions",M(18,Xr))("contentStyle",M(19,Jr))("appendTo","body")("baseZIndex",99999),o(4),C("ngModel",e.pageData.Filter.MonthTo),c("ngModelOptions",M(20,Xr))("contentStyle",M(21,Jr))("appendTo","body")("baseZIndex",99999),o(3),C("model",e.pageData.Filter.GroupByVariant),c("options",e.scopeFilter)}}function sc(i,s){i&1&&(n(0,"th",11),p(1," Name "),a())}function cc(i,s){i&1&&(n(0,"th",12),p(1," Code "),a())}function dc(i,s){i&1&&(n(0,"th",13)(1,"span",27),p(2," On Hand "),a()())}function uc(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=m();o(),D(" ",r.months[e.Month-1].ColumnLabel," ")}}function _c(i,s){i&1&&(n(0,"th",13)(1,"span",28),p(2," Total "),a()())}function gc(i,s){if(i&1&&(n(0,"td")(1,"a",31),p(2),a()()),i&2){let e=m().$implicit,r=m();o(),c("routerLink",X(3,rc,r.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",X(5,lc,e.ID)),o(),D(" ",e.Name," ")}}function Cc(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function fc(i,s){if(i&1&&(n(0,"td",29)(1,"span",27),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",e.OnHand?v(3,1,e.OnHand,r.pageData.FractionDigit):"0"," ")}}function xc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m();o(),D(" ",t.findKey(r.Sold,e.Month)?v(2,1,t.findKey(r.Sold,e.Month),t.pageData.FractionDigit):"0"," ")}}function hc(i,s){if(i&1&&(n(0,"td",29)(1,"span",28),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m().$implicit,r=m();o(2),D(" ",v(4,4,v(3,1,e.Sold,"Value"),r.pageData.FractionDigit)," ")}}function Sc(i,s){if(i&1&&(n(0,"tr"),S(1,gc,3,7,"td"),S(2,Cc,2,1,"td"),S(3,fc,4,4,"td",29),E(4,xc,3,4,"td",30),S(5,hc,5,7,"td",29),a()),i&2){let e=m();o(),y(e.column.name.selected?1:-1),o(),y(e.column.code.selected?2:-1),o(),y(e.column.OnHand.selected?3:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?5:-1)}}function yc(i,s){i&1&&b(0,"td")}function Dc(i,s){i&1&&(n(0,"td",29),p(1,"Total :"),a())}function vc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),D(" ",v(2,1,e.getOnHandTotal(),e.pageData.FractionDigit)," ")}}function wc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.Sold,r.pageData.FractionDigit)," ")}}function Tc(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data==null?null:e.data.MonthlySales,"Sold"),e.pageData.FractionDigit)," ")}}function Pc(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",32),S(2,yc,1,0,"td"),S(3,Dc,2,0,"td",29),S(4,vc,3,4,"td",29),E(5,wc,3,4,"td",30),S(6,Tc,4,7,"td",29),a()()),i&2){let e=m();o(2),y(e.column.name.selected?2:-1),o(),y(e.column.code.selected?3:-1),o(),y(e.column.OnHand.selected?4:-1),o(),c("ngForOf",e.data==null?null:e.data.MonthlySales),o(),y(e.column.total.selected?6:-1)}}var $n=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date().getFullYear(),Ze=this.pageData.Filter.MonthFrom-1;this.pageData.Filter.MonthFrom=new Date(T,Ze)}_toastrService=Pe(qe);columnService=Pe(gt);years=V.GenerateYears(new Date().getFullYear()+1,11,!0);months=[{ID:1,Label:"January",ColumnLabel:"Jan"},{ID:2,Label:"February",ColumnLabel:"Feb"},{ID:3,Label:"March",ColumnLabel:"Mar"},{ID:4,Label:"April",ColumnLabel:"Apr"},{ID:5,Label:"May",ColumnLabel:"May"},{ID:6,Label:"June",ColumnLabel:"Jun"},{ID:7,Label:"July",ColumnLabel:"Jul"},{ID:8,Label:"August",ColumnLabel:"Aug"},{ID:9,Label:"September",ColumnLabel:"Sep"},{ID:10,Label:"October",ColumnLabel:"Oct"},{ID:11,Label:"November",ColumnLabel:"Nov"},{ID:12,Label:"December",ColumnLabel:"Dec"}];scopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}];column={name:{selected:!0,name:"Name"},code:{selected:!0,name:"Code"},OnHand:{selected:!1,name:"On Hand",advanced:!0,endpoint:"/api/Report/GetProductSalesMonthlyOnHand",responseProperty:"OnHand"},total:{selected:!0,name:"Total"}};MonthFrom;MonthTo;preGetList(){if(this.pageData&&this.pageData.Filter&&this.pageData.Filter.MonthFrom&&this.pageData.Filter.MonthTo){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs;return}super.preGetList()}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales by Month",exportTypes:[{ID:"ReportExport/ProductSalesMonthly",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}findKey(e,r){let t=null;return e.forEach(l=>{l.Key==r&&(t=l.Value)}),t}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=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(),h);case"Code":return this.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),h);default:return 0}})}preInitList(){super.preInitList?.(),this.pageData.Filter.MonthFrom=new Date(this.pageData.Filter.MonthFrom),this.pageData.Filter.MonthTo=new Date(this.pageData.Filter.MonthTo)}onSubmit(){delete this.pageData.Filter.ListDynamicID;let e=(0,xo.default)(this.pageData.Filter.MonthFrom),r=(0,xo.default)(this.pageData.Filter.MonthTo);if(r.diff(e,"months")>5)this._toastrService.warning("Selected month range exceeds the maximum of 6 months.","Warning");else{let l=e.format("YYYY-MM")+"-01",h=r.format("YYYY-MM")+"-01";this.pageData.Filter.MonthFrom=new Date(l),this.pageData.Filter.MonthTo=new Date(h),delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.ListIDs,this.searchFromPageOne()}}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.pageData.Filter.ListDynamicID=this.infiniteList.map(e=>e.ID),this.columnService.checkForAdvancedColumn(this.column,this.infiniteList,this.pageData.Filter,"OnHand",e=>this.mappingDataOnAdvancedColumn(e))}mappingDataOnAdvancedColumn(e){e&&(this.infiniteList=this.infiniteList.map(r=>{let t=e.find(l=>l.ID==r.ID);return t&&(r.OnHand=t.OnHand),r}))}getOnHandTotal(){return!this.infiniteList||this.infiniteList.length===0?0:this.infiniteList.reduce((r,t)=>{let l=Number(t.OnHand)||0;return r+l},0)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-by-month"]],standalone:!1,features:[W],decls:41,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table","table-fixed","table-bordered",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left","border-end",2,"width","250px"],["mat-sort-header","Code",1,"align-left","border-end",2,"width","150px"],[1,"text-end","border-end",2,"width","90px"],["class","text-end border-end","style","width: 90px",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[1,"row",2,"margin-top","15px"],[1,"col-6","pe-2"],["view","month","dateFormat","M yy",3,"ngModelChange","ngModel","ngModelOptions","contentStyle","appendTo","baseZIndex"],[1,"col-6"],["name","Scope",3,"modelChange","model","options"],["matTooltip","Current OnHand Inventory","matTooltipPosition","left",1,"cursor-pointer"],["matTooltip","Total Quantity Sold Based on Filtered Month","matTooltipPosition","left",1,"cursor-pointer"],[1,"text-end"],["class","text-end",4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"table","table-borderless"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.onSubmit())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,pc,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare with Transfer Order "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,mc,19,22,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8),P("matSortChange",function(T){return u(l),_(t.sortData(T))}),n(31,"thead",9)(32,"tr",10),S(33,sc,2,0,"th",11),S(34,cc,2,0,"th",12),S(35,dc,3,0,"th",13),E(36,uc,2,1,"th",14),S(37,_c,3,0,"th",13),a()(),n(38,"tbody"),E(39,Sc,6,5,"tr",15),a(),E(40,Pc,7,5,"tfoot",16),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(19,ec)),o(3),c("routerLink",M(20,tc)),o(3),c("routerLink",M(21,ic)),o(3),c("routerLink",M(22,nc)),o(3),c("routerLink",M(23,ac)),o(3),c("routerLink",M(24,oc)),o(10),y(t.column.name.selected?33:-1),o(),y(t.column.code.selected?34:-1),o(),y(t.column.OnHand.selected?35:-1),o(),c("ngForOf",t.data==null?null:t.data.MonthlySales),o(),y(t.column.total.selected?37:-1),o(2),c("ngForOf",t.data==null?null:t.data.Data),o(),c("ngIf",(t.data==null||t.data.Data==null?null:t.data.Data.length)>0))},dependencies:[A,st,it,Q,L,R,ie,pe,ge,Te,Ce,U,Tr,se,re],encapsulation:2})};var Fc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],Ic=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],bc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],Ec=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Products_Tags"],Mc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],Vc=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],Bc=i=>[i],Oc=i=>({ID:i});function Lc(i,s){if(i&1){let e=I();n(0,"button",13),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",14),p(2," Export"),a()}}function Rc(i,s){if(i&1){let e=I();n(0,"div",15)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",17),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",18),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",19)(12,"datepicker",20),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Scope"),a(),n(15,"radio-options",21),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Product,t)||(l.pageData.Filter.Product=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.pageData.Filter.Product),c("options",e.scopeFilter)}}function kc(i,s){if(i&1&&(n(0,"th",22),p(1),a()),i&2){let e=s.$implicit;o(),F(e)}}function Wc(i,s){if(i&1&&(n(0,"tr"),b(1,"th")(2,"th"),G(3,kc,2,1,"th",22,Y),a()),i&2){let e=m();o(3),H(e.data==null?null:e.data.Outlet)}}function Nc(i,s){if(i&1&&(n(0,"th",12),p(1),a()),i&2){let e=s.$implicit;o(),D(" ",e)}}function Ac(i,s){if(i&1&&(n(0,"a",23),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m();c("routerLink",X(3,Bc,t.pageData.Filter.Product?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(5,Oc,r[1])),o(),F(r[e])}}function Gc(i,s){if(i&1&&p(0),i&2){let e=m().$implicit,r=m().$implicit;D(" ",r[e]," ")}}function Hc(i,s){if(i&1&&(n(0,"td",11),S(1,Ac,2,7,"a",23)(2,Gc,1,1),a()),i&2){let e=s.$index;o(),y(e===0?1:2)}}function Qc(i,s){if(i&1&&(n(0,"tr",11),G(1,Hc,3,1,"td",11,Y),a()),i&2){let e=s.$implicit,r=m();o(),H(r.getFilteredKeys(e))}}var ea=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}scopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];getFilteredKeys(e){return Object.keys(e).filter(r=>+r!=1)}openExportModal(){this.matDialog.open(K,{data:{title:"Product Sales vs Logistics",exportTypes:[{ID:"ReportExport/GetProductSalesVsDelivery",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],standalone:!1,features:[W],decls:43,vars:18,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border",2,"width","15%"],[1,"border"],[1,"border",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Scope",3,"modelChange","model","options"],["colspan","2",1,"text-center","border"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Lc,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Product Sold "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Outlet "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Month "),a()(),n(16,"li")(17,"a",6),p(18," Product Tags Analysis "),a()(),n(19,"li")(20,"a",6),p(21," Top Suppliers "),a()(),n(22,"li")(23,"a",6),p(24," Quantity Sold Chart "),a()()()()(),n(25,"filters"),E(26,Rc,16,10,"ng-template",null,0,O),a(),n(28,"content")(29,"div",7)(30,"table",8)(31,"thead",9),S(32,Wc,5,0,"tr"),n(33,"tr")(34,"th",10),p(35,"Name"),a(),n(36,"th",11),p(37,"Code"),a(),G(38,Nc,2,1,"th",12,Y),a()(),n(40,"tbody"),G(41,Qc,3,0,"tr",11,Y),a()()()()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Fc)),o(3),c("routerLink",M(13,Ic)),o(3),c("routerLink",M(14,bc)),o(3),c("routerLink",M(15,Ec)),o(3),c("routerLink",M(16,Mc)),o(3),c("routerLink",M(17,Vc)),o(9),y((t.data==null?null:t.data.Outlet.length)>0?32:-1),o(6),H(t.data==null?null:t.data.Header),o(3),H(t.data==null?null:t.data.Data))},dependencies:[A,Q,J,L,R,Te,Ce,U],encapsulation:2})};var Yc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],jc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],qc=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],Uc=()=>({"min-width":"50rem","font-family":"Roboto, sans-serif"}),Zr=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],zc=(i,s,e)=>({CategoryID:i,From:s,To:e}),Kc=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"],$r=i=>({CategoryID:i});function Xc(i,s){if(i&1){let e=I();n(0,"button",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function Jc(i,s){if(i&1&&(n(0,"span",23),p(1),a()),i&2){let e=s.item;c("matTooltip",Ct(e.Value)),o(),F(e.Value)}}function Zc(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),E(10,Jc,2,3,"ng-template",14),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(15,"div",16)(16,"datepicker",17),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",18),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",19),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a(),n(29,"h6"),p(30,"Product Type"),a(),n(31,"radio-options",22),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),C("ngModel",e.pageData.Filter.BrandID),o(5),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),C("model",e.pageData.Filter.ExcludeZero),o(3),C("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes)}}function $c(i,s){i&1&&(n(0,"th",43),p(1," Cost "),b(2,"p-treeTableSortIcon",44),a())}function ed(i,s){i&1&&(n(0,"th",45),p(1," Profit "),b(2,"p-treeTableSortIcon",46),a())}function td(i,s){i&1&&(n(0,"th",47),p(1," % "),b(2,"p-treeTableSortIcon",48),a())}function id(i,s){if(i&1&&(n(0,"tr",29)(1,"th",30),p(2," Category "),b(3,"p-treeTableSortIcon",31),a(),n(4,"th",32),p(5," Qty "),b(6,"p-treeTableSortIcon",33),a(),E(7,$c,3,0,"th",34),n(8,"th",35),p(9," Gross "),b(10,"p-treeTableSortIcon",36),a(),n(11,"th",37),p(12," Disc "),b(13,"p-treeTableSortIcon",38),a(),n(14,"th",39),p(15," Sales "),b(16,"p-treeTableSortIcon",40),a(),E(17,ed,3,0,"th",41)(18,td,3,0,"th",42),a()),i&2){let e=m(2);o(7),c("ngIf",e.roleService.product.Cost),o(10),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function nd(i,s){if(i&1&&(n(0,"td",57)(1,"span",23),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.CostInDirect&&e.Cost?"Direct ("+g(2,3,e.Cost)+") Indirect ("+g(3,5,e.CostInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedCost))}}function ad(i,s){if(i&1&&(n(0,"td",58)(1,"span",23),d(2,"number"),d(3,"number"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().rowData;o(),c("matTooltip",Ct(e.ProfitInDirect&&e.Profit?"Direct ("+g(2,3,e.Profit)+") Indirect ("+g(3,5,e.ProfitInDirect)+")":"")),o(3),F(g(5,7,e.DisplayedProfit))}}function od(i,s){if(i&1&&(n(0,"span",23),d(1,"number"),d(2,"number"),p(3),d(4,"number"),a()),i&2){let e=m(2).rowData;c("matTooltip",Ct(e.PercentageInDirect&&e.Percentage?"Direct ("+v(1,3,e.Percentage,"1.0-2")+") Indirect ("+v(2,6,e.PercentageInDirect,"1.0-2")+")":"")),o(3),D("",g(4,9,e.DisplayedPercentage),"%")}}function rd(i,s){if(i&1&&(n(0,"td"),E(1,od,5,11,"span",59),a()),i&2){let e=m(3);o(),c("ngIf",e.roleService.report.Profit)}}function ld(i,s){if(i&1&&(n(0,"tr",49)(1,"td"),b(2,"p-treeTableToggler",50),n(3,"a",51),d(4,"date"),d(5,"date"),p(6),a()(),n(7,"td")(8,"span",23),d(9,"number"),d(10,"number"),p(11),d(12,"quantityFraction"),a()(),E(13,nd,6,9,"td",52),n(14,"td",53)(15,"span",23),d(16,"number"),d(17,"number"),p(18),d(19,"amountFraction"),a()(),n(20,"td",54)(21,"a",55),d(22,"number"),d(23,"number"),p(24),d(25,"amountFraction"),a()(),n(26,"td",53)(27,"span",23),d(28,"number"),d(29,"number"),n(30,"a",51),p(31),d(32,"amountFraction"),a()()(),E(33,ad,6,9,"td",56)(34,rd,2,1,"td",7),a()),i&2){let e=s.$implicit,r=s.rowData,t=m(2);c("ttRow",e),o(2),c("rowNode",e),o(),c("routerLink",M(54,Zr))("queryParams",_t(55,zc,r.ID,v(4,24,t.pageData.Filter.From,"yyyy-MM-dd"),v(5,27,t.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(r.Name),o(2),c("matTooltip",Ct(r.QuantityIndirect&&r.Quantity?"Direct ("+g(9,30,r.Quantity)+") Indirect ("+g(10,32,r.QuantityIndirect)+")":"")),o(3),F(g(12,34,r.DisplayedQuantity)),o(2),c("ngIf",t.roleService.product.Cost),o(2),c("matTooltip",Ct(r.GrossIndirect&&r.GrossSales?"Direct ("+g(16,36,r.GrossSales)+") Indirect ("+g(17,38,r.GrossIndirect)+")":"")),o(3),F(g(19,40,r.DisplayedGross)),o(3),c("matTooltip",Ct(r.DiscountIndirect&&r.Discount?"Direct ("+g(22,42,r.Discount)+") Indirect ("+g(23,44,r.DiscountIndirect)+")":""))("routerLink",M(59,Kc))("queryParams",X(60,$r,r.ID)),o(3),F(g(25,46,r.DisplayedTotalDiscount)),o(3),c("matTooltip",Ct(r.NetSalesIndirect&&r.Sales?"Direct ("+g(28,48,r.Sales)+") Indirect ("+g(29,50,r.NetSalesIndirect)+")":"")),o(3),c("routerLink",M(62,Zr))("queryParams",X(63,$r,r.ID)),o(),F(g(32,52,r.DisplayedNetSales)),o(2),c("ngIf",t.roleService.report.Profit),o(),c("ngIf",t.roleService.report.Profit)}}function pd(i,s){if(i&1&&(n(0,"td",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalCost)," ")}}function md(i,s){if(i&1&&(n(0,"td",65),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalProfit)," ")}}function sd(i,s){if(i&1&&(n(0,"td",61),p(1),d(2,"number"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Aggregate.TotalPercentage),"% ")}}function cd(i,s){if(i&1&&(n(0,"tr",60)(1,"td",61),p(2,"Total :"),a(),n(3,"td",61),p(4),d(5,"quantityFraction"),a(),E(6,pd,3,3,"td",62),n(7,"td",63)(8,"a"),p(9),d(10,"amountFraction"),a()(),n(11,"td",61),p(12),d(13,"amountFraction"),a(),n(14,"td",63),p(15),d(16,"amountFraction"),a(),E(17,md,3,3,"td",62)(18,sd,3,3,"td",64),a()),i&2){let e=m(2);o(4),D(" ",g(5,7,e.data.Aggregate.TotalQuantity)," "),o(2),c("ngIf",e.roleService.product.Cost),o(3),F(g(10,9,e.data.Aggregate.TotalGross)),o(3),D(" ",g(13,11,e.data.Aggregate.TotalDiscount)," "),o(3),D(" ",g(16,13,e.data.Aggregate.TotalNetSales)," "),o(2),c("ngIf",e.roleService.report.Profit),o(),c("ngIf",e.roleService.report.Profit)}}function dd(i,s){if(i&1&&(n(0,"content")(1,"div",24)(2,"p-treeTable",25),E(3,id,19,3,"ng-template",26)(4,ld,35,65,"ng-template",27)(5,cd,19,15,"ng-template",28),a()()()),i&2){let e=m();o(2),c("value",e.data.data)("scrollable",!0)("scrollable",!0)("tableStyle",M(4,Uc))}}var ta=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CategorySales_TopCategory","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales"]],standalone:!1,features:[W],decls:20,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["name","render-ProductType",3,"modelChange","model","options"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],[1,"custom-header"],["ttSortableColumn","Name",1,"text-uppercase"],["field","Name"],["ttSortableColumn","DisplayedQuantity",1,"text-uppercase"],["field","DisplayedQuantity"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedCost",4,"ngIf"],["ttSortableColumn","DisplayedGross",1,"text-uppercase",2,"width","150px"],["field","DisplayedGross"],["ttSortableColumn","DisplayedTotalDiscount",1,"text-uppercase"],["field","DisplayedTotalDiscount"],["ttSortableColumn","DisplayedNetSales",1,"text-uppercase",2,"width","150px"],["field","DisplayedNetSales"],["style","width: 120px","class","text-uppercase","ttSortableColumn","DisplayedProfit",4,"ngIf"],["class","text-uppercase","ttSortableColumn","DisplayedPercentage",4,"ngIf"],["ttSortableColumn","DisplayedCost",1,"text-uppercase",2,"width","120px"],["field","DisplayedCost"],["ttSortableColumn","DisplayedProfit",1,"text-uppercase",2,"width","120px"],["field","DisplayedProfit"],["ttSortableColumn","DisplayedPercentage",1,"text-uppercase"],["field","DisplayedPercentage"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],["style","width: 120px","class","text-danger",4,"ngIf"],[2,"width","150px"],[1,"text-danger"],["matTooltipPosition","above",3,"routerLink","queryParams","matTooltip"],["style","width: 120px","class","text-success",4,"ngIf"],[1,"text-danger",2,"width","120px"],[1,"text-success",2,"width","120px"],["matTooltipPosition","above",3,"matTooltip",4,"ngIf"],[1,"table-footer"],[1,"text-end"],["style","width: 120px","class","text-end",4,"ngIf"],[1,"text-end",2,"width","150px"],["class","text-end",4,"ngIf"],[1,"text-end",2,"width","120px"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,Xc,3,0,"button",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," List View "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",6),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),E(17,Zc,32,17,"ng-template",null,0,O),a(),E(19,dd,6,5,"content",7),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(10,Yc)),o(3),c("routerLink",M(11,jc)),o(3),c("routerLink",M(12,qc)),o(5),c("ngIf",t.data))},dependencies:[A,it,Q,$,J,L,R,ie,Te,Ae,Fr,fn,Mr,Ir,br,Er,Ce,U,ze,Mn,re,oe,Z,ne],styles:[".p-treetable-scrollable-header-box{padding-right:0!important} .p-treetable .p-treetable-thead>tr>th:not(:first-child){text-align:right!important} .p-treetable .p-treetable-tbody>tr>td:not(:first-child){text-align:right!important} .p-treetable-scrollable-footer-box{padding-right:0!important} .table-header-styles, .p-treetable-tfoot td, .p-treetable-thead th{background:#f6f6f6!important;color:#3b3b3b!important;text-transform:uppercase!important;font-weight:700!important;line-height:25px!important;font-size:12px!important;font-family:Roboto,sans-serif!important} .p-component.p-iconwrapper>svg{height:11px!important} .p-treetable .p-treetable-tbody>tr>td{border-bottom-width:1px;border-color:#dee2e6}"]})};var ud=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],_d=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],gd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"];function Cd(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function fd(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(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),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Customer"),a(),n(15,"autocompleteV2",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.CustomerID)}}function xd(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function hd(i,s){if(i&1&&(n(0,"span"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Value)}}function Sd(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Value))}}function yd(i,s){if(i&1&&(n(0,"td"),S(1,hd,2,1,"span"),S(2,Sd,3,3,"span"),a()),i&2){let e=s.$implicit;o(),y(e.Key=="Category"?1:-1),o(),y(e.Key!="Category"?2:-1)}}function Dd(i,s){if(i&1&&(n(0,"tr"),G(1,yd,3,2,"td",null,Y),a()),i&2){let e=s.$implicit;o(),H(e)}}function vd(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e))}}function wd(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",20)(2,"td"),p(3,"Total : "),a(),G(4,vd,3,3,"td",null,Y),a()()),i&2){let e=m(2);o(4),H(e.data.Sum)}}function Td(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",17),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",18)(3,"tr"),G(4,xd,2,2,"th",19,Y),a()(),n(6,"tbody"),G(7,Dd,3,0,"tr",null,Y),a(),S(9,wd,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var ia=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet",null,null,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}openExportModal(){this.matDialog.open(K,{data:{title:"Category Sales by Outlet",exportTypes:[{ID:"ReportExport/CategorySalesByOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T]){let Ze=t.find(Ai=>Ai.Key===[this.data.Dataheader[T]].toString()).Value,Ni=l.find(Ai=>Ai.Key===[this.data.Dataheader[T]].toString()).Value;return this.compare(Ze,Ni,h)}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category-sales-by-outlet"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Cd,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Tree View "),a()(),n(10,"li")(11,"a",6),p(12," List View "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,fd,16,9,"ng-template",null,0,O),a(),n(19,"content"),S(20,Td,10,1,"div",7),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(10,ud)),o(3),c("routerLink",M(11,_d)),o(3),c("routerLink",M(12,gd)),o(6),y(t.data?20:-1))},dependencies:[A,Q,J,L,R,pe,ge,Ae,Ce,U,Z],encapsulation:2})};var Pd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],Fd=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold"],Id=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"];function bd(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Month"),a(),n(3,"ng-select",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),C("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies)}}function Ed(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",11),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var na=class i extends me{constructor(e,r){super(e,r,"Report/CategoryChart","ReportLoader/CategoryChartLoader");this.httpService=r}Months=V.Months;Years=V.GenerateYears(new Date().getFullYear(),11,!0);pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};PieData={};postInit(){this.PieData=this.data.filter(e=>e.GrossSales>0).map(e=>({name:e.Name,y:e.SalesPercentage}))}static \u0275fac=function(r){return new(r||i)(w(N),w(k))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-category"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Tree View "),a()(),n(9,"li")(10,"a",5),p(11," List View "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Outlet "),a()()()()(),n(15,"filters"),E(16,bd,10,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,Ed,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(7),c("routerLink",M(8,Pd)),o(3),c("routerLink",M(9,Fd)),o(3),c("routerLink",M(10,Id)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,R,ii],encapsulation:2})};var Md=()=>["/menu/Reports/Sales_Report/Standard/Peak/Peak"];function Vd(i,s){if(i&1){let e=I();n(0,"div",4)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",5),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",6),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",7)(9,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Sales Order Tag"),a(),n(12,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("items",e.pageData.Options.SalesOrderTagIDs),C("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("multiple",!0)}}function Bd(i,s){if(i&1&&(n(0,"content")(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div",14)(6,"div",15)(7,"p",16),p(8,"Transaction Per Hour"),a()(),n(9,"div",17),b(10,"POS-line-chart",18),a()()()(),n(11,"div",12)(12,"div",13)(13,"div",14)(14,"div",15)(15,"p",16),p(16,"Transaction Per Session"),a()(),n(17,"div",17),b(18,"POS-pie-chart",18),a()()()()()()()),i&2){let e=m();o(10),c("config",e.chartConfig)("data",e.ChartData),o(8),c("config",e.pieConfig)("data",e.PieData)}}var aa=class i extends De{constructor(e,r,t){super(e,r,"Report/PeakHour","ReportLoader/PeakHourLoader");this.httpService=r;this.roleService=t}categories=[];PieData={};ChartData={};pieConfig;chartConfig;postInit(){this.menuData.H=this.data.PageTitle;let e=new Date,r=[],t=[];this.data.Data.forEach(l=>{r.push(l.Name);let h={name:l.Name+": "+l.Description,y:l.Transaction};t.push(h)}),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,h){return l+"<br/>"+h.series.name+": <b>"+h.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-peak-hour"]],standalone:!1,features:[W],decls:9,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["bindLabel","Name","bindValue","ID","appendTo","body","placeholder","Select sales order tag",3,"ngModelChange","items","ngModel","multiple"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-6"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),b(3,"i",3),p(4," Table View"),a()(),n(5,"filters"),E(6,Vd,13,9,"ng-template",null,0,O),a(),S(8,Bd,19,4,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("routerLink",M(6,Md)),o(6),y(t.data?8:-1))},dependencies:[A,Q,$,J,L,R,ii,Mt,U],encapsulation:2})};function Od(i,s){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function Ld(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function Rd(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"number"),a(),n(10,"td",17),p(11),d(12,"amountFraction"),a(),n(13,"td",17),p(14),d(15,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(g(3,5,e.Visitor)),o(3),F(g(6,7,e.Orders)),o(3),F(g(9,9,e.TotalVisitor)),o(3),F(g(12,11,e.Sales)),o(3),F(g(15,13,e.Sales/(e.Visitor*e.Orders)))}}function kd(i,s){if(i&1&&(n(0,"div",3)(1,"table",11)(2,"thead",12)(3,"tr")(4,"th",13),p(5,"Number of Person"),a(),n(6,"th",14),p(7,"Orders"),a(),n(8,"th",14),p(9,"Total Visitor"),a(),n(10,"th",14),p(11,"Sales"),a(),n(12,"th",15),p(13,"Average Spending"),a()()(),n(14,"tbody"),G(15,Rd,16,15,"tr",null,Y),a(),n(17,"tfoot")(18,"tr",16)(19,"td",17),p(20,"Total"),a(),n(21,"td",17),p(22),d(23,"sum"),d(24,"number"),a(),n(25,"td",17),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",17),p(30),d(31,"sum"),d(32,"amountFraction"),a(),n(33,"td",17),p(34),d(35,"amountFraction"),a()()()()()),i&2){let e=m();o(15),H(e.data),o(7),F(g(24,7,v(23,4,e.data,"Orders"))),o(4),F(g(28,12,v(27,9,e.data,"TotalVisitor"))),o(4),F(g(32,17,v(31,14,e.data,"Sales"))),o(4),F(g(35,19,e.getSpendingPerPersonSum(e.data)))}}var oa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}getSpendingPerPersonSum(e){return e.reduce((r,t)=>r+t.Sales/(t.Visitor*t.Orders),0)}openExportModal(){this.matDialog.open(K,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-visitor"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Od,3,0,"a",2),a(),n(3,"filters"),E(4,Ld,10,6,"ng-template",null,0,O),a(),n(6,"content"),S(7,kd,36,21,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,J,L,R,U,se,re,Z],encapsulation:2})};var Wd=()=>["/menu/Reports/Sales_Report/Standard/Peak"];function Nd(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function Ad(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",19),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",20)(9,"datepicker",21),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function Gd(i,s){i&1&&(n(0,"th",10),p(1,"Revenue"),a())}function Hd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Revenue))}}function Qd(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",13),p(4),d(5,"number"),a(),n(6,"td",13),p(7),d(8,"quantityFraction"),a(),n(9,"td",13),p(10),d(11,"amountFraction"),a(),n(12,"td",14),p(13),d(14,"RoundUp"),d(15,"amountFraction"),a(),n(16,"td",13),p(17),d(18,"RoundUp"),d(19,"amountFraction"),a(),S(20,Hd,3,3,"td",13),a()),i&2){let e=s.$implicit,r=m();o(2),F(e.TimeFormat),o(2),F(g(5,7,e.Count)),o(3),F(g(8,9,e.Quantity)),o(3),F(g(11,11,e.Sales)),o(3),F(g(15,15,g(14,13,e.Tax))),o(4),F(g(19,19,g(18,17,e.SalesWithTax))),o(3),y(r.roleService.product.Cost||r.roleService.report.Profit?20:-1)}}function Yd(i,s){if(i&1&&(n(0,"td",13),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m();o(),F(g(3,4,v(2,1,e.data==null?null:e.data.Data,"Revenue")))}}var ra=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/GetPeakHourList","ReportLoader/PeakHourLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(K,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-table-view"]],standalone:!1,features:[W],decls:56,vars:43,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Nd,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Ad,10,6,"ng-template",null,0,O),a(),n(9,"content")(10,"div",5)(11,"table",6)(12,"thead",7)(13,"tr")(14,"th",8),p(15,"Time"),a(),n(16,"th",9),p(17,"Orders"),a(),n(18,"th",9),p(19,"Quantity"),a(),n(20,"th",10),p(21,"Sales"),a(),n(22,"th",10),p(23,"Tax"),a(),n(24,"th",10),p(25,"Sales + Tax"),a(),S(26,Gd,2,0,"th",10),a()(),n(27,"tbody"),G(28,Qd,21,21,"tr",null,Y),a(),n(30,"tfoot")(31,"tr",11),b(32,"td",12),n(33,"td",13),p(34),d(35,"sum"),d(36,"number"),a(),n(37,"td",13),p(38),d(39,"sum"),d(40,"quantityFraction"),a(),n(41,"td",13),p(42),d(43,"sum"),d(44,"amountFraction"),a(),n(45,"td",14),p(46),d(47,"sum"),d(48,"RoundUp"),d(49,"amountFraction"),a(),n(50,"td",13),p(51),d(52,"sum"),d(53,"RoundUp"),d(54,"amountFraction"),a(),S(55,Yd,4,6,"td",13),a()()()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(42,Wd)),o(23),y(t.roleService.product.Cost||t.roleService.report.Profit?26:-1),o(2),H(t.data==null?null:t.data.Data),o(6),F(g(36,16,v(35,13,t.data==null?null:t.data.Data,"Count"))),o(4),F(g(40,21,v(39,18,t.data==null?null:t.data.Data,"Quantity"))),o(4),F(g(44,26,v(43,23,t.data==null?null:t.data.Data,"Sales"))),o(4),F(g(49,33,g(48,31,v(47,28,t.data==null?null:t.data.Data,"Tax")))),o(5),F(g(54,40,g(53,38,v(52,35,t.data==null?null:t.data.Data,"SalesWithTax")))),o(4),y(t.roleService.product.Cost||t.roleService.report.Profit?55:-1))},dependencies:[A,Q,J,L,R,U,se,Cr,re,Z,ne],encapsulation:2})};var jd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],So=(i,s)=>({From:i,To:s}),qd=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Ud=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function zd(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",10),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)}}function Kd(i,s){if(i&1&&(n(0,"content")(1,"div",11),b(2,"POS-line-chart",12),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var la=class i extends me{maxFilterDate;minFilterDate;ChartData={};chartConfig;constructor(s,e,r){super(s,e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,r),this.initValidateFilterDate()}preInitList(){let s=this.route.snapshot.queryParams;s.From&&(this.pageData.Filter.From=s.From,this.pageData.Filter.To=s.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,90)}preGetList(){this.generateChartCategories()}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle,this.initChartConfig()}initChartConfig(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.generateChartCategories()},yAxis:{title:{text:""}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let s=new Date(this.pageData.Filter.From),e=new Date(this.pageData.Filter.To);return V.getDatesInRange(s,e).map(l=>`${l.getDate()} ${V.Months[l.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(s){this.pageData.Filter.From=s.from,this.pageData.Filter.To=s.to}static \u0275fac=function(e){return new(e||i)(w(N),w(k),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily-sales"]],standalone:!1,features:[W],decls:19,vars:23,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],[3,"dateChange","from","to","maxDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,r){if(e&1){let t=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(t),_(r.searchFromPageOne())}),x("filterChange",function(h){return u(t),f(r.pageData.Filter,h)||(r.pageData.Filter=h),_(h)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Table View "),a()(),n(9,"li")(10,"a",5),p(11," Daily Quantity Sold "),a()(),n(12,"li")(13,"a",5),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),E(16,zd,13,11,"ng-template",null,0,O),a(),S(18,Kd,3,2,"content"),a()}e&2&&(c("pageData",r.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",r.pageData.Filter),o(7),c("routerLink",M(11,jd))("queryParams",fe(12,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(15,qd))("queryParams",fe(16,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(3),c("routerLink",M(19,Ud))("queryParams",fe(20,So,r.pageData.Filter==null?null:r.pageData.Filter.From,r.pageData.Filter==null?null:r.pageData.Filter.To)),o(5),y(r.data?18:-1))},dependencies:[A,Q,$,L,R,Mt,Gt,Ce,U],encapsulation:2})};var $d={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},pi=class i{date;dateChange=new ln;width;minDate=V.MinDate;constructor(){}ngOnInit(){}setMonthAndYear(s,e){let r=null;s&&(r=s.toDate(),r.setHours(0,0,0,0)),this.date=r,this.dateChange.emit(r),e.close()}onDateChange(s){let e=null;s&&(e=s.toDate()),this.date=e,this.dateChange.emit(e)}onOpenDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){let s=document.getElementById("dropdown-filter");if(s){var e=new bootstrap.Dropdown(s);e&&(e._config.autoClose="outside")}}t;chosenYearHandler(s,e){let r=new Date(s.getFullYear(),0,1);this.date=r.toISOString(),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},features:[Ci([{provide:yn,useClass:Nn,deps:[Sn,wr]},{provide:Dn,useValue:$d}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker"],["matInput","",3,"dateChange","matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected","monthSelected","opened","closed"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("dateChange",function(h){return u(t),_(r.onDateChange(h.value))}),a(),b(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(h){u(t);let T=Dt(4);return _(r.chosenYearHandler(h,T))})("monthSelected",function(h){u(t);let T=Dt(4);return _(r.setMonthAndYear(h,T))})("opened",function(){return u(t),_(r.onOpenDatepicker())})("closed",function(){return u(t),_(r.onCloseDatepicker())}),a()()}if(e&2){let t=Dt(4);qt("width",r.width||100,"%"),o(),c("matDatepicker",t)("value",r.date==r.minDate?null:r.date),o(),c("for",t)}},dependencies:[At,In,yi,Tn,Pn,Fn,Di,En,wn,vn,bn],styles:[`.mat-mdc-form-field-disabled .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above,.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:50px!important}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
2
2
|
`],encapsulation:2})};var tu=()=>["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"];function iu(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker-year-month",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(8,"div",9)(9,"datepicker-year-month",8),x("dateChange",function(t){u(e);let l=m();return f(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),x("ngModelChange",function(t){u(e);let l=m();return f(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),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(19,"h6"),p(20,"Multiply Unit Qty"),a(),n(21,"radio-options",13),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.LastYear),c("items",e.optionsCompareYear),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),C("model",e.pageData.Filter.MultiplyUnitQuantity)}}function nu(i,s){if(i&1&&(n(0,"div",5),b(1,"POS-line-chart",14),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var ma=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance");this.httpService=r;this.csvConverter=t}chartData={Series:[]};chartConfig;currency=-1;optionsCompareYear=[{value:1,label:"Last one year"},{value:2,label:"Last two year"}];onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=this.generateSeries();this.chartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:void 0},labels:{formatter:function(){return V.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r,t="",l=Math.abs(this.total);return l>999&&l<1e10?(t="K",r=(l/1e3).toFixed(0)):l>=1e10?(t="M",r=(l/1e6).toFixed(0)):l<999&&(r=l.toString()),this.total<0&&(r="-"+r),r.replace(/\B(?=(\d{3})+(?!\d))/g,",")+t}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series,t=this.point?.stackTotal;r=r.filter(Ze=>this.series?.name==Ze?.name);let l=[],h="",T=this.point.index;return r.forEach(Ze=>{Ze.options.stack===this.point.series.options.stack&&(l=Ze.name.split(" "),h+=`
|
|
3
3
|
<b>${this.point.category}</b></br>Total:
|
|
4
4
|
${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(t)}</br>${l[0]}:
|
|
5
5
|
${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(Ze.points[T].y)}</br>
|
|
6
|
-
`)}),h}}}}generateSeries(){let e,r=[];return r=this.data.MonthlySalesRank.map(t=>(e={name:`${t.Name} ${t.CompareYear}`,data:t.Sales,stack:t.Year},e)),r}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-sales"]],standalone:!1,features:[W],decls:11,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"dateChange","date"],[1,"mt-4"],["appendTo","body","bindValue","value","bindLabel","label","placeholder","Compare To Year",3,"ngModelChange","ngModel","items"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],["name","Inventory",3,"modelChange","model"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"a",3),b(4,"i",4),p(5,"Table View"),a()()(),n(6,"filters"),E(7,iu,22,13,"ng-template",null,0,O),a(),n(9,"content"),S(10,nu,2,2,"div",5),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(3),c("routerLink",M(6,tu)),o(7),y(t.data?10:-1))},dependencies:[A,Q,$,L,R,ie,Te,Mt,pi,Ce,U],encapsulation:2})};var au=()=>["/menu/Reports/Sales_Report/Standard/Yearly"],ou=(i,s)=>({"text-success":i,"text-danger":s}),el=(i,s)=>({"text-success fw-bold":i,"text-danger fw-bold":s});function ru(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function lu(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year to Compare"),a(),n(12,"div",12)(13,"div",13)(14,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.FromYear,t)||(l.pageData.Filter.FromYear=t),_(t)}),a()(),n(15,"div",13)(16,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ToYear,t)||(l.pageData.Filter.ToYear=t),_(t)}),a()()(),n(17,"h6"),p(18,"Sales Order Tag"),a(),n(19,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(20,"h6"),p(21,"Currency"),a(),n(22,"ng-select",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Option.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.SalesID),o(5),C("ngModel",e.pageData.Filter.FromYear),c("items",e.Years),o(2),C("ngModel",e.pageData.Filter.ToYear),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Option==null?null:e.pageData.Option.Types),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Option.Currencies)}}function pu(i,s){if(i&1&&(n(0,"th",21),d(1,"GetChildrenArray"),d(2,"sum"),p(3),a()),i&2){let e=s.$implicit,r=m(2);c("colSpan",v(2,5,r.filterSales(v(1,2,r.data.Data,"Sales"),"Year",e),"Tax")==0?1:3),o(3),D(" ",e)}}function mu(i,s){i&1&&(n(0,"th",27),p(1," Sales"),a())}function su(i,s){i&1&&(n(0,"th",28),p(1," Tax"),a())}function cu(i,s){if(i&1&&(S(0,mu,2,0,"th",27),d(1,"GetChildrenArray"),d(2,"sum"),S(3,su,2,0,"th",28),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"th",28),p(7," Sales + Tax"),a()),i&2){let e=s.$implicit,r=m(2);y(v(2,5,r.filterSales(v(1,2,r.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,11,r.filterSales(v(4,8,r.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1)}}function du(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m(2);o(),D(" ",g(3,4,v(2,1,t.filterSales(r.Sales,"Year",e),"Sales")))}}function uu(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m(2);o(),D(" ",g(3,4,v(2,1,t.filterSales(r.Sales,"Year",e),"Tax"))," ")}}function _u(i,s){if(i&1&&(S(0,du,4,6,"td",28),d(1,"GetChildrenArray"),d(2,"sum"),S(3,uu,4,6,"td",28),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"td",28),p(7),d(8,"sum"),d(9,"amountFraction"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m(2);y(v(2,6,t.filterSales(v(1,3,t.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,12,t.filterSales(v(4,9,t.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1),o(4),D(" ",g(9,18,v(8,15,t.filterSales(r.Sales,"Year",e),"SalesWithTax")))}}function gu(i,s){if(i&1&&(n(0,"tr",23)(1,"td"),p(2),d(3,"Month"),a(),G(4,_u,10,20,null,null,Y),n(6,"td",26),d(7,"sum"),d(8,"sum"),p(9),d(10,"sum"),d(11,"number"),a(),n(12,"td",26),d(13,"sum"),d(14,"sum"),p(15),d(16,"sum"),d(17,"number"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(g(3,5,e.Month)),o(2),H(r.data.HeaderList),o(2),c("ngClass",fe(29,el,v(7,7,r.filterSales(e.Difference,"Month",e.Month),"Difference")>0,v(8,10,r.filterSales(e.Difference,"Month",e.Month),"Difference")<0)),o(3),D(" ",g(11,16,v(10,13,r.filterSales(e.Difference,"Month",e.Month),"Difference"))," "),o(3),c("ngClass",fe(32,el,v(13,18,r.filterSales(e.Difference,"Month",e.Month),"Percentage")>0,v(14,21,r.filterSales(e.Difference,"Month",e.Month),"Percentage")<0)),o(3),D(" ",g(17,27,v(16,24,r.filterSales(e.Difference,"Month",e.Month),"Percentage"))," ")}}function Cu(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(4,7,v(3,4,r.filterSales(v(2,1,r.data.Data,"Sales"),"Year",e),"Sales")))}}function fu(i,s){if(i&1&&(n(0,"td",30),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(4,7,v(3,4,r.filterSales(v(2,1,r.data.Data,"Sales"),"Year",e),"Tax")))}}function xu(i,s){if(i&1&&(S(0,Cu,5,9,"td",29),d(1,"GetChildrenArray"),d(2,"sum"),S(3,fu,5,9,"td",30),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"td",29),p(7),d(8,"GetChildrenArray"),d(9,"sum"),d(10,"amountFraction"),a()),i&2){let e=s.$implicit,r=m(2);y(v(2,6,r.filterSales(v(1,3,r.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,12,r.filterSales(v(4,9,r.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1),o(4),D(" ",g(10,21,v(9,18,r.filterSales(v(8,15,r.data.Data,"Sales"),"Year",e),"SalesWithTax")))}}function hu(i,s){if(i&1&&(n(0,"div",5)(1,"table",18)(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Month"),a(),G(6,pu,4,8,"th",21,Y),n(8,"th",22),p(9,"Diff"),a(),n(10,"th",22),p(11,"%"),a()(),n(12,"tr"),G(13,cu,8,14,null,null,Y),a()(),n(15,"tbody"),G(16,gu,18,35,"tr",23,Y),a(),n(18,"tfoot",24)(19,"tr")(20,"td",25),p(21,"Total :"),a(),G(22,xu,11,23,null,null,Y),n(24,"td",26),p(25),d(26,"number"),a()()()()()),i&2){let e=m();o(6),H(e.data.HeaderList),o(7),H(e.data.HeaderList),o(3),H(e.data.Data),o(6),H(e.data.HeaderList),o(2),c("ngClass",fe(4,ou,e.data.TotalDiff>0,e.data.TotalDiff<0)),o(),D(" ",g(26,2,e.data.TotalDiff))}}var sa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/YearlySalesList","ReportLoader/YearlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}subheader=["Sales","Tax","Sales+Tax"];prop=["Sales","Tax","SalesWithTax"];Years=V.GenerateYears(new Date().getFullYear(),11,!0);filterSales(e,r,t){return e.filter(function(l){return l[r]==t})}openExportModal(){this.matDialog.open(K,{data:{title:"Yearly",exportTypes:[{ID:"ReportExport/YearlySalesList",Value:"Default",FileName:"Yearly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-yearly"]],standalone:!1,features:[W],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[1,"row"],[1,"col-6"],["appendTo","body","placeholder","Choose Year From",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year To",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["rowspan","2"],[1,"text-center","border-start","border-end",3,"colSpan"],["rowspan","2",1,"text-end"],[1,"border-bottom"],[1,"table-footer"],[1,"fw-bold","text-success"],[1,"text-end",3,"ngClass"],[1,"text-end","border-start"],[1,"text-end"],[1,"text-end","text-success"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,ru,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,lu,23,15,"ng-template",null,0,O),a(),n(9,"content"),S(10,hu,27,7,"div",5),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,au)),o(7),y(t.data?10:-1))},dependencies:[A,tt,Q,$,L,R,ie,Ce,U,ze,se,Ln,fr,re,Z],encapsulation:2})};var Su=()=>["/menu/Reports/Sales_Report/Standard/Daily"],yo=(i,s)=>({From:i,To:s}),yu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Du=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"],tl=i=>({"is-weekend":i});function vu(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function wu(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",14),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(19,"h6"),p(20,"Sales Order Tag"),a(),n(21,"ng-select",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate),o(3),C("ngModel",e.pageData.Filter.DeliveryID),c("items",e.pageData.Options==null?null:e.pageData.Options.Deliveries),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function Tu(i,s){i&1&&(n(0,"th",26),p(1," Tax "),a())}function Pu(i,s){i&1&&(n(0,"th",27),p(1,"Net Sales + Tax"),a())}function Fu(i,s){i&1&&(n(0,"th",28),p(1,"Cost"),a())}function Iu(i,s){i&1&&(n(0,"th",29),p(1," Profit "),a())}function bu(i,s){i&1&&(n(0,"th",30),p(1," Profit + Tax Include "),a())}function Eu(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Tax))}}function Mu(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D("",g(2,1,e.SalesNetWithTax)," ")}}function Vu(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost))}}function Bu(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit))}}function Ou(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.ProfitWithTax>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.ProfitWithTax))}}function Lu(i,s){if(i&1&&(n(0,"tr",31)(1,"td",31),p(2),d(3,"date"),a(),n(4,"td"),p(5),d(6,"date"),a(),n(7,"td",33),p(8),d(9,"number"),a(),n(10,"td",33),p(11),d(12,"quantityFraction"),a(),n(13,"td",33),p(14),d(15,"amountFraction"),a(),n(16,"td",33),p(17),d(18,"amountFraction"),a(),S(19,Eu,3,3,"td",37),S(20,Mu,3,3,"td",33),S(21,Vu,3,3,"td",34),S(22,Bu,3,4,"td",36),S(23,Ou,3,4,"td",36),a()),i&2){let e=s.$implicit,r=m(2);c("ngClass",X(27,tl,r.data.DayOfWeekend)),o(),c("ngClass",X(29,tl,e.DayOfWeekend)),o(),D(" ",v(3,13,e.Day,"EEEE")," "),o(3),F(v(6,16,e.Day,"dd")),o(3),F(g(9,19,e.Count)),o(3),F(g(12,21,e.Quantity)),o(3),F(g(15,23,e.Gross)),o(3),F(g(18,25,e.SalesNet)),o(2),y(r.data.ShowTax?19:-1),o(),y(r.data.ShowTax?20:-1),o(),y(r.roleService.product.Cost?21:-1),o(),y(r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost?22:-1),o(),y(!r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost?23:-1)}}function Ru(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax")))}}function ku(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"SalesNetWithTax")))}}function Wu(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost")))}}function Nu(i,s){if(i&1&&(n(0,"td",35),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",v(1,2,e.data.Data,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.data.Data,"Profit")))}}function Au(i,s){if(i&1&&(n(0,"td",36),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",v(1,2,e.data.Data,"ProfitWithTax")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.data.Data,"ProfitWithTax")))}}function Gu(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Day"),a(),n(6,"th",21),p(7,"Dt."),a(),n(8,"th",22),p(9,"Orders "),a(),n(10,"th",23),p(11," Quantity"),a(),n(12,"th",24),p(13," Gross"),a(),n(14,"th",25),p(15," Net Sales"),a(),S(16,Tu,2,0,"th",26),S(17,Pu,2,0,"th",27),S(18,Fu,2,0,"th",28),S(19,Iu,2,0,"th",29),S(20,bu,2,0,"th",30),a()(),n(21,"tbody"),G(22,Lu,24,31,"tr",31,Y),a(),n(24,"tfoot")(25,"tr"),b(26,"td",32)(27,"td",32),n(28,"td",33),p(29),d(30,"sum"),d(31,"number"),a(),n(32,"td",33),p(33),d(34,"sum"),d(35,"quantityFraction"),a(),n(36,"td",33),p(37),d(38,"sum"),d(39,"amountFraction"),a(),n(40,"td",33),p(41),d(42,"sum"),d(43,"amountFraction"),a(),S(44,Ru,4,6,"td",33),S(45,ku,4,6,"td",33),S(46,Wu,4,6,"td",34),S(47,Nu,5,10,"td",35),S(48,Au,5,10,"td",36),a()()()()}if(i&2){let e=m();o(16),y(e.data.ShowTax?16:-1),o(),y(e.data.ShowTax?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?19:-1),o(),y(!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?20:-1),o(2),H(e.data.Data),o(7),F(g(31,17,v(30,14,e.data.Data,"Count"))),o(4),F(g(35,22,v(34,19,e.data.Data,"Quantity"))),o(4),F(g(39,27,v(38,24,e.data.Data,"Gross"))),o(4),F(g(43,32,v(42,29,e.data.Data,"SalesNet"))),o(3),y(e.data.ShowTax?44:-1),o(),y(e.data.ShowTax?45:-1),o(),y(e.roleService.product.Cost?46:-1),o(),y(e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?47:-1),o(),y(!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?48:-1)}}var ca=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/DailySalesList","ReportLoader/DailyReportSales",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.activatedRoute=T}maxFilterDate=new Date;originalData;hideMore=!0;postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data}preInitList(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";return this.compare(t[e.active],l[e.active],h)})}onFilterDateChange(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to}openExportModal(){this.matDialog.open(K,{data:{title:"Daily Sales Report",exportTypes:[{ID:"ReportExport/DailySalesExport",Value:"Default",FileName:"Daily Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily"]],standalone:!1,features:[W],decls:21,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to","maxDate"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["id","tableGrid","api","Report/DailySalesList","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Day",2,"width","90px"],["mat-sort-header","Date",1,"align-left",2,"width","42px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Gross","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNetWithTax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","ProfitWithTax","arrowPosition","before",1,"flex-right",2,"width","160px"],[3,"ngClass"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-danger",3,"ngClass"],[1,"text-end",3,"ngClass"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,vu,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Sales Chart "),a()(),n(10,"li")(11,"a",6),p(12," Daily Quantity Sold "),a()(),n(13,"li")(14,"a",6),p(15," Monthly Quantity Sold "),a()()()()(),n(16,"filters"),E(17,wu,22,16,"ng-template",null,0,O),a(),n(19,"content"),S(20,Gu,49,34,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Su))("queryParams",fe(13,yo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(16,yu))("queryParams",fe(17,yo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(20,Du))("queryParams",fe(21,yo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(6),y(t.data?20:-1))},dependencies:[A,tt,Q,$,L,R,pe,ge,Gt,Ce,U,ze,se,re,oe,Z,ne],encapsulation:2})};var Hu=()=>["/menu/Reports/Sales_Report/Standard/Monthly"];function Qu(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function Yu(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year"),a(),n(12,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(13,"h6"),p(14,"Multiply Unit Qty"),a(),n(15,"radio-options",13),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("model",e.pageData.Filter.MultiplyUnitQuantity)}}function ju(i,s){i&1&&(n(0,"th",19),p(1," Cost "),a())}function qu(i,s){i&1&&(n(0,"th",19),p(1," Profit "),a())}function Uu(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function zu(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Profit)," ")}}function Ku(i,s){if(i&1&&(n(0,"tr",28)(1,"td"),p(2),d(3,"Month"),a(),n(4,"td",23),p(5),d(6,"number"),a(),n(7,"td",23),p(8),d(9,"quantityFraction"),a(),E(10,Uu,3,3,"td",24),n(11,"td",23),p(12),d(13,"amountFraction"),a(),n(14,"td",23),p(15),d(16,"amountFraction"),a(),n(17,"td",25),p(18),d(19,"amountFraction"),a(),n(20,"td",26),p(21),d(22,"amountFraction"),a(),E(23,zu,3,3,"td",27),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(g(3,9,e.Month)),o(3),F(g(6,11,e.Count)),o(3),D(" ",g(9,13,e.Quantity)," "),o(2),c("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit),o(2),D(" ",g(13,15,e.Gross)," "),o(3),D(" ",g(16,17,e.Sales)," "),o(3),D(" ",g(19,19,e.Tax)," "),o(3),F(g(22,21,e.SalesNetWithTax)),o(2),c("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit)}}function Xu(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function Ju(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Profit"))," ")}}function Zu(i,s){if(i&1&&(n(0,"div",14)(1,"table",15)(2,"thead",16)(3,"tr")(4,"th",17),p(5,"Month"),a(),n(6,"th",18),p(7,"Orders"),a(),n(8,"th",19),p(9,"Quantity"),a(),E(10,ju,2,0,"th",20),n(11,"th",19),p(12,"Gross"),a(),n(13,"th",19),p(14,"Sales"),a(),n(15,"th",19),p(16,"Tax"),a(),n(17,"th",19),p(18,"Sales + Tax"),a(),E(19,qu,2,0,"th",20),a()(),n(20,"tbody"),E(21,Ku,24,23,"tr",21),a(),n(22,"tfoot")(23,"tr",22),b(24,"td"),n(25,"td",23),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",23),p(30),d(31,"sum"),d(32,"quantityFraction"),a(),E(33,Xu,4,6,"td",24),n(34,"td",23),p(35),d(36,"sum"),d(37,"amountFraction"),a(),n(38,"td",23),p(39),d(40,"sum"),d(41,"amountFraction"),a(),n(42,"td",25),p(43),d(44,"sum"),d(45,"amountFraction"),a(),n(46,"td",26),p(47),d(48,"sum"),d(49,"amountFraction"),a(),E(50,Ju,4,6,"td",27),a()()()()),i&2){let e=m();o(10),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(9),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),c("ngForOf",e.data.Data),o(5),D(" ",g(28,14,v(27,11,e.data.Data,"Count"))," "),o(4),D(" ",g(32,19,v(31,16,e.data.Data,"Quantity"))," "),o(3),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),D(" ",g(37,24,v(36,21,e.data.Data,"Gross"))," "),o(4),D(" ",g(41,29,v(40,26,e.data.Data,"Sales"))," "),o(4),D(" ",g(45,34,v(44,31,e.data.Data,"Tax"))," "),o(4),D(" ",g(49,39,v(48,36,e.data.Data,"SalesNetWithTax"))," "),o(3),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit)}}var da=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/MonthlySalesList","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}Years=V.GenerateYears(new Date().getFullYear(),11,!0);preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Monthly",exportTypes:[{ID:"ReportExport/MonthlySalesList",Value:"Default",FileName:"Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly"]],standalone:!1,features:[W],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["name","Inventory",3,"modelChange","model"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","90px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end"],["class","text-end text-success",4,"ngIf"],[1,"border-bottom"],[1,"text-end","text-danger"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Qu,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Yu,16,10,"ng-template",null,0,O),a(),n(9,"content"),E(10,Zu,51,41,"div",5),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,Hu)),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,L,R,ie,Te,Ce,U,ze,se,Ln,re,Z,ne],encapsulation:2})};var $u=()=>["/menu/Reports/Sales_Report/Standard/Daily"],il=(i,s)=>({From:i,To:s}),e_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],t_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function i_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)("minDate",e.minFilterDate)}}function n_(i,s){if(i&1&&(n(0,"content")(1,"div",12),b(2,"POS-line-chart",13),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var ua=class i extends me{constructor(e,r,t,l){super(e,r,"Report/DailySalesVolume","ReportLoader/DailyReportSales",null,l);this.httpService=r;this.csvConverter=t;this.initValidateFilterDate()}maxFilterDate;minFilterDate;Years=V.GenerateYears(new Date().getFullYear(),11,!0);chartConfig;currency=-1;Months=V.Months;ChartData={};initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,45)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.getQueryParams(),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}getQueryParams(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To)}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){this.menuData.H=this.data.PageTitle,this.initChart()}initChart(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},yAxis:{title:{text:""}},xAxis:{categories:this.generateChartCategories()},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return V.getDatesInRange(e,r).map(h=>`${h.getDate()} ${V.Months[h.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(e){this.pageData.Filter.From=e.from?.toISOString(),this.pageData.Filter.To=e.to?.toISOString()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-volume"]],standalone:!1,features:[W],decls:19,vars:19,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dropdown-item",3,"routerLink"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"dateChange","from","to","maxDate","minDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",6),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),E(16,i_,13,12,"ng-template",null,0,O),a(),S(18,n_,3,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(7),c("routerLink",M(10,$u))("queryParams",fe(11,il,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(14,e_))("queryParams",fe(15,il,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(18,t_)),o(5),y(t.data?18:-1))},dependencies:[A,Q,$,L,R,Mt,Gt,Ce,U],encapsulation:2})};var a_=()=>["/menu/Reports/Sales_Report/Standard/Daily"],o_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],r_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"];function l_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Year"),a(),n(9,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function p_(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-line-chart",12),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.ChartData)}}var _a=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthtlySalesVolume","ReportLoader/MonthlySalesVolume");this.httpService=r;this.csvConverter=t}currency=-1;Years=V.GenerateYears(new Date().getFullYear(),11,!0);ChartData={};chartConfig;preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=[];this.data.MonthlySalesRank.forEach(r=>{let t=r.Sales.map(h=>parseInt(h)),l={name:r.Name,data:t};e.push(l)}),this.ChartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-volume"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",5),p(14," Daily Quantity Sold "),a()()()()(),n(15,"filters"),E(16,l_,13,9,"ng-template",null,0,O),a(),n(18,"content"),S(19,p_,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(7),c("routerLink",M(8,a_)),o(3),c("routerLink",M(9,o_)),o(3),c("routerLink",M(10,r_)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,R,Mt,Ce,U],encapsulation:2})};var m_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],s_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],c_=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"];function d_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",8),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",11)(12,"datepicker",12),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function u_(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",13),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var ga=class i extends me{constructor(e,r){super(e,r,"Report/OutletPerformanceCart","ReportLoader/OutletPerformance");this.httpService=r}PieData={};pieConfig={title:"",dataLabels:!0,labelTooltips:"Sales",height:400,legend:{}};postInit(){this.getPieData(),this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getPieData(){let e=[],r=[];this.data.DataWithoutCategory.length>0&&this.data.DataWithoutCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.data.DataWithCategory.length>0&&this.data.DataWithCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.PieData=r}static \u0275fac=function(r){return new(r||i)(w(N),w(k))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-graphic"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Outlet Performance "),a()(),n(9,"li")(10,"a",5),p(11," Compare by Outlet Group "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Month "),a()()()()(),n(15,"filters"),E(16,d_,13,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,u_,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(7),c("routerLink",M(8,m_)),o(3),c("routerLink",M(9,s_)),o(3),c("routerLink",M(10,c_)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,J,L,R,ii,Ce],encapsulation:2})};var Do=Jt(bi());var __=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],g_=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],C_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],f_=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),nl=(i,s,e)=>({ListIDs:i,From:s,To:e}),Li=(i,s)=>({"text-danger":i,"text-success":s}),x_=()=>["/menu/Reports/Sales_Report/Standard/Summary"],al=(i,s)=>({"text-warning":i,"text-success":s,"text-end":!0}),ol=(i,s)=>({"text-success":i,"text-danger":s});function h_(i,s){if(i&1){let e=I();n(0,"a",12),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function S_(i,s){if(i&1){let e=I();n(0,"div",14)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",15),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TagIDs,t)||(l.pageData.Filter.TagIDs=t),_(t)}),a(),n(7,"h6"),p(8,"Outlet Group"),a(),n(9,"POS-outlet-group-tree-select",17),x("selectedOutletGroupIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"datepicker",18),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(14,"div",19)(15,"datepicker",20),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(16,"h6"),p(17,"Brand"),a(),n(18,"ng-select",21),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(19,"h6"),p(20,"Product Type"),a(),n(21,"radio-options",22),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(22,"h6"),p(23," Query Option "),b(24,"i",23),a(),n(25,"ng-select",24),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a()()}if(i&2){let e=m();o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),C("ngModel",e.pageData.Filter.TagIDs),o(3),c("showClear",!0),C("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("multiple",!0),C("ngModel",e.pageData.Filter.BrandIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),C("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),C("ngModel",e.pageData.Filter.QueryOption)}}function y_(i,s){i&1&&(n(0,"th",55),p(1," Prev "),a())}function D_(i,s){i&1&&(n(0,"th",56),p(1," Now "),a())}function v_(i,s){i&1&&(n(0,"th",57),p(1," Orders "),a())}function w_(i,s){i&1&&(n(0,"th",58),p(1," Qty "),a())}function T_(i,s){i&1&&(n(0,"th",59),p(1," Gross "),a())}function P_(i,s){i&1&&(n(0,"th",60),p(1," Basket Size "),a())}function F_(i,s){i&1&&(n(0,"th",61),p(1," Sales "),a())}function I_(i,s){i&1&&(n(0,"th",62),p(1," Avg Daily Sales "),a())}function b_(i,s){i&1&&(n(0,"th",63),p(1," Inventory "),a())}function E_(i,s){i&1&&(pt(0),n(1,"th",64),p(2," Target "),a(),mt())}function M_(i,s){i&1&&(n(0,"th",66),p(1," Ach(%) "),a())}function V_(i,s){if(i&1&&(pt(0),E(1,M_,2,0,"th",65),d(2,"HideSumZero"),d(3,"HideSumZero"),mt()),i&2){let e=m(2);o(),c("ngIf",v(2,1,e.data.Data,"AchievementWithTax")||v(3,4,e.data.Data,"Achievement"))}}function B_(i,s){i&1&&(n(0,"th",67),p(1," Daily Target "),a())}function O_(i,s){i&1&&(n(0,"th",68),p(1," Tax "),a())}function L_(i,s){if(i&1&&(n(0,"th",69),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function R_(i,s){i&1&&(n(0,"th",70),p(1,"\xB1 (%)"),a())}function k_(i,s){i&1&&(n(0,"th",71),p(1," Cost "),a())}function W_(i,s){if(i&1&&(n(0,"th",69),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function N_(i,s){i&1&&(n(0,"th",72),p(1," Expense "),a())}function A_(i,s){if(i&1&&(n(0,"td",75),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function G_(i,s){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.index;c("ngClass",fe(2,f_,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function H_(i,s){if(i&1&&(n(0,"td",70)(1,"a",77),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(5,nl,e.EntityID,r.convertToDateString(r.pageData.Filter.From),r.convertFromDateString(r.pageData.Filter.To))),o(),F(v(3,2,e.Count,"1.0-0"))}}function Q_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Y_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function j_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.BasketSize,"1.0-2")," ")}}function q_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function U_(i,s){if(i&1&&(n(0,"td",70)(1,"div"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.AverageDailySales))}}function z_(i,s){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.InventoryValue))}}function K_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.RangeSalesTarget)," ")}}function X_(i,s){if(i&1&&(pt(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m(2).$implicit;o(),c("ngClass",fe(4,Li,e.AchievementWithTax<100,e.AchievementWithTax>100)),o(),D(" ",g(3,2,e.AchievementWithTax)," ")}}function J_(i,s){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Li,e.Achievement<100,e.Achievement>100)),o(),D(" ",g(2,2,e.Achievement)," ")}}function Z_(i,s){if(i&1&&(n(0,"td",70),E(1,X_,4,7,"ng-container",78)(2,J_,3,7,"ng-template",null,1,O),a()),i&2){let e=Dt(3),r=m(3);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function $_(i,s){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.SalesTarget))}}function e1(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function t1(i,s){if(i&1&&(n(0,"td",70)(1,"a",81),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(11,x_))("queryParams",_t(12,nl,e.EntityID,v(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),v(3,6,r.pageData.Filter.To,"yyyy-MM-dd"))),o(4),F(g(6,9,e.SalesWithTax))}}function i1(i,s){if(i&1&&(pt(0),p(1),d(2,"number"),mt()),i&2){let e=m(2).$implicit;o(),D(" ",v(2,1,e.Increase,"1.0-0")," ")}}function n1(i,s){if(i&1&&p(0),i&2){let e=m(2).$implicit;D(" ",e.Increase," ")}}function a1(i,s){if(i&1&&(n(0,"td",79),E(1,i1,3,4,"ng-container",78)(2,n1,1,1,"ng-template",null,2,O),a()),i&2){let e=Dt(3),r=m().$implicit;c("ngClass",fe(3,al,r.IsNegative,r.IsPositive)),o(),c("ngIf",r.Increase!=="-")("ngIfElse",e)}}function o1(i,s){if(i&1&&(n(0,"td",82),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function r1(i,s){if(i&1&&(pt(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m(2).$implicit;o(),c("ngClass",fe(4,Li,e.ProfitWithTax<0,e.ProfitWithTax>0)),o(),D(" ",g(3,2,e.ProfitWithTax))}}function l1(i,s){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Li,e.Profit<0,e.Profit>0)),o(),D(" ",g(2,2,e.Profit))}}function p1(i,s){if(i&1&&(n(0,"td",70),E(1,r1,4,7,"ng-container",78)(2,l1,3,7,"ng-template",null,3,O),a()),i&2){let e=Dt(3),r=m(3);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function m1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Expense)," ")}}function s1(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",48),p(4),a(),E(5,A_,2,1,"td",73)(6,G_,2,5,"td",74)(7,H_,4,9,"td",43)(8,Q_,3,3,"td",43)(9,Y_,3,3,"td",43)(10,j_,3,4,"td",43)(11,q_,3,3,"td",43)(12,U_,4,3,"td",43)(13,z_,4,3,"td",43)(14,K_,3,3,"td",43),pt(15),E(16,Z_,4,2,"td",43),d(17,"HideSumZero"),d(18,"HideSumZero"),mt(),E(19,$_,4,3,"td",43)(20,e1,3,3,"td",51)(21,t1,7,16,"td",43)(22,a1,4,6,"td",53)(23,o1,3,3,"td",54)(24,p1,4,2,"td",43)(25,m1,3,3,"td",43),d(26,"sum"),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(2),F(r+1),o(2),F(e.Name),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",t.column.Orders.selected),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.Gross.selected),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.Sales.selected),o(),c("ngIf",t.column.AvgDaily.selected),o(),c("ngIf",t.column.Inventory.selected),o(),c("ngIf",t.column.TargetDaily.selected),o(2),c("ngIf",v(17,20,t.data.Data,"AchievementWithTax")||v(18,23,t.data.Data,"Achievement")),o(3),c("ngIf",t.column.DailyTarget.selected),o(),c("ngIf",t.column.Tax.selected),o(),c("ngIf",t.column.SalesNTax.selected),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",(t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost)&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.product.Expense&&t.column.QTY.selected&&v(26,26,t.data.Data,"Expense")!=0)}}function c1(i,s){i&1&&b(0,"td",50)}function d1(i,s){i&1&&b(0,"td",50)}function u1(i,s){if(i&1&&(n(0,"td",70)(1,"a",83),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m(2);o(2),D(" ",v(4,4,v(3,1,e.data.Data,"Count"),"1.0-0"))}}function _1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function g1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Gross"))," ")}}function C1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"BasketSize")/(e.data==null||e.data.Data==null?null:e.data.Data.length),"1.0-2")," ")}}function f1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Sales"))," ")}}function x1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"AverageDailySales"))," ")}}function h1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"InventoryValue"))," ")}}function S1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"RangeSalesTarget"))," ")}}function y1(i,s){if(i&1&&(pt(0),n(1,"span",79),d(2,"sum"),d(3,"sum"),p(4),d(5,"sum"),d(6,"amountFraction"),a(),mt()),i&2){let e=m(3);o(),c("ngClass",fe(13,Li,v(2,2,e.data.Data,"AchievementWithTax")<100,v(3,5,e.data.Data,"AchievementWithTax")>100)),o(3),D(" ",g(6,11,v(5,8,e.data.Data,"AchievementWithTax")/(e.data==null||e.data.Data==null?null:e.data.Data.length))," ")}}function D1(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(13,Li,v(1,2,e.data.Data,"Achievement")<100,v(2,5,e.data.Data,"Achievement")>100)),o(3),D(" ",g(5,11,v(4,8,e.data.Data,"Achievement")/(e.data==null||e.data.Data==null?null:e.data.Data.length)))}}function v1(i,s){if(i&1&&(n(0,"td",70),E(1,y1,7,16,"ng-container",78)(2,D1,6,16,"ng-template",null,4,O),a()),i&2){let e=Dt(3),r=m(2);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function w1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"SalesTarget"))," ")}}function T1(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function P1(i,s){if(i&1&&(n(0,"td",84)(1,"a",85),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function F1(i,s){if(i&1&&(n(0,"td",79),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",fe(5,al,e.comparation<0,e.comparation>0)),o(),D(" ",v(2,2,e.comparation,"1.0-0")," ")}}function I1(i,s){if(i&1&&(n(0,"td",82),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function b1(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(13,ol,v(1,2,e.data.Data,"Profit")>0,v(2,5,e.data.Data,"Profit")<0)),o(3),F(g(5,11,v(4,8,e.data.Data,"Profit")))}}function E1(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(13,ol,v(1,2,e.data.Data,"ProfitWithTax")>0,v(2,5,e.data.Data,"ProfitWithTax")<0)),o(3),D("",g(5,11,v(4,8,e.data.Data,"ProfitWithTax"))," ")}}function M1(i,s){if(i&1&&(n(0,"td",70),E(1,b1,6,16,"span",53)(2,E1,6,16,"span",53),a()),i&2){let e=m(2);o(),c("ngIf",e.pageData.IgnoreTax),o(),c("ngIf",!e.pageData.IgnoreTax)}}function V1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Expense"))," ")}}function B1(i,s){if(i&1){let e=I();n(0,"div",25)(1,"table",26),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",27)(3,"tr")(4,"th",28),p(5,"No"),a(),n(6,"th",29),p(7," Outlet "),a(),E(8,y_,2,0,"th",30)(9,D_,2,0,"th",31)(10,v_,2,0,"th",32)(11,w_,2,0,"th",33)(12,T_,2,0,"th",34)(13,P_,2,0,"th",35)(14,F_,2,0,"th",36)(15,I_,2,0,"th",37)(16,b_,2,0,"th",38)(17,E_,3,0,"ng-container",39)(18,V_,4,7,"ng-container",39)(19,B_,2,0,"th",40)(20,O_,2,0,"th",41)(21,L_,2,1,"th",42)(22,R_,2,0,"th",43)(23,k_,2,0,"th",44)(24,W_,2,1,"th",42)(25,N_,2,0,"th",45),d(26,"sum"),a()(),n(27,"tbody"),E(28,s1,27,29,"tr",46),a(),n(29,"tfoot")(30,"tr",47),b(31,"td",48),E(32,c1,1,0,"td",49)(33,d1,1,0,"td",49),b(34,"td",50),E(35,u1,5,7,"td",43)(36,_1,4,6,"td",43)(37,g1,4,6,"td",43)(38,C1,4,7,"td",43)(39,f1,4,6,"td",43)(40,x1,4,6,"td",43)(41,h1,4,6,"td",43)(42,S1,4,6,"td",43),pt(43),E(44,v1,4,2,"td",43),d(45,"HideSumZero"),d(46,"HideSumZero"),mt(),E(47,w1,4,6,"td",43)(48,T1,4,6,"td",51)(49,P1,5,6,"td",52)(50,F1,3,8,"td",53)(51,I1,4,6,"td",54)(52,M1,3,2,"td",43)(53,V1,4,6,"td",43),d(54,"sum"),a()()()()}if(i&2){let e=m();o(8),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.column.Orders.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.column.AvgDaily.selected),o(),c("ngIf",e.column.Inventory.selected),o(),c("ngIf",e.column.TargetDaily.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.DailyTarget.selected),o(),c("ngIf",e.column.Tax.selected),o(),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&v(26,37,e.data.Data,"Expense")!=0),o(3),c("ngForOf",e.data.Data),o(4),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.showCompareColumn),o(2),c("ngIf",e.column.Orders.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.column.AvgDaily.selected),o(),c("ngIf",e.column.Inventory.selected),o(),c("ngIf",e.column.TargetDaily.selected),o(2),c("ngIf",v(45,40,e.data.Data,"AchievementWithTax")||v(46,43,e.data.Data,"Achievement")),o(3),c("ngIf",e.column.DailyTarget.selected),o(),c("ngIf",e.column.Tax.selected),o(),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&v(54,46,e.data.Data,"Expense")!=0)}}var Ca=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/OutletPerformanceDetail","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=h}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Quantity",responseProperty:"Quantity"},Gross:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Gross",responseProperty:"Gross"},Sales:{selected:!0},AvgDaily:{selected:!1,name:"Avg Daily Sales"},Inventory:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_InventoryValue",responseProperty:"InventoryValue"},TargetDaily:{selected:!1,name:"Target"},DailyTarget:{selected:!1,name:"Daily Target"},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:this.roleService.product.Cost,role:this.roleService.product.Cost},Profit:{selected:this.roleService.report.Profit&&this.roleService.product.Cost,role:this.roleService.report.Profit&&this.roleService.product.Cost}};isCompare=!1;showCompareColumn=!1;totalDays=1;selectetOutletGroup;isShowOutletTarget=!0;postInit(e){this.menuData.H=e.PageTitle;var r=new Date(this.pageData.Filter.To),t=new Date(this.pageData.Filter.From);this.totalDays=V.differentInDays(t,r)+1,this.initShowSalesTarget(),this.checkForAdvancedColumn(),this.onCompareData(),this.data.Data=this.data.Data.map(l=>(l.AverageDailySales=l.Sales/this.totalDays,l.BasketSize=l.Quantity/l.Count,l.Achievement=this.calculateAchievement(l.SalesTarget,l.Sales,this.totalDays),l.AchievementWithTax=this.calculateAchievement(l.SalesTarget,l.SalesWithTax,this.totalDays),l)),this.hideTaxRelatedColumn(e.Data)}hideTaxRelatedColumn(e){e.map(t=>t.Tax).reduce((t,l)=>t+l,0)==0&&(this.column.Tax.selected=!1,this.column.SalesNTax.selected=!1)}calculateAchievement(e=0,r=0,t=1){let l=0;return e!=0&&r!=0&&(l=r/(e*t)*100),l}initShowSalesTarget(){let e=this.data.Data.reduce((r,t)=>r+t.SalesTarget,0);this.isShowOutletTarget=e>0}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Count":return this.compare(t.Count,l.Count,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Gross":return this.compare(t.Gross,l.Gross,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,h);case"Expense":return this.compare(t.Expense,l.Expense,h);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,h);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,h);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,h);case"Achievement":return this.compare(t.Achievement,l.Achievement,h);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,h);case"AverageDailySales":return this.compare(t.AverageDailySales,l.AverageDailySales,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Performance Detail",exportTypes:[{ID:"ReportExport/OutletPerformanceDefault",Value:"Default",FileName:"Outlet Performance"},{ID:"ReportExport/OutletPerformanceDetail",Value:"Detail",FileName:"Outlet Performance Detail "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}onSelectOutletGroup(e){this.pageData.Filter.OutletGroupID=e?.id,this.selectetOutletGroup=e}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data.map(e=>{let r=e;return r.ID=e.EntityID,r}),this.pageData.Filter,"ID",()=>{this.data.Data=this.data.Data.map(e=>(e.AverageDailySales=e.Sales/this.totalDays,e.BasketSize=e.Quantity/e.Count,e.Achievement=this.calculateAchievement(e.SalesTarget,e.Sales,this.totalDays),e.AchievementWithTax=this.calculateAchievement(e.SalesTarget,e.SalesWithTax,this.totalDays),e))})}get entityIDs(){return this.data&&Object.prototype.hasOwnProperty.call(this.data,"Data")&&this.data.Data.length>0?this.data.Data.map(e=>e.EntityID).join(","):null}convertToDateString(e){return(0,Do.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}convertFromDateString(e){return(0,Do.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-detail-outlet-performance"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],["IGNORE_TAX_ITEM",""],["INCREASE",""],["IGNORE_PROFIT_TAX",""],["IGNORE_TAX",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","multiple","ngModel"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["name","render-ProductType",3,"modelChange","model","options"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["mat-sort-header","Name",1,"align-left","freeze","header"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Gross","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","AverageDailySales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",4,"ngIf"],[4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","arrowPosition","before","class","text-end",4,"ngIf"],["arrowPosition","before","class","text-end",3,"mat-sort-header",4,"ngIf"],["class","text-end",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Expense","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end"],["mat-sort-header","AverageDailySales","arrowPosition","before",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",1,"text-end"],["matTooltip","Daily Target * Number of Days","matTooltipPosition","above","mat-sort-header","Target","arrowPosition","before",1,"text-end"],["mat-sort-header","Achievement","arrowPosition","before","class","text-end","matTooltipPosition","above","matTooltip","Achievement",4,"ngIf"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before",1,"text-end"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end"],["arrowPosition","before",1,"text-end",3,"mat-sort-header"],[1,"text-end"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end"],["mat-sort-header","Expense","arrowPosition","before",1,"text-end"],["style","width: 35px; text-align: center",4,"ngIf"],["style","width: 35px; text-align: center",3,"ngClass",4,"ngIf"],[2,"width","35px","text-align","center"],[2,"width","35px","text-align","center",3,"ngClass"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary",3,"queryParams"],[4,"ngIf","ngIfElse"],[3,"ngClass"],[1,"text-end","text-warning-emphasis"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary","target","_blank"],[1,"text-end","text-primary"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",5),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,h_,3,0,"a",6),n(3,"div",7)(4,"button",8),p(5," More "),a(),n(6,"ul",9)(7,"li")(8,"a",10),p(9," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",10),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",10),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,S_,26,16,"ng-template",null,0,O),a(),n(19,"content"),E(20,B1,55,49,"div",11),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(10,__)),o(3),c("routerLink",M(11,g_)),o(3),c("routerLink",M(12,C_)),o(6),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,L,R,ie,pe,ge,Te,Ce,Vi,se,ei,re,oe,Z,ne],styles:["table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{width:0!important}"]})};var O1=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],L1=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],R1=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],k1=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),rl=(i,s)=>({"text-danger":i,"text-success":s,"text-end":!0});function W1(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function N1(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(5,"div",12)(6,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(10,"h6"),p(11,"Compare with Prev Month"),a(),n(12,"radio-options",15),x("modelChange",function(t){u(e);let l=m();return f(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=m();o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),C("model",e.isCompare)}}function A1(i,s){i&1&&(n(0,"th",19),p(1," Prev "),a())}function G1(i,s){i&1&&(n(0,"th",20),p(1," Now "),a())}function H1(i,s){i&1&&(n(0,"th",27),p(1," \xB1 (%) "),a())}function Q1(i,s){i&1&&(n(0,"th",28),p(1," Cost "),a())}function Y1(i,s){if(i&1&&(n(0,"th",25),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function j1(i,s){if(i&1&&(n(0,"td",31),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function q1(i,s){if(i&1&&(n(0,"td",37),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,k1,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function U1(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,rl,e.IsNegative,e.IsPositive)),o(),D(" ",g(2,2,e.Increase)," ")}}function z1(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function K1(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function X1(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,j1,2,1,"td",31),S(4,q1,2,5,"td",37),n(5,"td",31),p(6),d(7,"number"),a(),n(8,"td",31),p(9),d(10,"quantityFraction"),a(),n(11,"td",31),p(12),d(13,"amountFraction"),a(),n(14,"td",31),p(15),d(16,"amountFraction"),a(),n(17,"td",32),p(18),d(19,"amountFraction"),a(),n(20,"td",33),p(21),d(22,"amountFraction"),a(),S(23,U1,3,7,"td",34),S(24,z1,3,3,"td",35),S(25,K1,3,3,"td",36),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(2),F(v(7,12,e.Count,".0-0")),o(3),F(g(10,15,e.Quantity)),o(3),F(g(13,17,e.Gross)),o(3),F(g(16,19,e.SalesNet)),o(3),D(" ",g(19,21,e.Tax)," "),o(3),D(" ",g(22,23,e.SalesWithTax)," "),o(2),y(r.showCompareColumn&&r.roleService.report.Profit?23:-1),o(),y(r.roleService.product.Cost?24:-1),o(),y(r.roleService.report.Profit?25:-1)}}function J1(i,s){i&1&&b(0,"td",30)}function Z1(i,s){i&1&&b(0,"td",30)}function $1(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",fe(5,rl,e.comparation,e.comparation)),o(),D(" ",v(2,2,e.comparation,".0-0")," ")}}function eg(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data==null?null:e.data.Data,"Cost"))," ")}}function tg(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"sum"),d(3,"amountFraction"),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",e.pageData.IgnoreTax?g(3,4,v(2,1,e.data==null?null:e.data.Data,"Profit")):g(5,9,v(4,6,e.data==null?null:e.data.Data,"ProfitWithTax"))," ")}}function ig(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"Outlet"),a(),S(6,A1,2,0,"th",19),S(7,G1,2,0,"th",20),n(8,"th",21),p(9," Orders "),a(),n(10,"th",22),p(11," Quantity "),a(),n(12,"th",23),p(13," Gross "),a(),n(14,"th",24),p(15," Sales "),a(),n(16,"th",25),p(17," Tax "),a(),n(18,"th",26),p(19," Sales + Tax "),a(),S(20,H1,2,0,"th",27),S(21,Q1,2,0,"th",28),S(22,Y1,2,1,"th",25),a()(),n(23,"tbody"),G(24,X1,26,25,"tr",null,Y),a(),n(26,"tfoot")(27,"tr",29),S(28,J1,1,0,"td",30),S(29,Z1,1,0,"td",30),b(30,"td",30),n(31,"td",31),p(32),d(33,"sum"),d(34,"number"),a(),n(35,"td",31),p(36),d(37,"sum"),d(38,"quantityFraction"),a(),n(39,"td",31),p(40),d(41,"sum"),d(42,"amountFraction"),a(),n(43,"td",31),p(44),d(45,"sum"),d(46,"amountFraction"),a(),n(47,"td",32),p(48),d(49,"sum"),d(50,"amountFraction"),a(),n(51,"td",33)(52,"a"),p(53),d(54,"sum"),d(55,"amountFraction"),a()(),S(56,$1,3,8,"td",34),S(57,eg,4,6,"td",35),S(58,tg,6,11,"td",36),a()()()()}if(i&2){let e=m();o(6),y(e.showCompareColumn?6:-1),o(),y(e.showCompareColumn?7:-1),o(9),c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesTaxNet"),o(2),c("altpropcond",Ct(e.pageData.IgnoreTax)),o(2),y(e.showCompareColumn&&e.roleService.report.Profit?20:-1),o(),y(e.roleService.product.Cost?21:-1),o(),y(e.roleService.report.Profit?22:-1),o(2),H(e.data==null?null:e.data.Data),o(4),y(e.showCompareColumn?28:-1),o(),y(e.showCompareColumn?29:-1),o(3),D(" ",v(34,22,v(33,19,e.data==null?null:e.data.Data,"Count"),".0-0")," "),o(4),D(" ",g(38,28,v(37,25,e.data==null?null:e.data.Data,"Quantity"))," "),o(4),D(" ",g(42,33,v(41,30,e.data==null?null:e.data.Data,"Gross"))," "),o(4),D(" ",g(46,38,v(45,35,e.data==null?null:e.data.Data,"SalesNet"))," "),o(4),D(" ",g(50,43,v(49,40,e.data==null?null:e.data.Data,"Tax"))," "),o(5),F(g(55,48,v(54,45,e.data==null?null:e.data.Data,"SalesWithTax"))),o(3),y(e.showCompareColumn&&e.roleService.report.Profit?56:-1),o(),y(e.roleService.product.Cost?57:-1),o(),y(e.roleService.report.Profit?58:-1)}}var fa=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/OutletGroupPerformance","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}isCompare=!1;showCompareColumn=!1;postInit(e){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Name=t.Name?t.Name:"",l.Name=l.Name?l.Name:"",e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Count":return this.compare(t.Count,l.Count,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Gross":return this.compare(t.Gross,l.Gross,h);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,h);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"SalesTaxNet":return this.compare(t.SalesTaxNet,l.SalesTaxNet,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformance",Value:"Default",FileName:"Outlet Group Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-group-performance"]],standalone:!1,features:[W],decls:21,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Compare",3,"modelChange","model"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px"],["arrowPosition","before",1,"text-end",2,"width","120px",3,"mat-sort-header"],["mat-sort-header","SalesWithTax","altprop","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px",3,"altpropcond"],[1,"text-end",2,"width","60px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","100px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-primary"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,W1,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,N1,13,5,"ng-template",null,0,O),a(),n(19,"content"),S(20,ig,59,50,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(9,O1)),o(3),c("routerLink",M(10,L1)),o(3),c("routerLink",M(11,R1)),o(6),y(t.data?20:-1))},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,se,re,Z,ne],encapsulation:2})};var ng=()=>["/menu/Reports/Sales_Report/Standard/Compare"],ag=i=>({"flex-right":i});function og(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function rg(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Sales Person"),a(),n(3,"sales-person-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function lg(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=s.$index;c("arrowPosition",Ct(r?"before":"after"))("mat-sort-header",e)("ngClass",X(5,ag,e!="Outlet")),o(),D(" ",e)}}function pg(i,s){if(i&1&&(n(0,"div",14),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(r[e])}}function mg(i,s){if(i&1&&(n(0,"div",15),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),D("",g(2,1,r[e])," ")}}function sg(i,s){if(i&1&&(n(0,"td"),S(1,pg,2,1,"div",14),S(2,mg,3,3,"div",15),a()),i&2){let e=s.$implicit;o(),y(e=="Outlet"?1:-1),o(),y(e!="Outlet"?2:-1)}}function cg(i,s){if(i&1&&(n(0,"tr"),G(1,sg,3,2,"td",null,Y),a()),i&2){let e=s.$implicit,r=m(2);o(),H(r.getKeys(e))}}function dg(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),F(g(2,1,e))}}function ug(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",16)(2,"td"),p(3,"Total : "),a(),G(4,dg,3,3,"td",17,Y),a()()),i&2){let e=m(2);o(4),H(e.data.DataFooter)}}function _g(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",11),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",12)(3,"tr"),G(4,lg,2,7,"th",13,Y),a()(),n(6,"tbody"),G(7,cg,3,0,"tr",null,Y),a(),S(9,ug,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var xa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/MonthlyOutletPerformance","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}Years=V.GenerateYears(new Date().getFullYear(),11,!0);getKeys(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 h=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T])return this.compare(t[this.data.Dataheader[T]],l[this.data.Dataheader[T]],h)})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Monthly Comparison",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformance",Value:"Default",FileName:"Outlet Monthly Comparison"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-monthly-performance"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Range Compare",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"table-light","sticky-top-thead"],[3,"mat-sort-header","arrowPosition","ngClass"],[2,"color","black"],[2,"color","black","text-align","right"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,og,3,0,"a",2),n(3,"a",3),p(4," View Range"),a()(),n(5,"filters"),E(6,rg,10,5,"ng-template",null,0,O),a(),n(8,"content"),S(9,_g,10,1,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,ng)),o(6),y(t.data?9:-1))},dependencies:[A,tt,Q,$,L,R,ie,pe,ge,ze,Z],encapsulation:2})};var gg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],Cg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],fg=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],xg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],hg=(i,s)=>({From:i,To:s}),Sg=()=>["/menu/Contacts/Contact/Sales_Person/Info"],yg=i=>({ID:i}),Dg=()=>["/menu/Reports/Sales_Report/Standard/Detail"],vg=(i,s,e,r,t)=>({SalesPersonID:i,From:s,To:e,ListIDs:r,IncludeComplementary:t}),wg=(i,s,e,r)=>({ID:i,from:s,to:e,IncludeComplementary:r}),Tg=i=>({SalesID:i});function Pg(i,s){if(i&1){let e=I();n(0,"button",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function Fg(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person Group"),a(),n(6,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesGroupID,t)||(l.pageData.Filter.SalesGroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",16)(12,"datepicker",17),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",18),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Sales Order Tag"),a(),n(18,"ng-select",19),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(19,"h6"),p(20,"Include Zero Amount Transaction"),a(),n(21,"radio-options",20),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.IncludeZeroAmountTransaction,t)||(l.pageData.Filter.IncludeZeroAmountTransaction=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData==null||e.pageData.List==null?null:e.pageData.List.Entities),o(3),C("ngModel",e.pageData.Filter.SalesGroupID),c("items",e.pageData.List==null?null:e.pageData.List.SalesGroup),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.DeliveryID),c("items",e.pageData.List==null?null:e.pageData.List.Deliveries),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.List==null?null:e.pageData.List.Types),o(3),C("model",e.pageData.Filter.IncludeZeroAmountTransaction)}}function Ig(i,s){i&1&&(n(0,"th",45),p(1," Sales Group "),a())}function bg(i,s){i&1&&(n(0,"th",46),p(1," Orders "),a())}function Eg(i,s){i&1&&(n(0,"th",47),p(1," Sales "),a())}function Mg(i,s){i&1&&(pt(0),n(1,"th",48),p(2," Avg. Daily "),a(),mt())}function Vg(i,s){i&1&&(n(0,"th",49),p(1," Tax "),a())}function Bg(i,s){i&1&&(n(0,"th",50),p(1," Sales + Tax "),a())}function Og(i,s){i&1&&(n(0,"th",51),p(1," Cost "),a())}function Lg(i,s){i&1&&(n(0,"th",52),p(1," Profit "),a())}function Rg(i,s){i&1&&(n(0,"th",55),p(1," Target "),a())}function kg(i,s){i&1&&(n(0,"th",56),p(1," Ach(%) "),a())}function Wg(i,s){if(i&1&&(pt(0),E(1,Rg,2,0,"th",53)(2,kg,2,0,"th",54),mt()),i&2){let e=m(2);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function Ng(i,s){i&1&&(n(0,"th",57),p(1," Quantity "),a())}function Ag(i,s){i&1&&(n(0,"th",58),p(1," Basket Size "),a())}function Gg(i,s){i&1&&(n(0,"th",59),p(1," Product Commission "),a())}function Hg(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Group)}}function Qg(i,s){if(i&1&&(n(0,"td",62)(1,"a",61),d(2,"date"),d(3,"date"),p(4),d(5,"number"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(12,Dg))("queryParams",cn(13,vg,e.ID,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.ListIDs,r.pageData.Filter.IncludeComplementary)),o(3),F(v(5,9,e.Orders,".0-0"))}}function Yg(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function jg(i,s){if(i&1&&(pt(0),n(1,"td",63),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m().$implicit;o(2),D(" ",g(3,1,e.AvgDailySales)," ")}}function qg(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Ug(i,s){if(i&1&&(n(0,"td",62)(1,"a",65),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",Ut(10,wg,e.ID,v(2,2,r.pageData.Filter.From,"ddMMyyyy"),v(3,5,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.IncludeComplementary)),o(3),D(" ",g(5,8,e.SalesNTax)," ")}}function zg(i,s){if(i&1&&(n(0,"td",66),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Kg(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Profit)," ")}}function Xg(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e.Target)," ")}}function Jg(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e.Achievement)," ")}}function Zg(i,s){if(i&1&&(pt(0),E(1,Xg,3,3,"td",44)(2,Jg,3,3,"td",44),mt()),i&2){let e=m(3);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function $g(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Quantity,"1.0-2")," ")}}function eC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.BasketSize,"1.0-2")," ")}}function tC(i,s){if(i&1&&(n(0,"td",63)(1,"span")(2,"a",68),p(3),d(4,"amountFraction"),a()()()),i&2){let e=m().$implicit;o(2),c("queryParams",X(4,Tg,e.ID)),o(),F(g(4,2,e.Commission))}}function iC(i,s){if(i&1&&(n(0,"tr")(1,"td",60)(2,"a",61),p(3),a()(),E(4,Hg,2,1,"td",9)(5,Qg,6,19,"td",40)(6,Yg,3,3,"td",41),d(7,"HideSumZero"),E(8,jg,4,3,"ng-container",9)(9,qg,3,3,"td",42),d(10,"HideSumZero"),E(11,Ug,6,15,"td",40)(12,zg,3,3,"td",43)(13,Kg,3,3,"td",44)(14,Zg,3,2,"ng-container",9)(15,$g,3,4,"td",41)(16,eC,3,4,"td",41)(17,tC,5,6,"td",41),a()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(21,Sg))("queryParams",X(22,yg,e.ID)),o(),F(e.Name),o(),c("ngIf",r.data.Show),o(),c("ngIf",r.column.Orders.selected),o(),c("ngIf",v(7,15,r.data.List,"Tax")&&r.column.Sales.selected),o(2),c("ngIf",r.isShowOutletTarget),o(),c("ngIf",v(10,18,r.data.List,"Tax")&&r.column.Tax.selected),o(2),c("ngIf",r.column.SalesNTax.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.roleService.report.Profit&&r.column.Profit.selected),o(),c("ngIf",r.isShowOutletTarget),o(),c("ngIf",r.column.QTY.selected),o(),c("ngIf",r.column.QTY.selected),o(),c("ngIf",r.column.Commission.selected&&r.roleService.product.CommissionView)}}function nC(i,s){i&1&&b(0,"td")}function aC(i,s){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Orders"),".0-0")," ")}}function oC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Sales"))," ")}}function rC(i,s){if(i&1&&(pt(0),n(1,"td",63),p(2),d(3,"sum"),d(4,"amountFraction"),a(),mt()),i&2){let e=m(2);o(2),D(" ",g(4,4,v(3,1,e.data.List,"AvgDailySales"))," ")}}function lC(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Tax"),e.pageData.FractionDigit)," ")}}function pC(i,s){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"SalesNTax"))," ")}}function mC(i,s){if(i&1&&(n(0,"td",66),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Cost"))," ")}}function sC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Profit"))," ")}}function cC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.data.List,"Target"))," ")}}function dC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(4,7,v(2,1,e.data.List,"Sales")/v(3,4,e.data.List,"Target")*100)," ")}}function uC(i,s){if(i&1&&(pt(0),E(1,cC,4,6,"td",44)(2,dC,5,9,"td",44),mt()),i&2){let e=m(2);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function _C(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Quantity"),"1.0-2")," ")}}function gC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"BasketSize"),"1.0-2")," ")}}function CC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Commission"))," ")}}function fC(i,s){if(i&1){let e=I();n(0,"content")(1,"div",21)(2,"div",22)(3,"table",23),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",24)(5,"tr",25)(6,"th",26),p(7,"Sales Person"),a(),E(8,Ig,2,0,"th",27)(9,bg,2,0,"th",28)(10,Eg,2,0,"th",29),d(11,"HideSumZero"),E(12,Mg,3,0,"ng-container",9)(13,Vg,2,0,"th",30),d(14,"HideSumZero"),E(15,Bg,2,0,"th",31)(16,Og,2,0,"th",32)(17,Lg,2,0,"th",33)(18,Wg,3,2,"ng-container",9)(19,Ng,2,0,"th",34)(20,Ag,2,0,"th",35)(21,Gg,2,0,"th",36),a()(),n(22,"tbody"),E(23,iC,18,24,"tr",37),a(),n(24,"tfoot")(25,"tr",38),S(26,nC,1,0,"td"),n(27,"td",39),p(28,"Total:"),a(),E(29,aC,4,7,"td",40)(30,oC,4,6,"td",41),d(31,"HideSumZero"),E(32,rC,5,6,"ng-container",9)(33,lC,4,7,"td",42),d(34,"HideSumZero"),E(35,pC,4,6,"td",40)(36,mC,4,6,"td",43)(37,sC,4,6,"td",44)(38,uC,3,2,"ng-container",9)(39,_C,4,7,"td",41)(40,gC,4,7,"td",41)(41,CC,4,6,"td",41),a()()()()()()}if(i&2){let e=m();o(8),c("ngIf",e.data.Show),o(),c("ngIf",e.column.Orders.selected),o(),c("ngIf",v(11,25,e.data.List,"Tax")&&e.column.Sales.selected),o(2),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",v(14,28,e.data.List,"Tax")&&e.column.Tax.selected),o(2),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.column.Commission.selected),o(2),c("ngForOf",e.data.List),o(3),y(e.data.Show?26:-1),o(3),c("ngIf",e.column.Orders.selected),o(),c("ngIf",v(31,31,e.data.List,"Tax")&&e.column.Sales.selected),o(2),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",v(34,34,e.data.List,"Tax")&&e.column.Tax.selected),o(2),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Commission.selected&&e.roleService.product.CommissionView)}}var ha=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/SalesPerson","ReportLoader/SalesPerson");this.httpService=r;this.csvConverter=t;this.reportFilterService=l;this.matDialog=h}isShowCommission=!1;roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},Sales:{selected:!0},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:!0,role:this.roleService.product.Cost},Target:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/SalesPersonOrderQuantity",responseProperty:"Quantity"},Commission:{selected:!1,advanced:!0,endpoint:"/api/Report/SalesPersonOrderCommission",responseProperty:"Commission",role:this.roleService.product.CommissionView},Profit:{selected:!0,role:this.roleService.report.Profit}};isShowOutletTarget=!0;postInit(){this.menuData.H=this.data.PageTitle,this.isShowCommission=!1,this.initShowSalesTarget();let e=this.getTotalDays();this.data.List=this.data.List.map(r=>(r.AvgDailySales=r.Sales/e,r)),this.checkForAdvancedColumn()}initShowSalesTarget(){let e=this.data?.List?.reduce((r,t)=>r+t.Target,0);this.isShowOutletTarget=e>0}getTotalDays(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return V.differentInDays(e,r)+1}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.Group=t.Group==null?"":t.Group,l.Group=l.Group==null?"":l.Group,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Group":return this.compare(t.Group.toLocaleLowerCase(),l.Group.toLocaleLowerCase(),h);case"Orders":return this.compare(t.Orders,l.Orders,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,h);case"Target":return this.compare(t.Target,l.Target,h);case"Achievement":return this.compare(t.Achievement,l.Achievement,h);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,h);case"AvgDailySales":return this.compare(t.AvgDailySales,l.AvgDailySales,h);case"Commission":return this.compare(t.Commission,l.Commission,h);default:return 0}})}getCommission(){this.httpService.post("/api/Report/SalesPersonComission",this.pageData.Filter).pipe(oi(e=>e?.List)).subscribe(e=>{let r=0;this.data.List=this.data.List.map(t=>(r=e.findIndex(l=>l.SalesPersonID===t.ID),r!=-1&&(t.Commission=e[r].Commission,t.Quantity=e[r].Quantity),t)),this.isShowCommission=!0})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Sales Person",exportTypes:[{ID:"ReportExport/SalesPerson",Value:"Default",FileName:"Sales by Sales Person"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.List,this.pageData.Filter,"ID",()=>{this.data.List=this.data.List.map(e=>nt(et({},e),{BasketSize:e.Quantity/e.Orders}))})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(rr),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-person"]],standalone:!1,features:[W],decls:26,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"d-flex"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Person Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Transaction",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left"],["mat-sort-header","Group","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Orders","style","width: 80px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","style","width: 90px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesNTax","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Cost","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Profit","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","style","width: 100px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","style","width: 110px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Commission","style","width: 200px","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column","text-end"],["class","text-end text-primary",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["mat-sort-header","Group","arrowPosition","before",1,"text-end"],["mat-sort-header","Orders","arrowPosition","before",1,"text-end",2,"width","80px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","AvgDailySales","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Target","style","width: 120px","arrowPosition","before","class","align-l",4,"ngIf"],["mat-sort-header","Achievement","style","width: 60px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Target","arrowPosition","before",1,"align-l",2,"width","120px"],["mat-sort-header","Achievement","arrowPosition","before",1,"text-end",2,"width","60px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end",2,"width","110px"],["mat-sort-header","Commission","arrowPosition","before",1,"text-end",2,"width","200px"],[1,"text-primary"],[3,"routerLink","queryParams"],[1,"text-end","text-primary"],[1,"text-end"],[1,"text-end","text-warning"],["routerLink","Commission_Report",3,"queryParams"],[1,"text-end","text-danger"],[1,"text-end","text-success"],["routerLink","/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions")(2,"div",2),E(3,Pg,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"By Outlet"),a()(),n(11,"li")(12,"a",7),p(13,"By Employee"),a()(),n(14,"li")(15,"a",7),p(16,"By Sales Group"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),E(23,Fg,22,13,"ng-template",null,0,O),a(),E(25,fC,42,37,"content",9),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(3),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(18,gg)),o(3),c("routerLink",M(19,Cg)),o(3),c("routerLink",M(20,fg)),o(3),c("routerLink",M(21,xg))("queryParams",fe(22,hg,v(19,12,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),v(20,15,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,L,R,ie,pe,ge,Te,U,se,ei,re,oe,Z],encapsulation:2})};var xC=()=>["/menu/Reports/Sales_Report/Standard/Person"],hC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],SC=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],yC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],DC=(i,s)=>({From:i,To:s}),ll=i=>({ID:i}),pl=(i,s,e,r)=>({SalesID:i,From:s,To:e,VariantName:r});function vC(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function wC(i,s){if(i&1){let e=I();n(0,"div",21)(1,"div",22)(2,"datepicker",23),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(3,"div",24)(4,"app-timepicker",25),x("timeChange",function(t){u(e);let l=m(3);return f(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=m(3);return _(l.timeFromChange(t))}),a()()(),n(5,"div",26)(6,"div",22)(7,"datepicker",27),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(8,"div",24)(9,"app-timepicker",25),x("timeChange",function(t){u(e);let l=m(3);return f(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=m(3);return _(l.timeToChange(t))}),a()()()}if(i&2){let e=m(3);o(2),c("width",100),C("date",e.pageData.Filter.From),o(2),C("time",e.timeFrom),o(3),c("width",100),C("date",e.pageData.Filter.To),o(2),C("time",e.timeTo)}}function TC(i,s){if(i&1){let e=I();n(0,"div")(1,"datepicker",28),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(3);return _(t.onFilterFromDate())}),a()(),n(2,"div",29)(3,"datepicker",30),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(3);return _(t.onFilterToDate())}),a()()}if(i&2){let e=m(3);o(),C("date",e.pageData.Filter.From),c("width",100),o(2),C("date",e.pageData.Filter.To),c("width",100)}}function PC(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",19),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ID,t)||(l.pageData.Filter.ID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),S(9,wC,10,6)(10,TC,4,4),n(11,"h6"),p(12,"Filter Invoice By"),a(),n(13,"radio-options",20),x("modelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.isCreated,t)||(l.pageData.Filter.isCreated=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.ID),o(3),y(e.pageData.Filter.isCreated?9:10),o(4),c("options",e.filterInvoiceBy),C("model",e.pageData.Filter.isCreated)}}function FC(i,s){i&1&&b(0,"app-empty-state")}function IC(i,s){i&1&&(n(0,"th",36),p(1," Commission "),a())}function bC(i,s){i&1&&(n(0,"th",36),p(1," Total Commission "),a())}function EC(i,s){if(i&1&&(n(0,"thead",31)(1,"tr",32)(2,"th",33)(3,"h2")(4,"a",34),p(5),a()()()(),n(6,"tr")(7,"th",35),p(8,"Product"),a(),n(9,"th",36),p(10,"Qty"),a(),n(11,"th",36),p(12,"Sales"),a(),S(13,IC,2,0,"th",36),S(14,bC,2,0,"th",36),a()()),i&2){let e=m().$implicit,r=m(2);o(4),c("queryParams",X(5,ll,e.ID)),o(),$t("",e.Name," - ",e.Code),o(8),y(r.roleService.product.CommissionView?13:-1),o(),y(r.roleService.product.CommissionView?14:-1)}}function MC(i,s){if(i&1&&(n(0,"div")(1,"a",40),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m(2).$implicit,r=m(4);ji("text-decoration-line-through",e.VariantCommission&&e.GroupCommission)("text-danger",e.VariantCommission&&e.GroupCommission),o(),c("queryParams",Ut(14,pl,e.SalesID,v(2,6,r.pageData.Filter.From,"ddMMyyyy"),v(3,9,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),F(g(5,12,e.VariantCommission))}}function VC(i,s){if(i&1&&(n(0,"div")(1,"a",41),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m(2).$implicit,r=m(4);o(),c("queryParams",Ut(10,pl,e.SalesID,v(2,2,r.pageData.Filter.From,"ddMMyyyy"),v(3,5,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),F(g(5,8,e.GroupCommission))}}function BC(i,s){if(i&1&&(n(0,"td",38),S(1,MC,6,19,"div",39),S(2,VC,6,15,"div"),a()),i&2){let e=m().$implicit;o(),y(e.VariantCommission||!e.GroupCommission?1:-1),o(),y(e.GroupCommission?2:-1)}}function OC(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalCommission)," ")}}function LC(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",37),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",38),p(7),d(8,"quantityFraction"),a(),n(9,"td",38),p(10),d(11,"amountFraction"),a(),S(12,BC,3,2,"td",38),S(13,OC,3,3,"td",38),a()),i&2){let e=s.$implicit,r=m(4);o(2),c("queryParams",X(11,ll,e.VariantID)),o(),F(e.Name),o(2),F(e.Code),o(2),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.NettSales)),o(2),y(r.roleService.product.CommissionView?12:-1),o(),y(r.roleService.product.CommissionView?13:-1)}}function RC(i,s){if(i&1&&(n(0,"tbody"),G(1,LC,14,13,"tr",null,Y),a()),i&2){let e=m().$implicit;o(),H(e.Item)}}function kC(i,s){if(i&1&&(n(0,"div"),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),n(5,"span",43),p(6),d(7,"sum"),d(8,"amountFraction"),a()()),i&2){let e=m(3).$implicit;ji("text-decoration-line-through",v(1,5,e.Item,"VariantCommission")&&v(2,8,e.Item,"GroupCommission"))("text-danger",v(3,11,e.Item,"VariantCommission")&&v(4,14,e.Item,"GroupCommission")),o(6),F(g(8,20,v(7,17,e.Item,"VariantCommission")))}}function WC(i,s){if(i&1&&(n(0,"div"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3).$implicit;o(),D(" ",g(3,4,v(2,1,e.Item,"GroupCommission"))," ")}}function NC(i,s){if(i&1&&(n(0,"td",38),S(1,kC,9,22,"div",39),d(2,"sum"),d(3,"sum"),S(4,WC,4,6,"div"),d(5,"sum"),a()),i&2){let e=m(2).$implicit;o(),y(v(2,2,e.Item,"VariantCommission")||!v(3,5,e.Item,"GroupCommission")?1:-1),o(3),y(v(5,8,e.Item,"GroupCommission")?4:-1)}}function AC(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(3,4,v(2,1,e.Item,"TotalCommission"))," ")}}function GC(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",42)(2,"td"),p(3,"Total"),a(),n(4,"td",38),p(5),d(6,"sum"),d(7,"quantityFraction"),a(),n(8,"td",38),p(9),d(10,"sum"),d(11,"amountFraction"),a(),S(12,NC,6,11,"td",38),S(13,AC,4,6,"td",38),a()()),i&2){let e=m().$implicit,r=m(2);o(5),D(" ",g(7,7,v(6,4,e.Item,"Quantity"))," "),o(4),D(" ",g(11,12,v(10,9,e.Item,"NettSales"))," "),o(3),y(r.roleService.product.CommissionView?12:-1),o(),y(r.roleService.product.CommissionView?13:-1)}}function HC(i,s){if(i&1&&(n(0,"table",14),S(1,EC,15,7,"thead",31),S(2,RC,3,0,"tbody"),S(3,GC,14,14,"tfoot"),a()),i&2){let e=s.$implicit;o(),y(e.Name?1:-1),o(),y(e.Name?2:-1),o(),y(e.Name?3:-1)}}function QC(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",3)(3,"a",4),P("click",function(){u(e);let t=m();return _(t.print())}),b(4,"i",5),p(5," Print"),a(),S(6,vC,3,0,"a",6),n(7,"div",7)(8,"button",8),p(9," More "),a(),n(10,"ul",9)(11,"li")(12,"a",10),p(13,"Summary"),a()(),n(14,"li")(15,"a",10),p(16,"By Outlet"),a()(),n(17,"li")(18,"a",10),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",11),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),E(26,PC,14,8,"ng-template",null,0,O),a(),n(28,"content")(29,"div",12),S(30,FC,1,0,"app-empty-state"),n(31,"div",13),G(32,HC,4,3,"table",14,Y),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(6),y(e.roleService!=null&&e.roleService.global.Export?6:-1),o(6),c("routerLink",M(17,xC)),o(3),c("routerLink",M(18,hC)),o(3),c("routerLink",M(19,SC)),o(3),c("routerLink",M(20,yC))("queryParams",fe(21,DC,v(22,11,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),v(23,14,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),o(9),y((e.data==null||e.data.Data==null?null:e.data.Data.length)==0?30:-1),o(2),H(e.data.Data)}}var Sa=class i extends De{constructor(e,r,t,l,h,T){super(e,r,"Report/GetSalesPersonCommissionGroupByProduct","ReportLoader/SalesCommissionLoader",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.activatedRoute=T}filterInvoiceBy=[{Key:!1,Value:"Date"},{Key:!0,Value:"Created"}];timeFrom;timeTo;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(K,{data:{title:"Employee Commission Report",exportTypes:[{ID:"ReportExport/SalesPersonGroupByProduct",Value:"Default",FileName:"Employee Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To),this.onFilterToDate()}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From),this.onFilterFromDate()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-commision-report"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],[1,"btn","btn-outline-secondary","ms-3"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom","mb-10"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],["name","Is Created",3,"modelChange","options","model"],[1,"w-100","d-flex","mt-2","align-items-center"],[1,"w-100"],["name","From","appearance","outline",3,"dateChange","width","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","mt-4"],["name","To","appearance","outline",3,"dateChange","width","date"],["name","From","appearance","outline",3,"dateChange","date","width"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date","width"],[1,"thead-light"],[2,"border","none !important"],["colspan","5",1,"text-center","bg-white","border-none"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],[2,"width","200px"],[1,"text-end",2,"width","100px"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"text-end"],[3,"text-decoration-line-through","text-danger"],["routerLink","Commission_Report_Detail","matTooltipPosition","above","matTooltip","variant commission",3,"queryParams"],["routerLink","Commission_Report_Detail",3,"queryParams"],[1,"table-footer","fw-bold"],["matTooltipPosition","above","matTooltip","Total variant commission"]],template:function(r,t){r&1&&S(0,QC,34,24,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,J,L,R,ie,Te,Mi,U,ze,kr,se,oe,Z,ne],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}} datepicker.timepicker>mat-form-field{width:140px!important}"]})};var YC=()=>["/menu/Reports/Sales_Report/Standard/Person"],jC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],qC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],UC=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],zC=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],vo=i=>({ID:i}),KC=()=>["/menu/Products/Catalog/Variants/Info"],XC=()=>["/menu/Contacts/Contact/Sales_Person/Info"];function JC(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function ZC(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Outlets),o(3),C("ngModel",e.pageData.Filter.SalesID),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function $C(i,s){i&1&&(n(0,"th",34),p(1,"Date"),a())}function ef(i,s){i&1&&(n(0,"th",34),p(1,"Outlet"),a())}function tf(i,s){i&1&&(n(0,"th",34),p(1," Number "),a())}function nf(i,s){i&1&&(n(0,"th"),p(1,"Product"),a())}function af(i,s){i&1&&(n(0,"th"),p(1,"Sales Person"),a())}function of(i,s){i&1&&(n(0,"th",35),p(1," Quantity "),a())}function rf(i,s){i&1&&(n(0,"th",35),p(1," Commission "),a())}function lf(i,s){i&1&&(n(0,"th",35),p(1," Total Commission "),a())}function pf(i,s){i&1&&(n(0,"th",35),p(1," Cost "),a())}function mf(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Date,"dd MMM yyyy")," ")}}function sf(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.EntityName)}}function cf(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,zC))("queryParams",X(4,vo,e.ID)),o(),F(e.Number)}}function df(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,KC))("queryParams",X(4,vo,e.VariantID)),o(),F(e.VariantName)}}function uf(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,XC))("queryParams",X(4,vo,e.SalesID)),o(),F(e.SalesName)}}function _f(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function gf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.SalesCommission,r.pageData.FractionDigit)," ")}}function Cf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.Total,r.pageData.FractionDigit)," ")}}function ff(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.UnitCost,r.pageData.FractionDigit)," ")}}function xf(i,s){if(i&1&&(n(0,"tr"),E(1,mf,3,4,"td",21)(2,sf,2,1,"td",21)(3,cf,3,6,"td",21)(4,df,3,6,"td",21)(5,uf,3,6,"td",21)(6,_f,3,3,"td",27)(7,gf,3,4,"td",27)(8,Cf,3,4,"td",27)(9,ff,3,4,"td",28),a()),i&2){let e=m(2);o(),c("ngIf",e.columns.Date.selected),o(),c("ngIf",e.columns.Outlet.selected),o(),c("ngIf",e.columns.InvoiceNumber.selected),o(),c("ngIf",e.columns.VariantName.selected),o(),c("ngIf",e.columns.SalesName.selected),o(),c("ngIf",e.columns.Quantity.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected)}}function hf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"SalesCommission"),e.pageData.FractionDigit)," ")}}function Sf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function yf(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"UnitCost"),e.pageData.FractionDigit)," ")}}function Df(i,s){if(i&1){let e=I();n(0,"span",38),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail"))}),n(1,"i",39),p(2,"?"),a()()}}function vf(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"quantityFraction"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function wf(i,s){if(i&1){let e=I();n(0,"div",40)(1,"a",41),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(2,"i",42),p(3," Next"),a(),n(4,"a",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail",!0))}),b(5,"i",44),p(6," Show All"),a()()}}function Tf(i,s){if(i&1&&(n(0,"div",16)(1,"table",17)(2,"thead",18)(3,"tr",19),E(4,$C,2,0,"th",20)(5,ef,2,0,"th",20)(6,tf,2,0,"th",20)(7,nf,2,0,"th",21)(8,af,2,0,"th",21)(9,of,2,0,"th",22)(10,rf,2,0,"th",22)(11,lf,2,0,"th",22)(12,pf,2,0,"th",22),a()(),n(13,"tbody"),E(14,xf,10,9,"tr",23),a(),n(15,"tfoot")(16,"tr",24)(17,"td",25),p(18,"Total:"),a(),n(19,"td",26),p(20),d(21,"sum"),d(22,"number"),a(),E(23,hf,4,7,"td",27)(24,Sf,4,7,"td",27)(25,yf,4,7,"td",28),a()()(),n(26,"div",29)(27,"div",30)(28,"div",31),p(29),d(30,"number"),E(31,Df,3,0,"span",32)(32,vf,3,3,"span",21),p(33),a()(),E(34,wf,7,0,"div",33),a()()),i&2){let e=m();o(4),c("ngIf",e.columns.Date.selected),o(),c("ngIf",e.columns.Outlet.selected),o(),c("ngIf",e.columns.InvoiceNumber.selected),o(),c("ngIf",e.columns.VariantName.selected),o(),c("ngIf",e.columns.SalesName.selected),o(),c("ngIf",e.columns.Quantity.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected),o(2),c("ngForOf",e.infiniteList),o(6),D(" ",g(22,22,v(21,19,e.data.Data,"Quantity"))," "),o(3),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected),o(4),D(" Showing 1 - ",g(30,24,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var ya=class i extends De{constructor(e,r,t,l,h,T){super(e,r,"Report/GetSalesPersonCommissionDetail","ReportLoader/SalesCommissionDetailLoader",null,h);this.httpService=r;this.csvConverter=t;this.datePipe=l;this.activatedRoute=h;this.matDialog=T}roleService=Pe(j);columnService=Pe(gt);datasource=[];columns={Date:{selected:!0,name:"Date",width:null,class:"w-100",visible:!0},Outlet:{selected:!0,name:"Outlet",width:null,class:"w-100",visible:!0},InvoiceNumber:{selected:!0,name:"Number",width:null,class:"w-100",visible:!0},VariantName:{selected:!0,name:"Name",width:null,class:"w-100",visible:!0},SalesName:{selected:!0,name:"Sales Person",width:null,class:"w-100",visible:!0},Quantity:{selected:!0,name:"Qty",width:null,class:"w-100",visible:!0},Commission:{selected:!0,name:"Commission",width:null,class:"w-100",visible:!0,role:this.roleService.product.CommissionView},TotalCommission:{selected:!0,name:"Total Commission",width:null,class:"w-100",visible:!0,role:this.roleService.product.CommissionView},UnitCost:{selected:!1,name:"Cost",width:null,class:"w-100",visible:!1,role:this.roleService.product.Cost}};onColumnSelectedChange(e){let r=this.columns[e.key];r&&(r.visible=!e.value.visible)}get displayedColumns(){return Object.keys(this.columns).filter(e=>this.columns[e].selected)}transformDate(e,r){return this.datePipe.transform(e,r)}getFilterData(e){this.infiniteList=this.originalData.filter(r=>Object.keys(r).some(t=>r[t]==null?!1:r[t].toString().toLowerCase().includes(e.toLowerCase())))}openExportModal(){this.matDialog.open(K,{data:{title:"Commission Report Detail",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionDetail",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountSalesPersonCommissionDetail",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(Ne),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-commision-report-detail"]],standalone:!1,features:[W],decls:24,vars:15,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 120px",4,"ngIf"],[4,"ngIf"],["style","width: 120px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end"],[1,"text-end","text-success"],["class","text-end text-success",4,"ngIf"],["class","text-end text-danger",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"],["class","btn-group",4,"ngIf"],[2,"width","120px"],[1,"text-end",2,"width","120px"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.VariantName,T)||(t.pageData.Filter.VariantName=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())})("textChange",function(T){return u(l),_(t.getFilterData(T))}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,JC,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9,"Summary"),a()(),n(10,"li")(11,"a",6),p(12,"By Outlet"),a()(),n(13,"li")(14,"a",6),p(15,"By Employee"),a()(),n(16,"li")(17,"a",6),p(18,"By Sales Group"),a()()()()(),n(19,"filters"),E(20,ZC,13,7,"ng-template",null,0,O),a(),n(22,"content"),E(23,Tf,35,26,"div",7),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.VariantName),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.columns),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(11,YC)),o(3),c("routerLink",M(12,jC)),o(3),c("routerLink",M(13,qC)),o(3),c("routerLink",M(14,UC)),o(6),c("ngIf",t.infiniteList&&t.data&&t.data.Data))},dependencies:[A,st,it,Q,J,L,R,ie,U,ze,se,re,oe,ne],encapsulation:2})};var ml=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],sl=i=>({ID:i});function Pf(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Ff(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Supplier"),a(),n(10,"autocompleteV2",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",10)(16,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Currency"),a(),n(19,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(20,"h6"),p(21,"Sort"),a(),n(22,"radio-options",13),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.IsDesc,t)||(l.pageData.Filter.IsDesc=t),_(t)}),a(),n(23,"h6"),p(24,"Purchase Order Tag"),a(),n(25,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Note Visible"),a(),n(28,"radio-options",15),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(29,"h6"),p(30,"Order By"),a(),n(31,"radio-options",16),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.SupplierID),o(4),c("isFloatingLabel",!1),C("date",e.pageData.Filter.From),o(2),c("isFloatingLabel",!1),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),C("model",e.pageData.Filter.IsDesc),c("options",e.AscDscRadio),o(3),c("items",e.pageData.Options.Tags),C("ngModel",e.pageData.Filter.TagID),o(3),C("model",e.pageData.Filter.NoteVisible),o(3),C("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function If(i,s){if(i&1&&(n(0,"th",26),p(1),a()),i&2){let e=m(2);o(),D(" Cost(",e.data.Symbol,") ")}}function bf(i,s){i&1&&(n(0,"th",27),p(1," Disc "),a())}function Ef(i,s){if(i&1&&(n(0,"th",28),p(1),a()),i&2){let e=m(2);o(),D(" Total(",e.data.Symbol,") ")}}function Mf(i,s){i&1&&(n(0,"span"),p(1," /"),a())}function Vf(i,s){if(i&1&&(n(0,"a",33)(1,"span",42),p(2),a()()),i&2){let e=m().$implicit;c("routerLink",M(3,ml))("queryParams",X(4,sl,e.Data.ID)),o(2),F("#"+e.PONumber)}}function Bf(i,s){if(i&1&&(n(0,"th",50),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitPrice)," ")}}function Of(i,s){if(i&1&&(n(0,"div",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e==null?null:e.DiscountAmount)," ")}}function Lf(i,s){if(i&1&&(n(0,"th",51),p(1),d(2,"amountFraction"),S(3,Of,3,3,"div",53),a()),i&2){let e=m().$implicit;o(),D(" ",(e==null?null:e.Discount)==0?"":g(2,2,e==null?null:e.Discount)+"%"," "),o(2),y((e==null?null:e.DiscountAmount)>0?3:-1)}}function Rf(i,s){if(i&1&&(n(0,"th",52),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.Total)," ")}}function kf(i,s){if(i&1&&(n(0,"tr")(1,"th",43)(2,"div",44)(3,"span"),p(4),a(),b(5,"small",45),a()(),n(6,"th",46),p(7),a(),n(8,"th",47),p(9),d(10,"quantityFraction"),a(),n(11,"th",48),p(12),d(13,"quantityFraction"),a(),n(14,"th",49),p(15),a(),S(16,Bf,3,3,"th",50),S(17,Lf,4,4,"th",51),S(18,Rf,3,3,"th",52),a()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(10,9,e==null?null:e.QtyRequested)," "),o(3),D(" ",g(13,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?16:-1),o(),y(r.roleService.product.Cost?17:-1),o(),y(r.roleService.product.Cost?18:-1)}}function Wf(i,s){if(i&1&&(n(0,"tr")(1,"th",59),p(2),a(),n(3,"th",60),p(4),a(),n(5,"th",61),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e==null?null:e.CurrencySymbol," "),o(2),D(" ",g(7,3,e==null?null:e.Amount)," ")}}function Nf(i,s){if(i&1&&(n(0,"table",41),G(1,Wf,8,5,"tr",null,Y),a()),i&2){let e=m(2).$implicit;o(),H(e==null?null:e.Aggregate)}}function Af(i,s){if(i&1&&(n(0,"tfoot",41)(1,"tr",54)(2,"td",55),p(3,"Total"),a(),n(4,"td",56)(5,"b"),p(6),d(7,"sum"),d(8,"quantityFraction"),a()(),b(9,"td",57),n(10,"td",58),S(11,Nf,3,0,"table",41),a()()()),i&2){let e=m().$implicit,r=m(2);o(6),F(g(8,5,v(7,2,e.Items,"Quantity"))),o(5),y(r.roleService.product.Cost?11:-1)}}function Gf(i,s){if(i&1&&(n(0,"div")(1,"div",31)(2,"div",32)(3,"a",33)(4,"span",34),p(5),a()(),S(6,Mf,2,0,"span"),S(7,Vf,3,6,"a",33),n(8,"span"),p(9),d(10,"date"),a(),b(11,"span",23),n(12,"strong",35),p(13),d(14,"sum"),d(15,"sum"),d(16,"quantityFraction"),a(),b(17,"small",36),a(),n(18,"div",37)(19,"label",38),p(20),a()()(),n(21,"table",39),b(22,"thead"),n(23,"tbody",40),G(24,kf,19,13,"tr",null,Y),a(),S(26,Af,12,7,"tfoot",41),a()()),i&2){let e=s.$implicit,r=m(2);o(3),c("routerLink",M(21,ml))("queryParams",X(22,sl,e.Data.ID)),o(2),F(e.Data.EntityName+" #"+e.Data.Number),o(),y(r.pageData.DualReceiptNumber?6:-1),o(),y(r.pageData.DualReceiptNumber?7:-1),o(2),F(" - "+v(10,10,e.Data.Date,"dd MMM yyyy")+(e.Data.Name==null?"":" : "+e.Data.Name)),o(4),D(" ","[Q: "+v(14,13,e.Items,"Quantity")+", T: "+g(16,19,v(15,16,e.Items,"Total"))+"]"," "),o(4),c("innerHtml",e==null||e.Data==null?null:e.Data.Note,Ee),o(3),F(e.Data==null?null:e.Data.PaymentStateLabel),o(4),H(e.Items),o(2),y(r.roleService.product.Cost?26:-1)}}function Hf(i,s){if(i&1&&(n(0,"div",62)(1,"div")(2,"strong"),p(3,"Tax Added"),a(),n(4,"span",59),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Purchases with Tax"),a(),n(10,"span",59),p(11),d(12,"amountFraction"),a()()()),i&2){let e=m(3);o(5),F(g(6,2,e.data.Aggregate.TaxAdd)),o(6),F(g(12,4,e.data.Aggregate.PurchaseWithTax))}}function Qf(i,s){if(i&1&&(n(0,"div",62)(1,"div")(2,"strong"),p(3,"Gross Purchase"),a(),n(4,"span",59),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Discount"),a(),n(10,"span",59),p(11),d(12,"amountFraction"),a()(),n(13,"div")(14,"strong"),p(15,"Tax Incl."),a(),n(16,"span",59),p(17),d(18,"amountFraction"),a()(),n(19,"div")(20,"strong"),p(21,"Net Purchase"),a(),n(22,"span",59),p(23),d(24,"amountFraction"),a()()()),i&2){let e=m(3);o(5),F(g(6,4,e.data.Aggregate.Gross)),o(6),F(g(12,6,e.data.Aggregate.Discount)),o(6),F(g(18,8,e.data.Aggregate.TaxInclude)),o(6),F(g(24,10,e.data.Aggregate.NetPurchase))}}function Yf(i,s){if(i&1&&(n(0,"div",30),S(1,Hf,13,6,"div",62),n(2,"div",62)(3,"div")(4,"strong"),p(5,"Orders"),a(),n(6,"span",59),p(7),d(8,"amountFraction"),a()(),n(9,"div")(10,"strong"),p(11,"Qty"),a(),n(12,"span",59),p(13),d(14,"quantityFraction"),a()()(),S(15,Qf,25,12,"div",62),a()),i&2){let e=m(2);o(),y(e.roleService.product.Cost?1:-1),o(6),F(g(8,4,e.data.Aggregate.TotalTransaction)),o(6),F(g(14,6,e.data.Aggregate.UnitQuantity)),o(2),y(e.roleService.product.Cost?15:-1)}}function jf(i,s){if(i&1&&(n(0,"content")(1,"div",17)(2,"table",18)(3,"thead",19)(4,"tr")(5,"th",20),p(6,"Name"),a(),n(7,"th",21),p(8,"Code"),a(),n(9,"th",22)(10,"span",23),p(11,"Requested"),a(),p(12," qty "),a(),n(13,"th",24),p(14,"Qty"),a(),n(15,"th",25),p(16,"UOM"),a(),S(17,If,2,1,"th",26),S(18,bf,2,0,"th",27),S(19,Ef,2,1,"th",28),a()(),n(20,"tbody")(21,"tr")(22,"td",29),G(23,Gf,27,24,"div",null,Y),a()()()(),S(25,Yf,16,8,"div",30),a()()),i&2){let e=m();o(17),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(3),li("colspan",e.roleService.product.Cost?8:6),o(),H(e.data.Data),o(2),y(e.data.Data.length>0?25:-1)}}var Da=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/GetPurchaseTransactionDetail","ReportLoader/GetPurchaseTransactionDetail");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.roleService=h;this.matDialog=T}hideMore=!0;AscDscRadio=[{Key:!1,Value:"Asc"},{Key:!0,Value:"Desc"}];SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];openExportModal(){this.matDialog.open(K,{data:{title:"Product Transaction Detail",exportTypes:[{ID:"ReportExport/ReportPurchaseDetail",Value:"Default",FileName:"Product Transaction Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty),this.datePipe.transform(this.pageData.Filter.From,"MMM")===this.datePipe.transform(this.pageData.Filter.To,"MMM")&&this.datePipe.transform(this.pageData.Filter.From,"yyyy")===this.datePipe.transform(this.pageData.Filter.To,"yyyy")?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d")}`:this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`,this.pageData.Filter.From==this.pageData.Filter.To?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`:this.menuData.H+=` - ${this.datePipe.transform(this.pageData.Filter.To,"d MMM yyyy")}`,this.menuData.H+=" ]"}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],[1,"mt-4"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","AscDesc",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","items","ngModel"],["name","NoteVisible",3,"modelChange","model"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","355px"],[2,"width","50px"],[1,"text-end",2,"width","55px"],[1,"d-block"],[1,"text-end",2,"width","33px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"red",2,"width","30px"],[1,"text-end",2,"width","150px"],[1,"px-0","border-bottom-0"],[1,"row","justify-content-end"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","mt-2","mb-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-3"],[1,"text-danger","ms-3"],[1,"d-block","fw-normal","fst-italic","ms-3",2,"word-break","break-all",3,"innerHtml"],[1,"d-lg-block","mt-2","me-5","fw-bold","fst-italic"],["runat","server",1,"status"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"table","table-sm","table-borderless"],["id","PONumber"],[1,"fw-normal","border-start","border-end",2,"width","325px"],[1,"lh-base"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","50px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","65px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","30px"],[1,"fst-italic","border-start","border-end","small",2,"width","40px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","80px"],[1,"fw-normal","border-start","border-end","text-end","text-danger",2,"width","30px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","140px"],[1,"text-danger"],[1,"grid_footer"],["colspan","2",1,"text-end","fw-bold"],["colspan","2",1,"text-end"],["colspan","3"],[1,"text-end","d-flex","justify-content-end","fw-bold"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[1,"zebra","col-auto"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Pf,3,0,"button",2),a(),n(3,"filters"),E(4,Ff,32,20,"ng-template",null,0,O),a(),S(6,jf,26,5,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,Te,Ae,Ce,U,se,oe,Z,ne],encapsulation:2})};var cl=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],wo=i=>({ID:i}),qf=()=>["/menu/Contacts/Contact/Suppliers/Info"];function Uf(i,s){if(i&1){let e=I();n(0,"button",31),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",32),p(2," Export "),a()}}function zf(i,s){if(i&1){let e=I();n(0,"div")(1,"div",33)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",34),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",35),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",36)(10,"datepicker",37),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Payment"),a(),n(13,"ng-select",38),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.StateID,t)||(l.pageData.Filter.StateID=t),_(t)}),a(),n(14,"h6"),p(15,"Supplier"),a(),n(16,"autocompleteV2",39),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(17,"h6"),p(18,"RowCount"),a(),n(19,"input",40),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(20,"h6"),p(21,"Order By"),a(),n(22,"radio-options",41),x("modelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m(2);return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=m(2);o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.StateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),C("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.contactDisplay),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount),o(3),C("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Kf(i,s){i&1&&(n(0,"th",13),p(1," Purchase "),a())}function Xf(i,s){i&1&&(n(0,"th",14),p(1," Tax "),a())}function Jf(i,s){i&1&&(n(0,"th",15),p(1," Purchase+Tax "),a())}function Zf(i,s){i&1&&(n(0,"th",16),p(1," Payment "),a())}function $f(i,s){i&1&&b(0,"br")}function ex(i,s){if(i&1&&(n(0,"a",42),p(1),a()),i&2){let e=m().$implicit;c("routerLink",M(3,cl))("queryParams",X(4,wo,e.PurchaseOrderID)),o(),F(e.PONumber)}}function tx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function ix(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function nx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalAmount)," ")}}function ax(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PaymentAmount)," ")}}function ox(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",42),p(5),a(),S(6,$f,1,0,"br"),S(7,ex,2,6,"a",42),a(),n(8,"td"),p(9),d(10,"date"),a(),n(11,"td")(12,"a",42),p(13),a()(),n(14,"td",21),p(15),d(16,"quantityFraction"),a(),S(17,tx,3,3,"td",21),S(18,ix,3,3,"td",22),S(19,nx,3,3,"td",21),S(20,ax,3,3,"td",21),n(21,"td"),p(22),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(25,cl))("queryParams",X(26,wo,e.ID)),o(),F(e.Number),o(),y(r.pageData.DualNumber?6:-1),o(),y(r.pageData.DualNumber?7:-1),o(2),F(v(10,20,e.Date,"dd MMM yyyy")),o(3),c("routerLink",M(28,qf))("queryParams",X(29,wo,e.SupplierID)),o(),D(" ",e.SupplierNameDisplay," "),o(2),D(" ",g(16,23,e.TotalItemQuantity)," "),o(2),y(r.roleService.product.Cost?17:-1),o(),y(r.roleService.product.Cost?18:-1),o(),y(r.roleService.product.Cost?19:-1),o(),y(r.roleService.product.Cost?20:-1),o(),ji("text-danger",e.PaymentStateLabel==="Unpaid")("text-success",e.PaymentStateLabel==="Paid"),o(),D(" ",e.PaymentStateLabel," ")}}function rx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function lx(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function px(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"TotalAmount"))," ")}}function mx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"PaymentAmount"))," ")}}function sx(i,s){if(i&1){let e=I();n(0,"span",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountReportPurchaseSummary"))}),n(1,"i",44),p(2,"?"),a()()}}function cx(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function dx(i,s){if(i&1){let e=I();n(0,"a",45),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",46),p(2," Next"),a()}}function ux(i,s){if(i&1){let e=I();n(0,"a",47),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountReportPurchaseSummary",!0))}),b(1,"i",48),p(2," Show All"),a()}}function _x(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),x("textChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Number,t)||(l.pageData.Filter.Number=t),_(t)}),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,Uf,3,0,"button",3),a(),n(3,"filters"),E(4,zf,23,14,"ng-template",null,0,O),a(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Outlet"),a(),n(14,"th",9),p(15,"Number"),a(),n(16,"th",10),p(17,"Date"),a(),n(18,"th",11),p(19," Supplier "),a(),n(20,"th",12),p(21," Qty "),a(),S(22,Kf,2,0,"th",13),S(23,Xf,2,0,"th",14),S(24,Jf,2,0,"th",15),S(25,Zf,2,0,"th",16),n(26,"th",17),p(27,"State"),a()()(),n(28,"tbody"),G(29,ox,23,31,"tr",null,Y),a(),n(31,"tfoot")(32,"tr",18),b(33,"td",19),n(34,"td",20),p(35,"Total :"),a(),n(36,"td",21),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),S(40,rx,4,6,"td",21),S(41,lx,4,6,"td",22),S(42,px,4,6,"td",21),S(43,mx,4,6,"td",21),b(44,"td",23),a()()()(),n(45,"div",24)(46,"div",25)(47,"div",26),p(48),d(49,"number"),E(50,sx,3,0,"span",27)(51,cx,3,3,"span",28),p(52),a()(),E(53,dx,3,0,"a",29)(54,ux,3,0,"a",30),a()()()()}if(i&2){let e=m();c("pageData",e.menuData),C("text",e.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(20),y(e.roleService.product.Cost?22:-1),o(),y(e.roleService.product.Cost?23:-1),o(),y(e.roleService.product.Cost?24:-1),o(),y(e.roleService.product.Cost?25:-1),o(4),H(e.infiniteList),o(8),D(" ",g(39,23,v(38,20,e.infiniteList,"TotalItemQuantity"))," "),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.product.Cost?41:-1),o(),y(e.roleService.product.Cost?42:-1),o(),y(e.roleService.product.Cost?43:-1),o(5),D(" Showing 1 - ",g(49,25,e.infiniteList.length)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var va=class i extends vi{constructor(e,r,t,l,h,T){super(e,r,"Report/ReportPurchaseSummary","ReportLoader/GetReportPurchaseSummary",null,l);this.httpService=r;this.csvConverter=t;this.url=l;this.roleService=h;this.matDialog=T}contactDisplay;preInitLoader(){let e=this.loaderPayload.ListIDs;typeof e=="string"&&V.IsNotEmpty(e)&&(this.loaderPayload.ListIDs=[e])}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Report Summary",exportTypes:[{ID:"ReportExport/ReportPurchaseSummary",Value:"Default",FileName:"Purchase Report Summary"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){super.postInit(e),this.menuData.H=e.PageTitle}preInitList(){V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null),V.IsNotEmpty(this.pageData.Filter.SupplierID)&&(this.pageData.Filter.From=V.MinDate),V.IsNotEmpty(this.pageData.SupplierName)&&(this.contactDisplay=this.pageData.SupplierName)}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,t.SupplierNameDisplay=t.SupplierNameDisplay==null?"":t.SupplierNameDisplay,l.SupplierNameDisplay=l.SupplierNameDisplay==null?"":l.SupplierNameDisplay,e.active){case"EntityName":return V.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),h);case"Number":return V.compare(t.Number,l.Number,h);case"Date":return V.compare(t.Date,l.Date,h);case"SupplierNameDisplay":return V.compare(t.SupplierNameDisplay.toLocaleLowerCase(),l.SupplierNameDisplay.toLocaleLowerCase(),h);case"TotalItemQuantity":return V.compare(t.TotalItemQuantity,l.TotalItemQuantity,h);case"Total":return V.compare(t.TotalAmount,l.TotalAmount,h);case"Sales":return V.compare(t.Sales,l.Sales,h);case"Tax":return V.compare(t.Tax,l.Tax,h);case"PaymentAmount":return V.compare(t.PaymentAmount,l.PaymentAmount,h);case"PaymentState":return V.compare(t.PaymentStateLabel,l.PaymentStateLabel,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-detail-summary"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName"],["mat-sort-header","Number"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","SupplierNameDisplay",2,"width","118px"],["mat-sort-header","TotalItemQuantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right","text-end",2,"width","118px"],["mat-sort-header","PaymentAmount","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","PaymentState",2,"width","70px"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end","empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"empty-column"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more data",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,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Sort",3,"modelChange","model","options"],[3,"routerLink","queryParams"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more data",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){r&1&&S(0,_x,55,27,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,it,Q,$,J,Qe,L,R,ie,pe,ge,Ue,Te,Ae,U,se,re,oe,Z,ne],encapsulation:2})};var gx=()=>["/menu/Contacts/Contact/Suppliers/Info"],Cx=i=>({ID:i}),fx=(i,s,e)=>({SupplierID:i,From:s,To:e}),xx=()=>["/menu/Reports/Purchases_Report/Summary"];function hx(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Sx(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier Group"),a(),n(7,"ng-select",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",9)(13,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function yx(i,s){i&1&&(n(0,"th",20),p(1," Purchase "),a())}function Dx(i,s){if(i&1&&(n(0,"td",24)(1,"a",30),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(11,fx,e.SupplierID,v(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),v(3,6,r.pageData.Filter.To,"yyyy-MM-dd")))("routerLink",M(15,xx)),o(3),F(g(5,9,e.Total))}}function vx(i,s){if(i&1&&(n(0,"tr",21)(1,"td"),p(2),a(),n(3,"td",27)(4,"a",28),p(5),a()(),n(6,"td",24),p(7),a(),n(8,"td",29),p(9),d(10,"quantityFraction"),a(),S(11,Dx,6,16,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",M(9,gx))("queryParams",X(10,Cx,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,7,e.Quantity)," "),o(2),y(r.roleService.product.Cost?11:-1)}}function wx(i,s){i&1&&(n(0,"th",24),p(1," Total Purchase "),a())}function Tx(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(2,1,e.data.TotalSales)," ")}}function Px(i,s){if(i&1){let e=I();n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",15)(5,"tr")(6,"th",16),p(7,"Rank"),a(),n(8,"th",17),p(9,"Supplier"),a(),n(10,"th",18),p(11," Code "),a(),n(12,"th",19),p(13," Quantity "),a(),S(14,yx,2,0,"th",20),a()(),n(15,"tbody"),G(16,vx,12,12,"tr",21,Y),a(),n(18,"tfoot")(19,"tr",22),b(20,"th",23),n(21,"th",24),p(22,"Total Quantity"),a(),S(23,wx,2,0,"th",24),a(),n(24,"tr"),b(25,"td",25),n(26,"td",24),p(27),d(28,"quantityFraction"),a(),S(29,Tx,3,3,"td",24),a()()(),n(30,"POS-complex-pagination",26),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(2),H(e.data.Data),o(7),y(e.roleService.product.Cost?23:-1),o(4),F(g(28,6,e.data.TotalQty)),o(2),y(e.roleService.product.Cost?29:-1),o(),c("total",e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var wa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/TopSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopPurchaseExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/TopSupplierCount",pagination:!0}})}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Code":return this.compare(t.Code,l.Code,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Total":return this.compare(t.Total,l.Total,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-top-supplier"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","35px"],["mat-sort-header","Name"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"thead-light"],["colspan","3"],[1,"text-end"],["colspan","3",1,"bg-white","border-top-0"],["api","Report/TopSupplierCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end","text-success"],[3,"queryParams","routerLink"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,hx,3,0,"button",2),a(),n(3,"filters"),E(4,Sx,17,11,"ng-template",null,0,O),a(),S(6,Px,31,8,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,Qe,L,R,pe,ge,Ue,Et,U,oe,Z,ne],encapsulation:2})};var Fx=i=>[i],Ix=i=>({ID:i}),bx=(i,s,e,r)=>({VariantID:i,ProductID:s,From:e,To:r});function Ex(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Mx(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Currency"),a(),n(10,"ng-select",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",10)(16,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Group By"),a(),n(19,"radio-options",12),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(20,"h6"),p(21,"Brand"),a(),n(22,"ng-select",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.pageData.Filter.GroupByProduct),c("options",e.GroupByRadio),o(3),c("multiple",!1),C("ngModel",e.pageData.Filter.BrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function Vx(i,s){i&1&&(n(0,"th"),p(1,"Variant"),a())}function Bx(i,s){i&1&&(n(0,"th",22),p(1," Cost "),a())}function Ox(i,s){i&1&&(n(0,"th",23),p(1," Gross "),a())}function Lx(i,s){i&1&&(n(0,"th",24),p(1," Purchase "),a())}function Rx(i,s){i&1&&(n(0,"th",25),p(1," Tax "),a())}function kx(i,s){i&1&&(n(0,"th",26),p(1," Purchase+Tax "),a())}function Wx(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.VariantName)}}function Nx(i,s){if(i&1&&(n(0,"td",29)(1,"a",32),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",Ut(4,bx,r.pageData.Filter.GroupByProduct?null:e.ID,r.pageData.Filter.GroupByProduct?e.ID:null,r.dateFromString(),r.dateToString())),o(),D(" ",g(3,2,e.UnitPrice)," ")}}function Ax(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function Gx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetPrice)," ")}}function Hx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Qx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PurchaseNTax)," ")}}function Yx(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",31),p(5),a()(),S(6,Wx,2,1,"td"),n(7,"td"),p(8),a(),n(9,"td",29),p(10),d(11,"number"),a(),n(12,"td",29),p(13),d(14,"quantityFraction"),a(),S(15,Nx,4,9,"td",29),S(16,Ax,3,3,"td",29),S(17,Gx,3,3,"td",29),S(18,Hx,3,3,"td",29),S(19,Qx,3,3,"td",29),a()),i&2){let e=s.$implicit,r=s.$index,t=m(2);o(2),F(r+1),o(2),c("routerLink",X(17,Fx,t.pageData.Filter.GroupByProduct?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(19,Ix,e.ID)),o(),F(e.Name),o(),y(t.pageData.Filter.GroupByProduct?-1:6),o(2),D(" ",t.pageData.Filter.GroupByProduct?e.ProductCode:e.VariantCode," "),o(2),F(g(11,13,e.Order)),o(3),F(g(14,15,e.Quantity)),o(2),y(t.roleService.product.Cost?15:-1),o(),y(t.roleService.product.Cost?16:-1),o(),y(t.roleService.product.Cost?17:-1),o(),y(t.roleService.product.Cost?18:-1),o(),y(t.roleService.product.Cost?19:-1)}}function jx(i,s){i&1&&b(0,"td")}function qx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"UnitPrice"))," ")}}function Ux(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function zx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"NetPrice"))," ")}}function Kx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function Xx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"PurchaseNTax"))," ")}}function Jx(i,s){if(i&1){let e=I();n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16)(4,"thead",17),P("matSortChange",function(t){u(e);let l=m();return _(l.onSortChange(t))}),n(5,"tr")(6,"th",18),p(7,"No"),a(),n(8,"th"),p(9,"Product"),a(),S(10,Vx,2,0,"th"),n(11,"th",19),p(12,"Code"),a(),n(13,"th",20),p(14," Orders "),a(),n(15,"th",21),p(16," Quantity "),a(),S(17,Bx,2,0,"th",22),S(18,Ox,2,0,"th",23),S(19,Lx,2,0,"th",24),S(20,Rx,2,0,"th",25),S(21,kx,2,0,"th",26),a()(),n(22,"tbody"),G(23,Yx,20,21,"tr",null,Y),a(),n(25,"tfoot")(26,"tr",27),b(27,"td"),S(28,jx,1,0,"td"),b(29,"td",28),n(30,"td"),p(31,"Total :"),a(),n(32,"td",29),p(33),d(34,"sum"),d(35,"number"),a(),n(36,"td",29),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),S(40,qx,4,6,"td",29),S(41,Ux,4,6,"td",29),S(42,zx,4,6,"td",29),S(43,Kx,4,6,"td",29),S(44,Xx,4,6,"td",29),a()()()(),n(45,"infinite-pagination",30),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount",!0))}),a()()()}if(i&2){let e=m();o(10),y(e.pageData.Filter.GroupByProduct?-1:10),o(7),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(),y(e.roleService.product.Cost?20:-1),o(),y(e.roleService.product.Cost?21:-1),o(2),H(e.infiniteList),o(5),y(e.pageData.Filter.GroupByProduct?-1:28),o(5),D(" ",g(35,23,v(34,20,e.infiniteList,"Order"))," "),o(4),D(" ",g(39,28,v(38,25,e.infiniteList,"Quantity"))," "),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.product.Cost?41:-1),o(),y(e.roleService.product.Cost?42:-1),o(),y(e.roleService.product.Cost?43:-1),o(),y(e.roleService.product.Cost?44:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Ta=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/PurchasesByProductList","ReportLoader/PurchasesByProductLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}GroupByRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];dateFromString=xi(()=>{let e=this.pageData.Filter.From;return e?new Date(e).toJSON():null});dateToString=xi(()=>{let e=this.pageData.Filter.To;return e?new Date(e).toJSON():null});openExportModal(){this.matDialog.open(K,{data:{title:"Product Bought Report",exportTypes:[{ID:"ReportExport/PurchasesByProductExport",Value:"Default",FileName:"Product Bought Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}onSortChange(e){let r=this.infiniteList.slice();if(!e.active||e.direction===""){this.infiniteList=this.originalData;return}this.infiniteList=r.sort((t,l)=>{let h=e.direction==="asc";return this.compare(t[e.active],l[e.active],h)})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-bought"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","GroupBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],["matSort","",1,"thead-light","sticky-top-thead",3,"matSortChange"],[2,"width","10px"],[2,"width","100px"],["mat-sort-header","Order","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","140px"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Purchase","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","PurchaseNTax","arrowPosition","before",1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],["routerLink","/menu/Reports/Purchases_Report/History",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Ex,3,0,"button",2),a(),n(3,"filters"),E(4,Mx,23,15,"ng-template",null,0,O),a(),S(6,Jx,46,30,"content"),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,Te,Ce,U,ti,se,re,Z,ne],encapsulation:2})};var Zx=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Pa=i=>({ID:i}),$x=()=>["/menu/Products/Catalog/Variants/Info"],eh=()=>["/menu/Contacts/Contact/Suppliers/Info"],th=()=>["/menu/Products/Catalog/Products/Info"];function ih(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function nh(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product"),a(),n(3,"autocompleteV2",16),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),C("ngModel",e.pageData.Filter.ProductID),c("inputTextValue",e.pageData.ProductName)}}function ah(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Variant"),a(),n(3,"autocompleteV2",17),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),C("ngModel",e.pageData.Filter.VariantID),c("renderThumbnail",!0)("inputTextValue",e.pageData.VariantName)}}function oh(i,s){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier"),a(),n(7,"autocompleteV2",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(8,"h6"),p(9,"Scope"),a(),n(10,"radio-options",9),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ByProduct,t)||(l.pageData.Filter.ByProduct=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()(),E(11,nh,4,2,"div",3)(12,ah,4,3,"div",3),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(17,"div",11)(18,"datepicker",12),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(19,"h6"),p(20,"Order By"),a(),n(21,"radio-options",13),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.OrderByNumber,t)||(l.pageData.Filter.OrderByNumber=t),_(t)}),a(),n(22,"h6"),p(23,"Currency"),a(),n(24,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(25,"h6"),p(26,"Brand"),a(),n(27,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()}if(i&2){let e=m();o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.SupplierID),o(3),C("model",e.pageData.Filter.ByProduct),c("options",e.ScopeRadio),o(),c("ngIf",e.pageData.Filter.ByProduct),o(),c("ngIf",!e.pageData.Filter.ByProduct),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.pageData.Filter.OrderByNumber),c("options",e.OrderByRadio),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("multiple",!1),C("ngModel",e.pageData.Filter.BrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function rh(i,s){i&1&&(n(0,"th",38),p(1,"Date"),a())}function lh(i,s){i&1&&(n(0,"th"),p(1,"Outlet"),a())}function ph(i,s){i&1&&(n(0,"th"),p(1," Supplier "),a())}function mh(i,s){i&1&&(n(0,"th",39),p(1," Fulfillment "),a())}function sh(i,s){i&1&&(n(0,"th"),p(1,"Product"),a())}function ch(i,s){i&1&&(n(0,"th",40),p(1," Qty "),a())}function dh(i,s){i&1&&(n(0,"th",41),p(1," Unit Quantity "),a())}function uh(i,s){i&1&&(n(0,"th",42)(1,"span",43),p(2," Cost "),a()())}function _h(i,s){i&1&&(n(0,"th",44)(1,"span",45),p(2," Gross "),a()())}function gh(i,s){i&1&&(n(0,"th",40),p(1," Item (%) "),a())}function Ch(i,s){i&1&&(n(0,"th",46),p(1," Item Disc "),a())}function fh(i,s){i&1&&(n(0,"th",40),p(1," Bill(%) "),a())}function xh(i,s){i&1&&(n(0,"th",46),p(1," Bill Disc "),a())}function hh(i,s){i&1&&(n(0,"th",47)(1,"span",48),p(2," Purchase + Tax "),a()())}function Sh(i,s){i&1&&(n(0,"th"),p(1,"Item Note"),a())}function yh(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Date,"dd MMM yyyy")," ")}}function Dh(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.EntityName)}}function vh(i,s){if(i&1&&(n(0,"td")(1,"a",50),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,eh))("queryParams",X(4,Pa,e.SupplierID)),o(),F(e.SupplierName)}}function wh(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryStatus," ")}}function Th(i,s){if(i&1&&(n(0,"td")(1,"a",50),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,th))("queryParams",X(4,Pa,e.ProductID)),o(),F(e.Name)}}function Ph(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Fh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.VariantUnitQuantity)," ")}}function Ih(i,s){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.UnitPrice)," ")}}function bh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function Eh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.Discount>0?g(2,1,e.Discount):"0"," ")}}function Mh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.ItemDiscountAmount>0?g(2,1,e.ItemDiscountAmount):"0"," ")}}function Vh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DiscountInvoice>0?g(2,1,e.DiscountInvoice):"0"," ")}}function Bh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.OrderDiscountAmount>0?g(2,1,e.OrderDiscountAmount):"0"," ")}}function Oh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PurchaseNTax)," ")}}function Lh(i,s){if(i&1&&b(0,"td",53),i&2){let e=m().$implicit;c("innerHTML",e.Note,Ee)}}function Rh(i,s){if(i&1&&(n(0,"tr",49),E(1,yh,3,4,"td",3)(2,Dh,2,1,"td",3),n(3,"td")(4,"a",50),p(5),a()(),E(6,vh,3,6,"td",3)(7,wh,2,1,"td",3)(8,Th,3,6,"td",3),n(9,"td")(10,"a",50),p(11),a()(),E(12,Ph,3,3,"td",30)(13,Fh,3,3,"td",30)(14,Ih,3,3,"td",35)(15,bh,3,3,"td",30)(16,Eh,3,3,"td",30)(17,Mh,3,3,"td",30)(18,Vh,3,3,"td",30)(19,Bh,3,3,"td",30)(20,Oh,3,3,"td",30)(21,Lh,1,1,"td",51),a()),i&2){let e=s.$implicit,r=m(2);o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Outlet.selected),o(2),c("routerLink",M(21,Zx))("queryParams",X(22,Pa,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",r.column.Supplier.selected),o(),c("ngIf",r.column.Fulfillment.selected),o(),c("ngIf",r.pageData.Filter.ByProduct),o(2),c("routerLink",M(24,$x))("queryParams",X(25,Pa,e.VariantID)),o(),F(e.Model),o(),c("ngIf",r.column.Qty.selected),o(),c("ngIf",r.column.UnitQty.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.UnitCost.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Gross.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.ItemPercentage.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.ItemDiscount.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.BillPercentage.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.BillDiscount.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.PurchaseNTax.selected),o(),c("ngIf",r.column.ItemNote.selected)}}function kh(i,s){i&1&&b(0,"td",34)}function Wh(i,s){i&1&&b(0,"td",34)}function Nh(i,s){i&1&&b(0,"td",34)}function Ah(i,s){i&1&&b(0,"td",34)}function Gh(i,s){i&1&&b(0,"td",34)}function Hh(i,s){i&1&&(n(0,"td",47),p(1," Total : "),a())}function Qh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function Yh(i,s){i&1&&b(0,"td",34)}function jh(i,s){if(i&1&&(n(0,"td",52),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"UnitPrice"))," ")}}function qh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Gross"))," ")}}function Uh(i,s){i&1&&b(0,"td",34)}function zh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ItemDiscountAmount"))," ")}}function Kh(i,s){i&1&&b(0,"td",34)}function Xh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"OrderDiscountAmount"))," ")}}function Jh(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"PurchaseNTax"))," ")}}function Zh(i,s){i&1&&b(0,"td",34)}function $h(i,s){if(i&1){let e=I();n(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr"),E(6,rh,2,0,"th",22)(7,lh,2,0,"th",3),n(8,"th",23),p(9,"Number"),a(),E(10,ph,2,0,"th",3)(11,mh,2,0,"th",24)(12,sh,2,0,"th",3),n(13,"th"),p(14,"Variant"),a(),E(15,ch,2,0,"th",25)(16,dh,2,0,"th",26)(17,uh,3,0,"th",27)(18,_h,3,0,"th",28)(19,gh,2,0,"th",25)(20,Ch,2,0,"th",29)(21,fh,2,0,"th",25)(22,xh,2,0,"th",29)(23,hh,3,0,"th",30)(24,Sh,2,0,"th",3),a()(),n(25,"tbody"),E(26,Rh,22,27,"tr",31),a(),n(27,"tfoot")(28,"tr",32),E(29,kh,1,0,"td",33)(30,Wh,1,0,"td",33),b(31,"td",34),E(32,Nh,1,0,"td",33)(33,Ah,1,0,"td",33)(34,Gh,1,0,"td",33)(35,Hh,2,0,"td",30)(36,Qh,4,6,"td",30)(37,Yh,1,0,"td",33)(38,jh,4,6,"td",35)(39,qh,4,6,"td",30)(40,Uh,1,0,"td",33)(41,zh,4,6,"td",30)(42,Kh,1,0,"td",33)(43,Xh,4,6,"td",30)(44,Jh,4,6,"td",36)(45,Zh,1,0,"td",33),a()()()(),n(46,"POS-complex-pagination",37),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Outlet.selected),o(3),c("ngIf",e.column.Supplier.selected&&e.column.Supplier.selected),o(),c("ngIf",e.column.Fulfillment.selected),o(),c("ngIf",e.pageData.Filter.ByProduct),o(3),c("ngIf",e.column.Qty.selected),o(),c("ngIf",e.column.UnitQty.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.UnitCost.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Gross.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.ItemPercentage.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.ItemDiscount.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.BillPercentage.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.BillDiscount.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.PurchaseNTax.selected),o(),c("ngIf",e.column.ItemNote.selected),o(2),c("ngForOf",e.data.Data),o(3),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Outlet.selected),o(2),c("ngIf",e.column.Supplier.selected),o(),c("ngIf",e.column.Fulfillment.selected),o(),c("ngIf",e.pageData.Filter.ByProduct),o(),c("ngIf",e.column.Qty.selected||e.column.PurchaseNTax.selected),o(),c("ngIf",e.column.Qty.selected),o(),c("ngIf",e.column.UnitQty.selected),o(),c("ngIf",e.column.UnitCost.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.Gross.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.ItemPercentage.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.ItemDiscount.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.BillPercentage.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.BillDiscount.selected&&e.roleService.product.Cost),o(),c("ngIf",e.roleService.product.Cost&&e.column.PurchaseNTax.selected),o(),c("ngIf",e.column.ItemNote.selected),o(),c("total",e.data.Data.length)("pageData",e.pageData)}}var Fa=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/ProductPurchaseHistory","ReportLoader/ProductPurchaseHistoryLoader",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=h;this.matDialog=T}columnService=Pe(gt);column={Date:{selected:!0},Outlet:{selected:!0},Supplier:{selected:!0},Fulfillment:{selected:!1},Qty:{selected:!0,name:"Quantity"},UnitQty:{selected:!1,name:"Unit Quantity"},UnitCost:{selected:!1,name:"Unit Cost"},Gross:{selected:!0,name:"Gross Purchase"},ItemPercentage:{selected:!1,name:"Item (%)"},ItemDiscount:{selected:!1,name:"Item Disc"},BillPercentage:{selected:!1,name:"Bill (%)"},BillDiscount:{selected:!1,name:"Bill Disc"},PurchaseNTax:{selected:!0,name:"Purchase N Tax"},ItemNote:{selected:!1,name:"Item Note"}};ScopeRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];OrderByRadio=[{Key:!0,Value:"Date & Number"},{Key:!1,Value:"Supplier"}];hideMore=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Product Purchase History",exportTypes:[{ID:"ReportExport/ProductPurchaseHistory",Value:"Default",FileName:"Product Purchase History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){let e=this.activatedRoute.snapshot?.queryParams;this.pageData.Filter.From=!e.VariantID&&e.From?e.From:e.VariantID?null:this.pageData.Filter.From,this.pageData.Filter.To=!e.VariantID&&e.To?e.To:e.VariantID?null:this.pageData.Filter.To,this.pageData.Filter.VariantID=V.IsNotEmpty(e.VariantID)?e.VariantID:V.GuidEmpty,this.pageData.Filter.ProductID=V.IsNotEmpty(e.ProductID)?e.ProductID:V.GuidEmpty,this.pageData.Filter.ByProduct=V.IsNotEmpty(e.ProductID),V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-purchase-history"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","OrderBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search Product",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail","inputTextValue"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 100px",4,"ngIf"],[2,"width","70px"],["style","width: 80px",4,"ngIf"],["style","width: 50px","class","text-end",4,"ngIf"],["style","width: 60px","class","text-end",4,"ngIf"],["style","width: 75px","class","text-end",4,"ngIf"],["style","width: 75px","class","text-end","title","Original cost multiplied by quantity",4,"ngIf"],["style","width: 70px","class","text-end",4,"ngIf"],["class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end text-danger",4,"ngIf"],["class","text-end","colspan","6",4,"ngIf"],["api","report/ProductPurchaseHistoryCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[2,"width","100px"],[2,"width","80px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","60px"],[1,"text-end",2,"width","75px"],["matTooltip","Original Cost for One Quantity Before Discount & Tax","matTooltipPosition","above"],["title","Original cost multiplied by quantity",1,"text-end",2,"width","75px"],["matTooltip","Unit Cost Multiplied by Quantity","matTooltipPosition","above"],[1,"text-end",2,"width","70px"],[1,"text-end"],["matTooltip","Gross Purchase After Discount & Tax","matTooltipPosition","above"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"innerHTML",4,"ngIf"],[1,"text-end","text-danger"],[3,"innerHTML"],["colspan","6",1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,ih,3,0,"button",2),a(),n(3,"filters"),E(4,oh,28,18,"ng-template",null,0,O),a(),E(6,$h,47,34,"content",3),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,L,R,ie,Te,Ae,Et,U,se,oe,Z,ne],encapsulation:2})};var e2=()=>["/menu/Reports/Purchases_Report/Daily/Monthly"];function t2(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function i2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",8),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Month"),a(),n(13,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(14,"h6"),p(15,"Currency"),a(),n(16,"ng-select",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(17,"h6"),p(18,"Multiply Unit Qty"),a(),n(19,"radio-options",12),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),C("model",e.pageData.Filter.MultiplyUnitQuantity),c("options",e.YesNoRadio)}}function n2(i,s){i&1&&(n(0,"th",17),p(1," Purchases "),a())}function a2(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PurchaseTotal)," ")}}function o2(i,s){if(i&1&&(n(0,"tr",18)(1,"td"),p(2),d(3,"date"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"quantityFraction"),a(),S(10,a2,3,3,"td",17),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(v(3,4,e.Date,"EEEE")),o(3),F(g(6,7,e.Day)),o(3),F(g(9,9,e.Quantity)),o(2),y(r.roleService.product.Cost?10:-1)}}function r2(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"PurchaseTotal"))," ")}}function l2(i,s){if(i&1&&(n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15)(4,"thead",16)(5,"tr")(6,"th"),p(7,"Day"),a(),n(8,"th",17),p(9,"Date (Day)"),a(),n(10,"th",17),p(11,"Quantity"),a(),S(12,n2,2,0,"th",17),a()(),n(13,"tbody"),G(14,o2,11,11,"tr",18,Y),a(),n(16,"tr")(17,"td",19),p(18,"Total"),a(),n(19,"td",17),p(20),d(21,"sum"),d(22,"quantityFraction"),a(),S(23,r2,4,6,"td",17),a()()()()()),i&2){let e=m();o(12),y(e.roleService.product.Cost?12:-1),o(2),H(e.data.Data),o(6),D(" ",g(22,6,v(21,3,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?23:-1)}}var Ia=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/GetPurchasePeriodDaily","ReportLoader/GetReportPurchaseDaily");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Months=V.Months}Years=[];Months=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Daily",exportTypes:[{ID:"ReportExport/DailyPurchaseReport",Value:"Default",FileName:"Purchase Daily"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily-purchases"]],standalone:!1,features:[W],decls:9,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Month","bindLabel","Label","bindValue","ID",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"border-bottom"],["colspan","2",1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,t2,3,0,"button",2),n(3,"a",3),p(4,"View Month"),a()(),n(5,"filters"),E(6,i2,20,14,"ng-template",null,0,O),a(),S(8,l2,24,8,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,e2)),o(5),y(t.data?8:-1))},dependencies:[A,Q,$,L,R,ie,Te,Ce,U,se,re,oe,Z,ne],encapsulation:2})};var p2=()=>["/menu/Reports/Purchases_Report/Daily"];function m2(i,s){if(i&1){let e=I();n(0,"button",12),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function s2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",14)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",15),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",16),x("selectedCategoryIDChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",17),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Currency"),a(),n(13,"ng-select",18),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(14,"h6"),p(15,"Multiply Unit Qty"),a(),n(16,"radio-options",19),x("modelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a(),n(17,"h6"),p(18,"Supplier"),a(),n(19,"autocompleteV2",20),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),C("model",e.pageData.Filter.MultiplyUnitQuantity),c("options",e.YesNoRadio),o(3),C("ngModel",e.pageData.Filter.SupplierID)}}function c2(i,s){i&1&&(n(0,"th",8),p(1,"Purchases"),a())}function d2(i,s){if(i&1&&(n(0,"td",8),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Income)," ")}}function u2(i,s){if(i&1&&(n(0,"tr",9)(1,"td"),p(2),a(),n(3,"td",8),p(4),d(5,"quantityFraction"),a(),S(6,d2,3,3,"td",8),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.MonthLabel),o(2),F(g(5,3,e.Quantity)),o(2),y(r.roleService.product.Cost?6:-1)}}function _2(i,s){if(i&1&&(n(0,"td",8),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Income"))," ")}}function g2(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,m2,3,0,"button",3),n(3,"a",4),p(4,"View Daily"),a()(),n(5,"filters"),E(6,s2,20,13,"ng-template",null,0,O),a(),n(8,"content")(9,"div",5)(10,"table",6)(11,"thead",7)(12,"tr")(13,"th"),p(14,"Month"),a(),n(15,"th",8),p(16,"Quantity"),a(),S(17,c2,2,0,"th",8),a()(),n(18,"tbody"),G(19,u2,7,5,"tr",9,Y),a(),n(21,"tr",10)(22,"td",11),p(23,"Total"),a(),n(24,"td",8),p(25),d(26,"sum"),d(27,"quantityFraction"),a(),S(28,_2,4,6,"td",8),a()()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(),c("routerLink",M(14,p2)),o(14),y(e.roleService.product.Cost?17:-1),o(2),H(e.data.Data),o(6),D(" ",g(27,12,v(26,9,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?28:-1)}}var ba=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/GetPurchasePeriodMonthly","ReportLoader/GetReportPurchaseMonthly");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0)}Years=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Monthly",exportTypes:[{ID:"ReportExport/MonthlyPurchaseReport",Value:"Default",FileName:"Purchase Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-purchase"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"border-bottom"],[1,"table-footer"],["colspan","1",1,"fw-bold","text-start","ps-4"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"]],template:function(r,t){r&1&&S(0,g2,29,15,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,$,L,R,ie,Te,Ae,Ce,U,se,Z,ne],encapsulation:2})};function C2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",2)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",3),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",4),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",5),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years)}}function f2(i,s){if(i&1&&(n(0,"content")(1,"div",6),b(2,"POS-line-chart",7),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var Ea=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthlyPurchasesVolume","ReportLoader/GetMonthlyPurchaseVolume");this.httpService=r;let l=new Date;this.Years=V.GenerateYears(l.getFullYear(),11,!0)}Years=[];ChartData={};chartConfig;preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}preInitList(){let e={ID:0,Symbol:"All"};this.pageData.Options.Currencies.unshift(e),this.pageData.Filter.CurrencyID=0}postInit(){let e=[];this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.Data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}},this.data.PageTitle!=null&&(this.menuData.H=this.data.PageTitle),this.data.Data.MonthlySalesRank.forEach((r,t)=>{let l={name:this.data.Data.MonthName[t],data:r.Sales};e.push(l)}),this.ChartData={series:e}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-volume"]],standalone:!1,features:[W],decls:6,vars:5,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet","appendTo","body",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),b(1,"actions"),n(2,"filters"),E(3,C2,11,8,"ng-template",null,0,O),a(),S(5,f2,3,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(5),y(t.data?5:-1))},dependencies:[A,$,L,R,Mt,Ce,U],encapsulation:2})};var x2=()=>["/menu/Products/Catalog/Products/Info"],h2=i=>({ID:i});function S2(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export"),a()}}function y2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",9)(13,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function D2(i,s){if(i&1&&(n(0,"tr",20)(1,"td"),p(2),a(),n(3,"td")(4,"a",21),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a(),n(11,"td",22),p(12),d(13,"quantityFraction"),a(),n(14,"td",23),p(15),d(16,"number"),a()()),i&2){let e=s.$implicit,r=s.$index;o(2),F(r+1),o(2),c("routerLink",M(14,x2))("queryParams",X(15,h2,e.ID)),o(),D(" ",e.Name," "),o(2),F(e.Code),o(2),F(g(10,8,e.PurchaseQuantity)),o(3),F(g(13,10,e.SellQuantity)),o(3),F(g(16,12,e.Ratio))}}function v2(i,s){if(i&1&&(n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),p(7," Now "),a(),n(8,"th",17),p(9,"Name"),a(),n(10,"th",18),p(11,"Code"),a(),n(12,"th",19),p(13,"Purchase"),a(),n(14,"th",19),p(15,"Sold"),a(),n(16,"th",19),p(17,"Sold Percentage(%)"),a()()(),n(18,"tbody"),G(19,D2,17,17,"tr",20,Y),a()()()()()),i&2){let e=m();o(19),H(e.data.Data)}}var Ma=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/PruchasedSalesReportList","ReportLoader/PurchaseSalesReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}GroupRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Sales Report",exportTypes:[{ID:"ReportExport/PurchasedSalesReportList",Value:"Default",FileName:"Purchase Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-sales-report"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","55px"],[2,"width","320px"],[2,"width","100px"],[1,"text-end",2,"width","80px"],[1,"border-bottom"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,S2,3,0,"button",2),a(),n(3,"filters"),E(4,y2,17,10,"ng-template",null,0,O),a(),S(6,v2,21,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,Qe,L,R,Ue,Ce,U,re,ne],encapsulation:2})};var w2=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"],T2=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],P2=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),F2=(i,s,e)=>({EntityID:i,From:s,To:e}),I2=()=>["/menu/Reports/Purchases_Report/Summary"];function b2(i,s){if(i&1){let e=I();n(0,"button",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function E2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Compare with Prev Month"),a(),n(3,"radio-options",14),x("modelChange",function(t){u(e);let l=m(2);return f(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),C("model",e.isCompare)}}function M2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",15),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(5,"div",16)(6,"datepicker",17),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function V2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Year - Month"),a(),n(3,"div",18)(4,"div",19)(5,"ng-select",20),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Year=null)}),a()(),n(6,"div",21)(7,"ng-select",22),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Month=null)}),a()()()()}if(i&2){let e=m(2);o(5),C("ngModel",e.Year),c("items",e.Years),o(2),C("ngModel",e.Month),c("items",e.Months)}}function B2(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",10),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Purchase Order Tag"),a(),n(6,"ng-select",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"Date Filter"),a(),n(9,"radio-options",12),x("modelChange",function(t){u(e);let l=m();return f(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.YearMonthToDateRange())}),a(),S(10,E2,4,1,"div"),S(11,M2,7,2,"div"),S(12,V2,8,4,"div"),n(13,"h6"),p(14,"Exclude Complementary"),a(),n(15,"radio-options",13),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ExcludeComplementary,t)||(l.pageData.Filter.ExcludeComplementary=t),_(t)}),a()()}if(i&2){let e=m();o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),C("model",e.IsPredefined),c("options",e.RadioDateFilterType),o(),y(e.IsPredefined?10:-1),o(),y(e.IsPredefined?-1:11),o(),y(e.IsPredefined?12:-1),o(3),C("model",e.pageData.Filter.ExcludeComplementary)}}function O2(i,s){i&1&&(n(0,"th",28),p(1," Prev "),a())}function L2(i,s){i&1&&(n(0,"th",29),p(1," Now "),a())}function R2(i,s){i&1&&(n(0,"th",30),p(1," Orders "),a())}function k2(i,s){i&1&&(n(0,"th",32),p(1," Purchase "),a())}function W2(i,s){if(i&1&&(n(0,"th",33),p(1," Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet")}}function N2(i,s){if(i&1&&(n(0,"th",34),p(1," Purchase+Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function A2(i,s){if(i&1&&(n(0,"td",38),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function G2(i,s){if(i&1&&(n(0,"td",40),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,P2,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function H2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Count,".0-0")," ")}}function Q2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Y2(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function j2(i,s){if(i&1&&(n(0,"td",38)(1,"a",41),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(11,F2,e.EntityID,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy")))("routerLink",M(15,I2)),o(4),F(g(6,9,e.SalesWithTax))}}function q2(i,s){if(i&1&&(n(0,"tr")(1,"td",36),p(2),a(),S(3,A2,2,1,"td",38),S(4,G2,2,5,"td",40),S(5,H2,3,4,"td",38),n(6,"td",38),p(7),d(8,"quantityFraction"),a(),S(9,Q2,3,3,"td",38),S(10,Y2,3,3,"td",39),d(11,"HideSumZero"),S(12,j2,7,16,"td",38),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(),y(r.data.WithCategory?-1:5),o(2),F(g(8,8,e.Quantity)),o(2),y(r.roleService.product.Cost?9:-1),o(),y(!r.data.WithCategory&&v(11,10,r.data.Data,"Tax")&&r.roleService.product.Cost?10:-1),o(2),y(!r.data.WithCategory&&r.roleService.product.Cost?12:-1)}}function U2(i,s){i&1&&b(0,"td",37)}function z2(i,s){i&1&&b(0,"td",37)}function K2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Count"),".0-0")," ")}}function X2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Sales"))," ")}}function J2(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function Z2(i,s){if(i&1&&(n(0,"td",38)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function $2(i,s){if(i&1){let e=I();n(0,"content")(1,"div",23)(2,"div",24)(3,"table",25),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",26)(5,"tr")(6,"th",27),p(7,"Outlet"),a(),S(8,O2,2,0,"th",28),S(9,L2,2,0,"th",29),S(10,R2,2,0,"th",30),n(11,"th",31),p(12," Qty "),a(),S(13,k2,2,0,"th",32),S(14,W2,2,1,"th",33),d(15,"HideSumZero"),S(16,N2,2,1,"th",34),a()(),n(17,"tbody"),G(18,q2,13,13,"tr",null,Y),a(),n(20,"tfoot")(21,"tr",35),b(22,"td",36),S(23,U2,1,0,"td",37),S(24,z2,1,0,"td",37),S(25,K2,4,7,"td",38),n(26,"td",38),p(27),d(28,"sum"),d(29,"quantityFraction"),a(),S(30,X2,4,6,"td",38),S(31,J2,4,6,"td",39),d(32,"HideSumZero"),S(33,Z2,5,6,"td",38),a()()()()()()}if(i&2){let e=m();o(8),y(e.showCompareColumn?8:-1),o(),y(e.showCompareColumn?9:-1),o(),y(e.data.WithCategory?-1:10),o(3),y(e.roleService.product.Cost?13:-1),o(),y(!e.data.WithCategory&&v(15,13,e.data.Data,"Tax")&&e.roleService.product.Cost?14:-1),o(2),y(!e.data.WithCategory&&e.roleService.product.Cost?16:-1),o(2),H(e.data.Data),o(5),y(e.showCompareColumn?23:-1),o(),y(e.showCompareColumn?24:-1),o(),y(e.data.WithCategory?-1:25),o(2),D(" ",g(29,19,v(28,16,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?30:-1),o(),y(!e.data.WithCategory&&v(32,21,e.data.Data,"Tax")&&e.roleService.product.Cost?31:-1),o(2),y(!e.data.WithCategory&&e.roleService.product.Cost?33:-1)}}var Va=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/OutletPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Year=T.getFullYear(),this.Month=T.getMonth()+1,this.Months=V.Months,this.Months.forEach(Ze=>Ze.Label=Ze.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Comparison=0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Purchase Performance",exportTypes:[{ID:"ReportExport/OutletPerformancePurchase",Value:"Default",FileName:"Outlet Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){this.YearMonthToDateRange()}postInit(e){this.menuData.H=e?.PageTitle,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month-1,1),this.pageData.Filter.To=new Date(this.Year,this.Month,0)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Count":return V.compare(t.Count,l.Count,h);case"SalesWithTax":return V.compare(t.SalesWithTax,l.SalesWithTax,h);case"Quantity":return V.compare(t.Quantity,l.Quantity,h);case"SalesNet":return V.compare(t.Sales,l.Sales,h);case"SalesTaxNet":return V.compare(t.Sales,l.Sales,h);case"Tax":return V.compare(t.Tax,l.Tax,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-performance"]],standalone:!1,features:[W],decls:17,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","Date Filter",3,"modelChange","model","options"],["name","complementary",3,"modelChange","model"],["name","compare",3,"modelChange","model"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"freeze","header"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","100px"],["arrowPosition","before",1,"flex-right",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"flex-right",2,"width","150px",3,"mat-sort-header"],[1,"footer"],[1,"freeze","body"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[3,"queryParams","routerLink"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,b2,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," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()()()()(),n(13,"filters"),E(14,B2,16,10,"ng-template",null,0,O),a(),S(16,$2,34,24,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,w2)),o(3),c("routerLink",M(9,T2)),o(5),y(t.data?16:-1))},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,Ce,se,ei,re,oe,Z,ne],encapsulation:2})};var eS=()=>["/menu/Reports/Purchases_Report/Outlet"],tS=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],iS=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),nS=(i,s)=>({"text-danger":i,"text-success":s,"text-end":!0});function aS(i,s){if(i&1){let e=I();n(0,"button",24),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",25),p(2," Export"),a()}}function oS(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"From - To"),a(),n(2,"div")(3,"datepicker",29),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(4,"div",30)(5,"datepicker",31),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()}if(i&2){let e=m(3);o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function rS(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Year - Month"),a(),n(2,"div",32)(3,"div",33)(4,"ng-select",34),x("ngModelChange",function(t){u(e);let l=m(3);return f(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(3);return _(t.Year=null)}),a()(),n(5,"div",35)(6,"ng-select",36),x("ngModelChange",function(t){u(e);let l=m(3);return f(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(3);return _(t.Month=null)}),a()()()}if(i&2){let e=m(3);o(4),C("ngModel",e.Year),c("items",e.Years),o(2),C("ngModel",e.Month),c("items",e.Months)}}function lS(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Compare with Prev Month"),a(),n(2,"radio-options",37),x("modelChange",function(t){u(e);let l=m(3);return f(l.isCompare,t)||(l.isCompare=t),_(t)}),a()}if(i&2){let e=m(3);o(2),C("model",e.isCompare)}}function pS(i,s){if(i&1){let e=I();n(0,"div")(1,"div",26)(2,"h6"),p(3,"Date Filter"),a(),n(4,"radio-options",27),x("modelChange",function(t){u(e);let l=m(2);return f(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),a(),S(5,oS,6,2),S(6,rS,7,4),n(7,"h6"),p(8,"Purchase Order Tag"),a(),n(9,"ng-select",28),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),S(10,lS,3,1),a()()}if(i&2){let e=m(2);o(4),C("model",e.IsPredefined),c("options",e.RadioDateFilterType),o(),y(e.IsPredefined?-1:5),o(),y(e.IsPredefined?6:-1),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(),y(e.IsPredefined?10:-1)}}function mS(i,s){i&1&&(n(0,"th",12),p(1,"Prev"),a())}function sS(i,s){i&1&&(n(0,"th",13),p(1,"Now"),a())}function cS(i,s){i&1&&(n(0,"th",17),p(1," \xB1 (%) "),a())}function dS(i,s){if(i&1&&(n(0,"td",22),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function uS(i,s){if(i&1&&(n(0,"td",38),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,iS,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function _S(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;c("ngClass",fe(5,nS,e.IsNegative,e.IsPositive)),o(),D(" ",v(2,2,e.Increase,".0-0")," ")}}function gS(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,dS,2,1,"td",22),S(4,uS,2,5,"td",38),n(5,"td",22),p(6),d(7,"number"),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a(),n(11,"td",22),p(12),d(13,"amountFraction"),a(),S(14,_S,3,8,"td",39),n(15,"td",23),p(16),d(17,"amountFraction"),a(),n(18,"td",22),p(19),d(20,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(2),F(v(7,9,e.Count,".0-0")),o(3),F(g(10,12,e.Quantity)),o(3),F(g(13,14,e.Sales)),o(2),y(r.showCompareColumn?14:-1),o(2),F(g(17,16,e.Tax)),o(3),D(" ",g(20,18,e.SalesWithTax)," ")}}function CS(i,s){i&1&&b(0,"td",21)}function fS(i,s){i&1&&b(0,"td",21)}function xS(i,s){i&1&&b(0,"td")}function hS(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,aS,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Month "),a()()()()(),n(13,"filters"),E(14,pS,11,7,"ng-template",null,0,O),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr")(21,"th",11),p(22,"Outlet"),a(),S(23,mS,2,0,"th",12),S(24,sS,2,0,"th",13),n(25,"th",14),p(26,"Orders "),a(),n(27,"th",15),p(28," Quantity"),a(),n(29,"th",16),p(30," Purchase"),a(),S(31,cS,2,0,"th",17),n(32,"th",18),p(33,"Tax"),a(),n(34,"th",19),p(35,"Purchase + Tax"),a()()(),n(36,"tbody"),G(37,gS,21,20,"tr",null,Y),a(),n(39,"tfoot")(40,"tr",20),S(41,CS,1,0,"td",21),S(42,fS,1,0,"td",21),b(43,"td",21),n(44,"td",22),p(45),d(46,"sum"),d(47,"number"),a(),n(48,"td",22),p(49),d(50,"sum"),d(51,"quantityFraction"),a(),n(52,"td",22),p(53),d(54,"sum"),d(55,"amountFraction"),a(),S(56,xS,1,0,"td"),n(57,"td",23),p(58),d(59,"sum"),d(60,"amountFraction"),a(),n(61,"td",22)(62,"a"),p(63),d(64,"sum"),d(65,"amountFraction"),a()()()()()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(6),c("routerLink",M(46,eS)),o(3),c("routerLink",M(47,tS)),o(12),y(e.showCompareColumn?23:-1),o(),y(e.showCompareColumn?24:-1),o(7),y(e.showCompareColumn?31:-1),o(),c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet"),o(2),c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet"),o(3),H(e.data==null?null:e.data.Data),o(4),y(e.showCompareColumn?41:-1),o(),y(e.showCompareColumn?42:-1),o(3),F(v(47,23,v(46,20,e.data==null?null:e.data.Data,"Count"),".0-0")),o(4),F(g(51,29,v(50,26,e.data==null?null:e.data.Data,"Quantity"))),o(4),D(" ",g(55,34,v(54,31,e.data==null?null:e.data.Data,"Sales"))," "),o(3),y(e.showCompareColumn?56:-1),o(2),D(" ",g(60,39,v(59,36,e.data==null?null:e.data.Data,"Tax"))," "),o(5),F(g(65,44,v(64,41,e.data==null?null:e.data.Data,"SalesWithTax")))}}var Ba=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/OutletGroupPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Year=T.getFullYear(),this.Month=T.getMonth(),this.Months=V.Months,this.Months.forEach(Ze=>Ze.Label=Ze.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}];first=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Purchase Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformancePurchase",Value:"Default",FileName:"Outlet Group Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.first&&(this.YearMonthToDateRange(),this.first=!1)}postInit(){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Count":return this.compare(t.Count,l.Count,h);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"SalesNet":return this.compare(t.Sales,l.Sales,h);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,h);case"Tax":return this.compare(t.Tax,l.Tax,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-group-performance"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],[1,"text-end",2,"width","100px"],["arrowPosition","before",1,"text-end",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"text-end",2,"width","150px",3,"mat-sort-header"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","Date Filter",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModelChange","change","clear","ngModel","items"],["name","compare",3,"modelChange","model"],[1,"text-end",3,"ngClass"],[3,"ngClass"]],template:function(r,t){r&1&&S(0,hS,66,48,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,se,re,Z,ne],encapsulation:2})};var SS=()=>["/menu/Reports/Purchases_Report/Outlet"],yS=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"];function DS(i,s){if(i&1){let e=I();n(0,"button",12),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",13),p(2," Export"),a()}}function vS(i,s){if(i&1){let e=I();n(0,"div")(1,"div",14)(2,"h6"),p(3,"Year"),a(),n(4,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(5,"h6"),p(6,"Purchase Order Tag"),a(),n(7,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function wS(i,s){if(i&1&&(n(0,"th",11),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function TS(i,s){if(i&1&&(n(0,"p",17),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(r[e])}}function PS(i,s){if(i&1&&(n(0,"p",17),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(g(2,1,r[e]))}}function FS(i,s){if(i&1&&(n(0,"td"),S(1,TS,2,1,"p",17),S(2,PS,3,3,"p",17),a()),i&2){let e=s.$implicit;o(),y(e=="Outlet"?1:-1),o(),y(e!="Outlet"?2:-1)}}function IS(i,s){if(i&1&&(n(0,"tr"),G(1,FS,3,2,"td",null,Y),a()),i&2){let e=s.$implicit,r=m(2);o(),H(r.getKey(e))}}function bS(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),F(g(2,1,e))}}function ES(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",18)(2,"td"),p(3,"Total : "),a(),G(4,bS,3,3,"td",null,Y),a()()),i&2){let e=m(2);o(4),H(e.data.DataFooter)}}function MS(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,DS,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," Outlet Report By "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Outlet Group "),a()()()()(),n(13,"filters"),E(14,vS,8,4,"ng-template",null,0,O),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr"),G(21,wS,2,2,"th",11,Y),a()(),n(23,"tbody"),G(24,IS,3,0,"tr",null,Y),a(),S(26,ES,6,0,"tfoot"),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,SS)),o(3),c("routerLink",M(9,yS)),o(10),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?26:-1)}}var Oa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/MonthlyOutletPerformancePurchase","ReportLoader/MonthlyReportPurchase");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0)}Years;openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Monthly Purchase Performance",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformancePurchase",Value:"Default",FileName:"Outlet Group Monthly Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((l,h)=>{let T=e.direction==="asc";for(let Ze=0;Ze<this.data.Dataheader.length;Ze++)if(e.active==this.data.Dataheader[Ze])return typeof l[this.data.Dataheader[Ze]]=="string"?t(l[this.data.Dataheader[Ze]].toLocaleLowerCase(),h[this.data.Dataheader[Ze]].toLocaleLowerCase(),T):t(l[this.data.Dataheader[Ze]],h[this.data.Dataheader[Ze]],T)});function t(l,h,T){return(l<h?-1:1)*(T?1:-1)}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-monthly-performance"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","","id","tableGrid",1,"table",3,"matSortChange"],[1,"table-light"],[3,"mat-sort-header"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],[2,"color","black"],[1,"table-footer"]],template:function(r,t){r&1&&S(0,MS,27,10,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,$,L,R,pe,ge,Z],encapsulation:2})};var VS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],BS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],OS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],LS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],RS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],kS=i=>({ID:i});function WS(i,s){if(i&1){let e=I();n(0,"a",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function NS(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",10),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",12)(8,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a(),n(9,"div")(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()()()}if(i&2){let e=m();o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(4),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function AS(i,s){if(i&1&&(n(0,"a",26),p(1),a()),i&2){let e=m().$implicit;c("queryParams",X(2,kS,e.CityID)),o(),F(e.CityName)}}function GS(i,s){if(i&1&&p(0),i&2){let e=m().$implicit;D(" ",e.CityName," ")}}function HS(i,s){if(i&1&&(n(0,"tr"),b(1,"td",25),n(2,"td"),S(3,AS,2,4,"a",26),S(4,GS,1,1),a(),b(5,"td",27),d(6,"number"),b(7,"td",27),d(8,"number"),b(9,"td",27),d(10,"number"),a()),i&2){let e=s.$implicit;o(),c("innerHtml",e.CityCode,Ee),o(2),y(e.CityID?3:-1),o(),y(e.CityID?-1:4),o(),c("innerHtml",g(6,6,e.Quantity),Ee),o(2),c("innerHtml",g(8,8,e.Total),Ee),o(2),c("innerHtml",g(10,10,e.Average),Ee)}}function QS(i,s){if(i&1){let e=I();n(0,"content")(1,"div",15)(2,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",17)(4,"tr")(5,"th",18),p(6,"Code"),a(),n(7,"th",19),p(8," Regional Name "),a(),n(9,"th",20),p(10," Quantity "),a(),n(11,"th",21),p(12," Total "),a(),n(13,"th",22),p(14," Avg. Price "),a()()(),n(15,"tbody"),G(16,HS,11,12,"tr",null,Y),a(),n(18,"tfoot")(19,"tr",23),b(20,"td",24),n(21,"td",24),p(22,"Total :"),a(),n(23,"td",24),p(24),d(25,"sum"),d(26,"quantityFraction"),a(),n(27,"td",24),p(28),d(29,"sum"),d(30,"amountFraction"),a(),n(31,"td",24),p(32),d(33,"sum"),d(34,"sum"),d(35,"amountFraction"),a()()()()()()}if(i&2){let e=m();o(16),H(e.data.List),o(8),D(" ",g(26,6,v(25,3,e.data.List,"Quantity"))," "),o(4),D(" ",g(30,11,v(29,8,e.data.List,"Total"))," "),o(4),D(" ",g(35,19,v(33,13,e.data.List,"Total")/v(34,16,e.data.List,"Quantity"))," ")}}var La=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/CitySales","ReportLoader/CitySalesLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}postInit(e){this.menuData.H=e.PageTitle}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"CityCode":return this.compare(t.CityCode,l.CityCode,h);case"CityName":return this.compare(t.CityName,l.CityName,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Average":return this.compare(t.Average,l.Average,h);case"Total":return this.compare(t.Total,l.Total,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"City Report",exportTypes:[{ID:"ReportExport/CitySalesExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-city"]],standalone:!1,features:[W],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[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,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","CityCode",2,"width","80px"],["mat-sort-header","CityName",2,"width","220px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Average","arrowPosition","before",1,"flex-right",2,"width","100px"],[1,"table-footer"],[1,"text-end"],[3,"innerHtml"],["routerLink","/menu/Contacts/Option_Values/City/Form",3,"queryParams"],[1,"text-end",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,WS,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,NS,13,6,"ng-template",null,0,O),a(),S(25,QS,36,21,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,VS)),o(3),c("routerLink",M(12,BS)),o(3),c("routerLink",M(13,OS)),o(3),c("routerLink",M(14,LS)),o(3),c("routerLink",M(15,RS)),o(5),y(t.data?25:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,Ce,se,re,Z,ne],encapsulation:2})};var YS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],jS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],qS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],US=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],zS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function KS(i,s){if(i&1){let e=I();n(0,"a",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function XS(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",12)(8,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function JS(i,s){i&1&&(n(0,"th",20),p(1,"Cost"),a())}function ZS(i,s){i&1&&(n(0,"th",20),p(1,"Profit"),a())}function $S(i,s){if(i&1&&(b(0,"td",28),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.Cost),Ee)}}function ey(i,s){if(i&1&&(b(0,"td",27),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.Profit),Ee)}}function ty(i,s){if(i&1&&(n(0,"tr"),b(1,"td",25)(2,"td",26),d(3,"number"),b(4,"td",26),d(5,"quantityFraction"),b(6,"td",26),d(7,"amountFraction"),b(8,"td",27),d(9,"amountFraction"),S(10,$S,2,3,"td",28),S(11,ey,2,3,"td",27),a()),i&2){let e=s.$implicit,r=m(2);o(),c("innerHtml",e.GroupName,Ee),o(),c("innerHtml",g(3,7,e.Count),Ee),o(2),c("innerHtml",g(5,9,e.Quantity),Ee),o(2),c("innerHtml",g(7,11,e.Gross),Ee),o(2),c("innerHtml",g(9,13,e.Sales),Ee),o(2),y(r.roleService.product.Cost?10:-1),o(),y(r.roleService.report.Profit?11:-1)}}function iy(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(3,4,v(2,1,e.data.Data,"Cost")))}}function ny(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(3,4,v(2,1,e.data.Data,"Profit")))}}function ay(i,s){if(i&1){let e=I();n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",17)(5,"tr")(6,"th",18),p(7,"Group Name"),a(),n(8,"th",19),p(9,"Orders"),a(),n(10,"th",20),p(11,"Quantity"),a(),n(12,"th",20),p(13,"Gross"),a(),n(14,"th",20),p(15,"Sales"),a(),S(16,JS,2,0,"th",20),S(17,ZS,2,0,"th",20),a()(),n(18,"tbody"),G(19,ty,12,15,"tr",null,Y),a(),n(21,"tfoot")(22,"tr",21),b(23,"td",22),n(24,"td",22),p(25),d(26,"sum"),d(27,"number"),a(),n(28,"td",22),p(29),d(30,"sum"),d(31,"quantityFraction"),a(),n(32,"td",22),p(33),d(34,"sum"),d(35,"amountFraction"),a(),n(36,"td",23),p(37),d(38,"sum"),d(39,"amountFraction"),a(),S(40,iy,4,6,"td",24),S(41,ny,4,6,"td",23),a()()()()()()}if(i&2){let e=m();o(16),y(e.roleService.product.Cost?16:-1),o(),y(e.roleService.report.Profit?17:-1),o(2),H(e.data.Data),o(6),F(g(27,11,v(26,8,e.data.Data,"Count"))),o(4),F(g(31,16,v(30,13,e.data.Data,"Quantity"))),o(4),F(g(35,21,v(34,18,e.data.Data,"Gross"))),o(4),F(g(39,26,v(38,23,e.data.Data,"Sales"))),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.report.Profit?41:-1)}}var Ra=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/CustomerGroup","ReportLoader/CustomerGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}first=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Customer Group",exportTypes:[{ID:"ReportExport/CustomerGroup",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"GroupName":return this.compare(t.GroupName,l.GroupName,h);case"Trans":return this.compare(t.Trans,l.Trans,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Gross":return this.compare(t.Gross,l.Gross,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-customer-group"]],standalone:!1,features:[W],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-success"],[1,"text-end","text-danger"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],[1,"text-end","text-success",3,"innerHtml"],[1,"text-end","text-danger",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,KS,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,XS,9,5,"ng-template",null,0,O),a(),S(25,ay,42,28,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,YS)),o(3),c("routerLink",M(12,jS)),o(3),c("routerLink",M(13,qS)),o(3),c("routerLink",M(14,US)),o(3),c("routerLink",M(15,zS)),o(5),y(t.data?25:-1))},dependencies:[A,Q,J,L,R,pe,U,se,re,Z,ne],encapsulation:2})};var oy=()=>["/menu/Reports/Sales_Report/Standard/Person"],ry=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],ly=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],py=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],my=(i,s)=>({From:i,To:s});function sy(i,s){if(i&1){let e=I();n(0,"a",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function cy(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",14),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",15)(8,"datepicker",16),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function dy(i,s){i&1&&(n(0,"th",22),p(1," Profit "),a())}function uy(i,s){if(i&1&&(b(0,"td",33),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.ActualProfit),Ee)}}function _y(i,s){if(i&1&&(n(0,"tr"),b(1,"td",30)(2,"td",31),d(3,"number"),b(4,"td",31),d(5,"amountFraction"),b(6,"td",31),d(7,"amountFraction"),b(8,"td",31),d(9,"number"),E(10,uy,2,3,"td",32),a()),i&2){let e=s.$implicit,r=m(2);o(),c("innerHtml",e.Name,Ee),o(),c("innerHtml",g(3,6,e.InvoiceCount),Ee),o(2),c("innerHtml",g(5,8,e.NetRevenue),Ee),o(2),c("innerHtml",g(7,10,e.SalesTarget),Ee),o(2),c("innerHtml",v(9,12,e.Percentage,"1.0-2"),Ee),o(2),c("ngIf",r.roleService.report.Profit)}}function gy(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ActualProfit"))," ")}}function Cy(i,s){if(i&1){let e=I();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr",21)(6,"th"),p(7,"Group Name"),a(),n(8,"th",22),p(9,"Count"),a(),n(10,"th",22),p(11,"Actual"),a(),n(12,"th",22),p(13,"Target"),a(),n(14,"th",22)(15,"span",23),p(16," % "),a()(),E(17,dy,2,0,"th",24),a()(),n(18,"tbody"),E(19,_y,11,15,"tr",25),a(),n(20,"tfoot")(21,"tr",26),b(22,"td",27)(23,"td",27),n(24,"td",28),p(25),d(26,"sum"),d(27,"amountFraction"),a(),b(28,"td",27)(29,"td",27),E(30,gy,4,6,"td",29),a()()()()()()}if(i&2){let e=m();o(17),c("ngIf",e.roleService.report.Profit),o(2),c("ngForOf",e.data.Data),o(6),D(" ",g(27,7,v(26,4,e.data.Data,"GrossRevenue"))," "),o(5),c("ngIf",e.roleService.report.Profit)}}var ka=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/SalesGroup","ReportLoader/SalesGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}first=!0;preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/SalesGroup",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-group"]],standalone:!1,features:[W],decls:26,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"btn","btn-outline-secondary"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end",2,"width","120px"],["matTooltip","(Actual / Target) * 100","matTooltipPosition","above"],["style","width: 120px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],["class","text-end text-success",3,"innerHtml",4,"ngIf"],[1,"text-end","text-success",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2),S(3,sy,3,0,"a",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"Summary"),a()(),n(11,"li")(12,"a",7),p(13,"By Outlet"),a()(),n(14,"li")(15,"a",7),p(16,"By Employee"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),E(23,cy,9,5,"ng-template",null,0,O),a(),E(25,Cy,31,9,"content",9),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(3),y(t.roleService!=null&&t.roleService.global.Export?3:-1),o(6),c("routerLink",M(17,oy)),o(3),c("routerLink",M(18,ry)),o(3),c("routerLink",M(19,ly)),o(3),c("routerLink",M(20,py))("queryParams",fe(21,my,v(19,11,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),v(20,14,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,J,L,R,ie,pe,U,se,re,oe,Z],encapsulation:2})};var fy=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report/By_Outlet"],xy=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],hy=i=>({ID:i});function Sy(i,s){i&1&&(n(0,"a",5),p(1,"By Outlet"),a()),i&2&&c("routerLink",M(1,fy))}function yy(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function Dy(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div",10)(7,"div",11)(8,"datepicker",12),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()()(),n(9,"div",13)(10,"div",11)(11,"datepicker",14),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()(),n(12,"h6"),p(13,"Tax"),a(),n(14,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(15,"h6"),p(16,"Page Size"),a(),n(17,"input",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(5),C("date",e.pageData.Filter.From),o(3),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function vy(i,s){if(i&1&&b(0,"th",41),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function wy(i,s){if(i&1&&(b(0,"td",46),d(1,"TaxDefault"),d(2,"amountFraction")),i&2){let e=s.index,r=m().$implicit,t=m(2);c("innerHtml",g(2,5,fi(1,1,t.data.Compenents,r,e)),Ee)}}function Ty(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",42),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td"),p(9),a(),n(10,"td"),p(11),d(12,"date"),a(),n(13,"td",43),p(14),d(15,"amountFraction"),a(),n(16,"td",44),p(17),d(18,"amountFraction"),a(),E(19,wy,3,7,"td",45),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(17,xy))("queryParams",X(18,hy,e.ID)),o(),F(e.Number),o(2),F(e.Name),o(2),F(e.TaxName),o(2),F(v(12,10,e.Date,"dd MMM yyyy")),o(3),F(g(15,13,e.Sales)),o(3),D(" ",g(18,15,e.Tax)," "),o(2),c("ngForOf",r.getComponent(r.data))}}function Py(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e.SumTaxAmount)," ")}}function Fy(i,s){if(i&1){let e=I();n(0,"span",48),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport"))}),n(1,"i",49),p(2,"?"),a()()}}function Iy(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function by(i,s){if(i&1){let e=I();n(0,"a",50),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",51),p(2," Next"),a()}}function Ey(i,s){if(i&1){let e=I();n(0,"a",52),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport",!0))}),b(1,"i",53),p(2," Show All"),a()}}function My(i,s){if(i&1){let e=I();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr")(6,"th",21),p(7,"Outlet"),a(),n(8,"th",22),p(9,"Number"),a(),n(10,"th",23),p(11,"Name"),a(),n(12,"th",24),p(13," Type "),a(),n(14,"th",25),p(15,"Date"),a(),n(16,"th",26),p(17," Sales "),a(),n(18,"th",27),p(19," Tax "),a(),E(20,vy,1,1,"th",28),a()(),n(21,"tbody"),E(22,Ty,20,20,"tr",29),a(),n(23,"tfoot")(24,"tr",30),b(25,"td",31),n(26,"td",32),p(27),d(28,"sum"),d(29,"amountFraction"),a(),n(30,"td",32),p(31),d(32,"sum"),d(33,"amountFraction"),a(),E(34,Py,3,3,"td",33),a()()()(),n(35,"div",34)(36,"div",35)(37,"div",36),p(38),d(39,"number"),E(40,Fy,3,0,"span",37)(41,Iy,3,3,"span",4),p(42),a()(),n(43,"div",38),E(44,by,3,0,"a",39)(45,Ey,3,0,"a",40),a()()()()}if(i&2){let e=m();o(20),c("ngForOf",e.data.Compenents),o(2),c("ngForOf",e.infiniteList),o(5),D(" ",g(29,14,v(28,11,e.infiniteList,"Sales"))," "),o(4),D(" ",g(33,19,v(32,16,e.infiniteList,"Tax"))," "),o(3),c("ngForOf",e.data.Compenents),o(4),D(" Showing 1 - ",g(39,21,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Wa=class i extends vi{constructor(e,r,t,l,h,T){super(e,r,"Report/GetSalesTaxReport","ReportLoader/GetTaxReport",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.toastrService=T}timeTo;timeFrom;getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}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 h=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),h);case"Number":return this.compare(t.Number,l.Number,h);case"Date":return this.compare(t.Date,l.Date,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"Tax":return this.compare(t.Tax,l.Tax,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Tax Report",exportTypes:[{ID:"ReportExport/GetSalesTaxReport",Value:"Default",FileName:"Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-tax-report"]],standalone:!1,features:[W],decls:8,vars:7,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3","matTooltipPosition","above","matTooltip","Tax Report By Outlet",3,"routerLink",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-3",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],["style","width: 150px","class","align-right text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],[1,"text-end","text-success"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more reports",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all reports",3,"click",4,"ngIf"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end",2,"width","150px"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more reports",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all reports",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,Sy,2,2,"a",2)(3,yy,3,0,"a",3),a(),n(4,"filters"),E(5,Dy,18,10,"ng-template",null,0,O),a(),E(7,My,46,23,"content",4),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,Qe,L,R,ie,pe,ge,Ue,U,se,Fi,re,oe,Z],encapsulation:2})};var Vy=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report"];function By(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function Oy(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",10)(8,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Tax"),a(),n(11,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("clearable",!1)}}function Ly(i,s){i&1&&(n(0,"th",17),p(1,"Total Tax"),a())}function Ry(i,s){if(i&1&&b(0,"th",18),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function ky(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),F(v(2,1,e.Tax,r.pageData.FractionDigit))}}function Wy(i,s){if(i&1&&(b(0,"td",18),d(1,"TaxDefault"),d(2,"number")),i&2){let e=s.$index,r=m().$implicit,t=m(2);c("innerHtml",v(2,5,fi(1,1,t.data.Compenents,r,e),t.pageData.FractionDigit),Ee)}}function Ny(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),S(6,ky,3,4,"td",23),G(7,Wy,3,8,"td",18,Y),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),F(v(5,3,e.Sales,r.pageData.FractionDigit)),o(2),y(r.data.Compenents.length==0?6:-1),o(),H(r.getComponent(e))}}function Ay(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Tax"),e.pageData.FractionDigit))}}function Gy(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.SumTaxAmount,r.pageData.FractionDigit)," ")}}function Hy(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",13),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",14)(3,"tr")(4,"th",15),p(5,"Outlet"),a(),n(6,"th",16),p(7,"Sales"),a(),S(8,Ly,2,0,"th",17),G(9,Ry,1,1,"th",18,Y),a()(),n(11,"tbody"),G(12,Ny,9,6,"tr",null,Y),a(),n(14,"tfoot")(15,"tr",19),b(16,"td",20),n(17,"td",21),p(18),d(19,"sum"),d(20,"number"),a(),S(21,Ay,4,7,"td",21),G(22,Gy,3,4,"td",22,Y),a()()()()}if(i&2){let e=m();o(8),y(e.data.Compenents.length==0?8:-1),o(),H(e.data.Compenents),o(3),H(e.data.Data),o(6),F(v(20,6,v(19,3,e.data.Data,"Sales"),e.pageData.FractionDigit)),o(3),y(e.data.Compenents.length==0?21:-1),o(),H(e.data.Compenents)}}var Na=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/GetTaxReportbyOutlet","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}openExportModal(){this.matDialog.open(K,{data:{title:"Tax Report by Outlet",exportTypes:[{ID:"ReportExport/GetTaxReportbyOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]}),e.Component}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 h=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.EntityName,l.EntityName,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"Tax":return this.compare(t.Tax,l.Tax,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-tax-report-by-outlet"]],standalone:!1,features:[W],decls:10,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-6",3,"routerLink"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items","clearable"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end","text-success"],[1,"text-end",2,"width","150px"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),p(3,"Tax Report"),a(),S(4,By,3,0,"a",3),a(),n(5,"filters"),E(6,Oy,12,8,"ng-template",null,0,O),a(),n(8,"content"),S(9,Hy,24,9,"div",4),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("routerLink",M(8,Vy)),o(2),y(t.roleService!=null&&t.roleService.global.Export?4:-1),o(5),y(t.data?9:-1))},dependencies:[A,Q,$,J,L,R,ie,pe,ge,U,se,Fi,re],encapsulation:2})};var Qy=()=>["/menu/Products/Catalog/Variants/Info"],Yy=i=>({ID:i});function jy(i,s){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function qy(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.SalesID)}}function Uy(i,s){i&1&&(n(0,"th",26),p(1," Category "),a())}function zy(i,s){i&1&&(n(0,"th",27),p(1,"Code"),a())}function Ky(i,s){i&1&&(n(0,"th",28),p(1," Release Date "),a())}function Xy(i,s){i&1&&(n(0,"th",29),p(1," Days Count "),a())}function Jy(i,s){i&1&&(n(0,"th",30),p(1," Last Sold "),a())}function Zy(i,s){i&1&&(n(0,"th",31),p(1," Last Purchased "),a())}function $y(i,s){i&1&&(n(0,"th",32),p(1," Days Purchased "),a())}function eD(i,s){i&1&&(n(0,"th",33),p(1," Qty "),a())}function tD(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Category)}}function iD(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function nD(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.Released?v(2,1,e.Released,"dd MMM yyyy"):"-"," ")}}function aD(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DaysCount!=null?g(2,1,e.DaysCount):"-"," ")}}function oD(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.LastSold?v(2,1,e.LastSold,"dd MMM yyyy"):"-"," ")}}function rD(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.LastPurchased?v(2,1,e.LastPurchased,"dd MMM yyyy"):"-"," ")}}function lD(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DaysSinceLastPurchased!=null?g(2,1,e.DaysSinceLastPurchased):"-"," ")}}function pD(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function mD(i,s){if(i&1&&(n(0,"tr",34),E(1,tD,2,1,"td",3),n(2,"td")(3,"a",35),p(4),a()(),E(5,iD,2,1,"td",3)(6,nD,3,4,"td",3)(7,aD,3,3,"td",36)(8,oD,3,4,"td",3)(9,rD,3,4,"td",3)(10,lD,3,3,"td",37)(11,pD,3,3,"td",38),a()),i&2){let e=s.$implicit,r=m(2);o(),c("ngIf",r.column.Category.selected),o(2),c("routerLink",M(11,Qy))("queryParams",X(12,Yy,e.ID)),o(),F(e.Name),o(),c("ngIf",r.column.Code.selected),o(),c("ngIf",r.column.ReleaseDate.selected),o(),c("ngIf",r.column.DaysCount.selected),o(),c("ngIf",r.column.LastSold.selected),o(),c("ngIf",r.column.LastPurchased.selected),o(),c("ngIf",r.column.DaysPurchased.selected),o(),c("ngIf",r.column.QTY.selected)}}function sD(i,s){if(i&1){let e=I();n(0,"content")(1,"div",13)(2,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",15)(4,"tr"),E(5,Uy,2,0,"th",16),n(6,"th",17),p(7,"Name"),a(),E(8,zy,2,0,"th",18)(9,Ky,2,0,"th",19)(10,Xy,2,0,"th",20)(11,Jy,2,0,"th",21)(12,Zy,2,0,"th",22)(13,$y,2,0,"th",23)(14,eD,2,0,"th",24),a()(),n(15,"tbody"),E(16,mD,12,14,"tr",25),a()()()()}if(i&2){let e=m();o(5),c("ngIf",e.column.Category.selected),o(3),c("ngIf",e.column.Code.selected),o(),c("ngIf",e.column.ReleaseDate.selected),o(),c("ngIf",e.column.DaysCount.selected),o(),c("ngIf",e.column.LastSold.selected),o(),c("ngIf",e.column.LastPurchased.selected),o(),c("ngIf",e.column.DaysPurchased.selected),o(),c("ngIf",e.column.QTY.selected),o(2),c("ngForOf",e.oriData.Data)}}var Aa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/ProductLifeCycle","ReportLoader/ProductLifeCycle",h);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.toastrService=h}roleService=Pe(j);columnService=Pe(gt);column={Category:{selected:!1,name:"Category"},Code:{selected:!0,name:"Code"},ReleaseDate:{selected:!0,name:"Release Date"},DaysCount:{selected:!1,name:"Days Count"},LastSold:{selected:!0,name:"Last Sold"},LastPurchased:{selected:!0,name:"Last Purchased"},DaysPurchased:{selected:!1,name:"Days Purchased"},QTY:{selected:!0,name:"Quantity"}};oriData;sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.oriData;return}this.data=r.sort((t,l)=>{let h=e.direction==="asc",T=typeof t[e.active];switch(V.IsEmpty(t.Code)&&(t.Code=""),V.IsEmpty(l.Code)&&(l.Code=""),V.IsEmpty(t.Released)&&(t.Release=""),V.IsEmpty(l.Released)&&(l.Release=""),V.IsEmpty(t.LastPurchased)&&(t.LastPurchased=""),V.IsEmpty(l.LastPurchased)&&(l.LastPurchased=""),V.IsEmpty(t.LastSold)&&(t.LastSold=""),V.IsEmpty(l.LastSold)&&(l.LastSold=""),T){case"string":return this.compare(t[e.active].toLocaleLowerCase(),l[e.active].toLocaleLowerCase(),h);case"number":return this.compare(t[e.active],l[e.active],h);default:return 0}})}preGetList(){this.pageData.Filter.EntityID||delete this.pageData.Filter.EntityID}postInit(e){this.oriData=e,console.log(e),this.menuData=nt(et({},this.menuData),{SH:e.PageTitle})}openExportModal(){this.matDialog.open(K,{data:{title:"Product Life Cycle",exportTypes:[{ID:"ReportExport/ProductLifeCycle",Value:"Default",FileName:"Product Life Cycle"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-life-cycle"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Category",4,"ngIf"],["mat-sort-header","Name"],["mat-sort-header","Code",4,"ngIf"],["mat-sort-header","Released",4,"ngIf"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above","mat-sort-header","DaysCount",4,"ngIf"],["mat-sort-header","LastSold",4,"ngIf"],["mat-sort-header","LastPurchased",4,"ngIf"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above","mat-sort-header","DaysSinceLastPurchased",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","flex-right text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["mat-sort-header","Category"],["mat-sort-header","Code"],["mat-sort-header","Released"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above","mat-sort-header","DaysCount"],["mat-sort-header","LastSold"],["mat-sort-header","LastPurchased"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above","mat-sort-header","DaysSinceLastPurchased"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right","text-end"],[1,"border-bottom"],[3,"routerLink","queryParams"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above",4,"ngIf"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above",4,"ngIf"],["class","text-end",4,"ngIf"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,jy,3,0,"a",2),a(),n(3,"filters"),E(4,qy,15,8,"ng-template",null,0,O),a(),E(6,sD,17,9,"content",3),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,J,L,R,ie,pe,ge,Ce,U,ze,re,oe,ne],encapsulation:2})};function cD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function dD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Supplier"),a(),n(14,"autocompleteV2",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(15,"h6"),p(16,"Row Count"),a(),n(17,"input",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.SupplierID),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function uD(i,s){i&1&&(n(0,"th",21),p(1,"Total Cost"),a())}function _D(i,s){i&1&&(n(0,"th",21),p(1,"Total profit "),a())}function gD(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalCost))}}function CD(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalProfit))}}function fD(i,s){if(i&1&&(n(0,"tr",23)(1,"td",24),p(2),a(),n(3,"td",24),p(4),a(),n(5,"td"),p(6),a(),n(7,"td"),p(8),a(),n(9,"td",25),p(10),d(11,"quantityFraction"),a(),n(12,"td",25),p(13),d(14,"quantityFraction"),a(),n(15,"td",25),p(16),d(17,"amountFraction"),a(),S(18,gD,3,3,"td",26),S(19,CD,3,3,"td",25),n(20,"td",25),p(21),d(22,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.PrevRank||"-"),o(2),F(e.Rank),o(2),F(e.Name),o(2),F(e.Code),o(2),F(g(11,10,e.Quantity)),o(3),F(g(14,12,e.OnHand)),o(3),F(g(17,14,e.TotalAmount)),o(2),y(r.roleService.product.Cost?18:-1),o(),y(r.roleService.report.Profit?19:-1),o(2),F(g(22,16,e.Margin))}}function xD(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data,"TotalCost")))}}function hD(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data,"TotalProfit")))}}function SD(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",27),b(2,"td",28),n(3,"td",29),p(4,"Total:"),a(),n(5,"td",29),p(6),d(7,"sum"),d(8,"quantityFraction"),a(),n(9,"td",29),p(10),d(11,"sum"),d(12,"quantityFraction"),a(),n(13,"td",29),p(14),d(15,"sum"),d(16,"amountFraction"),a(),S(17,xD,4,6,"td",29),S(18,hD,4,6,"td",29),a()()),i&2){let e=m(2);o(6),F(g(8,8,v(7,5,e.data,"Quantity"))),o(4),F(g(12,13,v(11,10,e.data,"OnHand"))),o(4),F(g(16,18,v(15,15,e.data,"TotalAmount"))),o(3),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.report.Profit?18:-1)}}function yD(i,s){if(i&1){let e=I();n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",16)(5,"tr")(6,"th",17),p(7,"Prev"),a(),n(8,"th",17),p(9,"Now"),a(),n(10,"th",18),p(11,"Name"),a(),n(12,"th",19),p(13,"Code"),a(),n(14,"th",17),p(15,"Sold"),a(),n(16,"th",20),p(17,"On Hand"),a(),n(18,"th",21),p(19,"Total Amount"),a(),S(20,uD,2,0,"th",21),S(21,_D,2,0,"th",21),n(22,"th",22),p(23,"%"),a()()(),n(24,"tbody"),G(25,fD,23,18,"tr",23,Y),a(),S(27,SD,19,20,"tfoot"),a()()()()}if(i&2){let e=m();o(20),y(e.roleService.product.Cost?20:-1),o(),y(e.roleService.report.Profit?21:-1),o(4),H(e.data.Data),o(2),y(e.data.length>0?27:-1)}}var Ga=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/GetReportProductProfit","ReportLoader/GetReportProductProfit",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.toastrService=T}RadioGroupBy=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];originalData;openExportModal(){this.matDialog.open(K,{data:{title:"Product Profit Report",exportTypes:[{ID:"ReportExport/GetReportProductProfit",Value:"Default",FileName:"Product Profit Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.originalData=e.Data}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";return this.compare(t[e.active],l[e.active],h)})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-profit"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","100px"],[2,"width","600px"],[2,"width","100px"],["matTooltip","On Hand Inventory",1,"text-end",2,"width","200px"],[1,"text-end",2,"width","200px"],["mat-sort-header","Margin",1,"text-end","align-right",2,"width","200px"],[1,"border-bottom"],[1,"text-end",2,"width","35px"],[1,"text-end","text-success"],[1,"text-end","text-danger"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,cD,3,0,"a",2),a(),n(3,"filters"),E(4,dD,18,10,"ng-template",null,0,O),a(),S(6,yD,28,3,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,J,Qe,L,R,ie,pe,ge,Ue,Ae,Ce,U,se,Z,ne],encapsulation:2})};var DD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],vD=i=>({ID:i});function wD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function TD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function PD(i,s){if(i&1&&(n(0,"tr",14)(1,"td")(2,"a",15),p(3),a()(),n(4,"td"),p(5),a(),n(6,"td"),p(7),a(),n(8,"td"),p(9),d(10,"quantityFraction"),a(),n(11,"td"),p(12),d(13,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(11,DD))("queryParams",X(12,vD,e.ID)),o(),F(e.InvoiceNumber),o(2),F(e.Name),o(2),F(e.Code),o(2),F(g(10,7,e.Quantity)),o(3),F(g(13,9,e.Price))}}function FD(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"table",12)(3,"thead",13)(4,"tr")(5,"th"),p(6,"Number"),a(),n(7,"th"),p(8,"Name"),a(),n(9,"th"),p(10,"Code"),a(),n(11,"th"),p(12,"Quantity"),a(),n(13,"th"),p(14,"Price"),a()()(),n(15,"tbody"),G(16,PD,14,14,"tr",14,Y),a()()()()),i&2){let e=m();o(16),H(e.data.Data)}}var Ha=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/GetExchangedSales","ReportLoader/GetExchangedSales",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.toastrService=T}openExportModal(){this.matDialog.open(K,{data:{title:"Exchanged Sales Report",exportTypes:[{ID:"ReportExport/GetExchangedSales",Value:"Default",FileName:"Exchanged Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-exchanged-sales"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border-bottom"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,wD,3,0,"a",2),a(),n(3,"filters"),E(4,TD,12,7,"ng-template",null,0,O),a(),S(6,FD,18,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,R,Ce,U,Z,ne],encapsulation:2})};function ID(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function bD(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product by Name"),a(),n(3,"autocompleteV2",12),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),C("ngModel",e.pageData.Filter.ProductID)}}function ED(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product by Code"),a(),n(3,"autocompleteV2",13),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),C("ngModel",e.pageData.Filter.ProductID)}}function MD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",7),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",8)(8,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Search By"),a(),n(11,"radio-options",10),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SearchBy,t)||(l.pageData.Filter.SearchBy=t),_(t)}),a(),S(12,bD,4,1,"div"),S(13,ED,4,1,"div"),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.pageData.Filter.SearchBy),c("options",e.RadioSearchBy),o(),y(e.pageData.Filter.SearchBy?12:-1),o(),y(e.pageData.Filter.SearchBy?-1:13),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function VD(i,s){if(i&1&&(n(0,"tr",20)(1,"td",21),p(2),a(),n(3,"td"),p(4),a(),n(5,"td",21),p(6),d(7,"quantityFraction"),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a()()),i&2){let e=s.$implicit;o(2),F(e.Rank),o(2),F(e.Name),o(2),F(g(7,4,e.Quantity)),o(3),F(g(10,6,e.OnHand))}}function BD(i,s){if(i&1&&(n(0,"content")(1,"div",14)(2,"table",15)(3,"thead",16)(4,"tr")(5,"th",17),p(6,"Rank"),a(),n(7,"th",18),p(8,"Name"),a(),n(9,"th",19),p(10,"Sold"),a(),n(11,"th",19),p(12,"Inventory"),a()()(),n(13,"tbody"),G(14,VD,11,8,"tr",20,Y),a()()()()),i&2){let e=m();o(14),H(e.data.Data)}}var Qa=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/GetSalesRankByVariantModel","ReportLoader/GetSalesRankByVariantModel",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.toastrService=T}RadioSearchBy=[{Key:!0,Value:"Name"},{Key:!1,Value:"Code"}];openExportModal(){this.matDialog.open(K,{data:{title:"Variant Model Rank Report",exportTypes:[{ID:"ReportExport/GetSalesRankByVariantModel",Value:"Default",FileName:"Variant Model Rank Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-variant-model-rank"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Search By",3,"modelChange","model","options"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestion","placeholder","Search by Name",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCode","placeholder","Search by Code",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","70px"],[2,"width","800px"],[1,"text-end",2,"width","100px"],[1,"border-bottom"],[1,"text-end"],[1,"text-success","text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,ID,3,0,"a",2),a(),n(3,"filters"),E(4,MD,17,11,"ng-template",null,0,O),a(),S(6,BD,16,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,J,Qe,L,R,Ue,Te,Ae,U,ne],encapsulation:2})};var OD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],LD=i=>({ID:i});function RD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function kD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function WD(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",20),p(5),a()(),n(6,"td"),p(7),d(8,"date"),a(),n(9,"td"),p(10),a(),n(11,"td"),p(12),a(),n(13,"td",16),p(14),d(15,"quantityFraction"),a(),n(16,"td",16),p(17),d(18,"amountFraction"),a(),n(19,"td",21),p(20),a(),n(21,"td",16),p(22),d(23,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(e.EntityName),o(2),c("routerLink",M(20,OD))("queryParams",X(21,LD,e.InvoiceID)),o(),F(e.Number),o(2),F(v(8,11,e.Date,"dd MMM yyyy")),o(3),F(e.Name),o(2),F(e.Code),o(2),D("(",g(15,14,e.Quantity),")"),o(3),F(g(18,16,e.UnitPrice)),o(3),D("",e.Discount&&e.Discount!=0?-e.Discount+"%":""," "),o(2),D("(",g(23,18,e.Total),")")}}function ND(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"div",12)(3,"table",13)(4,"thead",14)(5,"tr")(6,"th"),p(7,"Outlet"),a(),n(8,"th",15),p(9,"Number"),a(),n(10,"th"),p(11,"Date"),a(),n(12,"th"),p(13,"Name"),a(),n(14,"th"),p(15,"Code"),a(),n(16,"th",16),p(17,"Quantity"),a(),n(18,"th",16),p(19),a(),n(20,"th",17),p(21,"%"),a(),n(22,"th",16),p(23),a()()(),n(24,"tbody"),G(25,WD,24,23,"tr",null,Y),a(),n(27,"tfoot")(28,"tr",18),b(29,"td",19)(30,"td",19)(31,"td",19)(32,"td",19)(33,"td",19),n(34,"td",16),p(35),d(36,"sum"),d(37,"quantityFraction"),a(),b(38,"td",19)(39,"td",19),n(40,"td",16),p(41),d(42,"sum"),d(43,"amountFraction"),a()()()()()()()),i&2){let e=m();o(19),D("Price (",e.data.CurrencySymbol,")"),o(4),D("Total(",e.data.CurrencySymbol,")"),o(2),H(e.data.Data),o(10),F(g(37,7,v(36,4,e.data.Data,"Quantity"))),o(6),F(g(43,12,v(42,9,e.data.Data,"Total")))}}var Ya=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/SalesReturnList","ReportLoader/ReturnReportLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}month;year;openExportModal(){this.matDialog.open(K,{data:{title:"Sales Return",exportTypes:[{ID:"ReportExport/SalesReturnExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.menuData.H=e.PageTitle}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-return"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end"],[2,"width","30px"],[1,"table-footer"],[1,"empty-column"],[3,"routerLink","queryParams"],[1,"text-danger"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,RD,3,0,"a",2),a(),n(3,"filters"),E(4,kD,12,6,"ng-template",null,0,O),a(),S(6,ND,44,14,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,R,Ae,U,se,oe,Z,ne],encapsulation:2})};var AD=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],GD=i=>({ID:i});function HD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function QD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Supplier"),a(),n(6,"autocompleteV2",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.SupplierID),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function YD(i,s){i&1&&(n(0,"th",15),p(1,"Unit Cost"),a())}function jD(i,s){if(i&1&&(b(0,"td",36),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.UnitPrice),Ee)}}function qD(i,s){if(i&1&&(n(0,"tr",24)(1,"td",31),b(2,"span",32),a(),b(3,"td",33),n(4,"td",34),p(5),d(6,"quantityFraction"),a(),b(7,"td",35),S(8,jD,2,3,"td",36),n(9,"td",37),p(10),d(11,"amountFraction"),a(),b(12,"td",36),d(13,"amountFraction"),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("innerHtml",e.Name,Ee),o(),c("innerHtml",e.Code,Ee),o(2),D("(",g(6,7,e.Quantity),")"),o(2),c("innerHtml",e.UOMName,Ee),o(),y(r.roleService.product.Cost?8:-1),o(2),D(" ",e.Discount==0?"":"-"+g(11,9,e.Discount)+"%"),o(2),c("innerHtml",g(13,11,e.Total),Ee)}}function UD(i,s){i&1&&(n(0,"td",28),p(1,"\xA0"),a())}function zD(i,s){if(i&1&&(n(0,"div")(1,"div",18)(2,"a",19),b(3,"span",20),d(4,"date"),d(5,"date"),a(),n(6,"span"),p(7),d(8,"showIfNotNullOrEmptyString"),a()(),b(9,"span",21),n(10,"div",22)(11,"div")(12,"table",23),b(13,"thead"),n(14,"tbody"),G(15,qD,14,13,"tr",24,Y),a()()()(),n(17,"table",25)(18,"thead")(19,"tr",26)(20,"td",27),p(21,"Total"),a(),n(22,"td",28),p(23,"\xA0"),a(),n(24,"td",15),p(25),d(26,"sum"),d(27,"quantityFraction"),a(),b(28,"td",29),S(29,UD,2,0,"td",28),n(30,"td",30),p(31,"\xA0"),a(),n(32,"td",15),p(33),d(34,"sum"),d(35,"amountFraction"),a()()()()()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(27,AD))("queryParams",X(28,GD,e.InvoiceID)),o(),c("innerHtml",e.EntityName+" #"+e.Number+" - "+v(4,8,e.Date,"dd MMM yyyy")+" ("+v(5,11,e.Created,"HH:mm")+")",Ee),o(4),D(" ",v(8,14,e.CustomerNameDisplay," - {0}")," "),o(2),c("innerHtml",e.Note,Ee),o(6),H(e.Item),o(10),D("",g(27,20,v(26,17,e.Item,"Quantity")),"\xA0"),o(4),y(r.roleService.product.Cost?29:-1),o(4),D("",g(35,25,v(34,22,e.Item,"Total")),"\xA0 ")}}function KD(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"table",12)(3,"thead",13)(4,"tr")(5,"th"),p(6,"Name"),a(),n(7,"th",14),p(8,"Code"),a(),n(9,"th",15),p(10,"Quantity"),a(),n(11,"th",16),p(12,"UOM"),a(),S(13,YD,2,0,"th",15),n(14,"th",17),p(15,"%"),a(),n(16,"th",15),p(17,"Total(Rp.)"),a()()()(),G(18,zD,36,30,"div",null,Y),a()()),i&2){let e=m();o(13),y(e.roleService.product.Cost?13:-1),o(5),H(e.data.Data)}}var ja=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/PurchaseReturnList","ReportLoader/ReturnReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Return",exportTypes:[{ID:"ReportExport/PurchaseReturnList",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}postInit(){this.menuData.H=this.data.PageTitle}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-return"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"UOMWidth",2,"width","50px"],[2,"width","5%"],[1,"mt-7"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHtml"],[1,"mt-3","mb-3",3,"innerHtml"],[1,"items"],["cellspacing","0",1,"table","table-sm"],[1,"border-top"],[1,"w-100"],[1,"table-footer"],[1,"empty-column"],[1,"empty-column",2,"width","10%"],[1,"empty-column",2,"width","50px"],[1,"empty-column",2,"width","5%"],[1,"border-start","border-end"],[3,"innerHtml"],[1,"border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%"],[1,"UOMWidth","border-start","border-end",2,"width","50px",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"small","text-danger","border-start","border-end",2,"width","5%"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,HD,3,0,"a",2),a(),n(3,"filters"),E(4,QD,12,6,"ng-template",null,0,O),a(),S(6,KD,20,1,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,R,Ae,U,se,On,oe,Z,ne],encapsulation:2})};var XD=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],JD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],dl=i=>({ID:i});function ZD(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.exportCSV(t.csvConverter,"Report/ProductSalesByInvoice","Invoice_Item_Details.csv"))}),b(1,"i",6),p(2," Export"),a()}}function $D(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Customer"),a(),n(12,"autocompleteV2",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(13,"h6"),p(14,"Page Size"),a(),n(15,"input",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(20,"div",14)(21,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(22,"h6"),p(23,"Product"),a(),n(24,"autocompleteV2",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a(),n(25,"h6"),p(26,"Variant"),a(),n(27,"autocompleteV2",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("ngModel",e.pageData.Filter.RowCount),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("inputTextValue",e.pageData.Filter.ProductName),C("ngModel",e.pageData.Filter.ProductID),o(3),c("inputTextValue",e.pageData.Filter.VariantName)("renderThumbnail",!0),C("ngModel",e.pageData.Filter.VariantID)}}function ev(i,s){i&1&&(n(0,"th",23),p(1," Batch Number "),a())}function tv(i,s){i&1&&(n(0,"th",27),p(1," Cost "),a())}function iv(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.SerialBatchNumber)}}function nv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.UnitCost,r.pageData.FractionDigit)," ")}}function av(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td"),p(4),d(5,"date"),a(),n(6,"td")(7,"a",32),p(8),a()(),S(9,iv,2,1,"td"),n(10,"td")(11,"div",33)(12,"a",34),p(13),a(),n(14,"small",35),p(15),a()()(),n(16,"td"),p(17),a(),n(18,"td",36),p(19),d(20,"number"),a(),S(21,nv,3,4,"td",36),n(22,"td",36),p(23),d(24,"number"),a(),n(25,"td",36),p(26),d(27,"number"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Outlet),o(2),F(v(5,16,e.Date,"dd MMM yy")),o(3),c("routerLink",M(27,JD))("queryParams",X(28,dl,e.InvoiceID)),o(),F(e.Number),o(),y(r.showBatchNumber?9:-1),o(3),c("queryParams",X(30,dl,e.CustomerID)),o(),F(e.CustomerName),o(),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),F(e.Code),o(2),F(e.SalesPerson),o(2),$t(" ",g(20,19,e.Quantity),"",e.UnitQuantity!=1?" x "+e.UnitQuantity:""," "),o(2),y(r.roleService.product.Cost?21:-1),o(2),D(" ",v(24,21,e.UnitPrice,r.pageData.FractionDigit)," "),o(3),D(" ",v(27,24,e.Total,r.pageData.FractionDigit)," ")}}function ov(i,s){i&1&&b(0,"td",39)}function rv(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",37)(2,"td",38),p(3," Total: "),a(),n(4,"td",36),p(5),d(6,"sum"),d(7,"number"),a(),S(8,ov,1,0,"td",39),b(9,"td",39),n(10,"td",36),p(11),d(12,"sum"),d(13,"number"),a()()()),i&2){let e=m(2);o(2),c("colSpan",e.showBatchNumber?6:5),o(3),F(g(7,7,v(6,4,e.data.Data,"Quantity"))),o(3),y(e.roleService.product.Cost?8:-1),o(3),D(" ",v(13,12,v(12,9,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function lv(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5," Outlet "),a(),n(6,"th",21),p(7," Date "),a(),n(8,"th",22),p(9," Invoice # "),a(),S(10,ev,2,0,"th",23),n(11,"th",24),p(12,"Customer"),a(),n(13,"th",25),p(14," SALES PERSON "),a(),n(15,"th",26),p(16," Qty "),a(),S(17,tv,2,0,"th",27),n(18,"th",28),p(19," Price "),a(),n(20,"th",29),p(21," Total "),a()()(),n(22,"tbody"),G(23,av,28,32,"tr",null,Y),a(),S(25,rv,14,15,"tfoot"),a(),n(26,"div",30)(27,"POS-complex-pagination",31),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=m();o(10),y(e.showBatchNumber?10:-1),o(7),y(e.roleService.product.Cost?17:-1),o(6),H(e.data.Data),o(2),y(e.data.Data.length>0?25:-1),o(2),c("total",e.data.Data.length)("pageData",e.pageData)}}var qa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/ProductSalesByInvoice","ReportLoader/ProductSalesByInvoice",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=h}originalData;showBatchNumber=!0;maskingFields;maskingFieldMsg=Rn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.menuData.H=this.pageData.PageTitle,this.originalData=e.Data,this.initShowBatchNumber()}initShowBatchNumber(){let e=this.data?.Data[0]?.SerialBatchNumber;this.showBatchNumber=e!=null}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.Outlet,l.Outlet,h);case"Date":return this.compare(t.Date,l.Date,h);case"Number":return this.compare(t.Number,l.Number,h);case"SerialBatchNumber":return this.compare(t.SerialBatchNumber,l.SerialBatchNumber,h);case"CustomerName":return this.compare(t.CustomerName,l.CustomerName,h);case"SalesPerson":return this.compare(t.SalesPerson,l.SalesPerson,h);case"UnitCost":return this.compare(t.UnitCost,l.UnitCost,h);case"UnitPrice":return this.compare(t.UnitPrice,l.UnitPrice,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Discount":return this.compare(t.Discount,l.Discount,h);case"Total":return this.compare(t.TotalAfterDiscount,l.TotalAfterDiscount,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-invoice-items"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100",3,"ngModelChange","ngModel"],["type","text","autoNum","","min","0",1,"w-100",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search by Product",1,"w-100",3,"ngModelChange","inputTextValue","ngModel"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search by Variant",1,"w-100",3,"ngModelChange","inputTextValue","renderThumbnail","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet","width","100px",1,"align-left"],["mat-sort-header","Date",1,"align-left",2,"width","80px"],["mat-sort-header","Number",1,"align-left",2,"width","120px"],["mat-sort-header","SerialBatchNumber",1,"align-left"],["mat-sort-header","CustomerName",1,"align-left"],["mat-sort-header","SalesPerson",1,"align-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","60px"],["mat-sort-header","UnitCost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"d-sm-block","mt-2"],["api","Report/ProductSalesByInvoiceCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["target","_blank",3,"routerLink","queryParams"],[1,"w-100"],["routerLink","/menu/Contacts/Contact/Customers/Info","target","_blank",1,"d-block",3,"queryParams"],["matTooltipPosition","above",1,"opacity-75","d-inline",3,"matTooltip"],[1,"text-end"],[1,"table-footer"],[1,"text-end","empty-column",3,"colSpan"],[1,"empty-column"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,ZD,3,0,"a",2),n(3,"a",3),p(4,"Group by Product"),a()(),n(5,"filters"),E(6,$D,28,16,"ng-template",null,0,O),a(),n(8,"content"),S(9,lv,28,5,"div",4),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,XD)),o(6),y(t.data?9:-1))},dependencies:[A,Q,J,Qe,L,R,ie,pe,ge,Ue,Ae,Et,Ce,U,ze,se,re,oe],encapsulation:2})};var pv=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],mv=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],sv=()=>["/menu/Contacts/Contact/Customers/Info"],cv=i=>({ID:i}),ul=(i,s)=>({"text-danger":i,"text-success":s});function dv(i,s){if(i&1){let e=I();n(0,"a",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function uv(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Brand"),a(),n(3,"ng-select",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListBrandID,t)||(l.pageData.Filter.ListBrandID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",14),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",15)(9,"datepicker",16),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Row Count"),a(),n(12,"input",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0),C("ngModel",e.pageData.Filter.ListBrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brand),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function _v(i,s){i&1&&(n(0,"th",27),p(1,"Total Cost "),a())}function gv(i,s){i&1&&(n(0,"th",28),p(1,"Profit"),a())}function Cv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalCost?e.TotalCost:0))}}function fv(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,ul,e.Profit<0,e.Profit>0)),o(),D(" ",g(2,2,e.Profit))}}function xv(i,s){if(i&1&&(n(0,"tr")(1,"td",33),p(2),a(),n(3,"td",34),p(4),d(5,"quantityFraction"),a(),n(6,"td",35),p(7),d(8,"amountFraction"),a(),S(9,Cv,3,3,"td",36),S(10,fv,3,7,"td",37),a()),i&2){let e=s.$implicit,r=m(3);o(2),D("",e.BrandName," "),o(2),D(" ",g(5,5,e.Quantity?e.Quantity:0)),o(3),D(" ",g(8,7,e.TotalSales?e.TotalSales:0)),o(2),y(r.roleService.product.Cost?9:-1),o(),y(r.roleService.report.Profit?10:-1)}}function hv(i,s){if(i&1&&(n(0,"tr",29)(1,"td")(2,"a",30),p(3),a()(),n(4,"td",21),p(5),a(),n(6,"td",22),p(7),a(),n(8,"td",23),p(9),a(),n(10,"td",31)(11,"table",32),G(12,xv,11,9,"tr",null,Y),a()()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(7,sv))("queryParams",X(8,cv,e.CustomerID)),o(),$t(" ",e.Name," ",e.Title," "),o(2),F(e.Email),o(2),F(e.Mobile),o(2),F(e.City),o(3),H(e.Detail)}}function Sv(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Total.TotalCost)," ")}}function yv(i,s){if(i&1&&(n(0,"td",42),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(4,ul,e.data.Total.Profit<0,e.data.Total.Profit>0)),o(),D(" ",g(2,2,e.data.Total.Profit)," ")}}function Dv(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",38),b(2,"td",39),n(3,"td",40),p(4),d(5,"quantityFraction"),a(),n(6,"td",40),p(7),d(8,"amountFraction"),a(),S(9,Sv,3,3,"td",41),S(10,yv,3,7,"td",42),a()()),i&2){let e=m(2);o(4),D(" ",g(5,4,e.data.Total.Quantity)," "),o(3),D(" ",g(8,6,e.data.Total.TotalSales)," "),o(2),y(e.roleService.product.Cost?9:-1),o(),y(e.roleService.report.Profit?10:-1)}}function vv(i,s){if(i&1){let e=I();n(0,"div",8)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Customer "),a(),n(6,"th",21),p(7,"Email"),a(),n(8,"th",22),p(9,"Mobile"),a(),n(10,"th",23),p(11,"City"),a(),n(12,"th",24),p(13,"Brand"),a(),n(14,"th",25),p(15," Qty "),a(),n(16,"th",26),p(17,"Total Sales "),a(),S(18,_v,2,0,"th",27),S(19,gv,2,0,"th",28),a()(),n(20,"tbody"),G(21,hv,14,10,"tr",29,Y),a(),S(23,Dv,11,8,"tfoot"),a()()}if(i&2){let e=m();o(18),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.report.Profit?19:-1),o(2),H(e.data.Data),o(2),y(e.data?23:-1)}}var Ua=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CustomerBrand","ReportLoader/CustomerBrand");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}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 h=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);default:return 0}}),this.data.Detail=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"SalesNTax":return this.compare(t.TotalSales,l.TotalSales,h);case"Cost":return this.compare(t.TotalCost,l.TotalCost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Brand Sales Analysis",exportTypes:[{ID:"ReportExport/CustomerBrand",Value:"Default",FileName:"Brand Sales Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"SalesReport/CustomerBrandCount",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-brand-sales-analysis"]],standalone:!1,features:[W],decls:20,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["api","SalesReport/CustomerBrandCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Brand",1,"ng-select-multiple",3,"ngModelChange","multiple","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name","text","Customer",1,"align-left",2,"width","280px"],[2,"width","190px"],[2,"width","155px"],[2,"width","130px"],[2,"min-width","124px"],["mat-sort-header","Quantity","text","Qty",1,"align-left","text-end",2,"min-width","66px"],["mat-sort-header","SalesNTax","text","Total Sales","arrowPosition","before",1,"flex-right","text-end",2,"min-width","112px"],["mat-sort-header","Cost","text","Total Cost","arrowPosition","before",1,"flex-right","text-end",2,"min-width","113px"],["mat-sort-header","Profit","text","Profit","arrowPosition","before",1,"flex-right","text-end",2,"min-width","114px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["colspan","5",1,"p-0"],[1,"w-100","border-top-0"],[1,"border-top-0","text-start",2,"min-width","124px"],[1,"border-top-0","text-end",2,"min-width","66px"],[1,"border-top-0","text-end",2,"min-width","112px"],[1,"border-top-0","text-end","text-danger",2,"min-width","113px"],[1,"border-top-0","text-end",2,"min-width","114px",3,"ngClass"],[1,"footer"],["colspan","5"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,dv,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Brand "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()()()()(),n(13,"filters"),E(14,uv,13,7,"ng-template",null,0,O),a(),n(16,"content")(17,"div",7),S(18,vv,24,3,"div",8),n(19,"POS-complex-pagination",9),P("jumpToPage",function(){return u(l),_(t.getListData())})("previousPage",function(){return u(l),_(t.getListData())})("nextPage",function(){return u(l),_(t.getListData())}),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(10,pv)),o(3),c("routerLink",M(11,mv)),o(7),y(t.data?18:-1),o(),c("total",t.data.TransactionCount)("pageData",t.pageData))},dependencies:[A,tt,Q,$,J,Qe,L,R,pe,ge,Ue,Et,Z,ne],encapsulation:2})};var wv=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),Tv=()=>["/menu/Reports/Sales_Report/Standard/Detail"],Pv=(i,s,e)=>({From:i,To:s,TypeID:e}),_l=(i,s)=>({"text-warning":i,"text-success":s,"text-end":!0}),Ka=(i,s)=>({"text-danger":i,"text-success":s});function Fv(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export"),a()}}function Iv(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Year - Month"),a(),n(2,"div",13)(3,"div",14)(4,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Year=null)}),a()(),n(5,"div",16)(6,"ng-select",17),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Month=null)}),a()()()}if(i&2){let e=m(2);o(4),C("ngModel",e.Year),c("items",e.Years),o(2),C("ngModel",e.Month),c("items",e.Months)}}function bv(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",10)(12,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Compare with Prev Month"),a(),n(15,"radio-options",12),x("modelChange",function(t){u(e);let l=m();return f(l.isCompare,t)||(l.isCompare=t),_(t)}),a(),S(16,Iv,7,4),a()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.isCompare),o(),y(e.isCompare?16:-1)}}function Ev(i,s){i&1&&(n(0,"th",22),p(1,"Prev"),a())}function Mv(i,s){i&1&&(n(0,"th",23),p(1,"Now"),a())}function Vv(i,s){i&1&&(n(0,"th",24),p(1," Trans "),a())}function Bv(i,s){i&1&&(n(0,"th",25),p(1,"Qty"),a())}function Ov(i,s){i&1&&(n(0,"th",27),p(1,"Tax"),a())}function Lv(i,s){if(i&1&&(n(0,"th",28),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Rv(i,s){i&1&&(n(0,"th",29),p(1,"\xB1 (%)"),a())}function kv(i,s){i&1&&(n(0,"th",30),p(1,"Cost"),a())}function Wv(i,s){if(i&1&&(n(0,"th",28),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function Nv(i,s){i&1&&(n(0,"th",31),p(1," Target "),a())}function Av(i,s){i&1&&(n(0,"th",32),p(1," Ach(%) "),a())}function Gv(i,s){if(i&1&&(n(0,"td",29),p(1),a()),i&2){let e=m().$implicit;o(),F(e.PrevIndex)}}function Hv(i,s){if(i&1&&(n(0,"td",41),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,wv,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function Qv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Quantity))}}function Yv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.Count,".0-0"))}}function jv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function qv(i,s){if(i&1&&(n(0,"td",29)(1,"a",42),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(11,Tv))("queryParams",_t(12,Pv,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy"),e.TypeID)),o(4),F(g(6,9,e.SalesWithTax))}}function Uv(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,_l,e.IsNegative,e.IsPositive)),o(),D(" ",g(2,2,e.Increase)," ")}}function zv(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Kv(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function Xv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesTarget)," ")}}function Jv(i,s){if(i&1&&(n(0,"span",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Ka,e.Achievement<0,e.Achievement>0)),o(),D(" ",g(2,2,e.Achievement)," ")}}function Zv(i,s){if(i&1&&(n(0,"span",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Ka,e.AchievementWithTax<0,e.AchievementWithTax>0)),o(),D(" ",g(2,2,e.AchievementWithTax)," ")}}function $v(i,s){if(i&1&&(n(0,"td",29),S(1,Jv,3,7,"span",38),S(2,Zv,3,7,"span",38),a()),i&2){let e=m(3);o(),y(e.pageData.IgnoreTax?-1:1),o(),y(e.pageData.IgnoreTax?2:-1)}}function e3(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",34),p(4),a(),S(5,Gv,2,1,"td",29),S(6,Hv,2,5,"td",41),S(7,Qv,3,3,"td",29),S(8,Yv,3,4,"td",29),n(9,"td",29),p(10),d(11,"amountFraction"),a(),S(12,jv,3,3,"td",36),d(13,"HideSumZero"),S(14,qv,7,16,"td",29),S(15,Uv,3,7,"td",38),S(16,zv,3,3,"td",39),S(17,Kv,3,3,"td",40),S(18,Xv,3,3,"td",29),d(19,"HideSumZero"),S(20,$v,3,2,"td",29),d(21,"HideSumZero"),d(22,"HideSumZero"),a()),i&2){let e=s.$implicit,r=s.$index,t=m(2);o(2),F(r+1),o(2),F(e.Name),o(),y(t.showCompareColumn?5:-1),o(),y(t.showCompareColumn?6:-1),o(),y(t.data.WithCategory?7:-1),o(),y(t.data.WithCategory?-1:8),o(2),F(g(11,14,e.SalesNet)),o(2),y(!t.data.WithCategory&&v(13,16,t.data.Data,"Tax")?12:-1),o(2),y(t.data.WithCategory?-1:14),o(),y(t.showCompareColumn?15:-1),o(),y(t.roleService.product.Cost?16:-1),o(),y(t.roleService.report.Profit?17:-1),o(),y(v(19,19,t.data.Data,"SalesTarget")?18:-1),o(2),y(v(21,22,t.roleService.report.Profit&&t.data.Data,"AchievementWithTax")||v(22,25,t.data.Data,"Achievement")?20:-1)}}function t3(i,s){i&1&&b(0,"td",35)}function i3(i,s){i&1&&b(0,"td",35)}function n3(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Count"),".0-0")," ")}}function a3(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function o3(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function r3(i,s){if(i&1&&(n(0,"td",37)(1,"a",43),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function l3(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",fe(5,_l,e.comparation<0,e.comparation>0)),o(),D(" ",v(2,2,e.comparation,".0-0")," ")}}function p3(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function m3(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data.Data,"Profit")))}}function s3(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ProfitWithTax"))," ")}}function c3(i,s){if(i&1&&(n(0,"td",40),S(1,m3,4,6,"span"),S(2,s3,4,6,"span"),a()),i&2){let e=m(2);o(),y(e.pageData.IgnoreTax?1:-1),o(),y(e.pageData.IgnoreTax?-1:2)}}function d3(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Expense"))," ")}}function u3(i,s){if(i&1&&(n(0,"span",38),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(22,Ka,v(1,2,e.data.Data,"Sales")/v(2,5,e.data.Data,"SalesTarget")<0,v(3,8,e.data.Data,"Sales")/v(4,11,e.data.Data,"SalesTarget")>0)),o(5),D(" ",g(8,20,v(6,14,e.data.Data,"Sales")/v(7,17,e.data.Data,"SalesTarget"))," ")}}function _3(i,s){if(i&1&&(n(0,"span",38),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(22,Ka,v(1,2,e.data.Data,"SalesWithTax")/v(2,5,e.data.Data,"SalesTarget")<0,v(3,8,e.data.Data,"SalesWithTax")/v(4,11,e.data.Data,"SalesTarget")>0)),o(5),D(" ",g(8,20,v(6,14,e.data.Data,"SalesWithTax")/v(7,17,e.data.Data,"SalesTarget"))," ")}}function g3(i,s){if(i&1&&(n(0,"td",29),S(1,u3,9,25,"span",38),S(2,_3,9,25,"span",38),a()),i&2){let e=m(2);o(),y(e.pageData.IgnoreTax?-1:1),o(),y(e.pageData.IgnoreTax?2:-1)}}function C3(i,s){if(i&1){let e=I();n(0,"div",3)(1,"div",18)(2,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",20)(4,"tr")(5,"th"),p(6,"No."),a(),n(7,"th",21),p(8,"Tag"),a(),S(9,Ev,2,0,"th",22),S(10,Mv,2,0,"th",23),S(11,Vv,2,0,"th",24),S(12,Bv,2,0,"th",25),n(13,"th",26),p(14,"Sales"),a(),S(15,Ov,2,0,"th",27),d(16,"HideSumZero"),S(17,Lv,2,1,"th",28),S(18,Rv,2,0,"th",29),S(19,kv,2,0,"th",30),S(20,Wv,2,1,"th",28),S(21,Nv,2,0,"th",31),d(22,"HideSumZero"),S(23,Av,2,0,"th",32),d(24,"HideSumZero"),d(25,"HideSumZero"),a()(),n(26,"tbody"),G(27,e3,23,28,"tr",null,Y),a(),n(29,"tfoot")(30,"tr",33),b(31,"td")(32,"td",34),S(33,t3,1,0,"td",35),S(34,i3,1,0,"td",35),S(35,n3,4,7,"td",29),S(36,a3,4,6,"td",29),n(37,"td",29),p(38),d(39,"sum"),d(40,"amountFraction"),a(),S(41,o3,4,6,"td",36),d(42,"HideSumZero"),S(43,r3,5,6,"td",37),S(44,l3,3,8,"td",38),S(45,p3,4,6,"td",39),S(46,c3,3,2,"td",40),S(47,d3,4,6,"td",29),d(48,"HideSumZero"),S(49,g3,3,2,"td",29),d(50,"HideSumZero"),d(51,"HideSumZero"),a()()()()()}if(i&2){let e=m();o(9),y(e.showCompareColumn?9:-1),o(),y(e.showCompareColumn?10:-1),o(),y(e.data.WithCategory?-1:11),o(),y(e.data.WithCategory?12:-1),o(3),y(!e.data.WithCategory&&v(16,23,e.data.Data,"Tax")?15:-1),o(2),y(e.data.WithCategory?-1:17),o(),y(e.showCompareColumn?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(),y(e.roleService.report.Profit?20:-1),o(),y(v(22,26,e.data.Data,"SalesTarget")?21:-1),o(2),y(v(24,29,e.data.Data,"AchievementWithTax")||v(25,32,e.data.Data,"Achievement")&&e.roleService.report.Profit?23:-1),o(4),H(e.data.Data),o(6),y(e.showCompareColumn?33:-1),o(),y(e.showCompareColumn?34:-1),o(),y(e.data.WithCategory?-1:35),o(),y(e.data.WithCategory?36:-1),o(2),D(" ",g(40,38,v(39,35,e.data.Data,"SalesNet"))," "),o(3),y(!e.data.WithCategory&&v(42,40,e.data.Data,"Tax")?41:-1),o(2),y(e.data.WithCategory?-1:43),o(),y(e.showCompareColumn?44:-1),o(),y(e.roleService.product.Cost?45:-1),o(),y(e.roleService.report.Profit?46:-1),o(),y(e.roleService.product.Expense&&v(48,43,e.data.Data,"Expense")?47:-1),o(2),y(v(50,46,e.roleService.report.Profit&&e.data.Data,"AchievementWithTax")||v(51,49,e.data.Data,"Achievement")?49:-1)}}var za=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/OutletPerformanceByType","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Year=T.getFullYear(),this.Month=T.getMonth()}isCompare=!1;showCompareColumn=!1;DateFilterType=!1;Year;Month;Months=[{ID:0,Label:"Jan"},{ID:1,Label:"Feb"},{ID:2,Label:"Mar"},{ID:3,Label:"Apr"},{ID:4,Label:"May"},{ID:5,Label:"Jun"},{ID:6,Label:"Jul"},{ID:7,Label:"Aug"},{ID:8,Label:"Sep"},{ID:9,Label:"Oct"},{ID:10,Label:"Nov"},{ID:11,Label:"Dec"}];Years=V.GenerateYears(new Date().getFullYear(),11,!0);RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];postInit(e){this.originalData=e.Data,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1).toDateString(),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0).toDateString()}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Count":return this.compare(t.Count,l.Count,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Gross":return this.compare(t.Gross,l.Gross,h);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,h);case"SalesTaxNet":return this.compare(t.SalesNet,l.SalesNet,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,h);case"Expense":return this.compare(t.Expense,l.Expense,h);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,h);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,h);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,h);case"Achievement":return this.compare(t.Achievement,l.Achievement,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales Order Tag",exportTypes:[{ID:"ReportExport/OutletPerformanceByType",Value:"Default",FileName:"Sales Order Tag"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-by-sales-order-type"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Compare",3,"modelChange","model"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"align-left"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-left"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left"],["arrowPosition","before",1,"flex-left",3,"mat-sort-header"],[1,"text-end"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left"],["mat-sort-header","Target","arrowPosition","before",1,"align-left"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"align-left"],[1,"footer"],[1,"freeze","body"],[1,"empty-column"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-primary"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"text-end",3,"ngClass"],[3,"routerLink","queryParams"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Fv,3,0,"button",2),a(),n(3,"filters"),E(4,bv,17,10,"ng-template",null,0,O),a(),n(6,"content"),S(7,C3,52,52,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,U,se,ei,re,oe,Z,ne],encapsulation:2})};var gl=Jt(Po());var f3=new Zt("HIGHCHARTS_LOADER"),x3=new Zt("HIGHCHARTS_ROOT_MODULES"),h3=new Zt("HIGHCHARTS_OPTIONS"),S3=new Zt("HIGHCHARTS_CONFIG"),y3=new Zt("HIGHCHARTS_TIMEOUT"),D3=(()=>{let s=class s{constructor(){this.highcharts=dt(null),this.loader=Pe(f3),this.globalOptions=Pe(h3,{optional:!0}),this.globalModules=Pe(x3,{optional:!0})}loadHighchartsWithModules(r){return Hi(this,null,function*(){let t=yield this.loader();return yield Promise.allSettled([...this.globalModules?.()??[],...r?.modules?.()??[]]),t})}load(r){this.loadHighchartsWithModules(r).then(t=>{this.globalOptions&&t.setOptions(this.globalOptions),this.highcharts.set(t)})}};s.\u0275fac=function(t){return new(t||s)},s.\u0275prov=an({token:s,factory:s.\u0275fac,providedIn:"root"});let i=s;return i})(),v3=(()=>{let s=class s{delay(r){return new Promise(t=>setTimeout(t,r))}keepChartUpToDate(){dn(()=>Hi(this,null,function*(){this.update();let r=yield this.chart();this.chartCreated?r?.update(this.options(),!0,this.oneToOne()):r&&(this.chartCreated=!0)}))}destroyChart(){return Hi(this,null,function*(){let r=yield this.chart();r&&r.destroy()})}constructor(){this.constructorType=hi("chart"),this.oneToOne=hi(!1),this.options=hi.required(),this.update=un(),this.chartInstance=Ho(),this.destroyRef=Pe(Lo),this.el=Pe(Ro),this.platformId=Pe(ko),this.relativeConfig=Pe(S3,{optional:!0}),this.timeout=Pe(y3,{optional:!0}),this.highchartsChartService=Pe(D3),this.chartCreated=!1,this.constructorChart=xi(()=>{let r=this.highchartsChartService.highcharts();if(r)return r[this.constructorType()]}),this.chart=xi(()=>Hi(this,null,function*(){return yield this.delay(this.relativeConfig?.timeout??this.timeout??500),this.constructorChart()?.(this.el.nativeElement,Go(()=>this.options()),r=>this.chartInstance.emit(r))})),!(this.platformId&&zo(this.platformId))&&(this.highchartsChartService.load(this.relativeConfig),this.destroyRef.onDestroy(()=>this.destroyChart()),jo(()=>{this.update()&&this.update.set(!1)}),this.keepChartUpToDate())}};s.\u0275fac=function(t){return new(t||s)},s.\u0275dir=pn({type:s,selectors:[["","highchartsChart",""]],inputs:{constructorType:[1,"constructorType"],oneToOne:[1,"oneToOne"],options:[1,"options"],update:[1,"update"]},outputs:{update:"updateChange",chartInstance:"chartInstance"}});let i=s;return i})(),Xa=(()=>{let s=class s{};s.\u0275fac=function(t){return new(t||s)},s.\u0275cmp=B({type:s,selectors:[["highcharts-chart"]],features:[mn([{directive:v3,inputs:["constructorType","constructorType","oneToOne","oneToOne","options","options","update","update"],outputs:["chartInstance","chartInstance","updateChange","updateChange"]}])],decls:0,vars:0,template:function(t,l){},encapsulation:2,changeDetection:0});let i=s;return i})();function T3(i,s){if(i&1){let e=I();n(0,"div",3)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",4),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Date From - To"),a(),n(6,"div",5)(7,"div",6)(8,"datepicker",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(9,"div",6)(10,"datepicker",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()(),n(11,"h6"),p(12,"Price Range"),a(),n(13,"input",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.PriceRange,t)||(l.pageData.Filter.PriceRange=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),C("ngModel",e.pageData.Filter.ListIDs),o(5),C("ngModel",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(2),C("ngModel",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(3),C("ngModel",e.pageData.Filter.PriceRange)}}function P3(i,s){if(i&1){let e=I();n(0,"button",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function F3(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),d(4,"number"),a(),n(5,"td",21),p(6),d(7,"quantityFraction"),a(),n(8,"td",21),p(9),d(10,"quantityFraction"),a()()),i&2){let e=s.$implicit;o(2),$t(" ",g(3,4,e.KeyValue.Key.StartNumber)," - ",g(4,6,e.KeyValue.Key.EndNumber)," "),o(4),D(" ",e.KeyValue.Value!=0?g(7,8,e.KeyValue.Value):"-"," "),o(3),F(g(10,10,e.Sales))}}function I3(i,s){if(i&1&&(n(0,"content")(1,"div",12)(2,"div",5)(3,"div",6)(4,"table",13)(5,"thead",14)(6,"tr",15)(7,"th",16),p(8,"Price"),a(),n(9,"th",17),p(10,"Qty"),a(),n(11,"th"),p(12,"Sales"),a()()(),n(13,"tbody"),G(14,F3,11,12,"tr",null,Y),a()()(),n(16,"div",6)(17,"div",18)(18,"div",19),b(19,"highcharts-chart",20),a()()()()()()),i&2){let e=m();o(14),H(e.data.Data),o(5),c("Highcharts",e.Highcharts)("options",e.chartOptions())}}Gn(gl.default);var Ja=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/UnitPriceAnalysis","ReportLoader/PriceAnalysis",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}Highcharts=Bi;chartOptions=dt(null);openExportModal(){this.matDialog.open(K,{data:{title:"Price Analysis",exportTypes:[{ID:"ReportExport/PriceAnalysis",Value:"Default",FileName:"Price Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){super.postInit(e),this.chartOptions.set({chart:{type:"pie",style:{fontFamily:'"Roboto-Slab", sans-serif'}},title:{text:"Price Analysis Chart"},credits:{enabled:!1},tooltip:{headerFormat:"",pointFormat:'<span style="color:{point.color}">\u25CF</span> {point.name}: <b>{point.y:.1f}</b>'},plotOptions:{pie:{allowPointSelect:!0,borderWidth:2,cursor:"pointer",dataLabels:{enabled:!0,format:"<b>{point.name}</b><br>{point.y}",distance:20},showInLegend:!0}},series:[{type:"pie",data:[...e.PieChartData.map(r=>({name:r.Name,y:r.Qty}))]}]})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-price-analysis"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"row"],[1,"col-6"],["appearance","outline","name","From",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["appearance","outline","name","To",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","table-bordered"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","250px"],[2,"width","150px"],[1,"card"],[1,"card-body"],[2,"width","100%","height","400px","display","block",3,"Highcharts","options"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"filters"),E(2,T3,14,11,"ng-template",null,0,O),a(),n(4,"actions"),S(5,P3,3,0,"button",2),a(),S(6,I3,20,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(5),y(t.roleService.global.Export?5:-1),o(),y(t.data?6:-1))},dependencies:[A,J,Qe,L,R,Ue,U,Xa,re,ne],encapsulation:2})};var b3=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Cl=i=>({ID:i});function E3(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function M3(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",7),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",8)(10,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Tax"),a(),n(13,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(14,"h6"),p(15,"Page Size"),a(),n(16,"input",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function V3(i,s){i&1&&(n(0,"th",21),p(1," Purchase "),a())}function B3(i,s){i&1&&(n(0,"th",22),p(1," Tax "),a())}function O3(i,s){if(i&1&&b(0,"th",23),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function L3(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function R3(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function k3(i,s){if(i&1&&(b(0,"td",40),d(1,"TaxDefault"),d(2,"number")),i&2){let e=s.$index,r=m().$implicit,t=m(2);c("innerHtml",g(2,5,fi(1,1,t.data.Compenents,r,e)),Ee)}}function W3(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",36),p(5),a()(),n(6,"td")(7,"a",37),p(8),a()(),n(9,"td"),p(10),a(),n(11,"td"),p(12),d(13,"date"),a(),S(14,L3,3,3,"td",38),S(15,R3,3,3,"td",39),G(16,k3,3,7,"td",40,Y),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(13,b3))("queryParams",X(14,Cl,e.ID)),o(),F(e.Number),o(2),c("queryParams",X(16,Cl,e.SupplierID)),o(),D(" ",e.Name," "),o(2),F(e.TaxName),o(2),F(v(13,10,e.Date,"dd MMM yyyy")),o(2),y(r.roleService.product.Cost?14:-1),o(),y(r.roleService.product.Cost?15:-1),o(),H(r.getComponent(r.data))}}function N3(i,s){if(i&1&&(n(0,"td",27)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.infiniteList,"Sales")))}}function A3(i,s){if(i&1&&(n(0,"td",27)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.infiniteList,"Tax")))}}function G3(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e.SumTaxAmount)," ")}}function H3(i,s){if(i&1){let e=I();n(0,"span",41),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport"))}),n(1,"i",42),p(2,"?"),a()()}}function Q3(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function Y3(i,s){if(i&1){let e=I();n(0,"a",43),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",44),p(2," Next"),a()}}function j3(i,s){if(i&1){let e=I();n(0,"a",45),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport",!0))}),b(1,"i",46),p(2," Show All"),a()}}function q3(i,s){if(i&1){let e=I();n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",15)(5,"tr")(6,"th",16),p(7,"Outlet"),a(),n(8,"th",17),p(9,"Number"),a(),n(10,"th",18),p(11,"Supplier"),a(),n(12,"th",19),p(13," Type "),a(),n(14,"th",20),p(15,"Date"),a(),S(16,V3,2,0,"th",21),S(17,B3,2,0,"th",22),G(18,O3,1,1,"th",23,Y),a()(),n(20,"tbody"),G(21,W3,18,18,"tr",null,Y),a(),n(23,"tfoot")(24,"tr",24),b(25,"td",25),n(26,"td",26),p(27,"Total :"),a(),S(28,N3,5,6,"td",27),S(29,A3,5,6,"td",27),G(30,G3,3,3,"td",28,Y),a()()()(),n(32,"div",29)(33,"div",30)(34,"div",31),p(35),d(36,"number"),S(37,H3,3,0,"span",32),S(38,Q3,3,3,"span"),p(39),a()(),n(40,"div",33),S(41,Y3,3,0,"a",34),S(42,j3,3,0,"a",35),a()()()()}if(i&2){let e=m();o(16),y(e.roleService.product.Cost?16:-1),o(),y(e.roleService.product.Cost?17:-1),o(),H(e.data.Compenents),o(3),H(e.infiniteList),o(7),y(e.roleService.product.Cost?28:-1),o(),y(e.roleService.product.Cost?29:-1),o(),H(e.data.Compenents),o(5),D(" Showing 1 - ",g(36,10,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:37),o(),y(e.pageData.HideStoreApiCount?38:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),y(!e.nextPageDisabled&&!e.goToLast?41:-1),o(),y(!e.nextPageDisabled&&!e.goToLast?42:-1)}}var Za=class i extends vi{constructor(e,r,t,l,h,T){super(e,r,"Report/GetPurchaseTaxReport","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Tax Report",exportTypes:[{ID:"ReportExport/GetPurchaseTaxReport",Value:"Default",FileName:"Purchase Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountPurchaseTaxReport",pagination:!0}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.TaxTax=t==0?e.Tax:this.data.Compenents[t-1].TaxTax,r.TaxTax=t==0?r.TaxTax:r.TaxTax+r.TaxTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.TaxTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}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 h=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),h);case"Number":return this.compare(t.Number,l.Number,h);case"Date":return this.compare(t.Date,l.Date,h);case"Tax":return this.compare(t.Tax,l.Tax,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-purchase-tax-report"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[1,"table-footer"],["colspan","4",1,"text-end","empty-column"],[1,"text-end","empty-column"],[1,"text-end","text-success"],[1,"text-end",2,"width","150px"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","matTooltipPosition","above","matTooltip","Load all data",1,"btn","btn-outline-secondary","btn-sm","text-primary"],[3,"routerLink","queryParams"],["routerLink","/menu/Contacts/Contact/Suppliers/Info","target","_blank",3,"queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end",2,"width","150px",3,"innerHtml"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,E3,3,0,"button",2),a(),n(3,"filters"),E(4,M3,17,10,"ng-template",null,0,O),a(),S(6,q3,43,12,"content"),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,Qe,L,R,ie,pe,ge,Ue,U,se,Fi,re,oe,Z],encapsulation:2})};var U3=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],z3=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"];function K3(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",10)(9,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function X3(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",12),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var $a=class i extends De{constructor(e,r,t){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,t);this.httpService=r}chartData;chartConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};postInit(){this.menuData.H=this.data.PageTitle,this.initChartSeries()}initChartSeries(){let e=[];this.data?.Data?.forEach(r=>{let t={name:r.BrandName,y:r.Total};e.push(t)}),this.chartData=e}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(Ne))};static \u0275cmp=B({type:i,selectors:[["app-top-brand-chart"]],standalone:!1,features:[W],decls:17,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[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"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Top Brand "),a()(),n(9,"li")(10,"a",5),p(11," Brand Sales Analysis "),a()()()()(),n(12,"filters"),E(13,K3,10,6,"ng-template",null,0,O),a(),n(15,"content"),S(16,X3,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(7),c("routerLink",M(7,U3)),o(3),c("routerLink",M(8,z3)),o(6),y(t.data?16:-1))},dependencies:[A,Q,J,L,R,ii,U],encapsulation:2})};var J3=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],ki=i=>[i],fl=(i,s)=>({"text-danger":i,"text-success":s});function Z3(i,s){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function $3(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onChangeFilterDate1(t))}),a(),n(13,"h6"),p(14,"Compare With"),a(),n(15,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("multiple",!0),C("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.SalesOrderTags),o(3),c("from",e.pageData.Filter.From_range1)("to",e.pageData.Filter.To_range1),o(3),c("from",e.pageData.Filter.From_range2)("to",e.pageData.Filter.To_range2)}}function ew(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=m(2);o(),D(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function tw(i,s){if(i&1&&(n(0,"th",21),p(1),a()),i&2){let e=m(2);o(),D(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function iw(i,s){i&1&&(n(0,"th",23),p(1," Profit "),a())}function nw(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetProfit1)," ")}}function aw(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetProfit2)," ")}}function ow(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,fl,e.Growth<0,e.Growth>0)),o(),D(" ",g(2,2,e.Growth),"% ")}}function rw(i,s){if(i&1&&(n(0,"tr")(1,"td",26),p(2),a(),n(3,"td",27),p(4),d(5,"amountFraction"),a(),S(6,nw,3,3,"td",28),n(7,"td",27),p(8),d(9,"amountFraction"),a(),S(10,aw,3,3,"td",28),n(11,"td",29),p(12),d(13,"amountFraction"),a(),S(14,ow,3,7,"td",29),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(),c("colSpan",r.roleService.report.Profit?1:2),o(),D(" ",g(5,10,e.SalesNTax1)," "),o(2),y(r.roleService.report.Profit?6:-1),o(),c("colSpan",r.roleService.report.Profit?1:2),o(),D(" ",g(9,12,e.SalesNTax2)," "),o(2),y(r.roleService.report.Profit?10:-1),o(),c("ngClass",fe(16,fl,e.Revenue<0,e.Revenue>0)),o(),D(" ",g(13,14,e.Revenue),"% "),o(2),y(r.roleService.report.Profit?14:-1)}}function lw(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,ki,e.netProfit1Total>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.netProfit1Total)," ")}}function pw(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,ki,e.netProfit2Total>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.netProfit2Total)," ")}}function mw(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,ki,e.profitPercentage>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.profitPercentage),"% ")}}function sw(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",12),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",13)(3,"tr")(4,"th",14),p(5," Outlet "),a(),n(6,"th",15)(7,"span"),p(8),d(9,"date"),a(),p(10," - "),n(11,"span"),p(12),d(13,"date"),a()(),n(14,"th",16)(15,"span"),p(16),d(17,"date"),a(),p(18," - "),n(19,"span"),p(20),d(21,"date"),a()(),n(22,"th",16),p(23,"YOY Growth"),a()(),n(24,"tr",17)(25,"th",18),p(26),a(),S(27,ew,2,1,"th",19),n(28,"th",20),p(29),a(),S(30,tw,2,1,"th",21),n(31,"th",22),p(32,"Revenue"),a(),S(33,iw,2,0,"th",23),a()(),n(34,"tbody"),G(35,rw,15,19,"tr",null,Y),a(),n(37,"tfoot")(38,"tr"),b(39,"td"),n(40,"td",24),p(41),d(42,"amountFraction"),a(),S(43,lw,3,6,"td",25),n(44,"td",24),p(45),d(46,"amountFraction"),a(),S(47,pw,3,6,"td",25),n(48,"td",25),p(49),d(50,"amountFraction"),a(),S(51,mw,3,6,"td",25),a()()()()}if(i&2){let e=m();o(8),F(v(9,22,e.pageData.Filter.From_range1,"dd MMMM yyyy")),o(4),F(v(13,25,e.pageData.Filter.To_range1,"dd MMMM yyyy")),o(4),F(v(17,28,e.pageData.Filter.From_range2,"dd MMMM yyyy")),o(4),F(v(21,31,e.pageData.Filter.To_range2,"dd MMMM yyyy")),o(5),c("colSpan",e.roleService.report.Profit?1:2),o(),D(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),y(e.roleService.report.Profit?27:-1),o(),c("colSpan",e.roleService.report.Profit?1:2),o(),D(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),y(e.roleService.report.Profit?30:-1),o(3),y(e.roleService.report.Profit?33:-1),o(2),H(e.data),o(5),c("colSpan",e.roleService.report.Profit?1:2)("ngClass",X(40,ki,e.salesNTax1Total>0?"text-success":"text-danger")),o(),D(" ",g(42,34,e.salesNTax1Total)," "),o(2),y(e.roleService.report.Profit?43:-1),o(),c("colSpan",e.roleService.report.Profit?1:2)("ngClass",X(42,ki,e.salesNTax2Total>0?"text-success":"text-danger")),o(),D(" ",g(46,36,e.salesNTax2Total)," "),o(2),y(e.roleService.report.Profit?47:-1),o(),c("ngClass",X(44,ki,e.salesNTaxPercentage>0?"text-success":"text-danger")),o(),D(" ",g(50,38,e.salesNTaxPercentage),"% "),o(2),y(e.roleService.report.Profit?51:-1)}}var eo=class i extends me{constructor(e,r,t,l,h,T){super(t,l,"Report/SalesCompareByRange","ReportLoader/SalesCompareByRange");this.csvConverter=e;this.roleService=r;this.sumPipe=h;this.matDialog=T}salesNTax1Total=0;salesNTax2Total=0;netProfit1Total=0;netProfit2Total=0;salesNTaxPercentage=0;profitPercentage=0;originalData;ngOnInit(){}postInit(e){this.menuData.H="Sales Compare By Outlet",this.salesNTax1Total=this.sumPipe.transform(this.data,"SalesNTax1"),this.salesNTax2Total=this.sumPipe.transform(this.data,"SalesNTax2"),this.netProfit1Total=this.sumPipe.transform(this.data,"NetProfit1"),this.netProfit2Total=this.sumPipe.transform(this.data,"NetProfit2"),this.salesNTaxPercentage=this.calculatePercentage(this.salesNTax1Total,this.salesNTax2Total),this.profitPercentage=this.calculatePercentage(this.netProfit1Total,this.netProfit2Total),this.originalData=e}calculatePercentage(e,r){return(r-e)/e*100}preGetList(){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.PageNumber}onChangeFilterDate1(e){this.pageData.Filter.From_range1=e.from,this.pageData.Filter.To_range1=e.to}onChangeFilterDate2(e){this.pageData.Filter.From_range2=e.from,this.pageData.Filter.To_range2=e.to}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.originalData;return}this.data=r.sort((t,l)=>{let h=e.direction==="asc";switch(typeof t[e.active]){case"number":return this.compare(t[e.active],l[e.active],h);case"string":return this.compare(t[e.active],l[e.active],h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales Compare by Outlet",exportTypes:[{ID:"ReportExport/SalesCompareByRange",Value:"Default",FileName:"Sales Compare by Outlet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(q),w(j),w(N),w(k),w(se),w(z))};static \u0275cmp=B({type:i,selectors:[["app-sales-compare-by-outlet"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["matTooltipPosition","above","matTooltip","12 Months Compare",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindValue","ID","bindLabel","Name","placeholder","Choose Sales Order Tag",3,"ngModelChange","multiple","ngModel","items"],[3,"dateChange","from","to"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-header"],["rowspan","2","colspan","1","mat-sort-header","EntityName",1,"border-end","text-center"],["colspan","2",1,"text-center"],["colspan","2",1,"text-center","border-start"],[1,"border-top-2"],["mat-sort-header","SalesNTax1",1,"align-center",3,"colSpan"],["mat-sort-header","NetProfit1",1,"align-center","border-end"],["mat-sort-header","SalesNTax2",1,"align-center",3,"colSpan"],["mat-sort-header","NetProfit2",1,"align-center","border-end"],["mat-sort-header","Revenue",1,"align-center"],["mat-sort-header","Growth",1,"align-center"],[1,"text-end",3,"colSpan","ngClass"],[1,"text-end",3,"ngClass"],[1,"border-start","border-end"],[1,"text-end","border-end",3,"colSpan"],[1,"text-end","border-end"],[1,"text-end","border-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Z3,3,0,"button",2),n(3,"a",3),p(4," View Monthly"),a()(),n(5,"filters"),E(6,$3,16,13,"ng-template",null,0,O),a(),n(8,"content"),S(9,sw,52,46,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,J3)),o(6),y(t.data?9:-1))},dependencies:[A,tt,Q,$,L,R,ie,pe,ge,Gt,Ce,U,oe,Z],styles:["thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:60px;z-index:1020}@media only screen and (max-width: 768px){thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1020}}"]})};var Ji=Jt(bi());var cw={parse:{dateInput:"YYYY"},display:{dateInput:"YYYY",monthYearLabel:"YYYY",dateA11yLabel:"YYYY",monthYearA11yLabel:"YYYY"}},Wi=class i{yearCtrl=new Zo(null);year=un(null);minDate=(0,Ji.default)().subtract(100,"years");maxDate=(0,Ji.default)();constructor(){dn(()=>{this.year()&&this.yearCtrl.setValue((0,Ji.default)().year(this.year()).startOf("year"))})}chosenYearHandler(s,e){let r=s.year(),t=(0,Ji.default)().year(r).startOf("year");this.yearCtrl.setValue(t),this.year.set(r),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["pos-datepicker-year"]],inputs:{year:[1,"year"]},outputs:{year:"yearChange"},features:[Ci([{provide:yn,useClass:Nn,deps:[Sn]},{provide:Dn,useValue:cw}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker","w-100"],["matInput","",3,"click","matDatepicker","formControl","min","max"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("click",function(){u(t);let h=Dt(4);return _(h.open())}),a(),b(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(h){u(t);let T=Dt(4);return _(r.chosenYearHandler(h,T))}),a()()}if(e&2){let t=Dt(4);o(),c("matDatepicker",t)("formControl",r.yearCtrl)("min",r.minDate)("max",r.maxDate),o(),c("for",t)}},dependencies:[bn,wn,vn,Di,En,yi,Tn,Pn,Fn,At,Qe,L,gn,er],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}
|
|
6
|
+
`)}),h}}}}generateSeries(){let e,r=[];return r=this.data.MonthlySalesRank.map(t=>(e={name:`${t.Name} ${t.CompareYear}`,data:t.Sales,stack:t.Year},e)),r}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-sales"]],standalone:!1,features:[W],decls:11,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[3,"dateChange","date"],[1,"mt-4"],["appendTo","body","bindValue","value","bindLabel","label","placeholder","Compare To Year",3,"ngModelChange","ngModel","items"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],["name","Inventory",3,"modelChange","model"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"a",3),b(4,"i",4),p(5,"Table View"),a()()(),n(6,"filters"),E(7,iu,22,13,"ng-template",null,0,O),a(),n(9,"content"),S(10,nu,2,2,"div",5),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(3),c("routerLink",M(6,tu)),o(7),y(t.data?10:-1))},dependencies:[A,Q,$,L,R,ie,Te,Mt,pi,Ce,U],encapsulation:2})};var au=()=>["/menu/Reports/Sales_Report/Standard/Yearly"],ou=(i,s)=>({"text-success":i,"text-danger":s}),el=(i,s)=>({"text-success fw-bold":i,"text-danger fw-bold":s});function ru(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function lu(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year to Compare"),a(),n(12,"div",12)(13,"div",13)(14,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.FromYear,t)||(l.pageData.Filter.FromYear=t),_(t)}),a()(),n(15,"div",13)(16,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ToYear,t)||(l.pageData.Filter.ToYear=t),_(t)}),a()()(),n(17,"h6"),p(18,"Sales Order Tag"),a(),n(19,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(20,"h6"),p(21,"Currency"),a(),n(22,"ng-select",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Option.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.SalesID),o(5),C("ngModel",e.pageData.Filter.FromYear),c("items",e.Years),o(2),C("ngModel",e.pageData.Filter.ToYear),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Option==null?null:e.pageData.Option.Types),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Option.Currencies)}}function pu(i,s){if(i&1&&(n(0,"th",21),d(1,"GetChildrenArray"),d(2,"sum"),p(3),a()),i&2){let e=s.$implicit,r=m(2);c("colSpan",v(2,5,r.filterSales(v(1,2,r.data.Data,"Sales"),"Year",e),"Tax")==0?1:3),o(3),D(" ",e)}}function mu(i,s){i&1&&(n(0,"th",27),p(1," Sales"),a())}function su(i,s){i&1&&(n(0,"th",28),p(1," Tax"),a())}function cu(i,s){if(i&1&&(S(0,mu,2,0,"th",27),d(1,"GetChildrenArray"),d(2,"sum"),S(3,su,2,0,"th",28),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"th",28),p(7," Sales + Tax"),a()),i&2){let e=s.$implicit,r=m(2);y(v(2,5,r.filterSales(v(1,2,r.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,11,r.filterSales(v(4,8,r.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1)}}function du(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m(2);o(),D(" ",g(3,4,v(2,1,t.filterSales(r.Sales,"Year",e),"Sales")))}}function uu(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit,t=m(2);o(),D(" ",g(3,4,v(2,1,t.filterSales(r.Sales,"Year",e),"Tax"))," ")}}function _u(i,s){if(i&1&&(S(0,du,4,6,"td",28),d(1,"GetChildrenArray"),d(2,"sum"),S(3,uu,4,6,"td",28),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"td",28),p(7),d(8,"sum"),d(9,"amountFraction"),a()),i&2){let e=s.$implicit,r=m().$implicit,t=m(2);y(v(2,6,t.filterSales(v(1,3,t.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,12,t.filterSales(v(4,9,t.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1),o(4),D(" ",g(9,18,v(8,15,t.filterSales(r.Sales,"Year",e),"SalesWithTax")))}}function gu(i,s){if(i&1&&(n(0,"tr",23)(1,"td"),p(2),d(3,"Month"),a(),G(4,_u,10,20,null,null,Y),n(6,"td",26),d(7,"sum"),d(8,"sum"),p(9),d(10,"sum"),d(11,"number"),a(),n(12,"td",26),d(13,"sum"),d(14,"sum"),p(15),d(16,"sum"),d(17,"number"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(g(3,5,e.Month)),o(2),H(r.data.HeaderList),o(2),c("ngClass",fe(29,el,v(7,7,r.filterSales(e.Difference,"Month",e.Month),"Difference")>0,v(8,10,r.filterSales(e.Difference,"Month",e.Month),"Difference")<0)),o(3),D(" ",g(11,16,v(10,13,r.filterSales(e.Difference,"Month",e.Month),"Difference"))," "),o(3),c("ngClass",fe(32,el,v(13,18,r.filterSales(e.Difference,"Month",e.Month),"Percentage")>0,v(14,21,r.filterSales(e.Difference,"Month",e.Month),"Percentage")<0)),o(3),D(" ",g(17,27,v(16,24,r.filterSales(e.Difference,"Month",e.Month),"Percentage"))," ")}}function Cu(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(4,7,v(3,4,r.filterSales(v(2,1,r.data.Data,"Sales"),"Year",e),"Sales")))}}function fu(i,s){if(i&1&&(n(0,"td",30),p(1),d(2,"GetChildrenArray"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(4,7,v(3,4,r.filterSales(v(2,1,r.data.Data,"Sales"),"Year",e),"Tax")))}}function xu(i,s){if(i&1&&(S(0,Cu,5,9,"td",29),d(1,"GetChildrenArray"),d(2,"sum"),S(3,fu,5,9,"td",30),d(4,"GetChildrenArray"),d(5,"sum"),n(6,"td",29),p(7),d(8,"GetChildrenArray"),d(9,"sum"),d(10,"amountFraction"),a()),i&2){let e=s.$implicit,r=m(2);y(v(2,6,r.filterSales(v(1,3,r.data.Data,"Sales"),"Year",e),"Tax")!=0?0:-1),o(3),y(v(5,12,r.filterSales(v(4,9,r.data.Data,"Sales"),"Year",e),"Tax")!=0?3:-1),o(4),D(" ",g(10,21,v(9,18,r.filterSales(v(8,15,r.data.Data,"Sales"),"Year",e),"SalesWithTax")))}}function hu(i,s){if(i&1&&(n(0,"div",5)(1,"table",18)(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Month"),a(),G(6,pu,4,8,"th",21,Y),n(8,"th",22),p(9,"Diff"),a(),n(10,"th",22),p(11,"%"),a()(),n(12,"tr"),G(13,cu,8,14,null,null,Y),a()(),n(15,"tbody"),G(16,gu,18,35,"tr",23,Y),a(),n(18,"tfoot",24)(19,"tr")(20,"td",25),p(21,"Total :"),a(),G(22,xu,11,23,null,null,Y),n(24,"td",26),p(25),d(26,"number"),a()()()()()),i&2){let e=m();o(6),H(e.data.HeaderList),o(7),H(e.data.HeaderList),o(3),H(e.data.Data),o(6),H(e.data.HeaderList),o(2),c("ngClass",fe(4,ou,e.data.TotalDiff>0,e.data.TotalDiff<0)),o(),D(" ",g(26,2,e.data.TotalDiff))}}var sa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/YearlySalesList","ReportLoader/YearlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}subheader=["Sales","Tax","Sales+Tax"];prop=["Sales","Tax","SalesWithTax"];Years=V.GenerateYears(new Date().getFullYear(),11,!0);filterSales(e,r,t){return e.filter(function(l){return l[r]==t})}openExportModal(){this.matDialog.open(K,{data:{title:"Yearly",exportTypes:[{ID:"ReportExport/YearlySalesList",Value:"Default",FileName:"Yearly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-yearly"]],standalone:!1,features:[W],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[1,"row"],[1,"col-6"],["appendTo","body","placeholder","Choose Year From",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Year To",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["rowspan","2"],[1,"text-center","border-start","border-end",3,"colSpan"],["rowspan","2",1,"text-end"],[1,"border-bottom"],[1,"table-footer"],[1,"fw-bold","text-success"],[1,"text-end",3,"ngClass"],[1,"text-end","border-start"],[1,"text-end"],[1,"text-end","text-success"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,ru,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,lu,23,15,"ng-template",null,0,O),a(),n(9,"content"),S(10,hu,27,7,"div",5),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,au)),o(7),y(t.data?10:-1))},dependencies:[A,tt,Q,$,L,R,ie,Ce,U,ze,se,Ln,fr,re,Z],encapsulation:2})};var Su=()=>["/menu/Reports/Sales_Report/Standard/Daily"],yo=(i,s)=>({From:i,To:s}),yu=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"],Du=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"],tl=i=>({"is-weekend":i});function vu(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function wu(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",12),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",14),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Currency"),a(),n(18,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(19,"h6"),p(20,"Sales Order Tag"),a(),n(21,"ng-select",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate),o(3),C("ngModel",e.pageData.Filter.DeliveryID),c("items",e.pageData.Options==null?null:e.pageData.Options.Deliveries),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function Tu(i,s){i&1&&(n(0,"th",26),p(1," Tax "),a())}function Pu(i,s){i&1&&(n(0,"th",27),p(1,"Net Sales + Tax"),a())}function Fu(i,s){i&1&&(n(0,"th",28),p(1,"Cost"),a())}function Iu(i,s){i&1&&(n(0,"th",29),p(1," Profit "),a())}function bu(i,s){i&1&&(n(0,"th",30),p(1," Profit + Tax Include "),a())}function Eu(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Tax))}}function Mu(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D("",g(2,1,e.SalesNetWithTax)," ")}}function Vu(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost))}}function Bu(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit))}}function Ou(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.ProfitWithTax>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.ProfitWithTax))}}function Lu(i,s){if(i&1&&(n(0,"tr",31)(1,"td",31),p(2),d(3,"date"),a(),n(4,"td"),p(5),d(6,"date"),a(),n(7,"td",33),p(8),d(9,"number"),a(),n(10,"td",33),p(11),d(12,"quantityFraction"),a(),n(13,"td",33),p(14),d(15,"amountFraction"),a(),n(16,"td",33),p(17),d(18,"amountFraction"),a(),S(19,Eu,3,3,"td",37),S(20,Mu,3,3,"td",33),S(21,Vu,3,3,"td",34),S(22,Bu,3,4,"td",36),S(23,Ou,3,4,"td",36),a()),i&2){let e=s.$implicit,r=m(2);c("ngClass",X(27,tl,r.data.DayOfWeekend)),o(),c("ngClass",X(29,tl,e.DayOfWeekend)),o(),D(" ",v(3,13,e.Day,"EEEE")," "),o(3),F(v(6,16,e.Day,"dd")),o(3),F(g(9,19,e.Count)),o(3),F(g(12,21,e.Quantity)),o(3),F(g(15,23,e.Gross)),o(3),F(g(18,25,e.SalesNet)),o(2),y(r.data.ShowTax?19:-1),o(),y(r.data.ShowTax?20:-1),o(),y(r.roleService.product.Cost?21:-1),o(),y(r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost?22:-1),o(),y(!r.pageData.Config.IgnoreTax&&r.roleService.report.Profit&&r.roleService.product.Cost?23:-1)}}function Ru(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax")))}}function ku(i,s){if(i&1&&(n(0,"td",33),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"SalesNetWithTax")))}}function Wu(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost")))}}function Nu(i,s){if(i&1&&(n(0,"td",35),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",v(1,2,e.data.Data,"Profit")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.data.Data,"Profit")))}}function Au(i,s){if(i&1&&(n(0,"td",36),d(1,"sum"),p(2),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",v(1,2,e.data.Data,"ProfitWithTax")>=0?"text-success":"text-danger"),o(2),D(" ",g(4,8,v(3,5,e.data.Data,"ProfitWithTax")))}}function Gu(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Day"),a(),n(6,"th",21),p(7,"Dt."),a(),n(8,"th",22),p(9,"Orders "),a(),n(10,"th",23),p(11," Quantity"),a(),n(12,"th",24),p(13," Gross"),a(),n(14,"th",25),p(15," Net Sales"),a(),S(16,Tu,2,0,"th",26),S(17,Pu,2,0,"th",27),S(18,Fu,2,0,"th",28),S(19,Iu,2,0,"th",29),S(20,bu,2,0,"th",30),a()(),n(21,"tbody"),G(22,Lu,24,31,"tr",31,Y),a(),n(24,"tfoot")(25,"tr"),b(26,"td",32)(27,"td",32),n(28,"td",33),p(29),d(30,"sum"),d(31,"number"),a(),n(32,"td",33),p(33),d(34,"sum"),d(35,"quantityFraction"),a(),n(36,"td",33),p(37),d(38,"sum"),d(39,"amountFraction"),a(),n(40,"td",33),p(41),d(42,"sum"),d(43,"amountFraction"),a(),S(44,Ru,4,6,"td",33),S(45,ku,4,6,"td",33),S(46,Wu,4,6,"td",34),S(47,Nu,5,10,"td",35),S(48,Au,5,10,"td",36),a()()()()}if(i&2){let e=m();o(16),y(e.data.ShowTax?16:-1),o(),y(e.data.ShowTax?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?19:-1),o(),y(!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?20:-1),o(2),H(e.data.Data),o(7),F(g(31,17,v(30,14,e.data.Data,"Count"))),o(4),F(g(35,22,v(34,19,e.data.Data,"Quantity"))),o(4),F(g(39,27,v(38,24,e.data.Data,"Gross"))),o(4),F(g(43,32,v(42,29,e.data.Data,"SalesNet"))),o(3),y(e.data.ShowTax?44:-1),o(),y(e.data.ShowTax?45:-1),o(),y(e.roleService.product.Cost?46:-1),o(),y(e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?47:-1),o(),y(!e.pageData.Config.IgnoreTax&&e.roleService.report.Profit&&e.roleService.product.Cost?48:-1)}}var ca=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/DailySalesList","ReportLoader/DailyReportSales",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.activatedRoute=T}maxFilterDate=new Date;originalData;hideMore=!0;postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data}preInitList(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";return this.compare(t[e.active],l[e.active],h)})}onFilterDateChange(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to}openExportModal(){this.matDialog.open(K,{data:{title:"Daily Sales Report",exportTypes:[{ID:"ReportExport/DailySalesExport",Value:"Default",FileName:"Daily Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily"]],standalone:!1,features:[W],decls:21,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to","maxDate"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["id","tableGrid","api","Report/DailySalesList","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Day",2,"width","90px"],["mat-sort-header","Date",1,"align-left",2,"width","42px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Gross","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNetWithTax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","ProfitWithTax","arrowPosition","before",1,"flex-right",2,"width","160px"],[3,"ngClass"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-danger",3,"ngClass"],[1,"text-end",3,"ngClass"],[1,"text-end","text-warning-emphasis"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,vu,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Sales Chart "),a()(),n(10,"li")(11,"a",6),p(12," Daily Quantity Sold "),a()(),n(13,"li")(14,"a",6),p(15," Monthly Quantity Sold "),a()()()()(),n(16,"filters"),E(17,wu,22,16,"ng-template",null,0,O),a(),n(19,"content"),S(20,Gu,49,34,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(12,Su))("queryParams",fe(13,yo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(16,yu))("queryParams",fe(17,yo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(20,Du))("queryParams",fe(21,yo,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(6),y(t.data?20:-1))},dependencies:[A,tt,Q,$,L,R,pe,ge,Gt,Ce,U,ze,se,re,oe,Z,ne],encapsulation:2})};var Hu=()=>["/menu/Reports/Sales_Report/Standard/Monthly"];function Qu(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function Yu(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",10),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Person"),a(),n(9,"sales-person-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Year"),a(),n(12,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(13,"h6"),p(14,"Multiply Unit Qty"),a(),n(15,"radio-options",13),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("model",e.pageData.Filter.MultiplyUnitQuantity)}}function ju(i,s){i&1&&(n(0,"th",19),p(1," Cost "),a())}function qu(i,s){i&1&&(n(0,"th",19),p(1," Profit "),a())}function Uu(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function zu(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Profit)," ")}}function Ku(i,s){if(i&1&&(n(0,"tr",28)(1,"td"),p(2),d(3,"Month"),a(),n(4,"td",23),p(5),d(6,"number"),a(),n(7,"td",23),p(8),d(9,"quantityFraction"),a(),E(10,Uu,3,3,"td",24),n(11,"td",23),p(12),d(13,"amountFraction"),a(),n(14,"td",23),p(15),d(16,"amountFraction"),a(),n(17,"td",25),p(18),d(19,"amountFraction"),a(),n(20,"td",26),p(21),d(22,"amountFraction"),a(),E(23,zu,3,3,"td",27),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(g(3,9,e.Month)),o(3),F(g(6,11,e.Count)),o(3),D(" ",g(9,13,e.Quantity)," "),o(2),c("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit),o(2),D(" ",g(13,15,e.Gross)," "),o(3),D(" ",g(16,17,e.Sales)," "),o(3),D(" ",g(19,19,e.Tax)," "),o(3),F(g(22,21,e.SalesNetWithTax)),o(2),c("ngIf",r.roleService.product.Cost&&r.roleService.report.Profit)}}function Xu(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function Ju(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Profit"))," ")}}function Zu(i,s){if(i&1&&(n(0,"div",14)(1,"table",15)(2,"thead",16)(3,"tr")(4,"th",17),p(5,"Month"),a(),n(6,"th",18),p(7,"Orders"),a(),n(8,"th",19),p(9,"Quantity"),a(),E(10,ju,2,0,"th",20),n(11,"th",19),p(12,"Gross"),a(),n(13,"th",19),p(14,"Sales"),a(),n(15,"th",19),p(16,"Tax"),a(),n(17,"th",19),p(18,"Sales + Tax"),a(),E(19,qu,2,0,"th",20),a()(),n(20,"tbody"),E(21,Ku,24,23,"tr",21),a(),n(22,"tfoot")(23,"tr",22),b(24,"td"),n(25,"td",23),p(26),d(27,"sum"),d(28,"number"),a(),n(29,"td",23),p(30),d(31,"sum"),d(32,"quantityFraction"),a(),E(33,Xu,4,6,"td",24),n(34,"td",23),p(35),d(36,"sum"),d(37,"amountFraction"),a(),n(38,"td",23),p(39),d(40,"sum"),d(41,"amountFraction"),a(),n(42,"td",25),p(43),d(44,"sum"),d(45,"amountFraction"),a(),n(46,"td",26),p(47),d(48,"sum"),d(49,"amountFraction"),a(),E(50,Ju,4,6,"td",27),a()()()()),i&2){let e=m();o(10),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(9),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),c("ngForOf",e.data.Data),o(5),D(" ",g(28,14,v(27,11,e.data.Data,"Count"))," "),o(4),D(" ",g(32,19,v(31,16,e.data.Data,"Quantity"))," "),o(3),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit),o(2),D(" ",g(37,24,v(36,21,e.data.Data,"Gross"))," "),o(4),D(" ",g(41,29,v(40,26,e.data.Data,"Sales"))," "),o(4),D(" ",g(45,34,v(44,31,e.data.Data,"Tax"))," "),o(4),D(" ",g(49,39,v(48,36,e.data.Data,"SalesNetWithTax"))," "),o(3),c("ngIf",e.roleService.product.Cost&&e.roleService.report.Profit)}}var da=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/MonthlySalesList","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}Years=V.GenerateYears(new Date().getFullYear(),11,!0);preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}postInit(){this.menuData.H=this.data.PageTitle}openExportModal(){this.matDialog.open(K,{data:{title:"Monthly",exportTypes:[{ID:"ReportExport/MonthlySalesList",Value:"Default",FileName:"Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly"]],standalone:!1,features:[W],decls:11,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["name","Inventory",3,"modelChange","model"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","90px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],[1,"text-end","text-warning-emphasis"],[1,"text-end"],["class","text-end text-success",4,"ngIf"],[1,"border-bottom"],[1,"text-end","text-danger"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Qu,3,0,"a",2),n(3,"a",3),b(4,"i",4),p(5," Chart View"),a()(),n(6,"filters"),E(7,Yu,16,10,"ng-template",null,0,O),a(),n(9,"content"),E(10,Zu,51,41,"div",5),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,Hu)),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,L,R,ie,Te,Ce,U,ze,se,Ln,re,Z,ne],encapsulation:2})};var $u=()=>["/menu/Reports/Sales_Report/Standard/Daily"],il=(i,s)=>({From:i,To:s}),e_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],t_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"];function i_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onFilterDateChange(t))}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To)("maxDate",e.maxFilterDate)("minDate",e.minFilterDate)}}function n_(i,s){if(i&1&&(n(0,"content")(1,"div",12),b(2,"POS-line-chart",13),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var ua=class i extends me{constructor(e,r,t,l){super(e,r,"Report/DailySalesVolume","ReportLoader/DailyReportSales",null,l);this.httpService=r;this.csvConverter=t;this.initValidateFilterDate()}maxFilterDate;minFilterDate;Years=V.GenerateYears(new Date().getFullYear(),11,!0);chartConfig;currency=-1;Months=V.Months;ChartData={};initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=V.getDaysBefore(new Date,45)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.getQueryParams(),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs);let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}getQueryParams(){let e=this.route.snapshot.queryParams;e.From&&(this.pageData.Filter.From=e.From,this.pageData.Filter.To=e.To)}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){this.menuData.H=this.data.PageTitle,this.initChart()}initChart(){this.ChartData={series:this.data.Series},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},yAxis:{title:{text:""}},xAxis:{categories:this.generateChartCategories()},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}generateChartCategories(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return V.getDatesInRange(e,r).map(h=>`${h.getDate()} ${V.Months[h.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(e){this.pageData.Filter.From=e.from?.toISOString(),this.pageData.Filter.To=e.to?.toISOString()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-volume"]],standalone:!1,features:[W],decls:19,vars:19,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink","queryParams"],[1,"dropdown-item",3,"routerLink"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"dateChange","from","to","maxDate","minDate"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",6),p(14," Monthly Quantity Sold "),a()()()()(),n(15,"filters"),E(16,i_,13,12,"ng-template",null,0,O),a(),S(18,n_,3,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(7),c("routerLink",M(10,$u))("queryParams",fe(11,il,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(14,e_))("queryParams",fe(15,il,t.pageData.Filter==null?null:t.pageData.Filter.From,t.pageData.Filter==null?null:t.pageData.Filter.To)),o(3),c("routerLink",M(18,t_)),o(5),y(t.data?18:-1))},dependencies:[A,Q,$,L,R,Mt,Gt,Ce,U],encapsulation:2})};var a_=()=>["/menu/Reports/Sales_Report/Standard/Daily"],o_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"],r_=()=>["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"];function l_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Year"),a(),n(9,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.currency),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function p_(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-line-chart",12),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.ChartData)}}var _a=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthtlySalesVolume","ReportLoader/MonthlySalesVolume");this.httpService=r;this.csvConverter=t}currency=-1;Years=V.GenerateYears(new Date().getFullYear(),11,!0);ChartData={};chartConfig;preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}postInit(){let e=[];this.data.MonthlySalesRank.forEach(r=>{let t=r.Sales.map(h=>parseInt(h)),l={name:r.Name,data:t};e.push(l)}),this.ChartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-volume"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Sales Chart "),a()(),n(9,"li")(10,"a",5),p(11," Table View "),a()(),n(12,"li")(13,"a",5),p(14," Daily Quantity Sold "),a()()()()(),n(15,"filters"),E(16,l_,13,9,"ng-template",null,0,O),a(),n(18,"content"),S(19,p_,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(7),c("routerLink",M(8,a_)),o(3),c("routerLink",M(9,o_)),o(3),c("routerLink",M(10,r_)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,L,R,Mt,Ce,U],encapsulation:2})};var m_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],s_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],c_=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"];function d_(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",8),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",11)(12,"datepicker",12),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function u_(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",13),a()),i&2){let e=m();o(),c("config",e.pieConfig)("data",e.PieData)}}var ga=class i extends me{constructor(e,r){super(e,r,"Report/OutletPerformanceCart","ReportLoader/OutletPerformance");this.httpService=r}PieData={};pieConfig={title:"",dataLabels:!0,labelTooltips:"Sales",height:400,legend:{}};postInit(){this.getPieData(),this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getPieData(){let e=[],r=[];this.data.DataWithoutCategory.length>0&&this.data.DataWithoutCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.data.DataWithCategory.length>0&&this.data.DataWithCategory.forEach(t=>{e.push(t.Outlet);let l={name:t.Outlet,y:t.Sales};r.push(l)}),this.PieData=r}static \u0275fac=function(r){return new(r||i)(w(N),w(k))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-graphic"]],standalone:!1,features:[W],decls:20,vars:11,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Outlet Performance "),a()(),n(9,"li")(10,"a",5),p(11," Compare by Outlet Group "),a()(),n(12,"li")(13,"a",5),p(14," Compare by Month "),a()()()()(),n(15,"filters"),E(16,d_,13,6,"ng-template",null,0,O),a(),n(18,"content"),S(19,u_,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(7),c("routerLink",M(8,m_)),o(3),c("routerLink",M(9,s_)),o(3),c("routerLink",M(10,c_)),o(6),y(t.data?19:-1))},dependencies:[A,Q,$,J,L,R,ii,Ce],encapsulation:2})};var Do=Jt(bi());var __=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"],g_=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],C_=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],f_=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),nl=(i,s,e)=>({ListIDs:i,From:s,To:e}),Li=(i,s)=>({"text-danger":i,"text-success":s}),x_=()=>["/menu/Reports/Sales_Report/Standard/Summary"],al=(i,s)=>({"text-warning":i,"text-success":s,"text-end":!0}),ol=(i,s)=>({"text-success":i,"text-danger":s});function h_(i,s){if(i&1){let e=I();n(0,"a",12),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function S_(i,s){if(i&1){let e=I();n(0,"div",14)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",15),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TagIDs,t)||(l.pageData.Filter.TagIDs=t),_(t)}),a(),n(7,"h6"),p(8,"Outlet Group"),a(),n(9,"POS-outlet-group-tree-select",17),x("selectedOutletGroupIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.OutletGroupID,t)||(l.pageData.Filter.OutletGroupID=t),_(t)}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"datepicker",18),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(14,"div",19)(15,"datepicker",20),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(16,"h6"),p(17,"Brand"),a(),n(18,"ng-select",21),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandIDs,t)||(l.pageData.Filter.BrandIDs=t),_(t)}),a(),n(19,"h6"),p(20,"Product Type"),a(),n(21,"radio-options",22),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a(),n(22,"h6"),p(23," Query Option "),b(24,"i",23),a(),n(25,"ng-select",24),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.QueryOption,t)||(l.pageData.Filter.QueryOption=t),_(t)}),a()()}if(i&2){let e=m();o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("multiple",!0),C("ngModel",e.pageData.Filter.TagIDs),o(3),c("showClear",!0),C("selectedOutletGroupID",e.pageData.Filter.OutletGroupID),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("multiple",!0),C("ngModel",e.pageData.Filter.BrandIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),o(3),C("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes),o(4),c("items",e.pageData.Options==null?null:e.pageData.Options.QueryOptions),C("ngModel",e.pageData.Filter.QueryOption)}}function y_(i,s){i&1&&(n(0,"th",55),p(1," Prev "),a())}function D_(i,s){i&1&&(n(0,"th",56),p(1," Now "),a())}function v_(i,s){i&1&&(n(0,"th",57),p(1," Orders "),a())}function w_(i,s){i&1&&(n(0,"th",58),p(1," Qty "),a())}function T_(i,s){i&1&&(n(0,"th",59),p(1," Gross "),a())}function P_(i,s){i&1&&(n(0,"th",60),p(1," Basket Size "),a())}function F_(i,s){i&1&&(n(0,"th",61),p(1," Sales "),a())}function I_(i,s){i&1&&(n(0,"th",62),p(1," Avg Daily Sales "),a())}function b_(i,s){i&1&&(n(0,"th",63),p(1," Inventory "),a())}function E_(i,s){i&1&&(pt(0),n(1,"th",64),p(2," Target "),a(),mt())}function M_(i,s){i&1&&(n(0,"th",66),p(1," Ach(%) "),a())}function V_(i,s){if(i&1&&(pt(0),E(1,M_,2,0,"th",65),d(2,"HideSumZero"),d(3,"HideSumZero"),mt()),i&2){let e=m(2);o(),c("ngIf",v(2,1,e.data.Data,"AchievementWithTax")||v(3,4,e.data.Data,"Achievement"))}}function B_(i,s){i&1&&(n(0,"th",67),p(1," Daily Target "),a())}function O_(i,s){i&1&&(n(0,"th",68),p(1," Tax "),a())}function L_(i,s){if(i&1&&(n(0,"th",69),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function R_(i,s){i&1&&(n(0,"th",70),p(1,"\xB1 (%)"),a())}function k_(i,s){i&1&&(n(0,"th",71),p(1," Cost "),a())}function W_(i,s){if(i&1&&(n(0,"th",69),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function N_(i,s){i&1&&(n(0,"th",72),p(1," Expense "),a())}function A_(i,s){if(i&1&&(n(0,"td",75),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function G_(i,s){if(i&1&&(n(0,"td",76),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.index;c("ngClass",fe(2,f_,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function H_(i,s){if(i&1&&(n(0,"td",70)(1,"a",77),p(2),d(3,"number"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(5,nl,e.EntityID,r.convertToDateString(r.pageData.Filter.From),r.convertFromDateString(r.pageData.Filter.To))),o(),F(v(3,2,e.Count,"1.0-0"))}}function Q_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Y_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function j_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.BasketSize,"1.0-2")," ")}}function q_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function U_(i,s){if(i&1&&(n(0,"td",70)(1,"div"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.AverageDailySales))}}function z_(i,s){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.InventoryValue))}}function K_(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.RangeSalesTarget)," ")}}function X_(i,s){if(i&1&&(pt(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m(2).$implicit;o(),c("ngClass",fe(4,Li,e.AchievementWithTax<100,e.AchievementWithTax>100)),o(),D(" ",g(3,2,e.AchievementWithTax)," ")}}function J_(i,s){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Li,e.Achievement<100,e.Achievement>100)),o(),D(" ",g(2,2,e.Achievement)," ")}}function Z_(i,s){if(i&1&&(n(0,"td",70),E(1,X_,4,7,"ng-container",78)(2,J_,3,7,"ng-template",null,1,O),a()),i&2){let e=Dt(3),r=m(3);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function $_(i,s){if(i&1&&(n(0,"td",70)(1,"span"),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit;o(2),F(g(3,1,e.SalesTarget))}}function e1(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function t1(i,s){if(i&1&&(n(0,"td",70)(1,"a",81),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(11,x_))("queryParams",_t(12,nl,e.EntityID,v(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),v(3,6,r.pageData.Filter.To,"yyyy-MM-dd"))),o(4),F(g(6,9,e.SalesWithTax))}}function i1(i,s){if(i&1&&(pt(0),p(1),d(2,"number"),mt()),i&2){let e=m(2).$implicit;o(),D(" ",v(2,1,e.Increase,"1.0-0")," ")}}function n1(i,s){if(i&1&&p(0),i&2){let e=m(2).$implicit;D(" ",e.Increase," ")}}function a1(i,s){if(i&1&&(n(0,"td",79),E(1,i1,3,4,"ng-container",78)(2,n1,1,1,"ng-template",null,2,O),a()),i&2){let e=Dt(3),r=m().$implicit;c("ngClass",fe(3,al,r.IsNegative,r.IsPositive)),o(),c("ngIf",r.Increase!=="-")("ngIfElse",e)}}function o1(i,s){if(i&1&&(n(0,"td",82),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function r1(i,s){if(i&1&&(pt(0),n(1,"span",79),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m(2).$implicit;o(),c("ngClass",fe(4,Li,e.ProfitWithTax<0,e.ProfitWithTax>0)),o(),D(" ",g(3,2,e.ProfitWithTax))}}function l1(i,s){if(i&1&&(n(0,"span",79),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Li,e.Profit<0,e.Profit>0)),o(),D(" ",g(2,2,e.Profit))}}function p1(i,s){if(i&1&&(n(0,"td",70),E(1,r1,4,7,"ng-container",78)(2,l1,3,7,"ng-template",null,3,O),a()),i&2){let e=Dt(3),r=m(3);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function m1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Expense)," ")}}function s1(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",48),p(4),a(),E(5,A_,2,1,"td",73)(6,G_,2,5,"td",74)(7,H_,4,9,"td",43)(8,Q_,3,3,"td",43)(9,Y_,3,3,"td",43)(10,j_,3,4,"td",43)(11,q_,3,3,"td",43)(12,U_,4,3,"td",43)(13,z_,4,3,"td",43)(14,K_,3,3,"td",43),pt(15),E(16,Z_,4,2,"td",43),d(17,"HideSumZero"),d(18,"HideSumZero"),mt(),E(19,$_,4,3,"td",43)(20,e1,3,3,"td",51)(21,t1,7,16,"td",43)(22,a1,4,6,"td",53)(23,o1,3,3,"td",54)(24,p1,4,2,"td",43)(25,m1,3,3,"td",43),d(26,"sum"),a()),i&2){let e=s.$implicit,r=s.index,t=m(2);o(2),F(r+1),o(2),F(e.Name),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",t.column.Orders.selected),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.Gross.selected),o(),c("ngIf",t.column.QTY.selected),o(),c("ngIf",t.column.Sales.selected),o(),c("ngIf",t.column.AvgDaily.selected),o(),c("ngIf",t.column.Inventory.selected),o(),c("ngIf",t.column.TargetDaily.selected),o(2),c("ngIf",v(17,20,t.data.Data,"AchievementWithTax")||v(18,23,t.data.Data,"Achievement")),o(3),c("ngIf",t.column.DailyTarget.selected),o(),c("ngIf",t.column.Tax.selected),o(),c("ngIf",t.column.SalesNTax.selected),o(),c("ngIf",t.showCompareColumn),o(),c("ngIf",(t.roleService==null||t.roleService.product==null?null:t.roleService.product.Cost)&&t.column.Cost.selected),o(),c("ngIf",t.roleService.report.Profit&&t.column.Profit.selected),o(),c("ngIf",t.roleService.product.Expense&&t.column.QTY.selected&&v(26,26,t.data.Data,"Expense")!=0)}}function c1(i,s){i&1&&b(0,"td",50)}function d1(i,s){i&1&&b(0,"td",50)}function u1(i,s){if(i&1&&(n(0,"td",70)(1,"a",83),p(2),d(3,"sum"),d(4,"number"),a()()),i&2){let e=m(2);o(2),D(" ",v(4,4,v(3,1,e.data.Data,"Count"),"1.0-0"))}}function _1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function g1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Gross"))," ")}}function C1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"BasketSize")/(e.data==null||e.data.Data==null?null:e.data.Data.length),"1.0-2")," ")}}function f1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Sales"))," ")}}function x1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"AverageDailySales"))," ")}}function h1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"InventoryValue"))," ")}}function S1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"RangeSalesTarget"))," ")}}function y1(i,s){if(i&1&&(pt(0),n(1,"span",79),d(2,"sum"),d(3,"sum"),p(4),d(5,"sum"),d(6,"amountFraction"),a(),mt()),i&2){let e=m(3);o(),c("ngClass",fe(13,Li,v(2,2,e.data.Data,"AchievementWithTax")<100,v(3,5,e.data.Data,"AchievementWithTax")>100)),o(3),D(" ",g(6,11,v(5,8,e.data.Data,"AchievementWithTax")/(e.data==null||e.data.Data==null?null:e.data.Data.length))," ")}}function D1(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(13,Li,v(1,2,e.data.Data,"Achievement")<100,v(2,5,e.data.Data,"Achievement")>100)),o(3),D(" ",g(5,11,v(4,8,e.data.Data,"Achievement")/(e.data==null||e.data.Data==null?null:e.data.Data.length)))}}function v1(i,s){if(i&1&&(n(0,"td",70),E(1,y1,7,16,"ng-container",78)(2,D1,6,16,"ng-template",null,4,O),a()),i&2){let e=Dt(3),r=m(2);o(),c("ngIf",!r.pageData.IgnoreTax)("ngIfElse",e)}}function w1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"SalesTarget"))," ")}}function T1(i,s){if(i&1&&(n(0,"td",80),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function P1(i,s){if(i&1&&(n(0,"td",84)(1,"a",85),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function F1(i,s){if(i&1&&(n(0,"td",79),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",fe(5,al,e.comparation<0,e.comparation>0)),o(),D(" ",v(2,2,e.comparation,"1.0-0")," ")}}function I1(i,s){if(i&1&&(n(0,"td",82),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function b1(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(13,ol,v(1,2,e.data.Data,"Profit")>0,v(2,5,e.data.Data,"Profit")<0)),o(3),F(g(5,11,v(4,8,e.data.Data,"Profit")))}}function E1(i,s){if(i&1&&(n(0,"span",79),d(1,"sum"),d(2,"sum"),p(3),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(13,ol,v(1,2,e.data.Data,"ProfitWithTax")>0,v(2,5,e.data.Data,"ProfitWithTax")<0)),o(3),D("",g(5,11,v(4,8,e.data.Data,"ProfitWithTax"))," ")}}function M1(i,s){if(i&1&&(n(0,"td",70),E(1,b1,6,16,"span",53)(2,E1,6,16,"span",53),a()),i&2){let e=m(2);o(),c("ngIf",e.pageData.IgnoreTax),o(),c("ngIf",!e.pageData.IgnoreTax)}}function V1(i,s){if(i&1&&(n(0,"td",70),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Expense"))," ")}}function B1(i,s){if(i&1){let e=I();n(0,"div",25)(1,"table",26),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",27)(3,"tr")(4,"th",28),p(5,"No"),a(),n(6,"th",29),p(7," Outlet "),a(),E(8,y_,2,0,"th",30)(9,D_,2,0,"th",31)(10,v_,2,0,"th",32)(11,w_,2,0,"th",33)(12,T_,2,0,"th",34)(13,P_,2,0,"th",35)(14,F_,2,0,"th",36)(15,I_,2,0,"th",37)(16,b_,2,0,"th",38)(17,E_,3,0,"ng-container",39)(18,V_,4,7,"ng-container",39)(19,B_,2,0,"th",40)(20,O_,2,0,"th",41)(21,L_,2,1,"th",42)(22,R_,2,0,"th",43)(23,k_,2,0,"th",44)(24,W_,2,1,"th",42)(25,N_,2,0,"th",45),d(26,"sum"),a()(),n(27,"tbody"),E(28,s1,27,29,"tr",46),a(),n(29,"tfoot")(30,"tr",47),b(31,"td",48),E(32,c1,1,0,"td",49)(33,d1,1,0,"td",49),b(34,"td",50),E(35,u1,5,7,"td",43)(36,_1,4,6,"td",43)(37,g1,4,6,"td",43)(38,C1,4,7,"td",43)(39,f1,4,6,"td",43)(40,x1,4,6,"td",43)(41,h1,4,6,"td",43)(42,S1,4,6,"td",43),pt(43),E(44,v1,4,2,"td",43),d(45,"HideSumZero"),d(46,"HideSumZero"),mt(),E(47,w1,4,6,"td",43)(48,T1,4,6,"td",51)(49,P1,5,6,"td",52)(50,F1,3,8,"td",53)(51,I1,4,6,"td",54)(52,M1,3,2,"td",43)(53,V1,4,6,"td",43),d(54,"sum"),a()()()()}if(i&2){let e=m();o(8),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.column.Orders.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.column.AvgDaily.selected),o(),c("ngIf",e.column.Inventory.selected),o(),c("ngIf",e.column.TargetDaily.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.DailyTarget.selected),o(),c("ngIf",e.column.Tax.selected),o(),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&v(26,37,e.data.Data,"Expense")!=0),o(3),c("ngForOf",e.data.Data),o(4),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.showCompareColumn),o(2),c("ngIf",e.column.Orders.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Gross.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Sales.selected),o(),c("ngIf",e.column.AvgDaily.selected),o(),c("ngIf",e.column.Inventory.selected),o(),c("ngIf",e.column.TargetDaily.selected),o(2),c("ngIf",v(45,40,e.data.Data,"AchievementWithTax")||v(46,43,e.data.Data,"Achievement")),o(3),c("ngIf",e.column.DailyTarget.selected),o(),c("ngIf",e.column.Tax.selected),o(),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.showCompareColumn),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.roleService.product.Expense&&e.column.QTY.selected&&v(54,46,e.data.Data,"Expense")!=0)}}var Ca=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/OutletPerformanceDetail","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.matDialog=l;this.datePipe=h}roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Quantity",responseProperty:"Quantity"},Gross:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_Gross",responseProperty:"Gross"},Sales:{selected:!0},AvgDaily:{selected:!1,name:"Avg Daily Sales"},Inventory:{selected:!1,advanced:!0,endpoint:"/api/Report/OutletPerformanceDetail_Item_InventoryValue",responseProperty:"InventoryValue"},TargetDaily:{selected:!1,name:"Target"},DailyTarget:{selected:!1,name:"Daily Target"},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:this.roleService.product.Cost,role:this.roleService.product.Cost},Profit:{selected:this.roleService.report.Profit&&this.roleService.product.Cost,role:this.roleService.report.Profit&&this.roleService.product.Cost}};isCompare=!1;showCompareColumn=!1;totalDays=1;selectetOutletGroup;isShowOutletTarget=!0;postInit(e){this.menuData.H=e.PageTitle;var r=new Date(this.pageData.Filter.To),t=new Date(this.pageData.Filter.From);this.totalDays=V.differentInDays(t,r)+1,this.initShowSalesTarget(),this.checkForAdvancedColumn(),this.onCompareData(),this.data.Data=this.data.Data.map(l=>(l.AverageDailySales=l.Sales/this.totalDays,l.BasketSize=l.Quantity/l.Count,l.Achievement=this.calculateAchievement(l.SalesTarget,l.Sales,this.totalDays),l.AchievementWithTax=this.calculateAchievement(l.SalesTarget,l.SalesWithTax,this.totalDays),l)),this.hideTaxRelatedColumn(e.Data)}hideTaxRelatedColumn(e){e.map(t=>t.Tax).reduce((t,l)=>t+l,0)==0&&(this.column.Tax.selected=!1,this.column.SalesNTax.selected=!1)}calculateAchievement(e=0,r=0,t=1){let l=0;return e!=0&&r!=0&&(l=r/(e*t)*100),l}initShowSalesTarget(){let e=this.data.Data.reduce((r,t)=>r+t.SalesTarget,0);this.isShowOutletTarget=e>0}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}preInitList(){this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Count":return this.compare(t.Count,l.Count,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Gross":return this.compare(t.Gross,l.Gross,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,h);case"Expense":return this.compare(t.Expense,l.Expense,h);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,h);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,h);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,h);case"Achievement":return this.compare(t.Achievement,l.Achievement,h);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,h);case"AverageDailySales":return this.compare(t.AverageDailySales,l.AverageDailySales,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Performance Detail",exportTypes:[{ID:"ReportExport/OutletPerformanceDefault",Value:"Default",FileName:"Outlet Performance"},{ID:"ReportExport/OutletPerformanceDetail",Value:"Detail",FileName:"Outlet Performance Detail "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}onSelectOutletGroup(e){this.pageData.Filter.OutletGroupID=e?.id,this.selectetOutletGroup=e}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data.map(e=>{let r=e;return r.ID=e.EntityID,r}),this.pageData.Filter,"ID",()=>{this.data.Data=this.data.Data.map(e=>(e.AverageDailySales=e.Sales/this.totalDays,e.BasketSize=e.Quantity/e.Count,e.Achievement=this.calculateAchievement(e.SalesTarget,e.Sales,this.totalDays),e.AchievementWithTax=this.calculateAchievement(e.SalesTarget,e.SalesWithTax,this.totalDays),e))})}get entityIDs(){return this.data&&Object.prototype.hasOwnProperty.call(this.data,"Data")&&this.data.Data.length>0?this.data.Data.map(e=>e.EntityID).join(","):null}convertToDateString(e){return(0,Do.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}convertFromDateString(e){return(0,Do.default)(e).format("YYYY-MM-DDTHH:mm:ss.SSS")}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(oe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-detail-outlet-performance"]],standalone:!1,features:[W],decls:21,vars:13,consts:[["pageFilterTemplate",""],["IGNORE_TAX_ITEM",""],["INCREASE",""],["IGNORE_PROFIT_TAX",""],["IGNORE_TAX",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Category",1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","items","multiple","ngModel"],[1,"tree-select-as-filter",3,"selectedOutletGroupIDChange","showClear","selectedOutletGroupID"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["name","render-ProductType",3,"modelChange","model","options"],["title","When your query is performing poorly choose Recompile",1,"fa","fa-circle-info",2,"cursor","pointer"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["mat-sort-header","Name",1,"align-left","freeze","header"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",4,"ngIf"],["style","width: 35px","matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Gross","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","AverageDailySales","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",4,"ngIf"],[4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","arrowPosition","before","class","text-end",4,"ngIf"],["arrowPosition","before","class","text-end",3,"mat-sort-header",4,"ngIf"],["class","text-end",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Expense","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end text-warning-emphasis",4,"ngIf"],["class","text-end text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end"],["mat-sort-header","AverageDailySales","arrowPosition","before",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before","matTooltip","Outlet inventory value when sold","matTooltipPosition","above",1,"text-end"],["matTooltip","Daily Target * Number of Days","matTooltipPosition","above","mat-sort-header","Target","arrowPosition","before",1,"text-end"],["mat-sort-header","Achievement","arrowPosition","before","class","text-end","matTooltipPosition","above","matTooltip","Achievement",4,"ngIf"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"text-end"],["mat-sort-header","SalesTarget","arrowPosition","before",1,"text-end"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end"],["arrowPosition","before",1,"text-end",3,"mat-sort-header"],[1,"text-end"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end"],["mat-sort-header","Expense","arrowPosition","before",1,"text-end"],["style","width: 35px; text-align: center",4,"ngIf"],["style","width: 35px; text-align: center",3,"ngClass",4,"ngIf"],[2,"width","35px","text-align","center"],[2,"width","35px","text-align","center",3,"ngClass"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary",3,"queryParams"],[4,"ngIf","ngIfElse"],[3,"ngClass"],[1,"text-end","text-warning-emphasis"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],["routerLink","/menu/Reports/Sales_Report/Standard/Summary","target","_blank"],[1,"text-end","text-primary"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",5),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,h_,3,0,"a",6),n(3,"div",7)(4,"button",8),p(5," More "),a(),n(6,"ul",9)(7,"li")(8,"a",10),p(9," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",10),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",10),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,S_,26,16,"ng-template",null,0,O),a(),n(19,"content"),E(20,B1,55,49,"div",11),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(10,__)),o(3),c("routerLink",M(11,g_)),o(3),c("routerLink",M(12,C_)),o(6),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,L,R,ie,pe,ge,Te,Ce,Vi,se,ei,re,oe,Z,ne],styles:["table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{width:0!important}"]})};var O1=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance"],L1=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],R1=()=>["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"],k1=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),rl=(i,s)=>({"text-danger":i,"text-success":s,"text-end":!0});function W1(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function N1(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(5,"div",12)(6,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(10,"h6"),p(11,"Compare with Prev Month"),a(),n(12,"radio-options",15),x("modelChange",function(t){u(e);let l=m();return f(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=m();o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),C("model",e.isCompare)}}function A1(i,s){i&1&&(n(0,"th",19),p(1," Prev "),a())}function G1(i,s){i&1&&(n(0,"th",20),p(1," Now "),a())}function H1(i,s){i&1&&(n(0,"th",27),p(1," \xB1 (%) "),a())}function Q1(i,s){i&1&&(n(0,"th",28),p(1," Cost "),a())}function Y1(i,s){if(i&1&&(n(0,"th",25),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function j1(i,s){if(i&1&&(n(0,"td",31),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function q1(i,s){if(i&1&&(n(0,"td",37),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,k1,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function U1(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,rl,e.IsNegative,e.IsPositive)),o(),D(" ",g(2,2,e.Increase)," ")}}function z1(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function K1(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function X1(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,j1,2,1,"td",31),S(4,q1,2,5,"td",37),n(5,"td",31),p(6),d(7,"number"),a(),n(8,"td",31),p(9),d(10,"quantityFraction"),a(),n(11,"td",31),p(12),d(13,"amountFraction"),a(),n(14,"td",31),p(15),d(16,"amountFraction"),a(),n(17,"td",32),p(18),d(19,"amountFraction"),a(),n(20,"td",33),p(21),d(22,"amountFraction"),a(),S(23,U1,3,7,"td",34),S(24,z1,3,3,"td",35),S(25,K1,3,3,"td",36),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(2),F(v(7,12,e.Count,".0-0")),o(3),F(g(10,15,e.Quantity)),o(3),F(g(13,17,e.Gross)),o(3),F(g(16,19,e.SalesNet)),o(3),D(" ",g(19,21,e.Tax)," "),o(3),D(" ",g(22,23,e.SalesWithTax)," "),o(2),y(r.showCompareColumn&&r.roleService.report.Profit?23:-1),o(),y(r.roleService.product.Cost?24:-1),o(),y(r.roleService.report.Profit?25:-1)}}function J1(i,s){i&1&&b(0,"td",30)}function Z1(i,s){i&1&&b(0,"td",30)}function $1(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",fe(5,rl,e.comparation,e.comparation)),o(),D(" ",v(2,2,e.comparation,".0-0")," ")}}function eg(i,s){if(i&1&&(n(0,"td",35),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data==null?null:e.data.Data,"Cost"))," ")}}function tg(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"sum"),d(3,"amountFraction"),d(4,"sum"),d(5,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",e.pageData.IgnoreTax?g(3,4,v(2,1,e.data==null?null:e.data.Data,"Profit")):g(5,9,v(4,6,e.data==null?null:e.data.Data,"ProfitWithTax"))," ")}}function ig(i,s){if(i&1){let e=I();n(0,"div",7)(1,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",17)(3,"tr")(4,"th",18),p(5,"Outlet"),a(),S(6,A1,2,0,"th",19),S(7,G1,2,0,"th",20),n(8,"th",21),p(9," Orders "),a(),n(10,"th",22),p(11," Quantity "),a(),n(12,"th",23),p(13," Gross "),a(),n(14,"th",24),p(15," Sales "),a(),n(16,"th",25),p(17," Tax "),a(),n(18,"th",26),p(19," Sales + Tax "),a(),S(20,H1,2,0,"th",27),S(21,Q1,2,0,"th",28),S(22,Y1,2,1,"th",25),a()(),n(23,"tbody"),G(24,X1,26,25,"tr",null,Y),a(),n(26,"tfoot")(27,"tr",29),S(28,J1,1,0,"td",30),S(29,Z1,1,0,"td",30),b(30,"td",30),n(31,"td",31),p(32),d(33,"sum"),d(34,"number"),a(),n(35,"td",31),p(36),d(37,"sum"),d(38,"quantityFraction"),a(),n(39,"td",31),p(40),d(41,"sum"),d(42,"amountFraction"),a(),n(43,"td",31),p(44),d(45,"sum"),d(46,"amountFraction"),a(),n(47,"td",32),p(48),d(49,"sum"),d(50,"amountFraction"),a(),n(51,"td",33)(52,"a"),p(53),d(54,"sum"),d(55,"amountFraction"),a()(),S(56,$1,3,8,"td",34),S(57,eg,4,6,"td",35),S(58,tg,6,11,"td",36),a()()()()}if(i&2){let e=m();o(6),y(e.showCompareColumn?6:-1),o(),y(e.showCompareColumn?7:-1),o(9),c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesTaxNet"),o(2),c("altpropcond",Ct(e.pageData.IgnoreTax)),o(2),y(e.showCompareColumn&&e.roleService.report.Profit?20:-1),o(),y(e.roleService.product.Cost?21:-1),o(),y(e.roleService.report.Profit?22:-1),o(2),H(e.data==null?null:e.data.Data),o(4),y(e.showCompareColumn?28:-1),o(),y(e.showCompareColumn?29:-1),o(3),D(" ",v(34,22,v(33,19,e.data==null?null:e.data.Data,"Count"),".0-0")," "),o(4),D(" ",g(38,28,v(37,25,e.data==null?null:e.data.Data,"Quantity"))," "),o(4),D(" ",g(42,33,v(41,30,e.data==null?null:e.data.Data,"Gross"))," "),o(4),D(" ",g(46,38,v(45,35,e.data==null?null:e.data.Data,"SalesNet"))," "),o(4),D(" ",g(50,43,v(49,40,e.data==null?null:e.data.Data,"Tax"))," "),o(5),F(g(55,48,v(54,45,e.data==null?null:e.data.Data,"SalesWithTax"))),o(3),y(e.showCompareColumn&&e.roleService.report.Profit?56:-1),o(),y(e.roleService.product.Cost?57:-1),o(),y(e.roleService.report.Profit?58:-1)}}var fa=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/OutletGroupPerformance","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}isCompare=!1;showCompareColumn=!1;postInit(e){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Name=t.Name?t.Name:"",l.Name=l.Name?l.Name:"",e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Count":return this.compare(t.Count,l.Count,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Gross":return this.compare(t.Gross,l.Gross,h);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,h);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"SalesTaxNet":return this.compare(t.SalesTaxNet,l.SalesTaxNet,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformance",Value:"Default",FileName:"Outlet Group Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-group-performance"]],standalone:!1,features:[W],decls:21,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Compare",3,"modelChange","model"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","70px"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px"],["arrowPosition","before",1,"text-end",2,"width","120px",3,"mat-sort-header"],["mat-sort-header","SalesWithTax","altprop","SalesNet","arrowPosition","before",1,"text-end",2,"width","120px",3,"altpropcond"],[1,"text-end",2,"width","60px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","100px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-primary"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,W1,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()(),n(13,"li")(14,"a",6),p(15," Pie Chart "),a()()()()(),n(16,"filters"),E(17,N1,13,5,"ng-template",null,0,O),a(),n(19,"content"),S(20,ig,59,50,"div",7),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(9,O1)),o(3),c("routerLink",M(10,L1)),o(3),c("routerLink",M(11,R1)),o(6),y(t.data?20:-1))},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,se,re,Z,ne],encapsulation:2})};var ng=()=>["/menu/Reports/Sales_Report/Standard/Compare"],ag=i=>({"flex-right":i});function og(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function rg(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Sales Person"),a(),n(3,"sales-person-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(4,"h6"),p(5,"Year"),a(),n(6,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function lg(i,s){if(i&1&&(n(0,"th",13),p(1),a()),i&2){let e=s.$implicit,r=s.$index;c("arrowPosition",Ct(r?"before":"after"))("mat-sort-header",e)("ngClass",X(5,ag,e!="Outlet")),o(),D(" ",e)}}function pg(i,s){if(i&1&&(n(0,"div",14),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(r[e])}}function mg(i,s){if(i&1&&(n(0,"div",15),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),D("",g(2,1,r[e])," ")}}function sg(i,s){if(i&1&&(n(0,"td"),S(1,pg,2,1,"div",14),S(2,mg,3,3,"div",15),a()),i&2){let e=s.$implicit;o(),y(e=="Outlet"?1:-1),o(),y(e!="Outlet"?2:-1)}}function cg(i,s){if(i&1&&(n(0,"tr"),G(1,sg,3,2,"td",null,Y),a()),i&2){let e=s.$implicit,r=m(2);o(),H(r.getKeys(e))}}function dg(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),F(g(2,1,e))}}function ug(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",16)(2,"td"),p(3,"Total : "),a(),G(4,dg,3,3,"td",17,Y),a()()),i&2){let e=m(2);o(4),H(e.data.DataFooter)}}function _g(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",11),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",12)(3,"tr"),G(4,lg,2,7,"th",13,Y),a()(),n(6,"tbody"),G(7,cg,3,0,"tr",null,Y),a(),S(9,ug,6,0,"tfoot"),a()()}if(i&2){let e=m();o(4),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?9:-1)}}var xa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/MonthlyOutletPerformance","ReportLoader/MonthlyReportSales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}Years=V.GenerateYears(new Date().getFullYear(),11,!0);getKeys(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 h=e.direction==="asc";for(let T=0;T<this.data.Dataheader.length;T++)if(e.active==this.data.Dataheader[T])return this.compare(t[this.data.Dataheader[T]],l[this.data.Dataheader[T]],h)})}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Monthly Comparison",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformance",Value:"Default",FileName:"Outlet Monthly Comparison"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-outlet-monthly-performance"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],["matTooltipPosition","above","matTooltip","Range Compare",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[3,"ngModelChange","ngModel"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"table-light","sticky-top-thead"],[3,"mat-sort-header","arrowPosition","ngClass"],[2,"color","black"],[2,"color","black","text-align","right"],[1,"table-footer"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,og,3,0,"a",2),n(3,"a",3),p(4," View Range"),a()(),n(5,"filters"),E(6,rg,10,5,"ng-template",null,0,O),a(),n(8,"content"),S(9,_g,10,1,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,ng)),o(6),y(t.data?9:-1))},dependencies:[A,tt,Q,$,L,R,ie,pe,ge,ze,Z],encapsulation:2})};var gg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],Cg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],fg=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],xg=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],hg=(i,s)=>({From:i,To:s}),Sg=()=>["/menu/Contacts/Contact/Sales_Person/Info"],yg=i=>({ID:i}),Dg=()=>["/menu/Reports/Sales_Report/Standard/Detail"],vg=(i,s,e,r,t)=>({SalesPersonID:i,From:s,To:e,ListIDs:r,IncludeComplementary:t}),wg=(i,s,e,r)=>({ID:i,from:s,to:e,IncludeComplementary:r}),Tg=i=>({SalesID:i});function Pg(i,s){if(i&1){let e=I();n(0,"button",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function Fg(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person Group"),a(),n(6,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesGroupID,t)||(l.pageData.Filter.SalesGroupID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",16)(12,"datepicker",17),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Delivery"),a(),n(15,"ng-select",18),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DeliveryID,t)||(l.pageData.Filter.DeliveryID=t),_(t)}),a(),n(16,"h6"),p(17,"Sales Order Tag"),a(),n(18,"ng-select",19),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(19,"h6"),p(20,"Include Zero Amount Transaction"),a(),n(21,"radio-options",20),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.IncludeZeroAmountTransaction,t)||(l.pageData.Filter.IncludeZeroAmountTransaction=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData==null||e.pageData.List==null?null:e.pageData.List.Entities),o(3),C("ngModel",e.pageData.Filter.SalesGroupID),c("items",e.pageData.List==null?null:e.pageData.List.SalesGroup),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.DeliveryID),c("items",e.pageData.List==null?null:e.pageData.List.Deliveries),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.List==null?null:e.pageData.List.Types),o(3),C("model",e.pageData.Filter.IncludeZeroAmountTransaction)}}function Ig(i,s){i&1&&(n(0,"th",45),p(1," Sales Group "),a())}function bg(i,s){i&1&&(n(0,"th",46),p(1," Orders "),a())}function Eg(i,s){i&1&&(n(0,"th",47),p(1," Sales "),a())}function Mg(i,s){i&1&&(pt(0),n(1,"th",48),p(2," Avg. Daily "),a(),mt())}function Vg(i,s){i&1&&(n(0,"th",49),p(1," Tax "),a())}function Bg(i,s){i&1&&(n(0,"th",50),p(1," Sales + Tax "),a())}function Og(i,s){i&1&&(n(0,"th",51),p(1," Cost "),a())}function Lg(i,s){i&1&&(n(0,"th",52),p(1," Profit "),a())}function Rg(i,s){i&1&&(n(0,"th",55),p(1," Target "),a())}function kg(i,s){i&1&&(n(0,"th",56),p(1," Ach(%) "),a())}function Wg(i,s){if(i&1&&(pt(0),E(1,Rg,2,0,"th",53)(2,kg,2,0,"th",54),mt()),i&2){let e=m(2);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function Ng(i,s){i&1&&(n(0,"th",57),p(1," Quantity "),a())}function Ag(i,s){i&1&&(n(0,"th",58),p(1," Basket Size "),a())}function Gg(i,s){i&1&&(n(0,"th",59),p(1," Product Commission "),a())}function Hg(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Group)}}function Qg(i,s){if(i&1&&(n(0,"td",62)(1,"a",61),d(2,"date"),d(3,"date"),p(4),d(5,"number"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(12,Dg))("queryParams",cn(13,vg,e.ID,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.ListIDs,r.pageData.Filter.IncludeComplementary)),o(3),F(v(5,9,e.Orders,".0-0"))}}function Yg(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function jg(i,s){if(i&1&&(pt(0),n(1,"td",63),p(2),d(3,"amountFraction"),a(),mt()),i&2){let e=m().$implicit;o(2),D(" ",g(3,1,e.AvgDailySales)," ")}}function qg(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Ug(i,s){if(i&1&&(n(0,"td",62)(1,"a",65),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",Ut(10,wg,e.ID,v(2,2,r.pageData.Filter.From,"ddMMyyyy"),v(3,5,r.pageData.Filter.To,"ddMMyyyy"),r.pageData.Filter.IncludeComplementary)),o(3),D(" ",g(5,8,e.SalesNTax)," ")}}function zg(i,s){if(i&1&&(n(0,"td",66),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Kg(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Profit)," ")}}function Xg(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e.Target)," ")}}function Jg(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e.Achievement)," ")}}function Zg(i,s){if(i&1&&(pt(0),E(1,Xg,3,3,"td",44)(2,Jg,3,3,"td",44),mt()),i&2){let e=m(3);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function $g(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Quantity,"1.0-2")," ")}}function eC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.BasketSize,"1.0-2")," ")}}function tC(i,s){if(i&1&&(n(0,"td",63)(1,"span")(2,"a",68),p(3),d(4,"amountFraction"),a()()()),i&2){let e=m().$implicit;o(2),c("queryParams",X(4,Tg,e.ID)),o(),F(g(4,2,e.Commission))}}function iC(i,s){if(i&1&&(n(0,"tr")(1,"td",60)(2,"a",61),p(3),a()(),E(4,Hg,2,1,"td",9)(5,Qg,6,19,"td",40)(6,Yg,3,3,"td",41),d(7,"HideSumZero"),E(8,jg,4,3,"ng-container",9)(9,qg,3,3,"td",42),d(10,"HideSumZero"),E(11,Ug,6,15,"td",40)(12,zg,3,3,"td",43)(13,Kg,3,3,"td",44)(14,Zg,3,2,"ng-container",9)(15,$g,3,4,"td",41)(16,eC,3,4,"td",41)(17,tC,5,6,"td",41),a()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(21,Sg))("queryParams",X(22,yg,e.ID)),o(),F(e.Name),o(),c("ngIf",r.data.Show),o(),c("ngIf",r.column.Orders.selected),o(),c("ngIf",v(7,15,r.data.List,"Tax")&&r.column.Sales.selected),o(2),c("ngIf",r.isShowOutletTarget),o(),c("ngIf",v(10,18,r.data.List,"Tax")&&r.column.Tax.selected),o(2),c("ngIf",r.column.SalesNTax.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Cost.selected),o(),c("ngIf",r.roleService.report.Profit&&r.column.Profit.selected),o(),c("ngIf",r.isShowOutletTarget),o(),c("ngIf",r.column.QTY.selected),o(),c("ngIf",r.column.QTY.selected),o(),c("ngIf",r.column.Commission.selected&&r.roleService.product.CommissionView)}}function nC(i,s){i&1&&b(0,"td")}function aC(i,s){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Orders"),".0-0")," ")}}function oC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Sales"))," ")}}function rC(i,s){if(i&1&&(pt(0),n(1,"td",63),p(2),d(3,"sum"),d(4,"amountFraction"),a(),mt()),i&2){let e=m(2);o(2),D(" ",g(4,4,v(3,1,e.data.List,"AvgDailySales"))," ")}}function lC(i,s){if(i&1&&(n(0,"td",64),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Tax"),e.pageData.FractionDigit)," ")}}function pC(i,s){if(i&1&&(n(0,"td",62),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"SalesNTax"))," ")}}function mC(i,s){if(i&1&&(n(0,"td",66),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Cost"))," ")}}function sC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Profit"))," ")}}function cC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.data.List,"Target"))," ")}}function dC(i,s){if(i&1&&(n(0,"td",67),p(1),d(2,"sum"),d(3,"sum"),d(4,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(4,7,v(2,1,e.data.List,"Sales")/v(3,4,e.data.List,"Target")*100)," ")}}function uC(i,s){if(i&1&&(pt(0),E(1,cC,4,6,"td",44)(2,dC,5,9,"td",44),mt()),i&2){let e=m(2);o(),c("ngIf",e.data.ShowSalesTarget),o(),c("ngIf",e.data.ShowSalesTarget)}}function _C(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"Quantity"),"1.0-2")," ")}}function gC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.List,"BasketSize"),"1.0-2")," ")}}function CC(i,s){if(i&1&&(n(0,"td",63),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.List,"Commission"))," ")}}function fC(i,s){if(i&1){let e=I();n(0,"content")(1,"div",21)(2,"div",22)(3,"table",23),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",24)(5,"tr",25)(6,"th",26),p(7,"Sales Person"),a(),E(8,Ig,2,0,"th",27)(9,bg,2,0,"th",28)(10,Eg,2,0,"th",29),d(11,"HideSumZero"),E(12,Mg,3,0,"ng-container",9)(13,Vg,2,0,"th",30),d(14,"HideSumZero"),E(15,Bg,2,0,"th",31)(16,Og,2,0,"th",32)(17,Lg,2,0,"th",33)(18,Wg,3,2,"ng-container",9)(19,Ng,2,0,"th",34)(20,Ag,2,0,"th",35)(21,Gg,2,0,"th",36),a()(),n(22,"tbody"),E(23,iC,18,24,"tr",37),a(),n(24,"tfoot")(25,"tr",38),S(26,nC,1,0,"td"),n(27,"td",39),p(28,"Total:"),a(),E(29,aC,4,7,"td",40)(30,oC,4,6,"td",41),d(31,"HideSumZero"),E(32,rC,5,6,"ng-container",9)(33,lC,4,7,"td",42),d(34,"HideSumZero"),E(35,pC,4,6,"td",40)(36,mC,4,6,"td",43)(37,sC,4,6,"td",44)(38,uC,3,2,"ng-container",9)(39,_C,4,7,"td",41)(40,gC,4,7,"td",41)(41,CC,4,6,"td",41),a()()()()()()}if(i&2){let e=m();o(8),c("ngIf",e.data.Show),o(),c("ngIf",e.column.Orders.selected),o(),c("ngIf",v(11,25,e.data.List,"Tax")&&e.column.Sales.selected),o(2),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",v(14,28,e.data.List,"Tax")&&e.column.Tax.selected),o(2),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.column.Commission.selected),o(2),c("ngForOf",e.data.List),o(3),y(e.data.Show?26:-1),o(3),c("ngIf",e.column.Orders.selected),o(),c("ngIf",v(31,31,e.data.List,"Tax")&&e.column.Sales.selected),o(2),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",v(34,34,e.data.List,"Tax")&&e.column.Tax.selected),o(2),c("ngIf",e.column.SalesNTax.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Cost.selected),o(),c("ngIf",e.roleService.report.Profit&&e.column.Profit.selected),o(),c("ngIf",e.isShowOutletTarget),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.QTY.selected),o(),c("ngIf",e.column.Commission.selected&&e.roleService.product.CommissionView)}}var ha=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/SalesPerson","ReportLoader/SalesPerson");this.httpService=r;this.csvConverter=t;this.reportFilterService=l;this.matDialog=h}isShowCommission=!1;roleService=Pe(j);columnService=Pe(gt);column={Orders:{selected:!0},Sales:{selected:!0},Tax:{selected:!0},SalesNTax:{selected:!0,name:"Sales + Tax"},Cost:{selected:!0,role:this.roleService.product.Cost},Target:{selected:!0},QTY:{selected:!1,name:"Qty",advanced:!0,endpoint:"/api/Report/SalesPersonOrderQuantity",responseProperty:"Quantity"},Commission:{selected:!1,advanced:!0,endpoint:"/api/Report/SalesPersonOrderCommission",responseProperty:"Commission",role:this.roleService.product.CommissionView},Profit:{selected:!0,role:this.roleService.report.Profit}};isShowOutletTarget=!0;postInit(){this.menuData.H=this.data.PageTitle,this.isShowCommission=!1,this.initShowSalesTarget();let e=this.getTotalDays();this.data.List=this.data.List.map(r=>(r.AvgDailySales=r.Sales/e,r)),this.checkForAdvancedColumn()}initShowSalesTarget(){let e=this.data?.List?.reduce((r,t)=>r+t.Target,0);this.isShowOutletTarget=e>0}getTotalDays(){let e=new Date(this.pageData.Filter.From),r=new Date(this.pageData.Filter.To);return V.differentInDays(e,r)+1}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.Group=t.Group==null?"":t.Group,l.Group=l.Group==null?"":l.Group,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Group":return this.compare(t.Group.toLocaleLowerCase(),l.Group.toLocaleLowerCase(),h);case"Orders":return this.compare(t.Orders,l.Orders,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,h);case"Target":return this.compare(t.Target,l.Target,h);case"Achievement":return this.compare(t.Achievement,l.Achievement,h);case"BasketSize":return this.compare(t.BasketSize,l.BasketSize,h);case"AvgDailySales":return this.compare(t.AvgDailySales,l.AvgDailySales,h);case"Commission":return this.compare(t.Commission,l.Commission,h);default:return 0}})}getCommission(){this.httpService.post("/api/Report/SalesPersonComission",this.pageData.Filter).pipe(oi(e=>e?.List)).subscribe(e=>{let r=0;this.data.List=this.data.List.map(t=>(r=e.findIndex(l=>l.SalesPersonID===t.ID),r!=-1&&(t.Commission=e[r].Commission,t.Quantity=e[r].Quantity),t)),this.isShowCommission=!0})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Sales Person",exportTypes:[{ID:"ReportExport/SalesPerson",Value:"Default",FileName:"Sales by Sales Person"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.List,this.pageData.Filter,"ID",()=>{this.data.List=this.data.List.map(e=>nt(et({},e),{BasketSize:e.Quantity/e.Orders}))})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(rr),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-person"]],standalone:!1,features:[W],decls:26,vars:25,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],[1,"d-flex"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Person Group",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Delivery",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","Transaction",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name",1,"align-left"],["mat-sort-header","Group","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Orders","style","width: 80px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Sales","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Tax","style","width: 90px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","SalesNTax","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Cost","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Profit","style","width: 120px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Quantity","style","width: 100px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","BasketSize","style","width: 110px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Commission","style","width: 200px","arrowPosition","before","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column","text-end"],["class","text-end text-primary",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-warning",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["mat-sort-header","Group","arrowPosition","before",1,"text-end"],["mat-sort-header","Orders","arrowPosition","before",1,"text-end",2,"width","80px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","AvgDailySales","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Target","style","width: 120px","arrowPosition","before","class","align-l",4,"ngIf"],["mat-sort-header","Achievement","style","width: 60px","arrowPosition","before","class","text-end",4,"ngIf"],["mat-sort-header","Target","arrowPosition","before",1,"align-l",2,"width","120px"],["mat-sort-header","Achievement","arrowPosition","before",1,"text-end",2,"width","60px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","BasketSize","arrowPosition","before",1,"text-end",2,"width","110px"],["mat-sort-header","Commission","arrowPosition","before",1,"text-end",2,"width","200px"],[1,"text-primary"],[3,"routerLink","queryParams"],[1,"text-end","text-primary"],[1,"text-end"],[1,"text-end","text-warning"],["routerLink","Commission_Report",3,"queryParams"],[1,"text-end","text-danger"],[1,"text-end","text-success"],["routerLink","/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions")(2,"div",2),E(3,Pg,3,0,"button",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"By Outlet"),a()(),n(11,"li")(12,"a",7),p(13,"By Employee"),a()(),n(14,"li")(15,"a",7),p(16,"By Sales Group"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),E(23,Fg,22,13,"ng-template",null,0,O),a(),E(25,fC,42,37,"content",9),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(3),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(18,gg)),o(3),c("routerLink",M(19,Cg)),o(3),c("routerLink",M(20,fg)),o(3),c("routerLink",M(21,xg))("queryParams",fe(22,hg,v(19,12,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),v(20,15,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,L,R,ie,pe,ge,Te,U,se,ei,re,oe,Z],encapsulation:2})};var xC=()=>["/menu/Reports/Sales_Report/Standard/Person"],hC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],SC=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],yC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],DC=(i,s)=>({From:i,To:s}),ll=i=>({ID:i}),pl=(i,s,e,r)=>({SalesID:i,From:s,To:e,VariantName:r});function vC(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function wC(i,s){if(i&1){let e=I();n(0,"div",21)(1,"div",22)(2,"datepicker",23),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(3,"div",24)(4,"app-timepicker",25),x("timeChange",function(t){u(e);let l=m(3);return f(l.timeFrom,t)||(l.timeFrom=t),_(t)}),P("timeChange",function(t){u(e);let l=m(3);return _(l.timeFromChange(t))}),a()()(),n(5,"div",26)(6,"div",22)(7,"datepicker",27),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(8,"div",24)(9,"app-timepicker",25),x("timeChange",function(t){u(e);let l=m(3);return f(l.timeTo,t)||(l.timeTo=t),_(t)}),P("timeChange",function(t){u(e);let l=m(3);return _(l.timeToChange(t))}),a()()()}if(i&2){let e=m(3);o(2),c("width",100),C("date",e.pageData.Filter.From),o(2),C("time",e.timeFrom),o(3),c("width",100),C("date",e.pageData.Filter.To),o(2),C("time",e.timeTo)}}function TC(i,s){if(i&1){let e=I();n(0,"div")(1,"datepicker",28),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m(3);return _(t.onFilterFromDate())}),a()(),n(2,"div",29)(3,"datepicker",30),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m(3);return _(t.onFilterToDate())}),a()()}if(i&2){let e=m(3);o(),C("date",e.pageData.Filter.From),c("width",100),o(2),C("date",e.pageData.Filter.To),c("width",100)}}function PC(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",19),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ID,t)||(l.pageData.Filter.ID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),S(9,wC,10,6)(10,TC,4,4),n(11,"h6"),p(12,"Filter Invoice By"),a(),n(13,"radio-options",20),x("modelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.isCreated,t)||(l.pageData.Filter.isCreated=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.ID),o(3),y(e.pageData.Filter.isCreated?9:10),o(4),c("options",e.filterInvoiceBy),C("model",e.pageData.Filter.isCreated)}}function FC(i,s){i&1&&b(0,"app-empty-state")}function IC(i,s){i&1&&(n(0,"th",36),p(1," Commission "),a())}function bC(i,s){i&1&&(n(0,"th",36),p(1," Total Commission "),a())}function EC(i,s){if(i&1&&(n(0,"thead",31)(1,"tr",32)(2,"th",33)(3,"h2")(4,"a",34),p(5),a()()()(),n(6,"tr")(7,"th",35),p(8,"Product"),a(),n(9,"th",36),p(10,"Qty"),a(),n(11,"th",36),p(12,"Sales"),a(),S(13,IC,2,0,"th",36),S(14,bC,2,0,"th",36),a()()),i&2){let e=m().$implicit,r=m(2);o(4),c("queryParams",X(5,ll,e.ID)),o(),$t("",e.Name," - ",e.Code),o(8),y(r.roleService.product.CommissionView?13:-1),o(),y(r.roleService.product.CommissionView?14:-1)}}function MC(i,s){if(i&1&&(n(0,"div")(1,"a",40),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m(2).$implicit,r=m(4);ji("text-decoration-line-through",e.VariantCommission&&e.GroupCommission)("text-danger",e.VariantCommission&&e.GroupCommission),o(),c("queryParams",Ut(14,pl,e.SalesID,v(2,6,r.pageData.Filter.From,"ddMMyyyy"),v(3,9,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),F(g(5,12,e.VariantCommission))}}function VC(i,s){if(i&1&&(n(0,"div")(1,"a",41),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m(2).$implicit,r=m(4);o(),c("queryParams",Ut(10,pl,e.SalesID,v(2,2,r.pageData.Filter.From,"ddMMyyyy"),v(3,5,r.pageData.Filter.To,"ddMMyyyy"),e.Name)),o(3),F(g(5,8,e.GroupCommission))}}function BC(i,s){if(i&1&&(n(0,"td",38),S(1,MC,6,19,"div",39),S(2,VC,6,15,"div"),a()),i&2){let e=m().$implicit;o(),y(e.VariantCommission||!e.GroupCommission?1:-1),o(),y(e.GroupCommission?2:-1)}}function OC(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalCommission)," ")}}function LC(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",37),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",38),p(7),d(8,"quantityFraction"),a(),n(9,"td",38),p(10),d(11,"amountFraction"),a(),S(12,BC,3,2,"td",38),S(13,OC,3,3,"td",38),a()),i&2){let e=s.$implicit,r=m(4);o(2),c("queryParams",X(11,ll,e.VariantID)),o(),F(e.Name),o(2),F(e.Code),o(2),F(g(8,7,e.Quantity)),o(3),F(g(11,9,e.NettSales)),o(2),y(r.roleService.product.CommissionView?12:-1),o(),y(r.roleService.product.CommissionView?13:-1)}}function RC(i,s){if(i&1&&(n(0,"tbody"),G(1,LC,14,13,"tr",null,Y),a()),i&2){let e=m().$implicit;o(),H(e.Item)}}function kC(i,s){if(i&1&&(n(0,"div"),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),n(5,"span",43),p(6),d(7,"sum"),d(8,"amountFraction"),a()()),i&2){let e=m(3).$implicit;ji("text-decoration-line-through",v(1,5,e.Item,"VariantCommission")&&v(2,8,e.Item,"GroupCommission"))("text-danger",v(3,11,e.Item,"VariantCommission")&&v(4,14,e.Item,"GroupCommission")),o(6),F(g(8,20,v(7,17,e.Item,"VariantCommission")))}}function WC(i,s){if(i&1&&(n(0,"div"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3).$implicit;o(),D(" ",g(3,4,v(2,1,e.Item,"GroupCommission"))," ")}}function NC(i,s){if(i&1&&(n(0,"td",38),S(1,kC,9,22,"div",39),d(2,"sum"),d(3,"sum"),S(4,WC,4,6,"div"),d(5,"sum"),a()),i&2){let e=m(2).$implicit;o(),y(v(2,2,e.Item,"VariantCommission")||!v(3,5,e.Item,"GroupCommission")?1:-1),o(3),y(v(5,8,e.Item,"GroupCommission")?4:-1)}}function AC(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(3,4,v(2,1,e.Item,"TotalCommission"))," ")}}function GC(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",42)(2,"td"),p(3,"Total"),a(),n(4,"td",38),p(5),d(6,"sum"),d(7,"quantityFraction"),a(),n(8,"td",38),p(9),d(10,"sum"),d(11,"amountFraction"),a(),S(12,NC,6,11,"td",38),S(13,AC,4,6,"td",38),a()()),i&2){let e=m().$implicit,r=m(2);o(5),D(" ",g(7,7,v(6,4,e.Item,"Quantity"))," "),o(4),D(" ",g(11,12,v(10,9,e.Item,"NettSales"))," "),o(3),y(r.roleService.product.CommissionView?12:-1),o(),y(r.roleService.product.CommissionView?13:-1)}}function HC(i,s){if(i&1&&(n(0,"table",14),S(1,EC,15,7,"thead",31),S(2,RC,3,0,"tbody"),S(3,GC,14,14,"tfoot"),a()),i&2){let e=s.$implicit;o(),y(e.Name?1:-1),o(),y(e.Name?2:-1),o(),y(e.Name?3:-1)}}function QC(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",3)(3,"a",4),P("click",function(){u(e);let t=m();return _(t.print())}),b(4,"i",5),p(5," Print"),a(),S(6,vC,3,0,"a",6),n(7,"div",7)(8,"button",8),p(9," More "),a(),n(10,"ul",9)(11,"li")(12,"a",10),p(13,"Summary"),a()(),n(14,"li")(15,"a",10),p(16,"By Outlet"),a()(),n(17,"li")(18,"a",10),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",11),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),E(26,PC,14,8,"ng-template",null,0,O),a(),n(28,"content")(29,"div",12),S(30,FC,1,0,"app-empty-state"),n(31,"div",13),G(32,HC,4,3,"table",14,Y),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(6),y(e.roleService!=null&&e.roleService.global.Export?6:-1),o(6),c("routerLink",M(17,xC)),o(3),c("routerLink",M(18,hC)),o(3),c("routerLink",M(19,SC)),o(3),c("routerLink",M(20,yC))("queryParams",fe(21,DC,v(22,11,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),v(23,14,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),o(9),y((e.data==null||e.data.Data==null?null:e.data.Data.length)==0?30:-1),o(2),H(e.data.Data)}}var Sa=class i extends De{constructor(e,r,t,l,h,T){super(e,r,"Report/GetSalesPersonCommissionGroupByProduct","ReportLoader/SalesCommissionLoader",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.activatedRoute=T}filterInvoiceBy=[{Key:!1,Value:"Date"},{Key:!0,Value:"Created"}];timeFrom;timeTo;preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(K,{data:{title:"Employee Commission Report",exportTypes:[{ID:"ReportExport/SalesPersonGroupByProduct",Value:"Default",FileName:"Employee Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To),this.onFilterToDate()}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From),this.onFilterFromDate()}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(Ne))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-commision-report"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],[1,"btn","btn-outline-secondary","ms-3"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom","mb-10"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],["name","Is Created",3,"modelChange","options","model"],[1,"w-100","d-flex","mt-2","align-items-center"],[1,"w-100"],["name","From","appearance","outline",3,"dateChange","width","date"],[1,"ms-2"],[3,"timeChange","time"],[1,"w-100","d-flex","align-items-center","mt-4"],["name","To","appearance","outline",3,"dateChange","width","date"],["name","From","appearance","outline",3,"dateChange","date","width"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date","width"],[1,"thead-light"],[2,"border","none !important"],["colspan","5",1,"text-center","bg-white","border-none"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],[2,"width","200px"],[1,"text-end",2,"width","100px"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"text-end"],[3,"text-decoration-line-through","text-danger"],["routerLink","Commission_Report_Detail","matTooltipPosition","above","matTooltip","variant commission",3,"queryParams"],["routerLink","Commission_Report_Detail",3,"queryParams"],[1,"table-footer","fw-bold"],["matTooltipPosition","above","matTooltip","Total variant commission"]],template:function(r,t){r&1&&S(0,QC,34,24,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,J,L,R,ie,Te,Mi,U,ze,kr,se,oe,Z,ne],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}} datepicker.timepicker>mat-form-field{width:140px!important}"]})};var YC=()=>["/menu/Reports/Sales_Report/Standard/Person"],jC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],qC=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],UC=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],zC=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],vo=i=>({ID:i}),KC=()=>["/menu/Products/Catalog/Variants/Info"],XC=()=>["/menu/Contacts/Contact/Sales_Person/Info"];function JC(i,s){if(i&1){let e=I();n(0,"a",8),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",9),p(2," Export "),a()}}function ZC(i,s){if(i&1){let e=I();n(0,"div",10)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",14)(12,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Outlets),o(3),C("ngModel",e.pageData.Filter.SalesID),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function $C(i,s){i&1&&(n(0,"th",34),p(1,"Date"),a())}function ef(i,s){i&1&&(n(0,"th",34),p(1,"Outlet"),a())}function tf(i,s){i&1&&(n(0,"th",34),p(1," Number "),a())}function nf(i,s){i&1&&(n(0,"th"),p(1,"Product"),a())}function af(i,s){i&1&&(n(0,"th"),p(1,"Sales Person"),a())}function of(i,s){i&1&&(n(0,"th",35),p(1," Quantity "),a())}function rf(i,s){i&1&&(n(0,"th",35),p(1," Commission "),a())}function lf(i,s){i&1&&(n(0,"th",35),p(1," Total Commission "),a())}function pf(i,s){i&1&&(n(0,"th",35),p(1," Cost "),a())}function mf(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Date,"dd MMM yyyy")," ")}}function sf(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.EntityName)}}function cf(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,zC))("queryParams",X(4,vo,e.ID)),o(),F(e.Number)}}function df(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,KC))("queryParams",X(4,vo,e.VariantID)),o(),F(e.VariantName)}}function uf(i,s){if(i&1&&(n(0,"td")(1,"a",36),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,XC))("queryParams",X(4,vo,e.SalesID)),o(),F(e.SalesName)}}function _f(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function gf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.SalesCommission,r.pageData.FractionDigit)," ")}}function Cf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.Total,r.pageData.FractionDigit)," ")}}function ff(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.UnitCost,r.pageData.FractionDigit)," ")}}function xf(i,s){if(i&1&&(n(0,"tr"),E(1,mf,3,4,"td",21)(2,sf,2,1,"td",21)(3,cf,3,6,"td",21)(4,df,3,6,"td",21)(5,uf,3,6,"td",21)(6,_f,3,3,"td",27)(7,gf,3,4,"td",27)(8,Cf,3,4,"td",27)(9,ff,3,4,"td",28),a()),i&2){let e=m(2);o(),c("ngIf",e.columns.Date.selected),o(),c("ngIf",e.columns.Outlet.selected),o(),c("ngIf",e.columns.InvoiceNumber.selected),o(),c("ngIf",e.columns.VariantName.selected),o(),c("ngIf",e.columns.SalesName.selected),o(),c("ngIf",e.columns.Quantity.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected)}}function hf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"SalesCommission"),e.pageData.FractionDigit)," ")}}function Sf(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function yf(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"UnitCost"),e.pageData.FractionDigit)," ")}}function Df(i,s){if(i&1){let e=I();n(0,"span",38),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail"))}),n(1,"i",39),p(2,"?"),a()()}}function vf(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"quantityFraction"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function wf(i,s){if(i&1){let e=I();n(0,"div",40)(1,"a",41),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(2,"i",42),p(3," Next"),a(),n(4,"a",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesPersonCommissionDetail",!0))}),b(5,"i",44),p(6," Show All"),a()()}}function Tf(i,s){if(i&1&&(n(0,"div",16)(1,"table",17)(2,"thead",18)(3,"tr",19),E(4,$C,2,0,"th",20)(5,ef,2,0,"th",20)(6,tf,2,0,"th",20)(7,nf,2,0,"th",21)(8,af,2,0,"th",21)(9,of,2,0,"th",22)(10,rf,2,0,"th",22)(11,lf,2,0,"th",22)(12,pf,2,0,"th",22),a()(),n(13,"tbody"),E(14,xf,10,9,"tr",23),a(),n(15,"tfoot")(16,"tr",24)(17,"td",25),p(18,"Total:"),a(),n(19,"td",26),p(20),d(21,"sum"),d(22,"number"),a(),E(23,hf,4,7,"td",27)(24,Sf,4,7,"td",27)(25,yf,4,7,"td",28),a()()(),n(26,"div",29)(27,"div",30)(28,"div",31),p(29),d(30,"number"),E(31,Df,3,0,"span",32)(32,vf,3,3,"span",21),p(33),a()(),E(34,wf,7,0,"div",33),a()()),i&2){let e=m();o(4),c("ngIf",e.columns.Date.selected),o(),c("ngIf",e.columns.Outlet.selected),o(),c("ngIf",e.columns.InvoiceNumber.selected),o(),c("ngIf",e.columns.VariantName.selected),o(),c("ngIf",e.columns.SalesName.selected),o(),c("ngIf",e.columns.Quantity.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected),o(2),c("ngForOf",e.infiniteList),o(6),D(" ",g(22,22,v(21,19,e.data.Data,"Quantity"))," "),o(3),c("ngIf",e.roleService.product.CommissionView&&e.columns.Commission.selected),o(),c("ngIf",e.roleService.product.CommissionView&&e.columns.TotalCommission.selected),o(),c("ngIf",e.roleService.product.Cost&&e.columns.UnitCost.selected),o(4),D(" Showing 1 - ",g(30,24,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var ya=class i extends De{constructor(e,r,t,l,h,T){super(e,r,"Report/GetSalesPersonCommissionDetail","ReportLoader/SalesCommissionDetailLoader",null,h);this.httpService=r;this.csvConverter=t;this.datePipe=l;this.activatedRoute=h;this.matDialog=T}roleService=Pe(j);columnService=Pe(gt);datasource=[];columns={Date:{selected:!0,name:"Date",width:null,class:"w-100",visible:!0},Outlet:{selected:!0,name:"Outlet",width:null,class:"w-100",visible:!0},InvoiceNumber:{selected:!0,name:"Number",width:null,class:"w-100",visible:!0},VariantName:{selected:!0,name:"Name",width:null,class:"w-100",visible:!0},SalesName:{selected:!0,name:"Sales Person",width:null,class:"w-100",visible:!0},Quantity:{selected:!0,name:"Qty",width:null,class:"w-100",visible:!0},Commission:{selected:!0,name:"Commission",width:null,class:"w-100",visible:!0,role:this.roleService.product.CommissionView},TotalCommission:{selected:!0,name:"Total Commission",width:null,class:"w-100",visible:!0,role:this.roleService.product.CommissionView},UnitCost:{selected:!1,name:"Cost",width:null,class:"w-100",visible:!1,role:this.roleService.product.Cost}};onColumnSelectedChange(e){let r=this.columns[e.key];r&&(r.visible=!e.value.visible)}get displayedColumns(){return Object.keys(this.columns).filter(e=>this.columns[e].selected)}transformDate(e,r){return this.datePipe.transform(e,r)}getFilterData(e){this.infiniteList=this.originalData.filter(r=>Object.keys(r).some(t=>r[t]==null?!1:r[t].toString().toLowerCase().includes(e.toLowerCase())))}openExportModal(){this.matDialog.open(K,{data:{title:"Commission Report Detail",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionDetail",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountSalesPersonCommissionDetail",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(Ne),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-commision-report-detail"]],standalone:!1,features:[W],decls:24,vars:15,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 120px",4,"ngIf"],[4,"ngIf"],["style","width: 120px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end"],[1,"text-end","text-success"],["class","text-end text-success",4,"ngIf"],["class","text-end text-danger",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"],["class","btn-group",4,"ngIf"],[2,"width","120px"],[1,"text-end",2,"width","120px"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.VariantName,T)||(t.pageData.Filter.VariantName=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())})("textChange",function(T){return u(l),_(t.getFilterData(T))}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,JC,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9,"Summary"),a()(),n(10,"li")(11,"a",6),p(12,"By Outlet"),a()(),n(13,"li")(14,"a",6),p(15,"By Employee"),a()(),n(16,"li")(17,"a",6),p(18,"By Sales Group"),a()()()()(),n(19,"filters"),E(20,ZC,13,7,"ng-template",null,0,O),a(),n(22,"content"),E(23,Tf,35,26,"div",7),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.VariantName),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.columns),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(6),c("routerLink",M(11,YC)),o(3),c("routerLink",M(12,jC)),o(3),c("routerLink",M(13,qC)),o(3),c("routerLink",M(14,UC)),o(6),c("ngIf",t.infiniteList&&t.data&&t.data.Data))},dependencies:[A,st,it,Q,J,L,R,ie,U,ze,se,re,oe,ne],encapsulation:2})};var ml=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],sl=i=>({ID:i});function Pf(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Ff(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Supplier"),a(),n(10,"autocompleteV2",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",10)(16,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Currency"),a(),n(19,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(20,"h6"),p(21,"Sort"),a(),n(22,"radio-options",13),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.IsDesc,t)||(l.pageData.Filter.IsDesc=t),_(t)}),a(),n(23,"h6"),p(24,"Purchase Order Tag"),a(),n(25,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Note Visible"),a(),n(28,"radio-options",15),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.NoteVisible,t)||(l.pageData.Filter.NoteVisible=t),_(t)}),a(),n(29,"h6"),p(30,"Order By"),a(),n(31,"radio-options",16),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.SupplierID),o(4),c("isFloatingLabel",!1),C("date",e.pageData.Filter.From),o(2),c("isFloatingLabel",!1),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),C("model",e.pageData.Filter.IsDesc),c("options",e.AscDscRadio),o(3),c("items",e.pageData.Options.Tags),C("ngModel",e.pageData.Filter.TagID),o(3),C("model",e.pageData.Filter.NoteVisible),o(3),C("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function If(i,s){if(i&1&&(n(0,"th",26),p(1),a()),i&2){let e=m(2);o(),D(" Cost(",e.data.Symbol,") ")}}function bf(i,s){i&1&&(n(0,"th",27),p(1," Disc "),a())}function Ef(i,s){if(i&1&&(n(0,"th",28),p(1),a()),i&2){let e=m(2);o(),D(" Total(",e.data.Symbol,") ")}}function Mf(i,s){i&1&&(n(0,"span"),p(1," /"),a())}function Vf(i,s){if(i&1&&(n(0,"a",33)(1,"span",42),p(2),a()()),i&2){let e=m().$implicit;c("routerLink",M(3,ml))("queryParams",X(4,sl,e.Data.ID)),o(2),F("#"+e.PONumber)}}function Bf(i,s){if(i&1&&(n(0,"th",50),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.UnitPrice)," ")}}function Of(i,s){if(i&1&&(n(0,"div",53),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;o(),D(" ",g(2,1,e==null?null:e.DiscountAmount)," ")}}function Lf(i,s){if(i&1&&(n(0,"th",51),p(1),d(2,"amountFraction"),S(3,Of,3,3,"div",53),a()),i&2){let e=m().$implicit;o(),D(" ",(e==null?null:e.Discount)==0?"":g(2,2,e==null?null:e.Discount)+"%"," "),o(2),y((e==null?null:e.DiscountAmount)>0?3:-1)}}function Rf(i,s){if(i&1&&(n(0,"th",52),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e==null?null:e.Total)," ")}}function kf(i,s){if(i&1&&(n(0,"tr")(1,"th",43)(2,"div",44)(3,"span"),p(4),a(),b(5,"small",45),a()(),n(6,"th",46),p(7),a(),n(8,"th",47),p(9),d(10,"quantityFraction"),a(),n(11,"th",48),p(12),d(13,"quantityFraction"),a(),n(14,"th",49),p(15),a(),S(16,Bf,3,3,"th",50),S(17,Lf,4,4,"th",51),S(18,Rf,3,3,"th",52),a()),i&2){let e=s.$implicit,r=m(3);o(4),F(e==null?null:e.Name),o(),c("innerHtml",e==null?null:e.Note,Ee),o(2),D(" ",e==null?null:e.Code," "),o(2),D(" ",g(10,9,e==null?null:e.QtyRequested)," "),o(3),D(" ",g(13,11,e==null?null:e.Quantity)," "),o(3),D(" ",e==null?null:e.UOMName," "),o(),y(r.roleService.product.Cost?16:-1),o(),y(r.roleService.product.Cost?17:-1),o(),y(r.roleService.product.Cost?18:-1)}}function Wf(i,s){if(i&1&&(n(0,"tr")(1,"th",59),p(2),a(),n(3,"th",60),p(4),a(),n(5,"th",61),p(6),d(7,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),D("",e.Label," :"),o(2),D(" ",e==null?null:e.CurrencySymbol," "),o(2),D(" ",g(7,3,e==null?null:e.Amount)," ")}}function Nf(i,s){if(i&1&&(n(0,"table",41),G(1,Wf,8,5,"tr",null,Y),a()),i&2){let e=m(2).$implicit;o(),H(e==null?null:e.Aggregate)}}function Af(i,s){if(i&1&&(n(0,"tfoot",41)(1,"tr",54)(2,"td",55),p(3,"Total"),a(),n(4,"td",56)(5,"b"),p(6),d(7,"sum"),d(8,"quantityFraction"),a()(),b(9,"td",57),n(10,"td",58),S(11,Nf,3,0,"table",41),a()()()),i&2){let e=m().$implicit,r=m(2);o(6),F(g(8,5,v(7,2,e.Items,"Quantity"))),o(5),y(r.roleService.product.Cost?11:-1)}}function Gf(i,s){if(i&1&&(n(0,"div")(1,"div",31)(2,"div",32)(3,"a",33)(4,"span",34),p(5),a()(),S(6,Mf,2,0,"span"),S(7,Vf,3,6,"a",33),n(8,"span"),p(9),d(10,"date"),a(),b(11,"span",23),n(12,"strong",35),p(13),d(14,"sum"),d(15,"sum"),d(16,"quantityFraction"),a(),b(17,"small",36),a(),n(18,"div",37)(19,"label",38),p(20),a()()(),n(21,"table",39),b(22,"thead"),n(23,"tbody",40),G(24,kf,19,13,"tr",null,Y),a(),S(26,Af,12,7,"tfoot",41),a()()),i&2){let e=s.$implicit,r=m(2);o(3),c("routerLink",M(21,ml))("queryParams",X(22,sl,e.Data.ID)),o(2),F(e.Data.EntityName+" #"+e.Data.Number),o(),y(r.pageData.DualReceiptNumber?6:-1),o(),y(r.pageData.DualReceiptNumber?7:-1),o(2),F(" - "+v(10,10,e.Data.Date,"dd MMM yyyy")+(e.Data.Name==null?"":" : "+e.Data.Name)),o(4),D(" ","[Q: "+v(14,13,e.Items,"Quantity")+", T: "+g(16,19,v(15,16,e.Items,"Total"))+"]"," "),o(4),c("innerHtml",e==null||e.Data==null?null:e.Data.Note,Ee),o(3),F(e.Data==null?null:e.Data.PaymentStateLabel),o(4),H(e.Items),o(2),y(r.roleService.product.Cost?26:-1)}}function Hf(i,s){if(i&1&&(n(0,"div",62)(1,"div")(2,"strong"),p(3,"Tax Added"),a(),n(4,"span",59),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Purchases with Tax"),a(),n(10,"span",59),p(11),d(12,"amountFraction"),a()()()),i&2){let e=m(3);o(5),F(g(6,2,e.data.Aggregate.TaxAdd)),o(6),F(g(12,4,e.data.Aggregate.PurchaseWithTax))}}function Qf(i,s){if(i&1&&(n(0,"div",62)(1,"div")(2,"strong"),p(3,"Gross Purchase"),a(),n(4,"span",59),p(5),d(6,"amountFraction"),a()(),n(7,"div")(8,"strong"),p(9,"Discount"),a(),n(10,"span",59),p(11),d(12,"amountFraction"),a()(),n(13,"div")(14,"strong"),p(15,"Tax Incl."),a(),n(16,"span",59),p(17),d(18,"amountFraction"),a()(),n(19,"div")(20,"strong"),p(21,"Net Purchase"),a(),n(22,"span",59),p(23),d(24,"amountFraction"),a()()()),i&2){let e=m(3);o(5),F(g(6,4,e.data.Aggregate.Gross)),o(6),F(g(12,6,e.data.Aggregate.Discount)),o(6),F(g(18,8,e.data.Aggregate.TaxInclude)),o(6),F(g(24,10,e.data.Aggregate.NetPurchase))}}function Yf(i,s){if(i&1&&(n(0,"div",30),S(1,Hf,13,6,"div",62),n(2,"div",62)(3,"div")(4,"strong"),p(5,"Orders"),a(),n(6,"span",59),p(7),d(8,"amountFraction"),a()(),n(9,"div")(10,"strong"),p(11,"Qty"),a(),n(12,"span",59),p(13),d(14,"quantityFraction"),a()()(),S(15,Qf,25,12,"div",62),a()),i&2){let e=m(2);o(),y(e.roleService.product.Cost?1:-1),o(6),F(g(8,4,e.data.Aggregate.TotalTransaction)),o(6),F(g(14,6,e.data.Aggregate.UnitQuantity)),o(2),y(e.roleService.product.Cost?15:-1)}}function jf(i,s){if(i&1&&(n(0,"content")(1,"div",17)(2,"table",18)(3,"thead",19)(4,"tr")(5,"th",20),p(6,"Name"),a(),n(7,"th",21),p(8,"Code"),a(),n(9,"th",22)(10,"span",23),p(11,"Requested"),a(),p(12," qty "),a(),n(13,"th",24),p(14,"Qty"),a(),n(15,"th",25),p(16,"UOM"),a(),S(17,If,2,1,"th",26),S(18,bf,2,0,"th",27),S(19,Ef,2,1,"th",28),a()(),n(20,"tbody")(21,"tr")(22,"td",29),G(23,Gf,27,24,"div",null,Y),a()()()(),S(25,Yf,16,8,"div",30),a()()),i&2){let e=m();o(17),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(3),li("colspan",e.roleService.product.Cost?8:6),o(),H(e.data.Data),o(2),y(e.data.Data.length>0?25:-1)}}var Da=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/GetPurchaseTransactionDetail","ReportLoader/GetPurchaseTransactionDetail");this.httpService=r;this.csvConverter=t;this.datePipe=l;this.roleService=h;this.matDialog=T}hideMore=!0;AscDscRadio=[{Key:!1,Value:"Asc"},{Key:!0,Value:"Desc"}];SortBy=[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}];openExportModal(){this.matDialog.open(K,{data:{title:"Product Transaction Detail",exportTypes:[{ID:"ReportExport/ReportPurchaseDetail",Value:"Default",FileName:"Product Transaction Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty),this.datePipe.transform(this.pageData.Filter.From,"MMM")===this.datePipe.transform(this.pageData.Filter.To,"MMM")&&this.datePipe.transform(this.pageData.Filter.From,"yyyy")===this.datePipe.transform(this.pageData.Filter.To,"yyyy")?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d")}`:this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`,this.pageData.Filter.From==this.pageData.Filter.To?this.menuData.H=`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`:this.menuData.H+=` - ${this.datePipe.transform(this.pageData.Filter.To,"d MMM yyyy")}`,this.menuData.H+=" ]"}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(oe),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-detail"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],[1,"mt-4"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","AscDesc",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","items","ngModel"],["name","NoteVisible",3,"modelChange","model"],["name","Sort",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","355px"],[2,"width","50px"],[1,"text-end",2,"width","55px"],[1,"d-block"],[1,"text-end",2,"width","33px"],[1,"fst-italic","small",2,"width","40px"],[1,"text-end",2,"width","80px"],[1,"red",2,"width","30px"],[1,"text-end",2,"width","150px"],[1,"px-0","border-bottom-0"],[1,"row","justify-content-end"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","mt-2","mb-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-3"],[1,"text-danger","ms-3"],[1,"d-block","fw-normal","fst-italic","ms-3",2,"word-break","break-all",3,"innerHtml"],[1,"d-lg-block","mt-2","me-5","fw-bold","fst-italic"],["runat","server",1,"status"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"table","table-sm","table-borderless"],["id","PONumber"],[1,"fw-normal","border-start","border-end",2,"width","325px"],[1,"lh-base"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","50px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","65px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","30px"],[1,"fst-italic","border-start","border-end","small",2,"width","40px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","80px"],[1,"fw-normal","border-start","border-end","text-end","text-danger",2,"width","30px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","140px"],[1,"text-danger"],[1,"grid_footer"],["colspan","2",1,"text-end","fw-bold"],["colspan","2",1,"text-end"],["colspan","3"],[1,"text-end","d-flex","justify-content-end","fw-bold"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[1,"zebra","col-auto"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Pf,3,0,"button",2),a(),n(3,"filters"),E(4,Ff,32,20,"ng-template",null,0,O),a(),S(6,jf,26,5,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,Te,Ae,Ce,U,se,oe,Z,ne],encapsulation:2})};var cl=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],wo=i=>({ID:i}),qf=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"];function Uf(i,s){if(i&1){let e=I();n(0,"button",31),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",32),p(2," Export "),a()}}function zf(i,s){if(i&1){let e=I();n(0,"div")(1,"div",33)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",34),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",35),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",36)(10,"datepicker",37),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Payment"),a(),n(13,"ng-select",38),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.StateID,t)||(l.pageData.Filter.StateID=t),_(t)}),a(),n(14,"h6"),p(15,"Supplier"),a(),n(16,"autocompleteV2",39),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(17,"h6"),p(18,"RowCount"),a(),n(19,"input",40),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(20,"h6"),p(21,"Order By"),a(),n(22,"radio-options",41),x("modelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.DefaultFilterColumn,t)||(l.pageData.Filter.DefaultFilterColumn=t),_(t)}),P("modelChange",function(){u(e);let t=m(2);return _(t.searchFromPageOne())}),a()()()}if(i&2){let e=m(2);o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.StateID),c("items",e.pageData.Options==null?null:e.pageData.Options.States),o(3),C("ngModel",e.pageData.Filter.SupplierID),c("inputTextValue",e.contactDisplay),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount),o(3),C("model",e.pageData.Filter.DefaultFilterColumn),c("options",e.pageData.Options.DefaultFilterColumnOptions)}}function Kf(i,s){i&1&&(n(0,"th",13),p(1," Purchase "),a())}function Xf(i,s){i&1&&(n(0,"th",14),p(1," Tax "),a())}function Jf(i,s){i&1&&(n(0,"th",15),p(1," Purchase+Tax "),a())}function Zf(i,s){i&1&&(n(0,"th",16),p(1," Payment "),a())}function $f(i,s){i&1&&b(0,"br")}function ex(i,s){if(i&1&&(n(0,"a",42),p(1),a()),i&2){let e=m().$implicit;c("routerLink",M(3,cl))("queryParams",X(4,wo,e.PurchaseOrderID)),o(),F(e.PONumber)}}function tx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function ix(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function nx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalAmount)," ")}}function ax(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PaymentAmount)," ")}}function ox(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",42),p(5),a(),S(6,$f,1,0,"br"),S(7,ex,2,6,"a",42),a(),n(8,"td"),p(9),d(10,"date"),a(),n(11,"td")(12,"a",42),p(13),a()(),n(14,"td",21),p(15),d(16,"quantityFraction"),a(),S(17,tx,3,3,"td",21),S(18,ix,3,3,"td",22),S(19,nx,3,3,"td",21),S(20,ax,3,3,"td",21),n(21,"td"),p(22),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(25,cl))("queryParams",X(26,wo,e.ID)),o(),F(e.Number),o(),y(r.pageData.DualNumber?6:-1),o(),y(r.pageData.DualNumber?7:-1),o(2),F(v(10,20,e.Date,"dd MMM yyyy")),o(3),c("routerLink",M(28,qf))("queryParams",X(29,wo,e.SupplierID)),o(),D(" ",e.SupplierNameDisplay," "),o(2),D(" ",g(16,23,e.TotalItemQuantity)," "),o(2),y(r.roleService.product.Cost?17:-1),o(),y(r.roleService.product.Cost?18:-1),o(),y(r.roleService.product.Cost?19:-1),o(),y(r.roleService.product.Cost?20:-1),o(),ji("text-danger",e.PaymentStateLabel==="Unpaid")("text-success",e.PaymentStateLabel==="Paid"),o(),D(" ",e.PaymentStateLabel," ")}}function rx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Sales"))," ")}}function lx(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function px(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"TotalAmount"))," ")}}function mx(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"PaymentAmount"))," ")}}function sx(i,s){if(i&1){let e=I();n(0,"span",43),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountReportPurchaseSummary"))}),n(1,"i",44),p(2,"?"),a()()}}function cx(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function dx(i,s){if(i&1){let e=I();n(0,"a",45),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",46),p(2," Next"),a()}}function ux(i,s){if(i&1){let e=I();n(0,"a",47),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountReportPurchaseSummary",!0))}),b(1,"i",48),p(2," Show All"),a()}}function _x(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),x("textChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Number,t)||(l.pageData.Filter.Number=t),_(t)}),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,Uf,3,0,"button",3),a(),n(3,"filters"),E(4,zf,23,14,"ng-template",null,0,O),a(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Outlet"),a(),n(14,"th",9),p(15,"Number"),a(),n(16,"th",10),p(17,"Date"),a(),n(18,"th",11),p(19," Supplier "),a(),n(20,"th",12),p(21," Qty "),a(),S(22,Kf,2,0,"th",13),S(23,Xf,2,0,"th",14),S(24,Jf,2,0,"th",15),S(25,Zf,2,0,"th",16),n(26,"th",17),p(27,"State"),a()()(),n(28,"tbody"),G(29,ox,23,31,"tr",null,Y),a(),n(31,"tfoot")(32,"tr",18),b(33,"td",19),n(34,"td",20),p(35,"Total :"),a(),n(36,"td",21),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),S(40,rx,4,6,"td",21),S(41,lx,4,6,"td",22),S(42,px,4,6,"td",21),S(43,mx,4,6,"td",21),b(44,"td",23),a()()()(),n(45,"div",24)(46,"div",25)(47,"div",26),p(48),d(49,"number"),E(50,sx,3,0,"span",27)(51,cx,3,3,"span",28),p(52),a()(),E(53,dx,3,0,"a",29)(54,ux,3,0,"a",30),a()()()()}if(i&2){let e=m();c("pageData",e.menuData),C("text",e.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(20),y(e.roleService.product.Cost?22:-1),o(),y(e.roleService.product.Cost?23:-1),o(),y(e.roleService.product.Cost?24:-1),o(),y(e.roleService.product.Cost?25:-1),o(4),H(e.infiniteList),o(8),D(" ",g(39,23,v(38,20,e.infiniteList,"TotalItemQuantity"))," "),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.product.Cost?41:-1),o(),y(e.roleService.product.Cost?42:-1),o(),y(e.roleService.product.Cost?43:-1),o(5),D(" Showing 1 - ",g(49,25,e.infiniteList.length)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var va=class i extends vi{constructor(e,r,t,l,h,T){super(e,r,"Report/ReportPurchaseSummary","ReportLoader/GetReportPurchaseSummary",null,l);this.httpService=r;this.csvConverter=t;this.url=l;this.roleService=h;this.matDialog=T}contactDisplay;preInitLoader(){let e=this.loaderPayload.ListIDs;typeof e=="string"&&V.IsNotEmpty(e)&&(this.loaderPayload.ListIDs=[e])}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Report Summary",exportTypes:[{ID:"ReportExport/ReportPurchaseSummary",Value:"Default",FileName:"Purchase Report Summary"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){super.postInit(e),this.menuData.H=e.PageTitle}preInitList(){V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null),V.IsNotEmpty(this.pageData.Filter.SupplierID)&&(this.pageData.Filter.From=V.MinDate),V.IsNotEmpty(this.pageData.SupplierName)&&(this.contactDisplay=this.pageData.SupplierName)}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.infiniteList=r;return}this.infiniteList=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,t.SupplierNameDisplay=t.SupplierNameDisplay==null?"":t.SupplierNameDisplay,l.SupplierNameDisplay=l.SupplierNameDisplay==null?"":l.SupplierNameDisplay,e.active){case"EntityName":return V.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),h);case"Number":return V.compare(t.Number,l.Number,h);case"Date":return V.compare(t.Date,l.Date,h);case"SupplierNameDisplay":return V.compare(t.SupplierNameDisplay.toLocaleLowerCase(),l.SupplierNameDisplay.toLocaleLowerCase(),h);case"TotalItemQuantity":return V.compare(t.TotalItemQuantity,l.TotalItemQuantity,h);case"Total":return V.compare(t.TotalAmount,l.TotalAmount,h);case"Sales":return V.compare(t.Sales,l.Sales,h);case"Tax":return V.compare(t.Tax,l.Tax,h);case"PaymentAmount":return V.compare(t.PaymentAmount,l.PaymentAmount,h);case"PaymentState":return V.compare(t.PaymentStateLabel,l.PaymentStateLabel,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-detail-summary"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName"],["mat-sort-header","Number"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","SupplierNameDisplay",2,"width","118px"],["mat-sort-header","TotalItemQuantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right","text-end",2,"width","118px"],["mat-sort-header","PaymentAmount","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","PaymentState",2,"width","70px"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end","empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"empty-column"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more data",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,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Payment Status",3,"ngModelChange","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["autoNum","","name","RowCount",1,"w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["name","Sort",3,"modelChange","model","options"],[3,"routerLink","queryParams"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more data",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){r&1&&S(0,_x,55,27,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,it,Q,$,J,Qe,L,R,ie,pe,ge,Ue,Te,Ae,U,se,re,oe,Z,ne],encapsulation:2})};var gx=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],Cx=i=>({ID:i}),fx=(i,s,e)=>({SupplierID:i,From:s,To:e}),xx=()=>["/menu/Reports/Purchases_Report/Summary"];function hx(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Sx(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier Group"),a(),n(7,"ng-select",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupID,t)||(l.pageData.Filter.GroupID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",9)(13,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.GroupID),c("items",e.pageData.Options==null?null:e.pageData.Options.Group),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function yx(i,s){i&1&&(n(0,"th",20),p(1," Purchase "),a())}function Dx(i,s){if(i&1&&(n(0,"td",24)(1,"a",30),d(2,"date"),d(3,"date"),p(4),d(5,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(11,fx,e.SupplierID,v(2,3,r.pageData.Filter.From,"yyyy-MM-dd"),v(3,6,r.pageData.Filter.To,"yyyy-MM-dd")))("routerLink",M(15,xx)),o(3),F(g(5,9,e.Total))}}function vx(i,s){if(i&1&&(n(0,"tr",21)(1,"td"),p(2),a(),n(3,"td",27)(4,"a",28),p(5),a()(),n(6,"td",24),p(7),a(),n(8,"td",29),p(9),d(10,"quantityFraction"),a(),S(11,Dx,6,16,"td",24),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Rank),o(2),c("routerLink",M(9,gx))("queryParams",X(10,Cx,e.SupplierID)),o(),F(e.Name),o(2),F(e.Code),o(2),D(" ",g(10,7,e.Quantity)," "),o(2),y(r.roleService.product.Cost?11:-1)}}function wx(i,s){i&1&&(n(0,"th",24),p(1," Total Purchase "),a())}function Tx(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(2,1,e.data.TotalSales)," ")}}function Px(i,s){if(i&1){let e=I();n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",15)(5,"tr")(6,"th",16),p(7,"Rank"),a(),n(8,"th",17),p(9,"Supplier"),a(),n(10,"th",18),p(11," Code "),a(),n(12,"th",19),p(13," Quantity "),a(),S(14,yx,2,0,"th",20),a()(),n(15,"tbody"),G(16,vx,12,12,"tr",21,Y),a(),n(18,"tfoot")(19,"tr",22),b(20,"th",23),n(21,"th",24),p(22,"Total Quantity"),a(),S(23,wx,2,0,"th",24),a(),n(24,"tr"),b(25,"td",25),n(26,"td",24),p(27),d(28,"quantityFraction"),a(),S(29,Tx,3,3,"td",24),a()()(),n(30,"POS-complex-pagination",26),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()()}if(i&2){let e=m();o(14),y(e.roleService.product.Cost?14:-1),o(2),H(e.data.Data),o(7),y(e.roleService.product.Cost?23:-1),o(4),F(g(28,6,e.data.TotalQty)),o(2),y(e.roleService.product.Cost?29:-1),o(),c("total",e.data.Data==null?null:e.data.Data.length)("pageData",e.pageData)}}var wa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/TopSupplier","ReportLoader/TopSupplierLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}openExportModal(){this.matDialog.open(K,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopPurchaseExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/TopSupplierCount",pagination:!0}})}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Code":return this.compare(t.Code,l.Code,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Total":return this.compare(t.Total,l.Total,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-top-supplier"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Supplier Group",3,"ngModelChange","ngModel","items"],["name","From","appearance","outline",3,"dateChange","date"],[1,"mt-4"],["name","To","appearance","outline",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","35px"],["mat-sort-header","Name"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"border-bottom"],[1,"thead-light"],["colspan","3"],[1,"text-end"],["colspan","3",1,"bg-white","border-top-0"],["api","Report/TopSupplierCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end","text-success"],[3,"queryParams","routerLink"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,hx,3,0,"button",2),a(),n(3,"filters"),E(4,Sx,17,11,"ng-template",null,0,O),a(),S(6,Px,31,8,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,Qe,L,R,pe,ge,Ue,Et,U,oe,Z,ne],encapsulation:2})};var Fx=i=>[i],Ix=i=>({ID:i}),bx=(i,s,e,r)=>({VariantID:i,ProductID:s,From:e,To:r});function Ex(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Mx(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Currency"),a(),n(10,"ng-select",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(15,"div",10)(16,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(17,"h6"),p(18,"Group By"),a(),n(19,"radio-options",12),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(20,"h6"),p(21,"Brand"),a(),n(22,"ng-select",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.pageData.Filter.GroupByProduct),c("options",e.GroupByRadio),o(3),c("multiple",!1),C("ngModel",e.pageData.Filter.BrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function Vx(i,s){i&1&&(n(0,"th"),p(1,"Variant"),a())}function Bx(i,s){i&1&&(n(0,"th",22),p(1," Cost "),a())}function Ox(i,s){i&1&&(n(0,"th",23),p(1," Gross "),a())}function Lx(i,s){i&1&&(n(0,"th",24),p(1," Purchase "),a())}function Rx(i,s){i&1&&(n(0,"th",25),p(1," Tax "),a())}function kx(i,s){i&1&&(n(0,"th",26),p(1," Purchase+Tax "),a())}function Wx(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.VariantName)}}function Nx(i,s){if(i&1&&(n(0,"td",29)(1,"a",32),p(2),d(3,"amountFraction"),a()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",Ut(4,bx,r.pageData.Filter.GroupByProduct?null:e.ID,r.pageData.Filter.GroupByProduct?e.ID:null,r.dateFromString(),r.dateToString())),o(),D(" ",g(3,2,e.UnitPrice)," ")}}function Ax(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function Gx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetPrice)," ")}}function Hx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function Qx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PurchaseNTax)," ")}}function Yx(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",31),p(5),a()(),S(6,Wx,2,1,"td"),n(7,"td"),p(8),a(),n(9,"td",29),p(10),d(11,"number"),a(),n(12,"td",29),p(13),d(14,"quantityFraction"),a(),S(15,Nx,4,9,"td",29),S(16,Ax,3,3,"td",29),S(17,Gx,3,3,"td",29),S(18,Hx,3,3,"td",29),S(19,Qx,3,3,"td",29),a()),i&2){let e=s.$implicit,r=s.$index,t=m(2);o(2),F(r+1),o(2),c("routerLink",X(17,Fx,t.pageData.Filter.GroupByProduct?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",X(19,Ix,e.ID)),o(),F(e.Name),o(),y(t.pageData.Filter.GroupByProduct?-1:6),o(2),D(" ",t.pageData.Filter.GroupByProduct?e.ProductCode:e.VariantCode," "),o(2),F(g(11,13,e.Order)),o(3),F(g(14,15,e.Quantity)),o(2),y(t.roleService.product.Cost?15:-1),o(),y(t.roleService.product.Cost?16:-1),o(),y(t.roleService.product.Cost?17:-1),o(),y(t.roleService.product.Cost?18:-1),o(),y(t.roleService.product.Cost?19:-1)}}function jx(i,s){i&1&&b(0,"td")}function qx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"UnitPrice"))," ")}}function Ux(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Gross"))," ")}}function zx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"NetPrice"))," ")}}function Kx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"Tax"))," ")}}function Xx(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.infiniteList,"PurchaseNTax"))," ")}}function Jx(i,s){if(i&1){let e=I();n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16)(4,"thead",17),P("matSortChange",function(t){u(e);let l=m();return _(l.onSortChange(t))}),n(5,"tr")(6,"th",18),p(7,"No"),a(),n(8,"th"),p(9,"Product"),a(),S(10,Vx,2,0,"th"),n(11,"th",19),p(12,"Code"),a(),n(13,"th",20),p(14," Orders "),a(),n(15,"th",21),p(16," Quantity "),a(),S(17,Bx,2,0,"th",22),S(18,Ox,2,0,"th",23),S(19,Lx,2,0,"th",24),S(20,Rx,2,0,"th",25),S(21,kx,2,0,"th",26),a()(),n(22,"tbody"),G(23,Yx,20,21,"tr",null,Y),a(),n(25,"tfoot")(26,"tr",27),b(27,"td"),S(28,jx,1,0,"td"),b(29,"td",28),n(30,"td"),p(31,"Total :"),a(),n(32,"td",29),p(33),d(34,"sum"),d(35,"number"),a(),n(36,"td",29),p(37),d(38,"sum"),d(39,"quantityFraction"),a(),S(40,qx,4,6,"td",29),S(41,Ux,4,6,"td",29),S(42,zx,4,6,"td",29),S(43,Kx,4,6,"td",29),S(44,Xx,4,6,"td",29),a()()()(),n(45,"infinite-pagination",30),P("nextPage",function(){u(e);let t=m();return _(t.NextPage(!0))})("fetchTotalData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount"))})("concatAllData",function(){u(e);let t=m();return _(t.StoreRowsCountAPIResult("report/PurchasesByProductCount",!0))}),a()()()}if(i&2){let e=m();o(10),y(e.pageData.Filter.GroupByProduct?-1:10),o(7),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(),y(e.roleService.product.Cost?20:-1),o(),y(e.roleService.product.Cost?21:-1),o(2),H(e.infiniteList),o(5),y(e.pageData.Filter.GroupByProduct?-1:28),o(5),D(" ",g(35,23,v(34,20,e.infiniteList,"Order"))," "),o(4),D(" ",g(39,28,v(38,25,e.infiniteList,"Quantity"))," "),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.product.Cost?41:-1),o(),y(e.roleService.product.Cost?42:-1),o(),y(e.roleService.product.Cost?43:-1),o(),y(e.roleService.product.Cost?44:-1),o(),c("totalData",e.listTotal)("totalCurrentRow",e.infiniteList==null?null:e.infiniteList.length)("pageNumber",e.pageData.Filter.PageNumber)("nextPageDisabled",e.nextPageDisabled)("isFetchTotalData",e.pageData.HideStoreApiCount)("goToLast",e.goToLast)}}var Ta=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/PurchasesByProductList","ReportLoader/PurchasesByProductLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}GroupByRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];dateFromString=xi(()=>{let e=this.pageData.Filter.From;return e?new Date(e).toJSON():null});dateToString=xi(()=>{let e=this.pageData.Filter.To;return e?new Date(e).toJSON():null});openExportModal(){this.matDialog.open(K,{data:{title:"Product Bought Report",exportTypes:[{ID:"ReportExport/PurchasesByProductExport",Value:"Default",FileName:"Product Bought Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}onSortChange(e){let r=this.infiniteList.slice();if(!e.active||e.direction===""){this.infiniteList=this.originalData;return}this.infiniteList=r.sort((t,l)=>{let h=e.direction==="asc";return this.compare(t[e.active],l[e.active],h)})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-bought"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","GroupBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],["matSort","",1,"thead-light","sticky-top-thead",3,"matSortChange"],[2,"width","10px"],[2,"width","100px"],["mat-sort-header","Order","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Cost","arrowPosition","before",1,"text-end",2,"width","140px"],["mat-sort-header","Gross","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Purchase","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end",2,"width","120px"],["mat-sort-header","PurchaseNTax","arrowPosition","before",1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[3,"routerLink","queryParams"],["routerLink","/menu/Reports/Purchases_Report/History",3,"queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Text,T)||(t.pageData.Filter.Text=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Ex,3,0,"button",2),a(),n(3,"filters"),E(4,Mx,23,15,"ng-template",null,0,O),a(),S(6,Jx,46,30,"content"),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Text),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,Te,Ce,U,ti,se,re,Z,ne],encapsulation:2})};var Zx=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Pa=i=>({ID:i}),$x=()=>["/menu/Products/Catalog/Variants/Info"],eh=()=>["/menu/Contacts/Contact/Suppliers/Info/V2"],th=()=>["/menu/Products/Catalog/Products/Info"];function ih(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function nh(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product"),a(),n(3,"autocompleteV2",16),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),C("ngModel",e.pageData.Filter.ProductID),c("inputTextValue",e.pageData.ProductName)}}function ah(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Variant"),a(),n(3,"autocompleteV2",17),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),C("ngModel",e.pageData.Filter.VariantID),c("renderThumbnail",!0)("inputTextValue",e.pageData.VariantName)}}function oh(i,s){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Supplier"),a(),n(7,"autocompleteV2",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(8,"h6"),p(9,"Scope"),a(),n(10,"radio-options",9),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ByProduct,t)||(l.pageData.Filter.ByProduct=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.getListData())}),a()(),E(11,nh,4,2,"div",3)(12,ah,4,3,"div",3),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(17,"div",11)(18,"datepicker",12),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(19,"h6"),p(20,"Order By"),a(),n(21,"radio-options",13),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.OrderByNumber,t)||(l.pageData.Filter.OrderByNumber=t),_(t)}),a(),n(22,"h6"),p(23,"Currency"),a(),n(24,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(25,"h6"),p(26,"Brand"),a(),n(27,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),a()()}if(i&2){let e=m();o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.SupplierID),o(3),C("model",e.pageData.Filter.ByProduct),c("options",e.ScopeRadio),o(),c("ngIf",e.pageData.Filter.ByProduct),o(),c("ngIf",!e.pageData.Filter.ByProduct),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.pageData.Filter.OrderByNumber),c("options",e.OrderByRadio),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies),o(3),c("multiple",!1),C("ngModel",e.pageData.Filter.BrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands)}}function rh(i,s){i&1&&(n(0,"th",38),p(1,"Date"),a())}function lh(i,s){i&1&&(n(0,"th"),p(1,"Outlet"),a())}function ph(i,s){i&1&&(n(0,"th"),p(1," Supplier "),a())}function mh(i,s){i&1&&(n(0,"th",39),p(1," Fulfillment "),a())}function sh(i,s){i&1&&(n(0,"th"),p(1,"Product"),a())}function ch(i,s){i&1&&(n(0,"th",40),p(1," Qty "),a())}function dh(i,s){i&1&&(n(0,"th",41),p(1," Unit Quantity "),a())}function uh(i,s){i&1&&(n(0,"th",42)(1,"span",43),p(2," Cost "),a()())}function _h(i,s){i&1&&(n(0,"th",44)(1,"span",45),p(2," Gross "),a()())}function gh(i,s){i&1&&(n(0,"th",40),p(1," Item (%) "),a())}function Ch(i,s){i&1&&(n(0,"th",46),p(1," Item Disc "),a())}function fh(i,s){i&1&&(n(0,"th",40),p(1," Bill(%) "),a())}function xh(i,s){i&1&&(n(0,"th",46),p(1," Bill Disc "),a())}function hh(i,s){i&1&&(n(0,"th",47)(1,"span",48),p(2," Purchase + Tax "),a()())}function Sh(i,s){i&1&&(n(0,"th"),p(1,"Item Note"),a())}function yh(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Date,"dd MMM yyyy")," ")}}function Dh(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.EntityName)}}function vh(i,s){if(i&1&&(n(0,"td")(1,"a",50),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,eh))("queryParams",X(4,Pa,e.SupplierID)),o(),F(e.SupplierName)}}function wh(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.DeliveryStatus," ")}}function Th(i,s){if(i&1&&(n(0,"td")(1,"a",50),p(2),a()()),i&2){let e=m().$implicit;o(),c("routerLink",M(3,th))("queryParams",X(4,Pa,e.ProductID)),o(),F(e.Name)}}function Ph(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function Fh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.VariantUnitQuantity)," ")}}function Ih(i,s){if(i&1&&(n(0,"td",52),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.UnitPrice)," ")}}function bh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Gross)," ")}}function Eh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.Discount>0?g(2,1,e.Discount):"0"," ")}}function Mh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.ItemDiscountAmount>0?g(2,1,e.ItemDiscountAmount):"0"," ")}}function Vh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DiscountInvoice>0?g(2,1,e.DiscountInvoice):"0"," ")}}function Bh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",e.OrderDiscountAmount>0?g(2,1,e.OrderDiscountAmount):"0"," ")}}function Oh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PurchaseNTax)," ")}}function Lh(i,s){if(i&1&&b(0,"td",53),i&2){let e=m().$implicit;c("innerHTML",e.Note,Ee)}}function Rh(i,s){if(i&1&&(n(0,"tr",49),E(1,yh,3,4,"td",3)(2,Dh,2,1,"td",3),n(3,"td")(4,"a",50),p(5),a()(),E(6,vh,3,6,"td",3)(7,wh,2,1,"td",3)(8,Th,3,6,"td",3),n(9,"td")(10,"a",50),p(11),a()(),E(12,Ph,3,3,"td",30)(13,Fh,3,3,"td",30)(14,Ih,3,3,"td",35)(15,bh,3,3,"td",30)(16,Eh,3,3,"td",30)(17,Mh,3,3,"td",30)(18,Vh,3,3,"td",30)(19,Bh,3,3,"td",30)(20,Oh,3,3,"td",30)(21,Lh,1,1,"td",51),a()),i&2){let e=s.$implicit,r=m(2);o(),c("ngIf",r.column.Date.selected),o(),c("ngIf",r.column.Outlet.selected),o(2),c("routerLink",M(21,Zx))("queryParams",X(22,Pa,e.ID)),o(),D(" ",e.Number," "),o(),c("ngIf",r.column.Supplier.selected),o(),c("ngIf",r.column.Fulfillment.selected),o(),c("ngIf",r.pageData.Filter.ByProduct),o(2),c("routerLink",M(24,$x))("queryParams",X(25,Pa,e.VariantID)),o(),F(e.Model),o(),c("ngIf",r.column.Qty.selected),o(),c("ngIf",r.column.UnitQty.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.UnitCost.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.Gross.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.ItemPercentage.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.ItemDiscount.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.BillPercentage.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.BillDiscount.selected),o(),c("ngIf",r.roleService.product.Cost&&r.column.PurchaseNTax.selected),o(),c("ngIf",r.column.ItemNote.selected)}}function kh(i,s){i&1&&b(0,"td",34)}function Wh(i,s){i&1&&b(0,"td",34)}function Nh(i,s){i&1&&b(0,"td",34)}function Ah(i,s){i&1&&b(0,"td",34)}function Gh(i,s){i&1&&b(0,"td",34)}function Hh(i,s){i&1&&(n(0,"td",47),p(1," Total : "),a())}function Qh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function Yh(i,s){i&1&&b(0,"td",34)}function jh(i,s){if(i&1&&(n(0,"td",52),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"UnitPrice"))," ")}}function qh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Gross"))," ")}}function Uh(i,s){i&1&&b(0,"td",34)}function zh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ItemDiscountAmount"))," ")}}function Kh(i,s){i&1&&b(0,"td",34)}function Xh(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"OrderDiscountAmount"))," ")}}function Jh(i,s){if(i&1&&(n(0,"td",54),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"PurchaseNTax"))," ")}}function Zh(i,s){i&1&&b(0,"td",34)}function $h(i,s){if(i&1){let e=I();n(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr"),E(6,rh,2,0,"th",22)(7,lh,2,0,"th",3),n(8,"th",23),p(9,"Number"),a(),E(10,ph,2,0,"th",3)(11,mh,2,0,"th",24)(12,sh,2,0,"th",3),n(13,"th"),p(14,"Variant"),a(),E(15,ch,2,0,"th",25)(16,dh,2,0,"th",26)(17,uh,3,0,"th",27)(18,_h,3,0,"th",28)(19,gh,2,0,"th",25)(20,Ch,2,0,"th",29)(21,fh,2,0,"th",25)(22,xh,2,0,"th",29)(23,hh,3,0,"th",30)(24,Sh,2,0,"th",3),a()(),n(25,"tbody"),E(26,Rh,22,27,"tr",31),a(),n(27,"tfoot")(28,"tr",32),E(29,kh,1,0,"td",33)(30,Wh,1,0,"td",33),b(31,"td",34),E(32,Nh,1,0,"td",33)(33,Ah,1,0,"td",33)(34,Gh,1,0,"td",33)(35,Hh,2,0,"td",30)(36,Qh,4,6,"td",30)(37,Yh,1,0,"td",33)(38,jh,4,6,"td",35)(39,qh,4,6,"td",30)(40,Uh,1,0,"td",33)(41,zh,4,6,"td",30)(42,Kh,1,0,"td",33)(43,Xh,4,6,"td",30)(44,Jh,4,6,"td",36)(45,Zh,1,0,"td",33),a()()()(),n(46,"POS-complex-pagination",37),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=m();o(6),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Outlet.selected),o(3),c("ngIf",e.column.Supplier.selected&&e.column.Supplier.selected),o(),c("ngIf",e.column.Fulfillment.selected),o(),c("ngIf",e.pageData.Filter.ByProduct),o(3),c("ngIf",e.column.Qty.selected),o(),c("ngIf",e.column.UnitQty.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.UnitCost.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.Gross.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.ItemPercentage.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.ItemDiscount.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.BillPercentage.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.BillDiscount.selected),o(),c("ngIf",e.roleService.product.Cost&&e.column.PurchaseNTax.selected),o(),c("ngIf",e.column.ItemNote.selected),o(2),c("ngForOf",e.data.Data),o(3),c("ngIf",e.column.Date.selected),o(),c("ngIf",e.column.Outlet.selected),o(2),c("ngIf",e.column.Supplier.selected),o(),c("ngIf",e.column.Fulfillment.selected),o(),c("ngIf",e.pageData.Filter.ByProduct),o(),c("ngIf",e.column.Qty.selected||e.column.PurchaseNTax.selected),o(),c("ngIf",e.column.Qty.selected),o(),c("ngIf",e.column.UnitQty.selected),o(),c("ngIf",e.column.UnitCost.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.Gross.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.ItemPercentage.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.ItemDiscount.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.BillPercentage.selected&&e.roleService.product.Cost),o(),c("ngIf",e.column.BillDiscount.selected&&e.roleService.product.Cost),o(),c("ngIf",e.roleService.product.Cost&&e.column.PurchaseNTax.selected),o(),c("ngIf",e.column.ItemNote.selected),o(),c("total",e.data.Data.length)("pageData",e.pageData)}}var Fa=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/ProductPurchaseHistory","ReportLoader/ProductPurchaseHistoryLoader",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=h;this.matDialog=T}columnService=Pe(gt);column={Date:{selected:!0},Outlet:{selected:!0},Supplier:{selected:!0},Fulfillment:{selected:!1},Qty:{selected:!0,name:"Quantity"},UnitQty:{selected:!1,name:"Unit Quantity"},UnitCost:{selected:!1,name:"Unit Cost"},Gross:{selected:!0,name:"Gross Purchase"},ItemPercentage:{selected:!1,name:"Item (%)"},ItemDiscount:{selected:!1,name:"Item Disc"},BillPercentage:{selected:!1,name:"Bill (%)"},BillDiscount:{selected:!1,name:"Bill Disc"},PurchaseNTax:{selected:!0,name:"Purchase N Tax"},ItemNote:{selected:!1,name:"Item Note"}};ScopeRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];OrderByRadio=[{Key:!0,Value:"Date & Number"},{Key:!1,Value:"Supplier"}];hideMore=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Product Purchase History",exportTypes:[{ID:"ReportExport/ProductPurchaseHistory",Value:"Default",FileName:"Product Purchase History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){let e=this.activatedRoute.snapshot?.queryParams;this.pageData.Filter.From=!e.VariantID&&e.From?e.From:e.VariantID?null:this.pageData.Filter.From,this.pageData.Filter.To=!e.VariantID&&e.To?e.To:e.VariantID?null:this.pageData.Filter.To,this.pageData.Filter.VariantID=V.IsNotEmpty(e.VariantID)?e.VariantID:V.GuidEmpty,this.pageData.Filter.ProductID=V.IsNotEmpty(e.ProductID)?e.ProductID:V.GuidEmpty,this.pageData.Filter.ByProduct=V.IsNotEmpty(e.ProductID),V.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}afterPostInit(e){this.checkForAdvancedColumn()}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data.Data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-purchase-history"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","Scope",3,"modelChange","model","options"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","OrderBy",3,"modelChange","model","options"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","multiple","ngModel","items"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search Product",1,"w-100","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail","inputTextValue"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 100px",4,"ngIf"],[2,"width","70px"],["style","width: 80px",4,"ngIf"],["style","width: 50px","class","text-end",4,"ngIf"],["style","width: 60px","class","text-end",4,"ngIf"],["style","width: 75px","class","text-end",4,"ngIf"],["style","width: 75px","class","text-end","title","Original cost multiplied by quantity",4,"ngIf"],["style","width: 70px","class","text-end",4,"ngIf"],["class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],["class","text-end text-danger",4,"ngIf"],["class","text-end","colspan","6",4,"ngIf"],["api","report/ProductPurchaseHistoryCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[2,"width","100px"],[2,"width","80px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","60px"],[1,"text-end",2,"width","75px"],["matTooltip","Original Cost for One Quantity Before Discount & Tax","matTooltipPosition","above"],["title","Original cost multiplied by quantity",1,"text-end",2,"width","75px"],["matTooltip","Unit Cost Multiplied by Quantity","matTooltipPosition","above"],[1,"text-end",2,"width","70px"],[1,"text-end"],["matTooltip","Gross Purchase After Discount & Tax","matTooltipPosition","above"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"innerHTML",4,"ngIf"],[1,"text-end","text-danger"],[3,"innerHTML"],["colspan","6",1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,ih,3,0,"button",2),a(),n(3,"filters"),E(4,oh,28,18,"ng-template",null,0,O),a(),E(6,$h,47,34,"content",3),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,L,R,ie,Te,Ae,Et,U,se,oe,Z,ne],encapsulation:2})};var e2=()=>["/menu/Reports/Purchases_Report/Daily/Monthly"];function t2(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function i2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",6)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",8),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Month"),a(),n(13,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Month,t)||(l.pageData.Filter.Month=t),_(t)}),a(),n(14,"h6"),p(15,"Currency"),a(),n(16,"ng-select",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(17,"h6"),p(18,"Multiply Unit Qty"),a(),n(19,"radio-options",12),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.Month),c("items",e.Months),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),C("model",e.pageData.Filter.MultiplyUnitQuantity),c("options",e.YesNoRadio)}}function n2(i,s){i&1&&(n(0,"th",17),p(1," Purchases "),a())}function a2(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.PurchaseTotal)," ")}}function o2(i,s){if(i&1&&(n(0,"tr",18)(1,"td"),p(2),d(3,"date"),a(),n(4,"td",17),p(5),d(6,"number"),a(),n(7,"td",17),p(8),d(9,"quantityFraction"),a(),S(10,a2,3,3,"td",17),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(v(3,4,e.Date,"EEEE")),o(3),F(g(6,7,e.Day)),o(3),F(g(9,9,e.Quantity)),o(2),y(r.roleService.product.Cost?10:-1)}}function r2(i,s){if(i&1&&(n(0,"td",17),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"PurchaseTotal"))," ")}}function l2(i,s){if(i&1&&(n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15)(4,"thead",16)(5,"tr")(6,"th"),p(7,"Day"),a(),n(8,"th",17),p(9,"Date (Day)"),a(),n(10,"th",17),p(11,"Quantity"),a(),S(12,n2,2,0,"th",17),a()(),n(13,"tbody"),G(14,o2,11,11,"tr",18,Y),a(),n(16,"tr")(17,"td",19),p(18,"Total"),a(),n(19,"td",17),p(20),d(21,"sum"),d(22,"quantityFraction"),a(),S(23,r2,4,6,"td",17),a()()()()()),i&2){let e=m();o(12),y(e.roleService.product.Cost?12:-1),o(2),H(e.data.Data),o(6),D(" ",g(22,6,v(21,3,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?23:-1)}}var Ia=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/GetPurchasePeriodDaily","ReportLoader/GetReportPurchaseDaily");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Months=V.Months}Years=[];Months=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Daily",exportTypes:[{ID:"ReportExport/DailyPurchaseReport",Value:"Default",FileName:"Purchase Daily"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-daily-purchases"]],standalone:!1,features:[W],decls:9,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","placeholder","Choose Month","bindLabel","Label","bindValue","ID",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"border-bottom"],["colspan","2",1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,t2,3,0,"button",2),n(3,"a",3),p(4,"View Month"),a()(),n(5,"filters"),E(6,i2,20,14,"ng-template",null,0,O),a(),S(8,l2,24,8,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,e2)),o(5),y(t.data?8:-1))},dependencies:[A,Q,$,L,R,ie,Te,Ce,U,se,re,oe,Z,ne],encapsulation:2})};var p2=()=>["/menu/Reports/Purchases_Report/Daily"];function m2(i,s){if(i&1){let e=I();n(0,"button",12),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",13),p(2," Export "),a()}}function s2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",14)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",15),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",16),x("selectedCategoryIDChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",17),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(11,"h6"),p(12,"Currency"),a(),n(13,"ng-select",18),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a(),n(14,"h6"),p(15,"Multiply Unit Qty"),a(),n(16,"radio-options",19),x("modelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.MultiplyUnitQuantity,t)||(l.pageData.Filter.MultiplyUnitQuantity=t),_(t)}),a(),n(17,"h6"),p(18,"Supplier"),a(),n(19,"autocompleteV2",20),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options.Currencies),o(3),C("model",e.pageData.Filter.MultiplyUnitQuantity),c("options",e.YesNoRadio),o(3),C("ngModel",e.pageData.Filter.SupplierID)}}function c2(i,s){i&1&&(n(0,"th",8),p(1,"Purchases"),a())}function d2(i,s){if(i&1&&(n(0,"td",8),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Income)," ")}}function u2(i,s){if(i&1&&(n(0,"tr",9)(1,"td"),p(2),a(),n(3,"td",8),p(4),d(5,"quantityFraction"),a(),S(6,d2,3,3,"td",8),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.MonthLabel),o(2),F(g(5,3,e.Quantity)),o(2),y(r.roleService.product.Cost?6:-1)}}function _2(i,s){if(i&1&&(n(0,"td",8),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Income"))," ")}}function g2(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,m2,3,0,"button",3),n(3,"a",4),p(4,"View Daily"),a()(),n(5,"filters"),E(6,s2,20,13,"ng-template",null,0,O),a(),n(8,"content")(9,"div",5)(10,"table",6)(11,"thead",7)(12,"tr")(13,"th"),p(14,"Month"),a(),n(15,"th",8),p(16,"Quantity"),a(),S(17,c2,2,0,"th",8),a()(),n(18,"tbody"),G(19,u2,7,5,"tr",9,Y),a(),n(21,"tr",10)(22,"td",11),p(23,"Total"),a(),n(24,"td",8),p(25),d(26,"sum"),d(27,"quantityFraction"),a(),S(28,_2,4,6,"td",8),a()()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(),c("routerLink",M(14,p2)),o(14),y(e.roleService.product.Cost?17:-1),o(2),H(e.data.Data),o(6),D(" ",g(27,12,v(26,9,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?28:-1)}}var ba=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/GetPurchasePeriodMonthly","ReportLoader/GetReportPurchaseMonthly");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0)}Years=[];YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Monthly",exportTypes:[{ID:"ReportExport/MonthlyPurchaseReport",Value:"Default",FileName:"Purchase Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-monthly-purchase"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"border-bottom"],[1,"table-footer"],["colspan","1",1,"fw-bold","text-start","ps-4"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","ngModel","items"],["name","GroupBy",3,"modelChange","model","options"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"]],template:function(r,t){r&1&&S(0,g2,29,15,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,$,L,R,ie,Te,Ae,Ce,U,se,Z,ne],encapsulation:2})};function C2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",2)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",3),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",4),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"Year"),a(),n(10,"ng-select",5),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.Year),c("items",e.Years)}}function f2(i,s){if(i&1&&(n(0,"content")(1,"div",6),b(2,"POS-line-chart",7),a()()),i&2){let e=m();o(2),c("config",e.chartConfig)("data",e.ChartData)}}var Ea=class i extends me{constructor(e,r,t){super(e,r,"Report/MonthlyPurchasesVolume","ReportLoader/GetMonthlyPurchaseVolume");this.httpService=r;let l=new Date;this.Years=V.GenerateYears(l.getFullYear(),11,!0)}Years=[];ChartData={};chartConfig;preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}preInitList(){let e={ID:0,Symbol:"All"};this.pageData.Options.Currencies.unshift(e),this.pageData.Filter.CurrencyID=0}postInit(){let e=[];this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.Data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}},this.data.PageTitle!=null&&(this.menuData.H=this.data.PageTitle),this.data.Data.MonthlySalesRank.forEach((r,t)=>{let l={name:this.data.Data.MonthName[t],data:r.Sales};e.push(l)}),this.ChartData={series:e}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-volume"]],standalone:!1,features:[W],decls:6,vars:5,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet","appendTo","body",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),b(1,"actions"),n(2,"filters"),E(3,C2,11,8,"ng-template",null,0,O),a(),S(5,f2,3,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(5),y(t.data?5:-1))},dependencies:[A,$,L,R,Mt,Ce,U],encapsulation:2})};var x2=()=>["/menu/Products/Catalog/Products/Info"],h2=i=>({ID:i});function S2(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export"),a()}}function y2(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"Category"),a(),n(7,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(8,"h6"),p(9,"From - To"),a(),n(10,"div")(11,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(12,"div",9)(13,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2),C("ngModel",e.pageData.Filter.ListIDs),c("multiple",!0)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function D2(i,s){if(i&1&&(n(0,"tr",20)(1,"td"),p(2),a(),n(3,"td")(4,"a",21),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a(),n(11,"td",22),p(12),d(13,"quantityFraction"),a(),n(14,"td",23),p(15),d(16,"number"),a()()),i&2){let e=s.$implicit,r=s.$index;o(2),F(r+1),o(2),c("routerLink",M(14,x2))("queryParams",X(15,h2,e.ID)),o(),D(" ",e.Name," "),o(2),F(e.Code),o(2),F(g(10,8,e.PurchaseQuantity)),o(3),F(g(13,10,e.SellQuantity)),o(3),F(g(16,12,e.Ratio))}}function v2(i,s){if(i&1&&(n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),p(7," Now "),a(),n(8,"th",17),p(9,"Name"),a(),n(10,"th",18),p(11,"Code"),a(),n(12,"th",19),p(13,"Purchase"),a(),n(14,"th",19),p(15,"Sold"),a(),n(16,"th",19),p(17,"Sold Percentage(%)"),a()()(),n(18,"tbody"),G(19,D2,17,17,"tr",20,Y),a()()()()()),i&2){let e=m();o(19),H(e.data.Data)}}var Ma=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/PruchasedSalesReportList","ReportLoader/PurchaseSalesReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}GroupRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Sales Report",exportTypes:[{ID:"ReportExport/PurchasedSalesReportList",Value:"Default",FileName:"Purchase Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-sales-report"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","55px"],[2,"width","320px"],[2,"width","100px"],[1,"text-end",2,"width","80px"],[1,"border-bottom"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,S2,3,0,"button",2),a(),n(3,"filters"),E(4,y2,17,10,"ng-template",null,0,O),a(),S(6,v2,21,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,Qe,L,R,Ue,Ce,U,re,ne],encapsulation:2})};var w2=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"],T2=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],P2=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),F2=(i,s,e)=>({EntityID:i,From:s,To:e}),I2=()=>["/menu/Reports/Purchases_Report/Summary"];function b2(i,s){if(i&1){let e=I();n(0,"button",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function E2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Compare with Prev Month"),a(),n(3,"radio-options",14),x("modelChange",function(t){u(e);let l=m(2);return f(l.isCompare,t)||(l.isCompare=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),C("model",e.isCompare)}}function M2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"From - To"),a(),n(3,"div")(4,"datepicker",15),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(5,"div",16)(6,"datepicker",17),x("dateChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function V2(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Year - Month"),a(),n(3,"div",18)(4,"div",19)(5,"ng-select",20),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Year=null)}),a()(),n(6,"div",21)(7,"ng-select",22),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Month=null)}),a()()()()}if(i&2){let e=m(2);o(5),C("ngModel",e.Year),c("items",e.Years),o(2),C("ngModel",e.Month),c("items",e.Months)}}function B2(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",10),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"Purchase Order Tag"),a(),n(6,"ng-select",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"Date Filter"),a(),n(9,"radio-options",12),x("modelChange",function(t){u(e);let l=m();return f(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),P("modelChange",function(){u(e);let t=m();return _(t.YearMonthToDateRange())}),a(),S(10,E2,4,1,"div"),S(11,M2,7,2,"div"),S(12,V2,8,4,"div"),n(13,"h6"),p(14,"Exclude Complementary"),a(),n(15,"radio-options",13),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ExcludeComplementary,t)||(l.pageData.Filter.ExcludeComplementary=t),_(t)}),a()()}if(i&2){let e=m();o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),C("model",e.IsPredefined),c("options",e.RadioDateFilterType),o(),y(e.IsPredefined?10:-1),o(),y(e.IsPredefined?-1:11),o(),y(e.IsPredefined?12:-1),o(3),C("model",e.pageData.Filter.ExcludeComplementary)}}function O2(i,s){i&1&&(n(0,"th",28),p(1," Prev "),a())}function L2(i,s){i&1&&(n(0,"th",29),p(1," Now "),a())}function R2(i,s){i&1&&(n(0,"th",30),p(1," Orders "),a())}function k2(i,s){i&1&&(n(0,"th",32),p(1," Purchase "),a())}function W2(i,s){if(i&1&&(n(0,"th",33),p(1," Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet")}}function N2(i,s){if(i&1&&(n(0,"th",34),p(1," Purchase+Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function A2(i,s){if(i&1&&(n(0,"td",38),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function G2(i,s){if(i&1&&(n(0,"td",40),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,P2,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function H2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",v(2,1,e.Count,".0-0")," ")}}function Q2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function Y2(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function j2(i,s){if(i&1&&(n(0,"td",38)(1,"a",41),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("queryParams",_t(11,F2,e.EntityID,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy")))("routerLink",M(15,I2)),o(4),F(g(6,9,e.SalesWithTax))}}function q2(i,s){if(i&1&&(n(0,"tr")(1,"td",36),p(2),a(),S(3,A2,2,1,"td",38),S(4,G2,2,5,"td",40),S(5,H2,3,4,"td",38),n(6,"td",38),p(7),d(8,"quantityFraction"),a(),S(9,Q2,3,3,"td",38),S(10,Y2,3,3,"td",39),d(11,"HideSumZero"),S(12,j2,7,16,"td",38),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(),y(r.data.WithCategory?-1:5),o(2),F(g(8,8,e.Quantity)),o(2),y(r.roleService.product.Cost?9:-1),o(),y(!r.data.WithCategory&&v(11,10,r.data.Data,"Tax")&&r.roleService.product.Cost?10:-1),o(2),y(!r.data.WithCategory&&r.roleService.product.Cost?12:-1)}}function U2(i,s){i&1&&b(0,"td",37)}function z2(i,s){i&1&&b(0,"td",37)}function K2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Count"),".0-0")," ")}}function X2(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Sales"))," ")}}function J2(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function Z2(i,s){if(i&1&&(n(0,"td",38)(1,"a"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function $2(i,s){if(i&1){let e=I();n(0,"content")(1,"div",23)(2,"div",24)(3,"table",25),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",26)(5,"tr")(6,"th",27),p(7,"Outlet"),a(),S(8,O2,2,0,"th",28),S(9,L2,2,0,"th",29),S(10,R2,2,0,"th",30),n(11,"th",31),p(12," Qty "),a(),S(13,k2,2,0,"th",32),S(14,W2,2,1,"th",33),d(15,"HideSumZero"),S(16,N2,2,1,"th",34),a()(),n(17,"tbody"),G(18,q2,13,13,"tr",null,Y),a(),n(20,"tfoot")(21,"tr",35),b(22,"td",36),S(23,U2,1,0,"td",37),S(24,z2,1,0,"td",37),S(25,K2,4,7,"td",38),n(26,"td",38),p(27),d(28,"sum"),d(29,"quantityFraction"),a(),S(30,X2,4,6,"td",38),S(31,J2,4,6,"td",39),d(32,"HideSumZero"),S(33,Z2,5,6,"td",38),a()()()()()()}if(i&2){let e=m();o(8),y(e.showCompareColumn?8:-1),o(),y(e.showCompareColumn?9:-1),o(),y(e.data.WithCategory?-1:10),o(3),y(e.roleService.product.Cost?13:-1),o(),y(!e.data.WithCategory&&v(15,13,e.data.Data,"Tax")&&e.roleService.product.Cost?14:-1),o(2),y(!e.data.WithCategory&&e.roleService.product.Cost?16:-1),o(2),H(e.data.Data),o(5),y(e.showCompareColumn?23:-1),o(),y(e.showCompareColumn?24:-1),o(),y(e.data.WithCategory?-1:25),o(2),D(" ",g(29,19,v(28,16,e.data.Data,"Quantity"))," "),o(3),y(e.roleService.product.Cost?30:-1),o(),y(!e.data.WithCategory&&v(32,21,e.data.Data,"Tax")&&e.roleService.product.Cost?31:-1),o(2),y(!e.data.WithCategory&&e.roleService.product.Cost?33:-1)}}var Va=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/OutletPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Year=T.getFullYear(),this.Month=T.getMonth()+1,this.Months=V.Months,this.Months.forEach(Ze=>Ze.Label=Ze.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Comparison=0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Purchase Performance",exportTypes:[{ID:"ReportExport/OutletPerformancePurchase",Value:"Default",FileName:"Outlet Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){this.YearMonthToDateRange()}postInit(e){this.menuData.H=e?.PageTitle,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month-1,1),this.pageData.Filter.To=new Date(this.Year,this.Month,0)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Count":return V.compare(t.Count,l.Count,h);case"SalesWithTax":return V.compare(t.SalesWithTax,l.SalesWithTax,h);case"Quantity":return V.compare(t.Quantity,l.Quantity,h);case"SalesNet":return V.compare(t.Sales,l.Sales,h);case"SalesTaxNet":return V.compare(t.Sales,l.Sales,h);case"Tax":return V.compare(t.Tax,l.Tax,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-performance"]],standalone:!1,features:[W],decls:17,vars:10,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","Date Filter",3,"modelChange","model","options"],["name","complementary",3,"modelChange","model"],["name","compare",3,"modelChange","model"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"freeze","header"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","100px"],["arrowPosition","before",1,"flex-right",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"flex-right",2,"width","150px",3,"mat-sort-header"],[1,"footer"],[1,"freeze","body"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end",3,"ngClass"],[3,"queryParams","routerLink"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,b2,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," Compare by Outlet Group "),a()(),n(10,"li")(11,"a",6),p(12," Compare by Month "),a()()()()(),n(13,"filters"),E(14,B2,16,10,"ng-template",null,0,O),a(),S(16,$2,34,24,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,w2)),o(3),c("routerLink",M(9,T2)),o(5),y(t.data?16:-1))},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,Ce,se,ei,re,oe,Z,ne],encapsulation:2})};var eS=()=>["/menu/Reports/Purchases_Report/Outlet"],tS=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"],iS=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),nS=(i,s)=>({"text-danger":i,"text-success":s,"text-end":!0});function aS(i,s){if(i&1){let e=I();n(0,"button",24),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",25),p(2," Export"),a()}}function oS(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"From - To"),a(),n(2,"div")(3,"datepicker",29),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(4,"div",30)(5,"datepicker",31),x("dateChange",function(t){u(e);let l=m(3);return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()}if(i&2){let e=m(3);o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function rS(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Year - Month"),a(),n(2,"div",32)(3,"div",33)(4,"ng-select",34),x("ngModelChange",function(t){u(e);let l=m(3);return f(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(3);return _(t.Year=null)}),a()(),n(5,"div",35)(6,"ng-select",36),x("ngModelChange",function(t){u(e);let l=m(3);return f(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(3);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(3);return _(t.Month=null)}),a()()()}if(i&2){let e=m(3);o(4),C("ngModel",e.Year),c("items",e.Years),o(2),C("ngModel",e.Month),c("items",e.Months)}}function lS(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Compare with Prev Month"),a(),n(2,"radio-options",37),x("modelChange",function(t){u(e);let l=m(3);return f(l.isCompare,t)||(l.isCompare=t),_(t)}),a()}if(i&2){let e=m(3);o(2),C("model",e.isCompare)}}function pS(i,s){if(i&1){let e=I();n(0,"div")(1,"div",26)(2,"h6"),p(3,"Date Filter"),a(),n(4,"radio-options",27),x("modelChange",function(t){u(e);let l=m(2);return f(l.IsPredefined,t)||(l.IsPredefined=t),_(t)}),a(),S(5,oS,6,2),S(6,rS,7,4),n(7,"h6"),p(8,"Purchase Order Tag"),a(),n(9,"ng-select",28),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),S(10,lS,3,1),a()()}if(i&2){let e=m(2);o(4),C("model",e.IsPredefined),c("options",e.RadioDateFilterType),o(),y(e.IsPredefined?-1:5),o(),y(e.IsPredefined?6:-1),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(),y(e.IsPredefined?10:-1)}}function mS(i,s){i&1&&(n(0,"th",12),p(1,"Prev"),a())}function sS(i,s){i&1&&(n(0,"th",13),p(1,"Now"),a())}function cS(i,s){i&1&&(n(0,"th",17),p(1," \xB1 (%) "),a())}function dS(i,s){if(i&1&&(n(0,"td",22),p(1),a()),i&2){let e=m().$implicit;o(),D(" ",e.PrevIndex," ")}}function uS(i,s){if(i&1&&(n(0,"td",38),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,iS,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function _S(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;c("ngClass",fe(5,nS,e.IsNegative,e.IsPositive)),o(),D(" ",v(2,2,e.Increase,".0-0")," ")}}function gS(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),S(3,dS,2,1,"td",22),S(4,uS,2,5,"td",38),n(5,"td",22),p(6),d(7,"number"),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a(),n(11,"td",22),p(12),d(13,"amountFraction"),a(),S(14,_S,3,8,"td",39),n(15,"td",23),p(16),d(17,"amountFraction"),a(),n(18,"td",22),p(19),d(20,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Name),o(),y(r.showCompareColumn?3:-1),o(),y(r.showCompareColumn?4:-1),o(2),F(v(7,9,e.Count,".0-0")),o(3),F(g(10,12,e.Quantity)),o(3),F(g(13,14,e.Sales)),o(2),y(r.showCompareColumn?14:-1),o(2),F(g(17,16,e.Tax)),o(3),D(" ",g(20,18,e.SalesWithTax)," ")}}function CS(i,s){i&1&&b(0,"td",21)}function fS(i,s){i&1&&b(0,"td",21)}function xS(i,s){i&1&&b(0,"td")}function hS(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,aS,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Month "),a()()()()(),n(13,"filters"),E(14,pS,11,7,"ng-template",null,0,O),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr")(21,"th",11),p(22,"Outlet"),a(),S(23,mS,2,0,"th",12),S(24,sS,2,0,"th",13),n(25,"th",14),p(26,"Orders "),a(),n(27,"th",15),p(28," Quantity"),a(),n(29,"th",16),p(30," Purchase"),a(),S(31,cS,2,0,"th",17),n(32,"th",18),p(33,"Tax"),a(),n(34,"th",19),p(35,"Purchase + Tax"),a()()(),n(36,"tbody"),G(37,gS,21,20,"tr",null,Y),a(),n(39,"tfoot")(40,"tr",20),S(41,CS,1,0,"td",21),S(42,fS,1,0,"td",21),b(43,"td",21),n(44,"td",22),p(45),d(46,"sum"),d(47,"number"),a(),n(48,"td",22),p(49),d(50,"sum"),d(51,"quantityFraction"),a(),n(52,"td",22),p(53),d(54,"sum"),d(55,"amountFraction"),a(),S(56,xS,1,0,"td"),n(57,"td",23),p(58),d(59,"sum"),d(60,"amountFraction"),a(),n(61,"td",22)(62,"a"),p(63),d(64,"sum"),d(65,"amountFraction"),a()()()()()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(6),c("routerLink",M(46,eS)),o(3),c("routerLink",M(47,tS)),o(12),y(e.showCompareColumn?23:-1),o(),y(e.showCompareColumn?24:-1),o(7),y(e.showCompareColumn?31:-1),o(),c("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet"),o(2),c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet"),o(3),H(e.data==null?null:e.data.Data),o(4),y(e.showCompareColumn?41:-1),o(),y(e.showCompareColumn?42:-1),o(3),F(v(47,23,v(46,20,e.data==null?null:e.data.Data,"Count"),".0-0")),o(4),F(g(51,29,v(50,26,e.data==null?null:e.data.Data,"Quantity"))),o(4),D(" ",g(55,34,v(54,31,e.data==null?null:e.data.Data,"Sales"))," "),o(3),y(e.showCompareColumn?56:-1),o(2),D(" ",g(60,39,v(59,36,e.data==null?null:e.data.Data,"Tax"))," "),o(5),F(g(65,44,v(64,41,e.data==null?null:e.data.Data,"SalesWithTax")))}}var Ba=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/OutletGroupPerformancePurchase","ReportLoader/OutletPurchasePerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0),this.Year=T.getFullYear(),this.Month=T.getMonth(),this.Months=V.Months,this.Months.forEach(Ze=>Ze.Label=Ze.Label.slice(0,3))}isCompare=!1;showCompareColumn=!1;IsPredefined=!0;Years;Year;Month;Months;RadioDateFilterType=[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}];first=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Purchase Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformancePurchase",Value:"Default",FileName:"Outlet Group Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.first&&(this.YearMonthToDateRange(),this.first=!1)}postInit(){this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=r;return}this.data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Count":return this.compare(t.Count,l.Count,h);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"SalesNet":return this.compare(t.Sales,l.Sales,h);case"SalesTaxNet":return this.compare(t.Sales,l.Sales,h);case"Tax":return this.compare(t.Tax,l.Tax,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-group-performance"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","100px"],["mat-sort-header","Count","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],[1,"text-end",2,"width","100px"],["arrowPosition","before",1,"text-end",2,"width","100px",3,"mat-sort-header"],["arrowPosition","before",1,"text-end",2,"width","150px",3,"mat-sort-header"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","Date Filter",3,"modelChange","model","options"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModelChange","change","clear","ngModel","items"],["name","compare",3,"modelChange","model"],[1,"text-end",3,"ngClass"],[3,"ngClass"]],template:function(r,t){r&1&&S(0,hS,66,48,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,se,re,Z,ne],encapsulation:2})};var SS=()=>["/menu/Reports/Purchases_Report/Outlet"],yS=()=>["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"];function DS(i,s){if(i&1){let e=I();n(0,"button",12),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",13),p(2," Export"),a()}}function vS(i,s){if(i&1){let e=I();n(0,"div")(1,"div",14)(2,"h6"),p(3,"Year"),a(),n(4,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.Year,t)||(l.pageData.Filter.Year=t),_(t)}),a(),n(5,"h6"),p(6,"Purchase Order Tag"),a(),n(7,"ng-select",16),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()()}if(i&2){let e=m(2);o(4),C("ngModel",e.pageData.Filter.Year),c("items",e.Years),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)}}function wS(i,s){if(i&1&&(n(0,"th",11),p(1),a()),i&2){let e=s.$implicit;c("mat-sort-header",e),o(),F(e)}}function TS(i,s){if(i&1&&(n(0,"p",17),p(1),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(r[e])}}function PS(i,s){if(i&1&&(n(0,"p",17),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m().$implicit;o(),F(g(2,1,r[e]))}}function FS(i,s){if(i&1&&(n(0,"td"),S(1,TS,2,1,"p",17),S(2,PS,3,3,"p",17),a()),i&2){let e=s.$implicit;o(),y(e=="Outlet"?1:-1),o(),y(e!="Outlet"?2:-1)}}function IS(i,s){if(i&1&&(n(0,"tr"),G(1,FS,3,2,"td",null,Y),a()),i&2){let e=s.$implicit,r=m(2);o(),H(r.getKey(e))}}function bS(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),F(g(2,1,e))}}function ES(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",18)(2,"td"),p(3,"Total : "),a(),G(4,bS,3,3,"td",null,Y),a()()),i&2){let e=m(2);o(4),H(e.data.DataFooter)}}function MS(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions"),S(2,DS,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," Outlet Report By "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Outlet Performance "),a()(),n(10,"li")(11,"a",7),p(12," Compare by Outlet Group "),a()()()()(),n(13,"filters"),E(14,vS,8,4,"ng-template",null,0,O),a(),n(16,"content")(17,"div",8)(18,"table",9),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(19,"thead",10)(20,"tr"),G(21,wS,2,2,"th",11,Y),a()(),n(23,"tbody"),G(24,IS,3,0,"tr",null,Y),a(),S(26,ES,6,0,"tfoot"),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(2),y(e.roleService.global.Export?2:-1),o(6),c("routerLink",M(8,SS)),o(3),c("routerLink",M(9,yS)),o(10),H(e.data.Dataheader),o(3),H(e.data.Data),o(2),y(e.data.Data.length>0?26:-1)}}var Oa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/MonthlyOutletPerformancePurchase","ReportLoader/MonthlyReportPurchase");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Years=V.GenerateYears(T.getFullYear(),11,!0)}Years;openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Group Monthly Purchase Performance",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformancePurchase",Value:"Default",FileName:"Outlet Group Monthly Purchase Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getKey(e){return Object.keys(e)}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((l,h)=>{let T=e.direction==="asc";for(let Ze=0;Ze<this.data.Dataheader.length;Ze++)if(e.active==this.data.Dataheader[Ze])return typeof l[this.data.Dataheader[Ze]]=="string"?t(l[this.data.Dataheader[Ze]].toLocaleLowerCase(),h[this.data.Dataheader[Ze]].toLocaleLowerCase(),T):t(l[this.data.Dataheader[Ze]],h[this.data.Dataheader[Ze]],T)});function t(l,h,T){return(l<h?-1:1)*(T?1:-1)}}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-outlet-monthly-performance"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],["matSort","","id","tableGrid",1,"table",3,"matSortChange"],[1,"table-light"],[3,"mat-sort-header"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","ngModel","items"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Purchase Order Tag",3,"ngModelChange","ngModel","items"],[2,"color","black"],[1,"table-footer"]],template:function(r,t){r&1&&S(0,MS,27,10,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,$,L,R,pe,ge,Z],encapsulation:2})};var VS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],BS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],OS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],LS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Customer_Group"],RS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"],kS=i=>({ID:i});function WS(i,s){if(i&1){let e=I();n(0,"a",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function NS(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Category"),a(),n(3,"POS-product-category-select",10),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",12)(8,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a(),n(9,"div")(10,"h6"),p(11,"Currency"),a(),n(12,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CurrencyID,t)||(l.pageData.Filter.CurrencyID=t),_(t)}),a()()()()}if(i&2){let e=m();o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(4),C("ngModel",e.pageData.Filter.CurrencyID),c("items",e.pageData.Options==null?null:e.pageData.Options.Currencies)}}function AS(i,s){if(i&1&&(n(0,"a",26),p(1),a()),i&2){let e=m().$implicit;c("queryParams",X(2,kS,e.CityID)),o(),F(e.CityName)}}function GS(i,s){if(i&1&&p(0),i&2){let e=m().$implicit;D(" ",e.CityName," ")}}function HS(i,s){if(i&1&&(n(0,"tr"),b(1,"td",25),n(2,"td"),S(3,AS,2,4,"a",26),S(4,GS,1,1),a(),b(5,"td",27),d(6,"number"),b(7,"td",27),d(8,"number"),b(9,"td",27),d(10,"number"),a()),i&2){let e=s.$implicit;o(),c("innerHtml",e.CityCode,Ee),o(2),y(e.CityID?3:-1),o(),y(e.CityID?-1:4),o(),c("innerHtml",g(6,6,e.Quantity),Ee),o(2),c("innerHtml",g(8,8,e.Total),Ee),o(2),c("innerHtml",g(10,10,e.Average),Ee)}}function QS(i,s){if(i&1){let e=I();n(0,"content")(1,"div",15)(2,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",17)(4,"tr")(5,"th",18),p(6,"Code"),a(),n(7,"th",19),p(8," Regional Name "),a(),n(9,"th",20),p(10," Quantity "),a(),n(11,"th",21),p(12," Total "),a(),n(13,"th",22),p(14," Avg. Price "),a()()(),n(15,"tbody"),G(16,HS,11,12,"tr",null,Y),a(),n(18,"tfoot")(19,"tr",23),b(20,"td",24),n(21,"td",24),p(22,"Total :"),a(),n(23,"td",24),p(24),d(25,"sum"),d(26,"quantityFraction"),a(),n(27,"td",24),p(28),d(29,"sum"),d(30,"amountFraction"),a(),n(31,"td",24),p(32),d(33,"sum"),d(34,"sum"),d(35,"amountFraction"),a()()()()()()}if(i&2){let e=m();o(16),H(e.data.List),o(8),D(" ",g(26,6,v(25,3,e.data.List,"Quantity"))," "),o(4),D(" ",g(30,11,v(29,8,e.data.List,"Total"))," "),o(4),D(" ",g(35,19,v(33,13,e.data.List,"Total")/v(34,16,e.data.List,"Quantity"))," ")}}var La=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/CitySales","ReportLoader/CitySalesLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}postInit(e){this.menuData.H=e.PageTitle}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"CityCode":return this.compare(t.CityCode,l.CityCode,h);case"CityName":return this.compare(t.CityName,l.CityName,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Average":return this.compare(t.Average,l.Average,h);case"Total":return this.compare(t.Total,l.Total,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"City Report",exportTypes:[{ID:"ReportExport/CitySalesExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-city"]],standalone:!1,features:[W],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[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,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModelChange","ngModel","items"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","CityCode",2,"width","80px"],["mat-sort-header","CityName",2,"width","220px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Average","arrowPosition","before",1,"flex-right",2,"width","100px"],[1,"table-footer"],[1,"text-end"],[3,"innerHtml"],["routerLink","/menu/Contacts/Option_Values/City/Form",3,"queryParams"],[1,"text-end",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,WS,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By Customer Group "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,NS,13,6,"ng-template",null,0,O),a(),S(25,QS,36,21,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,VS)),o(3),c("routerLink",M(12,BS)),o(3),c("routerLink",M(13,OS)),o(3),c("routerLink",M(14,LS)),o(3),c("routerLink",M(15,RS)),o(5),y(t.data?25:-1))},dependencies:[A,Q,$,J,L,R,pe,ge,Ce,se,re,Z,ne],encapsulation:2})};var YS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers"],jS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"],qS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"],US=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/City"],zS=()=>["/menu/Reports/Sales_Report/Standard/Top_Customers/By_Last_Purchase"];function KS(i,s){if(i&1){let e=I();n(0,"a",7),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",8),p(2," Export "),a()}}function XS(i,s){if(i&1){let e=I();n(0,"div",9)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",12)(8,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function JS(i,s){i&1&&(n(0,"th",20),p(1,"Cost"),a())}function ZS(i,s){i&1&&(n(0,"th",20),p(1,"Profit"),a())}function $S(i,s){if(i&1&&(b(0,"td",28),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.Cost),Ee)}}function ey(i,s){if(i&1&&(b(0,"td",27),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.Profit),Ee)}}function ty(i,s){if(i&1&&(n(0,"tr"),b(1,"td",25)(2,"td",26),d(3,"number"),b(4,"td",26),d(5,"quantityFraction"),b(6,"td",26),d(7,"amountFraction"),b(8,"td",27),d(9,"amountFraction"),S(10,$S,2,3,"td",28),S(11,ey,2,3,"td",27),a()),i&2){let e=s.$implicit,r=m(2);o(),c("innerHtml",e.GroupName,Ee),o(),c("innerHtml",g(3,7,e.Count),Ee),o(2),c("innerHtml",g(5,9,e.Quantity),Ee),o(2),c("innerHtml",g(7,11,e.Gross),Ee),o(2),c("innerHtml",g(9,13,e.Sales),Ee),o(2),y(r.roleService.product.Cost?10:-1),o(),y(r.roleService.report.Profit?11:-1)}}function iy(i,s){if(i&1&&(n(0,"td",24),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(3,4,v(2,1,e.data.Data,"Cost")))}}function ny(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(3,4,v(2,1,e.data.Data,"Profit")))}}function ay(i,s){if(i&1){let e=I();n(0,"content")(1,"div",14)(2,"div",15)(3,"table",16),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",17)(5,"tr")(6,"th",18),p(7,"Group Name"),a(),n(8,"th",19),p(9,"Orders"),a(),n(10,"th",20),p(11,"Quantity"),a(),n(12,"th",20),p(13,"Gross"),a(),n(14,"th",20),p(15,"Sales"),a(),S(16,JS,2,0,"th",20),S(17,ZS,2,0,"th",20),a()(),n(18,"tbody"),G(19,ty,12,15,"tr",null,Y),a(),n(21,"tfoot")(22,"tr",21),b(23,"td",22),n(24,"td",22),p(25),d(26,"sum"),d(27,"number"),a(),n(28,"td",22),p(29),d(30,"sum"),d(31,"quantityFraction"),a(),n(32,"td",22),p(33),d(34,"sum"),d(35,"amountFraction"),a(),n(36,"td",23),p(37),d(38,"sum"),d(39,"amountFraction"),a(),S(40,iy,4,6,"td",24),S(41,ny,4,6,"td",23),a()()()()()()}if(i&2){let e=m();o(16),y(e.roleService.product.Cost?16:-1),o(),y(e.roleService.report.Profit?17:-1),o(2),H(e.data.Data),o(6),F(g(27,11,v(26,8,e.data.Data,"Count"))),o(4),F(g(31,16,v(30,13,e.data.Data,"Quantity"))),o(4),F(g(35,21,v(34,18,e.data.Data,"Gross"))),o(4),F(g(39,26,v(38,23,e.data.Data,"Sales"))),o(3),y(e.roleService.product.Cost?40:-1),o(),y(e.roleService.report.Profit?41:-1)}}var Ra=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/CustomerGroup","ReportLoader/CustomerGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}first=!0;openExportModal(){this.matDialog.open(K,{data:{title:"Customer Group",exportTypes:[{ID:"ReportExport/CustomerGroup",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}this.data.List=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"GroupName":return this.compare(t.GroupName,l.GroupName,h);case"Trans":return this.compare(t.Trans,l.Trans,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Gross":return this.compare(t.Gross,l.Gross,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-customer-group"]],standalone:!1,features:[W],decls:26,vars:16,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-success"],[1,"text-end","text-danger"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],[1,"text-end","text-success",3,"innerHtml"],[1,"text-end","text-danger",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,KS,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Customers "),a()(),n(10,"li")(11,"a",6),p(12," By Age "),a()(),n(13,"li")(14,"a",6),p(15," By Gender "),a()(),n(16,"li")(17,"a",6),p(18," By City "),a()(),n(19,"li")(20,"a",6),p(21," By Last Purchase "),a()()()()(),n(22,"filters"),E(23,XS,9,5,"ng-template",null,0,O),a(),S(25,ay,42,28,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(11,YS)),o(3),c("routerLink",M(12,jS)),o(3),c("routerLink",M(13,qS)),o(3),c("routerLink",M(14,US)),o(3),c("routerLink",M(15,zS)),o(5),y(t.data?25:-1))},dependencies:[A,Q,J,L,R,pe,U,se,re,Z,ne],encapsulation:2})};var oy=()=>["/menu/Reports/Sales_Report/Standard/Person"],ry=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Outlet"],ly=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],py=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],my=(i,s)=>({From:i,To:s});function sy(i,s){if(i&1){let e=I();n(0,"a",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function cy(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",14),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",15)(8,"datepicker",16),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function dy(i,s){i&1&&(n(0,"th",22),p(1," Profit "),a())}function uy(i,s){if(i&1&&(b(0,"td",33),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.ActualProfit),Ee)}}function _y(i,s){if(i&1&&(n(0,"tr"),b(1,"td",30)(2,"td",31),d(3,"number"),b(4,"td",31),d(5,"amountFraction"),b(6,"td",31),d(7,"amountFraction"),b(8,"td",31),d(9,"number"),E(10,uy,2,3,"td",32),a()),i&2){let e=s.$implicit,r=m(2);o(),c("innerHtml",e.Name,Ee),o(),c("innerHtml",g(3,6,e.InvoiceCount),Ee),o(2),c("innerHtml",g(5,8,e.NetRevenue),Ee),o(2),c("innerHtml",g(7,10,e.SalesTarget),Ee),o(2),c("innerHtml",v(9,12,e.Percentage,"1.0-2"),Ee),o(2),c("ngIf",r.roleService.report.Profit)}}function gy(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ActualProfit"))," ")}}function Cy(i,s){if(i&1){let e=I();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr",21)(6,"th"),p(7,"Group Name"),a(),n(8,"th",22),p(9,"Count"),a(),n(10,"th",22),p(11,"Actual"),a(),n(12,"th",22),p(13,"Target"),a(),n(14,"th",22)(15,"span",23),p(16," % "),a()(),E(17,dy,2,0,"th",24),a()(),n(18,"tbody"),E(19,_y,11,15,"tr",25),a(),n(20,"tfoot")(21,"tr",26),b(22,"td",27)(23,"td",27),n(24,"td",28),p(25),d(26,"sum"),d(27,"amountFraction"),a(),b(28,"td",27)(29,"td",27),E(30,gy,4,6,"td",29),a()()()()()()}if(i&2){let e=m();o(17),c("ngIf",e.roleService.report.Profit),o(2),c("ngForOf",e.data.Data),o(6),D(" ",g(27,7,v(26,4,e.data.Data,"GrossRevenue"))," "),o(5),c("ngIf",e.roleService.report.Profit)}}var ka=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/SalesGroup","ReportLoader/SalesGroupLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}first=!0;preGetList(){if(this.first){let e=new Date,r=e.getMonth(),t=e.getFullYear();this.pageData.Filter.From=new Date(t,r,1).toDateString(),this.pageData.Filter.To=new Date(t,r+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){let r=new Date,t=r.getMonth(),l=r.getFullYear();this.pageData.Filter.From=new Date(l,t,1),this.pageData.Filter.To=new Date(l,t+1,0),this.first=!1}}sortData(e){let r=this.data.List.slice();if(!e.active||e.direction===""){this.data.List=r;return}}openExportModal(){this.matDialog.open(K,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/SalesGroup",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-group"]],standalone:!1,features:[W],decls:26,vars:24,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"btn","btn-outline-secondary"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end",2,"width","120px"],["matTooltip","(Actual / Target) * 100","matTooltipPosition","above"],["style","width: 120px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],["class","text-end text-success",3,"innerHtml",4,"ngIf"],[1,"text-end","text-success",3,"innerHtml"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2),S(3,sy,3,0,"a",3),n(4,"div",4)(5,"button",5),p(6," More "),a(),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"Summary"),a()(),n(11,"li")(12,"a",7),p(13,"By Outlet"),a()(),n(14,"li")(15,"a",7),p(16,"By Employee"),a()(),n(17,"li")(18,"a",8),d(19,"date"),d(20,"date"),p(21," By Order Item"),a()()()()()(),n(22,"filters"),E(23,cy,9,5,"ng-template",null,0,O),a(),E(25,Cy,31,9,"content",9),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(3),y(t.roleService!=null&&t.roleService.global.Export?3:-1),o(6),c("routerLink",M(17,oy)),o(3),c("routerLink",M(18,ry)),o(3),c("routerLink",M(19,ly)),o(3),c("routerLink",M(20,py))("queryParams",fe(21,my,v(19,11,t.pageData.Filter==null?null:t.pageData.Filter.From,"ddMMyyyy"),v(20,14,t.pageData.Filter==null?null:t.pageData.Filter.To,"ddMMyyyy"))),o(7),c("ngIf",t.data))},dependencies:[A,st,it,Q,J,L,R,ie,pe,U,se,re,oe,Z],encapsulation:2})};var fy=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report/By_Outlet"],xy=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],hy=i=>({ID:i});function Sy(i,s){i&1&&(n(0,"a",5),p(1,"By Outlet"),a()),i&2&&c("routerLink",M(1,fy))}function yy(i,s){if(i&1){let e=I();n(0,"a",6),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",7),p(2," Export "),a()}}function Dy(i,s){if(i&1){let e=I();n(0,"div",8)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div",10)(7,"div",11)(8,"datepicker",12),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()()(),n(9,"div",13)(10,"div",11)(11,"datepicker",14),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()(),n(12,"h6"),p(13,"Tax"),a(),n(14,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(15,"h6"),p(16,"Page Size"),a(),n(17,"input",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(5),C("date",e.pageData.Filter.From),o(3),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function vy(i,s){if(i&1&&b(0,"th",41),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function wy(i,s){if(i&1&&(b(0,"td",46),d(1,"TaxDefault"),d(2,"amountFraction")),i&2){let e=s.index,r=m().$implicit,t=m(2);c("innerHtml",g(2,5,fi(1,1,t.data.Compenents,r,e)),Ee)}}function Ty(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",42),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td"),p(9),a(),n(10,"td"),p(11),d(12,"date"),a(),n(13,"td",43),p(14),d(15,"amountFraction"),a(),n(16,"td",44),p(17),d(18,"amountFraction"),a(),E(19,wy,3,7,"td",45),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(17,xy))("queryParams",X(18,hy,e.ID)),o(),F(e.Number),o(2),F(e.Name),o(2),F(e.TaxName),o(2),F(v(12,10,e.Date,"dd MMM yyyy")),o(3),F(g(15,13,e.Sales)),o(3),D(" ",g(18,15,e.Tax)," "),o(2),c("ngForOf",r.getComponent(r.data))}}function Py(i,s){if(i&1&&(n(0,"td",47),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e.SumTaxAmount)," ")}}function Fy(i,s){if(i&1){let e=I();n(0,"span",48),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport"))}),n(1,"i",49),p(2,"?"),a()()}}function Iy(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function by(i,s){if(i&1){let e=I();n(0,"a",50),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",51),p(2," Next"),a()}}function Ey(i,s){if(i&1){let e=I();n(0,"a",52),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport",!0))}),b(1,"i",53),p(2," Show All"),a()}}function My(i,s){if(i&1){let e=I();n(0,"content")(1,"div",17)(2,"div",18)(3,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",20)(5,"tr")(6,"th",21),p(7,"Outlet"),a(),n(8,"th",22),p(9,"Number"),a(),n(10,"th",23),p(11,"Name"),a(),n(12,"th",24),p(13," Type "),a(),n(14,"th",25),p(15,"Date"),a(),n(16,"th",26),p(17," Sales "),a(),n(18,"th",27),p(19," Tax "),a(),E(20,vy,1,1,"th",28),a()(),n(21,"tbody"),E(22,Ty,20,20,"tr",29),a(),n(23,"tfoot")(24,"tr",30),b(25,"td",31),n(26,"td",32),p(27),d(28,"sum"),d(29,"amountFraction"),a(),n(30,"td",32),p(31),d(32,"sum"),d(33,"amountFraction"),a(),E(34,Py,3,3,"td",33),a()()()(),n(35,"div",34)(36,"div",35)(37,"div",36),p(38),d(39,"number"),E(40,Fy,3,0,"span",37)(41,Iy,3,3,"span",4),p(42),a()(),n(43,"div",38),E(44,by,3,0,"a",39)(45,Ey,3,0,"a",40),a()()()()}if(i&2){let e=m();o(20),c("ngForOf",e.data.Compenents),o(2),c("ngForOf",e.infiniteList),o(5),D(" ",g(29,14,v(28,11,e.infiniteList,"Sales"))," "),o(4),D(" ",g(33,19,v(32,16,e.infiniteList,"Tax"))," "),o(3),c("ngForOf",e.data.Compenents),o(4),D(" Showing 1 - ",g(39,21,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),c("ngIf",!e.pageData.HideStoreApiCount),o(),c("ngIf",e.pageData.HideStoreApiCount),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),c("ngIf",!e.nextPageDisabled&&!e.goToLast),o(),c("ngIf",!e.nextPageDisabled&&!e.goToLast)}}var Wa=class i extends vi{constructor(e,r,t,l,h,T){super(e,r,"Report/GetSalesTaxReport","ReportLoader/GetTaxReport",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.toastrService=T}timeTo;timeFrom;getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}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 h=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),h);case"Number":return this.compare(t.Number,l.Number,h);case"Date":return this.compare(t.Date,l.Date,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"Tax":return this.compare(t.Tax,l.Tax,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Tax Report",exportTypes:[{ID:"ReportExport/GetSalesTaxReport",Value:"Default",FileName:"Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-tax-report"]],standalone:!1,features:[W],decls:8,vars:7,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3","matTooltipPosition","above","matTooltip","Tax Report By Outlet",3,"routerLink",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[4,"ngIf"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-3",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"w-100","d-flex","mt-2","align-items-center","justify-content-between"],[1,"w-100"],["name","From","appearance","outline",1,"timepicker",3,"dateChange","date"],[1,"w-100","d-flex","align-items-center","justify-content-between","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],["style","width: 150px","class","align-right text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],[1,"text-end","text-success"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more reports",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all reports",3,"click",4,"ngIf"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end",2,"width","150px"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more reports",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all reports",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,Sy,2,2,"a",2)(3,yy,3,0,"a",3),a(),n(4,"filters"),E(5,Dy,18,10,"ng-template",null,0,O),a(),E(7,My,46,23,"content",4),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,$,J,Qe,L,R,ie,pe,ge,Ue,U,se,Fi,re,oe,Z],encapsulation:2})};var Vy=()=>["/menu/Reports/Sales_Report/Advanced/Tax_Report"];function By(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function Oy(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",10)(8,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Tax"),a(),n(11,"ng-select",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types)("clearable",!1)}}function Ly(i,s){i&1&&(n(0,"th",17),p(1,"Total Tax"),a())}function Ry(i,s){if(i&1&&b(0,"th",18),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function ky(i,s){if(i&1&&(n(0,"td",23),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),F(v(2,1,e.Tax,r.pageData.FractionDigit))}}function Wy(i,s){if(i&1&&(b(0,"td",18),d(1,"TaxDefault"),d(2,"number")),i&2){let e=s.$index,r=m().$implicit,t=m(2);c("innerHtml",v(2,5,fi(1,1,t.data.Compenents,r,e),t.pageData.FractionDigit),Ee)}}function Ny(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",23),p(4),d(5,"number"),a(),S(6,ky,3,4,"td",23),G(7,Wy,3,8,"td",18,Y),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),F(v(5,3,e.Sales,r.pageData.FractionDigit)),o(2),y(r.data.Compenents.length==0?6:-1),o(),H(r.getComponent(e))}}function Ay(i,s){if(i&1&&(n(0,"td",21),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Tax"),e.pageData.FractionDigit))}}function Gy(i,s){if(i&1&&(n(0,"td",22),p(1),d(2,"number"),a()),i&2){let e=s.$implicit,r=m(2);o(),D(" ",v(2,1,e.SumTaxAmount,r.pageData.FractionDigit)," ")}}function Hy(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",13),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",14)(3,"tr")(4,"th",15),p(5,"Outlet"),a(),n(6,"th",16),p(7,"Sales"),a(),S(8,Ly,2,0,"th",17),G(9,Ry,1,1,"th",18,Y),a()(),n(11,"tbody"),G(12,Ny,9,6,"tr",null,Y),a(),n(14,"tfoot")(15,"tr",19),b(16,"td",20),n(17,"td",21),p(18),d(19,"sum"),d(20,"number"),a(),S(21,Ay,4,7,"td",21),G(22,Gy,3,4,"td",22,Y),a()()()()}if(i&2){let e=m();o(8),y(e.data.Compenents.length==0?8:-1),o(),H(e.data.Compenents),o(3),H(e.data.Data),o(6),F(v(20,6,v(19,3,e.data.Data,"Sales"),e.pageData.FractionDigit)),o(3),y(e.data.Compenents.length==0?21:-1),o(),H(e.data.Compenents)}}var Na=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/GetTaxReportbyOutlet","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}openExportModal(){this.matDialog.open(K,{data:{title:"Tax Report by Outlet",exportTypes:[{ID:"ReportExport/GetTaxReportbyOutlet",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{r.SalesTax=t==0?e.Sales:this.data.Compenents[t-1].SalesTax,r.SalesTax=t==0?r.SalesTax:r.SalesTax+r.SalesTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.SalesTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]}),e.Component}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 h=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.EntityName,l.EntityName,h);case"Sales":return this.compare(t.Sales,l.Sales,h);case"Tax":return this.compare(t.Tax,l.Tax,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-tax-report-by-outlet"]],standalone:!1,features:[W],decls:10,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-outline-secondary","me-6",3,"routerLink"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items","clearable"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end","text-success"],[1,"text-end",2,"width","150px"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),p(3,"Tax Report"),a(),S(4,By,3,0,"a",3),a(),n(5,"filters"),E(6,Oy,12,8,"ng-template",null,0,O),a(),n(8,"content"),S(9,Hy,24,9,"div",4),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("routerLink",M(8,Vy)),o(2),y(t.roleService!=null&&t.roleService.global.Export?4:-1),o(5),y(t.data?9:-1))},dependencies:[A,Q,$,J,L,R,ie,pe,ge,U,se,Fi,re],encapsulation:2})};var Qy=()=>["/menu/Products/Catalog/Variants/Info"],Yy=i=>({ID:i});function jy(i,s){if(i&1){let e=I();n(0,"a",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export "),a()}}function qy(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",8),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",10)(11,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Sales Person"),a(),n(14,"sales-person-selector",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.SalesID)}}function Uy(i,s){i&1&&(n(0,"th",26),p(1," Category "),a())}function zy(i,s){i&1&&(n(0,"th",27),p(1,"Code"),a())}function Ky(i,s){i&1&&(n(0,"th",28),p(1," Release Date "),a())}function Xy(i,s){i&1&&(n(0,"th",29),p(1," Days Count "),a())}function Jy(i,s){i&1&&(n(0,"th",30),p(1," Last Sold "),a())}function Zy(i,s){i&1&&(n(0,"th",31),p(1," Last Purchased "),a())}function $y(i,s){i&1&&(n(0,"th",32),p(1," Days Purchased "),a())}function eD(i,s){i&1&&(n(0,"th",33),p(1," Qty "),a())}function tD(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Category)}}function iD(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.Code)}}function nD(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.Released?v(2,1,e.Released,"dd MMM yyyy"):"-"," ")}}function aD(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DaysCount!=null?g(2,1,e.DaysCount):"-"," ")}}function oD(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.LastSold?v(2,1,e.LastSold,"dd MMM yyyy"):"-"," ")}}function rD(i,s){if(i&1&&(n(0,"td"),p(1),d(2,"date"),a()),i&2){let e=m().$implicit;o(),D(" ",e.LastPurchased?v(2,1,e.LastPurchased,"dd MMM yyyy"):"-"," ")}}function lD(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),D(" ",e.DaysSinceLastPurchased!=null?g(2,1,e.DaysSinceLastPurchased):"-"," ")}}function pD(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Quantity)," ")}}function mD(i,s){if(i&1&&(n(0,"tr",34),E(1,tD,2,1,"td",3),n(2,"td")(3,"a",35),p(4),a()(),E(5,iD,2,1,"td",3)(6,nD,3,4,"td",3)(7,aD,3,3,"td",36)(8,oD,3,4,"td",3)(9,rD,3,4,"td",3)(10,lD,3,3,"td",37)(11,pD,3,3,"td",38),a()),i&2){let e=s.$implicit,r=m(2);o(),c("ngIf",r.column.Category.selected),o(2),c("routerLink",M(11,Qy))("queryParams",X(12,Yy,e.ID)),o(),F(e.Name),o(),c("ngIf",r.column.Code.selected),o(),c("ngIf",r.column.ReleaseDate.selected),o(),c("ngIf",r.column.DaysCount.selected),o(),c("ngIf",r.column.LastSold.selected),o(),c("ngIf",r.column.LastPurchased.selected),o(),c("ngIf",r.column.DaysPurchased.selected),o(),c("ngIf",r.column.QTY.selected)}}function sD(i,s){if(i&1){let e=I();n(0,"content")(1,"div",13)(2,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",15)(4,"tr"),E(5,Uy,2,0,"th",16),n(6,"th",17),p(7,"Name"),a(),E(8,zy,2,0,"th",18)(9,Ky,2,0,"th",19)(10,Xy,2,0,"th",20)(11,Jy,2,0,"th",21)(12,Zy,2,0,"th",22)(13,$y,2,0,"th",23)(14,eD,2,0,"th",24),a()(),n(15,"tbody"),E(16,mD,12,14,"tr",25),a()()()()}if(i&2){let e=m();o(5),c("ngIf",e.column.Category.selected),o(3),c("ngIf",e.column.Code.selected),o(),c("ngIf",e.column.ReleaseDate.selected),o(),c("ngIf",e.column.DaysCount.selected),o(),c("ngIf",e.column.LastSold.selected),o(),c("ngIf",e.column.LastPurchased.selected),o(),c("ngIf",e.column.DaysPurchased.selected),o(),c("ngIf",e.column.QTY.selected),o(2),c("ngForOf",e.oriData.Data)}}var Aa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/ProductLifeCycle","ReportLoader/ProductLifeCycle",h);this.httpService=r;this.csvConverter=t;this.matDialog=l;this.toastrService=h}roleService=Pe(j);columnService=Pe(gt);column={Category:{selected:!1,name:"Category"},Code:{selected:!0,name:"Code"},ReleaseDate:{selected:!0,name:"Release Date"},DaysCount:{selected:!1,name:"Days Count"},LastSold:{selected:!0,name:"Last Sold"},LastPurchased:{selected:!0,name:"Last Purchased"},DaysPurchased:{selected:!1,name:"Days Purchased"},QTY:{selected:!0,name:"Quantity"}};oriData;sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.oriData;return}this.data=r.sort((t,l)=>{let h=e.direction==="asc",T=typeof t[e.active];switch(V.IsEmpty(t.Code)&&(t.Code=""),V.IsEmpty(l.Code)&&(l.Code=""),V.IsEmpty(t.Released)&&(t.Release=""),V.IsEmpty(l.Released)&&(l.Release=""),V.IsEmpty(t.LastPurchased)&&(t.LastPurchased=""),V.IsEmpty(l.LastPurchased)&&(l.LastPurchased=""),V.IsEmpty(t.LastSold)&&(t.LastSold=""),V.IsEmpty(l.LastSold)&&(l.LastSold=""),T){case"string":return this.compare(t[e.active].toLocaleLowerCase(),l[e.active].toLocaleLowerCase(),h);case"number":return this.compare(t[e.active],l[e.active],h);default:return 0}})}preGetList(){this.pageData.Filter.EntityID||delete this.pageData.Filter.EntityID}postInit(e){this.oriData=e,console.log(e),this.menuData=nt(et({},this.menuData),{SH:e.PageTitle})}openExportModal(){this.matDialog.open(K,{data:{title:"Product Life Cycle",exportTypes:[{ID:"ReportExport/ProductLifeCycle",Value:"Default",FileName:"Product Life Cycle"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}checkForAdvancedColumn(){this.columnService.checkForAdvancedColumn(this.column,this.data,this.pageData.Filter)}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-life-cycle"]],standalone:!1,features:[W],decls:7,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","onChangeColumnCheckbox","pageData","hideSearchBox","isFilterOnDropdown","filter","column"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Category",4,"ngIf"],["mat-sort-header","Name"],["mat-sort-header","Code",4,"ngIf"],["mat-sort-header","Released",4,"ngIf"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above","mat-sort-header","DaysCount",4,"ngIf"],["mat-sort-header","LastSold",4,"ngIf"],["mat-sort-header","LastPurchased",4,"ngIf"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above","mat-sort-header","DaysSinceLastPurchased",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","flex-right text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["mat-sort-header","Category"],["mat-sort-header","Code"],["mat-sort-header","Released"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above","mat-sort-header","DaysCount"],["mat-sort-header","LastSold"],["mat-sort-header","LastPurchased"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above","mat-sort-header","DaysSinceLastPurchased"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right","text-end"],[1,"border-bottom"],[3,"routerLink","queryParams"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above",4,"ngIf"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above",4,"ngIf"],["class","text-end",4,"ngIf"],["matTooltip","Days Since Product Released Date","matTooltipPosition","above"],["matTooltip","Days Since Last Purchased","matTooltipPosition","above"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),P("onChangeColumnCheckbox",function(){return u(l),_(t.checkForAdvancedColumn())}),n(1,"actions"),E(2,jy,3,0,"a",2),a(),n(3,"filters"),E(4,qy,15,8,"ng-template",null,0,O),a(),E(6,sD,17,9,"content",3),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),c("column",t.column),o(2),c("ngIf",t.roleService==null?null:t.roleService.global.Export),o(4),c("ngIf",t.data))},dependencies:[A,st,it,Q,J,L,R,ie,pe,ge,Ce,U,ze,re,oe,ne],encapsulation:2})};function cD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function dD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(12,"h6"),p(13,"Supplier"),a(),n(14,"autocompleteV2",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(15,"h6"),p(16,"Row Count"),a(),n(17,"input",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.SupplierID),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function uD(i,s){i&1&&(n(0,"th",21),p(1,"Total Cost"),a())}function _D(i,s){i&1&&(n(0,"th",21),p(1,"Total profit "),a())}function gD(i,s){if(i&1&&(n(0,"td",26),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalCost))}}function CD(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.TotalProfit))}}function fD(i,s){if(i&1&&(n(0,"tr",23)(1,"td",24),p(2),a(),n(3,"td",24),p(4),a(),n(5,"td"),p(6),a(),n(7,"td"),p(8),a(),n(9,"td",25),p(10),d(11,"quantityFraction"),a(),n(12,"td",25),p(13),d(14,"quantityFraction"),a(),n(15,"td",25),p(16),d(17,"amountFraction"),a(),S(18,gD,3,3,"td",26),S(19,CD,3,3,"td",25),n(20,"td",25),p(21),d(22,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.PrevRank||"-"),o(2),F(e.Rank),o(2),F(e.Name),o(2),F(e.Code),o(2),F(g(11,10,e.Quantity)),o(3),F(g(14,12,e.OnHand)),o(3),F(g(17,14,e.TotalAmount)),o(2),y(r.roleService.product.Cost?18:-1),o(),y(r.roleService.report.Profit?19:-1),o(2),F(g(22,16,e.Margin))}}function xD(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data,"TotalCost")))}}function hD(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data,"TotalProfit")))}}function SD(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",27),b(2,"td",28),n(3,"td",29),p(4,"Total:"),a(),n(5,"td",29),p(6),d(7,"sum"),d(8,"quantityFraction"),a(),n(9,"td",29),p(10),d(11,"sum"),d(12,"quantityFraction"),a(),n(13,"td",29),p(14),d(15,"sum"),d(16,"amountFraction"),a(),S(17,xD,4,6,"td",29),S(18,hD,4,6,"td",29),a()()),i&2){let e=m(2);o(6),F(g(8,8,v(7,5,e.data,"Quantity"))),o(4),F(g(12,13,v(11,10,e.data,"OnHand"))),o(4),F(g(16,18,v(15,15,e.data,"TotalAmount"))),o(3),y(e.roleService.product.Cost?17:-1),o(),y(e.roleService.report.Profit?18:-1)}}function yD(i,s){if(i&1){let e=I();n(0,"content")(1,"div",13)(2,"div",14)(3,"table",15),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",16)(5,"tr")(6,"th",17),p(7,"Prev"),a(),n(8,"th",17),p(9,"Now"),a(),n(10,"th",18),p(11,"Name"),a(),n(12,"th",19),p(13,"Code"),a(),n(14,"th",17),p(15,"Sold"),a(),n(16,"th",20),p(17,"On Hand"),a(),n(18,"th",21),p(19,"Total Amount"),a(),S(20,uD,2,0,"th",21),S(21,_D,2,0,"th",21),n(22,"th",22),p(23,"%"),a()()(),n(24,"tbody"),G(25,fD,23,18,"tr",23,Y),a(),S(27,SD,19,20,"tfoot"),a()()()()}if(i&2){let e=m();o(20),y(e.roleService.product.Cost?20:-1),o(),y(e.roleService.report.Profit?21:-1),o(4),H(e.data.Data),o(2),y(e.data.length>0?27:-1)}}var Ga=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/GetReportProductProfit","ReportLoader/GetReportProductProfit",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.toastrService=T}RadioGroupBy=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}];originalData;openExportModal(){this.matDialog.open(K,{data:{title:"Product Profit Report",exportTypes:[{ID:"ReportExport/GetReportProductProfit",Value:"Default",FileName:"Product Profit Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.originalData=e.Data}sortData(e){let r=this.data.Data.slice();if(!e.active||e.direction===""){this.data.Data=this.originalData;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";return this.compare(t[e.active],l[e.active],h)})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-product-profit"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","100px"],[2,"width","600px"],[2,"width","100px"],["matTooltip","On Hand Inventory",1,"text-end",2,"width","200px"],[1,"text-end",2,"width","200px"],["mat-sort-header","Margin",1,"text-end","align-right",2,"width","200px"],[1,"border-bottom"],[1,"text-end",2,"width","35px"],[1,"text-end","text-success"],[1,"text-end","text-danger"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,cD,3,0,"a",2),a(),n(3,"filters"),E(4,dD,18,10,"ng-template",null,0,O),a(),S(6,yD,28,3,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,J,Qe,L,R,ie,pe,ge,Ue,Ae,Ce,U,se,Z,ne],encapsulation:2})};var DD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],vD=i=>({ID:i});function wD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function TD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function PD(i,s){if(i&1&&(n(0,"tr",14)(1,"td")(2,"a",15),p(3),a()(),n(4,"td"),p(5),a(),n(6,"td"),p(7),a(),n(8,"td"),p(9),d(10,"quantityFraction"),a(),n(11,"td"),p(12),d(13,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(11,DD))("queryParams",X(12,vD,e.ID)),o(),F(e.InvoiceNumber),o(2),F(e.Name),o(2),F(e.Code),o(2),F(g(10,7,e.Quantity)),o(3),F(g(13,9,e.Price))}}function FD(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"table",12)(3,"thead",13)(4,"tr")(5,"th"),p(6,"Number"),a(),n(7,"th"),p(8,"Name"),a(),n(9,"th"),p(10,"Code"),a(),n(11,"th"),p(12,"Quantity"),a(),n(13,"th"),p(14,"Price"),a()()(),n(15,"tbody"),G(16,PD,14,14,"tr",14,Y),a()()()()),i&2){let e=m();o(16),H(e.data.Data)}}var Ha=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/GetExchangedSales","ReportLoader/GetExchangedSales",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.toastrService=T}openExportModal(){this.matDialog.open(K,{data:{title:"Exchanged Sales Report",exportTypes:[{ID:"ReportExport/GetExchangedSales",Value:"Default",FileName:"Exchanged Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-exchanged-sales"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border-bottom"],[3,"routerLink","queryParams"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,wD,3,0,"a",2),a(),n(3,"filters"),E(4,TD,12,7,"ng-template",null,0,O),a(),S(6,FD,18,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,R,Ce,U,Z,ne],encapsulation:2})};function ID(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function bD(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product by Name"),a(),n(3,"autocompleteV2",12),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),C("ngModel",e.pageData.Filter.ProductID)}}function ED(i,s){if(i&1){let e=I();n(0,"div")(1,"h6"),p(2,"Product by Code"),a(),n(3,"autocompleteV2",13),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a()()}if(i&2){let e=m(2);o(3),C("ngModel",e.pageData.Filter.ProductID)}}function MD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"datepicker",7),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(7,"div",8)(8,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(9,"h6"),p(10,"Search By"),a(),n(11,"radio-options",10),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SearchBy,t)||(l.pageData.Filter.SearchBy=t),_(t)}),a(),S(12,bD,4,1,"div"),S(13,ED,4,1,"div"),n(14,"h6"),p(15,"Row Count"),a(),n(16,"input",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.pageData.Filter.SearchBy),c("options",e.RadioSearchBy),o(),y(e.pageData.Filter.SearchBy?12:-1),o(),y(e.pageData.Filter.SearchBy?-1:13),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function VD(i,s){if(i&1&&(n(0,"tr",20)(1,"td",21),p(2),a(),n(3,"td"),p(4),a(),n(5,"td",21),p(6),d(7,"quantityFraction"),a(),n(8,"td",22),p(9),d(10,"quantityFraction"),a()()),i&2){let e=s.$implicit;o(2),F(e.Rank),o(2),F(e.Name),o(2),F(g(7,4,e.Quantity)),o(3),F(g(10,6,e.OnHand))}}function BD(i,s){if(i&1&&(n(0,"content")(1,"div",14)(2,"table",15)(3,"thead",16)(4,"tr")(5,"th",17),p(6,"Rank"),a(),n(7,"th",18),p(8,"Name"),a(),n(9,"th",19),p(10,"Sold"),a(),n(11,"th",19),p(12,"Inventory"),a()()(),n(13,"tbody"),G(14,VD,11,8,"tr",20,Y),a()()()()),i&2){let e=m();o(14),H(e.data.Data)}}var Qa=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/GetSalesRankByVariantModel","ReportLoader/GetSalesRankByVariantModel",T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;this.toastrService=T}RadioSearchBy=[{Key:!0,Value:"Name"},{Key:!1,Value:"Code"}];openExportModal(){this.matDialog.open(K,{data:{title:"Variant Model Rank Report",exportTypes:[{ID:"ReportExport/GetSalesRankByVariantModel",Value:"Default",FileName:"Variant Model Rank Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(qe))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-variant-model-rank"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-4"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Search By",3,"modelChange","model","options"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestion","placeholder","Search by Name",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCode","placeholder","Search by Code",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","70px"],[2,"width","800px"],[1,"text-end",2,"width","100px"],[1,"border-bottom"],[1,"text-end"],[1,"text-success","text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,ID,3,0,"a",2),a(),n(3,"filters"),E(4,MD,17,11,"ng-template",null,0,O),a(),S(6,BD,16,0,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,J,Qe,L,R,Ue,Te,Ae,U,ne],encapsulation:2})};var OD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],LD=i=>({ID:i});function RD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function kD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Customer"),a(),n(6,"autocompleteV2",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function WD(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",20),p(5),a()(),n(6,"td"),p(7),d(8,"date"),a(),n(9,"td"),p(10),a(),n(11,"td"),p(12),a(),n(13,"td",16),p(14),d(15,"quantityFraction"),a(),n(16,"td",16),p(17),d(18,"amountFraction"),a(),n(19,"td",21),p(20),a(),n(21,"td",16),p(22),d(23,"amountFraction"),a()()),i&2){let e=s.$implicit;o(2),F(e.EntityName),o(2),c("routerLink",M(20,OD))("queryParams",X(21,LD,e.InvoiceID)),o(),F(e.Number),o(2),F(v(8,11,e.Date,"dd MMM yyyy")),o(3),F(e.Name),o(2),F(e.Code),o(2),D("(",g(15,14,e.Quantity),")"),o(3),F(g(18,16,e.UnitPrice)),o(3),D("",e.Discount&&e.Discount!=0?-e.Discount+"%":""," "),o(2),D("(",g(23,18,e.Total),")")}}function ND(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"div",12)(3,"table",13)(4,"thead",14)(5,"tr")(6,"th"),p(7,"Outlet"),a(),n(8,"th",15),p(9,"Number"),a(),n(10,"th"),p(11,"Date"),a(),n(12,"th"),p(13,"Name"),a(),n(14,"th"),p(15,"Code"),a(),n(16,"th",16),p(17,"Quantity"),a(),n(18,"th",16),p(19),a(),n(20,"th",17),p(21,"%"),a(),n(22,"th",16),p(23),a()()(),n(24,"tbody"),G(25,WD,24,23,"tr",null,Y),a(),n(27,"tfoot")(28,"tr",18),b(29,"td",19)(30,"td",19)(31,"td",19)(32,"td",19)(33,"td",19),n(34,"td",16),p(35),d(36,"sum"),d(37,"quantityFraction"),a(),b(38,"td",19)(39,"td",19),n(40,"td",16),p(41),d(42,"sum"),d(43,"amountFraction"),a()()()()()()()),i&2){let e=m();o(19),D("Price (",e.data.CurrencySymbol,")"),o(4),D("Total(",e.data.CurrencySymbol,")"),o(2),H(e.data.Data),o(10),F(g(37,7,v(36,4,e.data.Data,"Quantity"))),o(6),F(g(43,12,v(42,9,e.data.Data,"Total")))}}var Ya=class i extends me{constructor(e,r,t,l,h,T){super(e,r,"Report/SalesReturnList","ReportLoader/ReturnReportLoader",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}month;year;openExportModal(){this.matDialog.open(K,{data:{title:"Sales Return",exportTypes:[{ID:"ReportExport/SalesReturnExport",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){this.menuData.H=e.PageTitle}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-sales-return"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end"],[2,"width","30px"],[1,"table-footer"],[1,"empty-column"],[3,"routerLink","queryParams"],[1,"text-danger"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,RD,3,0,"a",2),a(),n(3,"filters"),E(4,kD,12,6,"ng-template",null,0,O),a(),S(6,ND,44,14,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,R,Ae,U,se,oe,Z,ne],encapsulation:2})};var AD=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],GD=i=>({ID:i});function HD(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function QD(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.EntityID,t)||(l.pageData.Filter.EntityID=t),_(t)}),a(),n(4,"h6"),p(5,"Supplier"),a(),n(6,"autocompleteV2",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SupplierID,t)||(l.pageData.Filter.SupplierID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"datepicker",8),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a(),n(10,"div",9)(11,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("accessType",2),C("ngModel",e.pageData.Filter.EntityID),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.SupplierID),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function YD(i,s){i&1&&(n(0,"th",15),p(1,"Unit Cost"),a())}function jD(i,s){if(i&1&&(b(0,"td",36),d(1,"amountFraction")),i&2){let e=m().$implicit;c("innerHtml",g(1,1,e.UnitPrice),Ee)}}function qD(i,s){if(i&1&&(n(0,"tr",24)(1,"td",31),b(2,"span",32),a(),b(3,"td",33),n(4,"td",34),p(5),d(6,"quantityFraction"),a(),b(7,"td",35),S(8,jD,2,3,"td",36),n(9,"td",37),p(10),d(11,"amountFraction"),a(),b(12,"td",36),d(13,"amountFraction"),a()),i&2){let e=s.$implicit,r=m(3);o(2),c("innerHtml",e.Name,Ee),o(),c("innerHtml",e.Code,Ee),o(2),D("(",g(6,7,e.Quantity),")"),o(2),c("innerHtml",e.UOMName,Ee),o(),y(r.roleService.product.Cost?8:-1),o(2),D(" ",e.Discount==0?"":"-"+g(11,9,e.Discount)+"%"),o(2),c("innerHtml",g(13,11,e.Total),Ee)}}function UD(i,s){i&1&&(n(0,"td",28),p(1,"\xA0"),a())}function zD(i,s){if(i&1&&(n(0,"div")(1,"div",18)(2,"a",19),b(3,"span",20),d(4,"date"),d(5,"date"),a(),n(6,"span"),p(7),d(8,"showIfNotNullOrEmptyString"),a()(),b(9,"span",21),n(10,"div",22)(11,"div")(12,"table",23),b(13,"thead"),n(14,"tbody"),G(15,qD,14,13,"tr",24,Y),a()()()(),n(17,"table",25)(18,"thead")(19,"tr",26)(20,"td",27),p(21,"Total"),a(),n(22,"td",28),p(23,"\xA0"),a(),n(24,"td",15),p(25),d(26,"sum"),d(27,"quantityFraction"),a(),b(28,"td",29),S(29,UD,2,0,"td",28),n(30,"td",30),p(31,"\xA0"),a(),n(32,"td",15),p(33),d(34,"sum"),d(35,"amountFraction"),a()()()()()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(27,AD))("queryParams",X(28,GD,e.InvoiceID)),o(),c("innerHtml",e.EntityName+" #"+e.Number+" - "+v(4,8,e.Date,"dd MMM yyyy")+" ("+v(5,11,e.Created,"HH:mm")+")",Ee),o(4),D(" ",v(8,14,e.CustomerNameDisplay," - {0}")," "),o(2),c("innerHtml",e.Note,Ee),o(6),H(e.Item),o(10),D("",g(27,20,v(26,17,e.Item,"Quantity")),"\xA0"),o(4),y(r.roleService.product.Cost?29:-1),o(4),D("",g(35,25,v(34,22,e.Item,"Total")),"\xA0 ")}}function KD(i,s){if(i&1&&(n(0,"content")(1,"div",11)(2,"table",12)(3,"thead",13)(4,"tr")(5,"th"),p(6,"Name"),a(),n(7,"th",14),p(8,"Code"),a(),n(9,"th",15),p(10,"Quantity"),a(),n(11,"th",16),p(12,"UOM"),a(),S(13,YD,2,0,"th",15),n(14,"th",17),p(15,"%"),a(),n(16,"th",15),p(17,"Total(Rp.)"),a()()()(),G(18,zD,36,30,"div",null,Y),a()()),i&2){let e=m();o(13),y(e.roleService.product.Cost?13:-1),o(5),H(e.data.Data)}}var ja=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/PurchaseReturnList","ReportLoader/ReturnReportLoader");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Return",exportTypes:[{ID:"ReportExport/PurchaseReturnList",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){this.pageData.Filter.EntityID===null&&(this.pageData.Filter.EntityID=V.GuidEmpty)}postInit(){this.menuData.H=this.data.PageTitle}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-purchase-return"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Search Supplier",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"UOMWidth",2,"width","50px"],[2,"width","5%"],[1,"mt-7"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHtml"],[1,"mt-3","mb-3",3,"innerHtml"],[1,"items"],["cellspacing","0",1,"table","table-sm"],[1,"border-top"],[1,"w-100"],[1,"table-footer"],[1,"empty-column"],[1,"empty-column",2,"width","10%"],[1,"empty-column",2,"width","50px"],[1,"empty-column",2,"width","5%"],[1,"border-start","border-end"],[3,"innerHtml"],[1,"border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%"],[1,"UOMWidth","border-start","border-end",2,"width","50px",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"small","text-danger","border-start","border-end",2,"width","5%"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,HD,3,0,"a",2),a(),n(3,"filters"),E(4,QD,12,6,"ng-template",null,0,O),a(),S(6,KD,20,1,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,J,L,R,Ae,U,se,On,oe,Z,ne],encapsulation:2})};var XD=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],JD=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],dl=i=>({ID:i});function ZD(i,s){if(i&1){let e=I();n(0,"a",5),P("click",function(){u(e);let t=m();return _(t.exportCSV(t.csvConverter,"Report/ProductSalesByInvoice","Invoice_Item_Details.csv"))}),b(1,"i",6),p(2," Export"),a()}}function $D(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales"),a(),n(9,"sales-person-selector",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(10,"h6"),p(11,"Customer"),a(),n(12,"autocompleteV2",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(13,"h6"),p(14,"Page Size"),a(),n(15,"input",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(16,"h6"),p(17,"From - To"),a(),n(18,"div")(19,"datepicker",13),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(20,"div",14)(21,"datepicker",15),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(22,"h6"),p(23,"Product"),a(),n(24,"autocompleteV2",16),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ProductID,t)||(l.pageData.Filter.ProductID=t),_(t)}),a(),n(25,"h6"),p(26,"Variant"),a(),n(27,"autocompleteV2",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("ngModel",e.pageData.Filter.RowCount),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("inputTextValue",e.pageData.Filter.ProductName),C("ngModel",e.pageData.Filter.ProductID),o(3),c("inputTextValue",e.pageData.Filter.VariantName)("renderThumbnail",!0),C("ngModel",e.pageData.Filter.VariantID)}}function ev(i,s){i&1&&(n(0,"th",23),p(1," Batch Number "),a())}function tv(i,s){i&1&&(n(0,"th",27),p(1," Cost "),a())}function iv(i,s){if(i&1&&(n(0,"td"),p(1),a()),i&2){let e=m().$implicit;o(),F(e.SerialBatchNumber)}}function nv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"number"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",v(2,1,e.UnitCost,r.pageData.FractionDigit)," ")}}function av(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td"),p(4),d(5,"date"),a(),n(6,"td")(7,"a",32),p(8),a()(),S(9,iv,2,1,"td"),n(10,"td")(11,"div",33)(12,"a",34),p(13),a(),n(14,"small",35),p(15),a()()(),n(16,"td"),p(17),a(),n(18,"td",36),p(19),d(20,"number"),a(),S(21,nv,3,4,"td",36),n(22,"td",36),p(23),d(24,"number"),a(),n(25,"td",36),p(26),d(27,"number"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.Outlet),o(2),F(v(5,16,e.Date,"dd MMM yy")),o(3),c("routerLink",M(27,JD))("queryParams",X(28,dl,e.InvoiceID)),o(),F(e.Number),o(),y(r.showBatchNumber?9:-1),o(3),c("queryParams",X(30,dl,e.CustomerID)),o(),F(e.CustomerName),o(),c("matTooltip",r.maskingFields!=null&&r.maskingFields.Code&&!r.roleService.global.SensitiveField?r.maskingFieldMsg:""),o(),F(e.Code),o(2),F(e.SalesPerson),o(2),$t(" ",g(20,19,e.Quantity),"",e.UnitQuantity!=1?" x "+e.UnitQuantity:""," "),o(2),y(r.roleService.product.Cost?21:-1),o(2),D(" ",v(24,21,e.UnitPrice,r.pageData.FractionDigit)," "),o(3),D(" ",v(27,24,e.Total,r.pageData.FractionDigit)," ")}}function ov(i,s){i&1&&b(0,"td",39)}function rv(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",37)(2,"td",38),p(3," Total: "),a(),n(4,"td",36),p(5),d(6,"sum"),d(7,"number"),a(),S(8,ov,1,0,"td",39),b(9,"td",39),n(10,"td",36),p(11),d(12,"sum"),d(13,"number"),a()()()),i&2){let e=m(2);o(2),c("colSpan",e.showBatchNumber?6:5),o(3),F(g(7,7,v(6,4,e.data.Data,"Quantity"))),o(3),y(e.roleService.product.Cost?8:-1),o(3),D(" ",v(13,12,v(12,9,e.data.Data,"Total"),e.pageData.FractionDigit)," ")}}function lv(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5," Outlet "),a(),n(6,"th",21),p(7," Date "),a(),n(8,"th",22),p(9," Invoice # "),a(),S(10,ev,2,0,"th",23),n(11,"th",24),p(12,"Customer"),a(),n(13,"th",25),p(14," SALES PERSON "),a(),n(15,"th",26),p(16," Qty "),a(),S(17,tv,2,0,"th",27),n(18,"th",28),p(19," Price "),a(),n(20,"th",29),p(21," Total "),a()()(),n(22,"tbody"),G(23,av,28,32,"tr",null,Y),a(),S(25,rv,14,15,"tfoot"),a(),n(26,"div",30)(27,"POS-complex-pagination",31),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=m();o(10),y(e.showBatchNumber?10:-1),o(7),y(e.roleService.product.Cost?17:-1),o(6),H(e.data.Data),o(2),y(e.data.Data.length>0?25:-1),o(2),c("total",e.data.Data.length)("pageData",e.pageData)}}var qa=class i extends me{constructor(e,r,t,l,h){super(e,r,"Report/ProductSalesByInvoice","ReportLoader/ProductSalesByInvoice",null,l);this.httpService=r;this.csvConverter=t;this.activatedRoute=l;this.roleService=h}originalData;showBatchNumber=!0;maskingFields;maskingFieldMsg=Rn.maskingField;postInit(e){this.maskingFields=V.generateMaskingField(this.pageData.MaskFields),this.menuData.H=this.pageData.PageTitle,this.originalData=e.Data,this.initShowBatchNumber()}initShowBatchNumber(){let e=this.data?.Data[0]?.SerialBatchNumber;this.showBatchNumber=e!=null}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Outlet":return this.compare(t.Outlet,l.Outlet,h);case"Date":return this.compare(t.Date,l.Date,h);case"Number":return this.compare(t.Number,l.Number,h);case"SerialBatchNumber":return this.compare(t.SerialBatchNumber,l.SerialBatchNumber,h);case"CustomerName":return this.compare(t.CustomerName,l.CustomerName,h);case"SalesPerson":return this.compare(t.SalesPerson,l.SalesPerson,h);case"UnitCost":return this.compare(t.UnitCost,l.UnitCost,h);case"UnitPrice":return this.compare(t.UnitPrice,l.UnitPrice,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Discount":return this.compare(t.Discount,l.Discount,h);case"Total":return this.compare(t.TotalAfterDiscount,l.TotalAfterDiscount,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(Ne),w(j))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-invoice-items"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Search Customer",1,"w-100",3,"ngModelChange","ngModel"],["type","text","autoNum","","min","0",1,"w-100",3,"ngModelChange","ngModel"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Search by Product",1,"w-100",3,"ngModelChange","inputTextValue","ngModel"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search by Variant",1,"w-100",3,"ngModelChange","inputTextValue","renderThumbnail","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet","width","100px",1,"align-left"],["mat-sort-header","Date",1,"align-left",2,"width","80px"],["mat-sort-header","Number",1,"align-left",2,"width","120px"],["mat-sort-header","SerialBatchNumber",1,"align-left"],["mat-sort-header","CustomerName",1,"align-left"],["mat-sort-header","SalesPerson",1,"align-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","60px"],["mat-sort-header","UnitCost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"d-sm-block","mt-2"],["api","Report/ProductSalesByInvoiceCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["target","_blank",3,"routerLink","queryParams"],[1,"w-100"],["routerLink","/menu/Contacts/Contact/Customers/Info","target","_blank",1,"d-block",3,"queryParams"],["matTooltipPosition","above",1,"opacity-75","d-inline",3,"matTooltip"],[1,"text-end"],[1,"table-footer"],[1,"text-end","empty-column",3,"colSpan"],[1,"empty-column"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,ZD,3,0,"a",2),n(3,"a",3),p(4,"Group by Product"),a()(),n(5,"filters"),E(6,$D,28,16,"ng-template",null,0,O),a(),n(8,"content"),S(9,lv,28,5,"div",4),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,XD)),o(6),y(t.data?9:-1))},dependencies:[A,Q,J,Qe,L,R,ie,pe,ge,Ue,Ae,Et,Ce,U,ze,se,re,oe],encapsulation:2})};var pv=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],mv=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"],sv=()=>["/menu/Contacts/Contact/Customers/Info"],cv=i=>({ID:i}),ul=(i,s)=>({"text-danger":i,"text-success":s});function dv(i,s){if(i&1){let e=I();n(0,"a",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function uv(i,s){if(i&1){let e=I();n(0,"div",12)(1,"h6"),p(2,"Brand"),a(),n(3,"ng-select",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListBrandID,t)||(l.pageData.Filter.ListBrandID=t),_(t)}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",14),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",15)(9,"datepicker",16),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(10,"h6"),p(11,"Row Count"),a(),n(12,"input",17),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0),C("ngModel",e.pageData.Filter.ListBrandID),c("items",e.pageData.Options==null?null:e.pageData.Options.Brand),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function _v(i,s){i&1&&(n(0,"th",27),p(1,"Total Cost "),a())}function gv(i,s){i&1&&(n(0,"th",28),p(1,"Profit"),a())}function Cv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.TotalCost?e.TotalCost:0))}}function fv(i,s){if(i&1&&(n(0,"td",37),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,ul,e.Profit<0,e.Profit>0)),o(),D(" ",g(2,2,e.Profit))}}function xv(i,s){if(i&1&&(n(0,"tr")(1,"td",33),p(2),a(),n(3,"td",34),p(4),d(5,"quantityFraction"),a(),n(6,"td",35),p(7),d(8,"amountFraction"),a(),S(9,Cv,3,3,"td",36),S(10,fv,3,7,"td",37),a()),i&2){let e=s.$implicit,r=m(3);o(2),D("",e.BrandName," "),o(2),D(" ",g(5,5,e.Quantity?e.Quantity:0)),o(3),D(" ",g(8,7,e.TotalSales?e.TotalSales:0)),o(2),y(r.roleService.product.Cost?9:-1),o(),y(r.roleService.report.Profit?10:-1)}}function hv(i,s){if(i&1&&(n(0,"tr",29)(1,"td")(2,"a",30),p(3),a()(),n(4,"td",21),p(5),a(),n(6,"td",22),p(7),a(),n(8,"td",23),p(9),a(),n(10,"td",31)(11,"table",32),G(12,xv,11,9,"tr",null,Y),a()()()),i&2){let e=s.$implicit;o(2),c("routerLink",M(7,sv))("queryParams",X(8,cv,e.CustomerID)),o(),$t(" ",e.Name," ",e.Title," "),o(2),F(e.Email),o(2),F(e.Mobile),o(2),F(e.City),o(3),H(e.Detail)}}function Sv(i,s){if(i&1&&(n(0,"td",41),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(2,1,e.data.Total.TotalCost)," ")}}function yv(i,s){if(i&1&&(n(0,"td",42),p(1),d(2,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(4,ul,e.data.Total.Profit<0,e.data.Total.Profit>0)),o(),D(" ",g(2,2,e.data.Total.Profit)," ")}}function Dv(i,s){if(i&1&&(n(0,"tfoot")(1,"tr",38),b(2,"td",39),n(3,"td",40),p(4),d(5,"quantityFraction"),a(),n(6,"td",40),p(7),d(8,"amountFraction"),a(),S(9,Sv,3,3,"td",41),S(10,yv,3,7,"td",42),a()()),i&2){let e=m(2);o(4),D(" ",g(5,4,e.data.Total.Quantity)," "),o(3),D(" ",g(8,6,e.data.Total.TotalSales)," "),o(2),y(e.roleService.product.Cost?9:-1),o(),y(e.roleService.report.Profit?10:-1)}}function vv(i,s){if(i&1){let e=I();n(0,"div",8)(1,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",19)(3,"tr")(4,"th",20),p(5,"Customer "),a(),n(6,"th",21),p(7,"Email"),a(),n(8,"th",22),p(9,"Mobile"),a(),n(10,"th",23),p(11,"City"),a(),n(12,"th",24),p(13,"Brand"),a(),n(14,"th",25),p(15," Qty "),a(),n(16,"th",26),p(17,"Total Sales "),a(),S(18,_v,2,0,"th",27),S(19,gv,2,0,"th",28),a()(),n(20,"tbody"),G(21,hv,14,10,"tr",29,Y),a(),S(23,Dv,11,8,"tfoot"),a()()}if(i&2){let e=m();o(18),y(e.roleService.product.Cost?18:-1),o(),y(e.roleService.report.Profit?19:-1),o(2),H(e.data.Data),o(2),y(e.data?23:-1)}}var Ua=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CustomerBrand","ReportLoader/CustomerBrand");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}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 h=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);default:return 0}}),this.data.Detail=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"SalesNTax":return this.compare(t.TotalSales,l.TotalSales,h);case"Cost":return this.compare(t.TotalCost,l.TotalCost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Brand Sales Analysis",exportTypes:[{ID:"ReportExport/CustomerBrand",Value:"Default",FileName:"Brand Sales Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"SalesReport/CustomerBrandCount",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-brand-sales-analysis"]],standalone:!1,features:[W],decls:20,vars:12,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["api","SalesReport/CustomerBrandCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Brand",1,"ng-select-multiple",3,"ngModelChange","multiple","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name","text","Customer",1,"align-left",2,"width","280px"],[2,"width","190px"],[2,"width","155px"],[2,"width","130px"],[2,"min-width","124px"],["mat-sort-header","Quantity","text","Qty",1,"align-left","text-end",2,"min-width","66px"],["mat-sort-header","SalesNTax","text","Total Sales","arrowPosition","before",1,"flex-right","text-end",2,"min-width","112px"],["mat-sort-header","Cost","text","Total Cost","arrowPosition","before",1,"flex-right","text-end",2,"min-width","113px"],["mat-sort-header","Profit","text","Profit","arrowPosition","before",1,"flex-right","text-end",2,"min-width","114px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["colspan","5",1,"p-0"],[1,"w-100","border-top-0"],[1,"border-top-0","text-start",2,"min-width","124px"],[1,"border-top-0","text-end",2,"min-width","66px"],[1,"border-top-0","text-end",2,"min-width","112px"],[1,"border-top-0","text-end","text-danger",2,"min-width","113px"],[1,"border-top-0","text-end",2,"min-width","114px",3,"ngClass"],[1,"footer"],["colspan","5"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,dv,3,0,"a",2),n(3,"div",3)(4,"button",4),p(5," More "),a(),n(6,"ul",5)(7,"li")(8,"a",6),p(9," Top Brand "),a()(),n(10,"li")(11,"a",6),p(12," Pie Chart "),a()()()()(),n(13,"filters"),E(14,uv,13,7,"ng-template",null,0,O),a(),n(16,"content")(17,"div",7),S(18,vv,24,3,"div",8),n(19,"POS-complex-pagination",9),P("jumpToPage",function(){return u(l),_(t.getListData())})("previousPage",function(){return u(l),_(t.getListData())})("nextPage",function(){return u(l),_(t.getListData())}),a()()()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(6),c("routerLink",M(10,pv)),o(3),c("routerLink",M(11,mv)),o(7),y(t.data?18:-1),o(),c("total",t.data.TransactionCount)("pageData",t.pageData))},dependencies:[A,tt,Q,$,J,Qe,L,R,pe,ge,Ue,Et,Z,ne],encapsulation:2})};var wv=(i,s)=>({rankDown:i,rankUp:s,"number key":!0}),Tv=()=>["/menu/Reports/Sales_Report/Standard/Detail"],Pv=(i,s,e)=>({From:i,To:s,TypeID:e}),_l=(i,s)=>({"text-warning":i,"text-success":s,"text-end":!0}),Ka=(i,s)=>({"text-danger":i,"text-success":s});function Fv(i,s){if(i&1){let e=I();n(0,"button",4),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",5),p(2," Export"),a()}}function Iv(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Year - Month"),a(),n(2,"div",13)(3,"div",14)(4,"ng-select",15),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.Year,t)||(l.Year=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Year=null)}),a()(),n(5,"div",16)(6,"ng-select",17),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.Month,t)||(l.Month=t),_(t)}),P("change",function(){u(e);let t=m(2);return _(t.YearMonthToDateRange())})("clear",function(){u(e);let t=m(2);return _(t.Month=null)}),a()()()}if(i&2){let e=m(2);o(4),C("ngModel",e.Year),c("items",e.Years),o(2),C("ngModel",e.Month),c("items",e.Months)}}function bv(i,s){if(i&1){let e=I();n(0,"div",6)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Order Tag"),a(),n(6,"ng-select",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(7,"h6"),p(8,"From - To"),a(),n(9,"div")(10,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(11,"div",10)(12,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(13,"h6"),p(14,"Compare with Prev Month"),a(),n(15,"radio-options",12),x("modelChange",function(t){u(e);let l=m();return f(l.isCompare,t)||(l.isCompare=t),_(t)}),a(),S(16,Iv,7,4),a()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("model",e.isCompare),o(),y(e.isCompare?16:-1)}}function Ev(i,s){i&1&&(n(0,"th",22),p(1,"Prev"),a())}function Mv(i,s){i&1&&(n(0,"th",23),p(1,"Now"),a())}function Vv(i,s){i&1&&(n(0,"th",24),p(1," Trans "),a())}function Bv(i,s){i&1&&(n(0,"th",25),p(1,"Qty"),a())}function Ov(i,s){i&1&&(n(0,"th",27),p(1,"Tax"),a())}function Lv(i,s){if(i&1&&(n(0,"th",28),p(1," Sales + Tax "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Rv(i,s){i&1&&(n(0,"th",29),p(1,"\xB1 (%)"),a())}function kv(i,s){i&1&&(n(0,"th",30),p(1,"Cost"),a())}function Wv(i,s){if(i&1&&(n(0,"th",28),p(1," Profit "),a()),i&2){let e=m(2);c("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function Nv(i,s){i&1&&(n(0,"th",31),p(1," Target "),a())}function Av(i,s){i&1&&(n(0,"th",32),p(1," Ach(%) "),a())}function Gv(i,s){if(i&1&&(n(0,"td",29),p(1),a()),i&2){let e=m().$implicit;o(),F(e.PrevIndex)}}function Hv(i,s){if(i&1&&(n(0,"td",41),p(1),a()),i&2){let e=m(),r=e.$implicit,t=e.$index;c("ngClass",fe(2,wv,r.PrevIndex<t+1,r.PrevIndex>t+1)),o(),D(" ",r.CurrentIndex," ")}}function Qv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"quantityFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.Quantity))}}function Yv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;o(),F(v(2,1,e.Count,".0-0"))}}function jv(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function qv(i,s){if(i&1&&(n(0,"td",29)(1,"a",42),d(2,"date"),d(3,"date"),n(4,"b"),p(5),d(6,"amountFraction"),a()()()),i&2){let e=m().$implicit,r=m(2);o(),c("routerLink",M(11,Tv))("queryParams",_t(12,Pv,v(2,3,r.pageData.Filter.From,"ddMMyyyy"),v(3,6,r.pageData.Filter.To,"ddMMyyyy"),e.TypeID)),o(4),F(g(6,9,e.SalesWithTax))}}function Uv(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,_l,e.IsNegative,e.IsPositive)),o(),D(" ",g(2,2,e.Increase)," ")}}function zv(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Kv(i,s){if(i&1&&(n(0,"td",40),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit,r=m(2);o(),D(" ",g(2,1,r.pageData.IgnoreTax?e.Profit:e.ProfitWithTax)," ")}}function Xv(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.SalesTarget)," ")}}function Jv(i,s){if(i&1&&(n(0,"span",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Ka,e.Achievement<0,e.Achievement>0)),o(),D(" ",g(2,2,e.Achievement)," ")}}function Zv(i,s){if(i&1&&(n(0,"span",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2).$implicit;c("ngClass",fe(4,Ka,e.AchievementWithTax<0,e.AchievementWithTax>0)),o(),D(" ",g(2,2,e.AchievementWithTax)," ")}}function $v(i,s){if(i&1&&(n(0,"td",29),S(1,Jv,3,7,"span",38),S(2,Zv,3,7,"span",38),a()),i&2){let e=m(3);o(),y(e.pageData.IgnoreTax?-1:1),o(),y(e.pageData.IgnoreTax?2:-1)}}function e3(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td",34),p(4),a(),S(5,Gv,2,1,"td",29),S(6,Hv,2,5,"td",41),S(7,Qv,3,3,"td",29),S(8,Yv,3,4,"td",29),n(9,"td",29),p(10),d(11,"amountFraction"),a(),S(12,jv,3,3,"td",36),d(13,"HideSumZero"),S(14,qv,7,16,"td",29),S(15,Uv,3,7,"td",38),S(16,zv,3,3,"td",39),S(17,Kv,3,3,"td",40),S(18,Xv,3,3,"td",29),d(19,"HideSumZero"),S(20,$v,3,2,"td",29),d(21,"HideSumZero"),d(22,"HideSumZero"),a()),i&2){let e=s.$implicit,r=s.$index,t=m(2);o(2),F(r+1),o(2),F(e.Name),o(),y(t.showCompareColumn?5:-1),o(),y(t.showCompareColumn?6:-1),o(),y(t.data.WithCategory?7:-1),o(),y(t.data.WithCategory?-1:8),o(2),F(g(11,14,e.SalesNet)),o(2),y(!t.data.WithCategory&&v(13,16,t.data.Data,"Tax")?12:-1),o(2),y(t.data.WithCategory?-1:14),o(),y(t.showCompareColumn?15:-1),o(),y(t.roleService.product.Cost?16:-1),o(),y(t.roleService.report.Profit?17:-1),o(),y(v(19,19,t.data.Data,"SalesTarget")?18:-1),o(2),y(v(21,22,t.roleService.report.Profit&&t.data.Data,"AchievementWithTax")||v(22,25,t.data.Data,"Achievement")?20:-1)}}function t3(i,s){i&1&&b(0,"td",35)}function i3(i,s){i&1&&b(0,"td",35)}function n3(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"number"),a()),i&2){let e=m(2);o(),D(" ",v(3,4,v(2,1,e.data.Data,"Count"),".0-0")," ")}}function a3(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"quantityFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Quantity"))," ")}}function o3(i,s){if(i&1&&(n(0,"td",36),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Tax"))," ")}}function r3(i,s){if(i&1&&(n(0,"td",37)(1,"a",43),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.data.Data,"SalesWithTax")))}}function l3(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",fe(5,_l,e.comparation<0,e.comparation>0)),o(),D(" ",v(2,2,e.comparation,".0-0")," ")}}function p3(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Cost"))," ")}}function m3(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),F(g(3,4,v(2,1,e.data.Data,"Profit")))}}function s3(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(3);o(),D(" ",g(3,4,v(2,1,e.data.Data,"ProfitWithTax"))," ")}}function c3(i,s){if(i&1&&(n(0,"td",40),S(1,m3,4,6,"span"),S(2,s3,4,6,"span"),a()),i&2){let e=m(2);o(),y(e.pageData.IgnoreTax?1:-1),o(),y(e.pageData.IgnoreTax?-1:2)}}function d3(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"sum"),d(3,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(3,4,v(2,1,e.data.Data,"Expense"))," ")}}function u3(i,s){if(i&1&&(n(0,"span",38),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(22,Ka,v(1,2,e.data.Data,"Sales")/v(2,5,e.data.Data,"SalesTarget")<0,v(3,8,e.data.Data,"Sales")/v(4,11,e.data.Data,"SalesTarget")>0)),o(5),D(" ",g(8,20,v(6,14,e.data.Data,"Sales")/v(7,17,e.data.Data,"SalesTarget"))," ")}}function _3(i,s){if(i&1&&(n(0,"span",38),d(1,"sum"),d(2,"sum"),d(3,"sum"),d(4,"sum"),p(5),d(6,"sum"),d(7,"sum"),d(8,"amountFraction"),a()),i&2){let e=m(3);c("ngClass",fe(22,Ka,v(1,2,e.data.Data,"SalesWithTax")/v(2,5,e.data.Data,"SalesTarget")<0,v(3,8,e.data.Data,"SalesWithTax")/v(4,11,e.data.Data,"SalesTarget")>0)),o(5),D(" ",g(8,20,v(6,14,e.data.Data,"SalesWithTax")/v(7,17,e.data.Data,"SalesTarget"))," ")}}function g3(i,s){if(i&1&&(n(0,"td",29),S(1,u3,9,25,"span",38),S(2,_3,9,25,"span",38),a()),i&2){let e=m(2);o(),y(e.pageData.IgnoreTax?-1:1),o(),y(e.pageData.IgnoreTax?2:-1)}}function C3(i,s){if(i&1){let e=I();n(0,"div",3)(1,"div",18)(2,"table",19),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(3,"thead",20)(4,"tr")(5,"th"),p(6,"No."),a(),n(7,"th",21),p(8,"Tag"),a(),S(9,Ev,2,0,"th",22),S(10,Mv,2,0,"th",23),S(11,Vv,2,0,"th",24),S(12,Bv,2,0,"th",25),n(13,"th",26),p(14,"Sales"),a(),S(15,Ov,2,0,"th",27),d(16,"HideSumZero"),S(17,Lv,2,1,"th",28),S(18,Rv,2,0,"th",29),S(19,kv,2,0,"th",30),S(20,Wv,2,1,"th",28),S(21,Nv,2,0,"th",31),d(22,"HideSumZero"),S(23,Av,2,0,"th",32),d(24,"HideSumZero"),d(25,"HideSumZero"),a()(),n(26,"tbody"),G(27,e3,23,28,"tr",null,Y),a(),n(29,"tfoot")(30,"tr",33),b(31,"td")(32,"td",34),S(33,t3,1,0,"td",35),S(34,i3,1,0,"td",35),S(35,n3,4,7,"td",29),S(36,a3,4,6,"td",29),n(37,"td",29),p(38),d(39,"sum"),d(40,"amountFraction"),a(),S(41,o3,4,6,"td",36),d(42,"HideSumZero"),S(43,r3,5,6,"td",37),S(44,l3,3,8,"td",38),S(45,p3,4,6,"td",39),S(46,c3,3,2,"td",40),S(47,d3,4,6,"td",29),d(48,"HideSumZero"),S(49,g3,3,2,"td",29),d(50,"HideSumZero"),d(51,"HideSumZero"),a()()()()()}if(i&2){let e=m();o(9),y(e.showCompareColumn?9:-1),o(),y(e.showCompareColumn?10:-1),o(),y(e.data.WithCategory?-1:11),o(),y(e.data.WithCategory?12:-1),o(3),y(!e.data.WithCategory&&v(16,23,e.data.Data,"Tax")?15:-1),o(2),y(e.data.WithCategory?-1:17),o(),y(e.showCompareColumn?18:-1),o(),y(e.roleService.product.Cost?19:-1),o(),y(e.roleService.report.Profit?20:-1),o(),y(v(22,26,e.data.Data,"SalesTarget")?21:-1),o(2),y(v(24,29,e.data.Data,"AchievementWithTax")||v(25,32,e.data.Data,"Achievement")&&e.roleService.report.Profit?23:-1),o(4),H(e.data.Data),o(6),y(e.showCompareColumn?33:-1),o(),y(e.showCompareColumn?34:-1),o(),y(e.data.WithCategory?-1:35),o(),y(e.data.WithCategory?36:-1),o(2),D(" ",g(40,38,v(39,35,e.data.Data,"SalesNet"))," "),o(3),y(!e.data.WithCategory&&v(42,40,e.data.Data,"Tax")?41:-1),o(2),y(e.data.WithCategory?-1:43),o(),y(e.showCompareColumn?44:-1),o(),y(e.roleService.product.Cost?45:-1),o(),y(e.roleService.report.Profit?46:-1),o(),y(e.roleService.product.Expense&&v(48,43,e.data.Data,"Expense")?47:-1),o(2),y(v(50,46,e.roleService.report.Profit&&e.data.Data,"AchievementWithTax")||v(51,49,e.data.Data,"Achievement")?49:-1)}}var za=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/OutletPerformanceByType","ReportLoader/OutletPerformance");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h;let T=new Date;this.Year=T.getFullYear(),this.Month=T.getMonth()}isCompare=!1;showCompareColumn=!1;DateFilterType=!1;Year;Month;Months=[{ID:0,Label:"Jan"},{ID:1,Label:"Feb"},{ID:2,Label:"Mar"},{ID:3,Label:"Apr"},{ID:4,Label:"May"},{ID:5,Label:"Jun"},{ID:6,Label:"Jul"},{ID:7,Label:"Aug"},{ID:8,Label:"Sep"},{ID:9,Label:"Oct"},{ID:10,Label:"Nov"},{ID:11,Label:"Dec"}];Years=V.GenerateYears(new Date().getFullYear(),11,!0);RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];postInit(e){this.originalData=e.Data,this.onCompareData()}onCompareData(){this.isCompare?(this.OnCompare("Data"),this.showCompareColumn=!0):this.showCompareColumn=!1}YearMonthToDateRange(){let e=new Date;this.Year==null&&(this.Year=e.getFullYear()),this.Month==null&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1).toDateString(),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0).toDateString()}sortData(e){let r=JSON.parse(JSON.stringify(this.originalData));if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Count":return this.compare(t.Count,l.Count,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Gross":return this.compare(t.Gross,l.Gross,h);case"SalesNet":return this.compare(t.SalesNet,l.SalesNet,h);case"SalesTaxNet":return this.compare(t.SalesNet,l.SalesNet,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"SalesWithTax":return this.compare(t.SalesWithTax,l.SalesWithTax,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);case"ProfitWithTax":return this.compare(t.ProfitWithTax,l.ProfitWithTax,h);case"Expense":return this.compare(t.Expense,l.Expense,h);case"NetProfit":return this.compare(t.NetProfit,l.NetProfit,h);case"Target":return this.compare(t.SalesTarget,l.SalesTarget,h);case"SalesTarget":return this.compare(t.SalesTarget,l.SalesTarget,h);case"Achievement":return this.compare(t.Achievement,l.Achievement,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales Order Tag",exportTypes:[{ID:"ReportExport/OutletPerformanceByType",Value:"Default",FileName:"Sales Order Tag"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-by-sales-order-type"]],standalone:!1,features:[W],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["name","Compare",3,"modelChange","model"],[1,"row"],[1,"col-6","pe-2"],["appendTo","body","placeholder","Choose Year",3,"ngModelChange","change","clear","ngModel","items"],[1,"col-6","ps-2"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Month",3,"ngModelChange","change","clear","ngModel","items"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["matTooltip","Displays the sales ranking of the outlet group for the previous month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["matTooltip","Displays the sales ranking of the outlet group for the current month","matTooltipPosition","above",1,"text-end",2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"align-left"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-left"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left"],["arrowPosition","before",1,"flex-left",3,"mat-sort-header"],[1,"text-end"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left"],["mat-sort-header","Target","arrowPosition","before",1,"align-left"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"align-left"],[1,"footer"],[1,"freeze","body"],[1,"empty-column"],[1,"text-end","text-warning-emphasis"],[1,"text-end","text-primary"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"text-end",3,"ngClass"],[3,"routerLink","queryParams"],[1,"fw-bold"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Fv,3,0,"button",2),a(),n(3,"filters"),E(4,bv,17,10,"ng-template",null,0,O),a(),n(6,"content"),S(7,C3,52,52,"div",3),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(5),y(t.data?7:-1))},dependencies:[A,tt,Q,$,J,L,R,ie,pe,ge,Te,U,se,ei,re,oe,Z,ne],encapsulation:2})};var gl=Jt(Po());var f3=new Zt("HIGHCHARTS_LOADER"),x3=new Zt("HIGHCHARTS_ROOT_MODULES"),h3=new Zt("HIGHCHARTS_OPTIONS"),S3=new Zt("HIGHCHARTS_CONFIG"),y3=new Zt("HIGHCHARTS_TIMEOUT"),D3=(()=>{let s=class s{constructor(){this.highcharts=dt(null),this.loader=Pe(f3),this.globalOptions=Pe(h3,{optional:!0}),this.globalModules=Pe(x3,{optional:!0})}loadHighchartsWithModules(r){return Hi(this,null,function*(){let t=yield this.loader();return yield Promise.allSettled([...this.globalModules?.()??[],...r?.modules?.()??[]]),t})}load(r){this.loadHighchartsWithModules(r).then(t=>{this.globalOptions&&t.setOptions(this.globalOptions),this.highcharts.set(t)})}};s.\u0275fac=function(t){return new(t||s)},s.\u0275prov=an({token:s,factory:s.\u0275fac,providedIn:"root"});let i=s;return i})(),v3=(()=>{let s=class s{delay(r){return new Promise(t=>setTimeout(t,r))}keepChartUpToDate(){dn(()=>Hi(this,null,function*(){this.update();let r=yield this.chart();this.chartCreated?r?.update(this.options(),!0,this.oneToOne()):r&&(this.chartCreated=!0)}))}destroyChart(){return Hi(this,null,function*(){let r=yield this.chart();r&&r.destroy()})}constructor(){this.constructorType=hi("chart"),this.oneToOne=hi(!1),this.options=hi.required(),this.update=un(),this.chartInstance=Ho(),this.destroyRef=Pe(Lo),this.el=Pe(Ro),this.platformId=Pe(ko),this.relativeConfig=Pe(S3,{optional:!0}),this.timeout=Pe(y3,{optional:!0}),this.highchartsChartService=Pe(D3),this.chartCreated=!1,this.constructorChart=xi(()=>{let r=this.highchartsChartService.highcharts();if(r)return r[this.constructorType()]}),this.chart=xi(()=>Hi(this,null,function*(){return yield this.delay(this.relativeConfig?.timeout??this.timeout??500),this.constructorChart()?.(this.el.nativeElement,Go(()=>this.options()),r=>this.chartInstance.emit(r))})),!(this.platformId&&zo(this.platformId))&&(this.highchartsChartService.load(this.relativeConfig),this.destroyRef.onDestroy(()=>this.destroyChart()),jo(()=>{this.update()&&this.update.set(!1)}),this.keepChartUpToDate())}};s.\u0275fac=function(t){return new(t||s)},s.\u0275dir=pn({type:s,selectors:[["","highchartsChart",""]],inputs:{constructorType:[1,"constructorType"],oneToOne:[1,"oneToOne"],options:[1,"options"],update:[1,"update"]},outputs:{update:"updateChange",chartInstance:"chartInstance"}});let i=s;return i})(),Xa=(()=>{let s=class s{};s.\u0275fac=function(t){return new(t||s)},s.\u0275cmp=B({type:s,selectors:[["highcharts-chart"]],features:[mn([{directive:v3,inputs:["constructorType","constructorType","oneToOne","oneToOne","options","options","update","update"],outputs:["chartInstance","chartInstance","updateChange","updateChange"]}])],decls:0,vars:0,template:function(t,l){},encapsulation:2,changeDetection:0});let i=s;return i})();function T3(i,s){if(i&1){let e=I();n(0,"div",3)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",4),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Date From - To"),a(),n(6,"div",5)(7,"div",6)(8,"datepicker",7),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(9,"div",6)(10,"datepicker",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()(),n(11,"h6"),p(12,"Price Range"),a(),n(13,"input",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.PriceRange,t)||(l.pageData.Filter.PriceRange=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Outlets),C("ngModel",e.pageData.Filter.ListIDs),o(5),C("ngModel",e.pageData.Filter.From),c("showClearBtn",!0)("showTodayBtn",!0),o(2),C("ngModel",e.pageData.Filter.To),c("showClearBtn",!0)("showTodayBtn",!0),o(3),C("ngModel",e.pageData.Filter.PriceRange)}}function P3(i,s){if(i&1){let e=I();n(0,"button",10),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",11),p(2," Export "),a()}}function F3(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),d(3,"number"),d(4,"number"),a(),n(5,"td",21),p(6),d(7,"quantityFraction"),a(),n(8,"td",21),p(9),d(10,"quantityFraction"),a()()),i&2){let e=s.$implicit;o(2),$t(" ",g(3,4,e.KeyValue.Key.StartNumber)," - ",g(4,6,e.KeyValue.Key.EndNumber)," "),o(4),D(" ",e.KeyValue.Value!=0?g(7,8,e.KeyValue.Value):"-"," "),o(3),F(g(10,10,e.Sales))}}function I3(i,s){if(i&1&&(n(0,"content")(1,"div",12)(2,"div",5)(3,"div",6)(4,"table",13)(5,"thead",14)(6,"tr",15)(7,"th",16),p(8,"Price"),a(),n(9,"th",17),p(10,"Qty"),a(),n(11,"th"),p(12,"Sales"),a()()(),n(13,"tbody"),G(14,F3,11,12,"tr",null,Y),a()()(),n(16,"div",6)(17,"div",18)(18,"div",19),b(19,"highcharts-chart",20),a()()()()()()),i&2){let e=m();o(14),H(e.data.Data),o(5),c("Highcharts",e.Highcharts)("options",e.chartOptions())}}Gn(gl.default);var Ja=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/UnitPriceAnalysis","ReportLoader/PriceAnalysis",void 0,void 0,!0);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}Highcharts=Bi;chartOptions=dt(null);openExportModal(){this.matDialog.open(K,{data:{title:"Price Analysis",exportTypes:[{ID:"ReportExport/PriceAnalysis",Value:"Default",FileName:"Price Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(e){super.postInit(e),this.chartOptions.set({chart:{type:"pie",style:{fontFamily:'"Roboto-Slab", sans-serif'}},title:{text:"Price Analysis Chart"},credits:{enabled:!1},tooltip:{headerFormat:"",pointFormat:'<span style="color:{point.color}">\u25CF</span> {point.name}: <b>{point.y:.1f}</b>'},plotOptions:{pie:{allowPointSelect:!0,borderWidth:2,cursor:"pointer",dataLabels:{enabled:!0,format:"<b>{point.name}</b><br>{point.y}",distance:20},showInLegend:!0}},series:[{type:"pie",data:[...e.PieChartData.map(r=>({name:r.Name,y:r.Qty}))]}]})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["CustomerDisplay-price-analysis"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"row"],[1,"col-6"],["appearance","outline","name","From",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["appearance","outline","name","To",3,"ngModelChange","ngModel","showClearBtn","showTodayBtn"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","table-bordered"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","250px"],[2,"width","150px"],[1,"card"],[1,"card-body"],[2,"width","100%","height","400px","display","block",3,"Highcharts","options"],[1,"text-end"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"filters"),E(2,T3,14,11,"ng-template",null,0,O),a(),n(4,"actions"),S(5,P3,3,0,"button",2),a(),S(6,I3,20,2,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(5),y(t.roleService.global.Export?5:-1),o(),y(t.data?6:-1))},dependencies:[A,J,Qe,L,R,Ue,U,Xa,re,ne],encapsulation:2})};var b3=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],Cl=i=>({ID:i});function E3(i,s){if(i&1){let e=I();n(0,"button",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function M3(i,s){if(i&1){let e=I();n(0,"div")(1,"div",5)(2,"h6"),p(3,"Outlet"),a(),n(4,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(5,"h6"),p(6,"From - To"),a(),n(7,"div")(8,"datepicker",7),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),a()(),n(9,"div",8)(10,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),a()(),n(11,"h6"),p(12,"Tax"),a(),n(13,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TypeID,t)||(l.pageData.Filter.TypeID=t),_(t)}),a(),n(14,"h6"),p(15,"Page Size"),a(),n(16,"input",11),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a()()()}if(i&2){let e=m();o(4),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.TypeID),c("items",e.pageData.Options==null?null:e.pageData.Options.Types),o(3),c("max",1e4),C("ngModel",e.pageData.Filter.RowCount)}}function V3(i,s){i&1&&(n(0,"th",21),p(1," Purchase "),a())}function B3(i,s){i&1&&(n(0,"th",22),p(1," Tax "),a())}function O3(i,s){if(i&1&&b(0,"th",23),i&2){let e=s.$implicit;c("innerHtml",e.Label+" ("+e.Rate+"%)",Ee)}}function L3(i,s){if(i&1&&(n(0,"td",38),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Sales)," ")}}function R3(i,s){if(i&1&&(n(0,"td",39),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Tax)," ")}}function k3(i,s){if(i&1&&(b(0,"td",40),d(1,"TaxDefault"),d(2,"number")),i&2){let e=s.$index,r=m().$implicit,t=m(2);c("innerHtml",g(2,5,fi(1,1,t.data.Compenents,r,e)),Ee)}}function W3(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",36),p(5),a()(),n(6,"td")(7,"a",37),p(8),a()(),n(9,"td"),p(10),a(),n(11,"td"),p(12),d(13,"date"),a(),S(14,L3,3,3,"td",38),S(15,R3,3,3,"td",39),G(16,k3,3,7,"td",40,Y),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(13,b3))("queryParams",X(14,Cl,e.ID)),o(),F(e.Number),o(2),c("queryParams",X(16,Cl,e.SupplierID)),o(),D(" ",e.Name," "),o(2),F(e.TaxName),o(2),F(v(13,10,e.Date,"dd MMM yyyy")),o(2),y(r.roleService.product.Cost?14:-1),o(),y(r.roleService.product.Cost?15:-1),o(),H(r.getComponent(r.data))}}function N3(i,s){if(i&1&&(n(0,"td",27)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.infiniteList,"Sales")))}}function A3(i,s){if(i&1&&(n(0,"td",27)(1,"span"),p(2),d(3,"sum"),d(4,"amountFraction"),a()()),i&2){let e=m(2);o(2),F(g(4,4,v(3,1,e.infiniteList,"Tax")))}}function G3(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=s.$implicit;o(),D(" ",g(2,1,e.SumTaxAmount)," ")}}function H3(i,s){if(i&1){let e=I();n(0,"span",41),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport"))}),n(1,"i",42),p(2,"?"),a()()}}function Q3(i,s){if(i&1&&(n(0,"span"),p(1),d(2,"number"),a()),i&2){let e=m(2);o(),F(g(2,1,e.listTotal))}}function Y3(i,s){if(i&1){let e=I();n(0,"a",43),P("click",function(){u(e);let t=m(2);return _(t.NextPage(!0))}),b(1,"i",44),p(2," Next"),a()}}function j3(i,s){if(i&1){let e=I();n(0,"a",45),P("click",function(){u(e);let t=m(2);return _(t.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport",!0))}),b(1,"i",46),p(2," Show All"),a()}}function q3(i,s){if(i&1){let e=I();n(0,"content")(1,"div",12)(2,"div",13)(3,"table",14),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",15)(5,"tr")(6,"th",16),p(7,"Outlet"),a(),n(8,"th",17),p(9,"Number"),a(),n(10,"th",18),p(11,"Supplier"),a(),n(12,"th",19),p(13," Type "),a(),n(14,"th",20),p(15,"Date"),a(),S(16,V3,2,0,"th",21),S(17,B3,2,0,"th",22),G(18,O3,1,1,"th",23,Y),a()(),n(20,"tbody"),G(21,W3,18,18,"tr",null,Y),a(),n(23,"tfoot")(24,"tr",24),b(25,"td",25),n(26,"td",26),p(27,"Total :"),a(),S(28,N3,5,6,"td",27),S(29,A3,5,6,"td",27),G(30,G3,3,3,"td",28,Y),a()()()(),n(32,"div",29)(33,"div",30)(34,"div",31),p(35),d(36,"number"),S(37,H3,3,0,"span",32),S(38,Q3,3,3,"span"),p(39),a()(),n(40,"div",33),S(41,Y3,3,0,"a",34),S(42,j3,3,0,"a",35),a()()()()}if(i&2){let e=m();o(16),y(e.roleService.product.Cost?16:-1),o(),y(e.roleService.product.Cost?17:-1),o(),H(e.data.Compenents),o(3),H(e.infiniteList),o(7),y(e.roleService.product.Cost?28:-1),o(),y(e.roleService.product.Cost?29:-1),o(),H(e.data.Compenents),o(5),D(" Showing 1 - ",g(36,10,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),o(2),y(e.pageData.HideStoreApiCount?-1:37),o(),y(e.pageData.HideStoreApiCount?38:-1),o(),D(" records ~ ",e.pageData.Filter.PageNumber," Page "),o(2),y(!e.nextPageDisabled&&!e.goToLast?41:-1),o(),y(!e.nextPageDisabled&&!e.goToLast?42:-1)}}var Za=class i extends vi{constructor(e,r,t,l,h,T){super(e,r,"Report/GetPurchaseTaxReport","ReportLoader/GetTaxReport",t);this.httpService=r;this.csvConverter=l;this.roleService=h;this.matDialog=T}openExportModal(){this.matDialog.open(K,{data:{title:"Purchase Tax Report",exportTypes:[{ID:"ReportExport/GetPurchaseTaxReport",Value:"Default",FileName:"Purchase Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountPurchaseTaxReport",pagination:!0}})}getComponent(e){return e.Component=[],this.data.Compenents.forEach((r,t)=>{e.Tax!=0?(r.TaxTax=t==0?e.Tax:this.data.Compenents[t-1].TaxTax,r.TaxTax=t==0?r.TaxTax:r.TaxTax+r.TaxTax*this.data.Compenents[t-1].Rate/100,e.Component[t]=r.TaxTax*r.Rate/100,r.SumTaxAmount=r.SumTaxAmount+e.Component[t]):e.Component[t]=0}),e.Component}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 h=e.direction==="asc";switch(t.Name=t.Name==null?"":t.Name,l.Name=l.Name==null?"":l.Name,t.EntityName=t.EntityName==null?"":t.EntityName,l.EntityName=l.EntityName==null?"":l.EntityName,e.active){case"Name":return this.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Outlet":return this.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),h);case"Number":return this.compare(t.Number,l.Number,h);case"Date":return this.compare(t.Date,l.Date,h);case"Tax":return this.compare(t.Tax,l.Tax,h);default:return 0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(qe),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-purchase-tax-report"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Label","bindValue","ID","placeholder","Choose Tax Type",3,"ngModelChange","ngModel","items"],["type","text","autoNum","","name","RowCount",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Number"],["mat-sort-header","Name"],["mat-sort-header","TaxName","matTooltip","Tax Type",2,"width","150px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","Tax","arrowPosition","before","matTooltip","Tax Amount",1,"flex-right","text-end",2,"width","150px"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[1,"table-footer"],["colspan","4",1,"text-end","empty-column"],[1,"text-end","empty-column"],[1,"text-end","text-success"],[1,"text-end",2,"width","150px"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],[2,"cursor","pointer"],[1,"btn-group"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","matTooltipPosition","above","matTooltip","Load all data",1,"btn","btn-outline-secondary","btn-sm","text-primary"],[3,"routerLink","queryParams"],["routerLink","/menu/Contacts/Contact/Suppliers/Info/V2","target","_blank",3,"queryParams"],[1,"text-end"],[1,"text-end","text-warning-emphasis"],[1,"text-end",2,"width","150px",3,"innerHtml"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all data",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,E3,3,0,"button",2),a(),n(3,"filters"),E(4,M3,17,10,"ng-template",null,0,O),a(),S(6,q3,43,12,"content"),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,Q,$,J,Qe,L,R,ie,pe,ge,Ue,U,se,Fi,re,oe,Z],encapsulation:2})};var U3=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand"],z3=()=>["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"];function K3(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"From - To"),a(),n(6,"div")(7,"datepicker",9),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(8,"div",10)(9,"datepicker",11),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To)}}function X3(i,s){if(i&1&&(n(0,"div",6),b(1,"POS-pie-chart",12),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var $a=class i extends De{constructor(e,r,t){super(e,r,"Report/BrandRank","ReportLoader/BrandRank",null,t);this.httpService=r}chartData;chartConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}};postInit(){this.menuData.H=this.data.PageTitle,this.initChartSeries()}initChartSeries(){let e=[];this.data?.Data?.forEach(r=>{let t={name:r.BrandName,y:r.Total};e.push(t)}),this.chartData=e}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(Ne))};static \u0275cmp=B({type:i,selectors:[["app-top-brand-chart"]],standalone:!1,features:[W],decls:17,vars:9,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[1,"container-fluid","mt-5"],[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"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"div",2)(3,"button",3),p(4," More "),a(),n(5,"ul",4)(6,"li")(7,"a",5),p(8," Top Brand "),a()(),n(9,"li")(10,"a",5),p(11," Brand Sales Analysis "),a()()()()(),n(12,"filters"),E(13,K3,10,6,"ng-template",null,0,O),a(),n(15,"content"),S(16,X3,2,2,"div",6),a()()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(7),c("routerLink",M(7,U3)),o(3),c("routerLink",M(8,z3)),o(6),y(t.data?16:-1))},dependencies:[A,Q,J,L,R,ii,U],encapsulation:2})};var J3=()=>["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"],ki=i=>[i],fl=(i,s)=>({"text-danger":i,"text-success":s});function Z3(i,s){if(i&1){let e=I();n(0,"button",5),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",6),p(2," Export "),a()}}function $3(i,s){if(i&1){let e=I();n(0,"div",7)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",9),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Sales Order Tag"),a(),n(9,"ng-select",10),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesOrderTagIDs,t)||(l.pageData.Filter.SalesOrderTagIDs=t),_(t)}),a(),n(10,"h6"),p(11,"Date"),a(),n(12,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onChangeFilterDate1(t))}),a(),n(13,"h6"),p(14,"Compare With"),a(),n(15,"app-datepicker-range",11),P("dateChange",function(t){u(e);let l=m();return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),c("multiple",!0),C("ngModel",e.pageData.Filter.SalesOrderTagIDs),c("items",e.pageData.Options==null?null:e.pageData.Options.SalesOrderTags),o(3),c("from",e.pageData.Filter.From_range1)("to",e.pageData.Filter.To_range1),o(3),c("from",e.pageData.Filter.From_range2)("to",e.pageData.Filter.To_range2)}}function ew(i,s){if(i&1&&(n(0,"th",19),p(1),a()),i&2){let e=m(2);o(),D(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function tw(i,s){if(i&1&&(n(0,"th",21),p(1),a()),i&2){let e=m(2);o(),D(" ",e.pageData.Config.IgnoreTax?"Net Profit":"Profit"," ")}}function iw(i,s){i&1&&(n(0,"th",23),p(1," Profit "),a())}function nw(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetProfit1)," ")}}function aw(i,s){if(i&1&&(n(0,"td",28),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.NetProfit2)," ")}}function ow(i,s){if(i&1&&(n(0,"td",29),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",fe(4,fl,e.Growth<0,e.Growth>0)),o(),D(" ",g(2,2,e.Growth),"% ")}}function rw(i,s){if(i&1&&(n(0,"tr")(1,"td",26),p(2),a(),n(3,"td",27),p(4),d(5,"amountFraction"),a(),S(6,nw,3,3,"td",28),n(7,"td",27),p(8),d(9,"amountFraction"),a(),S(10,aw,3,3,"td",28),n(11,"td",29),p(12),d(13,"amountFraction"),a(),S(14,ow,3,7,"td",29),a()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(),c("colSpan",r.roleService.report.Profit?1:2),o(),D(" ",g(5,10,e.SalesNTax1)," "),o(2),y(r.roleService.report.Profit?6:-1),o(),c("colSpan",r.roleService.report.Profit?1:2),o(),D(" ",g(9,12,e.SalesNTax2)," "),o(2),y(r.roleService.report.Profit?10:-1),o(),c("ngClass",fe(16,fl,e.Revenue<0,e.Revenue>0)),o(),D(" ",g(13,14,e.Revenue),"% "),o(2),y(r.roleService.report.Profit?14:-1)}}function lw(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,ki,e.netProfit1Total>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.netProfit1Total)," ")}}function pw(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,ki,e.netProfit2Total>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.netProfit2Total)," ")}}function mw(i,s){if(i&1&&(n(0,"td",25),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",X(4,ki,e.profitPercentage>0?"text-success":"text-danger")),o(),D(" ",g(2,2,e.profitPercentage),"% ")}}function sw(i,s){if(i&1){let e=I();n(0,"div",4)(1,"table",12),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(2,"thead",13)(3,"tr")(4,"th",14),p(5," Outlet "),a(),n(6,"th",15)(7,"span"),p(8),d(9,"date"),a(),p(10," - "),n(11,"span"),p(12),d(13,"date"),a()(),n(14,"th",16)(15,"span"),p(16),d(17,"date"),a(),p(18," - "),n(19,"span"),p(20),d(21,"date"),a()(),n(22,"th",16),p(23,"YOY Growth"),a()(),n(24,"tr",17)(25,"th",18),p(26),a(),S(27,ew,2,1,"th",19),n(28,"th",20),p(29),a(),S(30,tw,2,1,"th",21),n(31,"th",22),p(32,"Revenue"),a(),S(33,iw,2,0,"th",23),a()(),n(34,"tbody"),G(35,rw,15,19,"tr",null,Y),a(),n(37,"tfoot")(38,"tr"),b(39,"td"),n(40,"td",24),p(41),d(42,"amountFraction"),a(),S(43,lw,3,6,"td",25),n(44,"td",24),p(45),d(46,"amountFraction"),a(),S(47,pw,3,6,"td",25),n(48,"td",25),p(49),d(50,"amountFraction"),a(),S(51,mw,3,6,"td",25),a()()()()}if(i&2){let e=m();o(8),F(v(9,22,e.pageData.Filter.From_range1,"dd MMMM yyyy")),o(4),F(v(13,25,e.pageData.Filter.To_range1,"dd MMMM yyyy")),o(4),F(v(17,28,e.pageData.Filter.From_range2,"dd MMMM yyyy")),o(4),F(v(21,31,e.pageData.Filter.To_range2,"dd MMMM yyyy")),o(5),c("colSpan",e.roleService.report.Profit?1:2),o(),D(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),y(e.roleService.report.Profit?27:-1),o(),c("colSpan",e.roleService.report.Profit?1:2),o(),D(" ",e.pageData.Config.IgnoreTax?"Sales":"Sales + Tax"," "),o(),y(e.roleService.report.Profit?30:-1),o(3),y(e.roleService.report.Profit?33:-1),o(2),H(e.data),o(5),c("colSpan",e.roleService.report.Profit?1:2)("ngClass",X(40,ki,e.salesNTax1Total>0?"text-success":"text-danger")),o(),D(" ",g(42,34,e.salesNTax1Total)," "),o(2),y(e.roleService.report.Profit?43:-1),o(),c("colSpan",e.roleService.report.Profit?1:2)("ngClass",X(42,ki,e.salesNTax2Total>0?"text-success":"text-danger")),o(),D(" ",g(46,36,e.salesNTax2Total)," "),o(2),y(e.roleService.report.Profit?47:-1),o(),c("ngClass",X(44,ki,e.salesNTaxPercentage>0?"text-success":"text-danger")),o(),D(" ",g(50,38,e.salesNTaxPercentage),"% "),o(2),y(e.roleService.report.Profit?51:-1)}}var eo=class i extends me{constructor(e,r,t,l,h,T){super(t,l,"Report/SalesCompareByRange","ReportLoader/SalesCompareByRange");this.csvConverter=e;this.roleService=r;this.sumPipe=h;this.matDialog=T}salesNTax1Total=0;salesNTax2Total=0;netProfit1Total=0;netProfit2Total=0;salesNTaxPercentage=0;profitPercentage=0;originalData;ngOnInit(){}postInit(e){this.menuData.H="Sales Compare By Outlet",this.salesNTax1Total=this.sumPipe.transform(this.data,"SalesNTax1"),this.salesNTax2Total=this.sumPipe.transform(this.data,"SalesNTax2"),this.netProfit1Total=this.sumPipe.transform(this.data,"NetProfit1"),this.netProfit2Total=this.sumPipe.transform(this.data,"NetProfit2"),this.salesNTaxPercentage=this.calculatePercentage(this.salesNTax1Total,this.salesNTax2Total),this.profitPercentage=this.calculatePercentage(this.netProfit1Total,this.netProfit2Total),this.originalData=e}calculatePercentage(e,r){return(r-e)/e*100}preGetList(){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.PageNumber}onChangeFilterDate1(e){this.pageData.Filter.From_range1=e.from,this.pageData.Filter.To_range1=e.to}onChangeFilterDate2(e){this.pageData.Filter.From_range2=e.from,this.pageData.Filter.To_range2=e.to}sortData(e){let r=this.data.slice();if(!e.active||e.direction===""){this.data=this.originalData;return}this.data=r.sort((t,l)=>{let h=e.direction==="asc";switch(typeof t[e.active]){case"number":return this.compare(t[e.active],l[e.active],h);case"string":return this.compare(t[e.active],l[e.active],h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales Compare by Outlet",exportTypes:[{ID:"ReportExport/SalesCompareByRange",Value:"Default",FileName:"Sales Compare by Outlet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(q),w(j),w(N),w(k),w(se),w(z))};static \u0275cmp=B({type:i,selectors:[["app-sales-compare-by-outlet"]],standalone:!1,features:[W],decls:10,vars:8,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["matTooltipPosition","above","matTooltip","12 Months Compare",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindValue","ID","bindLabel","Name","placeholder","Choose Sales Order Tag",3,"ngModelChange","multiple","ngModel","items"],[3,"dateChange","from","to"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-header"],["rowspan","2","colspan","1","mat-sort-header","EntityName",1,"border-end","text-center"],["colspan","2",1,"text-center"],["colspan","2",1,"text-center","border-start"],[1,"border-top-2"],["mat-sort-header","SalesNTax1",1,"align-center",3,"colSpan"],["mat-sort-header","NetProfit1",1,"align-center","border-end"],["mat-sort-header","SalesNTax2",1,"align-center",3,"colSpan"],["mat-sort-header","NetProfit2",1,"align-center","border-end"],["mat-sort-header","Revenue",1,"align-center"],["mat-sort-header","Growth",1,"align-center"],[1,"text-end",3,"colSpan","ngClass"],[1,"text-end",3,"ngClass"],[1,"border-start","border-end"],[1,"text-end","border-end",3,"colSpan"],[1,"text-end","border-end"],[1,"text-end","border-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Z3,3,0,"button",2),n(3,"a",3),p(4," View Monthly"),a()(),n(5,"filters"),E(6,$3,16,13,"ng-template",null,0,O),a(),n(8,"content"),S(9,sw,52,46,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService.global.Export?2:-1),o(),c("routerLink",M(7,J3)),o(6),y(t.data?9:-1))},dependencies:[A,tt,Q,$,L,R,ie,pe,ge,Gt,Ce,U,oe,Z],styles:["thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:60px;z-index:1020}@media only screen and (max-width: 768px){thead.sticky-header[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1020}}"]})};var Ji=Jt(bi());var cw={parse:{dateInput:"YYYY"},display:{dateInput:"YYYY",monthYearLabel:"YYYY",dateA11yLabel:"YYYY",monthYearA11yLabel:"YYYY"}},Wi=class i{yearCtrl=new Zo(null);year=un(null);minDate=(0,Ji.default)().subtract(100,"years");maxDate=(0,Ji.default)();constructor(){dn(()=>{this.year()&&this.yearCtrl.setValue((0,Ji.default)().year(this.year()).startOf("year"))})}chosenYearHandler(s,e){let r=s.year(),t=(0,Ji.default)().year(r).startOf("year");this.yearCtrl.setValue(t),this.year.set(r),e.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=B({type:i,selectors:[["pos-datepicker-year"]],inputs:{year:[1,"year"]},outputs:{year:"yearChange"},features:[Ci([{provide:yn,useClass:Nn,deps:[Sn]},{provide:Dn,useValue:cw}])],decls:5,vars:5,consts:[["dp",""],["appearance","outline",1,"datepicker","w-100"],["matInput","",3,"click","matDatepicker","formControl","min","max"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"yearSelected"]],template:function(e,r){if(e&1){let t=I();n(0,"mat-form-field",1)(1,"input",2),P("click",function(){u(t);let h=Dt(4);return _(h.open())}),a(),b(2,"mat-datepicker-toggle",3),n(3,"mat-datepicker",4,0),P("yearSelected",function(h){u(t);let T=Dt(4);return _(r.chosenYearHandler(h,T))}),a()()}if(e&2){let t=Dt(4);o(),c("matDatepicker",t)("formControl",r.yearCtrl)("min",r.minDate)("max",r.maxDate),o(),c("for",t)}},dependencies:[bn,wn,vn,Di,En,yi,Tn,Pn,Fn,At,Qe,L,gn,er],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}
|
|
7
7
|
`],encapsulation:2,changeDetection:0})};var uw=()=>["/menu/Reports/Sales_Report/Standard/Yearly/Comparison"];function _w(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Currency"),a(),n(9,"ng-select",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.currency,t)||(l.currency=t),_(t)}),P("change",function(){u(e);let t=m();return _(t.checkFilterCurrency())}),a(),n(10,"h6"),p(11,"From - To"),a(),n(12,"div")(13,"pos-datepicker-year",9),x("yearChange",function(t){u(e);let l=m();return f(l.pageData.Filter.FromYear,t)||(l.pageData.Filter.FromYear=t),_(t)}),a()(),n(14,"div",10)(15,"pos-datepicker-year",9),x("yearChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ToYear,t)||(l.pageData.Filter.ToYear=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.currency),c("items",e.pageData.Options.Currencies),o(4),C("year",e.pageData.Filter.FromYear),o(2),C("year",e.pageData.Filter.ToYear)}}function gw(i,s){if(i&1&&(n(0,"div",4),b(1,"POS-line-chart",11),a()),i&2){let e=m();o(),c("config",e.chartConfig)("data",e.chartData)}}var to=class i extends me{constructor(e,r,t,l){super(e,r,"SalesReport/YearlySalesListChart","ReportLoader/YearlySalesPerformance");this.httpService=r;this.csvConverter=t;this.role=l}chartData={series:[]};chartConfig;currency=-1;ngOnInit(){}preInitList(){let e={ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"};this.pageData.Options.Currencies.unshift(e),this.checkFilterCurrency()}checkFilterCurrency(){this.currency<0?this.pageData.Filter.CurrencyID=null:this.pageData.Filter.CurrencyID=this.currency}preGetList(){delete this.pageData.Filter?.From,delete this.pageData.Filter?.To,delete this.pageData.Filter?.PageNumber}postInit(e){this.chartData={series:this.generateSeries()},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.XAxis},yAxis:{title:{text:""},labels:{formatter:function(){return V.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){let r=this.axis.chart,t=r.userOptions.total,l,h="",T=Math.abs(t[this.x]?t[this.x]:0);return T>999&&T<1e10?(h="K",l=(T/1e3).toFixed(0)):T>=1e10?(h="M",l=(T/1e6).toFixed(0)):T<999&&(l=T.toString()),this.total<0&&(l="-"+l),l.replace(/\B(?=(\d{3})+(?!\d))/g,",")+h}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let r=this.series.chart.series;r=r.filter(T=>this.series?.name?.includes("Cost")?T?.name?.includes("Cost"):T?.name?.includes("Cost")==!1);let t=[],l="",h=this.point.index;return r.forEach(T=>{T.options.stack===this.point.series.options.stack&&(t=T.name.split(" "),l+=`<b>${t[0]}</b> <br/><br/>
|
|
8
8
|
${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(T.points[h]?.y)} <br/><br/>`)}),l}},total:this.generateStackTotal()}}generateStackTotal(){let e=[];return this.data.Series.filter(t=>t.Name=="Sales").forEach(t=>{e=[...e,t.Amount]}),e}generateSeries(){let e=[],r=this.data.Series.filter(h=>h.Name=="Sales").map(h=>h.Amount),t=this.data.Series.filter(h=>h.Name=="Profit").map(h=>h.Amount),l=this.data.Series.filter(h=>h.Name=="Cost").map(h=>h.Amount);return e=[{name:"Sales",data:r},{name:"Profit",data:t,visible:!1,showInLegend:!1},{name:"Cost",data:l}],this.role.report.Profit||e.splice(1,1),e}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j))};static \u0275cmp=B({type:i,selectors:[["app-yearly-bar-chart"]],standalone:!1,features:[W],decls:10,vars:7,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],[1,"container-fluid","mt-5"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Symbol","bindValue","ID","placeholder","Choose Currency",3,"ngModelChange","change","ngModel","items"],[3,"yearChange","year"],[1,"mt-4"],[3,"config","data"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.getListData())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions")(2,"a",2),b(3,"i",3),p(4,"Table View"),a()(),n(5,"filters"),E(6,_w,16,10,"ng-template",null,0,O),a(),n(8,"content"),S(9,gw,2,2,"div",4),a()()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("routerLink",M(6,uw)),o(7),y(t.data?9:-1))},dependencies:[A,Q,$,L,R,ie,Mt,Ce,U,Wi],encapsulation:2})};var Cw=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"],fw=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"],xw=()=>["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"],hw=i=>({id:i}),Sw=i=>[i],xl=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],yw=(i,s,e)=>({CategoryID:i,From:s,To:e}),hl=i=>({CategoryID:i}),Dw=()=>["/menu/Reports/Sales_Report/Standard/Discounted_Sales"];function vw(i,s){if(i&1){let e=I();n(0,"button",9),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",10),p(2," Export "),a()}}function ww(i,s){if(i&1&&(n(0,"span",25),p(1),a()),i&2){let e=s.item;c("matTooltip",Ct(e.Value)),o(),F(e.Value)}}function Tw(i,s){if(i&1){let e=I();n(0,"div",11)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",12),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",13),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Brand"),a(),n(9,"ng-select",14),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.BrandID,t)||(l.pageData.Filter.BrandID=t),_(t)}),E(10,ww,2,3,"ng-template",15),a(),n(11,"h6"),p(12,"From - To"),a(),n(13,"div")(14,"datepicker",16),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(15,"div",17)(16,"datepicker",18),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(17,"h6"),p(18,"Sales Person"),a(),n(19,"sales-person-selector",19),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(20,"h6"),p(21,"Customer"),a(),n(22,"autocompleteV2",20),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CustomerID,t)||(l.pageData.Filter.CustomerID=t),_(t)}),a(),n(23,"h6"),p(24,"Sales Order Tag"),a(),n(25,"ng-select",21),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.TagID,t)||(l.pageData.Filter.TagID=t),_(t)}),a(),n(26,"h6"),p(27,"Discount Calculation"),a(),n(28,"ng-select",22),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CalculationDiscount,t)||(l.pageData.Filter.CalculationDiscount=t),_(t)}),a(),n(29,"h6"),p(30,"Hide Zero & Negative"),a(),n(31,"radio-options",23),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ExcludeZero,t)||(l.pageData.Filter.ExcludeZero=t),_(t)}),a(),n(32,"h6"),p(33,"Product Type"),a(),n(34,"radio-options",24),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ProductType,t)||(l.pageData.Filter.ProductType=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("categories",X(23,Sw,X(21,hw,e.pageData.Filter.CategoryID)))("isInitializedCategoryLabel",!0)("showClear",!0),o(3),c("items",e.pageData.Options==null?null:e.pageData.Options.Brands),C("ngModel",e.pageData.Filter.BrandID),o(5),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),C("ngModel",e.pageData.Filter.CustomerID),o(3),C("ngModel",e.pageData.Filter.TagID),c("items",e.pageData.Options==null?null:e.pageData.Options.Tags),o(3),C("ngModel",e.pageData.Filter.CalculationDiscount),c("items",e.pageData.Options==null?null:e.pageData.Options.CalculationDiscountOptions),o(3),C("model",e.pageData.Filter.ExcludeZero),o(3),C("model",e.pageData.Filter.ProductType),c("options",e.pageData.Options.ProductTypes)}}function Pw(i,s){i&1&&(n(0,"th",48),p(1," DISCOUNT "),a())}function Fw(i,s){i&1&&(n(0,"th",49),p(1," DISCOUNT (%) "),a(),n(2,"th",50),p(3," DISCOUNT (AMOUNT) "),a())}function Iw(i,s){i&1&&(n(0,"th",51),p(1," COST "),a())}function bw(i,s){i&1&&(n(0,"th",52),p(1," PROFIT "),a())}function Ew(i,s){i&1&&(n(0,"th",53),p(1," % "),a())}function Mw(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),D(" ",g(2,1,e.Cost)," ")}}function Vw(i,s){if(i&1&&(n(0,"td",56),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;c("ngClass",e.Profit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Profit)," ")}}function Bw(i,s){if(i&1&&(n(0,"td",56),p(1),d(2,"number"),a()),i&2){let e=m().$implicit;c("ngClass",e.Percentage>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.Percentage),"% ")}}function Ow(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",54),d(3,"date"),d(4,"date"),p(5),a()(),n(6,"td",42),p(7),d(8,"quantityFraction"),a(),n(9,"td",42)(10,"a",54),p(11),d(12,"amountFraction"),a()(),n(13,"td",42)(14,"a",54),p(15),d(16,"amountFraction"),a()(),n(17,"td",42),p(18),d(19,"amountFraction"),a(),n(20,"td",44),p(21),d(22,"amountFraction"),a(),n(23,"td",42),p(24),d(25,"amountFraction"),a(),E(26,Mw,3,3,"td",45)(27,Vw,3,4,"td",46)(28,Bw,3,4,"td",46),a()),i&2){let e=s.$implicit,r=m(2);o(2),c("routerLink",M(34,xl))("queryParams",_t(35,yw,e.ID,v(3,16,r.pageData.Filter.From,"yyyy-MM-dd"),v(4,19,r.pageData.Filter.To,"yyyy-MM-dd"))),o(3),F(e.Name),o(2),F(g(8,22,e.Quantity)),o(3),c("routerLink",M(39,xl))("queryParams",X(40,hl,e.ID)),o(),D(" ",g(12,24,e.GrossSales)," "),o(3),c("routerLink",M(42,Dw))("queryParams",X(43,hl,e.ID)),o(),F(g(16,26,e.Discount)),o(3),F(g(19,28,e.Sales)),o(3),D(" ",g(22,30,e.Tax)," "),o(3),F(g(25,32,e.SalesNTax)),o(2),c("ngIf",r.roleService.product.Cost),o(),c("ngIf",r.roleService.report.Profit),o(),c("ngIf",r.roleService.report.Profit)}}function Lw(i,s){if(i&1&&(n(0,"td",55),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),D(" ",g(2,1,e.data.Aggregate.TotalCost)," ")}}function Rw(i,s){if(i&1&&(n(0,"td",56),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);c("ngClass",e.data.Aggregate.TotalProfit>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.data.Aggregate.TotalProfit)," ")}}function kw(i,s){if(i&1&&(n(0,"td",56),p(1),d(2,"number"),a()),i&2){let e=m(2);c("ngClass",e.data.Aggregate.TotalPercentage>=0?"text-success":"text-danger"),o(),D(" ",g(2,2,e.data.Aggregate.TotalPercentage),"% ")}}function Ww(i,s){if(i&1){let e=I();n(0,"content")(1,"div",26)(2,"div",27)(3,"table",28),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",29)(5,"tr")(6,"th",30),p(7,"CATEGORY"),a(),n(8,"th",31),p(9," QUANTITY "),a(),n(10,"th",32),p(11," GROSS SALES "),a(),E(12,Pw,2,0,"th",33)(13,Fw,4,0,"ng-template",null,1,O),n(15,"th",34),p(16," NET SALES "),a(),n(17,"th",35),p(18," Tax "),a(),n(19,"th",36),p(20," Sales + Tax "),a(),E(21,Iw,2,0,"th",37)(22,bw,2,0,"th",38)(23,Ew,2,0,"th",39),a()(),n(24,"tbody"),E(25,Ow,29,45,"tr",40),a(),n(26,"tfoot")(27,"tr",41)(28,"td",42),p(29,"Total :"),a(),n(30,"td",42),p(31),d(32,"quantityFraction"),a(),n(33,"td",43)(34,"a"),p(35),d(36,"amountFraction"),a()(),n(37,"td",42),p(38),d(39,"amountFraction"),a(),n(40,"td",42),p(41),d(42,"amountFraction"),a(),n(43,"td",44),p(44),d(45,"amountFraction"),a(),n(46,"td",42),p(47),d(48,"amountFraction"),a(),E(49,Lw,3,3,"td",45)(50,Rw,3,4,"td",46)(51,kw,3,4,"td",46),a()()()(),n(52,"POS-complex-pagination",47),P("jumpToPage",function(){u(e);let t=m();return _(t.getListData())})("previousPage",function(){u(e);let t=m();return _(t.getListData())})("nextPage",function(){u(e);let t=m();return _(t.getListData())}),a()()()}if(i&2){let e=Dt(14),r=m();o(12),c("ngIf",!r.pageData.Filter.BreakdownDiscountAmount)("ngIfElse",e),o(9),c("ngIf",r.roleService.product.Cost),o(),c("ngIf",r.roleService.report.Profit),o(),c("ngIf",r.roleService.report.Profit),o(2),c("ngForOf",r.data.Data),o(6),D(" ",g(32,17,r.data.Aggregate.TotalQuantity)," "),o(4),F(g(36,19,r.data.Aggregate.TotalGross)),o(3),D(" ",g(39,21,r.data.Aggregate.TotalDiscount)," "),o(3),D(" ",g(42,23,r.data.Aggregate.TotalNetSales)," "),o(3),D(" ",g(45,25,r.data.Aggregate.TotalTax)," "),o(3),D(" ",g(48,27,r.data.Aggregate.TotalSalesNTax)," "),o(2),c("ngIf",r.roleService.product.Cost),o(),c("ngIf",r.roleService.report.Profit),o(),c("ngIf",r.roleService.report.Profit),o(),c("total",r.data.Count)("pageData",r.pageData)}}var io=class i extends De{constructor(e,r,t,l,h){super(e,r,"Report/CategorySales","ReportLoader/CategorySales");this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}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 h=e.direction==="asc";switch(e.active){case"Name":return this.compare(t.Name,l.Name,h);case"Total":return this.compare(t.Total,l.Total,h);case"Quantity":return this.compare(t.Quantity,l.Quantity,h);case"Discount":return this.compare(t.Discount,l.Discount,h);case"NetSales":return this.compare(t.NetSales,l.NetSales,h);case"Cost":return this.compare(t.Cost,l.Cost,h);case"Profit":return this.compare(t.Profit,l.Profit,h);case"Percentage":return this.compare(t.Percentage,l.Percentage,h);case"Tax":return this.compare(t.Tax,l.Tax,h);case"SalesNTax":return this.compare(t.SalesNTax,l.SalesNTax,h);case"GrossSales":return this.compare(t.GrossSales,l.GrossSales,h);default:return 0}})}openExportModal(){this.matDialog.open(K,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["POS-category-sales-table"]],standalone:!1,features:[W],decls:20,vars:13,consts:[["pageFilterTemplate",""],["BREAKDOWN_HEADER",""],[3,"textChange","onSubmit","filterChange","pageData","text","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","categories","isInitializedCategoryLabel","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"ngModelChange","items","ngModel"],["ng-option-tmp",""],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],[3,"ngModelChange","ngModel"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100","ac-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Sales Order Tag",3,"ngModelChange","ngModel","items"],["bindLabel","Value","bindValue","Key","placeholder","Choose Calculation",3,"ngModelChange","ngModel","items"],[3,"modelChange","model"],["name","render-ProductType",3,"modelChange","model","options"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"text-start"],["arrowPosition","before","mat-sort-header","Quantity",1,"flex-right",2,"width","120px"],["mat-sort-header","GrossSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["class","flex-right","style","width: 120px","mat-sort-header","Discount","arrowPosition","before",4,"ngIf","ngIfElse"],["mat-sort-header","NetSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-right",2,"width","150px"],["class","flex-right","style","width: 120px","mat-sort-header","Cost","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 120px","mat-sort-header","Profit","arrowPosition","before",4,"ngIf"],["class","flex-right","style","width: 80px","mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-primary"],[1,"text-end","text-warning-emphasis"],["class","text-end text-danger",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["api","Report/GetTotalCountCategorySales",3,"jumpToPage","previousPage","nextPage","total","pageData"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","DiscountAmount","arrowPosition","before",1,"flex-right",2,"width","170px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",1,"flex-right",2,"width","80px"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",2),x("textChange",function(T){return u(l),f(t.pageData.Filter.Number,T)||(t.pageData.Filter.Number=T),_(T)}),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),E(2,vw,3,0,"button",3),n(3,"div",4)(4,"button",5),p(5," More "),a(),n(6,"ul",6)(7,"li")(8,"a",7),p(9," Tree View "),a()(),n(10,"li")(11,"a",7),p(12," Pie Chart "),a()(),n(13,"li")(14,"a",7),p(15," Compare by Outlet "),a()()()()(),n(16,"filters"),E(17,Tw,35,25,"ng-template",null,0,O),a(),E(19,Ww,53,29,"content",8),a()}r&2&&(c("pageData",t.menuData),C("text",t.pageData.Filter.Number),c("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),c("ngIf",t.roleService.global.Export),o(6),c("routerLink",M(10,Cw)),o(3),c("routerLink",M(11,fw)),o(3),c("routerLink",M(12,xw)),o(5),c("ngIf",t.data))},dependencies:[A,tt,st,it,Q,$,J,L,R,ie,pe,ge,Te,Ae,Et,Ce,U,ze,Mn,re,oe,Z,ne],encapsulation:2})};var yl=(i,s)=>({"text-danger":i,"text-success":s}),Nw=()=>["/menu/Products/Catalog/Variants/Info"],Sl=i=>({ID:i}),Aw=()=>["/menu/Orders/Orders/Customer_Invoice/Info"];function Gw(i,s){if(i&1){let e=I();n(0,"a",3),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",4),p(2," Export "),a()}}function Hw(i,s){if(i&1){let e=I();n(0,"div",5)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",6),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",7),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Discount Comparator"),a(),n(9,"ng-select",8),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CompareDifference,t)||(l.pageData.Filter.CompareDifference=t),_(t)}),a(),n(10,"h6"),p(11,"Variant"),a(),n(12,"autocompleteV2",9),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.VariantID,t)||(l.pageData.Filter.VariantID=t),_(t)}),a(),n(13,"h6"),p(14,"From - To"),a(),n(15,"div")(16,"datepicker",10),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.From,t)||(l.pageData.Filter.From=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterFromDate())}),a()(),n(17,"div",11)(18,"datepicker",12),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.To,t)||(l.pageData.Filter.To=t),_(t)}),P("dateChange",function(){u(e);let t=m();return _(t.onFilterToDate())}),a()(),n(19,"h6"),p(20,"Note"),a(),n(21,"input",13),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.Note,t)||(l.pageData.Filter.Note=t),_(t)}),a(),n(22,"h6"),p(23,"Disc %"),a(),n(24,"div",14)(25,"input",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DiscountFrom,t)||(l.pageData.Filter.DiscountFrom=t),_(t)}),a(),n(26,"input",15),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.DiscountTo,t)||(l.pageData.Filter.DiscountTo=t),_(t)}),a()()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("showClear",!0),o(3),C("ngModel",e.pageData.Filter.CompareDifference),c("clearable",!1)("items",e.pageData.Options==null?null:e.pageData.Options.DiscountReportCompareType),o(3),C("ngModel",e.pageData.Filter.VariantID),c("renderThumbnail",!0),o(4),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),C("ngModel",e.pageData.Filter.Note),o(4),C("ngModel",e.pageData.Filter.DiscountFrom),o(),C("ngModel",e.pageData.Filter.DiscountTo)}}function Qw(i,s){i&1&&(n(0,"th",26),p(1,"Cost"),a())}function Yw(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m().$implicit;o(),F(g(2,1,e.UnitCost))}}function jw(i,s){if(i&1&&(n(0,"tr")(1,"td"),p(2),a(),n(3,"td")(4,"a",38),p(5),a()(),n(6,"td"),p(7),a(),n(8,"td")(9,"a",38),p(10),a(),b(11,"span",39),a(),n(12,"td"),p(13),d(14,"date"),a(),n(15,"td",33),p(16),d(17,"quantityFraction"),a(),S(18,Yw,3,3,"td",34),n(19,"td",33),p(20),d(21,"amountFraction"),a(),n(22,"td",33),p(23),d(24,"amountFraction"),a(),n(25,"td",35),p(26),d(27,"amountFraction"),a(),n(28,"td",34),p(29),d(30,"amountFraction"),a(),n(31,"td",36),p(32),d(33,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m(2);o(2),F(e.EntityName),o(2),c("routerLink",M(33,Nw))("queryParams",X(34,Sl,e.ID)),o(),F(e.Name),o(2),F(e.Code),o(2),c("routerLink",M(36,Aw))("queryParams",X(37,Sl,e.InvoiceID)),o(),F(e.Number),o(),c("innerHTML",e.Note,Ee),o(2),F(v(14,18,e.Date,"dd MMM yyyy")),o(3),F(g(17,21,e.Quantity)),o(2),y(r.roleService.product.Cost?18:-1),o(2),F(g(21,23,e.UnitPriceOriginal)),o(3),F(g(24,25,e.UnitPrice)),o(2),c("ngClass",fe(39,yl,!e.NetPriceIsGreaterThanOriginalPrice,e.NetPriceIsGreaterThanOriginalPrice)),o(),D(" ",g(27,27,e.Discount)),o(3),D(" ",g(30,29,e.DiscountPercentage),"% "),o(3),F(g(33,31,e.Sales))}}function qw(i,s){if(i&1&&(n(0,"td",34),p(1),d(2,"amountFraction"),a()),i&2){let e=m(2);o(),F(g(2,1,e.data.Aggregate.TotalUnitCost))}}function Uw(i,s){if(i&1){let e=I();n(0,"POS-complex-pagination",40),P("jumpToPage",function(){u(e);let t=m(2);return _(t.getListData())})("previousPage",function(){u(e);let t=m(2);return _(t.getListData())})("nextPage",function(){u(e);let t=m(2);return _(t.getListData())}),a()}if(i&2){let e=m(2);c("total",e.data.Data.length)("pageData",e.pageData)}}function zw(i,s){if(i&1){let e=I();n(0,"content")(1,"div",16)(2,"div",17)(3,"table",18),P("matSortChange",function(t){u(e);let l=m();return _(l.sortData(t))}),n(4,"thead",19)(5,"tr")(6,"th",20),p(7,"Outlet"),a(),n(8,"th",21),p(9,"Variant"),a(),n(10,"th",22),p(11,"Code"),a(),n(12,"th",23),p(13,"Number / Note"),a(),n(14,"th",24),p(15,"Date"),a(),n(16,"th",25),p(17,"Quantity"),a(),S(18,Qw,2,0,"th",26),n(19,"th",27),p(20," Original Price"),a(),n(21,"th",28),p(22,"Price"),a(),n(23,"th",29),p(24,"Discount"),a(),n(25,"th",30),p(26," Disc%"),a(),n(27,"th",31),p(28,"Net Sales "),a()()(),n(29,"tbody"),G(30,jw,34,42,"tr",null,Y),a(),n(32,"tfoot")(33,"tr"),b(34,"td",32),n(35,"td",33),p(36,"Total :"),a(),n(37,"td",33),p(38),d(39,"quantityFraction"),a(),S(40,qw,3,3,"td",34),n(41,"td",33),p(42),d(43,"amountFraction"),a(),n(44,"td",33),p(45),d(46,"amountFraction"),a(),n(47,"td",35),p(48),d(49,"amountFraction"),a(),n(50,"td",34),p(51),d(52,"amountFraction"),a(),n(53,"td",36),p(54),d(55,"amountFraction"),a()()()()(),S(56,Uw,1,2,"POS-complex-pagination",37),a()()}if(i&2){let e=m();o(18),y(e.roleService.product.Cost?18:-1),o(12),H(e.data.Data),o(8),F(g(39,10,e.data.Aggregate.TotalQuantity)),o(2),y(e.roleService.product.Cost?40:-1),o(2),F(g(43,12,e.data.Aggregate.TotalUnitPriceOriginal)),o(3),F(g(46,14,e.data.Aggregate.TotalUnitPrice)),o(2),c("ngClass",fe(22,yl,e.data.Aggregate.TotalDiscount>0,e.data.Aggregate.TotalDiscount<0)),o(),D(" ",g(49,16,e.data.Aggregate.TotalDiscount<0?e.data.Aggregate.TotalDiscount*-1:e.data.Aggregate.TotalDiscount)),o(3),D(" ",g(52,18,e.data.Aggregate.DiscountPercentage),"% "),o(3),F(g(55,20,e.data.Aggregate.TotalNetSales)),o(2),y((e.data==null||e.data.Data==null?null:e.data.Data.length)>0?56:-1)}}var no=class i extends De{constructor(e,r,t,l,h){super(e,r,"SalesReport/Discount","SalesReportLoader/DiscountLoader",null,t);this.roleService=l;this.dialog=h}postInit(e){this.menuData.H=e.PageTitle,this.originalData=e.Data,this.initDiscountPercentage()}initDiscountPercentage(){this.data.Aggregate.DiscountPercentage=0;for(let e of this.data.Data)this.data.Aggregate.DiscountPercentage+=e.DiscountPercentage}sortData(e){let r=this.originalData.slice();if(!e.active||e.direction===""){this.data.Data=r;return}this.data.Data=r.sort((t,l)=>{let h=e.direction==="asc";switch(e.active){case"EntityName":return V.compare(t.EntityName.toLocaleLowerCase(),l.EntityName.toLocaleLowerCase(),h);case"Name":return V.compare(t.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),h);case"Code":return V.compare(t.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),h);case"Number":return V.compare(t.Number,l.Number,h);case"Date":return V.compare(t.Date,l.Date,h);case"Quantity":return V.compare(t.Quantity,l.Quantity,h);case"UnitCost":return V.compare(t.UnitCost,l.UnitCost,h);case"UnitPriceOriginal":return V.compare(t.UnitPriceOriginal,l.UnitPriceOriginal,h);case"UnitPrice":return V.compare(t.UnitPrice,l.UnitPrice,h);case"Discount":return V.compare(t.Discount,l.Discount,h);case"Sales":return V.compare(t.Sales,l.Sales,h);case"DiscountPercentage":return V.compare(t.DiscountPercentage,l.DiscountPercentage,h);case"Note":return V.compare(t.Note,l.Note,h);default:return 0}})}openExportModal(){this.dialog.open(K,{data:{title:"Discounted Report",exportTypes:[{ID:"SalesReportExport/Discount",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(Ne),w(j),w(z))};static \u0275cmp=B({type:i,selectors:[["app-discount-sales"]],standalone:!1,features:[W],decls:7,vars:6,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","outlets","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["bindLabel","Value","bindValue","Key","placeholder","Choose Discount Comparator",3,"ngModelChange","ngModel","clearable","items"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Search Variant",1,"w-100","ac-filter",3,"ngModelChange","ngModel","renderThumbnail"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["type","text",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel"],[1,"d-flex",2,"column-gap","10px"],["type","text","autoNum","","percentage","",1,"form-control","w-100",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","EntityName",2,"width","150px"],["mat-sort-header","Name",2,"width","150px"],["mat-sort-header","Code",2,"width","100px"],["mat-sort-header","Number",2,"width","100px"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Quantity","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitCost","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitPriceOriginal","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","Discount","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","DiscountPercentage","arrowPosition","before",1,"text-end",2,"width","90px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end",2,"width","100px"],["colspan","4"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end",3,"ngClass"],[1,"text-end","text-success"],["api","SalesReport/TotalDiscount",3,"total","pageData"],["target","_blank",3,"routerLink","queryParams"],[1,"d-block",3,"innerHTML"],["api","SalesReport/TotalDiscount",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(r,t){if(r&1){let l=I();n(0,"mainpanel-cmp",1),P("onSubmit",function(){return u(l),_(t.searchFromPageOne())}),x("filterChange",function(T){return u(l),f(t.pageData.Filter,T)||(t.pageData.Filter=T),_(T)}),n(1,"actions"),S(2,Gw,3,0,"a",2),a(),n(3,"filters"),E(4,Hw,27,16,"ng-template",null,0,O),a(),S(6,zw,57,25,"content"),a()}r&2&&(c("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",t.pageData.Filter),o(2),y(t.roleService!=null&&t.roleService.global.Export?2:-1),o(4),y(t.data?6:-1))},dependencies:[A,tt,Q,$,J,Qe,L,R,pe,ge,Ue,Ae,Et,Ce,U,oe,Z,ne],encapsulation:2})};var Kw=()=>["/menu/Reports/Sales_Report/Standard/Person"],Xw=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"],Jw=()=>["/menu/Reports/Sales_Report/Standard/Person/Sales_Group"],Zw=()=>["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"],$w=(i,s)=>({From:i,To:s}),vl=i=>({ID:i}),Dl=i=>[i],eT=(i,s)=>({SalesPersonID:i,ListIDs:s}),tT=(i,s,e,r)=>({SalesPersonID:i,ListIDs:s,From:e,To:r});function iT(i,s){if(i&1){let e=I();n(0,"a",15),P("click",function(){u(e);let t=m(2);return _(t.openExportModal())}),b(1,"i",16),p(2," Export "),a()}}function nT(i,s){if(i&1){let e=I();n(0,"div",17)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",18),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m(2);return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Sales Person"),a(),n(6,"sales-person-selector",19),x("ngModelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.SalesID,t)||(l.pageData.Filter.SalesID=t),_(t)}),a(),n(7,"h6"),p(8,"Date"),a(),n(9,"app-datepicker-range",20),P("dateChange",function(t){u(e);let l=m(2);return _(l.onChangeFilterDate1(t))}),a(),n(10,"h6",21),p(11,"Compare With"),a(),n(12,"app-datepicker-range",20),P("dateChange",function(t){u(e);let l=m(2);return _(l.onChangeFilterDate2(t))}),a()()}if(i&2){let e=m(2);o(3),c("accessType",2)("multiple",!0),C("ngModel",e.pageData.Filter.ListIDs),c("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("ngModel",e.pageData.Filter.SalesID),o(3),c("from",e.pageData.Filter.From)("to",e.pageData.Filter.To),o(3),c("from",e.pageData.Filter.CompareFrom)("to",e.pageData.Filter.CompareTo)}}function aT(i,s){if(i&1&&(n(0,"tr")(1,"td")(2,"a",37),p(3),a(),n(4,"div"),p(5),a()(),n(6,"td",36)(7,"a",38),p(8),d(9,"number"),a()(),n(10,"td",36),p(11),d(12,"quantityFraction"),a(),n(13,"td",36),p(14),d(15,"quantityFraction"),a(),n(16,"td",36),p(17),d(18,"quantityFraction"),a(),n(19,"td",36),p(20),d(21,"amountFraction"),a(),n(22,"td",36),p(23),d(24,"amountFraction"),a(),n(25,"td",36)(26,"a",38),d(27,"date"),d(28,"date"),p(29),d(30,"quantityFraction"),a()(),n(31,"td",36),p(32),d(33,"quantityFraction"),a(),n(34,"td",36),p(35),d(36,"quantityFraction"),a(),n(37,"td",36),p(38),d(39,"quantityFraction"),a(),n(40,"td",36),p(41),d(42,"amountFraction"),a(),n(43,"td",36),p(44),d(45,"amountFraction"),a()()),i&2){let e=s.$implicit,r=m().$implicit,t=m(2);o(2),c("queryParams",X(47,vl,e.PersonID)),o(),F(e.PersonName),o(2),F(e.PersonCode),o(2),c("queryParams",fe(51,eT,e.PersonID,X(49,Dl,r.EntityID))),o(),F(g(9,17,e.CountOrder)),o(3),F(g(12,19,e.Quantity)),o(3),F(g(15,21,e.BasketSize)),o(3),F(g(18,23,e.BasketValue)),o(3),F(g(21,25,e.Sales)),o(3),F(g(24,27,e.AverageDailySales)),o(3),c("queryParams",Ut(56,tT,e.PersonID,X(54,Dl,r.EntityID),v(27,29,t.pageData.Filter.CompareFrom,"ddMMyyyy"),v(28,32,t.pageData.Filter.CompareTo,"ddMMyyyy"))),o(3),D(" ",g(30,35,e.CountOrder1)),o(3),F(g(33,37,e.Quantity1)),o(3),F(g(36,39,e.BasketSize1)),o(3),F(g(39,41,e.BasketValue1)),o(3),F(g(42,43,e.Sales1)),o(3),F(g(45,45,e.AverageDailySales1))}}function oT(i,s){if(i&1&&(n(0,"table",14)(1,"thead",22)(2,"tr",23)(3,"th",24)(4,"h2")(5,"a",25),p(6),a()()()(),n(7,"tr")(8,"th",26),p(9," Sales Person"),a(),n(10,"th",27)(11,"span"),p(12),d(13,"date"),a(),p(14," - "),n(15,"span"),p(16),d(17,"date"),a()(),n(18,"th",28)(19,"span"),p(20),d(21,"date"),a(),p(22," - "),n(23,"span"),p(24),d(25,"date"),a()()(),n(26,"tr",29)(27,"th",30),p(28," Ordr"),a(),n(29,"th",31),p(30,"Qty"),a(),n(31,"th",31),b(32,"i",32),a(),n(33,"th",33),p(34,"Basket Value"),a(),n(35,"th",33),p(36,"Sales"),a(),n(37,"th",33),p(38,"Avg Daily"),a(),n(39,"th",34),p(40,"Ordr"),a(),n(41,"th",31),p(42,"Qty"),a(),n(43,"th",31),b(44,"i",32),a(),n(45,"th",33),p(46,"Basket Value"),a(),n(47,"th",33),p(48,"Sales"),a(),n(49,"th",33),p(50,"Avg Daily"),a()()(),n(51,"tbody"),G(52,aT,46,61,"tr",null,Y),a(),n(54,"tfoot")(55,"tr",35)(56,"td"),p(57,"Total"),a(),n(58,"td",36),p(59),d(60,"sum"),d(61,"number"),a(),n(62,"td",36),p(63),d(64,"sum"),d(65,"quantityFraction"),a(),n(66,"td",36),p(67),d(68,"sum"),d(69,"quantityFraction"),a(),n(70,"td",36),p(71),d(72,"sum"),d(73,"quantityFraction"),a(),n(74,"td",36),p(75),d(76,"sum"),d(77,"amountFraction"),a(),n(78,"td",36),p(79),d(80,"sum"),d(81,"amountFraction"),a(),n(82,"td",36),p(83),d(84,"sum"),d(85,"number"),a(),n(86,"td",36),p(87),d(88,"sum"),d(89,"quantityFraction"),a(),n(90,"td",36),p(91),d(92,"sum"),d(93,"quantityFraction"),a(),n(94,"td",36),p(95),d(96,"sum"),d(97,"quantityFraction"),a(),n(98,"td",36),p(99),d(100,"sum"),d(101,"amountFraction"),a(),n(102,"td",36),p(103),d(104,"sum"),d(105,"amountFraction"),a()()()()),i&2){let e=s.$implicit,r=m(2);o(5),c("queryParams",X(90,vl,e.EntityID)),o(),F(e.EntityName),o(6),F(v(13,18,r.pageData.Filter.From,"dd MMMM yyyy")),o(4),F(v(17,21,r.pageData.Filter.To,"dd MMMM yyyy")),o(4),F(v(21,24,r.pageData.Filter.CompareFrom,"dd MMMM yyyy")),o(4),F(v(25,27,r.pageData.Filter.CompareTo,"dd MMMM yyyy")),o(28),H(e.SalesCommison),o(7),F(g(61,33,v(60,30,e.SalesCommison,"CountOrder"))),o(4),F(g(65,38,v(64,35,e.SalesCommison,"Quantity"))),o(4),F(g(69,43,v(68,40,e.SalesCommison,"BasketSize"))),o(4),F(g(73,48,v(72,45,e.SalesCommison,"BasketValue"))),o(4),F(g(77,53,v(76,50,e.SalesCommison,"Sales"))),o(4),F(g(81,58,v(80,55,e.SalesCommison,"AverageDailySales"))),o(4),F(g(85,63,v(84,60,e.SalesCommison,"CountOrder1"))),o(4),F(g(89,68,v(88,65,e.SalesCommison,"Quantity1"))),o(4),F(g(93,73,v(92,70,e.SalesCommison,"BasketSize1"))),o(4),F(g(97,78,v(96,75,e.SalesCommison,"BasketValue1"))),o(4),F(g(101,83,v(100,80,e.SalesCommison,"Sales1"))),o(4),F(g(105,88,v(104,85,e.SalesCommison,"AverageDailySales1")))}}function rT(i,s){if(i&1){let e=I();n(0,"mainpanel-cmp",2),P("onSubmit",function(){u(e);let t=m();return _(t.searchFromPageOne())}),x("filterChange",function(t){u(e);let l=m();return f(l.pageData.Filter,t)||(l.pageData.Filter=t),_(t)}),n(1,"actions")(2,"div",3)(3,"a",4),P("click",function(){u(e);let t=m();return _(t.print())}),b(4,"i",5),p(5," Print"),a(),S(6,iT,3,0,"a",6),n(7,"div",7)(8,"button",8),p(9," More "),a(),n(10,"ul",9)(11,"li")(12,"a",10),p(13,"Summary"),a()(),n(14,"li")(15,"a",10),p(16,"By Employee"),a()(),n(17,"li")(18,"a",10),p(19,"By Sales Group"),a()(),n(20,"li")(21,"a",11),d(22,"date"),d(23,"date"),p(24," By Order Item"),a()()()()()(),n(25,"filters"),E(26,nT,13,9,"ng-template",null,0,O),a(),n(28,"content")(29,"div",12)(30,"div",13),G(31,oT,106,92,"table",14,Y),a()()()()}if(i&2){let e=m();c("pageData",e.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",e.pageData.Filter),o(6),y(e.roleService!=null&&e.roleService.global.Export?6:-1),o(6),c("routerLink",M(16,Kw)),o(3),c("routerLink",M(17,Xw)),o(3),c("routerLink",M(18,Jw)),o(3),c("routerLink",M(19,Zw))("queryParams",fe(20,$w,v(22,10,e.pageData.Filter==null?null:e.pageData.Filter.From,"ddMMyyyy"),v(23,13,e.pageData.Filter==null?null:e.pageData.Filter.To,"ddMMyyyy"))),o(10),H(e.data==null?null:e.data.Data)}}var ao=class i extends De{constructor(e,r,t,l,h,T){super(e,r,"Report/GetSalesPersonCommissionGroupByOutlet","ReportLoader/GetSalesPersonCommissionGroupByOutlet",null,T);this.httpService=r;this.csvConverter=t;this.roleService=l;this.matDialog=h}preInitLoader(){let e=this.route?.snapshot?.queryParams;e&&(this.loaderPayload=JSON.parse(JSON.stringify(e)),this.loaderPayload.IncludeComplementary=e.IncludeComplementary=="true"),this.loaderPayload.ListIDs=this.reportFilterService.initOutletFilter(this.loaderPayload.ListIDs)}print(){window.print()}openExportModal(){this.matDialog.open(K,{data:{title:"Outlet Commission Report",exportTypes:[{ID:"ReportExport/GetSalesPersonCommissionGroupByOutlet",Value:"Default",FileName:"Outlet Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(e){this.pageData.Filter.To=V.setDateTime(e,this.pageData.Filter.To)}timeFromChange(e){this.pageData.Filter.From=V.setDateTime(e,this.pageData.Filter.From)}onChangeFilterDate1(e){this.pageData.Filter.From=e.from,this.pageData.Filter.To=e.to,this.onFilterFromDate(),this.onFilterToDate()}onChangeFilterDate2(e){this.pageData.Filter.CompareFrom=e.from,this.pageData.Filter.CompareTo=e.to}static \u0275fac=function(r){return new(r||i)(w(N),w(k),w(q),w(j),w(z),w(Ne))};static \u0275cmp=B({type:i,selectors:[["POS-sales-person-by-outlet"]],standalone:!1,features:[W],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"d-flex"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],[1,"btn","btn-outline-secondary","ms-3"],[1,"btn-group","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"dropdown-item",3,"routerLink","queryParams"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom","mb-10"],[1,"btn","btn-outline-secondary","ms-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","multiple","ngModel","outlets"],[3,"ngModelChange","ngModel"],[3,"dateChange","from","to"],[1,"mt-0"],[1,"thead-light"],[2,"border","none !important"],["colspan","14",1,"text-center","bg-white","border-none"],["routerLink","/menu/Outlets/Master/Outlets/Info",3,"queryParams"],["rowspan","2","colspan","1",1,"border-end","text-center",2,"width","280px"],["colspan","6",1,"text-center"],["colspan","6",1,"text-center","border-start"],[1,"border-top-2"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end",2,"width","50px"],[1,"text-end",2,"width","50px"],["matTooltip","Basket Size","matTooltipPosition","above",1,"fa-solid","fa-cart-shopping"],[1,"text-end",2,"width","100px"],["matTooltip","Orders","matTooltipPosition","above",1,"text-end","border-start",2,"width","50px"],[1,"table-footer","fw-bold"],[1,"text-end"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],["routerLink","/menu/Reports/Sales_Report/Standard/Detail",3,"queryParams"]],template:function(r,t){r&1&&S(0,rT,33,23,"mainpanel-cmp",1),r&2&&y(t.data?0:-1)},dependencies:[A,Q,L,R,ie,Gt,U,ze,se,re,oe,Z,ne],styles:["@media print{a[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#000!important}}"]})};var oo=class i{onPanelShow(){setTimeout(()=>{let s=document.querySelector(".p-multiselect-filter-container input.p-multiselect-filter");s&&(s.focus(),s.select?.())},0)}static \u0275fac=function(e){return new(e||i)};static \u0275dir=pn({type:i,selectors:[["","autoFocusMultiselect",""]],hostBindings:function(e,r){e&1&&P("onPanelShow",function(){return r.onPanelShow()})}})};var pT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold"],mT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"],sT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"],cT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"],dT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Top_Suppliers"],uT=()=>["/menu/Reports/Sales_Report/Standard/Products_Sold/Qty_Sold_Chart"],wl=i=>({ID:i});function _T(i,s){if(i&1){let e=I();n(0,"h6"),p(1,"Date Value"),a(),n(2,"radio-options",35),x("modelChange",function(t){u(e);let l=m(2);return f(l.pageData.Filter.ReleasedType,t)||(l.pageData.Filter.ReleasedType=t),_(t)}),a()}if(i&2){let e=m(2);o(2),C("model",e.pageData.Filter.ReleasedType),c("options",e.pageData.Options==null?null:e.pageData.Options.ReleasedType)}}function gT(i,s){if(i&1){let e=I();n(0,"div",18)(1,"h6"),p(2,"Outlet"),a(),n(3,"outlet-selector",19),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListIDs,t)||(l.pageData.Filter.ListIDs=t),_(t)}),P("ngModelChange",function(){u(e);let t=m();return _(t.onFilterOutlets())}),a(),n(4,"h6"),p(5,"Category"),a(),n(6,"POS-product-category-select",20),x("selectedCategoryIDChange",function(t){u(e);let l=m();return f(l.pageData.Filter.CategoryID,t)||(l.pageData.Filter.CategoryID=t),_(t)}),a(),n(7,"h6"),p(8,"Product Tag"),a(),n(9,"p-multiselect",21),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ListTagID,t)||(l.pageData.Filter.ListTagID=t),_(t)}),a(),S(10,_T,3,2),n(11,"h6"),p(12,"Release Date"),a(),n(13,"div",22)(14,"datepicker",23),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ReleasedFrom,t)||(l.pageData.Filter.ReleasedFrom=t),_(t)}),a(),n(15,"datepicker",24),x("dateChange",function(t){u(e);let l=m();return f(l.pageData.Filter.ReleasedTo,t)||(l.pageData.Filter.ReleasedTo=t),_(t)}),a()(),n(16,"h6",25)(17,"div",26),p(18,"Number Of Interval"),a(),n(19,"div",26),p(20,"Interval Of"),a()(),n(21,"div",27)(22,"input",28),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.IntervalCount,t)||(l.pageData.Filter.IntervalCount=t),_(t)}),a(),n(23,"div",29)(24,"input",30),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.IntervalDays,t)||(l.pageData.Filter.IntervalDays=t),_(t)}),a(),n(25,"span",31),p(26,"Days"),a()()(),n(27,"h6"),p(28,"Page Size"),a(),n(29,"input",32),x("ngModelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.RowCount,t)||(l.pageData.Filter.RowCount=t),_(t)}),a(),n(30,"h6"),p(31,"Purchased"),a(),n(32,"radio-options",33),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.PurchaseType,t)||(l.pageData.Filter.PurchaseType=t),_(t)}),a(),n(33,"h6"),p(34,"Scope"),a(),n(35,"radio-options",33),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.GroupByProduct,t)||(l.pageData.Filter.GroupByProduct=t),_(t)}),a(),n(36,"h6"),p(37,"Options"),a(),n(38,"radio-options",34),x("modelChange",function(t){u(e);let l=m();return f(l.pageData.Filter.HideZero,t)||(l.pageData.Filter.HideZero=t),_(t)}),a()()}if(i&2){let e=m();o(3),c("multiple",!0)("accessType",2)("outlets",e.pageData.Options.Entities),C("ngModel",e.pageData.Filter.ListIDs),o(3),C("selectedCategoryID",e.pageData.Filter.CategoryID),c("isInitializedCategoryLabel",!0)("showClear",!0),o(3),C("ngModel",e.pageData.Filter.ListTagID),c("options",e.pageData.Options.Tags)("showClear",!0)("maxSelectedLabels",5),o(),y((e.pageData.Filter.ListTagID==null?null:e.pageData.Filter.ListTagID.length)<=1?10:-1),o(4),C("date",e.pageData.Filter.ReleasedFrom),o(),C("date",e.pageData.Filter.ReleasedTo),o(7),C("ngModel",e.pageData.Filter.IntervalCount),o(2),C("ngModel",e.pageData.Filter.IntervalDays),o(5),c("max",1e3),C("ngModel",e.pageData.Filter.RowCount),o(3),C("model",e.pageData.Filter.PurchaseType),c("options",e.pageData.Options==null?null:e.pageData.Options.PurchaseType),o(3),C("model",e.pageData.Filter.GroupByProduct),c("options",e.scopeFilter),o(3),C("model",e.pageData.Filter.HideZero),c("options",e.hideZeroOptions)}}function CT(i,s){if(i&1){let e=I();n(0,"button",36),P("click",function(){u(e);let t=m();return _(t.openExportModal())}),b(1,"i",37),p(2," Export "),a()}}function fT(i,s){if(i&1&&(n(0,"th",38),p(1),a(),n(2,"th",39),p(3," % "),a()),i&2){let e=s.$index,r=m();c("mat-sort-header","Interval"+e)("matTooltip"," Quantity Sold "+(e*r.intervalDays()+1)+" - "+(e+1)*r.intervalDays()+" Days since Release Date"),o(),D(" ",e*r.intervalDays()+1+"-"+(e+1)*r.intervalDays()," "),o(),c("mat-sort-header","Percentage"+e)("matTooltip"," Percentage Sold "+(e*r.intervalDays()+1)+" - "+(e+1)*r.intervalDays()+" Days since Release Date")}}function xT(i,s){if(i&1&&(n(0,"th",40),d(1,"date"),d(2,"date"),p(3," TOT "),a(),n(4,"th",41),d(5,"date"),d(6,"date"),p(7," % "),a()),i&2){let e=m();c("matTooltip","Total items sold"+(e.pageData.Filter.ReleasedFrom&&e.pageData.Filter.ReleasedTo?` in this period
|
|
9
9
|
`+v(1,2,e.pageData.Filter.ReleasedFrom,"dd MMM yyyy")+" - "+v(2,5,e.pageData.Filter.ReleasedTo,"dd MMM yyyy"):"")),o(4),c("matTooltip","Total Percentage items sold"+(e.pageData.Filter.ReleasedFrom&&e.pageData.Filter.ReleasedTo?` in this period
|