dealpos 11.2.3 → 11.2.4

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 +1 @@
1
- "use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[1122],{1122:(pZ,P,f)=>{f.r(P),f.d(P,{ReportsModule:()=>sZ});var s=f(6019),p=f(9133),Z=f(2262),_t=f(4176),ut=f(8727),L=f(6731),gt=f(9859),dt=f(138),mt=f(2605),Q=f(8525),Zt=f(7348),q=f(1949),c=f(5496),u=f(4382),S=f(5304),Y=f(5761),t=f(3668),g=f(8596),y=f(2387),I=f(7481),M=f(859);let ht=(()=>{class n{constructor(e,o,a,r){this.httpService=e,this.toaster=o,this.dialogRef=a,this.data=r,this.modalConfig=new Y.O,this.ExportPageNumber=r.Filter.ExportPageNumber,this.ExportRowCount=r.Filter.ExportRowCount,this.totalCount=r.TotalCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px",this.modalConfig.okText="Export"}ngOnInit(){this.countExportRowCount()}onPageNumberChange(e){this.ExportPageNumber=e,this.countExportRowCount()}countExportRowCount(){let e=this.data.Filter.ExportRowCount;this.ExportPageNumber>1?(this.endExport=this.totalCount-this.ExportPageNumber*e>0?this.ExportPageNumber*e:this.totalCount,this.startExport=this.ExportPageNumber-1==1?e+1:(this.ExportPageNumber-1)*e+1,this.startExport>this.totalCount&&(this.startExport=this.totalCount)):(this.startExport=this.ExportPageNumber,this.endExport=this.totalCount>e?e:this.totalCount)}onOk(){this.dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(S.so),t.Y36(S.WI))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ng-component"]],decls:28,vars:14,consts:[[3,"config","onOk","onCancel","onClose"],[1,"container",2,"width","350px"],[1,"row","form-group"],[1,"col-6","pl-0","pr-3"],[1,"font-weight-bold"],["type","text","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],[1,"col-6","pr-0","pl-3"],[1,"border","border-2","border-secondary","pl-3","pt-3","bg-light",2,"height","32px"],[1,"col-12","p-0"],[1,"border","border-1","pl-3","pt-3","alert-warning",2,"height","32px"],[1,"fas","fa-info-circle","mr-1"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),t.TgZ(1,"content"),t.TgZ(2,"div",1),t.TgZ(3,"div",2),t.TgZ(4,"div",3),t.TgZ(5,"label",4),t._uU(6,"Page Number"),t.qZA(),t.TgZ(7,"input",5),t.NdJ("ngModelChange",function(r){return o.ExportPageNumber=r})("ngModelChange",function(r){return o.onPageNumberChange(r)}),t.qZA(),t.qZA(),t.TgZ(8,"div",6),t.TgZ(9,"label",4),t._uU(10,"Page Size"),t.qZA(),t.TgZ(11,"div",7),t._uU(12),t.ALo(13,"number"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"div",2),t.TgZ(15,"div",8),t.TgZ(16,"div",9),t._UZ(17,"i",10),t._uU(18," Exporting ["),t.TgZ(19,"span",4),t._uU(20),t.ALo(21,"number"),t.ALo(22,"number"),t.qZA(),t._uU(23,"] record of "),t.TgZ(24,"span",4),t._uU(25),t.ALo(26,"number"),t.qZA(),t._uU(27," transactions "),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.Q6J("config",o.modalConfig),t.xp6(7),t.Q6J("ngModel",o.ExportPageNumber),t.xp6(5),t.Oqu(t.lcZ(13,6,o.ExportRowCount)),t.xp6(8),t.AsE("",t.lcZ(21,8,o.startExport)," - ",t.lcZ(22,10,o.endExport),""),t.xp6(5),t.Oqu(t.lcZ(26,12,o.totalCount)))},directives:[I.M,p.Fj,M.b,p.JJ,p.On],pipes:[s.JJ],styles:[""]}),n})();var xt=f(7080),h=f(4765),d=f(9265),D=f(7163),C=f(4290),T=f(1464);function Tt(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",25),t.TgZ(1,"a",28),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).export("default")}),t._UZ(2,"i",29),t._uU(3," Export"),t.qZA(),t.TgZ(4,"button",30),t._UZ(5,"b",31),t.qZA(),t.TgZ(6,"ul",32),t.TgZ(7,"li",33),t.TgZ(8,"a",34),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).export("contact")}),t._uU(9,"Export With Contact Detail"),t.qZA(),t.qZA(),t.TgZ(10,"li",33),t.TgZ(11,"a",34),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).export("complete")}),t._uU(12,"Export Complete Detail"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}}function Ct(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",35),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",36),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Customer"),t.qZA(),t.TgZ(8,"autocompleteV2",37),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.CustomerID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From/To"),t.qZA(),t.TgZ(12,"datepicker",38),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",39),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Sales"),t.qZA(),t.TgZ(17,"ng-select",40),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Group"),t.qZA(),t.TgZ(21,"ng-select",40),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ContactGroupID=a}),t.qZA(),t.qZA(),t.TgZ(22,"div"),t.TgZ(23,"h6"),t._uU(24,"Bin"),t.qZA(),t.TgZ(25,"radio-options",41),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Bin=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CustomerID),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("items",e.pageData.Options.Sales)("ngModel",e.pageData.Filter.SalesID),t.xp6(4),t.Q6J("items",e.pageData.Options.ContactGroups)("ngModel",e.pageData.Filter.ContactGroupID),t.xp6(4),t.Q6J("model",e.pageData.Filter.Bin)}}function ft(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",42),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Type"),t.qZA(),t.TgZ(4,"ng-select",40),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Currency"),t.qZA(),t.TgZ(8,"ng-select",43),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Delivery"),t.qZA(),t.TgZ(12,"ng-select",44),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.DeliveryStateID=a}),t.qZA(),t.qZA(),t.TgZ(13,"div"),t.TgZ(14,"h6"),t._uU(15,"Complementary"),t.qZA(),t.TgZ(16,"radio-options",45),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Complementary=a}),t.qZA(),t.qZA(),t.TgZ(17,"div"),t.TgZ(18,"h6"),t._uU(19,"Creator"),t.qZA(),t.TgZ(20,"autocompleteV2",46),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.CreatorID=a}),t.qZA(),t.qZA(),t.TgZ(21,"div"),t.TgZ(22,"h6"),t._uU(23,"Note Visible"),t.qZA(),t.TgZ(24,"radio-options",47),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.NoteVisible=a}),t.qZA(),t.qZA(),t.TgZ(25,"div"),t.TgZ(26,"h6"),t._uU(27,"Sort"),t.qZA(),t.TgZ(28,"radio-options",48),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.SortBy=a})("modelChange",function(){return t.CHM(e),t.oxw(2).searchFromPageOne()}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("items",e.pageData.Options.Types)("ngModel",e.pageData.Filter.TypeID),t.xp6(4),t.Q6J("items",e.pageData.Options.Currencies)("ngModel",e.pageData.Filter.CurrencyID),t.xp6(4),t.Q6J("items",e.pageData.Options.Deliveries)("ngModel",e.pageData.Filter.DeliveryStateID),t.xp6(4),t.Q6J("model",e.pageData.Filter.Complementary),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CreatorID),t.xp6(4),t.Q6J("model",e.pageData.Filter.NoteVisible),t.xp6(4),t.Q6J("model",e.pageData.Filter.SortBy)("options",e.SortBy)}}function At(n,i){1&n&&(t.TgZ(0,"th",49),t._uU(1," @ Cost "),t.qZA())}function qt(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1," /"),t.qZA())}const Dt=function(){return["/menu/Orders/Orders/Sales_Order/Info"]},R=function(n){return{ID:n}};function yt(n,i){if(1&n&&(t.TgZ(0,"a",52),t.TgZ(1,"span",66),t._uU(2),t.qZA(),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("routerLink",t.DdM(3,Dt))("queryParams",t.VKq(4,R,e.SalesOrderID)),t.xp6(2),t.Oqu("#"+e.SalesOrderNumber)}}function vt(n,i){if(1&n&&(t.TgZ(0,"span",56),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" "," - Profit: "+t.lcZ(2,1,e.Profit),"")}}function St(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1,"- "),t.qZA())}function Mt(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1,": "),t.qZA())}function bt(n,i){if(1&n&&(t.TgZ(0,"small"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.xp6(1),t.hij(" (",e.Commissions[0].Quantity," unit )")}}function Jt(n,i){if(1&n&&(t.TgZ(0,"i",78),t._uU(1),t.YNc(2,bt,2,1,"small",24),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" sold by ",e.Commissions[0].SalesName," "),t.xp6(1),t.Q6J("ngIf",(null==e?null:e.Commissions[0].Quantity)<e.Quantity)}}function Ot(n,i){if(1&n&&(t.TgZ(0,"li"),t.TgZ(1,"i"),t._uU(2),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.hij("( ",e.Quantity+" unit by "+e.SalesName," )")}}function It(n,i){if(1&n&&(t.TgZ(0,"ul",79),t.TgZ(1,"li"),t.TgZ(2,"i"),t._uU(3,"sold by"),t.qZA(),t.qZA(),t.YNc(4,Ot,3,1,"li",18),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(4),t.Q6J("ngForOf",null==e?null:e.Commissions)}}function Ut(n,i){if(1&n&&(t.TgZ(0,"th",80),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,null==e?null:e.UnitCost)," ")}}function Ft(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"th",11),t.TgZ(2,"div"),t.TgZ(3,"span",67),t._uU(4),t.qZA(),t.YNc(5,Jt,3,2,"i",68),t.YNc(6,It,5,1,"ul",69),t._UZ(7,"span",70),t.qZA(),t.qZA(),t.TgZ(8,"th",71),t._uU(9),t.qZA(),t.TgZ(10,"th",72),t._uU(11),t.ALo(12,"number"),t.qZA(),t.TgZ(13,"th",14),t._uU(14),t.qZA(),t.YNc(15,Ut,3,3,"th",73),t.TgZ(16,"th",74),t._uU(17),t.ALo(18,"number"),t.qZA(),t.TgZ(19,"th",75),t.TgZ(20,"div",76),t._uU(21),t.qZA(),t.TgZ(22,"div",77),t._uU(23),t.ALo(24,"number"),t.qZA(),t.qZA(),t.TgZ(25,"th",74),t._uU(26),t.ALo(27,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(3);t.xp6(4),t.Oqu(null==e?null:e.Name),t.xp6(1),t.Q6J("ngIf",1==(null==e?null:e.Commissions.length)),t.xp6(1),t.Q6J("ngIf",(null==e?null:e.Commissions.length)>1),t.xp6(1),t.Q6J("innerHtml",null==e?null:e.Note,t.oJD),t.xp6(2),t.hij(" ",null==e?null:e.Code," "),t.xp6(2),t.hij(" ",t.lcZ(12,12,null==e?null:e.Quantity)," "),t.xp6(3),t.hij(" ",null==e?null:e.UOMName," "),t.xp6(1),t.Q6J("ngIf",o.pageData.HasRoleCost),t.xp6(2),t.hij(" ",t.lcZ(18,14,null==e?null:e.UnitPrice)," "),t.xp6(4),t.hij(" ",0==(null==e?null:e.Discount)?"":(null==e?null:e.Discount)+"%"," "),t.xp6(2),t.hij(" ",0==(null==e?null:e.DiscountAmount)?"":t.lcZ(24,16,null==e?null:e.DiscountAmount)," "),t.xp6(3),t.hij(" ",t.lcZ(27,18,null==e?null:e.Total)," ")}}function wt(n,i){if(1&n&&(t.ynx(0),t.TgZ(1,"tr"),t.TgZ(2,"th",81),t._uU(3),t.qZA(),t.TgZ(4,"th",82),t._uU(5),t.qZA(),t.TgZ(6,"th",83),t._uU(7),t.ALo(8,"number"),t.qZA(),t.qZA(),t.BQk()),2&n){const e=i.$implicit;t.xp6(3),t.hij("",e.Label," :"),t.xp6(2),t.hij(" ",e.CurrencySymbol," "),t.xp6(2),t.hij(" ",t.lcZ(8,3,e.Amount)," ")}}const Nt=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]};function Pt(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"div",50),t.TgZ(2,"div",51),t.TgZ(3,"div"),t.TgZ(4,"a",52),t.TgZ(5,"span",53),t._uU(6),t.qZA(),t.qZA(),t.YNc(7,qt,2,0,"span",24),t.YNc(8,yt,3,6,"a",54),t.TgZ(9,"span"),t._uU(10),t.ALo(11,"date"),t._UZ(12,"small",55),t.ALo(13,"date"),t.TgZ(14,"small",56),t._uU(15),t.ALo(16,"showIfNotNullOrEmptyString"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(17,"div"),t.TgZ(18,"strong",57),t._uU(19),t.ALo(20,"number"),t.ALo(21,"sum"),t.TgZ(22,"span"),t._uU(23),t.ALo(24,"showIfNotNullOrEmptyString"),t.qZA(),t.qZA(),t.YNc(25,vt,3,3,"span",58),t.TgZ(26,"i",59),t._uU(27),t.qZA(),t.TgZ(28,"span",60),t._uU(29),t.qZA(),t.YNc(30,St,2,0,"span",24),t.YNc(31,Mt,2,0,"span",24),t.TgZ(32,"span",60),t._uU(33),t.qZA(),t.qZA(),t.qZA(),t.TgZ(34,"div",61),t.TgZ(35,"label",62),t._uU(36),t.qZA(),t.qZA(),t.qZA(),t.TgZ(37,"table",63),t._UZ(38,"thead"),t.TgZ(39,"tbody",64),t.YNc(40,Ft,28,20,"tr",18),t.qZA(),t.qZA(),t.TgZ(41,"table",65),t.YNc(42,wt,9,5,"ng-container",18),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(4),t.Q6J("routerLink",t.DdM(36,Nt))("queryParams",t.VKq(37,R,e.ID)),t.xp6(2),t.hij(" ",e.EntityName+" # "+e.Number,""),t.xp6(1),t.Q6J("ngIf",o.pageData.DualReceiptNumber),t.xp6(1),t.Q6J("ngIf",o.pageData.DualReceiptNumber),t.xp6(2),t.hij(" "," - "+t.xi3(11,19,e.Date,"dd MMM yyyy")," "),t.xp6(2),t.Q6J("innerHtml","("+t.xi3(13,22,e.Created,"HH:mm")+(null!=e.Order&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",t.oJD),t.xp6(3),t.Oqu(t.xi3(16,25,e.CustomerNameDisplay," - {0}")),t.xp6(4),t.hij(" ","[Q: "+t.lcZ(20,28,t.xi3(21,30,e.Items,"Quantity"))+", T: "+(e.Final?e.Final:"")+"]"," "),t.xp6(4),t.Oqu(t.xi3(24,33,e.SalesName," - Sales: {0}")),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleProfit),t.xp6(2),t.hij(" ",null==e.DeliveryOutlet?"":": Delivered from "+e.DeliveryOutlet," "),t.xp6(2),t.Oqu(null==e.AuthorizationKey?"":": "+e.AuthorizationKey),t.xp6(1),t.Q6J("ngIf",e.SONote&&e.AuthorizationKey),t.xp6(1),t.Q6J("ngIf",!e.AuthorizationKey),t.xp6(2),t.Oqu(null==e.SONote?"":e.SONote),t.xp6(3),t.Oqu(e.PaymentStateLabel),t.xp6(4),t.Q6J("ngForOf",e.Items),t.xp6(2),t.Q6J("ngForOf",e.Aggregate)}}function Lt(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"strong"),t._uU(2,"Qty"),t.qZA(),t.TgZ(3,"span",81),t._uU(4),t.ALo(5,"number"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(4),t.Oqu(t.lcZ(5,1,e.totalAggregate.ItemsQuantity))}}function Qt(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"strong"),t._uU(2,"Qty Complementary"),t.qZA(),t.TgZ(3,"span",81),t._uU(4),t.ALo(5,"number"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(4),t.Oqu(t.lcZ(5,1,e.totalAggregate.QuantityComplementary))}}function Yt(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"strong"),t._uU(2,"Qty Sold"),t.qZA(),t.TgZ(3,"span",81),t._uU(4),t.ALo(5,"number"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(4),t.Oqu(t.lcZ(5,1,e.totalAggregate.QuantityWithoutComplementary))}}function Rt(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"strong"),t._uU(2,"Cost ("),t.TgZ(3,"span",86),t._uU(4),t.ALo(5,"number"),t.qZA(),t._uU(6,"%)"),t.qZA(),t.TgZ(7,"span",81),t._uU(8),t.ALo(9,"number"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(4),t.Oqu(t.lcZ(5,2,e.totalAggregate.CostRatio)),t.xp6(4),t.Oqu(t.lcZ(9,4,e.totalAggregate.Cost))}}function kt(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"strong"),t.TgZ(2,"span"),t._uU(3,"Profit"),t.qZA(),t._uU(4," ("),t.TgZ(5,"span",86),t._uU(6),t.ALo(7,"number"),t.qZA(),t._uU(8,"%)"),t.qZA(),t.TgZ(9,"span",81),t._uU(10),t.ALo(11,"number"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(6),t.Oqu(t.lcZ(7,2,e.totalAggregate.ProfitRatio)),t.xp6(4),t.Oqu(t.lcZ(11,4,e.totalAggregate.Profit))}}function Et(n,i){if(1&n&&(t.TgZ(0,"div",84),t.TgZ(1,"div",85),t.TgZ(2,"div"),t.TgZ(3,"strong"),t._uU(4,"Tax Added"),t.qZA(),t.TgZ(5,"span",81),t._uU(6),t.ALo(7,"number"),t.qZA(),t.qZA(),t.TgZ(8,"div"),t.TgZ(9,"strong"),t._uU(10,"Sales with Tax"),t.qZA(),t.TgZ(11,"span",81),t._uU(12),t.ALo(13,"number"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"div",85),t.TgZ(15,"div"),t.TgZ(16,"strong"),t._uU(17,"Orders"),t.qZA(),t.TgZ(18,"span",81),t._uU(19),t.ALo(20,"number"),t.qZA(),t.qZA(),t.YNc(21,Lt,6,3,"div",24),t.YNc(22,Qt,6,3,"div",24),t.YNc(23,Yt,6,3,"div",24),t.qZA(),t.TgZ(24,"div",85),t.TgZ(25,"div"),t.TgZ(26,"strong"),t._uU(27,"Gross Sales"),t.qZA(),t.TgZ(28,"span",81),t._uU(29),t.ALo(30,"number"),t.qZA(),t.qZA(),t.TgZ(31,"div"),t.TgZ(32,"strong"),t._uU(33,"Discount"),t.qZA(),t.TgZ(34,"span",81),t._uU(35),t.ALo(36,"number"),t.qZA(),t.qZA(),t.TgZ(37,"div"),t.TgZ(38,"strong"),t._uU(39,"Tax Incl."),t.qZA(),t.TgZ(40,"span",81),t._uU(41),t.ALo(42,"number"),t.qZA(),t.qZA(),t.TgZ(43,"div"),t.TgZ(44,"strong"),t._uU(45,"Net Sales"),t.qZA(),t.TgZ(46,"span",81),t._uU(47),t.ALo(48,"number"),t.qZA(),t.qZA(),t.YNc(49,Rt,10,6,"div",24),t.YNc(50,kt,12,6,"div",24),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(6),t.Oqu(t.xi3(7,12,e.totalAggregate.TaxAdd,".0-0")),t.xp6(6),t.Oqu(t.xi3(13,15,e.totalAggregate.SalesWithTax,".0-0")),t.xp6(7),t.Oqu(t.xi3(20,18,e.totalAggregate.Orders,".0-0")),t.xp6(2),t.Q6J("ngIf",!e.pageData.Filter.Complementary),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.Complementary),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.Complementary),t.xp6(6),t.Oqu(t.xi3(30,21,e.totalAggregate.GrossItems,".0-0")),t.xp6(6),t.Oqu(t.xi3(36,24,e.totalAggregate.Discount,".0-0")),t.xp6(6),t.Oqu(t.xi3(42,27,e.totalAggregate.TaxInclude,".0-0")),t.xp6(6),t.Oqu(t.xi3(48,30,e.totalAggregate.SalesWithoutTax,".0-0")),t.xp6(2),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",e.pageData.HasRoleProfit)}}function Ht(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"span",87),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).StoreRowsCountAPIResult("Report/ReportDetailCount")}),t.TgZ(1,"i",88),t._uU(2,"?"),t.qZA(),t.qZA()}}function Vt(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(t.lcZ(2,1,e.listTotal))}}function Bt(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",89),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).NextPage(!0)}),t._UZ(1,"i",90),t._uU(2," Next"),t.qZA()}}function Gt(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",91),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).StoreRowsCountAPIResult("Report/ReportDetailCount",!0)}),t._UZ(1,"i",92),t._uU(2," Last"),t.qZA()}}function jt(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Tt,13,0,"div",2),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",3),t.YNc(5,Ct,26,11,"div",4),t.YNc(6,ft,29,11,"div",5),t.qZA(),t.TgZ(7,"a",6),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.hideMore=!a.hideMore}),t._uU(8,"More "),t._UZ(9,"i",7),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.TgZ(11,"div",8),t.TgZ(12,"table",9),t.TgZ(13,"thead",10),t.TgZ(14,"tr"),t.TgZ(15,"th",11),t._uU(16,"Name"),t.qZA(),t.TgZ(17,"th",12),t._uU(18,"Code"),t.qZA(),t.TgZ(19,"th",13),t._uU(20,"Qty"),t.qZA(),t.TgZ(21,"th",14),t._uU(22,"UOM"),t.qZA(),t.YNc(23,At,2,0,"th",15),t.TgZ(24,"th",16),t._uU(25,"@ Price"),t.qZA(),t.TgZ(26,"th",13),t._uU(27,"Disc."),t.qZA(),t.TgZ(28,"th",16),t._uU(29,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(30,"tbody"),t.TgZ(31,"tr"),t.TgZ(32,"td",17),t.YNc(33,Pt,43,39,"div",18),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.YNc(34,Et,51,33,"div",19),t.TgZ(35,"div",20),t.TgZ(36,"div",21),t.TgZ(37,"div",22),t._uU(38),t.ALo(39,"number"),t.YNc(40,Ht,3,0,"span",23),t.YNc(41,Vt,3,3,"span",24),t._uU(42),t.qZA(),t.qZA(),t.TgZ(43,"div",25),t.YNc(44,Bt,3,0,"a",26),t.YNc(45,Gt,3,0,"a",27),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.pageData.HasRoleExport),t.xp6(3),t.Q6J("ngIf",e.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!e.hideMore),t.xp6(17),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(9),t.uIk("colspan",e.pageData.HasRoleCost?8:7),t.xp6(1),t.Q6J("ngForOf",e.infiniteList),t.xp6(1),t.Q6J("ngIf",(null==e.data?null:e.data.Data.length)>0),t.xp6(4),t.hij(" Showing 1 - ",t.lcZ(39,15,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),t.xp6(2),t.Q6J("ngIf",!e.pageData.HideStoreApiCount),t.xp6(1),t.Q6J("ngIf",e.pageData.HideStoreApiCount),t.xp6(1),t.hij(" records ~ ",e.pageData.Filter.PageNumber," Page "),t.xp6(2),t.Q6J("ngIf",e.nextPageDisabled&&!e.goToLast),t.xp6(1),t.Q6J("ngIf",e.nextPageDisabled&&!e.goToLast)}}let Wt=(()=>{class n extends xt.X{constructor(e,o,a,r,l,_){super(e,"Report/ReportDetail","ReportLoader/ReportDetail",null,r),this.csvConverter=o,this.datePipe=a,this.activatedRoute=r,this.matDialog=l,this.toaster=_,this.hideMore=!0,this.SortBy=[{Key:!1,Value:"Number"},{Key:!0,Value:"Created"}]}preInitList(){this.oldRowCount=this.pageData.Filter.RowCount,this.pageData.Filter.NoteVisible=!0,this.totalAggregate=new $t}assignAggregate(e){this.totalAggregate.TaxAdd=e.Aggregate.TaxAdd,this.totalAggregate.SalesWithTax=e.Aggregate.SalesWithTax,this.totalAggregate.Orders=e.Aggregate.Orders,this.totalAggregate.ItemsQuantity=e.Aggregate.ItemsQuantity,this.totalAggregate.QuantityComplementary=e.Aggregate.QuantityComplementary,this.totalAggregate.QuantityWithoutComplementary=e.Aggregate.QuantityWithoutComplementary,this.totalAggregate.GrossItems=e.Aggregate.GrossItems,this.totalAggregate.Discount=e.Aggregate.Discount,this.totalAggregate.TaxInclude=e.Aggregate.TaxInclude,this.totalAggregate.SalesWithoutTax=e.Aggregate.SalesWithoutTax,e.Aggregate.CostRatio=this.costRatioCalculation(e.Aggregate.Cost,e.Aggregate.SalesWithoutTax,e.Aggregate.TaxInclude),this.totalAggregate.CostRatio=e.Aggregate.CostRatio,e.Aggregate.ProfitRatio=this.profitRatioCalculation(e.Aggregate.Profit,e.Aggregate.SalesWithoutTax,e.Aggregate.TaxInclude),this.totalAggregate.ProfitRatio=e.Aggregate.ProfitRatio,this.totalAggregate.Profit=e.Aggregate.Profit,this.totalAggregate.Cost=e.Aggregate.Cost}postExtendData(e){this.totalAggregate.TaxAdd+=e.Aggregate.TaxAdd,this.totalAggregate.SalesWithTax+=e.Aggregate.SalesWithTax,this.totalAggregate.Orders+=e.Aggregate.Orders,this.totalAggregate.ItemsQuantity+=e.Aggregate.ItemsQuantity,this.totalAggregate.QuantityComplementary+=e.Aggregate.QuantityComplementary,this.totalAggregate.QuantityWithoutComplementary+=e.Aggregate.QuantityWithoutComplementary,this.totalAggregate.GrossItems+=e.Aggregate.GrossItems,this.totalAggregate.Discount+=e.Aggregate.Discount,this.totalAggregate.TaxInclude+=e.Aggregate.TaxInclude,this.totalAggregate.SalesWithoutTax+=e.Aggregate.SalesWithoutTax,e.Aggregate.CostRatio=this.costRatioCalculation(e.Aggregate.Cost,e.Aggregate.SalesWithoutTax,e.Aggregate.TaxInclude),this.totalAggregate.CostRatio+=e.Aggregate.CostRatio,e.Aggregate.ProfitRatio=this.profitRatioCalculation(e.Aggregate.Profit,e.Aggregate.SalesWithoutTax,e.Aggregate.TaxInclude),this.totalAggregate.ProfitRatio+=e.Aggregate.ProfitRatio,this.totalAggregate.Profit+=e.Aggregate.Profit,this.totalAggregate.Cost+=e.Aggregate.Cost}costRatioCalculation(e,o,a){let r=0;return this.pageData.IncludeTax&&(o+=a),0!=o&&(r=e/o*100),r}profitRatioCalculation(e,o,a){let r=0;return this.pageData.IncludeTax&&(o+=a),0!=o&&(r=e/o*100),r}export(e){-1===this.pagination.ListTotal?this.httpService.post("/API/Report/ReportDetailCount",JSON.stringify(this.pageData.Filter)).subscribe(a=>{this.pagination.ListTotal=a.Count,this.showExportModal(e)}):this.showExportModal(e)}showExportModal(e){this.matDialog.open(ht,{data:{Filter:this.pageData.Filter,TotalCount:this.pagination.ListTotal}}).afterClosed().subscribe(a=>{if(a){const r=a.ExportPageNumber;switch(this.pageData.Filter.ExportPageNumber=r,e){case"default":this.exportCSV(this.csvConverter,"ReportExport/ReportDetail","SalesReport_"+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To)+`_Page_${r}.csv`);break;case"complete":this.exportCSV(this.csvConverter,"ReportExport/ReportDetailComplete","SalesReportComplete_"+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To)+`_Page_${r}.csv`);break;case"contact":this.exportCSV(this.csvConverter,"ReportExport/ReportDetailWithContact","SalesReportWithContact_"+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To)+`_Page_${r}.csv`)}}})}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(s.uU),t.Y36(u.gz),t.Y36(S.uw),t.Y36(y._W))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-sales-detail"]],features:[t.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","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"font-italic","small",2,"width","40px"],["class","text-right","style","width: 80px",4,"ngIf"],[1,"text-right",2,"width","90px"],[1,"px-0"],[4,"ngFor","ngForOf"],["class","row justify-content-end mt-10 mx-0",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"mr-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-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","title","Load more for 500 variants",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"click"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"items","ngModel","ngModelChange"],["name","Bin",3,"model","modelChange"],["id","more-filter","container","",1,"ml-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"],["requestUrl","/API/AC/GetUserSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["name","NoteVisible",3,"model","modelChange"],["name","Sort",3,"model","options","modelChange"],[1,"text-right",2,"width","80px"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"mr-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2"],[1,"h5","text-primary","font-weight-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ml-3"],["class","h5 text-primary font-weight-bold",3,"routerLink","queryParams",4,"ngIf"],[1,"font-italic","font-weight-bold",3,"innerHtml"],[1,"font-weight-bold"],[1,"text-danger","ml-3"],["class","font-weight-bold",4,"ngIf"],["id","deliveryNote"],[1,"d-inline-block","font-italic"],[1,"d-lg-block","mt-8","mr-2","font-weight-bold","font-italic"],["runat","server",1,"status"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"table","table-sm","table-borderless"],["id","PONumber"],[1,"font-weight-normal"],["class","text-warning inlineMarginLeft",4,"ngIf"],["class","list-inline text-warning inlineMarginLeft",4,"ngIf"],[1,"d-block","font-weight-normal","font-italic",2,"word-break","break-all",3,"innerHtml"],[1,"font-weight-normal",2,"width","75px"],[1,"font-weight-normal","text-right",2,"width","42px"],["class","font-weight-normal text-right","style","width: 80px",4,"ngIf"],[1,"font-weight-normal","text-right",2,"width","90px"],[1,"font-weight-normal","text-right","text-danger",2,"width","50px"],["title","Disc %"],["title","Disc Amount"],[1,"text-warning","inlineMarginLeft"],[1,"list-inline","text-warning","inlineMarginLeft"],[1,"font-weight-normal","text-right",2,"width","80px"],[1,"text-right"],[1,"p-0","font-weight-normal","text-right",2,"width","1%"],[1,"font-weight-normal","text-right",2,"width","5%"],[1,"row","justify-content-end","mt-10","mx-0"],[1,"zebra","col-auto"],[1,"Percentage"],[2,"cursor","pointer",3,"click"],["title","Retrieve rows count",1,"border","p-3"],["role","button","title","Load more for 500 variants",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,o){1&e&&t.YNc(0,jt,46,17,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},directives:[s.O5,d.p,s.sg,c.w9,p.JJ,p.On,D.J,C.QB,q.P,u.yS],pipes:[s.JJ,s.uU,T.WV,T.qU],styles:[""]}),n})();class $t{constructor(){this.TaxAdd=0,this.SalesWithTax=0,this.Orders=0,this.ItemsQuantity=0,this.QuantityComplementary=0,this.QuantityWithoutComplementary=0,this.GrossItems=0,this.Discount=0,this.TaxInclude=0,this.SalesWithoutTax=0,this.CostRatio=0,this.Cost=0,this.ProfitRatio=0,this.Profit=0}}let Kt=(()=>{class n{constructor(e,o){this._dialogRef=e,this.data=o,this.modalConfig=new Y.O,this.ExportPageNumber=o.ExportPageNumber,this.ExportRowCount=o.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 n.\u0275fac=function(e){return new(e||n)(t.Y36(S.so),t.Y36(S.WI))},n.\u0275cmp=t.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","form-group"],["type","text",1,"form-control",3,"ngModel","ngModelChange"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o._dialogRef.close()})("onClose",function(){return o._dialogRef.close()}),t.TgZ(1,"content"),t.TgZ(2,"div",1),t.TgZ(3,"div",2),t.TgZ(4,"label"),t._uU(5,"Page Number"),t.qZA(),t.TgZ(6,"input",3),t.NdJ("ngModelChange",function(r){return o.ExportPageNumber=r}),t.qZA(),t.qZA(),t.TgZ(7,"div",2),t.TgZ(8,"label"),t._uU(9,"Page Size"),t.qZA(),t.TgZ(10,"input",3),t.NdJ("ngModelChange",function(r){return o.ExportRowCount=r}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.Q6J("title","Export Report")("config",o.modalConfig),t.xp6(6),t.Q6J("ngModel",o.ExportPageNumber),t.xp6(4),t.Q6J("ngModel",o.ExportRowCount))},directives:[I.M,p.Fj,p.JJ,p.On],styles:[""]}),n})();var m=f(1139),Xt=f(5451);function zt(n,i){1&n&&(t.TgZ(0,"button",15),t._UZ(1,"b",16),t.qZA())}function te(n,i){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"datetimepicker",24),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(2,"datetimepicker",25),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.BQk()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("date",e.pageData.Filter.From)("appearance","outline")("width",215),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)("appearance","outline")("width",215)}}function ee(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"datepicker",24),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(1,"datepicker",25),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA()}if(2&n){const e=t.oxw(2);t.Q6J("date",e.pageData.Filter.From)("appearance","outline")("width",215),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)("appearance","outline")("width",215)}}function ne(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",17),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Customer"),t.qZA(),t.TgZ(8,"autocompleteV2",19),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CustomerID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Sales"),t.qZA(),t.TgZ(12,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(13,"div"),t.TgZ(14,"h6"),t._uU(15,"From/To"),t.qZA(),t.YNc(16,te,3,6,"ng-container",21),t.YNc(17,ee,2,6,"ng-template",null,22,t.W1O),t.qZA(),t.TgZ(19,"div"),t.TgZ(20,"h6"),t._uU(21,"filter invoice by"),t.qZA(),t.TgZ(22,"radio-options",23),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.isCreated=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.MAs(18),o=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",o.pageData.Filter.ListIDs)("items",null==o.pageData.Options?null:o.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",o.pageData.Filter.CustomerID)("inputTextValue",o.pageData.CustomerName),t.xp6(4),t.Q6J("ngModel",o.pageData.Filter.SalesID)("items",null==o.pageData.Options?null:o.pageData.Options.Sales),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter.isCreated)("ngIfElse",e),t.xp6(6),t.Q6J("options",o.filterInvociceBy)("model",o.pageData.Filter.isCreated)}}function ae(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",26),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Register"),t.qZA(),t.TgZ(4,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RegisterID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Customer Groups"),t.qZA(),t.TgZ(8,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CustomerGroupID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Payment"),t.qZA(),t.TgZ(12,"ng-select",27),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.PaymentState=a}),t.qZA(),t.qZA(),t.TgZ(13,"div"),t.TgZ(14,"h6"),t._uU(15,"Creator"),t.qZA(),t.TgZ(16,"autocompleteV2",28),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CreatorID=a}),t.qZA(),t.qZA(),t.TgZ(17,"div"),t.TgZ(18,"h6"),t._uU(19,"RowCount"),t.qZA(),t.TgZ(20,"input",29),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RegisterID)("items",e.pageData.Options.Registers),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CustomerGroupID)("items",e.pageData.Options.Groups),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.PaymentState)("items",e.pageData.Options.States),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CreatorID),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount)}}function oe(n,i){1&n&&(t.TgZ(0,"th",46),t._uU(1,"COST"),t.qZA())}function re(n,i){1&n&&(t.TgZ(0,"th",47),t._uU(1,"TAX"),t.qZA())}function ie(n,i){1&n&&(t.TgZ(0,"th",48),t._uU(1,"SURCHARGE "),t.qZA())}function le(n,i){1&n&&t._UZ(0,"br")}const se=function(){return["/menu/Orders/Orders/Sales_Order/Info"]},w=function(n){return{ID:n}};function pe(n,i){if(1&n&&(t.TgZ(0,"a",49),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("routerLink",t.DdM(3,se))("queryParams",t.VKq(4,w,e.SOID)),t.xp6(1),t.Oqu(e.SalesOrderNumber)}}function ce(n,i){1&n&&t._UZ(0,"br")}function _e(n,i){if(1&n&&(t.TgZ(0,"i"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Note)}}function ue(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Cost))}}function ge(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Tax))}}function de(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",t.lcZ(2,1,e.SurchargeAmount)," ")}}const me=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},Ze=function(){return["/menu/Contacts/Contact/Customers/Info"]},he=function(n,i,e){return{"text-success":n,"text-warning":i,"text-danger":e}};function xe(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"a",49),t._uU(5),t.qZA(),t.YNc(6,le,1,0,"br",50),t.YNc(7,pe,2,6,"a",51),t.YNc(8,ce,1,0,"br",50),t.YNc(9,_e,2,1,"i",50),t.qZA(),t.TgZ(10,"td"),t.TgZ(11,"div"),t._uU(12),t.ALo(13,"date"),t.qZA(),t.TgZ(14,"div"),t._uU(15),t.ALo(16,"date"),t.qZA(),t.qZA(),t.TgZ(17,"td"),t.TgZ(18,"a",52),t._uU(19),t.qZA(),t.qZA(),t.TgZ(20,"td"),t._uU(21),t.qZA(),t.YNc(22,ue,3,3,"td",53),t.TgZ(23,"td",54),t._uU(24),t.ALo(25,"number"),t.qZA(),t.YNc(26,ge,3,3,"td",53),t.YNc(27,de,3,3,"td",53),t.TgZ(28,"td",54),t._uU(29),t.ALo(30,"number"),t.qZA(),t.TgZ(31,"td",55),t._uU(32),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.EntityName),t.xp6(2),t.Q6J("routerLink",t.DdM(31,me))("queryParams",t.VKq(32,w,e.ID)),t.xp6(1),t.hij(" ",e.Number," "),t.xp6(1),t.Q6J("ngIf",o.pageData.DoubleNumber),t.xp6(1),t.Q6J("ngIf",o.pageData.DoubleNumber),t.xp6(1),t.Q6J("ngIf",e.Note),t.xp6(1),t.Q6J("ngIf",e.Note),t.xp6(3),t.hij(" ",t.xi3(13,21,e.Date,"dd MMM yy")," "),t.xp6(3),t.hij(" ",t.xi3(16,24,e.Created,"HH:mm")," "),t.xp6(3),t.Q6J("routerLink",t.DdM(34,Ze))("queryParams",t.VKq(35,w,e.CustomerID)),t.xp6(1),t.Oqu(e.CustomerName),t.xp6(2),t.Oqu(e.SalesName),t.xp6(1),t.Q6J("ngIf",o.pageData.IsCostVisible),t.xp6(2),t.Oqu(t.lcZ(25,27,e.Sales)),t.xp6(2),t.Q6J("ngIf",o.data.TaxVisible),t.xp6(1),t.Q6J("ngIf",o.data.SurchargeVisible),t.xp6(2),t.Oqu(t.lcZ(30,29,e.SalesNSurcharge)),t.xp6(2),t.Q6J("ngClass",t.kEZ(37,he,3==e.PaymentStateID,2==e.PaymentStateID,1==e.PaymentStateID)),t.xp6(1),t.Oqu(e.PaymentStateString)}}function Te(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Cost")),"")}}function Ce(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Tax")))}}function fe(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"SurchargeAmount")),"")}}function Ae(n,i){if(1&n&&(t.TgZ(0,"tfoot",56),t.TgZ(1,"tr",57),t._UZ(2,"td",58),t.TgZ(3,"td",59),t._uU(4),t.ALo(5,"number"),t.qZA(),t._UZ(6,"td",58),t._UZ(7,"td",58),t.TgZ(8,"td",60),t._uU(9,"Total:"),t.qZA(),t.YNc(10,Te,4,6,"td",53),t.TgZ(11,"td",54),t._uU(12),t.ALo(13,"number"),t.ALo(14,"sum"),t.qZA(),t.YNc(15,Ce,4,6,"td",53),t.YNc(16,fe,4,6,"td",53),t.TgZ(17,"td",54),t._uU(18),t.ALo(19,"number"),t.ALo(20,"sum"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(4),t.hij("",t.lcZ(5,6,e.data.Data.length)," Orders"),t.xp6(6),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(2),t.Oqu(t.lcZ(13,8,t.xi3(14,10,e.data.Data,"Sales"))),t.xp6(3),t.Q6J("ngIf",e.data.TaxVisible),t.xp6(1),t.Q6J("ngIf",e.data.SurchargeVisible),t.xp6(2),t.Oqu(t.lcZ(19,13,t.xi3(20,15,e.data.Data,"SalesNSurcharge")))}}function qe(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",30),t.TgZ(1,"table",31),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",32),t.TgZ(3,"tr"),t.TgZ(4,"th",33),t._uU(5,"OUTLET"),t.qZA(),t.TgZ(6,"th",34),t._uU(7,"NUMBER"),t.qZA(),t.TgZ(8,"th",35),t._uU(9,"DATE"),t.qZA(),t.TgZ(10,"th",36),t._uU(11,"CUSTOMER"),t.qZA(),t.TgZ(12,"th",37),t._uU(13,"SALES PERSON"),t.qZA(),t.YNc(14,oe,2,0,"th",38),t.TgZ(15,"th",39),t._uU(16,"SALES"),t.qZA(),t.YNc(17,re,2,0,"th",40),t.YNc(18,ie,2,0,"th",41),t.TgZ(19,"th",42),t._uU(20,"TOTAL"),t.qZA(),t.TgZ(21,"th",43),t._uU(22,"PAYMENT"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(23,"tbody"),t.YNc(24,xe,33,41,"tr",44),t.qZA(),t.YNc(25,Ae,21,18,"tfoot",45),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(14),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(3),t.Q6J("ngIf",e.data.TaxVisible),t.xp6(1),t.Q6J("ngIf",e.data.SurchargeVisible),t.xp6(6),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data)}}let De=(()=>{class n extends m.n{constructor(e,o,a,r,l){super(e,"Report/ReportSummary","ReportLoader/ReportSummary",null,r),this.httpService=e,this.csvConverter=o,this.datePipe=a,this.activatedRoute=r,this._matDialog=l,this.hideMore=!0,this.filterInvociceBy=[{Key:!1,Value:"Date"},{Key:!0,Value:"Created"}]}preGetList(){}postInit(){this.menuData.H=this.data.PageTitle,(null!=this.CustomerID||null!=this.CustomerID)&&(this.pageData.Filter.CustomerID=this.CustomerID),this.pageData.Filter.RowCount=0}openItemModal(e,o){this._matDialog.open(Kt,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(r=>{r&&(this.pageData.Filter.ExportPageNumber=r.ExportPageNumber,this.pageData.Filter.ExportRowCount=r.ExportRowCount,this.exportCSV(this.csvConverter,e,o),this.pageData.Filter.RowCount=0)})}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(a.CustomerName=null==a.CustomerName?"":a.CustomerName,r.CustomerName=null==r.CustomerName?"":r.CustomerName,a.SalesName=null==a.SalesName?"":a.SalesName,r.SalesName=null==r.SalesName?"":r.SalesName,e.active){case"outlet":return this.compare(a.EntityName.toLocaleLowerCase(),r.EntityName.toLocaleLowerCase(),l);case"number":return this.compare(a.Number,r.Number,l);case"date":return this.compare(a.Date,r.Date,l);case"customer":return this.compare(a.CustomerName.toLocaleLowerCase(),r.CustomerName.toLocaleLowerCase(),l);case"salesPerson":return this.compare(a.SalesName.toLocaleLowerCase(),r.SalesName.toLocaleLowerCase(),l);case"cost":return this.compare(a.Cost,r.Cost,l);case"sales":return this.compare(a.Sales,r.Sales,l);case"tax":return this.compare(a.Tax,r.Tax,l);case"surcharge":return this.compare(a.SurchargeAmount,r.SurchargeAmount,l);case"total":return this.compare(a.SalesNSurcharge,r.SalesNSurcharge,l);case"payment":return this.compare(a.PaymentStateString,r.PaymentStateString,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(s.uU),t.Y36(u.gz),t.Y36(S.uw))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-sales-summary"]],features:[t.qOj],decls:27,vars:6,consts:[[3,"pageData","hideSearchBox","onSubmit"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-upload"],["class","btn btn-outline-secondary btn-sm dropdown-toggle","data-toggle","dropdown",4,"ngIf"],[1,"dropdown-menu","dropdown-menu-right"],[1,"dropdown-item"],[3,"click"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"caret"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["placeholder","Customer","requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModel","inputTextValue","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"ngModel","items","ngModelChange"],[4,"ngIf","ngIfElse"],["DATEONLY",""],["name","Is Created",3,"options","model","modelChange"],["name","From",3,"date","appearance","width","dateChange"],["name","To",3,"date","appearance","width","dateChange"],["id","more-filter","container","",1,"ml-6"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModel","items","ngModelChange"],["requestUrl","/API/AC/GetUserSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["type","tel","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","class","align-right",4,"ngIf"],["mat-sort-header","sales",1,"align-right"],["mat-sort-header","tax","class","align-right",4,"ngIf"],["mat-sort-header","surcharge","class","align-right",4,"ngIf"],["mat-sort-header","total",1,"align-right"],["mat-sort-header","payment",2,"width","50px"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","cost",1,"align-right"],["mat-sort-header","tax",1,"align-right"],["mat-sort-header","surcharge",1,"align-right"],["target","_blank",3,"routerLink","queryParams"],[4,"ngIf"],["target","_blank",3,"routerLink","queryParams",4,"ngIf"],[3,"routerLink","queryParams"],["class","text-right",4,"ngIf"],[1,"text-right"],[1,"text-left",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],[1,"text-left","empty-column"],[1,"text-right","empty-column"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"div",1),t.TgZ(3,"a",2),t.NdJ("click",function(){return o.openItemModal("ReportExport/ReportSummary","SalesReportSummary_"+o.transformDate(o.pageData.Filter.From)+"-"+o.transformDate(o.pageData.Filter.To)+".csv")}),t._UZ(4,"i",3),t._uU(5," Export "),t.qZA(),t.YNc(6,zt,2,0,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/ReportSummaryWithPayment","ReportSummaryWithPayment.csv")}),t._uU(10," Export With Payment "),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t.NdJ("click",function(){return o.openItemModal("ReportExport/ReportSummaryWithMethod","ReportSummaryWithMethod.csv")}),t._uU(13," Export With Payment Method "),t.qZA(),t.qZA(),t.TgZ(14,"li",6),t.TgZ(15,"a",7),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/ReportSummaryWithTaxDetail","ReportSummaryWithTaxDetail.csv")}),t._uU(16," Export with Taxable & TaxExempt "),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(17,"filters"),t.TgZ(18,"div",8),t.YNc(19,ne,23,11,"div",9),t.YNc(20,ae,21,8,"div",10),t.qZA(),t.TgZ(21,"a",11),t.NdJ("click",function(){return o.hideMore=!o.hideMore}),t._uU(22,"More "),t._UZ(23,"i",12),t.qZA(),t.qZA(),t.TgZ(24,"content"),t.TgZ(25,"div",13),t.YNc(26,qe,26,5,"div",14),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(6),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(13),t.Q6J("ngIf",o.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!o.hideMore),t.xp6(6),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,D.J,q.P,Xt.L,C.QB,p.Fj,Z.YE,Z.nU,s.sg,u.yS,s.mk],pipes:[s.uU,s.JJ,T.qU],styles:[""]}),n})();function ye(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",6),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.convertToCSV(a.csvConverter,!1,"Top_Brand.csv")}),t._UZ(1,"i",7),t._uU(2,"Export"),t.qZA()}}function ve(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",8),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From - To"),t.qZA(),t.TgZ(8,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Se(n,i){1&n&&(t.TgZ(0,"th",20),t._uU(1,"Code"),t.qZA())}function Me(n,i){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Code)}}const be=function(){return["/menu/Products/Setup/Brand/Brand_Form"]},Je=function(n){return{ID:n}};function Oe(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t.TgZ(2,"a",21),t._uU(3),t.qZA(),t.qZA(),t.YNc(4,Me,2,1,"td",22),t.TgZ(5,"td",23),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",23),t._uU(9),t.ALo(10,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Q6J("routerLink",t.DdM(10,be))("queryParams",t.VKq(11,Je,e.ID)),t.xp6(1),t.hij("",e.BrandName," "),t.xp6(1),t.Q6J("ngIf",e.Countcode>0),t.xp6(2),t.Oqu(t.lcZ(7,6,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(10,8,e.Total))}}function Ie(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",12),t.TgZ(1,"table",13),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",14),t.TgZ(3,"tr"),t.TgZ(4,"th",15),t._uU(5,"Brand"),t.qZA(),t.YNc(6,Se,2,0,"th",16),t.TgZ(7,"th",17),t._uU(8,"Sold"),t.qZA(),t.TgZ(9,"th",18),t._uU(10,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"tbody"),t.YNc(12,Oe,11,13,"tr",19),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(6),t.Q6J("ngIf",e.data.Countcode>0),t.xp6(6),t.Q6J("ngForOf",e.data.Data)}}const Fe=function(){return["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"]};let we=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/BrandRank","ReportLoader/BrandRank"),this.httpService=e,this.csvConverter=o}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Brand":return this.compare(a.BrandName,r.BrandName,l);case"Code":return this.compare(a.Code,r.Code,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Total":return this.compare(a.Total,r.Total,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-Top-Brand"]],features:[t.qOj],decls:10,vars:7,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-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","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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",4,"ngIf"],["mat-sort-header","Quantity",1,"align-right",2,"width","75px"],["mat-sort-header","Total",1,"align-right",2,"width","120px"],[4,"ngFor","ngForOf"],["mat-sort-header","Code",2,"width","120px"],[3,"routerLink","queryParams"],[4,"ngIf"],[1,"text-right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,ye,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4," Brand Sales Analysis "),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,ve,10,4,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,Ie,13,2,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(1),t.Q6J("routerLink",t.DdM(6,Fe)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,Z.YE,Z.nU,s.sg],pipes:[s.JJ],encapsulation:2}),n})();function Ne(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"label",3),t.NdJ("click",function(){const r=t.CHM(e).$implicit;return t.oxw().updateSelectedGroups(r.ID)}),t._UZ(1,"input",4),t.TgZ(2,"span"),t._uU(3),t.qZA(),t.qZA()}if(2&n){const e=i.$implicit,o=t.oxw();t.xp6(1),t.Q6J("value",e.ID)("checked",o.IDGroups.indexOf(e.ID)>-1),t.xp6(2),t.Oqu(e.Name)}}let Pe=(()=>{class n{constructor(e,o){this.dialogRef=e,this.data=o,this.IDGroups=[],this.options=o.options,this.model=o.model,this.model.forEach(a=>{this.IDGroups.push(a.GroupID)})}ngOnInit(){}updateSelectedGroups(e){const o=this.IDGroups.indexOf(e);o>-1?this.IDGroups.splice(o,1):this.IDGroups.push(e)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(S.so),t.Y36(S.WI))},n.\u0275cmp=t.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(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.dialogRef.close()}),t.TgZ(1,"content"),t.TgZ(2,"div",1),t.YNc(3,Ne,4,3,"label",2),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.Q6J("title","Edit Groups"),t.xp6(3),t.Q6J("ngForOf",o.options))},directives:[I.M,s.sg],styles:["label[_ngcontent-%COMP%] {\n display: block;\n}\nlabel[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n font-size: 14px;\n}"]}),n})();var x=f(7695),N=f(5427);function Le(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/CustomerRank","Top Customer ["+a.transformDate(a.pageData.Filter.From)+" - "+a.transformDate(a.pageData.Filter.To)+"].csv")}),t._UZ(1,"i",12),t._uU(2,"Export"),t.qZA()}}function Qe(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Group"),t.qZA(),t.TgZ(8,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From/To"),t.qZA(),t.TgZ(12,"datepicker",16),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",17),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Row Count"),t.qZA(),t.TgZ(17,"input",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.GroupID)("items",null==e.pageData.Options?null:e.pageData.Options.Groups),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount)}}function Ye(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"span"),t.TgZ(1,"span"),t._uU(2),t.qZA(),t.TgZ(3,"a",37),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2).$implicit;return t.oxw(3).showModalEditGroup(a.Groups,a.CustomerID)}),t._uU(4),t.qZA(),t.qZA()}if(2&n){const e=i.$implicit,o=i.index;t.xp6(2),t.Oqu(0==o?"":" , "),t.xp6(2),t.Oqu(e.GroupName)}}function Re(n,i){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Ye,5,2,"span",31),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",e.Groups)}}function ke(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",37),t.NdJ("click",function(){t.CHM(e);const a=t.oxw().$implicit;return t.oxw(3).showModalEditGroup(a.Groups,a.CustomerID)}),t._uU(1," No group assigned "),t.qZA()}}const Ee=function(){return["/menu/Contacts/Contact/Customers/Info"]},He=function(n){return{ID:n}};function Ve(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t.TgZ(2,"a",32),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"td",33),t.YNc(5,Re,2,1,"span",34),t.YNc(6,ke,2,0,"a",35),t.qZA(),t.TgZ(7,"td"),t._uU(8),t.qZA(),t.TgZ(9,"td",36),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",36),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",36),t._uU(16),t.ALo(17,"number"),t.qZA(),t.TgZ(18,"td",36),t._uU(19),t.ALo(20,"number"),t.qZA(),t.TgZ(21,"td",36),t._uU(22),t.ALo(23,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Q6J("routerLink",t.DdM(21,Ee))("queryParams",t.VKq(22,He,e.CustomerID)),t.xp6(1),t.hij(" ",e.Name+" "+(e.Title?e.Title:"")," "),t.xp6(2),t.Q6J("ngIf",e.Groups.length>0),t.xp6(1),t.Q6J("ngIf",!(e.Groups.length>0)),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(11,11,e.Orders)),t.xp6(3),t.Oqu(t.lcZ(14,13,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(17,15,e.Sales)),t.xp6(3),t.Oqu(t.lcZ(20,17,e.Tax)),t.xp6(3),t.Oqu(t.lcZ(23,19,e.Sales+e.Tax))}}function Be(n,i){if(1&n&&(t.TgZ(0,"tbody",30),t.YNc(1,Ve,24,24,"tr",31),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.data.Data)}}function Ge(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",19),t.TgZ(1,"table",20),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",21),t.TgZ(3,"tr"),t.TgZ(4,"th",22),t._uU(5,"CUSTOMER"),t.qZA(),t.TgZ(6,"th"),t._uU(7,"GROUPS"),t.qZA(),t.TgZ(8,"th",23),t._uU(9,"CODE"),t.qZA(),t.TgZ(10,"th",24),t._uU(11,"ORDERS"),t.qZA(),t.TgZ(12,"th",25),t._uU(13,"QTY"),t.qZA(),t.TgZ(14,"th",26),t._uU(15,"SALES"),t.qZA(),t.TgZ(16,"th",27),t._uU(17,"TAX"),t.qZA(),t.TgZ(18,"th",28),t._uU(19,"SALES + TAX"),t.qZA(),t.qZA(),t.qZA(),t.YNc(20,Be,2,1,"tbody",29),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(20),t.Q6J("ngIf",e.data.Data)}}const We=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"]},Ke=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"]},ze=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Suppliers"]};let tn=(()=>{class n extends m.n{constructor(e,o,a,r,l){super(e,"Report/CustomerRank","ReportLoader/CustomerRank"),this.httpService=e,this.pageTitle=o,this.csvConverter=a,this.datePipe=r,this.matDialog=l}preInitList(){x.gT.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null)}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Name":return this.compare(a.Name,r.Name,l);case"Code":return this.compare(a.Code,r.Code,l);case"Orders":return this.compare(a.Orders,r.Orders,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"Tax":return this.compare(a.Tax,r.Tax,l);case"SalesNTax":return this.compare(a.Sales+a.Tax,r.Sales+r.Tax,l);default:return 0}}):o}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,o){this.matDialog.open(Pe,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(r=>{r&&this.httpService.post("/API/Report/UpdateContactGroups",JSON.stringify({ContactID:o,GroupIDs:r.groupIDs})).subscribe(()=>{this.getListData()})})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(N.Dx),t.Y36(h.O),t.Y36(s.uU),t.Y36(S.uw))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-Top-Customers"]],features:[t.qOj],decls:19,vars:11,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a group",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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","Name",2,"width","280px"],["mat-sort-header","Code",2,"width","120px"],["mat-sort-header","Orders",1,"align-right",2,"width","75px"],["mat-sort-header","Quantity",1,"align-right",2,"width","75px"],["mat-sort-header","Sales",1,"align-right",2,"width","135px"],["mat-sort-header","Tax",1,"align-right",2,"width","135px"],["mat-sort-header","SalesNTax",1,"align-right",2,"width","135px"],["class","border-bottom",4,"ngIf"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"pointer"],[4,"ngIf"],["class","text-primary",3,"click",4,"ngIf"],[1,"text-right"],[1,"text-primary",3,"click"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Le,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"Top Customers By Age"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10,"Top Customers By Gender"),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t._uU(13,"Top Supplier"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"filters"),t.TgZ(15,"div",8),t.YNc(16,Qe,18,7,"div",9),t.qZA(),t.qZA(),t.TgZ(17,"content"),t.YNc(18,Ge,21,1,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(8,We)),t.xp6(5),t.Q6J("routerLink",t.DdM(9,Ke)),t.xp6(3),t.Q6J("routerLink",t.DdM(10,ze)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,p.Fj,M.b,Z.YE,Z.nU,s.sg],pipes:[s.JJ],encapsulation:2}),n})();function en(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/CustomerRank","Top Customer ["+a.transformDate(a.pageData.Filter.From)+" - "+a.transformDate(a.pageData.Filter.To)+"].csv")}),t._UZ(1,"i",12),t._uU(2,"Export"),t.qZA()}}function nn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Group"),t.qZA(),t.TgZ(8,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From - To"),t.qZA(),t.TgZ(12,"datepicker",16),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",17),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Row Count"),t.qZA(),t.TgZ(17,"input",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.GroupID)("items",null==e.pageData.Options?null:e.pageData.Options.Groups),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount)}}function an(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",29),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",29),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",30),t._uU(10),t.ALo(11,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.hij(" ",e.Name," "),t.xp6(2),t.Oqu(t.lcZ(5,4,e.TotalOrders)),t.xp6(3),t.Oqu(t.lcZ(8,6,e.TotalQuantity)),t.xp6(3),t.Oqu(t.lcZ(11,8,e.TotalAmount))}}function on(n,i){if(1&n&&(t.TgZ(0,"tbody",27),t.YNc(1,an,12,10,"tr",28),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.data.Data)}}function rn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",19),t.TgZ(1,"table",20),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",21),t.TgZ(3,"tr"),t.TgZ(4,"th",22),t._uU(5,"AGE"),t.qZA(),t.TgZ(6,"th",23),t._uU(7,"ORDERS"),t.qZA(),t.TgZ(8,"th",24),t._uU(9,"QUANTITY"),t.qZA(),t.TgZ(10,"th",25),t._uU(11,"AMOUNT"),t.qZA(),t.qZA(),t.qZA(),t.YNc(12,on,2,1,"tbody",26),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(12),t.Q6J("ngIf",e.data.Data)}}const ln=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers"]},pn=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"]},_n=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Suppliers"]};let un=(()=>{class n extends m.n{constructor(e,o,a,r){super(e,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank"),this.httpService=e,this.pageTitle=o,this.csvConverter=a,this.datePipe=r}preInitList(){x.gT.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),x.gT.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Age":return this.compare(a.Name,r.Name,l);case"Orders":return this.compare(a.TotalOrders,r.TotalOrders,l);case"Quantity":return this.compare(a.TotalQuantity,r.TotalQuantity,l);case"Total":return this.compare(a.TotalAmount,r.TotalAmount,l);default:return 0}}):o}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(N.Dx),t.Y36(h.O),t.Y36(s.uU))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-top-customers-by-age"]],features:[t.qOj],decls:19,vars:11,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a group",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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",1,"align-right",2,"width","75px"],["mat-sort-header","Quantity",1,"align-right",2,"width","75px"],["mat-sort-header","Total",1,"align-right",2,"width","135px"],["class","border-bottom",4,"ngIf"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[1,"text-right"],[1,"text-right","text-success"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,en,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"Top Customers"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10,"Top Customers By Gender"),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t._uU(13,"Top Supplier"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"filters"),t.TgZ(15,"div",8),t.YNc(16,nn,18,7,"div",9),t.qZA(),t.qZA(),t.TgZ(17,"content"),t.YNc(18,rn,13,1,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(8,ln)),t.xp6(5),t.Q6J("routerLink",t.DdM(9,pn)),t.xp6(3),t.Q6J("routerLink",t.DdM(10,_n)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,p.Fj,M.b,Z.YE,Z.nU,s.sg],pipes:[s.JJ],styles:[""]}),n})();function gn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.convertToCSV(a.csvConverter,!0,"Top Gender ["+a.transformDate(a.pageData.Filter.From)+" - "+a.transformDate(a.pageData.Filter.To)+"].csv")}),t._UZ(1,"i",12),t._uU(2,"Export"),t.qZA()}}function dn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Group"),t.qZA(),t.TgZ(8,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From - To"),t.qZA(),t.TgZ(12,"datepicker",16),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",17),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Row Count"),t.qZA(),t.TgZ(17,"input",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.GroupID)("items",null==e.pageData.Options?null:e.pageData.Options.Groups),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount)}}function mn(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",28),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",28),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",29),t._uU(10),t.ALo(11,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.hij(" ",e.Name," "),t.xp6(2),t.Oqu(t.lcZ(5,4,e.TotalOrders)),t.xp6(3),t.Oqu(t.lcZ(8,6,e.TotalQuantity)),t.xp6(3),t.Oqu(t.lcZ(11,8,e.TotalAmount))}}function Zn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",19),t.TgZ(1,"table",20),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",21),t.TgZ(3,"tr"),t.TgZ(4,"th",22),t._uU(5,"GENDER"),t.qZA(),t.TgZ(6,"th",23),t._uU(7,"ORDERS"),t.qZA(),t.TgZ(8,"th",24),t._uU(9,"QUANTITY"),t.qZA(),t.TgZ(10,"th",25),t._uU(11,"AMOUNT"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(12,"tbody",26),t.YNc(13,mn,12,10,"tr",27),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(13),t.Q6J("ngForOf",e.data)}}const hn=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers"]},Tn=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"]},fn=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Suppliers"]};let An=(()=>{class n extends m.n{constructor(e,o,a,r){super(e,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank"),this.httpService=e,this.pageTitle=o,this.csvConverter=a,this.datePipe=r,this.header={0:"GENDER",1:"ORDERS",2:"QUANTITY",3:"AMOUNT"}}preInitList(){x.gT.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),x.gT.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){const o=this.data.slice();this.data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Gender":return this.compare(a.Name,r.Name,l);case"Orders":return this.compare(a.TotalOrders,r.TotalOrders,l);case"Quantity":return this.compare(a.TotalQuantity,r.TotalQuantity,l);case"Total":return this.compare(a.TotalAmount,r.TotalAmount,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(N.Dx),t.Y36(h.O),t.Y36(s.uU))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-top-customers-by-gender"]],features:[t.qOj],decls:19,vars:11,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a group",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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",1,"align-right",2,"width","75px"],["mat-sort-header","Quantity",1,"align-right",2,"width","75px"],["mat-sort-header","Total",1,"align-right",2,"width","135px"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[1,"text-right"],[1,"text-right","text-success"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,gn,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"Top Customers"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10,"Top Customers By Age"),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t._uU(13,"Top Supplier"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"filters"),t.TgZ(15,"div",8),t.YNc(16,dn,18,7,"div",9),t.qZA(),t.qZA(),t.TgZ(17,"content"),t.YNc(18,Zn,14,1,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(8,hn)),t.xp6(5),t.Q6J("routerLink",t.DdM(9,Tn)),t.xp6(3),t.Q6J("routerLink",t.DdM(10,fn)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,p.Fj,M.b,Z.YE,Z.nU,s.sg],pipes:[s.JJ],styles:[""]}),n})();function qn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/TopSalesExport","Top_Supplier.csv")}),t._UZ(1,"i",12),t._uU(2,"Export"),t.qZA()}}function Dn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Group"),t.qZA(),t.TgZ(8,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From - To"),t.qZA(),t.TgZ(12,"datepicker",16),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",17),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Row Count"),t.qZA(),t.TgZ(17,"input",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.GroupID)("items",null==e.pageData.Options?null:e.pageData.Options.Group),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount)}}const yn=function(){return["/menu/Contacts/Contact/Customers/Info"]},vn=function(n){return{ID:n}},Sn=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]},Mn=function(n,i,e){return{From:n,SupplierID:i,To:e}};function bn(n,i){if(1&n&&(t.TgZ(0,"tr",33),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",34),t.TgZ(4,"a",35),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"td",32),t._uU(7),t.qZA(),t.TgZ(8,"td",36),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",32),t.TgZ(12,"a",35),t.ALo(13,"date"),t.ALo(14,"date"),t._uU(15),t.ALo(16,"number"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.Rank),t.xp6(2),t.Q6J("routerLink",t.DdM(20,yn))("queryParams",t.VKq(21,vn,e.SupplierID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(10,9,e.Quantity)),t.xp6(3),t.Q6J("routerLink",t.DdM(23,Sn))("queryParams",t.kEZ(24,Mn,t.xi3(13,11,o.pageData.Filter.From,"ddMMyyyy"),e.SupplierID,t.xi3(14,14,o.pageData.Filter.To,"ddMMyyyy"))),t.xp6(3),t.hij(" ",t.xi3(16,17,e.Total,".0-0"),"")}}function Jn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",19),t.TgZ(1,"table",20),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",21),t.TgZ(3,"tr"),t.TgZ(4,"th",22),t._uU(5,"RANK"),t.qZA(),t.TgZ(6,"th",23),t._uU(7,"SUPPLIER"),t.qZA(),t.TgZ(8,"th",24),t._uU(9,"CODE"),t.qZA(),t.TgZ(10,"th",25),t._uU(11,"QUANTITY"),t.qZA(),t.TgZ(12,"th",26),t._uU(13,"TOTAL"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"tbody"),t.YNc(15,bn,17,28,"tr",27),t.qZA(),t.qZA(),t.TgZ(16,"div",28),t.TgZ(17,"table",29),t.TgZ(18,"thead",30),t.TgZ(19,"tr",31),t.TgZ(20,"th",32),t._uU(21,"Total Quantity"),t.qZA(),t.TgZ(22,"th",32),t._uU(23,"Total Sales"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(24,"tbody"),t.TgZ(25,"tr"),t.TgZ(26,"td"),t._uU(27),t.qZA(),t.TgZ(28,"td"),t._uU(29),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(15),t.Q6J("ngForOf",e.data.Data),t.xp6(12),t.Oqu(e.data.TotalQty),t.xp6(2),t.Oqu(e.data.TotalSales)}}const On=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers"]},Un=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"]},wn=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"]};let Nn=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader"),this.httpService=e,this.csvConverter=o}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Rank":return this.compare(a.Rank,r.Rank,l);case"Supplier":return this.compare(a.Name,r.Name,l);case"Code":return this.compare(a.Code,r.Code,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Total":return this.compare(a.Total,r.Total,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-top-suppliers"]],features:[t.qOj],decls:19,vars:11,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a group",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code",2,"width","80px"],["mat-sort-header","Quantity",1,"align-right",2,"width","120px"],["mat-sort-header","Total",1,"align-right",2,"width","120px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-end"],[1,"table","w-auto"],[1,"thead-light"],[1,"header"],[1,"text-right"],[1,"border-bottom"],[1,"text-left"],[3,"routerLink","queryParams"],[1,"text-right","text-success"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,qn,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"Top Customers"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10,"Top Customers By Gender"),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t._uU(13,"Top Customers By Age"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"filters"),t.TgZ(15,"div",8),t.YNc(16,Dn,18,7,"div",9),t.qZA(),t.qZA(),t.TgZ(17,"content"),t.YNc(18,Jn,30,3,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(8,On)),t.xp6(5),t.Q6J("routerLink",t.DdM(9,Un)),t.xp6(3),t.Q6J("routerLink",t.DdM(10,wn)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,p.Fj,M.b,Z.YE,Z.nU,s.sg],pipes:[s.JJ,s.uU],styles:[""]}),n})();var Pn=f(2254),Ln=f(2507),Qn=f.n(Ln),k=f(4106);function Yn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",17),t.NdJ("click",function(){return t.CHM(e),t.oxw().updateMinstock()}),t._uU(1,"Submit"),t.qZA()}}function Rn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",18),t.TgZ(1,"a",19),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/ProductSales","Product Sales.csv")}),t._UZ(2,"i",20),t._uU(3," Export "),t.qZA(),t.TgZ(4,"button",6),t._UZ(5,"b",21),t.qZA(),t.TgZ(6,"ul",22),t.TgZ(7,"li",8),t.TgZ(8,"a",23),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/ProductSalesExportWithDescription","Product Sales.csv")}),t._uU(9," Export With Description "),t.qZA(),t.qZA(),t.qZA(),t.qZA()}}function kn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",24),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",25),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a})("change",function(){return t.CHM(e),t.oxw().resetListId()}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",26),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From - To"),t.qZA(),t.TgZ(12,"datepicker",27),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",28),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Sales"),t.qZA(),t.TgZ(17,"ng-select",29),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Scope"),t.qZA(),t.TgZ(21,"radio-options",30),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupByVariant=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(4),t.Q6J("date",e.pageData.Filter.From)("showClearBtn",!0)("showTodayBtn",!0),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)("showClearBtn",!0)("showTodayBtn",!0),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("model",e.pageData.Filter.GroupByVariant)("options",e.ScopeFilter)}}function En(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",31),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Sales Order Type"),t.qZA(),t.TgZ(4,"ng-select",29),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Supplier"),t.qZA(),t.TgZ(8,"autocompleteV2",32),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SupplierID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Brand"),t.qZA(),t.TgZ(12,"autocompleteV2",33),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.BrandID=a}),t.qZA(),t.qZA(),t.TgZ(13,"div"),t.TgZ(14,"h6"),t._uU(15,"Customer"),t.qZA(),t.TgZ(16,"autocompleteV2",34),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CustomerID=a}),t.qZA(),t.qZA(),t.TgZ(17,"div"),t.TgZ(18,"h6"),t._uU(19,"Exclude Complementary"),t.qZA(),t.TgZ(20,"radio-options",35),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ExcludeComplementary=a}),t.qZA(),t.qZA(),t.TgZ(21,"div"),t.TgZ(22,"h6"),t._uU(23,"Exclude Non Inventory"),t.qZA(),t.TgZ(24,"radio-options",35),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ExcludeInventory=a}),t.qZA(),t.qZA(),t.TgZ(25,"div"),t.TgZ(26,"h6"),t._uU(27,"Show Inventory"),t.qZA(),t.TgZ(28,"radio-options",36),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ShowInventory=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SupplierID)("inputTextValue",e.pageData.supplierName),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.BrandID),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CustomerID),t.xp6(4),t.Q6J("model",e.pageData.Filter.ExcludeComplementary),t.xp6(4),t.Q6J("model",e.pageData.Filter.ExcludeInventory),t.xp6(4),t.Q6J("model",e.pageData.Filter.ShowInventory)}}function Hn(n,i){1&n&&(t.TgZ(0,"th",52),t._uU(1,"COST"),t.qZA())}function Vn(n,i){1&n&&(t.TgZ(0,"th",53),t._uU(1,"INVENTORY "),t.qZA())}function Bn(n,i){1&n&&(t.TgZ(0,"th",54),t._uU(1,"REORDER MIN"),t.qZA())}function Gn(n,i){1&n&&(t.TgZ(0,"th",55),t._uU(1,"UPDATE ROP"),t.qZA())}function jn(n,i){1&n&&(t.TgZ(0,"th",56),t._uU(1,"PROFIT"),t.qZA())}function Wn(n,i){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"img",66),t.NdJ("click",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.oxw(2).openBigPicture(r,a)}),t.qZA(),t.BQk()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.s9C("src",e.ThumbnailUrl,t.LSH)}}function $n(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",67),t.TgZ(1,"img",68),t.NdJ("click",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.oxw(2).openBigPicture(r,a)}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(3);t.Q6J("target",e.pageData.LinkTarget),t.xp6(1),t.Q6J("src","//res.cloudinary.com/pos/image/upload/w_"+(null==e.data?null:e.data.ThumbnailWidth)+"/POS/Images/Icon/products_thumb.png",t.LSH)}}function Kn(n,i){if(1&n&&(t.TgZ(0,"td",62),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",t.lcZ(2,1,e.UnitCost)," ")}}const E=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"]},zn=function(n,i,e){return{VariantID:n,From:i,To:e}};function ta(n,i){if(1&n&&(t.TgZ(0,"a",69),t.ALo(1,"date"),t.ALo(2,"date"),t._uU(3),t.ALo(4,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.Q6J("routerLink",t.DdM(11,E))("queryParams",t.kEZ(12,zn,e.ID,t.xi3(1,3,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(2,6,o.pageData.Filter.To,"ddMMyyyy"))),t.xp6(3),t.Oqu(t.lcZ(4,9,e.Total))}}const ea=function(n,i,e){return{ProductID:n,From:i,To:e}};function na(n,i){if(1&n&&(t.TgZ(0,"a",69),t.ALo(1,"date"),t.ALo(2,"date"),t._uU(3),t.ALo(4,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.Q6J("routerLink",t.DdM(11,E))("queryParams",t.kEZ(12,ea,e.ID,t.xi3(1,3,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(2,6,o.pageData.Filter.To,"ddMMyyyy"))),t.xp6(3),t.Oqu(t.lcZ(4,9,e.Total))}}function aa(n,i){if(1&n&&(t.TgZ(0,"td",62),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.UnitsInStock?e.UnitsInStock:0)," ")}}function oa(n,i){if(1&n&&(t.TgZ(0,"td",62),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.MinStock),"")}}function ra(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"td",62),t.TgZ(1,"input",70),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().$implicit.NewMinStock=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.NewMinStock)}}function ia(n,i){if(1&n&&(t.TgZ(0,"td",71),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",e.Profit>=0?"text-success":"text-danger"),t.xp6(1),t.hij(" ",t.lcZ(2,2,e.Profit)," ")}}const la=function(n){return[n]},sa=function(n){return{ID:n}};function pa(n,i){if(1&n&&(t.TgZ(0,"tr",57),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"div",58),t.TgZ(5,"div",59),t.YNc(6,Wn,2,1,"ng-container",51),t.YNc(7,$n,2,2,"a",60),t.qZA(),t.TgZ(8,"a",61),t._uU(9),t.qZA(),t.qZA(),t.qZA(),t.TgZ(10,"td"),t._uU(11),t.qZA(),t.TgZ(12,"td",62),t._uU(13),t.ALo(14,"number"),t.qZA(),t.YNc(15,Kn,3,3,"td",63),t.TgZ(16,"td",62),t.YNc(17,ta,5,16,"a",64),t.YNc(18,na,5,16,"a",64),t.qZA(),t.YNc(19,aa,3,3,"td",63),t.YNc(20,oa,3,3,"td",63),t.YNc(21,ra,2,1,"td",63),t.YNc(22,ia,3,4,"td",65),t.qZA()),2&n){const e=i.$implicit,o=i.index,a=t.oxw(2);t.xp6(2),t.Oqu(o+1),t.xp6(4),t.Q6J("ngIf",e.ImageUrl),t.xp6(1),t.Q6J("ngIf",!e.ImageUrl),t.xp6(1),t.Q6J("routerLink",t.VKq(17,la,1==a.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",t.VKq(19,sa,e.ID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(14,15,e.Quantity)),t.xp6(2),t.Q6J("ngIf",null==a.pageData.Role?null:a.pageData.Role.HasCostRole),t.xp6(2),t.Q6J("ngIf",a.pageData.Filter.GroupByVariant),t.xp6(1),t.Q6J("ngIf",!a.pageData.Filter.GroupByVariant),t.xp6(1),t.Q6J("ngIf",a.pageData.Filter.ShowInventory),t.xp6(1),t.Q6J("ngIf",e.MinVisible&&a.pageData.Filter.ShowInventory),t.xp6(1),t.Q6J("ngIf",(null==a.pageData.Role?null:a.pageData.Role.IsReorderPointEditor)&&a.pageData.Filter.GroupByVariant&&e.MinVisible&&a.pageData.Filter.ListIDs),t.xp6(1),t.Q6J("ngIf",null==a.pageData.Role?null:a.pageData.Role.HasCostRole)}}function ca(n,i){if(1&n&&(t.TgZ(0,"td",62),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"UnitCost"))," ")}}function _a(n,i){if(1&n&&(t.TgZ(0,"td",74),t.TgZ(1,"a"),t._uU(2),t.ALo(3,"number"),t.ALo(4,"sum"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(2),t.Oqu(t.lcZ(3,1,t.xi3(4,3,e.data.Data,"UnitsInStock")))}}function ua(n,i){if(1&n&&(t.TgZ(0,"td",62),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Profit")))}}function ga(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",72),t.TgZ(2,"td",73),t._uU(3,"Total : "),t.qZA(),t.TgZ(4,"td",62),t._uU(5),t.ALo(6,"number"),t.ALo(7,"sum"),t.qZA(),t.YNc(8,ca,4,6,"td",63),t.TgZ(9,"td",74),t.TgZ(10,"a"),t._uU(11),t.ALo(12,"number"),t.ALo(13,"sum"),t.qZA(),t.qZA(),t.YNc(14,_a,5,6,"td",75),t.YNc(15,ua,4,6,"td",63),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(5),t.Oqu(t.lcZ(6,5,t.xi3(7,7,e.data.Data,"Quantity"))),t.xp6(3),t.Q6J("ngIf",e.pageData.Role.HasCostRole),t.xp6(3),t.Oqu(t.lcZ(12,10,t.xi3(13,12,e.data.Data,"Total"))),t.xp6(3),t.Q6J("ngIf",e.pageData.Filter.ShowInventory),t.xp6(1),t.Q6J("ngIf",null==e.pageData.Role?null:e.pageData.Role.HasCostRole)}}function da(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",37),t.TgZ(1,"table",38),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",39),t.TgZ(3,"tr"),t.TgZ(4,"th",40),t._uU(5,"No"),t.qZA(),t.TgZ(6,"th",41),t._uU(7,"NAME"),t.qZA(),t.TgZ(8,"th",42),t._uU(9,"CODE"),t.qZA(),t.TgZ(10,"th",43),t._uU(11,"QUANTITY"),t.qZA(),t.YNc(12,Hn,2,0,"th",44),t.TgZ(13,"th",45),t._uU(14,"SALES "),t.qZA(),t.YNc(15,Vn,2,0,"th",46),t.YNc(16,Bn,2,0,"th",47),t.YNc(17,Gn,2,0,"th",48),t.YNc(18,jn,2,0,"th",49),t.qZA(),t.qZA(),t.TgZ(19,"tbody"),t.YNc(20,pa,23,21,"tr",50),t.qZA(),t.YNc(21,ga,16,15,"tfoot",51),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(12),t.Q6J("ngIf",null==e.pageData.Role?null:e.pageData.Role.HasCostRole),t.xp6(3),t.Q6J("ngIf",e.pageData.Filter.ShowInventory),t.xp6(1),t.Q6J("ngIf",e.data.MinVisible&&e.pageData.Filter.ShowInventory),t.xp6(1),t.Q6J("ngIf",(null==e.pageData.Role?null:e.pageData.Role.IsReorderPointEditor)&&e.pageData.Filter.GroupByVariant&&e.data.MinVisible&&e.pageData.Filter.ListIDs),t.xp6(1),t.Q6J("ngIf",null==e.pageData.Role?null:e.pageData.Role.HasCostRole),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data)}}const Za=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"]},xa=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"]},Ca=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Delivery"]};let fa=(()=>{class n extends m.n{constructor(e,o,a,r){super(e,"Report/ProductSales","ReportLoader/ProductSales",null,r),this.httpService=e,this.csvConverter=o,this.toasterService=a,this.activatedRoute=r,this.hideMore=!0,this.ScopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}]}postInit(){this.menuData.H=this.data.PageTitle,$(document).ready(function(){$('[data-toggle="tooltip"]').tooltip({trigger:"hover",sanitize:!1,sanitizeFn:e=>e})})}openBigPicture(e,o){Qn()({el:o.target,imgSrc:e.ImageUrl,noLoader:!1})}updateMinstock(){const e=[];return this.data.Data.forEach(a=>{a.NewMinStock!=a.MinStock&&e.push({VariantID:a.ID,MinStock:a.NewMinStock})}),x.gT.IsEmpty(0==this.pageData.Filter.ListIDs.length)?(alert("Outlet is require"),!1):x.gT.IsEmpty(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:e})).subscribe(a=>{this.toasterService.success(a,Pn.n.Success),this.getListData()})}sortData(e){const o=this.data.Data.slice();function a(r,l,_){return(r<l?-1:1)*(_?1:-1)}this.data.Data=e.active&&""!==e.direction?o.sort((r,l)=>{const _="asc"===e.direction;switch(r.Code=null==r.Code?"":r.Code,l.Code=null==l.Code?"":l.Code,r.BrandName=null==r.BrandName?"":r.BrandName,l.BrandName=null==l.BrandName?"":l.BrandName,e.active){case"Name":return a(r.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),_);case"Code":return a(r.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),_);case"Brand":return a(r.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),_);case"Quantity":return a(r.Quantity,l.Quantity,_);case"Total_Cost":return a(r.UnitCost,l.UnitCost,_);case"Inventory":return a(r.UnitsInStock,l.UnitsInStock,_);case"Total_Sales":return a(r.Total,l.Total,_);case"ReOrder":return a(r.MinStock,l.MinStock,_);default:return 0}}):o}resetListId(){0==this.pageData.Filter.ListIDs.length&&(this.pageData.Filter.ListIDs=null)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(y._W),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-product-sales"]],features:[t.qOj],decls:26,vars:13,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],["class","btn-group mr-6",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fas","fa-balance-scale","mr-2"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary","mr-6",3,"click"],[1,"btn-group","mr-6"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-upload"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-right"],[3,"click"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange","change"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModel","items","ngModelChange"],["name","From",3,"date","showClearBtn","showTodayBtn","dateChange"],["name","To",3,"date","showClearBtn","showTodayBtn","dateChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"ngModel","items","ngModelChange"],["name","Scope",3,"model","options","modelChange"],["id","more-filter","container","",1,"ml-6"],["requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100",3,"ngModel","inputTextValue","ngModelChange"],["requestUrl","/API/AC/GetProductBrandSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["name","Exclude",3,"model","modelChange"],["name","Scope",3,"model","modelChange"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["mat-sort-header","Name"],["mat-sort-header","Code",2,"width","100px"],["mat-sort-header","Quantity",1,"align-right",2,"width","100px"],["style","width: 100px;","class","align-right","mat-sort-header","Total_Cost",4,"ngIf"],["mat-sort-header","Total_Sales",1,"align-right",2,"width","100px"],["style","width: 100px;","class","align-right","mat-sort-header","Inventory",4,"ngIf"],["style","width: 120px;","class","align-right","mat-sort-header","ReOrder",4,"ngIf"],["style","width: 88px;","class","align-right",4,"ngIf"],["class","text-right","style","width: 7.5rem;",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[4,"ngIf"],["mat-sort-header","Total_Cost",1,"align-right",2,"width","100px"],["mat-sort-header","Inventory",1,"align-right",2,"width","100px"],["mat-sort-header","ReOrder",1,"align-right",2,"width","120px"],[1,"align-right",2,"width","88px"],[1,"text-right",2,"width","7.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"mr-3"],["class","d-block",3,"target",4,"ngIf"],[1,"",3,"routerLink","queryParams"],[1,"text-right"],["class","text-right",4,"ngIf"],[3,"routerLink","queryParams",4,"ngIf"],["class","text-right",3,"ngClass",4,"ngIf"],["matTooltip","Click to zoom",2,"width","40px",3,"src","click"],[1,"d-block",3,"target"],["matTooltip","Click to zoom",1,"border","rounded",2,"width","40px",3,"src","click"],[3,"routerLink","queryParams"],["type","text","autoNum","",1,"text-right",2,"width","72px",3,"ngModel","ngModelChange"],[1,"text-right",3,"ngClass"],[1,"table","table-borderless"],["colspan","3",1,"text-right"],[1,"text-right","text-primary"],["class","text-right text-primary ",4,"ngIf"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Text=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Yn,2,0,"a",1),t.YNc(3,Rn,10,0,"div",2),t.TgZ(4,"div",3),t.TgZ(5,"a",4),t._UZ(6,"i",5),t._uU(7,"Compare by Outlet"),t.qZA(),t._UZ(8,"button",6),t.TgZ(9,"ul",7),t.TgZ(10,"li",8),t.TgZ(11,"a",9),t._uU(12,"Compare by Month"),t.qZA(),t.qZA(),t.TgZ(13,"li",8),t.TgZ(14,"a",9),t._uU(15,"Compare with Delivery"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(16,"filters"),t.TgZ(17,"div",10),t.YNc(18,kn,22,15,"div",11),t.YNc(19,En,29,9,"div",12),t.qZA(),t.TgZ(20,"a",13),t.NdJ("click",function(){return o.hideMore=!o.hideMore}),t._uU(21,"More "),t._UZ(22,"i",14),t.qZA(),t.qZA(),t.TgZ(23,"content"),t.TgZ(24,"div",15),t.YNc(25,da,22,7,"div",16),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Text),t.xp6(2),t.Q6J("ngIf",(null==o.pageData.Role?null:o.pageData.Role.IsReorderPointEditor)&&o.pageData.Filter.GroupByVariant&&(null==o.data?null:o.data.MinVisible)&&o.pageData.Filter.ListIDs),t.xp6(1),t.Q6J("ngIf",null==o.pageData.Role?null:o.pageData.Role.HasExportRole),t.xp6(2),t.Q6J("routerLink",t.DdM(10,Za)),t.xp6(6),t.Q6J("routerLink",t.DdM(11,xa)),t.xp6(3),t.Q6J("routerLink",t.DdM(12,Ca)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!o.hideMore),t.xp6(6),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,q.P,D.J,Z.YE,Z.nU,s.sg,k.gM,p.Fj,M.b,s.mk],pipes:[s.JJ,s.uU,T.qU],styles:[""]}),n})();function Aa(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",6),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.convertToCSV(a.csvConverter,!0,"SalesProductByOutlet.csv")}),t._UZ(1,"i",7),t._uU(2," Export"),t.qZA()}}function qa(n,i){if(1&n&&(t.TgZ(0,"span",16),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Da(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Product"),t.qZA(),t.TgZ(3,"autocompleteV2",17),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ProductID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.ProductID)}}function ya(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Variant"),t.qZA(),t.TgZ(3,"autocompleteV2",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ProductID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.ProductID)}}function va(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",8),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Sales"),t.qZA(),t.TgZ(4,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Categories"),t.qZA(),t.TgZ(8,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,qa,2,2,"ng-template",11),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"From - To"),t.qZA(),t.TgZ(13,"datepicker",12),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(14,"datepicker",13),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(15,"div"),t.TgZ(16,"h6"),t._uU(17,"Scope"),t.qZA(),t.TgZ(18,"radio-options",14),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Product=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.YNc(19,Da,4,1,"div",15),t.YNc(20,ya,4,1,"div",15),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("model",e.pageData.Filter.Product)("options",e.ScopeFilter),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.Product),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.Product)}}function Sa(n,i){if(1&n&&(t.TgZ(0,"th",25),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Oqu(e)}}function Ma(n,i){if(1&n&&(t.TgZ(0,"td",25),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Oqu(e)}}function ba(n,i){if(1&n&&(t.TgZ(0,"tr",27),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",28),t._uU(4),t.qZA(),t.YNc(5,Ma,2,1,"td",24),t.TgZ(6,"td",25),t._uU(7),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(1),t.Q6J("ngForOf",e.Quantities),t.xp6(2),t.Oqu(e.Total)}}function Ja(n,i){if(1&n&&(t.TgZ(0,"div",19),t.TgZ(1,"table",20),t.TgZ(2,"thead",21),t.TgZ(3,"tr"),t.TgZ(4,"th",22),t._uU(5,"Nama"),t.qZA(),t.TgZ(6,"th",23),t._uU(7,"Code"),t.qZA(),t.YNc(8,Sa,2,1,"th",24),t.TgZ(9,"th",25),t._uU(10,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"tbody"),t.YNc(12,ba,8,4,"tr",26),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(8),t.Q6J("ngForOf",e.data.Outlet),t.xp6(4),t.Q6J("ngForOf",e.data.Data)}}const Oa=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]};let Ia=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet"),this.httpService=e,this.csvConverter=o,this.ScopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}]}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-product-sales-by-outlet"]],features:[t.qOj],decls:10,vars:8,consts:[[3,"pageData","text","hideSearchBox","textChange","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-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","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales",3,"ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["name","Scope",3,"model","options","modelChange"],[4,"ngIf"],[3,"title"],["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-right",4,"ngFor","ngForOf"],[1,"text-right"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[2,"text-align","right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Aa,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4,"Group by Product"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,va,21,10,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,Ja,13,2,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",null==o.pageData.Filter?null:o.pageData.Filter.IsExport),t.xp6(1),t.Q6J("routerLink",t.DdM(7,Oa)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,C.QB,q.P,D.J,s.sg],styles:[""]}),n})();function Ua(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",6),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.convertToCSV(a.csvConverter,!0,"SalesProductByOutlet.csv")}),t._UZ(1,"i",7),t._uU(2,"Export"),t.qZA()}}function Fa(n,i){if(1&n&&(t.TgZ(0,"span",15),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function wa(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",8),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Fa,2,2,"ng-template",11),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Compare Month From"),t.qZA(),t.TgZ(13,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.MonthFrom=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Compare Month To"),t.qZA(),t.TgZ(17,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.MonthTo=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Year"),t.qZA(),t.TgZ(21,"ng-select",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(22,"div"),t.TgZ(23,"h6"),t._uU(24,"Scope"),t.qZA(),t.TgZ(25,"radio-options",14),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupByVariant=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.MonthFrom)("items",e.Months),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.MonthTo)("items",e.Months),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("model",e.pageData.Filter.GroupByVariant)("options",e.ScopeFilter)}}function Na(n,i){if(1&n&&(t.TgZ(0,"th",25),t._uU(1),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.hij(" ",o.Months[e.Month-1].ColumnLabel," ")}}function Pa(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit,o=t.oxw().$implicit,a=t.oxw(2);t.xp6(1),t.hij(" ",a.findKey(o.Sold,e.Month)?t.lcZ(2,1,a.findKey(o.Sold,e.Month)):""," ")}}const La=function(n){return[n]},Qa=function(n){return{ID:n}};function Ya(n,i){if(1&n&&(t.TgZ(0,"tr",26),t.TgZ(1,"td"),t.TgZ(2,"a",27),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.YNc(6,Pa,3,3,"td",28),t.TgZ(7,"td",29),t._uU(8),t.ALo(9,"number"),t.ALo(10,"sum"),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.VKq(11,La,o.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",t.VKq(13,Qa,e.ID)),t.xp6(1),t.hij(" ",e.Name," "),t.xp6(2),t.Oqu(e.Code),t.xp6(1),t.Q6J("ngForOf",o.data.MonthlySales),t.xp6(2),t.hij(" ",t.lcZ(9,6,t.xi3(10,8,e.Sold,"Value"))," ")}}function Ra(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.Sold)," ")}}function ka(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",30),t._UZ(2,"td"),t._UZ(3,"td"),t.YNc(4,Ra,3,3,"td",28),t.TgZ(5,"td",29),t._uU(6),t.ALo(7,"number"),t.ALo(8,"sum"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("ngForOf",e.data.MonthlySales),t.xp6(2),t.hij(" ",t.lcZ(7,2,t.xi3(8,4,e.data.MonthlySales,"Sold"))," ")}}function Ea(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",16),t.TgZ(1,"table",17),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",18),t.TgZ(3,"tr"),t.TgZ(4,"th",19),t._uU(5,"Name"),t.qZA(),t.TgZ(6,"th",20),t._uU(7,"Code"),t.qZA(),t.YNc(8,Na,2,1,"th",21),t.TgZ(9,"th",22),t._uU(10,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"tbody"),t.YNc(12,Ya,11,15,"tr",23),t.qZA(),t.YNc(13,ka,9,7,"tfoot",24),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(8),t.Q6J("ngForOf",e.data.MonthlySales),t.xp6(4),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.Data.length>0)}}const Ha=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]};let Va=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly"),this.httpService=e,this.csvConverter=o,this.Years=x.gT.GenerateYears((new Date).getFullYear()+1,11,!0),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"}],this.ScopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}]}preGetList(){x.gT.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=x.gT.GuidEmpty)}postInit(){this.menuData.H=this.data.PageTitle}findKey(e,o){let a=null;return e.forEach(r=>{r.Key==o&&(a=r.Value)}),a}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(a.Code=null==a.Code?"":a.Code,r.Code=null==r.Code?"":r.Code,a.Name=null==a.Name?"":a.Name,r.Name=null==r.Name?"":r.Name,e.active){case"Name":return this.compare(a.Name.toLocaleLowerCase(),r.Name.toLocaleLowerCase(),l);case"Code":return this.compare(a.Code.toLocaleLowerCase(),r.Code.toLocaleLowerCase(),l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-product-sales-by-month"]],features:[t.qOj],decls:10,vars:7,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-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","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],["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","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange"],["placeholder","Year",3,"ngModel","items","ngModelChange"],["name","Scope",3,"model","options","modelChange"],[3,"title"],[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",2,"width","120px"],["class","text-right small","style","width: 70px",4,"ngFor","ngForOf"],[1,"text-right",2,"width","75px"],["class","border-bottom",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"text-right","small",2,"width","70px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["class","text-right",4,"ngFor","ngForOf"],[1,"text-right"],[1,"table","table-borderless"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Ua,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4,"Group by Product"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,wa,26,12,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,Ea,14,3,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(1),t.Q6J("routerLink",t.DdM(6,Ha)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,q.P,Z.YE,Z.nU,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function Ba(n,i){if(1&n&&(t.TgZ(0,"span",15),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Ga(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Product"),t.qZA(),t.TgZ(3,"autocompleteV2",16),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ProductID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.ProductID)}}function ja(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Variant"),t.qZA(),t.TgZ(3,"autocompleteV2",17),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ProductID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.ProductID)}}function Wa(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Categories"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(5,Ba,2,2,"ng-template",9),t.qZA(),t.qZA(),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"From - To"),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(10,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(11,"div"),t.TgZ(12,"h6"),t._uU(13,"Scope"),t.qZA(),t.TgZ(14,"radio-options",12),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Product=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.YNc(15,Ga,4,1,"div",13),t.YNc(16,ja,4,1,"div",13),t.TgZ(17,"div"),t.TgZ(18,"h6"),t._uU(19,"Write Performance Log"),t.qZA(),t.TgZ(20,"radio-options",14),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.WritePerformanceLog=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("model",e.pageData.Filter.Product)("options",e.ScopeFilter),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.Product),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.Product),t.xp6(4),t.Q6J("model",e.pageData.Filter.WritePerformanceLog)}}function $a(n,i){if(1&n&&(t.TgZ(0,"th",26),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Oqu(e)}}function Ka(n,i){if(1&n&&(t.TgZ(0,"tr"),t._UZ(1,"th"),t._UZ(2,"th"),t.YNc(3,$a,2,1,"th",25),t.qZA()),2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngForOf",e.data.Outlet)}}function Xa(n,i){if(1&n&&(t.TgZ(0,"th",27),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",e,"")}}function za(n,i){if(1&n&&(t.TgZ(0,"td",22),t._uU(1),t.qZA()),2&n){const e=i.$implicit,o=t.oxw().$implicit;t.xp6(1),t.Oqu(o[e])}}function to(n,i){if(1&n&&(t.TgZ(0,"tr",22),t.YNc(1,za,2,1,"td",24),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",o.getKeys(e))}}function eo(n,i){if(1&n&&(t.TgZ(0,"div",18),t.TgZ(1,"table",19),t.TgZ(2,"thead",20),t.YNc(3,Ka,4,1,"tr",13),t.TgZ(4,"tr"),t.TgZ(5,"th",21),t._uU(6,"Name"),t.qZA(),t.TgZ(7,"th",22),t._uU(8,"Code"),t.qZA(),t.YNc(9,Xa,2,1,"th",23),t.qZA(),t.qZA(),t.TgZ(10,"tbody"),t.YNc(11,to,2,1,"tr",24),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(3),t.Q6J("ngIf",e.data.Outlet.length>0),t.xp6(6),t.Q6J("ngForOf",e.data.Header),t.xp6(2),t.Q6J("ngForOf",e.data.Data)}}const no=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]};let ao=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet"),this.httpService=e,this.csvConverter=o,this.ScopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}]}getKeys(e){return Object.keys(e)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],features:[t.qOj],decls:12,vars:6,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[1,"btn","btn-outline-secondary",3,"routerLink"],[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",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["name","Scope",3,"model","options","modelChange"],[4,"ngIf"],["name","Scope",3,"model","modelChange"],[3,"title"],["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"],[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(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/GetProductSalesVsDelivery","Productsalesvsdelivery.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"Group by Product"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,Wa,21,9,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,eo,12,3,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(5),t.Q6J("routerLink",t.DdM(5,no)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,C.QB,q.P,D.J,s.sg],styles:[""]}),n})();function oo(n,i){if(1&n&&(t.TgZ(0,"span",20),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function ro(n,i){if(1&n&&(t.TgZ(0,"span",20),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function io(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Categories"),t.qZA(),t.TgZ(8,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,oo,2,2,"ng-template",16),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Brand"),t.qZA(),t.TgZ(13,"ng-select",17),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.BrandID=a}),t.YNc(14,ro,2,2,"ng-template",16),t.qZA(),t.qZA(),t.TgZ(15,"div"),t.TgZ(16,"h6"),t._uU(17,"From - To"),t.qZA(),t.TgZ(18,"datepicker",18),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(19,"datepicker",19),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("items",null==e.pageData.Options?null:e.pageData.Options.Brands)("ngModel",e.pageData.Filter.BrandID),t.xp6(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function lo(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",21),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Sales"),t.qZA(),t.TgZ(4,"ng-select",22),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Customer"),t.qZA(),t.TgZ(8,"autocompleteV2",23),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CustomerID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Exclude Zero"),t.qZA(),t.TgZ(12,"radio-options",24),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ExcludeZero=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("items",e.pageData.Options.Sales)("ngModel",e.pageData.Filter.SalesID),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CustomerID),t.xp6(4),t.Q6J("model",e.pageData.Filter.ExcludeZero)}}function so(n,i){1&n&&(t.TgZ(0,"th",42),t._uU(1," COST"),t.qZA())}function po(n,i){1&n&&(t.TgZ(0,"th",43),t._uU(1," PROFIT"),t.qZA())}function co(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Cost))}}function _o(n,i){if(1&n&&(t.TgZ(0,"td",37),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Profit))}}const uo=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]},go=function(n,i,e){return{CategoryID:n,From:i,To:e}};function mo(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t.TgZ(2,"a",44),t.ALo(3,"date"),t.ALo(4,"date"),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"td",37),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",38),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",37),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",37),t._uU(16),t.ALo(17,"number"),t.qZA(),t.YNc(18,co,3,3,"td",39),t.YNc(19,_o,3,3,"td",40),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.DdM(23,uo))("queryParams",t.kEZ(24,go,e.ID,t.xi3(3,9,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(4,12,o.pageData.Filter.To,"ddMMyyyy"))),t.xp6(3),t.Oqu(e.Name),t.xp6(2),t.Oqu(t.lcZ(8,15,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(11,17,e.Total)),t.xp6(3),t.Oqu(t.lcZ(14,19,e.Discount+e.DiscountAmount)),t.xp6(3),t.Oqu(t.lcZ(17,21,e.NetSales)),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",o.pageData.HasRoleCost)}}function Zo(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Cost")),"")}}function ho(n,i){if(1&n&&(t.TgZ(0,"td",37),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Profit")),"")}}function xo(n,i){if(1&n&&(t.TgZ(0,"div",46),t.TgZ(1,"small",47),t._uU(2,"Gross Sales :"),t.qZA(),t.TgZ(3,"strong",48),t._uU(4),t.ALo(5,"number"),t.ALo(6,"sum"),t.qZA(),t.TgZ(7,"small",47),t._uU(8,"- Discount % :"),t.qZA(),t.TgZ(9,"strong",49),t._uU(10),t.ALo(11,"number"),t.ALo(12,"sum"),t.qZA(),t.TgZ(13,"small",47),t._uU(14),t.qZA(),t.TgZ(15,"strong",49),t._uU(16),t.ALo(17,"number"),t.qZA(),t.TgZ(18,"small",47),t._uU(19),t.qZA(),t.TgZ(20,"strong",49),t._uU(21),t.ALo(22,"number"),t.qZA(),t.TgZ(23,"small",47),t._uU(24),t.qZA(),t.TgZ(25,"strong",50),t._uU(26),t.ALo(27,"number"),t.ALo(28,"sum"),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(4),t.Oqu(t.lcZ(5,8,t.xi3(6,10,e.data.Data,"Total"))),t.xp6(6),t.Oqu(t.lcZ(11,13,t.xi3(12,15,e.data.Data,"Discount"))),t.xp6(4),t.hij("- Discount ",e.data.Currency," :"),t.xp6(2),t.Oqu(t.lcZ(17,18,e.data.TotalDiscountAmount.DiscountAmount)),t.xp6(3),t.hij("- Point Used ",e.data.Currency," :"),t.xp6(2),t.Oqu(t.lcZ(22,20,e.data.TotalDiscountAmount.PointUsed)),t.xp6(3),t.hij("= Net Sales ",e.data.Currency," :"),t.xp6(2),t.Oqu(t.lcZ(27,22,t.xi3(28,24,e.data.Data,"NetSales")-e.data.TotalDiscountAmount.DiscountAmount-e.data.TotalDiscountAmount.PointUsed))}}function To(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",25),t.TgZ(1,"table",26),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",27),t.TgZ(3,"tr"),t.TgZ(4,"th",28),t._uU(5,"CATEGORY"),t.qZA(),t.TgZ(6,"th",29),t._uU(7,"QUANTITY"),t.qZA(),t.TgZ(8,"th",30),t._uU(9,"GROSS SALES"),t.qZA(),t.TgZ(10,"th",31),t._uU(11,"DISCOUNT"),t.qZA(),t.TgZ(12,"th",32),t._uU(13,"NET SALES"),t.qZA(),t.YNc(14,so,2,0,"th",33),t.YNc(15,po,2,0,"th",34),t.qZA(),t.qZA(),t.TgZ(16,"tbody"),t.YNc(17,mo,20,28,"tr",35),t.qZA(),t.TgZ(18,"tfoot"),t.TgZ(19,"tr",36),t.TgZ(20,"td",37),t._uU(21,"Total : "),t.qZA(),t.TgZ(22,"td",37),t._uU(23),t.ALo(24,"number"),t.ALo(25,"sum"),t.qZA(),t.TgZ(26,"td",38),t.TgZ(27,"a"),t._uU(28),t.ALo(29,"number"),t.ALo(30,"sum"),t.qZA(),t.qZA(),t.TgZ(31,"td",37),t._uU(32),t.ALo(33,"number"),t.ALo(34,"sum"),t.qZA(),t.TgZ(35,"td",37),t._uU(36),t.ALo(37,"number"),t.ALo(38,"sum"),t.qZA(),t.YNc(39,Zo,4,6,"td",39),t.YNc(40,ho,4,6,"td",40),t.qZA(),t.qZA(),t.qZA(),t.YNc(41,xo,29,27,"div",41),t.qZA()}if(2&n){const e=t.oxw();t.xp6(14),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(6),t.Oqu(t.lcZ(24,10,t.xi3(25,12,e.data.Data,"Quantity"))),t.xp6(5),t.Oqu(t.lcZ(29,15,t.xi3(30,17,e.data.Data,"Total"))),t.xp6(4),t.Oqu(t.lcZ(33,20,t.xi3(34,22,e.data.Data,"Discount"))),t.xp6(4),t.Oqu(t.lcZ(37,25,t.xi3(38,27,e.data.Data,"NetSales"))),t.xp6(3),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",e.data.Data.length>0)}}const fo=function(){return["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"]},qo=function(){return["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"]};let Do=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/CategorySales","ReportLoader/CategorySales"),this.httpService=e,this.csvConverter=o,this.hideMore=!0}postInit(){this.menuData.H=this.data.PageTitle}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Name":return this.compare(a.Name,r.Name,l);case"Total":return this.compare(a.Total,r.Total,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Discount":return this.compare(a.Discount,r.Discount,l);case"NetSales":return this.compare(a.NetSales,r.NetSales,l);case"Cost":return this.compare(a.Cost,r.Cost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-category-sales"]],features:[t.qOj],decls:20,vars:10,consts:[[3,"pageData","text","hideSearchBox","textChange","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],[1,"fas","fa-chart-area"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fas","fa-balance-scale","mr-2"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],["class","container-fluid mt-5",4,"ngIf"],["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"],["name","To",3,"date","dateChange"],[3,"title"],["id","more-filter","container","",1,"ml-6"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"items","ngModel","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModel","ngModelChange"],[3,"model","modelChange"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"text-left"],["mat-sort-header","Quantity",1,"align-right",2,"width","120px"],["mat-sort-header","Total",1,"align-right",2,"width","120px"],["mat-sort-header","Discount",1,"align-right",2,"width","120px"],["mat-sort-header","NetSales",1,"align-right",2,"width","120px"],["class","align-right","style","width: 120px;","mat-sort-header","Cost",4,"ngIf"],["class","align-right","style","width: 120px;","mat-sort-header","Profit",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right"],[1,"text-right","text-primary"],["class","text-right text-danger",4,"ngIf"],["class","text-right",4,"ngIf"],["class","h6 mt-12",4,"ngIf"],["mat-sort-header","Cost",1,"align-right",2,"width","120px"],["mat-sort-header","Profit",1,"align-right",2,"width","120px"],[3,"routerLink","queryParams"],[1,"text-right","text-danger"],[1,"h6","mt-12"],[1,"text-muted","h6"],[1,"text-primary","font-weight-bold","h2"],[1,"text-danger","font-weight-bold","h2"],[1,"text-success","font-weight-bold","h2"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/CategorySales","Category Sales.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.TgZ(5,"a",3),t._UZ(6,"i",4),t._uU(7," Chart View"),t.qZA(),t.TgZ(8,"a",5),t._UZ(9,"i",6),t._uU(10,"By Outlet"),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",7),t.YNc(13,io,20,9,"div",8),t.YNc(14,lo,13,4,"div",9),t.TgZ(15,"a",10),t.NdJ("click",function(){return o.hideMore=!o.hideMore}),t._uU(16,"More "),t._UZ(17,"i",11),t.qZA(),t.qZA(),t.qZA(),t.TgZ(18,"content"),t.YNc(19,To,42,30,"div",12),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number)("hideSearchBox",!0),t.xp6(5),t.Q6J("routerLink",t.DdM(8,fo)),t.xp6(3),t.Q6J("routerLink",t.DdM(9,qo)),t.xp6(5),t.Q6J("ngIf",o.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!o.hideMore),t.xp6(5),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,C.QB,D.J,q.P,Z.YE,Z.nU,s.sg],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function yo(n,i){if(1&n&&(t.TgZ(0,"span",13),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function vo(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Categories"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(5,yo,2,2,"ng-template",9),t.qZA(),t.qZA(),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"From - To"),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(10,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(11,"div"),t.TgZ(12,"h6"),t._uU(13,"Customer"),t.qZA(),t.TgZ(14,"autocompleteV2",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CustomerID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CustomerID)}}function So(n,i){if(1&n&&(t.TgZ(0,"th",20),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.Q6J("mat-sort-header",e),t.xp6(1),t.Oqu(e)}}function Mo(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(1),t.Oqu(o[e])}}function bo(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,o[e]))}}function Jo(n,i){if(1&n&&(t.TgZ(0,"td"),t.YNc(1,Mo,2,1,"span",19),t.YNc(2,bo,3,3,"span",19),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Q6J("ngIf","Category"==e),t.xp6(1),t.Q6J("ngIf","Category"!=e)}}function Oo(n,i){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,Jo,3,2,"td",18),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",o.getKey(e))}}function Io(n,i){if(1&n&&(t.TgZ(0,"td",22),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e),"")}}function Uo(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",21),t.TgZ(2,"td",22),t._uU(3,"Total : "),t.qZA(),t.YNc(4,Io,3,3,"td",23),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("ngForOf",e.data.Sum)}}function Fo(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",14),t.TgZ(1,"table",15),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",16),t.TgZ(3,"tr"),t.YNc(4,So,2,2,"th",17),t.qZA(),t.qZA(),t.TgZ(5,"tbody"),t.YNc(6,Oo,2,1,"tr",18),t.qZA(),t.YNc(7,Uo,5,1,"tfoot",19),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngForOf",e.data.Dataheader),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.Data.length>0)}}const wo=function(){return["/menu/Reports/Sales_Report/Standard/Category_Sold"]};let No=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet"),this.httpService=e,this.csvConverter=o}postInit(){this.menuData.H=this.data.PageTitle}getKey(e){return Object.keys(e)}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;for(let _=0;_<this.data.Dataheader.length;_++)if(e.active==this.data.Dataheader[_])return this.compare(a[this.data.Dataheader[_]],r[this.data.Dataheader[_]],l)}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-category-sales-by-outlet"]],features:[t.qOj],decls:12,vars:7,consts:[[3,"pageData","text","hideSearchBox","textChange","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[1,"btn","btn-outline-secondary",3,"routerLink"],[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",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModel","ngModelChange"],[3,"title"],[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"],[1,""],["class","",4,"ngFor","ngForOf"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,!0,"CategorySalesByOutlet.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"Table View"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,vo,15,5,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,Fo,8,3,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number)("hideSearchBox",!0),t.xp6(5),t.Q6J("routerLink",t.DdM(6,wo)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,C.QB,D.J,Z.YE,s.sg,Z.nU],pipes:[s.JJ],styles:[""]}),n})();var U=f(7168);function Po(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",5),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Month"),t.qZA(),t.TgZ(4,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Month=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Year"),t.qZA(),t.TgZ(8,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Currency"),t.qZA(),t.TgZ(12,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",e.pageData.Options.Currencies)}}function Lo(n,i){if(1&n&&(t.TgZ(0,"div",9),t._UZ(1,"POS-pie-chart",10),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("config",e.pieConfig)("data",e.PieData)}}const Qo=function(){return["/menu/Reports/Sales_Report/Standard/Category_Sold"]};let Yo=(()=>{class n extends m.n{constructor(e){super(e,"Report/CategoryChart","ReportLoader/CategoryChartLoader"),this.httpService=e,this.Months=x.gT.Months,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}},this.PieData={}}postInit(){const e=[],o=[];this.data.forEach(a=>{e.push(a.Name),o.push({name:a.Name,y:a.Total})}),this.PieData=o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-category"]],features:[t.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","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(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t._uU(3,"Table View"),t.qZA(),t.qZA(),t.TgZ(4,"filters"),t.TgZ(5,"div",2),t.YNc(6,Po,13,6,"div",3),t.qZA(),t.qZA(),t.TgZ(7,"content"),t.YNc(8,Lo,2,2,"div",4),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(2),t.Q6J("routerLink",t.DdM(5,Qo)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,U.J],styles:[""]}),n})();var J=f(3975);function Ro(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year"),t.qZA(),t.TgZ(3,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Year=a})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years)}}function ko(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Month"),t.qZA(),t.TgZ(3,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Month=a})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months)}}function Eo(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",12),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",13),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Ho(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Date Filter"),t.qZA(),t.TgZ(8,"radio-options",8),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Custom=a}),t.qZA(),t.qZA(),t.YNc(9,Ro,4,2,"div",9),t.YNc(10,ko,4,2,"div",9),t.YNc(11,Eo,5,2,"div",9),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("model",e.pageData.Filter.Custom)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.Custom),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.Custom),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.Custom)}}function Vo(n,i){if(1&n&&(t.TgZ(0,"div",14),t.TgZ(1,"div",15),t.TgZ(2,"div",16),t.TgZ(3,"div",17),t.TgZ(4,"div",18),t.TgZ(5,"div",19),t.TgZ(6,"p",20),t._uU(7,"Transaction Per Hour"),t.qZA(),t.qZA(),t.TgZ(8,"div",21),t._UZ(9,"POS-line-chart",22),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(10,"div",16),t.TgZ(11,"div",17),t.TgZ(12,"div",18),t.TgZ(13,"div",19),t.TgZ(14,"p",20),t._uU(15,"Transaction Per Session"),t.qZA(),t.qZA(),t.TgZ(16,"div",21),t._UZ(17,"POS-pie-chart",22),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(9),t.Q6J("config",e.chartConfig)("data",e.ChartData),t.xp6(8),t.Q6J("config",e.pieConfig)("data",e.PieData)}}const Go=function(){return["/menu/Reports/Sales_Report/Standard/Peak_Hour/Visitor"]},Wo=function(){return["/menu/Reports/Sales_Report/Standard/Peak_Hour/Peak_Hour"]};let $o=(()=>{class n extends m.n{constructor(e){super(e,"Report/PeakHour","ReportLoader/PeakHourLoader"),this.httpService=e,this.RadioDateFilterType=[{Key:!1,Value:"Month"},{Key:!0,Value:"Custom"}],this.DateFilterType="Month",this.categories=[],this.PieData={},this.ChartData={},this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.Months=x.gT.Months,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(o,a){return o+"<br/>"+a.series.name+": <b>"+a.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}postInit(){const e=new Date;this.Year=e.getFullYear();const o=[],a=[];this.data.Data.forEach(r=>{o.push(r.Name),a.push({name:r.Name,y:r.Transaction})}),this.PieData=a,this.ChartData={series:this.data.series},this.categories=this.data.categories}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-peak-hour"]],features:[t.qOj],decls:11,vars:8,consts:[[3,"pageData","hideSearchBox","onSubmit"],[1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],[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",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["name","Date Filter",3,"model","options","modelChange"],[4,"ngIf"],["placeholder","Year",3,"ngModel","items","ngModelChange","clear"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","clear"],["name","From",3,"date","dateChange"],["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(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t._uU(3,"Visitor View"),t.qZA(),t.TgZ(4,"a",2),t._uU(5,"Table View"),t.qZA(),t.qZA(),t.TgZ(6,"filters"),t.TgZ(7,"div",3),t.YNc(8,Ho,12,8,"div",4),t.qZA(),t.qZA(),t.TgZ(9,"content"),t.YNc(10,Vo,18,4,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(6,Go)),t.xp6(2),t.Q6J("routerLink",t.DdM(7,Wo)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,q.P,C.QB,J.D,U.J],styles:[""]}),n})();function Ko(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",8),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From - To"),t.qZA(),t.TgZ(8,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Xo(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.ALo(3,"number"),t.qZA(),t.TgZ(4,"td",20),t._uU(5),t.ALo(6,"number"),t.qZA(),t.TgZ(7,"td",20),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"td",20),t._uU(11),t.ALo(12,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,4,e.Visitor)),t.xp6(3),t.Oqu(t.lcZ(6,6,e.Orders)),t.xp6(3),t.Oqu(t.lcZ(9,8,e.TotalVisitor)),t.xp6(3),t.Oqu(t.lcZ(12,10,e.SalesNTax))}}function zo(n,i){if(1&n&&(t.TgZ(0,"div",12),t.TgZ(1,"table",13),t.TgZ(2,"thead",14),t.TgZ(3,"tr"),t.TgZ(4,"th",15),t._uU(5,"Visitor"),t.qZA(),t.TgZ(6,"th",16),t._uU(7,"Transaction"),t.qZA(),t.TgZ(8,"th",16),t._uU(9,"Total Visitor"),t.qZA(),t.TgZ(10,"th",17),t._uU(11,"Sales + Tax"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(12,"tbody"),t.YNc(13,Xo,13,12,"tr",18),t.qZA(),t.TgZ(14,"tfoot"),t.TgZ(15,"tr",19),t.TgZ(16,"td",20),t._uU(17,"Total"),t.qZA(),t.TgZ(18,"td",20),t._uU(19),t.ALo(20,"number"),t.ALo(21,"sum"),t.qZA(),t.TgZ(22,"td",20),t._uU(23),t.ALo(24,"number"),t.ALo(25,"sum"),t.qZA(),t.TgZ(26,"td",20),t._uU(27),t.ALo(28,"number"),t.ALo(29,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(13),t.Q6J("ngForOf",e.data),t.xp6(6),t.Oqu(t.lcZ(20,4,t.xi3(21,6,e.data,"Orders"))),t.xp6(4),t.Oqu(t.lcZ(24,9,t.xi3(25,11,e.data,"TotalVisitor"))),t.xp6(4),t.Oqu(t.lcZ(28,14,t.xi3(29,16,e.data,"SalesNTax")))}}const tr=function(){return["/menu/Reports/Sales_Report/Standard/Peak_Hour"]},nr=function(){return["/menu/Reports/Sales_Report/Standard/Peak_Hour/Peak_Hour"]};let ar=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader"),this.httpService=e,this.csvConverter=o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-visitor"]],features:[t.qOj],decls:14,vars:8,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],[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",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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-right",2,"width","50px"],[1,"text-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,!1,"PeakHour.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"Chart View"),t.qZA(),t.TgZ(7,"a",4),t._uU(8,"Table View"),t.qZA(),t.qZA(),t.TgZ(9,"filters"),t.TgZ(10,"div",5),t.YNc(11,Ko,10,5,"div",6),t.qZA(),t.qZA(),t.TgZ(12,"content"),t.YNc(13,zo,30,19,"div",7),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(5),t.Q6J("routerLink",t.DdM(6,tr)),t.xp6(2),t.Q6J("routerLink",t.DdM(7,nr)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,C.QB,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function or(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",7),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/GetPeakHourList","PeakHour.csv"),a.changeExport()}),t._UZ(1,"i",8),t._uU(2,"Export"),t.qZA()}}function rr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year"),t.qZA(),t.TgZ(3,"ng-select",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Year=a})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years)}}function ir(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Month"),t.qZA(),t.TgZ(3,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Month=a})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months)}}function lr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",15),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",16),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function sr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",9),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Date Filter"),t.qZA(),t.TgZ(8,"radio-options",11),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Custom=a}),t.qZA(),t.qZA(),t.YNc(9,rr,4,2,"div",12),t.YNc(10,ir,4,2,"div",12),t.YNc(11,lr,5,2,"div",12),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("model",e.pageData.Filter.Custom)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.Custom),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.Custom),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.Custom)}}function pr(n,i){1&n&&(t.TgZ(0,"th",22),t._uU(1,"Revenue"),t.qZA())}function cr(n,i){if(1&n&&(t.TgZ(0,"td",27),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Revenue))}}function _r(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",27),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",27),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",27),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",27),t._uU(13),t.ALo(14,"number"),t.ALo(15,"RoundUp"),t.qZA(),t.TgZ(16,"td",27),t._uU(17),t.ALo(18,"number"),t.ALo(19,"RoundUp"),t.qZA(),t.YNc(20,cr,3,3,"td",28),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.TimeFormat),t.xp6(2),t.Oqu(t.lcZ(5,7,e.Count)),t.xp6(3),t.Oqu(t.lcZ(8,9,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(11,11,e.Sales)),t.xp6(3),t.Oqu(t.lcZ(14,13,t.lcZ(15,15,e.Tax))),t.xp6(4),t.Oqu(t.lcZ(18,17,t.lcZ(19,19,e.SalesWithTax))),t.xp6(3),t.Q6J("ngIf",o.pageData.IsRevenue)}}function ur(n,i){if(1&n&&(t.TgZ(0,"td",27),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(t.lcZ(2,1,t.xi3(3,3,e.data,"Revenue")))}}function gr(n,i){if(1&n&&(t.TgZ(0,"div",17),t.TgZ(1,"table",18),t.TgZ(2,"thead",19),t.TgZ(3,"tr"),t.TgZ(4,"th",20),t._uU(5,"Time"),t.qZA(),t.TgZ(6,"th",21),t._uU(7,"Order"),t.qZA(),t.TgZ(8,"th",21),t._uU(9,"Quantity"),t.qZA(),t.TgZ(10,"th",22),t._uU(11,"Sales"),t.qZA(),t.TgZ(12,"th",22),t._uU(13,"Tax"),t.qZA(),t.TgZ(14,"th",22),t._uU(15,"Sales + Tax"),t.qZA(),t.YNc(16,pr,2,0,"th",23),t.qZA(),t.qZA(),t.TgZ(17,"tbody"),t.YNc(18,_r,21,21,"tr",24),t.qZA(),t.TgZ(19,"tfoot"),t.TgZ(20,"tr",25),t._UZ(21,"td",26),t.TgZ(22,"td",27),t._uU(23),t.ALo(24,"number"),t.ALo(25,"sum"),t.qZA(),t.TgZ(26,"td",27),t._uU(27),t.ALo(28,"number"),t.ALo(29,"sum"),t.qZA(),t.TgZ(30,"td",27),t._uU(31),t.ALo(32,"number"),t.ALo(33,"sum"),t.qZA(),t.TgZ(34,"td",27),t._uU(35),t.ALo(36,"number"),t.ALo(37,"RoundUp"),t.ALo(38,"sum"),t.qZA(),t.TgZ(39,"td",27),t._uU(40),t.ALo(41,"number"),t.ALo(42,"RoundUp"),t.ALo(43,"sum"),t.qZA(),t.YNc(44,ur,4,6,"td",28),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(16),t.Q6J("ngIf",e.pageData.IsRevenue),t.xp6(2),t.Q6J("ngForOf",e.data),t.xp6(5),t.Oqu(t.lcZ(24,8,t.xi3(25,10,e.data,"Count"))),t.xp6(4),t.Oqu(t.lcZ(28,13,t.xi3(29,15,e.data,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(32,18,t.xi3(33,20,e.data,"Sales"))),t.xp6(4),t.Oqu(t.lcZ(36,23,t.lcZ(37,25,t.xi3(38,27,e.data,"Tax")))),t.xp6(5),t.Oqu(t.lcZ(41,30,t.lcZ(42,32,t.xi3(43,34,e.data,"SalesWithTax")))),t.xp6(4),t.Q6J("ngIf",e.pageData.IsRevenue)}}const mr=function(){return["/menu/Reports/Sales_Report/Standard/Peak_Hour/Visitor"]},Zr=function(){return["/menu/Reports/Sales_Report/Standard/Peak_Hour"]};let hr=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetPeakHourList","ReportLoader/PeakHourLoader"),this.httpService=e,this.csvConverter=o,this.RadioDateFilterType=[{Key:!1,Value:"Month"},{Key:!0,Value:"Custom"}],this.DateFilterType="Month",this.Years=x.gT.GenerateYears((new Date).getFullYear(),10,!0),this.Months=x.gT.Months,this.menuData.H="Peak Hour Table"}changeExport(){this.pageData.Filter.Export=!1}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-table-view"]],features:[t.qOj],decls:12,vars:9,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an Outlet",3,"ngModel","items","ngModelChange"],["name","Date Filter",3,"model","options","modelChange"],[4,"ngIf"],["placeholder","Year",3,"ngModel","items","ngModelChange","clear"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","clear"],["name","From",3,"date","dateChange"],["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-right",2,"width","50px"],[1,"text-right",2,"width","120px"],["style","width: 120px","class"," text-right",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-right"],["class","text-right",4,"ngIf"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,or,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4,"Vistor View"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"Chart View"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,sr,12,7,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,gr,45,37,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasExportRole),t.xp6(1),t.Q6J("routerLink",t.DdM(7,mr)),t.xp6(2),t.Q6J("routerLink",t.DdM(8,Zr)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,q.P,C.QB,s.sg],pipes:[s.JJ,T.qU,T.Fo],styles:[""]}),n})();function xr(n,i){if(1&n&&(t.TgZ(0,"span",18),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Tr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",11),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,xr,2,2,"ng-template",14),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Currency"),t.qZA(),t.TgZ(13,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Month"),t.qZA(),t.TgZ(17,"ng-select",16),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Month=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Year"),t.qZA(),t.TgZ(21,"ng-select",17),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years)}}function Cr(n,i){if(1&n&&(t.TgZ(0,"div",19),t._UZ(1,"POS-line-chart",20),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("config",e.chartConfig)("data",e.ChartData)}}const Ar=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"]},qr=function(n,i){return{Month:n,Year:i}},Dr=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Yearly"]},vr=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"]};let Sr=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,o),this.ChartData={},this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.Months=x.gT.Months}preGetList(){const e=this.route.snapshot.queryParams;this.pageData.Filter.Month=e.Month,this.pageData.Filter.Year=e.Year}postInit(){this.ChartData={series:this.data.Series};const e=new Date(this.data.From),o=e.getMonth(),a=e.getFullYear();this.from=Date.UTC(a,o,1),this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{type:"datetime"},yAxis:{title:{text:""}},plotOptions:{series:{pointStart:this.from,pointInterval:864e5}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-daily-sales"]],features:[t.qOj],decls:19,vars:14,consts:[[3,"pageData","hideSearchBox","onSubmit"],[1,"btn-group"],["title","Table View",1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa","fa-table"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[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",""],["bindLabel","Symbol","bindValue","ID","placeholder","Choose a Currency",3,"ngModel","items","ngModelChange"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange"],["placeholder","Year",3,"ngModel","items","ngModelChange"],[3,"title"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"div",1),t.TgZ(3,"a",2),t._UZ(4,"i",3),t._uU(5," Table View"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10," Comparable PerYear"),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t._uU(13," Daily Quantity"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"filters"),t.TgZ(15,"div",8),t.YNc(16,Tr,22,10,"div",9),t.qZA(),t.qZA(),t.TgZ(17,"content"),t.YNc(18,Cr,2,2,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(3),t.Q6J("routerLink",t.DdM(8,Ar))("queryParams",t.WLB(9,qr,null==o.pageData.Filter?null:o.pageData.Filter.Month,null==o.pageData.Filter?null:o.pageData.Filter.Year)),t.xp6(6),t.Q6J("routerLink",t.DdM(12,Dr)),t.xp6(3),t.Q6J("routerLink",t.DdM(13,vr)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,J.D],styles:[""]}),n})();function Mr(n,i){if(1&n&&(t.TgZ(0,"span",17),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function br(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",11),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Year"),t.qZA(),t.TgZ(8,"ng-select",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Category"),t.qZA(),t.TgZ(12,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(13,Mr,2,2,"ng-template",15),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Currency"),t.qZA(),t.TgZ(17,"ng-select",16),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().currency=a})("change",function(){return t.CHM(e),t.oxw().checkFilterCurrency()}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.currency)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies)}}function Jr(n,i){if(1&n&&(t.TgZ(0,"div",18),t._UZ(1,"POS-line-chart",19),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("config",e.chartConfig)("data",e.ChartData)}}const Ir=function(){return["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"]},Fr=function(){return["/menu/Reports/Sales_Report/Standard/Monthly/Yearly_Table"]};let wr=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance"),this.httpService=e,this.csvConverter=o,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.ChartData={},this.currency=-1}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 e=[];this.data.MonthlySalesRank.forEach(o=>{const a={name:o.Name,data:o.Sales};a.data.unshift(null),e.push(a)}),this.ChartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{min:1,max:12},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-monthly-sales"]],features:[t.qOj],decls:16,vars:8,consts:[[3,"pageData","text","textChange","onSubmit"],[1,"btn-group"],["title","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[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"],["placeholder","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"],[3,"title"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"div",1),t.TgZ(3,"a",2),t._UZ(4,"i",3),t._uU(5," Table View"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10," View Yearly "),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",8),t.YNc(13,br,18,8,"div",9),t.qZA(),t.qZA(),t.TgZ(14,"content"),t.YNc(15,Jr,2,2,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(3),t.Q6J("routerLink",t.DdM(6,Ir)),t.xp6(6),t.Q6J("routerLink",t.DdM(7,Fr)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,J.D],styles:[""]}),n})();function Nr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.convertToCSV(a.csvConverter,!1,"SalesPerYear.csv")}),t._UZ(1,"i",12),t._uU(2,"Export"),t.qZA()}}function Pr(n,i){if(1&n&&(t.TgZ(0,"span",22),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Lr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Pr,2,2,"ng-template",16),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Sales Name"),t.qZA(),t.TgZ(13,"ng-select",17),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Year to Compare"),t.qZA(),t.TgZ(17,"div",18),t.TgZ(18,"div",19),t.TgZ(19,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.FromYear=a}),t.qZA(),t.qZA(),t.TgZ(20,"div",19),t.TgZ(21,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ToYear=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(22,"div"),t.TgZ(23,"h6"),t._uU(24,"Type"),t.qZA(),t.TgZ(25,"ng-select",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Option?null:e.pageData.Option.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Option?null:e.pageData.Option.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Option?null:e.pageData.Option.Sales),t.xp6(6),t.Q6J("ngModel",e.pageData.Filter.FromYear)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.pageData.Filter.ToYear)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",e.pageData.Option.Types)}}function Qr(n,i){if(1&n&&(t.TgZ(0,"th",34),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",e,"")}}function Yr(n,i){if(1&n&&(t.TgZ(0,"td",34),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=i.$implicit,o=t.oxw().$implicit,a=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,a.filterSales(o.Sales,"Year",e),"Sales"))," ")}}const H=function(n,i){return{"text-success font-weight-bold":n,"text-danger font-weight-bold":i}};function Rr(n,i){if(1&n&&(t.TgZ(0,"tr",35),t.TgZ(1,"td",26),t._uU(2),t.ALo(3,"Month"),t.qZA(),t.YNc(4,Yr,4,6,"td",36),t.TgZ(5,"td",37),t.ALo(6,"sum"),t.ALo(7,"sum"),t._uU(8),t.ALo(9,"number"),t.ALo(10,"sum"),t.qZA(),t.TgZ(11,"td",37),t.ALo(12,"sum"),t.ALo(13,"sum"),t._uU(14),t.ALo(15,"number"),t.ALo(16,"sum"),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(t.lcZ(3,6,e.Month)),t.xp6(2),t.Q6J("ngForOf",o.data.HeaderList),t.xp6(1),t.Q6J("ngClass",t.WLB(30,H,t.xi3(6,8,o.filterSales(e.Difference,"Month",e.Month),"Difference")>0,t.xi3(7,11,o.filterSales(e.Difference,"Month",e.Month),"Difference")<0)),t.xp6(3),t.hij(" ",t.lcZ(9,14,t.xi3(10,16,o.filterSales(e.Difference,"Month",e.Month),"Difference"))," "),t.xp6(3),t.Q6J("ngClass",t.WLB(33,H,t.xi3(12,19,o.filterSales(e.Difference,"Month",e.Month),"Percentage")>0,t.xi3(13,22,o.filterSales(e.Difference,"Month",e.Month),"Percentage")<0)),t.xp6(3),t.hij(" ",t.lcZ(15,25,t.xi3(16,27,o.filterSales(e.Difference,"Month",e.Month),"Percentage"))," ")}}function kr(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.ALo(4,"GetChildrenArray"),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,o.filterSales(t.xi3(4,6,o.data.Data,"Sales"),"Year",e),"Sales"))," ")}}const Er=function(n,i){return{"text-success":n,"text-danger":i}};function Hr(n,i){if(1&n&&(t.TgZ(0,"div",23),t.TgZ(1,"table",24),t.TgZ(2,"thead",25),t.TgZ(3,"tr"),t.TgZ(4,"th",26),t._uU(5,"Month"),t.qZA(),t.YNc(6,Qr,2,1,"th",27),t.TgZ(7,"th",28),t._uU(8,"Differences (IDR)"),t.qZA(),t.TgZ(9,"th",28),t._uU(10,"Percentage (%)"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"tbody"),t.YNc(12,Rr,17,36,"tr",29),t.qZA(),t.TgZ(13,"tfoot",30),t.TgZ(14,"tr"),t.TgZ(15,"td",31),t._uU(16,"Total :"),t.qZA(),t.YNc(17,kr,5,9,"td",32),t.TgZ(18,"td",33),t._uU(19),t.ALo(20,"number"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(6),t.Q6J("ngForOf",e.data.HeaderList),t.xp6(6),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Q6J("ngForOf",e.data.HeaderList),t.xp6(1),t.Q6J("ngClass",t.WLB(7,Er,e.data.TotalDiff>0,e.data.TotalDiff<0)),t.xp6(1),t.hij(" ",t.lcZ(20,5,e.data.TotalDiff),"")}}const Vr=function(){return["/menu/Reports/Sales_Report/Standard/Monthly"]},Br=function(){return["/menu/Reports/Sales_Report/Standard/Daily"]};let V=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/YearlySalesList","ReportLoader/YearlyReportSales"),this.httpService=e,this.csvConverter=o,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0)}filterSales(e,o,a){return e.filter(function(r){return r[o]==a})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-yearly"]],features:[t.qOj],decls:16,vars:9,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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,"ngModel","items","ngModelChange"],[1,"row"],[1,"col-6"],["placeholder","Year",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a Types",3,"ngModel","items","ngModelChange"],[3,"title"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","30px"],["style","width: 20px","class"," text-right",4,"ngFor","ngForOf"],[1,"text-right",2,"width","30px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"font-weight-bold","text-success"],["class","text-right text-success",4,"ngFor","ngForOf"],[1,"text-right",3,"ngClass"],[1,"text-right",2,"width","20px"],[1,"border-bottom"],["style","width: 20px","class","text-right",4,"ngFor","ngForOf"],[1,"text-right",2,"width","30px",3,"ngClass"],[1,"text-right","text-success"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Nr,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"View Monthly"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10," View Daily"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",8),t.YNc(13,Lr,26,13,"div",9),t.qZA(),t.qZA(),t.TgZ(14,"content"),t.YNc(15,Hr,21,10,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasExportRole),t.xp6(2),t.Q6J("routerLink",t.DdM(7,Vr)),t.xp6(5),t.Q6J("routerLink",t.DdM(8,Br)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,s.sg,s.mk],pipes:[s.JJ,T.mr,T.qU,T.J1],styles:[""]}),n})();function Gr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",15),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/DailySalesExport","Daily_Sales_Report.csv")}),t._UZ(1,"i",16),t._uU(2,"Export"),t.qZA()}}function jr(n,i){if(1&n&&(t.TgZ(0,"span",23),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Wr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",17),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",19),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,jr,2,2,"ng-template",20),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Sales Name"),t.qZA(),t.TgZ(13,"ng-select",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Month"),t.qZA(),t.TgZ(17,"ng-select",22),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Month=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months)}}function $r(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",24),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Year"),t.qZA(),t.TgZ(4,"ng-select",25),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Delivery"),t.qZA(),t.TgZ(8,"ng-select",26),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.DeliveryID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Currency"),t.qZA(),t.TgZ(12,"ng-select",27),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(13,"div"),t.TgZ(14,"h6"),t._uU(15,"Type"),t.qZA(),t.TgZ(16,"ng-select",28),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.DeliveryID)("items",null==e.pageData.Options?null:e.pageData.Options.Deliveries),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types)}}function Kr(n,i){1&n&&(t.TgZ(0,"th",48),t._uU(1," Tax "),t.qZA())}function Xr(n,i){1&n&&(t.TgZ(0,"th",49),t._uU(1,"Net Sales + Tax"),t.qZA())}function zr(n,i){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Cost"),t.qZA())}function ti(n,i){1&n&&(t.TgZ(0,"th",51),t._uU(1," Profit "),t.qZA())}function ei(n,i){1&n&&(t.TgZ(0,"th",52),t._uU(1," Profit + Tax Include "),t.qZA())}function ni(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Tax))}}function ai(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",t.lcZ(2,1,e.SalesNetWithTax)," ")}}function oi(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.Cost),"")}}function ri(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.Profit),"")}}function ii(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.ProfitWithTax),"")}}const B=function(n){return{"is-weekend":n}};function li(n,i){if(1&n&&(t.TgZ(0,"tr",53),t.TgZ(1,"td",53),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.ALo(6,"date"),t.qZA(),t.TgZ(7,"td",45),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"td",45),t._uU(11),t.ALo(12,"number"),t.qZA(),t.TgZ(13,"td",45),t._uU(14),t.ALo(15,"number"),t.qZA(),t.TgZ(16,"td",45),t._uU(17),t.ALo(18,"number"),t.qZA(),t.YNc(19,ni,3,3,"td",46),t.YNc(20,ai,3,3,"td",46),t.YNc(21,oi,3,3,"td",47),t.YNc(22,ri,3,3,"td",46),t.YNc(23,ii,3,3,"td",46),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.Q6J("ngClass",t.VKq(27,B,o.data.DayOfWeekend)),t.xp6(1),t.Q6J("ngClass",t.VKq(29,B,e.DayOfWeekend)),t.xp6(1),t.hij(" ",t.xi3(3,13,e.Day,"EEEE")," "),t.xp6(3),t.Oqu(t.xi3(6,16,e.Day,"dd")),t.xp6(3),t.Oqu(t.lcZ(9,19,e.Count)),t.xp6(3),t.Oqu(t.lcZ(12,21,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(15,23,e.Gross)),t.xp6(3),t.Oqu(t.lcZ(18,25,e.SalesNet)),t.xp6(2),t.Q6J("ngIf",o.data.ShowTax),t.xp6(1),t.Q6J("ngIf",o.data.ShowTax),t.xp6(1),t.Q6J("ngIf",o.pageData.Role.HasCostRole),t.xp6(1),t.Q6J("ngIf",o.pageData.Role.IgnoreTax&&o.pageData.Role.HasProfitRole&&o.pageData.Role.HasCostRole),t.xp6(1),t.Q6J("ngIf",!o.pageData.Role.IgnoreTax&&o.pageData.Role.HasProfitRole&&o.pageData.Role.HasCostRole)}}function si(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Tax")),"")}}function pi(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"SalesNetWithTax")),"")}}function ci(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Cost")),"")}}function _i(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Profit")),"")}}function ui(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"ProfitWithTax")),"")}}function gi(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",29),t.TgZ(1,"table",30),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",31),t.TgZ(3,"tr"),t.TgZ(4,"th",32),t._uU(5,"Day"),t.qZA(),t.TgZ(6,"th",33),t._uU(7,"Dt."),t.qZA(),t.TgZ(8,"th",34),t._uU(9,"Trans"),t.qZA(),t.TgZ(10,"th",35),t._uU(11,"Quantity"),t.qZA(),t.TgZ(12,"th",36),t._uU(13,"Gross"),t.qZA(),t.TgZ(14,"th",37),t._uU(15,"Net Sales"),t.qZA(),t.YNc(16,Kr,2,0,"th",38),t.YNc(17,Xr,2,0,"th",39),t.YNc(18,zr,2,0,"th",40),t.YNc(19,ti,2,0,"th",41),t.YNc(20,ei,2,0,"th",42),t.qZA(),t.qZA(),t.TgZ(21,"tbody"),t.YNc(22,li,24,31,"tr",43),t.qZA(),t.TgZ(23,"tfoot"),t.TgZ(24,"tr"),t._UZ(25,"td",44),t._UZ(26,"td",44),t.TgZ(27,"td",45),t._uU(28),t.ALo(29,"number"),t.ALo(30,"sum"),t.qZA(),t.TgZ(31,"td",45),t._uU(32),t.ALo(33,"number"),t.ALo(34,"sum"),t.qZA(),t.TgZ(35,"td",45),t._uU(36),t.ALo(37,"number"),t.ALo(38,"sum"),t.qZA(),t.TgZ(39,"td",45),t._uU(40),t.ALo(41,"number"),t.ALo(42,"sum"),t.qZA(),t.YNc(43,si,4,6,"td",46),t.YNc(44,pi,4,6,"td",46),t.YNc(45,ci,4,6,"td",47),t.YNc(46,_i,4,6,"td",47),t.YNc(47,ui,4,6,"td",46),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(16),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.pageData.Role.HasCostRole),t.xp6(1),t.Q6J("ngIf",e.pageData.Role.IgnoreTax&&e.pageData.Role.HasProfitRole&&e.pageData.Role.HasCostRole),t.xp6(1),t.Q6J("ngIf",!e.pageData.Role.IgnoreTax&&e.pageData.Role.HasProfitRole&&e.pageData.Role.HasCostRole),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(6),t.Oqu(t.lcZ(29,15,t.xi3(30,17,e.data.Data,"Count"))),t.xp6(4),t.Oqu(t.lcZ(33,20,t.xi3(34,22,e.data.Data,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(37,25,t.xi3(38,27,e.data.Data,"Gross"))),t.xp6(4),t.Oqu(t.lcZ(41,30,t.xi3(42,32,e.data.Data,"SalesNet"))),t.xp6(3),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.pageData.Role.HasCostRole),t.xp6(1),t.Q6J("ngIf",e.pageData.Role.IgnoreTax&&e.pageData.Role.HasProfitRole&&e.pageData.Role.HasCostRole),t.xp6(1),t.Q6J("ngIf",!e.pageData.Role.IgnoreTax&&e.pageData.Role.HasProfitRole&&e.pageData.Role.HasCostRole)}}const di=function(){return["/menu/Reports/Sales_Report/Standard/Daily"]},mi=function(n,i){return{Month:n,Year:i}},Zi=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Yearly"]};let hi=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/DailySalesList","ReportLoader/DailyReportSales",null,a),this.httpService=e,this.csvConverter=o,this.activatedRoute=a,this.Months=x.gT.Months,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.hideMore=!0}postInit(){this.menuData.H=this.data.PageTitle}sortData(e){const o=this.pageData.Data.slice();this.pageData.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Day":case"Date":return this.compare(a.Day,r.Day,l);case"Count":return this.compare(a.Count,r.Count,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Gross":return this.compare(a.Gross,r.Gross,l);case"SalesNet":return this.compare(a.SalesNet,r.SalesNet,l);case"Tax":return this.compare(a.Tax,r.Tax,l);case"SalesNetWithTax":return this.compare(a.SalesNetWithTax,r.SalesNetWithTax,l);case"Cost":return this.compare(a.Cost,r.Cost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);case"ProfitWithTax":return this.compare(a.ProfitWithTax,r.ProfitWithTax,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-daily"]],features:[t.qOj],decls:21,vars:14,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],["title","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink","queryParams"],[1,"fas","fa-chart-bar"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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 Sales",3,"ngModel","items","ngModelChange"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange"],[3,"title"],["id","more-filter","container","",1,"ml-6"],["placeholder","Year",3,"ngModel","items","ngModelChange"],["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-right",2,"width","42px"],["mat-sort-header","Count",1,"align-right",2,"width","70px"],["mat-sort-header","Quantity",1,"align-right",2,"width","100px"],["mat-sort-header","Gross",1,"align-right",2,"width","120px"],["mat-sort-header","SalesNet",1,"align-right",2,"width","120px"],["style","width: 120px","class"," align-right","mat-sort-header","Tax",4,"ngIf"],["style","width: 120px","class"," align-right","mat-sort-header","SalesNetWithTax",4,"ngIf"],["style","width: 120px","class"," align-right","mat-sort-header","Cost",4,"ngIf"],["style","width: 120px","class"," align-right","mat-sort-header","Profit",4,"ngIf"],["style","width: 160px","class"," align-right","mat-sort-header","ProfitWithTax",4,"ngIf"],[3,"ngClass",4,"ngFor","ngForOf"],[1,"empty-column"],[1,"text-right"],["class","text-right",4,"ngIf"],["class","text-right text-danger",4,"ngIf"],["mat-sort-header","Tax",1,"align-right",2,"width","120px"],["mat-sort-header","SalesNetWithTax",1,"align-right",2,"width","120px"],["mat-sort-header","Cost",1,"align-right",2,"width","120px"],["mat-sort-header","Profit",1,"align-right",2,"width","120px"],["mat-sort-header","ProfitWithTax",1,"align-right",2,"width","160px"],[3,"ngClass"],[1,"text-right","text-danger"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Gr,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._UZ(5,"i",4),t._uU(6," Chart View"),t.qZA(),t._UZ(7,"button",5),t.TgZ(8,"ul",6),t.TgZ(9,"li",7),t.TgZ(10,"a",8),t._uU(11,"Comparable PerYear"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(12,"filters"),t.TgZ(13,"div",9),t.YNc(14,Wr,18,8,"div",10),t.YNc(15,$r,17,8,"div",11),t.qZA(),t.TgZ(16,"a",12),t.NdJ("click",function(){return o.hideMore=!o.hideMore}),t._uU(17,"More "),t._UZ(18,"i",13),t.qZA(),t.qZA(),t.TgZ(19,"content"),t.YNc(20,gi,48,35,"div",14),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",null==o.pageData.Role?null:o.pageData.Role.HasExportRole),t.xp6(2),t.Q6J("routerLink",t.DdM(9,di))("queryParams",t.WLB(10,mi,null==o.pageData.Filter?null:o.pageData.Filter.Month,null==o.pageData.Filter?null:o.pageData.Filter.Year)),t.xp6(6),t.Q6J("routerLink",t.DdM(13,Zi)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!o.hideMore),t.xp6(5),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,Z.YE,Z.nU,s.sg,s.mk],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function xi(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",12),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/MonthlySalesList",a.data.PageTitle+".csv")}),t._UZ(1,"i",13),t._uU(2,"Export"),t.qZA()}}function Ti(n,i){if(1&n&&(t.TgZ(0,"span",23),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Ci(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",14),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",16),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Ti,2,2,"ng-template",17),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Sales Name"),t.qZA(),t.TgZ(13,"ng-select",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Year"),t.qZA(),t.TgZ(17,"ng-select",19),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Currency"),t.qZA(),t.TgZ(21,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(22,"div"),t.TgZ(23,"h6"),t._uU(24,"Type"),t.qZA(),t.TgZ(25,"ng-select",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(26,"div"),t.TgZ(27,"h6"),t._uU(28,"Multiply Unit Qty"),t.qZA(),t.TgZ(29,"radio-options",22),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.MultiplyUnitQuantity=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(4),t.Q6J("model",e.pageData.Filter.MultiplyUnitQuantity)}}function fi(n,i){1&n&&(t.TgZ(0,"th",29),t._uU(1,"Tax"),t.qZA())}function Ai(n,i){1&n&&(t.TgZ(0,"th",29),t._uU(1,"Sales + Tax"),t.qZA())}function qi(n,i){1&n&&(t.TgZ(0,"th",29),t._uU(1,"Cost"),t.qZA())}function Di(n,i){1&n&&(t.TgZ(0,"th",29),t._uU(1,"Profit"),t.qZA())}function yi(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.ALo(3,"RoundUp"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,t.lcZ(3,4,e.Tax),".0-0"))}}function vi(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.ALo(3,"RoundUp"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,t.lcZ(3,4,e.SalesNetWithTax),".0-0"))}}function Si(n,i){if(1&n&&(t.TgZ(0,"td",39),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",t.xi3(2,1,e.Cost,".0-0")," ")}}function Mi(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",t.xi3(2,1,e.Profit,".0-0")," ")}}function bi(n,i){if(1&n&&(t.TgZ(0,"tr",37),t.TgZ(1,"td"),t._uU(2),t.ALo(3,"Month"),t.qZA(),t.TgZ(4,"td",33),t._uU(5),t.ALo(6,"number"),t.qZA(),t.TgZ(7,"td",33),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"td",33),t._uU(11),t.ALo(12,"number"),t.qZA(),t.TgZ(13,"td",33),t._uU(14),t.ALo(15,"number"),t.qZA(),t.YNc(16,yi,4,6,"td",34),t.YNc(17,vi,4,6,"td",34),t.YNc(18,Si,3,4,"td",35),t.YNc(19,Mi,3,4,"td",36),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(t.lcZ(3,9,e.Month)),t.xp6(3),t.Oqu(t.xi3(6,11,e.Count,".0-0")),t.xp6(3),t.Oqu(t.xi3(9,14,e.Quantity,".0-0")),t.xp6(3),t.Oqu(t.xi3(12,17,e.Gross,".0-0")),t.xp6(3),t.Oqu(t.xi3(15,20,e.SalesNet,".0-0")),t.xp6(2),t.Q6J("ngIf",o.data.ShowTax),t.xp6(1),t.Q6J("ngIf",o.data.ShowTax),t.xp6(1),t.Q6J("ngIf",o.pageData.HasCostAndProfitRole),t.xp6(1),t.Q6J("ngIf",o.pageData.HasCostAndProfitRole)}}function Ji(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.ALo(3,"RoundUp"),t.ALo(4,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.lcZ(3,4,t.xi3(4,6,e.data.Data,"Tax")),".0-0"),"")}}function Oi(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.ALo(3,"RoundUp"),t.ALo(4,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.lcZ(3,4,t.xi3(4,6,e.data.Data,"SalesNetWithTax")),".0-0"),"")}}function Ii(n,i){if(1&n&&(t.TgZ(0,"td",39),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Cost"),".0-0"),"")}}function Ui(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Profit"),".0-0"),"")}}function Fi(n,i){if(1&n&&(t.TgZ(0,"div",24),t.TgZ(1,"table",25),t.TgZ(2,"thead",26),t.TgZ(3,"tr"),t.TgZ(4,"th",27),t._uU(5,"Month"),t.qZA(),t.TgZ(6,"th",28),t._uU(7,"Trans"),t.qZA(),t.TgZ(8,"th",29),t._uU(9,"Quantity"),t.qZA(),t.TgZ(10,"th",29),t._uU(11,"Gross"),t.qZA(),t.TgZ(12,"th",29),t._uU(13,"Net Sales"),t.qZA(),t.YNc(14,fi,2,0,"th",30),t.YNc(15,Ai,2,0,"th",30),t.YNc(16,qi,2,0,"th",30),t.YNc(17,Di,2,0,"th",30),t.qZA(),t.qZA(),t.TgZ(18,"tbody"),t.YNc(19,bi,20,23,"tr",31),t.qZA(),t.TgZ(20,"tfoot"),t.TgZ(21,"tr",32),t._UZ(22,"td"),t.TgZ(23,"td",33),t._uU(24),t.ALo(25,"number"),t.ALo(26,"sum"),t.qZA(),t.TgZ(27,"td",33),t._uU(28),t.ALo(29,"number"),t.ALo(30,"sum"),t.qZA(),t.TgZ(31,"td",33),t._uU(32),t.ALo(33,"number"),t.ALo(34,"sum"),t.qZA(),t.TgZ(35,"td",33),t._uU(36),t.ALo(37,"number"),t.ALo(38,"sum"),t.qZA(),t.YNc(39,Ji,5,9,"td",34),t.YNc(40,Oi,5,9,"td",34),t.YNc(41,Ii,4,7,"td",35),t.YNc(42,Ui,4,7,"td",36),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(14),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.pageData.HasCostAndProfitRole),t.xp6(1),t.Q6J("ngIf",e.pageData.HasCostAndProfitRole),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Oqu(t.xi3(25,13,t.xi3(26,16,e.data.Data,"Count"),".0-0")),t.xp6(4),t.Oqu(t.xi3(29,19,t.xi3(30,22,e.data.Data,"Quantity"),".0-0")),t.xp6(4),t.Oqu(t.xi3(33,25,t.xi3(34,28,e.data.Data,"Gross"),".0-0")),t.xp6(4),t.Oqu(t.xi3(37,31,t.xi3(38,34,e.data.Data,"Sales"),".0-0")),t.xp6(3),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.pageData.HasCostAndProfitRole),t.xp6(1),t.Q6J("ngIf",e.pageData.HasCostAndProfitRole)}}const wi=function(){return["/menu/Reports/Sales_Report/Standard/Monthly"]},Ni=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Yearly"]};let Pi=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/MonthlySalesList","ReportLoader/MonthlyReportSales"),this.httpService=e,this.csvConverter=o,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0)}postInit(){this.menuData.H=this.data.PageTitle}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-monthly"]],features:[t.qOj],decls:17,vars:9,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],["title","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink"],[1,"fas","fa-chart-bar"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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 Sales",3,"ngModel","items","ngModelChange"],["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"],[3,"title"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","90px"],[1,"text-right",2,"width","70px"],[1,"text-right",2,"width","120px"],["style","width: 120px","class"," text-right",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right","text-success"],["class","text-right",4,"ngIf"],["class","text-right text-danger",4,"ngIf"],["class","text-right text-success",4,"ngIf"],[1,"border-bottom"],[1,"text-right"],[1,"text-right","text-danger"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,xi,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._UZ(5,"i",4),t._uU(6," Chart View"),t.qZA(),t._UZ(7,"button",5),t.TgZ(8,"ul",6),t.TgZ(9,"li",7),t.TgZ(10,"a",8),t._uU(11,"View Yearly"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(12,"filters"),t.TgZ(13,"div",9),t.YNc(14,Ci,30,13,"div",10),t.qZA(),t.qZA(),t.TgZ(15,"content"),t.YNc(16,Fi,43,37,"div",11),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(2),t.Q6J("ngIf",o.pageData.HasExportRole),t.xp6(2),t.Q6J("routerLink",t.DdM(7,wi)),t.xp6(6),t.Q6J("routerLink",t.DdM(8,Ni)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,q.P,s.sg],pipes:[s.JJ,T.qU,T.mr,T.Fo],styles:[""]}),n})();function Li(n,i){if(1&n&&(t.TgZ(0,"span",13),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Qi(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Li,2,2,"ng-template",9),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Currency"),t.qZA(),t.TgZ(13,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().currency=a})("change",function(){return t.CHM(e),t.oxw().checkFilterCurrency()}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Month"),t.qZA(),t.TgZ(17,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Month=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Year"),t.qZA(),t.TgZ(21,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.currency)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years)}}function Yi(n,i){if(1&n&&(t.TgZ(0,"div",14),t._UZ(1,"POS-line-chart",15),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("config",e.chartConfig)("data",e.ChartData)}}const Ri=function(){return["/menu/Reports/Sales_Report/Standard/Daily"]},Ei=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"]};let Hi=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/DailySalesVolume","ReportLoader/DailyReportSales"),this.httpService=e,this.csvConverter=o,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.currency=-1,this.Months=x.gT.Months,this.ChartData={}}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(){this.ChartData={series:this.data.Series};const e=new Date(this.data.From),o=e.getMonth(),a=e.getFullYear();let r=Date.UTC(a,o,1);this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},yAxis:{title:""},xAxis:{type:"datetime"},plotOptions:{series:{pointStart:r,pointInterval:864e5}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-sales-volume"]],features:[t.qOj],decls:11,vars:8,consts:[[3,"pageData","hideSearchBox","onSubmit"],[1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],["title","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,"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"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange"],["placeholder","Year",3,"ngModel","items","ngModelChange"],[3,"title"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t._uU(3,"Daily Sales"),t.qZA(),t.TgZ(4,"a",2),t._uU(5,"View Monthly"),t.qZA(),t.qZA(),t.TgZ(6,"filters"),t.TgZ(7,"div",3),t.YNc(8,Qi,22,10,"div",4),t.qZA(),t.qZA(),t.TgZ(9,"content"),t.YNc(10,Yi,2,2,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(6,Ri)),t.xp6(2),t.Q6J("routerLink",t.DdM(7,Ei)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,J.D],styles:[""]}),n})();function Vi(n,i){if(1&n&&(t.TgZ(0,"span",11),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Bi(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",5),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Vi,2,2,"ng-template",8),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Year"),t.qZA(),t.TgZ(13,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Currency"),t.qZA(),t.TgZ(17,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().currency=a})("change",function(){return t.CHM(e),t.oxw().checkFilterCurrency()}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.currency)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies)}}function Gi(n,i){if(1&n&&(t.TgZ(0,"div",12),t._UZ(1,"POS-line-chart",13),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("config",e.chartConfig)("data",e.ChartData)}}const Wi=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"]};let $i=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/MonthtlySalesVolume","ReportLoader/MonthlySalesPerformance"),this.httpService=e,this.csvConverter=o,this.currency=-1,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.ChartData={}}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 e=[];this.data.MonthlySalesRank.forEach(o=>{const a=o.Sales.map(l=>parseInt(l));e.push({name:o.Name,data:a})}),this.ChartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-monthly-volume"]],features:[t.qOj],decls:9,vars:6,consts:[[3,"pageData","hideSearchBox","onSubmit"],["title","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"],[3,"title"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t._uU(3,"View Daily"),t.qZA(),t.qZA(),t.TgZ(4,"filters"),t.TgZ(5,"div",2),t.YNc(6,Bi,18,8,"div",3),t.qZA(),t.qZA(),t.TgZ(7,"content"),t.YNc(8,Gi,2,2,"div",4),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(5,Wi)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,J.D],styles:[""]}),n})();function Ki(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",12),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/OutletPerformance","Sales Transaction ["+a.pageData.Filter.From+" - "+a.pageData.Filter.To+"].csv")}),t._UZ(1,"i",13),t._uU(2,"Export"),t.qZA()}}function Xi(n,i){if(1&n&&(t.TgZ(0,"span",20),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function zi(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",21),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",22),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function tl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",23),t.TgZ(4,"div",24),t.TgZ(5,"ng-select",25),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Year=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA(),t.TgZ(6,"div",26),t.TgZ(7,"ng-select",27),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Month=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("ngModel",e.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.Month)("items",e.Months)}}function el(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",14),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Category"),t.qZA(),t.TgZ(4,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(5,Xi,2,2,"ng-template",16),t.qZA(),t.qZA(),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Type"),t.qZA(),t.TgZ(9,"ng-select",17),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Date Filter Type"),t.qZA(),t.TgZ(13,"radio-options",18),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().DateFilterType=a}),t.qZA(),t.qZA(),t.YNc(14,zi,5,2,"div",19),t.YNc(15,tl,8,4,"div",19),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(4),t.Q6J("model",e.DateFilterType)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.DateFilterType),t.xp6(1),t.Q6J("ngIf",e.DateFilterType)}}function nl(n,i){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Cost"),t.qZA())}function al(n,i){1&n&&(t.TgZ(0,"th",45),t._uU(1,"Profit"),t.qZA())}function ol(n,i){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Cost))}}const G=function(n,i){return{"text-danger":n,"text-success":i}};function rl(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",t.WLB(4,G,e.Profit<0,e.Profit>0)),t.xp6(1),t.Oqu(t.lcZ(2,2,e.Profit))}}const j=function(){return["/menu/Reports/Sales_Report/Standard/Summary"]},W=function(n,i,e){return{EntityID:n,From:i,To:e}};function il(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",41),t._uU(6),t.qZA(),t.TgZ(7,"td",41),t.TgZ(8,"a",46),t.ALo(9,"date"),t.ALo(10,"date"),t.TgZ(11,"b"),t._uU(12),t.ALo(13,"number"),t.qZA(),t.qZA(),t.qZA(),t.YNc(14,ol,3,3,"td",42),t.YNc(15,rl,3,7,"td",43),t.qZA()),2&n){const e=i.$implicit,o=i.index,a=t.oxw(3);t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Oqu(e.Outlet),t.xp6(2),t.Oqu(e.Quantity),t.xp6(2),t.Q6J("routerLink",t.DdM(16,j))("queryParams",t.kEZ(17,W,e.EntityID,t.xi3(9,8,a.pageData.Filter.From,"ddMMyyyy"),t.xi3(10,11,a.pageData.Filter.To,"ddMMyyyy"))),t.xp6(4),t.Oqu(t.lcZ(13,14,e.Sales)),t.xp6(2),t.Q6J("ngIf",a.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",a.pageData.IsProfitVisible)}}function ll(n,i){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(t.xi3(2,1,t.xi3(3,4,e.data.DataWithCategory,"Cost"),".0-0"))}}const K=function(n,i){return{"text-success":n,"text-danger":i}};function sl(n,i){if(1&n&&(t.TgZ(0,"td",47),t.ALo(1,"sum"),t.ALo(2,"sum"),t._uU(3),t.ALo(4,"number"),t.ALo(5,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(14,K,t.xi3(1,2,e.data.DataWithCategory,"Profit")>0,t.xi3(2,5,e.data.DataWithCategory,"Profit")<0)),t.xp6(3),t.Oqu(t.xi3(4,8,t.xi3(5,11,e.data.DataWithCategory,"Profit"),".0-0"))}}function pl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"table",30),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw(2).sortOutletDataWrapper(a)}),t.TgZ(1,"thead",31),t.TgZ(2,"tr",32),t.TgZ(3,"th"),t._uU(4,"No."),t.qZA(),t.TgZ(5,"th",33),t._uU(6,"Outlet"),t.qZA(),t.TgZ(7,"th",34),t._uU(8,"Quantity"),t.qZA(),t.TgZ(9,"th",35),t._uU(10,"Sales"),t.qZA(),t.YNc(11,nl,2,0,"th",36),t.YNc(12,al,2,0,"th",37),t.qZA(),t.qZA(),t.TgZ(13,"tbody"),t.YNc(14,il,16,21,"tr",38),t.qZA(),t.TgZ(15,"tfoot"),t.TgZ(16,"tr",39),t.TgZ(17,"td",40),t._uU(18),t.ALo(19,"number"),t.ALo(20,"sum"),t.qZA(),t.TgZ(21,"td",41),t._uU(22),t.ALo(23,"number"),t.ALo(24,"sum"),t.qZA(),t.YNc(25,ll,4,7,"td",42),t.YNc(26,sl,6,17,"td",43),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(11),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsProfitVisible),t.xp6(2),t.Q6J("ngForOf",e.data.DataWithCategory),t.xp6(4),t.Oqu(t.xi3(19,7,t.xi3(20,10,e.data.DataWithCategory,"Quantity"),".0-0")),t.xp6(4),t.Oqu(t.xi3(23,13,t.xi3(24,16,e.data.DataWithCategory,"Sales"),".0-0")),t.xp6(3),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsProfitVisible)}}function cl(n,i){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Cost"),t.qZA())}function _l(n,i){1&n&&(t.TgZ(0,"th",45),t._uU(1,"Profit"),t.qZA())}function ul(n,i){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Cost))}}function gl(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",t.WLB(4,G,e.Profit<0,e.Profit>0)),t.xp6(1),t.Oqu(t.lcZ(2,2,e.Profit))}}function dl(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",41),t._uU(6),t.qZA(),t.TgZ(7,"td",41),t.TgZ(8,"a",46),t.ALo(9,"date"),t.ALo(10,"date"),t.TgZ(11,"b"),t._uU(12),t.ALo(13,"number"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"td",41),t._uU(15),t.ALo(16,"number"),t.qZA(),t.TgZ(17,"td",41),t._uU(18),t.ALo(19,"number"),t.qZA(),t.YNc(20,ul,3,3,"td",42),t.YNc(21,gl,3,7,"td",43),t.qZA()),2&n){const e=i.$implicit,o=i.index,a=t.oxw(3);t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Oqu(e.Outlet),t.xp6(2),t.Oqu(e.Transaction),t.xp6(2),t.Q6J("routerLink",t.DdM(22,j))("queryParams",t.kEZ(23,W,e.EntityID,t.xi3(9,10,a.pageData.Filter.From,"ddMMyyyy"),t.xi3(10,13,a.pageData.Filter.To,"ddMMyyyy"))),t.xp6(4),t.Oqu(t.lcZ(13,16,e.Sales)),t.xp6(3),t.Oqu(t.lcZ(16,18,e.Tax)),t.xp6(3),t.Oqu(t.lcZ(19,20,e.Sales+e.Tax)),t.xp6(2),t.Q6J("ngIf",a.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",a.pageData.IsProfitVisible)}}function ml(n,i){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(t.xi3(2,1,t.xi3(3,4,e.data.DataWithoutCategory,"Cost"),".0-0"))}}function Zl(n,i){if(1&n&&(t.TgZ(0,"td",47),t.ALo(1,"sum"),t.ALo(2,"sum"),t._uU(3),t.ALo(4,"number"),t.ALo(5,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(14,K,t.xi3(1,2,e.data.DataWithoutCategory,"Profit")>0,t.xi3(2,5,e.data.DataWithoutCategory,"Profit")<0)),t.xp6(3),t.Oqu(t.xi3(4,8,t.xi3(5,11,e.data.DataWithoutCategory,"Profit"),".0-0"))}}function hl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"table",30),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw(2).sortOutletDataWrapper(a)}),t.TgZ(1,"thead",31),t.TgZ(2,"tr",32),t.TgZ(3,"th"),t._uU(4,"No."),t.qZA(),t.TgZ(5,"th",33),t._uU(6,"Outlet"),t.qZA(),t.TgZ(7,"th",48),t._uU(8,"Trans"),t.qZA(),t.TgZ(9,"th",35),t._uU(10,"Sales"),t.qZA(),t.TgZ(11,"th",49),t._uU(12,"Tax"),t.qZA(),t.TgZ(13,"th",50),t._uU(14,"Sales + Tax"),t.qZA(),t.YNc(15,cl,2,0,"th",36),t.YNc(16,_l,2,0,"th",37),t.qZA(),t.qZA(),t.TgZ(17,"tbody"),t.YNc(18,dl,22,27,"tr",38),t.qZA(),t.TgZ(19,"tfoot"),t.TgZ(20,"tr",39),t.TgZ(21,"td",40),t._uU(22),t.ALo(23,"number"),t.ALo(24,"sum"),t.qZA(),t.TgZ(25,"td",41),t._uU(26),t.ALo(27,"number"),t.ALo(28,"sum"),t.qZA(),t.TgZ(29,"td",41),t._uU(30),t.ALo(31,"number"),t.ALo(32,"sum"),t.qZA(),t.TgZ(33,"td",41),t._uU(34),t.ALo(35,"number"),t.ALo(36,"sum"),t.ALo(37,"sum"),t.qZA(),t.YNc(38,ml,4,7,"td",42),t.YNc(39,Zl,6,17,"td",43),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(15),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsProfitVisible),t.xp6(2),t.Q6J("ngForOf",e.data.DataWithoutCategory),t.xp6(4),t.Oqu(t.xi3(23,9,t.xi3(24,12,e.data.DataWithoutCategory,"Transaction"),".0-0")),t.xp6(4),t.Oqu(t.xi3(27,15,t.xi3(28,18,e.data.DataWithoutCategory,"Sales"),".0-0")),t.xp6(4),t.Oqu(t.xi3(31,21,t.xi3(32,24,e.data.DataWithoutCategory,"Tax"),".0-0")),t.xp6(4),t.Oqu(t.xi3(35,27,t.xi3(36,30,e.data.DataWithoutCategory,"Tax")+t.xi3(37,33,e.data.DataWithoutCategory,"Sales"),".0-0")),t.xp6(4),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsProfitVisible)}}function xl(n,i){1&n&&(t.TgZ(0,"p"),t._uU(1,"No Data has been loaded!"),t.qZA())}function Tl(n,i){if(1&n&&(t.TgZ(0,"div",28),t.YNc(1,pl,27,19,"table",29),t.YNc(2,hl,40,36,"table",29),t.YNc(3,xl,2,0,"p",19),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(null==e.data?null:e.data.DataWithCategory.length)>0),t.xp6(1),t.Q6J("ngIf",(null==e.data?null:e.data.DataWithoutCategory.length)>0),t.xp6(1),t.Q6J("ngIf",0==(null==e.data?null:e.data.DataWithCategory.length)&&0==(null==e.data?null:e.data.DataWithoutCategory.length))}}const fl=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Detail"]},ql=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Monthly_Perfomance"]},yl=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"]},Sl=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"]};let Ml=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/OutletPerformance","ReportLoader/OutletPerformance",null,a),this.httpService=e,this.csvConverter=o,this.activatedRoute=a,this.hideMore=!0,this.DateFilterType=!1,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"}],this.Years=[],this.RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}],this.YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];const r=new Date;this.Year=r.getFullYear(),this.Month=r.getMonth(),this.Years=x.gT.GenerateYears(r.getFullYear(),11,!0)}preInitList(){this.pageData.Filter.CategoryID=null}YearMonthToDateRange(){const e=new Date;null==this.Year&&(this.Year=e.getFullYear()),null==this.Month&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}sortOutletDataWrapper(e){let o,a;if(this.data.DataWithCategory.length>0)o=this.data.DataWithCategory,a=!0;else{if(!(this.data.DataWithoutCategory.length>0))return;o=this.data.DataWithoutCategory,a=!1}this.sortOutletData(o,e,a)}sortOutletData(e,o,a){function r(l,_,A){return(l<_?-1:1)*(A?1:-1)}o.active&&""!==o.direction&&null!=e&&(e=e.sort((l,_)=>{const A="asc"===o.direction;switch(o.active){case"Outlet":return r(l.Outlet,_.Outlet,A);case"Transaction":return r(l.Transaction,_.Transaction,A);case"Quantity":return r(l.Quantity,_.Quantity,A);case"Sales":return r(l.SalesNet,_.SalesNet,A);case"SalesTax":return r(l.SalesNet+l.Tax,_.SalesNet+l.Tax,A);case"Tax":return r(l.Tax,_.Tax,A);case"Cost":return r(l.Cost,_.Cost,A);case"Profit":return r(l.Profit,_.Profit,A);default:return 0}}),a?this.data.DataWithCategory=e:a||(this.data.DataWithoutCategory=e))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-outlet-performance"]],features:[t.qOj],decls:22,vars:13,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],["title","Outlet Performance Detail",1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],["title","Chart View",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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"],[3,"title"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","pl-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],[1,"container-fluid","mt-5"],["class","table","id","tableGrid","matSort","",3,"matSortChange",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",1,"align-right"],["mat-sort-header","Sales",1,"align-right"],["class","align-right","mat-sort-header","Cost",4,"ngIf"],["class","align-right","mat-sort-header","Profit",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],["colspan","3",1,"text-right"],[1,"text-right"],["class","text-right",4,"ngIf"],["class","text-right",3,"ngClass",4,"ngIf"],["mat-sort-header","Cost",1,"align-right"],["mat-sort-header","Profit",1,"align-right"],[3,"routerLink","queryParams"],[1,"text-right",3,"ngClass"],["mat-sort-header","Transaction",1,"align-right"],["mat-sort-header","Tax",1,"align-right"],["mat-sort-header","SalesTax",1,"align-right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Ki,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"View Detail"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10," By Month"),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t._uU(13,"By Entity Group"),t.qZA(),t.qZA(),t.TgZ(14,"li",6),t.TgZ(15,"a",8),t._uU(16," Chart View"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(17,"filters"),t.TgZ(18,"div",9),t.YNc(19,el,16,8,"div",10),t.qZA(),t.qZA(),t.TgZ(20,"content"),t.YNc(21,Tl,4,3,"div",11),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(9,fl)),t.xp6(5),t.Q6J("routerLink",t.DdM(10,ql)),t.xp6(3),t.Q6J("routerLink",t.DdM(11,yl)),t.xp6(3),t.Q6J("routerLink",t.DdM(12,Sl)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,q.P,C.QB,Z.YE,Z.nU,s.sg,s.mk],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function bl(n,i){if(1&n&&(t.TgZ(0,"span",11),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Jl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",12),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",13),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Ol(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",14),t.TgZ(4,"div",15),t.TgZ(5,"ng-select",16),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Year=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA(),t.TgZ(6,"div",17),t.TgZ(7,"ng-select",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Month=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("ngModel",e.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.Month)("items",e.Months)}}function Il(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",5),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Category"),t.qZA(),t.TgZ(4,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(5,bl,2,2,"ng-template",7),t.qZA(),t.qZA(),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Type"),t.qZA(),t.TgZ(9,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Date Filter"),t.qZA(),t.TgZ(13,"radio-options",9),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().DateFilterType=a})("modelChange",function(){return t.CHM(e),t.oxw().YearMonthToDateRange()}),t.qZA(),t.qZA(),t.YNc(14,Jl,5,2,"div",10),t.YNc(15,Ol,8,4,"div",10),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(4),t.Q6J("model",e.DateFilterType)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.DateFilterType),t.xp6(1),t.Q6J("ngIf",e.DateFilterType)}}function Ul(n,i){if(1&n&&(t.TgZ(0,"div",19),t._UZ(1,"POS-pie-chart",20),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("config",e.pieConfig)("data",e.PieData)}}const wl=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance"]};let Nl=(()=>{class n extends m.n{constructor(e){super(e,"Report/OutletPerformance","ReportLoader/OutletPerformance"),this.httpService=e,this.DateFilterType=!0,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"}],this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.PieData={},this.RadioDateFilterType=[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}],this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Sales",height:400,legend:{}};const o=new Date;this.Year=o.getFullYear(),this.Month=o.getMonth()}postInit(){this.getPieData()}getPieData(){const e=[],o=[];this.data.DataWithoutCategory.length>0&&this.data.DataWithoutCategory.forEach(a=>{e.push(a.Outlet),o.push({name:a.Outlet,y:a.Sales})}),this.data.DataWithCategory.length>0&&this.data.DataWithCategory.forEach(a=>{e.push(a.Outlet),o.push({name:a.Outlet,y:a.Sales})}),this.PieData=o}YearMonthToDateRange(){if(this.DateFilterType){const e=new Date;null==this.Year&&(this.Year=e.getFullYear()),null==this.Month&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-outlet-graphic"]],features:[t.qOj],decls:9,vars:6,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[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","Date Filter",3,"model","options","modelChange"],[4,"ngIf"],[3,"title"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","pl-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t._uU(3,"Table View"),t.qZA(),t.qZA(),t.TgZ(4,"filters"),t.TgZ(5,"div",2),t.YNc(6,Il,16,8,"div",3),t.qZA(),t.qZA(),t.TgZ(7,"content"),t.YNc(8,Ul,2,2,"div",4),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(5,wl)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,q.P,C.QB,U.J],styles:[""]}),n})();function Pl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",15),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/OutletPerformanceDetail","Sales Transaction ["+a.pageData.Filter.From+" - "+a.pageData.Filter.To+"].csv")}),t._UZ(1,"i",16),t._uU(2,"Export"),t.qZA()}}function Ll(n,i){if(1&n&&(t.TgZ(0,"span",23),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Ql(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",24),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",25),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Yl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Compare with prev Month"),t.qZA(),t.TgZ(3,"radio-options",26),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).isCompareData=a})("modelChange",function(){return t.CHM(e),t.oxw(2).OnCompare("Data")}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("model",e.isCompareData)}}function Rl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",27),t.TgZ(4,"div",28),t.TgZ(5,"ng-select",29),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Year=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA(),t.TgZ(6,"div",30),t.TgZ(7,"ng-select",31),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Month=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("ngModel",e.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.Month)("items",e.Months)}}function kl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",17),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Category"),t.qZA(),t.TgZ(4,"ng-select",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(5,Ll,2,2,"ng-template",19),t.qZA(),t.qZA(),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Type"),t.qZA(),t.TgZ(9,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Date Filter Type"),t.qZA(),t.TgZ(13,"radio-options",21),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().DateFilterType=a}),t.qZA(),t.qZA(),t.YNc(14,Ql,5,2,"div",22),t.YNc(15,Yl,4,1,"div",22),t.YNc(16,Rl,8,4,"div",22),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(4),t.Q6J("model",e.DateFilterType)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.DateFilterType),t.xp6(1),t.Q6J("ngIf",e.DateFilterType),t.xp6(1),t.Q6J("ngIf",e.DateFilterType)}}function El(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",32),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Exclude complementary"),t.qZA(),t.TgZ(4,"radio-options",26),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ExcludeComplementary=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Exclude Non Inventory"),t.qZA(),t.TgZ(8,"radio-options",26),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ExcludeInventory=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("model",e.pageData.Filter.ExcludeComplementary),t.xp6(4),t.Q6J("model",e.pageData.Filter.ExcludeInventory)}}function Hl(n,i){1&n&&(t.TgZ(0,"th",58),t._uU(1,"Prev"),t.qZA())}function Vl(n,i){1&n&&(t.TgZ(0,"th",58),t._uU(1,"Now"),t.qZA())}function Bl(n,i){1&n&&(t.TgZ(0,"th",59),t._uU(1,"Trans "),t.qZA())}function Gl(n,i){if(1&n&&(t.TgZ(0,"th",60),t._uU(1,"Tax"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet")}}function jl(n,i){if(1&n&&(t.TgZ(0,"th",60),t._uU(1," Sales + Tax"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Wl(n,i){1&n&&(t.TgZ(0,"th",53),t._uU(1,"\xb1 (%)"),t.qZA())}function $l(n,i){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Cost"),t.qZA())}function Kl(n,i){if(1&n&&(t.TgZ(0,"th",60),t._uU(1," Profit"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function Xl(n,i){1&n&&(t.TgZ(0,"th",62),t._uU(1,"Expense"),t.qZA())}function zl(n,i){1&n&&(t.TgZ(0,"th",63),t._uU(1,"Net Profit"),t.qZA())}function ts(n,i){1&n&&(t.TgZ(0,"th",64),t._uU(1," Target"),t.qZA())}function es(n,i){1&n&&(t.TgZ(0,"th",65),t._uU(1," Ach(%)"),t.qZA())}function ns(n,i){if(1&n&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.PrevIndex)}}const as=function(n,i){return{rankDown:n,rankUp:i,"number key":!0}};function os(n,i){if(1&n&&(t.TgZ(0,"td",69),t._uU(1),t.qZA()),2&n){const e=t.oxw(),o=e.$implicit,a=e.index;t.Q6J("ngClass",t.WLB(2,as,o.PrevIndex<a+1,o.PrevIndex>a+1)),t.xp6(1),t.hij(" ",o.CurrentIndex," ")}}function rs(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,e.Count,"1.0-0"))}}function is(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,e.Tax,"1.0-0"))}}const ls=function(){return["/menu/Reports/Sales_Report/Standard/Summary"]},ss=function(n,i,e){return{EntityID:n,From:i,To:e}};function ps(n,i){if(1&n&&(t.TgZ(0,"td",53),t.TgZ(1,"a",70),t.ALo(2,"date"),t.ALo(3,"date"),t.TgZ(4,"b"),t._uU(5),t.ALo(6,"number"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("routerLink",t.DdM(12,ls))("queryParams",t.kEZ(13,ss,e.EntityID,t.xi3(2,3,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(3,6,o.pageData.Filter.To,"ddMMyyyy"))),t.xp6(4),t.Oqu(t.xi3(6,9,e.SalesWithTax,"1.0-0"))}}function cs(n,i){if(1&n&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.BQk()),2&n){const e=t.oxw(2).$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.Increase,"1.0-0")," ")}}function _s(n,i){if(1&n&&t._uU(0),2&n){const e=t.oxw(2).$implicit;t.hij(" ",e.Increase," ")}}const X=function(n,i){return{"text-warning":n,"text-success":i,"text-right":!0}};function us(n,i){if(1&n&&(t.TgZ(0,"td",71),t.YNc(1,cs,3,4,"ng-container",72),t.YNc(2,_s,1,1,"ng-template",null,73,t.W1O),t.qZA()),2&n){const e=t.MAs(3),o=t.oxw().$implicit;t.Q6J("ngClass",t.WLB(3,X,o.IsNegative,o.IsPositive)),t.xp6(1),t.Q6J("ngIf","-"!==o.Increase)("ngIfElse",e)}}function gs(n,i){if(1&n&&(t.TgZ(0,"td",74),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",t.xi3(2,1,e.Cost,"1.0-0")," ")}}const O=function(n,i){return{"text-danger":n,"text-success":i}};function ds(n,i){if(1&n&&(t.TgZ(0,"span",71),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.Q6J("ngClass",t.WLB(5,O,e.Profit<0,e.Profit>0)),t.xp6(1),t.Oqu(t.xi3(2,2,e.Profit,"1.0-0"))}}function ms(n,i){if(1&n&&(t.TgZ(0,"span",71),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.Q6J("ngClass",t.WLB(5,O,e.ProfitWithTax<0,e.ProfitWithTax>0)),t.xp6(1),t.Oqu(t.xi3(2,2,e.ProfitWithTax,"1.0-0"))}}function Zs(n,i){if(1&n&&(t.TgZ(0,"td",53),t.YNc(1,ds,3,8,"span",55),t.YNc(2,ms,3,8,"span",55),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Q6J("ngIf",e.pageData.IgnoreTax),t.xp6(1),t.Q6J("ngIf",!e.pageData.IgnoreTax)}}function hs(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.Expense,"1.0-0"),"")}}function xs(n,i){if(1&n&&(t.TgZ(0,"td",75),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.NetProfit,"1.0-0"),"")}}function Ts(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.SalesTarget,"1.0-0"),"")}}function Cs(n,i){if(1&n&&(t.TgZ(0,"span",71),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.Q6J("ngClass",t.WLB(5,O,e.Achievement<0,e.Achievement>0)),t.xp6(1),t.Oqu(t.xi3(2,2,e.Achievement,"1.0-0"))}}function fs(n,i){if(1&n&&(t.TgZ(0,"span",71),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.Q6J("ngClass",t.WLB(5,O,e.AchievementWithTax<0,e.AchievementWithTax>0)),t.xp6(1),t.hij("",t.xi3(2,2,e.AchievementWithTax,"1.0-0")," ")}}function As(n,i){if(1&n&&(t.TgZ(0,"td",53),t.YNc(1,Cs,3,8,"span",55),t.YNc(2,fs,3,8,"span",55),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Q6J("ngIf",!e.pageData.IgnoreTax),t.xp6(1),t.Q6J("ngIf",e.pageData.IgnoreTax)}}function qs(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",51),t._uU(4),t.qZA(),t.YNc(5,ns,2,1,"td",66),t.YNc(6,os,2,5,"td",67),t.YNc(7,rs,3,4,"td",43),t.TgZ(8,"td",53),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",53),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td",53),t._uU(15),t.ALo(16,"number"),t.qZA(),t.YNc(17,is,3,4,"td",43),t.ALo(18,"HideSumZero"),t.YNc(19,ps,7,17,"td",43),t.YNc(20,us,4,6,"td",55),t.YNc(21,gs,3,4,"td",56),t.YNc(22,Zs,3,2,"td",43),t.YNc(23,hs,3,4,"td",43),t.ALo(24,"HideSumZero"),t.YNc(25,xs,3,4,"td",57),t.YNc(26,Ts,3,4,"td",43),t.ALo(27,"HideSumZero"),t.YNc(28,As,3,2,"td",43),t.ALo(29,"HideSumZero"),t.ALo(30,"HideSumZero"),t.qZA()),2&n){const e=i.$implicit,o=i.index,a=t.oxw(2);t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Oqu(e.Name),t.xp6(1),t.Q6J("ngIf",a.isCompareData),t.xp6(1),t.Q6J("ngIf",a.isCompareData),t.xp6(1),t.Q6J("ngIf",!e.WithCategory),t.xp6(2),t.Oqu(t.xi3(10,17,e.Quantity,"1.0-0")),t.xp6(3),t.Oqu(t.xi3(13,20,e.Gross,"1.0-0")),t.xp6(3),t.Oqu(t.xi3(16,23,e.SalesNet,"1.0-0")),t.xp6(2),t.Q6J("ngIf",!a.data.WithCategory&&t.xi3(18,26,a.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!a.data.WithCategory),t.xp6(1),t.Q6J("ngIf",a.isCompareData),t.xp6(1),t.Q6J("ngIf",a.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",a.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",a.pageData.IsExpense&&t.xi3(24,29,a.data.Data,"Expense")),t.xp6(2),t.Q6J("ngIf",a.pageData.IsExpense),t.xp6(1),t.Q6J("ngIf",t.xi3(27,32,a.data.Data,"SalesTarget")),t.xp6(2),t.Q6J("ngIf",t.xi3(29,35,a.data.Data,"AchievementWithTax")||t.xi3(30,38,a.data.Data,"Achievement"))}}function Ds(n,i){1&n&&t._UZ(0,"td",76)}function ys(n,i){1&n&&t._UZ(0,"td",76)}function vs(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Count"),"1.0-0"),"")}}function Ss(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Tax"),"1.0-0")," ")}}function Ms(n,i){if(1&n&&(t.TgZ(0,"td",77),t.TgZ(1,"a",78),t._uU(2),t.ALo(3,"number"),t.ALo(4,"sum"),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(2),t.Oqu(t.xi3(3,1,t.xi3(4,4,e.data.Data,"SalesWithTax"),"1.0-0"))}}function bs(n,i){if(1&n&&(t.TgZ(0,"td",71),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.WLB(5,X,e.comparation<0,e.comparation>0)),t.xp6(1),t.hij(" ",t.xi3(2,2,e.comparation,"1.0-0")," ")}}function Js(n,i){if(1&n&&(t.TgZ(0,"td",74),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Cost"),"1.0-0")," ")}}const z=function(n,i){return{"text-success":n,"text-danger":i}};function Os(n,i){if(1&n&&(t.TgZ(0,"span",71),t.ALo(1,"sum"),t.ALo(2,"sum"),t._uU(3),t.ALo(4,"number"),t.ALo(5,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(14,z,t.xi3(1,2,e.data.Data,"Profit")>0,t.xi3(2,5,e.data.Data,"Profit")<0)),t.xp6(3),t.Oqu(t.xi3(4,8,t.xi3(5,11,e.data.Data,"Profit"),"1.0-0"))}}function Is(n,i){if(1&n&&(t.TgZ(0,"span",71),t.ALo(1,"sum"),t.ALo(2,"sum"),t._uU(3),t.ALo(4,"number"),t.ALo(5,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(14,z,t.xi3(1,2,e.data.Data,"ProfitWithTax")>0,t.xi3(2,5,e.data.Data,"ProfitWithTax")<0)),t.xp6(3),t.hij("",t.xi3(4,8,t.xi3(5,11,e.data.Data,"ProfitWithTax"),"1.0-0")," ")}}function Us(n,i){if(1&n&&(t.TgZ(0,"td",53),t.YNc(1,Os,6,17,"span",55),t.YNc(2,Is,6,17,"span",55),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.pageData.IgnoreTax),t.xp6(1),t.Q6J("ngIf",!e.pageData.IgnoreTax)}}function Fs(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Expense"),"1.0-0"),"")}}function ws(n,i){if(1&n&&(t.TgZ(0,"td",75),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"NetProfit"),"1.0-0"),"")}}function Ns(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"SalesTarget"),"1.0-0"),"")}}function Ps(n,i){if(1&n&&(t.TgZ(0,"span",71),t.ALo(1,"sum"),t.ALo(2,"sum"),t.ALo(3,"sum"),t.ALo(4,"sum"),t._uU(5),t.ALo(6,"number"),t.ALo(7,"sum"),t.ALo(8,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(23,O,t.xi3(1,2,e.data.Data,"Sales")/t.xi3(2,5,e.data.Data,"SalesTarget")<0,t.xi3(3,8,e.data.Data,"Sales")/t.xi3(4,11,e.data.Data,"SalesTarget")>0)),t.xp6(5),t.Oqu(t.xi3(6,14,t.xi3(7,17,e.data.Data,"Sales")/t.xi3(8,20,e.data.Data,"SalesTarget"),"1.0-0"))}}function Ls(n,i){if(1&n&&(t.TgZ(0,"span",71),t.ALo(1,"sum"),t.ALo(2,"sum"),t.ALo(3,"sum"),t.ALo(4,"sum"),t._uU(5),t.ALo(6,"number"),t.ALo(7,"sum"),t.ALo(8,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(23,O,t.xi3(1,2,e.data.Data,"SalesWithTax")/t.xi3(2,5,e.data.Data,"SalesTarget")<0,t.xi3(3,8,e.data.Data,"SalesWithTax")/t.xi3(4,11,e.data.Data,"SalesTarget")>0)),t.xp6(5),t.hij("",t.xi3(6,14,t.xi3(7,17,e.data.Data,"SalesWithTax")/t.xi3(8,20,e.data.Data,"SalesTarget"),"1.0-0")," ")}}function Qs(n,i){if(1&n&&(t.TgZ(0,"td",53),t.YNc(1,Ps,9,26,"span",55),t.YNc(2,Ls,9,26,"span",55),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",!e.pageData.IgnoreTax),t.xp6(1),t.Q6J("ngIf",e.pageData.IgnoreTax)}}function Ys(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",33),t.TgZ(1,"table",34),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",35),t.TgZ(3,"tr"),t.TgZ(4,"th"),t._uU(5,"No."),t.qZA(),t.TgZ(6,"th",36),t._uU(7,"Outlet"),t.qZA(),t.YNc(8,Hl,2,0,"th",37),t.YNc(9,Vl,2,0,"th",37),t.YNc(10,Bl,2,0,"th",38),t.TgZ(11,"th",39),t._uU(12,"Qty"),t.qZA(),t.TgZ(13,"th",40),t._uU(14,"Gross"),t.qZA(),t.TgZ(15,"th",41),t._uU(16,"Sales"),t.qZA(),t.YNc(17,Gl,2,1,"th",42),t.ALo(18,"HideSumZero"),t.YNc(19,jl,2,1,"th",42),t.YNc(20,Wl,2,0,"th",43),t.YNc(21,$l,2,0,"th",44),t.YNc(22,Kl,2,1,"th",42),t.YNc(23,Xl,2,0,"th",45),t.ALo(24,"HideSumZero"),t.YNc(25,zl,2,0,"th",46),t.YNc(26,ts,2,0,"th",47),t.ALo(27,"HideSumZero"),t.YNc(28,es,2,0,"th",48),t.ALo(29,"HideSumZero"),t.ALo(30,"HideSumZero"),t.qZA(),t.qZA(),t.TgZ(31,"tbody"),t.YNc(32,qs,31,41,"tr",49),t.qZA(),t.TgZ(33,"tfoot"),t.TgZ(34,"tr",50),t._UZ(35,"td"),t._UZ(36,"td",51),t.YNc(37,Ds,1,0,"td",52),t.YNc(38,ys,1,0,"td",52),t.YNc(39,vs,4,7,"td",43),t.TgZ(40,"td",53),t._uU(41),t.ALo(42,"number"),t.ALo(43,"sum"),t.qZA(),t.TgZ(44,"td",53),t._uU(45),t.ALo(46,"number"),t.ALo(47,"sum"),t.qZA(),t.TgZ(48,"td",53),t._uU(49),t.ALo(50,"number"),t.ALo(51,"sum"),t.qZA(),t.YNc(52,Ss,4,7,"td",43),t.ALo(53,"HideSumZero"),t.YNc(54,Ms,5,7,"td",54),t.YNc(55,bs,3,8,"td",55),t.YNc(56,Js,4,7,"td",56),t.YNc(57,Us,3,2,"td",43),t.YNc(58,Fs,4,7,"td",43),t.ALo(59,"HideSumZero"),t.YNc(60,ws,4,7,"td",57),t.YNc(61,Ns,4,7,"td",43),t.ALo(62,"HideSumZero"),t.YNc(63,Qs,3,2,"td",43),t.ALo(64,"HideSumZero"),t.ALo(65,"HideSumZero"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(8),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(7),t.Q6J("ngIf",!e.data.WithCategory&&t.xi3(18,28,e.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsExpense&&t.xi3(24,31,e.data.Data,"Expense")),t.xp6(2),t.Q6J("ngIf",e.pageData.IsExpense),t.xp6(1),t.Q6J("ngIf",t.xi3(27,34,e.data.Data,"SalesTarget")),t.xp6(2),t.Q6J("ngIf",t.xi3(29,37,e.data.Data,"AchievementWithTax")||t.xi3(30,40,e.data.Data,"Achievement")),t.xp6(4),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(2),t.Oqu(t.xi3(42,43,t.xi3(43,46,e.data.Data,"Quantity"),"1.0-0")),t.xp6(4),t.Oqu(t.xi3(46,49,t.xi3(47,52,e.data.Data,"Gross"),"1.0-0")),t.xp6(4),t.hij(" ",t.xi3(50,55,t.xi3(51,58,e.data.Data,"SalesNet"),"1.0-0")," "),t.xp6(3),t.Q6J("ngIf",!e.data.WithCategory&&t.xi3(53,61,e.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsExpense&&t.xi3(59,64,e.data.Data,"Expense")),t.xp6(2),t.Q6J("ngIf",e.pageData.IsExpense),t.xp6(1),t.Q6J("ngIf",t.xi3(62,67,e.data.Data,"SalesTarget")),t.xp6(2),t.Q6J("ngIf",t.xi3(64,70,e.data.Data,"AchievementWithTax")||t.xi3(65,73,e.data.Data,"Achievement"))}}const ks=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance"]},Hs=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"]},Bs=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Monthly_Perfomance"]},js=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"]};let Ws=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/OutletPerformanceDetail","ReportLoader/OutletPerformance"),this.httpService=e,this.csvConverter=o,this.isCompareData=!1,this.hideMore=!0,this.DateFilterType=!1,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"}],this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];const a=new Date;this.Year=a.getFullYear(),this.Month=a.getMonth()}YearMonthToDateRange(){const e=new Date;null==this.Year&&(this.Year=e.getFullYear()),null==this.Month&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1).toDateString(),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0).toDateString()}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Name":return this.compare(a.Name,r.Name,l);case"Count":return this.compare(a.Count,r.Count,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Gross":return this.compare(a.Gross,r.Gross,l);case"SalesNet":case"SalesTaxNet":return this.compare(a.SalesNet,r.SalesNet,l);case"Tax":return this.compare(a.Tax,r.Tax,l);case"SalesWithTax":return this.compare(a.SalesWithTax,r.SalesWithTax,l);case"Cost":return this.compare(a.Cost,r.Cost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);case"ProfitWithTax":return this.compare(a.ProfitWithTax,r.ProfitWithTax,l);case"Expense":return this.compare(a.Expense,r.Expense,l);case"NetProfit":return this.compare(a.NetProfit,r.NetProfit,l);case"Target":case"SalesTarget":return this.compare(a.SalesTarget,r.SalesTarget,l);case"Achievement":return this.compare(a.Achievement,r.Achievement,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-detail-outlet-performance"]],features:[t.qOj],decls:26,vars:14,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],["title","Chart View",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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"],[3,"title"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["name","Compare",3,"model","modelChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","pl-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],["id","more-filter","container","",1,"ml-6"],[1,"container-fluid","mt-5"],["id","tableGrid","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","class","align-right",4,"ngIf"],["mat-sort-header","Quantity",1,"align-right"],["mat-sort-header","Gross",1,"align-right"],["mat-sort-header","SalesNet",1,"align-right"],["class","align-right",3,"mat-sort-header",4,"ngIf"],["class","text-right",4,"ngIf"],["mat-sort-header","Cost","class","align-right",4,"ngIf"],["mat-sort-header","Expense","class","align-right",4,"ngIf"],["mat-sort-header","NetProfit","class","align-right",4,"ngIf"],["mat-sort-header","Target","class","align-right",4,"ngIf"],["mat-sort-header","Achievement","class","align-right","title","Achievement",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"text-right"],["class","text-right text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-right text-danger",4,"ngIf"],["class","text-right text-success",4,"ngIf"],[2,"width","35px"],["mat-sort-header","Count",1,"align-right"],[1,"align-right",3,"mat-sort-header"],["mat-sort-header","Cost",1,"align-right"],["mat-sort-header","Expense",1,"align-right"],["mat-sort-header","NetProfit",1,"align-right"],["mat-sort-header","Target",1,"align-right"],["mat-sort-header","Achievement","title","Achievement",1,"align-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-right","text-danger"],[1,"text-right","text-success"],[1,"empty-column"],[1,"text-right","text-primary"],[1,"font-weight-bold"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Pl,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"View Summary"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10,"By Entity Group"),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t._uU(13," By Month"),t.qZA(),t.qZA(),t.TgZ(14,"li",6),t.TgZ(15,"a",8),t._uU(16," Chart View"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(17,"filters"),t.TgZ(18,"div",9),t.YNc(19,kl,17,9,"div",10),t.YNc(20,El,9,2,"div",11),t.qZA(),t.TgZ(21,"a",12),t.NdJ("click",function(){return o.hideMore=!o.hideMore}),t._uU(22,"More "),t._UZ(23,"i",13),t.qZA(),t.qZA(),t.TgZ(24,"content"),t.YNc(25,Ys,66,76,"div",14),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(10,ks)),t.xp6(5),t.Q6J("routerLink",t.DdM(11,Hs)),t.xp6(3),t.Q6J("routerLink",t.DdM(12,Bs)),t.xp6(3),t.Q6J("routerLink",t.DdM(13,js)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!o.hideMore),t.xp6(5),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,q.P,C.QB,Z.YE,Z.nU,s.sg,s.mk],pipes:[T.aQ,s.JJ,T.qU,s.uU],styles:[""]}),n})();function $s(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/OutletGroupPerformance","Sales Transaction ["+a.pageData.Filter.From+" - "+a.pageData.Filter.To+"].csv")}),t._UZ(1,"i",12),t._uU(2,"Export"),t.qZA()}}function Ks(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",17),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",18),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Xs(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",19),t.TgZ(4,"div",20),t.TgZ(5,"ng-select",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Year=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA(),t.TgZ(6,"div",22),t.TgZ(7,"ng-select",23),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Month=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("ngModel",e.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.Month)("items",e.Months)}}function zs(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Compare with prev Month"),t.qZA(),t.TgZ(3,"radio-options",24),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).isCompareData=a})("modelChange",function(){return t.CHM(e),t.oxw(2).OnCompare()}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("model",e.isCompareData)}}function tp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Date Filter Type"),t.qZA(),t.TgZ(4,"radio-options",14),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().DateFilterType=a}),t.qZA(),t.qZA(),t.YNc(5,Ks,5,2,"div",15),t.YNc(6,Xs,8,4,"div",15),t.TgZ(7,"div"),t.TgZ(8,"h6"),t._uU(9,"Type"),t.qZA(),t.TgZ(10,"ng-select",16),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.YNc(11,zs,4,1,"div",15),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("model",e.DateFilterType)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.DateFilterType),t.xp6(1),t.Q6J("ngIf",e.DateFilterType),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(1),t.Q6J("ngIf",e.DateFilterType)}}function ep(n,i){1&n&&(t.TgZ(0,"th",48),t._uU(1,"Prev"),t.qZA())}function np(n,i){1&n&&(t.TgZ(0,"th",48),t._uU(1,"Now"),t.qZA())}function ap(n,i){1&n&&(t.TgZ(0,"th",49),t._uU(1," \xb1 (%) "),t.qZA())}function op(n,i){1&n&&(t.TgZ(0,"th",50),t._uU(1," Cost "),t.qZA())}function rp(n,i){if(1&n&&(t.TgZ(0,"th",34),t._uU(1,"Profit "),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function ip(n,i){if(1&n&&(t.TgZ(0,"td",48),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",e.PrevIndex," ")}}const lp=function(n,i){return{rankDown:n,rankUp:i,"number key":!0}};function sp(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.qZA()),2&n){const e=t.oxw(),o=e.$implicit,a=e.index;t.Q6J("ngClass",t.WLB(2,lp,o.PrevIndex<a+1,o.PrevIndex>a+1)),t.xp6(1),t.hij(" ",o.CurrentIndex," ")}}const tt=function(n,i){return{"text-danger":n,"text-success":i,"text-right":!0}};function pp(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",t.WLB(5,tt,e.IsNegative,e.IsPositive)),t.xp6(1),t.hij(" ",t.xi3(2,2,e.Increase,".0-0")," ")}}function cp(n,i){if(1&n&&(t.TgZ(0,"td",55),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.Cost,".0-0")," ")}}function _p(n,i){if(1&n&&(t.TgZ(0,"td",56),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,o.pageData.IgnoreTax?e.ProfitWithTax:e.Profit,".0-0")," ")}}function up(n,i){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,ip,2,1,"td",28),t.YNc(2,sp,2,5,"td",51),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",52),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",43),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",43),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td",43),t._uU(15),t.ALo(16,"number"),t.qZA(),t.TgZ(17,"td",43),t._uU(18),t.ALo(19,"number"),t.qZA(),t.TgZ(20,"td",44),t._uU(21),t.ALo(22,"number"),t.qZA(),t.YNc(23,pp,3,8,"td",45),t.YNc(24,cp,3,4,"td",46),t.YNc(25,_p,3,4,"td",47),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngIf",o.isCompareData),t.xp6(1),t.Q6J("ngIf",o.isCompareData),t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(t.xi3(7,12,e.Count,".0-0")),t.xp6(3),t.Oqu(t.xi3(10,15,e.Quantity,".0-0")),t.xp6(3),t.Oqu(t.xi3(13,18,e.Gross,".0-0")),t.xp6(3),t.Oqu(t.xi3(16,21,e.SalesNet,".0-0")),t.xp6(3),t.Oqu(t.xi3(19,24,e.Tax,".0-0")),t.xp6(3),t.Oqu(t.xi3(22,27,e.SalesWithTax,".0-0")),t.xp6(2),t.Q6J("ngIf",o.isCompareData),t.xp6(1),t.Q6J("ngIf",o.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",o.pageData.IsCostVisible)}}function gp(n,i){1&n&&t._UZ(0,"td",42)}function dp(n,i){1&n&&t._UZ(0,"td",42)}function mp(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.WLB(5,tt,e.comparation,e.comparation)),t.xp6(1),t.hij(" ",t.xi3(2,2,e.comparation,".0-0")," ")}}function Zp(n,i){if(1&n&&(t.TgZ(0,"td",55),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data,"Cost"),".0-0")," ")}}function hp(n,i){if(1&n&&(t.TgZ(0,"td",56),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data,"ProfitWithTax"),".0-0")," ")}}function xp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",25),t.TgZ(1,"table",26),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",27),t.TgZ(3,"tr"),t.YNc(4,ep,2,0,"th",28),t.YNc(5,np,2,0,"th",28),t.TgZ(6,"th",29),t._uU(7,"Outlet"),t.qZA(),t.TgZ(8,"th",30),t._uU(9,"Trans"),t.qZA(),t.TgZ(10,"th",31),t._uU(11,"Quantity"),t.qZA(),t.TgZ(12,"th",32),t._uU(13,"Gross"),t.qZA(),t.TgZ(14,"th",33),t._uU(15,"Sales"),t.qZA(),t.TgZ(16,"th",34),t._uU(17,"Tax"),t.qZA(),t.TgZ(18,"th",35),t._uU(19,"Sales + Tax"),t.qZA(),t.YNc(20,ap,2,0,"th",36),t.YNc(21,op,2,0,"th",37),t.YNc(22,rp,2,1,"th",38),t.qZA(),t.qZA(),t.TgZ(23,"tbody"),t.YNc(24,up,26,30,"tr",39),t.qZA(),t.TgZ(25,"tfoot"),t.TgZ(26,"tr",40),t.YNc(27,gp,1,0,"td",41),t.YNc(28,dp,1,0,"td",41),t._UZ(29,"td",42),t.TgZ(30,"td",43),t._uU(31),t.ALo(32,"number"),t.ALo(33,"sum"),t.qZA(),t.TgZ(34,"td",43),t._uU(35),t.ALo(36,"number"),t.ALo(37,"sum"),t.qZA(),t.TgZ(38,"td",43),t._uU(39),t.ALo(40,"number"),t.ALo(41,"sum"),t.qZA(),t.TgZ(42,"td",43),t._uU(43),t.ALo(44,"number"),t.ALo(45,"sum"),t.qZA(),t.TgZ(46,"td",43),t._uU(47),t.ALo(48,"number"),t.ALo(49,"sum"),t.qZA(),t.TgZ(50,"td",44),t.TgZ(51,"a"),t._uU(52),t.ALo(53,"number"),t.ALo(54,"sum"),t.qZA(),t.qZA(),t.YNc(55,mp,3,8,"td",45),t.YNc(56,Zp,4,7,"td",46),t.YNc(57,hp,4,7,"td",47),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(11),t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesTaxNet"),t.xp6(2),t.s9C("altpropcond",e.pageData.IgnoreTax),t.xp6(2),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(2),t.Q6J("ngForOf",e.data),t.xp6(3),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(3),t.Oqu(t.xi3(32,19,t.xi3(33,22,e.data,"Count"),".0-0")),t.xp6(4),t.Oqu(t.xi3(36,25,t.xi3(37,28,e.data,"Quantity"),".0-0")),t.xp6(4),t.Oqu(t.xi3(40,31,t.xi3(41,34,e.data,"Gross"),".0-0")),t.xp6(4),t.hij(" ",t.xi3(44,37,t.xi3(45,40,e.data,"SalesNet"),".0-0")," "),t.xp6(4),t.hij(" ",t.xi3(48,43,t.xi3(49,46,e.data,"Tax"),".0-0")," "),t.xp6(5),t.Oqu(t.xi3(53,49,t.xi3(54,52,e.data,"SalesWithTax"),".0-0")),t.xp6(3),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible)}}const Cp=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance"]},Ap=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Monthly_Perfomance"]};let qp=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/OutletGroupPerformance","ReportLoader/OutletPerformance"),this.httpService=e,this.csvConverter=o,this.isCompareData=!1,this.DateFilterType=!0,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"}],this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.first=!0,this.RadioDateFilterType=[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}];const a=new Date;this.Year=a.getFullYear(),this.Month=a.getMonth()}preGetList(){this.first&&(this.YearMonthToDateRange(),this.first=!1)}YearMonthToDateRange(){const e=new Date;null==this.Year&&(this.Year=e.getFullYear()),null==this.Month&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}sortData(e){const o=this.data.slice();e.active&&""!==e.direction?this.data=o.sort((a,r)=>{const l="asc"===e.direction;switch(a.Name=a.Name?a.Name:"",r.Name=r.Name?r.Name:"",e.active){case"Name":return this.compare(a.Name,r.Name,l);case"Count":return this.compare(a.Count,r.Count,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Gross":return this.compare(a.Gross,r.Gross,l);case"SalesNet":return this.compare(a.SalesNet,r.SalesNet,l);case"SalesWithTax":return this.compare(a.SalesWithTax,r.SalesWithTax,l);case"Tax":return this.compare(a.Tax,r.Tax,l);case"SalesTaxNet":return this.compare(a.SalesTaxNet,r.SalesTaxNet,l);case"Cost":return this.compare(a.Cost,r.Cost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);case"ProfitWithTax":return this.compare(a.ProfitWithTax,r.ProfitWithTax,l);default:return 0}}):this.data.Data=o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-outlet-group-performance"]],features:[t.qOj],decls:16,vars:9,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["name","Date Filter",3,"model","options","modelChange"],[4,"ngIf"],["bindLabel","Name","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","pl-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],["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"],["mat-sort-header","Count",1,"align-right",2,"width","70px"],["mat-sort-header","Quantity",1,"align-right",2,"width","70px"],["mat-sort-header","Gross",1,"align-right",2,"width","120px"],["mat-sort-header","SalesNet",1,"align-right",2,"width","120px"],[1,"align-right",2,"width","120px",3,"mat-sort-header"],["mat-sort-header","SalesWithTax","altprop","SalesNet",1,"align-right",2,"width","120px",3,"altpropcond"],["style","width: 50px;",4,"ngIf"],["mat-sort-header","Cost","style","width: 120px;","class","align-right",4,"ngIf"],["style","width: 120px;","class","align-right",3,"mat-sort-header",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],[1,"text-right"],[1,"text-right","text-primary"],[3,"ngClass",4,"ngIf"],["class","text-right text-danger",4,"ngIf"],["class","text-right text-success",4,"ngIf"],[2,"width","35px"],[2,"width","50px"],["mat-sort-header","Cost",1,"align-right",2,"width","120px"],["style","width: 35px;",3,"ngClass",4,"ngIf"],[1,"text-right",2,"width","70px"],[2,"width","35px",3,"ngClass"],[3,"ngClass"],[1,"text-right","text-danger"],[1,"text-right","text-success"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,$s,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"By Entity "),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10,"Top By Month"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",8),t.YNc(13,tp,12,7,"div",9),t.qZA(),t.qZA(),t.TgZ(14,"content"),t.YNc(15,xp,58,55,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(7,Cp)),t.xp6(5),t.Q6J("routerLink",t.DdM(8,Ap)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,q.P,c.w9,p.JJ,p.On,C.QB,Z.YE,Z.nU,s.sg,s.mk],pipes:[s.JJ,T.qU],styles:[""]}),n})();function Dp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.convertToCSV(a.csvConverter,!0,"Monthly Outlet PErformance ["+a.pageData.Filter.From+" - "+a.pageData.Filter.To+"].csv")}),t._UZ(1,"i",12),t._uU(2,"Export"),t.qZA()}}function yp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Sales Name"),t.qZA(),t.TgZ(4,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Year"),t.qZA(),t.TgZ(8,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Type"),t.qZA(),t.TgZ(12,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types)}}const vp=function(n){return{"align-right":n}};function Sp(n,i){if(1&n&&(t.TgZ(0,"th",22),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.Q6J("mat-sort-header",e)("ngClass",t.VKq(3,vp,"Outlet"!=e)),t.xp6(1),t.Oqu(e)}}function Mp(n,i){if(1&n&&(t.TgZ(0,"div",25),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(1),t.Oqu(o[e])}}function bp(n,i){if(1&n&&(t.TgZ(0,"div",26),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(1),t.hij("",t.lcZ(2,1,o[e])," ")}}function Jp(n,i){if(1&n&&(t.TgZ(0,"td"),t.YNc(1,Mp,2,1,"div",23),t.YNc(2,bp,3,3,"div",24),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Q6J("ngIf","Outlet"==e),t.xp6(1),t.Q6J("ngIf","Outlet"!=e)}}function Op(n,i){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,Jp,3,2,"td",20),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",o.getKeys(e))}}function Ip(n,i){if(1&n&&(t.TgZ(0,"td",30),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e))}}function Up(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",27),t.TgZ(2,"td",28),t._uU(3,"Total : "),t.qZA(),t.YNc(4,Ip,3,3,"td",29),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("ngForOf",e.data.DataFooter)}}function Fp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",16),t.TgZ(1,"table",17),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",18),t.TgZ(3,"tr"),t.YNc(4,Sp,2,5,"th",19),t.qZA(),t.qZA(),t.TgZ(5,"tbody"),t.YNc(6,Op,2,1,"tr",20),t.qZA(),t.YNc(7,Up,5,1,"tfoot",21),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngForOf",e.data.Dataheader),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.Data.length>0)}}const Np=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance"]},Lp=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"]};let Qp=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/MonthlyOutletPerformance","ReportLoader/MonthlyReportSales"),this.httpService=e,this.csvConverter=o,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0)}getKeys(e){return Object.keys(e)}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;for(let _=0;_<this.data.Dataheader.length;_++)if(e.active==this.data.Dataheader[_])return this.compare(a[this.data.Dataheader[_]],r[this.data.Dataheader[_]],l)}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-outlet-monthly-performance"]],features:[t.qOj],decls:16,vars:9,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["placeholder","Year",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","ngClass",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"mat-sort-header","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"],[1,""],["class","text-right",4,"ngFor","ngForOf"],[1,"text-right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Dp,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"By Entity "),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10,"By Entity Group"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",8),t.YNc(13,yp,13,6,"div",9),t.qZA(),t.qZA(),t.TgZ(14,"content"),t.YNc(15,Fp,8,3,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasExportRole),t.xp6(2),t.Q6J("routerLink",t.DdM(7,Np)),t.xp6(5),t.Q6J("routerLink",t.DdM(8,Lp)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,Z.YE,s.sg,Z.nU,s.mk],pipes:[s.JJ],styles:[""]}),n})();function Yp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",7),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/SalesPerson","Sales_Performance.csv")}),t._UZ(1,"i",8),t._uU(2,"Export"),t.qZA()}}function Rp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",9),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Sales Group"),t.qZA(),t.TgZ(8,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesGroupID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From/To"),t.qZA(),t.TgZ(12,"datepicker",12),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",13),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Delivery"),t.qZA(),t.TgZ(17,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.DeliveryID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Sales Type"),t.qZA(),t.TgZ(21,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.List?null:e.pageData.List.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SalesGroupID)("items",null==e.pageData.List?null:e.pageData.List.SalesGroup),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.DeliveryID)("items",null==e.pageData.List?null:e.pageData.List.Deliveries),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.List?null:e.pageData.List.Types)}}function kp(n,i){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Sales Group"),t.qZA())}function Ep(n,i){1&n&&(t.TgZ(0,"th",40),t._uU(1," Cost "),t.qZA())}function Hp(n,i){1&n&&(t.TgZ(0,"th",41),t._uU(1,"Profit "),t.qZA())}function Vp(n,i){1&n&&(t.TgZ(0,"th",42),t._uU(1,"Target "),t.qZA())}function Bp(n,i){1&n&&(t.TgZ(0,"th",43),t._uU(1,"Ach(%) "),t.qZA())}function Gp(n,i){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Group)}}function jp(n,i){if(1&n&&(t.TgZ(0,"td",46),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Cost))}}function Wp(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",t.lcZ(2,1,e.Profit)," ")}}function $p(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.Target)," ")}}function Kp(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.Achievement),"")}}const Xp=function(){return["/menu/Contacts/Contact/Sales_Person/Info"]},zp=function(n){return{ID:n}},tc=function(){return["/menu/Reports/Sales_Report/Standard/Detail"]},ec=function(n,i,e,o){return{SalesPersonID:n,From:i,To:e,ListIDs:o}};function nc(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td",44),t.TgZ(2,"a",45),t._uU(3),t.qZA(),t.qZA(),t.YNc(4,Gp,2,1,"td",33),t.TgZ(5,"td",35),t.TgZ(6,"a",45),t.ALo(7,"date"),t.ALo(8,"date"),t._uU(9),t.ALo(10,"number"),t.qZA(),t.qZA(),t.TgZ(11,"td",36),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td",36),t._uU(15),t.ALo(16,"number"),t.qZA(),t.TgZ(17,"td",36),t._uU(18),t.ALo(19,"number"),t.qZA(),t.TgZ(20,"td",35),t._uU(21),t.ALo(22,"number"),t.qZA(),t.YNc(23,jp,3,3,"td",37),t.YNc(24,Wp,3,3,"td",38),t.YNc(25,$p,3,3,"td",38),t.YNc(26,Kp,3,3,"td",38),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.DdM(36,Xp))("queryParams",t.VKq(37,zp,e.ID)),t.xp6(1),t.Oqu(e.Name),t.xp6(1),t.Q6J("ngIf",o.data.Show),t.xp6(2),t.Q6J("routerLink",t.DdM(39,tc))("queryParams",t.l5B(40,ec,e.ID,t.xi3(7,15,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(8,18,o.pageData.Filter.To,"ddMMyyyy"),o.pageData.Filter.ListIDs)),t.xp6(3),t.Oqu(t.xi3(10,21,e.Orders,".0-0")),t.xp6(3),t.Oqu(t.xi3(13,24,e.Quantity,".0-0")),t.xp6(3),t.Oqu(t.xi3(16,27,e.Sales,".0-0")),t.xp6(3),t.Oqu(t.xi3(19,30,e.Tax,".0-0")),t.xp6(3),t.Oqu(t.xi3(22,33,e.SalesNTax,".0-0")),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",o.pageData.HasRoleProfit),t.xp6(1),t.Q6J("ngIf",o.data.ShowSalesTarget),t.xp6(1),t.Q6J("ngIf",o.data.ShowSalesTarget)}}function ac(n,i){1&n&&t._UZ(0,"td")}function oc(n,i){if(1&n&&(t.TgZ(0,"td",46),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.List,"Cost")),"")}}function rc(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.List,"Profit")),"")}}function ic(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.List,"Target")),"")}}function lc(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.ALo(4,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.List,"Sales")/t.xi3(4,6,e.data.List,"Target")*100)," ")}}function sc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",16),t.TgZ(1,"table",17),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",18),t.TgZ(3,"tr",19),t.TgZ(4,"th",20),t._uU(5,"Sales Person"),t.qZA(),t.YNc(6,kp,2,0,"th",21),t.TgZ(7,"th",22),t._uU(8,"Orders"),t.qZA(),t.TgZ(9,"th",23),t._uU(10,"Quantity"),t.qZA(),t.TgZ(11,"th",24),t._uU(12,"Sales"),t.qZA(),t.TgZ(13,"th",25),t._uU(14,"Tax"),t.qZA(),t.TgZ(15,"th",26),t._uU(16," Sales + Tax "),t.qZA(),t.YNc(17,Ep,2,0,"th",27),t.YNc(18,Hp,2,0,"th",28),t.YNc(19,Vp,2,0,"th",29),t.YNc(20,Bp,2,0,"th",30),t.qZA(),t.qZA(),t.TgZ(21,"tbody"),t.YNc(22,nc,27,45,"tr",31),t.qZA(),t.TgZ(23,"tfoot"),t.TgZ(24,"tr",32),t.YNc(25,ac,1,0,"td",33),t.TgZ(26,"td",34),t._uU(27,"Total:"),t.qZA(),t.TgZ(28,"td",35),t._uU(29),t.ALo(30,"number"),t.ALo(31,"sum"),t.qZA(),t.TgZ(32,"td",36),t._uU(33),t.ALo(34,"number"),t.ALo(35,"sum"),t.qZA(),t.TgZ(36,"td",36),t._uU(37),t.ALo(38,"number"),t.ALo(39,"sum"),t.qZA(),t.TgZ(40,"td",36),t._uU(41),t.ALo(42,"number"),t.ALo(43,"sum"),t.qZA(),t.TgZ(44,"td",35),t._uU(45),t.ALo(46,"number"),t.ALo(47,"sum"),t.qZA(),t.YNc(48,oc,4,6,"td",37),t.YNc(49,rc,4,6,"td",38),t.YNc(50,ic,4,6,"td",38),t.YNc(51,lc,5,9,"td",38),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(6),t.Q6J("ngIf",e.data.Show),t.xp6(11),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",e.pageData.HasRoleProfit),t.xp6(1),t.Q6J("ngIf",e.data.ShowSalesTarget),t.xp6(1),t.Q6J("ngIf",e.data.ShowSalesTarget),t.xp6(2),t.Q6J("ngForOf",e.data.List),t.xp6(3),t.Q6J("ngIf",e.data.Show),t.xp6(4),t.Oqu(t.xi3(30,16,t.xi3(31,19,e.data.List,"Orders"),".0-0")),t.xp6(4),t.Oqu(t.xi3(34,22,t.xi3(35,25,e.data.List,"Quantity"),".0-0")),t.xp6(4),t.Oqu(t.xi3(38,28,t.xi3(39,31,e.data.List,"Sales"),".0-0")),t.xp6(4),t.Oqu(t.xi3(42,34,t.xi3(43,37,e.data.List,"Tax"),".0-0")),t.xp6(4),t.hij("",t.xi3(46,40,t.xi3(47,43,e.data.List,"SalesNTax"),".0-0")," "),t.xp6(3),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",e.pageData.HasRoleProfit),t.xp6(1),t.Q6J("ngIf",e.data.ShowSalesTarget),t.xp6(1),t.Q6J("ngIf",e.data.ShowSalesTarget)}}const cc=function(){return["/menu/Reports/Sales_Report/Standard/Sales_Person/Commission_Report"]},uc=function(){return["/menu/Reports/Sales_Report/Standard/Sales_Person/Sales_Commission"]};let gc=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/SalesPerson","ReportLoader/SalesPerson"),this.httpService=e,this.csvConverter=o}postInit(){this.menuData.H=this.data.PageTitle}sortData(e){const o=this.data.List.slice();this.data.List=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(a.Name=null==a.Name?"":a.Name,r.Name=null==r.Name?"":r.Name,a.Group=null==a.Group?"":a.Group,r.Group=null==r.Group?"":r.Group,e.active){case"Name":return this.compare(a.Name.toLocaleLowerCase(),r.Name.toLocaleLowerCase(),l);case"Group":return this.compare(a.Group.toLocaleLowerCase(),r.Group.toLocaleLowerCase(),l);case"Orders":return this.compare(a.Orders,r.Orders,l);case"Tax":return this.compare(a.Tax,r.Tax,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Cost":return this.compare(a.Cost,r.Cost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"SalesNTax":return this.compare(a.SalesNTax,r.SalesNTax,l);case"Target":return this.compare(a.Target,r.Target,l);case"Achievement":return this.compare(a.Achievement,r.Achievement,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-sales-person"]],features:[t.qOj],decls:12,vars:9,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],["role","button","title","Target",1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],["role","button","title","Target",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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"],["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"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name"],["mat-sort-header","Group",4,"ngIf"],["mat-sort-header","Orders",1,"align-right",2,"width","80px"],["mat-sort-header","Quantity",1,"align-right",2,"width","100px"],["mat-sort-header","Sales",1,"align-right",2,"width","120px"],["mat-sort-header","Tax",1,"align-right",2,"width","90px"],["mat-sort-header","SalesNTax",1,"align-right",2,"width","120px"],["mat-sort-header","Cost","style","width: 120px;","class","align-right",4,"ngIf"],["mat-sort-header","Profit","style","width: 120px;","class","align-right",4,"ngIf"],["mat-sort-header","Target","style","width: 120px;","class","align-right",4,"ngIf"],["mat-sort-header","Achievement","style","width: 120px;","class","align-right",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[4,"ngIf"],[1,"empty-column","text-right"],[1,"text-right","text-primary"],[1,"text-right"],["class","text-right text-danger",4,"ngIf"],["class","text-right text-success",4,"ngIf"],["mat-sort-header","Group"],["mat-sort-header","Cost",1,"align-right",2,"width","120px"],["mat-sort-header","Profit",1,"align-right",2,"width","120px"],["mat-sort-header","Target",1,"align-right",2,"width","120px"],["mat-sort-header","Achievement",1,"align-right",2,"width","120px"],[1,"text-primary"],[3,"routerLink","queryParams"],[1,"text-right","text-danger"],[1,"text-right","text-success"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Yp,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4,"By Product"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"By Item"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,Rp,22,11,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,sc,52,46,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(1),t.Q6J("routerLink",t.DdM(7,cc)),t.xp6(2),t.Q6J("routerLink",t.DdM(8,uc)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,Z.YE,Z.nU,s.sg],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function dc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",7),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/GetSalesPersonCommissionGroupBySales","Sales_Commission.csv")}),t._UZ(1,"i",8),t._uU(2,"Export"),t.qZA()}}function mc(n,i){if(1&n&&(t.TgZ(0,"span",16),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Zc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",9),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,mc,2,2,"ng-template",12),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Sales Group"),t.qZA(),t.TgZ(13,"ng-select",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesGroupID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"From/To"),t.qZA(),t.TgZ(17,"datepicker",14),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(18,"datepicker",15),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.List?null:e.pageData.List.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.List?null:e.pageData.List.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.SalesGroupID)("items",null==e.pageData.List?null:e.pageData.List.SalesGroup),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function hc(n,i){1&n&&(t.TgZ(0,"th",31),t._uU(1,"Sales Target"),t.qZA())}function xc(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.SalesTarget,".0-0"),"")}}const Tc=function(n,i,e){return{ID:n,from:i,to:e}},et="/menu/Reports/Sales_Report/Standard/Sales_Person/Commission_Report",Cc=function(n){return[et,n]};function fc(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",29),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",29),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",29),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",29),t.TgZ(13,"a",32),t.ALo(14,"date"),t.ALo(15,"date"),t._uU(16),t.ALo(17,"number"),t.qZA(),t.qZA(),t.YNc(18,xc,3,4,"td",33),t.ALo(19,"sum"),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.SalesPersonName),t.xp6(2),t.Oqu(t.xi3(5,7,e.TotalOrders,".0-0")),t.xp6(3),t.Oqu(t.xi3(8,10,e.Quantity,".0-0")),t.xp6(3),t.Oqu(t.xi3(11,13,e.GrossRevenue,".0-0")),t.xp6(3),t.Q6J("routerLink",t.VKq(31,Cc,t.kEZ(27,Tc,e.SalesPersonID,t.xi3(14,16,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(15,19,o.pageData.Filter.To,"ddMMyyyy")))),t.xp6(3),t.hij(" ",t.lcZ(17,22,e.TotalCommission)," "),t.xp6(2),t.Q6J("ngIf",t.xi3(19,24,o.data.List,"SalesTarget")>0)}}function Ac(n,i){1&n&&t._UZ(0,"td",34)}function qc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",17),t.TgZ(1,"table",18),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",19),t.TgZ(3,"tr"),t.TgZ(4,"th",20),t._uU(5,"Sales Person"),t.qZA(),t.TgZ(6,"th",21),t._uU(7,"Orders"),t.qZA(),t.TgZ(8,"th",22),t._uU(9,"Items Quantity"),t.qZA(),t.TgZ(10,"th",23),t._uU(11,"Gross Revenue"),t.qZA(),t.TgZ(12,"th",24),t._uU(13,"Product Commission"),t.qZA(),t.YNc(14,hc,2,0,"th",25),t.ALo(15,"sum"),t.qZA(),t.qZA(),t.TgZ(16,"tbody"),t.YNc(17,fc,20,33,"tr",26),t.qZA(),t.TgZ(18,"tfoot"),t.TgZ(19,"tr",27),t.TgZ(20,"td",28),t._uU(21,"Total:"),t.qZA(),t.TgZ(22,"td",29),t._uU(23),t.ALo(24,"number"),t.ALo(25,"sum"),t.qZA(),t.TgZ(26,"td",29),t._uU(27),t.ALo(28,"number"),t.ALo(29,"sum"),t.qZA(),t.TgZ(30,"td",29),t._uU(31),t.ALo(32,"number"),t.ALo(33,"sum"),t.qZA(),t.TgZ(34,"td",29),t._uU(35),t.ALo(36,"number"),t.ALo(37,"sum"),t.qZA(),t.YNc(38,Ac,1,0,"td",30),t.ALo(39,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(14),t.Q6J("ngIf",t.xi3(15,7,e.data.List,"SalesTarget")>0),t.xp6(3),t.Q6J("ngForOf",e.data.List),t.xp6(6),t.Oqu(t.lcZ(24,10,t.xi3(25,12,e.data.List,"TotalOrders"))),t.xp6(4),t.Oqu(t.lcZ(28,15,t.xi3(29,17,e.data.List,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(32,20,t.xi3(33,22,e.data.List,"GrossRevenue"))),t.xp6(4),t.Oqu(t.lcZ(36,25,t.xi3(37,27,e.data.List,"TotalCommission"))),t.xp6(3),t.Q6J("ngIf",t.xi3(39,30,e.data.List,"SalesTarget")>0)}}const Dc=function(){return[et]},yc=function(){return["/menu/Reports/Sales_Report/Standard/Sales_Person"]};let vc=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetSalesPersonCommissionGroupBySales","ReportLoader/SalesPerson"),this.httpService=e,this.csvConverter=o}sortData(e){const o=this.data.List.slice();this.data.List=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Name":return this.compare(a.Name,r.Name,l);case"TotalOrders":return this.compare(a.TotalOrders,r.TotalOrders,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"GrossRevenue":return this.compare(a.GrossRevenue,r.GrossRevenue,l);case"TotalCommission":return this.compare(a.TotalCommission,r.TotalCommission,l);case"SalesTarget":return this.compare(a.SalesTarget,r.SalesTarget,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-sales-commision"]],features:[t.qOj],decls:12,vars:9,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],["role","button","title","Target",1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],["role","button","title","Target",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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"],["name","To",3,"date","dateChange"],[3,"title"],[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"],["mat-sort-header","TotalOrders",1,"align-right",2,"width","110px"],["mat-sort-header","Quantity",1,"align-right",2,"width","110px"],["mat-sort-header","GrossRevenue",1,"align-right",2,"width","150px"],["mat-sort-header","TotalCommission",1,"align-right",2,"width","150px"],["mat-sort-header","SalesTarget","style","width: 150px;","class","align-right",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column","text-right"],[1,"text-right"],["class","empty-column",4,"ngIf"],["mat-sort-header","SalesTarget",1,"align-right",2,"width","150px"],[3,"routerLink"],["class","text-right",4,"ngIf"],[1,"empty-column"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,dc,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4,"By Product"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"By Order"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,Zc,19,9,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,qc,40,33,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(1),t.Q6J("routerLink",t.DdM(7,Dc)),t.xp6(2),t.Q6J("routerLink",t.DdM(8,yc)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,C.QB,Z.YE,Z.nU,s.sg],pipes:[T.qU,s.JJ,s.uU],styles:[""]}),n})();function Sc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",11),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Sales"),t.qZA(),t.TgZ(8,"ng-select",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From/To"),t.qZA(),t.TgZ(12,"datepicker",14),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",15),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.ID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}const Mc=function(){return["/menu/Products/Catalog/Variants/Info"]},nt=function(n){return{ID:n}};function bc(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td",36),t.TgZ(2,"a",37),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"td",38),t._uU(5),t.qZA(),t.TgZ(6,"td",39),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",40),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",40),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",41),t._uU(16),t.ALo(17,"number"),t.qZA(),t.TgZ(18,"td",42),t._uU(19),t.ALo(20,"number"),t.qZA(),t.TgZ(21,"td",42),t._uU(22),t.ALo(23,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Q6J("routerLink",t.DdM(22,Mc))("queryParams",t.VKq(23,nt,e.VariantID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.hij(" ",t.lcZ(8,10,e.Quantity),""),t.xp6(3),t.hij(" ",t.lcZ(11,12,e.VariantCommission),""),t.xp6(3),t.hij(" ",t.lcZ(14,14,e.GroupCommission),""),t.xp6(3),t.hij(" ",t.lcZ(17,16,e.TotalCommission),""),t.xp6(3),t.hij(" ",t.lcZ(20,18,e.UnitPrice*e.Quantity),""),t.xp6(3),t.hij(" ",t.lcZ(23,20,e.NettSales)," ")}}const Jc=function(){return["/menu/Contacts/Contact/Sales_Person/Info"]};function Oc(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"div",28),t.TgZ(2,"a",29),t.TgZ(3,"span"),t._uU(4),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"strong"),t._uU(7),t.qZA(),t.qZA(),t.qZA(),t.TgZ(8,"div",30),t.TgZ(9,"div"),t.TgZ(10,"table",31),t._UZ(11,"thead"),t.TgZ(12,"tbody"),t.YNc(13,bc,24,25,"tr",27),t.qZA(),t.TgZ(14,"tfoot"),t.TgZ(15,"tr",32),t.TgZ(16,"td",33),t._uU(17,"Total:"),t.qZA(),t.TgZ(18,"td",34),t._uU(19),t.ALo(20,"number"),t.ALo(21,"sum"),t.ALo(22,"GetChildrenArray"),t.qZA(),t._UZ(23,"td",35),t.TgZ(24,"td",34),t._uU(25),t.ALo(26,"number"),t.ALo(27,"sum"),t.ALo(28,"GetChildrenArray"),t.qZA(),t.TgZ(29,"td",34),t._uU(30),t.ALo(31,"number"),t.ALo(32,"sum"),t.ALo(33,"GetChildrenArray"),t.qZA(),t.TgZ(34,"td",34),t._uU(35),t.ALo(36,"number"),t.ALo(37,"sum"),t.ALo(38,"GetChildrenArray"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.DdM(41,Jc))("queryParams",t.VKq(42,nt,e.ID)),t.xp6(2),t.Oqu(e.Name),t.xp6(3),t.Oqu(e.GroupName),t.xp6(6),t.Q6J("ngForOf",e.Item),t.xp6(6),t.hij(" ",t.lcZ(20,9,t.xi3(21,11,o.filterData(t.xi3(22,14,o.data.Data,"Item"),"SalesID",e.ID),"Quantity"))," "),t.xp6(6),t.hij(" ",t.lcZ(26,17,t.xi3(27,19,o.filterData(t.xi3(28,22,o.data.Data,"Item"),"SalesID",e.ID),"TotalCommission"))," "),t.xp6(5),t.hij(" ",t.lcZ(31,25,t.xi3(32,27,o.filterData(t.xi3(33,30,o.data.Data,"Item"),"SalesID",e.ID),"Revenue"))," "),t.xp6(5),t.hij(" ",t.lcZ(36,33,t.xi3(37,35,o.filterData(t.xi3(38,38,o.data.Data,"Item"),"SalesID",e.ID),"NettSales"))," ")}}function Ic(n,i){if(1&n&&(t.TgZ(0,"div",16),t.TgZ(1,"table",17),t.TgZ(2,"thead",18),t.TgZ(3,"tr",19),t._UZ(4,"th",20),t.TgZ(5,"th",21),t._uU(6,"Product Commission"),t.qZA(),t._UZ(7,"th",20),t.qZA(),t.TgZ(8,"tr"),t.TgZ(9,"th"),t._uU(10,"Name"),t.qZA(),t.TgZ(11,"th",22),t._uU(12,"Code"),t.qZA(),t.TgZ(13,"th",23),t._uU(14,"Quantity"),t.qZA(),t.TgZ(15,"th",24),t._uU(16,"Standard"),t.qZA(),t.TgZ(17,"th",24),t._uU(18,"Group"),t.qZA(),t.TgZ(19,"th",25),t._uU(20,"Qty * Product Comm."),t.qZA(),t.TgZ(21,"th",26),t._uU(22,"Gross Revenue"),t.qZA(),t.TgZ(23,"th",26),t._uU(24,"Nett Sales"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.YNc(25,Oc,39,44,"div",27),t.qZA()),2&n){const e=t.oxw();t.xp6(25),t.Q6J("ngForOf",e.data.Data)}}const Fc=function(){return["/menu/Reports/Sales_Report/Standard/Sales_Person/Sales_Commission"]},Nc=function(){return["/menu/Reports/Sales_Report/Standard/Sales_Person/Commission_Report/Commission_Report_Detail"]},Pc=function(n,i){return{From:n,To:i}};let Lc=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/GetSalesPersonCommissionGroupByProduct","ReportLoader/SalesCommissionLoader",null,a),this.httpService=e,this.csvConverter=o,this.activatedRoute=a}print(){window.print()}filterData(e,o,a){return e.filter(function(r){return r[o]==a})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-commision-report"]],features:[t.qOj],decls:20,vars:18,consts:[[3,"pageData","hideSearchBox","onSubmit"],[1,"btn-group","mr-6"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["role","button","title","Sales Person Commission Summary",1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],["role","button","title","Sales Person Statistics",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 outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a Sales Person",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"columnSpan"],["colspan","3",1,"empty-column"],["colspan","2",1,"text-center"],[2,"width","140px"],[1,"text-right",2,"width","100px"],[1,"text-right",2,"width","120px"],[1,"text-right",2,"width","150px"],[1,"text-right",2,"width","130px"],[4,"ngFor","ngForOf"],[1,"mt-11","ml-3"],[1,"h5","font-weight-bold","text-primary",3,"routerLink","queryParams"],[1,"items"],[1,"table-sm","border","w-100"],[1,"table-footer"],["colspan","2",1,"text-right","empty-column"],[1,"text-right","text-success"],["colspan","2",1,"text-right","text-success","empty-column"],[1,"border"],[3,"routerLink","queryParams"],[1,"border",2,"width","140px"],[1,"text-right","text-success","border",2,"width","100px"],[1,"text-right","text-success","border",2,"width","120px"],[1,"text-right","text-success","border",2,"width","150px"],[1,"text-right","text-success","border",2,"width","130px"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"div",1),t.TgZ(3,"a",2),t.NdJ("click",function(){return o.print()}),t._UZ(4,"i",3),t._uU(5," Print"),t.qZA(),t.TgZ(6,"a",4),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/SalesPersonGroupByProduct","Sales_Commission_byProduct.csv")}),t._UZ(7,"i",5),t._uU(8,"Export"),t.qZA(),t.qZA(),t.TgZ(9,"a",6),t._uU(10,"Return to Summary"),t.qZA(),t.TgZ(11,"a",7),t.ALo(12,"date"),t.ALo(13,"date"),t._uU(14,"View Detail"),t.qZA(),t.qZA(),t.TgZ(15,"filters"),t.TgZ(16,"div",8),t.YNc(17,Sc,14,7,"div",9),t.qZA(),t.qZA(),t.TgZ(18,"content"),t.YNc(19,Ic,26,1,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(9),t.Q6J("routerLink",t.DdM(13,Fc)),t.xp6(2),t.Q6J("routerLink",t.DdM(14,Nc))("queryParams",t.WLB(15,Pc,t.xi3(12,7,null==o.pageData.Filter?null:o.pageData.Filter.From,"ddMMyyyy"),t.xi3(13,10,null==o.pageData.Filter?null:o.pageData.Filter.To,"ddMMyyyy"))),t.xp6(6),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,C.QB,s.sg],pipes:[s.uU,s.JJ,T.qU,T.J1],styles:[""]}),n})();function Qc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Sales"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.ID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}const Yc=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},at=function(n){return{ID:n}};function Rc(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"td"),t.TgZ(5,"a",22),t._uU(6),t.qZA(),t.qZA(),t.TgZ(7,"td"),t._uU(8),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.qZA(),t.TgZ(11,"td",21),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td",21),t._uU(15),t.ALo(16,"number"),t.qZA(),t.TgZ(17,"td",21),t._uU(18),t.ALo(19,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(t.xi3(3,9,e.Date,"dd MMM yyyy")),t.xp6(3),t.Q6J("routerLink",t.DdM(18,Yc))("queryParams",t.VKq(19,at,e.InvoiceID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Oqu(e.VariantName),t.xp6(2),t.Oqu(e.SalesName),t.xp6(2),t.Oqu(t.lcZ(13,12,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(16,14,e.Commission)),t.xp6(3),t.Oqu(t.lcZ(19,16,e.TotalCommission))}}function kc(n,i){if(1&n&&(t.TgZ(0,"div",11),t.TgZ(1,"table",12),t.TgZ(2,"thead",13),t.TgZ(3,"tr",14),t.TgZ(4,"th",15),t._uU(5,"Date"),t.qZA(),t.TgZ(6,"th",15),t._uU(7,"Number"),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Name"),t.qZA(),t.TgZ(10,"th"),t._uU(11,"Sales Person"),t.qZA(),t.TgZ(12,"th",16),t._uU(13,"Quantity"),t.qZA(),t.TgZ(14,"th",16),t._uU(15,"Commission"),t.qZA(),t.TgZ(16,"th",16),t._uU(17,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(18,"tbody"),t.YNc(19,Rc,20,21,"tr",17),t.qZA(),t.TgZ(20,"tfoot"),t.TgZ(21,"tr",18),t._UZ(22,"td",19),t._UZ(23,"td",19),t._UZ(24,"td",19),t.TgZ(25,"td",20),t._uU(26,"Total:"),t.qZA(),t.TgZ(27,"td",21),t._uU(28),t.ALo(29,"number"),t.ALo(30,"sum"),t.qZA(),t._UZ(31,"td",19),t.TgZ(32,"td",21),t._uU(33),t.ALo(34,"number"),t.ALo(35,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(19),t.Q6J("ngForOf",e.data.Data),t.xp6(9),t.hij("",t.lcZ(29,3,t.xi3(30,5,e.data.Data,"Quantity"))," "),t.xp6(5),t.hij(" ",t.lcZ(34,8,t.xi3(35,10,e.data.Data,"TotalCommission")),"")}}const Hc=function(){return["/menu/Reports/Sales_Report/Standard/Sales_Person/Commission_Report"]};let Vc=(()=>{class n extends m.n{constructor(e,o,a,r){super(e,"Report/GetSalesPersonCommissionDetail","ReportLoader/SalesCommissionDetailLoader",null,r),this.httpService=e,this.csvConverter=o,this.datePipe=a,this.activatedRoute=r,this.datasource=[]}postInit(){this.menuData.H=this.data.PageTitle,this.datasource=this.data.Data}transformDate(e,o){return this.datePipe.transform(e,o)}getFilterData(e){this.data.Data=this.datasource.filter(o=>Object.keys(o).some(a=>null!=o[a]&&o[a].toString().toLowerCase().includes(e.toLowerCase())))}getID(){return this.pageData.Filter.ID?this.pageData.Filter.ID:x.gT.GuidEmpty}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(s.uU),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-commision-report-detail"]],features:[t.qOj],decls:12,vars:9,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["role","button",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 a Sales Person",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-right"],[1,"text-right","text-success"],["h","",3,"routerLink","queryParams"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()})("textChange",function(r){return o.getFilterData(r)}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return 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")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"Back"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,Qc,10,4,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,kc,36,13,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(5),t.Q6J("routerLink",t.DdM(6,Hc))("queryParams",t.VKq(7,at,o.getID())),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,C.QB,s.sg],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function Bc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",6),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/GetNonStandardPrice","Non-Standard Price.csv")}),t._UZ(1,"i",7),t._uU(2,"Export"),t.qZA()}}function Gc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",8),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Variant"),t.qZA(),t.TgZ(8,"autocompleteV2",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.VariantID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From/To"),t.qZA(),t.TgZ(12,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",12),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"PriceType"),t.qZA(),t.TgZ(17,"radio-options",13),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.PriceTypeID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Note"),t.qZA(),t.TgZ(21,"input",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Note=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.VariantID),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("model",e.pageData.Filter.PriceTypeID)("options",e.PriceType),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Note)}}function jc(n,i){1&n&&(t.TgZ(0,"th",23),t._uU(1,"Original Cost"),t.qZA())}function Wc(n,i){1&n&&(t.TgZ(0,"th",23),t._uU(1,"Cost"),t.qZA())}function $c(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.VariantUnitCost))}}function Kc(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.UnitCost))}}const Xc=function(){return["/menu/Products/Catalog/Variants/Info"]},ot=function(n){return{ID:n}},zc=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]};function t_(n,i){if(1&n&&(t.TgZ(0,"tr",26),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"a",27),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.qZA(),t.TgZ(8,"td"),t.TgZ(9,"a",27),t._uU(10),t.qZA(),t.qZA(),t.TgZ(11,"td"),t._uU(12),t.ALo(13,"date"),t.qZA(),t.YNc(14,$c,3,3,"td",28),t.YNc(15,Kc,3,3,"td",28),t.TgZ(16,"td",29),t._uU(17),t.ALo(18,"number"),t.qZA(),t.TgZ(19,"td",29),t._uU(20),t.ALo(21,"number"),t.qZA(),t.TgZ(22,"td"),t._UZ(23,"i",30),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.EntityName),t.xp6(2),t.Q6J("routerLink",t.DdM(21,Xc))("queryParams",t.VKq(22,ot,e.VariantID)),t.xp6(1),t.Oqu(e.VariantName),t.xp6(2),t.Oqu(e.VariantCode),t.xp6(2),t.Q6J("routerLink",t.DdM(24,zc))("queryParams",t.VKq(25,ot,e.InvoiceID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Oqu(t.xi3(13,14,e.Created,"dd MMM yyyy")),t.xp6(2),t.Q6J("ngIf",o.pageData.HasCostRole),t.xp6(1),t.Q6J("ngIf",o.pageData.HasCostRole),t.xp6(2),t.Oqu(t.lcZ(18,17,e.VariantUnitPrice)),t.xp6(3),t.Oqu(t.lcZ(21,19,e.UnitPrice)),t.xp6(3),t.Q6J("innerHtml",e.Note,t.oJD)}}function e_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",15),t.TgZ(1,"table",16),t.TgZ(2,"thead",17),t.TgZ(3,"tr"),t.TgZ(4,"th",18),t._uU(5,"Outlet"),t.qZA(),t.TgZ(6,"th",19),t._uU(7,"Variant"),t.qZA(),t.TgZ(8,"th",20),t._uU(9,"Code"),t.qZA(),t.TgZ(10,"th",21),t._uU(11,"Number"),t.qZA(),t.TgZ(12,"th",21),t._uU(13,"Date"),t.qZA(),t.YNc(14,jc,2,0,"th",22),t.YNc(15,Wc,2,0,"th",22),t.TgZ(16,"th",23),t._uU(17,"Original Price"),t.qZA(),t.TgZ(18,"th",23),t._uU(19,"Price"),t.qZA(),t.TgZ(20,"th"),t._uU(21,"Note"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(22,"tbody"),t.YNc(23,t_,24,27,"tr",24),t.qZA(),t.qZA(),t.ynx(24),t.TgZ(25,"mat-paginator",25),t.NdJ("page",function(a){return t.CHM(e),t.oxw().onPaginationChange(a)}),t.qZA(),t.BQk(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(14),t.Q6J("ngIf",e.pageData.HasCostRole),t.xp6(1),t.Q6J("ngIf",e.pageData.HasCostRole),t.xp6(8),t.Q6J("ngForOf",e.data.Data),t.xp6(2),t.Q6J("length",e.data.ListTotal)("pageSize",e.pagination.PageSize)("pageIndex",0==e.pageData.Filter.PageNumber?0:e.pageData.Filter.PageNumber-1)}}const a_=function(){return["/menu/Reports/Sales_Report/Standard/Discounted_Sales"]};let o_=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetNonStandardPrice","ReportLoader/NonStandardPrice"),this.httpService=e,this.csvConverter=o,this.PriceType=[{Key:0,Value:"All"},{Key:1,Value:"Edited"}],this.sourcedata=[]}postInit(){this.sourcedata=this.data.Data}getFilterData(e){this.data.Data=this.sourcedata.filter(o=>Object.keys(o).some(a=>null!=o[a]&&o[a].toString().toLowerCase().includes(e.toLowerCase())))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-non-standard-price"]],features:[t.qOj],decls:10,vars:7,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-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","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["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-right","style","width: 100px",4,"ngIf"],[1,"text-right",2,"width","100px"],["class","border-bottom",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[1,"border-bottom"],["target","_blank",3,"routerLink","queryParams"],["class","text-right",4,"ngIf"],[1,"text-right"],[2,"word-break","break-all",3,"innerHtml"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("textChange",function(r){return o.getFilterData(r)})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Bc,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4,"Discounted Sales"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,Gc,22,8,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,e_,26,6,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(2),t.Q6J("ngIf",null==o.pageData.Filter?null:o.pageData.Filter.IsExport),t.xp6(1),t.Q6J("routerLink",t.DdM(6,a_)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,D.J,C.QB,q.P,p.Fj,s.sg,Q.NW],pipes:[s.uU,s.JJ],styles:[""]}),n})();function r_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",25),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.exportCSV(a.csvConverter,"ReportExport/ReportPurchaseDetail","Purchase Transaction.csv")}),t._UZ(1,"i",26),t._uU(2,"Export"),t.qZA()}}function i_(n,i){if(1&n&&(t.TgZ(0,"th",27),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" UnitPrice(",e.data.Symbol,")")}}function l_(n,i){if(1&n&&(t.TgZ(0,"th",28),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" Total(",e.data.Symbol,")")}}function s_(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1," /"),t.qZA())}const rt=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},it=function(n){return{ID:n}};function p_(n,i){if(1&n&&(t.TgZ(0,"a",31),t.TgZ(1,"span",42),t._uU(2),t.qZA(),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("routerLink",t.DdM(3,rt))("queryParams",t.VKq(4,it,e.ID)),t.xp6(2),t.Oqu("#"+e.PONumber)}}function c_(n,i){if(1&n&&(t.TgZ(0,"th",49),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,null==e?null:e.UnitPrice))}}function __(n,i){if(1&n&&(t.TgZ(0,"th",50),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,null==e?null:e.Total)," ")}}function u_(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"th",43),t._uU(2),t.qZA(),t.TgZ(3,"th",44),t._uU(4),t.qZA(),t.TgZ(5,"th",45),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"th",18),t._uU(9),t.qZA(),t.YNc(10,c_,3,3,"th",46),t.TgZ(11,"th",47),t._uU(12),t.qZA(),t.YNc(13,__,3,3,"th",48),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(3);t.xp6(2),t.hij(" ",null==e?null:e.Name," "),t.xp6(2),t.Oqu(null==e?null:e.Code),t.xp6(2),t.hij(" ",t.lcZ(7,7,null==e?null:e.Quantity)," "),t.xp6(3),t.Oqu(null==e?null:e.UOMName),t.xp6(1),t.Q6J("ngIf",o.pageData.HasRoleCost),t.xp6(2),t.hij(" ",0==(null==e?null:e.Discount)?"-":(null==e?null:e.Discount)+"%"," "),t.xp6(1),t.Q6J("ngIf",o.pageData.HasRoleCost)}}function g_(n,i){if(1&n&&(t.TgZ(0,"tfoot",51),t.TgZ(1,"tr",52),t.TgZ(2,"td",53),t.TgZ(3,"b"),t._uU(4,"Total"),t.qZA(),t.qZA(),t.TgZ(5,"td",54),t.TgZ(6,"b"),t._uU(7),t.ALo(8,"number"),t.ALo(9,"sum"),t.qZA(),t.qZA(),t._UZ(10,"td"),t._UZ(11,"td"),t._UZ(12,"td"),t.TgZ(13,"td",55),t._UZ(14,"table",56),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(7),t.Oqu(t.lcZ(8,2,t.xi3(9,4,e.Items,"Quantity"))),t.xp6(7),t.Q6J("innerHTML",e.FooterHTML,t.oJD)}}function d_(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"div",29),t.TgZ(2,"div",30),t.TgZ(3,"a",31),t.TgZ(4,"span",32),t._uU(5),t.qZA(),t.qZA(),t.YNc(6,s_,2,0,"span",33),t.YNc(7,p_,3,6,"a",34),t.TgZ(8,"span"),t._uU(9),t.ALo(10,"date"),t.qZA(),t._UZ(11,"span",35),t.TgZ(12,"strong",36),t._uU(13),t.ALo(14,"sum"),t.ALo(15,"number"),t.ALo(16,"sum"),t.qZA(),t.qZA(),t.TgZ(17,"div",37),t.TgZ(18,"label",38),t._uU(19),t.qZA(),t.qZA(),t.qZA(),t.TgZ(20,"table",39),t._UZ(21,"thead"),t.TgZ(22,"tbody",40),t.YNc(23,u_,14,9,"tr",23),t.qZA(),t.YNc(24,g_,15,7,"tfoot",41),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(3),t.Q6J("routerLink",t.DdM(21,rt))("queryParams",t.VKq(22,it,e.ID)),t.xp6(2),t.Oqu(e.Name+" #"+e.Number),t.xp6(1),t.Q6J("ngIf",o.pageData.DualReceiptNumber),t.xp6(1),t.Q6J("ngIf",o.pageData.DualReceiptNumber),t.xp6(2),t.Oqu(" - "+t.xi3(10,10,e.Date,"dd MMM yyyy")+(null==e.SupplierName?"":" : "+e.SupplierName)),t.xp6(4),t.hij(" ","[Q: "+t.xi3(14,13,e.Items,"Quantity")+", T: "+t.lcZ(15,16,t.xi3(16,18,e.Items,"Total"))+"]"," "),t.xp6(6),t.Oqu(e.PaymentStateLabel),t.xp6(4),t.Q6J("ngForOf",e.Items),t.xp6(1),t.Q6J("ngIf",o.pageData.HasRoleCost)}}function m_(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"strong"),t._uU(2,"Cost ("),t.TgZ(3,"span",59),t._uU(4),t.ALo(5,"number"),t.qZA(),t._uU(6,"%)"),t.qZA(),t.TgZ(7,"span",54),t._uU(8),t.ALo(9,"number"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(4),t.Oqu(t.xi3(5,2,e.data.Aggregate.CostRatio,".0-0")),t.xp6(4),t.Oqu(e.data.Aggregate.Cost?t.xi3(9,5,e.data.Aggregate.Cost,".0-0"):"\xa0")}}function Z_(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"strong"),t.TgZ(2,"span"),t._uU(3,"Profit"),t.qZA(),t._uU(4," ("),t.TgZ(5,"span",59),t._uU(6),t.ALo(7,"number"),t.qZA(),t._uU(8,"%)"),t.qZA(),t.TgZ(9,"span",54),t._uU(10),t.ALo(11,"number"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(6),t.Oqu(t.xi3(7,2,e.data.Aggregate.ProfitRatio,".0-0")),t.xp6(4),t.Oqu(e.data.Aggregate.Profit?t.xi3(11,5,e.data.Aggregate.Profit,".0-0"):"\xa0")}}function h_(n,i){if(1&n&&(t.TgZ(0,"div",57),t.TgZ(1,"div",58),t.TgZ(2,"div"),t.TgZ(3,"strong"),t._uU(4,"Tax Added"),t.qZA(),t.TgZ(5,"span",54),t._uU(6),t.ALo(7,"number"),t.qZA(),t.qZA(),t.TgZ(8,"div"),t.TgZ(9,"strong"),t._uU(10,"Purchases with Tax"),t.qZA(),t.TgZ(11,"span",54),t._uU(12),t.ALo(13,"number"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"div",58),t.TgZ(15,"div"),t.TgZ(16,"strong"),t._uU(17,"Orders"),t.qZA(),t.TgZ(18,"span",54),t._uU(19),t.ALo(20,"number"),t.qZA(),t.qZA(),t.TgZ(21,"div"),t.TgZ(22,"strong"),t._uU(23,"Qty"),t.qZA(),t.TgZ(24,"span",54),t._uU(25),t.ALo(26,"number"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(27,"div",58),t.TgZ(28,"div"),t.TgZ(29,"strong"),t._uU(30,"Gross Purchase"),t.qZA(),t.TgZ(31,"span",54),t._uU(32),t.ALo(33,"number"),t.qZA(),t.qZA(),t.TgZ(34,"div"),t.TgZ(35,"strong"),t._uU(36,"Discount"),t.qZA(),t.TgZ(37,"span",54),t._uU(38),t.ALo(39,"number"),t.qZA(),t.qZA(),t.TgZ(40,"div"),t.TgZ(41,"strong"),t._uU(42,"Tax Incl."),t.qZA(),t.TgZ(43,"span",54),t._uU(44),t.ALo(45,"number"),t.qZA(),t.qZA(),t.TgZ(46,"div"),t.TgZ(47,"strong"),t._uU(48,"Net Purchase"),t.qZA(),t.TgZ(49,"span",54),t._uU(50),t.ALo(51,"number"),t.qZA(),t.qZA(),t.YNc(52,m_,10,8,"div",33),t.YNc(53,Z_,12,8,"div",33),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(6),t.Oqu(t.xi3(7,10,e.data.Aggregate.TaxAdd,".0-0")),t.xp6(6),t.Oqu(t.xi3(13,13,e.data.Aggregate.SalesWithTax,".0-0")),t.xp6(7),t.Oqu(t.xi3(20,16,e.data.Aggregate.TotalTransaction,".0-0")),t.xp6(6),t.Oqu(t.xi3(26,19,e.data.Aggregate.UnitQuantity,".0-0")),t.xp6(7),t.Oqu(t.xi3(33,22,e.data.Aggregate.Gross,".0-0")),t.xp6(6),t.Oqu(t.xi3(39,25,e.data.Aggregate.Discount,".0-0")),t.xp6(6),t.Oqu(t.xi3(45,28,e.data.Aggregate.TaxInclude,".0-0")),t.xp6(6),t.Oqu(t.xi3(51,31,e.data.Aggregate.NetSales,".0-0")),t.xp6(2),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",e.pageData.HasRoleCost)}}function x_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,r_,3,0,"a",2),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",3),t.TgZ(5,"div",4),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Outlet"),t.qZA(),t.TgZ(9,"ng-select",5),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Category"),t.qZA(),t.TgZ(13,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Supplier"),t.qZA(),t.TgZ(17,"autocompleteV2",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SupplierID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"From/To"),t.qZA(),t.TgZ(21,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(22,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(23,"div"),t.TgZ(24,"h6"),t._uU(25,"Currency"),t.qZA(),t.TgZ(26,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(27,"div"),t.TgZ(28,"h6"),t._uU(29,"Sort"),t.qZA(),t.TgZ(30,"radio-options",11),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.IsDesc=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(31,"content"),t.TgZ(32,"div",12),t.TgZ(33,"table",13),t.TgZ(34,"thead",14),t.TgZ(35,"tr"),t.TgZ(36,"th",15),t._uU(37,"Name"),t.qZA(),t.TgZ(38,"th",16),t._uU(39,"Code"),t.qZA(),t.TgZ(40,"th",17),t._uU(41,"Qty"),t.qZA(),t.TgZ(42,"th",18),t._uU(43,"UOM"),t.qZA(),t.YNc(44,i_,2,1,"th",19),t.TgZ(45,"th",20),t._uU(46,"%"),t.qZA(),t.YNc(47,l_,2,1,"th",21),t.qZA(),t.qZA(),t.TgZ(48,"tbody"),t.TgZ(49,"tr"),t.TgZ(50,"td",22),t.YNc(51,d_,25,24,"div",23),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.YNc(52,h_,54,34,"div",24),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.pageData.IsExport),t.xp6(7),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SupplierID),t.xp6(4),t.Q6J("isFloatingLabel",!1)("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("isFloatingLabel",!1)("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",e.pageData.Options.Currencies),t.xp6(4),t.Q6J("model",e.pageData.Filter.IsDesc)("options",e.AscDscRadio),t.xp6(14),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(3),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(3),t.uIk("colspan",e.pageData.HasRoleCost?8:6),t.xp6(1),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.Data.length>0)}}let T_=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/GetPurchaseTransactionDetail","ReportLoader/GetPurchaseTransactionDetail"),this.httpService=e,this.csvConverter=o,this.datePipe=a,this.AscDscRadio=[{Key:!1,Value:"Asc"},{Key:!0,Value:"Desc"}]}preGetList(){null===this.pageData.Filter.EntityID&&(this.pageData.Filter.EntityID=x.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")?`Purchases Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d")}`:`Purchases Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`,this.pageData.Filter.From==this.pageData.Filter.To?this.menuData.H=`Purchases 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 n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(s.uU))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-detail"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",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","width","215","appearance","outline","name","From",3,"isFloatingLabel","date","dateChange"],["placeholder","To","width","215","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","645px"],[2,"width","75px"],[1,"text-right",2,"width","30px"],[1,"font-italic","small",2,"width","40px"],["class","text-right","style","width: 80px",4,"ngIf"],[1,"red",2,"width","30px"],["class","text-right","style","width: 150px",4,"ngIf"],[1,"px-0"],[4,"ngFor","ngForOf"],["class","row justify-content-end",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[1,"text-right",2,"width","80px"],[1,"text-right",2,"width","150px"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"mr-auto","d-sm-block","mt-2","mb-2"],[1,"h5","text-primary","font-weight-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ml-3"],[4,"ngIf"],["class","h5 text-primary font-weight-bold",3,"routerLink","queryParams",4,"ngIf"],[1,"d-block"],[1,"text-danger","ml-3"],[1,"d-lg-block","mt-2","mr-5","font-weight-bold","font-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"],[2,"width","600px"],[1,"font-weight-normal",2,"width","75px"],[1,"font-weight-normal","text-right",2,"width","30px"],["class","font-weight-normal text-right","style","width: 80px",4,"ngIf"],[1,"font-weight-normal","text-right","text-danger",2,"width","30px"],["class","font-weight-normal text-right","style","width: 140px",4,"ngIf"],[1,"font-weight-normal","text-right",2,"width","80px"],[1,"font-weight-normal","text-right",2,"width","140px"],[1,"table","table-sm","table-borderless"],[1,"grid_footer"],["colspan","2",1,"text-right"],[1,"text-right"],[1,"text-right","d-flex","justify-content-end","font-weight-bold"],["cellpadding","0","cellspacing","0",3,"innerHTML"],[1,"row","justify-content-end"],[1,"zebra","col-auto"],[1,"Percentage"]],template:function(e,o){1&e&&t.YNc(0,x_,53,21,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data&&o.pageData)},directives:[s.O5,d.p,c.w9,p.JJ,p.On,D.J,C.QB,q.P,s.sg,u.yS],pipes:[s.uU,T.qU,s.JJ],styles:[""]}),n})();function C_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",31),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.exportCSV(a.csvConverter,"ReportExport/ReportPurchaseSummary","Purchase Summary.csv")}),t._UZ(1,"i",32),t._uU(2,"Export"),t.qZA()}}function f_(n,i){1&n&&t._UZ(0,"br")}const lt=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},st=function(n){return{ID:n}};function A_(n,i){if(1&n&&(t.TgZ(0,"a",33),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("routerLink",t.DdM(3,lt))("queryParams",t.VKq(4,st,e.SupplierPOID)),t.xp6(1),t.Oqu(e.PONumber)}}function q_(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"a",33),t._uU(5),t.qZA(),t.YNc(6,f_,1,0,"br",34),t.YNc(7,A_,2,6,"a",35),t.qZA(),t.TgZ(8,"td"),t._uU(9),t.ALo(10,"date"),t.qZA(),t.TgZ(11,"td"),t._uU(12),t.qZA(),t.TgZ(13,"td",27),t._uU(14),t.ALo(15,"number"),t.qZA(),t.TgZ(16,"td",27),t._uU(17),t.ALo(18,"number"),t.qZA(),t.TgZ(19,"td",27),t._uU(20),t.ALo(21,"number"),t.qZA(),t.TgZ(22,"td",27),t._uU(23),t.ALo(24,"number"),t.qZA(),t.TgZ(25,"td",27),t._uU(26),t.ALo(27,"number"),t.qZA(),t.TgZ(28,"td"),t._uU(29),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.EntityName),t.xp6(2),t.Q6J("routerLink",t.DdM(27,lt))("queryParams",t.VKq(28,st,e.ID)),t.xp6(1),t.Oqu(e.Number),t.xp6(1),t.Q6J("ngIf",o.pageData.DualNumber),t.xp6(1),t.Q6J("ngIf",o.pageData.DualNumber),t.xp6(2),t.Oqu(t.xi3(10,14,e.Date,"dd MMM yyyy")),t.xp6(3),t.Oqu(e.SupplierNameDisplay),t.xp6(2),t.Oqu(t.lcZ(15,17,e.TotalItemQuantity)),t.xp6(3),t.Oqu(t.lcZ(18,19,e.Sales)),t.xp6(3),t.Oqu(t.lcZ(21,21,e.Tax)),t.xp6(3),t.Oqu(t.lcZ(24,23,e.TotalAmount)),t.xp6(3),t.Oqu(t.lcZ(27,25,e.PaymentAmount)),t.xp6(3),t.Oqu(e.PaymentStateLabel)}}function D_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("textChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Number=a})("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,C_,3,0,"a",2),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",3),t.TgZ(5,"div",4),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Outlet"),t.qZA(),t.TgZ(9,"ng-select",5),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"From/To"),t.qZA(),t.TgZ(13,"datepicker",6),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(14,"datepicker",7),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(15,"div"),t.TgZ(16,"h6"),t._uU(17,"Payment"),t.qZA(),t.TgZ(18,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.StateID=a}),t.qZA(),t.qZA(),t.TgZ(19,"div"),t.TgZ(20,"h6"),t._uU(21,"Supplier"),t.qZA(),t.TgZ(22,"autocompleteV2",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SupplierID=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(23,"content"),t.TgZ(24,"div",10),t.TgZ(25,"table",11),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(26,"thead",12),t.TgZ(27,"tr"),t.TgZ(28,"th",13),t._uU(29,"Outlet"),t.qZA(),t.TgZ(30,"th",14),t._uU(31,"Number"),t.qZA(),t.TgZ(32,"th",15),t._uU(33,"Date"),t.qZA(),t.TgZ(34,"th",16),t._uU(35,"Supplier "),t.qZA(),t.TgZ(36,"th",17),t._uU(37,"Qty"),t.qZA(),t.TgZ(38,"th",18),t._uU(39,"Purchase"),t.qZA(),t.TgZ(40,"th",19),t._uU(41,"Tax"),t.qZA(),t.TgZ(42,"th",20),t._uU(43,"Total Amount"),t.qZA(),t.TgZ(44,"th",21),t._uU(45,"Payment"),t.qZA(),t.TgZ(46,"th",22),t._uU(47,"State"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(48,"tbody"),t.YNc(49,q_,30,30,"tr",23),t.qZA(),t.TgZ(50,"tfoot"),t.TgZ(51,"tr",24),t._UZ(52,"td",25),t.TgZ(53,"td",26),t._uU(54,"Total:"),t.qZA(),t.TgZ(55,"td",27),t._uU(56),t.ALo(57,"number"),t.ALo(58,"sum"),t.qZA(),t.TgZ(59,"td",27),t._uU(60),t.ALo(61,"number"),t.ALo(62,"sum"),t.qZA(),t.TgZ(63,"td",27),t._uU(64),t.ALo(65,"number"),t.ALo(66,"sum"),t.qZA(),t.TgZ(67,"td",28),t._uU(68),t.ALo(69,"number"),t.ALo(70,"sum"),t.qZA(),t.TgZ(71,"td",29),t._uU(72),t.ALo(73,"number"),t.ALo(74,"sum"),t.qZA(),t._UZ(75,"td",30),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("text",e.pageData.Filter.Number),t.xp6(2),t.Q6J("ngIf",e.pageData.IsExport),t.xp6(7),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.StateID)("items",null==e.pageData.Options?null:e.pageData.Options.States),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SupplierID)("inputTextValue",e.contactDisplay),t.xp6(27),t.Q6J("ngForOf",e.data.Data),t.xp6(7),t.hij(" ",t.lcZ(57,17,t.xi3(58,19,e.data.Data,"TotalItemQuantity")),""),t.xp6(4),t.hij("",t.lcZ(61,22,t.xi3(62,24,e.data.Data,"Sales"))," "),t.xp6(4),t.hij("",t.lcZ(65,27,t.xi3(66,29,e.data.Data,"Tax"))," "),t.xp6(4),t.hij(" ",t.lcZ(69,32,t.xi3(70,34,e.data.Data,"TotalAmount")),""),t.xp6(4),t.hij(" ",t.lcZ(73,37,t.xi3(74,39,e.data.Data,"PaymentAmount")),"")}}let y_=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/ReportPurchaseSummary","ReportLoader/GetReportPurchaseSummary",null,a),this.httpService=e,this.csvConverter=o,this.url=a}preInitList(){x.gT.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null),x.gT.IsNotEmpty(this.pageData.Filter.SupplierID)&&(this.pageData.Filter.From=x.gT.MinDate),x.gT.IsNotEmpty(this.pageData.SupplierName)&&(this.contactDisplay=this.pageData.SupplierName)}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(a.EntityName=null==a.EntityName?"":a.EntityName,r.EntityName=null==r.EntityName?"":r.EntityName,a.SupplierNameDisplay=null==a.SupplierNameDisplay?"":a.SupplierNameDisplay,r.SupplierNameDisplay=null==r.SupplierNameDisplay?"":r.SupplierNameDisplay,e.active){case"EntityName":return this.compare(a.EntityName.toLocaleLowerCase(),r.EntityName.toLocaleLowerCase(),l);case"Number":return this.compare(a.Number,r.Number,l);case"Date":return this.compare(a.Date,r.Date,l);case"SupplierNameDisplay":return this.compare(a.SupplierNameDisplay.toLocaleLowerCase(),r.SupplierNameDisplay.toLocaleLowerCase(),l);case"TotalItemQuantity":return this.compare(a.TotalItemQuantity,r.TotalItemQuantity,l);case"Total":return this.compare(a.TotalAmount,r.TotalAmount,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"Tax":return this.compare(a.Tax,r.Tax,l);case"PaymentAmount":return this.compare(a.PaymentAmount,r.PaymentAmount,l);case"PaymentState":return this.compare(a.PaymentStateLabel,r.PaymentStateLabel,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-detail-summary"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","text","textChange","onSubmit",4,"ngIf"],[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",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"],["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"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light"],["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",1,"align-right",2,"width","70px"],["mat-sort-header","Sales",1,"align-right",2,"width","118px"],["mat-sort-header","Tax",1,"align-right",2,"width","118px"],["mat-sort-header","Total",1,"align-right",2,"width","118px"],["mat-sort-header","PaymentAmount",1,"align-right",2,"width","118px"],["mat-sort-header","PaymentState",2,"width","70px"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-right","empty-column"],[1,"text-right"],[1,"text-right","text-danger"],[1,"text-right","text-success"],[1,"empty-column"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[3,"routerLink","queryParams"],[4,"ngIf"],[3,"routerLink","queryParams",4,"ngIf"]],template:function(e,o){1&e&&t.YNc(0,D_,76,42,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data&&o.pageData)},directives:[s.O5,d.p,c.w9,p.JJ,p.On,C.QB,D.J,Z.YE,Z.nU,s.sg,u.yS],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function v_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",23),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.exportCSV(a.csvConverter,"ReportExport/TopPurchaseExport","Top_Supplier.csv")}),t._UZ(1,"i",24),t._uU(2,"Export"),t.qZA()}}const S_=function(){return["/menu/Contacts/Contact/Suppliers/Info"]},M_=function(n){return{ID:n}},b_=function(n,i,e){return{SupplierID:n,From:i,To:e}},J_=function(){return["/menu/Reports/Purchases_Report/Summary"]};function O_(n,i){if(1&n&&(t.TgZ(0,"tr",25),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",26),t.TgZ(4,"a",27),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"td",21),t._uU(7),t.qZA(),t.TgZ(8,"td",28),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",21),t.TgZ(12,"a",29),t.ALo(13,"date"),t.ALo(14,"date"),t._uU(15),t.ALo(16,"number"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=i.index,a=t.oxw(2);t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Q6J("routerLink",t.DdM(19,S_))("queryParams",t.VKq(20,M_,e.SupplierID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(10,9,e.Quantity)),t.xp6(3),t.Q6J("queryParams",t.kEZ(22,b_,e.SupplierID,t.xi3(13,11,a.pageData.Filter.From,"ddMMyyyy"),t.xi3(14,14,a.pageData.Filter.To,"ddMMyyyy")))("routerLink",t.DdM(26,J_)),t.xp6(3),t.Oqu(t.lcZ(16,17,e.Total))}}function I_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,v_,3,0,"a",2),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",3),t.TgZ(5,"div",4),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Outlet"),t.qZA(),t.TgZ(9,"ng-select",5),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Group"),t.qZA(),t.TgZ(13,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"From/To"),t.qZA(),t.TgZ(17,"datepicker",7),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(18,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(19,"div"),t.TgZ(20,"h6"),t._uU(21,"Row Count"),t.qZA(),t.TgZ(22,"input",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(23,"content"),t.TgZ(24,"div",10),t.TgZ(25,"table",11),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(26,"thead",12),t.TgZ(27,"tr"),t.TgZ(28,"th",13),t._uU(29,"Rank"),t.qZA(),t.TgZ(30,"th",14),t._uU(31,"Supplier"),t.qZA(),t.TgZ(32,"th",15),t._uU(33,"Code"),t.qZA(),t.TgZ(34,"th",16),t._uU(35,"Quantity"),t.qZA(),t.TgZ(36,"th",17),t._uU(37,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(38,"tbody"),t.YNc(39,O_,17,27,"tr",18),t.qZA(),t.TgZ(40,"tfoot"),t.TgZ(41,"tr",19),t._UZ(42,"th",20),t.TgZ(43,"th",21),t._uU(44,"Total Quantity"),t.qZA(),t.TgZ(45,"th",21),t._uU(46,"Total Purchase"),t.qZA(),t.qZA(),t.TgZ(47,"tr"),t._UZ(48,"td",22),t.TgZ(49,"td",21),t._uU(50),t.qZA(),t.TgZ(51,"td",21),t._uU(52),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.pageData.HasRoleExport),t.xp6(7),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.GroupID)("items",null==e.pageData.Options?null:e.pageData.Options.Group),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount),t.xp6(17),t.Q6J("ngForOf",e.data.Data),t.xp6(11),t.Oqu(e.data.TotalQty),t.xp6(2),t.Oqu(e.data.TotalSales)}}let U_=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/TopSupplier","ReportLoader/TopSupplierLoader"),this.httpService=e,this.csvConverter=o}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Name":return this.compare(a.Name,r.Name,l);case"Code":return this.compare(a.Code,r.Code,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Total":return this.compare(a.Total,r.Total,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-top-supplier"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary",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",3,"date","dateChange"],["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"],[2,"width","35px"],["mat-sort-header","Name"],["mat-sort-header","Code",2,"width","80px"],["mat-sort-header","Quantity",1,"align-right",2,"width","120px"],["mat-sort-header","Total",1,"align-right",2,"width","120px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"thead-light"],["colspan","3",1,"bg-white","border-bottom-0"],[1,"text-right"],["colspan","3",1,"bg-white","border-top-0"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[1,"border-bottom"],[1,"text-left"],[3,"routerLink","queryParams"],[1,"text-right","text-success"],[3,"queryParams","routerLink"]],template:function(e,o){1&e&&t.YNc(0,I_,53,14,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data&&o.pageData)},directives:[s.O5,d.p,c.w9,p.JJ,p.On,C.QB,p.Fj,M.b,Z.YE,Z.nU,s.sg,u.yS],pipes:[s.JJ,s.uU],styles:[""]}),n})();function F_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",21),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.exportCSV(a.csvConverter,"ReportExport/PurchasesByProductExport","Purchases_By_Product.csv")}),t._UZ(1,"i",22),t._uU(2,"Export"),t.qZA()}}const w_=function(n){return{"pl-lg-12":n}},N_=function(n){return[n]},P_=function(n){return{ID:n}};function L_(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td",23),t.TgZ(2,"a",24),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td",20),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",20),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",20),t._uU(13),t.ALo(14,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngClass",t.VKq(14,w_,!e.IsParent)),t.xp6(1),t.Q6J("routerLink",t.VKq(16,N_,e.IsParent?"/menu/Products/Catalog/Categories/Info":o.pageData.Filter.GroupByProduct?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",t.VKq(18,P_,e.IsParent?e.CategoryID:e.ID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(8,8,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(11,10,e.Total)),t.xp6(3),t.Oqu(t.lcZ(14,12,e.LastPurchase))}}function Q_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("textChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Text=a})("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,F_,3,0,"a",2),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",3),t.TgZ(5,"div",4),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Category"),t.qZA(),t.TgZ(9,"ng-select",5),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Currency"),t.qZA(),t.TgZ(13,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"From/To"),t.qZA(),t.TgZ(17,"datepicker",7),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(18,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(19,"div"),t.TgZ(20,"h6"),t._uU(21,"Group By"),t.qZA(),t.TgZ(22,"radio-options",9),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupByProduct=a}),t.qZA(),t.qZA(),t.TgZ(23,"div"),t.TgZ(24,"h6"),t._uU(25,"Brand"),t.qZA(),t.TgZ(26,"autocompleteV2",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.BrandID=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(27,"content"),t.TgZ(28,"div",11),t.TgZ(29,"table",12),t.TgZ(30,"thead",13),t.TgZ(31,"tr"),t.TgZ(32,"th"),t._uU(33,"Name"),t.qZA(),t.TgZ(34,"th",14),t._uU(35,"Code"),t.qZA(),t.TgZ(36,"th",15),t._uU(37,"Quantity"),t.qZA(),t.TgZ(38,"th",16),t._uU(39,"Total"),t.qZA(),t.TgZ(40,"th",15),t._uU(41,"Last Purchase"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(42,"tbody"),t.YNc(43,L_,15,20,"tr",17),t.qZA(),t.TgZ(44,"tfoot"),t.TgZ(45,"tr",18),t._UZ(46,"td",19),t.TgZ(47,"td"),t._uU(48,"Total :"),t.qZA(),t.TgZ(49,"td",20),t._uU(50),t.ALo(51,"number"),t.ALo(52,"sum"),t.qZA(),t.TgZ(53,"td",20),t._uU(54),t.ALo(55,"number"),t.ALo(56,"sum"),t.qZA(),t._UZ(57,"td"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("text",e.pageData.Filter.Text),t.xp6(2),t.Q6J("ngIf",e.pageData.HasExportRole),t.xp6(7),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("model",e.pageData.Filter.GroupByProduct)("options",e.GroupByRadio),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.BrandID),t.xp6(17),t.Q6J("ngForOf",e.data),t.xp6(7),t.hij(" ",t.lcZ(51,15,t.xi3(52,17,e.filterData(e.data,"IsParent",!0),"Quantity"))," "),t.xp6(4),t.hij(" ",t.lcZ(55,20,t.xi3(56,22,e.filterData(e.data,"IsParent",!0),"Total"))," ")}}let Y_=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/PurchasesByProductList","ReportLoader/PurchasesByProductLoader"),this.httpService=e,this.csvConverter=o,this.GroupByRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}]}filterData(e,o,a){return e.filter(function(r){return r[o]==a})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-product-bought"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","text","textChange","onSubmit",4,"ngIf"],[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary",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"],["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"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","100px"],[1,"text-right",2,"width","120px"],[1,"text-right",2,"width","140px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-right"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[3,"ngClass"],[3,"routerLink","queryParams"]],template:function(e,o){1&e&&t.YNc(0,Q_,58,25,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data&&o.pageData)},directives:[s.O5,d.p,c.w9,p.JJ,p.On,C.QB,q.P,D.J,s.sg,s.mk,u.yS],pipes:[s.JJ,T.qU],styles:[""]}),n})();function R_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",8),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.convertToCSV(a.csvConverter,!0,"PurchaseHistory.csv")}),t._UZ(1,"i",9),t._uU(2,"Export"),t.qZA()}}function k_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Product"),t.qZA(),t.TgZ(3,"autocompleteV2",17),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ProductID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.ProductID)("inputTextValue",e.pageData.ProductName)}}function E_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Variant"),t.qZA(),t.TgZ(3,"autocompleteV2",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.VariantID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.VariantID)("inputTextValue",e.pageData.VariantName)}}function H_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",10),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Supplier"),t.qZA(),t.TgZ(8,"autocompleteV2",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SupplierID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Scope"),t.qZA(),t.TgZ(12,"radio-options",13),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ByProduct=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.YNc(13,k_,4,2,"div",14),t.YNc(14,E_,4,2,"div",14),t.TgZ(15,"div"),t.TgZ(16,"h6"),t._uU(17,"From/To"),t.qZA(),t.TgZ(18,"datepicker",15),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(19,"datepicker",16),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SupplierID),t.xp6(4),t.Q6J("model",e.pageData.Filter.ByProduct)("options",e.ScopeRadio),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.ByProduct),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.ByProduct),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function V_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",19),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Order By"),t.qZA(),t.TgZ(4,"radio-options",20),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.OrderByNumber=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Currency"),t.qZA(),t.TgZ(8,"ng-select",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Brand"),t.qZA(),t.TgZ(12,"autocompleteV2",22),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.BrandID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("model",e.pageData.Filter.OrderByNumber)("options",e.OrderByRadio),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.BrandID)}}function B_(n,i){1&n&&(t.TgZ(0,"th"),t._uU(1,"Product"),t.qZA())}function G_(n,i){1&n&&(t.TgZ(0,"th"),t._uU(1,"Variant"),t.qZA())}function j_(n,i){1&n&&(t.TgZ(0,"th",40),t._uU(1," Measurement"),t.qZA())}function W_(n,i){1&n&&(t.TgZ(0,"th",41),t._uU(1,"Cost"),t.qZA())}function $_(n,i){if(1&n&&(t.TgZ(0,"th",42),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" Total(",e.data.CurrencySymbol,")")}}function K_(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.VariantUnitQuantity),"")}}function X_(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.UnitPrice))}}function z_(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Total))}}const tu=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},eu=function(n){return{ID:n}};function nu(n,i){if(1&n&&(t.TgZ(0,"tr",43),t.TgZ(1,"td"),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td"),t.TgZ(7,"a",44),t._uU(8),t.qZA(),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.qZA(),t.TgZ(11,"td"),t._uU(12),t.qZA(),t.TgZ(13,"td"),t._uU(14),t.qZA(),t._UZ(15,"td",45),t.TgZ(16,"td",38),t._uU(17),t.ALo(18,"number"),t.qZA(),t.YNc(19,K_,3,3,"td",39),t.YNc(20,X_,3,3,"td",39),t.TgZ(21,"td",38),t._uU(22),t.qZA(),t.TgZ(23,"td",38),t._uU(24),t.qZA(),t.YNc(25,z_,3,3,"td",39),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(t.xi3(3,15,e.Date,"dd MMM yyyy")),t.xp6(3),t.Oqu(e.EntityName),t.xp6(2),t.Q6J("routerLink",t.DdM(20,tu))("queryParams",t.VKq(21,eu,e.ID)),t.xp6(1),t.hij(" ",e.Number," "),t.xp6(2),t.Oqu(e.DeliveryStatus),t.xp6(2),t.Oqu(e.SupplierName),t.xp6(2),t.Oqu(e.Name),t.xp6(1),t.Q6J("innerHTML",e.Note,t.oJD),t.xp6(2),t.Oqu(t.lcZ(18,18,e.Quantity)),t.xp6(2),t.Q6J("ngIf",(null==e||null==e.Data?null:e.Data.VariantQuantity)>1),t.xp6(1),t.Q6J("ngIf",o.pageData.HasCostRole),t.xp6(2),t.Oqu(e.Discount>0?e.Discount:""),t.xp6(2),t.Oqu(e.DiscountInvoice>0?e.DiscountInvoice:""),t.xp6(1),t.Q6J("ngIf",o.pageData.HasCostRole)}}function au(n,i){1&n&&t._UZ(0,"td",37)}function ou(n,i){1&n&&t._UZ(0,"td",37)}function ru(n,i){1&n&&t._UZ(0,"td",37)}function iu(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Total")),"")}}function lu(n,i){if(1&n&&(t.TgZ(0,"div",23),t.TgZ(1,"table",24),t.TgZ(2,"thead",25),t.TgZ(3,"tr"),t.TgZ(4,"th",26),t._uU(5,"Date"),t.qZA(),t.TgZ(6,"th",27),t._uU(7,"Outlet"),t.qZA(),t.TgZ(8,"th",28),t._uU(9,"Invoice"),t.qZA(),t.TgZ(10,"th",27),t._uU(11,"Deliv. State"),t.qZA(),t.TgZ(12,"th"),t._uU(13,"Supplier"),t.qZA(),t.YNc(14,B_,2,0,"th",14),t.YNc(15,G_,2,0,"th",14),t.TgZ(16,"th"),t._uU(17,"Product Note "),t._UZ(18,"br"),t.TgZ(19,"i"),t._uU(20,"Invoice Note"),t.qZA(),t.qZA(),t.TgZ(21,"th",29),t._uU(22,"Qty"),t.qZA(),t.YNc(23,j_,2,0,"th",30),t.YNc(24,W_,2,0,"th",31),t.TgZ(25,"th",29),t._uU(26,"Item(%)"),t.qZA(),t.TgZ(27,"th",29),t._uU(28,"inv(%)"),t.qZA(),t.YNc(29,$_,2,1,"th",32),t.qZA(),t.qZA(),t.TgZ(30,"tbody"),t.YNc(31,nu,26,23,"tr",33),t.qZA(),t.TgZ(32,"tfoot"),t.TgZ(33,"tr",34),t._UZ(34,"td",35),t.YNc(35,au,1,0,"td",36),t._UZ(36,"td",37),t.TgZ(37,"td",38),t._uU(38,"Total :"),t.qZA(),t.TgZ(39,"td",38),t._uU(40),t.ALo(41,"number"),t.ALo(42,"sum"),t.qZA(),t.YNc(43,ou,1,0,"td",36),t.YNc(44,ru,1,0,"td",36),t._UZ(45,"td",37),t._UZ(46,"td",37),t.YNc(47,iu,4,6,"td",39),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(14),t.Q6J("ngIf",e.pageData.Filter.ByProduct),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.ByProduct),t.xp6(8),t.Q6J("ngIf",(null==e.data||null==e.data.Data?null:e.data.Data.VariantQuantity)>1),t.xp6(1),t.Q6J("ngIf",e.pageData.HasCostRole),t.xp6(5),t.Q6J("ngIf",e.pageData.HasCostRole),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(4),t.Q6J("ngIf",!e.pageData.Filter.ByProduct),t.xp6(5),t.Oqu(t.lcZ(41,11,t.xi3(42,13,e.data.Data,"Quantity"))),t.xp6(3),t.Q6J("ngIf",e.pageData.HasCostRole),t.xp6(1),t.Q6J("ngIf",(null==e.data||null==e.data.Data?null:e.data.Data.VariantQuantity)>1),t.xp6(3),t.Q6J("ngIf",e.pageData.HasCostRole)}}let su=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/ProductPurchaseHistory","ReportLoader/ProductPurchaseHistoryLoader",null,a),this.httpService=e,this.csvConverter=o,this.ScopeRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}],this.OrderByRadio=[{Key:!0,Value:"Number"},{Key:!1,Value:"Supplier"}],this.hideMore=!0}preInitList(){x.gT.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-product-purchase-history"]],features:[t.qOj],decls:12,vars:6,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","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"],["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,"ml-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"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","100px"],[2,"width","80px"],[2,"width","70px"],[1,"text-right",2,"width","50px"],["style","width: 60px;","class","text-right",4,"ngIf"],["style","width: 75px;","class","text-right",4,"ngIf"],["style","width: 80px;","class","text-right",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","4",1,"empty-column"],["class","empty-column",4,"ngIf"],[1,"empty-column"],[1,"text-right"],["class","text-right",4,"ngIf"],[1,"text-right",2,"width","60px"],[1,"text-right",2,"width","75px"],[1,"text-right",2,"width","80px"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"innerHTML"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,R_,3,0,"a",1),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",2),t.YNc(5,H_,20,9,"div",3),t.YNc(6,V_,13,5,"div",4),t.qZA(),t.TgZ(7,"a",5),t.NdJ("click",function(){return o.hideMore=!o.hideMore}),t._uU(8,"More "),t._UZ(9,"i",6),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,lu,48,16,"div",7),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasExportRole),t.xp6(3),t.Q6J("ngIf",o.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!o.hideMore),t.xp6(5),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,D.J,q.P,C.QB,s.sg,u.yS],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function pu(n,i){if(1&n&&(t.TgZ(0,"tr",19),t.TgZ(1,"td"),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"td",16),t._uU(5),t.ALo(6,"number"),t.qZA(),t.TgZ(7,"td",16),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"td",16),t._uU(11),t.ALo(12,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(t.xi3(3,4,e.Date,"EEEE")),t.xp6(3),t.Oqu(t.lcZ(6,7,e.Day)),t.xp6(3),t.Oqu(t.lcZ(9,9,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(12,11,e.PurchaseTotal))}}const _u=function(){return["/menu/Reports/Purchases_Report/Daily_Purchase/Monthly_Purchase"]};function uu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",2),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/DailyPurchaseReport","DailyPurchaseReport.csv")}),t._UZ(3,"i",3),t._uU(4," Export "),t.qZA(),t.TgZ(5,"a",4),t._uU(6,"View Month"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",5),t.TgZ(9,"div",6),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Outlet"),t.qZA(),t.TgZ(13,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Category"),t.qZA(),t.TgZ(17,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Year"),t.qZA(),t.TgZ(21,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(22,"div"),t.TgZ(23,"h6"),t._uU(24,"Month"),t.qZA(),t.TgZ(25,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Month=a}),t.qZA(),t.qZA(),t.TgZ(26,"div"),t.TgZ(27,"h6"),t._uU(28,"Currency"),t.qZA(),t.TgZ(29,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(30,"div"),t.TgZ(31,"h6"),t._uU(32,"Multiply Unit Qty"),t.qZA(),t.TgZ(33,"radio-options",12),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.MultiplyUnitQuantity=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(34,"content"),t.TgZ(35,"div",13),t.TgZ(36,"table",14),t.TgZ(37,"thead",15),t.TgZ(38,"tr"),t.TgZ(39,"th"),t._uU(40,"Day"),t.qZA(),t.TgZ(41,"th",16),t._uU(42,"Dt."),t.qZA(),t.TgZ(43,"th",16),t._uU(44,"Quantity"),t.qZA(),t.TgZ(45,"th",16),t._uU(46,"Purchases"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(47,"tbody"),t.YNc(48,pu,13,13,"tr",17),t.qZA(),t.TgZ(49,"tr"),t.TgZ(50,"td",18),t._uU(51,"Total"),t.qZA(),t.TgZ(52,"td",16),t._uU(53),t.ALo(54,"number"),t.ALo(55,"sum"),t.qZA(),t.TgZ(56,"td",16),t._uU(57),t.ALo(58,"number"),t.ALo(59,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(5),t.Q6J("routerLink",t.DdM(29,_u)),t.xp6(8),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",e.pageData.Options.Currencies),t.xp6(4),t.Q6J("model",e.pageData.Filter.MultiplyUnitQuantity)("options",e.YesNoRadio),t.xp6(15),t.Q6J("ngForOf",e.data),t.xp6(5),t.Oqu(t.lcZ(54,19,t.xi3(55,21,e.data,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(58,24,t.xi3(59,26,e.data,"PurchaseTotal")))}}let gu=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetPurchasePeriodDaily","ReportLoader/GetReportPurchaseDaily"),this.httpService=e,this.csvConverter=o,this.Years=[],this.Months=[],this.YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];const a=new Date;this.Years=x.gT.GenerateYears(a.getFullYear(),11,!0),this.Months=x.gT.Months}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-daily-purchases"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","value","Export","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],["role","button","title","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","w-25"],[1,"thead-light"],[1,"text-right"],["class","border-bottom",4,"ngFor","ngForOf"],["colspan","2",1,"text-right"],[1,"border-bottom"]],template:function(e,o){1&e&&t.YNc(0,uu,60,30,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data&&o.pageData)},directives:[s.O5,d.p,u.yS,c.w9,p.JJ,p.On,q.P,s.sg],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function du(n,i){if(1&n&&(t.TgZ(0,"tr",20),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",16),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",16),t._uU(7),t.ALo(8,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.MonthLabel),t.xp6(2),t.Oqu(t.lcZ(5,3,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(8,5,e.Income))}}const mu=function(){return["/menu/Reports/Purchases_Report/Daily_Purchase"]};function Zu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",2),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/MonthlyPurchaseReport","DailyPurchaseReport.csv")}),t._UZ(3,"i",3),t._uU(4," Export "),t.qZA(),t.TgZ(5,"a",4),t._uU(6,"View Daily"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",5),t.TgZ(9,"div",6),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Outlet"),t.qZA(),t.TgZ(13,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Category"),t.qZA(),t.TgZ(17,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Year"),t.qZA(),t.TgZ(21,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(22,"div"),t.TgZ(23,"h6"),t._uU(24,"Currency"),t.qZA(),t.TgZ(25,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(26,"div"),t.TgZ(27,"h6"),t._uU(28,"Multiply Unit Qty"),t.qZA(),t.TgZ(29,"radio-options",11),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.MultiplyUnitQuantity=a}),t.qZA(),t.qZA(),t.TgZ(30,"div"),t.TgZ(31,"h6"),t._uU(32,"Supplier"),t.qZA(),t.TgZ(33,"autocompleteV2",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SupplierID=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(34,"content"),t.TgZ(35,"div",13),t.TgZ(36,"table",14),t.TgZ(37,"thead",15),t.TgZ(38,"tr"),t.TgZ(39,"th"),t._uU(40,"Month"),t.qZA(),t.TgZ(41,"th",16),t._uU(42,"Quantity"),t.qZA(),t.TgZ(43,"th",16),t._uU(44,"Purchases"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(45,"tbody"),t.YNc(46,du,9,7,"tr",17),t.qZA(),t.TgZ(47,"tr",18),t.TgZ(48,"td",19),t._uU(49,"Total"),t.qZA(),t.TgZ(50,"td",16),t._uU(51),t.ALo(52,"number"),t.ALo(53,"sum"),t.qZA(),t.TgZ(54,"td",16),t._uU(55),t.ALo(56,"number"),t.ALo(57,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(5),t.Q6J("routerLink",t.DdM(27,mu)),t.xp6(8),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",e.pageData.Options.Currencies),t.xp6(4),t.Q6J("model",e.pageData.Filter.MultiplyUnitQuantity)("options",e.YesNoRadio),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SupplierID),t.xp6(13),t.Q6J("ngForOf",e.data),t.xp6(5),t.Oqu(t.lcZ(52,17,t.xi3(53,19,e.data,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(56,22,t.xi3(57,24,e.data,"Income")))}}let hu=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetPurchasePeriodMonthly","ReportLoader/GetReportPurchaseMonthly"),this.httpService=e,this.csvConverter=o,this.Years=[],this.YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];const a=new Date;this.Years=x.gT.GenerateYears(a.getFullYear(),11,!0)}preGetList(){null===this.pageData.Filter.EntityID&&(this.pageData.Filter.EntityID=x.gT.GuidEmpty)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-monthly-purchase"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","value","Export","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],["role","button","title","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"],[1,"text-right"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","1",1,"text-right"],[1,"border-bottom"]],template:function(e,o){1&e&&t.YNc(0,Zu,58,28,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data&&o.pageData)},directives:[s.O5,d.p,u.yS,c.w9,p.JJ,p.On,q.P,D.J,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function xu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t._UZ(1,"actions"),t.TgZ(2,"filters"),t.TgZ(3,"div",2),t.TgZ(4,"div",3),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Outlet"),t.qZA(),t.TgZ(8,"ng-select",4),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Category"),t.qZA(),t.TgZ(12,"ng-select",5),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.TgZ(13,"div"),t.TgZ(14,"h6"),t._uU(15,"Year"),t.qZA(),t.TgZ(16,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(17,"content"),t.TgZ(18,"div",7),t._UZ(19,"POS-line-chart",8),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(8),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(3),t.Q6J("config",e.chartConfig)("data",e.ChartData)}}let Tu=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/MonthlyPurchasesVolume","ReportLoader/GetMonthlyPurchaseVolume"),this.httpService=e,this.Years=[],this.ChartData={};const a=new Date;this.Years=x.gT.GenerateYears(a.getFullYear(),11,!0)}preGetList(){null===this.pageData.Filter.EntityID&&(this.pageData.Filter.EntityID=x.gT.GuidEmpty)}preInitList(){this.pageData.Options.Currencies.unshift({ID:0,Symbol:"All"}),this.pageData.Filter.CurrencyID=0}postInit(){const e=[];this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}},this.data.MonthlySalesRank.forEach(o=>{e.push({name:o.Name,data:o.Sales})}),this.ChartData={series:e}}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-volume"]],features:[t.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(e,o){1&e&&t.YNc(0,xu,20,10,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data&&o.pageData)},directives:[s.O5,d.p,c.w9,p.JJ,p.On,J.D],styles:[""]}),n})();function Cu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",19),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.convertToCSV(a.csvConverter,!0,"Purchased_Sales_Report.csv")}),t._UZ(1,"i",20),t._uU(2,"Export"),t.qZA()}}function fu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year/Month"),t.qZA(),t.TgZ(3,"ng-select",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Period=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.Period)("items",null==e.pageData.Options?null:e.pageData.Options.Periods)}}function Au(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",22),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",23),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}const qu=function(){return["/menu/Products/Catalog/Products/Info"]},Du=function(n){return{ID:n}};function yu(n,i){if(1&n&&(t.TgZ(0,"tr",24),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"a",25),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.qZA(),t.TgZ(8,"td",26),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",26),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td",27),t._uU(15),t.ALo(16,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=i.index;t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Q6J("routerLink",t.DdM(14,qu))("queryParams",t.VKq(15,Du,e.ID)),t.xp6(1),t.hij(" ",e.Name," "),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(10,8,e.PurchaseQuantity)),t.xp6(3),t.Oqu(t.lcZ(13,10,e.SellQuantity)),t.xp6(3),t.Oqu(t.lcZ(16,12,e.Ratio))}}function vu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Cu,3,0,"a",2),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",3),t.TgZ(5,"div",4),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Outlet"),t.qZA(),t.TgZ(9,"ng-select",5),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Category"),t.qZA(),t.TgZ(13,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.YNc(14,fu,4,2,"div",7),t.YNc(15,Au,5,2,"div",7),t.TgZ(16,"div"),t.TgZ(17,"h6"),t._uU(18,"Row Count"),t.qZA(),t.TgZ(19,"input",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.TgZ(20,"div"),t.TgZ(21,"h6"),t._uU(22,"Date Filter"),t.qZA(),t.TgZ(23,"radio-options",9),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Predefined=a}),t.qZA(),t.TgZ(24,"h6"),t._uU(25,"Inventory Only"),t.qZA(),t.TgZ(26,"radio-options",10),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.InventoryOnly=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(27,"content"),t.TgZ(28,"div",11),t.TgZ(29,"table",12),t.TgZ(30,"thead",13),t.TgZ(31,"tr"),t.TgZ(32,"th",14),t._uU(33," Now "),t.qZA(),t.TgZ(34,"th",15),t._uU(35,"Name"),t.qZA(),t.TgZ(36,"th",16),t._uU(37,"Code"),t.qZA(),t.TgZ(38,"th",17),t._uU(39,"Purchase"),t.qZA(),t.TgZ(40,"th",17),t._uU(41,"Sold"),t.qZA(),t.TgZ(42,"th",17),t._uU(43,"Sold Percentage(%)"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(44,"tbody"),t.YNc(45,yu,17,17,"tr",18),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.pageData.HasExportRole),t.xp6(7),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.Predefined),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.Predefined),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount),t.xp6(4),t.Q6J("model",e.pageData.Filter.Predefined)("options",e.RadioDateFilterType),t.xp6(3),t.Q6J("model",e.pageData.Filter.InventoryOnly),t.xp6(19),t.Q6J("ngForOf",e.data.Data)}}let Su=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/PruchasedSalesReportList","ReportLoader/PurchaseSalesReportLoader"),this.httpService=e,this.csvConverter=o,this.RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Range"}],this.GroupRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}]}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-sales-report"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","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"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],[4,"ngIf"],["type","text","autoNum","",3,"ngModel","ngModelChange"],["name","Date Filter",3,"model","options","modelChange"],["name","Inventory",3,"model","modelChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light"],[2,"width","55px"],[2,"width","320px"],[2,"width","100px"],[1,"text-right",2,"width","80px"],["class","border-bottom",4,"ngFor","ngForOf"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"border-bottom"],[3,"routerLink","queryParams"],[1,"text-right"],[1,"text-right","text-success"]],template:function(e,o){1&e&&t.YNc(0,vu,46,14,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data&&o.pageData)},directives:[s.O5,d.p,c.w9,p.JJ,p.On,p.Fj,M.b,q.P,s.sg,C.QB,u.yS],pipes:[s.JJ],styles:[""]}),n})();function Mu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",31),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.exportCSV(a.csvConverter,"ReportExport/OutletPerformancePurchase","Purchases Transaction ["+a.pageData.Filter.From+" - "+a.pageData.Filter.To+"].csv")}),t._UZ(1,"i",32),t._uU(2,"Export"),t.qZA()}}function bu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Compare with prev Month"),t.qZA(),t.TgZ(3,"radio-options",33),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).Compare=a})("modelChange",function(){return t.CHM(e),t.oxw(2).OnCompare("Data")}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("model",e.Compare)}}function Ju(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",34),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",35),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Ou(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",36),t.TgZ(4,"div",37),t.TgZ(5,"ng-select",38),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Year=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA(),t.TgZ(6,"div",39),t.TgZ(7,"ng-select",40),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Month=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("ngModel",e.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.Month)("items",e.Months)}}function Iu(n,i){1&n&&(t.TgZ(0,"th",41),t._uU(1,"Prev"),t.qZA())}function Uu(n,i){1&n&&(t.TgZ(0,"th",41),t._uU(1,"Now"),t.qZA())}function Fu(n,i){1&n&&(t.TgZ(0,"th",42),t._uU(1,"Trans"),t.qZA())}function wu(n,i){if(1&n&&(t.TgZ(0,"th",43),t._uU(1,"Tax"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet")}}function Nu(n,i){if(1&n&&(t.TgZ(0,"th",43),t._uU(1," Purchase + Tax"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Pu(n,i){if(1&n&&(t.TgZ(0,"td",46),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.PrevIndex)}}const Lu=function(n,i){return{rankDown:n,rankUp:i,"number key":!0}};function Qu(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.qZA()),2&n){const e=t.oxw(),o=e.$implicit,a=e.index;t.Q6J("ngClass",t.WLB(2,Lu,o.PrevIndex<a+1,o.PrevIndex>a+1)),t.xp6(1),t.hij(" ",o.CurrentIndex," ")}}function Yu(n,i){if(1&n&&(t.TgZ(0,"td",30),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,e.Count,".0-0"))}}function Ru(n,i){if(1&n&&(t.TgZ(0,"td",30),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.Tax,".0-0"),"")}}const ku=function(n,i,e){return{EntityID:n,From:i,To:e}},Eu=function(){return["/menu/Reports/Purchases_Report/Summary"]};function Hu(n,i){if(1&n&&(t.TgZ(0,"td",30),t.TgZ(1,"a",48),t.ALo(2,"date"),t.ALo(3,"date"),t.TgZ(4,"b"),t._uU(5),t.ALo(6,"number"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("queryParams",t.kEZ(12,ku,e.EntityID,t.xi3(2,3,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(3,6,o.pageData.Filter.To,"ddMMyyyy")))("routerLink",t.DdM(16,Eu)),t.xp6(4),t.Oqu(t.xi3(6,9,e.SalesWithTax,".0-0"))}}function Vu(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",27),t._uU(4),t.qZA(),t.YNc(5,Pu,2,1,"td",44),t.YNc(6,Qu,2,5,"td",45),t.YNc(7,Yu,3,4,"td",29),t.TgZ(8,"td",30),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",30),t._uU(12),t.ALo(13,"number"),t.qZA(),t.YNc(14,Ru,3,4,"td",29),t.ALo(15,"HideSumZero"),t.YNc(16,Hu,7,17,"td",29),t.qZA()),2&n){const e=i.$implicit,o=i.index,a=t.oxw(2);t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Oqu(e.Name),t.xp6(1),t.Q6J("ngIf",a.Compare),t.xp6(1),t.Q6J("ngIf",a.Compare),t.xp6(1),t.Q6J("ngIf",!a.data.WithCategory),t.xp6(2),t.Oqu(t.xi3(10,9,e.Quantity,".0-0")),t.xp6(3),t.Oqu(t.xi3(13,12,e.Sales,".0-0")),t.xp6(2),t.Q6J("ngIf",!a.data.WithCategory&&t.xi3(15,15,a.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!a.data.WithCategory)}}function Bu(n,i){1&n&&t._UZ(0,"td",49)}function Gu(n,i){1&n&&t._UZ(0,"td",49)}function ju(n,i){if(1&n&&(t.TgZ(0,"td",30),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Count"),".0-0"),"")}}function Wu(n,i){if(1&n&&(t.TgZ(0,"td",30),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Tax"),".0-0")," ")}}function $u(n,i){if(1&n&&(t.TgZ(0,"td",30),t.TgZ(1,"a"),t._uU(2),t.ALo(3,"number"),t.ALo(4,"sum"),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(2),t.Oqu(t.xi3(3,1,t.xi3(4,4,e.data.Data,"SalesWithTax"),".0-0"))}}const Xu=function(){return["/menu/Reports/Purchases_Report/Outlet_Performance/Outlet_Group_Performance"]},tg=function(){return["/menu/Reports/Purchases_Report/Outlet_Performance/Outlet_Monthly_Perfomance"]};function eg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Mu,3,0,"a",2),t.TgZ(3,"div",3),t.TgZ(4,"a",4),t._uU(5,"By Entity Group"),t.qZA(),t._UZ(6,"button",5),t.TgZ(7,"ul",6),t.TgZ(8,"li",7),t.TgZ(9,"a",8),t._uU(10,"By Month"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",9),t.TgZ(13,"div",10),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Category"),t.qZA(),t.TgZ(17,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Type"),t.qZA(),t.TgZ(21,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(22,"div"),t.TgZ(23,"h6"),t._uU(24,"Date Filter"),t.qZA(),t.TgZ(25,"radio-options",13),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().IsPredefined=a})("modelChange",function(){return t.CHM(e),t.oxw().YearMonthToDateRange()}),t.qZA(),t.qZA(),t.YNc(26,bu,4,1,"div",14),t.YNc(27,Ju,5,2,"div",14),t.YNc(28,Ou,8,4,"div",14),t.TgZ(29,"div"),t.TgZ(30,"h6"),t._uU(31,"Exclude complementary"),t.qZA(),t.TgZ(32,"radio-options",15),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ExcludeComplementary=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(33,"content"),t.TgZ(34,"div",16),t.TgZ(35,"table",17),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(36,"thead",18),t.TgZ(37,"tr"),t.TgZ(38,"th"),t._uU(39,"No."),t.qZA(),t.TgZ(40,"th",19),t._uU(41,"Outlet"),t.qZA(),t.YNc(42,Iu,2,0,"th",20),t.YNc(43,Uu,2,0,"th",20),t.YNc(44,Fu,2,0,"th",21),t.TgZ(45,"th",22),t._uU(46,"Qty"),t.qZA(),t.TgZ(47,"th",23),t._uU(48,"Purchase"),t.qZA(),t.YNc(49,wu,2,1,"th",24),t.ALo(50,"HideSumZero"),t.YNc(51,Nu,2,1,"th",24),t.qZA(),t.qZA(),t.TgZ(52,"tbody"),t.YNc(53,Vu,17,18,"tr",25),t.qZA(),t.TgZ(54,"tfoot"),t.TgZ(55,"tr",26),t._UZ(56,"td"),t._UZ(57,"td",27),t.YNc(58,Bu,1,0,"td",28),t.YNc(59,Gu,1,0,"td",28),t.YNc(60,ju,4,7,"td",29),t.TgZ(61,"td",30),t._uU(62),t.ALo(63,"number"),t.ALo(64,"sum"),t.qZA(),t.TgZ(65,"td",30),t._uU(66),t.ALo(67,"number"),t.ALo(68,"sum"),t.qZA(),t.YNc(69,Wu,4,7,"td",29),t.ALo(70,"HideSumZero"),t.YNc(71,$u,5,7,"td",29),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(46,Xu)),t.xp6(5),t.Q6J("routerLink",t.DdM(47,tg)),t.xp6(8),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(4),t.Q6J("model",e.IsPredefined)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",e.IsPredefined),t.xp6(1),t.Q6J("ngIf",!e.IsPredefined),t.xp6(1),t.Q6J("ngIf",e.IsPredefined),t.xp6(4),t.Q6J("model",e.pageData.Filter.ExcludeComplementary),t.xp6(10),t.Q6J("ngIf",e.Compare),t.xp6(1),t.Q6J("ngIf",e.Compare),t.xp6(1),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(5),t.Q6J("ngIf",!e.data.WithCategory&&t.xi3(50,28,e.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Q6J("ngIf",e.Compare),t.xp6(1),t.Q6J("ngIf",e.Compare),t.xp6(1),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(2),t.Oqu(t.xi3(63,31,t.xi3(64,34,e.data.Data,"Quantity"),".0-0")),t.xp6(4),t.hij(" ",t.xi3(67,37,t.xi3(68,40,e.data.Data,"Sales"),".0-0")," "),t.xp6(3),t.Q6J("ngIf",!e.data.WithCategory&&t.xi3(70,43,e.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!e.data.WithCategory)}}let ng=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/OutletPerformancePurchase","ReportLoader/OutletPurchasePerformance"),this.httpService=e,this.csvConverter=o,this.Compare=!1,this.IsPredefined=!0,this.Comparison=0,this.RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];const a=new Date;this.Years=x.gT.GenerateYears(a.getFullYear(),11,!0),this.Year=a.getFullYear(),this.Month=a.getMonth()+1,this.Months=x.gT.Months,this.Months.forEach(r=>r.Label=r.Label.slice(0,3))}preInitList(){this.YearMonthToDateRange()}YearMonthToDateRange(){const e=new Date;null==this.Year&&(this.Year=e.getFullYear()),null==this.Month&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month-1,1),this.pageData.Filter.To=new Date(this.Year,this.Month,0)}postGetList(){this.Compare&&this.OnCompare("Data")}OnCompare(e){const o=e?this.data[e]:this.data;if(o.length<1)return;const a=Object.assign({},this.pageData.Filter);a.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),a.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(a)).subscribe(r=>{const l=e?r[e]:r;this.Comparison=0,o.forEach(_=>{_.PrevIndex="-",_.CurrentIndex="-",_.Increase="-";const A=l.filter(v=>v.EntityID==_.EntityID);if(_.CurrentIndex=_.Rank,A.length>0){const v=A[0];_.PrevIndex=v.Rank,v.SalesNet?_.Increase=(_.SalesNet-v.SalesNet)/v.SalesNet*100:v.Sales&&(_.Increase=(_.Sales-v.Sales)/v.Sales*100),_.IsPositive=_.Increase>0,_.IsNegative=_.Increase<0,this.Comparison+=_.Increase}})})}sortData(e){const o=this.data.Data.slice();function a(r,l,_){return(r<l?-1:1)*(_?1:-1)}this.data.Data=e.active&&""!==e.direction?o.sort((r,l)=>{const _="asc"===e.direction;switch(r.Name=null==r.Name?"":r.Name,l.Name=null==l.Name?"":l.Name,e.active){case"Name":return a(r.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),_);case"Count":return a(r.Count,l.Count,_);case"SalesWithTax":return a(r.SalesWithTax,l.SalesWithTax,_);case"Quantity":return a(r.Quantity,l.Quantity,_);case"SalesNet":case"SalesTaxNet":return a(r.Sales,l.Sales,_);case"Tax":return a(r.Tax,l.Tax,_);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-outlet-performance"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",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"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light"],["mat-sort-header","Name",1,"freeze","header"],["style","width: 35px;",4,"ngIf"],["mat-sort-header","Count","class","align-right",4,"ngIf"],["mat-sort-header","Quantity",1,"align-right"],["mat-sort-header","SalesNet",1,"align-right"],["class","align-right",3,"mat-sort-header",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],["class","text-right",4,"ngIf"],[1,"text-right"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["name","compare",3,"model","modelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","pl-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],[2,"width","35px"],["mat-sort-header","Count",1,"align-right"],[1,"align-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(e,o){1&e&&t.YNc(0,eg,72,48,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data&&o.pageData)},directives:[s.O5,d.p,u.yS,c.w9,p.JJ,p.On,q.P,Z.YE,Z.nU,s.sg,C.QB,s.mk],pipes:[T.aQ,s.JJ,T.qU,s.uU],styles:["table[_ngcontent-%COMP%] {\n width: 100%;\n}\n\n.sticky-top-thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\n top: 0 !important;\n}\n\ndiv.container-fluid.mt-5[_ngcontent-%COMP%] {\n padding-bottom: 1.25rem;\n width: 100%;\n overflow-x: auto;\n}"]}),n})();function ag(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",27),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.exportCSV(a.csvConverter,"ReportExport/OutletGroupPerformancePurchase","Purchases Transaction ["+a.pageData.Filter.From+" - "+a.pageData.Filter.To+"].csv")}),t._UZ(1,"i",28),t._uU(2,"Export"),t.qZA()}}function og(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",32),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(3).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",33),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(3).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(3);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function rg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",34),t.TgZ(4,"div",35),t.TgZ(5,"ng-select",36),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(3).Year=a})("change",function(){return t.CHM(e),t.oxw(3).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(3).Year=null}),t.qZA(),t.qZA(),t.TgZ(6,"div",37),t.TgZ(7,"ng-select",38),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(3).Month=a})("change",function(){return t.CHM(e),t.oxw(3).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(3).Month=null}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(3);t.xp6(5),t.Q6J("ngModel",e.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.Month)("items",e.Months)}}function ig(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Compare with prev Month"),t.qZA(),t.TgZ(3,"radio-options",39),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(3).Compare=a})("modelChange",function(){return t.CHM(e),t.oxw(3).OnCompare()}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(3);t.xp6(3),t.Q6J("model",e.Compare)}}function lg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",29),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Date Filter"),t.qZA(),t.TgZ(4,"radio-options",30),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).IsPredefined=a}),t.qZA(),t.qZA(),t.YNc(5,og,5,2,"div",26),t.YNc(6,rg,8,4,"div",26),t.TgZ(7,"div"),t.TgZ(8,"h6"),t._uU(9,"Type"),t.qZA(),t.TgZ(10,"ng-select",31),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.YNc(11,ig,4,1,"div",26),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("model",e.IsPredefined)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.IsPredefined),t.xp6(1),t.Q6J("ngIf",e.IsPredefined),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(1),t.Q6J("ngIf",e.IsPredefined)}}function sg(n,i){1&n&&(t.TgZ(0,"th",40),t._uU(1,"Prev"),t.qZA())}function pg(n,i){1&n&&(t.TgZ(0,"th",40),t._uU(1,"Now"),t.qZA())}function cg(n,i){1&n&&(t.TgZ(0,"th",41),t._uU(1," \xb1 (%) "),t.qZA())}function _g(n,i){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",e.PrevIndex," ")}}const ug=function(n,i){return{rankDown:n,rankUp:i,"number key":!0}};function gg(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.qZA()),2&n){const e=t.oxw(),o=e.$implicit,a=e.index;t.Q6J("ngClass",t.WLB(2,ug,o.PrevIndex<a+1,o.PrevIndex>a+1)),t.xp6(1),t.hij(" ",o.CurrentIndex," ")}}const dg=function(n,i){return{"text-danger":n,"text-success":i,"text-right":!0}};function mg(n,i){if(1&n&&(t.TgZ(0,"td",46),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",t.WLB(5,dg,e.IsNegative,e.IsPositive)),t.xp6(1),t.hij(" ",t.xi3(2,2,e.Increase,".0-0")," ")}}function Zg(n,i){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,_g,2,1,"td",14),t.YNc(2,gg,2,5,"td",42),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",43),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",25),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",25),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td",25),t._uU(15),t.ALo(16,"number"),t.qZA(),t.TgZ(17,"td",25),t._uU(18),t.ALo(19,"number"),t.qZA(),t.YNc(20,mg,3,8,"td",44),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngIf",o.Compare),t.xp6(1),t.Q6J("ngIf",o.Compare),t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(t.xi3(7,9,e.Count,".0-0")),t.xp6(3),t.Oqu(t.xi3(10,12,e.Quantity,".0-0")),t.xp6(3),t.Oqu(t.xi3(13,15,e.Sales,".0-0")),t.xp6(3),t.Oqu(t.xi3(16,18,e.Tax,".0-0")),t.xp6(3),t.hij(" ",t.xi3(19,21,e.SalesWithTax,".0-0")," "),t.xp6(2),t.Q6J("ngIf",o.Compare)}}function hg(n,i){1&n&&t._UZ(0,"td",24)}function xg(n,i){1&n&&t._UZ(0,"td",24)}function Tg(n,i){1&n&&t._UZ(0,"td")}const Cg=function(){return["/menu/Reports/Purchases_Report/Outlet_Performance"]},Ag=function(){return["/menu/Reports/Purchases_Report/Outlet_Performance/Outlet_Monthly_Perfomance"]};function qg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,ag,3,0,"a",2),t.TgZ(3,"div",3),t.TgZ(4,"a",4),t._uU(5,"By Entity"),t.qZA(),t._UZ(6,"button",5),t.TgZ(7,"ul",6),t.TgZ(8,"li",7),t.TgZ(9,"a",8),t._uU(10,"By Month"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",9),t.YNc(13,lg,12,7,"div",10),t.qZA(),t.qZA(),t.TgZ(14,"content"),t.TgZ(15,"div",11),t.TgZ(16,"table",12),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(17,"thead",13),t.TgZ(18,"tr"),t.YNc(19,sg,2,0,"th",14),t.YNc(20,pg,2,0,"th",14),t.TgZ(21,"th",15),t._uU(22,"Outlet"),t.qZA(),t.TgZ(23,"th",16),t._uU(24,"Trans"),t.qZA(),t.TgZ(25,"th",17),t._uU(26,"Quantity"),t.qZA(),t.TgZ(27,"th",18),t._uU(28,"Purchase"),t.qZA(),t.TgZ(29,"th",19),t._uU(30,"Tax"),t.qZA(),t.TgZ(31,"th",19),t._uU(32,"Purchase + Tax"),t.qZA(),t.YNc(33,cg,2,0,"th",20),t.qZA(),t.qZA(),t.TgZ(34,"tbody"),t.YNc(35,Zg,21,24,"tr",21),t.qZA(),t.TgZ(36,"tfoot"),t.TgZ(37,"tr",22),t.YNc(38,hg,1,0,"td",23),t.YNc(39,xg,1,0,"td",23),t._UZ(40,"td",24),t.TgZ(41,"td",25),t._uU(42),t.ALo(43,"number"),t.ALo(44,"sum"),t.qZA(),t.TgZ(45,"td",25),t._uU(46),t.ALo(47,"number"),t.ALo(48,"sum"),t.qZA(),t.TgZ(49,"td",25),t._uU(50),t.ALo(51,"number"),t.ALo(52,"sum"),t.qZA(),t.TgZ(53,"td",25),t._uU(54),t.ALo(55,"number"),t.ALo(56,"sum"),t.qZA(),t.TgZ(57,"td",25),t.TgZ(58,"a"),t._uU(59),t.ALo(60,"number"),t.ALo(61,"sum"),t.qZA(),t.qZA(),t.YNc(62,Tg,1,0,"td",26),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(50,Cg)),t.xp6(5),t.Q6J("routerLink",t.DdM(51,Ag)),t.xp6(4),t.Q6J("ngIf",e.pageData.Filter),t.xp6(6),t.Q6J("ngIf",e.Compare),t.xp6(1),t.Q6J("ngIf",e.Compare),t.xp6(9),t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet"),t.xp6(2),t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet"),t.xp6(2),t.Q6J("ngIf",e.Compare),t.xp6(2),t.Q6J("ngForOf",e.data),t.xp6(3),t.Q6J("ngIf",e.Compare),t.xp6(1),t.Q6J("ngIf",e.Compare),t.xp6(3),t.Oqu(t.xi3(43,20,t.xi3(44,23,e.data,"Count"),".0-0")),t.xp6(4),t.Oqu(t.xi3(47,26,t.xi3(48,29,e.data,"Quantity"),".0-0")),t.xp6(4),t.hij(" ",t.xi3(51,32,t.xi3(52,35,e.data,"Sales"),".0-0")," "),t.xp6(4),t.hij(" ",t.xi3(55,38,t.xi3(56,41,e.data,"Tax"),".0-0")," "),t.xp6(5),t.Oqu(t.xi3(60,44,t.xi3(61,47,e.data,"SalesWithTax"),".0-0")),t.xp6(3),t.Q6J("ngIf",e.Compare)}}let Dg=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/OutletGroupPerformancePurchase","ReportLoader/OutletPurchasePerformance"),this.httpService=e,this.csvConverter=o,this.Compare=!1,this.IsPredefined=!0,this.Comparison=0,this.RadioDateFilterType=[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}],this.first=!0,this.YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];const a=new Date;this.Years=x.gT.GenerateYears(a.getFullYear(),11,!0),this.Year=a.getFullYear(),this.Month=a.getMonth(),this.Months=x.gT.Months,this.Months.forEach(r=>r.Label=r.Label.slice(0,3))}preGetList(){this.first&&(this.YearMonthToDateRange(),this.first=!1)}postInit(){this.Compare&&this.OnCompare()}OnCompare(e){const o=e?this.data[e]:this.data;if(o.length<1)return;const a=Object.assign({},this.pageData.Filter);new Date,a.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),a.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(a)).subscribe(l=>{const _=e?l[e]:l;this.Comparison=0,o.forEach(A=>{A.PrevIndex="-",A.CurrentIndex="-",A.Increase="-";const v=_.filter(b=>b.EntityID==A.EntityID);if(A.CurrentIndex=A.Rank,v.length>0){const b=v[0];A.PrevIndex=b.Rank,b.SalesNet?A.Increase=(A.SalesNet-b.SalesNet)/b.SalesNet*100:b.Sales&&(A.Increase=(A.Sales-b.Sales)/b.Sales*100),A.IsPositive=A.Increase>0,A.IsNegative=A.Increase<0,this.Comparison+=A.Increase}})})}YearMonthToDateRange(){const e=new Date;null==this.Year&&(this.Year=e.getFullYear()),null==this.Month&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}sortData(e){const o=this.data.slice();this.data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Name":return this.compare(a.Name,r.Name,l);case"Count":return this.compare(a.Count,r.Count,l);case"SalesWithTax":return this.compare(a.SalesWithTax,r.SalesWithTax,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Sales":case"SalesNet":case"SalesTaxNet":return this.compare(a.Sales,r.Sales,l);case"Tax":return this.compare(a.Tax,r.Tax,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-outlet-group-performance"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",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"],["style","width: 35px;",4,"ngIf"],["mat-sort-header","Name"],["mat-sort-header","Count",1,"align-right",2,"width","70px"],["mat-sort-header","Quantity",1,"align-right",2,"width","70px"],["mat-sort-header","Sales",1,"align-right",2,"width","120px"],[1,"align-right",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-right"],[4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","pl-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-right",2,"width","70px"],[3,"ngClass",4,"ngIf"],[2,"width","35px",3,"ngClass"],[3,"ngClass"]],template:function(e,o){1&e&&t.YNc(0,qg,63,52,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data&&o.pageData)},directives:[s.O5,d.p,u.yS,Z.YE,Z.nU,s.sg,q.P,c.w9,p.JJ,p.On,C.QB,s.mk],pipes:[s.JJ,T.qU],styles:[""]}),n})();function yg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",17),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.convertToCSV(a.csvConverter,!0,"Monthly Outlet Performance ["+a.pageData.Filter.From+" - "+a.pageData.Filter.To+"].csv")}),t._UZ(1,"i",18),t._uU(2,"Export"),t.qZA()}}function vg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",19),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Year"),t.qZA(),t.TgZ(4,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Type"),t.qZA(),t.TgZ(8,"ng-select",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types)}}function Sg(n,i){if(1&n&&(t.TgZ(0,"th",22),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.Q6J("mat-sort-header",e),t.xp6(1),t.Oqu(e)}}function Mg(n,i){if(1&n&&(t.TgZ(0,"p",24),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(1),t.Oqu(o[e])}}function bg(n,i){if(1&n&&(t.TgZ(0,"p",24),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,o[e]))}}function Jg(n,i){if(1&n&&(t.TgZ(0,"td"),t.YNc(1,Mg,2,1,"p",23),t.YNc(2,bg,3,3,"p",23),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Q6J("ngIf","Outlet"==e),t.xp6(1),t.Q6J("ngIf","Outlet"!=e)}}function Og(n,i){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,Jg,3,2,"td",15),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",o.getKey(e))}}function Ig(n,i){if(1&n&&(t.TgZ(0,"td",26),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e))}}function Ug(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",25),t.TgZ(2,"td",26),t._uU(3,"Total : "),t.qZA(),t.YNc(4,Ig,3,3,"td",27),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("ngForOf",e.data.DataFooter)}}const Fg=function(){return["/menu/Reports/Purchases_Report/Outlet_Performance"]},Ng=function(){return["/menu/Reports/Purchases_Report/Outlet_Performance/Outlet_Group_Performance"]};function Pg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,yg,3,0,"a",2),t.TgZ(3,"div",3),t.TgZ(4,"a",4),t._uU(5,"By Entity"),t.qZA(),t._UZ(6,"button",5),t.TgZ(7,"ul",6),t.TgZ(8,"li",7),t.TgZ(9,"a",8),t._uU(10,"By Entity Group"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",9),t.YNc(13,vg,9,4,"div",10),t.qZA(),t.qZA(),t.TgZ(14,"content"),t.TgZ(15,"div",11),t.TgZ(16,"table",12),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(17,"thead",13),t.TgZ(18,"tr"),t.YNc(19,Sg,2,2,"th",14),t.qZA(),t.qZA(),t.TgZ(20,"tbody"),t.YNc(21,Og,2,1,"tr",15),t.qZA(),t.YNc(22,Ug,5,1,"tfoot",16),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.pageData.HasExportRole),t.xp6(2),t.Q6J("routerLink",t.DdM(9,Fg)),t.xp6(5),t.Q6J("routerLink",t.DdM(10,Ng)),t.xp6(4),t.Q6J("ngIf",e.pageData.Filter),t.xp6(6),t.Q6J("ngForOf",e.data.Dataheader),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.Data.length>0)}}let Lg=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/MonthlyOutletPerformancePurchase","ReportLoader/MonthlyReportPurchase"),this.httpService=e,this.csvConverter=o;const a=new Date;this.Years=x.gT.GenerateYears(a.getFullYear(),11,!0)}getKey(e){return Object.keys(e)}sortData(e){const o=this.data.Data.slice();function a(r,l,_){return(r<l?-1:1)*(_?1:-1)}this.data.Data=e.active&&""!==e.direction?o.sort((r,l)=>{const _="asc"===e.direction;for(let A=0;A<this.data.Dataheader.length;A++)if(e.active==this.data.Dataheader[A])return"string"==typeof r[this.data.Dataheader[A]]?a(r[this.data.Dataheader[A]].toLocaleLowerCase(),l[this.data.Dataheader[A]].toLocaleLowerCase(),_):a(r[this.data.Dataheader[A]],l[this.data.Dataheader[A]],_)}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-outlet-monthly-performance"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",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"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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"],[1,""],["class","",4,"ngFor","ngForOf"]],template:function(e,o){1&e&&t.YNc(0,Pg,23,11,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data&&o.pageData)},directives:[s.O5,d.p,u.yS,Z.YE,s.sg,c.w9,p.JJ,p.On,Z.nU],pipes:[s.JJ],styles:[""]}),n})();function Qg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",5),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/CitySalesExport","CitySalesReport.csv")}),t._UZ(1,"i",6),t._uU(2,"Export"),t.qZA()}}function Yg(n,i){if(1&n&&(t.TgZ(0,"span",13),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Rg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Category"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(5,Yg,2,2,"ng-template",9),t.qZA(),t.qZA(),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"From/To"),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(10,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.to=a}),t.qZA(),t.qZA(),t.TgZ(11,"div"),t.TgZ(12,"h6"),t._uU(13,"Currency"),t.qZA(),t.TgZ(14,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.to),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies)}}function kg(n,i){if(1&n&&(t.TgZ(0,"tr"),t._UZ(1,"td",25),t._UZ(2,"td",25),t._UZ(3,"td",26),t.ALo(4,"number"),t._UZ(5,"td",26),t.ALo(6,"number"),t._UZ(7,"td",26),t.ALo(8,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Q6J("innerHtml",e.CityCode,t.oJD),t.xp6(1),t.Q6J("innerHtml",e.CityName,t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(4,5,e.Quantity),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(6,7,e.Total),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(8,9,e.Average),t.oJD)}}function Eg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",14),t.TgZ(1,"table",15),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",16),t.TgZ(3,"tr"),t.TgZ(4,"th",17),t._uU(5,"Code"),t.qZA(),t.TgZ(6,"th",18),t._uU(7,"Regional Name"),t.qZA(),t.TgZ(8,"th",19),t._uU(9,"Quantity"),t.qZA(),t.TgZ(10,"th",20),t._uU(11,"Total"),t.qZA(),t.TgZ(12,"th",21),t._uU(13,"Avg. Price"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"tbody"),t.YNc(15,kg,9,11,"tr",22),t.qZA(),t.TgZ(16,"tfoot"),t.TgZ(17,"tr",23),t._UZ(18,"td",24),t.TgZ(19,"td",24),t._uU(20,"Total :"),t.qZA(),t.TgZ(21,"td",24),t._uU(22),t.ALo(23,"number"),t.ALo(24,"sum"),t.qZA(),t.TgZ(25,"td",24),t._uU(26),t.ALo(27,"number"),t.ALo(28,"sum"),t.qZA(),t.TgZ(29,"td",24),t._uU(30),t.ALo(31,"number"),t.ALo(32,"sum"),t.ALo(33,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(15),t.Q6J("ngForOf",e.data.List),t.xp6(7),t.Oqu(t.lcZ(23,4,t.xi3(24,6,e.data.List,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(27,9,t.xi3(28,11,e.data.List,"Total"))),t.xp6(4),t.hij(" ",t.lcZ(31,14,t.xi3(32,16,e.data.List,"Total")/t.xi3(33,19,e.data.List,"Quantity"))," ")}}let Hg=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/CitySales","ReportLoader/CitySalesLoader",o),this.httpService=e,this.csvConverter=a}postInit(e){this.menuData.H=e.PageTitle}sortData(e){const o=this.data.List.slice();this.data.List=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"CityCode":return this.compare(a.CityCode,r.CityCode,l);case"CityName":return this.compare(a.CityName,r.CityName,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Average":return this.compare(a.Average,r.Average,l);case"Total":return this.compare(a.Total,r.Total,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-city"]],features:[t.qOj],decls:8,vars:5,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","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","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],["container",""],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],[3,"title"],[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",1,"align-right",2,"width","70px"],["mat-sort-header","Total",1,"align-right",2,"width","100px"],["mat-sort-header","Average",1,"align-right",2,"width","100px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right"],[3,"innerHtml"],[1,"text-right",3,"innerHtml"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Qg,3,0,"a",1),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",2),t.YNc(5,Rg,15,6,"div",3),t.qZA(),t.qZA(),t.TgZ(6,"content"),t.YNc(7,Eg,34,22,"div",4),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",null==o.pageData.Role?null:o.pageData.Role.HasExportRole),t.xp6(3),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,c.ir,C.QB,Z.YE,Z.nU,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function Vg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.from=a}),t.qZA(),t.TgZ(9,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.to=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.from),t.xp6(1),t.Q6J("date",e.pageData.Filter.to)}}const Bg=function(n,i,e,o){return{SalesTypeID:n,OutletID:i,From:e,To:o}},Gg=function(n){return["/menu/Reports/Sales_Report/Standard/Detail",n]};function jg(n,i){if(1&n&&(t.TgZ(0,"tr"),t._UZ(1,"td",22),t._UZ(2,"td",23),t.ALo(3,"number"),t._UZ(4,"td",23),t.ALo(5,"number"),t.TgZ(6,"td",18),t.TgZ(7,"a",24),t.ALo(8,"date"),t.ALo(9,"date"),t._uU(10),t.ALo(11,"number"),t.qZA(),t.qZA(),t._UZ(12,"td",25),t.ALo(13,"number"),t._UZ(14,"td",26),t.ALo(15,"number"),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("innerHtml",e.Name,t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(3,7,e.Count),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(5,9,e.Quantity),t.oJD),t.xp6(3),t.Q6J("routerLink",t.VKq(28,Gg,t.l5B(23,Bg,e.TypeID,o.getOutletID(),t.xi3(8,11,o.getFrom(),"ddMMyyyy"),t.xi3(9,14,o.getTo(),"ddMMyyyy")))),t.xp6(3),t.Oqu(t.lcZ(11,17,e.Gross)),t.xp6(2),t.Q6J("innerHtml",t.lcZ(13,19,e.Sales),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(15,21,e.Cost),t.oJD)}}function Wg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",10),t.TgZ(1,"table",11),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",12),t.TgZ(3,"tr"),t.TgZ(4,"th",13),t._uU(5,"Type Name"),t.qZA(),t.TgZ(6,"th",14),t._uU(7,"Trans"),t.qZA(),t.TgZ(8,"th",15),t._uU(9,"Quantity"),t.qZA(),t.TgZ(10,"th",15),t._uU(11,"Gross"),t.qZA(),t.TgZ(12,"th",15),t._uU(13,"Sales"),t.qZA(),t.TgZ(14,"th",15),t._uU(15,"Cost"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(16,"tbody"),t.YNc(17,jg,16,30,"tr",16),t.qZA(),t.TgZ(18,"tfoot"),t.TgZ(19,"tr",17),t._UZ(20,"td",18),t.TgZ(21,"td",18),t._uU(22),t.ALo(23,"number"),t.ALo(24,"sum"),t.qZA(),t.TgZ(25,"td",18),t._uU(26),t.ALo(27,"number"),t.ALo(28,"sum"),t.qZA(),t.TgZ(29,"td",19),t.TgZ(30,"a"),t._uU(31),t.ALo(32,"number"),t.ALo(33,"sum"),t.qZA(),t.qZA(),t.TgZ(34,"td",20),t._uU(35),t.ALo(36,"number"),t.ALo(37,"sum"),t.qZA(),t.TgZ(38,"td",21),t._uU(39),t.ALo(40,"number"),t.ALo(41,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(17),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Oqu(t.lcZ(23,6,t.xi3(24,8,e.data.Data,"Count"))),t.xp6(4),t.Oqu(t.lcZ(27,11,t.xi3(28,13,e.data.Data,"Quantity"))),t.xp6(5),t.Oqu(t.lcZ(32,16,t.xi3(33,18,e.data.Data,"Gross"))),t.xp6(4),t.Oqu(t.lcZ(36,21,t.xi3(37,23,e.data.Data,"Sales"))),t.xp6(4),t.Oqu(t.lcZ(40,26,t.xi3(41,28,e.data.Data,"Cost")))}}let $g=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/TypeSales","ReportLoader/TypeSalesLoader",o),this.httpService=e,this.csvConverter=a;const r=new Date;this.month=r.getMonth(),this.year=r.getFullYear()}postInit(e){this.menuData.H=e.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(e){const o=this.data.List.slice();this.data.List=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"TypeName":return this.compare(a.TypeName,r.TypeName,l);case"Trans":return this.compare(a.Trans,r.Trans,l);case"Quality":return this.compare(a.Quality,r.Quality,l);case"Gross":return this.compare(a.Gross,r.Gross,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"Cost":return this.compare(a.Cost,r.Cost,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-type"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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"],["name","From",3,"date","dateChange"],["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-right",2,"width","70px"],[1,"text-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right"],[1,"text-right","text-primary"],[1,"text-right","text-success"],[1,"text-right","text-danger"],[3,"innerHtml"],[1,"text-right",3,"innerHtml"],[3,"routerLink"],[1,"text-right","text-success",3,"innerHtml"],[1,"text-right","text-danger",3,"innerHtml"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,o.data.Data,"TypeSalesReport.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,Vg,10,4,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,Wg,42,31,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,C.QB,Z.YE,s.sg,u.yS],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function Kg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Xg(n,i){1&n&&(t.TgZ(0,"th",15),t._uU(1,"Profit"),t.qZA())}function zg(n,i){if(1&n&&(t.TgZ(0,"tr"),t._UZ(1,"td",22),t._UZ(2,"td",23),t.ALo(3,"number"),t._UZ(4,"td",23),t.ALo(5,"number"),t._UZ(6,"td",23),t.ALo(7,"number"),t._UZ(8,"td",24),t.ALo(9,"number"),t._UZ(10,"td",25),t.ALo(11,"number"),t._UZ(12,"td",24),t.ALo(13,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Q6J("innerHtml",e.GroupName,t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(3,7,e.Count),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(5,9,e.Quantity),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(7,11,e.Gross),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(9,13,e.Sales),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(11,15,e.Cost),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(13,17,e.Profit),t.oJD)}}function td(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",10),t.TgZ(1,"table",11),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",12),t.TgZ(3,"tr"),t.TgZ(4,"th",13),t._uU(5,"Group Name"),t.qZA(),t.TgZ(6,"th",14),t._uU(7,"Trans"),t.qZA(),t.TgZ(8,"th",15),t._uU(9,"Quantity"),t.qZA(),t.TgZ(10,"th",15),t._uU(11,"Gross"),t.qZA(),t.TgZ(12,"th",15),t._uU(13,"Sales"),t.qZA(),t.TgZ(14,"th",15),t._uU(15,"Cost"),t.qZA(),t.YNc(16,Xg,2,0,"th",16),t.qZA(),t.qZA(),t.TgZ(17,"tbody"),t.YNc(18,zg,14,19,"tr",17),t.qZA(),t.TgZ(19,"tfoot"),t.TgZ(20,"tr",18),t._UZ(21,"td",19),t.TgZ(22,"td",19),t._uU(23),t.ALo(24,"number"),t.ALo(25,"sum"),t.qZA(),t.TgZ(26,"td",19),t._uU(27),t.ALo(28,"number"),t.ALo(29,"sum"),t.qZA(),t.TgZ(30,"td",19),t._uU(31),t.ALo(32,"number"),t.ALo(33,"sum"),t.qZA(),t.TgZ(34,"td",20),t._uU(35),t.ALo(36,"number"),t.ALo(37,"sum"),t.qZA(),t.TgZ(38,"td",21),t._uU(39),t.ALo(40,"number"),t.ALo(41,"sum"),t.qZA(),t.TgZ(42,"td",20),t._uU(43),t.ALo(44,"number"),t.ALo(45,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(16),t.Q6J("ngIf",!e.pageData.HasRole),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Oqu(t.lcZ(24,8,t.xi3(25,10,e.data.Data,"Count"))),t.xp6(4),t.Oqu(t.lcZ(28,13,t.xi3(29,15,e.data.Data,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(32,18,t.xi3(33,20,e.data.Data,"Gross"))),t.xp6(4),t.Oqu(t.lcZ(36,23,t.xi3(37,25,e.data.Data,"Sales"))),t.xp6(4),t.Oqu(t.lcZ(40,28,t.xi3(41,30,e.data.Data,"Cost"))),t.xp6(4),t.Oqu(t.lcZ(44,33,t.xi3(45,35,e.data.Data,"Profit")))}}let ed=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/CustomerGroup","ReportLoader/CustomerGroupLoader",o),this.httpService=e,this.csvConverter=a,this.first=!0}preGetList(){if(this.first){const e=new Date,o=e.getMonth(),a=e.getFullYear();this.pageData.Filter.From=new Date(a,o,1).toDateString(),this.pageData.Filter.To=new Date(a,o+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){const o=new Date,a=o.getMonth(),r=o.getFullYear();this.pageData.Filter.From=new Date(r,a,1),this.pageData.Filter.To=new Date(r,a+1,0),this.first=!1}}sortData(e){const o=this.data.List.slice();this.data.List=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"GroupName":return this.compare(a.GroupName,r.GroupName,l);case"Trans":return this.compare(a.Trans,r.Trans,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Gross":return this.compare(a.Gross,r.Gross,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"Cost":return this.compare(a.Cost,r.Cost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-customer-group"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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"],["name","From",3,"date","dateChange"],["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-right",2,"width","70px"],[1,"text-right",2,"width","120px"],["style","width: 120px;","class","text-right",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right"],[1,"text-right","text-success"],[1,"text-right","text-danger"],[3,"innerHtml"],[1,"text-right",3,"innerHtml"],[1,"text-right","text-success",3,"innerHtml"],[1,"text-right","text-danger",3,"innerHtml"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,o.data.Data,"CustomerGroupSalesReport.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,Kg,10,4,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,td,46,38,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,C.QB,Z.YE,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function nd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",5),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/SalesGroup","SalesGroupPerformance.csv")}),t._UZ(1,"i",6),t._uU(2,"Export"),t.qZA()}}function ad(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function od(n,i){1&n&&(t.TgZ(0,"th",15),t._uU(1,"Profit"),t.qZA())}function rd(n,i){if(1&n&&(t._UZ(0,"td",25),t.ALo(1,"number")),2&n){const e=t.oxw().$implicit;t.Q6J("innerHtml",t.lcZ(1,1,e.ActualProfit),t.oJD)}}function id(n,i){if(1&n&&(t.TgZ(0,"tr"),t._UZ(1,"td",22),t._UZ(2,"td",23),t.ALo(3,"number"),t._UZ(4,"td",23),t.ALo(5,"number"),t._UZ(6,"td",23),t.ALo(7,"number"),t._UZ(8,"td",23),t.YNc(9,rd,2,3,"td",24),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("innerHtml",e.Name,t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(3,6,e.InvoiceCount),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(5,8,e.NetRevenue),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(7,10,e.SalesTarget),t.oJD),t.xp6(2),t.Q6J("innerHtml",e.Percentage+"%",t.oJD),t.xp6(1),t.Q6J("ngIf",!o.pageData.HasRole)}}function ld(n,i){if(1&n&&(t.TgZ(0,"td",20),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"ActualProfit")),"")}}function sd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",11),t.TgZ(1,"table",12),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",13),t.TgZ(3,"tr",14),t.TgZ(4,"th"),t._uU(5,"Group Name"),t.qZA(),t.TgZ(6,"th",15),t._uU(7,"Count"),t.qZA(),t.TgZ(8,"th",15),t._uU(9,"Actual"),t.qZA(),t.TgZ(10,"th",15),t._uU(11,"Target"),t.qZA(),t.TgZ(12,"th",15),t._uU(13,"Percentage"),t.qZA(),t.YNc(14,od,2,0,"th",16),t.qZA(),t.qZA(),t.TgZ(15,"tbody"),t.YNc(16,id,10,12,"tr",17),t.qZA(),t.TgZ(17,"tfoot"),t.TgZ(18,"tr",18),t._UZ(19,"td",19),t._UZ(20,"td",19),t.TgZ(21,"td",20),t._uU(22),t.ALo(23,"number"),t.ALo(24,"sum"),t.qZA(),t._UZ(25,"td",19),t._UZ(26,"td",19),t.YNc(27,ld,4,6,"td",21),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(14),t.Q6J("ngIf",!e.pageData.HasRole),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(6),t.Oqu(t.lcZ(23,4,t.xi3(24,6,e.data.Data,"GrossRevenue"))),t.xp6(5),t.Q6J("ngIf",!e.pageData.HasRole)}}let pd=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/SalesGroup","ReportLoader/SalesGroupLoader",o),this.httpService=e,this.csvConverter=a,this.first=!0}preGetList(){if(this.first){const e=new Date,o=e.getMonth(),a=e.getFullYear();this.pageData.Filter.From=new Date(a,o,1).toDateString(),this.pageData.Filter.To=new Date(a,o+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){const o=new Date,a=o.getMonth(),r=o.getFullYear();this.pageData.Filter.From=new Date(r,a,1),this.pageData.Filter.To=new Date(r,a+1,0),this.first=!1}}sortData(e){const o=this.data.List.slice();e.active&&""!==e.direction||(this.data.List=o)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-sales-group"]],features:[t.qOj],decls:8,vars:5,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","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","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-right",2,"width","120px"],["style","width: 120px;","class","text-right",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right","empty-column"],[1,"text-right"],["class","text-right ",4,"ngIf"],[3,"innerHtml"],[1,"text-right",3,"innerHtml"],["class","text-right text-success",3,"innerHtml",4,"ngIf"],[1,"text-right","text-success",3,"innerHtml"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,nd,3,0,"a",1),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",2),t.YNc(5,ad,10,4,"div",3),t.qZA(),t.qZA(),t.TgZ(6,"content"),t.YNc(7,sd,28,9,"div",4),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasExportRole),t.xp6(3),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,C.QB,Z.YE,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function cd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Category"),t.qZA(),t.TgZ(13,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types)("clearable",!1)}}function _d(n,i){if(1&n&&t._UZ(0,"th",27),2&n){const e=i.$implicit;t.Q6J("innerHtml",e.Label+" ("+e.Rate+"%)",t.oJD)}}function ud(n,i){if(1&n&&(t._UZ(0,"td",31),t.ALo(1,"number"),t.ALo(2,"TaxDefault")),2&n){const e=i.index,o=t.oxw().$implicit,a=t.oxw(2);t.Q6J("innerHtml",t.lcZ(1,1,t.Dn7(2,3,a.data.Compenents,o,e)),t.oJD)}}const gd=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},dd=function(n){return{ID:n}};function md(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"a",28),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.qZA(),t.TgZ(8,"td"),t._uU(9),t.ALo(10,"date"),t.qZA(),t.TgZ(11,"td",29),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td",29),t._uU(15),t.ALo(16,"number"),t.qZA(),t.YNc(17,ud,3,7,"td",30),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.EntityName),t.xp6(2),t.Q6J("routerLink",t.DdM(16,gd))("queryParams",t.VKq(17,dd,e.ID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(t.xi3(10,9,e.Date,"dd MMM yyyy")),t.xp6(3),t.Oqu(t.lcZ(13,12,e.Sales)),t.xp6(3),t.Oqu(t.lcZ(16,14,e.Tax)),t.xp6(2),t.Q6J("ngForOf",o.getComponent(o.data))}}function Zd(n,i){if(1&n&&(t.TgZ(0,"td",32),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.SumTaxAmount)," ")}}function hd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",12),t.TgZ(1,"table",13),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",14),t.TgZ(3,"tr"),t.TgZ(4,"th",15),t._uU(5,"Outlet"),t.qZA(),t.TgZ(6,"th",16),t._uU(7,"Number"),t.qZA(),t.TgZ(8,"th",17),t._uU(9,"Name"),t.qZA(),t.TgZ(10,"th",18),t._uU(11,"Date"),t.qZA(),t.TgZ(12,"th",19),t._uU(13,"Sales"),t.qZA(),t.TgZ(14,"th",20),t._uU(15,"Tax"),t.qZA(),t.YNc(16,_d,1,1,"th",21),t.qZA(),t.qZA(),t.TgZ(17,"tbody"),t.YNc(18,md,18,19,"tr",22),t.qZA(),t.TgZ(19,"tfoot"),t.TgZ(20,"tr",23),t._UZ(21,"td",24),t.TgZ(22,"td",25),t._uU(23),t.ALo(24,"number"),t.ALo(25,"sum"),t.qZA(),t.TgZ(26,"td",25),t._uU(27),t.ALo(28,"number"),t.ALo(29,"sum"),t.qZA(),t.YNc(30,Zd,3,3,"td",26),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(16),t.Q6J("ngForOf",e.data.Compenents),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Oqu(t.lcZ(24,5,t.xi3(25,7,e.data.Data,"Sales"))),t.xp6(4),t.Oqu(t.lcZ(28,10,t.xi3(29,12,e.data.Data,"Tax"))),t.xp6(3),t.Q6J("ngForOf",e.data.Compenents)}}const Td=function(){return["/menu/Reports/Sales_Report/Advanced/Tax_Report/By_Outlet"]};let Cd=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/GetTaxReport","ReportLoader/GetTaxReport",o),this.httpService=e,this.csvConverter=a}getComponent(e){return e.Component=[],this.data.Compenents.forEach((o,a)=>{0!=e.Tax?(o.SalesTax=0==a?e.Sales:this.data.Compenents[a-1].SalesTax,o.SalesTax=0==a?o.SalesTax:o.SalesTax+o.SalesTax*this.data.Compenents[a-1].Rate/100,e.Component[a]=o.SalesTax*o.Rate/100,o.SumTaxAmount=o.SumTaxAmount+e.Component[a]):e.Component[a]=0}),e.Component}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(a.Name=null==a.Name?"":a.Name,r.Name=null==r.Name?"":r.Name,a.EntityName=null==a.EntityName?"":a.EntityName,r.EntityName=null==r.EntityName?"":r.EntityName,e.active){case"Name":return this.compare(a.Name.toLocaleLowerCase(),r.Name.toLocaleLowerCase(),l);case"Outlet":return this.compare(a.EntityName.toLocaleLowerCase(),r.EntityName.toLocaleLowerCase(),l);case"Number":return this.compare(a.Number,r.Number,l);case"Date":return this.compare(a.Date,r.Date,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"Tax":return this.compare(a.Tax,r.Tax,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-tax-report"]],features:[t.qOj],decls:12,vars:6,consts:[[3,"pageData","text","textChange","onSubmit"],["title","Tax Report By Outlet",1,"btn","btn-success","mr-6",3,"routerLink"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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","Number"],["mat-sort-header","Name"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales",1,"align-right",2,"width","150px"],["mat-sort-header","Tax",1,"align-right","text-right",2,"width","150px"],["style","width: 150px","class","align-right text-right",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","4",1,"text-right","empty-column"],[1,"text-right","text-success"],["class","text-right","style","width: 150px",4,"ngFor","ngForOf"],[1,"align-right","text-right",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],[1,"text-right"],["class","text-right","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-right",2,"width","150px",3,"innerHtml"],[1,"text-right",2,"width","150px"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t._uU(3,"By Outlet"),t.qZA(),t.TgZ(4,"a",2),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,o.data.Data,"TaxReport.csv")}),t._UZ(5,"i",3),t._uU(6,"Export"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,cd,14,8,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,hd,31,15,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(2),t.Q6J("routerLink",t.DdM(5,Td)),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,C.QB,Z.YE,Z.nU,s.sg],pipes:[s.JJ,T.qU,s.uU,T.X6],styles:[""]}),n})();function fd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Tax Type"),t.qZA(),t.TgZ(13,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types)("clearable",!1)}}function Ad(n,i){1&n&&(t.TgZ(0,"th",25),t._uU(1,"Total Tax"),t.qZA())}function qd(n,i){if(1&n&&t._UZ(0,"th",26),2&n){const e=i.$implicit;t.Q6J("innerHtml",e.Label+" ("+e.Rate+"%)",t.oJD)}}function Dd(n,i){if(1&n&&(t.TgZ(0,"td",27),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Tax))}}function yd(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e)," ")}}function vd(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",27),t._uU(4),t.ALo(5,"number"),t.qZA(),t.YNc(6,Dd,3,3,"td",28),t.YNc(7,yd,3,3,"td",24),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.EntityName),t.xp6(2),t.Oqu(t.lcZ(5,4,e.Sales)),t.xp6(2),t.Q6J("ngIf",0==o.data.Compenents.length),t.xp6(1),t.Q6J("ngForOf",o.getComponent(e))}}function Sd(n,i){if(1&n&&(t.TgZ(0,"td",22),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Tax")),"")}}function Md(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.SumTaxAmount)," ")}}function bd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",12),t.TgZ(1,"table",13),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",14),t.TgZ(3,"tr"),t.TgZ(4,"th",15),t._uU(5,"Outlet"),t.qZA(),t.TgZ(6,"th",16),t._uU(7,"Sales"),t.qZA(),t.YNc(8,Ad,2,0,"th",17),t.YNc(9,qd,1,1,"th",18),t.qZA(),t.qZA(),t.TgZ(10,"tbody"),t.YNc(11,vd,8,6,"tr",19),t.qZA(),t.TgZ(12,"tfoot"),t.TgZ(13,"tr",20),t._UZ(14,"td",21),t.TgZ(15,"td",22),t._uU(16),t.ALo(17,"number"),t.ALo(18,"sum"),t.qZA(),t.YNc(19,Sd,4,6,"td",23),t.YNc(20,Md,3,3,"td",24),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(8),t.Q6J("ngIf",0==e.data.Compenents.length),t.xp6(1),t.Q6J("ngForOf",e.data.Compenents),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Oqu(t.lcZ(17,6,t.xi3(18,8,e.data.Data,"Sales"))),t.xp6(3),t.Q6J("ngIf",0==e.data.Compenents.length),t.xp6(1),t.Q6J("ngForOf",e.data.Compenents)}}const Jd=function(){return["/menu/Reports/Sales_Report/Advanced/Tax_Report"]};let Od=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/GetTaxReportbyOutlet","ReportLoader/GetTaxReport",o),this.httpService=e,this.csvConverter=a}getComponent(e){return e.Component=[],this.data.Compenents.forEach((o,a)=>{o.SalesTax=0==a?e.Sales:this.data.Compenents[a-1].SalesTax,o.SalesTax=0==a?o.SalesTax:o.SalesTax+o.SalesTax*this.data.Compenents[a-1].Rate/100,e.Component[a]=o.SalesTax*o.Rate/100,o.SumTaxAmount=o.SumTaxAmount+e.Component[a]}),e.Component}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Outlet":return this.compare(a.EntityName,r.EntityName,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"Tax":return this.compare(a.Tax,r.Tax,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-tax-report-by-outlet"]],features:[t.qOj],decls:12,vars:7,consts:[[3,"pageData","text","hideSearchBox","textChange","onSubmit"],["title","Tax Report By Outlet",1,"btn","btn-success","mr-6",3,"routerLink"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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"],["name","From",3,"date","dateChange"],["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",1,"align-right",2,"width","150px"],["style","width: 150px","class","align-right","mat-sort-header","Tax",4,"ngIf"],["style","width: 150px","class","align-right",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right","empty-column"],[1,"text-right","text-success"],["class","text-right text-success",4,"ngIf"],["class","text-right","style","width: 150px",4,"ngFor","ngForOf"],["mat-sort-header","Tax",1,"align-right",2,"width","150px"],[1,"align-right",2,"width","150px",3,"innerHtml"],[1,"text-right"],["class","text-right",4,"ngIf"],[1,"text-right",2,"width","150px"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t._uU(3,"Tax Report"),t.qZA(),t.TgZ(4,"a",2),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,o.data.Data,"TaxReport.csv")}),t._UZ(5,"i",3),t._uU(6,"Export"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,fd,14,7,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,bd,21,11,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number)("hideSearchBox",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(6,Jd)),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,C.QB,Z.YE,Z.nU,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function Id(n,i){if(1&n&&(t.TgZ(0,"span",13),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Ud(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Id,2,2,"ng-template",9),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"From/To"),t.qZA(),t.TgZ(13,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(14,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(15,"div"),t.TgZ(16,"h6"),t._uU(17,"Sales Name"),t.qZA(),t.TgZ(18,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales)}}const Fd=function(){return["/menu/Products/Catalog/Variants/Info"]},wd=function(n){return{ID:n}};function Nd(n,i){if(1&n&&(t.TgZ(0,"tr",19),t.TgZ(1,"td"),t.TgZ(2,"a",20),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.ALo(8,"date"),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.ALo(11,"date"),t.qZA(),t.TgZ(12,"td",17),t._uU(13),t.ALo(14,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Q6J("routerLink",t.DdM(15,Fd))("queryParams",t.VKq(16,wd,e.ID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(e.LastSold?t.xi3(8,7,e.LastSold,"dd MMM yyyy"):"-"),t.xp6(3),t.Oqu(e.LastPurchased?t.xi3(11,10,e.LastPurchased,"dd MMM yyyy"):"-"),t.xp6(3),t.Oqu(t.lcZ(14,13,e.Quantity))}}function Pd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",14),t.TgZ(1,"table",15),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",16),t.TgZ(3,"tr"),t.TgZ(4,"th"),t._uU(5,"Name"),t.qZA(),t.TgZ(6,"th"),t._uU(7,"Code"),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Last Sold"),t.qZA(),t.TgZ(10,"th"),t._uU(11,"Last Purchased"),t.qZA(),t.TgZ(12,"th",17),t._uU(13,"Qty"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"tbody"),t.YNc(15,Nd,15,18,"tr",18),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(15),t.Q6J("ngForOf",e.data)}}let Ld=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/ProductLifeCycle","ReportLoader/ProductLifeCycle",o),this.httpService=e,this.csvConverter=a}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(a.Name=null==a.Name?"":a.Name,r.Name=null==r.Name?"":r.Name,a.EntityName=null==a.EntityName?"":a.EntityName,r.EntityName=null==r.EntityName?"":r.EntityName,e.active){case"Name":return this.compare(a.Name.toLocaleLowerCase(),r.Name.toLocaleLowerCase(),l);case"Outlet":return this.compare(a.EntityName.toLocaleLowerCase(),r.EntityName.toLocaleLowerCase(),l);case"Number":return this.compare(a.Number,r.Number,l);case"Date":return this.compare(a.Date,r.Date,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"Tax":return this.compare(a.Tax,r.Tax,l);default:return 0}}):o}preGetList(){this.pageData.Filter.EntityID||delete this.pageData.Filter.EntityID}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-product-life-cycle"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales",3,"ngModel","items","ngModelChange"],[3,"title"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"text-right"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[3,"routerLink","queryParams"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,o.data.Data,"ProductLifeCycleReport.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,Ud,19,8,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,Pd,16,1,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,c.ir,C.QB,Z.YE,s.sg,u.yS],pipes:[s.uU,s.JJ],styles:[""]}),n})();function Qd(n,i){if(1&n&&(t.TgZ(0,"span",15),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Yd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",16),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",17),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Rd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",18),t.TgZ(4,"div",19),t.TgZ(5,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(6,"div",21),t.TgZ(7,"ng-select",22),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Month=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months)}}function kd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Qd,2,2,"ng-template",9),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Date Filter"),t.qZA(),t.TgZ(13,"radio-options",10),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ByMonth=a}),t.qZA(),t.TgZ(14,"h6"),t._uU(15,"Group By"),t.qZA(),t.TgZ(16,"radio-options",11),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupBy=a}),t.qZA(),t.qZA(),t.YNc(17,Yd,5,2,"div",12),t.YNc(18,Rd,8,4,"div",12),t.TgZ(19,"div"),t.TgZ(20,"h6"),t._uU(21,"Row Count"),t.qZA(),t.TgZ(22,"input",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.TgZ(23,"div"),t.TgZ(24,"h6"),t._uU(25,"Supplier"),t.qZA(),t.TgZ(26,"autocompleteV2",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SupplierID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("model",e.pageData.Filter.ByMonth)("options",e.RadioDateFilterType),t.xp6(3),t.Q6J("model",e.pageData.Filter.GroupBy)("options",e.RadioGroupBy),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.ByMonth),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.ByMonth),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SupplierID)}}function Ed(n,i){if(1&n&&(t.TgZ(0,"tr",31),t.TgZ(1,"td",32),t._uU(2),t.qZA(),t.TgZ(3,"td",32),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA(),t.TgZ(7,"td"),t._uU(8),t.qZA(),t.TgZ(9,"td",33),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",33),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",33),t._uU(16),t.ALo(17,"number"),t.qZA(),t.TgZ(18,"td",34),t._uU(19),t.ALo(20,"number"),t.qZA(),t.TgZ(21,"td",33),t._uU(22),t.ALo(23,"number"),t.qZA(),t.TgZ(24,"td",33),t._uU(25),t.ALo(26,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.PrevRank||"-"),t.xp6(2),t.Oqu(e.Rank),t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(11,10,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(14,12,e.UnitsInStock)),t.xp6(3),t.Oqu(t.lcZ(17,14,e.TotalAmount)),t.xp6(3),t.Oqu(t.lcZ(20,16,e.TotalCost)),t.xp6(3),t.Oqu(t.lcZ(23,18,e.TotalProfit)),t.xp6(3),t.Oqu(t.lcZ(26,20,e.Margin))}}function Hd(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",35),t._UZ(2,"td",36),t.TgZ(3,"td",37),t._uU(4,"Total:"),t.qZA(),t.TgZ(5,"td",37),t._uU(6),t.ALo(7,"number"),t.ALo(8,"sum"),t.qZA(),t.TgZ(9,"td",37),t._uU(10),t.ALo(11,"number"),t.ALo(12,"sum"),t.qZA(),t.TgZ(13,"td",37),t._uU(14),t.ALo(15,"number"),t.ALo(16,"sum"),t.qZA(),t.TgZ(17,"td",37),t._uU(18),t.ALo(19,"number"),t.ALo(20,"sum"),t.qZA(),t.TgZ(21,"td",37),t._uU(22),t.ALo(23,"number"),t.ALo(24,"sum"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(6),t.Oqu(t.lcZ(7,5,t.xi3(8,7,e.data,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(11,10,t.xi3(12,12,e.data,"UnitsInStock"))),t.xp6(4),t.Oqu(t.lcZ(15,15,t.xi3(16,17,e.data,"TotalAmount"))),t.xp6(4),t.Oqu(t.lcZ(19,20,t.xi3(20,22,e.data,"TotalCost"))),t.xp6(4),t.Oqu(t.lcZ(23,25,t.xi3(24,27,e.data,"TotalProfit")))}}function Vd(n,i){if(1&n&&(t.TgZ(0,"div",23),t.TgZ(1,"table",24),t.TgZ(2,"thead",25),t.TgZ(3,"tr"),t.TgZ(4,"th",26),t._uU(5,"Prev"),t.qZA(),t.TgZ(6,"th",26),t._uU(7,"Now"),t.qZA(),t.TgZ(8,"th",27),t._uU(9,"Name"),t.qZA(),t.TgZ(10,"th",28),t._uU(11,"Code"),t.qZA(),t.TgZ(12,"th",26),t._uU(13,"Sold"),t.qZA(),t.TgZ(14,"th",29),t._uU(15,"Inventory"),t.qZA(),t.TgZ(16,"th",29),t._uU(17,"Total Amount"),t.qZA(),t.TgZ(18,"th",29),t._uU(19,"Total Cost"),t.qZA(),t.TgZ(20,"th",29),t._uU(21,"Total profit"),t.qZA(),t.TgZ(22,"th",29),t._uU(23,"%"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(24,"tbody"),t.YNc(25,Ed,27,22,"tr",30),t.qZA(),t.YNc(26,Hd,25,30,"tfoot",12),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(25),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.length>0)}}let Bd=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/GetReportProductProfit","ReportLoader/GetReportProductProfit",o),this.httpService=e,this.csvConverter=a,this.DateFilterType="Range",this.Months=[{ID:"1",Label:"Jan"},{ID:"2",Label:"Feb"},{ID:"3",Label:"Mar"},{ID:"4",Label:"Apr"},{ID:"5",Label:"May"},{ID:"6",Label:"Jun"},{ID:"7",Label:"Jul"},{ID:"8",Label:"Aug"},{ID:"9",Label:"Sep"},{ID:"10",Label:"Oct"},{ID:"11",Label:"Nov"},{ID:"12",Label:"Dec"}],this.RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Range"}],this.RadioGroupBy=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}],this.first=!0;const r=new Date;this.Years=this.GenerateYears(r.getFullYear(),11,!0)}GenerateYears(e,o,a){let r=-1;(null==o||null==o)&&(o=11),(null==a||null==a||!a)&&(r=1);const l=[];for(let _=0;_<o;_++)l.push(e+_*r);return l}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-product-profit"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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",""],["name","Date Filter",3,"model","options","modelChange"],["name","Group By",3,"model","options","modelChange"],[4,"ngIf"],["type","text",1,"form-control",3,"ngModel","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100",3,"ngModel","ngModelChange"],[3,"title"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange"],[1,"col-6","pl-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-right",2,"width","100px"],[2,"width","600px"],[2,"width","100px"],[1,"text-right",2,"width","200px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[1,"text-right",2,"width","35px"],[1,"text-right","text-success"],[1,"text-right","text-danger"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,o.data.Data,"ReportProductProfit.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,kd,27,12,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,Vd,27,2,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,c.ir,q.P,p.Fj,D.J,C.QB,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function Gd(n,i){if(1&n&&(t.TgZ(0,"span",12),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function jd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Gd,2,2,"ng-template",9),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"From/To"),t.qZA(),t.TgZ(13,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(14,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}const Wd=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},$d=function(n){return{ID:n}};function Kd(n,i){if(1&n&&(t.TgZ(0,"tr",17),t.TgZ(1,"td"),t.TgZ(2,"a",18),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.qZA(),t.TgZ(8,"td"),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td"),t._uU(12),t.ALo(13,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Q6J("routerLink",t.DdM(11,Wd))("queryParams",t.VKq(12,$d,e.ID)),t.xp6(1),t.Oqu(e.InvoiceNumber),t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(10,7,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(13,9,e.Price))}}function Xd(n,i){if(1&n&&(t.TgZ(0,"div",13),t.TgZ(1,"table",14),t.TgZ(2,"thead",15),t.TgZ(3,"tr"),t.TgZ(4,"th"),t._uU(5,"Number"),t.qZA(),t.TgZ(6,"th"),t._uU(7,"Name"),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Code"),t.qZA(),t.TgZ(10,"th"),t._uU(11,"Quantity"),t.qZA(),t.TgZ(12,"th"),t._uU(13,"Price"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"tbody"),t.YNc(15,Kd,14,14,"tr",16),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(15),t.Q6J("ngForOf",e.data.Data)}}let zd=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/GetExchangedSales","ReportLoader/GetExchangedSales",o),this.httpService=e,this.csvConverter=a}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-exchanged-sales"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[3,"title"],[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(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/GetExchangedSales","ReportExchangedSales.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,jd,15,6,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,Xd,16,1,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,c.ir,C.QB,s.sg,u.yS],pipes:[s.JJ],styles:[""]}),n})();function tm(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Product"),t.qZA(),t.TgZ(3,"autocompleteV2",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ProductID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.ProductID)}}function em(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Product"),t.qZA(),t.TgZ(3,"autocompleteV2",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ProductID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.ProductID)}}function nm(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.YNc(10,tm,4,1,"div",10),t.YNc(11,em,4,1,"div",10),t.TgZ(12,"div"),t.TgZ(13,"h6"),t._uU(14,"Search By"),t.qZA(),t.TgZ(15,"radio-options",11),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SearchBy=a}),t.qZA(),t.qZA(),t.TgZ(16,"div"),t.TgZ(17,"h6"),t._uU(18,"Row Count"),t.qZA(),t.TgZ(19,"input",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.SearchBy),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.SearchBy),t.xp6(4),t.Q6J("model",e.pageData.Filter.SearchBy)("options",e.RadioSearchBy),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount)}}function am(n,i){if(1&n&&(t.TgZ(0,"tr",22),t.TgZ(1,"td",23),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",23),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",24),t._uU(9),t.ALo(10,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.Rank),t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(t.lcZ(7,4,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(10,6,e.UnitsInStock))}}function om(n,i){if(1&n&&(t.TgZ(0,"div",15),t.TgZ(1,"table",16),t.TgZ(2,"thead",17),t.TgZ(3,"tr"),t.TgZ(4,"th",18),t._uU(5,"Rank"),t.qZA(),t.TgZ(6,"th",19),t._uU(7,"Name"),t.qZA(),t.TgZ(8,"th",20),t._uU(9,"Sold"),t.qZA(),t.TgZ(10,"th",20),t._uU(11,"Inventory"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(12,"tbody"),t.YNc(13,am,11,8,"tr",21),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(13),t.Q6J("ngForOf",e.data.Data)}}let rm=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/GetSalesRankByVariantModel","ReportLoader/GetSalesRankByVariantModel",o),this.httpService=e,this.csvConverter=a,this.RadioSearchBy=[{Key:!0,Value:"Name"},{Key:!1,Value:"Code"}]}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-variant-model-rank"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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"],["name","From",3,"date","dateChange"],["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-right",2,"width","70px"],[2,"width","800px"],[1,"text-right",2,"width","100px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[1,"text-right"],[1,"text-success","text-right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/GetSalesRankByVariantModel","ReportSalesRankByVariantModel.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,nm,20,9,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,om,14,1,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,C.QB,q.P,p.Fj,D.J,s.sg],pipes:[s.JJ],styles:[""]}),n})();function im(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Discount(%) From / To"),t.qZA(),t.TgZ(13,"div",11),t.TgZ(14,"div",12),t.TgZ(15,"input",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.DiscountFrom=a}),t.qZA(),t.qZA(),t.TgZ(16,"div",14),t.TgZ(17,"input",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.DiscountTo=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(6),t.Q6J("ngModel",e.pageData.Filter.DiscountFrom),t.xp6(2),t.Q6J("ngModel",e.pageData.Filter.DiscountTo)}}const lm=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},sm=function(n){return{ID:n}};function pm(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",21),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td"),t.TgZ(7,"a",25),t._uU(8),t.qZA(),t.qZA(),t.TgZ(9,"td",21),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",21),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",21),t._uU(16),t.ALo(17,"number"),t.qZA(),t.TgZ(18,"td",21),t._uU(19),t.ALo(20,"number"),t.qZA(),t.TgZ(21,"td",21),t._uU(22),t.ALo(23,"number"),t.qZA(),t.TgZ(24,"td",21),t._uU(25),t.ALo(26,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.VariantName),t.xp6(2),t.Oqu(t.lcZ(5,11,e.Quantity)),t.xp6(3),t.Q6J("routerLink",t.DdM(25,lm))("queryParams",t.VKq(26,sm,e.InvoiceID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Oqu(t.lcZ(11,13,e.ItemDiscount)),t.xp6(3),t.Oqu(t.lcZ(14,15,e.OrderDiscount)),t.xp6(3),t.Oqu(t.lcZ(17,17,e.OrderDiscount2)),t.xp6(3),t.Oqu(t.lcZ(20,19,e.OrderDiscountAmount)),t.xp6(3),t.Oqu(t.lcZ(23,21,e.UnitPrice)),t.xp6(3),t.Oqu(t.lcZ(26,23,e.NetSales))}}function cm(n,i){if(1&n&&(t.TgZ(0,"div",15),t.TgZ(1,"table",16),t.TgZ(2,"thead",17),t.TgZ(3,"tr"),t.TgZ(4,"th"),t._uU(5,"Name"),t.qZA(),t.TgZ(6,"th",18),t._uU(7,"Qty"),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Number"),t.qZA(),t.TgZ(10,"th",19),t._uU(11,"Item %"),t.qZA(),t.TgZ(12,"th",19),t._uU(13,"Order %"),t.qZA(),t.TgZ(14,"th",19),t._uU(15,"Order2 %"),t.qZA(),t.TgZ(16,"th",20),t._uU(17,"Order % Amount"),t.qZA(),t.TgZ(18,"th",20),t._uU(19,"Unit Price"),t.qZA(),t.TgZ(20,"th",21),t._uU(21,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(22,"tbody"),t.YNc(23,pm,27,28,"tr",22),t.qZA(),t.TgZ(24,"tfoot"),t.TgZ(25,"tr",23),t.TgZ(26,"td",21),t._uU(27,"Total : "),t.qZA(),t.TgZ(28,"td",21),t._uU(29),t.ALo(30,"number"),t.ALo(31,"sum"),t.qZA(),t.TgZ(32,"td",24),t._uU(33),t.ALo(34,"number"),t.ALo(35,"sum"),t.qZA(),t.TgZ(36,"td",21),t._uU(37),t.ALo(38,"number"),t.ALo(39,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(23),t.Q6J("ngForOf",e.data.Data),t.xp6(6),t.Oqu(t.lcZ(30,4,t.xi3(31,6,e.data.Data,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(34,9,t.xi3(35,11,e.data.Data,"UnitPrice"))),t.xp6(4),t.Oqu(t.lcZ(38,14,t.xi3(39,16,e.data.Data,"NetSales")))}}const um=function(){return["/menu/Reports/Sales_Report/Standard/Discounted_Sales/Discounted_Products"]};let gm=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetDiscountsales","ReportLoader/GetDiscountSales"),this.httpService=e,this.csvConverter=o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-discounted-sales"]],features:[t.qOj],decls:12,vars:6,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[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"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pr-2"],["type","number",1,"form-control",3,"ngModel","ngModelChange"],[1,"col-6","pl-2"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-right",2,"width","25px"],[1,"text-right",2,"width","100px"],[1,"text-right",2,"width","150px"],[1,"text-right"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","6",1,"text-right"],[3,"routerLink","queryParams"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,!0,"SalesTransaction.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"Discounted Products"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,im,18,6,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,cm,40,19,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(5),t.Q6J("routerLink",t.DdM(5,um)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,C.QB,p.wV,p.Fj,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function dm(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Customer"),t.qZA(),t.TgZ(8,"autocompleteV2",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CustomerID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From/To"),t.qZA(),t.TgZ(12,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CustomerID),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}const mm=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},Zm=function(n){return{ID:n}};function hm(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"a",20),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.ALo(8,"date"),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.qZA(),t.TgZ(11,"td"),t._uU(12),t.qZA(),t.TgZ(13,"td",15),t._uU(14),t.ALo(15,"number"),t.qZA(),t.TgZ(16,"td",15),t._uU(17),t.ALo(18,"number"),t.qZA(),t.TgZ(19,"td",21),t._uU(20),t.qZA(),t.TgZ(21,"td",15),t._uU(22),t.ALo(23,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.EntityName),t.xp6(2),t.Q6J("routerLink",t.DdM(20,mm))("queryParams",t.VKq(21,Zm,e.InvoiceID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Oqu(t.xi3(8,11,e.Date,"dd MMM yyyy")),t.xp6(3),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.hij("(",t.lcZ(15,14,e.Quantity),")"),t.xp6(3),t.Oqu(t.lcZ(18,16,e.UnitPrice)),t.xp6(3),t.hij("",e.Discount&&0!=e.Discount?-e.Discount+"%":""," "),t.xp6(2),t.hij("(",t.lcZ(23,18,e.Total),")")}}function xm(n,i){if(1&n&&(t.TgZ(0,"div",11),t.TgZ(1,"table",12),t.TgZ(2,"thead",13),t.TgZ(3,"tr"),t.TgZ(4,"th"),t._uU(5,"Outlet"),t.qZA(),t.TgZ(6,"th",14),t._uU(7,"Number"),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Date"),t.qZA(),t.TgZ(10,"th"),t._uU(11,"Name"),t.qZA(),t.TgZ(12,"th"),t._uU(13,"Code"),t.qZA(),t.TgZ(14,"th",15),t._uU(15,"Quantity"),t.qZA(),t.TgZ(16,"th",15),t._uU(17),t.qZA(),t.TgZ(18,"th",16),t._uU(19,"%"),t.qZA(),t.TgZ(20,"th",15),t._uU(21),t.qZA(),t.qZA(),t.qZA(),t.TgZ(22,"tbody"),t.YNc(23,hm,24,23,"tr",17),t.qZA(),t.TgZ(24,"tfoot"),t.TgZ(25,"tr",18),t._UZ(26,"td",19),t._UZ(27,"td",19),t._UZ(28,"td",19),t._UZ(29,"td",19),t._UZ(30,"td",19),t.TgZ(31,"td",15),t._uU(32),t.ALo(33,"number"),t.ALo(34,"sum"),t.qZA(),t._UZ(35,"td",19),t._UZ(36,"td",19),t.TgZ(37,"td",15),t._uU(38),t.ALo(39,"number"),t.ALo(40,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(17),t.hij("Price (",e.data.CurrencySymbol,")"),t.xp6(4),t.hij("Total(",e.data.CurrencySymbol,")"),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(9),t.Oqu(t.lcZ(33,5,t.xi3(34,7,e.data.Data,"Quantity"))),t.xp6(6),t.Oqu(t.lcZ(39,10,t.xi3(40,12,e.data.Data,"Total")))}}let Tm=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/SalesReturnList","ReportLoader/ReturnReportLoader",o),this.httpService=e,this.csvConverter=a}postInit(e){this.menuData.H=e.PageTitle}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-sales-return"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-right"],[2,"width","30px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[3,"routerLink","queryParams"],[1,"text-danger"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/SalesReturnExport",o.menuData.H+".csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,dm,14,5,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,xm,41,15,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,D.J,C.QB,s.sg,u.yS],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function Cm(n,i){if(1&n&&(t._UZ(0,"td",36),t.ALo(1,"number")),2&n){const e=t.oxw().$implicit;t.Q6J("innerHtml",t.lcZ(1,1,e.UnitCost),t.oJD)}}function fm(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._UZ(2,"span",29),t._UZ(3,"span",30),t.ALo(4,"newlines"),t.qZA(),t._UZ(5,"td",31),t.TgZ(6,"td",14),t._uU(7),t.ALo(8,"number"),t.qZA(),t._UZ(9,"td",32),t.YNc(10,Cm,2,3,"td",33),t._UZ(11,"td",34),t.ALo(12,"number"),t.TgZ(13,"td",35),t._uU(14),t.qZA(),t._UZ(15,"td",34),t.ALo(16,"number"),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(3);t.xp6(2),t.Q6J("innerHtml",e.Name,t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(4,9,e.Note),t.oJD),t.xp6(2),t.Q6J("innerHtml",e.Code,t.oJD),t.xp6(2),t.hij("(",t.lcZ(8,11,e.Quantity),")"),t.xp6(2),t.Q6J("innerHtml",e.UOMName,t.oJD),t.xp6(1),t.Q6J("ngIf",o.pageData.HasRoleCost),t.xp6(1),t.Q6J("innerHtml",t.lcZ(12,13,e.UnitPrice),t.oJD),t.xp6(3),t.hij(" ",0==e.Discount?"":"-"+e.Discount+"%",""),t.xp6(1),t.Q6J("innerHtml",t.lcZ(16,15,e.Total),t.oJD)}}const Am=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},qm=function(n){return{ID:n}};function Dm(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"div",18),t.TgZ(2,"a",19),t._UZ(3,"span",20),t.ALo(4,"date"),t.ALo(5,"date"),t.qZA(),t.TgZ(6,"span"),t._uU(7),t.ALo(8,"showIfNotNullOrEmptyString"),t.qZA(),t.qZA(),t.TgZ(9,"div",21),t.TgZ(10,"div"),t.TgZ(11,"table",22),t._UZ(12,"thead"),t.TgZ(13,"tbody"),t.YNc(14,fm,17,17,"tr",17),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(15,"table",23),t.TgZ(16,"thead"),t.TgZ(17,"tr",24),t.TgZ(18,"td",25),t._uU(19,"Total"),t.qZA(),t.TgZ(20,"td",26),t._uU(21,"\xa0"),t.qZA(),t.TgZ(22,"td",14),t._uU(23),t.ALo(24,"number"),t.qZA(),t._UZ(25,"td",27),t.TgZ(26,"td",26),t._uU(27,"\xa0"),t.qZA(),t.TgZ(28,"td",28),t._uU(29,"\xa0"),t.qZA(),t.TgZ(30,"td",14),t._uU(31),t.ALo(32,"number"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.DdM(20,Am))("queryParams",t.VKq(21,qm,e.InvoiceID)),t.xp6(1),t.Q6J("innerHtml",e.EntityName+" #"+e.Number+" - "+t.xi3(4,7,e.Date,"dd MMM yyyy")+" ("+t.xi3(5,10,e.Created,"HH:mm")+") : ",t.oJD),t.xp6(4),t.hij(" ",t.xi3(8,13,e.CustomerNameDisplay," - {0}")," "),t.xp6(7),t.Q6J("ngForOf",e.Item),t.xp6(9),t.hij("",t.lcZ(24,16,o.data.Quantity),"\xa0"),t.xp6(8),t.hij("",t.lcZ(32,18,o.data.TotalPrice),"\xa0")}}function ym(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",2),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/PurchaseReturnList",a.data.PageTitle+".csv")}),t._UZ(3,"i",3),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",4),t.TgZ(7,"div",5),t.TgZ(8,"div"),t.TgZ(9,"h6"),t._uU(10,"Outlet"),t.qZA(),t.TgZ(11,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(12,"div"),t.TgZ(13,"h6"),t._uU(14,"Supplier"),t.qZA(),t.TgZ(15,"autocompleteV2",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SupplierID=a}),t.qZA(),t.qZA(),t.TgZ(16,"div"),t.TgZ(17,"h6"),t._uU(18,"From/To"),t.qZA(),t.TgZ(19,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(20,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(21,"content"),t.TgZ(22,"div",10),t.TgZ(23,"table",11),t.TgZ(24,"thead",12),t.TgZ(25,"tr"),t.TgZ(26,"th"),t._uU(27,"Name"),t.qZA(),t.TgZ(28,"th",13),t._uU(29,"Code"),t.qZA(),t.TgZ(30,"th",14),t._uU(31,"Quantity"),t.qZA(),t._UZ(32,"th",15),t.TgZ(33,"th",14),t._uU(34,"Unit Price(Rp.)"),t.qZA(),t.TgZ(35,"th",16),t._uU(36,"%"),t.qZA(),t.TgZ(37,"th",14),t._uU(38,"Total(Rp.)"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.YNc(39,Dm,33,23,"div",17),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(11),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SupplierID),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(19),t.Q6J("ngForOf",e.data.Data)}}let vm=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/PurchaseReturnList","ReportLoader/ReturnReportLoader"),this.httpService=e,this.csvConverter=o}preGetList(){null===this.pageData.Filter.EntityID&&(this.pageData.Filter.EntityID=x.gT.GuidEmpty)}postInit(){this.menuData.H=this.data.PageTitle}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-return"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[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"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light"],[2,"width","10%"],[1,"text-right",2,"width","10%"],[1,"UOMWidth",2,"width","50px"],[2,"width","5%"],[4,"ngFor","ngForOf"],[1,"mt-7","ml-5"],[1,"h5","text-primary","font-weight-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHtml"],[1,"items"],["cellspacing","0",1,"table-sm","table-striped","w-100","table-bordered","purchase-return"],[2,"width","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%"],[3,"innerHtml"],[1,"list-unstyled",3,"innerHtml"],[2,"width","10%",3,"innerHtml"],[1,"UOMWidth",2,"width","50px",3,"innerHtml"],["class","text-right alt","style","width: 80px;",3,"innerHtml",4,"ngIf"],[1,"text-right",2,"width","10%",3,"innerHtml"],[1,"small","text-danger",2,"width","5%"],[1,"text-right","alt",2,"width","80px",3,"innerHtml"]],template:function(e,o){1&e&&t.YNc(0,ym,40,8,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data&&o.pageData)},directives:[s.O5,d.p,c.w9,p.JJ,p.On,D.J,C.QB,s.sg,u.yS],pipes:[s.uU,T.WV,s.JJ,T.sH],styles:[".purchase-return[_ngcontent-%COMP%] {\n border-collapse: collapse;\n margin-top: 10px;\n margin-bottom: 10px;\n}"]}),n})();function Sm(n,i){if(1&n&&(t.TgZ(0,"span",17),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Mm(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",10),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Sm,2,2,"ng-template",13),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Sales"),t.qZA(),t.TgZ(13,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Customer"),t.qZA(),t.TgZ(17,"autocompleteV2",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CustomerID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Page Size"),t.qZA(),t.TgZ(21,"input",16),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.PageSize=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CustomerID),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.PageSize)}}function bm(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",18),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"From/To"),t.qZA(),t.TgZ(4,"datepicker",19),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(5,"datepicker",20),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Product"),t.qZA(),t.TgZ(9,"autocompleteV2",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ProductID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Variant"),t.qZA(),t.TgZ(13,"autocompleteV2",22),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.VariantID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("inputTextValue",e.pageData.Filter.ProductName)("ngModel",e.pageData.Filter.ProductID),t.xp6(4),t.Q6J("inputTextValue",e.pageData.Filter.VariantName)("ngModel",e.pageData.Filter.VariantID)}}function Jm(n,i){1&n&&(t.TgZ(0,"th",39),t._uU(1," Cost "),t.qZA())}function Om(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Name)}}function Im(n,i){if(1&n&&(t.TgZ(0,"td",43),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.UnitCost))}}function Um(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1,"%"),t.qZA())}function Fm(n,i){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.DiscountAmount))}}const wm=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},Nm=function(n){return{ID:n}};function Pm(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.ALo(5,"date"),t.qZA(),t.TgZ(6,"td"),t.TgZ(7,"a",40),t._uU(8),t.qZA(),t.qZA(),t.TgZ(9,"td"),t.YNc(10,Om,2,1,"span",38),t._UZ(11,"span",41),t.TgZ(12,"i",42),t._uU(13),t.qZA(),t.qZA(),t.TgZ(14,"td"),t._uU(15),t.qZA(),t.TgZ(16,"td"),t._uU(17),t.qZA(),t.TgZ(18,"td",43),t._uU(19),t.ALo(20,"number"),t.qZA(),t.YNc(21,Im,3,3,"td",44),t.TgZ(22,"td",43),t._uU(23),t.ALo(24,"number"),t.qZA(),t.TgZ(25,"td",45),t.TgZ(26,"div"),t._uU(27),t.ALo(28,"number"),t.YNc(29,Um,2,0,"span",38),t.qZA(),t.YNc(30,Fm,3,3,"div",38),t.qZA(),t.TgZ(31,"td",43),t._uU(32),t.ALo(33,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.Outlet),t.xp6(2),t.Oqu(t.xi3(5,17,e.Date,"dd MMM yy")),t.xp6(3),t.Q6J("routerLink",t.DdM(28,wm))("queryParams",t.VKq(29,Nm,e.InvoiceID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Q6J("ngIf",""===o.pageData.Filter.ProductName||""===o.pageData.Filter.VariantName),t.xp6(1),t.Q6J("innerHtml",e.Note,t.oJD),t.xp6(2),t.Oqu(e.NoteOrder),t.xp6(2),t.Oqu(e.CustomerName),t.xp6(2),t.Oqu(e.SalesPerson),t.xp6(2),t.Oqu(t.lcZ(20,20,e.Quantity)),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleCost),t.xp6(2),t.Oqu(t.lcZ(24,22,e.UnitPrice)),t.xp6(4),t.Oqu(0==e.Discount?"":t.lcZ(28,24,e.Discount)),t.xp6(2),t.Q6J("ngIf",e.Discount),t.xp6(1),t.Q6J("ngIf",0!=e.DiscountAmount),t.xp6(2),t.Oqu(t.lcZ(33,26,e.Total))}}function Lm(n,i){1&n&&t._UZ(0,"td",50)}function Qm(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",46),t.TgZ(2,"td",47),t._uU(3,"Total:"),t.qZA(),t.TgZ(4,"td",43),t._uU(5),t.ALo(6,"number"),t.ALo(7,"sum"),t.qZA(),t.YNc(8,Lm,1,0,"td",48),t._UZ(9,"td",49),t.TgZ(10,"td",43),t._uU(11),t.ALo(12,"number"),t.ALo(13,"sum"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(5),t.Oqu(t.lcZ(6,3,t.xi3(7,5,e.data.Data,"Quantity"))),t.xp6(3),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(3),t.Oqu(t.lcZ(12,8,t.xi3(13,10,e.data.Data,"Total")))}}function Ym(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",23),t.TgZ(1,"table",24),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",25),t.TgZ(3,"tr"),t.TgZ(4,"th",26),t._uU(5,"Outlet"),t.qZA(),t.TgZ(6,"th",27),t._uU(7,"Date"),t.qZA(),t.TgZ(8,"th",28),t._uU(9,"Invoice #"),t.qZA(),t.TgZ(10,"th",29),t._uU(11,"Product / Note"),t.qZA(),t.TgZ(12,"th",30),t._uU(13,"Customer"),t.qZA(),t.TgZ(14,"th",31),t._uU(15,"SALES PERSON"),t.qZA(),t.TgZ(16,"th",32),t._uU(17,"Qty"),t.qZA(),t.YNc(18,Jm,2,0,"th",33),t.TgZ(19,"th",34),t._uU(20,"Price"),t.qZA(),t.TgZ(21,"th",35),t._uU(22,"Disc."),t.qZA(),t.TgZ(23,"th",36),t._uU(24,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(25,"tbody"),t.YNc(26,Pm,34,31,"tr",37),t.qZA(),t.YNc(27,Qm,14,13,"tfoot",38),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(18),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(8),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.Data.length>0)}}const Rm=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]};let km=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/ProductSalesByInvoice","ReportLoader/ProductSalesByInvoice",null,a),this.httpService=e,this.csvConverter=o,this.activatedRoute=a,this.hideMore=!0}postInit(e){this.menuData.H=this.pageData.PageTitle,this.originalData=e.Data}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Outlet":return this.compare(a.Outlet,r.Outlet,l);case"Date":return this.compare(a.Date,r.Date,l);case"Number":return this.compare(a.Number,r.Number,l);case"Note":return this.compare(a.Note,r.Note,l);case"CustomerName":return this.compare(a.CustomerName,r.CustomerName,l);case"SalesPerson":return this.compare(a.SalesPerson,r.SalesPerson,l);case"UnitCost":return this.compare(a.UnitCost,r.UnitCost,l);case"UnitPrice":return this.compare(a.UnitPrice,r.UnitPrice,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Discount":return this.compare(a.Discount,r.Discount,l);case"Total":return this.compare(a.TotalAfterDiscount,r.TotalAfterDiscount,l);default:return 0}}):this.originalData}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-invoice-items"]],features:[t.qOj],decls:16,vars:7,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],["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",""],["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","number","min","0",1,"w-100",3,"ngModel","ngModelChange"],[3,"title"],["id","more-filter","container","",1,"ml-6"],["name","From",3,"date","dateChange"],["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"],["mat-sort-header","Date",2,"width","80px"],["mat-sort-header","Number",2,"width","120px"],["mat-sort-header","Note"],["mat-sort-header","CustomerName"],["mat-sort-header","SalesPerson"],["mat-sort-header","Quantity",1,"align-right",2,"width","60px"],["mat-sort-header","UnitCost","style","width: 120px;","class","align-right",4,"ngIf"],["mat-sort-header","UnitPrice",1,"align-right",2,"width","120px"],["mat-sort-header","Discount",1,"align-right",2,"width","45px"],["mat-sort-header","Total",1,"align-right",2,"width","120px"],[4,"ngFor","ngForOf"],[4,"ngIf"],["mat-sort-header","UnitCost",1,"align-right",2,"width","120px"],["target","_blank",3,"routerLink","queryParams"],[2,"word-break","break-all",3,"innerHtml"],[1,"text-info"],[1,"text-right"],["class","text-right",4,"ngIf"],[1,"text-right","text-danger"],[1,"table-footer"],["colspan","6",1,"text-right","empty-column"],["class","empty-column",4,"ngIf"],["colspan","2",1,"empty-column"],[1,"empty-column"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"Report/ProductSalesByInvoice","Invoice_Item_Details.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"Group by Product"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,Mm,22,8,"div",5),t.YNc(10,bm,14,6,"div",6),t.qZA(),t.TgZ(11,"a",7),t.NdJ("click",function(){return o.hideMore=!o.hideMore}),t._uU(12,"More "),t._UZ(13,"i",8),t.qZA(),t.qZA(),t.TgZ(14,"content"),t.YNc(15,Ym,28,3,"div",9),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(5),t.Q6J("routerLink",t.DdM(6,Rm)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!o.hideMore),t.xp6(5),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,D.J,p.qQ,p.wV,p.Fj,C.QB,Z.YE,Z.nU,s.sg],pipes:[s.uU,s.JJ,T.qU],styles:[""]}),n})();function Em(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",7),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/CustomerBrand","Brand_Sales_Analysis.csv")}),t._UZ(1,"i",8),t._uU(2," Export "),t.qZA()}}function Hm(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",9),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Brand"),t.qZA(),t.TgZ(4,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListBrandID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From - To"),t.qZA(),t.TgZ(8,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",12),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Row Count"),t.qZA(),t.TgZ(13,"input",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListBrandID)("items",null==e.pageData.Options?null:e.pageData.Options.Brand),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount)}}function Vm(n,i){1&n&&(t.TgZ(0,"th",28),t._uU(1,"Total Cost"),t.qZA())}function Bm(n,i){1&n&&(t.TgZ(0,"th",29),t._uU(1,"Profit"),t.qZA())}function Gm(n,i){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.TotalCost?e.TotalCost:0),"")}}const pt=function(n,i){return{"text-danger":n,"text-success":i}};function jm(n,i){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",t.WLB(4,pt,e.Profit<0,e.Profit>0)),t.xp6(1),t.hij(" ",t.lcZ(2,2,e.Profit),"")}}function Wm(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td",35),t._uU(2),t.qZA(),t.TgZ(3,"td",36),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",37),t._uU(7),t.ALo(8,"number"),t.qZA(),t.YNc(9,Gm,3,3,"td",38),t.YNc(10,jm,3,7,"td",39),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(3);t.xp6(2),t.Oqu(e.BrandName),t.xp6(2),t.hij(" ",t.lcZ(5,5,e.Quantity?e.Quantity:0),""),t.xp6(3),t.hij(" ",t.lcZ(8,7,e.TotalSales?e.TotalSales:0),""),t.xp6(2),t.Q6J("ngIf",o.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",o.pageData.IsCostVisible)}}const $m=function(){return["/menu/Contacts/Contact/Customers/Info"]},Km=function(n){return{ID:n}};function Xm(n,i){if(1&n&&(t.TgZ(0,"tr",30),t.TgZ(1,"td"),t.TgZ(2,"a",31),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"td",18),t._uU(5),t.qZA(),t.TgZ(6,"td",19),t._uU(7),t.qZA(),t.TgZ(8,"td",20),t._uU(9),t.qZA(),t.TgZ(10,"td",32),t.TgZ(11,"table",33),t.YNc(12,Wm,11,9,"tr",34),t.qZA(),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Q6J("routerLink",t.DdM(8,$m))("queryParams",t.VKq(9,Km,e.CustomerID)),t.xp6(1),t.AsE(" ",e.Name," ",e.Title," "),t.xp6(2),t.Oqu(e.Email),t.xp6(2),t.Oqu(e.Mobile),t.xp6(2),t.Oqu(e.City),t.xp6(3),t.Q6J("ngForOf",e.Detail)}}function zm(n,i){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.hij(" ",t.lcZ(2,1,e.data.Total.TotalCost)," ")}}function t1(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(4,pt,e.data.Total.Profit<0,e.data.Total.Profit>0)),t.xp6(1),t.hij(" ",t.lcZ(2,2,e.data.Total.Profit)," ")}}function e1(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",42),t._UZ(2,"td",43),t.TgZ(3,"td",44),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",44),t._uU(7),t.ALo(8,"number"),t.qZA(),t.YNc(9,zm,3,3,"td",45),t.YNc(10,t1,3,7,"td",46),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(4),t.hij(" ",t.lcZ(5,4,e.data.Total.Quantity)," "),t.xp6(3),t.hij(" ",t.lcZ(8,6,e.data.Total.TotalSales)," "),t.xp6(2),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible)}}function n1(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",14),t.TgZ(1,"table",15),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",16),t.TgZ(3,"tr"),t.TgZ(4,"th",17),t._uU(5,"Customer"),t.qZA(),t.TgZ(6,"th",18),t._uU(7,"Email"),t.qZA(),t.TgZ(8,"th",19),t._uU(9,"Mobile"),t.qZA(),t.TgZ(10,"th",20),t._uU(11,"City"),t.qZA(),t.TgZ(12,"th",21),t._uU(13,"Brand"),t.qZA(),t.TgZ(14,"th",22),t._uU(15," Qty "),t.qZA(),t.TgZ(16,"th",23),t._uU(17,"Total Sales"),t.qZA(),t.YNc(18,Vm,2,0,"th",24),t.YNc(19,Bm,2,0,"th",25),t.qZA(),t.qZA(),t.TgZ(20,"tbody"),t.YNc(21,Xm,13,11,"tr",26),t.qZA(),t.YNc(22,e1,11,8,"tfoot",27),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(18),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data)}}const a1=function(){return["/menu/Reports/Sales_Report/Standard/Top_Brand"]};function r1(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function i1(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Compare with prev Month"),t.qZA(),t.TgZ(3,"radio-options",10),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).isCompareData=a})("modelChange",function(){return t.CHM(e),t.oxw(2).OnCompare("Data")}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("model",e.isCompareData)}}function l1(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",11),t.TgZ(4,"div",12),t.TgZ(5,"ng-select",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Year=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA(),t.TgZ(6,"div",14),t.TgZ(7,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Month=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("ngModel",e.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.Month)("items",e.Months)}}function s1(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",4),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Type"),t.qZA(),t.TgZ(4,"ng-select",5),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Date Filter Type"),t.qZA(),t.TgZ(8,"radio-options",6),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().DateFilterType=a}),t.qZA(),t.qZA(),t.YNc(9,r1,5,2,"div",7),t.YNc(10,i1,4,1,"div",7),t.YNc(11,l1,8,4,"div",7),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(4),t.Q6J("model",e.DateFilterType)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.DateFilterType),t.xp6(1),t.Q6J("ngIf",e.DateFilterType),t.xp6(1),t.Q6J("ngIf",e.DateFilterType)}}function p1(n,i){1&n&&(t.TgZ(0,"th",38),t._uU(1,"Prev"),t.qZA())}function c1(n,i){1&n&&(t.TgZ(0,"th",38),t._uU(1,"Now"),t.qZA())}function _1(n,i){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Trans "),t.qZA())}function u1(n,i){1&n&&(t.TgZ(0,"th",40),t._uU(1,"Qty"),t.qZA())}function g1(n,i){if(1&n&&(t.TgZ(0,"th",41),t._uU(1,"Tax"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet")}}function d1(n,i){if(1&n&&(t.TgZ(0,"th",41),t._uU(1," Sales + Tax"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function m1(n,i){1&n&&(t.TgZ(0,"th",33),t._uU(1,"\xb1 (%)"),t.qZA())}function Z1(n,i){1&n&&(t.TgZ(0,"th",42),t._uU(1,"Cost"),t.qZA())}function h1(n,i){if(1&n&&(t.TgZ(0,"th",41),t._uU(1," Profit"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function x1(n,i){1&n&&(t.TgZ(0,"th",43),t._uU(1," Target"),t.qZA())}function T1(n,i){1&n&&(t.TgZ(0,"th",44),t._uU(1," Ach(%)"),t.qZA())}function C1(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.PrevIndex)}}const f1=function(n,i){return{rankDown:n,rankUp:i,"number key":!0}};function A1(n,i){if(1&n&&(t.TgZ(0,"td",48),t._uU(1),t.qZA()),2&n){const e=t.oxw(),o=e.$implicit,a=e.index;t.Q6J("ngClass",t.WLB(2,f1,o.PrevIndex<a+1,o.PrevIndex>a+1)),t.xp6(1),t.hij(" ",o.CurrentIndex," ")}}function q1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,e.Quantity,".0-0"))}}function D1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,e.Count,".0-0"))}}function y1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,e.Tax,".0-0"))}}const v1=function(){return["/menu/Reports/Sales_Report/Standard/Detail"]},S1=function(n,i,e){return{From:n,To:i,TypeID:e}};function M1(n,i){if(1&n&&(t.TgZ(0,"td",33),t.TgZ(1,"a",49),t.ALo(2,"date"),t.ALo(3,"date"),t.TgZ(4,"b"),t._uU(5),t.ALo(6,"number"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("routerLink",t.DdM(12,v1))("queryParams",t.kEZ(13,S1,t.xi3(2,3,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(3,6,o.pageData.Filter.To,"ddMMyyyy"),e.TypeID)),t.xp6(4),t.Oqu(t.xi3(6,9,e.SalesWithTax,".0-0"))}}const ct=function(n,i){return{"text-warning":n,"text-success":i,"text-right":!0}};function b1(n,i){if(1&n&&(t.TgZ(0,"td",50),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",t.WLB(5,ct,e.IsNegative,e.IsPositive)),t.xp6(1),t.hij(" ",t.xi3(2,2,e.Increase,".0-0"),"")}}function J1(n,i){if(1&n&&(t.TgZ(0,"td",51),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.Cost,".0-0")," ")}}function O1(n,i){if(1&n&&(t.TgZ(0,"td",52),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,o.pageData.IgnoreTax?e.ProfitWithTax:e.Profit,".0-0"),"")}}function I1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.SalesTarget,".0-0"),"")}}const F=function(n,i){return{"text-danger":n,"text-success":i}};function U1(n,i){if(1&n&&(t.TgZ(0,"span",50),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.Q6J("ngClass",t.WLB(5,F,e.Achievement<0,e.Achievement>0)),t.xp6(1),t.Oqu(t.xi3(2,2,e.Achievement,".0-0"))}}function F1(n,i){if(1&n&&(t.TgZ(0,"span",50),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.Q6J("ngClass",t.WLB(5,F,e.AchievementWithTax<0,e.AchievementWithTax>0)),t.xp6(1),t.hij("",t.xi3(2,2,e.AchievementWithTax,".0-0")," ")}}function w1(n,i){if(1&n&&(t.TgZ(0,"td",33),t.YNc(1,U1,3,8,"span",35),t.YNc(2,F1,3,8,"span",35),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Q6J("ngIf",!e.pageData.IgnoreTax),t.xp6(1),t.Q6J("ngIf",e.pageData.IgnoreTax)}}function N1(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",31),t._uU(4),t.qZA(),t.YNc(5,C1,2,1,"td",45),t.YNc(6,A1,2,5,"td",46),t.YNc(7,q1,3,4,"td",25),t.YNc(8,D1,3,4,"td",25),t.TgZ(9,"td",33),t._uU(10),t.ALo(11,"number"),t.qZA(),t.YNc(12,y1,3,4,"td",25),t.ALo(13,"HideSumZero"),t.YNc(14,M1,7,17,"td",25),t.YNc(15,b1,3,8,"td",35),t.YNc(16,J1,3,4,"td",36),t.YNc(17,O1,3,4,"td",37),t.YNc(18,I1,3,4,"td",25),t.ALo(19,"HideSumZero"),t.YNc(20,w1,3,2,"td",25),t.ALo(21,"HideSumZero"),t.ALo(22,"HideSumZero"),t.qZA()),2&n){const e=i.$implicit,o=i.index,a=t.oxw(2);t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Oqu(e.Name),t.xp6(1),t.Q6J("ngIf",a.isCompareData),t.xp6(1),t.Q6J("ngIf",a.isCompareData),t.xp6(1),t.Q6J("ngIf",a.data.WithCategory),t.xp6(1),t.Q6J("ngIf",!a.data.WithCategory),t.xp6(2),t.Oqu(t.xi3(11,14,e.SalesNet,".0-0")),t.xp6(2),t.Q6J("ngIf",!a.data.WithCategory&&t.xi3(13,17,a.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!a.data.WithCategory),t.xp6(1),t.Q6J("ngIf",a.isCompareData),t.xp6(1),t.Q6J("ngIf",a.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",a.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",t.xi3(19,20,a.data.Data,"SalesTarget")),t.xp6(2),t.Q6J("ngIf",t.xi3(21,23,a.data.Data,"AchievementWithTax")||t.xi3(22,26,a.data.Data,"Achievement"))}}function P1(n,i){1&n&&t._UZ(0,"td",53)}function L1(n,i){1&n&&t._UZ(0,"td",53)}function Q1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Count"),".0-0"),"")}}function Y1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Quantity"),".0-0"),"")}}function R1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Tax"),".0-0")," ")}}function k1(n,i){if(1&n&&(t.TgZ(0,"td",54),t.TgZ(1,"a",55),t._uU(2),t.ALo(3,"number"),t.ALo(4,"sum"),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(2),t.Oqu(t.xi3(3,1,t.xi3(4,4,e.data.Data,"SalesWithTax"),".0-0"))}}function E1(n,i){if(1&n&&(t.TgZ(0,"td",50),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.WLB(5,ct,e.comparation<0,e.comparation>0)),t.xp6(1),t.hij(" ",t.xi3(2,2,e.comparation,".0-0")," ")}}function H1(n,i){if(1&n&&(t.TgZ(0,"td",51),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Cost"),".0-0")," ")}}function V1(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(t.xi3(2,1,t.xi3(3,4,e.data.Data,"Profit"),".0-0"))}}function B1(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.hij("",t.xi3(2,1,t.xi3(3,4,e.data.Data,"ProfitWithTax"),".0-0")," ")}}function G1(n,i){if(1&n&&(t.TgZ(0,"td",52),t.YNc(1,V1,4,7,"span",7),t.YNc(2,B1,4,7,"span",7),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",!e.pageData.IgnoreTax),t.xp6(1),t.Q6J("ngIf",e.pageData.IgnoreTax)}}function j1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Expense"),".0-0"),"")}}function W1(n,i){if(1&n&&(t.TgZ(0,"span",50),t.ALo(1,"sum"),t.ALo(2,"sum"),t.ALo(3,"sum"),t.ALo(4,"sum"),t._uU(5),t.ALo(6,"number"),t.ALo(7,"sum"),t.ALo(8,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(23,F,t.xi3(1,2,e.data.Data,"Sales")/t.xi3(2,5,e.data.Data,"SalesTarget")<0,t.xi3(3,8,e.data.Data,"Sales")/t.xi3(4,11,e.data.Data,"SalesTarget")>0)),t.xp6(5),t.Oqu(t.xi3(6,14,t.xi3(7,17,e.data.Data,"Sales")/t.xi3(8,20,e.data.Data,"SalesTarget"),".0-0"))}}function $1(n,i){if(1&n&&(t.TgZ(0,"span",50),t.ALo(1,"sum"),t.ALo(2,"sum"),t.ALo(3,"sum"),t.ALo(4,"sum"),t._uU(5),t.ALo(6,"number"),t.ALo(7,"sum"),t.ALo(8,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(23,F,t.xi3(1,2,e.data.Data,"SalesWithTax")/t.xi3(2,5,e.data.Data,"SalesTarget")<0,t.xi3(3,8,e.data.Data,"SalesWithTax")/t.xi3(4,11,e.data.Data,"SalesTarget")>0)),t.xp6(5),t.hij("",t.xi3(6,14,t.xi3(7,17,e.data.Data,"SalesWithTax")/t.xi3(8,20,e.data.Data,"SalesTarget"),".0-0")," ")}}function K1(n,i){if(1&n&&(t.TgZ(0,"td",33),t.YNc(1,W1,9,26,"span",35),t.YNc(2,$1,9,26,"span",35),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",!e.pageData.IgnoreTax),t.xp6(1),t.Q6J("ngIf",e.pageData.IgnoreTax)}}function X1(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",16),t.TgZ(1,"table",17),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",18),t.TgZ(3,"tr"),t.TgZ(4,"th"),t._uU(5,"No."),t.qZA(),t.TgZ(6,"th",19),t._uU(7,"Type"),t.qZA(),t.YNc(8,p1,2,0,"th",20),t.YNc(9,c1,2,0,"th",20),t.YNc(10,_1,2,0,"th",21),t.YNc(11,u1,2,0,"th",22),t.TgZ(12,"th",23),t._uU(13,"Sales"),t.qZA(),t.YNc(14,g1,2,1,"th",24),t.ALo(15,"HideSumZero"),t.YNc(16,d1,2,1,"th",24),t.YNc(17,m1,2,0,"th",25),t.YNc(18,Z1,2,0,"th",26),t.YNc(19,h1,2,1,"th",24),t.YNc(20,x1,2,0,"th",27),t.ALo(21,"HideSumZero"),t.YNc(22,T1,2,0,"th",28),t.ALo(23,"HideSumZero"),t.ALo(24,"HideSumZero"),t.qZA(),t.qZA(),t.TgZ(25,"tbody"),t.YNc(26,N1,23,29,"tr",29),t.qZA(),t.TgZ(27,"tfoot"),t.TgZ(28,"tr",30),t._UZ(29,"td"),t._UZ(30,"td",31),t.YNc(31,P1,1,0,"td",32),t.YNc(32,L1,1,0,"td",32),t.YNc(33,Q1,4,7,"td",25),t.YNc(34,Y1,4,7,"td",25),t.TgZ(35,"td",33),t._uU(36),t.ALo(37,"number"),t.ALo(38,"sum"),t.qZA(),t.YNc(39,R1,4,7,"td",25),t.ALo(40,"HideSumZero"),t.YNc(41,k1,5,7,"td",34),t.YNc(42,E1,3,8,"td",35),t.YNc(43,H1,4,7,"td",36),t.YNc(44,G1,3,2,"td",37),t.YNc(45,j1,4,7,"td",25),t.ALo(46,"HideSumZero"),t.YNc(47,K1,3,2,"td",25),t.ALo(48,"HideSumZero"),t.ALo(49,"HideSumZero"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(8),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(1),t.Q6J("ngIf",e.data.WithCategory),t.xp6(3),t.Q6J("ngIf",!e.data.WithCategory&&t.xi3(15,24,e.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",t.xi3(21,27,e.data.Data,"SalesTarget")),t.xp6(2),t.Q6J("ngIf",t.xi3(23,30,e.data.Data,"AchievementWithTax")||t.xi3(24,33,e.data.Data,"Achievement")),t.xp6(4),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(1),t.Q6J("ngIf",e.data.WithCategory),t.xp6(2),t.hij(" ",t.xi3(37,36,t.xi3(38,39,e.data.Data,"SalesNet"),".0-0")," "),t.xp6(3),t.Q6J("ngIf",!e.data.WithCategory&&t.xi3(40,42,e.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsExpense&&t.xi3(46,45,e.data.Data,"Expense")),t.xp6(2),t.Q6J("ngIf",t.xi3(48,48,e.data.Data,"AchievementWithTax")||t.xi3(49,51,e.data.Data,"Achievement"))}}function tZ(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Interval for Clustering"),t.qZA(),t.TgZ(3,"input",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Interval=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.Interval)}}function eZ(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",14),t._uU(4),t.ALo(5,"number"),t.qZA(),t._UZ(6,"td"),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.Key),t.xp6(2),t.Oqu(t.lcZ(5,2,e.Value))}}function nZ(n,i){if(1&n&&(t.TgZ(0,"div",7),t.TgZ(1,"table",8),t.TgZ(2,"thead",9),t.TgZ(3,"tr",10),t.TgZ(4,"th",11),t._uU(5,"Interval"),t.qZA(),t.TgZ(6,"th",12),t._uU(7,"Amount Of Products"),t.qZA(),t._UZ(8,"th"),t.qZA(),t.qZA(),t.TgZ(9,"tbody"),t.YNc(10,eZ,7,4,"tr",13),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(10),t.Q6J("ngForOf",e.data)}}const aZ=[{path:"Sales_Report/Standard/Detail",component:Wt},{path:"Sales_Report/Standard/Summary",component:De},{path:"Sales_Report/Standard/Top_Brand",component:we},{path:"Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis",component:(()=>{class n extends m.n{constructor(e,o){super(e,"Report/CustomerBrand","ReportLoader/CustomerBrand"),this.httpService=e,this.csvConverter=o}sortData(e){const o=this.data.Data.slice();e.active&&""!==e.direction?(this.data.Data=o.sort((a,r)=>{const l="asc"===e.direction;switch(a.Name=null==a.Name?"":a.Name,r.Name=null==r.Name?"":r.Name,e.active){case"Name":return this.compare(a.Name.toLocaleLowerCase(),r.Name.toLocaleLowerCase(),l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);default:return 0}}),this.data.Detail=o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"SalesNTax":return this.compare(a.TotalSales,r.TotalSales,l);case"Cost":return this.compare(a.TotalCost,r.TotalCost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);default:return 0}})):this.data.Data=o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-brand-sales-analysis"]],features:[t.qOj],decls:11,vars:7,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary mr-6",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","mr-6",3,"click"],[1,"fa","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose Brand",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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",2,"width","280px"],[2,"width","190px"],[2,"width","155px"],[2,"width","130px"],[2,"min-width","124px"],["mat-sort-header","Quantity","text","Qty",1,"text-right",2,"min-width","66px"],["mat-sort-header","SalesNTax","text","Total Sales",1,"text-right",2,"min-width","112px"],["mat-sort-header","Cost","text","Total Cost","class","text-right","style","min-width: 113px",4,"ngIf"],["mat-sort-header","Profit","text","Profit","class","text-right","style","min-width: 114px",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[4,"ngIf"],["mat-sort-header","Cost","text","Total Cost",1,"text-right",2,"min-width","113px"],["mat-sort-header","Profit","text","Profit",1,"text-right",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-left",2,"min-width","124px"],[1,"border-top-0",2,"min-width","66px"],[1,"border-top-0","text-right",2,"min-width","112px"],["class","border-top-0 text-right","style","min-width: 113px",4,"ngIf"],["class","border-top-0 text-right","style","min-width: 114px",3,"ngClass",4,"ngIf"],[1,"border-top-0","text-right",2,"min-width","113px"],[1,"border-top-0","text-right",2,"min-width","114px",3,"ngClass"],[1,"footer"],["colspan","5"],[1,"text-right"],["class","text-right",4,"ngIf"],["class","text-right",3,"ngClass",4,"ngIf"],[1,"text-right",3,"ngClass"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Em,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4," Top Brand "),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,Hm,14,6,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.TgZ(9,"div",5),t.YNc(10,n1,23,4,"div",6),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(1),t.Q6J("routerLink",t.DdM(6,a1)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(3),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,p.Fj,M.b,Z.YE,Z.nU,s.sg,s.mk],pipes:[s.JJ],styles:[""]}),n})()},{path:"Sales_Report/Standard/Top_Customers",component:tn},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Age",component:un},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender",component:An},{path:"Sales_Report/Standard/Top_Customers/Top_Suppliers",component:Nn},{path:"Sales_Report/Standard/Products_Sold",component:fa},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet",component:Ia},{path:"Sales_Report/Standard/Products_Sold/Product_Sales",component:Va},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Delivery",component:ao},{path:"Sales_Report/Standard/Category_Sold",component:Do},{path:"Sales_Report/Standard/Category_Sold/Category_By_Outlet",component:No},{path:"Sales_Report/Standard/Category_Sold/Category",component:Yo},{path:"Sales_Report/Standard/Peak_Hour",component:$o},{path:"Sales_Report/Standard/Peak_Hour/Visitor",component:ar},{path:"Sales_Report/Standard/Peak_Hour/Peak_Hour",component:hr},{path:"Sales_Report/Standard/Daily",component:Sr},{path:"Sales_Report/Standard/Daily/Daily_Table",component:hi},{path:"Sales_Report/Standard/Daily/Yearly",component:V},{path:"Sales_Report/Standard/Monthly",component:wr},{path:"Sales_Report/Standard/Monthly/Monthly_Table",component:Pi},{path:"Sales_Report/Standard/Monthly/Yearly_Table",component:V},{path:"Sales_Report/Standard/Daily/Daily_Quantity",component:Hi},{path:"Sales_Report/Standard/Daily/Daily_Quantity/Monthly",component:$i},{path:"Sales_Report/Standard/Outlet_Performance",component:Ml},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Graphic",component:Nl},{path:"Sales_Report/Standard/Outlet_Performance/Detail",component:Ws},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance",component:qp},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Monthly_Perfomance",component:Qp},{path:"Sales_Report/Standard/Sales_Order_Type",component:(()=>{class n extends m.n{constructor(e,o){super(e,"Report/OutletPerformanceByType","ReportLoader/OutletPerformance"),this.httpService=e,this.csvConverter=o,this.isCompareData=!1,this.hideMore=!0,this.DateFilterType=!1,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"}],this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];const a=new Date;this.Year=a.getFullYear(),this.Month=a.getMonth()}YearMonthToDateRange(){const e=new Date;null==this.Year&&(this.Year=e.getFullYear()),null==this.Month&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1).toDateString(),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0).toDateString()}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Name":return this.compare(a.Name,r.Name,l);case"Count":return this.compare(a.Count,r.Count,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Gross":return this.compare(a.Gross,r.Gross,l);case"SalesNet":case"SalesTaxNet":return this.compare(a.SalesNet,r.SalesNet,l);case"Tax":return this.compare(a.Tax,r.Tax,l);case"SalesWithTax":return this.compare(a.SalesWithTax,r.SalesWithTax,l);case"Cost":return this.compare(a.Cost,r.Cost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);case"ProfitWithTax":return this.compare(a.ProfitWithTax,r.ProfitWithTax,l);case"Expense":return this.compare(a.Expense,r.Expense,l);case"NetProfit":return this.compare(a.NetProfit,r.NetProfit,l);case"Target":case"SalesTarget":return this.compare(a.SalesTarget,r.SalesTarget,l);case"Achievement":return this.compare(a.Achievement,r.Achievement,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-by-sales-order-type"]],features:[t.qOj],decls:6,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["name","Date Filter",3,"model","options","modelChange"],[4,"ngIf"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["name","Compare",3,"model","modelChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","pl-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],[1,"container-fluid","mt-5"],["id","tableGrid","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","class","align-right",4,"ngIf"],["mat-sort-header","Quantity","class","align-right",4,"ngIf"],["mat-sort-header","SalesNet",1,"align-right"],["class","align-right",3,"mat-sort-header",4,"ngIf"],["class","text-right",4,"ngIf"],["mat-sort-header","Cost","class","align-right",4,"ngIf"],["mat-sort-header","Target","class","align-right",4,"ngIf"],["mat-sort-header","Achievement","class","align-right","title","Achievement",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"text-right"],["class","text-right text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-right text-danger",4,"ngIf"],["class","text-right text-success",4,"ngIf"],[2,"width","35px"],["mat-sort-header","Count",1,"align-right"],["mat-sort-header","Quantity",1,"align-right"],[1,"align-right",3,"mat-sort-header"],["mat-sort-header","Cost",1,"align-right"],["mat-sort-header","Target",1,"align-right"],["mat-sort-header","Achievement","title","Achievement",1,"align-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"],[1,"text-right","text-danger"],[1,"text-right","text-success"],[1,"empty-column"],[1,"text-right","text-primary"],[1,"font-weight-bold"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"filters"),t.TgZ(2,"div",1),t.YNc(3,s1,12,7,"div",2),t.qZA(),t.qZA(),t.TgZ(4,"content"),t.YNc(5,X1,50,54,"div",3),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(3),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,q.P,C.QB,Z.YE,Z.nU,s.sg,s.mk,u.yS],pipes:[T.aQ,s.JJ,T.qU,s.uU],styles:[""]}),n})()},{path:"Sales_Report/Standard/Sales_Person",component:gc},{path:"Sales_Report/Standard/Sales_Person/Sales_Commission",component:vc},{path:"Sales_Report/Standard/Sales_Person/Commission_Report",component:Lc},{path:"Sales_Report/Standard/Sales_Person/Commission_Report/Commission_Report_Detail",component:Vc},{path:"Sales_Report/Standard/Discounted_Sales",component:gm},{path:"Purchases_Report/Detail",component:T_},{path:"Purchases_Report/Summary",component:y_},{path:"Purchases_Report/Top_Supplier",component:U_},{path:"Purchases_Report/Product_Bought",component:Y_},{path:"Purchases_Report/Product_Purchase_History",component:su},{path:"Purchases_Report/Daily_Purchase",component:gu},{path:"Purchases_Report/Daily_Purchase/Monthly_Purchase",component:hu},{path:"Purchases_Report/Purchase_Volume",component:Tu},{path:"Purchases_Report/Purchased_Sales_Report",component:Su},{path:"Purchases_Report/Outlet_Performance",component:ng},{path:"Purchases_Report/Outlet_Performance/Outlet_Group_Performance",component:Dg},{path:"Purchases_Report/Outlet_Performance/Outlet_Monthly_Perfomance",component:Lg},{path:"Sales_Report/Group/City",component:Hg},{path:"Sales_Report/Group/Type",component:$g},{path:"Sales_Report/Group/Customer_Group",component:ed},{path:"Sales_Report/Group/Sales_Group",component:pd},{path:"Sales_Report/Advanced/Tax_Report",component:Cd},{path:"Sales_Report/Advanced/Tax_Report/By_Outlet",component:Od},{path:"Sales_Report/Advanced/Product_Life_Cycle",component:Ld},{path:"Sales_Report/Advanced/Product_Profit",component:Bd},{path:"Sales_Report/Advanced/Exchanged_Sales",component:zd},{path:"Sales_Report/Advanced/Variant_Model_Rank",component:rm},{path:"Sales_Report/Standard/Discounted_Sales/Discounted_Products",component:o_},{path:"Return/Sales_Return",component:Tm},{path:"Return/Purchase_Return",component:vm},{path:"Sales_Report/Standard/Products_Sold/Invoice_Items",component:km},{path:"Sales_Report/Standard/Price_Analysis",component:(()=>{class n extends m.n{constructor(e,o){super(e,"Report/UnitPriceAnalysis","ReportLoader/PriceAnalysis"),this.httpService=e,this.csvConverter=o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-price-analysis"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],["container",""],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fas","fa-upload","mr-3"],["class","container-fluid mt-5",4,"ngIf"],["type","number",3,"ngModel","ngModelChange"],[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-right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"filters"),t.TgZ(2,"div",1),t.YNc(3,tZ,4,1,"div",2),t.qZA(),t.qZA(),t.TgZ(4,"actions"),t.TgZ(5,"button",3),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/PriceAnalysis","PriceAnalysis.csv")}),t._UZ(6,"i",4),t._uU(7," Export "),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,nZ,11,1,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(3),t.Q6J("ngIf",o.pageData.Filter),t.xp6(6),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,p.wV,p.Fj,p.JJ,p.On,s.sg],pipes:[s.JJ],styles:[""]}),n})()},{path:"",redirectTo:"Sales_Report/Standard/Products_Sold",pathMatch:"full"}];let oZ=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[[u.Bz.forChild(aZ)],u.Bz]}),n})();var rZ=f(1768),iZ=f(2060),lZ=f(315);let sZ=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[s.uU],imports:[[d.R,T.dr,s.ez,oZ,c.A0,C.ZU,p.u5,p.UX,ut.FA,L.XK,gt.Fk,dt.c,L.Ng,mt.Nh,k.AV,Q.TU,Zt.vV,c.A0,Z.JX,_t.p0,rZ.X,I.d,q.K,U.N,J.Z,D.Q,iZ.I,lZ.T]]}),n})()}}]);
1
+ "use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[1122],{1122:(pZ,P,f)=>{f.r(P),f.d(P,{ReportsModule:()=>sZ});var s=f(6019),p=f(9133),Z=f(2262),_t=f(4176),ut=f(8727),L=f(6731),gt=f(9859),dt=f(138),mt=f(2605),Q=f(8525),Zt=f(7348),q=f(1949),c=f(5496),u=f(4382),S=f(5304),Y=f(5761),t=f(3668),g=f(8596),y=f(2387),I=f(7481),M=f(859);let ht=(()=>{class n{constructor(e,o,a,r){this.httpService=e,this.toaster=o,this.dialogRef=a,this.data=r,this.modalConfig=new Y.O,this.ExportPageNumber=r.Filter.ExportPageNumber,this.ExportRowCount=r.Filter.ExportRowCount,this.totalCount=r.TotalCount,this.modalConfig.title="Export Report",this.modalConfig.customWidth="379px",this.modalConfig.okText="Export"}ngOnInit(){this.countExportRowCount()}onPageNumberChange(e){this.ExportPageNumber=e,this.countExportRowCount()}countExportRowCount(){let e=this.data.Filter.ExportRowCount;this.ExportPageNumber>1?(this.endExport=this.totalCount-this.ExportPageNumber*e>0?this.ExportPageNumber*e:this.totalCount,this.startExport=this.ExportPageNumber-1==1?e+1:(this.ExportPageNumber-1)*e+1,this.startExport>this.totalCount&&(this.startExport=this.totalCount)):(this.startExport=this.ExportPageNumber,this.endExport=this.totalCount>e?e:this.totalCount)}onOk(){this.dialogRef.close({ExportPageNumber:this.ExportPageNumber,ExportRowCount:this.ExportRowCount})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(S.so),t.Y36(S.WI))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ng-component"]],decls:28,vars:14,consts:[[3,"config","onOk","onCancel","onClose"],[1,"container",2,"width","350px"],[1,"row","form-group"],[1,"col-6","pl-0","pr-3"],[1,"font-weight-bold"],["type","text","autoNum","",1,"form-control",3,"ngModel","ngModelChange"],[1,"col-6","pr-0","pl-3"],[1,"border","border-2","border-secondary","pl-3","pt-3","bg-light",2,"height","32px"],[1,"col-12","p-0"],[1,"border","border-1","pl-3","pt-3","alert-warning",2,"height","32px"],[1,"fas","fa-info-circle","mr-1"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.dialogRef.close()})("onClose",function(){return o.dialogRef.close()}),t.TgZ(1,"content"),t.TgZ(2,"div",1),t.TgZ(3,"div",2),t.TgZ(4,"div",3),t.TgZ(5,"label",4),t._uU(6,"Page Number"),t.qZA(),t.TgZ(7,"input",5),t.NdJ("ngModelChange",function(r){return o.ExportPageNumber=r})("ngModelChange",function(r){return o.onPageNumberChange(r)}),t.qZA(),t.qZA(),t.TgZ(8,"div",6),t.TgZ(9,"label",4),t._uU(10,"Page Size"),t.qZA(),t.TgZ(11,"div",7),t._uU(12),t.ALo(13,"number"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"div",2),t.TgZ(15,"div",8),t.TgZ(16,"div",9),t._UZ(17,"i",10),t._uU(18," Exporting ["),t.TgZ(19,"span",4),t._uU(20),t.ALo(21,"number"),t.ALo(22,"number"),t.qZA(),t._uU(23,"] record of "),t.TgZ(24,"span",4),t._uU(25),t.ALo(26,"number"),t.qZA(),t._uU(27," transactions "),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.Q6J("config",o.modalConfig),t.xp6(7),t.Q6J("ngModel",o.ExportPageNumber),t.xp6(5),t.Oqu(t.lcZ(13,6,o.ExportRowCount)),t.xp6(8),t.AsE("",t.lcZ(21,8,o.startExport)," - ",t.lcZ(22,10,o.endExport),""),t.xp6(5),t.Oqu(t.lcZ(26,12,o.totalCount)))},directives:[I.M,p.Fj,M.b,p.JJ,p.On],pipes:[s.JJ],styles:[""]}),n})();var xt=f(7080),h=f(4765),d=f(9265),D=f(7163),C=f(4290),T=f(1464);function Tt(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",25),t.TgZ(1,"a",28),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).export("default")}),t._UZ(2,"i",29),t._uU(3," Export"),t.qZA(),t.TgZ(4,"button",30),t._UZ(5,"b",31),t.qZA(),t.TgZ(6,"ul",32),t.TgZ(7,"li",33),t.TgZ(8,"a",34),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).export("contact")}),t._uU(9,"Export With Contact Detail"),t.qZA(),t.qZA(),t.TgZ(10,"li",33),t.TgZ(11,"a",34),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).export("complete")}),t._uU(12,"Export Complete Detail"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}}function Ct(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",35),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",36),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Customer"),t.qZA(),t.TgZ(8,"autocompleteV2",37),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.CustomerID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From/To"),t.qZA(),t.TgZ(12,"datepicker",38),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",39),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Sales"),t.qZA(),t.TgZ(17,"ng-select",40),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Group"),t.qZA(),t.TgZ(21,"ng-select",40),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ContactGroupID=a}),t.qZA(),t.qZA(),t.TgZ(22,"div"),t.TgZ(23,"h6"),t._uU(24,"Bin"),t.qZA(),t.TgZ(25,"radio-options",41),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Bin=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CustomerID),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("items",e.pageData.Options.Sales)("ngModel",e.pageData.Filter.SalesID),t.xp6(4),t.Q6J("items",e.pageData.Options.ContactGroups)("ngModel",e.pageData.Filter.ContactGroupID),t.xp6(4),t.Q6J("model",e.pageData.Filter.Bin)}}function ft(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",42),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Type"),t.qZA(),t.TgZ(4,"ng-select",40),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Currency"),t.qZA(),t.TgZ(8,"ng-select",43),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Delivery"),t.qZA(),t.TgZ(12,"ng-select",44),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.DeliveryStateID=a}),t.qZA(),t.qZA(),t.TgZ(13,"div"),t.TgZ(14,"h6"),t._uU(15,"Complementary"),t.qZA(),t.TgZ(16,"radio-options",45),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Complementary=a}),t.qZA(),t.qZA(),t.TgZ(17,"div"),t.TgZ(18,"h6"),t._uU(19,"Creator"),t.qZA(),t.TgZ(20,"autocompleteV2",46),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.CreatorID=a}),t.qZA(),t.qZA(),t.TgZ(21,"div"),t.TgZ(22,"h6"),t._uU(23,"Note Visible"),t.qZA(),t.TgZ(24,"radio-options",47),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.NoteVisible=a}),t.qZA(),t.qZA(),t.TgZ(25,"div"),t.TgZ(26,"h6"),t._uU(27,"Sort"),t.qZA(),t.TgZ(28,"radio-options",48),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.SortBy=a})("modelChange",function(){return t.CHM(e),t.oxw(2).searchFromPageOne()}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("items",e.pageData.Options.Types)("ngModel",e.pageData.Filter.TypeID),t.xp6(4),t.Q6J("items",e.pageData.Options.Currencies)("ngModel",e.pageData.Filter.CurrencyID),t.xp6(4),t.Q6J("items",e.pageData.Options.Deliveries)("ngModel",e.pageData.Filter.DeliveryStateID),t.xp6(4),t.Q6J("model",e.pageData.Filter.Complementary),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CreatorID),t.xp6(4),t.Q6J("model",e.pageData.Filter.NoteVisible),t.xp6(4),t.Q6J("model",e.pageData.Filter.SortBy)("options",e.SortBy)}}function At(n,i){1&n&&(t.TgZ(0,"th",49),t._uU(1," @ Cost "),t.qZA())}function qt(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1," /"),t.qZA())}const Dt=function(){return["/menu/Orders/Orders/Sales_Order/Info"]},R=function(n){return{ID:n}};function yt(n,i){if(1&n&&(t.TgZ(0,"a",52),t.TgZ(1,"span",66),t._uU(2),t.qZA(),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("routerLink",t.DdM(3,Dt))("queryParams",t.VKq(4,R,e.SalesOrderID)),t.xp6(2),t.Oqu("#"+e.SalesOrderNumber)}}function vt(n,i){if(1&n&&(t.TgZ(0,"span",56),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" "," - Profit: "+t.lcZ(2,1,e.Profit),"")}}function St(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1,"- "),t.qZA())}function Mt(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1,": "),t.qZA())}function bt(n,i){if(1&n&&(t.TgZ(0,"small"),t._uU(1),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.xp6(1),t.hij(" (",e.Commissions[0].Quantity," unit )")}}function Jt(n,i){if(1&n&&(t.TgZ(0,"i",78),t._uU(1),t.YNc(2,bt,2,1,"small",24),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" sold by ",e.Commissions[0].SalesName," "),t.xp6(1),t.Q6J("ngIf",(null==e?null:e.Commissions[0].Quantity)<e.Quantity)}}function Ot(n,i){if(1&n&&(t.TgZ(0,"li"),t.TgZ(1,"i"),t._uU(2),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.hij("( ",e.Quantity+" unit by "+e.SalesName," )")}}function It(n,i){if(1&n&&(t.TgZ(0,"ul",79),t.TgZ(1,"li"),t.TgZ(2,"i"),t._uU(3,"sold by"),t.qZA(),t.qZA(),t.YNc(4,Ot,3,1,"li",18),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(4),t.Q6J("ngForOf",null==e?null:e.Commissions)}}function Ut(n,i){if(1&n&&(t.TgZ(0,"th",80),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,null==e?null:e.UnitCost)," ")}}function Ft(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"th",11),t.TgZ(2,"div"),t.TgZ(3,"span",67),t._uU(4),t.qZA(),t.YNc(5,Jt,3,2,"i",68),t.YNc(6,It,5,1,"ul",69),t._UZ(7,"span",70),t.qZA(),t.qZA(),t.TgZ(8,"th",71),t._uU(9),t.qZA(),t.TgZ(10,"th",72),t._uU(11),t.ALo(12,"number"),t.qZA(),t.TgZ(13,"th",14),t._uU(14),t.qZA(),t.YNc(15,Ut,3,3,"th",73),t.TgZ(16,"th",74),t._uU(17),t.ALo(18,"number"),t.qZA(),t.TgZ(19,"th",75),t.TgZ(20,"div",76),t._uU(21),t.qZA(),t.TgZ(22,"div",77),t._uU(23),t.ALo(24,"number"),t.qZA(),t.qZA(),t.TgZ(25,"th",74),t._uU(26),t.ALo(27,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(3);t.xp6(4),t.Oqu(null==e?null:e.Name),t.xp6(1),t.Q6J("ngIf",1==(null==e?null:e.Commissions.length)),t.xp6(1),t.Q6J("ngIf",(null==e?null:e.Commissions.length)>1),t.xp6(1),t.Q6J("innerHtml",null==e?null:e.Note,t.oJD),t.xp6(2),t.hij(" ",null==e?null:e.Code," "),t.xp6(2),t.hij(" ",t.lcZ(12,12,null==e?null:e.Quantity)," "),t.xp6(3),t.hij(" ",null==e?null:e.UOMName," "),t.xp6(1),t.Q6J("ngIf",o.pageData.HasRoleCost),t.xp6(2),t.hij(" ",t.lcZ(18,14,null==e?null:e.UnitPrice)," "),t.xp6(4),t.hij(" ",0==(null==e?null:e.Discount)?"":(null==e?null:e.Discount)+"%"," "),t.xp6(2),t.hij(" ",0==(null==e?null:e.DiscountAmount)?"":t.lcZ(24,16,null==e?null:e.DiscountAmount)," "),t.xp6(3),t.hij(" ",t.lcZ(27,18,null==e?null:e.Total)," ")}}function wt(n,i){if(1&n&&(t.ynx(0),t.TgZ(1,"tr"),t.TgZ(2,"th",81),t._uU(3),t.qZA(),t.TgZ(4,"th",82),t._uU(5),t.qZA(),t.TgZ(6,"th",83),t._uU(7),t.ALo(8,"number"),t.qZA(),t.qZA(),t.BQk()),2&n){const e=i.$implicit;t.xp6(3),t.hij("",e.Label," :"),t.xp6(2),t.hij(" ",e.CurrencySymbol," "),t.xp6(2),t.hij(" ",t.lcZ(8,3,e.Amount)," ")}}const Nt=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]};function Pt(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"div",50),t.TgZ(2,"div",51),t.TgZ(3,"div"),t.TgZ(4,"a",52),t.TgZ(5,"span",53),t._uU(6),t.qZA(),t.qZA(),t.YNc(7,qt,2,0,"span",24),t.YNc(8,yt,3,6,"a",54),t.TgZ(9,"span"),t._uU(10),t.ALo(11,"date"),t._UZ(12,"small",55),t.ALo(13,"date"),t.TgZ(14,"small",56),t._uU(15),t.ALo(16,"showIfNotNullOrEmptyString"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(17,"div"),t.TgZ(18,"strong",57),t._uU(19),t.ALo(20,"number"),t.ALo(21,"sum"),t.TgZ(22,"span"),t._uU(23),t.ALo(24,"showIfNotNullOrEmptyString"),t.qZA(),t.qZA(),t.YNc(25,vt,3,3,"span",58),t.TgZ(26,"i",59),t._uU(27),t.qZA(),t.TgZ(28,"span",60),t._uU(29),t.qZA(),t.YNc(30,St,2,0,"span",24),t.YNc(31,Mt,2,0,"span",24),t.TgZ(32,"span",60),t._uU(33),t.qZA(),t.qZA(),t.qZA(),t.TgZ(34,"div",61),t.TgZ(35,"label",62),t._uU(36),t.qZA(),t.qZA(),t.qZA(),t.TgZ(37,"table",63),t._UZ(38,"thead"),t.TgZ(39,"tbody",64),t.YNc(40,Ft,28,20,"tr",18),t.qZA(),t.qZA(),t.TgZ(41,"table",65),t.YNc(42,wt,9,5,"ng-container",18),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(4),t.Q6J("routerLink",t.DdM(36,Nt))("queryParams",t.VKq(37,R,e.ID)),t.xp6(2),t.hij(" ",e.EntityName+" # "+e.Number,""),t.xp6(1),t.Q6J("ngIf",o.pageData.DualReceiptNumber),t.xp6(1),t.Q6J("ngIf",o.pageData.DualReceiptNumber),t.xp6(2),t.hij(" "," - "+t.xi3(11,19,e.Date,"dd MMM yyyy")," "),t.xp6(2),t.Q6J("innerHtml","("+t.xi3(13,22,e.Created,"HH:mm")+(null!=e.Order&&e.Order.ClientTimestamp?" - Client Timestamp: "+e.Order.ClientTimestamp:"")+")",t.oJD),t.xp6(3),t.Oqu(t.xi3(16,25,e.CustomerNameDisplay," - {0}")),t.xp6(4),t.hij(" ","[Q: "+t.lcZ(20,28,t.xi3(21,30,e.Items,"Quantity"))+", T: "+(e.Final?e.Final:"")+"]"," "),t.xp6(4),t.Oqu(t.xi3(24,33,e.SalesName," - Sales: {0}")),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleProfit),t.xp6(2),t.hij(" ",null==e.DeliveryOutlet?"":": Delivered from "+e.DeliveryOutlet," "),t.xp6(2),t.Oqu(null==e.AuthorizationKey?"":": "+e.AuthorizationKey),t.xp6(1),t.Q6J("ngIf",e.SONote&&e.AuthorizationKey),t.xp6(1),t.Q6J("ngIf",!e.AuthorizationKey),t.xp6(2),t.Oqu(null==e.SONote?"":e.SONote),t.xp6(3),t.Oqu(e.PaymentStateLabel),t.xp6(4),t.Q6J("ngForOf",e.Items),t.xp6(2),t.Q6J("ngForOf",e.Aggregate)}}function Lt(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"strong"),t._uU(2,"Qty"),t.qZA(),t.TgZ(3,"span",81),t._uU(4),t.ALo(5,"number"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(4),t.Oqu(t.lcZ(5,1,e.totalAggregate.ItemsQuantity))}}function Qt(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"strong"),t._uU(2,"Qty Complementary"),t.qZA(),t.TgZ(3,"span",81),t._uU(4),t.ALo(5,"number"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(4),t.Oqu(t.lcZ(5,1,e.totalAggregate.QuantityComplementary))}}function Yt(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"strong"),t._uU(2,"Qty Sold"),t.qZA(),t.TgZ(3,"span",81),t._uU(4),t.ALo(5,"number"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(4),t.Oqu(t.lcZ(5,1,e.totalAggregate.QuantityWithoutComplementary))}}function Rt(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"strong"),t._uU(2,"Cost ("),t.TgZ(3,"span",86),t._uU(4),t.ALo(5,"number"),t.qZA(),t._uU(6,"%)"),t.qZA(),t.TgZ(7,"span",81),t._uU(8),t.ALo(9,"number"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(4),t.Oqu(t.lcZ(5,2,e.totalAggregate.CostRatio)),t.xp6(4),t.Oqu(t.lcZ(9,4,e.totalAggregate.Cost))}}function kt(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"strong"),t.TgZ(2,"span"),t._uU(3,"Profit"),t.qZA(),t._uU(4," ("),t.TgZ(5,"span",86),t._uU(6),t.ALo(7,"number"),t.qZA(),t._uU(8,"%)"),t.qZA(),t.TgZ(9,"span",81),t._uU(10),t.ALo(11,"number"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(6),t.Oqu(t.lcZ(7,2,e.totalAggregate.ProfitRatio)),t.xp6(4),t.Oqu(t.lcZ(11,4,e.totalAggregate.Profit))}}function Et(n,i){if(1&n&&(t.TgZ(0,"div",84),t.TgZ(1,"div",85),t.TgZ(2,"div"),t.TgZ(3,"strong"),t._uU(4,"Tax Added"),t.qZA(),t.TgZ(5,"span",81),t._uU(6),t.ALo(7,"number"),t.qZA(),t.qZA(),t.TgZ(8,"div"),t.TgZ(9,"strong"),t._uU(10,"Sales with Tax"),t.qZA(),t.TgZ(11,"span",81),t._uU(12),t.ALo(13,"number"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"div",85),t.TgZ(15,"div"),t.TgZ(16,"strong"),t._uU(17,"Orders"),t.qZA(),t.TgZ(18,"span",81),t._uU(19),t.ALo(20,"number"),t.qZA(),t.qZA(),t.YNc(21,Lt,6,3,"div",24),t.YNc(22,Qt,6,3,"div",24),t.YNc(23,Yt,6,3,"div",24),t.qZA(),t.TgZ(24,"div",85),t.TgZ(25,"div"),t.TgZ(26,"strong"),t._uU(27,"Gross Sales"),t.qZA(),t.TgZ(28,"span",81),t._uU(29),t.ALo(30,"number"),t.qZA(),t.qZA(),t.TgZ(31,"div"),t.TgZ(32,"strong"),t._uU(33,"Discount"),t.qZA(),t.TgZ(34,"span",81),t._uU(35),t.ALo(36,"number"),t.qZA(),t.qZA(),t.TgZ(37,"div"),t.TgZ(38,"strong"),t._uU(39,"Tax Incl."),t.qZA(),t.TgZ(40,"span",81),t._uU(41),t.ALo(42,"number"),t.qZA(),t.qZA(),t.TgZ(43,"div"),t.TgZ(44,"strong"),t._uU(45,"Net Sales"),t.qZA(),t.TgZ(46,"span",81),t._uU(47),t.ALo(48,"number"),t.qZA(),t.qZA(),t.YNc(49,Rt,10,6,"div",24),t.YNc(50,kt,12,6,"div",24),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(6),t.Oqu(t.xi3(7,12,e.totalAggregate.TaxAdd,".0-0")),t.xp6(6),t.Oqu(t.xi3(13,15,e.totalAggregate.SalesWithTax,".0-0")),t.xp6(7),t.Oqu(t.xi3(20,18,e.totalAggregate.Orders,".0-0")),t.xp6(2),t.Q6J("ngIf",!e.pageData.Filter.Complementary),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.Complementary),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.Complementary),t.xp6(6),t.Oqu(t.xi3(30,21,e.totalAggregate.GrossItems,".0-0")),t.xp6(6),t.Oqu(t.xi3(36,24,e.totalAggregate.Discount,".0-0")),t.xp6(6),t.Oqu(t.xi3(42,27,e.totalAggregate.TaxInclude,".0-0")),t.xp6(6),t.Oqu(t.xi3(48,30,e.totalAggregate.SalesWithoutTax,".0-0")),t.xp6(2),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",e.pageData.HasRoleProfit)}}function Ht(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"span",87),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).StoreRowsCountAPIResult("Report/ReportDetailCount")}),t.TgZ(1,"i",88),t._uU(2,"?"),t.qZA(),t.qZA()}}function Vt(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(t.lcZ(2,1,e.listTotal))}}function Bt(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",89),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).NextPage(!0)}),t._UZ(1,"i",90),t._uU(2," Next"),t.qZA()}}function Gt(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",91),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).StoreRowsCountAPIResult("Report/ReportDetailCount",!0)}),t._UZ(1,"i",92),t._uU(2," Last"),t.qZA()}}function jt(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Tt,13,0,"div",2),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",3),t.YNc(5,Ct,26,11,"div",4),t.YNc(6,ft,29,11,"div",5),t.qZA(),t.TgZ(7,"a",6),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.hideMore=!a.hideMore}),t._uU(8,"More "),t._UZ(9,"i",7),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.TgZ(11,"div",8),t.TgZ(12,"table",9),t.TgZ(13,"thead",10),t.TgZ(14,"tr"),t.TgZ(15,"th",11),t._uU(16,"Name"),t.qZA(),t.TgZ(17,"th",12),t._uU(18,"Code"),t.qZA(),t.TgZ(19,"th",13),t._uU(20,"Qty"),t.qZA(),t.TgZ(21,"th",14),t._uU(22,"UOM"),t.qZA(),t.YNc(23,At,2,0,"th",15),t.TgZ(24,"th",16),t._uU(25,"@ Price"),t.qZA(),t.TgZ(26,"th",13),t._uU(27,"Disc."),t.qZA(),t.TgZ(28,"th",16),t._uU(29,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(30,"tbody"),t.TgZ(31,"tr"),t.TgZ(32,"td",17),t.YNc(33,Pt,43,39,"div",18),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.YNc(34,Et,51,33,"div",19),t.TgZ(35,"div",20),t.TgZ(36,"div",21),t.TgZ(37,"div",22),t._uU(38),t.ALo(39,"number"),t.YNc(40,Ht,3,0,"span",23),t.YNc(41,Vt,3,3,"span",24),t._uU(42),t.qZA(),t.qZA(),t.TgZ(43,"div",25),t.YNc(44,Bt,3,0,"a",26),t.YNc(45,Gt,3,0,"a",27),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.pageData.HasRoleExport),t.xp6(3),t.Q6J("ngIf",e.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!e.hideMore),t.xp6(17),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(9),t.uIk("colspan",e.pageData.HasRoleCost?8:7),t.xp6(1),t.Q6J("ngForOf",e.infiniteList),t.xp6(1),t.Q6J("ngIf",(null==e.data?null:e.data.Data.length)>0),t.xp6(4),t.hij(" Showing 1 - ",t.lcZ(39,15,e.pageData.Filter.RowCount*(e.pageData.Filter.PageNumber-1)+e.data.TotalCurrentRow)," of "),t.xp6(2),t.Q6J("ngIf",!e.pageData.HideStoreApiCount),t.xp6(1),t.Q6J("ngIf",e.pageData.HideStoreApiCount),t.xp6(1),t.hij(" records ~ ",e.pageData.Filter.PageNumber," Page "),t.xp6(2),t.Q6J("ngIf",e.nextPageDisabled&&!e.goToLast),t.xp6(1),t.Q6J("ngIf",e.nextPageDisabled&&!e.goToLast)}}let Wt=(()=>{class n extends xt.X{constructor(e,o,a,r,l,_){super(e,"Report/ReportDetail","ReportLoader/ReportDetail",null,r),this.csvConverter=o,this.datePipe=a,this.activatedRoute=r,this.matDialog=l,this.toaster=_,this.hideMore=!0,this.SortBy=[{Key:!1,Value:"Number"},{Key:!0,Value:"Created"}]}preInitList(){this.oldRowCount=this.pageData.Filter.RowCount,this.pageData.Filter.NoteVisible=!0,this.totalAggregate=new $t}assignAggregate(e){this.totalAggregate.TaxAdd=e.Aggregate.TaxAdd,this.totalAggregate.SalesWithTax=e.Aggregate.SalesWithTax,this.totalAggregate.Orders=e.Aggregate.Orders,this.totalAggregate.ItemsQuantity=e.Aggregate.ItemsQuantity,this.totalAggregate.QuantityComplementary=e.Aggregate.QuantityComplementary,this.totalAggregate.QuantityWithoutComplementary=e.Aggregate.QuantityWithoutComplementary,this.totalAggregate.GrossItems=e.Aggregate.GrossItems,this.totalAggregate.Discount=e.Aggregate.Discount,this.totalAggregate.TaxInclude=e.Aggregate.TaxInclude,this.totalAggregate.SalesWithoutTax=e.Aggregate.SalesWithoutTax,e.Aggregate.CostRatio=this.costRatioCalculation(e.Aggregate.Cost,e.Aggregate.SalesWithoutTax,e.Aggregate.TaxInclude),this.totalAggregate.CostRatio=e.Aggregate.CostRatio,e.Aggregate.ProfitRatio=this.profitRatioCalculation(e.Aggregate.Profit,e.Aggregate.SalesWithoutTax,e.Aggregate.TaxInclude),this.totalAggregate.ProfitRatio=e.Aggregate.ProfitRatio,this.totalAggregate.Profit=e.Aggregate.Profit,this.totalAggregate.Cost=e.Aggregate.Cost}postExtendData(e){this.totalAggregate.TaxAdd+=e.Aggregate.TaxAdd,this.totalAggregate.SalesWithTax+=e.Aggregate.SalesWithTax,this.totalAggregate.Orders+=e.Aggregate.Orders,this.totalAggregate.ItemsQuantity+=e.Aggregate.ItemsQuantity,this.totalAggregate.QuantityComplementary+=e.Aggregate.QuantityComplementary,this.totalAggregate.QuantityWithoutComplementary+=e.Aggregate.QuantityWithoutComplementary,this.totalAggregate.GrossItems+=e.Aggregate.GrossItems,this.totalAggregate.Discount+=e.Aggregate.Discount,this.totalAggregate.TaxInclude+=e.Aggregate.TaxInclude,this.totalAggregate.SalesWithoutTax+=e.Aggregate.SalesWithoutTax,e.Aggregate.CostRatio=this.costRatioCalculation(e.Aggregate.Cost,e.Aggregate.SalesWithoutTax,e.Aggregate.TaxInclude),this.totalAggregate.CostRatio+=e.Aggregate.CostRatio,e.Aggregate.ProfitRatio=this.profitRatioCalculation(e.Aggregate.Profit,e.Aggregate.SalesWithoutTax,e.Aggregate.TaxInclude),this.totalAggregate.ProfitRatio+=e.Aggregate.ProfitRatio,this.totalAggregate.Profit+=e.Aggregate.Profit,this.totalAggregate.Cost+=e.Aggregate.Cost}costRatioCalculation(e,o,a){let r=0;return this.pageData.IncludeTax&&(o+=a),0!=o&&(r=e/o*100),r}profitRatioCalculation(e,o,a){let r=0;return this.pageData.IncludeTax&&(o+=a),0!=o&&(r=e/o*100),r}export(e){-1===this.pagination.ListTotal?this.httpService.post("/API/Report/ReportDetailCount",JSON.stringify(this.pageData.Filter)).subscribe(a=>{this.pagination.ListTotal=a.Count,this.showExportModal(e)}):this.showExportModal(e)}showExportModal(e){this.matDialog.open(ht,{data:{Filter:this.pageData.Filter,TotalCount:this.pagination.ListTotal}}).afterClosed().subscribe(a=>{if(a){const r=a.ExportPageNumber;switch(this.pageData.Filter.ExportPageNumber=r,e){case"default":this.exportCSV(this.csvConverter,"ReportExport/ReportDetail","SalesReport_"+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To)+`_Page_${r}.csv`);break;case"complete":this.exportCSV(this.csvConverter,"ReportExport/ReportDetailComplete","SalesReportComplete_"+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To)+`_Page_${r}.csv`);break;case"contact":this.exportCSV(this.csvConverter,"ReportExport/ReportDetailWithContact","SalesReportWithContact_"+this.transformDate(this.pageData.Filter.From)+"-"+this.transformDate(this.pageData.Filter.To)+`_Page_${r}.csv`)}}})}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(s.uU),t.Y36(u.gz),t.Y36(S.uw),t.Y36(y._W))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-sales-detail"]],features:[t.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","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"font-italic","small",2,"width","40px"],["class","text-right","style","width: 80px",4,"ngIf"],[1,"text-right",2,"width","90px"],[1,"px-0"],[4,"ngFor","ngForOf"],["class","row justify-content-end mt-10 mx-0",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"mr-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-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","title","Load more for 500 variants",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"click"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"items","ngModel","ngModelChange"],["name","Bin",3,"model","modelChange"],["id","more-filter","container","",1,"ml-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"],["requestUrl","/API/AC/GetUserSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["name","NoteVisible",3,"model","modelChange"],["name","Sort",3,"model","options","modelChange"],[1,"text-right",2,"width","80px"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"mr-auto","d-sm-block","d-flex","flex-column","mt-8","mb-2"],[1,"h5","text-primary","font-weight-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ml-3"],["class","h5 text-primary font-weight-bold",3,"routerLink","queryParams",4,"ngIf"],[1,"font-italic","font-weight-bold",3,"innerHtml"],[1,"font-weight-bold"],[1,"text-danger","ml-3"],["class","font-weight-bold",4,"ngIf"],["id","deliveryNote"],[1,"d-inline-block","font-italic"],[1,"d-lg-block","mt-8","mr-2","font-weight-bold","font-italic"],["runat","server",1,"status"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"table","table-sm","table-borderless"],["id","PONumber"],[1,"font-weight-normal"],["class","text-warning inlineMarginLeft",4,"ngIf"],["class","list-inline text-warning inlineMarginLeft",4,"ngIf"],[1,"d-block","font-weight-normal","font-italic",2,"word-break","break-all",3,"innerHtml"],[1,"font-weight-normal",2,"width","75px"],[1,"font-weight-normal","text-right",2,"width","42px"],["class","font-weight-normal text-right","style","width: 80px",4,"ngIf"],[1,"font-weight-normal","text-right",2,"width","90px"],[1,"font-weight-normal","text-right","text-danger",2,"width","50px"],["title","Disc %"],["title","Disc Amount"],[1,"text-warning","inlineMarginLeft"],[1,"list-inline","text-warning","inlineMarginLeft"],[1,"font-weight-normal","text-right",2,"width","80px"],[1,"text-right"],[1,"p-0","font-weight-normal","text-right",2,"width","1%"],[1,"font-weight-normal","text-right",2,"width","5%"],[1,"row","justify-content-end","mt-10","mx-0"],[1,"zebra","col-auto"],[1,"Percentage"],[2,"cursor","pointer",3,"click"],["title","Retrieve rows count",1,"border","p-3"],["role","button","title","Load more for 500 variants",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,o){1&e&&t.YNc(0,jt,46,17,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},directives:[s.O5,d.p,s.sg,c.w9,p.JJ,p.On,D.J,C.QB,q.P,u.yS],pipes:[s.JJ,s.uU,T.WV,T.qU],styles:[""]}),n})();class $t{constructor(){this.TaxAdd=0,this.SalesWithTax=0,this.Orders=0,this.ItemsQuantity=0,this.QuantityComplementary=0,this.QuantityWithoutComplementary=0,this.GrossItems=0,this.Discount=0,this.TaxInclude=0,this.SalesWithoutTax=0,this.CostRatio=0,this.Cost=0,this.ProfitRatio=0,this.Profit=0}}let Kt=(()=>{class n{constructor(e,o){this._dialogRef=e,this.data=o,this.modalConfig=new Y.O,this.ExportPageNumber=o.ExportPageNumber,this.ExportRowCount=o.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 n.\u0275fac=function(e){return new(e||n)(t.Y36(S.so),t.Y36(S.WI))},n.\u0275cmp=t.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","form-group"],["type","text",1,"form-control",3,"ngModel","ngModelChange"]],template:function(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o._dialogRef.close()})("onClose",function(){return o._dialogRef.close()}),t.TgZ(1,"content"),t.TgZ(2,"div",1),t.TgZ(3,"div",2),t.TgZ(4,"label"),t._uU(5,"Page Number"),t.qZA(),t.TgZ(6,"input",3),t.NdJ("ngModelChange",function(r){return o.ExportPageNumber=r}),t.qZA(),t.qZA(),t.TgZ(7,"div",2),t.TgZ(8,"label"),t._uU(9,"Page Size"),t.qZA(),t.TgZ(10,"input",3),t.NdJ("ngModelChange",function(r){return o.ExportRowCount=r}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.Q6J("title","Export Report")("config",o.modalConfig),t.xp6(6),t.Q6J("ngModel",o.ExportPageNumber),t.xp6(4),t.Q6J("ngModel",o.ExportRowCount))},directives:[I.M,p.Fj,p.JJ,p.On],styles:[""]}),n})();var m=f(1139),Xt=f(5451);function zt(n,i){1&n&&(t.TgZ(0,"button",15),t._UZ(1,"b",16),t.qZA())}function te(n,i){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"datetimepicker",24),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(2,"datetimepicker",25),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.BQk()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("date",e.pageData.Filter.From)("appearance","outline")("width",215),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)("appearance","outline")("width",215)}}function ee(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"datepicker",24),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(1,"datepicker",25),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA()}if(2&n){const e=t.oxw(2);t.Q6J("date",e.pageData.Filter.From)("appearance","outline")("width",215),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)("appearance","outline")("width",215)}}function ne(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",17),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Customer"),t.qZA(),t.TgZ(8,"autocompleteV2",19),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CustomerID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Sales"),t.qZA(),t.TgZ(12,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(13,"div"),t.TgZ(14,"h6"),t._uU(15,"From/To"),t.qZA(),t.YNc(16,te,3,6,"ng-container",21),t.YNc(17,ee,2,6,"ng-template",null,22,t.W1O),t.qZA(),t.TgZ(19,"div"),t.TgZ(20,"h6"),t._uU(21,"filter invoice by"),t.qZA(),t.TgZ(22,"radio-options",23),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.isCreated=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.MAs(18),o=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",o.pageData.Filter.ListIDs)("items",null==o.pageData.Options?null:o.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",o.pageData.Filter.CustomerID)("inputTextValue",o.pageData.CustomerName),t.xp6(4),t.Q6J("ngModel",o.pageData.Filter.SalesID)("items",null==o.pageData.Options?null:o.pageData.Options.Sales),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter.isCreated)("ngIfElse",e),t.xp6(6),t.Q6J("options",o.filterInvociceBy)("model",o.pageData.Filter.isCreated)}}function ae(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",26),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Register"),t.qZA(),t.TgZ(4,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RegisterID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Customer Groups"),t.qZA(),t.TgZ(8,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CustomerGroupID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Payment"),t.qZA(),t.TgZ(12,"ng-select",27),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.PaymentState=a}),t.qZA(),t.qZA(),t.TgZ(13,"div"),t.TgZ(14,"h6"),t._uU(15,"Creator"),t.qZA(),t.TgZ(16,"autocompleteV2",28),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CreatorID=a}),t.qZA(),t.qZA(),t.TgZ(17,"div"),t.TgZ(18,"h6"),t._uU(19,"RowCount"),t.qZA(),t.TgZ(20,"input",29),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RegisterID)("items",e.pageData.Options.Registers),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CustomerGroupID)("items",e.pageData.Options.Groups),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.PaymentState)("items",e.pageData.Options.States),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CreatorID),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount)}}function oe(n,i){1&n&&(t.TgZ(0,"th",46),t._uU(1,"COST"),t.qZA())}function re(n,i){1&n&&(t.TgZ(0,"th",47),t._uU(1,"TAX"),t.qZA())}function ie(n,i){1&n&&(t.TgZ(0,"th",48),t._uU(1,"SURCHARGE "),t.qZA())}function le(n,i){1&n&&t._UZ(0,"br")}const se=function(){return["/menu/Orders/Orders/Sales_Order/Info"]},w=function(n){return{ID:n}};function pe(n,i){if(1&n&&(t.TgZ(0,"a",49),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("routerLink",t.DdM(3,se))("queryParams",t.VKq(4,w,e.SOID)),t.xp6(1),t.Oqu(e.SalesOrderNumber)}}function ce(n,i){1&n&&t._UZ(0,"br")}function _e(n,i){if(1&n&&(t.TgZ(0,"i"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Note)}}function ue(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Cost))}}function ge(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Tax))}}function de(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",t.lcZ(2,1,e.SurchargeAmount)," ")}}const me=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},Ze=function(){return["/menu/Contacts/Contact/Customers/Info"]},he=function(n,i,e){return{"text-success":n,"text-warning":i,"text-danger":e}};function xe(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"a",49),t._uU(5),t.qZA(),t.YNc(6,le,1,0,"br",50),t.YNc(7,pe,2,6,"a",51),t.YNc(8,ce,1,0,"br",50),t.YNc(9,_e,2,1,"i",50),t.qZA(),t.TgZ(10,"td"),t.TgZ(11,"div"),t._uU(12),t.ALo(13,"date"),t.qZA(),t.TgZ(14,"div"),t._uU(15),t.ALo(16,"date"),t.qZA(),t.qZA(),t.TgZ(17,"td"),t.TgZ(18,"a",52),t._uU(19),t.qZA(),t.qZA(),t.TgZ(20,"td"),t._uU(21),t.qZA(),t.YNc(22,ue,3,3,"td",53),t.TgZ(23,"td",54),t._uU(24),t.ALo(25,"number"),t.qZA(),t.YNc(26,ge,3,3,"td",53),t.YNc(27,de,3,3,"td",53),t.TgZ(28,"td",54),t._uU(29),t.ALo(30,"number"),t.qZA(),t.TgZ(31,"td",55),t._uU(32),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.EntityName),t.xp6(2),t.Q6J("routerLink",t.DdM(31,me))("queryParams",t.VKq(32,w,e.ID)),t.xp6(1),t.hij(" ",e.Number," "),t.xp6(1),t.Q6J("ngIf",o.pageData.DoubleNumber),t.xp6(1),t.Q6J("ngIf",o.pageData.DoubleNumber),t.xp6(1),t.Q6J("ngIf",e.Note),t.xp6(1),t.Q6J("ngIf",e.Note),t.xp6(3),t.hij(" ",t.xi3(13,21,e.Date,"dd MMM yy")," "),t.xp6(3),t.hij(" ",t.xi3(16,24,e.Created,"HH:mm")," "),t.xp6(3),t.Q6J("routerLink",t.DdM(34,Ze))("queryParams",t.VKq(35,w,e.CustomerID)),t.xp6(1),t.Oqu(e.CustomerName),t.xp6(2),t.Oqu(e.SalesName),t.xp6(1),t.Q6J("ngIf",o.pageData.IsCostVisible),t.xp6(2),t.Oqu(t.lcZ(25,27,e.Sales)),t.xp6(2),t.Q6J("ngIf",o.data.TaxVisible),t.xp6(1),t.Q6J("ngIf",o.data.SurchargeVisible),t.xp6(2),t.Oqu(t.lcZ(30,29,e.SalesNSurcharge)),t.xp6(2),t.Q6J("ngClass",t.kEZ(37,he,3==e.PaymentStateID,2==e.PaymentStateID,1==e.PaymentStateID)),t.xp6(1),t.Oqu(e.PaymentStateString)}}function Te(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Cost")),"")}}function Ce(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Tax")))}}function fe(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"SurchargeAmount")),"")}}function Ae(n,i){if(1&n&&(t.TgZ(0,"tfoot",56),t.TgZ(1,"tr",57),t._UZ(2,"td",58),t.TgZ(3,"td",59),t._uU(4),t.ALo(5,"number"),t.qZA(),t._UZ(6,"td",58),t._UZ(7,"td",58),t.TgZ(8,"td",60),t._uU(9,"Total:"),t.qZA(),t.YNc(10,Te,4,6,"td",53),t.TgZ(11,"td",54),t._uU(12),t.ALo(13,"number"),t.ALo(14,"sum"),t.qZA(),t.YNc(15,Ce,4,6,"td",53),t.YNc(16,fe,4,6,"td",53),t.TgZ(17,"td",54),t._uU(18),t.ALo(19,"number"),t.ALo(20,"sum"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(4),t.hij("",t.lcZ(5,6,e.data.Data.length)," Orders"),t.xp6(6),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(2),t.Oqu(t.lcZ(13,8,t.xi3(14,10,e.data.Data,"Sales"))),t.xp6(3),t.Q6J("ngIf",e.data.TaxVisible),t.xp6(1),t.Q6J("ngIf",e.data.SurchargeVisible),t.xp6(2),t.Oqu(t.lcZ(19,13,t.xi3(20,15,e.data.Data,"SalesNSurcharge")))}}function qe(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",30),t.TgZ(1,"table",31),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",32),t.TgZ(3,"tr"),t.TgZ(4,"th",33),t._uU(5,"OUTLET"),t.qZA(),t.TgZ(6,"th",34),t._uU(7,"NUMBER"),t.qZA(),t.TgZ(8,"th",35),t._uU(9,"DATE"),t.qZA(),t.TgZ(10,"th",36),t._uU(11,"CUSTOMER"),t.qZA(),t.TgZ(12,"th",37),t._uU(13,"SALES PERSON"),t.qZA(),t.YNc(14,oe,2,0,"th",38),t.TgZ(15,"th",39),t._uU(16,"SALES"),t.qZA(),t.YNc(17,re,2,0,"th",40),t.YNc(18,ie,2,0,"th",41),t.TgZ(19,"th",42),t._uU(20,"TOTAL"),t.qZA(),t.TgZ(21,"th",43),t._uU(22,"PAYMENT"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(23,"tbody"),t.YNc(24,xe,33,41,"tr",44),t.qZA(),t.YNc(25,Ae,21,18,"tfoot",45),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(14),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(3),t.Q6J("ngIf",e.data.TaxVisible),t.xp6(1),t.Q6J("ngIf",e.data.SurchargeVisible),t.xp6(6),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data)}}let De=(()=>{class n extends m.n{constructor(e,o,a,r,l){super(e,"Report/ReportSummary","ReportLoader/ReportSummary",null,r),this.httpService=e,this.csvConverter=o,this.datePipe=a,this.activatedRoute=r,this._matDialog=l,this.hideMore=!0,this.filterInvociceBy=[{Key:!1,Value:"Date"},{Key:!0,Value:"Created"}]}preGetList(){}postInit(){this.menuData.H=this.data.PageTitle,(null!=this.CustomerID||null!=this.CustomerID)&&(this.pageData.Filter.CustomerID=this.CustomerID),this.pageData.Filter.RowCount=0}openItemModal(e,o){this._matDialog.open(Kt,{data:{ExportRowCount:this.pageData.Filter.ExportRowCount,ExportPageNumber:this.pageData.Filter.ExportPageNumber}}).afterClosed().subscribe(r=>{r&&(this.pageData.Filter.ExportPageNumber=r.ExportPageNumber,this.pageData.Filter.ExportRowCount=r.ExportRowCount,this.exportCSV(this.csvConverter,e,o),this.pageData.Filter.RowCount=0)})}transformDate(e){return this.datePipe.transform(e,"ddMMyy")}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(a.CustomerName=null==a.CustomerName?"":a.CustomerName,r.CustomerName=null==r.CustomerName?"":r.CustomerName,a.SalesName=null==a.SalesName?"":a.SalesName,r.SalesName=null==r.SalesName?"":r.SalesName,e.active){case"outlet":return this.compare(a.EntityName.toLocaleLowerCase(),r.EntityName.toLocaleLowerCase(),l);case"number":return this.compare(a.Number,r.Number,l);case"date":return this.compare(a.Date,r.Date,l);case"customer":return this.compare(a.CustomerName.toLocaleLowerCase(),r.CustomerName.toLocaleLowerCase(),l);case"salesPerson":return this.compare(a.SalesName.toLocaleLowerCase(),r.SalesName.toLocaleLowerCase(),l);case"cost":return this.compare(a.Cost,r.Cost,l);case"sales":return this.compare(a.Sales,r.Sales,l);case"tax":return this.compare(a.Tax,r.Tax,l);case"surcharge":return this.compare(a.SurchargeAmount,r.SurchargeAmount,l);case"total":return this.compare(a.SalesNSurcharge,r.SalesNSurcharge,l);case"payment":return this.compare(a.PaymentStateString,r.PaymentStateString,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(s.uU),t.Y36(u.gz),t.Y36(S.uw))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-sales-summary"]],features:[t.qOj],decls:27,vars:6,consts:[[3,"pageData","hideSearchBox","onSubmit"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-upload"],["class","btn btn-outline-secondary btn-sm dropdown-toggle","data-toggle","dropdown",4,"ngIf"],[1,"dropdown-menu","dropdown-menu-right"],[1,"dropdown-item"],[3,"click"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"caret"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["placeholder","Customer","requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModel","inputTextValue","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"ngModel","items","ngModelChange"],[4,"ngIf","ngIfElse"],["DATEONLY",""],["name","Is Created",3,"options","model","modelChange"],["name","From",3,"date","appearance","width","dateChange"],["name","To",3,"date","appearance","width","dateChange"],["id","more-filter","container","",1,"ml-6"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModel","items","ngModelChange"],["requestUrl","/API/AC/GetUserSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["type","tel","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","class","align-right",4,"ngIf"],["mat-sort-header","sales",1,"align-right"],["mat-sort-header","tax","class","align-right",4,"ngIf"],["mat-sort-header","surcharge","class","align-right",4,"ngIf"],["mat-sort-header","total",1,"align-right"],["mat-sort-header","payment",2,"width","50px"],[4,"ngFor","ngForOf"],["class","border-top",4,"ngIf"],["mat-sort-header","cost",1,"align-right"],["mat-sort-header","tax",1,"align-right"],["mat-sort-header","surcharge",1,"align-right"],["target","_blank",3,"routerLink","queryParams"],[4,"ngIf"],["target","_blank",3,"routerLink","queryParams",4,"ngIf"],[3,"routerLink","queryParams"],["class","text-right",4,"ngIf"],[1,"text-right"],[1,"text-left",3,"ngClass"],[1,"border-top"],[1,"table","table-borderless"],[1,"empty-column"],[1,"text-left","empty-column"],[1,"text-right","empty-column"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"div",1),t.TgZ(3,"a",2),t.NdJ("click",function(){return o.openItemModal("ReportExport/ReportSummary","SalesReportSummary_"+o.transformDate(o.pageData.Filter.From)+"-"+o.transformDate(o.pageData.Filter.To)+".csv")}),t._UZ(4,"i",3),t._uU(5," Export "),t.qZA(),t.YNc(6,zt,2,0,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/ReportSummaryWithPayment","ReportSummaryWithPayment.csv")}),t._uU(10," Export With Payment "),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t.NdJ("click",function(){return o.openItemModal("ReportExport/ReportSummaryWithMethod","ReportSummaryWithMethod.csv")}),t._uU(13," Export With Payment Method "),t.qZA(),t.qZA(),t.TgZ(14,"li",6),t.TgZ(15,"a",7),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/ReportSummaryWithTaxDetail","ReportSummaryWithTaxDetail.csv")}),t._uU(16," Export with Taxable & TaxExempt "),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(17,"filters"),t.TgZ(18,"div",8),t.YNc(19,ne,23,11,"div",9),t.YNc(20,ae,21,8,"div",10),t.qZA(),t.TgZ(21,"a",11),t.NdJ("click",function(){return o.hideMore=!o.hideMore}),t._uU(22,"More "),t._UZ(23,"i",12),t.qZA(),t.qZA(),t.TgZ(24,"content"),t.TgZ(25,"div",13),t.YNc(26,qe,26,5,"div",14),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(6),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(13),t.Q6J("ngIf",o.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!o.hideMore),t.xp6(6),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,D.J,q.P,Xt.L,C.QB,p.Fj,Z.YE,Z.nU,s.sg,u.yS,s.mk],pipes:[s.uU,s.JJ,T.qU],styles:[""]}),n})();function ye(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",6),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.convertToCSV(a.csvConverter,!1,"Top_Brand.csv")}),t._UZ(1,"i",7),t._uU(2,"Export"),t.qZA()}}function ve(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",8),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From - To"),t.qZA(),t.TgZ(8,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Se(n,i){1&n&&(t.TgZ(0,"th",20),t._uU(1,"Code"),t.qZA())}function Me(n,i){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Code)}}const be=function(){return["/menu/Products/Setup/Brand/Brand_Form"]},Je=function(n){return{ID:n}};function Oe(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t.TgZ(2,"a",21),t._uU(3),t.qZA(),t.qZA(),t.YNc(4,Me,2,1,"td",22),t.TgZ(5,"td",23),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",23),t._uU(9),t.ALo(10,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Q6J("routerLink",t.DdM(10,be))("queryParams",t.VKq(11,Je,e.ID)),t.xp6(1),t.hij("",e.BrandName," "),t.xp6(1),t.Q6J("ngIf",e.Countcode>0),t.xp6(2),t.Oqu(t.lcZ(7,6,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(10,8,e.Total))}}function Ie(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",12),t.TgZ(1,"table",13),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",14),t.TgZ(3,"tr"),t.TgZ(4,"th",15),t._uU(5,"Brand"),t.qZA(),t.YNc(6,Se,2,0,"th",16),t.TgZ(7,"th",17),t._uU(8,"Sold"),t.qZA(),t.TgZ(9,"th",18),t._uU(10,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"tbody"),t.YNc(12,Oe,11,13,"tr",19),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(6),t.Q6J("ngIf",e.data.Countcode>0),t.xp6(6),t.Q6J("ngForOf",e.data.Data)}}const Fe=function(){return["/menu/Reports/Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis"]};let we=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/BrandRank","ReportLoader/BrandRank"),this.httpService=e,this.csvConverter=o}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Brand":return this.compare(a.BrandName,r.BrandName,l);case"Code":return this.compare(a.Code,r.Code,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Total":return this.compare(a.Total,r.Total,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-Top-Brand"]],features:[t.qOj],decls:10,vars:7,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-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","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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",4,"ngIf"],["mat-sort-header","Quantity",1,"align-right",2,"width","75px"],["mat-sort-header","Total",1,"align-right",2,"width","120px"],[4,"ngFor","ngForOf"],["mat-sort-header","Code",2,"width","120px"],[3,"routerLink","queryParams"],[4,"ngIf"],[1,"text-right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,ye,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4," Brand Sales Analysis "),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,ve,10,4,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,Ie,13,2,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(1),t.Q6J("routerLink",t.DdM(6,Fe)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,Z.YE,Z.nU,s.sg],pipes:[s.JJ],encapsulation:2}),n})();function Ne(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"label",3),t.NdJ("click",function(){const r=t.CHM(e).$implicit;return t.oxw().updateSelectedGroups(r.ID)}),t._UZ(1,"input",4),t.TgZ(2,"span"),t._uU(3),t.qZA(),t.qZA()}if(2&n){const e=i.$implicit,o=t.oxw();t.xp6(1),t.Q6J("value",e.ID)("checked",o.IDGroups.indexOf(e.ID)>-1),t.xp6(2),t.Oqu(e.Name)}}let Pe=(()=>{class n{constructor(e,o){this.dialogRef=e,this.data=o,this.IDGroups=[],this.options=o.options,this.model=o.model,this.model.forEach(a=>{this.IDGroups.push(a.GroupID)})}ngOnInit(){}updateSelectedGroups(e){const o=this.IDGroups.indexOf(e);o>-1?this.IDGroups.splice(o,1):this.IDGroups.push(e)}onOk(){this.dialogRef.close({groupIDs:this.IDGroups})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(S.so),t.Y36(S.WI))},n.\u0275cmp=t.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(e,o){1&e&&(t.TgZ(0,"modal-material",0),t.NdJ("onOk",function(){return o.onOk()})("onCancel",function(){return o.dialogRef.close()}),t.TgZ(1,"content"),t.TgZ(2,"div",1),t.YNc(3,Ne,4,3,"label",2),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.Q6J("title","Edit Groups"),t.xp6(3),t.Q6J("ngForOf",o.options))},directives:[I.M,s.sg],styles:["label[_ngcontent-%COMP%] {\n display: block;\n}\nlabel[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n font-size: 14px;\n}"]}),n})();var x=f(7695),N=f(5427);function Le(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/CustomerRank","Top Customer ["+a.transformDate(a.pageData.Filter.From)+" - "+a.transformDate(a.pageData.Filter.To)+"].csv")}),t._UZ(1,"i",12),t._uU(2,"Export"),t.qZA()}}function Qe(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Group"),t.qZA(),t.TgZ(8,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From/To"),t.qZA(),t.TgZ(12,"datepicker",16),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",17),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Row Count"),t.qZA(),t.TgZ(17,"input",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.GroupID)("items",null==e.pageData.Options?null:e.pageData.Options.Groups),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount)}}function Ye(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"span"),t.TgZ(1,"span"),t._uU(2),t.qZA(),t.TgZ(3,"a",37),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2).$implicit;return t.oxw(3).showModalEditGroup(a.Groups,a.CustomerID)}),t._uU(4),t.qZA(),t.qZA()}if(2&n){const e=i.$implicit,o=i.index;t.xp6(2),t.Oqu(0==o?"":" , "),t.xp6(2),t.Oqu(e.GroupName)}}function Re(n,i){if(1&n&&(t.TgZ(0,"span"),t.YNc(1,Ye,5,2,"span",31),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",e.Groups)}}function ke(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",37),t.NdJ("click",function(){t.CHM(e);const a=t.oxw().$implicit;return t.oxw(3).showModalEditGroup(a.Groups,a.CustomerID)}),t._uU(1," No group assigned "),t.qZA()}}const Ee=function(){return["/menu/Contacts/Contact/Customers/Info"]},He=function(n){return{ID:n}};function Ve(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t.TgZ(2,"a",32),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"td",33),t.YNc(5,Re,2,1,"span",34),t.YNc(6,ke,2,0,"a",35),t.qZA(),t.TgZ(7,"td"),t._uU(8),t.qZA(),t.TgZ(9,"td",36),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",36),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",36),t._uU(16),t.ALo(17,"number"),t.qZA(),t.TgZ(18,"td",36),t._uU(19),t.ALo(20,"number"),t.qZA(),t.TgZ(21,"td",36),t._uU(22),t.ALo(23,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Q6J("routerLink",t.DdM(21,Ee))("queryParams",t.VKq(22,He,e.CustomerID)),t.xp6(1),t.hij(" ",e.Name+" "+(e.Title?e.Title:"")," "),t.xp6(2),t.Q6J("ngIf",e.Groups.length>0),t.xp6(1),t.Q6J("ngIf",!(e.Groups.length>0)),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(11,11,e.Orders)),t.xp6(3),t.Oqu(t.lcZ(14,13,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(17,15,e.Sales)),t.xp6(3),t.Oqu(t.lcZ(20,17,e.Tax)),t.xp6(3),t.Oqu(t.lcZ(23,19,e.Sales+e.Tax))}}function Be(n,i){if(1&n&&(t.TgZ(0,"tbody",30),t.YNc(1,Ve,24,24,"tr",31),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.data.Data)}}function Ge(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",19),t.TgZ(1,"table",20),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",21),t.TgZ(3,"tr"),t.TgZ(4,"th",22),t._uU(5,"CUSTOMER"),t.qZA(),t.TgZ(6,"th"),t._uU(7,"GROUPS"),t.qZA(),t.TgZ(8,"th",23),t._uU(9,"CODE"),t.qZA(),t.TgZ(10,"th",24),t._uU(11,"ORDERS"),t.qZA(),t.TgZ(12,"th",25),t._uU(13,"QTY"),t.qZA(),t.TgZ(14,"th",26),t._uU(15,"SALES"),t.qZA(),t.TgZ(16,"th",27),t._uU(17,"TAX"),t.qZA(),t.TgZ(18,"th",28),t._uU(19,"SALES + TAX"),t.qZA(),t.qZA(),t.qZA(),t.YNc(20,Be,2,1,"tbody",29),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(20),t.Q6J("ngIf",e.data.Data)}}const We=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"]},Ke=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"]},ze=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Suppliers"]};let tn=(()=>{class n extends m.n{constructor(e,o,a,r,l){super(e,"Report/CustomerRank","ReportLoader/CustomerRank"),this.httpService=e,this.pageTitle=o,this.csvConverter=a,this.datePipe=r,this.matDialog=l}preInitList(){x.gT.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null)}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Name":return this.compare(a.Name,r.Name,l);case"Code":return this.compare(a.Code,r.Code,l);case"Orders":return this.compare(a.Orders,r.Orders,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"Tax":return this.compare(a.Tax,r.Tax,l);case"SalesNTax":return this.compare(a.Sales+a.Tax,r.Sales+r.Tax,l);default:return 0}}):o}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}showModalEditGroup(e,o){this.matDialog.open(Pe,{data:{options:this.pageData.Options.Groups,model:e}}).afterClosed().subscribe(r=>{r&&this.httpService.post("/API/Report/UpdateContactGroups",JSON.stringify({ContactID:o,GroupIDs:r.groupIDs})).subscribe(()=>{this.getListData()})})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(N.Dx),t.Y36(h.O),t.Y36(s.uU),t.Y36(S.uw))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-Top-Customers"]],features:[t.qOj],decls:19,vars:11,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a group",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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","Name",2,"width","280px"],["mat-sort-header","Code",2,"width","120px"],["mat-sort-header","Orders",1,"align-right",2,"width","75px"],["mat-sort-header","Quantity",1,"align-right",2,"width","75px"],["mat-sort-header","Sales",1,"align-right",2,"width","135px"],["mat-sort-header","Tax",1,"align-right",2,"width","135px"],["mat-sort-header","SalesNTax",1,"align-right",2,"width","135px"],["class","border-bottom",4,"ngIf"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[3,"routerLink","queryParams"],[1,"pointer"],[4,"ngIf"],["class","text-primary",3,"click",4,"ngIf"],[1,"text-right"],[1,"text-primary",3,"click"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Le,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"Top Customers By Age"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10,"Top Customers By Gender"),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t._uU(13,"Top Supplier"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"filters"),t.TgZ(15,"div",8),t.YNc(16,Qe,18,7,"div",9),t.qZA(),t.qZA(),t.TgZ(17,"content"),t.YNc(18,Ge,21,1,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(8,We)),t.xp6(5),t.Q6J("routerLink",t.DdM(9,Ke)),t.xp6(3),t.Q6J("routerLink",t.DdM(10,ze)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,p.Fj,M.b,Z.YE,Z.nU,s.sg],pipes:[s.JJ],encapsulation:2}),n})();function en(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/CustomerRank","Top Customer ["+a.transformDate(a.pageData.Filter.From)+" - "+a.transformDate(a.pageData.Filter.To)+"].csv")}),t._UZ(1,"i",12),t._uU(2,"Export"),t.qZA()}}function nn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Group"),t.qZA(),t.TgZ(8,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From - To"),t.qZA(),t.TgZ(12,"datepicker",16),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",17),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Row Count"),t.qZA(),t.TgZ(17,"input",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.GroupID)("items",null==e.pageData.Options?null:e.pageData.Options.Groups),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount)}}function an(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",29),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",29),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",30),t._uU(10),t.ALo(11,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.hij(" ",e.Name," "),t.xp6(2),t.Oqu(t.lcZ(5,4,e.TotalOrders)),t.xp6(3),t.Oqu(t.lcZ(8,6,e.TotalQuantity)),t.xp6(3),t.Oqu(t.lcZ(11,8,e.TotalAmount))}}function on(n,i){if(1&n&&(t.TgZ(0,"tbody",27),t.YNc(1,an,12,10,"tr",28),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.data.Data)}}function rn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",19),t.TgZ(1,"table",20),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",21),t.TgZ(3,"tr"),t.TgZ(4,"th",22),t._uU(5,"AGE"),t.qZA(),t.TgZ(6,"th",23),t._uU(7,"ORDERS"),t.qZA(),t.TgZ(8,"th",24),t._uU(9,"QUANTITY"),t.qZA(),t.TgZ(10,"th",25),t._uU(11,"AMOUNT"),t.qZA(),t.qZA(),t.qZA(),t.YNc(12,on,2,1,"tbody",26),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(12),t.Q6J("ngIf",e.data.Data)}}const ln=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers"]},pn=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"]},_n=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Suppliers"]};let un=(()=>{class n extends m.n{constructor(e,o,a,r){super(e,"Report/CustomerAgeRank","ReportLoader/CustomerAgeRank"),this.httpService=e,this.pageTitle=o,this.csvConverter=a,this.datePipe=r}preInitList(){x.gT.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),x.gT.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Age":return this.compare(a.Name,r.Name,l);case"Orders":return this.compare(a.TotalOrders,r.TotalOrders,l);case"Quantity":return this.compare(a.TotalQuantity,r.TotalQuantity,l);case"Total":return this.compare(a.TotalAmount,r.TotalAmount,l);default:return 0}}):o}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(N.Dx),t.Y36(h.O),t.Y36(s.uU))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-top-customers-by-age"]],features:[t.qOj],decls:19,vars:11,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a group",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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",1,"align-right",2,"width","75px"],["mat-sort-header","Quantity",1,"align-right",2,"width","75px"],["mat-sort-header","Total",1,"align-right",2,"width","135px"],["class","border-bottom",4,"ngIf"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[1,"text-right"],[1,"text-right","text-success"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,en,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"Top Customers"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10,"Top Customers By Gender"),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t._uU(13,"Top Supplier"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"filters"),t.TgZ(15,"div",8),t.YNc(16,nn,18,7,"div",9),t.qZA(),t.qZA(),t.TgZ(17,"content"),t.YNc(18,rn,13,1,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(8,ln)),t.xp6(5),t.Q6J("routerLink",t.DdM(9,pn)),t.xp6(3),t.Q6J("routerLink",t.DdM(10,_n)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,p.Fj,M.b,Z.YE,Z.nU,s.sg],pipes:[s.JJ],styles:[""]}),n})();function gn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.convertToCSV(a.csvConverter,!0,"Top Gender ["+a.transformDate(a.pageData.Filter.From)+" - "+a.transformDate(a.pageData.Filter.To)+"].csv")}),t._UZ(1,"i",12),t._uU(2,"Export"),t.qZA()}}function dn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Group"),t.qZA(),t.TgZ(8,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From - To"),t.qZA(),t.TgZ(12,"datepicker",16),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",17),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Row Count"),t.qZA(),t.TgZ(17,"input",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.GroupID)("items",null==e.pageData.Options?null:e.pageData.Options.Groups),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount)}}function mn(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",28),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",28),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",29),t._uU(10),t.ALo(11,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.hij(" ",e.Name," "),t.xp6(2),t.Oqu(t.lcZ(5,4,e.TotalOrders)),t.xp6(3),t.Oqu(t.lcZ(8,6,e.TotalQuantity)),t.xp6(3),t.Oqu(t.lcZ(11,8,e.TotalAmount))}}function Zn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",19),t.TgZ(1,"table",20),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",21),t.TgZ(3,"tr"),t.TgZ(4,"th",22),t._uU(5,"GENDER"),t.qZA(),t.TgZ(6,"th",23),t._uU(7,"ORDERS"),t.qZA(),t.TgZ(8,"th",24),t._uU(9,"QUANTITY"),t.qZA(),t.TgZ(10,"th",25),t._uU(11,"AMOUNT"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(12,"tbody",26),t.YNc(13,mn,12,10,"tr",27),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(13),t.Q6J("ngForOf",e.data)}}const hn=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers"]},Tn=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"]},fn=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Suppliers"]};let An=(()=>{class n extends m.n{constructor(e,o,a,r){super(e,"Report/CustomerGenderRank","ReportLoader/CustomerGenderRank"),this.httpService=e,this.pageTitle=o,this.csvConverter=a,this.datePipe=r,this.header={0:"GENDER",1:"ORDERS",2:"QUANTITY",3:"AMOUNT"}}preInitList(){x.gT.IsEmpty(this.pageData.Filter.GroupID)&&(this.pageData.Filter.GroupID=null),x.gT.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}transformDate(e){return this.datePipe.transform(e,"dd_MMM_yyyy")}sortData(e){const o=this.data.slice();this.data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Gender":return this.compare(a.Name,r.Name,l);case"Orders":return this.compare(a.TotalOrders,r.TotalOrders,l);case"Quantity":return this.compare(a.TotalQuantity,r.TotalQuantity,l);case"Total":return this.compare(a.TotalAmount,r.TotalAmount,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(N.Dx),t.Y36(h.O),t.Y36(s.uU))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-top-customers-by-gender"]],features:[t.qOj],decls:19,vars:11,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a group",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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",1,"align-right",2,"width","75px"],["mat-sort-header","Quantity",1,"align-right",2,"width","75px"],["mat-sort-header","Total",1,"align-right",2,"width","135px"],[1,"border-bottom"],[4,"ngFor","ngForOf"],[1,"text-right"],[1,"text-right","text-success"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,gn,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"Top Customers"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10,"Top Customers By Age"),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t._uU(13,"Top Supplier"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"filters"),t.TgZ(15,"div",8),t.YNc(16,dn,18,7,"div",9),t.qZA(),t.qZA(),t.TgZ(17,"content"),t.YNc(18,Zn,14,1,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(8,hn)),t.xp6(5),t.Q6J("routerLink",t.DdM(9,Tn)),t.xp6(3),t.Q6J("routerLink",t.DdM(10,fn)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,p.Fj,M.b,Z.YE,Z.nU,s.sg],pipes:[s.JJ],styles:[""]}),n})();function qn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/TopSalesExport","Top_Supplier.csv")}),t._UZ(1,"i",12),t._uU(2,"Export"),t.qZA()}}function Dn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Group"),t.qZA(),t.TgZ(8,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From - To"),t.qZA(),t.TgZ(12,"datepicker",16),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",17),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Row Count"),t.qZA(),t.TgZ(17,"input",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.GroupID)("items",null==e.pageData.Options?null:e.pageData.Options.Group),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount)}}const yn=function(){return["/menu/Contacts/Contact/Customers/Info"]},vn=function(n){return{ID:n}},Sn=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]},Mn=function(n,i,e){return{From:n,SupplierID:i,To:e}};function bn(n,i){if(1&n&&(t.TgZ(0,"tr",33),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",34),t.TgZ(4,"a",35),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"td",32),t._uU(7),t.qZA(),t.TgZ(8,"td",36),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",32),t.TgZ(12,"a",35),t.ALo(13,"date"),t.ALo(14,"date"),t._uU(15),t.ALo(16,"number"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.Rank),t.xp6(2),t.Q6J("routerLink",t.DdM(20,yn))("queryParams",t.VKq(21,vn,e.SupplierID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(10,9,e.Quantity)),t.xp6(3),t.Q6J("routerLink",t.DdM(23,Sn))("queryParams",t.kEZ(24,Mn,t.xi3(13,11,o.pageData.Filter.From,"ddMMyyyy"),e.SupplierID,t.xi3(14,14,o.pageData.Filter.To,"ddMMyyyy"))),t.xp6(3),t.hij(" ",t.xi3(16,17,e.Total,".0-0"),"")}}function Jn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",19),t.TgZ(1,"table",20),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",21),t.TgZ(3,"tr"),t.TgZ(4,"th",22),t._uU(5,"RANK"),t.qZA(),t.TgZ(6,"th",23),t._uU(7,"SUPPLIER"),t.qZA(),t.TgZ(8,"th",24),t._uU(9,"CODE"),t.qZA(),t.TgZ(10,"th",25),t._uU(11,"QUANTITY"),t.qZA(),t.TgZ(12,"th",26),t._uU(13,"TOTAL"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"tbody"),t.YNc(15,bn,17,28,"tr",27),t.qZA(),t.qZA(),t.TgZ(16,"div",28),t.TgZ(17,"table",29),t.TgZ(18,"thead",30),t.TgZ(19,"tr",31),t.TgZ(20,"th",32),t._uU(21,"Total Quantity"),t.qZA(),t.TgZ(22,"th",32),t._uU(23,"Total Sales"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(24,"tbody"),t.TgZ(25,"tr"),t.TgZ(26,"td"),t._uU(27),t.qZA(),t.TgZ(28,"td"),t._uU(29),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(15),t.Q6J("ngForOf",e.data.Data),t.xp6(12),t.Oqu(e.data.TotalQty),t.xp6(2),t.Oqu(e.data.TotalSales)}}const On=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers"]},Un=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender"]},wn=function(){return["/menu/Reports/Sales_Report/Standard/Top_Customers/Top_Customers_By_Age"]};let Nn=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/TopSalesSupplier","ReportLoader/TopSupplierLoader"),this.httpService=e,this.csvConverter=o}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Rank":return this.compare(a.Rank,r.Rank,l);case"Supplier":return this.compare(a.Name,r.Name,l);case"Code":return this.compare(a.Code,r.Code,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Total":return this.compare(a.Total,r.Total,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-top-suppliers"]],features:[t.qOj],decls:19,vars:11,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a group",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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","Rank",2,"width","35px"],["mat-sort-header","Supplier"],["mat-sort-header","Code",2,"width","80px"],["mat-sort-header","Quantity",1,"align-right",2,"width","120px"],["mat-sort-header","Total",1,"align-right",2,"width","120px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-end"],[1,"table","w-auto"],[1,"thead-light"],[1,"header"],[1,"text-right"],[1,"border-bottom"],[1,"text-left"],[3,"routerLink","queryParams"],[1,"text-right","text-success"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,qn,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"Top Customers"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10,"Top Customers By Gender"),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t._uU(13,"Top Customers By Age"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"filters"),t.TgZ(15,"div",8),t.YNc(16,Dn,18,7,"div",9),t.qZA(),t.qZA(),t.TgZ(17,"content"),t.YNc(18,Jn,30,3,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(8,On)),t.xp6(5),t.Q6J("routerLink",t.DdM(9,Un)),t.xp6(3),t.Q6J("routerLink",t.DdM(10,wn)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,p.Fj,M.b,Z.YE,Z.nU,s.sg],pipes:[s.JJ,s.uU],styles:[""]}),n})();var Pn=f(2254),Ln=f(2507),Qn=f.n(Ln),k=f(4106);function Yn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",17),t.NdJ("click",function(){return t.CHM(e),t.oxw().updateMinstock()}),t._uU(1,"Submit"),t.qZA()}}function Rn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",18),t.TgZ(1,"a",19),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/ProductSales","Product Sales.csv")}),t._UZ(2,"i",20),t._uU(3," Export "),t.qZA(),t.TgZ(4,"button",6),t._UZ(5,"b",21),t.qZA(),t.TgZ(6,"ul",22),t.TgZ(7,"li",8),t.TgZ(8,"a",23),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/ProductSalesExportWithDescription","Product Sales.csv")}),t._uU(9," Export With Description "),t.qZA(),t.qZA(),t.qZA(),t.qZA()}}function kn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",24),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",25),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a})("change",function(){return t.CHM(e),t.oxw().resetListId()}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",26),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From - To"),t.qZA(),t.TgZ(12,"datepicker",27),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",28),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Sales"),t.qZA(),t.TgZ(17,"ng-select",29),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Scope"),t.qZA(),t.TgZ(21,"radio-options",30),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupByVariant=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(4),t.Q6J("date",e.pageData.Filter.From)("showClearBtn",!0)("showTodayBtn",!0),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)("showClearBtn",!0)("showTodayBtn",!0),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("model",e.pageData.Filter.GroupByVariant)("options",e.ScopeFilter)}}function En(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",31),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Sales Order Type"),t.qZA(),t.TgZ(4,"ng-select",29),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Supplier"),t.qZA(),t.TgZ(8,"autocompleteV2",32),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SupplierID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Brand"),t.qZA(),t.TgZ(12,"autocompleteV2",33),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.BrandID=a}),t.qZA(),t.qZA(),t.TgZ(13,"div"),t.TgZ(14,"h6"),t._uU(15,"Customer"),t.qZA(),t.TgZ(16,"autocompleteV2",34),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CustomerID=a}),t.qZA(),t.qZA(),t.TgZ(17,"div"),t.TgZ(18,"h6"),t._uU(19,"Exclude Complementary"),t.qZA(),t.TgZ(20,"radio-options",35),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ExcludeComplementary=a}),t.qZA(),t.qZA(),t.TgZ(21,"div"),t.TgZ(22,"h6"),t._uU(23,"Exclude Non Inventory"),t.qZA(),t.TgZ(24,"radio-options",35),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ExcludeInventory=a}),t.qZA(),t.qZA(),t.TgZ(25,"div"),t.TgZ(26,"h6"),t._uU(27,"Show Inventory"),t.qZA(),t.TgZ(28,"radio-options",36),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ShowInventory=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SupplierID)("inputTextValue",e.pageData.supplierName),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.BrandID),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CustomerID),t.xp6(4),t.Q6J("model",e.pageData.Filter.ExcludeComplementary),t.xp6(4),t.Q6J("model",e.pageData.Filter.ExcludeInventory),t.xp6(4),t.Q6J("model",e.pageData.Filter.ShowInventory)}}function Hn(n,i){1&n&&(t.TgZ(0,"th",52),t._uU(1,"COST"),t.qZA())}function Vn(n,i){1&n&&(t.TgZ(0,"th",53),t._uU(1,"INVENTORY "),t.qZA())}function Bn(n,i){1&n&&(t.TgZ(0,"th",54),t._uU(1,"REORDER MIN"),t.qZA())}function Gn(n,i){1&n&&(t.TgZ(0,"th",55),t._uU(1,"UPDATE ROP"),t.qZA())}function jn(n,i){1&n&&(t.TgZ(0,"th",56),t._uU(1,"PROFIT"),t.qZA())}function Wn(n,i){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"img",66),t.NdJ("click",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.oxw(2).openBigPicture(r,a)}),t.qZA(),t.BQk()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.s9C("src",e.ThumbnailUrl,t.LSH)}}function $n(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",67),t.TgZ(1,"img",68),t.NdJ("click",function(a){t.CHM(e);const r=t.oxw().$implicit;return t.oxw(2).openBigPicture(r,a)}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(3);t.Q6J("target",e.pageData.LinkTarget),t.xp6(1),t.Q6J("src","//res.cloudinary.com/pos/image/upload/w_"+(null==e.data?null:e.data.ThumbnailWidth)+"/POS/Images/Icon/products_thumb.png",t.LSH)}}function Kn(n,i){if(1&n&&(t.TgZ(0,"td",62),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",t.lcZ(2,1,e.UnitCost)," ")}}const E=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Invoice_Items"]},zn=function(n,i,e){return{VariantID:n,From:i,To:e}};function ta(n,i){if(1&n&&(t.TgZ(0,"a",69),t.ALo(1,"date"),t.ALo(2,"date"),t._uU(3),t.ALo(4,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.Q6J("routerLink",t.DdM(11,E))("queryParams",t.kEZ(12,zn,e.ID,t.xi3(1,3,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(2,6,o.pageData.Filter.To,"ddMMyyyy"))),t.xp6(3),t.Oqu(t.lcZ(4,9,e.Total))}}const ea=function(n,i,e){return{ProductID:n,From:i,To:e}};function na(n,i){if(1&n&&(t.TgZ(0,"a",69),t.ALo(1,"date"),t.ALo(2,"date"),t._uU(3),t.ALo(4,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.Q6J("routerLink",t.DdM(11,E))("queryParams",t.kEZ(12,ea,e.ID,t.xi3(1,3,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(2,6,o.pageData.Filter.To,"ddMMyyyy"))),t.xp6(3),t.Oqu(t.lcZ(4,9,e.Total))}}function aa(n,i){if(1&n&&(t.TgZ(0,"td",62),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.UnitsInStock?e.UnitsInStock:0)," ")}}function oa(n,i){if(1&n&&(t.TgZ(0,"td",62),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.MinStock),"")}}function ra(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"td",62),t.TgZ(1,"input",70),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().$implicit.NewMinStock=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.NewMinStock)}}function ia(n,i){if(1&n&&(t.TgZ(0,"td",71),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",e.Profit>=0?"text-success":"text-danger"),t.xp6(1),t.hij(" ",t.lcZ(2,2,e.Profit)," ")}}const la=function(n){return[n]},sa=function(n){return{ID:n}};function pa(n,i){if(1&n&&(t.TgZ(0,"tr",57),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"div",58),t.TgZ(5,"div",59),t.YNc(6,Wn,2,1,"ng-container",51),t.YNc(7,$n,2,2,"a",60),t.qZA(),t.TgZ(8,"a",61),t._uU(9),t.qZA(),t.qZA(),t.qZA(),t.TgZ(10,"td"),t._uU(11),t.qZA(),t.TgZ(12,"td",62),t._uU(13),t.ALo(14,"number"),t.qZA(),t.YNc(15,Kn,3,3,"td",63),t.TgZ(16,"td",62),t.YNc(17,ta,5,16,"a",64),t.YNc(18,na,5,16,"a",64),t.qZA(),t.YNc(19,aa,3,3,"td",63),t.YNc(20,oa,3,3,"td",63),t.YNc(21,ra,2,1,"td",63),t.YNc(22,ia,3,4,"td",65),t.qZA()),2&n){const e=i.$implicit,o=i.index,a=t.oxw(2);t.xp6(2),t.Oqu(o+1),t.xp6(4),t.Q6J("ngIf",e.ImageUrl),t.xp6(1),t.Q6J("ngIf",!e.ImageUrl),t.xp6(1),t.Q6J("routerLink",t.VKq(17,la,1==a.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",t.VKq(19,sa,e.ID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(14,15,e.Quantity)),t.xp6(2),t.Q6J("ngIf",null==a.pageData.Role?null:a.pageData.Role.HasCostRole),t.xp6(2),t.Q6J("ngIf",a.pageData.Filter.GroupByVariant),t.xp6(1),t.Q6J("ngIf",!a.pageData.Filter.GroupByVariant),t.xp6(1),t.Q6J("ngIf",a.pageData.Filter.ShowInventory),t.xp6(1),t.Q6J("ngIf",e.MinVisible&&a.pageData.Filter.ShowInventory),t.xp6(1),t.Q6J("ngIf",(null==a.pageData.Role?null:a.pageData.Role.IsReorderPointEditor)&&a.pageData.Filter.GroupByVariant&&e.MinVisible&&a.pageData.Filter.ListIDs),t.xp6(1),t.Q6J("ngIf",null==a.pageData.Role?null:a.pageData.Role.HasCostRole)}}function ca(n,i){if(1&n&&(t.TgZ(0,"td",62),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"UnitCost"))," ")}}function _a(n,i){if(1&n&&(t.TgZ(0,"td",74),t.TgZ(1,"a"),t._uU(2),t.ALo(3,"number"),t.ALo(4,"sum"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(2),t.Oqu(t.lcZ(3,1,t.xi3(4,3,e.data.Data,"UnitsInStock")))}}function ua(n,i){if(1&n&&(t.TgZ(0,"td",62),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Profit")))}}function ga(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",72),t.TgZ(2,"td",73),t._uU(3,"Total : "),t.qZA(),t.TgZ(4,"td",62),t._uU(5),t.ALo(6,"number"),t.ALo(7,"sum"),t.qZA(),t.YNc(8,ca,4,6,"td",63),t.TgZ(9,"td",74),t.TgZ(10,"a"),t._uU(11),t.ALo(12,"number"),t.ALo(13,"sum"),t.qZA(),t.qZA(),t.YNc(14,_a,5,6,"td",75),t.YNc(15,ua,4,6,"td",63),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(5),t.Oqu(t.lcZ(6,5,t.xi3(7,7,e.data.Data,"Quantity"))),t.xp6(3),t.Q6J("ngIf",e.pageData.Role.HasCostRole),t.xp6(3),t.Oqu(t.lcZ(12,10,t.xi3(13,12,e.data.Data,"Total"))),t.xp6(3),t.Q6J("ngIf",e.pageData.Filter.ShowInventory),t.xp6(1),t.Q6J("ngIf",null==e.pageData.Role?null:e.pageData.Role.HasCostRole)}}function da(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",37),t.TgZ(1,"table",38),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",39),t.TgZ(3,"tr"),t.TgZ(4,"th",40),t._uU(5,"No"),t.qZA(),t.TgZ(6,"th",41),t._uU(7,"NAME"),t.qZA(),t.TgZ(8,"th",42),t._uU(9,"CODE"),t.qZA(),t.TgZ(10,"th",43),t._uU(11,"QUANTITY"),t.qZA(),t.YNc(12,Hn,2,0,"th",44),t.TgZ(13,"th",45),t._uU(14,"SALES "),t.qZA(),t.YNc(15,Vn,2,0,"th",46),t.YNc(16,Bn,2,0,"th",47),t.YNc(17,Gn,2,0,"th",48),t.YNc(18,jn,2,0,"th",49),t.qZA(),t.qZA(),t.TgZ(19,"tbody"),t.YNc(20,pa,23,21,"tr",50),t.qZA(),t.YNc(21,ga,16,15,"tfoot",51),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(12),t.Q6J("ngIf",null==e.pageData.Role?null:e.pageData.Role.HasCostRole),t.xp6(3),t.Q6J("ngIf",e.pageData.Filter.ShowInventory),t.xp6(1),t.Q6J("ngIf",e.data.MinVisible&&e.pageData.Filter.ShowInventory),t.xp6(1),t.Q6J("ngIf",(null==e.pageData.Role?null:e.pageData.Role.IsReorderPointEditor)&&e.pageData.Filter.GroupByVariant&&e.data.MinVisible&&e.pageData.Filter.ListIDs),t.xp6(1),t.Q6J("ngIf",null==e.pageData.Role?null:e.pageData.Role.HasCostRole),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data)}}const Za=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet"]},xa=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales"]},Ca=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Delivery"]};let fa=(()=>{class n extends m.n{constructor(e,o,a,r){super(e,"Report/ProductSales","ReportLoader/ProductSales",null,r),this.httpService=e,this.csvConverter=o,this.toasterService=a,this.activatedRoute=r,this.hideMore=!0,this.ScopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}]}postInit(){this.menuData.H=this.data.PageTitle,$(document).ready(function(){$('[data-toggle="tooltip"]').tooltip({trigger:"hover",sanitize:!1,sanitizeFn:e=>e})})}openBigPicture(e,o){Qn()({el:o.target,imgSrc:e.ImageUrl,noLoader:!1})}updateMinstock(){const e=[];return this.data.Data.forEach(a=>{a.NewMinStock!=a.MinStock&&e.push({VariantID:a.ID,MinStock:a.NewMinStock})}),x.gT.IsEmpty(0==this.pageData.Filter.ListIDs.length)?(alert("Outlet is require"),!1):x.gT.IsEmpty(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:e})).subscribe(a=>{this.toasterService.success(a,Pn.n.Success),this.getListData()})}sortData(e){const o=this.data.Data.slice();function a(r,l,_){return(r<l?-1:1)*(_?1:-1)}this.data.Data=e.active&&""!==e.direction?o.sort((r,l)=>{const _="asc"===e.direction;switch(r.Code=null==r.Code?"":r.Code,l.Code=null==l.Code?"":l.Code,r.BrandName=null==r.BrandName?"":r.BrandName,l.BrandName=null==l.BrandName?"":l.BrandName,e.active){case"Name":return a(r.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),_);case"Code":return a(r.Code.toLocaleLowerCase(),l.Code.toLocaleLowerCase(),_);case"Brand":return a(r.BrandName.toLocaleLowerCase(),l.BrandName.toLocaleLowerCase(),_);case"Quantity":return a(r.Quantity,l.Quantity,_);case"Total_Cost":return a(r.UnitCost,l.UnitCost,_);case"Inventory":return a(r.UnitsInStock,l.UnitsInStock,_);case"Total_Sales":return a(r.Total,l.Total,_);case"ReOrder":return a(r.MinStock,l.MinStock,_);default:return 0}}):o}resetListId(){0==this.pageData.Filter.ListIDs.length&&(this.pageData.Filter.ListIDs=null)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(y._W),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["POS-product-sales"]],features:[t.qOj],decls:26,vars:13,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],["class","btn-group mr-6",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fas","fa-balance-scale","mr-2"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],[1,"container-fluid","mt-5"],["class","table-responsive",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary","mr-6",3,"click"],[1,"btn-group","mr-6"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-upload"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-right"],[3,"click"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose...",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange","change"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModel","items","ngModelChange"],["name","From",3,"date","showClearBtn","showTodayBtn","dateChange"],["name","To",3,"date","showClearBtn","showTodayBtn","dateChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"ngModel","items","ngModelChange"],["name","Scope",3,"model","options","modelChange"],["id","more-filter","container","",1,"ml-6"],["requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100",3,"ngModel","inputTextValue","ngModelChange"],["requestUrl","/API/AC/GetProductBrandSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["name","Exclude",3,"model","modelChange"],["name","Scope",3,"model","modelChange"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["mat-sort-header","Name"],["mat-sort-header","Code",2,"width","100px"],["mat-sort-header","Quantity",1,"align-right",2,"width","100px"],["style","width: 100px;","class","align-right","mat-sort-header","Total_Cost",4,"ngIf"],["mat-sort-header","Total_Sales",1,"align-right",2,"width","100px"],["style","width: 100px;","class","align-right","mat-sort-header","Inventory",4,"ngIf"],["style","width: 120px;","class","align-right","mat-sort-header","ReOrder",4,"ngIf"],["style","width: 88px;","class","align-right",4,"ngIf"],["class","text-right","style","width: 7.5rem;",4,"ngIf"],["class","border-bottom align-middle",4,"ngFor","ngForOf"],[4,"ngIf"],["mat-sort-header","Total_Cost",1,"align-right",2,"width","100px"],["mat-sort-header","Inventory",1,"align-right",2,"width","100px"],["mat-sort-header","ReOrder",1,"align-right",2,"width","120px"],[1,"align-right",2,"width","88px"],[1,"text-right",2,"width","7.5rem"],[1,"border-bottom","align-middle"],[1,"d-flex","align-items-center","align-middle"],[1,"mr-3"],["class","d-block",3,"target",4,"ngIf"],[1,"",3,"routerLink","queryParams"],[1,"text-right"],["class","text-right",4,"ngIf"],[3,"routerLink","queryParams",4,"ngIf"],["class","text-right",3,"ngClass",4,"ngIf"],["matTooltip","Click to zoom",2,"width","40px",3,"src","click"],[1,"d-block",3,"target"],["matTooltip","Click to zoom",1,"border","rounded",2,"width","40px",3,"src","click"],[3,"routerLink","queryParams"],["type","text","autoNum","",1,"text-right",2,"width","72px",3,"ngModel","ngModelChange"],[1,"text-right",3,"ngClass"],[1,"table","table-borderless"],["colspan","3",1,"text-right"],[1,"text-right","text-primary"],["class","text-right text-primary ",4,"ngIf"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Text=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Yn,2,0,"a",1),t.YNc(3,Rn,10,0,"div",2),t.TgZ(4,"div",3),t.TgZ(5,"a",4),t._UZ(6,"i",5),t._uU(7,"Compare by Outlet"),t.qZA(),t._UZ(8,"button",6),t.TgZ(9,"ul",7),t.TgZ(10,"li",8),t.TgZ(11,"a",9),t._uU(12,"Compare by Month"),t.qZA(),t.qZA(),t.TgZ(13,"li",8),t.TgZ(14,"a",9),t._uU(15,"Compare with Delivery"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(16,"filters"),t.TgZ(17,"div",10),t.YNc(18,kn,22,15,"div",11),t.YNc(19,En,29,9,"div",12),t.qZA(),t.TgZ(20,"a",13),t.NdJ("click",function(){return o.hideMore=!o.hideMore}),t._uU(21,"More "),t._UZ(22,"i",14),t.qZA(),t.qZA(),t.TgZ(23,"content"),t.TgZ(24,"div",15),t.YNc(25,da,22,7,"div",16),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Text),t.xp6(2),t.Q6J("ngIf",(null==o.pageData.Role?null:o.pageData.Role.IsReorderPointEditor)&&o.pageData.Filter.GroupByVariant&&(null==o.data?null:o.data.MinVisible)&&o.pageData.Filter.ListIDs),t.xp6(1),t.Q6J("ngIf",null==o.pageData.Role?null:o.pageData.Role.HasExportRole),t.xp6(2),t.Q6J("routerLink",t.DdM(10,Za)),t.xp6(6),t.Q6J("routerLink",t.DdM(11,xa)),t.xp6(3),t.Q6J("routerLink",t.DdM(12,Ca)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!o.hideMore),t.xp6(6),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,q.P,D.J,Z.YE,Z.nU,s.sg,k.gM,p.Fj,M.b,s.mk],pipes:[s.JJ,s.uU,T.qU],styles:[""]}),n})();function Aa(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",6),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.convertToCSV(a.csvConverter,!0,"SalesProductByOutlet.csv")}),t._UZ(1,"i",7),t._uU(2," Export"),t.qZA()}}function qa(n,i){if(1&n&&(t.TgZ(0,"span",16),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Da(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Product"),t.qZA(),t.TgZ(3,"autocompleteV2",17),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ProductID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.ProductID)}}function ya(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Variant"),t.qZA(),t.TgZ(3,"autocompleteV2",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ProductID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.ProductID)}}function va(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",8),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Sales"),t.qZA(),t.TgZ(4,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Categories"),t.qZA(),t.TgZ(8,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,qa,2,2,"ng-template",11),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"From - To"),t.qZA(),t.TgZ(13,"datepicker",12),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(14,"datepicker",13),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(15,"div"),t.TgZ(16,"h6"),t._uU(17,"Scope"),t.qZA(),t.TgZ(18,"radio-options",14),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Product=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.YNc(19,Da,4,1,"div",15),t.YNc(20,ya,4,1,"div",15),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("model",e.pageData.Filter.Product)("options",e.ScopeFilter),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.Product),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.Product)}}function Sa(n,i){if(1&n&&(t.TgZ(0,"th",25),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Oqu(e)}}function Ma(n,i){if(1&n&&(t.TgZ(0,"td",25),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Oqu(e)}}function ba(n,i){if(1&n&&(t.TgZ(0,"tr",27),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",28),t._uU(4),t.qZA(),t.YNc(5,Ma,2,1,"td",24),t.TgZ(6,"td",25),t._uU(7),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(1),t.Q6J("ngForOf",e.Quantities),t.xp6(2),t.Oqu(e.Total)}}function Ja(n,i){if(1&n&&(t.TgZ(0,"div",19),t.TgZ(1,"table",20),t.TgZ(2,"thead",21),t.TgZ(3,"tr"),t.TgZ(4,"th",22),t._uU(5,"Nama"),t.qZA(),t.TgZ(6,"th",23),t._uU(7,"Code"),t.qZA(),t.YNc(8,Sa,2,1,"th",24),t.TgZ(9,"th",25),t._uU(10,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"tbody"),t.YNc(12,ba,8,4,"tr",26),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(8),t.Q6J("ngForOf",e.data.Outlet),t.xp6(4),t.Q6J("ngForOf",e.data.Data)}}const Oa=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]};let Ia=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/ReportSalesProductByOutlet","ReportLoader/ReportSalesProductByOutlet"),this.httpService=e,this.csvConverter=o,this.ScopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}]}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-product-sales-by-outlet"]],features:[t.qOj],decls:10,vars:8,consts:[[3,"pageData","text","hideSearchBox","textChange","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-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","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales",3,"ngModel","items","ngModelChange"],["bindLabel","Value","bindValue","Key","placeholder","Choose a category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["name","Scope",3,"model","options","modelChange"],[4,"ngIf"],[3,"title"],["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-right",4,"ngFor","ngForOf"],[1,"text-right"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[2,"text-align","right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Aa,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4,"Group by Product"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,va,21,10,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,Ja,13,2,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",null==o.pageData.Filter?null:o.pageData.Filter.IsExport),t.xp6(1),t.Q6J("routerLink",t.DdM(7,Oa)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,C.QB,q.P,D.J,s.sg],styles:[""]}),n})();function Ua(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",6),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.convertToCSV(a.csvConverter,!0,"SalesProductByOutlet.csv")}),t._UZ(1,"i",7),t._uU(2,"Export"),t.qZA()}}function Fa(n,i){if(1&n&&(t.TgZ(0,"span",15),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function wa(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",8),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Fa,2,2,"ng-template",11),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Compare Month From"),t.qZA(),t.TgZ(13,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.MonthFrom=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Compare Month To"),t.qZA(),t.TgZ(17,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.MonthTo=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Year"),t.qZA(),t.TgZ(21,"ng-select",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(22,"div"),t.TgZ(23,"h6"),t._uU(24,"Scope"),t.qZA(),t.TgZ(25,"radio-options",14),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupByVariant=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.MonthFrom)("items",e.Months),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.MonthTo)("items",e.Months),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("model",e.pageData.Filter.GroupByVariant)("options",e.ScopeFilter)}}function Na(n,i){if(1&n&&(t.TgZ(0,"th",25),t._uU(1),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.hij(" ",o.Months[e.Month-1].ColumnLabel," ")}}function Pa(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit,o=t.oxw().$implicit,a=t.oxw(2);t.xp6(1),t.hij(" ",a.findKey(o.Sold,e.Month)?t.lcZ(2,1,a.findKey(o.Sold,e.Month)):""," ")}}const La=function(n){return[n]},Qa=function(n){return{ID:n}};function Ya(n,i){if(1&n&&(t.TgZ(0,"tr",26),t.TgZ(1,"td"),t.TgZ(2,"a",27),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.YNc(6,Pa,3,3,"td",28),t.TgZ(7,"td",29),t._uU(8),t.ALo(9,"number"),t.ALo(10,"sum"),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.VKq(11,La,o.pageData.Filter.GroupByVariant?"/menu/Products/Catalog/Variants/Info":"/menu/Products/Catalog/Products/Info"))("queryParams",t.VKq(13,Qa,e.ID)),t.xp6(1),t.hij(" ",e.Name," "),t.xp6(2),t.Oqu(e.Code),t.xp6(1),t.Q6J("ngForOf",o.data.MonthlySales),t.xp6(2),t.hij(" ",t.lcZ(9,6,t.xi3(10,8,e.Sold,"Value"))," ")}}function Ra(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.Sold)," ")}}function ka(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",30),t._UZ(2,"td"),t._UZ(3,"td"),t.YNc(4,Ra,3,3,"td",28),t.TgZ(5,"td",29),t._uU(6),t.ALo(7,"number"),t.ALo(8,"sum"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("ngForOf",e.data.MonthlySales),t.xp6(2),t.hij(" ",t.lcZ(7,2,t.xi3(8,4,e.data.MonthlySales,"Sold"))," ")}}function Ea(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",16),t.TgZ(1,"table",17),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",18),t.TgZ(3,"tr"),t.TgZ(4,"th",19),t._uU(5,"Name"),t.qZA(),t.TgZ(6,"th",20),t._uU(7,"Code"),t.qZA(),t.YNc(8,Na,2,1,"th",21),t.TgZ(9,"th",22),t._uU(10,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"tbody"),t.YNc(12,Ya,11,15,"tr",23),t.qZA(),t.YNc(13,ka,9,7,"tfoot",24),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(8),t.Q6J("ngForOf",e.data.MonthlySales),t.xp6(4),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.Data.length>0)}}const Ha=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]};let Va=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/ProductSalesMonthly","ReportLoader/ProductSalesMonthly"),this.httpService=e,this.csvConverter=o,this.Years=x.gT.GenerateYears((new Date).getFullYear()+1,11,!0),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"}],this.ScopeFilter=[{Key:!1,Value:"Product"},{Key:!0,Value:"Variant"}]}preGetList(){x.gT.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=x.gT.GuidEmpty)}postInit(){this.menuData.H=this.data.PageTitle}findKey(e,o){let a=null;return e.forEach(r=>{r.Key==o&&(a=r.Value)}),a}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(a.Code=null==a.Code?"":a.Code,r.Code=null==r.Code?"":r.Code,a.Name=null==a.Name?"":a.Name,r.Name=null==r.Name?"":r.Name,e.active){case"Name":return this.compare(a.Name.toLocaleLowerCase(),r.Name.toLocaleLowerCase(),l);case"Code":return this.compare(a.Code.toLocaleLowerCase(),r.Code.toLocaleLowerCase(),l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-product-sales-by-month"]],features:[t.qOj],decls:10,vars:7,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-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","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],["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","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange"],["placeholder","Year",3,"ngModel","items","ngModelChange"],["name","Scope",3,"model","options","modelChange"],[3,"title"],[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",2,"width","120px"],["class","text-right small","style","width: 70px",4,"ngFor","ngForOf"],[1,"text-right",2,"width","75px"],["class","border-bottom",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"text-right","small",2,"width","70px"],[1,"border-bottom"],[3,"routerLink","queryParams"],["class","text-right",4,"ngFor","ngForOf"],[1,"text-right"],[1,"table","table-borderless"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Ua,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4,"Group by Product"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,wa,26,12,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,Ea,14,3,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(1),t.Q6J("routerLink",t.DdM(6,Ha)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,q.P,Z.YE,Z.nU,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function Ba(n,i){if(1&n&&(t.TgZ(0,"span",15),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Ga(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Product"),t.qZA(),t.TgZ(3,"autocompleteV2",16),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ProductID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.ProductID)}}function ja(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Variant"),t.qZA(),t.TgZ(3,"autocompleteV2",17),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ProductID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.ProductID)}}function Wa(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Categories"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(5,Ba,2,2,"ng-template",9),t.qZA(),t.qZA(),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"From - To"),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(10,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(11,"div"),t.TgZ(12,"h6"),t._uU(13,"Scope"),t.qZA(),t.TgZ(14,"radio-options",12),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Product=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.YNc(15,Ga,4,1,"div",13),t.YNc(16,ja,4,1,"div",13),t.TgZ(17,"div"),t.TgZ(18,"h6"),t._uU(19,"Write Performance Log"),t.qZA(),t.TgZ(20,"radio-options",14),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.WritePerformanceLog=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("model",e.pageData.Filter.Product)("options",e.ScopeFilter),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.Product),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.Product),t.xp6(4),t.Q6J("model",e.pageData.Filter.WritePerformanceLog)}}function $a(n,i){if(1&n&&(t.TgZ(0,"th",26),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Oqu(e)}}function Ka(n,i){if(1&n&&(t.TgZ(0,"tr"),t._UZ(1,"th"),t._UZ(2,"th"),t.YNc(3,$a,2,1,"th",25),t.qZA()),2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngForOf",e.data.Outlet)}}function Xa(n,i){if(1&n&&(t.TgZ(0,"th",27),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",e,"")}}function za(n,i){if(1&n&&(t.TgZ(0,"td",22),t._uU(1),t.qZA()),2&n){const e=i.$implicit,o=t.oxw().$implicit;t.xp6(1),t.Oqu(o[e])}}function to(n,i){if(1&n&&(t.TgZ(0,"tr",22),t.YNc(1,za,2,1,"td",24),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",o.getKeys(e))}}function eo(n,i){if(1&n&&(t.TgZ(0,"div",18),t.TgZ(1,"table",19),t.TgZ(2,"thead",20),t.YNc(3,Ka,4,1,"tr",13),t.TgZ(4,"tr"),t.TgZ(5,"th",21),t._uU(6,"Name"),t.qZA(),t.TgZ(7,"th",22),t._uU(8,"Code"),t.qZA(),t.YNc(9,Xa,2,1,"th",23),t.qZA(),t.qZA(),t.TgZ(10,"tbody"),t.YNc(11,to,2,1,"tr",24),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(3),t.Q6J("ngIf",e.data.Outlet.length>0),t.xp6(6),t.Q6J("ngForOf",e.data.Header),t.xp6(2),t.Q6J("ngForOf",e.data.Data)}}const no=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]};let ao=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetProductSalesVsDelivery","ReportLoader/ReportSalesProductByOutlet"),this.httpService=e,this.csvConverter=o,this.ScopeFilter=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}]}getKeys(e){return Object.keys(e)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-product-sales-vs-delivery"]],features:[t.qOj],decls:12,vars:6,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[1,"btn","btn-outline-secondary",3,"routerLink"],[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",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["name","Scope",3,"model","options","modelChange"],[4,"ngIf"],["name","Scope",3,"model","modelChange"],[3,"title"],["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"],[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(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/GetProductSalesVsDelivery","Productsalesvsdelivery.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"Group by Product"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,Wa,21,9,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,eo,12,3,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(5),t.Q6J("routerLink",t.DdM(5,no)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,C.QB,q.P,D.J,s.sg],styles:[""]}),n})();function oo(n,i){if(1&n&&(t.TgZ(0,"span",20),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function ro(n,i){if(1&n&&(t.TgZ(0,"span",20),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function io(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Categories"),t.qZA(),t.TgZ(8,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,oo,2,2,"ng-template",16),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Brand"),t.qZA(),t.TgZ(13,"ng-select",17),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.BrandID=a}),t.YNc(14,ro,2,2,"ng-template",16),t.qZA(),t.qZA(),t.TgZ(15,"div"),t.TgZ(16,"h6"),t._uU(17,"From - To"),t.qZA(),t.TgZ(18,"datepicker",18),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(19,"datepicker",19),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("items",null==e.pageData.Options?null:e.pageData.Options.Brands)("ngModel",e.pageData.Filter.BrandID),t.xp6(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function lo(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",21),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Sales"),t.qZA(),t.TgZ(4,"ng-select",22),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Customer"),t.qZA(),t.TgZ(8,"autocompleteV2",23),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CustomerID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Exclude Zero"),t.qZA(),t.TgZ(12,"radio-options",24),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ExcludeZero=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("items",e.pageData.Options.Sales)("ngModel",e.pageData.Filter.SalesID),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CustomerID),t.xp6(4),t.Q6J("model",e.pageData.Filter.ExcludeZero)}}function so(n,i){1&n&&(t.TgZ(0,"th",42),t._uU(1," COST"),t.qZA())}function po(n,i){1&n&&(t.TgZ(0,"th",43),t._uU(1," PROFIT"),t.qZA())}function co(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Cost))}}function _o(n,i){if(1&n&&(t.TgZ(0,"td",37),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Profit))}}const uo=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]},go=function(n,i,e){return{CategoryID:n,From:i,To:e}};function mo(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t.TgZ(2,"a",44),t.ALo(3,"date"),t.ALo(4,"date"),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"td",37),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",38),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",37),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",37),t._uU(16),t.ALo(17,"number"),t.qZA(),t.YNc(18,co,3,3,"td",39),t.YNc(19,_o,3,3,"td",40),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.DdM(23,uo))("queryParams",t.kEZ(24,go,e.ID,t.xi3(3,9,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(4,12,o.pageData.Filter.To,"ddMMyyyy"))),t.xp6(3),t.Oqu(e.Name),t.xp6(2),t.Oqu(t.lcZ(8,15,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(11,17,e.Total)),t.xp6(3),t.Oqu(t.lcZ(14,19,e.Discount+e.DiscountAmount)),t.xp6(3),t.Oqu(t.lcZ(17,21,e.NetSales)),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",o.pageData.HasRoleCost)}}function Zo(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Cost")),"")}}function ho(n,i){if(1&n&&(t.TgZ(0,"td",37),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Profit")),"")}}function xo(n,i){if(1&n&&(t.TgZ(0,"div",46),t.TgZ(1,"small",47),t._uU(2,"Gross Sales :"),t.qZA(),t.TgZ(3,"strong",48),t._uU(4),t.ALo(5,"number"),t.ALo(6,"sum"),t.qZA(),t.TgZ(7,"small",47),t._uU(8,"- Discount % :"),t.qZA(),t.TgZ(9,"strong",49),t._uU(10),t.ALo(11,"number"),t.ALo(12,"sum"),t.qZA(),t.TgZ(13,"small",47),t._uU(14),t.qZA(),t.TgZ(15,"strong",49),t._uU(16),t.ALo(17,"number"),t.qZA(),t.TgZ(18,"small",47),t._uU(19),t.qZA(),t.TgZ(20,"strong",49),t._uU(21),t.ALo(22,"number"),t.qZA(),t.TgZ(23,"small",47),t._uU(24),t.qZA(),t.TgZ(25,"strong",50),t._uU(26),t.ALo(27,"number"),t.ALo(28,"sum"),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(4),t.Oqu(t.lcZ(5,8,t.xi3(6,10,e.data.Data,"Total"))),t.xp6(6),t.Oqu(t.lcZ(11,13,t.xi3(12,15,e.data.Data,"Discount"))),t.xp6(4),t.hij("- Discount ",e.data.Currency," :"),t.xp6(2),t.Oqu(t.lcZ(17,18,e.data.TotalDiscountAmount.DiscountAmount)),t.xp6(3),t.hij("- Point Used ",e.data.Currency," :"),t.xp6(2),t.Oqu(t.lcZ(22,20,e.data.TotalDiscountAmount.PointUsed)),t.xp6(3),t.hij("= Net Sales ",e.data.Currency," :"),t.xp6(2),t.Oqu(t.lcZ(27,22,t.xi3(28,24,e.data.Data,"NetSales")-e.data.TotalDiscountAmount.DiscountAmount-e.data.TotalDiscountAmount.PointUsed))}}function To(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",25),t.TgZ(1,"table",26),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",27),t.TgZ(3,"tr"),t.TgZ(4,"th",28),t._uU(5,"CATEGORY"),t.qZA(),t.TgZ(6,"th",29),t._uU(7,"QUANTITY"),t.qZA(),t.TgZ(8,"th",30),t._uU(9,"GROSS SALES"),t.qZA(),t.TgZ(10,"th",31),t._uU(11,"DISCOUNT"),t.qZA(),t.TgZ(12,"th",32),t._uU(13,"NET SALES"),t.qZA(),t.YNc(14,so,2,0,"th",33),t.YNc(15,po,2,0,"th",34),t.qZA(),t.qZA(),t.TgZ(16,"tbody"),t.YNc(17,mo,20,28,"tr",35),t.qZA(),t.TgZ(18,"tfoot"),t.TgZ(19,"tr",36),t.TgZ(20,"td",37),t._uU(21,"Total : "),t.qZA(),t.TgZ(22,"td",37),t._uU(23),t.ALo(24,"number"),t.ALo(25,"sum"),t.qZA(),t.TgZ(26,"td",38),t.TgZ(27,"a"),t._uU(28),t.ALo(29,"number"),t.ALo(30,"sum"),t.qZA(),t.qZA(),t.TgZ(31,"td",37),t._uU(32),t.ALo(33,"number"),t.ALo(34,"sum"),t.qZA(),t.TgZ(35,"td",37),t._uU(36),t.ALo(37,"number"),t.ALo(38,"sum"),t.qZA(),t.YNc(39,Zo,4,6,"td",39),t.YNc(40,ho,4,6,"td",40),t.qZA(),t.qZA(),t.qZA(),t.YNc(41,xo,29,27,"div",41),t.qZA()}if(2&n){const e=t.oxw();t.xp6(14),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(6),t.Oqu(t.lcZ(24,10,t.xi3(25,12,e.data.Data,"Quantity"))),t.xp6(5),t.Oqu(t.lcZ(29,15,t.xi3(30,17,e.data.Data,"Total"))),t.xp6(4),t.Oqu(t.lcZ(33,20,t.xi3(34,22,e.data.Data,"Discount"))),t.xp6(4),t.Oqu(t.lcZ(37,25,t.xi3(38,27,e.data.Data,"NetSales"))),t.xp6(3),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",e.data.Data.length>0)}}const fo=function(){return["/menu/Reports/Sales_Report/Standard/Category_Sold/Category"]},qo=function(){return["/menu/Reports/Sales_Report/Standard/Category_Sold/Category_By_Outlet"]};let Do=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/CategorySales","ReportLoader/CategorySales"),this.httpService=e,this.csvConverter=o,this.hideMore=!0}postInit(){this.menuData.H=this.data.PageTitle}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Name":return this.compare(a.Name,r.Name,l);case"Total":return this.compare(a.Total,r.Total,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Discount":return this.compare(a.Discount,r.Discount,l);case"NetSales":return this.compare(a.NetSales,r.NetSales,l);case"Cost":return this.compare(a.Cost,r.Cost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-category-sales"]],features:[t.qOj],decls:20,vars:10,consts:[[3,"pageData","text","hideSearchBox","textChange","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],[1,"fas","fa-chart-area"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fas","fa-balance-scale","mr-2"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],["class","container-fluid mt-5",4,"ngIf"],["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"],["name","To",3,"date","dateChange"],[3,"title"],["id","more-filter","container","",1,"ml-6"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"items","ngModel","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModel","ngModelChange"],[3,"model","modelChange"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name",1,"text-left"],["mat-sort-header","Quantity",1,"align-right",2,"width","120px"],["mat-sort-header","Total",1,"align-right",2,"width","120px"],["mat-sort-header","Discount",1,"align-right",2,"width","120px"],["mat-sort-header","NetSales",1,"align-right",2,"width","120px"],["class","align-right","style","width: 120px;","mat-sort-header","Cost",4,"ngIf"],["class","align-right","style","width: 120px;","mat-sort-header","Profit",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right"],[1,"text-right","text-primary"],["class","text-right text-danger",4,"ngIf"],["class","text-right",4,"ngIf"],["class","h6 mt-12",4,"ngIf"],["mat-sort-header","Cost",1,"align-right",2,"width","120px"],["mat-sort-header","Profit",1,"align-right",2,"width","120px"],[3,"routerLink","queryParams"],[1,"text-right","text-danger"],[1,"h6","mt-12"],[1,"text-muted","h6"],[1,"text-primary","font-weight-bold","h2"],[1,"text-danger","font-weight-bold","h2"],[1,"text-success","font-weight-bold","h2"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/CategorySales","Category Sales.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.TgZ(5,"a",3),t._UZ(6,"i",4),t._uU(7," Chart View"),t.qZA(),t.TgZ(8,"a",5),t._UZ(9,"i",6),t._uU(10,"By Outlet"),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",7),t.YNc(13,io,20,9,"div",8),t.YNc(14,lo,13,4,"div",9),t.TgZ(15,"a",10),t.NdJ("click",function(){return o.hideMore=!o.hideMore}),t._uU(16,"More "),t._UZ(17,"i",11),t.qZA(),t.qZA(),t.qZA(),t.TgZ(18,"content"),t.YNc(19,To,42,30,"div",12),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number)("hideSearchBox",!0),t.xp6(5),t.Q6J("routerLink",t.DdM(8,fo)),t.xp6(3),t.Q6J("routerLink",t.DdM(9,qo)),t.xp6(5),t.Q6J("ngIf",o.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!o.hideMore),t.xp6(5),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,C.QB,D.J,q.P,Z.YE,Z.nU,s.sg],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function yo(n,i){if(1&n&&(t.TgZ(0,"span",13),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function vo(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Categories"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(5,yo,2,2,"ng-template",9),t.qZA(),t.qZA(),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"From - To"),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(10,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(11,"div"),t.TgZ(12,"h6"),t._uU(13,"Customer"),t.qZA(),t.TgZ(14,"autocompleteV2",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CustomerID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CustomerID)}}function So(n,i){if(1&n&&(t.TgZ(0,"th",20),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.Q6J("mat-sort-header",e),t.xp6(1),t.Oqu(e)}}function Mo(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(1),t.Oqu(o[e])}}function bo(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,o[e]))}}function Jo(n,i){if(1&n&&(t.TgZ(0,"td"),t.YNc(1,Mo,2,1,"span",19),t.YNc(2,bo,3,3,"span",19),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Q6J("ngIf","Category"==e),t.xp6(1),t.Q6J("ngIf","Category"!=e)}}function Oo(n,i){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,Jo,3,2,"td",18),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",o.getKey(e))}}function Io(n,i){if(1&n&&(t.TgZ(0,"td",22),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e),"")}}function Uo(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",21),t.TgZ(2,"td",22),t._uU(3,"Total : "),t.qZA(),t.YNc(4,Io,3,3,"td",23),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("ngForOf",e.data.Sum)}}function Fo(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",14),t.TgZ(1,"table",15),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",16),t.TgZ(3,"tr"),t.YNc(4,So,2,2,"th",17),t.qZA(),t.qZA(),t.TgZ(5,"tbody"),t.YNc(6,Oo,2,1,"tr",18),t.qZA(),t.YNc(7,Uo,5,1,"tfoot",19),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngForOf",e.data.Dataheader),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.Data.length>0)}}const wo=function(){return["/menu/Reports/Sales_Report/Standard/Category_Sold"]};let No=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/CategorySalesByOutlet","ReportLoader/CategorySalesByOutlet"),this.httpService=e,this.csvConverter=o}postInit(){this.menuData.H=this.data.PageTitle}getKey(e){return Object.keys(e)}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;for(let _=0;_<this.data.Dataheader.length;_++)if(e.active==this.data.Dataheader[_])return this.compare(a[this.data.Dataheader[_]],r[this.data.Dataheader[_]],l)}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-category-sales-by-outlet"]],features:[t.qOj],decls:12,vars:7,consts:[[3,"pageData","text","hideSearchBox","textChange","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[1,"btn","btn-outline-secondary",3,"routerLink"],[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",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModel","ngModelChange"],[3,"title"],[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"],[1,""],["class","",4,"ngFor","ngForOf"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,!0,"CategorySalesByOutlet.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"Table View"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,vo,15,5,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,Fo,8,3,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number)("hideSearchBox",!0),t.xp6(5),t.Q6J("routerLink",t.DdM(6,wo)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,C.QB,D.J,Z.YE,s.sg,Z.nU],pipes:[s.JJ],styles:[""]}),n})();var U=f(7168);function Po(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",5),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Month"),t.qZA(),t.TgZ(4,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Month=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Year"),t.qZA(),t.TgZ(8,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Currency"),t.qZA(),t.TgZ(12,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",e.pageData.Options.Currencies)}}function Lo(n,i){if(1&n&&(t.TgZ(0,"div",9),t._UZ(1,"POS-pie-chart",10),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("config",e.pieConfig)("data",e.PieData)}}const Qo=function(){return["/menu/Reports/Sales_Report/Standard/Category_Sold"]};let Yo=(()=>{class n extends m.n{constructor(e){super(e,"Report/CategoryChart","ReportLoader/CategoryChartLoader"),this.httpService=e,this.Months=x.gT.Months,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.pieConfig={title:"",dataLabels:!1,labelTooltips:"Sales",height:500,legend:{alignColumns:!1}},this.PieData={}}postInit(){const e=[],o=[];this.data.forEach(a=>{e.push(a.Name),o.push({name:a.Name,y:a.Total})}),this.PieData=o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-category"]],features:[t.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","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(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t._uU(3,"Table View"),t.qZA(),t.qZA(),t.TgZ(4,"filters"),t.TgZ(5,"div",2),t.YNc(6,Po,13,6,"div",3),t.qZA(),t.qZA(),t.TgZ(7,"content"),t.YNc(8,Lo,2,2,"div",4),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(2),t.Q6J("routerLink",t.DdM(5,Qo)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,U.J],styles:[""]}),n})();var J=f(3975);function Ro(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year"),t.qZA(),t.TgZ(3,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Year=a})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years)}}function ko(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Month"),t.qZA(),t.TgZ(3,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Month=a})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months)}}function Eo(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",12),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",13),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Ho(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Date Filter"),t.qZA(),t.TgZ(8,"radio-options",8),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Custom=a}),t.qZA(),t.qZA(),t.YNc(9,Ro,4,2,"div",9),t.YNc(10,ko,4,2,"div",9),t.YNc(11,Eo,5,2,"div",9),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("model",e.pageData.Filter.Custom)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.Custom),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.Custom),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.Custom)}}function Vo(n,i){if(1&n&&(t.TgZ(0,"div",14),t.TgZ(1,"div",15),t.TgZ(2,"div",16),t.TgZ(3,"div",17),t.TgZ(4,"div",18),t.TgZ(5,"div",19),t.TgZ(6,"p",20),t._uU(7,"Transaction Per Hour"),t.qZA(),t.qZA(),t.TgZ(8,"div",21),t._UZ(9,"POS-line-chart",22),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(10,"div",16),t.TgZ(11,"div",17),t.TgZ(12,"div",18),t.TgZ(13,"div",19),t.TgZ(14,"p",20),t._uU(15,"Transaction Per Session"),t.qZA(),t.qZA(),t.TgZ(16,"div",21),t._UZ(17,"POS-pie-chart",22),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(9),t.Q6J("config",e.chartConfig)("data",e.ChartData),t.xp6(8),t.Q6J("config",e.pieConfig)("data",e.PieData)}}const Go=function(){return["/menu/Reports/Sales_Report/Standard/Peak_Hour/Visitor"]},Wo=function(){return["/menu/Reports/Sales_Report/Standard/Peak_Hour/Peak_Hour"]};let $o=(()=>{class n extends m.n{constructor(e){super(e,"Report/PeakHour","ReportLoader/PeakHourLoader"),this.httpService=e,this.RadioDateFilterType=[{Key:!1,Value:"Month"},{Key:!0,Value:"Custom"}],this.DateFilterType="Month",this.categories=[],this.PieData={},this.ChartData={},this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.Months=x.gT.Months,this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Transaction",height:400,legend:{}},this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.categories},yAxis:{title:{text:""}},plotOptions:{},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0,textHeader:function(){return this.points.reduce(function(o,a){return o+"<br/>"+a.series.name+": <b>"+a.y+"</b>"},"<b>Time : "+this.x+"</b>")}}}}postInit(){const e=new Date;this.Year=e.getFullYear();const o=[],a=[];this.data.Data.forEach(r=>{o.push(r.Name),a.push({name:r.Name,y:r.Transaction})}),this.PieData=a,this.ChartData={series:this.data.series},this.categories=this.data.categories}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-peak-hour"]],features:[t.qOj],decls:11,vars:8,consts:[[3,"pageData","hideSearchBox","onSubmit"],[1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],[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",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["name","Date Filter",3,"model","options","modelChange"],[4,"ngIf"],["placeholder","Year",3,"ngModel","items","ngModelChange","clear"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","clear"],["name","From",3,"date","dateChange"],["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(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t._uU(3,"Visitor View"),t.qZA(),t.TgZ(4,"a",2),t._uU(5,"Table View"),t.qZA(),t.qZA(),t.TgZ(6,"filters"),t.TgZ(7,"div",3),t.YNc(8,Ho,12,8,"div",4),t.qZA(),t.qZA(),t.TgZ(9,"content"),t.YNc(10,Vo,18,4,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(6,Go)),t.xp6(2),t.Q6J("routerLink",t.DdM(7,Wo)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,q.P,C.QB,J.D,U.J],styles:[""]}),n})();function Ko(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",8),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From - To"),t.qZA(),t.TgZ(8,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Xo(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.ALo(3,"number"),t.qZA(),t.TgZ(4,"td",20),t._uU(5),t.ALo(6,"number"),t.qZA(),t.TgZ(7,"td",20),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"td",20),t._uU(11),t.ALo(12,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,4,e.Visitor)),t.xp6(3),t.Oqu(t.lcZ(6,6,e.Orders)),t.xp6(3),t.Oqu(t.lcZ(9,8,e.TotalVisitor)),t.xp6(3),t.Oqu(t.lcZ(12,10,e.SalesNTax))}}function zo(n,i){if(1&n&&(t.TgZ(0,"div",12),t.TgZ(1,"table",13),t.TgZ(2,"thead",14),t.TgZ(3,"tr"),t.TgZ(4,"th",15),t._uU(5,"Visitor"),t.qZA(),t.TgZ(6,"th",16),t._uU(7,"Transaction"),t.qZA(),t.TgZ(8,"th",16),t._uU(9,"Total Visitor"),t.qZA(),t.TgZ(10,"th",17),t._uU(11,"Sales + Tax"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(12,"tbody"),t.YNc(13,Xo,13,12,"tr",18),t.qZA(),t.TgZ(14,"tfoot"),t.TgZ(15,"tr",19),t.TgZ(16,"td",20),t._uU(17,"Total"),t.qZA(),t.TgZ(18,"td",20),t._uU(19),t.ALo(20,"number"),t.ALo(21,"sum"),t.qZA(),t.TgZ(22,"td",20),t._uU(23),t.ALo(24,"number"),t.ALo(25,"sum"),t.qZA(),t.TgZ(26,"td",20),t._uU(27),t.ALo(28,"number"),t.ALo(29,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(13),t.Q6J("ngForOf",e.data),t.xp6(6),t.Oqu(t.lcZ(20,4,t.xi3(21,6,e.data,"Orders"))),t.xp6(4),t.Oqu(t.lcZ(24,9,t.xi3(25,11,e.data,"TotalVisitor"))),t.xp6(4),t.Oqu(t.lcZ(28,14,t.xi3(29,16,e.data,"SalesNTax")))}}const tr=function(){return["/menu/Reports/Sales_Report/Standard/Peak_Hour"]},nr=function(){return["/menu/Reports/Sales_Report/Standard/Peak_Hour/Peak_Hour"]};let ar=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetNumberOfPersonList","ReportLoader/GetNumberOfPersonLoader"),this.httpService=e,this.csvConverter=o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-visitor"]],features:[t.qOj],decls:14,vars:8,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],[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",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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-right",2,"width","50px"],[1,"text-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,!1,"PeakHour.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"Chart View"),t.qZA(),t.TgZ(7,"a",4),t._uU(8,"Table View"),t.qZA(),t.qZA(),t.TgZ(9,"filters"),t.TgZ(10,"div",5),t.YNc(11,Ko,10,5,"div",6),t.qZA(),t.qZA(),t.TgZ(12,"content"),t.YNc(13,zo,30,19,"div",7),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(5),t.Q6J("routerLink",t.DdM(6,tr)),t.xp6(2),t.Q6J("routerLink",t.DdM(7,nr)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,C.QB,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function or(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",7),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/GetPeakHourList","PeakHour.csv"),a.changeExport()}),t._UZ(1,"i",8),t._uU(2,"Export"),t.qZA()}}function rr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year"),t.qZA(),t.TgZ(3,"ng-select",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Year=a})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years)}}function ir(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Month"),t.qZA(),t.TgZ(3,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Month=a})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months)}}function lr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",15),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",16),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function sr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",9),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Date Filter"),t.qZA(),t.TgZ(8,"radio-options",11),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Custom=a}),t.qZA(),t.qZA(),t.YNc(9,rr,4,2,"div",12),t.YNc(10,ir,4,2,"div",12),t.YNc(11,lr,5,2,"div",12),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("model",e.pageData.Filter.Custom)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.Custom),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.Custom),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.Custom)}}function pr(n,i){1&n&&(t.TgZ(0,"th",22),t._uU(1,"Revenue"),t.qZA())}function cr(n,i){if(1&n&&(t.TgZ(0,"td",27),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Revenue))}}function _r(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",27),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",27),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",27),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",27),t._uU(13),t.ALo(14,"number"),t.ALo(15,"RoundUp"),t.qZA(),t.TgZ(16,"td",27),t._uU(17),t.ALo(18,"number"),t.ALo(19,"RoundUp"),t.qZA(),t.YNc(20,cr,3,3,"td",28),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.TimeFormat),t.xp6(2),t.Oqu(t.lcZ(5,7,e.Count)),t.xp6(3),t.Oqu(t.lcZ(8,9,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(11,11,e.Sales)),t.xp6(3),t.Oqu(t.lcZ(14,13,t.lcZ(15,15,e.Tax))),t.xp6(4),t.Oqu(t.lcZ(18,17,t.lcZ(19,19,e.SalesWithTax))),t.xp6(3),t.Q6J("ngIf",o.pageData.IsRevenue)}}function ur(n,i){if(1&n&&(t.TgZ(0,"td",27),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Oqu(t.lcZ(2,1,t.xi3(3,3,e.data,"Revenue")))}}function gr(n,i){if(1&n&&(t.TgZ(0,"div",17),t.TgZ(1,"table",18),t.TgZ(2,"thead",19),t.TgZ(3,"tr"),t.TgZ(4,"th",20),t._uU(5,"Time"),t.qZA(),t.TgZ(6,"th",21),t._uU(7,"Order"),t.qZA(),t.TgZ(8,"th",21),t._uU(9,"Quantity"),t.qZA(),t.TgZ(10,"th",22),t._uU(11,"Sales"),t.qZA(),t.TgZ(12,"th",22),t._uU(13,"Tax"),t.qZA(),t.TgZ(14,"th",22),t._uU(15,"Sales + Tax"),t.qZA(),t.YNc(16,pr,2,0,"th",23),t.qZA(),t.qZA(),t.TgZ(17,"tbody"),t.YNc(18,_r,21,21,"tr",24),t.qZA(),t.TgZ(19,"tfoot"),t.TgZ(20,"tr",25),t._UZ(21,"td",26),t.TgZ(22,"td",27),t._uU(23),t.ALo(24,"number"),t.ALo(25,"sum"),t.qZA(),t.TgZ(26,"td",27),t._uU(27),t.ALo(28,"number"),t.ALo(29,"sum"),t.qZA(),t.TgZ(30,"td",27),t._uU(31),t.ALo(32,"number"),t.ALo(33,"sum"),t.qZA(),t.TgZ(34,"td",27),t._uU(35),t.ALo(36,"number"),t.ALo(37,"RoundUp"),t.ALo(38,"sum"),t.qZA(),t.TgZ(39,"td",27),t._uU(40),t.ALo(41,"number"),t.ALo(42,"RoundUp"),t.ALo(43,"sum"),t.qZA(),t.YNc(44,ur,4,6,"td",28),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(16),t.Q6J("ngIf",e.pageData.IsRevenue),t.xp6(2),t.Q6J("ngForOf",e.data),t.xp6(5),t.Oqu(t.lcZ(24,8,t.xi3(25,10,e.data,"Count"))),t.xp6(4),t.Oqu(t.lcZ(28,13,t.xi3(29,15,e.data,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(32,18,t.xi3(33,20,e.data,"Sales"))),t.xp6(4),t.Oqu(t.lcZ(36,23,t.lcZ(37,25,t.xi3(38,27,e.data,"Tax")))),t.xp6(5),t.Oqu(t.lcZ(41,30,t.lcZ(42,32,t.xi3(43,34,e.data,"SalesWithTax")))),t.xp6(4),t.Q6J("ngIf",e.pageData.IsRevenue)}}const mr=function(){return["/menu/Reports/Sales_Report/Standard/Peak_Hour/Visitor"]},Zr=function(){return["/menu/Reports/Sales_Report/Standard/Peak_Hour"]};let hr=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetPeakHourList","ReportLoader/PeakHourLoader"),this.httpService=e,this.csvConverter=o,this.RadioDateFilterType=[{Key:!1,Value:"Month"},{Key:!0,Value:"Custom"}],this.DateFilterType="Month",this.Years=x.gT.GenerateYears((new Date).getFullYear(),10,!0),this.Months=x.gT.Months,this.menuData.H="Peak Hour Table"}changeExport(){this.pageData.Filter.Export=!1}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-table-view"]],features:[t.qOj],decls:12,vars:9,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an Outlet",3,"ngModel","items","ngModelChange"],["name","Date Filter",3,"model","options","modelChange"],[4,"ngIf"],["placeholder","Year",3,"ngModel","items","ngModelChange","clear"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","clear"],["name","From",3,"date","dateChange"],["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-right",2,"width","50px"],[1,"text-right",2,"width","120px"],["style","width: 120px","class"," text-right",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-right"],["class","text-right",4,"ngIf"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,or,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4,"Vistor View"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"Chart View"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,sr,12,7,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,gr,45,37,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasExportRole),t.xp6(1),t.Q6J("routerLink",t.DdM(7,mr)),t.xp6(2),t.Q6J("routerLink",t.DdM(8,Zr)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,q.P,C.QB,s.sg],pipes:[s.JJ,T.qU,T.Fo],styles:[""]}),n})();function xr(n,i){if(1&n&&(t.TgZ(0,"span",18),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Tr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",11),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,xr,2,2,"ng-template",14),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Currency"),t.qZA(),t.TgZ(13,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Month"),t.qZA(),t.TgZ(17,"ng-select",16),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Month=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Year"),t.qZA(),t.TgZ(21,"ng-select",17),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years)}}function Cr(n,i){if(1&n&&(t.TgZ(0,"div",19),t._UZ(1,"POS-line-chart",20),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("config",e.chartConfig)("data",e.ChartData)}}const Ar=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Daily_Table"]},qr=function(n,i){return{Month:n,Year:i}},Dr=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Yearly"]},vr=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"]};let Sr=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/DailySalesChart","ReportLoader/DailyReportSales",null,o),this.ChartData={},this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.Months=x.gT.Months}preGetList(){const e=this.route.snapshot.queryParams;this.pageData.Filter.Month=e.Month,this.pageData.Filter.Year=e.Year}postInit(){this.ChartData={series:this.data.Series};const e=new Date(this.data.From),o=e.getMonth(),a=e.getFullYear();this.from=Date.UTC(a,o,1),this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},xAxis:{type:"datetime"},yAxis:{title:{text:""}},plotOptions:{series:{pointStart:this.from,pointInterval:864e5}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-daily-sales"]],features:[t.qOj],decls:19,vars:14,consts:[[3,"pageData","hideSearchBox","onSubmit"],[1,"btn-group"],["title","Table View",1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa","fa-table"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[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",""],["bindLabel","Symbol","bindValue","ID","placeholder","Choose a Currency",3,"ngModel","items","ngModelChange"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange"],["placeholder","Year",3,"ngModel","items","ngModelChange"],[3,"title"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"div",1),t.TgZ(3,"a",2),t._UZ(4,"i",3),t._uU(5," Table View"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10," Comparable PerYear"),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t._uU(13," Daily Quantity"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"filters"),t.TgZ(15,"div",8),t.YNc(16,Tr,22,10,"div",9),t.qZA(),t.qZA(),t.TgZ(17,"content"),t.YNc(18,Cr,2,2,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(3),t.Q6J("routerLink",t.DdM(8,Ar))("queryParams",t.WLB(9,qr,null==o.pageData.Filter?null:o.pageData.Filter.Month,null==o.pageData.Filter?null:o.pageData.Filter.Year)),t.xp6(6),t.Q6J("routerLink",t.DdM(12,Dr)),t.xp6(3),t.Q6J("routerLink",t.DdM(13,vr)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,J.D],styles:[""]}),n})();function Mr(n,i){if(1&n&&(t.TgZ(0,"span",17),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function br(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",11),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Year"),t.qZA(),t.TgZ(8,"ng-select",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Category"),t.qZA(),t.TgZ(12,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(13,Mr,2,2,"ng-template",15),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Currency"),t.qZA(),t.TgZ(17,"ng-select",16),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().currency=a})("change",function(){return t.CHM(e),t.oxw().checkFilterCurrency()}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.currency)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies)}}function Jr(n,i){if(1&n&&(t.TgZ(0,"div",18),t._UZ(1,"POS-line-chart",19),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("config",e.chartConfig)("data",e.ChartData)}}const Ir=function(){return["/menu/Reports/Sales_Report/Standard/Monthly/Monthly_Table"]},Fr=function(){return["/menu/Reports/Sales_Report/Standard/Monthly/Yearly_Table"]};let wr=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/MonthlySalesPerformanceChart","ReportLoader/MonthlySalesPerformance"),this.httpService=e,this.csvConverter=o,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.ChartData={},this.currency=-1}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 e=[];this.data.MonthlySalesRank.forEach(o=>{const a={name:o.Name,data:o.Sales};a.data.unshift(null),e.push(a)}),this.ChartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{min:1,max:12},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-monthly-sales"]],features:[t.qOj],decls:16,vars:8,consts:[[3,"pageData","text","textChange","onSubmit"],[1,"btn-group"],["title","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"fa","fa-table"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[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"],["placeholder","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"],[3,"title"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"div",1),t.TgZ(3,"a",2),t._UZ(4,"i",3),t._uU(5," Table View"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10," View Yearly "),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",8),t.YNc(13,br,18,8,"div",9),t.qZA(),t.qZA(),t.TgZ(14,"content"),t.YNc(15,Jr,2,2,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(3),t.Q6J("routerLink",t.DdM(6,Ir)),t.xp6(6),t.Q6J("routerLink",t.DdM(7,Fr)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,J.D],styles:[""]}),n})();function Nr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.convertToCSV(a.csvConverter,!1,"SalesPerYear.csv")}),t._UZ(1,"i",12),t._uU(2,"Export"),t.qZA()}}function Pr(n,i){if(1&n&&(t.TgZ(0,"span",22),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Lr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Pr,2,2,"ng-template",16),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Sales Name"),t.qZA(),t.TgZ(13,"ng-select",17),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Year to Compare"),t.qZA(),t.TgZ(17,"div",18),t.TgZ(18,"div",19),t.TgZ(19,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.FromYear=a}),t.qZA(),t.qZA(),t.TgZ(20,"div",19),t.TgZ(21,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ToYear=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(22,"div"),t.TgZ(23,"h6"),t._uU(24,"Type"),t.qZA(),t.TgZ(25,"ng-select",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Option?null:e.pageData.Option.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Option?null:e.pageData.Option.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Option?null:e.pageData.Option.Sales),t.xp6(6),t.Q6J("ngModel",e.pageData.Filter.FromYear)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.pageData.Filter.ToYear)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",e.pageData.Option.Types)}}function Qr(n,i){if(1&n&&(t.TgZ(0,"th",34),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",e,"")}}function Yr(n,i){if(1&n&&(t.TgZ(0,"td",34),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=i.$implicit,o=t.oxw().$implicit,a=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,a.filterSales(o.Sales,"Year",e),"Sales"))," ")}}const H=function(n,i){return{"text-success font-weight-bold":n,"text-danger font-weight-bold":i}};function Rr(n,i){if(1&n&&(t.TgZ(0,"tr",35),t.TgZ(1,"td",26),t._uU(2),t.ALo(3,"Month"),t.qZA(),t.YNc(4,Yr,4,6,"td",36),t.TgZ(5,"td",37),t.ALo(6,"sum"),t.ALo(7,"sum"),t._uU(8),t.ALo(9,"number"),t.ALo(10,"sum"),t.qZA(),t.TgZ(11,"td",37),t.ALo(12,"sum"),t.ALo(13,"sum"),t._uU(14),t.ALo(15,"number"),t.ALo(16,"sum"),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(t.lcZ(3,6,e.Month)),t.xp6(2),t.Q6J("ngForOf",o.data.HeaderList),t.xp6(1),t.Q6J("ngClass",t.WLB(30,H,t.xi3(6,8,o.filterSales(e.Difference,"Month",e.Month),"Difference")>0,t.xi3(7,11,o.filterSales(e.Difference,"Month",e.Month),"Difference")<0)),t.xp6(3),t.hij(" ",t.lcZ(9,14,t.xi3(10,16,o.filterSales(e.Difference,"Month",e.Month),"Difference"))," "),t.xp6(3),t.Q6J("ngClass",t.WLB(33,H,t.xi3(12,19,o.filterSales(e.Difference,"Month",e.Month),"Percentage")>0,t.xi3(13,22,o.filterSales(e.Difference,"Month",e.Month),"Percentage")<0)),t.xp6(3),t.hij(" ",t.lcZ(15,25,t.xi3(16,27,o.filterSales(e.Difference,"Month",e.Month),"Percentage"))," ")}}function kr(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.ALo(4,"GetChildrenArray"),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,o.filterSales(t.xi3(4,6,o.data.Data,"Sales"),"Year",e),"Sales"))," ")}}const Er=function(n,i){return{"text-success":n,"text-danger":i}};function Hr(n,i){if(1&n&&(t.TgZ(0,"div",23),t.TgZ(1,"table",24),t.TgZ(2,"thead",25),t.TgZ(3,"tr"),t.TgZ(4,"th",26),t._uU(5,"Month"),t.qZA(),t.YNc(6,Qr,2,1,"th",27),t.TgZ(7,"th",28),t._uU(8,"Differences (IDR)"),t.qZA(),t.TgZ(9,"th",28),t._uU(10,"Percentage (%)"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"tbody"),t.YNc(12,Rr,17,36,"tr",29),t.qZA(),t.TgZ(13,"tfoot",30),t.TgZ(14,"tr"),t.TgZ(15,"td",31),t._uU(16,"Total :"),t.qZA(),t.YNc(17,kr,5,9,"td",32),t.TgZ(18,"td",33),t._uU(19),t.ALo(20,"number"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(6),t.Q6J("ngForOf",e.data.HeaderList),t.xp6(6),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Q6J("ngForOf",e.data.HeaderList),t.xp6(1),t.Q6J("ngClass",t.WLB(7,Er,e.data.TotalDiff>0,e.data.TotalDiff<0)),t.xp6(1),t.hij(" ",t.lcZ(20,5,e.data.TotalDiff),"")}}const Vr=function(){return["/menu/Reports/Sales_Report/Standard/Monthly"]},Br=function(){return["/menu/Reports/Sales_Report/Standard/Daily"]};let V=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/YearlySalesList","ReportLoader/YearlyReportSales"),this.httpService=e,this.csvConverter=o,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0)}filterSales(e,o,a){return e.filter(function(r){return r[o]==a})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-yearly"]],features:[t.qOj],decls:16,vars:9,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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,"ngModel","items","ngModelChange"],[1,"row"],[1,"col-6"],["placeholder","Year",3,"ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a Types",3,"ngModel","items","ngModelChange"],[3,"title"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","30px"],["style","width: 20px","class"," text-right",4,"ngFor","ngForOf"],[1,"text-right",2,"width","30px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"font-weight-bold","text-success"],["class","text-right text-success",4,"ngFor","ngForOf"],[1,"text-right",3,"ngClass"],[1,"text-right",2,"width","20px"],[1,"border-bottom"],["style","width: 20px","class","text-right",4,"ngFor","ngForOf"],[1,"text-right",2,"width","30px",3,"ngClass"],[1,"text-right","text-success"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Nr,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"View Monthly"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10," View Daily"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",8),t.YNc(13,Lr,26,13,"div",9),t.qZA(),t.qZA(),t.TgZ(14,"content"),t.YNc(15,Hr,21,10,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasExportRole),t.xp6(2),t.Q6J("routerLink",t.DdM(7,Vr)),t.xp6(5),t.Q6J("routerLink",t.DdM(8,Br)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,s.sg,s.mk],pipes:[s.JJ,T.mr,T.qU,T.J1],styles:[""]}),n})();function Gr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",15),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/DailySalesExport","Daily_Sales_Report.csv")}),t._UZ(1,"i",16),t._uU(2,"Export"),t.qZA()}}function jr(n,i){if(1&n&&(t.TgZ(0,"span",23),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Wr(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",17),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",19),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,jr,2,2,"ng-template",20),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Sales Name"),t.qZA(),t.TgZ(13,"ng-select",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Month"),t.qZA(),t.TgZ(17,"ng-select",22),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Month=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months)}}function $r(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",24),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Year"),t.qZA(),t.TgZ(4,"ng-select",25),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Delivery"),t.qZA(),t.TgZ(8,"ng-select",26),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.DeliveryID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Currency"),t.qZA(),t.TgZ(12,"ng-select",27),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(13,"div"),t.TgZ(14,"h6"),t._uU(15,"Type"),t.qZA(),t.TgZ(16,"ng-select",28),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.DeliveryID)("items",null==e.pageData.Options?null:e.pageData.Options.Deliveries),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types)}}function Kr(n,i){1&n&&(t.TgZ(0,"th",48),t._uU(1," Tax "),t.qZA())}function Xr(n,i){1&n&&(t.TgZ(0,"th",49),t._uU(1,"Net Sales + Tax"),t.qZA())}function zr(n,i){1&n&&(t.TgZ(0,"th",50),t._uU(1,"Cost"),t.qZA())}function ti(n,i){1&n&&(t.TgZ(0,"th",51),t._uU(1," Profit "),t.qZA())}function ei(n,i){1&n&&(t.TgZ(0,"th",52),t._uU(1," Profit + Tax Include "),t.qZA())}function ni(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Tax))}}function ai(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",t.lcZ(2,1,e.SalesNetWithTax)," ")}}function oi(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.Cost),"")}}function ri(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.Profit),"")}}function ii(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.ProfitWithTax),"")}}const B=function(n){return{"is-weekend":n}};function li(n,i){if(1&n&&(t.TgZ(0,"tr",53),t.TgZ(1,"td",53),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.ALo(6,"date"),t.qZA(),t.TgZ(7,"td",45),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"td",45),t._uU(11),t.ALo(12,"number"),t.qZA(),t.TgZ(13,"td",45),t._uU(14),t.ALo(15,"number"),t.qZA(),t.TgZ(16,"td",45),t._uU(17),t.ALo(18,"number"),t.qZA(),t.YNc(19,ni,3,3,"td",46),t.YNc(20,ai,3,3,"td",46),t.YNc(21,oi,3,3,"td",47),t.YNc(22,ri,3,3,"td",46),t.YNc(23,ii,3,3,"td",46),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.Q6J("ngClass",t.VKq(27,B,o.data.DayOfWeekend)),t.xp6(1),t.Q6J("ngClass",t.VKq(29,B,e.DayOfWeekend)),t.xp6(1),t.hij(" ",t.xi3(3,13,e.Day,"EEEE")," "),t.xp6(3),t.Oqu(t.xi3(6,16,e.Day,"dd")),t.xp6(3),t.Oqu(t.lcZ(9,19,e.Count)),t.xp6(3),t.Oqu(t.lcZ(12,21,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(15,23,e.Gross)),t.xp6(3),t.Oqu(t.lcZ(18,25,e.SalesNet)),t.xp6(2),t.Q6J("ngIf",o.data.ShowTax),t.xp6(1),t.Q6J("ngIf",o.data.ShowTax),t.xp6(1),t.Q6J("ngIf",o.pageData.Role.HasCostRole),t.xp6(1),t.Q6J("ngIf",o.pageData.Role.IgnoreTax&&o.pageData.Role.HasProfitRole&&o.pageData.Role.HasCostRole),t.xp6(1),t.Q6J("ngIf",!o.pageData.Role.IgnoreTax&&o.pageData.Role.HasProfitRole&&o.pageData.Role.HasCostRole)}}function si(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Tax")),"")}}function pi(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"SalesNetWithTax")),"")}}function ci(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Cost")),"")}}function _i(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Profit")),"")}}function ui(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"ProfitWithTax")),"")}}function gi(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",29),t.TgZ(1,"table",30),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",31),t.TgZ(3,"tr"),t.TgZ(4,"th",32),t._uU(5,"Day"),t.qZA(),t.TgZ(6,"th",33),t._uU(7,"Dt."),t.qZA(),t.TgZ(8,"th",34),t._uU(9,"Trans"),t.qZA(),t.TgZ(10,"th",35),t._uU(11,"Quantity"),t.qZA(),t.TgZ(12,"th",36),t._uU(13,"Gross"),t.qZA(),t.TgZ(14,"th",37),t._uU(15,"Net Sales"),t.qZA(),t.YNc(16,Kr,2,0,"th",38),t.YNc(17,Xr,2,0,"th",39),t.YNc(18,zr,2,0,"th",40),t.YNc(19,ti,2,0,"th",41),t.YNc(20,ei,2,0,"th",42),t.qZA(),t.qZA(),t.TgZ(21,"tbody"),t.YNc(22,li,24,31,"tr",43),t.qZA(),t.TgZ(23,"tfoot"),t.TgZ(24,"tr"),t._UZ(25,"td",44),t._UZ(26,"td",44),t.TgZ(27,"td",45),t._uU(28),t.ALo(29,"number"),t.ALo(30,"sum"),t.qZA(),t.TgZ(31,"td",45),t._uU(32),t.ALo(33,"number"),t.ALo(34,"sum"),t.qZA(),t.TgZ(35,"td",45),t._uU(36),t.ALo(37,"number"),t.ALo(38,"sum"),t.qZA(),t.TgZ(39,"td",45),t._uU(40),t.ALo(41,"number"),t.ALo(42,"sum"),t.qZA(),t.YNc(43,si,4,6,"td",46),t.YNc(44,pi,4,6,"td",46),t.YNc(45,ci,4,6,"td",47),t.YNc(46,_i,4,6,"td",47),t.YNc(47,ui,4,6,"td",46),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(16),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.pageData.Role.HasCostRole),t.xp6(1),t.Q6J("ngIf",e.pageData.Role.IgnoreTax&&e.pageData.Role.HasProfitRole&&e.pageData.Role.HasCostRole),t.xp6(1),t.Q6J("ngIf",!e.pageData.Role.IgnoreTax&&e.pageData.Role.HasProfitRole&&e.pageData.Role.HasCostRole),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(6),t.Oqu(t.lcZ(29,15,t.xi3(30,17,e.data.Data,"Count"))),t.xp6(4),t.Oqu(t.lcZ(33,20,t.xi3(34,22,e.data.Data,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(37,25,t.xi3(38,27,e.data.Data,"Gross"))),t.xp6(4),t.Oqu(t.lcZ(41,30,t.xi3(42,32,e.data.Data,"SalesNet"))),t.xp6(3),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.pageData.Role.HasCostRole),t.xp6(1),t.Q6J("ngIf",e.pageData.Role.IgnoreTax&&e.pageData.Role.HasProfitRole&&e.pageData.Role.HasCostRole),t.xp6(1),t.Q6J("ngIf",!e.pageData.Role.IgnoreTax&&e.pageData.Role.HasProfitRole&&e.pageData.Role.HasCostRole)}}const di=function(){return["/menu/Reports/Sales_Report/Standard/Daily"]},mi=function(n,i){return{Month:n,Year:i}},Zi=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Yearly"]};let hi=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/DailySalesList","ReportLoader/DailyReportSales",null,a),this.httpService=e,this.csvConverter=o,this.activatedRoute=a,this.Months=x.gT.Months,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.hideMore=!0}postInit(){this.menuData.H=this.data.PageTitle}sortData(e){const o=this.pageData.Data.slice();this.pageData.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Day":case"Date":return this.compare(a.Day,r.Day,l);case"Count":return this.compare(a.Count,r.Count,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Gross":return this.compare(a.Gross,r.Gross,l);case"SalesNet":return this.compare(a.SalesNet,r.SalesNet,l);case"Tax":return this.compare(a.Tax,r.Tax,l);case"SalesNetWithTax":return this.compare(a.SalesNetWithTax,r.SalesNetWithTax,l);case"Cost":return this.compare(a.Cost,r.Cost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);case"ProfitWithTax":return this.compare(a.ProfitWithTax,r.ProfitWithTax,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-daily"]],features:[t.qOj],decls:21,vars:14,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],["title","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink","queryParams"],[1,"fas","fa-chart-bar"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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 Sales",3,"ngModel","items","ngModelChange"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange"],[3,"title"],["id","more-filter","container","",1,"ml-6"],["placeholder","Year",3,"ngModel","items","ngModelChange"],["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-right",2,"width","42px"],["mat-sort-header","Count",1,"align-right",2,"width","70px"],["mat-sort-header","Quantity",1,"align-right",2,"width","100px"],["mat-sort-header","Gross",1,"align-right",2,"width","120px"],["mat-sort-header","SalesNet",1,"align-right",2,"width","120px"],["style","width: 120px","class"," align-right","mat-sort-header","Tax",4,"ngIf"],["style","width: 120px","class"," align-right","mat-sort-header","SalesNetWithTax",4,"ngIf"],["style","width: 120px","class"," align-right","mat-sort-header","Cost",4,"ngIf"],["style","width: 120px","class"," align-right","mat-sort-header","Profit",4,"ngIf"],["style","width: 160px","class"," align-right","mat-sort-header","ProfitWithTax",4,"ngIf"],[3,"ngClass",4,"ngFor","ngForOf"],[1,"empty-column"],[1,"text-right"],["class","text-right",4,"ngIf"],["class","text-right text-danger",4,"ngIf"],["mat-sort-header","Tax",1,"align-right",2,"width","120px"],["mat-sort-header","SalesNetWithTax",1,"align-right",2,"width","120px"],["mat-sort-header","Cost",1,"align-right",2,"width","120px"],["mat-sort-header","Profit",1,"align-right",2,"width","120px"],["mat-sort-header","ProfitWithTax",1,"align-right",2,"width","160px"],[3,"ngClass"],[1,"text-right","text-danger"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Gr,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._UZ(5,"i",4),t._uU(6," Chart View"),t.qZA(),t._UZ(7,"button",5),t.TgZ(8,"ul",6),t.TgZ(9,"li",7),t.TgZ(10,"a",8),t._uU(11,"Comparable PerYear"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(12,"filters"),t.TgZ(13,"div",9),t.YNc(14,Wr,18,8,"div",10),t.YNc(15,$r,17,8,"div",11),t.qZA(),t.TgZ(16,"a",12),t.NdJ("click",function(){return o.hideMore=!o.hideMore}),t._uU(17,"More "),t._UZ(18,"i",13),t.qZA(),t.qZA(),t.TgZ(19,"content"),t.YNc(20,gi,48,35,"div",14),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",null==o.pageData.Role?null:o.pageData.Role.HasExportRole),t.xp6(2),t.Q6J("routerLink",t.DdM(9,di))("queryParams",t.WLB(10,mi,null==o.pageData.Filter?null:o.pageData.Filter.Month,null==o.pageData.Filter?null:o.pageData.Filter.Year)),t.xp6(6),t.Q6J("routerLink",t.DdM(13,Zi)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!o.hideMore),t.xp6(5),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,Z.YE,Z.nU,s.sg,s.mk],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function xi(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",12),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/MonthlySalesList",a.data.PageTitle+".csv")}),t._UZ(1,"i",13),t._uU(2,"Export"),t.qZA()}}function Ti(n,i){if(1&n&&(t.TgZ(0,"span",23),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Ci(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",14),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",16),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Ti,2,2,"ng-template",17),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Sales Name"),t.qZA(),t.TgZ(13,"ng-select",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Year"),t.qZA(),t.TgZ(17,"ng-select",19),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Currency"),t.qZA(),t.TgZ(21,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(22,"div"),t.TgZ(23,"h6"),t._uU(24,"Type"),t.qZA(),t.TgZ(25,"ng-select",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(26,"div"),t.TgZ(27,"h6"),t._uU(28,"Multiply Unit Qty"),t.qZA(),t.TgZ(29,"radio-options",22),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.MultiplyUnitQuantity=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(4),t.Q6J("model",e.pageData.Filter.MultiplyUnitQuantity)}}function fi(n,i){1&n&&(t.TgZ(0,"th",29),t._uU(1,"Tax"),t.qZA())}function Ai(n,i){1&n&&(t.TgZ(0,"th",29),t._uU(1,"Sales + Tax"),t.qZA())}function qi(n,i){1&n&&(t.TgZ(0,"th",29),t._uU(1,"Cost"),t.qZA())}function Di(n,i){1&n&&(t.TgZ(0,"th",29),t._uU(1,"Profit"),t.qZA())}function yi(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.ALo(3,"RoundUp"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,t.lcZ(3,4,e.Tax),".0-0"))}}function vi(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.ALo(3,"RoundUp"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,t.lcZ(3,4,e.SalesNetWithTax),".0-0"))}}function Si(n,i){if(1&n&&(t.TgZ(0,"td",39),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",t.xi3(2,1,e.Cost,".0-0")," ")}}function Mi(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",t.xi3(2,1,e.Profit,".0-0")," ")}}function bi(n,i){if(1&n&&(t.TgZ(0,"tr",37),t.TgZ(1,"td"),t._uU(2),t.ALo(3,"Month"),t.qZA(),t.TgZ(4,"td",33),t._uU(5),t.ALo(6,"number"),t.qZA(),t.TgZ(7,"td",33),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"td",33),t._uU(11),t.ALo(12,"number"),t.qZA(),t.TgZ(13,"td",33),t._uU(14),t.ALo(15,"number"),t.qZA(),t.YNc(16,yi,4,6,"td",34),t.YNc(17,vi,4,6,"td",34),t.YNc(18,Si,3,4,"td",35),t.YNc(19,Mi,3,4,"td",36),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(t.lcZ(3,9,e.Month)),t.xp6(3),t.Oqu(t.xi3(6,11,e.Count,".0-0")),t.xp6(3),t.Oqu(t.xi3(9,14,e.Quantity,".0-0")),t.xp6(3),t.Oqu(t.xi3(12,17,e.Gross,".0-0")),t.xp6(3),t.Oqu(t.xi3(15,20,e.SalesNet,".0-0")),t.xp6(2),t.Q6J("ngIf",o.data.ShowTax),t.xp6(1),t.Q6J("ngIf",o.data.ShowTax),t.xp6(1),t.Q6J("ngIf",o.pageData.HasCostAndProfitRole),t.xp6(1),t.Q6J("ngIf",o.pageData.HasCostAndProfitRole)}}function Ji(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.ALo(3,"RoundUp"),t.ALo(4,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.lcZ(3,4,t.xi3(4,6,e.data.Data,"Tax")),".0-0"),"")}}function Oi(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.ALo(3,"RoundUp"),t.ALo(4,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.lcZ(3,4,t.xi3(4,6,e.data.Data,"SalesNetWithTax")),".0-0"),"")}}function Ii(n,i){if(1&n&&(t.TgZ(0,"td",39),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Cost"),".0-0"),"")}}function Ui(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Profit"),".0-0"),"")}}function Fi(n,i){if(1&n&&(t.TgZ(0,"div",24),t.TgZ(1,"table",25),t.TgZ(2,"thead",26),t.TgZ(3,"tr"),t.TgZ(4,"th",27),t._uU(5,"Month"),t.qZA(),t.TgZ(6,"th",28),t._uU(7,"Trans"),t.qZA(),t.TgZ(8,"th",29),t._uU(9,"Quantity"),t.qZA(),t.TgZ(10,"th",29),t._uU(11,"Gross"),t.qZA(),t.TgZ(12,"th",29),t._uU(13,"Net Sales"),t.qZA(),t.YNc(14,fi,2,0,"th",30),t.YNc(15,Ai,2,0,"th",30),t.YNc(16,qi,2,0,"th",30),t.YNc(17,Di,2,0,"th",30),t.qZA(),t.qZA(),t.TgZ(18,"tbody"),t.YNc(19,bi,20,23,"tr",31),t.qZA(),t.TgZ(20,"tfoot"),t.TgZ(21,"tr",32),t._UZ(22,"td"),t.TgZ(23,"td",33),t._uU(24),t.ALo(25,"number"),t.ALo(26,"sum"),t.qZA(),t.TgZ(27,"td",33),t._uU(28),t.ALo(29,"number"),t.ALo(30,"sum"),t.qZA(),t.TgZ(31,"td",33),t._uU(32),t.ALo(33,"number"),t.ALo(34,"sum"),t.qZA(),t.TgZ(35,"td",33),t._uU(36),t.ALo(37,"number"),t.ALo(38,"sum"),t.qZA(),t.YNc(39,Ji,5,9,"td",34),t.YNc(40,Oi,5,9,"td",34),t.YNc(41,Ii,4,7,"td",35),t.YNc(42,Ui,4,7,"td",36),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(14),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.pageData.HasCostAndProfitRole),t.xp6(1),t.Q6J("ngIf",e.pageData.HasCostAndProfitRole),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Oqu(t.xi3(25,13,t.xi3(26,16,e.data.Data,"Count"),".0-0")),t.xp6(4),t.Oqu(t.xi3(29,19,t.xi3(30,22,e.data.Data,"Quantity"),".0-0")),t.xp6(4),t.Oqu(t.xi3(33,25,t.xi3(34,28,e.data.Data,"Gross"),".0-0")),t.xp6(4),t.Oqu(t.xi3(37,31,t.xi3(38,34,e.data.Data,"Sales"),".0-0")),t.xp6(3),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.data.ShowTax),t.xp6(1),t.Q6J("ngIf",e.pageData.HasCostAndProfitRole),t.xp6(1),t.Q6J("ngIf",e.pageData.HasCostAndProfitRole)}}const wi=function(){return["/menu/Reports/Sales_Report/Standard/Monthly"]},Ni=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Yearly"]};let Pi=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/MonthlySalesList","ReportLoader/MonthlyReportSales"),this.httpService=e,this.csvConverter=o,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0)}postInit(){this.menuData.H=this.data.PageTitle}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-monthly"]],features:[t.qOj],decls:17,vars:9,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],["title","Chart View",1,"btn","btn-outline-secondary","pointer",3,"routerLink"],[1,"fas","fa-chart-bar"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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 Sales",3,"ngModel","items","ngModelChange"],["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"],[3,"title"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","90px"],[1,"text-right",2,"width","70px"],[1,"text-right",2,"width","120px"],["style","width: 120px","class"," text-right",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right","text-success"],["class","text-right",4,"ngIf"],["class","text-right text-danger",4,"ngIf"],["class","text-right text-success",4,"ngIf"],[1,"border-bottom"],[1,"text-right"],[1,"text-right","text-danger"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,xi,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._UZ(5,"i",4),t._uU(6," Chart View"),t.qZA(),t._UZ(7,"button",5),t.TgZ(8,"ul",6),t.TgZ(9,"li",7),t.TgZ(10,"a",8),t._uU(11,"View Yearly"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(12,"filters"),t.TgZ(13,"div",9),t.YNc(14,Ci,30,13,"div",10),t.qZA(),t.qZA(),t.TgZ(15,"content"),t.YNc(16,Fi,43,37,"div",11),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(2),t.Q6J("ngIf",o.pageData.HasExportRole),t.xp6(2),t.Q6J("routerLink",t.DdM(7,wi)),t.xp6(6),t.Q6J("routerLink",t.DdM(8,Ni)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,q.P,s.sg],pipes:[s.JJ,T.qU,T.mr,T.Fo],styles:[""]}),n})();function Li(n,i){if(1&n&&(t.TgZ(0,"span",13),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Qi(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Li,2,2,"ng-template",9),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Currency"),t.qZA(),t.TgZ(13,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().currency=a})("change",function(){return t.CHM(e),t.oxw().checkFilterCurrency()}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Month"),t.qZA(),t.TgZ(17,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Month=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Year"),t.qZA(),t.TgZ(21,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.currency)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years)}}function Yi(n,i){if(1&n&&(t.TgZ(0,"div",14),t._UZ(1,"POS-line-chart",15),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("config",e.chartConfig)("data",e.ChartData)}}const Ri=function(){return["/menu/Reports/Sales_Report/Standard/Daily"]},Ei=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity/Monthly"]};let Hi=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/DailySalesVolume","ReportLoader/DailyReportSales"),this.httpService=e,this.csvConverter=o,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.currency=-1,this.Months=x.gT.Months,this.ChartData={}}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(){this.ChartData={series:this.data.Series};const e=new Date(this.data.From),o=e.getMonth(),a=e.getFullYear();let r=Date.UTC(a,o,1);this.chartConfig={chart:{type:"area"},title:{text:""},credits:{enabled:!1},yAxis:{title:""},xAxis:{type:"datetime"},plotOptions:{series:{pointStart:r,pointInterval:864e5}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-sales-volume"]],features:[t.qOj],decls:11,vars:8,consts:[[3,"pageData","hideSearchBox","onSubmit"],[1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],["title","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,"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"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange"],["placeholder","Year",3,"ngModel","items","ngModelChange"],[3,"title"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t._uU(3,"Daily Sales"),t.qZA(),t.TgZ(4,"a",2),t._uU(5,"View Monthly"),t.qZA(),t.qZA(),t.TgZ(6,"filters"),t.TgZ(7,"div",3),t.YNc(8,Qi,22,10,"div",4),t.qZA(),t.qZA(),t.TgZ(9,"content"),t.YNc(10,Yi,2,2,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(6,Ri)),t.xp6(2),t.Q6J("routerLink",t.DdM(7,Ei)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,J.D],styles:[""]}),n})();function Vi(n,i){if(1&n&&(t.TgZ(0,"span",11),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Bi(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",5),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Vi,2,2,"ng-template",8),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Year"),t.qZA(),t.TgZ(13,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Currency"),t.qZA(),t.TgZ(17,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().currency=a})("change",function(){return t.CHM(e),t.oxw().checkFilterCurrency()}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.currency)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies)}}function Gi(n,i){if(1&n&&(t.TgZ(0,"div",12),t._UZ(1,"POS-line-chart",13),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("config",e.chartConfig)("data",e.ChartData)}}const Wi=function(){return["/menu/Reports/Sales_Report/Standard/Daily/Daily_Quantity"]};let $i=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/MonthtlySalesVolume","ReportLoader/MonthlySalesPerformance"),this.httpService=e,this.csvConverter=o,this.currency=-1,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.ChartData={}}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 e=[];this.data.MonthlySalesRank.forEach(o=>{const a=o.Sales.map(l=>parseInt(l));e.push({name:o.Name,data:a})}),this.ChartData={series:e},this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}}}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-monthly-volume"]],features:[t.qOj],decls:9,vars:6,consts:[[3,"pageData","hideSearchBox","onSubmit"],["title","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"],[3,"title"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t._uU(3,"View Daily"),t.qZA(),t.qZA(),t.TgZ(4,"filters"),t.TgZ(5,"div",2),t.YNc(6,Bi,18,8,"div",3),t.qZA(),t.qZA(),t.TgZ(7,"content"),t.YNc(8,Gi,2,2,"div",4),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(5,Wi)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,J.D],styles:[""]}),n})();function Ki(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",12),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/OutletPerformance","Sales Transaction ["+a.pageData.Filter.From+" - "+a.pageData.Filter.To+"].csv")}),t._UZ(1,"i",13),t._uU(2,"Export"),t.qZA()}}function Xi(n,i){if(1&n&&(t.TgZ(0,"span",20),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function zi(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",21),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",22),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function tl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",23),t.TgZ(4,"div",24),t.TgZ(5,"ng-select",25),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Year=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA(),t.TgZ(6,"div",26),t.TgZ(7,"ng-select",27),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Month=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("ngModel",e.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.Month)("items",e.Months)}}function el(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",14),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Category"),t.qZA(),t.TgZ(4,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(5,Xi,2,2,"ng-template",16),t.qZA(),t.qZA(),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Type"),t.qZA(),t.TgZ(9,"ng-select",17),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Date Filter Type"),t.qZA(),t.TgZ(13,"radio-options",18),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().DateFilterType=a}),t.qZA(),t.qZA(),t.YNc(14,zi,5,2,"div",19),t.YNc(15,tl,8,4,"div",19),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(4),t.Q6J("model",e.DateFilterType)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.DateFilterType),t.xp6(1),t.Q6J("ngIf",e.DateFilterType)}}function nl(n,i){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Cost"),t.qZA())}function al(n,i){1&n&&(t.TgZ(0,"th",45),t._uU(1,"Profit"),t.qZA())}function ol(n,i){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Cost))}}const G=function(n,i){return{"text-danger":n,"text-success":i}};function rl(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",t.WLB(4,G,e.Profit<0,e.Profit>0)),t.xp6(1),t.Oqu(t.lcZ(2,2,e.Profit))}}const j=function(){return["/menu/Reports/Sales_Report/Standard/Summary"]},W=function(n,i,e){return{EntityID:n,From:i,To:e}};function il(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",41),t._uU(6),t.qZA(),t.TgZ(7,"td",41),t.TgZ(8,"a",46),t.ALo(9,"date"),t.ALo(10,"date"),t.TgZ(11,"b"),t._uU(12),t.ALo(13,"number"),t.qZA(),t.qZA(),t.qZA(),t.YNc(14,ol,3,3,"td",42),t.YNc(15,rl,3,7,"td",43),t.qZA()),2&n){const e=i.$implicit,o=i.index,a=t.oxw(3);t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Oqu(e.Outlet),t.xp6(2),t.Oqu(e.Quantity),t.xp6(2),t.Q6J("routerLink",t.DdM(16,j))("queryParams",t.kEZ(17,W,e.EntityID,t.xi3(9,8,a.pageData.Filter.From,"ddMMyyyy"),t.xi3(10,11,a.pageData.Filter.To,"ddMMyyyy"))),t.xp6(4),t.Oqu(t.lcZ(13,14,e.Sales)),t.xp6(2),t.Q6J("ngIf",a.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",a.pageData.IsProfitVisible)}}function ll(n,i){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(t.xi3(2,1,t.xi3(3,4,e.data.DataWithCategory,"Cost"),".0-0"))}}const K=function(n,i){return{"text-success":n,"text-danger":i}};function sl(n,i){if(1&n&&(t.TgZ(0,"td",47),t.ALo(1,"sum"),t.ALo(2,"sum"),t._uU(3),t.ALo(4,"number"),t.ALo(5,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(14,K,t.xi3(1,2,e.data.DataWithCategory,"Profit")>0,t.xi3(2,5,e.data.DataWithCategory,"Profit")<0)),t.xp6(3),t.Oqu(t.xi3(4,8,t.xi3(5,11,e.data.DataWithCategory,"Profit"),".0-0"))}}function pl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"table",30),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw(2).sortOutletDataWrapper(a)}),t.TgZ(1,"thead",31),t.TgZ(2,"tr",32),t.TgZ(3,"th"),t._uU(4,"No."),t.qZA(),t.TgZ(5,"th",33),t._uU(6,"Outlet"),t.qZA(),t.TgZ(7,"th",34),t._uU(8,"Quantity"),t.qZA(),t.TgZ(9,"th",35),t._uU(10,"Sales"),t.qZA(),t.YNc(11,nl,2,0,"th",36),t.YNc(12,al,2,0,"th",37),t.qZA(),t.qZA(),t.TgZ(13,"tbody"),t.YNc(14,il,16,21,"tr",38),t.qZA(),t.TgZ(15,"tfoot"),t.TgZ(16,"tr",39),t.TgZ(17,"td",40),t._uU(18),t.ALo(19,"number"),t.ALo(20,"sum"),t.qZA(),t.TgZ(21,"td",41),t._uU(22),t.ALo(23,"number"),t.ALo(24,"sum"),t.qZA(),t.YNc(25,ll,4,7,"td",42),t.YNc(26,sl,6,17,"td",43),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(11),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsProfitVisible),t.xp6(2),t.Q6J("ngForOf",e.data.DataWithCategory),t.xp6(4),t.Oqu(t.xi3(19,7,t.xi3(20,10,e.data.DataWithCategory,"Quantity"),".0-0")),t.xp6(4),t.Oqu(t.xi3(23,13,t.xi3(24,16,e.data.DataWithCategory,"Sales"),".0-0")),t.xp6(3),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsProfitVisible)}}function cl(n,i){1&n&&(t.TgZ(0,"th",44),t._uU(1,"Cost"),t.qZA())}function _l(n,i){1&n&&(t.TgZ(0,"th",45),t._uU(1,"Profit"),t.qZA())}function ul(n,i){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Cost))}}function gl(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",t.WLB(4,G,e.Profit<0,e.Profit>0)),t.xp6(1),t.Oqu(t.lcZ(2,2,e.Profit))}}function dl(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",41),t._uU(6),t.qZA(),t.TgZ(7,"td",41),t.TgZ(8,"a",46),t.ALo(9,"date"),t.ALo(10,"date"),t.TgZ(11,"b"),t._uU(12),t.ALo(13,"number"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"td",41),t._uU(15),t.ALo(16,"number"),t.qZA(),t.TgZ(17,"td",41),t._uU(18),t.ALo(19,"number"),t.qZA(),t.YNc(20,ul,3,3,"td",42),t.YNc(21,gl,3,7,"td",43),t.qZA()),2&n){const e=i.$implicit,o=i.index,a=t.oxw(3);t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Oqu(e.Outlet),t.xp6(2),t.Oqu(e.Transaction),t.xp6(2),t.Q6J("routerLink",t.DdM(22,j))("queryParams",t.kEZ(23,W,e.EntityID,t.xi3(9,10,a.pageData.Filter.From,"ddMMyyyy"),t.xi3(10,13,a.pageData.Filter.To,"ddMMyyyy"))),t.xp6(4),t.Oqu(t.lcZ(13,16,e.Sales)),t.xp6(3),t.Oqu(t.lcZ(16,18,e.Tax)),t.xp6(3),t.Oqu(t.lcZ(19,20,e.Sales+e.Tax)),t.xp6(2),t.Q6J("ngIf",a.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",a.pageData.IsProfitVisible)}}function ml(n,i){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(t.xi3(2,1,t.xi3(3,4,e.data.DataWithoutCategory,"Cost"),".0-0"))}}function Zl(n,i){if(1&n&&(t.TgZ(0,"td",47),t.ALo(1,"sum"),t.ALo(2,"sum"),t._uU(3),t.ALo(4,"number"),t.ALo(5,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(14,K,t.xi3(1,2,e.data.DataWithoutCategory,"Profit")>0,t.xi3(2,5,e.data.DataWithoutCategory,"Profit")<0)),t.xp6(3),t.Oqu(t.xi3(4,8,t.xi3(5,11,e.data.DataWithoutCategory,"Profit"),".0-0"))}}function hl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"table",30),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw(2).sortOutletDataWrapper(a)}),t.TgZ(1,"thead",31),t.TgZ(2,"tr",32),t.TgZ(3,"th"),t._uU(4,"No."),t.qZA(),t.TgZ(5,"th",33),t._uU(6,"Outlet"),t.qZA(),t.TgZ(7,"th",48),t._uU(8,"Trans"),t.qZA(),t.TgZ(9,"th",35),t._uU(10,"Sales"),t.qZA(),t.TgZ(11,"th",49),t._uU(12,"Tax"),t.qZA(),t.TgZ(13,"th",50),t._uU(14,"Sales + Tax"),t.qZA(),t.YNc(15,cl,2,0,"th",36),t.YNc(16,_l,2,0,"th",37),t.qZA(),t.qZA(),t.TgZ(17,"tbody"),t.YNc(18,dl,22,27,"tr",38),t.qZA(),t.TgZ(19,"tfoot"),t.TgZ(20,"tr",39),t.TgZ(21,"td",40),t._uU(22),t.ALo(23,"number"),t.ALo(24,"sum"),t.qZA(),t.TgZ(25,"td",41),t._uU(26),t.ALo(27,"number"),t.ALo(28,"sum"),t.qZA(),t.TgZ(29,"td",41),t._uU(30),t.ALo(31,"number"),t.ALo(32,"sum"),t.qZA(),t.TgZ(33,"td",41),t._uU(34),t.ALo(35,"number"),t.ALo(36,"sum"),t.ALo(37,"sum"),t.qZA(),t.YNc(38,ml,4,7,"td",42),t.YNc(39,Zl,6,17,"td",43),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(15),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsProfitVisible),t.xp6(2),t.Q6J("ngForOf",e.data.DataWithoutCategory),t.xp6(4),t.Oqu(t.xi3(23,9,t.xi3(24,12,e.data.DataWithoutCategory,"Transaction"),".0-0")),t.xp6(4),t.Oqu(t.xi3(27,15,t.xi3(28,18,e.data.DataWithoutCategory,"Sales"),".0-0")),t.xp6(4),t.Oqu(t.xi3(31,21,t.xi3(32,24,e.data.DataWithoutCategory,"Tax"),".0-0")),t.xp6(4),t.Oqu(t.xi3(35,27,t.xi3(36,30,e.data.DataWithoutCategory,"Tax")+t.xi3(37,33,e.data.DataWithoutCategory,"Sales"),".0-0")),t.xp6(4),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsProfitVisible)}}function xl(n,i){1&n&&(t.TgZ(0,"p"),t._uU(1,"No Data has been loaded!"),t.qZA())}function Tl(n,i){if(1&n&&(t.TgZ(0,"div",28),t.YNc(1,pl,27,19,"table",29),t.YNc(2,hl,40,36,"table",29),t.YNc(3,xl,2,0,"p",19),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(null==e.data?null:e.data.DataWithCategory.length)>0),t.xp6(1),t.Q6J("ngIf",(null==e.data?null:e.data.DataWithoutCategory.length)>0),t.xp6(1),t.Q6J("ngIf",0==(null==e.data?null:e.data.DataWithCategory.length)&&0==(null==e.data?null:e.data.DataWithoutCategory.length))}}const fl=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Detail"]},ql=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Monthly_Perfomance"]},yl=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"]},Sl=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"]};let Ml=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/OutletPerformance","ReportLoader/OutletPerformance",null,a),this.httpService=e,this.csvConverter=o,this.activatedRoute=a,this.hideMore=!0,this.DateFilterType=!1,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"}],this.Years=[],this.RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}],this.YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];const r=new Date;this.Year=r.getFullYear(),this.Month=r.getMonth(),this.Years=x.gT.GenerateYears(r.getFullYear(),11,!0)}preInitList(){this.pageData.Filter.CategoryID=null}YearMonthToDateRange(){const e=new Date;null==this.Year&&(this.Year=e.getFullYear()),null==this.Month&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}sortOutletDataWrapper(e){let o,a;if(this.data.DataWithCategory.length>0)o=this.data.DataWithCategory,a=!0;else{if(!(this.data.DataWithoutCategory.length>0))return;o=this.data.DataWithoutCategory,a=!1}this.sortOutletData(o,e,a)}sortOutletData(e,o,a){function r(l,_,A){return(l<_?-1:1)*(A?1:-1)}o.active&&""!==o.direction&&null!=e&&(e=e.sort((l,_)=>{const A="asc"===o.direction;switch(o.active){case"Outlet":return r(l.Outlet,_.Outlet,A);case"Transaction":return r(l.Transaction,_.Transaction,A);case"Quantity":return r(l.Quantity,_.Quantity,A);case"Sales":return r(l.SalesNet,_.SalesNet,A);case"SalesTax":return r(l.SalesNet+l.Tax,_.SalesNet+l.Tax,A);case"Tax":return r(l.Tax,_.Tax,A);case"Cost":return r(l.Cost,_.Cost,A);case"Profit":return r(l.Profit,_.Profit,A);default:return 0}}),a?this.data.DataWithCategory=e:a||(this.data.DataWithoutCategory=e))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-outlet-performance"]],features:[t.qOj],decls:22,vars:13,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],["title","Outlet Performance Detail",1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],["title","Chart View",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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"],[3,"title"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","pl-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],[1,"container-fluid","mt-5"],["class","table","id","tableGrid","matSort","",3,"matSortChange",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",1,"align-right"],["mat-sort-header","Sales",1,"align-right"],["class","align-right","mat-sort-header","Cost",4,"ngIf"],["class","align-right","mat-sort-header","Profit",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],["colspan","3",1,"text-right"],[1,"text-right"],["class","text-right",4,"ngIf"],["class","text-right",3,"ngClass",4,"ngIf"],["mat-sort-header","Cost",1,"align-right"],["mat-sort-header","Profit",1,"align-right"],[3,"routerLink","queryParams"],[1,"text-right",3,"ngClass"],["mat-sort-header","Transaction",1,"align-right"],["mat-sort-header","Tax",1,"align-right"],["mat-sort-header","SalesTax",1,"align-right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Ki,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"View Detail"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10," By Month"),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t._uU(13,"By Entity Group"),t.qZA(),t.qZA(),t.TgZ(14,"li",6),t.TgZ(15,"a",8),t._uU(16," Chart View"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(17,"filters"),t.TgZ(18,"div",9),t.YNc(19,el,16,8,"div",10),t.qZA(),t.qZA(),t.TgZ(20,"content"),t.YNc(21,Tl,4,3,"div",11),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(9,fl)),t.xp6(5),t.Q6J("routerLink",t.DdM(10,ql)),t.xp6(3),t.Q6J("routerLink",t.DdM(11,yl)),t.xp6(3),t.Q6J("routerLink",t.DdM(12,Sl)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,q.P,C.QB,Z.YE,Z.nU,s.sg,s.mk],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function bl(n,i){if(1&n&&(t.TgZ(0,"span",11),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Jl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",12),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",13),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Ol(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",14),t.TgZ(4,"div",15),t.TgZ(5,"ng-select",16),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Year=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA(),t.TgZ(6,"div",17),t.TgZ(7,"ng-select",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Month=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("ngModel",e.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.Month)("items",e.Months)}}function Il(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",5),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Category"),t.qZA(),t.TgZ(4,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(5,bl,2,2,"ng-template",7),t.qZA(),t.qZA(),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Type"),t.qZA(),t.TgZ(9,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Date Filter"),t.qZA(),t.TgZ(13,"radio-options",9),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().DateFilterType=a})("modelChange",function(){return t.CHM(e),t.oxw().YearMonthToDateRange()}),t.qZA(),t.qZA(),t.YNc(14,Jl,5,2,"div",10),t.YNc(15,Ol,8,4,"div",10),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(4),t.Q6J("model",e.DateFilterType)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.DateFilterType),t.xp6(1),t.Q6J("ngIf",e.DateFilterType)}}function Ul(n,i){if(1&n&&(t.TgZ(0,"div",19),t._UZ(1,"POS-pie-chart",20),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("config",e.pieConfig)("data",e.PieData)}}const wl=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance"]};let Nl=(()=>{class n extends m.n{constructor(e){super(e,"Report/OutletPerformance","ReportLoader/OutletPerformance"),this.httpService=e,this.DateFilterType=!0,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"}],this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.PieData={},this.RadioDateFilterType=[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}],this.pieConfig={title:"",dataLabels:!0,labelTooltips:"Sales",height:400,legend:{}};const o=new Date;this.Year=o.getFullYear(),this.Month=o.getMonth()}postInit(){this.getPieData()}getPieData(){const e=[],o=[];this.data.DataWithoutCategory.length>0&&this.data.DataWithoutCategory.forEach(a=>{e.push(a.Outlet),o.push({name:a.Outlet,y:a.Sales})}),this.data.DataWithCategory.length>0&&this.data.DataWithCategory.forEach(a=>{e.push(a.Outlet),o.push({name:a.Outlet,y:a.Sales})}),this.PieData=o}YearMonthToDateRange(){if(this.DateFilterType){const e=new Date;null==this.Year&&(this.Year=e.getFullYear()),null==this.Month&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-outlet-graphic"]],features:[t.qOj],decls:9,vars:6,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Table View",1,"btn","btn-outline-secondary",3,"routerLink"],[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","Date Filter",3,"model","options","modelChange"],[4,"ngIf"],[3,"title"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","pl-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],[1,"container-fluid","mt-5"],[3,"config","data"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t._uU(3,"Table View"),t.qZA(),t.qZA(),t.TgZ(4,"filters"),t.TgZ(5,"div",2),t.YNc(6,Il,16,8,"div",3),t.qZA(),t.qZA(),t.TgZ(7,"content"),t.YNc(8,Ul,2,2,"div",4),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(5,wl)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,q.P,C.QB,U.J],styles:[""]}),n})();function Pl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",15),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/OutletPerformanceDetail","Sales Transaction ["+a.pageData.Filter.From+" - "+a.pageData.Filter.To+"].csv")}),t._UZ(1,"i",16),t._uU(2,"Export"),t.qZA()}}function Ll(n,i){if(1&n&&(t.TgZ(0,"span",23),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Ql(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",24),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",25),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Yl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Compare with prev Month"),t.qZA(),t.TgZ(3,"radio-options",26),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).isCompareData=a})("modelChange",function(){return t.CHM(e),t.oxw(2).OnCompare("Data")}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("model",e.isCompareData)}}function Rl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",27),t.TgZ(4,"div",28),t.TgZ(5,"ng-select",29),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Year=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA(),t.TgZ(6,"div",30),t.TgZ(7,"ng-select",31),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Month=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("ngModel",e.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.Month)("items",e.Months)}}function kl(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",17),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Category"),t.qZA(),t.TgZ(4,"ng-select",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(5,Ll,2,2,"ng-template",19),t.qZA(),t.qZA(),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Type"),t.qZA(),t.TgZ(9,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Date Filter Type"),t.qZA(),t.TgZ(13,"radio-options",21),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().DateFilterType=a}),t.qZA(),t.qZA(),t.YNc(14,Ql,5,2,"div",22),t.YNc(15,Yl,4,1,"div",22),t.YNc(16,Rl,8,4,"div",22),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(4),t.Q6J("model",e.DateFilterType)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.DateFilterType),t.xp6(1),t.Q6J("ngIf",e.DateFilterType),t.xp6(1),t.Q6J("ngIf",e.DateFilterType)}}function El(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",32),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Exclude complementary"),t.qZA(),t.TgZ(4,"radio-options",26),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ExcludeComplementary=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Exclude Non Inventory"),t.qZA(),t.TgZ(8,"radio-options",26),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ExcludeInventory=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("model",e.pageData.Filter.ExcludeComplementary),t.xp6(4),t.Q6J("model",e.pageData.Filter.ExcludeInventory)}}function Hl(n,i){1&n&&(t.TgZ(0,"th",58),t._uU(1,"Prev"),t.qZA())}function Vl(n,i){1&n&&(t.TgZ(0,"th",58),t._uU(1,"Now"),t.qZA())}function Bl(n,i){1&n&&(t.TgZ(0,"th",59),t._uU(1,"Trans "),t.qZA())}function Gl(n,i){if(1&n&&(t.TgZ(0,"th",60),t._uU(1,"Tax"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet")}}function jl(n,i){if(1&n&&(t.TgZ(0,"th",60),t._uU(1," Sales + Tax"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Wl(n,i){1&n&&(t.TgZ(0,"th",53),t._uU(1,"\xb1 (%)"),t.qZA())}function $l(n,i){1&n&&(t.TgZ(0,"th",61),t._uU(1,"Cost"),t.qZA())}function Kl(n,i){if(1&n&&(t.TgZ(0,"th",60),t._uU(1," Profit"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function Xl(n,i){1&n&&(t.TgZ(0,"th",62),t._uU(1,"Expense"),t.qZA())}function zl(n,i){1&n&&(t.TgZ(0,"th",63),t._uU(1,"Net Profit"),t.qZA())}function ts(n,i){1&n&&(t.TgZ(0,"th",64),t._uU(1," Target"),t.qZA())}function es(n,i){1&n&&(t.TgZ(0,"th",65),t._uU(1," Ach(%)"),t.qZA())}function ns(n,i){if(1&n&&(t.TgZ(0,"td",68),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.PrevIndex)}}const as=function(n,i){return{rankDown:n,rankUp:i,"number key":!0}};function os(n,i){if(1&n&&(t.TgZ(0,"td",69),t._uU(1),t.qZA()),2&n){const e=t.oxw(),o=e.$implicit,a=e.index;t.Q6J("ngClass",t.WLB(2,as,o.PrevIndex<a+1,o.PrevIndex>a+1)),t.xp6(1),t.hij(" ",o.CurrentIndex," ")}}function rs(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,e.Count,"1.0-0"))}}function is(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,e.Tax,"1.0-0"))}}const ls=function(){return["/menu/Reports/Sales_Report/Standard/Summary"]},ss=function(n,i,e){return{EntityID:n,From:i,To:e}};function ps(n,i){if(1&n&&(t.TgZ(0,"td",53),t.TgZ(1,"a",70),t.ALo(2,"date"),t.ALo(3,"date"),t.TgZ(4,"b"),t._uU(5),t.ALo(6,"number"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("routerLink",t.DdM(12,ls))("queryParams",t.kEZ(13,ss,e.EntityID,t.xi3(2,3,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(3,6,o.pageData.Filter.To,"ddMMyyyy"))),t.xp6(4),t.Oqu(t.xi3(6,9,e.SalesWithTax,"1.0-0"))}}function cs(n,i){if(1&n&&(t.ynx(0),t._uU(1),t.ALo(2,"number"),t.BQk()),2&n){const e=t.oxw(2).$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.Increase,"1.0-0")," ")}}function _s(n,i){if(1&n&&t._uU(0),2&n){const e=t.oxw(2).$implicit;t.hij(" ",e.Increase," ")}}const X=function(n,i){return{"text-warning":n,"text-success":i,"text-right":!0}};function us(n,i){if(1&n&&(t.TgZ(0,"td",71),t.YNc(1,cs,3,4,"ng-container",72),t.YNc(2,_s,1,1,"ng-template",null,73,t.W1O),t.qZA()),2&n){const e=t.MAs(3),o=t.oxw().$implicit;t.Q6J("ngClass",t.WLB(3,X,o.IsNegative,o.IsPositive)),t.xp6(1),t.Q6J("ngIf","-"!==o.Increase)("ngIfElse",e)}}function gs(n,i){if(1&n&&(t.TgZ(0,"td",74),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",t.xi3(2,1,e.Cost,"1.0-0")," ")}}const O=function(n,i){return{"text-danger":n,"text-success":i}};function ds(n,i){if(1&n&&(t.TgZ(0,"span",71),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.Q6J("ngClass",t.WLB(5,O,e.Profit<0,e.Profit>0)),t.xp6(1),t.Oqu(t.xi3(2,2,e.Profit,"1.0-0"))}}function ms(n,i){if(1&n&&(t.TgZ(0,"span",71),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.Q6J("ngClass",t.WLB(5,O,e.ProfitWithTax<0,e.ProfitWithTax>0)),t.xp6(1),t.Oqu(t.xi3(2,2,e.ProfitWithTax,"1.0-0"))}}function Zs(n,i){if(1&n&&(t.TgZ(0,"td",53),t.YNc(1,ds,3,8,"span",55),t.YNc(2,ms,3,8,"span",55),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Q6J("ngIf",e.pageData.IgnoreTax),t.xp6(1),t.Q6J("ngIf",!e.pageData.IgnoreTax)}}function hs(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.Expense,"1.0-0"),"")}}function xs(n,i){if(1&n&&(t.TgZ(0,"td",75),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.NetProfit,"1.0-0"),"")}}function Ts(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.SalesTarget,"1.0-0"),"")}}function Cs(n,i){if(1&n&&(t.TgZ(0,"span",71),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.Q6J("ngClass",t.WLB(5,O,e.Achievement<0,e.Achievement>0)),t.xp6(1),t.Oqu(t.xi3(2,2,e.Achievement,"1.0-0"))}}function fs(n,i){if(1&n&&(t.TgZ(0,"span",71),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.Q6J("ngClass",t.WLB(5,O,e.AchievementWithTax<0,e.AchievementWithTax>0)),t.xp6(1),t.hij("",t.xi3(2,2,e.AchievementWithTax,"1.0-0")," ")}}function As(n,i){if(1&n&&(t.TgZ(0,"td",53),t.YNc(1,Cs,3,8,"span",55),t.YNc(2,fs,3,8,"span",55),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Q6J("ngIf",!e.pageData.IgnoreTax),t.xp6(1),t.Q6J("ngIf",e.pageData.IgnoreTax)}}function qs(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",51),t._uU(4),t.qZA(),t.YNc(5,ns,2,1,"td",66),t.YNc(6,os,2,5,"td",67),t.YNc(7,rs,3,4,"td",43),t.TgZ(8,"td",53),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",53),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td",53),t._uU(15),t.ALo(16,"number"),t.qZA(),t.YNc(17,is,3,4,"td",43),t.ALo(18,"HideSumZero"),t.YNc(19,ps,7,17,"td",43),t.YNc(20,us,4,6,"td",55),t.YNc(21,gs,3,4,"td",56),t.YNc(22,Zs,3,2,"td",43),t.YNc(23,hs,3,4,"td",43),t.ALo(24,"HideSumZero"),t.YNc(25,xs,3,4,"td",57),t.YNc(26,Ts,3,4,"td",43),t.ALo(27,"HideSumZero"),t.YNc(28,As,3,2,"td",43),t.ALo(29,"HideSumZero"),t.ALo(30,"HideSumZero"),t.qZA()),2&n){const e=i.$implicit,o=i.index,a=t.oxw(2);t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Oqu(e.Name),t.xp6(1),t.Q6J("ngIf",a.isCompareData),t.xp6(1),t.Q6J("ngIf",a.isCompareData),t.xp6(1),t.Q6J("ngIf",!e.WithCategory),t.xp6(2),t.Oqu(t.xi3(10,17,e.Quantity,"1.0-0")),t.xp6(3),t.Oqu(t.xi3(13,20,e.Gross,"1.0-0")),t.xp6(3),t.Oqu(t.xi3(16,23,e.SalesNet,"1.0-0")),t.xp6(2),t.Q6J("ngIf",!a.data.WithCategory&&t.xi3(18,26,a.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!a.data.WithCategory),t.xp6(1),t.Q6J("ngIf",a.isCompareData),t.xp6(1),t.Q6J("ngIf",a.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",a.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",a.pageData.IsExpense&&t.xi3(24,29,a.data.Data,"Expense")),t.xp6(2),t.Q6J("ngIf",a.pageData.IsExpense),t.xp6(1),t.Q6J("ngIf",t.xi3(27,32,a.data.Data,"SalesTarget")),t.xp6(2),t.Q6J("ngIf",t.xi3(29,35,a.data.Data,"AchievementWithTax")||t.xi3(30,38,a.data.Data,"Achievement"))}}function Ds(n,i){1&n&&t._UZ(0,"td",76)}function ys(n,i){1&n&&t._UZ(0,"td",76)}function vs(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Count"),"1.0-0"),"")}}function Ss(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Tax"),"1.0-0")," ")}}function Ms(n,i){if(1&n&&(t.TgZ(0,"td",77),t.TgZ(1,"a",78),t._uU(2),t.ALo(3,"number"),t.ALo(4,"sum"),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(2),t.Oqu(t.xi3(3,1,t.xi3(4,4,e.data.Data,"SalesWithTax"),"1.0-0"))}}function bs(n,i){if(1&n&&(t.TgZ(0,"td",71),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.WLB(5,X,e.comparation<0,e.comparation>0)),t.xp6(1),t.hij(" ",t.xi3(2,2,e.comparation,"1.0-0")," ")}}function Js(n,i){if(1&n&&(t.TgZ(0,"td",74),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Cost"),"1.0-0")," ")}}const z=function(n,i){return{"text-success":n,"text-danger":i}};function Os(n,i){if(1&n&&(t.TgZ(0,"span",71),t.ALo(1,"sum"),t.ALo(2,"sum"),t._uU(3),t.ALo(4,"number"),t.ALo(5,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(14,z,t.xi3(1,2,e.data.Data,"Profit")>0,t.xi3(2,5,e.data.Data,"Profit")<0)),t.xp6(3),t.Oqu(t.xi3(4,8,t.xi3(5,11,e.data.Data,"Profit"),"1.0-0"))}}function Is(n,i){if(1&n&&(t.TgZ(0,"span",71),t.ALo(1,"sum"),t.ALo(2,"sum"),t._uU(3),t.ALo(4,"number"),t.ALo(5,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(14,z,t.xi3(1,2,e.data.Data,"ProfitWithTax")>0,t.xi3(2,5,e.data.Data,"ProfitWithTax")<0)),t.xp6(3),t.hij("",t.xi3(4,8,t.xi3(5,11,e.data.Data,"ProfitWithTax"),"1.0-0")," ")}}function Us(n,i){if(1&n&&(t.TgZ(0,"td",53),t.YNc(1,Os,6,17,"span",55),t.YNc(2,Is,6,17,"span",55),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.pageData.IgnoreTax),t.xp6(1),t.Q6J("ngIf",!e.pageData.IgnoreTax)}}function Fs(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Expense"),"1.0-0"),"")}}function ws(n,i){if(1&n&&(t.TgZ(0,"td",75),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"NetProfit"),"1.0-0"),"")}}function Ns(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"SalesTarget"),"1.0-0"),"")}}function Ps(n,i){if(1&n&&(t.TgZ(0,"span",71),t.ALo(1,"sum"),t.ALo(2,"sum"),t.ALo(3,"sum"),t.ALo(4,"sum"),t._uU(5),t.ALo(6,"number"),t.ALo(7,"sum"),t.ALo(8,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(23,O,t.xi3(1,2,e.data.Data,"Sales")/t.xi3(2,5,e.data.Data,"SalesTarget")<0,t.xi3(3,8,e.data.Data,"Sales")/t.xi3(4,11,e.data.Data,"SalesTarget")>0)),t.xp6(5),t.Oqu(t.xi3(6,14,t.xi3(7,17,e.data.Data,"Sales")/t.xi3(8,20,e.data.Data,"SalesTarget"),"1.0-0"))}}function Ls(n,i){if(1&n&&(t.TgZ(0,"span",71),t.ALo(1,"sum"),t.ALo(2,"sum"),t.ALo(3,"sum"),t.ALo(4,"sum"),t._uU(5),t.ALo(6,"number"),t.ALo(7,"sum"),t.ALo(8,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(23,O,t.xi3(1,2,e.data.Data,"SalesWithTax")/t.xi3(2,5,e.data.Data,"SalesTarget")<0,t.xi3(3,8,e.data.Data,"SalesWithTax")/t.xi3(4,11,e.data.Data,"SalesTarget")>0)),t.xp6(5),t.hij("",t.xi3(6,14,t.xi3(7,17,e.data.Data,"SalesWithTax")/t.xi3(8,20,e.data.Data,"SalesTarget"),"1.0-0")," ")}}function Qs(n,i){if(1&n&&(t.TgZ(0,"td",53),t.YNc(1,Ps,9,26,"span",55),t.YNc(2,Ls,9,26,"span",55),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",!e.pageData.IgnoreTax),t.xp6(1),t.Q6J("ngIf",e.pageData.IgnoreTax)}}function Ys(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",33),t.TgZ(1,"table",34),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",35),t.TgZ(3,"tr"),t.TgZ(4,"th"),t._uU(5,"No."),t.qZA(),t.TgZ(6,"th",36),t._uU(7,"Outlet"),t.qZA(),t.YNc(8,Hl,2,0,"th",37),t.YNc(9,Vl,2,0,"th",37),t.YNc(10,Bl,2,0,"th",38),t.TgZ(11,"th",39),t._uU(12,"Qty"),t.qZA(),t.TgZ(13,"th",40),t._uU(14,"Gross"),t.qZA(),t.TgZ(15,"th",41),t._uU(16,"Sales"),t.qZA(),t.YNc(17,Gl,2,1,"th",42),t.ALo(18,"HideSumZero"),t.YNc(19,jl,2,1,"th",42),t.YNc(20,Wl,2,0,"th",43),t.YNc(21,$l,2,0,"th",44),t.YNc(22,Kl,2,1,"th",42),t.YNc(23,Xl,2,0,"th",45),t.ALo(24,"HideSumZero"),t.YNc(25,zl,2,0,"th",46),t.YNc(26,ts,2,0,"th",47),t.ALo(27,"HideSumZero"),t.YNc(28,es,2,0,"th",48),t.ALo(29,"HideSumZero"),t.ALo(30,"HideSumZero"),t.qZA(),t.qZA(),t.TgZ(31,"tbody"),t.YNc(32,qs,31,41,"tr",49),t.qZA(),t.TgZ(33,"tfoot"),t.TgZ(34,"tr",50),t._UZ(35,"td"),t._UZ(36,"td",51),t.YNc(37,Ds,1,0,"td",52),t.YNc(38,ys,1,0,"td",52),t.YNc(39,vs,4,7,"td",43),t.TgZ(40,"td",53),t._uU(41),t.ALo(42,"number"),t.ALo(43,"sum"),t.qZA(),t.TgZ(44,"td",53),t._uU(45),t.ALo(46,"number"),t.ALo(47,"sum"),t.qZA(),t.TgZ(48,"td",53),t._uU(49),t.ALo(50,"number"),t.ALo(51,"sum"),t.qZA(),t.YNc(52,Ss,4,7,"td",43),t.ALo(53,"HideSumZero"),t.YNc(54,Ms,5,7,"td",54),t.YNc(55,bs,3,8,"td",55),t.YNc(56,Js,4,7,"td",56),t.YNc(57,Us,3,2,"td",43),t.YNc(58,Fs,4,7,"td",43),t.ALo(59,"HideSumZero"),t.YNc(60,ws,4,7,"td",57),t.YNc(61,Ns,4,7,"td",43),t.ALo(62,"HideSumZero"),t.YNc(63,Qs,3,2,"td",43),t.ALo(64,"HideSumZero"),t.ALo(65,"HideSumZero"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(8),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(7),t.Q6J("ngIf",!e.data.WithCategory&&t.xi3(18,28,e.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsExpense&&t.xi3(24,31,e.data.Data,"Expense")),t.xp6(2),t.Q6J("ngIf",e.pageData.IsExpense),t.xp6(1),t.Q6J("ngIf",t.xi3(27,34,e.data.Data,"SalesTarget")),t.xp6(2),t.Q6J("ngIf",t.xi3(29,37,e.data.Data,"AchievementWithTax")||t.xi3(30,40,e.data.Data,"Achievement")),t.xp6(4),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(2),t.Oqu(t.xi3(42,43,t.xi3(43,46,e.data.Data,"Quantity"),"1.0-0")),t.xp6(4),t.Oqu(t.xi3(46,49,t.xi3(47,52,e.data.Data,"Gross"),"1.0-0")),t.xp6(4),t.hij(" ",t.xi3(50,55,t.xi3(51,58,e.data.Data,"SalesNet"),"1.0-0")," "),t.xp6(3),t.Q6J("ngIf",!e.data.WithCategory&&t.xi3(53,61,e.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsExpense&&t.xi3(59,64,e.data.Data,"Expense")),t.xp6(2),t.Q6J("ngIf",e.pageData.IsExpense),t.xp6(1),t.Q6J("ngIf",t.xi3(62,67,e.data.Data,"SalesTarget")),t.xp6(2),t.Q6J("ngIf",t.xi3(64,70,e.data.Data,"AchievementWithTax")||t.xi3(65,73,e.data.Data,"Achievement"))}}const ks=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance"]},Hs=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"]},Bs=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Monthly_Perfomance"]},js=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Graphic"]};let Ws=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/OutletPerformanceDetail","ReportLoader/OutletPerformance"),this.httpService=e,this.csvConverter=o,this.isCompareData=!1,this.hideMore=!0,this.DateFilterType=!1,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"}],this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];const a=new Date;this.Year=a.getFullYear(),this.Month=a.getMonth()}YearMonthToDateRange(){const e=new Date;null==this.Year&&(this.Year=e.getFullYear()),null==this.Month&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1).toDateString(),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0).toDateString()}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Name":return this.compare(a.Name,r.Name,l);case"Count":return this.compare(a.Count,r.Count,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Gross":return this.compare(a.Gross,r.Gross,l);case"SalesNet":case"SalesTaxNet":return this.compare(a.SalesNet,r.SalesNet,l);case"Tax":return this.compare(a.Tax,r.Tax,l);case"SalesWithTax":return this.compare(a.SalesWithTax,r.SalesWithTax,l);case"Cost":return this.compare(a.Cost,r.Cost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);case"ProfitWithTax":return this.compare(a.ProfitWithTax,r.ProfitWithTax,l);case"Expense":return this.compare(a.Expense,r.Expense,l);case"NetProfit":return this.compare(a.NetProfit,r.NetProfit,l);case"Target":case"SalesTarget":return this.compare(a.SalesTarget,r.SalesTarget,l);case"Achievement":return this.compare(a.Achievement,r.Achievement,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-detail-outlet-performance"]],features:[t.qOj],decls:26,vars:14,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],["title","Chart View",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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"],[3,"title"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["name","Compare",3,"model","modelChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","pl-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],["id","more-filter","container","",1,"ml-6"],[1,"container-fluid","mt-5"],["id","tableGrid","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","class","align-right",4,"ngIf"],["mat-sort-header","Quantity",1,"align-right"],["mat-sort-header","Gross",1,"align-right"],["mat-sort-header","SalesNet",1,"align-right"],["class","align-right",3,"mat-sort-header",4,"ngIf"],["class","text-right",4,"ngIf"],["mat-sort-header","Cost","class","align-right",4,"ngIf"],["mat-sort-header","Expense","class","align-right",4,"ngIf"],["mat-sort-header","NetProfit","class","align-right",4,"ngIf"],["mat-sort-header","Target","class","align-right",4,"ngIf"],["mat-sort-header","Achievement","class","align-right","title","Achievement",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"text-right"],["class","text-right text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-right text-danger",4,"ngIf"],["class","text-right text-success",4,"ngIf"],[2,"width","35px"],["mat-sort-header","Count",1,"align-right"],[1,"align-right",3,"mat-sort-header"],["mat-sort-header","Cost",1,"align-right"],["mat-sort-header","Expense",1,"align-right"],["mat-sort-header","NetProfit",1,"align-right"],["mat-sort-header","Target",1,"align-right"],["mat-sort-header","Achievement","title","Achievement",1,"align-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-right","text-danger"],[1,"text-right","text-success"],[1,"empty-column"],[1,"text-right","text-primary"],[1,"font-weight-bold"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Pl,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"View Summary"),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10,"By Entity Group"),t.qZA(),t.qZA(),t.TgZ(11,"li",6),t.TgZ(12,"a",7),t._uU(13," By Month"),t.qZA(),t.qZA(),t.TgZ(14,"li",6),t.TgZ(15,"a",8),t._uU(16," Chart View"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(17,"filters"),t.TgZ(18,"div",9),t.YNc(19,kl,17,9,"div",10),t.YNc(20,El,9,2,"div",11),t.qZA(),t.TgZ(21,"a",12),t.NdJ("click",function(){return o.hideMore=!o.hideMore}),t._uU(22,"More "),t._UZ(23,"i",13),t.qZA(),t.qZA(),t.TgZ(24,"content"),t.YNc(25,Ys,66,76,"div",14),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(10,ks)),t.xp6(5),t.Q6J("routerLink",t.DdM(11,Hs)),t.xp6(3),t.Q6J("routerLink",t.DdM(12,Bs)),t.xp6(3),t.Q6J("routerLink",t.DdM(13,js)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!o.hideMore),t.xp6(5),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,q.P,C.QB,Z.YE,Z.nU,s.sg,s.mk],pipes:[T.aQ,s.JJ,T.qU,s.uU],styles:[""]}),n})();function $s(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/OutletGroupPerformance","Sales Transaction ["+a.pageData.Filter.From+" - "+a.pageData.Filter.To+"].csv")}),t._UZ(1,"i",12),t._uU(2,"Export"),t.qZA()}}function Ks(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",17),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",18),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Xs(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",19),t.TgZ(4,"div",20),t.TgZ(5,"ng-select",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Year=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA(),t.TgZ(6,"div",22),t.TgZ(7,"ng-select",23),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Month=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("ngModel",e.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.Month)("items",e.Months)}}function zs(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Compare with prev Month"),t.qZA(),t.TgZ(3,"radio-options",24),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).isCompareData=a})("modelChange",function(){return t.CHM(e),t.oxw(2).OnCompare()}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("model",e.isCompareData)}}function tp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Date Filter Type"),t.qZA(),t.TgZ(4,"radio-options",14),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().DateFilterType=a}),t.qZA(),t.qZA(),t.YNc(5,Ks,5,2,"div",15),t.YNc(6,Xs,8,4,"div",15),t.TgZ(7,"div"),t.TgZ(8,"h6"),t._uU(9,"Type"),t.qZA(),t.TgZ(10,"ng-select",16),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.YNc(11,zs,4,1,"div",15),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("model",e.DateFilterType)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.DateFilterType),t.xp6(1),t.Q6J("ngIf",e.DateFilterType),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(1),t.Q6J("ngIf",e.DateFilterType)}}function ep(n,i){1&n&&(t.TgZ(0,"th",48),t._uU(1,"Prev"),t.qZA())}function np(n,i){1&n&&(t.TgZ(0,"th",48),t._uU(1,"Now"),t.qZA())}function ap(n,i){1&n&&(t.TgZ(0,"th",49),t._uU(1," \xb1 (%) "),t.qZA())}function op(n,i){1&n&&(t.TgZ(0,"th",50),t._uU(1," Cost "),t.qZA())}function rp(n,i){if(1&n&&(t.TgZ(0,"th",34),t._uU(1,"Profit "),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function ip(n,i){if(1&n&&(t.TgZ(0,"td",48),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",e.PrevIndex," ")}}const lp=function(n,i){return{rankDown:n,rankUp:i,"number key":!0}};function sp(n,i){if(1&n&&(t.TgZ(0,"td",53),t._uU(1),t.qZA()),2&n){const e=t.oxw(),o=e.$implicit,a=e.index;t.Q6J("ngClass",t.WLB(2,lp,o.PrevIndex<a+1,o.PrevIndex>a+1)),t.xp6(1),t.hij(" ",o.CurrentIndex," ")}}const tt=function(n,i){return{"text-danger":n,"text-success":i,"text-right":!0}};function pp(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",t.WLB(5,tt,e.IsNegative,e.IsPositive)),t.xp6(1),t.hij(" ",t.xi3(2,2,e.Increase,".0-0")," ")}}function cp(n,i){if(1&n&&(t.TgZ(0,"td",55),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.Cost,".0-0")," ")}}function _p(n,i){if(1&n&&(t.TgZ(0,"td",56),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,o.pageData.IgnoreTax?e.ProfitWithTax:e.Profit,".0-0")," ")}}function up(n,i){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,ip,2,1,"td",28),t.YNc(2,sp,2,5,"td",51),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",52),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",43),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",43),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td",43),t._uU(15),t.ALo(16,"number"),t.qZA(),t.TgZ(17,"td",43),t._uU(18),t.ALo(19,"number"),t.qZA(),t.TgZ(20,"td",44),t._uU(21),t.ALo(22,"number"),t.qZA(),t.YNc(23,pp,3,8,"td",45),t.YNc(24,cp,3,4,"td",46),t.YNc(25,_p,3,4,"td",47),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngIf",o.isCompareData),t.xp6(1),t.Q6J("ngIf",o.isCompareData),t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(t.xi3(7,12,e.Count,".0-0")),t.xp6(3),t.Oqu(t.xi3(10,15,e.Quantity,".0-0")),t.xp6(3),t.Oqu(t.xi3(13,18,e.Gross,".0-0")),t.xp6(3),t.Oqu(t.xi3(16,21,e.SalesNet,".0-0")),t.xp6(3),t.Oqu(t.xi3(19,24,e.Tax,".0-0")),t.xp6(3),t.Oqu(t.xi3(22,27,e.SalesWithTax,".0-0")),t.xp6(2),t.Q6J("ngIf",o.isCompareData),t.xp6(1),t.Q6J("ngIf",o.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",o.pageData.IsCostVisible)}}function gp(n,i){1&n&&t._UZ(0,"td",42)}function dp(n,i){1&n&&t._UZ(0,"td",42)}function mp(n,i){if(1&n&&(t.TgZ(0,"td",54),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.WLB(5,tt,e.comparation,e.comparation)),t.xp6(1),t.hij(" ",t.xi3(2,2,e.comparation,".0-0")," ")}}function Zp(n,i){if(1&n&&(t.TgZ(0,"td",55),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data,"Cost"),".0-0")," ")}}function hp(n,i){if(1&n&&(t.TgZ(0,"td",56),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data,"ProfitWithTax"),".0-0")," ")}}function xp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",25),t.TgZ(1,"table",26),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",27),t.TgZ(3,"tr"),t.YNc(4,ep,2,0,"th",28),t.YNc(5,np,2,0,"th",28),t.TgZ(6,"th",29),t._uU(7,"Outlet"),t.qZA(),t.TgZ(8,"th",30),t._uU(9,"Trans"),t.qZA(),t.TgZ(10,"th",31),t._uU(11,"Quantity"),t.qZA(),t.TgZ(12,"th",32),t._uU(13,"Gross"),t.qZA(),t.TgZ(14,"th",33),t._uU(15,"Sales"),t.qZA(),t.TgZ(16,"th",34),t._uU(17,"Tax"),t.qZA(),t.TgZ(18,"th",35),t._uU(19,"Sales + Tax"),t.qZA(),t.YNc(20,ap,2,0,"th",36),t.YNc(21,op,2,0,"th",37),t.YNc(22,rp,2,1,"th",38),t.qZA(),t.qZA(),t.TgZ(23,"tbody"),t.YNc(24,up,26,30,"tr",39),t.qZA(),t.TgZ(25,"tfoot"),t.TgZ(26,"tr",40),t.YNc(27,gp,1,0,"td",41),t.YNc(28,dp,1,0,"td",41),t._UZ(29,"td",42),t.TgZ(30,"td",43),t._uU(31),t.ALo(32,"number"),t.ALo(33,"sum"),t.qZA(),t.TgZ(34,"td",43),t._uU(35),t.ALo(36,"number"),t.ALo(37,"sum"),t.qZA(),t.TgZ(38,"td",43),t._uU(39),t.ALo(40,"number"),t.ALo(41,"sum"),t.qZA(),t.TgZ(42,"td",43),t._uU(43),t.ALo(44,"number"),t.ALo(45,"sum"),t.qZA(),t.TgZ(46,"td",43),t._uU(47),t.ALo(48,"number"),t.ALo(49,"sum"),t.qZA(),t.TgZ(50,"td",44),t.TgZ(51,"a"),t._uU(52),t.ALo(53,"number"),t.ALo(54,"sum"),t.qZA(),t.qZA(),t.YNc(55,mp,3,8,"td",45),t.YNc(56,Zp,4,7,"td",46),t.YNc(57,hp,4,7,"td",47),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(11),t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesTaxNet"),t.xp6(2),t.s9C("altpropcond",e.pageData.IgnoreTax),t.xp6(2),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(2),t.Q6J("ngForOf",e.data),t.xp6(3),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(3),t.Oqu(t.xi3(32,19,t.xi3(33,22,e.data,"Count"),".0-0")),t.xp6(4),t.Oqu(t.xi3(36,25,t.xi3(37,28,e.data,"Quantity"),".0-0")),t.xp6(4),t.Oqu(t.xi3(40,31,t.xi3(41,34,e.data,"Gross"),".0-0")),t.xp6(4),t.hij(" ",t.xi3(44,37,t.xi3(45,40,e.data,"SalesNet"),".0-0")," "),t.xp6(4),t.hij(" ",t.xi3(48,43,t.xi3(49,46,e.data,"Tax"),".0-0")," "),t.xp6(5),t.Oqu(t.xi3(53,49,t.xi3(54,52,e.data,"SalesWithTax"),".0-0")),t.xp6(3),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible)}}const Cp=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance"]},Ap=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Monthly_Perfomance"]};let qp=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/OutletGroupPerformance","ReportLoader/OutletPerformance"),this.httpService=e,this.csvConverter=o,this.isCompareData=!1,this.DateFilterType=!0,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"}],this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.first=!0,this.RadioDateFilterType=[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}];const a=new Date;this.Year=a.getFullYear(),this.Month=a.getMonth()}preGetList(){this.first&&(this.YearMonthToDateRange(),this.first=!1)}YearMonthToDateRange(){const e=new Date;null==this.Year&&(this.Year=e.getFullYear()),null==this.Month&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}sortData(e){const o=this.data.slice();e.active&&""!==e.direction?this.data=o.sort((a,r)=>{const l="asc"===e.direction;switch(a.Name=a.Name?a.Name:"",r.Name=r.Name?r.Name:"",e.active){case"Name":return this.compare(a.Name,r.Name,l);case"Count":return this.compare(a.Count,r.Count,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Gross":return this.compare(a.Gross,r.Gross,l);case"SalesNet":return this.compare(a.SalesNet,r.SalesNet,l);case"SalesWithTax":return this.compare(a.SalesWithTax,r.SalesWithTax,l);case"Tax":return this.compare(a.Tax,r.Tax,l);case"SalesTaxNet":return this.compare(a.SalesTaxNet,r.SalesTaxNet,l);case"Cost":return this.compare(a.Cost,r.Cost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);case"ProfitWithTax":return this.compare(a.ProfitWithTax,r.ProfitWithTax,l);default:return 0}}):this.data.Data=o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-outlet-group-performance"]],features:[t.qOj],decls:16,vars:9,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["name","Date Filter",3,"model","options","modelChange"],[4,"ngIf"],["bindLabel","Name","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","pl-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],["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"],["mat-sort-header","Count",1,"align-right",2,"width","70px"],["mat-sort-header","Quantity",1,"align-right",2,"width","70px"],["mat-sort-header","Gross",1,"align-right",2,"width","120px"],["mat-sort-header","SalesNet",1,"align-right",2,"width","120px"],[1,"align-right",2,"width","120px",3,"mat-sort-header"],["mat-sort-header","SalesWithTax","altprop","SalesNet",1,"align-right",2,"width","120px",3,"altpropcond"],["style","width: 50px;",4,"ngIf"],["mat-sort-header","Cost","style","width: 120px;","class","align-right",4,"ngIf"],["style","width: 120px;","class","align-right",3,"mat-sort-header",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["class","empty-column",4,"ngIf"],[1,"empty-column"],[1,"text-right"],[1,"text-right","text-primary"],[3,"ngClass",4,"ngIf"],["class","text-right text-danger",4,"ngIf"],["class","text-right text-success",4,"ngIf"],[2,"width","35px"],[2,"width","50px"],["mat-sort-header","Cost",1,"align-right",2,"width","120px"],["style","width: 35px;",3,"ngClass",4,"ngIf"],[1,"text-right",2,"width","70px"],[2,"width","35px",3,"ngClass"],[3,"ngClass"],[1,"text-right","text-danger"],[1,"text-right","text-success"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,$s,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"By Entity "),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10,"Top By Month"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",8),t.YNc(13,tp,12,7,"div",9),t.qZA(),t.qZA(),t.TgZ(14,"content"),t.YNc(15,xp,58,55,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(7,Cp)),t.xp6(5),t.Q6J("routerLink",t.DdM(8,Ap)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,q.P,c.w9,p.JJ,p.On,C.QB,Z.YE,Z.nU,s.sg,s.mk],pipes:[s.JJ,T.qU],styles:[""]}),n})();function Dp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",11),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.convertToCSV(a.csvConverter,!0,"Monthly Outlet PErformance ["+a.pageData.Filter.From+" - "+a.pageData.Filter.To+"].csv")}),t._UZ(1,"i",12),t._uU(2,"Export"),t.qZA()}}function yp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",13),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Sales Name"),t.qZA(),t.TgZ(4,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Year"),t.qZA(),t.TgZ(8,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Type"),t.qZA(),t.TgZ(12,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types)}}const vp=function(n){return{"align-right":n}};function Sp(n,i){if(1&n&&(t.TgZ(0,"th",22),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.Q6J("mat-sort-header",e)("ngClass",t.VKq(3,vp,"Outlet"!=e)),t.xp6(1),t.Oqu(e)}}function Mp(n,i){if(1&n&&(t.TgZ(0,"div",25),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(1),t.Oqu(o[e])}}function bp(n,i){if(1&n&&(t.TgZ(0,"div",26),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(1),t.hij("",t.lcZ(2,1,o[e])," ")}}function Jp(n,i){if(1&n&&(t.TgZ(0,"td"),t.YNc(1,Mp,2,1,"div",23),t.YNc(2,bp,3,3,"div",24),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Q6J("ngIf","Outlet"==e),t.xp6(1),t.Q6J("ngIf","Outlet"!=e)}}function Op(n,i){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,Jp,3,2,"td",20),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",o.getKeys(e))}}function Ip(n,i){if(1&n&&(t.TgZ(0,"td",30),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e))}}function Up(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",27),t.TgZ(2,"td",28),t._uU(3,"Total : "),t.qZA(),t.YNc(4,Ip,3,3,"td",29),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("ngForOf",e.data.DataFooter)}}function Fp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",16),t.TgZ(1,"table",17),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",18),t.TgZ(3,"tr"),t.YNc(4,Sp,2,5,"th",19),t.qZA(),t.qZA(),t.TgZ(5,"tbody"),t.YNc(6,Op,2,1,"tr",20),t.qZA(),t.YNc(7,Up,5,1,"tfoot",21),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngForOf",e.data.Dataheader),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.Data.length>0)}}const Np=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance"]},Lp=function(){return["/menu/Reports/Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance"]};let Qp=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/MonthlyOutletPerformance","ReportLoader/MonthlyReportSales"),this.httpService=e,this.csvConverter=o,this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0)}getKeys(e){return Object.keys(e)}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;for(let _=0;_<this.data.Dataheader.length;_++)if(e.active==this.data.Dataheader[_])return this.compare(a[this.data.Dataheader[_]],r[this.data.Dataheader[_]],l)}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-outlet-monthly-performance"]],features:[t.qOj],decls:16,vars:9,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",2,"cursor","pointer"],[1,"dropdown-item"],[3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["placeholder","Year",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","ngClass",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[4,"ngIf"],[3,"mat-sort-header","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"],[1,""],["class","text-right",4,"ngFor","ngForOf"],[1,"text-right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Dp,3,0,"a",1),t.TgZ(3,"div",2),t.TgZ(4,"a",3),t._uU(5,"By Entity "),t.qZA(),t._UZ(6,"button",4),t.TgZ(7,"ul",5),t.TgZ(8,"li",6),t.TgZ(9,"a",7),t._uU(10,"By Entity Group"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",8),t.YNc(13,yp,13,6,"div",9),t.qZA(),t.qZA(),t.TgZ(14,"content"),t.YNc(15,Fp,8,3,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasExportRole),t.xp6(2),t.Q6J("routerLink",t.DdM(7,Np)),t.xp6(5),t.Q6J("routerLink",t.DdM(8,Lp)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,Z.YE,s.sg,Z.nU,s.mk],pipes:[s.JJ],styles:[""]}),n})();function Yp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",7),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/SalesPerson","Sales_Performance.csv")}),t._UZ(1,"i",8),t._uU(2,"Export"),t.qZA()}}function Rp(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",9),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Sales Group"),t.qZA(),t.TgZ(8,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesGroupID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From/To"),t.qZA(),t.TgZ(12,"datepicker",12),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",13),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Delivery"),t.qZA(),t.TgZ(17,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.DeliveryID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Sales Type"),t.qZA(),t.TgZ(21,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.List?null:e.pageData.List.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SalesGroupID)("items",null==e.pageData.List?null:e.pageData.List.SalesGroup),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.DeliveryID)("items",null==e.pageData.List?null:e.pageData.List.Deliveries),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.List?null:e.pageData.List.Types)}}function kp(n,i){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Sales Group"),t.qZA())}function Ep(n,i){1&n&&(t.TgZ(0,"th",40),t._uU(1," Cost "),t.qZA())}function Hp(n,i){1&n&&(t.TgZ(0,"th",41),t._uU(1,"Profit "),t.qZA())}function Vp(n,i){1&n&&(t.TgZ(0,"th",42),t._uU(1,"Target "),t.qZA())}function Bp(n,i){1&n&&(t.TgZ(0,"th",43),t._uU(1,"Ach(%) "),t.qZA())}function Gp(n,i){if(1&n&&(t.TgZ(0,"td"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Group)}}function jp(n,i){if(1&n&&(t.TgZ(0,"td",46),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Cost))}}function Wp(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij("",t.lcZ(2,1,e.Profit)," ")}}function $p(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.Target)," ")}}function Kp(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.Achievement),"")}}const Xp=function(){return["/menu/Contacts/Contact/Sales_Person/Info"]},zp=function(n){return{ID:n}},tc=function(){return["/menu/Reports/Sales_Report/Standard/Detail"]},ec=function(n,i,e,o){return{SalesPersonID:n,From:i,To:e,ListIDs:o}};function nc(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td",44),t.TgZ(2,"a",45),t._uU(3),t.qZA(),t.qZA(),t.YNc(4,Gp,2,1,"td",33),t.TgZ(5,"td",35),t.TgZ(6,"a",45),t.ALo(7,"date"),t.ALo(8,"date"),t._uU(9),t.ALo(10,"number"),t.qZA(),t.qZA(),t.TgZ(11,"td",36),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td",36),t._uU(15),t.ALo(16,"number"),t.qZA(),t.TgZ(17,"td",36),t._uU(18),t.ALo(19,"number"),t.qZA(),t.TgZ(20,"td",35),t._uU(21),t.ALo(22,"number"),t.qZA(),t.YNc(23,jp,3,3,"td",37),t.YNc(24,Wp,3,3,"td",38),t.YNc(25,$p,3,3,"td",38),t.YNc(26,Kp,3,3,"td",38),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.DdM(36,Xp))("queryParams",t.VKq(37,zp,e.ID)),t.xp6(1),t.Oqu(e.Name),t.xp6(1),t.Q6J("ngIf",o.data.Show),t.xp6(2),t.Q6J("routerLink",t.DdM(39,tc))("queryParams",t.l5B(40,ec,e.ID,t.xi3(7,15,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(8,18,o.pageData.Filter.To,"ddMMyyyy"),o.pageData.Filter.ListIDs)),t.xp6(3),t.Oqu(t.xi3(10,21,e.Orders,".0-0")),t.xp6(3),t.Oqu(t.xi3(13,24,e.Quantity,".0-0")),t.xp6(3),t.Oqu(t.xi3(16,27,e.Sales,".0-0")),t.xp6(3),t.Oqu(t.xi3(19,30,e.Tax,".0-0")),t.xp6(3),t.Oqu(t.xi3(22,33,e.SalesNTax,".0-0")),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",o.pageData.HasRoleProfit),t.xp6(1),t.Q6J("ngIf",o.data.ShowSalesTarget),t.xp6(1),t.Q6J("ngIf",o.data.ShowSalesTarget)}}function ac(n,i){1&n&&t._UZ(0,"td")}function oc(n,i){if(1&n&&(t.TgZ(0,"td",46),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.List,"Cost")),"")}}function rc(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.List,"Profit")),"")}}function ic(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.List,"Target")),"")}}function lc(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.ALo(4,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.List,"Sales")/t.xi3(4,6,e.data.List,"Target")*100)," ")}}function sc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",16),t.TgZ(1,"table",17),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",18),t.TgZ(3,"tr",19),t.TgZ(4,"th",20),t._uU(5,"Sales Person"),t.qZA(),t.YNc(6,kp,2,0,"th",21),t.TgZ(7,"th",22),t._uU(8,"Orders"),t.qZA(),t.TgZ(9,"th",23),t._uU(10,"Quantity"),t.qZA(),t.TgZ(11,"th",24),t._uU(12,"Sales"),t.qZA(),t.TgZ(13,"th",25),t._uU(14,"Tax"),t.qZA(),t.TgZ(15,"th",26),t._uU(16," Sales + Tax "),t.qZA(),t.YNc(17,Ep,2,0,"th",27),t.YNc(18,Hp,2,0,"th",28),t.YNc(19,Vp,2,0,"th",29),t.YNc(20,Bp,2,0,"th",30),t.qZA(),t.qZA(),t.TgZ(21,"tbody"),t.YNc(22,nc,27,45,"tr",31),t.qZA(),t.TgZ(23,"tfoot"),t.TgZ(24,"tr",32),t.YNc(25,ac,1,0,"td",33),t.TgZ(26,"td",34),t._uU(27,"Total:"),t.qZA(),t.TgZ(28,"td",35),t._uU(29),t.ALo(30,"number"),t.ALo(31,"sum"),t.qZA(),t.TgZ(32,"td",36),t._uU(33),t.ALo(34,"number"),t.ALo(35,"sum"),t.qZA(),t.TgZ(36,"td",36),t._uU(37),t.ALo(38,"number"),t.ALo(39,"sum"),t.qZA(),t.TgZ(40,"td",36),t._uU(41),t.ALo(42,"number"),t.ALo(43,"sum"),t.qZA(),t.TgZ(44,"td",35),t._uU(45),t.ALo(46,"number"),t.ALo(47,"sum"),t.qZA(),t.YNc(48,oc,4,6,"td",37),t.YNc(49,rc,4,6,"td",38),t.YNc(50,ic,4,6,"td",38),t.YNc(51,lc,5,9,"td",38),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(6),t.Q6J("ngIf",e.data.Show),t.xp6(11),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",e.pageData.HasRoleProfit),t.xp6(1),t.Q6J("ngIf",e.data.ShowSalesTarget),t.xp6(1),t.Q6J("ngIf",e.data.ShowSalesTarget),t.xp6(2),t.Q6J("ngForOf",e.data.List),t.xp6(3),t.Q6J("ngIf",e.data.Show),t.xp6(4),t.Oqu(t.xi3(30,16,t.xi3(31,19,e.data.List,"Orders"),".0-0")),t.xp6(4),t.Oqu(t.xi3(34,22,t.xi3(35,25,e.data.List,"Quantity"),".0-0")),t.xp6(4),t.Oqu(t.xi3(38,28,t.xi3(39,31,e.data.List,"Sales"),".0-0")),t.xp6(4),t.Oqu(t.xi3(42,34,t.xi3(43,37,e.data.List,"Tax"),".0-0")),t.xp6(4),t.hij("",t.xi3(46,40,t.xi3(47,43,e.data.List,"SalesNTax"),".0-0")," "),t.xp6(3),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",e.pageData.HasRoleProfit),t.xp6(1),t.Q6J("ngIf",e.data.ShowSalesTarget),t.xp6(1),t.Q6J("ngIf",e.data.ShowSalesTarget)}}const cc=function(){return["/menu/Reports/Sales_Report/Standard/Sales_Person/Commission_Report"]},uc=function(){return["/menu/Reports/Sales_Report/Standard/Sales_Person/Sales_Commission"]};let gc=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/SalesPerson","ReportLoader/SalesPerson"),this.httpService=e,this.csvConverter=o}postInit(){this.menuData.H=this.data.PageTitle}sortData(e){const o=this.data.List.slice();this.data.List=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(a.Name=null==a.Name?"":a.Name,r.Name=null==r.Name?"":r.Name,a.Group=null==a.Group?"":a.Group,r.Group=null==r.Group?"":r.Group,e.active){case"Name":return this.compare(a.Name.toLocaleLowerCase(),r.Name.toLocaleLowerCase(),l);case"Group":return this.compare(a.Group.toLocaleLowerCase(),r.Group.toLocaleLowerCase(),l);case"Orders":return this.compare(a.Orders,r.Orders,l);case"Tax":return this.compare(a.Tax,r.Tax,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Cost":return this.compare(a.Cost,r.Cost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"SalesNTax":return this.compare(a.SalesNTax,r.SalesNTax,l);case"Target":return this.compare(a.Target,r.Target,l);case"Achievement":return this.compare(a.Achievement,r.Achievement,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-sales-person"]],features:[t.qOj],decls:12,vars:9,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],["role","button","title","Target",1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],["role","button","title","Target",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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"],["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"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],["mat-sort-header","Name"],["mat-sort-header","Group",4,"ngIf"],["mat-sort-header","Orders",1,"align-right",2,"width","80px"],["mat-sort-header","Quantity",1,"align-right",2,"width","100px"],["mat-sort-header","Sales",1,"align-right",2,"width","120px"],["mat-sort-header","Tax",1,"align-right",2,"width","90px"],["mat-sort-header","SalesNTax",1,"align-right",2,"width","120px"],["mat-sort-header","Cost","style","width: 120px;","class","align-right",4,"ngIf"],["mat-sort-header","Profit","style","width: 120px;","class","align-right",4,"ngIf"],["mat-sort-header","Target","style","width: 120px;","class","align-right",4,"ngIf"],["mat-sort-header","Achievement","style","width: 120px;","class","align-right",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[4,"ngIf"],[1,"empty-column","text-right"],[1,"text-right","text-primary"],[1,"text-right"],["class","text-right text-danger",4,"ngIf"],["class","text-right text-success",4,"ngIf"],["mat-sort-header","Group"],["mat-sort-header","Cost",1,"align-right",2,"width","120px"],["mat-sort-header","Profit",1,"align-right",2,"width","120px"],["mat-sort-header","Target",1,"align-right",2,"width","120px"],["mat-sort-header","Achievement",1,"align-right",2,"width","120px"],[1,"text-primary"],[3,"routerLink","queryParams"],[1,"text-right","text-danger"],[1,"text-right","text-success"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Yp,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4,"By Product"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"By Item"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,Rp,22,11,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,sc,52,46,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(1),t.Q6J("routerLink",t.DdM(7,cc)),t.xp6(2),t.Q6J("routerLink",t.DdM(8,uc)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,Z.YE,Z.nU,s.sg],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function dc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",7),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/GetSalesPersonCommissionGroupBySales","Sales_Commission.csv")}),t._UZ(1,"i",8),t._uU(2,"Export"),t.qZA()}}function mc(n,i){if(1&n&&(t.TgZ(0,"span",16),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Zc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",9),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,mc,2,2,"ng-template",12),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Sales Group"),t.qZA(),t.TgZ(13,"ng-select",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesGroupID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"From/To"),t.qZA(),t.TgZ(17,"datepicker",14),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(18,"datepicker",15),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.List?null:e.pageData.List.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.List?null:e.pageData.List.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.SalesGroupID)("items",null==e.pageData.List?null:e.pageData.List.SalesGroup),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function hc(n,i){1&n&&(t.TgZ(0,"th",31),t._uU(1,"Sales Target"),t.qZA())}function xc(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.SalesTarget,".0-0"),"")}}const Tc=function(n,i,e){return{ID:n,from:i,to:e}},et="/menu/Reports/Sales_Report/Standard/Sales_Person/Commission_Report",Cc=function(n){return[et,n]};function fc(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",29),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",29),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",29),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",29),t.TgZ(13,"a",32),t.ALo(14,"date"),t.ALo(15,"date"),t._uU(16),t.ALo(17,"number"),t.qZA(),t.qZA(),t.YNc(18,xc,3,4,"td",33),t.ALo(19,"sum"),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.SalesPersonName),t.xp6(2),t.Oqu(t.xi3(5,7,e.TotalOrders,".0-0")),t.xp6(3),t.Oqu(t.xi3(8,10,e.Quantity,".0-0")),t.xp6(3),t.Oqu(t.xi3(11,13,e.GrossRevenue,".0-0")),t.xp6(3),t.Q6J("routerLink",t.VKq(31,Cc,t.kEZ(27,Tc,e.SalesPersonID,t.xi3(14,16,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(15,19,o.pageData.Filter.To,"ddMMyyyy")))),t.xp6(3),t.hij(" ",t.lcZ(17,22,e.TotalCommission)," "),t.xp6(2),t.Q6J("ngIf",t.xi3(19,24,o.data.List,"SalesTarget")>0)}}function Ac(n,i){1&n&&t._UZ(0,"td",34)}function qc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",17),t.TgZ(1,"table",18),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",19),t.TgZ(3,"tr"),t.TgZ(4,"th",20),t._uU(5,"Sales Person"),t.qZA(),t.TgZ(6,"th",21),t._uU(7,"Orders"),t.qZA(),t.TgZ(8,"th",22),t._uU(9,"Items Quantity"),t.qZA(),t.TgZ(10,"th",23),t._uU(11,"Gross Revenue"),t.qZA(),t.TgZ(12,"th",24),t._uU(13,"Product Commission"),t.qZA(),t.YNc(14,hc,2,0,"th",25),t.ALo(15,"sum"),t.qZA(),t.qZA(),t.TgZ(16,"tbody"),t.YNc(17,fc,20,33,"tr",26),t.qZA(),t.TgZ(18,"tfoot"),t.TgZ(19,"tr",27),t.TgZ(20,"td",28),t._uU(21,"Total:"),t.qZA(),t.TgZ(22,"td",29),t._uU(23),t.ALo(24,"number"),t.ALo(25,"sum"),t.qZA(),t.TgZ(26,"td",29),t._uU(27),t.ALo(28,"number"),t.ALo(29,"sum"),t.qZA(),t.TgZ(30,"td",29),t._uU(31),t.ALo(32,"number"),t.ALo(33,"sum"),t.qZA(),t.TgZ(34,"td",29),t._uU(35),t.ALo(36,"number"),t.ALo(37,"sum"),t.qZA(),t.YNc(38,Ac,1,0,"td",30),t.ALo(39,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(14),t.Q6J("ngIf",t.xi3(15,7,e.data.List,"SalesTarget")>0),t.xp6(3),t.Q6J("ngForOf",e.data.List),t.xp6(6),t.Oqu(t.lcZ(24,10,t.xi3(25,12,e.data.List,"TotalOrders"))),t.xp6(4),t.Oqu(t.lcZ(28,15,t.xi3(29,17,e.data.List,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(32,20,t.xi3(33,22,e.data.List,"GrossRevenue"))),t.xp6(4),t.Oqu(t.lcZ(36,25,t.xi3(37,27,e.data.List,"TotalCommission"))),t.xp6(3),t.Q6J("ngIf",t.xi3(39,30,e.data.List,"SalesTarget")>0)}}const Dc=function(){return[et]},yc=function(){return["/menu/Reports/Sales_Report/Standard/Sales_Person"]};let vc=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetSalesPersonCommissionGroupBySales","ReportLoader/SalesPerson"),this.httpService=e,this.csvConverter=o}sortData(e){const o=this.data.List.slice();this.data.List=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Name":return this.compare(a.Name,r.Name,l);case"TotalOrders":return this.compare(a.TotalOrders,r.TotalOrders,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"GrossRevenue":return this.compare(a.GrossRevenue,r.GrossRevenue,l);case"TotalCommission":return this.compare(a.TotalCommission,r.TotalCommission,l);case"SalesTarget":return this.compare(a.SalesTarget,r.SalesTarget,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-sales-commision"]],features:[t.qOj],decls:12,vars:9,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],["role","button","title","Target",1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],["role","button","title","Target",1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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"],["name","To",3,"date","dateChange"],[3,"title"],[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"],["mat-sort-header","TotalOrders",1,"align-right",2,"width","110px"],["mat-sort-header","Quantity",1,"align-right",2,"width","110px"],["mat-sort-header","GrossRevenue",1,"align-right",2,"width","150px"],["mat-sort-header","TotalCommission",1,"align-right",2,"width","150px"],["mat-sort-header","SalesTarget","style","width: 150px;","class","align-right",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column","text-right"],[1,"text-right"],["class","empty-column",4,"ngIf"],["mat-sort-header","SalesTarget",1,"align-right",2,"width","150px"],[3,"routerLink"],["class","text-right",4,"ngIf"],[1,"empty-column"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,dc,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4,"By Product"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"By Order"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,Zc,19,9,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,qc,40,33,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(1),t.Q6J("routerLink",t.DdM(7,Dc)),t.xp6(2),t.Q6J("routerLink",t.DdM(8,yc)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,c.ir,C.QB,Z.YE,Z.nU,s.sg],pipes:[T.qU,s.JJ,s.uU],styles:[""]}),n})();function Sc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",11),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Sales"),t.qZA(),t.TgZ(8,"ng-select",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From/To"),t.qZA(),t.TgZ(12,"datepicker",14),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",15),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.ID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}const Mc=function(){return["/menu/Products/Catalog/Variants/Info"]},nt=function(n){return{ID:n}};function bc(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td",36),t.TgZ(2,"a",37),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"td",38),t._uU(5),t.qZA(),t.TgZ(6,"td",39),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",40),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",40),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",41),t._uU(16),t.ALo(17,"number"),t.qZA(),t.TgZ(18,"td",42),t._uU(19),t.ALo(20,"number"),t.qZA(),t.TgZ(21,"td",42),t._uU(22),t.ALo(23,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Q6J("routerLink",t.DdM(22,Mc))("queryParams",t.VKq(23,nt,e.VariantID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.hij(" ",t.lcZ(8,10,e.Quantity),""),t.xp6(3),t.hij(" ",t.lcZ(11,12,e.VariantCommission),""),t.xp6(3),t.hij(" ",t.lcZ(14,14,e.GroupCommission),""),t.xp6(3),t.hij(" ",t.lcZ(17,16,e.TotalCommission),""),t.xp6(3),t.hij(" ",t.lcZ(20,18,e.UnitPrice*e.Quantity),""),t.xp6(3),t.hij(" ",t.lcZ(23,20,e.NettSales)," ")}}const Jc=function(){return["/menu/Contacts/Contact/Sales_Person/Info"]};function Oc(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"div",28),t.TgZ(2,"a",29),t.TgZ(3,"span"),t._uU(4),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"strong"),t._uU(7),t.qZA(),t.qZA(),t.qZA(),t.TgZ(8,"div",30),t.TgZ(9,"div"),t.TgZ(10,"table",31),t._UZ(11,"thead"),t.TgZ(12,"tbody"),t.YNc(13,bc,24,25,"tr",27),t.qZA(),t.TgZ(14,"tfoot"),t.TgZ(15,"tr",32),t.TgZ(16,"td",33),t._uU(17,"Total:"),t.qZA(),t.TgZ(18,"td",34),t._uU(19),t.ALo(20,"number"),t.ALo(21,"sum"),t.ALo(22,"GetChildrenArray"),t.qZA(),t._UZ(23,"td",35),t.TgZ(24,"td",34),t._uU(25),t.ALo(26,"number"),t.ALo(27,"sum"),t.ALo(28,"GetChildrenArray"),t.qZA(),t.TgZ(29,"td",34),t._uU(30),t.ALo(31,"number"),t.ALo(32,"sum"),t.ALo(33,"GetChildrenArray"),t.qZA(),t.TgZ(34,"td",34),t._uU(35),t.ALo(36,"number"),t.ALo(37,"sum"),t.ALo(38,"GetChildrenArray"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.DdM(41,Jc))("queryParams",t.VKq(42,nt,e.ID)),t.xp6(2),t.Oqu(e.Name),t.xp6(3),t.Oqu(e.GroupName),t.xp6(6),t.Q6J("ngForOf",e.Item),t.xp6(6),t.hij(" ",t.lcZ(20,9,t.xi3(21,11,o.filterData(t.xi3(22,14,o.data.Data,"Item"),"SalesID",e.ID),"Quantity"))," "),t.xp6(6),t.hij(" ",t.lcZ(26,17,t.xi3(27,19,o.filterData(t.xi3(28,22,o.data.Data,"Item"),"SalesID",e.ID),"TotalCommission"))," "),t.xp6(5),t.hij(" ",t.lcZ(31,25,t.xi3(32,27,o.filterData(t.xi3(33,30,o.data.Data,"Item"),"SalesID",e.ID),"Revenue"))," "),t.xp6(5),t.hij(" ",t.lcZ(36,33,t.xi3(37,35,o.filterData(t.xi3(38,38,o.data.Data,"Item"),"SalesID",e.ID),"NettSales"))," ")}}function Ic(n,i){if(1&n&&(t.TgZ(0,"div",16),t.TgZ(1,"table",17),t.TgZ(2,"thead",18),t.TgZ(3,"tr",19),t._UZ(4,"th",20),t.TgZ(5,"th",21),t._uU(6,"Product Commission"),t.qZA(),t._UZ(7,"th",20),t.qZA(),t.TgZ(8,"tr"),t.TgZ(9,"th"),t._uU(10,"Name"),t.qZA(),t.TgZ(11,"th",22),t._uU(12,"Code"),t.qZA(),t.TgZ(13,"th",23),t._uU(14,"Quantity"),t.qZA(),t.TgZ(15,"th",24),t._uU(16,"Standard"),t.qZA(),t.TgZ(17,"th",24),t._uU(18,"Group"),t.qZA(),t.TgZ(19,"th",25),t._uU(20,"Qty * Product Comm."),t.qZA(),t.TgZ(21,"th",26),t._uU(22,"Gross Revenue"),t.qZA(),t.TgZ(23,"th",26),t._uU(24,"Nett Sales"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.YNc(25,Oc,39,44,"div",27),t.qZA()),2&n){const e=t.oxw();t.xp6(25),t.Q6J("ngForOf",e.data.Data)}}const Fc=function(){return["/menu/Reports/Sales_Report/Standard/Sales_Person/Sales_Commission"]},Nc=function(){return["/menu/Reports/Sales_Report/Standard/Sales_Person/Commission_Report/Commission_Report_Detail"]},Pc=function(n,i){return{From:n,To:i}};let Lc=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/GetSalesPersonCommissionGroupByProduct","ReportLoader/SalesCommissionLoader",null,a),this.httpService=e,this.csvConverter=o,this.activatedRoute=a}print(){window.print()}filterData(e,o,a){return e.filter(function(r){return r[o]==a})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-commision-report"]],features:[t.qOj],decls:20,vars:18,consts:[[3,"pageData","hideSearchBox","onSubmit"],[1,"btn-group","mr-6"],[1,"pointer","btn","btn-outline-secondary",3,"click"],[1,"fa","fa-print"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["role","button","title","Sales Person Commission Summary",1,"btn","btn-outline-secondary","mr-6",3,"routerLink"],["role","button","title","Sales Person Statistics",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 outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose a Sales Person",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"columnSpan"],["colspan","3",1,"empty-column"],["colspan","2",1,"text-center"],[2,"width","140px"],[1,"text-right",2,"width","100px"],[1,"text-right",2,"width","120px"],[1,"text-right",2,"width","150px"],[1,"text-right",2,"width","130px"],[4,"ngFor","ngForOf"],[1,"mt-11","ml-3"],[1,"h5","font-weight-bold","text-primary",3,"routerLink","queryParams"],[1,"items"],[1,"table-sm","border","w-100"],[1,"table-footer"],["colspan","2",1,"text-right","empty-column"],[1,"text-right","text-success"],["colspan","2",1,"text-right","text-success","empty-column"],[1,"border"],[3,"routerLink","queryParams"],[1,"border",2,"width","140px"],[1,"text-right","text-success","border",2,"width","100px"],[1,"text-right","text-success","border",2,"width","120px"],[1,"text-right","text-success","border",2,"width","150px"],[1,"text-right","text-success","border",2,"width","130px"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"div",1),t.TgZ(3,"a",2),t.NdJ("click",function(){return o.print()}),t._UZ(4,"i",3),t._uU(5," Print"),t.qZA(),t.TgZ(6,"a",4),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/SalesPersonGroupByProduct","Sales_Commission_byProduct.csv")}),t._UZ(7,"i",5),t._uU(8,"Export"),t.qZA(),t.qZA(),t.TgZ(9,"a",6),t._uU(10,"Return to Summary"),t.qZA(),t.TgZ(11,"a",7),t.ALo(12,"date"),t.ALo(13,"date"),t._uU(14,"View Detail"),t.qZA(),t.qZA(),t.TgZ(15,"filters"),t.TgZ(16,"div",8),t.YNc(17,Sc,14,7,"div",9),t.qZA(),t.qZA(),t.TgZ(18,"content"),t.YNc(19,Ic,26,1,"div",10),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(9),t.Q6J("routerLink",t.DdM(13,Fc)),t.xp6(2),t.Q6J("routerLink",t.DdM(14,Nc))("queryParams",t.WLB(15,Pc,t.xi3(12,7,null==o.pageData.Filter?null:o.pageData.Filter.From,"ddMMyyyy"),t.xi3(13,10,null==o.pageData.Filter?null:o.pageData.Filter.To,"ddMMyyyy"))),t.xp6(6),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,C.QB,s.sg],pipes:[s.uU,s.JJ,T.qU,T.J1],styles:[""]}),n})();function Qc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Sales"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.ID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}const Yc=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},at=function(n){return{ID:n}};function Rc(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"td"),t.TgZ(5,"a",22),t._uU(6),t.qZA(),t.qZA(),t.TgZ(7,"td"),t._uU(8),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.qZA(),t.TgZ(11,"td",21),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td",21),t._uU(15),t.ALo(16,"number"),t.qZA(),t.TgZ(17,"td",21),t._uU(18),t.ALo(19,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(t.xi3(3,9,e.Date,"dd MMM yyyy")),t.xp6(3),t.Q6J("routerLink",t.DdM(18,Yc))("queryParams",t.VKq(19,at,e.InvoiceID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Oqu(e.VariantName),t.xp6(2),t.Oqu(e.SalesName),t.xp6(2),t.Oqu(t.lcZ(13,12,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(16,14,e.Commission)),t.xp6(3),t.Oqu(t.lcZ(19,16,e.TotalCommission))}}function kc(n,i){if(1&n&&(t.TgZ(0,"div",11),t.TgZ(1,"table",12),t.TgZ(2,"thead",13),t.TgZ(3,"tr",14),t.TgZ(4,"th",15),t._uU(5,"Date"),t.qZA(),t.TgZ(6,"th",15),t._uU(7,"Number"),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Name"),t.qZA(),t.TgZ(10,"th"),t._uU(11,"Sales Person"),t.qZA(),t.TgZ(12,"th",16),t._uU(13,"Quantity"),t.qZA(),t.TgZ(14,"th",16),t._uU(15,"Commission"),t.qZA(),t.TgZ(16,"th",16),t._uU(17,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(18,"tbody"),t.YNc(19,Rc,20,21,"tr",17),t.qZA(),t.TgZ(20,"tfoot"),t.TgZ(21,"tr",18),t._UZ(22,"td",19),t._UZ(23,"td",19),t._UZ(24,"td",19),t.TgZ(25,"td",20),t._uU(26,"Total:"),t.qZA(),t.TgZ(27,"td",21),t._uU(28),t.ALo(29,"number"),t.ALo(30,"sum"),t.qZA(),t._UZ(31,"td",19),t.TgZ(32,"td",21),t._uU(33),t.ALo(34,"number"),t.ALo(35,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(19),t.Q6J("ngForOf",e.data.Data),t.xp6(9),t.hij("",t.lcZ(29,3,t.xi3(30,5,e.data.Data,"Quantity"))," "),t.xp6(5),t.hij(" ",t.lcZ(34,8,t.xi3(35,10,e.data.Data,"TotalCommission")),"")}}const Hc=function(){return["/menu/Reports/Sales_Report/Standard/Sales_Person/Commission_Report"]};let Vc=(()=>{class n extends m.n{constructor(e,o,a,r){super(e,"Report/GetSalesPersonCommissionDetail","ReportLoader/SalesCommissionDetailLoader",null,r),this.httpService=e,this.csvConverter=o,this.datePipe=a,this.activatedRoute=r,this.datasource=[]}postInit(){this.menuData.H=this.data.PageTitle,this.datasource=this.data.Data}transformDate(e,o){return this.datePipe.transform(e,o)}getFilterData(e){this.data.Data=this.datasource.filter(o=>Object.keys(o).some(a=>null!=o[a]&&o[a].toString().toLowerCase().includes(e.toLowerCase())))}getID(){return this.pageData.Filter.ID?this.pageData.Filter.ID:x.gT.GuidEmpty}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(s.uU),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-commision-report-detail"]],features:[t.qOj],decls:12,vars:9,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["role","button",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 a Sales Person",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-right"],[1,"text-right","text-success"],["h","",3,"routerLink","queryParams"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()})("textChange",function(r){return o.getFilterData(r)}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return 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")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"Back"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,Qc,10,4,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,kc,36,13,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(5),t.Q6J("routerLink",t.DdM(6,Hc))("queryParams",t.VKq(7,at,o.getID())),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,C.QB,s.sg],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function Bc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",6),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/GetNonStandardPrice","Non-Standard Price.csv")}),t._UZ(1,"i",7),t._uU(2,"Export"),t.qZA()}}function Gc(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",8),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Variant"),t.qZA(),t.TgZ(8,"autocompleteV2",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.VariantID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From/To"),t.qZA(),t.TgZ(12,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",12),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"PriceType"),t.qZA(),t.TgZ(17,"radio-options",13),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.PriceTypeID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Note"),t.qZA(),t.TgZ(21,"input",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Note=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.VariantID),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("model",e.pageData.Filter.PriceTypeID)("options",e.PriceType),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Note)}}function jc(n,i){1&n&&(t.TgZ(0,"th",23),t._uU(1,"Original Cost"),t.qZA())}function Wc(n,i){1&n&&(t.TgZ(0,"th",23),t._uU(1,"Cost"),t.qZA())}function $c(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.VariantUnitCost))}}function Kc(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.UnitCost))}}const Xc=function(){return["/menu/Products/Catalog/Variants/Info"]},ot=function(n){return{ID:n}},zc=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]};function t_(n,i){if(1&n&&(t.TgZ(0,"tr",26),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"a",27),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.qZA(),t.TgZ(8,"td"),t.TgZ(9,"a",27),t._uU(10),t.qZA(),t.qZA(),t.TgZ(11,"td"),t._uU(12),t.ALo(13,"date"),t.qZA(),t.YNc(14,$c,3,3,"td",28),t.YNc(15,Kc,3,3,"td",28),t.TgZ(16,"td",29),t._uU(17),t.ALo(18,"number"),t.qZA(),t.TgZ(19,"td",29),t._uU(20),t.ALo(21,"number"),t.qZA(),t.TgZ(22,"td"),t._UZ(23,"i",30),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.EntityName),t.xp6(2),t.Q6J("routerLink",t.DdM(21,Xc))("queryParams",t.VKq(22,ot,e.VariantID)),t.xp6(1),t.Oqu(e.VariantName),t.xp6(2),t.Oqu(e.VariantCode),t.xp6(2),t.Q6J("routerLink",t.DdM(24,zc))("queryParams",t.VKq(25,ot,e.InvoiceID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Oqu(t.xi3(13,14,e.Created,"dd MMM yyyy")),t.xp6(2),t.Q6J("ngIf",o.pageData.HasCostRole),t.xp6(1),t.Q6J("ngIf",o.pageData.HasCostRole),t.xp6(2),t.Oqu(t.lcZ(18,17,e.VariantUnitPrice)),t.xp6(3),t.Oqu(t.lcZ(21,19,e.UnitPrice)),t.xp6(3),t.Q6J("innerHtml",e.Note,t.oJD)}}function e_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",15),t.TgZ(1,"table",16),t.TgZ(2,"thead",17),t.TgZ(3,"tr"),t.TgZ(4,"th",18),t._uU(5,"Outlet"),t.qZA(),t.TgZ(6,"th",19),t._uU(7,"Variant"),t.qZA(),t.TgZ(8,"th",20),t._uU(9,"Code"),t.qZA(),t.TgZ(10,"th",21),t._uU(11,"Number"),t.qZA(),t.TgZ(12,"th",21),t._uU(13,"Date"),t.qZA(),t.YNc(14,jc,2,0,"th",22),t.YNc(15,Wc,2,0,"th",22),t.TgZ(16,"th",23),t._uU(17,"Original Price"),t.qZA(),t.TgZ(18,"th",23),t._uU(19,"Price"),t.qZA(),t.TgZ(20,"th"),t._uU(21,"Note"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(22,"tbody"),t.YNc(23,t_,24,27,"tr",24),t.qZA(),t.qZA(),t.ynx(24),t.TgZ(25,"mat-paginator",25),t.NdJ("page",function(a){return t.CHM(e),t.oxw().onPaginationChange(a)}),t.qZA(),t.BQk(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(14),t.Q6J("ngIf",e.pageData.HasCostRole),t.xp6(1),t.Q6J("ngIf",e.pageData.HasCostRole),t.xp6(8),t.Q6J("ngForOf",e.data.Data),t.xp6(2),t.Q6J("length",e.data.ListTotal)("pageSize",e.pagination.PageSize)("pageIndex",0==e.pageData.Filter.PageNumber?0:e.pageData.Filter.PageNumber-1)}}const a_=function(){return["/menu/Reports/Sales_Report/Standard/Discounted_Sales"]};let o_=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetNonStandardPrice","ReportLoader/NonStandardPrice"),this.httpService=e,this.csvConverter=o,this.PriceType=[{Key:0,Value:"All"},{Key:1,Value:"Edited"}],this.sourcedata=[]}postInit(){this.sourcedata=this.data.Data}getFilterData(e){this.data.Data=this.sourcedata.filter(o=>Object.keys(o).some(a=>null!=o[a]&&o[a].toString().toLowerCase().includes(e.toLowerCase())))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-non-standard-price"]],features:[t.qOj],decls:10,vars:7,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-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","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["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-right","style","width: 100px",4,"ngIf"],[1,"text-right",2,"width","100px"],["class","border-bottom",4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[1,"border-bottom"],["target","_blank",3,"routerLink","queryParams"],["class","text-right",4,"ngIf"],[1,"text-right"],[2,"word-break","break-all",3,"innerHtml"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("textChange",function(r){return o.getFilterData(r)})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Bc,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4,"Discounted Sales"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,Gc,22,8,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,e_,26,6,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(2),t.Q6J("ngIf",null==o.pageData.Filter?null:o.pageData.Filter.IsExport),t.xp6(1),t.Q6J("routerLink",t.DdM(6,a_)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,D.J,C.QB,q.P,p.Fj,s.sg,Q.NW],pipes:[s.uU,s.JJ],styles:[""]}),n})();function r_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",25),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.exportCSV(a.csvConverter,"ReportExport/ReportPurchaseDetail","Purchase Transaction.csv")}),t._UZ(1,"i",26),t._uU(2,"Export"),t.qZA()}}function i_(n,i){if(1&n&&(t.TgZ(0,"th",27),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" UnitPrice(",e.data.Symbol,")")}}function l_(n,i){if(1&n&&(t.TgZ(0,"th",28),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" Total(",e.data.Symbol,")")}}function s_(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1," /"),t.qZA())}const rt=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},it=function(n){return{ID:n}};function p_(n,i){if(1&n&&(t.TgZ(0,"a",31),t.TgZ(1,"span",42),t._uU(2),t.qZA(),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("routerLink",t.DdM(3,rt))("queryParams",t.VKq(4,it,e.ID)),t.xp6(2),t.Oqu("#"+e.PONumber)}}function c_(n,i){if(1&n&&(t.TgZ(0,"th",49),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,null==e?null:e.UnitPrice))}}function __(n,i){if(1&n&&(t.TgZ(0,"th",50),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,null==e?null:e.Total)," ")}}function u_(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"th",43),t._uU(2),t.qZA(),t.TgZ(3,"th",44),t._uU(4),t.qZA(),t.TgZ(5,"th",45),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"th",18),t._uU(9),t.qZA(),t.YNc(10,c_,3,3,"th",46),t.TgZ(11,"th",47),t._uU(12),t.qZA(),t.YNc(13,__,3,3,"th",48),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(3);t.xp6(2),t.hij(" ",null==e?null:e.Name," "),t.xp6(2),t.Oqu(null==e?null:e.Code),t.xp6(2),t.hij(" ",t.lcZ(7,7,null==e?null:e.Quantity)," "),t.xp6(3),t.Oqu(null==e?null:e.UOMName),t.xp6(1),t.Q6J("ngIf",o.pageData.HasRoleCost),t.xp6(2),t.hij(" ",0==(null==e?null:e.Discount)?"-":(null==e?null:e.Discount)+"%"," "),t.xp6(1),t.Q6J("ngIf",o.pageData.HasRoleCost)}}function g_(n,i){if(1&n&&(t.TgZ(0,"tfoot",51),t.TgZ(1,"tr",52),t.TgZ(2,"td",53),t.TgZ(3,"b"),t._uU(4,"Total"),t.qZA(),t.qZA(),t.TgZ(5,"td",54),t.TgZ(6,"b"),t._uU(7),t.ALo(8,"number"),t.ALo(9,"sum"),t.qZA(),t.qZA(),t._UZ(10,"td"),t._UZ(11,"td"),t._UZ(12,"td"),t.TgZ(13,"td",55),t._UZ(14,"table",56),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(7),t.Oqu(t.lcZ(8,2,t.xi3(9,4,e.Items,"Quantity"))),t.xp6(7),t.Q6J("innerHTML",e.FooterHTML,t.oJD)}}function d_(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"div",29),t.TgZ(2,"div",30),t.TgZ(3,"a",31),t.TgZ(4,"span",32),t._uU(5),t.qZA(),t.qZA(),t.YNc(6,s_,2,0,"span",33),t.YNc(7,p_,3,6,"a",34),t.TgZ(8,"span"),t._uU(9),t.ALo(10,"date"),t.qZA(),t._UZ(11,"span",35),t.TgZ(12,"strong",36),t._uU(13),t.ALo(14,"sum"),t.ALo(15,"number"),t.ALo(16,"sum"),t.qZA(),t.qZA(),t.TgZ(17,"div",37),t.TgZ(18,"label",38),t._uU(19),t.qZA(),t.qZA(),t.qZA(),t.TgZ(20,"table",39),t._UZ(21,"thead"),t.TgZ(22,"tbody",40),t.YNc(23,u_,14,9,"tr",23),t.qZA(),t.YNc(24,g_,15,7,"tfoot",41),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(3),t.Q6J("routerLink",t.DdM(21,rt))("queryParams",t.VKq(22,it,e.ID)),t.xp6(2),t.Oqu(e.Name+" #"+e.Number),t.xp6(1),t.Q6J("ngIf",o.pageData.DualReceiptNumber),t.xp6(1),t.Q6J("ngIf",o.pageData.DualReceiptNumber),t.xp6(2),t.Oqu(" - "+t.xi3(10,10,e.Date,"dd MMM yyyy")+(null==e.SupplierName?"":" : "+e.SupplierName)),t.xp6(4),t.hij(" ","[Q: "+t.xi3(14,13,e.Items,"Quantity")+", T: "+t.lcZ(15,16,t.xi3(16,18,e.Items,"Total"))+"]"," "),t.xp6(6),t.Oqu(e.PaymentStateLabel),t.xp6(4),t.Q6J("ngForOf",e.Items),t.xp6(1),t.Q6J("ngIf",o.pageData.HasRoleCost)}}function m_(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"strong"),t._uU(2,"Cost ("),t.TgZ(3,"span",59),t._uU(4),t.ALo(5,"number"),t.qZA(),t._uU(6,"%)"),t.qZA(),t.TgZ(7,"span",54),t._uU(8),t.ALo(9,"number"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(4),t.Oqu(t.xi3(5,2,e.data.Aggregate.CostRatio,".0-0")),t.xp6(4),t.Oqu(e.data.Aggregate.Cost?t.xi3(9,5,e.data.Aggregate.Cost,".0-0"):"\xa0")}}function Z_(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"strong"),t.TgZ(2,"span"),t._uU(3,"Profit"),t.qZA(),t._uU(4," ("),t.TgZ(5,"span",59),t._uU(6),t.ALo(7,"number"),t.qZA(),t._uU(8,"%)"),t.qZA(),t.TgZ(9,"span",54),t._uU(10),t.ALo(11,"number"),t.qZA(),t.qZA()),2&n){const e=t.oxw(3);t.xp6(6),t.Oqu(t.xi3(7,2,e.data.Aggregate.ProfitRatio,".0-0")),t.xp6(4),t.Oqu(e.data.Aggregate.Profit?t.xi3(11,5,e.data.Aggregate.Profit,".0-0"):"\xa0")}}function h_(n,i){if(1&n&&(t.TgZ(0,"div",57),t.TgZ(1,"div",58),t.TgZ(2,"div"),t.TgZ(3,"strong"),t._uU(4,"Tax Added"),t.qZA(),t.TgZ(5,"span",54),t._uU(6),t.ALo(7,"number"),t.qZA(),t.qZA(),t.TgZ(8,"div"),t.TgZ(9,"strong"),t._uU(10,"Purchases with Tax"),t.qZA(),t.TgZ(11,"span",54),t._uU(12),t.ALo(13,"number"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"div",58),t.TgZ(15,"div"),t.TgZ(16,"strong"),t._uU(17,"Orders"),t.qZA(),t.TgZ(18,"span",54),t._uU(19),t.ALo(20,"number"),t.qZA(),t.qZA(),t.TgZ(21,"div"),t.TgZ(22,"strong"),t._uU(23,"Qty"),t.qZA(),t.TgZ(24,"span",54),t._uU(25),t.ALo(26,"number"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(27,"div",58),t.TgZ(28,"div"),t.TgZ(29,"strong"),t._uU(30,"Gross Purchase"),t.qZA(),t.TgZ(31,"span",54),t._uU(32),t.ALo(33,"number"),t.qZA(),t.qZA(),t.TgZ(34,"div"),t.TgZ(35,"strong"),t._uU(36,"Discount"),t.qZA(),t.TgZ(37,"span",54),t._uU(38),t.ALo(39,"number"),t.qZA(),t.qZA(),t.TgZ(40,"div"),t.TgZ(41,"strong"),t._uU(42,"Tax Incl."),t.qZA(),t.TgZ(43,"span",54),t._uU(44),t.ALo(45,"number"),t.qZA(),t.qZA(),t.TgZ(46,"div"),t.TgZ(47,"strong"),t._uU(48,"Net Purchase"),t.qZA(),t.TgZ(49,"span",54),t._uU(50),t.ALo(51,"number"),t.qZA(),t.qZA(),t.YNc(52,m_,10,8,"div",33),t.YNc(53,Z_,12,8,"div",33),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(6),t.Oqu(t.xi3(7,10,e.data.Aggregate.TaxAdd,".0-0")),t.xp6(6),t.Oqu(t.xi3(13,13,e.data.Aggregate.SalesWithTax,".0-0")),t.xp6(7),t.Oqu(t.xi3(20,16,e.data.Aggregate.TotalTransaction,".0-0")),t.xp6(6),t.Oqu(t.xi3(26,19,e.data.Aggregate.UnitQuantity,".0-0")),t.xp6(7),t.Oqu(t.xi3(33,22,e.data.Aggregate.Gross,".0-0")),t.xp6(6),t.Oqu(t.xi3(39,25,e.data.Aggregate.Discount,".0-0")),t.xp6(6),t.Oqu(t.xi3(45,28,e.data.Aggregate.TaxInclude,".0-0")),t.xp6(6),t.Oqu(t.xi3(51,31,e.data.Aggregate.NetSales,".0-0")),t.xp6(2),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(1),t.Q6J("ngIf",e.pageData.HasRoleCost)}}function x_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,r_,3,0,"a",2),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",3),t.TgZ(5,"div",4),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Outlet"),t.qZA(),t.TgZ(9,"ng-select",5),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Category"),t.qZA(),t.TgZ(13,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Supplier"),t.qZA(),t.TgZ(17,"autocompleteV2",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SupplierID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"From/To"),t.qZA(),t.TgZ(21,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(22,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(23,"div"),t.TgZ(24,"h6"),t._uU(25,"Currency"),t.qZA(),t.TgZ(26,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(27,"div"),t.TgZ(28,"h6"),t._uU(29,"Sort"),t.qZA(),t.TgZ(30,"radio-options",11),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.IsDesc=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(31,"content"),t.TgZ(32,"div",12),t.TgZ(33,"table",13),t.TgZ(34,"thead",14),t.TgZ(35,"tr"),t.TgZ(36,"th",15),t._uU(37,"Name"),t.qZA(),t.TgZ(38,"th",16),t._uU(39,"Code"),t.qZA(),t.TgZ(40,"th",17),t._uU(41,"Qty"),t.qZA(),t.TgZ(42,"th",18),t._uU(43,"UOM"),t.qZA(),t.YNc(44,i_,2,1,"th",19),t.TgZ(45,"th",20),t._uU(46,"%"),t.qZA(),t.YNc(47,l_,2,1,"th",21),t.qZA(),t.qZA(),t.TgZ(48,"tbody"),t.TgZ(49,"tr"),t.TgZ(50,"td",22),t.YNc(51,d_,25,24,"div",23),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.YNc(52,h_,54,34,"div",24),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.pageData.IsExport),t.xp6(7),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SupplierID),t.xp6(4),t.Q6J("isFloatingLabel",!1)("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("isFloatingLabel",!1)("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",e.pageData.Options.Currencies),t.xp6(4),t.Q6J("model",e.pageData.Filter.IsDesc)("options",e.AscDscRadio),t.xp6(14),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(3),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(3),t.uIk("colspan",e.pageData.HasRoleCost?8:6),t.xp6(1),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.Data.length>0)}}let T_=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/GetPurchaseTransactionDetail","ReportLoader/GetPurchaseTransactionDetail"),this.httpService=e,this.csvConverter=o,this.datePipe=a,this.AscDscRadio=[{Key:!1,Value:"Asc"},{Key:!0,Value:"Desc"}]}preGetList(){null===this.pageData.Filter.EntityID&&(this.pageData.Filter.EntityID=x.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")?`Purchases Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d")}`:`Purchases Transaction [ ${this.datePipe.transform(this.pageData.Filter.From,"d MMM yyyy")}`,this.pageData.Filter.From==this.pageData.Filter.To?this.menuData.H=`Purchases 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 n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(s.uU))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-detail"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",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","width","215","appearance","outline","name","From",3,"isFloatingLabel","date","dateChange"],["placeholder","To","width","215","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","645px"],[2,"width","75px"],[1,"text-right",2,"width","30px"],[1,"font-italic","small",2,"width","40px"],["class","text-right","style","width: 80px",4,"ngIf"],[1,"red",2,"width","30px"],["class","text-right","style","width: 150px",4,"ngIf"],[1,"px-0"],[4,"ngFor","ngForOf"],["class","row justify-content-end",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[1,"text-right",2,"width","80px"],[1,"text-right",2,"width","150px"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"mr-auto","d-sm-block","mt-2","mb-2"],[1,"h5","text-primary","font-weight-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ml-3"],[4,"ngIf"],["class","h5 text-primary font-weight-bold",3,"routerLink","queryParams",4,"ngIf"],[1,"d-block"],[1,"text-danger","ml-3"],[1,"d-lg-block","mt-2","mr-5","font-weight-bold","font-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"],[2,"width","600px"],[1,"font-weight-normal",2,"width","75px"],[1,"font-weight-normal","text-right",2,"width","30px"],["class","font-weight-normal text-right","style","width: 80px",4,"ngIf"],[1,"font-weight-normal","text-right","text-danger",2,"width","30px"],["class","font-weight-normal text-right","style","width: 140px",4,"ngIf"],[1,"font-weight-normal","text-right",2,"width","80px"],[1,"font-weight-normal","text-right",2,"width","140px"],[1,"table","table-sm","table-borderless"],[1,"grid_footer"],["colspan","2",1,"text-right"],[1,"text-right"],[1,"text-right","d-flex","justify-content-end","font-weight-bold"],["cellpadding","0","cellspacing","0",3,"innerHTML"],[1,"row","justify-content-end"],[1,"zebra","col-auto"],[1,"Percentage"]],template:function(e,o){1&e&&t.YNc(0,x_,53,21,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},directives:[s.O5,d.p,c.w9,p.JJ,p.On,D.J,C.QB,q.P,s.sg,u.yS],pipes:[s.uU,T.qU,s.JJ],styles:[""]}),n})();function C_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",31),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.exportCSV(a.csvConverter,"ReportExport/ReportPurchaseSummary","Purchase Summary.csv")}),t._UZ(1,"i",32),t._uU(2,"Export"),t.qZA()}}function f_(n,i){1&n&&t._UZ(0,"br")}const lt=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},st=function(n){return{ID:n}};function A_(n,i){if(1&n&&(t.TgZ(0,"a",33),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("routerLink",t.DdM(3,lt))("queryParams",t.VKq(4,st,e.SupplierPOID)),t.xp6(1),t.Oqu(e.PONumber)}}function q_(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"a",33),t._uU(5),t.qZA(),t.YNc(6,f_,1,0,"br",34),t.YNc(7,A_,2,6,"a",35),t.qZA(),t.TgZ(8,"td"),t._uU(9),t.ALo(10,"date"),t.qZA(),t.TgZ(11,"td"),t._uU(12),t.qZA(),t.TgZ(13,"td",27),t._uU(14),t.ALo(15,"number"),t.qZA(),t.TgZ(16,"td",27),t._uU(17),t.ALo(18,"number"),t.qZA(),t.TgZ(19,"td",27),t._uU(20),t.ALo(21,"number"),t.qZA(),t.TgZ(22,"td",27),t._uU(23),t.ALo(24,"number"),t.qZA(),t.TgZ(25,"td",27),t._uU(26),t.ALo(27,"number"),t.qZA(),t.TgZ(28,"td"),t._uU(29),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.EntityName),t.xp6(2),t.Q6J("routerLink",t.DdM(27,lt))("queryParams",t.VKq(28,st,e.ID)),t.xp6(1),t.Oqu(e.Number),t.xp6(1),t.Q6J("ngIf",o.pageData.DualNumber),t.xp6(1),t.Q6J("ngIf",o.pageData.DualNumber),t.xp6(2),t.Oqu(t.xi3(10,14,e.Date,"dd MMM yyyy")),t.xp6(3),t.Oqu(e.SupplierNameDisplay),t.xp6(2),t.Oqu(t.lcZ(15,17,e.TotalItemQuantity)),t.xp6(3),t.Oqu(t.lcZ(18,19,e.Sales)),t.xp6(3),t.Oqu(t.lcZ(21,21,e.Tax)),t.xp6(3),t.Oqu(t.lcZ(24,23,e.TotalAmount)),t.xp6(3),t.Oqu(t.lcZ(27,25,e.PaymentAmount)),t.xp6(3),t.Oqu(e.PaymentStateLabel)}}function D_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("textChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Number=a})("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,C_,3,0,"a",2),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",3),t.TgZ(5,"div",4),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Outlet"),t.qZA(),t.TgZ(9,"ng-select",5),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"From/To"),t.qZA(),t.TgZ(13,"datepicker",6),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(14,"datepicker",7),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(15,"div"),t.TgZ(16,"h6"),t._uU(17,"Payment"),t.qZA(),t.TgZ(18,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.StateID=a}),t.qZA(),t.qZA(),t.TgZ(19,"div"),t.TgZ(20,"h6"),t._uU(21,"Supplier"),t.qZA(),t.TgZ(22,"autocompleteV2",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SupplierID=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(23,"content"),t.TgZ(24,"div",10),t.TgZ(25,"table",11),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(26,"thead",12),t.TgZ(27,"tr"),t.TgZ(28,"th",13),t._uU(29,"Outlet"),t.qZA(),t.TgZ(30,"th",14),t._uU(31,"Number"),t.qZA(),t.TgZ(32,"th",15),t._uU(33,"Date"),t.qZA(),t.TgZ(34,"th",16),t._uU(35,"Supplier "),t.qZA(),t.TgZ(36,"th",17),t._uU(37,"Qty"),t.qZA(),t.TgZ(38,"th",18),t._uU(39,"Purchase"),t.qZA(),t.TgZ(40,"th",19),t._uU(41,"Tax"),t.qZA(),t.TgZ(42,"th",20),t._uU(43,"Total Amount"),t.qZA(),t.TgZ(44,"th",21),t._uU(45,"Payment"),t.qZA(),t.TgZ(46,"th",22),t._uU(47,"State"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(48,"tbody"),t.YNc(49,q_,30,30,"tr",23),t.qZA(),t.TgZ(50,"tfoot"),t.TgZ(51,"tr",24),t._UZ(52,"td",25),t.TgZ(53,"td",26),t._uU(54,"Total:"),t.qZA(),t.TgZ(55,"td",27),t._uU(56),t.ALo(57,"number"),t.ALo(58,"sum"),t.qZA(),t.TgZ(59,"td",27),t._uU(60),t.ALo(61,"number"),t.ALo(62,"sum"),t.qZA(),t.TgZ(63,"td",27),t._uU(64),t.ALo(65,"number"),t.ALo(66,"sum"),t.qZA(),t.TgZ(67,"td",28),t._uU(68),t.ALo(69,"number"),t.ALo(70,"sum"),t.qZA(),t.TgZ(71,"td",29),t._uU(72),t.ALo(73,"number"),t.ALo(74,"sum"),t.qZA(),t._UZ(75,"td",30),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("text",e.pageData.Filter.Number),t.xp6(2),t.Q6J("ngIf",e.pageData.IsExport),t.xp6(7),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.StateID)("items",null==e.pageData.Options?null:e.pageData.Options.States),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SupplierID)("inputTextValue",e.contactDisplay),t.xp6(27),t.Q6J("ngForOf",e.data.Data),t.xp6(7),t.hij(" ",t.lcZ(57,17,t.xi3(58,19,e.data.Data,"TotalItemQuantity")),""),t.xp6(4),t.hij("",t.lcZ(61,22,t.xi3(62,24,e.data.Data,"Sales"))," "),t.xp6(4),t.hij("",t.lcZ(65,27,t.xi3(66,29,e.data.Data,"Tax"))," "),t.xp6(4),t.hij(" ",t.lcZ(69,32,t.xi3(70,34,e.data.Data,"TotalAmount")),""),t.xp6(4),t.hij(" ",t.lcZ(73,37,t.xi3(74,39,e.data.Data,"PaymentAmount")),"")}}let y_=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/ReportPurchaseSummary","ReportLoader/GetReportPurchaseSummary",null,a),this.httpService=e,this.csvConverter=o,this.url=a}preInitList(){x.gT.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null),x.gT.IsNotEmpty(this.pageData.Filter.SupplierID)&&(this.pageData.Filter.From=x.gT.MinDate),x.gT.IsNotEmpty(this.pageData.SupplierName)&&(this.contactDisplay=this.pageData.SupplierName)}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(a.EntityName=null==a.EntityName?"":a.EntityName,r.EntityName=null==r.EntityName?"":r.EntityName,a.SupplierNameDisplay=null==a.SupplierNameDisplay?"":a.SupplierNameDisplay,r.SupplierNameDisplay=null==r.SupplierNameDisplay?"":r.SupplierNameDisplay,e.active){case"EntityName":return this.compare(a.EntityName.toLocaleLowerCase(),r.EntityName.toLocaleLowerCase(),l);case"Number":return this.compare(a.Number,r.Number,l);case"Date":return this.compare(a.Date,r.Date,l);case"SupplierNameDisplay":return this.compare(a.SupplierNameDisplay.toLocaleLowerCase(),r.SupplierNameDisplay.toLocaleLowerCase(),l);case"TotalItemQuantity":return this.compare(a.TotalItemQuantity,r.TotalItemQuantity,l);case"Total":return this.compare(a.TotalAmount,r.TotalAmount,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"Tax":return this.compare(a.Tax,r.Tax,l);case"PaymentAmount":return this.compare(a.PaymentAmount,r.PaymentAmount,l);case"PaymentState":return this.compare(a.PaymentStateLabel,r.PaymentStateLabel,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-detail-summary"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","text","textChange","onSubmit",4,"ngIf"],[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",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"],["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"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light"],["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",1,"align-right",2,"width","70px"],["mat-sort-header","Sales",1,"align-right",2,"width","118px"],["mat-sort-header","Tax",1,"align-right",2,"width","118px"],["mat-sort-header","Total",1,"align-right",2,"width","118px"],["mat-sort-header","PaymentAmount",1,"align-right",2,"width","118px"],["mat-sort-header","PaymentState",2,"width","70px"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-right","empty-column"],[1,"text-right"],[1,"text-right","text-danger"],[1,"text-right","text-success"],[1,"empty-column"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[3,"routerLink","queryParams"],[4,"ngIf"],[3,"routerLink","queryParams",4,"ngIf"]],template:function(e,o){1&e&&t.YNc(0,D_,76,42,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},directives:[s.O5,d.p,c.w9,p.JJ,p.On,C.QB,D.J,Z.YE,Z.nU,s.sg,u.yS],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function v_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",23),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.exportCSV(a.csvConverter,"ReportExport/TopPurchaseExport","Top_Supplier.csv")}),t._UZ(1,"i",24),t._uU(2,"Export"),t.qZA()}}const S_=function(){return["/menu/Contacts/Contact/Suppliers/Info"]},M_=function(n){return{ID:n}},b_=function(n,i,e){return{SupplierID:n,From:i,To:e}},J_=function(){return["/menu/Reports/Purchases_Report/Summary"]};function O_(n,i){if(1&n&&(t.TgZ(0,"tr",25),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",26),t.TgZ(4,"a",27),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"td",21),t._uU(7),t.qZA(),t.TgZ(8,"td",28),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",21),t.TgZ(12,"a",29),t.ALo(13,"date"),t.ALo(14,"date"),t._uU(15),t.ALo(16,"number"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=i.index,a=t.oxw(2);t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Q6J("routerLink",t.DdM(19,S_))("queryParams",t.VKq(20,M_,e.SupplierID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(10,9,e.Quantity)),t.xp6(3),t.Q6J("queryParams",t.kEZ(22,b_,e.SupplierID,t.xi3(13,11,a.pageData.Filter.From,"ddMMyyyy"),t.xi3(14,14,a.pageData.Filter.To,"ddMMyyyy")))("routerLink",t.DdM(26,J_)),t.xp6(3),t.Oqu(t.lcZ(16,17,e.Total))}}function I_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,v_,3,0,"a",2),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",3),t.TgZ(5,"div",4),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Outlet"),t.qZA(),t.TgZ(9,"ng-select",5),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Group"),t.qZA(),t.TgZ(13,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"From/To"),t.qZA(),t.TgZ(17,"datepicker",7),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(18,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(19,"div"),t.TgZ(20,"h6"),t._uU(21,"Row Count"),t.qZA(),t.TgZ(22,"input",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(23,"content"),t.TgZ(24,"div",10),t.TgZ(25,"table",11),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(26,"thead",12),t.TgZ(27,"tr"),t.TgZ(28,"th",13),t._uU(29,"Rank"),t.qZA(),t.TgZ(30,"th",14),t._uU(31,"Supplier"),t.qZA(),t.TgZ(32,"th",15),t._uU(33,"Code"),t.qZA(),t.TgZ(34,"th",16),t._uU(35,"Quantity"),t.qZA(),t.TgZ(36,"th",17),t._uU(37,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(38,"tbody"),t.YNc(39,O_,17,27,"tr",18),t.qZA(),t.TgZ(40,"tfoot"),t.TgZ(41,"tr",19),t._UZ(42,"th",20),t.TgZ(43,"th",21),t._uU(44,"Total Quantity"),t.qZA(),t.TgZ(45,"th",21),t._uU(46,"Total Purchase"),t.qZA(),t.qZA(),t.TgZ(47,"tr"),t._UZ(48,"td",22),t.TgZ(49,"td",21),t._uU(50),t.qZA(),t.TgZ(51,"td",21),t._uU(52),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.pageData.HasRoleExport),t.xp6(7),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.GroupID)("items",null==e.pageData.Options?null:e.pageData.Options.Group),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount),t.xp6(17),t.Q6J("ngForOf",e.data.Data),t.xp6(11),t.Oqu(e.data.TotalQty),t.xp6(2),t.Oqu(e.data.TotalSales)}}let U_=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/TopSupplier","ReportLoader/TopSupplierLoader"),this.httpService=e,this.csvConverter=o}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Name":return this.compare(a.Name,r.Name,l);case"Code":return this.compare(a.Code,r.Code,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Total":return this.compare(a.Total,r.Total,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-top-supplier"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary",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",3,"date","dateChange"],["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"],[2,"width","35px"],["mat-sort-header","Name"],["mat-sort-header","Code",2,"width","80px"],["mat-sort-header","Quantity",1,"align-right",2,"width","120px"],["mat-sort-header","Total",1,"align-right",2,"width","120px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"thead-light"],["colspan","3",1,"bg-white","border-bottom-0"],[1,"text-right"],["colspan","3",1,"bg-white","border-top-0"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[1,"border-bottom"],[1,"text-left"],[3,"routerLink","queryParams"],[1,"text-right","text-success"],[3,"queryParams","routerLink"]],template:function(e,o){1&e&&t.YNc(0,I_,53,14,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},directives:[s.O5,d.p,c.w9,p.JJ,p.On,C.QB,p.Fj,M.b,Z.YE,Z.nU,s.sg,u.yS],pipes:[s.JJ,s.uU],styles:[""]}),n})();function F_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",21),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.exportCSV(a.csvConverter,"ReportExport/PurchasesByProductExport","Purchases_By_Product.csv")}),t._UZ(1,"i",22),t._uU(2,"Export"),t.qZA()}}const w_=function(n){return{"pl-lg-12":n}},N_=function(n){return[n]},P_=function(n){return{ID:n}};function L_(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td",23),t.TgZ(2,"a",24),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td",20),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td",20),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",20),t._uU(13),t.ALo(14,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngClass",t.VKq(14,w_,!e.IsParent)),t.xp6(1),t.Q6J("routerLink",t.VKq(16,N_,e.IsParent?"/menu/Products/Catalog/Categories/Info":o.pageData.Filter.GroupByProduct?"/menu/Products/Catalog/Products/Info":"/menu/Products/Catalog/Variants/Info"))("queryParams",t.VKq(18,P_,e.IsParent?e.CategoryID:e.ID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(8,8,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(11,10,e.Total)),t.xp6(3),t.Oqu(t.lcZ(14,12,e.LastPurchase))}}function Q_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("textChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Text=a})("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,F_,3,0,"a",2),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",3),t.TgZ(5,"div",4),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Category"),t.qZA(),t.TgZ(9,"ng-select",5),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Currency"),t.qZA(),t.TgZ(13,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"From/To"),t.qZA(),t.TgZ(17,"datepicker",7),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(18,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(19,"div"),t.TgZ(20,"h6"),t._uU(21,"Group By"),t.qZA(),t.TgZ(22,"radio-options",9),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupByProduct=a}),t.qZA(),t.qZA(),t.TgZ(23,"div"),t.TgZ(24,"h6"),t._uU(25,"Brand"),t.qZA(),t.TgZ(26,"autocompleteV2",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.BrandID=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(27,"content"),t.TgZ(28,"div",11),t.TgZ(29,"table",12),t.TgZ(30,"thead",13),t.TgZ(31,"tr"),t.TgZ(32,"th"),t._uU(33,"Name"),t.qZA(),t.TgZ(34,"th",14),t._uU(35,"Code"),t.qZA(),t.TgZ(36,"th",15),t._uU(37,"Quantity"),t.qZA(),t.TgZ(38,"th",16),t._uU(39,"Total"),t.qZA(),t.TgZ(40,"th",15),t._uU(41,"Last Purchase"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(42,"tbody"),t.YNc(43,L_,15,20,"tr",17),t.qZA(),t.TgZ(44,"tfoot"),t.TgZ(45,"tr",18),t._UZ(46,"td",19),t.TgZ(47,"td"),t._uU(48,"Total :"),t.qZA(),t.TgZ(49,"td",20),t._uU(50),t.ALo(51,"number"),t.ALo(52,"sum"),t.qZA(),t.TgZ(53,"td",20),t._uU(54),t.ALo(55,"number"),t.ALo(56,"sum"),t.qZA(),t._UZ(57,"td"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("text",e.pageData.Filter.Text),t.xp6(2),t.Q6J("ngIf",e.pageData.HasExportRole),t.xp6(7),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("model",e.pageData.Filter.GroupByProduct)("options",e.GroupByRadio),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.BrandID),t.xp6(17),t.Q6J("ngForOf",e.data),t.xp6(7),t.hij(" ",t.lcZ(51,15,t.xi3(52,17,e.filterData(e.data,"IsParent",!0),"Quantity"))," "),t.xp6(4),t.hij(" ",t.lcZ(55,20,t.xi3(56,22,e.filterData(e.data,"IsParent",!0),"Total"))," ")}}let Y_=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/PurchasesByProductList","ReportLoader/PurchasesByProductLoader"),this.httpService=e,this.csvConverter=o,this.GroupByRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}]}filterData(e,o,a){return e.filter(function(r){return r[o]==a})}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-product-bought"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","text","textChange","onSubmit",4,"ngIf"],[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary",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"],["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"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","100px"],[1,"text-right",2,"width","120px"],[1,"text-right",2,"width","140px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[1,"text-right"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[3,"ngClass"],[3,"routerLink","queryParams"]],template:function(e,o){1&e&&t.YNc(0,Q_,58,25,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},directives:[s.O5,d.p,c.w9,p.JJ,p.On,C.QB,q.P,D.J,s.sg,s.mk,u.yS],pipes:[s.JJ,T.qU],styles:[""]}),n})();function R_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",8),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.convertToCSV(a.csvConverter,!0,"PurchaseHistory.csv")}),t._UZ(1,"i",9),t._uU(2,"Export"),t.qZA()}}function k_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Product"),t.qZA(),t.TgZ(3,"autocompleteV2",17),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ProductID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.ProductID)("inputTextValue",e.pageData.ProductName)}}function E_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Variant"),t.qZA(),t.TgZ(3,"autocompleteV2",18),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.VariantID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.VariantID)("inputTextValue",e.pageData.VariantName)}}function H_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",10),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Supplier"),t.qZA(),t.TgZ(8,"autocompleteV2",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SupplierID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Scope"),t.qZA(),t.TgZ(12,"radio-options",13),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ByProduct=a})("modelChange",function(){return t.CHM(e),t.oxw().getListData()}),t.qZA(),t.qZA(),t.YNc(13,k_,4,2,"div",14),t.YNc(14,E_,4,2,"div",14),t.TgZ(15,"div"),t.TgZ(16,"h6"),t._uU(17,"From/To"),t.qZA(),t.TgZ(18,"datepicker",15),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(19,"datepicker",16),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SupplierID),t.xp6(4),t.Q6J("model",e.pageData.Filter.ByProduct)("options",e.ScopeRadio),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.ByProduct),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.ByProduct),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function V_(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",19),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Order By"),t.qZA(),t.TgZ(4,"radio-options",20),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.OrderByNumber=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Currency"),t.qZA(),t.TgZ(8,"ng-select",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Brand"),t.qZA(),t.TgZ(12,"autocompleteV2",22),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.BrandID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("model",e.pageData.Filter.OrderByNumber)("options",e.OrderByRadio),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.BrandID)}}function B_(n,i){1&n&&(t.TgZ(0,"th"),t._uU(1,"Product"),t.qZA())}function G_(n,i){1&n&&(t.TgZ(0,"th"),t._uU(1,"Variant"),t.qZA())}function j_(n,i){1&n&&(t.TgZ(0,"th",40),t._uU(1," Measurement"),t.qZA())}function W_(n,i){1&n&&(t.TgZ(0,"th",41),t._uU(1,"Cost"),t.qZA())}function $_(n,i){if(1&n&&(t.TgZ(0,"th",42),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" Total(",e.data.CurrencySymbol,")")}}function K_(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.VariantUnitQuantity),"")}}function X_(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.UnitPrice))}}function z_(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Total))}}const tu=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},eu=function(n){return{ID:n}};function nu(n,i){if(1&n&&(t.TgZ(0,"tr",43),t.TgZ(1,"td"),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td"),t.TgZ(7,"a",44),t._uU(8),t.qZA(),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.qZA(),t.TgZ(11,"td"),t._uU(12),t.qZA(),t.TgZ(13,"td"),t._uU(14),t.qZA(),t._UZ(15,"td",45),t.TgZ(16,"td",38),t._uU(17),t.ALo(18,"number"),t.qZA(),t.YNc(19,K_,3,3,"td",39),t.YNc(20,X_,3,3,"td",39),t.TgZ(21,"td",38),t._uU(22),t.qZA(),t.TgZ(23,"td",38),t._uU(24),t.qZA(),t.YNc(25,z_,3,3,"td",39),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(t.xi3(3,15,e.Date,"dd MMM yyyy")),t.xp6(3),t.Oqu(e.EntityName),t.xp6(2),t.Q6J("routerLink",t.DdM(20,tu))("queryParams",t.VKq(21,eu,e.ID)),t.xp6(1),t.hij(" ",e.Number," "),t.xp6(2),t.Oqu(e.DeliveryStatus),t.xp6(2),t.Oqu(e.SupplierName),t.xp6(2),t.Oqu(e.Name),t.xp6(1),t.Q6J("innerHTML",e.Note,t.oJD),t.xp6(2),t.Oqu(t.lcZ(18,18,e.Quantity)),t.xp6(2),t.Q6J("ngIf",(null==e||null==e.Data?null:e.Data.VariantQuantity)>1),t.xp6(1),t.Q6J("ngIf",o.pageData.HasCostRole),t.xp6(2),t.Oqu(e.Discount>0?e.Discount:""),t.xp6(2),t.Oqu(e.DiscountInvoice>0?e.DiscountInvoice:""),t.xp6(1),t.Q6J("ngIf",o.pageData.HasCostRole)}}function au(n,i){1&n&&t._UZ(0,"td",37)}function ou(n,i){1&n&&t._UZ(0,"td",37)}function ru(n,i){1&n&&t._UZ(0,"td",37)}function iu(n,i){if(1&n&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Total")),"")}}function lu(n,i){if(1&n&&(t.TgZ(0,"div",23),t.TgZ(1,"table",24),t.TgZ(2,"thead",25),t.TgZ(3,"tr"),t.TgZ(4,"th",26),t._uU(5,"Date"),t.qZA(),t.TgZ(6,"th",27),t._uU(7,"Outlet"),t.qZA(),t.TgZ(8,"th",28),t._uU(9,"Invoice"),t.qZA(),t.TgZ(10,"th",27),t._uU(11,"Deliv. State"),t.qZA(),t.TgZ(12,"th"),t._uU(13,"Supplier"),t.qZA(),t.YNc(14,B_,2,0,"th",14),t.YNc(15,G_,2,0,"th",14),t.TgZ(16,"th"),t._uU(17,"Product Note "),t._UZ(18,"br"),t.TgZ(19,"i"),t._uU(20,"Invoice Note"),t.qZA(),t.qZA(),t.TgZ(21,"th",29),t._uU(22,"Qty"),t.qZA(),t.YNc(23,j_,2,0,"th",30),t.YNc(24,W_,2,0,"th",31),t.TgZ(25,"th",29),t._uU(26,"Item(%)"),t.qZA(),t.TgZ(27,"th",29),t._uU(28,"inv(%)"),t.qZA(),t.YNc(29,$_,2,1,"th",32),t.qZA(),t.qZA(),t.TgZ(30,"tbody"),t.YNc(31,nu,26,23,"tr",33),t.qZA(),t.TgZ(32,"tfoot"),t.TgZ(33,"tr",34),t._UZ(34,"td",35),t.YNc(35,au,1,0,"td",36),t._UZ(36,"td",37),t.TgZ(37,"td",38),t._uU(38,"Total :"),t.qZA(),t.TgZ(39,"td",38),t._uU(40),t.ALo(41,"number"),t.ALo(42,"sum"),t.qZA(),t.YNc(43,ou,1,0,"td",36),t.YNc(44,ru,1,0,"td",36),t._UZ(45,"td",37),t._UZ(46,"td",37),t.YNc(47,iu,4,6,"td",39),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(14),t.Q6J("ngIf",e.pageData.Filter.ByProduct),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.ByProduct),t.xp6(8),t.Q6J("ngIf",(null==e.data||null==e.data.Data?null:e.data.Data.VariantQuantity)>1),t.xp6(1),t.Q6J("ngIf",e.pageData.HasCostRole),t.xp6(5),t.Q6J("ngIf",e.pageData.HasCostRole),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(4),t.Q6J("ngIf",!e.pageData.Filter.ByProduct),t.xp6(5),t.Oqu(t.lcZ(41,11,t.xi3(42,13,e.data.Data,"Quantity"))),t.xp6(3),t.Q6J("ngIf",e.pageData.HasCostRole),t.xp6(1),t.Q6J("ngIf",(null==e.data||null==e.data.Data?null:e.data.Data.VariantQuantity)>1),t.xp6(3),t.Q6J("ngIf",e.pageData.HasCostRole)}}let su=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/ProductPurchaseHistory","ReportLoader/ProductPurchaseHistoryLoader",null,a),this.httpService=e,this.csvConverter=o,this.ScopeRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}],this.OrderByRadio=[{Key:!0,Value:"Number"},{Key:!1,Value:"Supplier"}],this.hideMore=!0}preInitList(){x.gT.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=null)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-product-purchase-history"]],features:[t.qOj],decls:12,vars:6,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],["class","container-fluid mt-5",4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","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"],["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,"ml-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"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","100px"],[2,"width","80px"],[2,"width","70px"],[1,"text-right",2,"width","50px"],["style","width: 60px;","class","text-right",4,"ngIf"],["style","width: 75px;","class","text-right",4,"ngIf"],["style","width: 80px;","class","text-right",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","4",1,"empty-column"],["class","empty-column",4,"ngIf"],[1,"empty-column"],[1,"text-right"],["class","text-right",4,"ngIf"],[1,"text-right",2,"width","60px"],[1,"text-right",2,"width","75px"],[1,"text-right",2,"width","80px"],[1,"border-bottom"],[3,"routerLink","queryParams"],[3,"innerHTML"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,R_,3,0,"a",1),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",2),t.YNc(5,H_,20,9,"div",3),t.YNc(6,V_,13,5,"div",4),t.qZA(),t.TgZ(7,"a",5),t.NdJ("click",function(){return o.hideMore=!o.hideMore}),t._uU(8,"More "),t._UZ(9,"i",6),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,lu,48,16,"div",7),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasExportRole),t.xp6(3),t.Q6J("ngIf",o.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!o.hideMore),t.xp6(5),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,D.J,q.P,C.QB,s.sg,u.yS],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function pu(n,i){if(1&n&&(t.TgZ(0,"tr",19),t.TgZ(1,"td"),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"td",16),t._uU(5),t.ALo(6,"number"),t.qZA(),t.TgZ(7,"td",16),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"td",16),t._uU(11),t.ALo(12,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(t.xi3(3,4,e.Date,"EEEE")),t.xp6(3),t.Oqu(t.lcZ(6,7,e.Day)),t.xp6(3),t.Oqu(t.lcZ(9,9,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(12,11,e.PurchaseTotal))}}const _u=function(){return["/menu/Reports/Purchases_Report/Daily_Purchase/Monthly_Purchase"]};function uu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",2),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/DailyPurchaseReport","DailyPurchaseReport.csv")}),t._UZ(3,"i",3),t._uU(4," Export "),t.qZA(),t.TgZ(5,"a",4),t._uU(6,"View Month"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",5),t.TgZ(9,"div",6),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Outlet"),t.qZA(),t.TgZ(13,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Category"),t.qZA(),t.TgZ(17,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Year"),t.qZA(),t.TgZ(21,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(22,"div"),t.TgZ(23,"h6"),t._uU(24,"Month"),t.qZA(),t.TgZ(25,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Month=a}),t.qZA(),t.qZA(),t.TgZ(26,"div"),t.TgZ(27,"h6"),t._uU(28,"Currency"),t.qZA(),t.TgZ(29,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(30,"div"),t.TgZ(31,"h6"),t._uU(32,"Multiply Unit Qty"),t.qZA(),t.TgZ(33,"radio-options",12),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.MultiplyUnitQuantity=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(34,"content"),t.TgZ(35,"div",13),t.TgZ(36,"table",14),t.TgZ(37,"thead",15),t.TgZ(38,"tr"),t.TgZ(39,"th"),t._uU(40,"Day"),t.qZA(),t.TgZ(41,"th",16),t._uU(42,"Dt."),t.qZA(),t.TgZ(43,"th",16),t._uU(44,"Quantity"),t.qZA(),t.TgZ(45,"th",16),t._uU(46,"Purchases"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(47,"tbody"),t.YNc(48,pu,13,13,"tr",17),t.qZA(),t.TgZ(49,"tr"),t.TgZ(50,"td",18),t._uU(51,"Total"),t.qZA(),t.TgZ(52,"td",16),t._uU(53),t.ALo(54,"number"),t.ALo(55,"sum"),t.qZA(),t.TgZ(56,"td",16),t._uU(57),t.ALo(58,"number"),t.ALo(59,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(5),t.Q6J("routerLink",t.DdM(29,_u)),t.xp6(8),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",e.pageData.Options.Currencies),t.xp6(4),t.Q6J("model",e.pageData.Filter.MultiplyUnitQuantity)("options",e.YesNoRadio),t.xp6(15),t.Q6J("ngForOf",e.data),t.xp6(5),t.Oqu(t.lcZ(54,19,t.xi3(55,21,e.data,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(58,24,t.xi3(59,26,e.data,"PurchaseTotal")))}}let gu=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetPurchasePeriodDaily","ReportLoader/GetReportPurchaseDaily"),this.httpService=e,this.csvConverter=o,this.Years=[],this.Months=[],this.YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];const a=new Date;this.Years=x.gT.GenerateYears(a.getFullYear(),11,!0),this.Months=x.gT.Months}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-daily-purchases"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","value","Export","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],["role","button","title","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","w-25"],[1,"thead-light"],[1,"text-right"],["class","border-bottom",4,"ngFor","ngForOf"],["colspan","2",1,"text-right"],[1,"border-bottom"]],template:function(e,o){1&e&&t.YNc(0,uu,60,30,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},directives:[s.O5,d.p,u.yS,c.w9,p.JJ,p.On,q.P,s.sg],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function du(n,i){if(1&n&&(t.TgZ(0,"tr",20),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",16),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",16),t._uU(7),t.ALo(8,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.MonthLabel),t.xp6(2),t.Oqu(t.lcZ(5,3,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(8,5,e.Income))}}const mu=function(){return["/menu/Reports/Purchases_Report/Daily_Purchase"]};function Zu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",2),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/MonthlyPurchaseReport","DailyPurchaseReport.csv")}),t._UZ(3,"i",3),t._uU(4," Export "),t.qZA(),t.TgZ(5,"a",4),t._uU(6,"View Daily"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",5),t.TgZ(9,"div",6),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Outlet"),t.qZA(),t.TgZ(13,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Category"),t.qZA(),t.TgZ(17,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Year"),t.qZA(),t.TgZ(21,"ng-select",9),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(22,"div"),t.TgZ(23,"h6"),t._uU(24,"Currency"),t.qZA(),t.TgZ(25,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.TgZ(26,"div"),t.TgZ(27,"h6"),t._uU(28,"Multiply Unit Qty"),t.qZA(),t.TgZ(29,"radio-options",11),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.MultiplyUnitQuantity=a}),t.qZA(),t.qZA(),t.TgZ(30,"div"),t.TgZ(31,"h6"),t._uU(32,"Supplier"),t.qZA(),t.TgZ(33,"autocompleteV2",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SupplierID=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(34,"content"),t.TgZ(35,"div",13),t.TgZ(36,"table",14),t.TgZ(37,"thead",15),t.TgZ(38,"tr"),t.TgZ(39,"th"),t._uU(40,"Month"),t.qZA(),t.TgZ(41,"th",16),t._uU(42,"Quantity"),t.qZA(),t.TgZ(43,"th",16),t._uU(44,"Purchases"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(45,"tbody"),t.YNc(46,du,9,7,"tr",17),t.qZA(),t.TgZ(47,"tr",18),t.TgZ(48,"td",19),t._uU(49,"Total"),t.qZA(),t.TgZ(50,"td",16),t._uU(51),t.ALo(52,"number"),t.ALo(53,"sum"),t.qZA(),t.TgZ(54,"td",16),t._uU(55),t.ALo(56,"number"),t.ALo(57,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(5),t.Q6J("routerLink",t.DdM(27,mu)),t.xp6(8),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",e.pageData.Options.Currencies),t.xp6(4),t.Q6J("model",e.pageData.Filter.MultiplyUnitQuantity)("options",e.YesNoRadio),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SupplierID),t.xp6(13),t.Q6J("ngForOf",e.data),t.xp6(5),t.Oqu(t.lcZ(52,17,t.xi3(53,19,e.data,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(56,22,t.xi3(57,24,e.data,"Income")))}}let hu=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetPurchasePeriodMonthly","ReportLoader/GetReportPurchaseMonthly"),this.httpService=e,this.csvConverter=o,this.Years=[],this.YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];const a=new Date;this.Years=x.gT.GenerateYears(a.getFullYear(),11,!0)}preGetList(){null===this.pageData.Filter.EntityID&&(this.pageData.Filter.EntityID=x.gT.GuidEmpty)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-monthly-purchase"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","value","Export","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],["role","button","title","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"],[1,"text-right"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","1",1,"text-right"],[1,"border-bottom"]],template:function(e,o){1&e&&t.YNc(0,Zu,58,28,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},directives:[s.O5,d.p,u.yS,c.w9,p.JJ,p.On,q.P,D.J,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function xu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t._UZ(1,"actions"),t.TgZ(2,"filters"),t.TgZ(3,"div",2),t.TgZ(4,"div",3),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Outlet"),t.qZA(),t.TgZ(8,"ng-select",4),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"Category"),t.qZA(),t.TgZ(12,"ng-select",5),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.TgZ(13,"div"),t.TgZ(14,"h6"),t._uU(15,"Year"),t.qZA(),t.TgZ(16,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(17,"content"),t.TgZ(18,"div",7),t._UZ(19,"POS-line-chart",8),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(8),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(3),t.Q6J("config",e.chartConfig)("data",e.ChartData)}}let Tu=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/MonthlyPurchasesVolume","ReportLoader/GetMonthlyPurchaseVolume"),this.httpService=e,this.Years=[],this.ChartData={};const a=new Date;this.Years=x.gT.GenerateYears(a.getFullYear(),11,!0)}preGetList(){null===this.pageData.Filter.EntityID&&(this.pageData.Filter.EntityID=x.gT.GuidEmpty)}preInitList(){this.pageData.Options.Currencies.unshift({ID:0,Symbol:"All"}),this.pageData.Filter.CurrencyID=0}postInit(){const e=[];this.chartConfig={chart:{type:"column"},title:{text:""},credits:{enabled:!1},xAxis:{categories:this.data.MonthName},yAxis:{title:{text:""},stackLabels:{enabled:!0}},plotOptions:{column:{stacking:"normal"}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom"},tooltip:{shared:!0}},this.data.MonthlySalesRank.forEach(o=>{e.push({name:o.Name,data:o.Sales})}),this.ChartData={series:e}}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-volume"]],features:[t.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(e,o){1&e&&t.YNc(0,xu,20,10,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},directives:[s.O5,d.p,c.w9,p.JJ,p.On,J.D],styles:[""]}),n})();function Cu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",19),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.convertToCSV(a.csvConverter,!0,"Purchased_Sales_Report.csv")}),t._UZ(1,"i",20),t._uU(2,"Export"),t.qZA()}}function fu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year/Month"),t.qZA(),t.TgZ(3,"ng-select",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Period=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.Period)("items",null==e.pageData.Options?null:e.pageData.Options.Periods)}}function Au(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",22),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",23),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}const qu=function(){return["/menu/Products/Catalog/Products/Info"]},Du=function(n){return{ID:n}};function yu(n,i){if(1&n&&(t.TgZ(0,"tr",24),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"a",25),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.qZA(),t.TgZ(8,"td",26),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",26),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td",27),t._uU(15),t.ALo(16,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=i.index;t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Q6J("routerLink",t.DdM(14,qu))("queryParams",t.VKq(15,Du,e.ID)),t.xp6(1),t.hij(" ",e.Name," "),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(10,8,e.PurchaseQuantity)),t.xp6(3),t.Oqu(t.lcZ(13,10,e.SellQuantity)),t.xp6(3),t.Oqu(t.lcZ(16,12,e.Ratio))}}function vu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Cu,3,0,"a",2),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",3),t.TgZ(5,"div",4),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Outlet"),t.qZA(),t.TgZ(9,"ng-select",5),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Category"),t.qZA(),t.TgZ(13,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.YNc(14,fu,4,2,"div",7),t.YNc(15,Au,5,2,"div",7),t.TgZ(16,"div"),t.TgZ(17,"h6"),t._uU(18,"Row Count"),t.qZA(),t.TgZ(19,"input",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.TgZ(20,"div"),t.TgZ(21,"h6"),t._uU(22,"Date Filter"),t.qZA(),t.TgZ(23,"radio-options",9),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Predefined=a}),t.qZA(),t.TgZ(24,"h6"),t._uU(25,"Inventory Only"),t.qZA(),t.TgZ(26,"radio-options",10),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.InventoryOnly=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(27,"content"),t.TgZ(28,"div",11),t.TgZ(29,"table",12),t.TgZ(30,"thead",13),t.TgZ(31,"tr"),t.TgZ(32,"th",14),t._uU(33," Now "),t.qZA(),t.TgZ(34,"th",15),t._uU(35,"Name"),t.qZA(),t.TgZ(36,"th",16),t._uU(37,"Code"),t.qZA(),t.TgZ(38,"th",17),t._uU(39,"Purchase"),t.qZA(),t.TgZ(40,"th",17),t._uU(41,"Sold"),t.qZA(),t.TgZ(42,"th",17),t._uU(43,"Sold Percentage(%)"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(44,"tbody"),t.YNc(45,yu,17,17,"tr",18),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.pageData.HasExportRole),t.xp6(7),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.Predefined),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.Predefined),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount),t.xp6(4),t.Q6J("model",e.pageData.Filter.Predefined)("options",e.RadioDateFilterType),t.xp6(3),t.Q6J("model",e.pageData.Filter.InventoryOnly),t.xp6(19),t.Q6J("ngForOf",e.data.Data)}}let Su=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/PruchasedSalesReportList","ReportLoader/PurchaseSalesReportLoader"),this.httpService=e,this.csvConverter=o,this.RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Range"}],this.GroupRadio=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}]}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-sales-report"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","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"],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],[4,"ngIf"],["type","text","autoNum","",3,"ngModel","ngModelChange"],["name","Date Filter",3,"model","options","modelChange"],["name","Inventory",3,"model","modelChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light"],[2,"width","55px"],[2,"width","320px"],[2,"width","100px"],[1,"text-right",2,"width","80px"],["class","border-bottom",4,"ngFor","ngForOf"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"border-bottom"],[3,"routerLink","queryParams"],[1,"text-right"],[1,"text-right","text-success"]],template:function(e,o){1&e&&t.YNc(0,vu,46,14,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},directives:[s.O5,d.p,c.w9,p.JJ,p.On,p.Fj,M.b,q.P,s.sg,C.QB,u.yS],pipes:[s.JJ],styles:[""]}),n})();function Mu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",31),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.exportCSV(a.csvConverter,"ReportExport/OutletPerformancePurchase","Purchases Transaction ["+a.pageData.Filter.From+" - "+a.pageData.Filter.To+"].csv")}),t._UZ(1,"i",32),t._uU(2,"Export"),t.qZA()}}function bu(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Compare with prev Month"),t.qZA(),t.TgZ(3,"radio-options",33),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).Compare=a})("modelChange",function(){return t.CHM(e),t.oxw(2).OnCompare("Data")}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("model",e.Compare)}}function Ju(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",34),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",35),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Ou(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",36),t.TgZ(4,"div",37),t.TgZ(5,"ng-select",38),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Year=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA(),t.TgZ(6,"div",39),t.TgZ(7,"ng-select",40),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Month=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("ngModel",e.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.Month)("items",e.Months)}}function Iu(n,i){1&n&&(t.TgZ(0,"th",41),t._uU(1,"Prev"),t.qZA())}function Uu(n,i){1&n&&(t.TgZ(0,"th",41),t._uU(1,"Now"),t.qZA())}function Fu(n,i){1&n&&(t.TgZ(0,"th",42),t._uU(1,"Trans"),t.qZA())}function wu(n,i){if(1&n&&(t.TgZ(0,"th",43),t._uU(1,"Tax"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet")}}function Nu(n,i){if(1&n&&(t.TgZ(0,"th",43),t._uU(1," Purchase + Tax"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function Pu(n,i){if(1&n&&(t.TgZ(0,"td",46),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.PrevIndex)}}const Lu=function(n,i){return{rankDown:n,rankUp:i,"number key":!0}};function Qu(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.qZA()),2&n){const e=t.oxw(),o=e.$implicit,a=e.index;t.Q6J("ngClass",t.WLB(2,Lu,o.PrevIndex<a+1,o.PrevIndex>a+1)),t.xp6(1),t.hij(" ",o.CurrentIndex," ")}}function Yu(n,i){if(1&n&&(t.TgZ(0,"td",30),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,e.Count,".0-0"))}}function Ru(n,i){if(1&n&&(t.TgZ(0,"td",30),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.Tax,".0-0"),"")}}const ku=function(n,i,e){return{EntityID:n,From:i,To:e}},Eu=function(){return["/menu/Reports/Purchases_Report/Summary"]};function Hu(n,i){if(1&n&&(t.TgZ(0,"td",30),t.TgZ(1,"a",48),t.ALo(2,"date"),t.ALo(3,"date"),t.TgZ(4,"b"),t._uU(5),t.ALo(6,"number"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("queryParams",t.kEZ(12,ku,e.EntityID,t.xi3(2,3,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(3,6,o.pageData.Filter.To,"ddMMyyyy")))("routerLink",t.DdM(16,Eu)),t.xp6(4),t.Oqu(t.xi3(6,9,e.SalesWithTax,".0-0"))}}function Vu(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",27),t._uU(4),t.qZA(),t.YNc(5,Pu,2,1,"td",44),t.YNc(6,Qu,2,5,"td",45),t.YNc(7,Yu,3,4,"td",29),t.TgZ(8,"td",30),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",30),t._uU(12),t.ALo(13,"number"),t.qZA(),t.YNc(14,Ru,3,4,"td",29),t.ALo(15,"HideSumZero"),t.YNc(16,Hu,7,17,"td",29),t.qZA()),2&n){const e=i.$implicit,o=i.index,a=t.oxw(2);t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Oqu(e.Name),t.xp6(1),t.Q6J("ngIf",a.Compare),t.xp6(1),t.Q6J("ngIf",a.Compare),t.xp6(1),t.Q6J("ngIf",!a.data.WithCategory),t.xp6(2),t.Oqu(t.xi3(10,9,e.Quantity,".0-0")),t.xp6(3),t.Oqu(t.xi3(13,12,e.Sales,".0-0")),t.xp6(2),t.Q6J("ngIf",!a.data.WithCategory&&t.xi3(15,15,a.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!a.data.WithCategory)}}function Bu(n,i){1&n&&t._UZ(0,"td",49)}function Gu(n,i){1&n&&t._UZ(0,"td",49)}function ju(n,i){if(1&n&&(t.TgZ(0,"td",30),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Count"),".0-0"),"")}}function Wu(n,i){if(1&n&&(t.TgZ(0,"td",30),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Tax"),".0-0")," ")}}function $u(n,i){if(1&n&&(t.TgZ(0,"td",30),t.TgZ(1,"a"),t._uU(2),t.ALo(3,"number"),t.ALo(4,"sum"),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(2),t.Oqu(t.xi3(3,1,t.xi3(4,4,e.data.Data,"SalesWithTax"),".0-0"))}}const Xu=function(){return["/menu/Reports/Purchases_Report/Outlet_Performance/Outlet_Group_Performance"]},tg=function(){return["/menu/Reports/Purchases_Report/Outlet_Performance/Outlet_Monthly_Perfomance"]};function eg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Mu,3,0,"a",2),t.TgZ(3,"div",3),t.TgZ(4,"a",4),t._uU(5,"By Entity Group"),t.qZA(),t._UZ(6,"button",5),t.TgZ(7,"ul",6),t.TgZ(8,"li",7),t.TgZ(9,"a",8),t._uU(10,"By Month"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",9),t.TgZ(13,"div",10),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Category"),t.qZA(),t.TgZ(17,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Type"),t.qZA(),t.TgZ(21,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(22,"div"),t.TgZ(23,"h6"),t._uU(24,"Date Filter"),t.qZA(),t.TgZ(25,"radio-options",13),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().IsPredefined=a})("modelChange",function(){return t.CHM(e),t.oxw().YearMonthToDateRange()}),t.qZA(),t.qZA(),t.YNc(26,bu,4,1,"div",14),t.YNc(27,Ju,5,2,"div",14),t.YNc(28,Ou,8,4,"div",14),t.TgZ(29,"div"),t.TgZ(30,"h6"),t._uU(31,"Exclude complementary"),t.qZA(),t.TgZ(32,"radio-options",15),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ExcludeComplementary=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(33,"content"),t.TgZ(34,"div",16),t.TgZ(35,"table",17),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(36,"thead",18),t.TgZ(37,"tr"),t.TgZ(38,"th"),t._uU(39,"No."),t.qZA(),t.TgZ(40,"th",19),t._uU(41,"Outlet"),t.qZA(),t.YNc(42,Iu,2,0,"th",20),t.YNc(43,Uu,2,0,"th",20),t.YNc(44,Fu,2,0,"th",21),t.TgZ(45,"th",22),t._uU(46,"Qty"),t.qZA(),t.TgZ(47,"th",23),t._uU(48,"Purchase"),t.qZA(),t.YNc(49,wu,2,1,"th",24),t.ALo(50,"HideSumZero"),t.YNc(51,Nu,2,1,"th",24),t.qZA(),t.qZA(),t.TgZ(52,"tbody"),t.YNc(53,Vu,17,18,"tr",25),t.qZA(),t.TgZ(54,"tfoot"),t.TgZ(55,"tr",26),t._UZ(56,"td"),t._UZ(57,"td",27),t.YNc(58,Bu,1,0,"td",28),t.YNc(59,Gu,1,0,"td",28),t.YNc(60,ju,4,7,"td",29),t.TgZ(61,"td",30),t._uU(62),t.ALo(63,"number"),t.ALo(64,"sum"),t.qZA(),t.TgZ(65,"td",30),t._uU(66),t.ALo(67,"number"),t.ALo(68,"sum"),t.qZA(),t.YNc(69,Wu,4,7,"td",29),t.ALo(70,"HideSumZero"),t.YNc(71,$u,5,7,"td",29),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(46,Xu)),t.xp6(5),t.Q6J("routerLink",t.DdM(47,tg)),t.xp6(8),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(4),t.Q6J("model",e.IsPredefined)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",e.IsPredefined),t.xp6(1),t.Q6J("ngIf",!e.IsPredefined),t.xp6(1),t.Q6J("ngIf",e.IsPredefined),t.xp6(4),t.Q6J("model",e.pageData.Filter.ExcludeComplementary),t.xp6(10),t.Q6J("ngIf",e.Compare),t.xp6(1),t.Q6J("ngIf",e.Compare),t.xp6(1),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(5),t.Q6J("ngIf",!e.data.WithCategory&&t.xi3(50,28,e.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Q6J("ngIf",e.Compare),t.xp6(1),t.Q6J("ngIf",e.Compare),t.xp6(1),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(2),t.Oqu(t.xi3(63,31,t.xi3(64,34,e.data.Data,"Quantity"),".0-0")),t.xp6(4),t.hij(" ",t.xi3(67,37,t.xi3(68,40,e.data.Data,"Sales"),".0-0")," "),t.xp6(3),t.Q6J("ngIf",!e.data.WithCategory&&t.xi3(70,43,e.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!e.data.WithCategory)}}let ng=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/OutletPerformancePurchase","ReportLoader/OutletPurchasePerformance"),this.httpService=e,this.csvConverter=o,this.Compare=!1,this.IsPredefined=!0,this.Comparison=0,this.RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];const a=new Date;this.Years=x.gT.GenerateYears(a.getFullYear(),11,!0),this.Year=a.getFullYear(),this.Month=a.getMonth()+1,this.Months=x.gT.Months,this.Months.forEach(r=>r.Label=r.Label.slice(0,3))}preInitList(){this.YearMonthToDateRange()}YearMonthToDateRange(){const e=new Date;null==this.Year&&(this.Year=e.getFullYear()),null==this.Month&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month-1,1),this.pageData.Filter.To=new Date(this.Year,this.Month,0)}postGetList(){this.Compare&&this.OnCompare("Data")}OnCompare(e){const o=e?this.data[e]:this.data;if(o.length<1)return;const a=Object.assign({},this.pageData.Filter);a.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),a.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(a)).subscribe(r=>{const l=e?r[e]:r;this.Comparison=0,o.forEach(_=>{_.PrevIndex="-",_.CurrentIndex="-",_.Increase="-";const A=l.filter(v=>v.EntityID==_.EntityID);if(_.CurrentIndex=_.Rank,A.length>0){const v=A[0];_.PrevIndex=v.Rank,v.SalesNet?_.Increase=(_.SalesNet-v.SalesNet)/v.SalesNet*100:v.Sales&&(_.Increase=(_.Sales-v.Sales)/v.Sales*100),_.IsPositive=_.Increase>0,_.IsNegative=_.Increase<0,this.Comparison+=_.Increase}})})}sortData(e){const o=this.data.Data.slice();function a(r,l,_){return(r<l?-1:1)*(_?1:-1)}this.data.Data=e.active&&""!==e.direction?o.sort((r,l)=>{const _="asc"===e.direction;switch(r.Name=null==r.Name?"":r.Name,l.Name=null==l.Name?"":l.Name,e.active){case"Name":return a(r.Name.toLocaleLowerCase(),l.Name.toLocaleLowerCase(),_);case"Count":return a(r.Count,l.Count,_);case"SalesWithTax":return a(r.SalesWithTax,l.SalesWithTax,_);case"Quantity":return a(r.Quantity,l.Quantity,_);case"SalesNet":case"SalesTaxNet":return a(r.Sales,l.Sales,_);case"Tax":return a(r.Tax,l.Tax,_);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-outlet-performance"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",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"],["matSort","",1,"table",3,"matSortChange"],[1,"thead-light"],["mat-sort-header","Name",1,"freeze","header"],["style","width: 35px;",4,"ngIf"],["mat-sort-header","Count","class","align-right",4,"ngIf"],["mat-sort-header","Quantity",1,"align-right"],["mat-sort-header","SalesNet",1,"align-right"],["class","align-right",3,"mat-sort-header",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],["class","text-right",4,"ngIf"],[1,"text-right"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],["name","compare",3,"model","modelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","pl-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],[2,"width","35px"],["mat-sort-header","Count",1,"align-right"],[1,"align-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(e,o){1&e&&t.YNc(0,eg,72,48,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},directives:[s.O5,d.p,u.yS,c.w9,p.JJ,p.On,q.P,Z.YE,Z.nU,s.sg,C.QB,s.mk],pipes:[T.aQ,s.JJ,T.qU,s.uU],styles:["table[_ngcontent-%COMP%] {\n width: 100%;\n}\n\n.sticky-top-thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\n top: 0 !important;\n}\n\ndiv.container-fluid.mt-5[_ngcontent-%COMP%] {\n padding-bottom: 1.25rem;\n width: 100%;\n overflow-x: auto;\n}"]}),n})();function ag(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",27),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.exportCSV(a.csvConverter,"ReportExport/OutletGroupPerformancePurchase","Purchases Transaction ["+a.pageData.Filter.From+" - "+a.pageData.Filter.To+"].csv")}),t._UZ(1,"i",28),t._uU(2,"Export"),t.qZA()}}function og(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",32),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(3).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",33),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(3).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(3);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function rg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",34),t.TgZ(4,"div",35),t.TgZ(5,"ng-select",36),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(3).Year=a})("change",function(){return t.CHM(e),t.oxw(3).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(3).Year=null}),t.qZA(),t.qZA(),t.TgZ(6,"div",37),t.TgZ(7,"ng-select",38),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(3).Month=a})("change",function(){return t.CHM(e),t.oxw(3).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(3).Month=null}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(3);t.xp6(5),t.Q6J("ngModel",e.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.Month)("items",e.Months)}}function ig(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Compare with prev Month"),t.qZA(),t.TgZ(3,"radio-options",39),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(3).Compare=a})("modelChange",function(){return t.CHM(e),t.oxw(3).OnCompare()}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(3);t.xp6(3),t.Q6J("model",e.Compare)}}function lg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",29),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Date Filter"),t.qZA(),t.TgZ(4,"radio-options",30),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).IsPredefined=a}),t.qZA(),t.qZA(),t.YNc(5,og,5,2,"div",26),t.YNc(6,rg,8,4,"div",26),t.TgZ(7,"div"),t.TgZ(8,"h6"),t._uU(9,"Type"),t.qZA(),t.TgZ(10,"ng-select",31),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.YNc(11,ig,4,1,"div",26),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("model",e.IsPredefined)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.IsPredefined),t.xp6(1),t.Q6J("ngIf",e.IsPredefined),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(1),t.Q6J("ngIf",e.IsPredefined)}}function sg(n,i){1&n&&(t.TgZ(0,"th",40),t._uU(1,"Prev"),t.qZA())}function pg(n,i){1&n&&(t.TgZ(0,"th",40),t._uU(1,"Now"),t.qZA())}function cg(n,i){1&n&&(t.TgZ(0,"th",41),t._uU(1," \xb1 (%) "),t.qZA())}function _g(n,i){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",e.PrevIndex," ")}}const ug=function(n,i){return{rankDown:n,rankUp:i,"number key":!0}};function gg(n,i){if(1&n&&(t.TgZ(0,"td",45),t._uU(1),t.qZA()),2&n){const e=t.oxw(),o=e.$implicit,a=e.index;t.Q6J("ngClass",t.WLB(2,ug,o.PrevIndex<a+1,o.PrevIndex>a+1)),t.xp6(1),t.hij(" ",o.CurrentIndex," ")}}const dg=function(n,i){return{"text-danger":n,"text-success":i,"text-right":!0}};function mg(n,i){if(1&n&&(t.TgZ(0,"td",46),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",t.WLB(5,dg,e.IsNegative,e.IsPositive)),t.xp6(1),t.hij(" ",t.xi3(2,2,e.Increase,".0-0")," ")}}function Zg(n,i){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,_g,2,1,"td",14),t.YNc(2,gg,2,5,"td",42),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",43),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",25),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td",25),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td",25),t._uU(15),t.ALo(16,"number"),t.qZA(),t.TgZ(17,"td",25),t._uU(18),t.ALo(19,"number"),t.qZA(),t.YNc(20,mg,3,8,"td",44),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngIf",o.Compare),t.xp6(1),t.Q6J("ngIf",o.Compare),t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(t.xi3(7,9,e.Count,".0-0")),t.xp6(3),t.Oqu(t.xi3(10,12,e.Quantity,".0-0")),t.xp6(3),t.Oqu(t.xi3(13,15,e.Sales,".0-0")),t.xp6(3),t.Oqu(t.xi3(16,18,e.Tax,".0-0")),t.xp6(3),t.hij(" ",t.xi3(19,21,e.SalesWithTax,".0-0")," "),t.xp6(2),t.Q6J("ngIf",o.Compare)}}function hg(n,i){1&n&&t._UZ(0,"td",24)}function xg(n,i){1&n&&t._UZ(0,"td",24)}function Tg(n,i){1&n&&t._UZ(0,"td")}const Cg=function(){return["/menu/Reports/Purchases_Report/Outlet_Performance"]},Ag=function(){return["/menu/Reports/Purchases_Report/Outlet_Performance/Outlet_Monthly_Perfomance"]};function qg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,ag,3,0,"a",2),t.TgZ(3,"div",3),t.TgZ(4,"a",4),t._uU(5,"By Entity"),t.qZA(),t._UZ(6,"button",5),t.TgZ(7,"ul",6),t.TgZ(8,"li",7),t.TgZ(9,"a",8),t._uU(10,"By Month"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",9),t.YNc(13,lg,12,7,"div",10),t.qZA(),t.qZA(),t.TgZ(14,"content"),t.TgZ(15,"div",11),t.TgZ(16,"table",12),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(17,"thead",13),t.TgZ(18,"tr"),t.YNc(19,sg,2,0,"th",14),t.YNc(20,pg,2,0,"th",14),t.TgZ(21,"th",15),t._uU(22,"Outlet"),t.qZA(),t.TgZ(23,"th",16),t._uU(24,"Trans"),t.qZA(),t.TgZ(25,"th",17),t._uU(26,"Quantity"),t.qZA(),t.TgZ(27,"th",18),t._uU(28,"Purchase"),t.qZA(),t.TgZ(29,"th",19),t._uU(30,"Tax"),t.qZA(),t.TgZ(31,"th",19),t._uU(32,"Purchase + Tax"),t.qZA(),t.YNc(33,cg,2,0,"th",20),t.qZA(),t.qZA(),t.TgZ(34,"tbody"),t.YNc(35,Zg,21,24,"tr",21),t.qZA(),t.TgZ(36,"tfoot"),t.TgZ(37,"tr",22),t.YNc(38,hg,1,0,"td",23),t.YNc(39,xg,1,0,"td",23),t._UZ(40,"td",24),t.TgZ(41,"td",25),t._uU(42),t.ALo(43,"number"),t.ALo(44,"sum"),t.qZA(),t.TgZ(45,"td",25),t._uU(46),t.ALo(47,"number"),t.ALo(48,"sum"),t.qZA(),t.TgZ(49,"td",25),t._uU(50),t.ALo(51,"number"),t.ALo(52,"sum"),t.qZA(),t.TgZ(53,"td",25),t._uU(54),t.ALo(55,"number"),t.ALo(56,"sum"),t.qZA(),t.TgZ(57,"td",25),t.TgZ(58,"a"),t._uU(59),t.ALo(60,"number"),t.ALo(61,"sum"),t.qZA(),t.qZA(),t.YNc(62,Tg,1,0,"td",26),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.pageData.HasRoleExport),t.xp6(2),t.Q6J("routerLink",t.DdM(50,Cg)),t.xp6(5),t.Q6J("routerLink",t.DdM(51,Ag)),t.xp6(4),t.Q6J("ngIf",e.pageData.Filter),t.xp6(6),t.Q6J("ngIf",e.Compare),t.xp6(1),t.Q6J("ngIf",e.Compare),t.xp6(9),t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet"),t.xp6(2),t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet"),t.xp6(2),t.Q6J("ngIf",e.Compare),t.xp6(2),t.Q6J("ngForOf",e.data),t.xp6(3),t.Q6J("ngIf",e.Compare),t.xp6(1),t.Q6J("ngIf",e.Compare),t.xp6(3),t.Oqu(t.xi3(43,20,t.xi3(44,23,e.data,"Count"),".0-0")),t.xp6(4),t.Oqu(t.xi3(47,26,t.xi3(48,29,e.data,"Quantity"),".0-0")),t.xp6(4),t.hij(" ",t.xi3(51,32,t.xi3(52,35,e.data,"Sales"),".0-0")," "),t.xp6(4),t.hij(" ",t.xi3(55,38,t.xi3(56,41,e.data,"Tax"),".0-0")," "),t.xp6(5),t.Oqu(t.xi3(60,44,t.xi3(61,47,e.data,"SalesWithTax"),".0-0")),t.xp6(3),t.Q6J("ngIf",e.Compare)}}let Dg=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/OutletGroupPerformancePurchase","ReportLoader/OutletPurchasePerformance"),this.httpService=e,this.csvConverter=o,this.Compare=!1,this.IsPredefined=!0,this.Comparison=0,this.RadioDateFilterType=[{Key:!0,Value:"Predefined"},{Key:!1,Value:"Range"}],this.first=!0,this.YesNoRadio=[{Key:!0,Value:"Yes"},{Key:!1,Value:"No"}];const a=new Date;this.Years=x.gT.GenerateYears(a.getFullYear(),11,!0),this.Year=a.getFullYear(),this.Month=a.getMonth(),this.Months=x.gT.Months,this.Months.forEach(r=>r.Label=r.Label.slice(0,3))}preGetList(){this.first&&(this.YearMonthToDateRange(),this.first=!1)}postInit(){this.Compare&&this.OnCompare()}OnCompare(e){const o=e?this.data[e]:this.data;if(o.length<1)return;const a=Object.assign({},this.pageData.Filter);new Date,a.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),a.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(a)).subscribe(l=>{const _=e?l[e]:l;this.Comparison=0,o.forEach(A=>{A.PrevIndex="-",A.CurrentIndex="-",A.Increase="-";const v=_.filter(b=>b.EntityID==A.EntityID);if(A.CurrentIndex=A.Rank,v.length>0){const b=v[0];A.PrevIndex=b.Rank,b.SalesNet?A.Increase=(A.SalesNet-b.SalesNet)/b.SalesNet*100:b.Sales&&(A.Increase=(A.Sales-b.Sales)/b.Sales*100),A.IsPositive=A.Increase>0,A.IsNegative=A.Increase<0,this.Comparison+=A.Increase}})})}YearMonthToDateRange(){const e=new Date;null==this.Year&&(this.Year=e.getFullYear()),null==this.Month&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0)}sortData(e){const o=this.data.slice();this.data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Name":return this.compare(a.Name,r.Name,l);case"Count":return this.compare(a.Count,r.Count,l);case"SalesWithTax":return this.compare(a.SalesWithTax,r.SalesWithTax,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Sales":case"SalesNet":case"SalesTaxNet":return this.compare(a.Sales,r.Sales,l);case"Tax":return this.compare(a.Tax,r.Tax,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-outlet-group-performance"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",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"],["style","width: 35px;",4,"ngIf"],["mat-sort-header","Name"],["mat-sort-header","Count",1,"align-right",2,"width","70px"],["mat-sort-header","Quantity",1,"align-right",2,"width","70px"],["mat-sort-header","Sales",1,"align-right",2,"width","120px"],[1,"align-right",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-right"],[4,"ngIf"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","pl-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-right",2,"width","70px"],[3,"ngClass",4,"ngIf"],[2,"width","35px",3,"ngClass"],[3,"ngClass"]],template:function(e,o){1&e&&t.YNc(0,qg,63,52,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},directives:[s.O5,d.p,u.yS,Z.YE,Z.nU,s.sg,q.P,c.w9,p.JJ,p.On,C.QB,s.mk],pipes:[s.JJ,T.qU],styles:[""]}),n})();function yg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",17),t.NdJ("click",function(){t.CHM(e);const a=t.oxw(2);return a.convertToCSV(a.csvConverter,!0,"Monthly Outlet Performance ["+a.pageData.Filter.From+" - "+a.pageData.Filter.To+"].csv")}),t._UZ(1,"i",18),t._uU(2,"Export"),t.qZA()}}function vg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",19),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Year"),t.qZA(),t.TgZ(4,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Type"),t.qZA(),t.TgZ(8,"ng-select",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types)}}function Sg(n,i){if(1&n&&(t.TgZ(0,"th",22),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.Q6J("mat-sort-header",e),t.xp6(1),t.Oqu(e)}}function Mg(n,i){if(1&n&&(t.TgZ(0,"p",24),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(1),t.Oqu(o[e])}}function bg(n,i){if(1&n&&(t.TgZ(0,"p",24),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,o[e]))}}function Jg(n,i){if(1&n&&(t.TgZ(0,"td"),t.YNc(1,Mg,2,1,"p",23),t.YNc(2,bg,3,3,"p",23),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Q6J("ngIf","Outlet"==e),t.xp6(1),t.Q6J("ngIf","Outlet"!=e)}}function Og(n,i){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,Jg,3,2,"td",15),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",o.getKey(e))}}function Ig(n,i){if(1&n&&(t.TgZ(0,"td",26),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e))}}function Ug(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",25),t.TgZ(2,"td",26),t._uU(3,"Total : "),t.qZA(),t.YNc(4,Ig,3,3,"td",27),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(4),t.Q6J("ngForOf",e.data.DataFooter)}}const Fg=function(){return["/menu/Reports/Purchases_Report/Outlet_Performance"]},Ng=function(){return["/menu/Reports/Purchases_Report/Outlet_Performance/Outlet_Group_Performance"]};function Pg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,yg,3,0,"a",2),t.TgZ(3,"div",3),t.TgZ(4,"a",4),t._uU(5,"By Entity"),t.qZA(),t._UZ(6,"button",5),t.TgZ(7,"ul",6),t.TgZ(8,"li",7),t.TgZ(9,"a",8),t._uU(10,"By Entity Group"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(11,"filters"),t.TgZ(12,"div",9),t.YNc(13,vg,9,4,"div",10),t.qZA(),t.qZA(),t.TgZ(14,"content"),t.TgZ(15,"div",11),t.TgZ(16,"table",12),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(17,"thead",13),t.TgZ(18,"tr"),t.YNc(19,Sg,2,2,"th",14),t.qZA(),t.qZA(),t.TgZ(20,"tbody"),t.YNc(21,Og,2,1,"tr",15),t.qZA(),t.YNc(22,Ug,5,1,"tfoot",16),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",e.pageData.HasExportRole),t.xp6(2),t.Q6J("routerLink",t.DdM(9,Fg)),t.xp6(5),t.Q6J("routerLink",t.DdM(10,Ng)),t.xp6(4),t.Q6J("ngIf",e.pageData.Filter),t.xp6(6),t.Q6J("ngForOf",e.data.Dataheader),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.Data.length>0)}}let Lg=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/MonthlyOutletPerformancePurchase","ReportLoader/MonthlyReportPurchase"),this.httpService=e,this.csvConverter=o;const a=new Date;this.Years=x.gT.GenerateYears(a.getFullYear(),11,!0)}getKey(e){return Object.keys(e)}sortData(e){const o=this.data.Data.slice();function a(r,l,_){return(r<l?-1:1)*(_?1:-1)}this.data.Data=e.active&&""!==e.direction?o.sort((r,l)=>{const _="asc"===e.direction;for(let A=0;A<this.data.Dataheader.length;A++)if(e.active==this.data.Dataheader[A])return"string"==typeof r[this.data.Dataheader[A]]?a(r[this.data.Dataheader[A]].toLocaleLowerCase(),l[this.data.Dataheader[A]].toLocaleLowerCase(),_):a(r[this.data.Dataheader[A]],l[this.data.Dataheader[A]],_)}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-outlet-monthly-performance"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export","class","btn btn-outline-secondary mr-6",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"routerLink"],["data-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu","dropdown-menu-right",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"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","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"],[1,""],["class","",4,"ngFor","ngForOf"]],template:function(e,o){1&e&&t.YNc(0,Pg,23,11,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},directives:[s.O5,d.p,u.yS,Z.YE,s.sg,c.w9,p.JJ,p.On,Z.nU],pipes:[s.JJ],styles:[""]}),n})();function Qg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",5),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/CitySalesExport","CitySalesReport.csv")}),t._UZ(1,"i",6),t._uU(2,"Export"),t.qZA()}}function Yg(n,i){if(1&n&&(t.TgZ(0,"span",13),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Rg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Category"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(5,Yg,2,2,"ng-template",9),t.qZA(),t.qZA(),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"From/To"),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(10,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.to=a}),t.qZA(),t.qZA(),t.TgZ(11,"div"),t.TgZ(12,"h6"),t._uU(13,"Currency"),t.qZA(),t.TgZ(14,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CurrencyID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.to),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CurrencyID)("items",null==e.pageData.Options?null:e.pageData.Options.Currencies)}}function kg(n,i){if(1&n&&(t.TgZ(0,"tr"),t._UZ(1,"td",25),t._UZ(2,"td",25),t._UZ(3,"td",26),t.ALo(4,"number"),t._UZ(5,"td",26),t.ALo(6,"number"),t._UZ(7,"td",26),t.ALo(8,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Q6J("innerHtml",e.CityCode,t.oJD),t.xp6(1),t.Q6J("innerHtml",e.CityName,t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(4,5,e.Quantity),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(6,7,e.Total),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(8,9,e.Average),t.oJD)}}function Eg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",14),t.TgZ(1,"table",15),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",16),t.TgZ(3,"tr"),t.TgZ(4,"th",17),t._uU(5,"Code"),t.qZA(),t.TgZ(6,"th",18),t._uU(7,"Regional Name"),t.qZA(),t.TgZ(8,"th",19),t._uU(9,"Quantity"),t.qZA(),t.TgZ(10,"th",20),t._uU(11,"Total"),t.qZA(),t.TgZ(12,"th",21),t._uU(13,"Avg. Price"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"tbody"),t.YNc(15,kg,9,11,"tr",22),t.qZA(),t.TgZ(16,"tfoot"),t.TgZ(17,"tr",23),t._UZ(18,"td",24),t.TgZ(19,"td",24),t._uU(20,"Total :"),t.qZA(),t.TgZ(21,"td",24),t._uU(22),t.ALo(23,"number"),t.ALo(24,"sum"),t.qZA(),t.TgZ(25,"td",24),t._uU(26),t.ALo(27,"number"),t.ALo(28,"sum"),t.qZA(),t.TgZ(29,"td",24),t._uU(30),t.ALo(31,"number"),t.ALo(32,"sum"),t.ALo(33,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(15),t.Q6J("ngForOf",e.data.List),t.xp6(7),t.Oqu(t.lcZ(23,4,t.xi3(24,6,e.data.List,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(27,9,t.xi3(28,11,e.data.List,"Total"))),t.xp6(4),t.hij(" ",t.lcZ(31,14,t.xi3(32,16,e.data.List,"Total")/t.xi3(33,19,e.data.List,"Quantity"))," ")}}let Hg=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/CitySales","ReportLoader/CitySalesLoader",o),this.httpService=e,this.csvConverter=a}postInit(e){this.menuData.H=e.PageTitle}sortData(e){const o=this.data.List.slice();this.data.List=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"CityCode":return this.compare(a.CityCode,r.CityCode,l);case"CityName":return this.compare(a.CityName,r.CityName,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Average":return this.compare(a.Average,r.Average,l);case"Total":return this.compare(a.Total,r.Total,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-city"]],features:[t.qOj],decls:8,vars:5,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","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","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],["container",""],["bindLabel","Value","bindValue","Key","placeholder","Choose a Category",3,"ngModel","items","ngModelChange"],["ng-option-tmp",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["bindLabel","Symbol","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],[3,"title"],[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",1,"align-right",2,"width","70px"],["mat-sort-header","Total",1,"align-right",2,"width","100px"],["mat-sort-header","Average",1,"align-right",2,"width","100px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right"],[3,"innerHtml"],[1,"text-right",3,"innerHtml"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Qg,3,0,"a",1),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",2),t.YNc(5,Rg,15,6,"div",3),t.qZA(),t.qZA(),t.TgZ(6,"content"),t.YNc(7,Eg,34,22,"div",4),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",null==o.pageData.Role?null:o.pageData.Role.HasExportRole),t.xp6(3),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,c.ir,C.QB,Z.YE,Z.nU,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function Vg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.from=a}),t.qZA(),t.TgZ(9,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.to=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.from),t.xp6(1),t.Q6J("date",e.pageData.Filter.to)}}const Bg=function(n,i,e,o){return{SalesTypeID:n,OutletID:i,From:e,To:o}},Gg=function(n){return["/menu/Reports/Sales_Report/Standard/Detail",n]};function jg(n,i){if(1&n&&(t.TgZ(0,"tr"),t._UZ(1,"td",22),t._UZ(2,"td",23),t.ALo(3,"number"),t._UZ(4,"td",23),t.ALo(5,"number"),t.TgZ(6,"td",18),t.TgZ(7,"a",24),t.ALo(8,"date"),t.ALo(9,"date"),t._uU(10),t.ALo(11,"number"),t.qZA(),t.qZA(),t._UZ(12,"td",25),t.ALo(13,"number"),t._UZ(14,"td",26),t.ALo(15,"number"),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("innerHtml",e.Name,t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(3,7,e.Count),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(5,9,e.Quantity),t.oJD),t.xp6(3),t.Q6J("routerLink",t.VKq(28,Gg,t.l5B(23,Bg,e.TypeID,o.getOutletID(),t.xi3(8,11,o.getFrom(),"ddMMyyyy"),t.xi3(9,14,o.getTo(),"ddMMyyyy")))),t.xp6(3),t.Oqu(t.lcZ(11,17,e.Gross)),t.xp6(2),t.Q6J("innerHtml",t.lcZ(13,19,e.Sales),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(15,21,e.Cost),t.oJD)}}function Wg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",10),t.TgZ(1,"table",11),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",12),t.TgZ(3,"tr"),t.TgZ(4,"th",13),t._uU(5,"Type Name"),t.qZA(),t.TgZ(6,"th",14),t._uU(7,"Trans"),t.qZA(),t.TgZ(8,"th",15),t._uU(9,"Quantity"),t.qZA(),t.TgZ(10,"th",15),t._uU(11,"Gross"),t.qZA(),t.TgZ(12,"th",15),t._uU(13,"Sales"),t.qZA(),t.TgZ(14,"th",15),t._uU(15,"Cost"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(16,"tbody"),t.YNc(17,jg,16,30,"tr",16),t.qZA(),t.TgZ(18,"tfoot"),t.TgZ(19,"tr",17),t._UZ(20,"td",18),t.TgZ(21,"td",18),t._uU(22),t.ALo(23,"number"),t.ALo(24,"sum"),t.qZA(),t.TgZ(25,"td",18),t._uU(26),t.ALo(27,"number"),t.ALo(28,"sum"),t.qZA(),t.TgZ(29,"td",19),t.TgZ(30,"a"),t._uU(31),t.ALo(32,"number"),t.ALo(33,"sum"),t.qZA(),t.qZA(),t.TgZ(34,"td",20),t._uU(35),t.ALo(36,"number"),t.ALo(37,"sum"),t.qZA(),t.TgZ(38,"td",21),t._uU(39),t.ALo(40,"number"),t.ALo(41,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(17),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Oqu(t.lcZ(23,6,t.xi3(24,8,e.data.Data,"Count"))),t.xp6(4),t.Oqu(t.lcZ(27,11,t.xi3(28,13,e.data.Data,"Quantity"))),t.xp6(5),t.Oqu(t.lcZ(32,16,t.xi3(33,18,e.data.Data,"Gross"))),t.xp6(4),t.Oqu(t.lcZ(36,21,t.xi3(37,23,e.data.Data,"Sales"))),t.xp6(4),t.Oqu(t.lcZ(40,26,t.xi3(41,28,e.data.Data,"Cost")))}}let $g=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/TypeSales","ReportLoader/TypeSalesLoader",o),this.httpService=e,this.csvConverter=a;const r=new Date;this.month=r.getMonth(),this.year=r.getFullYear()}postInit(e){this.menuData.H=e.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(e){const o=this.data.List.slice();this.data.List=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"TypeName":return this.compare(a.TypeName,r.TypeName,l);case"Trans":return this.compare(a.Trans,r.Trans,l);case"Quality":return this.compare(a.Quality,r.Quality,l);case"Gross":return this.compare(a.Gross,r.Gross,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"Cost":return this.compare(a.Cost,r.Cost,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-type"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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"],["name","From",3,"date","dateChange"],["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-right",2,"width","70px"],[1,"text-right",2,"width","120px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right"],[1,"text-right","text-primary"],[1,"text-right","text-success"],[1,"text-right","text-danger"],[3,"innerHtml"],[1,"text-right",3,"innerHtml"],[3,"routerLink"],[1,"text-right","text-success",3,"innerHtml"],[1,"text-right","text-danger",3,"innerHtml"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,o.data.Data,"TypeSalesReport.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,Vg,10,4,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,Wg,42,31,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,C.QB,Z.YE,s.sg,u.yS],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function Kg(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Xg(n,i){1&n&&(t.TgZ(0,"th",15),t._uU(1,"Profit"),t.qZA())}function zg(n,i){if(1&n&&(t.TgZ(0,"tr"),t._UZ(1,"td",22),t._UZ(2,"td",23),t.ALo(3,"number"),t._UZ(4,"td",23),t.ALo(5,"number"),t._UZ(6,"td",23),t.ALo(7,"number"),t._UZ(8,"td",24),t.ALo(9,"number"),t._UZ(10,"td",25),t.ALo(11,"number"),t._UZ(12,"td",24),t.ALo(13,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Q6J("innerHtml",e.GroupName,t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(3,7,e.Count),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(5,9,e.Quantity),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(7,11,e.Gross),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(9,13,e.Sales),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(11,15,e.Cost),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(13,17,e.Profit),t.oJD)}}function td(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",10),t.TgZ(1,"table",11),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",12),t.TgZ(3,"tr"),t.TgZ(4,"th",13),t._uU(5,"Group Name"),t.qZA(),t.TgZ(6,"th",14),t._uU(7,"Trans"),t.qZA(),t.TgZ(8,"th",15),t._uU(9,"Quantity"),t.qZA(),t.TgZ(10,"th",15),t._uU(11,"Gross"),t.qZA(),t.TgZ(12,"th",15),t._uU(13,"Sales"),t.qZA(),t.TgZ(14,"th",15),t._uU(15,"Cost"),t.qZA(),t.YNc(16,Xg,2,0,"th",16),t.qZA(),t.qZA(),t.TgZ(17,"tbody"),t.YNc(18,zg,14,19,"tr",17),t.qZA(),t.TgZ(19,"tfoot"),t.TgZ(20,"tr",18),t._UZ(21,"td",19),t.TgZ(22,"td",19),t._uU(23),t.ALo(24,"number"),t.ALo(25,"sum"),t.qZA(),t.TgZ(26,"td",19),t._uU(27),t.ALo(28,"number"),t.ALo(29,"sum"),t.qZA(),t.TgZ(30,"td",19),t._uU(31),t.ALo(32,"number"),t.ALo(33,"sum"),t.qZA(),t.TgZ(34,"td",20),t._uU(35),t.ALo(36,"number"),t.ALo(37,"sum"),t.qZA(),t.TgZ(38,"td",21),t._uU(39),t.ALo(40,"number"),t.ALo(41,"sum"),t.qZA(),t.TgZ(42,"td",20),t._uU(43),t.ALo(44,"number"),t.ALo(45,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(16),t.Q6J("ngIf",!e.pageData.HasRole),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Oqu(t.lcZ(24,8,t.xi3(25,10,e.data.Data,"Count"))),t.xp6(4),t.Oqu(t.lcZ(28,13,t.xi3(29,15,e.data.Data,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(32,18,t.xi3(33,20,e.data.Data,"Gross"))),t.xp6(4),t.Oqu(t.lcZ(36,23,t.xi3(37,25,e.data.Data,"Sales"))),t.xp6(4),t.Oqu(t.lcZ(40,28,t.xi3(41,30,e.data.Data,"Cost"))),t.xp6(4),t.Oqu(t.lcZ(44,33,t.xi3(45,35,e.data.Data,"Profit")))}}let ed=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/CustomerGroup","ReportLoader/CustomerGroupLoader",o),this.httpService=e,this.csvConverter=a,this.first=!0}preGetList(){if(this.first){const e=new Date,o=e.getMonth(),a=e.getFullYear();this.pageData.Filter.From=new Date(a,o,1).toDateString(),this.pageData.Filter.To=new Date(a,o+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){const o=new Date,a=o.getMonth(),r=o.getFullYear();this.pageData.Filter.From=new Date(r,a,1),this.pageData.Filter.To=new Date(r,a+1,0),this.first=!1}}sortData(e){const o=this.data.List.slice();this.data.List=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"GroupName":return this.compare(a.GroupName,r.GroupName,l);case"Trans":return this.compare(a.Trans,r.Trans,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Gross":return this.compare(a.Gross,r.Gross,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"Cost":return this.compare(a.Cost,r.Cost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-customer-group"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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"],["name","From",3,"date","dateChange"],["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-right",2,"width","70px"],[1,"text-right",2,"width","120px"],["style","width: 120px;","class","text-right",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right"],[1,"text-right","text-success"],[1,"text-right","text-danger"],[3,"innerHtml"],[1,"text-right",3,"innerHtml"],[1,"text-right","text-success",3,"innerHtml"],[1,"text-right","text-danger",3,"innerHtml"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,o.data.Data,"CustomerGroupSalesReport.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,Kg,10,4,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,td,46,38,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,C.QB,Z.YE,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function nd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",5),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/SalesGroup","SalesGroupPerformance.csv")}),t._UZ(1,"i",6),t._uU(2,"Export"),t.qZA()}}function ad(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function od(n,i){1&n&&(t.TgZ(0,"th",15),t._uU(1,"Profit"),t.qZA())}function rd(n,i){if(1&n&&(t._UZ(0,"td",25),t.ALo(1,"number")),2&n){const e=t.oxw().$implicit;t.Q6J("innerHtml",t.lcZ(1,1,e.ActualProfit),t.oJD)}}function id(n,i){if(1&n&&(t.TgZ(0,"tr"),t._UZ(1,"td",22),t._UZ(2,"td",23),t.ALo(3,"number"),t._UZ(4,"td",23),t.ALo(5,"number"),t._UZ(6,"td",23),t.ALo(7,"number"),t._UZ(8,"td",23),t.YNc(9,rd,2,3,"td",24),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("innerHtml",e.Name,t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(3,6,e.InvoiceCount),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(5,8,e.NetRevenue),t.oJD),t.xp6(2),t.Q6J("innerHtml",t.lcZ(7,10,e.SalesTarget),t.oJD),t.xp6(2),t.Q6J("innerHtml",e.Percentage+"%",t.oJD),t.xp6(1),t.Q6J("ngIf",!o.pageData.HasRole)}}function ld(n,i){if(1&n&&(t.TgZ(0,"td",20),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"ActualProfit")),"")}}function sd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",11),t.TgZ(1,"table",12),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",13),t.TgZ(3,"tr",14),t.TgZ(4,"th"),t._uU(5,"Group Name"),t.qZA(),t.TgZ(6,"th",15),t._uU(7,"Count"),t.qZA(),t.TgZ(8,"th",15),t._uU(9,"Actual"),t.qZA(),t.TgZ(10,"th",15),t._uU(11,"Target"),t.qZA(),t.TgZ(12,"th",15),t._uU(13,"Percentage"),t.qZA(),t.YNc(14,od,2,0,"th",16),t.qZA(),t.qZA(),t.TgZ(15,"tbody"),t.YNc(16,id,10,12,"tr",17),t.qZA(),t.TgZ(17,"tfoot"),t.TgZ(18,"tr",18),t._UZ(19,"td",19),t._UZ(20,"td",19),t.TgZ(21,"td",20),t._uU(22),t.ALo(23,"number"),t.ALo(24,"sum"),t.qZA(),t._UZ(25,"td",19),t._UZ(26,"td",19),t.YNc(27,ld,4,6,"td",21),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(14),t.Q6J("ngIf",!e.pageData.HasRole),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(6),t.Oqu(t.lcZ(23,4,t.xi3(24,6,e.data.Data,"GrossRevenue"))),t.xp6(5),t.Q6J("ngIf",!e.pageData.HasRole)}}let pd=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/SalesGroup","ReportLoader/SalesGroupLoader",o),this.httpService=e,this.csvConverter=a,this.first=!0}preGetList(){if(this.first){const e=new Date,o=e.getMonth(),a=e.getFullYear();this.pageData.Filter.From=new Date(a,o,1).toDateString(),this.pageData.Filter.To=new Date(a,o+1,0).toDateString()}}postInit(e){if(this.menuData.H=e.PageTitle,this.first){const o=new Date,a=o.getMonth(),r=o.getFullYear();this.pageData.Filter.From=new Date(r,a,1),this.pageData.Filter.To=new Date(r,a+1,0),this.first=!1}}sortData(e){const o=this.data.List.slice();e.active&&""!==e.direction||(this.data.List=o)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-sales-group"]],features:[t.qOj],decls:8,vars:5,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","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","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-right",2,"width","120px"],["style","width: 120px;","class","text-right",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right","empty-column"],[1,"text-right"],["class","text-right ",4,"ngIf"],[3,"innerHtml"],[1,"text-right",3,"innerHtml"],["class","text-right text-success",3,"innerHtml",4,"ngIf"],[1,"text-right","text-success",3,"innerHtml"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,nd,3,0,"a",1),t.qZA(),t.TgZ(3,"filters"),t.TgZ(4,"div",2),t.YNc(5,ad,10,4,"div",3),t.qZA(),t.qZA(),t.TgZ(6,"content"),t.YNc(7,sd,28,9,"div",4),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasExportRole),t.xp6(3),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,C.QB,Z.YE,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function cd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListIDs=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Category"),t.qZA(),t.TgZ(13,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListIDs)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types)("clearable",!1)}}function _d(n,i){if(1&n&&t._UZ(0,"th",27),2&n){const e=i.$implicit;t.Q6J("innerHtml",e.Label+" ("+e.Rate+"%)",t.oJD)}}function ud(n,i){if(1&n&&(t._UZ(0,"td",31),t.ALo(1,"number"),t.ALo(2,"TaxDefault")),2&n){const e=i.index,o=t.oxw().$implicit,a=t.oxw(2);t.Q6J("innerHtml",t.lcZ(1,1,t.Dn7(2,3,a.data.Compenents,o,e)),t.oJD)}}const gd=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},dd=function(n){return{ID:n}};function md(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"a",28),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.qZA(),t.TgZ(8,"td"),t._uU(9),t.ALo(10,"date"),t.qZA(),t.TgZ(11,"td",29),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"td",29),t._uU(15),t.ALo(16,"number"),t.qZA(),t.YNc(17,ud,3,7,"td",30),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.EntityName),t.xp6(2),t.Q6J("routerLink",t.DdM(16,gd))("queryParams",t.VKq(17,dd,e.ID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(t.xi3(10,9,e.Date,"dd MMM yyyy")),t.xp6(3),t.Oqu(t.lcZ(13,12,e.Sales)),t.xp6(3),t.Oqu(t.lcZ(16,14,e.Tax)),t.xp6(2),t.Q6J("ngForOf",o.getComponent(o.data))}}function Zd(n,i){if(1&n&&(t.TgZ(0,"td",32),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.SumTaxAmount)," ")}}function hd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",12),t.TgZ(1,"table",13),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",14),t.TgZ(3,"tr"),t.TgZ(4,"th",15),t._uU(5,"Outlet"),t.qZA(),t.TgZ(6,"th",16),t._uU(7,"Number"),t.qZA(),t.TgZ(8,"th",17),t._uU(9,"Name"),t.qZA(),t.TgZ(10,"th",18),t._uU(11,"Date"),t.qZA(),t.TgZ(12,"th",19),t._uU(13,"Sales"),t.qZA(),t.TgZ(14,"th",20),t._uU(15,"Tax"),t.qZA(),t.YNc(16,_d,1,1,"th",21),t.qZA(),t.qZA(),t.TgZ(17,"tbody"),t.YNc(18,md,18,19,"tr",22),t.qZA(),t.TgZ(19,"tfoot"),t.TgZ(20,"tr",23),t._UZ(21,"td",24),t.TgZ(22,"td",25),t._uU(23),t.ALo(24,"number"),t.ALo(25,"sum"),t.qZA(),t.TgZ(26,"td",25),t._uU(27),t.ALo(28,"number"),t.ALo(29,"sum"),t.qZA(),t.YNc(30,Zd,3,3,"td",26),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(16),t.Q6J("ngForOf",e.data.Compenents),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Oqu(t.lcZ(24,5,t.xi3(25,7,e.data.Data,"Sales"))),t.xp6(4),t.Oqu(t.lcZ(28,10,t.xi3(29,12,e.data.Data,"Tax"))),t.xp6(3),t.Q6J("ngForOf",e.data.Compenents)}}const Td=function(){return["/menu/Reports/Sales_Report/Advanced/Tax_Report/By_Outlet"]};let Cd=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/GetTaxReport","ReportLoader/GetTaxReport",o),this.httpService=e,this.csvConverter=a}getComponent(e){return e.Component=[],this.data.Compenents.forEach((o,a)=>{0!=e.Tax?(o.SalesTax=0==a?e.Sales:this.data.Compenents[a-1].SalesTax,o.SalesTax=0==a?o.SalesTax:o.SalesTax+o.SalesTax*this.data.Compenents[a-1].Rate/100,e.Component[a]=o.SalesTax*o.Rate/100,o.SumTaxAmount=o.SumTaxAmount+e.Component[a]):e.Component[a]=0}),e.Component}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(a.Name=null==a.Name?"":a.Name,r.Name=null==r.Name?"":r.Name,a.EntityName=null==a.EntityName?"":a.EntityName,r.EntityName=null==r.EntityName?"":r.EntityName,e.active){case"Name":return this.compare(a.Name.toLocaleLowerCase(),r.Name.toLocaleLowerCase(),l);case"Outlet":return this.compare(a.EntityName.toLocaleLowerCase(),r.EntityName.toLocaleLowerCase(),l);case"Number":return this.compare(a.Number,r.Number,l);case"Date":return this.compare(a.Date,r.Date,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"Tax":return this.compare(a.Tax,r.Tax,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-tax-report"]],features:[t.qOj],decls:12,vars:6,consts:[[3,"pageData","text","textChange","onSubmit"],["title","Tax Report By Outlet",1,"btn","btn-success","mr-6",3,"routerLink"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose outlet",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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","Number"],["mat-sort-header","Name"],["mat-sort-header","Date",2,"width","100px"],["mat-sort-header","Sales",1,"align-right",2,"width","150px"],["mat-sort-header","Tax",1,"align-right","text-right",2,"width","150px"],["style","width: 150px","class","align-right text-right",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","4",1,"text-right","empty-column"],[1,"text-right","text-success"],["class","text-right","style","width: 150px",4,"ngFor","ngForOf"],[1,"align-right","text-right",2,"width","150px",3,"innerHtml"],[3,"routerLink","queryParams"],[1,"text-right"],["class","text-right","style","width: 150px",3,"innerHtml",4,"ngFor","ngForOf"],[1,"text-right",2,"width","150px",3,"innerHtml"],[1,"text-right",2,"width","150px"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t._uU(3,"By Outlet"),t.qZA(),t.TgZ(4,"a",2),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,o.data.Data,"TaxReport.csv")}),t._UZ(5,"i",3),t._uU(6,"Export"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,cd,14,8,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,hd,31,15,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(2),t.Q6J("routerLink",t.DdM(5,Td)),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,C.QB,Z.YE,Z.nU,s.sg],pipes:[s.JJ,T.qU,s.uU,T.X6],styles:[""]}),n})();function fd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Tax Type"),t.qZA(),t.TgZ(13,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types)("clearable",!1)}}function Ad(n,i){1&n&&(t.TgZ(0,"th",25),t._uU(1,"Total Tax"),t.qZA())}function qd(n,i){if(1&n&&t._UZ(0,"th",26),2&n){const e=i.$implicit;t.Q6J("innerHtml",e.Label+" ("+e.Rate+"%)",t.oJD)}}function Dd(n,i){if(1&n&&(t.TgZ(0,"td",27),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.Tax))}}function yd(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e)," ")}}function vd(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",27),t._uU(4),t.ALo(5,"number"),t.qZA(),t.YNc(6,Dd,3,3,"td",28),t.YNc(7,yd,3,3,"td",24),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.EntityName),t.xp6(2),t.Oqu(t.lcZ(5,4,e.Sales)),t.xp6(2),t.Q6J("ngIf",0==o.data.Compenents.length),t.xp6(1),t.Q6J("ngForOf",o.getComponent(e))}}function Sd(n,i){if(1&n&&(t.TgZ(0,"td",22),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.lcZ(2,1,t.xi3(3,3,e.data.Data,"Tax")),"")}}function Md(n,i){if(1&n&&(t.TgZ(0,"td",29),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.SumTaxAmount)," ")}}function bd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",12),t.TgZ(1,"table",13),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",14),t.TgZ(3,"tr"),t.TgZ(4,"th",15),t._uU(5,"Outlet"),t.qZA(),t.TgZ(6,"th",16),t._uU(7,"Sales"),t.qZA(),t.YNc(8,Ad,2,0,"th",17),t.YNc(9,qd,1,1,"th",18),t.qZA(),t.qZA(),t.TgZ(10,"tbody"),t.YNc(11,vd,8,6,"tr",19),t.qZA(),t.TgZ(12,"tfoot"),t.TgZ(13,"tr",20),t._UZ(14,"td",21),t.TgZ(15,"td",22),t._uU(16),t.ALo(17,"number"),t.ALo(18,"sum"),t.qZA(),t.YNc(19,Sd,4,6,"td",23),t.YNc(20,Md,3,3,"td",24),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(8),t.Q6J("ngIf",0==e.data.Compenents.length),t.xp6(1),t.Q6J("ngForOf",e.data.Compenents),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Oqu(t.lcZ(17,6,t.xi3(18,8,e.data.Data,"Sales"))),t.xp6(3),t.Q6J("ngIf",0==e.data.Compenents.length),t.xp6(1),t.Q6J("ngForOf",e.data.Compenents)}}const Jd=function(){return["/menu/Reports/Sales_Report/Advanced/Tax_Report"]};let Od=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/GetTaxReportbyOutlet","ReportLoader/GetTaxReport",o),this.httpService=e,this.csvConverter=a}getComponent(e){return e.Component=[],this.data.Compenents.forEach((o,a)=>{o.SalesTax=0==a?e.Sales:this.data.Compenents[a-1].SalesTax,o.SalesTax=0==a?o.SalesTax:o.SalesTax+o.SalesTax*this.data.Compenents[a-1].Rate/100,e.Component[a]=o.SalesTax*o.Rate/100,o.SumTaxAmount=o.SumTaxAmount+e.Component[a]}),e.Component}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Outlet":return this.compare(a.EntityName,r.EntityName,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"Tax":return this.compare(a.Tax,r.Tax,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-tax-report-by-outlet"]],features:[t.qOj],decls:12,vars:7,consts:[[3,"pageData","text","hideSearchBox","textChange","onSubmit"],["title","Tax Report By Outlet",1,"btn","btn-success","mr-6",3,"routerLink"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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"],["name","From",3,"date","dateChange"],["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",1,"align-right",2,"width","150px"],["style","width: 150px","class","align-right","mat-sort-header","Tax",4,"ngIf"],["style","width: 150px","class","align-right",3,"innerHtml",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-right","empty-column"],[1,"text-right","text-success"],["class","text-right text-success",4,"ngIf"],["class","text-right","style","width: 150px",4,"ngFor","ngForOf"],["mat-sort-header","Tax",1,"align-right",2,"width","150px"],[1,"align-right",2,"width","150px",3,"innerHtml"],[1,"text-right"],["class","text-right",4,"ngIf"],[1,"text-right",2,"width","150px"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t._uU(3,"Tax Report"),t.qZA(),t.TgZ(4,"a",2),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,o.data.Data,"TaxReport.csv")}),t._UZ(5,"i",3),t._uU(6,"Export"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,fd,14,7,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,bd,21,11,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number)("hideSearchBox",!0),t.xp6(2),t.Q6J("routerLink",t.DdM(6,Jd)),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,C.QB,Z.YE,Z.nU,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function Id(n,i){if(1&n&&(t.TgZ(0,"span",13),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Ud(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Id,2,2,"ng-template",9),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"From/To"),t.qZA(),t.TgZ(13,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(14,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(15,"div"),t.TgZ(16,"h6"),t._uU(17,"Sales Name"),t.qZA(),t.TgZ(18,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales)}}const Fd=function(){return["/menu/Products/Catalog/Variants/Info"]},wd=function(n){return{ID:n}};function Nd(n,i){if(1&n&&(t.TgZ(0,"tr",19),t.TgZ(1,"td"),t.TgZ(2,"a",20),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.ALo(8,"date"),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.ALo(11,"date"),t.qZA(),t.TgZ(12,"td",17),t._uU(13),t.ALo(14,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Q6J("routerLink",t.DdM(15,Fd))("queryParams",t.VKq(16,wd,e.ID)),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(e.LastSold?t.xi3(8,7,e.LastSold,"dd MMM yyyy"):"-"),t.xp6(3),t.Oqu(e.LastPurchased?t.xi3(11,10,e.LastPurchased,"dd MMM yyyy"):"-"),t.xp6(3),t.Oqu(t.lcZ(14,13,e.Quantity))}}function Pd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",14),t.TgZ(1,"table",15),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",16),t.TgZ(3,"tr"),t.TgZ(4,"th"),t._uU(5,"Name"),t.qZA(),t.TgZ(6,"th"),t._uU(7,"Code"),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Last Sold"),t.qZA(),t.TgZ(10,"th"),t._uU(11,"Last Purchased"),t.qZA(),t.TgZ(12,"th",17),t._uU(13,"Qty"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"tbody"),t.YNc(15,Nd,15,18,"tr",18),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(15),t.Q6J("ngForOf",e.data)}}let Ld=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/ProductLifeCycle","ReportLoader/ProductLifeCycle",o),this.httpService=e,this.csvConverter=a}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(a.Name=null==a.Name?"":a.Name,r.Name=null==r.Name?"":r.Name,a.EntityName=null==a.EntityName?"":a.EntityName,r.EntityName=null==r.EntityName?"":r.EntityName,e.active){case"Name":return this.compare(a.Name.toLocaleLowerCase(),r.Name.toLocaleLowerCase(),l);case"Outlet":return this.compare(a.EntityName.toLocaleLowerCase(),r.EntityName.toLocaleLowerCase(),l);case"Number":return this.compare(a.Number,r.Number,l);case"Date":return this.compare(a.Date,r.Date,l);case"Sales":return this.compare(a.Sales,r.Sales,l);case"Tax":return this.compare(a.Tax,r.Tax,l);default:return 0}}):o}preGetList(){this.pageData.Filter.EntityID||delete this.pageData.Filter.EntityID}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-product-life-cycle"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["bindLabel","Name","bindValue","ID","placeholder","Choose Sales",3,"ngModel","items","ngModelChange"],[3,"title"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[1,"text-right"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[3,"routerLink","queryParams"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,o.data.Data,"ProductLifeCycleReport.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,Ud,19,8,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,Pd,16,1,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,c.ir,C.QB,Z.YE,s.sg,u.yS],pipes:[s.uU,s.JJ],styles:[""]}),n})();function Qd(n,i){if(1&n&&(t.TgZ(0,"span",15),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Yd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",16),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",17),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function Rd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",18),t.TgZ(4,"div",19),t.TgZ(5,"ng-select",20),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Year=a}),t.qZA(),t.qZA(),t.TgZ(6,"div",21),t.TgZ(7,"ng-select",22),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.Month=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.pageData.Filter.Month)("items",e.Months)}}function kd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Qd,2,2,"ng-template",9),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Date Filter"),t.qZA(),t.TgZ(13,"radio-options",10),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ByMonth=a}),t.qZA(),t.TgZ(14,"h6"),t._uU(15,"Group By"),t.qZA(),t.TgZ(16,"radio-options",11),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.GroupBy=a}),t.qZA(),t.qZA(),t.YNc(17,Yd,5,2,"div",12),t.YNc(18,Rd,8,4,"div",12),t.TgZ(19,"div"),t.TgZ(20,"h6"),t._uU(21,"Row Count"),t.qZA(),t.TgZ(22,"input",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.TgZ(23,"div"),t.TgZ(24,"h6"),t._uU(25,"Supplier"),t.qZA(),t.TgZ(26,"autocompleteV2",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SupplierID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("model",e.pageData.Filter.ByMonth)("options",e.RadioDateFilterType),t.xp6(3),t.Q6J("model",e.pageData.Filter.GroupBy)("options",e.RadioGroupBy),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.ByMonth),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.ByMonth),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SupplierID)}}function Ed(n,i){if(1&n&&(t.TgZ(0,"tr",31),t.TgZ(1,"td",32),t._uU(2),t.qZA(),t.TgZ(3,"td",32),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA(),t.TgZ(7,"td"),t._uU(8),t.qZA(),t.TgZ(9,"td",33),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",33),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",33),t._uU(16),t.ALo(17,"number"),t.qZA(),t.TgZ(18,"td",34),t._uU(19),t.ALo(20,"number"),t.qZA(),t.TgZ(21,"td",33),t._uU(22),t.ALo(23,"number"),t.qZA(),t.TgZ(24,"td",33),t._uU(25),t.ALo(26,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.PrevRank||"-"),t.xp6(2),t.Oqu(e.Rank),t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(11,10,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(14,12,e.UnitsInStock)),t.xp6(3),t.Oqu(t.lcZ(17,14,e.TotalAmount)),t.xp6(3),t.Oqu(t.lcZ(20,16,e.TotalCost)),t.xp6(3),t.Oqu(t.lcZ(23,18,e.TotalProfit)),t.xp6(3),t.Oqu(t.lcZ(26,20,e.Margin))}}function Hd(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",35),t._UZ(2,"td",36),t.TgZ(3,"td",37),t._uU(4,"Total:"),t.qZA(),t.TgZ(5,"td",37),t._uU(6),t.ALo(7,"number"),t.ALo(8,"sum"),t.qZA(),t.TgZ(9,"td",37),t._uU(10),t.ALo(11,"number"),t.ALo(12,"sum"),t.qZA(),t.TgZ(13,"td",37),t._uU(14),t.ALo(15,"number"),t.ALo(16,"sum"),t.qZA(),t.TgZ(17,"td",37),t._uU(18),t.ALo(19,"number"),t.ALo(20,"sum"),t.qZA(),t.TgZ(21,"td",37),t._uU(22),t.ALo(23,"number"),t.ALo(24,"sum"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(6),t.Oqu(t.lcZ(7,5,t.xi3(8,7,e.data,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(11,10,t.xi3(12,12,e.data,"UnitsInStock"))),t.xp6(4),t.Oqu(t.lcZ(15,15,t.xi3(16,17,e.data,"TotalAmount"))),t.xp6(4),t.Oqu(t.lcZ(19,20,t.xi3(20,22,e.data,"TotalCost"))),t.xp6(4),t.Oqu(t.lcZ(23,25,t.xi3(24,27,e.data,"TotalProfit")))}}function Vd(n,i){if(1&n&&(t.TgZ(0,"div",23),t.TgZ(1,"table",24),t.TgZ(2,"thead",25),t.TgZ(3,"tr"),t.TgZ(4,"th",26),t._uU(5,"Prev"),t.qZA(),t.TgZ(6,"th",26),t._uU(7,"Now"),t.qZA(),t.TgZ(8,"th",27),t._uU(9,"Name"),t.qZA(),t.TgZ(10,"th",28),t._uU(11,"Code"),t.qZA(),t.TgZ(12,"th",26),t._uU(13,"Sold"),t.qZA(),t.TgZ(14,"th",29),t._uU(15,"Inventory"),t.qZA(),t.TgZ(16,"th",29),t._uU(17,"Total Amount"),t.qZA(),t.TgZ(18,"th",29),t._uU(19,"Total Cost"),t.qZA(),t.TgZ(20,"th",29),t._uU(21,"Total profit"),t.qZA(),t.TgZ(22,"th",29),t._uU(23,"%"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(24,"tbody"),t.YNc(25,Ed,27,22,"tr",30),t.qZA(),t.YNc(26,Hd,25,30,"tfoot",12),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(25),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.length>0)}}let Bd=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/GetReportProductProfit","ReportLoader/GetReportProductProfit",o),this.httpService=e,this.csvConverter=a,this.DateFilterType="Range",this.Months=[{ID:"1",Label:"Jan"},{ID:"2",Label:"Feb"},{ID:"3",Label:"Mar"},{ID:"4",Label:"Apr"},{ID:"5",Label:"May"},{ID:"6",Label:"Jun"},{ID:"7",Label:"Jul"},{ID:"8",Label:"Aug"},{ID:"9",Label:"Sep"},{ID:"10",Label:"Oct"},{ID:"11",Label:"Nov"},{ID:"12",Label:"Dec"}],this.RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Range"}],this.RadioGroupBy=[{Key:!0,Value:"Product"},{Key:!1,Value:"Variant"}],this.first=!0;const r=new Date;this.Years=this.GenerateYears(r.getFullYear(),11,!0)}GenerateYears(e,o,a){let r=-1;(null==o||null==o)&&(o=11),(null==a||null==a||!a)&&(r=1);const l=[];for(let _=0;_<o;_++)l.push(e+_*r);return l}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-product-profit"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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",""],["name","Date Filter",3,"model","options","modelChange"],["name","Group By",3,"model","options","modelChange"],[4,"ngIf"],["type","text",1,"form-control",3,"ngModel","ngModelChange"],["inputID","Key","requestUrl","/API/AC/GetSupplierSuggestion",1,"w-100",3,"ngModel","ngModelChange"],[3,"title"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange"],[1,"col-6","pl-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-right",2,"width","100px"],[2,"width","600px"],[2,"width","100px"],[1,"text-right",2,"width","200px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[1,"text-right",2,"width","35px"],[1,"text-right","text-success"],[1,"text-right","text-danger"],[1,"table-footer"],["colspan","3",1,"empty-column"],[1,"text-right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,o.data.Data,"ReportProductProfit.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,kd,27,12,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,Vd,27,2,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,c.ir,q.P,p.Fj,D.J,C.QB,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function Gd(n,i){if(1&n&&(t.TgZ(0,"span",12),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function jd(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Gd,2,2,"ng-template",9),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"From/To"),t.qZA(),t.TgZ(13,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(14,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}const Wd=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},$d=function(n){return{ID:n}};function Kd(n,i){if(1&n&&(t.TgZ(0,"tr",17),t.TgZ(1,"td"),t.TgZ(2,"a",18),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.qZA(),t.TgZ(8,"td"),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td"),t._uU(12),t.ALo(13,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Q6J("routerLink",t.DdM(11,Wd))("queryParams",t.VKq(12,$d,e.ID)),t.xp6(1),t.Oqu(e.InvoiceNumber),t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.Oqu(t.lcZ(10,7,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(13,9,e.Price))}}function Xd(n,i){if(1&n&&(t.TgZ(0,"div",13),t.TgZ(1,"table",14),t.TgZ(2,"thead",15),t.TgZ(3,"tr"),t.TgZ(4,"th"),t._uU(5,"Number"),t.qZA(),t.TgZ(6,"th"),t._uU(7,"Name"),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Code"),t.qZA(),t.TgZ(10,"th"),t._uU(11,"Quantity"),t.qZA(),t.TgZ(12,"th"),t._uU(13,"Price"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(14,"tbody"),t.YNc(15,Kd,14,14,"tr",16),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(15),t.Q6J("ngForOf",e.data.Data)}}let zd=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/GetExchangedSales","ReportLoader/GetExchangedSales",o),this.httpService=e,this.csvConverter=a}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-exchanged-sales"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[3,"title"],[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(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/GetExchangedSales","ReportExchangedSales.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,jd,15,6,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,Xd,16,1,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,c.ir,C.QB,s.sg,u.yS],pipes:[s.JJ],styles:[""]}),n})();function tm(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Product"),t.qZA(),t.TgZ(3,"autocompleteV2",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ProductID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.ProductID)}}function em(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Product"),t.qZA(),t.TgZ(3,"autocompleteV2",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.ProductID=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.ProductID)}}function nm(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.YNc(10,tm,4,1,"div",10),t.YNc(11,em,4,1,"div",10),t.TgZ(12,"div"),t.TgZ(13,"h6"),t._uU(14,"Search By"),t.qZA(),t.TgZ(15,"radio-options",11),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SearchBy=a}),t.qZA(),t.qZA(),t.TgZ(16,"div"),t.TgZ(17,"h6"),t._uU(18,"Row Count"),t.qZA(),t.TgZ(19,"input",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(1),t.Q6J("ngIf",e.pageData.Filter.SearchBy),t.xp6(1),t.Q6J("ngIf",!e.pageData.Filter.SearchBy),t.xp6(4),t.Q6J("model",e.pageData.Filter.SearchBy)("options",e.RadioSearchBy),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount)}}function am(n,i){if(1&n&&(t.TgZ(0,"tr",22),t.TgZ(1,"td",23),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",23),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td",24),t._uU(9),t.ALo(10,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.Rank),t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(t.lcZ(7,4,e.Quantity)),t.xp6(3),t.Oqu(t.lcZ(10,6,e.UnitsInStock))}}function om(n,i){if(1&n&&(t.TgZ(0,"div",15),t.TgZ(1,"table",16),t.TgZ(2,"thead",17),t.TgZ(3,"tr"),t.TgZ(4,"th",18),t._uU(5,"Rank"),t.qZA(),t.TgZ(6,"th",19),t._uU(7,"Name"),t.qZA(),t.TgZ(8,"th",20),t._uU(9,"Sold"),t.qZA(),t.TgZ(10,"th",20),t._uU(11,"Inventory"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(12,"tbody"),t.YNc(13,am,11,8,"tr",21),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(13),t.Q6J("ngForOf",e.data.Data)}}let rm=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/GetSalesRankByVariantModel","ReportLoader/GetSalesRankByVariantModel",o),this.httpService=e,this.csvConverter=a,this.RadioSearchBy=[{Key:!0,Value:"Name"},{Key:!1,Value:"Code"}]}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-variant-model-rank"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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"],["name","From",3,"date","dateChange"],["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-right",2,"width","70px"],[2,"width","800px"],[1,"text-right",2,"width","100px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],[1,"text-right"],[1,"text-success","text-right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/GetSalesRankByVariantModel","ReportSalesRankByVariantModel.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,nm,20,9,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,om,14,1,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,C.QB,q.P,p.Fj,D.J,s.sg],pipes:[s.JJ],styles:[""]}),n})();function im(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",7),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From/To"),t.qZA(),t.TgZ(8,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Discount(%) From / To"),t.qZA(),t.TgZ(13,"div",11),t.TgZ(14,"div",12),t.TgZ(15,"input",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.DiscountFrom=a}),t.qZA(),t.qZA(),t.TgZ(16,"div",14),t.TgZ(17,"input",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.DiscountTo=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(6),t.Q6J("ngModel",e.pageData.Filter.DiscountFrom),t.xp6(2),t.Q6J("ngModel",e.pageData.Filter.DiscountTo)}}const lm=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},sm=function(n){return{ID:n}};function pm(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",21),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td"),t.TgZ(7,"a",25),t._uU(8),t.qZA(),t.qZA(),t.TgZ(9,"td",21),t._uU(10),t.ALo(11,"number"),t.qZA(),t.TgZ(12,"td",21),t._uU(13),t.ALo(14,"number"),t.qZA(),t.TgZ(15,"td",21),t._uU(16),t.ALo(17,"number"),t.qZA(),t.TgZ(18,"td",21),t._uU(19),t.ALo(20,"number"),t.qZA(),t.TgZ(21,"td",21),t._uU(22),t.ALo(23,"number"),t.qZA(),t.TgZ(24,"td",21),t._uU(25),t.ALo(26,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.VariantName),t.xp6(2),t.Oqu(t.lcZ(5,11,e.Quantity)),t.xp6(3),t.Q6J("routerLink",t.DdM(25,lm))("queryParams",t.VKq(26,sm,e.InvoiceID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Oqu(t.lcZ(11,13,e.ItemDiscount)),t.xp6(3),t.Oqu(t.lcZ(14,15,e.OrderDiscount)),t.xp6(3),t.Oqu(t.lcZ(17,17,e.OrderDiscount2)),t.xp6(3),t.Oqu(t.lcZ(20,19,e.OrderDiscountAmount)),t.xp6(3),t.Oqu(t.lcZ(23,21,e.UnitPrice)),t.xp6(3),t.Oqu(t.lcZ(26,23,e.NetSales))}}function cm(n,i){if(1&n&&(t.TgZ(0,"div",15),t.TgZ(1,"table",16),t.TgZ(2,"thead",17),t.TgZ(3,"tr"),t.TgZ(4,"th"),t._uU(5,"Name"),t.qZA(),t.TgZ(6,"th",18),t._uU(7,"Qty"),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Number"),t.qZA(),t.TgZ(10,"th",19),t._uU(11,"Item %"),t.qZA(),t.TgZ(12,"th",19),t._uU(13,"Order %"),t.qZA(),t.TgZ(14,"th",19),t._uU(15,"Order2 %"),t.qZA(),t.TgZ(16,"th",20),t._uU(17,"Order % Amount"),t.qZA(),t.TgZ(18,"th",20),t._uU(19,"Unit Price"),t.qZA(),t.TgZ(20,"th",21),t._uU(21,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(22,"tbody"),t.YNc(23,pm,27,28,"tr",22),t.qZA(),t.TgZ(24,"tfoot"),t.TgZ(25,"tr",23),t.TgZ(26,"td",21),t._uU(27,"Total : "),t.qZA(),t.TgZ(28,"td",21),t._uU(29),t.ALo(30,"number"),t.ALo(31,"sum"),t.qZA(),t.TgZ(32,"td",24),t._uU(33),t.ALo(34,"number"),t.ALo(35,"sum"),t.qZA(),t.TgZ(36,"td",21),t._uU(37),t.ALo(38,"number"),t.ALo(39,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(23),t.Q6J("ngForOf",e.data.Data),t.xp6(6),t.Oqu(t.lcZ(30,4,t.xi3(31,6,e.data.Data,"Quantity"))),t.xp6(4),t.Oqu(t.lcZ(34,9,t.xi3(35,11,e.data.Data,"UnitPrice"))),t.xp6(4),t.Oqu(t.lcZ(38,14,t.xi3(39,16,e.data.Data,"NetSales")))}}const um=function(){return["/menu/Reports/Sales_Report/Standard/Discounted_Sales/Discounted_Products"]};let gm=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/GetDiscountsales","ReportLoader/GetDiscountSales"),this.httpService=e,this.csvConverter=o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-discounted-sales"]],features:[t.qOj],decls:12,vars:6,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[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"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"row"],[1,"col-6","pr-2"],["type","number",1,"form-control",3,"ngModel","ngModelChange"],[1,"col-6","pl-2"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-right",2,"width","25px"],[1,"text-right",2,"width","100px"],[1,"text-right",2,"width","150px"],[1,"text-right"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","6",1,"text-right"],[3,"routerLink","queryParams"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.convertToCSV(o.csvConverter,!0,"SalesTransaction.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"Discounted Products"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,im,18,6,"div",5),t.qZA(),t.qZA(),t.TgZ(10,"content"),t.YNc(11,cm,40,19,"div",6),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(5),t.Q6J("routerLink",t.DdM(5,um)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,C.QB,p.wV,p.Fj,s.sg],pipes:[s.JJ,T.qU],styles:[""]}),n})();function dm(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",6),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Customer"),t.qZA(),t.TgZ(8,"autocompleteV2",8),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CustomerID=a}),t.qZA(),t.qZA(),t.TgZ(9,"div"),t.TgZ(10,"h6"),t._uU(11,"From/To"),t.qZA(),t.TgZ(12,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(13,"datepicker",10),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CustomerID),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}const mm=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},Zm=function(n){return{ID:n}};function hm(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t.TgZ(4,"a",20),t._uU(5),t.qZA(),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.ALo(8,"date"),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.qZA(),t.TgZ(11,"td"),t._uU(12),t.qZA(),t.TgZ(13,"td",15),t._uU(14),t.ALo(15,"number"),t.qZA(),t.TgZ(16,"td",15),t._uU(17),t.ALo(18,"number"),t.qZA(),t.TgZ(19,"td",21),t._uU(20),t.qZA(),t.TgZ(21,"td",15),t._uU(22),t.ALo(23,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.EntityName),t.xp6(2),t.Q6J("routerLink",t.DdM(20,mm))("queryParams",t.VKq(21,Zm,e.InvoiceID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Oqu(t.xi3(8,11,e.Date,"dd MMM yyyy")),t.xp6(3),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Code),t.xp6(2),t.hij("(",t.lcZ(15,14,e.Quantity),")"),t.xp6(3),t.Oqu(t.lcZ(18,16,e.UnitPrice)),t.xp6(3),t.hij("",e.Discount&&0!=e.Discount?-e.Discount+"%":""," "),t.xp6(2),t.hij("(",t.lcZ(23,18,e.Total),")")}}function xm(n,i){if(1&n&&(t.TgZ(0,"div",11),t.TgZ(1,"table",12),t.TgZ(2,"thead",13),t.TgZ(3,"tr"),t.TgZ(4,"th"),t._uU(5,"Outlet"),t.qZA(),t.TgZ(6,"th",14),t._uU(7,"Number"),t.qZA(),t.TgZ(8,"th"),t._uU(9,"Date"),t.qZA(),t.TgZ(10,"th"),t._uU(11,"Name"),t.qZA(),t.TgZ(12,"th"),t._uU(13,"Code"),t.qZA(),t.TgZ(14,"th",15),t._uU(15,"Quantity"),t.qZA(),t.TgZ(16,"th",15),t._uU(17),t.qZA(),t.TgZ(18,"th",16),t._uU(19,"%"),t.qZA(),t.TgZ(20,"th",15),t._uU(21),t.qZA(),t.qZA(),t.qZA(),t.TgZ(22,"tbody"),t.YNc(23,hm,24,23,"tr",17),t.qZA(),t.TgZ(24,"tfoot"),t.TgZ(25,"tr",18),t._UZ(26,"td",19),t._UZ(27,"td",19),t._UZ(28,"td",19),t._UZ(29,"td",19),t._UZ(30,"td",19),t.TgZ(31,"td",15),t._uU(32),t.ALo(33,"number"),t.ALo(34,"sum"),t.qZA(),t._UZ(35,"td",19),t._UZ(36,"td",19),t.TgZ(37,"td",15),t._uU(38),t.ALo(39,"number"),t.ALo(40,"sum"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(17),t.hij("Price (",e.data.CurrencySymbol,")"),t.xp6(4),t.hij("Total(",e.data.CurrencySymbol,")"),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(9),t.Oqu(t.lcZ(33,5,t.xi3(34,7,e.data.Data,"Quantity"))),t.xp6(6),t.Oqu(t.lcZ(39,10,t.xi3(40,12,e.data.Data,"Total")))}}let Tm=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/SalesReturnList","ReportLoader/ReturnReportLoader",o),this.httpService=e,this.csvConverter=a}postInit(e){this.menuData.H=e.PageTitle}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(y._W),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-sales-return"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload","mr-4"],[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"],["inputID","Key","requestUrl","/API/AC/GetCustomerSuggestion",1,"w-100",3,"ngModel","ngModelChange"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","140px"],[1,"text-right"],[2,"width","30px"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"empty-column"],[3,"routerLink","queryParams"],[1,"text-danger"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/SalesReturnExport",o.menuData.H+".csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,dm,14,5,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,xm,41,15,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(7),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,D.J,C.QB,s.sg,u.yS],pipes:[s.JJ,T.qU,s.uU],styles:[""]}),n})();function Cm(n,i){if(1&n&&(t._UZ(0,"td",36),t.ALo(1,"number")),2&n){const e=t.oxw().$implicit;t.Q6J("innerHtml",t.lcZ(1,1,e.UnitCost),t.oJD)}}function fm(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._UZ(2,"span",29),t._UZ(3,"span",30),t.ALo(4,"newlines"),t.qZA(),t._UZ(5,"td",31),t.TgZ(6,"td",14),t._uU(7),t.ALo(8,"number"),t.qZA(),t._UZ(9,"td",32),t.YNc(10,Cm,2,3,"td",33),t._UZ(11,"td",34),t.ALo(12,"number"),t.TgZ(13,"td",35),t._uU(14),t.qZA(),t._UZ(15,"td",34),t.ALo(16,"number"),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(3);t.xp6(2),t.Q6J("innerHtml",e.Name,t.oJD),t.xp6(1),t.Q6J("innerHtml",t.lcZ(4,9,e.Note),t.oJD),t.xp6(2),t.Q6J("innerHtml",e.Code,t.oJD),t.xp6(2),t.hij("(",t.lcZ(8,11,e.Quantity),")"),t.xp6(2),t.Q6J("innerHtml",e.UOMName,t.oJD),t.xp6(1),t.Q6J("ngIf",o.pageData.HasRoleCost),t.xp6(1),t.Q6J("innerHtml",t.lcZ(12,13,e.UnitPrice),t.oJD),t.xp6(3),t.hij(" ",0==e.Discount?"":"-"+e.Discount+"%",""),t.xp6(1),t.Q6J("innerHtml",t.lcZ(16,15,e.Total),t.oJD)}}const Am=function(){return["/menu/Orders/Orders/Supplier_Bill/Info"]},qm=function(n){return{ID:n}};function Dm(n,i){if(1&n&&(t.TgZ(0,"div"),t.TgZ(1,"div",18),t.TgZ(2,"a",19),t._UZ(3,"span",20),t.ALo(4,"date"),t.ALo(5,"date"),t.qZA(),t.TgZ(6,"span"),t._uU(7),t.ALo(8,"showIfNotNullOrEmptyString"),t.qZA(),t.qZA(),t.TgZ(9,"div",21),t.TgZ(10,"div"),t.TgZ(11,"table",22),t._UZ(12,"thead"),t.TgZ(13,"tbody"),t.YNc(14,fm,17,17,"tr",17),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(15,"table",23),t.TgZ(16,"thead"),t.TgZ(17,"tr",24),t.TgZ(18,"td",25),t._uU(19,"Total"),t.qZA(),t.TgZ(20,"td",26),t._uU(21,"\xa0"),t.qZA(),t.TgZ(22,"td",14),t._uU(23),t.ALo(24,"number"),t.qZA(),t._UZ(25,"td",27),t.TgZ(26,"td",26),t._uU(27,"\xa0"),t.qZA(),t.TgZ(28,"td",28),t._uU(29,"\xa0"),t.qZA(),t.TgZ(30,"td",14),t._uU(31),t.ALo(32,"number"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.DdM(20,Am))("queryParams",t.VKq(21,qm,e.InvoiceID)),t.xp6(1),t.Q6J("innerHtml",e.EntityName+" #"+e.Number+" - "+t.xi3(4,7,e.Date,"dd MMM yyyy")+" ("+t.xi3(5,10,e.Created,"HH:mm")+") : ",t.oJD),t.xp6(4),t.hij(" ",t.xi3(8,13,e.CustomerNameDisplay," - {0}")," "),t.xp6(7),t.Q6J("ngForOf",e.Item),t.xp6(9),t.hij("",t.lcZ(24,16,o.data.Quantity),"\xa0"),t.xp6(8),t.hij("",t.lcZ(32,18,o.data.TotalPrice),"\xa0")}}function ym(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"mainpanel-cmp",1),t.NdJ("onSubmit",function(){return t.CHM(e),t.oxw().searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",2),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/PurchaseReturnList",a.data.PageTitle+".csv")}),t._UZ(3,"i",3),t._uU(4,"Export"),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",4),t.TgZ(7,"div",5),t.TgZ(8,"div"),t.TgZ(9,"h6"),t._uU(10,"Outlet"),t.qZA(),t.TgZ(11,"ng-select",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(12,"div"),t.TgZ(13,"h6"),t._uU(14,"Supplier"),t.qZA(),t.TgZ(15,"autocompleteV2",7),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SupplierID=a}),t.qZA(),t.qZA(),t.TgZ(16,"div"),t.TgZ(17,"h6"),t._uU(18,"From/To"),t.qZA(),t.TgZ(19,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(20,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.TgZ(21,"content"),t.TgZ(22,"div",10),t.TgZ(23,"table",11),t.TgZ(24,"thead",12),t.TgZ(25,"tr"),t.TgZ(26,"th"),t._uU(27,"Name"),t.qZA(),t.TgZ(28,"th",13),t._uU(29,"Code"),t.qZA(),t.TgZ(30,"th",14),t._uU(31,"Quantity"),t.qZA(),t._UZ(32,"th",15),t.TgZ(33,"th",14),t._uU(34,"Unit Price(Rp.)"),t.qZA(),t.TgZ(35,"th",16),t._uU(36,"%"),t.qZA(),t.TgZ(37,"th",14),t._uU(38,"Total(Rp.)"),t.qZA(),t.qZA(),t.qZA(),t.qZA(),t.YNc(39,Dm,33,23,"div",17),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.Q6J("pageData",e.menuData)("hideSearchBox",!0),t.xp6(11),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.SupplierID),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(19),t.Q6J("ngForOf",e.data.Data)}}let vm=(()=>{class n extends m.n{constructor(e,o){super(e,"Report/PurchaseReturnList","ReportLoader/ReturnReportLoader"),this.httpService=e,this.csvConverter=o}preGetList(){null===this.pageData.Filter.EntityID&&(this.pageData.Filter.EntityID=x.gT.GuidEmpty)}postInit(){this.menuData.H=this.data.PageTitle}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-purchase-return"]],features:[t.qOj],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","onSubmit",4,"ngIf"],[3,"pageData","hideSearchBox","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[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"],["name","To",3,"date","dateChange"],[1,"container-fluid","mt-5"],[1,"table"],[1,"thead-light"],[2,"width","10%"],[1,"text-right",2,"width","10%"],[1,"UOMWidth",2,"width","50px"],[2,"width","5%"],[4,"ngFor","ngForOf"],[1,"mt-7","ml-5"],[1,"h5","text-primary","font-weight-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHtml"],[1,"items"],["cellspacing","0",1,"table-sm","table-striped","w-100","table-bordered","purchase-return"],[2,"width","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%"],[3,"innerHtml"],[1,"list-unstyled",3,"innerHtml"],[2,"width","10%",3,"innerHtml"],[1,"UOMWidth",2,"width","50px",3,"innerHtml"],["class","text-right alt","style","width: 80px;",3,"innerHtml",4,"ngIf"],[1,"text-right",2,"width","10%",3,"innerHtml"],[1,"small","text-danger",2,"width","5%"],[1,"text-right","alt",2,"width","80px",3,"innerHtml"]],template:function(e,o){1&e&&t.YNc(0,ym,40,8,"mainpanel-cmp",0),2&e&&t.Q6J("ngIf",o.data)},directives:[s.O5,d.p,c.w9,p.JJ,p.On,D.J,C.QB,s.sg,u.yS],pipes:[s.uU,T.WV,s.JJ,T.sH],styles:[".purchase-return[_ngcontent-%COMP%] {\n border-collapse: collapse;\n margin-top: 10px;\n margin-bottom: 10px;\n}"]}),n})();function Sm(n,i){if(1&n&&(t.TgZ(0,"span",17),t._uU(1),t.qZA()),2&n){const e=i.item;t.s9C("title",e.Value),t.xp6(1),t.Oqu(e.Value)}}function Mm(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",10),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Outlet"),t.qZA(),t.TgZ(4,"ng-select",11),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.EntityID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Category"),t.qZA(),t.TgZ(8,"ng-select",12),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CategoryID=a}),t.YNc(9,Sm,2,2,"ng-template",13),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Sales"),t.qZA(),t.TgZ(13,"ng-select",14),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.SalesID=a}),t.qZA(),t.qZA(),t.TgZ(14,"div"),t.TgZ(15,"h6"),t._uU(16,"Customer"),t.qZA(),t.TgZ(17,"autocompleteV2",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.CustomerID=a}),t.qZA(),t.qZA(),t.TgZ(18,"div"),t.TgZ(19,"h6"),t._uU(20,"Page Size"),t.qZA(),t.TgZ(21,"input",16),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.PageSize=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.EntityID)("items",null==e.pageData.Options?null:e.pageData.Options.Entities),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CategoryID)("items",null==e.pageData.Options?null:e.pageData.Options.Categories),t.xp6(5),t.Q6J("ngModel",e.pageData.Filter.SalesID)("items",null==e.pageData.Options?null:e.pageData.Options.Sales),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.CustomerID),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.PageSize)}}function bm(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",18),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"From/To"),t.qZA(),t.TgZ(4,"datepicker",19),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(5,"datepicker",20),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(6,"div"),t.TgZ(7,"h6"),t._uU(8,"Product"),t.qZA(),t.TgZ(9,"autocompleteV2",21),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ProductID=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Variant"),t.qZA(),t.TgZ(13,"autocompleteV2",22),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.VariantID=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("inputTextValue",e.pageData.Filter.ProductName)("ngModel",e.pageData.Filter.ProductID),t.xp6(4),t.Q6J("inputTextValue",e.pageData.Filter.VariantName)("ngModel",e.pageData.Filter.VariantID)}}function Jm(n,i){1&n&&(t.TgZ(0,"th",39),t._uU(1," Cost "),t.qZA())}function Om(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.Name)}}function Im(n,i){if(1&n&&(t.TgZ(0,"td",43),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.UnitCost))}}function Um(n,i){1&n&&(t.TgZ(0,"span"),t._uU(1,"%"),t.qZA())}function Fm(n,i){if(1&n&&(t.TgZ(0,"div"),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,e.DiscountAmount))}}const wm=function(){return["/menu/Orders/Orders/Customer_Invoice/Info"]},Nm=function(n){return{ID:n}};function Pm(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.ALo(5,"date"),t.qZA(),t.TgZ(6,"td"),t.TgZ(7,"a",40),t._uU(8),t.qZA(),t.qZA(),t.TgZ(9,"td"),t.YNc(10,Om,2,1,"span",38),t._UZ(11,"span",41),t.TgZ(12,"i",42),t._uU(13),t.qZA(),t.qZA(),t.TgZ(14,"td"),t._uU(15),t.qZA(),t.TgZ(16,"td"),t._uU(17),t.qZA(),t.TgZ(18,"td",43),t._uU(19),t.ALo(20,"number"),t.qZA(),t.YNc(21,Im,3,3,"td",44),t.TgZ(22,"td",43),t._uU(23),t.ALo(24,"number"),t.qZA(),t.TgZ(25,"td",45),t.TgZ(26,"div"),t._uU(27),t.ALo(28,"number"),t.YNc(29,Um,2,0,"span",38),t.qZA(),t.YNc(30,Fm,3,3,"div",38),t.qZA(),t.TgZ(31,"td",43),t._uU(32),t.ALo(33,"number"),t.qZA(),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(e.Outlet),t.xp6(2),t.Oqu(t.xi3(5,17,e.Date,"dd MMM yy")),t.xp6(3),t.Q6J("routerLink",t.DdM(28,wm))("queryParams",t.VKq(29,Nm,e.InvoiceID)),t.xp6(1),t.Oqu(e.Number),t.xp6(2),t.Q6J("ngIf",""===o.pageData.Filter.ProductName||""===o.pageData.Filter.VariantName),t.xp6(1),t.Q6J("innerHtml",e.Note,t.oJD),t.xp6(2),t.Oqu(e.NoteOrder),t.xp6(2),t.Oqu(e.CustomerName),t.xp6(2),t.Oqu(e.SalesPerson),t.xp6(2),t.Oqu(t.lcZ(20,20,e.Quantity)),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleCost),t.xp6(2),t.Oqu(t.lcZ(24,22,e.UnitPrice)),t.xp6(4),t.Oqu(0==e.Discount?"":t.lcZ(28,24,e.Discount)),t.xp6(2),t.Q6J("ngIf",e.Discount),t.xp6(1),t.Q6J("ngIf",0!=e.DiscountAmount),t.xp6(2),t.Oqu(t.lcZ(33,26,e.Total))}}function Lm(n,i){1&n&&t._UZ(0,"td",50)}function Qm(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",46),t.TgZ(2,"td",47),t._uU(3,"Total:"),t.qZA(),t.TgZ(4,"td",43),t._uU(5),t.ALo(6,"number"),t.ALo(7,"sum"),t.qZA(),t.YNc(8,Lm,1,0,"td",48),t._UZ(9,"td",49),t.TgZ(10,"td",43),t._uU(11),t.ALo(12,"number"),t.ALo(13,"sum"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(5),t.Oqu(t.lcZ(6,3,t.xi3(7,5,e.data.Data,"Quantity"))),t.xp6(3),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(3),t.Oqu(t.lcZ(12,8,t.xi3(13,10,e.data.Data,"Total")))}}function Ym(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",23),t.TgZ(1,"table",24),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",25),t.TgZ(3,"tr"),t.TgZ(4,"th",26),t._uU(5,"Outlet"),t.qZA(),t.TgZ(6,"th",27),t._uU(7,"Date"),t.qZA(),t.TgZ(8,"th",28),t._uU(9,"Invoice #"),t.qZA(),t.TgZ(10,"th",29),t._uU(11,"Product / Note"),t.qZA(),t.TgZ(12,"th",30),t._uU(13,"Customer"),t.qZA(),t.TgZ(14,"th",31),t._uU(15,"SALES PERSON"),t.qZA(),t.TgZ(16,"th",32),t._uU(17,"Qty"),t.qZA(),t.YNc(18,Jm,2,0,"th",33),t.TgZ(19,"th",34),t._uU(20,"Price"),t.qZA(),t.TgZ(21,"th",35),t._uU(22,"Disc."),t.qZA(),t.TgZ(23,"th",36),t._uU(24,"Total"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(25,"tbody"),t.YNc(26,Pm,34,31,"tr",37),t.qZA(),t.YNc(27,Qm,14,13,"tfoot",38),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(18),t.Q6J("ngIf",e.pageData.HasRoleCost),t.xp6(8),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data.Data.length>0)}}const Rm=function(){return["/menu/Reports/Sales_Report/Standard/Products_Sold"]};let km=(()=>{class n extends m.n{constructor(e,o,a){super(e,"Report/ProductSalesByInvoice","ReportLoader/ProductSalesByInvoice",null,a),this.httpService=e,this.csvConverter=o,this.activatedRoute=a,this.hideMore=!0}postInit(e){this.menuData.H=this.pageData.PageTitle,this.originalData=e.Data}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Outlet":return this.compare(a.Outlet,r.Outlet,l);case"Date":return this.compare(a.Date,r.Date,l);case"Number":return this.compare(a.Number,r.Number,l);case"Note":return this.compare(a.Note,r.Note,l);case"CustomerName":return this.compare(a.CustomerName,r.CustomerName,l);case"SalesPerson":return this.compare(a.SalesPerson,r.SalesPerson,l);case"UnitCost":return this.compare(a.UnitCost,r.UnitCost,l);case"UnitPrice":return this.compare(a.UnitPrice,r.UnitPrice,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Discount":return this.compare(a.Discount,r.Discount,l);case"Total":return this.compare(a.TotalAfterDiscount,r.TotalAfterDiscount,l);default:return 0}}):this.originalData}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O),t.Y36(u.gz))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-invoice-items"]],features:[t.qOj],decls:16,vars:7,consts:[[3,"pageData","text","textChange","onSubmit"],["role","button","title","Export",1,"btn","btn-outline-secondary","mr-6",3,"click"],["aria-hidden","true",1,"fas","fa-upload"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"d-flex"],["container","",4,"ngIf"],["id","more-filter","class","ml-6","container","",4,"ngIf"],[1,"more",3,"click"],[1,"fas","fa-caret-down"],["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",""],["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","number","min","0",1,"w-100",3,"ngModel","ngModelChange"],[3,"title"],["id","more-filter","container","",1,"ml-6"],["name","From",3,"date","dateChange"],["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"],["mat-sort-header","Date",2,"width","80px"],["mat-sort-header","Number",2,"width","120px"],["mat-sort-header","Note"],["mat-sort-header","CustomerName"],["mat-sort-header","SalesPerson"],["mat-sort-header","Quantity",1,"align-right",2,"width","60px"],["mat-sort-header","UnitCost","style","width: 120px;","class","align-right",4,"ngIf"],["mat-sort-header","UnitPrice",1,"align-right",2,"width","120px"],["mat-sort-header","Discount",1,"align-right",2,"width","45px"],["mat-sort-header","Total",1,"align-right",2,"width","120px"],[4,"ngFor","ngForOf"],[4,"ngIf"],["mat-sort-header","UnitCost",1,"align-right",2,"width","120px"],["target","_blank",3,"routerLink","queryParams"],[2,"word-break","break-all",3,"innerHtml"],[1,"text-info"],[1,"text-right"],["class","text-right",4,"ngIf"],[1,"text-right","text-danger"],[1,"table-footer"],["colspan","6",1,"text-right","empty-column"],["class","empty-column",4,"ngIf"],["colspan","2",1,"empty-column"],[1,"empty-column"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("textChange",function(r){return o.pageData.Filter.Number=r})("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.TgZ(2,"a",1),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"Report/ProductSalesByInvoice","Invoice_Item_Details.csv")}),t._UZ(3,"i",2),t._uU(4,"Export"),t.qZA(),t.TgZ(5,"a",3),t._uU(6,"Group by Product"),t.qZA(),t.qZA(),t.TgZ(7,"filters"),t.TgZ(8,"div",4),t.YNc(9,Mm,22,8,"div",5),t.YNc(10,bm,14,6,"div",6),t.qZA(),t.TgZ(11,"a",7),t.NdJ("click",function(){return o.hideMore=!o.hideMore}),t._uU(12,"More "),t._UZ(13,"i",8),t.qZA(),t.qZA(),t.TgZ(14,"content"),t.YNc(15,Ym,28,3,"div",9),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("text",o.pageData.Filter.Number),t.xp6(5),t.Q6J("routerLink",t.DdM(6,Rm)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(1),t.Q6J("ngIf",!o.hideMore),t.xp6(5),t.Q6J("ngIf",o.data))},directives:[d.p,u.yS,s.O5,c.w9,p.JJ,p.On,c.ir,D.J,p.qQ,p.wV,p.Fj,C.QB,Z.YE,Z.nU,s.sg],pipes:[s.uU,s.JJ,T.qU],styles:[""]}),n})();function Em(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",7),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return a.exportCSV(a.csvConverter,"ReportExport/CustomerBrand","Brand_Sales_Analysis.csv")}),t._UZ(1,"i",8),t._uU(2," Export "),t.qZA()}}function Hm(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",9),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Brand"),t.qZA(),t.TgZ(4,"ng-select",10),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.ListBrandID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"From - To"),t.qZA(),t.TgZ(8,"datepicker",11),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.From=a}),t.qZA(),t.TgZ(9,"datepicker",12),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.To=a}),t.qZA(),t.qZA(),t.TgZ(10,"div"),t.TgZ(11,"h6"),t._uU(12,"Row Count"),t.qZA(),t.TgZ(13,"input",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.RowCount=a}),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("multiple",!0)("ngModel",e.pageData.Filter.ListBrandID)("items",null==e.pageData.Options?null:e.pageData.Options.Brand),t.xp6(4),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To),t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.RowCount)}}function Vm(n,i){1&n&&(t.TgZ(0,"th",28),t._uU(1,"Total Cost"),t.qZA())}function Bm(n,i){1&n&&(t.TgZ(0,"th",29),t._uU(1,"Profit"),t.qZA())}function Gm(n,i){if(1&n&&(t.TgZ(0,"td",40),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.lcZ(2,1,e.TotalCost?e.TotalCost:0),"")}}const pt=function(n,i){return{"text-danger":n,"text-success":i}};function jm(n,i){if(1&n&&(t.TgZ(0,"td",41),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",t.WLB(4,pt,e.Profit<0,e.Profit>0)),t.xp6(1),t.hij(" ",t.lcZ(2,2,e.Profit),"")}}function Wm(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td",35),t._uU(2),t.qZA(),t.TgZ(3,"td",36),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",37),t._uU(7),t.ALo(8,"number"),t.qZA(),t.YNc(9,Gm,3,3,"td",38),t.YNc(10,jm,3,7,"td",39),t.qZA()),2&n){const e=i.$implicit,o=t.oxw(3);t.xp6(2),t.Oqu(e.BrandName),t.xp6(2),t.hij(" ",t.lcZ(5,5,e.Quantity?e.Quantity:0),""),t.xp6(3),t.hij(" ",t.lcZ(8,7,e.TotalSales?e.TotalSales:0),""),t.xp6(2),t.Q6J("ngIf",o.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",o.pageData.IsCostVisible)}}const $m=function(){return["/menu/Contacts/Contact/Customers/Info"]},Km=function(n){return{ID:n}};function Xm(n,i){if(1&n&&(t.TgZ(0,"tr",30),t.TgZ(1,"td"),t.TgZ(2,"a",31),t._uU(3),t.qZA(),t.qZA(),t.TgZ(4,"td",18),t._uU(5),t.qZA(),t.TgZ(6,"td",19),t._uU(7),t.qZA(),t.TgZ(8,"td",20),t._uU(9),t.qZA(),t.TgZ(10,"td",32),t.TgZ(11,"table",33),t.YNc(12,Wm,11,9,"tr",34),t.qZA(),t.qZA(),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Q6J("routerLink",t.DdM(8,$m))("queryParams",t.VKq(9,Km,e.CustomerID)),t.xp6(1),t.AsE(" ",e.Name," ",e.Title," "),t.xp6(2),t.Oqu(e.Email),t.xp6(2),t.Oqu(e.Mobile),t.xp6(2),t.Oqu(e.City),t.xp6(3),t.Q6J("ngForOf",e.Detail)}}function zm(n,i){if(1&n&&(t.TgZ(0,"td",44),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.hij(" ",t.lcZ(2,1,e.data.Total.TotalCost)," ")}}function t1(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(4,pt,e.data.Total.Profit<0,e.data.Total.Profit>0)),t.xp6(1),t.hij(" ",t.lcZ(2,2,e.data.Total.Profit)," ")}}function e1(n,i){if(1&n&&(t.TgZ(0,"tfoot"),t.TgZ(1,"tr",42),t._UZ(2,"td",43),t.TgZ(3,"td",44),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td",44),t._uU(7),t.ALo(8,"number"),t.qZA(),t.YNc(9,zm,3,3,"td",45),t.YNc(10,t1,3,7,"td",46),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(4),t.hij(" ",t.lcZ(5,4,e.data.Total.Quantity)," "),t.xp6(3),t.hij(" ",t.lcZ(8,6,e.data.Total.TotalSales)," "),t.xp6(2),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible)}}function n1(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",14),t.TgZ(1,"table",15),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",16),t.TgZ(3,"tr"),t.TgZ(4,"th",17),t._uU(5,"Customer"),t.qZA(),t.TgZ(6,"th",18),t._uU(7,"Email"),t.qZA(),t.TgZ(8,"th",19),t._uU(9,"Mobile"),t.qZA(),t.TgZ(10,"th",20),t._uU(11,"City"),t.qZA(),t.TgZ(12,"th",21),t._uU(13,"Brand"),t.qZA(),t.TgZ(14,"th",22),t._uU(15," Qty "),t.qZA(),t.TgZ(16,"th",23),t._uU(17,"Total Sales"),t.qZA(),t.YNc(18,Vm,2,0,"th",24),t.YNc(19,Bm,2,0,"th",25),t.qZA(),t.qZA(),t.TgZ(20,"tbody"),t.YNc(21,Xm,13,11,"tr",26),t.qZA(),t.YNc(22,e1,11,8,"tfoot",27),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(18),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(2),t.Q6J("ngForOf",e.data.Data),t.xp6(1),t.Q6J("ngIf",e.data)}}const a1=function(){return["/menu/Reports/Sales_Report/Standard/Top_Brand"]};function r1(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"From/To"),t.qZA(),t.TgZ(3,"datepicker",8),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.From=a}),t.qZA(),t.TgZ(4,"datepicker",9),t.NdJ("dateChange",function(a){return t.CHM(e),t.oxw(2).pageData.Filter.To=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("date",e.pageData.Filter.From),t.xp6(1),t.Q6J("date",e.pageData.Filter.To)}}function i1(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Compare with prev Month"),t.qZA(),t.TgZ(3,"radio-options",10),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw(2).isCompareData=a})("modelChange",function(){return t.CHM(e),t.oxw(2).OnCompare("Data")}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(3),t.Q6J("model",e.isCompareData)}}function l1(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Year - Month"),t.qZA(),t.TgZ(3,"div",11),t.TgZ(4,"div",12),t.TgZ(5,"ng-select",13),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Year=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Year=null}),t.qZA(),t.qZA(),t.TgZ(6,"div",14),t.TgZ(7,"ng-select",15),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw(2).Month=a})("change",function(){return t.CHM(e),t.oxw(2).YearMonthToDateRange()})("clear",function(){return t.CHM(e),t.oxw(2).Month=null}),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(5),t.Q6J("ngModel",e.Year)("items",e.Years),t.xp6(2),t.Q6J("ngModel",e.Month)("items",e.Months)}}function s1(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",4),t.TgZ(1,"div"),t.TgZ(2,"h6"),t._uU(3,"Type"),t.qZA(),t.TgZ(4,"ng-select",5),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.TypeID=a}),t.qZA(),t.qZA(),t.TgZ(5,"div"),t.TgZ(6,"h6"),t._uU(7,"Date Filter Type"),t.qZA(),t.TgZ(8,"radio-options",6),t.NdJ("modelChange",function(a){return t.CHM(e),t.oxw().DateFilterType=a}),t.qZA(),t.qZA(),t.YNc(9,r1,5,2,"div",7),t.YNc(10,i1,4,1,"div",7),t.YNc(11,l1,8,4,"div",7),t.qZA()}if(2&n){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.pageData.Filter.TypeID)("items",null==e.pageData.Options?null:e.pageData.Options.Types),t.xp6(4),t.Q6J("model",e.DateFilterType)("options",e.RadioDateFilterType),t.xp6(1),t.Q6J("ngIf",!e.DateFilterType),t.xp6(1),t.Q6J("ngIf",e.DateFilterType),t.xp6(1),t.Q6J("ngIf",e.DateFilterType)}}function p1(n,i){1&n&&(t.TgZ(0,"th",38),t._uU(1,"Prev"),t.qZA())}function c1(n,i){1&n&&(t.TgZ(0,"th",38),t._uU(1,"Now"),t.qZA())}function _1(n,i){1&n&&(t.TgZ(0,"th",39),t._uU(1,"Trans "),t.qZA())}function u1(n,i){1&n&&(t.TgZ(0,"th",40),t._uU(1,"Qty"),t.qZA())}function g1(n,i){if(1&n&&(t.TgZ(0,"th",41),t._uU(1,"Tax"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"Tax":"SalesNet")}}function d1(n,i){if(1&n&&(t.TgZ(0,"th",41),t._uU(1," Sales + Tax"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"SalesWithTax":"SalesTaxNet")}}function m1(n,i){1&n&&(t.TgZ(0,"th",33),t._uU(1,"\xb1 (%)"),t.qZA())}function Z1(n,i){1&n&&(t.TgZ(0,"th",42),t._uU(1,"Cost"),t.qZA())}function h1(n,i){if(1&n&&(t.TgZ(0,"th",41),t._uU(1," Profit"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("mat-sort-header",e.pageData.IgnoreTax?"ProfitWithTax":"Profit")}}function x1(n,i){1&n&&(t.TgZ(0,"th",43),t._uU(1," Target"),t.qZA())}function T1(n,i){1&n&&(t.TgZ(0,"th",44),t._uU(1," Ach(%)"),t.qZA())}function C1(n,i){if(1&n&&(t.TgZ(0,"td",47),t._uU(1),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.PrevIndex)}}const f1=function(n,i){return{rankDown:n,rankUp:i,"number key":!0}};function A1(n,i){if(1&n&&(t.TgZ(0,"td",48),t._uU(1),t.qZA()),2&n){const e=t.oxw(),o=e.$implicit,a=e.index;t.Q6J("ngClass",t.WLB(2,f1,o.PrevIndex<a+1,o.PrevIndex>a+1)),t.xp6(1),t.hij(" ",o.CurrentIndex," ")}}function q1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,e.Quantity,".0-0"))}}function D1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,e.Count,".0-0"))}}function y1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,e.Tax,".0-0"))}}const v1=function(){return["/menu/Reports/Sales_Report/Standard/Detail"]},S1=function(n,i,e){return{From:n,To:i,TypeID:e}};function M1(n,i){if(1&n&&(t.TgZ(0,"td",33),t.TgZ(1,"a",49),t.ALo(2,"date"),t.ALo(3,"date"),t.TgZ(4,"b"),t._uU(5),t.ALo(6,"number"),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.xp6(1),t.Q6J("routerLink",t.DdM(12,v1))("queryParams",t.kEZ(13,S1,t.xi3(2,3,o.pageData.Filter.From,"ddMMyyyy"),t.xi3(3,6,o.pageData.Filter.To,"ddMMyyyy"),e.TypeID)),t.xp6(4),t.Oqu(t.xi3(6,9,e.SalesWithTax,".0-0"))}}const ct=function(n,i){return{"text-warning":n,"text-success":i,"text-right":!0}};function b1(n,i){if(1&n&&(t.TgZ(0,"td",50),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.Q6J("ngClass",t.WLB(5,ct,e.IsNegative,e.IsPositive)),t.xp6(1),t.hij(" ",t.xi3(2,2,e.Increase,".0-0"),"")}}function J1(n,i){if(1&n&&(t.TgZ(0,"td",51),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.Cost,".0-0")," ")}}function O1(n,i){if(1&n&&(t.TgZ(0,"td",52),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit,o=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,o.pageData.IgnoreTax?e.ProfitWithTax:e.Profit,".0-0"),"")}}function I1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.SalesTarget,".0-0"),"")}}const F=function(n,i){return{"text-danger":n,"text-success":i}};function U1(n,i){if(1&n&&(t.TgZ(0,"span",50),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.Q6J("ngClass",t.WLB(5,F,e.Achievement<0,e.Achievement>0)),t.xp6(1),t.Oqu(t.xi3(2,2,e.Achievement,".0-0"))}}function F1(n,i){if(1&n&&(t.TgZ(0,"span",50),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2).$implicit;t.Q6J("ngClass",t.WLB(5,F,e.AchievementWithTax<0,e.AchievementWithTax>0)),t.xp6(1),t.hij("",t.xi3(2,2,e.AchievementWithTax,".0-0")," ")}}function w1(n,i){if(1&n&&(t.TgZ(0,"td",33),t.YNc(1,U1,3,8,"span",35),t.YNc(2,F1,3,8,"span",35),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Q6J("ngIf",!e.pageData.IgnoreTax),t.xp6(1),t.Q6J("ngIf",e.pageData.IgnoreTax)}}function N1(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",31),t._uU(4),t.qZA(),t.YNc(5,C1,2,1,"td",45),t.YNc(6,A1,2,5,"td",46),t.YNc(7,q1,3,4,"td",25),t.YNc(8,D1,3,4,"td",25),t.TgZ(9,"td",33),t._uU(10),t.ALo(11,"number"),t.qZA(),t.YNc(12,y1,3,4,"td",25),t.ALo(13,"HideSumZero"),t.YNc(14,M1,7,17,"td",25),t.YNc(15,b1,3,8,"td",35),t.YNc(16,J1,3,4,"td",36),t.YNc(17,O1,3,4,"td",37),t.YNc(18,I1,3,4,"td",25),t.ALo(19,"HideSumZero"),t.YNc(20,w1,3,2,"td",25),t.ALo(21,"HideSumZero"),t.ALo(22,"HideSumZero"),t.qZA()),2&n){const e=i.$implicit,o=i.index,a=t.oxw(2);t.xp6(2),t.Oqu(o+1),t.xp6(2),t.Oqu(e.Name),t.xp6(1),t.Q6J("ngIf",a.isCompareData),t.xp6(1),t.Q6J("ngIf",a.isCompareData),t.xp6(1),t.Q6J("ngIf",a.data.WithCategory),t.xp6(1),t.Q6J("ngIf",!a.data.WithCategory),t.xp6(2),t.Oqu(t.xi3(11,14,e.SalesNet,".0-0")),t.xp6(2),t.Q6J("ngIf",!a.data.WithCategory&&t.xi3(13,17,a.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!a.data.WithCategory),t.xp6(1),t.Q6J("ngIf",a.isCompareData),t.xp6(1),t.Q6J("ngIf",a.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",a.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",t.xi3(19,20,a.data.Data,"SalesTarget")),t.xp6(2),t.Q6J("ngIf",t.xi3(21,23,a.data.Data,"AchievementWithTax")||t.xi3(22,26,a.data.Data,"Achievement"))}}function P1(n,i){1&n&&t._UZ(0,"td",53)}function L1(n,i){1&n&&t._UZ(0,"td",53)}function Q1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Count"),".0-0"),"")}}function Y1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Quantity"),".0-0"),"")}}function R1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Tax"),".0-0")," ")}}function k1(n,i){if(1&n&&(t.TgZ(0,"td",54),t.TgZ(1,"a",55),t._uU(2),t.ALo(3,"number"),t.ALo(4,"sum"),t.qZA(),t.qZA()),2&n){const e=t.oxw(2);t.xp6(2),t.Oqu(t.xi3(3,1,t.xi3(4,4,e.data.Data,"SalesWithTax"),".0-0"))}}function E1(n,i){if(1&n&&(t.TgZ(0,"td",50),t._uU(1),t.ALo(2,"number"),t.qZA()),2&n){const e=t.oxw(2);t.Q6J("ngClass",t.WLB(5,ct,e.comparation<0,e.comparation>0)),t.xp6(1),t.hij(" ",t.xi3(2,2,e.comparation,".0-0")," ")}}function H1(n,i){if(1&n&&(t.TgZ(0,"td",51),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Cost"),".0-0")," ")}}function V1(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.Oqu(t.xi3(2,1,t.xi3(3,4,e.data.Data,"Profit"),".0-0"))}}function B1(n,i){if(1&n&&(t.TgZ(0,"span"),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.xp6(1),t.hij("",t.xi3(2,1,t.xi3(3,4,e.data.Data,"ProfitWithTax"),".0-0")," ")}}function G1(n,i){if(1&n&&(t.TgZ(0,"td",52),t.YNc(1,V1,4,7,"span",7),t.YNc(2,B1,4,7,"span",7),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",!e.pageData.IgnoreTax),t.xp6(1),t.Q6J("ngIf",e.pageData.IgnoreTax)}}function j1(n,i){if(1&n&&(t.TgZ(0,"td",33),t._uU(1),t.ALo(2,"number"),t.ALo(3,"sum"),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.hij(" ",t.xi3(2,1,t.xi3(3,4,e.data.Data,"Expense"),".0-0"),"")}}function W1(n,i){if(1&n&&(t.TgZ(0,"span",50),t.ALo(1,"sum"),t.ALo(2,"sum"),t.ALo(3,"sum"),t.ALo(4,"sum"),t._uU(5),t.ALo(6,"number"),t.ALo(7,"sum"),t.ALo(8,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(23,F,t.xi3(1,2,e.data.Data,"Sales")/t.xi3(2,5,e.data.Data,"SalesTarget")<0,t.xi3(3,8,e.data.Data,"Sales")/t.xi3(4,11,e.data.Data,"SalesTarget")>0)),t.xp6(5),t.Oqu(t.xi3(6,14,t.xi3(7,17,e.data.Data,"Sales")/t.xi3(8,20,e.data.Data,"SalesTarget"),".0-0"))}}function $1(n,i){if(1&n&&(t.TgZ(0,"span",50),t.ALo(1,"sum"),t.ALo(2,"sum"),t.ALo(3,"sum"),t.ALo(4,"sum"),t._uU(5),t.ALo(6,"number"),t.ALo(7,"sum"),t.ALo(8,"sum"),t.qZA()),2&n){const e=t.oxw(3);t.Q6J("ngClass",t.WLB(23,F,t.xi3(1,2,e.data.Data,"SalesWithTax")/t.xi3(2,5,e.data.Data,"SalesTarget")<0,t.xi3(3,8,e.data.Data,"SalesWithTax")/t.xi3(4,11,e.data.Data,"SalesTarget")>0)),t.xp6(5),t.hij("",t.xi3(6,14,t.xi3(7,17,e.data.Data,"SalesWithTax")/t.xi3(8,20,e.data.Data,"SalesTarget"),".0-0")," ")}}function K1(n,i){if(1&n&&(t.TgZ(0,"td",33),t.YNc(1,W1,9,26,"span",35),t.YNc(2,$1,9,26,"span",35),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",!e.pageData.IgnoreTax),t.xp6(1),t.Q6J("ngIf",e.pageData.IgnoreTax)}}function X1(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",16),t.TgZ(1,"table",17),t.NdJ("matSortChange",function(a){return t.CHM(e),t.oxw().sortData(a)}),t.TgZ(2,"thead",18),t.TgZ(3,"tr"),t.TgZ(4,"th"),t._uU(5,"No."),t.qZA(),t.TgZ(6,"th",19),t._uU(7,"Type"),t.qZA(),t.YNc(8,p1,2,0,"th",20),t.YNc(9,c1,2,0,"th",20),t.YNc(10,_1,2,0,"th",21),t.YNc(11,u1,2,0,"th",22),t.TgZ(12,"th",23),t._uU(13,"Sales"),t.qZA(),t.YNc(14,g1,2,1,"th",24),t.ALo(15,"HideSumZero"),t.YNc(16,d1,2,1,"th",24),t.YNc(17,m1,2,0,"th",25),t.YNc(18,Z1,2,0,"th",26),t.YNc(19,h1,2,1,"th",24),t.YNc(20,x1,2,0,"th",27),t.ALo(21,"HideSumZero"),t.YNc(22,T1,2,0,"th",28),t.ALo(23,"HideSumZero"),t.ALo(24,"HideSumZero"),t.qZA(),t.qZA(),t.TgZ(25,"tbody"),t.YNc(26,N1,23,29,"tr",29),t.qZA(),t.TgZ(27,"tfoot"),t.TgZ(28,"tr",30),t._UZ(29,"td"),t._UZ(30,"td",31),t.YNc(31,P1,1,0,"td",32),t.YNc(32,L1,1,0,"td",32),t.YNc(33,Q1,4,7,"td",25),t.YNc(34,Y1,4,7,"td",25),t.TgZ(35,"td",33),t._uU(36),t.ALo(37,"number"),t.ALo(38,"sum"),t.qZA(),t.YNc(39,R1,4,7,"td",25),t.ALo(40,"HideSumZero"),t.YNc(41,k1,5,7,"td",34),t.YNc(42,E1,3,8,"td",35),t.YNc(43,H1,4,7,"td",36),t.YNc(44,G1,3,2,"td",37),t.YNc(45,j1,4,7,"td",25),t.ALo(46,"HideSumZero"),t.YNc(47,K1,3,2,"td",25),t.ALo(48,"HideSumZero"),t.ALo(49,"HideSumZero"),t.qZA(),t.qZA(),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(8),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(1),t.Q6J("ngIf",e.data.WithCategory),t.xp6(3),t.Q6J("ngIf",!e.data.WithCategory&&t.xi3(15,24,e.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",t.xi3(21,27,e.data.Data,"SalesTarget")),t.xp6(2),t.Q6J("ngIf",t.xi3(23,30,e.data.Data,"AchievementWithTax")||t.xi3(24,33,e.data.Data,"Achievement")),t.xp6(4),t.Q6J("ngForOf",e.data.Data),t.xp6(5),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(1),t.Q6J("ngIf",e.data.WithCategory),t.xp6(2),t.hij(" ",t.xi3(37,36,t.xi3(38,39,e.data.Data,"SalesNet"),".0-0")," "),t.xp6(3),t.Q6J("ngIf",!e.data.WithCategory&&t.xi3(40,42,e.data.Data,"Tax")),t.xp6(2),t.Q6J("ngIf",!e.data.WithCategory),t.xp6(1),t.Q6J("ngIf",e.isCompareData),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsCostVisible),t.xp6(1),t.Q6J("ngIf",e.pageData.IsExpense&&t.xi3(46,45,e.data.Data,"Expense")),t.xp6(2),t.Q6J("ngIf",t.xi3(48,48,e.data.Data,"AchievementWithTax")||t.xi3(49,51,e.data.Data,"Achievement"))}}function tZ(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div"),t.TgZ(1,"h6"),t._uU(2,"Interval for Clustering"),t.qZA(),t.TgZ(3,"input",6),t.NdJ("ngModelChange",function(a){return t.CHM(e),t.oxw().pageData.Filter.Interval=a}),t.qZA(),t.qZA()}if(2&n){const e=t.oxw();t.xp6(3),t.Q6J("ngModel",e.pageData.Filter.Interval)}}function eZ(n,i){if(1&n&&(t.TgZ(0,"tr"),t.TgZ(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",14),t._uU(4),t.ALo(5,"number"),t.qZA(),t._UZ(6,"td"),t.qZA()),2&n){const e=i.$implicit;t.xp6(2),t.Oqu(e.Key),t.xp6(2),t.Oqu(t.lcZ(5,2,e.Value))}}function nZ(n,i){if(1&n&&(t.TgZ(0,"div",7),t.TgZ(1,"table",8),t.TgZ(2,"thead",9),t.TgZ(3,"tr",10),t.TgZ(4,"th",11),t._uU(5,"Interval"),t.qZA(),t.TgZ(6,"th",12),t._uU(7,"Amount Of Products"),t.qZA(),t._UZ(8,"th"),t.qZA(),t.qZA(),t.TgZ(9,"tbody"),t.YNc(10,eZ,7,4,"tr",13),t.qZA(),t.qZA(),t.qZA()),2&n){const e=t.oxw();t.xp6(10),t.Q6J("ngForOf",e.data)}}const aZ=[{path:"Sales_Report/Standard/Detail",component:Wt},{path:"Sales_Report/Standard/Summary",component:De},{path:"Sales_Report/Standard/Top_Brand",component:we},{path:"Sales_Report/Standard/Top_Brand/Brand_Sales_Analysis",component:(()=>{class n extends m.n{constructor(e,o){super(e,"Report/CustomerBrand","ReportLoader/CustomerBrand"),this.httpService=e,this.csvConverter=o}sortData(e){const o=this.data.Data.slice();e.active&&""!==e.direction?(this.data.Data=o.sort((a,r)=>{const l="asc"===e.direction;switch(a.Name=null==a.Name?"":a.Name,r.Name=null==r.Name?"":r.Name,e.active){case"Name":return this.compare(a.Name.toLocaleLowerCase(),r.Name.toLocaleLowerCase(),l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);default:return 0}}),this.data.Detail=o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"SalesNTax":return this.compare(a.TotalSales,r.TotalSales,l);case"Cost":return this.compare(a.TotalCost,r.TotalCost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);default:return 0}})):this.data.Data=o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-brand-sales-analysis"]],features:[t.qOj],decls:11,vars:7,consts:[[3,"pageData","hideSearchBox","onSubmit"],["class","btn btn-outline-secondary mr-6",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","mr-6",3,"click"],[1,"fa","fa-upload"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose Brand",1,"outlet-multiple",3,"multiple","ngModel","items","ngModelChange"],["name","From",3,"date","dateChange"],["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",2,"width","280px"],[2,"width","190px"],[2,"width","155px"],[2,"width","130px"],[2,"min-width","124px"],["mat-sort-header","Quantity","text","Qty",1,"text-right",2,"min-width","66px"],["mat-sort-header","SalesNTax","text","Total Sales",1,"text-right",2,"min-width","112px"],["mat-sort-header","Cost","text","Total Cost","class","text-right","style","min-width: 113px",4,"ngIf"],["mat-sort-header","Profit","text","Profit","class","text-right","style","min-width: 114px",4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],[4,"ngIf"],["mat-sort-header","Cost","text","Total Cost",1,"text-right",2,"min-width","113px"],["mat-sort-header","Profit","text","Profit",1,"text-right",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-left",2,"min-width","124px"],[1,"border-top-0",2,"min-width","66px"],[1,"border-top-0","text-right",2,"min-width","112px"],["class","border-top-0 text-right","style","min-width: 113px",4,"ngIf"],["class","border-top-0 text-right","style","min-width: 114px",3,"ngClass",4,"ngIf"],[1,"border-top-0","text-right",2,"min-width","113px"],[1,"border-top-0","text-right",2,"min-width","114px",3,"ngClass"],[1,"footer"],["colspan","5"],[1,"text-right"],["class","text-right",4,"ngIf"],["class","text-right",3,"ngClass",4,"ngIf"],[1,"text-right",3,"ngClass"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"actions"),t.YNc(2,Em,3,0,"a",1),t.TgZ(3,"a",2),t._uU(4," Top Brand "),t.qZA(),t.qZA(),t.TgZ(5,"filters"),t.TgZ(6,"div",3),t.YNc(7,Hm,14,6,"div",4),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.TgZ(9,"div",5),t.YNc(10,n1,23,4,"div",6),t.qZA(),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(2),t.Q6J("ngIf",o.pageData.HasRoleExport),t.xp6(1),t.Q6J("routerLink",t.DdM(6,a1)),t.xp6(4),t.Q6J("ngIf",o.pageData.Filter),t.xp6(3),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,u.yS,c.w9,p.JJ,p.On,C.QB,p.Fj,M.b,Z.YE,Z.nU,s.sg,s.mk],pipes:[s.JJ],styles:[""]}),n})()},{path:"Sales_Report/Standard/Top_Customers",component:tn},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Age",component:un},{path:"Sales_Report/Standard/Top_Customers/Top_Customers_By_Gender",component:An},{path:"Sales_Report/Standard/Top_Customers/Top_Suppliers",component:Nn},{path:"Sales_Report/Standard/Products_Sold",component:fa},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_by_Outlet",component:Ia},{path:"Sales_Report/Standard/Products_Sold/Product_Sales",component:Va},{path:"Sales_Report/Standard/Products_Sold/Product_Sales_Vs_Delivery",component:ao},{path:"Sales_Report/Standard/Category_Sold",component:Do},{path:"Sales_Report/Standard/Category_Sold/Category_By_Outlet",component:No},{path:"Sales_Report/Standard/Category_Sold/Category",component:Yo},{path:"Sales_Report/Standard/Peak_Hour",component:$o},{path:"Sales_Report/Standard/Peak_Hour/Visitor",component:ar},{path:"Sales_Report/Standard/Peak_Hour/Peak_Hour",component:hr},{path:"Sales_Report/Standard/Daily",component:Sr},{path:"Sales_Report/Standard/Daily/Daily_Table",component:hi},{path:"Sales_Report/Standard/Daily/Yearly",component:V},{path:"Sales_Report/Standard/Monthly",component:wr},{path:"Sales_Report/Standard/Monthly/Monthly_Table",component:Pi},{path:"Sales_Report/Standard/Monthly/Yearly_Table",component:V},{path:"Sales_Report/Standard/Daily/Daily_Quantity",component:Hi},{path:"Sales_Report/Standard/Daily/Daily_Quantity/Monthly",component:$i},{path:"Sales_Report/Standard/Outlet_Performance",component:Ml},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Graphic",component:Nl},{path:"Sales_Report/Standard/Outlet_Performance/Detail",component:Ws},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Group_Performance",component:qp},{path:"Sales_Report/Standard/Outlet_Performance/Outlet_Monthly_Perfomance",component:Qp},{path:"Sales_Report/Standard/Sales_Order_Type",component:(()=>{class n extends m.n{constructor(e,o){super(e,"Report/OutletPerformanceByType","ReportLoader/OutletPerformance"),this.httpService=e,this.csvConverter=o,this.isCompareData=!1,this.hideMore=!0,this.DateFilterType=!1,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"}],this.Years=x.gT.GenerateYears((new Date).getFullYear(),11,!0),this.RadioDateFilterType=[{Key:!0,Value:"Month"},{Key:!1,Value:"Custom"}];const a=new Date;this.Year=a.getFullYear(),this.Month=a.getMonth()}YearMonthToDateRange(){const e=new Date;null==this.Year&&(this.Year=e.getFullYear()),null==this.Month&&(this.Month=e.getMonth()),this.pageData.Filter.From=new Date(this.Year,this.Month,1).toDateString(),this.pageData.Filter.To=new Date(this.Year,this.Month+1,0).toDateString()}sortData(e){const o=this.data.Data.slice();this.data.Data=e.active&&""!==e.direction?o.sort((a,r)=>{const l="asc"===e.direction;switch(e.active){case"Name":return this.compare(a.Name,r.Name,l);case"Count":return this.compare(a.Count,r.Count,l);case"Quantity":return this.compare(a.Quantity,r.Quantity,l);case"Gross":return this.compare(a.Gross,r.Gross,l);case"SalesNet":case"SalesTaxNet":return this.compare(a.SalesNet,r.SalesNet,l);case"Tax":return this.compare(a.Tax,r.Tax,l);case"SalesWithTax":return this.compare(a.SalesWithTax,r.SalesWithTax,l);case"Cost":return this.compare(a.Cost,r.Cost,l);case"Profit":return this.compare(a.Profit,r.Profit,l);case"ProfitWithTax":return this.compare(a.ProfitWithTax,r.ProfitWithTax,l);case"Expense":return this.compare(a.Expense,r.Expense,l);case"NetProfit":return this.compare(a.NetProfit,r.NetProfit,l);case"Target":case"SalesTarget":return this.compare(a.SalesTarget,r.SalesTarget,l);case"Achievement":return this.compare(a.Achievement,r.Achievement,l);default:return 0}}):o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-by-sales-order-type"]],features:[t.qOj],decls:6,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],[1,"d-flex"],["container","",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["container",""],["bindLabel","Name","bindValue","ID","placeholder","Choose..",3,"ngModel","items","ngModelChange"],["name","Date Filter",3,"model","options","modelChange"],[4,"ngIf"],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],["name","Compare",3,"model","modelChange"],[1,"row"],[1,"col-6","pr-2"],["placeholder","Year",3,"ngModel","items","ngModelChange","change","clear"],[1,"col-6","pl-2"],["bindLabel","Label","bindValue","ID","placeholder","Month",3,"ngModel","items","ngModelChange","change","clear"],[1,"container-fluid","mt-5"],["id","tableGrid","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","class","align-right",4,"ngIf"],["mat-sort-header","Quantity","class","align-right",4,"ngIf"],["mat-sort-header","SalesNet",1,"align-right"],["class","align-right",3,"mat-sort-header",4,"ngIf"],["class","text-right",4,"ngIf"],["mat-sort-header","Cost","class","align-right",4,"ngIf"],["mat-sort-header","Target","class","align-right",4,"ngIf"],["mat-sort-header","Achievement","class","align-right","title","Achievement",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"footer"],[1,"freeze","body"],["class","empty-column",4,"ngIf"],[1,"text-right"],["class","text-right text-primary",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","text-right text-danger",4,"ngIf"],["class","text-right text-success",4,"ngIf"],[2,"width","35px"],["mat-sort-header","Count",1,"align-right"],["mat-sort-header","Quantity",1,"align-right"],[1,"align-right",3,"mat-sort-header"],["mat-sort-header","Cost",1,"align-right"],["mat-sort-header","Target",1,"align-right"],["mat-sort-header","Achievement","title","Achievement",1,"align-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"],[1,"text-right","text-danger"],[1,"text-right","text-success"],[1,"empty-column"],[1,"text-right","text-primary"],[1,"font-weight-bold"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"filters"),t.TgZ(2,"div",1),t.YNc(3,s1,12,7,"div",2),t.qZA(),t.qZA(),t.TgZ(4,"content"),t.YNc(5,X1,50,54,"div",3),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(3),t.Q6J("ngIf",o.pageData.Filter),t.xp6(2),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,c.w9,p.JJ,p.On,q.P,C.QB,Z.YE,Z.nU,s.sg,s.mk,u.yS],pipes:[T.aQ,s.JJ,T.qU,s.uU],styles:[""]}),n})()},{path:"Sales_Report/Standard/Sales_Person",component:gc},{path:"Sales_Report/Standard/Sales_Person/Sales_Commission",component:vc},{path:"Sales_Report/Standard/Sales_Person/Commission_Report",component:Lc},{path:"Sales_Report/Standard/Sales_Person/Commission_Report/Commission_Report_Detail",component:Vc},{path:"Sales_Report/Standard/Discounted_Sales",component:gm},{path:"Purchases_Report/Detail",component:T_},{path:"Purchases_Report/Summary",component:y_},{path:"Purchases_Report/Top_Supplier",component:U_},{path:"Purchases_Report/Product_Bought",component:Y_},{path:"Purchases_Report/Product_Purchase_History",component:su},{path:"Purchases_Report/Daily_Purchase",component:gu},{path:"Purchases_Report/Daily_Purchase/Monthly_Purchase",component:hu},{path:"Purchases_Report/Purchase_Volume",component:Tu},{path:"Purchases_Report/Purchased_Sales_Report",component:Su},{path:"Purchases_Report/Outlet_Performance",component:ng},{path:"Purchases_Report/Outlet_Performance/Outlet_Group_Performance",component:Dg},{path:"Purchases_Report/Outlet_Performance/Outlet_Monthly_Perfomance",component:Lg},{path:"Sales_Report/Group/City",component:Hg},{path:"Sales_Report/Group/Type",component:$g},{path:"Sales_Report/Group/Customer_Group",component:ed},{path:"Sales_Report/Group/Sales_Group",component:pd},{path:"Sales_Report/Advanced/Tax_Report",component:Cd},{path:"Sales_Report/Advanced/Tax_Report/By_Outlet",component:Od},{path:"Sales_Report/Advanced/Product_Life_Cycle",component:Ld},{path:"Sales_Report/Advanced/Product_Profit",component:Bd},{path:"Sales_Report/Advanced/Exchanged_Sales",component:zd},{path:"Sales_Report/Advanced/Variant_Model_Rank",component:rm},{path:"Sales_Report/Standard/Discounted_Sales/Discounted_Products",component:o_},{path:"Return/Sales_Return",component:Tm},{path:"Return/Purchase_Return",component:vm},{path:"Sales_Report/Standard/Products_Sold/Invoice_Items",component:km},{path:"Sales_Report/Standard/Price_Analysis",component:(()=>{class n extends m.n{constructor(e,o){super(e,"Report/UnitPriceAnalysis","ReportLoader/PriceAnalysis"),this.httpService=e,this.csvConverter=o}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(g.O),t.Y36(h.O))},n.\u0275cmp=t.Xpm({type:n,selectors:[["CustomerDisplay-price-analysis"]],features:[t.qOj],decls:10,vars:4,consts:[[3,"pageData","hideSearchBox","onSubmit"],["container",""],[4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fas","fa-upload","mr-3"],["class","container-fluid mt-5",4,"ngIf"],["type","number",3,"ngModel","ngModelChange"],[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-right"]],template:function(e,o){1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return o.searchFromPageOne()}),t.TgZ(1,"filters"),t.TgZ(2,"div",1),t.YNc(3,tZ,4,1,"div",2),t.qZA(),t.qZA(),t.TgZ(4,"actions"),t.TgZ(5,"button",3),t.NdJ("click",function(){return o.exportCSV(o.csvConverter,"ReportExport/PriceAnalysis","PriceAnalysis.csv")}),t._UZ(6,"i",4),t._uU(7," Export "),t.qZA(),t.qZA(),t.TgZ(8,"content"),t.YNc(9,nZ,11,1,"div",5),t.qZA(),t.qZA()),2&e&&(t.Q6J("pageData",o.menuData)("hideSearchBox",!0),t.xp6(3),t.Q6J("ngIf",o.pageData.Filter),t.xp6(6),t.Q6J("ngIf",o.data))},directives:[d.p,s.O5,p.wV,p.Fj,p.JJ,p.On,s.sg],pipes:[s.JJ],styles:[""]}),n})()},{path:"",redirectTo:"Sales_Report/Standard/Products_Sold",pathMatch:"full"}];let oZ=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[[u.Bz.forChild(aZ)],u.Bz]}),n})();var rZ=f(1768),iZ=f(2060),lZ=f(315);let sZ=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[s.uU],imports:[[d.R,T.dr,s.ez,oZ,c.A0,C.ZU,p.u5,p.UX,ut.FA,L.XK,gt.Fk,dt.c,L.Ng,mt.Nh,k.AV,Q.TU,Zt.vV,c.A0,Z.JX,_t.p0,rZ.X,I.d,q.K,U.N,J.Z,D.Q,iZ.I,lZ.T]]}),n})()}}]);