marketplacepos 3.20.1 → 3.20.3

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 (31) hide show
  1. package/Marketplace/{chunk-XUOIJTB4.js → chunk-22G3JR6W.js} +1 -1
  2. package/Marketplace/{chunk-TE62OPBT.js → chunk-27TUGWVJ.js} +1 -1
  3. package/Marketplace/{chunk-MADSP2BP.js → chunk-3MQV6JYA.js} +1 -1
  4. package/Marketplace/{chunk-EN6KXWCY.js → chunk-5V62VWDN.js} +1 -1
  5. package/Marketplace/{chunk-NAZU3HCR.js → chunk-5YIYZ4W4.js} +1 -1
  6. package/Marketplace/{chunk-4O74KBBT.js → chunk-6GQBIOOG.js} +1 -1
  7. package/Marketplace/{chunk-2V4K6SEC.js → chunk-7JYGGXZV.js} +1 -1
  8. package/Marketplace/{chunk-LAQL3BQZ.js → chunk-AD73Q5SO.js} +1 -1
  9. package/Marketplace/{chunk-TVRLQACG.js → chunk-BBOSAJFJ.js} +1 -1
  10. package/Marketplace/{chunk-XG2DR4LW.js → chunk-BM43VVCJ.js} +1 -1
  11. package/Marketplace/{chunk-BKFG7NIB.js → chunk-CGXLDXLG.js} +1 -1
  12. package/Marketplace/{chunk-ML2BGDS4.js → chunk-EISQDLOC.js} +1 -1
  13. package/Marketplace/{chunk-ALKBIH7J.js → chunk-GD4X6JLM.js} +1 -1
  14. package/Marketplace/{chunk-2L6CZFW7.js → chunk-JGTROTZK.js} +1 -1
  15. package/Marketplace/{chunk-IG57OCJS.js → chunk-KZMQ7HFA.js} +1 -1
  16. package/Marketplace/{chunk-QNEE46MU.js → chunk-LC5PAP2Y.js} +1 -1
  17. package/Marketplace/{chunk-JEC3SZTG.js → chunk-NCTBDQQS.js} +1 -1
  18. package/Marketplace/{chunk-XQQPMC44.js → chunk-OUXYRPIM.js} +1 -1
  19. package/Marketplace/{chunk-IIPI4CHY.js → chunk-RZNPMBKU.js} +1 -1
  20. package/Marketplace/{chunk-EXZPDDOY.js → chunk-S5BOKQAK.js} +1 -1
  21. package/Marketplace/{chunk-HOTEJTGP.js → chunk-SAUHZIYY.js} +1 -1
  22. package/Marketplace/{chunk-YCTTFHDT.js → chunk-UV6746MK.js} +1 -1
  23. package/Marketplace/{chunk-XWXDJLRN.js → chunk-W2JPMZ3K.js} +1 -1
  24. package/Marketplace/{chunk-XYJNR26Y.js → chunk-WGQYJ7SC.js} +1 -1
  25. package/Marketplace/{chunk-YCVNABR6.js → chunk-XFEGVCTK.js} +1 -1
  26. package/Marketplace/{chunk-NNXYTNL6.js → chunk-XOLDVKQQ.js} +1 -1
  27. package/Marketplace/{chunk-DA5WII5E.js → chunk-XP5UAEOH.js} +1 -1
  28. package/Marketplace/{chunk-JUWM7ABO.js → chunk-YCBSVDJN.js} +1 -1
  29. package/Marketplace/index.html +2 -2
  30. package/Marketplace/{main-AEC57EMC.js → main-FD6XFGYK.js} +1 -1
  31. package/package.json +1 -1
@@ -1 +1 @@
1
- import{a as he}from"./chunk-HCJ6C5OR.js";import"./chunk-XUSY2QT2.js";import{a as ce}from"./chunk-TE62OPBT.js";import{a as se}from"./chunk-65RMQ5Q5.js";import{a as F}from"./chunk-XHAXYWZ7.js";import{b as pe,c as V}from"./chunk-MZNSPLFO.js";import"./chunk-BVIRHZTZ.js";import"./chunk-E5BOLHDG.js";import"./chunk-A37OKNC2.js";import"./chunk-ZA7FXMFZ.js";import"./chunk-ZX3SBNZT.js";import"./chunk-2FRMUOJY.js";import"./chunk-C6QIBOCB.js";import{a as le}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import"./chunk-D76K4RZ7.js";import"./chunk-EIBGI6U2.js";import{g as M}from"./chunk-LAQL3BQZ.js";import{b as te,e as ne}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{d as ie,l as ae,m as oe,n as re}from"./chunk-4CEFDQPI.js";import"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{c as q,h as X,m as Y,o as Z,y as ee}from"./chunk-2E5AKA74.js";import{c as D}from"./chunk-FTHTFVHH.js";import{$ as j,B,Bc as J,Fc as K,Ja as h,Jb as _,Ka as m,Nb as L,Ob as T,Pb as E,Qb as z,Rb as $,Va as w,X as k,_a as I,ab as d,ac as v,bc as y,da as S,ga as A,mb as c,nb as p,oa as b,ob as U,pa as P,pb as G,qb as W,rb as H,sb as N,vb as C,xb as g,yc as Q}from"./chunk-ZIZWZZ4E.js";import{a as R,b as x}from"./chunk-GNOSNGXM.js";var O=(()=>{let r=class r{constructor(){this.authService=S(M),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(t,i){let e=Object.assign([],this.channelOptions),n=[],a;return t.forEach(o=>{a=e.find(s=>s.ID==o?.parent?.id),a&&(a=x(R({},a),{Name:`${o?.parent?.label} - ${o?.label}`,LocationID:o?.id}),n.push(a))}),i.forEach(o=>{a=e.find(s=>s.ID==o.id),a&&n.push(a)}),n}generateFilterLocation(t,i){let e=[],n=[],a=[];return t.length>0?(e=t.map(o=>o.id),n=t.map(o=>o.parent.id).filter((o,s,f)=>f.indexOf(o)===s)):(e=[],n=[]),a=i.map(o=>o.id),a=a.concat(n).filter((o,s,f)=>f.indexOf(o)===s),{locationIds:e,channelIds:a}}};r.\u0275fac=function(i){return new(i||r)},r.\u0275prov=j({token:r,factory:r.\u0275fac});let l=r;return l})();function ue(l,r){if(l&1){let u=N();c(0,"button",15),C("click",function(){b(u);let i=g().ngIf,e=g();return P(e.onUpdateItems(i))}),U(1,"i",16),_(2," Update "),p()}}function me(l,r){if(l&1&&(c(0,"actions")(1,"div",13),I(2,ue,3,0,"button",14),p()()),l&2){let u=r.ngIf,t=g();h(2),d("ngIf",t.productService.hasSelectionVariant(u))}}function ge(l,r){l&1&&H(0)}function Ce(l,r){if(l&1){let u=N();G(0),c(1,"app-table",17),C("onToggle",function(i){b(u);let e=g();return P(e.onShowDifferenceStock(i))})("onSubmit",function(i){b(u);let e=g();return P(e.updateStockByVariant(i))}),p(),W()}if(l&2){let u=r.ngIf,t=g();h(),d("data",u)("channel",t.channels())("showProductToggle",!0)("hiddenIPOSInventory",t.searchFilter.HiddenIPOSInventory)}}var $e=(()=>{let r=class r{constructor(t,i,e,n,a,o){this.http=t,this.toastr=i,this.dialog=e,this.productService=n,this.authService=a,this.mainPanelService=o,this.paginationService=S(V),this.multiChannelService=S(O),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=w([]),this.selectedChannels=w([]),this.channels=w([]),this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:F.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>D.isValidGUID(n.id)==!1),e=t.filter(n=>D.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(e)}onSearch(t){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,i){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let n=[];e.forEach(s=>{s.Channel?.forEach(f=>{n.push({ID:s.ID,Code:s.Code,Inventory:s.Inventory,LocationID:f.LocationID})})});let o={ListChannelID:i.filter(s=>s.selected).map(s=>s.ID),List:n};this.http.post("/api/Inventory/UpdateChannel",o).subscribe(s=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku,LocationID:t.LocationID};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(e=>{this.paginationService.reloadPagination(this.searchFilter);let n=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+n.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=F.DIFFERENCE:this.searchFilter.filterModel=F.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let i=this.productService.selectedVariantProduct(t),e=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(se,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(e))},width:"600px"}).afterClosed().pipe(B(n=>D.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}};r.\u0275fac=function(i){return new(i||r)(m(ne),m(te),m(ie),m(le),m(M),m(ae))},r.\u0275cmp=A({type:r,selectors:[["app-multi-channel-comparison"]],standalone:!0,features:[z([V,O]),$],decls:26,vars:22,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","pageData","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,e){i&1&&(c(0,"mainpanel",0),C("onSubmit",function(a){return e.onSearch(a)}),I(1,me,3,1,"actions",1),v(2,"async"),c(3,"filters"),I(4,ge,1,0,"ng-container",1),v(5,"async"),c(6,"div")(7,"label",2),_(8,"Channel"),p(),c(9,"multiwarehouse-tree-select",3),C("onChannelChange",function(a){return e.onChannelChange(a)}),p()(),c(10,"div",4)(11,"label",5),_(12,"PageNumber"),p(),c(13,"input",6),E("ngModelChange",function(a){return T(e.searchFilter.PageNumber,a)||(e.searchFilter.PageNumber=a),a}),p()(),c(14,"div",4)(15,"label",7),_(16,"Page Size"),p(),c(17,"input",8),E("ngModelChange",function(a){return T(e.searchFilter.RowCount,a)||(e.searchFilter.RowCount=a),a}),p()()(),c(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),I(22,Ce,2,4,"ng-container",1),v(23,"async"),c(24,"infinite-paginator",12),v(25,"async"),C("onNextPage",function(){return e.paginationService.onNextPage(e.searchFilter)})("onLastPage",function(){return e.paginationService.onLastPage(e.searchFilter)})("onGetRowCount",function(){return e.paginationService.getRowCount(e.searchFilter)}),p()()()()()()),i&2&&(d("pageData",e.pageData)("hideSearchBox",!1),h(),d("ngIf",y(2,14,e.paginationService.data$)),h(3),d("ngIf",y(5,16,e.loader$)),h(5),d("multiple",!0),h(4),L("ngModel",e.searchFilter.PageNumber),h(4),L("ngModel",e.searchFilter.RowCount),h(5),d("ngIf",y(23,18,e.paginationService.data$)),h(2),d("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",y(25,20,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage()))},dependencies:[K,Q,J,re,oe,ce,ee,q,Z,X,Y,pe,he],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let l=r;return l})();export{$e as MultiChannelComparison};
1
+ import{a as he}from"./chunk-HCJ6C5OR.js";import"./chunk-XUSY2QT2.js";import{a as ce}from"./chunk-27TUGWVJ.js";import{a as se}from"./chunk-65RMQ5Q5.js";import{a as F}from"./chunk-XHAXYWZ7.js";import{b as pe,c as V}from"./chunk-MZNSPLFO.js";import"./chunk-BVIRHZTZ.js";import"./chunk-E5BOLHDG.js";import"./chunk-A37OKNC2.js";import"./chunk-ZA7FXMFZ.js";import"./chunk-ZX3SBNZT.js";import"./chunk-2FRMUOJY.js";import"./chunk-C6QIBOCB.js";import{a as le}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import"./chunk-D76K4RZ7.js";import"./chunk-EIBGI6U2.js";import{g as M}from"./chunk-AD73Q5SO.js";import{b as te,e as ne}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{d as ie,l as ae,m as oe,n as re}from"./chunk-4CEFDQPI.js";import"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{c as q,h as X,m as Y,o as Z,y as ee}from"./chunk-2E5AKA74.js";import{c as D}from"./chunk-FTHTFVHH.js";import{$ as j,B,Bc as J,Fc as K,Ja as h,Jb as _,Ka as m,Nb as L,Ob as T,Pb as E,Qb as z,Rb as $,Va as w,X as k,_a as I,ab as d,ac as v,bc as y,da as S,ga as A,mb as c,nb as p,oa as b,ob as U,pa as P,pb as G,qb as W,rb as H,sb as N,vb as C,xb as g,yc as Q}from"./chunk-ZIZWZZ4E.js";import{a as R,b as x}from"./chunk-GNOSNGXM.js";var O=(()=>{let r=class r{constructor(){this.authService=S(M),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(t,i){let e=Object.assign([],this.channelOptions),n=[],a;return t.forEach(o=>{a=e.find(s=>s.ID==o?.parent?.id),a&&(a=x(R({},a),{Name:`${o?.parent?.label} - ${o?.label}`,LocationID:o?.id}),n.push(a))}),i.forEach(o=>{a=e.find(s=>s.ID==o.id),a&&n.push(a)}),n}generateFilterLocation(t,i){let e=[],n=[],a=[];return t.length>0?(e=t.map(o=>o.id),n=t.map(o=>o.parent.id).filter((o,s,f)=>f.indexOf(o)===s)):(e=[],n=[]),a=i.map(o=>o.id),a=a.concat(n).filter((o,s,f)=>f.indexOf(o)===s),{locationIds:e,channelIds:a}}};r.\u0275fac=function(i){return new(i||r)},r.\u0275prov=j({token:r,factory:r.\u0275fac});let l=r;return l})();function ue(l,r){if(l&1){let u=N();c(0,"button",15),C("click",function(){b(u);let i=g().ngIf,e=g();return P(e.onUpdateItems(i))}),U(1,"i",16),_(2," Update "),p()}}function me(l,r){if(l&1&&(c(0,"actions")(1,"div",13),I(2,ue,3,0,"button",14),p()()),l&2){let u=r.ngIf,t=g();h(2),d("ngIf",t.productService.hasSelectionVariant(u))}}function ge(l,r){l&1&&H(0)}function Ce(l,r){if(l&1){let u=N();G(0),c(1,"app-table",17),C("onToggle",function(i){b(u);let e=g();return P(e.onShowDifferenceStock(i))})("onSubmit",function(i){b(u);let e=g();return P(e.updateStockByVariant(i))}),p(),W()}if(l&2){let u=r.ngIf,t=g();h(),d("data",u)("channel",t.channels())("showProductToggle",!0)("hiddenIPOSInventory",t.searchFilter.HiddenIPOSInventory)}}var $e=(()=>{let r=class r{constructor(t,i,e,n,a,o){this.http=t,this.toastr=i,this.dialog=e,this.productService=n,this.authService=a,this.mainPanelService=o,this.paginationService=S(V),this.multiChannelService=S(O),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=w([]),this.selectedChannels=w([]),this.channels=w([]),this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:F.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>D.isValidGUID(n.id)==!1),e=t.filter(n=>D.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(e)}onSearch(t){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,i){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let n=[];e.forEach(s=>{s.Channel?.forEach(f=>{n.push({ID:s.ID,Code:s.Code,Inventory:s.Inventory,LocationID:f.LocationID})})});let o={ListChannelID:i.filter(s=>s.selected).map(s=>s.ID),List:n};this.http.post("/api/Inventory/UpdateChannel",o).subscribe(s=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku,LocationID:t.LocationID};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(e=>{this.paginationService.reloadPagination(this.searchFilter);let n=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+n.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=F.DIFFERENCE:this.searchFilter.filterModel=F.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let i=this.productService.selectedVariantProduct(t),e=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(se,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(e))},width:"600px"}).afterClosed().pipe(B(n=>D.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}};r.\u0275fac=function(i){return new(i||r)(m(ne),m(te),m(ie),m(le),m(M),m(ae))},r.\u0275cmp=A({type:r,selectors:[["app-multi-channel-comparison"]],standalone:!0,features:[z([V,O]),$],decls:26,vars:22,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","pageData","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,e){i&1&&(c(0,"mainpanel",0),C("onSubmit",function(a){return e.onSearch(a)}),I(1,me,3,1,"actions",1),v(2,"async"),c(3,"filters"),I(4,ge,1,0,"ng-container",1),v(5,"async"),c(6,"div")(7,"label",2),_(8,"Channel"),p(),c(9,"multiwarehouse-tree-select",3),C("onChannelChange",function(a){return e.onChannelChange(a)}),p()(),c(10,"div",4)(11,"label",5),_(12,"PageNumber"),p(),c(13,"input",6),E("ngModelChange",function(a){return T(e.searchFilter.PageNumber,a)||(e.searchFilter.PageNumber=a),a}),p()(),c(14,"div",4)(15,"label",7),_(16,"Page Size"),p(),c(17,"input",8),E("ngModelChange",function(a){return T(e.searchFilter.RowCount,a)||(e.searchFilter.RowCount=a),a}),p()()(),c(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),I(22,Ce,2,4,"ng-container",1),v(23,"async"),c(24,"infinite-paginator",12),v(25,"async"),C("onNextPage",function(){return e.paginationService.onNextPage(e.searchFilter)})("onLastPage",function(){return e.paginationService.onLastPage(e.searchFilter)})("onGetRowCount",function(){return e.paginationService.getRowCount(e.searchFilter)}),p()()()()()()),i&2&&(d("pageData",e.pageData)("hideSearchBox",!1),h(),d("ngIf",y(2,14,e.paginationService.data$)),h(3),d("ngIf",y(5,16,e.loader$)),h(5),d("multiple",!0),h(4),L("ngModel",e.searchFilter.PageNumber),h(4),L("ngModel",e.searchFilter.RowCount),h(5),d("ngIf",y(23,18,e.paginationService.data$)),h(2),d("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",y(25,20,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage()))},dependencies:[K,Q,J,re,oe,ce,ee,q,Z,X,Y,pe,he],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let l=r;return l})();export{$e as MultiChannelComparison};
@@ -1 +1 @@
1
- import{a as he}from"./chunk-MZNSPLFO.js";import{a as oe}from"./chunk-BVIRHZTZ.js";import{a as fe}from"./chunk-E5BOLHDG.js";import{a as xe,b as Ce}from"./chunk-A37OKNC2.js";import{c as ue}from"./chunk-DYLT6RRK.js";import{a as ge}from"./chunk-D76K4RZ7.js";import{g as de}from"./chunk-EIBGI6U2.js";import{g as ce}from"./chunk-LAQL3BQZ.js";import{d as pe,g as se}from"./chunk-4CEFDQPI.js";import{t as _e,u as me}from"./chunk-2SC3HO66.js";import{b as ee,h as te,m as ne,y as ie}from"./chunk-2E5AKA74.js";import{c as re,e as le,f as ae}from"./chunk-FTHTFVHH.js";import{Ab as H,Ac as G,Ec as J,Fc as Q,Ha as v,Ib as b,Ja as a,Jb as s,Ka as F,Kb as k,Lb as S,Nb as O,Ob as D,Pb as N,Rb as Z,Tb as T,V as z,_a as p,ab as m,ac as $,bc as j,c as W,cc as q,dc as y,ga as A,hb as P,ib as E,kb as M,lb as V,mb as c,nb as _,oa as g,ob as I,pa as u,pb as x,qb as C,rb as R,sb as f,vb as h,vc as K,xa as B,xb as r,xc as X,yc as Y,za as U}from"./chunk-ZIZWZZ4E.js";var L=t=>[t],Te=t=>({"text-decoration-line-through":t}),be=t=>({"ms-10":t}),Se=t=>({"bg-gradient-warning":t});function ve(t,l){if(t&1){let n=f();c(0,"mat-slide-toggle",13),h("toggleChange",function(){g(n);let e=r();return e.toggleStatus=!e.toggleStatus,u(e.onToggle())}),c(1,"small",14),s(2),_()()}if(t&2){let n=r();a(2),S(" ",n.productToggleTitle?n.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Ie(t,l){if(t&1){let n=f();c(0,"th")(1,"input",16),N("ngModelChange",function(e){g(n);let o=r(2);return D(o.checkboxState,e)||(o.checkboxState=e),u(e)}),h("ngModelChange",function(){g(n);let e=r(2);return u(e.onCheckboxStateChange())}),_()()}if(t&2){let n=r(2);a(),O("ngModel",n.checkboxState)}}function ye(t,l){if(t&1&&(p(0,Ie,2,1,"ng-template",15),c(1,"th",11),s(2,"POS"),_()),t&2){let n=r();m("ngxPermissionsOnly",T(1,L,n.rolePriceEdit))}}function we(t,l){if(t&1&&(x(0),c(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),c(5,"div",21),s(6),$(7,"stringLimit"),_()()()(),C()),t&2){let n=l.$implicit;a(3),m("matTooltip",(n.Name==null?null:n.Name.length)>20?n.Name:""),a(),m("src",n==null?null:n.Img,v),a(2),S(" ",q(7,3,n.Name,20)," ")}}function Fe(t,l){t&1&&R(0)}function Pe(t,l){if(t&1&&(x(0),p(1,Fe,1,0,"ng-container",34),C()),t&2){r();let n=b(7);a(),m("ngTemplateOutlet",n)}}function Ee(t,l){t&1&&R(0)}function Me(t,l){if(t&1&&p(0,Ee,1,0,"ng-container",34),t&2){r(2);let n=b(7);m("ngTemplateOutlet",n)}}function Ve(t,l){if(t&1&&p(0,Me,1,1,"ng-template",15),t&2){let n=r(4);m("ngxPermissionsOnly",T(1,L,n.rolePriceEdit))}}function ke(t,l){if(t&1){let n=f();x(0),c(1,"input",35),N("ngModelChange",function(e){g(n);let o=r(4).$implicit;return D(o.selected,e)||(o.selected=e),u(e)}),h("ngModelChange",function(){g(n);let e=r(4).$implicit,o=r();return u(o.onCheckboxStateProduct(e.ID))}),_(),C()}if(t&2){let n=r(4).$implicit;a(),O("ngModel",n.selected)}}function Oe(t,l){if(t&1&&p(0,ke,2,1,"ng-container",22),t&2){let n=r(3).$implicit;m("ngIf",(n==null||n.Variants==null?null:n.Variants.length)>1)}}function De(t,l){if(t&1){let n=f();x(0),c(1,"img",36),h("click",function(e){g(n);let o=r(3).$implicit,d=r();return u(d.onZoomImage(e,o==null?null:o.ImageUrl))}),_(),C()}if(t&2){let n=r(3).$implicit;a(),H("src",n==null?null:n.ThumbnailUrl,v)}}function Ne(t,l){t&1&&I(0,"img",37)}function $e(t,l){if(t&1&&(x(0),c(1,"td",29)(2,"div",30),p(3,Pe,2,1,"ng-container",31)(4,Ve,1,3,"ng-template",null,0,y)(6,Oe,1,1,"ng-template",null,1,y),c(8,"div",26),p(9,De,2,1,"ng-container",31)(10,Ne,1,0,"ng-template",null,2,y),_()()(),c(12,"td",32)(13,"div"),s(14),_(),c(15,"small",33),s(16),_()(),C()),t&2){let n=b(5),i=b(11),e=r(2).$implicit,o=r();a(),m("rowSpan",e==null?null:e.Variants.length),a(2),m("ngIf",o.table=="inventory")("ngIfElse",n),a(5),m("ngClass",T(9,be,(e==null||e.Variants==null?null:e.Variants.length)<=1)),a(),m("ngIf",e==null?null:e.ThumbnailUrl)("ngIfElse",i),a(3),m("rowSpan",e==null?null:e.Variants.length),a(2),k(e==null?null:e.Name),a(2),S("(",e==null?null:e.Category,")")}}function Be(t,l){if(t&1){let n=f();c(0,"input",16),N("ngModelChange",function(e){g(n);let o=r(3).$implicit;return D(o.selected,e)||(o.selected=e),u(e)}),_()}if(t&2){let n=r(3).$implicit;O("ngModel",n.selected)}}function Ue(t,l){if(t&1&&(c(0,"td",38),p(1,Be,1,1,"input",39),_()),t&2){let n=r(2).$implicit,i=r(2);a(),m("ngIf",i.printPOS(n)>=0||i.table=="price")}}function Re(t,l){if(t&1&&(p(0,Ue,2,1,"ng-template",15),c(1,"td",24),s(2),$(3,"number"),_()),t&2){let n=r().$implicit,i=r(2);m("ngxPermissionsOnly",T(4,L,i.rolePriceEdit)),a(2),k(j(3,2,i.printPOS(n)))}}function je(t,l){if(t&1){let n=f();x(0),c(1,"td",40),h("click",function(){g(n);let e=r().$implicit,o=r().$implicit,d=r().$implicit,w=r();return u(w.openTableDialog(d.Name,o,e.ID,d.ChannelItemID))}),c(2,"div",30)(3,"div",41),s(4),$(5,"number"),_(),c(6,"a",42),h("click",function(e){return g(n),u(e==null?null:e.stopPropagation())}),I(7,"i",28),_()()(),C()}if(t&2){let n=l.$implicit,i=r(2).$implicit,e=r(2);a(),m("ngClass",T(5,Se,e.printPOS(i)!=e.printItem(n)&&e.hiddenIPOSInventory()==!1)),a(3),S(" ",j(5,3,e.printItem(n))," "),a(2),m("href",n.Url,v)}}function Le(t,l){t&1&&(c(0,"td",43)(1,"div",30)(2,"span"),s(3,"X"),_()()())}function We(t,l){if(t&1&&p(0,je,8,7,"ng-container",31)(1,Le,4,0,"ng-template",null,3,y),t&2){let n=l.$implicit,i=b(2),e=r().$implicit,o=r(2);m("ngIf",o.getItemFromChannel(e,n))("ngIfElse",i)}}function ze(t,l){if(t&1&&(c(0,"tr"),p(1,$e,17,11,"ng-container",22),c(2,"td",23),s(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),c(8,"div",21)(9,"a",27),I(10,"i",28),_()()()(),p(11,Re,4,6),M(12,We,3,2,null,null,E),_()),t&2){let n=l.$implicit,i=l.$index,e=r(2);a(),m("ngIf",i==0),a(2),k(n==null?null:n.Model),a(2),m("matTooltip",n.Discontinued?e.discontinuedVariantMsg:""),a(),m("ngClass",T(7,Te,n.Discontinued)),a(),S(" ",n.Code," "),a(2),m("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),v),a(2),P(e.hiddenIPOSInventory()==!1?11:-1),a(),V(e.channel)}}function Ae(t,l){if(t&1&&(c(0,"tbody"),M(1,ze,14,9,"tr",null,E),_()),t&2){let n=l.$implicit;a(),V(n.Variants)}}var ht=(()=>{let l=class l{constructor(i,e,o){this.dialog=i,this.biggerPictureService=e,this.authService=o,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=oe.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.onSubmit=new U,this.destroy$=new W,this.toggle=new U,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(i){let e=this.data.filter(o=>o.ID==i);e.length>0&&(e=e.map(o=>(o.Variants=o.Variants.map(d=>(d.selected=o.selected,d)),o)))}onCheckboxStateChange(){this.data=this.data.map(i=>(i.Variants=i.Variants.map(e=>(e.selected=this.checkboxState,e)),i))}getItemFromChannel(i,e){return i.Channel.find(d=>re.IsNotEmpty(e.LocationID)?d.LocationID==e.LocationID:d.ChannelID==e.ID)}printItem(i){if(this.table=="inventory")return i.Inventory;if(this.table=="price")return i.Price}openTableDialog(i,e,o,d){this.dialog.open(he,{data:{Name:i,Variant:e,ChannelID:o,Table:this.table,ChannelItemID:d}}).afterClosed().pipe(z(this.destroy$)).subscribe(w=>{w!=null&&this.onSubmit.emit(w)})}printPOS(i){return this.table=="inventory"?i.Inventory?i.Inventory:0:this.table=="price"?i.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(i,e){this.biggerPictureService.openBiggerPicture(i,e)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};l.\u0275fac=function(e){return new(e||l)(F(pe),F(ge),F(ce))},l.\u0275cmp=A({type:l,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},standalone:!0,features:[Z],decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["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"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[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"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(e,o){e&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,ve,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),s(10,"Variant"),_(),c(11,"th",11),s(12,"SKU"),_(),p(13,ye,3,3)(14,we,8,6,"ng-container",12),_()(),M(15,Ae,3,0,"tbody",null,E),_()()),e&2&&(a(8),P(o.showProductToggle?8:-1),a(5),P(o.hiddenIPOSInventory()==!1?13:-1),a(),m("ngForOf",o.channel),a(),V(o.data))},dependencies:[Q,K,X,Y,G,J,ie,ee,te,ne,Ce,xe,se,de,ue,ae,le,me,_e,fe],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%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]});let t=l;return t})();export{ht as a};
1
+ import{a as he}from"./chunk-MZNSPLFO.js";import{a as oe}from"./chunk-BVIRHZTZ.js";import{a as fe}from"./chunk-E5BOLHDG.js";import{a as xe,b as Ce}from"./chunk-A37OKNC2.js";import{c as ue}from"./chunk-DYLT6RRK.js";import{a as ge}from"./chunk-D76K4RZ7.js";import{g as de}from"./chunk-EIBGI6U2.js";import{g as ce}from"./chunk-AD73Q5SO.js";import{d as pe,g as se}from"./chunk-4CEFDQPI.js";import{t as _e,u as me}from"./chunk-2SC3HO66.js";import{b as ee,h as te,m as ne,y as ie}from"./chunk-2E5AKA74.js";import{c as re,e as le,f as ae}from"./chunk-FTHTFVHH.js";import{Ab as H,Ac as G,Ec as J,Fc as Q,Ha as v,Ib as b,Ja as a,Jb as s,Ka as F,Kb as k,Lb as S,Nb as O,Ob as D,Pb as N,Rb as Z,Tb as T,V as z,_a as p,ab as m,ac as $,bc as j,c as W,cc as q,dc as y,ga as A,hb as P,ib as E,kb as M,lb as V,mb as c,nb as _,oa as g,ob as I,pa as u,pb as x,qb as C,rb as R,sb as f,vb as h,vc as K,xa as B,xb as r,xc as X,yc as Y,za as U}from"./chunk-ZIZWZZ4E.js";var L=t=>[t],Te=t=>({"text-decoration-line-through":t}),be=t=>({"ms-10":t}),Se=t=>({"bg-gradient-warning":t});function ve(t,l){if(t&1){let n=f();c(0,"mat-slide-toggle",13),h("toggleChange",function(){g(n);let e=r();return e.toggleStatus=!e.toggleStatus,u(e.onToggle())}),c(1,"small",14),s(2),_()()}if(t&2){let n=r();a(2),S(" ",n.productToggleTitle?n.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function Ie(t,l){if(t&1){let n=f();c(0,"th")(1,"input",16),N("ngModelChange",function(e){g(n);let o=r(2);return D(o.checkboxState,e)||(o.checkboxState=e),u(e)}),h("ngModelChange",function(){g(n);let e=r(2);return u(e.onCheckboxStateChange())}),_()()}if(t&2){let n=r(2);a(),O("ngModel",n.checkboxState)}}function ye(t,l){if(t&1&&(p(0,Ie,2,1,"ng-template",15),c(1,"th",11),s(2,"POS"),_()),t&2){let n=r();m("ngxPermissionsOnly",T(1,L,n.rolePriceEdit))}}function we(t,l){if(t&1&&(x(0),c(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),c(5,"div",21),s(6),$(7,"stringLimit"),_()()()(),C()),t&2){let n=l.$implicit;a(3),m("matTooltip",(n.Name==null?null:n.Name.length)>20?n.Name:""),a(),m("src",n==null?null:n.Img,v),a(2),S(" ",q(7,3,n.Name,20)," ")}}function Fe(t,l){t&1&&R(0)}function Pe(t,l){if(t&1&&(x(0),p(1,Fe,1,0,"ng-container",34),C()),t&2){r();let n=b(7);a(),m("ngTemplateOutlet",n)}}function Ee(t,l){t&1&&R(0)}function Me(t,l){if(t&1&&p(0,Ee,1,0,"ng-container",34),t&2){r(2);let n=b(7);m("ngTemplateOutlet",n)}}function Ve(t,l){if(t&1&&p(0,Me,1,1,"ng-template",15),t&2){let n=r(4);m("ngxPermissionsOnly",T(1,L,n.rolePriceEdit))}}function ke(t,l){if(t&1){let n=f();x(0),c(1,"input",35),N("ngModelChange",function(e){g(n);let o=r(4).$implicit;return D(o.selected,e)||(o.selected=e),u(e)}),h("ngModelChange",function(){g(n);let e=r(4).$implicit,o=r();return u(o.onCheckboxStateProduct(e.ID))}),_(),C()}if(t&2){let n=r(4).$implicit;a(),O("ngModel",n.selected)}}function Oe(t,l){if(t&1&&p(0,ke,2,1,"ng-container",22),t&2){let n=r(3).$implicit;m("ngIf",(n==null||n.Variants==null?null:n.Variants.length)>1)}}function De(t,l){if(t&1){let n=f();x(0),c(1,"img",36),h("click",function(e){g(n);let o=r(3).$implicit,d=r();return u(d.onZoomImage(e,o==null?null:o.ImageUrl))}),_(),C()}if(t&2){let n=r(3).$implicit;a(),H("src",n==null?null:n.ThumbnailUrl,v)}}function Ne(t,l){t&1&&I(0,"img",37)}function $e(t,l){if(t&1&&(x(0),c(1,"td",29)(2,"div",30),p(3,Pe,2,1,"ng-container",31)(4,Ve,1,3,"ng-template",null,0,y)(6,Oe,1,1,"ng-template",null,1,y),c(8,"div",26),p(9,De,2,1,"ng-container",31)(10,Ne,1,0,"ng-template",null,2,y),_()()(),c(12,"td",32)(13,"div"),s(14),_(),c(15,"small",33),s(16),_()(),C()),t&2){let n=b(5),i=b(11),e=r(2).$implicit,o=r();a(),m("rowSpan",e==null?null:e.Variants.length),a(2),m("ngIf",o.table=="inventory")("ngIfElse",n),a(5),m("ngClass",T(9,be,(e==null||e.Variants==null?null:e.Variants.length)<=1)),a(),m("ngIf",e==null?null:e.ThumbnailUrl)("ngIfElse",i),a(3),m("rowSpan",e==null?null:e.Variants.length),a(2),k(e==null?null:e.Name),a(2),S("(",e==null?null:e.Category,")")}}function Be(t,l){if(t&1){let n=f();c(0,"input",16),N("ngModelChange",function(e){g(n);let o=r(3).$implicit;return D(o.selected,e)||(o.selected=e),u(e)}),_()}if(t&2){let n=r(3).$implicit;O("ngModel",n.selected)}}function Ue(t,l){if(t&1&&(c(0,"td",38),p(1,Be,1,1,"input",39),_()),t&2){let n=r(2).$implicit,i=r(2);a(),m("ngIf",i.printPOS(n)>=0||i.table=="price")}}function Re(t,l){if(t&1&&(p(0,Ue,2,1,"ng-template",15),c(1,"td",24),s(2),$(3,"number"),_()),t&2){let n=r().$implicit,i=r(2);m("ngxPermissionsOnly",T(4,L,i.rolePriceEdit)),a(2),k(j(3,2,i.printPOS(n)))}}function je(t,l){if(t&1){let n=f();x(0),c(1,"td",40),h("click",function(){g(n);let e=r().$implicit,o=r().$implicit,d=r().$implicit,w=r();return u(w.openTableDialog(d.Name,o,e.ID,d.ChannelItemID))}),c(2,"div",30)(3,"div",41),s(4),$(5,"number"),_(),c(6,"a",42),h("click",function(e){return g(n),u(e==null?null:e.stopPropagation())}),I(7,"i",28),_()()(),C()}if(t&2){let n=l.$implicit,i=r(2).$implicit,e=r(2);a(),m("ngClass",T(5,Se,e.printPOS(i)!=e.printItem(n)&&e.hiddenIPOSInventory()==!1)),a(3),S(" ",j(5,3,e.printItem(n))," "),a(2),m("href",n.Url,v)}}function Le(t,l){t&1&&(c(0,"td",43)(1,"div",30)(2,"span"),s(3,"X"),_()()())}function We(t,l){if(t&1&&p(0,je,8,7,"ng-container",31)(1,Le,4,0,"ng-template",null,3,y),t&2){let n=l.$implicit,i=b(2),e=r().$implicit,o=r(2);m("ngIf",o.getItemFromChannel(e,n))("ngIfElse",i)}}function ze(t,l){if(t&1&&(c(0,"tr"),p(1,$e,17,11,"ng-container",22),c(2,"td",23),s(3),_(),c(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),c(8,"div",21)(9,"a",27),I(10,"i",28),_()()()(),p(11,Re,4,6),M(12,We,3,2,null,null,E),_()),t&2){let n=l.$implicit,i=l.$index,e=r(2);a(),m("ngIf",i==0),a(2),k(n==null?null:n.Model),a(2),m("matTooltip",n.Discontinued?e.discontinuedVariantMsg:""),a(),m("ngClass",T(7,Te,n.Discontinued)),a(),S(" ",n.Code," "),a(2),m("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),v),a(2),P(e.hiddenIPOSInventory()==!1?11:-1),a(),V(e.channel)}}function Ae(t,l){if(t&1&&(c(0,"tbody"),M(1,ze,14,9,"tr",null,E),_()),t&2){let n=l.$implicit;a(),V(n.Variants)}}var ht=(()=>{let l=class l{constructor(i,e,o){this.dialog=i,this.biggerPictureService=e,this.authService=o,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=oe.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.onSubmit=new U,this.destroy$=new W,this.toggle=new U,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(i){let e=this.data.filter(o=>o.ID==i);e.length>0&&(e=e.map(o=>(o.Variants=o.Variants.map(d=>(d.selected=o.selected,d)),o)))}onCheckboxStateChange(){this.data=this.data.map(i=>(i.Variants=i.Variants.map(e=>(e.selected=this.checkboxState,e)),i))}getItemFromChannel(i,e){return i.Channel.find(d=>re.IsNotEmpty(e.LocationID)?d.LocationID==e.LocationID:d.ChannelID==e.ID)}printItem(i){if(this.table=="inventory")return i.Inventory;if(this.table=="price")return i.Price}openTableDialog(i,e,o,d){this.dialog.open(he,{data:{Name:i,Variant:e,ChannelID:o,Table:this.table,ChannelItemID:d}}).afterClosed().pipe(z(this.destroy$)).subscribe(w=>{w!=null&&this.onSubmit.emit(w)})}printPOS(i){return this.table=="inventory"?i.Inventory?i.Inventory:0:this.table=="price"?i.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(i,e){this.biggerPictureService.openBiggerPicture(i,e)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};l.\u0275fac=function(e){return new(e||l)(F(pe),F(ge),F(ce))},l.\u0275cmp=A({type:l,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},standalone:!0,features:[Z],decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["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"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[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"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(e,o){e&1&&(c(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,ve,3,1,"mat-slide-toggle",9),_()(),c(9,"th",10),s(10,"Variant"),_(),c(11,"th",11),s(12,"SKU"),_(),p(13,ye,3,3)(14,we,8,6,"ng-container",12),_()(),M(15,Ae,3,0,"tbody",null,E),_()()),e&2&&(a(8),P(o.showProductToggle?8:-1),a(5),P(o.hiddenIPOSInventory()==!1?13:-1),a(),m("ngForOf",o.channel),a(),V(o.data))},dependencies:[Q,K,X,Y,G,J,ie,ee,te,ne,Ce,xe,se,de,ue,ae,le,me,_e,fe],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%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]});let t=l;return t})();export{ht as a};