marketplacepos 5.41.6 → 5.41.7
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.
- package/Marketplace/{chunk-ZTQGQXIT.js → chunk-34YBIP7V.js} +1 -1
- package/Marketplace/{chunk-ZOVPSET6.js → chunk-6KVU4HYV.js} +1 -1
- package/Marketplace/{chunk-HW3FX455.js → chunk-6LYB3OX6.js} +1 -1
- package/Marketplace/{chunk-IINERY5O.js → chunk-7Y3AHSRY.js} +1 -1
- package/Marketplace/{chunk-JB6W72VA.js → chunk-7Y5FIUQG.js} +1 -1
- package/Marketplace/{chunk-F2X5N2W5.js → chunk-7ZSRD63R.js} +2 -2
- package/Marketplace/{chunk-SUC77PQU.js → chunk-A27CQ454.js} +1 -1
- package/Marketplace/{chunk-LNXJNBJQ.js → chunk-BSEXMJEZ.js} +1 -1
- package/Marketplace/{chunk-34CTATL6.js → chunk-BVX3DFE7.js} +1 -1
- package/Marketplace/{chunk-5KHDEW35.js → chunk-C6G3B77L.js} +1 -1
- package/Marketplace/{chunk-25HVJVYO.js → chunk-CRSCUQVD.js} +1 -1
- package/Marketplace/{chunk-ZSHPWPPL.js → chunk-E5PXWUP7.js} +1 -1
- package/Marketplace/{chunk-UQVGVHST.js → chunk-ELWDT5IN.js} +1 -1
- package/Marketplace/{chunk-AB3DHTC7.js → chunk-EYS22E2U.js} +1 -1
- package/Marketplace/{chunk-ACV6YALZ.js → chunk-F7PA3AZJ.js} +1 -1
- package/Marketplace/{chunk-DFRA5ORA.js → chunk-GB5MAE4Q.js} +1 -1
- package/Marketplace/{chunk-CTUXL543.js → chunk-HGHAWAUM.js} +1 -1
- package/Marketplace/{chunk-HUEPKUQW.js → chunk-I5J2PPVL.js} +1 -1
- package/Marketplace/{chunk-PWJ2Z5EH.js → chunk-J4YKXJ6J.js} +2 -2
- package/Marketplace/{chunk-PV6JAW7E.js → chunk-JMBQIF5Z.js} +1 -1
- package/Marketplace/{chunk-BB5SMGW7.js → chunk-JS2ESRK4.js} +1 -1
- package/Marketplace/{chunk-IHYEQWAY.js → chunk-KLNIF67L.js} +1 -1
- package/Marketplace/{chunk-FJVZ33X4.js → chunk-M5RTXLAJ.js} +1 -1
- package/Marketplace/{chunk-I4QWUPXR.js → chunk-MOZTIGPI.js} +1 -1
- package/Marketplace/{chunk-743EWFUY.js → chunk-NP3CNZCB.js} +1 -1
- package/Marketplace/{chunk-YJ6KE7ER.js → chunk-OYBLKQ6P.js} +1 -1
- package/Marketplace/{chunk-OIZORVCZ.js → chunk-OYXRKKZM.js} +1 -1
- package/Marketplace/{chunk-T6Q5SGJG.js → chunk-P3Y52SIA.js} +1 -1
- package/Marketplace/{chunk-OQNYXG6U.js → chunk-P45WU7I6.js} +1 -1
- package/Marketplace/{chunk-IIBM2V3E.js → chunk-P7ELVWKF.js} +1 -1
- package/Marketplace/{chunk-NTGWFIOH.js → chunk-S2FJFMRF.js} +1 -1
- package/Marketplace/{chunk-3OD47PUU.js → chunk-U24PS7YK.js} +1 -1
- package/Marketplace/{chunk-OHN3VXQV.js → chunk-UGHSWRCC.js} +1 -1
- package/Marketplace/{chunk-LQZTRBOB.js → chunk-WQOMUPJV.js} +1 -1
- package/Marketplace/chunk-WRPKXHM7.js +1 -0
- package/Marketplace/{chunk-73OLUI2Z.js → chunk-WZ7CRPM6.js} +1 -1
- package/Marketplace/{chunk-Z2PI4IS6.js → chunk-XN4O5YGO.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-36VYJM2O.js → main-XPLCKXAY.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-OOKURHR4.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ke}from"./chunk-XM6GN4VF.js";import"./chunk-7477X7LJ.js";import{a as N}from"./chunk-LQZTRBOB.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Me,b as Pe,c as De,d as G}from"./chunk-743EWFUY.js";import{a as ye,b as Ie,c as we}from"./chunk-RGR34QZ3.js";import{b as Ve}from"./chunk-ICSMRW7O.js";import{a as Te,b as Ee}from"./chunk-YXFTLQ5M.js";import"./chunk-MATSRG2L.js";import"./chunk-V2OJQHE3.js";import"./chunk-6XFYITUD.js";import"./chunk-LPXBSHUI.js";import"./chunk-D54NUPYF.js";import{a as be}from"./chunk-EGTYAIU5.js";import"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-4G3QN54S.js";import"./chunk-3RK6DDJD.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import{a as Fe}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{e as he}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{l as ue}from"./chunk-IHYEQWAY.js";import{b as me,e as _e}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as xe,l as fe,m as Se,n as ve}from"./chunk-ITTRZMEX.js";import{r as Ce,s as ge}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as ae,c as le,h as re,m as se,o as ce,y as pe}from"./chunk-DPLEMBB4.js";import{c as f,f as de}from"./chunk-PXB4YEY3.js";import{d as J,g as ee,j as te,k as ne,m as ie,n as oe}from"./chunk-GPEVUTDI.js";import{$c as R,Dc as Q,Eb as Z,Ec as c,Fc as D,G as Y,Gc as E,Ic as b,Jc as F,Kb as h,Kc as T,Oc as X,Qa as W,Qc as k,Wb as d,Z as B,Zc as g,_c as v,ad as z,bc as y,cc as O,ea as $,ec as U,fc as j,gc as a,hc as r,ic as x,jc as M,kc as P,mc as S,ob as V,pa as K,qb as s,rc as C,sc as l,v as A,vc as q,wb as w,ya as m,za as _}from"./chunk-T5ONJF63.js";import{a as L}from"./chunk-K2H6WANG.js";var Le=i=>({"text-decoration-line-through":i}),Ae=i=>({"ms-10":i}),Be=i=>({"bg-gradient-warning":i});function $e(i,p){if(i&1){let e=S();a(0,"button",38),C("click",function(){m(e);let t=l().ngIf,n=l(2);return _(n.onScanInventory(t))}),x(1,"i",39),c(2,"Refresh "),r()}}function We(i,p){if(i&1){let e=S();a(0,"div",36)(1,"button",40),C("click",function(){m(e);let t=l().ngIf,n=l(2);return _(n.updateStock(t))}),x(2,"i",41),c(3," Update "),r(),x(4,"button",42),a(5,"ul",43)(6,"a",44),C("click",function(){m(e);let t=l(3);return _(t.openExportDialog())}),x(7,"i",45),a(8,"span"),c(9,"Export"),r()()()()}}function Oe(i,p){if(i&1){let e=S();a(0,"button",46),C("click",function(){m(e);let t=l(3);return _(t.openExportDialog())}),x(1,"i",45),a(2,"span"),c(3,"Export"),r()()}}function Ue(i,p){if(i&1&&(a(0,"div"),h(1,$e,3,0,"button",35)(2,We,10,0,"div",36)(3,Oe,4,0,"button",37),r()),i&2){let e=p.ngIf,o=l(2);s(),d("ngIf",o.productService.hasSelectionVariant(e)),s(),y(o.productService.hasSelectionVariant(e)?2:3)}}function je(i,p){i&1&&(a(0,"div",47)(1,"span"),c(2," showing only different stock, please press next to populate more data "),r()())}function Qe(i,p){if(i&1){let e=S();a(0,"th")(1,"input",48),T("ngModelChange",function(t){m(e);let n=l(2);return F(n.checkboxState,t)||(n.checkboxState=t),_(t)}),C("ngModelChange",function(){let t=m(e).ngIf,n=l(2);return _(n.onCheckboxStateChange(t))}),r()()}if(i&2){let e=l(2);s(),b("ngModel",e.checkboxState)}}function ze(i,p){i&1&&(a(0,"th",32),c(1," Reserved "),r())}function Ge(i,p){if(i&1){let e=S();a(0,"input",66),T("ngModelChange",function(t){m(e);let n=l(3).$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),C("ngModelChange",function(){m(e);let t=l(3).$implicit,n=l(2);return _(n.onCheckboxStateProduct(t))}),r()}if(i&2){let e=l(3).$implicit;b("ngModel",e.selected)}}function He(i,p){if(i&1){let e=S();a(0,"img",67),C("click",function(t){m(e);let n=l(3).$implicit,u=l(2);return _(u.onZoomImage(t,n==null?null:n.ImageUrl))}),r()}if(i&2){let e=l(3).$implicit;q("src",e==null?null:e.ThumbnailUrl,V)}}function Ye(i,p){i&1&&x(0,"img",63)}function Ke(i,p){if(i&1&&(x(0,"br"),a(1,"div",68),x(2,"i",69),a(3,"small"),c(4),r()()),i&2){let e=l(3).$implicit;s(4),E("(",e==null?null:e.Category,")")}}function Ze(i,p){if(i&1&&(a(0,"td",59)(1,"div",14),h(2,Ge,1,1,"input",60),a(3,"div",61),h(4,He,1,1,"img",62)(5,Ye,1,0,"img",63),r()()(),a(6,"td",64)(7,"span",65),c(8),r(),h(9,Ke,5,1),r()),i&2){let e=l(2).$implicit,o=l(2);d("rowSpan",e==null?null:e.Variants.length),s(2),y(e.Variants.length>1?2:-1),s(),d("ngClass",k(7,Ae,e.Variants.length<=1)),s(),y(e!=null&&e.ThumbnailUrl?4:5),s(2),d("rowSpan",e==null?null:e.Variants.length),s(2),D(e==null?null:e.Name),s(),y(e.CategoryID!==null&&e.CategoryID!=o.guidEmpty?9:-1)}}function qe(i,p){if(i&1){let e=S();a(0,"input",48),T("ngModelChange",function(t){m(e);let n=l(2).$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),r()}if(i&2){let e=l(2).$implicit;b("ngModel",e.selected)}}function Xe(i,p){if(i&1&&h(0,qe,1,1,"input",53),i&2){let e=l().$implicit;y((e==null?null:e.Inventory)<=1e5?0:-1)}}function Je(i,p){if(i&1){let e=S();a(0,"input",48),T("ngModelChange",function(t){m(e);let n=l().$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),r()}if(i&2){let e=l().$implicit;b("ngModel",e.selected)}}function et(i,p){i&1&&(a(0,"div",70),c(1," Not Found "),r())}function tt(i,p){if(i&1&&(a(0,"div")(1,"span",71),c(2),g(3,"number"),r(),c(4," => "),a(5,"span",72),c(6),g(7,"number"),r()()),i&2){let e=l().$implicit;s(2),E(" ",v(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),D(v(7,4,e==null?null:e.Inventory))}}function nt(i,p){if(i&1&&(c(0),g(1,"number")),i&2){let e=l().$implicit;E(" ",v(1,1,e==null?null:e.Inventory)," ")}}function it(i,p){if(i&1&&(M(0),a(1,"div",73)(2,"a",74),x(3,"i",75),r()(),P()),i&2){let e=l().$implicit,o=l(3);s(2),d("href",o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),V)}}function ot(i,p){if(i&1){let e=S();a(0,"span",80),C("click",function(){let t=m(e).ngIf,n=l(2).$implicit,u=l().$implicit,I=l(2);return _(I.openTableDialog(u,n,t))}),c(1),g(2,"number"),r()}if(i&2){let e=l(2).$implicit;s(),E(" ",v(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function at(i,p){if(i&1){let e=S();a(0,"td",76)(1,"div",54)(2,"div"),h(3,ot,3,3,"span",77),g(4,"async"),r(),a(5,"div",73)(6,"a",74),x(7,"i",75),r()(),a(8,"div",73)(9,"span",78),C("click",function(){m(e);let t=l().$implicit,n=l(3);return _(n.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",79),r()()()()}if(i&2){let e=l().$implicit,o=l(3);d("ngClass",k(5,Be,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),d("ngIf",v(4,3,o.products$)),s(3),d("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,V)}}function lt(i,p){if(i&1&&(M(0),a(1,"span",81),c(2),g(3,"number"),r(),P()),i&2){let e=l(2).$implicit;s(2),E(" (",v(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function rt(i,p){i&1&&c(0," - ")}function st(i,p){if(i&1&&(M(0),a(1,"td",50),h(2,lt,4,3,"ng-container",58)(3,rt,1,0,"ng-template",null,1,z),r(),P()),i&2){let e=Q(4),o=l().$implicit;s(2),d("ngIf",o==null||o.Channel[0]==null?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function ct(i,p){i&1&&(M(0),c(1," - "),P())}function pt(i,p){if(i&1&&(a(0,"span",82),g(1,"date"),c(2),g(3,"date"),r()),i&2){let e=l().$implicit;d("matTooltip",R(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),E(" ",R(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function mt(i,p){if(i&1&&(a(0,"tr"),h(1,Ze,10,9),a(2,"td",49),c(3),r(),a(4,"td",50)(5,"span",51),c(6),r()(),a(7,"td",52),h(8,Xe,1,1)(9,Je,1,1,"input",53),r(),a(10,"td")(11,"div",54),h(12,et,2,0,"div",55)(13,tt,8,6,"div")(14,nt,2,3)(15,it,4,1,"ng-container",5),r()(),h(16,at,11,7,"td",56)(17,st,5,2,"ng-container",5),a(18,"td",57),h(19,ct,2,0,"ng-container",58)(20,pt,4,8,"ng-template",null,0,z),r()()),i&2){let e=p.$implicit,o=p.$index,t=Q(21),n=l(3);s(),y(o==0?1:-1),s(2),D(e==null?null:e.Model),s(2),d("matTooltip",e.Discontinued?n.discontinuedVariantMsg:"")("ngClass",k(14,Le,e.Discontinued)),s(),D(e==null?null:e.Code),s(2),y((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),d("ngIf",(e==null?null:e.I)==null),s(),y((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),y((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),d("ngIf",(e==null?null:e.I)!=null),s(),d("ngIf",e==null?null:e.Channel),s(),d("ngIf",n.isShowReservedColumn),s(2),d("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==n.minDate)("ngIfElse",t)}}function _t(i,p){if(i&1&&(a(0,"tbody"),U(1,mt,22,16,"tr",null,O),r()),i&2){let e=p.$implicit;s(),j(e.Variants)}}function dt(i,p){if(i&1){let e=S();a(0,"mainpanel",3),C("onSubmit",function(t){m(e);let n=l();return _(n.onSearch(t))}),a(1,"actions")(2,"div",4),h(3,Ue,4,2,"div",5),g(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),C("onChannelChange",function(t){m(e);let n=l();return _(n.onChannelChange(t))}),r()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),r(),a(13,"input",10),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),_(t)}),r()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),r(),a(17,"input",12),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),_(t)}),r()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.QuantityFrom,t)||(n.searchFilter.QuantityFrom=t),_(t)}),r(),c(23," - "),a(24,"input",16),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.QuantityTo,t)||(n.searchFilter.QuantityTo=t),_(t)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),h(29,je,3,0,"div",20),a(30,"table",21),C("matSortChange",function(t){m(e);let n=l();return _(n.onSortVariant(t))}),a(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),x(35,"br"),a(36,"mat-slide-toggle",24),C("toggleChange",function(){m(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,_(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),r()()(),a(39,"th",25),c(40,"Variant"),r(),a(41,"th",26),c(42,"SKU"),r(),h(43,Qe,2,1,"th",5),g(44,"async"),a(45,"th",27),c(46," POS "),r(),a(47,"th",28)(48,"div",29),C("click",function(){m(e);let t=l();return _(t.openModalFilter())}),x(49,"img",30),a(50,"span",31),c(51),g(52,"stringLimit"),r()()(),h(53,ze,2,0,"th",32),a(54,"th",33),c(55,"Last Sync"),r()()(),U(56,_t,3,0,"tbody",null,O),g(58,"async"),r(),a(59,"infinite-paginator",34),g(60,"async"),C("onNextPage",function(){m(e);let t=l();return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){m(e);let t=l();return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){m(e);let t=l();return _(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(i&2){let e,o,t,n=l();d("headerTitle","Inventory Comparison")("pageData",n.pageData)("hideSearchBox",!1),s(3),d("ngIf",v(4,21,n.products$)),s(6),d("ngModel",(n.searchFilter==null?null:n.searchFilter.LocationID)||(n.searchFilter==null?null:n.searchFilter.ChannelID)),s(4),b("ngModel",n.searchFilter.PageNumber),s(4),b("ngModel",n.searchFilter.RowCount),s(5),b("ngModel",n.searchFilter.QuantityFrom),s(2),b("ngModel",n.searchFilter.QuantityTo),s(5),d("ngIf",(n.searchFilter==null?null:n.searchFilter.filterModel)==3),s(14),d("ngIf",v(44,23,n.products$)),s(5),d("matTooltip",((e=n.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=n.channelIdentity())==null?null:e.label:""),s(),d("src",(o=n.channelIdentity())==null?null:o.img,V),s(2),E(" ",R(52,25,(t=n.channelIdentity())==null?null:t.label,13)," "),s(2),y(n.isShowReservedColumn?53:-1),s(3),j(v(58,28,n.products$)),s(3),d("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",v(60,30,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}var Zt=(()=>{class i{constructor(e,o,t,n,u,I,Re,Ne){this.http=e,this.toastr=o,this.dialog=t,this.productService=n,this.authService=u,this.biggerPictureService=I,this.inventoryService=Re,this.mainPanelService=Ne,this.infinitePagination=K(G),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=f.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=f.GuidEMpty,this.selectedChannel=W(null),this.channelIdentity=W({img:null,label:null}),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.hostName=this.authService.getDomain(),this.initPageLoader(),this.sourceObs$=this.infinitePagination.data$.pipe($(e=>{this.checkShowReservedColumn(e)}),A(e=>(e=this.calculateAvailableStock(e),e)),B(1)),this.products$=this.sourceObs$}calculateAvailableStock(e){return e.map(t=>(t.totalAvailable=t.Variants.reduce((n,u)=>(n+=u.I?.Available||0,n),0),t))}checkShowReservedColumn(e){let o=0,t;e.forEach(n=>{t=n.Variants.find(u=>f.IsNotEmpty(u?.Channel[0]?.InventoryReserved)),t&&(o+=1)}),this.isShowReservedColumn=o>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(B(1),$(e=>{this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID,LocationID:e.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!e.Filter.IsMarketplaceAppActive)}))}onChannelChange(e){let o=Object.assign({},e);this.selectedChannel.set(o),f.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let e=Object.assign({},this.selectedChannel());f.IsNotEmpty(e.parent)?(this.searchFilter.LocationID=e.id,this.searchFilter.ChannelID=e?.parent?.id,e.label=e?.parent?.label+" - "+e?.label,e.img=f.getChannelLogoByTypeId(e?.parent?.typeid)):(this.searchFilter.LocationID=null,e.img=f.getChannelLogoByTypeId(e?.typeid),this.searchFilter.ChannelID=e?.id,this.selectedChannel.set(e)),this.channelIdentity.update(()=>({img:e.img,label:e.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(e){e&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
1
|
+
import{a as ke}from"./chunk-XM6GN4VF.js";import"./chunk-7477X7LJ.js";import{a as N}from"./chunk-WQOMUPJV.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Me,b as Pe,c as De,d as G}from"./chunk-NP3CNZCB.js";import{a as ye,b as Ie,c as we}from"./chunk-RGR34QZ3.js";import{b as Ve}from"./chunk-ICSMRW7O.js";import{a as Te,b as Ee}from"./chunk-YXFTLQ5M.js";import"./chunk-MATSRG2L.js";import"./chunk-V2OJQHE3.js";import"./chunk-6XFYITUD.js";import"./chunk-LPXBSHUI.js";import"./chunk-D54NUPYF.js";import{a as be}from"./chunk-EGTYAIU5.js";import"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-4G3QN54S.js";import"./chunk-3RK6DDJD.js";import"./chunk-CH2MLZU7.js";import"./chunk-ZZVNB72Q.js";import{a as Fe}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{e as he}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{l as ue}from"./chunk-KLNIF67L.js";import{b as me,e as _e}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{d as xe,l as fe,m as Se,n as ve}from"./chunk-ITTRZMEX.js";import{r as Ce,s as ge}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as ae,c as le,h as re,m as se,o as ce,y as pe}from"./chunk-DPLEMBB4.js";import{c as f,f as de}from"./chunk-PXB4YEY3.js";import{d as J,g as ee,j as te,k as ne,m as ie,n as oe}from"./chunk-GPEVUTDI.js";import{$c as R,Dc as Q,Eb as Z,Ec as c,Fc as D,G as Y,Gc as E,Ic as b,Jc as F,Kb as h,Kc as T,Oc as X,Qa as W,Qc as k,Wb as d,Z as B,Zc as g,_c as v,ad as z,bc as y,cc as O,ea as $,ec as U,fc as j,gc as a,hc as r,ic as x,jc as M,kc as P,mc as S,ob as V,pa as K,qb as s,rc as C,sc as l,v as A,vc as q,wb as w,ya as m,za as _}from"./chunk-T5ONJF63.js";import{a as L}from"./chunk-K2H6WANG.js";var Le=i=>({"text-decoration-line-through":i}),Ae=i=>({"ms-10":i}),Be=i=>({"bg-gradient-warning":i});function $e(i,p){if(i&1){let e=S();a(0,"button",38),C("click",function(){m(e);let t=l().ngIf,n=l(2);return _(n.onScanInventory(t))}),x(1,"i",39),c(2,"Refresh "),r()}}function We(i,p){if(i&1){let e=S();a(0,"div",36)(1,"button",40),C("click",function(){m(e);let t=l().ngIf,n=l(2);return _(n.updateStock(t))}),x(2,"i",41),c(3," Update "),r(),x(4,"button",42),a(5,"ul",43)(6,"a",44),C("click",function(){m(e);let t=l(3);return _(t.openExportDialog())}),x(7,"i",45),a(8,"span"),c(9,"Export"),r()()()()}}function Oe(i,p){if(i&1){let e=S();a(0,"button",46),C("click",function(){m(e);let t=l(3);return _(t.openExportDialog())}),x(1,"i",45),a(2,"span"),c(3,"Export"),r()()}}function Ue(i,p){if(i&1&&(a(0,"div"),h(1,$e,3,0,"button",35)(2,We,10,0,"div",36)(3,Oe,4,0,"button",37),r()),i&2){let e=p.ngIf,o=l(2);s(),d("ngIf",o.productService.hasSelectionVariant(e)),s(),y(o.productService.hasSelectionVariant(e)?2:3)}}function je(i,p){i&1&&(a(0,"div",47)(1,"span"),c(2," showing only different stock, please press next to populate more data "),r()())}function Qe(i,p){if(i&1){let e=S();a(0,"th")(1,"input",48),T("ngModelChange",function(t){m(e);let n=l(2);return F(n.checkboxState,t)||(n.checkboxState=t),_(t)}),C("ngModelChange",function(){let t=m(e).ngIf,n=l(2);return _(n.onCheckboxStateChange(t))}),r()()}if(i&2){let e=l(2);s(),b("ngModel",e.checkboxState)}}function ze(i,p){i&1&&(a(0,"th",32),c(1," Reserved "),r())}function Ge(i,p){if(i&1){let e=S();a(0,"input",66),T("ngModelChange",function(t){m(e);let n=l(3).$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),C("ngModelChange",function(){m(e);let t=l(3).$implicit,n=l(2);return _(n.onCheckboxStateProduct(t))}),r()}if(i&2){let e=l(3).$implicit;b("ngModel",e.selected)}}function He(i,p){if(i&1){let e=S();a(0,"img",67),C("click",function(t){m(e);let n=l(3).$implicit,u=l(2);return _(u.onZoomImage(t,n==null?null:n.ImageUrl))}),r()}if(i&2){let e=l(3).$implicit;q("src",e==null?null:e.ThumbnailUrl,V)}}function Ye(i,p){i&1&&x(0,"img",63)}function Ke(i,p){if(i&1&&(x(0,"br"),a(1,"div",68),x(2,"i",69),a(3,"small"),c(4),r()()),i&2){let e=l(3).$implicit;s(4),E("(",e==null?null:e.Category,")")}}function Ze(i,p){if(i&1&&(a(0,"td",59)(1,"div",14),h(2,Ge,1,1,"input",60),a(3,"div",61),h(4,He,1,1,"img",62)(5,Ye,1,0,"img",63),r()()(),a(6,"td",64)(7,"span",65),c(8),r(),h(9,Ke,5,1),r()),i&2){let e=l(2).$implicit,o=l(2);d("rowSpan",e==null?null:e.Variants.length),s(2),y(e.Variants.length>1?2:-1),s(),d("ngClass",k(7,Ae,e.Variants.length<=1)),s(),y(e!=null&&e.ThumbnailUrl?4:5),s(2),d("rowSpan",e==null?null:e.Variants.length),s(2),D(e==null?null:e.Name),s(),y(e.CategoryID!==null&&e.CategoryID!=o.guidEmpty?9:-1)}}function qe(i,p){if(i&1){let e=S();a(0,"input",48),T("ngModelChange",function(t){m(e);let n=l(2).$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),r()}if(i&2){let e=l(2).$implicit;b("ngModel",e.selected)}}function Xe(i,p){if(i&1&&h(0,qe,1,1,"input",53),i&2){let e=l().$implicit;y((e==null?null:e.Inventory)<=1e5?0:-1)}}function Je(i,p){if(i&1){let e=S();a(0,"input",48),T("ngModelChange",function(t){m(e);let n=l().$implicit;return F(n.selected,t)||(n.selected=t),_(t)}),r()}if(i&2){let e=l().$implicit;b("ngModel",e.selected)}}function et(i,p){i&1&&(a(0,"div",70),c(1," Not Found "),r())}function tt(i,p){if(i&1&&(a(0,"div")(1,"span",71),c(2),g(3,"number"),r(),c(4," => "),a(5,"span",72),c(6),g(7,"number"),r()()),i&2){let e=l().$implicit;s(2),E(" ",v(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),D(v(7,4,e==null?null:e.Inventory))}}function nt(i,p){if(i&1&&(c(0),g(1,"number")),i&2){let e=l().$implicit;E(" ",v(1,1,e==null?null:e.Inventory)," ")}}function it(i,p){if(i&1&&(M(0),a(1,"div",73)(2,"a",74),x(3,"i",75),r()(),P()),i&2){let e=l().$implicit,o=l(3);s(2),d("href",o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),V)}}function ot(i,p){if(i&1){let e=S();a(0,"span",80),C("click",function(){let t=m(e).ngIf,n=l(2).$implicit,u=l().$implicit,I=l(2);return _(I.openTableDialog(u,n,t))}),c(1),g(2,"number"),r()}if(i&2){let e=l(2).$implicit;s(),E(" ",v(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function at(i,p){if(i&1){let e=S();a(0,"td",76)(1,"div",54)(2,"div"),h(3,ot,3,3,"span",77),g(4,"async"),r(),a(5,"div",73)(6,"a",74),x(7,"i",75),r()(),a(8,"div",73)(9,"span",78),C("click",function(){m(e);let t=l().$implicit,n=l(3);return _(n.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),x(10,"i",79),r()()()()}if(i&2){let e=l().$implicit,o=l(3);d("ngClass",k(5,Be,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),d("ngIf",v(4,3,o.products$)),s(3),d("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,V)}}function lt(i,p){if(i&1&&(M(0),a(1,"span",81),c(2),g(3,"number"),r(),P()),i&2){let e=l(2).$implicit;s(2),E(" (",v(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function rt(i,p){i&1&&c(0," - ")}function st(i,p){if(i&1&&(M(0),a(1,"td",50),h(2,lt,4,3,"ng-container",58)(3,rt,1,0,"ng-template",null,1,z),r(),P()),i&2){let e=Q(4),o=l().$implicit;s(2),d("ngIf",o==null||o.Channel[0]==null?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function ct(i,p){i&1&&(M(0),c(1," - "),P())}function pt(i,p){if(i&1&&(a(0,"span",82),g(1,"date"),c(2),g(3,"date"),r()),i&2){let e=l().$implicit;d("matTooltip",R(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),E(" ",R(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function mt(i,p){if(i&1&&(a(0,"tr"),h(1,Ze,10,9),a(2,"td",49),c(3),r(),a(4,"td",50)(5,"span",51),c(6),r()(),a(7,"td",52),h(8,Xe,1,1)(9,Je,1,1,"input",53),r(),a(10,"td")(11,"div",54),h(12,et,2,0,"div",55)(13,tt,8,6,"div")(14,nt,2,3)(15,it,4,1,"ng-container",5),r()(),h(16,at,11,7,"td",56)(17,st,5,2,"ng-container",5),a(18,"td",57),h(19,ct,2,0,"ng-container",58)(20,pt,4,8,"ng-template",null,0,z),r()()),i&2){let e=p.$implicit,o=p.$index,t=Q(21),n=l(3);s(),y(o==0?1:-1),s(2),D(e==null?null:e.Model),s(2),d("matTooltip",e.Discontinued?n.discontinuedVariantMsg:"")("ngClass",k(14,Le,e.Discontinued)),s(),D(e==null?null:e.Code),s(2),y((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),d("ngIf",(e==null?null:e.I)==null),s(),y((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),y((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),d("ngIf",(e==null?null:e.I)!=null),s(),d("ngIf",e==null?null:e.Channel),s(),d("ngIf",n.isShowReservedColumn),s(2),d("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==n.minDate)("ngIfElse",t)}}function _t(i,p){if(i&1&&(a(0,"tbody"),U(1,mt,22,16,"tr",null,O),r()),i&2){let e=p.$implicit;s(),j(e.Variants)}}function dt(i,p){if(i&1){let e=S();a(0,"mainpanel",3),C("onSubmit",function(t){m(e);let n=l();return _(n.onSearch(t))}),a(1,"actions")(2,"div",4),h(3,Ue,4,2,"div",5),g(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),C("onChannelChange",function(t){m(e);let n=l();return _(n.onChannelChange(t))}),r()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),r(),a(13,"input",10),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),_(t)}),r()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),r(),a(17,"input",12),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),_(t)}),r()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.QuantityFrom,t)||(n.searchFilter.QuantityFrom=t),_(t)}),r(),c(23," - "),a(24,"input",16),T("ngModelChange",function(t){m(e);let n=l();return F(n.searchFilter.QuantityTo,t)||(n.searchFilter.QuantityTo=t),_(t)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),h(29,je,3,0,"div",20),a(30,"table",21),C("matSortChange",function(t){m(e);let n=l();return _(n.onSortVariant(t))}),a(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),x(35,"br"),a(36,"mat-slide-toggle",24),C("toggleChange",function(){m(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,_(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),r()()(),a(39,"th",25),c(40,"Variant"),r(),a(41,"th",26),c(42,"SKU"),r(),h(43,Qe,2,1,"th",5),g(44,"async"),a(45,"th",27),c(46," POS "),r(),a(47,"th",28)(48,"div",29),C("click",function(){m(e);let t=l();return _(t.openModalFilter())}),x(49,"img",30),a(50,"span",31),c(51),g(52,"stringLimit"),r()()(),h(53,ze,2,0,"th",32),a(54,"th",33),c(55,"Last Sync"),r()()(),U(56,_t,3,0,"tbody",null,O),g(58,"async"),r(),a(59,"infinite-paginator",34),g(60,"async"),C("onNextPage",function(){m(e);let t=l();return _(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){m(e);let t=l();return _(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){m(e);let t=l();return _(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(i&2){let e,o,t,n=l();d("headerTitle","Inventory Comparison")("pageData",n.pageData)("hideSearchBox",!1),s(3),d("ngIf",v(4,21,n.products$)),s(6),d("ngModel",(n.searchFilter==null?null:n.searchFilter.LocationID)||(n.searchFilter==null?null:n.searchFilter.ChannelID)),s(4),b("ngModel",n.searchFilter.PageNumber),s(4),b("ngModel",n.searchFilter.RowCount),s(5),b("ngModel",n.searchFilter.QuantityFrom),s(2),b("ngModel",n.searchFilter.QuantityTo),s(5),d("ngIf",(n.searchFilter==null?null:n.searchFilter.filterModel)==3),s(14),d("ngIf",v(44,23,n.products$)),s(5),d("matTooltip",((e=n.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=n.channelIdentity())==null?null:e.label:""),s(),d("src",(o=n.channelIdentity())==null?null:o.img,V),s(2),E(" ",R(52,25,(t=n.channelIdentity())==null?null:t.label,13)," "),s(2),y(n.isShowReservedColumn?53:-1),s(3),j(v(58,28,n.products$)),s(3),d("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",v(60,30,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}var Zt=(()=>{class i{constructor(e,o,t,n,u,I,Re,Ne){this.http=e,this.toastr=o,this.dialog=t,this.productService=n,this.authService=u,this.biggerPictureService=I,this.inventoryService=Re,this.mainPanelService=Ne,this.infinitePagination=K(G),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=f.MinDate,this.isShowReservedColumn=!0,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.guidEmpty=f.GuidEMpty,this.selectedChannel=W(null),this.channelIdentity=W({img:null,label:null}),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.hostName=this.authService.getDomain(),this.initPageLoader(),this.sourceObs$=this.infinitePagination.data$.pipe($(e=>{this.checkShowReservedColumn(e)}),A(e=>(e=this.calculateAvailableStock(e),e)),B(1)),this.products$=this.sourceObs$}calculateAvailableStock(e){return e.map(t=>(t.totalAvailable=t.Variants.reduce((n,u)=>(n+=u.I?.Available||0,n),0),t))}checkShowReservedColumn(e){let o=0,t;e.forEach(n=>{t=n.Variants.find(u=>f.IsNotEmpty(u?.Channel[0]?.InventoryReserved)),t&&(o+=1)}),this.isShowReservedColumn=o>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(B(1),$(e=>{this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID,LocationID:e.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!e.Filter.IsMarketplaceAppActive)}))}onChannelChange(e){let o=Object.assign({},e);this.selectedChannel.set(o),f.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let e=Object.assign({},this.selectedChannel());f.IsNotEmpty(e.parent)?(this.searchFilter.LocationID=e.id,this.searchFilter.ChannelID=e?.parent?.id,e.label=e?.parent?.label+" - "+e?.label,e.img=f.getChannelLogoByTypeId(e?.parent?.typeid)):(this.searchFilter.LocationID=null,e.img=f.getChannelLogoByTypeId(e?.typeid),this.searchFilter.ChannelID=e?.id,this.selectedChannel.set(e)),this.channelIdentity.update(()=>({img:e.img,label:e.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(e){e&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
2
2
|
Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}onSearch(e){this.searchFilter.text=e,this.setChannelFilter(),this.initReloadData()}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let o=this.productService.selectedVariantProduct(e);if(o.length>0){let t=this.searchFilter.LocationID,n=o.map(I=>L({ID:I.ID,Code:I.Code,Inventory:I.Inventory},f.IsNotEmpty(t)&&{LocationID:t})),u={ListChannelID:[this.searchFilter.ChannelID],List:n};this.http.post("/api/Inventory/UpdateChannel",u).subscribe(I=>{this.initReloadData(),this.checkboxState=!1,this.handlingUpdateStock(I)})}}handlingUpdateStock(e){if(e[0]?.Response){let o=e[0]?.Response?.Fail_list,t=e[0]?.Response?.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",t,o)}else this.toastr.error(e[0]?.Exception,"Error")}refreshInventory(e,o,t,n){let u={ChannelItemID:e,ChannelVariationID:o,ChannelID:t,VariantID:n};this.http.post("/api/Inventory/RefreshInventoryChannel",u).subscribe(I=>{this.toastr.success("Successfully updated","Success"),this.initReloadData()})}onCheckboxStateProduct(e){e.Variants=e.Variants.map(o=>(o.Inventory>=0&&(o.selected=e.selected),o))}onCheckboxStateChange(e){e=e.map(o=>(o.Variants=o.Variants.map(t=>(t.selected=this.checkboxState,t)),o))}openTableDialog(e,o,t){this.dialog.open(Me,{data:{Name:e.Name,Variant:o,ChannelID:o?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:e.ChannelItemID}}).afterClosed().pipe(Y(u=>f.IsNotEmpty(u))).subscribe(u=>{this.updateItemAfterDialog(u)})}updateItemAfterDialog(e){let o=this.searchFilter.LocationID,t=L({ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:parseFloat(e.Inventory),VariantID:e.ID,SKU:e.Sku},f.IsNotEmpty(o)&&{LocationID:o});this.http.post("/api/Inventory/UpdateQuantityByItem",t).subscribe(n=>{this.searchFilter.PageNumber=1,this.initReloadData(),this.handlingUpdateStock([n])})}onScanInventory(e){let o=this.productService.selectedVariantProduct(e);this.inventoryService.refreshInventory(o).subscribe(()=>{this.initReloadData(),this.toastr.success("Inventory refreshed successfully","Success")})}openExportDialog(){this.dialog.open(Ve,{data:{title:"Export Inventory Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,QuantityFrom:this.searchFilter.QuantityFrom,QuantityTo:this.searchFilter.QuantityTo,exportApi:"Inventory/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=H.DIFFERENCE:this.searchFilter.filterModel=H.ALL,this.initReloadData()}onZoomImage(e,o){this.biggerPictureService.openBiggerPicture(e,o)}onSortVariant(e){if(e.direction==""){this.products$=this.sourceObs$;return}this.products$=this.products$.pipe(A(o=>o.map(t=>(t.Variants=t.Variants.sort((n,u)=>f.compare(n.I?.Available,u.I?.Available,e.direction==="asc")),t)).sort((t,n)=>f.compare(t.totalAvailable,n.totalAvailable,e.direction==="asc"))))}static{this.\u0275fac=function(o){return new(o||i)(w(_e),w(me),w(xe),w(be),w(ue),w(Fe),w(N),w(fe))}}static{this.\u0275cmp=Z({type:i,selectors:[["app-single-channel-comparison"]],features:[X([G,N])],decls:2,vars:3,consts:[["SYNCDATE",""],["EMPTY_RESERVED",""],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"onSubmit","headerTitle","pageData","hideSearchBox"],[1,"d-flex"],[4,"ngIf"],["for","channelOptions",1,"fw-bold","mb-2"],["id","channelOptions",3,"onChannelChange","ngModel"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],["matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col","mat-sort-header","Available","arrowPosition","before",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["class","btn btn-outline-dark me-3","matTooltip","Fetch the latest stock directly from the channel",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary","shadow","rounded"],["matTooltip","Fetch the latest stock directly from the channel",1,"btn","btn-outline-dark","me-3",3,"click"],[1,"fa-solid","fa-arrows-rotate","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-success","btn-sm","dropdown-toggle","border-start"],[1,"dropdown-menu","dropdown-menu-end","pointer"],["role","button",1,"dropdown-item","cursor-pointer","fs-5",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"align-middle"],["type","checkbox",3,"ngModel"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"width","0%",3,"rowSpan"],["type","checkbox",1,"me-3",3,"ngModel"],[3,"ngClass"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Stock Available"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-end",3,"ngClass"],["class","cursor",3,"click",4,"ngIf"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom","pt-1"],[1,"cursor",3,"click"],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"]],template:function(o,t){o&1&&(h(0,dt,61,32,"mainpanel",2),g(1,"async")),o&2&&d("ngIf",v(1,1,t.loader$))},dependencies:[oe,J,ee,te,ie,ne,ve,Se,he,pe,le,ce,ae,re,se,Pe,De,de,Ee,Te,ge,Ce,we,ye,Ie,ke],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]})}}return i})();export{Zt as SingleChannelComparisonComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as xe,b as Ce}from"./chunk-743EWFUY.js";import{a as ge,b as ue}from"./chunk-YXFTLQ5M.js";import{b as se}from"./chunk-J7AGLBPL.js";import{a as de}from"./chunk-VGXQU74M.js";import{a as pe}from"./chunk-RIHLYYZU.js";import{a as ne,l as le}from"./chunk-IHYEQWAY.js";import{d as _e,h as me}from"./chunk-ITTRZMEX.js";import{r as ae,s as ce}from"./chunk-TMFFA26Y.js";import{b as J,h as Q,m as ee,y as te}from"./chunk-DPLEMBB4.js";import{c as ie,e as oe,f as re}from"./chunk-PXB4YEY3.js";import{d as Z,f as q,g as K,i as X,m as Y,n as G}from"./chunk-GPEVUTDI.js";import{$c as H,Dc as b,Eb as z,Ec as s,Fc as V,Gc as y,Ic as k,Jc as O,Ka as $,Kb as p,Kc as D,Na as B,Qc as u,Wb as m,Zc as N,_c as R,ad as w,bc as v,ca as W,cc as P,ec as E,f as L,fc as M,gc as a,hc as _,ic as I,jc as C,kc as h,lc as U,mc as f,ob as S,qb as r,rc as T,sc as o,vc as A,wb as F,ya as d,za as g}from"./chunk-T5ONJF63.js";var j=t=>[t],fe=t=>({"text-decoration-line-through":t}),Te=t=>({"ms-10":t}),be=t=>({"text-danger":t}),ye=t=>({"bg-gradient-warning":t});function Se(t,c){if(t&1){let e=f();a(0,"mat-slide-toggle",13),T("toggleChange",function(){d(e);let n=o();return n.toggleStatus=!n.toggleStatus,g(n.onToggle())}),a(1,"small",14),s(2),_()()}if(t&2){let e=o();r(2),y(" ",e.productToggleTitle?e.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function ve(t,c){if(t&1){let e=f();a(0,"th")(1,"input",16),D("ngModelChange",function(n){d(e);let l=o(2);return O(l.checkboxState,n)||(l.checkboxState=n),g(n)}),T("ngModelChange",function(){d(e);let n=o(2);return g(n.onCheckboxStateChange())}),_()()}if(t&2){let e=o(2);r(),k("ngModel",e.checkboxState)}}function Ie(t,c){if(t&1&&(p(0,ve,2,1,"ng-template",15),a(1,"th",11),s(2,"POS"),_()),t&2){let e=o();m("ngxPermissionsOnly",u(1,j,e.rolePriceEdit))}}function we(t,c){if(t&1&&(C(0),a(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),a(5,"div",21),s(6),N(7,"stringLimit"),_()()()(),h()),t&2){let e=c.$implicit;r(3),m("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),m("src",e==null?null:e.Img,S),r(2),y(" ",H(7,3,e.Name,20)," ")}}function Fe(t,c){t&1&&U(0)}function Pe(t,c){if(t&1&&(C(0),p(1,Fe,1,0,"ng-container",33),h()),t&2){o();let e=b(7);r(),m("ngTemplateOutlet",e)}}function Ee(t,c){t&1&&U(0)}function Me(t,c){if(t&1&&p(0,Ee,1,0,"ng-container",33),t&2){o(2);let e=b(7);m("ngTemplateOutlet",e)}}function Ve(t,c){if(t&1&&p(0,Me,1,1,"ng-template",15),t&2){let e=o(4);m("ngxPermissionsOnly",u(1,j,e.rolePriceEdit))}}function ke(t,c){if(t&1){let e=f();C(0),a(1,"input",34),D("ngModelChange",function(n){d(e);let l=o(4).$implicit;return O(l.selected,n)||(l.selected=n),g(n)}),T("ngModelChange",function(){d(e);let n=o(4).$implicit,l=o();return g(l.onCheckboxStateProduct(n.ID))}),_(),h()}if(t&2){let e=o(4).$implicit;r(),k("ngModel",e.selected),m("disabled",!(e!=null&&e.Category))}}function Oe(t,c){if(t&1&&p(0,ke,2,2,"ng-container",22),t&2){let e=o(3).$implicit;m("ngIf",(e==null||e.Variants==null?null:e.Variants.length)>1)}}function De(t,c){if(t&1){let e=f();C(0),a(1,"img",35),T("click",function(n){d(e);let l=o(3).$implicit,x=o();return g(x.onZoomImage(n,l==null?null:l.ImageUrl))}),_(),h()}if(t&2){let e=o(3).$implicit;r(),A("src",e==null?null:e.ThumbnailUrl,S)}}function Ne(t,c){t&1&&I(0,"img",36)}function $e(t,c){if(t&1&&(C(0),a(1,"td",28)(2,"div",29),p(3,Pe,2,1,"ng-container",30)(4,Ve,1,3,"ng-template",null,0,w)(6,Oe,1,1,"ng-template",null,1,w),a(8,"div",26),p(9,De,2,1,"ng-container",30)(10,Ne,1,0,"ng-template",null,2,w),_()()(),a(12,"td",31)(13,"div"),s(14),_(),a(15,"small",32),s(16),_()(),h()),t&2){let e=b(5),i=b(11),n=o(2).$implicit,l=o();r(),m("rowSpan",n==null?null:n.Variants.length),r(2),m("ngIf",l.table=="inventory")("ngIfElse",e),r(5),m("ngClass",u(10,Te,(n==null||n.Variants==null?null:n.Variants.length)<=1)),r(),m("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",i),r(3),m("rowSpan",n==null?null:n.Variants.length),r(2),V(n==null?null:n.Name),r(),m("ngClass",u(12,be,!(n!=null&&n.Category))),r(),y("(",n!=null&&n.Category?n==null?null:n.Category:"Not Found In POS",")")}}function Be(t,c){if(t&1&&(a(0,"a",27),I(1,"i",37),_()),t&2){let e=o().$implicit,i=o(2);m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),S)}}function Ue(t,c){if(t&1){let e=f();a(0,"input",40),D("ngModelChange",function(n){d(e);let l=o(3).$implicit;return O(l.selected,n)||(l.selected=n),g(n)}),_()}if(t&2){let e=o(3).$implicit,i=o().$implicit;k("ngModel",e.selected),m("disabled",!(i!=null&&i.Category))}}function Re(t,c){if(t&1&&(a(0,"td",38),p(1,Ue,1,2,"input",39),_()),t&2){let e=o(2).$implicit,i=o(2);r(),m("ngIf",i.printPOS(e)>=0||i.table=="price")}}function je(t,c){if(t&1&&(p(0,Re,2,1,"ng-template",15),a(1,"td",24),s(2),N(3,"number"),_()),t&2){let e=o().$implicit,i=o(2);m("ngxPermissionsOnly",u(4,j,i.rolePriceEdit)),r(2),V(R(3,2,i.printPOS(e)))}}function Le(t,c){if(t&1){let e=f();C(0),a(1,"td",41),T("click",function(){d(e);let n=o().$implicit,l=o().$implicit,x=o().$implicit,he=o();return g(he.openTableDialog(x.Name,l,n.ID,x.ChannelItemID))}),a(2,"div",29)(3,"div",42),s(4),N(5,"number"),_(),a(6,"a",43),T("click",function(n){return d(e),g(n==null?null:n.stopPropagation())}),I(7,"i",37),_()()(),h()}if(t&2){let e=c.$implicit,i=o(2).$implicit,n=o(2);r(),m("ngClass",u(5,ye,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1)),r(3),y(" ",R(5,3,n.printItem(e))," "),r(2),m("href",e.Url,S)}}function We(t,c){t&1&&(a(0,"td",44)(1,"div",29)(2,"span"),s(3,"X"),_()()())}function ze(t,c){if(t&1&&p(0,Le,8,7,"ng-container",30)(1,We,4,0,"ng-template",null,3,w),t&2){let e=c.$implicit,i=b(2),n=o().$implicit,l=o(2);m("ngIf",l.getItemFromChannel(n,e))("ngIfElse",i)}}function Ae(t,c){if(t&1&&(a(0,"tr"),p(1,$e,17,14,"ng-container",22),a(2,"td",23),s(3),_(),a(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),a(8,"div",21),p(9,Be,2,1,"a",27),_()()(),p(10,je,4,6),E(11,ze,3,2,null,null,P),_()),t&2){let e=c.$implicit,i=c.$index,n=o().$implicit,l=o();r(),m("ngIf",i==0),r(2),V(e==null?null:e.Model),r(2),m("matTooltip",e.Discontinued?l.discontinuedVariantMsg:""),r(),m("ngClass",u(7,fe,e.Discontinued)),r(),y(" ",e.Code," "),r(2),v(n.Category?9:-1),r(),v(l.hiddenIPOSInventory()==!1?10:-1),r(),M(l.channel)}}function He(t,c){if(t&1&&(a(0,"tbody"),E(1,Ae,13,9,"tr",null,P),_()),t&2){let e=c.$implicit;r(),M(e.Variants)}}var ht=(()=>{class t{constructor(e,i,n){this.dialog=e,this.biggerPictureService=i,this.authService=n,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=ne.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 $,this.destroy$=new L,this.toggle=new $,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(l=>(l.selected=n.selected,l)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState,i)),e))}getItemFromChannel(e,i){return e.Channel.find(l=>ie.IsNotEmpty(i.LocationID)?l.LocationID==i.LocationID:l.ChannelID==i.ID)}printItem(e){if(this.table=="inventory")return e.Inventory;if(this.table=="price")return e.Price}openTableDialog(e,i,n,l){this.dialog.open(xe,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table,ChannelItemID:l}}).afterClosed().pipe(W(this.destroy$)).subscribe(x=>{x!=null&&this.onSubmit.emit(x)})}printPOS(e){return this.table=="inventory"?e.Inventory?e.Inventory:0:this.table=="price"?e.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)(F(_e),F(de),F(le))}}static{this.\u0275cmp=z({type:t,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"},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,"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",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[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,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[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(i,n){i&1&&(a(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,Se,3,1,"mat-slide-toggle",9),_()(),a(9,"th",10),s(10,"Variant"),_(),a(11,"th",11),s(12,"SKU"),_(),p(13,Ie,3,3)(14,we,8,6,"ng-container",12),_()(),E(15,He,3,0,"tbody",null,P),_()()),i&2&&(r(8),v(n.showProductToggle?8:-1),r(5),v(n.hiddenIPOSInventory()==!1?13:-1),r(),m("ngForOf",n.channel),r(),M(n.data))},dependencies:[G,Z,q,K,X,Y,te,J,Q,ee,ue,ge,me,pe,se,re,oe,ce,ae,Ce],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}"]})}}return t})();export{ht as a};
|
|
1
|
+
import{a as xe,b as Ce}from"./chunk-NP3CNZCB.js";import{a as ge,b as ue}from"./chunk-YXFTLQ5M.js";import{b as se}from"./chunk-J7AGLBPL.js";import{a as de}from"./chunk-VGXQU74M.js";import{a as pe}from"./chunk-RIHLYYZU.js";import{a as ne,l as le}from"./chunk-KLNIF67L.js";import{d as _e,h as me}from"./chunk-ITTRZMEX.js";import{r as ae,s as ce}from"./chunk-TMFFA26Y.js";import{b as J,h as Q,m as ee,y as te}from"./chunk-DPLEMBB4.js";import{c as ie,e as oe,f as re}from"./chunk-PXB4YEY3.js";import{d as Z,f as q,g as K,i as X,m as Y,n as G}from"./chunk-GPEVUTDI.js";import{$c as H,Dc as b,Eb as z,Ec as s,Fc as V,Gc as y,Ic as k,Jc as O,Ka as $,Kb as p,Kc as D,Na as B,Qc as u,Wb as m,Zc as N,_c as R,ad as w,bc as v,ca as W,cc as P,ec as E,f as L,fc as M,gc as a,hc as _,ic as I,jc as C,kc as h,lc as U,mc as f,ob as S,qb as r,rc as T,sc as o,vc as A,wb as F,ya as d,za as g}from"./chunk-T5ONJF63.js";var j=t=>[t],fe=t=>({"text-decoration-line-through":t}),Te=t=>({"ms-10":t}),be=t=>({"text-danger":t}),ye=t=>({"bg-gradient-warning":t});function Se(t,c){if(t&1){let e=f();a(0,"mat-slide-toggle",13),T("toggleChange",function(){d(e);let n=o();return n.toggleStatus=!n.toggleStatus,g(n.onToggle())}),a(1,"small",14),s(2),_()()}if(t&2){let e=o();r(2),y(" ",e.productToggleTitle?e.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function ve(t,c){if(t&1){let e=f();a(0,"th")(1,"input",16),D("ngModelChange",function(n){d(e);let l=o(2);return O(l.checkboxState,n)||(l.checkboxState=n),g(n)}),T("ngModelChange",function(){d(e);let n=o(2);return g(n.onCheckboxStateChange())}),_()()}if(t&2){let e=o(2);r(),k("ngModel",e.checkboxState)}}function Ie(t,c){if(t&1&&(p(0,ve,2,1,"ng-template",15),a(1,"th",11),s(2,"POS"),_()),t&2){let e=o();m("ngxPermissionsOnly",u(1,j,e.rolePriceEdit))}}function we(t,c){if(t&1&&(C(0),a(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),a(5,"div",21),s(6),N(7,"stringLimit"),_()()()(),h()),t&2){let e=c.$implicit;r(3),m("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),m("src",e==null?null:e.Img,S),r(2),y(" ",H(7,3,e.Name,20)," ")}}function Fe(t,c){t&1&&U(0)}function Pe(t,c){if(t&1&&(C(0),p(1,Fe,1,0,"ng-container",33),h()),t&2){o();let e=b(7);r(),m("ngTemplateOutlet",e)}}function Ee(t,c){t&1&&U(0)}function Me(t,c){if(t&1&&p(0,Ee,1,0,"ng-container",33),t&2){o(2);let e=b(7);m("ngTemplateOutlet",e)}}function Ve(t,c){if(t&1&&p(0,Me,1,1,"ng-template",15),t&2){let e=o(4);m("ngxPermissionsOnly",u(1,j,e.rolePriceEdit))}}function ke(t,c){if(t&1){let e=f();C(0),a(1,"input",34),D("ngModelChange",function(n){d(e);let l=o(4).$implicit;return O(l.selected,n)||(l.selected=n),g(n)}),T("ngModelChange",function(){d(e);let n=o(4).$implicit,l=o();return g(l.onCheckboxStateProduct(n.ID))}),_(),h()}if(t&2){let e=o(4).$implicit;r(),k("ngModel",e.selected),m("disabled",!(e!=null&&e.Category))}}function Oe(t,c){if(t&1&&p(0,ke,2,2,"ng-container",22),t&2){let e=o(3).$implicit;m("ngIf",(e==null||e.Variants==null?null:e.Variants.length)>1)}}function De(t,c){if(t&1){let e=f();C(0),a(1,"img",35),T("click",function(n){d(e);let l=o(3).$implicit,x=o();return g(x.onZoomImage(n,l==null?null:l.ImageUrl))}),_(),h()}if(t&2){let e=o(3).$implicit;r(),A("src",e==null?null:e.ThumbnailUrl,S)}}function Ne(t,c){t&1&&I(0,"img",36)}function $e(t,c){if(t&1&&(C(0),a(1,"td",28)(2,"div",29),p(3,Pe,2,1,"ng-container",30)(4,Ve,1,3,"ng-template",null,0,w)(6,Oe,1,1,"ng-template",null,1,w),a(8,"div",26),p(9,De,2,1,"ng-container",30)(10,Ne,1,0,"ng-template",null,2,w),_()()(),a(12,"td",31)(13,"div"),s(14),_(),a(15,"small",32),s(16),_()(),h()),t&2){let e=b(5),i=b(11),n=o(2).$implicit,l=o();r(),m("rowSpan",n==null?null:n.Variants.length),r(2),m("ngIf",l.table=="inventory")("ngIfElse",e),r(5),m("ngClass",u(10,Te,(n==null||n.Variants==null?null:n.Variants.length)<=1)),r(),m("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",i),r(3),m("rowSpan",n==null?null:n.Variants.length),r(2),V(n==null?null:n.Name),r(),m("ngClass",u(12,be,!(n!=null&&n.Category))),r(),y("(",n!=null&&n.Category?n==null?null:n.Category:"Not Found In POS",")")}}function Be(t,c){if(t&1&&(a(0,"a",27),I(1,"i",37),_()),t&2){let e=o().$implicit,i=o(2);m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),S)}}function Ue(t,c){if(t&1){let e=f();a(0,"input",40),D("ngModelChange",function(n){d(e);let l=o(3).$implicit;return O(l.selected,n)||(l.selected=n),g(n)}),_()}if(t&2){let e=o(3).$implicit,i=o().$implicit;k("ngModel",e.selected),m("disabled",!(i!=null&&i.Category))}}function Re(t,c){if(t&1&&(a(0,"td",38),p(1,Ue,1,2,"input",39),_()),t&2){let e=o(2).$implicit,i=o(2);r(),m("ngIf",i.printPOS(e)>=0||i.table=="price")}}function je(t,c){if(t&1&&(p(0,Re,2,1,"ng-template",15),a(1,"td",24),s(2),N(3,"number"),_()),t&2){let e=o().$implicit,i=o(2);m("ngxPermissionsOnly",u(4,j,i.rolePriceEdit)),r(2),V(R(3,2,i.printPOS(e)))}}function Le(t,c){if(t&1){let e=f();C(0),a(1,"td",41),T("click",function(){d(e);let n=o().$implicit,l=o().$implicit,x=o().$implicit,he=o();return g(he.openTableDialog(x.Name,l,n.ID,x.ChannelItemID))}),a(2,"div",29)(3,"div",42),s(4),N(5,"number"),_(),a(6,"a",43),T("click",function(n){return d(e),g(n==null?null:n.stopPropagation())}),I(7,"i",37),_()()(),h()}if(t&2){let e=c.$implicit,i=o(2).$implicit,n=o(2);r(),m("ngClass",u(5,ye,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1)),r(3),y(" ",R(5,3,n.printItem(e))," "),r(2),m("href",e.Url,S)}}function We(t,c){t&1&&(a(0,"td",44)(1,"div",29)(2,"span"),s(3,"X"),_()()())}function ze(t,c){if(t&1&&p(0,Le,8,7,"ng-container",30)(1,We,4,0,"ng-template",null,3,w),t&2){let e=c.$implicit,i=b(2),n=o().$implicit,l=o(2);m("ngIf",l.getItemFromChannel(n,e))("ngIfElse",i)}}function Ae(t,c){if(t&1&&(a(0,"tr"),p(1,$e,17,14,"ng-container",22),a(2,"td",23),s(3),_(),a(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),a(8,"div",21),p(9,Be,2,1,"a",27),_()()(),p(10,je,4,6),E(11,ze,3,2,null,null,P),_()),t&2){let e=c.$implicit,i=c.$index,n=o().$implicit,l=o();r(),m("ngIf",i==0),r(2),V(e==null?null:e.Model),r(2),m("matTooltip",e.Discontinued?l.discontinuedVariantMsg:""),r(),m("ngClass",u(7,fe,e.Discontinued)),r(),y(" ",e.Code," "),r(2),v(n.Category?9:-1),r(),v(l.hiddenIPOSInventory()==!1?10:-1),r(),M(l.channel)}}function He(t,c){if(t&1&&(a(0,"tbody"),E(1,Ae,13,9,"tr",null,P),_()),t&2){let e=c.$implicit;r(),M(e.Variants)}}var ht=(()=>{class t{constructor(e,i,n){this.dialog=e,this.biggerPictureService=i,this.authService=n,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=ne.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 $,this.destroy$=new L,this.toggle=new $,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(l=>(l.selected=n.selected,l)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState,i)),e))}getItemFromChannel(e,i){return e.Channel.find(l=>ie.IsNotEmpty(i.LocationID)?l.LocationID==i.LocationID:l.ChannelID==i.ID)}printItem(e){if(this.table=="inventory")return e.Inventory;if(this.table=="price")return e.Price}openTableDialog(e,i,n,l){this.dialog.open(xe,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table,ChannelItemID:l}}).afterClosed().pipe(W(this.destroy$)).subscribe(x=>{x!=null&&this.onSubmit.emit(x)})}printPOS(e){return this.table=="inventory"?e.Inventory?e.Inventory:0:this.table=="price"?e.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)(F(_e),F(de),F(le))}}static{this.\u0275cmp=z({type:t,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"},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,"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",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[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,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[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(i,n){i&1&&(a(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,Se,3,1,"mat-slide-toggle",9),_()(),a(9,"th",10),s(10,"Variant"),_(),a(11,"th",11),s(12,"SKU"),_(),p(13,Ie,3,3)(14,we,8,6,"ng-container",12),_()(),E(15,He,3,0,"tbody",null,P),_()()),i&2&&(r(8),v(n.showProductToggle?8:-1),r(5),v(n.hiddenIPOSInventory()==!1?13:-1),r(),m("ngForOf",n.channel),r(),M(n.data))},dependencies:[G,Z,q,K,X,Y,te,J,Q,ee,ue,ge,me,pe,se,re,oe,ce,ae,Ce],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}"]})}}return t})();export{ht as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as c}from"./chunk-OE2JYQHN.js";import{a as l}from"./chunk-
|
|
1
|
+
import{b as c}from"./chunk-OE2JYQHN.js";import{a as l}from"./chunk-C6G3B77L.js";import"./chunk-KLNIF67L.js";import"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import{n as u}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{y as s}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{F as a,J as n,n as i}from"./chunk-GPEVUTDI.js";import{Eb as p,Fb as r,ic as d,ka as e}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var M=(()=>{class t{constructor(){}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=p({type:t,selectors:[["app-report"]],standalone:!1,decls:1,vars:0,template:function(o,C){o&1&&d(0,"router-outlet")},dependencies:[a],styles:["ul[_ngcontent-%COMP%] > li.dropdown-item[_ngcontent-%COMP%]{font-size:.6875rem!important}"]})}}return t})();var R=[{path:"",component:M,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",loadChildren:()=>import("./chunk-6LYB3OX6.js").then(t=>t.OrderModule),canActivate:[l]}]}],h=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=r({type:t})}static{this.\u0275inj=e({imports:[i,n.forChild(R)]})}}return t})();var S=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=r({type:t})}static{this.\u0275inj=e({imports:[i,c,h,s,u,n]})}}return t})();export{S as ReportModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Y}from"./chunk-
|
|
1
|
+
import{a as Y}from"./chunk-XN4O5YGO.js";import{e as J}from"./chunk-6IAGGRZN.js";import{j as H}from"./chunk-KLNIF67L.js";import{b as j,e as F}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import{m as G,n as U}from"./chunk-ITTRZMEX.js";import"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as B,h as D,m as I,y as R}from"./chunk-DPLEMBB4.js";import"./chunk-PXB4YEY3.js";import{j as P,l as W,n as k}from"./chunk-GPEVUTDI.js";import{Eb as x,Ec as i,Fc as E,Ic as C,Jc as b,Kb as M,Kc as _,Lc as T,Mc as V,Nc as v,Qa as h,Wb as f,Z as y,Zc as S,_c as w,bc as O,gc as e,hc as t,ic as A,mc as L,pa as u,qb as d,rc as g,sc as N,ya as s,za as m}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";function z(n,q){if(n&1&&(e(0,"pre",21),i(1),S(2,"json"),t()),n&2){N();let l=v(25);d(),E(w(2,1,l))}}function K(n,q){n&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var ce=(()=>{class n{constructor(){this.httpService=u(F),this.toastr=u(j),this.selectedChannel=h(null),this.orderNumber=h(null)}fetchLog(){if(!this.selectedChannel()||!this.orderNumber()){this.toastr.warning("Please select a channel and enter an order number","Warning");return}this.orderLog$=this.httpService.post(H.GetOrderApiLog,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(y(1))}copyToClipboard(l){if(!l)return;let p=typeof l=="string"?l:JSON.stringify(l,null,2);navigator.clipboard.writeText(p),this.toastr.success("Copied to clipboard!","Success")}static{this.\u0275fac=function(p){return new(p||n)}}static{this.\u0275cmp=x({type:n,selectors:[["app-order-api"]],decls:40,vars:9,consts:[["headerTitle","Origin Order Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","orderLogText"],[1,"text-center","my-12","text-muted"]],template:function(p,r){if(p&1){let a=L();e(0,"mainpanel",0)(1,"actions")(2,"button",1),g("click",function(){return s(a),m(r.fetchLog())}),A(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," View logs related to Order API activities. "),t()(),e(15,"div",9)(16,"channel-select-options",10),_("ngModelChange",function(o){return s(a),b(r.selectedChannel,o)||(r.selectedChannel=o),m(o)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Order Number"),t(),e(21,"p",8),i(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),_("ngModelChange",function(o){return s(a),b(r.orderNumber,o)||(r.orderNumber=o),m(o)}),t()()()()(),T(25),S(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),g("click",function(){s(a);let o=v(25);return m(r.copyToClipboard(o))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),M(38,z,3,3,"pre",21)(39,K,2,0,"p",22),t()()()()()()()()()}if(p&2){f("hideSearchBox",!0)("hideSearchDropdown",!0),d(16),C("ngModel",r.selectedChannel),d(8),C("ngModel",r.orderNumber),d();let a=V(w(26,6,r.orderLog$));d(8),f("disabled",!a),d(5),O(a?38:39)}},dependencies:[k,P,W,U,G,J,R,B,D,I,Y],encapsulation:2})}}return n})();export{ce as OrderApiComponent};
|