marketplacepos 5.37.5 → 5.38.1

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.
Files changed (37) hide show
  1. package/Marketplace/{chunk-T2G6LONF.js → chunk-3F5YNXJZ.js} +1 -1
  2. package/Marketplace/{chunk-DNBZJ62Q.js → chunk-5F7JXOEW.js} +1 -1
  3. package/Marketplace/{chunk-CKCOOEQG.js → chunk-5WY7E5DR.js} +1 -1
  4. package/Marketplace/{chunk-PXXXV722.js → chunk-74NNHYZD.js} +1 -1
  5. package/Marketplace/{chunk-E2KCDO25.js → chunk-AGZELPLU.js} +1 -1
  6. package/Marketplace/{chunk-7NN7LEU4.js → chunk-AUFEVLWI.js} +1 -1
  7. package/Marketplace/{chunk-AQ527QZ4.js → chunk-DKSZXAZP.js} +1 -1
  8. package/Marketplace/{chunk-TUYBRQVT.js → chunk-ER4ENBJB.js} +1 -1
  9. package/Marketplace/{chunk-TY6N4JRI.js → chunk-FT2CIUVJ.js} +1 -1
  10. package/Marketplace/{chunk-CE2YFM5W.js → chunk-FXY6M473.js} +2 -2
  11. package/Marketplace/{chunk-UIDU76VX.js → chunk-HHYTW3RN.js} +1 -1
  12. package/Marketplace/{chunk-TABEGCJE.js → chunk-HREGLBCD.js} +1 -1
  13. package/Marketplace/chunk-I6PVQBH3.js +1 -0
  14. package/Marketplace/{chunk-GC2HU6DG.js → chunk-IGY25UKT.js} +1 -1
  15. package/Marketplace/{chunk-PRUGNP4D.js → chunk-KACPPB3G.js} +1 -1
  16. package/Marketplace/{chunk-OPZWOT5F.js → chunk-LQFYLU4B.js} +1 -1
  17. package/Marketplace/{chunk-BL7RQYYI.js → chunk-LVN6OVH5.js} +1 -1
  18. package/Marketplace/{chunk-UVMSTT2I.js → chunk-N253NBCW.js} +1 -1
  19. package/Marketplace/{chunk-H2ETKTF2.js → chunk-NEP7KI3U.js} +1 -1
  20. package/Marketplace/{chunk-PU65Z74E.js → chunk-PDUGX4DM.js} +1 -1
  21. package/Marketplace/{chunk-Z2Y7D4DZ.js → chunk-PYZWE4VU.js} +1 -1
  22. package/Marketplace/{chunk-4Y3XPT4V.js → chunk-QAEN52IK.js} +1 -1
  23. package/Marketplace/{chunk-ZWKNMFWZ.js → chunk-QCLSHTFL.js} +2 -2
  24. package/Marketplace/{chunk-HA4UOTDV.js → chunk-QEMI6GLH.js} +1 -1
  25. package/Marketplace/{chunk-6VWDQYTK.js → chunk-QXEKSQSM.js} +1 -1
  26. package/Marketplace/{chunk-WYV5N2CX.js → chunk-T7WMTOQA.js} +1 -1
  27. package/Marketplace/{chunk-32V6XHOM.js → chunk-TA3GQMN7.js} +1 -1
  28. package/Marketplace/{chunk-4EIP5A7W.js → chunk-TW6IUVEY.js} +1 -1
  29. package/Marketplace/{chunk-CPU3RPB6.js → chunk-UJLJ2U37.js} +1 -1
  30. package/Marketplace/{chunk-Q2CPBWY3.js → chunk-X3VJPR2I.js} +1 -1
  31. package/Marketplace/{chunk-CQ5QKLSV.js → chunk-XBPJY5X4.js} +1 -1
  32. package/Marketplace/{chunk-VDUN2ZDO.js → chunk-YTSQ3LOF.js} +1 -1
  33. package/Marketplace/{chunk-3RGBGL3B.js → chunk-ZCK76CIK.js} +1 -1
  34. package/Marketplace/index.html +3 -3
  35. package/Marketplace/{main-GAY5QK22.js → main-IKF2QRKL.js} +1 -1
  36. package/package.json +1 -1
  37. package/Marketplace/chunk-IVX7QWP7.js +0 -1
@@ -1 +1 @@
1
- import{a as X}from"./chunk-CPU3RPB6.js";import{a as Q}from"./chunk-7M4RYU7S.js";import{c as Y,d as D}from"./chunk-EQD3IUMF.js";import"./chunk-BVIRHZTZ.js";import{b as K}from"./chunk-OBN6RKRH.js";import"./chunk-5Z63CRGG.js";import"./chunk-RNWWVG3M.js";import"./chunk-UOAYF4SW.js";import{a as J}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import"./chunk-SD7UKXTX.js";import"./chunk-TY4H2W6F.js";import"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as $}from"./chunk-4Y3XPT4V.js";import{b as G,e as W}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{d as H,l as q,m as z}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as B,h as O,m as U,o as j,y as k}from"./chunk-AI4XRCAL.js";import"./chunk-W6T7TOHE.js";import{g as R,j as L,m as x,n as A}from"./chunk-B6POIFQM.js";import{Eb as N,Ec as g,G as V,Ic as S,Jc as v,Kb as f,Kc as y,Mc as E,Wb as u,Xc as _,Yc as C,Z as T,ea as F,gc as a,hc as p,ic as I,mc as b,pa as M,qb as d,rc as P,sc as o,wb as h,ya as s,za as l}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";function Z(r,w){if(r&1){let e=b();a(0,"button",15),P("click",function(){s(e);let t=o().ngIf,n=o(2);return l(n.onUpdateItems(t))}),I(1,"i",16),g(2," Update "),p()}}function ee(r,w){if(r&1&&(a(0,"div"),f(1,Z,3,0,"button",14),p()),r&2){let e=w.ngIf,i=o(2);d(),u("ngIf",i.productService.hasSelectionVariant(e))}}function te(r,w){if(r&1){let e=b();a(0,"mainpanel",1),P("onSubmit",function(t){s(e);let n=o();return l(n.onSearch(t))}),a(1,"actions")(2,"div",2),f(3,ee,2,1,"div",3),_(4,"async"),a(5,"button",4),P("click",function(){s(e);let t=o();return l(t.openExportDialog())}),I(6,"i",5),a(7,"span"),g(8,"Export"),p()()()(),a(9,"filters")(10,"div")(11,"label",6),g(12,"Page Number"),p(),a(13,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),l(t)}),p()(),a(14,"div",8)(15,"label",6),g(16,"Page Size"),p(),a(17,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),l(t)}),p()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),_(23,"async"),P("onToggle",function(t){s(e);let n=o();return l(n.onShowDifferencePrice(t))})("onSubmit",function(t){s(e);let n=o();return l(n.updatePriceByVariant(t))}),p(),a(24,"infinite-paginator",13),_(25,"async"),P("onNextPage",function(){s(e);let t=o();return l(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){s(e);let t=o();return l(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){s(e);let t=o();return l(t.infinitePagination.getRowCount(t.searchFilter))}),p()()()()()()}if(r&2){let e=o();u("textButton","Search"),d(3),u("ngIf",C(4,14,e.data$)),d(10),S("ngModel",e.searchFilter.PageNumber),d(4),S("ngModel",e.searchFilter.RowCount),d(5),u("showProductToggle",!0)("data",C(23,16,e.data$))("channel",e.channelOptions)("hiddenIPOSInventory",!1),d(2),u("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",C(25,18,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}var be=(()=>{class r{constructor(e,i,t,n,m,c){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=m,this.decimalPipe=c,this.infinitePagination=M(D),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),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.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(F(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let n=i.map(c=>({ID:c.ID,Code:c.Code,Price:c.UnitPrice}));var t=this.channelOptions.filter(c=>c.selected).map(c=>c.ID);let m={ListChannelID:t,ListPrice:n};this.http.post("/api/Price/UpdateChannel",m).subscribe(c=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+m.ListPrice.length+" items in "+m.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(t=>{let n=this.productService.findChannelById(i.ID,this.channelOptions),m=i.Price?this.decimalPipe.transform(i.Price):i.Price;this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+n.Name+" to "+m,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Q,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(V(t=>t!==void 0)).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openExportDialog(){this.dialog.open(K,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(i){return new(i||r)(h(W),h(G),h(H),h(J),h($),h(x))}}static{this.\u0275cmp=N({type:r,selectors:[["app-price-pos-channel"]],features:[E([D,x])],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["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"]],template:function(i,t){i&1&&(f(0,te,26,20,"mainpanel",0),_(1,"async")),i&2&&u("ngIf",C(1,1,t.loader$))},dependencies:[A,R,L,k,B,j,O,U,Y,z,q,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{be as PricePosChannelComponent};
1
+ import{a as X}from"./chunk-UJLJ2U37.js";import{a as Q}from"./chunk-7M4RYU7S.js";import{c as Y,d as D}from"./chunk-EQD3IUMF.js";import"./chunk-BVIRHZTZ.js";import{b as K}from"./chunk-OBN6RKRH.js";import"./chunk-5Z63CRGG.js";import"./chunk-RNWWVG3M.js";import"./chunk-UOAYF4SW.js";import{a as J}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import"./chunk-SD7UKXTX.js";import"./chunk-TY4H2W6F.js";import"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as $}from"./chunk-QAEN52IK.js";import{b as G,e as W}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{d as H,l as q,m as z}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as B,h as O,m as U,o as j,y as k}from"./chunk-AI4XRCAL.js";import"./chunk-W6T7TOHE.js";import{g as R,j as L,m as x,n as A}from"./chunk-B6POIFQM.js";import{Eb as N,Ec as g,G as V,Ic as S,Jc as v,Kb as f,Kc as y,Mc as E,Wb as u,Xc as _,Yc as C,Z as T,ea as F,gc as a,hc as p,ic as I,mc as b,pa as M,qb as d,rc as P,sc as o,wb as h,ya as s,za as l}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";function Z(r,w){if(r&1){let e=b();a(0,"button",15),P("click",function(){s(e);let t=o().ngIf,n=o(2);return l(n.onUpdateItems(t))}),I(1,"i",16),g(2," Update "),p()}}function ee(r,w){if(r&1&&(a(0,"div"),f(1,Z,3,0,"button",14),p()),r&2){let e=w.ngIf,i=o(2);d(),u("ngIf",i.productService.hasSelectionVariant(e))}}function te(r,w){if(r&1){let e=b();a(0,"mainpanel",1),P("onSubmit",function(t){s(e);let n=o();return l(n.onSearch(t))}),a(1,"actions")(2,"div",2),f(3,ee,2,1,"div",3),_(4,"async"),a(5,"button",4),P("click",function(){s(e);let t=o();return l(t.openExportDialog())}),I(6,"i",5),a(7,"span"),g(8,"Export"),p()()()(),a(9,"filters")(10,"div")(11,"label",6),g(12,"Page Number"),p(),a(13,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),l(t)}),p()(),a(14,"div",8)(15,"label",6),g(16,"Page Size"),p(),a(17,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),l(t)}),p()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),_(23,"async"),P("onToggle",function(t){s(e);let n=o();return l(n.onShowDifferencePrice(t))})("onSubmit",function(t){s(e);let n=o();return l(n.updatePriceByVariant(t))}),p(),a(24,"infinite-paginator",13),_(25,"async"),P("onNextPage",function(){s(e);let t=o();return l(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){s(e);let t=o();return l(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){s(e);let t=o();return l(t.infinitePagination.getRowCount(t.searchFilter))}),p()()()()()()}if(r&2){let e=o();u("textButton","Search"),d(3),u("ngIf",C(4,14,e.data$)),d(10),S("ngModel",e.searchFilter.PageNumber),d(4),S("ngModel",e.searchFilter.RowCount),d(5),u("showProductToggle",!0)("data",C(23,16,e.data$))("channel",e.channelOptions)("hiddenIPOSInventory",!1),d(2),u("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",C(25,18,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}var be=(()=>{class r{constructor(e,i,t,n,m,c){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=m,this.decimalPipe=c,this.infinitePagination=M(D),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),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.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(F(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let n=i.map(c=>({ID:c.ID,Code:c.Code,Price:c.UnitPrice}));var t=this.channelOptions.filter(c=>c.selected).map(c=>c.ID);let m={ListChannelID:t,ListPrice:n};this.http.post("/api/Price/UpdateChannel",m).subscribe(c=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+m.ListPrice.length+" items in "+m.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(t=>{let n=this.productService.findChannelById(i.ID,this.channelOptions),m=i.Price?this.decimalPipe.transform(i.Price):i.Price;this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+n.Name+" to "+m,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Q,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(V(t=>t!==void 0)).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openExportDialog(){this.dialog.open(K,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(i){return new(i||r)(h(W),h(G),h(H),h(J),h($),h(x))}}static{this.\u0275cmp=N({type:r,selectors:[["app-price-pos-channel"]],features:[E([D,x])],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["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"]],template:function(i,t){i&1&&(f(0,te,26,20,"mainpanel",0),_(1,"async")),i&2&&u("ngIf",C(1,1,t.loader$))},dependencies:[A,R,L,k,B,j,O,U,Y,z,q,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{be as PricePosChannelComponent};
@@ -1 +1 @@
1
- import{a as Le}from"./chunk-7M4RYU7S.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Re,b as $e,c as Ue,d as Q}from"./chunk-EQD3IUMF.js";import{a as Ce}from"./chunk-BVIRHZTZ.js";import{a as Be}from"./chunk-PF4F4EAR.js";import{a as De}from"./chunk-7KG3DC5J.js";import{b as ke}from"./chunk-OBN6RKRH.js";import"./chunk-5Z63CRGG.js";import"./chunk-RNWWVG3M.js";import"./chunk-UOAYF4SW.js";import{a as Ve}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as Ee,b as Te,c as Oe}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import"./chunk-TY4H2W6F.js";import{a as Ne}from"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as Se,b as ve,d as ye,e as Ie}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as z}from"./chunk-4Y3XPT4V.js";import{b as fe,e as xe}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{d as we,l as Me,m as Fe}from"./chunk-XOT2SZPE.js";import{r as G,s as K}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{a as ge,b as he,h as V,m as N,y as k}from"./chunk-AI4XRCAL.js";import{c as j,e as Pe,f as be}from"./chunk-W6T7TOHE.js";import{d as pe,f as W,g as de,j as _e,m as ue,n as D}from"./chunk-B6POIFQM.js";import{Dc as q,Eb as T,Ec as p,Fc as ce,G as J,Gc as f,Ic as w,Jc as M,Ka as oe,Kb as _,Kc as F,Mc as A,Na as Z,Oc as O,Pc as se,Qa as ae,Wb as s,Xc as v,Yc as E,Z as X,Zb as re,Zc as me,_c as Y,bc as U,cc as B,ea as ie,ec as L,fc as R,gc as o,hc as a,ic as x,jc as y,kc as I,mc as P,ob as b,pa as $,qb as r,rc as g,sc as m,v as ne,vc as le,wb as S,ya as h,za as C}from"./chunk-EIQCOZF5.js";import{a as ee,b as te}from"./chunk-K2H6WANG.js";var Xe=(n,c)=>({color:n,"font-weight":c});function Ze(n,c){if(n&1&&(o(0,"mat-radio-button",2),p(1),a()),n&2){let e=c.$implicit,i=c.index,t=m();re(se(7,Xe,t.model==e.Key&&t.activeBold?"#0976b4":"",t.model==e.Key&&t.activeBold?"700":"")),s("disabled",t.exception==e.Value)("matTooltip",t.title.length>0?t.title[i]:"")("value",e.Key)("name",t.name),r(),f("",e.Value," ")}}var je=(()=>{class n{constructor(){this.disabled=!1,this.modelChange=new oe,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(e){this.modelChange.emit(e)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=T({type:n,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(i,t){i&1&&(o(0,"mat-radio-group",0),g("ngModelChange",function(d){return t.change(d)}),_(1,Ze,2,10,"mat-radio-button",1),a()),i&2&&(s("disabled",t.disabled)("ngModel",t.model),r(),s("ngForOf",t.options))},dependencies:[D,W,Oe,Ee,Te,k,V,N,K,G],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px}html[_ngcontent-%COMP%]{--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]})}}return n})();function qe(n,c){if(n&1&&(o(0,"span",3),x(1,"img",4),a(),o(2,"span"),p(3),a()),n&2){let e=c.item;r(),s("src",e==null?null:e.Img,b),r(2),f(" ",e.Name," ")}}function Ye(n,c){if(n&1){let e=P();o(0,"span",6),g("click",function(){h(e);let t=m(),l=t.item,d=t.clear;return C(d(l))}),p(1,"x"),a()}}function Qe(n,c){if(n&1&&(o(0,"span",3),x(1,"img",4),a(),o(2,"span"),p(3),a(),_(4,Ye,2,0,"span",5)),n&2){let e=c.item,i=m();r(),s("src",e==null?null:e.Img,b),r(2),f(" ",e.Name," "),r(),U(i.clearable()?4:-1)}}var ze=(()=>{class n{constructor(){this.authService=$(z),this.multiple=Z(!1),this.clearable=Z(!0),this.options=this.authService.getChannels(),this.onChange=e=>{}}onChannelChange(e){this.onChange(e)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=T({type:n,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},features:[A([{provide:ge,multi:!0,useExisting:n}])],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(i,t){i&1&&(o(0,"ng-select",0),F("ngModelChange",function(d){return M(t.selectedChannels,d)||(t.selectedChannels=d),d}),g("ngModelChange",function(d){return t.onChannelChange(d)}),_(1,qe,4,2,"ng-template",1)(2,Qe,5,3,"ng-template",2),a()),i&2&&(s("clearable",t.clearable())("items",t.options),w("ngModel",t.selectedChannels),s("multiple",t.multiple()))},dependencies:[D,Ie,ye,Se,ve,k,V,N],encapsulation:2})}}return n})();var Ge=n=>[n],et=n=>({"text-decoration-line-through":n}),tt=n=>({"border-bottom":n}),nt=n=>({"bg-gradient-warning":n});function it(n,c){if(n&1){let e=P();y(0),o(1,"div")(2,"label",21),p(3,"Channel"),a(),o(4,"channel-select-options",22),F("ngModelChange",function(t){h(e);let l=m();return M(l.searchFilter.ListChannelID,t)||(l.searchFilter.ListChannelID=t),C(t)}),a()(),o(5,"div",23)(6,"label",24),p(7,"Filter by"),a(),o(8,"lib-radio-options",25),F("modelChange",function(t){h(e);let l=m();return M(l.searchFilter.filterModel,t)||(l.searchFilter.filterModel=t),C(t)}),a()(),I()}if(n&2){let e=m();r(4),s("multiple",!0),w("ngModel",e.searchFilter.ListChannelID),r(4),w("model",e.searchFilter.filterModel),s("options",e.filterTypeOptions)}}function ot(n,c){if(n&1){let e=P();o(0,"button",27),g("click",function(){h(e);let t=m().ngIf,l=m();return C(l.onUpdateItems(t))}),x(1,"i",28),p(2," Update "),a()}}function at(n,c){if(n&1&&(y(0),o(1,"div",4),_(2,ot,3,0,"button",26),a(),I()),n&2){let e=c.ngIf,i=m();r(2),s("ngIf",i.productService.hasSelectionVariant(e))}}function rt(n,c){if(n&1&&(o(0,"th",15)(1,"div",29),x(2,"img",30),o(3,"div",31),p(4),v(5,"stringLimit"),a()()()),n&2){let e=c.$implicit;r(),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,b),r(2),f(" ",me(5,3,e.Name,20)," ")}}function lt(n,c){if(n&1){let e=P();o(0,"th")(1,"input",32),F("ngModelChange",function(t){h(e);let l=m();return M(l.checkboxState,t)||(l.checkboxState=t),C(t)}),g("ngModelChange",function(){h(e);let t=m();return C(t.onSelectAllData())}),a()()}if(n&2){let e=m();r(),w("ngModel",e.checkboxState)}}function ct(n,c){n&1&&(o(0,"th",33)(1,"span"),p(2,"Expected"),a(),o(3,"span",34),p(4,"(POS)"),a()(),o(5,"th",33),p(6,"Channel"),a())}function st(n,c){if(n&1){let e=P();o(0,"img",47),g("click",function(t){h(e);let l=m(3).$implicit,d=m(2);return C(d.onZoomImage(t,l==null?null:l.ImageUrl))}),a()}if(n&2){let e=m(3).$implicit;le("src",e==null?null:e.ImageUrl,b)}}function mt(n,c){n&1&&x(0,"img",48)}function pt(n,c){if(n&1&&(o(0,"small",46),p(1),a()),n&2){let e=m(3).$implicit;r(),f("(",e==null?null:e.Category,")")}}function dt(n,c){if(n&1&&(y(0),o(1,"td",42),_(2,st,1,1,"img",43)(3,mt,1,0,"ng-template",null,0,Y),a(),o(5,"td",44)(6,"h5",45),p(7),a(),_(8,pt,2,1,"small",46),a(),I()),n&2){let e=q(4),i=m().$index,t=m().$implicit,l=m().ngIf;r(),s("rowSpan",t==null?null:t.Variants.length)("ngClass",O(7,tt,i+1==l.length)),r(),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",e),r(3),s("rowSpan",t==null?null:t.Variants.length),r(2),ce(t==null?null:t.Name),r(),U(t!=null&&t.Category?8:-1)}}function _t(n,c){if(n&1){let e=P();o(0,"td",49)(1,"input",32),F("ngModelChange",function(t){h(e);let l=m().$implicit;return M(l.selected,t)||(l.selected=t),C(t)}),a()()}if(n&2){let e=m().$implicit;r(),w("ngModel",e.selected)}}function ut(n,c){if(n&1){let e=P();y(0),o(1,"td",51),p(2),v(3,"number"),a(),o(4,"td",52),g("click",function(){let t=h(e).$implicit,l=m(2).$implicit,d=m().$implicit,u=m(2);return C(u.openTableDialog(l,d,t))}),o(5,"div",53)(6,"div",54),p(7),v(8,"number"),a(),o(9,"a",55),g("click",function(t){return h(e),C(t==null?null:t.stopPropagation())}),x(10,"i",40),a()()(),I()}if(n&2){let e=c.$implicit;r(2),f(" ",E(3,4,e.PriceExpected)," "),r(2),s("ngClass",O(8,nt,e.Price!=e.PriceExpected)),r(3),f(" ",E(8,6,e.Price)," "),r(2),s("href",e.Url,b)}}function gt(n,c){n&1&&(o(0,"td",56),p(1," X "),a(),o(2,"td",56),p(3," X "),a())}function ht(n,c){if(n&1&&(y(0),_(1,ut,11,10,"ng-container",50)(2,gt,4,0,"ng-template",null,1,Y),I()),n&2){let e=c.$implicit,i=q(3),t=m().$implicit,l=m(3);r(),s("ngIf",l.getItemFromChannel(t,e.ID))("ngIfElse",i)}}function Ct(n,c){if(n&1&&(o(0,"tr"),_(1,dt,9,9,"ng-container",3),o(2,"td",35),p(3),a(),o(4,"td",36)(5,"div",37)(6,"div",38),p(7),a(),o(8,"div",31)(9,"a",39),x(10,"i",40),a()()()(),_(11,_t,2,1,"ng-template",19)(12,ht,4,2,"ng-container",41),a()),n&2){let e=c.$implicit,i=c.$index,t=m(3);r(),s("ngIf",i==0),r(2),f(" ",e==null?null:e.Model," "),r(),s("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),r(2),s("ngClass",O(8,et,e.Discontinued)),r(),f(" ",e==null?null:e.Code," "),r(2),s("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),b),r(2),s("ngxPermissionsOnly",O(10,Ge,t.rolePriceEdit)),r(),s("ngForOf",t.channels())}}function ft(n,c){if(n&1&&(o(0,"tbody"),L(1,Ct,13,12,"tr",null,B),a()),n&2){let e=c.$implicit;r(),R(e.Variants)}}function xt(n,c){if(n&1&&(y(0),L(1,ft,3,0,"tbody",null,B),I()),n&2){let e=c.ngIf;r(),R(e)}}var gn=(()=>{class n{constructor(e,i,t,l,d,u,Ke){this.http=e,this.toastr=i,this.dialog=t,this.productService=l,this.authService=d,this.biggerPictureService=u,this.paginationService=Ke,this.infinitePagination=$(Q),this.searchFilter=new De,this.checkboxState=!1,this.rolePriceEdit=Ce.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.channels=ae([]),this.filterTypeOptions=[{Key:H.ALL,Value:"All"},{Key:H.DIFFERENCE,Value:"Difference"}],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(),this.initChannelTable()}initChannelTable(){let e=this.searchFilter.ListChannelID,i=[];j.IsEmpty(e)||e?.length==0?i=this.channelOptions:i=this.channelOptions.filter(t=>e.findIndex(l=>l==t.ID)>-1),this.channels.update(()=>i)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(X(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(ie(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=H.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),X(1))}onSelectAllData(){this.data$=this.data$.pipe(ne(e=>(e.map(i=>(i.Variants&&(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t))),i)),e)))}onFilter(e){this.searchFilter.text=e;let i=te(ee({},this.searchFilter),{text:e,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(u=>u.ID),d={ListChannelID:this.channelOptions.filter(u=>u.selected).map(u=>u.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:u=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:u=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,i){return e.Channel.find(t=>t.ChannelID==i)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Le,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(J(t=>j.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openTableDialog(e,i,t){let l=JSON.parse(JSON.stringify(e));this.dialog.open(Re,{data:{Name:i.Name,Variant:l,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(J(u=>j.IsNotEmpty(u))).subscribe(u=>{this.updateProductPrice(u,t)})}updateProductPrice(e,i){let t={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",t).subscribe(l=>{i.Price=t.Price;let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${d.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(ke,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}static{this.\u0275fac=function(i){return new(i||n)(S(xe),S(fe),S(we),S(Ve),S(z),S(Ne),S(Be))}}static{this.\u0275cmp=T({type:n,selectors:[["app-custom-channel-price"]],features:[A([Q])],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[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",1,"text-center","border-bottom-0","border","text-uppercase"],["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"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["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"],["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-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[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"]],template:function(i,t){i&1&&(o(0,"mainpanel",2),g("onSubmit",function(d){return t.onFilter(d)}),o(1,"filters"),_(2,it,9,4,"ng-container",3),v(3,"async"),a(),o(4,"actions")(5,"div",4),_(6,at,3,1,"ng-container",3),v(7,"async"),o(8,"button",5),g("click",function(){return t.openExportDialog()}),x(9,"i",6),o(10,"span"),p(11,"Export"),a()()()(),o(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),x(20,"th",14),L(21,rt,6,6,"th",15,B),a(),o(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),a()(),o(27,"th",17),p(28,"Variant"),a(),o(29,"th",18),p(30,"SKU"),a(),_(31,lt,2,1,"ng-template",19),L(32,ct,7,0,null,null,B),a()(),_(34,xt,3,0,"ng-container",3),v(35,"async"),a(),o(36,"infinite-paginator",20),v(37,"async"),g("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),a()()()()()()()),i&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",E(3,13,t.loader$)),r(4),s("ngIf",E(7,15,t.data$)),r(15),R(t.channels()),r(10),s("ngxPermissionsOnly",O(21,Ge,t.rolePriceEdit)),r(),R(t.channels()),r(2),s("ngIf",E(35,17,t.data$)),r(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",E(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[D,pe,W,de,_e,ue,Fe,Me,k,he,V,N,Ue,je,K,G,$e,be,Pe,ze],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}"]})}}return n})();export{gn as CustomChannelPriceComponent};
1
+ import{a as Le}from"./chunk-7M4RYU7S.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Re,b as $e,c as Ue,d as Q}from"./chunk-EQD3IUMF.js";import{a as Ce}from"./chunk-BVIRHZTZ.js";import{a as Be}from"./chunk-PF4F4EAR.js";import{a as De}from"./chunk-7KG3DC5J.js";import{b as ke}from"./chunk-OBN6RKRH.js";import"./chunk-5Z63CRGG.js";import"./chunk-RNWWVG3M.js";import"./chunk-UOAYF4SW.js";import{a as Ve}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as Ee,b as Te,c as Oe}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import"./chunk-TY4H2W6F.js";import{a as Ne}from"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as Se,b as ve,d as ye,e as Ie}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as z}from"./chunk-QAEN52IK.js";import{b as fe,e as xe}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{d as we,l as Me,m as Fe}from"./chunk-XOT2SZPE.js";import{r as G,s as K}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{a as ge,b as he,h as V,m as N,y as k}from"./chunk-AI4XRCAL.js";import{c as j,e as Pe,f as be}from"./chunk-W6T7TOHE.js";import{d as pe,f as W,g as de,j as _e,m as ue,n as D}from"./chunk-B6POIFQM.js";import{Dc as q,Eb as T,Ec as p,Fc as ce,G as J,Gc as f,Ic as w,Jc as M,Ka as oe,Kb as _,Kc as F,Mc as A,Na as Z,Oc as O,Pc as se,Qa as ae,Wb as s,Xc as v,Yc as E,Z as X,Zb as re,Zc as me,_c as Y,bc as U,cc as B,ea as ie,ec as L,fc as R,gc as o,hc as a,ic as x,jc as y,kc as I,mc as P,ob as b,pa as $,qb as r,rc as g,sc as m,v as ne,vc as le,wb as S,ya as h,za as C}from"./chunk-EIQCOZF5.js";import{a as ee,b as te}from"./chunk-K2H6WANG.js";var Xe=(n,c)=>({color:n,"font-weight":c});function Ze(n,c){if(n&1&&(o(0,"mat-radio-button",2),p(1),a()),n&2){let e=c.$implicit,i=c.index,t=m();re(se(7,Xe,t.model==e.Key&&t.activeBold?"#0976b4":"",t.model==e.Key&&t.activeBold?"700":"")),s("disabled",t.exception==e.Value)("matTooltip",t.title.length>0?t.title[i]:"")("value",e.Key)("name",t.name),r(),f("",e.Value," ")}}var je=(()=>{class n{constructor(){this.disabled=!1,this.modelChange=new oe,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(e){this.modelChange.emit(e)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=T({type:n,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(i,t){i&1&&(o(0,"mat-radio-group",0),g("ngModelChange",function(d){return t.change(d)}),_(1,Ze,2,10,"mat-radio-button",1),a()),i&2&&(s("disabled",t.disabled)("ngModel",t.model),r(),s("ngForOf",t.options))},dependencies:[D,W,Oe,Ee,Te,k,V,N,K,G],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px}html[_ngcontent-%COMP%]{--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]})}}return n})();function qe(n,c){if(n&1&&(o(0,"span",3),x(1,"img",4),a(),o(2,"span"),p(3),a()),n&2){let e=c.item;r(),s("src",e==null?null:e.Img,b),r(2),f(" ",e.Name," ")}}function Ye(n,c){if(n&1){let e=P();o(0,"span",6),g("click",function(){h(e);let t=m(),l=t.item,d=t.clear;return C(d(l))}),p(1,"x"),a()}}function Qe(n,c){if(n&1&&(o(0,"span",3),x(1,"img",4),a(),o(2,"span"),p(3),a(),_(4,Ye,2,0,"span",5)),n&2){let e=c.item,i=m();r(),s("src",e==null?null:e.Img,b),r(2),f(" ",e.Name," "),r(),U(i.clearable()?4:-1)}}var ze=(()=>{class n{constructor(){this.authService=$(z),this.multiple=Z(!1),this.clearable=Z(!0),this.options=this.authService.getChannels(),this.onChange=e=>{}}onChannelChange(e){this.onChange(e)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=T({type:n,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},features:[A([{provide:ge,multi:!0,useExisting:n}])],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(i,t){i&1&&(o(0,"ng-select",0),F("ngModelChange",function(d){return M(t.selectedChannels,d)||(t.selectedChannels=d),d}),g("ngModelChange",function(d){return t.onChannelChange(d)}),_(1,qe,4,2,"ng-template",1)(2,Qe,5,3,"ng-template",2),a()),i&2&&(s("clearable",t.clearable())("items",t.options),w("ngModel",t.selectedChannels),s("multiple",t.multiple()))},dependencies:[D,Ie,ye,Se,ve,k,V,N],encapsulation:2})}}return n})();var Ge=n=>[n],et=n=>({"text-decoration-line-through":n}),tt=n=>({"border-bottom":n}),nt=n=>({"bg-gradient-warning":n});function it(n,c){if(n&1){let e=P();y(0),o(1,"div")(2,"label",21),p(3,"Channel"),a(),o(4,"channel-select-options",22),F("ngModelChange",function(t){h(e);let l=m();return M(l.searchFilter.ListChannelID,t)||(l.searchFilter.ListChannelID=t),C(t)}),a()(),o(5,"div",23)(6,"label",24),p(7,"Filter by"),a(),o(8,"lib-radio-options",25),F("modelChange",function(t){h(e);let l=m();return M(l.searchFilter.filterModel,t)||(l.searchFilter.filterModel=t),C(t)}),a()(),I()}if(n&2){let e=m();r(4),s("multiple",!0),w("ngModel",e.searchFilter.ListChannelID),r(4),w("model",e.searchFilter.filterModel),s("options",e.filterTypeOptions)}}function ot(n,c){if(n&1){let e=P();o(0,"button",27),g("click",function(){h(e);let t=m().ngIf,l=m();return C(l.onUpdateItems(t))}),x(1,"i",28),p(2," Update "),a()}}function at(n,c){if(n&1&&(y(0),o(1,"div",4),_(2,ot,3,0,"button",26),a(),I()),n&2){let e=c.ngIf,i=m();r(2),s("ngIf",i.productService.hasSelectionVariant(e))}}function rt(n,c){if(n&1&&(o(0,"th",15)(1,"div",29),x(2,"img",30),o(3,"div",31),p(4),v(5,"stringLimit"),a()()()),n&2){let e=c.$implicit;r(),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,b),r(2),f(" ",me(5,3,e.Name,20)," ")}}function lt(n,c){if(n&1){let e=P();o(0,"th")(1,"input",32),F("ngModelChange",function(t){h(e);let l=m();return M(l.checkboxState,t)||(l.checkboxState=t),C(t)}),g("ngModelChange",function(){h(e);let t=m();return C(t.onSelectAllData())}),a()()}if(n&2){let e=m();r(),w("ngModel",e.checkboxState)}}function ct(n,c){n&1&&(o(0,"th",33)(1,"span"),p(2,"Expected"),a(),o(3,"span",34),p(4,"(POS)"),a()(),o(5,"th",33),p(6,"Channel"),a())}function st(n,c){if(n&1){let e=P();o(0,"img",47),g("click",function(t){h(e);let l=m(3).$implicit,d=m(2);return C(d.onZoomImage(t,l==null?null:l.ImageUrl))}),a()}if(n&2){let e=m(3).$implicit;le("src",e==null?null:e.ImageUrl,b)}}function mt(n,c){n&1&&x(0,"img",48)}function pt(n,c){if(n&1&&(o(0,"small",46),p(1),a()),n&2){let e=m(3).$implicit;r(),f("(",e==null?null:e.Category,")")}}function dt(n,c){if(n&1&&(y(0),o(1,"td",42),_(2,st,1,1,"img",43)(3,mt,1,0,"ng-template",null,0,Y),a(),o(5,"td",44)(6,"h5",45),p(7),a(),_(8,pt,2,1,"small",46),a(),I()),n&2){let e=q(4),i=m().$index,t=m().$implicit,l=m().ngIf;r(),s("rowSpan",t==null?null:t.Variants.length)("ngClass",O(7,tt,i+1==l.length)),r(),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",e),r(3),s("rowSpan",t==null?null:t.Variants.length),r(2),ce(t==null?null:t.Name),r(),U(t!=null&&t.Category?8:-1)}}function _t(n,c){if(n&1){let e=P();o(0,"td",49)(1,"input",32),F("ngModelChange",function(t){h(e);let l=m().$implicit;return M(l.selected,t)||(l.selected=t),C(t)}),a()()}if(n&2){let e=m().$implicit;r(),w("ngModel",e.selected)}}function ut(n,c){if(n&1){let e=P();y(0),o(1,"td",51),p(2),v(3,"number"),a(),o(4,"td",52),g("click",function(){let t=h(e).$implicit,l=m(2).$implicit,d=m().$implicit,u=m(2);return C(u.openTableDialog(l,d,t))}),o(5,"div",53)(6,"div",54),p(7),v(8,"number"),a(),o(9,"a",55),g("click",function(t){return h(e),C(t==null?null:t.stopPropagation())}),x(10,"i",40),a()()(),I()}if(n&2){let e=c.$implicit;r(2),f(" ",E(3,4,e.PriceExpected)," "),r(2),s("ngClass",O(8,nt,e.Price!=e.PriceExpected)),r(3),f(" ",E(8,6,e.Price)," "),r(2),s("href",e.Url,b)}}function gt(n,c){n&1&&(o(0,"td",56),p(1," X "),a(),o(2,"td",56),p(3," X "),a())}function ht(n,c){if(n&1&&(y(0),_(1,ut,11,10,"ng-container",50)(2,gt,4,0,"ng-template",null,1,Y),I()),n&2){let e=c.$implicit,i=q(3),t=m().$implicit,l=m(3);r(),s("ngIf",l.getItemFromChannel(t,e.ID))("ngIfElse",i)}}function Ct(n,c){if(n&1&&(o(0,"tr"),_(1,dt,9,9,"ng-container",3),o(2,"td",35),p(3),a(),o(4,"td",36)(5,"div",37)(6,"div",38),p(7),a(),o(8,"div",31)(9,"a",39),x(10,"i",40),a()()()(),_(11,_t,2,1,"ng-template",19)(12,ht,4,2,"ng-container",41),a()),n&2){let e=c.$implicit,i=c.$index,t=m(3);r(),s("ngIf",i==0),r(2),f(" ",e==null?null:e.Model," "),r(),s("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),r(2),s("ngClass",O(8,et,e.Discontinued)),r(),f(" ",e==null?null:e.Code," "),r(2),s("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),b),r(2),s("ngxPermissionsOnly",O(10,Ge,t.rolePriceEdit)),r(),s("ngForOf",t.channels())}}function ft(n,c){if(n&1&&(o(0,"tbody"),L(1,Ct,13,12,"tr",null,B),a()),n&2){let e=c.$implicit;r(),R(e.Variants)}}function xt(n,c){if(n&1&&(y(0),L(1,ft,3,0,"tbody",null,B),I()),n&2){let e=c.ngIf;r(),R(e)}}var gn=(()=>{class n{constructor(e,i,t,l,d,u,Ke){this.http=e,this.toastr=i,this.dialog=t,this.productService=l,this.authService=d,this.biggerPictureService=u,this.paginationService=Ke,this.infinitePagination=$(Q),this.searchFilter=new De,this.checkboxState=!1,this.rolePriceEdit=Ce.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.channels=ae([]),this.filterTypeOptions=[{Key:H.ALL,Value:"All"},{Key:H.DIFFERENCE,Value:"Difference"}],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(),this.initChannelTable()}initChannelTable(){let e=this.searchFilter.ListChannelID,i=[];j.IsEmpty(e)||e?.length==0?i=this.channelOptions:i=this.channelOptions.filter(t=>e.findIndex(l=>l==t.ID)>-1),this.channels.update(()=>i)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(X(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(ie(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=H.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),X(1))}onSelectAllData(){this.data$=this.data$.pipe(ne(e=>(e.map(i=>(i.Variants&&(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t))),i)),e)))}onFilter(e){this.searchFilter.text=e;let i=te(ee({},this.searchFilter),{text:e,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(u=>u.ID),d={ListChannelID:this.channelOptions.filter(u=>u.selected).map(u=>u.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:u=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:u=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,i){return e.Channel.find(t=>t.ChannelID==i)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Le,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(J(t=>j.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openTableDialog(e,i,t){let l=JSON.parse(JSON.stringify(e));this.dialog.open(Re,{data:{Name:i.Name,Variant:l,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(J(u=>j.IsNotEmpty(u))).subscribe(u=>{this.updateProductPrice(u,t)})}updateProductPrice(e,i){let t={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",t).subscribe(l=>{i.Price=t.Price;let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${d.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(ke,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}static{this.\u0275fac=function(i){return new(i||n)(S(xe),S(fe),S(we),S(Ve),S(z),S(Ne),S(Be))}}static{this.\u0275cmp=T({type:n,selectors:[["app-custom-channel-price"]],features:[A([Q])],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[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",1,"text-center","border-bottom-0","border","text-uppercase"],["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"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["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"],["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-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[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"]],template:function(i,t){i&1&&(o(0,"mainpanel",2),g("onSubmit",function(d){return t.onFilter(d)}),o(1,"filters"),_(2,it,9,4,"ng-container",3),v(3,"async"),a(),o(4,"actions")(5,"div",4),_(6,at,3,1,"ng-container",3),v(7,"async"),o(8,"button",5),g("click",function(){return t.openExportDialog()}),x(9,"i",6),o(10,"span"),p(11,"Export"),a()()()(),o(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),x(20,"th",14),L(21,rt,6,6,"th",15,B),a(),o(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),a()(),o(27,"th",17),p(28,"Variant"),a(),o(29,"th",18),p(30,"SKU"),a(),_(31,lt,2,1,"ng-template",19),L(32,ct,7,0,null,null,B),a()(),_(34,xt,3,0,"ng-container",3),v(35,"async"),a(),o(36,"infinite-paginator",20),v(37,"async"),g("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),a()()()()()()()),i&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",E(3,13,t.loader$)),r(4),s("ngIf",E(7,15,t.data$)),r(15),R(t.channels()),r(10),s("ngxPermissionsOnly",O(21,Ge,t.rolePriceEdit)),r(),R(t.channels()),r(2),s("ngIf",E(35,17,t.data$)),r(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",E(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[D,pe,W,de,_e,ue,Fe,Me,k,he,V,N,Ue,je,K,G,$e,be,Pe,ze],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}"]})}}return n})();export{gn as CustomChannelPriceComponent};
@@ -1 +1 @@
1
- import{a as M}from"./chunk-TUYBRQVT.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as B}from"./chunk-EQD3IUMF.js";import{a as se}from"./chunk-BVIRHZTZ.js";import{a as Ve,b as Te}from"./chunk-OBN6RKRH.js";import{a as be,b as Fe}from"./chunk-5Z63CRGG.js";import"./chunk-UOAYF4SW.js";import{a as ye}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import"./chunk-SD7UKXTX.js";import"./chunk-TY4H2W6F.js";import{a as ve}from"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as Ce,b as ue,d as fe,e as xe}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as he}from"./chunk-4Y3XPT4V.js";import{b as _e,e as me}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{d as Se,k as Pe,l as Ie,m as we}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{b as ie,c as oe,h as ae,m as re,o as le,y as ce}from"./chunk-AI4XRCAL.js";import{c as pe,e as de,f as ge}from"./chunk-W6T7TOHE.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-B6POIFQM.js";import{Dc as H,Eb as z,Ec as d,Fc as R,G as W,Gc as b,Ic as I,Jc as w,Kb as h,Kc as y,Mc as J,Oc as F,Wb as p,Xc as v,Yc as V,Z as A,Zc as Z,_c as Q,bc as S,cc as N,ea as $,ec as k,fc as L,gc as a,hc as c,ic as P,jc as G,kc as q,mc as f,ob as T,pa as j,qb as l,rc as C,sc as r,vc as K,wb as u,ya as _,za as m}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var U=i=>[i],Re=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i}),Ue=i=>({"ms-10":i});function Oe(i,s){if(i&1&&(a(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),p("src",e==null?null:e.Img,T),l(),b(" ",e.Name," ")}}function We(i,s){if(i&1){let e=f();a(0,"button",16),C("click",function(){_(e);let t=r().ngIf,o=r(2);return m(o.updateStock(t))}),P(1,"i",17),d(2," Update "),c()}}function Ae(i,s){if(i&1){let e=f();a(0,"actions")(1,"div",12),h(2,We,3,0,"button",13),a(3,"button",14),C("click",function(){_(e);let t=r(2);return m(t.openExportDialog())}),P(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),p("ngIf",n.productService.hasSelectionVariant(e))}}function $e(i,s){if(i&1){let e=f();a(0,"th")(1,"input",32),C("change",function(t){_(e);let o=r().ngIf,g=r(2);return m(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function je(i,s){if(i&1){let e=f();a(0,"input",51),y("ngModelChange",function(t){_(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),C("ngModelChange",function(){_(e);let t=r(4).$implicit,o=r(3);return m(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function ze(i,s){if(i&1&&h(0,je,1,1,"ng-template",26),i&2){let e=r(6);p("ngxPermissionsOnly",F(1,U,e.rolePriceEdit))}}function Ge(i,s){if(i&1){let e=f();G(0),a(1,"img",52),C("click",function(t){_(e);let o=r(3).$implicit,g=r(3);return m(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,T)}}function qe(i,s){i&1&&P(0,"img",53)}function Ke(i,s){if(i&1&&(a(0,"small",50),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function He(i,s){if(i&1&&(a(0,"td",44)(1,"div",45),h(2,ze,1,3,null,26),a(3,"div",46),h(4,Ge,2,1,"ng-container",47)(5,qe,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",48)(8,"span",49),d(9),c(),h(10,Ke,2,1,"small",50),c()),i&2){let e=H(6),n=r(2).$implicit;p("rowSpan",n.Variants.length),l(2),S((n.Variants==null?null:n.Variants.length)>1?2:-1),l(),p("ngClass",F(8,Ue,(n.Variants==null?null:n.Variants.length)<=1)),l(),p("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),p("rowSpan",n.Variants.length),l(2),R(n.Name),l(),S(n.Category?10:-1)}}function Je(i,s){if(i&1){let e=f();a(0,"input",56),y("ngModelChange",function(t){_(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Ze(i,s){if(i&1&&(a(0,"td",54),h(1,Je,1,1,"input",55),c()),i&2){let e=r().$implicit;l(),S(e.UnitPrice>=0?1:-1)}}function Qe(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Xe(i,s){if(i&1&&(a(0,"div"),d(1),v(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.UnitPrice)," ")}}function Ye(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let e=r().$implicit,n=r(4);l(),p("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),T)}}function et(i,s){if(i&1){let e=f();a(0,"div",58),C("click",function(){_(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,x=r();return m(x.openTableDialog(t,o,g))}),d(1),v(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function tt(i,s){if(i&1){let e=f();a(0,"tr",33),h(1,He,11,10),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Ze,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Qe,2,0,"div",36)(11,Xe,3,3,"div")(12,Ye,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,et,3,3,"div",39),a(16,"div",37)(17,"a",40),P(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=_(e).$implicit,o=r(4);return m(o.refreshPrice(t))}),P(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),S(n==0?1:-1),l(2),R(e.Model),l(2),p("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",F(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),p("ngxPermissionsOnly",F(14,U,t.rolePriceEdit)),l(3),S((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),p("ngClass",F(16,Be,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),S(e.Channel.length>0?15:-1),l(2),p("href",e.Channel[0]==null?null:e.Channel[0].Url,T)}}function nt(i,s){if(i&1&&k(0,tt,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function it(i,s){if(i&1){let e=f();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(t){_(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),m(t)}),C("toggleChange",function(){_(e);let t=r(2);return m(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,$e,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){_(e);let t=r(2);return m(t.openModalFilter())}),P(21,"img",29),a(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,nt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),v(29,"async"),C("onNextPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=r(2);return m(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",F(16,U,n.rolePriceEdit)),l(4),p("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),p("src",n.selectedChannel==null?null:n.selectedChannel.Img,T),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),p("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",V(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function ot(i,s){if(i&1){let e=f();a(0,"mainpanel",2),y("textChange",function(t){_(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),m(t)}),C("onSubmit",function(){_(e);let t=r();return m(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),m(t)}),h(6,Oe,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),m(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),m(t)}),c()()(),h(15,Ae,7,1,"actions",9),v(16,"async"),h(17,it,30,18,"content",9),v(18,"async"),c()}if(i&2){let e=r();p("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),p("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),p("ngIf",V(16,9,e.data$)),l(2),p("ngIf",V(18,11,e.data$))}}var At=(()=>{class i{constructor(e,n,t,o,g,x,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=x,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(B),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.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.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(x=>pe.IsNotEmpty(x))).subscribe(x=>{this.updateItemAfterDialog(x,e)})}updateItemAfterDialog(e,n){let t={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",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),x=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${x}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Se),u(ye),u(ve),u(M),u(he),u(Pe),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([B,M,ne("https://res.cloudinary.com/"),D])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",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"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["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"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",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","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,ot,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",V(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,xe,fe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],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}"],changeDetection:0})}}return i})();export{At as PriceSingleChannelComponent};
1
+ import{a as M}from"./chunk-ER4ENBJB.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as B}from"./chunk-EQD3IUMF.js";import{a as se}from"./chunk-BVIRHZTZ.js";import{a as Ve,b as Te}from"./chunk-OBN6RKRH.js";import{a as be,b as Fe}from"./chunk-5Z63CRGG.js";import"./chunk-UOAYF4SW.js";import{a as ye}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import"./chunk-SD7UKXTX.js";import"./chunk-TY4H2W6F.js";import{a as ve}from"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as Ce,b as ue,d as fe,e as xe}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as he}from"./chunk-QAEN52IK.js";import{b as _e,e as me}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{d as Se,k as Pe,l as Ie,m as we}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{b as ie,c as oe,h as ae,m as re,o as le,y as ce}from"./chunk-AI4XRCAL.js";import{c as pe,e as de,f as ge}from"./chunk-W6T7TOHE.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-B6POIFQM.js";import{Dc as H,Eb as z,Ec as d,Fc as R,G as W,Gc as b,Ic as I,Jc as w,Kb as h,Kc as y,Mc as J,Oc as F,Wb as p,Xc as v,Yc as V,Z as A,Zc as Z,_c as Q,bc as S,cc as N,ea as $,ec as k,fc as L,gc as a,hc as c,ic as P,jc as G,kc as q,mc as f,ob as T,pa as j,qb as l,rc as C,sc as r,vc as K,wb as u,ya as _,za as m}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var U=i=>[i],Re=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i}),Ue=i=>({"ms-10":i});function Oe(i,s){if(i&1&&(a(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),p("src",e==null?null:e.Img,T),l(),b(" ",e.Name," ")}}function We(i,s){if(i&1){let e=f();a(0,"button",16),C("click",function(){_(e);let t=r().ngIf,o=r(2);return m(o.updateStock(t))}),P(1,"i",17),d(2," Update "),c()}}function Ae(i,s){if(i&1){let e=f();a(0,"actions")(1,"div",12),h(2,We,3,0,"button",13),a(3,"button",14),C("click",function(){_(e);let t=r(2);return m(t.openExportDialog())}),P(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),p("ngIf",n.productService.hasSelectionVariant(e))}}function $e(i,s){if(i&1){let e=f();a(0,"th")(1,"input",32),C("change",function(t){_(e);let o=r().ngIf,g=r(2);return m(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function je(i,s){if(i&1){let e=f();a(0,"input",51),y("ngModelChange",function(t){_(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),C("ngModelChange",function(){_(e);let t=r(4).$implicit,o=r(3);return m(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function ze(i,s){if(i&1&&h(0,je,1,1,"ng-template",26),i&2){let e=r(6);p("ngxPermissionsOnly",F(1,U,e.rolePriceEdit))}}function Ge(i,s){if(i&1){let e=f();G(0),a(1,"img",52),C("click",function(t){_(e);let o=r(3).$implicit,g=r(3);return m(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,T)}}function qe(i,s){i&1&&P(0,"img",53)}function Ke(i,s){if(i&1&&(a(0,"small",50),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function He(i,s){if(i&1&&(a(0,"td",44)(1,"div",45),h(2,ze,1,3,null,26),a(3,"div",46),h(4,Ge,2,1,"ng-container",47)(5,qe,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",48)(8,"span",49),d(9),c(),h(10,Ke,2,1,"small",50),c()),i&2){let e=H(6),n=r(2).$implicit;p("rowSpan",n.Variants.length),l(2),S((n.Variants==null?null:n.Variants.length)>1?2:-1),l(),p("ngClass",F(8,Ue,(n.Variants==null?null:n.Variants.length)<=1)),l(),p("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),p("rowSpan",n.Variants.length),l(2),R(n.Name),l(),S(n.Category?10:-1)}}function Je(i,s){if(i&1){let e=f();a(0,"input",56),y("ngModelChange",function(t){_(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Ze(i,s){if(i&1&&(a(0,"td",54),h(1,Je,1,1,"input",55),c()),i&2){let e=r().$implicit;l(),S(e.UnitPrice>=0?1:-1)}}function Qe(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Xe(i,s){if(i&1&&(a(0,"div"),d(1),v(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.UnitPrice)," ")}}function Ye(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let e=r().$implicit,n=r(4);l(),p("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),T)}}function et(i,s){if(i&1){let e=f();a(0,"div",58),C("click",function(){_(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,x=r();return m(x.openTableDialog(t,o,g))}),d(1),v(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function tt(i,s){if(i&1){let e=f();a(0,"tr",33),h(1,He,11,10),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Ze,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Qe,2,0,"div",36)(11,Xe,3,3,"div")(12,Ye,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,et,3,3,"div",39),a(16,"div",37)(17,"a",40),P(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=_(e).$implicit,o=r(4);return m(o.refreshPrice(t))}),P(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),S(n==0?1:-1),l(2),R(e.Model),l(2),p("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",F(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),p("ngxPermissionsOnly",F(14,U,t.rolePriceEdit)),l(3),S((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),p("ngClass",F(16,Be,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),S(e.Channel.length>0?15:-1),l(2),p("href",e.Channel[0]==null?null:e.Channel[0].Url,T)}}function nt(i,s){if(i&1&&k(0,tt,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function it(i,s){if(i&1){let e=f();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(t){_(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),m(t)}),C("toggleChange",function(){_(e);let t=r(2);return m(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,$e,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){_(e);let t=r(2);return m(t.openModalFilter())}),P(21,"img",29),a(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,nt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),v(29,"async"),C("onNextPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=r(2);return m(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",F(16,U,n.rolePriceEdit)),l(4),p("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),p("src",n.selectedChannel==null?null:n.selectedChannel.Img,T),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),p("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",V(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function ot(i,s){if(i&1){let e=f();a(0,"mainpanel",2),y("textChange",function(t){_(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),m(t)}),C("onSubmit",function(){_(e);let t=r();return m(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),m(t)}),h(6,Oe,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),m(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),m(t)}),c()()(),h(15,Ae,7,1,"actions",9),v(16,"async"),h(17,it,30,18,"content",9),v(18,"async"),c()}if(i&2){let e=r();p("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),p("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),p("ngIf",V(16,9,e.data$)),l(2),p("ngIf",V(18,11,e.data$))}}var At=(()=>{class i{constructor(e,n,t,o,g,x,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=x,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(B),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.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.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(x=>pe.IsNotEmpty(x))).subscribe(x=>{this.updateItemAfterDialog(x,e)})}updateItemAfterDialog(e,n){let t={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",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),x=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${x}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Se),u(ye),u(ve),u(M),u(he),u(Pe),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([B,M,ne("https://res.cloudinary.com/"),D])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",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"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["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"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",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","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,ot,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",V(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,xe,fe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],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}"],changeDetection:0})}}return i})();export{At as PriceSingleChannelComponent};
@@ -1 +1 @@
1
- import{j as l}from"./chunk-4Y3XPT4V.js";import{b as c}from"./chunk-JSPVOV7M.js";import{G as a}from"./chunk-B6POIFQM.js";import{ja as n,oa as r}from"./chunk-EIQCOZF5.js";var v=(()=>{class e{constructor(o,t,i){this.toastr=o,this.authService=t,this.router=i}canActivate(o,t){let i=JSON.parse(window.localStorage.getItem("user")),u=new Date,s=!1;if(i!=null){let p=new Date(i.Token.expiredAt);u<p?s=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return s}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}static{this.\u0275fac=function(t){return new(t||e)(r(c),r(l),r(a))}}static{this.\u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{v as a};
1
+ import{j as l}from"./chunk-QAEN52IK.js";import{b as c}from"./chunk-JSPVOV7M.js";import{G as a}from"./chunk-B6POIFQM.js";import{ja as n,oa as r}from"./chunk-EIQCOZF5.js";var v=(()=>{class e{constructor(o,t,i){this.toastr=o,this.authService=t,this.router=i}canActivate(o,t){let i=JSON.parse(window.localStorage.getItem("user")),u=new Date,s=!1;if(i!=null){let p=new Date(i.Token.expiredAt);u<p?s=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return s}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}static{this.\u0275fac=function(t){return new(t||e)(r(c),r(l),r(a))}}static{this.\u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{v as a};