marketplacepos 5.37.0 → 5.37.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 (37) hide show
  1. package/Marketplace/{chunk-OCQD6PMZ.js → chunk-2H7UKR4Z.js} +1 -1
  2. package/Marketplace/{chunk-7UTZLQI6.js → chunk-3YRPTVAF.js} +1 -1
  3. package/Marketplace/{chunk-TF4BI2XD.js → chunk-4EWARO65.js} +1 -1
  4. package/Marketplace/{chunk-ITXEWTPA.js → chunk-64V4L3IJ.js} +1 -1
  5. package/Marketplace/{chunk-T2C2QH7B.js → chunk-77ESDFMO.js} +2 -2
  6. package/Marketplace/{chunk-A46FZGKG.js → chunk-AVSGKP57.js} +1 -1
  7. package/Marketplace/{chunk-QZDIKVMC.js → chunk-BTPFPDPR.js} +1 -1
  8. package/Marketplace/{chunk-LIEUAEW7.js → chunk-C4ESA6DM.js} +1 -1
  9. package/Marketplace/{chunk-2TAZ7EVF.js → chunk-CAGSG3DY.js} +1 -1
  10. package/Marketplace/{chunk-D2R7H4PZ.js → chunk-CIKNTHCR.js} +1 -1
  11. package/Marketplace/{chunk-72WUBVEI.js → chunk-D7G7GVNH.js} +1 -1
  12. package/Marketplace/{chunk-RO6HPA6M.js → chunk-F6Y7LJ64.js} +1 -1
  13. package/Marketplace/{chunk-XUPB6PPC.js → chunk-GG2SCXTS.js} +1 -1
  14. package/Marketplace/{chunk-S6AGBBNT.js → chunk-HETMK7WT.js} +1 -1
  15. package/Marketplace/chunk-I6PVQBH3.js +1 -0
  16. package/Marketplace/{chunk-IZARECBC.js → chunk-JGKNWNHJ.js} +1 -1
  17. package/Marketplace/{chunk-IIUCEXII.js → chunk-JJFRUJBP.js} +1 -1
  18. package/Marketplace/{chunk-VZBQMPS6.js → chunk-K7LGJFCY.js} +2 -2
  19. package/Marketplace/{chunk-GUDSPIQ4.js → chunk-KC2FFVLF.js} +1 -1
  20. package/Marketplace/{chunk-TESIDZXV.js → chunk-KEFQSTJD.js} +1 -1
  21. package/Marketplace/{chunk-XCM5Z3ZO.js → chunk-KSJLJ53O.js} +1 -1
  22. package/Marketplace/{chunk-CGGZVOPZ.js → chunk-MNMVQQPT.js} +1 -1
  23. package/Marketplace/{chunk-AUGXMJYD.js → chunk-MV2W43TI.js} +1 -1
  24. package/Marketplace/{chunk-UHQVAZB3.js → chunk-QP6X3QVC.js} +1 -1
  25. package/Marketplace/{chunk-2J4TQ5S7.js → chunk-R4FFSLZS.js} +1 -1
  26. package/Marketplace/{chunk-37YRCS7N.js → chunk-S45YFO7W.js} +1 -1
  27. package/Marketplace/{chunk-SZDSHN77.js → chunk-S4D2PHBV.js} +1 -1
  28. package/Marketplace/{chunk-IY224QZQ.js → chunk-TNQMLUO7.js} +1 -1
  29. package/Marketplace/{chunk-45NCWWK5.js → chunk-TR23CMVW.js} +1 -1
  30. package/Marketplace/{chunk-UX5Q3IK5.js → chunk-UI3RKKVM.js} +1 -1
  31. package/Marketplace/{chunk-DAM3G2L2.js → chunk-XJIHUZS4.js} +1 -1
  32. package/Marketplace/{chunk-EPPD6RR3.js → chunk-ZCGHEDGV.js} +1 -1
  33. package/Marketplace/{chunk-FDTJZH7Y.js → chunk-ZHKZ3QZP.js} +1 -1
  34. package/Marketplace/index.html +3 -3
  35. package/Marketplace/{main-FTJE6LDD.js → main-TSXSJ6BP.js} +1 -1
  36. package/package.json +1 -1
  37. package/Marketplace/chunk-IVX7QWP7.js +0 -1
@@ -1 +1 @@
1
- import{a as X}from"./chunk-DAM3G2L2.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-D2R7H4PZ.js";import{b as G,e as W}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{d as H,l as q,m as z}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as B,h as O,m as U,o as j,y as k}from"./chunk-AI4XRCAL.js";import"./chunk-W6T7TOHE.js";import{g as R,j as L,m as x,n as A}from"./chunk-B6POIFQM.js";import{Eb as N,Ec as g,G as V,Ic as S,Jc as v,Kb as f,Kc as y,Mc as E,Wb as u,Xc as _,Yc as C,Z as T,ea as F,gc as a,hc as p,ic as I,mc as b,pa as M,qb as d,rc as P,sc as o,wb as h,ya as s,za as l}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";function Z(r,w){if(r&1){let e=b();a(0,"button",15),P("click",function(){s(e);let t=o().ngIf,n=o(2);return l(n.onUpdateItems(t))}),I(1,"i",16),g(2," Update "),p()}}function ee(r,w){if(r&1&&(a(0,"div"),f(1,Z,3,0,"button",14),p()),r&2){let e=w.ngIf,i=o(2);d(),u("ngIf",i.productService.hasSelectionVariant(e))}}function te(r,w){if(r&1){let e=b();a(0,"mainpanel",1),P("onSubmit",function(t){s(e);let n=o();return l(n.onSearch(t))}),a(1,"actions")(2,"div",2),f(3,ee,2,1,"div",3),_(4,"async"),a(5,"button",4),P("click",function(){s(e);let t=o();return l(t.openExportDialog())}),I(6,"i",5),a(7,"span"),g(8,"Export"),p()()()(),a(9,"filters")(10,"div")(11,"label",6),g(12,"Page Number"),p(),a(13,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),l(t)}),p()(),a(14,"div",8)(15,"label",6),g(16,"Page Size"),p(),a(17,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),l(t)}),p()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),_(23,"async"),P("onToggle",function(t){s(e);let n=o();return l(n.onShowDifferencePrice(t))})("onSubmit",function(t){s(e);let n=o();return l(n.updatePriceByVariant(t))}),p(),a(24,"infinite-paginator",13),_(25,"async"),P("onNextPage",function(){s(e);let t=o();return l(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){s(e);let t=o();return l(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){s(e);let t=o();return l(t.infinitePagination.getRowCount(t.searchFilter))}),p()()()()()()}if(r&2){let e=o();u("textButton","Search"),d(3),u("ngIf",C(4,14,e.data$)),d(10),S("ngModel",e.searchFilter.PageNumber),d(4),S("ngModel",e.searchFilter.RowCount),d(5),u("showProductToggle",!0)("data",C(23,16,e.data$))("channel",e.channelOptions)("hiddenIPOSInventory",!1),d(2),u("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",C(25,18,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}var be=(()=>{class r{constructor(e,i,t,n,m,c){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=m,this.decimalPipe=c,this.infinitePagination=M(D),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(F(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let n=i.map(c=>({ID:c.ID,Code:c.Code,Price:c.UnitPrice}));var t=this.channelOptions.filter(c=>c.selected).map(c=>c.ID);let m={ListChannelID:t,ListPrice:n};this.http.post("/api/Price/UpdateChannel",m).subscribe(c=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+m.ListPrice.length+" items in "+m.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(t=>{let n=this.productService.findChannelById(i.ID,this.channelOptions),m=i.Price?this.decimalPipe.transform(i.Price):i.Price;this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+n.Name+" to "+m,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Q,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(V(t=>t!==void 0)).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openExportDialog(){this.dialog.open(K,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(i){return new(i||r)(h(W),h(G),h(H),h(J),h($),h(x))}}static{this.\u0275cmp=N({type:r,selectors:[["app-price-pos-channel"]],features:[E([D,x])],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(i,t){i&1&&(f(0,te,26,20,"mainpanel",0),_(1,"async")),i&2&&u("ngIf",C(1,1,t.loader$))},dependencies:[A,R,L,k,B,j,O,U,Y,z,q,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{be as PricePosChannelComponent};
1
+ import{a as X}from"./chunk-XJIHUZS4.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-CIKNTHCR.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,4 +1,4 @@
1
- import{h as g}from"./chunk-D2R7H4PZ.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`
1
+ import{h as g}from"./chunk-CIKNTHCR.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 h,b as f}from"./chunk-ARIW575T.js";import{a as i}from"./chunk-AUGXMJYD.js";import"./chunk-D2R7H4PZ.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-OCQD6PMZ.js").then(e=>e.PricePosChannelComponent)},canActivate:[i],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-37YRCS7N.js").then(e=>e.CustomChannelPriceComponent)},canActivate:[i],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-QZDIKVMC.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};
1
+ import{a as h,b as f}from"./chunk-ARIW575T.js";import{a as i}from"./chunk-MV2W43TI.js";import"./chunk-CIKNTHCR.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-2H7UKR4Z.js").then(e=>e.PricePosChannelComponent)},canActivate:[i],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-S45YFO7W.js").then(e=>e.CustomChannelPriceComponent)},canActivate:[i],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-BTPFPDPR.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};
@@ -1 +1 @@
1
- import{h as r,i as C}from"./chunk-D2R7H4PZ.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
+ import{h as r,i as C}from"./chunk-CIKNTHCR.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,8 +1,8 @@
1
- import{a as we,b as Pe,c as ze}from"./chunk-WHFC7TE4.js";import{a as X}from"./chunk-52GRE6TF.js";import"./chunk-77IUCPIQ.js";import"./chunk-WBVTRQFG.js";import{a as Je}from"./chunk-BVIRHZTZ.js";import{a as oe,b as le,c as yt}from"./chunk-OM7KOQLP.js";import"./chunk-MS4AQ6UA.js";import{a as me}from"./chunk-6HVHZ3HN.js";import{b as Lt}from"./chunk-OBN6RKRH.js";import"./chunk-5Z63CRGG.js";import{a as At,b as Rt,c as Wt,d as Bt,e as zt,f as Gt,g as jt}from"./chunk-VAPIXIJ3.js";import"./chunk-3NMGN7IE.js";import{a as xt,b as wt}from"./chunk-ARIW575T.js";import"./chunk-OVYL7SOO.js";import"./chunk-B5JAZPVU.js";import{a as Ht,b as Ut}from"./chunk-RNWWVG3M.js";import"./chunk-OS53H77X.js";import{a as pe,b as bt}from"./chunk-5BTJTFLF.js";import{a as Ft}from"./chunk-T7KM2WP6.js";import{i as It,j as Nt,k as Mt,l as Ot,m as kt}from"./chunk-VOISFPEM.js";import"./chunk-UOAYF4SW.js";import{a as Pt}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as $}from"./chunk-5WNSX64O.js";import{b as Vt}from"./chunk-WYOXUN3H.js";import{b as Et}from"./chunk-23MIIDCT.js";import{a as vt,b as Tt,c as Dt}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import{a as re}from"./chunk-AUGXMJYD.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 ne,b as ae,c as dt,d as J,e as ct}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{g as se,j as K}from"./chunk-D2R7H4PZ.js";import{b as be,e as W}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{b as gt,d as xe,e as ut,f as ft,g as St,l as j,m as Ct}from"./chunk-XOT2SZPE.js";import{r as _t,s as ht}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{b as Be,c as q,h as z,m as G,o as ie,y as st}from"./chunk-AI4XRCAL.js";import{b as P,c as I}from"./chunk-W6T7TOHE.js";import{E as Re,F as mt,H as Y,J as We,d as pt,f as A,g as R,j as Ce,k as V,m as U,n as ye}from"./chunk-B6POIFQM.js";import{Aa as Ye,B as Ze,Ba as qe,Dc as O,Eb as L,Ec as l,Fb as Ae,Fc as u,G as et,Gc as w,Ic as C,Jc as y,Kb as g,Kc as b,Mc as ot,Nc as ee,Oc as lt,Pc as te,Qa as nt,Wb as s,Xc as E,Yc as M,Z as he,Zc as F,_c as B,aa as tt,bc as Ke,ea as Le,gc as i,hc as a,ic as f,ja as Ve,jc as T,ka as Fe,kc as D,mc as N,oa as ge,ob as k,qb as o,rc as x,sc as d,v as H,vc as at,wb as v,wc as rt,xa as it,ya as _,za as h}from"./chunk-EIQCOZF5.js";import{a as Xe,b as Qe}from"./chunk-K2H6WANG.js";var Yt=(()=>{class n{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[Je.downloadOrder]},{Title:"Log",Url:"/menu/Order/Download_Order_Log",Permissions:[Je.downloadOrder]}]}ngOnInit(){}static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275cmp=L({type:n,selectors:[["app-orders"]],standalone:!1,decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(r,t){r&1&&(i(0,"nav",0)(1,"div",1)(2,"div"),f(3,"nav-tab",2),a()()(),f(4,"router-outlet")),r&2&&(o(3),s("Tabs",t.ObjectOrderTabs)("usePermissions",!0))},dependencies:[xt,mt],encapsulation:2})}}return n})();var Ge=(()=>{class n{constructor(e,r){this.http=e,this.toastr=r}acceptTokopediaOrders(e){return this.http.post("/api/Orders/AcceptOrderTokopedia",e).pipe(Le(r=>{this.tokopediaAcceptOrderHandler(r)}))}tokopediaAcceptOrderHandler(e){let r=e.filter(p=>p.Status==!1),t=e.filter(p=>p.Status==!0);if(r.length==0&&t.length>0){let p=`<ol>${this.generateSuccessMessage(t)}</ol>`;this.toastr.success(p,"Success",{enableHtml:!0})}else if(r.length>0&&t.length>0){let p=`<ol>
1
+ import{a as we,b as Pe,c as ze}from"./chunk-WHFC7TE4.js";import{a as X}from"./chunk-52GRE6TF.js";import"./chunk-77IUCPIQ.js";import"./chunk-WBVTRQFG.js";import{a as Je}from"./chunk-BVIRHZTZ.js";import{a as oe,b as le,c as yt}from"./chunk-OM7KOQLP.js";import"./chunk-MS4AQ6UA.js";import{a as me}from"./chunk-6HVHZ3HN.js";import{b as Lt}from"./chunk-OBN6RKRH.js";import"./chunk-5Z63CRGG.js";import{a as At,b as Rt,c as Wt,d as Bt,e as zt,f as Gt,g as jt}from"./chunk-VAPIXIJ3.js";import"./chunk-3NMGN7IE.js";import{a as xt,b as wt}from"./chunk-ARIW575T.js";import"./chunk-OVYL7SOO.js";import"./chunk-B5JAZPVU.js";import{a as Ht,b as Ut}from"./chunk-RNWWVG3M.js";import"./chunk-OS53H77X.js";import{a as pe,b as bt}from"./chunk-5BTJTFLF.js";import{a as Ft}from"./chunk-T7KM2WP6.js";import{i as It,j as Nt,k as Mt,l as Ot,m as kt}from"./chunk-VOISFPEM.js";import"./chunk-UOAYF4SW.js";import{a as Pt}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as $}from"./chunk-5WNSX64O.js";import{b as Vt}from"./chunk-WYOXUN3H.js";import{b as Et}from"./chunk-23MIIDCT.js";import{a as vt,b as Tt,c as Dt}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import{a as re}from"./chunk-MV2W43TI.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 ne,b as ae,c as dt,d as J,e as ct}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{g as se,j as K}from"./chunk-CIKNTHCR.js";import{b as be,e as W}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{b as gt,d as xe,e as ut,f as ft,g as St,l as j,m as Ct}from"./chunk-XOT2SZPE.js";import{r as _t,s as ht}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{b as Be,c as q,h as z,m as G,o as ie,y as st}from"./chunk-AI4XRCAL.js";import{b as P,c as I}from"./chunk-W6T7TOHE.js";import{E as Re,F as mt,H as Y,J as We,d as pt,f as A,g as R,j as Ce,k as V,m as U,n as ye}from"./chunk-B6POIFQM.js";import{Aa as Ye,B as Ze,Ba as qe,Dc as O,Eb as L,Ec as l,Fb as Ae,Fc as u,G as et,Gc as w,Ic as C,Jc as y,Kb as g,Kc as b,Mc as ot,Nc as ee,Oc as lt,Pc as te,Qa as nt,Wb as s,Xc as E,Yc as M,Z as he,Zc as F,_c as B,aa as tt,bc as Ke,ea as Le,gc as i,hc as a,ic as f,ja as Ve,jc as T,ka as Fe,kc as D,mc as N,oa as ge,ob as k,qb as o,rc as x,sc as d,v as H,vc as at,wb as v,wc as rt,xa as it,ya as _,za as h}from"./chunk-EIQCOZF5.js";import{a as Xe,b as Qe}from"./chunk-K2H6WANG.js";var Yt=(()=>{class n{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[Je.downloadOrder]},{Title:"Log",Url:"/menu/Order/Download_Order_Log",Permissions:[Je.downloadOrder]}]}ngOnInit(){}static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275cmp=L({type:n,selectors:[["app-orders"]],standalone:!1,decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(r,t){r&1&&(i(0,"nav",0)(1,"div",1)(2,"div"),f(3,"nav-tab",2),a()()(),f(4,"router-outlet")),r&2&&(o(3),s("Tabs",t.ObjectOrderTabs)("usePermissions",!0))},dependencies:[xt,mt],encapsulation:2})}}return n})();var Ge=(()=>{class n{constructor(e,r){this.http=e,this.toastr=r}acceptTokopediaOrders(e){return this.http.post("/api/Orders/AcceptOrderTokopedia",e).pipe(Le(r=>{this.tokopediaAcceptOrderHandler(r)}))}tokopediaAcceptOrderHandler(e){let r=e.filter(p=>p.Status==!1),t=e.filter(p=>p.Status==!0);if(r.length==0&&t.length>0){let p=`<ol>${this.generateSuccessMessage(t)}</ol>`;this.toastr.success(p,"Success",{enableHtml:!0})}else if(r.length>0&&t.length>0){let p=`<ol>
2
2
  ${this.generateSuccessMessage(t)}
3
3
  ${this.generateErrorMessage(r)}
4
4
  </ol>`;this.toastr.warning(p,"Warning",{enableHtml:!0})}else{let p=`<ol>${this.generateErrorMessage(r)}</ol>`;this.toastr.error(p,"Error",{enableHtml:!0})}}generateSuccessMessage(e){let r="";return e.forEach(t=>{r+=`<li><b>${t.OrderNumber}</b> was successfully Accept</li>`}),r}generateErrorMessage(e){let r="";return e.forEach(t=>{r+=`<li><b>${t.OrderNumber}</b> ${t.Message}</li>`}),r}static{this.\u0275fac=function(r){return new(r||n)(ge(W),ge(be))}}static{this.\u0275prov=Ve({token:n,factory:n.\u0275fac})}}return n})();function oi(n,c){if(n&1){let e=N();T(0),i(1,"button",20),x("click",function(){_(e);let t=d().ngIf,p=d();return h(p.onAcceptOrder(t))}),f(2,"i",21),l(3," Accept "),a(),D()}}function li(n,c){if(n&1&&(T(0),g(1,oi,4,0,"ng-container",3),D()),n&2){let e=d();o(),s("ngIf",e.isTokopediaAvailable&&e.isTokopediaSelected)}}function pi(n,c){if(n&1&&(i(0,"span",22),f(1,"img",23),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,k),o(),w(" ",e.Name," ")}}function mi(n,c){if(n&1){let e=N();T(0),i(1,"th",35)(2,"input",36),b("ngModelChange",function(t){_(e);let p=d(3);return y(p.isCheckAll,t)||(p.isCheckAll=t),h(t)}),x("ngModelChange",function(){_(e);let t=d(2).ngIf,p=d();return h(p.onSelectAllOrderData(t))}),a()(),D()}if(n&2){let e=d(3);o(2),C("ngModel",e.isCheckAll)}}function si(n,c){if(n&1){let e=N();T(0),i(1,"input",36),b("ngModelChange",function(t){_(e);let p=d(2).$implicit;return y(p.selected,t)||(p.selected=t),h(t)}),x("ngModelChange",function(){_(e);let t=d(4).ngIf,p=d();return h(p.onSelectOrderData(t))}),a(),D()}if(n&2){let e=d(2).$implicit;o(),C("ngModel",e.selected)}}function di(n,c){if(n&1&&(T(0),i(1,"td"),g(2,si,2,1,"ng-container",3),a(),D()),n&2){let e=d().$implicit,r=d(3);o(2),s("ngIf",e.Type==r.tokopediaType)}}function ci(n,c){if(n&1&&(T(0),i(1,"span"),l(2),a(),D()),n&2){let e=d().$implicit;o(2),u(e.Number)}}function _i(n,c){if(n&1&&(i(0,"a",38),l(1),a()),n&2){let e=d().$implicit,r=d(3);s("href",r.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+e.ID,k),o(),u(e.Number)}}function hi(n,c){if(n&1&&(i(0,"tr"),g(1,di,3,1,"ng-container",3),i(2,"td"),l(3),a(),i(4,"td"),g(5,ci,3,1,"ng-container",24)(6,_i,2,2,"ng-template",null,1,B),a(),i(8,"td"),l(9),a(),i(10,"td"),l(11),E(12,"date"),a(),i(13,"td"),f(14,"app-channel-logo",37),a()()),n&2){let e=c.$implicit,r=O(7),t=d(3);o(),s("ngIf",t.isTokopediaAvailable),o(2),u(e.Outlet),o(2),s("ngIf",e.ID==t.guidEmpty)("ngIfElse",r),o(4),u(e.Customer),o(2),u(F(12,7,e.Created,"dd MMM yyyy HH:mm")),o(3),s("typeId",e.Type)}}function gi(n,c){if(n&1){let e=N();T(0),i(1,"div",25)(2,"table",26),x("matSortChange",function(t){_(e);let p=d(2);return h(p.onSort(t))}),i(3,"thead",27)(4,"tr",28),g(5,mi,3,1,"ng-container",3),i(6,"th",29),l(7,"Outlet"),a(),i(8,"th",30),l(9,"Order number"),a(),i(10,"th"),l(11,"Customer"),a(),i(12,"th",31),l(13," Created On "),a(),i(14,"th",32),l(15,"Channel"),a()()(),i(16,"tbody"),g(17,hi,15,10,"tr",33),a()(),i(18,"app-mat-paginator-no-count",34),E(19,"async"),E(20,"async"),x("total",function(){_(e);let t=d(2);return h(t.getPaginatonTotal())})("next",function(){_(e);let t=d(2);return h(t.onNextPage())})("previous",function(){_(e);let t=d(2);return h(t.onPreviousPage())}),a()(),D()}if(n&2){let e,r=d().ngIf,t=d();o(5),s("ngIf",t.isTokopediaAvailable&&r),o(12),s("ngForOf",r),o(),s("filter",t.filter)("totaldata",(e=M(19,5,t.newOrdersData$))==null?null:e.length)("paginationTotal",M(20,7,t.paginationTotal$))}}function ui(n,c){if(n&1&&(T(0),g(1,gi,21,9,"ng-container",24),D()),n&2){let e=c.ngIf;d();let r=O(36);o(),s("ngIf",(e==null?null:e.length)>0)("ngIfElse",r)}}function fi(n,c){n&1&&(i(0,"div",39),f(1,"app-empty-state"),a())}var Kt=(()=>{class n{constructor(e,r,t,p){this.localDataService=e,this.orderService=r,this.acceptOrderService=t,this.authService=p,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=I.GuidEMpty,this.tokopediaType=P.Tokopedia,this.isTokopediaSelected=!1,this.isTokopediaAvailable=!1,this.isCheckAll=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initLoadPage()}initLoadPage(){this.orderService.loadInitialPage().subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.getNewOrders()})}getNewOrders(){let e={PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.sourceObs$=this.orderService.getNewOrders(e).pipe(he()),this.newOrdersData$=this.sourceObs$.pipe(Le(r=>{r.filter(p=>p.Type==P.Tokopedia).length>0&&(this.isTokopediaAvailable=!0)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID,this.filter.From,this.filter.To).pipe(he())}onNextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getNewOrders()}onPreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getNewOrders()}onSelectOrderData(e){this.isTokopediaSelected=!1,e.filter(t=>t.selected).length>0&&(this.isTokopediaSelected=!0)}onSelectAllOrderData(e){e=e.map(r=>(r.Type==P.Tokopedia&&(r.selected=this.isCheckAll),r)),this.onSelectOrderData(e)}onAcceptOrder(e){let r=this.getSelectedTokopediaOrders(e);this.acceptOrderService.acceptTokopediaOrders(r).subscribe(t=>{this.isTokopediaSelected=!1,location.reload()})}getSelectedTokopediaOrders(e){return e.filter(t=>t.selected).map(t=>t.Number)}onSort(e){if(e.direction==""){this.newOrdersData$=this.sourceObs$;return}if(e.active=="created"){let r=e.direction=="asc";this.newOrdersData$=this.newOrdersData$.pipe(H(t=>(t=t.sort((p,S)=>I.compare(p.Created,S.Created,r)),t)))}}static{this.\u0275fac=function(r){return new(r||n)(v(se),v(we),v(Ge),v(K))}}static{this.\u0275cmp=L({type:n,selectors:[["app-new-order"]],standalone:!1,decls:37,vars:15,consts:[["EMPTY_STATE",""],["NOT_EMPTY",""],["headerTitle","1 - New Order","searchBoxPlaceHolder","Search Orders...",3,"onSubmit","hideSearchBox"],[4,"ngIf"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-check"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[2,"width","5px"],["type","checkbox",3,"ngModelChange","ngModel"],[3,"typeId"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,t){if(r&1){let p=N();i(0,"mainpanel",2),x("onSubmit",function(){return _(p),h(t.getNewOrders())}),i(1,"actions"),g(2,li,2,1,"ng-container",3),E(3,"async"),i(4,"a",4),f(5,"i",5),i(6,"span"),l(7,"Visit our Fulfillment Display System"),a()()(),i(8,"filters")(9,"div")(10,"label",6),l(11,"Channel"),a(),i(12,"ng-select",7),b("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(13,pi,3,2,"ng-template",8),a()(),i(14,"div",9)(15,"label",10),l(16,"Page Number"),a(),i(17,"input",11),b("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(18,"div",9)(19,"label",10),l(20,"Page Size"),a(),i(21,"input",12),b("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(22,"div",9)(23,"label",13),l(24,"From/To"),a(),i(25,"div",14)(26,"datepicker",15),b("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(27,"div")(28,"datepicker",16),b("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(29,"content")(30,"div",17)(31,"div",18)(32,"div",19),g(33,ui,2,2,"ng-container",3),E(34,"async"),g(35,fi,2,0,"ng-template",null,0,B),a()()()()()}r&2&&(s("hideSearchBox",!0),o(2),s("ngIf",M(3,11,t.newOrdersData$)),o(10),s("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),s("ngIf",M(34,13,t.newOrdersData$)))},dependencies:[A,R,q,ie,Be,z,G,j,J,ne,ae,$,pe,me,oe,le,X,Ce,V],encapsulation:2})}}return n})();var Si=()=>["/menu/Order"];function Ci(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),l(4),E(5,"number"),a(),i(6,"td"),l(7),E(8,"number"),a()()),n&2){let e=c.$implicit;o(2),u(e.Code),o(2),u(M(5,3,e.Quantity)),o(3),u(M(8,5,e.Price))}}function yi(n,c){if(n&1&&(i(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),l(5,"Outlet Info"),a()(),i(6,"div",4)(7,"div",9),l(8," Outlet : "),a(),i(9,"div",9),l(10),a()(),i(11,"div",4)(12,"div",9),l(13," Date : "),a(),i(14,"div",9),l(15),E(16,"date"),a()(),i(17,"div",4)(18,"div",9),l(19," Status : "),a(),i(20,"div",9),l(21),a()(),i(22,"div",4)(23,"div",9),l(24," Tax Type : "),a(),i(25,"div",9),l(26),a()(),i(27,"div",4)(28,"div",9),l(29," Due Date : "),a(),i(30,"div",9),l(31),E(32,"date"),a()()(),i(33,"div",6)(34,"div",7)(35,"h3",8),l(36,"Customer Info"),a()(),i(37,"div",4)(38,"div",9),l(39," Name : "),a(),i(40,"div",9),l(41),a()(),i(42,"div",4)(43,"div",9),l(44," Email : "),a(),i(45,"div",9),l(46),a()(),i(47,"div",4)(48,"div",9),l(49," Mobile : "),a(),i(50,"div",9),l(51),a()()()(),i(52,"div",10)(53,"h3",11),l(54,"Products Sold"),a(),i(55,"div",12)(56,"table",13)(57,"thead",14)(58,"tr",15)(59,"th"),l(60,"Code"),a(),i(61,"th"),l(62,"Quantity"),a(),i(63,"th"),l(64,"Price"),a()()(),i(65,"tbody"),g(66,Ci,9,7,"tr",16),a()()()()()),n&2){let e=d();o(10),w(" ",e.model.Outlet," "),o(5),w(" ",F(16,9,e.model.Date,"dd MMM yyyy")," "),o(6),w(" ",e.model.Delivery," "),o(5),w(" ",e.model.TaxType," "),o(5),w(" ",F(32,12,e.model.DueDate,"dd MMM yyyy")," "),o(10),w(" ",e.model.Customer.Name," "),o(5),w(" ",e.model.Customer.Email," "),o(5),w(" ",e.model.Customer.Mobile," "),o(15),s("ngForOf",e.model.Variants)}}var Jt=(()=>{class n{constructor(e,r){this.http=e,this.url=r,this.number=this.url.snapshot.queryParams.Number,this.outlet=this.url.snapshot.queryParams.Outlet}ngOnInit(){this.Load()}Load(){var e={Number:this.number,Outlet:this.outlet};this.http.post("/api/orders/GetInvoiceDetail",e).subscribe(r=>{this.model=r})}static{this.\u0275fac=function(r){return new(r||n)(v(W),v(Re))}}static{this.\u0275cmp=L({type:n,selectors:[["app-detail-order"]],standalone:!1,decls:7,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-secondary","btn-fill","btn-lg","me-3",3,"routerLink"],[1,"container"],["class","row",4,"ngIf"],[1,"row"],[1,"col-4"],[1,"border","my-3","py-3","col-12"],[1,"row","m-2"],[1,"text-center"],[1,"col"],[1,"col-8"],[1,"text-center","my-3","py-3"],[1,"table-responsive"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"]],template:function(r,t){r&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),a()(),i(4,"content")(5,"div",2),g(6,yi,67,15,"div",3),a()()()),r&2&&(s("headerTitle","Order #"+t.number)("hideSearchBox",!0)("hideSearchDropdown",!0),o(2),s("routerLink",ee(5,Si)),o(4),s("ngIf",t.model))},dependencies:[A,R,j,Y,U,V],encapsulation:2})}}return n})();var $t=(()=>{class n{constructor(e){this.dialogRef=e,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}static{this.\u0275fac=function(r){return new(r||n)(v(gt))}}static{this.\u0275cmp=L({type:n,selectors:[["app-print-tokopedia"]],standalone:!1,decls:17,vars:1,consts:[[1,"container-fluid"],[1,"text-center","mb-4","fw-bold","mt-6"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"ngModelChange","ngModel"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click"]],template:function(r,t){r&1&&(i(0,"div",0)(1,"h2",1),l(2,"Cetak label pesanan"),a(),i(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),l(7,"Kamu akan mencetak label yang berisi detail pesanan"),a(),i(8,"div",5)(9,"mat-checkbox",6),b("ngModelChange",function(S){return y(t.tandaiSudahDicetak,S)||(t.tandaiSudahDicetak=S),S}),a(),i(10,"span",7),l(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),a()()()()(),i(12,"mat-dialog-actions",8)(13,"button",9),x("click",function(){return t.onCancel()}),l(14,"Cancel"),a(),i(15,"button",10),x("click",function(){return t.onPrint()}),l(16,"Cetak Pesanan"),a()()()),r&2&&(o(9),C("ngModel",t.tandaiSudahDicetak))},dependencies:[z,G,Ht,ft,ut],encapsulation:2})}}return n})();var He=(()=>{class n{constructor(e,r,t){this.http=e,this.toastr=r,this.dialog=t}getTokopediaShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/Tokopedia/Multiple",{Orders:e}).pipe(H(r=>(r=r.map(t=>(t.ChannelType=P.Tokopedia,t)),r)))}getTiktokShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/TIktok/Multiple",{Orders:e}).pipe(H(r=>(r=r.map(t=>(t.ChannelType=P.Tiktok,t)),r)))}getShopeeShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/shopee/Multiple",{Orders:e}).pipe(H(r=>(r=r.map(t=>(t.ChannelType=P.Shopee,t)),r)))}getLazadaShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/lazada/Multiple",{Orders:e}).pipe(H(r=>(r=r.map(t=>(t.ChannelType=P.Lazada,t)),r)))}printShippingLabelTokopedia(e){let r={OrderNumber:e,Printed:!0};this.dialog.open($t).afterClosed().pipe(et(t=>t!==void 0),tt(t=>(r.Printed=t,this.http.post("api/v1/Shippinglabel/Tokopedia",r)))).subscribe(t=>{let p=window.open("about:blank","_blank");p.document.write(t.File),p.document.close()})}printShippingLabelTiktok(e,r){let t={ShopID:r,OrderNumber:e};this.http.post("api/v1/Shippinglabel/Tiktok",t).subscribe(p=>{p.data!=null?window.open(p.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print")})}printShippingLabelShopee(e,r){let t={ShopID:r,OrderNumber:e};this.http.post("api/v1/Shippinglabel/shopee/DownloadShipping",t).subscribe(p=>{var S=Uint8Array.from(atob(p.File),Ee=>Ee.charCodeAt(0)),m=new Blob([S],{type:"octet/stream"});I.openDownloadFile(m,`${e}.pdf`)})}printShippingLabelLazada(e,r){let t={ShopID:r,OrderNumber:e};this.http.post("api/v1/Shippinglabel/Lazada/DownloadShipping",t).subscribe(p=>{p.result.data!=null?window.open(p.result.data.pdf_url,"_blank"):this.toastr.error(p.message,"Cannot Print")})}static{this.\u0275fac=function(r){return new(r||n)(ge(W),ge(be),ge(xe))}}static{this.\u0275prov=Ve({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var de=function(n){return n.SPX="https://res.cloudinary.com/pos/image/upload/v1698216798/APP/Print%20Shipping%20Label/SPX_Logo.png",n.SICEPAT="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/SiCepat_Logo.png",n.JNT="https://res.cloudinary.com/pos/image/upload/v1698216792/APP/Print%20Shipping%20Label/J_T_Logo.png",n.ANTERAJA="https://res.cloudinary.com/pos/image/upload/v1698218271/APP/Print%20Shipping%20Label/anteraja_Logo.png",n.JNE="https://res.cloudinary.com/pos/image/upload/v1698216791/APP/Print%20Shipping%20Label/JNE_Logo.png",n.GRAB="https://res.cloudinary.com/pos/image/upload/v1698216794/APP/Print%20Shipping%20Label/GrabExpress_Logo.png",n.GOSEND="https://res.cloudinary.com/pos/image/upload/v1698218375/APP/Print%20Shipping%20Label/Gosend_Logo.png",n.LAZADA_EXPRESS="https://res.cloudinary.com/pos/image/upload/v1698914677/icons/Marketplace%20logo/lazada-Logistics.png",n}(de||{});var De=function(n){return n.TOKOPEDIA="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/Tokopedia_Logo.png",n.SHOPEE="https://res.cloudinary.com/pos/image/upload/v1698219243/APP/Print%20Shipping%20Label/shopee-logo.png",n.LAZADA="https://res.cloudinary.com/pos/image/upload/v1698912333/icons/Marketplace%20logo/Lazada_icon.png",n.TIKTOK="https://res.cloudinary.com/pos/image/upload/v1645761565/icons/Marketplace%20logo/tiktok-logo.png",n}(De||{});function xi(n,c){if(n&1&&(T(0),i(1,"div",36)(2,"div",12)(3,"div",37),l(4),a()(),i(5,"div",12)(6,"div",37),l(7),a()()(),D()),n&2){let e=d();o(4),w(" ",e.recipient==null?null:e.recipient.City," "),o(3),w(" ",e.recipient==null?null:e.recipient.District," ")}}function wi(n,c){if(n&1&&(T(0),i(1,"div")(2,"span",15),l(3,"Berat: "),a(),i(4,"span",18),l(5),a()(),D()),n&2){let e=d();o(5),w("",e.shippingLabel==null?null:e.shippingLabel.Weight," gr")}}function vi(n,c){if(n&1&&(T(0),i(1,"div",38)(2,"span",14),l(3,"Batas Kirim:"),a(),i(4,"span",18),l(5),E(6,"date"),a()(),D()),n&2){let e=d();o(5),u(F(6,1,e.logistic==null?null:e.logistic.Batas_kirim,"dd-MM-yyy"))}}function Ti(n,c){if(n&1&&(T(0),i(1,"div",38)(2,"span",14),l(3,"No.Pesanan:"),a(),i(4,"span",18),l(5),a()(),D()),n&2){let e=d();o(5),u(e.shippingLabel==null?null:e.shippingLabel.OrderNumber)}}function Di(n,c){if(n&1&&(i(0,"tr")(1,"td",39),l(2),a(),i(3,"td"),l(4),a(),i(5,"td"),l(6),a(),i(7,"td"),l(8),E(9,"number"),a()()),n&2){let e=c.$implicit,r=c.index;o(2),u(r+1),o(2),u(e.Product_Name),o(2),u(e.SKU),o(2),u(M(9,4,e.Quantity))}}var Ue=(()=>{class n{constructor(){this.minDate=I.MinDate,this.channelType=P}ngOnChanges(e){e.shippingLabel&&e.shippingLabel.currentValue&&(this.initShippingLabel(),this.getShippingLogo(),this.getChannelLogo())}ngAfterViewInit(){this.initBarcodeConfig()}getChannelLogo(){switch(this.shippingLabel.ChannelType){case P.Tokopedia:this.marketplaceLogo=De.TOKOPEDIA;break;case P.Shopee:this.marketplaceLogo=De.SHOPEE;break;case P.Lazada:this.marketplaceLogo=De.LAZADA;break;case P.Tiktok:this.marketplaceLogo=De.TIKTOK;break}}getShippingLogo(){let e=this.shippingLabel.Logistic.Logistic_Name;e=e?.toLowerCase(),e.includes("anteraja")?this.shippingLogo=de.ANTERAJA:e.includes("grabexpress")?this.shippingLogo=de.GRAB:e.includes("jne")?this.shippingLogo=de.JNE:e.includes("gosend")?this.shippingLogo=de.GOSEND:e.includes("j&t")||e.includes("jnt")?this.shippingLogo=de.JNT:e.includes("sicepat")?this.shippingLogo=de.SICEPAT:e.includes("spx")?this.shippingLogo=de.SPX:(e.includes("lex")||e.includes("lx")||e.includes("lazada express"))&&(this.shippingLogo=de.LAZADA_EXPRESS)}initShippingLabel(){this.recipient=this.shippingLabel.Recipient,this.store=this.shippingLabel.Store,this.products=this.shippingLabel.Products,this.logistic=this.shippingLabel.Logistic}initBarcodeConfig(){if(I.IsNotEmpty(this.logistic?.Resi_Number)){let e=this.logistic?.Resi_Number;JsBarcode(`#RESI${this.id}`,this.logistic?.Resi_Number,{displayValue:!1,width:e.length>15?1:1.5,height:40})}I.IsNotEmpty(this.shippingLabel?.OrderNumber)&&JsBarcode(`#NO${this.id}`,this.shippingLabel?.OrderNumber,{displayValue:!1,width:this.shippingLabel?.OrderNumber.length>15?.5:1,height:40})}static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275cmp=L({type:n,selectors:[["app-shipping-label"]],inputs:{shippingLabel:"shippingLabel",id:"id"},features:[it],decls:87,vars:20,consts:[[1,"label-container"],[2,"border","1px solid","padding","12px"],[1,"row","mb-2"],[1,"col-12"],[1,"d-flex","align-items-center","justify-content-between"],["width","105px",1,"border-0",3,"src"],[1,"mb-4"],[1,"row","mb-1"],[1,"text-center","fw-bold","border","p-2","fs-5","border-dark"],[1,"me-2"],[1,"col-12","text-center"],[3,"id"],[1,"col-6"],[1,"d-flex"],[1,"fw-bold","fs-6","me-1"],[1,"fw-bold","fs-6"],[1,"mt-2"],[1,"mb-0","fs-6",2,"max-width","200px","word-wrap","break-word"],[1,"fs-6"],[1,"fs-6",2,"word-wrap","break-word","max-width","160px"],[4,"ngIf"],[1,"row","px-6"],[1,"col-5","border","border-dark","border-end-0","text-center","p-2"],[1,"col-7","border","border-dark","p-2","text-center","fs-6"],[1,"fst-italic"],[1,"row"],[1,"col-5","pt-4",2,"padding-right","0px"],[1,"d-flex","justify-content-between"],[1,"col-7","text-center"],[1,"mt-1",3,"id"],[1,"table","table-sm","fs-6"],[1,"text-center",2,"width","5px"],[2,"width","150px"],[2,"width","50px"],[2,"width","25px"],[4,"ngFor","ngForOf"],[1,"row","mb-4"],[1,"text-center","fw-bold","border","p-2","fs-6","border-dark","text-uppercase"],[1,"mt-4"],[1,"text-center"]],template:function(r,t){r&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div"),f(6,"img",5),a(),i(7,"div")(8,"h4"),l(9),a()(),i(10,"div"),f(11,"img",5),a()()()(),i(12,"div",6),f(13,"hr"),a(),i(14,"div",7)(15,"div",3)(16,"div",8)(17,"span",9),l(18),a(),i(19,"span"),l(20),a()()()(),i(21,"div",7)(22,"div",10),Ye(),f(23,"svg",11),a()(),qe(),i(24,"div",6),f(25,"hr"),a(),i(26,"div",2)(27,"div",12)(28,"div",13)(29,"div",14),l(30,"Penerima: "),a(),i(31,"div",15),l(32),a()(),i(33,"div",16)(34,"span",15),l(35,"Alamat Pengiriman:"),a(),i(36,"div",17),l(37),a()()(),i(38,"div",12)(39,"div",13)(40,"div",14),l(41,"Pengirim: "),a(),i(42,"div")(43,"div",15),l(44),a(),i(45,"div",18),l(46),a(),i(47,"div",19),l(48),a()()(),f(49,"div"),a()(),g(50,xi,8,2,"ng-container",20),i(51,"div",21)(52,"div",22)(53,"div",15),l(54,"CASHLESS"),a()(),i(55,"div",23)(56,"small",24),l(57,"Penjual tidak perlu membayar ongkos kirim ke kurir"),a()()(),i(58,"div",25)(59,"div",26)(60,"div",27),g(61,wi,6,1,"ng-container",20),i(62,"div")(63,"span",15),l(64,"COD: "),a(),i(65,"span",18),l(66),E(67,"number"),a()()(),g(68,vi,7,4,"ng-container",20)(69,Ti,6,1,"ng-container",20),a(),i(70,"div",28),Ye(),f(71,"svg",29),a()()(),qe(),i(72,"div",25)(73,"div",3)(74,"table",30)(75,"thead")(76,"tr")(77,"th",31),l(78,"No."),a(),i(79,"th",32),l(80,"Nama Produk"),a(),i(81,"th",33),l(82,"SKU"),a(),i(83,"th",34),l(84,"Qty"),a()()(),i(85,"tbody"),g(86,Di,10,6,"tr",35),a()()()()()),r&2&&(o(6),s("src",t.marketplaceLogo,k),o(3),u(t.logistic==null?null:t.logistic.Service),o(2),s("src",t.shippingLogo,k),o(7),w(" ",(t.shippingLabel==null?null:t.shippingLabel.ChannelType)==(t.channelType==null?null:t.channelType.Tokopedia)?"Kode Booking: ":"No. Resi: "," "),o(2),u(t.logistic==null?null:t.logistic.Resi_Number),o(3),s("id","RESI"+t.id),o(9),u(t.recipient==null?null:t.recipient.Name),o(5),w(" ",t.recipient==null?null:t.recipient.Address," "),o(7),u(t.store==null?null:t.store.Name),o(2),u(t.store==null?null:t.store.Phone),o(2),w(" ",t.store==null?null:t.store.Address," "),o(2),s("ngIf",(t.recipient==null?null:t.recipient.City)&&(t.recipient==null?null:t.recipient.District)),o(11),s("ngIf",t.shippingLabel==null?null:t.shippingLabel.Weight),o(5),w("Rp. ",t.shippingLabel!=null&&t.shippingLabel.IsCOD?M(67,18,t.shippingLabel==null||t.shippingLabel.SummaryPrice==null?null:t.shippingLabel.SummaryPrice.Total):0,""),o(2),s("ngIf",(t.logistic==null?null:t.logistic.Batas_kirim)&&(t.logistic==null?null:t.logistic.Batas_kirim)!==t.minDate),o(),s("ngIf",t.shippingLabel==null?null:t.shippingLabel.OrderNumber),o(2),s("id","NO"+t.id),o(15),s("ngForOf",t.products))},dependencies:[ye,A,R,U,V],styles:[".table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border:none!important}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-transform:capitalize;padding:4px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:none!important;padding:2px 2px 2px 5px!important;font-size:10px}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.4509803922)}.label-container[_ngcontent-%COMP%]{width:465px;float:left}hr[_ngcontent-%COMP%]{opacity:.8;margin:0}"]})}}return n})();var Pi=()=>["/menu/Order/detail"],Ii=(n,c)=>({Number:n,Outlet:c});function Ni(n,c){if(n&1){let e=N();T(0),i(1,"button",21),x("click",function(){_(e);let t=d();return h(t.onPrintMultipleShippingLabel())}),f(2,"i",22),i(3,"span"),l(4,"Print Shipping Label"),a()(),D()}}function Mi(n,c){if(n&1&&(i(0,"span",23),f(1,"img",24),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,k)("alt",e.Name),o(),w(" ",e.Name," ")}}function Oi(n,c){if(n&1){let e=N();T(0),i(1,"input",31),b("ngModelChange",function(t){_(e);let p=d().$implicit;return y(p.Selected,t)||(p.Selected=t),h(t)}),x("ngModelChange",function(){_(e);let t=d(3).ngIf,p=d();return h(p.onSelectReadyToShip(t))}),a(),D()}if(n&2){let e=d().$implicit;o(),C("ngModel",e.Selected)}}function ki(n,c){if(n&1&&(i(0,"a",44),l(1),a()),n&2){let e=d().$implicit;s("routerLink",ee(3,Pi))("queryParams",te(4,Ii,e.Number,e.Outlet)),o(),u(e.Number)}}function Li(n,c){if(n&1&&(i(0,"a",45),l(1),a()),n&2){let e=d().$implicit,r=d(3);s("href",r.domain+e.ID,k),o(),u(e.Number)}}function Vi(n,c){if(n&1){let e=N();i(0,"a",46),x("click",function(){_(e);let t=d().$implicit,p=d(3);return h(p.onPrintShippingLabel(t.Number,t.ShopID,t.TypeID))}),f(1,"i",47),a()}}function Fi(n,c){if(n&1&&(i(0,"tr")(1,"td"),g(2,Oi,2,1,"ng-container",4),a(),i(3,"td"),l(4),a(),i(5,"td"),g(6,ki,2,7,"a",39)(7,Li,2,2,"a",40),a(),i(8,"td"),l(9),a(),i(10,"td"),l(11),E(12,"number"),a(),i(13,"td"),l(14),E(15,"date"),a(),i(16,"td"),f(17,"app-channel-logo",41),a(),i(18,"td",42),g(19,Vi,2,0,"a",43),a()()),n&2){let e=c.$implicit,r=d(3);o(2),s("ngIf",e.TypeID==r.channelType.Shopee||e.TypeID==r.channelType.Tokopedia||e.TypeID==r.channelType.Tiktok),o(2),u(e.Outlet),o(2),s("ngIf",r.guidEmpty==e.ID),o(),s("ngIf",r.guidEmpty!=e.ID),o(2),u(e.Customer),o(2),u(M(12,9,e.Amount)),o(3),u(F(15,11,e.Date,"dd MMM yyyy")),o(3),s("typeId",e.TypeID),o(2),s("ngIf",e.TypeID==r.channelType.Shopee||e.TypeID==r.channelType.Tokopedia||e.TypeID==r.channelType.Tiktok||e.TypeID==r.channelType.Lazada)}}function Ai(n,c){if(n&1){let e=N();T(0),i(1,"div",26)(2,"table",27),x("matSortChange",function(t){_(e);let p=d(2);return h(p.onSort(t))}),i(3,"thead",28)(4,"tr",29)(5,"th",30)(6,"input",31),b("ngModelChange",function(t){_(e);let p=d(2);return y(p.isCheckAll,t)||(p.isCheckAll=t),h(t)}),x("ngModelChange",function(){_(e);let t=d().ngIf,p=d();return h(p.onSelectAllReadyToShip(t))}),a()(),i(7,"th",32),l(8,"Outlet"),a(),i(9,"th",33),l(10,"Order number"),a(),i(11,"th"),l(12,"Customer"),a(),i(13,"th",34),l(14,"Amount"),a(),i(15,"th",35),l(16,"Date"),a(),i(17,"th",36),l(18,"Channel"),a(),f(19,"th",37),a()(),i(20,"tbody"),g(21,Fi,20,14,"tr",20),a()(),i(22,"app-mat-paginator-no-count",38),E(23,"async"),E(24,"async"),x("total",function(){_(e);let t=d(2);return h(t.getRowCount())})("next",function(){_(e);let t=d(2);return h(t.NextPage())})("previous",function(){_(e);let t=d(2);return h(t.PreviousPage())}),a()(),D()}if(n&2){let e,r=d().ngIf,t=d();o(6),C("ngModel",t.isCheckAll),o(15),s("ngForOf",r),o(),s("filter",t.filter)("totaldata",(e=M(23,5,t.readyToShip$))==null?null:e.length)("paginationTotal",M(24,7,t.paginationTotal$))}}function Ri(n,c){if(n&1&&(T(0),g(1,Ai,25,9,"ng-container",25),D()),n&2){let e=c.ngIf;d();let r=O(35);o(),s("ngIf",e.length>0)("ngIfElse",r)}}function Wi(n,c){n&1&&(i(0,"div",48),f(1,"app-empty-state"),a())}function Bi(n,c){n&1&&(T(0),i(1,"div",50),l(2,"\xA0"),a(),D())}function zi(n,c){if(n&1&&(T(0),f(1,"app-shipping-label",49),g(2,Bi,3,0,"ng-container",4),D()),n&2){let e=c.$implicit,r=c.index,t=d();o(),s("shippingLabel",e)("id",r),o(),s("ngIf",r!==(t.shippingLabels==null?null:t.shippingLabels.length)-1)}}var Xt=(()=>{class n{constructor(e,r,t,p,S,m){this.http=e,this.localDataService=r,this.dialog=t,this.shippingLabelService=p,this.datePipe=S,this.authService=m,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.channelType=P,this.guidEmpty=I.GuidEMpty,this.selectedReadyToShip=[],this.isCheckAll=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.getReadyToShip()})}getReadyToShip(e){var r={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.sourceObs$=this.http.post("api/orders/GetReadyToShip",r).pipe(H(t=>t.Data),he(1)),this.readyToShip$=this.sourceObs$}onPrintMultipleShippingLabel(){let e=this.filterReadyToShipByChannel(this.selectedReadyToShip,P.Tokopedia),r=this.filterReadyToShipByChannel(this.selectedReadyToShip,P.Shopee),t=this.filterReadyToShipByChannel(this.selectedReadyToShip,P.Tiktok),p=[];e.length>0&&p.push(this.shippingLabelService.getTokopediaShippingLabel(this.shippingLabelPayload(e))),r.length>0&&p.push(this.shippingLabelService.getShopeeShippingLabel(this.shippingLabelPayload(r))),t.length>0&&p.push(this.shippingLabelService.getTiktokShippingLabel(this.shippingLabelPayload(t))),Ze(p).pipe(H(S=>S.reduce((m,Ee)=>m.concat(Ee),[]))).subscribe({next:S=>{this.shippingLabels=S,this.printShippingLabel()}})}filterReadyToShipByChannel(e,r){return e.filter(t=>t.TypeID==r)}shippingLabelPayload(e){return e.map(r=>({ShopID:r.ShopID,OrderNumber:r.Number}))}printShippingLabel(){setTimeout(()=>{this.setPdfname(),window.print()},500)}onPrintShippingLabel(e,r,t){switch(t){case P.Tokopedia:this.shippingLabelService.printShippingLabelTokopedia(e);break;case P.Tiktok:this.shippingLabelService.printShippingLabelTiktok(e,r);break;case P.Shopee:this.shippingLabelService.printShippingLabelShopee(e,r);break;case P.Lazada:this.shippingLabelService.printShippingLabelLazada(e,r);break}}setPdfname(){if(this.selectedReadyToShip.length>1){let e=new Date,r=this.datePipe.transform(e,"dd-MM-yyyy"),t=this.datePipe.transform(e,"HH-mm");document.title=`ShippingLabel_${r}_${t}`}else{let e=this.selectedReadyToShip[0].Number;document.title=`ShippingLabel_${e}`}}getSelectedReadyToShip(e){return e.filter(r=>r.Selected)}getRowCount(){var e={PaymentState:"Unpaid",DeliveryState:"Unsent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.paginationTotal$=this.http.post("api/orders/GetRowCount",e).pipe(H(r=>r?.Total))}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getReadyToShip()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getReadyToShip()}onSort(e){if(e.direction==""){this.readyToShip$=this.sourceObs$;return}if(e.active=="date"){let r=e.direction=="asc";this.readyToShip$=this.readyToShip$.pipe(H(t=>t.sort((p,S)=>I.compare(p.Date,S.Date,r))))}}onSelectReadyToShip(e){this.selectedReadyToShip=this.getSelectedReadyToShip(e)}onSelectAllReadyToShip(e){e=e.map(r=>((r.TypeID==P.Tokopedia||r.TypeID==P.Shopee||r.TypeID==P.Lazada)&&(r.Selected=this.isCheckAll),r)),this.selectedReadyToShip=this.getSelectedReadyToShip(e)}static{this.\u0275fac=function(r){return new(r||n)(v(W),v(se),v(xe),v(He),v(V),v(K))}}static{this.\u0275cmp=L({type:n,selectors:[["app-ready-to-ship"]],standalone:!1,decls:38,vars:13,consts:[["EMPTY_STATE",""],["headerTitle","2 - Ready to Ship","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],[1,"print_containers"],[4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","date",2,"width","130px"],[2,"width","114px"],[2,"width","10px"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[3,"shippingLabel","id"],[1,"page-break"]],template:function(r,t){if(r&1){let p=N();i(0,"mainpanel",1),x("onSubmit",function(m){return _(p),h(t.getReadyToShip(m))}),i(1,"actions")(2,"a",2),f(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),a()(),g(6,Ni,5,0,"ng-container",4),a(),i(7,"filters")(8,"div")(9,"label",5),l(10,"Channel"),a(),i(11,"ng-select",6),b("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(12,Mi,3,3,"ng-template",7),a()(),i(13,"div",8)(14,"label",9),l(15,"Page Number"),a(),i(16,"input",10),b("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(17,"div",8)(18,"label",9),l(19,"Page Size"),a(),i(20,"input",11),b("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(21,"div",8)(22,"label",12),l(23,"From/To"),a(),i(24,"div",13)(25,"datepicker",14),b("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(26,"div")(27,"datepicker",15),b("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(28,"content")(29,"div",16)(30,"div",17)(31,"div",18),g(32,Ri,2,2,"ng-container",4),E(33,"async"),g(34,Wi,2,0,"ng-template",null,0,B),a()()()()(),i(36,"div",19),g(37,zi,3,3,"ng-container",20),a()}r&2&&(o(6),s("ngIf",t.selectedReadyToShip.length>0),o(5),s("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),s("ngIf",M(33,11,t.readyToShip$)),o(5),s("ngForOf",t.shippingLabels))},dependencies:[A,R,q,ie,Be,z,G,j,Y,J,ne,ae,$,pe,me,oe,le,X,Ue,Ce,U,V],styles:[".print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block}}@media print{.page-break[_ngcontent-%COMP%]{page-break-after:always}}"]})}}return n})();var Gi=()=>["/menu/Order/detail"],ji=(n,c)=>({Number:n,Outlet:c});function Hi(n,c){if(n&1&&(i(0,"span",19),f(1,"img",20),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,k)("alt",e.Name),o(),w(" ",e.Name," ")}}function Ui(n,c){if(n&1&&(i(0,"a",35),l(1),a()),n&2){let e=d().$implicit;s("routerLink",ee(3,Gi))("queryParams",te(4,ji,e.Number,e.Outlet)),o(),u(e.Number)}}function Yi(n,c){if(n&1&&(i(0,"a",36),l(1),a()),n&2){let e=d().$implicit,r=d(2);s("href",r.domain+e.ID,k),o(),u(e.Number)}}function qi(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),g(4,Ui,2,7,"a",32)(5,Yi,2,2,"a",33),a(),i(6,"td"),l(7),a(),i(8,"td"),l(9),E(10,"number"),a(),i(11,"td"),l(12),E(13,"date"),a(),i(14,"td"),f(15,"app-channel-logo",34),a()()),n&2){let e=c.$implicit,r=d(2);o(2),u(e.Outlet),o(2),s("ngIf",r.hasGuidEmpty(e.ID)),o(),s("ngIf",!r.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,7,e.Amount)),o(3),u(F(13,9,e.Created,"dd MMM yyyy HH:mm")),o(3),s("typeId",e.TypeID)}}function Ki(n,c){if(n&1){let e=N();T(0),i(1,"div",21)(2,"table",22),x("matSortChange",function(t){_(e);let p=d();return h(p.onSort(t))}),i(3,"thead",23)(4,"tr",24)(5,"th",25),l(6,"Outlet"),a(),i(7,"th",26),l(8,"Order number"),a(),i(9,"th"),l(10,"Customer"),a(),i(11,"th",27),l(12,"Amount"),a(),i(13,"th",28),l(14," Created On "),a(),i(15,"th",29),l(16,"Channel"),a()()(),i(17,"tbody"),g(18,qi,16,12,"tr",30),a()(),i(19,"app-mat-paginator-no-count",31),x("total",function(){_(e);let t=d();return h(t.StoreRowsCountAPIResult())})("next",function(){_(e);let t=d();return h(t.NextPage())})("previous",function(){_(e);let t=d();return h(t.PreviousPage())}),a()(),D()}if(n&2){let e=d();o(18),s("ngForOf",e.data),o(),s("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function Ji(n,c){n&1&&(i(0,"div",37),f(1,"app-empty-state"),a())}var Qt=(()=>{class n{constructor(e,r,t){this.http=e,this.localDataService=r,this.authService=t,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=P,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}hasGuidEmpty(e){return e==I.GuidEMpty}Get(e){var r={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetShipped",r).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"Unpaid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(r=>{this.paginationTotal=r.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let r=e.direction=="asc";this.data=this.data.sort((t,p)=>I.compare(t.Created,p.Created,r))}}static{this.\u0275fac=function(r){return new(r||n)(v(W),v(se),v(K))}}static{this.\u0275cmp=L({type:n,selectors:[["app-shipped"]],standalone:!1,decls:34,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","3 - Shipped","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[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"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,t){if(r&1){let p=N();i(0,"mainpanel",1),x("onSubmit",function(m){return _(p),h(t.Get(m))}),i(1,"actions")(2,"a",2),f(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),a()()(),i(6,"filters")(7,"div")(8,"label",4),l(9,"Channel"),a(),i(10,"ng-select",5),b("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(11,Hi,3,3,"ng-template",6),a()(),i(12,"div",7)(13,"label",8),l(14,"Page Number"),a(),i(15,"input",9),b("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(16,"div",7)(17,"label",8),l(18,"Page Size"),a(),i(19,"input",10),b("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(20,"div",7)(21,"label",11),l(22,"From/To"),a(),i(23,"div",12)(24,"datepicker",13),b("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(25,"div")(26,"datepicker",14),b("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),g(31,Ki,20,4,"ng-container",18)(32,Ji,2,0,"ng-template",null,0,B),a()()()()()}if(r&2){let p=O(33);o(10),s("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),s("ngIf",t.data&&t.data.length>0)("ngIfElse",p)}},dependencies:[A,R,q,ie,z,G,j,Y,J,ne,ae,$,pe,me,oe,le,X,U,V],encapsulation:2})}}return n})();var $i=()=>["/menu/Order/detail"],Xi=(n,c)=>({Number:n,Outlet:c});function Qi(n,c){if(n&1&&(i(0,"span",19),f(1,"img",20),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,k)("alt",e.Name),o(),w(" ",e.Name," ")}}function Zi(n,c){if(n&1&&(i(0,"a",35),l(1),a()),n&2){let e=d().$implicit;s("routerLink",ee(3,$i))("queryParams",te(4,Xi,e.Number,e.Outlet)),o(),u(e.Number)}}function en(n,c){if(n&1&&(i(0,"a",36),l(1),a()),n&2){let e=d().$implicit,r=d(2);s("href",r.customerInfoUrl+e.ID,k),o(),u(e.Number)}}function tn(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),g(4,Zi,2,7,"a",32)(5,en,2,2,"a",33),a(),i(6,"td"),l(7),a(),i(8,"td"),l(9),E(10,"number"),a(),i(11,"td"),l(12),E(13,"date"),a(),i(14,"td"),f(15,"app-channel-logo",34),a()()),n&2){let e=c.$implicit,r=d(2);o(2),u(e.Outlet),o(2),s("ngIf",r.hasGuidEmpty(e.ID)),o(),s("ngIf",!r.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,7,e.Amount)),o(3),u(F(13,9,e.Created,"dd MMM yyyy HH:mm")),o(3),s("typeId",e.TypeID)}}function nn(n,c){if(n&1){let e=N();T(0),i(1,"div",21)(2,"table",22),x("matSortChange",function(t){_(e);let p=d();return h(p.onSort(t))}),i(3,"thead",23)(4,"tr",24)(5,"th",25),l(6,"Outlet"),a(),i(7,"th",26),l(8,"Order number"),a(),i(9,"th"),l(10,"Customer"),a(),i(11,"th",27),l(12,"Amount"),a(),i(13,"th",28),l(14," Created On "),a(),i(15,"th",29),l(16,"Channel"),a()()(),i(17,"tbody"),g(18,tn,16,12,"tr",30),a()(),i(19,"app-mat-paginator-no-count",31),x("total",function(){_(e);let t=d();return h(t.StoreRowsCountAPIResult())})("next",function(){_(e);let t=d();return h(t.NextPage())})("previous",function(){_(e);let t=d();return h(t.PreviousPage())}),a()(),D()}if(n&2){let e=d();o(18),s("ngForOf",e.data),o(),s("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function an(n,c){n&1&&(i(0,"div",37),f(1,"app-empty-state"),a())}var Zt=(()=>{class n{constructor(e,r){this.http=e,this.authService=r,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=P,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==I.GuidEMpty}getChannelLogo(e){return I.getChannelLogoByTypeId(e)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.customerInfoUrl=`${this.authService.getDomain()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var r={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetDelivered ",r).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"Paid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(r=>{this.paginationTotal=r.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let r=e.direction=="asc";this.data=this.data.sort((t,p)=>I.compare(t.Created,p.Created,r))}}static{this.\u0275fac=function(r){return new(r||n)(v(W),v(K))}}static{this.\u0275cmp=L({type:n,selectors:[["app-delivered"]],standalone:!1,decls:34,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","4 - Completed","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[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"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,t){if(r&1){let p=N();i(0,"mainpanel",1),x("onSubmit",function(m){return _(p),h(t.Get(m))}),i(1,"actions")(2,"a",2),f(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),a()()(),i(6,"filters")(7,"div")(8,"label",4),l(9,"Channel"),a(),i(10,"ng-select",5),b("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(11,Qi,3,3,"ng-template",6),a()(),i(12,"div",7)(13,"label",8),l(14,"Page Number"),a(),i(15,"input",9),b("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(16,"div",7)(17,"label",8),l(18,"Page Size"),a(),i(19,"input",10),b("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(20,"div",7)(21,"label",11),l(22,"From/To"),a(),i(23,"div",12)(24,"datepicker",13),b("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(25,"div")(26,"datepicker",14),b("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),g(31,nn,20,4,"ng-container",18)(32,an,2,0,"ng-template",null,0,B),a()()()()()}if(r&2){let p=O(33);o(10),s("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),s("ngIf",t.data&&t.data.length>0)("ngIfElse",p)}},dependencies:[A,R,q,ie,z,G,j,Y,J,ne,ae,$,pe,me,oe,le,X,U,V],encapsulation:2})}}return n})();var rn=()=>["/menu/Order/detail"],on=(n,c)=>({Number:n,Outlet:c});function ln(n,c){if(n&1&&(i(0,"span",21),f(1,"img",22),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,k)("alt",e.Name),o(),w(" ",e.Name," ")}}function pn(n,c){if(n&1&&(i(0,"a",38),l(1),a()),n&2){let e=d().$implicit;s("routerLink",ee(3,rn))("queryParams",te(4,on,e.Number,e.Outlet)),o(),u(e.Number)}}function mn(n,c){if(n&1&&(i(0,"a",39),l(1),a()),n&2){let e=d().$implicit,r=d(2);s("href",r.domain+e.ID,k),o(),u(e.Number)}}function sn(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),g(4,pn,2,7,"a",35)(5,mn,2,2,"a",36),a(),i(6,"td"),l(7),a(),i(8,"td"),l(9),E(10,"number"),a(),i(11,"td"),l(12),E(13,"date"),a(),i(14,"td"),l(15),a(),i(16,"td"),f(17,"app-channel-logo",37),a()()),n&2){let e=c.$implicit,r=d(2);o(2),u(e.Outlet),o(2),s("ngIf",r.hasGuidEmpty(e.ID)),o(),s("ngIf",!r.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,8,e.Amount)),o(3),u(F(13,10,e.Created,"dd MMM yyyy HH:mm")),o(3),u(e.State),o(2),s("typeId",e.TypeID)}}function dn(n,c){if(n&1){let e=N();T(0),i(1,"div",23)(2,"table",24),x("matSortChange",function(t){_(e);let p=d();return h(p.onSort(t))}),i(3,"thead",25)(4,"tr",26)(5,"th",27),l(6,"Outlet"),a(),i(7,"th",28),l(8,"Order number"),a(),i(9,"th"),l(10,"Customer"),a(),i(11,"th",29),l(12,"Amount"),a(),i(13,"th",30),l(14," Created On "),a(),i(15,"th",31),l(16,"Status"),a(),i(17,"th",32),l(18,"Channel"),a()()(),i(19,"tbody"),g(20,sn,18,13,"tr",33),a()(),i(21,"app-mat-paginator-no-count",34),x("total",function(){_(e);let t=d();return h(t.StoreRowsCountAPIResult())})("next",function(){_(e);let t=d();return h(t.NextPage())})("previous",function(){_(e);let t=d();return h(t.PreviousPage())}),a()(),D()}if(n&2){let e=d();o(20),s("ngForOf",e.data),o(),s("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function cn(n,c){n&1&&(i(0,"div",40),f(1,"app-empty-state"),a())}var ei=(()=>{class n{constructor(e,r,t,p){this.http=e,this.localDataService=r,this.authService=t,this.dialog=p,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==I.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var r={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetAll",r).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.Data],this.totaldata=this.data.length})}openExportDialog(){this.dialog.open(Lt,{data:{title:"Export Order All",pageNumber:this.filter.PageNumber,rowCount:this.filter.PageSize,filterExport:this.filter,getRowCountApi:"orders/GetRowCount",exportApi:"orders/GetExportAll"}}).afterClosed().subscribe()}changePage(e){this.filter=e,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"",DeliveryState:"",Bin:!1,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(r=>{this.paginationTotal=r.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let r=e.direction=="asc";this.data=this.data.sort((t,p)=>I.compare(t.Created,p.Created,r))}}static{this.\u0275fac=function(r){return new(r||n)(v(W),v(se),v(K),v(xe))}}static{this.\u0275cmp=L({type:n,selectors:[["app-all-order"]],standalone:!1,decls:38,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","All","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[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"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","135px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,t){if(r&1){let p=N();i(0,"mainpanel",1),x("onSubmit",function(m){return _(p),h(t.Get(m))}),i(1,"actions")(2,"a",2),f(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),a()(),i(6,"button",4),x("click",function(){return _(p),h(t.openExportDialog())}),f(7,"i",5),i(8,"span"),l(9,"Export"),a()()(),i(10,"filters")(11,"div")(12,"label",6),l(13,"Channel"),a(),i(14,"ng-select",7),b("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(15,ln,3,3,"ng-template",8),a()(),i(16,"div",9)(17,"label",10),l(18,"Page Number"),a(),i(19,"input",11),b("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(20,"div",9)(21,"label",10),l(22,"Page Size"),a(),i(23,"input",12),b("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(24,"div",9)(25,"label",13),l(26,"From/To"),a(),i(27,"div",14)(28,"datepicker",15),b("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(29,"div")(30,"datepicker",16),b("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(31,"content")(32,"div",17)(33,"div",18)(34,"div",19),g(35,dn,22,4,"ng-container",20)(36,cn,2,0,"ng-template",null,0,B),a()()()()()}if(r&2){let p=O(37);o(14),s("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),s("ngIf",t.data&&t.data.length>0)("ngIfElse",p)}},dependencies:[A,R,q,ie,z,G,j,Y,J,ne,ae,$,pe,me,oe,le,X,U,V],encapsulation:2})}}return n})();var _n=()=>["/menu/Order/detail"],hn=(n,c)=>({Number:n,Outlet:c});function gn(n,c){if(n&1&&(i(0,"span",20),f(1,"img",21),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,k)("alt",e.Name),o(),w(" ",e.Name," ")}}function un(n,c){if(n&1&&(i(0,"a",36),l(1),a()),n&2){let e=d().$implicit;s("routerLink",ee(3,_n))("queryParams",te(4,hn,e.Number,e.Outlet)),o(),u(e.Number)}}function fn(n,c){if(n&1&&(i(0,"a",37),l(1),a()),n&2){let e=d().$implicit,r=d(2);s("href",r.domain+e.ID,k),o(),u(e.Number)}}function Sn(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),g(4,un,2,7,"a",33)(5,fn,2,2,"a",34),a(),i(6,"td"),l(7),a(),i(8,"td"),l(9),E(10,"number"),a(),i(11,"td"),l(12),E(13,"date"),a(),i(14,"td"),f(15,"app-channel-logo",35),a()()),n&2){let e=c.$implicit,r=d(2);o(2),u(e.Outlet),o(2),s("ngIf",r.hasGuidEmpty(e.ID)),o(),s("ngIf",!r.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,7,e.Amount)),o(3),u(F(13,9,e.Created,"dd MMM yyyy HH:mm")),o(3),s("typeId",e.TypeID)}}function Cn(n,c){if(n&1){let e=N();T(0),i(1,"div",22)(2,"table",23),x("matSortChange",function(t){_(e);let p=d();return h(p.onSort(t))}),i(3,"thead",24)(4,"tr",25)(5,"th",26),l(6,"Outlet"),a(),i(7,"th",27),l(8,"Order number"),a(),i(9,"th"),l(10,"Customer"),a(),i(11,"th",28),l(12,"Amount"),a(),i(13,"th",29),l(14," Created On "),a(),i(15,"th",30),l(16,"Channel"),a()()(),i(17,"tbody"),g(18,Sn,16,12,"tr",31),a()(),i(19,"app-mat-paginator-no-count",32),x("total",function(){_(e);let t=d();return h(t.StoreRowsCountAPIResult())})("next",function(){_(e);let t=d();return h(t.NextPage())})("previous",function(){_(e);let t=d();return h(t.PreviousPage())}),a()(),D()}if(n&2){let e=d();o(18),s("ngForOf",e.data),o(),s("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function yn(n,c){n&1&&(i(0,"div",38),f(1,"app-empty-state"),a())}var ti=(()=>{class n{constructor(e,r,t){this.http=e,this.localDataService=r,this.authService=t,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],Note:"",From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==I.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var r={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,Note:this.filter.Note,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetCancelled ",r).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"",DeliveryState:"",Bin:!0,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(r=>{this.paginationTotal=r.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}getChannelLogo(e){return I.getChannelLogoByTypeId(e)}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let r=e.direction=="asc";this.data=this.data.sort((t,p)=>I.compare(t.Created,p.Created,r))}}static{this.\u0275fac=function(r){return new(r||n)(v(W),v(se),v(K))}}static{this.\u0275cmp=L({type:n,selectors:[["app-cancelled"]],standalone:!1,decls:38,vars:11,consts:[["EMPTY_STATE",""],["headerTitle","99 - Cancelled","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","text","name","Note",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[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"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(r,t){if(r&1){let p=N();i(0,"mainpanel",1),x("onSubmit",function(m){return _(p),h(t.Get(m))}),i(1,"actions")(2,"a",2),f(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),a()()(),i(6,"filters")(7,"div")(8,"label",4),l(9,"Channel"),a(),i(10,"ng-select",5),b("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(11,gn,3,3,"ng-template",6),a()(),i(12,"div",7)(13,"label",8),l(14,"Page Number"),a(),i(15,"input",9),b("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(16,"div",7)(17,"label",8),l(18,"Page Size"),a(),i(19,"input",10),b("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(20,"div",7)(21,"label",8),l(22,"Note"),a(),i(23,"input",11),b("ngModelChange",function(m){return _(p),y(t.filter.Note,m)||(t.filter.Note=m),h(m)}),a()(),i(24,"div",7)(25,"label",12),l(26,"From/To"),a(),i(27,"div",13)(28,"datepicker",14),b("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(29,"div")(30,"datepicker",15),b("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(31,"content")(32,"div",16)(33,"div",17)(34,"div",18),g(35,Cn,20,4,"ng-container",19)(36,yn,2,0,"ng-template",null,0,B),a()()()()()}if(r&2){let p=O(37);o(10),s("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(4),C("ngModel",t.filter.Note),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),s("ngIf",t.data&&t.data.length>0)("ngIfElse",p)}},dependencies:[A,R,q,ie,z,G,j,Y,J,ne,ae,$,pe,me,oe,le,X,U,V],encapsulation:2})}}return n})();var bn=(n,c)=>({"over-due-today":n,"over-due":c}),xn=n=>({"over-due":n});function wn(n,c){n&1&&(T(0),i(1,"a",19),l(2," Download V2 "),a(),D())}function vn(n,c){if(n&1){let e=N();T(0),i(1,"div",20)(2,"button",21),x("click",function(){_(e),d();let t=O(12);return h(t.previous())}),l(3," Back "),a(),i(4,"button",22),x("click",function(){_(e);let t=d(),p=O(12);return h(t.onNext(p))}),l(5," Next "),a()(),D()}if(n&2){let e=d();o(4),s("disabled",e.checkDisabledNextFilter())}}function Tn(n,c){if(n&1){let e=N();T(0),i(1,"button",23),x("click",function(){_(e);let t=d(),p=O(12);return h(t.onNext(p))}),l(2," Next "),a(),D()}if(n&2){let e=d();o(),s("disabled",e.checkDisabledNextFilter())}}function Dn(n,c){if(n&1){let e=N();T(0),i(1,"button",24),x("click",function(){_(e);let t=d(),p=O(12);return h(t.onNew(p))}),f(2,"i",25),l(3," New "),a(),D()}}function En(n,c){n&1&&(f(0,"i",26),i(1,"span"),l(2,"Filter"),a())}function Pn(n,c){if(n&1&&(i(0,"ng-option",36),f(1,"img",37),l(2),a()),n&2){let e=c.$implicit;s("value",e.ID),o(),s("src",e==null?null:e.Img,k),o(),w("",e.Name," ")}}function In(n,c){if(n&1){let e=N();i(0,"div",32)(1,"div",28)(2,"h5"),l(3,"Type"),a(),i(4,"p",29),l(5," Select Type want to download "),a()(),i(6,"div",28)(7,"div",38)(8,"div")(9,"mat-radio-group",39),b("ngModelChange",function(t){_(e);let p=d(2);return y(p.downloadType,t)||(p.downloadType=t),h(t)}),i(10,"mat-radio-button",40),l(11," Orders "),a(),i(12,"mat-radio-button",41),l(13," Disbursement "),a()()()(),i(14,"div",42)(15,"div",43),f(16,"i",44),a(),i(17,"p",45),l(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(n&2){let e=d(2);o(9),C("ngModel",e.downloadType),o(),s("value",!1),o(2),s("value",!0)}}function Nn(n,c){n&1&&(i(0,"p",29),l(1," Select Disbursement date "),i(2,"span",46),l(3,"(payment date / order complete date)"),a(),l(4," of the channel you want to download (Max 1 Week). "),a())}function Mn(n,c){n&1&&(i(0,"p",29),l(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function On(n,c){if(n&1){let e=N();T(0),i(1,"div",47)(2,"app-timepicker",48),b("timeChange",function(t){_(e);let p=d(2);return y(p.timeFrom,t)||(p.timeFrom=t),h(t)}),a(),i(3,"span",49),l(4,"-"),a(),i(5,"app-timepicker",48),b("timeChange",function(t){_(e);let p=d(2);return y(p.timeTo,t)||(p.timeTo=t),h(t)}),a()(),D()}if(n&2){let e=d(2);o(2),C("time",e.timeFrom),o(3),C("time",e.timeTo)}}function kn(n,c){if(n&1){let e=N();i(0,"div",27)(1,"div",8)(2,"div",7)(3,"div",28)(4,"h5"),l(5,"Select a Channel"),a(),i(6,"p",29),l(7," Select Channel want to download order "),a()(),i(8,"div",28)(9,"ng-select",30),b("ngModelChange",function(t){_(e);let p=d();return y(p.channelID,t)||(p.channelID=t),h(t)}),x("ngModelChange",function(){_(e);let t=d();return h(t.onSelectChannel())}),g(10,Pn,3,3,"ng-option",31),a()()(),g(11,In,19,3,"div",32),E(12,"async"),i(13,"div",32)(14,"div",28)(15,"h5"),l(16,"Date Range"),a(),g(17,Nn,5,0,"p",29)(18,Mn,2,0,"p",29),a(),i(19,"div",28)(20,"div",8)(21,"mat-date-range-input",33)(22,"input",34),b("ngModelChange",function(t){_(e);let p=d();return y(p.startDate,t)||(p.startDate=t),h(t)}),x("click",function(){_(e);let t=O(25);return h(t.open())}),a(),i(23,"input",35),b("ngModelChange",function(t){_(e);let p=d();return y(p.endDate,t)||(p.endDate=t),h(t)}),x("click",function(){_(e);let t=O(25);return h(t.open())})("ngModelChange",function(){_(e);let t=d();return h(t.onFilterDateChange())}),a()(),f(24,"mat-date-range-picker",null,1),a(),g(26,On,6,2,"ng-container",5),a()()()()}if(n&2){let e,r=O(25),t=d();o(9),s("clearable",!1),C("ngModel",t.channelID),o(),s("ngForOf",t.channelOptions),o(),Ke((e=M(12,9,t.channelDetail$))!=null&&e.ServiceFeeWriteOff?11:-1),o(6),Ke(t.downloadType()&&(t.currentChannel==null?null:t.currentChannel.TypeID)==t.channelType.Tokopedia?17:18),o(4),s("rangePicker",r),o(),C("ngModel",t.startDate),o(),C("ngModel",t.endDate),o(3),s("ngIf",t.showTimePicker)}}function Ln(n,c){n&1&&(f(0,"i",50),i(1,"span"),l(2,"Preview"),a())}function Vn(n,c){if(n&1&&(i(0,"th",72),l(1),a()),n&2){let e=d(3);o(),w(" ",e.currentChannel?"Created Date":"Last Status Update"," ")}}function Fn(n,c){if(n&1&&(i(0,"td"),l(1),E(2,"date"),a()),n&2){let e=d().$implicit;o(),w(" ",F(2,1,e.Date,"dd MMM yyyy HH:mm:ss")," ")}}function An(n,c){if(n&1&&(i(0,"span"),l(1),a()),n&2){let e=d().$implicit;o(),w(" ",e.ActionString," ")}}function Rn(n,c){if(n&1&&(i(0,"li"),l(1),a()),n&2){let e=c.$implicit;o(),w(" ",e," ")}}function Wn(n,c){if(n&1&&(i(0,"ul",77),g(1,Rn,2,1,"li",73),a()),n&2){let e=d().$implicit;o(),s("ngForOf",e.ActionString)}}function Bn(n,c){if(n&1&&(i(0,"span",78),f(1,"i",79),a()),n&2){let e=d().$implicit;rt("title","Delivery : ",e.DeliveryState,`
5
5
  Payment : `,e.PaymentState,"")}}function zn(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),l(4),a(),g(5,Fn,3,4,"td",5),i(6,"td")(7,"span"),l(8),a(),l(9),a(),i(10,"td",74)(11,"span"),l(12),a(),l(13),a(),i(14,"td"),g(15,An,2,1,"span",5)(16,Wn,2,1,"ul",75),a(),i(17,"td"),g(18,Bn,2,3,"span",76),a()()),n&2){let e=c.$implicit,r=c.index,t=d(4);o(2),u(r+1),o(2),u(e.Number),o(),s("ngIf",(t.currentChannel==null?null:t.currentChannel.TypeID)!=t.channelType.Shopee&&(t.currentChannel==null?null:t.currentChannel.TypeID)!==t.channelType.Tiktok),o(3),w("",e.ChannelStatus," - "),o(),w("",e.ChannelStatusDescription," "),o(),s("ngClass",te(12,bn,(e==null?null:e.Action)==t.actionPreviewOrder.Update,(e==null?null:e.Action)==t.actionPreviewOrder.New))("matTooltip",e.POSStatus==91||e.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),o(2),w("",e.POSStatus," - "),o(),w("",e.POSStatusDescription," "),o(2),s("ngIf",e.ActionString.length==1),o(),s("ngIf",e.ActionString.length>1),o(2),s("ngIf",e.ChannelStatus!=99&&e.POSStatus!=99)}}function Gn(n,c){if(n&1&&(T(0),g(1,zn,19,15,"tr",73),D()),n&2){let e=d(3);o(),s("ngForOf",e.displayedPreviewData)}}function jn(n,c){n&1&&(i(0,"tr",80)(1,"td",81)(2,"div",82),f(3,"i",83),a(),i(4,"h4",84),l(5," There is no order to processed "),a()()())}function Hn(n,c){if(n&1){let e=N();i(0,"div",52)(1,"div",53)(2,"div",54)(3,"div",55)(4,"div")(5,"ul",56)(6,"li",57)(7,"button",58),x("click",function(){_(e);let t=d(2);return h(t.filterPreviewData(t.previewStatus.ALL))}),l(8),a()(),i(9,"li",59)(10,"button",60),x("click",function(){_(e);let t=d(2);return h(t.filterPreviewData(t.previewStatus.SYNC))}),l(11),a()(),i(12,"li",59)(13,"button",61),x("click",function(){_(e);let t=d(2);return h(t.filterPreviewData(t.previewStatus.WRONG))}),l(14),a()(),i(15,"li",59)(16,"button",62),x("click",function(){_(e);let t=d(2);return h(t.filterPreviewData(t.previewStatus.UNSYNC))}),l(17),a()()()(),i(18,"div")(19,"button",63),x("click",function(){_(e);let t=d(2);return h(t.exportOrders())}),f(20,"i",64),i(21,"span"),l(22,"Export"),a()()()()(),i(23,"table",65)(24,"thead",66)(25,"tr"),f(26,"th",67),i(27,"th",68),l(28,"Number"),a(),g(29,Vn,2,1,"th",69),i(30,"th",70),l(31,"Channel Status"),a(),i(32,"th",70),l(33,"POS Status"),a(),i(34,"th"),l(35,"Action"),a(),f(36,"th",67),a()(),i(37,"tbody"),g(38,Gn,2,1,"ng-container",71)(39,jn,6,0,"ng-template",null,2,B),a()()()()}if(n&2){let e=O(40),r=d(2);o(7),s("ngClass",r.pillStatus=="all"?"btn-secondary text-white":"btn-outline-dark"),o(),w(" All (",r.allData,") "),o(2),s("ngClass",r.pillStatus=="sync"?"btn-success":"btn-outline-success"),o(),w(" Existing (",r.syncData,") "),o(2),s("ngClass",r.pillStatus=="wrong"?"btn-warning text-white":"btn-outline-warning"),o(),w(" Wrong Status (",r.wrongData,") "),o(2),s("ngClass",r.pillStatus=="unsync"?"btn-danger":"btn-outline-danger"),o(),w(" Missing (",r.unsyncData,") "),o(12),s("ngIf",(r.currentChannel==null?null:r.currentChannel.TypeID)!=r.channelType.Shopee&&(r.currentChannel==null?null:r.currentChannel.TypeID)!==r.channelType.Tiktok),o(9),s("ngIf",r.displayedPreviewData.length>0)("ngIfElse",e)}}function Un(n,c){if(n&1&&g(0,Hn,41,11,"div",51),n&2){let e=d();s("ngIf",e.currentState=="preview")}}function Yn(n,c){n&1&&(f(0,"i",85),i(1,"span"),l(2,"Finish"),a())}function qn(n,c){if(n&1&&(i(0,"tr",87)(1,"td"),l(2),a(),i(3,"td"),l(4),a(),i(5,"td"),l(6),a(),i(7,"td"),l(8),a()()),n&2){let e=c.$implicit,r=c.index;s("ngClass",lt(5,xn,e.Exception)),o(2),u(r+1),o(2),u(e.Number),o(2),u(e.Status),o(2),u(e.Exception)}}function Kn(n,c){if(n&1&&(T(0),g(1,qn,9,7,"tr",86),D()),n&2){let e=d(3);o(),s("ngForOf",e.downloadData)}}function Jn(n,c){n&1&&(i(0,"tr",80)(1,"td",81)(2,"div",82),f(3,"i",83),a(),i(4,"h4",84),l(5," There is no order to processed "),a()()())}function $n(n,c){if(n&1&&(i(0,"div",52)(1,"div",53)(2,"table",65)(3,"thead",66)(4,"tr"),f(5,"th",67),i(6,"th"),l(7,"Order Number"),a(),i(8,"th"),l(9,"Status"),a(),i(10,"th"),l(11,"Exception"),a()()(),i(12,"tbody"),g(13,Kn,2,1,"ng-container",71)(14,Jn,6,0,"ng-template",null,3,B),a()()()()),n&2){let e=O(15),r=d(2);o(13),s("ngIf",(r.downloadData==null?null:r.downloadData.length)>0)("ngIfElse",e)}}function Xn(n,c){if(n&1&&g(0,$n,16,2,"div",51),n&2){let e=d();s("ngIf",e.currentState=="finish")}}function Qn(n,c){n&1&&(i(0,"h6"),l(1,"1"),a())}function Zn(n,c){n&1&&(i(0,"h6"),l(1,"2"),a())}function ea(n,c){n&1&&(i(0,"h6"),l(1,"3"),a())}var Z=function(n){return n.ALL="all",n.SYNC="sync",n.WRONG="wrong",n.UNSYNC="unsync",n}(Z||{}),ii=(()=>{class n{constructor(e,r,t,p,S,m,Ee){this.http=e,this.toastr=r,this.datePipe=t,this.url=p,this.productService=S,this.orderService=m,this.authService=Ee,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=P,this.previewStatus=Z,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=Pe,this.cacheKey="",this.showTimePicker=!1,this.downloadType=nt(!1),this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initTimeFilter(),this.url.queryParams.subscribe(e=>{this.channelID=e.ChannelID,this.startDate=new Date(e.Date),this.endDate=new Date(e.Date)})}initTimeFilter(){this.timeFrom="00:00",this.timeTo="23:59"}onDownload(e){let r={ID:this.channelID,From:this.startDate,To:this.endDate,ListPreview:this.downloadedPreviewData,IsDisbursement:this.downloadType(),cacheKey:this.cacheKey};this.http.post("/api/Orders/Download",r).subscribe(t=>{this.downloadData=t.Body,this.onStepperNext(e)})}onPreview(e){if(!this.validateDatePreview())return;let r={ID:this.channelID,From:this.startDate,To:this.endDate,IsDisbursement:this.downloadType()};this.showTimePicker&&(r=Qe(Xe({},r),{TimeFrom:this.timeFrom+":00",TimeTo:this.timeTo+":00"})),this.http.post("/api/Orders/Preview",r).subscribe(t=>{if(t.Data.length==0){this.toastrEmptyPreview();return}this.cacheKey=t.cacheKey,this.previewData=t.Data,this.groupingPreviewData(),this.filterPreviewData(Z.ALL),this.initLengthStatusData(),this.onStepperNext(e)})}toastrEmptyPreview(){let e=this.datePipe.transform(this.startDate,"dd MMM yyyy"),r=this.datePipe.transform(this.endDate,"dd MMM yyyy"),t=this.showTimePicker?this.timeFrom+":00":"",p=this.showTimePicker?this.timeTo+":00":"";this.toastr.info(`There is no orders from ${e} ${t} to ${r} ${p}!`,"No Orders!")}validateDatePreview(){let e=!0;return this.downloadType()==!0?I.getDaysDiff(this.startDate,this.endDate)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Failed"),e=!1):I.getDaysDiff(this.startDate,this.endDate)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Failed"),e=!1),e}onSelectChannel(){this.currentChannel=this.channelOptions.find(e=>e.ID==this.channelID),this.initGetChannelDetail()}initGetChannelDetail(){this.currentChannel.TypeID==P.Tokopedia?this.channelDetail$=this.http.post("/api/ChannelLoader/GetChannelView",{ID:this.currentChannel.ID}).pipe(H(e=>e?.Model),he(1)):this.channelDetail$=null}setPageTitle(e){this.pageTitle=`
6
6
  ${e} (${this.getDateTitle()})
7
7
  `}getDateTitle(){let e=I.formatTitleFromDate(new Date(this.startDate),new Date(this.endDate)),r=this.datePipe.transform(this.startDate,e),t=this.datePipe.transform(this.endDate,"dd MMM yyyy");return`${e==null?"":r+"-"} ${t}`}onNew(e){this.channelID=null,this.startDate=null,this.endDate=null,this.pageTitle="Download to POS",this.channelDetail$=null,e.reset()}groupingPreviewData(){let e=this.filterDataByStatus(Z.UNSYNC),r=this.filterDataByStatus(Z.WRONG),t=[];this.currentChannel.TypeID==P.Tokopedia&&(t=this.filterDataByStatus(Z.SYNC)),this.downloadedPreviewData=[...t,...e,...r]}filterDataByStatus(e){let r=[];switch(e){case Z.ALL:r=this.previewData;break;case Z.SYNC:r=this.previewData.filter(t=>t.Action==Pe.DoNothing);break;case Z.WRONG:r=this.previewData.filter(t=>t.Action==Pe.Update);break;case Z.UNSYNC:r=this.previewData.filter(t=>t.Action==Pe.New);break}return r}filterPreviewData(e){this.pillStatus=e,this.displayedPreviewData=this.filterDataByStatus(e)}initLengthStatusData(){this.wrongData=this.filterDataByStatus(Z.WRONG).length,this.allData=this.previewData.length,this.syncData=this.filterDataByStatus(Z.SYNC).length,this.unsyncData=this.filterDataByStatus(Z.UNSYNC).length}getTypeID(){var e=this.channelOptions.find(r=>r.ID==this.channelID)?.TypeID;return e??0}onStepperChange(e){this.currentState=e.selectedStep.state}onStepperNext(e){e.selected.completed=!0,e.next()}onNext(e){switch(this.currentState){case"filter":this.onPreview(e);break;case"preview":this.onDownload(e);break}}stepChange(e){switch(e?.selectedStep?.state){case"filter":this.pageTitle="Download To POS",this.resetPreviewData();break;case"preview":let r=this.productService.findChannelById(this.channelID,this.channelOptions);this.setPageTitle(`Preview ${r?.Name}`);break;case"finish":this.setPageTitle("Download");break}}resetPreviewData(){this.displayedPreviewData=[],this.previewData=[],this.initLengthStatusData()}checkDisabledNextFilter(){let e=!I.isValidDate(this.startDate)||!I.isValidDate(this.endDate),r=I.IsEmpty(this.channelID);return e||r}exportOrders(){let e={ID:this.channelID,From:this.startDate,To:this.endDate},r=`Orders ${this.getDateTitle()}`;this.orderService.exportOrders(e,r).subscribe()}onFilterDateChange(){let e=1;this.startDate&&this.endDate&&(e=I.getDaysDiff(this.startDate,this.endDate)),this.showTimePicker=e==0}static{this.\u0275fac=function(r){return new(r||n)(v(W),v(be),v(V),v(Re),v(Pt),v(we),v(K))}}static{this.\u0275cmp=L({type:n,selectors:[["app-download"]],standalone:!1,features:[ot([{provide:At,useValue:{displayDefaultIndicatorType:!1}}])],decls:25,vars:13,consts:[["stepper",""],["picker",""],["EMPTY",""],["EMPTY_DOWNLOAD",""],[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["linear","",1,"w-100","stepper-download",3,"selectionChange","ngClass"],["state","filter",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","preview",3,"editable","completed"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],["routerLink","/menu/Order/Download",1,"btn","btn-outline-secondary","btn-fill","me-3"],[1,"btn-group","me-3"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","bg-success","text-white",3,"click","disabled"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"click","disabled"],[1,"btn","btn-outline-secondary","btn-fill",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[1,"fa-solid","fa-filter","me-3"],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[1,"mt-8"],[3,"timeChange","time"],[1,"mx-4"],[1,"fa-solid","fa-file","me-3"],["class","row pt-2",4,"ngIf"],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"col-12","d-flex","justify-content-between","align-items-end",2,"padding-left","0px","padding-right","0px"],[1,"nav","nav-pills"],[1,"nav-item","me-3"],[1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],[1,"nav-item","mx-3"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["width","15%"],[4,"ngFor","ngForOf"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"]],template:function(r,t){if(r&1){let p=N();i(0,"mainpanel",4)(1,"actions"),g(2,wn,3,0,"ng-container",5)(3,vn,6,1,"ng-container",5)(4,Tn,3,1,"ng-container",5)(5,Dn,4,0,"ng-container",5),a(),i(6,"content")(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"mat-stepper",10,0),x("selectionChange",function(m){return _(p),h(t.stepChange(m))})("selectionChange",function(m){return _(p),h(t.onStepperChange(m))}),i(13,"mat-step",11),g(14,En,3,0,"ng-template",12)(15,kn,27,11,"ng-template",13),a(),i(16,"mat-step",14),g(17,Ln,3,0,"ng-template",12)(18,Un,1,1,"ng-template",13),a(),i(19,"mat-step",15),g(20,Yn,3,0,"ng-template",12)(21,Xn,1,1,"ng-template",13),a(),g(22,Qn,2,0,"ng-template",16)(23,Zn,2,0,"ng-template",17)(24,ea,2,0,"ng-template",18),a()()()()()()()}if(r&2){let p=O(12);s("headerTitle",t.pageTitle)("description",t.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),o(2),s("ngIf",t.currentState=="filter"),o(),s("ngIf",t.currentState=="preview"),o(),s("ngIf",t.currentState=="filter"),o(),s("ngIf",t.currentState=="finish"),o(6),at("ngClass","last-edited-step-"+p.selectedIndex),o(2),s("editable",t.currentState!="finish")("completed",!1),o(3),s("editable",t.currentState!="finish")("completed",!1)}},dependencies:[pt,A,R,q,z,G,j,Y,J,dt,It,Nt,Mt,Ot,zt,Rt,Gt,Wt,Bt,_t,ze,vt,Tt,Ce,V],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.vertical-radio{display:flex;flex-direction:column;margin:15px 0}.mt-1rem{margin-top:1rem}.dateRange{padding-top:.8rem;padding-bottom:.8rem}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}.form-label-group.radio.download-type{height:45.5938px!important;border-radius:.375rem!important}
8
- `],encapsulation:2})}}return n})();var ta=[{path:"",component:Yt,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:Kt,canActivate:[re],data:{title:"New Order"}},{path:"detail",component:Jt,canActivate:[re],data:{title:"Orders detail"}},{path:"ready_to_ship",component:Xt,canActivate:[re],data:{title:"Ready To Ship"}},{path:"Shipped",component:Qt,canActivate:[re],data:{title:"Shipped"}},{path:"Delivered",component:Zt,canActivate:[re],data:{title:"Delivered"}},{path:"All",component:ei,canActivate:[re],data:{title:"All Order"}},{path:"Cancelled",component:ti,canActivate:[re],data:{title:"Cancelled"}},{path:"Download/V1",component:ii,canActivate:[re],data:{title:"Download V1"}},{path:"Download",loadComponent(){return import("./chunk-72WUBVEI.js").then(n=>n.DownloadV2Component)},canActivate:[re],data:{title:"Download"}},{path:"Download_Order_Log",loadComponent:()=>import("./chunk-UHQVAZB3.js").then(n=>n.DownloadOrderLogComponent),canActivate:[re],data:{title:"Download Order Log"}},{path:"Download_Order_Log/Detail",loadComponent:()=>import("./chunk-ONK4P7TL.js").then(n=>n.DownloadOrderDetailComponent),canActivate:[re],data:{title:"Download Order Log Detail"}}]}],ni=(()=>{class n{static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275mod=Ae({type:n})}static{this.\u0275inj=Fe({imports:[ye,We.forChild(ta)]})}}return n})();var lo=(()=>{class n{static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275mod=Ae({type:n})}static{this.\u0275inj=Fe({providers:[we,Ge,He],imports:[ye,st,ni,wt,Ct,Vt,We,ct,kt,Ft,$,jt,ht,bt,Ut,St,Et,yt,X,Ue,ze,Dt]})}}return n})();export{lo as OrdersModule};
8
+ `],encapsulation:2})}}return n})();var ta=[{path:"",component:Yt,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:Kt,canActivate:[re],data:{title:"New Order"}},{path:"detail",component:Jt,canActivate:[re],data:{title:"Orders detail"}},{path:"ready_to_ship",component:Xt,canActivate:[re],data:{title:"Ready To Ship"}},{path:"Shipped",component:Qt,canActivate:[re],data:{title:"Shipped"}},{path:"Delivered",component:Zt,canActivate:[re],data:{title:"Delivered"}},{path:"All",component:ei,canActivate:[re],data:{title:"All Order"}},{path:"Cancelled",component:ti,canActivate:[re],data:{title:"Cancelled"}},{path:"Download/V1",component:ii,canActivate:[re],data:{title:"Download V1"}},{path:"Download",loadComponent(){return import("./chunk-D7G7GVNH.js").then(n=>n.DownloadV2Component)},canActivate:[re],data:{title:"Download"}},{path:"Download_Order_Log",loadComponent:()=>import("./chunk-QP6X3QVC.js").then(n=>n.DownloadOrderLogComponent),canActivate:[re],data:{title:"Download Order Log"}},{path:"Download_Order_Log/Detail",loadComponent:()=>import("./chunk-ONK4P7TL.js").then(n=>n.DownloadOrderDetailComponent),canActivate:[re],data:{title:"Download Order Log Detail"}}]}],ni=(()=>{class n{static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275mod=Ae({type:n})}static{this.\u0275inj=Fe({imports:[ye,We.forChild(ta)]})}}return n})();var lo=(()=>{class n{static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275mod=Ae({type:n})}static{this.\u0275inj=Fe({providers:[we,Ge,He],imports:[ye,st,ni,wt,Ct,Vt,We,ct,kt,Ft,$,jt,ht,bt,Ut,St,Et,yt,X,Ue,ze,Dt]})}}return n})();export{lo as OrdersModule};
@@ -1,4 +1,4 @@
1
- import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-VAPIXIJ3.js";import{b as ie}from"./chunk-3NMGN7IE.js";import{a as ee,b as te}from"./chunk-ARIW575T.js";import{a as X}from"./chunk-AUGXMJYD.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as Q}from"./chunk-D2R7H4PZ.js";import{e as J}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as Y,m as Z}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as G,h as z,m as K,y as q}from"./chunk-AI4XRCAL.js";import"./chunk-W6T7TOHE.js";import{F as W,H as j,J as $,f as x,g as V,h as A,n as H}from"./chunk-B6POIFQM.js";import{Dc as v,Eb as C,Ec as p,Fb as k,Fc as B,Gc as L,Ic as O,Jc as F,Ka as M,Kb as m,Kc as R,Mc as P,Oc as w,Wb as l,gc as n,hc as i,ic as c,ja as I,jc as f,ka as T,kc as _,mc as S,nb as N,oa as U,qb as a,rc as y,sc as d,wb as D,ya as g,za as h}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var _e=e=>[e];function ge(e,s){if(e&1&&(f(0),n(1,"a",9),p(2),i(),_()),e&2){let t=s.$implicit;a(),l("routerLink",w(2,_e,t.url)),a(),L(" ",t.title,"")}}var ce=(()=>{class e{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-download"]],standalone:!1,decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(o,r){o&1&&(n(0,"nav",0)(1,"div",1)(2,"div"),c(3,"nav-tab",2),i()(),n(4,"div")(5,"div",3)(6,"a",4),c(7,"i",5),i(),n(8,"div",6)(9,"div",7),m(10,ge,3,4,"ng-container",8),i()()()()(),c(11,"router-outlet")),o&2&&(a(3),l("Tabs",r.tabs),a(7),l("ngForOf",r.moreMenu))},dependencies:[x,ee,W,j],encapsulation:2})}}return e})();var E=(()=>{class e{constructor(t){this.httpService=t}download(t){return this.httpService.post("/api/Product/downloadurl",t)}static{this.\u0275fac=function(o){return new(o||e)(U(J))}}static{this.\u0275prov=I({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Se=e=>({"background-color":e});function Ce(e,s){if(e&1&&(n(0,"th"),p(1),i()),e&2){let t=s.$implicit;a(),B(t.column)}}function ye(e,s){if(e&1&&(f(0),n(1,"td"),c(2,"span",6),i(),_()),e&2){let t=s.$implicit,o=d().$implicit;a(2),l("innerHTML",o[t.prop],N)}}function ve(e,s){if(e&1&&(n(0,"tr",5),m(1,ye,3,1,"ng-container",3),i()),e&2){let t=s.$implicit,o=d();l("ngStyle",w(2,Se,t.Status>200?"#F4D6D5":"#DEE9C9")),a(),l("ngForOf",o.configs)}}var de=(()=>{class e{constructor(){this.eventClose=new M}ngOnInit(){}onClose(){this.eventClose.emit()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},standalone:!1,decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(o,r){o&1&&(n(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),m(4,Ce,2,1,"th",3),i()(),n(5,"tbody"),m(6,ve,2,4,"tr",4),i()()()),o&2&&(a(4),l("ngForOf",r.configs),a(2),l("ngForOf",r.data))},dependencies:[x,A],encapsulation:2})}}return e})();function xe(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onNewStepperState(u))}),c(2,"i",16),p(3," New "),i(),_()}}function be(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t),d();let r=v(11);return h(r.previous())}),p(2," Back "),i(),_()}}function Ee(e,s){if(e&1){let t=S();f(0),n(1,"button",17),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onStepperNext(u))}),p(2," Next "),i(),_()}}function De(e,s){if(e&1){let t=S();f(0),n(1,"button",18),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onSubmit(u))}),p(2,"Download"),i(),_()}if(e&2){let t=d();a(),l("disabled",!t.urls)}}function Ie(e,s){e&1&&(c(0,"i",19),n(1,"span"),p(2,"Instruction"),i())}function Te(e,s){e&1&&(n(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),p(4,"Note"),i()(),n(5,"div",24)(6,"ol",25)(7,"li"),p(8," Use this form to Download Products from Tokopedia using product URL "),i(),n(9,"li"),p(10," Copy Product URL from "),n(11,"a",26),p(12,"https://seller.tokopedia.com/ "),i(),p(13," and paste in this form "),i(),n(14,"li"),p(15," Use New Line when you want to input several product URLs "),i()()()()())}function Ue(e,s){e&1&&(c(0,"i",27),n(1,"span"),p(2,"Download"),i())}function Me(e,s){if(e&1){let t=S();n(0,"div",20)(1,"textarea",28),R("ngModelChange",function(r){g(t);let u=d();return F(u.urls,r)||(u.urls=r),h(r)}),i()()}if(e&2){let t=d();a(),l("placeholder",t.urlPlaceholder),O("ngModel",t.urls)}}function Ne(e,s){e&1&&(c(0,"i",29),n(1,"span"),p(2,"Finish"),i())}function ke(e,s){if(e&1&&(n(0,"div",20),c(1,"app-response-api-list",30),i()),e&2){let t=d();a(),l("data",t.downloadResponses)("configs",t.configs)}}function Be(e,s){e&1&&(n(0,"h6"),p(1,"1"),i())}function Le(e,s){e&1&&(n(0,"h6"),p(1,"2"),i())}function Oe(e,s){e&1&&(n(0,"h6"),p(1,"3"),i())}var ue=(()=>{class e{constructor(t,o){this.downloadService=t,this.authService=o,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
1
+ import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-VAPIXIJ3.js";import{b as ie}from"./chunk-3NMGN7IE.js";import{a as ee,b as te}from"./chunk-ARIW575T.js";import{a as X}from"./chunk-MV2W43TI.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as Q}from"./chunk-CIKNTHCR.js";import{e as J}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as Y,m as Z}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as G,h as z,m as K,y as q}from"./chunk-AI4XRCAL.js";import"./chunk-W6T7TOHE.js";import{F as W,H as j,J as $,f as x,g as V,h as A,n as H}from"./chunk-B6POIFQM.js";import{Dc as v,Eb as C,Ec as p,Fb as k,Fc as B,Gc as L,Ic as O,Jc as F,Ka as M,Kb as m,Kc as R,Mc as P,Oc as w,Wb as l,gc as n,hc as i,ic as c,ja as I,jc as f,ka as T,kc as _,mc as S,nb as N,oa as U,qb as a,rc as y,sc as d,wb as D,ya as g,za as h}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var _e=e=>[e];function ge(e,s){if(e&1&&(f(0),n(1,"a",9),p(2),i(),_()),e&2){let t=s.$implicit;a(),l("routerLink",w(2,_e,t.url)),a(),L(" ",t.title,"")}}var ce=(()=>{class e{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-download"]],standalone:!1,decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(o,r){o&1&&(n(0,"nav",0)(1,"div",1)(2,"div"),c(3,"nav-tab",2),i()(),n(4,"div")(5,"div",3)(6,"a",4),c(7,"i",5),i(),n(8,"div",6)(9,"div",7),m(10,ge,3,4,"ng-container",8),i()()()()(),c(11,"router-outlet")),o&2&&(a(3),l("Tabs",r.tabs),a(7),l("ngForOf",r.moreMenu))},dependencies:[x,ee,W,j],encapsulation:2})}}return e})();var E=(()=>{class e{constructor(t){this.httpService=t}download(t){return this.httpService.post("/api/Product/downloadurl",t)}static{this.\u0275fac=function(o){return new(o||e)(U(J))}}static{this.\u0275prov=I({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Se=e=>({"background-color":e});function Ce(e,s){if(e&1&&(n(0,"th"),p(1),i()),e&2){let t=s.$implicit;a(),B(t.column)}}function ye(e,s){if(e&1&&(f(0),n(1,"td"),c(2,"span",6),i(),_()),e&2){let t=s.$implicit,o=d().$implicit;a(2),l("innerHTML",o[t.prop],N)}}function ve(e,s){if(e&1&&(n(0,"tr",5),m(1,ye,3,1,"ng-container",3),i()),e&2){let t=s.$implicit,o=d();l("ngStyle",w(2,Se,t.Status>200?"#F4D6D5":"#DEE9C9")),a(),l("ngForOf",o.configs)}}var de=(()=>{class e{constructor(){this.eventClose=new M}ngOnInit(){}onClose(){this.eventClose.emit()}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=C({type:e,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},standalone:!1,decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(o,r){o&1&&(n(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),m(4,Ce,2,1,"th",3),i()(),n(5,"tbody"),m(6,ve,2,4,"tr",4),i()()()),o&2&&(a(4),l("ngForOf",r.configs),a(2),l("ngForOf",r.data))},dependencies:[x,A],encapsulation:2})}}return e})();function xe(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onNewStepperState(u))}),c(2,"i",16),p(3," New "),i(),_()}}function be(e,s){if(e&1){let t=S();f(0),n(1,"button",15),y("click",function(){g(t),d();let r=v(11);return h(r.previous())}),p(2," Back "),i(),_()}}function Ee(e,s){if(e&1){let t=S();f(0),n(1,"button",17),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onStepperNext(u))}),p(2," Next "),i(),_()}}function De(e,s){if(e&1){let t=S();f(0),n(1,"button",18),y("click",function(){g(t);let r=d(),u=v(11);return h(r.onSubmit(u))}),p(2,"Download"),i(),_()}if(e&2){let t=d();a(),l("disabled",!t.urls)}}function Ie(e,s){e&1&&(c(0,"i",19),n(1,"span"),p(2,"Instruction"),i())}function Te(e,s){e&1&&(n(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),p(4,"Note"),i()(),n(5,"div",24)(6,"ol",25)(7,"li"),p(8," Use this form to Download Products from Tokopedia using product URL "),i(),n(9,"li"),p(10," Copy Product URL from "),n(11,"a",26),p(12,"https://seller.tokopedia.com/ "),i(),p(13," and paste in this form "),i(),n(14,"li"),p(15," Use New Line when you want to input several product URLs "),i()()()()())}function Ue(e,s){e&1&&(c(0,"i",27),n(1,"span"),p(2,"Download"),i())}function Me(e,s){if(e&1){let t=S();n(0,"div",20)(1,"textarea",28),R("ngModelChange",function(r){g(t);let u=d();return F(u.urls,r)||(u.urls=r),h(r)}),i()()}if(e&2){let t=d();a(),l("placeholder",t.urlPlaceholder),O("ngModel",t.urls)}}function Ne(e,s){e&1&&(c(0,"i",29),n(1,"span"),p(2,"Finish"),i())}function ke(e,s){if(e&1&&(n(0,"div",20),c(1,"app-response-api-list",30),i()),e&2){let t=d();a(),l("data",t.downloadResponses)("configs",t.configs)}}function Be(e,s){e&1&&(n(0,"h6"),p(1,"1"),i())}function Le(e,s){e&1&&(n(0,"h6"),p(1,"2"),i())}function Oe(e,s){e&1&&(n(0,"h6"),p(1,"3"),i())}var ue=(()=>{class e{constructor(t,o){this.downloadService=t,this.authService=o,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
2
2
  https://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat`,this.currentDomain=this.authService.getDomain()}onStepperChange(t){this.stepperState=t.selectedStep.state}onSubmit(t){let o=this.urls.split(/\r?\n/);this.downloadService.download(o).subscribe(r=>{this.downloadResponses=r,this.mappingLinkToProduct(),this.onStepperNext(t)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(t=>(t.Name=t?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${t.ID}" target="_blank">
3
3
  ${t?.Name}
4
4
  </a>`:"-",t))}onNewStepperState(t){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",t.reset(),this.onStepperNext(t)}onStepperNext(t){t.selected.completed=!0,t.next()}static{this.\u0275fac=function(o){return new(o||e)(D(E),D(Q))}}static{this.\u0275cmp=C({type:e,selectors:[["app-by-url"]],standalone:!1,features:[P([{provide:ne,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:11,consts:[["stepper",""],["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["linear","",1,"stepper-downloadByUrl",3,"selectionChange","selectedIndex"],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","DOWNLOAD",3,"editable","completed"],["state","FINISH"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"click","disabled"],[1,"fa-solid","fa-info","me-3"],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],[1,"fa-solid","fa-download","me-3"],["name","url","cols","30","rows","25",1,"form-control",3,"ngModelChange","placeholder","ngModel"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],["status","error",3,"data","configs"]],template:function(o,r){if(o&1){let u=S();n(0,"mainpanel",1)(1,"actions"),m(2,xe,4,0,"ng-container",2)(3,be,3,0,"ng-container",2)(4,Ee,3,0,"ng-container",2)(5,De,3,1,"ng-container",2),i(),n(6,"content")(7,"div",3)(8,"div",4)(9,"div",5)(10,"mat-stepper",6,0),y("selectionChange",function(fe){return g(u),h(r.onStepperChange(fe))}),n(12,"mat-step",7),m(13,Ie,3,0,"ng-template",8)(14,Te,16,0,"ng-template",9),i(),n(15,"mat-step",10),m(16,Ue,3,0,"ng-template",8)(17,Me,2,2,"ng-template",9),i(),n(18,"mat-step",11),m(19,Ne,3,0,"ng-template",8)(20,ke,2,2,"ng-template",9),i(),m(21,Be,2,0,"ng-template",12)(22,Le,2,0,"ng-template",13)(23,Oe,2,0,"ng-template",14),i()()()()()()}o&2&&(l("hideSearchBox",!0)("hideSearchDropdown",!0),a(2),l("ngIf",r.stepperState=="FINISH"),a(),l("ngIf",r.stepperState=="DOWNLOAD"),a(),l("ngIf",r.stepperState=="GUIDE"),a(),l("ngIf",r.stepperState=="DOWNLOAD"),a(5),l("selectedIndex",1),a(2),l("editable",r.stepperState!="FINISH")("completed",!0),a(3),l("editable",r.stepperState!="FINISH")("completed",!1))},dependencies:[V,G,z,K,Y,le,oe,pe,re,ae,de],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}
@@ -1 +1 @@
1
- import{a as M}from"./chunk-7UTZLQI6.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as B}from"./chunk-EQD3IUMF.js";import{a as se}from"./chunk-BVIRHZTZ.js";import{a as Ve,b as Te}from"./chunk-OBN6RKRH.js";import{a as be,b as Fe}from"./chunk-5Z63CRGG.js";import"./chunk-UOAYF4SW.js";import{a as ye}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import"./chunk-SD7UKXTX.js";import"./chunk-TY4H2W6F.js";import{a as ve}from"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as Ce,b as ue,d as fe,e as xe}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as he}from"./chunk-D2R7H4PZ.js";import{b as _e,e as me}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{d as Se,k as Pe,l as Ie,m as we}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{b as ie,c as oe,h as ae,m as re,o as le,y as ce}from"./chunk-AI4XRCAL.js";import{c as pe,e as de,f as ge}from"./chunk-W6T7TOHE.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-B6POIFQM.js";import{Dc as H,Eb as z,Ec as d,Fc as R,G as W,Gc as b,Ic as I,Jc as w,Kb as h,Kc as y,Mc as J,Oc as F,Wb as p,Xc as v,Yc as V,Z as A,Zc as Z,_c as Q,bc as S,cc as N,ea as $,ec as k,fc as L,gc as a,hc as c,ic as P,jc as G,kc as q,mc as f,ob as T,pa as j,qb as l,rc as C,sc as r,vc as K,wb as u,ya as _,za as m}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var U=i=>[i],Re=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i}),Ue=i=>({"ms-10":i});function Oe(i,s){if(i&1&&(a(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),p("src",e==null?null:e.Img,T),l(),b(" ",e.Name," ")}}function We(i,s){if(i&1){let e=f();a(0,"button",16),C("click",function(){_(e);let t=r().ngIf,o=r(2);return m(o.updateStock(t))}),P(1,"i",17),d(2," Update "),c()}}function Ae(i,s){if(i&1){let e=f();a(0,"actions")(1,"div",12),h(2,We,3,0,"button",13),a(3,"button",14),C("click",function(){_(e);let t=r(2);return m(t.openExportDialog())}),P(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),p("ngIf",n.productService.hasSelectionVariant(e))}}function $e(i,s){if(i&1){let e=f();a(0,"th")(1,"input",32),C("change",function(t){_(e);let o=r().ngIf,g=r(2);return m(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function je(i,s){if(i&1){let e=f();a(0,"input",51),y("ngModelChange",function(t){_(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),C("ngModelChange",function(){_(e);let t=r(4).$implicit,o=r(3);return m(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function ze(i,s){if(i&1&&h(0,je,1,1,"ng-template",26),i&2){let e=r(6);p("ngxPermissionsOnly",F(1,U,e.rolePriceEdit))}}function Ge(i,s){if(i&1){let e=f();G(0),a(1,"img",52),C("click",function(t){_(e);let o=r(3).$implicit,g=r(3);return m(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,T)}}function qe(i,s){i&1&&P(0,"img",53)}function Ke(i,s){if(i&1&&(a(0,"small",50),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function He(i,s){if(i&1&&(a(0,"td",44)(1,"div",45),h(2,ze,1,3,null,26),a(3,"div",46),h(4,Ge,2,1,"ng-container",47)(5,qe,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",48)(8,"span",49),d(9),c(),h(10,Ke,2,1,"small",50),c()),i&2){let e=H(6),n=r(2).$implicit;p("rowSpan",n.Variants.length),l(2),S((n.Variants==null?null:n.Variants.length)>1?2:-1),l(),p("ngClass",F(8,Ue,(n.Variants==null?null:n.Variants.length)<=1)),l(),p("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),p("rowSpan",n.Variants.length),l(2),R(n.Name),l(),S(n.Category?10:-1)}}function Je(i,s){if(i&1){let e=f();a(0,"input",56),y("ngModelChange",function(t){_(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Ze(i,s){if(i&1&&(a(0,"td",54),h(1,Je,1,1,"input",55),c()),i&2){let e=r().$implicit;l(),S(e.UnitPrice>=0?1:-1)}}function Qe(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Xe(i,s){if(i&1&&(a(0,"div"),d(1),v(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.UnitPrice)," ")}}function Ye(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let e=r().$implicit,n=r(4);l(),p("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),T)}}function et(i,s){if(i&1){let e=f();a(0,"div",58),C("click",function(){_(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,x=r();return m(x.openTableDialog(t,o,g))}),d(1),v(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function tt(i,s){if(i&1){let e=f();a(0,"tr",33),h(1,He,11,10),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Ze,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Qe,2,0,"div",36)(11,Xe,3,3,"div")(12,Ye,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,et,3,3,"div",39),a(16,"div",37)(17,"a",40),P(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=_(e).$implicit,o=r(4);return m(o.refreshPrice(t))}),P(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),S(n==0?1:-1),l(2),R(e.Model),l(2),p("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",F(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),p("ngxPermissionsOnly",F(14,U,t.rolePriceEdit)),l(3),S((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),p("ngClass",F(16,Be,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),S(e.Channel.length>0?15:-1),l(2),p("href",e.Channel[0]==null?null:e.Channel[0].Url,T)}}function nt(i,s){if(i&1&&k(0,tt,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function it(i,s){if(i&1){let e=f();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(t){_(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),m(t)}),C("toggleChange",function(){_(e);let t=r(2);return m(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,$e,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){_(e);let t=r(2);return m(t.openModalFilter())}),P(21,"img",29),a(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,nt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),v(29,"async"),C("onNextPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=r(2);return m(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",F(16,U,n.rolePriceEdit)),l(4),p("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),p("src",n.selectedChannel==null?null:n.selectedChannel.Img,T),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),p("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",V(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function ot(i,s){if(i&1){let e=f();a(0,"mainpanel",2),y("textChange",function(t){_(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),m(t)}),C("onSubmit",function(){_(e);let t=r();return m(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),m(t)}),h(6,Oe,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),m(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),m(t)}),c()()(),h(15,Ae,7,1,"actions",9),v(16,"async"),h(17,it,30,18,"content",9),v(18,"async"),c()}if(i&2){let e=r();p("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),p("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),p("ngIf",V(16,9,e.data$)),l(2),p("ngIf",V(18,11,e.data$))}}var At=(()=>{class i{constructor(e,n,t,o,g,x,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=x,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(B),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(x=>pe.IsNotEmpty(x))).subscribe(x=>{this.updateItemAfterDialog(x,e)})}updateItemAfterDialog(e,n){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),x=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${x}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Se),u(ye),u(ve),u(M),u(he),u(Pe),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([B,M,ne("https://res.cloudinary.com/"),D])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,ot,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",V(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,xe,fe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0})}}return i})();export{At as PriceSingleChannelComponent};
1
+ import{a as M}from"./chunk-3YRPTVAF.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as B}from"./chunk-EQD3IUMF.js";import{a as se}from"./chunk-BVIRHZTZ.js";import{a as Ve,b as Te}from"./chunk-OBN6RKRH.js";import{a as be,b as Fe}from"./chunk-5Z63CRGG.js";import"./chunk-UOAYF4SW.js";import{a as ye}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import"./chunk-SD7UKXTX.js";import"./chunk-TY4H2W6F.js";import{a as ve}from"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-R5IDWUP6.js";import"./chunk-4RAOUTR2.js";import{a as Ce,b as ue,d as fe,e as xe}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as he}from"./chunk-CIKNTHCR.js";import{b as _e,e as me}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{d as Se,k as Pe,l as Ie,m as we}from"./chunk-XOT2SZPE.js";import"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{b as ie,c as oe,h as ae,m as re,o as le,y as ce}from"./chunk-AI4XRCAL.js";import{c as pe,e as de,f as ge}from"./chunk-W6T7TOHE.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-B6POIFQM.js";import{Dc as H,Eb as z,Ec as d,Fc as R,G as W,Gc as b,Ic as I,Jc as w,Kb as h,Kc as y,Mc as J,Oc as F,Wb as p,Xc as v,Yc as V,Z as A,Zc as Z,_c as Q,bc as S,cc as N,ea as $,ec as k,fc as L,gc as a,hc as c,ic as P,jc as G,kc as q,mc as f,ob as T,pa as j,qb as l,rc as C,sc as r,vc as K,wb as u,ya as _,za as m}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var U=i=>[i],Re=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i}),Ue=i=>({"ms-10":i});function Oe(i,s){if(i&1&&(a(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),p("src",e==null?null:e.Img,T),l(),b(" ",e.Name," ")}}function We(i,s){if(i&1){let e=f();a(0,"button",16),C("click",function(){_(e);let t=r().ngIf,o=r(2);return m(o.updateStock(t))}),P(1,"i",17),d(2," Update "),c()}}function Ae(i,s){if(i&1){let e=f();a(0,"actions")(1,"div",12),h(2,We,3,0,"button",13),a(3,"button",14),C("click",function(){_(e);let t=r(2);return m(t.openExportDialog())}),P(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),p("ngIf",n.productService.hasSelectionVariant(e))}}function $e(i,s){if(i&1){let e=f();a(0,"th")(1,"input",32),C("change",function(t){_(e);let o=r().ngIf,g=r(2);return m(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function je(i,s){if(i&1){let e=f();a(0,"input",51),y("ngModelChange",function(t){_(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),C("ngModelChange",function(){_(e);let t=r(4).$implicit,o=r(3);return m(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function ze(i,s){if(i&1&&h(0,je,1,1,"ng-template",26),i&2){let e=r(6);p("ngxPermissionsOnly",F(1,U,e.rolePriceEdit))}}function Ge(i,s){if(i&1){let e=f();G(0),a(1,"img",52),C("click",function(t){_(e);let o=r(3).$implicit,g=r(3);return m(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,T)}}function qe(i,s){i&1&&P(0,"img",53)}function Ke(i,s){if(i&1&&(a(0,"small",50),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function He(i,s){if(i&1&&(a(0,"td",44)(1,"div",45),h(2,ze,1,3,null,26),a(3,"div",46),h(4,Ge,2,1,"ng-container",47)(5,qe,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",48)(8,"span",49),d(9),c(),h(10,Ke,2,1,"small",50),c()),i&2){let e=H(6),n=r(2).$implicit;p("rowSpan",n.Variants.length),l(2),S((n.Variants==null?null:n.Variants.length)>1?2:-1),l(),p("ngClass",F(8,Ue,(n.Variants==null?null:n.Variants.length)<=1)),l(),p("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),p("rowSpan",n.Variants.length),l(2),R(n.Name),l(),S(n.Category?10:-1)}}function Je(i,s){if(i&1){let e=f();a(0,"input",56),y("ngModelChange",function(t){_(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Ze(i,s){if(i&1&&(a(0,"td",54),h(1,Je,1,1,"input",55),c()),i&2){let e=r().$implicit;l(),S(e.UnitPrice>=0?1:-1)}}function Qe(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Xe(i,s){if(i&1&&(a(0,"div"),d(1),v(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.UnitPrice)," ")}}function Ye(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let e=r().$implicit,n=r(4);l(),p("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),T)}}function et(i,s){if(i&1){let e=f();a(0,"div",58),C("click",function(){_(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,x=r();return m(x.openTableDialog(t,o,g))}),d(1),v(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function tt(i,s){if(i&1){let e=f();a(0,"tr",33),h(1,He,11,10),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Ze,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Qe,2,0,"div",36)(11,Xe,3,3,"div")(12,Ye,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,et,3,3,"div",39),a(16,"div",37)(17,"a",40),P(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=_(e).$implicit,o=r(4);return m(o.refreshPrice(t))}),P(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),S(n==0?1:-1),l(2),R(e.Model),l(2),p("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",F(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),p("ngxPermissionsOnly",F(14,U,t.rolePriceEdit)),l(3),S((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),p("ngClass",F(16,Be,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),S(e.Channel.length>0?15:-1),l(2),p("href",e.Channel[0]==null?null:e.Channel[0].Url,T)}}function nt(i,s){if(i&1&&k(0,tt,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function it(i,s){if(i&1){let e=f();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(t){_(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),m(t)}),C("toggleChange",function(){_(e);let t=r(2);return m(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,$e,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){_(e);let t=r(2);return m(t.openModalFilter())}),P(21,"img",29),a(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,nt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),v(29,"async"),C("onNextPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=r(2);return m(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",F(16,U,n.rolePriceEdit)),l(4),p("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),p("src",n.selectedChannel==null?null:n.selectedChannel.Img,T),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),p("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",V(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function ot(i,s){if(i&1){let e=f();a(0,"mainpanel",2),y("textChange",function(t){_(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),m(t)}),C("onSubmit",function(){_(e);let t=r();return m(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),m(t)}),h(6,Oe,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),m(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),m(t)}),c()()(),h(15,Ae,7,1,"actions",9),v(16,"async"),h(17,it,30,18,"content",9),v(18,"async"),c()}if(i&2){let e=r();p("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),p("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),p("ngIf",V(16,9,e.data$)),l(2),p("ngIf",V(18,11,e.data$))}}var At=(()=>{class i{constructor(e,n,t,o,g,x,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=x,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(B),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(x=>pe.IsNotEmpty(x))).subscribe(x=>{this.updateItemAfterDialog(x,e)})}updateItemAfterDialog(e,n){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),x=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${x}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Se),u(ye),u(ve),u(M),u(he),u(Pe),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([B,M,ne("https://res.cloudinary.com/"),D])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,ot,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",V(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,xe,fe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0})}}return i})();export{At as PriceSingleChannelComponent};