marketplacepos 3.7.0 → 3.7.1

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 (71) hide show
  1. package/Marketplace/{chunk-T3S6OSUW.js → chunk-27MFG2V3.js} +1 -1
  2. package/Marketplace/{chunk-FAA5MCE6.js → chunk-3IE75VB2.js} +1 -1
  3. package/Marketplace/{chunk-GMQAKOAO.js → chunk-3TBUXGN2.js} +1 -1
  4. package/Marketplace/{chunk-RHSQYTCN.js → chunk-3XIO5MXN.js} +1 -1
  5. package/Marketplace/{chunk-7H5NOLAT.js → chunk-3Z7G7454.js} +2 -2
  6. package/Marketplace/{chunk-PT4HB4BE.js → chunk-6JZXM3Z4.js} +1 -1
  7. package/Marketplace/{chunk-7Q467LQU.js → chunk-6TDCWPXI.js} +1 -1
  8. package/Marketplace/{chunk-ZXG2LRR7.js → chunk-AMNHDM4A.js} +1 -1
  9. package/Marketplace/{chunk-PKV2MX2V.js → chunk-AWF36NII.js} +1 -1
  10. package/Marketplace/{chunk-B56SMRKB.js → chunk-AZ6WKDZE.js} +1 -1
  11. package/Marketplace/{chunk-6P6N5MPR.js → chunk-BAHS6OIP.js} +1 -1
  12. package/Marketplace/{chunk-UF6UXQ4F.js → chunk-BQZT7VC6.js} +1 -1
  13. package/Marketplace/{chunk-BWB3YEE3.js → chunk-BRQEPBAV.js} +1 -1
  14. package/Marketplace/chunk-BVOYXTEO.js +1 -0
  15. package/Marketplace/{chunk-IMCK7CZA.js → chunk-C5OKI7IN.js} +1 -1
  16. package/Marketplace/{chunk-YCOV6QF3.js → chunk-C6CRAPMP.js} +1 -1
  17. package/Marketplace/{chunk-6JUG64XK.js → chunk-CEIPUO3T.js} +1 -1
  18. package/Marketplace/{chunk-PGQNQRSE.js → chunk-DQ556KMX.js} +1 -1
  19. package/Marketplace/{chunk-WO5J2KLB.js → chunk-E5IYLHFK.js} +1 -1
  20. package/Marketplace/{chunk-NLLDIBGQ.js → chunk-EAPYNH2I.js} +1 -1
  21. package/Marketplace/{chunk-V6WGN4CJ.js → chunk-EB34X6M5.js} +1 -1
  22. package/Marketplace/{chunk-DWRODF4P.js → chunk-EDYL25D7.js} +1 -1
  23. package/Marketplace/{chunk-AIE4RSCM.js → chunk-F46K5N6V.js} +1 -1
  24. package/Marketplace/{chunk-XYLU3LCF.js → chunk-F66WSMGF.js} +1 -1
  25. package/Marketplace/{chunk-PEDSV4QH.js → chunk-FHTEX4VI.js} +1 -1
  26. package/Marketplace/{chunk-M6EV5O6B.js → chunk-HNFHD5DZ.js} +1 -1
  27. package/Marketplace/{chunk-N3MNWSYS.js → chunk-IXKXSEUO.js} +1 -1
  28. package/Marketplace/{chunk-PC3GKHB7.js → chunk-JJJFKCNJ.js} +1 -1
  29. package/Marketplace/{chunk-4ALKGSNS.js → chunk-K4EYVQBL.js} +1 -1
  30. package/Marketplace/{chunk-LW37VJAD.js → chunk-LZWVYHLU.js} +1 -1
  31. package/Marketplace/{chunk-3CJHQAXO.js → chunk-NGBU7BOS.js} +1 -1
  32. package/Marketplace/{chunk-FJ6DK2PY.js → chunk-NMVME7V7.js} +1 -1
  33. package/Marketplace/{chunk-D6U7F3FE.js → chunk-P6UO6DX3.js} +1 -1
  34. package/Marketplace/{chunk-QIPOMN5U.js → chunk-P7VJZQDH.js} +1 -1
  35. package/Marketplace/{chunk-ZKEOQVK3.js → chunk-PEA3QZNR.js} +1 -1
  36. package/Marketplace/{chunk-SRFXQR3O.js → chunk-PFWK7DXX.js} +1 -1
  37. package/Marketplace/{chunk-OHJBV2SP.js → chunk-PPMANECT.js} +1 -1
  38. package/Marketplace/{chunk-WHDLWSC7.js → chunk-Q3PNFN2P.js} +1 -1
  39. package/Marketplace/chunk-QBGUD5XV.js +1 -0
  40. package/Marketplace/{chunk-OCQGU4XF.js → chunk-QK6IV4IN.js} +1 -1
  41. package/Marketplace/{chunk-4ARMBRYZ.js → chunk-RW3P47SS.js} +1 -1
  42. package/Marketplace/{chunk-5X5XYEG7.js → chunk-S4OY7WNR.js} +1 -1
  43. package/Marketplace/{chunk-6UISEE6K.js → chunk-SFRVPZY5.js} +1 -1
  44. package/Marketplace/{chunk-7EHMM2RQ.js → chunk-SHE2HRK4.js} +1 -1
  45. package/Marketplace/{chunk-UUWXBTMC.js → chunk-SXEG2MLM.js} +1 -1
  46. package/Marketplace/{chunk-3UNDP7GV.js → chunk-SZYLETKI.js} +1 -1
  47. package/Marketplace/{chunk-O5TGJGPX.js → chunk-T62ZNA2E.js} +1 -1
  48. package/Marketplace/{chunk-C4WLCPS5.js → chunk-UJUFXSVW.js} +1 -1
  49. package/Marketplace/{chunk-WJX6E5SF.js → chunk-URMO6FUH.js} +1 -1
  50. package/Marketplace/{chunk-6JTRVIZI.js → chunk-UWM3HFZE.js} +1 -1
  51. package/Marketplace/{chunk-ABFPL6TA.js → chunk-V4TOR5C3.js} +1 -1
  52. package/Marketplace/{chunk-C675HTF2.js → chunk-VFVGT6W3.js} +1 -1
  53. package/Marketplace/{chunk-SNCK2FWA.js → chunk-VQFVU45K.js} +1 -1
  54. package/Marketplace/{chunk-FCRIZ226.js → chunk-WCDKR3FP.js} +1 -1
  55. package/Marketplace/{chunk-TCVITRSB.js → chunk-WJEQNHXJ.js} +1 -1
  56. package/Marketplace/{chunk-VW7ZPKO3.js → chunk-XA3H6AG7.js} +1 -1
  57. package/Marketplace/{chunk-SW4RH2OZ.js → chunk-XQLF7ESA.js} +1 -1
  58. package/Marketplace/{chunk-MNORCZ5U.js → chunk-Y5KDY32S.js} +1 -1
  59. package/Marketplace/{chunk-NUN457A7.js → chunk-YBKLOXGJ.js} +1 -1
  60. package/Marketplace/{chunk-3UHMSDZV.js → chunk-YZ2MT7MV.js} +1 -1
  61. package/Marketplace/index.html +2 -2
  62. package/Marketplace/{main-X7AMGDRI.js → main-RAPO7M6B.js} +1 -1
  63. package/Marketplace/{styles-QFHBM646.css → styles-BYB6Q4RC.css} +1 -1
  64. package/package.json +1 -1
  65. package/Marketplace/chunk-RJGQ3L4V.js +0 -1
  66. package/Marketplace/chunk-YMDCJACA.js +0 -1
  67. /package/Marketplace/{chunk-HET33HC6.js → chunk-JC2XATFG.js} +0 -0
  68. /package/Marketplace/{chunk-DZ4C4BLL.js → chunk-RMAUQHGQ.js} +0 -0
  69. /package/Marketplace/{chunk-BBHP36L3.js → chunk-UFDVDRIL.js} +0 -0
  70. /package/Marketplace/{chunk-WAAT6CHK.js → chunk-VNDEHKWX.js} +0 -0
  71. /package/Marketplace/{polyfills-34NMXNBT.js → polyfills-IC53TUFL.js} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as V,b as Me,c as Ve,d as ae,e as oe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-6P6N5MPR.js";import{a as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-WHDLWSC7.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-3UNDP7GV.js";import{a as De,b as Ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-O5TGJGPX.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-WAAT6CHK.js";import{a as ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-UF6UXQ4F.js";import{a as te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-FCRIZ226.js";import{a as ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-N3MNWSYS.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-LW37VJAD.js";import{a as be,b as Ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-DWRODF4P.js";import{e as q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-7H5NOLAT.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-D6U7F3FE.js";import{b as Q,e as H}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-3CJHQAXO.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-XYLU3LCF.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-C4WLCPS5.js";import{a as we}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-IMCK7CZA.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-AIE4RSCM.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-UUWXBTMC.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-GMQAKOAO.js";import{a as fe,c as xe,d as Se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-6JUG64XK.js";import{a as se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-ZKEOQVK3.js";import{B as ee,C as ye,q as W,r as ve,u as X}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-ZXG2LRR7.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-6UISEE6K.js";import{b as ge,c as K,h as J,k as Y,m as Z,u as Ce}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-ABFPL6TA.js";import{c as T}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-BBHP36L3.js";import{$a as x,B as P,Cb as f,Db as S,Eb as L,Fa as s,Ga as y,Hc as he,Lb as R,Lc as G,Oa as c,Ua as u,X as N,Xb as de,Za as l,Zb as _e,_a as r,_b as $,aa as B,ab as I,bb as w,bc as U,cc as ue,db as v,ea as F,ec as j,fa as O,fc as z,hb as h,ja as d,jb as p,ka as _,mb as pe,ob as A,pb as m,q as ce,qb as E,rb as b,sb as me,wb as re,za as k}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-FAA5MCE6.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.0/Marketplace/chunk-HET33HC6.js";var Pe=(()=>{let o=class o{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=F({type:o,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,a){n&1&&(l(0,"nav",0)(1,"div",1)(2,"div"),x(3,"nav-tab",2),r()()(),x(4,"router-outlet")),n&2&&(s(3),c("Tabs",a.inventoryTabs))},dependencies:[he,be]});let i=o;return i})();function Ge(i,o){if(i&1){let e=v();l(0,"button",22),h("click",function(){d(e);let n=p(3);return _(n.openScanDialog())}),x(1,"i",23),m(2," Scan Channel "),r()}}function Ke(i,o){if(i&1){let e=v();l(0,"button",24),h("click",function(){d(e);let n=p().ngIf,a=p(2);return _(a.onUpdateItems(n))}),x(1,"i",25),m(2," Update "),r()}}function Je(i,o){if(i&1&&(l(0,"actions")(1,"div",19)(2,"div"),u(3,Ge,3,0,"button",20)(4,Ke,3,0,"button",21),r()()()),i&2){let e=o.ngIf,t=p(2);s(3),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function Ye(i,o){if(i&1){let e=v();l(0,"app-table",26),h("onToggle",function(n){d(e);let a=p(2);return _(a.onShowDifferenceStock(n))})("onSubmit",function(n){let g=d(e).ngIf,C=p(2);return _(C.updateStockByVariant(n,g))}),r()}if(i&2){let e=o.ngIf,t=p(2);c("data",e)("channel",t.channelOptions)("showProductToggle",!0)("filter",t.searchFilter)}}function Ze(i,o){if(i&1){let e=v();l(0,"span",27),h("click",function(){d(e);let n=p(2);return _(n.getRowCount())}),l(1,"i",28),m(2,"?"),r()()}}function qe(i,o){if(i&1&&(l(0,"span"),m(1),f(2,"number"),r()),i&2){let e=o.ngIf;s(1),E(S(2,1,e))}}function We(i,o){if(i&1){let e=v();l(0,"a",29),h("click",function(){d(e);let n=p(2);return _(n.nextPage())}),x(1,"i",30),m(2," Next"),r()}}function Xe(i,o){if(i&1){let e=v();l(0,"a",31),h("click",function(){d(e);let n=p(2);return _(n.getAllData())}),x(1,"i",32),m(2," Last"),r()}}function et(i,o){if(i&1){let e=v();l(0,"mainpanel",1),h("onSubmit",function(n){d(e);let a=p();return _(a.onSearch(n))}),u(1,Je,5,2,"actions",2),f(2,"async"),l(3,"filters")(4,"div")(5,"label",3),m(6,"PageNumber"),r(),l(7,"input",4),h("ngModelChange",function(n){d(e);let a=p();return _(a.searchFilter.PageNumber=n)}),r()(),l(8,"div",5)(9,"label",6),m(10,"Page Size"),r(),l(11,"input",7),h("ngModelChange",function(n){d(e);let a=p();return _(a.searchFilter.RowCount=n)}),r()()(),l(12,"content")(13,"div",8)(14,"div",9)(15,"div",10),u(16,Ye,1,4,"app-table",11),f(17,"async"),I(18),l(19,"div",12)(20,"div",13)(21,"div",14),m(22),f(23,"number"),f(24,"async"),u(25,Ze,3,0,"span",15)(26,qe,3,3,"span",2),f(27,"async"),m(28),r()(),l(29,"div",16),u(30,We,3,0,"a",17)(31,Xe,3,0,"a",18),r()(),w(),r()()()()()}if(i&2){let e=p(),t;c("pageData",e.pageData)("hideSearchBox",!1)("textButton","Search"),s(1),c("ngIf",S(2,13,e.paginationService.data$)),s(6),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(5),c("ngIf",S(17,15,e.paginationService.data$)),s(6),b(" Showing 1 - ",S(23,17,(t=S(24,19,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",S(27,21,!e.paginationService.hideCount&&e.allDataCount$)),s(2),b(" records ~ ",e.paginationService.footerPageNumber," Page "),s(2),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}var Fe=(()=>{let o=class o{constructor(t,n,a,g,C,M){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=g,this.productService=C,this.authService=M,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],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.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(N(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:V.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,n){let a=this.productService.selectedVariantProduct(t);if(a.length>0){let C=a.map(D=>({ID:D.ID,Code:D.Code,Inventory:D.Inventory}));var g=n.filter(D=>D.selected).map(D=>D.ID);let M={ListChannelID:g,List:C};this.http.post("/api/Inventory/UpdateChannel",M).subscribe(D=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+M.List.length+" variants in "+M.ListChannelID.length+" channels","Success")})}}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(te,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(P(a=>T.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct),this.initPageLoader()}this.searchFilter.ChannelID=T.GuidEMpty})}updateStockByVariant(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+C.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=V.DIFFERENCE:this.searchFilter.filterModel=V.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let n=this.productService.selectedVariantProduct(t);this.dialog.open(Te,{data:{selectedItems:n,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe(P(a=>T.IsNotEmpty(a))).subscribe(a=>{this.updateStock(t,a)})}getRowCount(){this.paginationService.hideCount=!1;let t={text:this.searchFilter.text};this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,t)}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(H),y(Q),y(X),y(ie),y(ne),y(q))},o.\u0275cmp=F({type:o,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit"],[4,"ngIf"],["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,"ngModel","ngModelChange"],[1,"mt-5"],["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,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary border-start-0","title","Load all products",3,"click",4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(u(0,et,32,23,"mainpanel",0),f(1,"async")),n&2&&c("ngIf",S(1,1,a.loader$))},dependencies:[$,K,Z,J,Y,ee,ae,W,U,j],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();function tt(i,o){if(i&1){let e=v();l(0,"button",41),h("click",function(){d(e);let n=p(3);return _(n.openScanDialog())}),x(1,"i",42),m(2," Scan Channel "),r()}}function nt(i,o){if(i&1){let e=v();l(0,"button",43),h("click",function(){d(e);let n=p().ngIf,a=p(2);return _(a.updateStock(n))}),x(1,"i",44),m(2," Update"),r()}}function it(i,o){if(i&1&&(l(0,"div"),u(1,tt,3,0,"button",39)(2,nt,3,0,"button",40),r()),i&2){let e=o.ngIf,t=p(2);s(1),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function at(i,o){if(i&1&&(l(0,"span",45),x(1,"img",46),r(),m(2)),i&2){let e=o.item;s(1),c("src",e==null?null:e.logo,k),s(1),b(" ",e.Name," ")}}function ot(i,o){i&1&&(l(0,"div",47)(1,"span"),m(2," showing only different stock, please press next to populate more data "),r()())}function lt(i,o){if(i&1){let e=v();l(0,"th")(1,"input",48),h("ngModelChange",function(n){d(e);let a=p(2);return _(a.checkboxState=n)})("ngModelChange",function(){let a=d(e).ngIf,g=p(2);return _(g.onCheckboxStateChange(a))}),r()()}if(i&2){let e=p(2);s(1),c("ngModel",e.checkboxState)}}function rt(i,o){i&1&&(I(0),l(1,"th",49),m(2," Reserved "),r(),w())}function st(i,o){if(i&1){let e=v();l(0,"input",69),h("ngModelChange",function(n){d(e);let a=p(3).$implicit;return _(a.selected=n)})("ngModelChange",function(){d(e);let n=p(3).$implicit,a=p(2);return _(a.onCheckboxStateProduct(n))}),r()}if(i&2){let e=p(3).$implicit;c("ngModel",e.selected)}}function ct(i,o){if(i&1){let e=v();l(0,"img",70),h("click",function(n){d(e);let a=p(3).$implicit,g=p(2);return _(g.onZoomImage(n,a==null?null:a.ImageUrl))}),r()}if(i&2){let e=p(3).$implicit;pe("src",e==null?null:e.ThumbnailUrl,k)}}function pt(i,o){i&1&&x(0,"img",71)}function mt(i,o){if(i&1&&(I(0),x(1,"br"),l(2,"div",72),x(3,"i",73),l(4,"small"),m(5),r()(),w()),i&2){let e=p(3).$implicit;s(5),b("(",e==null?null:e.Category,")")}}function dt(i,o){if(i&1&&(I(0),l(1,"td",63)(2,"div",13),u(3,st,1,1,"input",64)(4,ct,1,1,"img",65)(5,pt,1,0,"ng-template",null,66,R),r()(),l(7,"td",67)(8,"span",68),m(9),r(),u(10,mt,6,1,"ng-container",3),r(),w()),i&2){let e=A(6),t=p().$implicit,n=p().$implicit,a=p(2);s(1),c("rowSpan",n==null?null:n.Variants.length),s(2),c("ngIf",(t==null?null:t.Inventory)>=0||n.Variants.length>1),s(1),c("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",e),s(3),c("rowSpan",n==null?null:n.Variants.length),s(2),E(n==null?null:n.Name),s(1),c("ngIf",n.CategoryID!==null&&n.CategoryID!=a.guidEmpty)}}function _t(i,o){if(i&1){let e=v();I(0),l(1,"input",48),h("ngModelChange",function(n){d(e);let a=p(2).$implicit;return _(a.selected=n)}),r(),w()}if(i&2){let e=p(2).$implicit;s(1),c("ngModel",e.selected)}}function ut(i,o){if(i&1&&(I(0),u(1,_t,2,1,"ng-container",3),w()),i&2){let e=p().$implicit;s(1),c("ngIf",(e==null?null:e.Inventory)<=1e5)}}function ht(i,o){if(i&1){let e=v();l(0,"input",48),h("ngModelChange",function(n){d(e);let a=p(2).$implicit;return _(a.selected=n)}),r()}if(i&2){let e=p(2).$implicit;c("ngModel",e.selected)}}function gt(i,o){if(i&1&&u(0,ht,1,1,"input",74),i&2){let e=p().$implicit;c("ngIf",(e==null?null:e.Inventory)>=0)}}function Ct(i,o){i&1&&(l(0,"div",75),m(1,"Not Found"),r())}function ft(i,o){if(i&1&&(l(0,"div")(1,"span",76),m(2),f(3,"number"),r(),m(4," => "),l(5,"span",77),m(6),f(7,"number"),r()()),i&2){let e=p().$implicit;s(2),b(" ",S(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),E(S(7,4,e==null?null:e.Inventory))}}function xt(i,o){if(i&1&&(l(0,"div"),m(1),f(2,"number"),r()),i&2){let e=p().$implicit;s(1),b(" ",S(2,1,e==null?null:e.Inventory)," ")}}function St(i,o){if(i&1&&(I(0),l(1,"div",78)(2,"a",79),x(3,"i",80),r()(),w()),i&2){let e=p().$implicit,t=p(3);s(2),c("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),k)}}var vt=i=>({"bg-gradient-warning":i});function yt(i,o){if(i&1){let e=v();l(0,"td",81)(1,"div",52)(2,"div")(3,"span",82),h("click",function(){d(e);let n=p().$implicit,a=p(),g=a.$implicit,C=a.ngForOf,M=p(2);return _(M.openTableDialog(g,n,C))}),m(4),f(5,"number"),r()(),l(6,"div",78)(7,"a",79),x(8,"i",80),r()()()()}if(i&2){let e=p().$implicit;c("ngClass",re(5,vt,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(4),b(" ",S(5,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," "),s(3),c("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,k)}}function bt(i,o){if(i&1&&(I(0),l(1,"span",85),m(2),f(3,"number"),r(),w()),i&2){let e=p(2).$implicit;s(2),b(" (",S(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function It(i,o){i&1&&m(0," - ")}function wt(i,o){if(i&1&&(I(0),l(1,"td",83),u(2,bt,4,3,"ng-container",55)(3,It,1,0,"ng-template",null,84,R),r(),w()),i&2){let e=A(4),t=p().$implicit;s(2),c("ngIf",t==null||t.Channel[0]==null?null:t.Channel[0].InventoryReserved)("ngIfElse",e)}}function Tt(i,o){i&1&&(I(0),m(1," - "),w())}function Mt(i,o){if(i&1&&(l(0,"span",86),f(1,"date"),m(2),f(3,"date"),r()),i&2){let e=p().$implicit;c("matTooltip",L(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),b(" ",L(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}var Dt=i=>({"text-decoration-line-through":i});function Et(i,o){if(i&1){let e=v();l(0,"tr"),u(1,dt,11,7,"ng-container",3),l(2,"td",50),m(3),r(),l(4,"td",51)(5,"div",52)(6,"span",53),m(7),r()()(),l(8,"td",54),u(9,ut,2,1,"ng-container",55)(10,gt,1,1,"ng-template",null,56,R),r(),l(12,"td")(13,"div",52),u(14,Ct,2,0,"div",57)(15,ft,8,6,"div",3)(16,xt,3,3,"div",3)(17,St,4,1,"ng-container",3),r()(),u(18,yt,9,7,"td",58)(19,wt,5,2,"ng-container",3),l(20,"td",31),u(21,Tt,2,0,"ng-container",55)(22,Mt,4,8,"ng-template",null,59,R),r(),l(24,"td")(25,"div",60)(26,"span",61),h("click",function(){let a=d(e).$implicit,g=p(3);return _(g.refreshInventory(a==null||a.Channel[0]==null?null:a.Channel[0].ChannelItemID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelVariationID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelID,a==null?null:a.ID))}),x(27,"i",62),r()()()()}if(i&2){let e=o.$implicit,t=o.index,n=A(11),a=A(23),g=p(3);s(1),c("ngIf",t==0),s(2),E(e==null?null:e.Model),s(1),c("matTooltip",e.isDiscontinued?g.discontinuedVariantMsg:""),s(2),c("ngClass",re(15,Dt,e.isDiscontinued)),s(1),E(e==null?null:e.Code),s(2),c("ngIf",(e==null?null:e.Channel[0].TypeID)==1)("ngIfElse",n),s(5),c("ngIf",(e==null?null:e.I)==null),s(1),c("ngIf",(e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",(e==null?null:e.I)!=null&&(e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",(e==null?null:e.I)!=null),s(1),c("ngIf",e==null?null:e.Channel),s(1),c("ngIf",g.isShowReservedColumn),s(2),c("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==g.minDate)("ngIfElse",a)}}function Vt(i,o){if(i&1&&(l(0,"tbody"),u(1,Et,28,17,"tr",33),r()),i&2){let e=o.$implicit;s(1),c("ngForOf",e.Variants)}}function Pt(i,o){if(i&1){let e=v();l(0,"span",87),h("click",function(){d(e);let n=p(2);return _(n.getRowCount())}),l(1,"i",88),m(2,"?"),r()()}}function Ft(i,o){if(i&1&&(l(0,"span"),m(1),f(2,"number"),r()),i&2){let e=o.ngIf;s(1),E(S(2,1,e==null?null:e.Total))}}function kt(i,o){if(i&1){let e=v();l(0,"a",92),h("click",function(){d(e);let n=p(3);return _(n.onNextPage())}),x(1,"i",93),m(2," Next"),r()}}function Nt(i,o){if(i&1){let e=v();l(0,"a",94),h("click",function(){d(e);let n=p(3);return _(n.onLastPage())}),x(1,"i",95),m(2," Last"),r()}}function At(i,o){if(i&1&&(l(0,"div",89),u(1,kt,3,0,"a",90)(2,Nt,3,0,"a",91),r()),i&2){let e=p(2);s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}function Rt(i,o){if(i&1){let e=v();l(0,"mainpanel",1),h("onSubmit",function(n){d(e);let a=p();return _(a.onSearch(n))}),l(1,"actions")(2,"div",2),u(3,it,3,2,"div",3),f(4,"async"),r()(),l(5,"filters")(6,"div")(7,"label",4),m(8,"Channel"),r(),l(9,"ng-select",5),h("ngModelChange",function(n){d(e);let a=p();return _(a.searchFilter.ChannelID=n)}),u(10,at,3,2,"ng-template",6),r()(),l(11,"div",7)(12,"label",8),m(13,"PageNumber"),r(),l(14,"input",9),h("ngModelChange",function(n){d(e);let a=p();return _(a.searchFilter.PageNumber=n)}),r()(),l(15,"div",7)(16,"label",10),m(17,"Page Size"),r(),l(18,"input",11),h("ngModelChange",function(n){d(e);let a=p();return _(a.searchFilter.RowCount=n)}),r()(),l(19,"div",7)(20,"label",12),m(21,"Quantity From - To"),r(),l(22,"div",13)(23,"input",14),h("ngModelChange",function(n){d(e);let a=p();return _(a.searchFilter.QuantityFrom=n)}),r(),m(24," - "),l(25,"input",15),h("ngModelChange",function(n){d(e);let a=p();return _(a.searchFilter.QuantityTo=n)}),r()()()(),l(26,"content")(27,"div",16)(28,"div",17)(29,"div",18),u(30,ot,3,0,"div",19),l(31,"table",20)(32,"thead",21)(33,"tr")(34,"th",22),m(35,"Product "),x(36,"br"),l(37,"mat-slide-toggle",23),h("toggleChange",function(){d(e);let n=p();return n.showDifferenceStock=!n.showDifferenceStock,_(n.onShowDifferenceStock())}),l(38,"small",12),m(39,"FILTER DIFFERENT INVENTORY"),r()()(),l(40,"th",24),m(41,"Variant"),r(),l(42,"th",25),m(43,"SKU"),r(),u(44,lt,2,1,"th",3),f(45,"async"),l(46,"th",26),m(47,"POS"),r(),l(48,"th",27)(49,"div",28),x(50,"img",29),l(51,"span",30),m(52),f(53,"stringLimit"),r()()(),u(54,rt,3,0,"ng-container",3),l(55,"th",31),m(56,"Last Sync"),r(),x(57,"th",32),r()(),u(58,Vt,2,1,"tbody",33),f(59,"async"),r(),l(60,"div",34)(61,"div",35)(62,"div",36),m(63),f(64,"number"),f(65,"async"),u(66,Pt,3,0,"span",37)(67,Ft,3,3,"span",3),f(68,"async"),m(69),r()(),u(70,At,3,2,"div",38),f(71,"async"),r()()()()()()}if(i&2){let e=p(),t,n;c("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),s(3),c("ngIf",S(4,24,e.paginationService.data$)),s(6),c("clearable",!1)("items",e.channelOptions)("ngModel",e.searchFilter.ChannelID),s(5),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(5),c("ngModel",e.searchFilter.QuantityFrom),s(2),c("ngModel",e.searchFilter.QuantityTo),s(5),c("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),s(14),c("ngIf",S(45,26,e.paginationService.data$)),s(5),c("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=13?e.selectedChannel==null?null:e.selectedChannel.Name:""),s(1),c("src",e.selectedChannel==null?null:e.selectedChannel.logo,k),s(2),me(" ",L(53,28,e.selectedChannel==null?null:e.selectedChannel.Name,13),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=13?"...":""," "),s(2),c("ngIf",e.isShowReservedColumn),s(4),c("ngForOf",S(59,31,e.products$)),s(5),b(" Showing 1 - ",S(64,33,(t=S(65,35,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",S(68,37,!e.paginationService.hideCount&&e.rowCount$)),s(2),b(" records ~ ",e.paginationService.footerPageNumber," Page "),s(1),c("ngIf",((n=S(71,39,e.paginationService.data$))==null?null:n.length)>0)}}var ke=(()=>{let o=class o{constructor(t,n,a,g,C,M,D,Ae){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=g,this.productService=C,this.authService=M,this.biggerPictureService=D,this.inventoryService=Ae,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=T.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=T.GuidEMpty,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],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.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.paginationService.data$.pipe(ce(t=>(t=t.map(n=>(n.Variants&&(n.Variants=n.Variants.map(a=>(a.isDiscontinued=n.Discontinued=="Yes",a))),n)),t)),N(t=>{this.checkShowReservedColumn(t)}))}checkShowReservedColumn(t){let n=0,a;t.forEach(g=>{a=g.Variants.find(C=>T.IsNotEmpty(C?.Channel[0]?.InventoryReserved)),a&&(n+=1)}),this.isShowReservedColumn=n>0}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe(N(t=>{if(this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.initSelectedChannel(),this.paginationService.reloadPagination(this.searchFilter),!t.Filter.IsMarketplaceAppActive){let n=`Automatic inventory sync disabled.
1
+ import{a as V,b as Me,c as Ve,d as ae,e as oe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-BAHS6OIP.js";import{a as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-Q3PNFN2P.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-SZYLETKI.js";import{a as De,b as Ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-T62ZNA2E.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-VNDEHKWX.js";import{a as ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-BQZT7VC6.js";import{a as te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-WCDKR3FP.js";import{a as ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-IXKXSEUO.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-LZWVYHLU.js";import{a as be,b as Ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-EDYL25D7.js";import{e as q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-3Z7G7454.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-P6UO6DX3.js";import{b as Q,e as H}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-NGBU7BOS.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-F66WSMGF.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-UJUFXSVW.js";import{a as we}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-C5OKI7IN.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-F46K5N6V.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-SXEG2MLM.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-3TBUXGN2.js";import{a as fe,c as xe,d as Se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-CEIPUO3T.js";import{a as se}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-PEA3QZNR.js";import{B as ee,C as ye,q as W,r as ve,u as X}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-AMNHDM4A.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-SFRVPZY5.js";import{b as ge,c as K,h as J,k as Y,m as Z,u as Ce}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-V4TOR5C3.js";import{c as T}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-UFDVDRIL.js";import{$a as x,B as P,Cb as f,Db as S,Eb as L,Fa as s,Ga as y,Hc as he,Lb as R,Lc as G,Oa as c,Ua as u,X as N,Xb as de,Za as l,Zb as _e,_a as r,_b as $,aa as B,ab as I,bb as w,bc as U,cc as ue,db as v,ea as F,ec as j,fa as O,fc as z,hb as h,ja as d,jb as p,ka as _,mb as pe,ob as A,pb as m,q as ce,qb as E,rb as b,sb as me,wb as re,za as k}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-3IE75VB2.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.7.1/Marketplace/chunk-JC2XATFG.js";var Pe=(()=>{let o=class o{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=F({type:o,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,a){n&1&&(l(0,"nav",0)(1,"div",1)(2,"div"),x(3,"nav-tab",2),r()()(),x(4,"router-outlet")),n&2&&(s(3),c("Tabs",a.inventoryTabs))},dependencies:[he,be]});let i=o;return i})();function Ge(i,o){if(i&1){let e=v();l(0,"button",22),h("click",function(){d(e);let n=p(3);return _(n.openScanDialog())}),x(1,"i",23),m(2," Scan Channel "),r()}}function Ke(i,o){if(i&1){let e=v();l(0,"button",24),h("click",function(){d(e);let n=p().ngIf,a=p(2);return _(a.onUpdateItems(n))}),x(1,"i",25),m(2," Update "),r()}}function Je(i,o){if(i&1&&(l(0,"actions")(1,"div",19)(2,"div"),u(3,Ge,3,0,"button",20)(4,Ke,3,0,"button",21),r()()()),i&2){let e=o.ngIf,t=p(2);s(3),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function Ye(i,o){if(i&1){let e=v();l(0,"app-table",26),h("onToggle",function(n){d(e);let a=p(2);return _(a.onShowDifferenceStock(n))})("onSubmit",function(n){let g=d(e).ngIf,C=p(2);return _(C.updateStockByVariant(n,g))}),r()}if(i&2){let e=o.ngIf,t=p(2);c("data",e)("channel",t.channelOptions)("showProductToggle",!0)("filter",t.searchFilter)}}function Ze(i,o){if(i&1){let e=v();l(0,"span",27),h("click",function(){d(e);let n=p(2);return _(n.getRowCount())}),l(1,"i",28),m(2,"?"),r()()}}function qe(i,o){if(i&1&&(l(0,"span"),m(1),f(2,"number"),r()),i&2){let e=o.ngIf;s(1),E(S(2,1,e))}}function We(i,o){if(i&1){let e=v();l(0,"a",29),h("click",function(){d(e);let n=p(2);return _(n.nextPage())}),x(1,"i",30),m(2," Next"),r()}}function Xe(i,o){if(i&1){let e=v();l(0,"a",31),h("click",function(){d(e);let n=p(2);return _(n.getAllData())}),x(1,"i",32),m(2," Last"),r()}}function et(i,o){if(i&1){let e=v();l(0,"mainpanel",1),h("onSubmit",function(n){d(e);let a=p();return _(a.onSearch(n))}),u(1,Je,5,2,"actions",2),f(2,"async"),l(3,"filters")(4,"div")(5,"label",3),m(6,"PageNumber"),r(),l(7,"input",4),h("ngModelChange",function(n){d(e);let a=p();return _(a.searchFilter.PageNumber=n)}),r()(),l(8,"div",5)(9,"label",6),m(10,"Page Size"),r(),l(11,"input",7),h("ngModelChange",function(n){d(e);let a=p();return _(a.searchFilter.RowCount=n)}),r()()(),l(12,"content")(13,"div",8)(14,"div",9)(15,"div",10),u(16,Ye,1,4,"app-table",11),f(17,"async"),I(18),l(19,"div",12)(20,"div",13)(21,"div",14),m(22),f(23,"number"),f(24,"async"),u(25,Ze,3,0,"span",15)(26,qe,3,3,"span",2),f(27,"async"),m(28),r()(),l(29,"div",16),u(30,We,3,0,"a",17)(31,Xe,3,0,"a",18),r()(),w(),r()()()()()}if(i&2){let e=p(),t;c("pageData",e.pageData)("hideSearchBox",!1)("textButton","Search"),s(1),c("ngIf",S(2,13,e.paginationService.data$)),s(6),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(5),c("ngIf",S(17,15,e.paginationService.data$)),s(6),b(" Showing 1 - ",S(23,17,(t=S(24,19,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",S(27,21,!e.paginationService.hideCount&&e.allDataCount$)),s(2),b(" records ~ ",e.paginationService.footerPageNumber," Page "),s(2),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}var Fe=(()=>{let o=class o{constructor(t,n,a,g,C,M){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=g,this.productService=C,this.authService=M,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],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.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(N(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:V.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,n){let a=this.productService.selectedVariantProduct(t);if(a.length>0){let C=a.map(D=>({ID:D.ID,Code:D.Code,Inventory:D.Inventory}));var g=n.filter(D=>D.selected).map(D=>D.ID);let M={ListChannelID:g,List:C};this.http.post("/api/Inventory/UpdateChannel",M).subscribe(D=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+M.List.length+" variants in "+M.ListChannelID.length+" channels","Success")})}}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(te,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(P(a=>T.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scanAll()})}scanAll(){this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct),this.initPageLoader()}this.searchFilter.ChannelID=T.GuidEMpty})}updateStockByVariant(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+C.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=V.DIFFERENCE:this.searchFilter.filterModel=V.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let n=this.productService.selectedVariantProduct(t);this.dialog.open(Te,{data:{selectedItems:n,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe(P(a=>T.IsNotEmpty(a))).subscribe(a=>{this.updateStock(t,a)})}getRowCount(){this.paginationService.hideCount=!1;let t={text:this.searchFilter.text};this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,t)}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(H),y(Q),y(X),y(ie),y(ne),y(q))},o.\u0275cmp=F({type:o,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit"],[4,"ngIf"],["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,"ngModel","ngModelChange"],[1,"mt-5"],["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,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary border-start-0","title","Load all products",3,"click",4,"ngIf"],[1,"d-flex"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(u(0,et,32,23,"mainpanel",0),f(1,"async")),n&2&&c("ngIf",S(1,1,a.loader$))},dependencies:[$,K,Z,J,Y,ee,ae,W,U,j],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();function tt(i,o){if(i&1){let e=v();l(0,"button",41),h("click",function(){d(e);let n=p(3);return _(n.openScanDialog())}),x(1,"i",42),m(2," Scan Channel "),r()}}function nt(i,o){if(i&1){let e=v();l(0,"button",43),h("click",function(){d(e);let n=p().ngIf,a=p(2);return _(a.updateStock(n))}),x(1,"i",44),m(2," Update"),r()}}function it(i,o){if(i&1&&(l(0,"div"),u(1,tt,3,0,"button",39)(2,nt,3,0,"button",40),r()),i&2){let e=o.ngIf,t=p(2);s(1),c("ngIf",!t.productService.hasSelectionVariant(e)),s(1),c("ngIf",t.productService.hasSelectionVariant(e))}}function at(i,o){if(i&1&&(l(0,"span",45),x(1,"img",46),r(),m(2)),i&2){let e=o.item;s(1),c("src",e==null?null:e.logo,k),s(1),b(" ",e.Name," ")}}function ot(i,o){i&1&&(l(0,"div",47)(1,"span"),m(2," showing only different stock, please press next to populate more data "),r()())}function lt(i,o){if(i&1){let e=v();l(0,"th")(1,"input",48),h("ngModelChange",function(n){d(e);let a=p(2);return _(a.checkboxState=n)})("ngModelChange",function(){let a=d(e).ngIf,g=p(2);return _(g.onCheckboxStateChange(a))}),r()()}if(i&2){let e=p(2);s(1),c("ngModel",e.checkboxState)}}function rt(i,o){i&1&&(I(0),l(1,"th",49),m(2," Reserved "),r(),w())}function st(i,o){if(i&1){let e=v();l(0,"input",69),h("ngModelChange",function(n){d(e);let a=p(3).$implicit;return _(a.selected=n)})("ngModelChange",function(){d(e);let n=p(3).$implicit,a=p(2);return _(a.onCheckboxStateProduct(n))}),r()}if(i&2){let e=p(3).$implicit;c("ngModel",e.selected)}}function ct(i,o){if(i&1){let e=v();l(0,"img",70),h("click",function(n){d(e);let a=p(3).$implicit,g=p(2);return _(g.onZoomImage(n,a==null?null:a.ImageUrl))}),r()}if(i&2){let e=p(3).$implicit;pe("src",e==null?null:e.ThumbnailUrl,k)}}function pt(i,o){i&1&&x(0,"img",71)}function mt(i,o){if(i&1&&(I(0),x(1,"br"),l(2,"div",72),x(3,"i",73),l(4,"small"),m(5),r()(),w()),i&2){let e=p(3).$implicit;s(5),b("(",e==null?null:e.Category,")")}}function dt(i,o){if(i&1&&(I(0),l(1,"td",63)(2,"div",13),u(3,st,1,1,"input",64)(4,ct,1,1,"img",65)(5,pt,1,0,"ng-template",null,66,R),r()(),l(7,"td",67)(8,"span",68),m(9),r(),u(10,mt,6,1,"ng-container",3),r(),w()),i&2){let e=A(6),t=p().$implicit,n=p().$implicit,a=p(2);s(1),c("rowSpan",n==null?null:n.Variants.length),s(2),c("ngIf",(t==null?null:t.Inventory)>=0||n.Variants.length>1),s(1),c("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",e),s(3),c("rowSpan",n==null?null:n.Variants.length),s(2),E(n==null?null:n.Name),s(1),c("ngIf",n.CategoryID!==null&&n.CategoryID!=a.guidEmpty)}}function _t(i,o){if(i&1){let e=v();I(0),l(1,"input",48),h("ngModelChange",function(n){d(e);let a=p(2).$implicit;return _(a.selected=n)}),r(),w()}if(i&2){let e=p(2).$implicit;s(1),c("ngModel",e.selected)}}function ut(i,o){if(i&1&&(I(0),u(1,_t,2,1,"ng-container",3),w()),i&2){let e=p().$implicit;s(1),c("ngIf",(e==null?null:e.Inventory)<=1e5)}}function ht(i,o){if(i&1){let e=v();l(0,"input",48),h("ngModelChange",function(n){d(e);let a=p(2).$implicit;return _(a.selected=n)}),r()}if(i&2){let e=p(2).$implicit;c("ngModel",e.selected)}}function gt(i,o){if(i&1&&u(0,ht,1,1,"input",74),i&2){let e=p().$implicit;c("ngIf",(e==null?null:e.Inventory)>=0)}}function Ct(i,o){i&1&&(l(0,"div",75),m(1,"Not Found"),r())}function ft(i,o){if(i&1&&(l(0,"div")(1,"span",76),m(2),f(3,"number"),r(),m(4," => "),l(5,"span",77),m(6),f(7,"number"),r()()),i&2){let e=p().$implicit;s(2),b(" ",S(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),E(S(7,4,e==null?null:e.Inventory))}}function xt(i,o){if(i&1&&(l(0,"div"),m(1),f(2,"number"),r()),i&2){let e=p().$implicit;s(1),b(" ",S(2,1,e==null?null:e.Inventory)," ")}}function St(i,o){if(i&1&&(I(0),l(1,"div",78)(2,"a",79),x(3,"i",80),r()(),w()),i&2){let e=p().$implicit,t=p(3);s(2),c("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),k)}}var vt=i=>({"bg-gradient-warning":i});function yt(i,o){if(i&1){let e=v();l(0,"td",81)(1,"div",52)(2,"div")(3,"span",82),h("click",function(){d(e);let n=p().$implicit,a=p(),g=a.$implicit,C=a.ngForOf,M=p(2);return _(M.openTableDialog(g,n,C))}),m(4),f(5,"number"),r()(),l(6,"div",78)(7,"a",79),x(8,"i",80),r()()()()}if(i&2){let e=p().$implicit;c("ngClass",re(5,vt,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(4),b(" ",S(5,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," "),s(3),c("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,k)}}function bt(i,o){if(i&1&&(I(0),l(1,"span",85),m(2),f(3,"number"),r(),w()),i&2){let e=p(2).$implicit;s(2),b(" (",S(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function It(i,o){i&1&&m(0," - ")}function wt(i,o){if(i&1&&(I(0),l(1,"td",83),u(2,bt,4,3,"ng-container",55)(3,It,1,0,"ng-template",null,84,R),r(),w()),i&2){let e=A(4),t=p().$implicit;s(2),c("ngIf",t==null||t.Channel[0]==null?null:t.Channel[0].InventoryReserved)("ngIfElse",e)}}function Tt(i,o){i&1&&(I(0),m(1," - "),w())}function Mt(i,o){if(i&1&&(l(0,"span",86),f(1,"date"),m(2),f(3,"date"),r()),i&2){let e=p().$implicit;c("matTooltip",L(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),b(" ",L(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}var Dt=i=>({"text-decoration-line-through":i});function Et(i,o){if(i&1){let e=v();l(0,"tr"),u(1,dt,11,7,"ng-container",3),l(2,"td",50),m(3),r(),l(4,"td",51)(5,"div",52)(6,"span",53),m(7),r()()(),l(8,"td",54),u(9,ut,2,1,"ng-container",55)(10,gt,1,1,"ng-template",null,56,R),r(),l(12,"td")(13,"div",52),u(14,Ct,2,0,"div",57)(15,ft,8,6,"div",3)(16,xt,3,3,"div",3)(17,St,4,1,"ng-container",3),r()(),u(18,yt,9,7,"td",58)(19,wt,5,2,"ng-container",3),l(20,"td",31),u(21,Tt,2,0,"ng-container",55)(22,Mt,4,8,"ng-template",null,59,R),r(),l(24,"td")(25,"div",60)(26,"span",61),h("click",function(){let a=d(e).$implicit,g=p(3);return _(g.refreshInventory(a==null||a.Channel[0]==null?null:a.Channel[0].ChannelItemID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelVariationID,a==null||a.Channel[0]==null?null:a.Channel[0].ChannelID,a==null?null:a.ID))}),x(27,"i",62),r()()()()}if(i&2){let e=o.$implicit,t=o.index,n=A(11),a=A(23),g=p(3);s(1),c("ngIf",t==0),s(2),E(e==null?null:e.Model),s(1),c("matTooltip",e.isDiscontinued?g.discontinuedVariantMsg:""),s(2),c("ngClass",re(15,Dt,e.isDiscontinued)),s(1),E(e==null?null:e.Code),s(2),c("ngIf",(e==null?null:e.Channel[0].TypeID)==1)("ngIfElse",n),s(5),c("ngIf",(e==null?null:e.I)==null),s(1),c("ngIf",(e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",(e==null?null:e.I)!=null&&(e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)),s(1),c("ngIf",(e==null?null:e.I)!=null),s(1),c("ngIf",e==null?null:e.Channel),s(1),c("ngIf",g.isShowReservedColumn),s(2),c("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==g.minDate)("ngIfElse",a)}}function Vt(i,o){if(i&1&&(l(0,"tbody"),u(1,Et,28,17,"tr",33),r()),i&2){let e=o.$implicit;s(1),c("ngForOf",e.Variants)}}function Pt(i,o){if(i&1){let e=v();l(0,"span",87),h("click",function(){d(e);let n=p(2);return _(n.getRowCount())}),l(1,"i",88),m(2,"?"),r()()}}function Ft(i,o){if(i&1&&(l(0,"span"),m(1),f(2,"number"),r()),i&2){let e=o.ngIf;s(1),E(S(2,1,e==null?null:e.Total))}}function kt(i,o){if(i&1){let e=v();l(0,"a",92),h("click",function(){d(e);let n=p(3);return _(n.onNextPage())}),x(1,"i",93),m(2," Next"),r()}}function Nt(i,o){if(i&1){let e=v();l(0,"a",94),h("click",function(){d(e);let n=p(3);return _(n.onLastPage())}),x(1,"i",95),m(2," Last"),r()}}function At(i,o){if(i&1&&(l(0,"div",89),u(1,kt,3,0,"a",90)(2,Nt,3,0,"a",91),r()),i&2){let e=p(2);s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),s(1),c("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}function Rt(i,o){if(i&1){let e=v();l(0,"mainpanel",1),h("onSubmit",function(n){d(e);let a=p();return _(a.onSearch(n))}),l(1,"actions")(2,"div",2),u(3,it,3,2,"div",3),f(4,"async"),r()(),l(5,"filters")(6,"div")(7,"label",4),m(8,"Channel"),r(),l(9,"ng-select",5),h("ngModelChange",function(n){d(e);let a=p();return _(a.searchFilter.ChannelID=n)}),u(10,at,3,2,"ng-template",6),r()(),l(11,"div",7)(12,"label",8),m(13,"PageNumber"),r(),l(14,"input",9),h("ngModelChange",function(n){d(e);let a=p();return _(a.searchFilter.PageNumber=n)}),r()(),l(15,"div",7)(16,"label",10),m(17,"Page Size"),r(),l(18,"input",11),h("ngModelChange",function(n){d(e);let a=p();return _(a.searchFilter.RowCount=n)}),r()(),l(19,"div",7)(20,"label",12),m(21,"Quantity From - To"),r(),l(22,"div",13)(23,"input",14),h("ngModelChange",function(n){d(e);let a=p();return _(a.searchFilter.QuantityFrom=n)}),r(),m(24," - "),l(25,"input",15),h("ngModelChange",function(n){d(e);let a=p();return _(a.searchFilter.QuantityTo=n)}),r()()()(),l(26,"content")(27,"div",16)(28,"div",17)(29,"div",18),u(30,ot,3,0,"div",19),l(31,"table",20)(32,"thead",21)(33,"tr")(34,"th",22),m(35,"Product "),x(36,"br"),l(37,"mat-slide-toggle",23),h("toggleChange",function(){d(e);let n=p();return n.showDifferenceStock=!n.showDifferenceStock,_(n.onShowDifferenceStock())}),l(38,"small",12),m(39,"FILTER DIFFERENT INVENTORY"),r()()(),l(40,"th",24),m(41,"Variant"),r(),l(42,"th",25),m(43,"SKU"),r(),u(44,lt,2,1,"th",3),f(45,"async"),l(46,"th",26),m(47,"POS"),r(),l(48,"th",27)(49,"div",28),x(50,"img",29),l(51,"span",30),m(52),f(53,"stringLimit"),r()()(),u(54,rt,3,0,"ng-container",3),l(55,"th",31),m(56,"Last Sync"),r(),x(57,"th",32),r()(),u(58,Vt,2,1,"tbody",33),f(59,"async"),r(),l(60,"div",34)(61,"div",35)(62,"div",36),m(63),f(64,"number"),f(65,"async"),u(66,Pt,3,0,"span",37)(67,Ft,3,3,"span",3),f(68,"async"),m(69),r()(),u(70,At,3,2,"div",38),f(71,"async"),r()()()()()()}if(i&2){let e=p(),t,n;c("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),s(3),c("ngIf",S(4,24,e.paginationService.data$)),s(6),c("clearable",!1)("items",e.channelOptions)("ngModel",e.searchFilter.ChannelID),s(5),c("ngModel",e.searchFilter.PageNumber),s(4),c("ngModel",e.searchFilter.RowCount),s(5),c("ngModel",e.searchFilter.QuantityFrom),s(2),c("ngModel",e.searchFilter.QuantityTo),s(5),c("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),s(14),c("ngIf",S(45,26,e.paginationService.data$)),s(5),c("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=13?e.selectedChannel==null?null:e.selectedChannel.Name:""),s(1),c("src",e.selectedChannel==null?null:e.selectedChannel.logo,k),s(2),me(" ",L(53,28,e.selectedChannel==null?null:e.selectedChannel.Name,13),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=13?"...":""," "),s(2),c("ngIf",e.isShowReservedColumn),s(4),c("ngForOf",S(59,31,e.products$)),s(5),b(" Showing 1 - ",S(64,33,(t=S(65,35,e.paginationService.data$))==null?null:t.length)," of "),s(3),c("ngIf",e.paginationService.hideCount),s(1),c("ngIf",S(68,37,!e.paginationService.hideCount&&e.rowCount$)),s(2),b(" records ~ ",e.paginationService.footerPageNumber," Page "),s(1),c("ngIf",((n=S(71,39,e.paginationService.data$))==null?null:n.length)>0)}}var ke=(()=>{let o=class o{constructor(t,n,a,g,C,M,D,Ae){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=g,this.productService=C,this.authService=M,this.biggerPictureService=D,this.inventoryService=Ae,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=T.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=T.GuidEMpty,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],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.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.paginationService.data$.pipe(ce(t=>(t=t.map(n=>(n.Variants&&(n.Variants=n.Variants.map(a=>(a.isDiscontinued=n.Discontinued=="Yes",a))),n)),t)),N(t=>{this.checkShowReservedColumn(t)}))}checkShowReservedColumn(t){let n=0,a;t.forEach(g=>{a=g.Variants.find(C=>T.IsNotEmpty(C?.Channel[0]?.InventoryReserved)),a&&(n+=1)}),this.isShowReservedColumn=n>0}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe(N(t=>{if(this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.initSelectedChannel(),this.paginationService.reloadPagination(this.searchFilter),!t.Filter.IsMarketplaceAppActive){let n=`Automatic inventory sync disabled.
2
2
  Please enable Dealpos X Marketplace Apps integration in POS Configuration`;this.toastr.warning(n,"Warning")}}))}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(t=>t.ID==this.searchFilter.ChannelID)}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter),this.initSelectedChannel()}updateStock(t){let n=this.productService.selectedVariantProduct(t);if(n.length>0){let a=n.map(C=>({ID:C.ID,Code:C.Code,Inventory:C.Inventory})),g={ListChannelID:[this.searchFilter.ChannelID],List:a};this.http.post("/api/Inventory/UpdateChannel",g).subscribe(C=>{this.searchFilter.PageNumber=1,this.paginationService.reloadPagination(this.searchFilter),this.checkboxState=!1,this.handlingUpdateStock(C)})}}handlingUpdateStock(t){if(t[0]?.StatusProduct){let n=t[0].StatusProduct.Fail_list,a=t[0].StatusProduct.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",a,n)}else this.toastr.error(t[0]?.Exception,"Error")}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=T.GuidEMpty,this.dialog.open(te,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(P(a=>T.IsNotEmpty(a))).subscribe(a=>{this.searchFilter.ChannelID=a.ChannelID,this.searchFilter.ScanFull=a.ScanFull,this.searchFilter.UpdatedProduct=a.UpdatedProduct,this.searchFilter.Async=a.Async,this.scannALl()})}scannALl(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.searchFilter.ScanFull=!1,this.initPageLoader(),this.toastr.success("Successfully scanned from "+t?.Name,"Success"))})}refreshInventory(t,n,a,g){let C={ChannelItemID:t,ChannelVariationID:n,ChannelID:a,VariantID:g};this.http.post("/api/Inventory/RefreshInventoryChannel",C).subscribe(M=>{this.toastr.success("Successfully updated","Success"),this.paginationService.reloadPagination(this.searchFilter)})}onCheckboxStateProduct(t){t.Variants=t.Variants.map(n=>(n.Inventory>=0&&(n.selected=t.selected),n))}onCheckboxStateChange(t){t=t.map(n=>(n.Variants=n.Variants.map(a=>(a.selected=this.checkboxState,a)),n))}openTableDialog(t,n,a){this.dialog.open(Me,{data:{Name:t.Name,Variant:n,ChannelID:n?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:t.ChannelItemID}}).afterClosed().pipe(P(C=>T.IsNotEmpty(C))).subscribe(C=>{this.updateItemAfterDialog(C,a)})}updateItemAfterDialog(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku},g=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(C=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+g?.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=V.DIFFERENCE:this.searchFilter.filterModel=V.ALL,this.paginationService.reloadPagination(this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,PageNumber:1,text:this.searchFilter.text};this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`${this.rowCountApi}`,t)}onLastPage(){let t={ChannelID:this.searchFilter.ChannelID,PageNumber:1};this.http.post(`${this.rowCountApi}`,t).subscribe({next:n=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,n.Total)}})}onZoomImage(t,n){this.biggerPictureService.openBiggerPicture(t,n)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(H),y(Q),y(X),y(ie),y(ne),y(q),y(we),y(oe))},o.\u0275cmp=F({type:o,selectors:[["app-single-channel-comparison"]],decls:2,vars:3,consts:[["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit"],[1,"d-flex"],[4,"ngIf"],["for","ng-select",1,"fw-bold"],["id","ng-select","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text","mt-3",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],[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,"ngModel","ngModelChange"],["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,"ngModel","ngModelChange"],[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,"ngModel","ngModelChange"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","140px"],["matTooltipPosition","above",1,"d-inline-block",3,"matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[1,"text-center"],[2,"width","4%"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],["class","btn-group",4,"ngIf"],["type","button","data-cy","scanInPos","class","btn btn-outline-secondary shadow rounded me-3",3,"click",4,"ngIf"],["class","btn btn-success",3,"click",4,"ngIf"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"me-2"],[2,"width","18px",3,"src"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModel","ngModelChange"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-start"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["OTHER_CHANNEL",""],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],["SYNCDATE",""],[1,"ps-0","d-flex","justify-content-center","align-items-center"],["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"],[1,"text-start",2,"width","0%",3,"rowSpan"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img cursor-pointer","style","margin-left: 20px",3,"src","click",4,"ngIf","ngIfElse"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["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,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"ms-2","pb-1"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-end",3,"ngClass"],[1,"cursor",3,"click"],[1,"text-end"],["EMPTY_RESERVED",""],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary border-start-0","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(u(0,Rt,72,41,"mainpanel",0),f(1,"async")),n&2&&c("ngIf",S(1,1,a.loader$))},dependencies:[de,_e,$,K,Z,ge,J,Y,xe,fe,De,ee,W,U,j,ue,Ve],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});let i=o;return i})();var Bt=[{path:"",component:Pe,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:Fe,canActivate:[se],data:{title:"Inventory Comparison"}},{path:"bychannel",component:ke,canActivate:[se],data:{title:"Inventory Comparison"}}]}],Ne=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=O({type:o}),o.\u0275inj=B({imports:[z,G.forChild(Bt)]});let i=o;return i})();var Fn=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=O({type:o}),o.\u0275inj=B({providers:[oe],imports:[z,Ne,G,Ie,Ce,Se,Ee,ye,ae,ve]});let i=o;return i})();export{Fn as InventoryModule};