marketplacepos 3.22.7 → 3.22.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/Marketplace/{chunk-RXU6CAOP.js → chunk-25B2ZKEV.js} +1 -1
  2. package/Marketplace/{chunk-HDQ264E7.js → chunk-2AZIRD3H.js} +1 -1
  3. package/Marketplace/{chunk-N6NC5NSE.js → chunk-2V4HZYVR.js} +1 -1
  4. package/Marketplace/{chunk-VL6PS3RX.js → chunk-4FFNXVLL.js} +1 -1
  5. package/Marketplace/{chunk-4MEDGUR4.js → chunk-4YGXXQGV.js} +1 -1
  6. package/Marketplace/{chunk-VRAOGJWM.js → chunk-5PPWE4IJ.js} +1 -1
  7. package/Marketplace/{chunk-7IV6AOHI.js → chunk-6QLRN5DC.js} +1 -1
  8. package/Marketplace/{chunk-XIQS2GJ5.js → chunk-6V44GMIW.js} +1 -1
  9. package/Marketplace/{chunk-DLCEDZGK.js → chunk-7NOBCBXC.js} +1 -1
  10. package/Marketplace/{chunk-S4LDJFZS.js → chunk-AKYLFMD3.js} +1 -1
  11. package/Marketplace/{chunk-WUTL4JBG.js → chunk-CBLSX34S.js} +1 -1
  12. package/Marketplace/{chunk-Y6ID7JCT.js → chunk-CDMZ7IPB.js} +1 -1
  13. package/Marketplace/{chunk-LT5ZCJRA.js → chunk-DXB2OHQZ.js} +1 -1
  14. package/Marketplace/{chunk-IOHEOTV2.js → chunk-F2HSZ5BX.js} +11 -11
  15. package/Marketplace/{chunk-FK647DV3.js → chunk-FGAQYUJP.js} +1 -1
  16. package/Marketplace/{chunk-I7SRUSWR.js → chunk-H6FMLR2D.js} +1 -1
  17. package/Marketplace/{chunk-34TFHXOV.js → chunk-HUQ2TRU6.js} +1 -1
  18. package/Marketplace/{chunk-YPE5AC3X.js → chunk-J5K5H4FR.js} +1 -1
  19. package/Marketplace/{chunk-WZVZOQN3.js → chunk-J5QT7AEB.js} +1 -1
  20. package/Marketplace/{chunk-OKZBCK7E.js → chunk-KBJEDIFC.js} +1 -1
  21. package/Marketplace/{chunk-5UKUFSGI.js → chunk-L4SJ72H4.js} +1 -1
  22. package/Marketplace/{chunk-3ATLH2O5.js → chunk-NK2CBWWU.js} +1 -1
  23. package/Marketplace/{chunk-4WRJ4UNZ.js → chunk-QYA5FUMB.js} +1 -1
  24. package/Marketplace/{chunk-5N4FTVPO.js → chunk-S46Y6TZ3.js} +1 -1
  25. package/Marketplace/{chunk-2RZIS7SO.js → chunk-TXZVD3Y2.js} +1 -1
  26. package/Marketplace/{chunk-MC7L2DZA.js → chunk-UP2QCF6N.js} +1 -1
  27. package/Marketplace/chunk-UYJ6AQMM.js +1 -0
  28. package/Marketplace/{chunk-Q653MB6W.js → chunk-VTIM32W5.js} +1 -1
  29. package/Marketplace/{chunk-VJUN2VLY.js → chunk-WU2PACVU.js} +1 -1
  30. package/Marketplace/{chunk-3T6NZ5WH.js → chunk-XVF5C6K3.js} +1 -1
  31. package/Marketplace/{chunk-XEJDB2R3.js → chunk-YH3ET4YX.js} +1 -1
  32. package/Marketplace/{chunk-J3APYGWI.js → chunk-YSYCCLYG.js} +1 -1
  33. package/Marketplace/{chunk-DIGP4L5I.js → chunk-Z3KMYVFY.js} +2 -2
  34. package/Marketplace/index.html +2 -2
  35. package/Marketplace/{main-A5PH6KD3.js → main-T34LUNYS.js} +1 -1
  36. package/package.json +1 -1
  37. package/Marketplace/chunk-ONBGY7D4.js +0 -1
@@ -1 +1 @@
1
- import{a as v,b}from"./chunk-N3TTJVBG.js";import{a as r}from"./chunk-Q653MB6W.js";import"./chunk-S4LDJFZS.js";import"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import"./chunk-64G3XLI6.js";import{n as h,r as i}from"./chunk-OVEJFFL6.js";import{Cd as o,Gb as u,Sb as d,Tb as C,Ub as a,jb as s,ka as l,ta as m,ua as c,vc as f}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var T=(()=>{let e=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"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=m({type:e,selectors:[["app-price"]],standalone:!0,features:[f],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,g){n&1&&(d(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),C()()(),a(4,"router-outlet")),n&2&&(s(3),u("Tabs",g.priceTabs))},dependencies:[o,b,v,i,h],encapsulation:2});let t=e;return t})();var P=[{path:"",component:T,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-J3APYGWI.js").then(t=>t.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-LT5ZCJRA.js").then(t=>t.CustomChannelPriceComponent)},canActivate:[r],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-HDQ264E7.js").then(t=>t.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=c({type:e}),e.\u0275inj=l({imports:[o,i.forChild(P)]});let t=e;return t})();export{D as PriceRoutingModule};
1
+ import{a as v,b}from"./chunk-N3TTJVBG.js";import{a as r}from"./chunk-VTIM32W5.js";import"./chunk-AKYLFMD3.js";import"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import"./chunk-64G3XLI6.js";import{n as h,r as i}from"./chunk-OVEJFFL6.js";import{Cd as o,Gb as u,Sb as d,Tb as C,Ub as a,jb as s,ka as l,ta as m,ua as c,vc as f}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var T=(()=>{let e=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"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=m({type:e,selectors:[["app-price"]],standalone:!0,features:[f],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,g){n&1&&(d(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),C()()(),a(4,"router-outlet")),n&2&&(s(3),u("Tabs",g.priceTabs))},dependencies:[o,b,v,i,h],encapsulation:2});let t=e;return t})();var P=[{path:"",component:T,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-YSYCCLYG.js").then(t=>t.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-DXB2OHQZ.js").then(t=>t.CustomChannelPriceComponent)},canActivate:[r],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-2AZIRD3H.js").then(t=>t.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=c({type:e}),e.\u0275inj=l({imports:[o,i.forChild(P)]});let t=e;return t})();export{D as PriceRoutingModule};
@@ -1 +1 @@
1
- import{a as N}from"./chunk-WTR5UFZI.js";import{a as M}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as U}from"./chunk-B5PFUQJP.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Ee,b as Me}from"./chunk-AMSVLO4N.js";import{a as De}from"./chunk-N6IHFFFZ.js";import{a as Ve,b as Te}from"./chunk-PD4CUVAW.js";import"./chunk-GCKSYCMI.js";import{a as be}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import{a as Fe}from"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{a as fe,b as xe,d as Se,e as Pe}from"./chunk-CCXKODFV.js";import{i as ue}from"./chunk-S4LDJFZS.js";import{b as de,e as ge}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as Ie,l as we,m as ye,n as ve}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{b as oe,c as re,h as le,m as ce,o as se,y as pe}from"./chunk-BSN7ZAXG.js";import{c as me,e as he,f as Ce}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as u,Bd as E,Cd as ie,Da as _,Ea as m,Eb as h,G as A,Gb as p,Gc as v,Hc as T,Ic as X,Id as ae,Jc as Y,Nb as S,Ob as k,Qb as L,Rb as R,Sb as o,Tb as c,Ub as P,Vb as q,Wb as K,Yb as x,Z as $,bc as r,ea as j,ec as H,gb as D,jb as l,kb as f,mc as J,nc as d,oc as B,pa as z,pc as F,rc as I,sc as w,sd as ee,ta as G,tc as y,uc as Z,vc as Q,vd as te,xc as V,yd as ne}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Ue=i=>({"text-decoration-line-through":i}),Oe=i=>({"bg-gradient-warning":i}),We=i=>({"ms-10":i});function Ae(i,s){if(i&1&&(o(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),p("src",t==null?null:t.Img,D),l(),F(" ",t.Name," ")}}function $e(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){_(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),P(1,"i",17),d(2," Update "),c()}}function je(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,$e,3,0,"button",13),o(3,"button",14),u("click",function(){_(t);let n=r(2);return m(n.openExportDialog())}),P(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),p("ngIf",e.productService.hasSelectionVariant(t))}}function ze(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){_(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function Ge(i,s){if(i&1){let t=x();o(0,"input",51),y("ngModelChange",function(n){_(t);let a=r(4).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){_(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function qe(i,s){if(i&1&&h(0,Ge,1,1,"ng-template",26),i&2){let t=r(6);p("ngxPermissionsOnly",V(1,O,t.rolePriceEdit))}}function Ke(i,s){if(i&1){let t=x();q(0),o(1,"img",52),u("click",function(n){_(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),K()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,D)}}function He(i,s){i&1&&P(0,"img",53)}function Je(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),F("(",t.Category,")")}}function Ze(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,qe,1,3,null,26),o(3,"div",46),h(4,Ke,2,1,"ng-container",47)(5,He,1,0,"ng-template",null,0,Y),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,Je,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;p("rowSpan",e.Variants.length),l(2),S((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),p("ngClass",V(8,We,(e.Variants==null?null:e.Variants.length)<=1)),l(),p("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),p("rowSpan",e.Variants.length),l(2),B(e.Name),l(),S(e.Category?10:-1)}}function Qe(i,s){if(i&1){let t=x();o(0,"input",56),y("ngModelChange",function(n){_(t);let a=r(2).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Xe(i,s){if(i&1&&(o(0,"td",54),h(1,Qe,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),S(t.UnitPrice>=0?1:-1)}}function Ye(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function et(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.UnitPrice)," ")}}function tt(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),p("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),D)}}function nt(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){_(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function it(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,Ze,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Xe,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Ye,2,0,"div",36)(11,et,3,3,"div")(12,tt,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,nt,3,3,"div",39),o(16,"div",37)(17,"a",40),P(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=_(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),P(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),S(e==0?1:-1),l(2),B(t.Model),l(2),p("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",V(12,Ue,t.Discontinued)),l(),F(" ",t.Code," "),l(),p("ngxPermissionsOnly",V(14,O,n.rolePriceEdit)),l(3),S((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),p("ngClass",V(16,Oe,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),S(t.Channel.length>0?15:-1),l(2),p("href",t.Channel[0]==null?null:t.Channel[0].Url,D)}}function at(i,s){if(i&1&&L(0,it,22,18,"tr",33,k),i&2){let t=s.$implicit;R(t.Variants)}}function ot(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(n){_(t);let a=r(2);return w(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){_(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,ze,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){_(t);let n=r(2);return m(n.openModalFilter())}),P(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),L(26,at,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){_(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",V(16,O,e.rolePriceEdit)),l(4),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),l(2),F(" ",X(24,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),l(3),R(t),l(2),p("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",T(29,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function rt(i,s){if(i&1){let t=x();o(0,"mainpanel",2),y("textChange",function(n){_(t);let a=r();return w(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){_(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Ae,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,je,7,1,"actions",9),v(16,"async"),h(17,ot,30,18,"content",9),v(18,"async"),c()}if(i&2){let t=r();p("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),p("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),p("ngIf",T(16,9,t.data$)),l(2),p("ngIf",T(18,11,t.data$))}}var zt=(()=>{let s=class s{constructor(e,n,a,g,C,b,W,Le,Re,Be){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=b,this.authService=W,this.mainPanelService=Le,this.exportService=Re,this.decimalPipe=Be,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=_e.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($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,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(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Ne,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(b=>me.IsNotEmpty(b))).subscribe(b=>{this.updateItemAfterDialog(b,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions),b=a.Price?this.decimalPipe.transform(a.Price):a.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${b}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Me,{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()}};s.\u0275fac=function(n){return new(n||s)(f(ge),f(de),f(Ie),f(be),f(Fe),f(N),f(ue),f(we),f(Ee),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Z([U,N,ae("https://res.cloudinary.com/"),E]),Q],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,a){n&1&&(h(0,rt,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",T(1,1,a.loader$))},dependencies:[ie,ee,te,ne,E,ve,ye,Pe,Se,fe,xe,pe,re,se,oe,le,ce,De,ke,Ce,he,Te,Ve],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let i=s;return i})();export{zt as PriceSingleChannelComponent};
1
+ import{a as N}from"./chunk-WTR5UFZI.js";import{a as M}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as U}from"./chunk-B5PFUQJP.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Ee,b as Me}from"./chunk-AMSVLO4N.js";import{a as De}from"./chunk-N6IHFFFZ.js";import{a as Ve,b as Te}from"./chunk-PD4CUVAW.js";import"./chunk-GCKSYCMI.js";import{a as be}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import{a as Fe}from"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{a as fe,b as xe,d as Se,e as Pe}from"./chunk-CCXKODFV.js";import{i as ue}from"./chunk-AKYLFMD3.js";import{b as de,e as ge}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as Ie,l as we,m as ye,n as ve}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{b as oe,c as re,h as le,m as ce,o as se,y as pe}from"./chunk-BSN7ZAXG.js";import{c as me,e as he,f as Ce}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as u,Bd as E,Cd as ie,Da as _,Ea as m,Eb as h,G as A,Gb as p,Gc as v,Hc as T,Ic as X,Id as ae,Jc as Y,Nb as S,Ob as k,Qb as L,Rb as R,Sb as o,Tb as c,Ub as P,Vb as q,Wb as K,Yb as x,Z as $,bc as r,ea as j,ec as H,gb as D,jb as l,kb as f,mc as J,nc as d,oc as B,pa as z,pc as F,rc as I,sc as w,sd as ee,ta as G,tc as y,uc as Z,vc as Q,vd as te,xc as V,yd as ne}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Ue=i=>({"text-decoration-line-through":i}),Oe=i=>({"bg-gradient-warning":i}),We=i=>({"ms-10":i});function Ae(i,s){if(i&1&&(o(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),p("src",t==null?null:t.Img,D),l(),F(" ",t.Name," ")}}function $e(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){_(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),P(1,"i",17),d(2," Update "),c()}}function je(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,$e,3,0,"button",13),o(3,"button",14),u("click",function(){_(t);let n=r(2);return m(n.openExportDialog())}),P(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),p("ngIf",e.productService.hasSelectionVariant(t))}}function ze(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){_(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function Ge(i,s){if(i&1){let t=x();o(0,"input",51),y("ngModelChange",function(n){_(t);let a=r(4).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){_(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function qe(i,s){if(i&1&&h(0,Ge,1,1,"ng-template",26),i&2){let t=r(6);p("ngxPermissionsOnly",V(1,O,t.rolePriceEdit))}}function Ke(i,s){if(i&1){let t=x();q(0),o(1,"img",52),u("click",function(n){_(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),K()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,D)}}function He(i,s){i&1&&P(0,"img",53)}function Je(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),F("(",t.Category,")")}}function Ze(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,qe,1,3,null,26),o(3,"div",46),h(4,Ke,2,1,"ng-container",47)(5,He,1,0,"ng-template",null,0,Y),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,Je,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;p("rowSpan",e.Variants.length),l(2),S((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),p("ngClass",V(8,We,(e.Variants==null?null:e.Variants.length)<=1)),l(),p("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),p("rowSpan",e.Variants.length),l(2),B(e.Name),l(),S(e.Category?10:-1)}}function Qe(i,s){if(i&1){let t=x();o(0,"input",56),y("ngModelChange",function(n){_(t);let a=r(2).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Xe(i,s){if(i&1&&(o(0,"td",54),h(1,Qe,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),S(t.UnitPrice>=0?1:-1)}}function Ye(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function et(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.UnitPrice)," ")}}function tt(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),p("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),D)}}function nt(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){_(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function it(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,Ze,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Xe,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Ye,2,0,"div",36)(11,et,3,3,"div")(12,tt,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,nt,3,3,"div",39),o(16,"div",37)(17,"a",40),P(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=_(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),P(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),S(e==0?1:-1),l(2),B(t.Model),l(2),p("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",V(12,Ue,t.Discontinued)),l(),F(" ",t.Code," "),l(),p("ngxPermissionsOnly",V(14,O,n.rolePriceEdit)),l(3),S((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),p("ngClass",V(16,Oe,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),S(t.Channel.length>0?15:-1),l(2),p("href",t.Channel[0]==null?null:t.Channel[0].Url,D)}}function at(i,s){if(i&1&&L(0,it,22,18,"tr",33,k),i&2){let t=s.$implicit;R(t.Variants)}}function ot(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(n){_(t);let a=r(2);return w(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){_(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,ze,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){_(t);let n=r(2);return m(n.openModalFilter())}),P(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),L(26,at,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){_(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",V(16,O,e.rolePriceEdit)),l(4),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),l(2),F(" ",X(24,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),l(3),R(t),l(2),p("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",T(29,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function rt(i,s){if(i&1){let t=x();o(0,"mainpanel",2),y("textChange",function(n){_(t);let a=r();return w(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){_(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Ae,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,je,7,1,"actions",9),v(16,"async"),h(17,ot,30,18,"content",9),v(18,"async"),c()}if(i&2){let t=r();p("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),p("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),p("ngIf",T(16,9,t.data$)),l(2),p("ngIf",T(18,11,t.data$))}}var zt=(()=>{let s=class s{constructor(e,n,a,g,C,b,W,Le,Re,Be){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=b,this.authService=W,this.mainPanelService=Le,this.exportService=Re,this.decimalPipe=Be,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=_e.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($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,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(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Ne,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(b=>me.IsNotEmpty(b))).subscribe(b=>{this.updateItemAfterDialog(b,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions),b=a.Price?this.decimalPipe.transform(a.Price):a.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${b}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Me,{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()}};s.\u0275fac=function(n){return new(n||s)(f(ge),f(de),f(Ie),f(be),f(Fe),f(N),f(ue),f(we),f(Ee),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Z([U,N,ae("https://res.cloudinary.com/"),E]),Q],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,a){n&1&&(h(0,rt,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",T(1,1,a.loader$))},dependencies:[ie,ee,te,ne,E,ve,ye,Pe,Se,fe,xe,pe,re,se,oe,le,ce,De,ke,Ce,he,Te,Ve],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let i=s;return i})();export{zt as PriceSingleChannelComponent};
@@ -1 +1 @@
1
- import{a as b}from"./chunk-5JOW2QWK.js";import{a as P}from"./chunk-IUKHWWDP.js";import{a as C}from"./chunk-6YZFSP2B.js";import{b as O}from"./chunk-WT6W7RAQ.js";import"./chunk-BQ7NR3ET.js";import{c as M}from"./chunk-UMNGKENU.js";import{a as m}from"./chunk-Q653MB6W.js";import{a as h}from"./chunk-PNVJ62RQ.js";import"./chunk-FMV4LYKN.js";import"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{e as s}from"./chunk-CCXKODFV.js";import"./chunk-S4LDJFZS.js";import"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{n as u}from"./chunk-BO4PPSB5.js";import{u as f}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{y as g}from"./chunk-BSN7ZAXG.js";import"./chunk-64G3XLI6.js";import{n as l,r as a}from"./chunk-OVEJFFL6.js";import{Cd as i,Ub as c,ka as e,ta as d,ua as r}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var _=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=d({type:t,selectors:[["app-products"]],decls:1,vars:0,template:function(n,v){n&1&&c(0,"router-outlet")},dependencies:[l],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=t;return o})();var y=[{path:"",component:_,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-5N4FTVPO.js").then(o=>o.StatusModule),canActivate:[m]},{path:"download",loadChildren:()=>import("./chunk-WUTL4JBG.js").then(o=>o.DownloadModule),canActivate:[m]},{path:"upload",loadComponent:()=>import("./chunk-VJUN2VLY.js").then(o=>o.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[m]}]}],w=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,a.forChild(y)]});let o=t;return o})();var W=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,g,a,w,f,u,s,O,C,M,h,P,b]});let o=t;return o})();export{W as ProductModule};
1
+ import{a as b}from"./chunk-5JOW2QWK.js";import{a as P}from"./chunk-IUKHWWDP.js";import{a as C}from"./chunk-6YZFSP2B.js";import{b as O}from"./chunk-WT6W7RAQ.js";import"./chunk-BQ7NR3ET.js";import{c as M}from"./chunk-UMNGKENU.js";import{a as m}from"./chunk-VTIM32W5.js";import{a as h}from"./chunk-PNVJ62RQ.js";import"./chunk-FMV4LYKN.js";import"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{e as s}from"./chunk-CCXKODFV.js";import"./chunk-AKYLFMD3.js";import"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{n as u}from"./chunk-BO4PPSB5.js";import{u as f}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{y as g}from"./chunk-BSN7ZAXG.js";import"./chunk-64G3XLI6.js";import{n as l,r as a}from"./chunk-OVEJFFL6.js";import{Cd as i,Ub as c,ka as e,ta as d,ua as r}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var _=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=d({type:t,selectors:[["app-products"]],decls:1,vars:0,template:function(n,v){n&1&&c(0,"router-outlet")},dependencies:[l],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=t;return o})();var y=[{path:"",component:_,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-S46Y6TZ3.js").then(o=>o.StatusModule),canActivate:[m]},{path:"download",loadChildren:()=>import("./chunk-CBLSX34S.js").then(o=>o.DownloadModule),canActivate:[m]},{path:"upload",loadComponent:()=>import("./chunk-WU2PACVU.js").then(o=>o.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[m]}]}],w=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,a.forChild(y)]});let o=t;return o})();var W=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,g,a,w,f,u,s,O,C,M,h,P,b]});let o=t;return o})();export{W as ProductModule};
@@ -1 +1 @@
1
- import{a as re}from"./chunk-RENQ3YZH.js";import{a as de,b as me}from"./chunk-LJHZMQZD.js";import"./chunk-MY4B7K3R.js";import"./chunk-FGPSBTFS.js";import"./chunk-ADRVUMMW.js";import{a as ae,b as le}from"./chunk-WT6W7RAQ.js";import"./chunk-BQ7NR3ET.js";import"./chunk-FMV4LYKN.js";import"./chunk-HCDKYABV.js";import{a as $,b as ee,d as te,e as ie}from"./chunk-CCXKODFV.js";import{i as Z}from"./chunk-S4LDJFZS.js";import{e as X}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{m as ne,n as oe}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as G,h as H,m as Y,o as J,y as K}from"./chunk-BSN7ZAXG.js";import{c as Q}from"./chunk-64G3XLI6.js";import{p as j,r as q}from"./chunk-OVEJFFL6.js";import{$b as v,Bd as A,Cd as U,Da as c,Ea as u,Eb as C,Gb as p,Gc as T,Hc as F,Ic as R,Jc as W,Sb as e,Tb as t,Ub as S,Vb as x,Wb as P,Yb as O,bc as M,gb as D,jb as r,kb as E,mc as I,nc as a,oc as y,pc as b,rc as h,sc as f,ta as L,tc as _,ud as B,vc as N,vd as k,xc as V,zd as z}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var pe=l=>({ID:l});function se(l,m){if(l&1&&(e(0,"span",17),S(1,"img",18),t(),a(2)),l&2){let i=m.item;r(),p("src",i.Img,D)("alt",i.Name),r(),b(" ",i.Name," ")}}function ge(l,m){if(l&1&&(e(0,"tr")(1,"td"),a(2),t(),e(3,"td"),S(4,"img",28),t(),e(5,"td"),a(6),t(),e(7,"td",29)(8,"a",30),a(9),T(10,"number"),t()(),e(11,"td"),a(12),t(),e(13,"td"),a(14),T(15,"date"),t()()),l&2){let i=m.$implicit;r(2),y(i._source.ChannelName),r(2),p("src",i.logo,D),r(2),y(i._source.DateRange),r(2),p("queryParams",V(12,pe,i._source.ID)),r(),b(" ",F(10,7,i._source.CountOrder)," "),r(3),y(i._source.UserLogin),r(2),b(" ",R(15,9,i._source["@timestamp_received"],"dd MMM yyyy hh:mm")," ")}}function ce(l,m){if(l&1){let i=O();x(0),e(1,"div",19)(2,"table",20)(3,"thead")(4,"tr",21)(5,"th",22),a(6,"Channel"),t(),e(7,"th",23),a(8,"Type"),t(),e(9,"th",24),a(10,"Download Date Range"),t(),e(11,"th",25),a(12,"Count"),t(),e(13,"th"),a(14,"User Login"),t(),e(15,"th"),a(16,"Created"),t()()(),e(17,"tbody"),C(18,ge,16,14,"tr",26),t()(),e(19,"mat-paginator",27),v("page",function(s){c(i);let n=M();return u(n.onPaginationChange(s))}),t()(),P()}if(l&2){let i=M();r(18),p("ngForOf",i.downloadOrders),r(),p("length",i.paginationTotal)("pageSize",i.paginationPageSize)("pageIndex",(i.filter==null?null:i.filter.PageNumber)==0?0:(i.filter==null?null:i.filter.PageNumber)-1)}}function ue(l,m){l&1&&(e(0,"div",31),S(1,"app-empty-state"),t())}var Ve=(()=>{let m=class m{constructor(d,s){this.http=d,this.authService=s,this.filter={PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""},this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(d=>{this.filter=d.Filter,this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter).subscribe(d=>{this.downloadOrders=d.hits,this.setChannelLogo(),this.paginationTotal=d.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}setChannelLogo(){this.downloadOrders=this.downloadOrders.map(d=>(d.logo=Q.getChannelLogoByTypeId(d._source.TypeID),d))}onPaginationChange(d){this.filter.PageNumber=d.pageIndex+1,this.getDownloadOrders()}};m.\u0275fac=function(s){return new(s||m)(E(X),E(Z))},m.\u0275cmp=L({type:m,selectors:[["app-download-order-log"]],standalone:!0,features:[N],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/Order/Download_Order_Log/Detail",3,"queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(s,n){if(s&1){let g=O();e(0,"mainpanel",1),v("onSubmit",function(){return c(g),u(n.getDownloadOrders())}),e(1,"filters")(2,"div")(3,"label",2),a(4,"Channel"),t(),e(5,"ng-select",3),_("ngModelChange",function(o){return c(g),f(n.filter.ChannelID,o)||(n.filter.ChannelID=o),u(o)}),C(6,se,3,3,"ng-template",4),t()(),e(7,"div",5)(8,"label",6),a(9,"From/To"),t(),e(10,"div",7)(11,"datepicker",8),_("dateChange",function(o){return c(g),f(n.filter.From,o)||(n.filter.From=o),u(o)}),t()(),e(12,"div")(13,"datepicker",9),_("dateChange",function(o){return c(g),f(n.filter.To,o)||(n.filter.To=o),u(o)}),t()()(),e(14,"div",5)(15,"label",10),a(16,"Page Number"),t(),e(17,"input",11),_("ngModelChange",function(o){return c(g),f(n.filter.PageNumber,o)||(n.filter.PageNumber=o),u(o)}),t()(),e(18,"div",5)(19,"label",10),a(20,"Page Size"),t(),e(21,"input",12),_("ngModelChange",function(o){return c(g),f(n.filter.RowCount,o)||(n.filter.RowCount=o),u(o)}),t()()(),e(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),C(26,ce,20,4,"ng-container",16)(27,ue,2,0,"ng-template",null,0,W),t()()()()()}if(s&2){let g=I(28);p("hideSearchBox",!0),r(5),p("clearable",!0)("items",n.channelOptions),h("ngModel",n.filter.ChannelID),r(6),h("date",n.filter.From),r(2),h("date",n.filter.To),r(4),h("ngModel",n.filter.PageNumber),r(4),h("ngModel",n.filter.RowCount),r(5),p("ngIf",(n.downloadOrders==null?null:n.downloadOrders.length)>0)("ngIfElse",g)}},dependencies:[U,B,k,A,z,le,ae,oe,ne,ie,te,$,ee,K,G,J,H,Y,me,de,q,j,re]});let l=m;return l})();export{Ve as DownloadOrderLogComponent};
1
+ import{a as re}from"./chunk-RENQ3YZH.js";import{a as de,b as me}from"./chunk-LJHZMQZD.js";import"./chunk-MY4B7K3R.js";import"./chunk-FGPSBTFS.js";import"./chunk-ADRVUMMW.js";import{a as ae,b as le}from"./chunk-WT6W7RAQ.js";import"./chunk-BQ7NR3ET.js";import"./chunk-FMV4LYKN.js";import"./chunk-HCDKYABV.js";import{a as $,b as ee,d as te,e as ie}from"./chunk-CCXKODFV.js";import{i as Z}from"./chunk-AKYLFMD3.js";import{e as X}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{m as ne,n as oe}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as G,h as H,m as Y,o as J,y as K}from"./chunk-BSN7ZAXG.js";import{c as Q}from"./chunk-64G3XLI6.js";import{p as j,r as q}from"./chunk-OVEJFFL6.js";import{$b as v,Bd as A,Cd as U,Da as c,Ea as u,Eb as C,Gb as p,Gc as T,Hc as F,Ic as R,Jc as W,Sb as e,Tb as t,Ub as S,Vb as x,Wb as P,Yb as O,bc as M,gb as D,jb as r,kb as E,mc as I,nc as a,oc as y,pc as b,rc as h,sc as f,ta as L,tc as _,ud as B,vc as N,vd as k,xc as V,zd as z}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var pe=l=>({ID:l});function se(l,m){if(l&1&&(e(0,"span",17),S(1,"img",18),t(),a(2)),l&2){let i=m.item;r(),p("src",i.Img,D)("alt",i.Name),r(),b(" ",i.Name," ")}}function ge(l,m){if(l&1&&(e(0,"tr")(1,"td"),a(2),t(),e(3,"td"),S(4,"img",28),t(),e(5,"td"),a(6),t(),e(7,"td",29)(8,"a",30),a(9),T(10,"number"),t()(),e(11,"td"),a(12),t(),e(13,"td"),a(14),T(15,"date"),t()()),l&2){let i=m.$implicit;r(2),y(i._source.ChannelName),r(2),p("src",i.logo,D),r(2),y(i._source.DateRange),r(2),p("queryParams",V(12,pe,i._source.ID)),r(),b(" ",F(10,7,i._source.CountOrder)," "),r(3),y(i._source.UserLogin),r(2),b(" ",R(15,9,i._source["@timestamp_received"],"dd MMM yyyy hh:mm")," ")}}function ce(l,m){if(l&1){let i=O();x(0),e(1,"div",19)(2,"table",20)(3,"thead")(4,"tr",21)(5,"th",22),a(6,"Channel"),t(),e(7,"th",23),a(8,"Type"),t(),e(9,"th",24),a(10,"Download Date Range"),t(),e(11,"th",25),a(12,"Count"),t(),e(13,"th"),a(14,"User Login"),t(),e(15,"th"),a(16,"Created"),t()()(),e(17,"tbody"),C(18,ge,16,14,"tr",26),t()(),e(19,"mat-paginator",27),v("page",function(s){c(i);let n=M();return u(n.onPaginationChange(s))}),t()(),P()}if(l&2){let i=M();r(18),p("ngForOf",i.downloadOrders),r(),p("length",i.paginationTotal)("pageSize",i.paginationPageSize)("pageIndex",(i.filter==null?null:i.filter.PageNumber)==0?0:(i.filter==null?null:i.filter.PageNumber)-1)}}function ue(l,m){l&1&&(e(0,"div",31),S(1,"app-empty-state"),t())}var Ve=(()=>{let m=class m{constructor(d,s){this.http=d,this.authService=s,this.filter={PageNumber:0,RowCount:20,ChannelID:"",From:"",To:""},this.channelOptions=this.authService.getChannels(),this.onGetLoader()}onGetLoader(){this.http.post("/api/OrdersLoader/OrderLogsLoader",{}).subscribe(d=>{this.filter=d.Filter,this.getDownloadOrders()})}getDownloadOrders(){this.http.post("api/Orders/OrderLogsPaged",this.filter).subscribe(d=>{this.downloadOrders=d.hits,this.setChannelLogo(),this.paginationTotal=d.total.value,this.paginationPageSize=this.filter.RowCount>this.paginationTotal?this.paginationTotal:this.filter.RowCount})}setChannelLogo(){this.downloadOrders=this.downloadOrders.map(d=>(d.logo=Q.getChannelLogoByTypeId(d._source.TypeID),d))}onPaginationChange(d){this.filter.PageNumber=d.pageIndex+1,this.getDownloadOrders()}};m.\u0275fac=function(s){return new(s||m)(E(X),E(Z))},m.\u0275cmp=L({type:m,selectors:[["app-download-order-log"]],standalone:!0,features:[N],decls:29,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","Download Order Log",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[2,"width","200px"],[1,"text-end",2,"width","200px"],[4,"ngFor","ngForOf"],[3,"page","length","pageSize","pageIndex"],[2,"width","25px",3,"src"],[1,"text-end"],["routerLink","/menu/Order/Download_Order_Log/Detail",3,"queryParams"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(s,n){if(s&1){let g=O();e(0,"mainpanel",1),v("onSubmit",function(){return c(g),u(n.getDownloadOrders())}),e(1,"filters")(2,"div")(3,"label",2),a(4,"Channel"),t(),e(5,"ng-select",3),_("ngModelChange",function(o){return c(g),f(n.filter.ChannelID,o)||(n.filter.ChannelID=o),u(o)}),C(6,se,3,3,"ng-template",4),t()(),e(7,"div",5)(8,"label",6),a(9,"From/To"),t(),e(10,"div",7)(11,"datepicker",8),_("dateChange",function(o){return c(g),f(n.filter.From,o)||(n.filter.From=o),u(o)}),t()(),e(12,"div")(13,"datepicker",9),_("dateChange",function(o){return c(g),f(n.filter.To,o)||(n.filter.To=o),u(o)}),t()()(),e(14,"div",5)(15,"label",10),a(16,"Page Number"),t(),e(17,"input",11),_("ngModelChange",function(o){return c(g),f(n.filter.PageNumber,o)||(n.filter.PageNumber=o),u(o)}),t()(),e(18,"div",5)(19,"label",10),a(20,"Page Size"),t(),e(21,"input",12),_("ngModelChange",function(o){return c(g),f(n.filter.RowCount,o)||(n.filter.RowCount=o),u(o)}),t()()(),e(22,"content")(23,"div",13)(24,"div",14)(25,"div",15),C(26,ce,20,4,"ng-container",16)(27,ue,2,0,"ng-template",null,0,W),t()()()()()}if(s&2){let g=I(28);p("hideSearchBox",!0),r(5),p("clearable",!0)("items",n.channelOptions),h("ngModel",n.filter.ChannelID),r(6),h("date",n.filter.From),r(2),h("date",n.filter.To),r(4),h("ngModel",n.filter.PageNumber),r(4),h("ngModel",n.filter.RowCount),r(5),p("ngIf",(n.downloadOrders==null?null:n.downloadOrders.length)>0)("ngIfElse",g)}},dependencies:[U,B,k,A,z,le,ae,oe,ne,ie,te,$,ee,K,G,J,H,Y,me,de,q,j,re]});let l=m;return l})();export{Ve as DownloadOrderLogComponent};
@@ -1 +1 @@
1
- import{a as F}from"./chunk-GPE5CZJG.js";import{a as E}from"./chunk-ZFQW5CVZ.js";import{g as w,i as T}from"./chunk-S4LDJFZS.js";import{b as D,e as u}from"./chunk-4SAJUEHO.js";import{b as a,c as g}from"./chunk-64G3XLI6.js";import{o as j}from"./chunk-OVEJFFL6.js";import{B as I,G as C,J as l,g as b,ja as s,pa as p,q as d,v as A,xb as U}from"./chunk-PQDPS2ID.js";var x=(()=>{let o=class o{constructor(){this.httpService=p(u)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(l(r=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(r=>({value_id:r.value_id,name:r.name}))})),t}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var H=(()=>{let o=class o{constructor(){this.httpService=p(u)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(l(r=>d(null)))}generateAttribute(t){let e;return t.map(r=>(r.type=="PRODUCT_PROPERTY"?e={id:r.id,name:r.name,type:r.type,values:r.values}:e={id:r.id,name:r.values[0].id,type:r.type},e))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var z=(()=>{let o=class o{constructor(){this.httpService=p(u)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var R=(()=>{let o=class o{constructor(){this.httpService=p(u)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var v=class{};var S=class{};var G=(()=>{let o=class o{constructor(){this.httpService=p(u)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var O=(()=>{let o=class o{constructor(){this.httpService=p(u)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var N=(()=>{let o=class o{constructor(){this.httpService=p(u)}uploadProduct(t){return this.httpService.post(w.UploadPlugoProduct,t).pipe(l(e=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var Bt=(()=>{let o=class o{constructor(){this.authService=p(T),this.productService=p(E),this.shoppeUploadService=p(x),this.tiktokUploadService=p(H),this.lazadaUploadService=p(z),this.tokopediaUploadService=p(G),this.wooUploadService=p(R),this.shopifyUploadService=p(O),this.plugoUploadService=p(N),this.toastrHandlingService=p(F),this.toastr=p(D),this.router=p(j),this.httpService=p(u),this._selectedProduct=new b(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(C(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return U(t.map(r=>{let c=new v;return c.id=r.ID,c.name=r.Name,c.type=r.TypeID,c.categoryId=null,c.attributes=[],c.selected=!1,c}))}onUploadProduct(t){let e=t.filter(r=>r.selected&&g.IsNotEmpty(r.categoryId)||r.selected&&(r.type==a.Shopify||r.type==a.Plugo));if(e.length>0){let r=this.generateDataForUpload(e);this.uploadProduct(r)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);I(e).pipe(A(r=>{let c=[];return r.forEach(m=>{c=[...c,...m]}),c})).subscribe({next:(r=[])=>{g.IsNotEmpty(r)&&this.toastrHandlingService.showToastrUploadMultiple(r),this.hasSuccessRes(r)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(r=>{r?.Response.Success_list?.length>0&&g.IsNotEmpty(r)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],r=[],c=[],m=[],y=[],P=[],k=[];t.forEach(n=>{switch(n.ChannelType){case a.Shopee:r.push(n);break;case a.Tiktok:e.push(n);break;case a.Lazada:c.push(n);break;case a.Tokopedia:m.push(n);break;case a.WooCommerce:y.push(n);break;case a.Shopify:P.push(n);break;case a.Plugo:k.push(n);break}});let h=[];return[{type:a.Shopee,data:r},{type:a.Tiktok,data:e},{type:a.Lazada,data:c},{type:a.Tokopedia,data:m},{type:a.WooCommerce,data:y},{type:a.Shopify,data:P},{type:a.Plugo,data:k}].filter(n=>n.data.length>0).forEach(n=>{switch(n.type){case a.Shopee:h.push(this.shoppeUploadService.uploadProduct(r));break;case a.Tiktok:h.push(this.tiktokUploadService.uploadProduct(e));break;case a.Lazada:h.push(this.lazadaUploadService.uploadProduct(c));break;case a.Tokopedia:h.push(this.tokopediaUploadService.uploadProduct(m));break;case a.WooCommerce:h.push(this.wooUploadService.uploadProduct(y));break;case a.Shopify:h.push(this.shopifyUploadService.uploadProduct(P));break;case a.Plugo:h.push(this.plugoUploadService.uploadProduct(k));break}}),h}generateDataForUpload(t){let e=[];return t.forEach(r=>{let c=new S;c.ChannelID=r.id,c.ChannelType=r.type,c.Products=this._selectedProduct.getValue(),r.type==a.Shopify?delete c.CategoryID:c.CategoryID=r.categoryId,r.type==a.WooCommerce||r.type==a.Shopify?c.Attribute=r.attributes[0]:c.Attributes=this.formatAttributes(r.type,r.attributes),e.push(c)}),e}formatAttributes(t,e){let r;switch(t){case a.Shopee:r=this.shoppeUploadService.generateAttribute(e);break;case a.Tiktok:r=this.tiktokUploadService.generateAttribute(e);break;case a.WooCommerce:r=this.tiktokUploadService.generateAttribute(e);break;case a.Tokopedia:r=e;break;case a.Shopify:r=e;break;default:r=[];break}return r}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();export{x as a,H as b,z as c,R as d,Bt as e};
1
+ import{a as F}from"./chunk-GPE5CZJG.js";import{a as E}from"./chunk-ZFQW5CVZ.js";import{g as w,i as T}from"./chunk-AKYLFMD3.js";import{b as D,e as u}from"./chunk-4SAJUEHO.js";import{b as a,c as g}from"./chunk-64G3XLI6.js";import{o as j}from"./chunk-OVEJFFL6.js";import{B as I,G as C,J as l,g as b,ja as s,pa as p,q as d,v as A,xb as U}from"./chunk-PQDPS2ID.js";var x=(()=>{let o=class o{constructor(){this.httpService=p(u)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(l(r=>d(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(r=>({value_id:r.value_id,name:r.name}))})),t}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var H=(()=>{let o=class o{constructor(){this.httpService=p(u)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(l(r=>d(null)))}generateAttribute(t){let e;return t.map(r=>(r.type=="PRODUCT_PROPERTY"?e={id:r.id,name:r.name,type:r.type,values:r.values}:e={id:r.id,name:r.values[0].id,type:r.type},e))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var z=(()=>{let o=class o{constructor(){this.httpService=p(u)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var R=(()=>{let o=class o{constructor(){this.httpService=p(u)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var v=class{};var S=class{};var G=(()=>{let o=class o{constructor(){this.httpService=p(u)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var O=(()=>{let o=class o{constructor(){this.httpService=p(u)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(l(r=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var N=(()=>{let o=class o{constructor(){this.httpService=p(u)}uploadProduct(t){return this.httpService.post(w.UploadPlugoProduct,t).pipe(l(e=>d(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var Bt=(()=>{let o=class o{constructor(){this.authService=p(T),this.productService=p(E),this.shoppeUploadService=p(x),this.tiktokUploadService=p(H),this.lazadaUploadService=p(z),this.tokopediaUploadService=p(G),this.wooUploadService=p(R),this.shopifyUploadService=p(O),this.plugoUploadService=p(N),this.toastrHandlingService=p(F),this.toastr=p(D),this.router=p(j),this.httpService=p(u),this._selectedProduct=new b(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(C(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return U(t.map(r=>{let c=new v;return c.id=r.ID,c.name=r.Name,c.type=r.TypeID,c.categoryId=null,c.attributes=[],c.selected=!1,c}))}onUploadProduct(t){let e=t.filter(r=>r.selected&&g.IsNotEmpty(r.categoryId)||r.selected&&(r.type==a.Shopify||r.type==a.Plugo));if(e.length>0){let r=this.generateDataForUpload(e);this.uploadProduct(r)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);I(e).pipe(A(r=>{let c=[];return r.forEach(m=>{c=[...c,...m]}),c})).subscribe({next:(r=[])=>{g.IsNotEmpty(r)&&this.toastrHandlingService.showToastrUploadMultiple(r),this.hasSuccessRes(r)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(r=>{r?.Response.Success_list?.length>0&&g.IsNotEmpty(r)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],r=[],c=[],m=[],y=[],P=[],k=[];t.forEach(n=>{switch(n.ChannelType){case a.Shopee:r.push(n);break;case a.Tiktok:e.push(n);break;case a.Lazada:c.push(n);break;case a.Tokopedia:m.push(n);break;case a.WooCommerce:y.push(n);break;case a.Shopify:P.push(n);break;case a.Plugo:k.push(n);break}});let h=[];return[{type:a.Shopee,data:r},{type:a.Tiktok,data:e},{type:a.Lazada,data:c},{type:a.Tokopedia,data:m},{type:a.WooCommerce,data:y},{type:a.Shopify,data:P},{type:a.Plugo,data:k}].filter(n=>n.data.length>0).forEach(n=>{switch(n.type){case a.Shopee:h.push(this.shoppeUploadService.uploadProduct(r));break;case a.Tiktok:h.push(this.tiktokUploadService.uploadProduct(e));break;case a.Lazada:h.push(this.lazadaUploadService.uploadProduct(c));break;case a.Tokopedia:h.push(this.tokopediaUploadService.uploadProduct(m));break;case a.WooCommerce:h.push(this.wooUploadService.uploadProduct(y));break;case a.Shopify:h.push(this.shopifyUploadService.uploadProduct(P));break;case a.Plugo:h.push(this.plugoUploadService.uploadProduct(k));break}}),h}generateDataForUpload(t){let e=[];return t.forEach(r=>{let c=new S;c.ChannelID=r.id,c.ChannelType=r.type,c.Products=this._selectedProduct.getValue(),r.type==a.Shopify?delete c.CategoryID:c.CategoryID=r.categoryId,r.type==a.WooCommerce||r.type==a.Shopify?c.Attribute=r.attributes[0]:c.Attributes=this.formatAttributes(r.type,r.attributes),e.push(c)}),e}formatAttributes(t,e){let r;switch(t){case a.Shopee:r=this.shoppeUploadService.generateAttribute(e);break;case a.Tiktok:r=this.tiktokUploadService.generateAttribute(e);break;case a.WooCommerce:r=this.tiktokUploadService.generateAttribute(e);break;case a.Tokopedia:r=e;break;case a.Shopify:r=e;break;default:r=[];break}return r}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();export{x as a,H as b,z as c,R as d,Bt as e};
@@ -1 +1 @@
1
- import{a as ct}from"./chunk-FK647DV3.js";import{a as Ct}from"./chunk-BQ7NR3ET.js";import{a as ht,b as ft}from"./chunk-UMNGKENU.js";import{f as gt}from"./chunk-HCDKYABV.js";import{b as D,c as E,i as k,j as w}from"./chunk-BO4PPSB5.js";import{t as P}from"./chunk-HUUFOAKH.js";import{X as mt}from"./chunk-E5GGIVK7.js";import{h as st,m as pt}from"./chunk-BSN7ZAXG.js";import{b as m,c as f}from"./chunk-64G3XLI6.js";import{o as dt}from"./chunk-OVEJFFL6.js";import{$b as v,Bd as rt,Da as F,Ea as L,Eb as C,Fb as z,Gb as p,Gc as x,Hc as O,Jc as ot,Nb as G,Ob as et,Qb as nt,Rb as it,Sb as a,Tb as r,Ub as y,Vb as H,Wb as J,Yb as R,Z as X,bc as h,gb as I,jb as l,kb as g,mc as at,nc as s,oc as u,pa as Z,pc as S,rc as V,sc as U,sd as B,ta as T,tc as A,ud as K,v as Q,vd as $,xb as tt,xc as W,yd as lt}from"./chunk-PQDPS2ID.js";function bt(n,d){if(n&1&&(a(0,"mat-option",10)(1,"div",11),y(2,"img",12),a(3,"span"),s(4),r()()()),n&2){let t=d.$implicit;p("value",t.ID)("disabled",t.disabled),l(),p("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),l(),p("src",t.Img,I),l(2),u(t.Name)}}function Tt(n,d){if(n&1){let t=R();a(0,"div",13)(1,"label",14),s(2,"Scan Type"),r(),a(3,"mat-radio-group",15),A("ngModelChange",function(e){F(t);let o=h();return U(o.filter.ScanFull,e)||(o.filter.ScanFull=e),L(e)}),a(4,"mat-radio-button",16),s(5," Full (Include Inactive Products) "),r(),a(6,"mat-radio-button",17),s(7," Active "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.ScanFull),l(),p("value",!0),l(2),p("value",!1)}}function It(n,d){n&1&&(a(0,"span"),s(1,"Never"),r())}function xt(n,d){if(n&1&&(a(0,"span"),s(1),x(2,"async"),r()),n&2){let t=h(2);l(),u(O(2,1,t.lastSync$))}}function Ot(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3)(2,"span",18),s(3,"Last Scan:"),r(),C(4,It,2,0,"span"),x(5,"async"),C(6,xt,3,3,"span"),r(),a(7,"mat-radio-group",19),A("ngModelChange",function(e){F(t);let o=h();return U(o.filter.UpdatedProduct,e)||(o.filter.UpdatedProduct=e),L(e)}),a(8,"mat-radio-button",20),s(9," Scan All Products "),r(),a(10,"mat-radio-button",21),s(11),r()()()}if(n&2){let t=h();l(4),G(O(5,6,t.lastSync$)==null?4:6),l(3),V("ngModel",t.filter.UpdatedProduct),l(),p("value",!1),l(2),p("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),l(),S(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Pt(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3),s(2," Scan Option "),r(),a(3,"mat-radio-group",22),A("ngModelChange",function(e){F(t);let o=h();return U(o.filter.Async,e)||(o.filter.Async=e),L(e)}),a(4,"mat-radio-button",23),s(5," Asynchronous (Get Notified when Complete) "),r(),a(6,"mat-radio-button",24),s(7," Synchronous (Wait until Complete) "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.Async),l(),p("value",!0),l(2),p("value",!1)}}var te=(()=>{let d=class d{constructor(i,e,o){this.dialogRef=i,this.data=e,this.router=o,this.channelService=Z(ct),this.channelType=m,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(i=>(i.disabled=!0,(i.TypeID==m.Tiktok||i.TypeID==m.Tokopedia||i.TypeID==m.Lazada||i.TypeID==m.WooCommerce)&&(i.disabled=!1),i)).sort(i=>i.disabled?1:-1))}onSelectChannel(i){let e=this.filterChannelById(i);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.setDefaultConfigUpdate(),this.getLastSync(i)}getLastSync(i){this.lastSync$=this.channelService.getLastSync(i).pipe(Q(e=>f.IsNotEmpty(e.LastSync)?f.convertToReadableDate(e.LastSync):null),X(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==m.Shopee||this.selectedChannel.TypeID==m.Tiktok||this.selectedChannel.TypeID==m.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=m.WooCommerce&&this.selectedChannel?.TypeID!=m.KalCare&&this.selectedChannel?.TypeID!=m.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(i){let e;return this.channelOptions&&(e=this.channelOptions.find(o=>o.ID==i)),e}submit(){this.selectedChannel.TypeID==m.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(i){return f.IsNotEmpty(i)}onClose(){this.dialogRef.close()}};d.\u0275fac=function(e){return new(e||d)(g(D),g(E),g(dt))},d.\u0275cmp=T({type:d,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),s(4,"Select a Channel"),r(),a(5,"mat-form-field",4)(6,"mat-select",5),A("ngModelChange",function(c){return U(o.filter.ChannelID,c)||(o.filter.ChannelID=c),c}),v("ngModelChange",function(c){return o.onSelectChannel(c)}),C(7,bt,5,5,"mat-option",6),r()(),C(8,Tt,8,3,"div",7)(9,Ot,12,8,"div",8)(10,Pt,8,3,"div",9),r()()()),e&2&&(p("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),l(6),p("disabled",o.disabledChannelOption),V("ngModel",o.filter.ChannelID),l(),p("ngForOf",o.channelOptions),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)),l(),G(o.hasScanUpdate&&o.selectedChannel?9:-1),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[K,$,st,pt,ht,ft,gt,Ct,mt,P,w,lt],encapsulation:2});let n=d;return n})();var M=function(n){return n.Tokopedia="https://seller.tokopedia.com",n.Shoope="https://seller.shopee.co.id",n.Tiktok="https://seller-id.tiktok.com",n.WooCommerce="https://woocommerce.dealpos.app",n.Lazada="https://sellercenter.lazada.co.id",n}(M||{});var Dt=n=>({"is-disabled":n});function Et(n,d){if(n&1&&(H(0),a(1,"tr")(2,"td",11),s(3),r(),a(4,"td",11),s(5),r(),a(6,"td",12)(7,"p",13),s(8,"Product Not in Channel!"),r()()(),J()),n&2){let t=h().$implicit;l(3),S(" ",t==null?null:t.Model,""),l(2),S(" ",t==null?null:t.Code,"")}}function kt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Model,"")}}function wt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Code,"")}}function Nt(n,d){if(n&1&&(a(0,"tr"),C(1,kt,2,2,"td",14)(2,wt,2,2,"td",14),a(3,"td",11)(4,"div",15)(5,"a",16),y(6,"img",17),r(),a(7,"div",18),s(8),r()()(),a(9,"td",11),s(10),x(11,"number"),r(),a(12,"td",19),s(13),x(14,"number"),r(),a(15,"td",19)(16,"a",20),y(17,"i",21),a(18,"span",22),s(19,"Edit"),r()()()()),n&2){let t=d.$implicit,i=d.index,e=h(3);l(),p("ngIf",i==0),l(),p("ngIf",i==0),l(3),p("href",t.Url,I)("title",t.Title),l(),p("src",e.getChannelLogo(t.TypeID),I),l(),p("matTooltip",(t==null||t.Name==null?null:t.Name.length)>55?t==null?null:t.Name:""),l(),S(" ",t.Name," "),l(2),u(O(11,12,t.Price)),l(3),u(O(14,14,t.Inventory)),l(3),p("href",e.getHyperlinkSellerCenter(t),I)("ngClass",W(16,Dt,t.TypeID==e.channelType.KalCare))("matTooltip",t.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Vt(n,d){if(n&1&&C(0,Nt,20,18,"tr",9),n&2){let t=h().$implicit;p("ngForOf",t==null?null:t.Channel)}}function Ut(n,d){if(n&1&&(H(0),C(1,Et,9,2,"ng-container",10)(2,Vt,1,1,"ng-template",null,0,ot),J()),n&2){let t=d.$implicit,i=at(3);l(),p("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",i)}}var de=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.channelType=m,this.variants=i.variants,this.title=i.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(i){return f.getChannelLogoByTypeId(i)}getHyperlinkSellerCenter(i){let e="javascript:void(0)";switch(i.TypeID){case m.Shopee:e=`${M.Shoope}/portal/product/${i.ChannelItemID}`;break;case m.Tiktok:e=`${M.Tiktok}/product/edit/${i.ChannelItemID}`;break;case m.Tokopedia:e=`${M.Tokopedia}/edit-product/${i.ChannelItemID}`;break;case m.WooCommerce:e=`${M.WooCommerce}/wp-admin/post.php?post=${i.ChannelItemID}&action=edit`;break;case m.Lazada:e=`${M.Lazada}/apps/product/publish?productId=${i.ChannelItemID}`;break}return e}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(a(0,"modal-material",1),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),s(6," VARIANT "),a(7,"sup"),y(8,"i",6),r()(),a(9,"th",5),s(10,"SKU"),r(),a(11,"th",5),s(12," PRODUCT "),a(13,"sup"),y(14,"i",7),r()(),a(15,"th",5),s(16,"PRICE"),r(),a(17,"th",8),s(18,"INVENTORY"),r(),y(19,"th",5),r()(),a(20,"tbody"),C(21,Ut,4,2,"ng-container",9),r()()()()),e&2&&(p("config",o.modalConfig),l(21),p("ngForOf",o.variants))},dependencies:[B,K,$,P,w,rt],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let n=d;return n})();var At=n=>({"bg-gradient-warning":n});function Ft(n,d){if(n&1&&(a(0,"tr",5)(1,"td"),s(2),r(),a(3,"td",6),s(4),r()()),n&2){let t=d.$implicit;p("matTooltip",t.duplicateMessage),l(2),u(t==null?null:t.Name),l(),p("ngClass",W(4,At,t.isDuplicate)),l(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var Ce=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.variants=tt([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let i=this.data?.variants,e={},o=[],_=i.filter(c=>f.IsEmpty(c.ChannelVariationSKU));i.filter(c=>f.IsNotEmpty(c.ChannelVariationSKU)).forEach((c,b,Y)=>{e[c.ChannelVariationSKU]=Y.filter(N=>N.ChannelVariationSKU===c.ChannelVariationSKU)}),Object.keys(e).forEach(c=>{e[c].length>1&&(e[c]=e[c].map((b,Y,N)=>{let q=`SKU ${b.ChannelVariationSKU} is duplicated with variant`;return N.forEach((j,Mt)=>{j.Name!==b.Name&&(q+=` ${N.length>2?j.Name+(Mt!==N.length-1?",":""):j.Name}`)}),b.duplicateMessage=q,b.isDuplicate=!0,b})),o.push(...e[c])}),o.push(..._),this.variants.set(o)}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variants"]],decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),s(6,"Variant"),r(),a(7,"th",4),s(8,"SKU"),r()()(),a(9,"tbody"),nt(10,Ft,5,6,"tr",5,et),r()()()()),e&2&&(p("config",o.modalConfig),l(10),it(o.variants()))},dependencies:[B,P,w],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]});let n=d;return n})();export{te as a,de as b,Ce as c};
1
+ import{a as ct}from"./chunk-FGAQYUJP.js";import{a as Ct}from"./chunk-BQ7NR3ET.js";import{a as ht,b as ft}from"./chunk-UMNGKENU.js";import{f as gt}from"./chunk-HCDKYABV.js";import{b as D,c as E,i as k,j as w}from"./chunk-BO4PPSB5.js";import{t as P}from"./chunk-HUUFOAKH.js";import{X as mt}from"./chunk-E5GGIVK7.js";import{h as st,m as pt}from"./chunk-BSN7ZAXG.js";import{b as m,c as f}from"./chunk-64G3XLI6.js";import{o as dt}from"./chunk-OVEJFFL6.js";import{$b as v,Bd as rt,Da as F,Ea as L,Eb as C,Fb as z,Gb as p,Gc as x,Hc as O,Jc as ot,Nb as G,Ob as et,Qb as nt,Rb as it,Sb as a,Tb as r,Ub as y,Vb as H,Wb as J,Yb as R,Z as X,bc as h,gb as I,jb as l,kb as g,mc as at,nc as s,oc as u,pa as Z,pc as S,rc as V,sc as U,sd as B,ta as T,tc as A,ud as K,v as Q,vd as $,xb as tt,xc as W,yd as lt}from"./chunk-PQDPS2ID.js";function bt(n,d){if(n&1&&(a(0,"mat-option",10)(1,"div",11),y(2,"img",12),a(3,"span"),s(4),r()()()),n&2){let t=d.$implicit;p("value",t.ID)("disabled",t.disabled),l(),p("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),l(),p("src",t.Img,I),l(2),u(t.Name)}}function Tt(n,d){if(n&1){let t=R();a(0,"div",13)(1,"label",14),s(2,"Scan Type"),r(),a(3,"mat-radio-group",15),A("ngModelChange",function(e){F(t);let o=h();return U(o.filter.ScanFull,e)||(o.filter.ScanFull=e),L(e)}),a(4,"mat-radio-button",16),s(5," Full (Include Inactive Products) "),r(),a(6,"mat-radio-button",17),s(7," Active "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.ScanFull),l(),p("value",!0),l(2),p("value",!1)}}function It(n,d){n&1&&(a(0,"span"),s(1,"Never"),r())}function xt(n,d){if(n&1&&(a(0,"span"),s(1),x(2,"async"),r()),n&2){let t=h(2);l(),u(O(2,1,t.lastSync$))}}function Ot(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3)(2,"span",18),s(3,"Last Scan:"),r(),C(4,It,2,0,"span"),x(5,"async"),C(6,xt,3,3,"span"),r(),a(7,"mat-radio-group",19),A("ngModelChange",function(e){F(t);let o=h();return U(o.filter.UpdatedProduct,e)||(o.filter.UpdatedProduct=e),L(e)}),a(8,"mat-radio-button",20),s(9," Scan All Products "),r(),a(10,"mat-radio-button",21),s(11),r()()()}if(n&2){let t=h();l(4),G(O(5,6,t.lastSync$)==null?4:6),l(3),V("ngModel",t.filter.UpdatedProduct),l(),p("value",!1),l(2),p("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),l(),S(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Pt(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3),s(2," Scan Option "),r(),a(3,"mat-radio-group",22),A("ngModelChange",function(e){F(t);let o=h();return U(o.filter.Async,e)||(o.filter.Async=e),L(e)}),a(4,"mat-radio-button",23),s(5," Asynchronous (Get Notified when Complete) "),r(),a(6,"mat-radio-button",24),s(7," Synchronous (Wait until Complete) "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.Async),l(),p("value",!0),l(2),p("value",!1)}}var te=(()=>{let d=class d{constructor(i,e,o){this.dialogRef=i,this.data=e,this.router=o,this.channelService=Z(ct),this.channelType=m,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(i=>(i.disabled=!0,(i.TypeID==m.Tiktok||i.TypeID==m.Tokopedia||i.TypeID==m.Lazada||i.TypeID==m.WooCommerce)&&(i.disabled=!1),i)).sort(i=>i.disabled?1:-1))}onSelectChannel(i){let e=this.filterChannelById(i);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.setDefaultConfigUpdate(),this.getLastSync(i)}getLastSync(i){this.lastSync$=this.channelService.getLastSync(i).pipe(Q(e=>f.IsNotEmpty(e.LastSync)?f.convertToReadableDate(e.LastSync):null),X(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==m.Shopee||this.selectedChannel.TypeID==m.Tiktok||this.selectedChannel.TypeID==m.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=m.WooCommerce&&this.selectedChannel?.TypeID!=m.KalCare&&this.selectedChannel?.TypeID!=m.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(i){let e;return this.channelOptions&&(e=this.channelOptions.find(o=>o.ID==i)),e}submit(){this.selectedChannel.TypeID==m.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(i){return f.IsNotEmpty(i)}onClose(){this.dialogRef.close()}};d.\u0275fac=function(e){return new(e||d)(g(D),g(E),g(dt))},d.\u0275cmp=T({type:d,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),s(4,"Select a Channel"),r(),a(5,"mat-form-field",4)(6,"mat-select",5),A("ngModelChange",function(c){return U(o.filter.ChannelID,c)||(o.filter.ChannelID=c),c}),v("ngModelChange",function(c){return o.onSelectChannel(c)}),C(7,bt,5,5,"mat-option",6),r()(),C(8,Tt,8,3,"div",7)(9,Ot,12,8,"div",8)(10,Pt,8,3,"div",9),r()()()),e&2&&(p("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),l(6),p("disabled",o.disabledChannelOption),V("ngModel",o.filter.ChannelID),l(),p("ngForOf",o.channelOptions),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)),l(),G(o.hasScanUpdate&&o.selectedChannel?9:-1),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[K,$,st,pt,ht,ft,gt,Ct,mt,P,w,lt],encapsulation:2});let n=d;return n})();var M=function(n){return n.Tokopedia="https://seller.tokopedia.com",n.Shoope="https://seller.shopee.co.id",n.Tiktok="https://seller-id.tiktok.com",n.WooCommerce="https://woocommerce.dealpos.app",n.Lazada="https://sellercenter.lazada.co.id",n}(M||{});var Dt=n=>({"is-disabled":n});function Et(n,d){if(n&1&&(H(0),a(1,"tr")(2,"td",11),s(3),r(),a(4,"td",11),s(5),r(),a(6,"td",12)(7,"p",13),s(8,"Product Not in Channel!"),r()()(),J()),n&2){let t=h().$implicit;l(3),S(" ",t==null?null:t.Model,""),l(2),S(" ",t==null?null:t.Code,"")}}function kt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Model,"")}}function wt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Code,"")}}function Nt(n,d){if(n&1&&(a(0,"tr"),C(1,kt,2,2,"td",14)(2,wt,2,2,"td",14),a(3,"td",11)(4,"div",15)(5,"a",16),y(6,"img",17),r(),a(7,"div",18),s(8),r()()(),a(9,"td",11),s(10),x(11,"number"),r(),a(12,"td",19),s(13),x(14,"number"),r(),a(15,"td",19)(16,"a",20),y(17,"i",21),a(18,"span",22),s(19,"Edit"),r()()()()),n&2){let t=d.$implicit,i=d.index,e=h(3);l(),p("ngIf",i==0),l(),p("ngIf",i==0),l(3),p("href",t.Url,I)("title",t.Title),l(),p("src",e.getChannelLogo(t.TypeID),I),l(),p("matTooltip",(t==null||t.Name==null?null:t.Name.length)>55?t==null?null:t.Name:""),l(),S(" ",t.Name," "),l(2),u(O(11,12,t.Price)),l(3),u(O(14,14,t.Inventory)),l(3),p("href",e.getHyperlinkSellerCenter(t),I)("ngClass",W(16,Dt,t.TypeID==e.channelType.KalCare))("matTooltip",t.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Vt(n,d){if(n&1&&C(0,Nt,20,18,"tr",9),n&2){let t=h().$implicit;p("ngForOf",t==null?null:t.Channel)}}function Ut(n,d){if(n&1&&(H(0),C(1,Et,9,2,"ng-container",10)(2,Vt,1,1,"ng-template",null,0,ot),J()),n&2){let t=d.$implicit,i=at(3);l(),p("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",i)}}var de=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.channelType=m,this.variants=i.variants,this.title=i.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(i){return f.getChannelLogoByTypeId(i)}getHyperlinkSellerCenter(i){let e="javascript:void(0)";switch(i.TypeID){case m.Shopee:e=`${M.Shoope}/portal/product/${i.ChannelItemID}`;break;case m.Tiktok:e=`${M.Tiktok}/product/edit/${i.ChannelItemID}`;break;case m.Tokopedia:e=`${M.Tokopedia}/edit-product/${i.ChannelItemID}`;break;case m.WooCommerce:e=`${M.WooCommerce}/wp-admin/post.php?post=${i.ChannelItemID}&action=edit`;break;case m.Lazada:e=`${M.Lazada}/apps/product/publish?productId=${i.ChannelItemID}`;break}return e}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(a(0,"modal-material",1),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),s(6," VARIANT "),a(7,"sup"),y(8,"i",6),r()(),a(9,"th",5),s(10,"SKU"),r(),a(11,"th",5),s(12," PRODUCT "),a(13,"sup"),y(14,"i",7),r()(),a(15,"th",5),s(16,"PRICE"),r(),a(17,"th",8),s(18,"INVENTORY"),r(),y(19,"th",5),r()(),a(20,"tbody"),C(21,Ut,4,2,"ng-container",9),r()()()()),e&2&&(p("config",o.modalConfig),l(21),p("ngForOf",o.variants))},dependencies:[B,K,$,P,w,rt],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let n=d;return n})();var At=n=>({"bg-gradient-warning":n});function Ft(n,d){if(n&1&&(a(0,"tr",5)(1,"td"),s(2),r(),a(3,"td",6),s(4),r()()),n&2){let t=d.$implicit;p("matTooltip",t.duplicateMessage),l(2),u(t==null?null:t.Name),l(),p("ngClass",W(4,At,t.isDuplicate)),l(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var Ce=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.variants=tt([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let i=this.data?.variants,e={},o=[],_=i.filter(c=>f.IsEmpty(c.ChannelVariationSKU));i.filter(c=>f.IsNotEmpty(c.ChannelVariationSKU)).forEach((c,b,Y)=>{e[c.ChannelVariationSKU]=Y.filter(N=>N.ChannelVariationSKU===c.ChannelVariationSKU)}),Object.keys(e).forEach(c=>{e[c].length>1&&(e[c]=e[c].map((b,Y,N)=>{let q=`SKU ${b.ChannelVariationSKU} is duplicated with variant`;return N.forEach((j,Mt)=>{j.Name!==b.Name&&(q+=` ${N.length>2?j.Name+(Mt!==N.length-1?",":""):j.Name}`)}),b.duplicateMessage=q,b.isDuplicate=!0,b})),o.push(...e[c])}),o.push(..._),this.variants.set(o)}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variants"]],decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),s(6,"Variant"),r(),a(7,"th",4),s(8,"SKU"),r()()(),a(9,"tbody"),nt(10,Ft,5,6,"tr",5,et),r()()()()),e&2&&(p("config",o.modalConfig),l(10),it(o.variants()))},dependencies:[B,P,w],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]});let n=d;return n})();export{te as a,de as b,Ce as c};
@@ -1 +1 @@
1
- import{a as he}from"./chunk-5OHPBQ35.js";import"./chunk-LRU7GIXZ.js";import{a as ce}from"./chunk-XEJDB2R3.js";import{a as se}from"./chunk-7LZ5ZSXM.js";import{a as F}from"./chunk-XHAXYWZ7.js";import{b as pe,c as V}from"./chunk-B5PFUQJP.js";import"./chunk-BVIRHZTZ.js";import"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-IJYSJN63.js";import"./chunk-X5Q6FPWS.js";import"./chunk-46AOM3SM.js";import"./chunk-JXTGH22T.js";import"./chunk-OULUJ2IO.js";import"./chunk-GCKSYCMI.js";import{a as le}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{i as M}from"./chunk-S4LDJFZS.js";import{b as te,e as ne}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as ie,l as ae,m as oe,n as re}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as q,h as X,m as Y,o as Z,y as ee}from"./chunk-BSN7ZAXG.js";import{c as D}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as C,Cd as K,Da as b,Ea as P,Eb as I,G as B,Gb as d,Gc as v,Hc as y,Sb as c,Tb as p,Ub as U,Vb as G,Wb as W,Xb as H,Yb as N,bc as g,ea as k,ja as j,jb as h,kb as m,nc as _,pa as S,rc as L,sc as T,ta as A,tc as E,uc as z,vc as $,vd as Q,xb as w,yd as J}from"./chunk-PQDPS2ID.js";import{a as R,b as x}from"./chunk-GNOSNGXM.js";var O=(()=>{let r=class r{constructor(){this.authService=S(M),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(t,i){let e=Object.assign([],this.channelOptions),n=[],a;return t.forEach(o=>{a=e.find(s=>s.ID==o?.parent?.id),a&&(a=x(R({},a),{Name:`${o?.parent?.label} - ${o?.label}`,LocationID:o?.id}),n.push(a))}),i.forEach(o=>{a=e.find(s=>s.ID==o.id),a&&n.push(a)}),n}generateFilterLocation(t,i){let e=[],n=[],a=[];return t.length>0?(e=t.map(o=>o.id),n=t.map(o=>o.parent.id).filter((o,s,f)=>f.indexOf(o)===s)):(e=[],n=[]),a=i.map(o=>o.id),a=a.concat(n).filter((o,s,f)=>f.indexOf(o)===s),{locationIds:e,channelIds:a}}};r.\u0275fac=function(i){return new(i||r)},r.\u0275prov=j({token:r,factory:r.\u0275fac});let l=r;return l})();function ue(l,r){if(l&1){let u=N();c(0,"button",15),C("click",function(){b(u);let i=g().ngIf,e=g();return P(e.onUpdateItems(i))}),U(1,"i",16),_(2," Update "),p()}}function me(l,r){if(l&1&&(c(0,"actions")(1,"div",13),I(2,ue,3,0,"button",14),p()()),l&2){let u=r.ngIf,t=g();h(2),d("ngIf",t.productService.hasSelectionVariant(u))}}function ge(l,r){l&1&&H(0)}function Ce(l,r){if(l&1){let u=N();G(0),c(1,"app-table",17),C("onToggle",function(i){b(u);let e=g();return P(e.onShowDifferenceStock(i))})("onSubmit",function(i){b(u);let e=g();return P(e.updateStockByVariant(i))}),p(),W()}if(l&2){let u=r.ngIf,t=g();h(),d("data",u)("channel",t.channels())("showProductToggle",!0)("hiddenIPOSInventory",t.searchFilter.HiddenIPOSInventory)}}var $e=(()=>{let r=class r{constructor(t,i,e,n,a,o){this.http=t,this.toastr=i,this.dialog=e,this.productService=n,this.authService=a,this.mainPanelService=o,this.paginationService=S(V),this.multiChannelService=S(O),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=w([]),this.selectedChannels=w([]),this.channels=w([]),this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:F.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>D.isValidGUID(n.id)==!1),e=t.filter(n=>D.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(e)}onSearch(t){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,i){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let n=[];e.forEach(s=>{s.Channel?.forEach(f=>{n.push({ID:s.ID,Code:s.Code,Inventory:s.Inventory,LocationID:f.LocationID})})});let o={ListChannelID:i.filter(s=>s.selected).map(s=>s.ID),List:n};this.http.post("/api/Inventory/UpdateChannel",o).subscribe(s=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku,LocationID:t.LocationID};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(e=>{this.paginationService.reloadPagination(this.searchFilter);let n=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+n.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=F.DIFFERENCE:this.searchFilter.filterModel=F.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let i=this.productService.selectedVariantProduct(t),e=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(se,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(B(n=>D.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}};r.\u0275fac=function(i){return new(i||r)(m(ne),m(te),m(ie),m(le),m(M),m(ae))},r.\u0275cmp=A({type:r,selectors:[["app-multi-channel-comparison"]],standalone:!0,features:[z([V,O]),$],decls:26,vars:22,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","pageData","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,e){i&1&&(c(0,"mainpanel",0),C("onSubmit",function(a){return e.onSearch(a)}),I(1,me,3,1,"actions",1),v(2,"async"),c(3,"filters"),I(4,ge,1,0,"ng-container",1),v(5,"async"),c(6,"div")(7,"label",2),_(8,"Channel"),p(),c(9,"multiwarehouse-tree-select",3),C("onChannelChange",function(a){return e.onChannelChange(a)}),p()(),c(10,"div",4)(11,"label",5),_(12,"PageNumber"),p(),c(13,"input",6),E("ngModelChange",function(a){return T(e.searchFilter.PageNumber,a)||(e.searchFilter.PageNumber=a),a}),p()(),c(14,"div",4)(15,"label",7),_(16,"Page Size"),p(),c(17,"input",8),E("ngModelChange",function(a){return T(e.searchFilter.RowCount,a)||(e.searchFilter.RowCount=a),a}),p()()(),c(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),I(22,Ce,2,4,"ng-container",1),v(23,"async"),c(24,"infinite-paginator",12),v(25,"async"),C("onNextPage",function(){return e.paginationService.onNextPage(e.searchFilter)})("onLastPage",function(){return e.paginationService.onLastPage(e.searchFilter)})("onGetRowCount",function(){return e.paginationService.getRowCount(e.searchFilter)}),p()()()()()()),i&2&&(d("pageData",e.pageData)("hideSearchBox",!1),h(),d("ngIf",y(2,14,e.paginationService.data$)),h(3),d("ngIf",y(5,16,e.loader$)),h(5),d("multiple",!0),h(4),L("ngModel",e.searchFilter.PageNumber),h(4),L("ngModel",e.searchFilter.RowCount),h(5),d("ngIf",y(23,18,e.paginationService.data$)),h(2),d("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",y(25,20,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage()))},dependencies:[K,Q,J,re,oe,ce,ee,q,Z,X,Y,pe,he],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let l=r;return l})();export{$e as MultiChannelComparison};
1
+ import{a as he}from"./chunk-5OHPBQ35.js";import"./chunk-LRU7GIXZ.js";import{a as ce}from"./chunk-YH3ET4YX.js";import{a as se}from"./chunk-7LZ5ZSXM.js";import{a as F}from"./chunk-XHAXYWZ7.js";import{b as pe,c as V}from"./chunk-B5PFUQJP.js";import"./chunk-BVIRHZTZ.js";import"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-IJYSJN63.js";import"./chunk-X5Q6FPWS.js";import"./chunk-46AOM3SM.js";import"./chunk-JXTGH22T.js";import"./chunk-OULUJ2IO.js";import"./chunk-GCKSYCMI.js";import{a as le}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{i as M}from"./chunk-AKYLFMD3.js";import{b as te,e as ne}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as ie,l as ae,m as oe,n as re}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as q,h as X,m as Y,o as Z,y as ee}from"./chunk-BSN7ZAXG.js";import{c as D}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as C,Cd as K,Da as b,Ea as P,Eb as I,G as B,Gb as d,Gc as v,Hc as y,Sb as c,Tb as p,Ub as U,Vb as G,Wb as W,Xb as H,Yb as N,bc as g,ea as k,ja as j,jb as h,kb as m,nc as _,pa as S,rc as L,sc as T,ta as A,tc as E,uc as z,vc as $,vd as Q,xb as w,yd as J}from"./chunk-PQDPS2ID.js";import{a as R,b as x}from"./chunk-GNOSNGXM.js";var O=(()=>{let r=class r{constructor(){this.authService=S(M),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(t,i){let e=Object.assign([],this.channelOptions),n=[],a;return t.forEach(o=>{a=e.find(s=>s.ID==o?.parent?.id),a&&(a=x(R({},a),{Name:`${o?.parent?.label} - ${o?.label}`,LocationID:o?.id}),n.push(a))}),i.forEach(o=>{a=e.find(s=>s.ID==o.id),a&&n.push(a)}),n}generateFilterLocation(t,i){let e=[],n=[],a=[];return t.length>0?(e=t.map(o=>o.id),n=t.map(o=>o.parent.id).filter((o,s,f)=>f.indexOf(o)===s)):(e=[],n=[]),a=i.map(o=>o.id),a=a.concat(n).filter((o,s,f)=>f.indexOf(o)===s),{locationIds:e,channelIds:a}}};r.\u0275fac=function(i){return new(i||r)},r.\u0275prov=j({token:r,factory:r.\u0275fac});let l=r;return l})();function ue(l,r){if(l&1){let u=N();c(0,"button",15),C("click",function(){b(u);let i=g().ngIf,e=g();return P(e.onUpdateItems(i))}),U(1,"i",16),_(2," Update "),p()}}function me(l,r){if(l&1&&(c(0,"actions")(1,"div",13),I(2,ue,3,0,"button",14),p()()),l&2){let u=r.ngIf,t=g();h(2),d("ngIf",t.productService.hasSelectionVariant(u))}}function ge(l,r){l&1&&H(0)}function Ce(l,r){if(l&1){let u=N();G(0),c(1,"app-table",17),C("onToggle",function(i){b(u);let e=g();return P(e.onShowDifferenceStock(i))})("onSubmit",function(i){b(u);let e=g();return P(e.updateStockByVariant(i))}),p(),W()}if(l&2){let u=r.ngIf,t=g();h(),d("data",u)("channel",t.channels())("showProductToggle",!0)("hiddenIPOSInventory",t.searchFilter.HiddenIPOSInventory)}}var $e=(()=>{let r=class r{constructor(t,i,e,n,a,o){this.http=t,this.toastr=i,this.dialog=e,this.productService=n,this.authService=a,this.mainPanelService=o,this.paginationService=S(V),this.multiChannelService=S(O),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=w([]),this.selectedChannels=w([]),this.channels=w([]),this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:F.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>D.isValidGUID(n.id)==!1),e=t.filter(n=>D.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(e)}onSearch(t){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,i){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let n=[];e.forEach(s=>{s.Channel?.forEach(f=>{n.push({ID:s.ID,Code:s.Code,Inventory:s.Inventory,LocationID:f.LocationID})})});let o={ListChannelID:i.filter(s=>s.selected).map(s=>s.ID),List:n};this.http.post("/api/Inventory/UpdateChannel",o).subscribe(s=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku,LocationID:t.LocationID};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(e=>{this.paginationService.reloadPagination(this.searchFilter);let n=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+n.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=F.DIFFERENCE:this.searchFilter.filterModel=F.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let i=this.productService.selectedVariantProduct(t),e=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(se,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(e))},width:"400px"}).afterClosed().pipe(B(n=>D.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}};r.\u0275fac=function(i){return new(i||r)(m(ne),m(te),m(ie),m(le),m(M),m(ae))},r.\u0275cmp=A({type:r,selectors:[["app-multi-channel-comparison"]],standalone:!0,features:[z([V,O]),$],decls:26,vars:22,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","pageData","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,e){i&1&&(c(0,"mainpanel",0),C("onSubmit",function(a){return e.onSearch(a)}),I(1,me,3,1,"actions",1),v(2,"async"),c(3,"filters"),I(4,ge,1,0,"ng-container",1),v(5,"async"),c(6,"div")(7,"label",2),_(8,"Channel"),p(),c(9,"multiwarehouse-tree-select",3),C("onChannelChange",function(a){return e.onChannelChange(a)}),p()(),c(10,"div",4)(11,"label",5),_(12,"PageNumber"),p(),c(13,"input",6),E("ngModelChange",function(a){return T(e.searchFilter.PageNumber,a)||(e.searchFilter.PageNumber=a),a}),p()(),c(14,"div",4)(15,"label",7),_(16,"Page Size"),p(),c(17,"input",8),E("ngModelChange",function(a){return T(e.searchFilter.RowCount,a)||(e.searchFilter.RowCount=a),a}),p()()(),c(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),I(22,Ce,2,4,"ng-container",1),v(23,"async"),c(24,"infinite-paginator",12),v(25,"async"),C("onNextPage",function(){return e.paginationService.onNextPage(e.searchFilter)})("onLastPage",function(){return e.paginationService.onLastPage(e.searchFilter)})("onGetRowCount",function(){return e.paginationService.getRowCount(e.searchFilter)}),p()()()()()()),i&2&&(d("pageData",e.pageData)("hideSearchBox",!1),h(),d("ngIf",y(2,14,e.paginationService.data$)),h(3),d("ngIf",y(5,16,e.loader$)),h(5),d("multiple",!0),h(4),L("ngModel",e.searchFilter.PageNumber),h(4),L("ngModel",e.searchFilter.RowCount),h(5),d("ngIf",y(23,18,e.paginationService.data$)),h(2),d("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",y(25,20,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage()))},dependencies:[K,Q,J,re,oe,ce,ee,q,Z,X,Y,pe,he],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let l=r;return l})();export{$e as MultiChannelComparison};
@@ -1 +1 @@
1
- import{a as B}from"./chunk-WZVZOQN3.js";import{a as vt}from"./chunk-7KG3DC5J.js";import{a as $}from"./chunk-6YZFSP2B.js";import{a as st,b as ft,d as ut,e as gt}from"./chunk-CCXKODFV.js";import{i as dt}from"./chunk-S4LDJFZS.js";import{e as pt}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{m as k,n as ht}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{h as rt,m as lt,y as mt}from"./chunk-BSN7ZAXG.js";import{c as ct}from"./chunk-64G3XLI6.js";import{m as at,p as F,r as R}from"./chunk-OVEJFFL6.js";import{$b as V,Bd as P,Cd as L,Da as N,Ea as E,Eb as u,Gb as p,Gc as s,Hc as _,Ic as S,Jc as it,Sb as r,Tb as o,Ub as D,Vb as g,Wb as h,Yb as G,Z as j,aa as q,bc as f,ca as U,ec as J,f as z,fb as W,gb as H,jb as m,ka as I,kb as v,mc as K,nc as l,oc as d,pc as x,rc as Q,sc as X,sd as nt,ta as y,tc as Y,ua as b,ud as ot,v as C,vd as T,wc as Z,xc as tt,yc as et,yd as w,zd as M}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var Et=(t,e)=>({"bg-gradient-danger":t,"bg-gradient-warning":e}),Dt=()=>["/menu/notification/detail"],Tt=t=>({ID:t});function wt(t,e){if(t&1&&(r(0,"span",14),D(1,"img",15),o(),l(2)),t&2){let n=e.item;m(),p("src",n.Img,H)("alt",n.Name),m(),x(" ",n.Name," ")}}function Mt(t,e){if(t&1&&(g(0),l(1),s(2,"number"),r(3,"span"),l(4,"s"),o(),h()),t&2){let n=f().$implicit;m(),x(" ",S(2,1,n.DurationInSecond,"1.1-1")," ")}}function Pt(t,e){t&1&&l(0," - ")}function Lt(t,e){if(t&1&&(g(0),r(1,"tr",16)(2,"td")(3,"a",17),D(4,"img",18),r(5,"span"),l(6),o()()(),r(7,"td")(8,"b"),l(9),o(),D(10,"div",19),o(),r(11,"td"),u(12,Mt,5,4,"ng-container",20)(13,Pt,1,0,"ng-template",null,0,it),o(),r(15,"td"),l(16),o(),r(17,"td"),l(18),s(19,"date"),o()(),h()),t&2){let n=e.$implicit,a=K(14);m(),p("ngClass",et(14,Et,n.Status==1,n.Status==0)),m(2),p("routerLink",Z(17,Dt))("queryParams",tt(18,Tt,n.ID)),m(),J("src",n.Img,H),m(2),d(n.Name),m(3),d(n.Label),m(),p("innerHTML",n.Message,W),m(2),p("ngIf",n.DurationInSecond)("ngIfElse",a),m(4),d(n.StatusLabel),m(2),d(S(19,11,n.Created,"dd MMM yyyy HH:mm"))}}function Ft(t,e){if(t&1){let n=G();g(0),r(1,"div",6)(2,"div",21)(3,"app-custom-paginator",22),s(4,"async"),s(5,"async"),V("total",function(){N(n);let i=f(2);return E(i.getRowCount())})("next",function(){N(n);let i=f(2);return E(i.getNotifications())})("previous",function(){N(n);let i=f(2);return E(i.getNotifications())}),o()()(),h()}if(t&2){let n=f().ngIf,a=f();m(3),p("filter",a.filter)("totaldata",n==null?null:n.length)("paginationTotal",_(4,4,a.rowCount$))("hasClicked",_(5,6,a.rowCount$))}}function Rt(t,e){if(t&1&&(g(0),u(1,Ft,6,8,"ng-container",13),h()),t&2){let n=e.ngIf;m(),p("ngIf",n.length>0)}}var _t=(()=>{let e=class e{constructor(a,i,c){this.http=a,this.notificationService=i,this.authService=c,this.filter=new vt,this.destroy$=new z,this.channelOptions=c.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(U(this.destroy$)).subscribe(a=>{a.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(a=>{this.filter=a.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let a={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",a).pipe(C(i=>i.Data),C(i=>(i=this.setChannelLogoToNotifications(i),i=this.setTimeToSecond(i),i)),j(1))}setTimeToSecond(a){return a=a.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i)),a}setChannelLogoToNotifications(a){return a=a.map(i=>(i.Img=ct.getChannelLogoByTypeId(i.TypeID),i)),a}getRowCount(){let a={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",a).pipe(C(i=>i.Count),j(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};e.\u0275fac=function(i){return new(i||e)(v(pt),v(B),v(dt))},e.\u0275cmp=y({type:e,selectors:[["app-notification"]],decls:30,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(i,c){i&1&&(r(0,"mainpanel",1),V("onSubmit",function(){return c.onFilter()}),r(1,"filters")(2,"div")(3,"h6",2),l(4,"Channel"),o(),r(5,"ng-select",3),Y("ngModelChange",function(O){return X(c.filter.ChannelID,O)||(c.filter.ChannelID=O),O}),u(6,wt,3,3,"ng-template",4),o()()(),r(7,"content")(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11)(15,"th"),l(16,"Channel"),o(),r(17,"th"),l(18,"Process"),o(),r(19,"th"),l(20,"Duration"),o(),r(21,"th"),l(22,"Status"),o(),r(23,"th"),l(24,"Created"),o()()(),r(25,"tbody"),u(26,Lt,20,20,"ng-container",12),s(27,"async"),o()()()()(),u(28,Rt,2,1,"ng-container",13),s(29,"async"),o()()()),i&2&&(m(5),p("clearable",!0)("items",c.channelOptions),Q("ngModel",c.filter.ChannelID),m(21),p("ngForOf",_(27,5,c.notifications$)),m(2),p("ngIf",_(29,7,c.notifications$)))},dependencies:[nt,ot,T,ut,st,ft,rt,lt,k,F,$,w,P,M]});let t=e;return t})();function Bt(t,e){if(t&1&&(r(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),l(4,"Perflog"),o()(),r(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),l(9),o()()()()()()),t&2){let n=f().ngIf;m(9),d(n.Perflog)}}function kt(t,e){if(t&1&&(g(0),r(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),l(5,"StackTrace"),o()(),r(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),l(10),o()()()()()(),h()),t&2){let n=f().ngIf;m(10),d(n==null?null:n.StackTrace)}}function $t(t,e){if(t&1&&(g(0),r(1,"mainpanel",1)(2,"actions")(3,"a",2),l(4,"Back"),o()(),r(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),l(12,"General"),o()(),r(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),l(18,"Created Date"),o(),r(19,"div")(20,"span"),l(21),s(22,"date"),o()()()(),r(23,"div",10)(24,"div",11)(25,"label"),l(26,"Status"),o(),r(27,"div")(28,"span"),l(29),o()()()()(),r(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),l(34,"Duration"),o(),r(35,"div")(36,"span"),l(37),s(38,"number"),o()()()(),r(39,"div",10)(40,"div",11)(41,"label"),l(42,"Label"),o(),r(43,"div")(44,"span"),l(45),o()()()()()()()()(),r(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),l(51,"Message"),o()(),r(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),l(56),o()()()()()(),u(57,Bt,10,1,"div",16)(58,kt,11,1,"ng-container",0),o()()()(),h()),t&2){let n=e.ngIf;m(),p("headerTitle","Notification "+n.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),m(20),d(S(22,10,n.Created,"dd MMM yyyy HH:mm:ss")),m(8),d(n.StatusLabel),m(8),x("",S(38,13,n.DurationInSecond,"1.1-1")," s"),m(8),d(n.Label),m(11),d(n.Message),m(),p("ngIf",n==null?null:n.Perflog),m(),p("ngIf",n==null?null:n.StackTrace)}}var Ct=(()=>{let e=class e{constructor(a,i){this.activatedRoute=a,this.notificationService=i}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(q(a=>{let i=a.ID;return this.notificationService.getNotificationDetail(i).pipe(C(c=>(c.DurationInSecond=parseInt(c.Duration)/1e3,c)))}))}};e.\u0275fac=function(i){return new(i||e)(v(at),v(B))},e.\u0275cmp=y({type:e,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(i,c){i&1&&(u(0,$t,59,16,"ng-container",0),s(1,"async")),i&2&&p("ngIf",_(1,1,c.notification$))},dependencies:[T,k,F,w,P,M]});let t=e;return t})();var Ot=[{path:"",component:_t},{path:"detail",component:Ct}],St=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=b({type:e}),e.\u0275inj=I({imports:[L,R.forChild(Ot)]});let t=e;return t})();var se=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=b({type:e}),e.\u0275inj=I({imports:[L,St,gt,mt,ht,R,$]});let t=e;return t})();export{se as NotificationModule};
1
+ import{a as B}from"./chunk-J5QT7AEB.js";import{a as vt}from"./chunk-7KG3DC5J.js";import{a as $}from"./chunk-6YZFSP2B.js";import{a as st,b as ft,d as ut,e as gt}from"./chunk-CCXKODFV.js";import{i as dt}from"./chunk-AKYLFMD3.js";import{e as pt}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{m as k,n as ht}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{h as rt,m as lt,y as mt}from"./chunk-BSN7ZAXG.js";import{c as ct}from"./chunk-64G3XLI6.js";import{m as at,p as F,r as R}from"./chunk-OVEJFFL6.js";import{$b as V,Bd as P,Cd as L,Da as N,Ea as E,Eb as u,Gb as p,Gc as s,Hc as _,Ic as S,Jc as it,Sb as r,Tb as o,Ub as D,Vb as g,Wb as h,Yb as G,Z as j,aa as q,bc as f,ca as U,ec as J,f as z,fb as W,gb as H,jb as m,ka as I,kb as v,mc as K,nc as l,oc as d,pc as x,rc as Q,sc as X,sd as nt,ta as y,tc as Y,ua as b,ud as ot,v as C,vd as T,wc as Z,xc as tt,yc as et,yd as w,zd as M}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var Et=(t,e)=>({"bg-gradient-danger":t,"bg-gradient-warning":e}),Dt=()=>["/menu/notification/detail"],Tt=t=>({ID:t});function wt(t,e){if(t&1&&(r(0,"span",14),D(1,"img",15),o(),l(2)),t&2){let n=e.item;m(),p("src",n.Img,H)("alt",n.Name),m(),x(" ",n.Name," ")}}function Mt(t,e){if(t&1&&(g(0),l(1),s(2,"number"),r(3,"span"),l(4,"s"),o(),h()),t&2){let n=f().$implicit;m(),x(" ",S(2,1,n.DurationInSecond,"1.1-1")," ")}}function Pt(t,e){t&1&&l(0," - ")}function Lt(t,e){if(t&1&&(g(0),r(1,"tr",16)(2,"td")(3,"a",17),D(4,"img",18),r(5,"span"),l(6),o()()(),r(7,"td")(8,"b"),l(9),o(),D(10,"div",19),o(),r(11,"td"),u(12,Mt,5,4,"ng-container",20)(13,Pt,1,0,"ng-template",null,0,it),o(),r(15,"td"),l(16),o(),r(17,"td"),l(18),s(19,"date"),o()(),h()),t&2){let n=e.$implicit,a=K(14);m(),p("ngClass",et(14,Et,n.Status==1,n.Status==0)),m(2),p("routerLink",Z(17,Dt))("queryParams",tt(18,Tt,n.ID)),m(),J("src",n.Img,H),m(2),d(n.Name),m(3),d(n.Label),m(),p("innerHTML",n.Message,W),m(2),p("ngIf",n.DurationInSecond)("ngIfElse",a),m(4),d(n.StatusLabel),m(2),d(S(19,11,n.Created,"dd MMM yyyy HH:mm"))}}function Ft(t,e){if(t&1){let n=G();g(0),r(1,"div",6)(2,"div",21)(3,"app-custom-paginator",22),s(4,"async"),s(5,"async"),V("total",function(){N(n);let i=f(2);return E(i.getRowCount())})("next",function(){N(n);let i=f(2);return E(i.getNotifications())})("previous",function(){N(n);let i=f(2);return E(i.getNotifications())}),o()()(),h()}if(t&2){let n=f().ngIf,a=f();m(3),p("filter",a.filter)("totaldata",n==null?null:n.length)("paginationTotal",_(4,4,a.rowCount$))("hasClicked",_(5,6,a.rowCount$))}}function Rt(t,e){if(t&1&&(g(0),u(1,Ft,6,8,"ng-container",13),h()),t&2){let n=e.ngIf;m(),p("ngIf",n.length>0)}}var _t=(()=>{let e=class e{constructor(a,i,c){this.http=a,this.notificationService=i,this.authService=c,this.filter=new vt,this.destroy$=new z,this.channelOptions=c.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(U(this.destroy$)).subscribe(a=>{a.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(a=>{this.filter=a.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let a={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",a).pipe(C(i=>i.Data),C(i=>(i=this.setChannelLogoToNotifications(i),i=this.setTimeToSecond(i),i)),j(1))}setTimeToSecond(a){return a=a.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i)),a}setChannelLogoToNotifications(a){return a=a.map(i=>(i.Img=ct.getChannelLogoByTypeId(i.TypeID),i)),a}getRowCount(){let a={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",a).pipe(C(i=>i.Count),j(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};e.\u0275fac=function(i){return new(i||e)(v(pt),v(B),v(dt))},e.\u0275cmp=y({type:e,selectors:[["app-notification"]],decls:30,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(i,c){i&1&&(r(0,"mainpanel",1),V("onSubmit",function(){return c.onFilter()}),r(1,"filters")(2,"div")(3,"h6",2),l(4,"Channel"),o(),r(5,"ng-select",3),Y("ngModelChange",function(O){return X(c.filter.ChannelID,O)||(c.filter.ChannelID=O),O}),u(6,wt,3,3,"ng-template",4),o()()(),r(7,"content")(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11)(15,"th"),l(16,"Channel"),o(),r(17,"th"),l(18,"Process"),o(),r(19,"th"),l(20,"Duration"),o(),r(21,"th"),l(22,"Status"),o(),r(23,"th"),l(24,"Created"),o()()(),r(25,"tbody"),u(26,Lt,20,20,"ng-container",12),s(27,"async"),o()()()()(),u(28,Rt,2,1,"ng-container",13),s(29,"async"),o()()()),i&2&&(m(5),p("clearable",!0)("items",c.channelOptions),Q("ngModel",c.filter.ChannelID),m(21),p("ngForOf",_(27,5,c.notifications$)),m(2),p("ngIf",_(29,7,c.notifications$)))},dependencies:[nt,ot,T,ut,st,ft,rt,lt,k,F,$,w,P,M]});let t=e;return t})();function Bt(t,e){if(t&1&&(r(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),l(4,"Perflog"),o()(),r(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),l(9),o()()()()()()),t&2){let n=f().ngIf;m(9),d(n.Perflog)}}function kt(t,e){if(t&1&&(g(0),r(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),l(5,"StackTrace"),o()(),r(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),l(10),o()()()()()(),h()),t&2){let n=f().ngIf;m(10),d(n==null?null:n.StackTrace)}}function $t(t,e){if(t&1&&(g(0),r(1,"mainpanel",1)(2,"actions")(3,"a",2),l(4,"Back"),o()(),r(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),l(12,"General"),o()(),r(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),l(18,"Created Date"),o(),r(19,"div")(20,"span"),l(21),s(22,"date"),o()()()(),r(23,"div",10)(24,"div",11)(25,"label"),l(26,"Status"),o(),r(27,"div")(28,"span"),l(29),o()()()()(),r(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),l(34,"Duration"),o(),r(35,"div")(36,"span"),l(37),s(38,"number"),o()()()(),r(39,"div",10)(40,"div",11)(41,"label"),l(42,"Label"),o(),r(43,"div")(44,"span"),l(45),o()()()()()()()()(),r(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),l(51,"Message"),o()(),r(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),l(56),o()()()()()(),u(57,Bt,10,1,"div",16)(58,kt,11,1,"ng-container",0),o()()()(),h()),t&2){let n=e.ngIf;m(),p("headerTitle","Notification "+n.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),m(20),d(S(22,10,n.Created,"dd MMM yyyy HH:mm:ss")),m(8),d(n.StatusLabel),m(8),x("",S(38,13,n.DurationInSecond,"1.1-1")," s"),m(8),d(n.Label),m(11),d(n.Message),m(),p("ngIf",n==null?null:n.Perflog),m(),p("ngIf",n==null?null:n.StackTrace)}}var Ct=(()=>{let e=class e{constructor(a,i){this.activatedRoute=a,this.notificationService=i}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(q(a=>{let i=a.ID;return this.notificationService.getNotificationDetail(i).pipe(C(c=>(c.DurationInSecond=parseInt(c.Duration)/1e3,c)))}))}};e.\u0275fac=function(i){return new(i||e)(v(at),v(B))},e.\u0275cmp=y({type:e,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(i,c){i&1&&(u(0,$t,59,16,"ng-container",0),s(1,"async")),i&2&&p("ngIf",_(1,1,c.notification$))},dependencies:[T,k,F,w,P,M]});let t=e;return t})();var Ot=[{path:"",component:_t},{path:"detail",component:Ct}],St=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=b({type:e}),e.\u0275inj=I({imports:[L,R.forChild(Ot)]});let t=e;return t})();var se=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=b({type:e}),e.\u0275inj=I({imports:[L,St,gt,mt,ht,R,$]});let t=e;return t})();export{se as NotificationModule};
@@ -1,2 +1,2 @@
1
- import{a as Ve}from"./chunk-5OHPBQ35.js";import"./chunk-LRU7GIXZ.js";import{a as L}from"./chunk-WTR5UFZI.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Pe,b as De,c as G}from"./chunk-B5PFUQJP.js";import"./chunk-BVIRHZTZ.js";import{b as Me}from"./chunk-AMSVLO4N.js";import{a as Ee}from"./chunk-N6IHFFFZ.js";import{a as Te,b as Fe}from"./chunk-PD4CUVAW.js";import"./chunk-IJYSJN63.js";import"./chunk-X5Q6FPWS.js";import"./chunk-46AOM3SM.js";import"./chunk-OULUJ2IO.js";import"./chunk-GCKSYCMI.js";import{a as we}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import{a as be}from"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{e as ge}from"./chunk-CCXKODFV.js";import{i as Ce}from"./chunk-S4LDJFZS.js";import{b as de,e as ue}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as Se,l as ye,m as ve,n as Ie}from"./chunk-BO4PPSB5.js";import{t as fe,u as xe}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{b as re,c as se,h as pe,m as ce,o as me,y as _e}from"./chunk-BSN7ZAXG.js";import{c as v,f as he}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as f,Bd as ae,Cd as le,Da as _,Ea as d,Eb as u,G as Y,Gb as m,Gc as h,Hc as x,Ic as N,Jc as z,Nb as I,Ob as U,Qb as $,Rb as j,Sb as a,Tb as r,Ub as S,Vb as D,Wb as V,Yb as y,Z as A,bc as l,ea as W,ec as q,gb as P,jb as s,kb as w,mc as Q,nc as c,oc as k,pa as K,pc as M,rc as b,sc as T,sd as ee,ta as Z,tc as F,uc as X,ud as te,vc as J,vd as ne,xb as O,xc as R,yd as ie,zd as oe}from"./chunk-PQDPS2ID.js";import{a as B}from"./chunk-GNOSNGXM.js";var Ne=o=>({"text-decoration-line-through":o}),Le=o=>({"ms-10":o}),Be=o=>({"bg-gradient-warning":o});function Ae(o,p){if(o&1){let e=y();a(0,"button",38),f("click",function(){_(e);let t=l().ngIf,i=l(2);return d(i.updateStock(t))}),S(1,"i",39),c(2," Update "),r()}}function We(o,p){if(o&1){let e=y();a(0,"div"),u(1,Ae,3,0,"button",35),a(2,"button",36),f("click",function(){_(e);let t=l(2);return d(t.openExportDialog())}),S(3,"i",37),a(4,"span"),c(5,"Export"),r()()()}if(o&2){let e=p.ngIf,n=l(2);s(),m("ngIf",n.productService.hasSelectionVariant(e))}}function Oe(o,p){o&1&&(a(0,"div",40)(1,"span"),c(2," showing only different stock, please press next to populate more data "),r()())}function Ue(o,p){if(o&1){let e=y();a(0,"th")(1,"input",41),F("ngModelChange",function(t){_(e);let i=l(2);return T(i.checkboxState,t)||(i.checkboxState=t),d(t)}),f("ngModelChange",function(){let t=_(e).ngIf,i=l(2);return d(i.onCheckboxStateChange(t))}),r()()}if(o&2){let e=l(2);s(),b("ngModel",e.checkboxState)}}function $e(o,p){o&1&&(a(0,"th",32),c(1," Reserved "),r())}function je(o,p){}function Qe(o,p){if(o&1){let e=y();a(0,"input",60),F("ngModelChange",function(t){_(e);let i=l(3).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),f("ngModelChange",function(){_(e);let t=l(3).$implicit,i=l(2);return d(i.onCheckboxStateProduct(t))}),r()}if(o&2){let e=l(3).$implicit;b("ngModel",e.selected)}}function ze(o,p){if(o&1){let e=y();a(0,"img",61),f("click",function(t){_(e);let i=l(3).$implicit,C=l(2);return d(C.onZoomImage(t,i==null?null:i.ImageUrl))}),r()}if(o&2){let e=l(3).$implicit;q("src",e==null?null:e.ThumbnailUrl,P)}}function Ge(o,p){o&1&&S(0,"img",57)}function He(o,p){if(o&1&&(S(0,"br"),a(1,"div",62),S(2,"i",63),a(3,"small"),c(4),r()()),o&2){let e=l(3).$implicit;s(4),M("(",e==null?null:e.Category,")")}}function Ye(o,p){if(o&1&&(a(0,"td",53)(1,"div",14),u(2,Qe,1,1,"input",54),a(3,"div",55),u(4,ze,1,1,"img",56)(5,Ge,1,0,"img",57),r()()(),a(6,"td",58)(7,"span",59),c(8),r(),u(9,He,5,1),r()),o&2){let e=l(2).$implicit,n=l(2);m("rowSpan",e==null?null:e.Variants.length),s(2),I(e.Variants.length>1?2:-1),s(),m("ngClass",R(7,Le,e.Variants.length<=1)),s(),I(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),k(e==null?null:e.Name),s(),I(e.CategoryID!==null&&e.CategoryID!=n.guidEmpty?9:-1)}}function Ke(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l(2).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l(2).$implicit;b("ngModel",e.selected)}}function Ze(o,p){if(o&1&&u(0,Ke,1,1,"input",47),o&2){let e=l().$implicit;I((e==null?null:e.Inventory)<=1e5?0:-1)}}function qe(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l().$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l().$implicit;b("ngModel",e.selected)}}function Xe(o,p){o&1&&(a(0,"div",64),c(1," Not Found "),r())}function Je(o,p){if(o&1&&(a(0,"div")(1,"span",65),c(2),h(3,"number"),r(),c(4," => "),a(5,"span",66),c(6),h(7,"number"),r()()),o&2){let e=l().$implicit;s(2),M(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),k(x(7,4,e==null?null:e.Inventory))}}function et(o,p){if(o&1&&(c(0),h(1,"number")),o&2){let e=l().$implicit;M(" ",x(1,1,e==null?null:e.Inventory)," ")}}function tt(o,p){if(o&1&&(D(0),a(1,"div",67)(2,"a",68),S(3,"i",69),r()(),V()),o&2){let e=l().$implicit,n=l(3);s(2),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),P)}}function nt(o,p){if(o&1){let e=y();a(0,"span",74),f("click",function(){let t=_(e).ngIf,i=l(2).$implicit,C=l().$implicit,g=l(2);return d(g.openTableDialog(C,i,t))}),c(1),h(2,"number"),r()}if(o&2){let e=l(2).$implicit;s(),M(" ",x(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function it(o,p){if(o&1){let e=y();a(0,"td",70)(1,"div",48)(2,"div"),u(3,nt,3,3,"span",71),h(4,"async"),r(),a(5,"div",67)(6,"a",68),S(7,"i",69),r()(),a(8,"div",67)(9,"span",72),f("click",function(){_(e);let t=l().$implicit,i=l(3);return d(i.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),S(10,"i",73),r()()()()}if(o&2){let e=l().$implicit,n=l(3);m("ngClass",R(5,Be,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",x(4,3,n.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,P)}}function ot(o,p){if(o&1&&(D(0),a(1,"span",75),c(2),h(3,"number"),r(),V()),o&2){let e=l(2).$implicit;s(2),M(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function at(o,p){o&1&&c(0," - ")}function lt(o,p){if(o&1&&(D(0),a(1,"td",44),u(2,ot,4,3,"ng-container",52)(3,at,1,0,"ng-template",null,1,z),r(),V()),o&2){let e=Q(4),n=l().$implicit;s(2),m("ngIf",n==null||n.Channel[0]==null?null:n.Channel[0].InventoryReserved)("ngIfElse",e)}}function rt(o,p){o&1&&(D(0),c(1," - "),V())}function st(o,p){if(o&1&&(a(0,"span",76),h(1,"date"),c(2),h(3,"date"),r()),o&2){let e=l().$implicit;m("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),M(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function pt(o,p){if(o&1&&(a(0,"tr"),u(1,Ye,10,9),a(2,"td",43),c(3),r(),a(4,"td",44)(5,"span",45),c(6),r()(),a(7,"td",46),u(8,Ze,1,1)(9,qe,1,1,"input",47),r(),a(10,"td")(11,"div",48),u(12,Xe,2,0,"div",49)(13,Je,8,6,"div")(14,et,2,3)(15,tt,4,1,"ng-container",5),r()(),u(16,it,11,7,"td",50)(17,lt,5,2,"ng-container",5),a(18,"td",51),u(19,rt,2,0,"ng-container",52)(20,st,4,8,"ng-template",null,0,z),r()()),o&2){let e=p.$implicit,n=p.index,t=Q(21),i=l(3);s(),I(n==0?1:-1),s(2),k(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",R(14,Ne,e.Discontinued)),s(),k(e==null?null:e.Code),s(2),I((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),m("ngIf",(e==null?null:e.I)==null),s(),I((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),I((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",t)}}function ct(o,p){if(o&1&&(a(0,"tbody"),$(1,je,0,0,null,null,U),u(3,pt,22,16,"tr",42),r()),o&2){let e=p.$implicit;s(),j(e.Variants),s(2),m("ngForOf",e.Variants)}}function mt(o,p){if(o&1){let e=y();a(0,"mainpanel",3),f("onSubmit",function(t){_(e);let i=l();return d(i.onSearch(t))}),a(1,"actions")(2,"div",4),u(3,We,6,1,"div",5),h(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),f("onChannelChange",function(t){_(e);let i=l();return d(i.onChannelChange(t))}),r()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),r(),a(13,"input",10),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),d(t)}),r()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),r(),a(17,"input",12),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),d(t)}),r()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityFrom,t)||(i.searchFilter.QuantityFrom=t),d(t)}),r(),c(23," - "),a(24,"input",16),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityTo,t)||(i.searchFilter.QuantityTo=t),d(t)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),u(29,Oe,3,0,"div",20),a(30,"table",21)(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),S(35,"br"),a(36,"mat-slide-toggle",24),f("toggleChange",function(){_(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,d(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),r()()(),a(39,"th",25),c(40,"Variant"),r(),a(41,"th",26),c(42,"SKU"),r(),u(43,Ue,2,1,"th",5),h(44,"async"),a(45,"th",27),c(46,"POS"),r(),a(47,"th",28)(48,"div",29),f("click",function(){_(e);let t=l();return d(t.openModalFilter())}),S(49,"img",30),a(50,"span",31),c(51),h(52,"stringLimit"),r()()(),u(53,$e,2,0,"th",32),a(54,"th",33),c(55,"Last Sync"),r()()(),$(56,ct,4,1,"tbody",null,U),h(58,"async"),r(),a(59,"infinite-paginator",34),h(60,"async"),f("onNextPage",function(){_(e);let t=l();return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=l();return d(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=l();return d(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(o&2){let e,n,t,i=l();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",x(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),b("ngModel",i.searchFilter.PageNumber),s(4),b("ngModel",i.searchFilter.RowCount),s(5),b("ngModel",i.searchFilter.QuantityFrom),s(2),b("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngIf",x(44,23,i.products$)),s(5),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(n=i.channelIdentity())==null?null:n.img,P),s(2),M(" ",N(52,25,(t=i.channelIdentity())==null?null:t.label,13)," "),s(2),I(i.isShowReservedColumn?53:-1),s(3),j(x(58,28,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",x(60,30,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var Kt=(()=>{let p=class p{constructor(n,t,i,C,g,E,ke,Re){this.http=n,this.toastr=t,this.dialog=i,this.productService=C,this.authService=g,this.biggerPictureService=E,this.inventoryService=ke,this.mainPanelService=Re,this.infinitePagination=K(G),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=v.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=v.GuidEMpty,this.selectedChannel=O(null),this.channelIdentity=O({img:null,label:null}),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.infinitePagination.data$.pipe(W(n=>{this.checkShowReservedColumn(n)}),A())}checkShowReservedColumn(n){let t=0,i;n.forEach(C=>{i=C.Variants.find(g=>v.IsNotEmpty(g?.Channel[0]?.InventoryReserved)),i&&(t+=1)}),this.isShowReservedColumn=t>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(A(1),W(n=>{this.searchFilter={RowCount:n.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:n.Filter.ChannelID,LocationID:n.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!n.Filter.IsMarketplaceAppActive)}))}onChannelChange(n){let t=Object.assign({},n);this.selectedChannel.set(t),v.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let n=Object.assign({},this.selectedChannel());v.IsNotEmpty(n.parent)?(this.searchFilter.LocationID=n.id,this.searchFilter.ChannelID=n?.parent?.id,n.label=n?.parent?.label+" - "+n?.label,n.img=v.getChannelLogoByTypeId(n?.parent?.typeid)):(this.searchFilter.LocationID=null,n.img=v.getChannelLogoByTypeId(n?.typeid),this.searchFilter.ChannelID=n?.id,this.selectedChannel.set(n)),this.channelIdentity.update(()=>({img:n.img,label:n.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(n){n&&this.toastr.warning(`Automatic inventory sync disabled.
1
+ import{a as Ve}from"./chunk-5OHPBQ35.js";import"./chunk-LRU7GIXZ.js";import{a as L}from"./chunk-WTR5UFZI.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Pe,b as De,c as G}from"./chunk-B5PFUQJP.js";import"./chunk-BVIRHZTZ.js";import{b as Me}from"./chunk-AMSVLO4N.js";import{a as Ee}from"./chunk-N6IHFFFZ.js";import{a as Te,b as Fe}from"./chunk-PD4CUVAW.js";import"./chunk-IJYSJN63.js";import"./chunk-X5Q6FPWS.js";import"./chunk-46AOM3SM.js";import"./chunk-OULUJ2IO.js";import"./chunk-GCKSYCMI.js";import{a as we}from"./chunk-ZFQW5CVZ.js";import"./chunk-ADRVUMMW.js";import{a as be}from"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{e as ge}from"./chunk-CCXKODFV.js";import{i as Ce}from"./chunk-AKYLFMD3.js";import{b as de,e as ue}from"./chunk-4SAJUEHO.js";import"./chunk-KCDL7SWP.js";import{d as Se,l as ye,m as ve,n as Ie}from"./chunk-BO4PPSB5.js";import{t as fe,u as xe}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{b as re,c as se,h as pe,m as ce,o as me,y as _e}from"./chunk-BSN7ZAXG.js";import{c as v,f as he}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as f,Bd as ae,Cd as le,Da as _,Ea as d,Eb as u,G as Y,Gb as m,Gc as h,Hc as x,Ic as N,Jc as z,Nb as I,Ob as U,Qb as $,Rb as j,Sb as a,Tb as r,Ub as S,Vb as D,Wb as V,Yb as y,Z as A,bc as l,ea as W,ec as q,gb as P,jb as s,kb as w,mc as Q,nc as c,oc as k,pa as K,pc as M,rc as b,sc as T,sd as ee,ta as Z,tc as F,uc as X,ud as te,vc as J,vd as ne,xb as O,xc as R,yd as ie,zd as oe}from"./chunk-PQDPS2ID.js";import{a as B}from"./chunk-GNOSNGXM.js";var Ne=o=>({"text-decoration-line-through":o}),Le=o=>({"ms-10":o}),Be=o=>({"bg-gradient-warning":o});function Ae(o,p){if(o&1){let e=y();a(0,"button",38),f("click",function(){_(e);let t=l().ngIf,i=l(2);return d(i.updateStock(t))}),S(1,"i",39),c(2," Update "),r()}}function We(o,p){if(o&1){let e=y();a(0,"div"),u(1,Ae,3,0,"button",35),a(2,"button",36),f("click",function(){_(e);let t=l(2);return d(t.openExportDialog())}),S(3,"i",37),a(4,"span"),c(5,"Export"),r()()()}if(o&2){let e=p.ngIf,n=l(2);s(),m("ngIf",n.productService.hasSelectionVariant(e))}}function Oe(o,p){o&1&&(a(0,"div",40)(1,"span"),c(2," showing only different stock, please press next to populate more data "),r()())}function Ue(o,p){if(o&1){let e=y();a(0,"th")(1,"input",41),F("ngModelChange",function(t){_(e);let i=l(2);return T(i.checkboxState,t)||(i.checkboxState=t),d(t)}),f("ngModelChange",function(){let t=_(e).ngIf,i=l(2);return d(i.onCheckboxStateChange(t))}),r()()}if(o&2){let e=l(2);s(),b("ngModel",e.checkboxState)}}function $e(o,p){o&1&&(a(0,"th",32),c(1," Reserved "),r())}function je(o,p){}function Qe(o,p){if(o&1){let e=y();a(0,"input",60),F("ngModelChange",function(t){_(e);let i=l(3).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),f("ngModelChange",function(){_(e);let t=l(3).$implicit,i=l(2);return d(i.onCheckboxStateProduct(t))}),r()}if(o&2){let e=l(3).$implicit;b("ngModel",e.selected)}}function ze(o,p){if(o&1){let e=y();a(0,"img",61),f("click",function(t){_(e);let i=l(3).$implicit,C=l(2);return d(C.onZoomImage(t,i==null?null:i.ImageUrl))}),r()}if(o&2){let e=l(3).$implicit;q("src",e==null?null:e.ThumbnailUrl,P)}}function Ge(o,p){o&1&&S(0,"img",57)}function He(o,p){if(o&1&&(S(0,"br"),a(1,"div",62),S(2,"i",63),a(3,"small"),c(4),r()()),o&2){let e=l(3).$implicit;s(4),M("(",e==null?null:e.Category,")")}}function Ye(o,p){if(o&1&&(a(0,"td",53)(1,"div",14),u(2,Qe,1,1,"input",54),a(3,"div",55),u(4,ze,1,1,"img",56)(5,Ge,1,0,"img",57),r()()(),a(6,"td",58)(7,"span",59),c(8),r(),u(9,He,5,1),r()),o&2){let e=l(2).$implicit,n=l(2);m("rowSpan",e==null?null:e.Variants.length),s(2),I(e.Variants.length>1?2:-1),s(),m("ngClass",R(7,Le,e.Variants.length<=1)),s(),I(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),k(e==null?null:e.Name),s(),I(e.CategoryID!==null&&e.CategoryID!=n.guidEmpty?9:-1)}}function Ke(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l(2).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l(2).$implicit;b("ngModel",e.selected)}}function Ze(o,p){if(o&1&&u(0,Ke,1,1,"input",47),o&2){let e=l().$implicit;I((e==null?null:e.Inventory)<=1e5?0:-1)}}function qe(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l().$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l().$implicit;b("ngModel",e.selected)}}function Xe(o,p){o&1&&(a(0,"div",64),c(1," Not Found "),r())}function Je(o,p){if(o&1&&(a(0,"div")(1,"span",65),c(2),h(3,"number"),r(),c(4," => "),a(5,"span",66),c(6),h(7,"number"),r()()),o&2){let e=l().$implicit;s(2),M(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),k(x(7,4,e==null?null:e.Inventory))}}function et(o,p){if(o&1&&(c(0),h(1,"number")),o&2){let e=l().$implicit;M(" ",x(1,1,e==null?null:e.Inventory)," ")}}function tt(o,p){if(o&1&&(D(0),a(1,"div",67)(2,"a",68),S(3,"i",69),r()(),V()),o&2){let e=l().$implicit,n=l(3);s(2),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),P)}}function nt(o,p){if(o&1){let e=y();a(0,"span",74),f("click",function(){let t=_(e).ngIf,i=l(2).$implicit,C=l().$implicit,g=l(2);return d(g.openTableDialog(C,i,t))}),c(1),h(2,"number"),r()}if(o&2){let e=l(2).$implicit;s(),M(" ",x(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function it(o,p){if(o&1){let e=y();a(0,"td",70)(1,"div",48)(2,"div"),u(3,nt,3,3,"span",71),h(4,"async"),r(),a(5,"div",67)(6,"a",68),S(7,"i",69),r()(),a(8,"div",67)(9,"span",72),f("click",function(){_(e);let t=l().$implicit,i=l(3);return d(i.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),S(10,"i",73),r()()()()}if(o&2){let e=l().$implicit,n=l(3);m("ngClass",R(5,Be,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",x(4,3,n.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,P)}}function ot(o,p){if(o&1&&(D(0),a(1,"span",75),c(2),h(3,"number"),r(),V()),o&2){let e=l(2).$implicit;s(2),M(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function at(o,p){o&1&&c(0," - ")}function lt(o,p){if(o&1&&(D(0),a(1,"td",44),u(2,ot,4,3,"ng-container",52)(3,at,1,0,"ng-template",null,1,z),r(),V()),o&2){let e=Q(4),n=l().$implicit;s(2),m("ngIf",n==null||n.Channel[0]==null?null:n.Channel[0].InventoryReserved)("ngIfElse",e)}}function rt(o,p){o&1&&(D(0),c(1," - "),V())}function st(o,p){if(o&1&&(a(0,"span",76),h(1,"date"),c(2),h(3,"date"),r()),o&2){let e=l().$implicit;m("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),M(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function pt(o,p){if(o&1&&(a(0,"tr"),u(1,Ye,10,9),a(2,"td",43),c(3),r(),a(4,"td",44)(5,"span",45),c(6),r()(),a(7,"td",46),u(8,Ze,1,1)(9,qe,1,1,"input",47),r(),a(10,"td")(11,"div",48),u(12,Xe,2,0,"div",49)(13,Je,8,6,"div")(14,et,2,3)(15,tt,4,1,"ng-container",5),r()(),u(16,it,11,7,"td",50)(17,lt,5,2,"ng-container",5),a(18,"td",51),u(19,rt,2,0,"ng-container",52)(20,st,4,8,"ng-template",null,0,z),r()()),o&2){let e=p.$implicit,n=p.index,t=Q(21),i=l(3);s(),I(n==0?1:-1),s(2),k(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",R(14,Ne,e.Discontinued)),s(),k(e==null?null:e.Code),s(2),I((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),m("ngIf",(e==null?null:e.I)==null),s(),I((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),I((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",t)}}function ct(o,p){if(o&1&&(a(0,"tbody"),$(1,je,0,0,null,null,U),u(3,pt,22,16,"tr",42),r()),o&2){let e=p.$implicit;s(),j(e.Variants),s(2),m("ngForOf",e.Variants)}}function mt(o,p){if(o&1){let e=y();a(0,"mainpanel",3),f("onSubmit",function(t){_(e);let i=l();return d(i.onSearch(t))}),a(1,"actions")(2,"div",4),u(3,We,6,1,"div",5),h(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),f("onChannelChange",function(t){_(e);let i=l();return d(i.onChannelChange(t))}),r()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),r(),a(13,"input",10),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),d(t)}),r()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),r(),a(17,"input",12),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),d(t)}),r()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityFrom,t)||(i.searchFilter.QuantityFrom=t),d(t)}),r(),c(23," - "),a(24,"input",16),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityTo,t)||(i.searchFilter.QuantityTo=t),d(t)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),u(29,Oe,3,0,"div",20),a(30,"table",21)(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),S(35,"br"),a(36,"mat-slide-toggle",24),f("toggleChange",function(){_(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,d(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),r()()(),a(39,"th",25),c(40,"Variant"),r(),a(41,"th",26),c(42,"SKU"),r(),u(43,Ue,2,1,"th",5),h(44,"async"),a(45,"th",27),c(46,"POS"),r(),a(47,"th",28)(48,"div",29),f("click",function(){_(e);let t=l();return d(t.openModalFilter())}),S(49,"img",30),a(50,"span",31),c(51),h(52,"stringLimit"),r()()(),u(53,$e,2,0,"th",32),a(54,"th",33),c(55,"Last Sync"),r()()(),$(56,ct,4,1,"tbody",null,U),h(58,"async"),r(),a(59,"infinite-paginator",34),h(60,"async"),f("onNextPage",function(){_(e);let t=l();return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=l();return d(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=l();return d(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(o&2){let e,n,t,i=l();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",x(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),b("ngModel",i.searchFilter.PageNumber),s(4),b("ngModel",i.searchFilter.RowCount),s(5),b("ngModel",i.searchFilter.QuantityFrom),s(2),b("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngIf",x(44,23,i.products$)),s(5),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(n=i.channelIdentity())==null?null:n.img,P),s(2),M(" ",N(52,25,(t=i.channelIdentity())==null?null:t.label,13)," "),s(2),I(i.isShowReservedColumn?53:-1),s(3),j(x(58,28,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",x(60,30,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var Kt=(()=>{let p=class p{constructor(n,t,i,C,g,E,ke,Re){this.http=n,this.toastr=t,this.dialog=i,this.productService=C,this.authService=g,this.biggerPictureService=E,this.inventoryService=ke,this.mainPanelService=Re,this.infinitePagination=K(G),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=v.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=v.GuidEMpty,this.selectedChannel=O(null),this.channelIdentity=O({img:null,label:null}),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.infinitePagination.data$.pipe(W(n=>{this.checkShowReservedColumn(n)}),A())}checkShowReservedColumn(n){let t=0,i;n.forEach(C=>{i=C.Variants.find(g=>v.IsNotEmpty(g?.Channel[0]?.InventoryReserved)),i&&(t+=1)}),this.isShowReservedColumn=t>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(A(1),W(n=>{this.searchFilter={RowCount:n.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:n.Filter.ChannelID,LocationID:n.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!n.Filter.IsMarketplaceAppActive)}))}onChannelChange(n){let t=Object.assign({},n);this.selectedChannel.set(t),v.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let n=Object.assign({},this.selectedChannel());v.IsNotEmpty(n.parent)?(this.searchFilter.LocationID=n.id,this.searchFilter.ChannelID=n?.parent?.id,n.label=n?.parent?.label+" - "+n?.label,n.img=v.getChannelLogoByTypeId(n?.parent?.typeid)):(this.searchFilter.LocationID=null,n.img=v.getChannelLogoByTypeId(n?.typeid),this.searchFilter.ChannelID=n?.id,this.selectedChannel.set(n)),this.channelIdentity.update(()=>({img:n.img,label:n.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(n){n&&this.toastr.warning(`Automatic inventory sync disabled.
2
2
  Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}onSearch(n){this.searchFilter.text=n,this.setChannelFilter(),this.initReloadData()}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(n){let t=this.productService.selectedVariantProduct(n);if(t.length>0){let i=this.searchFilter.LocationID,C=t.map(E=>B({ID:E.ID,Code:E.Code,Inventory:E.Inventory},v.IsNotEmpty(i)&&{LocationID:i})),g={ListChannelID:[this.searchFilter.ChannelID],List:C};this.http.post("/api/Inventory/UpdateChannel",g).subscribe(E=>{this.initReloadData(),this.checkboxState=!1,this.handlingUpdateStock(E)})}}handlingUpdateStock(n){if(n[0]?.Response){let t=n[0]?.Response?.Fail_list,i=n[0]?.Response?.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",i,t)}else this.toastr.error(n[0]?.Exception,"Error")}refreshInventory(n,t,i,C){let g={ChannelItemID:n,ChannelVariationID:t,ChannelID:i,VariantID:C};this.http.post("/api/Inventory/RefreshInventoryChannel",g).subscribe(E=>{this.toastr.success("Successfully updated","Success"),this.initReloadData()})}onCheckboxStateProduct(n){n.Variants=n.Variants.map(t=>(t.Inventory>=0&&(t.selected=n.selected),t))}onCheckboxStateChange(n){n=n.map(t=>(t.Variants=t.Variants.map(i=>(i.selected=this.checkboxState,i)),t))}openTableDialog(n,t,i){this.dialog.open(Pe,{data:{Name:n.Name,Variant:t,ChannelID:t?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:n.ChannelItemID}}).afterClosed().pipe(Y(g=>v.IsNotEmpty(g))).subscribe(g=>{this.updateItemAfterDialog(g)})}updateItemAfterDialog(n){let t=this.searchFilter.LocationID,i=B({ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,NewQuantity:parseFloat(n.Inventory),VariantID:n.ID,SKU:n.Sku},v.IsNotEmpty(t)&&{LocationID:t});this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(C=>{this.searchFilter.PageNumber=1,this.initReloadData(),this.handlingUpdateStock([C])})}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Inventory Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,QuantityFrom:this.searchFilter.QuantityFrom,QuantityTo:this.searchFilter.QuantityTo,exportApi:"Inventory/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=H.DIFFERENCE:this.searchFilter.filterModel=H.ALL,this.initReloadData()}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}};p.\u0275fac=function(t){return new(t||p)(w(ue),w(de),w(Se),w(we),w(Ce),w(be),w(L),w(ye))},p.\u0275cmp=Z({type:p,selectors:[["app-single-channel-comparison"]],standalone:!0,features:[X([G,L]),J],decls:2,vars:3,consts:[["SYNCDATE",""],["EMPTY_RESERVED",""],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"onSubmit","headerTitle","pageData","hideSearchBox"],[1,"d-flex"],[4,"ngIf"],["for","channelOptions",1,"fw-bold","mb-2"],["id","channelOptions",3,"onChannelChange","ngModel"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["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"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"align-middle"],["type","checkbox",3,"ngModel"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"width","0%",3,"rowSpan"],["type","checkbox",1,"me-3",3,"ngModel"],[3,"ngClass"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Stock Available"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-end",3,"ngClass"],["class","cursor",3,"click",4,"ngIf"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom","pt-1"],[1,"cursor",3,"click"],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"]],template:function(t,i){t&1&&(u(0,mt,61,32,"mainpanel",2),h(1,"async")),t&2&&m("ngIf",x(1,1,i.loader$))},dependencies:[le,ee,te,ne,ie,ae,oe,Ie,ve,ge,_e,se,me,re,pe,ce,Ee,De,he,Fe,Te,xe,fe,Ve],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});let o=p;return o})();export{Kt as SingleChannelComparisonComponent};