dealpos 12.2.2 → 12.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[9498],{79498:(Te,$,g)=>{g.r($),g.d($,{ReportsModule:()=>VC});var l=g(81180),p=g(36895),d=g(24006),f=g(96308),ne=g(7155),O=g(99602),Y=g(3238),V=g(71948),B=g(44144),K=g(3848),W=g(59798),R=g(90811),q=g(11594),m=g(88796),h=g(9116),y=g(65412),me=g(42046),e=g(94650),_=g(89156),I=g(97185),x=g(10266),U=g(83902),X=g(63165);function ht(n,r){if(1&n&&(e.TgZ(0,"ng-conntainer")(1,"span",4),e._uU(2),e.ALo(3,"number"),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Oqu(e.lcZ(3,1,t.totalCount))}}function ft(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",13)(1,"i",14),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onShowTotal())}),e._uU(2,"?"),e.qZA()()}}let xt=(()=>{class n{constructor(t,a,o,i){(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"toaster",void 0),(0,l.Z)(this,"dialogRef",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"modalConfig",new me.O),(0,l.Z)(this,"ExportPageNumber",void 0),(0,l.Z)(this,"ExportRowCount",void 0),(0,l.Z)(this,"startExport",void 0),(0,l.Z)(this,"endExport",void 0),(0,l.Z)(this,"totalCount",void 0),(0,l.Z)(this,"calculateCount",void 0),(0,l.Z)(this,"isShowTotal",void 0),this.httpService=t,this.toaster=a,this.dialogRef=o,this.data=i,this.ExportPageNumber=i.Filter.ExportPageNumber,this.ExportRowCount=i.Filter.ExportRowCount,this.totalCount=i.TotalCount,this.isShowTotal=i.isShowTotal,this.initModalConfig()}ngOnInit(){this.countExportRowCount()}initModalConfig(){this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px",this.modalConfig.okText="Export"}onShowTotal(){this.httpService.post("/API/Report/ReportDetailCount",JSON.stringify(this.data.Filter)).subscribe(t=>{this.isShowTotal=!0,this.totalCount=t.Count,this.countExportRowCount()})}onPageNumberChange(t){this.ExportPageNumber=t,this.countExportRowCount()}countExportRowCount(){let t=this.data.Filter.ExportRowCount;this.ExportPageNumber>1?(this.endExport=this.totalCount-this.ExportPageNumber*t>0?this.ExportPageNumber*t:this.totalCount,this.startExport=this.ExportPageNumber-1==1?t+1:(this.ExportPageNumber-1)*t+1,this.startExport>this.totalCount&&(this.startExport=this.totalCount)):(this.startExport=this.ExportPageNumber,this.endExport=this.totalCount>t?t:this.totalCount)}onOk(){this.dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(I._W),e.Y36(y.so),e.Y36(y.WI))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["ng-component"]],decls:28,vars:13,consts:[[3,"config","onOk","onCancel","onClose"],[1,"container",2,"width","350px"],[1,"row"],[1,"col-6","ps-0","pe-3"],[1,"fw-bold"],["type","text","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],[1,"col-6","pe-0","ps-3"],[1,"border","border-2","border-secondary","ps-3","pt-3","bg-light",2,"height","32px"],[1,"col-12","p-0"],[1,"border","border-1","ps-3","pt-3","alert-warning",2,"height","32px"],[1,"fa-solid","fa-circle-info","me-1"],[4,"ngIf","ngIfElse"],["MARK_QUESTION",""],[2,"cursor","pointer"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","py-1","px-3",3,"click"]],template:function(t,a){if(1&t&&(e.TgZ(0,"modal-material",0),e.NdJ("onOk",function(){return a.onOk()})("onCancel",function(){return a.dialogRef.close()})("onClose",function(){return a.dialogRef.close()}),e.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"label",4),e._uU(6,"Page Number"),e.qZA(),e.TgZ(7,"input",5),e.NdJ("ngModelChange",function(i){return a.ExportPageNumber=i})("ngModelChange",function(i){return a.onPageNumberChange(i)}),e.qZA()(),e.TgZ(8,"div",6)(9,"label",4),e._uU(10,"Page Size"),e.qZA(),e.TgZ(11,"div",7),e._uU(12),e.ALo(13,"number"),e.qZA()()(),e.TgZ(14,"div",2)(15,"div",8)(16,"div",9),e._UZ(17,"i",10),e._uU(18," Exporting ["),e.TgZ(19,"span",4),e._uU(20),e.ALo(21,"number"),e.ALo(22,"number"),e.qZA(),e._uU(23,"] record of "),e.YNc(24,ht,4,3,"ng-conntainer",11),e.YNc(25,ft,3,0,"ng-template",null,12,e.W1O),e._uU(27," transactions "),e.qZA()()()()()()),2&t){const o=e.MAs(26);e.Q6J("config",a.modalConfig),e.xp6(7),e.Q6J("ngModel",a.ExportPageNumber),e.xp6(5),e.hij(" ",e.lcZ(13,7,a.ExportRowCount),""),e.xp6(8),e.AsE("",e.lcZ(21,9,a.startExport)," - ",e.lcZ(22,11,a.endExport),""),e.xp6(4),e.Q6J("ngIf",a.isShowTotal)("ngIfElse",o)}},dependencies:[p.O5,d.Fj,d.JJ,d.On,x.gM,U.b,X.M,p.JJ]})),n})();var ce=g(23410),C=g(67327),M=g(17554),Z=g(24424),N=g(10962),b=g(51161),T=g(30273),A=g(98085),E=g(58393),j=g(76359),S=g(93669);function Tt(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",28),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.openExportModal())}),e._UZ(1,"i",29),e._uU(2," Export"),e.qZA()}}function Ct(n,r){if(1&n&&(e.TgZ(0,"div",26),e.YNc(1,Tt,3,0,"button",27),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.roleService.global.Export)}}function Zt(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",30)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",31),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Customer"),e.qZA(),e.TgZ(8,"autocompleteV2",32),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.CustomerID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"From - To"),e.qZA(),e.TgZ(12,"div")(13,"datepicker",33),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(14,"div",34)(15,"datepicker",35),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onFilterToDate())}),e.qZA()()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Sales"),e.qZA(),e.TgZ(19,"ng-select-infinite",36),e.NdJ("selectedChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.SalesID=o)}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"Group"),e.qZA(),e.TgZ(23,"ng-select",37),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ContactGroupID=o)}),e.qZA()(),e.TgZ(24,"div")(25,"h6"),e._uU(26,"Bin"),e.qZA(),e.TgZ(27,"radio-options",38),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.Bin=o)}),e.qZA()()()}if(2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CustomerID),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("selected",t.pageData.Filter.SalesID)("items",null==t.pageData.Options?null:t.pageData.Options.Sales),e.xp6(4),e.Q6J("items",t.pageData.Options.ContactGroups)("ngModel",t.pageData.Filter.ContactGroupID),e.xp6(4),e.Q6J("model",t.pageData.Filter.Bin)}}function Dt(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",39)(1,"div")(2,"h6"),e._uU(3,"Type"),e.qZA(),e.TgZ(4,"ng-select",37),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Currency"),e.qZA(),e.TgZ(8,"ng-select",40),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.CurrencyID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Delivery"),e.qZA(),e.TgZ(12,"ng-select",41),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.DeliveryStateID=o)}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Complementary"),e.qZA(),e.TgZ(16,"radio-options",42),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.Complementary=o)}),e.qZA()(),e.TgZ(17,"div")(18,"h6"),e._uU(19,"Payment"),e.qZA(),e.TgZ(20,"ng-select",43),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.PaymentStateID=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(21,"div")(22,"h6"),e._uU(23,"Creator"),e.qZA(),e.TgZ(24,"autocompleteV2",44),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.CreatorID=o)}),e.qZA()(),e.TgZ(25,"div")(26,"h6"),e._uU(27,"Note Visible"),e.qZA(),e.TgZ(28,"radio-options",45),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.NoteVisible=o)}),e.qZA()(),e.TgZ(29,"div")(30,"h6"),e._uU(31,"Date Filter Column"),e.qZA(),e.TgZ(32,"radio-options",46),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.SortBy=o)})("modelChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.searchFromPageOne())}),e.qZA()()()}if(2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("items",t.pageData.Options.Types)("ngModel",t.pageData.Filter.TypeID),e.xp6(4),e.Q6J("items",t.pageData.Options.Currencies)("ngModel",t.pageData.Filter.CurrencyID),e.xp6(4),e.Q6J("items",t.pageData.Options.Deliveries)("ngModel",t.pageData.Filter.DeliveryStateID),e.xp6(4),e.Q6J("model",t.pageData.Filter.Complementary),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.PaymentStateID)("items",null==t.pageData.Options?null:t.pageData.Options.States),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CreatorID),e.xp6(4),e.Q6J("model",t.pageData.Filter.NoteVisible),e.xp6(4),e.Q6J("model",t.pageData.Filter.SortBy)("options",t.SortBy)}}function vt(n,r){1&n&&(e.TgZ(0,"th",47),e._uU(1," @ Cost "),e.qZA())}function bt(n,r){if(1&n&&(e.TgZ(0,"small",63),e._uU(1),e.ALo(2,"showIfNotNullOrEmptyString"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.xi3(2,1,t.CustomerNameDisplay," - {0}"))}}function yt(n,r){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"showIfNotNullOrEmptyString"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.xi3(2,1,t.SalesName," - Sales: {0}"))}}function St(n,r){if(1&n&&(e.TgZ(0,"span",63),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" "," - Profit: "+e.lcZ(2,1,t.Profit)," ")}}function At(n,r){if(1&n&&(e.TgZ(0,"i",64),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",null==t.DeliveryOutlet?"":": Delivered from "+t.DeliveryOutlet," ")}}function wt(n,r){if(1&n&&(e.TgZ(0,"span",65),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",null==t.AuthorizationKey?"":": "+t.AuthorizationKey," ")}}function Ft(n,r){1&n&&(e.TgZ(0,"span"),e._uU(1,"-"),e.qZA())}function Mt(n,r){if(1&n&&(e.ynx(0),e._UZ(1,"div",66),e.ALo(2,"newlines"),e.BQk()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("innerHTML",e.lcZ(2,1,t.SONote),e.oJD)}}const we=function(n){return{ID:n}};function qt(n,r){if(1&n&&(e.ynx(0),e.TgZ(1,"div")(2,"a",67),e._uU(3),e.qZA()(),e.BQk()),2&n){const t=e.oxw().$implicit;e.xp6(2),e.Q6J("queryParams",e.VKq(2,we,t.ReferenceInvoiceID)),e.xp6(1),e.hij(" Return ",t.ReferenceInvoiceNumber," ")}}function It(n,r){if(1&n&&(e.TgZ(0,"i",80),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" sold by ",t.Commissions.SalesName," ")}}function Pt(n,r){if(1&n&&(e.TgZ(0,"th",81),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,null==t?null:t.UnitCost)," ")}}function Ot(n,r){if(1&n&&(e.TgZ(0,"tr",68)(1,"th",12)(2,"div")(3,"span",69),e._uU(4),e.qZA(),e.YNc(5,It,2,1,"i",70),e._UZ(6,"span",71),e.qZA()(),e.TgZ(7,"th",72),e._uU(8),e.qZA(),e.TgZ(9,"th",73),e._uU(10),e.ALo(11,"number"),e.qZA(),e.TgZ(12,"th",74),e._uU(13),e.qZA(),e.YNc(14,Pt,3,3,"th",75),e.TgZ(15,"th",76),e._uU(16),e.ALo(17,"number"),e.qZA(),e.TgZ(18,"th",77)(19,"div",78),e._uU(20),e.qZA(),e.TgZ(21,"div",79),e._uU(22),e.ALo(23,"number"),e.qZA()(),e.TgZ(24,"th",76),e._uU(25),e.ALo(26,"number"),e.qZA()()),2&n){const t=r.$implicit,a=e.oxw(3);e.xp6(4),e.Oqu(null==t?null:t.Name),e.xp6(1),e.Q6J("ngIf",0!=(null==t?null:t.Commissions.Quantity)&&t.Commissions.SalesName),e.xp6(1),e.Q6J("innerHtml",null==t?null:t.Note,e.oJD),e.xp6(2),e.hij(" ",null==t?null:t.Code," "),e.xp6(2),e.hij(" ",e.lcZ(11,11,null==t?null:t.Quantity)," "),e.xp6(3),e.hij(" ",null==t?null:t.UOMName," "),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(2),e.hij(" ",e.lcZ(17,13,null==t?null:t.UnitPrice)," "),e.xp6(4),e.hij(" ",0==(null==t?null:t.Discount)?"":(null==t?null:t.Discount)+"%"," "),e.xp6(2),e.hij(" ",0==(null==t?null:t.DiscountAmount)?"":e.lcZ(23,15,null==t?null:t.DiscountAmount)," "),e.xp6(3),e.hij(" ",e.lcZ(26,17,null==t?null:t.Total)," ")}}function Nt(n,r){if(1&n&&(e.ynx(0),e.TgZ(1,"tr")(2,"th",82),e._uU(3),e.qZA(),e.TgZ(4,"th",83),e._uU(5),e.qZA(),e.TgZ(6,"th",84),e._uU(7),e.ALo(8,"number"),e.qZA()(),e.BQk()),2&n){const t=r.$implicit;e.xp6(3),e.hij("",t.Label," :"),e.xp6(2),e.hij(" ",t.CurrencySymbol," "),e.xp6(2),e.hij(" ",e.lcZ(8,3,t.Amount)," ")}}const Jt=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]};function Lt(n,r){if(1&n&&(e.TgZ(0,"div")(1,"div",48)(2,"div",49)(3,"div")(4,"a",50)(5,"span",51),e._uU(6),e.qZA()(),e.TgZ(7,"span"),e._uU(8),e.ALo(9,"date"),e._UZ(10,"small",52),e.ALo(11,"date"),e.YNc(12,bt,3,4,"small",53),e.qZA()(),e.TgZ(13,"div",54)(14,"strong",55),e._uU(15),e.YNc(16,yt,3,4,"span",25),e.qZA(),e.YNc(17,St,3,3,"span",53),e.YNc(18,At,2,1,"i",56),e.YNc(19,wt,2,1,"span",57),e.YNc(20,Ft,2,0,"span",25),e.qZA(),e.YNc(21,Mt,3,3,"ng-container",25),e.YNc(22,qt,4,4,"ng-container",25),e.qZA(),e.TgZ(23,"div",58),e._uU(24),e.qZA()(),e.TgZ(25,"table",59)(26,"tbody",60),e.YNc(27,Ot,27,19,"tr",61),e.qZA()(),e.TgZ(28,"table",62),e.YNc(29,Nt,9,5,"ng-container",19),e.qZA()()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(4),e.Q6J("routerLink",e.DdM(23,Jt))("queryParams",e.VKq(24,we,t.ID)),e.xp6(2),e.hij(" ",t.EntityName+" # "+t.Number,""),e.xp6(2),e.hij(" "," - "+e.xi3(9,17,t.Date,"dd MMM yyyy")," "),e.xp6(2),e.Q6J("innerHtml","("+e.xi3(11,20,t.Created,"HH:mm")+(null!=t.Order&&t.Order.ClientTimestamp?" - Client Timestamp: "+t.Order.ClientTimestamp:"")+")",e.oJD),e.xp6(2),e.Q6J("ngIf",a.isNotEmpty(t.CustomerNameDisplay)),e.xp6(3),e.hij(" ","[Q: "+t.TotalItemQuantity+"]"," "),e.xp6(1),e.Q6J("ngIf",a.isNotEmpty(t.SalesName)),e.xp6(1),e.Q6J("ngIf",a.roleService.report.Profit),e.xp6(1),e.Q6J("ngIf",a.isNotEmpty(t.DeliveryOutlet)),e.xp6(1),e.Q6J("ngIf",a.isNotEmpty(t.AuthorizationKey)),e.xp6(1),e.Q6J("ngIf",t.SONote&&t.AuthorizationKey),e.xp6(1),e.Q6J("ngIf",a.isNotEmpty(t.SONote)),e.xp6(1),e.Q6J("ngIf",a.isNotEmpty(t.ReferenceInvoiceID)),e.xp6(2),e.hij(" ",t.PaymentStateLabel," "),e.xp6(3),e.Q6J("ngForOf",t.Items),e.xp6(2),e.Q6J("ngForOf",t.Aggregate)}}function Ut(n,r){if(1&n&&(e.TgZ(0,"div",59)(1,"strong"),e._uU(2,"Qty"),e.qZA(),e.TgZ(3,"span",82),e._uU(4),e.ALo(5,"number"),e.qZA()()),2&n){const t=e.oxw(3);e.xp6(4),e.Oqu(e.lcZ(5,1,t.totalAggregate.ItemsQuantity))}}function Qt(n,r){if(1&n&&(e.TgZ(0,"div",59)(1,"strong"),e._uU(2,"Qty Complementary"),e.qZA(),e.TgZ(3,"span",82),e._uU(4),e.ALo(5,"number"),e.qZA()()),2&n){const t=e.oxw(3);e.xp6(4),e.Oqu(e.lcZ(5,1,t.totalAggregate.QuantityComplementary))}}function kt(n,r){if(1&n&&(e.TgZ(0,"div",59)(1,"strong"),e._uU(2,"Qty Sold"),e.qZA(),e.TgZ(3,"span",82),e._uU(4),e.ALo(5,"number"),e.qZA()()),2&n){const t=e.oxw(3);e.xp6(4),e.Oqu(e.lcZ(5,1,t.totalAggregate.QuantityWithoutComplementary))}}function Et(n,r){if(1&n&&(e.TgZ(0,"div")(1,"strong"),e._uU(2,"Cost ("),e.TgZ(3,"span",89),e._uU(4),e.ALo(5,"number"),e.qZA(),e._uU(6,"%)"),e.qZA(),e.TgZ(7,"span",82),e._uU(8),e.ALo(9,"number"),e.qZA()()),2&n){const t=e.oxw(3);e.xp6(4),e.Oqu(e.lcZ(5,2,t.totalAggregate.CostRatio)),e.xp6(4),e.Oqu(e.lcZ(9,4,t.totalAggregate.Cost))}}function Yt(n,r){if(1&n&&(e.TgZ(0,"div")(1,"strong")(2,"span"),e._uU(3,"Profit"),e.qZA(),e._uU(4," ("),e.TgZ(5,"span",89),e._uU(6),e.ALo(7,"number"),e.qZA(),e._uU(8,"%)"),e.qZA(),e.TgZ(9,"span",82),e._uU(10),e.ALo(11,"number"),e.qZA()()),2&n){const t=e.oxw(3);e.xp6(6),e.Oqu(e.lcZ(7,2,t.totalAggregate.ProfitRatio)),e.xp6(4),e.Oqu(e.lcZ(11,4,t.totalAggregate.Profit))}}function Rt(n,r){if(1&n&&(e.TgZ(0,"div",85),e._UZ(1,"div",86),e.TgZ(2,"div",87)(3,"div")(4,"strong"),e._uU(5,"Tax Added"),e.qZA(),e.TgZ(6,"span",82),e._uU(7),e.ALo(8,"number"),e.qZA()(),e.TgZ(9,"div")(10,"strong"),e._uU(11,"Sales with Tax"),e.qZA(),e.TgZ(12,"span",82),e._uU(13),e.ALo(14,"number"),e.qZA()()(),e.TgZ(15,"div",87)(16,"div",59)(17,"strong"),e._uU(18,"Orders"),e.qZA(),e.TgZ(19,"span",82),e._uU(20),e.ALo(21,"number"),e.qZA()(),e.YNc(22,Ut,6,3,"div",88),e.YNc(23,Qt,6,3,"div",88),e.YNc(24,kt,6,3,"div",88),e.qZA(),e.TgZ(25,"div",87)(26,"div")(27,"strong"),e._uU(28,"Gross Sales"),e.qZA(),e.TgZ(29,"span",82),e._uU(30),e.ALo(31,"number"),e.qZA()(),e.TgZ(32,"div")(33,"strong"),e._uU(34,"Discount"),e.qZA(),e.TgZ(35,"span",82),e._uU(36),e.ALo(37,"number"),e.qZA()(),e.TgZ(38,"div")(39,"strong"),e._uU(40,"Tax Incl."),e.qZA(),e.TgZ(41,"span",82),e._uU(42),e.ALo(43,"number"),e.qZA()(),e.TgZ(44,"div")(45,"strong"),e._uU(46,"Net Sales"),e.qZA(),e.TgZ(47,"span",82),e._uU(48),e.ALo(49,"number"),e.qZA()(),e.YNc(50,Et,10,6,"div",25),e.YNc(51,Yt,12,6,"div",25),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(7),e.Oqu(e.xi3(8,12,t.totalAggregate.TaxAdd,".0-0")),e.xp6(6),e.Oqu(e.xi3(14,15,t.totalAggregate.SalesWithTax,".0-0")),e.xp6(7),e.Oqu(e.xi3(21,18,t.totalAggregate.Orders,".0-0")),e.xp6(2),e.Q6J("ngIf",!t.pageData.Filter.Complementary),e.xp6(1),e.Q6J("ngIf",t.pageData.Filter.Complementary),e.xp6(1),e.Q6J("ngIf",t.pageData.Filter.Complementary),e.xp6(6),e.Oqu(e.xi3(31,21,t.totalAggregate.GrossItems,".0-0")),e.xp6(6),e.Oqu(e.xi3(37,24,t.totalAggregate.Discount,".0-0")),e.xp6(6),e.Oqu(e.xi3(43,27,t.totalAggregate.TaxInclude,".0-0")),e.xp6(6),e.Oqu(e.xi3(49,30,t.totalAggregate.SalesWithoutTax,".0-0")),e.xp6(2),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.report.Profit)}}function Gt(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",90),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.StoreRowsCountAPIResult("Report/ReportDetailCount"))}),e.TgZ(1,"i",91),e._uU(2,"?"),e.qZA()()}}function Ht(n,r){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(e.lcZ(2,1,t.listTotal))}}function Vt(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",26)(1,"a",92),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.NextPage(!0))}),e._UZ(2,"i",93),e._uU(3," Next"),e.qZA(),e.TgZ(4,"a",94),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.StoreRowsCountAPIResult("Report/ReportDetailCount",!0))}),e._UZ(5,"i",95),e._uU(6," Show All"),e.qZA()()}}function Bt(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e.TgZ(1,"actions"),e.YNc(2,Ct,2,1,"div",2),e.qZA(),e.TgZ(3,"filters")(4,"div",3),e.YNc(5,Zt,28,11,"div",4),e.YNc(6,Dt,33,13,"div",5),e.qZA(),e.TgZ(7,"a",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.hideMore=!o.hideMore)}),e._uU(8),e._UZ(9,"i",7),e.qZA()(),e.TgZ(10,"content")(11,"div",8)(12,"div",9)(13,"table",10)(14,"thead",11)(15,"tr")(16,"th",12),e._uU(17,"Name"),e.qZA(),e.TgZ(18,"th",13),e._uU(19,"Code"),e.qZA(),e.TgZ(20,"th",14),e._uU(21,"Qty"),e.qZA(),e.TgZ(22,"th",15),e._uU(23,"UOM"),e.qZA(),e.YNc(24,vt,2,0,"th",16),e.TgZ(25,"th",17),e._uU(26,"@ Price"),e.qZA(),e.TgZ(27,"th",14),e._uU(28,"Disc."),e.qZA(),e.TgZ(29,"th",17),e._uU(30,"Total"),e.qZA()()(),e.TgZ(31,"tbody")(32,"tr")(33,"td",18),e.YNc(34,Lt,30,26,"div",19),e.qZA()()()()(),e.YNc(35,Rt,52,33,"div",20),e.TgZ(36,"div",21)(37,"div",22)(38,"div",23),e._uU(39),e.ALo(40,"number"),e.YNc(41,Gt,3,0,"span",24),e.YNc(42,Ht,3,3,"span",25),e._uU(43),e.qZA()(),e.YNc(44,Vt,7,0,"div",2),e.qZA()()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",t.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",t.pageData.Filter),e.xp6(1),e.Q6J("ngIf",!t.hideMore),e.xp6(2),e.hij("",t.hideMore?"More":"Less"," "),e.xp6(16),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(9),e.uIk("colspan",t.roleService.product.Cost?8:7),e.xp6(1),e.Q6J("ngForOf",t.infiniteList),e.xp6(1),e.Q6J("ngIf",(null==t.data?null:t.data.Data.length)>0),e.xp6(4),e.hij(" Showing 1 - ",e.lcZ(40,15,t.pageData.Filter.RowCount*(t.pageData.Filter.PageNumber-1)+t.data.TotalCurrentRow)," of "),e.xp6(2),e.Q6J("ngIf",!t.pageData.HideStoreApiCount),e.xp6(1),e.Q6J("ngIf",t.pageData.HideStoreApiCount),e.xp6(1),e.hij(" records ~ ",t.pageData.Filter.PageNumber," Page "),e.xp6(1),e.Q6J("ngIf",t.nextPageDisabled&&!t.goToLast)}}let Kt=(()=>{class n extends ce.X{constructor(t,a,o,i,s,c,u,w){super(t,"Report/ReportDetail","ReportLoader/ReportDetail",null,i),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"datePipe",void 0),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"toaster",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"totalAggregate",void 0),(0,l.Z)(this,"hideMore",!0),(0,l.Z)(this,"SortBy",[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}]),this.csvConverter=a,this.datePipe=o,this.activatedRoute=i,this.matDialog=s,this.toaster=c,this.reportFilterService=u,this.roleService=w}preInitList(){this.oldRowCount=this.pageData.Filter.RowCount,this.totalAggregate=new jt,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)}preInitLoader(){let t=this.route?.snapshot?.queryParams;t&&(this.queryParams=JSON.parse(JSON.stringify(t)),this.queryParams.IncludeComplementary="true"==t.IncludeComplementary)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}afterPostInit(t){this.nextPageDisabled=t.NextPage}assignAggregate(t){this.totalAggregate.TaxAdd=t.Aggregate.TaxAdd,this.totalAggregate.SalesWithTax=t.Aggregate.SalesWithTax,this.totalAggregate.Orders=t.Aggregate.Orders,this.totalAggregate.ItemsQuantity=t.Aggregate.ItemsQuantity,this.totalAggregate.QuantityComplementary=t.Aggregate.QuantityComplementary,this.totalAggregate.QuantityWithoutComplementary=t.Aggregate.QuantityWithoutComplementary,this.totalAggregate.GrossItems=t.Aggregate.GrossItems,this.totalAggregate.Discount=t.Aggregate.Discount,this.totalAggregate.TaxInclude=t.Aggregate.TaxInclude,this.totalAggregate.SalesWithoutTax=t.Aggregate.SalesWithoutTax,t.Aggregate.CostRatio=this.costRatioCalculation(t.Aggregate.Cost,t.Aggregate.SalesWithoutTax,t.Aggregate.TaxInclude),this.totalAggregate.CostRatio=t.Aggregate.CostRatio,t.Aggregate.ProfitRatio=this.profitRatioCalculation(t.Aggregate.Profit,t.Aggregate.SalesWithoutTax,t.Aggregate.TaxInclude),this.totalAggregate.ProfitRatio=t.Aggregate.ProfitRatio,this.totalAggregate.Profit=t.Aggregate.Profit,this.totalAggregate.Cost=t.Aggregate.Cost}postExtendData(t){this.totalAggregate.TaxAdd+=t.Aggregate.TaxAdd,this.totalAggregate.SalesWithTax+=t.Aggregate.SalesWithTax,this.totalAggregate.Orders+=t.Aggregate.Orders,this.totalAggregate.ItemsQuantity+=t.Aggregate.ItemsQuantity,this.totalAggregate.QuantityComplementary+=t.Aggregate.QuantityComplementary,this.totalAggregate.QuantityWithoutComplementary+=t.Aggregate.QuantityWithoutComplementary,this.totalAggregate.GrossItems+=t.Aggregate.GrossItems,this.totalAggregate.Discount+=t.Aggregate.Discount,this.totalAggregate.TaxInclude+=t.Aggregate.TaxInclude,this.totalAggregate.SalesWithoutTax+=t.Aggregate.SalesWithoutTax,t.Aggregate.CostRatio=this.costRatioCalculation(t.Aggregate.Cost,t.Aggregate.SalesWithoutTax,t.Aggregate.TaxInclude),this.totalAggregate.CostRatio+=t.Aggregate.CostRatio,t.Aggregate.ProfitRatio=this.profitRatioCalculation(t.Aggregate.Profit,t.Aggregate.SalesWithoutTax,t.Aggregate.TaxInclude),this.totalAggregate.ProfitRatio+=t.Aggregate.ProfitRatio,this.totalAggregate.Profit+=t.Aggregate.Profit,this.totalAggregate.Cost+=t.Aggregate.Cost}costRatioCalculation(t,a,o){let i=0;return this.pageData.IncludeTax&&(a+=o),0!=a&&(i=t/a*100),i}profitRatioCalculation(t,a,o){let i=0;return this.pageData.IncludeTax&&(a+=o),0!=a&&(i=t/a*100),i}export(t){let a=this.listTotal,o=!0;this.pageData.HideStoreApiCount||(a=this.pageData.Filter.RowCount*(this.pageData.Filter.PageNumber-1)+this.data.TotalCurrentRow,o=!1),this.showExportModal(t,a,o)}showExportModal(t,a,o){this.matDialog.open(xt,{data:{Filter:this.pageData.Filter,TotalCount:a,isShowTotal:o}}).afterClosed().subscribe(s=>{if(s){const c=s.ExportPageNumber;switch(this.pageData.Filter.ExportPageNumber=c,t){case"default":this.exportCSV(this.csvConverter,"ReportExport/ReportDetail","SalesReport_"+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To)+`_Page_${c}.csv`);break;case"xslx":this.exportXlsx("ReportExport/ReportDetail","SalesReport_"+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To)+`_Page_${c}.xlsx`);break;case"complete":this.exportCSV(this.csvConverter,"ReportExport/ReportDetailComplete","SalesReportComplete_"+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To)+`_Page_${c}.csv`);break;case"contactxlsx":this.exportXlsx("ReportExport/ReportDetailComplete","SalesReportComplete_"+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To)+`_Page_${c}.xlsx`);break;case"completexlsx":this.exportXlsx("ReportExport/ReportDetailWithContact","SalesReportWithContact_"+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To)+`_Page_${c}.xlsx`);break;case"contact":this.exportCSV(this.csvConverter,"ReportExport/ReportDetailWithContact","SalesReportWithContact_"+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To)+`_Page_${c}.csv`)}}})}transformDate(t){return this.datePipe.transform(t,"ddMMyy")}isNotEmpty(t){return C.gT.IsNotEmpty(t)}openExportModal(){const t=" "+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To);this.matDialog.open(M.H,{data:{title:"Sales by Transaction",exportTypes:[{ID:"ReportExport/ReportDetail",Value:"Default",FileName:"Sales Transaction"+t},{ID:"ReportExport/ReportDetailWithContact",Value:"Contact Detail",FileName:"Sales Transaction with Contact"+t},{ID:"ReportExport/ReportDetailComplete",Value:"Complete Detail",FileName:"Sales Complete Transaction"+t}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportDetailCount",pagination:!0}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(p.uU),e.Y36(h.gz),e.Y36(y.uw),e.Y36(I._W),e.Y36(N.z),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["POS-sales-detail"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["class","btn-group",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ms-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fa-solid","fa-caret-down"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],["class","text-end","style","width: 80px",4,"ngIf"],[1,"text-end",2,"width","90px"],[1,"px-0",2,"border-bottom-width","0px !important"],[4,"ngFor","ngForOf"],["class","row justify-content-end mt-10 mx-0 aggregate-detail",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose...","id","inputSales",3,"selected","items","selectedChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"items","ngModel","ngModelChange"],["name","Bin",3,"model","modelChange"],["id","more-filter","container","",1,"ms-6"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose...",3,"items","ngModel","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"items","ngModel","ngModelChange"],["name","Complementary",3,"model","modelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModel","items","ngModelChange"],["requestUrl","/API/AC/GetUserSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["name","NoteVisible",3,"model","modelChange"],["name","Sort",3,"model","options","modelChange"],[1,"text-end",2,"width","80px"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2","ps-1"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[1,"fst-italic","fw-bold",3,"innerHtml"],["class","fw-bold",4,"ngIf"],[1,"pt-1"],[1,"text-danger"],["id","deliveryNote",4,"ngIf"],["class","d-inline-block fst-italic",4,"ngIf"],[1,"mt-8","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],["class","border-start border-end",4,"ngFor","ngForOf"],[1,"table","table-sm","table-borderless"],[1,"fw-bold"],["id","deliveryNote"],[1,"d-inline-block","fst-italic"],[1,"d-inline-block","fst-italic",3,"innerHTML"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],[1,"border-start","border-end"],[1,"fw-normal"],["class","text-warning inlineMarginLeft",4,"ngIf"],[1,"d-block","fw-normal","fst-italic",2,"word-break","break-all",3,"innerHtml"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"fw-normal","text-end","border-start","border-end",2,"width","42px"],[1,"fst-italic","small","border-start","border-end",2,"width","40px"],["class","fw-normal text-end border-start border-end","style","width: 80px",4,"ngIf"],[1,"fw-normal","text-end","border-start","border-end",2,"width","90px"],[1,"fw-normal","text-end","text-danger","border-start","border-end",2,"width","50px"],["matTooltipPosition","above","matTooltip","Disc %"],["matTooltipPosition","above","matTooltip","Disc Amount"],[1,"text-warning","inlineMarginLeft"],[1,"fw-normal","text-end","border-start","border-end",2,"width","80px"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[1,"row","justify-content-end","mt-10","mx-0","aggregate-detail"],[1,"col-auto"],[1,"zebra","col-auto"],["class","w-100",4,"ngIf"],[1,"Percentage"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(t,a){1&t&&e.YNc(0,Bt,45,17,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,x.gM,q.P,E.J,j.R,S.sH,S.WV,p.JJ,p.uU],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}}"]})),n})();class jt{constructor(){(0,l.Z)(this,"TaxAdd",0),(0,l.Z)(this,"SalesWithTax",0),(0,l.Z)(this,"Orders",0),(0,l.Z)(this,"ItemsQuantity",0),(0,l.Z)(this,"QuantityComplementary",0),(0,l.Z)(this,"QuantityWithoutComplementary",0),(0,l.Z)(this,"GrossItems",0),(0,l.Z)(this,"Discount",0),(0,l.Z)(this,"TaxInclude",0),(0,l.Z)(this,"SalesWithoutTax",0),(0,l.Z)(this,"CostRatio",0),(0,l.Z)(this,"Cost",0),(0,l.Z)(this,"ProfitRatio",0),(0,l.Z)(this,"Profit",0)}}let zt=(()=>{class n{constructor(t,a){(0,l.Z)(this,"_dialogRef",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"modalConfig",new me.O),(0,l.Z)(this,"ExportPageNumber",void 0),(0,l.Z)(this,"ExportRowCount",void 0),this._dialogRef=t,this.data=a,this.ExportPageNumber=a.ExportPageNumber,this.ExportRowCount=a.ExportRowCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px"}ngOnInit(){}onOk(){this._dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}close(){this._dialogRef.close()}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(y.so),e.Y36(y.WI))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["modal-export-summary"]],decls:11,vars:4,consts:[[3,"title","config","onOk","onCancel","onClose"],[1,"container",2,"width","350px"],[1,"row"],["type","text",1,"form-control",3,"ngModel","ngModelChange"]],template:function(t,a){1&t&&(e.TgZ(0,"modal-material",0),e.NdJ("onOk",function(){return a.onOk()})("onCancel",function(){return a._dialogRef.close()})("onClose",function(){return a._dialogRef.close()}),e.TgZ(1,"content")(2,"div",1)(3,"div",2)(4,"label"),e._uU(5,"Page Number"),e.qZA(),e.TgZ(6,"input",3),e.NdJ("ngModelChange",function(i){return a.ExportPageNumber=i}),e.qZA()(),e.TgZ(7,"div",2)(8,"label"),e._uU(9,"Page Size"),e.qZA(),e.TgZ(10,"input",3),e.NdJ("ngModelChange",function(i){return a.ExportRowCount=i}),e.qZA()()()()()),2&t&&(e.Q6J("title","Export Report")("config",a.modalConfig),e.xp6(6),e.Q6J("ngModel",a.ExportPageNumber),e.xp6(4),e.Q6J("ngModel",a.ExportRowCount))},dependencies:[d.Fj,d.JJ,d.On,X.M]})),n})();var ge=g(5536);function Wt(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",18),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.openExportModal())}),e._UZ(1,"i",19),e._uU(2," Export"),e.qZA()}}function $t(n,r){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",27)(2,"datepicker",28),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onFilterFromDate())}),e.qZA(),e.TgZ(3,"div",29)(4,"app-timepicker",30),e.NdJ("timeChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.timeFrom=o)})("timeChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.timeFromChange(o))}),e.qZA()()(),e.TgZ(5,"div",31)(6,"datepicker",32),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onFilterFromDate())}),e.qZA(),e.TgZ(7,"div",29)(8,"app-timepicker",30),e.NdJ("timeChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.timeTo=o)})("timeChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.timeToChange(o))}),e.qZA()()(),e.BQk()}if(2&n){const t=e.oxw(3);e.xp6(2),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("time",t.timeFrom),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(2),e.Q6J("time",t.timeTo)}}function Xt(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"datepicker",33),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(2,"div",34)(3,"datepicker",35),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onFilterToDate())}),e.qZA()()}if(2&n){const t=e.oxw(3);e.xp6(1),e.Q6J("date",t.pageData.Filter.From)("appearance","outline")("width",100),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)("appearance","outline")("width",100)}}function en(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",20)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",21),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Customer"),e.qZA(),e.TgZ(8,"autocompleteV2",22),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.CustomerID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Sales"),e.qZA(),e.TgZ(12,"ng-select-infinite",23),e.NdJ("selectedChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.SalesID=o)}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"From - To"),e.qZA(),e.YNc(16,$t,9,4,"ng-container",24),e.YNc(17,Xt,4,6,"ng-template",null,25,e.W1O),e.qZA(),e.TgZ(19,"div")(20,"h6"),e._uU(21,"Date Filter Column"),e.qZA(),e.TgZ(22,"radio-options",26),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.isCreated=o)}),e.qZA()()()}if(2&n){const t=e.MAs(18),a=e.oxw(2);e.xp6(4),e.Q6J("multiple",!0)("ngModel",a.pageData.Filter.ListIDs)("items",null==a.pageData.Options?null:a.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",a.pageData.Filter.CustomerID)("inputTextValue",a.pageData.CustomerName),e.xp6(4),e.Q6J("selected",a.pageData.Filter.SalesID)("items",null==a.pageData.Options?null:a.pageData.Options.Sales),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter.isCreated)("ngIfElse",t),e.xp6(6),e.Q6J("options",a.filterInvoiceBy)("model",a.pageData.Filter.isCreated)}}function tn(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",36)(1,"div")(2,"h6"),e._uU(3,"Register"),e.qZA(),e.TgZ(4,"ng-select",37),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.RegisterID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Customer Groups"),e.qZA(),e.TgZ(8,"ng-select",37),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.CustomerGroupID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Payment"),e.qZA(),e.TgZ(12,"ng-select",38),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.PaymentState=o)}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Creator"),e.qZA(),e.TgZ(16,"autocompleteV2",39),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.CreatorID=o)}),e.qZA()(),e.TgZ(17,"div")(18,"h6"),e._uU(19,"RowCount"),e.qZA(),e.TgZ(20,"input",40),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.RowCount=o)}),e.qZA()()()}if(2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.RegisterID)("items",t.pageData.Options.Registers),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CustomerGroupID)("items",t.pageData.Options.Groups),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.PaymentState)("items",t.pageData.Options.States),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CreatorID),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.RowCount)}}function nn(n,r){1&n&&(e.TgZ(0,"th",57),e._uU(1,"COST"),e.qZA())}function on(n,r){1&n&&(e.TgZ(0,"th",58),e._uU(1," TAX"),e.qZA())}function an(n,r){1&n&&(e.TgZ(0,"th",59),e._uU(1,"SURCHARGE "),e.qZA())}function rn(n,r){1&n&&e._UZ(0,"br")}function ln(n,r){if(1&n&&(e.TgZ(0,"i"),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(t.Note)}}function sn(n,r){if(1&n&&(e.TgZ(0,"td",63),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Cost))}}function pn(n,r){if(1&n&&(e.TgZ(0,"td",63),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Tax))}}function cn(n,r){if(1&n&&(e.TgZ(0,"td",63),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij("",e.lcZ(2,1,t.SurchargeAmount)," ")}}const dn=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},Fe=function(n){return{ID:n}},un=function(){return["/menu/Contacts/Contact/Customers/Info"]},_n=function(n,r,t){return{"text-success":n,"text-warning":r,"text-danger":t}};function mn(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"a",60),e._uU(5),e.qZA(),e.YNc(6,rn,1,0,"br",14),e.YNc(7,ln,2,1,"i",14),e.qZA(),e.TgZ(8,"td")(9,"div"),e._uU(10),e.ALo(11,"date"),e.qZA(),e.TgZ(12,"div"),e._uU(13),e.ALo(14,"date"),e.qZA()(),e.TgZ(15,"td")(16,"a",61),e._uU(17),e.qZA()(),e.TgZ(18,"td"),e._uU(19),e.qZA(),e.YNc(20,sn,3,3,"td",62),e.TgZ(21,"td",63),e._uU(22),e.ALo(23,"number"),e.qZA(),e.YNc(24,pn,3,3,"td",62),e.YNc(25,cn,3,3,"td",62),e.TgZ(26,"td",63),e._uU(27),e.ALo(28,"number"),e.qZA(),e.TgZ(29,"td",64),e._uU(30),e.qZA()()),2&n){const t=r.$implicit,a=e.oxw(3);e.xp6(2),e.Oqu(t.EntityName),e.xp6(2),e.Q6J("routerLink",e.DdM(29,dn))("queryParams",e.VKq(30,Fe,t.ID)),e.xp6(1),e.hij(" ",t.Number," "),e.xp6(1),e.Q6J("ngIf",t.Note),e.xp6(1),e.Q6J("ngIf",t.Note),e.xp6(3),e.hij(" ",e.xi3(11,19,t.Date,"dd MMM yy")," "),e.xp6(3),e.hij(" ",e.xi3(14,22,t.Created,"HH:mm")," "),e.xp6(3),e.Q6J("routerLink",e.DdM(32,un))("queryParams",e.VKq(33,Fe,t.CustomerID)),e.xp6(1),e.Oqu(t.CustomerName),e.xp6(2),e.Oqu(t.SalesName),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(2),e.Oqu(e.lcZ(23,25,t.Sales)),e.xp6(2),e.Q6J("ngIf",a.data.TaxVisible),e.xp6(1),e.Q6J("ngIf",a.data.SurchargeVisible),e.xp6(2),e.Oqu(e.lcZ(28,27,t.SalesNSurcharge)),e.xp6(2),e.Q6J("ngClass",e.kEZ(35,_n,3==t.PaymentStateID,2==t.PaymentStateID,1==t.PaymentStateID)),e.xp6(1),e.Oqu(t.PaymentStateString)}}function gn(n,r){if(1&n&&(e.TgZ(0,"td",63),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(4);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.infiniteList,"Cost")),"")}}function hn(n,r){if(1&n&&(e.TgZ(0,"td",63),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(4);e.xp6(1),e.Oqu(e.lcZ(2,1,e.xi3(3,3,t.infiniteList,"Tax")))}}function fn(n,r){if(1&n&&(e.TgZ(0,"td",63),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(4);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.infiniteList,"SurchargeAmount")),"")}}function xn(n,r){if(1&n&&(e.TgZ(0,"tfoot",65)(1,"tr",66),e._UZ(2,"td",67),e.TgZ(3,"td",68),e._uU(4),e.ALo(5,"number"),e.qZA(),e._UZ(6,"td",67)(7,"td",67),e.TgZ(8,"td",69),e._uU(9,"Total:"),e.qZA(),e.YNc(10,gn,4,6,"td",62),e.TgZ(11,"td",63),e._uU(12),e.ALo(13,"number"),e.ALo(14,"sum"),e.qZA(),e.YNc(15,hn,4,6,"td",62),e.YNc(16,fn,4,6,"td",62),e.TgZ(17,"td",63),e._uU(18),e.ALo(19,"number"),e.ALo(20,"sum"),e.qZA()()()),2&n){const t=e.oxw(3);e.xp6(4),e.hij("",e.lcZ(5,6,t.infiniteList.length)," Orders"),e.xp6(6),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(2),e.Oqu(e.lcZ(13,8,e.xi3(14,10,t.infiniteList,"Sales"))),e.xp6(3),e.Q6J("ngIf",t.data.TaxVisible),e.xp6(1),e.Q6J("ngIf",t.data.SurchargeVisible),e.xp6(2),e.Oqu(e.lcZ(19,13,e.xi3(20,15,t.infiniteList,"SalesNSurcharge")))}}function Tn(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",41)(1,"table",42),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",43)(3,"tr")(4,"th",44),e._uU(5,"OUTLET"),e.qZA(),e.TgZ(6,"th",45),e._uU(7,"NUMBER"),e.qZA(),e.TgZ(8,"th",46),e._uU(9,"DATE"),e.qZA(),e.TgZ(10,"th",47),e._uU(11,"CUSTOMER"),e.qZA(),e.TgZ(12,"th",48),e._uU(13,"SALES PERSON"),e.qZA(),e.YNc(14,nn,2,0,"th",49),e.TgZ(15,"th",50),e._uU(16,"SALES"),e.qZA(),e.YNc(17,on,2,0,"th",51),e.YNc(18,an,2,0,"th",52),e.TgZ(19,"th",53),e._uU(20,"TOTAL"),e.qZA(),e.TgZ(21,"th",54),e._uU(22,"PAYMENT"),e.qZA()()(),e.TgZ(23,"tbody"),e.YNc(24,mn,31,39,"tr",55),e.qZA(),e.YNc(25,xn,21,18,"tfoot",56),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(14),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(3),e.Q6J("ngIf",t.data.TaxVisible),e.xp6(1),e.Q6J("ngIf",t.data.SurchargeVisible),e.xp6(6),e.Q6J("ngForOf",t.infiniteList),e.xp6(1),e.Q6J("ngIf",t.data)}}function Cn(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",70),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.StoreRowsCountAPIResult("Report/ReportSummaryCount"))}),e.TgZ(1,"i",71),e._uU(2,"?"),e.qZA()()}}function Zn(n,r){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(e.lcZ(2,1,t.listTotal))}}function Dn(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",72),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.NextPage(!0))}),e._UZ(1,"i",73),e._uU(2," Next"),e.qZA()}}function vn(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",74),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.StoreRowsCountAPIResult("Report/ReportSummaryCount",!0))}),e._UZ(1,"i",75),e._uU(2," Last"),e.qZA()}}function bn(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e.TgZ(1,"actions"),e.YNc(2,Wt,3,0,"button",2),e.qZA(),e.TgZ(3,"filters")(4,"div",3),e.YNc(5,en,23,11,"div",4),e.YNc(6,tn,21,8,"div",5),e.qZA(),e.TgZ(7,"a",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.hideMore=!o.hideMore)}),e._uU(8),e._UZ(9,"i",7),e.qZA()(),e.TgZ(10,"content")(11,"div",8),e.YNc(12,Tn,26,5,"div",9),e.TgZ(13,"div",10)(14,"div",11)(15,"div",12),e._uU(16),e.ALo(17,"number"),e.YNc(18,Cn,3,0,"span",13),e.YNc(19,Zn,3,3,"span",14),e._uU(20),e.qZA()(),e.TgZ(21,"div",15),e.YNc(22,Dn,3,0,"a",16),e.YNc(23,vn,3,0,"a",17),e.qZA()()()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",t.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",t.pageData.Filter),e.xp6(1),e.Q6J("ngIf",!t.hideMore),e.xp6(2),e.hij("",t.hideMore?"More":"Less"," "),e.xp6(4),e.Q6J("ngIf",t.data),e.xp6(4),e.hij(" Showing 1 - ",e.lcZ(17,13,t.pageData.Filter.RowCount*(t.pageData.Filter.PageNumber-1)+t.data.TotalCurrentRow)," of "),e.xp6(2),e.Q6J("ngIf",!t.pageData.HideStoreApiCount),e.xp6(1),e.Q6J("ngIf",t.pageData.HideStoreApiCount),e.xp6(1),e.hij(" records ~ ",t.pageData.Filter.PageNumber," Page "),e.xp6(2),e.Q6J("ngIf",t.nextPageDisabled&&!t.goToLast),e.xp6(1),e.Q6J("ngIf",t.nextPageDisabled&&!t.goToLast)}}let yn=(()=>{class n extends ce.X{constructor(t,a,o,i,s,c,u){super(t,"Report/ReportSummary","ReportLoader/ReportSummary",null,i),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"datePipe",void 0),(0,l.Z)(this,"_matDialog",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"hideMore",!0),(0,l.Z)(this,"From",void 0),(0,l.Z)(this,"To",void 0),(0,l.Z)(this,"EntityID",void 0),(0,l.Z)(this,"CustomerID",void 0),(0,l.Z)(this,"timeTo",void 0),(0,l.Z)(this,"timeFrom",void 0),(0,l.Z)(this,"filterInvoiceBy",[{Key:!1,Value:"Posted"},{Key:!0,Value:"Created"}]),this.httpService=t,this.csvConverter=a,this.datePipe=o,this._matDialog=s,this.reportFilterService=c,this.roleService=u}preInitList(){this.oldRowCount=this.pageData.Filter.RowCount,this.route.snapshot.queryParams.EntityID||(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)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}openItemModal(t,a){this._matDialog.open(zt,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(i=>{i&&(this.pageData.Filter.ExportPageNumber=i.ExportPageNumber,this.pageData.Filter.ExportRowCount=i.ExportRowCount,this.exportCSV(this.csvConverter,t,a),this.pageData.Filter.RowCount=0)})}transformDate(t){return this.datePipe.transform(t,"ddMMyy")}sortData(t){const a=this.infiniteList.slice();this.infiniteList=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(o.CustomerName=null==o.CustomerName?"":o.CustomerName,i.CustomerName=null==i.CustomerName?"":i.CustomerName,o.SalesName=null==o.SalesName?"":o.SalesName,i.SalesName=null==i.SalesName?"":i.SalesName,t.active){case"outlet":return this.compare(o.EntityName.toLocaleLowerCase(),i.EntityName.toLocaleLowerCase(),s);case"number":return this.compare(o.Number,i.Number,s);case"date":return this.compare(o.Date,i.Date,s);case"customer":return this.compare(o.CustomerName.toLocaleLowerCase(),i.CustomerName.toLocaleLowerCase(),s);case"salesPerson":return this.compare(o.SalesName.toLocaleLowerCase(),i.SalesName.toLocaleLowerCase(),s);case"cost":return this.compare(o.Cost,i.Cost,s);case"sales":return this.compare(o.Sales,i.Sales,s);case"tax":return this.compare(o.Tax,i.Tax,s);case"surcharge":return this.compare(o.SurchargeAmount,i.SurchargeAmount,s);case"total":return this.compare(o.SalesNSurcharge,i.SalesNSurcharge,s);case"payment":return this.compare(o.PaymentStateString,i.PaymentStateString,s);default:return 0}}):a}openExportModal(){this._matDialog.open(M.H,{data:{title:"Sales Summary",exportTypes:[{ID:"ReportExport/ReportSummary",Value:"Default",FileName:"Sales Summary"},{ID:"ReportExport/ReportSummaryWithPayment",Value:"Payment",FileName:"Sales Summary with Payment"},{ID:"ReportExport/ReportSummaryWithMethod",Value:"Payment Method",FileName:"Sales Summary with Payment Method"},{ID:"ReportExport/ReportSummaryWithTaxDetail",Value:"Taxable & TaxExempt",FileName:"Sales Summary with Taxable & TaxExempt"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/ReportSummaryCount",pagination:!0}})}timeToChange(t){this.pageData.Filter.To=C.gT.setDateTime(t,this.pageData.Filter.To)}timeFromChange(t){this.pageData.Filter.From=C.gT.setDateTime(t,this.pageData.Filter.From)}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(p.uU),e.Y36(h.gz),e.Y36(y.uw),e.Y36(N.z),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["POS-sales-summary"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ms-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fa-solid","fa-caret-down"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load more for 500 variants",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["placeholder","Customer","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100",3,"ngModel","inputTextValue","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"selected","items","selectedChange"],[4,"ngIf","ngIfElse"],["DATEONLY",""],["name","Is Created",3,"options","model","modelChange"],[1,"w-100","d-flex","align-items-center","mt-2"],["name","From","appearance","outline",1,"timepicker",3,"date","dateChange"],[1,"ms-2"],[3,"time","timeChange"],[1,"w-100","d-flex","mt-4","align-items-center"],["name","To","appearance","outline",1,"timepicker",3,"date","dateChange"],["name","From",3,"date","appearance","width","dateChange"],[1,"mt-4"],["name","To",3,"date","appearance","width","dateChange"],["id","more-filter","container","",1,"ms-6"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModel","items","ngModelChange"],["requestUrl","/API/AC/GetUserSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["name","RowCount",1,"w-100",3,"ngModel","ngModelChange"],[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"],["mat-sort-header","customer"],["mat-sort-header","salesPerson"],["mat-sort-header","cost","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","sales","arrowPosition","before",1,"flex-right"],["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",1,"flex-right"],["mat-sort-header","payment",2,"width","50px"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","tax","arrowPosition","before",1,"flex-right"],["mat-sort-header","surcharge","arrowPosition","before",1,"flex-right"],["target","_blank",3,"routerLink","queryParams"],[3,"routerLink","queryParams"],["class","text-end",4,"ngIf"],[1,"text-end"],[1,"text-start",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],[1,"text-start","empty-column"],[1,"text-end","empty-column"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load more for 500 variants",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(t,a){1&t&&e.YNc(0,bn,24,15,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.mk,p.sg,p.O5,h.rH,m.w9,A.QB,d.Fj,d.JJ,d.On,x.gM,f.YE,f.nU,q.P,E.J,j.R,ge.E,S.qU,p.JJ,p.uU],styles:["datepicker.timepicker>mat-form-field{width:140px!important}"]})),n})();var D=g(4077);function Sn(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",8),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",9),e._uU(2," Export"),e.qZA()}}function An(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",10)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",11),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"From - To"),e.qZA(),e.TgZ(8,"datepicker",12),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA(),e.TgZ(9,"div",13)(10,"datepicker",14),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function wn(n,r){1&n&&(e.TgZ(0,"th",24),e._uU(1,"Code"),e.qZA())}function Fn(n,r){if(1&n&&(e.TgZ(0,"td"),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(t.Code)}}const Mn=function(){return["/menu/Products/Setup/Brand/Brand_Form"]},qn=function(n){return{ID:n}},In=function(n,r){return{BrandID:n,Name:r}};function Pn(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td")(2,"a",25),e._uU(3),e.qZA()(),e.YNc(4,Fn,2,1,"td",26),e.TgZ(5,"td",27)(6,"a",28),e._uU(7),e.ALo(8,"number"),e.qZA()(),e.TgZ(9,"td",27),e._uU(10),e.ALo(11,"number"),e.qZA()()),2&n){const t=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(11,Mn))("queryParams",e.VKq(12,qn,t.ID)),e.xp6(1),e.hij("",t.BrandName," "),e.xp6(1),e.Q6J("ngIf",t.Countcode>0),e.xp6(2),e.Q6J("queryParams",e.WLB(14,In,t.ID,t.BrandName)),e.xp6(1),e.Oqu(e.lcZ(8,7,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(11,9,t.Total))}}function On(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",15)(1,"table",16),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",17)(3,"tr")(4,"th",18),e._uU(5,"Brand"),e.qZA(),e.YNc(6,wn,2,0,"th",19),e.TgZ(7,"th",20),e._uU(8,"Sold"),e.qZA(),e.TgZ(9,"th",21),e._uU(10,"Total"),e.qZA()()(),e.TgZ(11,"tbody"),e.YNc(12,Pn,12,17,"tr",22),e.qZA(),e.TgZ(13,"tfoot")(14,"tr",23)(15,"td"),e._uU(16,"Total"),e.qZA(),e.TgZ(17,"td"),e._uU(18),e.ALo(19,"number"),e.ALo(20,"sum"),e.qZA(),e.TgZ(21,"td"),e._uU(22),e.ALo(23,"number"),e.ALo(24,"sum"),e.qZA()()()()()}if(2&n){const t=e.oxw();e.xp6(6),e.Q6J("ngIf",t.data.Countcode>0),e.xp6(6),e.Q6J("ngForOf",t.data.Data),e.xp6(6),e.Oqu(e.lcZ(19,4,e.xi3(20,6,t.data.Data,"Quantity"))),e.xp6(4),e.Oqu(e.lcZ(23,9,e.xi3(24,11,t.data.Data,"Total")))}}const Jn=function(){return["/menu/Reports/Sales_Report/Standard/Top_Brand/Top_Brand_Chart"]},Un=function(){return["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"]};let Qn=(()=>{class n extends D.n{constructor(t,a,o,i,s,c){super(t,"Report/BrandRank","ReportLoader/BrandRank",null,o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),this.httpService=t,this.csvConverter=a,this.reportFilterService=i,this.roleService=s,this.matDialog=c}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"Brand":return this.compare(o.BrandName,i.BrandName,s);case"Code":return this.compare(o.Code,i.Code,s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);case"Total":return this.compare(o.Total,i.Total,s);default:return 0}}):a}openExportModal(){this.matDialog.open(M.H,{data:{title:"Top Brand",exportTypes:[{ID:"ReportExport/BrandRank",Value:"Default",FileName:"Top Brand"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(h.gz),e.Y36(N.z),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["POS-Top-Brand"]],features:[e.qOj],decls:13,vars:9,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","me-6",3,"routerLink"],[1,"fa-solid","fa-chart-area","me-2"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Brand",2,"width","150px"],["style","width: 120px;","mat-sort-header","Code","arrowPosition","before","class","align-left",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"footer","text-end","fw-bold"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],[3,"routerLink","queryParams"],[4,"ngIf"],[1,"text-end"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,Sn,3,0,"button",1),e.TgZ(3,"a",2),e._UZ(4,"i",3),e._uU(5,"Chart View "),e.qZA(),e.TgZ(6,"a",4),e._uU(7," Brand Sales Analysis "),e.qZA()(),e.TgZ(8,"filters")(9,"div",5),e.YNc(10,An,11,5,"div",6),e.qZA()(),e.TgZ(11,"content"),e.YNc(12,On,25,14,"div",7),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(7,Jn)),e.xp6(3),e.Q6J("routerLink",e.DdM(8,Un)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,f.YE,f.nU,S.qU,p.JJ],encapsulation:2})),n})();function kn(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"label",3),e.NdJ("click",function(){const i=e.CHM(t).$implicit,s=e.oxw();return e.KtG(s.updateSelectedGroups(i.ID))}),e._UZ(1,"input",4),e.TgZ(2,"span"),e._uU(3),e.qZA()()}if(2&n){const t=r.$implicit,a=e.oxw();e.xp6(1),e.Q6J("value",t.ID)("checked",a.IDGroups.indexOf(t.ID)>-1),e.xp6(2),e.Oqu(t.Name)}}let En=(()=>{class n{constructor(t,a){(0,l.Z)(this,"dialogRef",void 0),(0,l.Z)(this,"data",void 0),(0,l.Z)(this,"options",void 0),(0,l.Z)(this,"model",void 0),(0,l.Z)(this,"IDGroups",[]),this.dialogRef=t,this.data=a,this.options=a.options,this.model=a.model,this.model.forEach(o=>{this.IDGroups.push(o.GroupID)})}ngOnInit(){}updateSelectedGroups(t){const a=this.IDGroups.indexOf(t);a>-1?this.IDGroups.splice(a,1):this.IDGroups.push(t)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(y.so),e.Y36(y.WI))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["POS-modal-edit-group"]],decls:4,vars:2,consts:[[3,"title","onOk","onCancel"],[1,"container-fluid","pt-6"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],["type","checkbox",3,"value","checked"]],template:function(t,a){1&t&&(e.TgZ(0,"modal-material",0),e.NdJ("onOk",function(){return a.onOk()})("onCancel",function(){return a.dialogRef.close()}),e.TgZ(1,"content")(2,"div",1),e.YNc(3,kn,4,3,"label",2),e.qZA()()()),2&t&&(e.Q6J("title","Edit Groups"),e.xp6(3),e.Q6J("ngForOf",a.options))},dependencies:[p.sg,X.M],styles:["label[_ngcontent-%COMP%]{display:block}label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:14px}"]})),n})();function Yn(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",11),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",12),e._uU(2," Export"),e.qZA()}}function Rn(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",13)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",14),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Group"),e.qZA(),e.TgZ(8,"ng-select",15),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.GroupID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"From - To"),e.qZA(),e.TgZ(12,"div")(13,"datepicker",16),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(14,"div",17)(15,"datepicker",18),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Row Count"),e.qZA(),e.TgZ(19,"input",19),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.RowCount=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.GroupID)("items",null==t.pageData.Options?null:t.pageData.Options.Groups),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.RowCount)}}function Gn(n,r){1&n&&(e.ynx(0),e.TgZ(1,"th",33),e._uU(2,"COST"),e.qZA(),e.BQk())}function Hn(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span")(1,"span"),e._uU(2),e.qZA(),e.TgZ(3,"a",40),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2).$implicit,i=e.oxw(3);return e.KtG(i.showModalEditGroup(o.Groups,o.CustomerID))}),e._uU(4),e.qZA()()}if(2&n){const t=r.$implicit,a=r.index;e.xp6(2),e.Oqu(0==a?"":" , "),e.xp6(2),e.Oqu(t.GroupName)}}function Vn(n,r){if(1&n&&(e.TgZ(0,"span"),e.YNc(1,Hn,5,2,"span",35),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.Groups)}}function Bn(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",40),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,i=e.oxw(3);return e.KtG(i.showModalEditGroup(o.Groups,o.CustomerID))}),e._uU(1," No group assigned "),e.qZA()}}function Kn(n,r){if(1&n&&(e.ynx(0),e.TgZ(1,"td",39),e._uU(2),e.ALo(3,"number"),e.qZA(),e.BQk()),2&n){const t=e.oxw().$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.Cost))}}const jn=function(){return["/menu/Contacts/Contact/Customers/Info"]},zn=function(n){return{ID:n}};function Wn(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td")(2,"a",36),e._uU(3),e.qZA()(),e.TgZ(4,"td",37),e.YNc(5,Vn,2,1,"span",28),e.YNc(6,Bn,2,0,"a",38),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td",39),e._uU(10),e.ALo(11,"number"),e.qZA(),e.TgZ(12,"td",39),e._uU(13),e.ALo(14,"number"),e.qZA(),e.YNc(15,Kn,4,3,"ng-container",28),e.TgZ(16,"td",39),e._uU(17),e.ALo(18,"number"),e.qZA(),e.TgZ(19,"td",39),e._uU(20),e.ALo(21,"number"),e.qZA(),e.TgZ(22,"td",39),e._uU(23),e.ALo(24,"number"),e.qZA()()),2&n){const t=r.$implicit,a=e.oxw(3);e.xp6(2),e.Q6J("routerLink",e.DdM(22,jn))("queryParams",e.VKq(23,zn,t.CustomerID)),e.xp6(1),e.hij(" ",t.Name+" "+(t.Title?t.Title:"")," "),e.xp6(2),e.Q6J("ngIf",t.Groups.length>0),e.xp6(1),e.Q6J("ngIf",!(t.Groups.length>0)),e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(11,12,t.Orders)),e.xp6(3),e.Oqu(e.lcZ(14,14,t.Quantity)),e.xp6(2),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(2),e.Oqu(e.lcZ(18,16,t.Sales)),e.xp6(3),e.Oqu(e.lcZ(21,18,t.Tax)),e.xp6(3),e.Oqu(e.lcZ(24,20,t.Sales+t.Tax))}}function $n(n,r){if(1&n&&(e.TgZ(0,"tbody",34),e.YNc(1,Wn,25,25,"tr",35),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.data.Data)}}function Xn(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",20)(1,"div",21)(2,"table",22),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(3,"thead",23)(4,"tr")(5,"th",24),e._uU(6,"CUSTOMER"),e.qZA(),e.TgZ(7,"th"),e._uU(8,"GROUPS"),e.qZA(),e.TgZ(9,"th",25),e._uU(10,"CODE"),e.qZA(),e.TgZ(11,"th",26),e._uU(12,"ORDERS"),e.qZA(),e.TgZ(13,"th",27),e._uU(14,"QTY"),e.qZA(),e.YNc(15,Gn,3,0,"ng-container",28),e.TgZ(16,"th",29),e._uU(17,"SALES"),e.qZA(),e.TgZ(18,"th",30),e._uU(19,"TAX"),e.qZA(),e.TgZ(20,"th",31),e._uU(21,"SALES + TAX"),e.qZA()()(),e.YNc(22,$n,2,1,"tbody",32),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(15),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(7),e.Q6J("ngIf",t.data.Data)}}const to=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"]},oo=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"]},io=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Suppliers"]};let ro=(()=>{class n extends D.n{constructor(t,a,o,i,s,c){super(t,"Report/CustomerRank","ReportLoader/CustomerRank"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"datePipe",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),this.httpService=t,this.csvConverter=a,this.datePipe=o,this.matDialog=i,this.reportFilterService=s,this.roleService=c}postInit(t){this.menuData.H=t.PageTitle}preInitList(){C.gT.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)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData?.Filter?.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"Name":return this.compare(o.Name,i.Name,s);case"Code":return this.compare(o.Code,i.Code,s);case"Orders":return this.compare(o.Orders,i.Orders,s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);case"Sales":return this.compare(o.Sales,i.Sales,s);case"Tax":return this.compare(o.Tax,i.Tax,s);case"SalesNTax":return this.compare(o.Sales+o.Tax,i.Sales+i.Tax,s);case"Cost":return this.compare(o.Cost,i.Cost,s);default:return 0}}):a}transformDate(t){return this.datePipe.transform(t,"dd_MMM_yyyy")}showModalEditGroup(t,a){this.matDialog.open(En,{data:{options:this.pageData.Options.Groups,model:t}}).afterClosed().subscribe(i=>{i&&this.httpService.post("/API/Report/UpdateContactGroups",JSON.stringify({ContactID:a,GroupIDs:i.groupIDs})).subscribe(()=>{this.getListData()})})}openExportModal(){const t=`[${this.transformDate(this.pageData.Filter.From)} - ${this.transformDate(this.pageData.Filter.To)}]`;this.matDialog.open(M.H,{data:{title:"Top Customers",exportTypes:[{ID:"ReportExport/CustomerRank",Value:"Default",FileName:"Top Customer "+t}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(p.uU),e.Y36(y.uw),e.Y36(N.z),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["POS-Top-Customers"]],features:[e.qOj],decls:19,vars:11,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a group",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["type","text","autoNum","",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",2,"width","280px"],["mat-sort-header","Code","arrowPosition","before",1,"align-left",2,"width","120px"],["mat-sort-header","Orders","arrowPosition","before",1,"align-left",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-left",2,"width","75px"],[4,"ngIf"],["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"],["class","border-bottom",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left",2,"width","135px"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"pointer"],["class","text-primary",3,"click",4,"ngIf"],[1,"text-end"],[1,"text-primary",3,"click"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,Yn,3,0,"button",1),e.TgZ(3,"div",2)(4,"a",3),e._uU(5,"Top Customers By Age"),e.qZA(),e._UZ(6,"button",4),e.TgZ(7,"ul",5)(8,"li",6)(9,"a",7),e._uU(10,"Top Customers By Gender"),e.qZA()(),e.TgZ(11,"li",6)(12,"a",7),e._uU(13,"Top Supplier"),e.qZA()()()()(),e.TgZ(14,"filters")(15,"div",8),e.YNc(16,Rn,20,8,"div",9),e.qZA()(),e.TgZ(17,"content"),e.YNc(18,Xn,23,2,"div",10),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(2),e.Q6J("routerLink",e.DdM(8,to)),e.xp6(5),e.Q6J("routerLink",e.DdM(9,oo)),e.xp6(3),e.Q6J("routerLink",e.DdM(10,io)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.Fj,d.JJ,d.On,f.YE,f.nU,U.b,p.JJ],encapsulation:2})),n})();function lo(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",11),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",12),e._uU(2," Export "),e.qZA()}}function so(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",13)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",14),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Group"),e.qZA(),e.TgZ(8,"ng-select",15),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.GroupID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"From - To"),e.qZA(),e.TgZ(12,"div")(13,"datepicker",16),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(14,"div",17)(15,"datepicker",18),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Row Count"),e.qZA(),e.TgZ(19,"input",19),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.RowCount=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.GroupID)("items",null==t.pageData.Options?null:t.pageData.Options.Groups),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.RowCount)}}function po(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td",30),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td",30),e._uU(7),e.ALo(8,"number"),e.qZA(),e.TgZ(9,"td",31),e._uU(10),e.ALo(11,"number"),e.qZA()()),2&n){const t=r.$implicit;e.xp6(2),e.hij(" ",t.Name," "),e.xp6(2),e.Oqu(e.lcZ(5,4,t.TotalOrders)),e.xp6(3),e.Oqu(e.lcZ(8,6,t.TotalQuantity)),e.xp6(3),e.Oqu(e.lcZ(11,8,t.TotalAmount))}}function co(n,r){if(1&n&&(e.TgZ(0,"tbody",28),e.YNc(1,po,12,10,"tr",29),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.data.Data)}}function uo(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",20)(1,"table",21),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",22)(3,"tr")(4,"th",23),e._uU(5,"AGE"),e.qZA(),e.TgZ(6,"th",24),e._uU(7,"ORDERS"),e.qZA(),e.TgZ(8,"th",25),e._uU(9,"QUANTITY"),e.qZA(),e.TgZ(10,"th",26),e._uU(11,"AMOUNT"),e.qZA()()(),e.YNc(12,co,2,1,"tbody",27),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(12),e.Q6J("ngIf",t.data.Data)}}const _o=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers"]},go=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"]},fo=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Suppliers"]};let xo=(()=>{class n extends D.n{constructor(t,a,o,i,s,c){super(t,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"datePipe",void 0),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.reportFilterService=s,this.datePipe=c}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){C.gT.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)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"Age":return this.compare(o.Name,i.Name,s);case"Orders":return this.compare(o.TotalOrders,i.TotalOrders,s);case"Quantity":return this.compare(o.TotalQuantity,i.TotalQuantity,s);case"Total":return this.compare(o.TotalAmount,i.TotalAmount,s);default:return 0}}):a}transformDate(t){return this.datePipe.transform(t,"dd_MMM_yyyy")}openExportModal(){this.matDialog.open(M.H,{data:{title:"Top age customer",exportTypes:[{ID:"ReportExport/CustomerAgeRank",Value:"Default",FileName:"Top age customer"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw),e.Y36(N.z),e.Y36(p.uU))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["POS-top-customers-by-age"]],features:[e.qOj],decls:19,vars:11,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a group",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["type","text","autoNum","",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Age",2,"width","280px"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","75px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","135px"],["class","border-bottom",4,"ngIf"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[1,"text-end"],[1,"text-end","text-success"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,lo,3,0,"a",1),e.TgZ(3,"div",2)(4,"a",3),e._uU(5,"Top Customers"),e.qZA(),e._UZ(6,"button",4),e.TgZ(7,"ul",5)(8,"li",6)(9,"a",7),e._uU(10,"Top Customers By Gender"),e.qZA()(),e.TgZ(11,"li",6)(12,"a",7),e._uU(13,"Top Supplier"),e.qZA()()()()(),e.TgZ(14,"filters")(15,"div",8),e.YNc(16,so,20,8,"div",9),e.qZA()(),e.TgZ(17,"content"),e.YNc(18,uo,13,1,"div",10),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(2),e.Q6J("routerLink",e.DdM(8,_o)),e.xp6(5),e.Q6J("routerLink",e.DdM(9,go)),e.xp6(3),e.Q6J("routerLink",e.DdM(10,fo)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.Fj,d.JJ,d.On,f.YE,f.nU,U.b,p.JJ]})),n})();function To(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",11),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",12),e._uU(2," Export "),e.qZA()}}function Co(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",13)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",14),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Group"),e.qZA(),e.TgZ(8,"ng-select",15),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.GroupID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"From - To"),e.qZA(),e.TgZ(12,"div")(13,"datepicker",16),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(14,"div",17)(15,"datepicker",18),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Row Count"),e.qZA(),e.TgZ(19,"input",19),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.RowCount=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.GroupID)("items",null==t.pageData.Options?null:t.pageData.Options.Groups),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.RowCount)}}function Zo(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td",29),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td",29),e._uU(7),e.ALo(8,"number"),e.qZA(),e.TgZ(9,"td",30),e._uU(10),e.ALo(11,"number"),e.qZA()()),2&n){const t=r.$implicit;e.xp6(2),e.hij(" ",t.Name," "),e.xp6(2),e.Oqu(e.lcZ(5,4,t.TotalOrders)),e.xp6(3),e.Oqu(e.lcZ(8,6,t.TotalQuantity)),e.xp6(3),e.Oqu(e.lcZ(11,8,t.TotalAmount))}}function Do(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",20)(1,"table",21),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",22)(3,"tr")(4,"th",23),e._uU(5,"GENDER"),e.qZA(),e.TgZ(6,"th",24),e._uU(7,"ORDERS"),e.qZA(),e.TgZ(8,"th",25),e._uU(9,"QUANTITY"),e.qZA(),e.TgZ(10,"th",26),e._uU(11,"AMOUNT"),e.qZA()()(),e.TgZ(12,"tbody",27),e.YNc(13,Zo,12,10,"tr",28),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(13),e.Q6J("ngForOf",null==t.data?null:t.data.Data)}}const vo=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers"]},yo=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"]},Ao=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Suppliers"]};let wo=(()=>{class n extends D.n{constructor(t,a,o,i,s,c){super(t,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"datePipe",void 0),(0,l.Z)(this,"header",{0:"GENDER",1:"ORDERS",2:"QUANTITY",3:"AMOUNT"}),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.reportFilterService=s,this.datePipe=c}postInit(t){this.menuData.H=t.PageTitle}preInitList(){C.gT.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)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}transformDate(t){return this.datePipe.transform(t,"dd_MMM_yyyy")}sortData(t){const a=this.data.slice();this.data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"Gender":return this.compare(o.Name,i.Name,s);case"Orders":return this.compare(o.TotalOrders,i.TotalOrders,s);case"Quantity":return this.compare(o.TotalQuantity,i.TotalQuantity,s);case"Total":return this.compare(o.TotalAmount,i.TotalAmount,s);default:return 0}}):a}openExportModal(){this.matDialog.open(M.H,{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}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw),e.Y36(N.z),e.Y36(p.uU))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["POS-top-customers-by-gender"]],features:[e.qOj],decls:19,vars:11,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a group",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["type","text","autoNum","",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Gender",2,"width","280px"],["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"],[4,"ngFor","ngForOf"],[1,"text-end"],[1,"text-end","text-success"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,To,3,0,"a",1),e.TgZ(3,"div",2)(4,"a",3),e._uU(5,"Top Customers"),e.qZA(),e._UZ(6,"button",4),e.TgZ(7,"ul",5)(8,"li",6)(9,"a",7),e._uU(10,"Top Customers By Age"),e.qZA()(),e.TgZ(11,"li",6)(12,"a",7),e._uU(13,"Top Supplier"),e.qZA()()()()(),e.TgZ(14,"filters")(15,"div",8),e.YNc(16,Co,20,8,"div",9),e.qZA()(),e.TgZ(17,"content"),e.YNc(18,Do,14,1,"div",10),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(2),e.Q6J("routerLink",e.DdM(8,vo)),e.xp6(5),e.Q6J("routerLink",e.DdM(9,yo)),e.xp6(3),e.Q6J("routerLink",e.DdM(10,Ao)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.Fj,d.JJ,d.On,f.YE,f.nU,U.b,p.JJ]})),n})();function Fo(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",11),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",12),e._uU(2," Export "),e.qZA()}}function Mo(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",13)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",14),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Group"),e.qZA(),e.TgZ(8,"ng-select",15),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.GroupID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"From - To"),e.qZA(),e.TgZ(12,"div")(13,"datepicker",16),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(14,"div",17)(15,"datepicker",18),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Row Count"),e.qZA(),e.TgZ(19,"input",19),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.RowCount=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.GroupID)("items",null==t.pageData.Options?null:t.pageData.Options.Group),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.RowCount)}}const qo=function(){return["/menu/Contacts/Contact/Suppliers/Info"]},Io=function(n){return{ID:n}},Po=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]},Oo=function(n,r,t){return{From:n,SupplierID:r,To:t}};function No(n,r){if(1&n&&(e.TgZ(0,"tr",33)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td",34)(4,"a",35),e._uU(5),e.qZA()(),e.TgZ(6,"td",32),e._uU(7),e.qZA(),e.TgZ(8,"td",36),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td",32)(12,"a",35),e.ALo(13,"date"),e.ALo(14,"date"),e._uU(15),e.ALo(16,"number"),e.qZA()()()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.Rank),e.xp6(2),e.Q6J("routerLink",e.DdM(20,qo))("queryParams",e.VKq(21,Io,t.SupplierID)),e.xp6(1),e.Oqu(t.Name),e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(10,9,t.Quantity)),e.xp6(3),e.Q6J("routerLink",e.DdM(23,Po))("queryParams",e.kEZ(24,Oo,e.xi3(13,11,a.pageData.Filter.From,"yyyy-MM-dd"),t.SupplierID,e.xi3(14,14,a.pageData.Filter.To,"yyyy-MM-dd"))),e.xp6(3),e.hij(" ",e.xi3(16,17,t.Total,".0-0"),"")}}function Jo(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",20)(1,"table",21),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",22)(3,"tr")(4,"th",23),e._uU(5,"RANK"),e.qZA(),e.TgZ(6,"th",24),e._uU(7,"SUPPLIER"),e.qZA(),e.TgZ(8,"th",25),e._uU(9,"CODE"),e.qZA(),e.TgZ(10,"th",26),e._uU(11,"QUANTITY"),e.qZA(),e.TgZ(12,"th",27),e._uU(13,"TOTAL"),e.qZA()()(),e.TgZ(14,"tbody"),e.YNc(15,No,17,28,"tr",28),e.qZA()(),e.TgZ(16,"div",29)(17,"table",30)(18,"thead",22)(19,"tr",31)(20,"th",32),e._uU(21,"Total Quantity"),e.qZA(),e.TgZ(22,"th",32),e._uU(23,"Total Sales"),e.qZA()()(),e.TgZ(24,"tbody")(25,"tr")(26,"td"),e._uU(27),e.qZA(),e.TgZ(28,"td"),e._uU(29),e.qZA()()()()()()}if(2&n){const t=e.oxw();e.xp6(15),e.Q6J("ngForOf",t.data.Data),e.xp6(12),e.Oqu(t.data.TotalQty),e.xp6(2),e.Oqu(t.data.TotalSales)}}const Lo=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers"]},Qo=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"]},Eo=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"]};let Yo=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"reportFilterService",void 0),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.reportFilterService=s}postInit(t){this.menuData.H=t.PageTitle}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"Rank":return this.compare(o.Rank,i.Rank,s);case"Supplier":return this.compare(o.Name,i.Name,s);case"Code":return this.compare(o.Code,i.Code,s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);case"Total":return this.compare(o.Total,i.Total,s);default:return 0}}):a}openExportModal(){this.matDialog.open(M.H,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopSalesExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw),e.Y36(N.z))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["POS-top-suppliers"]],features:[e.qOj],decls:19,vars:11,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a group",3,"ngModel","items","ngModelChange"],["name","From","appearance","outline",3,"date","dateChange"],[1,"mt-4"],["name","To","appearance","outline",3,"date","dateChange"],["type","text","autoNum","",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-end"],[1,"table","w-auto"],[1,"header"],[1,"text-end"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end","text-success"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,Fo,3,0,"a",1),e.TgZ(3,"div",2)(4,"a",3),e._uU(5,"Top Customers"),e.qZA(),e._UZ(6,"button",4),e.TgZ(7,"ul",5)(8,"li",6)(9,"a",7),e._uU(10,"Top Customers By Gender"),e.qZA()(),e.TgZ(11,"li",6)(12,"a",7),e._uU(13,"Top Customers By Age"),e.qZA()()()()(),e.TgZ(14,"filters")(15,"div",8),e.YNc(16,Mo,20,8,"div",9),e.qZA()(),e.TgZ(17,"content"),e.YNc(18,Jo,30,3,"div",10),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(2),e.Q6J("routerLink",e.DdM(8,Lo)),e.xp6(5),e.Q6J("routerLink",e.DdM(9,Qo)),e.xp6(3),e.Q6J("routerLink",e.DdM(10,Eo)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.Fj,d.JJ,d.On,f.YE,f.nU,U.b,p.JJ,p.uU]})),n})();var Ro=g(15861),Go=g(96700);function Ho(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.updateMinstock())}),e._uU(1,"Update Variant Min Stock"),e.qZA()}}function Vo(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",38),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.openExportModal())}),e._UZ(1,"i",39),e._uU(2," Export"),e.qZA()}}function Bo(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",40)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",41),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onFilterOutlets())})("change",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.resetListId())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",42),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.CategoryID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"From - To"),e.qZA(),e.TgZ(12,"div")(13,"datepicker",43),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(14,"div",44)(15,"datepicker",45),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onFilterToDate())}),e.qZA()()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Sales"),e.qZA(),e.TgZ(19,"ng-select-infinite",46),e.NdJ("selectedChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.SalesID=o)}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"Scope"),e.qZA(),e.TgZ(23,"radio-options",47),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.GroupByVariant=o)})("modelChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.getListData())}),e.qZA()()()}if(2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(5),e.Q6J("date",t.pageData.Filter.From)("showClearBtn",!0)("showTodayBtn",!0),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)("showClearBtn",!0)("showTodayBtn",!0),e.xp6(4),e.Q6J("selected",t.pageData.Filter.SalesID)("items",null==t.pageData.Options?null:t.pageData.Options.Sales),e.xp6(4),e.Q6J("model",t.pageData.Filter.GroupByVariant)("options",t.ScopeFilter)}}function Ko(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",48)(1,"div")(2,"h6"),e._uU(3,"Sales Order Type"),e.qZA(),e.TgZ(4,"ng-select",49),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Logistics Service"),e.qZA(),e.TgZ(8,"ng-select",49),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.LogisticsServiceID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Supplier"),e.qZA(),e.TgZ(12,"autocompleteV2",50),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.SupplierID=o)}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Brand"),e.qZA(),e.TgZ(16,"autocompleteV2",51),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.BrandID=o)}),e.qZA()(),e.TgZ(17,"div")(18,"h6"),e._uU(19,"Group"),e.qZA(),e.TgZ(20,"ng-select",52),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ContactGroupID=o)}),e.qZA()(),e.TgZ(21,"div")(22,"h6"),e._uU(23,"Customer"),e.qZA(),e.TgZ(24,"autocompleteV2",53),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.CustomerID=o)}),e.qZA()(),e.TgZ(25,"div")(26,"h6"),e._uU(27,"Complementary"),e.qZA(),e.TgZ(28,"radio-options",54),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.IncludeComplementary=o)}),e.qZA()(),e.TgZ(29,"div")(30,"h6"),e._uU(31,"Exclude Non Inventory"),e.qZA(),e.TgZ(32,"radio-options",54),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ExcludeInventory=o)}),e.qZA()(),e.TgZ(33,"div")(34,"h6"),e._uU(35,"Show Inventory"),e.qZA(),e.TgZ(36,"radio-options",55),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ShowInventory=o)})("modelChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.getListData())}),e.qZA()()()}if(2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Options?null:t.pageData.Options.Types),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.LogisticsServiceID)("items",null==t.pageData.Options?null:t.pageData.Options.ServicesLogistics),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.SupplierID)("inputTextValue",t.pageData.supplierName),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.BrandID)("inputTextValue",t.brandName),e.xp6(4),e.Q6J("items",t.pageData.Options.ContactGroups)("ngModel",t.pageData.Filter.ContactGroupID),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CustomerID),e.xp6(4),e.Q6J("model",t.pageData.Filter.IncludeComplementary),e.xp6(4),e.Q6J("model",t.pageData.Filter.ExcludeInventory),e.xp6(4),e.Q6J("model",t.pageData.Filter.ShowInventory)}}function jo(n,r){1&n&&(e.TgZ(0,"th",56),e._uU(1,"COST"),e.qZA())}function zo(n,r){1&n&&(e.TgZ(0,"th",57),e._uU(1,"INVENTORY "),e.qZA())}function Wo(n,r){1&n&&(e.TgZ(0,"th",58),e._uU(1,"Buffer Stock"),e.qZA())}function $o(n,r){1&n&&(e.TgZ(0,"th",59),e._uU(1,"UPDATE ROP"),e.qZA())}function Xo(n,r){1&n&&(e.TgZ(0,"th",60),e._uU(1,"PROFIT"),e.qZA())}function ea(n,r){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"img",70),e.NdJ("click",function(o){e.CHM(t);const i=e.oxw().$implicit,s=e.oxw(2);return e.KtG(s.openBigPicture(i,o))}),e.qZA(),e.BQk()}if(2&n){const t=e.oxw().$implicit;e.xp6(1),e.s9C("src",t.ThumbnailUrl,e.LSH)}}function ta(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",71)(1,"img",72),e.NdJ("click",function(o){e.CHM(t);const i=e.oxw().$implicit,s=e.oxw(2);return e.KtG(s.openBigPicture(i,o))}),e.qZA()()}if(2&n){const t=e.oxw(3);e.Q6J("target",t.pageData.LinkTarget),e.xp6(1),e.Q6J("src","//res.cloudinary.com/pos/image/upload/w_"+(null==t.data?null:t.data.ThumbnailWidth)+"/POS/Images/Icon/products_thumb.png",e.LSH)}}function na(n,r){if(1&n&&(e.TgZ(0,"td",66),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij("",e.lcZ(2,1,t.UnitCost)," ")}}const Me=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"]},aa=function(n,r,t){return{VariantID:n,From:r,To:t}};function ia(n,r){if(1&n&&(e.TgZ(0,"a",65),e.ALo(1,"date"),e.ALo(2,"date"),e._uU(3),e.ALo(4,"number"),e.qZA()),2&n){const t=e.oxw().$implicit,a=e.oxw(2);e.Q6J("routerLink",e.DdM(11,Me))("queryParams",e.kEZ(12,aa,t.ID,e.xi3(1,3,a.pageData.Filter.From,"ddMMyyyy"),e.xi3(2,6,a.pageData.Filter.To,"ddMMyyyy"))),e.xp6(3),e.Oqu(e.lcZ(4,9,t.Total))}}const ra=function(n,r,t){return{ProductID:n,From:r,To:t}};function la(n,r){if(1&n&&(e.TgZ(0,"a",65),e.ALo(1,"date"),e.ALo(2,"date"),e._uU(3),e.ALo(4,"number"),e.qZA()),2&n){const t=e.oxw().$implicit,a=e.oxw(2);e.Q6J("routerLink",e.DdM(11,Me))("queryParams",e.kEZ(12,ra,t.ID,e.xi3(1,3,a.pageData.Filter.From,"ddMMyyyy"),e.xi3(2,6,a.pageData.Filter.To,"ddMMyyyy"))),e.xp6(3),e.Oqu(e.lcZ(4,9,t.Total))}}function sa(n,r){if(1&n&&(e.TgZ(0,"td",66),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.UnitsInStock?t.UnitsInStock:0)," ")}}function pa(n,r){if(1&n&&(e.TgZ(0,"td",66),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.MinStock),"")}}function ca(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"td",66)(1,"input",73),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw().$implicit;return e.KtG(i.NewMinStock=o)}),e.qZA()()}if(2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngModel",t.NewMinStock)}}function da(n,r){if(1&n&&(e.TgZ(0,"td",74),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.Q6J("ngClass",t.Profit>=0?"text-success":"text-danger"),e.xp6(1),e.hij(" ",e.lcZ(2,2,t.Profit)," ")}}const ua=function(n){return[n]},_a=function(n){return{ID:n}};function ma(n,r){if(1&n&&(e.TgZ(0,"tr",61)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"div",62)(5,"div",63),e.YNc(6,ea,2,1,"ng-container",31),e.YNc(7,ta,2,2,"a",64),e.qZA(),e.TgZ(8,"a",65),e._uU(9),e.qZA()()(),e.TgZ(10,"td"),e._uU(11),e.qZA(),e.TgZ(12,"td",66),e._uU(13),e.ALo(14,"number"),e.qZA(),e.YNc(15,na,3,3,"td",67),e.TgZ(16,"td",66),e.YNc(17,ia,5,16,"a",68),e.YNc(18,la,5,16,"a",68),e.qZA(),e.YNc(19,sa,3,3,"td",67),e.YNc(20,pa,3,3,"td",67),e.YNc(21,ca,2,1,"td",67),e.YNc(22,da,3,4,"td",69),e.qZA()),2&n){const t=r.$implicit,a=r.index,o=e.oxw(2);e.xp6(2),e.Oqu(a+1),e.xp6(4),e.Q6J("ngIf",t.ImageUrl),e.xp6(1),e.Q6J("ngIf",!t.ImageUrl),e.xp6(1),e.Q6J("routerLink",e.VKq(17,ua,1==o.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",e.VKq(19,_a,t.ID)),e.xp6(1),e.Oqu(t.Name),e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(14,15,t.Quantity)),e.xp6(2),e.Q6J("ngIf",o.roleService.product.Cost),e.xp6(2),e.Q6J("ngIf",o.pageData.Filter.GroupByVariant),e.xp6(1),e.Q6J("ngIf",!o.pageData.Filter.GroupByVariant),e.xp6(1),e.Q6J("ngIf",o.pageData.Filter.ShowInventory),e.xp6(1),e.Q6J("ngIf",o.data.MinVisible&&o.pageData.Filter.ShowInventory),e.xp6(1),e.Q6J("ngIf",o.roleService.product.Edit&&o.pageData.Filter.GroupByVariant&&o.data.MinVisible&&o.pageData.Filter.ListIDs),e.xp6(1),e.Q6J("ngIf",o.roleService.product.Cost)}}function ga(n,r){if(1&n&&(e.TgZ(0,"td",66),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.infiniteList,"UnitCost"))," ")}}function ha(n,r){if(1&n&&(e.TgZ(0,"td",77)(1,"a"),e._uU(2),e.ALo(3,"number"),e.ALo(4,"sum"),e.qZA()()),2&n){const t=e.oxw(3);e.xp6(2),e.Oqu(e.lcZ(3,1,e.xi3(4,3,t.infiniteList,"UnitsInStock")))}}function fa(n,r){if(1&n&&(e.TgZ(0,"td",80),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Oqu(e.lcZ(2,1,e.xi3(3,3,t.infiniteList,"Profit")))}}function xa(n,r){if(1&n&&(e.TgZ(0,"tfoot")(1,"tr",75)(2,"td",76),e._uU(3,"Total : "),e.qZA(),e.TgZ(4,"td",66),e._uU(5),e.ALo(6,"number"),e.ALo(7,"sum"),e.qZA(),e.YNc(8,ga,4,6,"td",67),e.TgZ(9,"td",77)(10,"a"),e._uU(11),e.ALo(12,"number"),e.ALo(13,"sum"),e.qZA()(),e.YNc(14,ha,5,6,"td",78),e.YNc(15,fa,4,6,"td",79),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(5),e.Oqu(e.lcZ(6,5,e.xi3(7,7,t.infiniteList,"Quantity"))),e.xp6(3),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(3),e.Oqu(e.lcZ(12,10,e.xi3(13,12,t.infiniteList,"Total"))),e.xp6(3),e.Q6J("ngIf",t.pageData.Filter.ShowInventory),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost)}}function Ta(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",81),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.StoreRowsCountAPIResult("Report/ProductSalesCount"))}),e.TgZ(1,"i",82),e._uU(2,"?"),e.qZA()()}}function Ca(n,r){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(e.lcZ(2,1,t.listTotal))}}function Za(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",4)(1,"a",83),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.NextPage(!0))}),e._UZ(2,"i",84),e._uU(3," Next"),e.qZA(),e.TgZ(4,"a",85),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.StoreRowsCountAPIResult("Report/ProductSalesCount",!0))}),e._UZ(5,"i",86),e._uU(6," Show All"),e.qZA()()}}const va=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"]},ya=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"]},Aa=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics"]};function wa(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("textChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Text=o)})("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e.TgZ(1,"actions"),e.YNc(2,Ho,2,0,"a",2),e.YNc(3,Vo,3,0,"button",3),e.TgZ(4,"div",4)(5,"a",5),e._UZ(6,"i",6),e._uU(7,"Compare by Outlet"),e.qZA(),e._UZ(8,"button",7),e.TgZ(9,"ul",8)(10,"li",9)(11,"a",10),e._uU(12,"Compare by Month"),e.qZA()(),e.TgZ(13,"li",9)(14,"a",10),e._uU(15,"Compare with Delivery"),e.qZA()()()()(),e.TgZ(16,"filters")(17,"div",11),e.YNc(18,Bo,24,15,"div",12),e.YNc(19,Ko,37,14,"div",13),e.qZA(),e.TgZ(20,"a",14),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.hideMore=!o.hideMore)}),e._uU(21),e._UZ(22,"i",15),e.qZA()(),e.TgZ(23,"content")(24,"div",16)(25,"div",17)(26,"table",18),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(27,"thead",19)(28,"tr")(29,"th",20),e._uU(30,"No"),e.qZA(),e.TgZ(31,"th",21),e._uU(32,"NAME"),e.qZA(),e.TgZ(33,"th",22),e._uU(34," CODE"),e.qZA(),e.TgZ(35,"th",23),e._uU(36,"QUANTITY"),e.qZA(),e.YNc(37,jo,2,0,"th",24),e.TgZ(38,"th",25),e._uU(39,"SALES "),e.qZA(),e.YNc(40,zo,2,0,"th",26),e.YNc(41,Wo,2,0,"th",27),e.YNc(42,$o,2,0,"th",28),e.YNc(43,Xo,2,0,"th",29),e.qZA()(),e.TgZ(44,"tbody"),e.YNc(45,ma,23,21,"tr",30),e.qZA(),e.YNc(46,xa,16,15,"tfoot",31),e.qZA()(),e.TgZ(47,"div",32)(48,"div",33)(49,"div",34),e._uU(50),e.ALo(51,"number"),e.YNc(52,Ta,3,0,"span",35),e.YNc(53,Ca,3,3,"span",31),e._uU(54),e.qZA()(),e.YNc(55,Za,7,0,"div",36),e.qZA()()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("text",t.pageData.Filter.Text),e.xp6(2),e.Q6J("ngIf",t.roleService.product.Edit&&t.pageData.Filter.GroupByVariant&&(null==t.data?null:t.data.MinVisible)&&t.pageData.Filter.ListIDs),e.xp6(1),e.Q6J("ngIf",t.roleService.global.Export),e.xp6(2),e.Q6J("routerLink",e.DdM(24,va)),e.xp6(6),e.Q6J("routerLink",e.DdM(25,ya)),e.xp6(3),e.Q6J("routerLink",e.DdM(26,Aa)),e.xp6(4),e.Q6J("ngIf",t.pageData.Filter),e.xp6(1),e.Q6J("ngIf",!t.hideMore),e.xp6(2),e.hij("",t.hideMore?"More":"Less"," "),e.xp6(16),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(3),e.Q6J("ngIf",t.pageData.Filter.ShowInventory),e.xp6(1),e.Q6J("ngIf",t.data.MinVisible&&t.pageData.Filter.ShowInventory),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Edit&&t.pageData.Filter.GroupByVariant&&t.data.MinVisible&&t.pageData.Filter.ListIDs),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(2),e.Q6J("ngForOf",t.infiniteList),e.xp6(1),e.Q6J("ngIf",t.data),e.xp6(4),e.hij(" Showing 1 - ",e.lcZ(51,22,t.pageData.Filter.RowCount*(t.pageData.Filter.PageNumber-1)+t.data.TotalCurrentRow)," of "),e.xp6(2),e.Q6J("ngIf",!t.pageData.HideStoreApiCount),e.xp6(1),e.Q6J("ngIf",t.pageData.HideStoreApiCount),e.xp6(1),e.hij(" records ~ ",t.pageData.Filter.PageNumber," Page "),e.xp6(1),e.Q6J("ngIf",t.nextPageDisabled&&!t.goToLast)}}const Fa=BiggerPicture({target:document.body});let Ma=(()=>{class n extends ce.X{constructor(t,a,o,i,s,c,u){super(t,"Report/ProductSales","ReportLoader/ProductSales",null,i),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"toasterService",void 0),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"hideMore",!0),(0,l.Z)(this,"ScopeFilter",[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}]),(0,l.Z)(this,"brandName",void 0),this.httpService=t,this.csvConverter=a,this.toasterService=o,this.activatedRoute=i,this.reportFilterService=s,this.roleService=c,this.matDialog=u}preGetList(){this.pageData.Filter.ListIDs=this.pageData.Filter.ListIDs?this.pageData.Filter.ListIDs:[]}preInitList(){this.oldRowCount=this.pageData.Filter.RowCount,this.handlingQueryParams()}handlingQueryParams(){let t=this.activatedRoute.snapshot.queryParams;C.gT.IsNotEmpty(t.BrandID)&&(this.brandName=t.Name,this.pageData.Filter.BrandID=t.BrandID),("01010001"==t.From||C.gT.IsEmpty(t.From))&&(this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From)),("01010001"==t.To||C.gT.IsEmpty(t.To))&&(this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To))}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}openBigPicture(t,a){return(0,Ro.Z)(function*(){a.preventDefault();try{const o=yield(0,C.FI)(t.ImageUrl.replace("w_80",""));Fa.open({items:[o],intro:"fadeup"})}catch(o){alert(o)}})()}updateMinstock(){const t=[];return this.infiniteList.forEach(o=>{o.NewMinStock!=o.MinStock&&t.push({VariantID:o.ID,MinStock:o.NewMinStock})}),0==this.pageData.Filter.ListIDs.length?(alert("Outlet is required"),!1):this.pageData.Filter.ListIDs.length>1?(alert("Only support 1 Outlet"),!1):void this.httpService.post("/api/Inventory/SubmitMinstockbysalesproduct",JSON.stringify({EntityID:this.pageData.Filter.ListIDs[0],Items:t})).subscribe(o=>{this.toasterService.success(o,Go.n.Success),this.getListData()})}sortData(t){const a=this.infiniteList.slice();function o(i,s,c){return(i<s?-1:1)*(c?1:-1)}this.infiniteList=t.active&&""!==t.direction?a.sort((i,s)=>{const c="asc"===t.direction;switch(i.Code=null==i.Code?"":i.Code,s.Code=null==s.Code?"":s.Code,i.BrandName=null==i.BrandName?"":i.BrandName,s.BrandName=null==s.BrandName?"":s.BrandName,t.active){case"Name":return o(i.Name.toLocaleLowerCase(),s.Name.toLocaleLowerCase(),c);case"Code":return o(i.Code.toLocaleLowerCase(),s.Code.toLocaleLowerCase(),c);case"Brand":return o(i.BrandName.toLocaleLowerCase(),s.BrandName.toLocaleLowerCase(),c);case"Quantity":return o(i.Quantity,s.Quantity,c);case"Total_Cost":return o(i.UnitCost,s.UnitCost,c);case"Inventory":return o(i.UnitsInStock,s.UnitsInStock,c);case"Total_Sales":return o(i.Total,s.Total,c);case"ReOrder":return o(i.MinStock,s.MinStock,c);default:return 0}}):a}resetListId(){0==this.pageData.Filter.ListIDs.length&&(this.pageData.Filter.ListIDs=null)}openExportModal(){this.matDialog.open(M.H,{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}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(I._W),e.Y36(h.gz),e.Y36(N.z),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["POS-product-sales"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","text","textChange","onSubmit",4,"ngIf"],[3,"pageData","text","textChange","onSubmit"],["role","button","class","btn btn-success me-6",3,"click",4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-scale-balanced","me-2"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ms-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fa-solid","fa-caret-down"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["mat-sort-header","Name"],["arrowPosition","before","mat-sort-header","Code",1,"align-left",2,"width","100px"],["arrowPosition","before","mat-sort-header","Quantity",2,"width","100px"],["style","width: 100px;","arrowPosition","before","mat-sort-header","Total_Cost",4,"ngIf"],["arrowPosition","before","mat-sort-header","Total_Sales",2,"width","100px"],["style","width: 100px;","arrowPosition","before","mat-sort-header","Inventory",4,"ngIf"],["style","width: 120px;","arrowPosition","before","mat-sort-header","ReOrder",4,"ngIf"],["style","width: 88px;","arrowPosition","before",4,"ngIf"],["class","text-end","style","width: 7.5rem;",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[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"],["role","button",1,"btn","btn-success","me-6",3,"click"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange","change"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",1,"category-filter",3,"ngModel","items","ngModelChange"],["appearance","outline","name","From",3,"date","showClearBtn","showTodayBtn","dateChange"],[1,"mt-4"],["appearance","outline","name","To",3,"date","showClearBtn","showTodayBtn","dateChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose...","id","inputSales",1,"productform",3,"selected","items","selectedChange"],["name","Scope",3,"model","options","modelChange"],["id","more-filter","container","",1,"ms-6"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"ngModel","items","ngModelChange"],["requestUrl","/API/AC/GetSupplierSuggestion","notFoundMessageFor","supplier",1,"w-100",3,"ngModel","inputTextValue","ngModelChange"],["requestUrl","/API/AC/GetProductBrandSuggestion",1,"w-100",3,"ngModel","inputTextValue","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"items","ngModel","ngModelChange"],["requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100",3,"ngModel","ngModelChange"],["name","Exclude",3,"model","modelChange"],["name","Scope",3,"model","modelChange"],["arrowPosition","before","mat-sort-header","Total_Cost",2,"width","100px"],["arrowPosition","before","mat-sort-header","Inventory",2,"width","100px"],["arrowPosition","before","mat-sort-header","ReOrder",2,"width","120px"],["arrowPosition","before",2,"width","88px"],[1,"text-end",2,"width","7.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"me-3"],["class","d-block",3,"target",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"routerLink","queryParams",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["matTooltipPosition","above","matTooltip","Click to zoom",2,"width","40px",3,"src","click"],[1,"d-block",3,"target"],["matTooltipPosition","above","matTooltip","Click to zoom",1,"border","rounded",2,"width","40px",3,"src","click"],["type","text","autoNum","",1,"text-end",2,"width","72px",3,"ngModel","ngModelChange"],[1,"text-end",3,"ngClass"],[1,"table","table-borderless"],["colspan","3",1,"text-end"],[1,"text-end","text-primary"],["class","text-end text-primary ",4,"ngIf"],["colspan","2","class","text-end",4,"ngIf"],["colspan","2",1,"text-end"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(t,a){1&t&&e.YNc(0,wa,56,27,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.mk,p.sg,p.O5,h.rH,m.w9,A.QB,d.Fj,d.JJ,d.On,x.gM,f.YE,f.nU,U.b,q.P,E.J,j.R,S.qU,p.JJ,p.uU],styles:[".category-filter[_ngcontent-%COMP%] .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{white-space:normal;word-break:break-word}"]})),n})();function qa(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.convertToCSV(o.csvConverter,!0,"SalesProductByOutlet.csv"))}),e._UZ(1,"i",7),e._uU(2," Export"),e.qZA()}}function Ia(n,r){if(1&n&&(e.TgZ(0,"span",17),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function Pa(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Product"),e.qZA(),e.TgZ(3,"autocompleteV2",18),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ProductID=o)}),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(3),e.Q6J("ngModel",t.pageData.Filter.ProductID)}}function Oa(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Variant"),e.qZA(),e.TgZ(3,"autocompleteV2",19),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ProductID=o)}),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(3),e.Q6J("ngModel",t.pageData.Filter.ProductID)}}function Na(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",8)(1,"div")(2,"h6"),e._uU(3,"Sales"),e.qZA(),e.TgZ(4,"ng-select-infinite",9),e.NdJ("selectedChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SalesID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Categories"),e.qZA(),e.TgZ(8,"ng-select",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,Ia,2,2,"ng-template",11),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"From - To"),e.qZA(),e.TgZ(13,"div")(14,"datepicker",12),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(15,"div",13)(16,"datepicker",14),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()(),e.TgZ(17,"div")(18,"h6"),e._uU(19,"Scope"),e.qZA(),e.TgZ(20,"radio-options",15),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Product=o)})("modelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.getListData())}),e.qZA()(),e.YNc(21,Pa,4,1,"div",16),e.YNc(22,Oa,4,1,"div",16),e.qZA()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("selected",t.pageData.Filter.SalesID)("items",null==t.pageData.Options?null:t.pageData.Options.Sales),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(6),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("model",t.pageData.Filter.Product)("options",t.ScopeFilter),e.xp6(1),e.Q6J("ngIf",t.pageData.Filter.Product),e.xp6(1),e.Q6J("ngIf",!t.pageData.Filter.Product)}}function Ja(n,r){if(1&n&&(e.TgZ(0,"th",26),e._uU(1),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.Oqu(t)}}function La(n,r){if(1&n&&(e.TgZ(0,"td",26),e._uU(1),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.Oqu(t)}}function Ua(n,r){if(1&n&&(e.TgZ(0,"tr",28)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td",29),e._uU(4),e.qZA(),e.YNc(5,La,2,1,"td",25),e.TgZ(6,"td",26),e._uU(7),e.qZA()()),2&n){const t=r.$implicit;e.xp6(2),e.Oqu(t.Name),e.xp6(2),e.Oqu(t.Code),e.xp6(1),e.Q6J("ngForOf",t.Quantities),e.xp6(2),e.Oqu(t.Total)}}function Qa(n,r){if(1&n&&(e.TgZ(0,"div",20)(1,"table",21)(2,"thead",22)(3,"tr")(4,"th",23),e._uU(5,"Nama"),e.qZA(),e.TgZ(6,"th",24),e._uU(7,"Code"),e.qZA(),e.YNc(8,Ja,2,1,"th",25),e.TgZ(9,"th",26),e._uU(10,"Total"),e.qZA()()(),e.TgZ(11,"tbody"),e.YNc(12,Ua,8,4,"tr",27),e.qZA()()()),2&n){const t=e.oxw();e.xp6(8),e.Q6J("ngForOf",t.data.Outlet),e.xp6(4),e.Q6J("ngForOf",t.data.Data)}}const ka=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]};let Ea=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"ScopeFilter",[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}]),this.httpService=t,this.csvConverter=a,this.reportFilterService=o,this.roleService=i}postInit(t){this.menuData.H=t.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)}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(N.z),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-product-sales-by-outlet"]],features:[e.qOj],decls:10,vars:8,consts:[[3,"pageData","text","hideSearchBox","textChange","onSubmit"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary me-6",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...","id","inputSales",1,"productform",3,"selected","items","selectedChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["name","Scope",3,"model","options","modelChange"],[4,"ngIf"],["matTooltipPosition","above",3,"matTooltip"],["requestUrl","/API/AC/GetProductSuggestionByCodeNName",1,"w-100",3,"ngModel","ngModelChange"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%","text-align","right"],["class","text-end",4,"ngFor","ngForOf"],[1,"text-end"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[2,"text-align","right"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.Number=i})("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,qa,3,0,"a",1),e.TgZ(3,"a",2),e._uU(4,"Group by Product"),e.qZA()(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,Na,23,10,"div",4),e.qZA()(),e.TgZ(8,"content"),e.YNc(9,Qa,13,2,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.Number)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(7,ka)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,m.ir,A.QB,d.JJ,d.On,x.gM,q.P,E.J,j.R]})),n})();function Ya(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.convertToCSV(o.csvConverter,!0,"SalesProductByOutlet.csv"))}),e._UZ(1,"i",7),e._uU(2," Export"),e.qZA()}}function Ra(n,r){if(1&n&&(e.TgZ(0,"span",15),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function Ga(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",8)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,Ra,2,2,"ng-template",11),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Compare Month From"),e.qZA(),e.TgZ(13,"ng-select",12),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.MonthFrom=o)}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"Compare Month To"),e.qZA(),e.TgZ(17,"ng-select",12),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.MonthTo=o)}),e.qZA()(),e.TgZ(18,"div")(19,"h6"),e._uU(20,"Year"),e.qZA(),e.TgZ(21,"ng-select",13),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Year=o)}),e.qZA()(),e.TgZ(22,"div")(23,"h6"),e._uU(24,"Scope"),e.qZA(),e.TgZ(25,"radio-options",14),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.GroupByVariant=o)})("modelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.getListData())}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(5),e.Q6J("ngModel",t.pageData.Filter.MonthFrom)("items",t.Months),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.MonthTo)("items",t.Months),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.Year)("items",t.Years),e.xp6(4),e.Q6J("model",t.pageData.Filter.GroupByVariant)("options",t.ScopeFilter)}}function Ha(n,r){if(1&n&&(e.TgZ(0,"th",25),e._uU(1),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(1),e.hij(" ",a.Months[t.Month-1].ColumnLabel," ")}}function Va(n,r){if(1&n&&(e.TgZ(0,"td",29),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=r.$implicit,a=e.oxw().$implicit,o=e.oxw(2);e.xp6(1),e.hij(" ",o.findKey(a.Sold,t.Month)?e.lcZ(2,1,o.findKey(a.Sold,t.Month)):""," ")}}const Ba=function(n){return[n]},Ka=function(n){return{ID:n}};function ja(n,r){if(1&n&&(e.TgZ(0,"tr",26)(1,"td")(2,"a",27),e._uU(3),e.qZA()(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.YNc(6,Va,3,3,"td",28),e.TgZ(7,"td",29),e._uU(8),e.ALo(9,"number"),e.ALo(10,"sum"),e.qZA()()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Q6J("routerLink",e.VKq(11,Ba,a.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",e.VKq(13,Ka,t.ID)),e.xp6(1),e.hij(" ",t.Name," "),e.xp6(2),e.Oqu(t.Code),e.xp6(1),e.Q6J("ngForOf",a.data.MonthlySales),e.xp6(2),e.hij(" ",e.lcZ(9,6,e.xi3(10,8,t.Sold,"Value"))," ")}}function za(n,r){if(1&n&&(e.TgZ(0,"td",29),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.Sold)," ")}}function Wa(n,r){if(1&n&&(e.TgZ(0,"tfoot")(1,"tr",30),e._UZ(2,"td")(3,"td"),e.YNc(4,za,3,3,"td",28),e.TgZ(5,"td",29),e._uU(6),e.ALo(7,"number"),e.ALo(8,"sum"),e.qZA()()()),2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("ngForOf",t.data.MonthlySales),e.xp6(2),e.hij(" ",e.lcZ(7,2,e.xi3(8,4,t.data.MonthlySales,"Sold"))," ")}}function $a(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",16)(1,"table",17),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",18)(3,"tr")(4,"th",19),e._uU(5,"Name"),e.qZA(),e.TgZ(6,"th",20),e._uU(7,"Code"),e.qZA(),e.YNc(8,Ha,2,1,"th",21),e.TgZ(9,"th",22),e._uU(10,"Total"),e.qZA()()(),e.TgZ(11,"tbody"),e.YNc(12,ja,11,15,"tr",23),e.qZA(),e.YNc(13,Wa,9,7,"tfoot",24),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(8),e.Q6J("ngForOf",t.data.MonthlySales),e.xp6(4),e.Q6J("ngForOf",t.data.Data),e.xp6(1),e.Q6J("ngIf",t.data.Data.length>0)}}const Xa=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]};let ei=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"Years",C.gT.GenerateYears((new Date).getFullYear()+1,11,!0)),(0,l.Z)(this,"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"}]),(0,l.Z)(this,"ScopeFilter",[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}]),this.httpService=t,this.csvConverter=a,this.reportFilterService=o,this.roleService=i}preGetList(){C.gT.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=C.gT.GuidEmpty)}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData?.Filter?.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}findKey(t,a){let o=null;return t.forEach(i=>{i.Key==a&&(o=i.Value)}),o}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(o.Code=null==o.Code?"":o.Code,i.Code=null==i.Code?"":i.Code,o.Name=null==o.Name?"":o.Name,i.Name=null==i.Name?"":i.Name,t.active){case"Name":return this.compare(o.Name.toLocaleLowerCase(),i.Name.toLocaleLowerCase(),s);case"Code":return this.compare(o.Code.toLocaleLowerCase(),i.Code.toLocaleLowerCase(),s);default:return 0}}):a}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(N.z),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-product-sales-by-month"]],features:[e.qOj],decls:10,vars:7,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary me-6",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload","me-4"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange"],["placeholder","Year",3,"ngModel","items","ngModelChange"],["name","Scope",3,"model","options","modelChange"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["mat-sort-header","Code",1,"align-left",2,"width","120px"],["class","text-end small","style","width: 70px",4,"ngFor","ngForOf"],[1,"text-end",2,"width","75px"],["class","border-bottom",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"text-end","small",2,"width","70px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["class","text-end",4,"ngFor","ngForOf"],[1,"text-end"],[1,"table","table-borderless"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,Ya,3,0,"a",1),e.TgZ(3,"a",2),e._uU(4,"Group by Product"),e.qZA()(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,Ga,26,13,"div",4),e.qZA()(),e.TgZ(8,"content"),e.YNc(9,$a,14,3,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(6,Xa)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,m.ir,d.JJ,d.On,x.gM,f.YE,f.nU,q.P,S.qU,p.JJ]})),n})();function ti(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.exportCSV(o.csvConverter,"ReportExport/GetProductSalesVsDelivery","Productsalesvsdelivery.csv"))}),e._UZ(1,"i",7),e._uU(2," Export"),e.qZA()}}function ni(n,r){if(1&n&&(e.TgZ(0,"span",17),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function oi(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Product"),e.qZA(),e.TgZ(3,"autocompleteV2",18),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ProductID=o)}),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(3),e.Q6J("ngModel",t.pageData.Filter.ProductID)}}function ai(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Variant"),e.qZA(),e.TgZ(3,"autocompleteV2",19),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ProductID=o)}),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(3),e.Q6J("ngModel",t.pageData.Filter.ProductID)}}function ii(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",8)(1,"div")(2,"h6"),e._uU(3,"Categories"),e.qZA(),e.TgZ(4,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(5,ni,2,2,"ng-template",10),e.qZA()(),e.TgZ(6,"div")(7,"h6"),e._uU(8,"From - To"),e.qZA(),e.TgZ(9,"div")(10,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(11,"div",12)(12,"datepicker",13),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Scope"),e.qZA(),e.TgZ(16,"radio-options",14),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Product=o)})("modelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.getListData())}),e.qZA()(),e.YNc(17,oi,4,1,"div",15),e.YNc(18,ai,4,1,"div",15),e.TgZ(19,"div")(20,"h6"),e._uU(21,"Write Performance Log"),e.qZA(),e.TgZ(22,"radio-options",16),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.WritePerformanceLog=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(6),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("model",t.pageData.Filter.Product)("options",t.ScopeFilter),e.xp6(1),e.Q6J("ngIf",t.pageData.Filter.Product),e.xp6(1),e.Q6J("ngIf",!t.pageData.Filter.Product),e.xp6(4),e.Q6J("model",t.pageData.Filter.WritePerformanceLog)}}function ri(n,r){if(1&n&&(e.TgZ(0,"th",28),e._uU(1),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.Oqu(t)}}function li(n,r){if(1&n&&(e.TgZ(0,"tr"),e._UZ(1,"th")(2,"th"),e.YNc(3,ri,2,1,"th",27),e.qZA()),2&n){const t=e.oxw(2);e.xp6(3),e.Q6J("ngForOf",t.data.Outlet)}}function si(n,r){if(1&n&&(e.TgZ(0,"th",29),e._uU(1),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.hij(" ",t,"")}}function pi(n,r){if(1&n&&(e.TgZ(0,"td",24),e._uU(1),e.qZA()),2&n){const t=r.$implicit,a=e.oxw().$implicit;e.xp6(1),e.Oqu(a[t])}}function ci(n,r){if(1&n&&(e.TgZ(0,"tr",24),e.YNc(1,pi,2,1,"td",26),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",a.getKeys(t))}}function di(n,r){if(1&n&&(e.TgZ(0,"div",20)(1,"table",21)(2,"thead",22),e.YNc(3,li,4,1,"tr",15),e.TgZ(4,"tr")(5,"th",23),e._uU(6,"Name"),e.qZA(),e.TgZ(7,"th",24),e._uU(8,"Code"),e.qZA(),e.YNc(9,si,2,1,"th",25),e.qZA()(),e.TgZ(10,"tbody"),e.YNc(11,ci,2,1,"tr",26),e.qZA()()()),2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngIf",t.data.Outlet.length>0),e.xp6(6),e.Q6J("ngForOf",t.data.Header),e.xp6(2),e.Q6J("ngForOf",t.data.Data)}}const ui=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]};let _i=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"ScopeFilter",[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}]),this.httpService=t,this.csvConverter=a,this.reportFilterService=o,this.roleService=i}postInit(t){this.menuData.H=t.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)}getKeys(t){return Object.keys(t)}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(N.z),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],features:[e.qOj],decls:10,vars:7,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary me-6",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["name","Scope",3,"model","options","modelChange"],[4,"ngIf"],["name","Scope",3,"model","modelChange"],["matTooltipPosition","above",3,"matTooltip"],["requestUrl","/API/AC/GetProductSuggestionByCodeNName",1,"w-100",3,"ngModel","ngModelChange"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border",2,"width","15%"],[1,"border"],["class","border","style","width: 10%",4,"ngFor","ngForOf"],["class","border",4,"ngFor","ngForOf"],["colspan","2","class","text-center border",4,"ngFor","ngForOf"],["colspan","2",1,"text-center","border"],[1,"border",2,"width","10%"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,ti,3,0,"a",1),e.TgZ(3,"a",2),e._uU(4,"Group by Product"),e.qZA()(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,ii,23,9,"div",4),e.qZA()(),e.TgZ(8,"content"),e.YNc(9,di,12,3,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(6,ui)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,m.ir,A.QB,d.JJ,d.On,x.gM,q.P,E.J]})),n})();var H=g(10805),F=g(19592);let mi=(()=>{class n{constructor(t){this.host=t,this.focused=!1}ngAfterViewChecked(){if(!this.focused&&this.autofocus){const t=F.p.getFocusableElements(this.host.nativeElement);0===t.length&&this.host.nativeElement.focus(),t.length>0&&t[0].focus(),this.focused=!0}}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.SBq))},n.\u0275dir=e.lG2({type:n,selectors:[["","pAutoFocus",""]],hostAttrs:[1,"p-element"],inputs:{autofocus:"autofocus"}}),n})(),gi=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[p.ez]}),n})();var Ce=g(72526),ie=g(91795),re=g(93718),qe=g(3608),L=g(60982);function hi(n,r){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw();let a;e.xp6(1),e.Oqu(null!==(a=t.label)&&void 0!==a?a:"empty")}}function fi(n,r){1&n&&e.GkF(0)}const de=function(n){return{height:n}},xi=function(n,r){return{"p-dropdown-item":!0,"p-highlight":n,"p-disabled":r}},Ze=function(n){return{$implicit:n}},Ti=["container"],Ci=["filter"],Zi=["in"],Di=["editableInput"],vi=["items"],bi=["scroller"],yi=["overlay"];function Si(n,r){if(1&n&&(e.ynx(0),e._uU(1),e.BQk()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.label||"empty")}}function Ai(n,r){1&n&&e.GkF(0)}const wi=function(n){return{"p-dropdown-label p-inputtext":!0,"p-dropdown-label-empty":n}};function Fi(n,r){if(1&n&&(e.TgZ(0,"span",14),e.YNc(1,Si,2,1,"ng-container",15),e.YNc(2,Ai,1,0,"ng-container",16),e.qZA()),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(9,wi,null==t.label||0===t.label.length))("pTooltip",t.tooltip)("tooltipPosition",t.tooltipPosition)("positionStyle",t.tooltipPositionStyle)("tooltipStyleClass",t.tooltipStyleClass),e.uIk("id",t.labelId),e.xp6(1),e.Q6J("ngIf",!t.selectedItemTemplate),e.xp6(1),e.Q6J("ngTemplateOutlet",t.selectedItemTemplate)("ngTemplateOutletContext",e.VKq(11,Ze,t.selectedOption))}}const Mi=function(n){return{"p-dropdown-label p-inputtext p-placeholder":!0,"p-dropdown-label-empty":n}};function qi(n,r){if(1&n&&(e.TgZ(0,"span",17),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(2,Mi,null==t.placeholder||0===t.placeholder.length)),e.xp6(1),e.Oqu(t.placeholder||"empty")}}function Ii(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"input",18,19),e.NdJ("input",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onEditableInputChange(o))})("focus",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onEditableInputFocus(o))})("blur",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onInputBlur(o))}),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("disabled",t.disabled),e.uIk("maxlength",t.maxlength)("placeholder",t.placeholder)("aria-expanded",t.overlayVisible)}}function Pi(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"i",20),e.NdJ("click",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.clear(o))}),e.qZA()}}function Oi(n,r){1&n&&e.GkF(0)}function Ni(n,r){1&n&&e.GkF(0)}const Ie=function(n){return{options:n}};function Ji(n,r){if(1&n&&(e.ynx(0),e.YNc(1,Ni,1,0,"ng-container",16),e.BQk()),2&n){const t=e.oxw(3);e.xp6(1),e.Q6J("ngTemplateOutlet",t.filterTemplate)("ngTemplateOutletContext",e.VKq(2,Ie,t.filterOptions))}}function Li(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",30)(1,"input",31,32),e.NdJ("keydown.enter",function(o){return o.preventDefault()})("keydown",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.onKeydown(o,!1))})("input",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.onFilterInputChange(o))}),e.qZA(),e._UZ(3,"span",33),e.qZA()}if(2&n){const t=e.oxw(3);e.xp6(1),e.Q6J("value",t.filterValue||""),e.uIk("placeholder",t.filterPlaceholder)("aria-label",t.ariaFilterLabel)("aria-activedescendant",t.overlayVisible?"p-highlighted-option":t.labelId)}}function Ui(n,r){if(1&n&&(e.TgZ(0,"div",27),e.NdJ("click",function(a){return a.stopPropagation()}),e.YNc(1,Ji,2,4,"ng-container",28),e.YNc(2,Li,4,4,"ng-template",null,29,e.W1O),e.qZA()),2&n){const t=e.MAs(3),a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",a.filterTemplate)("ngIfElse",t)}}function Qi(n,r){1&n&&e.GkF(0)}const Pe=function(n,r){return{$implicit:n,options:r}};function ki(n,r){if(1&n&&e.YNc(0,Qi,1,0,"ng-container",16),2&n){const t=r.$implicit,a=r.options;e.oxw(2);const o=e.MAs(7);e.Q6J("ngTemplateOutlet",o)("ngTemplateOutletContext",e.WLB(2,Pe,t,a))}}function Ei(n,r){1&n&&e.GkF(0)}function Yi(n,r){if(1&n&&e.YNc(0,Ei,1,0,"ng-container",16),2&n){const t=r.options,a=e.oxw(4);e.Q6J("ngTemplateOutlet",a.loaderTemplate)("ngTemplateOutletContext",e.VKq(2,Ie,t))}}function Ri(n,r){1&n&&(e.ynx(0),e.YNc(1,Yi,1,4,"ng-template",36),e.BQk())}function Gi(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"p-scroller",34,35),e.NdJ("onLazyLoad",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onLazyLoad.emit(o))}),e.YNc(2,ki,1,5,"ng-template",13),e.YNc(3,Ri,2,0,"ng-container",15),e.qZA()}if(2&n){const t=e.oxw(2);e.Akn(e.VKq(8,de,t.scrollHeight)),e.Q6J("items",t.optionsToDisplay)("itemSize",t.virtualScrollItemSize||t._itemSize)("autoSize",!0)("lazy",t.lazy)("options",t.virtualScrollOptions),e.xp6(3),e.Q6J("ngIf",t.loaderTemplate)}}function Hi(n,r){1&n&&e.GkF(0)}const Vi=function(){return{}};function Bi(n,r){if(1&n&&(e.ynx(0),e.YNc(1,Hi,1,0,"ng-container",16),e.BQk()),2&n){e.oxw();const t=e.MAs(7),a=e.oxw();e.xp6(1),e.Q6J("ngTemplateOutlet",t)("ngTemplateOutletContext",e.WLB(3,Pe,a.optionsToDisplay,e.DdM(2,Vi)))}}function Ki(n,r){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit,a=e.oxw(4);e.xp6(1),e.Oqu(a.getOptionGroupLabel(t)||"empty")}}function ji(n,r){1&n&&e.GkF(0)}function zi(n,r){1&n&&e.GkF(0)}const Oe=function(n,r){return{$implicit:n,selectedOption:r}};function Wi(n,r){if(1&n&&(e.TgZ(0,"li",42),e.YNc(1,Ki,2,1,"span",15),e.YNc(2,ji,1,0,"ng-container",16),e.qZA(),e.YNc(3,zi,1,0,"ng-container",16)),2&n){const t=r.$implicit,a=e.oxw(2).options,o=e.MAs(5),i=e.oxw(2);e.Q6J("ngStyle",e.VKq(6,de,a.itemSize+"px")),e.xp6(1),e.Q6J("ngIf",!i.groupTemplate),e.xp6(1),e.Q6J("ngTemplateOutlet",i.groupTemplate)("ngTemplateOutletContext",e.VKq(8,Ze,t)),e.xp6(1),e.Q6J("ngTemplateOutlet",o)("ngTemplateOutletContext",e.WLB(10,Oe,i.getOptionGroupChildren(t),i.selectedOption))}}function $i(n,r){if(1&n&&(e.ynx(0),e.YNc(1,Wi,4,13,"ng-template",41),e.BQk()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t)}}function Xi(n,r){1&n&&e.GkF(0)}function er(n,r){if(1&n&&(e.ynx(0),e.YNc(1,Xi,1,0,"ng-container",16),e.BQk()),2&n){const t=e.oxw().$implicit,a=e.MAs(5),o=e.oxw(2);e.xp6(1),e.Q6J("ngTemplateOutlet",a)("ngTemplateOutletContext",e.WLB(2,Oe,t,o.selectedOption))}}function tr(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"p-dropdownItem",43),e.NdJ("onClick",function(o){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onItemClick(o))}),e.qZA()}if(2&n){const t=r.$implicit,a=e.oxw().selectedOption,o=e.oxw(3);e.Q6J("option",t)("selected",a==t)("label",o.getOptionLabel(t))("disabled",o.isOptionDisabled(t))("template",o.itemTemplate)}}function nr(n,r){1&n&&e.YNc(0,tr,1,5,"ng-template",41),2&n&&e.Q6J("ngForOf",r.$implicit)}function or(n,r){if(1&n&&(e.ynx(0),e._uU(1),e.BQk()),2&n){const t=e.oxw(4);e.xp6(1),e.hij(" ",t.emptyFilterMessageLabel," ")}}function ar(n,r){1&n&&e.GkF(0,null,45)}function ir(n,r){if(1&n&&(e.TgZ(0,"li",44),e.YNc(1,or,2,1,"ng-container",28),e.YNc(2,ar,2,0,"ng-container",22),e.qZA()),2&n){const t=e.oxw().options,a=e.oxw(2);e.Q6J("ngStyle",e.VKq(4,de,t.itemSize+"px")),e.xp6(1),e.Q6J("ngIf",!a.emptyFilterTemplate&&!a.emptyTemplate)("ngIfElse",a.emptyFilter),e.xp6(1),e.Q6J("ngTemplateOutlet",a.emptyFilterTemplate||a.emptyTemplate)}}function rr(n,r){if(1&n&&(e.ynx(0),e._uU(1),e.BQk()),2&n){const t=e.oxw(4);e.xp6(1),e.hij(" ",t.emptyMessageLabel," ")}}function lr(n,r){1&n&&e.GkF(0,null,46)}function sr(n,r){if(1&n&&(e.TgZ(0,"li",44),e.YNc(1,rr,2,1,"ng-container",28),e.YNc(2,lr,2,0,"ng-container",22),e.qZA()),2&n){const t=e.oxw().options,a=e.oxw(2);e.Q6J("ngStyle",e.VKq(4,de,t.itemSize+"px")),e.xp6(1),e.Q6J("ngIf",!a.emptyTemplate)("ngIfElse",a.empty),e.xp6(1),e.Q6J("ngTemplateOutlet",a.emptyTemplate)}}function pr(n,r){if(1&n&&(e.TgZ(0,"ul",37,38),e.YNc(2,$i,2,1,"ng-container",15),e.YNc(3,er,2,5,"ng-container",15),e.YNc(4,nr,1,1,"ng-template",null,39,e.W1O),e.YNc(6,ir,3,6,"li",40),e.YNc(7,sr,3,6,"li",40),e.qZA()),2&n){const t=r.options,a=e.oxw(2);e.Akn(t.contentStyle),e.Q6J("ngClass",t.contentStyleClass),e.uIk("id",a.listId),e.xp6(2),e.Q6J("ngIf",a.group),e.xp6(1),e.Q6J("ngIf",!a.group),e.xp6(3),e.Q6J("ngIf",a.filterValue&&a.isEmpty()),e.xp6(1),e.Q6J("ngIf",!a.filterValue&&a.isEmpty())}}function cr(n,r){1&n&&e.GkF(0)}function dr(n,r){if(1&n&&(e.TgZ(0,"div",21),e.YNc(1,Oi,1,0,"ng-container",22),e.YNc(2,Ui,4,2,"div",23),e.TgZ(3,"div",24),e.YNc(4,Gi,4,10,"p-scroller",25),e.YNc(5,Bi,2,6,"ng-container",15),e.YNc(6,pr,8,8,"ng-template",null,26,e.W1O),e.qZA(),e.YNc(8,cr,1,0,"ng-container",22),e.qZA()),2&n){const t=e.oxw();e.Tol(t.panelStyleClass),e.Q6J("ngClass","p-dropdown-panel p-component")("ngStyle",t.panelStyle),e.xp6(1),e.Q6J("ngTemplateOutlet",t.headerTemplate),e.xp6(1),e.Q6J("ngIf",t.filter),e.xp6(1),e.Udp("max-height",t.virtualScroll?"auto":t.scrollHeight||"auto"),e.xp6(1),e.Q6J("ngIf",t.virtualScroll),e.xp6(1),e.Q6J("ngIf",!t.virtualScroll),e.xp6(3),e.Q6J("ngTemplateOutlet",t.footerTemplate)}}const ur=function(n,r,t,a){return{"p-dropdown p-component":!0,"p-disabled":n,"p-dropdown-open":r,"p-focus":t,"p-dropdown-clearable":a}},_r={provide:d.JU,useExisting:(0,e.Gpc)(()=>Ne),multi:!0};let mr=(()=>{class n{constructor(){this.onClick=new e.vpe}onOptionClick(t){this.onClick.emit({originalEvent:t,option:this.option})}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["p-dropdownItem"]],hostAttrs:[1,"p-element"],inputs:{option:"option",selected:"selected",label:"label",disabled:"disabled",visible:"visible",itemSize:"itemSize",template:"template"},outputs:{onClick:"onClick"},decls:3,vars:15,consts:[["role","option","pRipple","",3,"ngStyle","id","ngClass","click"],[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(t,a){1&t&&(e.TgZ(0,"li",0),e.NdJ("click",function(i){return a.onOptionClick(i)}),e.YNc(1,hi,2,1,"span",1),e.YNc(2,fi,1,0,"ng-container",2),e.qZA()),2&t&&(e.Q6J("ngStyle",e.VKq(8,de,a.itemSize+"px"))("id",a.selected?"p-highlighted-option":"")("ngClass",e.WLB(10,xi,a.selected,a.disabled)),e.uIk("aria-label",a.label)("aria-selected",a.selected),e.xp6(1),e.Q6J("ngIf",!a.template),e.xp6(1),e.Q6J("ngTemplateOutlet",a.template)("ngTemplateOutletContext",e.VKq(13,Ze,a.option)))},dependencies:[p.mk,p.O5,p.tP,p.PC,ie.H],encapsulation:2}),n})(),Ne=(()=>{class n{constructor(t,a,o,i,s,c){this.el=t,this.renderer=a,this.cd=o,this.zone=i,this.filterService=s,this.config=c,this.scrollHeight="200px",this.resetFilterOnHide=!1,this.dropdownIcon="pi pi-chevron-down",this.optionGroupChildren="items",this.autoDisplayFirst=!0,this.emptyFilterMessage="",this.emptyMessage="",this.lazy=!1,this.filterMatchMode="contains",this.tooltip="",this.tooltipPosition="right",this.tooltipPositionStyle="absolute",this.autofocusFilter=!0,this.overlayDirection="end",this.onChange=new e.vpe,this.onFilter=new e.vpe,this.onFocus=new e.vpe,this.onBlur=new e.vpe,this.onClick=new e.vpe,this.onShow=new e.vpe,this.onHide=new e.vpe,this.onClear=new e.vpe,this.onLazyLoad=new e.vpe,this.onModelChange=()=>{},this.onModelTouched=()=>{},this.id=(0,L.Th)()}get disabled(){return this._disabled}set disabled(t){t&&(this.focused=!1,this.overlayVisible&&this.hide()),this._disabled=t,this.cd.destroyed||this.cd.detectChanges()}get itemSize(){return this._itemSize}set itemSize(t){this._itemSize=t,console.warn("The itemSize property is deprecated, use virtualScrollItemSize property instead.")}get autoZIndex(){return this._autoZIndex}set autoZIndex(t){this._autoZIndex=t,console.warn("The autoZIndex property is deprecated since v14.2.0, use overlayOptions property instead.")}get baseZIndex(){return this._baseZIndex}set baseZIndex(t){this._baseZIndex=t,console.warn("The baseZIndex property is deprecated since v14.2.0, use overlayOptions property instead.")}get showTransitionOptions(){return this._showTransitionOptions}set showTransitionOptions(t){this._showTransitionOptions=t,console.warn("The showTransitionOptions property is deprecated since v14.2.0, use overlayOptions property instead.")}get hideTransitionOptions(){return this._hideTransitionOptions}set hideTransitionOptions(t){this._hideTransitionOptions=t,console.warn("The hideTransitionOptions property is deprecated since v14.2.0, use overlayOptions property instead.")}ngAfterContentInit(){this.templates.forEach(t=>{switch(t.getType()){case"item":default:this.itemTemplate=t.template;break;case"selectedItem":this.selectedItemTemplate=t.template;break;case"header":this.headerTemplate=t.template;break;case"filter":this.filterTemplate=t.template;break;case"footer":this.footerTemplate=t.template;break;case"emptyfilter":this.emptyFilterTemplate=t.template;break;case"empty":this.emptyTemplate=t.template;break;case"group":this.groupTemplate=t.template;break;case"loader":this.loaderTemplate=t.template}})}ngOnInit(){this.optionsToDisplay=this.options,this.updateSelectedOption(null),this.labelId=this.id+"_label",this.listId=this.id+"_list",this.filterBy&&(this.filterOptions={filter:t=>this.onFilterInputChange(t),reset:()=>this.resetFilter()})}get options(){return this._options}set options(t){this._options=t,this.optionsToDisplay=this._options,this.updateSelectedOption(this.value),this.selectedOption=this.findOption(this.value,this.optionsToDisplay),!this.selectedOption&&L.gb.isNotEmpty(this.value)&&!this.editable&&(this.value=null,this.onModelChange(this.value)),this.optionsChanged=!0,this._filterValue&&this._filterValue.length&&this.activateFilter()}get filterValue(){return this._filterValue}set filterValue(t){this._filterValue=t,this.activateFilter()}ngAfterViewInit(){this.editable&&this.updateEditableLabel()}get label(){return"number"==typeof this.selectedOption&&(this.selectedOption=this.selectedOption.toString()),this.selectedOption?this.getOptionLabel(this.selectedOption):null}get emptyMessageLabel(){return this.emptyMessage||this.config.getTranslation(H.ws.EMPTY_MESSAGE)}get emptyFilterMessageLabel(){return this.emptyFilterMessage||this.config.getTranslation(H.ws.EMPTY_FILTER_MESSAGE)}get filled(){return"string"==typeof this.value?!!this.value:this.value||null!=this.value||null!=this.value}get isVisibleClearIcon(){return null!=this.value&&""!==this.value&&this.showClear&&!this.disabled}updateEditableLabel(){this.editableInputViewChild&&this.editableInputViewChild.nativeElement&&(this.editableInputViewChild.nativeElement.value=this.selectedOption?this.getOptionLabel(this.selectedOption):this.value||"")}getOptionLabel(t){return this.optionLabel?L.gb.resolveFieldData(t,this.optionLabel):t&&void 0!==t.label?t.label:t}getOptionValue(t){return this.optionValue?L.gb.resolveFieldData(t,this.optionValue):!this.optionLabel&&t&&void 0!==t.value?t.value:t}isOptionDisabled(t){return this.optionDisabled?L.gb.resolveFieldData(t,this.optionDisabled):!(!t||void 0===t.disabled)&&t.disabled}getOptionGroupLabel(t){return this.optionGroupLabel?L.gb.resolveFieldData(t,this.optionGroupLabel):t&&void 0!==t.label?t.label:t}getOptionGroupChildren(t){return this.optionGroupChildren?L.gb.resolveFieldData(t,this.optionGroupChildren):t.items}onItemClick(t){const a=t.option;this.isOptionDisabled(a)||(this.selectItem(t.originalEvent,a),this.accessibleViewChild.nativeElement.focus({preventScroll:!0})),setTimeout(()=>{this.hide()},1)}selectItem(t,a){this.selectedOption!=a&&(this.selectedOption=a,this.value=this.getOptionValue(a),this.onModelChange(this.value),this.updateEditableLabel(),this.onChange.emit({originalEvent:t,value:this.value}))}ngAfterViewChecked(){if(this.optionsChanged&&this.overlayVisible&&(this.optionsChanged=!1,this.zone.runOutsideAngular(()=>{setTimeout(()=>{this.overlayViewChild&&this.overlayViewChild.alignOverlay()},1)})),this.selectedOptionUpdated&&this.itemsWrapper){let t=F.p.findSingle(this.overlayViewChild.overlayViewChild.nativeElement,"li.p-highlight");t&&F.p.scrollInView(this.itemsWrapper,t),this.selectedOptionUpdated=!1}}writeValue(t){this.filter&&this.resetFilter(),this.value=t,this.updateSelectedOption(t),this.updateEditableLabel(),this.cd.markForCheck()}resetFilter(){this._filterValue=null,this.filterViewChild&&this.filterViewChild.nativeElement&&(this.filterViewChild.nativeElement.value=""),this.optionsToDisplay=this.options}updateSelectedOption(t){this.selectedOption=this.findOption(t,this.optionsToDisplay),this.autoDisplayFirst&&!this.placeholder&&!this.selectedOption&&this.optionsToDisplay&&this.optionsToDisplay.length&&!this.editable&&(this.selectedOption=this.group?this.optionsToDisplay[0].items[0]:this.optionsToDisplay[0],this.value=this.getOptionValue(this.selectedOption),this.onModelChange(this.value)),this.selectedOptionUpdated=!0}registerOnChange(t){this.onModelChange=t}registerOnTouched(t){this.onModelTouched=t}setDisabledState(t){this.disabled=t,this.cd.markForCheck()}onMouseclick(t){this.disabled||this.readonly||this.isInputClick(t)||(this.onClick.emit(t),this.accessibleViewChild.nativeElement.focus({preventScroll:!0}),this.overlayVisible?this.hide():this.show(),this.cd.detectChanges())}isInputClick(t){return F.p.hasClass(t.target,"p-dropdown-clear-icon")||t.target.isSameNode(this.accessibleViewChild.nativeElement)||this.editableInputViewChild&&t.target.isSameNode(this.editableInputViewChild.nativeElement)}isEmpty(){return!this.optionsToDisplay||this.optionsToDisplay&&0===this.optionsToDisplay.length}onEditableInputFocus(t){this.focused=!0,this.hide(),this.onFocus.emit(t)}onEditableInputChange(t){this.value=t.target.value,this.updateSelectedOption(this.value),this.onModelChange(this.value),this.onChange.emit({originalEvent:t,value:this.value})}show(){this.overlayVisible=!0,this.cd.markForCheck()}onOverlayAnimationStart(t){if("visible"===t.toState){if(this.itemsWrapper=F.p.findSingle(this.overlayViewChild.overlayViewChild.nativeElement,this.virtualScroll?".p-scroller":".p-dropdown-items-wrapper"),this.virtualScroll&&this.scroller.setContentEl(this.itemsViewChild.nativeElement),this.options&&this.options.length)if(this.virtualScroll){const a=this.selectedOption?this.findOptionIndex(this.getOptionValue(this.selectedOption),this.optionsToDisplay):-1;-1!==a&&this.scroller.scrollToIndex(a)}else{let a=F.p.findSingle(this.itemsWrapper,".p-dropdown-item.p-highlight");a&&a.scrollIntoView({block:"nearest",inline:"center"})}this.filterViewChild&&this.filterViewChild.nativeElement&&(this.preventModelTouched=!0,this.autofocusFilter&&this.filterViewChild.nativeElement.focus()),this.onShow.emit(t)}"void"===t.toState&&(this.itemsWrapper=null,this.onModelTouched(),this.onHide.emit(t))}hide(){this.overlayVisible=!1,this.filter&&this.resetFilterOnHide&&this.resetFilter(),this.cd.markForCheck()}onInputFocus(t){this.focused=!0,this.onFocus.emit(t)}onInputBlur(t){this.focused=!1,this.onBlur.emit(t),this.preventModelTouched||this.onModelTouched(),this.preventModelTouched=!1}findPrevEnabledOption(t){let a;if(this.optionsToDisplay&&this.optionsToDisplay.length){for(let o=t-1;0<=o;o--){let i=this.optionsToDisplay[o];if(!this.isOptionDisabled(i)){a=i;break}}if(!a)for(let o=this.optionsToDisplay.length-1;o>=t;o--){let i=this.optionsToDisplay[o];if(!this.isOptionDisabled(i)){a=i;break}}}return a}findNextEnabledOption(t){let a;if(this.optionsToDisplay&&this.optionsToDisplay.length){for(let o=t+1;o<this.optionsToDisplay.length;o++){let i=this.optionsToDisplay[o];if(!this.isOptionDisabled(i)){a=i;break}}if(!a)for(let o=0;o<t;o++){let i=this.optionsToDisplay[o];if(!this.isOptionDisabled(i)){a=i;break}}}return a}onKeydown(t,a){if(!this.readonly&&this.optionsToDisplay&&null!==this.optionsToDisplay.length)switch(t.which){case 40:if(!this.overlayVisible&&t.altKey)this.show();else if(this.group){let o=this.selectedOption?this.findOptionGroupIndex(this.getOptionValue(this.selectedOption),this.optionsToDisplay):-1;if(-1!==o){let i=o.itemIndex+1;i<this.getOptionGroupChildren(this.optionsToDisplay[o.groupIndex]).length?(this.selectItem(t,this.getOptionGroupChildren(this.optionsToDisplay[o.groupIndex])[i]),this.selectedOptionUpdated=!0):this.optionsToDisplay[o.groupIndex+1]&&(this.selectItem(t,this.getOptionGroupChildren(this.optionsToDisplay[o.groupIndex+1])[0]),this.selectedOptionUpdated=!0)}else this.optionsToDisplay&&this.optionsToDisplay.length>0&&this.selectItem(t,this.getOptionGroupChildren(this.optionsToDisplay[0])[0])}else{let o=this.selectedOption?this.findOptionIndex(this.getOptionValue(this.selectedOption),this.optionsToDisplay):-1,i=this.findNextEnabledOption(o);i&&(this.selectItem(t,i),this.selectedOptionUpdated=!0)}t.preventDefault();break;case 38:if(this.group){let o=this.selectedOption?this.findOptionGroupIndex(this.getOptionValue(this.selectedOption),this.optionsToDisplay):-1;if(-1!==o){let i=o.itemIndex-1;if(i>=0)this.selectItem(t,this.getOptionGroupChildren(this.optionsToDisplay[o.groupIndex])[i]),this.selectedOptionUpdated=!0;else if(i<0){let s=this.optionsToDisplay[o.groupIndex-1];s&&(this.selectItem(t,this.getOptionGroupChildren(s)[this.getOptionGroupChildren(s).length-1]),this.selectedOptionUpdated=!0)}}}else{let o=this.selectedOption?this.findOptionIndex(this.getOptionValue(this.selectedOption),this.optionsToDisplay):-1,i=this.findPrevEnabledOption(o);i&&(this.selectItem(t,i),this.selectedOptionUpdated=!0)}t.preventDefault();break;case 32:a&&(this.overlayVisible?this.hide():this.show(),t.preventDefault());break;case 13:this.overlayVisible&&(!this.filter||this.optionsToDisplay&&this.optionsToDisplay.length>0)?this.hide():this.overlayVisible||this.show(),t.preventDefault();break;case 27:case 9:this.hide();break;default:a&&!t.metaKey&&17!==t.which&&this.search(t)}}search(t){this.searchTimeout&&clearTimeout(this.searchTimeout);const a=t.key;let o;if(this.previousSearchChar=this.currentSearchChar,this.currentSearchChar=a,this.searchValue=this.previousSearchChar===this.currentSearchChar?this.currentSearchChar:this.searchValue?this.searchValue+a:a,this.group){let i=this.selectedOption?this.findOptionGroupIndex(this.getOptionValue(this.selectedOption),this.optionsToDisplay):{groupIndex:0,itemIndex:0};o=this.searchOptionWithinGroup(i)}else{let i=this.selectedOption?this.findOptionIndex(this.getOptionValue(this.selectedOption),this.optionsToDisplay):-1;o=this.searchOption(++i)}o&&!this.isOptionDisabled(o)&&(this.selectItem(t,o),this.selectedOptionUpdated=!0),this.searchTimeout=setTimeout(()=>{this.searchValue=null},250)}searchOption(t){let a;return this.searchValue&&(a=this.searchOptionInRange(t,this.optionsToDisplay.length),a||(a=this.searchOptionInRange(0,t))),a}searchOptionInRange(t,a){for(let o=t;o<a;o++){let i=this.optionsToDisplay[o];if(this.getOptionLabel(i).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))&&!this.isOptionDisabled(i))return i}return null}searchOptionWithinGroup(t){if(this.searchValue){for(let o=t.groupIndex;o<this.optionsToDisplay.length;o++)for(let i=t.groupIndex===o?t.itemIndex+1:0;i<this.getOptionGroupChildren(this.optionsToDisplay[o]).length;i++){let s=this.getOptionGroupChildren(this.optionsToDisplay[o])[i];if(this.getOptionLabel(s).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))&&!this.isOptionDisabled(s))return s}for(let o=0;o<=t.groupIndex;o++)for(let i=0;i<(t.groupIndex===o?t.itemIndex:this.getOptionGroupChildren(this.optionsToDisplay[o]).length);i++){let s=this.getOptionGroupChildren(this.optionsToDisplay[o])[i];if(this.getOptionLabel(s).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))&&!this.isOptionDisabled(s))return s}}return null}findOptionIndex(t,a){let o=-1;if(a)for(let i=0;i<a.length;i++)if(null==t&&null==this.getOptionValue(a[i])||L.gb.equals(t,this.getOptionValue(a[i]),this.dataKey)){o=i;break}return o}findOptionGroupIndex(t,a){let o,i;if(a)for(let s=0;s<a.length&&(o=s,i=this.findOptionIndex(t,this.getOptionGroupChildren(a[s])),-1===i);s++);return-1!==i?{groupIndex:o,itemIndex:i}:-1}findOption(t,a,o){if(this.group&&!o){let i;if(a&&a.length)for(let s of a)if(i=this.findOption(t,this.getOptionGroupChildren(s),!0),i)break;return i}{let i=this.findOptionIndex(t,a);return-1!=i?a[i]:null}}onFilterInputChange(t){let a=t.target.value;a&&a.length?(this._filterValue=a,this.activateFilter()):(this._filterValue=null,this.optionsToDisplay=this.options),this.virtualScroll&&this.scroller.scrollToIndex(0),this.optionsChanged=!0,this.onFilter.emit({originalEvent:t,filter:this._filterValue})}activateFilter(){let t=(this.filterBy||this.optionLabel||"label").split(",");if(this.options&&this.options.length){if(this.group){let a=[];for(let o of this.options){let i=this.filterService.filter(this.getOptionGroupChildren(o),t,this.filterValue,this.filterMatchMode,this.filterLocale);i&&i.length&&a.push({...o,[this.optionGroupChildren]:i})}this.optionsToDisplay=a}else this.optionsToDisplay=this.filterService.filter(this.options,t,this.filterValue,this.filterMatchMode,this.filterLocale);this.optionsChanged=!0}}applyFocus(){this.editable?F.p.findSingle(this.el.nativeElement,".p-dropdown-label.p-inputtext").focus():F.p.findSingle(this.el.nativeElement,"input[readonly]").focus()}focus(){this.applyFocus()}clear(t){this.value=null,this.onModelChange(this.value),this.onChange.emit({originalEvent:t,value:this.value}),this.updateSelectedOption(this.value),this.updateEditableLabel(),this.onClear.emit(t)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.SBq),e.Y36(e.Qsj),e.Y36(e.sBO),e.Y36(e.R0b),e.Y36(H.iZ),e.Y36(H.b4))},n.\u0275cmp=e.Xpm({type:n,selectors:[["p-dropdown"]],contentQueries:function(t,a,o){if(1&t&&e.Suo(o,H.jx,4),2&t){let i;e.iGM(i=e.CRH())&&(a.templates=i)}},viewQuery:function(t,a){if(1&t&&(e.Gf(Ti,5),e.Gf(Ci,5),e.Gf(Zi,5),e.Gf(Di,5),e.Gf(vi,5),e.Gf(bi,5),e.Gf(yi,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.containerViewChild=o.first),e.iGM(o=e.CRH())&&(a.filterViewChild=o.first),e.iGM(o=e.CRH())&&(a.accessibleViewChild=o.first),e.iGM(o=e.CRH())&&(a.editableInputViewChild=o.first),e.iGM(o=e.CRH())&&(a.itemsViewChild=o.first),e.iGM(o=e.CRH())&&(a.scroller=o.first),e.iGM(o=e.CRH())&&(a.overlayViewChild=o.first)}},hostAttrs:[1,"p-element","p-inputwrapper"],hostVars:4,hostBindings:function(t,a){2&t&&e.ekj("p-inputwrapper-filled",a.filled)("p-inputwrapper-focus",a.focused||a.overlayVisible)},inputs:{scrollHeight:"scrollHeight",filter:"filter",name:"name",style:"style",panelStyle:"panelStyle",styleClass:"styleClass",panelStyleClass:"panelStyleClass",readonly:"readonly",required:"required",editable:"editable",appendTo:"appendTo",tabindex:"tabindex",placeholder:"placeholder",filterPlaceholder:"filterPlaceholder",filterLocale:"filterLocale",inputId:"inputId",selectId:"selectId",dataKey:"dataKey",filterBy:"filterBy",autofocus:"autofocus",resetFilterOnHide:"resetFilterOnHide",dropdownIcon:"dropdownIcon",optionLabel:"optionLabel",optionValue:"optionValue",optionDisabled:"optionDisabled",optionGroupLabel:"optionGroupLabel",optionGroupChildren:"optionGroupChildren",autoDisplayFirst:"autoDisplayFirst",group:"group",showClear:"showClear",emptyFilterMessage:"emptyFilterMessage",emptyMessage:"emptyMessage",lazy:"lazy",virtualScroll:"virtualScroll",virtualScrollItemSize:"virtualScrollItemSize",virtualScrollOptions:"virtualScrollOptions",overlayOptions:"overlayOptions",ariaFilterLabel:"ariaFilterLabel",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",filterMatchMode:"filterMatchMode",maxlength:"maxlength",tooltip:"tooltip",tooltipPosition:"tooltipPosition",tooltipPositionStyle:"tooltipPositionStyle",tooltipStyleClass:"tooltipStyleClass",autofocusFilter:"autofocusFilter",overlayDirection:"overlayDirection",disabled:"disabled",itemSize:"itemSize",autoZIndex:"autoZIndex",baseZIndex:"baseZIndex",showTransitionOptions:"showTransitionOptions",hideTransitionOptions:"hideTransitionOptions",options:"options",filterValue:"filterValue"},outputs:{onChange:"onChange",onFilter:"onFilter",onFocus:"onFocus",onBlur:"onBlur",onClick:"onClick",onShow:"onShow",onHide:"onHide",onClear:"onClear",onLazyLoad:"onLazyLoad"},features:[e._Bn([_r])],decls:14,vars:32,consts:[[3,"ngClass","ngStyle","click"],["container",""],[1,"p-hidden-accessible"],["type","text","readonly","","aria-haspopup","listbox","aria-haspopup","listbox","pAutoFocus","","role","combobox",3,"disabled","autofocus","focus","blur","keydown"],["in",""],[3,"ngClass","pTooltip","tooltipPosition","positionStyle","tooltipStyleClass",4,"ngIf"],[3,"ngClass",4,"ngIf"],["type","text","class","p-dropdown-label p-inputtext","aria-haspopup","listbox",3,"disabled","input","focus","blur",4,"ngIf"],["class","p-dropdown-clear-icon pi pi-times",3,"click",4,"ngIf"],["role","button","aria-label","dropdown trigger","aria-haspopup","listbox",1,"p-dropdown-trigger"],[1,"p-dropdown-trigger-icon",3,"ngClass"],[3,"visible","options","target","appendTo","autoZIndex","baseZIndex","showTransitionOptions","hideTransitionOptions","visibleChange","onAnimationStart","onHide"],["overlay",""],["pTemplate","content"],[3,"ngClass","pTooltip","tooltipPosition","positionStyle","tooltipStyleClass"],[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngClass"],["type","text","aria-haspopup","listbox",1,"p-dropdown-label","p-inputtext",3,"disabled","input","focus","blur"],["editableInput",""],[1,"p-dropdown-clear-icon","pi","pi-times",3,"click"],[3,"ngClass","ngStyle"],[4,"ngTemplateOutlet"],["class","p-dropdown-header",3,"click",4,"ngIf"],[1,"p-dropdown-items-wrapper"],[3,"items","style","itemSize","autoSize","lazy","options","onLazyLoad",4,"ngIf"],["buildInItems",""],[1,"p-dropdown-header",3,"click"],[4,"ngIf","ngIfElse"],["builtInFilterElement",""],[1,"p-dropdown-filter-container"],["type","text","autocomplete","off",1,"p-dropdown-filter","p-inputtext","p-component",3,"value","keydown.enter","keydown","input"],["filter",""],[1,"p-dropdown-filter-icon","pi","pi-search"],[3,"items","itemSize","autoSize","lazy","options","onLazyLoad"],["scroller",""],["pTemplate","loader"],["role","listbox",1,"p-dropdown-items",3,"ngClass"],["items",""],["itemslist",""],["class","p-dropdown-empty-message",3,"ngStyle",4,"ngIf"],["ngFor","",3,"ngForOf"],[1,"p-dropdown-item-group",3,"ngStyle"],[3,"option","selected","label","disabled","template","onClick"],[1,"p-dropdown-empty-message",3,"ngStyle"],["emptyFilter",""],["empty",""]],template:function(t,a){1&t&&(e.TgZ(0,"div",0,1),e.NdJ("click",function(i){return a.onMouseclick(i)}),e.TgZ(2,"div",2)(3,"input",3,4),e.NdJ("focus",function(i){return a.onInputFocus(i)})("blur",function(i){return a.onInputBlur(i)})("keydown",function(i){return a.onKeydown(i,!0)}),e.qZA()(),e.YNc(5,Fi,3,13,"span",5),e.YNc(6,qi,2,4,"span",6),e.YNc(7,Ii,2,4,"input",7),e.YNc(8,Pi,1,0,"i",8),e.TgZ(9,"div",9),e._UZ(10,"span",10),e.qZA(),e.TgZ(11,"p-overlay",11,12),e.NdJ("visibleChange",function(i){return a.overlayVisible=i})("onAnimationStart",function(i){return a.onOverlayAnimationStart(i)})("onHide",function(){return a.hide()}),e.YNc(13,dr,9,11,"ng-template",13),e.qZA()()),2&t&&(e.Tol(a.styleClass),e.Q6J("ngClass",e.l5B(27,ur,a.disabled,a.overlayVisible,a.focused,a.showClear&&!a.disabled))("ngStyle",a.style),e.xp6(3),e.Q6J("disabled",a.disabled)("autofocus",a.autofocus),e.uIk("id",a.inputId)("placeholder",a.placeholder)("aria-label",a.ariaLabel)("aria-expanded",!1)("aria-labelledby",a.ariaLabelledBy)("tabindex",a.tabindex)("aria-activedescendant",a.overlayVisible?a.labelId:null),e.xp6(2),e.Q6J("ngIf",!a.editable&&null!=a.label),e.xp6(1),e.Q6J("ngIf",!a.editable&&null==a.label),e.xp6(1),e.Q6J("ngIf",a.editable),e.xp6(1),e.Q6J("ngIf",a.isVisibleClearIcon),e.xp6(1),e.uIk("aria-expanded",a.overlayVisible),e.xp6(1),e.Q6J("ngClass",a.dropdownIcon),e.xp6(1),e.Q6J("visible",a.overlayVisible)("options",a.overlayOptions)("target","@parent")("appendTo",a.appendTo)("autoZIndex",a.autoZIndex)("baseZIndex",a.baseZIndex)("showTransitionOptions",a.showTransitionOptions)("hideTransitionOptions",a.hideTransitionOptions))},dependencies:[p.mk,p.sg,p.O5,p.tP,p.PC,Ce.aV,H.jx,qe.u,re.T,mi,mr],styles:[".p-dropdown{display:inline-flex;cursor:pointer;position:relative;-webkit-user-select:none;user-select:none}.p-dropdown-clear-icon{position:absolute;top:50%;margin-top:-.5rem}.p-dropdown-trigger{display:flex;align-items:center;justify-content:center;flex-shrink:0}.p-dropdown-label{display:block;white-space:nowrap;overflow:hidden;flex:1 1 auto;width:1%;text-overflow:ellipsis;cursor:pointer}.p-dropdown-label-empty{overflow:hidden;visibility:hidden}input.p-dropdown-label{cursor:default}.p-dropdown-items-wrapper{overflow:auto}.p-dropdown-item{cursor:pointer;font-weight:400;white-space:nowrap;position:relative;overflow:hidden}.p-dropdown-items{margin:0;padding:0;list-style-type:none}.p-dropdown-filter{width:100%}.p-dropdown-filter-container{position:relative}.p-dropdown-filter-icon{position:absolute;top:50%;margin-top:-.5rem}.p-fluid .p-dropdown{display:flex}.p-fluid .p-dropdown .p-dropdown-label{width:1%}\n"],encapsulation:2,changeDetection:0}),n})(),Je=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[p.ez,Ce.U8,H.m8,qe.z,ie.T,re.v,gi,Ce.U8,H.m8,re.v]}),n})();var Le=g(35593),Ue=g(51740);const gr=["input"];function hr(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"i",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clear())}),e.qZA()}}const Qe=function(){return{"p-inputnumber-button p-inputnumber-button-up":!0}},ke=function(){return{"p-inputnumber-button p-inputnumber-button-down":!0}};function fr(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",7)(1,"button",8),e.NdJ("mousedown",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onUpButtonMouseDown(o))})("mouseup",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onUpButtonMouseUp())})("mouseleave",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onUpButtonMouseLeave())})("keydown",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onUpButtonKeyDown(o))})("keyup",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onUpButtonKeyUp())}),e.qZA(),e.TgZ(2,"button",8),e.NdJ("mousedown",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onDownButtonMouseDown(o))})("mouseup",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onDownButtonMouseUp())})("mouseleave",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onDownButtonMouseLeave())})("keydown",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onDownButtonKeyDown(o))})("keyup",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onDownButtonKeyUp())}),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(1),e.Tol(t.incrementButtonClass),e.Q6J("ngClass",e.DdM(10,Qe))("icon",t.incrementButtonIcon)("disabled",t.disabled),e.xp6(1),e.Tol(t.decrementButtonClass),e.Q6J("ngClass",e.DdM(11,ke))("icon",t.decrementButtonIcon)("disabled",t.disabled)}}function xr(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",8),e.NdJ("mousedown",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onUpButtonMouseDown(o))})("mouseup",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onUpButtonMouseUp())})("mouseleave",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onUpButtonMouseLeave())})("keydown",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onUpButtonKeyDown(o))})("keyup",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onUpButtonKeyUp())}),e.qZA()}if(2&n){const t=e.oxw();e.Tol(t.incrementButtonClass),e.Q6J("ngClass",e.DdM(5,Qe))("icon",t.incrementButtonIcon)("disabled",t.disabled)}}function Tr(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",8),e.NdJ("mousedown",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onDownButtonMouseDown(o))})("mouseup",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onDownButtonMouseUp())})("mouseleave",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onDownButtonMouseLeave())})("keydown",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onDownButtonKeyDown(o))})("keyup",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onDownButtonKeyUp())}),e.qZA()}if(2&n){const t=e.oxw();e.Tol(t.decrementButtonClass),e.Q6J("ngClass",e.DdM(5,ke))("icon",t.decrementButtonIcon)("disabled",t.disabled)}}const Cr=function(n,r,t){return{"p-inputnumber p-component":!0,"p-inputnumber-buttons-stacked":n,"p-inputnumber-buttons-horizontal":r,"p-inputnumber-buttons-vertical":t}},Zr={provide:d.JU,useExisting:(0,e.Gpc)(()=>Ee),multi:!0};let Ee=(()=>{class n{constructor(t,a){this.el=t,this.cd=a,this.showButtons=!1,this.format=!0,this.buttonLayout="stacked",this.incrementButtonIcon="pi pi-angle-up",this.decrementButtonIcon="pi pi-angle-down",this.readonly=!1,this.step=1,this.allowEmpty=!0,this.mode="decimal",this.useGrouping=!0,this.showClear=!1,this.onInput=new e.vpe,this.onFocus=new e.vpe,this.onBlur=new e.vpe,this.onKeyDown=new e.vpe,this.onClear=new e.vpe,this.onModelChange=()=>{},this.onModelTouched=()=>{},this.groupChar="",this.prefixChar="",this.suffixChar=""}get disabled(){return this._disabled}set disabled(t){t&&(this.focused=!1),this._disabled=t,this.timer&&this.clearTimer()}ngOnChanges(t){["locale","localeMatcher","mode","currency","currencyDisplay","useGrouping","minFractionDigits","maxFractionDigits","prefix","suffix"].some(o=>!!t[o])&&this.updateConstructParser()}ngOnInit(){this.constructParser(),this.initialized=!0}getOptions(){return{localeMatcher:this.localeMatcher,style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,useGrouping:this.useGrouping,minimumFractionDigits:this.minFractionDigits,maximumFractionDigits:this.maxFractionDigits}}constructParser(){this.numberFormat=new Intl.NumberFormat(this.locale,this.getOptions());const t=[...new Intl.NumberFormat(this.locale,{useGrouping:!1}).format(9876543210)].reverse(),a=new Map(t.map((o,i)=>[o,i]));this._numeral=new RegExp(`[${t.join("")}]`,"g"),this._group=this.getGroupingExpression(),this._minusSign=this.getMinusSignExpression(),this._currency=this.getCurrencyExpression(),this._decimal=this.getDecimalExpression(),this._suffix=this.getSuffixExpression(),this._prefix=this.getPrefixExpression(),this._index=o=>a.get(o)}updateConstructParser(){this.initialized&&this.constructParser()}escapeRegExp(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}getDecimalExpression(){const t=new Intl.NumberFormat(this.locale,{...this.getOptions(),useGrouping:!1});return new RegExp(`[${t.format(1.1).replace(this._currency,"").trim().replace(this._numeral,"")}]`,"g")}getGroupingExpression(){const t=new Intl.NumberFormat(this.locale,{useGrouping:!0});return this.groupChar=t.format(1e6).trim().replace(this._numeral,"").charAt(0),new RegExp(`[${this.groupChar}]`,"g")}getMinusSignExpression(){const t=new Intl.NumberFormat(this.locale,{useGrouping:!1});return new RegExp(`[${t.format(-1).trim().replace(this._numeral,"")}]`,"g")}getCurrencyExpression(){if(this.currency){const t=new Intl.NumberFormat(this.locale,{style:"currency",currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});return new RegExp(`[${t.format(1).replace(/\s/g,"").replace(this._numeral,"").replace(this._group,"")}]`,"g")}return new RegExp("[]","g")}getPrefixExpression(){if(this.prefix)this.prefixChar=this.prefix;else{const t=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay});this.prefixChar=t.format(1).split("1")[0]}return new RegExp(`${this.escapeRegExp(this.prefixChar||"")}`,"g")}getSuffixExpression(){if(this.suffix)this.suffixChar=this.suffix;else{const t=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});this.suffixChar=t.format(1).split("1")[1]}return new RegExp(`${this.escapeRegExp(this.suffixChar||"")}`,"g")}formatValue(t){if(null!=t){if("-"===t)return t;if(this.format){let o=new Intl.NumberFormat(this.locale,this.getOptions()).format(t);return this.prefix&&(o=this.prefix+o),this.suffix&&(o+=this.suffix),o}return t.toString()}return""}parseValue(t){let a=t.replace(this._suffix,"").replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").replace(this._group,"").replace(this._minusSign,"-").replace(this._decimal,".").replace(this._numeral,this._index);if(a){if("-"===a)return a;let o=+a;return isNaN(o)?null:o}return null}repeat(t,a,o){if(this.readonly)return;let i=a||500;this.clearTimer(),this.timer=setTimeout(()=>{this.repeat(t,40,o)},i),this.spin(t,o)}spin(t,a){let o=this.step*a,i=this.parseValue(this.input.nativeElement.value)||0,s=this.validateValue(i+o);this.maxlength&&this.maxlength<this.formatValue(s).length||(this.updateInput(s,null,"spin",null),this.updateModel(t,s),this.handleOnInput(t,i,s))}clear(){this.value=null,this.onModelChange(this.value),this.onClear.emit()}onUpButtonMouseDown(t){this.input.nativeElement.focus(),this.repeat(t,null,1),t.preventDefault()}onUpButtonMouseUp(){this.clearTimer()}onUpButtonMouseLeave(){this.clearTimer()}onUpButtonKeyDown(t){(32===t.keyCode||13===t.keyCode)&&this.repeat(t,null,1)}onUpButtonKeyUp(){this.clearTimer()}onDownButtonMouseDown(t){this.input.nativeElement.focus(),this.repeat(t,null,-1),t.preventDefault()}onDownButtonMouseUp(){this.clearTimer()}onDownButtonMouseLeave(){this.clearTimer()}onDownButtonKeyUp(){this.clearTimer()}onDownButtonKeyDown(t){(32===t.keyCode||13===t.keyCode)&&this.repeat(t,null,-1)}onUserInput(t){this.readonly||(this.isSpecialChar&&(t.target.value=this.lastValue),this.isSpecialChar=!1)}onInputKeyDown(t){if(this.readonly)return;if(this.lastValue=t.target.value,t.shiftKey||t.altKey)return void(this.isSpecialChar=!0);let a=t.target.selectionStart,o=t.target.selectionEnd,i=t.target.value,s=null;switch(t.altKey&&t.preventDefault(),t.which){case 38:this.spin(t,1),t.preventDefault();break;case 40:this.spin(t,-1),t.preventDefault();break;case 37:this.isNumeralChar(i.charAt(a-1))||t.preventDefault();break;case 39:this.isNumeralChar(i.charAt(a))||t.preventDefault();break;case 13:s=this.validateValue(this.parseValue(this.input.nativeElement.value)),this.input.nativeElement.value=this.formatValue(s),this.input.nativeElement.setAttribute("aria-valuenow",s),this.updateModel(t,s);break;case 8:if(t.preventDefault(),a===o){const c=i.charAt(a-1),{decimalCharIndex:u,decimalCharIndexWithoutPrefix:w}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(c)){const v=this.getDecimalLength(i);if(this._group.test(c))this._group.lastIndex=0,s=i.slice(0,a-2)+i.slice(a-1);else if(this._decimal.test(c))this._decimal.lastIndex=0,v?this.input.nativeElement.setSelectionRange(a-1,a-1):s=i.slice(0,a-1)+i.slice(a);else if(u>0&&a>u){const Q=this.isDecimalMode()&&(this.minFractionDigits||0)<v?"":"0";s=i.slice(0,a-1)+Q+i.slice(a)}else 1===w?(s=i.slice(0,a-1)+"0"+i.slice(a),s=this.parseValue(s)>0?s:""):s=i.slice(0,a-1)+i.slice(a)}this.updateValue(t,s,null,"delete-single")}else s=this.deleteRange(i,a,o),this.updateValue(t,s,null,"delete-range");break;case 46:if(t.preventDefault(),a===o){const c=i.charAt(a),{decimalCharIndex:u,decimalCharIndexWithoutPrefix:w}=this.getDecimalCharIndexes(i);if(this.isNumeralChar(c)){const v=this.getDecimalLength(i);if(this._group.test(c))this._group.lastIndex=0,s=i.slice(0,a)+i.slice(a+2);else if(this._decimal.test(c))this._decimal.lastIndex=0,v?this.input.nativeElement.setSelectionRange(a+1,a+1):s=i.slice(0,a)+i.slice(a+1);else if(u>0&&a>u){const Q=this.isDecimalMode()&&(this.minFractionDigits||0)<v?"":"0";s=i.slice(0,a)+Q+i.slice(a+1)}else 1===w?(s=i.slice(0,a)+"0"+i.slice(a+1),s=this.parseValue(s)>0?s:""):s=i.slice(0,a)+i.slice(a+1)}this.updateValue(t,s,null,"delete-back-single")}else s=this.deleteRange(i,a,o),this.updateValue(t,s,null,"delete-range")}this.onKeyDown.emit(t)}onInputKeyPress(t){if(this.readonly)return;let a=t.which||t.keyCode,o=String.fromCharCode(a);const i=this.isDecimalSign(o),s=this.isMinusSign(o);13!=a&&t.preventDefault(),(48<=a&&a<=57||s||i)&&this.insert(t,o,{isDecimalSign:i,isMinusSign:s})}onPaste(t){if(!this.disabled&&!this.readonly){t.preventDefault();let a=(t.clipboardData||window.clipboardData).getData("Text");if(a){let o=this.parseValue(a);null!=o&&this.insert(t,o.toString())}}}allowMinusSign(){return null==this.min||this.min<0}isMinusSign(t){return!(!this._minusSign.test(t)&&"-"!==t||(this._minusSign.lastIndex=0,0))}isDecimalSign(t){return!!this._decimal.test(t)&&(this._decimal.lastIndex=0,!0)}isDecimalMode(){return"decimal"===this.mode}getDecimalCharIndexes(t){let a=t.search(this._decimal);this._decimal.lastIndex=0;const i=t.replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").search(this._decimal);return this._decimal.lastIndex=0,{decimalCharIndex:a,decimalCharIndexWithoutPrefix:i}}getCharIndexes(t){const a=t.search(this._decimal);this._decimal.lastIndex=0;const o=t.search(this._minusSign);this._minusSign.lastIndex=0;const i=t.search(this._suffix);this._suffix.lastIndex=0;const s=t.search(this._currency);return this._currency.lastIndex=0,{decimalCharIndex:a,minusCharIndex:o,suffixCharIndex:i,currencyCharIndex:s}}insert(t,a,o={isDecimalSign:!1,isMinusSign:!1}){const i=a.search(this._minusSign);if(this._minusSign.lastIndex=0,!this.allowMinusSign()&&-1!==i)return;let s=this.input.nativeElement.selectionStart,c=this.input.nativeElement.selectionEnd,u=this.input.nativeElement.value.trim();const{decimalCharIndex:w,minusCharIndex:v,suffixCharIndex:Q,currencyCharIndex:J}=this.getCharIndexes(u);let P;if(o.isMinusSign)0===s&&(P=u,(-1===v||0!==c)&&(P=this.insertText(u,a,0,c)),this.updateValue(t,P,a,"insert"));else if(o.isDecimalSign)w>0&&s===w?this.updateValue(t,u,a,"insert"):(w>s&&w<c||-1===w&&this.maxFractionDigits)&&(P=this.insertText(u,a,s,c),this.updateValue(t,P,a,"insert"));else{const G=this.numberFormat.resolvedOptions().maximumFractionDigits,k=s!==c?"range-insert":"insert";if(w>0&&s>w){if(s+a.length-(w+1)<=G){const z=J>=s?J-1:Q>=s?Q:u.length;P=u.slice(0,s)+a+u.slice(s+a.length,z)+u.slice(z),this.updateValue(t,P,a,k)}}else P=this.insertText(u,a,s,c),this.updateValue(t,P,a,k)}}insertText(t,a,o,i){if(2===("."===a?a:a.split(".")).length){const c=t.slice(o,i).search(this._decimal);return this._decimal.lastIndex=0,c>0?t.slice(0,o)+this.formatValue(a)+t.slice(i):t||this.formatValue(a)}return i-o===t.length?this.formatValue(a):0===o?a+t.slice(i):i===t.length?t.slice(0,o)+a:t.slice(0,o)+a+t.slice(i)}deleteRange(t,a,o){let i;return i=o-a===t.length?"":0===a?t.slice(o):o===t.length?t.slice(0,a):t.slice(0,a)+t.slice(o),i}initCursor(){let t=this.input.nativeElement.selectionStart,a=this.input.nativeElement.value,o=a.length,i=null,s=(this.prefixChar||"").length;a=a.replace(this._prefix,""),t-=s;let c=a.charAt(t);if(this.isNumeralChar(c))return t+s;let u=t-1;for(;u>=0;){if(c=a.charAt(u),this.isNumeralChar(c)){i=u+s;break}u--}if(null!==i)this.input.nativeElement.setSelectionRange(i+1,i+1);else{for(u=t;u<o;){if(c=a.charAt(u),this.isNumeralChar(c)){i=u+s;break}u++}null!==i&&this.input.nativeElement.setSelectionRange(i,i)}return i||0}onInputClick(){!this.readonly&&this.input.nativeElement.value!==F.p.getSelection()&&this.initCursor()}isNumeralChar(t){return!(1!==t.length||!(this._numeral.test(t)||this._decimal.test(t)||this._group.test(t)||this._minusSign.test(t))||(this.resetRegex(),0))}resetRegex(){this._numeral.lastIndex=0,this._decimal.lastIndex=0,this._group.lastIndex=0,this._minusSign.lastIndex=0}updateValue(t,a,o,i){let s=this.input.nativeElement.value,c=null;null!=a&&(c=this.parseValue(a),c=c||this.allowEmpty?c:0,this.updateInput(c,o,i,a),this.handleOnInput(t,s,c))}handleOnInput(t,a,o){this.isValueChanged(a,o)&&this.onInput.emit({originalEvent:t,value:o,formattedValue:a})}isValueChanged(t,a){return null===a&&null!==t||null!=a&&a!==("string"==typeof t?this.parseValue(t):t)}validateValue(t){return"-"===t||null==t?null:null!=this.min&&t<this.min?this.min:null!=this.max&&t>this.max?this.max:t}updateInput(t,a,o,i){a=a||"";let s=this.input.nativeElement.value,c=this.formatValue(t),u=s.length;if(c!==i&&(c=this.concatValues(c,i)),0===u){this.input.nativeElement.value=c,this.input.nativeElement.setSelectionRange(0,0);const v=this.initCursor()+a.length;this.input.nativeElement.setSelectionRange(v,v)}else{let w=this.input.nativeElement.selectionStart,v=this.input.nativeElement.selectionEnd;if(this.maxlength&&this.maxlength<c.length)return;this.input.nativeElement.value=c;let Q=c.length;if("range-insert"===o){const J=this.parseValue((s||"").slice(0,w)),G=(null!==J?J.toString():"").split("").join(`(${this.groupChar})?`),k=new RegExp(G,"g");k.test(c);const z=a.split("").join(`(${this.groupChar})?`),ae=new RegExp(z,"g");ae.test(c.slice(k.lastIndex)),v=k.lastIndex+ae.lastIndex,this.input.nativeElement.setSelectionRange(v,v)}else if(Q===u)"insert"===o||"delete-back-single"===o?this.input.nativeElement.setSelectionRange(v+1,v+1):"delete-single"===o?this.input.nativeElement.setSelectionRange(v-1,v-1):("delete-range"===o||"spin"===o)&&this.input.nativeElement.setSelectionRange(v,v);else if("delete-back-single"===o){let J=s.charAt(v-1),P=s.charAt(v),G=u-Q,k=this._group.test(P);k&&1===G?v+=1:!k&&this.isNumeralChar(J)&&(v+=-1*G+1),this._group.lastIndex=0,this.input.nativeElement.setSelectionRange(v,v)}else if("-"===s&&"insert"===o){this.input.nativeElement.setSelectionRange(0,0);const P=this.initCursor()+a.length+1;this.input.nativeElement.setSelectionRange(P,P)}else v+=Q-u,this.input.nativeElement.setSelectionRange(v,v)}this.input.nativeElement.setAttribute("aria-valuenow",t)}concatValues(t,a){if(t&&a){let o=a.search(this._decimal);return this._decimal.lastIndex=0,this.suffixChar?t.replace(this.suffixChar,"").split(this._decimal)[0]+a.replace(this.suffixChar,"").slice(o)+this.suffixChar:-1!==o?t.split(this._decimal)[0]+a.slice(o):t}return t}getDecimalLength(t){if(t){const a=t.split(this._decimal);if(2===a.length)return a[1].replace(this._suffix,"").trim().replace(/\s/g,"").replace(this._currency,"").length}return 0}onInputFocus(t){this.focused=!0,this.onFocus.emit(t)}onInputBlur(t){this.focused=!1;let a=this.validateValue(this.parseValue(this.input.nativeElement.value));this.input.nativeElement.value=this.formatValue(a),this.input.nativeElement.setAttribute("aria-valuenow",a),this.updateModel(t,a),this.onBlur.emit(t)}formattedValue(){return this.formatValue(this.value||this.allowEmpty?this.value:0)}updateModel(t,a){this.value!==a&&(this.value=a,this.onModelChange(a)),this.onModelTouched()}writeValue(t){this.value=t,this.cd.markForCheck()}registerOnChange(t){this.onModelChange=t}registerOnTouched(t){this.onModelTouched=t}setDisabledState(t){this.disabled=t,this.cd.markForCheck()}get filled(){return null!=this.value&&this.value.toString().length>0}clearTimer(){this.timer&&clearInterval(this.timer)}getFormatter(){return this.numberFormat}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.SBq),e.Y36(e.sBO))},n.\u0275cmp=e.Xpm({type:n,selectors:[["p-inputNumber"]],viewQuery:function(t,a){if(1&t&&e.Gf(gr,5),2&t){let o;e.iGM(o=e.CRH())&&(a.input=o.first)}},hostAttrs:[1,"p-element","p-inputwrapper"],hostVars:6,hostBindings:function(t,a){2&t&&e.ekj("p-inputwrapper-filled",a.filled)("p-inputwrapper-focus",a.focused)("p-inputnumber-clearable",a.showClear&&"vertical"!=a.buttonLayout)},inputs:{showButtons:"showButtons",format:"format",buttonLayout:"buttonLayout",inputId:"inputId",styleClass:"styleClass",style:"style",placeholder:"placeholder",size:"size",maxlength:"maxlength",tabindex:"tabindex",title:"title",ariaLabel:"ariaLabel",ariaRequired:"ariaRequired",name:"name",required:"required",autocomplete:"autocomplete",min:"min",max:"max",incrementButtonClass:"incrementButtonClass",decrementButtonClass:"decrementButtonClass",incrementButtonIcon:"incrementButtonIcon",decrementButtonIcon:"decrementButtonIcon",readonly:"readonly",step:"step",allowEmpty:"allowEmpty",locale:"locale",localeMatcher:"localeMatcher",mode:"mode",currency:"currency",currencyDisplay:"currencyDisplay",useGrouping:"useGrouping",minFractionDigits:"minFractionDigits",maxFractionDigits:"maxFractionDigits",prefix:"prefix",suffix:"suffix",inputStyle:"inputStyle",inputStyleClass:"inputStyleClass",showClear:"showClear",disabled:"disabled"},outputs:{onInput:"onInput",onFocus:"onFocus",onBlur:"onBlur",onKeyDown:"onKeyDown",onClear:"onClear"},features:[e._Bn([Zr]),e.TTD],decls:7,vars:32,consts:[[3,"ngClass","ngStyle"],["pInputText","","inputmode","decimal",3,"ngClass","ngStyle","value","disabled","readonly","input","keydown","keypress","paste","click","focus","blur"],["input",""],["class","p-inputnumber-clear-icon pi pi-times",3,"click",4,"ngIf"],["class","p-inputnumber-button-group",4,"ngIf"],["type","button","pButton","","tabindex","-1",3,"ngClass","class","icon","disabled","mousedown","mouseup","mouseleave","keydown","keyup",4,"ngIf"],[1,"p-inputnumber-clear-icon","pi","pi-times",3,"click"],[1,"p-inputnumber-button-group"],["type","button","pButton","","tabindex","-1",3,"ngClass","icon","disabled","mousedown","mouseup","mouseleave","keydown","keyup"]],template:function(t,a){1&t&&(e.TgZ(0,"span",0)(1,"input",1,2),e.NdJ("input",function(i){return a.onUserInput(i)})("keydown",function(i){return a.onInputKeyDown(i)})("keypress",function(i){return a.onInputKeyPress(i)})("paste",function(i){return a.onPaste(i)})("click",function(){return a.onInputClick()})("focus",function(i){return a.onInputFocus(i)})("blur",function(i){return a.onInputBlur(i)}),e.qZA(),e.YNc(3,hr,1,0,"i",3),e.YNc(4,fr,3,12,"span",4),e.YNc(5,xr,1,6,"button",5),e.YNc(6,Tr,1,6,"button",5),e.qZA()),2&t&&(e.Tol(a.styleClass),e.Q6J("ngClass",e.kEZ(28,Cr,a.showButtons&&"stacked"===a.buttonLayout,a.showButtons&&"horizontal"===a.buttonLayout,a.showButtons&&"vertical"===a.buttonLayout))("ngStyle",a.style),e.xp6(1),e.Tol(a.inputStyleClass),e.Q6J("ngClass","p-inputnumber-input")("ngStyle",a.inputStyle)("value",a.formattedValue())("disabled",a.disabled)("readonly",a.readonly),e.uIk("placeholder",a.placeholder)("title",a.title)("id",a.inputId)("size",a.size)("name",a.name)("autocomplete",a.autocomplete)("maxlength",a.maxlength)("tabindex",a.tabindex)("aria-label",a.ariaLabel)("aria-required",a.ariaRequired)("required",a.required)("min",a.min)("max",a.max),e.xp6(2),e.Q6J("ngIf","vertical"!=a.buttonLayout&&a.showClear&&a.value),e.xp6(1),e.Q6J("ngIf",a.showButtons&&"stacked"===a.buttonLayout),e.xp6(1),e.Q6J("ngIf",a.showButtons&&"stacked"!==a.buttonLayout),e.xp6(1),e.Q6J("ngIf",a.showButtons&&"stacked"!==a.buttonLayout))},dependencies:[p.mk,p.O5,p.PC,Ue.o,Le.Hq],styles:["p-inputnumber,.p-inputnumber{display:inline-flex}.p-inputnumber-button{display:flex;align-items:center;justify-content:center;flex:0 0 auto}.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button .p-button-label,.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button .p-button-label{display:none}.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-up{border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0;padding:0}.p-inputnumber-buttons-stacked .p-inputnumber-input{border-top-right-radius:0;border-bottom-right-radius:0}.p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-down{border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:0;padding:0}.p-inputnumber-buttons-stacked .p-inputnumber-button-group{display:flex;flex-direction:column}.p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button{flex:1 1 auto}.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up{order:3;border-top-left-radius:0;border-bottom-left-radius:0}.p-inputnumber-buttons-horizontal .p-inputnumber-input{order:2;border-radius:0}.p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down{order:1;border-top-right-radius:0;border-bottom-right-radius:0}.p-inputnumber-buttons-vertical{flex-direction:column}.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up{order:1;border-bottom-left-radius:0;border-bottom-right-radius:0;width:100%}.p-inputnumber-buttons-vertical .p-inputnumber-input{order:2;border-radius:0;text-align:center}.p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down{order:3;border-top-left-radius:0;border-top-right-radius:0;width:100%}.p-inputnumber-input{flex:1 1 auto}.p-fluid p-inputnumber,.p-fluid .p-inputnumber{width:100%}.p-fluid .p-inputnumber .p-inputnumber-input{width:1%}.p-fluid .p-inputnumber-buttons-vertical .p-inputnumber-input{width:100%}.p-inputnumber-clear-icon{position:absolute;top:50%;margin-top:-.5rem;cursor:pointer}.p-inputnumber-clearable{position:relative}\n"],encapsulation:2,changeDetection:0}),n})(),Ye=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[p.ez,Ue.j,Le.hJ]}),n})();function Dr(n,r){1&n&&e.GkF(0)}const De=function(n){return{$implicit:n}};function vr(n,r){if(1&n&&(e.TgZ(0,"div",15),e.YNc(1,Dr,1,0,"ng-container",16),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngTemplateOutlet",t.templateLeft)("ngTemplateOutletContext",e.VKq(2,De,t.paginatorState))}}function br(n,r){if(1&n&&(e.TgZ(0,"span",17),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.currentPageReport)}}const he=function(n){return{"p-disabled":n}};function yr(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",18),e.NdJ("click",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.changePageToFirst(o))}),e._UZ(1,"span",19),e.qZA()}if(2&n){const t=e.oxw(2);e.Q6J("disabled",t.isFirstPage()||t.empty())("ngClass",e.VKq(2,he,t.isFirstPage()||t.empty()))}}const Sr=function(n){return{"p-highlight":n}};function Ar(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",22),e.NdJ("click",function(o){const s=e.CHM(t).$implicit,c=e.oxw(3);return e.KtG(c.onPageLinkClick(o,s-1))}),e._uU(1),e.qZA()}if(2&n){const t=r.$implicit,a=e.oxw(3);e.Q6J("ngClass",e.VKq(2,Sr,t-1==a.getPage())),e.xp6(1),e.hij(" ",t," ")}}function wr(n,r){if(1&n&&(e.TgZ(0,"span",20),e.YNc(1,Ar,2,4,"button",21),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.pageLinks)}}function Fr(n,r){if(1&n&&e._uU(0),2&n){const t=e.oxw(3);e.Oqu(t.currentPageReport)}}function Mr(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"p-dropdown",23),e.NdJ("onChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onPageDropdownChange(o))}),e.YNc(1,Fr,1,1,"ng-template",24),e.qZA()}if(2&n){const t=e.oxw(2);e.Q6J("options",t.pageItems)("ngModel",t.getPage())("disabled",t.empty())("appendTo",t.dropdownAppendTo)("scrollHeight",t.dropdownScrollHeight)}}function qr(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",25),e.NdJ("click",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.changePageToLast(o))}),e._UZ(1,"span",26),e.qZA()}if(2&n){const t=e.oxw(2);e.Q6J("disabled",t.isLastPage()||t.empty())("ngClass",e.VKq(2,he,t.isLastPage()||t.empty()))}}function Ir(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"p-inputNumber",27),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.changePage(o-1))}),e.qZA()}if(2&n){const t=e.oxw(2);e.Q6J("ngModel",t.currentPage())("disabled",t.empty())}}function Pr(n,r){1&n&&e.GkF(0)}function Or(n,r){if(1&n&&e.YNc(0,Pr,1,0,"ng-container",16),2&n){const t=r.$implicit,a=e.oxw(4);e.Q6J("ngTemplateOutlet",a.dropdownItemTemplate)("ngTemplateOutletContext",e.VKq(2,De,t))}}function Nr(n,r){1&n&&(e.ynx(0),e.YNc(1,Or,1,4,"ng-template",30),e.BQk())}function Jr(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"p-dropdown",28),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.rows=o)})("onChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onRppChange(o))}),e.YNc(1,Nr,2,0,"ng-container",29),e.qZA()}if(2&n){const t=e.oxw(2);e.Q6J("options",t.rowsPerPageItems)("ngModel",t.rows)("disabled",t.empty())("appendTo",t.dropdownAppendTo)("scrollHeight",t.dropdownScrollHeight),e.xp6(1),e.Q6J("ngIf",t.dropdownItemTemplate)}}function Lr(n,r){1&n&&e.GkF(0)}function Ur(n,r){if(1&n&&(e.TgZ(0,"div",31),e.YNc(1,Lr,1,0,"ng-container",16),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngTemplateOutlet",t.templateRight)("ngTemplateOutletContext",e.VKq(2,De,t.paginatorState))}}function Qr(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",1),e.YNc(1,vr,2,4,"div",2),e.YNc(2,br,2,1,"span",3),e.YNc(3,yr,2,4,"button",4),e.TgZ(4,"button",5),e.NdJ("click",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.changePageToPrev(o))}),e._UZ(5,"span",6),e.qZA(),e.YNc(6,wr,2,1,"span",7),e.YNc(7,Mr,2,5,"p-dropdown",8),e.TgZ(8,"button",9),e.NdJ("click",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.changePageToNext(o))}),e._UZ(9,"span",10),e.qZA(),e.YNc(10,qr,2,4,"button",11),e.YNc(11,Ir,1,2,"p-inputNumber",12),e.YNc(12,Jr,2,6,"p-dropdown",13),e.YNc(13,Ur,2,4,"div",14),e.qZA()}if(2&n){const t=e.oxw();e.Tol(t.styleClass),e.Q6J("ngStyle",t.style)("ngClass","p-paginator p-component"),e.xp6(1),e.Q6J("ngIf",t.templateLeft),e.xp6(1),e.Q6J("ngIf",t.showCurrentPageReport),e.xp6(1),e.Q6J("ngIf",t.showFirstLastIcon),e.xp6(1),e.Q6J("disabled",t.isFirstPage()||t.empty())("ngClass",e.VKq(17,he,t.isFirstPage()||t.empty())),e.xp6(2),e.Q6J("ngIf",t.showPageLinks),e.xp6(1),e.Q6J("ngIf",t.showJumpToPageDropdown),e.xp6(1),e.Q6J("disabled",t.isLastPage()||t.empty())("ngClass",e.VKq(19,he,t.isLastPage()||t.empty())),e.xp6(2),e.Q6J("ngIf",t.showFirstLastIcon),e.xp6(1),e.Q6J("ngIf",t.showJumpToPageInput),e.xp6(1),e.Q6J("ngIf",t.rowsPerPageOptions),e.xp6(1),e.Q6J("ngIf",t.templateRight)}}let kr=(()=>{class n{constructor(t){this.cd=t,this.pageLinkSize=5,this.onPageChange=new e.vpe,this.alwaysShow=!0,this.dropdownScrollHeight="200px",this.currentPageReportTemplate="{currentPage} of {totalPages}",this.showFirstLastIcon=!0,this.totalRecords=0,this.rows=0,this.showPageLinks=!0,this._first=0,this._page=0}ngOnInit(){this.updatePaginatorState()}ngOnChanges(t){t.totalRecords&&(this.updatePageLinks(),this.updatePaginatorState(),this.updateFirst(),this.updateRowsPerPageOptions()),t.first&&(this._first=t.first.currentValue,this.updatePageLinks(),this.updatePaginatorState()),t.rows&&(this.updatePageLinks(),this.updatePaginatorState()),t.rowsPerPageOptions&&this.updateRowsPerPageOptions()}get first(){return this._first}set first(t){this._first=t}updateRowsPerPageOptions(){if(this.rowsPerPageOptions){this.rowsPerPageItems=[];for(let t of this.rowsPerPageOptions)"object"==typeof t&&t.showAll?this.rowsPerPageItems.unshift({label:t.showAll,value:this.totalRecords}):this.rowsPerPageItems.push({label:String(t),value:t})}}isFirstPage(){return 0===this.getPage()}isLastPage(){return this.getPage()===this.getPageCount()-1}getPageCount(){return Math.ceil(this.totalRecords/this.rows)}calculatePageLinkBoundaries(){let t=this.getPageCount(),a=Math.min(this.pageLinkSize,t),o=Math.max(0,Math.ceil(this.getPage()-a/2)),i=Math.min(t-1,o+a-1);return o=Math.max(0,o-(this.pageLinkSize-(i-o+1))),[o,i]}updatePageLinks(){this.pageLinks=[];let t=this.calculatePageLinkBoundaries(),o=t[1];for(let i=t[0];i<=o;i++)this.pageLinks.push(i+1);if(this.showJumpToPageDropdown){this.pageItems=[];for(let i=0;i<this.getPageCount();i++)this.pageItems.push({label:String(i+1),value:i})}}changePage(t){var a=this.getPageCount();if(t>=0&&t<a){this._first=this.rows*t;var o={page:t,first:this.first,rows:this.rows,pageCount:a};this.updatePageLinks(),this.onPageChange.emit(o),this.updatePaginatorState()}}updateFirst(){const t=this.getPage();t>0&&this.totalRecords&&this.first>=this.totalRecords&&Promise.resolve(null).then(()=>this.changePage(t-1))}getPage(){return Math.floor(this.first/this.rows)}changePageToFirst(t){this.isFirstPage()||this.changePage(0),t.preventDefault()}changePageToPrev(t){this.changePage(this.getPage()-1),t.preventDefault()}changePageToNext(t){this.changePage(this.getPage()+1),t.preventDefault()}changePageToLast(t){this.isLastPage()||this.changePage(this.getPageCount()-1),t.preventDefault()}onPageLinkClick(t,a){this.changePage(a),t.preventDefault()}onRppChange(t){this.changePage(this.getPage())}onPageDropdownChange(t){this.changePage(t.value)}updatePaginatorState(){this.paginatorState={page:this.getPage(),pageCount:this.getPageCount(),rows:this.rows,first:this.first,totalRecords:this.totalRecords}}empty(){return 0===this.getPageCount()}currentPage(){return this.getPageCount()>0?this.getPage()+1:0}get currentPageReport(){return this.currentPageReportTemplate.replace("{currentPage}",String(this.currentPage())).replace("{totalPages}",String(this.getPageCount())).replace("{first}",String(this.totalRecords>0?this._first+1:0)).replace("{last}",String(Math.min(this._first+this.rows,this.totalRecords))).replace("{rows}",String(this.rows)).replace("{totalRecords}",String(this.totalRecords))}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.sBO))},n.\u0275cmp=e.Xpm({type:n,selectors:[["p-paginator"]],hostAttrs:[1,"p-element"],inputs:{pageLinkSize:"pageLinkSize",style:"style",styleClass:"styleClass",alwaysShow:"alwaysShow",templateLeft:"templateLeft",templateRight:"templateRight",dropdownAppendTo:"dropdownAppendTo",dropdownScrollHeight:"dropdownScrollHeight",currentPageReportTemplate:"currentPageReportTemplate",showCurrentPageReport:"showCurrentPageReport",showFirstLastIcon:"showFirstLastIcon",totalRecords:"totalRecords",rows:"rows",rowsPerPageOptions:"rowsPerPageOptions",showJumpToPageDropdown:"showJumpToPageDropdown",showJumpToPageInput:"showJumpToPageInput",showPageLinks:"showPageLinks",dropdownItemTemplate:"dropdownItemTemplate",first:"first"},outputs:{onPageChange:"onPageChange"},features:[e.TTD],decls:1,vars:1,consts:[[3,"class","ngStyle","ngClass",4,"ngIf"],[3,"ngStyle","ngClass"],["class","p-paginator-left-content",4,"ngIf"],["class","p-paginator-current",4,"ngIf"],["type","button","pRipple","","class","p-paginator-first p-paginator-element p-link",3,"disabled","ngClass","click",4,"ngIf"],["type","button","pRipple","",1,"p-paginator-prev","p-paginator-element","p-link",3,"disabled","ngClass","click"],[1,"p-paginator-icon","pi","pi-angle-left"],["class","p-paginator-pages",4,"ngIf"],["styleClass","p-paginator-page-options",3,"options","ngModel","disabled","appendTo","scrollHeight","onChange",4,"ngIf"],["type","button","pRipple","",1,"p-paginator-next","p-paginator-element","p-link",3,"disabled","ngClass","click"],[1,"p-paginator-icon","pi","pi-angle-right"],["type","button","pRipple","","class","p-paginator-last p-paginator-element p-link",3,"disabled","ngClass","click",4,"ngIf"],["class","p-paginator-page-input",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["styleClass","p-paginator-rpp-options",3,"options","ngModel","disabled","appendTo","scrollHeight","ngModelChange","onChange",4,"ngIf"],["class","p-paginator-right-content",4,"ngIf"],[1,"p-paginator-left-content"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"p-paginator-current"],["type","button","pRipple","",1,"p-paginator-first","p-paginator-element","p-link",3,"disabled","ngClass","click"],[1,"p-paginator-icon","pi","pi-angle-double-left"],[1,"p-paginator-pages"],["type","button","class","p-paginator-page p-paginator-element p-link","pRipple","",3,"ngClass","click",4,"ngFor","ngForOf"],["type","button","pRipple","",1,"p-paginator-page","p-paginator-element","p-link",3,"ngClass","click"],["styleClass","p-paginator-page-options",3,"options","ngModel","disabled","appendTo","scrollHeight","onChange"],["pTemplate","selectedItem"],["type","button","pRipple","",1,"p-paginator-last","p-paginator-element","p-link",3,"disabled","ngClass","click"],[1,"p-paginator-icon","pi","pi-angle-double-right"],[1,"p-paginator-page-input",3,"ngModel","disabled","ngModelChange"],["styleClass","p-paginator-rpp-options",3,"options","ngModel","disabled","appendTo","scrollHeight","ngModelChange","onChange"],[4,"ngIf"],["pTemplate","item"],[1,"p-paginator-right-content"]],template:function(t,a){1&t&&e.YNc(0,Qr,14,21,"div",0),2&t&&e.Q6J("ngIf",!!a.alwaysShow||a.pageLinks&&a.pageLinks.length>1)},dependencies:[p.mk,p.sg,p.O5,p.tP,p.PC,Ne,H.jx,Ee,d.JJ,d.On,ie.H],styles:[".p-paginator{display:flex;align-items:center;justify-content:center;flex-wrap:wrap}.p-paginator-left-content{margin-right:auto}.p-paginator-right-content{margin-left:auto}.p-paginator-page,.p-paginator-next,.p-paginator-last,.p-paginator-first,.p-paginator-prev,.p-paginator-current{cursor:pointer;display:inline-flex;align-items:center;justify-content:center;line-height:1;-webkit-user-select:none;user-select:none;overflow:hidden;position:relative}.p-paginator-element:focus{z-index:1;position:relative}\n"],encapsulation:2,changeDetection:0}),n})(),Er=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[p.ez,Je,Ye,d.u5,H.m8,ie.T,Je,Ye,d.u5,H.m8]}),n})();var ue=g(77579);const Yr=["container"],Rr=["resizeHelper"],Gr=["reorderIndicatorUp"],Hr=["reorderIndicatorDown"],Vr=["table"],Br=["scrollableView"],Kr=["scrollableFrozenView"];function jr(n,r){if(1&n&&(e.TgZ(0,"div",12)(1,"div",13),e._UZ(2,"i"),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Tol("p-treetable-loading-icon pi-spin "+t.loadingIcon)}}function zr(n,r){1&n&&e.GkF(0)}function Wr(n,r){if(1&n&&(e.TgZ(0,"div",14),e.YNc(1,zr,1,0,"ng-container",15),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngTemplateOutlet",t.captionTemplate)}}function $r(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"p-paginator",16),e.NdJ("onPageChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onPageChange(o))}),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("rows",t.rows)("first",t.first)("totalRecords",t.totalRecords)("pageLinkSize",t.pageLinks)("alwaysShow",t.alwaysShowPaginator)("rowsPerPageOptions",t.rowsPerPageOptions)("templateLeft",t.paginatorLeftTemplate)("templateRight",t.paginatorRightTemplate)("dropdownAppendTo",t.paginatorDropdownAppendTo)("currentPageReportTemplate",t.currentPageReportTemplate)("showFirstLastIcon",t.showFirstLastIcon)("dropdownItemTemplate",t.paginatorDropdownItemTemplate)("showCurrentPageReport",t.showCurrentPageReport)("showJumpToPageDropdown",t.showJumpToPageDropdown)("showPageLinks",t.showPageLinks)}}function Xr(n,r){1&n&&e.GkF(0)}function el(n,r){1&n&&e.GkF(0)}function tl(n,r){1&n&&e.GkF(0)}const ee=function(n){return{$implicit:n}};function nl(n,r){if(1&n&&(e.TgZ(0,"div",17)(1,"table",18,19),e.YNc(3,Xr,1,0,"ng-container",20),e.TgZ(4,"thead",21),e.YNc(5,el,1,0,"ng-container",20),e.qZA(),e._UZ(6,"tbody",22),e.TgZ(7,"tfoot",23),e.YNc(8,tl,1,0,"ng-container",20),e.qZA()()()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngClass",t.tableStyleClass)("ngStyle",t.tableStyle),e.xp6(2),e.Q6J("ngTemplateOutlet",t.colGroupTemplate)("ngTemplateOutletContext",e.VKq(10,ee,t.columns)),e.xp6(2),e.Q6J("ngTemplateOutlet",t.headerTemplate)("ngTemplateOutletContext",e.VKq(12,ee,t.columns)),e.xp6(1),e.Q6J("pTreeTableBody",t.columns)("pTreeTableBodyTemplate",t.bodyTemplate),e.xp6(2),e.Q6J("ngTemplateOutlet",t.footerTemplate)("ngTemplateOutletContext",e.VKq(14,ee,t.columns))}}const ol=function(n){return{width:n}};function al(n,r){if(1&n&&e._UZ(0,"div",28,29),2&n){const t=e.oxw(2);e.Q6J("ttScrollableView",t.frozenColumns)("frozen",!0)("ngStyle",e.VKq(4,ol,t.frozenWidth))("scrollHeight",t.scrollHeight)}}const il=function(n,r){return{left:n,width:r}};function rl(n,r){if(1&n&&(e.TgZ(0,"div",24),e.YNc(1,al,2,6,"div",25),e._UZ(2,"div",26,27),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.frozenColumns||t.frozenBodyTemplate),e.xp6(1),e.Q6J("ttScrollableView",t.columns)("frozen",!1)("scrollHeight",t.scrollHeight)("ngStyle",e.WLB(5,il,t.frozenWidth,"calc(100% - "+t.frozenWidth+")"))}}function ll(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"p-paginator",30),e.NdJ("onPageChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onPageChange(o))}),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("rows",t.rows)("first",t.first)("totalRecords",t.totalRecords)("pageLinkSize",t.pageLinks)("alwaysShow",t.alwaysShowPaginator)("rowsPerPageOptions",t.rowsPerPageOptions)("templateLeft",t.paginatorLeftTemplate)("templateRight",t.paginatorRightTemplate)("dropdownAppendTo",t.paginatorDropdownAppendTo)("currentPageReportTemplate",t.currentPageReportTemplate)("showFirstLastIcon",t.showFirstLastIcon)("dropdownItemTemplate",t.paginatorDropdownItemTemplate)("showCurrentPageReport",t.showCurrentPageReport)("showJumpToPageDropdown",t.showJumpToPageDropdown)("showPageLinks",t.showPageLinks)}}function sl(n,r){1&n&&e.GkF(0)}function pl(n,r){if(1&n&&(e.TgZ(0,"div",31),e.YNc(1,sl,1,0,"ng-container",15),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngTemplateOutlet",t.summaryTemplate)}}function cl(n,r){1&n&&e._UZ(0,"div",32,33)}function dl(n,r){1&n&&e._UZ(0,"span",34,35)}function ul(n,r){1&n&&e._UZ(0,"span",36,37)}const _l=function(n,r,t,a,o){return{"p-treetable p-component":!0,"p-treetable-hoverable-rows":n,"p-treetable-auto-layout":r,"p-treetable-resizable":t,"p-treetable-resizable-fit":a,"p-treetable-flex-scrollable":o}},ml=["pTreeTableBody",""];function gl(n,r){1&n&&e.GkF(0)}const hl=function(n,r,t,a){return{$implicit:n,node:r,rowData:t,columns:a}};function fl(n,r){if(1&n&&(e.ynx(0),e.YNc(1,gl,1,0,"ng-container",2),e.BQk()),2&n){const t=e.oxw().$implicit,a=e.oxw();e.xp6(1),e.Q6J("ngTemplateOutlet",a.template)("ngTemplateOutletContext",e.l5B(2,hl,t,t.node,t.node.data,a.columns))}}function xl(n,r){1&n&&e.YNc(0,fl,2,7,"ng-container",1),2&n&&e.Q6J("ngIf",r.$implicit.visible)}function Tl(n,r){1&n&&e.GkF(0)}const Cl=function(n,r){return{$implicit:n,frozen:r}};function Zl(n,r){if(1&n&&(e.ynx(0),e.YNc(1,Tl,1,0,"ng-container",2),e.BQk()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngTemplateOutlet",t.tt.emptyMessageTemplate)("ngTemplateOutletContext",e.WLB(2,Cl,t.columns,t.frozen))}}const Dl=["scrollHeader"],vl=["scrollHeaderBox"],bl=["scrollBody"],yl=["scrollTable"],Sl=["loadingTable"],Al=["scrollFooter"],wl=["scrollFooterBox"],Fl=["scrollableAligner"],Ml=["scroller"],ql=["ttScrollableView",""];function Il(n,r){1&n&&e.GkF(0)}function Pl(n,r){1&n&&e.GkF(0)}function Ol(n,r){1&n&&e.GkF(0)}const Re=function(n,r){return{$implicit:n,options:r}};function Nl(n,r){if(1&n&&e.YNc(0,Ol,1,0,"ng-container",5),2&n){const t=r.$implicit,a=r.options;e.oxw(2);const o=e.MAs(11);e.Q6J("ngTemplateOutlet",o)("ngTemplateOutletContext",e.WLB(2,Re,t,a))}}function Jl(n,r){1&n&&e.GkF(0)}const Ll=function(n){return{options:n}};function Ul(n,r){if(1&n&&e.YNc(0,Jl,1,0,"ng-container",5),2&n){const t=r.options,a=e.oxw(3);e.Q6J("ngTemplateOutlet",a.loaderTemplate)("ngTemplateOutletContext",e.VKq(2,Ll,t))}}function Ql(n,r){1&n&&(e.ynx(0),e.YNc(1,Ul,1,4,"ng-template",14),e.BQk())}const kl=function(n){return{height:n}};function El(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"p-scroller",11,12),e.NdJ("onLazyLoad",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.tt.onLazyItemLoad(o))}),e.YNc(2,Nl,1,5,"ng-template",13),e.YNc(3,Ql,2,0,"ng-container",8),e.qZA()}if(2&n){const t=e.oxw();e.Akn(e.VKq(8,kl,"flex"!==t.tt.scrollHeight?t.tt.scrollHeight:void 0)),e.Q6J("items",t.tt.serializedValue)("scrollHeight","flex"!==t.scrollHeight?void 0:"100%")("itemSize",t.tt.virtualScrollItemSize||t.tt._virtualRowHeight)("lazy",t.tt.lazy)("options",t.tt.virtualScrollOptions),e.xp6(3),e.Q6J("ngIf",t.loaderTemplate)}}function Yl(n,r){1&n&&e.GkF(0)}const Rl=function(n,r){return{"max-height":n,"overflow-y":r}},Gl=function(){return{}};function Hl(n,r){if(1&n&&(e.ynx(0),e.TgZ(1,"div",15,16),e.YNc(3,Yl,1,0,"ng-container",5),e.qZA(),e.BQk()),2&n){const t=e.oxw(),a=e.MAs(11);e.xp6(1),e.Q6J("ngStyle",e.WLB(3,Rl,"flex"!==t.tt.scrollHeight?t.scrollHeight:void 0,!t.frozen&&t.tt.scrollHeight?"scroll":void 0)),e.xp6(2),e.Q6J("ngTemplateOutlet",a)("ngTemplateOutletContext",e.WLB(7,Re,t.serializedValue,e.DdM(6,Gl)))}}function Vl(n,r){1&n&&e.GkF(0)}function Bl(n,r){1&n&&e._UZ(0,"div",21,22)}function Kl(n,r){if(1&n&&(e.TgZ(0,"table",17,18),e.YNc(2,Vl,1,0,"ng-container",5),e._UZ(3,"tbody",19),e.qZA(),e.YNc(4,Bl,2,0,"div",20)),2&n){const t=r.$implicit,a=r.options,o=e.oxw();e.Akn(a.contentStyle),e.Tol(o.tt.tableStyleClass),e.Q6J("ngClass",a.contentStyleClass)("ngStyle",o.tt.tableStyle),e.xp6(2),e.Q6J("ngTemplateOutlet",o.frozen&&o.tt.frozenColGroupTemplate||o.tt.colGroupTemplate)("ngTemplateOutletContext",e.VKq(13,ee,o.columns)),e.xp6(1),e.Q6J("pTreeTableBody",o.columns)("pTreeTableBodyTemplate",o.frozen&&o.tt.frozenBodyTemplate||o.tt.bodyTemplate)("serializedNodes",t)("frozen",o.frozen),e.xp6(1),e.Q6J("ngIf",o.frozen)}}function jl(n,r){1&n&&e.GkF(0)}function zl(n,r){1&n&&e.GkF(0)}function Wl(n,r){if(1&n&&(e.TgZ(0,"div",23,24)(2,"div",25,26)(4,"table",27),e.YNc(5,jl,1,0,"ng-container",5),e.TgZ(6,"tfoot",28),e.YNc(7,zl,1,0,"ng-container",5),e.qZA()()()()),2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngClass",t.tt.tableStyleClass)("ngStyle",t.tt.tableStyle),e.xp6(1),e.Q6J("ngTemplateOutlet",t.frozen&&t.tt.frozenColGroupTemplate||t.tt.colGroupTemplate)("ngTemplateOutletContext",e.VKq(6,ee,t.columns)),e.xp6(2),e.Q6J("ngTemplateOutlet",t.frozen&&t.tt.frozenFooterTemplate||t.tt.footerTemplate)("ngTemplateOutletContext",e.VKq(8,ee,t.columns))}}const $l=function(n,r,t){return{"pi-sort-amount-up-alt":n,"pi-sort-amount-down":r,"pi-sort-alt":t}};let ve=(()=>{class n{constructor(){this.sortSource=new ue.x,this.selectionSource=new ue.x,this.contextMenuSource=new ue.x,this.uiUpdateSource=new ue.x,this.totalRecordsSource=new ue.x,this.sortSource$=this.sortSource.asObservable(),this.selectionSource$=this.selectionSource.asObservable(),this.contextMenuSource$=this.contextMenuSource.asObservable(),this.uiUpdateSource$=this.uiUpdateSource.asObservable(),this.totalRecordsSource$=this.totalRecordsSource.asObservable()}onSort(t){this.sortSource.next(t)}onSelectionChange(){this.selectionSource.next(null)}onContextMenu(t){this.contextMenuSource.next(t)}onUIUpdate(t){this.uiUpdateSource.next(t)}onTotalRecordsChange(t){this.totalRecordsSource.next(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac}),n})(),oe=(()=>{class n{constructor(t,a,o,i,s){this.el=t,this.cd=a,this.zone=o,this.tableService=i,this.filterService=s,this.lazy=!1,this.lazyLoadOnInit=!0,this.first=0,this.pageLinks=5,this.alwaysShowPaginator=!0,this.paginatorPosition="bottom",this.currentPageReportTemplate="{currentPage} of {totalPages}",this.showFirstLastIcon=!0,this.showPageLinks=!0,this.defaultSortOrder=1,this.sortMode="single",this.resetPageOnSort=!0,this.selectionChange=new e.vpe,this.contextMenuSelectionChange=new e.vpe,this.contextMenuSelectionMode="separate",this.compareSelectionBy="deepEquals",this.loadingIcon="pi pi-spinner",this.showLoader=!0,this.virtualScrollDelay=150,this.columnResizeMode="fit",this.rowTrackBy=(c,u)=>u,this.filters={},this.filterDelay=300,this.filterMode="lenient",this.onFilter=new e.vpe,this.onNodeExpand=new e.vpe,this.onNodeCollapse=new e.vpe,this.onPage=new e.vpe,this.onSort=new e.vpe,this.onLazyLoad=new e.vpe,this.sortFunction=new e.vpe,this.onColResize=new e.vpe,this.onColReorder=new e.vpe,this.onNodeSelect=new e.vpe,this.onNodeUnselect=new e.vpe,this.onContextMenuSelect=new e.vpe,this.onHeaderCheckboxToggle=new e.vpe,this.onEditInit=new e.vpe,this.onEditComplete=new e.vpe,this.onEditCancel=new e.vpe,this._virtualRowHeight=28,this._value=[],this._totalRecords=0,this._sortOrder=1,this.selectionKeys={}}get virtualRowHeight(){return this._virtualRowHeight}set virtualRowHeight(t){this._virtualRowHeight=t,console.warn("The virtualRowHeight property is deprecated, use virtualScrollItemSize property instead.")}ngOnInit(){this.lazy&&this.lazyLoadOnInit&&!this.virtualScroll&&this.onLazyLoad.emit(this.createLazyLoadMetadata()),this.initialized=!0}ngAfterContentInit(){this.templates.forEach(t=>{switch(t.getType()){case"caption":this.captionTemplate=t.template;break;case"header":this.headerTemplate=t.template;break;case"body":this.bodyTemplate=t.template;break;case"loadingbody":this.loadingBodyTemplate=t.template;break;case"footer":this.footerTemplate=t.template;break;case"summary":this.summaryTemplate=t.template;break;case"colgroup":this.colGroupTemplate=t.template;break;case"emptymessage":this.emptyMessageTemplate=t.template;break;case"paginatorleft":this.paginatorLeftTemplate=t.template;break;case"paginatorright":this.paginatorRightTemplate=t.template;break;case"paginatordropdownitem":this.paginatorDropdownItemTemplate=t.template;break;case"frozenheader":this.frozenHeaderTemplate=t.template;break;case"frozenbody":this.frozenBodyTemplate=t.template;break;case"frozenfooter":this.frozenFooterTemplate=t.template;break;case"frozencolgroup":this.frozenColGroupTemplate=t.template}})}ngOnChanges(t){t.value&&(this._value=t.value.currentValue,this.lazy||(this.totalRecords=this._value?this._value.length:0,"single"==this.sortMode&&this.sortField?this.sortSingle():"multiple"==this.sortMode&&this.multiSortMeta?this.sortMultiple():this.hasFilter()&&this._filter()),this.updateSerializedValue(),this.tableService.onUIUpdate(this.value)),t.sortField&&(this._sortField=t.sortField.currentValue,(!this.lazy||this.initialized)&&"single"===this.sortMode&&this.sortSingle()),t.sortOrder&&(this._sortOrder=t.sortOrder.currentValue,(!this.lazy||this.initialized)&&"single"===this.sortMode&&this.sortSingle()),t.multiSortMeta&&(this._multiSortMeta=t.multiSortMeta.currentValue,"multiple"===this.sortMode&&this.sortMultiple()),t.selection&&(this._selection=t.selection.currentValue,this.preventSelectionSetterPropagation||(this.updateSelectionKeys(),this.tableService.onSelectionChange()),this.preventSelectionSetterPropagation=!1)}get value(){return this._value}set value(t){this._value=t}updateSerializedValue(){this.serializedValue=[],this.paginator?this.serializePageNodes():this.serializeNodes(null,this.filteredNodes||this.value,0,!0)}serializeNodes(t,a,o,i){if(a&&a.length)for(let s of a){s.parent=t;const c={node:s,parent:t,level:o,visible:i&&(!t||t.expanded)};this.serializedValue.push(c),c.visible&&s.expanded&&this.serializeNodes(s,s.children,o+1,c.visible)}}serializePageNodes(){let t=this.filteredNodes||this.value;if(this.serializedValue=[],t&&t.length){const a=this.lazy?0:this.first;for(let o=a;o<a+this.rows;o++){let i=t[o];i&&(this.serializedValue.push({node:i,parent:null,level:0,visible:!0}),this.serializeNodes(i,i.children,1,!0))}}}get totalRecords(){return this._totalRecords}set totalRecords(t){this._totalRecords=t,this.tableService.onTotalRecordsChange(this._totalRecords)}get sortField(){return this._sortField}set sortField(t){this._sortField=t}get sortOrder(){return this._sortOrder}set sortOrder(t){this._sortOrder=t}get multiSortMeta(){return this._multiSortMeta}set multiSortMeta(t){this._multiSortMeta=t}get selection(){return this._selection}set selection(t){this._selection=t}updateSelectionKeys(){if(this.dataKey&&this._selection)if(this.selectionKeys={},Array.isArray(this._selection))for(let t of this._selection)this.selectionKeys[String(L.gb.resolveFieldData(t.data,this.dataKey))]=1;else this.selectionKeys[String(L.gb.resolveFieldData(this._selection.data,this.dataKey))]=1}onPageChange(t){this.first=t.first,this.rows=t.rows,this.lazy?this.onLazyLoad.emit(this.createLazyLoadMetadata()):this.serializePageNodes(),this.onPage.emit({first:this.first,rows:this.rows}),this.tableService.onUIUpdate(this.value),this.scrollable&&this.resetScrollTop()}sort(t){let a=t.originalEvent;if("single"===this.sortMode&&(this._sortOrder=this.sortField===t.field?-1*this.sortOrder:this.defaultSortOrder,this._sortField=t.field,this.sortSingle(),this.resetPageOnSort&&this.scrollable&&this.resetScrollTop()),"multiple"===this.sortMode){let o=a.metaKey||a.ctrlKey,i=this.getSortMeta(t.field);i?o?i.order=-1*i.order:(this._multiSortMeta=[{field:t.field,order:-1*i.order}],this.resetPageOnSort&&this.scrollable&&this.resetScrollTop()):((!o||!this.multiSortMeta)&&(this._multiSortMeta=[],this.resetPageOnSort&&this.scrollable&&this.resetScrollTop()),this.multiSortMeta.push({field:t.field,order:this.defaultSortOrder})),this.sortMultiple()}}sortSingle(){if(this.sortField&&this.sortOrder){this.lazy?this.onLazyLoad.emit(this.createLazyLoadMetadata()):this.value&&(this.sortNodes(this.value),this.hasFilter()&&this._filter());let t={field:this.sortField,order:this.sortOrder};this.onSort.emit(t),this.tableService.onSort(t),this.updateSerializedValue()}}sortNodes(t){if(t&&0!==t.length){this.customSort?this.sortFunction.emit({data:t,mode:this.sortMode,field:this.sortField,order:this.sortOrder}):t.sort((a,o)=>{let i=L.gb.resolveFieldData(a.data,this.sortField),s=L.gb.resolveFieldData(o.data,this.sortField),c=null;return c=null==i&&null!=s?-1:null!=i&&null==s?1:null==i&&null==s?0:"string"==typeof i&&"string"==typeof s?i.localeCompare(s,void 0,{numeric:!0}):i<s?-1:i>s?1:0,this.sortOrder*c});for(let a of t)this.sortNodes(a.children)}}sortMultiple(){this.multiSortMeta&&(this.lazy?this.onLazyLoad.emit(this.createLazyLoadMetadata()):this.value&&(this.sortMultipleNodes(this.value),this.hasFilter()&&this._filter()),this.onSort.emit({multisortmeta:this.multiSortMeta}),this.updateSerializedValue(),this.tableService.onSort(this.multiSortMeta))}sortMultipleNodes(t){if(t&&0!==t.length){this.customSort?this.sortFunction.emit({data:this.value,mode:this.sortMode,multiSortMeta:this.multiSortMeta}):t.sort((a,o)=>this.multisortField(a,o,this.multiSortMeta,0));for(let a of t)this.sortMultipleNodes(a.children)}}multisortField(t,a,o,i){if(L.gb.isEmpty(this.multiSortMeta)||L.gb.isEmpty(o[i]))return 0;let s=L.gb.resolveFieldData(t.data,o[i].field),c=L.gb.resolveFieldData(a.data,o[i].field),u=null;if(null==s&&null!=c?u=-1:null!=s&&null==c?u=1:null==s&&null==c&&(u=0),"string"==typeof s||s instanceof String){if(s.localeCompare&&s!=c)return o[i].order*s.localeCompare(c,void 0,{numeric:!0})}else u=s<c?-1:1;return s==c?o.length-1>i?this.multisortField(t,a,o,i+1):0:o[i].order*u}getSortMeta(t){if(this.multiSortMeta&&this.multiSortMeta.length)for(let a=0;a<this.multiSortMeta.length;a++)if(this.multiSortMeta[a].field===t)return this.multiSortMeta[a];return null}isSorted(t){if("single"===this.sortMode)return this.sortField&&this.sortField===t;if("multiple"===this.sortMode){let a=!1;if(this.multiSortMeta)for(let o=0;o<this.multiSortMeta.length;o++)if(this.multiSortMeta[o].field==t){a=!0;break}return a}}createLazyLoadMetadata(){return{first:this.first,rows:this.rows,sortField:this.sortField,sortOrder:this.sortOrder,filters:this.filters,globalFilter:this.filters&&this.filters.global?this.filters.global.value:null,multiSortMeta:this.multiSortMeta,forceUpdate:()=>this.cd.detectChanges()}}onLazyItemLoad(t){this.onLazyLoad.emit({...this.createLazyLoadMetadata(),...t,rows:t.last-t.first})}resetScrollTop(){this.virtualScroll?this.scrollToVirtualIndex(0):this.scrollTo({top:0})}scrollToVirtualIndex(t){this.scrollableViewChild&&this.scrollableViewChild.scrollToVirtualIndex(t),this.scrollableFrozenViewChild&&this.scrollableFrozenViewChild.scrollToVirtualIndex(t)}scrollTo(t){this.scrollableViewChild&&this.scrollableViewChild.scrollTo(t),this.scrollableFrozenViewChild&&this.scrollableFrozenViewChild.scrollTo(t)}isEmpty(){let t=this.filteredNodes||this.value;return null==t||0==t.length}getBlockableElement(){return this.el.nativeElement.children[0]}onColumnResizeBegin(t){let a=F.p.getOffset(this.containerViewChild.nativeElement).left;this.lastResizerHelperX=t.pageX-a+this.containerViewChild.nativeElement.scrollLeft,t.preventDefault()}onColumnResize(t){let a=F.p.getOffset(this.containerViewChild.nativeElement).left;F.p.addClass(this.containerViewChild.nativeElement,"p-unselectable-text"),this.resizeHelperViewChild.nativeElement.style.height=this.containerViewChild.nativeElement.offsetHeight+"px",this.resizeHelperViewChild.nativeElement.style.top="0px",this.resizeHelperViewChild.nativeElement.style.left=t.pageX-a+this.containerViewChild.nativeElement.scrollLeft+"px",this.resizeHelperViewChild.nativeElement.style.display="block"}onColumnResizeEnd(t,a){let o=this.resizeHelperViewChild.nativeElement.offsetLeft-this.lastResizerHelperX,i=a.offsetWidth,s=i+o;if(i+o>parseInt(a.style.minWidth||15)){if("fit"===this.columnResizeMode){let u=a.nextElementSibling;for(;!u.offsetParent;)u=u.nextElementSibling;if(u){let w=u.offsetWidth-o;if(s>15&&w>parseInt(u.style.minWidth||15))if(this.scrollable){let Q=this.findParentScrollableView(a),J=F.p.findSingle(Q,".p-treetable-scrollable-body table")||F.p.findSingle(Q,".p-scroller-viewport table"),P=F.p.findSingle(Q,"table.p-treetable-scrollable-header-table"),G=F.p.findSingle(Q,"table.p-treetable-scrollable-footer-table"),k=F.p.index(a);this.resizeColGroup(P,k,s,w),this.resizeColGroup(J,k,s,w),this.resizeColGroup(G,k,s,w)}else a.style.width=s+"px",u&&(u.style.width=w+"px")}}else if("expand"===this.columnResizeMode)if(this.scrollable){let u=this.findParentScrollableView(a),w=F.p.findSingle(u,".p-treetable-scrollable-body")||F.p.findSingle(u,".p-scroller-viewport"),v=F.p.findSingle(u,".p-treetable-scrollable-header"),Q=F.p.findSingle(u,".p-treetable-scrollable-footer"),J=F.p.findSingle(u,".p-treetable-scrollable-body table")||F.p.findSingle(u,".p-scroller-viewport table"),P=F.p.findSingle(u,"table.p-treetable-scrollable-header-table"),G=F.p.findSingle(u,"table.p-treetable-scrollable-footer-table");J.style.width=J.offsetWidth+o+"px",P.style.width=P.offsetWidth+o+"px",G&&(G.style.width=G.offsetWidth+o+"px");let k=F.p.index(a);const z=a?J.offsetWidth+o:s,ae=a?P.offsetWidth+o:s,Se=this.containerViewChild.nativeElement.offsetWidth>=z;let Ae=(_t,mt,gt,BC)=>{_t&&mt&&(_t.style.width=BC?gt+F.p.calculateScrollbarWidth(w)+"px":"auto",mt.style.width=gt+"px")};Ae(w,J,z,Se),Ae(v,P,ae,Se),Ae(Q,G,ae,Se),this.resizeColGroup(P,k,s,null),this.resizeColGroup(J,k,s,null),this.resizeColGroup(G,k,s,null)}else this.tableViewChild.nativeElement.style.width=this.tableViewChild.nativeElement.offsetWidth+o+"px",a.style.width=s+"px",this.containerViewChild.nativeElement.style.width=this.tableViewChild.nativeElement.style.width+"px";this.onColResize.emit({element:a,delta:o})}this.resizeHelperViewChild.nativeElement.style.display="none",F.p.removeClass(this.containerViewChild.nativeElement,"p-unselectable-text")}findParentScrollableView(t){if(t){let a=t.parentElement;for(;a&&!F.p.hasClass(a,"p-treetable-scrollable-view");)a=a.parentElement;return a}return null}resizeColGroup(t,a,o,i){if(t){let s="COLGROUP"===t.children[0].nodeName?t.children[0]:null;if(!s)throw"Scrollable tables require a colgroup to support resizable columns";{let c=s.children[a],u=c.nextElementSibling;c.style.width=o+"px",u&&i&&(u.style.width=i+"px")}}}onColumnDragStart(t,a){this.reorderIconWidth=F.p.getHiddenElementOuterWidth(this.reorderIndicatorUpViewChild.nativeElement),this.reorderIconHeight=F.p.getHiddenElementOuterHeight(this.reorderIndicatorDownViewChild.nativeElement),this.draggedColumn=a,t.dataTransfer.setData("text","b")}onColumnDragEnter(t,a){if(this.reorderableColumns&&this.draggedColumn&&a){t.preventDefault();let o=F.p.getOffset(this.containerViewChild.nativeElement),i=F.p.getOffset(a);if(this.draggedColumn!=a){let s=i.left-o.left,u=i.left+a.offsetWidth/2;this.reorderIndicatorUpViewChild.nativeElement.style.top=i.top-o.top-(this.reorderIconHeight-1)+"px",this.reorderIndicatorDownViewChild.nativeElement.style.top=i.top-o.top+a.offsetHeight+"px",t.pageX>u?(this.reorderIndicatorUpViewChild.nativeElement.style.left=s+a.offsetWidth-Math.ceil(this.reorderIconWidth/2)+"px",this.reorderIndicatorDownViewChild.nativeElement.style.left=s+a.offsetWidth-Math.ceil(this.reorderIconWidth/2)+"px",this.dropPosition=1):(this.reorderIndicatorUpViewChild.nativeElement.style.left=s-Math.ceil(this.reorderIconWidth/2)+"px",this.reorderIndicatorDownViewChild.nativeElement.style.left=s-Math.ceil(this.reorderIconWidth/2)+"px",this.dropPosition=-1),this.reorderIndicatorUpViewChild.nativeElement.style.display="block",this.reorderIndicatorDownViewChild.nativeElement.style.display="block"}else t.dataTransfer.dropEffect="none"}}onColumnDragLeave(t){this.reorderableColumns&&this.draggedColumn&&(t.preventDefault(),this.reorderIndicatorUpViewChild.nativeElement.style.display="none",this.reorderIndicatorDownViewChild.nativeElement.style.display="none")}onColumnDrop(t,a){if(t.preventDefault(),this.draggedColumn){let o=F.p.indexWithinGroup(this.draggedColumn,"ttreorderablecolumn"),i=F.p.indexWithinGroup(a,"ttreorderablecolumn"),s=o!=i;s&&(i-o==1&&-1===this.dropPosition||o-i==1&&1===this.dropPosition)&&(s=!1),s&&i<o&&1===this.dropPosition&&(i+=1),s&&i>o&&-1===this.dropPosition&&(i-=1),s&&(L.gb.reorderArray(this.columns,o,i),this.onColReorder.emit({dragIndex:o,dropIndex:i,columns:this.columns})),this.reorderIndicatorUpViewChild.nativeElement.style.display="none",this.reorderIndicatorDownViewChild.nativeElement.style.display="none",this.draggedColumn.draggable=!1,this.draggedColumn=null,this.dropPosition=null}}handleRowClick(t){let a=t.originalEvent.target.nodeName;if("INPUT"!=a&&"BUTTON"!=a&&"A"!=a&&!F.p.hasClass(t.originalEvent.target,"p-clickable")){if(this.selectionMode){this.preventSelectionSetterPropagation=!0;let o=t.rowNode,i=this.isSelected(o.node),s=!this.rowTouched&&this.metaKeySelection,c=this.dataKey?String(L.gb.resolveFieldData(o.node.data,this.dataKey)):null;if(s){let u=t.originalEvent.metaKey||t.originalEvent.ctrlKey;if(i&&u){if(this.isSingleSelectionMode())this._selection=null,this.selectionKeys={},this.selectionChange.emit(null);else{let w=this.findIndexInSelection(o.node);this._selection=this.selection.filter((v,Q)=>Q!=w),this.selectionChange.emit(this.selection),c&&delete this.selectionKeys[c]}this.onNodeUnselect.emit({originalEvent:t.originalEvent,node:o.node,type:"row"})}else this.isSingleSelectionMode()?(this._selection=o.node,this.selectionChange.emit(o.node),c&&(this.selectionKeys={},this.selectionKeys[c]=1)):this.isMultipleSelectionMode()&&(u?this._selection=this.selection||[]:(this._selection=[],this.selectionKeys={}),this._selection=[...this.selection,o.node],this.selectionChange.emit(this.selection),c&&(this.selectionKeys[c]=1)),this.onNodeSelect.emit({originalEvent:t.originalEvent,node:o.node,type:"row",index:t.rowIndex})}else if("single"===this.selectionMode)i?(this._selection=null,this.selectionKeys={},this.selectionChange.emit(this.selection),this.onNodeUnselect.emit({originalEvent:t.originalEvent,node:o.node,type:"row"})):(this._selection=o.node,this.selectionChange.emit(this.selection),this.onNodeSelect.emit({originalEvent:t.originalEvent,node:o.node,type:"row",index:t.rowIndex}),c&&(this.selectionKeys={},this.selectionKeys[c]=1));else if("multiple"===this.selectionMode)if(i){let u=this.findIndexInSelection(o.node);this._selection=this.selection.filter((w,v)=>v!=u),this.selectionChange.emit(this.selection),this.onNodeUnselect.emit({originalEvent:t.originalEvent,node:o.node,type:"row"}),c&&delete this.selectionKeys[c]}else this._selection=this.selection?[...this.selection,o.node]:[o.node],this.selectionChange.emit(this.selection),this.onNodeSelect.emit({originalEvent:t.originalEvent,node:o.node,type:"row",index:t.rowIndex}),c&&(this.selectionKeys[c]=1);this.tableService.onSelectionChange()}this.rowTouched=!1}}handleRowTouchEnd(t){this.rowTouched=!0}handleRowRightClick(t){if(this.contextMenu){const a=t.rowNode.node;if("separate"===this.contextMenuSelectionMode)this.contextMenuSelection=a,this.contextMenuSelectionChange.emit(a),this.onContextMenuSelect.emit({originalEvent:t.originalEvent,node:a}),this.contextMenu.show(t.originalEvent),this.tableService.onContextMenu(a);else if("joint"===this.contextMenuSelectionMode){this.preventSelectionSetterPropagation=!0;let o=this.isSelected(a),i=this.dataKey?String(L.gb.resolveFieldData(a.data,this.dataKey)):null;o||(this.isSingleSelectionMode()?(this.selection=a,this.selectionChange.emit(a)):this.isMultipleSelectionMode()&&(this.selection=[a],this.selectionChange.emit(this.selection)),i&&(this.selectionKeys[i]=1)),this.contextMenu.show(t.originalEvent),this.onContextMenuSelect.emit({originalEvent:t.originalEvent,node:a})}}}toggleNodeWithCheckbox(t){this.selection=this.selection||[],this.preventSelectionSetterPropagation=!0;let a=t.rowNode.node;this.isSelected(a)?(this.propagateSelectionDown(a,!1),t.rowNode.parent&&this.propagateSelectionUp(a.parent,!1),this.selectionChange.emit(this.selection),this.onNodeUnselect.emit({originalEvent:t,node:a})):(this.propagateSelectionDown(a,!0),t.rowNode.parent&&this.propagateSelectionUp(a.parent,!0),this.selectionChange.emit(this.selection),this.onNodeSelect.emit({originalEvent:t,node:a})),this.tableService.onSelectionChange()}toggleNodesWithCheckbox(t,a){let o=this.filteredNodes||this.value;if(this._selection=a&&o?o.slice():[],a){if(o&&o.length)for(let i of o)this.propagateSelectionDown(i,!0)}else this._selection=[],this.selectionKeys={};this.preventSelectionSetterPropagation=!0,this.selectionChange.emit(this._selection),this.tableService.onSelectionChange(),this.onHeaderCheckboxToggle.emit({originalEvent:t,checked:a})}propagateSelectionUp(t,a){if(t.children&&t.children.length){let i=0,s=!1,c=this.dataKey?String(L.gb.resolveFieldData(t.data,this.dataKey)):null;for(let u of t.children)this.isSelected(u)?i++:u.partialSelected&&(s=!0);if(a&&i==t.children.length)this._selection=[...this.selection||[],t],t.partialSelected=!1,c&&(this.selectionKeys[c]=1);else{if(!a){let u=this.findIndexInSelection(t);u>=0&&(this._selection=this.selection.filter((w,v)=>v!=u),c&&delete this.selectionKeys[c])}t.partialSelected=!!(s||i>0&&i!=t.children.length)}}let o=t.parent;o&&this.propagateSelectionUp(o,a)}propagateSelectionDown(t,a){let o=this.findIndexInSelection(t),i=this.dataKey?String(L.gb.resolveFieldData(t.data,this.dataKey)):null;if(a&&-1==o?(this._selection=[...this.selection||[],t],i&&(this.selectionKeys[i]=1)):!a&&o>-1&&(this._selection=this.selection.filter((s,c)=>c!=o),i&&delete this.selectionKeys[i]),t.partialSelected=!1,t.children&&t.children.length)for(let s of t.children)this.propagateSelectionDown(s,a)}isSelected(t){return!(!t||!this.selection)&&(this.dataKey?void 0!==this.selectionKeys[L.gb.resolveFieldData(t.data,this.dataKey)]:Array.isArray(this.selection)?this.findIndexInSelection(t)>-1:this.equals(t,this.selection))}findIndexInSelection(t){let a=-1;if(this.selection&&this.selection.length)for(let o=0;o<this.selection.length;o++)if(this.equals(t,this.selection[o])){a=o;break}return a}isSingleSelectionMode(){return"single"===this.selectionMode}isMultipleSelectionMode(){return"multiple"===this.selectionMode}equals(t,a){return"equals"===this.compareSelectionBy?t===a:L.gb.equals(t.data,a.data,this.dataKey)}filter(t,a,o){this.filterTimeout&&clearTimeout(this.filterTimeout),this.isFilterBlank(t)?this.filters[a]&&delete this.filters[a]:this.filters[a]={value:t,matchMode:o},this.filterTimeout=setTimeout(()=>{this._filter(),this.filterTimeout=null},this.filterDelay)}filterGlobal(t,a){this.filter(t,"global",a)}isFilterBlank(t){return null==t||!!("string"==typeof t&&0==t.trim().length||Array.isArray(t)&&0==t.length)}_filter(){if(this.lazy)this.onLazyLoad.emit(this.createLazyLoadMetadata());else{if(!this.value)return;if(this.hasFilter()){let a;if(this.filters.global){if(!this.columns&&!this.globalFilterFields)throw new Error("Global filtering requires dynamic columns or globalFilterFields to be defined.");a=this.globalFilterFields||this.columns}this.filteredNodes=[];const o="strict"===this.filterMode;let i=!1;for(let s of this.value){let v,c={...s},u=!0,w=!1;for(let J in this.filters)if(this.filters.hasOwnProperty(J)&&"global"!==J){let P=this.filters[J];if(v={filterField:J,filterValue:P.value,filterConstraint:this.filterService.filters[P.matchMode||"startsWith"],isStrictMode:o},(o&&!(this.findFilteredNodes(c,v)||this.isFilterMatched(c,v))||!o&&!(this.isFilterMatched(c,v)||this.findFilteredNodes(c,v)))&&(u=!1),!u)break}if(this.filters.global&&!w&&a)for(let J=0;J<a.length;J++){let P={...c};v={filterField:a[J].field||a[J],filterValue:this.filters.global.value,filterConstraint:this.filterService.filters[this.filters.global.matchMode],isStrictMode:o},(o&&(this.findFilteredNodes(P,v)||this.isFilterMatched(P,v))||!o&&(this.isFilterMatched(P,v)||this.findFilteredNodes(P,v)))&&(w=!0,c=P)}let Q=u;this.filters.global&&(Q=u&&w),Q&&this.filteredNodes.push(c),i=i||!u||w||u&&this.filteredNodes.length>0||!w&&0===this.filteredNodes.length}i||(this.filteredNodes=null),this.paginator&&(this.totalRecords=this.filteredNodes?this.filteredNodes.length:this.value?this.value.length:0)}else this.filteredNodes=null,this.paginator&&(this.totalRecords=this.value?this.value.length:0)}this.first=0;const t=this.filteredNodes||this.value;this.onFilter.emit({filters:this.filters,filteredValue:t}),this.tableService.onUIUpdate(t),this.updateSerializedValue(),this.scrollable&&this.resetScrollTop()}findFilteredNodes(t,a){if(t){let o=!1;if(t.children){let i=[...t.children];t.children=[];for(let s of i){let c={...s};this.isFilterMatched(c,a)&&(o=!0,t.children.push(c))}}if(o)return!0}}isFilterMatched(t,{filterField:a,filterValue:o,filterConstraint:i,isStrictMode:s}){let c=!1;return i(L.gb.resolveFieldData(t.data,a),o,this.filterLocale)&&(c=!0),(!c||s&&!this.isNodeLeaf(t))&&(c=this.findFilteredNodes(t,{filterField:a,filterValue:o,filterConstraint:i,isStrictMode:s})||c),c}isNodeLeaf(t){return!1!==t.leaf&&!(t.children&&t.children.length)}hasFilter(){let t=!0;for(let a in this.filters)if(this.filters.hasOwnProperty(a)){t=!1;break}return!t}reset(){this._sortField=null,this._sortOrder=1,this._multiSortMeta=null,this.tableService.onSort(null),this.filteredNodes=null,this.filters={},this.first=0,this.lazy?this.onLazyLoad.emit(this.createLazyLoadMetadata()):this.totalRecords=this._value?this._value.length:0}updateEditingCell(t,a,o){this.editingCell=t,this.editingCellData=a,this.editingCellField=o,this.bindDocumentEditListener()}isEditingCellValid(){return this.editingCell&&0===F.p.find(this.editingCell,".ng-invalid.ng-dirty").length}bindDocumentEditListener(){this.documentEditListener||(this.documentEditListener=t=>{this.editingCell&&!this.editingCellClick&&this.isEditingCellValid()&&(F.p.removeClass(this.editingCell,"p-cell-editing"),this.editingCell=null,this.onEditComplete.emit({field:this.editingCellField,data:this.editingCellData}),this.editingCellField=null,this.editingCellData=null,this.unbindDocumentEditListener()),this.editingCellClick=!1},document.addEventListener("click",this.documentEditListener))}unbindDocumentEditListener(){this.documentEditListener&&(document.removeEventListener("click",this.documentEditListener),this.documentEditListener=null)}ngOnDestroy(){this.unbindDocumentEditListener(),this.editingCell=null,this.editingCellField=null,this.editingCellData=null,this.initialized=null}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(e.SBq),e.Y36(e.sBO),e.Y36(e.R0b),e.Y36(ve),e.Y36(H.iZ))},n.\u0275cmp=e.Xpm({type:n,selectors:[["p-treeTable"]],contentQueries:function(t,a,o){if(1&t&&e.Suo(o,H.jx,4),2&t){let i;e.iGM(i=e.CRH())&&(a.templates=i)}},viewQuery:function(t,a){if(1&t&&(e.Gf(Yr,5),e.Gf(Rr,5),e.Gf(Gr,5),e.Gf(Hr,5),e.Gf(Vr,5),e.Gf(Br,5),e.Gf(Kr,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.containerViewChild=o.first),e.iGM(o=e.CRH())&&(a.resizeHelperViewChild=o.first),e.iGM(o=e.CRH())&&(a.reorderIndicatorUpViewChild=o.first),e.iGM(o=e.CRH())&&(a.reorderIndicatorDownViewChild=o.first),e.iGM(o=e.CRH())&&(a.tableViewChild=o.first),e.iGM(o=e.CRH())&&(a.scrollableViewChild=o.first),e.iGM(o=e.CRH())&&(a.scrollableFrozenViewChild=o.first)}},hostAttrs:[1,"p-element"],inputs:{columns:"columns",style:"style",styleClass:"styleClass",tableStyle:"tableStyle",tableStyleClass:"tableStyleClass",autoLayout:"autoLayout",lazy:"lazy",lazyLoadOnInit:"lazyLoadOnInit",paginator:"paginator",rows:"rows",first:"first",pageLinks:"pageLinks",rowsPerPageOptions:"rowsPerPageOptions",alwaysShowPaginator:"alwaysShowPaginator",paginatorPosition:"paginatorPosition",paginatorDropdownAppendTo:"paginatorDropdownAppendTo",currentPageReportTemplate:"currentPageReportTemplate",showCurrentPageReport:"showCurrentPageReport",showJumpToPageDropdown:"showJumpToPageDropdown",showFirstLastIcon:"showFirstLastIcon",showPageLinks:"showPageLinks",defaultSortOrder:"defaultSortOrder",sortMode:"sortMode",resetPageOnSort:"resetPageOnSort",customSort:"customSort",selectionMode:"selectionMode",contextMenuSelection:"contextMenuSelection",contextMenuSelectionMode:"contextMenuSelectionMode",dataKey:"dataKey",metaKeySelection:"metaKeySelection",compareSelectionBy:"compareSelectionBy",rowHover:"rowHover",loading:"loading",loadingIcon:"loadingIcon",showLoader:"showLoader",scrollable:"scrollable",scrollHeight:"scrollHeight",virtualScroll:"virtualScroll",virtualScrollItemSize:"virtualScrollItemSize",virtualScrollOptions:"virtualScrollOptions",virtualScrollDelay:"virtualScrollDelay",frozenWidth:"frozenWidth",frozenColumns:"frozenColumns",resizableColumns:"resizableColumns",columnResizeMode:"columnResizeMode",reorderableColumns:"reorderableColumns",contextMenu:"contextMenu",rowTrackBy:"rowTrackBy",filters:"filters",globalFilterFields:"globalFilterFields",filterDelay:"filterDelay",filterMode:"filterMode",filterLocale:"filterLocale",virtualRowHeight:"virtualRowHeight",value:"value",totalRecords:"totalRecords",sortField:"sortField",sortOrder:"sortOrder",multiSortMeta:"multiSortMeta",selection:"selection"},outputs:{selectionChange:"selectionChange",contextMenuSelectionChange:"contextMenuSelectionChange",onFilter:"onFilter",onNodeExpand:"onNodeExpand",onNodeCollapse:"onNodeCollapse",onPage:"onPage",onSort:"onSort",onLazyLoad:"onLazyLoad",sortFunction:"sortFunction",onColResize:"onColResize",onColReorder:"onColReorder",onNodeSelect:"onNodeSelect",onNodeUnselect:"onNodeUnselect",onContextMenuSelect:"onContextMenuSelect",onHeaderCheckboxToggle:"onHeaderCheckboxToggle",onEditInit:"onEditInit",onEditComplete:"onEditComplete",onEditCancel:"onEditCancel"},features:[e._Bn([ve]),e.TTD],decls:12,vars:20,consts:[["data-scrollselectors",".p-treetable-scrollable-body",3,"ngStyle","ngClass"],["container",""],["class","p-treetable-loading",4,"ngIf"],["class","p-treetable-header",4,"ngIf"],["styleClass","p-paginator-top",3,"rows","first","totalRecords","pageLinkSize","alwaysShow","rowsPerPageOptions","templateLeft","templateRight","dropdownAppendTo","currentPageReportTemplate","showFirstLastIcon","dropdownItemTemplate","showCurrentPageReport","showJumpToPageDropdown","showPageLinks","onPageChange",4,"ngIf"],["class","p-treetable-wrapper",4,"ngIf"],["class","p-treetable-scrollable-wrapper",4,"ngIf"],["styleClass","p-paginator-bottom",3,"rows","first","totalRecords","pageLinkSize","alwaysShow","rowsPerPageOptions","templateLeft","templateRight","dropdownAppendTo","currentPageReportTemplate","showFirstLastIcon","dropdownItemTemplate","showCurrentPageReport","showJumpToPageDropdown","showPageLinks","onPageChange",4,"ngIf"],["class","p-treetable-footer",4,"ngIf"],["class","p-column-resizer-helper","style","display:none",4,"ngIf"],["class","pi pi-arrow-down p-treetable-reorder-indicator-up",4,"ngIf"],["class","pi pi-arrow-up p-treetable-reorder-indicator-down",4,"ngIf"],[1,"p-treetable-loading"],[1,"p-treetable-loading-overlay","p-component-overlay"],[1,"p-treetable-header"],[4,"ngTemplateOutlet"],["styleClass","p-paginator-top",3,"rows","first","totalRecords","pageLinkSize","alwaysShow","rowsPerPageOptions","templateLeft","templateRight","dropdownAppendTo","currentPageReportTemplate","showFirstLastIcon","dropdownItemTemplate","showCurrentPageReport","showJumpToPageDropdown","showPageLinks","onPageChange"],[1,"p-treetable-wrapper"],[3,"ngClass","ngStyle"],["table",""],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"p-treetable-thead"],[1,"p-treetable-tbody",3,"pTreeTableBody","pTreeTableBodyTemplate"],[1,"p-treetable-tfoot"],[1,"p-treetable-scrollable-wrapper"],["class","p-treetable-scrollable-view p-treetable-frozen-view",3,"ttScrollableView","frozen","ngStyle","scrollHeight",4,"ngIf"],[1,"p-treetable-scrollable-view",3,"ttScrollableView","frozen","scrollHeight","ngStyle"],["scrollableView",""],[1,"p-treetable-scrollable-view","p-treetable-frozen-view",3,"ttScrollableView","frozen","ngStyle","scrollHeight"],["scrollableFrozenView",""],["styleClass","p-paginator-bottom",3,"rows","first","totalRecords","pageLinkSize","alwaysShow","rowsPerPageOptions","templateLeft","templateRight","dropdownAppendTo","currentPageReportTemplate","showFirstLastIcon","dropdownItemTemplate","showCurrentPageReport","showJumpToPageDropdown","showPageLinks","onPageChange"],[1,"p-treetable-footer"],[1,"p-column-resizer-helper",2,"display","none"],["resizeHelper",""],[1,"pi","pi-arrow-down","p-treetable-reorder-indicator-up"],["reorderIndicatorUp",""],[1,"pi","pi-arrow-up","p-treetable-reorder-indicator-down"],["reorderIndicatorDown",""]],template:function(t,a){1&t&&(e.TgZ(0,"div",0,1),e.YNc(2,jr,3,2,"div",2),e.YNc(3,Wr,2,1,"div",3),e.YNc(4,$r,1,15,"p-paginator",4),e.YNc(5,nl,9,16,"div",5),e.YNc(6,rl,4,8,"div",6),e.YNc(7,ll,1,15,"p-paginator",7),e.YNc(8,pl,2,1,"div",8),e.YNc(9,cl,2,0,"div",9),e.YNc(10,dl,2,0,"span",10),e.YNc(11,ul,2,0,"span",11),e.qZA()),2&t&&(e.Tol(a.styleClass),e.Q6J("ngStyle",a.style)("ngClass",e.qbA(14,_l,a.rowHover||"single"===a.selectionMode||"multiple"===a.selectionMode,a.autoLayout,a.resizableColumns,a.resizableColumns&&"fit"===a.columnResizeMode,a.scrollable&&"flex"===a.scrollHeight)),e.xp6(2),e.Q6J("ngIf",a.loading&&a.showLoader),e.xp6(1),e.Q6J("ngIf",a.captionTemplate),e.xp6(1),e.Q6J("ngIf",a.paginator&&("top"===a.paginatorPosition||"both"==a.paginatorPosition)),e.xp6(1),e.Q6J("ngIf",!a.scrollable),e.xp6(1),e.Q6J("ngIf",a.scrollable),e.xp6(1),e.Q6J("ngIf",a.paginator&&("bottom"===a.paginatorPosition||"both"==a.paginatorPosition)),e.xp6(1),e.Q6J("ngIf",a.summaryTemplate),e.xp6(1),e.Q6J("ngIf",a.resizableColumns),e.xp6(1),e.Q6J("ngIf",a.reorderableColumns),e.xp6(1),e.Q6J("ngIf",a.reorderableColumns))},dependencies:function(){return[p.mk,p.O5,p.tP,p.PC,kr,ts,Ge]},styles:[".p-treetable{position:relative}.p-treetable table{border-collapse:collapse;width:100%;table-layout:fixed}.p-treetable .p-sortable-column{cursor:pointer;-webkit-user-select:none;user-select:none}.p-treetable .p-sortable-column .p-column-title,.p-treetable .p-sortable-column .p-sortable-column-icon,.p-treetable .p-sortable-column .p-sortable-column-badge{vertical-align:middle}.p-treetable .p-sortable-column .p-sortable-column-badge{display:inline-flex;align-items:center;justify-content:center}.p-treetable-auto-layout>.p-treetable-wrapper{overflow-x:auto}.p-treetable-auto-layout>.p-treetable-wrapper>table{table-layout:auto}.p-treetable-hoverable-rows .p-treetable-tbody>tr{cursor:pointer}.p-treetable-toggler{cursor:pointer;-webkit-user-select:none;user-select:none;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;overflow:hidden;position:relative}p-treetabletoggler+p-treetablecheckbox .p-checkbox{vertical-align:middle}p-treetabletoggler+p-treetablecheckbox+span{vertical-align:middle}.p-treetable-scrollable-wrapper{position:relative}.p-treetable-scrollable-header,.p-treetable-scrollable-footer{overflow:hidden}.p-treetable-scrollable-body{overflow:auto;position:relative}.p-treetable-scrollable-body>table>.p-treetable-tbody>tr:first-child>td{border-top:0 none}.p-treetable-virtual-table{position:absolute}.p-treetable-frozen-view .p-treetable-scrollable-body{overflow:hidden}.p-treetable-frozen-view>.p-treetable-scrollable-body>table>.p-treetable-tbody>tr>td:last-child{border-right:0 none}.p-treetable-unfrozen-view{position:absolute;top:0}.p-treetable-flex-scrollable,.p-treetable-flex-scrollable .p-treetable-scrollable-wrapper,.p-treetable-flex-scrollable .p-treetable-scrollable-view{display:flex;flex-direction:column;flex:1;height:100%}.p-treetable-flex-scrollable .p-treetable-virtual-scrollable-body{flex:1}.p-treetable-resizable>.p-treetable-wrapper{overflow-x:auto}.p-treetable-resizable .p-treetable-thead>tr>th,.p-treetable-resizable .p-treetable-tfoot>tr>td,.p-treetable-resizable .p-treetable-tbody>tr>td{overflow:hidden}.p-treetable-resizable .p-resizable-column{background-clip:padding-box;position:relative}.p-treetable-resizable-fit .p-resizable-column:last-child .p-column-resizer{display:none}.p-treetable .p-column-resizer{display:block;position:absolute!important;top:0;right:0;margin:0;width:.5rem;height:100%;padding:0;cursor:col-resize;border:1px solid transparent}.p-treetable .p-column-resizer-helper{width:1px;position:absolute;z-index:10;display:none}.p-treetable .p-row-editor-init,.p-treetable .p-row-editor-save,.p-treetable .p-row-editor-cancel,.p-treetable .p-row-toggler{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;position:relative}.p-treetable-reorder-indicator-up,.p-treetable-reorder-indicator-down{position:absolute;display:none}[ttReorderableColumn]{cursor:move}.p-treetable .p-treetable-loading-overlay{position:absolute;display:flex;align-items:center;justify-content:center;z-index:2}.p-treetable .p-scroller-loading{transform:none!important;min-height:0;position:sticky;top:0;left:0}\n"],encapsulation:2}),n})(),Ge=(()=>{class n{constructor(t,a,o){this.tt=t,this.treeTableService=a,this.cd=o,this.subscription=this.tt.tableService.uiUpdateSource$.subscribe(()=>{this.tt.virtualScroll&&this.cd.detectChanges()})}getScrollerOption(t,a){return this.tt.virtualScroll&&(a=a||this.scrollerOptions)?a[t]:null}getRowIndex(t){const a=this.getScrollerOption("getItemOptions");return a?a(t).index:t}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe),e.Y36(ve),e.Y36(e.sBO))},n.\u0275cmp=e.Xpm({type:n,selectors:[["","pTreeTableBody",""]],hostAttrs:[1,"p-element"],inputs:{columns:["pTreeTableBody","columns"],template:["pTreeTableBodyTemplate","template"],frozen:"frozen",serializedNodes:"serializedNodes",scrollerOptions:"scrollerOptions"},attrs:ml,decls:2,vars:3,consts:[["ngFor","",3,"ngForOf","ngForTrackBy"],[4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(t,a){1&t&&(e.YNc(0,xl,1,1,"ng-template",0),e.YNc(1,Zl,2,5,"ng-container",1)),2&t&&(e.Q6J("ngForOf",a.serializedNodes||a.tt.serializedValue)("ngForTrackBy",a.tt.rowTrackBy),e.xp6(1),e.Q6J("ngIf",a.tt.isEmpty()))},dependencies:[p.sg,p.O5,p.tP],encapsulation:2}),n})(),ts=(()=>{class n{constructor(t,a,o){this.tt=t,this.el=a,this.zone=o}get scrollHeight(){return this._scrollHeight}set scrollHeight(t){this._scrollHeight=t,null!=t&&(t.includes("%")||t.includes("calc"))&&console.log('Percentage scroll height calculation is removed in favor of the more performant CSS based flex mode, use scrollHeight="flex" instead.')}ngAfterViewInit(){if(this.frozen)this.scrollableAlignerViewChild&&this.scrollableAlignerViewChild.nativeElement&&(this.scrollableAlignerViewChild.nativeElement.style.height=F.p.calculateScrollbarHeight()+"px");else{(this.tt.frozenColumns||this.tt.frozenBodyTemplate)&&F.p.addClass(this.el.nativeElement,"p-treetable-unfrozen-view");let t=this.el.nativeElement.previousElementSibling;t&&(this.frozenSiblingBody=F.p.findSingle(t,this.tt.virtualScroll?".p-scroller-viewport":".p-treetable-scrollable-body"));let a=F.p.calculateScrollbarWidth();this.scrollHeaderBoxViewChild.nativeElement.style.paddingRight=a+"px",this.scrollFooterBoxViewChild&&this.scrollFooterBoxViewChild.nativeElement&&(this.scrollFooterBoxViewChild.nativeElement.style.paddingRight=a+"px")}this.bindEvents()}bindEvents(){this.zone.runOutsideAngular(()=>{this.scrollHeaderViewChild&&this.scrollHeaderViewChild.nativeElement&&(this.headerScrollListener=this.onHeaderScroll.bind(this),this.scrollHeaderBoxViewChild.nativeElement.addEventListener("scroll",this.headerScrollListener)),this.scrollFooterViewChild&&this.scrollFooterViewChild.nativeElement&&(this.footerScrollListener=this.onFooterScroll.bind(this),this.scrollFooterViewChild.nativeElement.addEventListener("scroll",this.footerScrollListener)),this.frozen||(this.bodyScrollListener=this.onBodyScroll.bind(this),this.tt.virtualScroll?this.scroller.getElementRef().nativeElement.addEventListener("scroll",this.bodyScrollListener):this.scrollBodyViewChild.nativeElement.addEventListener("scroll",this.bodyScrollListener))})}unbindEvents(){this.scrollHeaderViewChild&&this.scrollHeaderViewChild.nativeElement&&this.scrollHeaderBoxViewChild.nativeElement.removeEventListener("scroll",this.headerScrollListener),this.scrollFooterViewChild&&this.scrollFooterViewChild.nativeElement&&this.scrollFooterViewChild.nativeElement.removeEventListener("scroll",this.footerScrollListener),this.scrollBodyViewChild&&this.scrollBodyViewChild.nativeElement&&this.scrollBodyViewChild.nativeElement.removeEventListener("scroll",this.bodyScrollListener),this.scroller&&this.scroller.getElementRef()&&this.scroller.getElementRef().nativeElement.removeEventListener("scroll",this.bodyScrollListener)}onHeaderScroll(){const t=this.scrollHeaderViewChild.nativeElement.scrollLeft;this.scrollBodyViewChild.nativeElement.scrollLeft=t,this.scrollFooterViewChild&&this.scrollFooterViewChild.nativeElement&&(this.scrollFooterViewChild.nativeElement.scrollLeft=t),this.preventBodyScrollPropagation=!0}onFooterScroll(){const t=this.scrollFooterViewChild.nativeElement.scrollLeft;this.scrollBodyViewChild.nativeElement.scrollLeft=t,this.scrollHeaderViewChild&&this.scrollHeaderViewChild.nativeElement&&(this.scrollHeaderViewChild.nativeElement.scrollLeft=t),this.preventBodyScrollPropagation=!0}onBodyScroll(t){this.preventBodyScrollPropagation?this.preventBodyScrollPropagation=!1:(this.scrollHeaderViewChild&&this.scrollHeaderViewChild.nativeElement&&(this.scrollHeaderBoxViewChild.nativeElement.style.marginLeft=-1*t.target.scrollLeft+"px"),this.scrollFooterViewChild&&this.scrollFooterViewChild.nativeElement&&(this.scrollFooterBoxViewChild.nativeElement.style.marginLeft=-1*t.target.scrollLeft+"px"),this.frozenSiblingBody&&(this.frozenSiblingBody.scrollTop=t.target.scrollTop))}scrollToVirtualIndex(t){this.scroller&&this.scroller.scrollToIndex(t)}scrollTo(t){this.scroller?this.scroller.scrollTo(t):this.scrollBodyViewChild.nativeElement.scrollTo?this.scrollBodyViewChild.nativeElement.scrollTo(t):(this.scrollBodyViewChild.nativeElement.scrollLeft=t.left,this.scrollBodyViewChild.nativeElement.scrollTop=t.top)}ngOnDestroy(){this.unbindEvents(),this.frozenSiblingBody=null}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe),e.Y36(e.SBq),e.Y36(e.R0b))},n.\u0275cmp=e.Xpm({type:n,selectors:[["","ttScrollableView",""]],viewQuery:function(t,a){if(1&t&&(e.Gf(Dl,5),e.Gf(vl,5),e.Gf(bl,5),e.Gf(yl,5),e.Gf(Sl,5),e.Gf(Al,5),e.Gf(wl,5),e.Gf(Fl,5),e.Gf(Ml,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.scrollHeaderViewChild=o.first),e.iGM(o=e.CRH())&&(a.scrollHeaderBoxViewChild=o.first),e.iGM(o=e.CRH())&&(a.scrollBodyViewChild=o.first),e.iGM(o=e.CRH())&&(a.scrollTableViewChild=o.first),e.iGM(o=e.CRH())&&(a.scrollLoadingTableViewChild=o.first),e.iGM(o=e.CRH())&&(a.scrollFooterViewChild=o.first),e.iGM(o=e.CRH())&&(a.scrollFooterBoxViewChild=o.first),e.iGM(o=e.CRH())&&(a.scrollableAlignerViewChild=o.first),e.iGM(o=e.CRH())&&(a.scroller=o.first)}},hostAttrs:[1,"p-element"],inputs:{columns:["ttScrollableView","columns"],frozen:"frozen",scrollHeight:"scrollHeight"},attrs:ql,decls:13,vars:13,consts:[[1,"p-treetable-scrollable-header"],["scrollHeader",""],[1,"p-treetable-scrollable-header-box"],["scrollHeaderBox",""],[1,"p-treetable-scrollable-header-table",3,"ngClass","ngStyle"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"p-treetable-thead"],["styleClass","p-treetable-scrollable-body",3,"items","style","scrollHeight","itemSize","lazy","options","onLazyLoad",4,"ngIf"],[4,"ngIf"],["buildInItems",""],["class","p-treetable-scrollable-footer",4,"ngIf"],["styleClass","p-treetable-scrollable-body",3,"items","scrollHeight","itemSize","lazy","options","onLazyLoad"],["scroller",""],["pTemplate","content"],["pTemplate","loader"],[1,"p-treetable-scrollable-body",3,"ngStyle"],["scrollBody",""],[3,"ngClass","ngStyle"],["scrollTable",""],[1,"p-treetable-tbody",3,"pTreeTableBody","pTreeTableBodyTemplate","serializedNodes","frozen"],["style","background-color:transparent",4,"ngIf"],[2,"background-color","transparent"],["scrollableAligner",""],[1,"p-treetable-scrollable-footer"],["scrollFooter",""],[1,"p-treetable-scrollable-footer-box"],["scrollFooterBox",""],[1,"p-treetable-scrollable-footer-table",3,"ngClass","ngStyle"],[1,"p-treetable-tfoot"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0,1)(2,"div",2,3)(4,"table",4),e.YNc(5,Il,1,0,"ng-container",5),e.TgZ(6,"thead",6),e.YNc(7,Pl,1,0,"ng-container",5),e.qZA()()()(),e.YNc(8,El,4,10,"p-scroller",7),e.YNc(9,Hl,4,10,"ng-container",8),e.YNc(10,Kl,5,15,"ng-template",null,9,e.W1O),e.YNc(12,Wl,8,10,"div",10)),2&t&&(e.xp6(4),e.Q6J("ngClass",a.tt.tableStyleClass)("ngStyle",a.tt.tableStyle),e.xp6(1),e.Q6J("ngTemplateOutlet",a.frozen&&a.tt.frozenColGroupTemplate||a.tt.colGroupTemplate)("ngTemplateOutletContext",e.VKq(9,ee,a.columns)),e.xp6(2),e.Q6J("ngTemplateOutlet",a.frozen&&a.tt.frozenHeaderTemplate||a.tt.headerTemplate)("ngTemplateOutletContext",e.VKq(11,ee,a.columns)),e.xp6(1),e.Q6J("ngIf",a.tt.virtualScroll),e.xp6(1),e.Q6J("ngIf",!a.tt.virtualScroll),e.xp6(3),e.Q6J("ngIf",a.tt.footerTemplate))},dependencies:[p.mk,p.O5,p.tP,p.PC,H.jx,re.T,Ge],encapsulation:2}),n})(),ns=(()=>{class n{constructor(t){this.tt=t,this.isEnabled()&&(this.subscription=this.tt.tableService.sortSource$.subscribe(a=>{this.updateSortState()}))}ngOnInit(){this.isEnabled()&&this.updateSortState()}updateSortState(){this.sorted=this.tt.isSorted(this.field)}onClick(t){this.isEnabled()&&(this.updateSortState(),this.tt.sort({originalEvent:t,field:this.field}),F.p.clearSelection())}onEnterKey(t){this.onClick(t)}isEnabled(){return!0!==this.ttSortableColumnDisabled}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe))},n.\u0275dir=e.lG2({type:n,selectors:[["","ttSortableColumn",""]],hostAttrs:[1,"p-element"],hostVars:6,hostBindings:function(t,a){1&t&&e.NdJ("click",function(i){return a.onClick(i)})("keydown.enter",function(i){return a.onEnterKey(i)}),2&t&&(e.uIk("tabindex",a.isEnabled()?"0":null)("role","columnheader"),e.ekj("p-sortable-column",a.isEnabled())("p-highlight",a.sorted))},inputs:{field:["ttSortableColumn","field"],ttSortableColumnDisabled:"ttSortableColumnDisabled"}}),n})(),os=(()=>{class n{constructor(t,a){this.tt=t,this.cd=a,this.subscription=this.tt.tableService.sortSource$.subscribe(o=>{this.updateSortState(),this.cd.markForCheck()})}ngOnInit(){this.updateSortState()}onClick(t){t.preventDefault()}updateSortState(){if("single"===this.tt.sortMode)this.sortOrder=this.tt.isSorted(this.field)?this.tt.sortOrder:0;else if("multiple"===this.tt.sortMode){let t=this.tt.getSortMeta(this.field);this.sortOrder=t?t.order:0}}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe),e.Y36(e.sBO))},n.\u0275cmp=e.Xpm({type:n,selectors:[["p-treeTableSortIcon"]],hostAttrs:[1,"p-element"],inputs:{field:"field",ariaLabelDesc:"ariaLabelDesc",ariaLabelAsc:"ariaLabelAsc"},decls:1,vars:5,consts:[[1,"p-sortable-column-icon","pi","pi-fw",3,"ngClass"]],template:function(t,a){1&t&&e._UZ(0,"i",0),2&t&&e.Q6J("ngClass",e.kEZ(1,$l,1===a.sortOrder,-1===a.sortOrder,0===a.sortOrder))},dependencies:[p.mk],encapsulation:2,changeDetection:0}),n})(),as=(()=>{class n{constructor(t,a,o){this.tt=t,this.el=a,this.zone=o}onKeyDown(t){switch(t.which){case 40:let a=this.el.nativeElement.nextElementSibling;a&&a.focus(),t.preventDefault();break;case 38:let o=this.el.nativeElement.previousElementSibling;o&&o.focus(),t.preventDefault();break;case 37:this.rowNode.node.expanded&&(this.tt.toggleRowIndex=F.p.index(this.el.nativeElement),this.rowNode.node.expanded=!1,this.tt.onNodeCollapse.emit({originalEvent:t,node:this.rowNode.node}),this.tt.updateSerializedValue(),this.tt.tableService.onUIUpdate(this.tt.value),this.restoreFocus());break;case 39:this.rowNode.node.expanded||(this.tt.toggleRowIndex=F.p.index(this.el.nativeElement),this.rowNode.node.expanded=!0,this.tt.onNodeExpand.emit({originalEvent:t,node:this.rowNode.node}),this.tt.updateSerializedValue(),this.tt.tableService.onUIUpdate(this.tt.value),this.restoreFocus())}}restoreFocus(){this.zone.runOutsideAngular(()=>{setTimeout(()=>{let t=F.p.findSingle(this.tt.containerViewChild.nativeElement,".p-treetable-tbody").children[this.tt.toggleRowIndex];t&&t.focus()},25)})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe),e.Y36(e.SBq),e.Y36(e.R0b))},n.\u0275dir=e.lG2({type:n,selectors:[["","ttRow",""]],hostAttrs:[1,"p-element"],hostVars:1,hostBindings:function(t,a){1&t&&e.NdJ("keydown",function(i){return a.onKeyDown(i)}),2&t&&e.uIk("tabindex","0")},inputs:{rowNode:["ttRow","rowNode"]}}),n})(),is=(()=>{class n{constructor(t){this.tt=t}onClick(t){this.rowNode.node.expanded=!this.rowNode.node.expanded,this.rowNode.node.expanded?this.tt.onNodeExpand.emit({originalEvent:t,node:this.rowNode.node}):this.tt.onNodeCollapse.emit({originalEvent:t,node:this.rowNode.node}),this.tt.updateSerializedValue(),this.tt.tableService.onUIUpdate(this.tt.value),t.preventDefault()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(oe))},n.\u0275cmp=e.Xpm({type:n,selectors:[["p-treeTableToggler"]],hostAttrs:[1,"p-element"],inputs:{rowNode:"rowNode"},decls:2,vars:5,consts:[["type","button","tabindex","-1","pRipple","",1,"p-treetable-toggler","p-link",3,"click"],[3,"ngClass"]],template:function(t,a){1&t&&(e.TgZ(0,"button",0),e.NdJ("click",function(i){return a.onClick(i)}),e._UZ(1,"i",1),e.qZA()),2&t&&(e.Udp("visibility",!1===a.rowNode.node.leaf||a.rowNode.node.children&&a.rowNode.node.children.length?"visible":"hidden")("margin-left",16*a.rowNode.level+"px"),e.xp6(1),e.Q6J("ngClass",a.rowNode.node.expanded?"pi pi-fw pi-chevron-down":"pi pi-fw pi-chevron-right"))},dependencies:[p.mk,ie.H],encapsulation:2}),n})(),rs=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[p.ez,Er,ie.T,re.v,H.m8,re.v]}),n})();function ls(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",12),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",13),e._uU(2," Export"),e.qZA()}}function ss(n,r){if(1&n&&(e.TgZ(0,"span",22),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function ps(n,r){if(1&n&&(e.TgZ(0,"span",22),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function cs(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",14)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",15),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Categories"),e.qZA(),e.TgZ(8,"ng-select",16),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,ss,2,2,"ng-template",17),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Brand"),e.qZA(),e.TgZ(13,"ng-select",18),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.BrandID=o)}),e.YNc(14,ps,2,2,"ng-template",17),e.qZA()(),e.TgZ(15,"div")(16,"h6"),e._uU(17,"From - To"),e.qZA(),e.TgZ(18,"div")(19,"datepicker",19),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(20,"div",20)(21,"datepicker",21),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(5),e.Q6J("items",null==t.pageData.Options?null:t.pageData.Options.Brands)("ngModel",t.pageData.Filter.BrandID),e.xp6(6),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function ds(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",23)(1,"div")(2,"h6"),e._uU(3,"Sales"),e.qZA(),e.TgZ(4,"ng-select-infinite",24),e.NdJ("selectedChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SalesID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Customer"),e.qZA(),e.TgZ(8,"autocompleteV2",25),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CustomerID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Exclude Zero"),e.qZA(),e.TgZ(12,"radio-options",26),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ExcludeZero=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("selected",t.pageData.Filter.SalesID)("items",null==t.pageData.Options?null:t.pageData.Options.Sales),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CustomerID),e.xp6(4),e.Q6J("model",t.pageData.Filter.ExcludeZero)}}function us(n,r){1&n&&(e.TgZ(0,"th",46),e._uU(1," Cost "),e._UZ(2,"p-treeTableSortIcon",47),e.qZA())}function _s(n,r){1&n&&(e.TgZ(0,"th",48),e._uU(1," Profit "),e._UZ(2,"p-treeTableSortIcon",49),e.qZA())}function ms(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"th",33),e._uU(2," Category "),e._UZ(3,"p-treeTableSortIcon",34),e.qZA(),e.TgZ(4,"th",35),e._uU(5," Quantity "),e._UZ(6,"p-treeTableSortIcon",36),e.qZA(),e.TgZ(7,"th",37),e._uU(8," Gross Sales "),e._UZ(9,"p-treeTableSortIcon",36),e.qZA(),e.TgZ(10,"th",38),e._uU(11," Discount "),e._UZ(12,"p-treeTableSortIcon",39),e.qZA(),e.TgZ(13,"th",40),e._uU(14," Net Sales "),e._UZ(15,"p-treeTableSortIcon",41),e.qZA(),e.YNc(16,us,3,0,"th",42),e.YNc(17,_s,3,0,"th",43),e.TgZ(18,"th",44),e._uU(19," % "),e._UZ(20,"p-treeTableSortIcon",45),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(16),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost)}}function gs(n,r){if(1&n&&(e.TgZ(0,"span",58),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().rowData;e.xp6(1),e.hij("(",e.lcZ(2,1,t.QuantityIndirect),")")}}function hs(n,r){if(1&n&&(e.TgZ(0,"span",58),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().rowData;e.xp6(1),e.hij("(",e.lcZ(2,1,t.TotalIndirect),")")}}function fs(n,r){if(1&n&&(e.TgZ(0,"span",59),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().rowData;e.xp6(1),e.hij("(",e.lcZ(2,1,t.DiscountIndirect+t.DiscountAmountIndirect),")")}}function xs(n,r){if(1&n&&(e.TgZ(0,"span",58),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().rowData;e.xp6(1),e.hij("(",e.lcZ(2,1,t.NetSalesIndirect),")")}}function Ts(n,r){if(1&n&&(e.TgZ(0,"span",59),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2).rowData;e.xp6(1),e.hij("(",e.lcZ(2,1,t.CostInDirect),")")}}function Cs(n,r){if(1&n&&(e.TgZ(0,"td",53),e._uU(1),e.ALo(2,"number"),e.YNc(3,Ts,3,3,"span",55),e.qZA()),2&n){const t=e.oxw().rowData;e.xp6(1),e.hij("",e.lcZ(2,2,t.Cost)," "),e.xp6(2),e.Q6J("ngIf",t.CostInDirect)}}function Zs(n,r){if(1&n&&(e.TgZ(0,"span",58),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2).rowData;e.xp6(1),e.hij("(",e.lcZ(2,1,t.ProfitInDirect),")")}}function Ds(n,r){if(1&n&&(e.TgZ(0,"td",53),e._uU(1),e.ALo(2,"number"),e.YNc(3,Zs,3,3,"span",54),e.qZA()),2&n){const t=e.oxw().rowData;e.xp6(1),e.hij("",e.lcZ(2,2,t.Profit)," "),e.xp6(2),e.Q6J("ngIf",t.ProfitInDirect)}}function vs(n,r){if(1&n&&(e.TgZ(0,"span",58),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().rowData;e.xp6(1),e.hij("(",e.lcZ(2,1,t.PercentageInDirect),")%")}}const bs=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]},ys=function(n,r,t){return{CategoryID:n,From:r,To:t}};function Ss(n,r){if(1&n&&(e.TgZ(0,"tr",50)(1,"td"),e._UZ(2,"p-treeTableToggler",51),e.TgZ(3,"a",52),e.ALo(4,"date"),e.ALo(5,"date"),e._uU(6),e.qZA()(),e.TgZ(7,"td",53),e._uU(8),e.ALo(9,"number"),e.YNc(10,gs,3,3,"span",54),e.qZA(),e.TgZ(11,"td",53),e._uU(12),e.ALo(13,"number"),e.YNc(14,hs,3,3,"span",54),e.qZA(),e.TgZ(15,"td",53),e._uU(16),e.ALo(17,"number"),e.YNc(18,fs,3,3,"span",55),e.qZA(),e.TgZ(19,"td",53),e._uU(20),e.ALo(21,"number"),e.YNc(22,xs,3,3,"span",54),e.qZA(),e.YNc(23,Cs,4,4,"td",56),e.YNc(24,Ds,4,4,"td",56),e.TgZ(25,"td",57),e._uU(26),e.ALo(27,"number"),e.YNc(28,vs,3,3,"span",54),e.qZA()()),2&n){const t=r.$implicit,a=r.rowData,o=e.oxw(2);e.Q6J("ttRow",t),e.xp6(2),e.Q6J("rowNode",t),e.xp6(1),e.Q6J("routerLink",e.DdM(33,bs))("queryParams",e.kEZ(34,ys,a.ID,e.xi3(4,17,o.pageData.Filter.From,"yyyy-MM-dd"),e.xi3(5,20,o.pageData.Filter.To,"yyyy-MM-dd"))),e.xp6(3),e.Oqu(a.Name),e.xp6(2),e.hij("",e.lcZ(9,23,a.Quantity)," "),e.xp6(2),e.Q6J("ngIf",a.QuantityIndirect),e.xp6(2),e.hij("",e.lcZ(13,25,a.Total)," "),e.xp6(2),e.Q6J("ngIf",a.TotalIndirect),e.xp6(2),e.hij("",e.lcZ(17,27,a.Discount+a.DiscountAmount)," "),e.xp6(2),e.Q6J("ngIf",a.DiscountIndirect+a.DiscountAmountIndirect),e.xp6(2),e.hij("",e.lcZ(21,29,a.NetSales)," "),e.xp6(2),e.Q6J("ngIf",a.NetSalesIndirect),e.xp6(1),e.Q6J("ngIf",o.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",o.roleService.product.Cost),e.xp6(2),e.hij("",e.lcZ(27,31,a.Percentage),"% "),e.xp6(2),e.Q6J("ngIf",a.ProfitInDirect)}}function As(n,r){if(1&n&&(e.TgZ(0,"td",62),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.hij(" ",e.lcZ(2,1,t.data.TotalDiscountAmount.TotalCost),"")}}function ws(n,r){if(1&n&&(e.TgZ(0,"td",62),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.hij(" ",e.lcZ(2,1,t.data.TotalDiscountAmount.TotalProfit),"")}}function Fs(n,r){if(1&n&&(e.TgZ(0,"tr",60)(1,"td",61),e._uU(2,"Total : "),e.qZA(),e.TgZ(3,"td",62),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td",62)(7,"a"),e._uU(8),e.ALo(9,"number"),e.qZA()(),e.TgZ(10,"td",62),e._uU(11),e.ALo(12,"number"),e.qZA(),e.TgZ(13,"td",62),e._uU(14),e.ALo(15,"number"),e.qZA(),e.YNc(16,As,3,3,"td",63),e.YNc(17,ws,3,3,"td",63),e.TgZ(18,"td",64),e._uU(19),e.ALo(20,"number"),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(4),e.Oqu(e.lcZ(5,7,t.data.TotalDiscountAmount.TotalQuantity)),e.xp6(4),e.Oqu(e.lcZ(9,9,t.data.TotalDiscountAmount.TotalGross)),e.xp6(3),e.Oqu(e.lcZ(12,11,t.data.TotalDiscountAmount.Discount+t.data.TotalDiscountAmount.DiscountAmount)),e.xp6(3),e.Oqu(e.lcZ(15,13,t.data.TotalDiscountAmount.NetSales)),e.xp6(2),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(2),e.hij(" ",e.lcZ(20,15,t.data.TotalDiscountAmount.TotalPercentage),"%")}}function Ms(n,r){if(1&n&&(e.TgZ(0,"div",65)(1,"small",66),e._uU(2,"Gross Sales :"),e.qZA(),e.TgZ(3,"strong",67),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"small",66),e._uU(7,"- Discount % :"),e.qZA(),e.TgZ(8,"strong",68),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"small",66),e._uU(12),e.qZA(),e.TgZ(13,"strong",68),e._uU(14),e.ALo(15,"number"),e.qZA(),e.TgZ(16,"small",66),e._uU(17),e.qZA(),e.TgZ(18,"strong",68),e._uU(19),e.ALo(20,"number"),e.qZA(),e.TgZ(21,"small",66),e._uU(22),e.qZA(),e.TgZ(23,"strong",69),e._uU(24),e.ALo(25,"number"),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(4),e.Oqu(e.lcZ(5,8,t.data.TotalDiscountAmount.TotalGross)),e.xp6(5),e.Oqu(e.lcZ(10,10,t.data.TotalDiscountAmount.Discount)),e.xp6(3),e.hij("- Discount ",t.data.Currency," :"),e.xp6(2),e.Oqu(e.lcZ(15,12,t.data.TotalDiscountAmount.DiscountAmount)),e.xp6(3),e.hij("- Point Used ",t.data.Currency," :"),e.xp6(2),e.Oqu(e.lcZ(20,14,t.data.TotalDiscountAmount.PointUsed)),e.xp6(3),e.hij("= Net Sales ",t.data.Currency," :"),e.xp6(2),e.Oqu(e.lcZ(25,16,t.data.TotalDiscountAmount.NetSales))}}const qs=function(){return{"min-width":"50rem"}};function Is(n,r){if(1&n&&(e.TgZ(0,"div",27)(1,"p-treeTable",28),e.YNc(2,ms,21,2,"ng-template",29),e.YNc(3,Ss,29,38,"ng-template",30),e.YNc(4,Fs,21,17,"ng-template",31),e.qZA(),e.YNc(5,Ms,26,18,"div",32),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("value",t.data.data)("scrollable",!0)("tableStyle",e.DdM(4,qs)),e.xp6(4),e.Q6J("ngIf",t.data.data.length>0)}}const Os=function(){return["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"]},Js=function(){return["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"]};let Ls=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/CategorySales_TopCategory","ReportLoader/CategorySales"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"hideMore",!0),this.httpService=t,this.csvConverter=a,this.reportFilterService=o,this.roleService=i,this.matDialog=s}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"Name":return this.compare(o.Name,i.Name,s);case"Total":return this.compare(o.Total,i.Total,s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);case"Discount":return this.compare(o.Discount,i.Discount,s);case"NetSales":return this.compare(o.NetSales,i.NetSales,s);case"Cost":return this.compare(o.Cost,i.Cost,s);case"Profit":return this.compare(o.Profit,i.Profit,s);case"Percentage":return this.compare(o.Percentage,i.Percentage,s);default:return 0}}):a}openExportModal(){this.matDialog.open(M.H,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(N.z),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-category-sales"]],features:[e.qOj],decls:18,vars:12,consts:[[3,"pageData","text","hideSearchBox","textChange","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","me-6",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-scale-balanced","me-2"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ms-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fa-solid","fa-caret-down"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["matTooltipPosition","above",3,"matTooltip"],["id","more-filter","container","",1,"ms-6"],["bindLabel","Name","bindValue","ID","placeholder","Choose...","id","inputSales",3,"selected","items","selectedChange"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100",3,"ngModel","ngModelChange"],[3,"model","modelChange"],[1,"container-fluid","mt-5"],[3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["pTemplate","footer"],["class","h6 mt-12",4,"ngIf"],["ttSortableColumn","Name"],["field","Name"],["ttSortableColumn","Quantity",2,"width","120px"],["field","Quantity"],["ttSortableColumn","Total",2,"width","120px"],["ttSortableColumn","TotalDiscount",2,"width","120px"],["field","TotalDiscount"],["ttSortableColumn","NetSales",2,"width","120px"],["field","NetSales"],["style","width: 120px;","ttSortableColumn","Cost",4,"ngIf"],["style","width: 120px;","ttSortableColumn","Profit",4,"ngIf"],["ttSortableColumn","Percentage",2,"width","100px"],["field","Percentage"],["ttSortableColumn","Cost",2,"width","120px"],["field","Cost"],["ttSortableColumn","Profit",2,"width","120px"],["field","Profit"],[3,"ttRow"],[3,"rowNode"],[3,"routerLink","queryParams"],[2,"width","120px"],["class","text-success",4,"ngIf"],["class","text-danger",4,"ngIf"],["style","width: 120px;",4,"ngIf"],[2,"width","100px"],[1,"text-success"],[1,"text-danger"],[1,"table-footer"],[1,"text-end"],[1,"text-end",2,"width","120px"],["style","width: 120px;","class","text-end",4,"ngIf"],[1,"text-end",2,"width","100px"],[1,"h6","mt-12"],[1,"text-muted","h6"],[1,"text-primary","fw-bold","h2"],[1,"text-danger","fw-bold","h2"],[1,"text-success","fw-bold","h2"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.Number=i})("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,ls,3,0,"button",1),e.TgZ(3,"a",2),e._UZ(4,"i",3),e._uU(5," Chart View"),e.qZA(),e.TgZ(6,"a",4),e._UZ(7,"i",5),e._uU(8,"By Outlet"),e.qZA()(),e.TgZ(9,"filters")(10,"div",6),e.YNc(11,cs,22,9,"div",7),e.YNc(12,ds,13,4,"div",8),e.TgZ(13,"a",9),e.NdJ("click",function(){return a.hideMore=!a.hideMore}),e._uU(14),e._UZ(15,"i",10),e.qZA()()(),e.TgZ(16,"content"),e.YNc(17,Is,6,5,"div",11),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.Number)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(10,Os)),e.xp6(3),e.Q6J("routerLink",e.DdM(11,Js)),e.xp6(5),e.Q6J("ngIf",a.pageData.Filter),e.xp6(1),e.Q6J("ngIf",!a.hideMore),e.xp6(2),e.hij("",a.hideMore?"More":"Less"," "),e.xp6(3),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.O5,h.rH,m.w9,m.ir,A.QB,d.JJ,d.On,x.gM,q.P,E.J,j.R,oe,H.jx,is,ns,os,as,p.JJ,p.uU],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} .p-treetable .p-treetable-tfoot>tr>td{border:none;background-color:#fff;font-weight:400}"]})),n})();function Us(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",7),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.convertToCSV(o.csvConverter,!0,"CategorySalesByOutlet.csv"))}),e._UZ(1,"i",8),e._uU(2," Export"),e.qZA()}}function Qs(n,r){if(1&n&&(e.TgZ(0,"span",16),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function ks(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",9)(1,"div")(2,"h6"),e._uU(3,"Categories"),e.qZA(),e.TgZ(4,"ng-select",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(5,Qs,2,2,"ng-template",11),e.qZA()(),e.TgZ(6,"div")(7,"h6"),e._uU(8,"From - To"),e.qZA(),e.TgZ(9,"div")(10,"datepicker",12),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(11,"div",13)(12,"datepicker",14),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Customer"),e.qZA(),e.TgZ(16,"autocompleteV2",15),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CustomerID=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(6),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CustomerID)}}function Es(n,r){if(1&n&&(e.TgZ(0,"th",23),e._uU(1),e.qZA()),2&n){const t=r.$implicit;e.Q6J("mat-sort-header",t),e.xp6(1),e.Oqu(t)}}function Ys(n,r){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit,a=e.oxw().$implicit;e.xp6(1),e.Oqu(a[t])}}function Rs(n,r){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit,a=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,a[t]))}}function Gs(n,r){if(1&n&&(e.TgZ(0,"td"),e.YNc(1,Ys,2,1,"span",22),e.YNc(2,Rs,3,3,"span",22),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.Q6J("ngIf","Category"==t),e.xp6(1),e.Q6J("ngIf","Category"!=t)}}function Hs(n,r){if(1&n&&(e.TgZ(0,"tr"),e.YNc(1,Gs,3,2,"td",21),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",a.getKey(t))}}function Vs(n,r){if(1&n&&(e.TgZ(0,"td"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t),"")}}function Bs(n,r){if(1&n&&(e.TgZ(0,"tfoot")(1,"tr",24)(2,"td"),e._uU(3,"Total : "),e.qZA(),e.YNc(4,Vs,3,3,"td",21),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("ngForOf",t.data.Sum)}}function Ks(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",17)(1,"table",18),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",19)(3,"tr"),e.YNc(4,Es,2,2,"th",20),e.qZA()(),e.TgZ(5,"tbody"),e.YNc(6,Hs,2,1,"tr",21),e.qZA(),e.YNc(7,Bs,5,1,"tfoot",22),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngForOf",t.data.Dataheader),e.xp6(2),e.Q6J("ngForOf",t.data.Data),e.xp6(1),e.Q6J("ngIf",t.data.Data.length>0)}}const js=function(){return["/menu/Reports/Sales_Report/Standard/Category_Sold"]};let zs=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),this.httpService=t,this.csvConverter=a,this.reportFilterService=o,this.roleService=i}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(t){return Object.keys(t)}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;for(let c=0;c<this.data.Dataheader.length;c++)if(t.active==this.data.Dataheader[c])return this.compare(o[this.data.Dataheader[c]],i[this.data.Dataheader[c]],s)}):a}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(N.z),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-category-sales-by-outlet"]],features:[e.qOj],decls:11,vars:8,consts:[[3,"pageData","text","hideSearchBox","textChange","onSubmit"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary me-6",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[3,"mat-sort-header",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"mat-sort-header"],[1,"table-footer"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.Number=i})("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,Us,3,0,"a",1),e.TgZ(3,"a",2),e._UZ(4,"i",3),e._uU(5," Table View"),e.qZA()(),e.TgZ(6,"filters")(7,"div",4),e.YNc(8,ks,17,5,"div",5),e.qZA()(),e.TgZ(9,"content"),e.YNc(10,Ks,8,3,"div",6),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.Number)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(7,js)),e.xp6(5),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,m.ir,A.QB,d.JJ,d.On,x.gM,f.YE,f.nU,E.J,p.JJ]})),n})();var _e=g(86371);function Ws(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",6)(1,"div")(2,"h6"),e._uU(3,"Month"),e.qZA(),e.TgZ(4,"ng-select",7),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Month=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Year"),e.qZA(),e.TgZ(8,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Year=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Currency"),e.qZA(),e.TgZ(12,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CurrencyID=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.Month)("items",t.Months),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.Year)("items",t.Years),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CurrencyID)("items",t.pageData.Options.Currencies)}}function $s(n,r){if(1&n&&(e.TgZ(0,"div",10),e._UZ(1,"POS-pie-chart",11),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("config",t.pieConfig)("data",t.PieData)}}const Xs=function(){return["/menu/Reports/Sales_Report/Standard/Category_Sold"]};let ep=(()=>{class n extends D.n{constructor(t){super(t,"Report/CategoryChart","ReportLoader/CategoryChartLoader"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"Months",C.gT.Months),(0,l.Z)(this,"Years",C.gT.GenerateYears((new Date).getFullYear(),11,!0)),(0,l.Z)(this,"pieConfig",{title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}}),(0,l.Z)(this,"PieData",{}),this.httpService=t}postInit(){this.PieData=this.data.filter(t=>t.Total>0).map(t=>({name:t.Name,y:t.Total}))}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-category"]],features:[e.qOj],decls:10,vars:6,consts:[[3,"pageData","text","textChange","onSubmit"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["container",""],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange"],["placeholder","Year",3,"ngModel","items","ngModelChange"],["bindLabel","Symbol","bindValue","ID","placeholder","All",3,"ngModel","items","ngModelChange"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.Number=i})("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions")(2,"a",1),e._UZ(3,"i",2),e._uU(4," Table View"),e.qZA()(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,Ws,13,6,"div",4),e.qZA()(),e.TgZ(8,"content"),e.YNc(9,$s,2,2,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.Number),e.xp6(2),e.Q6J("routerLink",e.DdM(5,Xs)),e.xp6(5),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.O5,h.rH,m.w9,d.JJ,d.On,_e.J]})),n})();var te=g(46510);function tp(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",6)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",7),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"From - To"),e.qZA(),e.TgZ(8,"div")(9,"datepicker",8),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(10,"div",9)(11,"datepicker",10),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function np(n,r){if(1&n&&(e.TgZ(0,"div",11)(1,"div",12)(2,"div",13)(3,"div",14)(4,"div",15)(5,"div",16)(6,"p",17),e._uU(7,"Transaction Per Hour"),e.qZA()(),e.TgZ(8,"div",18),e._UZ(9,"POS-line-chart",19),e.qZA()()()(),e.TgZ(10,"div",13)(11,"div",14)(12,"div",15)(13,"div",16)(14,"p",17),e._uU(15,"Transaction Per Session"),e.qZA()(),e.TgZ(16,"div",18),e._UZ(17,"POS-pie-chart",19),e.qZA()()()()()()),2&n){const t=e.oxw();e.xp6(9),e.Q6J("config",t.chartConfig)("data",t.ChartData),e.xp6(8),e.Q6J("config",t.pieConfig)("data",t.PieData)}}const op=function(){return["/menu/Reports/Sales_Report/Standard/Peak/Peak"]};let ap=(()=>{class n extends D.n{constructor(t,a,o){super(t,"Report/PeakHour","ReportLoader/PeakHourLoader"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"categories",[]),(0,l.Z)(this,"PieData",{}),(0,l.Z)(this,"ChartData",{}),(0,l.Z)(this,"pieConfig",{title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}}),(0,l.Z)(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(i,s){return i+"<br/>"+s.series.name+": <b>"+s.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}),this.httpService=t,this.reportFilterService=a,this.roleService=o}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}postInit(){this.menuData.H=this.data.PageTitle;const a=[],o=[];this.data.Data.forEach(i=>{a.push(i.Name),o.push({name:i.Name+": "+i.Description,y:i.Transaction})}),this.PieData=o,this.ChartData={series:this.data.series},this.categories=this.data.categories}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(N.z),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-peak-hour"]],features:[e.qOj],decls:10,vars:6,consts:[[3,"pageData","hideSearchBox","onSubmit"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an Outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col"],[1,"card"],[1,"card-body","mt-5"],[1,"card-title"],[1,"h3"],[1,"card-text"],[3,"config","data"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions")(2,"a",1),e._UZ(3,"i",2),e._uU(4," Table View"),e.qZA()(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,tp,12,5,"div",4),e.qZA()(),e.TgZ(8,"content"),e.YNc(9,np,18,4,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(5,op)),e.xp6(5),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,_e.J,te.D]})),n})();function ip(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",5),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",6),e._uU(2," Export "),e.qZA()}}function rp(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"From - To"),e.qZA(),e.TgZ(8,"div")(9,"datepicker",9),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(10,"div",10)(11,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function lp(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.ALo(3,"number"),e.qZA(),e.TgZ(4,"td",20),e._uU(5),e.ALo(6,"number"),e.qZA(),e.TgZ(7,"td",20),e._uU(8),e.ALo(9,"number"),e.qZA(),e.TgZ(10,"td",20),e._uU(11),e.ALo(12,"number"),e.qZA(),e.TgZ(13,"td",20),e._uU(14),e.ALo(15,"number"),e.qZA()()),2&n){const t=r.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,5,t.Visitor)),e.xp6(3),e.Oqu(e.lcZ(6,7,t.Orders)),e.xp6(3),e.Oqu(e.lcZ(9,9,t.TotalVisitor)),e.xp6(3),e.Oqu(e.lcZ(12,11,t.Sales)),e.xp6(3),e.Oqu(e.lcZ(15,13,t.Sales/(t.Visitor*t.Orders)))}}function sp(n,r){if(1&n&&(e.TgZ(0,"div",12)(1,"table",13)(2,"thead",14)(3,"tr")(4,"th",15),e._uU(5,"Number of Person"),e.qZA(),e.TgZ(6,"th",16),e._uU(7,"Transaction"),e.qZA(),e.TgZ(8,"th",16),e._uU(9,"Total Visitor"),e.qZA(),e.TgZ(10,"th",16),e._uU(11,"Sales"),e.qZA(),e.TgZ(12,"th",17),e._uU(13,"Average Spending"),e.qZA()()(),e.TgZ(14,"tbody"),e.YNc(15,lp,16,15,"tr",18),e.qZA(),e.TgZ(16,"tfoot")(17,"tr",19)(18,"td",20),e._uU(19,"Total"),e.qZA(),e.TgZ(20,"td",20),e._uU(21),e.ALo(22,"number"),e.ALo(23,"sum"),e.qZA(),e.TgZ(24,"td",20),e._uU(25),e.ALo(26,"number"),e.ALo(27,"sum"),e.qZA(),e.TgZ(28,"td",20),e._uU(29),e.ALo(30,"number"),e.ALo(31,"sum"),e.qZA(),e.TgZ(32,"td",20),e._uU(33),e.ALo(34,"number"),e.qZA()()()()()),2&n){const t=e.oxw();e.xp6(15),e.Q6J("ngForOf",t.data),e.xp6(6),e.Oqu(e.lcZ(22,5,e.xi3(23,7,t.data,"Orders"))),e.xp6(4),e.Oqu(e.lcZ(26,10,e.xi3(27,12,t.data,"TotalVisitor"))),e.xp6(4),e.Oqu(e.lcZ(30,15,e.xi3(31,17,t.data,"Sales"))),e.xp6(4),e.Oqu(e.lcZ(34,20,t.getSpendingPerPersonSum(t.data)))}}let pp=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i}getSpendingPerPersonSum(t){return t.reduce((a,o)=>a+o.Sales/(o.Visitor*o.Orders),0)}openExportModal(){this.matDialog.open(M.H,{data:{title:"Visitor Report",exportTypes:[{ID:"ReportExport/GetNumberOfPersonList",Value:"Default",FileName:"Visitor Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-visitor"]],features:[e.qOj],decls:8,vars:5,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,ip,3,0,"a",1),e.qZA(),e.TgZ(3,"filters")(4,"div",2),e.YNc(5,rp,12,5,"div",3),e.qZA()(),e.TgZ(6,"content"),e.YNc(7,sp,35,22,"div",4),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,m.w9,A.QB,d.JJ,d.On,S.qU,p.JJ]})),n})();function cp(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",7),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",8),e._uU(2," Export "),e.qZA()}}function dp(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",9)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"From - To"),e.qZA(),e.TgZ(8,"div")(9,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(10,"div",12)(11,"datepicker",13),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function up(n,r){1&n&&(e.TgZ(0,"th",19),e._uU(1,"Revenue"),e.qZA())}function _p(n,r){if(1&n&&(e.TgZ(0,"td",24),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Revenue))}}function mp(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td",24),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td",24),e._uU(7),e.ALo(8,"number"),e.qZA(),e.TgZ(9,"td",24),e._uU(10),e.ALo(11,"number"),e.qZA(),e.TgZ(12,"td",24),e._uU(13),e.ALo(14,"number"),e.ALo(15,"RoundUp"),e.qZA(),e.TgZ(16,"td",24),e._uU(17),e.ALo(18,"number"),e.ALo(19,"RoundUp"),e.qZA(),e.YNc(20,_p,3,3,"td",25),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.TimeFormat),e.xp6(2),e.Oqu(e.lcZ(5,7,t.Count)),e.xp6(3),e.Oqu(e.lcZ(8,9,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(11,11,t.Sales)),e.xp6(3),e.Oqu(e.lcZ(14,13,e.lcZ(15,15,t.Tax))),e.xp6(4),e.Oqu(e.lcZ(18,17,e.lcZ(19,19,t.SalesWithTax))),e.xp6(3),e.Q6J("ngIf",a.roleService.product.Cost||a.roleService.report.Profit)}}function gp(n,r){if(1&n&&(e.TgZ(0,"td",24),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(e.lcZ(2,1,e.xi3(3,3,t.data.Data,"Revenue")))}}function hp(n,r){if(1&n&&(e.TgZ(0,"div",14)(1,"table",15)(2,"thead",16)(3,"tr")(4,"th",17),e._uU(5,"Time"),e.qZA(),e.TgZ(6,"th",18),e._uU(7,"Order"),e.qZA(),e.TgZ(8,"th",18),e._uU(9,"Quantity"),e.qZA(),e.TgZ(10,"th",19),e._uU(11,"Sales"),e.qZA(),e.TgZ(12,"th",19),e._uU(13,"Tax"),e.qZA(),e.TgZ(14,"th",19),e._uU(15,"Sales + Tax"),e.qZA(),e.YNc(16,up,2,0,"th",20),e.qZA()(),e.TgZ(17,"tbody"),e.YNc(18,mp,21,21,"tr",21),e.qZA(),e.TgZ(19,"tfoot")(20,"tr",22),e._UZ(21,"td",23),e.TgZ(22,"td",24),e._uU(23),e.ALo(24,"number"),e.ALo(25,"sum"),e.qZA(),e.TgZ(26,"td",24),e._uU(27),e.ALo(28,"number"),e.ALo(29,"sum"),e.qZA(),e.TgZ(30,"td",24),e._uU(31),e.ALo(32,"number"),e.ALo(33,"sum"),e.qZA(),e.TgZ(34,"td",24),e._uU(35),e.ALo(36,"number"),e.ALo(37,"RoundUp"),e.ALo(38,"sum"),e.qZA(),e.TgZ(39,"td",24),e._uU(40),e.ALo(41,"number"),e.ALo(42,"RoundUp"),e.ALo(43,"sum"),e.qZA(),e.YNc(44,gp,4,6,"td",25),e.qZA()()()()),2&n){const t=e.oxw();e.xp6(16),e.Q6J("ngIf",t.roleService.product.Cost||t.roleService.report.Profit),e.xp6(2),e.Q6J("ngForOf",t.data.Data),e.xp6(5),e.Oqu(e.lcZ(24,8,e.xi3(25,10,t.data.Data,"Count"))),e.xp6(4),e.Oqu(e.lcZ(28,13,e.xi3(29,15,t.data.Data,"Quantity"))),e.xp6(4),e.Oqu(e.lcZ(32,18,e.xi3(33,20,t.data.Data,"Sales"))),e.xp6(4),e.Oqu(e.lcZ(36,23,e.lcZ(37,25,e.xi3(38,27,t.data.Data,"Tax")))),e.xp6(5),e.Oqu(e.lcZ(41,30,e.lcZ(42,32,e.xi3(43,34,t.data.Data,"SalesWithTax")))),e.xp6(4),e.Q6J("ngIf",t.roleService.product.Cost||t.roleService.report.Profit)}}const fp=function(){return["/menu/Reports/Sales_Report/Standard/Peak"]};let xp=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/GetPeakHourList","ReportLoader/PeakHourLoader"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"reportFilterService",void 0),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.reportFilterService=s,this.menuData.H="Peak Hour Table"}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}changeExport(){this.pageData.Filter.Export=!1}openExportModal(){this.matDialog.open(M.H,{data:{title:"Peak Hour",exportTypes:[{ID:"ReportExport/GetPeakHourList",Value:"Default",FileName:"Peak Hour"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw),e.Y36(N.z))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-table-view"]],features:[e.qOj],decls:11,vars:7,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an Outlet",3,"multiple","ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[1,"text-end",2,"width","50px"],[1,"text-end",2,"width","120px"],["style","width: 120px","class"," text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,cp,3,0,"a",1),e.TgZ(3,"a",2),e._UZ(4,"i",3),e._uU(5," Chart View"),e.qZA()(),e.TgZ(6,"filters")(7,"div",4),e.YNc(8,dp,12,5,"div",5),e.qZA()(),e.TgZ(9,"content"),e.YNc(10,hp,45,37,"div",6),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(6,fp)),e.xp6(5),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,S.qU,S.Fo,p.JJ]})),n})();var be=g(8277),He=g(4859),le=g(59549);function Tp(n,r){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"mat-date-range-picker-actions")(2,"button",8),e._uU(3,"Cancel"),e.qZA(),e.TgZ(4,"button",9),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onSelectDate())}),e._uU(5,"Search"),e.qZA()(),e.BQk()}}const Cp={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let fe=(()=>{class n{constructor(){(0,l.Z)(this,"placeholder",void 0),(0,l.Z)(this,"displayToggle",void 0),(0,l.Z)(this,"minDate",void 0),(0,l.Z)(this,"maxDate",void 0),(0,l.Z)(this,"showButtonConfirm",!1),(0,l.Z)(this,"width",void 0),(0,l.Z)(this,"dateChange",new e.vpe),(0,l.Z)(this,"from",void 0),(0,l.Z)(this,"to",void 0)}fromDateChange(t){let a=t?.toDate();this.from=a}toDateChange(t){if(t){let a=t.toDate();this.to=a,this.showButtonConfirm||this.emitDateChange()}}emitDateChange(){this.dateChange.emit({from:this.from,to:this.to})}onSelectDate(){this.emitDateChange()}onOpenDatepicker(){var t=new bootstrap.Dropdown(document.getElementById("dropdown-filter"));t&&(t._config.autoClose="inside")}onCloseDatepicker(){var t=new bootstrap.Dropdown(document.getElementById("dropdown-filter"));t&&(t._config.autoClose="outside")}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["app-datepicker-range"]],inputs:{placeholder:"placeholder",displayToggle:"displayToggle",minDate:"minDate",maxDate:"maxDate",showButtonConfirm:"showButtonConfirm",width:"width",from:"from",to:"to"},outputs:{dateChange:"dateChange"},features:[e._Bn([{provide:Y._A,useClass:be.t7,deps:[Y.Ad]},{provide:Y.sG,useValue:Cp}])],decls:8,vars:9,consts:[["appearance","outline",1,"p-0","date-range"],["id","dates",3,"min","max","rangePicker"],["matStartDate","","placeholder","Start date",3,"value","dateChange","click"],["matEndDate","","placeholder","End date",3,"value","dateChange","click"],["matSuffix","",3,"for"],[3,"opened","closed"],["picker",""],[4,"ngIf"],["mat-button","","matDateRangePickerCancel",""],["mat-raised-button","","color","primary","matDateRangePickerApply","",3,"click"]],template:function(t,a){if(1&t){const o=e.EpF();e.TgZ(0,"mat-form-field",0)(1,"mat-date-range-input",1)(2,"input",2),e.NdJ("dateChange",function(s){return a.fromDateChange(s.value)})("click",function(){e.CHM(o);const s=e.MAs(6);return e.KtG(s.open())}),e.qZA(),e.TgZ(3,"input",3),e.NdJ("dateChange",function(s){return a.toDateChange(s.value)})("click",function(){e.CHM(o);const s=e.MAs(6);return e.KtG(s.open())}),e.qZA()(),e._UZ(4,"mat-datepicker-toggle",4),e.TgZ(5,"mat-date-range-picker",5,6),e.NdJ("opened",function(){return a.onOpenDatepicker()})("closed",function(){return a.onCloseDatepicker()}),e.YNc(7,Tp,6,0,"ng-container",7),e.qZA()()}if(2&t){const o=e.MAs(6);e.Udp("width",a.width||100,"%"),e.xp6(1),e.Q6J("min",a.minDate)("max",a.maxDate)("rangePicker",o),e.xp6(1),e.Q6J("value",a.from),e.xp6(1),e.Q6J("value",a.to),e.xp6(1),e.Q6J("for",o),e.xp6(3),e.Q6J("ngIf",a.showButtonConfirm)}},dependencies:[p.O5,O.nW,O.wx,O.zY,O.By,O._g,O.M5,O.dp,O.DK,le.KE,le.R9,He.lW],styles:["mat-form-field.date-range>div.mat-mdc-form-field-wrapper{padding-bottom:0!important}mat-form-field.date-range .mat-mdc-text-field-wrapper.mdc-text-field{padding-left:14px!important}mat-form-field.date-range .mat-mdc-form-field-icon-prefix{padding:0!important}mat-form-field.date-range .mat-date-range-input-container{margin-top:6px;font-size:11px}mat-form-field.date-range .mat-mdc-form-field-icon-suffix{padding:0!important}\n"],encapsulation:2})),n})(),Zp=(()=>{class n{}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)}),(0,l.Z)(n,"\u0275mod",e.oAB({type:n})),(0,l.Z)(n,"\u0275inj",e.cJS({providers:[O.FA],imports:[p.ez,Y.XK,O.FA,le.lN,A.ZU,B.c,d.u5,He.ot]})),n})();function Dp(n,r){if(1&n&&(e.TgZ(0,"span",13),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function vp(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,Dp,2,2,"ng-template",10),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Currency"),e.qZA(),e.TgZ(13,"ng-select",11),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CurrencyID=o)}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"Date"),e.qZA(),e.TgZ(17,"app-datepicker-range",12),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onFilterDateChange(o))}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(5),e.Q6J("ngModel",t.pageData.Filter.CurrencyID)("items",null==t.pageData.Options?null:t.pageData.Options.Currencies),e.xp6(4),e.Q6J("from",t.pageData.Filter.From)("to",t.pageData.Filter.To)("maxDate",t.maxFilterDate)}}function bp(n,r){if(1&n&&(e.TgZ(0,"div",14),e._UZ(1,"POS-line-chart",15),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("config",t.chartConfig)("data",t.ChartData)}}const Sp=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"]},Ve=function(n,r){return{From:n,To:r}},wp=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"]};let Fp=(()=>{class n extends D.n{constructor(t,a,o){super(t,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,a),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"maxFilterDate",void 0),(0,l.Z)(this,"minFilterDate",void 0),(0,l.Z)(this,"ChartData",{}),(0,l.Z)(this,"chartConfig",void 0),this.reportFilterService=o,this.initValidateFilterDate()}preInitList(){const t=this.route.snapshot.queryParams;t.From&&(this.pageData.Filter.From=t.From,this.pageData.Filter.To=t.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=C.gT.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(){const t=new Date(this.pageData.Filter.From),a=new Date(this.pageData.Filter.To);return C.gT.getDatesInRange(t,a).map(s=>`${s.getDate()} ${C.gT.Months[s.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(t){this.pageData.Filter.From=t.from?.toISOString(),this.pageData.Filter.To=t.to?.toISOString()}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(h.gz),e.Y36(N.z))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-daily-sales"]],features:[e.qOj],decls:12,vars:16,consts:[[3,"pageData","hideSearchBox","onSubmit"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary","me-3",3,"routerLink","queryParams"],[1,"fa","fa-table"],["matTooltipPosition","above","matTooltip","Daily Quantity",1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["bindLabel","Symbol","bindValue","ID","placeholder","Choose a Currency",3,"ngModel","items","ngModelChange"],[3,"from","to","maxDate","dateChange"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions")(2,"a",1),e._UZ(3,"i",2),e._uU(4," Table View"),e.qZA(),e.TgZ(5,"a",3),e._uU(6,"Daily Quantity"),e.qZA()(),e.TgZ(7,"filters")(8,"div",4),e.YNc(9,vp,18,10,"div",5),e.qZA()(),e.TgZ(10,"content"),e.YNc(11,bp,2,2,"div",6),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(8,Sp))("queryParams",e.WLB(9,Ve,null==a.pageData.Filter?null:a.pageData.Filter.From,null==a.pageData.Filter?null:a.pageData.Filter.To)),e.xp6(3),e.Q6J("routerLink",e.DdM(12,wp))("queryParams",e.WLB(13,Ve,null==a.pageData.Filter?null:a.pageData.Filter.From,null==a.pageData.Filter?null:a.pageData.Filter.To)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.O5,h.rH,m.w9,m.ir,d.JJ,d.On,x.gM,te.D,fe]})),n})();const Mp={parse:{dateInput:"MM/YYYY"},display:{dateInput:"MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let ye=(()=>{class n{constructor(){(0,l.Z)(this,"date",void 0),(0,l.Z)(this,"dateChange",new e.vpe),(0,l.Z)(this,"width",void 0),(0,l.Z)(this,"minDate",C.gT.MinDate)}ngOnInit(){}setMonthAndYear(t,a){let o=null;t&&(o=t.toDate(),o.setHours(0,0,0,0)),this.date=o,this.dateChange.emit(o),a.close()}onOpenDatepicker(){const t=document.getElementById("dropdown-filter");if(t){var a=new bootstrap.Dropdown(t);a&&(a._config.autoClose="inside")}}onCloseDatepicker(){const t=document.getElementById("dropdown-filter");if(t){var a=new bootstrap.Dropdown(t);a&&(a._config.autoClose="outside")}}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["datepicker-year-month"]],inputs:{date:"date",width:"width"},outputs:{dateChange:"dateChange"},standalone:!0,features:[e._Bn([{provide:Y._A,useClass:be.t7,deps:[Y.Ad,be.o8]},{provide:Y.sG,useValue:Mp}]),e.jDz],decls:5,vars:5,consts:[["appearance","outline",1,"datepicker"],["matInput","",3,"matDatepicker","value"],["matIconSuffix","",3,"for"],["startView","multi-year",3,"monthSelected","opened","closed"],["dp",""]],template:function(t,a){if(1&t){const o=e.EpF();e.TgZ(0,"mat-form-field",0),e._UZ(1,"input",1)(2,"mat-datepicker-toggle",2),e.TgZ(3,"mat-datepicker",3,4),e.NdJ("monthSelected",function(s){e.CHM(o);const c=e.MAs(4);return e.KtG(a.setMonthAndYear(s,c))})("opened",function(){return a.onOpenDatepicker()})("closed",function(){return a.onCloseDatepicker()}),e.qZA()()}if(2&t){const o=e.MAs(4);e.Udp("width",a.width||100,"%"),e.xp6(1),e.Q6J("matDatepicker",o)("value",a.date==a.minDate?null:a.date),e.xp6(1),e.Q6J("for",o)}},dependencies:[d.u5,Y.XK,O.FA,O.Mq,O.hl,O.nW,B.c,B.Nt,le.KE,le.R9,le.lN],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}\n"],encapsulation:2})),n})();function qp(n,r){if(1&n&&(e.TgZ(0,"span",15),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function Ip(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"From - To"),e.qZA(),e.TgZ(8,"div")(9,"datepicker-year-month",9),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(10,"div",10)(11,"datepicker-year-month",9),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Compare To Year"),e.qZA(),e.TgZ(15,"ng-select",11),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.LastYear=o)}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Category"),e.qZA(),e.TgZ(19,"ng-select",12),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(20,qp,2,2,"ng-template",13),e.qZA()(),e.TgZ(21,"div")(22,"h6"),e._uU(23,"Currency"),e.qZA(),e.TgZ(24,"ng-select",14),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.currency=o)})("change",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.checkFilterCurrency())}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.LastYear)("items",t.optionsCompareYear),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(5),e.Q6J("ngModel",t.currency)("items",null==t.pageData.Options?null:t.pageData.Options.Currencies)}}function Pp(n,r){if(1&n&&(e.TgZ(0,"div",16),e._UZ(1,"POS-line-chart",17),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("config",t.chartConfig)("data",t.chartData)}}const Np=function(){return["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"]};let Jp=(()=>{class n extends D.n{constructor(t,a,o){super(t,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"chartData",{Series:[]}),(0,l.Z)(this,"chartConfig",void 0),(0,l.Z)(this,"currency",-1),(0,l.Z)(this,"optionsCompareYear",[{value:1,label:"Last one year"},{value:2,label:"Last two year"}]),this.httpService=t,this.csvConverter=a,this.reportFilterService=o}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Options.Currencies.unshift({ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"}),this.checkFilterCurrency()}checkFilterCurrency(){this.pageData.Filter.CurrencyID=this.currency<0?null:this.currency}postInit(){const t=this.generateSeries();this.chartData={series:t},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:void 0},labels:{formatter:function(){return C.gT.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){const o=this.axis.chart.userOptions.total;let i,s="",c=Math.abs(o[this.x]?o[this.x]:0);return c>999&&c<1e10?(s="K",i=(c/1e3).toFixed(0)):c>=1e10?(s="M",i=(c/1e6).toFixed(0)):c<900&&(i=c.toString()),this.total<0&&(i="-"+i),i.replace(/\B(?=(\d{3})+(?!\d))/g,",")+s}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let a=this.series.chart.series;a=a.filter(c=>this.series?.name?.includes("Cost")?c?.name?.includes("Cost"):0==c?.name?.includes("Cost"));let o=[],i="",s=this.point.index;return a.forEach(c=>{c.options.stack===this.point.series.options.stack&&(o=c.name.split(" "),i+=`<b>${o[0]}</b> <br/><br/>\n ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(c.points[s].y)} <br/><br/>`)}),i}},total:this.generateStackTotal()},this.changeStackLabelFormat()}generateSeries(){let t,a=[];return a=this.data.MonthlySalesRank.map(o=>(t={name:`${o.Name} ${o.CompareYear}`,data:o.Sales,stack:o.Year},"Profit"==o.Name&&(t.visible=!1,t.showInLegend=!1),t)),a}generateStackTotal(){let t=[];return C.gT.IsNotEmpty(this.pageData.Filter.LastYear)?this.data.MonthlySalesRank.filter(o=>"Sales"==o.Name).forEach(o=>{t=[...o.Sales,...t]}):t=this.data.MonthlySalesRank.filter(a=>"Sales"==a.Name)[0]?.Sales,t}changeStackLabelFormat(){let t=0;C.gT.IsNotEmpty(this.pageData.Filter.LastYear)&&(this.chartConfig.yAxis={stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){const o=this.axis.chart.userOptions.total;return t++,C.gT.formatNumber(o[t-1]?o[t-1]:0)}}})}isNotEmpty(t){return C.gT.IsNotEmpty(t)}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(N.z))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-monthly-sales"]],features:[e.qOj],decls:11,vars:6,consts:[[3,"pageData","hideSearchBox","onSubmit"],[1,"btn-group"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],[3,"date","dateChange"],[1,"mt-4"],["bindValue","value","bindLabel","label","placeholder","Compare To Year",3,"ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["bindLabel","Symbol","bindValue","ID","placeholder","Choose a Currency",3,"ngModel","items","ngModelChange","change"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions")(2,"div",1)(3,"a",2),e._UZ(4,"i",3),e._uU(5,"Table View"),e.qZA()()(),e.TgZ(6,"filters")(7,"div",4),e.YNc(8,Ip,25,11,"div",5),e.qZA()(),e.TgZ(9,"content"),e.YNc(10,Pp,2,2,"div",6),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(3),e.Q6J("routerLink",e.DdM(5,Np)),e.xp6(5),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.O5,h.rH,m.w9,m.ir,d.JJ,d.On,x.gM,te.D,ye]})),n})();function Lp(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",7),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",8),e._uU(2," Export "),e.qZA()}}function Up(n,r){if(1&n&&(e.TgZ(0,"span",18),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function Qp(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",9)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",11),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,Up,2,2,"ng-template",12),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Sales Name"),e.qZA(),e.TgZ(13,"ng-select-infinite",13),e.NdJ("selectedChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SalesID=o)}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"Year to Compare"),e.qZA(),e.TgZ(17,"div",14)(18,"div",15)(19,"ng-select",16),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.FromYear=o)}),e.qZA()(),e.TgZ(20,"div",15)(21,"ng-select",16),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ToYear=o)}),e.qZA()()()(),e.TgZ(22,"div")(23,"h6"),e._uU(24,"Type"),e.qZA(),e.TgZ(25,"ng-select",17),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Option?null:t.pageData.Option.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Option?null:t.pageData.Option.Categories),e.xp6(5),e.Q6J("selected",t.pageData.Filter.SalesID)("items",null==t.pageData.Option?null:t.pageData.Option.Sales),e.xp6(6),e.Q6J("ngModel",t.pageData.Filter.FromYear)("items",t.Years),e.xp6(2),e.Q6J("ngModel",t.pageData.Filter.ToYear)("items",t.Years),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Option?null:t.pageData.Option.Types)}}function kp(n,r){if(1&n&&(e.TgZ(0,"th",30),e._uU(1),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.hij(" ",t,"")}}function Ep(n,r){if(1&n&&(e.TgZ(0,"td",30),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=r.$implicit,a=e.oxw().$implicit,o=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,o.filterSales(a.Sales,"Year",t),"Sales"))," ")}}const Be=function(n,r){return{"text-success fw-bold":n,"text-danger fw-bold":r}};function Yp(n,r){if(1&n&&(e.TgZ(0,"tr",31)(1,"td",22),e._uU(2),e.ALo(3,"Month"),e.qZA(),e.YNc(4,Ep,4,6,"td",32),e.TgZ(5,"td",33),e.ALo(6,"sum"),e.ALo(7,"sum"),e._uU(8),e.ALo(9,"number"),e.ALo(10,"sum"),e.qZA(),e.TgZ(11,"td",33),e.ALo(12,"sum"),e.ALo(13,"sum"),e._uU(14),e.ALo(15,"number"),e.ALo(16,"sum"),e.qZA()()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(e.lcZ(3,6,t.Month)),e.xp6(2),e.Q6J("ngForOf",a.data.HeaderList),e.xp6(1),e.Q6J("ngClass",e.WLB(30,Be,e.xi3(6,8,a.filterSales(t.Difference,"Month",t.Month),"Difference")>0,e.xi3(7,11,a.filterSales(t.Difference,"Month",t.Month),"Difference")<0)),e.xp6(3),e.hij(" ",e.lcZ(9,14,e.xi3(10,16,a.filterSales(t.Difference,"Month",t.Month),"Difference"))," "),e.xp6(3),e.Q6J("ngClass",e.WLB(33,Be,e.xi3(12,19,a.filterSales(t.Difference,"Month",t.Month),"Percentage")>0,e.xi3(13,22,a.filterSales(t.Difference,"Month",t.Month),"Percentage")<0)),e.xp6(3),e.hij(" ",e.lcZ(15,25,e.xi3(16,27,a.filterSales(t.Difference,"Month",t.Month),"Percentage"))," ")}}function Rp(n,r){if(1&n&&(e.TgZ(0,"td",34),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.ALo(4,"GetChildrenArray"),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,a.filterSales(e.xi3(4,6,a.data.Data,"Sales"),"Year",t),"Sales"))," ")}}const Gp=function(n,r){return{"text-success":n,"text-danger":r}};function Hp(n,r){if(1&n&&(e.TgZ(0,"div",19)(1,"table",20)(2,"thead",21)(3,"tr")(4,"th",22),e._uU(5,"Month"),e.qZA(),e.YNc(6,kp,2,1,"th",23),e.TgZ(7,"th",24),e._uU(8,"Differences (IDR)"),e.qZA(),e.TgZ(9,"th",24),e._uU(10,"Percentage (%)"),e.qZA()()(),e.TgZ(11,"tbody"),e.YNc(12,Yp,17,36,"tr",25),e.qZA(),e.TgZ(13,"tfoot",26)(14,"tr")(15,"td",27),e._uU(16,"Total :"),e.qZA(),e.YNc(17,Rp,5,9,"td",28),e.TgZ(18,"td",29),e._uU(19),e.ALo(20,"number"),e.qZA()()()()()),2&n){const t=e.oxw();e.xp6(6),e.Q6J("ngForOf",t.data.HeaderList),e.xp6(6),e.Q6J("ngForOf",t.data.Data),e.xp6(5),e.Q6J("ngForOf",t.data.HeaderList),e.xp6(1),e.Q6J("ngClass",e.WLB(7,Gp,t.data.TotalDiff>0,t.data.TotalDiff<0)),e.xp6(1),e.hij(" ",e.lcZ(20,5,t.data.TotalDiff),"")}}const Vp=function(){return["/menu/Reports/Sales_Report/Standard/Yearly"]};let Bp=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/YearlySalesList","ReportLoader/YearlyReportSales"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"Years",C.gT.GenerateYears((new Date).getFullYear(),11,!0)),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i}filterSales(t,a,o){return t.filter(function(i){return i[a]==o})}openExportModal(){this.matDialog.open(M.H,{data:{title:"Yearly",exportTypes:[{ID:"ReportExport/YearlySalesList",Value:"Default",FileName:"Yearly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-yearly"]],features:[e.qOj],decls:11,vars:7,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["bindLabel","Name","bindValue","ID","placeholder","Choose a Sales",3,"selected","items","selectedChange"],[1,"row"],[1,"col-6"],["placeholder","Year",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a Types",3,"ngModel","items","ngModelChange"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","30px"],["style","width: 20px","class"," text-end",4,"ngFor","ngForOf"],[1,"text-end",2,"width","30px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"fw-bold","text-success"],["class","text-end text-success",4,"ngFor","ngForOf"],[1,"text-end",3,"ngClass"],[1,"text-end",2,"width","20px"],[1,"border-bottom"],["style","width: 20px","class","text-end",4,"ngFor","ngForOf"],[1,"text-end",2,"width","30px",3,"ngClass"],[1,"text-end","text-success"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,Lp,3,0,"a",1),e.TgZ(3,"a",2),e._UZ(4,"i",3),e._uU(5," Chart View"),e.qZA()(),e.TgZ(6,"filters")(7,"div",4),e.YNc(8,Qp,26,13,"div",5),e.qZA()(),e.TgZ(9,"content"),e.YNc(10,Hp,21,10,"div",6),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(6,Vp)),e.xp6(5),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.mk,p.sg,p.O5,h.rH,m.w9,m.ir,d.JJ,d.On,x.gM,j.R,S.qU,S.mr,S.J1,p.JJ]})),n})();function Kp(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",15),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",16),e._uU(2," Export "),e.qZA()}}function jp(n,r){if(1&n&&(e.TgZ(0,"span",23),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function zp(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",17)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",18),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",19),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,jp,2,2,"ng-template",20),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Sales Name"),e.qZA(),e.TgZ(13,"ng-select-infinite",21),e.NdJ("selectedChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SalesID=o)}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"Date"),e.qZA(),e.TgZ(17,"app-datepicker-range",22),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onFilterDateChange(o))}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(5),e.Q6J("selected",t.pageData.Filter.SalesID)("items",null==t.pageData.Options?null:t.pageData.Options.Sales),e.xp6(4),e.Q6J("from",t.pageData.Filter.From)("to",t.pageData.Filter.To)("maxDate",t.maxFilterDate)}}function Wp(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",24)(1,"div")(2,"h6"),e._uU(3,"Delivery"),e.qZA(),e.TgZ(4,"ng-select",25),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.DeliveryID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Currency"),e.qZA(),e.TgZ(8,"ng-select",26),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CurrencyID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Type"),e.qZA(),e.TgZ(12,"ng-select",27),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.DeliveryID)("items",null==t.pageData.Options?null:t.pageData.Options.Deliveries),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CurrencyID)("items",null==t.pageData.Options?null:t.pageData.Options.Currencies),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Options?null:t.pageData.Options.Types)}}function $p(n,r){1&n&&(e.TgZ(0,"th",47),e._uU(1," Tax "),e.qZA())}function Xp(n,r){1&n&&(e.TgZ(0,"th",48),e._uU(1,"Net Sales + Tax"),e.qZA())}function ec(n,r){1&n&&(e.TgZ(0,"th",49),e._uU(1,"Cost"),e.qZA())}function tc(n,r){1&n&&(e.TgZ(0,"th",50),e._uU(1," Profit "),e.qZA())}function nc(n,r){1&n&&(e.TgZ(0,"th",51),e._uU(1," Profit + Tax Include "),e.qZA())}function oc(n,r){if(1&n&&(e.TgZ(0,"td",44),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Tax))}}function ac(n,r){if(1&n&&(e.TgZ(0,"td",44),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij("",e.lcZ(2,1,t.SalesNetWithTax)," ")}}function ic(n,r){if(1&n&&(e.TgZ(0,"td",53),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.Cost),"")}}function rc(n,r){if(1&n&&(e.TgZ(0,"td",44),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.Profit),"")}}function lc(n,r){if(1&n&&(e.TgZ(0,"td",44),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.ProfitWithTax),"")}}const Ke=function(n){return{"is-weekend":n}};function sc(n,r){if(1&n&&(e.TgZ(0,"tr",52)(1,"td",52),e._uU(2),e.ALo(3,"date"),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.ALo(6,"date"),e.qZA(),e.TgZ(7,"td",44),e._uU(8),e.ALo(9,"number"),e.qZA(),e.TgZ(10,"td",44),e._uU(11),e.ALo(12,"number"),e.qZA(),e.TgZ(13,"td",44),e._uU(14),e.ALo(15,"number"),e.qZA(),e.TgZ(16,"td",44),e._uU(17),e.ALo(18,"number"),e.qZA(),e.YNc(19,oc,3,3,"td",45),e.YNc(20,ac,3,3,"td",45),e.YNc(21,ic,3,3,"td",46),e.YNc(22,rc,3,3,"td",45),e.YNc(23,lc,3,3,"td",45),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.Q6J("ngClass",e.VKq(27,Ke,a.data.DayOfWeekend)),e.xp6(1),e.Q6J("ngClass",e.VKq(29,Ke,t.DayOfWeekend)),e.xp6(1),e.hij(" ",e.xi3(3,13,t.Day,"EEEE")," "),e.xp6(3),e.Oqu(e.xi3(6,16,t.Day,"dd")),e.xp6(3),e.Oqu(e.lcZ(9,19,t.Count)),e.xp6(3),e.Oqu(e.lcZ(12,21,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(15,23,t.Gross)),e.xp6(3),e.Oqu(e.lcZ(18,25,t.SalesNet)),e.xp6(2),e.Q6J("ngIf",a.data.ShowTax),e.xp6(1),e.Q6J("ngIf",a.data.ShowTax),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",a.pageData.Config.IgnoreTax&&a.roleService.report.Profit&&a.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",!a.pageData.Config.IgnoreTax&&a.roleService.report.Profit&&a.roleService.product.Cost)}}function pc(n,r){if(1&n&&(e.TgZ(0,"td",44),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.data.Data,"Tax")),"")}}function cc(n,r){if(1&n&&(e.TgZ(0,"td",44),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.data.Data,"SalesNetWithTax")),"")}}function dc(n,r){if(1&n&&(e.TgZ(0,"td",53),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.data.Data,"Cost")),"")}}function uc(n,r){if(1&n&&(e.TgZ(0,"td",53),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.data.Data,"Profit")),"")}}function _c(n,r){if(1&n&&(e.TgZ(0,"td",44),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.data.Data,"ProfitWithTax")),"")}}function mc(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",28)(1,"table",29),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",30)(3,"tr")(4,"th",31),e._uU(5,"Day"),e.qZA(),e.TgZ(6,"th",32),e._uU(7,"Dt."),e.qZA(),e.TgZ(8,"th",33),e._uU(9,"Trans "),e.qZA(),e.TgZ(10,"th",34),e._uU(11," Quantity"),e.qZA(),e.TgZ(12,"th",35),e._uU(13," Gross"),e.qZA(),e.TgZ(14,"th",36),e._uU(15," Net Sales"),e.qZA(),e.YNc(16,$p,2,0,"th",37),e.YNc(17,Xp,2,0,"th",38),e.YNc(18,ec,2,0,"th",39),e.YNc(19,tc,2,0,"th",40),e.YNc(20,nc,2,0,"th",41),e.qZA()(),e.TgZ(21,"tbody"),e.YNc(22,sc,24,31,"tr",42),e.qZA(),e.TgZ(23,"tfoot")(24,"tr"),e._UZ(25,"td",43)(26,"td",43),e.TgZ(27,"td",44),e._uU(28),e.ALo(29,"number"),e.ALo(30,"sum"),e.qZA(),e.TgZ(31,"td",44),e._uU(32),e.ALo(33,"number"),e.ALo(34,"sum"),e.qZA(),e.TgZ(35,"td",44),e._uU(36),e.ALo(37,"number"),e.ALo(38,"sum"),e.qZA(),e.TgZ(39,"td",44),e._uU(40),e.ALo(41,"number"),e.ALo(42,"sum"),e.qZA(),e.YNc(43,pc,4,6,"td",45),e.YNc(44,cc,4,6,"td",45),e.YNc(45,dc,4,6,"td",46),e.YNc(46,uc,4,6,"td",46),e.YNc(47,_c,4,6,"td",45),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(16),e.Q6J("ngIf",t.data.ShowTax),e.xp6(1),e.Q6J("ngIf",t.data.ShowTax),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.pageData.Config.IgnoreTax&&t.roleService.report.Profit&&t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",!t.pageData.Config.IgnoreTax&&t.roleService.report.Profit&&t.roleService.product.Cost),e.xp6(2),e.Q6J("ngForOf",t.data.Data),e.xp6(6),e.Oqu(e.lcZ(29,15,e.xi3(30,17,t.data.Data,"Count"))),e.xp6(4),e.Oqu(e.lcZ(33,20,e.xi3(34,22,t.data.Data,"Quantity"))),e.xp6(4),e.Oqu(e.lcZ(37,25,e.xi3(38,27,t.data.Data,"Gross"))),e.xp6(4),e.Oqu(e.lcZ(41,30,e.xi3(42,32,t.data.Data,"SalesNet"))),e.xp6(3),e.Q6J("ngIf",t.data.ShowTax),e.xp6(1),e.Q6J("ngIf",t.data.ShowTax),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.pageData.Config.IgnoreTax&&t.roleService.report.Profit&&t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",!t.pageData.Config.IgnoreTax&&t.roleService.report.Profit&&t.roleService.product.Cost)}}const gc=function(){return["/menu/Reports/Sales_Report/Standard/Daily"]},hc=function(n,r){return{From:n,To:r}},xc=function(){return["/menu/Reports/Sales_Report/Standard/Yearly/Comparison"]};let Tc=(()=>{class n extends D.n{constructor(t,a,o,i,s,c){super(t,"Report/DailySalesList","ReportLoader/DailyReportSales",null,c),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"maxFilterDate",new Date),(0,l.Z)(this,"originalData",void 0),(0,l.Z)(this,"hideMore",!0),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.reportFilterService=s,this.activatedRoute=c}postInit(t){this.menuData.H=t.PageTitle,this.originalData=t.Data}preInitList(){const t=this.route.snapshot.queryParams;t.From&&(this.pageData.Filter.From=t.From,this.pageData.Filter.To=t.To),this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>this.compare(o[t.active],i[t.active],"asc"===t.direction)):this.originalData}onFilterDateChange(t){this.pageData.Filter.From=t.from?.toISOString(),this.pageData.Filter.To=t.to?.toISOString()}openExportModal(){this.matDialog.open(M.H,{data:{title:"Daily Sales Report",exportTypes:[{ID:"ReportExport/DailySalesExport",Value:"Default",FileName:"Daily Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw),e.Y36(N.z),e.Y36(h.gz))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-daily"]],features:[e.qOj],decls:21,vars:15,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn-group"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink","queryParams"],[1,"fa-solid","fa-chart-area"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ms-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fa-solid","fa-caret-down"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales",3,"selected","items","selectedChange"],[3,"from","to","maxDate","dateChange"],["matTooltipPosition","above",3,"matTooltip"],["id","more-filter","container","",1,"ms-6"],["bindLabel","Value","bindValue","Key","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose a Currency",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose Type",3,"ngModel","items","ngModelChange"],[1,"container-fluid","mt-5"],["id","tableGrid","api","Report/DailySalesList","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Day",2,"width","90px"],["mat-sort-header","Date",1,"align-left",2,"width","42px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Gross","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","120px"],["style","width: 120px","class"," flex-right","mat-sort-header","Tax","arrowPosition","before",4,"ngIf"],["style","width: 120px","class"," flex-right","mat-sort-header","SalesNetWithTax","arrowPosition","before",4,"ngIf"],["style","width: 120px","class"," flex-right","mat-sort-header","Cost","arrowPosition","before",4,"ngIf"],["style","width: 120px","class"," flex-right","mat-sort-header","Profit","arrowPosition","before",4,"ngIf"],["style","width: 160px","class"," flex-right","mat-sort-header","ProfitWithTax","arrowPosition","before",4,"ngIf"],[3,"ngClass",4,"ngFor","ngForOf"],[1,"empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["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,"text-end","text-danger"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,Kp,3,0,"a",1),e.TgZ(3,"div",2)(4,"a",3),e._UZ(5,"i",4),e._uU(6," Chart View"),e.qZA(),e._UZ(7,"button",5),e.TgZ(8,"ul",6)(9,"li",7)(10,"a",8),e._uU(11,"View Yearly"),e.qZA()()()()(),e.TgZ(12,"filters")(13,"div",9),e.YNc(14,zp,18,10,"div",10),e.YNc(15,Wp,13,6,"div",11),e.qZA(),e.TgZ(16,"a",12),e.NdJ("click",function(){return a.hideMore=!a.hideMore}),e._uU(17),e._UZ(18,"i",13),e.qZA()(),e.TgZ(19,"content"),e.YNc(20,mc,48,35,"div",14),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(2),e.Q6J("routerLink",e.DdM(10,gc))("queryParams",e.WLB(11,hc,null==a.pageData.Filter?null:a.pageData.Filter.From,null==a.pageData.Filter?null:a.pageData.Filter.To)),e.xp6(6),e.Q6J("routerLink",e.DdM(14,xc)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(1),e.Q6J("ngIf",!a.hideMore),e.xp6(2),e.hij("",a.hideMore?"More":"Less"," "),e.xp6(3),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.mk,p.sg,p.O5,h.rH,m.w9,m.ir,d.JJ,d.On,x.gM,f.YE,f.nU,j.R,fe,S.qU,p.JJ,p.uU]})),n})();function Cc(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",12),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",13),e._uU(2," Export "),e.qZA()}}function Zc(n,r){if(1&n&&(e.TgZ(0,"span",23),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function Dc(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",14)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",15),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",16),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,Zc,2,2,"ng-template",17),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Sales Name"),e.qZA(),e.TgZ(13,"ng-select-infinite",18),e.NdJ("selectedChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SalesID=o)}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"Year"),e.qZA(),e.TgZ(17,"ng-select",19),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Year=o)}),e.qZA()(),e.TgZ(18,"div")(19,"h6"),e._uU(20,"Currency"),e.qZA(),e.TgZ(21,"ng-select",20),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CurrencyID=o)}),e.qZA()(),e.TgZ(22,"div")(23,"h6"),e._uU(24,"Type"),e.qZA(),e.TgZ(25,"ng-select",21),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()(),e.TgZ(26,"div")(27,"h6"),e._uU(28,"Multiply Unit Qty"),e.qZA(),e.TgZ(29,"radio-options",22),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.MultiplyUnitQuantity=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(5),e.Q6J("selected",t.pageData.Filter.SalesID)("items",null==t.pageData.Options?null:t.pageData.Options.Sales),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.Year)("items",t.Years),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CurrencyID)("items",null==t.pageData.Options?null:t.pageData.Options.Currencies),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Options?null:t.pageData.Options.Types),e.xp6(4),e.Q6J("model",t.pageData.Filter.MultiplyUnitQuantity)}}function vc(n,r){1&n&&(e.TgZ(0,"th",29),e._uU(1,"Tax"),e.qZA())}function bc(n,r){1&n&&(e.TgZ(0,"th",29),e._uU(1,"Sales + Tax"),e.qZA())}function yc(n,r){1&n&&(e.TgZ(0,"th",29),e._uU(1,"Cost"),e.qZA())}function Sc(n,r){1&n&&(e.TgZ(0,"th",29),e._uU(1,"Profit"),e.qZA())}function Ac(n,r){if(1&n&&(e.TgZ(0,"td",38),e._uU(1),e.ALo(2,"number"),e.ALo(3,"RoundUp"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.xi3(2,1,e.lcZ(3,4,t.Tax),".0-0"))}}function wc(n,r){if(1&n&&(e.TgZ(0,"td",38),e._uU(1),e.ALo(2,"number"),e.ALo(3,"RoundUp"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.xi3(2,1,e.lcZ(3,4,t.SalesNetWithTax),".0-0"))}}function Fc(n,r){if(1&n&&(e.TgZ(0,"td",39),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij("",e.xi3(2,1,t.Cost,".0-0")," ")}}function Mc(n,r){if(1&n&&(e.TgZ(0,"td",33),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij("",e.xi3(2,1,t.Profit,".0-0")," ")}}function qc(n,r){if(1&n&&(e.TgZ(0,"tr",37)(1,"td"),e._uU(2),e.ALo(3,"Month"),e.qZA(),e.TgZ(4,"td",33),e._uU(5),e.ALo(6,"number"),e.qZA(),e.TgZ(7,"td",33),e._uU(8),e.ALo(9,"number"),e.qZA(),e.TgZ(10,"td",33),e._uU(11),e.ALo(12,"number"),e.qZA(),e.TgZ(13,"td",33),e._uU(14),e.ALo(15,"number"),e.qZA(),e.YNc(16,Ac,4,6,"td",34),e.YNc(17,wc,4,6,"td",34),e.YNc(18,Fc,3,4,"td",35),e.YNc(19,Mc,3,4,"td",36),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(e.lcZ(3,9,t.Month)),e.xp6(3),e.Oqu(e.xi3(6,11,t.Count,".0-0")),e.xp6(3),e.Oqu(e.xi3(9,14,t.Quantity,".0-0")),e.xp6(3),e.Oqu(e.xi3(12,17,t.Gross,".0-0")),e.xp6(3),e.Oqu(e.xi3(15,20,t.SalesNet,".0-0")),e.xp6(2),e.Q6J("ngIf",a.data.ShowTax),e.xp6(1),e.Q6J("ngIf",a.data.ShowTax),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost&&a.roleService.report.Profit),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost&&a.roleService.report.Profit)}}function Ic(n,r){if(1&n&&(e.TgZ(0,"td",38),e._uU(1),e.ALo(2,"number"),e.ALo(3,"RoundUp"),e.ALo(4,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.lcZ(3,4,e.xi3(4,6,t.data.Data,"Tax")),".0-0"),"")}}function Pc(n,r){if(1&n&&(e.TgZ(0,"td",38),e._uU(1),e.ALo(2,"number"),e.ALo(3,"RoundUp"),e.ALo(4,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.lcZ(3,4,e.xi3(4,6,t.data.Data,"SalesNetWithTax")),".0-0"),"")}}function Oc(n,r){if(1&n&&(e.TgZ(0,"td",39),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"Cost"),".0-0"),"")}}function Nc(n,r){if(1&n&&(e.TgZ(0,"td",33),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"Profit"),".0-0"),"")}}function Jc(n,r){if(1&n&&(e.TgZ(0,"div",24)(1,"table",25)(2,"thead",26)(3,"tr")(4,"th",27),e._uU(5,"Month"),e.qZA(),e.TgZ(6,"th",28),e._uU(7,"Trans"),e.qZA(),e.TgZ(8,"th",29),e._uU(9,"Quantity"),e.qZA(),e.TgZ(10,"th",29),e._uU(11,"Gross"),e.qZA(),e.TgZ(12,"th",29),e._uU(13,"Net Sales"),e.qZA(),e.YNc(14,vc,2,0,"th",30),e.YNc(15,bc,2,0,"th",30),e.YNc(16,yc,2,0,"th",30),e.YNc(17,Sc,2,0,"th",30),e.qZA()(),e.TgZ(18,"tbody"),e.YNc(19,qc,20,23,"tr",31),e.qZA(),e.TgZ(20,"tfoot")(21,"tr",32),e._UZ(22,"td"),e.TgZ(23,"td",33),e._uU(24),e.ALo(25,"number"),e.ALo(26,"sum"),e.qZA(),e.TgZ(27,"td",33),e._uU(28),e.ALo(29,"number"),e.ALo(30,"sum"),e.qZA(),e.TgZ(31,"td",33),e._uU(32),e.ALo(33,"number"),e.ALo(34,"sum"),e.qZA(),e.TgZ(35,"td",33),e._uU(36),e.ALo(37,"number"),e.ALo(38,"sum"),e.qZA(),e.YNc(39,Ic,5,9,"td",34),e.YNc(40,Pc,5,9,"td",34),e.YNc(41,Oc,4,7,"td",35),e.YNc(42,Nc,4,7,"td",36),e.qZA()()()()),2&n){const t=e.oxw();e.xp6(14),e.Q6J("ngIf",t.data.ShowTax),e.xp6(1),e.Q6J("ngIf",t.data.ShowTax),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost&&t.roleService.report.Profit),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost&&t.roleService.report.Profit),e.xp6(2),e.Q6J("ngForOf",t.data.Data),e.xp6(5),e.Oqu(e.xi3(25,13,e.xi3(26,16,t.data.Data,"Count"),".0-0")),e.xp6(4),e.Oqu(e.xi3(29,19,e.xi3(30,22,t.data.Data,"Quantity"),".0-0")),e.xp6(4),e.Oqu(e.xi3(33,25,e.xi3(34,28,t.data.Data,"Gross"),".0-0")),e.xp6(4),e.Oqu(e.xi3(37,31,e.xi3(38,34,t.data.Data,"Sales"),".0-0")),e.xp6(3),e.Q6J("ngIf",t.data.ShowTax),e.xp6(1),e.Q6J("ngIf",t.data.ShowTax),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost&&t.roleService.report.Profit),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost&&t.roleService.report.Profit)}}const Lc=function(){return["/menu/Reports/Sales_Report/Standard/Monthly"]},Qc=function(){return["/menu/Reports/Sales_Report/Standard/Yearly/Comparison"]};let kc=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/MonthlySalesList","ReportLoader/MonthlyReportSales"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"Years",C.gT.GenerateYears((new Date).getFullYear(),11,!0)),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.reportFilterService=s}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(M.H,{data:{title:"Monthly",exportTypes:[{ID:"ReportExport/MonthlySalesList",Value:"Default",FileName:"Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw),e.Y36(N.z))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-monthly"]],features:[e.qOj],decls:17,vars:9,consts:[[3,"pageData","text","textChange","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn-group"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink"],[1,"fa-solid","fa-chart-bar"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["bindLabel","Name","bindValue","ID","placeholder","Choose a Sales",3,"selected","items","selectedChange"],["placeholder","Year",3,"ngModel","items","ngModelChange"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose a Currency",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose Type",3,"ngModel","items","ngModelChange"],["name","Inventory",3,"model","modelChange"],["matTooltipPosition","above",3,"matTooltip"],[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",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[1,"border-bottom"],[1,"text-end"],[1,"text-end","text-danger"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.Number=i})("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,Cc,3,0,"a",1),e.TgZ(3,"div",2)(4,"a",3),e._UZ(5,"i",4),e._uU(6," Chart View"),e.qZA(),e._UZ(7,"button",5),e.TgZ(8,"ul",6)(9,"li",7)(10,"a",8),e._uU(11,"View Yearly"),e.qZA()()()()(),e.TgZ(12,"filters")(13,"div",9),e.YNc(14,Dc,30,14,"div",10),e.qZA()(),e.TgZ(15,"content"),e.YNc(16,Jc,43,37,"div",11),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.Number),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(2),e.Q6J("routerLink",e.DdM(7,Lc)),e.xp6(6),e.Q6J("routerLink",e.DdM(8,Qc)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,m.ir,d.JJ,d.On,x.gM,q.P,j.R,S.qU,S.Fo,S.mr,p.JJ]})),n})();function Ec(n,r){if(1&n&&(e.TgZ(0,"span",12),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function Yc(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",6)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",7),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,Ec,2,2,"ng-template",9),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Currency"),e.qZA(),e.TgZ(13,"ng-select",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.currency=o)})("change",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.checkFilterCurrency())}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"Date"),e.qZA(),e.TgZ(17,"app-datepicker-range",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onFilterDateChange(o))}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(5),e.Q6J("ngModel",t.currency)("items",null==t.pageData.Options?null:t.pageData.Options.Currencies),e.xp6(4),e.Q6J("from",t.pageData.Filter.From)("to",t.pageData.Filter.To)("maxDate",t.maxFilterDate)("minDate",t.minFilterDate)}}function Rc(n,r){if(1&n&&(e.TgZ(0,"div",13),e._UZ(1,"POS-line-chart",14),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("config",t.chartConfig)("data",t.ChartData)}}const Gc=function(){return["/menu/Reports/Sales_Report/Standard/Daily"]},Hc=function(n,r){return{From:n,To:r}},Bc=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"]};let Kc=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/DailySalesVolume","ReportLoader/DailyReportSales",null,i),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"maxFilterDate",void 0),(0,l.Z)(this,"minFilterDate",void 0),(0,l.Z)(this,"Years",C.gT.GenerateYears((new Date).getFullYear(),11,!0)),(0,l.Z)(this,"chartConfig",void 0),(0,l.Z)(this,"currency",-1),(0,l.Z)(this,"Months",C.gT.Months),(0,l.Z)(this,"ChartData",{}),this.httpService=t,this.csvConverter=a,this.reportFilterService=o,this.initValidateFilterDate()}initValidateFilterDate(){this.maxFilterDate=new Date,this.minFilterDate=C.gT.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),this.pageData.Options.Currencies.unshift({ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"}),this.checkFilterCurrency()}getQueryParams(){const t=this.route.snapshot.queryParams;t.From&&(this.pageData.Filter.From=t.From,this.pageData.Filter.To=t.To)}checkFilterCurrency(){this.pageData.Filter.CurrencyID=this.currency<0?null: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(){const t=new Date(this.pageData.Filter.From),a=new Date(this.pageData.Filter.To);return C.gT.getDatesInRange(t,a).map(s=>`${s.getDate()} ${C.gT.Months[s.getMonth()]?.Label?.substring(0,3)}`)}onFilterDateChange(t){this.pageData.Filter.From=t.from?.toISOString(),this.pageData.Filter.To=t.to?.toISOString()}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(N.z),e.Y36(h.gz))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-sales-volume"]],features:[e.qOj],decls:11,vars:12,consts:[[3,"pageData","hideSearchBox","onSubmit"],[1,"btn","btn-outline-secondary","me-6",3,"routerLink","queryParams"],["matTooltipPosition","above","matTooltip","View Monthly",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["bindLabel","Symbol","bindValue","ID","placeholder","Choose a Currency",3,"ngModel","items","ngModelChange","change"],[3,"from","to","maxDate","minDate","dateChange"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions")(2,"a",1),e._uU(3,"Daily Sales"),e.qZA(),e.TgZ(4,"a",2),e._uU(5,"View Monthly"),e.qZA()(),e.TgZ(6,"filters")(7,"div",3),e.YNc(8,Yc,18,11,"div",4),e.qZA()(),e.TgZ(9,"content"),e.YNc(10,Rc,2,2,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(7,Gc))("queryParams",e.WLB(8,Hc,null==a.pageData.Filter?null:a.pageData.Filter.From,null==a.pageData.Filter?null:a.pageData.Filter.To)),e.xp6(2),e.Q6J("routerLink",e.DdM(11,Bc)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.O5,h.rH,m.w9,m.ir,d.JJ,d.On,x.gM,te.D,fe]})),n})();function jc(n,r){if(1&n&&(e.TgZ(0,"span",11),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function zc(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",5)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",6),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",7),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,jc,2,2,"ng-template",8),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Year"),e.qZA(),e.TgZ(13,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Year=o)}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"Currency"),e.qZA(),e.TgZ(17,"ng-select",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.currency=o)})("change",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.checkFilterCurrency())}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(5),e.Q6J("ngModel",t.pageData.Filter.Year)("items",t.Years),e.xp6(4),e.Q6J("ngModel",t.currency)("items",null==t.pageData.Options?null:t.pageData.Options.Currencies)}}function Wc(n,r){if(1&n&&(e.TgZ(0,"div",12),e._UZ(1,"POS-line-chart",13),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("config",t.chartConfig)("data",t.ChartData)}}const Xc=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"]};let ed=(()=>{class n extends D.n{constructor(t,a){super(t,"Report/MonthtlySalesVolume","ReportLoader/MonthlySalesVolume"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"currency",-1),(0,l.Z)(this,"Years",C.gT.GenerateYears((new Date).getFullYear(),11,!0)),(0,l.Z)(this,"ChartData",{}),(0,l.Z)(this,"chartConfig",void 0),this.httpService=t,this.csvConverter=a}preInitList(){this.pageData.Options.Currencies.unshift({ID:-1,Index:1,Symbol:"All",Name:"All",ExchangeRate:1,ConversionSuggestion:!0,ExchangeRateDate:"0001-01-01T00:00:00",ExchangeRateDateDisplay:"01 Jan 0001"}),this.checkFilterCurrency()}checkFilterCurrency(){this.pageData.Filter.CurrencyID=this.currency<0?null:this.currency}postInit(){const t=[];this.data.MonthlySalesRank.forEach(a=>{const o=a.Sales.map(s=>parseInt(s));t.push({name:a.Name,data:o})}),this.ChartData={series:t},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}}}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-monthly-volume"]],features:[e.qOj],decls:9,vars:6,consts:[[3,"pageData","hideSearchBox","onSubmit"],["matTooltipPosition","above","matTooltip","View Daily",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["placeholder","Year",3,"ngModel","items","ngModelChange"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose a Currency",3,"ngModel","items","ngModelChange","change"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions")(2,"a",1),e._uU(3,"View Daily"),e.qZA()(),e.TgZ(4,"filters")(5,"div",2),e.YNc(6,zc,18,8,"div",3),e.qZA()(),e.TgZ(7,"content"),e.YNc(8,Wc,2,2,"div",4),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(5,Xc)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.O5,h.rH,m.w9,m.ir,d.JJ,d.On,x.gM,te.D]})),n})();function td(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",14),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",15),e._uU(2," Export"),e.qZA()}}function nd(n,r){if(1&n&&(e.TgZ(0,"span",24),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function od(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",16)(1,"div")(2,"h6"),e._uU(3,"Outlet Group"),e.qZA(),e.TgZ(4,"ng-select",17),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.OutletGroupID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",18),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,nd,2,2,"ng-template",19),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Type"),e.qZA(),e.TgZ(13,"ng-select",20),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"From - To"),e.qZA(),e.TgZ(17,"div")(18,"datepicker",21),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(19,"div",22)(20,"datepicker",23),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.OutletGroupID)("items",null==t.pageData.Options?null:t.pageData.Options.OutletGroups),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(5),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Options?null:t.pageData.Options.Types),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function ad(n,r){1&n&&(e.TgZ(0,"th",43),e._uU(1,"Cost"),e.qZA())}function id(n,r){1&n&&(e.TgZ(0,"th",44),e._uU(1,"Profit"),e.qZA())}function rd(n,r){if(1&n&&(e.TgZ(0,"td",40),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Cost))}}const je=function(n,r){return{"text-danger":n,"text-success":r}};function ld(n,r){if(1&n&&(e.TgZ(0,"td",46),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.Q6J("ngClass",e.WLB(4,je,t.Profit<0,t.Profit>0)),e.xp6(1),e.hij(" ",e.lcZ(2,2,t.Profit),"")}}const ze=function(){return["/menu/Reports/Sales_Report/Standard/Summary"]},We=function(n,r,t){return{EntityID:n,From:r,To:t}};function sd(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td",40),e._uU(6),e.qZA(),e.TgZ(7,"td",40)(8,"a",45),e.ALo(9,"date"),e.ALo(10,"date"),e.TgZ(11,"b"),e._uU(12),e.ALo(13,"number"),e.qZA()()(),e.YNc(14,rd,3,3,"td",41),e.YNc(15,ld,3,7,"td",42),e.qZA()),2&n){const t=r.$implicit,a=r.index,o=e.oxw(3);e.xp6(2),e.Oqu(a+1),e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Oqu(t.Quantity),e.xp6(2),e.Q6J("routerLink",e.DdM(16,ze))("queryParams",e.kEZ(17,We,t.EntityID,e.xi3(9,8,o.pageData.Filter.From,"ddMMyyyy"),e.xi3(10,11,o.pageData.Filter.To,"ddMMyyyy"))),e.xp6(4),e.Oqu(e.lcZ(13,14,t.Sales)),e.xp6(2),e.Q6J("ngIf",o.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",o.roleService.report.Profit)}}function pd(n,r){if(1&n&&(e.TgZ(0,"td",40),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Oqu(e.xi3(2,1,e.xi3(3,4,t.data.DataWithCategory,"Cost"),".0-0"))}}const $e=function(n,r){return{"text-success":n,"text-danger":r}};function cd(n,r){if(1&n&&(e.TgZ(0,"td",46),e.ALo(1,"sum"),e.ALo(2,"sum"),e._uU(3),e.ALo(4,"number"),e.ALo(5,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.WLB(14,$e,e.xi3(1,2,t.data.DataWithCategory,"Profit")>0,e.xi3(2,5,t.data.DataWithCategory,"Profit")<0)),e.xp6(3),e.hij(" ",e.xi3(4,8,e.xi3(5,11,t.data.DataWithCategory,"Profit"),".0-0"),"")}}function dd(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"table",29),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.sortOutletDataWrapper(o))}),e.TgZ(1,"thead",30)(2,"tr",31)(3,"th"),e._uU(4,"No."),e.qZA(),e.TgZ(5,"th",32),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",33),e._uU(8,"Quantity"),e.qZA(),e.TgZ(9,"th",34),e._uU(10,"Sales"),e.qZA(),e.YNc(11,ad,2,0,"th",35),e.YNc(12,id,2,0,"th",36),e.qZA()(),e.TgZ(13,"tbody"),e.YNc(14,sd,16,21,"tr",37),e.qZA(),e.TgZ(15,"tfoot")(16,"tr",38)(17,"td",39),e._uU(18),e.ALo(19,"number"),e.ALo(20,"sum"),e.qZA(),e.TgZ(21,"td",40),e._uU(22),e.ALo(23,"number"),e.ALo(24,"sum"),e.qZA(),e.YNc(25,pd,4,7,"td",41),e.YNc(26,cd,6,17,"td",42),e.qZA()()()}if(2&n){const t=e.oxw(2);e.xp6(11),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.report.Profit),e.xp6(2),e.Q6J("ngForOf",t.data.DataWithCategory),e.xp6(4),e.Oqu(e.xi3(19,7,e.xi3(20,10,t.data.DataWithCategory,"Quantity"),".0-0")),e.xp6(4),e.Oqu(e.xi3(23,13,e.xi3(24,16,t.data.DataWithCategory,"Sales"),".0-0")),e.xp6(3),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.report.Profit)}}function ud(n,r){1&n&&(e.TgZ(0,"th",54),e._uU(1,"Cost"),e.qZA())}function _d(n,r){1&n&&(e.TgZ(0,"th",55),e._uU(1,"Profit"),e.qZA())}function md(n,r){if(1&n&&(e.TgZ(0,"td",40),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Cost))}}function gd(n,r){if(1&n&&(e.TgZ(0,"td",46),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.Q6J("ngClass",e.WLB(4,je,t.Profit<0,t.Profit>0)),e.xp6(1),e.hij(" ",e.lcZ(2,2,t.Profit),"")}}function hd(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td",40),e._uU(6),e.qZA(),e.TgZ(7,"td",40)(8,"a",45),e.ALo(9,"date"),e.ALo(10,"date"),e.TgZ(11,"b"),e._uU(12),e.ALo(13,"number"),e.qZA()()(),e.TgZ(14,"td",40),e._uU(15),e.ALo(16,"number"),e.qZA(),e.TgZ(17,"td",40),e._uU(18),e.ALo(19,"number"),e.qZA(),e.YNc(20,md,3,3,"td",41),e.YNc(21,gd,3,7,"td",42),e.qZA()),2&n){const t=r.$implicit,a=r.index,o=e.oxw(3);e.xp6(2),e.Oqu(a+1),e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Oqu(t.Transaction),e.xp6(2),e.Q6J("routerLink",e.DdM(22,ze))("queryParams",e.kEZ(23,We,t.EntityID,e.xi3(9,10,o.pageData.Filter.From,"ddMMyyyy"),e.xi3(10,13,o.pageData.Filter.To,"ddMMyyyy"))),e.xp6(4),e.Oqu(e.lcZ(13,16,t.Sales)),e.xp6(3),e.Oqu(e.lcZ(16,18,t.Tax)),e.xp6(3),e.Oqu(e.lcZ(19,20,t.Sales+t.Tax)),e.xp6(2),e.Q6J("ngIf",o.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",o.roleService.report.Profit)}}function fd(n,r){if(1&n&&(e.TgZ(0,"td",40),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Oqu(e.xi3(2,1,e.xi3(3,4,t.data.DataWithoutCategory,"Cost"),".0-0"))}}function xd(n,r){if(1&n&&(e.TgZ(0,"td",46),e.ALo(1,"sum"),e.ALo(2,"sum"),e._uU(3),e.ALo(4,"number"),e.ALo(5,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.WLB(14,$e,e.xi3(1,2,t.data.DataWithoutCategory,"Profit")>0,e.xi3(2,5,t.data.DataWithoutCategory,"Profit")<0)),e.xp6(3),e.hij(" ",e.xi3(4,8,e.xi3(5,11,t.data.DataWithoutCategory,"Profit"),".0-0"),"")}}function Td(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"table",29),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.sortOutletDataWrapper(o))}),e.TgZ(1,"thead",30)(2,"tr",31)(3,"th"),e._uU(4,"No."),e.qZA(),e.TgZ(5,"th",47),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",48),e._uU(8,"Trans"),e.qZA(),e.TgZ(9,"th",49),e._uU(10,"Sales"),e.qZA(),e.TgZ(11,"th",50),e._uU(12,"Tax"),e.qZA(),e.TgZ(13,"th",51),e._uU(14,"Sales + Tax"),e.qZA(),e.YNc(15,ud,2,0,"th",52),e.YNc(16,_d,2,0,"th",53),e.qZA()(),e.TgZ(17,"tbody"),e.YNc(18,hd,22,27,"tr",37),e.qZA(),e.TgZ(19,"tfoot")(20,"tr",38)(21,"td",39),e._uU(22),e.ALo(23,"number"),e.ALo(24,"sum"),e.qZA(),e.TgZ(25,"td",40),e._uU(26),e.ALo(27,"number"),e.ALo(28,"sum"),e.qZA(),e.TgZ(29,"td",40),e._uU(30),e.ALo(31,"number"),e.ALo(32,"sum"),e.qZA(),e.TgZ(33,"td",40),e._uU(34),e.ALo(35,"number"),e.ALo(36,"sum"),e.ALo(37,"sum"),e.qZA(),e.YNc(38,fd,4,7,"td",41),e.YNc(39,xd,6,17,"td",42),e.qZA()()()}if(2&n){const t=e.oxw(2);e.xp6(15),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.report.Profit),e.xp6(2),e.Q6J("ngForOf",t.data.DataWithoutCategory),e.xp6(4),e.Oqu(e.xi3(23,9,e.xi3(24,12,t.data.DataWithoutCategory,"Transaction"),".0-0")),e.xp6(4),e.Oqu(e.xi3(27,15,e.xi3(28,18,t.data.DataWithoutCategory,"Sales"),".0-0")),e.xp6(4),e.Oqu(e.xi3(31,21,e.xi3(32,24,t.data.DataWithoutCategory,"Tax"),".0-0")),e.xp6(4),e.Oqu(e.xi3(35,27,e.xi3(36,30,t.data.DataWithoutCategory,"Tax")+e.xi3(37,33,t.data.DataWithoutCategory,"Sales"),".0-0")),e.xp6(4),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.report.Profit)}}function Cd(n,r){1&n&&(e.TgZ(0,"p"),e._uU(1,"No Data has been loaded!"),e.qZA())}function Zd(n,r){if(1&n&&(e.TgZ(0,"div",25)(1,"div",26),e.YNc(2,dd,27,19,"table",27),e.qZA(),e.TgZ(3,"div",26),e.YNc(4,Td,40,36,"table",27),e.qZA(),e.YNc(5,Cd,2,0,"p",28),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngIf",(null==t.data?null:t.data.DataWithCategory.length)>0),e.xp6(2),e.Q6J("ngIf",(null==t.data?null:t.data.DataWithoutCategory.length)>0),e.xp6(1),e.Q6J("ngIf",0==(null==t.data?null:t.data.DataWithCategory.length)&&0==(null==t.data?null:t.data.DataWithoutCategory.length))}}const vd=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"]},yd=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Detail"]},Ad=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"]};let wd=(()=>{class n extends D.n{constructor(t,a,o,i,s,c){super(t,"Report/OutletPerformance","ReportLoader/OutletPerformance",null,o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"hideMore",!0),(0,l.Z)(this,"YesNoRadio",[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}]),this.httpService=t,this.csvConverter=a,this.activatedRoute=o,this.reportFilterService=i,this.roleService=s,this.matDialog=c}postInit(t){this.menuData.H=t.PageTitle}preInitList(){this.pageData.Filter.CategoryID=null,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)}sortOutletDataWrapper(t){let a,o;if(this.data.DataWithCategory.length>0)a=this.data.DataWithCategory,o=!0;else{if(!(this.data.DataWithoutCategory.length>0))return;a=this.data.DataWithoutCategory,o=!1}this.sortOutletData(a,t,o)}sortOutletData(t,a,o){function i(s,c,u){return(s<c?-1:1)*(u?1:-1)}a.active&&""!==a.direction&&null!=t&&(t=t.sort((s,c)=>{const u="asc"===a.direction;switch(a.active){case"Outlet":return i(s.Outlet,c.Outlet,u);case"Transaction":return i(s.Transaction,c.Transaction,u);case"Quantity":return i(s.Quantity,c.Quantity,u);case"Sales":return i(s.SalesNet,c.SalesNet,u);case"SalesTax":return i(s.SalesNet+s.Tax,c.SalesNet+s.Tax,u);case"Tax":return i(s.Tax,c.Tax,u);case"Cost":return i(s.Cost,c.Cost,u);case"Profit":return i(s.Profit,c.Profit,u);default:return 0}}),o?this.data.DataWithCategory=t:o||(this.data.DataWithoutCategory=t))}openExportModal(){this.matDialog.open(M.H,{data:{title:"Outlet Performance",exportTypes:[{ID:"ReportExport/OutletPerformance",Value:"Default",FileName:`Outlet Performance ${this.pageData.Filter.From} - ${this.pageData.Filter.To}`}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(h.gz),e.Y36(N.z),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-outlet-performance"]],features:[e.qOj],decls:20,vars:11,consts:[[3,"pageData","text","textChange","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Chart View",1,"btn","btn-outline-secondary","me-6",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"btn-group"],["matTooltipPosition","above","matTooltip","Outlet Performance Detail",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-circle-info","ms-2"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Value","bindValue","Key","placeholder","Choose an outlet group",3,"ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["bindLabel","Name","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["class","table","id","tableGrid","matSort","",3,"matSortChange",4,"ngIf"],[4,"ngIf"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Outlet"],["mat-sort-header","Quantity","arrowPosition","before",1,"align-left"],["mat-sort-header","Sales","arrowPosition","before",1,"align-left"],["class","align-right","at-sort-header","Cost",4,"ngIf"],["class","align-left","mat-sort-header","Profit","arrowPosition","before",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],["colspan","3",1,"text-end"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["at-sort-header","Cost",1,"align-right"],["mat-sort-header","Profit","arrowPosition","before",1,"align-left"],[3,"routerLink","queryParams"],[1,"text-end",3,"ngClass"],["mat-sort-header","Outlet",1,"align-left"],["mat-sort-header","Transaction","arrowPosition","before",1,"flex-left"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-left"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-left"],["mat-sort-header","SalesTax","arrowPosition","before",1,"flex-left"],["class","flex-left","mat-sort-header","Cost","arrowPosition","before",4,"ngIf"],["class","flex-left","mat-sort-header","Profit","arrowPosition","before",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-left"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.Number=i})("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,td,3,0,"button",1),e.TgZ(3,"a",2),e._UZ(4,"i",3),e._uU(5," Chart View"),e.qZA(),e.TgZ(6,"div",4)(7,"a",5),e._UZ(8,"i",6),e._uU(9," View Detail"),e.qZA(),e._UZ(10,"button",7),e.TgZ(11,"ul",8)(12,"li",9)(13,"a",10),e._uU(14,"By Entity Group"),e.qZA()()()()(),e.TgZ(15,"filters")(16,"div",11),e.YNc(17,od,21,8,"div",12),e.qZA()(),e.TgZ(18,"content"),e.YNc(19,Zd,6,3,"div",13),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.Number),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(8,vd)),e.xp6(4),e.Q6J("routerLink",e.DdM(9,yd)),e.xp6(6),e.Q6J("routerLink",e.DdM(10,Ad)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.mk,p.sg,p.O5,h.rH,m.w9,m.ir,A.QB,d.JJ,d.On,x.gM,f.YE,f.nU,S.qU,p.JJ,p.uU]})),n})();function Fd(n,r){if(1&n&&(e.TgZ(0,"span",13),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function Md(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",6)(1,"div")(2,"h6"),e._uU(3,"Category"),e.qZA(),e.TgZ(4,"ng-select",7),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(5,Fd,2,2,"ng-template",8),e.qZA()(),e.TgZ(6,"div")(7,"h6"),e._uU(8,"Type"),e.qZA(),e.TgZ(9,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"From - To"),e.qZA(),e.TgZ(13,"div")(14,"datepicker",10),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(15,"div",11)(16,"datepicker",12),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(5),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Options?null:t.pageData.Options.Types),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function qd(n,r){if(1&n&&(e.TgZ(0,"div",14),e._UZ(1,"POS-pie-chart",15),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("config",t.pieConfig)("data",t.PieData)}}const Pd=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance"]};let Od=(()=>{class n extends D.n{constructor(t,a){super(t,"Report/OutletPerformanceCart","ReportLoader/OutletPerformance"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"PieData",{}),(0,l.Z)(this,"pieConfig",{title:"",dataLabels:!0,labelTooltips:"Sales",height:400,legend:{}}),this.httpService=t,this.reportFilterService=a}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(){const t=[],a=[];this.data.DataWithoutCategory.length>0&&this.data.DataWithoutCategory.forEach(o=>{t.push(o.Outlet),a.push({name:o.Outlet,y:o.Sales})}),this.data.DataWithCategory.length>0&&this.data.DataWithCategory.forEach(o=>{t.push(o.Outlet),a.push({name:o.Outlet,y:o.Sales})}),this.PieData=a}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(N.z))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-outlet-graphic"]],features:[e.qOj],decls:10,vars:6,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["container",""],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["bindLabel","Name","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions")(2,"a",1),e._UZ(3,"i",2),e._uU(4," Table View"),e.qZA()(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,Md,17,6,"div",4),e.qZA()(),e.TgZ(8,"content"),e.YNc(9,qd,2,2,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(5,Pd)),e.xp6(5),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.O5,h.rH,m.w9,m.ir,A.QB,d.JJ,d.On,x.gM,_e.J]})),n})();function Nd(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",15),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",16),e._uU(2," Export "),e.qZA()}}function Jd(n,r){if(1&n&&(e.TgZ(0,"span",23),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function Ld(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"From - To"),e.qZA(),e.TgZ(3,"div")(4,"datepicker",24),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(5,"div",25)(6,"datepicker",26),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onFilterToDate())}),e.qZA()()()}if(2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function Ud(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Compare with prev Month"),e.qZA(),e.TgZ(3,"radio-options",27),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.isCompareData=o)})("modelChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.OnCompare("Data"))}),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(3),e.Q6J("model",t.isCompareData)}}function Qd(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Year - Month"),e.qZA(),e.TgZ(3,"div",28)(4,"div",29)(5,"ng-select",30),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.Year=o)})("change",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.YearMonthToDateRange())})("clear",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.Year=null)}),e.qZA()(),e.TgZ(6,"div",31)(7,"ng-select",32),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.Month=o)})("change",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.YearMonthToDateRange())})("clear",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.Month=null)}),e.qZA()()()()}if(2&n){const t=e.oxw(2);e.xp6(5),e.Q6J("ngModel",t.Year)("items",t.Years),e.xp6(2),e.Q6J("ngModel",t.Month)("items",t.Months)}}function kd(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",17)(1,"div")(2,"h6"),e._uU(3,"Category"),e.qZA(),e.TgZ(4,"ng-select",18),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(5,Jd,2,2,"ng-template",19),e.qZA()(),e.TgZ(6,"div")(7,"h6"),e._uU(8,"Type"),e.qZA(),e.TgZ(9,"ng-select",20),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Date Filter Type"),e.qZA(),e.TgZ(13,"radio-options",21),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.DateFilterType=o)}),e.qZA()(),e.YNc(14,Ld,7,2,"div",22),e.YNc(15,Ud,4,1,"div",22),e.YNc(16,Qd,8,4,"div",22),e.qZA()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(5),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Options?null:t.pageData.Options.Types),e.xp6(4),e.Q6J("model",t.DateFilterType)("options",t.RadioDateFilterType),e.xp6(1),e.Q6J("ngIf",!t.DateFilterType),e.xp6(1),e.Q6J("ngIf",t.DateFilterType),e.xp6(1),e.Q6J("ngIf",t.DateFilterType)}}function Ed(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",33)(1,"div")(2,"h6"),e._uU(3,"Complementary"),e.qZA(),e.TgZ(4,"radio-options",27),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ExcludeComplementary=o)})("modelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.getListData())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Exclude Non Inventory"),e.qZA(),e.TgZ(8,"radio-options",27),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ExcludeInventory=o)})("modelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.getListData())}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("model",t.pageData.Filter.ExcludeComplementary),e.xp6(4),e.Q6J("model",t.pageData.Filter.ExcludeInventory)}}function Yd(n,r){1&n&&(e.TgZ(0,"th",59),e._uU(1,"Prev"),e.qZA())}function Rd(n,r){1&n&&(e.TgZ(0,"th",59),e._uU(1,"Now"),e.qZA())}function Gd(n,r){1&n&&(e.TgZ(0,"th",60),e._uU(1,"Trans "),e.qZA())}function Hd(n,r){if(1&n&&(e.TgZ(0,"th",61),e._uU(1,"Tax"),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("mat-sort-header",t.pageData.IgnoreTax?"Tax":"SalesNet")}}function Vd(n,r){if(1&n&&(e.TgZ(0,"th",61),e._uU(1," Sales + Tax"),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("mat-sort-header",t.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Bd(n,r){1&n&&(e.TgZ(0,"th",54),e._uU(1,"\xb1 (%)"),e.qZA())}function Kd(n,r){1&n&&(e.TgZ(0,"th",62),e._uU(1,"Cost"),e.qZA())}function jd(n,r){if(1&n&&(e.TgZ(0,"th",61),e._uU(1," Profit"),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("mat-sort-header",t.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function zd(n,r){1&n&&(e.TgZ(0,"th",63),e._uU(1,"Expense"),e.qZA())}function Wd(n,r){1&n&&(e.TgZ(0,"th",64),e._uU(1,"Net Profit "),e.qZA())}function $d(n,r){1&n&&(e.TgZ(0,"th",65),e._uU(1," Target"),e.qZA())}function Xd(n,r){1&n&&(e.TgZ(0,"th",66),e._uU(1," Ach(%)"),e.qZA())}function eu(n,r){if(1&n&&(e.TgZ(0,"td",69),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(t.PrevIndex)}}const tu=function(n,r){return{rankDown:n,rankUp:r,"number key":!0}};function nu(n,r){if(1&n&&(e.TgZ(0,"td",70),e._uU(1),e.qZA()),2&n){const t=e.oxw(),a=t.$implicit,o=t.index;e.Q6J("ngClass",e.WLB(2,tu,a.PrevIndex<o+1,a.PrevIndex>o+1)),e.xp6(1),e.hij(" ",a.CurrentIndex," ")}}function ou(n,r){if(1&n&&(e.TgZ(0,"td",54),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.xi3(2,1,t.Count,"1.0-0"))}}function au(n,r){if(1&n&&(e.TgZ(0,"td",54),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.xi3(2,1,t.Tax,"1.0-0"))}}const iu=function(){return["/menu/Reports/Sales_Report/Standard/Summary"]},ru=function(n,r,t){return{EntityID:n,From:r,To:t}};function lu(n,r){if(1&n&&(e.TgZ(0,"td",54)(1,"a",71),e.ALo(2,"date"),e.ALo(3,"date"),e.TgZ(4,"b"),e._uU(5),e.ALo(6,"number"),e.qZA()()()),2&n){const t=e.oxw().$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("routerLink",e.DdM(12,iu))("queryParams",e.kEZ(13,ru,t.EntityID,e.xi3(2,3,a.pageData.Filter.From,"ddMMyyyy"),e.xi3(3,6,a.pageData.Filter.To,"ddMMyyyy"))),e.xp6(4),e.Oqu(e.xi3(6,9,t.SalesWithTax,"1.0-0"))}}function su(n,r){if(1&n&&(e.ynx(0),e._uU(1),e.ALo(2,"number"),e.BQk()),2&n){const t=e.oxw(2).$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.Increase,"1.0-0")," ")}}function pu(n,r){if(1&n&&e._uU(0),2&n){const t=e.oxw(2).$implicit;e.hij(" ",t.Increase," ")}}const Xe=function(n,r){return{"text-warning":n,"text-success":r,"text-end":!0}};function cu(n,r){if(1&n&&(e.TgZ(0,"td",72),e.YNc(1,su,3,4,"ng-container",73),e.YNc(2,pu,1,1,"ng-template",null,74,e.W1O),e.qZA()),2&n){const t=e.MAs(3),a=e.oxw().$implicit;e.Q6J("ngClass",e.WLB(3,Xe,a.IsNegative,a.IsPositive)),e.xp6(1),e.Q6J("ngIf","-"!==a.Increase)("ngIfElse",t)}}function du(n,r){if(1&n&&(e.TgZ(0,"td",75),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij("",e.xi3(2,1,t.Cost,"1.0-0")," ")}}const se=function(n,r){return{"text-danger":n,"text-success":r}};function uu(n,r){if(1&n&&(e.TgZ(0,"span",72),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2).$implicit;e.Q6J("ngClass",e.WLB(5,se,t.Profit<0,t.Profit>0)),e.xp6(1),e.Oqu(e.xi3(2,2,t.Profit,"1.0-0"))}}function _u(n,r){if(1&n&&(e.TgZ(0,"span",72),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2).$implicit;e.Q6J("ngClass",e.WLB(5,se,t.ProfitWithTax<0,t.ProfitWithTax>0)),e.xp6(1),e.Oqu(e.xi3(2,2,t.ProfitWithTax,"1.0-0"))}}function mu(n,r){if(1&n&&(e.TgZ(0,"td",54),e.YNc(1,uu,3,8,"span",56),e.YNc(2,_u,3,8,"span",56),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",t.pageData.IgnoreTax),e.xp6(1),e.Q6J("ngIf",!t.pageData.IgnoreTax)}}function gu(n,r){if(1&n&&(e.TgZ(0,"td",54),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.Expense,"1.0-0"),"")}}function hu(n,r){if(1&n&&(e.TgZ(0,"td",76),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.NetProfit,"1.0-0"),"")}}function fu(n,r){if(1&n&&(e.TgZ(0,"td",54),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.SalesTarget,"1.0-0"),"")}}function xu(n,r){if(1&n&&(e.TgZ(0,"span",72),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2).$implicit;e.Q6J("ngClass",e.WLB(5,se,t.Achievement<0,t.Achievement>0)),e.xp6(1),e.Oqu(e.xi3(2,2,t.Achievement,"1.0-0"))}}function Tu(n,r){if(1&n&&(e.TgZ(0,"span",72),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2).$implicit;e.Q6J("ngClass",e.WLB(5,se,t.AchievementWithTax<0,t.AchievementWithTax>0)),e.xp6(1),e.hij("",e.xi3(2,2,t.AchievementWithTax,"1.0-0")," ")}}function Cu(n,r){if(1&n&&(e.TgZ(0,"td",54),e.YNc(1,xu,3,8,"span",56),e.YNc(2,Tu,3,8,"span",56),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",!t.pageData.IgnoreTax),e.xp6(1),e.Q6J("ngIf",t.pageData.IgnoreTax)}}function Zu(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td",52),e._uU(4),e.qZA(),e.YNc(5,eu,2,1,"td",67),e.YNc(6,nu,2,5,"td",68),e.YNc(7,ou,3,4,"td",44),e.TgZ(8,"td",54),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td",54),e._uU(12),e.ALo(13,"number"),e.qZA(),e.TgZ(14,"td",54),e._uU(15),e.ALo(16,"number"),e.qZA(),e.YNc(17,au,3,4,"td",44),e.ALo(18,"HideSumZero"),e.YNc(19,lu,7,17,"td",44),e.YNc(20,cu,4,6,"td",56),e.YNc(21,du,3,4,"td",57),e.YNc(22,mu,3,2,"td",44),e.YNc(23,gu,3,4,"td",44),e.ALo(24,"HideSumZero"),e.YNc(25,hu,3,4,"td",58),e.YNc(26,fu,3,4,"td",44),e.ALo(27,"HideSumZero"),e.YNc(28,Cu,3,2,"td",44),e.ALo(29,"HideSumZero"),e.ALo(30,"HideSumZero"),e.qZA()),2&n){const t=r.$implicit,a=r.index,o=e.oxw(2);e.xp6(2),e.Oqu(a+1),e.xp6(2),e.Oqu(t.Name),e.xp6(1),e.Q6J("ngIf",o.isCompareData),e.xp6(1),e.Q6J("ngIf",o.isCompareData),e.xp6(1),e.Q6J("ngIf",!o.data.WithCategory),e.xp6(2),e.Oqu(e.xi3(10,17,t.Quantity,"1.0-0")),e.xp6(3),e.Oqu(e.xi3(13,20,t.Gross,"1.0-0")),e.xp6(3),e.Oqu(e.xi3(16,23,t.SalesNet,"1.0-0")),e.xp6(2),e.Q6J("ngIf",!o.data.WithCategory&&e.xi3(18,26,o.data.Data,"Tax")),e.xp6(2),e.Q6J("ngIf",!o.data.WithCategory),e.xp6(1),e.Q6J("ngIf",o.isCompareData),e.xp6(1),e.Q6J("ngIf",o.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",o.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",o.roleService.product.Expense&&e.xi3(24,29,o.data.Data,"Expense")),e.xp6(2),e.Q6J("ngIf",o.roleService.product.Expense),e.xp6(1),e.Q6J("ngIf",e.xi3(27,32,o.data.Data,"SalesTarget")),e.xp6(2),e.Q6J("ngIf",e.xi3(29,35,o.data.Data,"AchievementWithTax")||e.xi3(30,38,o.data.Data,"Achievement"))}}function Du(n,r){1&n&&e._UZ(0,"td",77)}function vu(n,r){1&n&&e._UZ(0,"td",77)}function bu(n,r){if(1&n&&(e.TgZ(0,"td",54),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"Count"),"1.0-0"),"")}}function yu(n,r){if(1&n&&(e.TgZ(0,"td",54),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"Tax"),"1.0-0")," ")}}function Su(n,r){if(1&n&&(e.TgZ(0,"td",78)(1,"a",79),e._uU(2),e.ALo(3,"number"),e.ALo(4,"sum"),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(e.xi3(3,1,e.xi3(4,4,t.data.Data,"SalesWithTax"),"1.0-0"))}}function Au(n,r){if(1&n&&(e.TgZ(0,"td",72),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("ngClass",e.WLB(5,Xe,t.comparation<0,t.comparation>0)),e.xp6(1),e.hij(" ",e.xi3(2,2,t.comparation,"1.0-0")," ")}}function wu(n,r){if(1&n&&(e.TgZ(0,"td",75),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"Cost"),"1.0-0")," ")}}const et=function(n,r){return{"text-success":n,"text-danger":r}};function Fu(n,r){if(1&n&&(e.TgZ(0,"span",72),e.ALo(1,"sum"),e.ALo(2,"sum"),e._uU(3),e.ALo(4,"number"),e.ALo(5,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.WLB(14,et,e.xi3(1,2,t.data.Data,"Profit")>0,e.xi3(2,5,t.data.Data,"Profit")<0)),e.xp6(3),e.Oqu(e.xi3(4,8,e.xi3(5,11,t.data.Data,"Profit"),"1.0-0"))}}function Mu(n,r){if(1&n&&(e.TgZ(0,"span",72),e.ALo(1,"sum"),e.ALo(2,"sum"),e._uU(3),e.ALo(4,"number"),e.ALo(5,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.WLB(14,et,e.xi3(1,2,t.data.Data,"ProfitWithTax")>0,e.xi3(2,5,t.data.Data,"ProfitWithTax")<0)),e.xp6(3),e.hij("",e.xi3(4,8,e.xi3(5,11,t.data.Data,"ProfitWithTax"),"1.0-0")," ")}}function qu(n,r){if(1&n&&(e.TgZ(0,"td",54),e.YNc(1,Fu,6,17,"span",56),e.YNc(2,Mu,6,17,"span",56),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.pageData.IgnoreTax),e.xp6(1),e.Q6J("ngIf",!t.pageData.IgnoreTax)}}function Iu(n,r){if(1&n&&(e.TgZ(0,"td",54),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"Expense"),"1.0-0"),"")}}function Pu(n,r){if(1&n&&(e.TgZ(0,"td",76),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"NetProfit"),"1.0-0"),"")}}function Ou(n,r){if(1&n&&(e.TgZ(0,"td",54),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"SalesTarget"),"1.0-0"),"")}}function Nu(n,r){if(1&n&&(e.TgZ(0,"span",72),e.ALo(1,"sum"),e.ALo(2,"sum"),e.ALo(3,"sum"),e.ALo(4,"sum"),e._uU(5),e.ALo(6,"number"),e.ALo(7,"sum"),e.ALo(8,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.WLB(23,se,e.xi3(1,2,t.data.Data,"Sales")/e.xi3(2,5,t.data.Data,"SalesTarget")<0,e.xi3(3,8,t.data.Data,"Sales")/e.xi3(4,11,t.data.Data,"SalesTarget")>0)),e.xp6(5),e.Oqu(e.xi3(6,14,e.xi3(7,17,t.data.Data,"Sales")/e.xi3(8,20,t.data.Data,"SalesTarget"),"1.0-0"))}}function Ju(n,r){if(1&n&&(e.TgZ(0,"span",72),e.ALo(1,"sum"),e.ALo(2,"sum"),e.ALo(3,"sum"),e.ALo(4,"sum"),e._uU(5),e.ALo(6,"number"),e.ALo(7,"sum"),e.ALo(8,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.WLB(23,se,e.xi3(1,2,t.data.Data,"SalesWithTax")/e.xi3(2,5,t.data.Data,"SalesTarget")<0,e.xi3(3,8,t.data.Data,"SalesWithTax")/e.xi3(4,11,t.data.Data,"SalesTarget")>0)),e.xp6(5),e.hij("",e.xi3(6,14,e.xi3(7,17,t.data.Data,"SalesWithTax")/e.xi3(8,20,t.data.Data,"SalesTarget"),"1.0-0")," ")}}function Lu(n,r){if(1&n&&(e.TgZ(0,"td",54),e.YNc(1,Nu,9,26,"span",56),e.YNc(2,Ju,9,26,"span",56),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",!t.pageData.IgnoreTax),e.xp6(1),e.Q6J("ngIf",t.pageData.IgnoreTax)}}function Uu(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",34)(1,"table",35),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",36)(3,"tr")(4,"th"),e._uU(5,"No."),e.qZA(),e.TgZ(6,"th",37),e._uU(7,"Outlet"),e.qZA(),e.YNc(8,Yd,2,0,"th",38),e.YNc(9,Rd,2,0,"th",38),e.YNc(10,Gd,2,0,"th",39),e.TgZ(11,"th",40),e._uU(12,"Qty"),e.qZA(),e.TgZ(13,"th",41),e._uU(14,"Gross"),e.qZA(),e.TgZ(15,"th",42),e._uU(16,"Sales"),e.qZA(),e.YNc(17,Hd,2,1,"th",43),e.ALo(18,"HideSumZero"),e.YNc(19,Vd,2,1,"th",43),e.YNc(20,Bd,2,0,"th",44),e.YNc(21,Kd,2,0,"th",45),e.YNc(22,jd,2,1,"th",43),e.YNc(23,zd,2,0,"th",46),e.ALo(24,"HideSumZero"),e.YNc(25,Wd,2,0,"th",47),e.YNc(26,$d,2,0,"th",48),e.ALo(27,"HideSumZero"),e.YNc(28,Xd,2,0,"th",49),e.ALo(29,"HideSumZero"),e.ALo(30,"HideSumZero"),e.qZA()(),e.TgZ(31,"tbody"),e.YNc(32,Zu,31,41,"tr",50),e.qZA(),e.TgZ(33,"tfoot")(34,"tr",51),e._UZ(35,"td")(36,"td",52),e.YNc(37,Du,1,0,"td",53),e.YNc(38,vu,1,0,"td",53),e.YNc(39,bu,4,7,"td",44),e.TgZ(40,"td",54),e._uU(41),e.ALo(42,"number"),e.ALo(43,"sum"),e.qZA(),e.TgZ(44,"td",54),e._uU(45),e.ALo(46,"number"),e.ALo(47,"sum"),e.qZA(),e.TgZ(48,"td",54),e._uU(49),e.ALo(50,"number"),e.ALo(51,"sum"),e.qZA(),e.YNc(52,yu,4,7,"td",44),e.ALo(53,"HideSumZero"),e.YNc(54,Su,5,7,"td",55),e.YNc(55,Au,3,8,"td",56),e.YNc(56,wu,4,7,"td",57),e.YNc(57,qu,3,2,"td",44),e.YNc(58,Iu,4,7,"td",44),e.ALo(59,"HideSumZero"),e.YNc(60,Pu,4,7,"td",58),e.YNc(61,Ou,4,7,"td",44),e.ALo(62,"HideSumZero"),e.YNc(63,Lu,3,2,"td",44),e.ALo(64,"HideSumZero"),e.ALo(65,"HideSumZero"),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(8),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",!t.data.WithCategory),e.xp6(7),e.Q6J("ngIf",!t.data.WithCategory&&e.xi3(18,28,t.data.Data,"Tax")),e.xp6(2),e.Q6J("ngIf",!t.data.WithCategory),e.xp6(1),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Expense&&e.xi3(24,31,t.data.Data,"Expense")),e.xp6(2),e.Q6J("ngIf",t.roleService.product.Expense),e.xp6(1),e.Q6J("ngIf",e.xi3(27,34,t.data.Data,"SalesTarget")),e.xp6(2),e.Q6J("ngIf",e.xi3(29,37,t.data.Data,"AchievementWithTax")||e.xi3(30,40,t.data.Data,"Achievement")),e.xp6(4),e.Q6J("ngForOf",t.data.Data),e.xp6(5),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",!t.data.WithCategory),e.xp6(2),e.Oqu(e.xi3(42,43,e.xi3(43,46,t.data.Data,"Quantity"),"1.0-0")),e.xp6(4),e.Oqu(e.xi3(46,49,e.xi3(47,52,t.data.Data,"Gross"),"1.0-0")),e.xp6(4),e.hij(" ",e.xi3(50,55,e.xi3(51,58,t.data.Data,"SalesNet"),"1.0-0")," "),e.xp6(3),e.Q6J("ngIf",!t.data.WithCategory&&e.xi3(53,61,t.data.Data,"Tax")),e.xp6(2),e.Q6J("ngIf",!t.data.WithCategory),e.xp6(1),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Expense&&e.xi3(59,64,t.data.Data,"Expense")),e.xp6(2),e.Q6J("ngIf",t.roleService.product.Expense),e.xp6(1),e.Q6J("ngIf",e.xi3(62,67,t.data.Data,"SalesTarget")),e.xp6(2),e.Q6J("ngIf",e.xi3(64,70,t.data.Data,"AchievementWithTax")||e.xi3(65,73,t.data.Data,"Achievement"))}}const ku=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance"]},Yu=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"]},Gu=function(){return["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"]},Vu=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"]};let Bu=(()=>{class n extends D.n{constructor(t,a,o,i,s,c){super(t,"Report/OutletPerformanceDetail","ReportLoader/OutletPerformance"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"datePipe",void 0),(0,l.Z)(this,"isCompareData",!1),(0,l.Z)(this,"hideMore",!0),(0,l.Z)(this,"DateFilterType",!1),(0,l.Z)(this,"Year",void 0),(0,l.Z)(this,"Month",void 0),(0,l.Z)(this,"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"}]),(0,l.Z)(this,"Years",C.gT.GenerateYears((new Date).getFullYear(),11,!0)),(0,l.Z)(this,"RadioDateFilterType",[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}]),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.reportFilterService=s,this.datePipe=c;const u=new Date;this.Year=u.getFullYear(),this.Month=u.getMonth()}postInit(t){this.menuData.H=t.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)}YearMonthToDateRange(){const t=new Date;null==this.Year&&(this.Year=t.getFullYear()),null==this.Month&&(this.Month=t.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()}transformDate(t){return this.datePipe.transform(t,"dd_MMM_yyyy")}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"Name":return this.compare(o.Name,i.Name,s);case"Count":return this.compare(o.Count,i.Count,s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);case"Gross":return this.compare(o.Gross,i.Gross,s);case"SalesNet":case"SalesTaxNet":return this.compare(o.SalesNet,i.SalesNet,s);case"Tax":return this.compare(o.Tax,i.Tax,s);case"SalesWithTax":return this.compare(o.SalesWithTax,i.SalesWithTax,s);case"Cost":return this.compare(o.Cost,i.Cost,s);case"Profit":return this.compare(o.Profit,i.Profit,s);case"ProfitWithTax":return this.compare(o.ProfitWithTax,i.ProfitWithTax,s);case"Expense":return this.compare(o.Expense,i.Expense,s);case"NetProfit":return this.compare(o.NetProfit,i.NetProfit,s);case"Target":case"SalesTarget":return this.compare(o.SalesTarget,i.SalesTarget,s);case"Achievement":return this.compare(o.Achievement,i.Achievement,s);default:return 0}}):a}openExportModal(){this.matDialog.open(M.H,{data:{title:"Outlet Performance Detail",exportTypes:[{ID:"ReportExport/OutletPerformanceDetail",Value:"Default",FileName:"Outlet Performance Detail "+this.transformDate(this.pageData.Filter.From)+" - "+this.transformDate(this.pageData.Filter.To)}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw),e.Y36(N.z),e.Y36(p.uU))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-detail-outlet-performance"]],features:[e.qOj],decls:26,vars:15,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],["matTooltipPosition","above","matTooltip","Chart View",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ms-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fa-solid","fa-caret-down"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["bindLabel","Name","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["name","Date Filter",3,"model","options","modelChange"],[4,"ngIf"],["matTooltipPosition","above",3,"matTooltip"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["name","Compare",3,"model","modelChange"],[1,"row"],[1,"col-6","pe-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","ps-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],["id","more-filter","container","",1,"ms-6"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left","freeze","header"],["style","width: 35px;",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right"],["mat-sort-header","Gross","arrowPosition","before",1,"flex-right"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right"],["arrowPosition","before","class","flex-right",3,"mat-sort-header",4,"ngIf"],["class","text-end",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","Expense","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","NetProfit","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","Target","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","Achievement","arrowPosition","before","class","flex-right","matTooltipPosition","above","matTooltip","Achievement",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"text-end"],["class","text-end text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right"],["arrowPosition","before",1,"flex-right",3,"mat-sort-header"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right"],["mat-sort-header","Expense","arrowPosition","before",1,"flex-right"],["mat-sort-header","NetProfit","arrowPosition","before",1,"flex-right"],["mat-sort-header","Target","arrowPosition","before",1,"flex-right"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"flex-right"],["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"],[3,"routerLink","queryParams"],[3,"ngClass"],[4,"ngIf","ngIfElse"],["INCREASE",""],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"empty-column"],[1,"text-end","text-primary"],[1,"fw-bold"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,Nd,3,0,"a",1),e.TgZ(3,"div",2)(4,"a",3),e._uU(5,"View Summary"),e.qZA(),e._UZ(6,"button",4),e.TgZ(7,"ul",5)(8,"li",6)(9,"a",7),e._uU(10,"By Entity Group"),e.qZA()(),e.TgZ(11,"li",6)(12,"a",7),e._uU(13," By Month"),e.qZA()(),e.TgZ(14,"li",6)(15,"a",8),e._uU(16," Chart View"),e.qZA()()()()(),e.TgZ(17,"filters")(18,"div",9),e.YNc(19,kd,17,9,"div",10),e.YNc(20,Ed,9,2,"div",11),e.qZA(),e.TgZ(21,"a",12),e.NdJ("click",function(){return a.hideMore=!a.hideMore}),e._uU(22),e._UZ(23,"i",13),e.qZA()(),e.TgZ(24,"content"),e.YNc(25,Uu,66,76,"div",14),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(2),e.Q6J("routerLink",e.DdM(11,ku)),e.xp6(5),e.Q6J("routerLink",e.DdM(12,Yu)),e.xp6(3),e.Q6J("routerLink",e.DdM(13,Gu)),e.xp6(3),e.Q6J("routerLink",e.DdM(14,Vu)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(1),e.Q6J("ngIf",!a.hideMore),e.xp6(2),e.hij("",a.hideMore?"More":"Less"," "),e.xp6(3),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.mk,p.sg,p.O5,h.rH,m.w9,m.ir,A.QB,d.JJ,d.On,x.gM,f.YE,f.nU,q.P,S.qU,S.aQ,p.JJ,p.uU]})),n})();function Ku(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",7),e._uU(2," Export "),e.qZA()}}function ju(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",8)(1,"div")(2,"h6"),e._uU(3,"From - To"),e.qZA(),e.TgZ(4,"div")(5,"datepicker",9),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(6,"div",10)(7,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Type"),e.qZA(),e.TgZ(11,"ng-select",12),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Compare with prev Month"),e.qZA(),e.TgZ(15,"radio-options",13),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.isCompareData=o)})("modelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.OnCompare("Data"))}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Options?null:t.pageData.Options.Types),e.xp6(4),e.Q6J("model",t.isCompareData)}}function zu(n,r){1&n&&(e.TgZ(0,"th",37),e._uU(1,"Prev"),e.qZA())}function Wu(n,r){1&n&&(e.TgZ(0,"th",37),e._uU(1,"Now"),e.qZA())}function $u(n,r){1&n&&(e.TgZ(0,"th",38),e._uU(1," \xb1 (%) "),e.qZA())}function Xu(n,r){1&n&&(e.TgZ(0,"th",39),e._uU(1," Cost "),e.qZA())}function e_(n,r){if(1&n&&(e.TgZ(0,"th",23),e._uU(1,"Profit "),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("mat-sort-header",t.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function t_(n,r){if(1&n&&(e.TgZ(0,"td",37),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",t.PrevIndex," ")}}const n_=function(n,r){return{rankDown:n,rankUp:r,"number key":!0}};function o_(n,r){if(1&n&&(e.TgZ(0,"td",42),e._uU(1),e.qZA()),2&n){const t=e.oxw(),a=t.$implicit,o=t.index;e.Q6J("ngClass",e.WLB(2,n_,a.PrevIndex<o+1,a.PrevIndex>o+1)),e.xp6(1),e.hij(" ",a.CurrentIndex," ")}}const tt=function(n,r){return{"text-danger":n,"text-success":r,"text-end":!0}};function a_(n,r){if(1&n&&(e.TgZ(0,"td",43),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.Q6J("ngClass",e.WLB(5,tt,t.IsNegative,t.IsPositive)),e.xp6(1),e.hij(" ",e.xi3(2,2,t.Increase,".0-0")," ")}}function i_(n,r){if(1&n&&(e.TgZ(0,"td",44),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.Cost,".0-0")," ")}}function r_(n,r){if(1&n&&(e.TgZ(0,"td",45),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit,a=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,a.pageData.IgnoreTax?t.ProfitWithTax:t.Profit,".0-0")," ")}}function l_(n,r){if(1&n&&(e.TgZ(0,"tr"),e.YNc(1,t_,2,1,"td",17),e.YNc(2,o_,2,5,"td",40),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td",41),e._uU(6),e.ALo(7,"number"),e.qZA(),e.TgZ(8,"td",32),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td",32),e._uU(12),e.ALo(13,"number"),e.qZA(),e.TgZ(14,"td",32),e._uU(15),e.ALo(16,"number"),e.qZA(),e.TgZ(17,"td",32),e._uU(18),e.ALo(19,"number"),e.qZA(),e.TgZ(20,"td",33),e._uU(21),e.ALo(22,"number"),e.qZA(),e.YNc(23,a_,3,8,"td",34),e.YNc(24,i_,3,4,"td",35),e.YNc(25,r_,3,4,"td",36),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",a.isCompareData),e.xp6(1),e.Q6J("ngIf",a.isCompareData),e.xp6(2),e.Oqu(t.Name),e.xp6(2),e.Oqu(e.xi3(7,12,t.Count,".0-0")),e.xp6(3),e.Oqu(e.xi3(10,15,t.Quantity,".0-0")),e.xp6(3),e.Oqu(e.xi3(13,18,t.Gross,".0-0")),e.xp6(3),e.Oqu(e.xi3(16,21,t.SalesNet,".0-0")),e.xp6(3),e.Oqu(e.xi3(19,24,t.Tax,".0-0")),e.xp6(3),e.Oqu(e.xi3(22,27,t.SalesWithTax,".0-0")),e.xp6(2),e.Q6J("ngIf",a.isCompareData),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost)}}function s_(n,r){1&n&&e._UZ(0,"td",31)}function p_(n,r){1&n&&e._UZ(0,"td",31)}function c_(n,r){if(1&n&&(e.TgZ(0,"td",43),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("ngClass",e.WLB(5,tt,t.comparation,t.comparation)),e.xp6(1),e.hij(" ",e.xi3(2,2,t.comparation,".0-0")," ")}}function d_(n,r){if(1&n&&(e.TgZ(0,"td",44),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,null==t.data?null:t.data.Data,"Cost"),".0-0")," ")}}function u_(n,r){if(1&n&&(e.TgZ(0,"td",45),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,null==t.data?null:t.data.Data,"ProfitWithTax"),".0-0")," ")}}function __(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",14)(1,"table",15),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",16)(3,"tr"),e.YNc(4,zu,2,0,"th",17),e.YNc(5,Wu,2,0,"th",17),e.TgZ(6,"th",18),e._uU(7,"Outlet"),e.qZA(),e.TgZ(8,"th",19),e._uU(9,"Trans "),e.qZA(),e.TgZ(10,"th",20),e._uU(11," Quantity"),e.qZA(),e.TgZ(12,"th",21),e._uU(13," Gross"),e.qZA(),e.TgZ(14,"th",22),e._uU(15," Sales"),e.qZA(),e.TgZ(16,"th",23),e._uU(17,"Tax"),e.qZA(),e.TgZ(18,"th",24),e._uU(19,"Sales + Tax "),e.qZA(),e.YNc(20,$u,2,0,"th",25),e.YNc(21,Xu,2,0,"th",26),e.YNc(22,e_,2,1,"th",27),e.qZA()(),e.TgZ(23,"tbody"),e.YNc(24,l_,26,30,"tr",28),e.qZA(),e.TgZ(25,"tfoot")(26,"tr",29),e.YNc(27,s_,1,0,"td",30),e.YNc(28,p_,1,0,"td",30),e._UZ(29,"td",31),e.TgZ(30,"td",32),e._uU(31),e.ALo(32,"number"),e.ALo(33,"sum"),e.qZA(),e.TgZ(34,"td",32),e._uU(35),e.ALo(36,"number"),e.ALo(37,"sum"),e.qZA(),e.TgZ(38,"td",32),e._uU(39),e.ALo(40,"number"),e.ALo(41,"sum"),e.qZA(),e.TgZ(42,"td",32),e._uU(43),e.ALo(44,"number"),e.ALo(45,"sum"),e.qZA(),e.TgZ(46,"td",32),e._uU(47),e.ALo(48,"number"),e.ALo(49,"sum"),e.qZA(),e.TgZ(50,"td",33)(51,"a"),e._uU(52),e.ALo(53,"number"),e.ALo(54,"sum"),e.qZA()(),e.YNc(55,c_,3,8,"td",34),e.YNc(56,d_,4,7,"td",35),e.YNc(57,u_,4,7,"td",36),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",t.isCompareData),e.xp6(11),e.Q6J("mat-sort-header",t.pageData.IgnoreTax?"Tax":"SalesTaxNet"),e.xp6(2),e.s9C("altpropcond",t.pageData.IgnoreTax),e.xp6(2),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(2),e.Q6J("ngForOf",null==t.data?null:t.data.Data),e.xp6(3),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",t.isCompareData),e.xp6(3),e.Oqu(e.xi3(32,19,e.xi3(33,22,null==t.data?null:t.data.Data,"Count"),".0-0")),e.xp6(4),e.Oqu(e.xi3(36,25,e.xi3(37,28,null==t.data?null:t.data.Data,"Quantity"),".0-0")),e.xp6(4),e.Oqu(e.xi3(40,31,e.xi3(41,34,null==t.data?null:t.data.Data,"Gross"),".0-0")),e.xp6(4),e.hij(" ",e.xi3(44,37,e.xi3(45,40,null==t.data?null:t.data.Data,"SalesNet"),".0-0")," "),e.xp6(4),e.hij(" ",e.xi3(48,43,e.xi3(49,46,null==t.data?null:t.data.Data,"Tax"),".0-0")," "),e.xp6(5),e.Oqu(e.xi3(53,49,e.xi3(54,52,null==t.data?null:t.data.Data,"SalesWithTax"),".0-0")),e.xp6(3),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost)}}const g_=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance"]};let h_=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/OutletGroupPerformance","ReportLoader/OutletPerformance"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"isCompareData",!1),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i}postInit(t){this.menuData.H=t.PageTitle}sortData(t){const a=this.data.slice();t.active&&""!==t.direction?this.data=a.sort((o,i)=>{const s="asc"===t.direction;switch(o.Name=o.Name?o.Name:"",i.Name=i.Name?i.Name:"",t.active){case"Name":return this.compare(o.Name,i.Name,s);case"Count":return this.compare(o.Count,i.Count,s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);case"Gross":return this.compare(o.Gross,i.Gross,s);case"SalesNet":return this.compare(o.SalesNet,i.SalesNet,s);case"SalesWithTax":return this.compare(o.SalesWithTax,i.SalesWithTax,s);case"Tax":return this.compare(o.Tax,i.Tax,s);case"SalesTaxNet":return this.compare(o.SalesTaxNet,i.SalesTaxNet,s);case"Cost":return this.compare(o.Cost,i.Cost,s);case"Profit":return this.compare(o.Profit,i.Profit,s);case"ProfitWithTax":return this.compare(o.ProfitWithTax,i.ProfitWithTax,s);default:return 0}}):this.data.Data=a}openExportModal(){this.matDialog.open(M.H,{data:{title:"Outlet Group Performance",exportTypes:[{ID:"ReportExport/OutletGroupPerformance",Value:"Default",FileName:"Outlet Group Performance"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-outlet-group-performance"]],features:[e.qOj],decls:10,vars:7,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["name","Compare",3,"model","modelChange"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 35px;",4,"ngIf"],["mat-sort-header","Name",1,"align-left"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Gross","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right",2,"width","120px"],["arrowPosition","before",1,"flex-right",2,"width","120px",3,"mat-sort-header"],["mat-sort-header","SalesWithTax","altprop","SalesNet","arrowPosition","before",1,"flex-right",2,"width","120px",3,"altpropcond"],["style","width: 50px;",4,"ngIf"],["mat-sort-header","Cost","style","width: 120px;","arrowPosition","before","class","flex-right",4,"ngIf"],["style","width: 120px;","arrowPosition","before","class","flex-right",3,"mat-sort-header",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],[1,"text-end"],[1,"text-end","text-primary"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[2,"width","35px"],[2,"width","50px"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["style","width: 35px;",3,"ngClass",4,"ngIf"],[1,"text-end",2,"width","70px"],[2,"width","35px",3,"ngClass"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,Ku,3,0,"a",1),e.TgZ(3,"a",2),e._uU(4,"By Entity "),e.qZA()(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,ju,16,5,"div",4),e.qZA()(),e.TgZ(8,"content"),e.YNc(9,__,58,55,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(6,g_)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.mk,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,f.YE,f.nU,q.P,S.qU,p.JJ]})),n})();function f_(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",7),e._uU(2," Export "),e.qZA()}}function x_(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",8)(1,"div")(2,"h6"),e._uU(3,"Sales"),e.qZA(),e.TgZ(4,"ng-select-infinite",9),e.NdJ("selectedChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SalesID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Year"),e.qZA(),e.TgZ(8,"ng-select",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Year=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Type"),e.qZA(),e.TgZ(12,"ng-select",11),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("selected",t.pageData.Filter.SalesID)("items",null==t.pageData.Options?null:t.pageData.Options.Sales),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.Year)("items",t.Years),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Options?null:t.pageData.Options.Types)}}const T_=function(n){return{"flex-right":n}};function C_(n,r){if(1&n&&(e.TgZ(0,"th",18),e._uU(1),e.qZA()),2&n){const t=r.$implicit;e.s9C("arrowPosition",r.index?"before":"after"),e.Q6J("mat-sort-header",t)("ngClass",e.VKq(4,T_,"Outlet"!=t)),e.xp6(1),e.hij(" ",t,"")}}function Z_(n,r){if(1&n&&(e.TgZ(0,"div",21),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit,a=e.oxw().$implicit;e.xp6(1),e.Oqu(a[t])}}function D_(n,r){if(1&n&&(e.TgZ(0,"div",22),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit,a=e.oxw().$implicit;e.xp6(1),e.hij("",e.lcZ(2,1,a[t])," ")}}function v_(n,r){if(1&n&&(e.TgZ(0,"td"),e.YNc(1,Z_,2,1,"div",19),e.YNc(2,D_,3,3,"div",20),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.Q6J("ngIf","Outlet"==t),e.xp6(1),e.Q6J("ngIf","Outlet"!=t)}}function b_(n,r){if(1&n&&(e.TgZ(0,"tr"),e.YNc(1,v_,3,2,"td",16),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",a.getKeys(t))}}function y_(n,r){if(1&n&&(e.TgZ(0,"td",25),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t))}}function S_(n,r){if(1&n&&(e.TgZ(0,"tfoot")(1,"tr",23)(2,"td"),e._uU(3,"Total : "),e.qZA(),e.YNc(4,y_,3,3,"td",24),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("ngForOf",t.data.DataFooter)}}function A_(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",12)(1,"table",13),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",14)(3,"tr"),e.YNc(4,C_,2,6,"th",15),e.qZA()(),e.TgZ(5,"tbody"),e.YNc(6,b_,2,1,"tr",16),e.qZA(),e.YNc(7,S_,5,1,"tfoot",17),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngForOf",t.data.Dataheader),e.xp6(2),e.Q6J("ngForOf",t.data.Data),e.xp6(1),e.Q6J("ngIf",t.data.Data.length>0)}}const w_=function(){return["/menu/Reports/Sales_Report/Standard/Compare"]};let F_=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/MonthlyOutletPerformance","ReportLoader/MonthlyReportSales"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"Years",C.gT.GenerateYears((new Date).getFullYear(),11,!0)),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i}getKeys(t){return Object.keys(t)}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;for(let c=0;c<this.data.Dataheader.length;c++)if(t.active==this.data.Dataheader[c])return this.compare(o[this.data.Dataheader[c]],i[this.data.Dataheader[c]],s)}):a}openExportModal(){this.matDialog.open(M.H,{data:{title:"Outlet Monthly Comparison",exportTypes:[{ID:"ReportExport/MonthlyOutletPerformance",Value:"Default",FileName:"Outlet Monthly Comparison"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-outlet-monthly-performance"]],features:[e.qOj],decls:10,vars:7,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","Range Compare",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"selected","items","selectedChange"],["placeholder","Year",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"table-light","sticky-top-thead"],[3,"mat-sort-header","arrowPosition","ngClass",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"mat-sort-header","arrowPosition","ngClass"],["style","color: black",4,"ngIf"],["style","color: black;text-align:right",4,"ngIf"],[2,"color","black"],[2,"color","black","text-align","right"],[1,"table-footer"],["class","text-end",4,"ngFor","ngForOf"],[1,"text-end"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,f_,3,0,"a",1),e.TgZ(3,"a",2),e._uU(4," View Range"),e.qZA()(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,x_,13,6,"div",4),e.qZA()(),e.TgZ(8,"content"),e.YNc(9,A_,8,3,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(6,w_)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.mk,p.sg,p.O5,h.rH,m.w9,d.JJ,d.On,x.gM,f.YE,f.nU,j.R,p.JJ]})),n})();function M_(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",7),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",8),e._uU(2," Export"),e.qZA()}}function q_(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",9)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Sales Group"),e.qZA(),e.TgZ(8,"ng-select",11),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SalesGroupID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"From - To"),e.qZA(),e.TgZ(12,"div")(13,"datepicker",12),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(14,"div",13)(15,"datepicker",14),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Delivery"),e.qZA(),e.TgZ(19,"ng-select",15),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.DeliveryID=o)}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"Sales Type"),e.qZA(),e.TgZ(23,"ng-select",16),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()(),e.TgZ(24,"div")(25,"h6"),e._uU(26,"Complementary"),e.qZA(),e.TgZ(27,"radio-options",17),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.IncludeComplementary=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.List?null:t.pageData.List.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.SalesGroupID)("items",null==t.pageData.List?null:t.pageData.List.SalesGroup),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.DeliveryID)("items",null==t.pageData.List?null:t.pageData.List.Deliveries),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.List?null:t.pageData.List.Types),e.xp6(4),e.Q6J("model",t.pageData.Filter.IncludeComplementary)}}function I_(n,r){1&n&&(e.TgZ(0,"th",42),e._uU(1," Sales Group"),e.qZA())}function P_(n,r){1&n&&(e.TgZ(0,"th",43),e._uU(1," Cost "),e.qZA())}function O_(n,r){1&n&&(e.TgZ(0,"th",44),e._uU(1,"Profit "),e.qZA())}function N_(n,r){1&n&&(e.TgZ(0,"th",45),e._uU(1,"Target "),e.qZA())}function J_(n,r){1&n&&(e.TgZ(0,"th",46),e._uU(1,"Ach(%) "),e.qZA())}function L_(n,r){if(1&n&&(e.TgZ(0,"td"),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(t.Group)}}function U_(n,r){if(1&n&&(e.TgZ(0,"td",50),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Cost))}}function Q_(n,r){if(1&n&&(e.TgZ(0,"td",51),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij("",e.lcZ(2,1,t.Profit)," ")}}function k_(n,r){if(1&n&&(e.TgZ(0,"td",51),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.Target)," ")}}function E_(n,r){if(1&n&&(e.TgZ(0,"td",51),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.Achievement),"")}}const Y_=function(){return["/menu/Contacts/Contact/Sales_Person/Info"]},R_=function(n){return{ID:n}},G_=function(){return["/menu/Reports/Sales_Report/Standard/Detail"]},H_=function(n,r,t,a,o){return{SalesPersonID:n,From:r,To:t,ListIDs:a,IncludeComplementary:o}},V_=function(n,r,t,a){return{ID:n,from:r,to:t,IncludeComplementary:a}};function B_(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td",47)(2,"a",48),e._uU(3),e.qZA()(),e.YNc(4,L_,2,1,"td",36),e.TgZ(5,"td",38)(6,"a",48),e.ALo(7,"date"),e.ALo(8,"date"),e._uU(9),e.ALo(10,"number"),e.qZA()(),e.TgZ(11,"td",39),e._uU(12),e.ALo(13,"number"),e.qZA(),e.TgZ(14,"td",39),e._uU(15),e.ALo(16,"number"),e.qZA(),e.TgZ(17,"td",39),e._uU(18),e.ALo(19,"number"),e.qZA(),e.TgZ(20,"td",38)(21,"a",49),e.ALo(22,"date"),e.ALo(23,"date"),e._uU(24),e.ALo(25,"number"),e.qZA()(),e.YNc(26,U_,3,3,"td",40),e.YNc(27,Q_,3,3,"td",41),e.YNc(28,k_,3,3,"td",41),e.YNc(29,E_,3,3,"td",41),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Q6J("routerLink",e.DdM(43,Y_))("queryParams",e.VKq(44,R_,t.ID)),e.xp6(1),e.Oqu(t.Name),e.xp6(1),e.Q6J("ngIf",a.data.Show),e.xp6(2),e.Q6J("routerLink",e.DdM(46,G_))("queryParams",e.qbA(47,H_,t.ID,e.xi3(7,16,a.pageData.Filter.From,"ddMMyyyy"),e.xi3(8,19,a.pageData.Filter.To,"ddMMyyyy"),a.pageData.Filter.ListIDs,a.pageData.Filter.IncludeComplementary)),e.xp6(3),e.Oqu(e.xi3(10,22,t.Orders,".0-0")),e.xp6(3),e.Oqu(e.xi3(13,25,t.Quantity,".0-0")),e.xp6(3),e.Oqu(e.xi3(16,28,t.Sales,".0-0")),e.xp6(3),e.Oqu(e.xi3(19,31,t.Tax,".0-0")),e.xp6(3),e.Q6J("queryParams",e.l5B(53,V_,t.ID,e.xi3(22,34,a.pageData.Filter.From,"ddMMyyyy"),e.xi3(23,37,a.pageData.Filter.To,"ddMMyyyy"),a.pageData.Filter.IncludeComplementary)),e.xp6(3),e.hij(" ",e.xi3(25,40,t.SalesNTax,".0-0")," "),e.xp6(2),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",a.roleService.report.Profit),e.xp6(1),e.Q6J("ngIf",a.data.ShowSalesTarget),e.xp6(1),e.Q6J("ngIf",a.data.ShowSalesTarget)}}function K_(n,r){1&n&&e._UZ(0,"td")}function j_(n,r){if(1&n&&(e.TgZ(0,"td",50),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.data.List,"Cost")),"")}}function z_(n,r){if(1&n&&(e.TgZ(0,"td",51),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.data.List,"Profit")),"")}}function W_(n,r){if(1&n&&(e.TgZ(0,"td",51),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.data.List,"Target")),"")}}function $_(n,r){if(1&n&&(e.TgZ(0,"td",51),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.ALo(4,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.data.List,"Sales")/e.xi3(4,6,t.data.List,"Target")*100)," ")}}function X_(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",18)(1,"div",19)(2,"table",20),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(3,"thead",21)(4,"tr",22)(5,"th",23),e._uU(6,"Sales Person"),e.qZA(),e.YNc(7,I_,2,0,"th",24),e.TgZ(8,"th",25),e._uU(9," Orders"),e.qZA(),e.TgZ(10,"th",26),e._uU(11,"Quantity"),e.qZA(),e.TgZ(12,"th",27),e._uU(13," Sales"),e.qZA(),e.TgZ(14,"th",28),e._uU(15,"Tax "),e.qZA(),e.TgZ(16,"th",29),e._uU(17," Sales + Tax "),e.qZA(),e.YNc(18,P_,2,0,"th",30),e.YNc(19,O_,2,0,"th",31),e.YNc(20,N_,2,0,"th",32),e.YNc(21,J_,2,0,"th",33),e.qZA()(),e.TgZ(22,"tbody"),e.YNc(23,B_,30,58,"tr",34),e.qZA(),e.TgZ(24,"tfoot")(25,"tr",35),e.YNc(26,K_,1,0,"td",36),e.TgZ(27,"td",37),e._uU(28,"Total:"),e.qZA(),e.TgZ(29,"td",38),e._uU(30),e.ALo(31,"number"),e.ALo(32,"sum"),e.qZA(),e.TgZ(33,"td",39),e._uU(34),e.ALo(35,"number"),e.ALo(36,"sum"),e.qZA(),e.TgZ(37,"td",39),e._uU(38),e.ALo(39,"number"),e.ALo(40,"sum"),e.qZA(),e.TgZ(41,"td",39),e._uU(42),e.ALo(43,"number"),e.ALo(44,"sum"),e.qZA(),e.TgZ(45,"td",38),e._uU(46),e.ALo(47,"number"),e.ALo(48,"sum"),e.qZA(),e.YNc(49,j_,4,6,"td",40),e.YNc(50,z_,4,6,"td",41),e.YNc(51,W_,4,6,"td",41),e.YNc(52,$_,5,9,"td",41),e.qZA()()()()()}if(2&n){const t=e.oxw();e.xp6(7),e.Q6J("ngIf",t.data.Show),e.xp6(11),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.report.Profit),e.xp6(1),e.Q6J("ngIf",t.data.ShowSalesTarget),e.xp6(1),e.Q6J("ngIf",t.data.ShowSalesTarget),e.xp6(2),e.Q6J("ngForOf",t.data.List),e.xp6(3),e.Q6J("ngIf",t.data.Show),e.xp6(4),e.Oqu(e.xi3(31,16,e.xi3(32,19,t.data.List,"Orders"),".0-0")),e.xp6(4),e.Oqu(e.xi3(35,22,e.xi3(36,25,t.data.List,"Quantity"),".0-0")),e.xp6(4),e.Oqu(e.xi3(39,28,e.xi3(40,31,t.data.List,"Sales"),".0-0")),e.xp6(4),e.Oqu(e.xi3(43,34,e.xi3(44,37,t.data.List,"Tax"),".0-0")),e.xp6(4),e.hij("",e.xi3(47,40,e.xi3(48,43,t.data.List,"SalesNTax"),".0-0")," "),e.xp6(3),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.report.Profit),e.xp6(1),e.Q6J("ngIf",t.data.ShowSalesTarget),e.xp6(1),e.Q6J("ngIf",t.data.ShowSalesTarget)}}const tm=function(){return["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"]},om=function(){return["/menu/Reports/Sales_Report/Standard/Person/Person_Commission"]};let am=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/SalesPerson","ReportLoader/SalesPerson"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),this.httpService=t,this.csvConverter=a,this.reportFilterService=o,this.roleService=i,this.matDialog=s}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}sortData(t){const a=this.data.List.slice();this.data.List=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(o.Name=null==o.Name?"":o.Name,i.Name=null==i.Name?"":i.Name,o.Group=null==o.Group?"":o.Group,i.Group=null==i.Group?"":i.Group,t.active){case"Name":return this.compare(o.Name.toLocaleLowerCase(),i.Name.toLocaleLowerCase(),s);case"Group":return this.compare(o.Group.toLocaleLowerCase(),i.Group.toLocaleLowerCase(),s);case"Orders":return this.compare(o.Orders,i.Orders,s);case"Tax":return this.compare(o.Tax,i.Tax,s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);case"Cost":return this.compare(o.Cost,i.Cost,s);case"Profit":return this.compare(o.Profit,i.Profit,s);case"Sales":return this.compare(o.Sales,i.Sales,s);case"SalesNTax":return this.compare(o.SalesNTax,i.SalesNTax,s);case"Target":return this.compare(o.Target,i.Target,s);case"Achievement":return this.compare(o.Achievement,i.Achievement,s);default:return 0}}):a}openExportModal(){this.matDialog.open(M.H,{data:{title:"Sales by Sales Person",exportTypes:[{ID:"ReportExport/SalesPerson",Value:"Default",FileName:"Sales by Sales Person"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(N.z),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-sales-person"]],features:[e.qOj],decls:12,vars:9,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Target",1,"btn","btn-outline-secondary","me-6",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Target",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a Sales Group",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"ngModel","items","ngModelChange"],["name","Complementary",3,"model","modelChange"],[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","flex-right",4,"ngIf"],["mat-sort-header","Orders","arrowPosition","before",1,"flex-right",2,"width","80px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Sales","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Tax","arrowPosition","before",1,"flex-right",2,"width","90px"],["mat-sort-header","SalesNTax","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Cost","style","width: 120px;","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","Profit","style","width: 120px;","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","Target","style","width: 120px;","arrowPosition","before","class","align-l",4,"ngIf"],["mat-sort-header","Achievement","style","width: 120px;","arrowPosition","before","class","flex-right",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[4,"ngIf"],[1,"empty-column","text-end"],[1,"text-end","text-primary"],[1,"text-end"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],["mat-sort-header","Group","arrowPosition","before",1,"flex-right"],["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","Target","arrowPosition","before",1,"align-l",2,"width","120px"],["mat-sort-header","Achievement","arrowPosition","before",1,"flex-right",2,"width","120px"],[1,"text-primary"],[3,"routerLink","queryParams"],["routerLink","Commission_Report",3,"queryParams"],[1,"text-end","text-danger"],[1,"text-end","text-success"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,M_,3,0,"button",1),e.TgZ(3,"a",2),e._uU(4,"By Employee"),e.qZA(),e.TgZ(5,"a",3),e._uU(6,"By Item"),e.qZA()(),e.TgZ(7,"filters")(8,"div",4),e.YNc(9,q_,28,12,"div",5),e.qZA()(),e.TgZ(10,"content"),e.YNc(11,X_,53,46,"div",6),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(7,tm)),e.xp6(2),e.Q6J("routerLink",e.DdM(8,om)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,x.gM,f.YE,f.nU,q.P,S.qU,p.JJ,p.uU]})),n})();function im(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",7),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.exportCSV(o.csvConverter,"ReportExport/GetSalesPersonCommissionGroupBySales","Sales_Commission.csv"))}),e._UZ(1,"i",8),e._uU(2,"Export"),e.qZA()}}function rm(n,r){if(1&n&&(e.TgZ(0,"span",17),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function lm(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",9)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",11),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,rm,2,2,"ng-template",12),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Sales Group"),e.qZA(),e.TgZ(13,"ng-select",13),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SalesGroupID=o)}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"From - To"),e.qZA(),e.TgZ(17,"div")(18,"datepicker",14),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(19,"div",15)(20,"datepicker",16),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.List?null:t.pageData.List.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.List?null:t.pageData.List.Categories),e.xp6(5),e.Q6J("ngModel",t.pageData.Filter.SalesGroupID)("items",null==t.pageData.List?null:t.pageData.List.SalesGroup),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function sm(n,r){1&n&&(e.TgZ(0,"th",32),e._uU(1,"Sales Target"),e.qZA())}function pm(n,r){if(1&n&&(e.TgZ(0,"td",30),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.SalesTarget,".0-0"),"")}}const cm=function(n,r,t){return{ID:n,from:r,to:t}},nt="/menu/Reports/Sales_Report/Standard/Person/Commission_Report",dm=function(n){return[nt,n]};function um(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td",30),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td",30),e._uU(7),e.ALo(8,"number"),e.qZA(),e.TgZ(9,"td",30),e._uU(10),e.ALo(11,"number"),e.qZA(),e.TgZ(12,"td",30)(13,"a",33),e.ALo(14,"date"),e.ALo(15,"date"),e._uU(16),e.ALo(17,"number"),e.qZA()(),e.YNc(18,pm,3,4,"td",34),e.ALo(19,"sum"),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.SalesPersonName),e.xp6(2),e.Oqu(e.xi3(5,7,t.TotalOrders,".0-0")),e.xp6(3),e.Oqu(e.xi3(8,10,t.Quantity,".0-0")),e.xp6(3),e.Oqu(e.xi3(11,13,t.GrossRevenue,".0-0")),e.xp6(3),e.Q6J("routerLink",e.VKq(31,dm,e.kEZ(27,cm,t.SalesPersonID,e.xi3(14,16,a.pageData.Filter.From,"ddMMyyyy"),e.xi3(15,19,a.pageData.Filter.To,"ddMMyyyy")))),e.xp6(3),e.hij(" ",e.lcZ(17,22,t.TotalCommission)," "),e.xp6(2),e.Q6J("ngIf",e.xi3(19,24,a.data.List,"SalesTarget")>0)}}function _m(n,r){1&n&&e._UZ(0,"td",35)}function mm(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",18)(1,"table",19),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",20)(3,"tr")(4,"th",21),e._uU(5,"Sales Person"),e.qZA(),e.TgZ(6,"th",22),e._uU(7,"Orders"),e.qZA(),e.TgZ(8,"th",23),e._uU(9,"Items Quantity"),e.qZA(),e.TgZ(10,"th",24),e._uU(11,"Gross Revenue"),e.qZA(),e.TgZ(12,"th",25),e._uU(13,"Product Commission "),e.qZA(),e.YNc(14,sm,2,0,"th",26),e.ALo(15,"sum"),e.qZA()(),e.TgZ(16,"tbody"),e.YNc(17,um,20,33,"tr",27),e.qZA(),e.TgZ(18,"tfoot")(19,"tr",28)(20,"td",29),e._uU(21,"Total:"),e.qZA(),e.TgZ(22,"td",30),e._uU(23),e.ALo(24,"number"),e.ALo(25,"sum"),e.qZA(),e.TgZ(26,"td",30),e._uU(27),e.ALo(28,"number"),e.ALo(29,"sum"),e.qZA(),e.TgZ(30,"td",30),e._uU(31),e.ALo(32,"number"),e.ALo(33,"sum"),e.qZA(),e.TgZ(34,"td",30),e._uU(35),e.ALo(36,"number"),e.ALo(37,"sum"),e.qZA(),e.YNc(38,_m,1,0,"td",31),e.ALo(39,"sum"),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(14),e.Q6J("ngIf",e.xi3(15,7,t.data.List,"SalesTarget")>0),e.xp6(3),e.Q6J("ngForOf",t.data.List),e.xp6(6),e.Oqu(e.lcZ(24,10,e.xi3(25,12,t.data.List,"TotalOrders"))),e.xp6(4),e.Oqu(e.lcZ(28,15,e.xi3(29,17,t.data.List,"Quantity"))),e.xp6(4),e.Oqu(e.lcZ(32,20,e.xi3(33,22,t.data.List,"GrossRevenue"))),e.xp6(4),e.Oqu(e.lcZ(36,25,e.xi3(37,27,t.data.List,"TotalCommission"))),e.xp6(3),e.Q6J("ngIf",e.xi3(39,30,t.data.List,"SalesTarget")>0)}}const gm=function(){return[nt]},hm=function(){return["/menu/Reports/Sales_Report/Standard/Person"]};let fm=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/GetSalesPersonCommissionGroupBySales","ReportLoader/SalesPerson"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),this.httpService=t,this.csvConverter=a,this.reportFilterService=o,this.roleService=i}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}sortData(t){const a=this.data.List.slice();this.data.List=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"Name":return this.compare(o.Name,i.Name,s);case"TotalOrders":return this.compare(o.TotalOrders,i.TotalOrders,s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);case"GrossRevenue":return this.compare(o.GrossRevenue,i.GrossRevenue,s);case"TotalCommission":return this.compare(o.TotalCommission,i.TotalCommission,s);case"SalesTarget":return this.compare(o.SalesTarget,i.SalesTarget,s);default:return 0}}):a}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(N.z),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-sales-commision"]],features:[e.qOj],decls:12,vars:9,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary me-6",3,"click",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Target",1,"btn","btn-outline-secondary","me-6",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Target",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["bindLabel","Name","bindValue","ID","placeholder","Choose a Sales group",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name","text","Sales Person",1,"align-left"],["mat-sort-header","TotalOrders","arrowPosition","before",1,"flex-right",2,"width","110px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","110px"],["mat-sort-header","GrossRevenue","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","TotalCommission","arrowPosition","before",1,"flex-right",2,"width","150px"],["mat-sort-header","SalesTarget","style","width: 150px;","arrowPosition","before","class","flex-right",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column","text-end"],[1,"text-end"],["class","empty-column",4,"ngIf"],["mat-sort-header","SalesTarget","arrowPosition","before",1,"flex-right",2,"width","150px"],[3,"routerLink"],["class","text-end",4,"ngIf"],[1,"empty-column"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,im,3,0,"a",1),e.TgZ(3,"a",2),e._uU(4,"By Product"),e.qZA(),e.TgZ(5,"a",3),e._uU(6,"By Order"),e.qZA()(),e.TgZ(7,"filters")(8,"div",4),e.YNc(9,lm,21,9,"div",5),e.qZA()(),e.TgZ(10,"content"),e.YNc(11,mm,40,33,"div",6),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(7,gm)),e.xp6(2),e.Q6J("routerLink",e.DdM(8,hm)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,m.ir,A.QB,d.JJ,d.On,x.gM,f.YE,f.nU,S.qU,p.JJ,p.uU]})),n})();function xm(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",14),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.openExportModal())}),e._UZ(1,"i",15),e._uU(2," Export "),e.qZA()}}function Tm(n,r){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",22)(2,"datepicker",23),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.pageData.Filter.From=o)}),e.qZA(),e.TgZ(3,"div",24)(4,"app-timepicker",25),e.NdJ("timeChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.timeFrom=o)})("timeChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.timeFromChange(o))}),e.qZA()()(),e.TgZ(5,"div",26)(6,"datepicker",27),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.pageData.Filter.To=o)}),e.qZA(),e.TgZ(7,"div",24)(8,"app-timepicker",25),e.NdJ("timeChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.timeTo=o)})("timeChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.timeToChange(o))}),e.qZA()()(),e.BQk()}if(2&n){const t=e.oxw(3);e.xp6(2),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("time",t.timeFrom),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(2),e.Q6J("time",t.timeTo)}}function Cm(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"datepicker",28),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(2,"div",29)(3,"datepicker",30),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.onFilterToDate())}),e.qZA()()}if(2&n){const t=e.oxw(3);e.xp6(1),e.Q6J("date",t.pageData.Filter.From)("appearance","outline")("width",100),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)("appearance","outline")("width",100)}}function Zm(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",16)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",17),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Sales"),e.qZA(),e.TgZ(8,"ng-select-infinite",18),e.NdJ("selectedChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"From - To"),e.qZA(),e.YNc(12,Tm,9,4,"ng-container",19),e.YNc(13,Cm,4,6,"ng-template",null,20,e.W1O),e.qZA(),e.TgZ(15,"div")(16,"h6"),e._uU(17,"filter invoice by"),e.qZA(),e.TgZ(18,"radio-options",21),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.isCreated=o)}),e.qZA()()()}if(2&n){const t=e.MAs(14),a=e.oxw(2);e.xp6(4),e.Q6J("multiple",!0)("ngModel",a.pageData.Filter.ListIDs)("items",null==a.pageData.Options?null:a.pageData.Options.Entities),e.xp6(4),e.Q6J("selected",a.pageData.Filter.ID)("items",null==a.pageData.Options?null:a.pageData.Options.Sales),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter.isCreated)("ngIfElse",t),e.xp6(6),e.Q6J("options",a.filterInvoiceBy)("model",a.pageData.Filter.isCreated)}}const ot=function(n){return{ID:n}};function Dm(n,r){if(1&n&&(e.TgZ(0,"thead",34)(1,"tr",35)(2,"th",36)(3,"h2")(4,"a",37),e._uU(5),e.qZA()()()(),e.TgZ(6,"tr")(7,"th",38),e._uU(8,"Product"),e.qZA(),e.TgZ(9,"th",39),e._uU(10,"Qty"),e.qZA(),e.TgZ(11,"th",39),e._uU(12,"Sales"),e.qZA(),e.TgZ(13,"th",39),e._uU(14,"Commission"),e.qZA(),e.TgZ(15,"th",39),e._uU(16,"Total Commission"),e.qZA()()()),2&n){const t=e.oxw().$implicit;e.xp6(4),e.Q6J("queryParams",e.VKq(3,ot,t.ID)),e.xp6(1),e.AsE("",t.Name," - ",t.Code,"")}}const at=function(n,r,t,a){return{SalesID:n,From:r,To:t,VariantName:a}};function vm(n,r){if(1&n&&(e.TgZ(0,"div")(1,"a",44),e.ALo(2,"date"),e.ALo(3,"date"),e._uU(4),e.ALo(5,"number"),e.qZA()()),2&n){const t=e.oxw().$implicit,a=e.oxw(4);e.ekj("text-decoration-line-through",t.VariantCommission&&t.GroupCommission)("text-danger",t.VariantCommission&&t.GroupCommission),e.xp6(1),e.Q6J("queryParams",e.l5B(14,at,t.SalesID,e.xi3(2,6,a.pageData.Filter.From,"ddMMyyyy"),e.xi3(3,9,a.pageData.Filter.To,"ddMMyyyy"),t.Name)),e.xp6(3),e.Oqu(e.lcZ(5,12,t.VariantCommission))}}function bm(n,r){if(1&n&&(e.TgZ(0,"div")(1,"a",45),e.ALo(2,"date"),e.ALo(3,"date"),e._uU(4),e.ALo(5,"number"),e.qZA()()),2&n){const t=e.oxw().$implicit,a=e.oxw(4);e.xp6(1),e.Q6J("queryParams",e.l5B(10,at,t.SalesID,e.xi3(2,2,a.pageData.Filter.From,"ddMMyyyy"),e.xi3(3,5,a.pageData.Filter.To,"ddMMyyyy"),t.Name)),e.xp6(3),e.Oqu(e.lcZ(5,8,t.GroupCommission))}}function ym(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td")(2,"a",41),e._uU(3),e.qZA(),e.TgZ(4,"div"),e._uU(5),e.qZA()(),e.TgZ(6,"td",42),e._uU(7),e.ALo(8,"number"),e.qZA(),e.TgZ(9,"td",42),e._uU(10),e.ALo(11,"number"),e.qZA(),e.TgZ(12,"td",42),e.YNc(13,vm,6,19,"div",43),e.YNc(14,bm,6,15,"div",33),e.qZA(),e.TgZ(15,"td",42),e._uU(16),e.ALo(17,"number"),e.qZA()()),2&n){const t=r.$implicit;e.xp6(2),e.Q6J("queryParams",e.VKq(14,ot,t.VariantID)),e.xp6(1),e.Oqu(t.Name),e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(8,8,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(11,10,t.NettSales)),e.xp6(3),e.Q6J("ngIf",t.VariantCommission||!t.GroupCommission),e.xp6(1),e.Q6J("ngIf",t.GroupCommission),e.xp6(2),e.Oqu(e.lcZ(17,12,t.TotalCommission))}}function Sm(n,r){if(1&n&&(e.TgZ(0,"tbody"),e.YNc(1,ym,18,16,"tr",40),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.Item)}}function Am(n,r){if(1&n&&(e.TgZ(0,"div"),e.ALo(1,"sum"),e.ALo(2,"sum"),e.ALo(3,"sum"),e.ALo(4,"sum"),e.TgZ(5,"span",47),e._uU(6),e.ALo(7,"number"),e.ALo(8,"sum"),e.qZA()()),2&n){const t=e.oxw(2).$implicit;e.ekj("text-decoration-line-through",e.xi3(1,5,t.Item,"VariantCommission")&&e.xi3(2,8,t.Item,"GroupCommission"))("text-danger",e.xi3(3,11,t.Item,"VariantCommission")&&e.xi3(4,14,t.Item,"GroupCommission")),e.xp6(6),e.Oqu(e.lcZ(7,17,e.xi3(8,19,t.Item,"VariantCommission")))}}function wm(n,r){if(1&n&&(e.TgZ(0,"div"),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2).$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,e.xi3(3,3,t.Item,"GroupCommission")))}}function Fm(n,r){if(1&n&&(e.TgZ(0,"tfoot")(1,"tr",46)(2,"td"),e._uU(3,"Total"),e.qZA(),e.TgZ(4,"td",42),e._uU(5),e.ALo(6,"number"),e.ALo(7,"sum"),e.qZA(),e.TgZ(8,"td",42),e._uU(9),e.ALo(10,"number"),e.ALo(11,"sum"),e.qZA(),e.TgZ(12,"td",42),e.YNc(13,Am,9,22,"div",43),e.ALo(14,"sum"),e.YNc(15,wm,4,6,"div",33),e.ALo(16,"sum"),e.qZA(),e.TgZ(17,"td",42),e._uU(18),e.ALo(19,"number"),e.ALo(20,"sum"),e.qZA()()()),2&n){const t=e.oxw().$implicit;e.xp6(5),e.Oqu(e.lcZ(6,5,e.xi3(7,7,t.Item,"Quantity"))),e.xp6(4),e.Oqu(e.lcZ(10,10,e.xi3(11,12,t.Item,"NettSales"))),e.xp6(4),e.Q6J("ngIf",e.xi3(14,15,t.Item,"VariantCommission")),e.xp6(2),e.Q6J("ngIf",e.xi3(16,18,t.Item,"GroupCommission")),e.xp6(3),e.Oqu(e.lcZ(19,21,e.xi3(20,23,t.Item,"TotalCommission")))}}function Mm(n,r){if(1&n&&(e.TgZ(0,"table",31),e.YNc(1,Dm,17,5,"thead",32),e.YNc(2,Sm,2,1,"tbody",33),e.YNc(3,Fm,21,26,"tfoot",33),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.Q6J("ngIf",t.Name),e.xp6(1),e.Q6J("ngIf",t.Name),e.xp6(1),e.Q6J("ngIf",t.Name)}}const Im=function(){return["/menu/Reports/Sales_Report/Standard/Person/Employee_Commission"]},Om=function(){return["/menu/Reports/Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail"]},Nm=function(n,r){return{From:n,To:r}};function Jm(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e.TgZ(1,"actions")(2,"div",2)(3,"a",3),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.print())}),e._UZ(4,"i",4),e._uU(5," Print"),e.qZA(),e.YNc(6,xm,3,0,"a",5),e.qZA(),e.TgZ(7,"a",6),e._uU(8,"Return to Summary"),e.qZA(),e.TgZ(9,"a",7),e.ALo(10,"date"),e.ALo(11,"date"),e._UZ(12,"i",8),e._uU(13," View Detail"),e.qZA()(),e.TgZ(14,"filters")(15,"div",9),e.YNc(16,Zm,19,9,"div",10),e.qZA()(),e.TgZ(17,"content")(18,"div",11)(19,"div",12),e.YNc(20,Mm,4,3,"table",13),e.qZA()()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("hideSearchBox",!0),e.xp6(6),e.Q6J("ngIf",null==t.roleService?null:t.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(14,Im)),e.xp6(2),e.Q6J("routerLink",e.DdM(15,Om))("queryParams",e.WLB(16,Nm,e.xi3(10,8,null==t.pageData.Filter?null:t.pageData.Filter.From,"ddMMyyyy"),e.xi3(11,11,null==t.pageData.Filter?null:t.pageData.Filter.To,"ddMMyyyy"))),e.xp6(7),e.Q6J("ngIf",t.pageData.Filter),e.xp6(4),e.Q6J("ngForOf",t.data.Data)}}let Lm=(()=>{class n extends D.n{constructor(t,a,o,i,s,c){super(t,"Report/GetSalesPersonCommissionGroupByProduct","ReportLoader/SalesCommissionLoader",null,c),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"filterInvoiceBy",[{Key:!1,Value:"Date"},{Key:!0,Value:"Created"}]),(0,l.Z)(this,"timeFrom",void 0),(0,l.Z)(this,"timeTo",void 0),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.reportFilterService=s,this.activatedRoute=c}postInit(){this.menuData.H=this.data.PageTitle}preInitLoader(){let t=this.route?.snapshot?.queryParams;t&&(this.queryParams=JSON.parse(JSON.stringify(t)),this.queryParams.IncludeComplementary="true"==t.IncludeComplementary)}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}print(){window.print()}openBigPicture(t,a){BigPicture({el:a.target,imgSrc:t.ImageURL||"//res.cloudinary.com/pos/image/upload/w_200/POS/Images/Icon/products_thumb.png"})}openExportModal(){this.matDialog.open(M.H,{data:{title:"Employee Commission Report",exportTypes:[{ID:"ReportExport/SalesPersonGroupByProduct",Value:"Default",FileName:"Employee Commission Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(t){this.pageData.Filter.To=C.gT.setDateTime(t,this.pageData.Filter.To)}timeFromChange(t){this.pageData.Filter.From=C.gT.setDateTime(t,this.pageData.Filter.From)}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw),e.Y36(N.z),e.Y36(h.gz))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-commision-report"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],[1,"btn-group","me-5"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Commission Summary",1,"btn","btn-outline-secondary","me-5",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Sales Person Statistics",1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-circle-info","ms-2"],[1,"d-flex"],["container","",4,"ngIf"],[1,"container-fluid"],[1,"table-responsive"],["id","tableGrid","class","table border-bottom mb-10",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"selected","items","selectedChange"],[4,"ngIf","ngIfElse"],["DATEONLY",""],["name","Is Created",3,"options","model","modelChange"],[1,"w-100","d-flex","mt-2","align-items-center"],["name","From","appearance","outline",1,"timepicker",3,"date","dateChange"],[1,"ms-2"],[3,"time","timeChange"],[1,"w-100","d-flex","align-items-center","mt-4"],["name","To","appearance","outline",1,"timepicker",3,"date","dateChange"],["name","From",3,"date","appearance","width","dateChange"],[1,"mt-4"],["name","To",3,"date","appearance","width","dateChange"],["id","tableGrid",1,"table","border-bottom","mb-10"],["class","thead-light",4,"ngIf"],[4,"ngIf"],[1,"thead-light"],[2,"border","none !important"],["colspan","5",1,"text-center","bg-white","border-none"],["routerLink","/menu/Contacts/Contact/Sales_Person/Info",3,"queryParams"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[4,"ngFor","ngForOf"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"text-end"],[3,"text-decoration-line-through","text-danger",4,"ngIf"],["routerLink","Commission_Report_Detail","matTooltipPosition","above","matTooltip","variant commission",3,"queryParams"],["routerLink","Commission_Report_Detail",3,"queryParams"],[1,"table-footer","fw-bold"],["matTooltipPosition","above","matTooltip","Total variant commission"]],template:function(t,a){1&t&&e.YNc(0,Jm,21,19,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,x.gM,q.P,j.R,ge.E,S.qU,p.JJ,p.uU],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}"]})),n})();function Um(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.exportCSV(o.csvConverter,"ReportExport/GetSalesPersonCommissionDetail",o.data.SalesName?o.data.SalesName:"_Commission_Detail_"+o.transformDate(o.pageData.Filter.From,"dd_MMM")+"-"+o.transformDate(o.pageData.Filter.To,"dd_MMM")+".csv"))}),e._UZ(1,"i",7),e._uU(2,"Export"),e.qZA()}}function Qm(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",8)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListEntityID=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Sales"),e.qZA(),e.TgZ(8,"ng-select",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SalesID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"From - To"),e.qZA(),e.TgZ(12,"div")(13,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(14,"div",12)(15,"datepicker",13),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.ListEntityID)("multiple",!0)("items",null==t.pageData.Options?null:t.pageData.Options.Outlets),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.SalesID)("items",null==t.pageData.Options?null:t.pageData.Options.Sales),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}const km=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},Em=function(n){return{ID:n}};function Ym(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.ALo(3,"date"),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td")(7,"a",26),e._uU(8),e.qZA()(),e.TgZ(9,"td"),e._uU(10),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.qZA(),e.TgZ(13,"td",23),e._uU(14),e.ALo(15,"number"),e.qZA(),e.TgZ(16,"td",23),e._uU(17),e.ALo(18,"number"),e.qZA(),e.TgZ(19,"td",23),e._uU(20),e.ALo(21,"number"),e.qZA()()),2&n){const t=r.$implicit;e.xp6(2),e.Oqu(e.xi3(3,10,t.Date,"dd MMM yyyy")),e.xp6(3),e.Oqu(t.EntityName),e.xp6(2),e.Q6J("routerLink",e.DdM(19,km))("queryParams",e.VKq(20,Em,t.ID)),e.xp6(1),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.VariantName),e.xp6(2),e.Oqu(t.SalesName),e.xp6(2),e.Oqu(e.lcZ(15,13,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(18,15,t.SalesCommission)),e.xp6(3),e.Oqu(e.lcZ(21,17,t.Total))}}function Rm(n,r){if(1&n&&(e.TgZ(0,"div",14)(1,"table",15)(2,"thead",16)(3,"tr",17)(4,"th",18),e._uU(5,"Date"),e.qZA(),e.TgZ(6,"th",18),e._uU(7,"Outlet"),e.qZA(),e.TgZ(8,"th",18),e._uU(9,"Number"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Name"),e.qZA(),e.TgZ(12,"th"),e._uU(13,"Sales Person"),e.qZA(),e.TgZ(14,"th",19),e._uU(15,"Quantity"),e.qZA(),e.TgZ(16,"th",19),e._uU(17,"Commission"),e.qZA(),e.TgZ(18,"th",19),e._uU(19,"Total Commission"),e.qZA()()(),e.TgZ(20,"tbody"),e.YNc(21,Ym,22,22,"tr",20),e.qZA(),e.TgZ(22,"tfoot")(23,"tr",21)(24,"td",22),e._uU(25,"Total:"),e.qZA(),e.TgZ(26,"td",23),e._uU(27),e.ALo(28,"number"),e.ALo(29,"sum"),e.qZA(),e.TgZ(30,"td",24),e._uU(31),e.ALo(32,"number"),e.ALo(33,"sum"),e.qZA(),e.TgZ(34,"td",25),e._uU(35),e.ALo(36,"number"),e.ALo(37,"sum"),e.qZA()()()()()),2&n){const t=e.oxw();e.xp6(21),e.Q6J("ngForOf",t.data.Data),e.xp6(6),e.hij("",e.lcZ(28,4,e.xi3(29,6,t.data.Data,"Quantity"))," "),e.xp6(4),e.hij(" ",e.lcZ(32,9,e.xi3(33,11,t.data.Data,"SalesCommission")),""),e.xp6(4),e.hij(" ",e.lcZ(36,14,e.xi3(37,16,t.data.Data,"Total")),"")}}const Hm=function(){return["/menu/Reports/Sales_Report/Standard/Person/Commission_Report"]};let Vm=(()=>{class n extends D.n{constructor(t,a,o,i,s,c){super(t,"Report/GetSalesPersonCommissionDetail","ReportLoader/SalesCommissionDetailLoader",null,i),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"datePipe",void 0),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"datasource",[]),this.httpService=t,this.csvConverter=a,this.datePipe=o,this.activatedRoute=i,this.reportFilterService=s,this.roleService=c}postInit(){this.menuData.H=this.data.PageTitle,this.datasource=this.data.Data}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}transformDate(t,a){return this.datePipe.transform(t,a)}getFilterData(t){this.data.Data=this.datasource.filter(a=>Object.keys(a).some(o=>null!=a[o]&&a[o].toString().toLowerCase().includes(t.toLowerCase())))}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(p.uU),e.Y36(h.gz),e.Y36(N.z),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-commision-report-detail"]],features:[e.qOj],decls:10,vars:7,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary me-6",3,"click",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an Outlet",3,"ngModel","multiple","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a Sales Person",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","120px"],[1,"text-end",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end"],[1,"text-end","text-success"],["colspan","1",1,"text-end","text-success"],["colspan","2",1,"text-end","text-success"],["h","",3,"routerLink","queryParams"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.VariantName=i})("onSubmit",function(){return a.searchFromPageOne()})("textChange",function(i){return a.getFilterData(i)}),e.TgZ(1,"actions"),e.YNc(2,Um,3,0,"a",1),e.TgZ(3,"a",2),e._uU(4,"Back"),e.qZA()(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,Qm,16,7,"div",4),e.qZA()(),e.TgZ(8,"content"),e.YNc(9,Rm,38,19,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.VariantName),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(6,Hm)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,x.gM,S.qU,p.JJ,p.uU]})),n})();function Bm(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.exportCSV(o.csvConverter,"ReportExport/GetNonStandardPrice","Non-Standard Price.csv"))}),e._UZ(1,"i",7),e._uU(2,"Export"),e.qZA()}}function Km(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",8)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Variant"),e.qZA(),e.TgZ(8,"autocompleteV2",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.VariantID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"From - To"),e.qZA(),e.TgZ(12,"div")(13,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(14,"div",12)(15,"datepicker",13),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"PriceType"),e.qZA(),e.TgZ(19,"radio-options",14),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.PriceTypeID=o)}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"Note"),e.qZA(),e.TgZ(23,"input",15),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Note=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.VariantID),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("model",t.pageData.Filter.PriceTypeID)("options",t.PriceType),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.Note)}}function jm(n,r){1&n&&(e.TgZ(0,"th",24),e._uU(1,"Original Cost"),e.qZA())}function zm(n,r){1&n&&(e.TgZ(0,"th",24),e._uU(1,"Cost"),e.qZA())}function Wm(n,r){if(1&n&&(e.TgZ(0,"td",30),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.VariantUnitCost))}}function $m(n,r){if(1&n&&(e.TgZ(0,"td",30),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.UnitCost))}}const Xm=function(){return["/menu/Products/Catalog/Variants/Info"]},it=function(n){return{ID:n}},eg=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]};function tg(n,r){if(1&n&&(e.TgZ(0,"tr",27)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"a",28),e._uU(5),e.qZA()(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td")(9,"a",28),e._uU(10),e.qZA()(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.YNc(14,Wm,3,3,"td",29),e.YNc(15,$m,3,3,"td",29),e.TgZ(16,"td",30),e._uU(17),e.ALo(18,"number"),e.qZA(),e.TgZ(19,"td",30),e._uU(20),e.ALo(21,"number"),e.qZA(),e.TgZ(22,"td"),e._UZ(23,"i",31),e.qZA()()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.EntityName),e.xp6(2),e.Q6J("routerLink",e.DdM(21,Xm))("queryParams",e.VKq(22,it,t.VariantID)),e.xp6(1),e.Oqu(t.VariantName),e.xp6(2),e.Oqu(t.VariantCode),e.xp6(2),e.Q6J("routerLink",e.DdM(24,eg))("queryParams",e.VKq(25,it,t.InvoiceID)),e.xp6(1),e.Oqu(t.Number),e.xp6(2),e.Oqu(e.xi3(13,14,t.Created,"dd MMM yyyy")),e.xp6(2),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(2),e.Oqu(e.lcZ(18,17,t.VariantUnitPrice)),e.xp6(3),e.Oqu(e.lcZ(21,19,t.UnitPrice)),e.xp6(3),e.Q6J("innerHtml",t.Note,e.oJD)}}function ng(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",16)(1,"table",17)(2,"thead",18)(3,"tr")(4,"th",19),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"th",20),e._uU(7,"Variant"),e.qZA(),e.TgZ(8,"th",21),e._uU(9,"Code"),e.qZA(),e.TgZ(10,"th",22),e._uU(11,"Number"),e.qZA(),e.TgZ(12,"th",22),e._uU(13,"Date"),e.qZA(),e.YNc(14,jm,2,0,"th",23),e.YNc(15,zm,2,0,"th",23),e.TgZ(16,"th",24),e._uU(17,"Original Price"),e.qZA(),e.TgZ(18,"th",24),e._uU(19,"Price"),e.qZA(),e.TgZ(20,"th"),e._uU(21,"Note"),e.qZA()()(),e.TgZ(22,"tbody"),e.YNc(23,tg,24,27,"tr",25),e.qZA()(),e.ynx(24),e.TgZ(25,"mat-paginator",26),e.NdJ("page",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onPaginationChange(o))}),e.qZA(),e.BQk(),e.qZA()}if(2&n){const t=e.oxw();e.xp6(14),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(8),e.Q6J("ngForOf",t.data.Data),e.xp6(2),e.Q6J("length",t.data.listTotal)("pageSize",t.pagination.pageSize)("pageIndex",0==t.pageData.Filter.PageNumber?0:t.pageData.Filter.PageNumber-1)}}const ag=function(){return["/menu/Reports/Sales_Report/Standard/Discounted_Sales"]};let ig=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/GetNonStandardPrice","ReportLoader/NonStandardPrice"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"PriceType",[{Key:0,Value:"All"},{Key:1,Value:"Edited"}]),(0,l.Z)(this,"sourcedata",[]),this.httpService=t,this.csvConverter=a,this.reportFilterService=o,this.roleService=i}postInit(){this.sourcedata=this.data.Data,this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}getFilterData(t){this.data.Data=this.sourcedata.filter(a=>Object.keys(a).some(o=>null!=a[o]&&a[o].toString().toLowerCase().includes(t.toLowerCase())))}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(N.z),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-non-standard-price"]],features:[e.qOj],decls:10,vars:7,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary me-6",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["name","PriceType",3,"model","options","modelChange"],["type","text",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","90px"],[2,"width","150px"],[2,"width","75px"],[2,"width","100px"],["class","text-end","style","width: 100px",4,"ngIf"],[1,"text-end",2,"width","100px"],["class","border-bottom",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[1,"border-bottom"],["target","_blank",3,"routerLink","queryParams"],["class","text-end",4,"ngIf"],[1,"text-end"],[2,"word-break","break-all",3,"innerHtml"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.Number=i})("textChange",function(i){return a.getFilterData(i)})("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,Bm,3,0,"a",1),e.TgZ(3,"a",2),e._uU(4,"Discounted Sales"),e.qZA()(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,Km,24,9,"div",4),e.qZA()(),e.TgZ(8,"content"),e.YNc(9,ng,26,6,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.Number),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(6,ag)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.Fj,d.JJ,d.On,x.gM,W.NW,q.P,E.J,p.JJ,p.uU]})),n})();function rg(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",28),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.openExportModal())}),e._UZ(1,"i",29),e._uU(2," Export"),e.qZA()}}function lg(n,r){if(1&n&&(e.TgZ(0,"th",30),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" UnitPrice(",t.data.Symbol,")")}}function sg(n,r){if(1&n&&(e.TgZ(0,"th",31),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" Total(",t.data.Symbol,")")}}function pg(n,r){1&n&&(e.TgZ(0,"span"),e._uU(1," /"),e.qZA())}const rt=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},lt=function(n){return{ID:n}};function cg(n,r){if(1&n&&(e.TgZ(0,"a",34)(1,"span",44),e._uU(2),e.qZA()()),2&n){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,rt))("queryParams",e.VKq(4,lt,t.Data.ID)),e.xp6(2),e.Oqu("#"+t.PONumber)}}function dg(n,r){if(1&n&&(e.TgZ(0,"th",53),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,null==t?null:t.UnitPrice))}}function ug(n,r){if(1&n&&(e.TgZ(0,"th",54),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,null==t?null:t.Total)," ")}}function _g(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"th",45),e._uU(2),e.qZA(),e.TgZ(3,"th",46),e._uU(4),e.qZA(),e.TgZ(5,"th",47),e._uU(6),e.ALo(7,"number"),e.qZA(),e.TgZ(8,"th",48),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"th",49),e._uU(12),e.qZA(),e.YNc(13,dg,3,3,"th",50),e.TgZ(14,"th",51),e._uU(15),e.qZA(),e.YNc(16,ug,3,3,"th",52),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(3);e.xp6(2),e.hij(" ",null==t?null:t.Name," "),e.xp6(2),e.hij(" ",null==t?null:t.Code,""),e.xp6(2),e.hij(" ",e.lcZ(7,8,null==t?null:t.QtyRequested)," "),e.xp6(3),e.hij(" ",e.lcZ(10,10,null==t?null:t.Quantity)," "),e.xp6(3),e.hij(" ",null==t?null:t.UOMName,""),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(2),e.hij(" ",0==(null==t?null:t.Discount)?"-":(null==t?null:t.Discount)+"%"," "),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost)}}function mg(n,r){if(1&n&&(e.ynx(0),e.TgZ(1,"tr")(2,"th",61),e._uU(3),e.qZA(),e.TgZ(4,"th",62),e._uU(5),e.qZA(),e.TgZ(6,"th",63),e._uU(7),e.ALo(8,"number"),e.qZA()(),e.BQk()),2&n){const t=r.$implicit;e.xp6(3),e.hij("",t.Label," :"),e.xp6(2),e.hij(" ",null==t?null:t.CurrencySymbol," "),e.xp6(2),e.hij(" ",e.lcZ(8,3,null==t?null:t.Amount)," ")}}function gg(n,r){if(1&n&&(e.TgZ(0,"tfoot",55)(1,"tr",56)(2,"td",57),e._uU(3,"Total"),e.qZA(),e.TgZ(4,"td",58)(5,"b"),e._uU(6),e.ALo(7,"number"),e.ALo(8,"sum"),e.qZA()(),e._UZ(9,"td",59),e.TgZ(10,"td",60)(11,"table",55),e.YNc(12,mg,9,5,"ng-container",26),e.qZA()()()()),2&n){const t=e.oxw().$implicit;e.xp6(6),e.Oqu(e.lcZ(7,2,e.xi3(8,4,t.Items,"Quantity"))),e.xp6(6),e.Q6J("ngForOf",null==t?null:t.Aggregate)}}function hg(n,r){if(1&n&&(e.TgZ(0,"div")(1,"div",32)(2,"div",33)(3,"a",34)(4,"span",35),e._uU(5),e.qZA()(),e.YNc(6,pg,2,0,"span",36),e.YNc(7,cg,3,6,"a",37),e.TgZ(8,"span"),e._uU(9),e.ALo(10,"date"),e.qZA(),e._UZ(11,"span",19),e.TgZ(12,"strong",38),e._uU(13),e.ALo(14,"sum"),e.ALo(15,"number"),e.ALo(16,"sum"),e.qZA()(),e.TgZ(17,"div",39)(18,"label",40),e._uU(19),e.qZA()()(),e.TgZ(20,"table",41),e._UZ(21,"thead"),e.TgZ(22,"tbody",42),e.YNc(23,_g,17,12,"tr",26),e.qZA(),e.YNc(24,gg,13,7,"tfoot",43),e.qZA()()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(3),e.Q6J("routerLink",e.DdM(21,rt))("queryParams",e.VKq(22,lt,t.Data.ID)),e.xp6(2),e.Oqu(t.Data.EntityName+" #"+t.Data.Number),e.xp6(1),e.Q6J("ngIf",a.pageData.DualReceiptNumber),e.xp6(1),e.Q6J("ngIf",a.pageData.DualReceiptNumber),e.xp6(2),e.Oqu(" - "+e.xi3(10,10,t.Data.Date,"dd MMM yyyy")+(null==t.Data.Name?"":" : "+t.Data.Name)),e.xp6(4),e.hij(" ","[Q: "+e.xi3(14,13,t.Items,"Quantity")+", T: "+e.lcZ(15,16,e.xi3(16,18,t.Items,"Total"))+"]"," "),e.xp6(6),e.Oqu(t.Data.PaymentStateLabel),e.xp6(4),e.Q6J("ngForOf",t.Items),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost)}}function fg(n,r){if(1&n&&(e.TgZ(0,"div",64)(1,"div",65)(2,"div")(3,"strong"),e._uU(4,"Tax Added"),e.qZA(),e.TgZ(5,"span",61),e._uU(6),e.ALo(7,"number"),e.qZA()(),e.TgZ(8,"div")(9,"strong"),e._uU(10,"Purchases with Tax"),e.qZA(),e.TgZ(11,"span",61),e._uU(12),e.ALo(13,"number"),e.qZA()()(),e.TgZ(14,"div",65)(15,"div")(16,"strong"),e._uU(17,"Orders"),e.qZA(),e.TgZ(18,"span",61),e._uU(19),e.ALo(20,"number"),e.qZA()(),e.TgZ(21,"div")(22,"strong"),e._uU(23,"Qty"),e.qZA(),e.TgZ(24,"span",61),e._uU(25),e.ALo(26,"number"),e.qZA()()(),e.TgZ(27,"div",65)(28,"div")(29,"strong"),e._uU(30,"Gross Purchase"),e.qZA(),e.TgZ(31,"span",61),e._uU(32),e.ALo(33,"number"),e.qZA()(),e.TgZ(34,"div")(35,"strong"),e._uU(36,"Discount"),e.qZA(),e.TgZ(37,"span",61),e._uU(38),e.ALo(39,"number"),e.qZA()(),e.TgZ(40,"div")(41,"strong"),e._uU(42,"Tax Incl."),e.qZA(),e.TgZ(43,"span",61),e._uU(44),e.ALo(45,"number"),e.qZA()(),e.TgZ(46,"div")(47,"strong"),e._uU(48,"Net Purchase"),e.qZA(),e.TgZ(49,"span",61),e._uU(50),e.ALo(51,"number"),e.qZA()()()()),2&n){const t=e.oxw(2);e.xp6(6),e.Oqu(e.xi3(7,8,t.data.Aggregate.TaxAdd,".0-0")),e.xp6(6),e.Oqu(e.xi3(13,11,t.data.Aggregate.PurchaseWithTax,".0-0")),e.xp6(7),e.Oqu(e.xi3(20,14,t.data.Aggregate.TotalTransaction,".0-0")),e.xp6(6),e.Oqu(e.xi3(26,17,t.data.Aggregate.UnitQuantity,".0-0")),e.xp6(7),e.Oqu(e.xi3(33,20,t.data.Aggregate.Gross,".0-0")),e.xp6(6),e.Oqu(e.xi3(39,23,t.data.Aggregate.Discount,".0-0")),e.xp6(6),e.Oqu(e.xi3(45,26,t.data.Aggregate.TaxInclude,".0-0")),e.xp6(6),e.Oqu(e.xi3(51,29,t.data.Aggregate.NetPurchase,".0-0"))}}function xg(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e.TgZ(1,"actions"),e.YNc(2,rg,3,0,"button",2),e.qZA(),e.TgZ(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"h6"),e._uU(8,"Outlet"),e.qZA(),e.TgZ(9,"ng-select",5),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Category"),e.qZA(),e.TgZ(13,"ng-select",6),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"Supplier"),e.qZA(),e.TgZ(17,"autocompleteV2",7),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SupplierID=o)}),e.qZA()(),e.TgZ(18,"div")(19,"h6"),e._uU(20,"From - To"),e.qZA(),e.TgZ(21,"div")(22,"datepicker",8),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(23,"div",9)(24,"datepicker",10),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()(),e.TgZ(25,"div")(26,"h6"),e._uU(27,"Currency"),e.qZA(),e.TgZ(28,"ng-select",11),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CurrencyID=o)}),e.qZA()(),e.TgZ(29,"div")(30,"h6"),e._uU(31,"Sort"),e.qZA(),e.TgZ(32,"radio-options",12),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.IsDesc=o)}),e.qZA()()()()(),e.TgZ(33,"content")(34,"div",13)(35,"table",14)(36,"thead",15)(37,"tr")(38,"th",16),e._uU(39,"Name"),e.qZA(),e.TgZ(40,"th",17),e._uU(41,"Code"),e.qZA(),e.TgZ(42,"th",18)(43,"span",19),e._uU(44,"Requested"),e.qZA(),e._uU(45," qty "),e.qZA(),e.TgZ(46,"th",20),e._uU(47,"Qty"),e.qZA(),e.TgZ(48,"th",21),e._uU(49,"UOM"),e.qZA(),e.YNc(50,lg,2,1,"th",22),e.TgZ(51,"th",23),e._uU(52,"%"),e.qZA(),e.YNc(53,sg,2,1,"th",24),e.qZA()(),e.TgZ(54,"tbody")(55,"tr")(56,"td",25),e.YNc(57,hg,25,24,"div",26),e.qZA()()()(),e.YNc(58,fg,52,32,"div",27),e.qZA()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",t.roleService.global.Export),e.xp6(7),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.SupplierID),e.xp6(5),e.Q6J("isFloatingLabel",!1)("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("isFloatingLabel",!1)("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CurrencyID)("items",t.pageData.Options.Currencies),e.xp6(4),e.Q6J("model",t.pageData.Filter.IsDesc)("options",t.AscDscRadio),e.xp6(18),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(3),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(3),e.uIk("colspan",t.roleService.product.Cost?8:6),e.xp6(1),e.Q6J("ngForOf",t.data.Data),e.xp6(1),e.Q6J("ngIf",t.data.Data.length>0)}}let Tg=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/GetPurchaseTransactionDetail","ReportLoader/GetPurchaseTransactionDetail"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"datePipe",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"AscDscRadio",[{Key:!1,Value:"Asc"},{Key:!0,Value:"Desc"}]),this.httpService=t,this.csvConverter=a,this.datePipe=o,this.roleService=i,this.matDialog=s}openExportModal(){this.matDialog.open(M.H,{data:{title:"Product Transaction Detail",exportTypes:[{ID:"ReportExport/ReportPurchaseDetail",Value:"Default",FileName:"Product Transaction Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){null===this.pageData.Filter.EntityID&&(this.pageData.Filter.EntityID=C.gT.GuidEmpty),this.menuData.H=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")?`Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d")}`:`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+=" ]"}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(p.uU),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-purchase-detail"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["placeholder","From","appearance","outline","name","From",3,"isFloatingLabel","date","dateChange"],[1,"mt-4"],["placeholder","To","appearance","outline","name","To",3,"isFloatingLabel","date","dateChange"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["name","AscDesc",3,"model","options","modelChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","355px"],[2,"width","50px"],[1,"text-end",2,"width","55px"],[1,"d-block"],[1,"text-end",2,"width","33px"],[1,"fst-italic","small",2,"width","40px"],["class","text-end","style","width: 80px",4,"ngIf"],[1,"red",2,"width","30px"],["class","text-end","style","width: 150px",4,"ngIf"],[1,"px-0","border-bottom-0"],[4,"ngFor","ngForOf"],["class","row justify-content-end",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","150px"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","mt-2","mb-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-3"],[4,"ngIf"],["class","h5 text-primary fw-bold",3,"routerLink","queryParams",4,"ngIf"],[1,"text-danger","ms-3"],[1,"d-lg-block","mt-2","me-5","fw-bold","fst-italic"],["runat","server",1,"status"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],["class","table table-sm table-borderless",4,"ngIf"],["id","PONumber"],[1,"fw-normal","border-start","border-end",2,"width","325px"],[1,"fw-normal","border-start","border-end",2,"width","50px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","65px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","30px"],[1,"fst-italic","border-start","border-end","small",2,"width","40px"],["class","fw-normal border-start border-end text-end","style","width: 80px",4,"ngIf"],[1,"fw-normal","border-start","border-end","text-end","text-danger",2,"width","30px"],["class","fw-normal border-start border-end text-end","style","width: 140px",4,"ngIf"],[1,"fw-normal","border-start","border-end","text-end",2,"width","80px"],[1,"fw-normal","border-start","border-end","text-end",2,"width","140px"],[1,"table","table-sm","table-borderless"],[1,"grid_footer"],["colspan","2",1,"text-end","fw-bold"],["colspan","2",1,"text-end"],["colspan","3"],[1,"text-end","d-flex","justify-content-end","fw-bold"],[1,"text-end"],[1,"p-0","fw-normal","text-end",2,"width","1%"],[1,"fw-normal","text-end",2,"width","5%"],[1,"row","justify-content-end"],[1,"zebra","col-auto"]],template:function(t,a){1&t&&e.YNc(0,xg,59,21,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,q.P,E.J,S.qU,p.JJ,p.uU]})),n})();function Cg(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",33),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.openExportModal())}),e._UZ(1,"i",34),e._uU(2," Export"),e.qZA()}}function Zg(n,r){1&n&&e._UZ(0,"br")}const st=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},pt=function(n){return{ID:n}};function Dg(n,r){if(1&n&&(e.TgZ(0,"a",35),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,st))("queryParams",e.VKq(4,pt,t.PurchaseOrderID)),e.xp6(1),e.Oqu(t.PONumber)}}function vg(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"a",35),e._uU(5),e.qZA(),e.YNc(6,Zg,1,0,"br",36),e.YNc(7,Dg,2,6,"a",37),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"date"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.qZA(),e.TgZ(13,"td",29),e._uU(14),e.ALo(15,"number"),e.qZA(),e.TgZ(16,"td",29),e._uU(17),e.ALo(18,"number"),e.qZA(),e.TgZ(19,"td",29),e._uU(20),e.ALo(21,"number"),e.qZA(),e.TgZ(22,"td",29),e._uU(23),e.ALo(24,"number"),e.qZA(),e.TgZ(25,"td",29),e._uU(26),e.ALo(27,"number"),e.qZA(),e.TgZ(28,"td"),e._uU(29),e.qZA()()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.EntityName),e.xp6(2),e.Q6J("routerLink",e.DdM(27,st))("queryParams",e.VKq(28,pt,t.ID)),e.xp6(1),e.Oqu(t.Number),e.xp6(1),e.Q6J("ngIf",a.pageData.DualNumber),e.xp6(1),e.Q6J("ngIf",a.pageData.DualNumber),e.xp6(2),e.Oqu(e.xi3(10,14,t.Date,"dd MMM yyyy")),e.xp6(3),e.Oqu(t.SupplierNameDisplay),e.xp6(2),e.Oqu(e.lcZ(15,17,t.TotalItemQuantity)),e.xp6(3),e.Oqu(e.lcZ(18,19,t.Sales)),e.xp6(3),e.Oqu(e.lcZ(21,21,t.Tax)),e.xp6(3),e.Oqu(e.lcZ(24,23,t.TotalAmount)),e.xp6(3),e.Oqu(e.lcZ(27,25,t.PaymentAmount)),e.xp6(3),e.Oqu(t.PaymentStateLabel)}}function bg(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("textChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Number=o)})("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e.TgZ(1,"actions"),e.YNc(2,Cg,3,0,"button",2),e.qZA(),e.TgZ(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"h6"),e._uU(8,"Outlet"),e.qZA(),e.TgZ(9,"ng-select",5),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"From - To"),e.qZA(),e.TgZ(13,"div")(14,"datepicker",6),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(15,"div",7)(16,"datepicker",8),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()(),e.TgZ(17,"div")(18,"h6"),e._uU(19,"Payment"),e.qZA(),e.TgZ(20,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.StateID=o)}),e.qZA()(),e.TgZ(21,"div")(22,"h6"),e._uU(23,"Supplier"),e.qZA(),e.TgZ(24,"autocompleteV2",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SupplierID=o)}),e.qZA()()()()(),e.TgZ(25,"content")(26,"div",11)(27,"div",12)(28,"table",13),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(29,"thead",14)(30,"tr")(31,"th",15),e._uU(32,"Outlet"),e.qZA(),e.TgZ(33,"th",16),e._uU(34,"Number"),e.qZA(),e.TgZ(35,"th",17),e._uU(36,"Date"),e.qZA(),e.TgZ(37,"th",18),e._uU(38,"Supplier "),e.qZA(),e.TgZ(39,"th",19),e._uU(40,"Qty"),e.qZA(),e.TgZ(41,"th",20),e._uU(42," Purchase"),e.qZA(),e.TgZ(43,"th",21),e._uU(44,"Tax "),e.qZA(),e.TgZ(45,"th",22),e._uU(46," Total Amount "),e.qZA(),e.TgZ(47,"th",23),e._uU(48,"Payment"),e.qZA(),e.TgZ(49,"th",24),e._uU(50,"State"),e.qZA()()(),e.TgZ(51,"tbody"),e.YNc(52,vg,30,30,"tr",25),e.qZA(),e.TgZ(53,"tfoot")(54,"tr",26),e._UZ(55,"td",27),e.TgZ(56,"td",28),e._uU(57,"Total:"),e.qZA(),e.TgZ(58,"td",29),e._uU(59),e.ALo(60,"number"),e.ALo(61,"sum"),e.qZA(),e.TgZ(62,"td",29),e._uU(63),e.ALo(64,"number"),e.ALo(65,"sum"),e.qZA(),e.TgZ(66,"td",29),e._uU(67),e.ALo(68,"number"),e.ALo(69,"sum"),e.qZA(),e.TgZ(70,"td",30),e._uU(71),e.ALo(72,"number"),e.ALo(73,"sum"),e.qZA(),e.TgZ(74,"td",31),e._uU(75),e.ALo(76,"number"),e.ALo(77,"sum"),e.qZA(),e._UZ(78,"td",32),e.qZA()()()()()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("text",t.pageData.Filter.Number),e.xp6(2),e.Q6J("ngIf",t.roleService.global.Export),e.xp6(7),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.StateID)("items",null==t.pageData.Options?null:t.pageData.Options.States),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.SupplierID)("inputTextValue",t.contactDisplay),e.xp6(28),e.Q6J("ngForOf",t.data.Data),e.xp6(7),e.hij(" ",e.lcZ(60,17,e.xi3(61,19,t.data.Data,"TotalItemQuantity")),""),e.xp6(4),e.hij("",e.lcZ(64,22,e.xi3(65,24,t.data.Data,"Sales"))," "),e.xp6(4),e.hij("",e.lcZ(68,27,e.xi3(69,29,t.data.Data,"Tax"))," "),e.xp6(4),e.hij(" ",e.lcZ(72,32,e.xi3(73,34,t.data.Data,"TotalAmount")),""),e.xp6(4),e.hij(" ",e.lcZ(76,37,e.xi3(77,39,t.data.Data,"PaymentAmount")),"")}}let yg=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/ReportPurchaseSummary","ReportLoader/GetReportPurchaseSummary",null,o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"url",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"contactDisplay",void 0),this.httpService=t,this.csvConverter=a,this.url=o,this.roleService=i,this.matDialog=s}openExportModal(){this.matDialog.open(M.H,{data:{title:"Purchase Report Summary",exportTypes:[{ID:"ReportExport/ReportPurchaseSummary",Value:"Default",FileName:"Purchase Report Summary"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(t){this.menuData.H=t.PageTitle}preInitList(){C.gT.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null),C.gT.IsNotEmpty(this.pageData.Filter.SupplierID)&&(this.pageData.Filter.From=C.gT.MinDate),C.gT.IsNotEmpty(this.pageData.SupplierName)&&(this.contactDisplay=this.pageData.SupplierName)}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(o.EntityName=null==o.EntityName?"":o.EntityName,i.EntityName=null==i.EntityName?"":i.EntityName,o.SupplierNameDisplay=null==o.SupplierNameDisplay?"":o.SupplierNameDisplay,i.SupplierNameDisplay=null==i.SupplierNameDisplay?"":i.SupplierNameDisplay,t.active){case"EntityName":return this.compare(o.EntityName.toLocaleLowerCase(),i.EntityName.toLocaleLowerCase(),s);case"Number":return this.compare(o.Number,i.Number,s);case"Date":return this.compare(o.Date,i.Date,s);case"SupplierNameDisplay":return this.compare(o.SupplierNameDisplay.toLocaleLowerCase(),i.SupplierNameDisplay.toLocaleLowerCase(),s);case"TotalItemQuantity":return this.compare(o.TotalItemQuantity,i.TotalItemQuantity,s);case"Total":return this.compare(o.TotalAmount,i.TotalAmount,s);case"Sales":return this.compare(o.Sales,i.Sales,s);case"Tax":return this.compare(o.Tax,i.Tax,s);case"PaymentAmount":return this.compare(o.PaymentAmount,i.PaymentAmount,s);case"PaymentState":return this.compare(o.PaymentStateLabel,i.PaymentStateLabel,s);default:return 0}}):a}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(h.gz),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-purchase-detail-summary"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","text","textChange","onSubmit",4,"ngIf"],[3,"pageData","text","textChange","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100",3,"ngModel","inputTextValue","ngModelChange"],[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",2,"width","118px"],["mat-sort-header","PaymentAmount","arrowPosition","before",1,"flex-right",2,"width","118px"],["mat-sort-header","PaymentState",2,"width","70px"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end","empty-column"],[1,"text-end"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"empty-column"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[3,"routerLink","queryParams"],[4,"ngIf"],[3,"routerLink","queryParams",4,"ngIf"]],template:function(t,a){1&t&&e.YNc(0,bg,79,42,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,f.YE,f.nU,E.J,S.qU,p.JJ,p.uU]})),n})();function Sg(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",25),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.openExportModal())}),e._UZ(1,"i",26),e._uU(2," Export"),e.qZA()}}const Ag=function(){return["/menu/Contacts/Contact/Suppliers/Info"]},wg=function(n){return{ID:n}},Fg=function(n,r,t){return{SupplierID:n,From:r,To:t}},Mg=function(){return["/menu/Reports/Purchases_Report/Summary"]};function qg(n,r){if(1&n&&(e.TgZ(0,"tr",27)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td",28)(4,"a",29),e._uU(5),e.qZA()(),e.TgZ(6,"td",23),e._uU(7),e.qZA(),e.TgZ(8,"td",30),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td",23)(12,"a",31),e.ALo(13,"date"),e.ALo(14,"date"),e._uU(15),e.ALo(16,"number"),e.qZA()()()),2&n){const t=r.$implicit,a=r.index,o=e.oxw(2);e.xp6(2),e.Oqu(a+1),e.xp6(2),e.Q6J("routerLink",e.DdM(19,Ag))("queryParams",e.VKq(20,wg,t.SupplierID)),e.xp6(1),e.Oqu(t.Name),e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(10,9,t.Quantity)),e.xp6(3),e.Q6J("queryParams",e.kEZ(22,Fg,t.SupplierID,e.xi3(13,11,o.pageData.Filter.From,"ddMMyyyy"),e.xi3(14,14,o.pageData.Filter.To,"ddMMyyyy")))("routerLink",e.DdM(26,Mg)),e.xp6(3),e.Oqu(e.lcZ(16,17,t.Total))}}function Ig(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e.TgZ(1,"actions"),e.YNc(2,Sg,3,0,"button",2),e.qZA(),e.TgZ(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"h6"),e._uU(8,"Outlet"),e.qZA(),e.TgZ(9,"ng-select",5),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)}),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Group"),e.qZA(),e.TgZ(13,"ng-select",6),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.GroupID=o)}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"From - To"),e.qZA(),e.TgZ(17,"div")(18,"datepicker",7),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(19,"div",8)(20,"datepicker",9),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()(),e.TgZ(21,"div")(22,"h6"),e._uU(23,"Row Count"),e.qZA(),e.TgZ(24,"input",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.RowCount=o)}),e.qZA()()()()(),e.TgZ(25,"content")(26,"div",11)(27,"div",12)(28,"table",13),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(29,"thead",14)(30,"tr")(31,"th",15),e._uU(32,"Rank"),e.qZA(),e.TgZ(33,"th",16),e._uU(34,"Supplier"),e.qZA(),e.TgZ(35,"th",17),e._uU(36," Code"),e.qZA(),e.TgZ(37,"th",18),e._uU(38,"Quantity"),e.qZA(),e.TgZ(39,"th",19),e._uU(40," Total"),e.qZA()()(),e.TgZ(41,"tbody"),e.YNc(42,qg,17,27,"tr",20),e.qZA(),e.TgZ(43,"tfoot")(44,"tr",21),e._UZ(45,"th",22),e.TgZ(46,"th",23),e._uU(47,"Total Quantity"),e.qZA(),e.TgZ(48,"th",23),e._uU(49,"Total Purchase"),e.qZA()(),e.TgZ(50,"tr"),e._UZ(51,"td",24),e.TgZ(52,"td",23),e._uU(53),e.qZA(),e.TgZ(54,"td",23),e._uU(55),e.qZA()()()()()()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",t.roleService.global.Export),e.xp6(7),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.GroupID)("items",null==t.pageData.Options?null:t.pageData.Options.Group),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.RowCount),e.xp6(18),e.Q6J("ngForOf",t.data.Data),e.xp6(11),e.Oqu(t.data.TotalQty),e.xp6(2),e.Oqu(t.data.TotalSales)}}let Pg=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/TopSupplier","ReportLoader/TopSupplierLoader"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i}openExportModal(){this.matDialog.open(M.H,{data:{title:"Top Supplier",exportTypes:[{ID:"ReportExport/TopPurchaseExport",Value:"Default",FileName:"Top Supplier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"Name":return this.compare(o.Name,i.Name,s);case"Code":return this.compare(o.Code,i.Code,s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);case"Total":return this.compare(o.Total,i.Total,s);default:return 0}}):a}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-top-supplier"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a Group",3,"ngModel","items","ngModelChange"],["name","From","appearance","outline",3,"date","dateChange"],[1,"mt-4"],["name","To","appearance","outline",3,"date","dateChange"],["type","text","autoNum","",3,"ngModel","ngModelChange"],[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"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"thead-light"],["colspan","3",1,"bg-white","border-bottom-0"],[1,"text-end"],["colspan","3",1,"bg-white","border-top-0"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"border-bottom"],[1,"text-start"],[3,"routerLink","queryParams"],[1,"text-end","text-success"],[3,"queryParams","routerLink"]],template:function(t,a){1&t&&e.YNc(0,Ig,56,14,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.Fj,d.JJ,d.On,f.YE,f.nU,U.b,p.JJ,p.uU]})),n})();function Og(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",23),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.openExportModal())}),e._UZ(1,"i",24),e._uU(2," Export"),e.qZA()}}const Ng=function(n){return[n]},Jg=function(n){return{ID:n}};function Lg(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td")(2,"a",25),e._uU(3),e.qZA()(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td",22),e._uU(7),e.ALo(8,"number"),e.qZA(),e.TgZ(9,"td",22),e._uU(10),e.ALo(11,"number"),e.qZA(),e.TgZ(12,"td",22),e._uU(13),e.ALo(14,"number"),e.qZA(),e.TgZ(15,"td",22),e._uU(16),e.ALo(17,"number"),e.qZA()()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Q6J("routerLink",e.VKq(16,Ng,a.pageData.Filter.GroupByProduct?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",e.VKq(18,Jg,t.ID)),e.xp6(1),e.Oqu(t.Name),e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(8,8,t.Order)),e.xp6(3),e.Oqu(e.lcZ(11,10,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(14,12,t.Total)),e.xp6(3),e.Oqu(e.lcZ(17,14,t.AvgPrice))}}function Ug(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("textChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Text=o)})("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e.TgZ(1,"actions"),e.YNc(2,Og,3,0,"button",2),e.qZA(),e.TgZ(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"h6"),e._uU(8,"Category"),e.qZA(),e.TgZ(9,"ng-select",5),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Currency"),e.qZA(),e.TgZ(13,"ng-select",6),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CurrencyID=o)}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"From - To"),e.qZA(),e.TgZ(17,"div")(18,"datepicker",7),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(19,"div",8)(20,"datepicker",9),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()(),e.TgZ(21,"div")(22,"h6"),e._uU(23,"Group By"),e.qZA(),e.TgZ(24,"radio-options",10),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.GroupByProduct=o)}),e.qZA()(),e.TgZ(25,"div")(26,"h6"),e._uU(27,"Brand"),e.qZA(),e.TgZ(28,"autocompleteV2",11),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.BrandID=o)}),e.qZA()()()()(),e.TgZ(29,"content")(30,"div",12)(31,"div",13)(32,"table",14)(33,"thead",15)(34,"tr")(35,"th"),e._uU(36,"Name"),e.qZA(),e.TgZ(37,"th",16),e._uU(38,"Code"),e.qZA(),e.TgZ(39,"th",17),e._uU(40,"Order"),e.qZA(),e.TgZ(41,"th",17),e._uU(42,"Quantity"),e.qZA(),e.TgZ(43,"th",18),e._uU(44,"Amount"),e.qZA(),e.TgZ(45,"th",17),e._uU(46,"Avg Price"),e.qZA()()(),e.TgZ(47,"tbody"),e.YNc(48,Lg,18,20,"tr",19),e.qZA(),e.TgZ(49,"tfoot")(50,"tr",20),e._UZ(51,"td",21),e.TgZ(52,"td"),e._uU(53,"Total :"),e.qZA(),e.TgZ(54,"td",22),e._uU(55),e.ALo(56,"number"),e.ALo(57,"sum"),e.qZA(),e.TgZ(58,"td",22),e._uU(59),e.ALo(60,"number"),e.ALo(61,"sum"),e.qZA(),e.TgZ(62,"td",22),e._uU(63),e.ALo(64,"number"),e.ALo(65,"sum"),e.qZA(),e.TgZ(66,"td",22),e._uU(67),e.ALo(68,"number"),e.ALo(69,"sum"),e.qZA()()()()()()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("text",t.pageData.Filter.Text),e.xp6(2),e.Q6J("ngIf",t.roleService.global.Export),e.xp6(7),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CurrencyID)("items",null==t.pageData.Options?null:t.pageData.Options.Currencies),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("model",t.pageData.Filter.GroupByProduct)("options",t.GroupByRadio),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.BrandID),e.xp6(20),e.Q6J("ngForOf",t.data.Data),e.xp6(7),e.hij(" ",e.lcZ(56,17,e.xi3(57,19,t.data.Data,"Order"))," "),e.xp6(4),e.hij(" ",e.lcZ(60,22,e.xi3(61,24,t.data.Data,"Quantity"))," "),e.xp6(4),e.hij(" ",e.lcZ(64,27,e.xi3(65,29,t.data.Data,"Total"))," "),e.xp6(4),e.hij(" ",e.lcZ(68,32,e.xi3(69,34,t.data.Data,"AvgPrice"))," ")}}let Qg=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/PurchasesByProductList","ReportLoader/PurchasesByProductLoader"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"GroupByRadio",[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}]),(0,l.Z)(this,"text",void 0),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i}openExportModal(){this.matDialog.open(M.H,{data:{title:"Product Bought Report",exportTypes:[{ID:"ReportExport/PurchasesByProductExport",Value:"Default",FileName:"Product Bought Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-product-bought"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","text","textChange","onSubmit",4,"ngIf"],[3,"pageData","text","textChange","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["name","GroupBy",3,"model","options","modelChange"],["inputID","Key","requestUrl","/API/AC/GetProductBrandSuggestion",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","100px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","140px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-end"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[3,"routerLink","queryParams"]],template:function(t,a){1&t&&e.YNc(0,Ug,70,37,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,q.P,E.J,S.qU,p.JJ]})),n})();function kg(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",8),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",9),e._uU(2," Export"),e.qZA()}}function Eg(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Product"),e.qZA(),e.TgZ(3,"autocompleteV2",18),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ProductID=o)}),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(3),e.Q6J("ngModel",t.pageData.Filter.ProductID)("inputTextValue",t.pageData.ProductName)}}function Yg(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Variant"),e.qZA(),e.TgZ(3,"autocompleteV2",19),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.VariantID=o)}),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(3),e.Q6J("ngModel",t.pageData.Filter.VariantID)("inputTextValue",t.pageData.VariantName)}}function Rg(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",10)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",11),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Supplier"),e.qZA(),e.TgZ(8,"autocompleteV2",12),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SupplierID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Scope"),e.qZA(),e.TgZ(12,"radio-options",13),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ByProduct=o)})("modelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.getListData())}),e.qZA()(),e.YNc(13,Eg,4,2,"div",14),e.YNc(14,Yg,4,2,"div",14),e.TgZ(15,"div")(16,"h6"),e._uU(17,"From - To"),e.qZA(),e.TgZ(18,"div")(19,"datepicker",15),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(20,"div",16)(21,"datepicker",17),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.SupplierID),e.xp6(4),e.Q6J("model",t.pageData.Filter.ByProduct)("options",t.ScopeRadio),e.xp6(1),e.Q6J("ngIf",t.pageData.Filter.ByProduct),e.xp6(1),e.Q6J("ngIf",!t.pageData.Filter.ByProduct),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function Gg(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",20)(1,"div")(2,"h6"),e._uU(3,"Order By"),e.qZA(),e.TgZ(4,"radio-options",21),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.OrderByNumber=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Currency"),e.qZA(),e.TgZ(8,"ng-select",22),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CurrencyID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Brand"),e.qZA(),e.TgZ(12,"autocompleteV2",23),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.BrandID=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("model",t.pageData.Filter.OrderByNumber)("options",t.OrderByRadio),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CurrencyID)("items",null==t.pageData.Options?null:t.pageData.Options.Currencies),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.BrandID)}}function Hg(n,r){1&n&&(e.TgZ(0,"th"),e._uU(1,"Product"),e.qZA())}function Vg(n,r){1&n&&(e.TgZ(0,"th"),e._uU(1,"Variant"),e.qZA())}function Bg(n,r){1&n&&(e.TgZ(0,"th",41),e._uU(1," Measurement"),e.qZA())}function Kg(n,r){1&n&&(e.TgZ(0,"th",42),e._uU(1,"Cost"),e.qZA())}function jg(n,r){if(1&n&&(e.TgZ(0,"th",43),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" Total(",t.data.CurrencySymbol,")")}}function zg(n,r){if(1&n&&(e.TgZ(0,"td",38),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.VariantUnitQuantity),"")}}function Wg(n,r){if(1&n&&(e.TgZ(0,"td",38),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.UnitPrice))}}function $g(n,r){if(1&n&&(e.TgZ(0,"td",38),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Total))}}const Xg=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},eh=function(n){return{ID:n}};function th(n,r){if(1&n&&(e.TgZ(0,"tr",44)(1,"td"),e._uU(2),e.ALo(3,"date"),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td")(7,"a",45),e._uU(8),e.qZA()(),e.TgZ(9,"td"),e._uU(10),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.qZA(),e.TgZ(13,"td"),e._uU(14),e.qZA(),e._UZ(15,"td",46),e.TgZ(16,"td",38),e._uU(17),e.ALo(18,"number"),e.qZA(),e.YNc(19,zg,3,3,"td",47),e.YNc(20,Wg,3,3,"td",47),e.TgZ(21,"td",38),e._uU(22),e.qZA(),e.TgZ(23,"td",38),e._uU(24),e.qZA(),e.YNc(25,$g,3,3,"td",47),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(e.xi3(3,15,t.Date,"dd MMM yyyy")),e.xp6(3),e.Oqu(t.EntityName),e.xp6(2),e.Q6J("routerLink",e.DdM(20,Xg))("queryParams",e.VKq(21,eh,t.ID)),e.xp6(1),e.hij(" ",t.Number," "),e.xp6(2),e.Oqu(t.DeliveryStatus),e.xp6(2),e.Oqu(t.SupplierName),e.xp6(2),e.Oqu(t.Name),e.xp6(1),e.Q6J("innerHTML",t.Note,e.oJD),e.xp6(2),e.Oqu(e.lcZ(18,18,t.Quantity)),e.xp6(2),e.Q6J("ngIf",(null==t||null==t.Data?null:t.Data.VariantQuantity)>1),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(2),e.Oqu(t.Discount>0?t.Discount:""),e.xp6(2),e.Oqu(t.DiscountInvoice>0?t.DiscountInvoice:""),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost)}}function nh(n,r){1&n&&e._UZ(0,"td",48)}function oh(n,r){if(1&n&&(e.TgZ(0,"td",49),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.data.Data,"Total")),"")}}function ah(n,r){if(1&n&&(e.TgZ(0,"div",24)(1,"div",25)(2,"table",26)(3,"thead",27)(4,"tr")(5,"th",28),e._uU(6,"Date"),e.qZA(),e.TgZ(7,"th",29),e._uU(8,"Outlet"),e.qZA(),e.TgZ(9,"th",30),e._uU(10,"Invoice"),e.qZA(),e.TgZ(11,"th",29),e._uU(12,"Deliv. State"),e.qZA(),e.TgZ(13,"th"),e._uU(14,"Supplier"),e.qZA(),e.YNc(15,Hg,2,0,"th",14),e.YNc(16,Vg,2,0,"th",14),e.TgZ(17,"th"),e._uU(18,"Product Note "),e._UZ(19,"br"),e.TgZ(20,"i"),e._uU(21,"Invoice Note"),e.qZA()(),e.TgZ(22,"th",31),e._uU(23,"Qty"),e.qZA(),e.YNc(24,Bg,2,0,"th",32),e.YNc(25,Kg,2,0,"th",33),e.TgZ(26,"th",31),e._uU(27,"Item(%)"),e.qZA(),e.TgZ(28,"th",31),e._uU(29,"inv(%)"),e.qZA(),e.YNc(30,jg,2,1,"th",34),e.qZA()(),e.TgZ(31,"tbody"),e.YNc(32,th,26,23,"tr",35),e.qZA(),e.TgZ(33,"tfoot")(34,"tr",36),e._UZ(35,"td",37),e.TgZ(36,"td",38),e._uU(37,"Total :"),e.qZA(),e.TgZ(38,"td",38),e._uU(39),e.ALo(40,"number"),e.ALo(41,"sum"),e.qZA(),e.YNc(42,nh,1,0,"td",39),e.YNc(43,oh,4,6,"td",40),e.qZA()()()()()),2&n){const t=e.oxw();e.xp6(15),e.Q6J("ngIf",t.pageData.Filter.ByProduct),e.xp6(1),e.Q6J("ngIf",!t.pageData.Filter.ByProduct),e.xp6(8),e.Q6J("ngIf",(null==t.data||null==t.data.Data?null:t.data.Data.VariantQuantity)>1),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(5),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(2),e.Q6J("ngForOf",t.data.Data),e.xp6(7),e.Oqu(e.lcZ(40,9,e.xi3(41,11,t.data.Data,"Quantity"))),e.xp6(3),e.Q6J("ngIf",(null==t.data||null==t.data.Data?null:t.data.Data.VariantQuantity)>1),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost)}}let ih=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/ProductPurchaseHistory","ReportLoader/ProductPurchaseHistoryLoader",null,o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"ScopeRadio",[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}]),(0,l.Z)(this,"OrderByRadio",[{Key:!0,Value:"Number"},{Key:!1,Value:"Supplier"}]),(0,l.Z)(this,"hideMore",!0),this.httpService=t,this.csvConverter=a,this.roleService=i,this.matDialog=s}openExportModal(){this.matDialog.open(M.H,{data:{title:"Product Purchase History",exportTypes:[{ID:"ReportExport/ProductPurchaseHistory",Value:"Default",FileName:"Product Purchase History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preInitList(){C.gT.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(h.gz),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-product-purchase-history"]],features:[e.qOj],decls:12,vars:7,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ms-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fa-solid","fa-caret-down"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["name","Scope",3,"model","options","modelChange"],[4,"ngIf"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCodeNName",1,"w-100",3,"ngModel","inputTextValue","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"w-100",3,"ngModel","inputTextValue","ngModelChange"],["id","more-filter","container","",1,"ms-6"],["name","OrderBy",3,"model","options","modelChange"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose...",3,"ngModel","items","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetProductBrandSuggestion",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","100px"],[2,"width","80px"],[2,"width","70px"],[1,"text-end",2,"width","50px"],["style","width: 60px;","class","text-end",4,"ngIf"],["style","width: 75px;","class","text-end",4,"ngIf"],["style","width: 80px;","class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","6",1,"empty-column"],[1,"text-end"],["class","empty-column",4,"ngIf"],["class","text-end","colspan","4",4,"ngIf"],[1,"text-end",2,"width","60px"],[1,"text-end",2,"width","75px"],[1,"text-end",2,"width","80px"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"innerHTML"],["class","text-end",4,"ngIf"],[1,"empty-column"],["colspan","4",1,"text-end"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,kg,3,0,"button",1),e.qZA(),e.TgZ(3,"filters")(4,"div",2),e.YNc(5,Rg,22,9,"div",3),e.YNc(6,Gg,13,5,"div",4),e.qZA(),e.TgZ(7,"a",5),e.NdJ("click",function(){return a.hideMore=!a.hideMore}),e._uU(8),e._UZ(9,"i",6),e.qZA()(),e.TgZ(10,"content"),e.YNc(11,ah,44,14,"div",7),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(1),e.Q6J("ngIf",!a.hideMore),e.xp6(2),e.hij("",a.hideMore?"More":"Less"," "),e.xp6(3),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,q.P,E.J,S.qU,p.JJ,p.uU]})),n})();function rh(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",19),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.openExportModal())}),e._UZ(1,"i",20),e._uU(2," Export"),e.qZA()}}function lh(n,r){if(1&n&&(e.TgZ(0,"tr",21)(1,"td"),e._uU(2),e.ALo(3,"date"),e.qZA(),e.TgZ(4,"td",16),e._uU(5),e.ALo(6,"number"),e.qZA(),e.TgZ(7,"td",16),e._uU(8),e.ALo(9,"number"),e.qZA(),e.TgZ(10,"td",16),e._uU(11),e.ALo(12,"number"),e.qZA()()),2&n){const t=r.$implicit;e.xp6(2),e.Oqu(e.xi3(3,4,t.Date,"EEEE")),e.xp6(3),e.Oqu(e.lcZ(6,7,t.Day)),e.xp6(3),e.Oqu(e.lcZ(9,9,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(12,11,t.PurchaseTotal))}}const sh=function(){return["/menu/Reports/Purchases_Report/Daily/Monthly"]};function ph(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e.TgZ(1,"actions"),e.YNc(2,rh,3,0,"button",2),e.TgZ(3,"a",3),e._uU(4,"View Month"),e.qZA()(),e.TgZ(5,"filters")(6,"div",4)(7,"div",5)(8,"div")(9,"h6"),e._uU(10,"Outlet"),e.qZA(),e.TgZ(11,"ng-select",6),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Category"),e.qZA(),e.TgZ(15,"ng-select",7),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Year"),e.qZA(),e.TgZ(19,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Year=o)}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"Month"),e.qZA(),e.TgZ(23,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Month=o)}),e.qZA()(),e.TgZ(24,"div")(25,"h6"),e._uU(26,"Currency"),e.qZA(),e.TgZ(27,"ng-select",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CurrencyID=o)}),e.qZA()(),e.TgZ(28,"div")(29,"h6"),e._uU(30,"Multiply Unit Qty"),e.qZA(),e.TgZ(31,"radio-options",11),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.MultiplyUnitQuantity=o)}),e.qZA()()()()(),e.TgZ(32,"content")(33,"div",12)(34,"div",13)(35,"table",14)(36,"thead",15)(37,"tr")(38,"th"),e._uU(39,"Day"),e.qZA(),e.TgZ(40,"th",16),e._uU(41,"Dt."),e.qZA(),e.TgZ(42,"th",16),e._uU(43,"Quantity"),e.qZA(),e.TgZ(44,"th",16),e._uU(45,"Purchases"),e.qZA()()(),e.TgZ(46,"tbody"),e.YNc(47,lh,13,13,"tr",17),e.qZA(),e.TgZ(48,"tr")(49,"td",18),e._uU(50,"Total"),e.qZA(),e.TgZ(51,"td",16),e._uU(52),e.ALo(53,"number"),e.ALo(54,"sum"),e.qZA(),e.TgZ(55,"td",16),e._uU(56),e.ALo(57,"number"),e.ALo(58,"sum"),e.qZA()()()()()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",t.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(30,sh)),e.xp6(8),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.Year)("items",t.Years),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.Month)("items",t.Months),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CurrencyID)("items",t.pageData.Options.Currencies),e.xp6(4),e.Q6J("model",t.pageData.Filter.MultiplyUnitQuantity)("options",t.YesNoRadio),e.xp6(16),e.Q6J("ngForOf",t.data.Data),e.xp6(5),e.Oqu(e.lcZ(53,20,e.xi3(54,22,t.data.Data,"Quantity"))),e.xp6(4),e.Oqu(e.lcZ(57,25,e.xi3(58,27,t.data.Data,"PurchaseTotal")))}}let ch=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/GetPurchasePeriodDaily","ReportLoader/GetReportPurchaseDaily"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"Years",[]),(0,l.Z)(this,"Months",[]),(0,l.Z)(this,"YesNoRadio",[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}]),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.Years=C.gT.GenerateYears((new Date).getFullYear(),11,!0),this.Months=C.gT.Months}openExportModal(){this.matDialog.open(M.H,{data:{title:"Purchase Daily",exportTypes:[{ID:"ReportExport/DailyPurchaseReport",Value:"Default",FileName:"Purchase Daily"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-daily-purchases"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["placeholder","Year",3,"ngModel","items","ngModelChange"],["placeholder","Month","bindLabel","Label","bindValue","ID",3,"ngModel","items","ngModelChange"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["name","GroupBy",3,"model","options","modelChange"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],["class","border-bottom",4,"ngFor","ngForOf"],["colspan","2",1,"text-end"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"border-bottom"]],template:function(t,a){1&t&&e.YNc(0,ph,59,31,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,d.JJ,d.On,x.gM,q.P,S.qU,p.JJ,p.uU]})),n})();function dh(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",19),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.openExportModal())}),e._UZ(1,"i",20),e._uU(2," Export"),e.qZA()}}function uh(n,r){if(1&n&&(e.TgZ(0,"tr",21)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td",15),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td",15),e._uU(7),e.ALo(8,"number"),e.qZA()()),2&n){const t=r.$implicit;e.xp6(2),e.Oqu(t.MonthLabel),e.xp6(2),e.Oqu(e.lcZ(5,3,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(8,5,t.Income))}}const _h=function(){return["/menu/Reports/Purchases_Report/Daily"]};function mh(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e.TgZ(1,"actions"),e.YNc(2,dh,3,0,"button",2),e.TgZ(3,"a",3),e._uU(4,"View Daily"),e.qZA()(),e.TgZ(5,"filters")(6,"div",4)(7,"div",5)(8,"div")(9,"h6"),e._uU(10,"Outlet"),e.qZA(),e.TgZ(11,"ng-select",6),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Category"),e.qZA(),e.TgZ(15,"ng-select",7),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Year"),e.qZA(),e.TgZ(19,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Year=o)}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"Currency"),e.qZA(),e.TgZ(23,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CurrencyID=o)}),e.qZA()(),e.TgZ(24,"div")(25,"h6"),e._uU(26,"Multiply Unit Qty"),e.qZA(),e.TgZ(27,"radio-options",10),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.MultiplyUnitQuantity=o)}),e.qZA()(),e.TgZ(28,"div")(29,"h6"),e._uU(30,"Supplier"),e.qZA(),e.TgZ(31,"autocompleteV2",11),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SupplierID=o)}),e.qZA()()()()(),e.TgZ(32,"content")(33,"div",12)(34,"table",13)(35,"thead",14)(36,"tr")(37,"th"),e._uU(38,"Month"),e.qZA(),e.TgZ(39,"th",15),e._uU(40,"Quantity"),e.qZA(),e.TgZ(41,"th",15),e._uU(42,"Purchases"),e.qZA()()(),e.TgZ(43,"tbody"),e.YNc(44,uh,9,7,"tr",16),e.qZA(),e.TgZ(45,"tr",17)(46,"td",18),e._uU(47,"Total"),e.qZA(),e.TgZ(48,"td",15),e._uU(49),e.ALo(50,"number"),e.ALo(51,"sum"),e.qZA(),e.TgZ(52,"td",15),e._uU(53),e.ALo(54,"number"),e.ALo(55,"sum"),e.qZA()()()()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",t.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(28,_h)),e.xp6(8),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.Year)("items",t.Years),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CurrencyID)("items",t.pageData.Options.Currencies),e.xp6(4),e.Q6J("model",t.pageData.Filter.MultiplyUnitQuantity)("options",t.YesNoRadio),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.SupplierID),e.xp6(13),e.Q6J("ngForOf",t.data.Data),e.xp6(5),e.Oqu(e.lcZ(50,18,e.xi3(51,20,t.data.Data,"Quantity"))),e.xp6(4),e.Oqu(e.lcZ(54,23,e.xi3(55,25,t.data.Data,"Income")))}}let gh=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/GetPurchasePeriodMonthly","ReportLoader/GetReportPurchaseMonthly"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"Years",[]),(0,l.Z)(this,"YesNoRadio",[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}]),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.Years=C.gT.GenerateYears((new Date).getFullYear(),11,!0)}openExportModal(){this.matDialog.open(M.H,{data:{title:"Purchase Monthly",exportTypes:[{ID:"ReportExport/MonthlyPurchaseReport",Value:"Default",FileName:"Purchase Monthly"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}preGetList(){null===this.pageData.Filter.EntityID&&(this.pageData.Filter.EntityID=C.gT.GuidEmpty)}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-monthly-purchase"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","View Month",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["placeholder","Year",3,"ngModel","items","ngModelChange"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["name","GroupBy",3,"model","options","modelChange"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-5"],[1,"table","w-25"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","1",1,"text-end"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"border-bottom"]],template:function(t,a){1&t&&e.YNc(0,mh,56,29,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,d.JJ,d.On,x.gM,q.P,E.J,S.qU,p.JJ]})),n})();function hh(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e._UZ(1,"actions"),e.TgZ(2,"filters")(3,"div",2)(4,"div",3)(5,"div")(6,"h6"),e._uU(7,"Outlet"),e.qZA(),e.TgZ(8,"ng-select",4),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Category"),e.qZA(),e.TgZ(12,"ng-select",5),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Year"),e.qZA(),e.TgZ(16,"ng-select",6),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Year=o)}),e.qZA()()()()(),e.TgZ(17,"content")(18,"div",7),e._UZ(19,"POS-line-chart",8),e.qZA()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("hideSearchBox",!0),e.xp6(8),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.Year)("items",t.Years),e.xp6(3),e.Q6J("config",t.chartConfig)("data",t.ChartData)}}let fh=(()=>{class n extends D.n{constructor(t,a){super(t,"Report/MonthlyPurchasesVolume","ReportLoader/GetMonthlyPurchaseVolume"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"Years",[]),(0,l.Z)(this,"ChartData",{}),(0,l.Z)(this,"chartConfig",void 0),this.httpService=t,this.Years=C.gT.GenerateYears((new Date).getFullYear(),11,!0)}preGetList(){null===this.pageData.Filter.EntityID&&(this.pageData.Filter.EntityID=C.gT.GuidEmpty)}preInitList(){this.pageData.Options.Currencies.unshift({ID:0,Symbol:"All"}),this.pageData.Filter.CurrencyID=0}postInit(){const t=[];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}},null!=this.data.PageTitle&&(this.menuData.H=this.data.PageTitle),this.data.Data.MonthlySalesRank.forEach(a=>{t.push({name:a.Name,data:a.Sales})}),this.ChartData={series:t}}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-purchase-volume"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["placeholder","Year",3,"ngModel","items","ngModelChange"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(t,a){1&t&&e.YNc(0,hh,20,10,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.O5,m.w9,d.JJ,d.On,te.D]})),n})();function xh(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",20),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.openExportModal())}),e._UZ(1,"i",21),e._uU(2," Export"),e.qZA()}}const Th=function(){return["/menu/Products/Catalog/Products/Info"]},Ch=function(n){return{ID:n}};function Zh(n,r){if(1&n&&(e.TgZ(0,"tr",22)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"a",23),e._uU(5),e.qZA()(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td",24),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td",24),e._uU(12),e.ALo(13,"number"),e.qZA(),e.TgZ(14,"td",25),e._uU(15),e.ALo(16,"number"),e.qZA()()),2&n){const t=r.$implicit,a=r.index;e.xp6(2),e.Oqu(a+1),e.xp6(2),e.Q6J("routerLink",e.DdM(14,Th))("queryParams",e.VKq(15,Ch,t.ID)),e.xp6(1),e.hij(" ",t.Name," "),e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(10,8,t.PurchaseQuantity)),e.xp6(3),e.Oqu(e.lcZ(13,10,t.SellQuantity)),e.xp6(3),e.Oqu(e.lcZ(16,12,t.Ratio))}}function Dh(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e.TgZ(1,"actions"),e.YNc(2,xh,3,0,"button",2),e.qZA(),e.TgZ(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"h6"),e._uU(8,"Outlet"),e.qZA(),e.TgZ(9,"ng-select",5),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Category"),e.qZA(),e.TgZ(13,"ng-select",6),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"From - To"),e.qZA(),e.TgZ(17,"div")(18,"datepicker",7),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(19,"div",8)(20,"datepicker",9),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()(),e.TgZ(21,"div")(22,"h6"),e._uU(23,"Row Count"),e.qZA(),e.TgZ(24,"input",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.RowCount=o)}),e.qZA()()()()(),e.TgZ(25,"content")(26,"div",11)(27,"div",12)(28,"table",13)(29,"thead",14)(30,"tr")(31,"th",15),e._uU(32," Now "),e.qZA(),e.TgZ(33,"th",16),e._uU(34,"Name"),e.qZA(),e.TgZ(35,"th",17),e._uU(36,"Code"),e.qZA(),e.TgZ(37,"th",18),e._uU(38,"Purchase"),e.qZA(),e.TgZ(39,"th",18),e._uU(40,"Sold"),e.qZA(),e.TgZ(41,"th",18),e._uU(42,"Sold Percentage(%)"),e.qZA()()(),e.TgZ(43,"tbody"),e.YNc(44,Zh,17,17,"tr",19),e.qZA()()()()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",t.roleService.global.Export),e.xp6(7),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.RowCount),e.xp6(20),e.Q6J("ngForOf",t.data.Data)}}let vh=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/PruchasedSalesReportList","ReportLoader/PurchaseSalesReportLoader"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"GroupRadio",[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}]),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i}openExportModal(){this.matDialog.open(M.H,{data:{title:"Purchase Sales Report",exportTypes:[{ID:"ReportExport/PurchasedSalesReportList",Value:"Default",FileName:"Purchase Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-purchase-sales-report"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["type","text","autoNum","",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","55px"],[2,"width","320px"],[2,"width","100px"],[1,"text-end",2,"width","80px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"border-bottom"],[3,"routerLink","queryParams"],[1,"text-end"],[1,"text-end","text-success"]],template:function(t,a){1&t&&e.YNc(0,Dh,45,11,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.Fj,d.JJ,d.On,U.b,p.JJ]})),n})();function bh(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",32),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.openExportModal())}),e._UZ(1,"i",33),e._uU(2," Export"),e.qZA()}}function yh(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Compare with prev Month"),e.qZA(),e.TgZ(3,"radio-options",34),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.Compare=o)})("modelChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.OnCompare("Data"))}),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(3),e.Q6J("model",t.Compare)}}function Sh(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"From - To"),e.qZA(),e.TgZ(3,"div")(4,"datepicker",35),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(5,"div",36)(6,"datepicker",37),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()()}if(2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function Ah(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Year - Month"),e.qZA(),e.TgZ(3,"div",38)(4,"div",39)(5,"ng-select",40),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.Year=o)})("change",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.YearMonthToDateRange())})("clear",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.Year=null)}),e.qZA()(),e.TgZ(6,"div",41)(7,"ng-select",42),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.Month=o)})("change",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.YearMonthToDateRange())})("clear",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.Month=null)}),e.qZA()()()()}if(2&n){const t=e.oxw(2);e.xp6(5),e.Q6J("ngModel",t.Year)("items",t.Years),e.xp6(2),e.Q6J("ngModel",t.Month)("items",t.Months)}}function wh(n,r){1&n&&(e.TgZ(0,"th",43),e._uU(1,"Prev"),e.qZA())}function Fh(n,r){1&n&&(e.TgZ(0,"th",43),e._uU(1,"Now"),e.qZA())}function Mh(n,r){1&n&&(e.TgZ(0,"th",44),e._uU(1,"Trans"),e.qZA())}function qh(n,r){if(1&n&&(e.TgZ(0,"th",45),e._uU(1,"Tax"),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("mat-sort-header",t.pageData.IgnoreTax?"Tax":"SalesNet")}}function Ih(n,r){if(1&n&&(e.TgZ(0,"th",45),e._uU(1," Purchase + Tax"),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("mat-sort-header",t.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Ph(n,r){if(1&n&&(e.TgZ(0,"td",48),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(t.PrevIndex)}}const Oh=function(n,r){return{rankDown:n,rankUp:r,"number key":!0}};function Nh(n,r){if(1&n&&(e.TgZ(0,"td",49),e._uU(1),e.qZA()),2&n){const t=e.oxw(),a=t.$implicit,o=t.index;e.Q6J("ngClass",e.WLB(2,Oh,a.PrevIndex<o+1,a.PrevIndex>o+1)),e.xp6(1),e.hij(" ",a.CurrentIndex," ")}}function Jh(n,r){if(1&n&&(e.TgZ(0,"td",31),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.xi3(2,1,t.Count,".0-0"))}}function Lh(n,r){if(1&n&&(e.TgZ(0,"td",31),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.Tax,".0-0"),"")}}const Uh=function(n,r,t){return{EntityID:n,From:r,To:t}},Qh=function(){return["/menu/Reports/Purchases_Report/Summary"]};function kh(n,r){if(1&n&&(e.TgZ(0,"td",31)(1,"a",50),e.ALo(2,"date"),e.ALo(3,"date"),e.TgZ(4,"b"),e._uU(5),e.ALo(6,"number"),e.qZA()()()),2&n){const t=e.oxw().$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("queryParams",e.kEZ(12,Uh,t.EntityID,e.xi3(2,3,a.pageData.Filter.From,"ddMMyyyy"),e.xi3(3,6,a.pageData.Filter.To,"ddMMyyyy")))("routerLink",e.DdM(16,Qh)),e.xp6(4),e.Oqu(e.xi3(6,9,t.SalesWithTax,".0-0"))}}function Eh(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td",28),e._uU(4),e.qZA(),e.YNc(5,Ph,2,1,"td",46),e.YNc(6,Nh,2,5,"td",47),e.YNc(7,Jh,3,4,"td",30),e.TgZ(8,"td",31),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td",31),e._uU(12),e.ALo(13,"number"),e.qZA(),e.YNc(14,Lh,3,4,"td",30),e.ALo(15,"HideSumZero"),e.YNc(16,kh,7,17,"td",30),e.qZA()),2&n){const t=r.$implicit,a=r.index,o=e.oxw(2);e.xp6(2),e.Oqu(a+1),e.xp6(2),e.Oqu(t.Name),e.xp6(1),e.Q6J("ngIf",o.Compare),e.xp6(1),e.Q6J("ngIf",o.Compare),e.xp6(1),e.Q6J("ngIf",!o.data.WithCategory),e.xp6(2),e.Oqu(e.xi3(10,9,t.Quantity,".0-0")),e.xp6(3),e.Oqu(e.xi3(13,12,t.Sales,".0-0")),e.xp6(2),e.Q6J("ngIf",!o.data.WithCategory&&e.xi3(15,15,o.data.Data,"Tax")),e.xp6(2),e.Q6J("ngIf",!o.data.WithCategory)}}function Yh(n,r){1&n&&e._UZ(0,"td",51)}function Rh(n,r){1&n&&e._UZ(0,"td",51)}function Gh(n,r){if(1&n&&(e.TgZ(0,"td",31),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"Count"),".0-0"),"")}}function Hh(n,r){if(1&n&&(e.TgZ(0,"td",31),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"Tax"),".0-0")," ")}}function Vh(n,r){if(1&n&&(e.TgZ(0,"td",31)(1,"a"),e._uU(2),e.ALo(3,"number"),e.ALo(4,"sum"),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(e.xi3(3,1,e.xi3(4,4,t.data.Data,"SalesWithTax"),".0-0"))}}const Kh=function(){return["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"]},zh=function(){return["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"]};function Wh(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e.TgZ(1,"actions"),e.YNc(2,bh,3,0,"button",2),e.TgZ(3,"div",3)(4,"a",4),e._uU(5,"By Entity Group"),e.qZA(),e._UZ(6,"button",5),e.TgZ(7,"ul",6)(8,"li",7)(9,"a",8),e._uU(10,"By Month"),e.qZA()()()()(),e.TgZ(11,"filters")(12,"div",9)(13,"div",10)(14,"div")(15,"h6"),e._uU(16,"Category"),e.qZA(),e.TgZ(17,"ng-select",11),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.qZA()(),e.TgZ(18,"div")(19,"h6"),e._uU(20,"Type"),e.qZA(),e.TgZ(21,"ng-select",12),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()(),e.TgZ(22,"div")(23,"h6"),e._uU(24,"Date Filter"),e.qZA(),e.TgZ(25,"radio-options",13),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.IsPredefined=o)})("modelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.YearMonthToDateRange())}),e.qZA()(),e.YNc(26,yh,4,1,"div",14),e.YNc(27,Sh,7,2,"div",14),e.YNc(28,Ah,8,4,"div",14),e.TgZ(29,"div")(30,"h6"),e._uU(31,"Complementary"),e.qZA(),e.TgZ(32,"radio-options",15),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ExcludeComplementary=o)}),e.qZA()()()()(),e.TgZ(33,"content")(34,"div",16)(35,"div",17)(36,"table",18),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(37,"thead",19)(38,"tr")(39,"th"),e._uU(40,"No."),e.qZA(),e.TgZ(41,"th",20),e._uU(42,"Outlet"),e.qZA(),e.YNc(43,wh,2,0,"th",21),e.YNc(44,Fh,2,0,"th",21),e.YNc(45,Mh,2,0,"th",22),e.TgZ(46,"th",23),e._uU(47,"Qty"),e.qZA(),e.TgZ(48,"th",24),e._uU(49,"Purchase"),e.qZA(),e.YNc(50,qh,2,1,"th",25),e.ALo(51,"HideSumZero"),e.YNc(52,Ih,2,1,"th",25),e.qZA()(),e.TgZ(53,"tbody"),e.YNc(54,Eh,17,18,"tr",26),e.qZA(),e.TgZ(55,"tfoot")(56,"tr",27),e._UZ(57,"td")(58,"td",28),e.YNc(59,Yh,1,0,"td",29),e.YNc(60,Rh,1,0,"td",29),e.YNc(61,Gh,4,7,"td",30),e.TgZ(62,"td",31),e._uU(63),e.ALo(64,"number"),e.ALo(65,"sum"),e.qZA(),e.TgZ(66,"td",31),e._uU(67),e.ALo(68,"number"),e.ALo(69,"sum"),e.qZA(),e.YNc(70,Hh,4,7,"td",30),e.ALo(71,"HideSumZero"),e.YNc(72,Vh,5,7,"td",30),e.qZA()()()()()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",t.roleService.global.Export),e.xp6(2),e.Q6J("routerLink",e.DdM(46,Kh)),e.xp6(5),e.Q6J("routerLink",e.DdM(47,zh)),e.xp6(8),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Options?null:t.pageData.Options.Types),e.xp6(4),e.Q6J("model",t.IsPredefined)("options",t.RadioDateFilterType),e.xp6(1),e.Q6J("ngIf",t.IsPredefined),e.xp6(1),e.Q6J("ngIf",!t.IsPredefined),e.xp6(1),e.Q6J("ngIf",t.IsPredefined),e.xp6(4),e.Q6J("model",t.pageData.Filter.ExcludeComplementary),e.xp6(11),e.Q6J("ngIf",t.Compare),e.xp6(1),e.Q6J("ngIf",t.Compare),e.xp6(1),e.Q6J("ngIf",!t.data.WithCategory),e.xp6(5),e.Q6J("ngIf",!t.data.WithCategory&&e.xi3(51,28,t.data.Data,"Tax")),e.xp6(2),e.Q6J("ngIf",!t.data.WithCategory),e.xp6(2),e.Q6J("ngForOf",t.data.Data),e.xp6(5),e.Q6J("ngIf",t.Compare),e.xp6(1),e.Q6J("ngIf",t.Compare),e.xp6(1),e.Q6J("ngIf",!t.data.WithCategory),e.xp6(2),e.Oqu(e.xi3(64,31,e.xi3(65,34,t.data.Data,"Quantity"),".0-0")),e.xp6(4),e.hij(" ",e.xi3(68,37,e.xi3(69,40,t.data.Data,"Sales"),".0-0")," "),e.xp6(3),e.Q6J("ngIf",!t.data.WithCategory&&e.xi3(71,43,t.data.Data,"Tax")),e.xp6(2),e.Q6J("ngIf",!t.data.WithCategory)}}let $h=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/OutletPerformancePurchase","ReportLoader/OutletPurchasePerformance"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"Compare",!1),(0,l.Z)(this,"IsPredefined",!0),(0,l.Z)(this,"Comparison",0),(0,l.Z)(this,"Years",void 0),(0,l.Z)(this,"Year",void 0),(0,l.Z)(this,"Month",void 0),(0,l.Z)(this,"Months",void 0),(0,l.Z)(this,"RadioDateFilterType",[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}]),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i;const s=new Date;this.Years=C.gT.GenerateYears(s.getFullYear(),11,!0),this.Year=s.getFullYear(),this.Month=s.getMonth()+1,this.Months=C.gT.Months,this.Months.forEach(c=>c.Label=c.Label.slice(0,3))}openExportModal(){this.matDialog.open(M.H,{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()}YearMonthToDateRange(){const t=new Date;null==this.Year&&(this.Year=t.getFullYear()),null==this.Month&&(this.Month=t.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month-1,1),this.pageData.Filter.To=new Date(this.Year,this.Month,0)}postGetList(){this.Compare&&this.OnCompare("Data")}OnCompare(t){const a=t?this.data[t]:this.data;if(a.length<1)return;const o=Object.assign({},this.pageData.Filter);o.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),o.To=new Date(new Date(this.pageData.Filter.To).getFullYear(),new Date(this.pageData.Filter.To).getMonth(),0).toDateString(),this.httpService.post("/api/Report/OutletPerformancePurchase",JSON.stringify(o)).subscribe(i=>{const s=t?i[t]:i;this.Comparison=0,a.forEach(c=>{c.PrevIndex="-",c.CurrentIndex="-",c.Increase="-";const u=s.filter(w=>w.EntityID==c.EntityID);if(c.CurrentIndex=c.Rank,u.length>0){const w=u[0];c.PrevIndex=w.Rank,w.SalesNet?c.Increase=(c.SalesNet-w.SalesNet)/w.SalesNet*100:w.Sales&&(c.Increase=(c.Sales-w.Sales)/w.Sales*100),c.IsPositive=c.Increase>0,c.IsNegative=c.Increase<0,this.Comparison+=c.Increase}})})}sortData(t){const a=this.data.Data.slice();function o(i,s,c){return(i<s?-1:1)*(c?1:-1)}this.data.Data=t.active&&""!==t.direction?a.sort((i,s)=>{const c="asc"===t.direction;switch(i.Name=null==i.Name?"":i.Name,s.Name=null==s.Name?"":s.Name,t.active){case"Name":return o(i.Name.toLocaleLowerCase(),s.Name.toLocaleLowerCase(),c);case"Count":return o(i.Count,s.Count,c);case"SalesWithTax":return o(i.SalesWithTax,s.SalesWithTax,c);case"Quantity":return o(i.Quantity,s.Quantity,c);case"SalesNet":case"SalesTaxNet":return o(i.Sales,s.Sales,c);case"Tax":return o(i.Tax,s.Tax,c);default:return 0}}):a}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-purchase-outlet-performance"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container",""],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["name","Date Filter",3,"model","options","modelChange"],[4,"ngIf"],["name","complementary",3,"model","modelChange"],[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"],["style","width: 35px;",4,"ngIf"],["mat-sort-header","Count","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-right"],["arrowPosition","before","class","flex-right",3,"mat-sort-header",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],["class","text-end",4,"ngIf"],[1,"text-end"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["name","compare",3,"model","modelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pe-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","ps-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],[2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-right"],["arrowPosition","before",1,"flex-right",3,"mat-sort-header"],["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"],[3,"queryParams","routerLink"],[1,"empty-column"]],template:function(t,a){1&t&&e.YNc(0,Wh,73,48,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.mk,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,f.YE,f.nU,q.P,S.qU,S.aQ,p.JJ,p.uU]})),n})();function Xh(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",28),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.openExportModal())}),e._UZ(1,"i",29),e._uU(2," Export"),e.qZA()}}function e1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"From - To"),e.qZA(),e.TgZ(3,"div")(4,"datepicker",33),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(5,"div",34)(6,"datepicker",35),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()()}if(2&n){const t=e.oxw(3);e.xp6(4),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function t1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Year - Month"),e.qZA(),e.TgZ(3,"div",36)(4,"div",37)(5,"ng-select",38),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.Year=o)})("change",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.YearMonthToDateRange())})("clear",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.Year=null)}),e.qZA()(),e.TgZ(6,"div",39)(7,"ng-select",40),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.Month=o)})("change",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.YearMonthToDateRange())})("clear",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.Month=null)}),e.qZA()()()()}if(2&n){const t=e.oxw(3);e.xp6(5),e.Q6J("ngModel",t.Year)("items",t.Years),e.xp6(2),e.Q6J("ngModel",t.Month)("items",t.Months)}}function n1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Compare with prev Month"),e.qZA(),e.TgZ(3,"radio-options",41),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw(3);return e.KtG(i.Compare=o)})("modelChange",function(){e.CHM(t);const o=e.oxw(3);return e.KtG(o.OnCompare())}),e.qZA()()}if(2&n){const t=e.oxw(3);e.xp6(3),e.Q6J("model",t.Compare)}}function o1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",30)(1,"div")(2,"h6"),e._uU(3,"Date Filter"),e.qZA(),e.TgZ(4,"radio-options",31),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.IsPredefined=o)}),e.qZA()(),e.YNc(5,e1,7,2,"div",27),e.YNc(6,t1,8,4,"div",27),e.TgZ(7,"div")(8,"h6"),e._uU(9,"Type"),e.qZA(),e.TgZ(10,"ng-select",32),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()(),e.YNc(11,n1,4,1,"div",27),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("model",t.IsPredefined)("options",t.RadioDateFilterType),e.xp6(1),e.Q6J("ngIf",!t.IsPredefined),e.xp6(1),e.Q6J("ngIf",t.IsPredefined),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Options?null:t.pageData.Options.Types),e.xp6(1),e.Q6J("ngIf",t.IsPredefined)}}function a1(n,r){1&n&&(e.TgZ(0,"th",42),e._uU(1,"Prev"),e.qZA())}function i1(n,r){1&n&&(e.TgZ(0,"th",42),e._uU(1,"Now"),e.qZA())}function r1(n,r){1&n&&(e.TgZ(0,"th",43),e._uU(1," \xb1 (%) "),e.qZA())}function l1(n,r){if(1&n&&(e.TgZ(0,"td",42),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",t.PrevIndex," ")}}const s1=function(n,r){return{rankDown:n,rankUp:r,"number key":!0}};function p1(n,r){if(1&n&&(e.TgZ(0,"td",47),e._uU(1),e.qZA()),2&n){const t=e.oxw(),a=t.$implicit,o=t.index;e.Q6J("ngClass",e.WLB(2,s1,a.PrevIndex<o+1,a.PrevIndex>o+1)),e.xp6(1),e.hij(" ",a.CurrentIndex," ")}}const c1=function(n,r){return{"text-danger":n,"text-success":r,"text-end":!0}};function d1(n,r){if(1&n&&(e.TgZ(0,"td",48),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.Q6J("ngClass",e.WLB(5,c1,t.IsNegative,t.IsPositive)),e.xp6(1),e.hij(" ",e.xi3(2,2,t.Increase,".0-0")," ")}}function u1(n,r){if(1&n&&(e.TgZ(0,"tr"),e.YNc(1,l1,2,1,"td",14),e.YNc(2,p1,2,5,"td",44),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td",45),e._uU(6),e.ALo(7,"number"),e.qZA(),e.TgZ(8,"td",26),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td",26),e._uU(12),e.ALo(13,"number"),e.qZA(),e.TgZ(14,"td",26),e._uU(15),e.ALo(16,"number"),e.qZA(),e.TgZ(17,"td",26),e._uU(18),e.ALo(19,"number"),e.qZA(),e.YNc(20,d1,3,8,"td",46),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",a.Compare),e.xp6(1),e.Q6J("ngIf",a.Compare),e.xp6(2),e.Oqu(t.Name),e.xp6(2),e.Oqu(e.xi3(7,9,t.Count,".0-0")),e.xp6(3),e.Oqu(e.xi3(10,12,t.Quantity,".0-0")),e.xp6(3),e.Oqu(e.xi3(13,15,t.Sales,".0-0")),e.xp6(3),e.Oqu(e.xi3(16,18,t.Tax,".0-0")),e.xp6(3),e.hij(" ",e.xi3(19,21,t.SalesWithTax,".0-0")," "),e.xp6(2),e.Q6J("ngIf",a.Compare)}}function _1(n,r){1&n&&e._UZ(0,"td",25)}function m1(n,r){1&n&&e._UZ(0,"td",25)}function g1(n,r){1&n&&e._UZ(0,"td")}const h1=function(){return["/menu/Reports/Purchases_Report/Outlet"]},x1=function(){return["/menu/Reports/Purchases_Report/Outlet/Outlet_Monthly_Perfomance"]};function T1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e.TgZ(1,"actions"),e.YNc(2,Xh,3,0,"button",2),e.TgZ(3,"div",3)(4,"a",4),e._uU(5,"By Entity"),e.qZA(),e._UZ(6,"button",5),e.TgZ(7,"ul",6)(8,"li",7)(9,"a",8),e._uU(10,"By Month"),e.qZA()()()()(),e.TgZ(11,"filters")(12,"div",9),e.YNc(13,o1,12,7,"div",10),e.qZA()(),e.TgZ(14,"content")(15,"div",11)(16,"table",12),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(17,"thead",13)(18,"tr"),e.YNc(19,a1,2,0,"th",14),e.YNc(20,i1,2,0,"th",14),e.TgZ(21,"th",15),e._uU(22,"Outlet"),e.qZA(),e.TgZ(23,"th",16),e._uU(24,"Trans "),e.qZA(),e.TgZ(25,"th",17),e._uU(26," Quantity"),e.qZA(),e.TgZ(27,"th",18),e._uU(28," Purchase"),e.qZA(),e.TgZ(29,"th",19),e._uU(30,"Tax"),e.qZA(),e.TgZ(31,"th",20),e._uU(32,"Purchase + Tax"),e.qZA(),e.YNc(33,r1,2,0,"th",21),e.qZA()(),e.TgZ(34,"tbody"),e.YNc(35,u1,21,24,"tr",22),e.qZA(),e.TgZ(36,"tfoot")(37,"tr",23),e.YNc(38,_1,1,0,"td",24),e.YNc(39,m1,1,0,"td",24),e._UZ(40,"td",25),e.TgZ(41,"td",26),e._uU(42),e.ALo(43,"number"),e.ALo(44,"sum"),e.qZA(),e.TgZ(45,"td",26),e._uU(46),e.ALo(47,"number"),e.ALo(48,"sum"),e.qZA(),e.TgZ(49,"td",26),e._uU(50),e.ALo(51,"number"),e.ALo(52,"sum"),e.qZA(),e.TgZ(53,"td",26),e._uU(54),e.ALo(55,"number"),e.ALo(56,"sum"),e.qZA(),e.TgZ(57,"td",26)(58,"a"),e._uU(59),e.ALo(60,"number"),e.ALo(61,"sum"),e.qZA()(),e.YNc(62,g1,1,0,"td",27),e.qZA()()()()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",t.roleService.global.Export),e.xp6(2),e.Q6J("routerLink",e.DdM(50,h1)),e.xp6(5),e.Q6J("routerLink",e.DdM(51,x1)),e.xp6(4),e.Q6J("ngIf",t.pageData.Filter),e.xp6(6),e.Q6J("ngIf",t.Compare),e.xp6(1),e.Q6J("ngIf",t.Compare),e.xp6(9),e.Q6J("mat-sort-header",t.pageData.IgnoreTax?"Tax":"SalesNet"),e.xp6(2),e.Q6J("mat-sort-header",t.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet"),e.xp6(2),e.Q6J("ngIf",t.Compare),e.xp6(2),e.Q6J("ngForOf",null==t.data?null:t.data.Data),e.xp6(3),e.Q6J("ngIf",t.Compare),e.xp6(1),e.Q6J("ngIf",t.Compare),e.xp6(3),e.Oqu(e.xi3(43,20,e.xi3(44,23,null==t.data?null:t.data.Data,"Count"),".0-0")),e.xp6(4),e.Oqu(e.xi3(47,26,e.xi3(48,29,null==t.data?null:t.data.Data,"Quantity"),".0-0")),e.xp6(4),e.hij(" ",e.xi3(51,32,e.xi3(52,35,null==t.data?null:t.data.Data,"Sales"),".0-0")," "),e.xp6(4),e.hij(" ",e.xi3(55,38,e.xi3(56,41,null==t.data?null:t.data.Data,"Tax"),".0-0")," "),e.xp6(5),e.Oqu(e.xi3(60,44,e.xi3(61,47,null==t.data?null:t.data.Data,"SalesWithTax"),".0-0")),e.xp6(3),e.Q6J("ngIf",t.Compare)}}let C1=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/OutletGroupPerformancePurchase","ReportLoader/OutletPurchasePerformance"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"Compare",!1),(0,l.Z)(this,"IsPredefined",!0),(0,l.Z)(this,"Comparison",0),(0,l.Z)(this,"Years",void 0),(0,l.Z)(this,"Year",void 0),(0,l.Z)(this,"Month",void 0),(0,l.Z)(this,"Months",void 0),(0,l.Z)(this,"RadioDateFilterType",[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}]),(0,l.Z)(this,"first",!0),(0,l.Z)(this,"YesNoRadio",[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}]),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i;const s=new Date;this.Years=C.gT.GenerateYears(s.getFullYear(),11,!0),this.Year=s.getFullYear(),this.Month=s.getMonth(),this.Months=C.gT.Months,this.Months.forEach(c=>c.Label=c.Label.slice(0,3))}openExportModal(){this.matDialog.open(M.H,{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.Compare&&this.OnCompare()}OnCompare(t){const a=t?this.data[t]:this.data;if(a.length<1)return;const o=Object.assign({},this.pageData.Filter);o.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),o.To=new Date(new Date(this.pageData.Filter.To).getFullYear(),new Date(this.pageData.Filter.To).getMonth(),0).toDateString(),this.httpService.post("/api/Report/OutletGroupPerformancePurchase",JSON.stringify(o)).subscribe(s=>{const c=t?s[t]:s;this.Comparison=0,a.forEach(u=>{u.PrevIndex="-",u.CurrentIndex="-",u.Increase="-";const w=c.filter(v=>v.EntityID==u.EntityID);if(u.CurrentIndex=u.Rank,w.length>0){const v=w[0];u.PrevIndex=v.Rank,v.SalesNet?u.Increase=(u.SalesNet-v.SalesNet)/v.SalesNet*100:v.Sales&&(u.Increase=(u.Sales-v.Sales)/v.Sales*100),u.IsPositive=u.Increase>0,u.IsNegative=u.Increase<0,this.Comparison+=u.Increase}})})}YearMonthToDateRange(){const t=new Date;null==this.Year&&(this.Year=t.getFullYear()),null==this.Month&&(this.Month=t.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(t){const a=this.data.slice();this.data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"Name":return this.compare(o.Name,i.Name,s);case"Count":return this.compare(o.Count,i.Count,s);case"SalesWithTax":return this.compare(o.SalesWithTax,i.SalesWithTax,s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);case"Sales":case"SalesNet":case"SalesTaxNet":return this.compare(o.Sales,i.Sales,s);case"Tax":return this.compare(o.Tax,i.Tax,s);default:return 0}}):a}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-purchase-outlet-group-performance"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],[1,"container-fluid","mt-5"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["style","width: 35px;",4,"ngIf"],["mat-sort-header","Name"],["mat-sort-header","Count","arrowPosition","before",1,"align-left",2,"width","70px"],["mat-sort-header","Quantity","arrowPosition","before",1,"align-left",2,"width","70px"],["mat-sort-header","Sales","arrowPosition","before",1,"align-left",2,"width","120px"],["arrowPosition","before",1,"flex-right",2,"width","120px",3,"mat-sort-header"],["arrowPosition","before",1,"align-left",2,"width","120px",3,"mat-sort-header"],["style","width: 50px;",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],[1,"text-end"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["name","Date Filter",3,"model","options","modelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pe-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","ps-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],["name","compare",3,"model","modelChange"],[2,"width","35px"],[2,"width","50px"],["style","width: 35px;",3,"ngClass",4,"ngIf"],[1,"text-end",2,"width","70px"],[3,"ngClass",4,"ngIf"],[2,"width","35px",3,"ngClass"],[3,"ngClass"]],template:function(t,a){1&t&&e.YNc(0,T1,63,52,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.mk,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,f.YE,f.nU,q.P,S.qU,p.JJ]})),n})();function Z1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",17),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.openExportModal())}),e._UZ(1,"i",18),e._uU(2," Export"),e.qZA()}}function D1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",19)(1,"div")(2,"h6"),e._uU(3,"Year"),e.qZA(),e.TgZ(4,"ng-select",20),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.Year=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Type"),e.qZA(),e.TgZ(8,"ng-select",21),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()()()}if(2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.Year)("items",t.Years),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Options?null:t.pageData.Options.Types)}}function v1(n,r){if(1&n&&(e.TgZ(0,"th",22),e._uU(1),e.qZA()),2&n){const t=r.$implicit;e.Q6J("mat-sort-header",t),e.xp6(1),e.Oqu(t)}}function b1(n,r){if(1&n&&(e.TgZ(0,"p",24),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit,a=e.oxw().$implicit;e.xp6(1),e.Oqu(a[t])}}function y1(n,r){if(1&n&&(e.TgZ(0,"p",24),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit,a=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,a[t]))}}function S1(n,r){if(1&n&&(e.TgZ(0,"td"),e.YNc(1,b1,2,1,"p",23),e.YNc(2,y1,3,3,"p",23),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.Q6J("ngIf","Outlet"==t),e.xp6(1),e.Q6J("ngIf","Outlet"!=t)}}function A1(n,r){if(1&n&&(e.TgZ(0,"tr"),e.YNc(1,S1,3,2,"td",15),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",a.getKey(t))}}function w1(n,r){if(1&n&&(e.TgZ(0,"td"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t))}}function F1(n,r){if(1&n&&(e.TgZ(0,"tfoot")(1,"tr",25)(2,"td"),e._uU(3,"Total : "),e.qZA(),e.YNc(4,w1,3,3,"td",15),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("ngForOf",t.data.DataFooter)}}const M1=function(){return["/menu/Reports/Purchases_Report/Outlet"]},I1=function(){return["/menu/Reports/Purchases_Report/Outlet/Outlet_Group_Performance"]};function P1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e.TgZ(1,"actions"),e.YNc(2,Z1,3,0,"button",2),e.TgZ(3,"div",3)(4,"a",4),e._uU(5,"By Entity"),e.qZA(),e._UZ(6,"button",5),e.TgZ(7,"ul",6)(8,"li",7)(9,"a",8),e._uU(10,"By Entity Group"),e.qZA()()()()(),e.TgZ(11,"filters")(12,"div",9),e.YNc(13,D1,9,4,"div",10),e.qZA()(),e.TgZ(14,"content")(15,"div",11)(16,"table",12),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(17,"thead",13)(18,"tr"),e.YNc(19,v1,2,2,"th",14),e.qZA()(),e.TgZ(20,"tbody"),e.YNc(21,A1,2,1,"tr",15),e.qZA(),e.YNc(22,F1,5,1,"tfoot",16),e.qZA()()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",t.roleService.global.Export),e.xp6(2),e.Q6J("routerLink",e.DdM(9,M1)),e.xp6(5),e.Q6J("routerLink",e.DdM(10,I1)),e.xp6(4),e.Q6J("ngIf",t.pageData.Filter),e.xp6(6),e.Q6J("ngForOf",t.data.Dataheader),e.xp6(2),e.Q6J("ngForOf",t.data.Data),e.xp6(1),e.Q6J("ngIf",t.data.Data.length>0)}}let O1=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/MonthlyOutletPerformancePurchase","ReportLoader/MonthlyReportPurchase"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"Years",void 0),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.Years=C.gT.GenerateYears((new Date).getFullYear(),11,!0)}openExportModal(){this.matDialog.open(M.H,{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(t){return Object.keys(t)}sortData(t){const a=this.data.Data.slice();function o(i,s,c){return(i<s?-1:1)*(c?1:-1)}this.data.Data=t.active&&""!==t.direction?a.sort((i,s)=>{const c="asc"===t.direction;for(let u=0;u<this.data.Dataheader.length;u++)if(t.active==this.data.Dataheader[u])return"string"==typeof i[this.data.Dataheader[u]]?o(i[this.data.Dataheader[u]].toLocaleLowerCase(),s[this.data.Dataheader[u]].toLocaleLowerCase(),c):o(i[this.data.Dataheader[u]],s[this.data.Dataheader[u]],c)}):a}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-purchase-outlet-monthly-performance"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],[1,"container-fluid","mt-5"],["matSort","","id","tableGrid",1,"table",3,"matSortChange"],[1,"table-light"],[3,"mat-sort-header",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["placeholder","Year",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],[3,"mat-sort-header"],["style","color: black;",4,"ngIf"],[2,"color","black"],[1,"table-footer"]],template:function(t,a){1&t&&e.YNc(0,P1,23,11,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,d.JJ,d.On,f.YE,f.nU,p.JJ]})),n})();function N1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",5),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.exportCSV(o.csvConverter,"ReportExport/CitySalesExport","CitySalesReport.csv"))}),e._UZ(1,"i",6),e._uU(2,"Export"),e.qZA()}}function J1(n,r){if(1&n&&(e.TgZ(0,"span",14),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function L1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"div")(2,"h6"),e._uU(3,"Category"),e.qZA(),e.TgZ(4,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(5,J1,2,2,"ng-template",9),e.qZA()(),e.TgZ(6,"div")(7,"h6"),e._uU(8,"From - To"),e.qZA(),e.TgZ(9,"div")(10,"datepicker",10),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(11,"div",11)(12,"datepicker",12),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Currency"),e.qZA(),e.TgZ(16,"ng-select",13),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CurrencyID=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(6),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CurrencyID)("items",null==t.pageData.Options?null:t.pageData.Options.Currencies)}}function U1(n,r){if(1&n&&(e.TgZ(0,"tr"),e._UZ(1,"td",26)(2,"td",26)(3,"td",27),e.ALo(4,"number"),e._UZ(5,"td",27),e.ALo(6,"number"),e._UZ(7,"td",27),e.ALo(8,"number"),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.Q6J("innerHtml",t.CityCode,e.oJD),e.xp6(1),e.Q6J("innerHtml",t.CityName,e.oJD),e.xp6(1),e.Q6J("innerHtml",e.lcZ(4,5,t.Quantity),e.oJD),e.xp6(2),e.Q6J("innerHtml",e.lcZ(6,7,t.Total),e.oJD),e.xp6(2),e.Q6J("innerHtml",e.lcZ(8,9,t.Average),e.oJD)}}function Q1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",15)(1,"table",16),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",17)(3,"tr")(4,"th",18),e._uU(5,"Code"),e.qZA(),e.TgZ(6,"th",19),e._uU(7,"Regional Name"),e.qZA(),e.TgZ(8,"th",20),e._uU(9,"Quantity"),e.qZA(),e.TgZ(10,"th",21),e._uU(11,"Total"),e.qZA(),e.TgZ(12,"th",22),e._uU(13,"Avg. Price"),e.qZA()()(),e.TgZ(14,"tbody"),e.YNc(15,U1,9,11,"tr",23),e.qZA(),e.TgZ(16,"tfoot")(17,"tr",24),e._UZ(18,"td",25),e.TgZ(19,"td",25),e._uU(20,"Total :"),e.qZA(),e.TgZ(21,"td",25),e._uU(22),e.ALo(23,"number"),e.ALo(24,"sum"),e.qZA(),e.TgZ(25,"td",25),e._uU(26),e.ALo(27,"number"),e.ALo(28,"sum"),e.qZA(),e.TgZ(29,"td",25),e._uU(30),e.ALo(31,"number"),e.ALo(32,"sum"),e.ALo(33,"sum"),e.qZA()()()()()}if(2&n){const t=e.oxw();e.xp6(15),e.Q6J("ngForOf",t.data.List),e.xp6(7),e.Oqu(e.lcZ(23,4,e.xi3(24,6,t.data.List,"Quantity"))),e.xp6(4),e.Oqu(e.lcZ(27,9,e.xi3(28,11,t.data.List,"Total"))),e.xp6(4),e.hij(" ",e.lcZ(31,14,e.xi3(32,16,t.data.List,"Total")/e.xi3(33,19,t.data.List,"Quantity"))," ")}}let k1=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/CitySales","ReportLoader/CitySalesLoader",a),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),this.httpService=t,this.csvConverter=o,this.roleService=i}postInit(t){this.menuData.H=t.PageTitle}sortData(t){const a=this.data.List.slice();this.data.List=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"CityCode":return this.compare(o.CityCode,i.CityCode,s);case"CityName":return this.compare(o.CityName,i.CityName,s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);case"Average":return this.compare(o.Average,i.Average,s);case"Total":return this.compare(o.Total,i.Total,s);default:return 0}}):a}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(I._W),e.Y36(Z.O),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-city"]],features:[e.qOj],decls:8,vars:5,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload","me-4"],["container",""],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","CityCode",2,"width","80px"],["mat-sort-header","CityName",2,"width","220px"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right",2,"width","70px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","100px"],["mat-sort-header","Average","arrowPosition","before",1,"flex-right",2,"width","100px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,N1,3,0,"a",1),e.qZA(),e.TgZ(3,"filters")(4,"div",2),e.YNc(5,L1,17,6,"div",3),e.qZA()(),e.TgZ(6,"content"),e.YNc(7,Q1,34,22,"div",4),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,m.w9,m.ir,A.QB,d.JJ,d.On,x.gM,f.YE,f.nU,S.qU,p.JJ]})),n})();function E1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",5),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.convertToCSV(o.csvConverter,o.data.Data,"TypeSalesReport.csv"))}),e._UZ(1,"i",6),e._uU(2,"Export"),e.qZA()}}function Y1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"From - To"),e.qZA(),e.TgZ(8,"div")(9,"datepicker",9),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.from=o)}),e.qZA()(),e.TgZ(10,"div",10)(11,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.to=o)}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(5),e.Q6J("date",t.pageData.Filter.from),e.xp6(2),e.Q6J("date",t.pageData.Filter.to)}}function R1(n,r){1&n&&(e.TgZ(0,"th",17),e._uU(1,"Cost"),e.qZA())}function G1(n,r){if(1&n&&(e._UZ(0,"td",30),e.ALo(1,"number")),2&n){const t=e.oxw().$implicit;e.Q6J("innerHtml",e.lcZ(1,1,t.Cost),e.oJD)}}const H1=function(n,r,t,a){return{SalesTypeID:n,OutletID:r,From:t,To:a}},V1=function(n){return["/menu/Reports/Sales_Report/Standard/Detail",n]};function B1(n,r){if(1&n&&(e.TgZ(0,"tr"),e._UZ(1,"td",25)(2,"td",26),e.ALo(3,"number"),e._UZ(4,"td",26),e.ALo(5,"number"),e.TgZ(6,"td",21)(7,"a",27),e.ALo(8,"date"),e.ALo(9,"date"),e._uU(10),e.ALo(11,"number"),e.qZA()(),e._UZ(12,"td",28),e.ALo(13,"number"),e.YNc(14,G1,2,3,"td",29),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("innerHtml",t.Name,e.oJD),e.xp6(1),e.Q6J("innerHtml",e.lcZ(3,7,t.Count),e.oJD),e.xp6(2),e.Q6J("innerHtml",e.lcZ(5,9,t.Quantity),e.oJD),e.xp6(3),e.Q6J("routerLink",e.VKq(26,V1,e.l5B(21,H1,t.TypeID,a.getOutletID(),e.xi3(8,11,a.getFrom(),"ddMMyyyy"),e.xi3(9,14,a.getTo(),"ddMMyyyy")))),e.xp6(3),e.Oqu(e.lcZ(11,17,t.Gross)),e.xp6(2),e.Q6J("innerHtml",e.lcZ(13,19,t.Sales),e.oJD),e.xp6(2),e.Q6J("ngIf",a.roleService.product.Cost)}}function K1(n,r){if(1&n&&(e.TgZ(0,"td",31),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(e.lcZ(2,1,e.xi3(3,3,t.data.Data,"Cost")))}}function j1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",12)(1,"table",13),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",14)(3,"tr")(4,"th",15),e._uU(5,"Tag Name"),e.qZA(),e.TgZ(6,"th",16),e._uU(7,"Trans"),e.qZA(),e.TgZ(8,"th",17),e._uU(9,"Quantity"),e.qZA(),e.TgZ(10,"th",17),e._uU(11,"Gross"),e.qZA(),e.TgZ(12,"th",17),e._uU(13,"Sales"),e.qZA(),e.YNc(14,R1,2,0,"th",18),e.qZA()(),e.TgZ(15,"tbody"),e.YNc(16,B1,15,28,"tr",19),e.qZA(),e.TgZ(17,"tfoot")(18,"tr",20),e._UZ(19,"td",21),e.TgZ(20,"td",21),e._uU(21),e.ALo(22,"number"),e.ALo(23,"sum"),e.qZA(),e.TgZ(24,"td",21),e._uU(25),e.ALo(26,"number"),e.ALo(27,"sum"),e.qZA(),e.TgZ(28,"td",22)(29,"a"),e._uU(30),e.ALo(31,"number"),e.ALo(32,"sum"),e.qZA()(),e.TgZ(33,"td",23),e._uU(34),e.ALo(35,"number"),e.ALo(36,"sum"),e.qZA(),e.YNc(37,K1,4,6,"td",24),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(14),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(2),e.Q6J("ngForOf",t.data.Data),e.xp6(5),e.Oqu(e.lcZ(22,7,e.xi3(23,9,t.data.Data,"Count"))),e.xp6(4),e.Oqu(e.lcZ(26,12,e.xi3(27,14,t.data.Data,"Quantity"))),e.xp6(5),e.Oqu(e.lcZ(31,17,e.xi3(32,19,t.data.Data,"Gross"))),e.xp6(4),e.Oqu(e.lcZ(35,22,e.xi3(36,24,t.data.Data,"Sales"))),e.xp6(3),e.Q6J("ngIf",t.roleService.product.Cost)}}let z1=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/TypeSales","ReportLoader/TypeSalesLoader",a),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"month",void 0),(0,l.Z)(this,"year",void 0),this.httpService=t,this.csvConverter=o,this.roleService=i;const s=new Date;this.month=s.getMonth(),this.year=s.getFullYear()}postInit(t){this.menuData.H=t.PageTitle}getFrom(){return new Date(this.year,this.month,1).toLocaleDateString()}getTo(){return new Date(this.year,this.month+1,0).toLocaleDateString()}getOutletID(){return"00000000-0000-0000-0000-000000000000"!=this.pageData.Filter.EntityID&&this.pageData.Filter.EntityID?this.pageData.Filter.EntityID:"00000000-0000-0000-0000-000000000000"}sortData(t){const a=this.data.List.slice();this.data.List=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"TypeName":return this.compare(o.TypeName,i.TypeName,s);case"Trans":return this.compare(o.Trans,i.Trans,s);case"Quality":return this.compare(o.Quality,i.Quality,s);case"Gross":return this.compare(o.Gross,i.Gross,s);case"Sales":return this.compare(o.Sales,i.Sales,s);case"Cost":return this.compare(o.Cost,i.Cost,s);default:return 0}}):a}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(I._W),e.Y36(Z.O),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-type"]],features:[e.qOj],decls:8,vars:5,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload","me-4"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],["style","width: 120px;","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-primary"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],[3,"routerLink"],[1,"text-end","text-success",3,"innerHtml"],["class","text-end text-danger",3,"innerHtml",4,"ngIf"],[1,"text-end","text-danger",3,"innerHtml"],[1,"text-end","text-danger"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.Number=i})("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,E1,3,0,"a",1),e.qZA(),e.TgZ(3,"filters")(4,"div",2),e.YNc(5,Y1,12,4,"div",3),e.qZA()(),e.TgZ(6,"content"),e.YNc(7,j1,38,27,"div",4),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.Number),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,x.gM,f.YE,S.qU,p.JJ,p.uU]})),n})();function W1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",5),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.convertToCSV(o.csvConverter,o.data.Data,"CustomerGroupSalesReport.csv"))}),e._UZ(1,"i",6),e._uU(2,"Export"),e.qZA()}}function $1(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"From - To"),e.qZA(),e.TgZ(8,"div")(9,"datepicker",9),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(10,"div",10)(11,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function X1(n,r){1&n&&(e.TgZ(0,"th",18),e._uU(1,"Cost"),e.qZA())}function ef(n,r){1&n&&(e.TgZ(0,"th",18),e._uU(1,"Profit"),e.qZA())}function tf(n,r){if(1&n&&(e._UZ(0,"td",31),e.ALo(1,"number")),2&n){const t=e.oxw().$implicit;e.Q6J("innerHtml",e.lcZ(1,1,t.Cost),e.oJD)}}function nf(n,r){if(1&n&&(e._UZ(0,"td",28),e.ALo(1,"number")),2&n){const t=e.oxw().$implicit;e.Q6J("innerHtml",e.lcZ(1,1,t.Profit),e.oJD)}}function of(n,r){if(1&n&&(e.TgZ(0,"tr"),e._UZ(1,"td",26)(2,"td",27),e.ALo(3,"number"),e._UZ(4,"td",27),e.ALo(5,"number"),e._UZ(6,"td",27),e.ALo(7,"number"),e._UZ(8,"td",28),e.ALo(9,"number"),e.YNc(10,tf,2,3,"td",29),e.YNc(11,nf,2,3,"td",30),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("innerHtml",t.GroupName,e.oJD),e.xp6(1),e.Q6J("innerHtml",e.lcZ(3,7,t.Count),e.oJD),e.xp6(2),e.Q6J("innerHtml",e.lcZ(5,9,t.Quantity),e.oJD),e.xp6(2),e.Q6J("innerHtml",e.lcZ(7,11,t.Gross),e.oJD),e.xp6(2),e.Q6J("innerHtml",e.lcZ(9,13,t.Sales),e.oJD),e.xp6(2),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",a.roleService.report.Profit)}}function af(n,r){if(1&n&&(e.TgZ(0,"td",32),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(e.lcZ(2,1,e.xi3(3,3,t.data.Data,"Cost")))}}function rf(n,r){if(1&n&&(e.TgZ(0,"td",23),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(e.lcZ(2,1,e.xi3(3,3,t.data.Data,"Profit")))}}function lf(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",12)(1,"div",13)(2,"table",14),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(3,"thead",15)(4,"tr")(5,"th",16),e._uU(6,"Group Name"),e.qZA(),e.TgZ(7,"th",17),e._uU(8,"Trans"),e.qZA(),e.TgZ(9,"th",18),e._uU(10,"Quantity"),e.qZA(),e.TgZ(11,"th",18),e._uU(12,"Gross"),e.qZA(),e.TgZ(13,"th",18),e._uU(14,"Sales"),e.qZA(),e.YNc(15,X1,2,0,"th",19),e.YNc(16,ef,2,0,"th",19),e.qZA()(),e.TgZ(17,"tbody"),e.YNc(18,of,12,15,"tr",20),e.qZA(),e.TgZ(19,"tfoot")(20,"tr",21),e._UZ(21,"td",22),e.TgZ(22,"td",22),e._uU(23),e.ALo(24,"number"),e.ALo(25,"sum"),e.qZA(),e.TgZ(26,"td",22),e._uU(27),e.ALo(28,"number"),e.ALo(29,"sum"),e.qZA(),e.TgZ(30,"td",22),e._uU(31),e.ALo(32,"number"),e.ALo(33,"sum"),e.qZA(),e.TgZ(34,"td",23),e._uU(35),e.ALo(36,"number"),e.ALo(37,"sum"),e.qZA(),e.YNc(38,af,4,6,"td",24),e.YNc(39,rf,4,6,"td",25),e.qZA()()()()()}if(2&n){const t=e.oxw();e.xp6(15),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.report.Profit),e.xp6(2),e.Q6J("ngForOf",t.data.Data),e.xp6(5),e.Oqu(e.lcZ(24,9,e.xi3(25,11,t.data.Data,"Count"))),e.xp6(4),e.Oqu(e.lcZ(28,14,e.xi3(29,16,t.data.Data,"Quantity"))),e.xp6(4),e.Oqu(e.lcZ(32,19,e.xi3(33,21,t.data.Data,"Gross"))),e.xp6(4),e.Oqu(e.lcZ(36,24,e.xi3(37,26,t.data.Data,"Sales"))),e.xp6(3),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.report.Profit)}}let sf=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/CustomerGroup","ReportLoader/CustomerGroupLoader",a),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"first",!0),this.httpService=t,this.csvConverter=o,this.roleService=i}preGetList(){if(this.first){const t=new Date,a=t.getMonth(),o=t.getFullYear();this.pageData.Filter.From=new Date(o,a,1).toDateString(),this.pageData.Filter.To=new Date(o,a+1,0).toDateString()}}postInit(t){if(this.menuData.H=t.PageTitle,this.first){const a=new Date,o=a.getMonth(),i=a.getFullYear();this.pageData.Filter.From=new Date(i,o,1),this.pageData.Filter.To=new Date(i,o+1,0),this.first=!1}}sortData(t){const a=this.data.List.slice();this.data.List=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"GroupName":return this.compare(o.GroupName,i.GroupName,s);case"Trans":return this.compare(o.Trans,i.Trans,s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);case"Gross":return this.compare(o.Gross,i.Gross,s);case"Sales":return this.compare(o.Sales,i.Sales,s);case"Cost":return this.compare(o.Cost,i.Cost,s);case"Profit":return this.compare(o.Profit,i.Profit,s);default:return 0}}):a}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(I._W),e.Y36(Z.O),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-customer-group"]],features:[e.qOj],decls:8,vars:5,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload","me-4"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end",2,"width","70px"],[1,"text-end",2,"width","120px"],["style","width: 120px;","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],[1,"text-end","text-success",3,"innerHtml"],["class","text-end text-danger",3,"innerHtml",4,"ngIf"],["class","text-end text-success",3,"innerHtml",4,"ngIf"],[1,"text-end","text-danger",3,"innerHtml"],[1,"text-end","text-danger"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,W1,3,0,"a",1),e.qZA(),e.TgZ(3,"filters")(4,"div",2),e.YNc(5,$1,12,4,"div",3),e.qZA()(),e.TgZ(6,"content"),e.YNc(7,lf,40,29,"div",4),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,m.w9,A.QB,d.JJ,d.On,x.gM,f.YE,S.qU,p.JJ]})),n})();function pf(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",5),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.exportCSV(o.csvConverter,"ReportExport/SalesGroup","SalesGroupPerformance.csv"))}),e._UZ(1,"i",6),e._uU(2,"Export"),e.qZA()}}function cf(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"From - To"),e.qZA(),e.TgZ(8,"div")(9,"datepicker",9),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(10,"div",10)(11,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function df(n,r){1&n&&(e.TgZ(0,"th",17),e._uU(1,"Profit"),e.qZA())}function uf(n,r){if(1&n&&(e._UZ(0,"td",27),e.ALo(1,"number")),2&n){const t=e.oxw().$implicit;e.Q6J("innerHtml",e.lcZ(1,1,t.ActualProfit),e.oJD)}}function _f(n,r){if(1&n&&(e.TgZ(0,"tr"),e._UZ(1,"td",24)(2,"td",25),e.ALo(3,"number"),e._UZ(4,"td",25),e.ALo(5,"number"),e._UZ(6,"td",25),e.ALo(7,"number"),e._UZ(8,"td",25),e.YNc(9,uf,2,3,"td",26),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("innerHtml",t.Name,e.oJD),e.xp6(1),e.Q6J("innerHtml",e.lcZ(3,6,t.InvoiceCount),e.oJD),e.xp6(2),e.Q6J("innerHtml",e.lcZ(5,8,t.NetRevenue),e.oJD),e.xp6(2),e.Q6J("innerHtml",e.lcZ(7,10,t.SalesTarget),e.oJD),e.xp6(2),e.Q6J("innerHtml",t.Percentage+"%",e.oJD),e.xp6(1),e.Q6J("ngIf",a.roleService.report.Profit)}}function mf(n,r){if(1&n&&(e.TgZ(0,"td",22),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.data.Data,"ActualProfit")),"")}}function gf(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",12)(1,"div",13)(2,"table",14),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(3,"thead",15)(4,"tr",16)(5,"th"),e._uU(6,"Group Name"),e.qZA(),e.TgZ(7,"th",17),e._uU(8,"Count"),e.qZA(),e.TgZ(9,"th",17),e._uU(10,"Actual"),e.qZA(),e.TgZ(11,"th",17),e._uU(12,"Target"),e.qZA(),e.TgZ(13,"th",17),e._uU(14,"Percentage"),e.qZA(),e.YNc(15,df,2,0,"th",18),e.qZA()(),e.TgZ(16,"tbody"),e.YNc(17,_f,10,12,"tr",19),e.qZA(),e.TgZ(18,"tfoot")(19,"tr",20),e._UZ(20,"td",21)(21,"td",21),e.TgZ(22,"td",22),e._uU(23),e.ALo(24,"number"),e.ALo(25,"sum"),e.qZA(),e._UZ(26,"td",21)(27,"td",21),e.YNc(28,mf,4,6,"td",23),e.qZA()()()()()}if(2&n){const t=e.oxw();e.xp6(15),e.Q6J("ngIf",t.roleService.report.Profit),e.xp6(2),e.Q6J("ngForOf",t.data.Data),e.xp6(6),e.Oqu(e.lcZ(24,4,e.xi3(25,6,t.data.Data,"GrossRevenue"))),e.xp6(5),e.Q6J("ngIf",t.roleService.report.Profit)}}let hf=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/SalesGroup","ReportLoader/SalesGroupLoader",a),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"first",!0),this.httpService=t,this.csvConverter=o,this.roleService=i}preGetList(){if(this.first){const t=new Date,a=t.getMonth(),o=t.getFullYear();this.pageData.Filter.From=new Date(o,a,1).toDateString(),this.pageData.Filter.To=new Date(o,a+1,0).toDateString()}}postInit(t){if(this.menuData.H=t.PageTitle,this.first){const a=new Date,o=a.getMonth(),i=a.getFullYear();this.pageData.Filter.From=new Date(i,o,1),this.pageData.Filter.To=new Date(i,o+1,0),this.first=!1}}sortData(t){const a=this.data.List.slice();t.active&&""!==t.direction||(this.data.List=a)}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(I._W),e.Y36(Z.O),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-sales-group"]],features:[e.qOj],decls:8,vars:5,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload","me-4"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-end",2,"width","120px"],["style","width: 120px;","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end"],["class","text-end ",4,"ngIf"],[3,"innerHtml"],[1,"text-end",3,"innerHtml"],["class","text-end text-success",3,"innerHtml",4,"ngIf"],[1,"text-end","text-success",3,"innerHtml"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,pf,3,0,"a",1),e.qZA(),e.TgZ(3,"filters")(4,"div",2),e.YNc(5,cf,12,4,"div",3),e.qZA()(),e.TgZ(6,"content"),e.YNc(7,gf,29,9,"div",4),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,m.w9,A.QB,d.JJ,d.On,x.gM,f.YE,S.qU,p.JJ]})),n})();const xf=function(){return["/menu/Reports/Sales_Report/Advanced/Tax_Report/By_Outlet"]};function Tf(n,r){1&n&&(e.TgZ(0,"a",6),e._uU(1,"By Outlet"),e.qZA()),2&n&&e.Q6J("routerLink",e.DdM(1,xf))}function Cf(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",7),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",8),e._uU(2," Export "),e.qZA()}}function Zf(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",9)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"From - To"),e.qZA(),e.TgZ(8,"div",11)(9,"datepicker",12),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA(),e.TgZ(10,"div",13)(11,"app-timepicker",14),e.NdJ("timeChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.timeFrom=o)})("timeChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.timeFromChange(o))}),e.qZA()()(),e.TgZ(12,"div",15)(13,"datepicker",12),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA(),e.TgZ(14,"div",13)(15,"app-timepicker",14),e.NdJ("timeChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.timeTo=o)})("timeChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.timeToChange(o))}),e.qZA()()()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Tax"),e.qZA(),e.TgZ(19,"ng-select",16),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()(),e.TgZ(20,"div")(21,"h6"),e._uU(22,"Page Size"),e.qZA(),e.TgZ(23,"input",17),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.RowCount=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("time",t.timeFrom),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(2),e.Q6J("time",t.timeTo),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Options?null:t.pageData.Options.Types),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.RowCount)}}function Df(n,r){if(1&n&&e._UZ(0,"th",43),2&n){const t=r.$implicit;e.Q6J("innerHtml",t.Label+" ("+t.Rate+"%)",e.oJD)}}function vf(n,r){if(1&n&&(e._UZ(0,"td",47),e.ALo(1,"number"),e.ALo(2,"TaxDefault")),2&n){const t=r.index,a=e.oxw().$implicit,o=e.oxw(2);e.Q6J("innerHtml",e.lcZ(1,1,e.Dn7(2,3,o.data.Compenents,a,t)),e.oJD)}}const bf=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},yf=function(n){return{ID:n}};function Sf(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"a",44),e._uU(5),e.qZA()(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.ALo(12,"date"),e.qZA(),e.TgZ(13,"td",45),e._uU(14),e.ALo(15,"number"),e.qZA(),e.TgZ(16,"td",45),e._uU(17),e.ALo(18,"number"),e.qZA(),e.YNc(19,vf,3,7,"td",46),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.EntityName),e.xp6(2),e.Q6J("routerLink",e.DdM(17,bf))("queryParams",e.VKq(18,yf,t.ID)),e.xp6(1),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Name),e.xp6(2),e.Oqu(t.TaxName),e.xp6(2),e.Oqu(e.xi3(12,10,t.Created,"dd MMM yyyy")),e.xp6(3),e.Oqu(e.lcZ(15,13,t.Sales)),e.xp6(3),e.Oqu(e.lcZ(18,15,t.Tax)),e.xp6(2),e.Q6J("ngForOf",a.getComponent(a.data))}}function Af(n,r){if(1&n&&(e.TgZ(0,"td",48),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.SumTaxAmount)," ")}}function wf(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",49),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport"))}),e.TgZ(1,"i",50),e._uU(2,"?"),e.qZA()()}}function Ff(n,r){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(e.lcZ(2,1,t.listTotal))}}function Mf(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",51),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.NextPage(!0))}),e._UZ(1,"i",52),e._uU(2," Next"),e.qZA()}}function qf(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",53),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.StoreRowsCountAPIResult("Report/GetCountSalesTaxReport",!0))}),e._UZ(1,"i",54),e._uU(2," Show All"),e.qZA()}}function If(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",18)(1,"div",19)(2,"table",20),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(3,"thead",21)(4,"tr")(5,"th",22),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",23),e._uU(8,"Number"),e.qZA(),e.TgZ(9,"th",24),e._uU(10,"Name"),e.qZA(),e.TgZ(11,"th",25),e._uU(12,"Type"),e.qZA(),e.TgZ(13,"th",26),e._uU(14,"Date"),e.qZA(),e.TgZ(15,"th",27),e._uU(16," Sales"),e.qZA(),e.TgZ(17,"th",28),e._uU(18,"Tax"),e.qZA(),e.YNc(19,Df,1,1,"th",29),e.qZA()(),e.TgZ(20,"tbody"),e.YNc(21,Sf,20,20,"tr",30),e.qZA(),e.TgZ(22,"tfoot")(23,"tr",31),e._UZ(24,"td",32),e.TgZ(25,"td",33),e._uU(26),e.ALo(27,"number"),e.ALo(28,"sum"),e.qZA(),e.TgZ(29,"td",33),e._uU(30),e.ALo(31,"number"),e.ALo(32,"sum"),e.qZA(),e.YNc(33,Af,3,3,"td",34),e.qZA()()()(),e.TgZ(34,"div",35)(35,"div",36)(36,"div",37),e._uU(37),e.ALo(38,"number"),e.YNc(39,wf,3,0,"span",38),e.YNc(40,Ff,3,3,"span",39),e._uU(41),e.qZA()(),e.TgZ(42,"div",40),e.YNc(43,Mf,3,0,"a",41),e.YNc(44,qf,3,0,"a",42),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(19),e.Q6J("ngForOf",t.data.Compenents),e.xp6(2),e.Q6J("ngForOf",t.infiniteList),e.xp6(5),e.Oqu(e.lcZ(27,11,e.xi3(28,13,t.infiniteList,"Sales"))),e.xp6(4),e.Oqu(e.lcZ(31,16,e.xi3(32,18,t.infiniteList,"Tax"))),e.xp6(3),e.Q6J("ngForOf",t.data.Compenents),e.xp6(4),e.hij(" Showing 1 - ",e.lcZ(38,21,t.pageData.Filter.RowCount*(t.pageData.Filter.PageNumber-1)+t.data.TotalCurrentRow)," of "),e.xp6(2),e.Q6J("ngIf",!t.pageData.HideStoreApiCount),e.xp6(1),e.Q6J("ngIf",t.pageData.HideStoreApiCount),e.xp6(1),e.hij(" records ~ ",t.pageData.Filter.PageNumber," Page "),e.xp6(2),e.Q6J("ngIf",t.nextPageDisabled&&!t.goToLast),e.xp6(1),e.Q6J("ngIf",t.nextPageDisabled&&!t.goToLast)}}let Pf=(()=>{class n extends ce.X{constructor(t,a,o,i,s){super(t,"Report/GetSalesTaxReport","ReportLoader/GetTaxReport",s),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"toastrService",void 0),(0,l.Z)(this,"timeTo",void 0),(0,l.Z)(this,"timeFrom",void 0),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.toastrService=s}preInitList(){this.oldRowCount=this.pageData.Filter.RowCount}getComponent(t){return t.Component=[],this.data.Compenents.forEach((a,o)=>{0!=t.Tax?(a.SalesTax=0==o?t.Sales:this.data.Compenents[o-1].SalesTax,a.SalesTax=0==o?a.SalesTax:a.SalesTax+a.SalesTax*this.data.Compenents[o-1].Rate/100,t.Component[o]=a.SalesTax*a.Rate/100,a.SumTaxAmount=a.SumTaxAmount+t.Component[o]):t.Component[o]=0}),t.Component}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(o.Name=null==o.Name?"":o.Name,i.Name=null==i.Name?"":i.Name,o.EntityName=null==o.EntityName?"":o.EntityName,i.EntityName=null==i.EntityName?"":i.EntityName,t.active){case"Name":return this.compare(o.Name.toLocaleLowerCase(),i.Name.toLocaleLowerCase(),s);case"Outlet":return this.compare(o.EntityName.toLocaleLowerCase(),i.EntityName.toLocaleLowerCase(),s);case"Number":return this.compare(o.Number,i.Number,s);case"Date":return this.compare(o.Date,i.Date,s);case"Sales":return this.compare(o.Sales,i.Sales,s);case"Tax":return this.compare(o.Tax,i.Tax,s);default:return 0}}):a}openExportModal(){this.matDialog.open(M.H,{data:{title:"Tax Report",exportTypes:[{ID:"ReportExport/GetSalesTaxReport",Value:"Default",FileName:"Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}timeToChange(t){this.pageData.Filter.To=C.gT.setDateTime(t,this.pageData.Filter.To)}timeFromChange(t){this.pageData.Filter.From=C.gT.setDateTime(t,this.pageData.Filter.From)}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw),e.Y36(I._W))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-tax-report"]],features:[e.qOj],decls:9,vars:6,consts:[[3,"pageData","text","textChange","onSubmit"],["class","btn btn-success me-6","matTooltipPosition","above","matTooltip","Tax Report By Outlet",3,"routerLink",4,"ngIf"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-success","me-6",3,"routerLink"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],[1,"w-100","d-flex","mt-2","align-items-center"],["name","To","appearance","outline",1,"timepicker",3,"date","dateChange"],[1,"ms-2"],[3,"time","timeChange"],[1,"w-100","d-flex","align-items-center","mt-4"],["bindLabel","Label","bindValue","ID","placeholder","Choose a Type",3,"ngModel","items","ngModelChange"],["type","text","autoNum","","name","RowCount",1,"form-control",3,"ngModel","ngModelChange"],[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",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",1,"flex-right","text-end",2,"width","150px"],["style","width: 150px","class","align-right text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],[1,"text-end","text-success"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load next page",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],[1,"text-end"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end",2,"width","150px"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.Number=i})("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,Tf,2,2,"a",1),e.YNc(3,Cf,3,0,"a",2),e.qZA(),e.TgZ(4,"filters")(5,"div",3),e.YNc(6,Zf,24,10,"div",4),e.qZA()(),e.TgZ(7,"content"),e.YNc(8,If,45,23,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.Number),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.Fj,d.JJ,d.On,x.gM,f.YE,f.nU,U.b,ge.E,S.qU,S.X6,p.JJ,p.uU],styles:["datepicker.timepicker>mat-form-field{width:140px!important}"]})),n})();function Of(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.convertToCSV(o.csvConverter,o.data.Data,"TaxReport.csv"))}),e._UZ(1,"i",7),e._uU(2,"Export"),e.qZA()}}function Nf(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",8)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"From - To"),e.qZA(),e.TgZ(8,"div")(9,"datepicker",10),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(10,"div",11)(11,"datepicker",12),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Tax Type"),e.qZA(),e.TgZ(15,"ng-select",13),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Options?null:t.pageData.Options.Types)("clearable",!1)}}function Jf(n,r){1&n&&(e.TgZ(0,"th",27),e._uU(1,"Total Tax"),e.qZA())}function Lf(n,r){if(1&n&&e._UZ(0,"th",28),2&n){const t=r.$implicit;e.Q6J("innerHtml",t.Label+" ("+t.Rate+"%)",e.oJD)}}function Uf(n,r){if(1&n&&(e.TgZ(0,"td",29),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Tax))}}function Qf(n,r){if(1&n&&(e._UZ(0,"td",28),e.ALo(1,"number"),e.ALo(2,"TaxDefault")),2&n){const t=r.index,a=e.oxw().$implicit,o=e.oxw(2);e.Q6J("innerHtml",e.lcZ(1,1,e.Dn7(2,3,o.data.Compenents,a,t)),e.oJD)}}function kf(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td",29),e._uU(4),e.ALo(5,"number"),e.qZA(),e.YNc(6,Uf,3,3,"td",30),e.YNc(7,Qf,3,7,"td",31),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.EntityName),e.xp6(2),e.Oqu(e.lcZ(5,4,t.Sales)),e.xp6(2),e.Q6J("ngIf",0==a.data.Compenents.length),e.xp6(1),e.Q6J("ngForOf",a.getComponent(t))}}function Ef(n,r){if(1&n&&(e.TgZ(0,"td",24),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.data.Data,"Tax")),"")}}function Yf(n,r){if(1&n&&(e.TgZ(0,"td",32),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.SumTaxAmount)," ")}}function Rf(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",14)(1,"table",15),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",16)(3,"tr")(4,"th",17),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"th",18),e._uU(7,"Sales"),e.qZA(),e.YNc(8,Jf,2,0,"th",19),e.YNc(9,Lf,1,1,"th",20),e.qZA()(),e.TgZ(10,"tbody"),e.YNc(11,kf,8,6,"tr",21),e.qZA(),e.TgZ(12,"tfoot")(13,"tr",22),e._UZ(14,"td",23),e.TgZ(15,"td",24),e._uU(16),e.ALo(17,"number"),e.ALo(18,"sum"),e.qZA(),e.YNc(19,Ef,4,6,"td",25),e.YNc(20,Yf,3,3,"td",26),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(8),e.Q6J("ngIf",0==t.data.Compenents.length),e.xp6(1),e.Q6J("ngForOf",t.data.Compenents),e.xp6(2),e.Q6J("ngForOf",t.data.Data),e.xp6(5),e.Oqu(e.lcZ(17,6,e.xi3(18,8,t.data.Data,"Sales"))),e.xp6(3),e.Q6J("ngIf",0==t.data.Compenents.length),e.xp6(1),e.Q6J("ngForOf",t.data.Compenents)}}const Gf=function(){return["/menu/Reports/Sales_Report/Advanced/Tax_Report"]};let Hf=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/GetTaxReportbyOutlet","ReportLoader/GetTaxReport",a),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),this.httpService=t,this.csvConverter=o,this.roleService=i}getComponent(t){return t.Component=[],this.data.Compenents.forEach((a,o)=>{a.SalesTax=0==o?t.Sales:this.data.Compenents[o-1].SalesTax,a.SalesTax=0==o?a.SalesTax:a.SalesTax+a.SalesTax*this.data.Compenents[o-1].Rate/100,t.Component[o]=a.SalesTax*a.Rate/100,a.SumTaxAmount=a.SumTaxAmount+t.Component[o]}),t.Component}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"Outlet":return this.compare(o.EntityName,i.EntityName,s);case"Sales":return this.compare(o.Sales,i.Sales,s);case"Tax":return this.compare(o.Tax,i.Tax,s);default:return 0}}):a}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(I._W),e.Y36(Z.O),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-tax-report-by-outlet"]],features:[e.qOj],decls:10,vars:8,consts:[[3,"pageData","text","hideSearchBox","textChange","onSubmit"],["matTooltipPosition","above","matTooltip","Tax Report By Outlet",1,"btn","btn-success","me-6",3,"routerLink"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload","me-4"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["bindLabel","Label","bindValue","ID","placeholder","Choose a Type",3,"ngModel","items","clearable","ngModelChange"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet",2,"width","150px"],["mat-sort-header","Sales","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],["style","width: 150px","class","text-end flex-right","mat-sort-header","Tax","arrowPosition","before",4,"ngIf"],["style","width: 150px","class","text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end","empty-column"],[1,"text-end","text-success"],["class","text-end text-success",4,"ngIf"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],["mat-sort-header","Tax","arrowPosition","before",1,"text-end","flex-right",2,"width","150px"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end",2,"width","150px"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.Number=i})("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions")(2,"a",1),e._uU(3,"Tax Report"),e.qZA(),e.YNc(4,Of,3,0,"a",2),e.qZA(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,Nf,16,7,"div",4),e.qZA()(),e.TgZ(8,"content"),e.YNc(9,Rf,21,11,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.Number)("hideSearchBox",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(7,Gf)),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,x.gM,f.YE,f.nU,S.qU,S.X6,p.JJ]})),n})();function Vf(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",5),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",6),e._uU(2," Export "),e.qZA()}}function Bf(n,r){if(1&n&&(e.TgZ(0,"span",15),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function Kf(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,Bf,2,2,"ng-template",10),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"From - To"),e.qZA(),e.TgZ(13,"div")(14,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(15,"div",12)(16,"datepicker",13),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()(),e.TgZ(17,"div")(18,"h6"),e._uU(19,"Sales Name"),e.qZA(),e.TgZ(20,"ng-select",14),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SalesID=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(6),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.SalesID)("items",null==t.pageData.Options?null:t.pageData.Options.Sales)}}const jf=function(){return["/menu/Products/Catalog/Variants/Info"]},zf=function(n){return{ID:n}};function Wf(n,r){if(1&n&&(e.TgZ(0,"tr",25)(1,"td")(2,"a",26),e._uU(3),e.qZA()(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"date"),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.ALo(11,"date"),e.qZA(),e.TgZ(12,"td",27),e._uU(13),e.ALo(14,"number"),e.qZA()()),2&n){const t=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(15,jf))("queryParams",e.VKq(16,zf,t.ID)),e.xp6(1),e.Oqu(t.Name),e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(t.LastSold?e.xi3(8,7,t.LastSold,"dd MMM yyyy"):"-"),e.xp6(3),e.Oqu(t.LastPurchased?e.xi3(11,10,t.LastPurchased,"dd MMM yyyy"):"-"),e.xp6(3),e.Oqu(e.lcZ(14,13,t.Quantity))}}function $f(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",16)(1,"table",17),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",18)(3,"tr")(4,"th",19),e._uU(5,"Name"),e.qZA(),e.TgZ(6,"th",20),e._uU(7,"Code"),e.qZA(),e.TgZ(8,"th",21),e._uU(9,"Last Sold"),e.qZA(),e.TgZ(10,"th",22),e._uU(11,"Last Purchased"),e.qZA(),e.TgZ(12,"th",23),e._uU(13,"Qty"),e.qZA()()(),e.TgZ(14,"tbody"),e.YNc(15,Wf,15,18,"tr",24),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(15),e.Q6J("ngForOf",t.data)}}let Xf=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/ProductLifeCycle","ReportLoader/ProductLifeCycle",s),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"toastrService",void 0),(0,l.Z)(this,"oriData",void 0),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.toastrService=s}sortData(t){const a=this.data.slice();this.data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction,c=typeof o[t.active];switch(C.gT.IsEmpty(o.Code)&&(o.Code=""),C.gT.IsEmpty(i.Code)&&(i.Code=""),C.gT.IsEmpty(o.LastPurchased)&&(o.LastPurchased=""),C.gT.IsEmpty(i.LastPurchased)&&(i.LastPurchased=""),C.gT.IsEmpty(o.LastPurchased)&&(o.LastSold=""),C.gT.IsEmpty(i.LastPurchased)&&(i.LastSold=""),c){case"string":return this.compare(o[t.active].toLocaleLowerCase(),i[t.active].toLocaleLowerCase(),s);case"number":return this.compare(o[t.active],i[t.active],s);default:return 0}}):this.oriData}preGetList(){this.pageData.Filter.EntityID||delete this.pageData.Filter.EntityID}postInit(t){this.oriData=t}openExportModal(){this.matDialog.open(M.H,{data:{title:"Product Life Cycle",exportTypes:[{ID:"ReportExport/ProductLifeCycle",Value:"Default",FileName:"Product Life Cycle"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw),e.Y36(I._W))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-product-life-cycle"]],features:[e.qOj],decls:8,vars:5,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales",3,"ngModel","items","ngModelChange"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["mat-sort-header","Code"],["mat-sort-header","LastSold"],["mat-sort-header","LastPurchased"],["mat-sort-header","Quantity","arrowPosition","before",1,"flex-right","text-end"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[3,"routerLink","queryParams"],[1,"text-end"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,Vf,3,0,"a",1),e.qZA(),e.TgZ(3,"filters")(4,"div",2),e.YNc(5,Kf,21,8,"div",3),e.qZA()(),e.TgZ(6,"content"),e.YNc(7,$f,16,1,"div",4),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,m.ir,A.QB,d.JJ,d.On,x.gM,f.YE,f.nU,p.JJ,p.uU]})),n})();function ex(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",5),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",6),e._uU(2," Export "),e.qZA()}}function tx(n,r){if(1&n&&(e.TgZ(0,"span",16),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function nx(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,tx,2,2,"ng-template",10),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"From - To"),e.qZA(),e.TgZ(13,"div")(14,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(15,"div",12)(16,"datepicker",13),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()(),e.TgZ(17,"div")(18,"h6"),e._uU(19,"Row Count"),e.qZA(),e.TgZ(20,"input",14),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.RowCount=o)}),e.qZA()(),e.TgZ(21,"div")(22,"h6"),e._uU(23,"Supplier"),e.qZA(),e.TgZ(24,"autocompleteV2",15),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SupplierID=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(6),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.RowCount),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.SupplierID)}}function ox(n,r){1&n&&(e.TgZ(0,"th",24),e._uU(1,"Total Cost"),e.qZA())}function ax(n,r){1&n&&(e.TgZ(0,"th",24),e._uU(1,"Total profit"),e.qZA())}function ix(n,r){if(1&n&&(e.TgZ(0,"td",33),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.TotalCost))}}function rx(n,r){if(1&n&&(e.TgZ(0,"td",30),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.TotalProfit))}}function lx(n,r){if(1&n&&(e.TgZ(0,"tr",28)(1,"td",29),e._uU(2),e.qZA(),e.TgZ(3,"td",29),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA(),e.TgZ(9,"td",30),e._uU(10),e.ALo(11,"number"),e.qZA(),e.TgZ(12,"td",30),e._uU(13),e.ALo(14,"number"),e.qZA(),e.TgZ(15,"td",30),e._uU(16),e.ALo(17,"number"),e.qZA(),e.YNc(18,ix,3,3,"td",31),e.YNc(19,rx,3,3,"td",32),e.TgZ(20,"td",30),e._uU(21),e.ALo(22,"number"),e.qZA()()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.PrevRank||"-"),e.xp6(2),e.Oqu(t.Rank),e.xp6(2),e.Oqu(t.Name),e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(11,10,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(14,12,t.UnitsInStock)),e.xp6(3),e.Oqu(e.lcZ(17,14,t.TotalAmount)),e.xp6(2),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",a.roleService.report.Profit),e.xp6(2),e.Oqu(e.lcZ(22,16,t.Margin))}}function sx(n,r){if(1&n&&(e.TgZ(0,"td",36),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Oqu(e.lcZ(2,1,e.xi3(3,3,t.data,"TotalCost")))}}function px(n,r){if(1&n&&(e.TgZ(0,"td",36),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Oqu(e.lcZ(2,1,e.xi3(3,3,t.data,"TotalProfit")))}}function cx(n,r){if(1&n&&(e.TgZ(0,"tfoot")(1,"tr",34),e._UZ(2,"td",35),e.TgZ(3,"td",36),e._uU(4,"Total:"),e.qZA(),e.TgZ(5,"td",36),e._uU(6),e.ALo(7,"number"),e.ALo(8,"sum"),e.qZA(),e.TgZ(9,"td",36),e._uU(10),e.ALo(11,"number"),e.ALo(12,"sum"),e.qZA(),e.TgZ(13,"td",36),e._uU(14),e.ALo(15,"number"),e.ALo(16,"sum"),e.qZA(),e.YNc(17,sx,4,6,"td",37),e.YNc(18,px,4,6,"td",37),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(6),e.Oqu(e.lcZ(7,5,e.xi3(8,7,t.data,"Quantity"))),e.xp6(4),e.Oqu(e.lcZ(11,10,e.xi3(12,12,t.data,"UnitsInStock"))),e.xp6(4),e.Oqu(e.lcZ(15,15,e.xi3(16,17,t.data,"TotalAmount"))),e.xp6(3),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.report.Profit)}}function dx(n,r){if(1&n&&(e.TgZ(0,"div",17)(1,"div",18)(2,"table",19)(3,"thead",20)(4,"tr")(5,"th",21),e._uU(6,"Prev"),e.qZA(),e.TgZ(7,"th",21),e._uU(8,"Now"),e.qZA(),e.TgZ(9,"th",22),e._uU(10,"Name"),e.qZA(),e.TgZ(11,"th",23),e._uU(12,"Code"),e.qZA(),e.TgZ(13,"th",21),e._uU(14,"Sold"),e.qZA(),e.TgZ(15,"th",24),e._uU(16,"Inventory"),e.qZA(),e.TgZ(17,"th",24),e._uU(18,"Total Amount"),e.qZA(),e.YNc(19,ox,2,0,"th",25),e.YNc(20,ax,2,0,"th",25),e.TgZ(21,"th",24),e._uU(22,"%"),e.qZA()()(),e.TgZ(23,"tbody"),e.YNc(24,lx,23,18,"tr",26),e.qZA(),e.YNc(25,cx,19,20,"tfoot",27),e.qZA()()()),2&n){const t=e.oxw();e.xp6(19),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.report.Profit),e.xp6(4),e.Q6J("ngForOf",t.data.Data),e.xp6(1),e.Q6J("ngIf",t.data.length>0)}}let ux=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/GetReportProductProfit","ReportLoader/GetReportProductProfit",s),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"toastrService",void 0),(0,l.Z)(this,"RadioGroupBy",[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}]),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.toastrService=s}openExportModal(){this.matDialog.open(M.H,{data:{title:"Product Profit Report",exportTypes:[{ID:"ReportExport/GetReportProductProfit",Value:"Default",FileName:"Product Profit Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw),e.Y36(I._W))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-product-profit"]],features:[e.qOj],decls:8,vars:5,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["type","text",1,"form-control",3,"ngModel","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","100px"],[2,"width","600px"],[2,"width","100px"],[1,"text-end",2,"width","200px"],["style","width: 200px","class","text-end",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"border-bottom"],[1,"text-end",2,"width","35px"],[1,"text-end","text-success"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[1,"text-end","text-danger"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-end"],["class","text-end",4,"ngIf"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,ex,3,0,"a",1),e.qZA(),e.TgZ(3,"filters")(4,"div",2),e.YNc(5,nx,25,8,"div",3),e.qZA()(),e.TgZ(6,"content"),e.YNc(7,dx,26,4,"div",4),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,m.w9,m.ir,A.QB,d.Fj,d.JJ,d.On,x.gM,E.J,S.qU,p.JJ]})),n})();function _x(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",5),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",6),e._uU(2," Export "),e.qZA()}}function mx(n,r){if(1&n&&(e.TgZ(0,"span",14),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function gx(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,mx,2,2,"ng-template",10),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"From - To"),e.qZA(),e.TgZ(13,"div")(14,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(15,"div",12)(16,"datepicker",13),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(6),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}const hx=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},fx=function(n){return{ID:n}};function xx(n,r){if(1&n&&(e.TgZ(0,"tr",19)(1,"td")(2,"a",20),e._uU(3),e.qZA()(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"number"),e.qZA()()),2&n){const t=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(11,hx))("queryParams",e.VKq(12,fx,t.ID)),e.xp6(1),e.Oqu(t.InvoiceNumber),e.xp6(2),e.Oqu(t.Name),e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(10,7,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(13,9,t.Price))}}function Tx(n,r){if(1&n&&(e.TgZ(0,"div",15)(1,"table",16)(2,"thead",17)(3,"tr")(4,"th"),e._uU(5,"Number"),e.qZA(),e.TgZ(6,"th"),e._uU(7,"Name"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Code"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Quantity"),e.qZA(),e.TgZ(12,"th"),e._uU(13,"Price"),e.qZA()()(),e.TgZ(14,"tbody"),e.YNc(15,xx,14,14,"tr",18),e.qZA()()()),2&n){const t=e.oxw();e.xp6(15),e.Q6J("ngForOf",t.data.Data)}}let Cx=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/GetExchangedSales","ReportLoader/GetExchangedSales",s),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"toastrService",void 0),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.toastrService=s}openExportModal(){this.matDialog.open(M.H,{data:{title:"Exchanged Sales Report",exportTypes:[{ID:"ReportExport/GetExchangedSales",Value:"Default",FileName:"Exchanged Sales Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw),e.Y36(I._W))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-exchanged-sales"]],features:[e.qOj],decls:8,vars:5,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[3,"routerLink","queryParams"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,_x,3,0,"a",1),e.qZA(),e.TgZ(3,"filters")(4,"div",2),e.YNc(5,gx,17,6,"div",3),e.qZA()(),e.TgZ(6,"content"),e.YNc(7,Tx,16,1,"div",4),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,m.ir,A.QB,d.JJ,d.On,x.gM,p.JJ]})),n})();function Zx(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",5),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",6),e._uU(2," Export "),e.qZA()}}function Dx(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Product"),e.qZA(),e.TgZ(3,"autocompleteV2",15),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ProductID=o)}),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(3),e.Q6J("ngModel",t.pageData.Filter.ProductID)}}function vx(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Product"),e.qZA(),e.TgZ(3,"autocompleteV2",16),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.ProductID=o)}),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(3),e.Q6J("ngModel",t.pageData.Filter.ProductID)}}function bx(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"From - To"),e.qZA(),e.TgZ(8,"div")(9,"datepicker",9),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(10,"div",10)(11,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()(),e.YNc(12,Dx,4,1,"div",12),e.YNc(13,vx,4,1,"div",12),e.TgZ(14,"div")(15,"h6"),e._uU(16,"Search By"),e.qZA(),e.TgZ(17,"radio-options",13),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SearchBy=o)}),e.qZA()(),e.TgZ(18,"div")(19,"h6"),e._uU(20,"Row Count"),e.qZA(),e.TgZ(21,"input",14),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.RowCount=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(1),e.Q6J("ngIf",t.pageData.Filter.SearchBy),e.xp6(1),e.Q6J("ngIf",!t.pageData.Filter.SearchBy),e.xp6(4),e.Q6J("model",t.pageData.Filter.SearchBy)("options",t.RadioSearchBy),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.RowCount)}}function yx(n,r){if(1&n&&(e.TgZ(0,"tr",24)(1,"td",25),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td",25),e._uU(6),e.ALo(7,"number"),e.qZA(),e.TgZ(8,"td",26),e._uU(9),e.ALo(10,"number"),e.qZA()()),2&n){const t=r.$implicit;e.xp6(2),e.Oqu(t.Rank),e.xp6(2),e.Oqu(t.Name),e.xp6(2),e.Oqu(e.lcZ(7,4,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(10,6,t.UnitsInStock))}}function Sx(n,r){if(1&n&&(e.TgZ(0,"div",17)(1,"table",18)(2,"thead",19)(3,"tr")(4,"th",20),e._uU(5,"Rank"),e.qZA(),e.TgZ(6,"th",21),e._uU(7,"Name"),e.qZA(),e.TgZ(8,"th",22),e._uU(9,"Sold"),e.qZA(),e.TgZ(10,"th",22),e._uU(11,"Inventory"),e.qZA()()(),e.TgZ(12,"tbody"),e.YNc(13,yx,11,8,"tr",23),e.qZA()()()),2&n){const t=e.oxw();e.xp6(13),e.Q6J("ngForOf",t.data.Data)}}let Ax=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/GetSalesRankByVariantModel","ReportLoader/GetSalesRankByVariantModel",s),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"toastrService",void 0),(0,l.Z)(this,"RadioSearchBy",[{Key:!0,Value:"Name"},{Key:!1,Value:"Code"}]),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.toastrService=s}openExportModal(){this.matDialog.open(M.H,{data:{title:"Variant Model Rank Report",exportTypes:[{ID:"ReportExport/GetSalesRankByVariantModel",Value:"Default",FileName:"Variant Model Rank Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw),e.Y36(I._W))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-variant-model-rank"]],features:[e.qOj],decls:8,vars:5,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],[4,"ngIf"],["name","Search By",3,"model","options","modelChange"],["type","text",1,"form-control",3,"ngModel","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetProductSuggestionByCode",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","70px"],[2,"width","800px"],[1,"text-end",2,"width","100px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[1,"text-end"],[1,"text-success","text-end"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,Zx,3,0,"a",1),e.qZA(),e.TgZ(3,"filters")(4,"div",2),e.YNc(5,bx,22,9,"div",3),e.qZA()(),e.TgZ(6,"content"),e.YNc(7,Sx,14,1,"div",4),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,m.w9,A.QB,d.Fj,d.JJ,d.On,q.P,E.J,p.JJ]})),n})();function wx(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",7),e._uU(2," Export"),e.qZA()}}function Fx(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",8)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"From - To"),e.qZA(),e.TgZ(8,"div")(9,"datepicker",10),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(10,"div",11)(11,"datepicker",12),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Discount(%) From / To"),e.qZA(),e.TgZ(15,"div",13)(16,"div",14)(17,"input",15),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.DiscountFrom=o)}),e.qZA()(),e.TgZ(18,"div",16)(19,"input",15),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.DiscountTo=o)}),e.qZA()()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(6),e.Q6J("ngModel",t.pageData.Filter.DiscountFrom),e.xp6(2),e.Q6J("ngModel",t.pageData.Filter.DiscountTo)}}const Mx=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},qx=function(n){return{ID:n}};function Ix(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td",24),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td")(7,"a",28),e._uU(8),e.qZA()(),e.TgZ(9,"td",24),e._uU(10),e.ALo(11,"number"),e.qZA(),e.TgZ(12,"td",24),e._uU(13),e.ALo(14,"number"),e.qZA(),e.TgZ(15,"td",24),e._uU(16),e.ALo(17,"number"),e.qZA(),e.TgZ(18,"td",24),e._uU(19),e.ALo(20,"number"),e.qZA(),e.TgZ(21,"td",24),e._uU(22),e.ALo(23,"number"),e.qZA(),e.TgZ(24,"td",24),e._uU(25),e.ALo(26,"number"),e.qZA()()),2&n){const t=r.$implicit;e.xp6(2),e.Oqu(t.VariantName),e.xp6(2),e.Oqu(e.lcZ(5,11,t.Quantity)),e.xp6(3),e.Q6J("routerLink",e.DdM(25,Mx))("queryParams",e.VKq(26,qx,t.InvoiceID)),e.xp6(1),e.Oqu(t.Number),e.xp6(2),e.Oqu(e.lcZ(11,13,t.ItemDiscount)),e.xp6(3),e.Oqu(e.lcZ(14,15,t.OrderDiscount)),e.xp6(3),e.Oqu(e.lcZ(17,17,t.OrderDiscount2)),e.xp6(3),e.Oqu(e.lcZ(20,19,t.OrderDiscountAmount)),e.xp6(3),e.Oqu(e.lcZ(23,21,t.UnitPrice)),e.xp6(3),e.Oqu(e.lcZ(26,23,t.NetSales))}}function Px(n,r){if(1&n&&(e.TgZ(0,"div",17)(1,"div",18)(2,"table",19)(3,"thead",20)(4,"tr")(5,"th"),e._uU(6,"Name"),e.qZA(),e.TgZ(7,"th",21),e._uU(8,"Qty"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Number"),e.qZA(),e.TgZ(11,"th",22),e._uU(12,"Item %"),e.qZA(),e.TgZ(13,"th",22),e._uU(14,"Order %"),e.qZA(),e.TgZ(15,"th",22),e._uU(16,"Order2 %"),e.qZA(),e.TgZ(17,"th",23),e._uU(18,"Order % Amount"),e.qZA(),e.TgZ(19,"th",23),e._uU(20,"Unit Price"),e.qZA(),e.TgZ(21,"th",24),e._uU(22,"Total"),e.qZA()()(),e.TgZ(23,"tbody"),e.YNc(24,Ix,27,28,"tr",25),e.qZA(),e.TgZ(25,"tfoot")(26,"tr",26)(27,"td",24),e._uU(28,"Total : "),e.qZA(),e.TgZ(29,"td",24),e._uU(30),e.ALo(31,"number"),e.ALo(32,"sum"),e.qZA(),e.TgZ(33,"td",27),e._uU(34),e.ALo(35,"number"),e.ALo(36,"sum"),e.qZA(),e.TgZ(37,"td",24),e._uU(38),e.ALo(39,"number"),e.ALo(40,"sum"),e.qZA()()()()()()),2&n){const t=e.oxw();e.xp6(24),e.Q6J("ngForOf",t.data.Data),e.xp6(6),e.Oqu(e.lcZ(31,4,e.xi3(32,6,t.data.Data,"Quantity"))),e.xp6(4),e.Oqu(e.lcZ(35,9,e.xi3(36,11,t.data.Data,"UnitPrice"))),e.xp6(4),e.Oqu(e.lcZ(39,14,e.xi3(40,16,t.data.Data,"NetSales")))}}const Nx=function(){return["/menu/Reports/Sales_Report/Standard/Discounted_Sales/Discounted_Products"]};let Jx=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/GetDiscountsales","ReportLoader/GetDiscountSales"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),this.httpService=t,this.csvConverter=a,this.reportFilterService=o,this.roleService=i,this.matDialog=s}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}openExportModal(){this.matDialog.open(M.H,{data:{title:"Discounted Sales",exportTypes:[{ID:"ReportExport/GetDiscountsales",Value:"Default",FileName:"Discounted Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(N.z),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-discounted-sales"]],features:[e.qOj],decls:10,vars:7,consts:[[3,"pageData","text","textChange","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pe-2"],["type","text","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],[1,"col-6","ps-2"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-end",2,"width","25px"],[1,"text-end",2,"width","100px"],[1,"text-end",2,"width","150px"],[1,"text-end"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","6",1,"text-end"],[3,"routerLink","queryParams"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.Number=i})("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,wx,3,0,"button",1),e.TgZ(3,"a",2),e._uU(4,"Discounted Products"),e.qZA()(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,Fx,20,7,"div",4),e.qZA()(),e.TgZ(8,"content"),e.YNc(9,Px,41,19,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.Number),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(6,Nx)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.Fj,d.JJ,d.On,U.b,S.qU,p.JJ]})),n})();function Lx(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",5),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.exportCSV(o.csvConverter,"ReportExport/SalesReturnExport",o.menuData.H+".csv"))}),e._UZ(1,"i",6),e._uU(2,"Export"),e.qZA()}}function Ux(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Customer"),e.qZA(),e.TgZ(8,"autocompleteV2",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CustomerID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"From - To"),e.qZA(),e.TgZ(12,"div")(13,"datepicker",10),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(14,"div",11)(15,"datepicker",12),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CustomerID),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}const Qx=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},kx=function(n){return{ID:n}};function Ex(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"a",23),e._uU(5),e.qZA()(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"date"),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.qZA(),e.TgZ(13,"td",18),e._uU(14),e.ALo(15,"number"),e.qZA(),e.TgZ(16,"td",18),e._uU(17),e.ALo(18,"number"),e.qZA(),e.TgZ(19,"td",24),e._uU(20),e.qZA(),e.TgZ(21,"td",18),e._uU(22),e.ALo(23,"number"),e.qZA()()),2&n){const t=r.$implicit;e.xp6(2),e.Oqu(t.EntityName),e.xp6(2),e.Q6J("routerLink",e.DdM(20,Qx))("queryParams",e.VKq(21,kx,t.InvoiceID)),e.xp6(1),e.Oqu(t.Number),e.xp6(2),e.Oqu(e.xi3(8,11,t.Date,"dd MMM yyyy")),e.xp6(3),e.Oqu(t.Name),e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.hij("(",e.lcZ(15,14,t.Quantity),")"),e.xp6(3),e.Oqu(e.lcZ(18,16,t.UnitPrice)),e.xp6(3),e.hij("",t.Discount&&0!=t.Discount?-t.Discount+"%":""," "),e.xp6(2),e.hij("(",e.lcZ(23,18,t.Total),")")}}function Yx(n,r){if(1&n&&(e.TgZ(0,"div",13)(1,"div",14)(2,"table",15)(3,"thead",16)(4,"tr")(5,"th"),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",17),e._uU(8,"Number"),e.qZA(),e.TgZ(9,"th"),e._uU(10,"Date"),e.qZA(),e.TgZ(11,"th"),e._uU(12,"Name"),e.qZA(),e.TgZ(13,"th"),e._uU(14,"Code"),e.qZA(),e.TgZ(15,"th",18),e._uU(16,"Quantity"),e.qZA(),e.TgZ(17,"th",18),e._uU(18),e.qZA(),e.TgZ(19,"th",19),e._uU(20,"%"),e.qZA(),e.TgZ(21,"th",18),e._uU(22),e.qZA()()(),e.TgZ(23,"tbody"),e.YNc(24,Ex,24,23,"tr",20),e.qZA(),e.TgZ(25,"tfoot")(26,"tr",21),e._UZ(27,"td",22)(28,"td",22)(29,"td",22)(30,"td",22)(31,"td",22),e.TgZ(32,"td",18),e._uU(33),e.ALo(34,"number"),e.ALo(35,"sum"),e.qZA(),e._UZ(36,"td",22)(37,"td",22),e.TgZ(38,"td",18),e._uU(39),e.ALo(40,"number"),e.ALo(41,"sum"),e.qZA()()()()()()),2&n){const t=e.oxw();e.xp6(18),e.hij("Price (",t.data.CurrencySymbol,")"),e.xp6(4),e.hij("Total(",t.data.CurrencySymbol,")"),e.xp6(2),e.Q6J("ngForOf",t.data.Data),e.xp6(9),e.Oqu(e.lcZ(34,5,e.xi3(35,7,t.data.Data,"Quantity"))),e.xp6(6),e.Oqu(e.lcZ(40,10,e.xi3(41,12,t.data.Data,"Total")))}}let Rx=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/SalesReturnList","ReportLoader/ReturnReportLoader",a),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"month",void 0),(0,l.Z)(this,"year",void 0),this.httpService=t,this.csvConverter=o,this.roleService=i}postInit(t){this.menuData.H=t.PageTitle}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(I._W),e.Y36(Z.O),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-sales-return"]],features:[e.qOj],decls:8,vars:5,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload","me-4"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-end"],[2,"width","30px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[3,"routerLink","queryParams"],[1,"text-danger"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,Lx,3,0,"a",1),e.qZA(),e.TgZ(3,"filters")(4,"div",2),e.YNc(5,Ux,16,5,"div",3),e.qZA()(),e.TgZ(6,"content"),e.YNc(7,Yx,42,15,"div",4),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,x.gM,E.J,S.qU,p.JJ,p.uU]})),n})();function Gx(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",18),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.exportCSV(o.csvConverter,"ReportExport/PurchaseReturnList",o.data.PageTitle+".csv"))}),e._UZ(1,"i",19),e._uU(2,"Export"),e.qZA()}}function Hx(n,r){if(1&n&&(e._UZ(0,"td",42),e.ALo(1,"number")),2&n){const t=e.oxw().$implicit;e.Q6J("innerHtml",e.lcZ(1,1,t.UnitCost),e.oJD)}}function Vx(n,r){if(1&n&&(e.TgZ(0,"tr",32)(1,"td",33),e._UZ(2,"span",34)(3,"span",35),e.ALo(4,"newlines"),e.qZA(),e._UZ(5,"td",36),e.TgZ(6,"td",37),e._uU(7),e.ALo(8,"number"),e.qZA(),e._UZ(9,"td",38),e.YNc(10,Hx,2,3,"td",39),e._UZ(11,"td",40),e.ALo(12,"number"),e.TgZ(13,"td",41),e._uU(14),e.qZA(),e._UZ(15,"td",40),e.ALo(16,"number"),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(3);e.xp6(2),e.Q6J("innerHtml",t.Name,e.oJD),e.xp6(1),e.Q6J("innerHtml",e.lcZ(4,9,t.Note),e.oJD),e.xp6(2),e.Q6J("innerHtml",t.Code,e.oJD),e.xp6(2),e.hij("(",e.lcZ(8,11,t.Quantity),")"),e.xp6(2),e.Q6J("innerHtml",t.UOMName,e.oJD),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(1),e.Q6J("innerHtml",e.lcZ(12,13,t.UnitPrice),e.oJD),e.xp6(3),e.hij(" ",0==t.Discount?"":"-"+t.Discount+"%",""),e.xp6(1),e.Q6J("innerHtml",e.lcZ(16,15,t.Total),e.oJD)}}const Bx=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},Kx=function(n){return{ID:n}};function jx(n,r){if(1&n&&(e.TgZ(0,"div")(1,"div",20)(2,"a",21),e._UZ(3,"span",22),e.ALo(4,"date"),e.ALo(5,"date"),e.qZA(),e.TgZ(6,"span"),e._uU(7),e.ALo(8,"showIfNotNullOrEmptyString"),e.qZA()(),e.TgZ(9,"div",23)(10,"div")(11,"table",24),e._UZ(12,"thead"),e.TgZ(13,"tbody"),e.YNc(14,Vx,17,17,"tr",25),e.qZA()()()(),e.TgZ(15,"table",26)(16,"thead")(17,"tr",27)(18,"td",28),e._uU(19,"Total"),e.qZA(),e.TgZ(20,"td",29),e._uU(21,"\xa0"),e.qZA(),e.TgZ(22,"td",14),e._uU(23),e.ALo(24,"number"),e.qZA(),e._UZ(25,"td",30),e.TgZ(26,"td",29),e._uU(27,"\xa0"),e.qZA(),e.TgZ(28,"td",31),e._uU(29,"\xa0"),e.qZA(),e.TgZ(30,"td",14),e._uU(31),e.ALo(32,"number"),e.qZA()()()()()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Q6J("routerLink",e.DdM(20,Bx))("queryParams",e.VKq(21,Kx,t.InvoiceID)),e.xp6(1),e.Q6J("innerHtml",t.EntityName+" #"+t.Number+" - "+e.xi3(4,7,t.Date,"dd MMM yyyy")+" ("+e.xi3(5,10,t.Created,"HH:mm")+") : ",e.oJD),e.xp6(4),e.hij(" ",e.xi3(8,13,t.CustomerNameDisplay," - {0}")," "),e.xp6(7),e.Q6J("ngForOf",t.Item),e.xp6(9),e.hij("",e.lcZ(24,16,a.data.Quantity),"\xa0"),e.xp6(8),e.hij("",e.lcZ(32,18,a.data.TotalPrice),"\xa0")}}function zx(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel-cmp",1),e.NdJ("onSubmit",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.searchFromPageOne())}),e.TgZ(1,"actions"),e.YNc(2,Gx,3,0,"a",2),e.qZA(),e.TgZ(3,"filters")(4,"div",3)(5,"div",4)(6,"div")(7,"h6"),e._uU(8,"Outlet"),e.qZA(),e.TgZ(9,"ng-select",5),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Supplier"),e.qZA(),e.TgZ(13,"autocompleteV2",6),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SupplierID=o)}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"From - To"),e.qZA(),e.TgZ(17,"div")(18,"datepicker",7),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(19,"div",8)(20,"datepicker",9),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()()()()(),e.TgZ(21,"content")(22,"div",10)(23,"table",11)(24,"thead",12)(25,"tr")(26,"th"),e._uU(27,"Name"),e.qZA(),e.TgZ(28,"th",13),e._uU(29,"Code"),e.qZA(),e.TgZ(30,"th",14),e._uU(31,"Quantity"),e.qZA(),e._UZ(32,"th",15),e.TgZ(33,"th",14),e._uU(34,"Unit Price(Rp.)"),e.qZA(),e.TgZ(35,"th",16),e._uU(36,"%"),e.qZA(),e.TgZ(37,"th",14),e._uU(38,"Total(Rp.)"),e.qZA()()()(),e.YNc(39,jx,33,23,"div",17),e.qZA()()()}if(2&n){const t=e.oxw();e.Q6J("pageData",t.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",t.roleService.global.Export),e.xp6(7),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.SupplierID),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(19),e.Q6J("ngForOf",t.data.Data)}}let Wx=(()=>{class n extends D.n{constructor(t,a,o){super(t,"Report/PurchaseReturnList","ReportLoader/ReturnReportLoader"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),this.httpService=t,this.csvConverter=a,this.roleService=o}preGetList(){null===this.pageData.Filter.EntityID&&(this.pageData.Filter.EntityID=C.gT.GuidEmpty)}postInit(){this.menuData.H=this.data.PageTitle}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-purchase-return"]],features:[e.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"d-flex"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],[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%"],[4,"ngFor","ngForOf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"mt-7","ms-5"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHtml"],[1,"items"],["cellspacing","0",1,"table","table-sm"],["class","border-top",4,"ngFor","ngForOf"],[1,"w-100"],[1,"table-footer"],[1,"empty-column"],[1,"empty-column",2,"width","10%"],[1,"empty-column",2,"width","50px"],[1,"empty-column",2,"width","5%"],[1,"border-top"],[1,"border-start","border-end"],[3,"innerHtml"],[1,"list-unstyled",3,"innerHtml"],[1,"border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"text-end","border-start","border-end",2,"width","10%"],[1,"UOMWidth","border-start","border-end",2,"width","50px",3,"innerHtml"],["class","text-end alt border-start border-end","style","width: 80px;",3,"innerHtml",4,"ngIf"],[1,"text-end","border-start","border-end",2,"width","10%",3,"innerHtml"],[1,"small","text-danger","border-start","border-end",2,"width","5%"],[1,"text-end","alt","border-start","border-end",2,"width","80px",3,"innerHtml"]],template:function(t,a){1&t&&e.YNc(0,zx,40,9,"mainpanel-cmp",0),2&t&&e.Q6J("ngIf",a.data)},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,x.gM,E.J,S.sH,S.WV,p.JJ,p.uU]})),n})();function $x(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",9),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.exportCSV(o.csvConverter,"Report/ProductSalesByInvoice","Invoice_Item_Details.csv"))}),e._UZ(1,"i",10),e._uU(2," Export"),e.qZA()}}function Xx(n,r){if(1&n&&(e.TgZ(0,"span",18),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function eT(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",11)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",12),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.EntityID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",13),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,Xx,2,2,"ng-template",14),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Sales"),e.qZA(),e.TgZ(13,"ng-select",15),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SalesID=o)}),e.qZA()(),e.TgZ(14,"div")(15,"h6"),e._uU(16,"Customer"),e.qZA(),e.TgZ(17,"autocompleteV2",16),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CustomerID=o)}),e.qZA()(),e.TgZ(18,"div")(19,"h6"),e._uU(20,"Page Size"),e.qZA(),e.TgZ(21,"input",17),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.PageSize=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.EntityID)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(5),e.Q6J("ngModel",t.pageData.Filter.SalesID)("items",null==t.pageData.Options?null:t.pageData.Options.Sales),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CustomerID),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.PageSize)}}function tT(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",19)(1,"div")(2,"h6"),e._uU(3,"From - To"),e.qZA(),e.TgZ(4,"div")(5,"datepicker",20),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(6,"div",21)(7,"datepicker",22),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()(),e.TgZ(8,"div")(9,"h6"),e._uU(10,"Product"),e.qZA(),e.TgZ(11,"autocompleteV2",23),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ProductID=o)}),e.qZA()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Variant"),e.qZA(),e.TgZ(15,"autocompleteV2",24),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.VariantID=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("inputTextValue",t.pageData.Filter.ProductName)("ngModel",t.pageData.Filter.ProductID),e.xp6(4),e.Q6J("inputTextValue",t.pageData.Filter.VariantName)("ngModel",t.pageData.Filter.VariantID)}}function nT(n,r){1&n&&(e.TgZ(0,"th",41),e._uU(1," Cost "),e.qZA())}function oT(n,r){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(t.Name)}}function aT(n,r){if(1&n&&(e.TgZ(0,"td",45),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.UnitCost))}}function iT(n,r){1&n&&(e.TgZ(0,"span"),e._uU(1,"%"),e.qZA())}function rT(n,r){if(1&n&&(e.TgZ(0,"div"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.DiscountAmount))}}const lT=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},sT=function(n){return{ID:n}};function pT(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.ALo(5,"date"),e.qZA(),e.TgZ(6,"td")(7,"a",42),e._uU(8),e.qZA()(),e.TgZ(9,"td"),e.YNc(10,oT,2,1,"span",40),e._UZ(11,"span",43),e.TgZ(12,"i",44),e._uU(13),e.qZA()(),e.TgZ(14,"td"),e._uU(15),e.qZA(),e.TgZ(16,"td"),e._uU(17),e.qZA(),e.TgZ(18,"td",45),e._uU(19),e.ALo(20,"number"),e.qZA(),e.YNc(21,aT,3,3,"td",46),e.TgZ(22,"td",45),e._uU(23),e.ALo(24,"number"),e.qZA(),e.TgZ(25,"td",47)(26,"div"),e._uU(27),e.ALo(28,"number"),e.YNc(29,iT,2,0,"span",40),e.qZA(),e.YNc(30,rT,3,3,"div",40),e.qZA(),e.TgZ(31,"td",45),e._uU(32),e.ALo(33,"number"),e.qZA()()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Oqu(e.xi3(5,17,t.Date,"dd MMM yy")),e.xp6(3),e.Q6J("routerLink",e.DdM(28,lT))("queryParams",e.VKq(29,sT,t.InvoiceID)),e.xp6(1),e.Oqu(t.Number),e.xp6(2),e.Q6J("ngIf",""===a.pageData.Filter.ProductName||""===a.pageData.Filter.VariantName),e.xp6(1),e.Q6J("innerHtml",t.Note,e.oJD),e.xp6(2),e.Oqu(t.NoteOrder),e.xp6(2),e.Oqu(t.CustomerName),e.xp6(2),e.Oqu(t.SalesPerson),e.xp6(2),e.Oqu(e.lcZ(20,20,t.Quantity)),e.xp6(2),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(2),e.Oqu(e.lcZ(24,22,t.UnitPrice)),e.xp6(4),e.Oqu(0==t.Discount?"":e.lcZ(28,24,t.Discount)),e.xp6(2),e.Q6J("ngIf",t.Discount),e.xp6(1),e.Q6J("ngIf",0!=t.DiscountAmount),e.xp6(2),e.Oqu(e.lcZ(33,26,t.Total))}}function cT(n,r){1&n&&e._UZ(0,"td",52)}function dT(n,r){if(1&n&&(e.TgZ(0,"tfoot")(1,"tr",48)(2,"td",49),e._uU(3,"Total:"),e.qZA(),e.TgZ(4,"td",45),e._uU(5),e.ALo(6,"number"),e.ALo(7,"sum"),e.qZA(),e.YNc(8,cT,1,0,"td",50),e._UZ(9,"td",51),e.TgZ(10,"td",45),e._uU(11),e.ALo(12,"number"),e.ALo(13,"sum"),e.qZA()()()),2&n){const t=e.oxw(2);e.xp6(5),e.Oqu(e.lcZ(6,3,e.xi3(7,5,t.data.Data,"Quantity"))),e.xp6(3),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(3),e.Oqu(e.lcZ(12,8,e.xi3(13,10,t.data.Data,"Total")))}}function uT(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",25)(1,"table",26),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",27)(3,"tr")(4,"th",28),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"th",29),e._uU(7,"Date"),e.qZA(),e.TgZ(8,"th",30),e._uU(9,"Invoice #"),e.qZA(),e.TgZ(10,"th",31),e._uU(11,"Product / Note"),e.qZA(),e.TgZ(12,"th",32),e._uU(13,"Customer"),e.qZA(),e.TgZ(14,"th",33),e._uU(15,"SALES PERSON"),e.qZA(),e.TgZ(16,"th",34),e._uU(17,"Qty"),e.qZA(),e.YNc(18,nT,2,0,"th",35),e.TgZ(19,"th",36),e._uU(20,"Price"),e.qZA(),e.TgZ(21,"th",37),e._uU(22,"Disc."),e.qZA(),e.TgZ(23,"th",38),e._uU(24,"Total"),e.qZA()()(),e.TgZ(25,"tbody"),e.YNc(26,pT,34,31,"tr",39),e.qZA(),e.YNc(27,dT,14,13,"tfoot",40),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(18),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(8),e.Q6J("ngForOf",t.data.Data),e.xp6(1),e.Q6J("ngIf",t.data.Data.length>0)}}const _T=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]};let mT=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/ProductSalesByInvoice","ReportLoader/ProductSalesByInvoice",null,o),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"activatedRoute",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"originalData",void 0),(0,l.Z)(this,"hideMore",!0),this.httpService=t,this.csvConverter=a,this.activatedRoute=o,this.roleService=i}postInit(t){this.menuData.H=this.pageData.PageTitle,this.originalData=t.Data}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"Outlet":return this.compare(o.Outlet,i.Outlet,s);case"Date":return this.compare(o.Date,i.Date,s);case"Number":return this.compare(o.Number,i.Number,s);case"Note":return this.compare(o.Note,i.Note,s);case"CustomerName":return this.compare(o.CustomerName,i.CustomerName,s);case"SalesPerson":return this.compare(o.SalesPerson,i.SalesPerson,s);case"UnitCost":return this.compare(o.UnitCost,i.UnitCost,s);case"UnitPrice":return this.compare(o.UnitPrice,i.UnitPrice,s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);case"Discount":return this.compare(o.Discount,i.Discount,s);case"Total":return this.compare(o.TotalAfterDiscount,i.TotalAfterDiscount,s);default:return 0}}):this.originalData}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(h.gz),e.Y36(b.N))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-invoice-items"]],features:[e.qOj],decls:14,vars:9,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","matTooltipPosition","above","matTooltip","Export","class","btn btn-outline-secondary me-6",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ms-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fa-solid","fa-caret-down"],["class","container-fluid mt-5",4,"ngIf"],["role","button","matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["bindLabel","Name","bindValue","ID","placeholder","Choose a Sales",3,"ngModel","items","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["type","text","autoNum","","min","0",1,"w-100",3,"ngModel","ngModelChange"],["matTooltipPosition","above",3,"matTooltip"],["id","more-filter","container","",1,"ms-6"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["requestUrl","/API/AC/GetProductSuggestionByCodeNName",1,"w-100",3,"inputTextValue","ngModel","ngModelChange"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"w-100",3,"inputTextValue","ngModel","ngModelChange"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Outlet","width","100px",1,"align-left"],["mat-sort-header","Date",1,"align-left",2,"width","80px"],["mat-sort-header","Number",1,"align-left",2,"width","120px"],["mat-sort-header","Note",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","style","width: 120px;","arrowPosition","before","class","flex-right",4,"ngIf"],["mat-sort-header","UnitPrice","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","45px"],["mat-sort-header","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],[4,"ngFor","ngForOf"],[4,"ngIf"],["mat-sort-header","UnitCost","arrowPosition","before",1,"flex-right",2,"width","120px"],["target","_blank",3,"routerLink","queryParams"],[2,"word-break","break-all",3,"innerHtml"],[1,"text-info"],[1,"text-end"],["class","text-end",4,"ngIf"],[1,"text-end","text-danger"],[1,"table-footer"],["colspan","6",1,"text-end","empty-column"],["class","empty-column",4,"ngIf"],["colspan","2",1,"empty-column"],[1,"empty-column"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.Number=i})("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,$x,3,0,"a",1),e.TgZ(3,"a",2),e._uU(4,"Group by Product"),e.qZA()(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,eT,22,8,"div",4),e.YNc(8,tT,16,6,"div",5),e.qZA(),e.TgZ(9,"a",6),e.NdJ("click",function(){return a.hideMore=!a.hideMore}),e._uU(10),e._UZ(11,"i",7),e.qZA()(),e.TgZ(12,"content"),e.YNc(13,uT,28,3,"div",8),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.Number),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(8,_T)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(1),e.Q6J("ngIf",!a.hideMore),e.xp6(2),e.hij("",a.hideMore?"More":"Less"," "),e.xp6(3),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,m.ir,A.QB,d.Fj,d.JJ,d.On,x.gM,f.YE,f.nU,U.b,E.J,S.qU,p.JJ,p.uU]})),n})();function gT(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",7),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",8),e._uU(2," Export "),e.qZA()}}function hT(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",9)(1,"div")(2,"h6"),e._uU(3,"Brand"),e.qZA(),e.TgZ(4,"ng-select",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListBrandID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"From - To"),e.qZA(),e.TgZ(8,"div")(9,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(10,"div",12)(11,"datepicker",13),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Row Count"),e.qZA(),e.TgZ(15,"input",14),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.RowCount=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListBrandID)("items",null==t.pageData.Options?null:t.pageData.Options.Brand),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.RowCount)}}function fT(n,r){1&n&&(e.TgZ(0,"th",29),e._uU(1,"Total Cost "),e.qZA())}function xT(n,r){1&n&&(e.TgZ(0,"th",30),e._uU(1,"Profit"),e.qZA())}function TT(n,r){if(1&n&&(e.TgZ(0,"td",41),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.TotalCost?t.TotalCost:0),"")}}const ct=function(n,r){return{"text-danger":n,"text-success":r}};function CT(n,r){if(1&n&&(e.TgZ(0,"td",42),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.Q6J("ngClass",e.WLB(4,ct,t.Profit<0,t.Profit>0)),e.xp6(1),e.hij(" ",e.lcZ(2,2,t.Profit),"")}}function ZT(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td",36),e._uU(2),e.qZA(),e.TgZ(3,"td",37),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td",38),e._uU(7),e.ALo(8,"number"),e.qZA(),e.YNc(9,TT,3,3,"td",39),e.YNc(10,CT,3,7,"td",40),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(3);e.xp6(2),e.hij("",t.BrandName," "),e.xp6(2),e.hij(" ",e.lcZ(5,5,t.Quantity?t.Quantity:0),""),e.xp6(3),e.hij(" ",e.lcZ(8,7,t.TotalSales?t.TotalSales:0),""),e.xp6(2),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost)}}const DT=function(){return["/menu/Contacts/Contact/Customers/Info"]},vT=function(n){return{ID:n}};function bT(n,r){if(1&n&&(e.TgZ(0,"tr",31)(1,"td")(2,"a",32),e._uU(3),e.qZA()(),e.TgZ(4,"td",19),e._uU(5),e.qZA(),e.TgZ(6,"td",20),e._uU(7),e.qZA(),e.TgZ(8,"td",21),e._uU(9),e.qZA(),e.TgZ(10,"td",33)(11,"table",34),e.YNc(12,ZT,11,9,"tr",35),e.qZA()()()),2&n){const t=r.$implicit;e.xp6(2),e.Q6J("routerLink",e.DdM(8,DT))("queryParams",e.VKq(9,vT,t.CustomerID)),e.xp6(1),e.AsE(" ",t.Name," ",t.Title," "),e.xp6(2),e.Oqu(t.Email),e.xp6(2),e.Oqu(t.Mobile),e.xp6(2),e.Oqu(t.City),e.xp6(3),e.Q6J("ngForOf",t.Detail)}}function yT(n,r){if(1&n&&(e.TgZ(0,"td",45),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.hij(" ",e.lcZ(2,1,t.data.Total.TotalCost)," ")}}function ST(n,r){if(1&n&&(e.TgZ(0,"td",48),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.WLB(4,ct,t.data.Total.Profit<0,t.data.Total.Profit>0)),e.xp6(1),e.hij(" ",e.lcZ(2,2,t.data.Total.Profit)," ")}}function AT(n,r){if(1&n&&(e.TgZ(0,"tfoot")(1,"tr",43),e._UZ(2,"td",44),e.TgZ(3,"td",45),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td",45),e._uU(7),e.ALo(8,"number"),e.qZA(),e.YNc(9,yT,3,3,"td",46),e.YNc(10,ST,3,7,"td",47),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(4),e.hij(" ",e.lcZ(5,4,t.data.Total.Quantity)," "),e.xp6(3),e.hij(" ",e.lcZ(8,6,t.data.Total.TotalSales)," "),e.xp6(2),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost)}}function wT(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",15)(1,"table",16),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",17)(3,"tr")(4,"th",18),e._uU(5,"Customer "),e.qZA(),e.TgZ(6,"th",19),e._uU(7,"Email"),e.qZA(),e.TgZ(8,"th",20),e._uU(9,"Mobile"),e.qZA(),e.TgZ(10,"th",21),e._uU(11,"City"),e.qZA(),e.TgZ(12,"th",22),e._uU(13,"Brand"),e.qZA(),e.TgZ(14,"th",23),e._uU(15," Qty "),e.qZA(),e.TgZ(16,"th",24),e._uU(17,"Total Sales "),e.qZA(),e.YNc(18,fT,2,0,"th",25),e.YNc(19,xT,2,0,"th",26),e.qZA()(),e.TgZ(20,"tbody"),e.YNc(21,bT,13,11,"tr",27),e.qZA(),e.YNc(22,AT,11,8,"tfoot",28),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(18),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(2),e.Q6J("ngForOf",t.data.Data),e.xp6(1),e.Q6J("ngIf",t.data)}}const FT=function(){return["/menu/Reports/Sales_Report/Standard/Top_Brand"]};let MT=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/CustomerBrand","ReportLoader/CustomerBrand"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"reportFilterService",void 0),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i,this.reportFilterService=s}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)}sortData(t){const a=this.data.Data.slice();t.active&&""!==t.direction?(this.data.Data=a.sort((o,i)=>{const s="asc"===t.direction;switch(o.Name=null==o.Name?"":o.Name,i.Name=null==i.Name?"":i.Name,t.active){case"Name":return this.compare(o.Name.toLocaleLowerCase(),i.Name.toLocaleLowerCase(),s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);default:return 0}}),this.data.Detail=a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"SalesNTax":return this.compare(o.TotalSales,i.TotalSales,s);case"Cost":return this.compare(o.TotalCost,i.TotalCost,s);case"Profit":return this.compare(o.Profit,i.Profit,s);default:return 0}})):this.data.Data=a}openExportModal(){this.matDialog.open(M.H,{data:{title:"Brand Sales Analysis",exportTypes:[{ID:"ReportExport/CustomerBrand",Value:"Default",FileName:"Brand Sales Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw),e.Y36(N.z))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-brand-sales-analysis"]],features:[e.qOj],decls:11,vars:7,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-4",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],[1,"btn","btn-outline-secondary","me-4",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose Brand",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["type","text","autoNum","",3,"ngModel","ngModelChange"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name","text","Customer",1,"align-left",2,"width","280px"],[2,"width","190px"],[2,"width","155px"],[2,"width","130px"],[2,"min-width","124px"],["mat-sort-header","Quantity","text","Qty",1,"align-left","text-end",2,"min-width","66px"],["mat-sort-header","SalesNTax","text","Total Sales","arrowPosition","before",1,"flex-right","text-end",2,"min-width","112px"],["mat-sort-header","Cost","text","Total Cost","arrowPosition","before","class","flex-right text-end","style","min-width: 113px",4,"ngIf"],["mat-sort-header","Profit","text","Profit","arrowPosition","before","class","flex-right text-end","style","min-width: 114px",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[4,"ngIf"],["mat-sort-header","Cost","text","Total Cost","arrowPosition","before",1,"flex-right","text-end",2,"min-width","113px"],["mat-sort-header","Profit","text","Profit","arrowPosition","before",1,"flex-right","text-end",2,"min-width","114px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["colspan","5",1,"p-0"],[1,"w-100","border-top-0"],[4,"ngFor","ngForOf"],[1,"border-top-0","text-start",2,"min-width","124px"],[1,"border-top-0",2,"min-width","66px"],[1,"border-top-0","text-end",2,"min-width","112px"],["class","border-top-0 text-end","style","min-width: 113px",4,"ngIf"],["class","border-top-0 text-end","style","min-width: 114px",3,"ngClass",4,"ngIf"],[1,"border-top-0","text-end",2,"min-width","113px"],[1,"border-top-0","text-end",2,"min-width","114px",3,"ngClass"],[1,"footer"],["colspan","5"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,gT,3,0,"a",1),e.TgZ(3,"a",2),e._uU(4," Top Brand "),e.qZA()(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,hT,16,6,"div",4),e.qZA()(),e.TgZ(8,"content")(9,"div",5),e.YNc(10,wT,23,4,"div",6),e.qZA()()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",null==a.roleService?null:a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(6,FT)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(3),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.mk,p.sg,p.O5,h.rH,m.w9,A.QB,d.Fj,d.JJ,d.On,f.YE,f.nU,U.b,p.JJ]})),n})();function qT(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",5),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",6),e._uU(2," Export"),e.qZA()}}function IT(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"From - To"),e.qZA(),e.TgZ(3,"div")(4,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(5,"div",12)(6,"datepicker",13),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.onFilterToDate())}),e.qZA()()()}if(2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function PT(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Compare with prev Month"),e.qZA(),e.TgZ(3,"radio-options",14),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.isCompareData=o)})("modelChange",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.OnCompare("Data"))}),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(3),e.Q6J("model",t.isCompareData)}}function OT(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Year - Month"),e.qZA(),e.TgZ(3,"div",15)(4,"div",16)(5,"ng-select",17),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.Year=o)})("change",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.YearMonthToDateRange())})("clear",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.Year=null)}),e.qZA()(),e.TgZ(6,"div",18)(7,"ng-select",19),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw(2);return e.KtG(i.Month=o)})("change",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.YearMonthToDateRange())})("clear",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.Month=null)}),e.qZA()()()()}if(2&n){const t=e.oxw(2);e.xp6(5),e.Q6J("ngModel",t.Year)("items",t.Years),e.xp6(2),e.Q6J("ngModel",t.Month)("items",t.Months)}}function NT(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListOutletID=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Type"),e.qZA(),e.TgZ(8,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()(),e.YNc(9,IT,7,2,"div",10),e.YNc(10,PT,4,1,"div",10),e.YNc(11,OT,8,4,"div",10),e.qZA()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListOutletID)("items",null==t.pageData.Options?null:t.pageData.Options.Outlets),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Options?null:t.pageData.Options.Types),e.xp6(1),e.Q6J("ngIf",!t.DateFilterType),e.xp6(1),e.Q6J("ngIf",t.DateFilterType),e.xp6(1),e.Q6J("ngIf",t.DateFilterType)}}function JT(n,r){1&n&&(e.TgZ(0,"th",43),e._uU(1,"Prev"),e.qZA())}function LT(n,r){1&n&&(e.TgZ(0,"th",43),e._uU(1,"Now"),e.qZA())}function UT(n,r){1&n&&(e.TgZ(0,"th",44),e._uU(1," Trans "),e.qZA())}function QT(n,r){1&n&&(e.TgZ(0,"th",45),e._uU(1,"Qty"),e.qZA())}function kT(n,r){if(1&n&&(e.TgZ(0,"th",46),e._uU(1,"Tax"),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("mat-sort-header",t.pageData.IgnoreTax?"Tax":"SalesNet")}}function ET(n,r){if(1&n&&(e.TgZ(0,"th",46),e._uU(1," Sales + Tax "),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("mat-sort-header",t.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function YT(n,r){1&n&&(e.TgZ(0,"th",38),e._uU(1,"\xb1 (%)"),e.qZA())}function RT(n,r){1&n&&(e.TgZ(0,"th",47),e._uU(1,"Cost"),e.qZA())}function GT(n,r){if(1&n&&(e.TgZ(0,"th",46),e._uU(1," Profit "),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("mat-sort-header",t.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function HT(n,r){1&n&&(e.TgZ(0,"th",48),e._uU(1," Target "),e.qZA())}function VT(n,r){1&n&&(e.TgZ(0,"th",49),e._uU(1," Ach(%) "),e.qZA())}function BT(n,r){if(1&n&&(e.TgZ(0,"td",52),e._uU(1),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(t.PrevIndex)}}const KT=function(n,r){return{rankDown:n,rankUp:r,"number key":!0}};function jT(n,r){if(1&n&&(e.TgZ(0,"td",53),e._uU(1),e.qZA()),2&n){const t=e.oxw(),a=t.$implicit,o=t.index;e.Q6J("ngClass",e.WLB(2,KT,a.PrevIndex<o+1,a.PrevIndex>o+1)),e.xp6(1),e.hij(" ",a.CurrentIndex," ")}}function zT(n,r){if(1&n&&(e.TgZ(0,"td",38),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.xi3(2,1,t.Quantity,".0-0"))}}function WT(n,r){if(1&n&&(e.TgZ(0,"td",38),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.xi3(2,1,t.Count,".0-0"))}}function $T(n,r){if(1&n&&(e.TgZ(0,"td",38),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.Tax,".0-0")," ")}}const XT=function(){return["/menu/Reports/Sales_Report/Standard/Detail"]},e2=function(n,r,t){return{From:n,To:r,TypeID:t}};function t2(n,r){if(1&n&&(e.TgZ(0,"td",38)(1,"a",54),e.ALo(2,"date"),e.ALo(3,"date"),e.TgZ(4,"b"),e._uU(5),e.ALo(6,"number"),e.qZA()()()),2&n){const t=e.oxw().$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("routerLink",e.DdM(12,XT))("queryParams",e.kEZ(13,e2,e.xi3(2,3,a.pageData.Filter.From,"ddMMyyyy"),e.xi3(3,6,a.pageData.Filter.To,"ddMMyyyy"),t.TypeID)),e.xp6(4),e.Oqu(e.xi3(6,9,t.SalesWithTax,".0-0"))}}const dt=function(n,r){return{"text-warning":n,"text-success":r,"text-end":!0}};function n2(n,r){if(1&n&&(e.TgZ(0,"td",55),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.Q6J("ngClass",e.WLB(5,dt,t.IsNegative,t.IsPositive)),e.xp6(1),e.hij(" ",e.xi3(2,2,t.Increase,".0-0")," ")}}function o2(n,r){if(1&n&&(e.TgZ(0,"td",56),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.Cost,".0-0")," ")}}function a2(n,r){if(1&n&&(e.TgZ(0,"td",57),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit,a=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,a.pageData.IgnoreTax?t.ProfitWithTax:t.Profit,".0-0")," ")}}function r2(n,r){if(1&n&&(e.TgZ(0,"td",38),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.SalesTarget,".0-0")," ")}}const xe=function(n,r){return{"text-danger":n,"text-success":r}};function l2(n,r){if(1&n&&(e.TgZ(0,"span",55),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2).$implicit;e.Q6J("ngClass",e.WLB(5,xe,t.Achievement<0,t.Achievement>0)),e.xp6(1),e.hij(" ",e.xi3(2,2,t.Achievement,".0-0")," ")}}function s2(n,r){if(1&n&&(e.TgZ(0,"span",55),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2).$implicit;e.Q6J("ngClass",e.WLB(5,xe,t.AchievementWithTax<0,t.AchievementWithTax>0)),e.xp6(1),e.hij(" ",e.xi3(2,2,t.AchievementWithTax,".0-0")," ")}}function p2(n,r){if(1&n&&(e.TgZ(0,"td",38),e.YNc(1,l2,3,8,"span",40),e.YNc(2,s2,3,8,"span",40),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",!t.pageData.IgnoreTax),e.xp6(1),e.Q6J("ngIf",t.pageData.IgnoreTax)}}function c2(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td",36),e._uU(4),e.qZA(),e.YNc(5,BT,2,1,"td",50),e.YNc(6,jT,2,5,"td",51),e.YNc(7,zT,3,4,"td",30),e.YNc(8,WT,3,4,"td",30),e.TgZ(9,"td",38),e._uU(10),e.ALo(11,"number"),e.qZA(),e.YNc(12,$T,3,4,"td",30),e.ALo(13,"HideSumZero"),e.YNc(14,t2,7,17,"td",30),e.YNc(15,n2,3,8,"td",40),e.YNc(16,o2,3,4,"td",41),e.YNc(17,a2,3,4,"td",42),e.YNc(18,r2,3,4,"td",30),e.ALo(19,"HideSumZero"),e.YNc(20,p2,3,2,"td",30),e.ALo(21,"HideSumZero"),e.ALo(22,"HideSumZero"),e.qZA()),2&n){const t=r.$implicit,a=r.index,o=e.oxw(2);e.xp6(2),e.Oqu(a+1),e.xp6(2),e.Oqu(t.Name),e.xp6(1),e.Q6J("ngIf",o.isCompareData),e.xp6(1),e.Q6J("ngIf",o.isCompareData),e.xp6(1),e.Q6J("ngIf",o.data.WithCategory),e.xp6(1),e.Q6J("ngIf",!o.data.WithCategory),e.xp6(2),e.Oqu(e.xi3(11,14,t.SalesNet,".0-0")),e.xp6(2),e.Q6J("ngIf",!o.data.WithCategory&&e.xi3(13,17,o.data.Data,"Tax")),e.xp6(2),e.Q6J("ngIf",!o.data.WithCategory),e.xp6(1),e.Q6J("ngIf",o.isCompareData),e.xp6(1),e.Q6J("ngIf",o.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",o.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",e.xi3(19,20,o.data.Data,"SalesTarget")),e.xp6(2),e.Q6J("ngIf",e.xi3(21,23,o.data.Data,"AchievementWithTax")||e.xi3(22,26,o.data.Data,"Achievement"))}}function d2(n,r){1&n&&e._UZ(0,"td",58)}function u2(n,r){1&n&&e._UZ(0,"td",58)}function _2(n,r){if(1&n&&(e.TgZ(0,"td",38),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"Count"),".0-0")," ")}}function m2(n,r){if(1&n&&(e.TgZ(0,"td",38),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"Quantity"),".0-0")," ")}}function g2(n,r){if(1&n&&(e.TgZ(0,"td",38),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"Tax"),".0-0")," ")}}function h2(n,r){if(1&n&&(e.TgZ(0,"td",59)(1,"a",60),e._uU(2),e.ALo(3,"number"),e.ALo(4,"sum"),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(e.xi3(3,1,e.xi3(4,4,t.data.Data,"SalesWithTax"),".0-0"))}}function f2(n,r){if(1&n&&(e.TgZ(0,"td",55),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("ngClass",e.WLB(5,dt,t.comparation<0,t.comparation>0)),e.xp6(1),e.hij(" ",e.xi3(2,2,t.comparation,".0-0")," ")}}function x2(n,r){if(1&n&&(e.TgZ(0,"td",56),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"Cost"),".0-0")," ")}}function T2(n,r){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Oqu(e.xi3(2,1,e.xi3(3,4,t.data.Data,"Profit"),".0-0"))}}function C2(n,r){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"ProfitWithTax"),".0-0")," ")}}function Z2(n,r){if(1&n&&(e.TgZ(0,"td",57),e.YNc(1,T2,4,7,"span",10),e.YNc(2,C2,4,7,"span",10),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",!t.pageData.IgnoreTax),e.xp6(1),e.Q6J("ngIf",t.pageData.IgnoreTax)}}function D2(n,r){if(1&n&&(e.TgZ(0,"td",38),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.xi3(2,1,e.xi3(3,4,t.data.Data,"Expense"),".0-0")," ")}}function v2(n,r){if(1&n&&(e.TgZ(0,"span",55),e.ALo(1,"sum"),e.ALo(2,"sum"),e.ALo(3,"sum"),e.ALo(4,"sum"),e._uU(5),e.ALo(6,"number"),e.ALo(7,"sum"),e.ALo(8,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.WLB(23,xe,e.xi3(1,2,t.data.Data,"Sales")/e.xi3(2,5,t.data.Data,"SalesTarget")<0,e.xi3(3,8,t.data.Data,"Sales")/e.xi3(4,11,t.data.Data,"SalesTarget")>0)),e.xp6(5),e.hij(" ",e.xi3(6,14,e.xi3(7,17,t.data.Data,"Sales")/e.xi3(8,20,t.data.Data,"SalesTarget"),".0-0")," ")}}function b2(n,r){if(1&n&&(e.TgZ(0,"span",55),e.ALo(1,"sum"),e.ALo(2,"sum"),e.ALo(3,"sum"),e.ALo(4,"sum"),e._uU(5),e.ALo(6,"number"),e.ALo(7,"sum"),e.ALo(8,"sum"),e.qZA()),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.WLB(23,xe,e.xi3(1,2,t.data.Data,"SalesWithTax")/e.xi3(2,5,t.data.Data,"SalesTarget")<0,e.xi3(3,8,t.data.Data,"SalesWithTax")/e.xi3(4,11,t.data.Data,"SalesTarget")>0)),e.xp6(5),e.hij(" ",e.xi3(6,14,e.xi3(7,17,t.data.Data,"SalesWithTax")/e.xi3(8,20,t.data.Data,"SalesTarget"),".0-0")," ")}}function y2(n,r){if(1&n&&(e.TgZ(0,"td",38),e.YNc(1,v2,9,26,"span",40),e.YNc(2,b2,9,26,"span",40),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",!t.pageData.IgnoreTax),e.xp6(1),e.Q6J("ngIf",t.pageData.IgnoreTax)}}function S2(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",20)(1,"div",21)(2,"table",22),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(3,"thead",23)(4,"tr")(5,"th"),e._uU(6,"No."),e.qZA(),e.TgZ(7,"th",24),e._uU(8,"Tag"),e.qZA(),e.YNc(9,JT,2,0,"th",25),e.YNc(10,LT,2,0,"th",25),e.YNc(11,UT,2,0,"th",26),e.YNc(12,QT,2,0,"th",27),e.TgZ(13,"th",28),e._uU(14,"Sales"),e.qZA(),e.YNc(15,kT,2,1,"th",29),e.ALo(16,"HideSumZero"),e.YNc(17,ET,2,1,"th",29),e.YNc(18,YT,2,0,"th",30),e.YNc(19,RT,2,0,"th",31),e.YNc(20,GT,2,1,"th",29),e.YNc(21,HT,2,0,"th",32),e.ALo(22,"HideSumZero"),e.YNc(23,VT,2,0,"th",33),e.ALo(24,"HideSumZero"),e.ALo(25,"HideSumZero"),e.qZA()(),e.TgZ(26,"tbody"),e.YNc(27,c2,23,29,"tr",34),e.qZA(),e.TgZ(28,"tfoot")(29,"tr",35),e._UZ(30,"td")(31,"td",36),e.YNc(32,d2,1,0,"td",37),e.YNc(33,u2,1,0,"td",37),e.YNc(34,_2,4,7,"td",30),e.YNc(35,m2,4,7,"td",30),e.TgZ(36,"td",38),e._uU(37),e.ALo(38,"number"),e.ALo(39,"sum"),e.qZA(),e.YNc(40,g2,4,7,"td",30),e.ALo(41,"HideSumZero"),e.YNc(42,h2,5,7,"td",39),e.YNc(43,f2,3,8,"td",40),e.YNc(44,x2,4,7,"td",41),e.YNc(45,Z2,3,2,"td",42),e.YNc(46,D2,4,7,"td",30),e.ALo(47,"HideSumZero"),e.YNc(48,y2,3,2,"td",30),e.ALo(49,"HideSumZero"),e.ALo(50,"HideSumZero"),e.qZA()()()()()}if(2&n){const t=e.oxw();e.xp6(9),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",!t.data.WithCategory),e.xp6(1),e.Q6J("ngIf",t.data.WithCategory),e.xp6(3),e.Q6J("ngIf",!t.data.WithCategory&&e.xi3(16,24,t.data.Data,"Tax")),e.xp6(2),e.Q6J("ngIf",!t.data.WithCategory),e.xp6(1),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",e.xi3(22,27,t.data.Data,"SalesTarget")),e.xp6(2),e.Q6J("ngIf",e.xi3(24,30,t.data.Data,"AchievementWithTax")||e.xi3(25,33,t.data.Data,"Achievement")),e.xp6(4),e.Q6J("ngForOf",t.data.Data),e.xp6(5),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",!t.data.WithCategory),e.xp6(1),e.Q6J("ngIf",t.data.WithCategory),e.xp6(2),e.hij(" ",e.xi3(38,36,e.xi3(39,39,t.data.Data,"SalesNet"),".0-0")," "),e.xp6(3),e.Q6J("ngIf",!t.data.WithCategory&&e.xi3(41,42,t.data.Data,"Tax")),e.xp6(2),e.Q6J("ngIf",!t.data.WithCategory),e.xp6(1),e.Q6J("ngIf",t.isCompareData),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Expense&&e.xi3(47,45,t.data.Data,"Expense")),e.xp6(2),e.Q6J("ngIf",e.xi3(49,48,t.data.Data,"AchievementWithTax")||e.xi3(50,51,t.data.Data,"Achievement"))}}let A2=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/OutletPerformanceByType","ReportLoader/OutletPerformance"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"isCompareData",!1),(0,l.Z)(this,"hideMore",!0),(0,l.Z)(this,"DateFilterType",!1),(0,l.Z)(this,"Year",void 0),(0,l.Z)(this,"Month",void 0),(0,l.Z)(this,"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"}]),(0,l.Z)(this,"Years",C.gT.GenerateYears((new Date).getFullYear(),11,!0)),(0,l.Z)(this,"RadioDateFilterType",[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}]),this.httpService=t,this.csvConverter=a,this.reportFilterService=o,this.roleService=i,this.matDialog=s;const c=new Date;this.Year=c.getFullYear(),this.Month=c.getMonth()}postInit(t){this.menuData.H=t.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)}YearMonthToDateRange(){const t=new Date;null==this.Year&&(this.Year=t.getFullYear()),null==this.Month&&(this.Month=t.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(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"Name":return this.compare(o.Name,i.Name,s);case"Count":return this.compare(o.Count,i.Count,s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);case"Gross":return this.compare(o.Gross,i.Gross,s);case"SalesNet":case"SalesTaxNet":return this.compare(o.SalesNet,i.SalesNet,s);case"Tax":return this.compare(o.Tax,i.Tax,s);case"SalesWithTax":return this.compare(o.SalesWithTax,i.SalesWithTax,s);case"Cost":return this.compare(o.Cost,i.Cost,s);case"Profit":return this.compare(o.Profit,i.Profit,s);case"ProfitWithTax":return this.compare(o.ProfitWithTax,i.ProfitWithTax,s);case"Expense":return this.compare(o.Expense,i.Expense,s);case"NetProfit":return this.compare(o.NetProfit,i.NetProfit,s);case"Target":case"SalesTarget":return this.compare(o.SalesTarget,i.SalesTarget,s);case"Achievement":return this.compare(o.Achievement,i.Achievement,s);default:return 0}}):a}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListOutletID)}openExportModal(){this.matDialog.open(M.H,{data:{title:"Sales Order Tag",exportTypes:[{ID:"ReportExport/OutletPerformanceByType",Value:"Default",FileName:"Sales Order Tag"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(N.z),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-by-sales-order-type"]],features:[e.qOj],decls:8,vars:5,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],[4,"ngIf"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["name","Compare",3,"model","modelChange"],[1,"row"],[1,"col-6","pe-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","ps-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"align-left"],["style","width: 35px;",4,"ngIf"],["mat-sort-header","Count","class","flex-left","arrowPosition","before",4,"ngIf"],["mat-sort-header","Quantity","arrowPosition","before","class","align-left",4,"ngIf"],["mat-sort-header","SalesNet","arrowPosition","before",1,"flex-left"],["arrowPosition","before","class","flex-left",3,"mat-sort-header",4,"ngIf"],["class","text-end",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before","class","flex-left",4,"ngIf"],["mat-sort-header","Target","arrowPosition","before","class","align-left",4,"ngIf"],["mat-sort-header","Achievement","arrowPosition","before","class","align-left","matTooltipPosition","above","matTooltip","Achievement",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"text-end"],["class","text-end text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],["class","text-end text-success",4,"ngIf"],[2,"width","35px"],["mat-sort-header","Count","arrowPosition","before",1,"flex-left"],["mat-sort-header","Quantity","arrowPosition","before",1,"align-left"],["arrowPosition","before",1,"flex-left",3,"mat-sort-header"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-left"],["mat-sort-header","Target","arrowPosition","before",1,"align-left"],["mat-sort-header","Achievement","arrowPosition","before","matTooltipPosition","above","matTooltip","Achievement",1,"align-left"],["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"],[3,"routerLink","queryParams"],[3,"ngClass"],[1,"text-end","text-danger"],[1,"text-end","text-success"],[1,"empty-column"],[1,"text-end","text-primary"],[1,"fw-bold"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,qT,3,0,"button",1),e.qZA(),e.TgZ(3,"filters")(4,"div",2),e.YNc(5,NT,12,8,"div",3),e.qZA()(),e.TgZ(6,"content"),e.YNc(7,S2,51,54,"div",4),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.mk,p.sg,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,x.gM,f.YE,f.nU,q.P,S.qU,S.aQ,p.JJ,p.uU]})),n})();function w2(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"h6"),e._uU(2,"Interval for Clustering"),e.qZA(),e.TgZ(3,"input",5),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.Interval=o)}),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngModel",t.pageData.Filter.Interval)}}function F2(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",7),e._uU(2," Export"),e.qZA()}}function M2(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td",15),e._uU(4),e.ALo(5,"number"),e.qZA(),e._UZ(6,"td"),e.qZA()),2&n){const t=r.$implicit;e.xp6(2),e.Oqu(t.Key),e.xp6(2),e.Oqu(e.lcZ(5,2,t.Value))}}function q2(n,r){if(1&n&&(e.TgZ(0,"div",8)(1,"table",9)(2,"thead",10)(3,"tr",11)(4,"th",12),e._uU(5,"Interval"),e.qZA(),e.TgZ(6,"th",13),e._uU(7,"Amount Of Products"),e.qZA(),e._UZ(8,"th"),e.qZA()(),e.TgZ(9,"tbody"),e.YNc(10,M2,7,4,"tr",14),e.qZA()()()),2&n){const t=e.oxw();e.xp6(10),e.Q6J("ngForOf",t.data)}}let I2=(()=>{class n extends D.n{constructor(t,a,o,i){super(t,"Report/UnitPriceAnalysis","ReportLoader/PriceAnalysis"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),this.httpService=t,this.csvConverter=a,this.roleService=o,this.matDialog=i}openExportModal(){this.matDialog.open(M.H,{data:{title:"Price Analysis",exportTypes:[{ID:"ReportExport/PriceAnalysis",Value:"Default",FileName:"Price Analysis"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["CustomerDisplay-price-analysis"]],features:[e.qOj],decls:8,vars:5,consts:[[3,"pageData","hideSearchBox","onSubmit"],["container",""],[4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["type","text","autoNum","",3,"ngModel","ngModelChange"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","250px"],[2,"width","150px"],[4,"ngFor","ngForOf"],[1,"text-end"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"filters")(2,"div",1),e.YNc(3,w2,4,1,"div",2),e.qZA()(),e.TgZ(4,"actions"),e.YNc(5,F2,3,0,"button",3),e.qZA(),e.TgZ(6,"content"),e.YNc(7,q2,11,1,"div",4),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,d.Fj,d.JJ,d.On,U.b,p.JJ]})),n})();function P2(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",5),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",6),e._uU(2," Export"),e.qZA()}}function O2(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"From - To"),e.qZA(),e.TgZ(8,"div")(9,"datepicker",9),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)}),e.qZA()(),e.TgZ(10,"div",10)(11,"datepicker",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)}),e.qZA()()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Tax"),e.qZA(),e.TgZ(15,"ng-select",12),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.TypeID=o)}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Page Size"),e.qZA(),e.TgZ(19,"input",13),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.RowCount=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.TypeID)("items",null==t.pageData.Options?null:t.pageData.Options.Types),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.RowCount)}}function N2(n,r){if(1&n&&e._UZ(0,"th",39),2&n){const t=r.$implicit;e.Q6J("innerHtml",t.Label+" ("+t.Rate+"%)",e.oJD)}}function J2(n,r){if(1&n&&(e._UZ(0,"td",43),e.ALo(1,"number"),e.ALo(2,"TaxDefault")),2&n){const t=r.index,a=e.oxw().$implicit,o=e.oxw(2);e.Q6J("innerHtml",e.lcZ(1,1,e.Dn7(2,3,o.data.Compenents,a,t)),e.oJD)}}const L2=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},U2=function(n){return{ID:n}};function Q2(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td")(4,"a",40),e._uU(5),e.qZA()(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.ALo(12,"date"),e.qZA(),e.TgZ(13,"td",41),e._uU(14),e.ALo(15,"number"),e.qZA(),e.TgZ(16,"td",41),e._uU(17),e.ALo(18,"number"),e.qZA(),e.YNc(19,J2,3,7,"td",42),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.EntityName),e.xp6(2),e.Q6J("routerLink",e.DdM(17,L2))("queryParams",e.VKq(18,U2,t.ID)),e.xp6(1),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Name),e.xp6(2),e.Oqu(t.TaxName),e.xp6(2),e.Oqu(e.xi3(12,10,t.Date,"dd MMM yyyy")),e.xp6(3),e.Oqu(e.lcZ(15,13,t.Sales)),e.xp6(3),e.Oqu(e.lcZ(18,15,t.Tax)),e.xp6(2),e.Q6J("ngForOf",a.getComponent(a.data))}}function k2(n,r){if(1&n&&(e.TgZ(0,"td",44),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=r.$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.SumTaxAmount)," ")}}function E2(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",45),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport"))}),e.TgZ(1,"i",46),e._uU(2,"?"),e.qZA()()}}function Y2(n,r){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(e.lcZ(2,1,t.listTotal))}}function R2(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",47),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.NextPage(!0))}),e._UZ(1,"i",48),e._uU(2," Next"),e.qZA()}}function G2(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"a",49),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.StoreRowsCountAPIResult("Report/GetCountPurchaseTaxReport",!0))}),e._UZ(1,"i",50),e._uU(2," Show All"),e.qZA()}}function H2(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",14)(1,"div",15)(2,"table",16),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(3,"thead",17)(4,"tr")(5,"th",18),e._uU(6,"Outlet"),e.qZA(),e.TgZ(7,"th",19),e._uU(8,"Number"),e.qZA(),e.TgZ(9,"th",20),e._uU(10,"Name"),e.qZA(),e.TgZ(11,"th",21),e._uU(12,"Type"),e.qZA(),e.TgZ(13,"th",22),e._uU(14,"Date"),e.qZA(),e.TgZ(15,"th",23),e._uU(16," Purchase"),e.qZA(),e.TgZ(17,"th",24),e._uU(18,"Tax"),e.qZA(),e.YNc(19,N2,1,1,"th",25),e.qZA()(),e.TgZ(20,"tbody"),e.YNc(21,Q2,20,20,"tr",26),e.qZA(),e.TgZ(22,"tfoot")(23,"tr",27),e._UZ(24,"td",28),e.TgZ(25,"td",29),e._uU(26),e.ALo(27,"number"),e.ALo(28,"sum"),e.qZA(),e.TgZ(29,"td",29),e._uU(30),e.ALo(31,"number"),e.ALo(32,"sum"),e.qZA(),e.YNc(33,k2,3,3,"td",30),e.qZA()()()(),e.TgZ(34,"div",31)(35,"div",32)(36,"div",33),e._uU(37),e.ALo(38,"number"),e.YNc(39,E2,3,0,"span",34),e.YNc(40,Y2,3,3,"span",35),e._uU(41),e.qZA()(),e.TgZ(42,"div",36),e.YNc(43,R2,3,0,"a",37),e.YNc(44,G2,3,0,"a",38),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(19),e.Q6J("ngForOf",t.data.Compenents),e.xp6(2),e.Q6J("ngForOf",t.infiniteList),e.xp6(5),e.Oqu(e.lcZ(27,11,e.xi3(28,13,t.infiniteList,"Sales"))),e.xp6(4),e.Oqu(e.lcZ(31,16,e.xi3(32,18,t.infiniteList,"Tax"))),e.xp6(3),e.Q6J("ngForOf",t.data.Compenents),e.xp6(4),e.hij(" Showing 1 - ",e.lcZ(38,21,t.pageData.Filter.RowCount*(t.pageData.Filter.PageNumber-1)+t.data.TotalCurrentRow)," of "),e.xp6(2),e.Q6J("ngIf",!t.pageData.HideStoreApiCount),e.xp6(1),e.Q6J("ngIf",t.pageData.HideStoreApiCount),e.xp6(1),e.hij(" records ~ ",t.pageData.Filter.PageNumber," Page "),e.xp6(2),e.Q6J("ngIf",t.nextPageDisabled&&!t.goToLast),e.xp6(1),e.Q6J("ngIf",t.nextPageDisabled&&!t.goToLast)}}let V2=(()=>{class n extends ce.X{constructor(t,a,o,i,s){super(t,"Report/GetPurchaseTaxReport","ReportLoader/GetTaxReport",a),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),this.httpService=t,this.csvConverter=o,this.roleService=i,this.matDialog=s}openExportModal(){this.matDialog.open(M.H,{data:{title:"Purchase Tax Report",exportTypes:[{ID:"ReportExport/GetPurchaseTaxReport",Value:"Default",FileName:"Purchase Tax Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Report/GetCountPurchaseTaxReport",pagination:!0}})}preInitList(){this.oldRowCount=this.pageData.Filter.RowCount}getComponent(t){return t.Component=[],this.data.Compenents.forEach((a,o)=>{0!=t.Tax?(a.TaxTax=0==o?t.Tax:this.data.Compenents[o-1].TaxTax,a.TaxTax=0==o?a.TaxTax:a.TaxTax+a.TaxTax*this.data.Compenents[o-1].Rate/100,t.Component[o]=a.TaxTax*a.Rate/100,a.SumTaxAmount=a.SumTaxAmount+t.Component[o]):t.Component[o]=0}),t.Component}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(o.Name=null==o.Name?"":o.Name,i.Name=null==i.Name?"":i.Name,o.EntityName=null==o.EntityName?"":o.EntityName,i.EntityName=null==i.EntityName?"":i.EntityName,t.active){case"Name":return this.compare(o.Name.toLocaleLowerCase(),i.Name.toLocaleLowerCase(),s);case"Outlet":return this.compare(o.EntityName.toLocaleLowerCase(),i.EntityName.toLocaleLowerCase(),s);case"Number":return this.compare(o.Number,i.Number,s);case"Date":return this.compare(o.Date,i.Date,s);case"Tax":case"Tax":return this.compare(o.Tax,i.Tax,s);default:return 0}}):a}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(I._W),e.Y36(Z.O),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["POS-purchase-tax-report"]],features:[e.qOj],decls:8,vars:5,consts:[[3,"pageData","text","textChange","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["bindLabel","Label","bindValue","ID","placeholder","Choose a Type",3,"ngModel","items","ngModelChange"],["type","text","autoNum","","name","RowCount",1,"form-control",3,"ngModel","ngModelChange"],[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",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",1,"flex-right","text-end",2,"width","150px"],["style","width: 150px","class","align-right text-end",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","5",1,"text-end","empty-column"],[1,"text-end","text-success"],["class","text-end","style","width: 150px",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load next page",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],[1,"align-right","text-end",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],[1,"text-end"],["class","text-end","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-end",2,"width","150px",3,"innerHtml"],[1,"text-end",2,"width","150px"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retrieve rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.Number=i})("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,P2,3,0,"button",1),e.qZA(),e.TgZ(3,"filters")(4,"div",2),e.YNc(5,O2,20,8,"div",3),e.qZA()(),e.TgZ(6,"content"),e.YNc(7,H2,45,23,"div",4),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.Number),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(3),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,A.QB,d.Fj,d.JJ,d.On,x.gM,f.YE,f.nU,U.b,S.qU,S.X6,p.JJ,p.uU]})),n})();function B2(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",5)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",6),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"From - To"),e.qZA(),e.TgZ(8,"div")(9,"datepicker",7),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(10,"div",8)(11,"datepicker",9),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(5),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function K2(n,r){if(1&n&&(e.TgZ(0,"div",10),e._UZ(1,"POS-pie-chart",11),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("config",t.chartConfig)("data",t.chartData)}}const j2=function(){return["/menu/Reports/Sales_Report/Standard/Top_Brand"]};let z2=(()=>{class n extends D.n{constructor(t,a,o){super(t,"Report/BrandRank","ReportLoader/BrandRank",null,a),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"chartData",void 0),(0,l.Z)(this,"chartConfig",{title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}}),this.httpService=t,this.reportFilterService=o}postInit(){this.initChartSeries()}initChartSeries(){const t=[];this.data?.Data?.forEach(a=>{t.push({name:a.BrandName,y:a.Total})}),this.chartData=t}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(h.gz),e.Y36(N.z))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["app-top-brand-chart"]],features:[e.qOj],decls:9,vars:6,consts:[[3,"pageData","text","textChange","onSubmit"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.Number=i})("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions")(2,"a",1),e._uU(3,"Table View"),e.qZA()(),e.TgZ(4,"filters")(5,"div",2),e.YNc(6,B2,12,5,"div",3),e.qZA()(),e.TgZ(7,"content"),e.YNc(8,K2,2,2,"div",4),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.Number),e.xp6(2),e.Q6J("routerLink",e.DdM(5,j2)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.O5,h.rH,m.w9,A.QB,d.JJ,d.On,_e.J]})),n})();function W2(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",6),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",7),e._uU(2," Export"),e.qZA()}}function $2(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",8)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",9),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",10),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Date"),e.qZA(),e.TgZ(12,"app-datepicker-range",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onChangeFilterDate1(o))}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Compare With"),e.qZA(),e.TgZ(16,"app-datepicker-range",11),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.onChangeFilterDate2(o))}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(4),e.Q6J("from",t.pageData.Filter.From_range1)("to",t.pageData.Filter.To_range1),e.xp6(4),e.Q6J("from",t.pageData.Filter.From_range2)("to",t.pageData.Filter.To_range2)}}function X2(n,r){1&n&&(e.TgZ(0,"th",29),e._uU(1,"Net Profit"),e.qZA())}function eC(n,r){1&n&&(e.TgZ(0,"th",30),e._uU(1,"Net Profit"),e.qZA())}function tC(n,r){1&n&&(e.TgZ(0,"th",31),e._uU(1,"Profit"),e.qZA())}function nC(n,r){if(1&n&&(e.TgZ(0,"td",37),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.xi3(2,1,t.NetProfit1,"1.0-2"))}}function oC(n,r){if(1&n&&(e.TgZ(0,"td",37),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.xi3(2,1,t.NetProfit2,"1.0-2"))}}const ut=function(n,r){return{"text-danger":n,"text-success":r}};function aC(n,r){if(1&n&&(e.TgZ(0,"td",35),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.Q6J("ngClass",e.WLB(5,ut,t.Growth<0,t.Growth>0)),e.xp6(1),e.hij(" ",e.xi3(2,2,t.Growth,"1.0-2"),"%")}}function iC(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td",32),e._uU(2),e.qZA(),e.TgZ(3,"td",33),e._uU(4),e.ALo(5,"number"),e.qZA(),e.YNc(6,nC,3,4,"td",34),e.TgZ(7,"td",33),e._uU(8),e.ALo(9,"number"),e.qZA(),e.YNc(10,oC,3,4,"td",34),e.TgZ(11,"td",35),e._uU(12),e.ALo(13,"number"),e.qZA(),e.YNc(14,aC,3,8,"td",36),e.qZA()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Oqu(t.EntityName),e.xp6(1),e.Q6J("colSpan",a.roleService.report.Profit?1:2),e.xp6(1),e.Oqu(e.xi3(5,10,t.SalesNTax1,"1.0-2")),e.xp6(2),e.Q6J("ngIf",a.roleService.report.Profit),e.xp6(1),e.Q6J("colSpan",a.roleService.report.Profit?1:2),e.xp6(1),e.Oqu(e.xi3(9,13,t.SalesNTax2,"1.0-2")),e.xp6(2),e.Q6J("ngIf",a.roleService.report.Profit),e.xp6(1),e.Q6J("ngClass",e.WLB(19,ut,t.Revenue<0,t.Revenue>0)),e.xp6(1),e.hij(" ",e.xi3(13,16,t.Revenue,"1.0-2"),"% "),e.xp6(2),e.Q6J("ngIf",a.roleService.report.Profit)}}const pe=function(n){return[n]};function rC(n,r){if(1&n&&(e.TgZ(0,"td",28),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("ngClass",e.VKq(5,pe,t.netProfit1Total>0?"text-success":"text-danger")),e.xp6(1),e.hij("",e.xi3(2,2,t.netProfit1Total,".0-0")," ")}}function lC(n,r){if(1&n&&(e.TgZ(0,"td",28),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("ngClass",e.VKq(5,pe,t.netProfit2Total>0?"text-success":"text-danger")),e.xp6(1),e.hij(" ",e.xi3(2,2,t.netProfit2Total,".0-0"),"")}}function sC(n,r){if(1&n&&(e.TgZ(0,"td",28),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw(2);e.Q6J("ngClass",e.VKq(5,pe,t.profitPercentage>0?"text-success":"text-danger")),e.xp6(1),e.hij(" ",e.xi3(2,2,t.profitPercentage,"1.0-2"),"%")}}function pC(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",12)(1,"table",13),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(2,"thead",14)(3,"tr")(4,"th",15),e._uU(5,"Outlet"),e.qZA(),e.TgZ(6,"th",16)(7,"span"),e._uU(8),e.ALo(9,"date"),e.qZA(),e._uU(10," - "),e.TgZ(11,"span"),e._uU(12),e.ALo(13,"date"),e.qZA()(),e.TgZ(14,"th",17)(15,"span"),e._uU(16),e.ALo(17,"date"),e.qZA(),e._uU(18," - "),e.TgZ(19,"span"),e._uU(20),e.ALo(21,"date"),e.qZA()(),e.TgZ(22,"th",17),e._uU(23,"YOY Growth"),e.qZA()(),e.TgZ(24,"tr",18)(25,"th",19),e._uU(26,"Sales + Tax"),e.qZA(),e.YNc(27,X2,2,0,"th",20),e.TgZ(28,"th",21),e._uU(29,"Sales + Tax"),e.qZA(),e.YNc(30,eC,2,0,"th",22),e.TgZ(31,"th",23),e._uU(32,"Revenue"),e.qZA(),e.YNc(33,tC,2,0,"th",24),e.qZA()(),e.TgZ(34,"tbody"),e.YNc(35,iC,15,22,"tr",25),e.qZA(),e.TgZ(36,"tfoot")(37,"tr"),e._UZ(38,"td"),e.TgZ(39,"td",26),e._uU(40),e.ALo(41,"number"),e.qZA(),e.YNc(42,rC,3,7,"td",27),e.TgZ(43,"td",26),e._uU(44),e.ALo(45,"number"),e.qZA(),e.YNc(46,lC,3,7,"td",27),e.TgZ(47,"td",28),e._uU(48),e.ALo(49,"number"),e.qZA(),e.YNc(50,sC,3,7,"td",27),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(8),e.Oqu(e.xi3(9,21,t.pageData.Filter.From_range1,"dd MMMM yyyy")),e.xp6(4),e.Oqu(e.xi3(13,24,t.pageData.Filter.To_range1,"dd MMMM yyyy")),e.xp6(4),e.Oqu(e.xi3(17,27,t.pageData.Filter.From_range2,"dd MMMM yyyy")),e.xp6(4),e.Oqu(e.xi3(21,30,t.pageData.Filter.To_range2,"dd MMMM yyyy")),e.xp6(5),e.Q6J("colSpan",t.roleService.report.Profit?1:2),e.xp6(2),e.Q6J("ngIf",t.roleService.report.Profit),e.xp6(1),e.Q6J("colSpan",t.roleService.report.Profit?1:2),e.xp6(2),e.Q6J("ngIf",t.roleService.report.Profit),e.xp6(3),e.Q6J("ngIf",t.roleService.report.Profit),e.xp6(2),e.Q6J("ngForOf",t.data),e.xp6(4),e.Q6J("colSpan",t.roleService.report.Profit?1:2)("ngClass",e.VKq(42,pe,t.salesNTax1Total>0?"text-success":"text-danger")),e.xp6(1),e.hij("",e.xi3(41,33,t.salesNTax1Total,".0-0")," "),e.xp6(2),e.Q6J("ngIf",t.roleService.report.Profit),e.xp6(1),e.Q6J("colSpan",t.roleService.report.Profit?1:2)("ngClass",e.VKq(44,pe,t.salesNTax2Total>0?"text-success":"text-danger")),e.xp6(1),e.hij(" ",e.xi3(45,36,t.salesNTax2Total,".0-0"),""),e.xp6(2),e.Q6J("ngIf",t.roleService.report.Profit),e.xp6(1),e.Q6J("ngClass",e.VKq(46,pe,t.salesNTaxPercentage>0?"text-success":"text-danger")),e.xp6(1),e.hij(" ",e.xi3(49,39,t.salesNTaxPercentage,"1.0-2"),"% "),e.xp6(2),e.Q6J("ngIf",t.roleService.report.Profit)}}const dC=function(){return["/menu/Reports/Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance"]};let uC=(()=>{class n extends D.n{constructor(t,a,o,i,s){super(o,"Report/SalesCompareByRange","ReportLoader/SalesCompareByRange"),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"sumPipe",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"salesNTax1Total",0),(0,l.Z)(this,"salesNTax2Total",0),(0,l.Z)(this,"netProfit1Total",0),(0,l.Z)(this,"netProfit2Total",0),(0,l.Z)(this,"salesNTaxPercentage",0),(0,l.Z)(this,"profitPercentage",0),(0,l.Z)(this,"originalData",void 0),this.csvConverter=t,this.roleService=a,this.sumPipe=i,this.matDialog=s}ngOnInit(){}postInit(t){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=t}calculatePercentage(t,a){return(a-t)/t*100}preGetList(){delete this.pageData.Filter.From,delete this.pageData.Filter.To,delete this.pageData.Filter.PageNumber}onChangeFilterDate1(t){this.pageData.Filter.From_range1=t.from,this.pageData.Filter.To_range1=t.to}onChangeFilterDate2(t){this.pageData.Filter.From_range2=t.from,this.pageData.Filter.To_range2=t.to}sortData(t){const a=this.data.slice();this.data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(typeof o[t.active]){case"number":case"string":return this.compare(o[t.active],i[t.active],s);default:return 0}}):this.originalData}openExportModal(){this.matDialog.open(M.H,{data:{title:"Sales Compare by Outlet",exportTypes:[{ID:"ReportExport/SalesCompareByRange",Value:"Default",FileName:"Sales Compare by Outlet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(Z.O),e.Y36(b.N),e.Y36(_.O),e.Y36(S.qU),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["app-sales-compare-by-outlet"]],features:[e.qOj],decls:10,vars:7,consts:[["filterWidth","240px",3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["matTooltipPosition","above","matTooltip","12 Months Compare",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","","class"," w-100",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container","",1,"w-100"],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModel","items","ngModelChange"],[3,"from","to","dateChange"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-header"],["rowspan","2","colspan","1","mat-sort-header","EntityName",1,"border-end","text-center"],["colspan","2",1,"text-center"],["colspan","2",1,"text-center","border-start"],[1,"border-top-2"],["mat-sort-header","SalesNTax1",1,"align-center",3,"colSpan"],["class","align-center border-end","mat-sort-header","NetProfit1",4,"ngIf"],["mat-sort-header","SalesNTax2",1,"align-center",3,"colSpan"],["class","align-center border-end","mat-sort-header","NetProfit2",4,"ngIf"],["mat-sort-header","Revenue",1,"align-center"],["class","align-center","mat-sort-header","Growth",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"text-end",3,"colSpan","ngClass"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-end",3,"ngClass"],["mat-sort-header","NetProfit1",1,"align-center","border-end"],["mat-sort-header","NetProfit2",1,"align-center","border-end"],["mat-sort-header","Growth",1,"align-center"],[1,"border-start","border-end"],[1,"text-end","border-end",3,"colSpan"],["class","text-end border-end",4,"ngIf"],[1,"text-end","border-end",3,"ngClass"],["class","text-end border-end",3,"ngClass",4,"ngIf"],[1,"text-end","border-end"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,W2,3,0,"button",1),e.TgZ(3,"a",2),e._uU(4," View Monthly"),e.qZA()(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,$2,17,9,"div",4),e.qZA()(),e.TgZ(8,"content"),e.YNc(9,pC,51,48,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(6,dC)),e.xp6(4),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.mk,p.sg,p.O5,h.rH,m.w9,d.JJ,d.On,x.gM,f.YE,f.nU,fe,p.JJ,p.uU],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}}"]})),n})();var _C=g(62612);function mC(n,r){if(1&n&&(e.TgZ(0,"span",10),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function gC(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",6)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",7),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Category"),e.qZA(),e.TgZ(8,"ng-select",8),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,mC,2,2,"ng-template",9),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories)}}function hC(n,r){if(1&n&&(e.TgZ(0,"div",11),e._UZ(1,"POS-line-chart",12),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("config",t.chartConfig)("data",t.chartData)}}const xC=function(){return["/menu/Reports/Sales_Report/Standard/Yearly/Comparison"]};let TC=(()=>{class n extends D.n{constructor(t,a){super(t,"SalesReport/YearlySalesListChart","ReportLoader/MonthlySalesPerformance"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"chartData",{series:[]}),(0,l.Z)(this,"chartConfig",void 0),this.httpService=t,this.csvConverter=a}ngOnInit(){}preGetList(){delete this.pageData.Filter?.From,delete this.pageData.Filter?.To,delete this.pageData.Filter?.PageNumber}postInit(t){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 C.gT.formatNumber(this.value)}},stackLabels:{enabled:!0,style:{fontSize:"0.6rem"},formatter:function(){const o=this.axis.chart.userOptions.total;let i,s="",c=Math.abs(o[this.x]?o[this.x]:0);return c>999&&c<1e10?(s="K",i=(c/1e3).toFixed(0)):c>=1e10?(s="M",i=(c/1e6).toFixed(0)):c<900&&(i=c.toString()),this.total<0&&(i="-"+i),i.replace(/\B(?=(\d{3})+(?!\d))/g,",")+s}}},plotOptions:{column:{stacking:"normal",states:{inactive:{enabled:!1}}}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{formatter:function(){let a=this.series.chart.series;a=a.filter(c=>this.series?.name?.includes("Cost")?c?.name?.includes("Cost"):0==c?.name?.includes("Cost"));let o=[],i="",s=this.point.index;return a.forEach(c=>{c.options.stack===this.point.series.options.stack&&(o=c.name.split(" "),i+=`<b>${o[0]}</b> <br/><br/>\n ${Intl.NumberFormat("id-ID",{currency:"IDR"}).format(c.points[s]?.y)} <br/><br/>`)}),i}},total:this.generateStackTotal()}}generateStackTotal(){let t=[];return this.data.Series.filter(o=>"Sales"==o.Name).forEach(o=>{t=[...t,o.Amount]}),t}generateSeries(){let t=[];return t=[{name:"Sales",data:this.data.Series.filter(s=>"Sales"==s.Name).map(s=>s.Amount)},{name:"Profit",data:this.data.Series.filter(s=>"Profit"==s.Name).map(s=>s.Amount),visible:!1,showInLegend:!1},{name:"Cost",data:this.data.Series.filter(s=>"Cost"==s.Name).map(s=>s.Amount)}],t}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["app-yearly-bar-chart"]],features:[e.qOj],decls:10,vars:6,consts:[[3,"pageData","hideSearchBox","onSubmit"],["matTooltipPosition","above","matTooltip","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table","me-2"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["matTooltipPosition","above",3,"matTooltip"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("onSubmit",function(){return a.getListData()}),e.TgZ(1,"actions")(2,"a",1),e._UZ(3,"i",2),e._uU(4,"Table View"),e.qZA()(),e.TgZ(5,"filters")(6,"div",3),e.YNc(7,gC,10,5,"div",4),e.qZA()(),e.TgZ(8,"content"),e.YNc(9,hC,2,2,"div",5),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("hideSearchBox",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(5,xC)),e.xp6(5),e.Q6J("ngIf",a.pageData.Filter),e.xp6(2),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.O5,h.rH,m.w9,m.ir,d.JJ,d.On,x.gM,te.D]})),n})();function CC(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"button",13),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.openExportModal())}),e._UZ(1,"i",14),e._uU(2," Export"),e.qZA()}}function ZC(n,r){if(1&n&&(e.TgZ(0,"span",23),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function DC(n,r){if(1&n&&(e.TgZ(0,"span",23),e._uU(1),e.qZA()),2&n){const t=r.item;e.s9C("matTooltip",t.Value),e.xp6(1),e.Oqu(t.Value)}}function vC(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",15)(1,"div")(2,"h6"),e._uU(3,"Outlet"),e.qZA(),e.TgZ(4,"ng-select",16),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ListIDs=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterOutlets())}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Categories"),e.qZA(),e.TgZ(8,"ng-select",17),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CategoryID=o)}),e.YNc(9,ZC,2,2,"ng-template",18),e.qZA()(),e.TgZ(10,"div")(11,"h6"),e._uU(12,"Brand"),e.qZA(),e.TgZ(13,"ng-select",19),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.BrandID=o)}),e.YNc(14,DC,2,2,"ng-template",18),e.qZA()(),e.TgZ(15,"div")(16,"h6"),e._uU(17,"From - To"),e.qZA(),e.TgZ(18,"div")(19,"datepicker",20),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.From=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterFromDate())}),e.qZA()(),e.TgZ(20,"div",21)(21,"datepicker",22),e.NdJ("dateChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.To=o)})("dateChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.onFilterToDate())}),e.qZA()()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("multiple",!0)("ngModel",t.pageData.Filter.ListIDs)("items",null==t.pageData.Options?null:t.pageData.Options.Entities),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CategoryID)("items",null==t.pageData.Options?null:t.pageData.Options.Categories),e.xp6(5),e.Q6J("items",null==t.pageData.Options?null:t.pageData.Options.Brands)("ngModel",t.pageData.Filter.BrandID),e.xp6(6),e.Q6J("date",t.pageData.Filter.From),e.xp6(2),e.Q6J("date",t.pageData.Filter.To)}}function bC(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",24)(1,"div")(2,"h6"),e._uU(3,"Sales"),e.qZA(),e.TgZ(4,"ng-select-infinite",25),e.NdJ("selectedChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.SalesID=o)}),e.qZA()(),e.TgZ(5,"div")(6,"h6"),e._uU(7,"Customer"),e.qZA(),e.TgZ(8,"autocompleteV2",26),e.NdJ("ngModelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.CustomerID=o)}),e.qZA()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Exclude Zero"),e.qZA(),e.TgZ(12,"radio-options",27),e.NdJ("modelChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.pageData.Filter.ExcludeZero=o)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(4),e.Q6J("selected",t.pageData.Filter.SalesID)("items",null==t.pageData.Options?null:t.pageData.Options.Sales),e.xp6(4),e.Q6J("ngModel",t.pageData.Filter.CustomerID),e.xp6(4),e.Q6J("model",t.pageData.Filter.ExcludeZero)}}function yC(n,r){1&n&&(e.TgZ(0,"th",47),e._uU(1," COST"),e.qZA())}function SC(n,r){1&n&&(e.TgZ(0,"th",48),e._uU(1," PROFIT"),e.qZA())}function AC(n,r){if(1&n&&(e.TgZ(0,"td",50),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij("",e.lcZ(2,1,t.Cost)," ")}}function wC(n,r){if(1&n&&(e.TgZ(0,"td",42),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Profit))}}const FC=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]},MC=function(n,r,t){return{CategoryID:n,From:r,To:t}};function qC(n,r){if(1&n&&(e.TgZ(0,"tr")(1,"td")(2,"a",49),e.ALo(3,"date"),e.ALo(4,"date"),e._uU(5),e.qZA()(),e.TgZ(6,"td",42),e._uU(7),e.ALo(8,"number"),e.qZA(),e.TgZ(9,"td",43),e._uU(10),e.ALo(11,"number"),e.qZA(),e.TgZ(12,"td",42),e._uU(13),e.ALo(14,"number"),e.qZA(),e.TgZ(15,"td",42),e._uU(16),e.ALo(17,"number"),e.qZA(),e.YNc(18,AC,3,3,"td",44),e.YNc(19,wC,3,3,"td",45),e.TgZ(20,"td",42),e._uU(21),e.ALo(22,"number"),e.qZA()()),2&n){const t=r.$implicit,a=e.oxw(2);e.xp6(2),e.Q6J("routerLink",e.DdM(26,FC))("queryParams",e.kEZ(27,MC,t.ID,e.xi3(3,10,a.pageData.Filter.From,"yyyy-MM-dd"),e.xi3(4,13,a.pageData.Filter.To,"yyyy-MM-dd"))),e.xp6(3),e.Oqu(t.Name),e.xp6(2),e.Oqu(e.lcZ(8,16,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(11,18,t.Total)),e.xp6(3),e.Oqu(e.lcZ(14,20,t.Discount+t.DiscountAmount)),e.xp6(3),e.Oqu(e.lcZ(17,22,t.NetSales)),e.xp6(2),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",a.roleService.product.Cost),e.xp6(2),e.hij("",e.lcZ(22,24,t.Percentage),"%")}}function IC(n,r){if(1&n&&(e.TgZ(0,"td",50),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.data.Data,"Cost")),"")}}function PC(n,r){if(1&n&&(e.TgZ(0,"td",42),e._uU(1),e.ALo(2,"number"),e.ALo(3,"sum"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",e.lcZ(2,1,e.xi3(3,3,t.data.Data,"Profit")),"")}}function OC(n,r){if(1&n&&(e.TgZ(0,"div",51)(1,"small",52),e._uU(2,"Gross Sales :"),e.qZA(),e.TgZ(3,"strong",53),e._uU(4),e.ALo(5,"number"),e.ALo(6,"sum"),e.qZA(),e.TgZ(7,"small",52),e._uU(8,"- Discount % :"),e.qZA(),e.TgZ(9,"strong",54),e._uU(10),e.ALo(11,"number"),e.ALo(12,"sum"),e.qZA(),e.TgZ(13,"small",52),e._uU(14),e.qZA(),e.TgZ(15,"strong",54),e._uU(16),e.ALo(17,"number"),e.qZA(),e.TgZ(18,"small",52),e._uU(19),e.qZA(),e.TgZ(20,"strong",54),e._uU(21),e.ALo(22,"number"),e.qZA(),e.TgZ(23,"small",52),e._uU(24),e.qZA(),e.TgZ(25,"strong",55),e._uU(26),e.ALo(27,"number"),e.ALo(28,"sum"),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(4),e.Oqu(e.lcZ(5,8,e.xi3(6,10,t.data.Data,"Total"))),e.xp6(6),e.Oqu(e.lcZ(11,13,e.xi3(12,15,t.data.Data,"Discount"))),e.xp6(4),e.hij("- Discount ",t.data.Currency," :"),e.xp6(2),e.Oqu(e.lcZ(17,18,t.data.TotalDiscountAmount.DiscountAmount)),e.xp6(3),e.hij("- Point Used ",t.data.Currency," :"),e.xp6(2),e.Oqu(e.lcZ(22,20,t.data.TotalDiscountAmount.PointUsed)),e.xp6(3),e.hij("= Net Sales ",t.data.Currency," :"),e.xp6(2),e.Oqu(e.lcZ(27,22,e.xi3(28,24,t.data.Data,"NetSales")))}}function NC(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",28)(1,"div",29)(2,"table",30),e.NdJ("matSortChange",function(o){e.CHM(t);const i=e.oxw();return e.KtG(i.sortData(o))}),e.TgZ(3,"thead",31)(4,"tr")(5,"th",32),e._uU(6,"CATEGORY"),e.qZA(),e.TgZ(7,"th",33),e._uU(8,"QUANTITY"),e.qZA(),e.TgZ(9,"th",34),e._uU(10," GROSS SALES"),e.qZA(),e.TgZ(11,"th",35),e._uU(12,"DISCOUNT"),e.qZA(),e.TgZ(13,"th",36),e._uU(14,"NET SALES"),e.qZA(),e.YNc(15,yC,2,0,"th",37),e.YNc(16,SC,2,0,"th",38),e.TgZ(17,"th",39),e._uU(18," % "),e.qZA()()(),e.TgZ(19,"tbody"),e.YNc(20,qC,23,31,"tr",40),e.qZA(),e.TgZ(21,"tfoot")(22,"tr",41)(23,"td",42),e._uU(24,"Total : "),e.qZA(),e.TgZ(25,"td",42),e._uU(26),e.ALo(27,"number"),e.ALo(28,"sum"),e.qZA(),e.TgZ(29,"td",43)(30,"a"),e._uU(31),e.ALo(32,"number"),e.ALo(33,"sum"),e.qZA()(),e.TgZ(34,"td",42),e._uU(35),e.ALo(36,"number"),e.ALo(37,"sum"),e.qZA(),e.TgZ(38,"td",42),e._uU(39),e.ALo(40,"number"),e.ALo(41,"sum"),e.qZA(),e.YNc(42,IC,4,6,"td",44),e.YNc(43,PC,4,6,"td",45),e.TgZ(44,"td",42),e._uU(45),e.ALo(46,"number"),e.ALo(47,"sum"),e.qZA()()()()(),e.YNc(48,OC,29,27,"div",46),e.qZA()}if(2&n){const t=e.oxw();e.xp6(15),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(4),e.Q6J("ngForOf",t.data.Data),e.xp6(6),e.Oqu(e.lcZ(27,11,e.xi3(28,13,t.data.Data,"Quantity"))),e.xp6(5),e.Oqu(e.lcZ(32,16,e.xi3(33,18,t.data.Data,"Total"))),e.xp6(4),e.Oqu(e.lcZ(36,21,e.xi3(37,23,t.data.Data,"Discount"))),e.xp6(4),e.Oqu(e.lcZ(40,26,e.xi3(41,28,t.data.Data,"NetSales"))),e.xp6(3),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(1),e.Q6J("ngIf",t.roleService.product.Cost),e.xp6(2),e.hij(" ",e.lcZ(46,31,e.xi3(47,33,t.data.Data,"Percentage")),"%"),e.xp6(3),e.Q6J("ngIf",t.data.Data.length>0)}}const LC=function(){return["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"]},QC=function(){return["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_Sales_Tree"]},EC=function(){return["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"]},YC=[{path:"Sales_Report/Standard/Detail",component:Kt},{path:"Sales_Report/Standard/Summary",component:yn},{path:"Sales_Report/Standard/Top_Brand",component:Qn},{path:"Sales_Report/Standard/Top_Brand/Top_Brand_Chart",component:z2},{path:"Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis",component:MT},{path:"Sales_Report/Standard/Top_Customers",component:ro},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Age",component:xo},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender",component:wo},{path:"Sales_Report/Standard/Top_Customers/Top_Suppliers",component:Yo},{path:"Sales_Report/Standard/Products_Sold",component:Ma},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet",component:Ea},{path:"Sales_Report/Standard/Products_Sold/Product_Sales",component:ei},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Logistics",component:_i},{path:"Sales_Report/Standard/Category_Sold",component:(()=>{class n extends D.n{constructor(t,a,o,i,s){super(t,"Report/CategorySales","ReportLoader/CategorySales"),(0,l.Z)(this,"httpService",void 0),(0,l.Z)(this,"csvConverter",void 0),(0,l.Z)(this,"reportFilterService",void 0),(0,l.Z)(this,"roleService",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"hideMore",!0),this.httpService=t,this.csvConverter=a,this.reportFilterService=o,this.roleService=i,this.matDialog=s}postInit(){this.menuData.H=this.data.PageTitle}preInitList(){this.pageData.Filter.ListIDs=this.reportFilterService.initOutletFilter(this.pageData.Filter.ListIDs),this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}sortData(t){const a=this.data.Data.slice();this.data.Data=t.active&&""!==t.direction?a.sort((o,i)=>{const s="asc"===t.direction;switch(t.active){case"Name":return this.compare(o.Name,i.Name,s);case"Total":return this.compare(o.Total,i.Total,s);case"Quantity":return this.compare(o.Quantity,i.Quantity,s);case"Discount":return this.compare(o.Discount,i.Discount,s);case"NetSales":return this.compare(o.NetSales,i.NetSales,s);case"Cost":return this.compare(o.Cost,i.Cost,s);case"Profit":return this.compare(o.Profit,i.Profit,s);case"Percentage":return this.compare(o.Percentage,i.Percentage,s);default:return 0}}):a}openExportModal(){this.matDialog.open(M.H,{data:{title:"Sales by Category",exportTypes:[{ID:"ReportExport/CategorySales",Value:"Default",FileName:"Category Sales"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)(e.Y36(_.O),e.Y36(Z.O),e.Y36(N.z),e.Y36(b.N),e.Y36(y.uw))}),(0,l.Z)(n,"\u0275cmp",e.Xpm({type:n,selectors:[["POS-category-sales-table"]],features:[e.qOj],decls:21,vars:14,consts:[[3,"pageData","text","hideSearchBox","textChange","onSubmit"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","me-6",3,"routerLink"],[1,"fa-solid","fa-chart-area"],[1,"fa-solid","fa-table-tree"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa-solid","fa-scale-balanced","me-2"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ms-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fa-solid","fa-caret-down"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["bindLabel","Value","bindValue","Key","placeholder","Choose Brand",3,"items","ngModel","ngModelChange"],["name","From",3,"date","dateChange"],[1,"mt-4"],["name","To",3,"date","dateChange"],["matTooltipPosition","above",3,"matTooltip"],["id","more-filter","container","",1,"ms-6"],["bindLabel","Name","bindValue","ID","placeholder","Choose...","id","inputSales",3,"selected","items","selectedChange"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion","notFoundMessageFor","customer",1,"w-100",3,"ngModel","ngModelChange"],[3,"model","modelChange"],[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","Total","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Discount","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","NetSales","arrowPosition","before",1,"flex-right",2,"width","120px"],["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"],["mat-sort-header","Percentage","arrowPosition","before","title","Percentage contribution of a category",1,"flex-right",2,"width","80px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-end"],[1,"text-end","text-primary"],["class","text-end text-danger",4,"ngIf"],["class","text-end",4,"ngIf"],["class","h6 mt-12",4,"ngIf"],["mat-sort-header","Cost","arrowPosition","before",1,"flex-right",2,"width","120px"],["mat-sort-header","Profit","arrowPosition","before",1,"flex-right",2,"width","120px"],[3,"routerLink","queryParams"],[1,"text-end","text-danger"],[1,"h6","mt-12"],[1,"text-muted","h6"],[1,"text-primary","fw-bold","h2"],[1,"text-danger","fw-bold","h2"],[1,"text-success","fw-bold","h2"]],template:function(t,a){1&t&&(e.TgZ(0,"mainpanel-cmp",0),e.NdJ("textChange",function(i){return a.pageData.Filter.Number=i})("onSubmit",function(){return a.searchFromPageOne()}),e.TgZ(1,"actions"),e.YNc(2,CC,3,0,"button",1),e.TgZ(3,"a",2),e._UZ(4,"i",3),e._uU(5," Chart View"),e.qZA(),e.TgZ(6,"a",2),e._UZ(7,"i",4),e._uU(8," Tree View"),e.qZA(),e.TgZ(9,"a",5),e._UZ(10,"i",6),e._uU(11,"By Outlet"),e.qZA()(),e.TgZ(12,"filters")(13,"div",7),e.YNc(14,vC,22,9,"div",8),e.YNc(15,bC,13,4,"div",9),e.TgZ(16,"a",10),e.NdJ("click",function(){return a.hideMore=!a.hideMore}),e._uU(17),e._UZ(18,"i",11),e.qZA()()(),e.TgZ(19,"content"),e.YNc(20,NC,49,36,"div",12),e.qZA()()),2&t&&(e.Q6J("pageData",a.menuData)("text",a.pageData.Filter.Number)("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",a.roleService.global.Export),e.xp6(1),e.Q6J("routerLink",e.DdM(11,LC)),e.xp6(3),e.Q6J("routerLink",e.DdM(12,QC)),e.xp6(3),e.Q6J("routerLink",e.DdM(13,EC)),e.xp6(5),e.Q6J("ngIf",a.pageData.Filter),e.xp6(1),e.Q6J("ngIf",!a.hideMore),e.xp6(2),e.hij("",a.hideMore?"More":"Less"," "),e.xp6(3),e.Q6J("ngIf",a.data))},dependencies:[T.p,p.sg,p.O5,h.rH,m.w9,m.ir,A.QB,d.JJ,d.On,x.gM,f.YE,f.nU,q.P,E.J,j.R,S.qU,p.JJ,p.uU]})),n})()},{path:"Sales_Report/Standard/Category_Sold/Category_Sales_Tree",component:Ls},{path:"Sales_Report/Standard/Category_Sold/Category_By_Outlet",component:zs},{path:"Sales_Report/Standard/Category_Sold/Category",component:ep},{path:"Sales_Report/Standard/Peak",component:ap},{path:"Sales_Report/Standard/Peak/Peak",component:xp},{path:"Sales_Report/Standard/Daily",component:Fp},{path:"Sales_Report/Standard/Daily/Daily_Table",component:Tc},{path:"Sales_Report/Standard/Monthly",component:Jp},{path:"Sales_Report/Standard/Monthly/Monthly_Table",component:kc},{path:"Sales_Report/Standard/Yearly",component:TC},{path:"Sales_Report/Standard/Yearly/Comparison",component:Bp},{path:"Sales_Report/Standard/Daily/Daily_Quantity",component:Kc},{path:"Sales_Report/Standard/Daily/Daily_Quantity/Monthly",component:ed},{path:"Sales_Report/Standard/Outlet_Performance",component:wd},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Graphic",component:Od},{path:"Sales_Report/Standard/Outlet_Performance/Detail",component:Bu},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance",component:h_},{path:"Sales_Report/Standard/Sales_Order_Tag",component:A2},{path:"Sales_Report/Standard/Person",component:am},{path:"Sales_Report/Standard/Person/Person_Commission",component:fm},{path:"Sales_Report/Standard/Person/Commission_Report",component:Lm},{path:"Sales_Report/Standard/Person/Commission_Report/Commission_Report_Detail",component:Vm},{path:"Sales_Report/Standard/Discounted_Sales",component:Jx},{path:"Purchases_Report/Detail",component:Tg},{path:"Purchases_Report/Summary",component:yg},{path:"Purchases_Report/Supplier",component:Pg},{path:"Purchases_Report/Product",component:Qg},{path:"Purchases_Report/History",component:ih},{path:"Purchases_Report/Daily",component:ch},{path:"Purchases_Report/Daily/Monthly",component:gh},{path:"Purchases_Report/Volume",component:fh},{path:"Purchases_Report/Sales",component:vh},{path:"Purchases_Report/Tax",component:V2},{path:"Purchases_Report/Outlet",component:$h},{path:"Purchases_Report/Outlet/Outlet_Group_Performance",component:C1},{path:"Purchases_Report/Outlet/Outlet_Monthly_Perfomance",component:O1},{path:"Sales_Report/Group/City",component:k1},{path:"Sales_Report/Group/Tag",component:z1},{path:"Sales_Report/Group/Customer_Group",component:sf},{path:"Sales_Report/Group/Sales_Group",component:hf},{path:"Sales_Report/Standard/Compare",component:uC},{path:"Sales_Report/Standard/Compare/Outlet_Monthly_Perfomance",component:F_},{path:"Sales_Report/Advanced/Tax_Report",component:Pf},{path:"Sales_Report/Advanced/Visitor",component:pp},{path:"Sales_Report/Advanced/Tax_Report/By_Outlet",component:Hf},{path:"Sales_Report/Advanced/Product_Life_Cycle",component:Xf},{path:"Sales_Report/Advanced/Product_Profit",component:ux},{path:"Sales_Report/Advanced/Exchanged_Sales",component:Cx},{path:"Sales_Report/Advanced/Variant_Model_Rank",component:Ax},{path:"Sales_Report/Advanced/Logistics_Service",component:_C.k},{path:"Sales_Report/Standard/Discounted_Sales/Discounted_Products",component:ig},{path:"Return/Sales_Return",component:Rx},{path:"Return/Purchase_Return",component:Wx},{path:"Sales_Report/Standard/Products_Sold/Invoice_Items",component:mT},{path:"Sales_Report/Standard/Price_Analysis",component:I2},{path:"",redirectTo:"Sales_Report/Standard/Products_Sold",pathMatch:"full"}];let RC=(()=>{class n{}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)}),(0,l.Z)(n,"\u0275mod",e.oAB({type:n})),(0,l.Z)(n,"\u0275inj",e.cJS({imports:[h.Bz.forChild(YC),h.Bz]})),n})();var GC=g(65131),HC=g(3077);let VC=(()=>{class n{}return(0,l.Z)(n,"\u0275fac",function(t){return new(t||n)}),(0,l.Z)(n,"\u0275mod",e.oAB({type:n})),(0,l.Z)(n,"\u0275inj",e.cJS({providers:[p.uU],imports:[T.R,S.dr,p.ez,RC,m.A0,A.ZU,d.u5,d.UX,O.FA,Y.XK,V.Fk,B.c,Y.Ng,K.Nh,x.AV,W.TU,R.vV,m.A0,f.JX,ne.p0,GC.X,X.d,q.K,_e.N,te.Z,E.Q,HC.T,j.q,Zp,M.H,ge.E,ye,rs,ye]})),n})()},76359:(Te,$,g)=>{g.d($,{R:()=>y,q:()=>me});var l=g(81180),p=g(36895),d=g(94650),f=g(24006),ne=g(67327),O=g(77579),Y=g(78372),V=g(71884),B=g(54004),K=g(39300),W=g(82722);class R{constructor(){(0,l.Z)(this,"_dataBuffer",void 0),(0,l.Z)(this,"_bufferSize",void 0),(0,l.Z)(this,"_data",void 0),(0,l.Z)(this,"_loading",void 0),(0,l.Z)(this,"_input$",new O.x),(0,l.Z)(this,"_destroy$",new O.x),this._loading=!1,this._bufferSize=50,this.data=[]}onSearch(){this._input$.pipe((0,Y.b)(200),(0,V.x)(),(0,B.U)(_=>(_&&(_=_.toLowerCase()),this.filterData(_))),(0,K.h)(_=>void 0!==_),(0,W.R)(this._destroy$)).subscribe(_=>{this._dataBuffer=_.slice(0,this._bufferSize)})}onClear(){this._dataBuffer=this._data.slice(0,this._bufferSize)}filterData(_){let x,I=-1;return this._data.filter(X=>(x=JSON.stringify(X).toLowerCase(),I=x.indexOf(_),-1!==I||null==_))}get input$(){return this._input$}get bufferData(){return this._dataBuffer}get loading(){return this._loading}set data(_){this._data=_||[],this._dataBuffer=this._data.slice(0,this._bufferSize),this.onSearch()}initSelectedValue(_,I){if(ne.gT.IsNotEmpty(_)){let x=this._data.filter(U=>-1!==U[I].toString().toLowerCase().indexOf(_));this._dataBuffer=x.slice(0,this._bufferSize)}}set bufferSize(_){this._bufferSize=_}onScrollToEnd(){this.fetchMore()}fetchMore(){const _=this._dataBuffer.length,I=this._data.slice(_,this._bufferSize+_);this._loading=!0,setTimeout(()=>{this._loading=!1,this._dataBuffer=this._dataBuffer.concat(I)},200)}destroy(){this._destroy$.next(!0),this._destroy$.complete()}}var q=g(88796);const m=["selectId"];function h(e,_){if(1&e&&(d.TgZ(0,"span",3),d._uU(1),d.qZA()),2&e){const I=_.item,x=d.oxw();d.Q6J("title",I[x.bindLabel]),d.xp6(1),d.Oqu(I[x.bindLabel])}}let y=(()=>{class e{set items(I){this.ngSelectInfiniteScroll.data=I,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}get selected(){return this._selected}set selected(I){this._selected=I,this.ngSelectInfiniteScroll.initSelectedValue(this.selected,this.bindValue)}constructor(){(0,l.Z)(this,"placeholder",void 0),(0,l.Z)(this,"bindValue",void 0),(0,l.Z)(this,"bindLabel",void 0),(0,l.Z)(this,"width","100%"),(0,l.Z)(this,"clearable",!0),(0,l.Z)(this,"parent",void 0),(0,l.Z)(this,"disabled",!1),(0,l.Z)(this,"optionTitle",!1),(0,l.Z)(this,"ngSelectElement",void 0),(0,l.Z)(this,"_selected",void 0),(0,l.Z)(this,"selectedChange",void 0),(0,l.Z)(this,"selectedLabel",void 0),(0,l.Z)(this,"ngSelectInfiniteScroll",void 0),this.ngSelectInfiniteScroll=new R,this.selectedChange=new d.vpe,this.selectedLabel=new d.vpe}onSelectChange(I){I?(this.selectedChange.emit(I[this.bindValue]),this.selectedLabel.emit(I[this.bindLabel])):(this.selectedChange.emit(null),this.selectedLabel.emit(null))}}return(0,l.Z)(e,"\u0275fac",function(I){return new(I||e)}),(0,l.Z)(e,"\u0275cmp",d.Xpm({type:e,selectors:[["ng-select-infinite"]],viewQuery:function(I,x){if(1&I&&d.Gf(m,7),2&I){let U;d.iGM(U=d.CRH())&&(x.ngSelectElement=U.first)}},inputs:{placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",width:"width",clearable:"clearable",parent:"parent",disabled:"disabled",optionTitle:"optionTitle",items:"items",selected:"selected"},outputs:{selectedChange:"selectedChange",selectedLabel:"selectedLabel"},decls:3,vars:12,consts:[[3,"disabled","virtualScroll","typeahead","items","bindLabel","bindValue","placeholder","ngModel","clearable","appendTo","clear","scrollToEnd","change"],["selectId",""],["ng-option-tmp",""],[3,"title"]],template:function(I,x){1&I&&(d.TgZ(0,"ng-select",0,1),d.NdJ("clear",function(){return x.ngSelectInfiniteScroll.onClear()})("scrollToEnd",function(){return x.ngSelectInfiniteScroll.onScrollToEnd()})("change",function(X){return x.onSelectChange(X)}),d.YNc(2,h,2,2,"ng-template",2),d.qZA()),2&I&&(d.Udp("width",x.width),d.Q6J("disabled",x.disabled)("virtualScroll",!0)("typeahead",x.ngSelectInfiniteScroll.input$)("items",x.ngSelectInfiniteScroll.bufferData)("bindLabel",x.bindLabel)("bindValue",x.bindValue)("placeholder",x.placeholder)("ngModel",x.selected)("clearable",x.clearable)("appendTo",x.parent))},dependencies:[q.w9,q.ir,f.JJ,f.On]})),e})(),me=(()=>{class e{}return(0,l.Z)(e,"\u0275fac",function(I){return new(I||e)}),(0,l.Z)(e,"\u0275mod",d.oAB({type:e})),(0,l.Z)(e,"\u0275inj",d.cJS({imports:[p.ez,q.A0,f.u5]})),e})()},5536:(Te,$,g)=>{g.d($,{E:()=>B});var l=g(81180),p=g(94650),d=g(24006),f=g(70585),ne=g(36895),O=g(35593),Y=g(10805);const V=function(){return{standalone:!0}};let B=(()=>{class K{constructor(R){(0,l.Z)(this,"datePipe",void 0),(0,l.Z)(this,"time",void 0),(0,l.Z)(this,"timeChange",void 0),this.datePipe=R,this.timeChange=new p.vpe}ngOnInit(){}onTimeChange(R){let q=null;R&&(q=this.datePipe.transform(R,"HH:mm")),this.timeChange.emit(q),this.onTimePickerChange()}onShowCalendar(){const R=document.getElementById("dropdown-filter");if(R){var q=new bootstrap.Dropdown(R);q&&(q._config.autoClose="inside")}}onTimePickerChange(){const R=document.getElementById("dropdown-filter");if(R){var q=new bootstrap.Dropdown(R);q&&(q._config.autoClose="outside")}}}return(0,l.Z)(K,"\u0275fac",function(R){return new(R||K)(p.Y36(ne.uU))}),(0,l.Z)(K,"\u0275cmp",p.Xpm({type:K,selectors:[["app-timepicker"]],inputs:{time:"time"},outputs:{timeChange:"timeChange"},standalone:!0,features:[p.jDz],decls:4,vars:5,consts:[["styleClass","custom-height","id","shippingTime","appendTo","body",3,"baseZIndex","ngModel","timeOnly","ngModelOptions","ngModelChange","onSelect"],["myCalendar",""],["pButton","","type","button","label","Close",3,"click"]],template:function(R,q){if(1&R){const m=p.EpF();p.TgZ(0,"p-calendar",0,1),p.NdJ("ngModelChange",function(y){return q.time=y})("ngModelChange",function(y){return q.onTimeChange(y)})("onSelect",function(){return q.onShowCalendar()}),p.TgZ(2,"p-footer")(3,"button",2),p.NdJ("click",function(){return p.CHM(m),p.MAs(1).hideOverlay(),p.KtG(q.onShowCalendar())}),p.qZA()()()}2&R&&p.Q6J("baseZIndex",1100)("ngModel",q.time)("timeOnly",!0)("ngModelOptions",p.DdM(4,V))},dependencies:[f._8,f.f,O.Hq,Y.$_,d.u5,d.JJ,d.On],styles:["p-calendar span.p-calendar.p-calendar-timeonly.custom-height{height:44px;width:55px}"]})),K})()},51740:(Te,$,g)=>{g.d($,{j:()=>ne,o:()=>f});var l=g(94650),p=g(36895),d=g(24006);let f=(()=>{class O{constructor(V,B,K){this.el=V,this.ngModel=B,this.cd=K}ngAfterViewInit(){this.updateFilledState(),this.cd.detectChanges()}ngDoCheck(){this.updateFilledState()}onInput(V){this.updateFilledState()}updateFilledState(){this.filled=this.el.nativeElement.value&&this.el.nativeElement.value.length||this.ngModel&&this.ngModel.model}}return O.\u0275fac=function(V){return new(V||O)(l.Y36(l.SBq),l.Y36(d.On,8),l.Y36(l.sBO))},O.\u0275dir=l.lG2({type:O,selectors:[["","pInputText",""]],hostAttrs:[1,"p-inputtext","p-component","p-element"],hostVars:2,hostBindings:function(V,B){1&V&&l.NdJ("input",function(W){return B.onInput(W)}),2&V&&l.ekj("p-filled",B.filled)}}),O})(),ne=(()=>{class O{}return O.\u0275fac=function(V){return new(V||O)},O.\u0275mod=l.oAB({type:O}),O.\u0275inj=l.cJS({imports:[p.ez]}),O})()}}]);