marketplacepos 2.4.1 → 2.4.2
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/162.fb6aac67d4ab0ff8.js +1 -0
- package/Marketplace/{387.04d02414af56d750.js → 387.f8d525b15c777074.js} +1 -1
- package/Marketplace/{458.c769122ade2c10ed.js → 458.12f2630e8891b53a.js} +1 -1
- package/Marketplace/667.d0658dfbb8c75eb3.js +1 -0
- package/Marketplace/832.40bafce037098f88.js +1 -0
- package/Marketplace/874.947c66675e9d3698.js +1 -0
- package/Marketplace/882.1c9c716bbdb403b5.js +1 -0
- package/Marketplace/index.html +2 -2
- package/Marketplace/{runtime.d01f3ddbb2b8f1f2.js → runtime.d2e34b8aa2806626.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/472.54413a4f69aa673d.js +0 -1
- package/Marketplace/667.81e6162196d486da.js +0 -1
- package/Marketplace/767.79e23997e93fb6c3.js +0 -1
- package/Marketplace/882.b34c3cc6e65d7a17.js +0 -1
- package/Marketplace/970.d0e3ee1e2aec0db5.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[162],{9162:(fn,f,s)=>{s.r(f),s.d(f,{InventoryModule:()=>Cn});var h=s(6895),n=s(4650),_=s(8252),x=s(7398);let M=(()=>{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,a){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",a.inventoryTabs))},dependencies:[_.lC,x.e]}),e})();var v=s(8231),A=s(6304),I=s(8505),g=s(9300),m=s(3154),b=s(1318),S=s(7185),y=s(5412),T=s(7287),d=s(7481),Z=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 o=n.oxw(2).ngIf,i=n.oxw();return n.KtG(i.openScanDialog(o.Options.Channel))}),n._UZ(1,"i",18),n._uU(2," Scan Channel "),n.qZA()}}function J(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",19),n.NdJ("click",function(){n.CHM(t);const o=n.oxw().ngIf,i=n.oxw().ngIf,r=n.oxw();return n.KtG(r.onUpdateItems(o,i.Options.Channel))}),n._UZ(1,"i",20),n._uU(2," Update "),n.qZA()}}function U(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,J,3,0,"button",16),n.qZA()()()),2&e){const t=l.ngIf,a=n.oxw(2);n.xp6(3),n.Q6J("ngIf",!a.hasSelection(t)),n.xp6(1),n.Q6J("ngIf",a.hasSelection(t))}}function P(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"app-table",21),n.NdJ("onToggle",function(o){n.CHM(t);const i=n.oxw(2);return n.KtG(i.onShowDifferenceStock(o))})("onSubmit",function(o){const r=n.CHM(t).ngIf,c=n.oxw(2);return n.KtG(c.UpdateStockByVariant(o,r))}),n.qZA()}if(2&e){const t=l.ngIf,a=n.oxw().ngIf,o=n.oxw();n.Q6J("data",t)("channel",o.channelOptions)("showProductToggle",!0)("filter",a.Filter)}}function k(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"span",22),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2);return n.KtG(o.getAllDataCount())}),n.TgZ(1,"i",23),n._uU(2,"?"),n.qZA()()}}function L(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 O(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",24),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2);return n.KtG(o.nextPage())}),n._UZ(1,"i",25),n._uU(2," Next"),n.qZA()}}function Q(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",26),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2);return n.KtG(o.getAllData())}),n._UZ(1,"i",27),n._uU(2," Last"),n.qZA()}}function V(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"mainpanel",1),n.NdJ("onSubmit",function(o){n.CHM(t);const i=n.oxw();return n.KtG(i.onSearch(o))}),n.YNc(1,U,5,2,"actions",2),n.ALo(2,"async"),n.TgZ(3,"content")(4,"div",3)(5,"div",4)(6,"div",5),n.YNc(7,P,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,k,3,0,"span",10),n.YNc(16,L,3,3,"span",2),n.ALo(17,"async"),n._uU(18),n.qZA()(),n.TgZ(19,"div",11),n.YNc(20,O,3,0,"a",12),n.YNc(21,Q,3,0,"a",13),n.qZA()()()()()()()}if(2&e){const t=n.oxw();let a;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==(a=n.lcZ(14,18,t.paginationService.data$))?null:a.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 Y=(()=>{class e{constructor(t,a,o,i){this.http=t,this.toastr=a,this.dialog=o,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,I.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,a){let o=this.getSelected(t);if(o.length>0){let r=[];o.forEach(p=>r.push({ID:p.ID,Code:p.Code,Inventory:p.Inventory}));var i=[];for(let p of a)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){let a=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(v.j,{data:{filter:a,Channel:t},width:"40%"}).afterClosed().pipe((0,g.h)(i=>m.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.ChannelID=i.ChannelID,this.RefreshChannel()})}RefreshChannel(){let t={ID:this.searchFilter.ChannelID,ScanFull:this.searchFilter.ScanFull};this.http.post("/api/product/ScanOptimized",t).subscribe(a=>{this.searchFilter.ChannelID=m.g.GuidEMpty,this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully scanned from "+this.getChannelName(t.ID),"Success")})}UpdateStockByVariant(t,a){let o={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",o).subscribe(i=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+this.getChannelName(o.ID)+" to "+o.NewQuantity,"Success");for(let r of a)if(r.ChannelItemID===t.ChannelItemID)for(let c of r.Variants)c.ChannelVariationID==t.ChannelVariantID&&(c.Stock=parseFloat(t.Inventory))})}getSelected(t){let a=[];if(t){for(let o of t)for(let i of o.Variants)i.selected&&a.push(i);return a}return[]}hasSelection(t){return!!t&&this.getSelected(t).length>0}getChannelName(t){return this.channelOptions.find(o=>o.ID==t).Name}onShowDifferenceStock(t){this.searchFilter.filterModel=t?3:1,this.paginationService.resetToFirstPage(this.searchFilter)}onUpdateItems(t,a){const o=this.getSelected(t);this.dialog.open(A.j,{data:{selectedItems:o,channels:a},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(b.O),n.Y36(S._W),n.Y36(y.uw),n.Y36(T.b))},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-multi-channel-comparison"]],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,a){1&t&&(n.YNc(0,V,22,22,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,a.loader$))},dependencies:[h.O5,d.p,Z.a,h.Ov,h.JJ],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]}),e})();var q=s(7945),$=s(6082),u=s(4006),C=s(8796),F=s(455),w=s(266);function K(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",32),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2).ngIf,i=n.oxw();return n.KtG(i.openScanDialog(o))}),n._UZ(1,"i",33),n._uU(2," Scan Channel "),n.qZA()}}function R(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"button",34),n.NdJ("click",function(){n.CHM(t);const o=n.oxw().ngIf,i=n.oxw(2);return n.KtG(i.updateStock(o))}),n._UZ(1,"i",35),n._uU(2," Update"),n.qZA()}}function E(e,l){if(1&e&&(n.TgZ(0,"div"),n.YNc(1,K,3,0,"button",30),n.YNc(2,R,3,0,"button",31),n.qZA()),2&e){const t=l.ngIf,a=n.oxw(2);n.xp6(1),n.Q6J("ngIf",!a.productService.hasSelectionVariant(t)),n.xp6(1),n.Q6J("ngIf",a.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 H(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"th")(1,"input",37),n.NdJ("ngModelChange",function(o){n.CHM(t);const i=n.oxw(2);return n.KtG(i.checkboxState=o)})("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 B(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 j(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"input",57),n.NdJ("ngModelChange",function(o){n.CHM(t);const i=n.oxw(3).$implicit;return n.KtG(i.selected=o)})("ngModelChange",function(){n.CHM(t);const o=n.oxw(3).$implicit,i=n.oxw(2);return n.KtG(i.onCheckboxStateProduct(o))}),n.qZA()}if(2&e){const t=n.oxw(3).$implicit;n.Q6J("ngModel",t.selected)}}function z(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 W(e,l){1&e&&n._UZ(0,"img",59)}function X(e,l){if(1&e&&(n.ynx(0),n.TgZ(1,"td",50)(2,"div",51),n.YNc(3,j,1,1,"input",52),n.YNc(4,z,1,1,"img",53),n.YNc(5,W,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),a=n.oxw().$implicit,o=n.oxw().$implicit;n.xp6(1),n.Q6J("rowSpan",null==o?null:o.Variants.length),n.xp6(2),n.Q6J("ngIf",(null==a?null:a.Inventory)>=0||o.Variants.length>1),n.xp6(1),n.Q6J("ngIf",null==o?null:o.ThumbnailUrl)("ngIfElse",t),n.xp6(3),n.Q6J("rowSpan",null==o?null:o.Variants.length),n.xp6(2),n.Oqu(null==o?null:o.Name),n.xp6(3),n.hij("(",null==o?null:o.Category,")")}}function nn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"input",37),n.NdJ("ngModelChange",function(o){n.CHM(t);const i=n.oxw().$implicit;return n.KtG(i.selected=o)}),n.qZA()}if(2&e){const t=n.oxw().$implicit;n.Q6J("ngModel",t.selected)}}function tn(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 en(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 an=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 o=n.oxw().$implicit,i=n.oxw(),r=i.$implicit,c=i.ngForOf,p=n.oxw(2);return n.KtG(p.openTableDialog(r,o,c))}),n._uU(3),n.ALo(4,"number"),n.qZA()()()}if(2&e){const t=n.oxw().$implicit;n.Q6J("ngClass",n.VKq(4,an,(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 ln(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"tr"),n.YNc(1,X,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,nn,1,1,"input",43),n.qZA(),n.TgZ(8,"td",41),n.YNc(9,tn,8,6,"span",3),n.YNc(10,en,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,a=l.index;n.xp6(1),n.Q6J("ngIf",0==a),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 rn(e,l){if(1&e&&(n.TgZ(0,"tbody"),n.YNc(1,ln,20,8,"tr",24),n.qZA()),2&e){const t=l.$implicit;n.xp6(1),n.Q6J("ngForOf",t.Variants)}}function sn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"span",65),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(2);return n.KtG(o.getRowCount())}),n.TgZ(1,"i",66),n._uU(2,"?"),n.qZA()()}}function cn(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 pn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",70),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(3);return n.KtG(o.onNextPage())}),n._UZ(1,"i",71),n._uU(2," Next"),n.qZA()}}function hn(e,l){if(1&e){const t=n.EpF();n.TgZ(0,"a",72),n.NdJ("click",function(){n.CHM(t);const o=n.oxw(3);return n.KtG(o.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,pn,3,0,"a",68),n.YNc(2,hn,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(o){n.CHM(t);const i=n.oxw();return n.KtG(i.onSearch(o))}),n.TgZ(1,"actions")(2,"div",2),n.YNc(3,E,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(o){n.CHM(t);const i=n.oxw();return n.KtG(i.searchFilter.PageNumber=o)}),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(o){n.CHM(t);const i=n.oxw();return n.KtG(i.searchFilter.RowCount=o)}),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 o=n.oxw();return o.showDifferenceStock=!o.showDifferenceStock,n.KtG(o.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,H,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(o){n.CHM(t);const i=n.oxw();return n.KtG(i.onFilterChannel(o))})("ngModelChange",function(o){n.CHM(t);const i=n.oxw();return n.KtG(i.searchFilter.ChannelID=o)}),n.YNc(40,B,3,3,"ng-option",22),n.qZA()(),n._UZ(41,"th",23),n.qZA()(),n.YNc(42,rn,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,sn,3,0,"span",28),n.YNc(51,cn,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,a=n.oxw();let o,i;n.Q6J("headerTitle","Inventory Comparison")("pageData",a.pageData)("hideSearchBox",!1),n.xp6(3),n.Q6J("ngIf",n.lcZ(4,17,a.paginationService.data$)),n.xp6(8),n.Q6J("ngModel",a.searchFilter.PageNumber),n.xp6(4),n.Q6J("ngModel",a.searchFilter.RowCount),n.xp6(5),n.Q6J("ngIf",3==(null==a.searchFilter?null:a.searchFilter.filterModel)),n.xp6(14),n.Q6J("ngIf",n.lcZ(35,19,a.paginationService.data$)),n.xp6(5),n.Q6J("clearable",!1)("ngModel",a.searchFilter.ChannelID),n.xp6(1),n.Q6J("ngForOf",t.Options.Channel),n.xp6(2),n.Q6J("ngForOf",n.lcZ(43,21,a.paginationService.data$)),n.xp6(5),n.hij(" Showing 1 - ",n.lcZ(48,23,null==(o=n.lcZ(49,25,a.paginationService.data$))?null:o.length)," of "),n.xp6(3),n.Q6J("ngIf",a.paginationService.hideCount),n.xp6(1),n.Q6J("ngIf",n.lcZ(52,27,!a.paginationService.hideCount&&a.rowCount$)),n.xp6(2),n.hij(" records ~ ",a.paginationService.footerPageNumber," Page "),n.xp6(1),n.Q6J("ngIf",(null==(i=n.lcZ(55,29,a.paginationService.data$))?null:i.length)>0)}}let gn=(()=>{class e{constructor(t,a,o,i,r){this.http=t,this.toastr=a,this.dialog=o,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,I.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 a=this.productService.selectedVariantProduct(t);if(a.length>0){let i=a.map(c=>({ID:c.ID,Code:c.Code,Inventory:c.Inventory}));var o=[];o.push(this.searchFilter.ChannelID);let r={ListChannelID:o,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 a=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(v.j,{data:{filter:a,Channel:t.Options.Channel},width:"40%"}).afterClosed().pipe((0,g.h)(i=>m.g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.refreshChannel(t)})}refreshChannel(t){let a={ID:this.searchFilter.ChannelID,ScanFull:this.searchFilter.ScanFull};const o=this.productService.findChannelById(this.searchFilter.ChannelID,t.Options.Channel);this.http.post("/api/product/ScanOptimized",a).subscribe(i=>{this.searchFilter.ScanFull=!1,this.searchFilter.PageNumber=1,this.paginationService.resetToFirstPage(this.searchFilter),this.toastr.success("Successfully scanned from "+o?.Name,"Success")})}RefreshInventory(t,a,o,i){this.http.post("/api/Inventory/RefreshInventoryChannel",{ChannelItemID:t,ChannelVariationID:a,ChannelID:o,VariantID:i}).subscribe(c=>{this.toastr.success("Successfully updated","Success"),this.paginationService.resetToFirstPage(this.searchFilter)})}onCheckboxStateProduct(t){t.Variants=t.Variants.map(a=>(a.Inventory>=0&&(a.selected=t.selected),a))}onCheckboxStateChange(t){t=t.map(a=>(a.Variants=a.Variants.map(o=>(o.selected=this.checkboxState,o)),a))}openTableDialog(t,a,o){this.dialog.open(q.k,{data:{Name:t.Name,Variant:a,ChannelID:a?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:t.ChannelItemID}}).afterClosed().pipe((0,g.h)(r=>r)).subscribe(r=>{this.updateItemAfterDialog(r,o)})}updateItemAfterDialog(t,a){let o={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",o).subscribe(r=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+i?.Name+" to "+o.NewQuantity,"Success"),a=a.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:a=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,a.Total)}})}ngOnDestroy(){this.paginationService.destroy()}}return e.\u0275fac=function(t){return new(t||e)(n.Y36(b.O),n.Y36(S._W),n.Y36(y.uw),n.Y36(T.b),n.Y36($.M))},e.\u0275cmp=n.Xpm({type:e,selectors:[["app-single-channel-comparison"]],decls:2,vars:3,consts:[["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit"],[1,"d-flex"],[4,"ngIf"],["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,a){1&t&&(n.YNc(0,_n,56,31,"mainpanel",0),n.ALo(1,"async")),2&t&&n.Q6J("ngIf",n.lcZ(1,1,a.loader$))},dependencies:[h.mk,h.sg,h.O5,u.Fj,u.wV,u.Wl,u.JJ,u.On,C.w9,C.jq,F.Rr,d.p,w.gM,h.Ov,h.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 D=s(8063);const mn=[{path:"",component:M,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:Y,canActivate:[D.a],data:{title:"Inventory Comparison"}},{path:"bychannel",component:gn,canActivate:[D.a],data:{title:"Inventory Comparison"}}]}];let dn=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=n.oAB({type:e}),e.\u0275inj=n.cJS({imports:[h.ez,_.Bz.forChild(mn)]}),e})(),Cn=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=n.oAB({type:e}),e.\u0275inj=n.cJS({imports:[h.ez,dn,_.Bz,x.Z,u.u5,C.A0,F.rP,d.R,Z.U,w.AV]}),e})()}}]);
|