marketplacepos 5.38.3 → 5.38.4

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-CZUJNA5G.js → chunk-2ESOTQPW.js} +1 -1
  2. package/Marketplace/{chunk-7POQ3C3K.js → chunk-2JKSMF3I.js} +1 -1
  3. package/Marketplace/{chunk-PG3IYBPX.js → chunk-2OL4XZXJ.js} +1 -1
  4. package/Marketplace/{chunk-NEXCPJGQ.js → chunk-3C4M544Q.js} +1 -1
  5. package/Marketplace/{chunk-HLBD2ZRF.js → chunk-4RXCRDWF.js} +1 -1
  6. package/Marketplace/{chunk-WFEOCQ7B.js → chunk-54RFAHSK.js} +1 -1
  7. package/Marketplace/{chunk-AHACTT37.js → chunk-5X6GYYIM.js} +1 -1
  8. package/Marketplace/{chunk-F7NU25EB.js → chunk-7AVVOGZA.js} +1 -1
  9. package/Marketplace/{chunk-ZHN24KZM.js → chunk-BXKAE7Z3.js} +1 -1
  10. package/Marketplace/{chunk-KVKFKGDQ.js → chunk-CZWNWUW2.js} +1 -1
  11. package/Marketplace/{chunk-OOJNZDBG.js → chunk-DYBAGP7P.js} +1 -1
  12. package/Marketplace/{chunk-VOXQUD5E.js → chunk-EA52MAWA.js} +1 -1
  13. package/Marketplace/{chunk-UPZ35RUO.js → chunk-EOPCFNMW.js} +1 -1
  14. package/Marketplace/{chunk-Z3KIQHIK.js → chunk-EU6PHSKS.js} +1 -1
  15. package/Marketplace/{chunk-K5ZBGZ47.js → chunk-G35YVLFO.js} +1 -1
  16. package/Marketplace/{chunk-ZYWCWZDR.js → chunk-GQZES4UF.js} +1 -1
  17. package/Marketplace/{chunk-JIBVE3DE.js → chunk-GZIXVRJT.js} +1 -1
  18. package/Marketplace/{chunk-LRHLOGXM.js → chunk-HQL6WPF6.js} +1 -1
  19. package/Marketplace/{chunk-XYZPGDD2.js → chunk-HTVSJFUP.js} +1 -1
  20. package/Marketplace/{chunk-CBHXQUMA.js → chunk-JYLQJCDT.js} +1 -1
  21. package/Marketplace/{chunk-VSJIQ3SX.js → chunk-KZTPUAO4.js} +1 -1
  22. package/Marketplace/{chunk-AVI5X2TT.js → chunk-LMYPSQJN.js} +1 -1
  23. package/Marketplace/{chunk-OJVDCT5U.js → chunk-LQQ67QXG.js} +2 -2
  24. package/Marketplace/{chunk-G6T2QL55.js → chunk-QRJDRFNS.js} +1 -1
  25. package/Marketplace/{chunk-4AOCYXXV.js → chunk-SA573BZL.js} +1 -1
  26. package/Marketplace/{chunk-5RI4KPF6.js → chunk-SVCUTNSP.js} +1 -1
  27. package/Marketplace/{chunk-W3X2KRUQ.js → chunk-T3VPBK5Q.js} +1 -1
  28. package/Marketplace/{chunk-S6WP72HC.js → chunk-TTKPJA6M.js} +1 -1
  29. package/Marketplace/{chunk-ZS3HQV2S.js → chunk-U2ZMUFQ6.js} +1 -1
  30. package/Marketplace/{chunk-7CDZNNWL.js → chunk-WCAHHXUG.js} +1 -1
  31. package/Marketplace/{chunk-3PJZW7HF.js → chunk-XDUYDX35.js} +1 -1
  32. package/Marketplace/{chunk-B5LX5TOF.js → chunk-YCXXSKHC.js} +1 -1
  33. package/Marketplace/{chunk-HAUNYMEG.js → chunk-YSHR4I3P.js} +1 -1
  34. package/Marketplace/{chunk-4FI4YSVV.js → chunk-ZGL7PBN6.js} +2 -2
  35. package/Marketplace/index.html +2 -2
  36. package/Marketplace/{main-TARO2A2O.js → main-DFBPCCHZ.js} +1 -1
  37. package/package.json +1 -1
@@ -1 +1 @@
1
- import{a as h,b as f}from"./chunk-OE2JYQHN.js";import{a as i}from"./chunk-F7NU25EB.js";import"./chunk-3PJZW7HF.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import"./chunk-PXB4YEY3.js";import{F as C,J as n,n as o}from"./chunk-GPEVUTDI.js";import{Eb as l,Fb as c,Wb as s,gc as u,hc as d,ic as r,ka as p,qb as m}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var v=(()=>{class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,P){t&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),r(3,"nav-tab",2),d()()(),r(4,"router-outlet")),t&2&&(m(3),s("Tabs",P.priceTabs))},dependencies:[o,f,h,n,C],encapsulation:2})}}return e})();var M=[{path:"",component:v,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-AHACTT37.js").then(e=>e.PricePosChannelComponent)},canActivate:[i],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-PG3IYBPX.js").then(e=>e.CustomChannelPriceComponent)},canActivate:[i],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-WFEOCQ7B.js").then(e=>e.PriceSingleChannelComponent)},canActivate:[i],data:{title:"Price Single Channel Comparison"}}]}],j=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=c({type:e})}static{this.\u0275inj=p({imports:[o,n.forChild(M)]})}}return e})();export{j as PriceRoutingModule};
1
+ import{a as h,b as f}from"./chunk-OE2JYQHN.js";import{a as i}from"./chunk-7AVVOGZA.js";import"./chunk-XDUYDX35.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import"./chunk-PXB4YEY3.js";import{F as C,J as n,n as o}from"./chunk-GPEVUTDI.js";import{Eb as l,Fb as c,Wb as s,gc as u,hc as d,ic as r,ka as p,qb as m}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var v=(()=>{class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-price"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,P){t&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),r(3,"nav-tab",2),d()()(),r(4,"router-outlet")),t&2&&(m(3),s("Tabs",P.priceTabs))},dependencies:[o,f,h,n,C],encapsulation:2})}}return e})();var M=[{path:"",component:v,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-5X6GYYIM.js").then(e=>e.PricePosChannelComponent)},canActivate:[i],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-2OL4XZXJ.js").then(e=>e.CustomChannelPriceComponent)},canActivate:[i],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-54RFAHSK.js").then(e=>e.PriceSingleChannelComponent)},canActivate:[i],data:{title:"Price Single Channel Comparison"}}]}],j=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=c({type:e})}static{this.\u0275inj=p({imports:[o,n.forChild(M)]})}}return e})();export{j as PriceRoutingModule};
@@ -1 +1 @@
1
- import{a as O}from"./chunk-UBMI3NQH.js";import{a as P}from"./chunk-J3P46Z53.js";import{a as M}from"./chunk-4ASUM4N5.js";import{b as h}from"./chunk-CVQMAWML.js";import"./chunk-LEHTNMIE.js";import{c as f}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a}from"./chunk-F7NU25EB.js";import{a as C}from"./chunk-62PFQNHJ.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{e as u}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import"./chunk-3PJZW7HF.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{n as g}from"./chunk-ITTRZMEX.js";import{s}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{y as l}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{F as c,J as i,n as r}from"./chunk-GPEVUTDI.js";import{Eb as p,Fb as e,ic as d,ka as n}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var x=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=p({type:t,selectors:[["app-products"]],standalone:!1,decls:1,vars:0,template:function(o,y){o&1&&d(0,"router-outlet")},dependencies:[c],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}"]})}}return t})();var w=[{path:"",component:x,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-VSJIQ3SX.js").then(t=>t.StatusModule),canActivate:[a]},{path:"download",loadChildren:()=>import("./chunk-HAUNYMEG.js").then(t=>t.DownloadModule),canActivate:[a]},{path:"upload",loadComponent:()=>import("./chunk-7CDZNNWL.js").then(t=>t.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[a]}]}],_=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,i.forChild(w)]})}}return t})();var V=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,l,i,_,s,g,u,h,M,f,C,P,O]})}}return t})();export{V as ProductModule};
1
+ import{a as O}from"./chunk-UBMI3NQH.js";import{a as P}from"./chunk-J3P46Z53.js";import{a as M}from"./chunk-4ASUM4N5.js";import{b as h}from"./chunk-CVQMAWML.js";import"./chunk-LEHTNMIE.js";import{c as f}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a}from"./chunk-7AVVOGZA.js";import{a as C}from"./chunk-62PFQNHJ.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{e as u}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import"./chunk-XDUYDX35.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{n as g}from"./chunk-ITTRZMEX.js";import{s}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{y as l}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{F as c,J as i,n as r}from"./chunk-GPEVUTDI.js";import{Eb as p,Fb as e,ic as d,ka as n}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var x=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=p({type:t,selectors:[["app-products"]],standalone:!1,decls:1,vars:0,template:function(o,y){o&1&&d(0,"router-outlet")},dependencies:[c],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}"]})}}return t})();var w=[{path:"",component:x,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-KZTPUAO4.js").then(t=>t.StatusModule),canActivate:[a]},{path:"download",loadChildren:()=>import("./chunk-YSHR4I3P.js").then(t=>t.DownloadModule),canActivate:[a]},{path:"upload",loadComponent:()=>import("./chunk-WCAHHXUG.js").then(t=>t.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[a]}]}],_=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,i.forChild(w)]})}}return t})();var V=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e({type:t})}static{this.\u0275inj=n({imports:[r,l,i,_,s,g,u,h,M,f,C,P,O]})}}return t})();export{V as ProductModule};
@@ -1 +1 @@
1
- import{a as ke}from"./chunk-K5ZBGZ47.js";import{a as De}from"./chunk-OAS72QB2.js";import{a as W}from"./chunk-XHAXYWZ7.js";import{a as Oe,b as Ve,c as Ne,d as J}from"./chunk-UIM3W5B7.js";import{a as ue}from"./chunk-BVIRHZTZ.js";import{a as Te}from"./chunk-PPDHTO44.js";import{a as we}from"./chunk-7KG3DC5J.js";import{b as Ee}from"./chunk-3LQNSF7T.js";import"./chunk-YXFTLQ5M.js";import"./chunk-OLSC6KHB.js";import"./chunk-7TWBIV3T.js";import{a as Fe}from"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{a as ve,b as Ie,c as ye}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import{a as Me}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as xe}from"./chunk-3PJZW7HF.js";import{b as he,e as ge}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as Pe,m as be,n as Se}from"./chunk-ITTRZMEX.js";import{r as A,s as j}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as _e,h as R,m as L,y as $}from"./chunk-DPLEMBB4.js";import{c as U,e as Ce,f as fe}from"./chunk-PXB4YEY3.js";import{d as se,f as k,g as me,j as pe,m as de,n as B}from"./chunk-GPEVUTDI.js";import{$c as ce,Dc as z,Eb as N,Ec as p,Fc as re,G as K,Gc as f,Ic as D,Jc as O,Ka as ee,Kb as u,Kc as V,Oc as ae,Qa as te,Qc as w,Rc as le,Wb as s,Z as G,Zb as ne,Zc as b,_c as y,ad as H,bc as ie,cc as M,ea as Y,ec as E,fc as T,gc as o,hc as a,ic as P,jc as S,kc as v,mc as I,ob as F,pa as Q,qb as r,rc as h,sc as m,v as q,vc as oe,wb as x,ya as g,za as C}from"./chunk-T5ONJF63.js";import{a as X,b as Z}from"./chunk-K2H6WANG.js";var We=(n,c)=>({color:n,"font-weight":c});function Ke(n,c){if(n&1&&(o(0,"mat-radio-button",2),p(1),a()),n&2){let e=c.$implicit,i=c.index,t=m();ne(le(7,We,t.model==e.Key&&t.activeBold?"#0976b4":"",t.model==e.Key&&t.activeBold?"700":"")),s("disabled",t.exception==e.Value)("matTooltip",t.title.length>0?t.title[i]:"")("value",e.Key)("name",t.name),r(),f("",e.Value," ")}}var Be=(()=>{class n{constructor(){this.disabled=!1,this.modelChange=new ee,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(e){this.modelChange.emit(e)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=N({type:n,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(i,t){i&1&&(o(0,"mat-radio-group",0),h("ngModelChange",function(d){return t.change(d)}),u(1,Ke,2,10,"mat-radio-button",1),a()),i&2&&(s("disabled",t.disabled)("ngModel",t.model),r(),s("ngForOf",t.options))},dependencies:[B,k,ye,ve,Ie,$,R,L,j,A],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px}html[_ngcontent-%COMP%]{--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]})}}return n})();var Re=n=>[n],Ge=n=>({"text-decoration-line-through":n}),ze=n=>({"border-bottom":n}),He=n=>({"bg-gradient-warning":n});function Je(n,c){if(n&1){let e=I();S(0),o(1,"div")(2,"label",21),p(3,"Channel"),a(),o(4,"channel-select-options",22),V("ngModelChange",function(t){g(e);let l=m();return O(l.searchFilter.ListChannelID,t)||(l.searchFilter.ListChannelID=t),C(t)}),a()(),o(5,"div",23)(6,"label",24),p(7,"Filter by"),a(),o(8,"lib-radio-options",25),V("modelChange",function(t){g(e);let l=m();return O(l.searchFilter.filterModel,t)||(l.searchFilter.filterModel=t),C(t)}),a()(),v()}if(n&2){let e=m();r(4),s("multiple",!0),D("ngModel",e.searchFilter.ListChannelID),r(4),D("model",e.searchFilter.filterModel),s("options",e.filterTypeOptions)}}function Xe(n,c){if(n&1){let e=I();o(0,"button",27),h("click",function(){g(e);let t=m().ngIf,l=m();return C(l.onUpdateItems(t))}),P(1,"i",28),p(2," Update "),a()}}function Ze(n,c){if(n&1&&(S(0),o(1,"div",4),u(2,Xe,3,0,"button",26),a(),v()),n&2){let e=c.ngIf,i=m();r(2),s("ngIf",i.productService.hasSelectionVariant(e))}}function qe(n,c){if(n&1&&(o(0,"th",15)(1,"div",29),P(2,"img",30),o(3,"div",31),p(4),b(5,"stringLimit"),a()()()),n&2){let e=c.$implicit;r(),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,F),r(2),f(" ",ce(5,3,e.Name,20)," ")}}function Ye(n,c){if(n&1){let e=I();o(0,"th")(1,"input",32),V("ngModelChange",function(t){g(e);let l=m();return O(l.checkboxState,t)||(l.checkboxState=t),C(t)}),h("ngModelChange",function(){g(e);let t=m();return C(t.onSelectAllData())}),a()()}if(n&2){let e=m();r(),D("ngModel",e.checkboxState)}}function Qe(n,c){n&1&&(o(0,"th",33)(1,"span"),p(2,"Expected"),a(),o(3,"span",34),p(4,"(POS)"),a()(),o(5,"th",33),p(6,"Channel"),a())}function et(n,c){if(n&1){let e=I();o(0,"img",47),h("click",function(t){g(e);let l=m(3).$implicit,d=m(2);return C(d.onZoomImage(t,l==null?null:l.ImageUrl))}),a()}if(n&2){let e=m(3).$implicit;oe("src",e==null?null:e.ImageUrl,F)}}function tt(n,c){n&1&&P(0,"img",48)}function nt(n,c){if(n&1&&(o(0,"small",46),p(1),a()),n&2){let e=m(3).$implicit;r(),f("(",e==null?null:e.Category,")")}}function it(n,c){if(n&1&&(S(0),o(1,"td",42),u(2,et,1,1,"img",43)(3,tt,1,0,"ng-template",null,0,H),a(),o(5,"td",44)(6,"h5",45),p(7),a(),u(8,nt,2,1,"small",46),a(),v()),n&2){let e=z(4),i=m().$index,t=m().$implicit,l=m().ngIf;r(),s("rowSpan",t==null?null:t.Variants.length)("ngClass",w(7,ze,i+1==l.length)),r(),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",e),r(3),s("rowSpan",t==null?null:t.Variants.length),r(2),re(t==null?null:t.Name),r(),ie(t!=null&&t.Category?8:-1)}}function ot(n,c){if(n&1){let e=I();o(0,"td",49)(1,"input",32),V("ngModelChange",function(t){g(e);let l=m().$implicit;return O(l.selected,t)||(l.selected=t),C(t)}),a()()}if(n&2){let e=m().$implicit;r(),D("ngModel",e.selected)}}function rt(n,c){if(n&1){let e=I();S(0),o(1,"td",51),p(2),b(3,"number"),a(),o(4,"td",52),h("click",function(){let t=g(e).$implicit,l=m(2).$implicit,d=m().$implicit,_=m(2);return C(_.openTableDialog(l,d,t))}),o(5,"div",53)(6,"div",54),p(7),b(8,"number"),a(),o(9,"a",55),h("click",function(t){return g(e),C(t==null?null:t.stopPropagation())}),P(10,"i",40),a()()(),v()}if(n&2){let e=c.$implicit;r(2),f(" ",y(3,4,e.PriceExpected)," "),r(2),s("ngClass",w(8,He,e.Price!=e.PriceExpected)),r(3),f(" ",y(8,6,e.Price)," "),r(2),s("href",e.Url,F)}}function at(n,c){n&1&&(o(0,"td",56),p(1," X "),a(),o(2,"td",56),p(3," X "),a())}function lt(n,c){if(n&1&&(S(0),u(1,rt,11,10,"ng-container",50)(2,at,4,0,"ng-template",null,1,H),v()),n&2){let e=c.$implicit,i=z(3),t=m().$implicit,l=m(3);r(),s("ngIf",l.getItemFromChannel(t,e.ID))("ngIfElse",i)}}function ct(n,c){if(n&1&&(o(0,"tr"),u(1,it,9,9,"ng-container",3),o(2,"td",35),p(3),a(),o(4,"td",36)(5,"div",37)(6,"div",38),p(7),a(),o(8,"div",31)(9,"a",39),P(10,"i",40),a()()()(),u(11,ot,2,1,"ng-template",19)(12,lt,4,2,"ng-container",41),a()),n&2){let e=c.$implicit,i=c.$index,t=m(3);r(),s("ngIf",i==0),r(2),f(" ",e==null?null:e.Model," "),r(),s("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),r(2),s("ngClass",w(8,Ge,e.Discontinued)),r(),f(" ",e==null?null:e.Code," "),r(2),s("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),F),r(2),s("ngxPermissionsOnly",w(10,Re,t.rolePriceEdit)),r(),s("ngForOf",t.channels())}}function st(n,c){if(n&1&&(o(0,"tbody"),E(1,ct,13,12,"tr",null,M),a()),n&2){let e=c.$implicit;r(),T(e.Variants)}}function mt(n,c){if(n&1&&(S(0),E(1,st,3,0,"tbody",null,M),v()),n&2){let e=c.ngIf;r(),T(e)}}var qt=(()=>{class n{constructor(e,i,t,l,d,_,Le){this.http=e,this.toastr=i,this.dialog=t,this.productService=l,this.authService=d,this.biggerPictureService=_,this.paginationService=Le,this.infinitePagination=Q(J),this.searchFilter=new we,this.checkboxState=!1,this.rolePriceEdit=ue.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=te([]),this.filterTypeOptions=[{Key:W.ALL,Value:"All"},{Key:W.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let e=this.searchFilter.ListChannelID,i=[];U.IsEmpty(e)||e?.length==0?i=this.channelOptions:i=this.channelOptions.filter(t=>e.findIndex(l=>l==t.ID)>-1),this.channels.update(()=>i)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(G(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(Y(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=W.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),G(1))}onSelectAllData(){this.data$=this.data$.pipe(q(e=>(e.map(i=>(i.Variants&&(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t))),i)),e)))}onFilter(e){this.searchFilter.text=e;let i=Z(X({},this.searchFilter),{text:e,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(_=>_.ID),d={ListChannelID:this.channelOptions.filter(_=>_.selected).map(_=>_.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:_=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:_=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,i){return e.Channel.find(t=>t.ChannelID==i)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(De,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(K(t=>U.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openTableDialog(e,i,t){let l=JSON.parse(JSON.stringify(e));this.dialog.open(Oe,{data:{Name:i.Name,Variant:l,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(K(_=>U.IsNotEmpty(_))).subscribe(_=>{this.updateProductPrice(_,t)})}updateProductPrice(e,i){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(l=>{i.Price=t.Price;let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${d.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Ee,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}static{this.\u0275fac=function(i){return new(i||n)(x(ge),x(he),x(Pe),x(Fe),x(xe),x(Me),x(Te))}}static{this.\u0275cmp=N({type:n,selectors:[["app-custom-channel-price"]],features:[ae([J])],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(i,t){i&1&&(o(0,"mainpanel",2),h("onSubmit",function(d){return t.onFilter(d)}),o(1,"filters"),u(2,Je,9,4,"ng-container",3),b(3,"async"),a(),o(4,"actions")(5,"div",4),u(6,Ze,3,1,"ng-container",3),b(7,"async"),o(8,"button",5),h("click",function(){return t.openExportDialog()}),P(9,"i",6),o(10,"span"),p(11,"Export"),a()()()(),o(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),P(20,"th",14),E(21,qe,6,6,"th",15,M),a(),o(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),a()(),o(27,"th",17),p(28,"Variant"),a(),o(29,"th",18),p(30,"SKU"),a(),u(31,Ye,2,1,"ng-template",19),E(32,Qe,7,0,null,null,M),a()(),u(34,mt,3,0,"ng-container",3),b(35,"async"),a(),o(36,"infinite-paginator",20),b(37,"async"),h("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),a()()()()()()()),i&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",y(3,13,t.loader$)),r(4),s("ngIf",y(7,15,t.data$)),r(15),T(t.channels()),r(10),s("ngxPermissionsOnly",w(21,Re,t.rolePriceEdit)),r(),T(t.channels()),r(2),s("ngIf",y(35,17,t.data$)),r(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",y(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[B,se,k,me,pe,de,Se,be,$,_e,R,L,Ne,Be,j,A,Ve,fe,Ce,ke],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]})}}return n})();export{qt as CustomChannelPriceComponent};
1
+ import{a as ke}from"./chunk-G35YVLFO.js";import{a as De}from"./chunk-OAS72QB2.js";import{a as W}from"./chunk-XHAXYWZ7.js";import{a as Oe,b as Ve,c as Ne,d as J}from"./chunk-UIM3W5B7.js";import{a as ue}from"./chunk-BVIRHZTZ.js";import{a as Te}from"./chunk-PPDHTO44.js";import{a as we}from"./chunk-7KG3DC5J.js";import{b as Ee}from"./chunk-3LQNSF7T.js";import"./chunk-YXFTLQ5M.js";import"./chunk-OLSC6KHB.js";import"./chunk-7TWBIV3T.js";import{a as Fe}from"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import{a as ve,b as Ie,c as ye}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import{a as Me}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as xe}from"./chunk-XDUYDX35.js";import{b as he,e as ge}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as Pe,m as be,n as Se}from"./chunk-ITTRZMEX.js";import{r as A,s as j}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as _e,h as R,m as L,y as $}from"./chunk-DPLEMBB4.js";import{c as U,e as Ce,f as fe}from"./chunk-PXB4YEY3.js";import{d as se,f as k,g as me,j as pe,m as de,n as B}from"./chunk-GPEVUTDI.js";import{$c as ce,Dc as z,Eb as N,Ec as p,Fc as re,G as K,Gc as f,Ic as D,Jc as O,Ka as ee,Kb as u,Kc as V,Oc as ae,Qa as te,Qc as w,Rc as le,Wb as s,Z as G,Zb as ne,Zc as b,_c as y,ad as H,bc as ie,cc as M,ea as Y,ec as E,fc as T,gc as o,hc as a,ic as P,jc as S,kc as v,mc as I,ob as F,pa as Q,qb as r,rc as h,sc as m,v as q,vc as oe,wb as x,ya as g,za as C}from"./chunk-T5ONJF63.js";import{a as X,b as Z}from"./chunk-K2H6WANG.js";var We=(n,c)=>({color:n,"font-weight":c});function Ke(n,c){if(n&1&&(o(0,"mat-radio-button",2),p(1),a()),n&2){let e=c.$implicit,i=c.index,t=m();ne(le(7,We,t.model==e.Key&&t.activeBold?"#0976b4":"",t.model==e.Key&&t.activeBold?"700":"")),s("disabled",t.exception==e.Value)("matTooltip",t.title.length>0?t.title[i]:"")("value",e.Key)("name",t.name),r(),f("",e.Value," ")}}var Be=(()=>{class n{constructor(){this.disabled=!1,this.modelChange=new ee,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(e){this.modelChange.emit(e)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=N({type:n,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(i,t){i&1&&(o(0,"mat-radio-group",0),h("ngModelChange",function(d){return t.change(d)}),u(1,Ke,2,10,"mat-radio-button",1),a()),i&2&&(s("disabled",t.disabled)("ngModel",t.model),r(),s("ngForOf",t.options))},dependencies:[B,k,ye,ve,Ie,$,R,L,j,A],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px}html[_ngcontent-%COMP%]{--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]})}}return n})();var Re=n=>[n],Ge=n=>({"text-decoration-line-through":n}),ze=n=>({"border-bottom":n}),He=n=>({"bg-gradient-warning":n});function Je(n,c){if(n&1){let e=I();S(0),o(1,"div")(2,"label",21),p(3,"Channel"),a(),o(4,"channel-select-options",22),V("ngModelChange",function(t){g(e);let l=m();return O(l.searchFilter.ListChannelID,t)||(l.searchFilter.ListChannelID=t),C(t)}),a()(),o(5,"div",23)(6,"label",24),p(7,"Filter by"),a(),o(8,"lib-radio-options",25),V("modelChange",function(t){g(e);let l=m();return O(l.searchFilter.filterModel,t)||(l.searchFilter.filterModel=t),C(t)}),a()(),v()}if(n&2){let e=m();r(4),s("multiple",!0),D("ngModel",e.searchFilter.ListChannelID),r(4),D("model",e.searchFilter.filterModel),s("options",e.filterTypeOptions)}}function Xe(n,c){if(n&1){let e=I();o(0,"button",27),h("click",function(){g(e);let t=m().ngIf,l=m();return C(l.onUpdateItems(t))}),P(1,"i",28),p(2," Update "),a()}}function Ze(n,c){if(n&1&&(S(0),o(1,"div",4),u(2,Xe,3,0,"button",26),a(),v()),n&2){let e=c.ngIf,i=m();r(2),s("ngIf",i.productService.hasSelectionVariant(e))}}function qe(n,c){if(n&1&&(o(0,"th",15)(1,"div",29),P(2,"img",30),o(3,"div",31),p(4),b(5,"stringLimit"),a()()()),n&2){let e=c.$implicit;r(),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,F),r(2),f(" ",ce(5,3,e.Name,20)," ")}}function Ye(n,c){if(n&1){let e=I();o(0,"th")(1,"input",32),V("ngModelChange",function(t){g(e);let l=m();return O(l.checkboxState,t)||(l.checkboxState=t),C(t)}),h("ngModelChange",function(){g(e);let t=m();return C(t.onSelectAllData())}),a()()}if(n&2){let e=m();r(),D("ngModel",e.checkboxState)}}function Qe(n,c){n&1&&(o(0,"th",33)(1,"span"),p(2,"Expected"),a(),o(3,"span",34),p(4,"(POS)"),a()(),o(5,"th",33),p(6,"Channel"),a())}function et(n,c){if(n&1){let e=I();o(0,"img",47),h("click",function(t){g(e);let l=m(3).$implicit,d=m(2);return C(d.onZoomImage(t,l==null?null:l.ImageUrl))}),a()}if(n&2){let e=m(3).$implicit;oe("src",e==null?null:e.ImageUrl,F)}}function tt(n,c){n&1&&P(0,"img",48)}function nt(n,c){if(n&1&&(o(0,"small",46),p(1),a()),n&2){let e=m(3).$implicit;r(),f("(",e==null?null:e.Category,")")}}function it(n,c){if(n&1&&(S(0),o(1,"td",42),u(2,et,1,1,"img",43)(3,tt,1,0,"ng-template",null,0,H),a(),o(5,"td",44)(6,"h5",45),p(7),a(),u(8,nt,2,1,"small",46),a(),v()),n&2){let e=z(4),i=m().$index,t=m().$implicit,l=m().ngIf;r(),s("rowSpan",t==null?null:t.Variants.length)("ngClass",w(7,ze,i+1==l.length)),r(),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",e),r(3),s("rowSpan",t==null?null:t.Variants.length),r(2),re(t==null?null:t.Name),r(),ie(t!=null&&t.Category?8:-1)}}function ot(n,c){if(n&1){let e=I();o(0,"td",49)(1,"input",32),V("ngModelChange",function(t){g(e);let l=m().$implicit;return O(l.selected,t)||(l.selected=t),C(t)}),a()()}if(n&2){let e=m().$implicit;r(),D("ngModel",e.selected)}}function rt(n,c){if(n&1){let e=I();S(0),o(1,"td",51),p(2),b(3,"number"),a(),o(4,"td",52),h("click",function(){let t=g(e).$implicit,l=m(2).$implicit,d=m().$implicit,_=m(2);return C(_.openTableDialog(l,d,t))}),o(5,"div",53)(6,"div",54),p(7),b(8,"number"),a(),o(9,"a",55),h("click",function(t){return g(e),C(t==null?null:t.stopPropagation())}),P(10,"i",40),a()()(),v()}if(n&2){let e=c.$implicit;r(2),f(" ",y(3,4,e.PriceExpected)," "),r(2),s("ngClass",w(8,He,e.Price!=e.PriceExpected)),r(3),f(" ",y(8,6,e.Price)," "),r(2),s("href",e.Url,F)}}function at(n,c){n&1&&(o(0,"td",56),p(1," X "),a(),o(2,"td",56),p(3," X "),a())}function lt(n,c){if(n&1&&(S(0),u(1,rt,11,10,"ng-container",50)(2,at,4,0,"ng-template",null,1,H),v()),n&2){let e=c.$implicit,i=z(3),t=m().$implicit,l=m(3);r(),s("ngIf",l.getItemFromChannel(t,e.ID))("ngIfElse",i)}}function ct(n,c){if(n&1&&(o(0,"tr"),u(1,it,9,9,"ng-container",3),o(2,"td",35),p(3),a(),o(4,"td",36)(5,"div",37)(6,"div",38),p(7),a(),o(8,"div",31)(9,"a",39),P(10,"i",40),a()()()(),u(11,ot,2,1,"ng-template",19)(12,lt,4,2,"ng-container",41),a()),n&2){let e=c.$implicit,i=c.$index,t=m(3);r(),s("ngIf",i==0),r(2),f(" ",e==null?null:e.Model," "),r(),s("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),r(2),s("ngClass",w(8,Ge,e.Discontinued)),r(),f(" ",e==null?null:e.Code," "),r(2),s("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),F),r(2),s("ngxPermissionsOnly",w(10,Re,t.rolePriceEdit)),r(),s("ngForOf",t.channels())}}function st(n,c){if(n&1&&(o(0,"tbody"),E(1,ct,13,12,"tr",null,M),a()),n&2){let e=c.$implicit;r(),T(e.Variants)}}function mt(n,c){if(n&1&&(S(0),E(1,st,3,0,"tbody",null,M),v()),n&2){let e=c.ngIf;r(),T(e)}}var qt=(()=>{class n{constructor(e,i,t,l,d,_,Le){this.http=e,this.toastr=i,this.dialog=t,this.productService=l,this.authService=d,this.biggerPictureService=_,this.paginationService=Le,this.infinitePagination=Q(J),this.searchFilter=new we,this.checkboxState=!1,this.rolePriceEdit=ue.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=te([]),this.filterTypeOptions=[{Key:W.ALL,Value:"All"},{Key:W.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let e=this.searchFilter.ListChannelID,i=[];U.IsEmpty(e)||e?.length==0?i=this.channelOptions:i=this.channelOptions.filter(t=>e.findIndex(l=>l==t.ID)>-1),this.channels.update(()=>i)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(G(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(Y(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=W.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),G(1))}onSelectAllData(){this.data$=this.data$.pipe(q(e=>(e.map(i=>(i.Variants&&(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t))),i)),e)))}onFilter(e){this.searchFilter.text=e;let i=Z(X({},this.searchFilter),{text:e,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(_=>_.ID),d={ListChannelID:this.channelOptions.filter(_=>_.selected).map(_=>_.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:_=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:_=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,i){return e.Channel.find(t=>t.ChannelID==i)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(De,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(K(t=>U.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openTableDialog(e,i,t){let l=JSON.parse(JSON.stringify(e));this.dialog.open(Oe,{data:{Name:i.Name,Variant:l,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(K(_=>U.IsNotEmpty(_))).subscribe(_=>{this.updateProductPrice(_,t)})}updateProductPrice(e,i){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(l=>{i.Price=t.Price;let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${d.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Ee,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}static{this.\u0275fac=function(i){return new(i||n)(x(ge),x(he),x(Pe),x(Fe),x(xe),x(Me),x(Te))}}static{this.\u0275cmp=N({type:n,selectors:[["app-custom-channel-price"]],features:[ae([J])],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(i,t){i&1&&(o(0,"mainpanel",2),h("onSubmit",function(d){return t.onFilter(d)}),o(1,"filters"),u(2,Je,9,4,"ng-container",3),b(3,"async"),a(),o(4,"actions")(5,"div",4),u(6,Ze,3,1,"ng-container",3),b(7,"async"),o(8,"button",5),h("click",function(){return t.openExportDialog()}),P(9,"i",6),o(10,"span"),p(11,"Export"),a()()()(),o(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),P(20,"th",14),E(21,qe,6,6,"th",15,M),a(),o(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),a()(),o(27,"th",17),p(28,"Variant"),a(),o(29,"th",18),p(30,"SKU"),a(),u(31,Ye,2,1,"ng-template",19),E(32,Qe,7,0,null,null,M),a()(),u(34,mt,3,0,"ng-container",3),b(35,"async"),a(),o(36,"infinite-paginator",20),b(37,"async"),h("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),a()()()()()()()),i&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",y(3,13,t.loader$)),r(4),s("ngIf",y(7,15,t.data$)),r(15),T(t.channels()),r(10),s("ngxPermissionsOnly",w(21,Re,t.rolePriceEdit)),r(),T(t.channels()),r(2),s("ngIf",y(35,17,t.data$)),r(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",y(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[B,se,k,me,pe,de,Se,be,$,_e,R,L,Ne,Be,j,A,Ve,fe,Ce,ke],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]})}}return n})();export{qt as CustomChannelPriceComponent};
@@ -1 +1 @@
1
- import{a as C}from"./chunk-7477X7LJ.js";import{a as h,b as y}from"./chunk-OE2JYQHN.js";import{a as r}from"./chunk-F7NU25EB.js";import"./chunk-3PJZW7HF.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import"./chunk-PXB4YEY3.js";import{F as v,J as o,n}from"./chunk-GPEVUTDI.js";import{Eb as l,Fb as s,Oc as f,Wb as u,gc as c,hc as d,ic as i,ka as m,qb as p}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var M=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"},{Title:"Different Inventory",Url:"/menu/inventory/channel_summary"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-inventory"]],features:[f([C])],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,b){t&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),d()()(),i(4,"router-outlet")),t&2&&(p(3),u("Tabs",b.inventoryTabs))},dependencies:[n,y,h,o,v],encapsulation:2})}}return e})();var g=[{path:"",component:M,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-JIBVE3DE.js").then(e=>e.MultiChannelComparison)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-HLBD2ZRF.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-UPZ35RUO.js").then(e=>e.ChannelSummaryComponent)},canActivate:[r],data:{title:"Different Inventory"}}]}],E=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=s({type:e})}static{this.\u0275inj=m({imports:[n,o.forChild(g)]})}}return e})();export{E as InventoryRoutingModule};
1
+ import{a as C}from"./chunk-7477X7LJ.js";import{a as h,b as y}from"./chunk-OE2JYQHN.js";import{a as r}from"./chunk-7AVVOGZA.js";import"./chunk-XDUYDX35.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import"./chunk-PXB4YEY3.js";import{F as v,J as o,n}from"./chunk-GPEVUTDI.js";import{Eb as l,Fb as s,Oc as f,Wb as u,gc as c,hc as d,ic as i,ka as m,qb as p}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var M=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"},{Title:"Different Inventory",Url:"/menu/inventory/channel_summary"}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=l({type:e,selectors:[["app-inventory"]],features:[f([C])],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,b){t&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),d()()(),i(4,"router-outlet")),t&2&&(p(3),u("Tabs",b.inventoryTabs))},dependencies:[n,y,h,o,v],encapsulation:2})}}return e})();var g=[{path:"",component:M,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-GZIXVRJT.js").then(e=>e.MultiChannelComparison)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-4RXCRDWF.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-EOPCFNMW.js").then(e=>e.ChannelSummaryComponent)},canActivate:[r],data:{title:"Different Inventory"}}]}],E=(()=>{class e{static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275mod=s({type:e})}static{this.\u0275inj=m({imports:[n,o.forChild(g)]})}}return e})();export{E as InventoryRoutingModule};
@@ -1,2 +1,2 @@
1
- import{a as ke}from"./chunk-H55YXRO5.js";import"./chunk-7477X7LJ.js";import{a as N}from"./chunk-G6T2QL55.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Me,b as Pe,c as De,d as G}from"./chunk-UIM3W5B7.js";import"./chunk-BVIRHZTZ.js";import{a as ye,b as Ie,c as we}from"./chunk-RGR34QZ3.js";import{b as Ve}from"./chunk-3LQNSF7T.js";import{a as Te,b as Ee}from"./chunk-YXFTLQ5M.js";import"./chunk-PXU3DWYL.js";import"./chunk-AL3REAHH.js";import"./chunk-UDOCTVWA.js";import"./chunk-GBD4FIF3.js";import"./chunk-7TWBIV3T.js";import{a as be}from"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import{a as Fe}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{e as he}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as ue}from"./chunk-3PJZW7HF.js";import{b as me,e as _e}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as xe,l as fe,m as Se,n as ve}from"./chunk-ITTRZMEX.js";import{r as Ce,s as ge}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as ae,c as le,h as re,m as se,o as ce,y as pe}from"./chunk-DPLEMBB4.js";import{c as f,f as de}from"./chunk-PXB4YEY3.js";import{d as J,g as ee,j as te,k as ne,m as ie,n as oe}from"./chunk-GPEVUTDI.js";import{$c as R,Dc as Q,Eb as Z,Ec as c,Fc as D,G as Y,Gc as E,Ic as b,Jc as F,Kb as h,Kc as T,Oc as X,Qa as W,Qc as k,Wb as d,Z as B,Zc as g,_c as v,ad as z,bc as y,cc as O,ea as $,ec as U,fc as j,gc as a,hc as r,ic as x,jc as M,kc as P,mc as S,ob as V,pa as K,qb as s,rc as C,sc as l,v as A,vc as q,wb as w,ya as m,za as _}from"./chunk-T5ONJF63.js";import{a as L}from"./chunk-K2H6WANG.js";var Le=i=>({"text-decoration-line-through":i}),Ae=i=>({"ms-10":i}),Be=i=>({"bg-gradient-warning":i});function $e(i,p){if(i&1){let e=S();a(0,"button",38),C("click",function(){m(e);let t=l().ngIf,n=l(2);return _(n.onScanInventory(t))}),x(1,"i",39),c(2,"Refresh "),r()}}function We(i,p){if(i&1){let e=S();a(0,"div",36)(1,"button",40),C("click",function(){m(e);let t=l().ngIf,n=l(2);return _(n.updateStock(t))}),x(2,"i",41),c(3," Update "),r(),x(4,"button",42),a(5,"ul",43)(6,"a",44),C("click",function(){m(e);let t=l(3);return _(t.openExportDialog())}),x(7,"i",45),a(8,"span"),c(9,"Export"),r()()()()}}function Oe(i,p){if(i&1){let e=S();a(0,"button",46),C("click",function(){m(e);let t=l(3);return _(t.openExportDialog())}),x(1,"i",45),a(2,"span"),c(3,"Export"),r()()}}function Ue(i,p){if(i&1&&(a(0,"div"),h(1,$e,3,0,"button",35)(2,We,10,0,"div",36)(3,Oe,4,0,"button",37),r()),i&2){let e=p.ngIf,o=l(2);s(),d("ngIf",o.productService.hasSelectionVariant(e)),s(),y(o.productService.hasSelectionVariant(e)?2:3)}}function je(i,p){i&1&&(a(0,"div",47)(1,"span"),c(2," showing only different stock, please press next to populate more data "),r()())}function Qe(i,p){if(i&1){let e=S();a(0,"th")(1,"input",48),T("ngModelChange",function(t){m(e);let n=l(2);return F(n.checkboxState,t)||(n.checkboxState=t),_(t)}),C("ngModelChange",function(){let t=m(e).ngIf,n=l(2);return _(n.onCheckboxStateChange(t))}),r()()}if(i&2){let e=l(2);s(),b("ngModel",e.checkboxState)}}function ze(i,p){i&1&&(a(0,"th",32),c(1," Reserved "),r())}function Ge(i,p){if(i&1){let e=S();a(0,"input",66),T("ngModelChange",function(t){m(e);let n=l(3).$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),C("ngModelChange",function(){m(e);let t=l(3).$implicit,n=l(2);return _(n.onCheckboxStateProduct(t))}),r()}if(i&2){let e=l(3).$implicit;b("ngModel",e.selected)}}function He(i,p){if(i&1){let e=S();a(0,"img",67),C("click",function(t){m(e);let n=l(3).$implicit,u=l(2);return _(u.onZoomImage(t,n==null?null:n.ImageUrl))}),r()}if(i&2){let e=l(3).$implicit;q("src",e==null?null:e.ThumbnailUrl,V)}}function Ye(i,p){i&1&&x(0,"img",63)}function Ke(i,p){if(i&1&&(x(0,"br"),a(1,"div",68),x(2,"i",69),a(3,"small"),c(4),r()()),i&2){let e=l(3).$implicit;s(4),E("(",e==null?null:e.Category,")")}}function Ze(i,p){if(i&1&&(a(0,"td",59)(1,"div",14),h(2,Ge,1,1,"input",60),a(3,"div",61),h(4,He,1,1,"img",62)(5,Ye,1,0,"img",63),r()()(),a(6,"td",64)(7,"span",65),c(8),r(),h(9,Ke,5,1),r()),i&2){let e=l(2).$implicit,o=l(2);d("rowSpan",e==null?null:e.Variants.length),s(2),y(e.Variants.length>1?2:-1),s(),d("ngClass",k(7,Ae,e.Variants.length<=1)),s(),y(e!=null&&e.ThumbnailUrl?4:5),s(2),d("rowSpan",e==null?null:e.Variants.length),s(2),D(e==null?null:e.Name),s(),y(e.CategoryID!==null&&e.CategoryID!=o.guidEmpty?9:-1)}}function qe(i,p){if(i&1){let e=S();a(0,"input",48),T("ngModelChange",function(t){m(e);let n=l(2).$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),r()}if(i&2){let e=l(2).$implicit;b("ngModel",e.selected)}}function Xe(i,p){if(i&1&&h(0,qe,1,1,"input",53),i&2){let e=l().$implicit;y((e==null?null:e.Inventory)<=1e5?0:-1)}}function Je(i,p){if(i&1){let e=S();a(0,"input",48),T("ngModelChange",function(t){m(e);let n=l().$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),r()}if(i&2){let e=l().$implicit;b("ngModel",e.selected)}}function et(i,p){i&1&&(a(0,"div",70),c(1," Not Found "),r())}function tt(i,p){if(i&1&&(a(0,"div")(1,"span",71),c(2),g(3,"number"),r(),c(4," => "),a(5,"span",72),c(6),g(7,"number"),r()()),i&2){let e=l().$implicit;s(2),E(" ",v(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),D(v(7,4,e==null?null:e.Inventory))}}function nt(i,p){if(i&1&&(c(0),g(1,"number")),i&2){let e=l().$implicit;E(" ",v(1,1,e==null?null:e.Inventory)," ")}}function it(i,p){if(i&1&&(M(0),a(1,"div",73)(2,"a",74),x(3,"i",75),r()(),P()),i&2){let e=l().$implicit,o=l(3);s(2),d("href",o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),V)}}function ot(i,p){if(i&1){let e=S();a(0,"span",80),C("click",function(){let t=m(e).ngIf,n=l(2).$implicit,u=l().$implicit,I=l(2);return _(I.openTableDialog(u,n,t))}),c(1),g(2,"number"),r()}if(i&2){let e=l(2).$implicit;s(),E(" ",v(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function at(i,p){if(i&1){let e=S();a(0,"td",76)(1,"div",54)(2,"div"),h(3,ot,3,3,"span",77),g(4,"async"),r(),a(5,"div",73)(6,"a",74),x(7,"i",75),r()(),a(8,"div",73)(9,"span",78),C("click",function(){m(e);let t=l().$implicit,n=l(3);return _(n.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))}),x(10,"i",79),r()()()()}if(i&2){let e=l().$implicit,o=l(3);d("ngClass",k(5,Be,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),d("ngIf",v(4,3,o.products$)),s(3),d("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,V)}}function lt(i,p){if(i&1&&(M(0),a(1,"span",81),c(2),g(3,"number"),r(),P()),i&2){let e=l(2).$implicit;s(2),E(" (",v(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function rt(i,p){i&1&&c(0," - ")}function st(i,p){if(i&1&&(M(0),a(1,"td",50),h(2,lt,4,3,"ng-container",58)(3,rt,1,0,"ng-template",null,1,z),r(),P()),i&2){let e=Q(4),o=l().$implicit;s(2),d("ngIf",o==null||o.Channel[0]==null?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function ct(i,p){i&1&&(M(0),c(1," - "),P())}function pt(i,p){if(i&1&&(a(0,"span",82),g(1,"date"),c(2),g(3,"date"),r()),i&2){let e=l().$implicit;d("matTooltip",R(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),E(" ",R(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function mt(i,p){if(i&1&&(a(0,"tr"),h(1,Ze,10,9),a(2,"td",49),c(3),r(),a(4,"td",50)(5,"span",51),c(6),r()(),a(7,"td",52),h(8,Xe,1,1)(9,Je,1,1,"input",53),r(),a(10,"td")(11,"div",54),h(12,et,2,0,"div",55)(13,tt,8,6,"div")(14,nt,2,3)(15,it,4,1,"ng-container",5),r()(),h(16,at,11,7,"td",56)(17,st,5,2,"ng-container",5),a(18,"td",57),h(19,ct,2,0,"ng-container",58)(20,pt,4,8,"ng-template",null,0,z),r()()),i&2){let e=p.$implicit,o=p.$index,t=Q(21),n=l(3);s(),y(o==0?1:-1),s(2),D(e==null?null:e.Model),s(2),d("matTooltip",e.Discontinued?n.discontinuedVariantMsg:"")("ngClass",k(14,Le,e.Discontinued)),s(),D(e==null?null:e.Code),s(2),y((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),d("ngIf",(e==null?null:e.I)==null),s(),y((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),y((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),d("ngIf",(e==null?null:e.I)!=null),s(),d("ngIf",e==null?null:e.Channel),s(),d("ngIf",n.isShowReservedColumn),s(2),d("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==n.minDate)("ngIfElse",t)}}function _t(i,p){if(i&1&&(a(0,"tbody"),U(1,mt,22,16,"tr",null,O),r()),i&2){let e=p.$implicit;s(),j(e.Variants)}}function dt(i,p){if(i&1){let e=S();a(0,"mainpanel",3),C("onSubmit",function(t){m(e);let n=l();return _(n.onSearch(t))}),a(1,"actions")(2,"div",4),h(3,Ue,4,2,"div",5),g(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),C("onChannelChange",function(t){m(e);let n=l();return _(n.onChannelChange(t))}),r()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),r(),a(13,"input",10),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),_(t)}),r()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),r(),a(17,"input",12),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),_(t)}),r()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.QuantityFrom,t)||(n.searchFilter.QuantityFrom=t),_(t)}),r(),c(23," - "),a(24,"input",16),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.QuantityTo,t)||(n.searchFilter.QuantityTo=t),_(t)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),h(29,je,3,0,"div",20),a(30,"table",21),C("matSortChange",function(t){m(e);let n=l();return _(n.onSortVariant(t))}),a(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),x(35,"br"),a(36,"mat-slide-toggle",24),C("toggleChange",function(){m(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,_(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(),h(43,Qe,2,1,"th",5),g(44,"async"),a(45,"th",27),c(46," POS "),r(),a(47,"th",28)(48,"div",29),C("click",function(){m(e);let t=l();return _(t.openModalFilter())}),x(49,"img",30),a(50,"span",31),c(51),g(52,"stringLimit"),r()()(),h(53,ze,2,0,"th",32),a(54,"th",33),c(55,"Last Sync"),r()()(),U(56,_t,3,0,"tbody",null,O),g(58,"async"),r(),a(59,"infinite-paginator",34),g(60,"async"),C("onNextPage",function(){m(e);let t=l();return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){m(e);let t=l();return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){m(e);let t=l();return _(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(i&2){let e,o,t,n=l();d("headerTitle","Inventory Comparison")("pageData",n.pageData)("hideSearchBox",!1),s(3),d("ngIf",v(4,21,n.products$)),s(6),d("ngModel",(n.searchFilter==null?null:n.searchFilter.LocationID)||(n.searchFilter==null?null:n.searchFilter.ChannelID)),s(4),b("ngModel",n.searchFilter.PageNumber),s(4),b("ngModel",n.searchFilter.RowCount),s(5),b("ngModel",n.searchFilter.QuantityFrom),s(2),b("ngModel",n.searchFilter.QuantityTo),s(5),d("ngIf",(n.searchFilter==null?null:n.searchFilter.filterModel)==3),s(14),d("ngIf",v(44,23,n.products$)),s(5),d("matTooltip",((e=n.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=n.channelIdentity())==null?null:e.label:""),s(),d("src",(o=n.channelIdentity())==null?null:o.img,V),s(2),E(" ",R(52,25,(t=n.channelIdentity())==null?null:t.label,13)," "),s(2),y(n.isShowReservedColumn?53:-1),s(3),j(v(58,28,n.products$)),s(3),d("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",v(60,30,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}var Zt=(()=>{class i{constructor(e,o,t,n,u,I,Re,Ne){this.http=e,this.toastr=o,this.dialog=t,this.productService=n,this.authService=u,this.biggerPictureService=I,this.inventoryService=Re,this.mainPanelService=Ne,this.infinitePagination=K(G),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=f.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=f.GuidEMpty,this.selectedChannel=W(null),this.channelIdentity=W({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.sourceObs$=this.infinitePagination.data$.pipe($(e=>{this.checkShowReservedColumn(e)}),A(e=>(e=this.calculateAvailableStock(e),e)),B(1)),this.products$=this.sourceObs$}calculateAvailableStock(e){return e.map(t=>(t.totalAvailable=t.Variants.reduce((n,u)=>(n+=u.I?.Available||0,n),0),t))}checkShowReservedColumn(e){let o=0,t;e.forEach(n=>{t=n.Variants.find(u=>f.IsNotEmpty(u?.Channel[0]?.InventoryReserved)),t&&(o+=1)}),this.isShowReservedColumn=o>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(B(1),$(e=>{this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID,LocationID:e.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!e.Filter.IsMarketplaceAppActive)}))}onChannelChange(e){let o=Object.assign({},e);this.selectedChannel.set(o),f.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let e=Object.assign({},this.selectedChannel());f.IsNotEmpty(e.parent)?(this.searchFilter.LocationID=e.id,this.searchFilter.ChannelID=e?.parent?.id,e.label=e?.parent?.label+" - "+e?.label,e.img=f.getChannelLogoByTypeId(e?.parent?.typeid)):(this.searchFilter.LocationID=null,e.img=f.getChannelLogoByTypeId(e?.typeid),this.searchFilter.ChannelID=e?.id,this.selectedChannel.set(e)),this.channelIdentity.update(()=>({img:e.img,label:e.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(e){e&&this.toastr.warning(`Automatic inventory sync disabled.
1
+ import{a as ke}from"./chunk-H55YXRO5.js";import"./chunk-7477X7LJ.js";import{a as N}from"./chunk-QRJDRFNS.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Me,b as Pe,c as De,d as G}from"./chunk-UIM3W5B7.js";import"./chunk-BVIRHZTZ.js";import{a as ye,b as Ie,c as we}from"./chunk-RGR34QZ3.js";import{b as Ve}from"./chunk-3LQNSF7T.js";import{a as Te,b as Ee}from"./chunk-YXFTLQ5M.js";import"./chunk-PXU3DWYL.js";import"./chunk-AL3REAHH.js";import"./chunk-UDOCTVWA.js";import"./chunk-GBD4FIF3.js";import"./chunk-7TWBIV3T.js";import{a as be}from"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import{a as Fe}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{e as he}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as ue}from"./chunk-XDUYDX35.js";import{b as me,e as _e}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as xe,l as fe,m as Se,n as ve}from"./chunk-ITTRZMEX.js";import{r as Ce,s as ge}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as ae,c as le,h as re,m as se,o as ce,y as pe}from"./chunk-DPLEMBB4.js";import{c as f,f as de}from"./chunk-PXB4YEY3.js";import{d as J,g as ee,j as te,k as ne,m as ie,n as oe}from"./chunk-GPEVUTDI.js";import{$c as R,Dc as Q,Eb as Z,Ec as c,Fc as D,G as Y,Gc as E,Ic as b,Jc as F,Kb as h,Kc as T,Oc as X,Qa as W,Qc as k,Wb as d,Z as B,Zc as g,_c as v,ad as z,bc as y,cc as O,ea as $,ec as U,fc as j,gc as a,hc as r,ic as x,jc as M,kc as P,mc as S,ob as V,pa as K,qb as s,rc as C,sc as l,v as A,vc as q,wb as w,ya as m,za as _}from"./chunk-T5ONJF63.js";import{a as L}from"./chunk-K2H6WANG.js";var Le=i=>({"text-decoration-line-through":i}),Ae=i=>({"ms-10":i}),Be=i=>({"bg-gradient-warning":i});function $e(i,p){if(i&1){let e=S();a(0,"button",38),C("click",function(){m(e);let t=l().ngIf,n=l(2);return _(n.onScanInventory(t))}),x(1,"i",39),c(2,"Refresh "),r()}}function We(i,p){if(i&1){let e=S();a(0,"div",36)(1,"button",40),C("click",function(){m(e);let t=l().ngIf,n=l(2);return _(n.updateStock(t))}),x(2,"i",41),c(3," Update "),r(),x(4,"button",42),a(5,"ul",43)(6,"a",44),C("click",function(){m(e);let t=l(3);return _(t.openExportDialog())}),x(7,"i",45),a(8,"span"),c(9,"Export"),r()()()()}}function Oe(i,p){if(i&1){let e=S();a(0,"button",46),C("click",function(){m(e);let t=l(3);return _(t.openExportDialog())}),x(1,"i",45),a(2,"span"),c(3,"Export"),r()()}}function Ue(i,p){if(i&1&&(a(0,"div"),h(1,$e,3,0,"button",35)(2,We,10,0,"div",36)(3,Oe,4,0,"button",37),r()),i&2){let e=p.ngIf,o=l(2);s(),d("ngIf",o.productService.hasSelectionVariant(e)),s(),y(o.productService.hasSelectionVariant(e)?2:3)}}function je(i,p){i&1&&(a(0,"div",47)(1,"span"),c(2," showing only different stock, please press next to populate more data "),r()())}function Qe(i,p){if(i&1){let e=S();a(0,"th")(1,"input",48),T("ngModelChange",function(t){m(e);let n=l(2);return F(n.checkboxState,t)||(n.checkboxState=t),_(t)}),C("ngModelChange",function(){let t=m(e).ngIf,n=l(2);return _(n.onCheckboxStateChange(t))}),r()()}if(i&2){let e=l(2);s(),b("ngModel",e.checkboxState)}}function ze(i,p){i&1&&(a(0,"th",32),c(1," Reserved "),r())}function Ge(i,p){if(i&1){let e=S();a(0,"input",66),T("ngModelChange",function(t){m(e);let n=l(3).$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),C("ngModelChange",function(){m(e);let t=l(3).$implicit,n=l(2);return _(n.onCheckboxStateProduct(t))}),r()}if(i&2){let e=l(3).$implicit;b("ngModel",e.selected)}}function He(i,p){if(i&1){let e=S();a(0,"img",67),C("click",function(t){m(e);let n=l(3).$implicit,u=l(2);return _(u.onZoomImage(t,n==null?null:n.ImageUrl))}),r()}if(i&2){let e=l(3).$implicit;q("src",e==null?null:e.ThumbnailUrl,V)}}function Ye(i,p){i&1&&x(0,"img",63)}function Ke(i,p){if(i&1&&(x(0,"br"),a(1,"div",68),x(2,"i",69),a(3,"small"),c(4),r()()),i&2){let e=l(3).$implicit;s(4),E("(",e==null?null:e.Category,")")}}function Ze(i,p){if(i&1&&(a(0,"td",59)(1,"div",14),h(2,Ge,1,1,"input",60),a(3,"div",61),h(4,He,1,1,"img",62)(5,Ye,1,0,"img",63),r()()(),a(6,"td",64)(7,"span",65),c(8),r(),h(9,Ke,5,1),r()),i&2){let e=l(2).$implicit,o=l(2);d("rowSpan",e==null?null:e.Variants.length),s(2),y(e.Variants.length>1?2:-1),s(),d("ngClass",k(7,Ae,e.Variants.length<=1)),s(),y(e!=null&&e.ThumbnailUrl?4:5),s(2),d("rowSpan",e==null?null:e.Variants.length),s(2),D(e==null?null:e.Name),s(),y(e.CategoryID!==null&&e.CategoryID!=o.guidEmpty?9:-1)}}function qe(i,p){if(i&1){let e=S();a(0,"input",48),T("ngModelChange",function(t){m(e);let n=l(2).$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),r()}if(i&2){let e=l(2).$implicit;b("ngModel",e.selected)}}function Xe(i,p){if(i&1&&h(0,qe,1,1,"input",53),i&2){let e=l().$implicit;y((e==null?null:e.Inventory)<=1e5?0:-1)}}function Je(i,p){if(i&1){let e=S();a(0,"input",48),T("ngModelChange",function(t){m(e);let n=l().$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),r()}if(i&2){let e=l().$implicit;b("ngModel",e.selected)}}function et(i,p){i&1&&(a(0,"div",70),c(1," Not Found "),r())}function tt(i,p){if(i&1&&(a(0,"div")(1,"span",71),c(2),g(3,"number"),r(),c(4," => "),a(5,"span",72),c(6),g(7,"number"),r()()),i&2){let e=l().$implicit;s(2),E(" ",v(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),D(v(7,4,e==null?null:e.Inventory))}}function nt(i,p){if(i&1&&(c(0),g(1,"number")),i&2){let e=l().$implicit;E(" ",v(1,1,e==null?null:e.Inventory)," ")}}function it(i,p){if(i&1&&(M(0),a(1,"div",73)(2,"a",74),x(3,"i",75),r()(),P()),i&2){let e=l().$implicit,o=l(3);s(2),d("href",o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),V)}}function ot(i,p){if(i&1){let e=S();a(0,"span",80),C("click",function(){let t=m(e).ngIf,n=l(2).$implicit,u=l().$implicit,I=l(2);return _(I.openTableDialog(u,n,t))}),c(1),g(2,"number"),r()}if(i&2){let e=l(2).$implicit;s(),E(" ",v(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function at(i,p){if(i&1){let e=S();a(0,"td",76)(1,"div",54)(2,"div"),h(3,ot,3,3,"span",77),g(4,"async"),r(),a(5,"div",73)(6,"a",74),x(7,"i",75),r()(),a(8,"div",73)(9,"span",78),C("click",function(){m(e);let t=l().$implicit,n=l(3);return _(n.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))}),x(10,"i",79),r()()()()}if(i&2){let e=l().$implicit,o=l(3);d("ngClass",k(5,Be,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),d("ngIf",v(4,3,o.products$)),s(3),d("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,V)}}function lt(i,p){if(i&1&&(M(0),a(1,"span",81),c(2),g(3,"number"),r(),P()),i&2){let e=l(2).$implicit;s(2),E(" (",v(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function rt(i,p){i&1&&c(0," - ")}function st(i,p){if(i&1&&(M(0),a(1,"td",50),h(2,lt,4,3,"ng-container",58)(3,rt,1,0,"ng-template",null,1,z),r(),P()),i&2){let e=Q(4),o=l().$implicit;s(2),d("ngIf",o==null||o.Channel[0]==null?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function ct(i,p){i&1&&(M(0),c(1," - "),P())}function pt(i,p){if(i&1&&(a(0,"span",82),g(1,"date"),c(2),g(3,"date"),r()),i&2){let e=l().$implicit;d("matTooltip",R(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),E(" ",R(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function mt(i,p){if(i&1&&(a(0,"tr"),h(1,Ze,10,9),a(2,"td",49),c(3),r(),a(4,"td",50)(5,"span",51),c(6),r()(),a(7,"td",52),h(8,Xe,1,1)(9,Je,1,1,"input",53),r(),a(10,"td")(11,"div",54),h(12,et,2,0,"div",55)(13,tt,8,6,"div")(14,nt,2,3)(15,it,4,1,"ng-container",5),r()(),h(16,at,11,7,"td",56)(17,st,5,2,"ng-container",5),a(18,"td",57),h(19,ct,2,0,"ng-container",58)(20,pt,4,8,"ng-template",null,0,z),r()()),i&2){let e=p.$implicit,o=p.$index,t=Q(21),n=l(3);s(),y(o==0?1:-1),s(2),D(e==null?null:e.Model),s(2),d("matTooltip",e.Discontinued?n.discontinuedVariantMsg:"")("ngClass",k(14,Le,e.Discontinued)),s(),D(e==null?null:e.Code),s(2),y((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),d("ngIf",(e==null?null:e.I)==null),s(),y((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),y((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),d("ngIf",(e==null?null:e.I)!=null),s(),d("ngIf",e==null?null:e.Channel),s(),d("ngIf",n.isShowReservedColumn),s(2),d("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==n.minDate)("ngIfElse",t)}}function _t(i,p){if(i&1&&(a(0,"tbody"),U(1,mt,22,16,"tr",null,O),r()),i&2){let e=p.$implicit;s(),j(e.Variants)}}function dt(i,p){if(i&1){let e=S();a(0,"mainpanel",3),C("onSubmit",function(t){m(e);let n=l();return _(n.onSearch(t))}),a(1,"actions")(2,"div",4),h(3,Ue,4,2,"div",5),g(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),C("onChannelChange",function(t){m(e);let n=l();return _(n.onChannelChange(t))}),r()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),r(),a(13,"input",10),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),_(t)}),r()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),r(),a(17,"input",12),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),_(t)}),r()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.QuantityFrom,t)||(n.searchFilter.QuantityFrom=t),_(t)}),r(),c(23," - "),a(24,"input",16),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.QuantityTo,t)||(n.searchFilter.QuantityTo=t),_(t)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),h(29,je,3,0,"div",20),a(30,"table",21),C("matSortChange",function(t){m(e);let n=l();return _(n.onSortVariant(t))}),a(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),x(35,"br"),a(36,"mat-slide-toggle",24),C("toggleChange",function(){m(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,_(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(),h(43,Qe,2,1,"th",5),g(44,"async"),a(45,"th",27),c(46," POS "),r(),a(47,"th",28)(48,"div",29),C("click",function(){m(e);let t=l();return _(t.openModalFilter())}),x(49,"img",30),a(50,"span",31),c(51),g(52,"stringLimit"),r()()(),h(53,ze,2,0,"th",32),a(54,"th",33),c(55,"Last Sync"),r()()(),U(56,_t,3,0,"tbody",null,O),g(58,"async"),r(),a(59,"infinite-paginator",34),g(60,"async"),C("onNextPage",function(){m(e);let t=l();return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){m(e);let t=l();return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){m(e);let t=l();return _(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(i&2){let e,o,t,n=l();d("headerTitle","Inventory Comparison")("pageData",n.pageData)("hideSearchBox",!1),s(3),d("ngIf",v(4,21,n.products$)),s(6),d("ngModel",(n.searchFilter==null?null:n.searchFilter.LocationID)||(n.searchFilter==null?null:n.searchFilter.ChannelID)),s(4),b("ngModel",n.searchFilter.PageNumber),s(4),b("ngModel",n.searchFilter.RowCount),s(5),b("ngModel",n.searchFilter.QuantityFrom),s(2),b("ngModel",n.searchFilter.QuantityTo),s(5),d("ngIf",(n.searchFilter==null?null:n.searchFilter.filterModel)==3),s(14),d("ngIf",v(44,23,n.products$)),s(5),d("matTooltip",((e=n.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=n.channelIdentity())==null?null:e.label:""),s(),d("src",(o=n.channelIdentity())==null?null:o.img,V),s(2),E(" ",R(52,25,(t=n.channelIdentity())==null?null:t.label,13)," "),s(2),y(n.isShowReservedColumn?53:-1),s(3),j(v(58,28,n.products$)),s(3),d("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",v(60,30,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}var Zt=(()=>{class i{constructor(e,o,t,n,u,I,Re,Ne){this.http=e,this.toastr=o,this.dialog=t,this.productService=n,this.authService=u,this.biggerPictureService=I,this.inventoryService=Re,this.mainPanelService=Ne,this.infinitePagination=K(G),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=f.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=f.GuidEMpty,this.selectedChannel=W(null),this.channelIdentity=W({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.sourceObs$=this.infinitePagination.data$.pipe($(e=>{this.checkShowReservedColumn(e)}),A(e=>(e=this.calculateAvailableStock(e),e)),B(1)),this.products$=this.sourceObs$}calculateAvailableStock(e){return e.map(t=>(t.totalAvailable=t.Variants.reduce((n,u)=>(n+=u.I?.Available||0,n),0),t))}checkShowReservedColumn(e){let o=0,t;e.forEach(n=>{t=n.Variants.find(u=>f.IsNotEmpty(u?.Channel[0]?.InventoryReserved)),t&&(o+=1)}),this.isShowReservedColumn=o>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(B(1),$(e=>{this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID,LocationID:e.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!e.Filter.IsMarketplaceAppActive)}))}onChannelChange(e){let o=Object.assign({},e);this.selectedChannel.set(o),f.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let e=Object.assign({},this.selectedChannel());f.IsNotEmpty(e.parent)?(this.searchFilter.LocationID=e.id,this.searchFilter.ChannelID=e?.parent?.id,e.label=e?.parent?.label+" - "+e?.label,e.img=f.getChannelLogoByTypeId(e?.parent?.typeid)):(this.searchFilter.LocationID=null,e.img=f.getChannelLogoByTypeId(e?.typeid),this.searchFilter.ChannelID=e?.id,this.selectedChannel.set(e)),this.channelIdentity.update(()=>({img:e.img,label:e.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(e){e&&this.toastr.warning(`Automatic inventory sync disabled.
2
2
  Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}onSearch(e){this.searchFilter.text=e,this.setChannelFilter(),this.initReloadData()}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let o=this.productService.selectedVariantProduct(e);if(o.length>0){let t=this.searchFilter.LocationID,n=o.map(I=>L({ID:I.ID,Code:I.Code,Inventory:I.Inventory},f.IsNotEmpty(t)&&{LocationID:t})),u={ListChannelID:[this.searchFilter.ChannelID],List:n};this.http.post("/api/Inventory/UpdateChannel",u).subscribe(I=>{this.initReloadData(),this.checkboxState=!1,this.handlingUpdateStock(I)})}}handlingUpdateStock(e){if(e[0]?.Response){let o=e[0]?.Response?.Fail_list,t=e[0]?.Response?.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",t,o)}else this.toastr.error(e[0]?.Exception,"Error")}refreshInventory(e,o,t,n){let u={ChannelItemID:e,ChannelVariationID:o,ChannelID:t,VariantID:n};this.http.post("/api/Inventory/RefreshInventoryChannel",u).subscribe(I=>{this.toastr.success("Successfully updated","Success"),this.initReloadData()})}onCheckboxStateProduct(e){e.Variants=e.Variants.map(o=>(o.Inventory>=0&&(o.selected=e.selected),o))}onCheckboxStateChange(e){e=e.map(o=>(o.Variants=o.Variants.map(t=>(t.selected=this.checkboxState,t)),o))}openTableDialog(e,o,t){this.dialog.open(Me,{data:{Name:e.Name,Variant:o,ChannelID:o?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:e.ChannelItemID}}).afterClosed().pipe(Y(u=>f.IsNotEmpty(u))).subscribe(u=>{this.updateItemAfterDialog(u)})}updateItemAfterDialog(e){let o=this.searchFilter.LocationID,t=L({ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:parseFloat(e.Inventory),VariantID:e.ID,SKU:e.Sku},f.IsNotEmpty(o)&&{LocationID:o});this.http.post("/api/Inventory/UpdateQuantityByItem",t).subscribe(n=>{this.searchFilter.PageNumber=1,this.initReloadData(),this.handlingUpdateStock([n])})}onScanInventory(e){let o=this.productService.selectedVariantProduct(e);this.inventoryService.refreshInventory(o).subscribe(()=>{this.initReloadData(),this.toastr.success("Inventory refreshed successfully","Success")})}openExportDialog(){this.dialog.open(Ve,{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(e,o){this.biggerPictureService.openBiggerPicture(e,o)}onSortVariant(e){if(e.direction==""){this.products$=this.sourceObs$;return}this.products$=this.products$.pipe(A(o=>o.map(t=>(t.Variants=t.Variants.sort((n,u)=>f.compare(n.I?.Available,u.I?.Available,e.direction==="asc")),t)).sort((t,n)=>f.compare(t.totalAvailable,n.totalAvailable,e.direction==="asc"))))}static{this.\u0275fac=function(o){return new(o||i)(w(_e),w(me),w(xe),w(be),w(ue),w(Fe),w(N),w(fe))}}static{this.\u0275cmp=Z({type:i,selectors:[["app-single-channel-comparison"]],features:[X([G,N])],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"],["matSort","",1,"table","border-bottom",3,"matSortChange"],[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","mat-sort-header","Available","arrowPosition","before",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-outline-dark me-3","matTooltip","Fetch the latest stock directly from the channel",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary","shadow","rounded"],["matTooltip","Fetch the latest stock directly from the channel",1,"btn","btn-outline-dark","me-3",3,"click"],[1,"fa-solid","fa-arrows-rotate","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-success","btn-sm","dropdown-toggle","border-start"],[1,"dropdown-menu","dropdown-menu-end","pointer"],["role","button",1,"dropdown-item","cursor-pointer","fs-5",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModelChange","ngModel"],[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(o,t){o&1&&(h(0,dt,61,32,"mainpanel",2),g(1,"async")),o&2&&d("ngIf",v(1,1,t.loader$))},dependencies:[oe,J,ee,te,ie,ne,ve,Se,he,pe,le,ce,ae,re,se,Pe,De,de,Ee,Te,ge,Ce,we,ye,Ie,ke],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}"]})}}return i})();export{Zt as SingleChannelComparisonComponent};
@@ -1 +1 @@
1
- import{a as M}from"./chunk-G6T2QL55.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as B}from"./chunk-UIM3W5B7.js";import{a as se}from"./chunk-BVIRHZTZ.js";import{a as Ve,b as Te}from"./chunk-3LQNSF7T.js";import{a as be,b as Fe}from"./chunk-YXFTLQ5M.js";import"./chunk-7TWBIV3T.js";import{a as ye}from"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import{a as ve}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{a as Ce,b as ue,d as fe,e as xe}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as he}from"./chunk-3PJZW7HF.js";import{b as _e,e as me}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as Se,l as Pe,m as Ie,n as we}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as ie,c as oe,h as ae,m as re,o as le,y as ce}from"./chunk-DPLEMBB4.js";import{c as pe,e as de,f as ge}from"./chunk-PXB4YEY3.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-GPEVUTDI.js";import{$c as Z,Dc as H,Eb as z,Ec as d,Fc as R,G as W,Gc as b,Ic as I,Jc as w,Kb as h,Kc as y,Oc as J,Qc as F,Wb as p,Z as A,Zc as v,_c as V,ad as Q,bc as S,cc as N,ea as $,ec as k,fc as L,gc as a,hc as c,ic as P,jc as G,kc as q,mc as f,ob as T,pa as j,qb as l,rc as C,sc as r,vc as K,wb as u,ya as _,za as m}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var U=i=>[i],Re=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i}),Ue=i=>({"ms-10":i});function Oe(i,s){if(i&1&&(a(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),p("src",e==null?null:e.Img,T),l(),b(" ",e.Name," ")}}function We(i,s){if(i&1){let e=f();a(0,"button",16),C("click",function(){_(e);let t=r().ngIf,o=r(2);return m(o.updateStock(t))}),P(1,"i",17),d(2," Update "),c()}}function Ae(i,s){if(i&1){let e=f();a(0,"actions")(1,"div",12),h(2,We,3,0,"button",13),a(3,"button",14),C("click",function(){_(e);let t=r(2);return m(t.openExportDialog())}),P(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),p("ngIf",n.productService.hasSelectionVariant(e))}}function $e(i,s){if(i&1){let e=f();a(0,"th")(1,"input",32),C("change",function(t){_(e);let o=r().ngIf,g=r(2);return m(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function je(i,s){if(i&1){let e=f();a(0,"input",51),y("ngModelChange",function(t){_(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),C("ngModelChange",function(){_(e);let t=r(4).$implicit,o=r(3);return m(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function ze(i,s){if(i&1&&h(0,je,1,1,"ng-template",26),i&2){let e=r(6);p("ngxPermissionsOnly",F(1,U,e.rolePriceEdit))}}function Ge(i,s){if(i&1){let e=f();G(0),a(1,"img",52),C("click",function(t){_(e);let o=r(3).$implicit,g=r(3);return m(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,T)}}function qe(i,s){i&1&&P(0,"img",53)}function Ke(i,s){if(i&1&&(a(0,"small",50),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function He(i,s){if(i&1&&(a(0,"td",44)(1,"div",45),h(2,ze,1,3,null,26),a(3,"div",46),h(4,Ge,2,1,"ng-container",47)(5,qe,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",48)(8,"span",49),d(9),c(),h(10,Ke,2,1,"small",50),c()),i&2){let e=H(6),n=r(2).$implicit;p("rowSpan",n.Variants.length),l(2),S((n.Variants==null?null:n.Variants.length)>1?2:-1),l(),p("ngClass",F(8,Ue,(n.Variants==null?null:n.Variants.length)<=1)),l(),p("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),p("rowSpan",n.Variants.length),l(2),R(n.Name),l(),S(n.Category?10:-1)}}function Je(i,s){if(i&1){let e=f();a(0,"input",56),y("ngModelChange",function(t){_(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Ze(i,s){if(i&1&&(a(0,"td",54),h(1,Je,1,1,"input",55),c()),i&2){let e=r().$implicit;l(),S(e.UnitPrice>=0?1:-1)}}function Qe(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Xe(i,s){if(i&1&&(a(0,"div"),d(1),v(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.UnitPrice)," ")}}function Ye(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let e=r().$implicit,n=r(4);l(),p("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),T)}}function et(i,s){if(i&1){let e=f();a(0,"div",58),C("click",function(){_(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,x=r();return m(x.openTableDialog(t,o,g))}),d(1),v(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function tt(i,s){if(i&1){let e=f();a(0,"tr",33),h(1,He,11,10),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Ze,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Qe,2,0,"div",36)(11,Xe,3,3,"div")(12,Ye,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,et,3,3,"div",39),a(16,"div",37)(17,"a",40),P(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=_(e).$implicit,o=r(4);return m(o.refreshPrice(t))}),P(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),S(n==0?1:-1),l(2),R(e.Model),l(2),p("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",F(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),p("ngxPermissionsOnly",F(14,U,t.rolePriceEdit)),l(3),S((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),p("ngClass",F(16,Be,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),S(e.Channel.length>0?15:-1),l(2),p("href",e.Channel[0]==null?null:e.Channel[0].Url,T)}}function nt(i,s){if(i&1&&k(0,tt,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function it(i,s){if(i&1){let e=f();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(t){_(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),m(t)}),C("toggleChange",function(){_(e);let t=r(2);return m(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,$e,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){_(e);let t=r(2);return m(t.openModalFilter())}),P(21,"img",29),a(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,nt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),v(29,"async"),C("onNextPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=r(2);return m(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",F(16,U,n.rolePriceEdit)),l(4),p("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),p("src",n.selectedChannel==null?null:n.selectedChannel.Img,T),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),p("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",V(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function ot(i,s){if(i&1){let e=f();a(0,"mainpanel",2),y("textChange",function(t){_(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),m(t)}),C("onSubmit",function(){_(e);let t=r();return m(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),m(t)}),h(6,Oe,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),m(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),m(t)}),c()()(),h(15,Ae,7,1,"actions",9),v(16,"async"),h(17,it,30,18,"content",9),v(18,"async"),c()}if(i&2){let e=r();p("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),p("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),p("ngIf",V(16,9,e.data$)),l(2),p("ngIf",V(18,11,e.data$))}}var At=(()=>{class i{constructor(e,n,t,o,g,x,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=x,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(B),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(x=>pe.IsNotEmpty(x))).subscribe(x=>{this.updateItemAfterDialog(x,e)})}updateItemAfterDialog(e,n){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),x=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${x}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Se),u(ye),u(ve),u(M),u(he),u(Pe),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([B,M,ne("https://res.cloudinary.com/"),D])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,ot,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",V(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,xe,fe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0})}}return i})();export{At as PriceSingleChannelComponent};
1
+ import{a as M}from"./chunk-QRJDRFNS.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as B}from"./chunk-UIM3W5B7.js";import{a as se}from"./chunk-BVIRHZTZ.js";import{a as Ve,b as Te}from"./chunk-3LQNSF7T.js";import{a as be,b as Fe}from"./chunk-YXFTLQ5M.js";import"./chunk-7TWBIV3T.js";import{a as ye}from"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import{a as ve}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{a as Ce,b as ue,d as fe,e as xe}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as he}from"./chunk-XDUYDX35.js";import{b as _e,e as me}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as Se,l as Pe,m as Ie,n as we}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as ie,c as oe,h as ae,m as re,o as le,y as ce}from"./chunk-DPLEMBB4.js";import{c as pe,e as de,f as ge}from"./chunk-PXB4YEY3.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-GPEVUTDI.js";import{$c as Z,Dc as H,Eb as z,Ec as d,Fc as R,G as W,Gc as b,Ic as I,Jc as w,Kb as h,Kc as y,Oc as J,Qc as F,Wb as p,Z as A,Zc as v,_c as V,ad as Q,bc as S,cc as N,ea as $,ec as k,fc as L,gc as a,hc as c,ic as P,jc as G,kc as q,mc as f,ob as T,pa as j,qb as l,rc as C,sc as r,vc as K,wb as u,ya as _,za as m}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var U=i=>[i],Re=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i}),Ue=i=>({"ms-10":i});function Oe(i,s){if(i&1&&(a(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),p("src",e==null?null:e.Img,T),l(),b(" ",e.Name," ")}}function We(i,s){if(i&1){let e=f();a(0,"button",16),C("click",function(){_(e);let t=r().ngIf,o=r(2);return m(o.updateStock(t))}),P(1,"i",17),d(2," Update "),c()}}function Ae(i,s){if(i&1){let e=f();a(0,"actions")(1,"div",12),h(2,We,3,0,"button",13),a(3,"button",14),C("click",function(){_(e);let t=r(2);return m(t.openExportDialog())}),P(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),p("ngIf",n.productService.hasSelectionVariant(e))}}function $e(i,s){if(i&1){let e=f();a(0,"th")(1,"input",32),C("change",function(t){_(e);let o=r().ngIf,g=r(2);return m(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function je(i,s){if(i&1){let e=f();a(0,"input",51),y("ngModelChange",function(t){_(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),C("ngModelChange",function(){_(e);let t=r(4).$implicit,o=r(3);return m(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function ze(i,s){if(i&1&&h(0,je,1,1,"ng-template",26),i&2){let e=r(6);p("ngxPermissionsOnly",F(1,U,e.rolePriceEdit))}}function Ge(i,s){if(i&1){let e=f();G(0),a(1,"img",52),C("click",function(t){_(e);let o=r(3).$implicit,g=r(3);return m(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,T)}}function qe(i,s){i&1&&P(0,"img",53)}function Ke(i,s){if(i&1&&(a(0,"small",50),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function He(i,s){if(i&1&&(a(0,"td",44)(1,"div",45),h(2,ze,1,3,null,26),a(3,"div",46),h(4,Ge,2,1,"ng-container",47)(5,qe,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",48)(8,"span",49),d(9),c(),h(10,Ke,2,1,"small",50),c()),i&2){let e=H(6),n=r(2).$implicit;p("rowSpan",n.Variants.length),l(2),S((n.Variants==null?null:n.Variants.length)>1?2:-1),l(),p("ngClass",F(8,Ue,(n.Variants==null?null:n.Variants.length)<=1)),l(),p("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),p("rowSpan",n.Variants.length),l(2),R(n.Name),l(),S(n.Category?10:-1)}}function Je(i,s){if(i&1){let e=f();a(0,"input",56),y("ngModelChange",function(t){_(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Ze(i,s){if(i&1&&(a(0,"td",54),h(1,Je,1,1,"input",55),c()),i&2){let e=r().$implicit;l(),S(e.UnitPrice>=0?1:-1)}}function Qe(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Xe(i,s){if(i&1&&(a(0,"div"),d(1),v(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.UnitPrice)," ")}}function Ye(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let e=r().$implicit,n=r(4);l(),p("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),T)}}function et(i,s){if(i&1){let e=f();a(0,"div",58),C("click",function(){_(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,x=r();return m(x.openTableDialog(t,o,g))}),d(1),v(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function tt(i,s){if(i&1){let e=f();a(0,"tr",33),h(1,He,11,10),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Ze,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Qe,2,0,"div",36)(11,Xe,3,3,"div")(12,Ye,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,et,3,3,"div",39),a(16,"div",37)(17,"a",40),P(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=_(e).$implicit,o=r(4);return m(o.refreshPrice(t))}),P(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),S(n==0?1:-1),l(2),R(e.Model),l(2),p("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",F(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),p("ngxPermissionsOnly",F(14,U,t.rolePriceEdit)),l(3),S((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),p("ngClass",F(16,Be,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),S(e.Channel.length>0?15:-1),l(2),p("href",e.Channel[0]==null?null:e.Channel[0].Url,T)}}function nt(i,s){if(i&1&&k(0,tt,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function it(i,s){if(i&1){let e=f();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(t){_(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),m(t)}),C("toggleChange",function(){_(e);let t=r(2);return m(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,$e,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){_(e);let t=r(2);return m(t.openModalFilter())}),P(21,"img",29),a(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,nt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),v(29,"async"),C("onNextPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=r(2);return m(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",F(16,U,n.rolePriceEdit)),l(4),p("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),p("src",n.selectedChannel==null?null:n.selectedChannel.Img,T),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),p("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",V(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function ot(i,s){if(i&1){let e=f();a(0,"mainpanel",2),y("textChange",function(t){_(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),m(t)}),C("onSubmit",function(){_(e);let t=r();return m(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),m(t)}),h(6,Oe,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),m(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),m(t)}),c()()(),h(15,Ae,7,1,"actions",9),v(16,"async"),h(17,it,30,18,"content",9),v(18,"async"),c()}if(i&2){let e=r();p("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),p("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),p("ngIf",V(16,9,e.data$)),l(2),p("ngIf",V(18,11,e.data$))}}var At=(()=>{class i{constructor(e,n,t,o,g,x,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=x,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(B),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(x=>pe.IsNotEmpty(x))).subscribe(x=>{this.updateItemAfterDialog(x,e)})}updateItemAfterDialog(e,n){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),x=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${x}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Se),u(ye),u(ve),u(M),u(he),u(Pe),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([B,M,ne("https://res.cloudinary.com/"),D])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,ot,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",V(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,xe,fe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0})}}return i})();export{At as PriceSingleChannelComponent};
@@ -1 +1 @@
1
- import{a as X}from"./chunk-VOXQUD5E.js";import{a as Q}from"./chunk-OAS72QB2.js";import{c as Y,d as D}from"./chunk-UIM3W5B7.js";import"./chunk-BVIRHZTZ.js";import{b as K}from"./chunk-3LQNSF7T.js";import"./chunk-YXFTLQ5M.js";import"./chunk-OLSC6KHB.js";import"./chunk-7TWBIV3T.js";import{a as J}from"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as $}from"./chunk-3PJZW7HF.js";import{b as G,e as W}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as H,m as q,n as z}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as B,h as O,m as U,o as j,y as k}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{g as R,j as L,m as x,n as A}from"./chunk-GPEVUTDI.js";import{Eb as N,Ec as g,G as V,Ic as S,Jc as v,Kb as f,Kc as y,Oc as E,Wb as u,Z as T,Zc as _,_c as C,ea as F,gc as a,hc as p,ic as I,mc as b,pa as M,qb as d,rc as P,sc as o,wb as h,ya as s,za as l}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";function Z(r,w){if(r&1){let e=b();a(0,"button",15),P("click",function(){s(e);let t=o().ngIf,n=o(2);return l(n.onUpdateItems(t))}),I(1,"i",16),g(2," Update "),p()}}function ee(r,w){if(r&1&&(a(0,"div"),f(1,Z,3,0,"button",14),p()),r&2){let e=w.ngIf,i=o(2);d(),u("ngIf",i.productService.hasSelectionVariant(e))}}function te(r,w){if(r&1){let e=b();a(0,"mainpanel",1),P("onSubmit",function(t){s(e);let n=o();return l(n.onSearch(t))}),a(1,"actions")(2,"div",2),f(3,ee,2,1,"div",3),_(4,"async"),a(5,"button",4),P("click",function(){s(e);let t=o();return l(t.openExportDialog())}),I(6,"i",5),a(7,"span"),g(8,"Export"),p()()()(),a(9,"filters")(10,"div")(11,"label",6),g(12,"Page Number"),p(),a(13,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),l(t)}),p()(),a(14,"div",8)(15,"label",6),g(16,"Page Size"),p(),a(17,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),l(t)}),p()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),_(23,"async"),P("onToggle",function(t){s(e);let n=o();return l(n.onShowDifferencePrice(t))})("onSubmit",function(t){s(e);let n=o();return l(n.updatePriceByVariant(t))}),p(),a(24,"infinite-paginator",13),_(25,"async"),P("onNextPage",function(){s(e);let t=o();return l(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){s(e);let t=o();return l(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){s(e);let t=o();return l(t.infinitePagination.getRowCount(t.searchFilter))}),p()()()()()()}if(r&2){let e=o();u("textButton","Search"),d(3),u("ngIf",C(4,14,e.data$)),d(10),S("ngModel",e.searchFilter.PageNumber),d(4),S("ngModel",e.searchFilter.RowCount),d(5),u("showProductToggle",!0)("data",C(23,16,e.data$))("channel",e.channelOptions)("hiddenIPOSInventory",!1),d(2),u("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",C(25,18,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}var be=(()=>{class r{constructor(e,i,t,n,m,c){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=m,this.decimalPipe=c,this.infinitePagination=M(D),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(F(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let n=i.map(c=>({ID:c.ID,Code:c.Code,Price:c.UnitPrice}));var t=this.channelOptions.filter(c=>c.selected).map(c=>c.ID);let m={ListChannelID:t,ListPrice:n};this.http.post("/api/Price/UpdateChannel",m).subscribe(c=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+m.ListPrice.length+" items in "+m.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(t=>{let n=this.productService.findChannelById(i.ID,this.channelOptions),m=i.Price?this.decimalPipe.transform(i.Price):i.Price;this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+n.Name+" to "+m,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Q,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(V(t=>t!==void 0)).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openExportDialog(){this.dialog.open(K,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(i){return new(i||r)(h(W),h(G),h(H),h(J),h($),h(x))}}static{this.\u0275cmp=N({type:r,selectors:[["app-price-pos-channel"]],features:[E([D,x])],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(i,t){i&1&&(f(0,te,26,20,"mainpanel",0),_(1,"async")),i&2&&u("ngIf",C(1,1,t.loader$))},dependencies:[A,R,L,k,B,j,O,U,Y,z,q,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{be as PricePosChannelComponent};
1
+ import{a as X}from"./chunk-EA52MAWA.js";import{a as Q}from"./chunk-OAS72QB2.js";import{c as Y,d as D}from"./chunk-UIM3W5B7.js";import"./chunk-BVIRHZTZ.js";import{b as K}from"./chunk-3LQNSF7T.js";import"./chunk-YXFTLQ5M.js";import"./chunk-OLSC6KHB.js";import"./chunk-7TWBIV3T.js";import{a as J}from"./chunk-EGTYAIU5.js";import"./chunk-LOJPRXKZ.js";import"./chunk-6ALHX2I4.js";import"./chunk-3RK6DDJD.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as $}from"./chunk-XDUYDX35.js";import{b as G,e as W}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as H,m as q,n as z}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as B,h as O,m as U,o as j,y as k}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{g as R,j as L,m as x,n as A}from"./chunk-GPEVUTDI.js";import{Eb as N,Ec as g,G as V,Ic as S,Jc as v,Kb as f,Kc as y,Oc as E,Wb as u,Z as T,Zc as _,_c as C,ea as F,gc as a,hc as p,ic as I,mc as b,pa as M,qb as d,rc as P,sc as o,wb as h,ya as s,za as l}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";function Z(r,w){if(r&1){let e=b();a(0,"button",15),P("click",function(){s(e);let t=o().ngIf,n=o(2);return l(n.onUpdateItems(t))}),I(1,"i",16),g(2," Update "),p()}}function ee(r,w){if(r&1&&(a(0,"div"),f(1,Z,3,0,"button",14),p()),r&2){let e=w.ngIf,i=o(2);d(),u("ngIf",i.productService.hasSelectionVariant(e))}}function te(r,w){if(r&1){let e=b();a(0,"mainpanel",1),P("onSubmit",function(t){s(e);let n=o();return l(n.onSearch(t))}),a(1,"actions")(2,"div",2),f(3,ee,2,1,"div",3),_(4,"async"),a(5,"button",4),P("click",function(){s(e);let t=o();return l(t.openExportDialog())}),I(6,"i",5),a(7,"span"),g(8,"Export"),p()()()(),a(9,"filters")(10,"div")(11,"label",6),g(12,"Page Number"),p(),a(13,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),l(t)}),p()(),a(14,"div",8)(15,"label",6),g(16,"Page Size"),p(),a(17,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),l(t)}),p()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),_(23,"async"),P("onToggle",function(t){s(e);let n=o();return l(n.onShowDifferencePrice(t))})("onSubmit",function(t){s(e);let n=o();return l(n.updatePriceByVariant(t))}),p(),a(24,"infinite-paginator",13),_(25,"async"),P("onNextPage",function(){s(e);let t=o();return l(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){s(e);let t=o();return l(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){s(e);let t=o();return l(t.infinitePagination.getRowCount(t.searchFilter))}),p()()()()()()}if(r&2){let e=o();u("textButton","Search"),d(3),u("ngIf",C(4,14,e.data$)),d(10),S("ngModel",e.searchFilter.PageNumber),d(4),S("ngModel",e.searchFilter.RowCount),d(5),u("showProductToggle",!0)("data",C(23,16,e.data$))("channel",e.channelOptions)("hiddenIPOSInventory",!1),d(2),u("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",C(25,18,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}var be=(()=>{class r{constructor(e,i,t,n,m,c){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=m,this.decimalPipe=c,this.infinitePagination=M(D),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(F(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let n=i.map(c=>({ID:c.ID,Code:c.Code,Price:c.UnitPrice}));var t=this.channelOptions.filter(c=>c.selected).map(c=>c.ID);let m={ListChannelID:t,ListPrice:n};this.http.post("/api/Price/UpdateChannel",m).subscribe(c=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+m.ListPrice.length+" items in "+m.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(t=>{let n=this.productService.findChannelById(i.ID,this.channelOptions),m=i.Price?this.decimalPipe.transform(i.Price):i.Price;this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+n.Name+" to "+m,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Q,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(V(t=>t!==void 0)).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openExportDialog(){this.dialog.open(K,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(i){return new(i||r)(h(W),h(G),h(H),h(J),h($),h(x))}}static{this.\u0275cmp=N({type:r,selectors:[["app-price-pos-channel"]],features:[E([D,x])],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(i,t){i&1&&(f(0,te,26,20,"mainpanel",0),_(1,"async")),i&2&&u("ngIf",C(1,1,t.loader$))},dependencies:[A,R,L,k,B,j,O,U,Y,z,q,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{be as PricePosChannelComponent};
@@ -1 +1 @@
1
- import{j as l}from"./chunk-3PJZW7HF.js";import{b as c}from"./chunk-BUFEIJAI.js";import{G as a}from"./chunk-GPEVUTDI.js";import{ja as n,oa as r}from"./chunk-T5ONJF63.js";var v=(()=>{class e{constructor(o,t,i){this.toastr=o,this.authService=t,this.router=i}canActivate(o,t){let i=JSON.parse(window.localStorage.getItem("user")),u=new Date,s=!1;if(i!=null){let p=new Date(i.Token.expiredAt);u<p?s=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return s}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}static{this.\u0275fac=function(t){return new(t||e)(r(c),r(l),r(a))}}static{this.\u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{v as a};
1
+ import{j as l}from"./chunk-XDUYDX35.js";import{b as c}from"./chunk-BUFEIJAI.js";import{G as a}from"./chunk-GPEVUTDI.js";import{ja as n,oa as r}from"./chunk-T5ONJF63.js";var v=(()=>{class e{constructor(o,t,i){this.toastr=o,this.authService=t,this.router=i}canActivate(o,t){let i=JSON.parse(window.localStorage.getItem("user")),u=new Date,s=!1;if(i!=null){let p=new Date(i.Token.expiredAt);u<p?s=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return s}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}static{this.\u0275fac=function(t){return new(t||e)(r(c),r(l),r(a))}}static{this.\u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{v as a};
@@ -1 +1 @@
1
- import{a as it}from"./chunk-CBHXQUMA.js";import{a as st}from"./chunk-LEHTNMIE.js";import{a as at,b as ot}from"./chunk-GHQH62TZ.js";import{c as rt}from"./chunk-Q72ZXPDP.js";import{f as lt}from"./chunk-Q2OEJFVT.js";import{b as w,c as x,j as E,k as U}from"./chunk-ITTRZMEX.js";import{r as P}from"./chunk-TMFFA26Y.js";import{h as et,m as nt}from"./chunk-DPLEMBB4.js";import{b as m,c}from"./chunk-PXB4YEY3.js";import{G as tt,d as X,f as Y,g as Z,j as $}from"./chunk-GPEVUTDI.js";import{Eb as D,Ec as s,Fc as u,Gc as q,Ic as v,Jc as M,Kb as S,Kc as T,Qa as K,Qc as Q,Wb as r,Z as R,Zc as k,_c as A,bc as N,cc as G,ec as z,fc as H,gc as a,hc as l,ic as J,mc as O,ob as j,pa as B,qb as o,rc as y,sc as f,v as W,wb as C,ya as b,za as I}from"./chunk-T5ONJF63.js";function Ct(i,h){if(i&1&&(a(0,"mat-option",10)(1,"div",11),J(2,"img",12),a(3,"span"),s(4),l()()()),i&2){let t=h.$implicit;r("value",t.ID)("disabled",t.disabled),o(),r("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),o(),r("src",t.Img,j),o(2),u(t.Name)}}function gt(i,h){if(i&1){let t=O();a(0,"div",13)(1,"label",14),s(2,"Scan Type"),l(),a(3,"mat-radio-group",15),T("ngModelChange",function(e){b(t);let p=f();return M(p.filter.ScanFull,e)||(p.filter.ScanFull=e),I(e)}),a(4,"mat-radio-button",16),s(5," Full (Include Inactive Products) "),l(),a(6,"mat-radio-button",17),s(7," Active "),l()()()}if(i&2){let t=f();o(3),v("ngModel",t.filter.ScanFull),o(),r("value",!0),o(2),r("value",!1)}}function ut(i,h){i&1&&(a(0,"span"),s(1,"Never"),l())}function _t(i,h){if(i&1&&(a(0,"span"),s(1),k(2,"async"),l()),i&2){let t=f(2);o(),u(A(2,1,t.lastSync$))}}function St(i,h){if(i&1){let t=O();a(0,"div",8)(1,"label",3)(2,"span",18),s(3,"Last Scan:"),l(),S(4,ut,2,0,"span"),k(5,"async"),S(6,_t,3,3,"span"),l(),a(7,"mat-radio-group",19),T("ngModelChange",function(e){b(t);let p=f();return M(p.filter.UpdatedProduct,e)||(p.filter.UpdatedProduct=e),I(e)}),a(8,"mat-radio-button",20),s(9," Scan All Products "),l(),a(10,"mat-radio-button",21),s(11),l()()()}if(i&2){let t=f();o(4),N(A(5,6,t.lastSync$)==null?4:6),o(3),v("ngModel",t.filter.UpdatedProduct),o(),r("value",!1),o(2),r("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"),o(),q(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function yt(i,h){if(i&1){let t=O();a(0,"div",8)(1,"label",3),s(2," Scan Option "),l(),a(3,"mat-radio-group",22),T("ngModelChange",function(e){b(t);let p=f();return M(p.filter.Async,e)||(p.filter.Async=e),I(e)}),a(4,"mat-radio-button",23),s(5," Asynchronous (Get Notified when Complete) "),l(),a(6,"mat-radio-button",24),s(7," Synchronous (Wait until Complete) "),l()()()}if(i&2){let t=f();o(3),v("ngModel",t.filter.Async),o(),r("value",!0),o(2),r("value",!1)}}var Lt=(()=>{class i{constructor(t,n,e){this.dialogRef=t,this.data=n,this.router=e,this.channelService=B(it),this.channelType=m,this.disabledChannelOption=!1,this.filter={ChannelID:c.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=c.IsNotEmpty(n.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=c.IsEmpty(n.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==m.Tiktok||t.TypeID==m.Tokopedia||t.TypeID==m.Lazada||t.TypeID==m.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let n=this.filterChannelById(t);this.selectedChannel=n,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(W(n=>(this.selectedChannel.LastSync=n.LastSync,this.setDefaultConfigUpdate(),c.IsNotEmpty(n.LastSync)?c.convertToReadableDate(n.LastSync):null)),R(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&c.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(t){let n;return this.channelOptions&&(n=this.channelOptions.find(e=>e.ID==t)),n}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(t){return c.IsNotEmpty(t)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||i)(C(w),C(x),C(tt))}}static{this.\u0275cmp=D({type:i,selectors:[["app-scan-dialog"]],standalone:!1,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(n,e){n&1&&(a(0,"modal-material",0),y("onOk",function(){return e.submit()})("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),s(4,"Select a Channel"),l(),a(5,"mat-form-field",4)(6,"mat-select",5),T("ngModelChange",function(d){return M(e.filter.ChannelID,d)||(e.filter.ChannelID=d),d}),y("ngModelChange",function(d){return e.onSelectChannel(d)}),S(7,Ct,5,5,"mat-option",6),l()(),S(8,gt,8,3,"div",7)(9,St,12,8,"div",8)(10,yt,8,3,"div",9),l()()()),n&2&&(r("dynamicValidated",e.isNotEmpty(e.filter.ChannelID))("config",e.modalConfig),o(6),r("disabled",e.disabledChannelOption),v("ngModel",e.filter.ChannelID),o(),r("ngForOf",e.channelOptions),o(),r("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)),o(),N(e.hasScanUpdate&&e.selectedChannel?9:-1),o(),r("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)))},dependencies:[Y,Z,et,nt,at,ot,lt,st,rt,P,U,$],encapsulation:2})}}return i})();var vt=i=>({"bg-gradient-warning":i});function Mt(i,h){if(i&1&&(a(0,"tr",5)(1,"td"),s(2),l(),a(3,"td",6),s(4),l()()),i&2){let t=h.$implicit;r("matTooltip",t.duplicateMessage),o(2),u(t==null?null:t.Name),o(),r("ngClass",Q(4,vt,t.isDuplicate)),o(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var Ht=(()=>{class i{constructor(t,n){this.data=t,this.dialogRef=n,this.variants=K([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let t=this.data?.variants,n={},e=[],p=t.filter(d=>c.IsEmpty(d.ChannelVariationSKU));t.filter(d=>c.IsNotEmpty(d.ChannelVariationSKU)).forEach((d,g,F)=>{n[d.ChannelVariationSKU]=F.filter(_=>_.ChannelVariationSKU===d.ChannelVariationSKU)}),Object.keys(n).forEach(d=>{n[d].length>1&&(n[d]=n[d].map((g,F,_)=>{let L=`SKU ${g.ChannelVariationSKU} is duplicated with variant`;return _.forEach((V,dt)=>{V.Name!==g.Name&&(L+=` ${_.length>2?V.Name+(dt!==_.length-1?",":""):V.Name}`)}),g.duplicateMessage=L,g.isDuplicate=!0,g})),e.push(...n[d])}),e.push(...p),this.variants.set(e)}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}static{this.\u0275fac=function(n){return new(n||i)(C(x),C(w))}}static{this.\u0275cmp=D({type:i,selectors:[["app-modal-variants"]],standalone:!1,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(n,e){n&1&&(a(0,"modal-material",0),y("onCancel",function(){return e.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),s(6,"Variant"),l(),a(7,"th",4),s(8,"SKU"),l()()(),a(9,"tbody"),z(10,Mt,5,6,"tr",5,G),l()()()()),n&2&&(r("config",e.modalConfig),o(10),H(e.variants()))},dependencies:[X,P,U],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}"]})}}return i})();export{Lt as a,Ht as b};
1
+ import{a as it}from"./chunk-JYLQJCDT.js";import{a as st}from"./chunk-LEHTNMIE.js";import{a as at,b as ot}from"./chunk-GHQH62TZ.js";import{c as rt}from"./chunk-Q72ZXPDP.js";import{f as lt}from"./chunk-Q2OEJFVT.js";import{b as w,c as x,j as E,k as U}from"./chunk-ITTRZMEX.js";import{r as P}from"./chunk-TMFFA26Y.js";import{h as et,m as nt}from"./chunk-DPLEMBB4.js";import{b as m,c}from"./chunk-PXB4YEY3.js";import{G as tt,d as X,f as Y,g as Z,j as $}from"./chunk-GPEVUTDI.js";import{Eb as D,Ec as s,Fc as u,Gc as q,Ic as v,Jc as M,Kb as S,Kc as T,Qa as K,Qc as Q,Wb as r,Z as R,Zc as k,_c as A,bc as N,cc as G,ec as z,fc as H,gc as a,hc as l,ic as J,mc as O,ob as j,pa as B,qb as o,rc as y,sc as f,v as W,wb as C,ya as b,za as I}from"./chunk-T5ONJF63.js";function Ct(i,h){if(i&1&&(a(0,"mat-option",10)(1,"div",11),J(2,"img",12),a(3,"span"),s(4),l()()()),i&2){let t=h.$implicit;r("value",t.ID)("disabled",t.disabled),o(),r("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),o(),r("src",t.Img,j),o(2),u(t.Name)}}function gt(i,h){if(i&1){let t=O();a(0,"div",13)(1,"label",14),s(2,"Scan Type"),l(),a(3,"mat-radio-group",15),T("ngModelChange",function(e){b(t);let p=f();return M(p.filter.ScanFull,e)||(p.filter.ScanFull=e),I(e)}),a(4,"mat-radio-button",16),s(5," Full (Include Inactive Products) "),l(),a(6,"mat-radio-button",17),s(7," Active "),l()()()}if(i&2){let t=f();o(3),v("ngModel",t.filter.ScanFull),o(),r("value",!0),o(2),r("value",!1)}}function ut(i,h){i&1&&(a(0,"span"),s(1,"Never"),l())}function _t(i,h){if(i&1&&(a(0,"span"),s(1),k(2,"async"),l()),i&2){let t=f(2);o(),u(A(2,1,t.lastSync$))}}function St(i,h){if(i&1){let t=O();a(0,"div",8)(1,"label",3)(2,"span",18),s(3,"Last Scan:"),l(),S(4,ut,2,0,"span"),k(5,"async"),S(6,_t,3,3,"span"),l(),a(7,"mat-radio-group",19),T("ngModelChange",function(e){b(t);let p=f();return M(p.filter.UpdatedProduct,e)||(p.filter.UpdatedProduct=e),I(e)}),a(8,"mat-radio-button",20),s(9," Scan All Products "),l(),a(10,"mat-radio-button",21),s(11),l()()()}if(i&2){let t=f();o(4),N(A(5,6,t.lastSync$)==null?4:6),o(3),v("ngModel",t.filter.UpdatedProduct),o(),r("value",!1),o(2),r("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"),o(),q(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function yt(i,h){if(i&1){let t=O();a(0,"div",8)(1,"label",3),s(2," Scan Option "),l(),a(3,"mat-radio-group",22),T("ngModelChange",function(e){b(t);let p=f();return M(p.filter.Async,e)||(p.filter.Async=e),I(e)}),a(4,"mat-radio-button",23),s(5," Asynchronous (Get Notified when Complete) "),l(),a(6,"mat-radio-button",24),s(7," Synchronous (Wait until Complete) "),l()()()}if(i&2){let t=f();o(3),v("ngModel",t.filter.Async),o(),r("value",!0),o(2),r("value",!1)}}var Lt=(()=>{class i{constructor(t,n,e){this.dialogRef=t,this.data=n,this.router=e,this.channelService=B(it),this.channelType=m,this.disabledChannelOption=!1,this.filter={ChannelID:c.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=c.IsNotEmpty(n.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=c.IsEmpty(n.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==m.Tiktok||t.TypeID==m.Tokopedia||t.TypeID==m.Lazada||t.TypeID==m.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let n=this.filterChannelById(t);this.selectedChannel=n,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(W(n=>(this.selectedChannel.LastSync=n.LastSync,this.setDefaultConfigUpdate(),c.IsNotEmpty(n.LastSync)?c.convertToReadableDate(n.LastSync):null)),R(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&c.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(t){let n;return this.channelOptions&&(n=this.channelOptions.find(e=>e.ID==t)),n}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(t){return c.IsNotEmpty(t)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||i)(C(w),C(x),C(tt))}}static{this.\u0275cmp=D({type:i,selectors:[["app-scan-dialog"]],standalone:!1,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(n,e){n&1&&(a(0,"modal-material",0),y("onOk",function(){return e.submit()})("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),s(4,"Select a Channel"),l(),a(5,"mat-form-field",4)(6,"mat-select",5),T("ngModelChange",function(d){return M(e.filter.ChannelID,d)||(e.filter.ChannelID=d),d}),y("ngModelChange",function(d){return e.onSelectChannel(d)}),S(7,Ct,5,5,"mat-option",6),l()(),S(8,gt,8,3,"div",7)(9,St,12,8,"div",8)(10,yt,8,3,"div",9),l()()()),n&2&&(r("dynamicValidated",e.isNotEmpty(e.filter.ChannelID))("config",e.modalConfig),o(6),r("disabled",e.disabledChannelOption),v("ngModel",e.filter.ChannelID),o(),r("ngForOf",e.channelOptions),o(),r("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)),o(),N(e.hasScanUpdate&&e.selectedChannel?9:-1),o(),r("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)))},dependencies:[Y,Z,et,nt,at,ot,lt,st,rt,P,U,$],encapsulation:2})}}return i})();var vt=i=>({"bg-gradient-warning":i});function Mt(i,h){if(i&1&&(a(0,"tr",5)(1,"td"),s(2),l(),a(3,"td",6),s(4),l()()),i&2){let t=h.$implicit;r("matTooltip",t.duplicateMessage),o(2),u(t==null?null:t.Name),o(),r("ngClass",Q(4,vt,t.isDuplicate)),o(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var Ht=(()=>{class i{constructor(t,n){this.data=t,this.dialogRef=n,this.variants=K([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let t=this.data?.variants,n={},e=[],p=t.filter(d=>c.IsEmpty(d.ChannelVariationSKU));t.filter(d=>c.IsNotEmpty(d.ChannelVariationSKU)).forEach((d,g,F)=>{n[d.ChannelVariationSKU]=F.filter(_=>_.ChannelVariationSKU===d.ChannelVariationSKU)}),Object.keys(n).forEach(d=>{n[d].length>1&&(n[d]=n[d].map((g,F,_)=>{let L=`SKU ${g.ChannelVariationSKU} is duplicated with variant`;return _.forEach((V,dt)=>{V.Name!==g.Name&&(L+=` ${_.length>2?V.Name+(dt!==_.length-1?",":""):V.Name}`)}),g.duplicateMessage=L,g.isDuplicate=!0,g})),e.push(...n[d])}),e.push(...p),this.variants.set(e)}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}static{this.\u0275fac=function(n){return new(n||i)(C(x),C(w))}}static{this.\u0275cmp=D({type:i,selectors:[["app-modal-variants"]],standalone:!1,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(n,e){n&1&&(a(0,"modal-material",0),y("onCancel",function(){return e.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),s(6,"Variant"),l(),a(7,"th",4),s(8,"SKU"),l()()(),a(9,"tbody"),z(10,Mt,5,6,"tr",5,G),l()()()()),n&2&&(r("config",e.modalConfig),o(10),H(e.variants()))},dependencies:[X,P,U],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}"]})}}return i})();export{Lt as a,Ht as b};
@@ -1,2 +1,2 @@
1
- import{a as Y}from"./chunk-K5ZBGZ47.js";import{e as G}from"./chunk-6IAGGRZN.js";import{h as H}from"./chunk-3PJZW7HF.js";import{b as j,e as F}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import{m as J,n as U}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as D,h as I,m as R,y as k}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{j as T,l as W,n as B}from"./chunk-GPEVUTDI.js";import{Eb as w,Ec as n,Gc as N,Ic as u,Jc as g,Kb as b,Kc as f,Lc as E,Mc as V,Nc as P,Qa as h,Wb as M,Z as S,Zc as C,_c as v,bc as L,gc as e,hc as t,ic as y,mc as O,pa as c,qb as l,rc as x,sc as A,ya as p,za as s}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";function z(i,q){if(i&1&&(e(0,"pre"),n(1),C(2,"json"),t()),i&2){A();let d=P(25);l(),N(" ",d?v(2,1,d):"",`
1
+ import{a as Y}from"./chunk-G35YVLFO.js";import{e as G}from"./chunk-6IAGGRZN.js";import{h as H}from"./chunk-XDUYDX35.js";import{b as j,e as F}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import{m as J,n as U}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as D,h as I,m as R,y as k}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{j as T,l as W,n as B}from"./chunk-GPEVUTDI.js";import{Eb as w,Ec as n,Gc as N,Ic as u,Jc as g,Kb as b,Kc as f,Lc as E,Mc as V,Nc as P,Qa as h,Wb as M,Z as S,Zc as C,_c as v,bc as L,gc as e,hc as t,ic as y,mc as O,pa as c,qb as l,rc as x,sc as A,ya as p,za as s}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";function z(i,q){if(i&1&&(e(0,"pre"),n(1),C(2,"json"),t()),i&2){A();let d=P(25);l(),N(" ",d?v(2,1,d):"",`
2
2
  `)}}function K(i,q){i&1&&(e(0,"p",20),n(1," Your data will be shown here once it's available "),t())}var ce=(()=>{class i{constructor(){this.httpService=c(F),this.toastr=c(j),this.selectedChannel=h(null),this.orderNumber=h(null)}fetchLog(){if(!this.selectedChannel()||!this.orderNumber()){this.toastr.warning("Please select a channel and enter an order number","Warning");return}this.orderLog$=this.httpService.post(H.GetOrderApiLog,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(S(1))}static{this.\u0275fac=function(m){return new(m||i)}}static{this.\u0275cmp=w({type:i,selectors:[["app-order-api-log"]],decls:38,vars:8,consts:[["headerTitle","Origin Order Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group"],[1,"text-center","my-12","text-muted"]],template:function(m,r){if(m&1){let a=O();e(0,"mainpanel",0)(1,"actions")(2,"button",1),x("click",function(){return p(a),s(r.fetchLog())}),y(3,"i",2),n(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),n(12,"Channel"),t(),e(13,"p",8),n(14," View logs related to Order API activities. "),t()(),e(15,"div",9)(16,"channel-select-options",10),f("ngModelChange",function(o){return p(a),g(r.selectedChannel,o)||(r.selectedChannel=o),s(o)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),n(20,"Order Number"),t(),e(21,"p",8),n(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),f("ngModelChange",function(o){return p(a),g(r.orderNumber,o)||(r.orderNumber=o),s(o)}),t()()()()(),E(25),C(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),n(32,"Response"),t()(),e(33,"div",17)(34,"div",18)(35,"div",19),b(36,z,3,3,"pre")(37,K,2,0,"p",20),t()()()()()()()()()}if(m&2){M("hideSearchBox",!0)("hideSearchDropdown",!0),l(16),u("ngModel",r.selectedChannel),l(8),u("ngModel",r.orderNumber),l();let a=V(v(26,5,r.orderLog$));l(11),L(a?36:37)}},dependencies:[B,T,W,U,J,G,k,D,I,R,Y],encapsulation:2})}}return i})();export{ce as OrderApiLogComponent};
@@ -1 +1 @@
1
- import{a as oe}from"./chunk-ZD5LURJS.js";import{b as ae}from"./chunk-COBHWPGI.js";import{a as le,b as re}from"./chunk-CVQMAWML.js";import"./chunk-LEHTNMIE.js";import"./chunk-CH2MLZU7.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-SDUUFQUI.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as X}from"./chunk-3PJZW7HF.js";import{e as Q}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as ne,n as ie}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{h as H,m as U,y as G}from"./chunk-DPLEMBB4.js";import{c as K}from"./chunk-PXB4YEY3.js";import{j as V,k as J,l as W,n as k}from"./chunk-GPEVUTDI.js";import{$c as A,Eb as P,Ec as p,Fc as C,Gc as y,Ic as j,Jc as O,Kb as u,Kc as q,Oc as z,Wb as d,Z as M,Zc as m,_c as c,aa as D,bc as R,cc as B,ec as T,fc as $,g as L,gc as i,hc as a,ic as f,ja as w,mc as F,ob as S,pa as g,qb as l,rc as v,sc as x,v as I,ya as E,za as N}from"./chunk-T5ONJF63.js";import{a as _}from"./chunk-K2H6WANG.js";var b=(()=>{class n{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(D(e=>this.getLogs$(e).pipe()))}getLogs$(e){return this.httpService.post("/api/Channel/GetChannelLogPaged",e)}onPaginationChange(e){let t=this._pageination.value;t.PageNumber=e.pageIndex+1,this._pageination.next(t)}onFilter(e){let t=this._pageination.value;t.PageNumber=1,t=_(_({},t),e),this._pageination.next(t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=w({token:n,factory:n.\u0275fac})}}return n})();function me(n,h){if(n&1&&(i(0,"span",10),f(1,"img",11),a(),p(2)),n&2){let e=h.item;l(),d("src",e.Img,S)("alt",e.Name),l(),y(" ",e.Name," ")}}function se(n,h){if(n&1&&(i(0,"tr")(1,"td"),f(2,"img",17),i(3,"span"),p(4),a()(),i(5,"td")(6,"span",18),p(7),m(8,"json"),a()(),i(9,"td"),p(10),m(11,"json"),a(),i(12,"td"),p(13),m(14,"date"),a()()),n&2){let e=h.$implicit;l(2),d("src",e.Img,S),l(2),y(" ",e.ChannelName," "),l(3),C(c(8,5,e.Request)),l(3),C(c(11,7,e.Response)),l(3),C(A(14,9,e.Created,"dd-MM-yyyy hh:mm:ss"))}}function ce(n,h){if(n&1){let e=F();i(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),p(5,"Channel"),a(),i(6,"th"),p(7,"Request"),a(),i(8,"th"),p(9,"Response"),a(),i(10,"th",15),p(11,"Created"),a()()(),i(12,"tbody"),T(13,se,15,12,"tr",null,B),m(15,"async"),a()(),i(16,"mat-paginator",16),m(17,"async"),m(18,"async"),m(19,"async"),m(20,"async"),v("page",function(r){E(e);let o=x();return N(o.channelLogService.onPaginationChange(r))}),a()()}if(n&2){let e,t,r,o,s=x();l(13),$((e=c(15,3,s.channelLogs$))==null?null:e.Data),l(3),d("length",(t=c(17,5,s.channelLogs$))==null?null:t.Count)("pageSize",(r=c(18,7,s.filter$))==null?null:r.RowCount)("pageIndex",(o=c(19,9,s.filter$))!=null&&o.PageNumber?0:((o=c(20,11,s.filter$))==null?null:o.PageNumber)-1)}}function de(n,h){n&1&&(i(0,"div",9),f(1,"app-empty-state"),a())}var Oe=(()=>{class n{constructor(){this.channelLogService=g(b),this.authService=g(X),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(e=>(e.Data?e.Data=e.Data.map(t=>(t.Response=t.Response?JSON.parse(t.Response):"",t.Request=t.Request?JSON.parse(t.Request):"",t.Img=K.getChannelLogoByTypeId(t.TypeID),t)):e.Data=[],e)),M(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-channel-log"]],features:[z([b])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","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,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"],[1,""]],template:function(t,r){if(t&1&&(i(0,"mainpanel",0),v("onSubmit",function(){return r.onSubmitFilter()}),i(1,"filters")(2,"div",1)(3,"div")(4,"label",2),p(5,"Channel"),a(),i(6,"ng-select",3),q("ngModelChange",function(s){return O(r.channelID,s)||(r.channelID=s),s}),u(7,me,3,3,"ng-template",4),a()()()(),i(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,ce,21,13,"div",8),m(13,"async"),u(14,de,2,0,"div",9),a()()()()()),t&2){let o;d("hideSearchBox",!0),l(6),d("clearable",!0)("items",r.channelOptions),j("ngModel",r.channelID),l(6),R(((o=c(13,5,r.channelLogs$))==null||o.Data==null?null:o.Data.length)>0?12:14)}},dependencies:[k,V,W,J,ie,ne,oe,re,le,ae,te,ee,Y,Z,G,H,U],encapsulation:2})}}return n})();export{Oe as ChannelLogComponent};
1
+ import{a as oe}from"./chunk-ZD5LURJS.js";import{b as ae}from"./chunk-COBHWPGI.js";import{a as le,b as re}from"./chunk-CVQMAWML.js";import"./chunk-LEHTNMIE.js";import"./chunk-CH2MLZU7.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-SDUUFQUI.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as X}from"./chunk-XDUYDX35.js";import{e as Q}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as ne,n as ie}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{h as H,m as U,y as G}from"./chunk-DPLEMBB4.js";import{c as K}from"./chunk-PXB4YEY3.js";import{j as V,k as J,l as W,n as k}from"./chunk-GPEVUTDI.js";import{$c as A,Eb as P,Ec as p,Fc as C,Gc as y,Ic as j,Jc as O,Kb as u,Kc as q,Oc as z,Wb as d,Z as M,Zc as m,_c as c,aa as D,bc as R,cc as B,ec as T,fc as $,g as L,gc as i,hc as a,ic as f,ja as w,mc as F,ob as S,pa as g,qb as l,rc as v,sc as x,v as I,ya as E,za as N}from"./chunk-T5ONJF63.js";import{a as _}from"./chunk-K2H6WANG.js";var b=(()=>{class n{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(D(e=>this.getLogs$(e).pipe()))}getLogs$(e){return this.httpService.post("/api/Channel/GetChannelLogPaged",e)}onPaginationChange(e){let t=this._pageination.value;t.PageNumber=e.pageIndex+1,this._pageination.next(t)}onFilter(e){let t=this._pageination.value;t.PageNumber=1,t=_(_({},t),e),this._pageination.next(t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=w({token:n,factory:n.\u0275fac})}}return n})();function me(n,h){if(n&1&&(i(0,"span",10),f(1,"img",11),a(),p(2)),n&2){let e=h.item;l(),d("src",e.Img,S)("alt",e.Name),l(),y(" ",e.Name," ")}}function se(n,h){if(n&1&&(i(0,"tr")(1,"td"),f(2,"img",17),i(3,"span"),p(4),a()(),i(5,"td")(6,"span",18),p(7),m(8,"json"),a()(),i(9,"td"),p(10),m(11,"json"),a(),i(12,"td"),p(13),m(14,"date"),a()()),n&2){let e=h.$implicit;l(2),d("src",e.Img,S),l(2),y(" ",e.ChannelName," "),l(3),C(c(8,5,e.Request)),l(3),C(c(11,7,e.Response)),l(3),C(A(14,9,e.Created,"dd-MM-yyyy hh:mm:ss"))}}function ce(n,h){if(n&1){let e=F();i(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),p(5,"Channel"),a(),i(6,"th"),p(7,"Request"),a(),i(8,"th"),p(9,"Response"),a(),i(10,"th",15),p(11,"Created"),a()()(),i(12,"tbody"),T(13,se,15,12,"tr",null,B),m(15,"async"),a()(),i(16,"mat-paginator",16),m(17,"async"),m(18,"async"),m(19,"async"),m(20,"async"),v("page",function(r){E(e);let o=x();return N(o.channelLogService.onPaginationChange(r))}),a()()}if(n&2){let e,t,r,o,s=x();l(13),$((e=c(15,3,s.channelLogs$))==null?null:e.Data),l(3),d("length",(t=c(17,5,s.channelLogs$))==null?null:t.Count)("pageSize",(r=c(18,7,s.filter$))==null?null:r.RowCount)("pageIndex",(o=c(19,9,s.filter$))!=null&&o.PageNumber?0:((o=c(20,11,s.filter$))==null?null:o.PageNumber)-1)}}function de(n,h){n&1&&(i(0,"div",9),f(1,"app-empty-state"),a())}var Oe=(()=>{class n{constructor(){this.channelLogService=g(b),this.authService=g(X),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(e=>(e.Data?e.Data=e.Data.map(t=>(t.Response=t.Response?JSON.parse(t.Response):"",t.Request=t.Request?JSON.parse(t.Request):"",t.Img=K.getChannelLogoByTypeId(t.TypeID),t)):e.Data=[],e)),M(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=P({type:n,selectors:[["app-channel-log"]],features:[z([b])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","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,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"],[1,""]],template:function(t,r){if(t&1&&(i(0,"mainpanel",0),v("onSubmit",function(){return r.onSubmitFilter()}),i(1,"filters")(2,"div",1)(3,"div")(4,"label",2),p(5,"Channel"),a(),i(6,"ng-select",3),q("ngModelChange",function(s){return O(r.channelID,s)||(r.channelID=s),s}),u(7,me,3,3,"ng-template",4),a()()()(),i(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,ce,21,13,"div",8),m(13,"async"),u(14,de,2,0,"div",9),a()()()()()),t&2){let o;d("hideSearchBox",!0),l(6),d("clearable",!0)("items",r.channelOptions),j("ngModel",r.channelID),l(6),R(((o=c(13,5,r.channelLogs$))==null||o.Data==null?null:o.Data.length)>0?12:14)}},dependencies:[k,V,W,J,ie,ne,oe,re,le,ae,te,ee,Y,Z,G,H,U],encapsulation:2})}}return n})();export{Oe as ChannelLogComponent};