marketplacepos 5.48.1 → 5.48.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-ZRTEGBXK.js → chunk-2IASUYTM.js} +1 -1
- package/Marketplace/{chunk-D3VVBQYY.js → chunk-3JYZF65T.js} +1 -1
- package/Marketplace/{chunk-SJT5OMJM.js → chunk-3K2EKA5O.js} +1 -1
- package/Marketplace/{chunk-KB3CRZC5.js → chunk-5CHTDUME.js} +1 -1
- package/Marketplace/{chunk-BYTWGXP7.js → chunk-5KYN6Y7M.js} +1 -1
- package/Marketplace/{chunk-MRT6ZM2A.js → chunk-5X2L45XK.js} +1 -1
- package/Marketplace/{chunk-AAUBUT4Y.js → chunk-6OIMOM7S.js} +1 -1
- package/Marketplace/{chunk-IX6JJ6BJ.js → chunk-7DT7FQ2T.js} +1 -1
- package/Marketplace/{chunk-IWFUFVCC.js → chunk-7SB4C4PT.js} +1 -1
- package/Marketplace/{chunk-3LTTPECO.js → chunk-ADKAX3OO.js} +1 -1
- package/Marketplace/{chunk-6Z2CE7TK.js → chunk-AEVLZ7NS.js} +1 -1
- package/Marketplace/{chunk-HUECAZ5I.js → chunk-ALPG22RQ.js} +1 -1
- package/Marketplace/{chunk-PUUZQ4N5.js → chunk-B6F5PDL5.js} +1 -1
- package/Marketplace/{chunk-IYDRCUIT.js → chunk-C6JHPCLF.js} +1 -1
- package/Marketplace/{chunk-CG7UNGPF.js → chunk-CAZ7U2IL.js} +1 -1
- package/Marketplace/{chunk-SGTGXMFX.js → chunk-CBU473N2.js} +1 -1
- package/Marketplace/{chunk-QSBCJIQ3.js → chunk-CLQGGKN6.js} +1 -1
- package/Marketplace/{chunk-JKRH5WGR.js → chunk-DH5CXAEM.js} +1 -1
- package/Marketplace/{chunk-RASTACH2.js → chunk-FCFCTT5A.js} +1 -1
- package/Marketplace/{chunk-I3Q5TAIL.js → chunk-FRZCC6KZ.js} +1 -1
- package/Marketplace/{chunk-Q7MU7DBD.js → chunk-GVI6GJHY.js} +1 -1
- package/Marketplace/{chunk-TOATNIRC.js → chunk-GX6JPDQ5.js} +1 -1
- package/Marketplace/{chunk-XLNRT52E.js → chunk-H7GV5SNI.js} +1 -1
- package/Marketplace/{chunk-ZEF5FMYQ.js → chunk-HKHNRMPT.js} +1 -1
- package/Marketplace/{chunk-Q4AWQ7IC.js → chunk-I723PUUO.js} +1 -1
- package/Marketplace/{chunk-7WHUYSBD.js → chunk-IDH7MCR3.js} +1 -1
- package/Marketplace/{chunk-3TPMCGA5.js → chunk-J6BQDYXO.js} +1 -1
- package/Marketplace/{chunk-TLPRODFI.js → chunk-KSVJCX2D.js} +1 -1
- package/Marketplace/{chunk-IODYBTLK.js → chunk-KZSTYKIP.js} +1 -1
- package/Marketplace/{chunk-IU36PH6K.js → chunk-LABF6W37.js} +1 -1
- package/Marketplace/{chunk-NSBKRFO7.js → chunk-M65Z55OS.js} +1 -1
- package/Marketplace/{chunk-6ZE3KI6C.js → chunk-MKADKY44.js} +1 -1
- package/Marketplace/{chunk-ZVTFMONF.js → chunk-PLLHTY6O.js} +1 -1
- package/Marketplace/{chunk-RDS3OGH2.js → chunk-PZKN5FIT.js} +1 -1
- package/Marketplace/{chunk-WIYPRMVW.js → chunk-QCV5XC3U.js} +2 -2
- package/Marketplace/{chunk-64EV3KZS.js → chunk-RCBY7EIY.js} +1 -1
- package/Marketplace/{chunk-RXZ43ZSY.js → chunk-SZVL42NR.js} +1 -1
- package/Marketplace/{chunk-SFZDUON5.js → chunk-TIIGDXIJ.js} +2 -2
- package/Marketplace/{chunk-BJH4EGMC.js → chunk-UBTALPOC.js} +1 -1
- package/Marketplace/{chunk-XF2QZL6C.js → chunk-UCEZJNIL.js} +1 -1
- package/Marketplace/{chunk-327AAICB.js → chunk-VYQD3A3M.js} +1 -1
- package/Marketplace/{chunk-5G3OIF3V.js → chunk-WRK3ZHRX.js} +1 -1
- package/Marketplace/{chunk-GTIJJRTW.js → chunk-X6COQADC.js} +1 -1
- package/Marketplace/{chunk-X5X4R6MJ.js → chunk-XDBH7EGC.js} +1 -1
- package/Marketplace/{chunk-UIZJMH4U.js → chunk-XK4RP5MQ.js} +1 -1
- package/Marketplace/{chunk-GF6B54DH.js → chunk-Y77WYZ6Y.js} +1 -1
- package/Marketplace/{chunk-AFCA7VVG.js → chunk-ZUL6ZHSW.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-T7D6R6TU.js → main-YJKBQ3LW.js} +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as P,b as v}from"./chunk-
|
|
1
|
+
import{a as P,b as v}from"./chunk-6OIMOM7S.js";import{i as I}from"./chunk-I723PUUO.js";import{a as f}from"./chunk-AGBJEXIM.js";import{b as m,e as g}from"./chunk-OXWPYJNB.js";import{c as i}from"./chunk-JBEKD57G.js";import{J as h,ea as l,ma as C,qa as u,r as c,ra as S}from"./chunk-ZYJ6LAJ3.js";var R=(()=>{let o=class o{constructor(t,e,n){this.httpService=t,this.toastrService=e,this.notificationService=n,this.authService=S(I),this.scanChannelToastr=S(P),this.channelOptions=this.authService.getChannels()}loader(t=i.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:t})}LoadInPOS(t=i.GuidEMpty){return this.httpService.post("/api/product/LoadInPOS",{ID:t})}filterChannelByTypeId(t,e){return t.filter(n=>e.findIndex(a=>n.TypeID==a)!==-1)}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(t){let e={ID:t};return this.httpService.post("/api/product/TotalProductLive",e)}clearCacheChannel(t){let e={ID:t};return this.httpService.post("/api/Channel/ClearCacheChannel",e)}detachProduct(t){return this.httpService.post("/api/product/Detach",t)}uploadSingleProduct(t,e){let n={Channel:e,Products:t};return this.httpService.post("api/product/UploadMultipleChannel",n).pipe(l(a=>{this.showToastrSuccessUploadSingle(a,t[0])}),h(a=>(this.showToastErrorUploadSingle(a,t[0]),c(()=>new Error(a)))))}uploadMultipleProduct(t,e){let n={Channel:e,Products:t};return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",n).pipe(l(a=>{this.showToastrUploadMultiple(a.Message)}),h(a=>(this.showToastrUploadMultiple(a.error?.Message),c(()=>new Error(a)))))}uploadNotInChannel(t,e){let n={Products:t,Channel:e};return this.httpService.post("/api/product/UploadProductNotInChannelToChannel",n).pipe(l(a=>{this.showToastrUploadMultiple(a)}),h(a=>(this.showToastrUploadMultiple(a.error?.Message),c(()=>new Error(a)))))}scanSingle(t,e){let n={ID:t,SKU:e};return this.httpService.post("/api/product/ScanSingle",n)}scanNotInChannel(t){let e={ID:t};return this.httpService.post("/api/product/ScanNotinChannel",e)}findAllSoldInChannel(t){return this.httpService.post("/api/product/GetSoldInChannel",t)}scanAll(t,e,n,a=!1){let s={ID:t,ScanFull:e,UpdatedProduct:n,Async:a};return this.httpService.post("/api/product/ScanOptimized",s)}scanAsyncProductV2(t,e,n){let a={ID:t,ScanFull:e,UpdatedProduct:n,Async:!0};return this.httpService.post(f.ScanAsyncProductV2,a).pipe(l(s=>{this.notificationService.subscribeToJobGroup(s.JobID)}))}scanSyncProductV2(t,e,n){let a={ID:t,ScanFull:e,UpdatedProduct:n,Async:!1};return this.httpService.post(f.ScanSyncProductV2,a)}scanProductV2(t,e,n,a=!1){let s=this.findChannelById(t,this.channelOptions);return a?this.scanAsyncProductV2(t,e,n).pipe(l(r=>{this.scanChannelToastr.showToast({text:"Scan Job Started",detail:`JobID: ${r.JobID}`,severity:"info",data:{channelName:s.Name,channelTypeId:s.TypeID,jobId:r.JobID}})})):this.scanSyncProductV2(t,e,n).pipe(l(r=>{this.successToastrScanAllProduct(r,s,!n)}))}scanCompareToPos(t){return this.httpService.post("/api/product/CompareMarketplaceToPOS",t)}getVariantCodesProduct(t){return(t.Variants||[]).map(a=>a.Code)}downloadMultipleProduct(t){let e=t.map(n=>({ChannelItemID:n.ChannelItemID,ChannelID:n.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",e).pipe(l(n=>{this.toastrService.success(`${n.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(t){let e={ChannelItemID:t.ChannelItemID,ChannelID:t.ChannelID};return this.httpService.post("/api/product/DownloadProductFromChannel",e).pipe(l(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(t=[]){let e=[];return t.forEach(n=>{n.Variants.forEach(a=>{e=[...e,a.Code]})}),e}filterUnselectedChannel(t,e){let n=[];t.forEach(s=>{n=[...n,...s.Channel]});let a;if(!n||n.length==0)a=e;else{let s=[];a=e.filter(r=>(s=n.filter(d=>d.ChannelID==r.ID),s.length!==t.length))}return a}findChannelById(t,e){return e.find(n=>n.ID==t)}sortChannel(t=[]){return t.sort((e,n)=>e.TypeID<n.TypeID?1:e.TypeID===n.TypeID?0:-1)}hasSelection(t=[]){return this.selectedProduct(t).length>0}selectedProduct(t=[]){return t.filter(e=>e.selected)}hasSelectionVariant(t){return this.selectedVariantProduct(t).length>0}selectedVariantProduct(t){let e=[];return t.forEach(n=>{e=[...e,...n.Variants!=null?n.Variants.filter(a=>a.selected):""]}),e}getChannelProduct(t){let e=t.Variants||[],n=[];for(let a of e)if(a.Channel!=null)for(let s of a.Channel)n.filter(r=>r.ChannelID==s.ChannelID).length==0&&n.push(s);return this.sortChannel(n)}successToastrScanAllProduct(t,e,n){let a=t.InChannel?t?.InChannel?.Product:0,s=t?.NotInPOS?.Product?t?.NotInPOS?.Product:0,r=i.IsNotEmpty(t.LastUpdate)?i.convertToReadableDate(t.LastUpdate):null;n?this.toastrService.success(`
|
|
2
2
|
${s+a} product updates in ${e.Name} </br>
|
|
3
3
|
(${a} In Channel + ${s} Not In Pos)
|
|
4
4
|
${i.IsNotEmpty(r)?"since "+r:""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as m}from"./chunk-
|
|
1
|
+
import{h as m}from"./chunk-I723PUUO.js";import{a as r}from"./chunk-AGBJEXIM.js";import{b as S,e as C}from"./chunk-OXWPYJNB.js";import{b as i,c as l}from"./chunk-JBEKD57G.js";import{aa as u,ea as h,ma as c,ra as s,v as p}from"./chunk-ZYJ6LAJ3.js";var b=(()=>{let n=class n{constructor(){this.httpService=s(C),this.toastr=s(S),this.tokenService=s(m)}saveChannel(e){return this.httpService.post("/api/Channel/SubmitChannel",e).pipe(u(t=>this.tokenService.refreshToken().pipe(p(o=>t))))}getLastSync(e){return this.httpService.get(`${r.ChannelGetLastSyncByID}/?ID=${e}`)}getChannel(e){return this.httpService.post(r.GetChannel,e)}getChannelLoader(){return this.httpService.get(r.GetChannelLoader)}testShopID(e){return this.httpService.post(r.TestShopID,e).pipe(h(t=>{this.showTostrSuccessTestShopID(t)}))}updateChannelType(e){let t={ChannelID:e.ID,TypeID:i.ShopifyV2};return this.httpService.post(r.UpdateChannelType,t).pipe(h(o=>{this.showTostrSuccessTestShopID(o)}))}updateChannelIndex(e){return this.httpService.post(r.UpdateChannelIndex,e)}deleteChannel(e){return this.httpService.post(r.DeleteChannel,e)}mapChannelImage(e){return e.map(t=>(t.img=l.getChannelLogoByTypeId(t.TypeID),t))}showTostrSuccessTestShopID(e){let t="";for(var o in e)t+=o+" : "+e[o]+"<br/>";this.toastr.success(t,"Success",{enableHtml:!0,closeButton:!0,positionClass:"toast-bottom-right"})}getRegisterByOutletName(e){return this.httpService.post(r.GetRegisterByOutletName,{Outlet:e})}getChannelRowCount(e){return this.httpService.post(r.GetChannelRowCount,e).pipe(p(t=>t.Count))}getChannelWarehouse(e){return this.httpService.get(`${r.GetChannelWarehouse}/?ChannelID=${e}`)}unSynchronizedWarehouse(e){return this.httpService.delete(`${r.UnSynchronizedWarehouse}?ID=${e}`)}authorizedChannel(e){let t=this.getApiAuthorize(e);return this.httpService.post(`/api/${t}`,null).pipe(h(o=>{window.open(o.Url,"_blank")}))}getApiAuthorize(e){let t;switch(e){case i.Shopee:t="ChannelAuthorization/ShopeeV2_URL";break;case i.Tiktok:t="ChannelAuthorization/Tiktok_URL";break;case i.Lazada:t="ChannelAuthorization/Lazada_URL";break}return t}};n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"});let a=n;return a})();export{b as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Ce}from"./chunk-DXYMG6QK.js";import{c as Se}from"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import{a as ne}from"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import{a as me,b as pe,d as de,e as ge}from"./chunk-6KWG6O5L.js";import{i as ce}from"./chunk-
|
|
1
|
+
import{b as Ce}from"./chunk-DXYMG6QK.js";import{c as Se}from"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import{a as ne}from"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import{a as me,b as pe,d as de,e as ge}from"./chunk-6KWG6O5L.js";import{i as ce}from"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-AGBJEXIM.js";import{b as re,e as ae}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{b as g,c as oe}from"./chunk-JBEKD57G.js";import{m as fe,n as _e}from"./chunk-EDEZ3JLR.js";import{A as ie,h as ee,m as te}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import{b as se,c as le}from"./chunk-ZETUYNFJ.js";import{v as he,w as ue}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{I as L,i as Z,m as y}from"./chunk-LNJUGHOX.js";import{$b as V,$c as Y,Gb as K,Hb as _,Hc as P,Mb as S,Mc as c,Nc as h,Oc as G,Qc as O,Rc as w,Sc as I,Tc as q,Uc as Q,Vc as X,Z as b,aa as F,bc as W,dc as $,ea as R,ec as j,fc as A,gc as p,hc as r,hd as C,ic as s,id as x,jc as H,kd as D,lb as k,na as u,nb as l,nc as z,oc as J,q as B,qc as E,ra as f,v,vc as N,xa as M,xc as m,ya as T}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var ve=t=>[t];function be(t,i){if(t&1&&(r(0,"span",14),H(1,"img",15),s(),r(2,"span"),c(3),s()),t&2){let a=i.item;l(),p("src",a.Img,k)("alt",a.Name),l(2),G(" ",a.Name," ")}}function Me(t,i){if(t&1){let a=E();z(0),q(1),C(2,"async"),r(3,"a",16),N("click",function(){M(a);let e=X(1),o=m();return T(o.submitLogistics(e))}),c(4,"Submit"),s(),J()}if(t&2){let a=m();l(),Q(x(2,0,a.logisticServices$))}}function Te(t,i){}function Ee(t,i){if(t&1){let a=E();r(0,"ng-select",18),I("ngModelChange",function(e){M(a);let o=m(2).$implicit;return w(o.ProductSKU,e)||(o.ProductSKU=e),T(e)}),s()}if(t&2){let a=m(),n=m().$implicit;O("ngModel",n.ProductSKU),p("items",a)}}function Ne(t,i){if(t&1&&(r(0,"span"),c(1),s()),t&2){let a=m(2).$implicit;l(),h(a.ProductSKU||"-")}}function Pe(t,i){if(t&1&&S(0,Te,0,0,"ng-template",17)(1,Ee,1,2,"ng-template",null,0,D)(3,Ne,2,1,"ng-template",null,1,D),t&2){let a=P(2),n=P(4),e=m(2);p("ngxPermissionsOnly",Y(3,ve,e.logisticEditRole))("ngxPermissionsOnlyThen",a)("ngxPermissionsOnlyElse",n)}}function Oe(t,i){if(t&1&&(r(0,"tr")(1,"td"),c(2),s(),r(3,"td"),c(4),s(),r(5,"td"),c(6),s(),r(7,"td"),V(8,Pe,5,5),C(9,"async"),s()()),t&2){let a,n=i.$implicit,e=m();l(2),h(n.Name),l(2),h(n.Service),l(2),h(n.TypeString),l(2),W((a=x(9,4,e.logisticOptions$))?8:-1,a)}}var ye=(()=>{let i=class i{constructor(){this.http=f(ae),this.toastr=f(re),this.authService=f(ce),this.filter={ChannelID:""},this.logisticEditRole=ne.LogisticUpdate,this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let n=[g.WooCommerce,g.Lazada,g.Shopify,g.Plugo,g.Tokopedia];this.channelOptions=this.channelOptions.map(e=>(n.forEach(o=>{e.TypeID===o&&(e.disabled=!0)}),e))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(n=>{this.filter=n.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(b(1))}submitLogistics(n){this.clonedLogisticServices$.pipe(v(e=>n.map(o=>(e.findIndex(d=>d.Name===o.Name&&d.ProductSKU==o.ProductSKU)==-1&&(o.IsChange=!0),o))),F(e=>this.http.post("/api/Logistic/Submit",e))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter).pipe(v(n=>n.map(e=>(e.ProductSKU=oe.IsEmpty(e.ProductSKU)?null:e.ProductSKU,e))),R(n=>{let e=JSON.parse(JSON.stringify(n));this.clonedLogisticServices$=B(e)}),b(1))}iniTitle(){let n=this.channelOptions.find(e=>e.ID==this.filter.ChannelID);this.channelName=n?n.Name:null}};i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=K({type:i,selectors:[["app-logistic"]],standalone:!1,decls:29,vars:8,consts:[["thenBlock",""],["elseBlock",""],["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[4,"ngxPermissionsOnly"],[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"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[3,"ngxPermissionsOnly","ngxPermissionsOnlyThen","ngxPermissionsOnlyElse"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(e,o){e&1&&(r(0,"mainpanel",2),N("onSubmit",function(){return o.getLogisticService()}),r(1,"filters")(2,"div")(3,"label",3),c(4,"Select a Channel"),s(),r(5,"ng-select",4),I("ngModelChange",function(d){return w(o.filter.ChannelID,d)||(o.filter.ChannelID=d),d}),S(6,be,4,3,"ng-template",5),s()()(),r(7,"actions"),S(8,Me,5,3,"ng-container",6),s(),r(9,"content")(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",10)(14,"table",11)(15,"thead",12)(16,"tr",13)(17,"th"),c(18,"Logistic"),s(),r(19,"th"),c(20,"Service"),s(),r(21,"th"),c(22,"Type"),s(),r(23,"th"),c(24,"Logistic Service"),s()()(),r(25,"tbody"),j(26,Oe,10,6,"tr",null,$),C(28,"async"),s()()()()()()()()),e&2&&(p("headerTitle","Logistic Courier - "+o.channelName)("hideSearchDropdown",!1),l(5),p("clearable",!1)("items",o.channelOptions),O("ngModel",o.filter.ChannelID),l(3),p("ngxPermissionsOnly",o.logisticEditRole),l(18),A(x(28,6,o.logisticServices$)))},dependencies:[ee,te,fe,de,me,pe,he,se,Z],encapsulation:2});let t=i;return t})();var we=[{path:"",component:ye}],Le=(()=>{let i=class i{};i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=_({type:i}),i.\u0275inj=u({imports:[y,L.forChild(we)]});let t=i;return t})();var mt=(()=>{let i=class i{};i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=_({type:i}),i.\u0275inj=u({imports:[y,L,Le,ie,_e,ge,Ce,Se,ue,le]});let t=i;return t})();export{mt as LogisticModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ve}from"./chunk-DHPNXR6E.js";import{a as Fe}from"./chunk-6XDT56RT.js";import"./chunk-SHUYFOQI.js";import{a as N}from"./chunk-ISMIPSYN.js";import{a as ve,b as be,c as Te,d as L,e as W}from"./chunk-S5R6MCNP.js";import{c as fe,d as Pe}from"./chunk-T7HRAMHR.js";import"./chunk-DAUML5UD.js";import{a as ye,b as we}from"./chunk-DXYMG6QK.js";import"./chunk-63I3I3MX.js";import{a as ue}from"./chunk-ZRTEGBXK.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import{a as ae}from"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import{a as xe}from"./chunk-6OJQRHIZ.js";import"./chunk-AAUBUT4Y.js";import{e as pe}from"./chunk-6KWG6O5L.js";import{a as Se}from"./chunk-BYTWGXP7.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import{i as de}from"./chunk-Q4AWQ7IC.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import{b as le,e as ce}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{c as re}from"./chunk-JBEKD57G.js";import{d as me,l as Ce,m as he,n as ge}from"./chunk-EDEZ3JLR.js";import{A as oe,b as Y,c as ee,h as te,m as ne,o as ie}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import{b as se,c as _e}from"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{c as J,i as Z,l as E,m as Q,p as X}from"./chunk-LNJUGHOX.js";import{$b as h,$c as V,G as A,Gb as q,Ha as H,Mb as M,Mc as p,Nc as B,Oc as T,Qc as P,Rc as y,Sc as w,Wc as G,Z as $,Zc as K,bc as g,cc as k,ea as z,ec as O,fc as R,gc as C,hc as a,hd as v,ic as l,id as b,jc as F,jd as j,lb as D,nb as c,qc as S,ra as u,vc as x,xa as _,xc as r,ya as d}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var U=o=>[o],Ie=o=>({"text-decoration-line-through":o}),De=o=>({"bg-gradient-warning":o});function Ee(o,s){if(o&1){let e=S();a(0,"button",13),x("click",function(){_(e);let t=r(),i=r(2);return d(i.updateStock(t))}),F(1,"i",14),p(2," Update "),l()}}function Me(o,s){if(o&1){let e=S();a(0,"div",8),h(1,Ee,3,0,"button",10),a(2,"button",11),x("click",function(){_(e);let t=r(2);return d(t.openExportDialog())}),F(3,"i",12),a(4,"span"),p(5,"Export"),l()()()}if(o&2){let e=r(2);c(),g(e.productService.hasSelectionVariant(s)?1:-1)}}function Ne(o,s){if(o&1){let e=S();a(0,"th")(1,"input",28),x("change",function(t){_(e);let i=r(),m=r(2);return d(m.onSelectAllSKU(t.target.checked,i))}),l()()}}function ke(o,s){if(o&1){let e=S();a(0,"input",46),w("ngModelChange",function(t){_(e);let i=r(4).$implicit;return y(i.selected,t)||(i.selected=t),d(t)}),x("ngModelChange",function(){_(e);let t=r(4).$implicit,i=r(3);return d(i.onCheckboxStateProduct(t))}),l()}if(o&2){let e=r(4).$implicit;P("ngModel",e.selected)}}function Oe(o,s){if(o&1&&M(0,ke,1,1,"ng-template",22),o&2){let e=r(6);C("ngxPermissionsOnly",V(1,U,e.rolePriceEdit))}}function Re(o,s){if(o&1){let e=S();a(0,"img",47),x("click",function(t){_(e);let i=r(3).$implicit,m=r(3);return d(m.onZoomImage(t,i==null?null:i.ImageUrl))}),l()}if(o&2){let e=r(3).$implicit;C("src",G(e.ThumbnailUrl),D)}}function Be(o,s){o&1&&F(0,"img",42)}function Le(o,s){if(o&1&&(a(0,"small",45),p(1),l()),o&2){let e=r(3).$implicit;c(),T("(",e.Category,")")}}function We(o,s){if(o&1&&(a(0,"td",40)(1,"div",31),h(2,Oe,1,3,null,22),a(3,"div"),h(4,Re,1,2,"img",41)(5,Be,1,0,"img",42),l()()(),a(6,"td",43)(7,"span",44),p(8),l(),h(9,Le,2,1,"small",45),l()),o&2){let e=r(2).$implicit;C("rowSpan",e.Variants.length),c(2),g((e.Variants==null?null:e.Variants.length)>1?2:-1),c(2),g(e.ThumbnailUrl?4:5),c(2),C("rowSpan",e.Variants.length),c(2),B(e.Name),c(),g(e.Category?9:-1)}}function Ue(o,s){if(o&1){let e=S();a(0,"input",50),w("ngModelChange",function(t){_(e);let i=r(2).$implicit;return y(i.selected,t)||(i.selected=t),d(t)}),l()}if(o&2){let e=r(2).$implicit;P("ngModel",e.selected)}}function Ae(o,s){if(o&1&&(a(0,"td",48),h(1,Ue,1,1,"input",49),l()),o&2){let e=r().$implicit;c(),g(e.UnitPrice>=0?1:-1)}}function $e(o,s){o&1&&(a(0,"div",32),p(1," Not Found "),l())}function ze(o,s){if(o&1&&(a(0,"div"),p(1),v(2,"number"),l()),o&2){let e=r().$implicit;c(),T(" ",b(2,1,e.UnitPrice)," ")}}function He(o,s){if(o&1&&(a(0,"div",33)(1,"a",36),F(2,"i",51),l()()),o&2){let e=r().$implicit,n=r(4);c(),C("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),D)}}function qe(o,s){if(o&1){let e=S();a(0,"div",52),x("click",function(){_(e);let t=r().$implicit,i=r().$implicit,m=r(2),f=r();return d(f.openTableDialog(t,i,m))}),p(1),v(2,"number"),l()}if(o&2){let e=r().$implicit;c(),T(" ",b(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function Ge(o,s){if(o&1){let e=S();a(0,"tr",29),h(1,We,10,6),a(2,"td",20),p(3),l(),a(4,"td",23)(5,"span",30),p(6),l()(),M(7,Ae,2,1,"ng-template",22),a(8,"td",23)(9,"div",31),h(10,$e,2,0,"div",32),h(11,ze,3,3,"div"),h(12,He,3,1,"div",33),l()(),a(13,"td",34)(14,"div",31),h(15,qe,3,3,"div",35),a(16,"div",33)(17,"a",36),F(18,"i",37),l()(),a(19,"div",33)(20,"div",38),x("click",function(){let t=_(e).$implicit,i=r(4);return d(i.refreshPrice(t))}),F(21,"i",39),l()()()()()}if(o&2){let e=s.$implicit,n=s.$index,t=r(4);c(),g(n==0?1:-1),c(2),B(e.Model),c(2),C("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",V(12,Ie,e.Discontinued)),c(),T(" ",e.Code," "),c(),C("ngxPermissionsOnly",V(14,U,t.rolePriceEdit)),c(3),g((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),c(),g((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),c(),g((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),c(),C("ngClass",V(16,De,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),c(2),g(e.Channel.length>0?15:-1),c(2),C("href",e.Channel[0]==null?null:e.Channel[0].Url,D)}}function Ke(o,s){if(o&1&&O(0,Ge,22,18,"tr",29,k),o&2){let e=s.$implicit;R(e.Variants)}}function je(o,s){if(o&1){let e=S();a(0,"div",9)(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr")(5,"th",18),p(6," Product "),a(7,"div")(8,"mat-slide-toggle",19),w("ngModelChange",function(t){_(e);let i=r(2);return y(i.toggleDifferentInventory,t)||(i.toggleDifferentInventory=t),d(t)}),x("toggleChange",function(){_(e);let t=r(2);return d(t.onToggleDifferentInventory())}),a(9,"small",6),p(10,"FILTER DIFFERENT PRICE"),l()()()(),a(11,"th",20),p(12,"Variant"),l(),a(13,"th",21),p(14,"SKU"),l(),M(15,Ne,2,0,"ng-template",22),a(16,"th",23),p(17,"POS"),l(),a(18,"th",23)(19,"div",24),x("click",function(){_(e);let t=r(2);return d(t.openModalFilter())}),F(20,"img",25),a(21,"span",26),p(22),v(23,"stringLimit"),l()()()()(),a(24,"tbody"),O(25,Ke,2,0,null,null,k),l()(),a(27,"infinite-paginator",27),v(28,"async"),x("onNextPage",function(){_(e);let t=r(2);return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r(2);return d(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=r(2);return d(t.infinitePagination.getRowCount(t.searchFilter))}),l()()()}if(o&2){let e=r(2);c(8),P("ngModel",e.toggleDifferentInventory),c(7),C("ngxPermissionsOnly",V(16,U,e.rolePriceEdit)),c(4),C("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),c(),C("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),c(2),T(" ",j(23,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),c(3),R(s),c(2),C("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",b(28,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function Je(o,s){if(o&1){let e=S();a(0,"mainpanel",1),w("textChange",function(t){_(e);let i=r();return y(i.searchFilter.text,t)||(i.searchFilter.text=t),d(t)}),x("onSubmit",function(){_(e);let t=r();return d(t.onSearch())}),a(1,"filters")(2,"div",2)(3,"label",3),p(4,"Channel"),l(),a(5,"app-channel-options-v2",4),w("ngModelChange",function(t){_(e);let i=r();return y(i.searchFilter.ChannelID,t)||(i.searchFilter.ChannelID=t),d(t)}),l()(),a(6,"div",2)(7,"filter-query-type",5),w("numberFilterComparatorChange",function(t){_(e);let i=r();return y(i.searchFilter.NumberFilterComparator,t)||(i.searchFilter.NumberFilterComparator=t),d(t)})("searchTypeChange",function(t){_(e);let i=r();return y(i.searchFilter.SearchType,t)||(i.searchFilter.SearchType=t),d(t)}),l()(),a(8,"div",2)(9,"label",6),p(10,"Page Number"),l(),a(11,"input",7),w("ngModelChange",function(t){_(e);let i=r();return y(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),d(t)}),l()(),a(12,"div")(13,"label",6),p(14,"Page Size"),l(),a(15,"input",7),w("ngModelChange",function(t){_(e);let i=r();return y(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),d(t)}),l()()(),a(16,"actions"),h(17,Me,6,1,"div",8),v(18,"async"),l(),a(19,"content"),h(20,je,29,18,"div",9),v(21,"async"),l()()}if(o&2){let e,n,t=s,i=r();C("headerTitle",i.pageTitle),P("text",i.searchFilter.text),C("searchBoxPlaceHolder",i.searchPlaceholder()),c(5),P("ngModel",i.searchFilter.ChannelID),c(2),C("numberFilterComparatorOptions",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions),P("numberFilterComparator",i.searchFilter.NumberFilterComparator),C("searchTypeOptions",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions),P("searchType",i.searchFilter.SearchType),c(4),P("ngModel",i.searchFilter.PageNumber),c(4),P("ngModel",i.searchFilter.RowCount),c(2),g((e=b(18,12,i.data$))?17:-1,e),c(3),g((n=b(21,14,i.data$))?20:-1,n)}}var Nt=(()=>{let s=class s{constructor(){this.http=u(ce),this.toastr=u(le),this.dialog=u(me),this.productService=u(ue),this.biggerPictureService=u(xe),this.authService=u(de),this.mainPanelService=u(Ce),this.decimalPipe=u(E),this.placeholderService=u(fe),this.infinitePagination=u(L),this.updateResHandling=u(W),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=ae.PriceUpdate,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.searchPlaceholder=H("Search ...");let n=this.authService;this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=n.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(z(n=>{this.searchFilter=n.Filter,this.searchFilter.filterModel=N.ALL,this.initSearchPlaceholder(),this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter.SearchType,this.searchFilter.NumberFilterComparator))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=N.ALL:this.searchFilter.filterModel=N.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(n){n.Variants=n.Variants.map(t=>(t.selected=n.selected,t))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(n){let i=this.productService.selectedVariantProduct(n).map(f=>({ID:f.ID,ChannelID:f.Channel[0].ChannelID,Code:f.Code,Price:f.UnitPrice})),m={ListChannelID:[this.searchFilter.ChannelID],ListPrice:i};this.http.post("/api/Price/UpdateChannel",m).subscribe(f=>{this.onSearch(),this.handlingUpdateStock(f.Response)})}handlingUpdateStock(n){if(n.success_list?.length>0||n.failure_list?.length>0){let t=n.failure_list,i=n.success_list;this.updateResHandling.responseHandling(i,t,"Price")}else this.toastr.error(n[0]?.Exception,"Error")}refreshPrice(n){let t={ChannelItemID:n?.Channel[0].ChannelItemID,ChannelVariationID:n?.Channel[0]?.ChannelVariationID,ChannelID:n?.Channel[0]?.ChannelID,VariantID:n.ID};this.http.post("/api/Price/RefreshPriceChannel",t).subscribe(i=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel(),this.initSearchPlaceholder()}openTableDialog(n,t,i){let m=JSON.parse(JSON.stringify(n));this.dialog.open(ve,{data:{Name:t.Name,Variant:m,ChannelID:m?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:m?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(I=>re.IsNotEmpty(I))).subscribe(I=>{this.updateItemAfterDialog(I,n)})}updateItemAfterDialog(n,t){let i={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:parseFloat(n.Price),VariantID:n.ID,SKU:n.Sku};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(m=>{let f=this.productService.findChannelById(i.ID,this.channelOptions),I=i.Price?this.decimalPipe.transform(i.Price):i.Price;this.toastr.success(`Successfully updated ${n.ItemName} (${n.VarName}) price in ${f.Name} to ${I}`,"Success"),t.Channel[0]&&(t.Channel[0].Price=i.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(n=>n.ID==this.searchFilter.ChannelID)}onSelectAllSKU(n,t){t=t.map(i=>(i.Variants=i.Variants.map(m=>(m.selected=n,m)),i))}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}openExportDialog(){this.dialog.open(Fe,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(t){return new(t||s)},s.\u0275cmp=q({type:s,selectors:[["app-price-single-channel"]],features:[K([L,Ve,X("https://resc.cloudinary.com/"),E,W])],decls:2,vars:3,consts:[[1,"single-price",3,"headerTitle","text","searchBoxPlaceHolder"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text","searchBoxPlaceHolder"],[1,"mb-5"],[1,"fw-bold","mb-2"],[3,"ngModelChange","ngModel"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"d-flex"],[1,"container-fluid","mt-5"],[1,"btn","btn-success"],[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"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(t,i){if(t&1&&(h(0,Je,22,16,"mainpanel",0),v(1,"async")),t&2){let m;g((m=b(1,1,i.loader$))?0:-1,m)}},dependencies:[Q,J,ge,he,oe,ee,ie,Y,te,ne,Te,_e,se,we,ye,Se,pe,Pe,Z,E,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let o=s;return o})();export{Nt as PriceSingleChannelComponent};
|
|
1
|
+
import{a as Ve}from"./chunk-DHPNXR6E.js";import{a as Fe}from"./chunk-6XDT56RT.js";import"./chunk-SHUYFOQI.js";import{a as N}from"./chunk-ISMIPSYN.js";import{a as ve,b as be,c as Te,d as L,e as W}from"./chunk-S5R6MCNP.js";import{c as fe,d as Pe}from"./chunk-T7HRAMHR.js";import"./chunk-DAUML5UD.js";import{a as ye,b as we}from"./chunk-DXYMG6QK.js";import"./chunk-63I3I3MX.js";import{a as ue}from"./chunk-2IASUYTM.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import{a as ae}from"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import{a as xe}from"./chunk-6OJQRHIZ.js";import"./chunk-6OIMOM7S.js";import{e as pe}from"./chunk-6KWG6O5L.js";import{a as Se}from"./chunk-5KYN6Y7M.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import{i as de}from"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import{b as le,e as ce}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{c as re}from"./chunk-JBEKD57G.js";import{d as me,l as Ce,m as he,n as ge}from"./chunk-EDEZ3JLR.js";import{A as oe,b as Y,c as ee,h as te,m as ne,o as ie}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import{b as se,c as _e}from"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{c as J,i as Z,l as E,m as Q,p as X}from"./chunk-LNJUGHOX.js";import{$b as h,$c as V,G as A,Gb as q,Ha as H,Mb as M,Mc as p,Nc as B,Oc as T,Qc as P,Rc as y,Sc as w,Wc as G,Z as $,Zc as K,bc as g,cc as k,ea as z,ec as O,fc as R,gc as C,hc as a,hd as v,ic as l,id as b,jc as F,jd as j,lb as D,nb as c,qc as S,ra as u,vc as x,xa as _,xc as r,ya as d}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var U=o=>[o],Ie=o=>({"text-decoration-line-through":o}),De=o=>({"bg-gradient-warning":o});function Ee(o,s){if(o&1){let e=S();a(0,"button",13),x("click",function(){_(e);let t=r(),i=r(2);return d(i.updateStock(t))}),F(1,"i",14),p(2," Update "),l()}}function Me(o,s){if(o&1){let e=S();a(0,"div",8),h(1,Ee,3,0,"button",10),a(2,"button",11),x("click",function(){_(e);let t=r(2);return d(t.openExportDialog())}),F(3,"i",12),a(4,"span"),p(5,"Export"),l()()()}if(o&2){let e=r(2);c(),g(e.productService.hasSelectionVariant(s)?1:-1)}}function Ne(o,s){if(o&1){let e=S();a(0,"th")(1,"input",28),x("change",function(t){_(e);let i=r(),m=r(2);return d(m.onSelectAllSKU(t.target.checked,i))}),l()()}}function ke(o,s){if(o&1){let e=S();a(0,"input",46),w("ngModelChange",function(t){_(e);let i=r(4).$implicit;return y(i.selected,t)||(i.selected=t),d(t)}),x("ngModelChange",function(){_(e);let t=r(4).$implicit,i=r(3);return d(i.onCheckboxStateProduct(t))}),l()}if(o&2){let e=r(4).$implicit;P("ngModel",e.selected)}}function Oe(o,s){if(o&1&&M(0,ke,1,1,"ng-template",22),o&2){let e=r(6);C("ngxPermissionsOnly",V(1,U,e.rolePriceEdit))}}function Re(o,s){if(o&1){let e=S();a(0,"img",47),x("click",function(t){_(e);let i=r(3).$implicit,m=r(3);return d(m.onZoomImage(t,i==null?null:i.ImageUrl))}),l()}if(o&2){let e=r(3).$implicit;C("src",G(e.ThumbnailUrl),D)}}function Be(o,s){o&1&&F(0,"img",42)}function Le(o,s){if(o&1&&(a(0,"small",45),p(1),l()),o&2){let e=r(3).$implicit;c(),T("(",e.Category,")")}}function We(o,s){if(o&1&&(a(0,"td",40)(1,"div",31),h(2,Oe,1,3,null,22),a(3,"div"),h(4,Re,1,2,"img",41)(5,Be,1,0,"img",42),l()()(),a(6,"td",43)(7,"span",44),p(8),l(),h(9,Le,2,1,"small",45),l()),o&2){let e=r(2).$implicit;C("rowSpan",e.Variants.length),c(2),g((e.Variants==null?null:e.Variants.length)>1?2:-1),c(2),g(e.ThumbnailUrl?4:5),c(2),C("rowSpan",e.Variants.length),c(2),B(e.Name),c(),g(e.Category?9:-1)}}function Ue(o,s){if(o&1){let e=S();a(0,"input",50),w("ngModelChange",function(t){_(e);let i=r(2).$implicit;return y(i.selected,t)||(i.selected=t),d(t)}),l()}if(o&2){let e=r(2).$implicit;P("ngModel",e.selected)}}function Ae(o,s){if(o&1&&(a(0,"td",48),h(1,Ue,1,1,"input",49),l()),o&2){let e=r().$implicit;c(),g(e.UnitPrice>=0?1:-1)}}function $e(o,s){o&1&&(a(0,"div",32),p(1," Not Found "),l())}function ze(o,s){if(o&1&&(a(0,"div"),p(1),v(2,"number"),l()),o&2){let e=r().$implicit;c(),T(" ",b(2,1,e.UnitPrice)," ")}}function He(o,s){if(o&1&&(a(0,"div",33)(1,"a",36),F(2,"i",51),l()()),o&2){let e=r().$implicit,n=r(4);c(),C("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),D)}}function qe(o,s){if(o&1){let e=S();a(0,"div",52),x("click",function(){_(e);let t=r().$implicit,i=r().$implicit,m=r(2),f=r();return d(f.openTableDialog(t,i,m))}),p(1),v(2,"number"),l()}if(o&2){let e=r().$implicit;c(),T(" ",b(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function Ge(o,s){if(o&1){let e=S();a(0,"tr",29),h(1,We,10,6),a(2,"td",20),p(3),l(),a(4,"td",23)(5,"span",30),p(6),l()(),M(7,Ae,2,1,"ng-template",22),a(8,"td",23)(9,"div",31),h(10,$e,2,0,"div",32),h(11,ze,3,3,"div"),h(12,He,3,1,"div",33),l()(),a(13,"td",34)(14,"div",31),h(15,qe,3,3,"div",35),a(16,"div",33)(17,"a",36),F(18,"i",37),l()(),a(19,"div",33)(20,"div",38),x("click",function(){let t=_(e).$implicit,i=r(4);return d(i.refreshPrice(t))}),F(21,"i",39),l()()()()()}if(o&2){let e=s.$implicit,n=s.$index,t=r(4);c(),g(n==0?1:-1),c(2),B(e.Model),c(2),C("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",V(12,Ie,e.Discontinued)),c(),T(" ",e.Code," "),c(),C("ngxPermissionsOnly",V(14,U,t.rolePriceEdit)),c(3),g((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),c(),g((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),c(),g((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),c(),C("ngClass",V(16,De,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),c(2),g(e.Channel.length>0?15:-1),c(2),C("href",e.Channel[0]==null?null:e.Channel[0].Url,D)}}function Ke(o,s){if(o&1&&O(0,Ge,22,18,"tr",29,k),o&2){let e=s.$implicit;R(e.Variants)}}function je(o,s){if(o&1){let e=S();a(0,"div",9)(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr")(5,"th",18),p(6," Product "),a(7,"div")(8,"mat-slide-toggle",19),w("ngModelChange",function(t){_(e);let i=r(2);return y(i.toggleDifferentInventory,t)||(i.toggleDifferentInventory=t),d(t)}),x("toggleChange",function(){_(e);let t=r(2);return d(t.onToggleDifferentInventory())}),a(9,"small",6),p(10,"FILTER DIFFERENT PRICE"),l()()()(),a(11,"th",20),p(12,"Variant"),l(),a(13,"th",21),p(14,"SKU"),l(),M(15,Ne,2,0,"ng-template",22),a(16,"th",23),p(17,"POS"),l(),a(18,"th",23)(19,"div",24),x("click",function(){_(e);let t=r(2);return d(t.openModalFilter())}),F(20,"img",25),a(21,"span",26),p(22),v(23,"stringLimit"),l()()()()(),a(24,"tbody"),O(25,Ke,2,0,null,null,k),l()(),a(27,"infinite-paginator",27),v(28,"async"),x("onNextPage",function(){_(e);let t=r(2);return d(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r(2);return d(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=r(2);return d(t.infinitePagination.getRowCount(t.searchFilter))}),l()()()}if(o&2){let e=r(2);c(8),P("ngModel",e.toggleDifferentInventory),c(7),C("ngxPermissionsOnly",V(16,U,e.rolePriceEdit)),c(4),C("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),c(),C("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),c(2),T(" ",j(23,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),c(3),R(s),c(2),C("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",b(28,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function Je(o,s){if(o&1){let e=S();a(0,"mainpanel",1),w("textChange",function(t){_(e);let i=r();return y(i.searchFilter.text,t)||(i.searchFilter.text=t),d(t)}),x("onSubmit",function(){_(e);let t=r();return d(t.onSearch())}),a(1,"filters")(2,"div",2)(3,"label",3),p(4,"Channel"),l(),a(5,"app-channel-options-v2",4),w("ngModelChange",function(t){_(e);let i=r();return y(i.searchFilter.ChannelID,t)||(i.searchFilter.ChannelID=t),d(t)}),l()(),a(6,"div",2)(7,"filter-query-type",5),w("numberFilterComparatorChange",function(t){_(e);let i=r();return y(i.searchFilter.NumberFilterComparator,t)||(i.searchFilter.NumberFilterComparator=t),d(t)})("searchTypeChange",function(t){_(e);let i=r();return y(i.searchFilter.SearchType,t)||(i.searchFilter.SearchType=t),d(t)}),l()(),a(8,"div",2)(9,"label",6),p(10,"Page Number"),l(),a(11,"input",7),w("ngModelChange",function(t){_(e);let i=r();return y(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),d(t)}),l()(),a(12,"div")(13,"label",6),p(14,"Page Size"),l(),a(15,"input",7),w("ngModelChange",function(t){_(e);let i=r();return y(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),d(t)}),l()()(),a(16,"actions"),h(17,Me,6,1,"div",8),v(18,"async"),l(),a(19,"content"),h(20,je,29,18,"div",9),v(21,"async"),l()()}if(o&2){let e,n,t=s,i=r();C("headerTitle",i.pageTitle),P("text",i.searchFilter.text),C("searchBoxPlaceHolder",i.searchPlaceholder()),c(5),P("ngModel",i.searchFilter.ChannelID),c(2),C("numberFilterComparatorOptions",t==null||t.Options==null?null:t.Options.SearchComparatorTypeOptions),P("numberFilterComparator",i.searchFilter.NumberFilterComparator),C("searchTypeOptions",t==null||t.Options==null?null:t.Options.SearchSKUOnlyOrSKUNameOptions),P("searchType",i.searchFilter.SearchType),c(4),P("ngModel",i.searchFilter.PageNumber),c(4),P("ngModel",i.searchFilter.RowCount),c(2),g((e=b(18,12,i.data$))?17:-1,e),c(3),g((n=b(21,14,i.data$))?20:-1,n)}}var Nt=(()=>{let s=class s{constructor(){this.http=u(ce),this.toastr=u(le),this.dialog=u(me),this.productService=u(ue),this.biggerPictureService=u(xe),this.authService=u(de),this.mainPanelService=u(Ce),this.decimalPipe=u(E),this.placeholderService=u(fe),this.infinitePagination=u(L),this.updateResHandling=u(W),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=ae.PriceUpdate,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.searchPlaceholder=H("Search ...");let n=this.authService;this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=n.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(z(n=>{this.searchFilter=n.Filter,this.searchFilter.filterModel=N.ALL,this.initSearchPlaceholder(),this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter.SearchType,this.searchFilter.NumberFilterComparator))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=N.ALL:this.searchFilter.filterModel=N.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(n){n.Variants=n.Variants.map(t=>(t.selected=n.selected,t))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(n){let i=this.productService.selectedVariantProduct(n).map(f=>({ID:f.ID,ChannelID:f.Channel[0].ChannelID,Code:f.Code,Price:f.UnitPrice})),m={ListChannelID:[this.searchFilter.ChannelID],ListPrice:i};this.http.post("/api/Price/UpdateChannel",m).subscribe(f=>{this.onSearch(),this.handlingUpdateStock(f.Response)})}handlingUpdateStock(n){if(n.success_list?.length>0||n.failure_list?.length>0){let t=n.failure_list,i=n.success_list;this.updateResHandling.responseHandling(i,t,"Price")}else this.toastr.error(n[0]?.Exception,"Error")}refreshPrice(n){let t={ChannelItemID:n?.Channel[0].ChannelItemID,ChannelVariationID:n?.Channel[0]?.ChannelVariationID,ChannelID:n?.Channel[0]?.ChannelID,VariantID:n.ID};this.http.post("/api/Price/RefreshPriceChannel",t).subscribe(i=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel(),this.initSearchPlaceholder()}openTableDialog(n,t,i){let m=JSON.parse(JSON.stringify(n));this.dialog.open(ve,{data:{Name:t.Name,Variant:m,ChannelID:m?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:m?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(I=>re.IsNotEmpty(I))).subscribe(I=>{this.updateItemAfterDialog(I,n)})}updateItemAfterDialog(n,t){let i={ID:n.ChannelID,ChannelItemID:n.ChannelItemID,ChannelVariantID:n.ChannelVariationID,Price:parseFloat(n.Price),VariantID:n.ID,SKU:n.Sku};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(m=>{let f=this.productService.findChannelById(i.ID,this.channelOptions),I=i.Price?this.decimalPipe.transform(i.Price):i.Price;this.toastr.success(`Successfully updated ${n.ItemName} (${n.VarName}) price in ${f.Name} to ${I}`,"Success"),t.Channel[0]&&(t.Channel[0].Price=i.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(n=>n.ID==this.searchFilter.ChannelID)}onSelectAllSKU(n,t){t=t.map(i=>(i.Variants=i.Variants.map(m=>(m.selected=n,m)),i))}onZoomImage(n,t){this.biggerPictureService.openBiggerPicture(n,t)}openExportDialog(){this.dialog.open(Fe,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(t){return new(t||s)},s.\u0275cmp=q({type:s,selectors:[["app-price-single-channel"]],features:[K([L,Ve,X("https://resc.cloudinary.com/"),E,W])],decls:2,vars:3,consts:[[1,"single-price",3,"headerTitle","text","searchBoxPlaceHolder"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text","searchBoxPlaceHolder"],[1,"mb-5"],[1,"fw-bold","mb-2"],[3,"ngModelChange","ngModel"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"d-flex"],[1,"container-fluid","mt-5"],[1,"btn","btn-success"],[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"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","8px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","8px",3,"click","src"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(t,i){if(t&1&&(h(0,Je,22,16,"mainpanel",0),v(1,"async")),t&2){let m;g((m=b(1,1,i.loader$))?0:-1,m)}},dependencies:[Q,J,ge,he,oe,ee,ie,Y,te,ne,Te,_e,se,we,ye,Se,pe,Pe,Z,E,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let o=s;return o})();export{Nt as PriceSingleChannelComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as W,b as A,c as U}from"./chunk-3JRUKSV3.js";import{a as z,b as B}from"./chunk-SJ5MC42H.js";import{b as j}from"./chunk-NWB7EVME.js";import{a as I}from"./chunk-A6QXXKPR.js";import{i as E}from"./chunk-
|
|
1
|
+
import{a as W,b as A,c as U}from"./chunk-3JRUKSV3.js";import{a as z,b as B}from"./chunk-SJ5MC42H.js";import{b as j}from"./chunk-NWB7EVME.js";import{a as I}from"./chunk-A6QXXKPR.js";import{i as E}from"./chunk-I723PUUO.js";import{ra as P}from"./chunk-5PMKN6PM.js";import{A as k,a as D,h as N,m as F}from"./chunk-L3W6SG2T.js";import{$b as T,Gb as V,Kb as v,Mb as _,Mc as x,Nc as S,Qc as w,Rc as b,Sc as y,Zc as O,bc as L,gc as p,hc as c,ic as u,jc as g,lb as h,nb as m,qc as f,ra as M,td as d,vc as C,xa as r,xc as a,ya as s}from"./chunk-ZYJ6LAJ3.js";function G(n,o){if(n&1&&(c(0,"div",6),g(1,"img",7),c(2,"div"),x(3),u()()),n&2){let e=o.$implicit;m(),p("src",e.logo,h),m(2),S(e.Name)}}function R(n,o){if(n&1){let e=f();c(0,"p-multiselect",4,0),C("click",function(){r(e);let i=a();return s(i.onClickSelect())}),y("ngModelChange",function(i){r(e);let l=a();return b(l.selectedChannels,i)||(l.selectedChannels=i),s(i)}),C("ngModelChange",function(i){r(e);let l=a();return s(l.onChannelChange(i))}),_(2,G,4,2,"ng-template",5),u()}if(n&2){let e=a();p("options",e.options())("placeholder",e.placeholder()),w("ngModel",e.selectedChannels),p("showClear",e.clearable())("autofocusFilter",!0)("maxSelectedLabels",e.maxSelectedLabels())}}function q(n,o){if(n&1&&(c(0,"div",6),g(1,"img",7),c(2,"div"),x(3),u()()),n&2){let e=o.$implicit;m(),p("src",e.logo,h),m(2),S(e.Name)}}function H(n,o){if(n&1){let e=f();c(0,"p-select",8,1),C("click",function(){r(e);let i=a();return s(i.onClickSelect())}),y("ngModelChange",function(i){r(e);let l=a();return b(l.selectedChannels,i)||(l.selectedChannels=i),s(i)}),C("ngModelChange",function(i){r(e);let l=a();return s(l.onChannelChange(i))}),_(2,q,4,2,"ng-template",5),u()}if(n&2){let e=a();p("options",e.options())("placeholder",e.placeholder()),w("ngModel",e.selectedChannels),p("showClear",e.clearable())("autofocusFilter",!0)("filter",!0)}}var re=(()=>{let o=class o extends U{constructor(){super(),this.authService=M(E),this.multiple=d(!1),this.clearable=d(!0),this.placeholder=d("Select Channels"),this.options=d(this.authService.getChannels()),this.maxSelectedLabels=d(6),this.onChange=t=>{}}onChannelChange(t){this.multiple()?t=t||[]:t=t||I.GuidEmpty,this.onChange(t)}onClickSelect(){this.initTopPosition(),setTimeout(()=>{this.adjustOverlayPosition()},0)}writeValue(t){this.selectedChannels=t}registerOnChange(t){this.onChange=t}registerOnTouched(t){}setDisabledState(t){}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=V({type:o,selectors:[["app-channel-options-v2"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"],placeholder:[1,"placeholder"],options:[1,"options"],maxSelectedLabels:[1,"maxSelectedLabels"]},features:[O([{provide:D,multi:!0,useExisting:o}]),v],decls:2,vars:1,consts:[["multiSelect",""],["select",""],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","filter"],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels"],["pTemplate","item"],[1,"d-flex","align-items-center","gap-2"],[2,"width","18px",3,"src"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","filter"]],template:function(i,l){i&1&&T(0,R,3,6,"p-multiselect",2)(1,H,3,6,"p-select",3),i&2&&L(l.multiple()?0:1)},dependencies:[B,z,P,j,k,N,F,A,W],encapsulation:2});let n=o;return n})();export{re as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as xe,b as Te}from"./chunk-L76NLJD7.js";import{a as Ce,b as Se,c as ye}from"./chunk-ILW6ZFFV.js";import{a as ve}from"./chunk-IODYBTLK.js";import{a as N}from"./chunk-Q7MU7DBD.js";import{a as be}from"./chunk-S7CKRTJV.js";import"./chunk-EYT2YJGK.js";import"./chunk-RNWHARPK.js";import{a as fe}from"./chunk-7JQEF4XX.js";import"./chunk-AFIF6VRM.js";import"./chunk-ZW2TMVZP.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import"./chunk-FCEXPGTK.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import"./chunk-6KWG6O5L.js";import{a as ge}from"./chunk-BYTWGXP7.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import{a as he}from"./chunk-PDCVMSLL.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-Q4AWQ7IC.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import{b as me}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{b as de}from"./chunk-JBEKD57G.js";import{m as ue,n as _e}from"./chunk-EDEZ3JLR.js";import{A as se,b as ne,c as oe,h as re,m as le,o as ae}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import{v as pe,w as ce}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as $,j as ee,l as te,m as ie}from"./chunk-LNJUGHOX.js";import{$b as v,$c as X,Bc as H,Cc as Q,Dc as j,Gb as D,Ha as P,Lc as q,Mc as d,Nc as w,Oc as E,Qc as C,Rc as S,Sc as y,Tc as U,Uc as G,Vc as F,Z as I,Zc as J,_c as K,bc as x,cc as B,ea as k,ec as A,fc as z,gc as f,hc as t,hd as M,ic as n,id as O,jc as h,jd as Y,lb as W,nb as a,od as Z,qc as T,ra as R,vc as g,xa as p,xc as u,ya as c}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as V,b as L}from"./chunk-66YHNWRR.js";var we=["contextMenu"],Me=()=>[],Ve=l=>({"td-cell-hover":l});function Re(l,m){if(l&1){let e=T();t(0,"button",20),g("click",function(){p(e);let r=u();return c(r.setMultipleFulfillment())}),d(1," Set Fulfillment "),n()}}function Ee(l,m){if(l&1&&h(0,"variants-dropdown",37),l&2){let e=u().$implicit;f("variants",e==null?null:e.Variants)}}function Oe(l,m){if(l&1&&h(0,"variant-with-image",38),l&2){let e=u().$implicit;f("variant",e==null?null:e.Variants[0])}}function Pe(l,m){if(l&1&&(t(0,"span"),d(1),n()),l&2){let e=u().$implicit;a(),E("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Fe(l,m){if(l&1){let e=T();t(0,"div",40)(1,"button",44),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.refreshShippingAndRefNumber(r))}),h(2,"i",45),n()()}}function Ne(l,m){if(l&1){let e=T();t(0,"button",46),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.onSetFulfillment(r))}),d(1," Set Fulfillment "),n()}}function Le(l,m){if(l&1){let e=T();t(0,"tr")(1,"td")(2,"input",30),y("ngModelChange",function(r){let o=p(e).$implicit;return S(o.selected,r)||(o.selected=r),c(r)}),g("ngModelChange",function(){p(e);let r=u(2),o=F(0);return c(r.onSelectOrder(o))}),n()(),t(3,"td")(4,"div",31),h(5,"img",32),M(6,"channelImage"),t(7,"div",33)(8,"div"),d(9),n(),t(10,"small",34)(11,"span"),d(12),n()()()()(),t(13,"td")(14,"div",35)(15,"div"),h(16,"order-link",36),n(),t(17,"small"),d(18),M(19,"date"),n()()(),t(20,"td"),d(21),n(),t(22,"td"),v(23,Ee,1,1,"variants-dropdown",37)(24,Oe,1,1,"variant-with-image",38),n(),t(25,"td",39),d(26),M(27,"number"),n(),t(28,"td",40)(29,"div",41)(30,"div",35)(31,"div",42)(32,"span"),d(33),n(),v(34,Pe,2,1,"span"),n(),t(35,"small"),d(36),n()(),v(37,Fe,3,0,"div",40),n()(),t(38,"td",40),v(39,Ne,2,0,"button",43),n()()}if(l&2){let e=m.$implicit,i=u(2);a(2),C("ngModel",e.selected),f("disabled",i.selectedChannelType()!=null&&i.selectedChannelType()!=e.MarketType),a(3),f("src",O(6,18,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),a(4),w(e.Outlet),a(3),w(e.ChannelName),a(4),f("order",e),a(2),E(" ",Y(19,20,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),a(3),w(e.Customer),a(),q(X(25,Ve,(e.Variants==null?null:e.Variants.length)>1)),a(),x((e.Variants==null?null:e.Variants.length)>1?23:24),a(3),w(O(27,23,e.Amount)),a(7),w(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),a(),x(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?34:-1),a(2),E(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),a(),x(!(e.LogisticService!=null&&e.LogisticService.Name)||!e.ReferenceNumber?37:-1),a(2),x((e==null?null:e.MarketType)!=i.channelType.WooCommerce?39:-1)}}function Ie(l,m){if(l&1){let e=T();t(0,"div",17)(1,"table",21)(2,"thead",22)(3,"tr",23),h(4,"th",24),t(5,"th",25),d(6,"Outlet"),n(),t(7,"th",25),d(8,"Number"),n(),t(9,"th",25),d(10,"Customer"),n(),t(11,"th"),d(12,"Items"),n(),t(13,"th",26),d(14,"Amount"),n(),t(15,"th",27),d(16,"Shipping"),n(),h(17,"th",28),n()(),t(18,"tbody"),A(19,Le,40,27,"tr",null,B),n()(),t(21,"app-custom-paginator",29),g("next",function(){p(e);let r=u();return c(r.initReadyToShip())})("previous",function(){p(e);let r=u();return c(r.initReadyToShip())}),n()()}if(l&2){let e=u(),i=F(0);a(19),z(i),a(2),f("filter",e.filter())("totaldata",i==null?null:i.length)}}function ke(l,m){l&1&&(t(0,"div",18),h(1,"app-empty-state"),n())}var mt=(()=>{let m=class m{constructor(){this.toastr=R(me),this.orderService=R(N),this.fulfillmentService=R(xe),this.channelType=de,this.selectedOrders=P([]),this.selectedChannelType=Z(()=>{let i=null;return this.selectedOrders().length>0&&(i=this.selectedOrders()[0].MarketType),i}),this.filter=P({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"}]}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:i=>{this.initFromDate(i)},error:i=>{console.error("Error fetching default date:",i),this.initFromDate(null)}})}initFromDate(i){this.filter.update(r=>L(V({},r),{From:i})),this.initReadyToShip()}initReadyToShip(){this.readyToShip$=this.orderService.getReadyToShipOrders(this.filter()).pipe(k(()=>{this.selectedOrders.set([])}),I(1))}onFilterChange(i){this.filter.update(r=>V(V({},r),i))}onSetFulfillment(i){this.fulfillmentService.setFulfillmentOrder(i).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}refreshShippingAndRefNumber(i){this.orderService.refreshShippingCourier(i.ShopID,i.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),this.initReadyToShip()})}setMultipleFulfillment(){this.fulfillmentService.setFulfillmentMultipleOrders(this.selectedOrders()).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}onSelectOrder(i){let r=i.filter(o=>o.selected);this.selectedOrders.set(r)}onMouseHover(i,r){(!r.LogisticService?.Name||!r.ReferenceNumber)&&this.contextMenuEl.show(i,r)}onSelectContextItem(i){i.item?.id==="refresh"&&this.refreshShippingAndRefNumber(i.data)}};m.\u0275fac=function(r){return new(r||m)},m.\u0275cmp=D({type:m,selectors:[["app-ready-to-ship"]],viewQuery:function(r,o){if(r&1&&H(we,5),r&2){let _;Q(_=j())&&(o.contextMenuEl=_.first)}},features:[J([N])],decls:37,vars:14,consts:[["contextMenu",""],["headerTitle","To Ship","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],[1,"btn","btn-outline-secondary","shadow","rounded"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","100px"],[2,"width","150px"],["rowCountApi","/api/orders/toshipcount",3,"next","previous","filter","totaldata"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"actions-cell"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem"],["matTooltip","Retrieve shipping courier and reference number",1,"btn","btn-icon-only",3,"click"],[1,"fa-solid","fa-arrows-rotate","fs-6"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(r,o){if(r&1){let _=T();U(0),M(1,"async"),t(2,"mainpanel",1),g("onSubmit",function(){return p(_),c(o.initReadyToShip())}),y("textChange",function(s){return p(_),S(o.filter().Number,s)||(o.filter().Number=s),c(s)}),t(3,"actions"),v(4,Re,2,0,"button",2),t(5,"a",3),h(6,"i",4),t(7,"span"),d(8,"Order Fulfillment Display"),n()()(),t(9,"filters")(10,"div")(11,"label",5),d(12,"Channel"),n(),t(13,"app-channel-options-v2",6),y("ngModelChange",function(s){return p(_),S(o.filter().ListChannelID,s)||(o.filter().ListChannelID=s),c(s)}),n()(),t(14,"div",7)(15,"label",5),d(16,"From/To"),n(),t(17,"div",8)(18,"datepicker",9),y("dateChange",function(s){return p(_),S(o.filter().From,s)||(o.filter().From=s),c(s)}),n()(),t(19,"div")(20,"datepicker",10),y("dateChange",function(s){return p(_),S(o.filter().To,s)||(o.filter().To=s),c(s)}),n()()(),t(21,"div",7)(22,"label",11),d(23,"Page Number"),n(),t(24,"input",12),y("ngModelChange",function(s){return p(_),S(o.filter().PageNumber,s)||(o.filter().PageNumber=s),c(s)}),n()(),t(25,"div",7)(26,"label",11),d(27,"Page Size"),n(),t(28,"input",13),y("ngModelChange",function(s){return p(_),S(o.filter().PageSize,s)||(o.filter().PageSize=s),c(s)}),n()()(),t(29,"content")(30,"div",14)(31,"div",15)(32,"div",16),v(33,Ie,22,2,"div",17)(34,ke,2,0,"div",18),n()()()()(),t(35,"app-context-menu",19,0),g("onSelectItem",function(s){return p(_),c(o.onSelectContextItem(s))}),n()}if(r&2){let _=G(O(1,10,o.readyToShip$)||K(13,Me));a(2),C("text",o.filter().Number),a(2),x(o.selectedOrders().length>0?4:-1),a(9),f("multiple",!0),C("ngModel",o.filter().ListChannelID),a(5),C("date",o.filter().From),a(2),C("date",o.filter().To),a(4),C("ngModel",o.filter().PageNumber),a(4),C("ngModel",o.filter().PageSize),a(5),x(_.length>0?33:34),a(2),f("items",o.contextMenuItems)}},dependencies:[ie,_e,ue,fe,he,se,oe,ae,ne,re,le,Se,ye,be,ve,ce,pe,Te,ge,$,te,ee,Ce],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], div[_ngcontent-%COMP%]:hover.actions-cell .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"]});let l=m;return l})();export{mt as ReadyToShipComponent};
|
|
1
|
+
import{a as xe,b as Te}from"./chunk-L76NLJD7.js";import{a as Ce,b as Se,c as ye}from"./chunk-ILW6ZFFV.js";import{a as ve}from"./chunk-KZSTYKIP.js";import{a as N}from"./chunk-GVI6GJHY.js";import{a as be}from"./chunk-S7CKRTJV.js";import"./chunk-EYT2YJGK.js";import"./chunk-RNWHARPK.js";import{a as fe}from"./chunk-7JQEF4XX.js";import"./chunk-AFIF6VRM.js";import"./chunk-ZW2TMVZP.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import"./chunk-FCEXPGTK.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import"./chunk-6KWG6O5L.js";import{a as ge}from"./chunk-5KYN6Y7M.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import{a as he}from"./chunk-PDCVMSLL.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import{b as me}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{b as de}from"./chunk-JBEKD57G.js";import{m as ue,n as _e}from"./chunk-EDEZ3JLR.js";import{A as se,b as ne,c as oe,h as re,m as le,o as ae}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import{v as pe,w as ce}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as $,j as ee,l as te,m as ie}from"./chunk-LNJUGHOX.js";import{$b as v,$c as X,Bc as H,Cc as Q,Dc as j,Gb as D,Ha as P,Lc as q,Mc as d,Nc as w,Oc as E,Qc as C,Rc as S,Sc as y,Tc as U,Uc as G,Vc as F,Z as I,Zc as J,_c as K,bc as x,cc as B,ea as k,ec as A,fc as z,gc as f,hc as t,hd as M,ic as n,id as O,jc as h,jd as Y,lb as W,nb as a,od as Z,qc as T,ra as R,vc as g,xa as p,xc as u,ya as c}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as V,b as L}from"./chunk-66YHNWRR.js";var we=["contextMenu"],Me=()=>[],Ve=l=>({"td-cell-hover":l});function Re(l,m){if(l&1){let e=T();t(0,"button",20),g("click",function(){p(e);let r=u();return c(r.setMultipleFulfillment())}),d(1," Set Fulfillment "),n()}}function Ee(l,m){if(l&1&&h(0,"variants-dropdown",37),l&2){let e=u().$implicit;f("variants",e==null?null:e.Variants)}}function Oe(l,m){if(l&1&&h(0,"variant-with-image",38),l&2){let e=u().$implicit;f("variant",e==null?null:e.Variants[0])}}function Pe(l,m){if(l&1&&(t(0,"span"),d(1),n()),l&2){let e=u().$implicit;a(),E("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Fe(l,m){if(l&1){let e=T();t(0,"div",40)(1,"button",44),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.refreshShippingAndRefNumber(r))}),h(2,"i",45),n()()}}function Ne(l,m){if(l&1){let e=T();t(0,"button",46),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.onSetFulfillment(r))}),d(1," Set Fulfillment "),n()}}function Le(l,m){if(l&1){let e=T();t(0,"tr")(1,"td")(2,"input",30),y("ngModelChange",function(r){let o=p(e).$implicit;return S(o.selected,r)||(o.selected=r),c(r)}),g("ngModelChange",function(){p(e);let r=u(2),o=F(0);return c(r.onSelectOrder(o))}),n()(),t(3,"td")(4,"div",31),h(5,"img",32),M(6,"channelImage"),t(7,"div",33)(8,"div"),d(9),n(),t(10,"small",34)(11,"span"),d(12),n()()()()(),t(13,"td")(14,"div",35)(15,"div"),h(16,"order-link",36),n(),t(17,"small"),d(18),M(19,"date"),n()()(),t(20,"td"),d(21),n(),t(22,"td"),v(23,Ee,1,1,"variants-dropdown",37)(24,Oe,1,1,"variant-with-image",38),n(),t(25,"td",39),d(26),M(27,"number"),n(),t(28,"td",40)(29,"div",41)(30,"div",35)(31,"div",42)(32,"span"),d(33),n(),v(34,Pe,2,1,"span"),n(),t(35,"small"),d(36),n()(),v(37,Fe,3,0,"div",40),n()(),t(38,"td",40),v(39,Ne,2,0,"button",43),n()()}if(l&2){let e=m.$implicit,i=u(2);a(2),C("ngModel",e.selected),f("disabled",i.selectedChannelType()!=null&&i.selectedChannelType()!=e.MarketType),a(3),f("src",O(6,18,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),a(4),w(e.Outlet),a(3),w(e.ChannelName),a(4),f("order",e),a(2),E(" ",Y(19,20,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),a(3),w(e.Customer),a(),q(X(25,Ve,(e.Variants==null?null:e.Variants.length)>1)),a(),x((e.Variants==null?null:e.Variants.length)>1?23:24),a(3),w(O(27,23,e.Amount)),a(7),w(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),a(),x(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?34:-1),a(2),E(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),a(),x(!(e.LogisticService!=null&&e.LogisticService.Name)||!e.ReferenceNumber?37:-1),a(2),x((e==null?null:e.MarketType)!=i.channelType.WooCommerce?39:-1)}}function Ie(l,m){if(l&1){let e=T();t(0,"div",17)(1,"table",21)(2,"thead",22)(3,"tr",23),h(4,"th",24),t(5,"th",25),d(6,"Outlet"),n(),t(7,"th",25),d(8,"Number"),n(),t(9,"th",25),d(10,"Customer"),n(),t(11,"th"),d(12,"Items"),n(),t(13,"th",26),d(14,"Amount"),n(),t(15,"th",27),d(16,"Shipping"),n(),h(17,"th",28),n()(),t(18,"tbody"),A(19,Le,40,27,"tr",null,B),n()(),t(21,"app-custom-paginator",29),g("next",function(){p(e);let r=u();return c(r.initReadyToShip())})("previous",function(){p(e);let r=u();return c(r.initReadyToShip())}),n()()}if(l&2){let e=u(),i=F(0);a(19),z(i),a(2),f("filter",e.filter())("totaldata",i==null?null:i.length)}}function ke(l,m){l&1&&(t(0,"div",18),h(1,"app-empty-state"),n())}var mt=(()=>{let m=class m{constructor(){this.toastr=R(me),this.orderService=R(N),this.fulfillmentService=R(xe),this.channelType=de,this.selectedOrders=P([]),this.selectedChannelType=Z(()=>{let i=null;return this.selectedOrders().length>0&&(i=this.selectedOrders()[0].MarketType),i}),this.filter=P({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"}]}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:i=>{this.initFromDate(i)},error:i=>{console.error("Error fetching default date:",i),this.initFromDate(null)}})}initFromDate(i){this.filter.update(r=>L(V({},r),{From:i})),this.initReadyToShip()}initReadyToShip(){this.readyToShip$=this.orderService.getReadyToShipOrders(this.filter()).pipe(k(()=>{this.selectedOrders.set([])}),I(1))}onFilterChange(i){this.filter.update(r=>V(V({},r),i))}onSetFulfillment(i){this.fulfillmentService.setFulfillmentOrder(i).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}refreshShippingAndRefNumber(i){this.orderService.refreshShippingCourier(i.ShopID,i.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),this.initReadyToShip()})}setMultipleFulfillment(){this.fulfillmentService.setFulfillmentMultipleOrders(this.selectedOrders()).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}onSelectOrder(i){let r=i.filter(o=>o.selected);this.selectedOrders.set(r)}onMouseHover(i,r){(!r.LogisticService?.Name||!r.ReferenceNumber)&&this.contextMenuEl.show(i,r)}onSelectContextItem(i){i.item?.id==="refresh"&&this.refreshShippingAndRefNumber(i.data)}};m.\u0275fac=function(r){return new(r||m)},m.\u0275cmp=D({type:m,selectors:[["app-ready-to-ship"]],viewQuery:function(r,o){if(r&1&&H(we,5),r&2){let _;Q(_=j())&&(o.contextMenuEl=_.first)}},features:[J([N])],decls:37,vars:14,consts:[["contextMenu",""],["headerTitle","To Ship","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],[1,"btn","btn-outline-secondary","shadow","rounded"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","100px"],[2,"width","150px"],["rowCountApi","/api/orders/toshipcount",3,"next","previous","filter","totaldata"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"actions-cell"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem"],["matTooltip","Retrieve shipping courier and reference number",1,"btn","btn-icon-only",3,"click"],[1,"fa-solid","fa-arrows-rotate","fs-6"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(r,o){if(r&1){let _=T();U(0),M(1,"async"),t(2,"mainpanel",1),g("onSubmit",function(){return p(_),c(o.initReadyToShip())}),y("textChange",function(s){return p(_),S(o.filter().Number,s)||(o.filter().Number=s),c(s)}),t(3,"actions"),v(4,Re,2,0,"button",2),t(5,"a",3),h(6,"i",4),t(7,"span"),d(8,"Order Fulfillment Display"),n()()(),t(9,"filters")(10,"div")(11,"label",5),d(12,"Channel"),n(),t(13,"app-channel-options-v2",6),y("ngModelChange",function(s){return p(_),S(o.filter().ListChannelID,s)||(o.filter().ListChannelID=s),c(s)}),n()(),t(14,"div",7)(15,"label",5),d(16,"From/To"),n(),t(17,"div",8)(18,"datepicker",9),y("dateChange",function(s){return p(_),S(o.filter().From,s)||(o.filter().From=s),c(s)}),n()(),t(19,"div")(20,"datepicker",10),y("dateChange",function(s){return p(_),S(o.filter().To,s)||(o.filter().To=s),c(s)}),n()()(),t(21,"div",7)(22,"label",11),d(23,"Page Number"),n(),t(24,"input",12),y("ngModelChange",function(s){return p(_),S(o.filter().PageNumber,s)||(o.filter().PageNumber=s),c(s)}),n()(),t(25,"div",7)(26,"label",11),d(27,"Page Size"),n(),t(28,"input",13),y("ngModelChange",function(s){return p(_),S(o.filter().PageSize,s)||(o.filter().PageSize=s),c(s)}),n()()(),t(29,"content")(30,"div",14)(31,"div",15)(32,"div",16),v(33,Ie,22,2,"div",17)(34,ke,2,0,"div",18),n()()()()(),t(35,"app-context-menu",19,0),g("onSelectItem",function(s){return p(_),c(o.onSelectContextItem(s))}),n()}if(r&2){let _=G(O(1,10,o.readyToShip$)||K(13,Me));a(2),C("text",o.filter().Number),a(2),x(o.selectedOrders().length>0?4:-1),a(9),f("multiple",!0),C("ngModel",o.filter().ListChannelID),a(5),C("date",o.filter().From),a(2),C("date",o.filter().To),a(4),C("ngModel",o.filter().PageNumber),a(4),C("ngModel",o.filter().PageSize),a(5),x(_.length>0?33:34),a(2),f("items",o.contextMenuItems)}},dependencies:[ie,_e,ue,fe,he,se,oe,ae,ne,re,le,Se,ye,be,ve,ce,pe,Te,ge,$,te,ee,Ce],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], div[_ngcontent-%COMP%]:hover.actions-cell .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"]});let l=m;return l})();export{mt as ReadyToShipComponent};
|