dealpos 12.6.5 → 12.6.6

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.
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkPOS=self.webpackChunkPOS||[]).push([[2972],{22972:(J,D,s)=>{s.r(D),s.d(D,{DashboardV2Component:()=>et});var l=s(81180),d=s(96814),_=s(81401),x=s(40652),m=s(41927),T=s(37398),t=s(65879),y=s(58763);let f=(()=>{var o;class r{constructor(e){(0,l.Z)(this,"httpService",void 0),this.httpService=e}getConfig(){return this.httpService.get(m.W.GetDashboardConfig).pipe((0,T.U)(e=>e.DashboardData))}getDashboardSales(e){return this.httpService.post(m.W.GetDashboardSales,e)}getDashboardPurchase(e){return this.httpService.post(m.W.GetDashboardPurchase,e)}getDashboardDebt(e){return this.httpService.post(m.W.GetDashboardDebt,e)}getDashboardProduct(e){return this.httpService.post(m.W.GetDashboardProduct,e)}getDashboardInventory(e){return this.httpService.post(m.W.GetDashboardInventory,e)}getLineChartConfig(){return{credits:{enabled:!1},accessibility:{enabled:!1},chart:{type:"spline",ignoreHiddenSeries:!1,height:400,spacingTop:-20,spacingRight:15},title:{text:"<br/>"},legend:{enabled:!1},xAxis:{type:"datetime",labels:{style:{color:"gray"}},lineColor:"gray",tickColor:"gray"},yAxis:{min:0,title:{text:""},labels:{formatter:function(){const n=this.value;if(0==n)return"";var u=parseInt(n).toString();return u.length<=4?parseFloat(n).toString():u.length>=5&&u.length<=6?n/1e3+" k":u.length>=7&&u.length<=9?n/1e6+" MM":u.length>=10?n/1e9+" BN":void 0},style:{color:"gray"}}},plotOptions:{series:{pointInterval:864e5},spline:{lineWidth:4,states:{hover:{lineWidth:6}},marker:{enabled:!1}}},tooltip:{shared:!0},series:[]}}}return o=r,(0,l.Z)(r,"\u0275fac",function(e){return new(e||o)(t.LFG(y.O))}),(0,l.Z)(r,"\u0275prov",t.Yz7({token:o,factory:o.\u0275fac})),r})();var i=s(86864),v=s(81845);const S=s(40274),P=s(85518),I=s(5674);S(v),P(v),I(v),P(v);let U=(()=>{var o;class r{constructor(){(0,l.Z)(this,"config",void 0),(0,l.Z)(this,"containerId",void 0),(0,l.Z)(this,"htmlIsRendered",!1)}ngAfterViewInit(){i.g.IsNotEmpty(this.containerId)&&(this.initChart(),this.htmlIsRendered=!0)}ngOnChanges(e){e.config&&e.config.currentValue&&this.htmlIsRendered&&this.initChart()}initChart(){v.chart(this.containerId,this.config),v.setOptions({lang:{thousandsSep:","}})}}return o=r,(0,l.Z)(r,"\u0275fac",function(e){return new(e||o)}),(0,l.Z)(r,"\u0275cmp",t.Xpm({type:o,selectors:[["app-chart-container"]],inputs:{config:"config",containerId:"containerId"},standalone:!0,features:[t.TTD,t.jDz],decls:1,vars:1,consts:[[3,"id"]],template:function(e,n){1&e&&t._UZ(0,"div",0),2&e&&t.Q6J("id",n.containerId)}})),r})(),M=(()=>{var o;class r{constructor(e){(0,l.Z)(this,"dashboardService",void 0),(0,l.Z)(this,"chartConfig",void 0),(0,l.Z)(this,"chartData",void 0),(0,l.Z)(this,"salesData",void 0),(0,l.Z)(this,"dashboardConfig",void 0),this.dashboardService=e,this.chartConfig=this.dashboardService.getLineChartConfig()}ngOnChanges(e){if(e.chartData&&e.chartData.currentValue){let n=e?.chartData?.currentValue?.Series;n=n?.map(u=>(u.type=null,u)),this.chartConfig={...this.chartConfig,series:n},this.setSeriesPointStart()}}setSeriesPointStart(){const e=new Date(this.chartData.From);this.chartConfig.plotOptions.series.pointStart=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())}}return o=r,(0,l.Z)(r,"\u0275fac",function(e){return new(e||o)(t.Y36(f))}),(0,l.Z)(r,"\u0275cmp",t.Xpm({type:o,selectors:[["app-sales-widget"]],inputs:{chartData:"chartData",salesData:"salesData",dashboardConfig:"dashboardConfig"},standalone:!0,features:[t._Bn([f]),t.TTD,t.jDz],decls:36,vars:22,consts:[[1,"d-flex","align-items-top","mt-12"],[1,"pe-6",2,"width","81%"],["containerId","salesChart",3,"config"],[1,"ps-4",2,"width","19%"],[1,"border","rounded","p-8","w-100","h-auto"],[1,"fw-normal"],[1,"text-end","mb-6"],[1,"fs-4"],[1,"text-success"],[1,"text-end"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"app-chart-container",2),t.qZA(),t.TgZ(3,"div",3)(4,"div",4)(5,"h2",5),t._uU(6,"Today"),t.qZA(),t.TgZ(7,"div",6)(8,"div",7),t._uU(9,"Sales"),t.qZA(),t.TgZ(10,"h2",8),t._uU(11),t.ALo(12,"number"),t.qZA()(),t.TgZ(13,"div",6)(14,"div",7),t._uU(15,"Sales + Tax"),t.qZA(),t.TgZ(16,"h2",8),t._uU(17),t.ALo(18,"number"),t.qZA()(),t.TgZ(19,"div",6)(20,"div",7),t._uU(21,"Cost"),t.qZA(),t.TgZ(22,"h2",8),t._uU(23),t.ALo(24,"number"),t.qZA()(),t.TgZ(25,"div",6)(26,"div",7),t._uU(27,"Profit"),t.qZA(),t.TgZ(28,"h2",8),t._uU(29),t.ALo(30,"number"),t.qZA()(),t.TgZ(31,"div",9)(32,"div",7),t._uU(33,"Top Outlet"),t.qZA(),t.TgZ(34,"h2",8),t._uU(35),t.qZA()()()()()),2&e&&(t.xp6(2),t.Q6J("config",n.chartConfig),t.xp6(9),t.AsE("",null==n.dashboardConfig?null:n.dashboardConfig.CurrencySymbol," ",t.xi3(12,10,null==n.salesData?null:n.salesData.Sales,null==n.dashboardConfig?null:n.dashboardConfig.FractionDigit),""),t.xp6(6),t.AsE("",null==n.dashboardConfig?null:n.dashboardConfig.CurrencySymbol," ",t.xi3(18,13,null==n.salesData?null:n.salesData.SalesWithTax,null==n.dashboardConfig?null:n.dashboardConfig.FractionDigit),""),t.xp6(6),t.AsE("",null==n.dashboardConfig?null:n.dashboardConfig.CurrencySymbol," ",t.xi3(24,16,null==n.salesData?null:n.salesData.Cost,null==n.dashboardConfig?null:n.dashboardConfig.FractionDigit),""),t.xp6(6),t.AsE("",null==n.dashboardConfig?null:n.dashboardConfig.CurrencySymbol," ",t.xi3(30,19,null==n.salesData?null:n.salesData.Profit,null==n.dashboardConfig?null:n.dashboardConfig.FractionDigit),""),t.xp6(6),t.Oqu(null==n.salesData||null==n.salesData.TopOutlet?null:n.salesData.TopOutlet.Name))},dependencies:[d.ez,d.JJ,U],styles:[".text-success[_ngcontent-%COMP%]{color:#66a822!important}"]})),r})(),w=(()=>{var o;class r{constructor(e){(0,l.Z)(this,"dashboardService",void 0),(0,l.Z)(this,"chartConfig",void 0),(0,l.Z)(this,"chartData",void 0),(0,l.Z)(this,"purchaseData",void 0),(0,l.Z)(this,"dashboardConfig",void 0),this.dashboardService=e,this.chartConfig=this.dashboardService.getLineChartConfig()}ngOnChanges(e){if(e.chartData&&e.chartData.currentValue){let n=e?.chartData?.currentValue?.Series;n=n.map(u=>(u.type=null,u)),this.chartConfig={...this.chartConfig,series:n}}}}return o=r,(0,l.Z)(r,"\u0275fac",function(e){return new(e||o)(t.Y36(f))}),(0,l.Z)(r,"\u0275cmp",t.Xpm({type:o,selectors:[["app-purchase-widget"]],inputs:{chartData:"chartData",purchaseData:"purchaseData",dashboardConfig:"dashboardConfig"},standalone:!0,features:[t._Bn([f]),t.TTD,t.jDz],decls:25,vars:16,consts:[[1,"d-flex","align-items-top","mt-12"],[1,"pe-6",2,"width","81%"],["containerId","purchaseChart",3,"config"],[1,"ps-4",2,"width","19%"],[1,"border","rounded","p-8","w-100","h-auto"],[1,"fw-normal"],[1,"text-end","mb-6"],[1,"fs-4"],[1,"text-success"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"app-chart-container",2),t.qZA(),t.TgZ(3,"div",3)(4,"div",4)(5,"h2",5),t._uU(6,"Today"),t.qZA(),t.TgZ(7,"div",6)(8,"div",7),t._uU(9,"Purchase"),t.qZA(),t.TgZ(10,"h2",8),t._uU(11),t.ALo(12,"number"),t.qZA()(),t.TgZ(13,"div",6)(14,"div",7),t._uU(15,"Purchase + Tax"),t.qZA(),t.TgZ(16,"h2",8),t._uU(17),t.ALo(18,"number"),t.qZA()(),t.TgZ(19,"div",6)(20,"div",7),t._uU(21,"Tax"),t.qZA(),t.TgZ(22,"h2",8),t._uU(23),t.ALo(24,"number"),t.qZA()()()()()),2&e&&(t.xp6(2),t.Q6J("config",n.chartConfig),t.xp6(9),t.AsE("",null==n.dashboardConfig?null:n.dashboardConfig.CurrencySymbol," ",t.xi3(12,7,null==n.purchaseData?null:n.purchaseData.Purchase,null==n.dashboardConfig?null:n.dashboardConfig.FractionDigit),""),t.xp6(6),t.AsE("",null==n.dashboardConfig?null:n.dashboardConfig.CurrencySymbol," ",t.xi3(18,10,null==n.purchaseData?null:n.purchaseData.PurchaseWithTax,null==n.dashboardConfig?null:n.dashboardConfig.FractionDigit),""),t.xp6(6),t.AsE("",null==n.dashboardConfig?null:n.dashboardConfig.CurrencySymbol," ",t.xi3(24,13,null==n.purchaseData?null:n.purchaseData.Tax,null==n.dashboardConfig?null:n.dashboardConfig.FractionDigit),""))},dependencies:[d.ez,d.JJ,U],styles:[".text-success[_ngcontent-%COMP%]{color:#66a822!important}"]})),r})();var Z=s(67081),A=s(99397);function c(o,r){if(1&o&&(t.ynx(0),t.TgZ(1,"div",3),t._uU(2),t.qZA(),t.TgZ(3,"h2"),t._uU(4),t.qZA(),t.BQk()),2&o){const a=t.oxw();t.xp6(2),t.Oqu(a.title),t.xp6(2),t.Oqu(a.content)}}function b(o,r){if(1&o&&(t.TgZ(0,"div",4),t._uU(1),t.qZA()),2&o){const a=t.oxw();t.xp6(1),t.Oqu(a.title)}}const p=function(o,r){return{active:o,"d-flex align-items-center":r}};let g=(()=>{var o;class r{constructor(){(0,l.Z)(this,"title",void 0),(0,l.Z)(this,"isActive",void 0),(0,l.Z)(this,"content",void 0),(0,l.Z)(this,"showValue",void 0)}ngOnInit(){}}return o=r,(0,l.Z)(r,"\u0275fac",function(e){return new(e||o)}),(0,l.Z)(r,"\u0275cmp",t.Xpm({type:o,selectors:[["app-card-widget"]],inputs:{title:"title",isActive:"isActive",content:"content",showValue:"showValue"},standalone:!0,features:[t.jDz],decls:4,vars:6,consts:[[1,"card-widget",3,"ngClass"],[4,"ngIf","ngIfElse"],["TITLE_ONLY",""],[1,"fs-4"],[1,"fw-normal","fs-4"]],template:function(e,n){if(1&e&&(t.TgZ(0,"div",0),t.YNc(1,c,5,2,"ng-container",1),t.YNc(2,b,2,1,"ng-template",null,2,t.W1O),t.qZA()),2&e){const u=t.MAs(3);t.Q6J("ngClass",t.WLB(3,p,n.isActive,0==n.showValue)),t.xp6(1),t.Q6J("ngIf",n.showValue)("ngIfElse",u)}},dependencies:[d.ez,d.mk,d.O5],styles:[".card-widget[_ngcontent-%COMP%]{padding:20px;border-radius:6px;min-height:95px;border:.5px solid #e4e4e4}.active[_ngcontent-%COMP%]{background-color:#f0f0f0}"]})),r})();const h=function(o){return{"table-border-bottom-0":o}};function C(o,r){if(1&o&&(t.TgZ(0,"tr",13)(1,"td",11),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.ALo(8,"number"),t.qZA()()),2&o){const a=r.$implicit,e=r.index,n=t.oxw();t.Q6J("ngClass",t.VKq(9,h,(null==n.debtData||null==n.debtData.TopReceivable?null:n.debtData.TopReceivable.length)==e+1)),t.xp6(2),t.Oqu(null==a?null:a.Name),t.xp6(2),t.Oqu(t.xi3(5,4,null==a?null:a.Credit,null==n.dashboardConfig?null:n.dashboardConfig.FractionDigit)),t.xp6(3),t.Oqu(t.lcZ(8,7,null==a?null:a.Limit))}}function O(o,r){if(1&o&&(t.TgZ(0,"tr",13)(1,"td",11),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.ALo(8,"number"),t.qZA()()),2&o){const a=r.$implicit,e=r.index,n=t.oxw();t.Q6J("ngClass",t.VKq(9,h,(null==n.debtData||null==n.debtData.TopPayable?null:n.debtData.TopPayable.length)==e+1)),t.xp6(2),t.Oqu(null==a?null:a.Name),t.xp6(2),t.Oqu(t.xi3(5,4,null==a?null:a.Credit,null==n.dashboardConfig?null:n.dashboardConfig.FractionDigit)),t.xp6(3),t.Oqu(t.lcZ(8,7,null==a?null:a.Limit))}}let q=(()=>{var o;class r{constructor(){(0,l.Z)(this,"debtData",void 0),(0,l.Z)(this,"dashboardConfig",void 0)}ngOnInit(){}}return o=r,(0,l.Z)(r,"\u0275fac",function(e){return new(e||o)}),(0,l.Z)(r,"\u0275cmp",t.Xpm({type:o,selectors:[["app-debt-widget"]],inputs:{debtData:"debtData",dashboardConfig:"dashboardConfig"},standalone:!0,features:[t.jDz],decls:62,vars:18,consts:[[1,"row","mt-12"],[1,"col-6"],[1,"card","mb-0"],[1,"card-body","p-6"],[1,"row","d-flex","align-items-center","justify-content-between"],[1,"lh-base","col-6","text-center"],[1,"fs-4"],[1,"text-success"],[1,"card"],[1,"card-body","p-0"],[1,"table"],[1,"ps-8"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"div",6),t._uU(7,"Debt Receivable"),t.qZA(),t.TgZ(8,"h2",7),t._uU(9),t.ALo(10,"number"),t.qZA()(),t.TgZ(11,"div",5)(12,"div",6),t._uU(13,"Number Of Transaction"),t.qZA(),t.TgZ(14,"h2",7),t._uU(15),t.ALo(16,"number"),t.qZA()()()()()(),t.TgZ(17,"div",1)(18,"div",2)(19,"div",3)(20,"div",4)(21,"div",5)(22,"div",6),t._uU(23,"Debt Payable"),t.qZA(),t.TgZ(24,"h2",7),t._uU(25),t.ALo(26,"number"),t.qZA()(),t.TgZ(27,"div",5)(28,"div",6),t._uU(29,"Number Of Transaction"),t.qZA(),t.TgZ(30,"h2",7),t._uU(31),t.ALo(32,"number"),t.qZA()()()()()()(),t.TgZ(33,"div",0)(34,"div",1)(35,"div",8)(36,"div",9)(37,"table",10)(38,"thead")(39,"tr")(40,"th",11),t._uU(41,"Customer Name"),t.qZA(),t.TgZ(42,"th"),t._uU(43,"Debt"),t.qZA(),t.TgZ(44,"th"),t._uU(45,"Limit"),t.qZA()()(),t.TgZ(46,"tbody"),t.YNc(47,C,9,11,"tr",12),t.qZA()()()()(),t.TgZ(48,"div",1)(49,"div",8)(50,"div",9)(51,"table",10)(52,"thead")(53,"tr")(54,"th",11),t._uU(55,"Supplier Name"),t.qZA(),t.TgZ(56,"th"),t._uU(57,"Debt"),t.qZA(),t.TgZ(58,"th"),t._uU(59,"Limit"),t.qZA()()(),t.TgZ(60,"tbody"),t.YNc(61,O,9,11,"tr",12),t.qZA()()()()()()),2&e&&(t.xp6(9),t.AsE("",null==n.dashboardConfig?null:n.dashboardConfig.CurrencySymbol," ",t.xi3(10,8,null==n.debtData?null:n.debtData.Receivable,null==n.dashboardConfig?null:n.dashboardConfig.FractionDigit),""),t.xp6(6),t.Oqu(t.lcZ(16,11,null==n.debtData?null:n.debtData.ReceivableQuantity)),t.xp6(10),t.AsE("",null==n.dashboardConfig?null:n.dashboardConfig.CurrencySymbol," ",t.xi3(26,13,null==n.debtData?null:n.debtData.Payable,null==n.dashboardConfig?null:n.dashboardConfig.FractionDigit),""),t.xp6(6),t.Oqu(t.lcZ(32,16,null==n.debtData?null:n.debtData.PayableQuantity)),t.xp6(16),t.Q6J("ngForOf",null==n.debtData?null:n.debtData.TopReceivable),t.xp6(14),t.Q6J("ngForOf",null==n.debtData?null:n.debtData.TopPayable))},dependencies:[d.ez,d.mk,d.sg,d.JJ],styles:[".text-success[_ngcontent-%COMP%]{color:#66a822!important}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border-top:0px!important;border-left:0px!important;border-right:0px!important}tbody[_ngcontent-%COMP%] tr.table-border-bottom-0[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px!important}"]})),r})();var L=s(56223);const Q=function(o){return{"table-border-bottom-0":o}};function V(o,r){if(1&o&&(t.TgZ(0,"tr",7)(1,"td",5),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.ALo(8,"number"),t.qZA()()),2&o){const a=r.$implicit,e=r.index,n=t.oxw();t.Q6J("ngClass",t.VKq(9,Q,(null==n.productData||null==n.productData.TopProduct?null:n.productData.TopProduct.length)==e+1)),t.xp6(2),t.Oqu(null==a?null:a.Name),t.xp6(2),t.Oqu(t.lcZ(5,4,null==a?null:a.Quantity)),t.xp6(3),t.Oqu(t.xi3(8,6,null==a?null:a.Total,null==n.dashboardConfig?null:n.dashboardConfig.FractionDigit))}}function R(o,r){if(1&o&&(t.TgZ(0,"tr",7)(1,"td",5),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.ALo(5,"number"),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.ALo(8,"number"),t.qZA()()),2&o){const a=r.$implicit,e=r.index,n=t.oxw();t.Q6J("ngClass",t.VKq(9,Q,(null==n.productData||null==n.productData.TopBrand?null:n.productData.TopBrand.length)==e+1)),t.xp6(2),t.Oqu(null==a?null:a.Name),t.xp6(2),t.Oqu(t.lcZ(5,4,null==a?null:a.Quantity)),t.xp6(3),t.Oqu(t.xi3(8,6,null==a?null:a.Total,null==n.dashboardConfig?null:n.dashboardConfig.FractionDigit))}}let E=(()=>{var o;class r{constructor(){(0,l.Z)(this,"productData",void 0),(0,l.Z)(this,"dashboardConfig",void 0)}ngOnInit(){}}return o=r,(0,l.Z)(r,"\u0275fac",function(e){return new(e||o)}),(0,l.Z)(r,"\u0275cmp",t.Xpm({type:o,selectors:[["app-product-widget"]],inputs:{productData:"productData",dashboardConfig:"dashboardConfig"},standalone:!0,features:[t.jDz],decls:29,vars:2,consts:[[1,"row","mt-12"],[1,"col-6"],[1,"card"],[1,"card-body","p-0"],[1,"table"],[1,"ps-8"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"table",4)(5,"thead")(6,"tr")(7,"th",5),t._uU(8,"Product Name"),t.qZA(),t.TgZ(9,"th"),t._uU(10,"Sold"),t.qZA(),t.TgZ(11,"th"),t._uU(12,"Total"),t.qZA()()(),t.TgZ(13,"tbody"),t.YNc(14,V,9,11,"tr",6),t.qZA()()()()(),t.TgZ(15,"div",1)(16,"div",2)(17,"div",3)(18,"table",4)(19,"thead")(20,"tr")(21,"th",5),t._uU(22,"Brand Name"),t.qZA(),t.TgZ(23,"th"),t._uU(24,"Sold"),t.qZA(),t.TgZ(25,"th"),t._uU(26,"Total"),t.qZA()()(),t.TgZ(27,"tbody"),t.YNc(28,R,9,11,"tr",6),t.qZA()()()()()()),2&e&&(t.xp6(14),t.Q6J("ngForOf",null==n.productData?null:n.productData.TopProduct),t.xp6(14),t.Q6J("ngForOf",null==n.productData?null:n.productData.TopBrand))},dependencies:[d.ez,d.mk,d.sg,d.JJ],styles:["table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border-top:0px!important;border-left:0px!important;border-right:0px!important}tbody[_ngcontent-%COMP%] tr.table-border-bottom-0[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px!important}"]})),r})();var N=s(54807);const W=function(o){return{"table-border-bottom-0":o}};function $(o,r){if(1&o&&(t.TgZ(0,"tr",17)(1,"td",15),t._uU(2),t.ALo(3,"date"),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.TgZ(6,"td"),t._uU(7),t.ALo(8,"number"),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.ALo(11,"number"),t.qZA()()),2&o){const a=r.$implicit,e=r.index,n=t.oxw();t.Q6J("ngClass",t.VKq(12,W,(null==n.inventoryData||null==n.inventoryData.TransferOrder||null==n.inventoryData.TransferOrder.TopDispatched?null:n.inventoryData.TransferOrder.TopDispatched.length)==e+1)),t.xp6(2),t.Oqu(t.xi3(3,5,null==a?null:a.Date,"dd MMM yyyy")),t.xp6(3),t.Oqu(null==a?null:a.Number),t.xp6(2),t.Oqu(t.lcZ(8,8,null==a?null:a.Quantity)),t.xp6(3),t.Oqu(t.lcZ(11,10,null==a?null:a.Price))}}const Y=function(o){return{"text-danger":o}};function B(o,r){if(1&o&&(t.TgZ(0,"tr",17)(1,"td",15),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.ALo(7,"number"),t.qZA(),t.TgZ(8,"td"),t._uU(9),t.ALo(10,"number"),t.qZA(),t.TgZ(11,"td")(12,"span",17),t._uU(13),t.ALo(14,"number"),t.qZA()()()),2&o){const a=r.$implicit,e=r.index,n=t.oxw();t.Q6J("ngClass",t.VKq(13,W,(null==n.inventoryData||null==n.inventoryData.Inventory||null==n.inventoryData.Inventory.TopROP?null:n.inventoryData.Inventory.TopROP.length)==e+1)),t.xp6(2),t.Oqu(null==a?null:a.Outlet),t.xp6(2),t.Oqu(null==a?null:a.Product),t.xp6(2),t.Oqu(t.lcZ(7,7,null==a?null:a.Inventory)),t.xp6(3),t.Oqu(t.lcZ(10,9,null==a?null:a.ROP)),t.xp6(3),t.Q6J("ngClass",t.VKq(15,Y,(null==a?null:a.Different)<0)),t.xp6(1),t.hij(" ",t.lcZ(14,11,null==a?null:a.Different)," ")}}let z=(()=>{var o;class r{constructor(){(0,l.Z)(this,"inventoryData",void 0),(0,l.Z)(this,"dashboardConfig",void 0)}ngOnInit(){}}return o=r,(0,l.Z)(r,"\u0275fac",function(e){return new(e||o)}),(0,l.Z)(r,"\u0275cmp",t.Xpm({type:o,selectors:[["app-inventory-widget"]],inputs:{inventoryData:"inventoryData",dashboardConfig:"dashboardConfig"},standalone:!0,features:[t.jDz],decls:73,vars:14,consts:[[1,"row","mt-12"],[1,"col-6"],[1,"card","mb-0"],[1,"card-body","py-10"],[1,"row","d-flex","align-items-center"],[1,"col-6","text-center","py-3","border-end"],[1,"text-success",2,"font-size","40px"],[1,"fs-5"],[1,"col-6","text-center","py-3"],[1,"col-6","text-center","py-2","border-end"],[1,"col-6","text-center","py-2"],[1,"fw-normal","ps-2",2,"padding-bottom","15px"],[1,"card"],[1,"card-body","p-0"],[1,"table"],[1,"ps-8"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"div")(7,"div",6),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"div",7),t._uU(11,"Dispatched Transfer Order"),t.qZA()()(),t.TgZ(12,"div",8)(13,"div",6),t._uU(14),t.ALo(15,"number"),t.qZA(),t.TgZ(16,"div",7),t._uU(17,"Total Quantity"),t.qZA()()()()()(),t.TgZ(18,"div",1)(19,"div",2)(20,"div",3)(21,"div",4)(22,"div",9)(23,"div",6),t._uU(24),t.ALo(25,"number"),t.qZA(),t.TgZ(26,"div",7),t._uU(27,"Inventory ROP"),t.qZA()(),t.TgZ(28,"div",10)(29,"div",6),t._uU(30),t.ALo(31,"number"),t.qZA(),t.TgZ(32,"div",7),t._uU(33,"Inventory Max"),t.qZA()()()()()()(),t.TgZ(34,"div",0)(35,"div",1)(36,"h4",11),t._uU(37,"Top 5 Dispatched Transfer Order"),t.qZA(),t.TgZ(38,"div",12)(39,"div",13)(40,"table",14)(41,"thead")(42,"tr")(43,"th",15),t._uU(44,"Date"),t.qZA(),t.TgZ(45,"th"),t._uU(46,"Number"),t.qZA(),t.TgZ(47,"th"),t._uU(48,"Qty"),t.qZA(),t.TgZ(49,"th"),t._uU(50,"Price"),t.qZA()()(),t.TgZ(51,"tbody"),t.YNc(52,$,12,14,"tr",16),t.qZA()()()()(),t.TgZ(53,"div",1)(54,"h4",11),t._uU(55,"Top 5 Inventory ROP"),t.qZA(),t.TgZ(56,"div",12)(57,"div",13)(58,"table",14)(59,"thead")(60,"tr")(61,"th",15),t._uU(62,"Outlet"),t.qZA(),t.TgZ(63,"th"),t._uU(64,"Product"),t.qZA(),t.TgZ(65,"th"),t._uU(66,"INV"),t.qZA(),t.TgZ(67,"th"),t._uU(68,"ROP"),t.qZA(),t.TgZ(69,"th"),t._uU(70,"DIFF"),t.qZA()()(),t.TgZ(71,"tbody"),t.YNc(72,B,15,17,"tr",16),t.qZA()()()()()()),2&e&&(t.xp6(8),t.Oqu(t.lcZ(9,6,null==n.inventoryData||null==n.inventoryData.TransferOrder?null:n.inventoryData.TransferOrder.Total)),t.xp6(6),t.hij("",t.lcZ(15,8,null==n.inventoryData||null==n.inventoryData.TransferOrder?null:n.inventoryData.TransferOrder.TotalQuantity)," "),t.xp6(10),t.hij("",t.lcZ(25,10,null==n.inventoryData||null==n.inventoryData.Inventory?null:n.inventoryData.Inventory.ProductReorderCount)," "),t.xp6(6),t.hij("",t.lcZ(31,12,null==n.inventoryData||null==n.inventoryData.Inventory?null:n.inventoryData.Inventory.ProductOverStock)," "),t.xp6(22),t.Q6J("ngForOf",null==n.inventoryData||null==n.inventoryData.TransferOrder?null:n.inventoryData.TransferOrder.TopDispatched),t.xp6(20),t.Q6J("ngForOf",null==n.inventoryData||null==n.inventoryData.Inventory?null:n.inventoryData.Inventory.TopROP))},dependencies:[d.ez,d.mk,d.sg,d.JJ,d.uU],styles:[".text-success[_ngcontent-%COMP%]{color:#66a822!important}table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border-top:0px!important;border-left:0px!important;border-right:0px!important}tbody[_ngcontent-%COMP%] tr.table-border-bottom-0[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px!important}"]})),r})();var j=s(67547);function k(o,r){if(1&o){const a=t.EpF();t.ynx(0),t.TgZ(1,"div",12),t.NdJ("click",function(){const u=t.CHM(a).index,F=t.oxw(2);return t.KtG(F.onClickWidget(u))}),t._UZ(2,"app-card-widget",13),t.ALo(3,"number"),t.qZA(),t.BQk()}if(2&o){const a=r.$implicit,e=t.oxw().ngIf,n=t.oxw();t.xp6(2),t.Q6J("title",a.title)("content",e.CurrencySymbol+" "+(null==a.value?"---.---,-":t.lcZ(3,4,a.value)))("showValue",a.showValue)("isActive",a.id==n.activeTab)}}function H(o,r){if(1&o&&(t.ynx(0),t._UZ(1,"app-sales-widget",14),t.ALo(2,"async"),t.ALo(3,"async"),t.BQk()),2&o){const a=t.oxw().ngIf,e=t.oxw();let n,u;t.xp6(1),t.Q6J("dashboardConfig",a)("salesData",null==(n=t.lcZ(2,3,e.salesData$))?null:n.PageData)("chartData",null==(u=t.lcZ(3,5,e.salesData$))?null:u.HighChartData)}}function X(o,r){if(1&o&&(t.ynx(0),t._UZ(1,"app-purchase-widget",15),t.ALo(2,"async"),t.ALo(3,"async"),t.BQk()),2&o){const a=t.oxw().ngIf,e=t.oxw();let n,u;t.xp6(1),t.Q6J("dashboardConfig",a)("purchaseData",null==(n=t.lcZ(2,3,e.purchaseData$))?null:n.PageData)("chartData",null==(u=t.lcZ(3,5,e.purchaseData$))?null:u.HighChartData)}}function G(o,r){if(1&o&&(t.ynx(0),t._UZ(1,"app-debt-widget",16),t.ALo(2,"async"),t.BQk()),2&o){const a=t.oxw().ngIf,e=t.oxw();let n;t.xp6(1),t.Q6J("dashboardConfig",a)("debtData",null==(n=t.lcZ(2,2,e.debtData$))?null:n.PageData)}}function K(o,r){if(1&o&&(t.ynx(0),t._UZ(1,"app-product-widget",17),t.ALo(2,"async"),t.BQk()),2&o){const a=t.oxw().ngIf,e=t.oxw();let n;t.xp6(1),t.Q6J("dashboardConfig",a)("productData",null==(n=t.lcZ(2,2,e.productData$))?null:n.PageData)}}function tt(o,r){if(1&o&&(t.ynx(0),t._UZ(1,"app-inventory-widget",18),t.ALo(2,"async"),t.BQk()),2&o){const a=t.oxw().ngIf,e=t.oxw();let n;t.xp6(1),t.Q6J("dashboardConfig",a)("inventoryData",null==(n=t.lcZ(2,2,e.inventoryData$))?null:n.PageData)}}function nt(o,r){if(1&o&&(t.ynx(0),t.TgZ(1,"div",8)(2,"div",9)(3,"div",10),t.YNc(4,k,4,6,"ng-container",11),t.qZA(),t.YNc(5,H,4,7,"ng-container",7),t.YNc(6,X,4,7,"ng-container",7),t.YNc(7,G,3,4,"ng-container",7),t.YNc(8,K,3,4,"ng-container",7),t.YNc(9,tt,3,4,"ng-container",7),t.qZA()(),t.BQk()),2&o){const a=t.oxw();t.xp6(4),t.Q6J("ngForOf",a.widgets),t.xp6(1),t.Q6J("ngIf","SALES"==a.activeTab),t.xp6(1),t.Q6J("ngIf","PURCHASE"==a.activeTab),t.xp6(1),t.Q6J("ngIf","DEBT"==a.activeTab),t.xp6(1),t.Q6J("ngIf","PRODUCT"==a.activeTab),t.xp6(1),t.Q6J("ngIf","INVENTORY"==a.activeTab)}}let et=(()=>{var o;class r extends x.M{constructor(e,n){super(e),(0,l.Z)(this,"dashboardService",void 0),(0,l.Z)(this,"widgets",[{id:"SALES",title:"Sales",value:null,showValue:!0},{id:"PURCHASE",title:"Purchase",value:null,showValue:!0},{id:"DEBT",title:"Debt Receivable",value:null,showValue:!0},{id:"PRODUCT",title:"Product",showValue:!1},{id:"INVENTORY",title:"Inventory",showValue:!1}]),(0,l.Z)(this,"filterPeriodOptions",[{Label:"Today",Value:0},{Label:"Week",Value:1},{Label:"Month",Value:2}]),(0,l.Z)(this,"dashboardFilter",{Outlets:[]}),(0,l.Z)(this,"dashboardConfig$",void 0),(0,l.Z)(this,"salesData$",void 0),(0,l.Z)(this,"purchaseData$",void 0),(0,l.Z)(this,"debtData$",void 0),(0,l.Z)(this,"productData$",void 0),(0,l.Z)(this,"inventoryData$",void 0),(0,l.Z)(this,"activeTab","SALES"),this.dashboardService=n,this.menuData$.subscribe(()=>this.initDashboardConfig()),this.initSalesData(),this.initPurchaseData(),this.initDebtData(),this.initProductData(),this.initInventoryData()}initDashboardConfig(){this.dashboardConfig$=this.dashboardService.getConfig().pipe((0,Z.d)(1))}initSalesData(){this.salesData$=this.dashboardService.getDashboardSales(this.dashboardFilter).pipe((0,A.b)(e=>{this.widgets[0].value=e.PageData.Sales}),(0,Z.d)(1))}initPurchaseData(){this.purchaseData$=this.dashboardService.getDashboardPurchase(this.dashboardFilter).pipe((0,A.b)(e=>{this.widgets[1].value=e?.PageData?.Purchase}),(0,Z.d)(1))}initDebtData(){this.debtData$=this.dashboardService.getDashboardDebt(this.dashboardFilter).pipe((0,A.b)(e=>{this.widgets[2].value=e?.PageData?.Receivable}),(0,Z.d)(1))}initProductData(){this.productData$=this.dashboardService.getDashboardProduct(this.dashboardFilter).pipe((0,Z.d)(1))}initInventoryData(){this.inventoryData$=this.dashboardService.getDashboardInventory(this.dashboardFilter).pipe((0,Z.d)(1))}onFilter(){switch(this.activeTab){case"SALES":this.initSalesData();break;case"PURCHASE":this.initPurchaseData();break;case"DEBT":this.initDebtData();break;case"PRODUCT":this.initProductData();break;case"INVENTORY":this.initInventoryData()}}onClickWidget(e){this.activeTab=this.widgets[e].id}}return o=r,(0,l.Z)(r,"\u0275fac",function(e){return new(e||o)(t.Y36(j.X),t.Y36(f))}),(0,l.Z)(r,"\u0275cmp",t.Xpm({type:o,selectors:[["POS-dashboard-v2"]],standalone:!0,features:[t._Bn([f]),t.qOj,t.jDz],decls:15,vars:10,consts:[[3,"hideSearchBox","pageData","onSubmit"],["container",""],["bindLabel","Name","bindValue","ID",3,"items","multiple","ngModel","ngModelChange"],[1,"content"],[1,"container-fluid","bg-light-gray","pt-4"],[1,"row"],[1,"col-12"],[4,"ngIf"],[1,"card"],[1,"card-body"],[1,"row","d-flex","justify-content-center"],[4,"ngFor","ngForOf"],[1,"col","cursor-pointer",3,"click"],[3,"title","content","showValue","isActive"],[3,"dashboardConfig","salesData","chartData"],[3,"dashboardConfig","purchaseData","chartData"],[3,"dashboardConfig","debtData"],[3,"dashboardConfig","productData"],[3,"dashboardConfig","inventoryData"]],template:function(e,n){if(1&e&&(t.TgZ(0,"mainpanel-cmp",0),t.NdJ("onSubmit",function(){return n.onFilter()}),t.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),t._uU(5,"Outlet"),t.qZA(),t.TgZ(6,"ng-select",2),t.NdJ("ngModelChange",function(F){return n.dashboardFilter.Outlets=F}),t.ALo(7,"async"),t.qZA()()()(),t.TgZ(8,"content")(9,"div",3)(10,"div",4)(11,"div",5)(12,"div",6),t.YNc(13,nt,10,6,"ng-container",7),t.ALo(14,"async"),t.qZA()()()()()()),2&e){let u;t.Q6J("hideSearchBox",!0)("pageData",n.menuData),t.xp6(6),t.Q6J("items",null==(u=t.lcZ(7,6,n.dashboardConfig$))?null:u.Outlets)("multiple",!0)("ngModel",n.dashboardFilter.Outlets),t.xp6(7),t.Q6J("ngIf",t.lcZ(14,8,n.dashboardConfig$))}},dependencies:[d.ez,d.sg,d.O5,d.Ov,d.JJ,_.R,_.p,L.u5,L.JJ,L.On,N.A0,N.w9,M,w,g,q,E,z]})),r})()},40652:(J,D,s)=>{s.d(D,{M:()=>_});var l=s(81180),d=s(99397);class _{constructor(m){(0,l.Z)(this,"menuData$",void 0),(0,l.Z)(this,"menuData",{T:null,N:null,H:null,U:null}),m.setMenu$(),this.menuData$=m.menu$.pipe((0,d.b)(T=>this.menuData=T))}}},67547:(J,D,s)=>{s.d(D,{X:()=>A});var l=s(81180),d=s(22096),_=s(36232),x=s(99397),m=s(94664),T=s(37398),t=s(26306),y=s(96814),f=s(17700),i=s(65879);function v(c,b){if(1&c&&i._UZ(0,"button",14),2&c){const p=i.oxw().index;i.uIk("data-bs-slide-to",p)}}function S(c,b){if(1&c&&(i.ynx(0),i.YNc(1,v,1,1,"button",13),i.BQk()),2&c){const p=b.index;i.xp6(1),i.Q6J("ngIf",0!=p)}}function P(c,b){if(1&c&&(i.TgZ(0,"div",11),i._UZ(1,"button",12),i.YNc(2,S,2,1,"ng-container",10),i.qZA()),2&c){const p=i.oxw();i.xp6(1),i.uIk("data-bs-slide-to",0),i.xp6(1),i.Q6J("ngForOf",p.changelogs)}}function I(c,b){if(1&c&&(i.TgZ(0,"div",16),i._UZ(1,"img",6),i.TgZ(2,"div",7)(3,"h2")(4,"a",8),i._uU(5),i.qZA()(),i.TgZ(6,"p",9),i._uU(7),i.qZA()()()),2&c){const p=i.oxw().$implicit;i.xp6(1),i.Q6J("src",p.ImageSource,i.LSH),i.xp6(3),i.Q6J("href",p.Href,i.LSH),i.xp6(1),i.Oqu(p.Title),i.xp6(2),i.hij(" ",p.Description," ")}}function U(c,b){if(1&c&&(i.ynx(0),i.YNc(1,I,8,4,"div",15),i.BQk()),2&c){const p=b.index;i.xp6(1),i.Q6J("ngIf",0!=p)}}let M=(()=>{var c;class b{constructor(g,h){(0,l.Z)(this,"dialogRef",void 0),(0,l.Z)(this,"changelogs",[]),this.dialogRef=h,this.changelogs=g}close(){this.dialogRef.close()}}return c=b,(0,l.Z)(b,"\u0275fac",function(g){return new(g||c)(i.Y36(f.WI),i.Y36(f.so))}),(0,l.Z)(b,"\u0275cmp",i.Xpm({type:c,selectors:[["POS-modal-changelog"]],standalone:!0,features:[i.jDz],decls:15,vars:6,consts:[[1,"changelog-container","h-100"],["mat-button","",1,"close",3,"click"],["id","carouselExampleIndicators","data-bs-ride","carousel",1,"carousel","slide"],["class","carousel-indicators",4,"ngIf"],[1,"carousel-inner"],[1,"carousel-item","active"],["alt","",3,"src"],[1,"text-container",2,"height","150px","width","40vw","margin","0 auto"],["target","_blank",3,"href"],[1,"description"],[4,"ngFor","ngForOf"],[1,"carousel-indicators"],["type","button","data-bs-target","#carouselExampleIndicators","aria-current","true",1,"active"],["type","button","data-bs-target","#carouselExampleIndicators","aria-current","true",4,"ngIf"],["type","button","data-bs-target","#carouselExampleIndicators","aria-current","true"],["class","carousel-item",4,"ngIf"],[1,"carousel-item"]],template:function(g,h){1&g&&(i.TgZ(0,"div",0)(1,"button",1),i.NdJ("click",function(){return h.close()}),i._uU(2,"X"),i.qZA(),i.TgZ(3,"div",2),i.YNc(4,P,3,2,"div",3),i.TgZ(5,"div",4)(6,"div",5),i._UZ(7,"img",6),i.TgZ(8,"div",7)(9,"h2")(10,"a",8),i._uU(11),i.qZA()(),i.TgZ(12,"p",9),i._uU(13),i.qZA()()(),i.YNc(14,U,2,1,"ng-container",10),i.qZA()()()),2&g&&(i.xp6(4),i.Q6J("ngIf",h.changelogs.length>1),i.xp6(3),i.Q6J("src",h.changelogs[0].ImageSource,i.LSH),i.xp6(3),i.Q6J("href",h.changelogs[0].Href,i.LSH),i.xp6(1),i.Oqu(h.changelogs[0].Title),i.xp6(2),i.hij(" ",h.changelogs[0].Description," "),i.xp6(1),i.Q6J("ngForOf",h.changelogs))},dependencies:[y.ez,y.sg,y.O5],styles:[".changelog-container[_ngcontent-%COMP%]{position:relative;text-align:center}.changelog-container[_ngcontent-%COMP%] .carousel.slide[_ngcontent-%COMP%]{height:100%}.changelog-container[_ngcontent-%COMP%] .carousel-indicators[_ngcontent-%COMP%] [data-bs-target][_ngcontent-%COMP%]{background-color:#dbdfea}.changelog-container[_ngcontent-%COMP%] .carousel-indicators[_ngcontent-%COMP%] .active[_ngcontent-%COMP%]{background-color:#19a7ce}.changelog-container[_ngcontent-%COMP%] .carousel-indicators[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:10px;height:10px;border-radius:10px;border:0}.changelog-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{aspect-ratio:16/9;max-height:55vh}@media (max-width: 576px){.changelog-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{aspect-ratio:auto;width:100%}}.changelog-container[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin-top:20px}.changelog-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-top:10px!important;margin-bottom:15px!important;max-width:700px;font-size:15px;margin:0 auto}.changelog-container[_ngcontent-%COMP%] .close[_ngcontent-%COMP%]{position:absolute;top:15px;right:20px;transform:translate(100%,-100%);background:white;padding:8px 13px;min-width:auto;border:none;border-radius:119px;z-index:2}@media (max-width: 576px){.changelog-container[_ngcontent-%COMP%] .text-container[_ngcontent-%COMP%]{width:100%!important}}"]})),b})();var w=s(58763),Z=s(6593);let A=(()=>{var c;class b{constructor(g,h,C){(0,l.Z)(this,"http",void 0),(0,l.Z)(this,"matDialog",void 0),(0,l.Z)(this,"title",void 0),(0,l.Z)(this,"menu$",void 0),this.http=g,this.matDialog=h,this.title=C}setMenu$(){const g=this.getCurrentFormattedRoute();this.menu$=this.http.get(`/API/Menu/${g}`).pipe((0,x.b)(h=>this.title.setTitle(h.T)),(0,m.w)(h=>{let C=(0,d.of)(h);if(h.U.length>0){localStorage.getItem("mapRouteOpenChangelogDialog")||localStorage.setItem("mapRouteOpenChangelogDialog",JSON.stringify([]));const O=JSON.parse(localStorage.getItem("mapRouteOpenChangelogDialog")),q=g.split("?")[0];O.includes(q)||(O.push(q),localStorage.setItem("mapRouteOpenChangelogDialog",JSON.stringify(O)),C=this.matDialog.open(M,{panelClass:"changelog-dialog",data:h.U}).afterOpened().pipe((0,T.U)(()=>h)))}return C}),(0,t.K)(()=>_.E))}getCurrentFormattedRoute(){try{let g=window.location.href;return g=g.split("menu/")[1],g=g.split(";")[0],g}catch(g){console.log(g)}}}return c=b,(0,l.Z)(b,"\u0275fac",function(g){return new(g||c)(i.LFG(w.O),i.LFG(f.uw),i.LFG(Z.Dx))}),(0,l.Z)(b,"\u0275prov",i.Yz7({token:c,factory:c.\u0275fac,providedIn:"root"})),b})()}}]);