marketplacepos 3.6.0 → 3.6.2

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 (77) hide show
  1. package/Marketplace/{chunk-DKPFXQNF.js → chunk-2GCJVDVN.js} +1 -1
  2. package/Marketplace/chunk-2KGUHH44.js +1 -0
  3. package/Marketplace/{chunk-JWESCPR3.js → chunk-45NXB6RE.js} +1 -1
  4. package/Marketplace/{chunk-FTYEJYHR.js → chunk-46GC4FG7.js} +1 -1
  5. package/Marketplace/{chunk-37HLVAAU.js → chunk-4YRDQUI3.js} +1 -1
  6. package/Marketplace/{chunk-KDJNHDU2.js → chunk-5LHF6NCK.js} +1 -1
  7. package/Marketplace/{chunk-4TY6WDXS.js → chunk-66UC4STB.js} +1 -1
  8. package/Marketplace/{chunk-PUSB4EIC.js → chunk-6M2Q3GGB.js} +1 -1
  9. package/Marketplace/{chunk-NAXDUEX4.js → chunk-7EYB3DHT.js} +1 -1
  10. package/Marketplace/{chunk-JUIDNG6B.js → chunk-7JWQMOH7.js} +1 -1
  11. package/Marketplace/{chunk-2GUSUJKR.js → chunk-7V6UQDFG.js} +1 -1
  12. package/Marketplace/{chunk-CIGF5YG5.js → chunk-A4X2AUOC.js} +1 -1
  13. package/Marketplace/{chunk-KTPCOMZ2.js → chunk-BATYANE3.js} +1 -1
  14. package/Marketplace/{chunk-6YFZBURX.js → chunk-BREDWZJ7.js} +1 -1
  15. package/Marketplace/chunk-BVGNNSM2.js +1 -0
  16. package/Marketplace/{chunk-YK6VKTWV.js → chunk-BVMOK3VE.js} +1 -1
  17. package/Marketplace/{chunk-FBU5QXHN.js → chunk-BW5REXI6.js} +1 -1
  18. package/Marketplace/{chunk-PP4T4PLJ.js → chunk-BYPWQ2HT.js} +1 -1
  19. package/Marketplace/{chunk-35GLPUIA.js → chunk-CBOPSK2G.js} +1 -1
  20. package/Marketplace/{chunk-WNUGQVRM.js → chunk-DKGYGZK7.js} +1 -1
  21. package/Marketplace/{chunk-JGYSNRH6.js → chunk-DQRS5DAE.js} +1 -1
  22. package/Marketplace/{chunk-MIAEM23L.js → chunk-DZKSVYPR.js} +1 -1
  23. package/Marketplace/{chunk-YS2YJHB3.js → chunk-EAYXHDLW.js} +1 -1
  24. package/Marketplace/{chunk-ISJRZPJX.js → chunk-EOM22W74.js} +1 -1
  25. package/Marketplace/{chunk-3G5KO3TI.js → chunk-ERRFLL6T.js} +1 -1
  26. package/Marketplace/{chunk-IPSBLHOU.js → chunk-F45ZZTMU.js} +1 -1
  27. package/Marketplace/{chunk-3ZNOGHL3.js → chunk-FH2STK2T.js} +1 -1
  28. package/Marketplace/{chunk-Q2ZCP6BL.js → chunk-FO3KSKQ6.js} +1 -1
  29. package/Marketplace/{chunk-AO2MXRCQ.js → chunk-GF526R3A.js} +1 -1
  30. package/Marketplace/{chunk-SFDY7NUA.js → chunk-GMNZLOVM.js} +1 -1
  31. package/Marketplace/{chunk-VX5ROJLM.js → chunk-HUDF4XGA.js} +1 -1
  32. package/Marketplace/{chunk-BUG6II55.js → chunk-HXRWGEJ5.js} +1 -1
  33. package/Marketplace/{chunk-I7PLLVEH.js → chunk-I3M6GHUE.js} +1 -1
  34. package/Marketplace/{chunk-QC4HQRFC.js → chunk-J2UWP2SN.js} +1 -1
  35. package/Marketplace/{chunk-SY5WIR62.js → chunk-JSCR55UZ.js} +3 -3
  36. package/Marketplace/{chunk-HVNMMTYL.js → chunk-KM23UFSR.js} +1 -1
  37. package/Marketplace/{chunk-YBAPXY6T.js → chunk-L3TBTXVF.js} +1 -1
  38. package/Marketplace/{chunk-3KJSV75O.js → chunk-LXDCPBTR.js} +1 -1
  39. package/Marketplace/chunk-MO3YBEXE.js +1 -0
  40. package/Marketplace/{chunk-233MWU5I.js → chunk-NZQHBWBK.js} +2 -2
  41. package/Marketplace/{chunk-K5FAZTRK.js → chunk-PFXGXQHO.js} +1 -1
  42. package/Marketplace/{chunk-SUY2H7ZI.js → chunk-PXAUQQ7Y.js} +1 -1
  43. package/Marketplace/{chunk-ZXU3FVPS.js → chunk-QYZDV3KB.js} +1 -1
  44. package/Marketplace/{chunk-W7OIIPRU.js → chunk-QZ6GD3DK.js} +1 -1
  45. package/Marketplace/{chunk-2Y66HZFD.js → chunk-RISSBTN2.js} +1 -1
  46. package/Marketplace/{chunk-MLMGMDJA.js → chunk-RNPQSH4X.js} +1 -1
  47. package/Marketplace/{chunk-53K2CWAN.js → chunk-RQYJJ3EK.js} +1 -1
  48. package/Marketplace/{chunk-V752HOUZ.js → chunk-RWYXA653.js} +1 -1
  49. package/Marketplace/{chunk-HEYRRICW.js → chunk-SB5XTLLY.js} +1 -1
  50. package/Marketplace/{chunk-2FZAKLVH.js → chunk-TAD43MYD.js} +1 -1
  51. package/Marketplace/{chunk-ZVELVZIL.js → chunk-TG2NAWXW.js} +1 -1
  52. package/Marketplace/{chunk-G4PZ5CPL.js → chunk-TPFTT632.js} +1 -1
  53. package/Marketplace/{chunk-IOUI2FZD.js → chunk-UV6KK4W6.js} +1 -1
  54. package/Marketplace/{chunk-IM6ZDC7I.js → chunk-V7X66MWE.js} +1 -1
  55. package/Marketplace/{chunk-UTRK7TTD.js → chunk-XAU4KWDG.js} +1 -1
  56. package/Marketplace/{chunk-R2U2NYVL.js → chunk-XDJYCAPB.js} +1 -1
  57. package/Marketplace/{chunk-Q6Y22NLN.js → chunk-XJMXZWZW.js} +1 -1
  58. package/Marketplace/{chunk-UTSC6PL6.js → chunk-YBEJ6DSM.js} +1 -1
  59. package/Marketplace/{chunk-M3XCT7JY.js → chunk-YO44EPAG.js} +1 -1
  60. package/Marketplace/{chunk-NEAQH3FX.js → chunk-Z4L57D42.js} +1 -1
  61. package/Marketplace/{chunk-MGVAWFYU.js → chunk-ZHLG7GCJ.js} +1 -1
  62. package/Marketplace/{chunk-7ARC4G4F.js → chunk-ZJYHLYQC.js} +1 -1
  63. package/Marketplace/{chunk-5LICD27P.js → chunk-ZLHGVQE6.js} +2 -2
  64. package/Marketplace/{chunk-MBHOZDLB.js → chunk-ZRTKOAYD.js} +1 -1
  65. package/Marketplace/index.html +2 -2
  66. package/Marketplace/{main-ICOUGZTS.js → main-JR4ZU2LJ.js} +1 -1
  67. package/Marketplace/{styles-XDRE2JJC.css → styles-DXZCV23O.css} +1 -1
  68. package/package.json +1 -1
  69. package/Marketplace/chunk-E64JNFG7.js +0 -1
  70. package/Marketplace/chunk-UWU5GEHX.js +0 -1
  71. package/Marketplace/chunk-V3NJFGV3.js +0 -1
  72. /package/Marketplace/{chunk-6RUGKYFT.js → chunk-72VLH7XK.js} +0 -0
  73. /package/Marketplace/{chunk-6HLIRI7N.js → chunk-GCXKRLIU.js} +0 -0
  74. /package/Marketplace/{chunk-V6VYUZWG.js → chunk-NXHCLVII.js} +0 -0
  75. /package/Marketplace/{chunk-ZLME6FEU.js → chunk-OUASU5FP.js} +0 -0
  76. /package/Marketplace/{chunk-KPTAVWMG.js → chunk-YD4CXLB4.js} +0 -0
  77. /package/Marketplace/{polyfills-L2ZK4WXQ.js → polyfills-ON52FDZY.js} +0 -0
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"marketplacepos","version":"3.6.0"}
1
+ {"name":"marketplacepos","version":"3.6.2"}
@@ -1 +0,0 @@
1
- import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-CIGF5YG5.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6RUGKYFT.js";
@@ -1 +0,0 @@
1
- import{a as h}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-53K2CWAN.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-3ZNOGHL3.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-ISJRZPJX.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-3KJSV75O.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-BUG6II55.js";import{b as u}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MLMGMDJA.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-V752HOUZ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-DKPFXQNF.js";import{a as f}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-G4PZ5CPL.js";import{w as l}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-IM6ZDC7I.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-JWESCPR3.js";import{u as d}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6YFZBURX.js";import{$a as c,Hc as s,Lc as m,aa as r,ea as a,fa as i,fc as n}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MGVAWFYU.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6RUGKYFT.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("https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-Q6Y22NLN.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};
@@ -1 +0,0 @@
1
- import{a as Ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-V6VYUZWG.js";import{a as O,b as he,c as ue,d as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-5LICD27P.js";import{a as _e,b as Be}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-I7PLLVEH.js";import{b as Ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-W7OIIPRU.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-ZLME6FEU.js";import{a as Re,b as Le}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-FBU5QXHN.js";import{a as re}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6HLIRI7N.js";import{a as de}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-AO2MXRCQ.js";import{a as pe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-PUSB4EIC.js";import{a as G}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-NEAQH3FX.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-IOUI2FZD.js";import{c as K}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-K5FAZTRK.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-BUG6II55.js";import{a as Me,b as ke}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MLMGMDJA.js";import{b as B,e as j}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-VX5ROJLM.js";import{b as le,c as De}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-V752HOUZ.js";import{a as me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MBHOZDLB.js";import{a as Oe,b as $e,c as Ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-PP4T4PLJ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-HVNMMTYL.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-DKPFXQNF.js";import{d as Ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-2FZAKLVH.js";import{a as ce}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-G4PZ5CPL.js";import{t as se,u as Ee,v as z,w as Fe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-IM6ZDC7I.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-JWESCPR3.js";import{b as ne,c as ie,h as k,k as N,m as oe,u as ae,v as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6YFZBURX.js";import{c as w}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-KPTAVWMG.js";import{$a as x,B as D,Cb as P,Db as v,Fa as l,Ga as b,Hc as we,Ja as Ie,Lb as Y,Lc as te,Oa as s,Q as be,Ua as C,X as q,Xb as $,Za as r,Zb as A,_a as c,_b as U,aa as X,ab as F,bb as M,bc as ee,db as f,ea as V,ec as R,fa as Q,fc as L,hb as g,ja as h,jb as p,ka as u,mb as W,ob as H,pb as m,q as Z,qb as T,rb as I,ub as ye,wb as y,za as E}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MGVAWFYU.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6RUGKYFT.js";function nt(i,a){if(i&1){let n=f();r(0,"button",18),g("click",function(){h(n);let t=p(3);return u(t.openScanDialog())}),x(1,"i",19),m(2," Scan Channel "),c()}}function it(i,a){if(i&1){let n=f();r(0,"button",20),g("click",function(){h(n);let t=p().ngIf,o=p(2);return u(o.onUpdateItems(t))}),x(1,"i",21),m(2," Update "),c()}}function ot(i,a){if(i&1&&(r(0,"div"),C(1,nt,3,0,"button",16)(2,it,3,0,"button",17),c()),i&2){let n=a.ngIf,e=p(2);l(1),s("ngIf",!e.productService.hasSelectionVariant(n)),l(1),s("ngIf",e.productService.hasSelectionVariant(n))}}function at(i,a){if(i&1){let n=f();r(0,"div",22)(1,"app-table",23),g("onToggle",function(t){h(n);let o=p(2);return u(o.onShowDifferencePrice(t))})("onSubmit",function(t){h(n);let o=p(2);return u(o.updatePriceByVariant(t))}),P(2,"async"),c()()}if(i&2){let n=p().ngIf,e=p();l(1),s("showProductToggle",!0)("data",v(2,4,e.paginationService.data$))("channel",n.Options.Channel)("filter",n.Filter)}}function rt(i,a){if(i&1){let n=f();r(0,"span",24),g("click",function(){h(n);let t=p(2);return u(t.getRowCount())}),r(1,"i",25),m(2,"?"),c()()}}function lt(i,a){if(i&1&&(r(0,"span"),m(1),P(2,"number"),c()),i&2){let n=a.ngIf;l(1),T(v(2,1,n))}}function ct(i,a){if(i&1){let n=f();r(0,"a",26),g("click",function(){h(n);let t=p(2);return u(t.onNextPage())}),x(1,"i",27),m(2," Next"),c()}}function st(i,a){if(i&1){let n=f();r(0,"a",28),g("click",function(){h(n);let t=p(2);return u(t.onLastPage())}),x(1,"i",29),m(2," Last"),c()}}function pt(i,a){if(i&1){let n=f();r(0,"mainpanel",1),g("onSubmit",function(t){h(n);let o=p();return u(o.onSearch(t))}),r(1,"actions")(2,"div",2),C(3,ot,3,2,"div",3),P(4,"async"),c()(),r(5,"filters")(6,"div",4)(7,"div")(8,"label"),m(9,"Page Number"),c(),r(10,"input",5),g("ngModelChange",function(t){h(n);let o=p();return u(o.searchFilter.PageNumber=t)}),c()(),r(11,"div")(12,"label"),m(13,"Page Size"),c(),r(14,"input",5),g("ngModelChange",function(t){h(n);let o=p();return u(o.searchFilter.RowCount=t)}),c()()()(),r(15,"content")(16,"div",6)(17,"div",7),C(18,at,3,6,"div",8),P(19,"async"),c(),r(20,"div",9)(21,"div",10)(22,"div",11),m(23),P(24,"number"),P(25,"async"),C(26,rt,3,0,"span",12)(27,lt,3,3,"span",3),P(28,"async"),m(29),c()(),r(30,"div",13),C(31,ct,3,0,"a",14)(32,st,3,0,"a",15),c()()()()()}if(i&2){let n=p(),e;s("pageData",n.pageData)("textButton","Search"),l(3),s("ngIf",v(4,12,n.paginationService.data$)),l(7),s("ngModel",n.searchFilter.PageNumber),l(4),s("ngModel",n.searchFilter.RowCount),l(4),s("ngIf",v(19,14,n.paginationService.data$)),l(5),I(" Showing 1 - ",v(24,16,(e=v(25,18,n.paginationService.data$))==null?null:e.length)," of "),l(3),s("ngIf",n.paginationService.hideCount),l(1),s("ngIf",!n.paginationService.hideCount&&v(28,20,n.allDataCount$)),l(2),I(" records ~ ",n.paginationService.footerPageNumber," Page "),l(2),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),l(1),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}var He=(()=>{let a=class a{constructor(e,t,o,d,_){this.http=e,this.toastr=t,this.dialog=o,this.paginationService=d,this.productService=_,this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.filterOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]}}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.getDataAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(q(e=>{this.channelOptions=e.Options.Channel,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)}openScanDialog(){this.searchFilter.ChannelID=w.GuidEMpty;let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(pe,{data:{filter:e,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(D(o=>w.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.initPageLoader(),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)}})}updatePrice(e){let t=this.productService.selectedVariantProduct(e);if(t.length>0){let d=t.map(S=>({ID:S.ID,Code:S.Code,Price:S.UnitPrice}));var o=this.channelOptions.filter(S=>S.selected).map(S=>S.ID);let _={ListChannelID:o,ListPrice:d};this.http.post("/api/Price/UpdateChannel",_).subscribe(S=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+_.ListPrice.length+" items in "+_.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(o=>{let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+d.Name+" to "+t.Price,"Success"),this.paginationService.reloadPagination(this.searchFilter)})}onUpdateItems(e){let t=this.productService.selectedVariantProduct(e);this.dialog.open(_e,{data:{selectedItems:t,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(D(o=>o!==void 0)).subscribe(o=>{this.channelOptions=o,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()}};a.\u0275fac=function(t){return new(t||a)(b(j),b(B),b(K),b(de),b(G))},a.\u0275cmp=V({type:a,selectors:[["app-price-pos-channel"]],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"pageData","textButton","onSubmit"],[1,"d-flex"],[4,"ngIf"],["container",""],["type","number",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],["class","col-md-12",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"showProductToggle","data","channel","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(t,o){t&1&&(C(0,pt,33,22,"mainpanel",0),P(1,"async")),t&2&&s("ngIf",v(1,1,o.loader$))},dependencies:[U,ie,oe,k,N,z,ue,ee,R],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=a;return i})();function mt(i,a){if(i&1&&(r(0,"mat-radio-button",3),m(1),c()),i&2){let n=a.$implicit,e=a.index,t=p();s("value",n.Key)("name",t.name)("title",t.tooltipsText[e]?t.tooltipsText[e]:""),l(1),I(" ",n.Value,"")}}var dt=i=>({"border-0 rounded":i}),Ce=(()=>{let a=class a{constructor(){this.modelChange=new Ie,this.border=!1,this.tooltipsText=[]}change(e){this.modelChange.emit(e)}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=V({type:a,selectors:[["radio-options"]],inputs:{model:"model",options:"options",border:"border",name:"name",tooltipsText:"tooltipsText"},outputs:{modelChange:"modelChange"},standalone:!0,features:[ye],decls:3,vars:5,consts:[[1,"form-control","h-100",3,"ngClass"],[3,"ngModel","ngModelChange"],["class","me-5","data-toggle","tooltip","data-placement","right",3,"value","name","title",4,"ngFor","ngForOf"],["data-toggle","tooltip","data-placement","right",1,"me-5",3,"value","name","title"]],template:function(t,o){t&1&&(r(0,"div",0)(1,"mat-radio-group",1),g("ngModelChange",function(_){return o.change(_)}),C(2,mt,2,4,"mat-radio-button",2),c()()),t&2&&(s("ngClass",y(3,dt,o.border==!1)),l(1),s("ngModel",o.model),l(1),s("ngForOf",o.options))},dependencies:[L,$,A,Ae,Oe,$e,ae,k,N],styles:[".mat-radio-label{margin-top:auto;margin-bottom:auto}"]});let i=a;return i})();function Ct(i,a){if(i&1){let n=f();r(0,"button",18),g("click",function(){h(n);let t=p();return u(t.onUpdateItems())}),x(1,"i",19),m(2," Update "),c()}}function ft(i,a){if(i&1&&(r(0,"th",20),m(1),c()),i&2){let n=a.$implicit;l(1),T(n.Name)}}function xt(i,a){if(i&1){let n=f();r(0,"th")(1,"input",21),g("ngModelChange",function(t){h(n);let o=p();return u(o.checkboxState=t)})("ngModelChange",function(){h(n);let t=p();return u(t.onSelectAllData())}),c()()}if(i&2){let n=p();l(1),s("ngModel",n.checkboxState)}}function St(i,a){i&1&&(F(0),r(1,"th",22),m(2," Expected (POS) "),c(),r(3,"th",22),m(4," Channel "),c(),M())}function Pt(i,a){if(i&1){let n=f();r(0,"img",35),g("click",function(t){h(n);let o=p(3).$implicit,d=p();return u(d.onZoomImage(t,o==null?null:o.ImageUrl))}),c()}if(i&2){let n=p(3).$implicit;W("src",n==null?null:n.ImageUrl,E)}}function vt(i,a){i&1&&x(0,"img",36)}var bt=i=>({"border-bottom":i});function It(i,a){if(i&1&&(F(0),r(1,"td",30),C(2,Pt,1,1,"img",31)(3,vt,1,0,"ng-template",null,32,Y),c(),r(5,"td",33)(6,"h5",34),m(7),c(),x(8,"br"),r(9,"small"),m(10),c()(),M()),i&2){let n=H(4),e=p().index,t=p().$implicit,o=p();l(1),s("rowSpan",t==null?null:t.Variants.length)("ngClass",y(7,bt,e+1==o.products.length)),l(1),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),l(3),s("rowSpan",t==null?null:t.Variants.length),l(2),T(t==null?null:t.Name),l(3),I("(",t==null?null:t.Category,")")}}function yt(i,a){if(i&1){let n=f();r(0,"td",37)(1,"input",21),g("ngModelChange",function(t){h(n);let o=p().$implicit;return u(o.selected=t)}),c()()}if(i&2){let n=p().$implicit;l(1),s("ngModel",n.selected)}}var wt=i=>({"bg-gradient-warning":i});function Tt(i,a){if(i&1){let n=f();F(0),r(1,"td",40),m(2),P(3,"number"),c(),r(4,"td",41),g("click",function(){let o=h(n).$implicit,d=p(2).$implicit,_=p().$implicit,S=p();return u(S.openTableDialog(d,_,o))}),r(5,"span",42),m(6),P(7,"number"),c(),r(8,"a",43),g("click",function(t){return t==null?null:t.stopPropagation()}),x(9,"i",29),c()(),M()}if(i&2){let n=a.$implicit;l(2),I(" ",v(3,4,n.PriceExpected)," "),l(2),s("ngClass",y(8,wt,n.Price!=n.PriceExpected)),l(2),I(" ",v(7,6,n.Price)," "),l(2),s("href",n.Url,E)}}function Dt(i,a){i&1&&(r(0,"td",44),m(1,"X"),c(),r(2,"td",44),m(3,"X"),c())}function Vt(i,a){if(i&1&&(F(0),C(1,Tt,10,10,"ng-container",38)(2,Dt,4,0,"ng-template",null,39,Y),M()),i&2){let n=a.$implicit,e=H(3),t=p().$implicit,o=p(2);l(1),s("ngIf",o.getItemFromChannel(t,n.ID))("ngIfElse",e)}}var Et=i=>({"text-decoration-line-through":i}),Ye=i=>[i];function Ft(i,a){if(i&1&&(r(0,"tr"),C(1,It,11,9,"ng-container",23),r(2,"td",24),m(3),c(),r(4,"td",25)(5,"span",26),m(6),c(),r(7,"span",27)(8,"a",28),x(9,"i",29),c()()(),C(10,yt,2,1,"ng-template",16)(11,Vt,4,2,"ng-container",17),c()),i&2){let n=a.$implicit,e=a.index,t=p(2);l(1),s("ngIf",e==0),l(2),T(n==null?null:n.Model),l(1),s("matTooltip",n.isDiscontinued?t.discontinuedVariantMsg:""),l(1),s("ngClass",y(8,Et,n.isDiscontinued)),l(1),T(n==null?null:n.Code),l(2),s("href","https://"+t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),E),l(2),s("ngxPermissionsOnly",y(10,Ye,t.rolePriceEdit)),l(1),s("ngForOf",t.channelOptions)}}function Mt(i,a){if(i&1&&(r(0,"tbody"),C(1,Ft,12,12,"tr",17),c()),i&2){let n=a.$implicit;l(1),s("ngForOf",n.Variants)}}var Ze=(()=>{let a=class a{constructor(e,t,o,d,_){this.http=e,this.toastr=t,this.dialog=o,this.productService=d,this.biggerPictureService=_,this.searchFilter=new Ne,this.products=[],this.checkboxState=!1,this.rolePriceEdit=re.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.initPageLoader(),this.filterTypeOptions=[{Key:O.ALL,Value:"All"},{Key:O.DIFFERENCE,Value:"Difference"}],this.filterType=O.ALL,this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.hostName=d.getHostName()}initPageLoader(){this.http.post("/api/PriceLoader/LoadMultiple",{}).subscribe(e=>{this.channelOptions=e.Options.Channel,this.searchFilter=e.Filter,this.onFilter()})}onSelectAllData(){this.products=this.products.map(e=>(e.Variants&&(e.Variants=e.Variants.map(t=>(t.selected=this.checkboxState,t))),e))}onFilter(e){let t={text:e,filterModel:this.filterType,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount};this.http.post("/api/Price/GetOutletPrice",t).pipe(Z(o=>(o.Data=o.Data.map(d=>(d.Variants=d.Variants.map(_=>(_.isDiscontinued=_.Discontinued=="Yes",_)),d)),o.Data))).subscribe(o=>{this.products=o})}updatePrice(){let e=this.productService.selectedVariantProduct(this.products);if(e.length>0){let t=e.map(_=>_.ID),d={ListChannelID:this.channelOptions.filter(_=>_.selected).map(_=>_.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:_=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:_=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,t){return e.Channel.find(o=>o.ChannelID==t)}onUpdateItems(){let e=this.productService.selectedVariantProduct(this.products);this.dialog.open(_e,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(D(t=>w.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice()})}openTableDialog(e,t,o){let d=JSON.parse(JSON.stringify(e));this.dialog.open(he,{data:{Name:t.Name,Variant:d,ChannelID:o?.ChannelID,Table:"price",ChannelItemID:o?.ChannelItemID}}).afterClosed().pipe(D(S=>w.IsNotEmpty(S))).subscribe(S=>{this.updateProductPrice(S,o)})}updateProductPrice(e,t){let o={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",o).subscribe(d=>{t.Price=o.Price;let _=this.productService.findChannelById(o.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${_.Name} to ${o.Price}`,"Success")})}onZoomImage(e,t){this.biggerPictureService.openBiggerPicture(e,t)}};a.\u0275fac=function(t){return new(t||a)(b(j),b(B),b(K),b(G),b(me))},a.\u0275cmp=V({type:a,selectors:[["app-custom-channel-price"]],decls:30,vars:14,consts:[["headerTitle","Price Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],["container",""],["name","filterModel",3,"model","options","border","modelChange"],[1,"d-flex"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","5"],["scope","col","colspan","2","class","text-center border-bottom-0 border w-10 text-uppercase",4,"ngFor","ngForOf"],["scope","col","colspan","2",1,"text-center","w-20"],["scope","col",1,"text-start"],["scope","col",1,"text-start","w-10"],[3,"ngxPermissionsOnly"],[4,"ngFor","ngForOf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","w-10","text-uppercase"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"text-end","border-top-0","border","w-10"],[4,"ngIf"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-start","border-bottom",3,"matTooltip"],[3,"ngClass"],[1,"ms-2"],["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"],["elsePic",""],[1,"text-center","border-bottom",3,"rowSpan"],[1,"mb-0","item-name"],[1,"border","rounded","w-img","cursor-pointer",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["elseCol",""],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"ngClass","click"],[1,"me-2"],["target","_blank",3,"href","click"],[1,"table-white","border","text-end",2,"color","red"]],template:function(t,o){t&1&&(r(0,"mainpanel",0),g("onSubmit",function(_){return o.onFilter(_)}),r(1,"filters")(2,"div",1)(3,"div")(4,"h6"),m(5,"Filter by"),c(),r(6,"radio-options",2),g("modelChange",function(_){return o.filterType=_}),c()()()(),r(7,"actions")(8,"div",3),C(9,Ct,3,0,"button",4),c()(),r(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr"),x(18,"th",11),C(19,ft,2,1,"th",12),c(),r(20,"tr")(21,"th",13),m(22,"Product"),c(),r(23,"th",14),m(24,"Variant"),c(),r(25,"th",15),m(26,"SKU"),c(),C(27,xt,2,1,"ng-template",16)(28,St,5,0,"ng-container",17),c()(),C(29,Mt,2,1,"tbody",17),c()()()()()()()),t&2&&(s("pageData",o.pageData)("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),l(6),s("model",o.filterType)("options",o.filterTypeOptions)("border",!0),l(3),s("ngIf",o.productService.hasSelectionVariant(o.products)),l(10),s("ngForOf",o.channelOptions),l(8),s("ngxPermissionsOnly",y(12,Ye,o.rolePriceEdit)),l(1),s("ngForOf",o.channelOptions),l(1),s("ngForOf",o.products))},dependencies:[$,A,U,ne,k,N,z,se,Ce,le,R],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=a;return i})();function kt(i,a){if(i&1){let n=f();r(0,"button",8),g("click",function(){h(n);let t=p(2).ngIf,o=p();return u(o.openScanDialog(t))}),x(1,"i",9),m(2," Scan Channel "),c()}}function Nt(i,a){if(i&1){let n=f();r(0,"button",10),g("click",function(){h(n);let t=p().ngIf,o=p(2);return u(o.updateStock(t))}),x(1,"i",11),m(2," Update "),c()}}function Ot(i,a){if(i&1&&(r(0,"actions")(1,"div",5)(2,"div"),C(3,kt,3,0,"button",6)(4,Nt,3,0,"button",7),c()()()),i&2){let n=a.ngIf,e=p(2);l(3),s("ngIf",!e.productService.hasSelectionVariant(n)),l(1),s("ngIf",e.productService.hasSelectionVariant(n))}}function $t(i,a){if(i&1){let n=f();r(0,"th")(1,"input",32),g("change",function(t){h(n);let o=p().ngIf,d=p(2);return u(d.onSelectAllSKU(t.target.checked,o))}),c()()}}function At(i,a){if(i&1){let n=f();r(0,"input",52),g("ngModelChange",function(t){h(n);let o=p(4).$implicit;return u(o.selected=t)})("ngModelChange",function(){h(n);let t=p(4).$implicit,o=p(3);return u(o.onCheckboxStateProduct(t))}),c()}if(i&2){let n=p(4).$implicit;s("ngModel",n.selected)}}function Ut(i,a){if(i&1&&C(0,At,1,1,"input",51),i&2){let n=p(2).$implicit,e=p().$implicit;s("ngIf",n.Inventory>=0||e.Variants.length>1)}}function Rt(i,a){if(i&1){let n=f();r(0,"img",53),g("click",function(t){h(n);let o=p(3).$implicit,d=p(3);return u(d.onZoomImage(t,o==null?null:o.ImageUrl))}),c()}if(i&2){let n=p(3).$implicit;W("src",n.ThumbnailUrl,E)}}function Lt(i,a){i&1&&x(0,"img",54)}var ve=i=>[i];function Bt(i,a){if(i&1&&(F(0),r(1,"td",45)(2,"div",46),C(3,Ut,1,1,"ng-template",21)(4,Rt,1,1,"img",47)(5,Lt,1,0,"ng-template",null,48,Y),c()(),r(7,"td",49)(8,"span",50),m(9),c(),x(10,"br"),r(11,"small"),m(12),c()(),M()),i&2){let n=H(6),e=p(2).$implicit,t=p(3);l(1),s("rowSpan",e.Variants.length),l(2),s("ngxPermissionsOnly",y(7,ve,t.rolePriceEdit)),l(1),s("ngIf",e.ThumbnailUrl)("ngIfElse",n),l(3),s("rowSpan",e.Variants.length),l(2),T(e.Name),l(3),I("(",e.Category,")")}}function jt(i,a){if(i&1){let n=f();r(0,"input",57),g("ngModelChange",function(t){h(n);let o=p(2).$implicit;return u(o.selected=t)}),c()}if(i&2){let n=p(2).$implicit;s("ngModel",n.selected)}}function zt(i,a){if(i&1&&(r(0,"td",55),C(1,jt,1,1,"input",56),c()),i&2){let n=p().$implicit;l(1),s("ngIf",n.Inventory>=0)}}function Kt(i,a){if(i&1){let n=f();r(0,"div",58),g("click",function(){h(n);let t=p().$implicit,o=p().$implicit,d=p(2).ngIf,_=p();return u(_.openTableDialog(t,o,d))}),m(1),P(2,"number"),c()}if(i&2){let n=p().$implicit;l(1),I(" ",v(2,1,n.Channel[0]==null?null:n.Channel[0].Price)," ")}}var Gt=i=>({"text-decoration-line-through":i}),Jt=i=>({"bg-gradient-warning":i});function Ht(i,a){if(i&1){let n=f();r(0,"tr"),C(1,Bt,13,9,"ng-container",4),r(2,"td",19),m(3),c(),r(4,"td",33)(5,"span",34),m(6),c(),r(7,"span",35)(8,"a",36),x(9,"i",37),c()()(),C(10,zt,2,1,"ng-template",21),r(11,"td",22),m(12),P(13,"number"),c(),r(14,"td",38),C(15,Kt,3,3,"div",39),c(),r(16,"td")(17,"div",40)(18,"div",41)(19,"a",36),x(20,"i",42),c(),m(21," \xA0\xA0 "),r(22,"span",43),g("click",function(){let o=h(n).$implicit,d=p(4);return u(d.refreshPrice(o))}),x(23,"i",44),c()()()()()}if(i&2){let n=a.$implicit,e=a.index,t=p(4);l(1),s("ngIf",e==0),l(2),T(n.Model),l(1),s("matTooltip",n.isDiscontinued?t.discontinuedVariantMsg:""),l(1),s("ngClass",y(13,Gt,n.isDiscontinued)),l(1),I(" ",n.Code," "),l(2),s("href","https://"+t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),E),l(2),s("ngxPermissionsOnly",y(15,ve,t.rolePriceEdit)),l(2),I(" ",v(13,11,n.UnitPrice)," "),l(2),s("ngClass",y(17,Jt,n.UnitPrice!=(n.Channel[0]==null?null:n.Channel[0].Price))),l(1),s("ngIf",n.Channel.length>0),l(4),s("href",n.Channel[0]==null?null:n.Channel[0].Url,E)}}function Yt(i,a){if(i&1&&(F(0),C(1,Ht,24,19,"tr",26),M()),i&2){let n=a.$implicit;l(1),s("ngForOf",n.Variants)}}function Zt(i,a){if(i&1){let n=f();r(0,"span",58),g("click",function(){h(n);let t=p(3);return u(t.getRowCount())}),r(1,"i",59),m(2,"?"),c()()}}function qt(i,a){if(i&1&&(r(0,"span"),m(1),P(2,"number"),c()),i&2){let n=a.ngIf;l(1),T(v(2,1,n.Total))}}function Xt(i,a){if(i&1){let n=f();r(0,"a",63),g("click",function(){h(n);let t=p(4);return u(t.onNextPage())}),x(1,"i",64),m(2," Next"),c()}}function Qt(i,a){if(i&1){let n=f();r(0,"a",65),g("click",function(){h(n);let t=p(4);return u(t.onLastPage())}),x(1,"i",66),m(2," Last"),c()}}function Wt(i,a){if(i&1&&(r(0,"div",60),C(1,Xt,3,0,"a",61)(2,Qt,3,0,"a",62),c()),i&2){let n=p(3);l(1),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),l(1),s("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function en(i,a){if(i&1){let n=f();r(0,"content")(1,"div",12)(2,"div",13)(3,"table",14)(4,"thead",15)(5,"tr")(6,"th",16),m(7," Product "),r(8,"div")(9,"mat-slide-toggle",17),g("ngModelChange",function(t){h(n);let o=p(2);return u(o.toggleDifferentInventory=t)})("toggleChange",function(){h(n);let t=p(2);return u(t.onToggleDifferentInventory())}),r(10,"small",18),m(11,"FILTER DIFFERENT PRICE"),c()()()(),r(12,"th",19),m(13,"Variant"),c(),r(14,"th",20),m(15,"SKU"),c(),C(16,$t,2,0,"ng-template",21),r(17,"th",22),m(18,"POS"),c(),r(19,"th",22)(20,"div",23),g("click",function(){h(n);let t=p(2);return u(t.onChangeChannel())}),x(21,"img",24),m(22),c()(),x(23,"th",25),c()(),r(24,"tbody"),C(25,Yt,2,1,"ng-container",26),c()(),r(26,"div",27)(27,"div",28)(28,"div",29),m(29),P(30,"number"),C(31,Zt,3,0,"span",30)(32,qt,3,3,"span",4),P(33,"async"),m(34),c()(),C(35,Wt,3,2,"div",31),c()()()()}if(i&2){let n=a.ngIf,e=p(2);l(9),s("ngModel",e.toggleDifferentInventory),l(7),s("ngxPermissionsOnly",y(15,ve,e.rolePriceEdit)),l(4),s("matTooltip","Change "+(e.selectedChannel==null?null:e.selectedChannel.Name)),l(1),s("src",e.selectedChannel.logo,E),l(1),I(" ",e.selectedChannel!=null&&e.selectedChannel.Name?e.selectedChannel==null?null:e.selectedChannel.Name:"Choose Channel ..."," "),l(3),s("ngForOf",n),l(4),I(" Showing 1 - ",v(30,11,n==null?null:n.length)," of "),l(2),s("ngIf",e.paginationService.hideCount),l(1),s("ngIf",v(33,13,!e.paginationService.hideCount&&e.allDataCount$)),l(2),I(" records ~ ",e.paginationService.footerPageNumber," Page "),l(1),s("ngIf",n.length>0)}}function tn(i,a){if(i&1){let n=f();r(0,"mainpanel",1),g("textChange",function(t){h(n);let o=p();return u(o.searchFilter.text=t)})("onSubmit",function(){h(n);let t=p();return u(t.search())}),r(1,"filters")(2,"div",2)(3,"div")(4,"label"),m(5,"Page Number"),c(),r(6,"input",3),g("ngModelChange",function(t){h(n);let o=p();return u(o.searchFilter.PageNumber=t)}),c()(),r(7,"div")(8,"label"),m(9,"Page Size"),c(),r(10,"input",3),g("ngModelChange",function(t){h(n);let o=p();return u(o.searchFilter.RowCount=t)}),c()()()(),C(11,Ot,5,2,"actions",4),P(12,"async"),C(13,en,36,17,"content",4),P(14,"async"),c()}if(i&2){let n=p();s("headerTitle",n.pageTitle)("text",n.searchFilter.text),l(6),s("ngModel",n.searchFilter.PageNumber),l(4),s("ngModel",n.searchFilter.RowCount),l(1),s("ngIf",v(12,6,n.data$)),l(2),s("ngIf",v(14,8,n.data$))}}var qe=(()=>{let a=class a{constructor(e,t,o,d,_,S,We){this.http=e,this.paginationService=t,this.toastr=o,this.dialog=d,this.productService=_,this.biggerPictureService=S,this.inventoryService=We,this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.allDataCountEndpoint="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=re.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.productService.getHostName(),this.data$=this.paginationService.data$.pipe(be(1),Z(et=>et.map(fe=>(fe.Variants=fe.Variants.map(xe=>(xe.isDiscontinued=xe.Discontinued=="Yes",xe)),fe))))}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(q(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=O.ALL,this.paginationService.reloadPagination(this.searchFilter),this.channelOptions=e.Options.Channel,this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=O.ALL:this.searchFilter.filterModel=O.DIFFERENCE,this.search()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(t=>(t.selected=e.selected,t))}openScanDialog(e){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=w.GuidEMpty,this.dialog.open(pe,{data:{filter:t,channelOptions:e.Options.Channel},width:"600px"}).afterClosed().pipe(D(o=>w.IsNotEmpty(o))).subscribe(o=>{this.searchFilter.ChannelID=o.ChannelID,this.searchFilter.ScanFull=o.ScanFull,this.searchFilter.UpdatedProduct=o.UpdatedProduct,this.searchFilter.Async=o.Async,this.scanAll(e)})}scanAll(e){let t=this.productService.findChannelById(this.searchFilter.ChannelID,e.Options.Channel);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(o=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(),this.toastr.success(`Successfully scanned from ${t?.Name}`,"Success"))})}updateStock(e){let o=this.productService.selectedVariantProduct(e).map(_=>({ID:_.ID,ChannelID:_.Channel[0].ChannelID,Code:_.Code,Price:_.UnitPrice})),d={ListChannelID:[this.searchFilter.ChannelID],ListPrice:o};this.http.post("/api/Price/UpdateChannel",d).subscribe(_=>{this.search(),this.handlingUpdateStock(_.Response)})}handlingUpdateStock(e){if(e.success_list.length>0||e.failure_list.length>0){let t=e.failure_list,o=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",o,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(o=>{this.toastr.success("Successfully updated","Success"),this.search()})}search(){this.paginationService.reloadPagination(this.searchFilter)}getRowCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}onLastPage(){this.http.post(`/API/${this.allDataCountEndpoint}`,this.searchFilter).subscribe({next:e=>{this.paginationService.getAllData(this.searchFilter,e.Total)}})}openTableDialog(e,t,o){let d=JSON.parse(JSON.stringify(e));this.dialog.open(he,{data:{Name:t.Name,Variant:d,ChannelID:d?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:d?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(D(S=>w.IsNotEmpty(S))).subscribe(S=>{this.updateItemAfterDialog(S,o,e)})}updateItemAfterDialog(e,t,o){let d={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",d).subscribe(_=>{let S=this.productService.findChannelById(d.ID,t.Options.Channel);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${S.Name} to ${d.Price}`,"Success"),o.Channel[0]&&(o.Channel[0].Price=d.Price)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID),this.selectedChannel&&(this.selectedChannel.logo=w.getChannelLogoByTypeId(this.selectedChannel.TypeID))}onChangeChannel(){this.dialog.open(Be,{data:{channelOptions:this.channelOptions,selectedChannel:this.selectedChannel}}).afterClosed().pipe(D(e=>w.IsNotEmpty(e))).subscribe(e=>{this.selectedChannel=e,this.searchFilter.ChannelID=e.ID,this.search()})}onSelectAllSKU(e,t){t=t.map(o=>(o.Variants=o.Variants.map(d=>(d.selected=e,d)),o))}onZoomImage(e,t){this.biggerPictureService.openBiggerPicture(e,t)}ngOnDestroy(){this.paginationService.destroy()}};a.\u0275fac=function(t){return new(t||a)(b(j),b(de),b(B),b(K),b(G),b(me),b(ge))},a.\u0275cmp=V({type:a,selectors:[["app-price-single-channel"]],decls:2,vars:3,consts:[[3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[3,"headerTitle","text","textChange","onSubmit"],["container",""],["type","number",3,"ngModel","ngModelChange"],[4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModel","ngModelChange","toggleChange"],[1,"fw-bold"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["matTooltipPosition","above",1,"d-inline-block","text-truncate","mt-3","cursor-pointer",2,"max-width","114px",3,"matTooltip","click"],[2,"width","16px",3,"src"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","checkbox",1,"me-3",3,"change"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[3,"ngClass"],[1,"ms-2"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-external-link-alt"],[1,"text-end",3,"ngClass"],["style","cursor: pointer;",3,"click",4,"ngIf"],[1,"row"],[1,"col-12","ps-0","d-flex","justify-content-between"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModel","ngModelChange"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(t,o){t&1&&(C(0,tn,15,10,"mainpanel",0),P(1,"async")),t&2&&s("ngIf",v(1,1,o.loader$))},dependencies:[$,A,U,ie,oe,ne,k,N,z,Re,se,le,ee,R],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=a;return i})();var Xe=(()=>{let a=class a{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"}]}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=V({type:a,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,o){t&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),x(3,"nav-tab",2),c()()(),x(4,"router-outlet")),t&2&&(l(3),s("Tabs",o.priceTabs))},dependencies:[Me,we]});let i=a;return i})();var nn=[{path:"",component:Xe,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",component:He,canActivate:[ce],data:{title:"Global Price Comparison"}},{path:"OutletPrice",component:Ze,canActivate:[ce],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",component:qe,canActivate:[ce],data:{title:"Price Single Channel Comparison"}}]}],Qe=(()=>{let a=class a{};a.\u0275fac=function(t){return new(t||a)},a.\u0275mod=Q({type:a}),a.\u0275inj=X({imports:[L,te.forChild(nn)]});let i=a;return i})();var ui=(()=>{let a=class a{};a.\u0275fac=function(t){return new(t||a)},a.\u0275mod=Q({type:a}),a.\u0275inj=X({providers:[ge],imports:[L,ae,ke,Fe,te,Ve,Qe,Te,Le,Ue,Ee,Ce,ue,De.forChild()]});let i=a;return i})();export{ui as PriceModule};