marketplacepos 2.4.7 → 2.4.9

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_marketplace=self.webpackChunkpos_marketplace||[]).push([[874],{1874:(ke,T,l)=>{l.r(T),l.d(T,{PriceModule:()=>Ue});var p=l(6895),v=l(7398),u=l(7481),m=l(8252),_=l(4006),C=l(8796),e=l(4650);let U=(()=>{class n{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,o){1&t&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&t&&(e.xp6(3),e.Q6J("Tabs",o.priceTabs))},dependencies:[v.e,m.lC]}),n})();var Z=l(8231),y=l(6304),w=l(8505),d=l(9300),h=l(3154),f=l(1318),x=l(7185),P=l(5412),A=l(7287),b=l(6082),F=l(488);function O(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"button",16),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.openScanDialog())}),e._UZ(1,"i",17),e._uU(2," Scan Channel "),e.qZA()}}function k(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"button",18),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().ngIf,a=e.oxw(2);return e.KtG(a.onUpdateItems(i))}),e._UZ(1,"i",19),e._uU(2," Update "),e.qZA()}}function L(n,c){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,O,3,0,"button",14),e.YNc(2,k,3,0,"button",15),e.qZA()),2&n){const t=c.ngIf,o=e.oxw(2);e.xp6(1),e.Q6J("ngIf",!o.productService.hasSelectionVariant(t)),e.xp6(1),e.Q6J("ngIf",o.productService.hasSelectionVariant(t))}}function Q(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"div",20)(1,"app-table",21),e.NdJ("onToggle",function(i){e.CHM(t);const a=e.oxw(2);return e.KtG(a.onShowDifferencePrice(i))})("onSubmit",function(i){e.CHM(t);const a=e.oxw(2);return e.KtG(a.updatePriceByVariant(i))}),e.ALo(2,"async"),e.qZA()()}if(2&n){const t=e.oxw().ngIf,o=e.oxw();e.xp6(1),e.Q6J("showProductToggle",!0)("data",e.lcZ(2,4,o.paginationService.data$))("channel",t.Options.Channel)("filter",t.Filter)}}function q(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.getRowCount())}),e.TgZ(1,"i",23),e._uU(2,"?"),e.qZA()()}}function V(n,c){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=c.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t))}}function $(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"a",24),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onNextPage())}),e._UZ(1,"i",25),e._uU(2," Next"),e.qZA()}}function Y(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"a",26),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onLastPage())}),e._UZ(1,"i",27),e._uU(2," Last"),e.qZA()}}function E(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("onSubmit",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.onSearch(i))}),e.TgZ(1,"actions")(2,"div",2),e.YNc(3,L,3,2,"div",3),e.ALo(4,"async"),e.qZA()(),e.TgZ(5,"content")(6,"div",4)(7,"div",5),e.YNc(8,Q,3,6,"div",6),e.ALo(9,"async"),e.qZA(),e.TgZ(10,"div",7)(11,"div",8)(12,"div",9),e._uU(13),e.ALo(14,"number"),e.ALo(15,"async"),e.YNc(16,q,3,0,"span",10),e.YNc(17,V,3,3,"span",3),e.ALo(18,"async"),e._uU(19),e.qZA()(),e.TgZ(20,"div",11),e.YNc(21,$,3,0,"a",12),e.YNc(22,Y,3,0,"a",13),e.qZA()()()()()}if(2&n){const t=e.oxw();let o;e.Q6J("pageData",t.pageData)("hideSearchDropdown",!0)("textButton","Search"),e.xp6(3),e.Q6J("ngIf",e.lcZ(4,11,t.paginationService.data$)),e.xp6(5),e.Q6J("ngIf",e.lcZ(9,13,t.paginationService.data$)),e.xp6(5),e.hij(" Showing 1 - ",e.lcZ(14,15,null==(o=e.lcZ(15,17,t.paginationService.data$))?null:o.length)," of "),e.xp6(3),e.Q6J("ngIf",t.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",!t.paginationService.hideCount&&e.lcZ(18,19,t.allDataCount$)),e.xp6(2),e.hij(" records ~ ",t.paginationService.footerPageNumber," Page "),e.xp6(2),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}let K=(()=>{class n{constructor(t,o,i,a,r){this.http=t,this.toastr=o,this.dialog=i,this.paginationService=a,this.productService=r,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe((0,w.b)(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,RowCount:t.Filter.RowCount,filterModel:1},this.searchFilter=t.Filter,this.paginationService.resetToFirstPage(this.searchFilter)}))}onShowDifferencePrice(t){this.searchFilter.filterModel=1,t&&(this.searchFilter.filterModel=3),this.paginationService.resetToFirstPage(this.searchFilter)}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}openScanDialog(){this.searchFilter.ChannelID=h.g.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(Z.j,{data:{filter:t,channelOptions:this.channelOptions},width:"40%"}).afterClosed().pipe((0,d.h)(i=>h.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let o=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.initPageLoader(),this.productService.successToastrScanAllProduct(t,o,!this.searchFilter.UpdatedProduct)}})}updatePrice(t){let o=this.productService.selectedVariantProduct(t);if(o.length>0){let a=o.map(s=>({ID:s.ID,Code:s.Code,Price:s.UnitPrice})),r={ListChannelID:this.channelOptions.filter(s=>s.selected).map(s=>s.ID),ListPrice:a};this.http.post("/api/Price/UpdateChannel",r).subscribe(s=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+r.ListPrice.length+" items in "+r.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(t){let o={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:t.Price-0,VariantID:t.ID};this.http.post("/api/Price/UpdatePriceByID",o).subscribe(i=>{let a=this.productService.findChannelById(o.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") price in "+a.Name+" to "+o.Price,"Success"),this.paginationService.resetToFirstPage(this.searchFilter)})}onUpdateItems(t){const o=this.productService.selectedVariantProduct(t);this.dialog.open(y.j,{data:{selectedItems:o,channels:this.channelOptions},width:"40%"}).afterClosed().pipe((0,d.h)(i=>void 0!==i)).subscribe(i=>{this.channelOptions=i,this.updatePrice(t)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/api/${this.rowCountAPI}`,{})}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(f.O),e.Y36(x._W),e.Y36(P.uw),e.Y36(A.b),e.Y36(b.M))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchDropdown","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","hideSearchDropdown","textButton","onSubmit"],[1,"d-flex"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-md-12",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"col-md-12"],["productToggleTitle","Filter Different Price","table","price",3,"showProductToggle","data","channel","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",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(t,o){1&t&&(e.YNc(0,E,23,21,"mainpanel",0),e.ALo(1,"async")),2&t&&e.Q6J("ngIf",e.lcZ(1,1,o.loader$))},dependencies:[p.O5,u.p,F.a,p.Ov,p.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]}),n})();var g=l(8705),D=l(7945),H=l(1290),N=l(1739),I=l(1948);function R(n,c){if(1&n&&(e.TgZ(0,"mat-radio-button",3),e._uU(1),e.qZA()),2&n){const t=c.$implicit,o=c.index,i=e.oxw();e.Q6J("value",t.Key)("name",i.name)("title",i.tooltipsText[o]?i.tooltipsText[o]:""),e.xp6(1),e.hij(" ",t.Value,"")}}const G=function(n){return{"border-0":n}};let B=(()=>{class n{constructor(){this.modelChange=new e.vpe,this.border=!1,this.tooltipsText=[]}change(t){this.modelChange.emit(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},decls:3,vars:5,consts:[[1,"form-control","h-100",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(t,o){1&t&&(e.TgZ(0,"div",0)(1,"mat-radio-group",1),e.NdJ("ngModelChange",function(a){return o.change(a)}),e.YNc(2,R,2,4,"mat-radio-button",2),e.qZA()()),2&t&&(e.Q6J("ngClass",e.VKq(3,G,0==o.border)),e.xp6(1),e.Q6J("ngModel",o.model),e.xp6(1),e.Q6J("ngForOf",o.options))},dependencies:[p.mk,p.sg,I.VQ,I.U0,_.JJ,_.On],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]}),n})(),j=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[p.ez,I.Fk,_.u5]}),n})();function z(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"button",19),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onUpdateItems())}),e._UZ(1,"i",20),e._uU(2," Update "),e.qZA()}}function W(n,c){if(1&n&&(e.TgZ(0,"th",21),e._uU(1),e.qZA()),2&n){const t=c.$implicit;e.xp6(1),e.Oqu(t.Name)}}function X(n,c){1&n&&(e.ynx(0),e.TgZ(1,"th",22),e._uU(2," Expected (POS) "),e.qZA(),e.TgZ(3,"th",22),e._uU(4," Channel "),e.qZA(),e.BQk())}function ee(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"img",34),e.NdJ("click",function(i){e.CHM(t);const a=e.oxw(3).$implicit,r=e.oxw();return e.KtG(r.onZoomImage(i,null==a?null:a.ImageUrl))}),e.qZA()}if(2&n){const t=e.oxw(3).$implicit;e.s9C("src",null==t?null:t.ImageUrl,e.LSH)}}function te(n,c){1&n&&e._UZ(0,"img",35)}const ne=function(n){return{"border-bottom":n}};function ie(n,c){if(1&n&&(e.ynx(0),e.TgZ(1,"td",29),e.YNc(2,ee,1,1,"img",30),e.YNc(3,te,1,0,"ng-template",null,31,e.W1O),e.qZA(),e.TgZ(5,"td",32)(6,"h5",33),e._uU(7),e.qZA(),e._UZ(8,"br"),e.TgZ(9,"small"),e._uU(10),e.qZA()(),e.BQk()),2&n){const t=e.MAs(4),o=e.oxw().index,i=e.oxw().$implicit,a=e.oxw();e.xp6(1),e.Q6J("rowSpan",null==i?null:i.Variants.length)("ngClass",e.VKq(7,ne,o+1==a.products.length)),e.xp6(1),e.Q6J("ngIf",null==i?null:i.ImageUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",null==i?null:i.Variants.length),e.xp6(2),e.Oqu(null==i?null:i.Name),e.xp6(3),e.hij("(",null==i?null:i.Category,")")}}const oe=function(n){return{"bg-gradient-warning":n}};function ae(n,c){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"td",38),e._uU(2),e.ALo(3,"number"),e.qZA(),e.TgZ(4,"td",39)(5,"div",40)(6,"div",41),e.NdJ("click",function(){const a=e.CHM(t).$implicit,r=e.oxw(2).$implicit,s=e.oxw().$implicit,Oe=e.oxw();return e.KtG(Oe.openTableDialog(r,s,a))}),e._uU(7),e.ALo(8,"number"),e._UZ(9,"br"),e.qZA(),e.TgZ(10,"div",42)(11,"a",26),e._UZ(12,"i",27),e.qZA()()()(),e.BQk()}if(2&n){const t=c.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,4,t.PriceExpected)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(8,oe,t.Price!=t.PriceExpected)),e.xp6(3),e.hij(" ",e.lcZ(8,6,t.Price)," "),e.xp6(4),e.Q6J("href",t.Url,e.LSH)}}function ce(n,c){1&n&&(e.TgZ(0,"td",43),e._uU(1,"X"),e.qZA(),e.TgZ(2,"td",43),e._uU(3,"X"),e.qZA())}function re(n,c){if(1&n&&(e.ynx(0),e.YNc(1,ae,13,10,"ng-container",36),e.YNc(2,ce,4,0,"ng-template",null,37,e.W1O),e.BQk()),2&n){const t=c.$implicit,o=e.MAs(3),i=e.oxw().$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",a.getItemFromChannel(i,t.ID))("ngIfElse",o)}}function le(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"tr"),e.YNc(1,ie,11,9,"ng-container",23),e.TgZ(2,"td",24),e._uU(3),e.qZA(),e.TgZ(4,"td",24)(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span",25)(8,"a",26),e._UZ(9,"i",27),e.qZA()()(),e.TgZ(10,"td",28)(11,"input",17),e.NdJ("ngModelChange",function(i){const r=e.CHM(t).$implicit;return e.KtG(r.selected=i)}),e.qZA()(),e.YNc(12,re,4,2,"ng-container",18),e.qZA()}if(2&n){const t=c.$implicit,o=c.index,i=e.oxw(2);e.xp6(1),e.Q6J("ngIf",0==o),e.xp6(2),e.Oqu(null==t?null:t.Model),e.xp6(3),e.Oqu(null==t?null:t.Code),e.xp6(2),e.Q6J("href","https://"+i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),e.LSH),e.xp6(2),e.Q6J("hidden",null==i.searchFilter?null:i.searchFilter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngModel",t.selected),e.xp6(1),e.Q6J("ngForOf",i.channelOptions)}}function se(n,c){if(1&n&&(e.TgZ(0,"tbody"),e.YNc(1,le,13,7,"tr",18),e.qZA()),2&n){const t=c.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}let pe=(()=>{class n{constructor(t,o,i,a,r){this.http=t,this.toastr=o,this.dialog=i,this.productService=a,this.biggerPictureService=r,this.searchFilter=new H.k,this.products=[],this.checkboxState=!1,this.initPageLoader(),this.filterTypeOptions=[{Key:g.v.ALL,Value:"All"},{Key:g.v.DIFFERENCE,Value:"Difference"}],this.filterType=g.v.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.hostName=a.getHostName()}initPageLoader(){this.http.post("/api/PriceLoader/LoadMultiple",{}).subscribe(t=>{this.channelOptions=t.Options.Channel,this.searchFilter=t.Filter,this.searchFilter.HiddenIPOSInventory=!1,this.onFilter()})}onSelectAllData(){this.products=this.products.map(t=>(t.Variants&&(t.Variants=t.Variants.map(o=>(o.selected=this.checkboxState,o))),t))}onFilter(t){this.http.post("/api/Price/GetOutletPrice",{text:t,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount}).subscribe(i=>{this.products=i.Data})}updatePrice(){let t=this.productService.selectedVariantProduct(this.products);if(t.length>0){let o=t.map(r=>r.ID),a={ListChannelID:this.channelOptions.filter(r=>r.selected).map(r=>r.ID),ListID:o};this.http.post("/api/Price/UpdateChannelOutletPrice",a).subscribe({next:r=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+a.ListID.length+" items in "+a.ListChannelID.length+" channels","Success")},error:r=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(t=>(t.selected=!1,t))}getItemFromChannel(t,o){return t.Channel.find(i=>i.ChannelID==o)}onUpdateItems(){const t=this.productService.selectedVariantProduct(this.products);this.dialog.open(y.j,{data:{selectedItems:t,channels:this.channelOptions},width:"40%"}).afterClosed().pipe((0,d.h)(o=>h.g.IsNotEmpty(o))).subscribe(o=>{this.channelOptions=o,this.updatePrice()})}openTableDialog(t,o,i){let a=JSON.parse(JSON.stringify(t));this.dialog.open(D.k,{data:{Name:o.Name,Variant:a,ChannelID:i?.ChannelID,Table:"price",ChannelItemID:i?.ChannelItemID}}).afterClosed().pipe((0,d.h)(s=>h.g.IsNotEmpty(s))).subscribe(s=>{this.updateProductPrice(s,i)})}updateProductPrice(t,o){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:parseFloat(t.Price),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(a=>{o.Price=i.Price;const r=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success(`Successfully updated ${t.ItemName} (${t.VarName}) inventory in ${r.Name} to ${i.Price}`,"Success")})}onZoomImage(t,o){this.biggerPictureService.openBiggerPicture(t,o)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(f.O),e.Y36(x._W),e.Y36(P.uw),e.Y36(b.M),e.Y36(N.k))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-custom-channel-price"]],decls:31,vars:13,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],["container",""],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","5"],["scope","col","colspan","2","class","text-center border-bottom-0 border w-10 text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-20"],["scope","col",1,"text-start"],["scope","col",1,"text-start","w-10"],[3,"hidden"],["type","checkbox",3,"ngModel","ngModelChange"],[4,"ngFor","ngForOf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","w-10","text-uppercase"],[1,"text-end","border-top-0","border","w-10"],[4,"ngIf"],[1,"text-start","border-bottom"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"align-middle",3,"hidden"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-center","border-bottom",3,"rowSpan"],[1,"mb-0","item-name"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[4,"ngIf","ngIfElse"],["elseCol",""],[1,"text-end","border"],[1,"text-end","border","pointer","cell-hover",3,"ngClass"],[1,"row","justify-content-end","me-0"],[1,"col-8","px-0","text-center",3,"click"],[1,"col-2","ps-0","text-start","align-self-center"],[1,"table-white","border","text-end",2,"color","red"]],template:function(t,o){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(a){return o.onFilter(a)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Filter by"),e.qZA(),e.TgZ(6,"radio-options",2),e.NdJ("modelChange",function(a){return o.filterType=a}),e.qZA()()()(),e.TgZ(7,"actions")(8,"div",3),e.YNc(9,z,3,0,"button",4),e.qZA()(),e.TgZ(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr"),e._UZ(18,"th",11),e.YNc(19,W,2,1,"th",12),e.qZA(),e.TgZ(20,"tr")(21,"th",13),e._uU(22,"Product"),e.qZA(),e.TgZ(23,"th",14),e._uU(24,"Variant"),e.qZA(),e.TgZ(25,"th",15),e._uU(26,"SKU"),e.qZA(),e.TgZ(27,"th",16)(28,"input",17),e.NdJ("ngModelChange",function(a){return o.checkboxState=a})("ngModelChange",function(){return o.onSelectAllData()}),e.qZA()(),e.YNc(29,X,5,0,"ng-container",18),e.qZA()(),e.YNc(30,se,2,1,"tbody",18),e.qZA()()()()()()()),2&t&&(e.Q6J("pageData",o.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),e.xp6(6),e.Q6J("model",o.filterType)("options",o.filterTypeOptions)("border",!1),e.xp6(3),e.Q6J("ngIf",o.productService.hasSelectionVariant(o.products)),e.xp6(10),e.Q6J("ngForOf",o.channelOptions),e.xp6(8),e.Q6J("hidden",null==o.searchFilter?null:o.searchFilter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngModel",o.checkboxState),e.xp6(1),e.Q6J("ngForOf",o.channelOptions),e.xp6(1),e.Q6J("ngForOf",o.products))},dependencies:[p.mk,p.sg,p.O5,_.Wl,_.JJ,_.On,u.p,B,p.JJ],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]}),n})();var M=l(455),J=l(266);function _e(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"button",8),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2).ngIf,a=e.oxw();return e.KtG(a.openScanDialog(i))}),e._UZ(1,"i",9),e._uU(2," Scan Channel "),e.qZA()}}function he(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"button",10),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().ngIf,a=e.oxw(2);return e.KtG(a.updateStock(i))}),e._UZ(1,"i",11),e._uU(2," Update "),e.qZA()}}function de(n,c){if(1&n&&(e.TgZ(0,"actions")(1,"div",5)(2,"div"),e.YNc(3,_e,3,0,"button",6),e.YNc(4,he,3,0,"button",7),e.qZA()()()),2&n){const t=c.ngIf,o=e.oxw(2);e.xp6(3),e.Q6J("ngIf",!o.productService.hasSelectionVariant(t)),e.xp6(1),e.Q6J("ngIf",o.productService.hasSelectionVariant(t))}}function ge(n,c){if(1&n&&(e.TgZ(0,"ng-option",32),e._UZ(1,"img",33),e._uU(2),e.qZA()),2&n){const t=c.$implicit;e.Q6J("value",t.ID),e.xp6(1),e.s9C("src",t.Img,e.LSH),e.xp6(1),e.hij("",t.Name," ")}}function ue(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"input",53),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw(3).$implicit;return e.KtG(a.selected=i)})("ngModelChange",function(){e.CHM(t);const i=e.oxw(3).$implicit,a=e.oxw(3);return e.KtG(a.onCheckboxStateProduct(i))}),e.qZA()}if(2&n){const t=e.oxw(3).$implicit;e.Q6J("ngModel",t.selected)}}function me(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"img",54),e.NdJ("click",function(i){e.CHM(t);const a=e.oxw(3).$implicit,r=e.oxw(3);return e.KtG(r.onZoomImage(i,null==a?null:a.ImageUrl))}),e.qZA()}if(2&n){const t=e.oxw(3).$implicit;e.s9C("src",t.ThumbnailUrl,e.LSH)}}function Ce(n,c){1&n&&e._UZ(0,"img",55)}function fe(n,c){if(1&n&&(e.ynx(0),e.TgZ(1,"td",46)(2,"div",47),e.YNc(3,ue,1,1,"input",48),e.YNc(4,me,1,1,"img",49),e.YNc(5,Ce,1,0,"ng-template",null,50,e.W1O),e.qZA()(),e.TgZ(7,"td",51)(8,"span",52),e._uU(9),e.qZA(),e._UZ(10,"br"),e.TgZ(11,"small"),e._uU(12),e.qZA()(),e.BQk()),2&n){const t=e.MAs(6),o=e.oxw().$implicit,i=e.oxw().$implicit;e.xp6(1),e.Q6J("rowSpan",i.Variants.length),e.xp6(2),e.Q6J("ngIf",o.Inventory>=0||i.Variants.length>1),e.xp6(1),e.Q6J("ngIf",i.ThumbnailUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",i.Variants.length),e.xp6(2),e.Oqu(i.Name),e.xp6(3),e.hij("(",i.Category,")")}}function xe(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"input",56),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw().$implicit;return e.KtG(a.selected=i)}),e.qZA()}if(2&n){const t=e.oxw().$implicit;e.Q6J("ngModel",t.selected)}}function Pe(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"div",57)(1,"div",58),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,a=e.oxw().$implicit,r=e.oxw(2).ngIf,s=e.oxw();return e.KtG(s.openTableDialog(i,a,r))}),e._uU(2),e.ALo(3,"number"),e.qZA()()}if(2&n){const t=e.oxw().$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,null==t.Channel[0]?null:t.Channel[0].Price)," ")}}const be=function(n){return{"bg-gradient-warning":n}};function Ie(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"tr"),e.YNc(1,fe,13,7,"ng-container",4),e.TgZ(2,"td",19),e._uU(3),e.qZA(),e.TgZ(4,"td",22)(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span",34)(8,"a",35),e._UZ(9,"i",36),e.qZA()()(),e.TgZ(10,"td",37),e.YNc(11,xe,1,1,"input",38),e.qZA(),e.TgZ(12,"td",22),e._uU(13),e.ALo(14,"number"),e.qZA(),e.TgZ(15,"td",39),e.YNc(16,Pe,4,3,"div",40),e.qZA(),e.TgZ(17,"td")(18,"div",41)(19,"div",42)(20,"a",35),e._UZ(21,"i",43),e.qZA(),e._uU(22," \xa0\xa0 "),e.TgZ(23,"span",44),e.NdJ("click",function(){const a=e.CHM(t).$implicit,r=e.oxw(4);return e.KtG(r.refreshPrice(a))}),e._UZ(24,"i",45),e.qZA()()()()()}if(2&n){const t=c.$implicit,o=c.index,i=e.oxw(4);e.xp6(1),e.Q6J("ngIf",0==o),e.xp6(2),e.Oqu(t.Model),e.xp6(3),e.hij(" ",t.Code," "),e.xp6(2),e.Q6J("href","https://"+i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),e.LSH),e.xp6(3),e.Q6J("ngIf",t.Inventory>=0),e.xp6(2),e.hij(" ",e.lcZ(14,9,t.UnitPrice)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(11,be,t.UnitPrice!=(null==t.Channel[0]?null:t.Channel[0].Price))),e.xp6(1),e.Q6J("ngIf",t.Channel.length>0),e.xp6(4),e.Q6J("href",null==t.Channel[0]?null:t.Channel[0].Url,e.LSH)}}function Se(n,c){if(1&n&&(e.ynx(0),e.YNc(1,Ie,25,13,"tr",26),e.BQk()),2&n){const t=c.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}function Te(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"span",59),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.getRowCount())}),e.TgZ(1,"i",60),e._uU(2,"?"),e.qZA()()}}function ve(n,c){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=c.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Total))}}function Ze(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"a",64),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onNextPage())}),e._UZ(1,"i",65),e._uU(2," Next"),e.qZA()}}function ye(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"a",66),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onLastPage())}),e._UZ(1,"i",67),e._uU(2," Last"),e.qZA()}}function we(n,c){if(1&n&&(e.TgZ(0,"div",61),e.YNc(1,Ze,3,0,"a",62),e.YNc(2,ye,3,0,"a",63),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Ae(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),e._uU(7," Product "),e.TgZ(8,"div")(9,"mat-slide-toggle",17),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw(2);return e.KtG(a.toggleDifferentInventory=i)})("toggleChange",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onToggleDifferentInventory())}),e.TgZ(10,"small",18),e._uU(11,"Filter Different Price"),e.qZA()()()(),e.TgZ(12,"th",19),e._uU(13,"Variant"),e.qZA(),e.TgZ(14,"th",20),e._uU(15,"SKU"),e.qZA(),e.TgZ(16,"th")(17,"input",21),e.NdJ("change",function(i){const r=e.CHM(t).ngIf,s=e.oxw(2);return e.KtG(s.onSelectAllSKU(i.target.checked,r))}),e.qZA()(),e.TgZ(18,"th",22),e._uU(19,"POS"),e.qZA(),e.TgZ(20,"th")(21,"ng-select",23),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw(2);return e.KtG(a.searchFilter.ChannelID=i)})("change",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.search())}),e.YNc(22,ge,3,3,"ng-option",24),e.qZA()(),e._UZ(23,"th",25),e.qZA()(),e.TgZ(24,"tbody"),e.YNc(25,Se,2,1,"ng-container",26),e.qZA()(),e.TgZ(26,"div",27)(27,"div",28)(28,"div",29),e._uU(29),e.ALo(30,"number"),e.YNc(31,Te,3,0,"span",30),e.YNc(32,ve,3,3,"span",4),e.ALo(33,"async"),e._uU(34),e.qZA()(),e.YNc(35,we,3,2,"div",31),e.qZA()()()()}if(2&n){const t=c.ngIf,o=e.oxw().ngIf,i=e.oxw();e.xp6(9),e.Q6J("ngModel",i.toggleDifferentInventory),e.xp6(12),e.Q6J("clearable",!1)("ngModel",i.searchFilter.ChannelID),e.xp6(1),e.Q6J("ngForOf",o.Options.Channel),e.xp6(3),e.Q6J("ngForOf",t),e.xp6(4),e.hij(" Showing 1 - ",e.lcZ(30,10,null==t?null:t.length)," of "),e.xp6(2),e.Q6J("ngIf",i.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(33,12,!i.paginationService.hideCount&&i.allDataCount$)),e.xp6(2),e.hij(" records ~ ",i.paginationService.footerPageNumber," Page "),e.xp6(1),e.Q6J("ngIf",t.length>0)}}function Fe(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("textChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.searchFilter.text=i)})("onSubmit",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.search())}),e.TgZ(1,"filters")(2,"div",2)(3,"div")(4,"label"),e._uU(5,"Page Size"),e.qZA(),e.TgZ(6,"input",3),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.searchFilter.RowCount=i)}),e.qZA()()()(),e.YNc(7,de,5,2,"actions",4),e.ALo(8,"async"),e.YNc(9,Ae,36,14,"content",4),e.ALo(10,"async"),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("headerTitle",t.pageTitle)("text",t.searchFilter.text),e.xp6(6),e.Q6J("ngModel",t.searchFilter.RowCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(8,5,t.paginationService.data$)),e.xp6(2),e.Q6J("ngIf",e.lcZ(10,7,t.paginationService.data$))}}let De=(()=>{class n{constructor(t,o,i,a,r,s){this.http=t,this.paginationService=o,this.toastr=i,this.dialog=a,this.productService=r,this.biggerPictureService=s,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.hostName=this.productService.getHostName()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe((0,w.b)(t=>{this.searchFilter=t.Filter,this.searchFilter.filterModel=g.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}))}onToggleDifferentInventory(){this.searchFilter.filterModel=this.toggleDifferentInventory?g.v.ALL:g.v.DIFFERENCE,this.search()}onCheckboxStateProduct(t){t.Variants=t.Variants.map(o=>(o.selected=t.selected,o))}openScanDialog(t){let o=JSON.parse(JSON.stringify(this.searchFilter));o.ChannelID=h.g.GuidEMpty,this.dialog.open(Z.j,{data:{filter:o,channelOptions:t.Options.Channel},width:"40%"}).afterClosed().pipe((0,d.h)(i=>h.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAll(t)})}scanAll(t){const o=this.productService.findChannelById(this.searchFilter.ChannelID,t.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(i=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(),this.toastr.success(`Successfully scanned from ${o?.Name}`,"Success"))})}updateStock(t){let i=this.productService.selectedVariantProduct(t).map(r=>({ID:r.ID,ChannelID:r.Channel[0].ChannelID,Code:r.Code,Price:r.UnitPrice})),a={ListChannelID:[this.searchFilter.ChannelID],ListPrice:i};this.http.post("/api/Price/UpdateChannel",a).subscribe(()=>{this.search(),this.toastr.success(`Successfully updated ${a.ListPrice.length} variants in ${a.ListChannelID.length} channels`,"Success")})}refreshPrice(t){this.http.post("/api/Price/RefreshPriceChannel",{ChannelItemID:t?.Channel[0].ChannelItemID,ChannelVariationID:t?.Channel[0]?.ChannelVariationID,ChannelID:t?.Channel[0]?.ChannelID,VariantID:t.ID}).subscribe(i=>{this.toastr.success("Successfully updated","Success"),this.search()})}search(){this.paginationService.resetToFirstPage(this.searchFilter)}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter).subscribe({next:t=>{this.paginationService.getAllData(this.searchFilter,t.Total)}})}openTableDialog(t,o,i){let a=JSON.parse(JSON.stringify(t));this.dialog.open(D.k,{data:{Name:o.Name,Variant:a,ChannelID:a?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:a?.Channel[0]?.ChannelItemID}}).afterClosed().pipe((0,d.h)(s=>h.g.IsNotEmpty(s))).subscribe(s=>{this.updateItemAfterDialog(s,i,t)})}updateItemAfterDialog(t,o,i){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:parseFloat(t.Price),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(r=>{const s=this.productService.findChannelById(a.ID,o.Options.Channel);this.toastr.success(`Successfully updated ${t.ItemName} (${t.VarName}) inventory in ${s.Name} to ${a.Price}`,"Success"),i.Channel[0]&&(i.Channel[0].Price=a.Price)})}onSelectAllSKU(t,o){o=o.map(i=>(i.Variants=i.Variants.map(a=>(a.selected=t,a)),i))}onZoomImage(t,o){this.biggerPictureService.openBiggerPicture(t,o)}ngOnDestroy(){this.paginationService.destroy()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(f.O),e.Y36(A.b),e.Y36(x._W),e.Y36(P.uw),e.Y36(b.M),e.Y36(N.k))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"headerTitle","text","textChange","onSubmit"],["container",""],["type","number",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModel","ngModelChange","toggleChange"],[1,"fw-bold"],[1,"text-start"],[1,"text-end",2,"width","20%"],["type","checkbox",1,"me-3",3,"change"],[1,"text-end"],["name","channelOption",3,"clearable","ngModel","ngModelChange","change"],[3,"value",4,"ngFor","ngForOf"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-external-link-alt"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"text-end",3,"ngClass"],["class","row justify-content-end me-0",4,"ngIf"],[1,"row"],[1,"col-12","ps-0","d-flex","justify-content-between"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"row","justify-content-end","me-0"],[1,"col-8","ps-0","pe-12","text-end",2,"cursor","pointer",3,"click"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",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","Load more for 20 products",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(t,o){1&t&&(e.YNc(0,Fe,11,9,"mainpanel",0),e.ALo(1,"async")),2&t&&e.Q6J("ngIf",e.lcZ(1,1,o.loader$))},dependencies:[p.mk,p.sg,p.O5,_.Fj,_.wV,_.Wl,_.JJ,_.On,u.p,C.w9,C.jq,M.Rr,J.gM,p.Ov,p.JJ],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"]}),n})();var S=l(8063);const Ne=[{path:"",component:U,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:K,canActivate:[S.a],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:pe,canActivate:[S.a],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:De,canActivate:[S.a],data:{title:"Price Single Channel Comparison"}}]}];let Me=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[p.ez,m.Bz.forChild(Ne)]}),n})();var Je=l(6709);let Ue=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[p.ez,_.u5,v.Z,u.R,m.Bz,C.A0,Me,_.UX,M.rP,j,Je.p9,F.U,J.AV]}),n})()}}]);
1
+ "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[874],{1874:(ke,T,l)=>{l.r(T),l.d(T,{PriceModule:()=>Ue});var p=l(6895),v=l(7398),u=l(7481),m=l(8252),_=l(4006),C=l(8796),e=l(4650);let U=(()=>{class n{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,o){1&t&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&t&&(e.xp6(3),e.Q6J("Tabs",o.priceTabs))},dependencies:[v.e,m.lC]}),n})();var Z=l(8231),y=l(6304),w=l(8505),d=l(9300),h=l(3154),f=l(1318),x=l(7185),P=l(5412),A=l(7287),b=l(6082),F=l(488);function O(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"button",16),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.openScanDialog())}),e._UZ(1,"i",17),e._uU(2," Scan Channel "),e.qZA()}}function k(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"button",18),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().ngIf,a=e.oxw(2);return e.KtG(a.onUpdateItems(i))}),e._UZ(1,"i",19),e._uU(2," Update "),e.qZA()}}function L(n,c){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,O,3,0,"button",14),e.YNc(2,k,3,0,"button",15),e.qZA()),2&n){const t=c.ngIf,o=e.oxw(2);e.xp6(1),e.Q6J("ngIf",!o.productService.hasSelectionVariant(t)),e.xp6(1),e.Q6J("ngIf",o.productService.hasSelectionVariant(t))}}function Q(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"div",20)(1,"app-table",21),e.NdJ("onToggle",function(i){e.CHM(t);const a=e.oxw(2);return e.KtG(a.onShowDifferencePrice(i))})("onSubmit",function(i){e.CHM(t);const a=e.oxw(2);return e.KtG(a.updatePriceByVariant(i))}),e.ALo(2,"async"),e.qZA()()}if(2&n){const t=e.oxw().ngIf,o=e.oxw();e.xp6(1),e.Q6J("showProductToggle",!0)("data",e.lcZ(2,4,o.paginationService.data$))("channel",t.Options.Channel)("filter",t.Filter)}}function q(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.getRowCount())}),e.TgZ(1,"i",23),e._uU(2,"?"),e.qZA()()}}function V(n,c){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=c.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t))}}function $(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"a",24),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onNextPage())}),e._UZ(1,"i",25),e._uU(2," Next"),e.qZA()}}function Y(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"a",26),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onLastPage())}),e._UZ(1,"i",27),e._uU(2," Last"),e.qZA()}}function E(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("onSubmit",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.onSearch(i))}),e.TgZ(1,"actions")(2,"div",2),e.YNc(3,L,3,2,"div",3),e.ALo(4,"async"),e.qZA()(),e.TgZ(5,"content")(6,"div",4)(7,"div",5),e.YNc(8,Q,3,6,"div",6),e.ALo(9,"async"),e.qZA(),e.TgZ(10,"div",7)(11,"div",8)(12,"div",9),e._uU(13),e.ALo(14,"number"),e.ALo(15,"async"),e.YNc(16,q,3,0,"span",10),e.YNc(17,V,3,3,"span",3),e.ALo(18,"async"),e._uU(19),e.qZA()(),e.TgZ(20,"div",11),e.YNc(21,$,3,0,"a",12),e.YNc(22,Y,3,0,"a",13),e.qZA()()()()()}if(2&n){const t=e.oxw();let o;e.Q6J("pageData",t.pageData)("hideSearchDropdown",!0)("textButton","Search"),e.xp6(3),e.Q6J("ngIf",e.lcZ(4,11,t.paginationService.data$)),e.xp6(5),e.Q6J("ngIf",e.lcZ(9,13,t.paginationService.data$)),e.xp6(5),e.hij(" Showing 1 - ",e.lcZ(14,15,null==(o=e.lcZ(15,17,t.paginationService.data$))?null:o.length)," of "),e.xp6(3),e.Q6J("ngIf",t.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",!t.paginationService.hideCount&&e.lcZ(18,19,t.allDataCount$)),e.xp6(2),e.hij(" records ~ ",t.paginationService.footerPageNumber," Page "),e.xp6(2),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}let K=(()=>{class n{constructor(t,o,i,a,r){this.http=t,this.toastr=o,this.dialog=i,this.paginationService=a,this.productService=r,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe((0,w.b)(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,RowCount:t.Filter.RowCount,filterModel:1},this.searchFilter=t.Filter,this.paginationService.resetToFirstPage(this.searchFilter)}))}onShowDifferencePrice(t){this.searchFilter.filterModel=1,t&&(this.searchFilter.filterModel=3),this.paginationService.resetToFirstPage(this.searchFilter)}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}openScanDialog(){this.searchFilter.ChannelID=h.g.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(Z.j,{data:{filter:t,channelOptions:this.channelOptions},width:"40%"}).afterClosed().pipe((0,d.h)(i=>h.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let o=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.initPageLoader(),this.productService.successToastrScanAllProduct(t,o,!this.searchFilter.UpdatedProduct)}})}updatePrice(t){let o=this.productService.selectedVariantProduct(t);if(o.length>0){let a=o.map(s=>({ID:s.ID,Code:s.Code,Price:s.UnitPrice})),r={ListChannelID:this.channelOptions.filter(s=>s.selected).map(s=>s.ID),ListPrice:a};this.http.post("/api/Price/UpdateChannel",r).subscribe(s=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+r.ListPrice.length+" items in "+r.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(t){let o={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:t.Price-0,VariantID:t.ID};this.http.post("/api/Price/UpdatePriceByID",o).subscribe(i=>{let a=this.productService.findChannelById(o.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") price in "+a.Name+" to "+o.Price,"Success"),this.paginationService.resetToFirstPage(this.searchFilter)})}onUpdateItems(t){const o=this.productService.selectedVariantProduct(t);this.dialog.open(y.j,{data:{selectedItems:o,channels:this.channelOptions},width:"40%"}).afterClosed().pipe((0,d.h)(i=>void 0!==i)).subscribe(i=>{this.channelOptions=i,this.updatePrice(t)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/api/${this.rowCountAPI}`,{})}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(f.O),e.Y36(x._W),e.Y36(P.uw),e.Y36(A.b),e.Y36(b.M))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchDropdown","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","hideSearchDropdown","textButton","onSubmit"],[1,"d-flex"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-md-12",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"col-md-12"],["productToggleTitle","Filter Different Price","table","price",3,"showProductToggle","data","channel","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",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(t,o){1&t&&(e.YNc(0,E,23,21,"mainpanel",0),e.ALo(1,"async")),2&t&&e.Q6J("ngIf",e.lcZ(1,1,o.loader$))},dependencies:[p.O5,u.p,F.a,p.Ov,p.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]}),n})();var g=l(8705),D=l(7945),H=l(1290),N=l(1739),I=l(1948);function R(n,c){if(1&n&&(e.TgZ(0,"mat-radio-button",3),e._uU(1),e.qZA()),2&n){const t=c.$implicit,o=c.index,i=e.oxw();e.Q6J("value",t.Key)("name",i.name)("title",i.tooltipsText[o]?i.tooltipsText[o]:""),e.xp6(1),e.hij(" ",t.Value,"")}}const G=function(n){return{"border-0":n}};let B=(()=>{class n{constructor(){this.modelChange=new e.vpe,this.border=!1,this.tooltipsText=[]}change(t){this.modelChange.emit(t)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},decls:3,vars:5,consts:[[1,"form-control","h-100",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(t,o){1&t&&(e.TgZ(0,"div",0)(1,"mat-radio-group",1),e.NdJ("ngModelChange",function(a){return o.change(a)}),e.YNc(2,R,2,4,"mat-radio-button",2),e.qZA()()),2&t&&(e.Q6J("ngClass",e.VKq(3,G,0==o.border)),e.xp6(1),e.Q6J("ngModel",o.model),e.xp6(1),e.Q6J("ngForOf",o.options))},dependencies:[p.mk,p.sg,I.VQ,I.U0,_.JJ,_.On],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]}),n})(),j=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[p.ez,I.Fk,_.u5]}),n})();function z(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"button",19),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.onUpdateItems())}),e._UZ(1,"i",20),e._uU(2," Update "),e.qZA()}}function W(n,c){if(1&n&&(e.TgZ(0,"th",21),e._uU(1),e.qZA()),2&n){const t=c.$implicit;e.xp6(1),e.Oqu(t.Name)}}function X(n,c){1&n&&(e.ynx(0),e.TgZ(1,"th",22),e._uU(2," Expected (POS) "),e.qZA(),e.TgZ(3,"th",22),e._uU(4," Channel "),e.qZA(),e.BQk())}function ee(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"img",34),e.NdJ("click",function(i){e.CHM(t);const a=e.oxw(3).$implicit,r=e.oxw();return e.KtG(r.onZoomImage(i,null==a?null:a.ImageUrl))}),e.qZA()}if(2&n){const t=e.oxw(3).$implicit;e.s9C("src",null==t?null:t.ImageUrl,e.LSH)}}function te(n,c){1&n&&e._UZ(0,"img",35)}const ne=function(n){return{"border-bottom":n}};function ie(n,c){if(1&n&&(e.ynx(0),e.TgZ(1,"td",29),e.YNc(2,ee,1,1,"img",30),e.YNc(3,te,1,0,"ng-template",null,31,e.W1O),e.qZA(),e.TgZ(5,"td",32)(6,"h5",33),e._uU(7),e.qZA(),e._UZ(8,"br"),e.TgZ(9,"small"),e._uU(10),e.qZA()(),e.BQk()),2&n){const t=e.MAs(4),o=e.oxw().index,i=e.oxw().$implicit,a=e.oxw();e.xp6(1),e.Q6J("rowSpan",null==i?null:i.Variants.length)("ngClass",e.VKq(7,ne,o+1==a.products.length)),e.xp6(1),e.Q6J("ngIf",null==i?null:i.ImageUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",null==i?null:i.Variants.length),e.xp6(2),e.Oqu(null==i?null:i.Name),e.xp6(3),e.hij("(",null==i?null:i.Category,")")}}const oe=function(n){return{"bg-gradient-warning":n}};function ae(n,c){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"td",38),e._uU(2),e.ALo(3,"number"),e.qZA(),e.TgZ(4,"td",39)(5,"div",40)(6,"div",41),e.NdJ("click",function(){const a=e.CHM(t).$implicit,r=e.oxw(2).$implicit,s=e.oxw().$implicit,Oe=e.oxw();return e.KtG(Oe.openTableDialog(r,s,a))}),e._uU(7),e.ALo(8,"number"),e._UZ(9,"br"),e.qZA(),e.TgZ(10,"div",42)(11,"a",26),e._UZ(12,"i",27),e.qZA()()()(),e.BQk()}if(2&n){const t=c.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,4,t.PriceExpected)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(8,oe,t.Price!=t.PriceExpected)),e.xp6(3),e.hij(" ",e.lcZ(8,6,t.Price)," "),e.xp6(4),e.Q6J("href",t.Url,e.LSH)}}function ce(n,c){1&n&&(e.TgZ(0,"td",43),e._uU(1,"X"),e.qZA(),e.TgZ(2,"td",43),e._uU(3,"X"),e.qZA())}function re(n,c){if(1&n&&(e.ynx(0),e.YNc(1,ae,13,10,"ng-container",36),e.YNc(2,ce,4,0,"ng-template",null,37,e.W1O),e.BQk()),2&n){const t=c.$implicit,o=e.MAs(3),i=e.oxw().$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",a.getItemFromChannel(i,t.ID))("ngIfElse",o)}}function le(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"tr"),e.YNc(1,ie,11,9,"ng-container",23),e.TgZ(2,"td",24),e._uU(3),e.qZA(),e.TgZ(4,"td",24)(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span",25)(8,"a",26),e._UZ(9,"i",27),e.qZA()()(),e.TgZ(10,"td",28)(11,"input",17),e.NdJ("ngModelChange",function(i){const r=e.CHM(t).$implicit;return e.KtG(r.selected=i)}),e.qZA()(),e.YNc(12,re,4,2,"ng-container",18),e.qZA()}if(2&n){const t=c.$implicit,o=c.index,i=e.oxw(2);e.xp6(1),e.Q6J("ngIf",0==o),e.xp6(2),e.Oqu(null==t?null:t.Model),e.xp6(3),e.Oqu(null==t?null:t.Code),e.xp6(2),e.Q6J("href","https://"+i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),e.LSH),e.xp6(2),e.Q6J("hidden",null==i.searchFilter?null:i.searchFilter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngModel",t.selected),e.xp6(1),e.Q6J("ngForOf",i.channelOptions)}}function se(n,c){if(1&n&&(e.TgZ(0,"tbody"),e.YNc(1,le,13,7,"tr",18),e.qZA()),2&n){const t=c.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}let pe=(()=>{class n{constructor(t,o,i,a,r){this.http=t,this.toastr=o,this.dialog=i,this.productService=a,this.biggerPictureService=r,this.searchFilter=new H.k,this.products=[],this.checkboxState=!1,this.initPageLoader(),this.filterTypeOptions=[{Key:g.v.ALL,Value:"All"},{Key:g.v.DIFFERENCE,Value:"Difference"}],this.filterType=g.v.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.hostName=a.getHostName()}initPageLoader(){this.http.post("/api/PriceLoader/LoadMultiple",{}).subscribe(t=>{this.channelOptions=t.Options.Channel,this.searchFilter=t.Filter,this.searchFilter.HiddenIPOSInventory=!1,this.onFilter()})}onSelectAllData(){this.products=this.products.map(t=>(t.Variants&&(t.Variants=t.Variants.map(o=>(o.selected=this.checkboxState,o))),t))}onFilter(t){this.http.post("/api/Price/GetOutletPrice",{text:t,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount}).subscribe(i=>{this.products=i.Data})}updatePrice(){let t=this.productService.selectedVariantProduct(this.products);if(t.length>0){let o=t.map(r=>r.ID),a={ListChannelID:this.channelOptions.filter(r=>r.selected).map(r=>r.ID),ListID:o};this.http.post("/api/Price/UpdateChannelOutletPrice",a).subscribe({next:r=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+a.ListID.length+" items in "+a.ListChannelID.length+" channels","Success")},error:r=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(t=>(t.selected=!1,t))}getItemFromChannel(t,o){return t.Channel.find(i=>i.ChannelID==o)}onUpdateItems(){const t=this.productService.selectedVariantProduct(this.products);this.dialog.open(y.j,{data:{selectedItems:t,channels:this.channelOptions},width:"40%"}).afterClosed().pipe((0,d.h)(o=>h.g.IsNotEmpty(o))).subscribe(o=>{this.channelOptions=o,this.updatePrice()})}openTableDialog(t,o,i){let a=JSON.parse(JSON.stringify(t));this.dialog.open(D.k,{data:{Name:o.Name,Variant:a,ChannelID:i?.ChannelID,Table:"price",ChannelItemID:i?.ChannelItemID}}).afterClosed().pipe((0,d.h)(s=>h.g.IsNotEmpty(s))).subscribe(s=>{this.updateProductPrice(s,i)})}updateProductPrice(t,o){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:parseFloat(t.Price),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(a=>{o.Price=i.Price;const r=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success(`Successfully updated ${t.ItemName} (${t.VarName}) inventory in ${r.Name} to ${i.Price}`,"Success")})}onZoomImage(t,o){this.biggerPictureService.openBiggerPicture(t,o)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(f.O),e.Y36(x._W),e.Y36(P.uw),e.Y36(b.M),e.Y36(N.k))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-custom-channel-price"]],decls:31,vars:13,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],["container",""],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","5"],["scope","col","colspan","2","class","text-center border-bottom-0 border w-10 text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-20"],["scope","col",1,"text-start"],["scope","col",1,"text-start","w-10"],[3,"hidden"],["type","checkbox",3,"ngModel","ngModelChange"],[4,"ngFor","ngForOf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","w-10","text-uppercase"],[1,"text-end","border-top-0","border","w-10"],[4,"ngIf"],[1,"text-start","border-bottom"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"align-middle",3,"hidden"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-center","border-bottom",3,"rowSpan"],[1,"mb-0","item-name"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[4,"ngIf","ngIfElse"],["elseCol",""],[1,"text-end","border"],[1,"text-end","border","pointer","cell-hover",3,"ngClass"],[1,"row","justify-content-end","me-0"],[1,"col-8","px-0","text-center",3,"click"],[1,"col-2","ps-0","text-start","align-self-center"],[1,"table-white","border","text-end",2,"color","red"]],template:function(t,o){1&t&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(a){return o.onFilter(a)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Filter by"),e.qZA(),e.TgZ(6,"radio-options",2),e.NdJ("modelChange",function(a){return o.filterType=a}),e.qZA()()()(),e.TgZ(7,"actions")(8,"div",3),e.YNc(9,z,3,0,"button",4),e.qZA()(),e.TgZ(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr"),e._UZ(18,"th",11),e.YNc(19,W,2,1,"th",12),e.qZA(),e.TgZ(20,"tr")(21,"th",13),e._uU(22,"Product"),e.qZA(),e.TgZ(23,"th",14),e._uU(24,"Variant"),e.qZA(),e.TgZ(25,"th",15),e._uU(26,"SKU"),e.qZA(),e.TgZ(27,"th",16)(28,"input",17),e.NdJ("ngModelChange",function(a){return o.checkboxState=a})("ngModelChange",function(){return o.onSelectAllData()}),e.qZA()(),e.YNc(29,X,5,0,"ng-container",18),e.qZA()(),e.YNc(30,se,2,1,"tbody",18),e.qZA()()()()()()()),2&t&&(e.Q6J("pageData",o.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),e.xp6(6),e.Q6J("model",o.filterType)("options",o.filterTypeOptions)("border",!1),e.xp6(3),e.Q6J("ngIf",o.productService.hasSelectionVariant(o.products)),e.xp6(10),e.Q6J("ngForOf",o.channelOptions),e.xp6(8),e.Q6J("hidden",null==o.searchFilter?null:o.searchFilter.HiddenIPOSInventory),e.xp6(1),e.Q6J("ngModel",o.checkboxState),e.xp6(1),e.Q6J("ngForOf",o.channelOptions),e.xp6(1),e.Q6J("ngForOf",o.products))},dependencies:[p.mk,p.sg,p.O5,_.Wl,_.JJ,_.On,u.p,B,p.JJ],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]}),n})();var M=l(455),J=l(266);function _e(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"button",8),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2).ngIf,a=e.oxw();return e.KtG(a.openScanDialog(i))}),e._UZ(1,"i",9),e._uU(2," Scan Channel "),e.qZA()}}function he(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"button",10),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().ngIf,a=e.oxw(2);return e.KtG(a.updateStock(i))}),e._UZ(1,"i",11),e._uU(2," Update "),e.qZA()}}function de(n,c){if(1&n&&(e.TgZ(0,"actions")(1,"div",5)(2,"div"),e.YNc(3,_e,3,0,"button",6),e.YNc(4,he,3,0,"button",7),e.qZA()()()),2&n){const t=c.ngIf,o=e.oxw(2);e.xp6(3),e.Q6J("ngIf",!o.productService.hasSelectionVariant(t)),e.xp6(1),e.Q6J("ngIf",o.productService.hasSelectionVariant(t))}}function ge(n,c){if(1&n&&(e.TgZ(0,"ng-option",32),e._UZ(1,"img",33),e._uU(2),e.qZA()),2&n){const t=c.$implicit;e.Q6J("value",t.ID),e.xp6(1),e.s9C("src",t.Img,e.LSH),e.xp6(1),e.hij("",t.Name," ")}}function ue(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"input",53),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw(3).$implicit;return e.KtG(a.selected=i)})("ngModelChange",function(){e.CHM(t);const i=e.oxw(3).$implicit,a=e.oxw(3);return e.KtG(a.onCheckboxStateProduct(i))}),e.qZA()}if(2&n){const t=e.oxw(3).$implicit;e.Q6J("ngModel",t.selected)}}function me(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"img",54),e.NdJ("click",function(i){e.CHM(t);const a=e.oxw(3).$implicit,r=e.oxw(3);return e.KtG(r.onZoomImage(i,null==a?null:a.ImageUrl))}),e.qZA()}if(2&n){const t=e.oxw(3).$implicit;e.s9C("src",t.ThumbnailUrl,e.LSH)}}function Ce(n,c){1&n&&e._UZ(0,"img",55)}function fe(n,c){if(1&n&&(e.ynx(0),e.TgZ(1,"td",46)(2,"div",47),e.YNc(3,ue,1,1,"input",48),e.YNc(4,me,1,1,"img",49),e.YNc(5,Ce,1,0,"ng-template",null,50,e.W1O),e.qZA()(),e.TgZ(7,"td",51)(8,"span",52),e._uU(9),e.qZA(),e._UZ(10,"br"),e.TgZ(11,"small"),e._uU(12),e.qZA()(),e.BQk()),2&n){const t=e.MAs(6),o=e.oxw().$implicit,i=e.oxw().$implicit;e.xp6(1),e.Q6J("rowSpan",i.Variants.length),e.xp6(2),e.Q6J("ngIf",o.Inventory>=0||i.Variants.length>1),e.xp6(1),e.Q6J("ngIf",i.ThumbnailUrl)("ngIfElse",t),e.xp6(3),e.Q6J("rowSpan",i.Variants.length),e.xp6(2),e.Oqu(i.Name),e.xp6(3),e.hij("(",i.Category,")")}}function xe(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"input",56),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw().$implicit;return e.KtG(a.selected=i)}),e.qZA()}if(2&n){const t=e.oxw().$implicit;e.Q6J("ngModel",t.selected)}}function Pe(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"div",57)(1,"div",58),e.NdJ("click",function(){e.CHM(t);const i=e.oxw().$implicit,a=e.oxw().$implicit,r=e.oxw(2).ngIf,s=e.oxw();return e.KtG(s.openTableDialog(i,a,r))}),e._uU(2),e.ALo(3,"number"),e.qZA()()}if(2&n){const t=e.oxw().$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,null==t.Channel[0]?null:t.Channel[0].Price)," ")}}const be=function(n){return{"bg-gradient-warning":n}};function Ie(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"tr"),e.YNc(1,fe,13,7,"ng-container",4),e.TgZ(2,"td",19),e._uU(3),e.qZA(),e.TgZ(4,"td",22)(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span",34)(8,"a",35),e._UZ(9,"i",36),e.qZA()()(),e.TgZ(10,"td",37),e.YNc(11,xe,1,1,"input",38),e.qZA(),e.TgZ(12,"td",22),e._uU(13),e.ALo(14,"number"),e.qZA(),e.TgZ(15,"td",39),e.YNc(16,Pe,4,3,"div",40),e.qZA(),e.TgZ(17,"td")(18,"div",41)(19,"div",42)(20,"a",35),e._UZ(21,"i",43),e.qZA(),e._uU(22," \xa0\xa0 "),e.TgZ(23,"span",44),e.NdJ("click",function(){const a=e.CHM(t).$implicit,r=e.oxw(4);return e.KtG(r.refreshPrice(a))}),e._UZ(24,"i",45),e.qZA()()()()()}if(2&n){const t=c.$implicit,o=c.index,i=e.oxw(4);e.xp6(1),e.Q6J("ngIf",0==o),e.xp6(2),e.Oqu(t.Model),e.xp6(3),e.hij(" ",t.Code," "),e.xp6(2),e.Q6J("href","https://"+i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),e.LSH),e.xp6(3),e.Q6J("ngIf",t.Inventory>=0),e.xp6(2),e.hij(" ",e.lcZ(14,9,t.UnitPrice)," "),e.xp6(2),e.Q6J("ngClass",e.VKq(11,be,t.UnitPrice!=(null==t.Channel[0]?null:t.Channel[0].Price))),e.xp6(1),e.Q6J("ngIf",t.Channel.length>0),e.xp6(4),e.Q6J("href",null==t.Channel[0]?null:t.Channel[0].Url,e.LSH)}}function Se(n,c){if(1&n&&(e.ynx(0),e.YNc(1,Ie,25,13,"tr",26),e.BQk()),2&n){const t=c.$implicit;e.xp6(1),e.Q6J("ngForOf",t.Variants)}}function Te(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"span",59),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.getRowCount())}),e.TgZ(1,"i",60),e._uU(2,"?"),e.qZA()()}}function ve(n,c){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=c.ngIf;e.xp6(1),e.Oqu(e.lcZ(2,1,t.Total))}}function Ze(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"a",64),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onNextPage())}),e._UZ(1,"i",65),e._uU(2," Next"),e.qZA()}}function ye(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"a",66),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(4);return e.KtG(i.onLastPage())}),e._UZ(1,"i",67),e._uU(2," Last"),e.qZA()}}function we(n,c){if(1&n&&(e.TgZ(0,"div",61),e.YNc(1,Ze,3,0,"a",62),e.YNc(2,ye,3,0,"a",63),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),e.xp6(1),e.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Ae(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),e._uU(7," Product "),e.TgZ(8,"div")(9,"mat-slide-toggle",17),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw(2);return e.KtG(a.toggleDifferentInventory=i)})("toggleChange",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.onToggleDifferentInventory())}),e.TgZ(10,"small",18),e._uU(11,"Filter Different Price"),e.qZA()()()(),e.TgZ(12,"th",19),e._uU(13,"Variant"),e.qZA(),e.TgZ(14,"th",20),e._uU(15,"SKU"),e.qZA(),e.TgZ(16,"th")(17,"input",21),e.NdJ("change",function(i){const r=e.CHM(t).ngIf,s=e.oxw(2);return e.KtG(s.onSelectAllSKU(i.target.checked,r))}),e.qZA()(),e.TgZ(18,"th",22),e._uU(19,"POS"),e.qZA(),e.TgZ(20,"th")(21,"ng-select",23),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw(2);return e.KtG(a.searchFilter.ChannelID=i)})("change",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.search())}),e.YNc(22,ge,3,3,"ng-option",24),e.qZA()(),e._UZ(23,"th",25),e.qZA()(),e.TgZ(24,"tbody"),e.YNc(25,Se,2,1,"ng-container",26),e.qZA()(),e.TgZ(26,"div",27)(27,"div",28)(28,"div",29),e._uU(29),e.ALo(30,"number"),e.YNc(31,Te,3,0,"span",30),e.YNc(32,ve,3,3,"span",4),e.ALo(33,"async"),e._uU(34),e.qZA()(),e.YNc(35,we,3,2,"div",31),e.qZA()()()()}if(2&n){const t=c.ngIf,o=e.oxw().ngIf,i=e.oxw();e.xp6(9),e.Q6J("ngModel",i.toggleDifferentInventory),e.xp6(12),e.Q6J("clearable",!1)("ngModel",i.searchFilter.ChannelID),e.xp6(1),e.Q6J("ngForOf",o.Options.Channel),e.xp6(3),e.Q6J("ngForOf",t),e.xp6(4),e.hij(" Showing 1 - ",e.lcZ(30,10,null==t?null:t.length)," of "),e.xp6(2),e.Q6J("ngIf",i.paginationService.hideCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(33,12,!i.paginationService.hideCount&&i.allDataCount$)),e.xp6(2),e.hij(" records ~ ",i.paginationService.footerPageNumber," Page "),e.xp6(1),e.Q6J("ngIf",t.length>0)}}function Fe(n,c){if(1&n){const t=e.EpF();e.TgZ(0,"mainpanel",1),e.NdJ("textChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.searchFilter.text=i)})("onSubmit",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.search())}),e.TgZ(1,"filters")(2,"div",2)(3,"div")(4,"label"),e._uU(5,"Page Size"),e.qZA(),e.TgZ(6,"input",3),e.NdJ("ngModelChange",function(i){e.CHM(t);const a=e.oxw();return e.KtG(a.searchFilter.RowCount=i)}),e.qZA()()()(),e.YNc(7,de,5,2,"actions",4),e.ALo(8,"async"),e.YNc(9,Ae,36,14,"content",4),e.ALo(10,"async"),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("headerTitle",t.pageTitle)("text",t.searchFilter.text),e.xp6(6),e.Q6J("ngModel",t.searchFilter.RowCount),e.xp6(1),e.Q6J("ngIf",e.lcZ(8,5,t.paginationService.data$)),e.xp6(2),e.Q6J("ngIf",e.lcZ(10,7,t.paginationService.data$))}}let De=(()=>{class n{constructor(t,o,i,a,r,s){this.http=t,this.paginationService=o,this.toastr=i,this.dialog=a,this.productService=r,this.biggerPictureService=s,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.hostName=this.productService.getHostName()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe((0,w.b)(t=>{this.searchFilter=t.Filter,this.searchFilter.filterModel=g.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}))}onToggleDifferentInventory(){this.searchFilter.filterModel=this.toggleDifferentInventory?g.v.ALL:g.v.DIFFERENCE,this.search()}onCheckboxStateProduct(t){t.Variants=t.Variants.map(o=>(o.selected=t.selected,o))}openScanDialog(t){let o=JSON.parse(JSON.stringify(this.searchFilter));o.ChannelID=h.g.GuidEMpty,this.dialog.open(Z.j,{data:{filter:o,channelOptions:t.Options.Channel},width:"40%"}).afterClosed().pipe((0,d.h)(i=>h.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAll(t)})}scanAll(t){const o=this.productService.findChannelById(this.searchFilter.ChannelID,t.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(i=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(),this.toastr.success(`Successfully scanned from ${o?.Name}`,"Success"))})}updateStock(t){let i=this.productService.selectedVariantProduct(t).map(r=>({ID:r.ID,ChannelID:r.Channel[0].ChannelID,Code:r.Code,Price:r.UnitPrice})),a={ListChannelID:[this.searchFilter.ChannelID],ListPrice:i};this.http.post("/api/Price/UpdateChannel",a).subscribe(()=>{this.search(),this.toastr.success(`Successfully updated ${a.ListPrice.length} variants in ${a.ListChannelID.length} channels`,"Success")})}refreshPrice(t){this.http.post("/api/Price/RefreshPriceChannel",{ChannelItemID:t?.Channel[0].ChannelItemID,ChannelVariationID:t?.Channel[0]?.ChannelVariationID,ChannelID:t?.Channel[0]?.ChannelID,VariantID:t.ID}).subscribe(i=>{this.toastr.success("Successfully updated","Success"),this.search()})}search(){this.paginationService.resetToFirstPage(this.searchFilter)}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter).subscribe({next:t=>{this.paginationService.getAllData(this.searchFilter,t.Total)}})}openTableDialog(t,o,i){let a=JSON.parse(JSON.stringify(t));this.dialog.open(D.k,{data:{Name:o.Name,Variant:a,ChannelID:a?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:a?.Channel[0]?.ChannelItemID}}).afterClosed().pipe((0,d.h)(s=>h.g.IsNotEmpty(s))).subscribe(s=>{this.updateItemAfterDialog(s,i,t)})}updateItemAfterDialog(t,o,i){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:parseFloat(t.Price),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(r=>{const s=this.productService.findChannelById(a.ID,o.Options.Channel);this.toastr.success(`Successfully updated ${t.ItemName} (${t.VarName}) inventory in ${s.Name} to ${a.Price}`,"Success"),i.Channel[0]&&(i.Channel[0].Price=a.Price)})}onSelectAllSKU(t,o){o=o.map(i=>(i.Variants=i.Variants.map(a=>(a.selected=t,a)),i))}onZoomImage(t,o){this.biggerPictureService.openBiggerPicture(t,o)}ngOnDestroy(){this.paginationService.destroy()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(f.O),e.Y36(A.b),e.Y36(x._W),e.Y36(P.uw),e.Y36(b.M),e.Y36(N.k))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"headerTitle","text","textChange","onSubmit"],["container",""],["type","number",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModel","ngModelChange","toggleChange"],[1,"fw-bold"],[1,"text-start"],[1,"text-end",2,"width","20%"],["type","checkbox",1,"me-3",3,"change"],[1,"text-end"],["name","channelOption",3,"clearable","ngModel","ngModelChange","change"],[3,"value",4,"ngFor","ngForOf"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-external-link-alt"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"text-end",3,"ngClass"],["class","row justify-content-end me-0",4,"ngIf"],[1,"row"],[1,"col-12","ps-0","d-flex","justify-content-between"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"row","justify-content-end","me-0"],[1,"col-8","ps-0","pe-12","text-end",2,"cursor","pointer",3,"click"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",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","Load more for 20 products",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(t,o){1&t&&(e.YNc(0,Fe,11,9,"mainpanel",0),e.ALo(1,"async")),2&t&&e.Q6J("ngIf",e.lcZ(1,1,o.loader$))},dependencies:[p.mk,p.sg,p.O5,_.Fj,_.wV,_.Wl,_.JJ,_.On,u.p,C.w9,C.jq,M.Rr,J.gM,p.Ov,p.JJ],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"]}),n})();var S=l(8063);const Ne=[{path:"",component:U,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:K,canActivate:[S.a],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:pe,canActivate:[S.a],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:De,canActivate:[S.a],data:{title:"Price Single Channel Comparison"}}]}];let Me=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[p.ez,m.Bz.forChild(Ne)]}),n})();var Je=l(6709);let Ue=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[p.ez,_.u5,v.Z,u.R,m.Bz,C.A0,Me,_.UX,M.rP,j,Je.p9,F.U,J.AV]}),n})()}}]);
@@ -14,9 +14,9 @@
14
14
  <script>
15
15
  (function () { var w = window; var ic = w.Intercom; if (typeof ic === "function") { ic('reattach_activator'); ic('update', w.intercomSettings); } else { var d = document; var i = function () { i.c(arguments); }; i.q = []; i.c = function (args) { i.q.push(args); }; w.Intercom = i; var l = function () { var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://widget.intercom.io/widget/xv1oomgl'; var x = d.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); }; if (w.attachEvent) { w.attachEvent('onload', l); } else { w.addEventListener('load', l, false); } } })();
16
16
  </script>
17
- <style>@charset "UTF-8";:root{--bs-blue:#337ab7;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#c9302c;--bs-orange:#f6a828;--bs-yellow:#ffc107;--bs-green:#89b03e;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-black:#000;--bs-white:#ffffff;--bs-gray:#cccccc;--bs-gray-dark:#343a40;--bs-gray-100:#dddddd;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#cccccc;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#4d4d4d;--bs-primary:#337ab7;--bs-success:#89b03e;--bs-secondary:#cccccc;--bs-dark:#4d4d4d;--bs-light:#dddddd;--bs-light-gray:rgba(203, 203, 210, .15);--bs-light-blue:#dfeffc;--bs-danger:#c9302c;--bs-warning:#f6a828;--bs-primary-rgb:51, 122, 183;--bs-success-rgb:137, 176, 62;--bs-secondary-rgb:204, 204, 204;--bs-dark-rgb:77, 77, 77;--bs-light-rgb:221, 221, 221;--bs-light-gray-rgb:203, 203, 210;--bs-light-blue-rgb:223, 239, 252;--bs-danger-rgb:201, 48, 44;--bs-warning-rgb:246, 168, 40;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-body-color-rgb:51, 51, 51;--bs-body-bg-rgb:255, 255, 255;--bs-font-sans-serif:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0));--bs-body-font-family:Roboto, sans-serif;--bs-body-font-size:.75rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#333333;--bs-body-bg:#ffffff;--bs-border-width:1px;--bs-border-style:solid;--bs-border-color:#dee2e6;--bs-border-color-translucent:rgba(0, 0, 0, .175);--bs-border-radius:.375rem;--bs-border-radius-sm:.25rem;--bs-border-radius-lg:.5rem;--bs-border-radius-xl:1rem;--bs-border-radius-2xl:2rem;--bs-border-radius-pill:50rem;--bs-link-color:#0976b4;--bs-link-hover-color:#075e90;--bs-code-color:#d63384;--bs-highlight-bg:#fff3cd}*,*:before,*:after{box-sizing:border-box}@media (prefers-reduced-motion: no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}@media (max-width: 991px){body{position:relative}}html,body{height:100%}@media print{html,body{height:auto}body{color:#000!important}}</style><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/marketplacepos@2.4.7/Marketplace/styles.dff58ae3c0783953.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/marketplacepos@2.4.7/Marketplace/styles.dff58ae3c0783953.css"></noscript></head>
17
+ <style>@charset "UTF-8";:root{--bs-blue:#337ab7;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#c9302c;--bs-orange:#f6a828;--bs-yellow:#ffc107;--bs-green:#89b03e;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-black:#000;--bs-white:#ffffff;--bs-gray:#cccccc;--bs-gray-dark:#343a40;--bs-gray-100:#dddddd;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#cccccc;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#4d4d4d;--bs-primary:#337ab7;--bs-success:#89b03e;--bs-secondary:#cccccc;--bs-dark:#4d4d4d;--bs-light:#dddddd;--bs-light-gray:rgba(203, 203, 210, .15);--bs-light-blue:#dfeffc;--bs-danger:#c9302c;--bs-warning:#f6a828;--bs-primary-rgb:51, 122, 183;--bs-success-rgb:137, 176, 62;--bs-secondary-rgb:204, 204, 204;--bs-dark-rgb:77, 77, 77;--bs-light-rgb:221, 221, 221;--bs-light-gray-rgb:203, 203, 210;--bs-light-blue-rgb:223, 239, 252;--bs-danger-rgb:201, 48, 44;--bs-warning-rgb:246, 168, 40;--bs-white-rgb:255, 255, 255;--bs-black-rgb:0, 0, 0;--bs-body-color-rgb:51, 51, 51;--bs-body-bg-rgb:255, 255, 255;--bs-font-sans-serif:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--bs-font-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0));--bs-body-font-family:Roboto, sans-serif;--bs-body-font-size:.75rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#333333;--bs-body-bg:#ffffff;--bs-border-width:1px;--bs-border-style:solid;--bs-border-color:#dee2e6;--bs-border-color-translucent:rgba(0, 0, 0, .175);--bs-border-radius:.375rem;--bs-border-radius-sm:.25rem;--bs-border-radius-lg:.5rem;--bs-border-radius-xl:1rem;--bs-border-radius-2xl:2rem;--bs-border-radius-pill:50rem;--bs-link-color:#0976b4;--bs-link-hover-color:#075e90;--bs-code-color:#d63384;--bs-highlight-bg:#fff3cd}*,*:before,*:after{box-sizing:border-box}@media (prefers-reduced-motion: no-preference){:root{scroll-behavior:smooth}}body{margin:0;font-family:var(--bs-body-font-family);font-size:var(--bs-body-font-size);font-weight:var(--bs-body-font-weight);line-height:var(--bs-body-line-height);color:var(--bs-body-color);text-align:var(--bs-body-text-align);background-color:var(--bs-body-bg);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}@media (max-width: 991px){body{position:relative}}html,body{height:100%}@media print{html,body{height:auto}body{color:#000!important}}</style><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/marketplacepos@2.4.9/Marketplace/styles.dff58ae3c0783953.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/marketplacepos@2.4.9/Marketplace/styles.dff58ae3c0783953.css"></noscript></head>
18
18
  <body>
19
19
  <app-root></app-root>
20
- <script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.4.7/Marketplace/runtime.d61181a09cffdcb7.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.4.7/Marketplace/polyfills.8d85b0533e3f867a.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.4.7/Marketplace/scripts.09af772bfa77d50d.js" defer></script><script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.4.7/Marketplace/main.195197d9958646d1.js" type="module"></script>
20
+ <script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.4.9/Marketplace/runtime.a82898ac8aec5312.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.4.9/Marketplace/polyfills.8d85b0533e3f867a.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.4.9/Marketplace/scripts.09af772bfa77d50d.js" defer></script><script src="https://cdn.jsdelivr.net/npm/marketplacepos@2.4.9/Marketplace/main.195197d9958646d1.js" type="module"></script>
21
21
 
22
22
  </body></html>
@@ -1 +1 @@
1
- (()=>{"use strict";var e,v={},_={};function r(e){var n=_[e];if(void 0!==n)return n.exports;var t=_[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(n,t,f,c)=>{if(!t){var a=1/0;for(o=0;o<e.length;o++){for(var[t,f,c]=e[o],s=!0,d=0;d<t.length;d++)(!1&c||a>=c)&&Object.keys(r.O).every(u=>r.O[u](t[d]))?t.splice(d--,1):(s=!1,c<a&&(a=c));if(s){e.splice(o--,1);var l=f();void 0!==l&&(n=l)}}return n}c=c||0;for(var o=e.length;o>0&&e[o-1][2]>c;o--)e[o]=e[o-1];e[o]=[t,f,c]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},(()=>{var n,e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;r.t=function(t,f){if(1&f&&(t=this(t)),8&f||"object"==typeof t&&t&&(4&f&&t.__esModule||16&f&&"function"==typeof t.then))return t;var c=Object.create(null);r.r(c);var o={};n=n||[null,e({}),e([]),e(e)];for(var a=2&f&&t;"object"==typeof a&&!~n.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(s=>o[s]=()=>t[s]);return o.default=()=>t,r.d(c,o),c}})(),r.d=(e,n)=>{for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((n,t)=>(r.f[t](e,n),n),[])),r.u=e=>(592===e?"common":e)+"."+{6:"fc79ecc0c0a33462",25:"5e00713dbd080b64",32:"9c83cc1dfc19e37d",162:"607e0d0557cd1e06",174:"981a3e729681507b",180:"bfed0f08b5cdbbde",360:"4fa1f449dc516500",369:"22148155f90d64b2",397:"727785281e7927cb",455:"fc7663306b753727",463:"7140b32660c473a4",512:"96a1a3c8c51a8727",516:"f335756d88de781a",585:"9e916b668a91cc94",592:"3f5874655db24424",616:"fb179a9605c3e98c",716:"65e3e9a36c3e8be6",717:"c3d108362a36e597",739:"82b92600f9519019",785:"e0040d021febffb1",796:"d34bd45b5a924fca",832:"6082371d3ebb95a0",874:"6ae77583afef7f90"}[e]+".js",r.miniCssF=e=>{},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="pos-marketplace:";r.l=(t,f,c,o)=>{if(e[t])e[t].push(f);else{var a,s;if(void 0!==c)for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++){var i=d[l];if(i.getAttribute("src")==t||i.getAttribute("data-webpack")==n+c){a=i;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",n+c),a.src=r.tu(t)),e[t]=[f];var p=(g,u)=>{a.onerror=a.onload=null,clearTimeout(b);var m=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),m&&m.forEach(h=>h(u)),g)return g(u)},b=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:n=>n},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="https://cdn.jsdelivr.net/npm/marketplacepos@2.4.7/Marketplace/",(()=>{var e={666:0};r.f.j=(f,c)=>{var o=r.o(e,f)?e[f]:void 0;if(0!==o)if(o)c.push(o[2]);else if(666!=f){var a=new Promise((i,p)=>o=e[f]=[i,p]);c.push(o[2]=a);var s=r.p+r.u(f),d=new Error;r.l(s,i=>{if(r.o(e,f)&&(0!==(o=e[f])&&(e[f]=void 0),o)){var p=i&&("load"===i.type?"missing":i.type),b=i&&i.target&&i.target.src;d.message="Loading chunk "+f+" failed.\n("+p+": "+b+")",d.name="ChunkLoadError",d.type=p,d.request=b,o[1](d)}},"chunk-"+f,f)}else e[f]=0},r.O.j=f=>0===e[f];var n=(f,c)=>{var d,l,[o,a,s]=c,i=0;if(o.some(b=>0!==e[b])){for(d in a)r.o(a,d)&&(r.m[d]=a[d]);if(s)var p=s(r)}for(f&&f(c);i<o.length;i++)r.o(e,l=o[i])&&e[l]&&e[l][0](),e[l]=0;return r.O(p)},t=self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))})()})();
1
+ (()=>{"use strict";var e,v={},_={};function r(e){var n=_[e];if(void 0!==n)return n.exports;var t=_[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(n,t,f,c)=>{if(!t){var a=1/0;for(o=0;o<e.length;o++){for(var[t,f,c]=e[o],s=!0,d=0;d<t.length;d++)(!1&c||a>=c)&&Object.keys(r.O).every(u=>r.O[u](t[d]))?t.splice(d--,1):(s=!1,c<a&&(a=c));if(s){e.splice(o--,1);var l=f();void 0!==l&&(n=l)}}return n}c=c||0;for(var o=e.length;o>0&&e[o-1][2]>c;o--)e[o]=e[o-1];e[o]=[t,f,c]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},(()=>{var n,e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;r.t=function(t,f){if(1&f&&(t=this(t)),8&f||"object"==typeof t&&t&&(4&f&&t.__esModule||16&f&&"function"==typeof t.then))return t;var c=Object.create(null);r.r(c);var o={};n=n||[null,e({}),e([]),e(e)];for(var a=2&f&&t;"object"==typeof a&&!~n.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(s=>o[s]=()=>t[s]);return o.default=()=>t,r.d(c,o),c}})(),r.d=(e,n)=>{for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((n,t)=>(r.f[t](e,n),n),[])),r.u=e=>(592===e?"common":e)+"."+{6:"fc79ecc0c0a33462",25:"5e00713dbd080b64",32:"9c83cc1dfc19e37d",162:"380fb02c77fa6ec0",174:"d9e54ac6a8d68fed",180:"bfed0f08b5cdbbde",360:"4fa1f449dc516500",369:"16ffb7833f5f392e",397:"5bc29c874039d3c8",455:"fc7663306b753727",463:"7140b32660c473a4",512:"96a1a3c8c51a8727",516:"f335756d88de781a",585:"9e916b668a91cc94",592:"3f5874655db24424",616:"fb179a9605c3e98c",716:"65e3e9a36c3e8be6",717:"c3d108362a36e597",739:"82b92600f9519019",785:"e0040d021febffb1",796:"d34bd45b5a924fca",832:"6082371d3ebb95a0",874:"472e0cd7c75127ca"}[e]+".js",r.miniCssF=e=>{},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="pos-marketplace:";r.l=(t,f,c,o)=>{if(e[t])e[t].push(f);else{var a,s;if(void 0!==c)for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++){var i=d[l];if(i.getAttribute("src")==t||i.getAttribute("data-webpack")==n+c){a=i;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",n+c),a.src=r.tu(t)),e[t]=[f];var b=(g,u)=>{a.onerror=a.onload=null,clearTimeout(p);var m=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),m&&m.forEach(h=>h(u)),g)return g(u)},p=setTimeout(b.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=b.bind(null,a.onerror),a.onload=b.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:n=>n},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="https://cdn.jsdelivr.net/npm/marketplacepos@2.4.9/Marketplace/",(()=>{var e={666:0};r.f.j=(f,c)=>{var o=r.o(e,f)?e[f]:void 0;if(0!==o)if(o)c.push(o[2]);else if(666!=f){var a=new Promise((i,b)=>o=e[f]=[i,b]);c.push(o[2]=a);var s=r.p+r.u(f),d=new Error;r.l(s,i=>{if(r.o(e,f)&&(0!==(o=e[f])&&(e[f]=void 0),o)){var b=i&&("load"===i.type?"missing":i.type),p=i&&i.target&&i.target.src;d.message="Loading chunk "+f+" failed.\n("+b+": "+p+")",d.name="ChunkLoadError",d.type=b,d.request=p,o[1](d)}},"chunk-"+f,f)}else e[f]=0},r.O.j=f=>0===e[f];var n=(f,c)=>{var d,l,[o,a,s]=c,i=0;if(o.some(p=>0!==e[p])){for(d in a)r.o(a,d)&&(r.m[d]=a[d]);if(s)var b=s(r)}for(f&&f(c);i<o.length;i++)r.o(e,l=o[i])&&e[l]&&e[l][0](),e[l]=0;return r.O(b)},t=self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))})()})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marketplacepos",
3
- "version": "2.4.7",
3
+ "version": "2.4.9",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[162],{9162:(vn,x,s)=>{s.r(x),s.d(x,{InventoryModule:()=>xn});var c=s(6895),n=s(4650),m=s(8252),v=s(7398);let D=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,i){1&t&&(n.TgZ(0,"nav",0)(1,"div",1)(2,"div"),n._UZ(3,"nav-tab",2),n.qZA()()(),n._UZ(4,"router-outlet")),2&t&&(n.xp6(3),n.Q6J("Tabs",i.inventoryTabs))},dependencies:[m.lC,v.e]}),e})();var I=s(8231),P=s(6304),b=s(8505),d=s(9300),u=s(3154),_=s(8705),S=s(1318),y=s(7185),T=s(5412),Z=s(7287),F=s(6082),C=s(7481),w=s(488);function J(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",17),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(3);return n.KtG(a.openScanDialog())}),n._UZ(1,"i",18),n._uU(2," Scan Channel "),n.qZA()}}function U(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",19),n.NdJ("click",function(){n.CHM(t);const a=n.oxw().ngIf,o=n.oxw(2);return n.KtG(o.onUpdateItems(a))}),n._UZ(1,"i",20),n._uU(2," Update "),n.qZA()}}function k(e,l){if(1&e&&(n.TgZ(0,"actions")(1,"div",14)(2,"div"),n.YNc(3,J,3,0,"button",15),n.YNc(4,U,3,0,"button",16),n.qZA()()()),2&e){const t=l.ngIf,i=n.oxw(2);n.xp6(3),n.Q6J("ngIf",!i.productService.hasSelectionVariant(t)),n.xp6(1),n.Q6J("ngIf",i.productService.hasSelectionVariant(t))}}function L(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"app-table",21),n.NdJ("onToggle",function(a){n.CHM(t);const o=n.oxw(2);return n.KtG(o.onShowDifferenceStock(a))})("onSubmit",function(a){const r=n.CHM(t).ngIf,p=n.oxw(2);return n.KtG(p.updateStockByVariant(a,r))}),n.qZA()}if(2&e){const t=l.ngIf,i=n.oxw(2);n.Q6J("data",t)("channel",i.channelOptions)("showProductToggle",!0)("filter",i.searchFilter)}}function O(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"span",22),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.getRowCount())}),n.TgZ(1,"i",23),n._uU(2,"?"),n.qZA()()}}function Q(e,l){if(1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&e){const t=l.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,t))}}function Y(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",24),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.nextPage())}),n._UZ(1,"i",25),n._uU(2," Next"),n.qZA()}}function E(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",26),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.getAllData())}),n._UZ(1,"i",27),n._uU(2," Last"),n.qZA()}}function V(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.onSearch(a))}),n.YNc(1,k,5,2,"actions",2),n.ALo(2,"async"),n.TgZ(3,"content")(4,"div",3)(5,"div",4)(6,"div",5),n.YNc(7,L,1,4,"app-table",6),n.ALo(8,"async"),n.ynx(9),n.TgZ(10,"div",7)(11,"div",8)(12,"div",9),n._uU(13),n.ALo(14,"number"),n.ALo(15,"async"),n.YNc(16,O,3,0,"span",10),n.YNc(17,Q,3,3,"span",2),n.ALo(18,"async"),n._uU(19),n.qZA()(),n.TgZ(20,"div",11),n.YNc(21,Y,3,0,"a",12),n.YNc(22,E,3,0,"a",13),n.qZA()(),n.BQk(),n.qZA()()()()()}if(2&e){const t=n.oxw();let i;n.Q6J("pageData",t.pageData)("hideSearchBox",!1)("hideSearchDropdown",!0)("textButton","Search"),n.xp6(1),n.Q6J("ngIf",n.lcZ(2,12,t.paginationService.data$)),n.xp6(6),n.Q6J("ngIf",n.lcZ(8,14,t.paginationService.data$)),n.xp6(6),n.hij(" Showing 1 - ",n.lcZ(14,16,null==(i=n.lcZ(15,18,t.paginationService.data$))?null:i.length)," of "),n.xp6(3),n.Q6J("ngIf",t.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(18,20,!t.paginationService.hideCount&&t.allDataCount$)),n.xp6(2),n.hij(" records ~ ",t.paginationService.footerPageNumber," Page "),n.xp6(2),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}let q=(()=>{class e{constructor(t,i,a,o,r){this.http=t,this.toastr=i,this.dialog=a,this.paginationService=o,this.productService=r,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe((0,b.b)(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,filterModel:_.v.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.resetToFirstPage(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(t,i){let a=this.productService.selectedVariantProduct(t);if(a.length>0){let r=a.map(h=>({ID:h.ID,Code:h.Code,Inventory:h.Inventory})),p={ListChannelID:i.filter(h=>h.selected).map(h=>h.ID),List:r};this.http.post("/api/Inventory/UpdateChannel",p).subscribe(h=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+p.List.length+" variants in "+p.ListChannelID.length+" channels","Success")})}}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(I.j,{data:{filter:t,channelOptions:this.channelOptions},width:"40%"}).afterClosed().pipe((0,d.h)(a=>u.g.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,i,!this.searchFilter.UpdatedProduct),this.initPageLoader()}this.searchFilter.ChannelID=u.g.GuidEMpty})}updateStockByVariant(t,i){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(o=>{let r=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+r.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(t){this.searchFilter.filterModel=t?_.v.DIFFERENCE:_.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}onUpdateItems(t){const i=this.productService.selectedVariantProduct(t);this.dialog.open(P.j,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"40%"}).afterClosed().pipe((0,d.h)(a=>u.g.IsNotEmpty(a))).subscribe(a=>{this.updateStock(t,a)})}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,{text:this.searchFilter.text})}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}}return e.\u0275fac=function(t){return new(t||e)(n.Y36(S.O),n.Y36(y._W),n.Y36(T.uw),n.Y36(Z.b),n.Y36(F.M))},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",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(t,i){1&t&&(n.YNc(0,V,23,22,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,i.loader$))},dependencies:[c.O5,C.p,w.a,c.Ov,c.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]}),e})();var $=s(7945),K=s(1739),g=s(4006),f=s(8796),A=s(455),M=s(266);function G(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",32),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2).ngIf,o=n.oxw();return n.KtG(o.openScanDialog(a))}),n._UZ(1,"i",33),n._uU(2," Scan Channel "),n.qZA()}}function H(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",34),n.NdJ("click",function(){n.CHM(t);const a=n.oxw().ngIf,o=n.oxw(2);return n.KtG(o.updateStock(a))}),n._UZ(1,"i",35),n._uU(2," Update"),n.qZA()}}function R(e,l){if(1&e&&(n.TgZ(0,"div"),n.YNc(1,G,3,0,"button",30),n.YNc(2,H,3,0,"button",31),n.qZA()),2&e){const t=l.ngIf,i=n.oxw(2);n.xp6(1),n.Q6J("ngIf",!i.productService.hasSelectionVariant(t)),n.xp6(1),n.Q6J("ngIf",i.productService.hasSelectionVariant(t))}}function B(e,l){1&e&&(n.TgZ(0,"div",36)(1,"span"),n._uU(2," showing only different stock, please press next to populate more data "),n.qZA()())}function j(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"th")(1,"input",37),n.NdJ("ngModelChange",function(a){n.CHM(t);const o=n.oxw(2);return n.KtG(o.checkboxState=a)})("ngModelChange",function(){const o=n.CHM(t).ngIf,r=n.oxw(2);return n.KtG(r.onCheckboxStateChange(o))}),n.qZA()()}if(2&e){const t=n.oxw(2);n.xp6(1),n.Q6J("ngModel",t.checkboxState)}}function z(e,l){if(1&e&&(n.TgZ(0,"ng-option",38),n._UZ(1,"img",39),n._uU(2),n.qZA()),2&e){const t=l.$implicit;n.Q6J("value",t.ID),n.xp6(1),n.s9C("src",t.Img,n.LSH),n.xp6(1),n.hij("",t.Name," ")}}function W(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"input",58),n.NdJ("ngModelChange",function(a){n.CHM(t);const o=n.oxw(3).$implicit;return n.KtG(o.selected=a)})("ngModelChange",function(){n.CHM(t);const a=n.oxw(3).$implicit,o=n.oxw(2);return n.KtG(o.onCheckboxStateProduct(a))}),n.qZA()}if(2&e){const t=n.oxw(3).$implicit;n.Q6J("ngModel",t.selected)}}function X(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"img",59),n.NdJ("click",function(a){n.CHM(t);const o=n.oxw(3).$implicit,r=n.oxw(2);return n.KtG(r.onZoomImage(a,null==o?null:o.ImageUrl))}),n.qZA()}if(2&e){const t=n.oxw(3).$implicit;n.s9C("src",null==t?null:t.ThumbnailUrl,n.LSH)}}function nn(e,l){1&e&&n._UZ(0,"img",60)}function tn(e,l){if(1&e&&(n.ynx(0),n.TgZ(1,"td",51)(2,"div",52),n.YNc(3,W,1,1,"input",53),n.YNc(4,X,1,1,"img",54),n.YNc(5,nn,1,0,"ng-template",null,55,n.W1O),n.qZA()(),n.TgZ(7,"td",56)(8,"span",57),n._uU(9),n.qZA(),n._UZ(10,"br"),n.TgZ(11,"small"),n._uU(12),n.qZA()(),n.BQk()),2&e){const t=n.MAs(6),i=n.oxw().$implicit,a=n.oxw().$implicit;n.xp6(1),n.Q6J("rowSpan",null==a?null:a.Variants.length),n.xp6(2),n.Q6J("ngIf",(null==i?null:i.Inventory)>=0||a.Variants.length>1),n.xp6(1),n.Q6J("ngIf",null==a?null:a.ThumbnailUrl)("ngIfElse",t),n.xp6(3),n.Q6J("rowSpan",null==a?null:a.Variants.length),n.xp6(2),n.Oqu(null==a?null:a.Name),n.xp6(3),n.hij("(",null==a?null:a.Category,")")}}function en(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"input",37),n.NdJ("ngModelChange",function(a){n.CHM(t);const o=n.oxw().$implicit;return n.KtG(o.selected=a)}),n.qZA()}if(2&e){const t=n.oxw().$implicit;n.Q6J("ngModel",t.selected)}}function an(e,l){if(1&e&&(n.TgZ(0,"span")(1,"span",61),n._uU(2),n.ALo(3,"number"),n.qZA(),n._uU(4," => "),n.TgZ(5,"span",62),n._uU(6),n.ALo(7,"number"),n.qZA()()),2&e){const t=n.oxw().$implicit;n.xp6(2),n.hij(" ",n.lcZ(3,2,null==t||null==t.I?null:t.I.Available),""),n.xp6(4),n.Oqu(n.lcZ(7,4,null==t?null:t.Inventory))}}function on(e,l){if(1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&e){const t=n.oxw().$implicit;n.xp6(1),n.hij(" ",n.lcZ(2,1,null==t?null:t.Inventory)," ")}}const ln=function(e){return{"bg-gradient-warning":e}};function rn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"td",63)(1,"div",64)(2,"div",65),n.NdJ("click",function(){n.CHM(t);const a=n.oxw().$implicit,o=n.oxw(),r=o.$implicit,p=o.ngForOf,h=n.oxw(2);return n.KtG(h.openTableDialog(r,a,p))}),n._uU(3),n.ALo(4,"number"),n.qZA()()()}if(2&e){const t=n.oxw().$implicit;n.Q6J("ngClass",n.VKq(4,ln,(null==t?null:t.Inventory)!=(null==t||null==t.Channel[0]?null:t.Channel[0].Inventory))),n.xp6(3),n.hij(" ",n.lcZ(4,2,null==t||null==t.Channel[0]?null:t.Channel[0].Inventory)," ")}}function sn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"tr"),n.YNc(1,tn,13,7,"ng-container",3),n.TgZ(2,"td",40),n._uU(3),n.qZA(),n.TgZ(4,"td",41)(5,"span"),n._uU(6),n.qZA(),n.TgZ(7,"span",42)(8,"a",43),n._UZ(9,"i",44),n.qZA()()(),n.TgZ(10,"td",45),n.YNc(11,en,1,1,"input",46),n.qZA(),n.TgZ(12,"td",41),n.YNc(13,an,8,6,"span",3),n.YNc(14,on,3,3,"span",3),n.qZA(),n.YNc(15,rn,5,6,"td",47),n.TgZ(16,"td")(17,"div",10)(18,"div",48)(19,"a",43),n._UZ(20,"i",44),n.qZA(),n._uU(21," \xa0\xa0 "),n.TgZ(22,"span",49),n.NdJ("click",function(){const o=n.CHM(t).$implicit,r=n.oxw(3);return n.KtG(r.refreshInventory(null==o||null==o.Channel[0]?null:o.Channel[0].ChannelItemID,null==o||null==o.Channel[0]?null:o.Channel[0].ChannelVariationID,null==o||null==o.Channel[0]?null:o.Channel[0].ChannelID,null==o?null:o.ID))}),n._UZ(23,"i",50),n.qZA()()()()()}if(2&e){const t=l.$implicit,i=l.index,a=n.oxw(3);n.xp6(1),n.Q6J("ngIf",0==i),n.xp6(2),n.Oqu(null==t?null:t.Model),n.xp6(3),n.Oqu(null==t?null:t.Code),n.xp6(2),n.Q6J("href","https://"+a.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(null==t?null:t.ID),n.LSH),n.xp6(3),n.Q6J("ngIf",(null==t?null:t.Inventory)>=0),n.xp6(2),n.Q6J("ngIf",(null==t?null:t.Inventory)!=(null==t||null==t.I?null:t.I.Available)),n.xp6(1),n.Q6J("ngIf",(null==t?null:t.Inventory)==(null==t||null==t.I?null:t.I.Available)),n.xp6(1),n.Q6J("ngIf",null==t?null:t.Channel),n.xp6(4),n.Q6J("href",null==t||null==t.Channel[0]?null:t.Channel[0].Url,n.LSH)}}function cn(e,l){if(1&e&&(n.TgZ(0,"tbody"),n.YNc(1,sn,24,9,"tr",24),n.qZA()),2&e){const t=l.$implicit;n.xp6(1),n.Q6J("ngForOf",t.Variants)}}function pn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"span",66),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.getRowCount())}),n.TgZ(1,"i",67),n._uU(2,"?"),n.qZA()()}}function hn(e,l){if(1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&e){const t=l.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,null==t?null:t.Total))}}function un(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",71),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(3);return n.KtG(a.onNextPage())}),n._UZ(1,"i",72),n._uU(2," Next"),n.qZA()}}function gn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",73),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(3);return n.KtG(a.onLastPage())}),n._UZ(1,"i",74),n._uU(2," Last"),n.qZA()}}function _n(e,l){if(1&e&&(n.TgZ(0,"div",68),n.YNc(1,un,3,0,"a",69),n.YNc(2,gn,3,0,"a",70),n.qZA()),2&e){const t=n.oxw(2);n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function dn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.onSearch(a))}),n.TgZ(1,"actions")(2,"div",2),n.YNc(3,R,3,2,"div",3),n.ALo(4,"async"),n.qZA()(),n.TgZ(5,"filters")(6,"div",2)(7,"div",4)(8,"div")(9,"label",5),n._uU(10,"PageNumber"),n.qZA(),n.TgZ(11,"input",6),n.NdJ("ngModelChange",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.searchFilter.PageNumber=a)}),n.qZA()(),n.TgZ(12,"div")(13,"label",7),n._uU(14,"Page Size"),n.qZA(),n.TgZ(15,"input",8),n.NdJ("ngModelChange",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.searchFilter.RowCount=a)}),n.qZA()()()()(),n.TgZ(16,"content")(17,"div",9)(18,"div",10)(19,"div",11),n.YNc(20,B,3,0,"div",12),n.TgZ(21,"table",13)(22,"thead",14)(23,"tr")(24,"th",15),n._uU(25,"Product "),n._UZ(26,"br"),n.TgZ(27,"mat-slide-toggle",16),n.NdJ("toggleChange",function(){n.CHM(t);const a=n.oxw();return a.showDifferenceStock=!a.showDifferenceStock,n.KtG(a.onShowDifferenceStock())}),n.TgZ(28,"small",17),n._uU(29,"Filter Different Inventory"),n.qZA()()(),n.TgZ(30,"th",18),n._uU(31,"Variant"),n.qZA(),n.TgZ(32,"th",19),n._uU(33,"SKU"),n.qZA(),n.YNc(34,j,2,1,"th",3),n.ALo(35,"async"),n.TgZ(36,"th",20),n._uU(37,"POS"),n.qZA(),n.TgZ(38,"th")(39,"ng-select",21),n.NdJ("change",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.onFilterChannel(a))})("ngModelChange",function(a){n.CHM(t);const o=n.oxw();return n.KtG(o.searchFilter.ChannelID=a)}),n.YNc(40,z,3,3,"ng-option",22),n.qZA()(),n._UZ(41,"th",23),n.qZA()(),n.YNc(42,cn,2,1,"tbody",24),n.ALo(43,"async"),n.qZA(),n.TgZ(44,"div",25)(45,"div",26)(46,"div",27),n._uU(47),n.ALo(48,"number"),n.ALo(49,"async"),n.YNc(50,pn,3,0,"span",28),n.YNc(51,hn,3,3,"span",3),n.ALo(52,"async"),n._uU(53),n.qZA()(),n.YNc(54,_n,3,2,"div",29),n.ALo(55,"async"),n.qZA()()()()()()}if(2&e){const t=l.ngIf,i=n.oxw();let a,o;n.Q6J("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),n.xp6(3),n.Q6J("ngIf",n.lcZ(4,17,i.paginationService.data$)),n.xp6(8),n.Q6J("ngModel",i.searchFilter.PageNumber),n.xp6(4),n.Q6J("ngModel",i.searchFilter.RowCount),n.xp6(5),n.Q6J("ngIf",3==(null==i.searchFilter?null:i.searchFilter.filterModel)),n.xp6(14),n.Q6J("ngIf",n.lcZ(35,19,i.paginationService.data$)),n.xp6(5),n.Q6J("clearable",!1)("ngModel",i.searchFilter.ChannelID),n.xp6(1),n.Q6J("ngForOf",t.Options.Channel),n.xp6(2),n.Q6J("ngForOf",n.lcZ(43,21,i.paginationService.data$)),n.xp6(5),n.hij(" Showing 1 - ",n.lcZ(48,23,null==(a=n.lcZ(49,25,i.paginationService.data$))?null:a.length)," of "),n.xp6(3),n.Q6J("ngIf",i.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(52,27,!i.paginationService.hideCount&&i.rowCount$)),n.xp6(2),n.hij(" records ~ ",i.paginationService.footerPageNumber," Page "),n.xp6(1),n.Q6J("ngIf",(null==(o=n.lcZ(55,29,i.paginationService.data$))?null:o.length)>0)}}let mn=(()=>{class e{constructor(t,i,a,o,r,p){this.http=t,this.toastr=i,this.dialog=a,this.paginationService=o,this.productService=r,this.biggerPictureService=p,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]},this.hostName=r.getHostName()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe((0,b.b)(t=>{this.channelOptions=t.Options.Channel,this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.paginationService.resetToFirstPage(this.searchFilter),t.Filter.IsMarketplaceAppActive||this.toastr.warning("Automatic inventory sync disabled.\n Please enable Dealpos X Marketplace Apps integration in POS Configuration","Warning")}))}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}onFilterChannel(t){this.searchFilter.ChannelID=t,this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(t){const i=this.productService.selectedVariantProduct(t);if(i.length>0){let a=i.map(r=>({ID:r.ID,Code:r.Code,Inventory:r.Inventory})),o={ListChannelID:[this.searchFilter.ChannelID],List:a};this.http.post("/api/Inventory/UpdateChannel",o).subscribe(r=>{this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success"),this.checkboxState=!1})}}openScanDialog(t){const i=JSON.parse(JSON.stringify(this.searchFilter));i.ChannelID=u.g.GuidEMpty,this.dialog.open(I.j,{data:{filter:i,channelOptions:t.Options.Channel},width:"40%"}).afterClosed().pipe((0,d.h)(o=>u.g.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scannALl(t)})}scannALl(t){const i=this.productService.findChannelById(this.searchFilter.ChannelID,t.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(a=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.searchFilter.ScanFull=!1,this.initPageLoader(),this.toastr.success("Successfully scanned from "+i?.Name,"Success"))})}refreshInventory(t,i,a,o){this.http.post("/api/Inventory/RefreshInventoryChannel",{ChannelItemID:t,ChannelVariationID:i,ChannelID:a,VariantID:o}).subscribe(p=>{this.toastr.success("Successfully updated","Success"),this.paginationService.resetToFirstPage(this.searchFilter)})}onCheckboxStateProduct(t){t.Variants=t.Variants.map(i=>(i.Inventory>=0&&(i.selected=t.selected),i))}onCheckboxStateChange(t){t=t.map(i=>(i.Variants=i.Variants.map(a=>(a.selected=this.checkboxState,a)),i))}openTableDialog(t,i,a){this.dialog.open($.k,{data:{Name:t.Name,Variant:i,ChannelID:i?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:t.ChannelItemID}}).afterClosed().pipe((0,d.h)(r=>u.g.IsNotEmpty(r))).subscribe(r=>{this.updateItemAfterDialog(r,a)})}updateItemAfterDialog(t,i){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};const o=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(r=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+o?.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(){this.searchFilter.filterModel=this.showDifferenceStock?_.v.DIFFERENCE:_.v.ALL,this.paginationService.resetToFirstPage(this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}getRowCount(){const t={ChannelID:this.searchFilter.ChannelID,PageNumber:1,text:this.searchFilter.text};this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`${this.rowCountApi}`,t)}onLastPage(){this.http.post(`${this.rowCountApi}`,{ChannelID:this.searchFilter.ChannelID,PageNumber:1}).subscribe({next:i=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,i.Total)}})}onZoomImage(t,i){this.biggerPictureService.openBiggerPicture(t,i)}ngOnDestroy(){this.paginationService.destroy()}}return e.\u0275fac=function(t){return new(t||e)(n.Y36(S.O),n.Y36(y._W),n.Y36(T.uw),n.Y36(Z.b),n.Y36(F.M),n.Y36(K.k))},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-single-channel-comparison"]],decls:2,vars:3,consts:[["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","36%"],[3,"toggleChange"],[1,"fw-bold"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","20%"],["scope","col",1,"text-end","w-10"],[3,"clearable","ngModel","change","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModel","ngModelChange"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"text-start"],[1,"text-end"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"col-12","ps-0","d-flex","justify-content-between"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"text-end",3,"ngClass"],[1,"row","justify-content-end","me-0"],[1,"col-12","pe-12","text-end",3,"click"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",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","Load more for 20 products",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(t,i){1&t&&(n.YNc(0,dn,56,31,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,i.loader$))},dependencies:[c.mk,c.sg,c.O5,g.Fj,g.wV,g.Wl,g.JJ,g.On,f.w9,f.jq,A.Rr,C.p,M.gM,c.Ov,c.JJ],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]}),e})();var N=s(8063);const Cn=[{path:"",component:D,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:q,canActivate:[N.a],data:{title:"Inventory Comparison"}},{path:"bychannel",component:mn,canActivate:[N.a],data:{title:"Inventory Comparison"}}]}];let fn=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=n.oAB({type:e}),e.\u0275inj=n.cJS({imports:[c.ez,m.Bz.forChild(Cn)]}),e})(),xn=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=n.oAB({type:e}),e.\u0275inj=n.cJS({imports:[c.ez,fn,m.Bz,v.Z,g.u5,f.A0,A.rP,C.R,w.U,M.AV]}),e})()}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[174],{6174:(M,y,s)=>{s.r(y),s.d(y,{OrderModule:()=>E});var p=s(6895),t=s(4650),v=s(7398),m=s(8252);const C=function(){return["/menu/report/product-statistic/channel"]};let S=(()=>{class o{constructor(){this.reportTabs=[{Title:"1 - New Order",Url:"/menu/report/order/sync-order"},{Title:"2 - Ready to Ship",Url:"/menu/report/order/invoice"},{Title:"3 - Shipped",Url:"/menu/report/order/delivery"},{Title:"4 - Completed",Url:"/menu/report/order/payment"}]}}return o.\u0275fac=function(e){return new(e||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-order"]],decls:18,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"],[1,"dropdown","dropstart","me-4"],["role","button","data-bs-toggle","dropdown","id","dropdownMenuButton1","aria-expanded","false",1,"text-dark"],[1,"fas","fa-bars","fa-lg"],["aria-labelledby","dropdownMenuButton1",1,"dropdown-menu","report"],[1,"dropdown-header","text-dark","fw-normal",2,"font-size",".875rem !important"],[1,"dropdown-divider"],[1,"dropdown-item",3,"routerLink"],[1,"fa-regular","fa-file","me-2"]],template:function(e,r){1&e&&(t.TgZ(0,"nav",0)(1,"div",1)(2,"div"),t._UZ(3,"nav-tab",2),t.qZA(),t.TgZ(4,"div",3)(5,"a",4),t._UZ(6,"i",5),t.qZA(),t.TgZ(7,"ul",6)(8,"li")(9,"h5",7),t._uU(10,"Product Report"),t.qZA()(),t.TgZ(11,"li"),t._UZ(12,"hr",8),t.qZA(),t.TgZ(13,"li")(14,"a",9),t._UZ(15,"i",10),t._uU(16,"Product Statistic"),t.qZA()()()()()(),t._UZ(17,"router-outlet")),2&e&&(t.xp6(3),t.Q6J("Tabs",r.reportTabs),t.xp6(11),t.Q6J("routerLink",t.DdM(2,C)))},dependencies:[v.e,m.lC,m.yS],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]}),o})();var l=s(3154);class f{}var _=s(1318);let g=(()=>{class o{constructor(e){this.http=e}GetLoader(){return new Promise((e,r)=>{this.http.post("/api/Report/GetLoader",{}).subscribe(i=>{e(i)})})}GetSyncOrder(e){return new Promise((r,i)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(a=>{r(a)})})}GetSyncInvoice(e){return new Promise((r,i)=>{this.http.post("/api/Report/Invoice",JSON.stringify(e)).subscribe(a=>{r(a)})})}GetSyncDelivery(e){return new Promise((r,i)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(a=>{r(a)})})}GetSyncPayment(e){return new Promise((r,i)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(a=>{r(a)})})}}return o.\u0275fac=function(e){return new(e||o)(t.LFG(_.O))},o.\u0275prov=t.Yz7({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var d=s(7481),c=s(5171),h=(()=>{return(o=h||(h={}))[o.OK=200]="OK",o[o.BAD_REQUEST=400]="BAD_REQUEST",o[o.CONFLICT=409]="CONFLICT",o[o.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",h;var o})();function D(o,n){if(1&o&&(t.TgZ(0,"th",6)(1,"div",7)(2,"h4"),t._uU(3),t.qZA(),t.TgZ(4,"small",8),t._uU(5),t.qZA()()()),2&o){const e=n.$implicit,r=t.oxw();t.xp6(3),t.Oqu(e),t.xp6(1),t.Tol(r.getTextBgColor(e)),t.xp6(1),t.Oqu(r.getHeaderStatusDesc(e))}}const O=function(){return["/menu/log/order"]},P=function(o,n,e,r,i){return{responseCode:o,From:n,to:e,actionType:r,ChannelID:i}};function Z(o,n){if(1&o&&(t.TgZ(0,"td",12)(1,"a",13),t._uU(2),t.qZA()()),2&o){const e=n.$implicit,r=t.oxw().$implicit,i=t.oxw();t.xp6(1),t.Q6J("routerLink",t.DdM(3,O))("queryParams",t.qbA(4,P,e.Key,i.from,i.to,i.type,r.ChannelID)),t.xp6(1),t.hij(" ",e.Value," ")}}function F(o,n){if(1&o&&(t.TgZ(0,"tr")(1,"td")(2,"a",9),t._UZ(3,"img",10),t.qZA()(),t.TgZ(4,"td")(5,"div")(6,"a",9),t._uU(7),t.qZA()(),t.TgZ(8,"div"),t._uU(9),t.qZA()(),t.YNc(10,Z,3,10,"td",11),t.qZA()),2&o){const e=n.$implicit,r=t.oxw();t.xp6(2),t.s9C("href",e.Url,t.LSH),t.xp6(1),t.Q6J("src",r.getChannelLogo(e.Type),t.LSH),t.xp6(3),t.s9C("href",e.Url,t.LSH),t.xp6(1),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Url),t.xp6(1),t.Q6J("ngForOf",e.list)}}let u=(()=>{class o{constructor(){this.headerStatus=h}getHeaderStatusDesc(e){let r=null;switch(e){case h.BAD_REQUEST:r="BAD REQUEST";break;case h.CONFLICT:r="CONFLICT";break;case h.INTERNAL_SERVER_ERROR:r="INTERNAL SERVER ERROR";break;default:r="OK"}return r}getTextBgColor(e){let r=null;switch(e){case h.OK:r="bg-success";break;case h.INTERNAL_SERVER_ERROR:r="bg-danger";break;default:r="bg-warning"}return r}getChannelLogo(e){return l.g.getChannelLogoByTypeId(e)}}return o.\u0275fac=function(e){return new(e||o)},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-table-report"]],inputs:{header:"header",result:"result",from:"from",to:"to",type:"type"},decls:9,vars:2,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","3%"],["class","text-start","style","width: 5%;",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"text-start",2,"width","5%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],["class","text-start",4,"ngFor","ngForOf"],[1,"text-start"],[1,"h3","text-primary","fw-bold",3,"routerLink","queryParams"]],template:function(e,r){1&e&&(t.TgZ(0,"table",0)(1,"thead",1)(2,"tr"),t._UZ(3,"th",2),t.TgZ(4,"th",3),t._uU(5,"Channel"),t.qZA(),t.YNc(6,D,6,4,"th",4),t.qZA()(),t.TgZ(7,"tbody"),t.YNc(8,F,11,6,"tr",5),t.qZA()()),2&e&&(t.xp6(6),t.Q6J("ngForOf",r.header),t.xp6(2),t.Q6J("ngForOf",r.result))},dependencies:[p.sg,m.yS],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]}),o})();function w(o,n){if(1&o&&(t.TgZ(0,"div",5)(1,"div",6),t._UZ(2,"app-table-report",7),t.qZA()()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("result",e.result)("header",e.header)("from",e.from)("to",e.to)("type",0)}}let x=(()=>{class o{constructor(e,r){this.http=e,this.datePipe=r,this.filter=new f,this.pageTitle="New Order";let i=new Date;this.maxDate=i,this.minDate=l.g.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){const e=l.g.formatTitleForFromDate(this.filter.From,this.filter.To),r=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${r} - ${i})`}initPageLoader(){this.http.GetLoader().then(e=>{this.filter=e,this.from=this.filter.From.toString(),this.to=this.filter.To.toString(),this.http.GetSyncOrder(this.filter).then(r=>{this.header=r.Header,this.result=r.Body})})}getChannelLogs(e){this.filter.From=e.from,this.filter.To=e.to,this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(r=>{this.header=r.Header,this.result=r.Body,this.from=this.filter.From.toJSON(),this.to=this.filter.To.toJSON()})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(g),t.Y36(p.uU))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-sales-order"]],decls:7,vars:7,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],[1,"filterDate"],[3,"minDate","from","to","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(e,r){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),t.NdJ("dateChange",function(a){return r.getChannelLogs(a)}),t.qZA()()(),t.TgZ(4,"content")(5,"div",3),t.YNc(6,w,3,5,"div",4),t.qZA()()()),2&e&&(t.Q6J("headerTitle",r.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(3),t.Q6J("minDate",r.minDate)("from",r.filter.From)("to",r.filter.To),t.xp6(3),t.Q6J("ngIf",r.result))},dependencies:[p.O5,d.p,c.Pg,u],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),o})();var T=s(8063);function R(o,n){if(1&o&&(t.TgZ(0,"div",5)(1,"div",6),t._UZ(2,"app-table-report",7),t.qZA()()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("result",e.result)("header",e.header)("from",e.from)("to",e.to)("type",1)}}let b=(()=>{class o{constructor(e,r){this.http=e,this.datePipe=r,this.filter=new f,this.PageTitle="Ready to Ship";let i=new Date;this.maxDate=i,this.minDate=l.g.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){const e=l.g.formatTitleForFromDate(this.filter.From,this.filter.To),r=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${r} - ${i})`}initPageLoader(){this.http.GetLoader().then(e=>{this.filter=e,this.from=this.filter.From.toString(),this.to=this.filter.To.toString(),this.http.GetSyncInvoice(this.filter).then(r=>{this.header=r.Header,this.result=r.Body})})}getChannelLogs(e){this.filter.From=e.from,this.filter.To=e.to,this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(r=>{this.header=r.Header,this.result=r.Body,this.from=this.filter.From.toJSON(),this.to=this.filter.To.toJSON()})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(g),t.Y36(p.uU))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-invoice"]],decls:7,vars:7,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],[1,"filterDate"],[3,"minDate","from","to","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(e,r){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),t.NdJ("dateChange",function(a){return r.getChannelLogs(a)}),t.qZA()()(),t.TgZ(4,"content")(5,"div",3),t.YNc(6,R,3,5,"div",4),t.qZA()()()),2&e&&(t.Q6J("headerTitle",r.PageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(3),t.Q6J("minDate",r.minDate)("from",r.filter.From)("to",r.filter.To),t.xp6(3),t.Q6J("ngIf",r.result))},dependencies:[p.O5,d.p,c.Pg,u],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),o})();function A(o,n){if(1&o&&(t.TgZ(0,"div",5)(1,"div",6),t._UZ(2,"app-table-report",7),t.qZA()()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("result",e.result)("header",e.header)("from",e.from)("to",e.to)("type",3)}}let L=(()=>{class o{constructor(e,r){this.http=e,this.datePipe=r,this.filter=new f;let i=new Date;this.maxDate=i,this.minDate=l.g.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){const e=l.g.formatTitleForFromDate(this.filter.From,this.filter.To),r=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${r} - ${i})`}initPageLoader(){this.http.GetLoader().then(e=>{this.filter=e,this.from=this.filter.From.toString(),this.to=this.filter.To.toString(),this.http.GetSyncDelivery(this.filter).then(r=>{this.header=r.Header,this.result=r.Body})})}getChannelLogs(e){this.filter.From=e.from,this.filter.To=e.to,this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(r=>{this.header=r.Header,this.result=r.Body,this.from=this.filter.From.toJSON(),this.to=this.filter.To.toJSON()})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(g),t.Y36(p.uU))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-delivery"]],decls:7,vars:7,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],[1,"filterDate"],[3,"minDate","from","to","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(e,r){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),t.NdJ("dateChange",function(a){return r.getChannelLogs(a)}),t.qZA()()(),t.TgZ(4,"content")(5,"div",3),t.YNc(6,A,3,5,"div",4),t.qZA()()()),2&e&&(t.Q6J("headerTitle",r.PageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(3),t.Q6J("minDate",r.minDate)("from",r.filter.From)("to",r.filter.To),t.xp6(3),t.Q6J("ngIf",r.result))},dependencies:[p.O5,d.p,c.Pg,u],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),o})();function N(o,n){if(1&o&&(t.TgZ(0,"div",5)(1,"div",6),t._UZ(2,"app-table-report",7),t.qZA()()),2&o){const e=t.oxw();t.xp6(2),t.Q6J("result",e.result)("header",e.header)("from",e.from)("to",e.to)("type",4)}}let J=(()=>{class o{constructor(e,r){this.http=e,this.datePipe=r,this.filter=new f,this.PageTitle="Completed";let i=new Date;this.minDate=l.g.addDays(i,6),this.filter.From=i,this.filter.To=i,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){const e=l.g.formatTitleForFromDate(this.filter.From,this.filter.To),r=this.datePipe.transform(this.filter.From,e),i=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${r} - ${i})`}initPageLoader(){this.http.GetLoader().then(e=>{this.filter=e,this.from=this.filter.From.toString(),this.to=this.filter.To.toString(),this.http.GetSyncPayment(this.filter).then(r=>{this.header=r.Header,this.result=r.Body})})}getChannelLogs(e){this.filter.From=e.from,this.filter.To=e.to,this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(r=>{this.header=r.Header,this.result=r.Body,this.from=this.filter.From.toJSON(),this.to=this.filter.To.toJSON()})}}return o.\u0275fac=function(e){return new(e||o)(t.Y36(g),t.Y36(p.uU))},o.\u0275cmp=t.Xpm({type:o,selectors:[["app-payment"]],decls:7,vars:7,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],[1,"filterDate"],[3,"minDate","from","to","dateChange"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(e,r){1&e&&(t.TgZ(0,"mainpanel",0)(1,"actions")(2,"div",1)(3,"app-datepicker-range",2),t.NdJ("dateChange",function(a){return r.getChannelLogs(a)}),t.qZA()()(),t.TgZ(4,"content")(5,"div",3),t.YNc(6,N,3,5,"div",4),t.qZA()()()),2&e&&(t.Q6J("headerTitle",r.PageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),t.xp6(3),t.Q6J("minDate",r.minDate)("from",r.filter.From)("to",r.filter.To),t.xp6(3),t.Q6J("ngIf",r.result))},dependencies:[p.O5,d.p,c.Pg,u],styles:[".filterDate[_ngcontent-%COMP%]{position:absolute;right:10px;top:2px}"]}),o})();var I=s(4006);const U=[{path:"",component:S,children:[{path:"",redirectTo:"sync-order",pathMatch:"full"},{path:"sync-order",component:x,canActivate:[T.a],data:{title:"Sync Order"}},{path:"invoice",component:b,canActivate:[T.a],data:{title:"Sync Invoice"}},{path:"delivery",component:L,canActivate:[T.a],data:{title:"Sync Delivery"}},{path:"payment",component:J,canActivate:[T.a],data:{title:"Sync Payment"}}]}];let E=(()=>{class o{}return o.\u0275fac=function(e){return new(e||o)},o.\u0275mod=t.oAB({type:o}),o.\u0275inj=t.cJS({imports:[p.ez,v.Z,I.u5,d.R,c.v,m.Bz.forChild(U)]}),o})()}}]);