marketplacepos 5.33.3 → 5.33.5
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-AK46UZMO.js → chunk-3IIFBCEN.js} +1 -1
- package/Marketplace/{chunk-TBNR5NJS.js → chunk-4EMYM322.js} +1 -1
- package/Marketplace/{chunk-6IB7KPKP.js → chunk-4LQVVPLG.js} +1 -1
- package/Marketplace/{chunk-VHMDV7XB.js → chunk-567ET6EM.js} +1 -1
- package/Marketplace/{chunk-BOFVAVH7.js → chunk-5PONAF6B.js} +1 -1
- package/Marketplace/{chunk-YAVQ35MM.js → chunk-5RLTRTFU.js} +1 -1
- package/Marketplace/{chunk-JYRTO7M3.js → chunk-7CGLVYCD.js} +1 -1
- package/Marketplace/{chunk-M4DRRFIZ.js → chunk-7H7JW7PT.js} +1 -1
- package/Marketplace/{chunk-7OCXVLNV.js → chunk-7YB72345.js} +1 -1
- package/Marketplace/{chunk-WQOM5LDR.js → chunk-ACABNDTE.js} +1 -1
- package/Marketplace/{chunk-VEJSM4DU.js → chunk-BYK5U3CK.js} +2 -2
- package/Marketplace/{chunk-JA3YPIEI.js → chunk-DCN33TBW.js} +1 -1
- package/Marketplace/{chunk-KVFB6XBL.js → chunk-DSIDFS5M.js} +1 -1
- package/Marketplace/{chunk-6LYDZOAJ.js → chunk-FOXW4EWP.js} +1 -1
- package/Marketplace/{chunk-MCYU6XCA.js → chunk-K6JM3GJS.js} +1 -1
- package/Marketplace/{chunk-MM4YTMYD.js → chunk-K73J4PMO.js} +1 -1
- package/Marketplace/{chunk-4YUEEL6J.js → chunk-KR3QY42G.js} +1 -1
- package/Marketplace/{chunk-AZZYTM37.js → chunk-KSMHDTW4.js} +10 -2
- package/Marketplace/{chunk-X2UZ26AC.js → chunk-OXH33ST3.js} +1 -1
- package/Marketplace/{chunk-YVN2BEFU.js → chunk-QGAR7VQ4.js} +1 -1
- package/Marketplace/{chunk-MRTUGQ56.js → chunk-QPDRGXE6.js} +1 -1
- package/Marketplace/{chunk-2VO6Y2JY.js → chunk-QZINW5VX.js} +1 -1
- package/Marketplace/{chunk-HUC4WXNS.js → chunk-RCM7O4DG.js} +1 -1
- package/Marketplace/{chunk-6KZX5MHR.js → chunk-RO4MJFRL.js} +1 -1
- package/Marketplace/{chunk-EPWKKU4V.js → chunk-SIDT3QSA.js} +1 -1
- package/Marketplace/{chunk-DODVHXOC.js → chunk-T3Z545C5.js} +1 -1
- package/Marketplace/{chunk-H4I5VT2Y.js → chunk-TQFRU756.js} +1 -1
- package/Marketplace/{chunk-DDDZ234H.js → chunk-W5AINSNN.js} +1 -1
- package/Marketplace/{chunk-HHQCIJX5.js → chunk-W7SVLKHL.js} +1 -1
- package/Marketplace/{chunk-VRXNR7QX.js → chunk-X5LNHB6B.js} +1 -1
- package/Marketplace/{chunk-3CPUV2QC.js → chunk-YVF7TRTO.js} +1 -1
- package/Marketplace/{chunk-RCYZRSCU.js → chunk-YWBWW4KH.js} +1 -1
- package/Marketplace/{chunk-ZYY6USWK.js → chunk-ZUUFTWA7.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-ZOCGLFVD.js → main-IP6IXXME.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as he}from"./chunk-3LR4RLA6.js";import"./chunk-O4CRP4WO.js";import{a as ce}from"./chunk-
|
|
1
|
+
import{a as he}from"./chunk-3LR4RLA6.js";import"./chunk-O4CRP4WO.js";import{a as ce}from"./chunk-TQFRU756.js";import{a as se}from"./chunk-7LZ5ZSXM.js";import{a as N}from"./chunk-XHAXYWZ7.js";import{b as pe,c as V}from"./chunk-7XUSMPAA.js";import"./chunk-BVIRHZTZ.js";import"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-IJYSJN63.js";import"./chunk-X5Q6FPWS.js";import"./chunk-46AOM3SM.js";import"./chunk-JXTGH22T.js";import"./chunk-OULUJ2IO.js";import"./chunk-GCKSYCMI.js";import{a as le}from"./chunk-ZQWAIH5X.js";import"./chunk-ADRVUMMW.js";import"./chunk-LUY3WZJE.js";import"./chunk-HCDKYABV.js";import{j as M}from"./chunk-QGAR7VQ4.js";import{b as te,e as ne}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{d as ie,l as ae,m as oe,n as re}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{c as q,h as X,m as Y,o as Z,y as ee}from"./chunk-BSN7ZAXG.js";import{c as f}from"./chunk-47DMD3UG.js";import"./chunk-OVEJFFL6.js";import{$b as C,Cd as K,Da as P,Ea as w,Eb as _,G as B,Gb as d,Gc as y,Hc as b,Sb as c,Tb as p,Ub as U,Vb as G,Wb as W,Xb as H,Yb as F,bc as g,ea as k,ja as j,jb as h,kb as u,nc as v,pa as I,rc as L,sc as T,ta as A,tc as E,uc as z,vc as $,vd as Q,xb as D,yd as J}from"./chunk-PQDPS2ID.js";import{a as R,b as x}from"./chunk-GNOSNGXM.js";var O=(()=>{let r=class r{constructor(){this.authService=I(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.filter(o=>f.IsNotEmpty(o?.parent?.id)).map(o=>o?.parent?.id).filter((o,s,S)=>S.indexOf(o)===s)):(e=[],n=[]),a=i.map(o=>o.id),a=a.concat(n).filter((o,s,S)=>S.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 me(l,r){if(l&1){let m=F();c(0,"button",15),C("click",function(){P(m);let i=g().ngIf,e=g();return w(e.onUpdateItems(i))}),U(1,"i",16),v(2," Update "),p()}}function ue(l,r){if(l&1&&(c(0,"actions")(1,"div",13),_(2,me,3,0,"button",14),p()()),l&2){let m=r.ngIf,t=g();h(2),d("ngIf",t.productService.hasSelectionVariant(m))}}function ge(l,r){l&1&&H(0)}function Ce(l,r){if(l&1){let m=F();G(0),c(1,"app-table",17),C("onToggle",function(i){P(m);let e=g();return w(e.onShowDifferenceStock(i))})("onSubmit",function(i){P(m);let e=g();return w(e.updateStockByVariant(i))}),p(),W()}if(l&2){let m=r.ngIf,t=g();h(),d("data",m)("channel",t.channels())("showProductToggle",!0)("hiddenIPOSInventory",t.searchFilter.HiddenIPOSInventory)}}var Qe=(()=>{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=I(V),this.multiChannelService=I(O),this.searchFilter={PageNumber:1,RowCount:100},this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.selectedLocations=D([]),this.selectedChannels=D([]),this.channels=D([]),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:N.ALL,RowCount:t.Filter.PageSize,HiddenIPOSInventory:t.Filter.HiddenIPOSInventory},this.searchFilter=t.Filter,this.mainPanelService.openModalFilter()}))}onChannelChange(t=[]){let i=t.filter(n=>f.isValidGUID(n.id)==!1),e=t.filter(n=>f.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(S=>{n.push({ID:s.ID,Code:s.Code,Inventory:s.Inventory,LocationID:S.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=N.DIFFERENCE:this.searchFilter.filterModel=N.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:"400px"}).afterClosed().pipe(B(n=>f.IsNotEmpty(n))).subscribe(n=>{this.updateStock(t,n)})}};r.\u0275fac=function(i){return new(i||r)(u(ne),u(te),u(ie),u(le),u(M),u(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)}),_(1,ue,3,1,"actions",1),y(2,"async"),c(3,"filters"),_(4,ge,1,0,"ng-container",1),y(5,"async"),c(6,"div")(7,"label",2),v(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),v(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),v(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),_(22,Ce,2,4,"ng-container",1),y(23,"async"),c(24,"infinite-paginator",12),y(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",b(2,14,e.paginationService.data$)),h(3),d("ngIf",b(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",b(23,18,e.paginationService.data$)),h(2),d("totalData",e.paginationService.totalData())("hideCount",e.paginationService.hideCount())("rowCount",b(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{Qe as MultiChannelComparison};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _}from"./chunk-J5D7PMX5.js";import"./chunk-6U6JR5K6.js";import{a as de,b as ce}from"./chunk-X2TVRY2Z.js";import"./chunk-MY4B7K3R.js";import"./chunk-FGPSBTFS.js";import"./chunk-ADRVUMMW.js";import{a as R}from"./chunk-JYRTO7M3.js";import"./chunk-FMV4LYKN.js";import"./chunk-HCDKYABV.js";import"./chunk-YVN2BEFU.js";import{e as se}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{m as D,n as pe}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{y as me}from"./chunk-BSN7ZAXG.js";import{c as f}from"./chunk-47DMD3UG.js";import{n as oe,p as ae,r as le}from"./chunk-OVEJFFL6.js";import{$b as b,Bc as ee,Bd as re,Ca as q,Cd as ne,Eb as v,Gb as p,Gc as A,Hc as j,Kb as X,Sb as o,Tb as a,Ub as C,Xb as Y,Z as V,bc as T,ea as H,ec as U,gb as G,ja as J,jb as m,ka as Q,kb as h,nc as c,oa as K,oc as N,pc as Z,rc as u,sc as y,ta as S,tc as g,ua as z,ud as te,vd as P,wc as $,yd as ie,zd as w}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var fe=(()=>{let r=class r{constructor(){this.reportTabs=[{Title:"1.Create Order",Url:"/menu/sync-log/order/sync-order"},{Title:"2.Convert Order To Invoice",Url:"/menu/sync-log/order/convert-to-invoice"},{Title:"3.Create Invoice",Url:"/menu/sync-log/order/invoice"},{Title:"4.Create Outbound Logistic",Url:"/menu/sync-log/order/delivery"},{Title:"5.Add Payment",Url:"/menu/sync-log/order/payment"},{Title:"6.Void Invoice",Url:"/menu/sync-log/order/void-invoice"},{Title:"All",Url:"/menu/sync-log/order/all"}]}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=S({type:r,selectors:[["app-order"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(i,t){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),a()()(),C(4,"router-outlet")),i&2&&(m(3),p("Tabs",t.reportTabs))},dependencies:[de,oe],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]});let n=r;return n})();var F=class{};var I=(()=>{let r=class r{constructor(e){this.http=e}GetLoader(){return this.http.post("/api/Report/GetLoader",{})}GetSyncOrder(e){return new Promise((i,t)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/CreateInvoice",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncVoidInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/Void",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncConvertInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/ConvertToInvoice",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncDelivery(e){return new Promise((i,t)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncPayment(e){return new Promise((i,t)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(d=>{i(d)})})}getAllReport(e){return this.http.post("/api/Report/all",JSON.stringify(e))}};r.\u0275fac=function(i){return new(i||r)(K(se))},r.\u0275prov=J({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var L=function(n){return n[n.OK=200]="OK",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.CONFLICT=409]="CONFLICT",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n}(L||{});var _e=()=>["/menu/log/order"],Fe=(n,r,s,e,i)=>({responseCode:n,From:r,to:s,actionType:e,ChannelID:i});function be(n,r){if(n&1&&(o(0,"th",9)(1,"div",10)(2,"h4"),c(3),a(),o(4,"small",11),c(5),a()()()),n&2){let s=r.$implicit,e=T();m(3),N(s),m(),X(e.getTextBgColor(s)),m(),N(e.getHeaderStatusDesc(s))}}function Pe(n,r){if(n&1&&(o(0,"td",14)(1,"a",15),c(2),a()()),n&2){let s=r.$implicit,e=T().$implicit,i=T();m(),p("routerLink",$(3,_e))("queryParams",ee(4,Fe,s.Key,i.fromQueryParam,i.toQueryParam,i.type,e.ChannelID)),m(),Z(" ",s.Value," ")}}function we(n,r){if(n&1&&(o(0,"tr")(1,"td")(2,"a",12),C(3,"img",13),a()(),o(4,"td")(5,"div")(6,"a",12),c(7),a()(),o(8,"div"),c(9),a()(),v(10,Pe,3,10,"td",8),a()),n&2){let s=r.$implicit,e=T();m(2),U("href",s.Url,G),m(),p("src",e.getChannelLogo(s.Type),G),m(3),U("href",s.Url,G),m(),N(s.Name),m(2),N(s.Url),m(),p("ngForOf",s.list)}}function De(n,r){if(n&1&&(o(0,"td",14)(1,"div",16),c(2),A(3,"number"),a()()),n&2){let s=r.$implicit;m(2),N(j(3,1,s.total))}}var E=(()=>{let r=class r{constructor(){this.type=null,this.headerStatus=L,this.listCalculationStatusCode=[]}set from(e){e&&(this.fromQueryParam=new Date(e).toJSON().toString())}set to(e){e&&(this.toQueryParam=new Date(e).toJSON().toString())}ngOnChanges(e){e.result&&this.calculateStatusCode()}getHeaderStatusDesc(e){let i=null;switch(e){case L.BAD_REQUEST:i="BAD REQUEST";break;case L.CONFLICT:i="CONFLICT";break;case L.INTERNAL_SERVER_ERROR:i="INTERNAL SERVER ERROR";break;case L.NOT_FOUND:i="NOT FOUND";break;default:i="OK";break}return i}getTextBgColor(e){let i=null;switch(e){case L.OK:i="bg-success";break;case L.INTERNAL_SERVER_ERROR:i="bg-danger";break;default:i="bg-warning";break}return i}getChannelLogo(e){return f.getChannelLogoByTypeId(e)}calculateStatusCode(){if(this.listCalculationStatusCode=[],this.result){let e,i;this.concatStatusCode().forEach(t=>{e=this.listCalculationStatusCode.findIndex(d=>d.status==t.Key),i=e!==-1,i?this.listCalculationStatusCode[e].total+=t.Value:this.listCalculationStatusCode=[...this.listCalculationStatusCode,{status:t.Key,total:t.Value}]})}}concatStatusCode(){return this.result.map(e=>e.list).reduce((e,i)=>[...e,...i])}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=S({type:r,selectors:[["app-table-report"]],inputs:{header:"header",result:"result",from:"from",to:"to",type:"type"},features:[q],decls:15,vars:3,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","5%"],["class","text-start","style","width: 10%;",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],["colspan","2"],[1,"text-center","h3","fw-bold"],["class","text-start",4,"ngFor","ngForOf"],[1,"text-start",2,"width","10%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],[1,"text-start"],[1,"h3","text-primary","fw-bold","ms-1",3,"routerLink","queryParams"],[1,"d-inline-block","h3","text-primary","fw-bold","ms-1"]],template:function(i,t){i&1&&(o(0,"table",0)(1,"thead",1)(2,"tr"),C(3,"th",2),o(4,"th",3),c(5,"Channel"),a(),v(6,be,6,4,"th",4),a()(),o(7,"tbody"),v(8,we,11,6,"tr",5),a(),o(9,"tfoot")(10,"tr")(11,"td",6)(12,"div",7),c(13,"Total"),a()(),v(14,De,4,3,"td",8),a()()()),i&2&&(m(6),p("ngForOf",t.header),m(2),p("ngForOf",t.result),m(6),p("ngForOf",t.listCalculationStatusCode))},dependencies:[te,ae,re],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]});let n=r;return n})();function Ie(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",0)}}var he=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.pageTitle="New Order";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-sales-order"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.getChannelLogs()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Ie,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.pageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Ee(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",1)}}var ue=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-invoice"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Ee,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Oe(n,r){if(n&1&&(o(0,"div",8)(1,"div",9),C(2,"app-table-report",10),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",3)}}var ye=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F;let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-delivery"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"filterDate"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div",1)(3,"label",2),c(4,"From/To"),a(),o(5,"div",3)(6,"datepicker",4),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",5),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",6),v(11,Oe,3,5,"div",7),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Le(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",4)}}var ge=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Completed";let t=new Date;this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-payment"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Le,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Re(n,r){n&1&&Y(0)}function Me(n,r){if(n&1&&(o(0,"div",8)(1,"div",9),C(2,"app-table-report",10),a()()),n&2){let s=r.ngIf,e=T();m(2),p("result",s.Body)("header",s.Header)("from",e.filter==null?null:e.filter.From)("to",e.filter==null?null:e.filter.To)}}var ve=(()=>{let r=class r{constructor(e,i){this.reportOrderService=e,this.datePipe=i,this.filter=new F}ngOnInit(){this.initFilter(),this.initLoader()}initFilter(){let e=new Date;this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`All (${e==null?"":i+"-"} ${t})`}initLoader(){this.pageLoader$=this.reportOrderService.GetLoader().pipe(H(e=>{this.filter=e,this.updatePageTitle(),this.initData()}))}initData(){this.reportData$=this.reportOrderService.getAllReport(this.filter).pipe(V())}onFilter(){this.updatePageTitle(),this.initData()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-all"]],decls:15,vars:10,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[4,"ngIf"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Re,1,0,"ng-container",6),A(12,"async"),v(13,Me,3,4,"div",7),A(14,"async"),a()()()),i&2&&(p("headerTitle",t.pageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",j(12,6,t.pageLoader$)),m(2),p("ngIf",j(14,8,t.reportData$)))},dependencies:[P,D,_,E,ie]});let n=r;return n})();function ke(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",1)}}var Ce=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Convert Sales Order To Invoice";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Convert Sales Order To Invoice (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-convert-invoice"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,ke,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function xe(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",1)}}var Te=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-void-invoice"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,xe,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();var Ne=[{path:"",component:fe,children:[{path:"",redirectTo:"all",pathMatch:"full"},{path:"sync-order",component:he,canActivate:[R],data:{title:"Sync Order"}},{path:"convert-to-invoice",component:Ce,canActivate:[R],data:{title:"Sync Convert to Invoice"}},{path:"invoice",component:ue,canActivate:[R],data:{title:"Sync Invoice"}},{path:"delivery",component:ye,canActivate:[R],data:{title:"Sync Delivery"}},{path:"payment",component:ge,canActivate:[R],data:{title:"Sync Payment"}},{path:"void-invoice",component:Te,canActivate:[R],data:{title:"Sync void invoice"}},{path:"all",component:ve,canActivate:[R],data:{title:"All Report"}}]}],Et=(()=>{let r=class r{};r.\u0275fac=function(i){return new(i||r)},r.\u0275mod=z({type:r}),r.\u0275inj=Q({imports:[ne,ce,me,pe,_,le.forChild(Ne)]});let n=r;return n})();export{Et as OrderModule};
|
|
1
|
+
import{a as _}from"./chunk-J5D7PMX5.js";import"./chunk-6U6JR5K6.js";import{a as de,b as ce}from"./chunk-X2TVRY2Z.js";import"./chunk-MY4B7K3R.js";import"./chunk-FGPSBTFS.js";import"./chunk-ADRVUMMW.js";import{a as R}from"./chunk-7CGLVYCD.js";import"./chunk-FMV4LYKN.js";import"./chunk-HCDKYABV.js";import"./chunk-QGAR7VQ4.js";import{e as se}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{m as D,n as pe}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{y as me}from"./chunk-BSN7ZAXG.js";import{c as f}from"./chunk-47DMD3UG.js";import{n as oe,p as ae,r as le}from"./chunk-OVEJFFL6.js";import{$b as b,Bc as ee,Bd as re,Ca as q,Cd as ne,Eb as v,Gb as p,Gc as A,Hc as j,Kb as X,Sb as o,Tb as a,Ub as C,Xb as Y,Z as V,bc as T,ea as H,ec as U,gb as G,ja as J,jb as m,ka as Q,kb as h,nc as c,oa as K,oc as N,pc as Z,rc as u,sc as y,ta as S,tc as g,ua as z,ud as te,vd as P,wc as $,yd as ie,zd as w}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var fe=(()=>{let r=class r{constructor(){this.reportTabs=[{Title:"1.Create Order",Url:"/menu/sync-log/order/sync-order"},{Title:"2.Convert Order To Invoice",Url:"/menu/sync-log/order/convert-to-invoice"},{Title:"3.Create Invoice",Url:"/menu/sync-log/order/invoice"},{Title:"4.Create Outbound Logistic",Url:"/menu/sync-log/order/delivery"},{Title:"5.Add Payment",Url:"/menu/sync-log/order/payment"},{Title:"6.Void Invoice",Url:"/menu/sync-log/order/void-invoice"},{Title:"All",Url:"/menu/sync-log/order/all"}]}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=S({type:r,selectors:[["app-order"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(i,t){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),a()()(),C(4,"router-outlet")),i&2&&(m(3),p("Tabs",t.reportTabs))},dependencies:[de,oe],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]});let n=r;return n})();var F=class{};var I=(()=>{let r=class r{constructor(e){this.http=e}GetLoader(){return this.http.post("/api/Report/GetLoader",{})}GetSyncOrder(e){return new Promise((i,t)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/CreateInvoice",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncVoidInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/Void",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncConvertInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/ConvertToInvoice",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncDelivery(e){return new Promise((i,t)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncPayment(e){return new Promise((i,t)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(d=>{i(d)})})}getAllReport(e){return this.http.post("/api/Report/all",JSON.stringify(e))}};r.\u0275fac=function(i){return new(i||r)(K(se))},r.\u0275prov=J({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var L=function(n){return n[n.OK=200]="OK",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.CONFLICT=409]="CONFLICT",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n}(L||{});var _e=()=>["/menu/log/order"],Fe=(n,r,s,e,i)=>({responseCode:n,From:r,to:s,actionType:e,ChannelID:i});function be(n,r){if(n&1&&(o(0,"th",9)(1,"div",10)(2,"h4"),c(3),a(),o(4,"small",11),c(5),a()()()),n&2){let s=r.$implicit,e=T();m(3),N(s),m(),X(e.getTextBgColor(s)),m(),N(e.getHeaderStatusDesc(s))}}function Pe(n,r){if(n&1&&(o(0,"td",14)(1,"a",15),c(2),a()()),n&2){let s=r.$implicit,e=T().$implicit,i=T();m(),p("routerLink",$(3,_e))("queryParams",ee(4,Fe,s.Key,i.fromQueryParam,i.toQueryParam,i.type,e.ChannelID)),m(),Z(" ",s.Value," ")}}function we(n,r){if(n&1&&(o(0,"tr")(1,"td")(2,"a",12),C(3,"img",13),a()(),o(4,"td")(5,"div")(6,"a",12),c(7),a()(),o(8,"div"),c(9),a()(),v(10,Pe,3,10,"td",8),a()),n&2){let s=r.$implicit,e=T();m(2),U("href",s.Url,G),m(),p("src",e.getChannelLogo(s.Type),G),m(3),U("href",s.Url,G),m(),N(s.Name),m(2),N(s.Url),m(),p("ngForOf",s.list)}}function De(n,r){if(n&1&&(o(0,"td",14)(1,"div",16),c(2),A(3,"number"),a()()),n&2){let s=r.$implicit;m(2),N(j(3,1,s.total))}}var E=(()=>{let r=class r{constructor(){this.type=null,this.headerStatus=L,this.listCalculationStatusCode=[]}set from(e){e&&(this.fromQueryParam=new Date(e).toJSON().toString())}set to(e){e&&(this.toQueryParam=new Date(e).toJSON().toString())}ngOnChanges(e){e.result&&this.calculateStatusCode()}getHeaderStatusDesc(e){let i=null;switch(e){case L.BAD_REQUEST:i="BAD REQUEST";break;case L.CONFLICT:i="CONFLICT";break;case L.INTERNAL_SERVER_ERROR:i="INTERNAL SERVER ERROR";break;case L.NOT_FOUND:i="NOT FOUND";break;default:i="OK";break}return i}getTextBgColor(e){let i=null;switch(e){case L.OK:i="bg-success";break;case L.INTERNAL_SERVER_ERROR:i="bg-danger";break;default:i="bg-warning";break}return i}getChannelLogo(e){return f.getChannelLogoByTypeId(e)}calculateStatusCode(){if(this.listCalculationStatusCode=[],this.result){let e,i;this.concatStatusCode().forEach(t=>{e=this.listCalculationStatusCode.findIndex(d=>d.status==t.Key),i=e!==-1,i?this.listCalculationStatusCode[e].total+=t.Value:this.listCalculationStatusCode=[...this.listCalculationStatusCode,{status:t.Key,total:t.Value}]})}}concatStatusCode(){return this.result.map(e=>e.list).reduce((e,i)=>[...e,...i])}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=S({type:r,selectors:[["app-table-report"]],inputs:{header:"header",result:"result",from:"from",to:"to",type:"type"},features:[q],decls:15,vars:3,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","5%"],["class","text-start","style","width: 10%;",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],["colspan","2"],[1,"text-center","h3","fw-bold"],["class","text-start",4,"ngFor","ngForOf"],[1,"text-start",2,"width","10%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],[1,"text-start"],[1,"h3","text-primary","fw-bold","ms-1",3,"routerLink","queryParams"],[1,"d-inline-block","h3","text-primary","fw-bold","ms-1"]],template:function(i,t){i&1&&(o(0,"table",0)(1,"thead",1)(2,"tr"),C(3,"th",2),o(4,"th",3),c(5,"Channel"),a(),v(6,be,6,4,"th",4),a()(),o(7,"tbody"),v(8,we,11,6,"tr",5),a(),o(9,"tfoot")(10,"tr")(11,"td",6)(12,"div",7),c(13,"Total"),a()(),v(14,De,4,3,"td",8),a()()()),i&2&&(m(6),p("ngForOf",t.header),m(2),p("ngForOf",t.result),m(6),p("ngForOf",t.listCalculationStatusCode))},dependencies:[te,ae,re],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]});let n=r;return n})();function Ie(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",0)}}var he=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.pageTitle="New Order";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-sales-order"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.getChannelLogs()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Ie,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.pageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Ee(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",1)}}var ue=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-invoice"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Ee,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Oe(n,r){if(n&1&&(o(0,"div",8)(1,"div",9),C(2,"app-table-report",10),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",3)}}var ye=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F;let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-delivery"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"filterDate"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div",1)(3,"label",2),c(4,"From/To"),a(),o(5,"div",3)(6,"datepicker",4),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",5),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",6),v(11,Oe,3,5,"div",7),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Le(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",4)}}var ge=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Completed";let t=new Date;this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-payment"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Le,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Re(n,r){n&1&&Y(0)}function Me(n,r){if(n&1&&(o(0,"div",8)(1,"div",9),C(2,"app-table-report",10),a()()),n&2){let s=r.ngIf,e=T();m(2),p("result",s.Body)("header",s.Header)("from",e.filter==null?null:e.filter.From)("to",e.filter==null?null:e.filter.To)}}var ve=(()=>{let r=class r{constructor(e,i){this.reportOrderService=e,this.datePipe=i,this.filter=new F}ngOnInit(){this.initFilter(),this.initLoader()}initFilter(){let e=new Date;this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`All (${e==null?"":i+"-"} ${t})`}initLoader(){this.pageLoader$=this.reportOrderService.GetLoader().pipe(H(e=>{this.filter=e,this.updatePageTitle(),this.initData()}))}initData(){this.reportData$=this.reportOrderService.getAllReport(this.filter).pipe(V())}onFilter(){this.updatePageTitle(),this.initData()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-all"]],decls:15,vars:10,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[4,"ngIf"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Re,1,0,"ng-container",6),A(12,"async"),v(13,Me,3,4,"div",7),A(14,"async"),a()()()),i&2&&(p("headerTitle",t.pageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",j(12,6,t.pageLoader$)),m(2),p("ngIf",j(14,8,t.reportData$)))},dependencies:[P,D,_,E,ie]});let n=r;return n})();function ke(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",1)}}var Ce=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Convert Sales Order To Invoice";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Convert Sales Order To Invoice (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-convert-invoice"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,ke,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function xe(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",1)}}var Te=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-void-invoice"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,xe,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();var Ne=[{path:"",component:fe,children:[{path:"",redirectTo:"all",pathMatch:"full"},{path:"sync-order",component:he,canActivate:[R],data:{title:"Sync Order"}},{path:"convert-to-invoice",component:Ce,canActivate:[R],data:{title:"Sync Convert to Invoice"}},{path:"invoice",component:ue,canActivate:[R],data:{title:"Sync Invoice"}},{path:"delivery",component:ye,canActivate:[R],data:{title:"Sync Delivery"}},{path:"payment",component:ge,canActivate:[R],data:{title:"Sync Payment"}},{path:"void-invoice",component:Te,canActivate:[R],data:{title:"Sync void invoice"}},{path:"all",component:ve,canActivate:[R],data:{title:"All Report"}}]}],Et=(()=>{let r=class r{};r.\u0275fac=function(i){return new(i||r)},r.\u0275mod=z({type:r}),r.\u0275inj=Q({imports:[ne,ce,me,pe,_,le.forChild(Ne)]});let n=r;return n})();export{Et as OrderModule};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as u}from"./chunk-
|
|
1
|
+
import{h as u}from"./chunk-QGAR7VQ4.js";import{b as h,e as g}from"./chunk-E3NPUJ23.js";import{ja as l,oa as c}from"./chunk-PQDPS2ID.js";var v=(()=>{let a=class a{constructor(r,t){this.toastrService=r,this.http=t}refreshInventory(r){let t=r.map(e=>e.Channel.map(n=>(n.VariantID=e.ID,n))).reduce((e,s)=>(e=e.concat(s),e),[]).map(e=>({ChannelItemID:e.ChannelItemID,ChannelID:e.ChannelID,VariantID:e.VariantID,ChannelVariationID:e.ChannelVariationID}));return this.http.post(u.RefreshInventory,t)}showToastrUpdateInventory(r,t,e){let s=t.length>0,n=e.length>0;if(!n&&s&&this.toastrService.success(`${this.generateSuccessMessage(t.length)}`,"Success",{enableHtml:!0}),n&&s){let o=`<li>${this.generateSuccessMessage(t.length)}</li>`,m=this.generateErrorMessage(r,e),p=`<ol>${o} ${m}</ol>`;this.toastrService.warning(p,"Warning",{enableHtml:!0})}if(n&&!s){let o=`<ol>${this.generateErrorMessage(r,e)}</ol>`;this.toastrService.error(o,"Error",{enableHtml:!0})}}generateSuccessMessage(r){return`
|
|
2
2
|
<div>
|
|
3
3
|
<span class="fw-bold">Successfully</span> updated ${r} variants in 1 channels
|
|
4
4
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as u}from"./chunk-X2TVRY2Z.js";import{a as f}from"./chunk-
|
|
1
|
+
import{b as u}from"./chunk-X2TVRY2Z.js";import{a as f}from"./chunk-7CGLVYCD.js";import"./chunk-QGAR7VQ4.js";import"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{n as l}from"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{y as d}from"./chunk-BSN7ZAXG.js";import"./chunk-47DMD3UG.js";import{n as c,r as m}from"./chunk-OVEJFFL6.js";import{Cd as n,Ub as a,ka as r,ta as s,ua as i}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var M=(()=>{let t=class t{constructor(){}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=s({type:t,selectors:[["app-report"]],decls:1,vars:0,template:function(e,O){e&1&&a(0,"router-outlet")},dependencies:[c],styles:["ul[_ngcontent-%COMP%] > li.dropdown-item[_ngcontent-%COMP%]{font-size:.6875rem!important}"]});let o=t;return o})();var y=[{path:"",component:M,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",loadChildren:()=>import("./chunk-4EMYM322.js").then(o=>o.OrderModule),canActivate:[f]}]}],C=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i({type:t}),t.\u0275inj=r({imports:[n,m.forChild(y)]});let o=t;return o})();var b=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i({type:t}),t.\u0275inj=r({imports:[n,u,C,d,l,m]});let o=t;return o})();export{b as ReportModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as se}from"./chunk-PD4CUVAW.js";import{c as ae}from"./chunk-UMNGKENU.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-CCXKODFV.js";import{j as X}from"./chunk-
|
|
1
|
+
import{b as se}from"./chunk-PD4CUVAW.js";import{c as ae}from"./chunk-UMNGKENU.js";import{a as Y,b as Z,d as ee,e as te}from"./chunk-CCXKODFV.js";import{j as X}from"./chunk-QGAR7VQ4.js";import{b as q,e as Q}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{m as oe,n as re}from"./chunk-BO4PPSB5.js";import{t as ie,u as ne}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{h as H,m as z,y as J}from"./chunk-BSN7ZAXG.js";import{b as d,c as G}from"./chunk-47DMD3UG.js";import{r as y}from"./chunk-OVEJFFL6.js";import{$b as E,Cd as b,Da as x,Ea as N,Eb as g,Gb as m,Gc as _,Hc as v,Sb as r,Tb as a,Ub as W,Vb as I,Wb as T,Yb as w,Z as M,aa as K,bc as h,ea as V,gb as B,jb as l,ka as f,kb as S,nc as c,oc as C,pc as R,q as F,rc as O,sc as P,ta as j,tc as D,ua as u,ud as $,v as L,vd as k,yd as A}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";function pe(n,t){if(n&1&&(r(0,"span",13),W(1,"img",14),a(),r(2,"span"),c(3),a()),n&2){let s=t.item;l(),m("src",s.Img,B)("alt",s.Name),l(2),R(" ",s.Name," ")}}function de(n,t){if(n&1){let s=w();I(0),r(1,"a",15),E("click",function(){let e=x(s).ngIf,o=h();return N(o.submitLogistics(e))}),c(2,"Submit"),a(),T()}}function ge(n,t){if(n&1){let s=w();I(0),r(1,"ng-select",16),D("ngModelChange",function(e){x(s);let o=h().$implicit;return P(o.ProductSKU,e)||(o.ProductSKU=e),N(e)}),a(),T()}if(n&2){let s=t.ngIf,i=h().$implicit;l(),O("ngModel",i.ProductSKU),m("items",s)}}function he(n,t){if(n&1&&(r(0,"tr")(1,"td"),c(2),a(),r(3,"td"),c(4),a(),r(5,"td"),c(6),a(),r(7,"td"),g(8,ge,2,2,"ng-container",4),_(9,"async"),a()()),n&2){let s=t.$implicit,i=h();l(2),C(s.Name),l(2),C(s.Service),l(2),C(s.TypeString),l(2),m("ngIf",v(9,4,i.logisticOptions$))}}var ce=(()=>{let t=class t{constructor(i,e,o){this.http=i,this.toastr=e,this.authService=o,this.filter={ChannelID:""},this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let i=[d.WooCommerce,d.Lazada,d.Shopify,d.Plugo,d.Tokopedia];this.channelOptions=this.channelOptions.map(e=>(i.forEach(o=>{e.TypeID===o&&(e.disabled=!0)}),e))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(i=>{this.filter=i.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(M(1))}submitLogistics(i){this.clonedLogisticServices$.pipe(L(e=>i.map(o=>(e.findIndex(p=>p.Name===o.Name&&p.ProductSKU==o.ProductSKU)==-1&&(o.IsChange=!0),o))),K(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(L(i=>i.map(e=>(e.ProductSKU=G.IsEmpty(e.ProductSKU)?null:e.ProductSKU,e))),V(i=>{let e=JSON.parse(JSON.stringify(i));this.clonedLogisticServices$=F(e)}),M(1))}iniTitle(){let i=this.channelOptions.find(e=>e.ID==this.filter.ChannelID);this.channelName=i?i.Name:null}};t.\u0275fac=function(e){return new(e||t)(S(Q),S(q),S(X))},t.\u0275cmp=j({type:t,selectors:[["app-logistic"]],decls:29,vars:11,consts:[["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,"ngIf"],[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"],[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"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(e,o){e&1&&(r(0,"mainpanel",0),E("onSubmit",function(){return o.getLogisticService()}),r(1,"filters")(2,"div")(3,"label",1),c(4,"Select a Channel"),a(),r(5,"ng-select",2),D("ngModelChange",function(p){return P(o.filter.ChannelID,p)||(o.filter.ChannelID=p),p}),g(6,pe,4,3,"ng-template",3),a()()(),r(7,"actions"),g(8,de,3,0,"ng-container",4),_(9,"async"),a(),r(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr",11)(18,"th"),c(19,"Logistic"),a(),r(20,"th"),c(21,"Service"),a(),r(22,"th"),c(23,"Type"),a(),r(24,"th"),c(25,"Logistic Service"),a()()(),r(26,"tbody"),g(27,he,10,6,"tr",12),_(28,"async"),a()()()()()()()()),e&2&&(m("headerTitle","Logistic Courier - "+o.channelName)("hideSearchDropdown",!1),l(5),m("clearable",!1)("items",o.channelOptions),O("ngModel",o.filter.ChannelID),l(3),m("ngIf",v(9,7,o.logisticServices$)),l(19),m("ngForOf",v(28,9,o.logisticServices$)))},dependencies:[$,k,H,z,oe,ee,Y,Z,ie,A]});let n=t;return n})();var fe=[{path:"",component:ce}],me=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=u({type:t}),t.\u0275inj=f({imports:[b,y.forChild(fe)]});let n=t;return n})();var ke=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=u({type:t}),t.\u0275inj=f({imports:[b,y,me,J,re,te,se,ae,ne]});let n=t;return n})();export{ke as LogisticModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-7H7JW7PT.js";import"./chunk-RENQ3YZH.js";import"./chunk-P5UOWO2P.js";import"./chunk-WT6W7RAQ.js";import"./chunk-BQ7NR3ET.js";import"./chunk-FMV4LYKN.js";import"./chunk-HCDKYABV.js";import"./chunk-CCXKODFV.js";import"./chunk-QGAR7VQ4.js";import"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import"./chunk-BO4PPSB5.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import"./chunk-BSN7ZAXG.js";import"./chunk-47DMD3UG.js";import"./chunk-OVEJFFL6.js";import"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";export{a as ChannelLogComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p}from"./chunk-
|
|
1
|
+
import{j as p}from"./chunk-QGAR7VQ4.js";import{b as l}from"./chunk-E3NPUJ23.js";import{o as c}from"./chunk-OVEJFFL6.js";import{ja as a,oa as r}from"./chunk-PQDPS2ID.js";var x=(()=>{let e=class e{constructor(s,t,i){this.toastr=s,this.authService=t,this.router=i}canActivate(s,t){let i=JSON.parse(window.localStorage.getItem("user")),u=new Date,n=!1;if(i!=null){let h=new Date(i.Token.expiredAt);u<h?n=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return n}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}};e.\u0275fac=function(t){return new(t||e)(r(l),r(p),r(c))},e.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"});let o=e;return o})();export{x as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as re}from"./chunk-RENQ3YZH.js";import{b as le}from"./chunk-P5UOWO2P.js";import{a as pe,b as me}from"./chunk-WT6W7RAQ.js";import{a as ee,b as te,d as ne,e as ie}from"./chunk-CCXKODFV.js";import{j as Z}from"./chunk-
|
|
1
|
+
import{a as re}from"./chunk-RENQ3YZH.js";import{b as le}from"./chunk-P5UOWO2P.js";import{a as pe,b as me}from"./chunk-WT6W7RAQ.js";import{a as ee,b as te,d as ne,e as ie}from"./chunk-CCXKODFV.js";import{j as Z}from"./chunk-QGAR7VQ4.js";import{e as Y}from"./chunk-E3NPUJ23.js";import{m as ae,n as oe}from"./chunk-BO4PPSB5.js";import{h as G,m as K,y as Q}from"./chunk-BSN7ZAXG.js";import{c as X}from"./chunk-47DMD3UG.js";import{$b as x,Ad as H,Cd as U,Da as P,Ea as R,Eb as u,Gb as h,Gc as c,Hc as d,Ic as J,Nb as B,Ob as T,Qb as $,Rb as F,Sb as a,Tb as o,Ub as f,Yb as j,Z as D,aa as w,bc as y,g as I,gb as v,ja as E,jb as p,nc as s,oc as C,pa as g,pc as b,rc as O,sc as q,ta as N,tc as z,uc as A,v as M,vc as V,yd as W,zd as k}from"./chunk-PQDPS2ID.js";import{a as S}from"./chunk-GNOSNGXM.js";var L=(()=>{let t=class t{constructor(){this.httpService=g(Y),this._pageination=new I({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(w(n=>this.getLogs$(n).pipe()))}getLogs$(n){return this.httpService.post("/api/Channel/GetChannelLogPaged",n)}onPaginationChange(n){let e=this._pageination.value;e.PageNumber=n.pageIndex+1,this._pageination.next(e)}onFilter(n){let e=this._pageination.value;e.PageNumber=1,e=S(S({},e),n),this._pageination.next(e)}};t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=E({token:t,factory:t.\u0275fac});let i=t;return i})();function ce(i,t){if(i&1&&(a(0,"span",10),f(1,"img",11),o(),s(2)),i&2){let l=t.item;p(),h("src",l.Img,v)("alt",l.Name),p(),b(" ",l.Name," ")}}function de(i,t){if(i&1&&(a(0,"tr")(1,"td"),f(2,"img",17),a(3,"span"),s(4),o()(),a(5,"td"),s(6),c(7,"json"),o(),a(8,"td"),s(9),c(10,"json"),o(),a(11,"td"),s(12),c(13,"date"),o()()),i&2){let l=t.$implicit;p(2),h("src",l.Img,v),p(2),b(" ",l.ChannelName," "),p(2),C(d(7,5,l.Request)),p(3),C(d(10,7,l.Response)),p(3),C(J(13,9,l.Created,"dd-MM-yyyy hh:mm:ss"))}}function he(i,t){if(i&1){let l=j();a(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),s(5,"Channel"),o(),a(6,"th"),s(7,"Request"),o(),a(8,"th"),s(9,"Response"),o(),a(10,"th",15),s(11,"Created"),o()()(),a(12,"tbody"),$(13,de,14,12,"tr",null,T),c(15,"async"),o()(),a(16,"mat-paginator",16),c(17,"async"),c(18,"async"),c(19,"async"),c(20,"async"),x("page",function(e){P(l);let r=y();return R(r.channelLogService.onPaginationChange(e))}),o()()}if(i&2){let l,n,e,r,m=y();p(13),F((l=d(15,3,m.channelLogs$))==null?null:l.Data),p(3),h("length",(n=d(17,5,m.channelLogs$))==null?null:n.Count)("pageSize",(e=d(18,7,m.filter$))==null?null:e.RowCount)("pageIndex",(r=d(19,9,m.filter$))!=null&&r.PageNumber?0:((r=d(20,11,m.filter$))==null?null:r.PageNumber)-1)}}function ge(i,t){i&1&&(a(0,"div",9),f(1,"app-empty-state"),o())}var ze=(()=>{let t=class t{constructor(){this.channelLogService=g(L),this.authService=g(Z),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(M(n=>(n.Data?n.Data=n.Data.map(e=>(e.Response=e.Response?JSON.parse(e.Response):"",e.Request=e.Request?JSON.parse(e.Request):"",e.Img=X.getChannelLogoByTypeId(e.TypeID),e)):n.Data=[],n)),D(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=N({type:t,selectors:[["app-channel-log"]],standalone:!0,features:[A([L]),V],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","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,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"]],template:function(e,r){if(e&1&&(a(0,"mainpanel",0),x("onSubmit",function(){return r.onSubmitFilter()}),a(1,"filters")(2,"div",1)(3,"div")(4,"label",2),s(5,"Channel"),o(),a(6,"ng-select",3),z("ngModelChange",function(_){return q(r.channelID,_)||(r.channelID=_),_}),u(7,ce,3,3,"ng-template",4),o()()()(),a(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,he,21,13,"div",8),c(13,"async"),u(14,ge,2,0,"div",9),o()()()()()),e&2){let m;h("hideSearchBox",!0),p(6),h("clearable",!0)("items",r.channelOptions),O("ngModel",r.channelID),p(6),B(((m=d(13,5,r.channelLogs$))==null||m.Data==null?null:m.Data.length)>0?12:14)}},dependencies:[U,W,H,k,oe,ae,re,me,pe,le,ie,ne,ee,te,Q,G,K]});let i=t;return i})();export{ze as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-H4I5VT2Y.js";import{a as Ue}from"./chunk-7LZ5ZSXM.js";import{a as X}from"./chunk-XHAXYWZ7.js";import{a as Ae,b as We,c as te}from"./chunk-7XUSMPAA.js";import{a as xe}from"./chunk-BVIRHZTZ.js";import{a as $e}from"./chunk-OSA3WANL.js";import{a as Ne}from"./chunk-7KG3DC5J.js";import{b as Re}from"./chunk-S2Z3ZGU7.js";import{a as Le}from"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-JXTGH22T.js";import"./chunk-GCKSYCMI.js";import{a as ke}from"./chunk-ZQWAIH5X.js";import"./chunk-ADRVUMMW.js";import{a as De,b as Oe,c as Ve}from"./chunk-UMNGKENU.js";import{a as Be}from"./chunk-LUY3WZJE.js";import"./chunk-HCDKYABV.js";import{a as ye,b as Ie,d as we,e as Fe}from"./chunk-CCXKODFV.js";import{j as K}from"./chunk-YVN2BEFU.js";import{b as Pe,e as be}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{d as Me,m as Ee,n as Te}from"./chunk-BO4PPSB5.js";import{t as H,u as J}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{a as Ce,b as fe,h as k,m as B,y as L}from"./chunk-BSN7ZAXG.js";import{c as G,e as Se,f as ve}from"./chunk-47DMD3UG.js";import"./chunk-OVEJFFL6.js";import{$b as g,Bd as he,Cd as N,Da as C,Ea as f,Eb as u,G as Z,Gb as s,Gc as y,Hc as T,Ic as de,Jb as ce,Jc as ee,Ma as Y,Nb as W,Ob as R,Pa as re,Qb as $,Rb as U,Sb as r,Tb as l,Ub as P,Vb as I,Wb as w,Yb as b,Z as q,bc as m,ea as ae,ec as se,gb as S,jb as c,kb as v,mc as Q,nc as p,oc as me,pa as A,pc as x,rc as F,sc as M,sd as _e,ta as D,tc as E,uc as j,ud as z,v as oe,vc as O,vd as ue,xb as le,xc as V,yc as pe,yd as ge}from"./chunk-PQDPS2ID.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:{title:"Updating Price",selectedItems:e,channels:this.channelOptions},width:"400px"}).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-TQFRU756.js";import{a as Ue}from"./chunk-7LZ5ZSXM.js";import{a as X}from"./chunk-XHAXYWZ7.js";import{a as Ae,b as We,c as te}from"./chunk-7XUSMPAA.js";import{a as xe}from"./chunk-BVIRHZTZ.js";import{a as $e}from"./chunk-OSA3WANL.js";import{a as Ne}from"./chunk-7KG3DC5J.js";import{b as Re}from"./chunk-S2Z3ZGU7.js";import{a as Le}from"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-JXTGH22T.js";import"./chunk-GCKSYCMI.js";import{a as ke}from"./chunk-ZQWAIH5X.js";import"./chunk-ADRVUMMW.js";import{a as De,b as Oe,c as Ve}from"./chunk-UMNGKENU.js";import{a as Be}from"./chunk-LUY3WZJE.js";import"./chunk-HCDKYABV.js";import{a as ye,b as Ie,d as we,e as Fe}from"./chunk-CCXKODFV.js";import{j as K}from"./chunk-QGAR7VQ4.js";import{b as Pe,e as be}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{d as Me,m as Ee,n as Te}from"./chunk-BO4PPSB5.js";import{t as H,u as J}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{a as Ce,b as fe,h as k,m as B,y as L}from"./chunk-BSN7ZAXG.js";import{c as G,e as Se,f as ve}from"./chunk-47DMD3UG.js";import"./chunk-OVEJFFL6.js";import{$b as g,Bd as he,Cd as N,Da as C,Ea as f,Eb as u,G as Z,Gb as s,Gc as y,Hc as T,Ic as de,Jb as ce,Jc as ee,Ma as Y,Nb as W,Ob as R,Pa as re,Qb as $,Rb as U,Sb as r,Tb as l,Ub as P,Vb as I,Wb as w,Yb as b,Z as q,bc as m,ea as ae,ec as se,gb as S,jb as c,kb as v,mc as Q,nc as p,oc as me,pa as A,pc as x,rc as F,sc as M,sd as _e,ta as D,tc as E,uc as j,ud as z,v as oe,vc as O,vd as ue,xb as le,xc as V,yc as pe,yd as ge}from"./chunk-PQDPS2ID.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:{title:"Updating Price",selectedItems:e,channels:this.channelOptions},width:"400px"}).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};
|