marketplacepos 2.4.0 → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/102.00a16fb36f5a57f2.js +1 -0
- package/Marketplace/162.9784f9e579112c86.js +1 -0
- package/Marketplace/285.7583f3169c88c210.js +1 -0
- package/Marketplace/387.10f091023152d154.js +1 -0
- package/Marketplace/3rdpartylicenses.txt +25 -0
- package/Marketplace/402.60951eab064c9706.js +1 -0
- package/Marketplace/455.fc7663306b753727.js +1 -0
- package/Marketplace/458.556f206f7d19bc29.js +1 -0
- package/Marketplace/585.9e916b668a91cc94.js +1 -0
- package/Marketplace/616.fb179a9605c3e98c.js +1 -0
- package/Marketplace/667.b7320f874219caa9.js +1 -0
- package/Marketplace/785.a0973529f8e8819e.js +1 -0
- package/Marketplace/796.d34bd45b5a924fca.js +1 -0
- package/Marketplace/832.40bafce037098f88.js +1 -0
- package/Marketplace/874.9879a8b9489c9845.js +1 -0
- package/Marketplace/882.5d3edc53a8e4c38e.js +1 -0
- package/Marketplace/assets/lbd/_sidebar-and-main-panel.scss +0 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/main.f30bf3b0f501021c.js +1 -0
- package/Marketplace/runtime.9cbc4802b0456746.js +1 -0
- package/Marketplace/scripts.09af772bfa77d50d.js +1 -0
- package/Marketplace/styles.f8366e17917068bd.css +20 -0
- package/package.json +1 -1
- package/Marketplace/146.bc63745556a7579e.js +0 -1
- package/Marketplace/285.1f547ef81e91fc15.js +0 -1
- package/Marketplace/288.9b236c96f7411cc2.js +0 -1
- package/Marketplace/327.72c9ed40548e876f.js +0 -1
- package/Marketplace/402.76aaae9b8dfdc4fd.js +0 -1
- package/Marketplace/458.175fffe756700561.js +0 -1
- package/Marketplace/466.02b13502d80588a2.js +0 -1
- package/Marketplace/472.2a25cc631023dd9d.js +0 -1
- package/Marketplace/585.c93552ac67f4550c.js +0 -1
- package/Marketplace/61.6bf2570c9c03e65d.js +0 -1
- package/Marketplace/616.507588c0a5d7b9e1.js +0 -1
- package/Marketplace/767.297995f3aba0da57.js +0 -1
- package/Marketplace/796.3be8ad424aad7864.js +0 -1
- package/Marketplace/970.3f4eb2182e0ed6ff.js +0 -1
- package/Marketplace/main.7b5711d2efb046b5.js +0 -1
- package/Marketplace/runtime.ec27a3ee2f27cef3.js +0 -1
- package/Marketplace/scripts.512baec01df5d79f.js +0 -1
- package/Marketplace/styles.84477c613818f650.css +0 -39
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[472],{1472:(fn,d,s)=>{s.r(d),s.d(d,{InventoryModule:()=>dn});var u=s(6895),n=s(4650),h=s(8252),f=s(7398);let D=(()=>{class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=n.Xpm({type:e,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(t,o){1&t&&(n.TgZ(0,"nav",0)(1,"div",1)(2,"div"),n._UZ(3,"nav-tab",2),n.qZA()()(),n._UZ(4,"router-outlet")),2&t&&(n.xp6(3),n.Q6J("Tabs",o.inventoryTabs))},dependencies:[h.lC,f.e]}),e})();var v=s(5241),A=s(2486),C=s(8505),I=s(1318),y=s(7185),x=s(5412),b=s(7287),m=s(7481),S=s(488);function N(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",17),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2).ngIf,i=n.oxw();return n.KtG(i.openScanDialog(a.Options.Channel))}),n._UZ(1,"i",18),n._uU(2," Scan Channel "),n.qZA()}}function P(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",19),n.NdJ("click",function(){n.CHM(t);const a=n.oxw().ngIf,i=n.oxw().ngIf,r=n.oxw();return n.KtG(r.onUpdateItems(a,i.Options.Channel))}),n._UZ(1,"i",20),n._uU(2," Update "),n.qZA()}}function M(e,l){if(1&e&&(n.TgZ(0,"actions")(1,"div",14)(2,"div"),n.YNc(3,N,3,0,"button",15),n.YNc(4,P,3,0,"button",16),n.qZA()()()),2&e){const t=l.ngIf,o=n.oxw(2);n.xp6(3),n.Q6J("ngIf",!o.hasSelection(t)),n.xp6(1),n.Q6J("ngIf",o.hasSelection(t))}}function R(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"app-table",21),n.NdJ("onToggle",function(a){n.CHM(t);const i=n.oxw(2);return n.KtG(i.onShowDifferenceStock(a))})("onSubmit",function(a){const r=n.CHM(t).ngIf,c=n.oxw(2);return n.KtG(c.UpdateStockByVariant(a,r))}),n.qZA()}if(2&e){const t=l.ngIf,o=n.oxw().ngIf,a=n.oxw();n.Q6J("data",t)("channel",a.channelOptions)("showProductToggle",!0)("filter",o.Filter)}}function U(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"span",22),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.getAllDataCount())}),n.TgZ(1,"i",23),n._uU(2,"?"),n.qZA()()}}function k(e,l){if(1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&e){const t=l.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,t))}}function J(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",24),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.nextPage())}),n._UZ(1,"i",25),n._uU(2," Next"),n.qZA()}}function L(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",26),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.getAllData())}),n._UZ(1,"i",27),n._uU(2," Last"),n.qZA()}}function Q(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(a){n.CHM(t);const i=n.oxw();return n.KtG(i.onSearch(a))}),n.YNc(1,M,5,2,"actions",2),n.ALo(2,"async"),n.TgZ(3,"content")(4,"div",3)(5,"div",4)(6,"div",5),n.YNc(7,R,1,4,"app-table",6),n.ALo(8,"async"),n.TgZ(9,"div",7)(10,"div",8)(11,"div",9),n._uU(12),n.ALo(13,"number"),n.ALo(14,"async"),n.YNc(15,U,3,0,"span",10),n.YNc(16,k,3,3,"span",2),n.ALo(17,"async"),n._uU(18),n.qZA()(),n.TgZ(19,"div",11),n.YNc(20,J,3,0,"a",12),n.YNc(21,L,3,0,"a",13),n.qZA()()()()()()()}if(2&e){const t=n.oxw();let o;n.Q6J("pageData",t.pageData)("hideSearchBox",!1)("hideSearchDropdown",!0)("textButton","Search"),n.xp6(1),n.Q6J("ngIf",n.lcZ(2,12,t.paginationService.data$)),n.xp6(6),n.Q6J("ngIf",n.lcZ(8,14,t.paginationService.data$)),n.xp6(5),n.hij(" Showing 1 - ",n.lcZ(13,16,null==(o=n.lcZ(14,18,t.paginationService.data$))?null:o.length)," of "),n.xp6(3),n.Q6J("ngIf",t.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(17,20,!t.paginationService.hideCount&&t.allDataCount$)),n.xp6(2),n.hij(" records ~ ",t.paginationService.footerPageNumber," Page "),n.xp6(2),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}let O=(()=>{class e{constructor(t,o,a,i){this.http=t,this.toastr=o,this.dialog=a,this.paginationService=i,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.Options=[{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}]}}ngOnInit(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe((0,C.b)(t=>{this.channelOptions=t.Options.Channel,t.Filter={PageNumber:t.Filter.PageNumber,filterModel:1,RowCount:t.Filter.PageSize},this.searchFilter=t.Filter,this.paginationService.resetToFirstPage(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(t,o){let a=this.getSelected(t);if(a.length>0){let r=[];a.forEach(p=>r.push({ID:p.ID,Code:p.Code,Inventory:p.Inventory}));var i=[];for(let p of o)p.selected&&i.push(p.ID);let c={ListChannelID:i,List:r};this.http.post("/api/Inventory/UpdateChannel",c).subscribe(p=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+c.List.length+" variants in "+c.ListChannelID.length+" channels","Success")})}}openScanDialog(t){this.dialog.open(v.j,{data:{filter:this.searchFilter,Channel:t},width:"30%"}).afterClosed().subscribe(a=>{null!=a&&(this.searchFilter=a.filter,this.searchFilter.sync?this.RefreshChannel():this.searchFilter.sync||this.RefreshChannel())})}RefreshChannel(){let t={ID:this.searchFilter.ChannelID,ScanFull:this.searchFilter.ScanFull};this.http.post("/api/product/ScanOptimized",t).subscribe(o=>{this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully scanned from "+this.getChannelName(t.ID),"Success")})}UpdateStockByVariant(t,o){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(i=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+this.getChannelName(a.ID)+" to "+a.NewQuantity,"Success");for(let r of o)if(r.ChannelItemID===t.ChannelItemID)for(let c of r.Variants)c.ChannelVariationID==t.ChannelVariantID&&(c.Stock=parseFloat(t.Inventory))})}getSelected(t){let o=[];if(t){for(let a of t)for(let i of a.Variants)i.selected&&o.push(i);return o}return[]}hasSelection(t){return!!t&&this.getSelected(t).length>0}getChannelName(t){return this.channelOptions.find(a=>a.ID==t).Name}onShowDifferenceStock(t){this.searchFilter.filterModel=t?3:1,this.paginationService.resetToFirstPage(this.searchFilter)}onUpdateItems(t,o){const a=this.getSelected(t);this.dialog.open(A.j,{data:{selectedItems:a,channels:o},width:"40%"}).afterClosed().subscribe(i=>{i&&this.updateStock(t,i)})}getAllDataCount(){this.paginationService.hideCount=!1,this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,{})}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()}}return e.\u0275fac=function(t){return new(t||e)(n.Y36(I.O),n.Y36(y._W),n.Y36(x.uw),n.Y36(b.b))},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-inventory-pos"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","hideSearchDropdown","textButton","onSubmit"],[4,"ngIf"],[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","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",3,"click"],[1,"fas","fa-share"]],template:function(t,o){1&t&&(n.YNc(0,Q,22,22,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,o.loader$))},dependencies:[u.O5,m.p,S.a,u.Ov,u.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]}),e})();var V=s(7945),T=s(9300),Y=s(6082),_=s(4006),g=s(8796),Z=s(455),w=s(266);function q(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",32),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2).ngIf,i=n.oxw();return n.KtG(i.openScanDialog(a))}),n._UZ(1,"i",33),n._uU(2," Scan Channel "),n.qZA()}}function $(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",34),n.NdJ("click",function(){n.CHM(t);const a=n.oxw().ngIf,i=n.oxw(2);return n.KtG(i.updateStock(a))}),n._UZ(1,"i",35),n._uU(2," Update"),n.qZA()}}function K(e,l){if(1&e&&(n.TgZ(0,"div"),n.YNc(1,q,3,0,"button",30),n.YNc(2,$,3,0,"button",31),n.qZA()),2&e){const t=l.ngIf,o=n.oxw(2);n.xp6(1),n.Q6J("ngIf",!o.productService.hasSelectionVariant(t)),n.xp6(1),n.Q6J("ngIf",o.productService.hasSelectionVariant(t))}}function G(e,l){1&e&&(n.TgZ(0,"div",36)(1,"span"),n._uU(2," showing only different stock, please press next to populate more data "),n.qZA()())}function E(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"th")(1,"input",37),n.NdJ("ngModelChange",function(a){n.CHM(t);const i=n.oxw(2);return n.KtG(i.checkboxState=a)})("ngModelChange",function(){const i=n.CHM(t).ngIf,r=n.oxw(2);return n.KtG(r.onCheckboxStateChange(i))}),n.qZA()()}if(2&e){const t=n.oxw(2);n.xp6(1),n.Q6J("ngModel",t.checkboxState)}}function H(e,l){if(1&e&&(n.TgZ(0,"ng-option",38),n._UZ(1,"img",39),n._uU(2),n.qZA()),2&e){const t=l.$implicit;n.Q6J("value",t.ID),n.xp6(1),n.s9C("src",t.Img,n.LSH),n.xp6(1),n.Oqu(t.Name)}}function B(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"input",57),n.NdJ("ngModelChange",function(a){n.CHM(t);const i=n.oxw(3).$implicit;return n.KtG(i.selected=a)})("ngModelChange",function(){n.CHM(t);const a=n.oxw(3).$implicit,i=n.oxw(2);return n.KtG(i.onCheckboxStateProduct(a))}),n.qZA()}if(2&e){const t=n.oxw(3).$implicit;n.Q6J("ngModel",t.selected)}}function j(e,l){if(1&e&&n._UZ(0,"img",58),2&e){const t=n.oxw(3).$implicit;n.s9C("src",null==t?null:t.ThumbnailUrl,n.LSH)}}function z(e,l){1&e&&n._UZ(0,"img",59)}function W(e,l){if(1&e&&(n.ynx(0),n.TgZ(1,"td",50)(2,"div",51),n.YNc(3,B,1,1,"input",52),n.YNc(4,j,1,1,"img",53),n.YNc(5,z,1,0,"ng-template",null,54,n.W1O),n.qZA()(),n.TgZ(7,"td",55)(8,"span",56),n._uU(9),n.qZA(),n._UZ(10,"br"),n.TgZ(11,"small"),n._uU(12),n.qZA()(),n.BQk()),2&e){const t=n.MAs(6),o=n.oxw().$implicit,a=n.oxw().$implicit;n.xp6(1),n.Q6J("rowSpan",null==a?null:a.Variants.length),n.xp6(2),n.Q6J("ngIf",(null==o?null:o.Inventory)>=0||a.Variants.length>1),n.xp6(1),n.Q6J("ngIf",null==a?null:a.ThumbnailUrl)("ngIfElse",t),n.xp6(3),n.Q6J("rowSpan",null==a?null:a.Variants.length),n.xp6(2),n.Oqu(null==a?null:a.Name),n.xp6(3),n.hij("(",null==a?null:a.Category,")")}}function X(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"input",37),n.NdJ("ngModelChange",function(a){n.CHM(t);const i=n.oxw().$implicit;return n.KtG(i.selected=a)}),n.qZA()}if(2&e){const t=n.oxw().$implicit;n.Q6J("ngModel",t.selected)}}function nn(e,l){if(1&e&&(n.TgZ(0,"span")(1,"span",60),n._uU(2),n.ALo(3,"number"),n.qZA(),n._uU(4," => "),n.TgZ(5,"span",61),n._uU(6),n.ALo(7,"number"),n.qZA()()),2&e){const t=n.oxw().$implicit;n.xp6(2),n.hij(" ",n.lcZ(3,2,null==t||null==t.I?null:t.I.Available),""),n.xp6(4),n.Oqu(n.lcZ(7,4,null==t?null:t.Inventory))}}function tn(e,l){if(1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&e){const t=n.oxw().$implicit;n.xp6(1),n.hij(" ",n.lcZ(2,1,null==t?null:t.Inventory)," ")}}const en=function(e){return{"bg-err":e}};function on(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"td",62)(1,"div",63)(2,"div",64),n.NdJ("click",function(){n.CHM(t);const a=n.oxw().$implicit,i=n.oxw(),r=i.$implicit,c=i.ngForOf,p=n.oxw(2);return n.KtG(p.openTableDialog(r,a,c))}),n._uU(3),n.ALo(4,"number"),n.qZA()()()}if(2&e){const t=n.oxw().$implicit;n.Q6J("ngClass",n.VKq(4,en,(null==t?null:t.Inventory)!=(null==t||null==t.Channel[0]?null:t.Channel[0].Inventory))),n.xp6(3),n.hij(" ",n.lcZ(4,2,null==t||null==t.Channel[0]?null:t.Channel[0].Inventory)," ")}}function an(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"tr"),n.YNc(1,W,13,7,"ng-container",3),n.TgZ(2,"td",40),n._uU(3),n.qZA(),n.TgZ(4,"td",41),n._uU(5),n.qZA(),n.TgZ(6,"td",42),n.YNc(7,X,1,1,"input",43),n.qZA(),n.TgZ(8,"td",41),n.YNc(9,nn,8,6,"span",3),n.YNc(10,tn,3,3,"span",3),n.qZA(),n.YNc(11,on,5,6,"td",44),n.TgZ(12,"td")(13,"div",10)(14,"div",45)(15,"a",46),n._UZ(16,"i",47),n.qZA(),n._uU(17," \xa0\xa0 "),n.TgZ(18,"span",48),n.NdJ("click",function(){const i=n.CHM(t).$implicit,r=n.oxw(3);return n.KtG(r.RefreshInventory(null==i||null==i.Channel[0]?null:i.Channel[0].ChannelItemID,null==i||null==i.Channel[0]?null:i.Channel[0].ChannelVariationID,null==i||null==i.Channel[0]?null:i.Channel[0].ChannelID,null==i?null:i.ID))}),n._UZ(19,"i",49),n.qZA()()()()()}if(2&e){const t=l.$implicit,o=l.index;n.xp6(1),n.Q6J("ngIf",0==o),n.xp6(2),n.Oqu(null==t?null:t.Model),n.xp6(2),n.hij(" ",null==t?null:t.Code," "),n.xp6(2),n.Q6J("ngIf",(null==t?null:t.Inventory)>=0),n.xp6(2),n.Q6J("ngIf",(null==t?null:t.Inventory)!=(null==t||null==t.I?null:t.I.Available)),n.xp6(1),n.Q6J("ngIf",(null==t?null:t.Inventory)==(null==t||null==t.I?null:t.I.Available)),n.xp6(1),n.Q6J("ngIf",null==t?null:t.Channel),n.xp6(4),n.Q6J("href",null==t||null==t.Channel[0]?null:t.Channel[0].Url,n.LSH)}}function ln(e,l){if(1&e&&(n.TgZ(0,"tbody"),n.YNc(1,an,20,8,"tr",24),n.qZA()),2&e){const t=l.$implicit;n.xp6(1),n.Q6J("ngForOf",t.Variants)}}function rn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"span",65),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(2);return n.KtG(a.getRowCount())}),n.TgZ(1,"i",66),n._uU(2,"?"),n.qZA()()}}function sn(e,l){if(1&e&&(n.TgZ(0,"span"),n._uU(1),n.ALo(2,"number"),n.qZA()),2&e){const t=l.ngIf;n.xp6(1),n.Oqu(n.lcZ(2,1,null==t?null:t.Total))}}function cn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",70),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(3);return n.KtG(a.onNextPage())}),n._UZ(1,"i",71),n._uU(2," Next"),n.qZA()}}function pn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",72),n.NdJ("click",function(){n.CHM(t);const a=n.oxw(3);return n.KtG(a.onLastPage())}),n._UZ(1,"i",73),n._uU(2," Last"),n.qZA()}}function un(e,l){if(1&e&&(n.TgZ(0,"div",67),n.YNc(1,cn,3,0,"a",68),n.YNc(2,pn,3,0,"a",69),n.qZA()),2&e){const t=n.oxw(2);n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),n.xp6(1),n.Q6J("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function _n(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(a){n.CHM(t);const i=n.oxw();return n.KtG(i.onSearch(a))}),n.TgZ(1,"actions")(2,"div",2),n.YNc(3,K,3,2,"div",3),n.ALo(4,"async"),n.qZA()(),n.TgZ(5,"filters")(6,"div",2)(7,"div",4)(8,"div")(9,"label",5),n._uU(10,"PageNumber"),n.qZA(),n.TgZ(11,"input",6),n.NdJ("ngModelChange",function(a){n.CHM(t);const i=n.oxw();return n.KtG(i.searchFilter.PageNumber=a)}),n.qZA()(),n.TgZ(12,"div")(13,"label",7),n._uU(14,"Page Size"),n.qZA(),n.TgZ(15,"input",8),n.NdJ("ngModelChange",function(a){n.CHM(t);const i=n.oxw();return n.KtG(i.searchFilter.RowCount=a)}),n.qZA()()()()(),n.TgZ(16,"content")(17,"div",9)(18,"div",10)(19,"div",11),n.YNc(20,G,3,0,"div",12),n.TgZ(21,"table",13)(22,"thead",14)(23,"tr")(24,"th",15),n._uU(25,"Product "),n._UZ(26,"br"),n.TgZ(27,"mat-slide-toggle",16),n.NdJ("toggleChange",function(){n.CHM(t);const a=n.oxw();return a.showDifferenceStock=!a.showDifferenceStock,n.KtG(a.onShowDifferenceStock())}),n.TgZ(28,"small",17),n._uU(29,"Filter Different Inventory"),n.qZA()()(),n.TgZ(30,"th",18),n._uU(31,"Variant"),n.qZA(),n.TgZ(32,"th",19),n._uU(33,"SKU"),n.qZA(),n.YNc(34,E,2,1,"th",3),n.ALo(35,"async"),n.TgZ(36,"th",20),n._uU(37,"POS"),n.qZA(),n.TgZ(38,"th")(39,"ng-select",21),n.NdJ("change",function(a){n.CHM(t);const i=n.oxw();return n.KtG(i.onFilterChannel(a))})("ngModelChange",function(a){n.CHM(t);const i=n.oxw();return n.KtG(i.searchFilter.ChannelID=a)}),n.YNc(40,H,3,3,"ng-option",22),n.qZA()(),n._UZ(41,"th",23),n.qZA()(),n.YNc(42,ln,2,1,"tbody",24),n.ALo(43,"async"),n.qZA(),n.TgZ(44,"div",25)(45,"div",26)(46,"div",27),n._uU(47),n.ALo(48,"number"),n.ALo(49,"async"),n.YNc(50,rn,3,0,"span",28),n.YNc(51,sn,3,3,"span",3),n.ALo(52,"async"),n._uU(53),n.qZA()(),n.YNc(54,un,3,2,"div",29),n.ALo(55,"async"),n.qZA()()()()()()}if(2&e){const t=l.ngIf,o=n.oxw();let a,i;n.Q6J("headerTitle","Inventory Comparison")("pageData",o.pageData)("hideSearchBox",!1),n.xp6(3),n.Q6J("ngIf",n.lcZ(4,17,o.paginationService.data$)),n.xp6(8),n.Q6J("ngModel",o.searchFilter.PageNumber),n.xp6(4),n.Q6J("ngModel",o.searchFilter.RowCount),n.xp6(5),n.Q6J("ngIf",3==(null==o.searchFilter?null:o.searchFilter.filterModel)),n.xp6(14),n.Q6J("ngIf",n.lcZ(35,19,o.paginationService.data$)),n.xp6(5),n.Q6J("clearable",!1)("ngModel",o.searchFilter.ChannelID),n.xp6(1),n.Q6J("ngForOf",t.Options.Channel),n.xp6(2),n.Q6J("ngForOf",n.lcZ(43,21,o.paginationService.data$)),n.xp6(5),n.hij(" Showing 1 - ",n.lcZ(48,23,null==(a=n.lcZ(49,25,o.paginationService.data$))?null:a.length)," of "),n.xp6(3),n.Q6J("ngIf",o.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(52,27,!o.paginationService.hideCount&&o.rowCount$)),n.xp6(2),n.hij(" records ~ ",o.paginationService.footerPageNumber," Page "),n.xp6(1),n.Q6J("ngIf",(null==(i=n.lcZ(55,29,o.paginationService.data$))?null:i.length)>0)}}let hn=(()=>{class e{constructor(t,o,a,i,r){this.http=t,this.toastr=o,this.dialog=a,this.paginationService=i,this.productService=r,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",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}]},this.initLoader()}initLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe((0,C.b)(t=>{this.channelOptions=t.Options.Channel,this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.paginationService.resetToFirstPage(this.searchFilter),t.Filter.IsMarketplaceAppActive||this.toastr.warning("Automatic inventory sync disabled.\n Please enable Dealpos X Marketplace Apps integration in POS Configuration","Warning")}))}onSearch(t){this.searchFilter.text=t,this.paginationService.resetToFirstPage(this.searchFilter)}onFilterChannel(t){this.searchFilter.ChannelID=t,this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter)}updateStock(t){const o=this.productService.selectedVariantProduct(t);if(o.length>0){let i=o.map(c=>({ID:c.ID,Code:c.Code,Inventory:c.Inventory}));var a=[];a.push(this.searchFilter.ChannelID);let r={ListChannelID:a,List:i};this.http.post("/api/Inventory/UpdateChannel",r).subscribe(c=>{this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully updated "+r.List.length+" variants in "+r.ListChannelID.length+" channels","Success")})}}openScanDialog(t){const o=Object.assign({},this.searchFilter);this.dialog.open(v.j,{data:{filter:o,Channel:t.Options.Channel},width:"30%"}).afterClosed().pipe((0,T.h)(i=>i)).subscribe(i=>{this.searchFilter=i.filter,this.searchFilter.sync&&this.refreshChannel(t)})}refreshChannel(t){let o={ID:this.searchFilter.ChannelID,ScanFull:this.searchFilter.ScanFull};const a=this.productService.findChannelById(this.searchFilter.ChannelID,t.Options.Channel);this.http.post("/api/product/ScanOptimized",o).subscribe(i=>{this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully scanned from "+a?.Name,"Success")})}RefreshInventory(t,o,a,i){this.http.post("/api/Inventory/RefreshInventoryChannel",{ChannelItemID:t,ChannelVariationID:o,ChannelID:a,VariantID:i}).subscribe(c=>{this.toastr.success("Successfully updated","Success"),this.paginationService.resetToFirstPage(this.searchFilter)})}onCheckboxStateProduct(t){t.Variants=t.Variants.map(o=>(o.Inventory>=0&&(o.selected=t.selected),o))}onCheckboxStateChange(t){t=t.map(o=>(o.Variants=o.Variants.map(a=>(a.selected=this.checkboxState,a)),o))}openTableDialog(t,o,a){this.dialog.open(V.k,{data:{Name:t.Name,Variant:o,ChannelID:o?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:t.ChannelItemID}}).afterClosed().pipe((0,T.h)(r=>r)).subscribe(r=>{this.updateItemAfterDialog(r,a)})}updateItemAfterDialog(t,o){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};const i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(r=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+i?.Name+" to "+a.NewQuantity,"Success"),o=o.map(c=>(c.ChannelItemID===t.ChannelItemID&&(c.Variants=c.Variants.map(p=>(p.ChannelVariationID==t.ChannelVariantID&&(p.Stock=t.Inventory),p))),c))})}onShowDifferenceStock(){this.searchFilter.filterModel=this.showDifferenceStock?3:1,this.paginationService.resetToFirstPage(this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}getRowCount(){const t={ChannelID:this.searchFilter.ChannelID,PageNumber:1};this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`${this.rowCountApi}`,t)}onLastPage(){this.http.post(`${this.rowCountApi}`,{ChannelID:this.searchFilter.ChannelID,PageNumber:1}).subscribe({next:o=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,o.Total)}})}ngOnDestroy(){this.paginationService.destroy()}}return e.\u0275fac=function(t){return new(t||e)(n.Y36(I.O),n.Y36(y._W),n.Y36(x.uw),n.Y36(b.b),n.Y36(Y.M))},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-inventory-realtime"]],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"],["container",""],["for","PageNumber"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control",3,"ngModel","ngModelChange"],["for","RowCount"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control",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","36%"],[3,"toggleChange"],[1,"fw-bold"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","20%"],["scope","col",1,"text-end","w-10"],[3,"clearable","ngModel","change","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[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"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModel","ngModelChange"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"text-start"],[1,"text-end"],[1,"align-middle"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"col-12","ps-0","d-flex","justify-content-between"],["target","_blank",2,"color","#333333",3,"href"],[1,"fas","fa-lg","fa-external-link-alt"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",3,"click"],[1,"fas","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],["type","checkbox","class","me-3",3,"ngModel","ngModelChange",4,"ngIf"],["class","border rounded w-img","style","margin-left: 20px",3,"src",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",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"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"text-end",3,"ngClass"],[1,"row","justify-content-end","me-0"],[1,"col-12","pe-12","text-end",3,"click"],[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","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",3,"click"],[1,"fas","fa-share"]],template:function(t,o){1&t&&(n.YNc(0,_n,56,31,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,o.loader$))},dependencies:[u.mk,u.sg,u.O5,_.Fj,_.wV,_.Wl,_.JJ,_.On,g.w9,g.jq,Z.Rr,m.p,w.gM,u.Ov,u.JJ],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}i.fas[_ngcontent-%COMP%]{font-size:13px}"]}),e})();var F=s(8063);const mn=[{path:"",component:D,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:O,canActivate:[F.a],data:{title:"Inventory Comparison"}},{path:"bychannel",component:hn,canActivate:[F.a],data:{title:"Inventory Comparison"}}]}];let gn=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=n.oAB({type:e}),e.\u0275inj=n.cJS({imports:[u.ez,h.Bz.forChild(mn)]}),e})(),dn=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=n.oAB({type:e}),e.\u0275inj=n.cJS({imports:[u.ez,gn,h.Bz,f.Z,_.u5,g.A0,Z.rP,m.R,S.U,w.AV]}),e})()}}]);
|