marketplacepos 3.9.7 → 3.10.0
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/3rdpartylicenses.txt +37 -37
- package/Marketplace/chunk-2WK2VI24.js +1 -0
- package/Marketplace/{chunk-G4XG7N2M.js → chunk-32LBRSCJ.js} +4 -4
- package/Marketplace/chunk-35L7AOGR.js +1 -0
- package/Marketplace/chunk-3KM6M3SV.js +1 -0
- package/Marketplace/chunk-3SVOLAII.js +1 -0
- package/Marketplace/chunk-4HJGWXQ3.js +1 -0
- package/Marketplace/{chunk-Z6VJNXH5.js → chunk-4PF4YRRT.js} +1 -1
- package/Marketplace/chunk-6D7NMKRE.js +1 -0
- package/Marketplace/chunk-6NPWPFG3.js +2 -0
- package/Marketplace/chunk-7KXQRJHI.js +1 -0
- package/Marketplace/chunk-7MM3ONJ5.js +1 -0
- package/Marketplace/chunk-7RTQ2IDL.js +1 -0
- package/Marketplace/chunk-BLMEJMMZ.js +1 -0
- package/Marketplace/chunk-ECAAF5I6.js +1 -0
- package/Marketplace/{chunk-IKKEE3ZC.js → chunk-FA44W5LU.js} +2 -2
- package/Marketplace/chunk-FBXFQ4G2.js +39 -0
- package/Marketplace/chunk-FDI2UIO2.js +1 -0
- package/Marketplace/chunk-GR5OKYJS.js +1 -0
- package/Marketplace/chunk-HT7RDS3I.js +1 -0
- package/Marketplace/chunk-I5POPG3M.js +1 -0
- package/Marketplace/chunk-JYZZ37SG.js +1 -0
- package/Marketplace/chunk-KB7PR6DP.js +1 -0
- package/Marketplace/{chunk-OJIY47SY.js → chunk-KPPQNI2R.js} +1 -1
- package/Marketplace/chunk-L6CJT6UC.js +1 -0
- package/Marketplace/chunk-L7Q6GF26.js +1 -0
- package/Marketplace/chunk-LAEELPPC.js +1 -0
- package/Marketplace/chunk-LBQ2LOYA.js +1 -0
- package/Marketplace/chunk-NJM2XHQY.js +1 -0
- package/Marketplace/chunk-NN3SPEH5.js +1 -0
- package/Marketplace/chunk-O3IHPLVP.js +1 -0
- package/Marketplace/chunk-ORA63EP5.js +1 -0
- package/Marketplace/chunk-OV2NRCQ5.js +1 -0
- package/Marketplace/chunk-OZKNF6S2.js +1 -0
- package/Marketplace/chunk-P3IVG6BD.js +1 -0
- package/Marketplace/chunk-PNLW4YVH.js +1 -0
- package/Marketplace/chunk-POSHHHMT.js +1 -0
- package/Marketplace/{chunk-SXTJAABI.js → chunk-PZX3AESM.js} +2 -2
- package/Marketplace/chunk-QTQ6GNKJ.js +5 -0
- package/Marketplace/{chunk-3E3AJFQR.js → chunk-RUB4SQ54.js} +2 -2
- package/Marketplace/{chunk-KX4RY3YM.js → chunk-SHX3JAGT.js} +1 -1
- package/Marketplace/chunk-SOPDRQWM.js +2 -0
- package/Marketplace/chunk-SQGOM2WU.js +1 -0
- package/Marketplace/chunk-SQR4ZRTF.js +2 -0
- package/Marketplace/chunk-SUMLYFC7.js +1 -0
- package/Marketplace/{chunk-MHU6SJ5A.js → chunk-TBOHCD6E.js} +1 -1
- package/Marketplace/chunk-ULR2QT4D.js +2 -0
- package/Marketplace/chunk-UW4B35JC.js +1 -0
- package/Marketplace/chunk-VCLTTDX7.js +1 -0
- package/Marketplace/chunk-WCQU2HIE.js +3 -0
- package/Marketplace/chunk-WKDJS327.js +1 -0
- package/Marketplace/chunk-WOHUGR5B.js +1 -0
- package/Marketplace/chunk-XDU5GZAR.js +4 -0
- package/Marketplace/chunk-XLZ3ZJTK.js +1 -0
- package/Marketplace/chunk-YGL3QYTJ.js +1 -0
- package/Marketplace/chunk-YILL4GKX.js +5 -0
- package/Marketplace/chunk-ZMC2DAP2.js +1 -0
- package/Marketplace/chunk-ZRFFM47Q.js +1 -0
- package/Marketplace/index.html +2 -2
- package/Marketplace/main-525IC5TZ.js +1 -0
- package/Marketplace/styles-SUQABHBL.css +1 -0
- package/package.json +1 -1
- package/Marketplace/chunk-2IJJWAYN.js +0 -1
- package/Marketplace/chunk-2MVWDXPG.js +0 -3
- package/Marketplace/chunk-3CMEFVHV.js +0 -1
- package/Marketplace/chunk-5MP2C2GN.js +0 -1
- package/Marketplace/chunk-5OQFKOT3.js +0 -1
- package/Marketplace/chunk-6LY5BIL3.js +0 -1
- package/Marketplace/chunk-7XM22FKG.js +0 -1
- package/Marketplace/chunk-BHWMGQZN.js +0 -1
- package/Marketplace/chunk-BUDL76ZU.js +0 -1
- package/Marketplace/chunk-CC6GVMJK.js +0 -1
- package/Marketplace/chunk-COBXXWMY.js +0 -1
- package/Marketplace/chunk-CUSPCEJT.js +0 -4
- package/Marketplace/chunk-DSWUPDVF.js +0 -1
- package/Marketplace/chunk-DUJ654ZX.js +0 -1
- package/Marketplace/chunk-EJ5KL5JT.js +0 -1
- package/Marketplace/chunk-FAU3DFPX.js +0 -1
- package/Marketplace/chunk-FRAPCUOC.js +0 -1
- package/Marketplace/chunk-G3L2MSRM.js +0 -1
- package/Marketplace/chunk-GZ6EJLC2.js +0 -1
- package/Marketplace/chunk-HNVCUZMB.js +0 -1
- package/Marketplace/chunk-HSB44YON.js +0 -1
- package/Marketplace/chunk-HSQYSU2F.js +0 -5
- package/Marketplace/chunk-IPUL4A72.js +0 -39
- package/Marketplace/chunk-IU36UM4K.js +0 -1
- package/Marketplace/chunk-JH5HJCDZ.js +0 -1
- package/Marketplace/chunk-KQDNRM3M.js +0 -1
- package/Marketplace/chunk-KXVR2ZP3.js +0 -1
- package/Marketplace/chunk-L346FFAX.js +0 -1
- package/Marketplace/chunk-LJORI5SH.js +0 -1
- package/Marketplace/chunk-M2RVZO2N.js +0 -2
- package/Marketplace/chunk-MGEKJ45C.js +0 -1
- package/Marketplace/chunk-MNZYX56J.js +0 -1
- package/Marketplace/chunk-NBQR434T.js +0 -2
- package/Marketplace/chunk-O42LRLFS.js +0 -1
- package/Marketplace/chunk-OIOMVXRX.js +0 -1
- package/Marketplace/chunk-QGIVCWJ5.js +0 -1
- package/Marketplace/chunk-QWWXJFHN.js +0 -1
- package/Marketplace/chunk-RNVH2THT.js +0 -1
- package/Marketplace/chunk-SLBGML3Y.js +0 -1
- package/Marketplace/chunk-TH7T5L4B.js +0 -1
- package/Marketplace/chunk-VFADXTL7.js +0 -1
- package/Marketplace/chunk-VOTVGH4Q.js +0 -1
- package/Marketplace/chunk-VWZWQO2U.js +0 -1
- package/Marketplace/chunk-VZL6YUAQ.js +0 -1
- package/Marketplace/chunk-W3OMCM7Z.js +0 -1
- package/Marketplace/chunk-W7B34I4A.js +0 -1
- package/Marketplace/chunk-WFFW6WSV.js +0 -1
- package/Marketplace/chunk-WY3SS6E7.js +0 -2
- package/Marketplace/chunk-X42AN3JK.js +0 -2
- package/Marketplace/chunk-X4C725KJ.js +0 -5
- package/Marketplace/chunk-XC4T4XXY.js +0 -1
- package/Marketplace/chunk-YZMKXH5W.js +0 -1
- package/Marketplace/main-U2MNCBIN.js +0 -1
- package/Marketplace/styles-AQQ2FNHV.css +0 -1
- /package/Marketplace/{chunk-WDTFLB3R.js → chunk-4RJDBICZ.js} +0 -0
- /package/Marketplace/{chunk-KO2R4FW6.js → chunk-OOD7TLAL.js} +0 -0
- /package/Marketplace/{chunk-YQZUILJJ.js → chunk-ZKZWHDGN.js} +0 -0
- /package/Marketplace/{polyfills-OTWIPYTS.js → polyfills-ZMM4NOHE.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as D,b as Ee,c as Pe,d as ae,e as oe}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-32LBRSCJ.js";import{a as Me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-BLMEJMMZ.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-PNLW4YVH.js";import{a as Ve,b as De}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-WOHUGR5B.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-OOD7TLAL.js";import{a as ie}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-ZRFFM47Q.js";import{a as ne}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-YILL4GKX.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-OV2NRCQ5.js";import{a as Ie,b as we}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-3KM6M3SV.js";import{a as Te}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-TBOHCD6E.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-KPPQNI2R.js";import{a as Ce,b as fe,d as xe,e as ve}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-SOPDRQWM.js";import{a as re}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-NJM2XHQY.js";import{d as q,k as W}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-XDU5GZAR.js";import{a as H}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-L6CJT6UC.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-SHX3JAGT.js";import{B as ye,C as te,D as be,q as X,r as Se,u as ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-SQR4ZRTF.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-NN3SPEH5.js";import{b as ge,c as K,h as Y,k as J,m as Z,u as he}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-FDI2UIO2.js";import{c as V}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-7RTQ2IDL.js";import{$a as l,Aa as N,Ac as G,B,Fb as f,Ga as r,Gb as x,Ha as y,Hb as O,Ob as R,Qa as p,Wa as u,X as k,_b as me,aa as $,ab as s,ac as de,bb as v,bc as U,cb as b,db as I,ea as P,ec as j,fa as A,fb as S,fc as _e,hc as z,ic as Q,ja as d,jb as g,ka as _,lb as c,ob as pe,q as se,qb as F,rb as m,sb as E,tb as w,ub as ce,wc as ue,yb as L}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-FA44W5LU.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-ZKZWHDGN.js";var Ne=(()=>{let o=class o{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}};o.\u0275fac=function(n){return new(n||o)},o.\u0275cmp=P({type:o,selectors:[["app-inventory"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,a){n&1&&(l(0,"nav",0)(1,"div",1)(2,"div"),v(3,"nav-tab",2),s()()(),v(4,"router-outlet")),n&2&&(r(3),p("Tabs",a.inventoryTabs))},dependencies:[ue,Ie]});let i=o;return i})();function Ye(i,o){if(i&1){let e=S();l(0,"button",21),g("click",function(){d(e);let n=c().ngIf,a=c(2);return _(a.onUpdateItems(n))}),v(1,"i",22),m(2," Update "),s()}}function Je(i,o){if(i&1&&(l(0,"actions")(1,"div",19),u(2,Ye,3,0,"button",20),s()()),i&2){let e=o.ngIf,t=c(2);r(2),p("ngIf",t.productService.hasSelectionVariant(e))}}function Ze(i,o){if(i&1){let e=S();l(0,"app-table",23),g("onToggle",function(n){d(e);let a=c(2);return _(a.onShowDifferenceStock(n))})("onSubmit",function(n){let h=d(e).ngIf,C=c(2);return _(C.updateStockByVariant(n,h))}),s()}if(i&2){let e=o.ngIf,t=c(2);p("data",e)("channel",t.channelOptions)("showProductToggle",!0)("filter",t.searchFilter)}}function qe(i,o){if(i&1){let e=S();l(0,"span",24),g("click",function(){d(e);let n=c(2);return _(n.getRowCount())}),l(1,"i",25),m(2,"?"),s()()}}function We(i,o){if(i&1&&(l(0,"span"),m(1),f(2,"number"),s()),i&2){let e=o.ngIf;r(1),E(x(2,1,e))}}function Xe(i,o){if(i&1){let e=S();l(0,"a",26),g("click",function(){d(e);let n=c(2);return _(n.nextPage())}),v(1,"i",27),m(2," Next"),s()}}function et(i,o){if(i&1){let e=S();l(0,"a",28),g("click",function(){d(e);let n=c(2);return _(n.getAllData())}),v(1,"i",29),m(2," Last"),s()}}function tt(i,o){if(i&1){let e=S();l(0,"mainpanel",1),g("onSubmit",function(n){d(e);let a=c();return _(a.onSearch(n))}),u(1,Je,3,1,"actions",2),f(2,"async"),l(3,"filters")(4,"div")(5,"label",3),m(6,"PageNumber"),s(),l(7,"input",4),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.PageNumber=n)}),s()(),l(8,"div",5)(9,"label",6),m(10,"Page Size"),s(),l(11,"input",7),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.RowCount=n)}),s()()(),l(12,"content")(13,"div",8)(14,"div",9)(15,"div",10),u(16,Ze,1,4,"app-table",11),f(17,"async"),b(18),l(19,"div",12)(20,"div",13)(21,"div",14),m(22),f(23,"number"),f(24,"async"),u(25,qe,3,0,"span",15)(26,We,3,3,"span",2),f(27,"async"),m(28),s()(),l(29,"div",16),u(30,Xe,3,0,"a",17)(31,et,3,0,"a",18),s()(),I(),s()()()()()}if(i&2){let e=c(),t;p("pageData",e.pageData)("hideSearchBox",!1)("textButton","Search"),r(1),p("ngIf",x(2,13,e.paginationService.data$)),r(6),p("ngModel",e.searchFilter.PageNumber),r(4),p("ngModel",e.searchFilter.RowCount),r(5),p("ngIf",x(17,15,e.paginationService.data$)),r(6),w(" Showing 1 - ",x(23,17,(t=x(24,19,e.paginationService.data$))==null?null:t.length)," of "),r(3),p("ngIf",e.paginationService.hideCount),r(1),p("ngIf",x(27,21,!e.paginationService.hideCount&&e.allDataCount$)),r(2),w(" records ~ ",e.paginationService.footerPageNumber," Page "),r(2),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),r(1),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}var ke=(()=>{let o=class o{constructor(t,n,a,h,C,T){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=h,this.productService=C,this.authService=T,this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:D.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,n){let a=this.productService.selectedVariantProduct(t);if(a.length>0){let C=a.map(M=>({ID:M.ID,Code:M.Code,Inventory:M.Inventory}));var h=n.filter(M=>M.selected).map(M=>M.ID);let T={ListChannelID:h,List:C};this.http.post("/api/Inventory/UpdateChannel",T).subscribe(M=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+T.List.length+" variants in "+T.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(h=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+C.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=D.DIFFERENCE:this.searchFilter.filterModel=D.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let n=this.productService.selectedVariantProduct(t);this.dialog.open(Me,{data:{selectedItems:n,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe(B(a=>V.IsNotEmpty(a))).subscribe(a=>{this.updateStock(t,a)})}getRowCount(){this.paginationService.hideCount=!1;let t={text:this.searchFilter.text};this.allDataCount$=this.http.post(`/API/${this.allDataCountEndpoint}`,t)}nextPage(){this.paginationService.onNextPage(this.searchFilter)}getAllData(){this.http.post(`/API/${this.allDataCountEndpoint}`,{}).subscribe({next:t=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,t)}})}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(H),y(q),y(ee),y(ie),y(ne),y(W))},o.\u0275cmp=P({type:o,selectors:[["app-multi-channel-comparison"]],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit"],[4,"ngIf"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[1,"mt-5"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit",4,"ngIf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary border-start-0","title","Load all products",3,"click",4,"ngIf"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"data","channel","showProductToggle","filter","onToggle","onSubmit"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(u(0,tt,32,23,"mainpanel",0),f(1,"async")),n&2&&p("ngIf",x(1,1,a.loader$))},dependencies:[U,K,Z,Y,J,te,ae,X,j,z],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let i=o;return i})();function nt(i,o){if(i&1){let e=S();l(0,"button",39),g("click",function(){d(e);let n=c().ngIf,a=c(2);return _(a.updateStock(n))}),v(1,"i",40),m(2," Update"),s()}}function it(i,o){if(i&1&&(l(0,"div"),u(1,nt,3,0,"button",38),s()),i&2){let e=o.ngIf,t=c(2);r(1),p("ngIf",t.productService.hasSelectionVariant(e))}}function at(i,o){if(i&1&&(l(0,"span",41),v(1,"img",42),s(),m(2)),i&2){let e=o.item;r(1),p("src",e==null?null:e.Img,N),r(1),w(" ",e.Name," ")}}function ot(i,o){i&1&&(l(0,"div",43)(1,"span"),m(2," showing only different stock, please press next to populate more data "),s()())}function lt(i,o){if(i&1){let e=S();l(0,"th")(1,"input",44),g("ngModelChange",function(n){d(e);let a=c(2);return _(a.checkboxState=n)})("ngModelChange",function(){let a=d(e).ngIf,h=c(2);return _(h.onCheckboxStateChange(a))}),s()()}if(i&2){let e=c(2);r(1),p("ngModel",e.checkboxState)}}function rt(i,o){i&1&&(b(0),l(1,"th",45),m(2," Reserved "),s(),I())}function st(i,o){if(i&1){let e=S();b(0),l(1,"input",61),g("ngModelChange",function(n){d(e);let a=c(3).$implicit;return _(a.selected=n)})("ngModelChange",function(){d(e);let n=c(3).$implicit,a=c(2);return _(a.onCheckboxStateProduct(n))}),s(),I()}if(i&2){let e=c(3).$implicit;r(1),p("ngModel",e.selected)}}function pt(i,o){if(i&1){let e=S();b(0),l(1,"img",62),g("click",function(n){d(e);let a=c(3).$implicit,h=c(2);return _(h.onZoomImage(n,a==null?null:a.ImageUrl))}),s(),I()}if(i&2){let e=c(3).$implicit;r(1),pe("src",e==null?null:e.ThumbnailUrl,N)}}function ct(i,o){i&1&&v(0,"img",63)}function mt(i,o){if(i&1&&(b(0),v(1,"br"),l(2,"div",64),v(3,"i",65),l(4,"small"),m(5),s()(),I()),i&2){let e=c(3).$implicit;r(5),w("(",e==null?null:e.Category,")")}}var dt=i=>({"ms-10":i});function _t(i,o){if(i&1&&(b(0),l(1,"td",57)(2,"div",13),u(3,st,2,1,"ng-container",3),l(4,"div",49),u(5,pt,2,1,"ng-container",51)(6,ct,1,0,"ng-template",null,58,R),s()()(),l(8,"td",59)(9,"span",60),m(10),s(),u(11,mt,6,1,"ng-container",3),s(),I()),i&2){let e=F(7),t=c(2).$implicit,n=c(2);r(1),p("rowSpan",t==null?null:t.Variants.length),r(2),p("ngIf",t.Variants.length>1),r(1),p("ngClass",L(8,dt,t.Variants.length<=1)),r(1),p("ngIf",t==null?null:t.ThumbnailUrl)("ngIfElse",e),r(3),p("rowSpan",t==null?null:t.Variants.length),r(2),E(t==null?null:t.Name),r(1),p("ngIf",t.CategoryID!==null&&t.CategoryID!=n.guidEmpty)}}function ut(i,o){if(i&1){let e=S();b(0),l(1,"input",44),g("ngModelChange",function(n){d(e);let a=c(2).$implicit;return _(a.selected=n)}),s(),I()}if(i&2){let e=c(2).$implicit;r(1),p("ngModel",e.selected)}}function gt(i,o){if(i&1&&(b(0),u(1,ut,2,1,"ng-container",3),I()),i&2){let e=c().$implicit;r(1),p("ngIf",(e==null?null:e.Inventory)<=1e5)}}function ht(i,o){if(i&1){let e=S();l(0,"input",44),g("ngModelChange",function(n){d(e);let a=c(2).$implicit;return _(a.selected=n)}),s()}if(i&2){let e=c(2).$implicit;p("ngModel",e.selected)}}function Ct(i,o){if(i&1&&u(0,ht,1,1,"input",66),i&2){let e=c().$implicit;p("ngIf",(e==null?null:e.Inventory)>=0)}}function ft(i,o){i&1&&(l(0,"div",67),m(1,"Not Found"),s())}function xt(i,o){if(i&1&&(l(0,"div")(1,"span",68),m(2),f(3,"number"),s(),m(4," => "),l(5,"span",69),m(6),f(7,"number"),s()()),i&2){let e=c().$implicit;r(2),w(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),r(4),E(x(7,4,e==null?null:e.Inventory))}}function vt(i,o){if(i&1&&(l(0,"div"),m(1),f(2,"number"),s()),i&2){let e=c().$implicit;r(1),w(" ",x(2,1,e==null?null:e.Inventory)," ")}}function St(i,o){if(i&1&&(b(0),l(1,"div",70)(2,"a",71),v(3,"i",72),s()(),I()),i&2){let e=c().$implicit,t=c(3);r(2),p("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),N)}}var yt=i=>({"bg-gradient-warning":i});function bt(i,o){if(i&1){let e=S();l(0,"td",73)(1,"div",48)(2,"div")(3,"span",74),g("click",function(){d(e);let n=c().$implicit,a=c(),h=a.$implicit,C=a.ngForOf,T=c(2);return _(T.openTableDialog(h,n,C))}),m(4),f(5,"number"),s()(),l(6,"div",70)(7,"a",71),v(8,"i",72),s()(),l(9,"div",70)(10,"span",75),g("click",function(){d(e);let n=c().$implicit,a=c(3);return _(a.refreshInventory(n==null||n.Channel[0]==null?null:n.Channel[0].ChannelItemID,n==null||n.Channel[0]==null?null:n.Channel[0].ChannelVariationID,n==null||n.Channel[0]==null?null:n.Channel[0].ChannelID,n==null?null:n.ID))}),v(11,"i",76),s()()()()}if(i&2){let e=c().$implicit;p("ngClass",L(5,yt,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),r(4),w(" ",x(5,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," "),r(3),p("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,N)}}function It(i,o){if(i&1&&(b(0),l(1,"span",79),m(2),f(3,"number"),s(),I()),i&2){let e=c(2).$implicit;r(2),w(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function wt(i,o){i&1&&m(0," - ")}function Tt(i,o){if(i&1&&(b(0),l(1,"td",77),u(2,It,4,3,"ng-container",51)(3,wt,1,0,"ng-template",null,78,R),s(),I()),i&2){let e=F(4),t=c().$implicit;r(2),p("ngIf",t==null||t.Channel[0]==null?null:t.Channel[0].InventoryReserved)("ngIfElse",e)}}function Mt(i,o){i&1&&(b(0),m(1," - "),I())}function Et(i,o){if(i&1&&(l(0,"span",80),f(1,"date"),m(2),f(3,"date"),s()),i&2){let e=c().$implicit;p("matTooltip",O(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),r(2),w(" ",O(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}var Vt=i=>({"text-decoration-line-through":i});function Dt(i,o){if(i&1&&(l(0,"tr"),u(1,_t,12,10,"ng-container",3),l(2,"td",46),m(3),s(),l(4,"td",47)(5,"div",48)(6,"span",49),m(7),s()()(),l(8,"td",50),u(9,gt,2,1,"ng-container",51)(10,Ct,1,1,"ng-template",null,52,R),s(),l(12,"td")(13,"div",48),u(14,ft,2,0,"div",53)(15,xt,8,6,"div",3)(16,vt,3,3,"div",3)(17,St,4,1,"ng-container",3),s()(),u(18,bt,12,7,"td",54)(19,Tt,5,2,"ng-container",3),l(20,"td",55),u(21,Mt,2,0,"ng-container",51)(22,Et,4,8,"ng-template",null,56,R),s()()),i&2){let e=o.$implicit,t=o.index,n=F(11),a=F(23),h=c(3);r(1),p("ngIf",t==0),r(2),E(e==null?null:e.Model),r(1),p("matTooltip",e.isDiscontinued?h.discontinuedVariantMsg:""),r(2),p("ngClass",L(15,Vt,e.isDiscontinued)),r(1),E(e==null?null:e.Code),r(2),p("ngIf",(e==null?null:e.Channel[0].TypeID)==1)("ngIfElse",n),r(5),p("ngIf",(e==null?null:e.I)==null),r(1),p("ngIf",(e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)),r(1),p("ngIf",(e==null?null:e.I)!=null&&(e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)),r(1),p("ngIf",(e==null?null:e.I)!=null),r(1),p("ngIf",e==null?null:e.Channel),r(1),p("ngIf",h.isShowReservedColumn),r(2),p("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==h.minDate)("ngIfElse",a)}}function Pt(i,o){if(i&1&&(l(0,"tbody"),u(1,Dt,24,17,"tr",32),s()),i&2){let e=o.$implicit;r(1),p("ngForOf",e.Variants)}}function Nt(i,o){if(i&1){let e=S();l(0,"span",81),g("click",function(){d(e);let n=c(2);return _(n.getRowCount())}),l(1,"i",82),m(2,"?"),s()()}}function kt(i,o){if(i&1&&(l(0,"span"),m(1),f(2,"number"),s()),i&2){let e=o.ngIf;r(1),E(x(2,1,e==null?null:e.Total))}}function Ft(i,o){if(i&1){let e=S();l(0,"a",86),g("click",function(){d(e);let n=c(3);return _(n.onNextPage())}),v(1,"i",87),m(2," Next"),s()}}function Rt(i,o){if(i&1){let e=S();l(0,"a",88),g("click",function(){d(e);let n=c(3);return _(n.onLastPage())}),v(1,"i",89),m(2," Last"),s()}}function Bt(i,o){if(i&1&&(l(0,"div",83),u(1,Ft,3,0,"a",84)(2,Rt,3,0,"a",85),s()),i&2){let e=c(2);r(1),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage),r(1),p("ngIf",e.paginationService.disableNextButton&&!e.paginationService.goToLastPage)}}function $t(i,o){if(i&1){let e=S();l(0,"mainpanel",1),g("onSubmit",function(n){d(e);let a=c();return _(a.onSearch(n))}),l(1,"actions")(2,"div",2),u(3,it,2,1,"div",3),f(4,"async"),s()(),l(5,"filters")(6,"div")(7,"label",4),m(8,"Channel"),s(),l(9,"ng-select",5),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.ChannelID=n)}),u(10,at,3,2,"ng-template",6),s()(),l(11,"div",7)(12,"label",8),m(13,"PageNumber"),s(),l(14,"input",9),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.PageNumber=n)}),s()(),l(15,"div",7)(16,"label",10),m(17,"Page Size"),s(),l(18,"input",11),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.RowCount=n)}),s()(),l(19,"div",7)(20,"label",12),m(21,"Quantity From - To"),s(),l(22,"div",13)(23,"input",14),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.QuantityFrom=n)}),s(),m(24," - "),l(25,"input",15),g("ngModelChange",function(n){d(e);let a=c();return _(a.searchFilter.QuantityTo=n)}),s()()()(),l(26,"content")(27,"div",16)(28,"div",17)(29,"div",18),u(30,ot,3,0,"div",19),l(31,"table",20)(32,"thead",21)(33,"tr")(34,"th",22),m(35,"Product "),v(36,"br"),l(37,"mat-slide-toggle",23),g("toggleChange",function(){d(e);let n=c();return n.showDifferenceStock=!n.showDifferenceStock,_(n.onShowDifferenceStock())}),l(38,"small",12),m(39,"FILTER DIFFERENT INVENTORY"),s()()(),l(40,"th",24),m(41,"Variant"),s(),l(42,"th",25),m(43,"SKU"),s(),u(44,lt,2,1,"th",3),f(45,"async"),l(46,"th",26),m(47,"POS"),s(),l(48,"th",27)(49,"div",28),g("click",function(){d(e);let n=c();return _(n.openModalFilter())}),v(50,"img",29),l(51,"span",30),m(52),f(53,"stringLimit"),s()()(),u(54,rt,3,0,"ng-container",3),l(55,"th",31),m(56,"Last Sync"),s()()(),u(57,Pt,2,1,"tbody",32),f(58,"async"),s(),l(59,"div",33)(60,"div",34)(61,"div",35),m(62),f(63,"number"),f(64,"async"),u(65,Nt,3,0,"span",36)(66,kt,3,3,"span",3),f(67,"async"),m(68),s()(),u(69,Bt,3,2,"div",37),f(70,"async"),s()()()()()()}if(i&2){let e=c(),t,n;p("headerTitle","Inventory Comparison")("pageData",e.pageData)("hideSearchBox",!1),r(3),p("ngIf",x(4,24,e.paginationService.data$)),r(6),p("clearable",!1)("items",e.channelOptions)("ngModel",e.searchFilter.ChannelID),r(5),p("ngModel",e.searchFilter.PageNumber),r(4),p("ngModel",e.searchFilter.RowCount),r(5),p("ngModel",e.searchFilter.QuantityFrom),r(2),p("ngModel",e.searchFilter.QuantityTo),r(5),p("ngIf",(e.searchFilter==null?null:e.searchFilter.filterModel)==3),r(14),p("ngIf",x(45,26,e.paginationService.data$)),r(5),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?e.selectedChannel==null?null:e.selectedChannel.Name:""),r(1),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,N),r(2),ce(" ",O(53,28,e.selectedChannel==null?null:e.selectedChannel.Name,13),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>13?"...":""," "),r(2),p("ngIf",e.isShowReservedColumn),r(3),p("ngForOf",x(58,31,e.products$)),r(5),w(" Showing 1 - ",x(63,33,(t=x(64,35,e.paginationService.data$))==null?null:t.length)," of "),r(3),p("ngIf",e.paginationService.hideCount),r(1),p("ngIf",x(67,37,!e.paginationService.hideCount&&e.rowCount$)),r(2),w(" records ~ ",e.paginationService.footerPageNumber," Page "),r(1),p("ngIf",((n=x(70,39,e.paginationService.data$))==null?null:n.length)>0)}}var Fe=(()=>{let o=class o{constructor(t,n,a,h,C,T,M,Be,$e){this.http=t,this.toastr=n,this.dialog=a,this.paginationService=h,this.productService=C,this.authService=T,this.biggerPictureService=M,this.inventoryService=Be,this.mainPanelService=$e,this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="/api/InventoryLoader/Load",this.rowCountApi="/api/Inventory/GetInventoryByChannelRowCount",this.minDate=V.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=V.GuidEMpty,this.Options=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.paginationService.data$.pipe(se(t=>(t=t.map(n=>(n.Variants&&(n.Variants=n.Variants.map(a=>(a.isDiscontinued=n.Discontinued=="Yes",a))),n)),t)),k(t=>{this.checkShowReservedColumn(t)}))}checkShowReservedColumn(t){let n=0,a;t.forEach(h=>{a=h.Variants.find(C=>V.IsNotEmpty(C?.Channel[0]?.InventoryReserved)),a&&(n+=1)}),this.isShowReservedColumn=n>0}initPageLoader(){this.paginationService.fetchDataEndpoint="Inventory/GetSingleChannelComparison",this.loader$=this.http.post(this.loaderApi,{}).pipe(k(t=>{if(this.searchFilter={RowCount:t.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:t.Filter.ChannelID},this.initSelectedChannel(),this.paginationService.reloadPagination(this.searchFilter),!t.Filter.IsMarketplaceAppActive){let n=`Automatic inventory sync disabled.
|
|
2
|
+
Please enable Dealpos X Marketplace Apps integration in POS Configuration`;this.toastr.warning(n,"Warning")}}))}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(t=>t.ID==this.searchFilter.ChannelID)}onSearch(t){this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter),this.initSelectedChannel()}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(t){let n=this.productService.selectedVariantProduct(t);if(n.length>0){let a=n.map(C=>({ID:C.ID,Code:C.Code,Inventory:C.Inventory})),h={ListChannelID:[this.searchFilter.ChannelID],List:a};this.http.post("/api/Inventory/UpdateChannel",h).subscribe(C=>{this.searchFilter.PageNumber=1,this.paginationService.reloadPagination(this.searchFilter),this.checkboxState=!1,this.handlingUpdateStock(C)})}}handlingUpdateStock(t){if(t[0]?.StatusProduct){let n=t[0].StatusProduct.Fail_list,a=t[0].StatusProduct.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",a,n)}else this.toastr.error(t[0]?.Exception,"Error")}refreshInventory(t,n,a,h){let C={ChannelItemID:t,ChannelVariationID:n,ChannelID:a,VariantID:h};this.http.post("/api/Inventory/RefreshInventoryChannel",C).subscribe(T=>{this.toastr.success("Successfully updated","Success"),this.paginationService.reloadPagination(this.searchFilter)})}onCheckboxStateProduct(t){t.Variants=t.Variants.map(n=>(n.Inventory>=0&&(n.selected=t.selected),n))}onCheckboxStateChange(t){t=t.map(n=>(n.Variants=n.Variants.map(a=>(a.selected=this.checkboxState,a)),n))}openTableDialog(t,n,a){this.dialog.open(Ee,{data:{Name:t.Name,Variant:n,ChannelID:n?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:t.ChannelItemID}}).afterClosed().pipe(B(C=>V.IsNotEmpty(C))).subscribe(C=>{this.updateItemAfterDialog(C,a)})}updateItemAfterDialog(t,n){let a={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku},h=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.http.post("/api/Inventory/UpdateQuantityByItem",a).subscribe(C=>{this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+h?.Name+" to "+a.NewQuantity,"Success")})}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=D.DIFFERENCE:this.searchFilter.filterModel=D.ALL,this.paginationService.reloadPagination(this.searchFilter)}onNextPage(){this.paginationService.onNextPage(this.searchFilter)}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,PageNumber:1,text:this.searchFilter.text};this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`${this.rowCountApi}`,t)}onLastPage(){let t={ChannelID:this.searchFilter.ChannelID,PageNumber:1};this.http.post(`${this.rowCountApi}`,t).subscribe({next:n=>{this.searchFilter.PageNumber=1,this.paginationService.getAllData(this.searchFilter,n.Total)}})}onZoomImage(t,n){this.biggerPictureService.openBiggerPicture(t,n)}ngOnDestroy(){this.paginationService.destroy()}};o.\u0275fac=function(n){return new(n||o)(y(H),y(q),y(ee),y(ie),y(ne),y(W),y(Te),y(oe),y(ye))},o.\u0275cmp=P({type:o,selectors:[["app-single-channel-comparison"]],decls:2,vars:3,consts:[["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit"],[1,"d-flex"],[4,"ngIf"],["for","ng-select",1,"fw-bold"],["id","ng-select","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text","mt-3",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModel","ngModelChange"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModel","ngModelChange"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModel","ngModelChange"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],["scope","col",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"matTooltip","click"],[2,"width","16px",3,"src"],[1,"ms-1"],[1,"text-center",2,"width","145px"],[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"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"me-2"],[2,"width","18px",3,"src"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModel","ngModelChange"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-start"],["matTooltipPosition","above",1,"text-end",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],[1,"align-middle"],[4,"ngIf","ngIfElse"],["OTHER_CHANNEL",""],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],["SYNCDATE",""],[1,"text-start",2,"width","0%",3,"rowSpan"],["elsePic",""],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModel","ngModelChange"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src","click"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Allocated"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[1,"text-end",3,"ngClass"],[1,"cursor",3,"click"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom"],[1,"text-end"],["EMPTY_RESERVED",""],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary border-start-0","title","Load all products",3,"click",4,"ngIf"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(n,a){n&1&&(u(0,$t,71,41,"mainpanel",0),f(1,"async")),n&2&&p("ngIf",x(1,1,a.loader$))},dependencies:[me,de,U,K,Z,ge,Y,J,xe,Ce,fe,Ve,te,X,j,z,_e,Pe],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});let i=o;return i})();var At=[{path:"",component:Ne,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",component:ke,canActivate:[re],data:{title:"Inventory Comparison"}},{path:"bychannel",component:Fe,canActivate:[re],data:{title:"Inventory Comparison"}}]}],Re=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=A({type:o}),o.\u0275inj=$({imports:[Q,G.forChild(At)]});let i=o;return i})();var Nn=(()=>{let o=class o{};o.\u0275fac=function(n){return new(n||o)},o.\u0275mod=A({type:o}),o.\u0275inj=$({providers:[oe],imports:[Q,Re,G,we,he,ve,De,be,ae,Se]});let i=o;return i})();export{Nn as InventoryModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as W}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-4PF4YRRT.js";import{c as z,d as j,e as q,f as G,g as H,h as J,i as K,j as Q,k as U}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-PZX3AESM.js";import{a as L,c as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-POSHHHMT.js";import{c as N}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-OV2NRCQ5.js";import{b as P,g as V,h as x}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-KPPQNI2R.js";import{Q as R,R as F,S as I,T as B}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-NN3SPEH5.js";import{u as A}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-FDI2UIO2.js";import{$a as p,Ga as o,La as h,Qa as r,Ta as M,Wa as k,ab as m,bb as w,bc as S,cb as v,db as Y,ea as D,fb as _,ic as b,ja as u,jb as c,ka as f,lb as y,qb as g,rb as C,vb as E,wb as T}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-FA44W5LU.js";function Z(l,a){if(l&1){let X=_();v(0),p(1,"mat-date-range-picker-actions")(2,"button",8),C(3,"Cancel"),m(),p(4,"button",9),c("click",function(){u(X);let e=y();return f(e.onSelectDate())}),C(5,"Search"),m()(),Y()}}var $={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},he=(()=>{let a=class a{constructor(){this.disabled=!1,this.widthClass="w-100",this.showButtonConfirm=!1,this.dateChange=new h}fromDateChange(t){let e=t?.toDate();this.from=e}toDateChange(t){if(t){let e=t.toDate();this.to=e,this.showButtonConfirm||this.emitDateChange()}}onOpenDatepicker(){console.log("open");let t=document.getElementById("dropdown-filter");if(t){var e=new bootstrap.Dropdown(t);e&&(e._config.autoClose="inside")}}onCloseDatepicker(){console.log("close");let t=document.getElementById("dropdown-filter");if(t){var e=new bootstrap.Dropdown(t);e&&(e._config.autoClose="outside")}}emitDateChange(){this.dateChange.emit({from:this.from,to:this.to})}onSelectDate(){this.emitDateChange()}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["app-datepicker-range"]],inputs:{placeholder:"placeholder",displayToggle:"displayToggle",date:"date",disabled:"disabled",minDate:"minDate",widthClass:"widthClass",showButtonConfirm:"showButtonConfirm",from:"from",to:"to"},outputs:{dateChange:"dateChange"},standalone:!0,features:[E([{provide:F,useClass:W,deps:[R]},{provide:I,useValue:$}]),T],decls:8,vars:8,consts:[["appearance","outline",1,"date-range"],["id","dates",3,"min","rangePicker"],["matStartDate","","placeholder","Start date",3,"value","dateChange","click"],["matEndDate","","placeholder","End date",3,"value","dateChange","click"],["matPrefix","",3,"for"],[3,"opened","closed"],["picker",""],[4,"ngIf"],["mat-button","","matDateRangePickerCancel",""],["mat-raised-button","","color","primary","matDateRangePickerApply","",3,"click"]],template:function(e,n){if(e&1){let d=_();p(0,"mat-form-field",0)(1,"mat-date-range-input",1)(2,"input",2),c("dateChange",function(i){return n.fromDateChange(i.value)})("click",function(){u(d);let i=g(6);return f(i.open())}),m(),p(3,"input",3),c("dateChange",function(i){return n.toDateChange(i.value)})("click",function(){u(d);let i=g(6);return f(i.open())}),m()(),w(4,"mat-datepicker-toggle",4),p(5,"mat-date-range-picker",5,6),c("opened",function(){return n.onOpenDatepicker()})("closed",function(){return n.onCloseDatepicker()}),k(7,Z,6,0,"ng-container",7),m()()}if(e&2){let d=g(6);M(n.widthClass),o(1),r("min",n.minDate)("rangePicker",d),o(1),r("value",n.from),o(1),r("value",n.to),o(1),r("for",d),o(3),r("ngIf",n.showButtonConfirm)}},dependencies:[b,S,B,U,z,G,j,q,H,Q,K,J,x,V,P,N,A,O,L],styles:["mat-form-field.date-range.mat-mdc-form-field-type-mat-date-range-input .mat-mdc-form-field-infix{padding-top:12px!important;padding-bottom:12px!important;min-height:45px!important;font-size:14px!important}"]});let l=a;return l})();export{he as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-4PF4YRRT.js";import{a as j}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-HT7RDS3I.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-PZX3AESM.js";import{a as q,b as x}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-L7Q6GF26.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-LAEELPPC.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-POSHHHMT.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-OV2NRCQ5.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-KPPQNI2R.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-L6CJT6UC.js";import{C as O,D as H}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-SQR4ZRTF.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-NN3SPEH5.js";import{c as w,h as B,k as N,u as $}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-FDI2UIO2.js";import{$a as n,Ac as k,Fb as u,Ga as o,Gb as c,Ha as S,Hb as _,Q as h,Qa as m,Ta as I,Wa as M,ab as i,ac as F,ea as C,ec as E,fc as A,hc as T,ic as R,jb as g,q as v,rb as r,tb as f,wb as b,xb as L,yb as P,yc as D}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-FA44W5LU.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-ZKZWHDGN.js";var V=()=>["/menu/log/inventory-async/detail"],G=a=>({ID:a});function J(a,l){if(a&1&&(n(0,"tr")(1,"td")(2,"a",14),r(3),u(4,"date"),i()(),n(5,"td"),r(6),u(7,"number"),i(),n(8,"td")(9,"span",15),r(10),i()()()),a&2){let t=l.$implicit;o(2),m("routerLink",L(13,V))("queryParams",P(14,G,t._id)),o(1),f(" ",_(4,7,t==null?null:t._source["@timestamp"],"dd MMM yyyy HH:mm:ss")," "),o(3),f(" ",_(7,10,t.DurationInSecond,"1.1-1")," s "),o(3),I((t==null||t._source==null||t._source.log==null?null:t._source.log.respCode)===200||(t==null||t._source==null||t._source.log==null?null:t._source.log.respCode)===202?"bg-success":"bg-warning"),o(1),f(" ",t==null||t._source==null||t._source.log==null?null:t._source.log.respCode," ")}}var le=(()=>{let l=class l{constructor(p){this.inventoryAsyncServiceLog=p,this.filters={PageNumber:1,RowCount:100,From:null,To:null,StatusCode:""}}ngOnInit(){this.initInventoryLog()}initInventoryLog(){let p=this.inventoryAsyncServiceLog.getInventoryAsyncLog(this.filters).pipe(h(1));this.inventoryLog$=p.pipe(v(s=>s?.hits)),this.totalPagination$=p.pipe(v(s=>s?.total.value))}onPaginationChange(p){this.filters.PageNumber=p.pageIndex+1,this.initInventoryLog()}onSubmitFilter(){this.initInventoryLog()}};l.\u0275fac=function(s){return new(s||l)(S(j))},l.\u0275cmp=C({type:l,selectors:[["app-inventory-async-log"]],standalone:!0,features:[b],decls:33,vars:16,consts:[["headerTitle","Async Inventory",3,"hideSearchBox","onSubmit"],["container",""],["name","From",3,"date","dateChange"],["name","To",3,"date","dateChange"],[1,"mt-5"],["type","text","name","StatusCode",1,"w-100","mt-2","form-control",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col"],[1,"table-responsive"],[1,"table","table-hover"],[1,"table-light"],[4,"ngFor","ngForOf"],[3,"length","pageSize","pageIndex","page"],[3,"routerLink","queryParams"],[1,"text-white","p-2","rounded","response-desc"]],template:function(s,e){s&1&&(n(0,"mainpanel",0),g("onSubmit",function(){return e.onSubmitFilter()}),n(1,"filters")(2,"div",1)(3,"div")(4,"label"),r(5,"From/To"),i(),n(6,"datepicker",2),g("dateChange",function(d){return e.filters.From=d}),i(),n(7,"datepicker",3),g("dateChange",function(d){return e.filters.To=d}),i()(),n(8,"div",4)(9,"label"),r(10,"Response Code"),i(),n(11,"input",5),g("ngModelChange",function(d){return e.filters.StatusCode=d}),i()()()(),n(12,"content")(13,"div",6)(14,"div",7)(15,"div",8)(16,"div",9)(17,"table",10)(18,"thead")(19,"tr",11)(20,"th"),r(21,"Created"),i(),n(22,"th"),r(23,"Duration"),i(),n(24,"th"),r(25,"Response code"),i()()(),n(26,"tbody"),M(27,J,11,16,"tr",12),u(28,"async"),i()(),n(29,"mat-paginator",13),g("page",function(d){return e.onPaginationChange(d)}),u(30,"async"),u(31,"async"),u(32,"async"),i()()()()()()()),s&2&&(m("hideSearchBox",!0),o(6),m("date",e.filters.From),o(1),m("date",e.filters.To),o(4),m("ngModel",e.filters.StatusCode),o(16),m("ngForOf",c(28,8,e.inventoryLog$)),o(2),m("length",c(30,10,e.totalPagination$))("pageSize",e.filters.RowCount>c(31,12,e.totalPagination$)?c(32,14,e.totalPagination$):e.filters.RowCount)("pageIndex",(e.filters==null?null:e.filters.PageNumber)==0?0:(e.filters==null?null:e.filters.PageNumber)-1))},dependencies:[$,w,B,N,R,F,E,T,A,H,O,x,q,z,k,D]});let a=l;return a})();export{le as InventoryAsyncLogComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as y,A as z,E as F,I as H,Ja as Q,Jb as _,L as G,La as W,N as S,R as C,T as j,Va as X,X as V,aa as Y,ba as A,ca as d,d as g,da as P,fa as Z,ga as J,ia as q,m as f,n as c,q as v,s as p,t as I,w as M,xc as ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-FA44W5LU.js";import{a as m,b as O}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-ZKZWHDGN.js";var D={REMOVE:"remove",SHOW:"show"},ie=(()=>{let r=class r{constructor(){this.strategiesSource=new g({}),this.strategies$=this.strategiesSource.asObservable()}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=y({token:r,factory:r.\u0275fac});let s=r;return s})(),L=new A("USE_CONFIGURATION_STORE"),B=(()=>{let r=class r{constructor(e=!1,t){this.isolate=e,this.configurationStore=t,this.strategiesSource=this.isolate?new g({}):this.configurationStore.strategiesSource,this.strategies$=this.strategiesSource.asObservable(),this.onAuthorisedDefaultStrategy=this.isolate?void 0:this.configurationStore.onAuthorisedDefaultStrategy,this.onUnAuthorisedDefaultStrategy=this.isolate?void 0:this.configurationStore.onUnAuthorisedDefaultStrategy}setDefaultOnAuthorizedStrategy(e){this.isolate?this.onAuthorisedDefaultStrategy=this.getDefinedStrategy(e):(this.configurationStore.onAuthorisedDefaultStrategy=this.getDefinedStrategy(e),this.onAuthorisedDefaultStrategy=this.configurationStore.onAuthorisedDefaultStrategy)}setDefaultOnUnauthorizedStrategy(e){this.isolate?this.onUnAuthorisedDefaultStrategy=this.getDefinedStrategy(e):(this.configurationStore.onUnAuthorisedDefaultStrategy=this.getDefinedStrategy(e),this.onUnAuthorisedDefaultStrategy=this.configurationStore.onUnAuthorisedDefaultStrategy)}addPermissionStrategy(e,t){this.strategiesSource.value[e]=t}getStrategy(e){return this.strategiesSource.value[e]}getAllStrategies(){return this.strategiesSource.value}getDefinedStrategy(e){if(this.strategiesSource.value[e]||this.isPredefinedStrategy(e))return e;throw new Error(`No ' ${e} ' strategy is found please define one`)}isPredefinedStrategy(e){return e===D.SHOW||e===D.REMOVE}};r.\u0275fac=function(t){return new(t||r)(d(L),d(ie))},r.\u0275prov=y({token:r,factory:r.\u0275fac});let s=r;return s})();function l(s){return typeof s=="function"}function K(s){if(Object.prototype.toString.call(s)!=="[object Object]")return!1;{let r=Object.getPrototypeOf(s);return r===null||r===Object.prototype}}function se(s){return!!s&&typeof s=="string"}function R(s){return typeof s=="boolean"}function ne(s){return Object.prototype.toString.call(s)==="[object Promise]"}function T(s){return Array.isArray(s)?s.length>0:!!s}function w(s){return se(s)?[s]:s}var re=(()=>{let r=class r{constructor(){this.permissionsSource=new g({}),this.permissions$=this.permissionsSource.asObservable()}};r.\u0275fac=function(t){return new(t||r)},r.\u0275prov=y({token:r,factory:r.\u0275fac});let s=r;return s})(),$=new A("USE_PERMISSIONS_STORE"),E=(()=>{let r=class r{constructor(e=!1,t){this.isolate=e,this.permissionsStore=t,this.permissionsSource=this.isolate?new g({}):this.permissionsStore.permissionsSource,this.permissions$=this.permissionsSource.asObservable()}flushPermissions(){this.permissionsSource.next({})}hasPermission(e){return!e||Array.isArray(e)&&e.length===0?Promise.resolve(!0):(e=w(e),this.hasArrayPermission(e))}loadPermissions(e,t){let i=e.reduce((n,o)=>this.reducePermission(n,o,t),{});this.permissionsSource.next(i)}addPermission(e,t){if(Array.isArray(e)){let i=e.reduce((n,o)=>this.reducePermission(n,o,t),this.permissionsSource.value);this.permissionsSource.next(i)}else{let i=this.reducePermission(this.permissionsSource.value,e,t);this.permissionsSource.next(i)}}removePermission(e){let t=m({},this.permissionsSource.value);delete t[e],this.permissionsSource.next(t)}getPermission(e){return this.permissionsSource.value[e]}getPermissions(){return this.permissionsSource.value}reducePermission(e,t,i){return i&&l(i)?O(m({},e),{[t]:{name:t,validationFunction:i}}):O(m({},e),{[t]:{name:t}})}hasArrayPermission(e){let t=e.map(i=>{if(this.hasPermissionValidationFunction(i)){let n=this.permissionsSource.value[i].validationFunction,o=m({},this.permissionsSource.value);return c(null).pipe(v(()=>n(i,o)),j(h=>R(h)?c(h):h),F(()=>c(!1)))}return c(!!this.permissionsSource.value[i])});return f(t).pipe(I(),S(i=>i!==!1,!1),v(i=>i!==!1)).toPromise().then(i=>i)}hasPermissionValidationFunction(e){return!!this.permissionsSource.value[e]&&!!this.permissionsSource.value[e].validationFunction&&l(this.permissionsSource.value[e].validationFunction)}};r.\u0275fac=function(t){return new(t||r)(d($),d(re))},r.\u0275prov=y({token:r,factory:r.\u0275fac});let s=r;return s})(),k=class{constructor(){this.rolesSource=new g({}),this.roles$=this.rolesSource.asObservable()}},N=new A("USE_ROLES_STORE"),b=(()=>{let r=class r{constructor(e=!1,t,i){this.isolate=e,this.rolesStore=t,this.permissionsService=i,this.rolesSource=this.isolate?new g({}):this.rolesStore.rolesSource,this.roles$=this.rolesSource.asObservable()}addRole(e,t){let i=O(m({},this.rolesSource.value),{[e]:{name:e,validationFunction:t}});this.rolesSource.next(i)}addRoleWithPermissions(e,t){this.permissionsService.addPermission(t),this.addRole(e,t)}addRoles(e){Object.keys(e).forEach((t,i)=>{this.addRole(t,e[t])})}addRolesWithPermissions(e){Object.keys(e).forEach((t,i)=>{this.addRoleWithPermissions(t,e[t])})}flushRoles(){this.rolesSource.next({})}flushRolesAndPermissions(){this.flushRoles(),this.permissionsService.flushPermissions()}removeRole(e){let t=m({},this.rolesSource.value);delete t[e],this.rolesSource.next(t)}getRoles(){return this.rolesSource.value}getRole(e){return this.rolesSource.value[e]}hasOnlyRoles(e){return!e||Array.isArray(e)&&e.length===0?Promise.resolve(!0):(e=w(e),Promise.all([this.hasRoleKey(e),this.hasRolePermission(this.rolesSource.value,e)]).then(([i,n])=>i||n))}hasRoleKey(e){let t=e.map(i=>{if(!!this.rolesSource.value[i]&&!!this.rolesSource.value[i].validationFunction&&l(this.rolesSource.value[i].validationFunction)&&!ne(this.rolesSource.value[i].validationFunction)){let o=this.rolesSource.value[i].validationFunction,h=m({},this.rolesSource.value);return c(null).pipe(v(()=>o(i,h)),j(x=>R(x)?c(x):x),F(()=>c(!1)))}return c(!1)});return f(t).pipe(I(),S(i=>i!==!1,!1),v(i=>i!==!1)).toPromise().then(i=>i)}hasRolePermission(e,t){return f(t).pipe(p(i=>e[i]&&Array.isArray(e[i].validationFunction)?f(e[i].validationFunction).pipe(p(n=>this.permissionsService.hasPermission(n)),G(n=>n===!0)):c(!1)),S(i=>i===!0,!1)).toPromise()}};r.\u0275fac=function(t){return new(t||r)(d(N),d(k),d(E))},r.\u0275prov=y({token:r,factory:r.\u0275fac});let s=r;return s})(),Pe=(()=>{let r=class r{constructor(){this.permissionsAuthorized=new W,this.permissionsUnauthorized=new W,this.firstMergeUnusedRun=1,this.permissionsService=P(E),this.configurationService=P(B),this.rolesService=P(b),this.viewContainer=P(X),this.changeDetector=P(Q),this.templateRef=P(_)}ngOnInit(){this.viewContainer.clear(),this.initPermissionSubscription=this.validateExceptOnlyPermissions()}ngOnChanges(e){let t=e.ngxPermissionsOnly,i=e.ngxPermissionsExcept;if(t||i){if(t&&t.firstChange||i&&i.firstChange)return;z(this.permissionsService.permissions$,this.rolesService.roles$).pipe(C(this.firstMergeUnusedRun),H(1)).subscribe(()=>{if(T(this.ngxPermissionsExcept)){this.validateExceptAndOnlyPermissions();return}if(T(this.ngxPermissionsOnly)){this.validateOnlyPermissions();return}this.handleAuthorisedPermission(this.getAuthorisedTemplates())})}}ngOnDestroy(){this.initPermissionSubscription&&this.initPermissionSubscription.unsubscribe()}validateExceptOnlyPermissions(){return z(this.permissionsService.permissions$,this.rolesService.roles$).pipe(C(this.firstMergeUnusedRun)).subscribe(()=>{if(T(this.ngxPermissionsExcept)){this.validateExceptAndOnlyPermissions();return}if(T(this.ngxPermissionsOnly)){this.validateOnlyPermissions();return}this.handleAuthorisedPermission(this.getAuthorisedTemplates())})}validateExceptAndOnlyPermissions(){Promise.all([this.permissionsService.hasPermission(this.ngxPermissionsExcept),this.rolesService.hasOnlyRoles(this.ngxPermissionsExcept)]).then(([e,t])=>{if(e||t){this.handleUnauthorisedPermission(this.ngxPermissionsExceptElse||this.ngxPermissionsElse);return}if(this.ngxPermissionsOnly)throw!1;this.handleAuthorisedPermission(this.ngxPermissionsExceptThen||this.ngxPermissionsThen||this.templateRef)}).catch(()=>{this.ngxPermissionsOnly?this.validateOnlyPermissions():this.handleAuthorisedPermission(this.ngxPermissionsExceptThen||this.ngxPermissionsThen||this.templateRef)})}validateOnlyPermissions(){Promise.all([this.permissionsService.hasPermission(this.ngxPermissionsOnly),this.rolesService.hasOnlyRoles(this.ngxPermissionsOnly)]).then(([e,t])=>{e||t?this.handleAuthorisedPermission(this.ngxPermissionsOnlyThen||this.ngxPermissionsThen||this.templateRef):this.handleUnauthorisedPermission(this.ngxPermissionsOnlyElse||this.ngxPermissionsElse)}).catch(()=>{this.handleUnauthorisedPermission(this.ngxPermissionsOnlyElse||this.ngxPermissionsElse)})}handleUnauthorisedPermission(e){if(!(R(this.currentAuthorizedState)&&!this.currentAuthorizedState)){if(this.currentAuthorizedState=!1,this.permissionsUnauthorized.emit(),this.getUnAuthorizedStrategyInput()){this.applyStrategyAccordingToStrategyType(this.getUnAuthorizedStrategyInput());return}this.configurationService.onUnAuthorisedDefaultStrategy&&!this.elseBlockDefined()?this.applyStrategy(this.configurationService.onUnAuthorisedDefaultStrategy):this.showTemplateBlockInView(e)}}handleAuthorisedPermission(e){if(!(R(this.currentAuthorizedState)&&this.currentAuthorizedState)){if(this.currentAuthorizedState=!0,this.permissionsAuthorized.emit(),this.getAuthorizedStrategyInput()){this.applyStrategyAccordingToStrategyType(this.getAuthorizedStrategyInput());return}this.configurationService.onAuthorisedDefaultStrategy&&!this.thenBlockDefined()?this.applyStrategy(this.configurationService.onAuthorisedDefaultStrategy):this.showTemplateBlockInView(e)}}applyStrategyAccordingToStrategyType(e){if(se(e)){this.applyStrategy(e);return}if(l(e)){this.showTemplateBlockInView(this.templateRef),e(this.templateRef);return}}showTemplateBlockInView(e){this.viewContainer.clear(),e&&(this.viewContainer.createEmbeddedView(e),this.changeDetector.markForCheck())}getAuthorisedTemplates(){return this.ngxPermissionsOnlyThen||this.ngxPermissionsExceptThen||this.ngxPermissionsThen||this.templateRef}elseBlockDefined(){return!!this.ngxPermissionsExceptElse||!!this.ngxPermissionsElse}thenBlockDefined(){return!!this.ngxPermissionsExceptThen||!!this.ngxPermissionsThen}getAuthorizedStrategyInput(){return this.ngxPermissionsOnlyAuthorisedStrategy||this.ngxPermissionsExceptAuthorisedStrategy||this.ngxPermissionsAuthorisedStrategy}getUnAuthorizedStrategyInput(){return this.ngxPermissionsOnlyUnauthorisedStrategy||this.ngxPermissionsExceptUnauthorisedStrategy||this.ngxPermissionsUnauthorisedStrategy}applyStrategy(e){if(e===D.SHOW){this.showTemplateBlockInView(this.templateRef);return}if(e===D.REMOVE){this.viewContainer.clear();return}let t=this.configurationService.getStrategy(e);this.showTemplateBlockInView(this.templateRef),t(this.templateRef)}};r.\u0275fac=function(t){return new(t||r)},r.\u0275dir=J({type:r,selectors:[["","ngxPermissionsOnly",""],["","ngxPermissionsExcept",""]],inputs:{ngxPermissionsOnly:"ngxPermissionsOnly",ngxPermissionsOnlyThen:"ngxPermissionsOnlyThen",ngxPermissionsOnlyElse:"ngxPermissionsOnlyElse",ngxPermissionsExcept:"ngxPermissionsExcept",ngxPermissionsExceptElse:"ngxPermissionsExceptElse",ngxPermissionsExceptThen:"ngxPermissionsExceptThen",ngxPermissionsThen:"ngxPermissionsThen",ngxPermissionsElse:"ngxPermissionsElse",ngxPermissionsOnlyAuthorisedStrategy:"ngxPermissionsOnlyAuthorisedStrategy",ngxPermissionsOnlyUnauthorisedStrategy:"ngxPermissionsOnlyUnauthorisedStrategy",ngxPermissionsExceptUnauthorisedStrategy:"ngxPermissionsExceptUnauthorisedStrategy",ngxPermissionsExceptAuthorisedStrategy:"ngxPermissionsExceptAuthorisedStrategy",ngxPermissionsUnauthorisedStrategy:"ngxPermissionsUnauthorisedStrategy",ngxPermissionsAuthorisedStrategy:"ngxPermissionsAuthorisedStrategy"},outputs:{permissionsAuthorized:"permissionsAuthorized",permissionsUnauthorized:"permissionsUnauthorized"},features:[q]});let s=r;return s})(),oe="default";var te=(()=>{let r=class r{constructor(e,t,i){this.permissionsService=e,this.rolesService=t,this.router=i}canActivate(e,t){return this.hasPermissions(e,t)}canActivateChild(e,t){return this.hasPermissions(e,t)}canLoad(e){return this.hasPermissions(e)}canMatch(e){return this.hasPermissions(e)}hasPermissions(e,t){let i=e&&e.data?e.data.permissions:{},n=this.transformPermission(i,e,t);return this.isParameterAvailable(n.except)?this.passingExceptPermissionsValidation(n,e,t):this.isParameterAvailable(n.only)?this.passingOnlyPermissionsValidation(n,e,t):!0}transformPermission(e,t,i){let n=l(e.only)?e.only(t,i):w(e.only),o=l(e.except)?e.except(t,i):w(e.except),h=e.redirectTo;return{only:n,except:o,redirectTo:h}}isParameterAvailable(e){return!!e&&e.length>0}passingExceptPermissionsValidation(e,t,i){if(e.redirectTo&&(l(e.redirectTo)||K(e.redirectTo)&&!this.isRedirectionWithParameters(e.redirectTo))){let n="";return f(e.except).pipe(p(o=>M([this.permissionsService.hasPermission(o),this.rolesService.hasOnlyRoles(o)]).pipe(V(h=>{h.every(U=>U===!1)||(n=o)}))),S(o=>o.some(h=>h===!0),!1),p(o=>n?(this.handleRedirectOfFailedPermission(e,n,t,i),c(!1)):!o&&e.only?this.onlyRedirectCheck(e,t,i):c(!o))).toPromise()}return Promise.all([this.permissionsService.hasPermission(e.except),this.rolesService.hasOnlyRoles(e.except)]).then(([n,o])=>n||o?(e.redirectTo&&this.redirectToAnotherRoute(e.redirectTo,t,i),!1):e.only?this.checkOnlyPermissions(e,t,i):!0)}redirectToAnotherRoute(e,t,i,n){let o=l(e)?e(n,t,i):e;if(this.isRedirectionWithParameters(o)){o.navigationCommands=this.transformNavigationCommands(o.navigationCommands,t,i),o.navigationExtras=this.transformNavigationExtras(o.navigationExtras,t,i),this.router.navigate(o.navigationCommands,o.navigationExtras);return}Array.isArray(o)?this.router.navigate(o):this.router.navigate([o])}isRedirectionWithParameters(e){return K(e)&&(!!e.navigationCommands||!!e.navigationExtras)}transformNavigationCommands(e,t,i){return l(e)?e(t,i):e}transformNavigationExtras(e,t,i){return l(e)?e(t,i):e}onlyRedirectCheck(e,t,i){let n="";return f(e.only).pipe(p(o=>M([this.permissionsService.hasPermission(o),this.rolesService.hasOnlyRoles(o)]).pipe(V(h=>{h.every(U=>U===!1)&&(n=o)}))),S(o=>l(e.redirectTo)?o.some(h=>h===!0):o.every(h=>h===!1),!1),p(o=>l(e.redirectTo)?o?c(!0):(this.handleRedirectOfFailedPermission(e,n,t,i),c(!1)):(n&&this.handleRedirectOfFailedPermission(e,n,t,i),c(!o)))).toPromise()}handleRedirectOfFailedPermission(e,t,i,n){this.isFailedPermissionPropertyOfRedirectTo(e,t)?this.redirectToAnotherRoute(e.redirectTo[t],i,n,t):l(e.redirectTo)?this.redirectToAnotherRoute(e.redirectTo,i,n,t):this.redirectToAnotherRoute(e.redirectTo[oe],i,n,t)}isFailedPermissionPropertyOfRedirectTo(e,t){return!!e.redirectTo&&e.redirectTo[t]}checkOnlyPermissions(e,t,i){let n=m({},e);return Promise.all([this.permissionsService.hasPermission(n.only),this.rolesService.hasOnlyRoles(n.only)]).then(([o,h])=>o||h?!0:(n.redirectTo&&this.redirectToAnotherRoute(n.redirectTo,t,i),!1))}passingOnlyPermissionsValidation(e,t,i){return l(e.redirectTo)||K(e.redirectTo)&&!this.isRedirectionWithParameters(e.redirectTo)?this.onlyRedirectCheck(e,t,i):this.checkOnlyPermissions(e,t,i)}};r.\u0275fac=function(t){return new(t||r)(d(E),d(b),d(ee))},r.\u0275prov=y({token:r,factory:r.\u0275fac});let s=r;return s})();var Se=(()=>{let r=class r{static forRoot(e={}){return{ngModule:r,providers:[re,k,ie,E,te,b,B,{provide:$,useValue:e.permissionsIsolate},{provide:N,useValue:e.rolesIsolate},{provide:L,useValue:e.configurationIsolate}]}}static forChild(e={}){return{ngModule:r,providers:[{provide:$,useValue:e.permissionsIsolate},{provide:N,useValue:e.rolesIsolate},{provide:L,useValue:e.configurationIsolate},B,E,b,te]}}};r.\u0275fac=function(t){return new(t||r)},r.\u0275mod=Z({type:r}),r.\u0275inj=Y({});let s=r;return s})();var u=function(s){return s.SHOOPE="https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",s.WOOCOMMERCE="https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",s.TOKOPEDIA="https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",s.TIKTOK="https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",s.LAZADA="https://res.cloudinary.com/pos/image/upload/v1680681836/icons/marketplace_icons/Lazadanew.png",s.KALCARE="https://res.cloudinary.com/pos/image/upload/v1654230268/icons/marketplace_icons/kalcare.png",s.SHOPIFY="https://res.cloudinary.com/pos/image/upload/v1707987435/icons/marketplace_icons/shopify.png",s}(u||{});var a=function(s){return s[s.Tokopedia=1]="Tokopedia",s[s.WooCommerce=2]="WooCommerce",s[s.None=3]="None",s[s.KalCare=4]="KalCare",s[s.Shopee=5]="Shopee",s[s.Tiktok=6]="Tiktok",s[s.Lazada=7]="Lazada",s[s.Shopify=8]="Shopify",s}(a||{});var De=(()=>{let r=class r{static IsNotEmpty(e){return e!=""&&e!=r.GuidEMpty&&e!=null&&e!=null}static IsEmpty(e){return e==""||e==null||e==null||e==r.GuidEMpty}static getChannelLogoByTypeId(e){let t;switch(e){case a.Tokopedia:t=u.TOKOPEDIA;break;case a.Shopee:t=u.SHOOPE;break;case a.WooCommerce:t=u.WOOCOMMERCE;break;case a.Lazada:t=u.LAZADA;break;case a.Tiktok:t=u.TIKTOK;break;case a.KalCare:t=u.KALCARE;break;case a.Shopify:t=u.SHOPIFY;break}return t}static getChannelLogoByName(e=""){e=e.toLowerCase();let t;switch(e){case"tokopedia":t=u.TOKOPEDIA;break;case"shoppe":t=u.SHOOPE;break;case"woocommerce":t=u.WOOCOMMERCE;break;case"tiktok":t=u.TIKTOK;break;case"lazada":t=u.LAZADA;break;case"kalCare":t=u.KALCARE;break}return t}static getChannelName(e){let t;switch(e){case a.Shopee:t="Shopee";break;case a.Tokopedia:t="Tokopedia";break;case a.Lazada:t="Lazada";break;case a.Tiktok:t="Tiktok";break;case a.WooCommerce:t="WooCommerce";break;case a.KalCare:t="WooCommerce";break}return t}static assignChannelLogo(e){return e=e.map(t=>(t.logo=this.getChannelLogoByTypeId(t.TypeID),t)),e}static getCssChannelColor(e){let t;switch(e){case a.Shopee:t="#ee4d2d";break;case a.Tokopedia:t="var(--G500,#03AC0E)";break;case a.Lazada:t="#FF00B2";break;case a.Tiktok:t="black";break;case a.WooCommerce:t="#674399";break;case a.KalCare:t="rgb(128, 188, 0)";break}return t}static getDaysDiff(e,t){var i=t.getTime()-e.getTime(),n=i/(1e3*60*60*24);return n}static addDays(e,t){let i=new Date(Number(e));return i.setDate(e.getDate()-t),i}static isValidDate(e){return e instanceof Date&&!isNaN(e)}static getImageInfo(e){return new Promise((t,i)=>{let n=new Image;n.src=e,n.decode().then(()=>{t({img:e,height:n.height,width:n.width})}).catch(()=>{i(new Error(`Image load error for ${e}`))})})}static formatTitleFromDate(e,t){let i=null,n=new Date(e),o=new Date(t);return n.getDate()!=o.getDate()&&(i="dd"),n.getMonth()!=o.getMonth()&&(i="dd MMM"),n.getFullYear()!=o.getFullYear()&&(i="dd MMM yyyy"),i}static openDownloadFile(e,t){var i=window.URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download=t,n.click()}static compare(e,t,i){return(e<t?-1:1)*(i?1:-1)}static isDateExpired(e){let t=new Date,i=!1;return e.getTime()<t.getTime()&&(i=!0),i}};r.GuidEMpty="00000000-0000-0000-0000-000000000000",r.MinDate="0001-01-01T00:00:00";let s=r;return s})();export{u as a,a as b,De as c,E as d,Pe as e,Se as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as U}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-PNLW4YVH.js";import{A as T,s as k,t as w,z as S}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-SQR4ZRTF.js";import{h as I,k as x}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-FDI2UIO2.js";import{$a as a,Aa as C,Ga as s,Ha as d,Qa as m,Wa as _,ab as c,ac as O,bb as u,ea as g,fb as M,ja as f,jb as p,ka as h,rb as v,sb as y}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-FA44W5LU.js";function b(o,e){if(o&1){let r=M();a(0,"li")(1,"mat-checkbox",5),p("ngModelChange",function(t){let i=f(r).$implicit;return h(i.selected=t)}),a(2,"div",6),u(3,"img",7),a(4,"h5",8),v(5),c()()()()}if(o&2){let r=e.$implicit;s(1),m("ngModel",r.selected),s(2),m("src",r.Img,C),s(2),y(r.Name)}}var E=(()=>{let e=class e{constructor(l,t){this.data=l,this.dialogRef=t,this.selectedItems=this.data.selectedItems,this.channels=this.data.channels}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new S,this.modalConfig.title="Updating Inventory"}onOk(){this.dialogRef.close(this.channels)}onClose(){this.dialogRef.close()}getSelectedChannel(){return this.channels.filter(l=>l.selected)}};e.\u0275fac=function(t){return new(t||e)(d(w),d(k))},e.\u0275cmp=g({type:e,selectors:[["app-modal-update-channels"]],decls:5,vars:3,consts:[[3,"dynamicValidated","config","onOk","onClose","onCancel"],["content",""],[2,"overflow-y","auto","max-height","28rem"],[1,"no-bullet"],[4,"ngFor","ngForOf"],[3,"ngModel","ngModelChange"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src"],[1,"fw-light","ms-2","my-auto"]],template:function(t,n){if(t&1&&(a(0,"modal-material",0),p("onOk",function(){return n.onOk()})("onClose",function(){return n.onClose()})("onCancel",function(){return n.onClose()}),a(1,"div",1)(2,"div",2)(3,"ul",3),_(4,b,6,3,"li",4),c()()()()),t&2){let i;m("dynamicValidated",((i=n.getSelectedChannel())==null?null:i.length)>0)("config",n.modalConfig),s(4),m("ngForOf",n.channels)}},dependencies:[O,I,x,U,T],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]});let o=e;return o})();export{E as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$a as i,Aa as r,Ga as a,Qa as s,ab as c,bb as m,ea as o,rb as p,wb as d}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.10.0/Marketplace/chunk-FA44W5LU.js";var y=(()=>{let t=class t{constructor(){this.emptyStateImg="https://res.cloudinary.com/pos/image/upload/v1683772105/icons/marketplace_icons/emptyrecord.svg"}ngOnInit(){}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=o({type:t,selectors:[["app-empty-state"]],standalone:!0,features:[d],decls:4,vars:1,consts:[["alt","",2,"width","225px",3,"src"],[1,"text-center","fs-2","text-secondary","mt-4"]],template:function(e,f){e&1&&(i(0,"div"),m(1,"img",0),i(2,"div",1),p(3," No records found "),c()()),e&2&&(a(1),s("src",f.emptyStateImg,r))}});let n=t;return n})();export{y as a};
|