marketplacepos 3.11.7 → 3.11.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-7QECCYLR.js → chunk-2OH65RRD.js} +1 -1
- package/Marketplace/{chunk-L4Q4FQFW.js → chunk-6X4Y72EU.js} +1 -1
- package/Marketplace/{chunk-ZU7YBWGM.js → chunk-ABP7H2KB.js} +1 -1
- package/Marketplace/{chunk-H5P5BX43.js → chunk-AERLJCPZ.js} +1 -1
- package/Marketplace/{chunk-QBA3X367.js → chunk-BQJ7TEFU.js} +1 -1
- package/Marketplace/{chunk-XJNFT56V.js → chunk-BRZIJKKW.js} +1 -1
- package/Marketplace/{chunk-UUPUVGXL.js → chunk-FKXEU6YD.js} +1 -1
- package/Marketplace/{chunk-T4Y427M7.js → chunk-GIB66QXC.js} +1 -1
- package/Marketplace/{chunk-5OSUE6B3.js → chunk-INC2ZO2P.js} +1 -1
- package/Marketplace/{chunk-JJ4ZOCSD.js → chunk-LGV7OVZH.js} +1 -1
- package/Marketplace/{chunk-QBVEDLRG.js → chunk-OIH3Z2GT.js} +1 -1
- package/Marketplace/{chunk-THNYE3KI.js → chunk-OJ2KLARB.js} +1 -1
- package/Marketplace/{chunk-CDAAQO6A.js → chunk-RTKGPCVZ.js} +1 -1
- package/Marketplace/{chunk-WVXTWIP3.js → chunk-SBNYVAJR.js} +1 -1
- package/Marketplace/{chunk-NQ3TJQ5O.js → chunk-SJ5GUR4P.js} +1 -1
- package/Marketplace/{chunk-PTYBFE3S.js → chunk-TXHO42LP.js} +1 -1
- package/Marketplace/{chunk-7TDQZKQC.js → chunk-V33ISYRU.js} +1 -1
- package/Marketplace/{chunk-LHLYIKEW.js → chunk-X66AQCTB.js} +1 -1
- package/Marketplace/{chunk-LHJXLBHB.js → chunk-YME44T2B.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-MFYZJGET.js → main-S2MUPIWG.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ke}from"./chunk-IWVYX6KY.js";import{a as He,b as Je,c as Ze}from"./chunk-G5LCLRIW.js";import{a as L,b as Pe,c as ve,d as be,e as ye}from"./chunk-WVXTWIP3.js";import{a as Se}from"./chunk-WQ7LUTQ2.js";import{b as qe}from"./chunk-BMZAGAK3.js";import{a as Xe,b as Ye}from"./chunk-N4S3Q3EC.js";import{a as ue}from"./chunk-662E5VTA.js";import{a as Y}from"./chunk-KBYAFLE5.js";import{a as X}from"./chunk-U5YOE633.js";import"./chunk-INNTQ5YN.js";import{a as ze,b as Ge}from"./chunk-SRYGE2HW.js";import{a as xe}from"./chunk-MYMGWQRE.js";import"./chunk-DT3B54LD.js";import{a as Re,b as Be,d as Ue,e as Ae}from"./chunk-AL67KXJV.js";import{a as Ce}from"./chunk-T4Y427M7.js";import{g as J}from"./chunk-7QECCYLR.js";import{b as G,e as K}from"./chunk-K3G6FMDF.js";import"./chunk-JM3LERUP.js";import{B as je,C as q,D as We,q as fe,r as $e,u as Z}from"./chunk-ZKBLXGXT.js";import"./chunk-6B64VOO7.js";import{b as me,c as de,h as k,k as O,m as _e,u as ge,v as Oe}from"./chunk-SP6QPE3M.js";import{c as H,e as he,f as Le}from"./chunk-6F6NSBIF.js";import{Ab as m,B as R,Bb as N,Cb as y,Db as ce,Eb as T,Fb as V,Gb as D,Ha as M,Ia as l,Ib as Ne,Ja as b,Kb as E,Q as ae,Rb as S,Sb as v,Tb as se,Ub as ne,Wa as d,Wc as ke,X as B,Ya as p,_c as pe,aa as oe,fb as r,gb as c,ha as F,hb as P,ia as re,ib as I,ic as U,jb as w,kc as A,lb as f,lc as $,ob as C,oc as j,pa as g,q as ee,qa as u,qb as s,rc as W,sc as z,tb as le,za as Fe,zb as te}from"./chunk-6DRNAUKE.js";import"./chunk-GRMIXZTT.js";function gt(i,o){if(i&1){let n=f();r(0,"button",18),C("click",function(){g(n);let t=s().ngIf,a=s(2);return u(a.onUpdateItems(t))}),P(1,"i",19),m(2," Update "),c()}}function ut(i,o){if(i&1&&(r(0,"div"),d(1,gt,3,0,"button",17),c()),i&2){let n=o.ngIf,e=s(2);l(),p("ngIf",e.productService.hasSelectionVariant(n))}}function ht(i,o){if(i&1){let n=f();r(0,"div",20)(1,"app-table",21),S(2,"async"),C("onToggle",function(t){g(n);let a=s(2);return u(a.onShowDifferencePrice(t))})("onSubmit",function(t){g(n);let a=s(2);return u(a.updatePriceByVariant(t))}),c()()}if(i&2){let n=s().ngIf,e=s();l(),p("showProductToggle",!0)("data",v(2,4,e.paginationService.data$))("channel",e.channelOptions)("filter",n.Filter)}}function Ct(i,o){if(i&1){let n=f();r(0,"span",22),C("click",function(){g(n);let t=s(2);return u(t.getRowCount())}),r(1,"i",23),m(2,"?"),c()()}}function ft(i,o){if(i&1&&(r(0,"span"),m(1),S(2,"number"),c()),i&2){let n=o.ngIf;l(),N(v(2,1,n))}}function xt(i,o){if(i&1){let n=f();r(0,"a",24),C("click",function(){g(n);let t=s(2);return u(t.onNextPage())}),P(1,"i",25),m(2," Next"),c()}}function St(i,o){if(i&1){let n=f();r(0,"a",26),C("click",function(){g(n);let t=s(2);return u(t.onLastPage())}),P(1,"i",27),m(2," Last"),c()}}function Pt(i,o){if(i&1){let n=f();r(0,"mainpanel",1),C("onSubmit",function(t){g(n);let a=s();return u(a.onSearch(t))}),r(1,"actions")(2,"div",2),d(3,ut,2,1,"div",3),S(4,"async"),c()(),r(5,"filters")(6,"div")(7,"label",4),m(8,"Page Number"),c(),r(9,"input",5),D("ngModelChange",function(t){g(n);let a=s();return V(a.searchFilter.PageNumber,t)||(a.searchFilter.PageNumber=t),u(t)}),c()(),r(10,"div",6)(11,"label",4),m(12,"Page Size"),c(),r(13,"input",5),D("ngModelChange",function(t){g(n);let a=s();return V(a.searchFilter.RowCount,t)||(a.searchFilter.RowCount=t),u(t)}),c()()(),r(14,"content")(15,"div",7)(16,"div",8),d(17,ht,3,6,"div",9),S(18,"async"),c(),r(19,"div",10)(20,"div",11)(21,"div",12),m(22),S(23,"async"),S(24,"number"),d(25,Ct,3,0,"span",13)(26,ft,3,3,"span",3),S(27,"async"),m(28),c()(),r(29,"div",14),d(30,xt,3,0,"a",15)(31,St,3,0,"a",16),c()()()()()}if(i&2){let n,e=s();p("pageData",e.pageData)("textButton","Search"),l(3),p("ngIf",v(4,12,e.paginationService.data$)),l(6),T("ngModel",e.searchFilter.PageNumber),l(4),T("ngModel",e.searchFilter.RowCount),l(4),p("ngIf",v(18,14,e.paginationService.data$)),l(5),y(" Showing 1 - ",v(24,18,(n=v(23,16,e.paginationService.data$))==null?null:n.length)," of "),l(3),p("ngIf",e.paginationService.hideCount),l(),p("ngIf",!e.paginationService.hideCount&&v(27,20,e.allDataCount$)),l(2),y(" records ~ ",e.paginationService.footerPageNumber," Page "),l(2),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),l(),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}var rt=(()=>{let o=class o{constructor(e,t,a,_,h,x){this.http=e,this.toastr=t,this.dialog=a,this.paginationService=_,this.productService=h,this.authService=x,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}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(B(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.paginationService.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}updatePrice(e){let t=this.productService.selectedVariantProduct(e);if(t.length>0){let _=t.map(x=>({ID:x.ID,Code:x.Code,Price:x.UnitPrice}));var a=this.channelOptions.filter(x=>x.selected).map(x=>x.ID);let h={ListChannelID:a,ListPrice:_};this.http.post("/api/Price/UpdateChannel",h).subscribe(x=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+h.ListPrice.length+" items in "+h.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(a=>{let _=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+_.Name+" to "+t.Price,"Success"),this.paginationService.reloadPagination(this.searchFilter)})}onUpdateItems(e){let t=this.productService.selectedVariantProduct(e);this.dialog.open(Se,{data:{selectedItems:t,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(R(a=>a!==void 0)).subscribe(a=>{this.channelOptions=a,this.updatePrice(e)})}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:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(t){return new(t||o)(b(K),b(G),b(Z),b(Y),b(X),b(J))},o.\u0275cmp=F({type:o,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","pageData","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[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 border-start-0","title","Load all products",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["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,"onToggle","onSubmit","showProductToggle","data","channel","filter"],[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","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(t,a){t&1&&(d(0,Pt,32,22,"mainpanel",0),S(1,"async")),t&2&&p("ngIf",v(1,1,a.loader$))},dependencies:[$,de,_e,k,O,q,be,j,W],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();var vt=i=>({"border-0 rounded":i});function bt(i,o){if(i&1&&(r(0,"mat-radio-button",3),m(1),c()),i&2){let n=o.$implicit,e=o.index,t=s();p("value",n.Key)("name",t.name)("title",t.tooltipsText[e]?t.tooltipsText[e]:""),l(),y(" ",n.Value,"")}}var Ie=(()=>{let o=class o{constructor(){this.modelChange=new Fe,this.border=!1,this.tooltipsText=[]}change(e){this.modelChange.emit(e)}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=F({type:o,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},standalone:!0,features:[Ne],decls:3,vars:5,consts:[[1,"form-control","h-100","rounded-1",3,"ngClass"],[3,"ngModelChange","ngModel"],["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,a){t&1&&(r(0,"div",0)(1,"mat-radio-group",1),C("ngModelChange",function(h){return a.change(h)}),d(2,bt,2,4,"mat-radio-button",2),c()()),t&2&&(p("ngClass",E(3,vt,a.border==!1)),l(),p("ngModel",a.model),l(),p("ngForOf",a.options))},dependencies:[z,U,A,Ze,He,Je,ge,k,O],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]});let i=o;return i})();var lt=i=>[i],Dt=i=>({"text-decoration-line-through":i}),Et=i=>({"border-bottom":i}),Mt=i=>({"bg-gradient-warning":i});function Ft(i,o){if(i&1){let n=f();I(0),r(1,"div")(2,"label",25),m(3,"Filter by"),c(),r(4,"radio-options",26),D("modelChange",function(t){g(n);let a=s();return V(a.filterType,t)||(a.filterType=t),u(t)}),c()(),w()}if(i&2){let n=s();l(4),T("model",n.filterType),p("options",n.filterTypeOptions)("border",!0)}}function Nt(i,o){if(i&1){let n=f();r(0,"button",29),C("click",function(){g(n);let t=s().ngIf,a=s();return u(a.onUpdateItems(t))}),P(1,"i",30),m(2," Update "),c()}}function kt(i,o){if(i&1&&(I(0),r(1,"div",27),d(2,Nt,3,0,"button",28),c(),w()),i&2){let n=o.ngIf,e=s();l(2),p("ngIf",e.productService.hasSelectionVariant(n))}}function Ot(i,o){if(i&1&&(r(0,"th",31)(1,"div",32),P(2,"img",33),r(3,"div",34),m(4),S(5,"stringLimit"),c()()()),i&2){let n=o.$implicit;l(),p("matTooltip",(n.Name==null?null:n.Name.length)>20?n.Name:""),l(),p("src",n==null?null:n.Img,M),l(2),ce("",se(5,4,n.Name,20),"",(n.Name==null?null:n.Name.length)>20?"...":"","")}}function Lt(i,o){if(i&1){let n=f();r(0,"th")(1,"input",35),D("ngModelChange",function(t){g(n);let a=s();return V(a.checkboxState,t)||(a.checkboxState=t),u(t)}),C("ngModelChange",function(){g(n);let t=s();return u(t.onSelectAllData())}),c()()}if(i&2){let n=s();l(),T("ngModel",n.checkboxState)}}function Rt(i,o){i&1&&(I(0),r(1,"th",36)(2,"span"),m(3,"Expected"),c(),r(4,"span",37),m(5,"(POS)"),c()(),r(6,"th",36),m(7," Channel "),c(),w())}function Bt(i,o){if(i&1){let n=f();r(0,"img",49),C("click",function(t){g(n);let a=s(3).$implicit,_=s(2);return u(_.onZoomImage(t,a==null?null:a.ImageUrl))}),c()}if(i&2){let n=s(3).$implicit;le("src",n==null?null:n.ImageUrl,M)}}function Ut(i,o){i&1&&P(0,"img",50)}function At(i,o){if(i&1&&(I(0),r(1,"td",44),d(2,Bt,1,1,"img",45)(3,Ut,1,0,"ng-template",null,0,ne),c(),r(5,"td",46)(6,"h5",47),m(7),c(),r(8,"small",48),m(9),c()(),w()),i&2){let n=te(4),e=s().index,t=s().$implicit,a=s().ngIf;l(),p("rowSpan",t==null?null:t.Variants.length)("ngClass",E(7,Et,e+1==a.length)),l(),p("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),l(3),p("rowSpan",t==null?null:t.Variants.length),l(2),N(t==null?null:t.Name),l(2),y("(",t==null?null:t.Category,")")}}function $t(i,o){if(i&1){let n=f();r(0,"td",51)(1,"input",35),D("ngModelChange",function(t){g(n);let a=s().$implicit;return V(a.selected,t)||(a.selected=t),u(t)}),c()()}if(i&2){let n=s().$implicit;l(),T("ngModel",n.selected)}}function jt(i,o){if(i&1){let n=f();I(0),r(1,"td",53),m(2),S(3,"number"),c(),r(4,"td",54),C("click",function(){let t=g(n).$implicit,a=s(2).$implicit,_=s().$implicit,h=s(2);return u(h.openTableDialog(a,_,t))}),r(5,"div",55)(6,"div",56),m(7),S(8,"number"),c(),r(9,"a",57),C("click",function(t){return g(n),u(t==null?null:t.stopPropagation())}),P(10,"i",43),c()()(),w()}if(i&2){let n=o.$implicit;l(2),y(" ",v(3,4,n.PriceExpected)," "),l(2),p("ngClass",E(8,Mt,n.Price!=n.PriceExpected)),l(3),y(" ",v(8,6,n.Price)," "),l(2),p("href",n.Url,M)}}function Wt(i,o){i&1&&(r(0,"td",58),m(1,"X"),c(),r(2,"td",58),m(3,"X"),c())}function zt(i,o){if(i&1&&(I(0),d(1,jt,11,10,"ng-container",52)(2,Wt,4,0,"ng-template",null,1,ne),w()),i&2){let n=o.$implicit,e=te(3),t=s().$implicit,a=s(3);l(),p("ngIf",a.getItemFromChannel(t,n.ID))("ngIfElse",e)}}function Gt(i,o){if(i&1&&(r(0,"tr"),d(1,At,10,9,"ng-container",3),r(2,"td",38),m(3),c(),r(4,"td",39)(5,"div",40)(6,"div",41),m(7),c(),r(8,"div",34)(9,"a",42),P(10,"i",43),c()()()(),d(11,$t,2,1,"ng-template",16)(12,zt,4,2,"ng-container",17),c()),i&2){let n=o.$implicit,e=o.index,t=s(3);l(),p("ngIf",e==0),l(2),N(n==null?null:n.Model),l(),p("matTooltip",n.isDiscontinued?t.discontinuedVariantMsg:""),l(2),p("ngClass",E(8,Dt,n.isDiscontinued)),l(),y(" ",n==null?null:n.Code,""),l(2),p("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),M),l(2),p("ngxPermissionsOnly",E(10,lt,t.rolePriceEdit)),l(),p("ngForOf",t.channelOptions)}}function Kt(i,o){if(i&1&&(r(0,"tbody"),d(1,Gt,13,12,"tr",17),c()),i&2){let n=o.$implicit;l(),p("ngForOf",n.Variants)}}function Ht(i,o){if(i&1&&(I(0),d(1,Kt,2,1,"tbody",17),w()),i&2){let n=o.ngIf;l(),p("ngForOf",n)}}function Jt(i,o){if(i&1){let n=f();r(0,"span",59),C("click",function(){g(n);let t=s();return u(t.getRowCount())}),r(1,"i",60),m(2,"?"),c()()}}function Zt(i,o){if(i&1&&(r(0,"span"),m(1),S(2,"number"),c()),i&2){let n=o.ngIf;l(),N(v(2,1,n))}}function qt(i,o){if(i&1){let n=f();r(0,"a",61),C("click",function(){g(n);let t=s();return u(t.onNextPage())}),P(1,"i",62),m(2," Next"),c()}}function Xt(i,o){if(i&1){let n=f();r(0,"a",63),C("click",function(){g(n);let t=s();return u(t.onLastPage())}),P(1,"i",64),m(2," Last"),c()}}var ct=(()=>{let o=class o{constructor(e,t,a,_,h,x,we){this.http=e,this.toastr=t,this.dialog=a,this.productService=_,this.authService=h,this.biggerPictureService=x,this.paginationService=we,this.searchFilter=new Ke,this.checkboxState=!1,this.rolePriceEdit=ue.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:L.ALL,Value:"All"},{Key:L.DIFFERENCE,Value:"Difference"}],this.filterType=L.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination()}initPagination(){this.paginationService.fetchDataEndpoint="Price/GetOutletPrice",this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.paginationService.data$.pipe(ee(e=>(e=e.map(t=>(t.Variants&&(t.Variants=t.Variants.map(a=>(a.isDiscontinued=a.Discontinued=="Yes",a))),t)),e)),ae(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(B(e=>{this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.paginationService.hideCount=!1,this.totalData$=this.http.post(`/api/${this.rowCountAPI}`,{}).pipe(B(e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}))}getRowCount(){this.paginationService.hideCount=!1,this.totalData$=this.http.post(`/api/${this.rowCountAPI}`,{})}onSelectAllData(){this.data$=this.data$.pipe(ee(e=>(e.map(t=>(t.Variants&&(t.Variants=t.Variants.map(a=>(a.selected=this.checkboxState,a))),t)),e)))}onFilter(e){let t={text:e,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.paginationService.reloadPagination(t)}updatePrice(e){let t=this.productService.selectedVariantProduct(e);if(t.length>0){let a=t.map(x=>x.ID),h={ListChannelID:this.channelOptions.filter(x=>x.selected).map(x=>x.ID),ListID:a};this.http.post("/api/Price/UpdateChannelOutletPrice",h).subscribe({next:x=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+h.ListID.length+" items in "+h.ListChannelID.length+" channels","Success")},error:x=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,t){return e.Channel.find(a=>a.ChannelID==t)}onUpdateItems(e){let t=this.productService.selectedVariantProduct(e);this.dialog.open(Se,{data:{selectedItems:t,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(R(a=>H.IsNotEmpty(a))).subscribe(a=>{this.channelOptions=a,this.updatePrice(e)})}openTableDialog(e,t,a){let _=JSON.parse(JSON.stringify(e));this.dialog.open(Pe,{data:{Name:t.Name,Variant:_,ChannelID:a?.ChannelID,Table:"price",ChannelItemID:a?.ChannelItemID}}).afterClosed().pipe(R(x=>H.IsNotEmpty(x))).subscribe(x=>{this.updateProductPrice(x,a)})}updateProductPrice(e,t){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(_=>{t.Price=a.Price;let h=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${h.Name} to ${a.Price}`,"Success")})}onZoomImage(e,t){this.biggerPictureService.openBiggerPicture(e,t)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(t){return new(t||o)(b(K),b(G),b(Z),b(X),b(J),b(xe),b(Y))},o.\u0275cmp=F({type:o,selectors:[["app-custom-channel-price"]],decls:42,vars:30,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","pageData","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2","class","text-center border-bottom-0 border text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[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"],[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 border-start-0","title","Load all products",3,"click",4,"ngIf"],[1,"fw-bold","mb-2"],["name","filterModel",3,"modelChange","model","options","border"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["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","text-uppercase"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"],[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","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(t,a){if(t&1&&(r(0,"mainpanel",2),C("onSubmit",function(h){return a.onFilter(h)}),r(1,"filters"),d(2,Ft,5,3,"ng-container",3),S(3,"async"),c(),r(4,"actions"),d(5,kt,3,1,"ng-container",3),S(6,"async"),c(),r(7,"content")(8,"div",4)(9,"div",5)(10,"div",6)(11,"div",7)(12,"table",8)(13,"thead",9)(14,"tr",10),P(15,"th",11),d(16,Ot,6,7,"th",12),c(),r(17,"tr")(18,"th",13)(19,"span"),m(20," Product "),c()(),r(21,"th",14),m(22,"Variant"),c(),r(23,"th",15),m(24,"SKU"),c(),d(25,Lt,2,1,"ng-template",16)(26,Rt,8,0,"ng-container",17),c()(),d(27,Ht,2,1,"ng-container",3),S(28,"async"),c()()()(),r(29,"div",18)(30,"div",19)(31,"div",20),m(32),S(33,"async"),S(34,"number"),d(35,Jt,3,0,"span",21)(36,Zt,3,3,"span",3),S(37,"async"),m(38),c()(),r(39,"div",22),d(40,qt,3,0,"a",23)(41,Xt,3,0,"a",24),c()()()()()),t&2){let _;p("pageData",a.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),l(2),p("ngIf",v(3,16,a.loader$)),l(3),p("ngIf",v(6,18,a.data$)),l(11),p("ngForOf",a.channelOptions),l(9),p("ngxPermissionsOnly",E(28,lt,a.rolePriceEdit)),l(),p("ngForOf",a.channelOptions),l(),p("ngIf",v(28,20,a.data$)),l(5),y(" Showing 1 - ",v(34,24,(_=v(33,22,a.paginationService.data$))==null?null:_.length)," of "),l(3),p("ngIf",a.paginationService.hideCount),l(),p("ngIf",!a.paginationService.hideCount&&v(37,26,a.totalData$)),l(2),y(" records ~ ",a.paginationService.footerPageNumber," Page "),l(2),p("ngIf",a.paginationService.disableNextButton&&!a.paginationService.goToLastPage),l(),p("ngIf",a.paginationService.disableNextButton&&!a.paginationService.goToLastPage)}},dependencies:[U,A,$,me,k,O,q,fe,Ie,he,j,W,ve],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}"]});let i=o;return i})();var Ee=i=>[i],Yt=i=>({"text-decoration-line-through":i}),Qt=i=>({"bg-gradient-warning":i}),en=i=>({"ms-10":i});function tn(i,o){if(i&1&&(r(0,"span",10),P(1,"img",11),c(),m(2)),i&2){let n=o.item;l(),p("src",n==null?null:n.Img,M),l(),y(" ",n.Name," ")}}function nn(i,o){if(i&1){let n=f();r(0,"button",16),C("click",function(){g(n);let t=s().ngIf,a=s(2);return u(a.updateStock(t))}),P(1,"i",17),m(2," Update "),c()}}function an(i,o){if(i&1){let n=f();r(0,"actions")(1,"div",12),d(2,nn,3,0,"button",13),r(3,"button",14),C("click",function(){g(n);let t=s(2);return u(t.Export())}),P(4,"i",15),r(5,"span"),m(6,"Export"),c()()()()}if(i&2){let n=o.ngIf,e=s(2);l(2),p("ngIf",e.productService.hasSelectionVariant(n))}}function on(i,o){if(i&1){let n=f();r(0,"th")(1,"input",37),C("change",function(t){g(n);let a=s().ngIf,_=s(2);return u(_.onSelectAllSKU(t.target.checked,a))}),c()()}}function rn(i,o){if(i&1){let n=f();r(0,"input",54),D("ngModelChange",function(t){g(n);let a=s(4).$implicit;return V(a.selected,t)||(a.selected=t),u(t)}),C("ngModelChange",function(){g(n);let t=s(4).$implicit,a=s(3);return u(a.onCheckboxStateProduct(t))}),c()}if(i&2){let n=s(4).$implicit;T("ngModel",n.selected)}}function ln(i,o){if(i&1&&(I(0),d(1,rn,1,1,"ng-template",26),w()),i&2){let n=s(6);l(),p("ngxPermissionsOnly",E(1,Ee,n.rolePriceEdit))}}function cn(i,o){if(i&1){let n=f();I(0),r(1,"img",55),C("click",function(t){g(n);let a=s(3).$implicit,_=s(3);return u(_.onZoomImage(t,a==null?null:a.ImageUrl))}),c(),w()}if(i&2){let n=s(3).$implicit;l(),le("src",n.ThumbnailUrl,M)}}function sn(i,o){i&1&&P(0,"img",56)}function pn(i,o){if(i&1&&(I(0),P(1,"br"),r(2,"small"),m(3),c(),w()),i&2){let n=s(3).$implicit;l(3),y("(",n.Category,")")}}function mn(i,o){if(i&1&&(I(0),r(1,"td",49)(2,"div",50),d(3,ln,2,3,"ng-container",9),r(4,"div",39),d(5,cn,2,1,"ng-container",51)(6,sn,1,0,"ng-template",null,0,ne),c()()(),r(8,"td",52)(9,"span",53),m(10),c(),d(11,pn,4,1,"ng-container",9),c(),w()),i&2){let n=te(7),e=s(2).$implicit,t=s(3);l(),p("rowSpan",e.Variants.length),l(2),p("ngIf",(e.Variants==null?null:e.Variants.length)>1),l(),p("ngClass",E(8,en,(e.Variants==null?null:e.Variants.length)<=1)),l(),p("ngIf",e.ThumbnailUrl)("ngIfElse",n),l(3),p("rowSpan",e.Variants.length),l(2),N(e.Name),l(),p("ngIf",(e==null?null:e.CategoryID)!==null&&(e==null?null:e.CategoryID)!=t.guidEmpty)}}function dn(i,o){if(i&1){let n=f();r(0,"input",59),D("ngModelChange",function(t){g(n);let a=s(2).$implicit;return V(a.selected,t)||(a.selected=t),u(t)}),c()}if(i&2){let n=s(2).$implicit;T("ngModel",n.selected)}}function _n(i,o){if(i&1&&(r(0,"td",57),d(1,dn,1,1,"input",58),c()),i&2){let n=s().$implicit;l(),p("ngIf",n.Inventory>=0)}}function gn(i,o){i&1&&(r(0,"div",60),m(1,"Not Found"),c())}function un(i,o){if(i&1&&(r(0,"div"),m(1),S(2,"number"),c()),i&2){let n=s().$implicit;l(),y(" ",v(2,1,n.UnitPrice),"")}}function hn(i,o){if(i&1&&(I(0),r(1,"div",44)(2,"a",45),P(3,"i",61),c()(),w()),i&2){let n=s().$implicit,e=s(4);l(2),p("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),M)}}function Cn(i,o){if(i&1){let n=f();r(0,"div",62),C("click",function(){g(n);let t=s().$implicit,a=s().$implicit,_=s(2).ngIf,h=s();return u(h.openTableDialog(t,a,_))}),m(1),S(2,"number"),c()}if(i&2){let n=s().$implicit;l(),y(" ",v(2,1,n.Channel[0]==null?null:n.Channel[0].Price)," ")}}function fn(i,o){if(i&1){let n=f();r(0,"tr"),d(1,mn,12,10,"ng-container",9),r(2,"td",24),m(3),c(),r(4,"td",38)(5,"span",39),m(6),c()(),d(7,_n,2,1,"ng-template",26),r(8,"td",27)(9,"div",40),d(10,gn,2,0,"div",41)(11,un,3,3,"div",9)(12,hn,4,1,"ng-container",9),c()(),r(13,"td",42)(14,"div",40),d(15,Cn,3,3,"div",43),r(16,"div",44)(17,"a",45),P(18,"i",46),c()(),r(19,"div",44)(20,"div",47),C("click",function(){let t=g(n).$implicit,a=s(4);return u(a.refreshPrice(t))}),P(21,"i",48),c()()()()()}if(i&2){let n=o.$implicit,e=o.index,t=s(4);l(),p("ngIf",e==0),l(2),N(n.Model),l(),p("matTooltip",n.isDiscontinued?t.discontinuedVariantMsg:""),l(),p("ngClass",E(12,Yt,n.isDiscontinued)),l(),y(" ",n.Code," "),l(),p("ngxPermissionsOnly",E(14,Ee,t.rolePriceEdit)),l(3),p("ngIf",(n.Channel[0]==null?null:n.Channel[0].Description)!=null),l(),p("ngIf",(n.Channel[0]==null?null:n.Channel[0].Description)==null),l(),p("ngIf",(n.Channel[0]==null?null:n.Channel[0].Description)==null),l(),p("ngClass",E(16,Qt,n.UnitPrice!=(n.Channel[0]==null?null:n.Channel[0].Price))),l(2),p("ngIf",n.Channel.length>0),l(2),p("href",n.Channel[0]==null?null:n.Channel[0].Url,M)}}function xn(i,o){if(i&1&&(I(0),d(1,fn,22,18,"tr",31),w()),i&2){let n=o.$implicit;l(),p("ngForOf",n.Variants)}}function Sn(i,o){if(i&1){let n=f();r(0,"span",62),C("click",function(){g(n);let t=s(3);return u(t.getRowCount())}),r(1,"i",63),m(2,"?"),c()()}}function Pn(i,o){if(i&1&&(r(0,"span"),m(1),S(2,"number"),c()),i&2){let n=o.ngIf;l(),N(v(2,1,n.Total))}}function vn(i,o){if(i&1){let n=f();r(0,"a",67),C("click",function(){g(n);let t=s(4);return u(t.onNextPage())}),P(1,"i",68),m(2," Next"),c()}}function bn(i,o){if(i&1){let n=f();r(0,"a",69),C("click",function(){g(n);let t=s(4);return u(t.onLastPage())}),P(1,"i",70),m(2," Last"),c()}}function yn(i,o){if(i&1&&(r(0,"div",64),d(1,vn,3,0,"a",65)(2,bn,3,0,"a",66),c()),i&2){let n=s(3);l(),p("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),l(),p("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function In(i,o){if(i&1){let n=f();r(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),m(7," Product "),r(8,"div")(9,"mat-slide-toggle",23),D("ngModelChange",function(t){g(n);let a=s(2);return V(a.toggleDifferentInventory,t)||(a.toggleDifferentInventory=t),u(t)}),C("toggleChange",function(){g(n);let t=s(2);return u(t.onToggleDifferentInventory())}),r(10,"small",7),m(11,"FILTER DIFFERENT PRICE"),c()()()(),r(12,"th",24),m(13,"Variant"),c(),r(14,"th",25),m(15,"SKU"),c(),d(16,on,2,0,"ng-template",26),r(17,"th",27),m(18,"POS"),c(),r(19,"th",27)(20,"div",28),C("click",function(){g(n);let t=s(2);return u(t.openModalFilter())}),P(21,"img",29),r(22,"span",30),m(23),S(24,"stringLimit"),c()()()()(),r(25,"tbody"),d(26,xn,2,1,"ng-container",31),c()(),r(27,"div",32)(28,"div",33)(29,"div",34),m(30),S(31,"number"),d(32,Sn,3,0,"span",35)(33,Pn,3,3,"span",9),S(34,"async"),m(35),c()(),d(36,yn,3,2,"div",36),c()()()()}if(i&2){let n=o.ngIf,e=s(2);l(9),T("ngModel",e.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",E(19,Ee,e.rolePriceEdit)),l(4),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,M),l(2),ce(" ",se(24,12,e.selectedChannel==null?null:e.selectedChannel.Name,20),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?"...":""," "),l(3),p("ngForOf",n),l(4),y(" Showing 1 - ",v(31,15,n==null?null:n.length)," of "),l(2),p("ngIf",e.paginationService.hideCount),l(),p("ngIf",v(34,17,!e.paginationService.hideCount&&e.allDataCount$)),l(2),y(" records ~ ",e.paginationService.footerPageNumber," Page "),l(),p("ngIf",n.length>0)}}function wn(i,o){if(i&1){let n=f();r(0,"mainpanel",2),D("textChange",function(t){g(n);let a=s();return V(a.searchFilter.text,t)||(a.searchFilter.text=t),u(t)}),C("onSubmit",function(){g(n);let t=s();return u(t.onSearch())}),r(1,"filters")(2,"div")(3,"label",3),m(4,"Channel"),c(),r(5,"ng-select",4),D("ngModelChange",function(t){g(n);let a=s();return V(a.searchFilter.ChannelID,t)||(a.searchFilter.ChannelID=t),u(t)}),d(6,tn,3,2,"ng-template",5),c()(),r(7,"div",6)(8,"label",7),m(9,"Page Number"),c(),r(10,"input",8),D("ngModelChange",function(t){g(n);let a=s();return V(a.searchFilter.PageNumber,t)||(a.searchFilter.PageNumber=t),u(t)}),c()(),r(11,"div",6)(12,"label",7),m(13,"Page Size"),c(),r(14,"input",8),D("ngModelChange",function(t){g(n);let a=s();return V(a.searchFilter.RowCount,t)||(a.searchFilter.RowCount=t),u(t)}),c()()(),d(15,an,7,1,"actions",9),S(16,"async"),d(17,In,37,21,"content",9),S(18,"async"),c()}if(i&2){let n=s();p("headerTitle",n.pageTitle),T("text",n.searchFilter.text),l(5),p("clearable",!1)("items",n.channelOptions),T("ngModel",n.searchFilter.ChannelID),l(5),T("ngModel",n.searchFilter.PageNumber),l(4),T("ngModel",n.searchFilter.RowCount),l(),p("ngIf",v(16,9,n.data$)),l(2),p("ngIf",v(18,11,n.data$))}}var st=(()=>{let o=class o{constructor(e,t,a,_,h,x,we,Me,dt){this.http=e,this.paginationService=t,this.toastr=a,this.dialog=_,this.productService=h,this.biggerPictureService=x,this.inventoryService=we,this.authService=Me,this.mainPanelService=dt,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=ue.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=H.GuidEMpty,this.hostName=this.authService.getDomain(),this.data$=this.paginationService.data$.pipe(ae(1),ee(_t=>_t.map(ie=>(ie.Variants&&(ie.Variants=ie.Variants.map(Te=>(Te.isDiscontinued=Te.Discontinued=="Yes",Te))),ie)))),this.channelOptions=Me.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(B(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=L.ALL,this.paginationService.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=L.ALL:this.searchFilter.filterModel=L.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(t=>(t.selected=e.selected,t))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(h=>({ID:h.ID,ChannelID:h.Channel[0].ChannelID,Code:h.Code,Price:h.UnitPrice})),_={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",_).subscribe(h=>{this.onSearch(),this.handlingUpdateStock(h.Response)})}handlingUpdateStock(e){if(e.success_list.length>0||e.failure_list.length>0){let t=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,t)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let t={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",t).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.paginationService.reloadPagination(this.searchFilter),this.initSelectedChannel()}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:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e.Total)}})}openTableDialog(e,t,a){let _=JSON.parse(JSON.stringify(e));this.dialog.open(Pe,{data:{Name:t.Name,Variant:_,ChannelID:_?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:_?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(R(x=>H.IsNotEmpty(x))).subscribe(x=>{this.updateItemAfterDialog(x,e)})}updateItemAfterDialog(e,t){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(_=>{let h=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${h.Name} to ${a.Price}`,"Success"),t.Channel[0]&&(t.Channel[0].Price=a.Price)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,t){t=t.map(a=>(a.Variants=a.Variants.map(_=>(_.selected=e,_)),a))}onZoomImage(e,t){this.biggerPictureService.openBiggerPicture(e,t)}Export(){let e={ChannelID:this.searchFilter.ChannelID,IsMarketplaceAppActive:this.searchFilter.IsMarketplaceAppActive,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,filterModel:this.searchFilter.filterModel};this.http.postFile("/api/price/GetExportSingleChannelComparison",e).subscribe(t=>{let a=window.URL.createObjectURL(t.file),_=document.createElement("a");_.download=this.getFilenameFromContentDisposition(t.title),_.href=a,_.click(),URL.revokeObjectURL(a),_.remove()})}getFilenameFromContentDisposition(e){let a=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(e);return a!=null&&a[1]?a[1].replace(/['"]/g,""):""}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(t){return new(t||o)(b(K),b(Y),b(G),b(Z),b(X),b(xe),b(ye),b(J),b(je))},o.\u0275cmp=F({type:o,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[["elsePic",""],[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[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,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[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","checkbox",1,"me-3",3,"change"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[3,"ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],[1,"text-end",3,"ngClass"],["style","cursor: pointer;",3,"click",4,"ngIf"],[1,"ms-3"],["target","_blank",3,"href"],[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"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"fas","external-link-custom","fa-external-link-alt"],[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 border-start-0","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","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(t,a){t&1&&(d(0,wn,19,13,"mainpanel",1),S(1,"async")),t&2&&p("ngIf",v(1,1,a.loader$))},dependencies:[U,A,$,de,_e,me,k,O,q,Ue,Re,Be,Xe,fe,he,j,W,ve],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}"]});let i=o;return i})();var pt=(()=>{let o=class o{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"}]}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=F({type:o,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,a){t&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),P(3,"nav-tab",2),c()()(),P(4,"router-outlet")),t&2&&(l(3),p("Tabs",a.priceTabs))},dependencies:[ze,ke]});let i=o;return i})();var Tn=[{path:"",component:pt,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:rt,canActivate:[Ce],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:ct,canActivate:[Ce],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:st,canActivate:[Ce],data:{title:"Price Single Channel Comparison"}}]}],mt=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=re({type:o}),o.\u0275inj=oe({imports:[z,pe.forChild(Tn)]});let i=o;return i})();var Ui=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=re({type:o}),o.\u0275inj=oe({providers:[ye],imports:[z,ge,Ge,We,pe,Ae,mt,Oe,Ye,qe,$e,Ie,be,Le.forChild()]});let i=o;return i})();export{Ui as PriceModule};
|
|
1
|
+
import{a as Ke}from"./chunk-IWVYX6KY.js";import{a as He,b as Je,c as Ze}from"./chunk-G5LCLRIW.js";import{a as L,b as Pe,c as ve,d as be,e as ye}from"./chunk-SBNYVAJR.js";import{a as Se}from"./chunk-WQ7LUTQ2.js";import{b as qe}from"./chunk-BMZAGAK3.js";import{a as Xe,b as Ye}from"./chunk-N4S3Q3EC.js";import{a as ue}from"./chunk-662E5VTA.js";import{a as Y}from"./chunk-KBYAFLE5.js";import{a as X}from"./chunk-U5YOE633.js";import"./chunk-INNTQ5YN.js";import{a as ze,b as Ge}from"./chunk-SRYGE2HW.js";import{a as xe}from"./chunk-MYMGWQRE.js";import"./chunk-DT3B54LD.js";import{a as Re,b as Be,d as Ue,e as Ae}from"./chunk-AL67KXJV.js";import{a as Ce}from"./chunk-GIB66QXC.js";import{g as J}from"./chunk-2OH65RRD.js";import{b as G,e as K}from"./chunk-K3G6FMDF.js";import"./chunk-JM3LERUP.js";import{B as je,C as q,D as We,q as fe,r as $e,u as Z}from"./chunk-ZKBLXGXT.js";import"./chunk-6B64VOO7.js";import{b as me,c as de,h as k,k as O,m as _e,u as ge,v as Oe}from"./chunk-SP6QPE3M.js";import{c as H,e as he,f as Le}from"./chunk-6F6NSBIF.js";import{Ab as m,B as R,Bb as N,Cb as y,Db as ce,Eb as T,Fb as V,Gb as D,Ha as M,Ia as l,Ib as Ne,Ja as b,Kb as E,Q as ae,Rb as S,Sb as v,Tb as se,Ub as ne,Wa as d,Wc as ke,X as B,Ya as p,_c as pe,aa as oe,fb as r,gb as c,ha as F,hb as P,ia as re,ib as I,ic as U,jb as w,kc as A,lb as f,lc as $,ob as C,oc as j,pa as g,q as ee,qa as u,qb as s,rc as W,sc as z,tb as le,za as Fe,zb as te}from"./chunk-6DRNAUKE.js";import"./chunk-GRMIXZTT.js";function gt(i,o){if(i&1){let n=f();r(0,"button",18),C("click",function(){g(n);let t=s().ngIf,a=s(2);return u(a.onUpdateItems(t))}),P(1,"i",19),m(2," Update "),c()}}function ut(i,o){if(i&1&&(r(0,"div"),d(1,gt,3,0,"button",17),c()),i&2){let n=o.ngIf,e=s(2);l(),p("ngIf",e.productService.hasSelectionVariant(n))}}function ht(i,o){if(i&1){let n=f();r(0,"div",20)(1,"app-table",21),S(2,"async"),C("onToggle",function(t){g(n);let a=s(2);return u(a.onShowDifferencePrice(t))})("onSubmit",function(t){g(n);let a=s(2);return u(a.updatePriceByVariant(t))}),c()()}if(i&2){let n=s().ngIf,e=s();l(),p("showProductToggle",!0)("data",v(2,4,e.paginationService.data$))("channel",e.channelOptions)("filter",n.Filter)}}function Ct(i,o){if(i&1){let n=f();r(0,"span",22),C("click",function(){g(n);let t=s(2);return u(t.getRowCount())}),r(1,"i",23),m(2,"?"),c()()}}function ft(i,o){if(i&1&&(r(0,"span"),m(1),S(2,"number"),c()),i&2){let n=o.ngIf;l(),N(v(2,1,n))}}function xt(i,o){if(i&1){let n=f();r(0,"a",24),C("click",function(){g(n);let t=s(2);return u(t.onNextPage())}),P(1,"i",25),m(2," Next"),c()}}function St(i,o){if(i&1){let n=f();r(0,"a",26),C("click",function(){g(n);let t=s(2);return u(t.onLastPage())}),P(1,"i",27),m(2," Last"),c()}}function Pt(i,o){if(i&1){let n=f();r(0,"mainpanel",1),C("onSubmit",function(t){g(n);let a=s();return u(a.onSearch(t))}),r(1,"actions")(2,"div",2),d(3,ut,2,1,"div",3),S(4,"async"),c()(),r(5,"filters")(6,"div")(7,"label",4),m(8,"Page Number"),c(),r(9,"input",5),D("ngModelChange",function(t){g(n);let a=s();return V(a.searchFilter.PageNumber,t)||(a.searchFilter.PageNumber=t),u(t)}),c()(),r(10,"div",6)(11,"label",4),m(12,"Page Size"),c(),r(13,"input",5),D("ngModelChange",function(t){g(n);let a=s();return V(a.searchFilter.RowCount,t)||(a.searchFilter.RowCount=t),u(t)}),c()()(),r(14,"content")(15,"div",7)(16,"div",8),d(17,ht,3,6,"div",9),S(18,"async"),c(),r(19,"div",10)(20,"div",11)(21,"div",12),m(22),S(23,"async"),S(24,"number"),d(25,Ct,3,0,"span",13)(26,ft,3,3,"span",3),S(27,"async"),m(28),c()(),r(29,"div",14),d(30,xt,3,0,"a",15)(31,St,3,0,"a",16),c()()()()()}if(i&2){let n,e=s();p("pageData",e.pageData)("textButton","Search"),l(3),p("ngIf",v(4,12,e.paginationService.data$)),l(6),T("ngModel",e.searchFilter.PageNumber),l(4),T("ngModel",e.searchFilter.RowCount),l(4),p("ngIf",v(18,14,e.paginationService.data$)),l(5),y(" Showing 1 - ",v(24,18,(n=v(23,16,e.paginationService.data$))==null?null:n.length)," of "),l(3),p("ngIf",e.paginationService.hideCount),l(),p("ngIf",!e.paginationService.hideCount&&v(27,20,e.allDataCount$)),l(2),y(" records ~ ",e.paginationService.footerPageNumber," Page "),l(2),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),l(),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}var rt=(()=>{let o=class o{constructor(e,t,a,_,h,x){this.http=e,this.toastr=t,this.dialog=a,this.paginationService=_,this.productService=h,this.authService=x,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}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(B(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.paginationService.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}updatePrice(e){let t=this.productService.selectedVariantProduct(e);if(t.length>0){let _=t.map(x=>({ID:x.ID,Code:x.Code,Price:x.UnitPrice}));var a=this.channelOptions.filter(x=>x.selected).map(x=>x.ID);let h={ListChannelID:a,ListPrice:_};this.http.post("/api/Price/UpdateChannel",h).subscribe(x=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+h.ListPrice.length+" items in "+h.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(a=>{let _=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+_.Name+" to "+t.Price,"Success"),this.paginationService.reloadPagination(this.searchFilter)})}onUpdateItems(e){let t=this.productService.selectedVariantProduct(e);this.dialog.open(Se,{data:{selectedItems:t,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(R(a=>a!==void 0)).subscribe(a=>{this.channelOptions=a,this.updatePrice(e)})}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:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(t){return new(t||o)(b(K),b(G),b(Z),b(Y),b(X),b(J))},o.\u0275cmp=F({type:o,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","pageData","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[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 border-start-0","title","Load all products",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["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,"onToggle","onSubmit","showProductToggle","data","channel","filter"],[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","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(t,a){t&1&&(d(0,Pt,32,22,"mainpanel",0),S(1,"async")),t&2&&p("ngIf",v(1,1,a.loader$))},dependencies:[$,de,_e,k,O,q,be,j,W],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();var vt=i=>({"border-0 rounded":i});function bt(i,o){if(i&1&&(r(0,"mat-radio-button",3),m(1),c()),i&2){let n=o.$implicit,e=o.index,t=s();p("value",n.Key)("name",t.name)("title",t.tooltipsText[e]?t.tooltipsText[e]:""),l(),y(" ",n.Value,"")}}var Ie=(()=>{let o=class o{constructor(){this.modelChange=new Fe,this.border=!1,this.tooltipsText=[]}change(e){this.modelChange.emit(e)}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=F({type:o,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},standalone:!0,features:[Ne],decls:3,vars:5,consts:[[1,"form-control","h-100","rounded-1",3,"ngClass"],[3,"ngModelChange","ngModel"],["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,a){t&1&&(r(0,"div",0)(1,"mat-radio-group",1),C("ngModelChange",function(h){return a.change(h)}),d(2,bt,2,4,"mat-radio-button",2),c()()),t&2&&(p("ngClass",E(3,vt,a.border==!1)),l(),p("ngModel",a.model),l(),p("ngForOf",a.options))},dependencies:[z,U,A,Ze,He,Je,ge,k,O],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]});let i=o;return i})();var lt=i=>[i],Dt=i=>({"text-decoration-line-through":i}),Et=i=>({"border-bottom":i}),Mt=i=>({"bg-gradient-warning":i});function Ft(i,o){if(i&1){let n=f();I(0),r(1,"div")(2,"label",25),m(3,"Filter by"),c(),r(4,"radio-options",26),D("modelChange",function(t){g(n);let a=s();return V(a.filterType,t)||(a.filterType=t),u(t)}),c()(),w()}if(i&2){let n=s();l(4),T("model",n.filterType),p("options",n.filterTypeOptions)("border",!0)}}function Nt(i,o){if(i&1){let n=f();r(0,"button",29),C("click",function(){g(n);let t=s().ngIf,a=s();return u(a.onUpdateItems(t))}),P(1,"i",30),m(2," Update "),c()}}function kt(i,o){if(i&1&&(I(0),r(1,"div",27),d(2,Nt,3,0,"button",28),c(),w()),i&2){let n=o.ngIf,e=s();l(2),p("ngIf",e.productService.hasSelectionVariant(n))}}function Ot(i,o){if(i&1&&(r(0,"th",31)(1,"div",32),P(2,"img",33),r(3,"div",34),m(4),S(5,"stringLimit"),c()()()),i&2){let n=o.$implicit;l(),p("matTooltip",(n.Name==null?null:n.Name.length)>20?n.Name:""),l(),p("src",n==null?null:n.Img,M),l(2),ce("",se(5,4,n.Name,20),"",(n.Name==null?null:n.Name.length)>20?"...":"","")}}function Lt(i,o){if(i&1){let n=f();r(0,"th")(1,"input",35),D("ngModelChange",function(t){g(n);let a=s();return V(a.checkboxState,t)||(a.checkboxState=t),u(t)}),C("ngModelChange",function(){g(n);let t=s();return u(t.onSelectAllData())}),c()()}if(i&2){let n=s();l(),T("ngModel",n.checkboxState)}}function Rt(i,o){i&1&&(I(0),r(1,"th",36)(2,"span"),m(3,"Expected"),c(),r(4,"span",37),m(5,"(POS)"),c()(),r(6,"th",36),m(7," Channel "),c(),w())}function Bt(i,o){if(i&1){let n=f();r(0,"img",49),C("click",function(t){g(n);let a=s(3).$implicit,_=s(2);return u(_.onZoomImage(t,a==null?null:a.ImageUrl))}),c()}if(i&2){let n=s(3).$implicit;le("src",n==null?null:n.ImageUrl,M)}}function Ut(i,o){i&1&&P(0,"img",50)}function At(i,o){if(i&1&&(I(0),r(1,"td",44),d(2,Bt,1,1,"img",45)(3,Ut,1,0,"ng-template",null,0,ne),c(),r(5,"td",46)(6,"h5",47),m(7),c(),r(8,"small",48),m(9),c()(),w()),i&2){let n=te(4),e=s().index,t=s().$implicit,a=s().ngIf;l(),p("rowSpan",t==null?null:t.Variants.length)("ngClass",E(7,Et,e+1==a.length)),l(),p("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),l(3),p("rowSpan",t==null?null:t.Variants.length),l(2),N(t==null?null:t.Name),l(2),y("(",t==null?null:t.Category,")")}}function $t(i,o){if(i&1){let n=f();r(0,"td",51)(1,"input",35),D("ngModelChange",function(t){g(n);let a=s().$implicit;return V(a.selected,t)||(a.selected=t),u(t)}),c()()}if(i&2){let n=s().$implicit;l(),T("ngModel",n.selected)}}function jt(i,o){if(i&1){let n=f();I(0),r(1,"td",53),m(2),S(3,"number"),c(),r(4,"td",54),C("click",function(){let t=g(n).$implicit,a=s(2).$implicit,_=s().$implicit,h=s(2);return u(h.openTableDialog(a,_,t))}),r(5,"div",55)(6,"div",56),m(7),S(8,"number"),c(),r(9,"a",57),C("click",function(t){return g(n),u(t==null?null:t.stopPropagation())}),P(10,"i",43),c()()(),w()}if(i&2){let n=o.$implicit;l(2),y(" ",v(3,4,n.PriceExpected)," "),l(2),p("ngClass",E(8,Mt,n.Price!=n.PriceExpected)),l(3),y(" ",v(8,6,n.Price)," "),l(2),p("href",n.Url,M)}}function Wt(i,o){i&1&&(r(0,"td",58),m(1,"X"),c(),r(2,"td",58),m(3,"X"),c())}function zt(i,o){if(i&1&&(I(0),d(1,jt,11,10,"ng-container",52)(2,Wt,4,0,"ng-template",null,1,ne),w()),i&2){let n=o.$implicit,e=te(3),t=s().$implicit,a=s(3);l(),p("ngIf",a.getItemFromChannel(t,n.ID))("ngIfElse",e)}}function Gt(i,o){if(i&1&&(r(0,"tr"),d(1,At,10,9,"ng-container",3),r(2,"td",38),m(3),c(),r(4,"td",39)(5,"div",40)(6,"div",41),m(7),c(),r(8,"div",34)(9,"a",42),P(10,"i",43),c()()()(),d(11,$t,2,1,"ng-template",16)(12,zt,4,2,"ng-container",17),c()),i&2){let n=o.$implicit,e=o.index,t=s(3);l(),p("ngIf",e==0),l(2),N(n==null?null:n.Model),l(),p("matTooltip",n.isDiscontinued?t.discontinuedVariantMsg:""),l(2),p("ngClass",E(8,Dt,n.isDiscontinued)),l(),y(" ",n==null?null:n.Code,""),l(2),p("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),M),l(2),p("ngxPermissionsOnly",E(10,lt,t.rolePriceEdit)),l(),p("ngForOf",t.channelOptions)}}function Kt(i,o){if(i&1&&(r(0,"tbody"),d(1,Gt,13,12,"tr",17),c()),i&2){let n=o.$implicit;l(),p("ngForOf",n.Variants)}}function Ht(i,o){if(i&1&&(I(0),d(1,Kt,2,1,"tbody",17),w()),i&2){let n=o.ngIf;l(),p("ngForOf",n)}}function Jt(i,o){if(i&1){let n=f();r(0,"span",59),C("click",function(){g(n);let t=s();return u(t.getRowCount())}),r(1,"i",60),m(2,"?"),c()()}}function Zt(i,o){if(i&1&&(r(0,"span"),m(1),S(2,"number"),c()),i&2){let n=o.ngIf;l(),N(v(2,1,n))}}function qt(i,o){if(i&1){let n=f();r(0,"a",61),C("click",function(){g(n);let t=s();return u(t.onNextPage())}),P(1,"i",62),m(2," Next"),c()}}function Xt(i,o){if(i&1){let n=f();r(0,"a",63),C("click",function(){g(n);let t=s();return u(t.onLastPage())}),P(1,"i",64),m(2," Last"),c()}}var ct=(()=>{let o=class o{constructor(e,t,a,_,h,x,we){this.http=e,this.toastr=t,this.dialog=a,this.productService=_,this.authService=h,this.biggerPictureService=x,this.paginationService=we,this.searchFilter=new Ke,this.checkboxState=!1,this.rolePriceEdit=ue.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:L.ALL,Value:"All"},{Key:L.DIFFERENCE,Value:"Difference"}],this.filterType=L.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination()}initPagination(){this.paginationService.fetchDataEndpoint="Price/GetOutletPrice",this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.paginationService.data$.pipe(ee(e=>(e=e.map(t=>(t.Variants&&(t.Variants=t.Variants.map(a=>(a.isDiscontinued=a.Discontinued=="Yes",a))),t)),e)),ae(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(B(e=>{this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.paginationService.hideCount=!1,this.totalData$=this.http.post(`/api/${this.rowCountAPI}`,{}).pipe(B(e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e)}))}getRowCount(){this.paginationService.hideCount=!1,this.totalData$=this.http.post(`/api/${this.rowCountAPI}`,{})}onSelectAllData(){this.data$=this.data$.pipe(ee(e=>(e.map(t=>(t.Variants&&(t.Variants=t.Variants.map(a=>(a.selected=this.checkboxState,a))),t)),e)))}onFilter(e){let t={text:e,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.paginationService.reloadPagination(t)}updatePrice(e){let t=this.productService.selectedVariantProduct(e);if(t.length>0){let a=t.map(x=>x.ID),h={ListChannelID:this.channelOptions.filter(x=>x.selected).map(x=>x.ID),ListID:a};this.http.post("/api/Price/UpdateChannelOutletPrice",h).subscribe({next:x=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+h.ListID.length+" items in "+h.ListChannelID.length+" channels","Success")},error:x=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,t){return e.Channel.find(a=>a.ChannelID==t)}onUpdateItems(e){let t=this.productService.selectedVariantProduct(e);this.dialog.open(Se,{data:{selectedItems:t,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(R(a=>H.IsNotEmpty(a))).subscribe(a=>{this.channelOptions=a,this.updatePrice(e)})}openTableDialog(e,t,a){let _=JSON.parse(JSON.stringify(e));this.dialog.open(Pe,{data:{Name:t.Name,Variant:_,ChannelID:a?.ChannelID,Table:"price",ChannelItemID:a?.ChannelItemID}}).afterClosed().pipe(R(x=>H.IsNotEmpty(x))).subscribe(x=>{this.updateProductPrice(x,a)})}updateProductPrice(e,t){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(_=>{t.Price=a.Price;let h=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${h.Name} to ${a.Price}`,"Success")})}onZoomImage(e,t){this.biggerPictureService.openBiggerPicture(e,t)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(t){return new(t||o)(b(K),b(G),b(Z),b(X),b(J),b(xe),b(Y))},o.\u0275cmp=F({type:o,selectors:[["app-custom-channel-price"]],decls:42,vars:30,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","pageData","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2","class","text-center border-bottom-0 border text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[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"],[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 border-start-0","title","Load all products",3,"click",4,"ngIf"],[1,"fw-bold","mb-2"],["name","filterModel",3,"modelChange","model","options","border"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["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","text-uppercase"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"],[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","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(t,a){if(t&1&&(r(0,"mainpanel",2),C("onSubmit",function(h){return a.onFilter(h)}),r(1,"filters"),d(2,Ft,5,3,"ng-container",3),S(3,"async"),c(),r(4,"actions"),d(5,kt,3,1,"ng-container",3),S(6,"async"),c(),r(7,"content")(8,"div",4)(9,"div",5)(10,"div",6)(11,"div",7)(12,"table",8)(13,"thead",9)(14,"tr",10),P(15,"th",11),d(16,Ot,6,7,"th",12),c(),r(17,"tr")(18,"th",13)(19,"span"),m(20," Product "),c()(),r(21,"th",14),m(22,"Variant"),c(),r(23,"th",15),m(24,"SKU"),c(),d(25,Lt,2,1,"ng-template",16)(26,Rt,8,0,"ng-container",17),c()(),d(27,Ht,2,1,"ng-container",3),S(28,"async"),c()()()(),r(29,"div",18)(30,"div",19)(31,"div",20),m(32),S(33,"async"),S(34,"number"),d(35,Jt,3,0,"span",21)(36,Zt,3,3,"span",3),S(37,"async"),m(38),c()(),r(39,"div",22),d(40,qt,3,0,"a",23)(41,Xt,3,0,"a",24),c()()()()()),t&2){let _;p("pageData",a.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),l(2),p("ngIf",v(3,16,a.loader$)),l(3),p("ngIf",v(6,18,a.data$)),l(11),p("ngForOf",a.channelOptions),l(9),p("ngxPermissionsOnly",E(28,lt,a.rolePriceEdit)),l(),p("ngForOf",a.channelOptions),l(),p("ngIf",v(28,20,a.data$)),l(5),y(" Showing 1 - ",v(34,24,(_=v(33,22,a.paginationService.data$))==null?null:_.length)," of "),l(3),p("ngIf",a.paginationService.hideCount),l(),p("ngIf",!a.paginationService.hideCount&&v(37,26,a.totalData$)),l(2),y(" records ~ ",a.paginationService.footerPageNumber," Page "),l(2),p("ngIf",a.paginationService.disableNextButton&&!a.paginationService.goToLastPage),l(),p("ngIf",a.paginationService.disableNextButton&&!a.paginationService.goToLastPage)}},dependencies:[U,A,$,me,k,O,q,fe,Ie,he,j,W,ve],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}"]});let i=o;return i})();var Ee=i=>[i],Yt=i=>({"text-decoration-line-through":i}),Qt=i=>({"bg-gradient-warning":i}),en=i=>({"ms-10":i});function tn(i,o){if(i&1&&(r(0,"span",10),P(1,"img",11),c(),m(2)),i&2){let n=o.item;l(),p("src",n==null?null:n.Img,M),l(),y(" ",n.Name," ")}}function nn(i,o){if(i&1){let n=f();r(0,"button",16),C("click",function(){g(n);let t=s().ngIf,a=s(2);return u(a.updateStock(t))}),P(1,"i",17),m(2," Update "),c()}}function an(i,o){if(i&1){let n=f();r(0,"actions")(1,"div",12),d(2,nn,3,0,"button",13),r(3,"button",14),C("click",function(){g(n);let t=s(2);return u(t.Export())}),P(4,"i",15),r(5,"span"),m(6,"Export"),c()()()()}if(i&2){let n=o.ngIf,e=s(2);l(2),p("ngIf",e.productService.hasSelectionVariant(n))}}function on(i,o){if(i&1){let n=f();r(0,"th")(1,"input",37),C("change",function(t){g(n);let a=s().ngIf,_=s(2);return u(_.onSelectAllSKU(t.target.checked,a))}),c()()}}function rn(i,o){if(i&1){let n=f();r(0,"input",54),D("ngModelChange",function(t){g(n);let a=s(4).$implicit;return V(a.selected,t)||(a.selected=t),u(t)}),C("ngModelChange",function(){g(n);let t=s(4).$implicit,a=s(3);return u(a.onCheckboxStateProduct(t))}),c()}if(i&2){let n=s(4).$implicit;T("ngModel",n.selected)}}function ln(i,o){if(i&1&&(I(0),d(1,rn,1,1,"ng-template",26),w()),i&2){let n=s(6);l(),p("ngxPermissionsOnly",E(1,Ee,n.rolePriceEdit))}}function cn(i,o){if(i&1){let n=f();I(0),r(1,"img",55),C("click",function(t){g(n);let a=s(3).$implicit,_=s(3);return u(_.onZoomImage(t,a==null?null:a.ImageUrl))}),c(),w()}if(i&2){let n=s(3).$implicit;l(),le("src",n.ThumbnailUrl,M)}}function sn(i,o){i&1&&P(0,"img",56)}function pn(i,o){if(i&1&&(I(0),P(1,"br"),r(2,"small"),m(3),c(),w()),i&2){let n=s(3).$implicit;l(3),y("(",n.Category,")")}}function mn(i,o){if(i&1&&(I(0),r(1,"td",49)(2,"div",50),d(3,ln,2,3,"ng-container",9),r(4,"div",39),d(5,cn,2,1,"ng-container",51)(6,sn,1,0,"ng-template",null,0,ne),c()()(),r(8,"td",52)(9,"span",53),m(10),c(),d(11,pn,4,1,"ng-container",9),c(),w()),i&2){let n=te(7),e=s(2).$implicit,t=s(3);l(),p("rowSpan",e.Variants.length),l(2),p("ngIf",(e.Variants==null?null:e.Variants.length)>1),l(),p("ngClass",E(8,en,(e.Variants==null?null:e.Variants.length)<=1)),l(),p("ngIf",e.ThumbnailUrl)("ngIfElse",n),l(3),p("rowSpan",e.Variants.length),l(2),N(e.Name),l(),p("ngIf",(e==null?null:e.CategoryID)!==null&&(e==null?null:e.CategoryID)!=t.guidEmpty)}}function dn(i,o){if(i&1){let n=f();r(0,"input",59),D("ngModelChange",function(t){g(n);let a=s(2).$implicit;return V(a.selected,t)||(a.selected=t),u(t)}),c()}if(i&2){let n=s(2).$implicit;T("ngModel",n.selected)}}function _n(i,o){if(i&1&&(r(0,"td",57),d(1,dn,1,1,"input",58),c()),i&2){let n=s().$implicit;l(),p("ngIf",n.Inventory>=0)}}function gn(i,o){i&1&&(r(0,"div",60),m(1,"Not Found"),c())}function un(i,o){if(i&1&&(r(0,"div"),m(1),S(2,"number"),c()),i&2){let n=s().$implicit;l(),y(" ",v(2,1,n.UnitPrice),"")}}function hn(i,o){if(i&1&&(I(0),r(1,"div",44)(2,"a",45),P(3,"i",61),c()(),w()),i&2){let n=s().$implicit,e=s(4);l(2),p("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),M)}}function Cn(i,o){if(i&1){let n=f();r(0,"div",62),C("click",function(){g(n);let t=s().$implicit,a=s().$implicit,_=s(2).ngIf,h=s();return u(h.openTableDialog(t,a,_))}),m(1),S(2,"number"),c()}if(i&2){let n=s().$implicit;l(),y(" ",v(2,1,n.Channel[0]==null?null:n.Channel[0].Price)," ")}}function fn(i,o){if(i&1){let n=f();r(0,"tr"),d(1,mn,12,10,"ng-container",9),r(2,"td",24),m(3),c(),r(4,"td",38)(5,"span",39),m(6),c()(),d(7,_n,2,1,"ng-template",26),r(8,"td",27)(9,"div",40),d(10,gn,2,0,"div",41)(11,un,3,3,"div",9)(12,hn,4,1,"ng-container",9),c()(),r(13,"td",42)(14,"div",40),d(15,Cn,3,3,"div",43),r(16,"div",44)(17,"a",45),P(18,"i",46),c()(),r(19,"div",44)(20,"div",47),C("click",function(){let t=g(n).$implicit,a=s(4);return u(a.refreshPrice(t))}),P(21,"i",48),c()()()()()}if(i&2){let n=o.$implicit,e=o.index,t=s(4);l(),p("ngIf",e==0),l(2),N(n.Model),l(),p("matTooltip",n.isDiscontinued?t.discontinuedVariantMsg:""),l(),p("ngClass",E(12,Yt,n.isDiscontinued)),l(),y(" ",n.Code," "),l(),p("ngxPermissionsOnly",E(14,Ee,t.rolePriceEdit)),l(3),p("ngIf",(n.Channel[0]==null?null:n.Channel[0].Description)!=null),l(),p("ngIf",(n.Channel[0]==null?null:n.Channel[0].Description)==null),l(),p("ngIf",(n.Channel[0]==null?null:n.Channel[0].Description)==null),l(),p("ngClass",E(16,Qt,n.UnitPrice!=(n.Channel[0]==null?null:n.Channel[0].Price))),l(2),p("ngIf",n.Channel.length>0),l(2),p("href",n.Channel[0]==null?null:n.Channel[0].Url,M)}}function xn(i,o){if(i&1&&(I(0),d(1,fn,22,18,"tr",31),w()),i&2){let n=o.$implicit;l(),p("ngForOf",n.Variants)}}function Sn(i,o){if(i&1){let n=f();r(0,"span",62),C("click",function(){g(n);let t=s(3);return u(t.getRowCount())}),r(1,"i",63),m(2,"?"),c()()}}function Pn(i,o){if(i&1&&(r(0,"span"),m(1),S(2,"number"),c()),i&2){let n=o.ngIf;l(),N(v(2,1,n.Total))}}function vn(i,o){if(i&1){let n=f();r(0,"a",67),C("click",function(){g(n);let t=s(4);return u(t.onNextPage())}),P(1,"i",68),m(2," Next"),c()}}function bn(i,o){if(i&1){let n=f();r(0,"a",69),C("click",function(){g(n);let t=s(4);return u(t.onLastPage())}),P(1,"i",70),m(2," Last"),c()}}function yn(i,o){if(i&1&&(r(0,"div",64),d(1,vn,3,0,"a",65)(2,bn,3,0,"a",66),c()),i&2){let n=s(3);l(),p("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),l(),p("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function In(i,o){if(i&1){let n=f();r(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),m(7," Product "),r(8,"div")(9,"mat-slide-toggle",23),D("ngModelChange",function(t){g(n);let a=s(2);return V(a.toggleDifferentInventory,t)||(a.toggleDifferentInventory=t),u(t)}),C("toggleChange",function(){g(n);let t=s(2);return u(t.onToggleDifferentInventory())}),r(10,"small",7),m(11,"FILTER DIFFERENT PRICE"),c()()()(),r(12,"th",24),m(13,"Variant"),c(),r(14,"th",25),m(15,"SKU"),c(),d(16,on,2,0,"ng-template",26),r(17,"th",27),m(18,"POS"),c(),r(19,"th",27)(20,"div",28),C("click",function(){g(n);let t=s(2);return u(t.openModalFilter())}),P(21,"img",29),r(22,"span",30),m(23),S(24,"stringLimit"),c()()()()(),r(25,"tbody"),d(26,xn,2,1,"ng-container",31),c()(),r(27,"div",32)(28,"div",33)(29,"div",34),m(30),S(31,"number"),d(32,Sn,3,0,"span",35)(33,Pn,3,3,"span",9),S(34,"async"),m(35),c()(),d(36,yn,3,2,"div",36),c()()()()}if(i&2){let n=o.ngIf,e=s(2);l(9),T("ngModel",e.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",E(19,Ee,e.rolePriceEdit)),l(4),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,M),l(2),ce(" ",se(24,12,e.selectedChannel==null?null:e.selectedChannel.Name,20),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?"...":""," "),l(3),p("ngForOf",n),l(4),y(" Showing 1 - ",v(31,15,n==null?null:n.length)," of "),l(2),p("ngIf",e.paginationService.hideCount),l(),p("ngIf",v(34,17,!e.paginationService.hideCount&&e.allDataCount$)),l(2),y(" records ~ ",e.paginationService.footerPageNumber," Page "),l(),p("ngIf",n.length>0)}}function wn(i,o){if(i&1){let n=f();r(0,"mainpanel",2),D("textChange",function(t){g(n);let a=s();return V(a.searchFilter.text,t)||(a.searchFilter.text=t),u(t)}),C("onSubmit",function(){g(n);let t=s();return u(t.onSearch())}),r(1,"filters")(2,"div")(3,"label",3),m(4,"Channel"),c(),r(5,"ng-select",4),D("ngModelChange",function(t){g(n);let a=s();return V(a.searchFilter.ChannelID,t)||(a.searchFilter.ChannelID=t),u(t)}),d(6,tn,3,2,"ng-template",5),c()(),r(7,"div",6)(8,"label",7),m(9,"Page Number"),c(),r(10,"input",8),D("ngModelChange",function(t){g(n);let a=s();return V(a.searchFilter.PageNumber,t)||(a.searchFilter.PageNumber=t),u(t)}),c()(),r(11,"div",6)(12,"label",7),m(13,"Page Size"),c(),r(14,"input",8),D("ngModelChange",function(t){g(n);let a=s();return V(a.searchFilter.RowCount,t)||(a.searchFilter.RowCount=t),u(t)}),c()()(),d(15,an,7,1,"actions",9),S(16,"async"),d(17,In,37,21,"content",9),S(18,"async"),c()}if(i&2){let n=s();p("headerTitle",n.pageTitle),T("text",n.searchFilter.text),l(5),p("clearable",!1)("items",n.channelOptions),T("ngModel",n.searchFilter.ChannelID),l(5),T("ngModel",n.searchFilter.PageNumber),l(4),T("ngModel",n.searchFilter.RowCount),l(),p("ngIf",v(16,9,n.data$)),l(2),p("ngIf",v(18,11,n.data$))}}var st=(()=>{let o=class o{constructor(e,t,a,_,h,x,we,Me,dt){this.http=e,this.paginationService=t,this.toastr=a,this.dialog=_,this.productService=h,this.biggerPictureService=x,this.inventoryService=we,this.authService=Me,this.mainPanelService=dt,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=ue.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=H.GuidEMpty,this.hostName=this.authService.getDomain(),this.data$=this.paginationService.data$.pipe(ae(1),ee(_t=>_t.map(ie=>(ie.Variants&&(ie.Variants=ie.Variants.map(Te=>(Te.isDiscontinued=Te.Discontinued=="Yes",Te))),ie)))),this.channelOptions=Me.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(B(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=L.ALL,this.paginationService.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=L.ALL:this.searchFilter.filterModel=L.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(t=>(t.selected=e.selected,t))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(h=>({ID:h.ID,ChannelID:h.Channel[0].ChannelID,Code:h.Code,Price:h.UnitPrice})),_={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",_).subscribe(h=>{this.onSearch(),this.handlingUpdateStock(h.Response)})}handlingUpdateStock(e){if(e.success_list.length>0||e.failure_list.length>0){let t=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,t)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let t={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",t).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.paginationService.reloadPagination(this.searchFilter),this.initSelectedChannel()}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:e=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,e.Total)}})}openTableDialog(e,t,a){let _=JSON.parse(JSON.stringify(e));this.dialog.open(Pe,{data:{Name:t.Name,Variant:_,ChannelID:_?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:_?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(R(x=>H.IsNotEmpty(x))).subscribe(x=>{this.updateItemAfterDialog(x,e)})}updateItemAfterDialog(e,t){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(_=>{let h=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${h.Name} to ${a.Price}`,"Success"),t.Channel[0]&&(t.Channel[0].Price=a.Price)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,t){t=t.map(a=>(a.Variants=a.Variants.map(_=>(_.selected=e,_)),a))}onZoomImage(e,t){this.biggerPictureService.openBiggerPicture(e,t)}Export(){let e={ChannelID:this.searchFilter.ChannelID,IsMarketplaceAppActive:this.searchFilter.IsMarketplaceAppActive,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,filterModel:this.searchFilter.filterModel};this.http.postFile("/api/price/GetExportSingleChannelComparison",e).subscribe(t=>{let a=window.URL.createObjectURL(t.file),_=document.createElement("a");_.download=this.getFilenameFromContentDisposition(t.title),_.href=a,_.click(),URL.revokeObjectURL(a),_.remove()})}getFilenameFromContentDisposition(e){let a=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(e);return a!=null&&a[1]?a[1].replace(/['"]/g,""):""}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(t){return new(t||o)(b(K),b(Y),b(G),b(Z),b(X),b(xe),b(ye),b(J),b(je))},o.\u0275cmp=F({type:o,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[["elsePic",""],[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[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,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[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","checkbox",1,"me-3",3,"change"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[3,"ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],[1,"text-end",3,"ngClass"],["style","cursor: pointer;",3,"click",4,"ngIf"],[1,"ms-3"],["target","_blank",3,"href"],[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"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"fas","external-link-custom","fa-external-link-alt"],[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 border-start-0","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","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(t,a){t&1&&(d(0,wn,19,13,"mainpanel",1),S(1,"async")),t&2&&p("ngIf",v(1,1,a.loader$))},dependencies:[U,A,$,de,_e,me,k,O,q,Ue,Re,Be,Xe,fe,he,j,W,ve],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}"]});let i=o;return i})();var pt=(()=>{let o=class o{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"}]}};o.\u0275fac=function(t){return new(t||o)},o.\u0275cmp=F({type:o,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,a){t&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),P(3,"nav-tab",2),c()()(),P(4,"router-outlet")),t&2&&(l(3),p("Tabs",a.priceTabs))},dependencies:[ze,ke]});let i=o;return i})();var Tn=[{path:"",component:pt,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:rt,canActivate:[Ce],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:ct,canActivate:[Ce],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:st,canActivate:[Ce],data:{title:"Price Single Channel Comparison"}}]}],mt=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=re({type:o}),o.\u0275inj=oe({imports:[z,pe.forChild(Tn)]});let i=o;return i})();var Ui=(()=>{let o=class o{};o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=re({type:o}),o.\u0275inj=oe({providers:[ye],imports:[z,ge,Ge,We,pe,Ae,mt,Oe,Ye,qe,$e,Ie,be,Le.forChild()]});let i=o;return i})();export{Ui as PriceModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h}from"./chunk-YZ67XPSX.js";import"./chunk-GSSZWMCP.js";import"./chunk-XDNW2F3I.js";import"./chunk-TDHJ34QP.js";import"./chunk-INNTQ5YN.js";import{b as u}from"./chunk-SRYGE2HW.js";import"./chunk-DT3B54LD.js";import{a as f}from"./chunk-
|
|
1
|
+
import{a as h}from"./chunk-YZ67XPSX.js";import"./chunk-GSSZWMCP.js";import"./chunk-XDNW2F3I.js";import"./chunk-TDHJ34QP.js";import"./chunk-INNTQ5YN.js";import{b as u}from"./chunk-SRYGE2HW.js";import"./chunk-DT3B54LD.js";import{a as f}from"./chunk-GIB66QXC.js";import"./chunk-2OH65RRD.js";import"./chunk-K3G6FMDF.js";import"./chunk-JM3LERUP.js";import{D as l}from"./chunk-ZKBLXGXT.js";import"./chunk-6B64VOO7.js";import{u as d}from"./chunk-SP6QPE3M.js";import"./chunk-6F6NSBIF.js";import{Wc as s,_c as m,aa as r,ha as a,hb as c,ia as i,sc as n}from"./chunk-6DRNAUKE.js";import"./chunk-GRMIXZTT.js";var C=(()=>{let t=class t{constructor(){}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=a({type:t,selectors:[["app-report"]],decls:1,vars:0,template:function(e,O){e&1&&c(0,"router-outlet")},dependencies:[s],styles:["ul[_ngcontent-%COMP%] > li.dropdown-item[_ngcontent-%COMP%]{font-size:.6875rem!important}"]});let o=t;return o})();var y=[{path:"",component:C,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",loadChildren:()=>import("./chunk-TXHO42LP.js").then(o=>o.OrderModule),canActivate:[f]}]}],g=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i({type:t}),t.\u0275inj=r({imports:[n,m.forChild(y)]});let o=t;return o})();var z=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i({type:t}),t.\u0275inj=r({imports:[n,u,g,d,l,m,h]});let o=t;return o})();export{z as ReportModule};
|