marketplacepos 3.21.6 → 3.21.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-4QUCNZN2.js → chunk-2F44QDLH.js} +1 -1
- package/Marketplace/{chunk-UP5CXG2B.js → chunk-2QVIG263.js} +1 -1
- package/Marketplace/{chunk-IB46MDNU.js → chunk-3P4COPCN.js} +1 -1
- package/Marketplace/{chunk-AQA52J4U.js → chunk-6ESX3BS2.js} +1 -1
- package/Marketplace/{chunk-6PCT7HIM.js → chunk-7JKSOA2R.js} +2 -2
- package/Marketplace/{chunk-2EYWMPQX.js → chunk-AFBDLFMY.js} +1 -1
- package/Marketplace/{chunk-WW6W3SP2.js → chunk-BMK5SJRN.js} +1 -1
- package/Marketplace/{chunk-MQNWQ257.js → chunk-CYUYV52E.js} +1 -1
- package/Marketplace/{chunk-B5FAOEVH.js → chunk-EE3YTF4V.js} +1 -1
- package/Marketplace/chunk-EE7O2AZI.js +1 -0
- package/Marketplace/chunk-EJSGWKV7.js +1 -0
- package/Marketplace/{chunk-R3QJR4HI.js → chunk-EMEIDNOO.js} +1 -1
- package/Marketplace/{chunk-KJOJ6LAX.js → chunk-EOIKKQ7X.js} +1 -1
- package/Marketplace/{chunk-GNWFAGYX.js → chunk-ES4U2NNX.js} +1 -1
- package/Marketplace/{chunk-4EZWKXNL.js → chunk-FYKIDYCS.js} +1 -1
- package/Marketplace/{chunk-TDI34NXM.js → chunk-GCDM4B4K.js} +1 -1
- package/Marketplace/{chunk-JF3MAISY.js → chunk-IGFLJLH3.js} +1 -1
- package/Marketplace/{chunk-MNP4VHWJ.js → chunk-JML5C5LT.js} +1 -1
- package/Marketplace/{chunk-S5YRRWEO.js → chunk-LBKERMQG.js} +1 -1
- package/Marketplace/{chunk-LW7U63D2.js → chunk-MZ2CV5F4.js} +1 -1
- package/Marketplace/{chunk-KRIKEQ65.js → chunk-NACI2VXY.js} +1 -1
- package/Marketplace/chunk-NBSXPQ4I.js +1 -0
- package/Marketplace/{chunk-MHQ3TN3W.js → chunk-O4KSD4DG.js} +1 -1
- package/Marketplace/{chunk-5WNZHEXR.js → chunk-OHAF22S3.js} +1 -1
- package/Marketplace/{chunk-GX4H5CMI.js → chunk-POIVCN6Y.js} +1 -1
- package/Marketplace/{chunk-7232476I.js → chunk-RATKMB5I.js} +1 -1
- package/Marketplace/{chunk-CALC5HI4.js → chunk-TFKI74DX.js} +1 -1
- package/Marketplace/{chunk-W3CAJZBB.js → chunk-TNTE5NGV.js} +1 -1
- package/Marketplace/{chunk-BZ2J2YBO.js → chunk-VIZJAMWI.js} +1 -1
- package/Marketplace/{chunk-DGR4P3AD.js → chunk-VMXCRHQU.js} +1 -1
- package/Marketplace/{chunk-6XQF4AYN.js → chunk-VPLWN7IJ.js} +1 -1
- package/Marketplace/{chunk-D6NLUBBA.js → chunk-XBSGKOKN.js} +1 -1
- package/Marketplace/{chunk-AYXSVVB7.js → chunk-YYWDZAFM.js} +1 -1
- package/Marketplace/{chunk-IX2SX7NH.js → chunk-YZFIOH77.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-JIBRMOJ5.js → main-YL2BGL7R.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-6ROL3HRT.js +0 -1
- package/Marketplace/chunk-OVGQQRBL.js +0 -1
- package/Marketplace/chunk-VMV4M5HA.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ct}from"./chunk-MHQ3TN3W.js";import{a as Ct}from"./chunk-ENIJ4MFV.js";import{a as ht,b as ft}from"./chunk-2KEQ33LI.js";import{f as gt}from"./chunk-C2SGQUOH.js";import{b as D,c as E,i as k,j as w}from"./chunk-OI3SQ5ZO.js";import{t as P}from"./chunk-OE7XFNYO.js";import{X as mt}from"./chunk-UEB6GFG5.js";import{h as st,m as pt}from"./chunk-JCKUKK6T.js";import{b as m,c as f}from"./chunk-KZ2VDCDO.js";import{$a as z,Bc as lt,Ec as rt,Ha as I,Ib as at,Ja as l,Jb as s,Ka as g,Kb as u,Lb as S,Nb as V,Ob as U,Pb as A,Q as X,Tb as W,Va as tt,Yc as dt,_a as C,ab as p,ac as x,bc as O,da as Z,dc as ot,ga as T,hb as G,ib as et,kb as nt,lb as it,mb as a,nb as r,oa as F,ob as y,pa as L,pb as H,q as Q,qb as J,sb as R,vb as v,vc as B,xb as h,xc as K,yc as $}from"./chunk-QNL3BTRG.js";function bt(n,d){if(n&1&&(a(0,"mat-option",10)(1,"div",11),y(2,"img",12),a(3,"span"),s(4),r()()()),n&2){let t=d.$implicit;p("value",t.ID)("disabled",t.disabled),l(),p("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),l(),p("src",t.Img,I),l(2),u(t.Name)}}function Tt(n,d){if(n&1){let t=R();a(0,"div",13)(1,"label",14),s(2,"Scan Type"),r(),a(3,"mat-radio-group",15),A("ngModelChange",function(e){F(t);let o=h();return U(o.filter.ScanFull,e)||(o.filter.ScanFull=e),L(e)}),a(4,"mat-radio-button",16),s(5," Full (Include Inactive Products) "),r(),a(6,"mat-radio-button",17),s(7," Active "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.ScanFull),l(),p("value",!0),l(2),p("value",!1)}}function It(n,d){n&1&&(a(0,"span"),s(1,"Never"),r())}function xt(n,d){if(n&1&&(a(0,"span"),s(1),x(2,"async"),r()),n&2){let t=h(2);l(),u(O(2,1,t.lastSync$))}}function Ot(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3)(2,"span",18),s(3,"Last Scan:"),r(),C(4,It,2,0,"span"),x(5,"async"),C(6,xt,3,3,"span"),r(),a(7,"mat-radio-group",19),A("ngModelChange",function(e){F(t);let o=h();return U(o.filter.UpdatedProduct,e)||(o.filter.UpdatedProduct=e),L(e)}),a(8,"mat-radio-button",20),s(9," Scan All Products "),r(),a(10,"mat-radio-button",21),s(11),r()()()}if(n&2){let t=h();l(4),G(O(5,6,t.lastSync$)==null?4:6),l(3),V("ngModel",t.filter.UpdatedProduct),l(),p("value",!1),l(2),p("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),l(),S(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Pt(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3),s(2," Scan Option "),r(),a(3,"mat-radio-group",22),A("ngModelChange",function(e){F(t);let o=h();return U(o.filter.Async,e)||(o.filter.Async=e),L(e)}),a(4,"mat-radio-button",23),s(5," Asynchronous (Get Notified when Complete) "),r(),a(6,"mat-radio-button",24),s(7," Synchronous (Wait until Complete) "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.Async),l(),p("value",!0),l(2),p("value",!1)}}var te=(()=>{let d=class d{constructor(i,e,o){this.dialogRef=i,this.data=e,this.router=o,this.channelService=Z(ct),this.channelType=m,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(i=>(i.disabled=!0,(i.TypeID==m.Tiktok||i.TypeID==m.Tokopedia||i.TypeID==m.Lazada||i.TypeID==m.WooCommerce)&&(i.disabled=!1),i)).sort(i=>i.disabled?1:-1))}onSelectChannel(i){let e=this.filterChannelById(i);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.setDefaultConfigUpdate(),this.getLastSync(i)}getLastSync(i){this.lastSync$=this.channelService.getLastSync(i).pipe(Q(e=>f.IsNotEmpty(e.LastSync)?f.convertToReadableDate(e.LastSync):null),X(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==m.Shopee||this.selectedChannel.TypeID==m.Tiktok||this.selectedChannel.TypeID==m.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=m.WooCommerce&&this.selectedChannel?.TypeID!=m.KalCare&&this.selectedChannel?.TypeID!=m.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(i){let e;return this.channelOptions&&(e=this.channelOptions.find(o=>o.ID==i)),e}submit(){this.selectedChannel.TypeID==m.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(i){return f.IsNotEmpty(i)}onClose(){this.dialogRef.close()}};d.\u0275fac=function(e){return new(e||d)(g(D),g(E),g(dt))},d.\u0275cmp=T({type:d,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),s(4,"Select a Channel"),r(),a(5,"mat-form-field",4)(6,"mat-select",5),A("ngModelChange",function(c){return U(o.filter.ChannelID,c)||(o.filter.ChannelID=c),c}),v("ngModelChange",function(c){return o.onSelectChannel(c)}),C(7,bt,5,5,"mat-option",6),r()(),C(8,Tt,8,3,"div",7)(9,Ot,12,8,"div",8)(10,Pt,8,3,"div",9),r()()()),e&2&&(p("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),l(6),p("disabled",o.disabledChannelOption),V("ngModel",o.filter.ChannelID),l(),p("ngForOf",o.channelOptions),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)),l(),G(o.hasScanUpdate&&o.selectedChannel?9:-1),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[K,$,st,pt,ht,ft,gt,Ct,mt,P,w,lt],encapsulation:2});let n=d;return n})();var M=function(n){return n.Tokopedia="https://seller.tokopedia.com",n.Shoope="https://seller.shopee.co.id",n.Tiktok="https://seller-id.tiktok.com",n.WooCommerce="https://woocommerce.dealpos.app",n.Lazada="https://sellercenter.lazada.co.id",n}(M||{});var Dt=n=>({"is-disabled":n});function Et(n,d){if(n&1&&(H(0),a(1,"tr")(2,"td",11),s(3),r(),a(4,"td",11),s(5),r(),a(6,"td",12)(7,"p",13),s(8,"Product Not in Channel!"),r()()(),J()),n&2){let t=h().$implicit;l(3),S(" ",t==null?null:t.Model,""),l(2),S(" ",t==null?null:t.Code,"")}}function kt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Model,"")}}function wt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Code,"")}}function Nt(n,d){if(n&1&&(a(0,"tr"),C(1,kt,2,2,"td",14)(2,wt,2,2,"td",14),a(3,"td",11)(4,"div",15)(5,"a",16),y(6,"img",17),r(),a(7,"div",18),s(8),r()()(),a(9,"td",11),s(10),x(11,"number"),r(),a(12,"td",19),s(13),x(14,"number"),r(),a(15,"td",19)(16,"a",20),y(17,"i",21),a(18,"span",22),s(19,"Edit"),r()()()()),n&2){let t=d.$implicit,i=d.index,e=h(3);l(),p("ngIf",i==0),l(),p("ngIf",i==0),l(3),p("href",t.Url,I)("title",t.Title),l(),p("src",e.getChannelLogo(t.TypeID),I),l(),p("matTooltip",(t==null||t.Name==null?null:t.Name.length)>55?t==null?null:t.Name:""),l(),S(" ",t.Name," "),l(2),u(O(11,12,t.Price)),l(3),u(O(14,14,t.Inventory)),l(3),p("href",e.getHyperlinkSellerCenter(t),I)("ngClass",W(16,Dt,t.TypeID==e.channelType.KalCare))("matTooltip",t.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Vt(n,d){if(n&1&&C(0,Nt,20,18,"tr",9),n&2){let t=h().$implicit;p("ngForOf",t==null?null:t.Channel)}}function Ut(n,d){if(n&1&&(H(0),C(1,Et,9,2,"ng-container",10)(2,Vt,1,1,"ng-template",null,0,ot),J()),n&2){let t=d.$implicit,i=at(3);l(),p("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",i)}}var de=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.channelType=m,this.variants=i.variants,this.title=i.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(i){return f.getChannelLogoByTypeId(i)}getHyperlinkSellerCenter(i){let e="javascript:void(0)";switch(i.TypeID){case m.Shopee:e=`${M.Shoope}/portal/product/${i.ChannelItemID}`;break;case m.Tiktok:e=`${M.Tiktok}/product/edit/${i.ChannelItemID}`;break;case m.Tokopedia:e=`${M.Tokopedia}/edit-product/${i.ChannelItemID}`;break;case m.WooCommerce:e=`${M.WooCommerce}/wp-admin/post.php?post=${i.ChannelItemID}&action=edit`;break;case m.Lazada:e=`${M.Lazada}/apps/product/publish?productId=${i.ChannelItemID}`;break}return e}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(a(0,"modal-material",1),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),s(6," VARIANT "),a(7,"sup"),y(8,"i",6),r()(),a(9,"th",5),s(10,"SKU"),r(),a(11,"th",5),s(12," PRODUCT "),a(13,"sup"),y(14,"i",7),r()(),a(15,"th",5),s(16,"PRICE"),r(),a(17,"th",8),s(18,"INVENTORY"),r(),y(19,"th",5),r()(),a(20,"tbody"),C(21,Ut,4,2,"ng-container",9),r()()()()),e&2&&(p("config",o.modalConfig),l(21),p("ngForOf",o.variants))},dependencies:[B,K,$,P,w,rt],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let n=d;return n})();var At=n=>({"bg-gradient-warning":n});function Ft(n,d){if(n&1&&(a(0,"tr",5)(1,"td"),s(2),r(),a(3,"td",6),s(4),r()()),n&2){let t=d.$implicit;p("matTooltip",t.duplicateMessage),l(2),u(t==null?null:t.Name),l(),p("ngClass",W(4,At,t.isDuplicate)),l(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var Ce=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.variants=tt([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let i=this.data?.variants,e={},o=[],_=i.filter(c=>f.IsEmpty(c.ChannelVariationSKU));i.filter(c=>f.IsNotEmpty(c.ChannelVariationSKU)).forEach((c,b,Y)=>{e[c.ChannelVariationSKU]=Y.filter(N=>N.ChannelVariationSKU===c.ChannelVariationSKU)}),Object.keys(e).forEach(c=>{e[c].length>1&&(e[c]=e[c].map((b,Y,N)=>{let q=`SKU ${b.ChannelVariationSKU} is duplicated with variant`;return N.forEach((j,Mt)=>{j.Name!==b.Name&&(q+=` ${N.length>2?j.Name+(Mt!==N.length-1?",":""):j.Name}`)}),b.duplicateMessage=q,b.isDuplicate=!0,b})),o.push(...e[c])}),o.push(..._),this.variants.set(o)}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variants"]],decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),s(6,"Variant"),r(),a(7,"th",4),s(8,"SKU"),r()()(),a(9,"tbody"),nt(10,Ft,5,6,"tr",5,et),r()()()()),e&2&&(p("config",o.modalConfig),l(10),it(o.variants()))},dependencies:[B,P,w],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]});let n=d;return n})();export{te as a,de as b,Ce as c};
|
|
1
|
+
import{a as ct}from"./chunk-O4KSD4DG.js";import{a as Ct}from"./chunk-ENIJ4MFV.js";import{a as ht,b as ft}from"./chunk-2KEQ33LI.js";import{f as gt}from"./chunk-C2SGQUOH.js";import{b as D,c as E,i as k,j as w}from"./chunk-OI3SQ5ZO.js";import{t as P}from"./chunk-OE7XFNYO.js";import{X as mt}from"./chunk-UEB6GFG5.js";import{h as st,m as pt}from"./chunk-JCKUKK6T.js";import{b as m,c as f}from"./chunk-KZ2VDCDO.js";import{$a as z,Bc as lt,Ec as rt,Ha as I,Ib as at,Ja as l,Jb as s,Ka as g,Kb as u,Lb as S,Nb as V,Ob as U,Pb as A,Q as X,Tb as W,Va as tt,Yc as dt,_a as C,ab as p,ac as x,bc as O,da as Z,dc as ot,ga as T,hb as G,ib as et,kb as nt,lb as it,mb as a,nb as r,oa as F,ob as y,pa as L,pb as H,q as Q,qb as J,sb as R,vb as v,vc as B,xb as h,xc as K,yc as $}from"./chunk-QNL3BTRG.js";function bt(n,d){if(n&1&&(a(0,"mat-option",10)(1,"div",11),y(2,"img",12),a(3,"span"),s(4),r()()()),n&2){let t=d.$implicit;p("value",t.ID)("disabled",t.disabled),l(),p("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),l(),p("src",t.Img,I),l(2),u(t.Name)}}function Tt(n,d){if(n&1){let t=R();a(0,"div",13)(1,"label",14),s(2,"Scan Type"),r(),a(3,"mat-radio-group",15),A("ngModelChange",function(e){F(t);let o=h();return U(o.filter.ScanFull,e)||(o.filter.ScanFull=e),L(e)}),a(4,"mat-radio-button",16),s(5," Full (Include Inactive Products) "),r(),a(6,"mat-radio-button",17),s(7," Active "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.ScanFull),l(),p("value",!0),l(2),p("value",!1)}}function It(n,d){n&1&&(a(0,"span"),s(1,"Never"),r())}function xt(n,d){if(n&1&&(a(0,"span"),s(1),x(2,"async"),r()),n&2){let t=h(2);l(),u(O(2,1,t.lastSync$))}}function Ot(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3)(2,"span",18),s(3,"Last Scan:"),r(),C(4,It,2,0,"span"),x(5,"async"),C(6,xt,3,3,"span"),r(),a(7,"mat-radio-group",19),A("ngModelChange",function(e){F(t);let o=h();return U(o.filter.UpdatedProduct,e)||(o.filter.UpdatedProduct=e),L(e)}),a(8,"mat-radio-button",20),s(9," Scan All Products "),r(),a(10,"mat-radio-button",21),s(11),r()()()}if(n&2){let t=h();l(4),G(O(5,6,t.lastSync$)==null?4:6),l(3),V("ngModel",t.filter.UpdatedProduct),l(),p("value",!1),l(2),p("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),l(),S(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Pt(n,d){if(n&1){let t=R();a(0,"div",8)(1,"label",3),s(2," Scan Option "),r(),a(3,"mat-radio-group",22),A("ngModelChange",function(e){F(t);let o=h();return U(o.filter.Async,e)||(o.filter.Async=e),L(e)}),a(4,"mat-radio-button",23),s(5," Asynchronous (Get Notified when Complete) "),r(),a(6,"mat-radio-button",24),s(7," Synchronous (Wait until Complete) "),r()()()}if(n&2){let t=h();l(3),V("ngModel",t.filter.Async),l(),p("value",!0),l(2),p("value",!1)}}var te=(()=>{let d=class d{constructor(i,e,o){this.dialogRef=i,this.data=e,this.router=o,this.channelService=Z(ct),this.channelType=m,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(e.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(e.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID,this.filter.ScanFull=!1}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(i=>(i.disabled=!0,(i.TypeID==m.Tiktok||i.TypeID==m.Tokopedia||i.TypeID==m.Lazada||i.TypeID==m.WooCommerce)&&(i.disabled=!1),i)).sort(i=>i.disabled?1:-1))}onSelectChannel(i){let e=this.filterChannelById(i);this.selectedChannel=e,this.filter.Async=!0,this.iniHasScanUpdate(),this.setDefaultConfigUpdate(),this.getLastSync(i)}getLastSync(i){this.lastSync$=this.channelService.getLastSync(i).pipe(Q(e=>f.IsNotEmpty(e.LastSync)?f.convertToReadableDate(e.LastSync):null),X(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==m.Shopee||this.selectedChannel.TypeID==m.Tiktok||this.selectedChannel.TypeID==m.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=m.WooCommerce&&this.selectedChannel?.TypeID!=m.KalCare&&this.selectedChannel?.TypeID!=m.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(i){let e;return this.channelOptions&&(e=this.channelOptions.find(o=>o.ID==i)),e}submit(){this.selectedChannel.TypeID==m.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(i){return f.IsNotEmpty(i)}onClose(){this.dialogRef.close()}};d.\u0275fac=function(e){return new(e||d)(g(D),g(E),g(dt))},d.\u0275cmp=T({type:d,selectors:[["app-scan-dialog"]],decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onOk",function(){return o.submit()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),s(4,"Select a Channel"),r(),a(5,"mat-form-field",4)(6,"mat-select",5),A("ngModelChange",function(c){return U(o.filter.ChannelID,c)||(o.filter.ChannelID=c),c}),v("ngModelChange",function(c){return o.onSelectChannel(c)}),C(7,bt,5,5,"mat-option",6),r()(),C(8,Tt,8,3,"div",7)(9,Ot,12,8,"div",8)(10,Pt,8,3,"div",9),r()()()),e&2&&(p("dynamicValidated",o.isNotEmpty(o.filter.ChannelID))("config",o.modalConfig),l(6),p("disabled",o.disabledChannelOption),V("ngModel",o.filter.ChannelID),l(),p("ngForOf",o.channelOptions),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)),l(),G(o.hasScanUpdate&&o.selectedChannel?9:-1),l(),p("ngIf",!o.isSingleChannel&&o.isNotEmpty(o.filter.ChannelID)))},dependencies:[K,$,st,pt,ht,ft,gt,Ct,mt,P,w,lt],encapsulation:2});let n=d;return n})();var M=function(n){return n.Tokopedia="https://seller.tokopedia.com",n.Shoope="https://seller.shopee.co.id",n.Tiktok="https://seller-id.tiktok.com",n.WooCommerce="https://woocommerce.dealpos.app",n.Lazada="https://sellercenter.lazada.co.id",n}(M||{});var Dt=n=>({"is-disabled":n});function Et(n,d){if(n&1&&(H(0),a(1,"tr")(2,"td",11),s(3),r(),a(4,"td",11),s(5),r(),a(6,"td",12)(7,"p",13),s(8,"Product Not in Channel!"),r()()(),J()),n&2){let t=h().$implicit;l(3),S(" ",t==null?null:t.Model,""),l(2),S(" ",t==null?null:t.Code,"")}}function kt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Model,"")}}function wt(n,d){if(n&1&&(a(0,"td",11),s(1),r()),n&2){let t=h(3).$implicit;z("rowspan",t.Channel.length),l(),S(" ",t==null?null:t.Code,"")}}function Nt(n,d){if(n&1&&(a(0,"tr"),C(1,kt,2,2,"td",14)(2,wt,2,2,"td",14),a(3,"td",11)(4,"div",15)(5,"a",16),y(6,"img",17),r(),a(7,"div",18),s(8),r()()(),a(9,"td",11),s(10),x(11,"number"),r(),a(12,"td",19),s(13),x(14,"number"),r(),a(15,"td",19)(16,"a",20),y(17,"i",21),a(18,"span",22),s(19,"Edit"),r()()()()),n&2){let t=d.$implicit,i=d.index,e=h(3);l(),p("ngIf",i==0),l(),p("ngIf",i==0),l(3),p("href",t.Url,I)("title",t.Title),l(),p("src",e.getChannelLogo(t.TypeID),I),l(),p("matTooltip",(t==null||t.Name==null?null:t.Name.length)>55?t==null?null:t.Name:""),l(),S(" ",t.Name," "),l(2),u(O(11,12,t.Price)),l(3),u(O(14,14,t.Inventory)),l(3),p("href",e.getHyperlinkSellerCenter(t),I)("ngClass",W(16,Dt,t.TypeID==e.channelType.KalCare))("matTooltip",t.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Vt(n,d){if(n&1&&C(0,Nt,20,18,"tr",9),n&2){let t=h().$implicit;p("ngForOf",t==null?null:t.Channel)}}function Ut(n,d){if(n&1&&(H(0),C(1,Et,9,2,"ng-container",10)(2,Vt,1,1,"ng-template",null,0,ot),J()),n&2){let t=d.$implicit,i=at(3);l(),p("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",i)}}var de=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.channelType=m,this.variants=i.variants,this.title=i.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(i){return f.getChannelLogoByTypeId(i)}getHyperlinkSellerCenter(i){let e="javascript:void(0)";switch(i.TypeID){case m.Shopee:e=`${M.Shoope}/portal/product/${i.ChannelItemID}`;break;case m.Tiktok:e=`${M.Tiktok}/product/edit/${i.ChannelItemID}`;break;case m.Tokopedia:e=`${M.Tokopedia}/edit-product/${i.ChannelItemID}`;break;case m.WooCommerce:e=`${M.WooCommerce}/wp-admin/post.php?post=${i.ChannelItemID}&action=edit`;break;case m.Lazada:e=`${M.Lazada}/apps/product/publish?productId=${i.ChannelItemID}`;break}return e}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variant"]],decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(e,o){e&1&&(a(0,"modal-material",1),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),s(6," VARIANT "),a(7,"sup"),y(8,"i",6),r()(),a(9,"th",5),s(10,"SKU"),r(),a(11,"th",5),s(12," PRODUCT "),a(13,"sup"),y(14,"i",7),r()(),a(15,"th",5),s(16,"PRICE"),r(),a(17,"th",8),s(18,"INVENTORY"),r(),y(19,"th",5),r()(),a(20,"tbody"),C(21,Ut,4,2,"ng-container",9),r()()()()),e&2&&(p("config",o.modalConfig),l(21),p("ngForOf",o.variants))},dependencies:[B,K,$,P,w,rt],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]});let n=d;return n})();var At=n=>({"bg-gradient-warning":n});function Ft(n,d){if(n&1&&(a(0,"tr",5)(1,"td"),s(2),r(),a(3,"td",6),s(4),r()()),n&2){let t=d.$implicit;p("matTooltip",t.duplicateMessage),l(2),u(t==null?null:t.Name),l(),p("ngClass",W(4,At,t.isDuplicate)),l(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var Ce=(()=>{let d=class d{constructor(i,e){this.data=i,this.dialogRef=e,this.variants=tt([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let i=this.data?.variants,e={},o=[],_=i.filter(c=>f.IsEmpty(c.ChannelVariationSKU));i.filter(c=>f.IsNotEmpty(c.ChannelVariationSKU)).forEach((c,b,Y)=>{e[c.ChannelVariationSKU]=Y.filter(N=>N.ChannelVariationSKU===c.ChannelVariationSKU)}),Object.keys(e).forEach(c=>{e[c].length>1&&(e[c]=e[c].map((b,Y,N)=>{let q=`SKU ${b.ChannelVariationSKU} is duplicated with variant`;return N.forEach((j,Mt)=>{j.Name!==b.Name&&(q+=` ${N.length>2?j.Name+(Mt!==N.length-1?",":""):j.Name}`)}),b.duplicateMessage=q,b.isDuplicate=!0,b})),o.push(...e[c])}),o.push(..._),this.variants.set(o)}initModalConfig(){this.modalConfig=new k,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}};d.\u0275fac=function(e){return new(e||d)(g(E),g(D))},d.\u0275cmp=T({type:d,selectors:[["app-modal-variants"]],decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(e,o){e&1&&(a(0,"modal-material",0),v("onCancel",function(){return o.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),s(6,"Variant"),r(),a(7,"th",4),s(8,"SKU"),r()()(),a(9,"tbody"),nt(10,Ft,5,6,"tr",5,et),r()()()()),e&2&&(p("config",o.modalConfig),l(10),it(o.variants()))},dependencies:[B,P,w],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]});let n=d;return n})();export{te as a,de as b,Ce as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as he}from"./chunk-KJ4SL5OX.js";import"./chunk-ZSZQPMV2.js";import{a as ce}from"./chunk-
|
|
1
|
+
import{a as he}from"./chunk-KJ4SL5OX.js";import"./chunk-ZSZQPMV2.js";import{a as ce}from"./chunk-RATKMB5I.js";import{a as se}from"./chunk-LIPM3QTO.js";import{a as F}from"./chunk-XHAXYWZ7.js";import{b as pe,c as V}from"./chunk-EXBAGUW2.js";import"./chunk-BVIRHZTZ.js";import"./chunk-GDA72XOJ.js";import"./chunk-S66L7N22.js";import"./chunk-LZVUS3GC.js";import"./chunk-DSKMV7XY.js";import"./chunk-633RG6PO.js";import"./chunk-O4N2CCVN.js";import{a as le}from"./chunk-OUJF6YWV.js";import"./chunk-YUBBVFFI.js";import"./chunk-UX3GY5M2.js";import"./chunk-C2SGQUOH.js";import{i as M}from"./chunk-ES4U2NNX.js";import{b as te,e as ne}from"./chunk-KTXT25SP.js";import"./chunk-KCDL7SWP.js";import{d as ie,l as ae,m as oe,n as re}from"./chunk-OI3SQ5ZO.js";import"./chunk-OE7XFNYO.js";import"./chunk-UEB6GFG5.js";import{c as q,h as X,m as Y,o as Z,y as ee}from"./chunk-JCKUKK6T.js";import{c as D}from"./chunk-KZ2VDCDO.js";import{$ as j,B,Bc as J,Fc as K,Ja as h,Jb as _,Ka as m,Nb as L,Ob as T,Pb as E,Qb as z,Rb as $,Va as w,X as k,_a as I,ab as d,ac as v,bc as y,da as S,ga as A,mb as c,nb as p,oa as b,ob as U,pa as P,pb as G,qb as W,rb as H,sb as N,vb as C,xb as g,yc as Q}from"./chunk-QNL3BTRG.js";import{a as R,b as x}from"./chunk-GNOSNGXM.js";var O=(()=>{let r=class r{constructor(){this.authService=S(M),this.channelOptions=this.authService.getChannels()}filterSelectedChannels(t,i){let e=Object.assign([],this.channelOptions),n=[],a;return t.forEach(o=>{a=e.find(s=>s.ID==o?.parent?.id),a&&(a=x(R({},a),{Name:`${o?.parent?.label} - ${o?.label}`,LocationID:o?.id}),n.push(a))}),i.forEach(o=>{a=e.find(s=>s.ID==o.id),a&&n.push(a)}),n}generateFilterLocation(t,i){let e=[],n=[],a=[];return t.length>0?(e=t.map(o=>o.id),n=t.map(o=>o.parent.id).filter((o,s,f)=>f.indexOf(o)===s)):(e=[],n=[]),a=i.map(o=>o.id),a=a.concat(n).filter((o,s,f)=>f.indexOf(o)===s),{locationIds:e,channelIds:a}}};r.\u0275fac=function(i){return new(i||r)},r.\u0275prov=j({token:r,factory:r.\u0275fac});let l=r;return l})();function ue(l,r){if(l&1){let u=N();c(0,"button",15),C("click",function(){b(u);let i=g().ngIf,e=g();return P(e.onUpdateItems(i))}),U(1,"i",16),_(2," Update "),p()}}function me(l,r){if(l&1&&(c(0,"actions")(1,"div",13),I(2,ue,3,0,"button",14),p()()),l&2){let u=r.ngIf,t=g();h(2),d("ngIf",t.productService.hasSelectionVariant(u))}}function ge(l,r){l&1&&H(0)}function Ce(l,r){if(l&1){let u=N();G(0),c(1,"app-table",17),C("onToggle",function(i){b(u);let e=g();return P(e.onShowDifferenceStock(i))})("onSubmit",function(i){b(u);let e=g();return P(e.updateStockByVariant(i))}),p(),W()}if(l&2){let u=r.ngIf,t=g();h(),d("data",u)("channel",t.channels())("showProductToggle",!0)("hiddenIPOSInventory",t.searchFilter.HiddenIPOSInventory)}}var $e=(()=>{let r=class r{constructor(t,i,e,n,a,o){this.http=t,this.toastr=i,this.dialog=e,this.productService=n,this.authService=a,this.mainPanelService=o,this.paginationService=S(V),this.multiChannelService=S(O),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=w([]),this.selectedChannels=w([]),this.channels=w([]),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.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(k(t=>{t.Filter={PageNumber:t.Filter.PageNumber,filterModel:F.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>D.isValidGUID(n.id)==!1),e=t.filter(n=>D.isValidGUID(n.id));this.selectedLocations.set(i),this.selectedChannels.set(e)}onSearch(t){let i=this.multiChannelService.filterSelectedChannels(this.selectedLocations(),this.selectedChannels());this.channels.set(i);let e=this.multiChannelService.generateFilterLocation(this.selectedLocations(),this.selectedChannels());this.searchFilter.ListChannelID=e.channelIds,this.searchFilter.ListLocationID=e.locationIds,this.searchFilter.text=t,this.paginationService.reloadPagination(this.searchFilter)}updateStock(t,i){let e=this.productService.selectedVariantProduct(t);if(e.length>0){let n=[];e.forEach(s=>{s.Channel?.forEach(f=>{n.push({ID:s.ID,Code:s.Code,Inventory:s.Inventory,LocationID:f.LocationID})})});let o={ListChannelID:i.filter(s=>s.selected).map(s=>s.ID),List:n};this.http.post("/api/Inventory/UpdateChannel",o).subscribe(s=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+o.List.length+" variants in "+o.ListChannelID.length+" channels","Success")})}}updateStockByVariant(t){let i={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,NewQuantity:parseFloat(t.Inventory),VariantID:t.ID,SKU:t.Sku,LocationID:t.LocationID};this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(e=>{this.paginationService.reloadPagination(this.searchFilter);let n=this.productService.findChannelById(i.ID,this.channelOptions);this.toastr.success("Successfully updated "+t.ItemName+"("+t.VarName+") inventory in "+n.Name+" to "+i.NewQuantity,"Success")})}onShowDifferenceStock(t){t?this.searchFilter.filterModel=F.DIFFERENCE:this.searchFilter.filterModel=F.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(t){let i=this.productService.selectedVariantProduct(t),e=this.channelOptions.filter(n=>this.channels()?.find(a=>a.ID===n.ID));this.dialog.open(se,{data:{selectedItems:i,channels:JSON.parse(JSON.stringify(e))},width:"600px"}).afterClosed().pipe(B(n=>D.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}};r.\u0275fac=function(i){return new(i||r)(m(ne),m(te),m(ie),m(le),m(M),m(ae))},r.\u0275cmp=A({type:r,selectors:[["app-multi-channel-comparison"]],standalone:!0,features:[z([V,O]),$],decls:26,vars:22,consts:[["headerTitle","Inventory Comparison","textButton","Search",3,"onSubmit","pageData","hideSearchBox"],[4,"ngIf"],["for","selectChannel",1,"fw-bold","mb-3"],["id","selectChannel",3,"onChannelChange","multiple"],[1,"mt-5"],["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,"ngModelChange","ngModel"],["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,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[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,"onToggle","onSubmit","data","channel","showProductToggle","hiddenIPOSInventory"]],template:function(i,e){i&1&&(c(0,"mainpanel",0),C("onSubmit",function(a){return e.onSearch(a)}),I(1,me,3,1,"actions",1),v(2,"async"),c(3,"filters"),I(4,ge,1,0,"ng-container",1),v(5,"async"),c(6,"div")(7,"label",2),_(8,"Channel"),p(),c(9,"multiwarehouse-tree-select",3),C("onChannelChange",function(a){return e.onChannelChange(a)}),p()(),c(10,"div",4)(11,"label",5),_(12,"PageNumber"),p(),c(13,"input",6),E("ngModelChange",function(a){return T(e.searchFilter.PageNumber,a)||(e.searchFilter.PageNumber=a),a}),p()(),c(14,"div",4)(15,"label",7),_(16,"Page Size"),p(),c(17,"input",8),E("ngModelChange",function(a){return T(e.searchFilter.RowCount,a)||(e.searchFilter.RowCount=a),a}),p()()(),c(18,"content")(19,"div",9)(20,"div",10)(21,"div",11),I(22,Ce,2,4,"ng-container",1),v(23,"async"),c(24,"infinite-paginator",12),v(25,"async"),C("onNextPage",function(){return e.paginationService.onNextPage(e.searchFilter)})("onLastPage",function(){return e.paginationService.onLastPage(e.searchFilter)})("onGetRowCount",function(){return e.paginationService.getRowCount(e.searchFilter)}),p()()()()()()),i&2&&(d("pageData",e.pageData)("hideSearchBox",!1),h(),d("ngIf",y(2,14,e.paginationService.data$)),h(3),d("ngIf",y(5,16,e.loader$)),h(5),d("multiple",!0),h(4),L("ngModel",e.searchFilter.PageNumber),h(4),L("ngModel",e.searchFilter.RowCount),h(5),d("ngIf",y(23,18,e.paginationService.data$)),h(2),d("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",y(25,20,e.paginationService.totalRowCount$))("pageNumber",e.paginationService.pageNumber())("disableNextButton",e.paginationService.disableNextButton())("goToLastPage",e.paginationService.isLastPage()))},dependencies:[K,Q,J,re,oe,ce,ee,q,Z,X,Y,pe,he],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let l=r;return l})();export{$e as MultiChannelComparison};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b}from"./chunk-GCHJ4FTF.js";import{a as P}from"./chunk-AGKVS3IQ.js";import{b as O}from"./chunk-2LJXM62F.js";import"./chunk-ENIJ4MFV.js";import{a as C}from"./chunk-45PCYYJD.js";import{c as M}from"./chunk-2KEQ33LI.js";import{a as m}from"./chunk-
|
|
1
|
+
import{a as b}from"./chunk-GCHJ4FTF.js";import{a as P}from"./chunk-AGKVS3IQ.js";import{b as O}from"./chunk-2LJXM62F.js";import"./chunk-ENIJ4MFV.js";import{a as C}from"./chunk-45PCYYJD.js";import{c as M}from"./chunk-2KEQ33LI.js";import{a as m}from"./chunk-YYWDZAFM.js";import{a as h}from"./chunk-XSYSCEVJ.js";import"./chunk-UOT5GPQI.js";import"./chunk-UX3GY5M2.js";import"./chunk-C2SGQUOH.js";import{e as s}from"./chunk-7IIB5DLC.js";import"./chunk-ES4U2NNX.js";import"./chunk-KTXT25SP.js";import"./chunk-KCDL7SWP.js";import{n as u}from"./chunk-OI3SQ5ZO.js";import{u as f}from"./chunk-OE7XFNYO.js";import"./chunk-UEB6GFG5.js";import{y as g}from"./chunk-JCKUKK6T.js";import"./chunk-KZ2VDCDO.js";import{$c as a,Fc as i,Xc as l,aa as e,ga as d,ha as r,ob as c}from"./chunk-QNL3BTRG.js";import"./chunk-GNOSNGXM.js";var _=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=d({type:t,selectors:[["app-products"]],decls:1,vars:0,template:function(n,v){n&1&&c(0,"router-outlet")},dependencies:[l],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=t;return o})();var y=[{path:"",component:_,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-LBKERMQG.js").then(o=>o.StatusModule),canActivate:[m]},{path:"download",loadChildren:()=>import("./chunk-MZ2CV5F4.js").then(o=>o.DownloadModule),canActivate:[m]},{path:"upload",loadComponent:()=>import("./chunk-XBSGKOKN.js").then(o=>o.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[m]}]}],w=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,a.forChild(y)]});let o=t;return o})();var W=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,g,a,w,f,u,s,O,C,M,h,P,b]});let o=t;return o})();export{W as ProductModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as B}from"./chunk-
|
|
1
|
+
import{a as B}from"./chunk-OHAF22S3.js";import{a as vt}from"./chunk-7KG3DC5J.js";import{a as $}from"./chunk-45PCYYJD.js";import{a as st,b as ft,d as ut,e as gt}from"./chunk-7IIB5DLC.js";import{i as dt}from"./chunk-ES4U2NNX.js";import{e as pt}from"./chunk-KTXT25SP.js";import"./chunk-KCDL7SWP.js";import{m as k,n as ht}from"./chunk-OI3SQ5ZO.js";import"./chunk-OE7XFNYO.js";import"./chunk-UEB6GFG5.js";import{h as rt,m as lt,y as mt}from"./chunk-JCKUKK6T.js";import{c as ct}from"./chunk-KZ2VDCDO.js";import{$c as R,Ab as J,Bc as w,Cc as M,Ec as P,Fc as L,Ga as W,Ha as H,Ib as K,Ja as m,Jb as l,Ka as v,Kb as d,Lb as x,Nb as Q,Ob as X,Pb as Y,Q as j,Sb as Z,T as q,Tb as tt,Ub as et,V as U,Wc as at,Zc as F,_a as u,aa as I,ab as p,ac as s,bc as _,c as z,cc as S,dc as it,ga as y,ha as b,mb as r,nb as o,oa as N,ob as D,pa as E,pb as g,q as C,qb as h,sb as G,vb as V,vc as nt,xb as f,xc as ot,yc as T}from"./chunk-QNL3BTRG.js";import"./chunk-GNOSNGXM.js";var Et=(t,e)=>({"bg-gradient-danger":t,"bg-gradient-warning":e}),Dt=()=>["/menu/notification/detail"],Tt=t=>({ID:t});function wt(t,e){if(t&1&&(r(0,"span",14),D(1,"img",15),o(),l(2)),t&2){let n=e.item;m(),p("src",n.Img,H)("alt",n.Name),m(),x(" ",n.Name," ")}}function Mt(t,e){if(t&1&&(g(0),l(1),s(2,"number"),r(3,"span"),l(4,"s"),o(),h()),t&2){let n=f().$implicit;m(),x(" ",S(2,1,n.DurationInSecond,"1.1-1")," ")}}function Pt(t,e){t&1&&l(0," - ")}function Lt(t,e){if(t&1&&(g(0),r(1,"tr",16)(2,"td")(3,"a",17),D(4,"img",18),r(5,"span"),l(6),o()()(),r(7,"td")(8,"b"),l(9),o(),D(10,"div",19),o(),r(11,"td"),u(12,Mt,5,4,"ng-container",20)(13,Pt,1,0,"ng-template",null,0,it),o(),r(15,"td"),l(16),o(),r(17,"td"),l(18),s(19,"date"),o()(),h()),t&2){let n=e.$implicit,a=K(14);m(),p("ngClass",et(14,Et,n.Status==1,n.Status==0)),m(2),p("routerLink",Z(17,Dt))("queryParams",tt(18,Tt,n.ID)),m(),J("src",n.Img,H),m(2),d(n.Name),m(3),d(n.Label),m(),p("innerHTML",n.Message,W),m(2),p("ngIf",n.DurationInSecond)("ngIfElse",a),m(4),d(n.StatusLabel),m(2),d(S(19,11,n.Created,"dd MMM yyyy HH:mm"))}}function Ft(t,e){if(t&1){let n=G();g(0),r(1,"div",6)(2,"div",21)(3,"app-custom-paginator",22),s(4,"async"),s(5,"async"),V("total",function(){N(n);let i=f(2);return E(i.getRowCount())})("next",function(){N(n);let i=f(2);return E(i.getNotifications())})("previous",function(){N(n);let i=f(2);return E(i.getNotifications())}),o()()(),h()}if(t&2){let n=f().ngIf,a=f();m(3),p("filter",a.filter)("totaldata",n==null?null:n.length)("paginationTotal",_(4,4,a.rowCount$))("hasClicked",_(5,6,a.rowCount$))}}function Rt(t,e){if(t&1&&(g(0),u(1,Ft,6,8,"ng-container",13),h()),t&2){let n=e.ngIf;m(),p("ngIf",n.length>0)}}var _t=(()=>{let e=class e{constructor(a,i,c){this.http=a,this.notificationService=i,this.authService=c,this.filter=new vt,this.destroy$=new z,this.channelOptions=c.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(U(this.destroy$)).subscribe(a=>{a.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(a=>{this.filter=a.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let a={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",a).pipe(C(i=>i.Data),C(i=>(i=this.setChannelLogoToNotifications(i),i=this.setTimeToSecond(i),i)),j(1))}setTimeToSecond(a){return a=a.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i)),a}setChannelLogoToNotifications(a){return a=a.map(i=>(i.Img=ct.getChannelLogoByTypeId(i.TypeID),i)),a}getRowCount(){let a={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",a).pipe(C(i=>i.Count),j(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};e.\u0275fac=function(i){return new(i||e)(v(pt),v(B),v(dt))},e.\u0275cmp=y({type:e,selectors:[["app-notification"]],decls:30,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(i,c){i&1&&(r(0,"mainpanel",1),V("onSubmit",function(){return c.onFilter()}),r(1,"filters")(2,"div")(3,"h6",2),l(4,"Channel"),o(),r(5,"ng-select",3),Y("ngModelChange",function(O){return X(c.filter.ChannelID,O)||(c.filter.ChannelID=O),O}),u(6,wt,3,3,"ng-template",4),o()()(),r(7,"content")(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11)(15,"th"),l(16,"Channel"),o(),r(17,"th"),l(18,"Process"),o(),r(19,"th"),l(20,"Duration"),o(),r(21,"th"),l(22,"Status"),o(),r(23,"th"),l(24,"Created"),o()()(),r(25,"tbody"),u(26,Lt,20,20,"ng-container",12),s(27,"async"),o()()()()(),u(28,Rt,2,1,"ng-container",13),s(29,"async"),o()()()),i&2&&(m(5),p("clearable",!0)("items",c.channelOptions),Q("ngModel",c.filter.ChannelID),m(21),p("ngForOf",_(27,5,c.notifications$)),m(2),p("ngIf",_(29,7,c.notifications$)))},dependencies:[nt,ot,T,ut,st,ft,rt,lt,k,F,$,w,P,M]});let t=e;return t})();function Bt(t,e){if(t&1&&(r(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),l(4,"Perflog"),o()(),r(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),l(9),o()()()()()()),t&2){let n=f().ngIf;m(9),d(n.Perflog)}}function kt(t,e){if(t&1&&(g(0),r(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),l(5,"StackTrace"),o()(),r(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),l(10),o()()()()()(),h()),t&2){let n=f().ngIf;m(10),d(n==null?null:n.StackTrace)}}function $t(t,e){if(t&1&&(g(0),r(1,"mainpanel",1)(2,"actions")(3,"a",2),l(4,"Back"),o()(),r(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),l(12,"General"),o()(),r(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),l(18,"Created Date"),o(),r(19,"div")(20,"span"),l(21),s(22,"date"),o()()()(),r(23,"div",10)(24,"div",11)(25,"label"),l(26,"Status"),o(),r(27,"div")(28,"span"),l(29),o()()()()(),r(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),l(34,"Duration"),o(),r(35,"div")(36,"span"),l(37),s(38,"number"),o()()()(),r(39,"div",10)(40,"div",11)(41,"label"),l(42,"Label"),o(),r(43,"div")(44,"span"),l(45),o()()()()()()()()(),r(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),l(51,"Message"),o()(),r(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),l(56),o()()()()()(),u(57,Bt,10,1,"div",16)(58,kt,11,1,"ng-container",0),o()()()(),h()),t&2){let n=e.ngIf;m(),p("headerTitle","Notification "+n.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),m(20),d(S(22,10,n.Created,"dd MMM yyyy HH:mm:ss")),m(8),d(n.StatusLabel),m(8),x("",S(38,13,n.DurationInSecond,"1.1-1")," s"),m(8),d(n.Label),m(11),d(n.Message),m(),p("ngIf",n==null?null:n.Perflog),m(),p("ngIf",n==null?null:n.StackTrace)}}var Ct=(()=>{let e=class e{constructor(a,i){this.activatedRoute=a,this.notificationService=i}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(q(a=>{let i=a.ID;return this.notificationService.getNotificationDetail(i).pipe(C(c=>(c.DurationInSecond=parseInt(c.Duration)/1e3,c)))}))}};e.\u0275fac=function(i){return new(i||e)(v(at),v(B))},e.\u0275cmp=y({type:e,selectors:[["app-detail"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(i,c){i&1&&(u(0,$t,59,16,"ng-container",0),s(1,"async")),i&2&&p("ngIf",_(1,1,c.notification$))},dependencies:[T,k,F,w,P,M]});let t=e;return t})();var Ot=[{path:"",component:_t},{path:"detail",component:Ct}],St=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=b({type:e}),e.\u0275inj=I({imports:[L,R.forChild(Ot)]});let t=e;return t})();var se=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=b({type:e}),e.\u0275inj=I({imports:[L,St,gt,mt,ht,R,$]});let t=e;return t})();export{se as NotificationModule};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ee}from"./chunk-LQWFYVLD.js";import"./chunk-6U6JR5K6.js";import{a as $t,d as Zt,e as Xt}from"./chunk-F57GDDSE.js";import{a as et}from"./chunk-BVIRHZTZ.js";import{a as le,b as pe,c as vt}from"./chunk-7N5WLZWW.js";import{a as se}from"./chunk-EYZIWEGE.js";import{b as Rt}from"./chunk-L3JD55OC.js";import"./chunk-GDA72XOJ.js";import"./chunk-S66L7N22.js";import{a as Bt,b as zt,c as Gt,d as jt,e as Ht,f as Ut,g as Yt}from"./chunk-4AUJZEST.js";import"./chunk-7FSQ3UC2.js";import{a as Dt,b as Et}from"./chunk-UAXJ7MHW.js";import"./chunk-ZRW4OZGG.js";import{i as qt}from"./chunk-633RG6PO.js";import{a as Jt,b as Kt}from"./chunk-O4N2CCVN.js";import{a as me,b as Tt}from"./chunk-4NXO2JYR.js";import{f as kt,g as Lt,h as Vt,i as Ft,j as At}from"./chunk-PCKZD4LZ.js";import{a as Ot}from"./chunk-OUJF6YWV.js";import"./chunk-YUBBVFFI.js";import{a as Q}from"./chunk-GCHJ4FTF.js";import{b as Wt}from"./chunk-2LJXM62F.js";import{b as Mt}from"./chunk-ENIJ4MFV.js";import{a as Pt,b as It,c as Nt}from"./chunk-2KEQ33LI.js";import{a as de}from"./chunk-
|
|
1
|
+
import{a as ee}from"./chunk-LQWFYVLD.js";import"./chunk-6U6JR5K6.js";import{a as $t,d as Zt,e as Xt}from"./chunk-F57GDDSE.js";import{a as et}from"./chunk-BVIRHZTZ.js";import{a as le,b as pe,c as vt}from"./chunk-7N5WLZWW.js";import{a as se}from"./chunk-EYZIWEGE.js";import{b as Rt}from"./chunk-L3JD55OC.js";import"./chunk-GDA72XOJ.js";import"./chunk-S66L7N22.js";import{a as Bt,b as zt,c as Gt,d as jt,e as Ht,f as Ut,g as Yt}from"./chunk-4AUJZEST.js";import"./chunk-7FSQ3UC2.js";import{a as Dt,b as Et}from"./chunk-UAXJ7MHW.js";import"./chunk-ZRW4OZGG.js";import{i as qt}from"./chunk-633RG6PO.js";import{a as Jt,b as Kt}from"./chunk-O4N2CCVN.js";import{a as me,b as Tt}from"./chunk-4NXO2JYR.js";import{f as kt,g as Lt,h as Vt,i as Ft,j as At}from"./chunk-PCKZD4LZ.js";import{a as Ot}from"./chunk-OUJF6YWV.js";import"./chunk-YUBBVFFI.js";import{a as Q}from"./chunk-GCHJ4FTF.js";import{b as Wt}from"./chunk-2LJXM62F.js";import{b as Mt}from"./chunk-ENIJ4MFV.js";import{a as Pt,b as It,c as Nt}from"./chunk-2KEQ33LI.js";import{a as de}from"./chunk-YYWDZAFM.js";import"./chunk-UOT5GPQI.js";import"./chunk-C2SGQUOH.js";import{a as re,b as oe,c as gt,d as X,e as _t}from"./chunk-7IIB5DLC.js";import{f as he,i as Z}from"./chunk-ES4U2NNX.js";import{b as Te,e as A}from"./chunk-KTXT25SP.js";import"./chunk-KCDL7SWP.js";import{b as Ct,d as De,e as yt,f as wt,g as xt,m as Y,n as bt}from"./chunk-OI3SQ5ZO.js";import{t as ft,u as St}from"./chunk-OE7XFNYO.js";import{P as ut}from"./chunk-UEB6GFG5.js";import{b as He,c as $,h as z,m as G,o as ae,y as Ue}from"./chunk-JCKUKK6T.js";import{b as N,c as M}from"./chunk-KZ2VDCDO.js";import{$ as fe,$c as je,Ab as st,B as rt,Bb as dt,Bc as ve,Cc as F,Ec as K,Fc as Se,Ha as V,Ib as O,Ja as p,Jb as m,Ka as v,Kb as S,Lb as T,Nb as w,Ob as x,Pb as b,Q as ye,Qb as ct,Rb as We,Sb as J,T as ot,Tb as Be,Ub as ie,Va as mt,Wc as Ge,X as be,Xc as ht,Zc as ne,_a as u,aa as Ae,ab as d,ac as P,bc as k,ca as ce,cc as R,dc as U,ga as L,ha as Re,hb as Qe,mb as n,na as lt,nb as r,oa as g,ob as C,pa as _,pb as D,q as j,qa as Ze,qb as E,ra as Xe,sb as I,vb as y,vc as ze,w as at,xb as c,xc as W,yc as B,za as pt}from"./chunk-QNL3BTRG.js";import{a as it,b as nt}from"./chunk-GNOSNGXM.js";var Qt=(()=>{let l=class l{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[et.downloadOrder]},{Title:"Log",Url:"/menu/Order/Download_Order_Log",Permissions:[et.downloadOrder]}]}ngOnInit(){}};l.\u0275fac=function(t){return new(t||l)},l.\u0275cmp=L({type:l,selectors:[["app-orders"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(t,i){t&1&&(n(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),r()()(),C(4,"router-outlet")),t&2&&(p(3),d("Tabs",i.ObjectOrderTabs)("usePermissions",!0))},dependencies:[Dt,ht]});let a=l;return a})();var ei=(()=>{let l=class l{constructor(){}convertToCSV(e,t){let i;if(typeof e=="string")i=e;else{var h=typeof e=="object"?e:JSON.parse(e);i=this.transformToCSVStringFormat(h)}this.downloadCSV(i,t)}transformToCSVStringFormat(e){if(!e||!e.length)return;let t=",",i=Object.keys(e[0]);return e.map(f=>i.map(s=>{let q=f[s]===null||f[s]===void 0?"":f[s];return q=q instanceof Date?q.toLocaleString():q.toString().replace(/"/g,'""'),q.search(/("|,|\n)/g)>=0&&(q=`"${q}"`),q}).join(t)).join(`
|
|
2
2
|
`)}downloadCSV(e,t){var i=new Blob([e],{type:"text/csv;charset=utf8;"}),h=document.createElement("a");h.setAttribute("href",window.URL.createObjectURL(i)),h.setAttribute("download",t),document.body.appendChild(h),h.click(),document.body.removeChild(h)}};l.\u0275fac=function(t){return new(t||l)},l.\u0275prov=fe({token:l,factory:l.\u0275fac,providedIn:"root"});let a=l;return a})();var Ee=(()=>{let l=class l{constructor(e,t){this.http=e,this.exportService=t}loadInitialPage(){return this.http.post("/api/ordersLoader/GetOrder",{})}getNewOrders(e){return this.http.post("/api/orders/GetNewOrder",e).pipe(j(t=>t.Data))}getTotalNewOrders(e,t,i){let h={ListChannelID:e,From:t,To:i};return this.http.post("/api/orders/GetCountNewOrder",h).pipe(j(f=>f.Count))}exportOrders(e,t){return this.http.post("api/Orders/ExportOrder",e).pipe(be(i=>{this.exportService.convertToCSV(i,t)}))}};l.\u0275fac=function(t){return new(t||l)(ce(A),ce(ei))},l.\u0275prov=fe({token:l,factory:l.\u0275fac});let a=l;return a})();var Ye=(()=>{let l=class l{constructor(e,t){this.http=e,this.toastr=t}acceptTokopediaOrders(e){return this.http.post("/api/Orders/AcceptOrderTokopedia",e).pipe(be(t=>{this.tokopediaAcceptOrderHandler(t)}))}tokopediaAcceptOrderHandler(e){let t=e.filter(h=>h.Status==!1),i=e.filter(h=>h.Status==!0);if(t.length==0&&i.length>0){let h=`<ol>${this.generateSuccessMessage(i)}</ol>`;this.toastr.success(h,"Success",{enableHtml:!0})}else if(t.length>0&&i.length>0){let h=`<ol>
|
|
3
3
|
${this.generateSuccessMessage(i)}
|
|
4
4
|
${this.generateErrorMessage(t)}
|
|
@@ -6,4 +6,4 @@ import{a as ee}from"./chunk-LQWFYVLD.js";import"./chunk-6U6JR5K6.js";import{a as
|
|
|
6
6
|
Payment : `,o.PaymentState,"")}}function Xn(a,l){if(a&1&&(n(0,"tr")(1,"td"),m(2),r(),n(3,"td"),m(4),r(),u(5,qn,3,4,"td",5),n(6,"td")(7,"span"),m(8),r(),m(9),r(),n(10,"td",73)(11,"span"),m(12),r(),m(13),r(),n(14,"td"),u(15,Jn,2,1,"span",5)(16,$n,2,1,"ul",74),r(),n(17,"td"),u(18,Zn,2,3,"span",75),r()()),a&2){let o=l.$implicit,e=l.index,t=c(4);p(2),S(e+1),p(2),S(o.Number),p(),d("ngIf",(t.currentChannel==null?null:t.currentChannel.TypeID)!=t.channelType.Shopee&&(t.currentChannel==null?null:t.currentChannel.TypeID)!==t.channelType.Tiktok),p(3),T("",o.ChannelStatus," - "),p(),T("",o.ChannelStatusDescription," "),p(),d("ngClass",ie(12,kn,(o==null?null:o.Action)==t.actionPreviewOrder.Update,(o==null?null:o.Action)==t.actionPreviewOrder.New))("matTooltip",o.POSStatus==91||o.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),p(2),T("",o.POSStatus," - "),p(),T("",o.POSStatusDescription," "),p(2),d("ngIf",o.ActionString.length==1),p(),d("ngIf",o.ActionString.length>1),p(2),d("ngIf",o.ChannelStatus!=99&&o.POSStatus!=99)}}function Qn(a,l){if(a&1&&(D(0),u(1,Xn,19,15,"tr",72),E()),a&2){let o=c(3);p(),d("ngForOf",o.displayedPreviewData)}}function ea(a,l){a&1&&(n(0,"tr",79)(1,"td",80)(2,"div",81),C(3,"i",82),r(),n(4,"h4",83),m(5," There is no order to processed "),r()()())}function ta(a,l){if(a&1){let o=I();n(0,"div",51)(1,"div",52)(2,"div",53)(3,"div",54)(4,"div")(5,"ul",55)(6,"li",56)(7,"button",57),y("click",function(){g(o);let t=c(2);return _(t.filterPreviewData(t.previewStatus.ALL))}),m(8),r()(),n(9,"li",58)(10,"button",59),y("click",function(){g(o);let t=c(2);return _(t.filterPreviewData(t.previewStatus.SYNC))}),m(11),r()(),n(12,"li",58)(13,"button",60),y("click",function(){g(o);let t=c(2);return _(t.filterPreviewData(t.previewStatus.WRONG))}),m(14),r()(),n(15,"li",58)(16,"button",61),y("click",function(){g(o);let t=c(2);return _(t.filterPreviewData(t.previewStatus.UNSYNC))}),m(17),r()()()(),n(18,"div")(19,"button",62),y("click",function(){g(o);let t=c(2);return _(t.exportOrders())}),C(20,"i",63),n(21,"span"),m(22,"Export"),r()()()()(),n(23,"table",64)(24,"thead",65)(25,"tr"),C(26,"th",66),n(27,"th",67),m(28,"Number"),r(),u(29,Yn,2,1,"th",68),n(30,"th",69),m(31,"Channel Status"),r(),n(32,"th",69),m(33,"POS Status"),r(),n(34,"th"),m(35,"Action"),r(),C(36,"th",66),r()(),n(37,"tbody"),u(38,Qn,2,1,"ng-container",70)(39,ea,6,0,"ng-template",null,2,U),r()()()()}if(a&2){let o=O(40),e=c(2);p(7),d("ngClass",e.pillStatus=="all"?"btn-secondary text-white":"btn-outline-dark"),p(),T(" All (",e.allData,") "),p(2),d("ngClass",e.pillStatus=="sync"?"btn-success":"btn-outline-success"),p(),T(" Existing (",e.syncData,") "),p(2),d("ngClass",e.pillStatus=="wrong"?"btn-warning text-white":"btn-outline-warning"),p(),T(" Wrong Status (",e.wrongData,") "),p(2),d("ngClass",e.pillStatus=="unsync"?"btn-danger":"btn-outline-danger"),p(),T(" Missing (",e.unsyncData,") "),p(12),d("ngIf",(e.currentChannel==null?null:e.currentChannel.TypeID)!=e.channelType.Shopee&&(e.currentChannel==null?null:e.currentChannel.TypeID)!==e.channelType.Tiktok),p(9),d("ngIf",e.displayedPreviewData.length>0)("ngIfElse",o)}}function ia(a,l){if(a&1&&u(0,ta,41,11,"div",50),a&2){let o=c();d("ngIf",o.currentState=="preview")}}function na(a,l){a&1&&(C(0,"i",84),n(1,"span"),m(2,"Finish"),r())}function aa(a,l){if(a&1&&(n(0,"tr",86)(1,"td"),m(2),r(),n(3,"td"),m(4),r(),n(5,"td"),m(6),r(),n(7,"td"),m(8),r()()),a&2){let o=l.$implicit,e=l.index;d("ngClass",Be(5,Ln,o.Exception)),p(2),S(e+1),p(2),S(o.Number),p(2),S(o.Status),p(2),S(o.Exception)}}function ra(a,l){if(a&1&&(D(0),u(1,aa,9,7,"tr",85),E()),a&2){let o=c(3);p(),d("ngForOf",o.downloadData)}}function oa(a,l){a&1&&(n(0,"tr",79)(1,"td",80)(2,"div",81),C(3,"i",82),r(),n(4,"h4",83),m(5," There is no order to processed "),r()()())}function la(a,l){if(a&1&&(n(0,"div",51)(1,"div",52)(2,"table",64)(3,"thead",65)(4,"tr"),C(5,"th",66),n(6,"th"),m(7,"Order Number"),r(),n(8,"th"),m(9,"Status"),r(),n(10,"th"),m(11,"Exception"),r()()(),n(12,"tbody"),u(13,ra,2,1,"ng-container",70)(14,oa,6,0,"ng-template",null,3,U),r()()()()),a&2){let o=O(15),e=c(2);p(13),d("ngIf",(e.downloadData==null?null:e.downloadData.length)>0)("ngIfElse",o)}}function pa(a,l){if(a&1&&u(0,la,16,2,"div",50),a&2){let o=c();d("ngIf",o.currentState=="finish")}}function ma(a,l){a&1&&(n(0,"h6"),m(1,"1"),r())}function sa(a,l){a&1&&(n(0,"h6"),m(1,"2"),r())}function da(a,l){a&1&&(n(0,"h6"),m(1,"3"),r())}var te=function(a){return a.ALL="all",a.SYNC="sync",a.WRONG="wrong",a.UNSYNC="unsync",a}(te||{}),di=(()=>{let l=class l{constructor(e,t,i,h,f,s,q){this.http=e,this.toastr=t,this.datePipe=i,this.url=h,this.productService=f,this.orderService=s,this.authService=q,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=N,this.previewStatus=te,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=Me,this.showTimePicker=!1,this.downloadType=mt(!1),this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initTimeFilter(),this.url.queryParams.subscribe(e=>{this.channelID=e.ChannelID,this.startDate=new Date(e.Date),this.endDate=new Date(e.Date)})}initTimeFilter(){this.timeFrom="00:00",this.timeTo="23:59"}onDownload(e){let t={ID:this.channelID,From:this.startDate,To:this.endDate,ListPreview:this.downloadedPreviewData,IsDisbursement:this.downloadType()};this.http.post("/api/Orders/Download",t).subscribe(i=>{this.downloadData=i.Body,this.onStepperNext(e)})}onPreview(e){if(!this.validateDatePreview())return;let t={ID:this.channelID,From:this.startDate,To:this.endDate,IsDisbursement:this.downloadType()};this.showTimePicker&&(t=nt(it({},t),{TimeFrom:this.timeFrom+":00",TimeTo:this.timeTo+":00"})),this.http.post("/api/Orders/Preview",t).subscribe(i=>{if(i.length==0){this.toastrEmptyPreview();return}this.previewData=i,this.groupingPreviewData(),this.filterPreviewData(te.ALL),this.initLengthStatusData(),this.onStepperNext(e)})}toastrEmptyPreview(){let e=this.datePipe.transform(this.startDate,"dd MMM yyyy"),t=this.datePipe.transform(this.endDate,"dd MMM yyyy"),i=this.showTimePicker?this.timeFrom+":00":"",h=this.showTimePicker?this.timeTo+":00":"";this.toastr.info(`There is no orders from ${e} ${i} to ${t} ${h}!`,"No Orders!")}validateDatePreview(){let e=!0;return this.downloadType()==!0?M.getDaysDiff(this.startDate,this.endDate)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Failed"),e=!1):M.getDaysDiff(this.startDate,this.endDate)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Failed"),e=!1),e}onSelectChannel(){this.currentChannel=this.channelOptions.find(e=>e.ID==this.channelID),this.initGetChannelDetail()}initGetChannelDetail(){this.currentChannel.TypeID==N.Tokopedia?this.channelDetail$=this.http.post("/api/ChannelLoader/GetChannelView",{ID:this.currentChannel.ID}).pipe(j(e=>e?.Model),ye(1)):this.channelDetail$=null}setPageTitle(e){this.pageTitle=`
|
|
7
7
|
${e} (${this.getDateTitle()})
|
|
8
8
|
`}getDateTitle(){let e=M.formatTitleFromDate(new Date(this.startDate),new Date(this.endDate)),t=this.datePipe.transform(this.startDate,e),i=this.datePipe.transform(this.endDate,"dd MMM yyyy");return`${e==null?"":t+"-"} ${i}`}onNew(e){this.channelID=null,this.startDate=null,this.endDate=null,this.pageTitle="Download to POS",this.channelDetail$=null,e.reset()}groupingPreviewData(){let e=this.filterDataByStatus(te.UNSYNC),t=this.filterDataByStatus(te.WRONG),i=[];this.currentChannel.TypeID==N.Tokopedia&&(i=this.filterDataByStatus(te.SYNC)),this.downloadedPreviewData=[...i,...e,...t]}filterDataByStatus(e){let t=[];switch(e){case te.ALL:t=this.previewData;break;case te.SYNC:t=this.previewData.filter(i=>i.Action==Me.DoNothing);break;case te.WRONG:t=this.previewData.filter(i=>i.Action==Me.Update);break;case te.UNSYNC:t=this.previewData.filter(i=>i.Action==Me.New);break}return t}filterPreviewData(e){this.pillStatus=e,this.displayedPreviewData=this.filterDataByStatus(e)}initLengthStatusData(){this.wrongData=this.filterDataByStatus(te.WRONG).length,this.allData=this.previewData.length,this.syncData=this.filterDataByStatus(te.SYNC).length,this.unsyncData=this.filterDataByStatus(te.UNSYNC).length}getTypeID(){var e=this.channelOptions.find(t=>t.ID==this.channelID)?.TypeID;return e??0}onStepperChange(e){this.currentState=e.selectedStep.state}onStepperNext(e){e.selected.completed=!0,e.next()}onNext(e){switch(this.currentState){case"filter":this.onPreview(e);break;case"preview":this.onDownload(e);break}}stepChange(e){switch(e?.selectedStep?.state){case"filter":this.pageTitle="Download To POS",this.resetPreviewData();break;case"preview":let t=this.productService.findChannelById(this.channelID,this.channelOptions);this.setPageTitle(`Preview ${t?.Name}`);break;case"finish":this.setPageTitle("Download");break}}resetPreviewData(){this.displayedPreviewData=[],this.previewData=[],this.initLengthStatusData()}checkDisabledNextFilter(){let e=!M.isValidDate(this.startDate)||!M.isValidDate(this.endDate),t=M.IsEmpty(this.channelID);return e||t}exportOrders(){let e={ID:this.channelID,From:this.startDate,To:this.endDate},t=`Orders ${this.getDateTitle()}`;this.orderService.exportOrders(e,t).subscribe()}onFilterDateChange(){let e=1;this.startDate&&this.endDate&&(e=M.getDaysDiff(this.startDate,this.endDate)),this.showTimePicker=e==0}};l.\u0275fac=function(t){return new(t||l)(v(A),v(Te),v(F),v(Ge),v(Ot),v(Ee),v(Z))},l.\u0275cmp=L({type:l,selectors:[["app-download"]],features:[ct([{provide:Bt,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:12,consts:[["stepper",""],["picker",""],["EMPTY",""],["EMPTY_DOWNLOAD",""],[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["linear","",1,"w-100","stepper-download",3,"selectionChange","ngClass"],["state","filter",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","preview",3,"editable","completed"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","bg-success","text-white",3,"click","disabled"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2","bg-success","text-white",3,"click","disabled"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[1,"fa-solid","fa-filter","me-3"],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[1,"mt-8"],[3,"timeChange","time"],[1,"mx-4"],[1,"fa-solid","fa-file","me-3"],["class","row pt-2",4,"ngIf"],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"col-12","d-flex","justify-content-between","align-items-end",2,"padding-left","0px","padding-right","0px"],[1,"nav","nav-pills"],[1,"nav-item","me-3"],[1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],[1,"nav-item","mx-3"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["width","15%"],[4,"ngFor","ngForOf"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"]],template:function(t,i){if(t&1){let h=I();n(0,"mainpanel",4)(1,"actions"),u(2,Vn,6,1,"ng-container",5)(3,Fn,3,1,"ng-container",5)(4,An,4,0,"ng-container",5),r(),n(5,"content")(6,"div",6)(7,"div",7)(8,"div",8)(9,"div",9)(10,"mat-stepper",10,0),y("selectionChange",function(s){return g(h),_(i.stepChange(s))})("selectionChange",function(s){return g(h),_(i.onStepperChange(s))}),n(12,"mat-step",11),u(13,Rn,3,0,"ng-template",12)(14,Hn,27,11,"ng-template",13),r(),n(15,"mat-step",14),u(16,Un,3,0,"ng-template",12)(17,ia,1,1,"ng-template",13),r(),n(18,"mat-step",15),u(19,na,3,0,"ng-template",12)(20,pa,1,1,"ng-template",13),r(),u(21,ma,2,0,"ng-template",16)(22,sa,2,0,"ng-template",17)(23,da,2,0,"ng-template",18),r()()()()()()()}if(t&2){let h=O(11);d("headerTitle",i.pageTitle)("description",i.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),d("ngIf",i.currentState=="preview"),p(),d("ngIf",i.currentState=="filter"),p(),d("ngIf",i.currentState=="finish"),p(6),st("ngClass","last-edited-step-"+h.selectedIndex),p(2),d("editable",i.currentState!="finish")("completed",!1),p(3),d("editable",i.currentState!="finish")("completed",!1)}},dependencies:[ze,W,B,$,z,G,Y,X,gt,Vt,kt,Lt,Ft,Ht,zt,Ut,Gt,jt,ft,$e,Pt,It,ve,F],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.vertical-radio{display:flex;flex-direction:column;margin:15px 0}.mt-1rem{margin-top:1rem}.dateRange{padding-top:.8rem;padding-bottom:.8rem}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}.form-label-group.radio.download-type{height:45.5938px!important;border-radius:.375rem!important}
|
|
9
|
-
`],encapsulation:2});let a=l;return a})();var ca=[{path:"",component:Qt,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:ni,canActivate:[de],data:{title:"New Order"}},{path:"detail",component:ai,canActivate:[de],data:{title:"Orders detail"}},{path:"ready_to_ship",component:oi,canActivate:[de],data:{title:"Ready To Ship"}},{path:"Shipped",component:li,canActivate:[de],data:{title:"Shipped"}},{path:"Delivered",component:pi,canActivate:[de],data:{title:"Delivered"}},{path:"All",component:mi,canActivate:[de],data:{title:"All Order"}},{path:"Cancelled",component:si,canActivate:[de],data:{title:"Cancelled"}},{path:"Download",component:di,canActivate:[de],data:{title:"Download"}},{path:"Download_Order_Log",loadComponent:()=>import("./chunk-
|
|
9
|
+
`],encapsulation:2});let a=l;return a})();var ca=[{path:"",component:Qt,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:ni,canActivate:[de],data:{title:"New Order"}},{path:"detail",component:ai,canActivate:[de],data:{title:"Orders detail"}},{path:"ready_to_ship",component:oi,canActivate:[de],data:{title:"Ready To Ship"}},{path:"Shipped",component:li,canActivate:[de],data:{title:"Shipped"}},{path:"Delivered",component:pi,canActivate:[de],data:{title:"Delivered"}},{path:"All",component:mi,canActivate:[de],data:{title:"All Order"}},{path:"Cancelled",component:si,canActivate:[de],data:{title:"Cancelled"}},{path:"Download",component:di,canActivate:[de],data:{title:"Download"}},{path:"Download_Order_Log",loadComponent:()=>import("./chunk-EOIKKQ7X.js").then(a=>a.DownloadOrderLogComponent),canActivate:[de],data:{title:"Download Order Log"}},{path:"Download_Order_Log/Detail",loadComponent:()=>import("./chunk-AUBPDK26.js").then(a=>a.DownloadOrderDetailComponent),canActivate:[de],data:{title:"Download Order Log Detail"}}]}],ci=(()=>{let l=class l{};l.\u0275fac=function(t){return new(t||l)},l.\u0275mod=Re({type:l}),l.\u0275inj=Ae({imports:[Se,je.forChild(ca)]});let a=l;return a})();var No=(()=>{let l=class l{};l.\u0275fac=function(t){return new(t||l)},l.\u0275mod=Re({type:l}),l.\u0275inj=Ae({providers:[Ee,Ye,Je],imports:[Se,Ue,ci,Et,bt,Wt,je,_t,At,ut,Q,Yt,St,Tt,Kt,xt,Mt,vt,ee,Ke,$e,Nt]});let a=l;return a})();export{No as OrdersModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-7232476I.js";import{a as Ue}from"./chunk-LIPM3QTO.js";import{a as X}from"./chunk-XHAXYWZ7.js";import{a as Ae,b as We,c as te}from"./chunk-EXBAGUW2.js";import{a as xe}from"./chunk-BVIRHZTZ.js";import{a as $e}from"./chunk-J5DBLKIA.js";import{a as Ne}from"./chunk-7KG3DC5J.js";import{b as Re}from"./chunk-L3JD55OC.js";import{a as Le}from"./chunk-GDA72XOJ.js";import"./chunk-S66L7N22.js";import"./chunk-O4N2CCVN.js";import{a as ke}from"./chunk-OUJF6YWV.js";import"./chunk-YUBBVFFI.js";import{a as De,b as Oe,c as Ve}from"./chunk-2KEQ33LI.js";import{a as Be}from"./chunk-UX3GY5M2.js";import"./chunk-C2SGQUOH.js";import{a as ye,b as Ie,d as we,e as Fe}from"./chunk-7IIB5DLC.js";import{i as K}from"./chunk-GNWFAGYX.js";import{b as Pe,e as be}from"./chunk-KTXT25SP.js";import"./chunk-KCDL7SWP.js";import{d as Me,m as Ee,n as Te}from"./chunk-OI3SQ5ZO.js";import{t as H,u as J}from"./chunk-OE7XFNYO.js";import"./chunk-UEB6GFG5.js";import{a as Ce,b as fe,h as k,m as B,y as L}from"./chunk-JCKUKK6T.js";import{c as G,e as Se,f as ve}from"./chunk-KZ2VDCDO.js";import{Ab as se,B as Z,Bc as ge,Ec as he,Fc as N,Ha as S,Ib as Q,Ja as c,Jb as p,Ka as v,Kb as me,Lb as x,Nb as F,Ob as M,Pb as E,Q as q,Qb as j,Rb as O,Tb as V,Ub as pe,Va as le,X as ae,_a as u,ab as s,ac as y,bc as T,cc as de,da as A,db as ce,dc as ee,ga as D,hb as W,ib as R,kb as $,lb as U,mb as r,nb as l,oa as C,ob as P,pa as f,pb as I,q as oe,qb as w,sb as b,vb as g,vc as _e,xa as Y,xb as m,xc as z,yc as ue,za as re}from"./chunk-QNL3BTRG.js";import{a as ne,b as ie}from"./chunk-GNOSNGXM.js";var qe=(n,a)=>({color:n,"font-weight":a});function Ye(n,a){if(n&1&&(r(0,"mat-radio-button",2),p(1),l()),n&2){let i=a.$implicit,o=a.index,e=m();ce(pe(7,qe,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),c(),x("",i.Value," ")}}var Ge=(()=>{let a=class a{constructor(){this.disabled=!1,this.modelChange=new re,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(o){this.modelChange.emit(o)}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[O],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(e,t){e&1&&(r(0,"mat-radio-group",0),g("ngModelChange",function(_){return t.change(_)}),u(1,Ye,2,10,"mat-radio-button",1),l()),e&2&&(s("disabled",t.disabled)("ngModel",t.model),c(),s("ngForOf",t.options))},dependencies:[N,z,Ve,De,Oe,L,k,B,J,H],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]});let n=a;return n})();function Qe(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l()),n&2){let i=a.item;c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," ")}}function et(n,a){if(n&1){let i=b();r(0,"span",6),g("click",function(){C(i);let e=m(),t=e.item,d=e.clear;return f(d(t))}),p(1,"x"),l()}}function tt(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l(),u(4,et,2,0,"span",5)),n&2){let i=a.item,o=m();c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," "),c(),W(o.clearable()?4:-1)}}var Ke=(()=>{let a=class a{constructor(){this.authService=A(K),this.multiple=Y(!1),this.clearable=Y(!0),this.options=this.authService.getChannels(),this.onChange=o=>{}}onChannelChange(o){this.onChange(o)}writeValue(o){this.selectedChannels=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},standalone:!0,features:[j([{provide:Ce,multi:!0,useExisting:a}]),O],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(e,t){e&1&&(r(0,"ng-select",0),E("ngModelChange",function(_){return M(t.selectedChannels,_)||(t.selectedChannels=_),_}),g("ngModelChange",function(_){return t.onChannelChange(_)}),u(1,Qe,4,2,"ng-template",1)(2,tt,5,3,"ng-template",2),l()),e&2&&(s("clearable",t.clearable())("items",t.options),F("ngModel",t.selectedChannels),s("multiple",t.multiple()))},dependencies:[N,Fe,we,ye,Ie,L,k,B]});let n=a;return n})();var He=n=>[n],nt=n=>({"text-decoration-line-through":n}),it=n=>({"border-bottom":n}),ot=n=>({"bg-gradient-warning":n});function at(n,a){if(n&1){let i=b();I(0),r(1,"div")(2,"label",21),p(3,"Channel"),l(),r(4,"channel-select-options",22),E("ngModelChange",function(e){C(i);let t=m();return M(t.searchFilter.ListChannelID,e)||(t.searchFilter.ListChannelID=e),f(e)}),l()(),r(5,"div",23)(6,"label",24),p(7,"Filter by"),l(),r(8,"lib-radio-options",25),E("modelChange",function(e){C(i);let t=m();return M(t.searchFilter.filterModel,e)||(t.searchFilter.filterModel=e),f(e)}),l()(),w()}if(n&2){let i=m();c(4),s("multiple",!0),F("ngModel",i.searchFilter.ListChannelID),c(4),F("model",i.searchFilter.filterModel),s("options",i.filterTypeOptions)}}function rt(n,a){if(n&1){let i=b();r(0,"button",27),g("click",function(){C(i);let e=m().ngIf,t=m();return f(t.onUpdateItems(e))}),P(1,"i",28),p(2," Update "),l()}}function lt(n,a){if(n&1&&(I(0),r(1,"div",4),u(2,rt,3,0,"button",26),l(),w()),n&2){let i=a.ngIf,o=m();c(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function ct(n,a){if(n&1&&(r(0,"th",15)(1,"div",29),P(2,"img",30),r(3,"div",31),p(4),y(5,"stringLimit"),l()()()),n&2){let i=a.$implicit;c(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),c(),s("src",i==null?null:i.Img,S),c(2),x(" ",de(5,3,i.Name,20)," ")}}function st(n,a){if(n&1){let i=b();r(0,"th")(1,"input",32),E("ngModelChange",function(e){C(i);let t=m();return M(t.checkboxState,e)||(t.checkboxState=e),f(e)}),g("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),l()()}if(n&2){let i=m();c(),F("ngModel",i.checkboxState)}}function mt(n,a){n&1&&(r(0,"th",33)(1,"span"),p(2,"Expected"),l(),r(3,"span",34),p(4,"(POS)"),l()(),r(5,"th",33),p(6,"Channel"),l())}function pt(n,a){if(n&1){let i=b();r(0,"img",47),g("click",function(e){C(i);let t=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,t==null?null:t.ImageUrl))}),l()}if(n&2){let i=m(3).$implicit;se("src",i==null?null:i.ImageUrl,S)}}function dt(n,a){n&1&&P(0,"img",48)}function _t(n,a){if(n&1&&(r(0,"small",46),p(1),l()),n&2){let i=m(3).$implicit;c(),x("(",i==null?null:i.Category,")")}}function ut(n,a){if(n&1&&(I(0),r(1,"td",42),u(2,pt,1,1,"img",43)(3,dt,1,0,"ng-template",null,0,ee),l(),r(5,"td",44)(6,"h5",45),p(7),l(),u(8,_t,2,1,"small",46),l(),w()),n&2){let i=Q(4),o=m().$index,e=m().$implicit,t=m().ngIf;c(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",V(7,it,o+1==t.length)),c(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),c(3),s("rowSpan",e==null?null:e.Variants.length),c(2),me(e==null?null:e.Name),c(),W(e!=null&&e.Category?8:-1)}}function gt(n,a){if(n&1){let i=b();r(0,"td",49)(1,"input",32),E("ngModelChange",function(e){C(i);let t=m().$implicit;return M(t.selected,e)||(t.selected=e),f(e)}),l()()}if(n&2){let i=m().$implicit;c(),F("ngModel",i.selected)}}function ht(n,a){if(n&1){let i=b();I(0),r(1,"td",51),p(2),y(3,"number"),l(),r(4,"td",52),g("click",function(){let e=C(i).$implicit,t=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(t,d,e))}),r(5,"div",53)(6,"div",54),p(7),y(8,"number"),l(),r(9,"a",55),g("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),P(10,"i",40),l()()(),w()}if(n&2){let i=a.$implicit;c(2),x(" ",T(3,4,i.PriceExpected)," "),c(2),s("ngClass",V(8,ot,i.Price!=i.PriceExpected)),c(3),x(" ",T(8,6,i.Price)," "),c(2),s("href",i.Url,S)}}function Ct(n,a){n&1&&(r(0,"td",56),p(1," X "),l(),r(2,"td",56),p(3," X "),l())}function ft(n,a){if(n&1&&(I(0),u(1,ht,11,10,"ng-container",50)(2,Ct,4,0,"ng-template",null,1,ee),w()),n&2){let i=a.$implicit,o=Q(3),e=m().$implicit,t=m(3);c(),s("ngIf",t.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function xt(n,a){if(n&1&&(r(0,"tr"),u(1,ut,9,9,"ng-container",3),r(2,"td",35),p(3),l(),r(4,"td",36)(5,"div",37)(6,"div",38),p(7),l(),r(8,"div",31)(9,"a",39),P(10,"i",40),l()()()(),u(11,gt,2,1,"ng-template",19)(12,ft,4,2,"ng-container",41),l()),n&2){let i=a.$implicit,o=a.$index,e=m(3);c(),s("ngIf",o==0),c(2),x(" ",i==null?null:i.Model," "),c(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),c(2),s("ngClass",V(8,nt,i.Discontinued)),c(),x(" ",i==null?null:i.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),S),c(2),s("ngxPermissionsOnly",V(10,He,e.rolePriceEdit)),c(),s("ngForOf",e.channels())}}function Pt(n,a){if(n&1&&(r(0,"tbody"),$(1,xt,13,12,"tr",null,R),l()),n&2){let i=a.$implicit;c(),U(i.Variants)}}function bt(n,a){if(n&1&&(I(0),$(1,Pt,3,0,"tbody",null,R),w()),n&2){let i=a.ngIf;c(),U(i)}}var xn=(()=>{let a=class a{constructor(o,e,t,d,_,h,Je){this.http=o,this.toastr=e,this.dialog=t,this.productService=d,this.authService=_,this.biggerPictureService=h,this.paginationService=Je,this.infinitePagination=A(te),this.searchFilter=new Ne,this.checkboxState=!1,this.rolePriceEdit=xe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=le([]),this.filterTypeOptions=[{Key:X.ALL,Value:"All"},{Key:X.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let o=this.searchFilter.ListChannelID,e=[];G.IsEmpty(o)||o?.length==0?e=this.channelOptions:e=this.channelOptions.filter(t=>o.findIndex(d=>d==t.ID)>-1),this.channels.update(()=>e)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(q(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(ae(o=>{this.searchFilter=o.Filter,this.searchFilter.filterModel=X.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),q(1))}onSelectAllData(){this.data$=this.data$.pipe(oe(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(t=>(t.selected=this.checkboxState,t))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e=ie(ne({},this.searchFilter),{text:o,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let t=e.map(h=>h.ID),_={ListChannelID:this.channelOptions.filter(h=>h.selected).map(h=>h.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:h=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:h=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(t=>t.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Ue,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(Z(t=>G.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(o)})}openTableDialog(o,e,t){let d=JSON.parse(JSON.stringify(o));this.dialog.open(Ae,{data:{Name:e.Name,Variant:d,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(Z(h=>G.IsNotEmpty(h))).subscribe(h=>{this.updateProductPrice(h,t)})}updateProductPrice(o,e){let t={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(d=>{e.Price=t.Price;let _=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Re,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};a.\u0275fac=function(e){return new(e||a)(v(be),v(Pe),v(Me),v(ke),v(K),v(Be),v($e))},a.\u0275cmp=D({type:a,selectors:[["app-custom-channel-price"]],standalone:!0,features:[j([te]),O],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(e,t){e&1&&(r(0,"mainpanel",2),g("onSubmit",function(_){return t.onFilter(_)}),r(1,"filters"),u(2,at,9,4,"ng-container",3),y(3,"async"),l(),r(4,"actions")(5,"div",4),u(6,lt,3,1,"ng-container",3),y(7,"async"),r(8,"button",5),g("click",function(){return t.openExportDialog()}),P(9,"i",6),r(10,"span"),p(11,"Export"),l()()()(),r(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),P(20,"th",14),$(21,ct,6,6,"th",15,R),l(),r(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),l()(),r(27,"th",17),p(28,"Variant"),l(),r(29,"th",18),p(30,"SKU"),l(),u(31,st,2,1,"ng-template",19),$(32,mt,7,0,null,null,R),l()(),u(34,bt,3,0,"ng-container",3),y(35,"async"),l(),r(36,"infinite-paginator",20),y(37,"async"),g("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),l()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),c(2),s("ngIf",T(3,13,t.loader$)),c(4),s("ngIf",T(7,15,t.data$)),c(15),U(t.channels()),c(10),s("ngxPermissionsOnly",V(21,He,t.rolePriceEdit)),c(),U(t.channels()),c(2),s("ngIf",T(35,17,t.data$)),c(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",T(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[N,_e,z,ue,ge,he,Te,Ee,L,fe,k,B,We,Ge,J,H,Le,ve,Se,Ke],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let n=a;return n})();export{xn as CustomChannelPriceComponent};
|
|
1
|
+
import"./chunk-RATKMB5I.js";import{a as Ue}from"./chunk-LIPM3QTO.js";import{a as X}from"./chunk-XHAXYWZ7.js";import{a as Ae,b as We,c as te}from"./chunk-EXBAGUW2.js";import{a as xe}from"./chunk-BVIRHZTZ.js";import{a as $e}from"./chunk-J5DBLKIA.js";import{a as Ne}from"./chunk-7KG3DC5J.js";import{b as Re}from"./chunk-L3JD55OC.js";import{a as Le}from"./chunk-GDA72XOJ.js";import"./chunk-S66L7N22.js";import"./chunk-O4N2CCVN.js";import{a as ke}from"./chunk-OUJF6YWV.js";import"./chunk-YUBBVFFI.js";import{a as De,b as Oe,c as Ve}from"./chunk-2KEQ33LI.js";import{a as Be}from"./chunk-UX3GY5M2.js";import"./chunk-C2SGQUOH.js";import{a as ye,b as Ie,d as we,e as Fe}from"./chunk-7IIB5DLC.js";import{i as K}from"./chunk-ES4U2NNX.js";import{b as Pe,e as be}from"./chunk-KTXT25SP.js";import"./chunk-KCDL7SWP.js";import{d as Me,m as Ee,n as Te}from"./chunk-OI3SQ5ZO.js";import{t as H,u as J}from"./chunk-OE7XFNYO.js";import"./chunk-UEB6GFG5.js";import{a as Ce,b as fe,h as k,m as B,y as L}from"./chunk-JCKUKK6T.js";import{c as G,e as Se,f as ve}from"./chunk-KZ2VDCDO.js";import{Ab as se,B as Z,Bc as ge,Ec as he,Fc as N,Ha as S,Ib as Q,Ja as c,Jb as p,Ka as v,Kb as me,Lb as x,Nb as F,Ob as M,Pb as E,Q as q,Qb as j,Rb as O,Tb as V,Ub as pe,Va as le,X as ae,_a as u,ab as s,ac as y,bc as T,cc as de,da as A,db as ce,dc as ee,ga as D,hb as W,ib as R,kb as $,lb as U,mb as r,nb as l,oa as C,ob as P,pa as f,pb as I,q as oe,qb as w,sb as b,vb as g,vc as _e,xa as Y,xb as m,xc as z,yc as ue,za as re}from"./chunk-QNL3BTRG.js";import{a as ne,b as ie}from"./chunk-GNOSNGXM.js";var qe=(n,a)=>({color:n,"font-weight":a});function Ye(n,a){if(n&1&&(r(0,"mat-radio-button",2),p(1),l()),n&2){let i=a.$implicit,o=a.index,e=m();ce(pe(7,qe,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),c(),x("",i.Value," ")}}var Ge=(()=>{let a=class a{constructor(){this.disabled=!1,this.modelChange=new re,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(o){this.modelChange.emit(o)}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[O],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(e,t){e&1&&(r(0,"mat-radio-group",0),g("ngModelChange",function(_){return t.change(_)}),u(1,Ye,2,10,"mat-radio-button",1),l()),e&2&&(s("disabled",t.disabled)("ngModel",t.model),c(),s("ngForOf",t.options))},dependencies:[N,z,Ve,De,Oe,L,k,B,J,H],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]});let n=a;return n})();function Qe(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l()),n&2){let i=a.item;c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," ")}}function et(n,a){if(n&1){let i=b();r(0,"span",6),g("click",function(){C(i);let e=m(),t=e.item,d=e.clear;return f(d(t))}),p(1,"x"),l()}}function tt(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l(),u(4,et,2,0,"span",5)),n&2){let i=a.item,o=m();c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," "),c(),W(o.clearable()?4:-1)}}var Ke=(()=>{let a=class a{constructor(){this.authService=A(K),this.multiple=Y(!1),this.clearable=Y(!0),this.options=this.authService.getChannels(),this.onChange=o=>{}}onChannelChange(o){this.onChange(o)}writeValue(o){this.selectedChannels=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},standalone:!0,features:[j([{provide:Ce,multi:!0,useExisting:a}]),O],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(e,t){e&1&&(r(0,"ng-select",0),E("ngModelChange",function(_){return M(t.selectedChannels,_)||(t.selectedChannels=_),_}),g("ngModelChange",function(_){return t.onChannelChange(_)}),u(1,Qe,4,2,"ng-template",1)(2,tt,5,3,"ng-template",2),l()),e&2&&(s("clearable",t.clearable())("items",t.options),F("ngModel",t.selectedChannels),s("multiple",t.multiple()))},dependencies:[N,Fe,we,ye,Ie,L,k,B]});let n=a;return n})();var He=n=>[n],nt=n=>({"text-decoration-line-through":n}),it=n=>({"border-bottom":n}),ot=n=>({"bg-gradient-warning":n});function at(n,a){if(n&1){let i=b();I(0),r(1,"div")(2,"label",21),p(3,"Channel"),l(),r(4,"channel-select-options",22),E("ngModelChange",function(e){C(i);let t=m();return M(t.searchFilter.ListChannelID,e)||(t.searchFilter.ListChannelID=e),f(e)}),l()(),r(5,"div",23)(6,"label",24),p(7,"Filter by"),l(),r(8,"lib-radio-options",25),E("modelChange",function(e){C(i);let t=m();return M(t.searchFilter.filterModel,e)||(t.searchFilter.filterModel=e),f(e)}),l()(),w()}if(n&2){let i=m();c(4),s("multiple",!0),F("ngModel",i.searchFilter.ListChannelID),c(4),F("model",i.searchFilter.filterModel),s("options",i.filterTypeOptions)}}function rt(n,a){if(n&1){let i=b();r(0,"button",27),g("click",function(){C(i);let e=m().ngIf,t=m();return f(t.onUpdateItems(e))}),P(1,"i",28),p(2," Update "),l()}}function lt(n,a){if(n&1&&(I(0),r(1,"div",4),u(2,rt,3,0,"button",26),l(),w()),n&2){let i=a.ngIf,o=m();c(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function ct(n,a){if(n&1&&(r(0,"th",15)(1,"div",29),P(2,"img",30),r(3,"div",31),p(4),y(5,"stringLimit"),l()()()),n&2){let i=a.$implicit;c(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),c(),s("src",i==null?null:i.Img,S),c(2),x(" ",de(5,3,i.Name,20)," ")}}function st(n,a){if(n&1){let i=b();r(0,"th")(1,"input",32),E("ngModelChange",function(e){C(i);let t=m();return M(t.checkboxState,e)||(t.checkboxState=e),f(e)}),g("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),l()()}if(n&2){let i=m();c(),F("ngModel",i.checkboxState)}}function mt(n,a){n&1&&(r(0,"th",33)(1,"span"),p(2,"Expected"),l(),r(3,"span",34),p(4,"(POS)"),l()(),r(5,"th",33),p(6,"Channel"),l())}function pt(n,a){if(n&1){let i=b();r(0,"img",47),g("click",function(e){C(i);let t=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,t==null?null:t.ImageUrl))}),l()}if(n&2){let i=m(3).$implicit;se("src",i==null?null:i.ImageUrl,S)}}function dt(n,a){n&1&&P(0,"img",48)}function _t(n,a){if(n&1&&(r(0,"small",46),p(1),l()),n&2){let i=m(3).$implicit;c(),x("(",i==null?null:i.Category,")")}}function ut(n,a){if(n&1&&(I(0),r(1,"td",42),u(2,pt,1,1,"img",43)(3,dt,1,0,"ng-template",null,0,ee),l(),r(5,"td",44)(6,"h5",45),p(7),l(),u(8,_t,2,1,"small",46),l(),w()),n&2){let i=Q(4),o=m().$index,e=m().$implicit,t=m().ngIf;c(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",V(7,it,o+1==t.length)),c(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),c(3),s("rowSpan",e==null?null:e.Variants.length),c(2),me(e==null?null:e.Name),c(),W(e!=null&&e.Category?8:-1)}}function gt(n,a){if(n&1){let i=b();r(0,"td",49)(1,"input",32),E("ngModelChange",function(e){C(i);let t=m().$implicit;return M(t.selected,e)||(t.selected=e),f(e)}),l()()}if(n&2){let i=m().$implicit;c(),F("ngModel",i.selected)}}function ht(n,a){if(n&1){let i=b();I(0),r(1,"td",51),p(2),y(3,"number"),l(),r(4,"td",52),g("click",function(){let e=C(i).$implicit,t=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(t,d,e))}),r(5,"div",53)(6,"div",54),p(7),y(8,"number"),l(),r(9,"a",55),g("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),P(10,"i",40),l()()(),w()}if(n&2){let i=a.$implicit;c(2),x(" ",T(3,4,i.PriceExpected)," "),c(2),s("ngClass",V(8,ot,i.Price!=i.PriceExpected)),c(3),x(" ",T(8,6,i.Price)," "),c(2),s("href",i.Url,S)}}function Ct(n,a){n&1&&(r(0,"td",56),p(1," X "),l(),r(2,"td",56),p(3," X "),l())}function ft(n,a){if(n&1&&(I(0),u(1,ht,11,10,"ng-container",50)(2,Ct,4,0,"ng-template",null,1,ee),w()),n&2){let i=a.$implicit,o=Q(3),e=m().$implicit,t=m(3);c(),s("ngIf",t.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function xt(n,a){if(n&1&&(r(0,"tr"),u(1,ut,9,9,"ng-container",3),r(2,"td",35),p(3),l(),r(4,"td",36)(5,"div",37)(6,"div",38),p(7),l(),r(8,"div",31)(9,"a",39),P(10,"i",40),l()()()(),u(11,gt,2,1,"ng-template",19)(12,ft,4,2,"ng-container",41),l()),n&2){let i=a.$implicit,o=a.$index,e=m(3);c(),s("ngIf",o==0),c(2),x(" ",i==null?null:i.Model," "),c(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),c(2),s("ngClass",V(8,nt,i.Discontinued)),c(),x(" ",i==null?null:i.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),S),c(2),s("ngxPermissionsOnly",V(10,He,e.rolePriceEdit)),c(),s("ngForOf",e.channels())}}function Pt(n,a){if(n&1&&(r(0,"tbody"),$(1,xt,13,12,"tr",null,R),l()),n&2){let i=a.$implicit;c(),U(i.Variants)}}function bt(n,a){if(n&1&&(I(0),$(1,Pt,3,0,"tbody",null,R),w()),n&2){let i=a.ngIf;c(),U(i)}}var xn=(()=>{let a=class a{constructor(o,e,t,d,_,h,Je){this.http=o,this.toastr=e,this.dialog=t,this.productService=d,this.authService=_,this.biggerPictureService=h,this.paginationService=Je,this.infinitePagination=A(te),this.searchFilter=new Ne,this.checkboxState=!1,this.rolePriceEdit=xe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=le([]),this.filterTypeOptions=[{Key:X.ALL,Value:"All"},{Key:X.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let o=this.searchFilter.ListChannelID,e=[];G.IsEmpty(o)||o?.length==0?e=this.channelOptions:e=this.channelOptions.filter(t=>o.findIndex(d=>d==t.ID)>-1),this.channels.update(()=>e)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(q(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(ae(o=>{this.searchFilter=o.Filter,this.searchFilter.filterModel=X.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),q(1))}onSelectAllData(){this.data$=this.data$.pipe(oe(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(t=>(t.selected=this.checkboxState,t))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e=ie(ne({},this.searchFilter),{text:o,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let t=e.map(h=>h.ID),_={ListChannelID:this.channelOptions.filter(h=>h.selected).map(h=>h.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:h=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:h=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(t=>t.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Ue,{data:{selectedItems:e,channels:this.channelOptions},width:"600px"}).afterClosed().pipe(Z(t=>G.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(o)})}openTableDialog(o,e,t){let d=JSON.parse(JSON.stringify(o));this.dialog.open(Ae,{data:{Name:e.Name,Variant:d,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(Z(h=>G.IsNotEmpty(h))).subscribe(h=>{this.updateProductPrice(h,t)})}updateProductPrice(o,e){let t={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(d=>{e.Price=t.Price;let _=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Re,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};a.\u0275fac=function(e){return new(e||a)(v(be),v(Pe),v(Me),v(ke),v(K),v(Be),v($e))},a.\u0275cmp=D({type:a,selectors:[["app-custom-channel-price"]],standalone:!0,features:[j([te]),O],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(e,t){e&1&&(r(0,"mainpanel",2),g("onSubmit",function(_){return t.onFilter(_)}),r(1,"filters"),u(2,at,9,4,"ng-container",3),y(3,"async"),l(),r(4,"actions")(5,"div",4),u(6,lt,3,1,"ng-container",3),y(7,"async"),r(8,"button",5),g("click",function(){return t.openExportDialog()}),P(9,"i",6),r(10,"span"),p(11,"Export"),l()()()(),r(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),P(20,"th",14),$(21,ct,6,6,"th",15,R),l(),r(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),l()(),r(27,"th",17),p(28,"Variant"),l(),r(29,"th",18),p(30,"SKU"),l(),u(31,st,2,1,"ng-template",19),$(32,mt,7,0,null,null,R),l()(),u(34,bt,3,0,"ng-container",3),y(35,"async"),l(),r(36,"infinite-paginator",20),y(37,"async"),g("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),l()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),c(2),s("ngIf",T(3,13,t.loader$)),c(4),s("ngIf",T(7,15,t.data$)),c(15),U(t.channels()),c(10),s("ngxPermissionsOnly",V(21,He,t.rolePriceEdit)),c(),U(t.channels()),c(2),s("ngIf",T(35,17,t.data$)),c(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",T(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[N,_e,z,ue,ge,he,Te,Ee,L,fe,k,B,We,Ge,J,H,Le,ve,Se,Ke],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let n=a;return n})();export{xn as CustomChannelPriceComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as Ve}from"./chunk-KJ4SL5OX.js";import"./chunk-ZSZQPMV2.js";import{a as L}from"./chunk-NLZCSTVO.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Pe,b as De,c as G}from"./chunk-EXBAGUW2.js";import"./chunk-BVIRHZTZ.js";import{b as Me}from"./chunk-L3JD55OC.js";import{a as Ee}from"./chunk-GDA72XOJ.js";import{a as Te,b as Fe}from"./chunk-S66L7N22.js";import"./chunk-LZVUS3GC.js";import"./chunk-DSKMV7XY.js";import"./chunk-633RG6PO.js";import{a as we}from"./chunk-OUJF6YWV.js";import"./chunk-YUBBVFFI.js";import{a as be}from"./chunk-UX3GY5M2.js";import"./chunk-C2SGQUOH.js";import{e as ge}from"./chunk-7IIB5DLC.js";import{i as Ce}from"./chunk-GNWFAGYX.js";import{b as de,e as ue}from"./chunk-KTXT25SP.js";import"./chunk-KCDL7SWP.js";import{d as Se,l as ye,m as ve,n as Ie}from"./chunk-OI3SQ5ZO.js";import{t as fe,u as xe}from"./chunk-OE7XFNYO.js";import"./chunk-UEB6GFG5.js";import{b as re,c as se,h as pe,m as ce,o as me,y as _e}from"./chunk-JCKUKK6T.js";import{c as v,f as he}from"./chunk-KZ2VDCDO.js";import{Ab as q,B as Y,Bc as ie,Cc as oe,Ec as ae,Fc as le,Ha as P,Ib as Q,Ja as s,Jb as c,Ka as w,Kb as k,Lb as M,Nb as b,Ob as T,Pb as F,Q as A,Qb as X,Rb as J,Tb as R,Va as O,X as W,_a as u,ab as m,ac as h,bc as x,cc as N,da as K,dc as z,ga as Z,hb as I,ib as U,kb as $,lb as j,mb as a,nb as r,oa as _,ob as S,pa as d,pb as D,qb as V,sb as y,vb as f,vc as ee,xb as l,xc as te,yc as ne}from"./chunk-QNL3BTRG.js";import{a as B}from"./chunk-GNOSNGXM.js";var Ne=o=>({"text-decoration-line-through":o}),Le=o=>({"ms-10":o}),Be=o=>({"bg-gradient-warning":o});function Ae(o,p){if(o&1){let e=y();a(0,"button",38),f("click",function(){_(e);let t=l().ngIf,i=l(2);return d(i.updateStock(t))}),S(1,"i",39),c(2," Update "),r()}}function We(o,p){if(o&1){let e=y();a(0,"div"),u(1,Ae,3,0,"button",35),a(2,"button",36),f("click",function(){_(e);let t=l(2);return d(t.openExportDialog())}),S(3,"i",37),a(4,"span"),c(5,"Export"),r()()()}if(o&2){let e=p.ngIf,n=l(2);s(),m("ngIf",n.productService.hasSelectionVariant(e))}}function Oe(o,p){o&1&&(a(0,"div",40)(1,"span"),c(2," showing only different stock, please press next to populate more data "),r()())}function Ue(o,p){if(o&1){let e=y();a(0,"th")(1,"input",41),F("ngModelChange",function(t){_(e);let i=l(2);return T(i.checkboxState,t)||(i.checkboxState=t),d(t)}),f("ngModelChange",function(){let t=_(e).ngIf,i=l(2);return d(i.onCheckboxStateChange(t))}),r()()}if(o&2){let e=l(2);s(),b("ngModel",e.checkboxState)}}function $e(o,p){o&1&&(a(0,"th",32),c(1," Reserved "),r())}function je(o,p){}function Qe(o,p){if(o&1){let e=y();a(0,"input",60),F("ngModelChange",function(t){_(e);let i=l(3).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),f("ngModelChange",function(){_(e);let t=l(3).$implicit,i=l(2);return d(i.onCheckboxStateProduct(t))}),r()}if(o&2){let e=l(3).$implicit;b("ngModel",e.selected)}}function ze(o,p){if(o&1){let e=y();a(0,"img",61),f("click",function(t){_(e);let i=l(3).$implicit,C=l(2);return d(C.onZoomImage(t,i==null?null:i.ImageUrl))}),r()}if(o&2){let e=l(3).$implicit;q("src",e==null?null:e.ThumbnailUrl,P)}}function Ge(o,p){o&1&&S(0,"img",57)}function He(o,p){if(o&1&&(S(0,"br"),a(1,"div",62),S(2,"i",63),a(3,"small"),c(4),r()()),o&2){let e=l(3).$implicit;s(4),M("(",e==null?null:e.Category,")")}}function Ye(o,p){if(o&1&&(a(0,"td",53)(1,"div",14),u(2,Qe,1,1,"input",54),a(3,"div",55),u(4,ze,1,1,"img",56)(5,Ge,1,0,"img",57),r()()(),a(6,"td",58)(7,"span",59),c(8),r(),u(9,He,5,1),r()),o&2){let e=l(2).$implicit,n=l(2);m("rowSpan",e==null?null:e.Variants.length),s(2),I(e.Variants.length>1?2:-1),s(),m("ngClass",R(7,Le,e.Variants.length<=1)),s(),I(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),k(e==null?null:e.Name),s(),I(e.CategoryID!==null&&e.CategoryID!=n.guidEmpty?9:-1)}}function Ke(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l(2).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l(2).$implicit;b("ngModel",e.selected)}}function Ze(o,p){if(o&1&&u(0,Ke,1,1,"input",47),o&2){let e=l().$implicit;I((e==null?null:e.Inventory)<=1e5?0:-1)}}function qe(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l().$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l().$implicit;b("ngModel",e.selected)}}function Xe(o,p){o&1&&(a(0,"div",64),c(1," Not Found "),r())}function Je(o,p){if(o&1&&(a(0,"div")(1,"span",65),c(2),h(3,"number"),r(),c(4," => "),a(5,"span",66),c(6),h(7,"number"),r()()),o&2){let e=l().$implicit;s(2),M(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),k(x(7,4,e==null?null:e.Inventory))}}function et(o,p){if(o&1&&(c(0),h(1,"number")),o&2){let e=l().$implicit;M(" ",x(1,1,e==null?null:e.Inventory)," ")}}function tt(o,p){if(o&1&&(D(0),a(1,"div",67)(2,"a",68),S(3,"i",69),r()(),V()),o&2){let e=l().$implicit,n=l(3);s(2),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),P)}}function nt(o,p){if(o&1){let e=y();a(0,"span",74),f("click",function(){let t=_(e).ngIf,i=l(2).$implicit,C=l().$implicit,g=l(2);return d(g.openTableDialog(C,i,t))}),c(1),h(2,"number"),r()}if(o&2){let e=l(2).$implicit;s(),M(" ",x(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function it(o,p){if(o&1){let e=y();a(0,"td",70)(1,"div",48)(2,"div"),u(3,nt,3,3,"span",71),h(4,"async"),r(),a(5,"div",67)(6,"a",68),S(7,"i",69),r()(),a(8,"div",67)(9,"span",72),f("click",function(){_(e);let t=l().$implicit,i=l(3);return d(i.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),S(10,"i",73),r()()()()}if(o&2){let e=l().$implicit,n=l(3);m("ngClass",R(5,Be,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",x(4,3,n.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,P)}}function ot(o,p){if(o&1&&(D(0),a(1,"span",75),c(2),h(3,"number"),r(),V()),o&2){let e=l(2).$implicit;s(2),M(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function at(o,p){o&1&&c(0," - ")}function lt(o,p){if(o&1&&(D(0),a(1,"td",44),u(2,ot,4,3,"ng-container",52)(3,at,1,0,"ng-template",null,1,z),r(),V()),o&2){let e=Q(4),n=l().$implicit;s(2),m("ngIf",n==null||n.Channel[0]==null?null:n.Channel[0].InventoryReserved)("ngIfElse",e)}}function rt(o,p){o&1&&(D(0),c(1," - "),V())}function st(o,p){if(o&1&&(a(0,"span",76),h(1,"date"),c(2),h(3,"date"),r()),o&2){let e=l().$implicit;m("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),M(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function pt(o,p){if(o&1&&(a(0,"tr"),u(1,Ye,10,9),a(2,"td",43),c(3),r(),a(4,"td",44)(5,"span",45),c(6),r()(),a(7,"td",46),u(8,Ze,1,1)(9,qe,1,1,"input",47),r(),a(10,"td")(11,"div",48),u(12,Xe,2,0,"div",49)(13,Je,8,6,"div")(14,et,2,3)(15,tt,4,1,"ng-container",5),r()(),u(16,it,11,7,"td",50)(17,lt,5,2,"ng-container",5),a(18,"td",51),u(19,rt,2,0,"ng-container",52)(20,st,4,8,"ng-template",null,0,z),r()()),o&2){let e=p.$implicit,n=p.index,t=Q(21),i=l(3);s(),I(n==0?1:-1),s(2),k(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",R(14,Ne,e.Discontinued)),s(),k(e==null?null:e.Code),s(2),I((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),m("ngIf",(e==null?null:e.I)==null),s(),I((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),I((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",t)}}function ct(o,p){if(o&1&&(a(0,"tbody"),$(1,je,0,0,null,null,U),u(3,pt,22,16,"tr",42),r()),o&2){let e=p.$implicit;s(),j(e.Variants),s(2),m("ngForOf",e.Variants)}}function mt(o,p){if(o&1){let e=y();a(0,"mainpanel",3),f("onSubmit",function(t){_(e);let i=l();return d(i.onSearch(t))}),a(1,"actions")(2,"div",4),u(3,We,6,1,"div",5),h(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),f("onChannelChange",function(t){_(e);let i=l();return d(i.onChannelChange(t))}),r()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),r(),a(13,"input",10),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),d(t)}),r()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),r(),a(17,"input",12),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),d(t)}),r()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityFrom,t)||(i.searchFilter.QuantityFrom=t),d(t)}),r(),c(23," - "),a(24,"input",16),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityTo,t)||(i.searchFilter.QuantityTo=t),d(t)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),u(29,Oe,3,0,"div",20),a(30,"table",21)(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),S(35,"br"),a(36,"mat-slide-toggle",24),f("toggleChange",function(){_(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,d(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),r()()(),a(39,"th",25),c(40,"Variant"),r(),a(41,"th",26),c(42,"SKU"),r(),u(43,Ue,2,1,"th",5),h(44,"async"),a(45,"th",27),c(46,"POS"),r(),a(47,"th",28)(48,"div",29),f("click",function(){_(e);let t=l();return d(t.openModalFilter())}),S(49,"img",30),a(50,"span",31),c(51),h(52,"stringLimit"),r()()(),u(53,$e,2,0,"th",32),a(54,"th",33),c(55,"Last Sync"),r()()(),$(56,ct,4,1,"tbody",null,U),h(58,"async"),r(),a(59,"infinite-paginator",34),h(60,"async"),f("onNextPage",function(){_(e);let t=l();return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=l();return d(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=l();return d(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(o&2){let e,n,t,i=l();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",x(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),b("ngModel",i.searchFilter.PageNumber),s(4),b("ngModel",i.searchFilter.RowCount),s(5),b("ngModel",i.searchFilter.QuantityFrom),s(2),b("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngIf",x(44,23,i.products$)),s(5),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(n=i.channelIdentity())==null?null:n.img,P),s(2),M(" ",N(52,25,(t=i.channelIdentity())==null?null:t.label,13)," "),s(2),I(i.isShowReservedColumn?53:-1),s(3),j(x(58,28,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",x(60,30,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var Kt=(()=>{let p=class p{constructor(n,t,i,C,g,E,ke,Re){this.http=n,this.toastr=t,this.dialog=i,this.productService=C,this.authService=g,this.biggerPictureService=E,this.inventoryService=ke,this.mainPanelService=Re,this.infinitePagination=K(G),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="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.selectedChannel=O(null),this.channelIdentity=O({img:null,label:null}),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.infinitePagination.data$.pipe(W(n=>{this.checkShowReservedColumn(n)}),A())}checkShowReservedColumn(n){let t=0,i;n.forEach(C=>{i=C.Variants.find(g=>v.IsNotEmpty(g?.Channel[0]?.InventoryReserved)),i&&(t+=1)}),this.isShowReservedColumn=t>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(A(1),W(n=>{this.searchFilter={RowCount:n.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:n.Filter.ChannelID,LocationID:n.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!n.Filter.IsMarketplaceAppActive)}))}onChannelChange(n){let t=Object.assign({},n);this.selectedChannel.set(t),v.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let n=Object.assign({},this.selectedChannel());v.IsNotEmpty(n.parent)?(this.searchFilter.LocationID=n.id,this.searchFilter.ChannelID=n?.parent?.id,n.label=n?.parent?.label+" - "+n?.label,n.img=v.getChannelLogoByTypeId(n?.parent?.typeid)):(this.searchFilter.LocationID=null,n.img=v.getChannelLogoByTypeId(n?.typeid),this.searchFilter.ChannelID=n?.id,this.selectedChannel.set(n)),this.channelIdentity.update(()=>({img:n.img,label:n.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(n){n&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
1
|
+
import{a as Ve}from"./chunk-KJ4SL5OX.js";import"./chunk-ZSZQPMV2.js";import{a as L}from"./chunk-NLZCSTVO.js";import{a as H}from"./chunk-XHAXYWZ7.js";import{a as Pe,b as De,c as G}from"./chunk-EXBAGUW2.js";import"./chunk-BVIRHZTZ.js";import{b as Me}from"./chunk-L3JD55OC.js";import{a as Ee}from"./chunk-GDA72XOJ.js";import{a as Te,b as Fe}from"./chunk-S66L7N22.js";import"./chunk-LZVUS3GC.js";import"./chunk-DSKMV7XY.js";import"./chunk-633RG6PO.js";import{a as we}from"./chunk-OUJF6YWV.js";import"./chunk-YUBBVFFI.js";import{a as be}from"./chunk-UX3GY5M2.js";import"./chunk-C2SGQUOH.js";import{e as ge}from"./chunk-7IIB5DLC.js";import{i as Ce}from"./chunk-ES4U2NNX.js";import{b as de,e as ue}from"./chunk-KTXT25SP.js";import"./chunk-KCDL7SWP.js";import{d as Se,l as ye,m as ve,n as Ie}from"./chunk-OI3SQ5ZO.js";import{t as fe,u as xe}from"./chunk-OE7XFNYO.js";import"./chunk-UEB6GFG5.js";import{b as re,c as se,h as pe,m as ce,o as me,y as _e}from"./chunk-JCKUKK6T.js";import{c as v,f as he}from"./chunk-KZ2VDCDO.js";import{Ab as q,B as Y,Bc as ie,Cc as oe,Ec as ae,Fc as le,Ha as P,Ib as Q,Ja as s,Jb as c,Ka as w,Kb as k,Lb as M,Nb as b,Ob as T,Pb as F,Q as A,Qb as X,Rb as J,Tb as R,Va as O,X as W,_a as u,ab as m,ac as h,bc as x,cc as N,da as K,dc as z,ga as Z,hb as I,ib as U,kb as $,lb as j,mb as a,nb as r,oa as _,ob as S,pa as d,pb as D,qb as V,sb as y,vb as f,vc as ee,xb as l,xc as te,yc as ne}from"./chunk-QNL3BTRG.js";import{a as B}from"./chunk-GNOSNGXM.js";var Ne=o=>({"text-decoration-line-through":o}),Le=o=>({"ms-10":o}),Be=o=>({"bg-gradient-warning":o});function Ae(o,p){if(o&1){let e=y();a(0,"button",38),f("click",function(){_(e);let t=l().ngIf,i=l(2);return d(i.updateStock(t))}),S(1,"i",39),c(2," Update "),r()}}function We(o,p){if(o&1){let e=y();a(0,"div"),u(1,Ae,3,0,"button",35),a(2,"button",36),f("click",function(){_(e);let t=l(2);return d(t.openExportDialog())}),S(3,"i",37),a(4,"span"),c(5,"Export"),r()()()}if(o&2){let e=p.ngIf,n=l(2);s(),m("ngIf",n.productService.hasSelectionVariant(e))}}function Oe(o,p){o&1&&(a(0,"div",40)(1,"span"),c(2," showing only different stock, please press next to populate more data "),r()())}function Ue(o,p){if(o&1){let e=y();a(0,"th")(1,"input",41),F("ngModelChange",function(t){_(e);let i=l(2);return T(i.checkboxState,t)||(i.checkboxState=t),d(t)}),f("ngModelChange",function(){let t=_(e).ngIf,i=l(2);return d(i.onCheckboxStateChange(t))}),r()()}if(o&2){let e=l(2);s(),b("ngModel",e.checkboxState)}}function $e(o,p){o&1&&(a(0,"th",32),c(1," Reserved "),r())}function je(o,p){}function Qe(o,p){if(o&1){let e=y();a(0,"input",60),F("ngModelChange",function(t){_(e);let i=l(3).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),f("ngModelChange",function(){_(e);let t=l(3).$implicit,i=l(2);return d(i.onCheckboxStateProduct(t))}),r()}if(o&2){let e=l(3).$implicit;b("ngModel",e.selected)}}function ze(o,p){if(o&1){let e=y();a(0,"img",61),f("click",function(t){_(e);let i=l(3).$implicit,C=l(2);return d(C.onZoomImage(t,i==null?null:i.ImageUrl))}),r()}if(o&2){let e=l(3).$implicit;q("src",e==null?null:e.ThumbnailUrl,P)}}function Ge(o,p){o&1&&S(0,"img",57)}function He(o,p){if(o&1&&(S(0,"br"),a(1,"div",62),S(2,"i",63),a(3,"small"),c(4),r()()),o&2){let e=l(3).$implicit;s(4),M("(",e==null?null:e.Category,")")}}function Ye(o,p){if(o&1&&(a(0,"td",53)(1,"div",14),u(2,Qe,1,1,"input",54),a(3,"div",55),u(4,ze,1,1,"img",56)(5,Ge,1,0,"img",57),r()()(),a(6,"td",58)(7,"span",59),c(8),r(),u(9,He,5,1),r()),o&2){let e=l(2).$implicit,n=l(2);m("rowSpan",e==null?null:e.Variants.length),s(2),I(e.Variants.length>1?2:-1),s(),m("ngClass",R(7,Le,e.Variants.length<=1)),s(),I(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),k(e==null?null:e.Name),s(),I(e.CategoryID!==null&&e.CategoryID!=n.guidEmpty?9:-1)}}function Ke(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l(2).$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l(2).$implicit;b("ngModel",e.selected)}}function Ze(o,p){if(o&1&&u(0,Ke,1,1,"input",47),o&2){let e=l().$implicit;I((e==null?null:e.Inventory)<=1e5?0:-1)}}function qe(o,p){if(o&1){let e=y();a(0,"input",41),F("ngModelChange",function(t){_(e);let i=l().$implicit;return T(i.selected,t)||(i.selected=t),d(t)}),r()}if(o&2){let e=l().$implicit;b("ngModel",e.selected)}}function Xe(o,p){o&1&&(a(0,"div",64),c(1," Not Found "),r())}function Je(o,p){if(o&1&&(a(0,"div")(1,"span",65),c(2),h(3,"number"),r(),c(4," => "),a(5,"span",66),c(6),h(7,"number"),r()()),o&2){let e=l().$implicit;s(2),M(" ",x(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),k(x(7,4,e==null?null:e.Inventory))}}function et(o,p){if(o&1&&(c(0),h(1,"number")),o&2){let e=l().$implicit;M(" ",x(1,1,e==null?null:e.Inventory)," ")}}function tt(o,p){if(o&1&&(D(0),a(1,"div",67)(2,"a",68),S(3,"i",69),r()(),V()),o&2){let e=l().$implicit,n=l(3);s(2),m("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),P)}}function nt(o,p){if(o&1){let e=y();a(0,"span",74),f("click",function(){let t=_(e).ngIf,i=l(2).$implicit,C=l().$implicit,g=l(2);return d(g.openTableDialog(C,i,t))}),c(1),h(2,"number"),r()}if(o&2){let e=l(2).$implicit;s(),M(" ",x(2,1,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function it(o,p){if(o&1){let e=y();a(0,"td",70)(1,"div",48)(2,"div"),u(3,nt,3,3,"span",71),h(4,"async"),r(),a(5,"div",67)(6,"a",68),S(7,"i",69),r()(),a(8,"div",67)(9,"span",72),f("click",function(){_(e);let t=l().$implicit,i=l(3);return d(i.refreshInventory(t==null||t.Channel[0]==null?null:t.Channel[0].ChannelItemID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelVariationID,t==null||t.Channel[0]==null?null:t.Channel[0].ChannelID,t==null?null:t.ID))}),S(10,"i",73),r()()()()}if(o&2){let e=l().$implicit,n=l(3);m("ngClass",R(5,Be,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",x(4,3,n.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,P)}}function ot(o,p){if(o&1&&(D(0),a(1,"span",75),c(2),h(3,"number"),r(),V()),o&2){let e=l(2).$implicit;s(2),M(" (",x(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function at(o,p){o&1&&c(0," - ")}function lt(o,p){if(o&1&&(D(0),a(1,"td",44),u(2,ot,4,3,"ng-container",52)(3,at,1,0,"ng-template",null,1,z),r(),V()),o&2){let e=Q(4),n=l().$implicit;s(2),m("ngIf",n==null||n.Channel[0]==null?null:n.Channel[0].InventoryReserved)("ngIfElse",e)}}function rt(o,p){o&1&&(D(0),c(1," - "),V())}function st(o,p){if(o&1&&(a(0,"span",76),h(1,"date"),c(2),h(3,"date"),r()),o&2){let e=l().$implicit;m("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),M(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function pt(o,p){if(o&1&&(a(0,"tr"),u(1,Ye,10,9),a(2,"td",43),c(3),r(),a(4,"td",44)(5,"span",45),c(6),r()(),a(7,"td",46),u(8,Ze,1,1)(9,qe,1,1,"input",47),r(),a(10,"td")(11,"div",48),u(12,Xe,2,0,"div",49)(13,Je,8,6,"div")(14,et,2,3)(15,tt,4,1,"ng-container",5),r()(),u(16,it,11,7,"td",50)(17,lt,5,2,"ng-container",5),a(18,"td",51),u(19,rt,2,0,"ng-container",52)(20,st,4,8,"ng-template",null,0,z),r()()),o&2){let e=p.$implicit,n=p.index,t=Q(21),i=l(3);s(),I(n==0?1:-1),s(2),k(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",R(14,Ne,e.Discontinued)),s(),k(e==null?null:e.Code),s(2),I((e==null?null:e.Channel[0].TypeID)==1?8:(e==null?null:e.Inventory)>=0?9:-1),s(4),m("ngIf",(e==null?null:e.I)==null),s(),I((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?13:-1),s(),I((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?14:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",t)}}function ct(o,p){if(o&1&&(a(0,"tbody"),$(1,je,0,0,null,null,U),u(3,pt,22,16,"tr",42),r()),o&2){let e=p.$implicit;s(),j(e.Variants),s(2),m("ngForOf",e.Variants)}}function mt(o,p){if(o&1){let e=y();a(0,"mainpanel",3),f("onSubmit",function(t){_(e);let i=l();return d(i.onSearch(t))}),a(1,"actions")(2,"div",4),u(3,We,6,1,"div",5),h(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),c(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),f("onChannelChange",function(t){_(e);let i=l();return d(i.onChannelChange(t))}),r()(),a(10,"div",8)(11,"label",9),c(12,"PageNumber"),r(),a(13,"input",10),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),d(t)}),r()(),a(14,"div",8)(15,"label",11),c(16,"Page Size"),r(),a(17,"input",12),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),d(t)}),r()(),a(18,"div",8)(19,"label",13),c(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityFrom,t)||(i.searchFilter.QuantityFrom=t),d(t)}),r(),c(23," - "),a(24,"input",16),F("ngModelChange",function(t){_(e);let i=l();return T(i.searchFilter.QuantityTo,t)||(i.searchFilter.QuantityTo=t),d(t)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),u(29,Oe,3,0,"div",20),a(30,"table",21)(31,"thead",22)(32,"tr")(33,"th",23),c(34," Product "),S(35,"br"),a(36,"mat-slide-toggle",24),f("toggleChange",function(){_(e);let t=l();return t.showDifferenceStock=!t.showDifferenceStock,d(t.onShowDifferenceStock())}),a(37,"small",13),c(38,"FILTER DIFFERENT INVENTORY"),r()()(),a(39,"th",25),c(40,"Variant"),r(),a(41,"th",26),c(42,"SKU"),r(),u(43,Ue,2,1,"th",5),h(44,"async"),a(45,"th",27),c(46,"POS"),r(),a(47,"th",28)(48,"div",29),f("click",function(){_(e);let t=l();return d(t.openModalFilter())}),S(49,"img",30),a(50,"span",31),c(51),h(52,"stringLimit"),r()()(),u(53,$e,2,0,"th",32),a(54,"th",33),c(55,"Last Sync"),r()()(),$(56,ct,4,1,"tbody",null,U),h(58,"async"),r(),a(59,"infinite-paginator",34),h(60,"async"),f("onNextPage",function(){_(e);let t=l();return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=l();return d(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=l();return d(t.infinitePagination.getRowCount(t.searchFilter))}),r()()()()()()}if(o&2){let e,n,t,i=l();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",x(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),b("ngModel",i.searchFilter.PageNumber),s(4),b("ngModel",i.searchFilter.RowCount),s(5),b("ngModel",i.searchFilter.QuantityFrom),s(2),b("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngIf",x(44,23,i.products$)),s(5),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(n=i.channelIdentity())==null?null:n.img,P),s(2),M(" ",N(52,25,(t=i.channelIdentity())==null?null:t.label,13)," "),s(2),I(i.isShowReservedColumn?53:-1),s(3),j(x(58,28,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",x(60,30,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var Kt=(()=>{let p=class p{constructor(n,t,i,C,g,E,ke,Re){this.http=n,this.toastr=t,this.dialog=i,this.productService=C,this.authService=g,this.biggerPictureService=E,this.inventoryService=ke,this.mainPanelService=Re,this.infinitePagination=K(G),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="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.selectedChannel=O(null),this.channelIdentity=O({img:null,label:null}),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.hostName=this.authService.getDomain(),this.initPageLoader(),this.products$=this.infinitePagination.data$.pipe(W(n=>{this.checkShowReservedColumn(n)}),A())}checkShowReservedColumn(n){let t=0,i;n.forEach(C=>{i=C.Variants.find(g=>v.IsNotEmpty(g?.Channel[0]?.InventoryReserved)),i&&(t+=1)}),this.isShowReservedColumn=t>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe(A(1),W(n=>{this.searchFilter={RowCount:n.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:n.Filter.ChannelID,LocationID:n.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!n.Filter.IsMarketplaceAppActive)}))}onChannelChange(n){let t=Object.assign({},n);this.selectedChannel.set(t),v.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let n=Object.assign({},this.selectedChannel());v.IsNotEmpty(n.parent)?(this.searchFilter.LocationID=n.id,this.searchFilter.ChannelID=n?.parent?.id,n.label=n?.parent?.label+" - "+n?.label,n.img=v.getChannelLogoByTypeId(n?.parent?.typeid)):(this.searchFilter.LocationID=null,n.img=v.getChannelLogoByTypeId(n?.typeid),this.searchFilter.ChannelID=n?.id,this.selectedChannel.set(n)),this.channelIdentity.update(()=>({img:n.img,label:n.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(n){n&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
2
2
|
Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}onSearch(n){this.searchFilter.text=n,this.setChannelFilter(),this.initReloadData()}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(n){let t=this.productService.selectedVariantProduct(n);if(t.length>0){let i=this.searchFilter.LocationID,C=t.map(E=>B({ID:E.ID,Code:E.Code,Inventory:E.Inventory},v.IsNotEmpty(i)&&{LocationID:i})),g={ListChannelID:[this.searchFilter.ChannelID],List:C};this.http.post("/api/Inventory/UpdateChannel",g).subscribe(E=>{this.initReloadData(),this.checkboxState=!1,this.handlingUpdateStock(E)})}}handlingUpdateStock(n){if(n[0]?.Response){let t=n[0]?.Response?.Fail_list,i=n[0]?.Response?.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",i,t)}else this.toastr.error(n[0]?.Exception,"Error")}refreshInventory(n,t,i,C){let g={ChannelItemID:n,ChannelVariationID:t,ChannelID:i,VariantID:C};this.http.post("/api/Inventory/RefreshInventoryChannel",g).subscribe(E=>{this.toastr.success("Successfully updated","Success"),this.initReloadData()})}onCheckboxStateProduct(n){n.Variants=n.Variants.map(t=>(t.Inventory>=0&&(t.selected=n.selected),t))}onCheckboxStateChange(n){n=n.map(t=>(t.Variants=t.Variants.map(i=>(i.selected=this.checkboxState,i)),t))}openTableDialog(n,t,i){this.dialog.open(Pe,{data:{Name:n.Name,Variant:t,ChannelID:t?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:n.ChannelItemID}}).afterClosed().pipe(Y(g=>v.IsNotEmpty(g))).subscribe(g=>{this.updateItemAfterDialog(g)})}updateItemAfterDialog(n){let t=this.searchFilter.LocationID,i=B({ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,NewQuantity:parseFloat(n.Inventory),VariantID:n.ID,SKU:n.Sku},v.IsNotEmpty(t)&&{LocationID:t});this.http.post("/api/Inventory/UpdateQuantityByItem",i).subscribe(C=>{this.searchFilter.PageNumber=1,this.initReloadData(),this.handlingUpdateStock([C])})}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Inventory Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,QuantityFrom:this.searchFilter.QuantityFrom,QuantityTo:this.searchFilter.QuantityTo,exportApi:"Inventory/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=H.DIFFERENCE:this.searchFilter.filterModel=H.ALL,this.initReloadData()}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}};p.\u0275fac=function(t){return new(t||p)(w(ue),w(de),w(Se),w(we),w(Ce),w(be),w(L),w(ye))},p.\u0275cmp=Z({type:p,selectors:[["app-single-channel-comparison"]],standalone:!0,features:[X([G,L]),J],decls:2,vars:3,consts:[["SYNCDATE",""],["EMPTY_RESERVED",""],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"onSubmit","headerTitle","pageData","hideSearchBox"],[1,"d-flex"],[4,"ngIf"],["for","channelOptions",1,"fw-bold","mb-2"],["id","channelOptions",3,"onChannelChange","ngModel"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],[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,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[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,"ngModelChange","ngModel"],[4,"ngFor","ngForOf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"align-middle"],["type","checkbox",3,"ngModel"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"width","0%",3,"rowSpan"],["type","checkbox",1,"me-3",3,"ngModel"],[3,"ngClass"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Stock Available"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-end",3,"ngClass"],["class","cursor",3,"click",4,"ngIf"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom","pt-1"],[1,"cursor",3,"click"],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"]],template:function(t,i){t&1&&(u(0,mt,61,32,"mainpanel",2),h(1,"async")),t&2&&m("ngIf",x(1,1,i.loader$))},dependencies:[le,ee,te,ne,ie,ae,oe,Ie,ve,ge,_e,se,me,re,pe,ce,Ee,De,he,Fe,Te,xe,fe,Ve],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]});let o=p;return o})();export{Kt as SingleChannelComparisonComponent};
|