marketplacepos 5.37.4 → 5.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-JNMDGK2M.js → chunk-4QEOVQLZ.js} +1 -1
- package/Marketplace/{chunk-6ZT6G6ZX.js → chunk-622VL2HU.js} +1 -1
- package/Marketplace/{chunk-RDBEJJXU.js → chunk-65GOHJMV.js} +1 -1
- package/Marketplace/{chunk-IPEOCIUA.js → chunk-6CLQ6MPF.js} +1 -1
- package/Marketplace/{chunk-XDB5B4VD.js → chunk-AH6GCKKU.js} +1 -1
- package/Marketplace/{chunk-LBCJNHNR.js → chunk-BD37MB7I.js} +1 -1
- package/Marketplace/{chunk-ZEWJSXKY.js → chunk-C2HP2BMZ.js} +1 -1
- package/Marketplace/{chunk-WU7L6NYM.js → chunk-D77TYLTT.js} +2 -2
- package/Marketplace/{chunk-SE5GYDNR.js → chunk-DHI45KAU.js} +1 -1
- package/Marketplace/{chunk-76DD4KTI.js → chunk-FAHAXTSA.js} +1 -1
- package/Marketplace/{chunk-RX6VZ4IG.js → chunk-GLXVYGIZ.js} +1 -1
- package/Marketplace/{chunk-VOCVNYLC.js → chunk-H2ARBTXG.js} +1 -1
- package/Marketplace/{chunk-F3YTGLZT.js → chunk-HXKFLOFX.js} +1 -1
- package/Marketplace/chunk-I6PVQBH3.js +1 -0
- package/Marketplace/{chunk-PNPQ4ROP.js → chunk-KE4XRFTW.js} +1 -1
- package/Marketplace/{chunk-O55WNQN7.js → chunk-NEWP5HCV.js} +1 -1
- package/Marketplace/{chunk-MH5AVQJR.js → chunk-NTEZHLGS.js} +2 -2
- package/Marketplace/{chunk-3DEMAMTN.js → chunk-OKIJSTL2.js} +1 -1
- package/Marketplace/{chunk-GVAPYZ7X.js → chunk-PP7SYNKI.js} +1 -1
- package/Marketplace/{chunk-K27IWV7V.js → chunk-S47D7FK6.js} +1 -1
- package/Marketplace/{chunk-2IHMLXWJ.js → chunk-SLFWHPGC.js} +1 -1
- package/Marketplace/{chunk-JTETVWNX.js → chunk-SUR7PSDZ.js} +1 -1
- package/Marketplace/{chunk-AMVY4XMB.js → chunk-T7DQIAIU.js} +1 -1
- package/Marketplace/{chunk-T2UNTDY6.js → chunk-TMZC6XB5.js} +1 -1
- package/Marketplace/{chunk-7EO5MRBU.js → chunk-UGVPHSH5.js} +1 -1
- package/Marketplace/{chunk-7W2EWSOP.js → chunk-UMMHSYPY.js} +1 -1
- package/Marketplace/{chunk-K3RLIVYF.js → chunk-VOZRPECJ.js} +1 -1
- package/Marketplace/{chunk-RG5P2GM3.js → chunk-WOZRWYVI.js} +1 -1
- package/Marketplace/{chunk-H5DKI4F4.js → chunk-YEIDCIAG.js} +1 -1
- package/Marketplace/{chunk-7CIOGSCS.js → chunk-YNWF5MA2.js} +1 -1
- package/Marketplace/{chunk-YE6BUIS7.js → chunk-Z3XN3QX6.js} +1 -1
- package/Marketplace/{chunk-2Y4PYWHB.js → chunk-ZPZODNRB.js} +1 -1
- package/Marketplace/{chunk-74EGQDBL.js → chunk-ZQMYVBT2.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-6QPEM5JQ.js → main-GDCVUNTX.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-IVX7QWP7.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as r,i as C}from"./chunk-
|
|
1
|
+
import{h as r,i as C}from"./chunk-YNWF5MA2.js";import{b as l,e as S}from"./chunk-JSPVOV7M.js";import{b as a,c as u}from"./chunk-W6T7TOHE.js";import{aa as p,ea as h,ja as c,oa as o,v as s}from"./chunk-EIQCOZF5.js";var y=(()=>{class i{constructor(e,t,n){this.httpService=e,this.toastr=t,this.tokenService=n}saveChannel(e){return this.httpService.post("/api/Channel/SubmitChannel",e).pipe(p(t=>this.tokenService.refreshToken().pipe(s(n=>t))))}getLastSync(e){return this.httpService.get(`${r.ChannelGetLastSyncByID}/?ID=${e}`)}getChannel(e){return this.httpService.post(r.GetChannel,e)}getChannelLoader(){return this.httpService.get(r.GetChannelLoader)}testShopID(e){return this.httpService.post(r.TestShopID,e).pipe(h(t=>{this.showTostrSuccessTestShopID(t)}))}updateChannelIndex(e){return this.httpService.post(r.UpdateChannelIndex,e)}deleteChannel(e){return this.httpService.post(r.DeleteChannel,e)}mapChannelImage(e){return e.map(t=>(t.img=u.getChannelLogoByTypeId(t.TypeID),t))}showTostrSuccessTestShopID(e){let t="";for(var n in e)t+=n+" : "+e[n]+"<br/>";this.toastr.success(t,"Success",{enableHtml:!0,closeButton:!0,positionClass:"toast-bottom-right"})}getRegisterByOutletName(e){return this.httpService.post(r.GetRegisterByOutletName,{Outlet:e})}getChannelRowCount(e){return this.httpService.post(r.GetChannelRowCount,e).pipe(s(t=>t.Count))}getChannelWarehouse(e){return this.httpService.get(`${r.GetChannelWarehouse}/?ChannelID=${e}`)}unSynchronizedWarehouse(e){return this.httpService.delete(`${r.UnSynchronizedWarehouse}?ID=${e}`)}authorizedChannel(e){let t=this.getApiAuthorize(e);return this.httpService.post(`/api/${t}`,null).pipe(h(n=>{window.open(n.Url,"_blank")}))}getApiAuthorize(e){let t;switch(e){case a.Shopee:t="ChannelAuthorization/ShopeeV2_URL";break;case a.Tiktok:t="ChannelAuthorization/Tiktok_URL";break;case a.Lazada:t="ChannelAuthorization/Lazada_URL";break}return t}static{this.\u0275fac=function(t){return new(t||i)(o(S),o(l),o(C))}}static{this.\u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{y as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as E}from"./chunk-WNAVUGZ4.js";import{a as T}from"./chunk-EXFL3GUX.js";import{h as D,j as w}from"./chunk-
|
|
1
|
+
import{a as E}from"./chunk-WNAVUGZ4.js";import{a as T}from"./chunk-EXFL3GUX.js";import{h as D,j as w}from"./chunk-YNWF5MA2.js";import{b as j,e as s}from"./chunk-JSPVOV7M.js";import{b as i,c as m}from"./chunk-W6T7TOHE.js";import{G as C}from"./chunk-B6POIFQM.js";import{B as A,G as U,J as u,Qa as I,g as k,ja as p,pa as a,q as d,v as b}from"./chunk-EIQCOZF5.js";var F=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(o=>({value_id:o.value_id,name:o.name}))})),t}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var x=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(u(o=>d(null)))}generateAttribute(t){let e;return t.map(o=>(o.type=="PRODUCT_PROPERTY"?e={id:o.id,name:o.name,type:o.type,values:o.values}:e={id:o.id,name:o.values[0].id,type:o.type},e))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var z=(()=>{class r{constructor(){this.httpService=a(s)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var g=class{};var v=class{};var R=(()=>{class r{constructor(){this.httpService=a(s)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var G=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(u(o=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var O=(()=>{class r{constructor(){this.httpService=a(s)}uploadProduct(t){return this.httpService.post(D.UploadPlugoProduct,t).pipe(u(e=>d(null)))}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var Vt=(()=>{class r{constructor(){this.authService=a(w),this.productService=a(T),this.shoppeUploadService=a(F),this.tiktokUploadService=a(x),this.lazadaUploadService=a(H),this.tokopediaUploadService=a(R),this.wooUploadService=a(z),this.shopifyUploadService=a(G),this.plugoUploadService=a(O),this.toastrHandlingService=a(E),this.toastr=a(j),this.router=a(C),this.httpService=a(s),this._selectedProduct=new k(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(U(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return I(t.map(o=>{let c=new g;return c.id=o.ID,c.name=o.Name,c.type=o.TypeID,c.categoryId=null,c.attributes=[],c.selected=!1,c}))}onUploadProduct(t){let e=t.filter(o=>o.selected&&m.IsNotEmpty(o.categoryId)||o.selected&&(o.type==i.Shopify||o.type==i.Plugo));if(e.length>0){let o=this.generateDataForUpload(e);this.uploadProduct(o)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);A(e).pipe(b(o=>{let c=[];return o.forEach(f=>{c=[...c,...f]}),c})).subscribe({next:(o=[])=>{m.IsNotEmpty(o)&&this.toastrHandlingService.showToastrUploadMultiple(o),this.hasSuccessRes(o)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(o=>{o?.Response.Success_list?.length>0&&m.IsNotEmpty(o)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],o=[],c=[],f=[],S=[],y=[],P=[];t.forEach(l=>{switch(l.ChannelType){case i.Shopee:o.push(l);break;case i.Tiktok:e.push(l);break;case i.Lazada:c.push(l);break;case i.Tokopedia:f.push(l);break;case i.WooCommerce:S.push(l);break;case i.Shopify:y.push(l);break;case i.Plugo:P.push(l);break}});let n=[];return[{type:i.Shopee,data:o},{type:i.Tiktok,data:e},{type:i.Lazada,data:c},{type:i.Tokopedia,data:f},{type:i.WooCommerce,data:S},{type:i.Shopify,data:y},{type:i.Plugo,data:P}].filter(l=>l.data.length>0).forEach(l=>{switch(l.type){case i.Shopee:n.push(this.shoppeUploadService.uploadProduct(o));break;case i.Tiktok:n.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:n.push(this.lazadaUploadService.uploadProduct(c));break;case i.Tokopedia:n.push(this.tokopediaUploadService.uploadProduct(f));break;case i.WooCommerce:n.push(this.wooUploadService.uploadProduct(S));break;case i.Shopify:n.push(this.shopifyUploadService.uploadProduct(y));break;case i.Plugo:n.push(this.plugoUploadService.uploadProduct(P));break}}),n}generateDataForUpload(t){let e=[];return t.forEach(o=>{let c=new v;c.ChannelID=o.id,c.ChannelType=o.type,c.Products=this._selectedProduct.getValue(),o.type==i.Shopify?delete c.CategoryID:c.CategoryID=o.categoryId,o.type==i.WooCommerce||o.type==i.Shopify?c.Attribute=o.attributes[0]:c.Attributes=this.formatAttributes(o.type,o.attributes),e.push(c)}),e}formatAttributes(t,e){let o;switch(t){case i.Shopee:o=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:o=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:o=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:o=e;break;case i.Shopify:o=e;break;default:o=[];break}return o}static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275prov=p({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{F as a,x as b,H as c,z as d,Vt as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as X}from"./chunk-
|
|
1
|
+
import{a as X}from"./chunk-SUR7PSDZ.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-YNWF5MA2.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 ie}from"./chunk-6HVHZ3HN.js";import{a as ae,b as le}from"./chunk-YQSHLQDX.js";import"./chunk-OVYL7SOO.js";import"./chunk-T7KM2WP6.js";import"./chunk-VOISFPEM.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as oe,b as re}from"./chunk-WYOXUN3H.js";import"./chunk-23MIIDCT.js";import"./chunk-SD7UKXTX.js";import"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as X,b as Z,d as $,e as ee}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as Q}from"./chunk-
|
|
1
|
+
import{a as ie}from"./chunk-6HVHZ3HN.js";import{a as ae,b as le}from"./chunk-YQSHLQDX.js";import"./chunk-OVYL7SOO.js";import"./chunk-T7KM2WP6.js";import"./chunk-VOISFPEM.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as oe,b as re}from"./chunk-WYOXUN3H.js";import"./chunk-23MIIDCT.js";import"./chunk-SD7UKXTX.js";import"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as X,b as Z,d as $,e as ee}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as Q}from"./chunk-YNWF5MA2.js";import{e as K}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as te,m as ne}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as j,h as q,m as G,o as H,y as Y}from"./chunk-AI4XRCAL.js";import{c as J}from"./chunk-W6T7TOHE.js";import{H as A,J as U,f as W,g as F,k as B,m as k,n as z}from"./chunk-B6POIFQM.js";import{Dc as P,Eb as M,Ec as l,Fc as S,Gc as y,Ic as c,Jc as u,Kb as w,Kc as h,Oc as I,Wb as m,Xc as L,Yc as N,Zc as V,_c as R,gc as t,hc as n,ic as C,jc as T,kc as x,mc as O,ob as b,qb as r,rc as E,sc as v,wb as D,ya as p,za as s}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var de=a=>({ID:a});function me(a,f){if(a&1&&(t(0,"span",17),C(1,"img",18),n(),l(2)),a&2){let e=f.item;r(),m("src",e.Img,b)("alt",e.Name),r(),y(" ",e.Name," ")}}function pe(a,f){if(a&1&&(t(0,"tr")(1,"td"),l(2),n(),t(3,"td"),C(4,"img",28),n(),t(5,"td"),l(6),n(),t(7,"td",29)(8,"a",30),l(9),L(10,"number"),n()(),t(11,"td"),l(12),n(),t(13,"td"),l(14),L(15,"date"),n()()),a&2){let e=f.$implicit;r(2),S(e._source.ChannelName),r(2),m("src",e.logo,b),r(2),S(e._source.DateRange),r(2),m("queryParams",I(12,de,e._source.ID)),r(),y(" ",N(10,7,e._source.CountOrder)," "),r(3),S(e._source.UserLogin),r(2),y(" ",V(15,9,e._source["@timestamp_received"],"dd MMM yyyy hh:mm")," ")}}function se(a,f){if(a&1){let e=O();T(0),t(1,"div",19)(2,"table",20)(3,"thead")(4,"tr",21)(5,"th",22),l(6,"Channel"),n(),t(7,"th",23),l(8,"Type"),n(),t(9,"th",24),l(10,"Download Date Range"),n(),t(11,"th",25),l(12,"Count"),n(),t(13,"th"),l(14,"User Login"),n(),t(15,"th"),l(16,"Created"),n()()(),t(17,"tbody"),w(18,pe,16,14,"tr",26),n()(),t(19,"mat-paginator",27),E("page",function(i){p(e);let d=v();return s(d.onPaginationChange(i))}),n()(),x()}if(a&2){let e=v();r(18),m("ngForOf",e.downloadOrders),r(),m("length",e.paginationTotal)("pageSize",e.paginationPageSize)("pageIndex",(e.filter==null?null:e.filter.PageNumber)==0?0:(e.filter==null?null:e.filter.PageNumber)-1)}}function ge(a,f){a&1&&(t(0,"div",31),C(1,"app-empty-state"),n())}var Ie=(()=>{class a{constructor(e,g){this.http=e,this.authService=g,this.filter={PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""},this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(e=>{this.filter=e.Filter,this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter).subscribe(e=>{this.downloadOrders=e.hits,this.setChannelLogo(),this.paginationTotal=e.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}setChannelLogo(){this.downloadOrders=this.downloadOrders.map(e=>(e.logo=J.getChannelLogoByTypeId(e._source.TypeID),e))}onPaginationChange(e){this.filter.PageNumber=e.pageIndex+1,this.getDownloadOrders()}static{this.\u0275fac=function(g){return new(g||a)(D(K),D(Q))}}static{this.\u0275cmp=M({type:a,selectors:[["app-download-order-log"]],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[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","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/Order/Download_Order_Log/Detail",3,"queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(g,i){if(g&1){let d=O();t(0,"mainpanel",1),E("onSubmit",function(){return p(d),s(i.getDownloadOrders())}),t(1,"filters")(2,"div")(3,"label",2),l(4,"Channel"),n(),t(5,"ng-select",3),h("ngModelChange",function(o){return p(d),u(i.filter.ChannelID,o)||(i.filter.ChannelID=o),s(o)}),w(6,me,3,3,"ng-template",4),n()(),t(7,"div",5)(8,"label",6),l(9,"From/To"),n(),t(10,"div",7)(11,"datepicker",8),h("dateChange",function(o){return p(d),u(i.filter.From,o)||(i.filter.From=o),s(o)}),n()(),t(12,"div")(13,"datepicker",9),h("dateChange",function(o){return p(d),u(i.filter.To,o)||(i.filter.To=o),s(o)}),n()()(),t(14,"div",5)(15,"label",10),l(16,"Page Number"),n(),t(17,"input",11),h("ngModelChange",function(o){return p(d),u(i.filter.PageNumber,o)||(i.filter.PageNumber=o),s(o)}),n()(),t(18,"div",5)(19,"label",10),l(20,"Page Size"),n(),t(21,"input",12),h("ngModelChange",function(o){return p(d),u(i.filter.RowCount,o)||(i.filter.RowCount=o),s(o)}),n()()(),t(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),w(26,se,20,4,"ng-container",16)(27,ge,2,0,"ng-template",null,0,R),n()()()()()}if(g&2){let d=P(28);m("hideSearchBox",!0),r(5),m("clearable",!0)("items",i.channelOptions),c("ngModel",i.filter.ChannelID),r(6),c("date",i.filter.From),r(2),c("date",i.filter.To),r(4),c("ngModel",i.filter.PageNumber),r(4),c("ngModel",i.filter.RowCount),r(5),m("ngIf",(i.downloadOrders==null?null:i.downloadOrders.length)>0)("ngIfElse",d)}},dependencies:[z,W,F,k,B,re,oe,ne,te,ee,$,X,Z,Y,j,H,q,G,le,ae,U,A,ie],encapsulation:2})}}return a})();export{Ie as DownloadOrderLogComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as g}from"./chunk-
|
|
1
|
+
import{h as g}from"./chunk-YNWF5MA2.js";import{b as l,e as h}from"./chunk-JSPVOV7M.js";import{ja as c,oa as o}from"./chunk-EIQCOZF5.js";var S=(()=>{class n{constructor(r,t){this.toastrService=r,this.http=t}refreshInventory(r){let t=r.map(e=>e.Channel.map(a=>(a.VariantID=e.ID,a))).reduce((e,s)=>(e=e.concat(s),e),[]).map(e=>({ChannelItemID:e.ChannelItemID,ChannelID:e.ChannelID,VariantID:e.VariantID,ChannelVariationID:e.ChannelVariationID}));return this.http.post(g.RefreshInventory,t)}showToastrUpdateInventory(r,t,e){let s=t.length>0,a=e.length>0;if(!a&&s&&this.toastrService.success(`${this.generateSuccessMessage(t.length)}`,"Success",{enableHtml:!0}),a&&s){let i=`<li>${this.generateSuccessMessage(t.length)}</li>`,u=this.generateErrorMessage(r,e),m=`<ol>${i} ${u}</ol>`;this.toastrService.warning(m,"Warning",{enableHtml:!0})}if(a&&!s){let i=`<ol>${this.generateErrorMessage(r,e)}</ol>`;this.toastrService.error(i,"Error",{enableHtml:!0})}}generateSuccessMessage(r){return`
|
|
2
2
|
<div>
|
|
3
3
|
<span class="fw-bold">Successfully</span> updated ${r} variants in 1 channels
|
|
4
4
|
</div>
|
|
@@ -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-7CIOGSCS.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-YNWF5MA2.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 h,b as f}from"./chunk-ARIW575T.js";import{a as i}from"./chunk-
|
|
1
|
+
import{a as h,b as f}from"./chunk-ARIW575T.js";import{a as i}from"./chunk-DHI45KAU.js";import"./chunk-YNWF5MA2.js";import"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import"./chunk-W6T7TOHE.js";import{F as C,J as n,n as o}from"./chunk-B6POIFQM.js";import{Eb as l,Fb as c,Wb as s,gc as u,hc as d,ic as r,ka as p,qb as m}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var v=(()=>{class e{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"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,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,P){t&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),r(3,"nav-tab",2),d()()(),r(4,"router-outlet")),t&2&&(m(3),s("Tabs",P.priceTabs))},dependencies:[o,f,h,n,C],encapsulation:2})}}return e})();var M=[{path:"",component:v,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-65GOHJMV.js").then(e=>e.PricePosChannelComponent)},canActivate:[i],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-BD37MB7I.js").then(e=>e.CustomChannelPriceComponent)},canActivate:[i],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-Z3XN3QX6.js").then(e=>e.PriceSingleChannelComponent)},canActivate:[i],data:{title:"Price Single Channel Comparison"}}]}],j=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=c({type:e})}static{this.\u0275inj=p({imports:[o,n.forChild(M)]})}}return e})();export{j as PriceRoutingModule};
|