marketplacepos 5.48.1 → 5.48.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-ZRTEGBXK.js → chunk-2IASUYTM.js} +1 -1
- package/Marketplace/{chunk-D3VVBQYY.js → chunk-3JYZF65T.js} +1 -1
- package/Marketplace/{chunk-SJT5OMJM.js → chunk-3K2EKA5O.js} +1 -1
- package/Marketplace/{chunk-KB3CRZC5.js → chunk-5CHTDUME.js} +1 -1
- package/Marketplace/{chunk-BYTWGXP7.js → chunk-5KYN6Y7M.js} +1 -1
- package/Marketplace/{chunk-MRT6ZM2A.js → chunk-5X2L45XK.js} +1 -1
- package/Marketplace/{chunk-AAUBUT4Y.js → chunk-6OIMOM7S.js} +1 -1
- package/Marketplace/{chunk-IX6JJ6BJ.js → chunk-7DT7FQ2T.js} +1 -1
- package/Marketplace/{chunk-IWFUFVCC.js → chunk-7SB4C4PT.js} +1 -1
- package/Marketplace/{chunk-3LTTPECO.js → chunk-ADKAX3OO.js} +1 -1
- package/Marketplace/{chunk-6Z2CE7TK.js → chunk-AEVLZ7NS.js} +1 -1
- package/Marketplace/{chunk-HUECAZ5I.js → chunk-ALPG22RQ.js} +1 -1
- package/Marketplace/{chunk-PUUZQ4N5.js → chunk-B6F5PDL5.js} +1 -1
- package/Marketplace/{chunk-IYDRCUIT.js → chunk-C6JHPCLF.js} +1 -1
- package/Marketplace/{chunk-CG7UNGPF.js → chunk-CAZ7U2IL.js} +1 -1
- package/Marketplace/{chunk-SGTGXMFX.js → chunk-CBU473N2.js} +1 -1
- package/Marketplace/{chunk-QSBCJIQ3.js → chunk-CLQGGKN6.js} +1 -1
- package/Marketplace/{chunk-JKRH5WGR.js → chunk-DH5CXAEM.js} +1 -1
- package/Marketplace/{chunk-RASTACH2.js → chunk-FCFCTT5A.js} +1 -1
- package/Marketplace/{chunk-I3Q5TAIL.js → chunk-FRZCC6KZ.js} +1 -1
- package/Marketplace/{chunk-Q7MU7DBD.js → chunk-GVI6GJHY.js} +1 -1
- package/Marketplace/{chunk-TOATNIRC.js → chunk-GX6JPDQ5.js} +1 -1
- package/Marketplace/{chunk-XLNRT52E.js → chunk-H7GV5SNI.js} +1 -1
- package/Marketplace/{chunk-ZEF5FMYQ.js → chunk-HKHNRMPT.js} +1 -1
- package/Marketplace/{chunk-Q4AWQ7IC.js → chunk-I723PUUO.js} +1 -1
- package/Marketplace/{chunk-7WHUYSBD.js → chunk-IDH7MCR3.js} +1 -1
- package/Marketplace/{chunk-3TPMCGA5.js → chunk-J6BQDYXO.js} +1 -1
- package/Marketplace/{chunk-TLPRODFI.js → chunk-KSVJCX2D.js} +1 -1
- package/Marketplace/{chunk-IODYBTLK.js → chunk-KZSTYKIP.js} +1 -1
- package/Marketplace/{chunk-IU36PH6K.js → chunk-LABF6W37.js} +1 -1
- package/Marketplace/{chunk-NSBKRFO7.js → chunk-M65Z55OS.js} +1 -1
- package/Marketplace/{chunk-6ZE3KI6C.js → chunk-MKADKY44.js} +1 -1
- package/Marketplace/{chunk-ZVTFMONF.js → chunk-PLLHTY6O.js} +1 -1
- package/Marketplace/{chunk-RDS3OGH2.js → chunk-PZKN5FIT.js} +1 -1
- package/Marketplace/{chunk-WIYPRMVW.js → chunk-QCV5XC3U.js} +2 -2
- package/Marketplace/{chunk-64EV3KZS.js → chunk-RCBY7EIY.js} +1 -1
- package/Marketplace/{chunk-RXZ43ZSY.js → chunk-SZVL42NR.js} +1 -1
- package/Marketplace/{chunk-SFZDUON5.js → chunk-TIIGDXIJ.js} +2 -2
- package/Marketplace/{chunk-BJH4EGMC.js → chunk-UBTALPOC.js} +1 -1
- package/Marketplace/{chunk-XF2QZL6C.js → chunk-UCEZJNIL.js} +1 -1
- package/Marketplace/{chunk-327AAICB.js → chunk-VYQD3A3M.js} +1 -1
- package/Marketplace/{chunk-5G3OIF3V.js → chunk-WRK3ZHRX.js} +1 -1
- package/Marketplace/{chunk-GTIJJRTW.js → chunk-X6COQADC.js} +1 -1
- package/Marketplace/{chunk-X5X4R6MJ.js → chunk-XDBH7EGC.js} +1 -1
- package/Marketplace/{chunk-UIZJMH4U.js → chunk-XK4RP5MQ.js} +1 -1
- package/Marketplace/{chunk-GF6B54DH.js → chunk-Y77WYZ6Y.js} +1 -1
- package/Marketplace/{chunk-AFCA7VVG.js → chunk-ZUL6ZHSW.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-T7D6R6TU.js → main-YJKBQ3LW.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as he}from"./chunk-DHPNXR6E.js";import{a as le}from"./chunk-6XDT56RT.js";import"./chunk-SHUYFOQI.js";import{a as pe}from"./chunk-UIZJMH4U.js";import{a as se}from"./chunk-GG3MDS4C.js";import{c as ce,d as D,e as V}from"./chunk-S5R6MCNP.js";import{a as ie,b as ne,c as re,d as ae}from"./chunk-T7HRAMHR.js";import"./chunk-DAUML5UD.js";import"./chunk-DXYMG6QK.js";import"./chunk-O2YF5VGD.js";import"./chunk-63I3I3MX.js";import{a as te}from"./chunk-ZRTEGBXK.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import"./chunk-AAUBUT4Y.js";import{e as X}from"./chunk-6KWG6O5L.js";import{a as oe}from"./chunk-BYTWGXP7.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import{i as Q}from"./chunk-Q4AWQ7IC.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import{a as N}from"./chunk-AGBJEXIM.js";import{b as j,e as z}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{c as K}from"./chunk-JBEKD57G.js";import{d as Y,l as Z,m as $,n as ee}from"./chunk-EDEZ3JLR.js";import{A as J,c as G,h as k,m as x,o as q}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as U,l as W,m as H}from"./chunk-LNJUGHOX.js";import{$b as T,G as E,Gb as L,Ha as b,Mc as g,Qc as P,Rc as f,Sc as _,Tc as B,Z as O,Zc as A,bc as I,ea as R,gc as u,hc as a,hd as S,ic as p,id as y,jc as v,nb as h,qc as M,ra as c,vc as C,xa as l,xc as w,ya as s}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function de(m,d){if(m&1){let F=M();a(0,"button",16),C("click",function(){l(F);let n=w(),e=w();return s(e.onUpdateItems(n))}),v(1,"i",17),g(2," Update "),p()}}function me(m,d){if(m&1&&(a(0,"div"),T(1,de,3,0,"button",15),p()),m&2){let F=w();h(),I(F.productService.hasSelectionVariant(d)?1:-1)}}var Ke=(()=>{let d=class d{constructor(){this.http=c(z),this.toastr=c(j),this.dialog=c(Y),this.productService=c(te),this.authService=c(Q),this.placeholderService=c(re),this.infinitePagination=c(D),this.updateResHandling=c(V),this.mainPanelService=c(Z),this.channelOptions=b([]),this.searchFilter=b({PageNumber:1,RowCount:50,filterModel:1,text:"",ListChannelID:[],SearchType:ie.NameOnly,NumberFilterComparator:ne.Contains}),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(O()),this.searchPlaceholder=b("Search ...")}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(R(t=>{t.Filter={PageNumber:t.Filter.PageNumber,RowCount:t.Filter.RowCount,filterModel:1,SearchType:t.Filter.SearchType,NumberFilterComparator:t.Filter.NumberFilterComparator},this.initSearchPlaceholder(),this.searchFilter.set(t.Filter),this.mainPanelService.openModalFilter()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter().SearchType,this.searchFilter().NumberFilterComparator))}onShowDifferencePrice(t){let n=1;t&&(n=3),this.searchFilter.update(e=>(e.filterModel=n,e)),this.infinitePagination.reloadPagination(this.searchFilter())}onSearch(t){this.searchFilter.update(n=>(n.text=t,n)),this.infinitePagination.reloadPagination(this.searchFilter()),this.filterSelectedChannels(),this.initSearchPlaceholder()}onUpdateItems(t){let n=JSON.parse(JSON.stringify(this.channelOptions())),e=this.productService.selectedVariantProduct(t);this.dialog.open(se,{data:{title:"Updating Price",selectedItems:e,channels:n},width:"400px"}).afterClosed().pipe(E(r=>K.IsNotEmpty(r))).subscribe(r=>{this.channelOptions.set(r),this.updatePrice(t)})}filterSelectedChannels(){let n=this.authService.getChannels().filter(e=>this.searchFilter().ListChannelID?.indexOf(e.ID)!==-1);this.channelOptions.set(n)}updatePrice(t){let n=this.productService.selectedVariantProduct(t);if(n.length>0){let e=n.map(i=>({ID:i.ID,Code:i.Code,Price:i.UnitPrice})),o={ListChannelID:this.getSelectedChannels().map(i=>i.ID),ListPrice:e};this.http.post(N.UpdateChannelPrice,o).subscribe(i=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(i),this.resetSelectedChannels()})}}updatePriceByVariant(t){let n={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:t.Price-0,VariantID:t.ID};this.http.post(N.UpdatePriceById,n).subscribe(e=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(e)})}handlingUpdatePrice(t){let n=t?.Response?.success_list,e=t?.Response?.failure_list,r=this.getSelectedChannels();n?.length>0||e?.length>0?this.updateResHandling.responseHandling(n,e,"Price",r):this.toastr.error(t[0]?.Exception,"Error")}openExportDialog(){this.dialog.open(le,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter().PageNumber,rowCount:this.searchFilter().RowCount,filterExport:this.searchFilter(),getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}resetSelectedChannels(){this.channelOptions.update(t=>(t.forEach(n=>{n.selected=!1}),t))}getSelectedChannels(){return this.channelOptions().filter(t=>t.selected)}};d.\u0275fac=function(n){return new(n||d)},d.\u0275cmp=L({type:d,selectors:[["app-price-pos-channel"]],features:[A([D,W,he,V])],decls:34,vars:28,consts:[["headerTitle","Price Comparison","textButton","Search",3,"onSubmit","searchBoxPlaceHolder"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"mb-5"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(n,e){if(n&1){let r=M();B(0),S(1,"async"),a(2,"mainpanel",0),C("onSubmit",function(i){return l(r),s(e.onSearch(i))}),a(3,"actions")(4,"div",1),T(5,me,2,1,"div"),S(6,"async"),a(7,"button",2),C("click",function(){return l(r),s(e.openExportDialog())}),v(8,"i",3),a(9,"span"),g(10,"Export"),p()()()(),a(11,"filters")(12,"div",4)(13,"label",5),g(14,"Channel"),p(),a(15,"app-channel-options-v2",6),_("ngModelChange",function(i){return l(r),f(e.searchFilter().ListChannelID,i)||(e.searchFilter().ListChannelID=i),s(i)}),p()(),a(16,"div",4)(17,"filter-query-type",7),_("numberFilterComparatorChange",function(i){return l(r),f(e.searchFilter().NumberFilterComparator,i)||(e.searchFilter().NumberFilterComparator=i),s(i)})("searchTypeChange",function(i){return l(r),f(e.searchFilter().SearchType,i)||(e.searchFilter().SearchType=i),s(i)}),p()(),a(18,"div",4)(19,"label",8),g(20,"Page Number"),p(),a(21,"input",9),_("ngModelChange",function(i){return l(r),f(e.searchFilter().PageNumber,i)||(e.searchFilter().PageNumber=i),s(i)}),p()(),a(22,"div")(23,"label",8),g(24,"Page Size"),p(),a(25,"input",9),_("ngModelChange",function(i){return l(r),f(e.searchFilter().RowCount,i)||(e.searchFilter().RowCount=i),s(i)}),p()()(),a(26,"content")(27,"div",10)(28,"div",11)(29,"div",12)(30,"app-table",13),S(31,"async"),C("onToggle",function(i){return l(r),s(e.onShowDifferencePrice(i))})("onSubmit",function(i){return l(r),s(e.updatePriceByVariant(i))}),p(),a(32,"infinite-paginator",14),S(33,"async"),C("onNextPage",function(){return l(r),s(e.infinitePagination.onNextPage(e.searchFilter()))})("onLastPage",function(){return l(r),s(e.infinitePagination.onLastPage(e.searchFilter()))})("onGetRowCount",function(){return l(r),s(e.infinitePagination.getRowCount(e.searchFilter()))}),p()()()()()()}if(n&2){let r,o=y(1,20,e.loader$);h(2),u("searchBoxPlaceHolder",e.searchPlaceholder()),h(3),I((r=y(6,22,e.data$))?5:-1,r),h(10),u("multiple",!0),P("ngModel",e.searchFilter().ListChannelID),h(2),u("numberFilterComparatorOptions",o==null||o.Options==null?null:o.Options.SearchComparatorTypeOptions),P("numberFilterComparator",e.searchFilter().NumberFilterComparator),u("searchTypeOptions",o==null||o.Options==null?null:o.Options.SearchSKUOnlyOrSKUNameOptions),P("searchType",e.searchFilter().SearchType),h(4),P("ngModel",e.searchFilter().PageNumber),h(4),P("ngModel",e.searchFilter().RowCount),h(5),u("showProductToggle",!0)("data",y(31,24,e.data$))("channel",e.channelOptions())("hiddenIPOSInventory",!1),h(2),u("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",y(33,26,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}},dependencies:[H,J,G,q,k,x,ce,ee,$,pe,oe,X,ae,U],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let m=d;return m})();export{Ke as PricePosChannelComponent};
|
|
1
|
+
import{a as he}from"./chunk-DHPNXR6E.js";import{a as le}from"./chunk-6XDT56RT.js";import"./chunk-SHUYFOQI.js";import{a as pe}from"./chunk-XK4RP5MQ.js";import{a as se}from"./chunk-GG3MDS4C.js";import{c as ce,d as D,e as V}from"./chunk-S5R6MCNP.js";import{a as ie,b as ne,c as re,d as ae}from"./chunk-T7HRAMHR.js";import"./chunk-DAUML5UD.js";import"./chunk-DXYMG6QK.js";import"./chunk-O2YF5VGD.js";import"./chunk-63I3I3MX.js";import{a as te}from"./chunk-2IASUYTM.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import"./chunk-6OIMOM7S.js";import{e as X}from"./chunk-6KWG6O5L.js";import{a as oe}from"./chunk-5KYN6Y7M.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import{i as Q}from"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import{a as N}from"./chunk-AGBJEXIM.js";import{b as j,e as z}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{c as K}from"./chunk-JBEKD57G.js";import{d as Y,l as Z,m as $,n as ee}from"./chunk-EDEZ3JLR.js";import{A as J,c as G,h as k,m as x,o as q}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as U,l as W,m as H}from"./chunk-LNJUGHOX.js";import{$b as T,G as E,Gb as L,Ha as b,Mc as g,Qc as P,Rc as f,Sc as _,Tc as B,Z as O,Zc as A,bc as I,ea as R,gc as u,hc as a,hd as S,ic as p,id as y,jc as v,nb as h,qc as M,ra as c,vc as C,xa as l,xc as w,ya as s}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function de(m,d){if(m&1){let F=M();a(0,"button",16),C("click",function(){l(F);let n=w(),e=w();return s(e.onUpdateItems(n))}),v(1,"i",17),g(2," Update "),p()}}function me(m,d){if(m&1&&(a(0,"div"),T(1,de,3,0,"button",15),p()),m&2){let F=w();h(),I(F.productService.hasSelectionVariant(d)?1:-1)}}var Ke=(()=>{let d=class d{constructor(){this.http=c(z),this.toastr=c(j),this.dialog=c(Y),this.productService=c(te),this.authService=c(Q),this.placeholderService=c(re),this.infinitePagination=c(D),this.updateResHandling=c(V),this.mainPanelService=c(Z),this.channelOptions=b([]),this.searchFilter=b({PageNumber:1,RowCount:50,filterModel:1,text:"",ListChannelID:[],SearchType:ie.NameOnly,NumberFilterComparator:ne.Contains}),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(O()),this.searchPlaceholder=b("Search ...")}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(R(t=>{t.Filter={PageNumber:t.Filter.PageNumber,RowCount:t.Filter.RowCount,filterModel:1,SearchType:t.Filter.SearchType,NumberFilterComparator:t.Filter.NumberFilterComparator},this.initSearchPlaceholder(),this.searchFilter.set(t.Filter),this.mainPanelService.openModalFilter()}))}initSearchPlaceholder(){this.searchPlaceholder.set(this.placeholderService.generatePlaceholderBySearchType(this.searchFilter().SearchType,this.searchFilter().NumberFilterComparator))}onShowDifferencePrice(t){let n=1;t&&(n=3),this.searchFilter.update(e=>(e.filterModel=n,e)),this.infinitePagination.reloadPagination(this.searchFilter())}onSearch(t){this.searchFilter.update(n=>(n.text=t,n)),this.infinitePagination.reloadPagination(this.searchFilter()),this.filterSelectedChannels(),this.initSearchPlaceholder()}onUpdateItems(t){let n=JSON.parse(JSON.stringify(this.channelOptions())),e=this.productService.selectedVariantProduct(t);this.dialog.open(se,{data:{title:"Updating Price",selectedItems:e,channels:n},width:"400px"}).afterClosed().pipe(E(r=>K.IsNotEmpty(r))).subscribe(r=>{this.channelOptions.set(r),this.updatePrice(t)})}filterSelectedChannels(){let n=this.authService.getChannels().filter(e=>this.searchFilter().ListChannelID?.indexOf(e.ID)!==-1);this.channelOptions.set(n)}updatePrice(t){let n=this.productService.selectedVariantProduct(t);if(n.length>0){let e=n.map(i=>({ID:i.ID,Code:i.Code,Price:i.UnitPrice})),o={ListChannelID:this.getSelectedChannels().map(i=>i.ID),ListPrice:e};this.http.post(N.UpdateChannelPrice,o).subscribe(i=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(i),this.resetSelectedChannels()})}}updatePriceByVariant(t){let n={ID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariantID:t.ChannelVariationID,Price:t.Price-0,VariantID:t.ID};this.http.post(N.UpdatePriceById,n).subscribe(e=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(e)})}handlingUpdatePrice(t){let n=t?.Response?.success_list,e=t?.Response?.failure_list,r=this.getSelectedChannels();n?.length>0||e?.length>0?this.updateResHandling.responseHandling(n,e,"Price",r):this.toastr.error(t[0]?.Exception,"Error")}openExportDialog(){this.dialog.open(le,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter().PageNumber,rowCount:this.searchFilter().RowCount,filterExport:this.searchFilter(),getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}resetSelectedChannels(){this.channelOptions.update(t=>(t.forEach(n=>{n.selected=!1}),t))}getSelectedChannels(){return this.channelOptions().filter(t=>t.selected)}};d.\u0275fac=function(n){return new(n||d)},d.\u0275cmp=L({type:d,selectors:[["app-price-pos-channel"]],features:[A([D,W,he,V])],decls:34,vars:28,consts:[["headerTitle","Price Comparison","textButton","Search",3,"onSubmit","searchBoxPlaceHolder"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"mb-5"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[3,"numberFilterComparatorChange","searchTypeChange","numberFilterComparatorOptions","numberFilterComparator","searchTypeOptions","searchType"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(n,e){if(n&1){let r=M();B(0),S(1,"async"),a(2,"mainpanel",0),C("onSubmit",function(i){return l(r),s(e.onSearch(i))}),a(3,"actions")(4,"div",1),T(5,me,2,1,"div"),S(6,"async"),a(7,"button",2),C("click",function(){return l(r),s(e.openExportDialog())}),v(8,"i",3),a(9,"span"),g(10,"Export"),p()()()(),a(11,"filters")(12,"div",4)(13,"label",5),g(14,"Channel"),p(),a(15,"app-channel-options-v2",6),_("ngModelChange",function(i){return l(r),f(e.searchFilter().ListChannelID,i)||(e.searchFilter().ListChannelID=i),s(i)}),p()(),a(16,"div",4)(17,"filter-query-type",7),_("numberFilterComparatorChange",function(i){return l(r),f(e.searchFilter().NumberFilterComparator,i)||(e.searchFilter().NumberFilterComparator=i),s(i)})("searchTypeChange",function(i){return l(r),f(e.searchFilter().SearchType,i)||(e.searchFilter().SearchType=i),s(i)}),p()(),a(18,"div",4)(19,"label",8),g(20,"Page Number"),p(),a(21,"input",9),_("ngModelChange",function(i){return l(r),f(e.searchFilter().PageNumber,i)||(e.searchFilter().PageNumber=i),s(i)}),p()(),a(22,"div")(23,"label",8),g(24,"Page Size"),p(),a(25,"input",9),_("ngModelChange",function(i){return l(r),f(e.searchFilter().RowCount,i)||(e.searchFilter().RowCount=i),s(i)}),p()()(),a(26,"content")(27,"div",10)(28,"div",11)(29,"div",12)(30,"app-table",13),S(31,"async"),C("onToggle",function(i){return l(r),s(e.onShowDifferencePrice(i))})("onSubmit",function(i){return l(r),s(e.updatePriceByVariant(i))}),p(),a(32,"infinite-paginator",14),S(33,"async"),C("onNextPage",function(){return l(r),s(e.infinitePagination.onNextPage(e.searchFilter()))})("onLastPage",function(){return l(r),s(e.infinitePagination.onLastPage(e.searchFilter()))})("onGetRowCount",function(){return l(r),s(e.infinitePagination.getRowCount(e.searchFilter()))}),p()()()()()()}if(n&2){let r,o=y(1,20,e.loader$);h(2),u("searchBoxPlaceHolder",e.searchPlaceholder()),h(3),I((r=y(6,22,e.data$))?5:-1,r),h(10),u("multiple",!0),P("ngModel",e.searchFilter().ListChannelID),h(2),u("numberFilterComparatorOptions",o==null||o.Options==null?null:o.Options.SearchComparatorTypeOptions),P("numberFilterComparator",e.searchFilter().NumberFilterComparator),u("searchTypeOptions",o==null||o.Options==null?null:o.Options.SearchSKUOnlyOrSKUNameOptions),P("searchType",e.searchFilter().SearchType),h(4),P("ngModel",e.searchFilter().PageNumber),h(4),P("ngModel",e.searchFilter().RowCount),h(5),u("showProductToggle",!0)("data",y(31,24,e.data$))("channel",e.channelOptions())("hiddenIPOSInventory",!1),h(2),u("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",y(33,26,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}},dependencies:[H,J,G,q,k,x,ce,ee,$,pe,oe,X,ae,U],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let m=d;return m})();export{Ke as PricePosChannelComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as et,b as tt,c as it}from"./chunk-Q2QX5AAJ.js";import"./chunk-AZOCRKXK.js";import{a as de}from"./chunk-Q7MU7DBD.js";import"./chunk-RNWHARPK.js";import{a as Ke,b as Qe,c as Ze,e as qe,f as Je,g as Xe}from"./chunk-R2XT5M5F.js";import{e as $e,k as Ue,l as Ge,m as je,n as Ye,o as He}from"./chunk-ZW2TMVZP.js";import"./chunk-2F4DTZCZ.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import"./chunk-FCEXPGTK.js";import"./chunk-UH5C5HXK.js";import{a as ze}from"./chunk-ZRTEGBXK.js";import"./chunk-OPXITNRF.js";import{a as Be,b as Le,c as Ae}from"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-WHHW4IZT.js";import"./chunk-N5AE5WMQ.js";import"./chunk-AAUBUT4Y.js";import{c as Ve,d as Ie,e as Ne}from"./chunk-6KWG6O5L.js";import"./chunk-4RLWHMI6.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import{h as ke,i as ae}from"./chunk-Q4AWQ7IC.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import{qa as We}from"./chunk-5PMKN6PM.js";import{a as oe}from"./chunk-AGBJEXIM.js";import{b as Pe,e as Ee}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{b as ne,c as x}from"./chunk-JBEKD57G.js";import{m as Oe,n as Re}from"./chunk-EDEZ3JLR.js";import{A as ie,b as Te,c as be,h as ee,m as te,x as Me}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import{v as Fe,w as re}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{I as xe,c as O,i as X,j as $,m as V}from"./chunk-LNJUGHOX.js";import{$b as w,$c as q,Bc as fe,Cc as ge,Dc as _e,Gb as k,Ha as g,Hc as N,Mb as Y,Mc as s,Nc as F,Oc as D,Qc as b,Rc as M,Sc as P,Wc as Ce,Yc as we,Z as G,Zc as Z,_c as ve,aa as ce,ad as Se,bc as v,dc as R,ea as j,ec as W,fc as B,gc as h,hc as o,hd as L,ic as a,id as H,jc as S,jd as ye,lb as he,m as me,ma as ue,nb as l,pd as J,qc as T,ra as y,sb as A,sd as De,td as I,v as Q,vc as C,xa as c,xc as _,ya as u}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as se,b as pe}from"./chunk-66YHNWRR.js";var lt=e=>({"over-due":e});function dt(e,r){if(e&1&&(o(0,"tr",6)(1,"td"),s(2),a(),o(3,"td"),s(4),a(),o(5,"td"),s(6),a(),o(7,"td"),s(8),a()()),e&2){let d=r.$implicit,t=r.$index;h("ngClass",q(5,lt,d.Exception)),l(2),F(t+1),l(2),F(d.Number),l(2),F(d.Status),l(2),F(d.Exception)}}function st(e,r){if(e&1&&W(0,dt,9,7,"tr",6,R),e&2){let d,t=_();B((d=t.downloadResult())==null?null:d.Body)}}function pt(e,r){e&1&&(o(0,"tr",5)(1,"td",7)(2,"div",8),S(3,"i",9),a(),o(4,"h4",10),s(5," There is no order to processed "),a()()())}var nt=(()=>{let r=class r{constructor(){this.downloadResult=I()}ngOnInit(){}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:15,vars:1,consts:[[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[1,"text-center"],[3,"ngClass"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(o(0,"div",0)(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr"),S(5,"th",4),o(6,"th"),s(7,"Order Number"),a(),o(8,"th"),s(9,"Status"),a(),o(10,"th"),s(11,"Exception"),a()()(),o(12,"tbody"),w(13,st,2,0)(14,pt,6,0,"tr",5),a()()()()),n&2){let p;l(13),v(((p=i.downloadResult())==null||p.Body==null?null:p.Body.length)>0?13:14)}},dependencies:[V,O],encapsulation:2});let e=r;return e})();var ct=e=>({"full-width":e}),ut=()=>({standalone:!0}),ot=(()=>{let r=class r{constructor(){this.datePipe=y($),this.fullWidth=I(!1),this.timeChange=new A}ngOnInit(){}onTimeChange(t){let n=null;t&&(n=this.datePipe.transform(t,"HH:mm")),this.timeChange.emit(n),this.onTimePickerChange()}onShowCalendar(){let t=document.getElementById("dropdown-filter");if(t){var n=new bootstrap.Dropdown(t);n&&(n._config.autoClose="inside")}}onTimePickerChange(){let t=document.getElementById("dropdown-filter");if(t){var n=new bootstrap.Dropdown(t);n&&(n._config.autoClose="outside")}}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["app-timepicker"]],inputs:{time:"time",fullWidth:[1,"fullWidth"]},outputs:{timeChange:"timeChange"},decls:4,vars:8,consts:[["myCalendar",""],["styleClass","custom-height","id","shippingTime","appendTo","body",3,"ngModelChange","onSelect","ngClass","baseZIndex","ngModel","timeOnly","ngModelOptions"],["size","small","label","Close",3,"click"]],template:function(n,i){if(n&1){let p=T();o(0,"p-datepicker",1,0),P("ngModelChange",function(m){return c(p),M(i.time,m)||(i.time=m),u(m)}),C("ngModelChange",function(m){return c(p),u(i.onTimeChange(m))})("onSelect",function(){return c(p),u(i.onShowCalendar())}),o(2,"p-footer")(3,"p-button",2),C("click",function(){return c(p),N(1).hideOverlay(),u(i.onShowCalendar())}),a()()()}n&2&&(h("ngClass",q(5,ct,i.fullWidth()))("baseZIndex",1100),b("ngModel",i.time),h("timeOnly",!0)("ngModelOptions",ve(7,ut)))},dependencies:[V,O,ie,ee,te,it,tt,et,We],styles:["p-datepicker span.p-datepicker.custom-height{height:44px;width:70px} p-datepicker.full-width span.p-datepicker.custom-height{height:44px;width:100%!important}"]});let e=r;return e})();var z=(()=>{let r=class r{constructor(){this.httpService=y(Ee),this.toastr=y(Pe),this.datePipe=y($)}gerChannelDetailById(t){return this.httpService.post(oe.GetChannelDetail,{ID:t})}getOrderPreview(t){return this.httpService.post(oe.GetOrderPreviewV2,t)}getDownloadOrder(t){return this.httpService.post(oe.GetDownloadOrderV2,t)}onPreviewOrder(t){return this.validateDatePreview(t)?this.getOrderPreview(t).pipe(j(n=>{n.Data?.length===0&&this.toastrEmptyPreview(t)})):me}toastrEmptyPreview(t){let n=this.datePipe.transform(t.From,"dd MMM yyyy"),i=this.datePipe.transform(t.To,"dd MMM yyyy"),p=t.TimeFrom?t.TimeFrom:"",f=t.TimeTo?t.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${p} to ${i} ${f}!`,"No Orders!")}validateDatePreview(t){let n=!0;return t.downloadType==!0?x.getDaysDiff(t?.From,t?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):x.getDaysDiff(t?.From,t?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(t,n){let i=x.formatTitleFromDate(new Date(t),new Date(n)),p=this.datePipe.transform(t,i),f=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":p+"-"} ${f}`}};r.\u0275fac=function(n){return new(n||r)},r.\u0275prov=ue({token:r,factory:r.\u0275fac});let e=r;return e})();function ht(e,r){if(e&1&&(o(0,"ng-option",7),S(1,"img",17),s(2),a()),e&2){let d=r.$implicit;h("value",d.ID),l(),h("src",d==null?null:d.Img,he),l(),D("",d.Name," ")}}function ft(e,r){if(e&1){let d=T();o(0,"div",8)(1,"div",4)(2,"h5"),s(3,"Type"),a(),o(4,"p",5),s(5,"Select Type want to download"),a()(),o(6,"div",4)(7,"div",18)(8,"div")(9,"mat-radio-group",19),P("ngModelChange",function(n){c(d);let i=_();return M(i.downloadType,n)||(i.downloadType=n),u(n)}),C("ngModelChange",function(){c(d);let n=_();return u(n.onDownloadTypeChange())}),o(10,"mat-radio-button",20),s(11," Orders "),a(),o(12,"mat-radio-button",21),s(13," Disbursement "),a()()()(),o(14,"div",22)(15,"div",23),S(16,"i",24),a(),o(17,"p",25),s(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(e&2){let d=_();l(9),b("ngModel",d.downloadType),l(),h("value",!1),l(2),h("value",!0)}}function gt(e,r){e&1&&(o(0,"p",5),s(1," Select Disbursement date "),o(2,"span",26),s(3,"(payment date / order complete date)"),a(),s(4," of the channel you want to download (Max 1 Week). "),a())}function _t(e,r){e&1&&(o(0,"p",5),s(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function Ct(e,r){if(e&1){let d=T();o(0,"div",16)(1,"app-timepicker",27),P("timeChange",function(n){c(d);let i=_();return M(i.startTime,n)||(i.startTime=n),u(n)}),C("timeChange",function(){c(d);let n=_();return u(n.onStartTimeChange())}),a(),o(2,"span",28),s(3,"-"),a(),o(4,"app-timepicker",27),P("timeChange",function(n){c(d);let i=_();return M(i.endTime,n)||(i.endTime=n),u(n)}),C("timeChange",function(){c(d);let n=_();return u(n.onEndTimeChange())}),a()()}if(e&2){let d=_();l(),b("time",d.startTime),l(3),b("time",d.endTime)}}var at=(()=>{let r=class r{constructor(){this.reset=I(!1),this.authService=y(ae),this.tokenService=y(ke),this.downloadService=y(z),this.downloadType=g(!1),this.selectedChannelId=g(null),this.channelOptions=g(this.authService.getChannels()),this.channelType=ne,this.selectedChannel=g(null),this.showTimePicker=g(!1),this.startDate=g(null),this.endDate=g(null),this.startTime=g("00:00"),this.endTime=g("23:59"),this.minDate=g(new Date),this.maxDate=g(new Date),this.filterData=new A,this._onRememberMeChange=De({alias:"onRememberMeChange"}),this.rememberMe=g(!1),J(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0}),this.initDateValidation()}initDateValidation(){let t=this.tokenService?.getTokenValue(),n=t?.DownloadRange?JSON.parse(t?.DownloadRange):0;if(n<=0)this.minDate.set(null),this.maxDate.set(null);else{let i=new Date,p=x.addDays(i,n-1);this.minDate.set(p)}}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(t=>t.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(Q(t=>t?.Model),G(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let t=1;this.startDate()&&this.endDate()&&(t=x.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>t==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}onChangeRememberMe(t){this._onRememberMeChange.emit(t)}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange",_onRememberMeChange:"onRememberMeChange"},features:[Z([z,$e()])],decls:32,vars:13,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"row","mt-6"],[1,"col-12","d-flex","align-items-center"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker","min","max"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel","maxlength"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"col-6","d-flex","align-items-center","gap-2","mt-10"],["type","checkbox",2,"width","16px","height","16px",3,"ngModelChange","ngModel"],[1,"ms-2"],[1,"mt-8","d-flex","align-items-center"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let p=T();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),s(5,"Select a Channel"),a(),o(6,"p",5),s(7,"Select Channel want to download order"),a()(),o(8,"div",4)(9,"ng-select",6),P("ngModelChange",function(m){return c(p),M(i.selectedChannelId,m)||(i.selectedChannelId=m),u(m)}),C("ngModelChange",function(){return c(p),u(i.onSelectChannel())}),W(10,ht,3,3,"ng-option",7,R),a()()(),w(12,ft,19,3,"div",8),L(13,"async"),o(14,"div",8)(15,"div",4)(16,"h5"),s(17,"Date Range"),a(),w(18,gt,5,0,"p",5)(19,_t,2,0,"p",5),a(),o(20,"div",4)(21,"div",9)(22,"mat-date-range-input",10)(23,"input",11),P("ngModelChange",function(m){return c(p),M(i.startDate,m)||(i.startDate=m),u(m)}),C("click",function(){c(p);let m=N(26);return u(m.open())}),a(),o(24,"input",12),P("ngModelChange",function(m){return c(p),M(i.endDate,m)||(i.endDate=m),u(m)}),C("click",function(){c(p);let m=N(26);return u(m.open())})("ngModelChange",function(){return c(p),u(i.onFilterDateChange())}),a()(),S(25,"mat-date-range-picker",null,0),a(),o(27,"div",13)(28,"input",14),P("ngModelChange",function(m){return c(p),M(i.rememberMe,m)||(i.rememberMe=m),u(m)}),C("ngModelChange",function(m){return c(p),u(i.onChangeRememberMe(m))}),a(),o(29,"h5",15),s(30,"Save Date"),a()(),w(31,Ct,5,2,"div",16),a()()()()}if(n&2){let p,f,m=N(26);l(9),h("clearable",!1),b("ngModel",i.selectedChannelId),l(),B(i.channelOptions()),l(2),v((p=H(13,11,i.channelDetail$))!=null&&p.ServiceFeeWriteOff&&((p=i.selectedChannel())==null?null:p.TypeID)==i.channelType.Tokopedia?12:-1),l(6),v(i.downloadType()&&((f=i.selectedChannel())==null?null:f.TypeID)==i.channelType.Tokopedia?18:19),l(4),h("rangePicker",m)("min",i.minDate())("max",i.maxDate()),l(),b("ngModel",i.startDate),l(),b("ngModel",i.endDate),l(4),b("ngModel",i.rememberMe),l(3),v(i.showTimePicker()?31:-1)}},dependencies:[V,Ne,Ie,Ve,Ae,Be,Le,ie,be,Te,ee,Me,te,ot,Ye,Ue,He,Ge,je,X],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]});let e=r;return e})();var E=(function(e){return e.ALL="all",e.SYNC="sync",e.WRONG="wrong",e.UNSYNC="unsync",e})(E||{});var U=(function(e){return e[e.DoNothing=0]="DoNothing",e[e.New=1]="New",e[e.Update=2]="Update",e})(U||{});var wt=(e,r)=>({"over-due-today":e,"over-due":r});function vt(e,r){if(e&1&&(o(0,"th",17),s(1),a()),e&2){let d=_();l(),D(" ",d.selectedChannel()?"Created Date":"Last Status Update"," ")}}function St(e,r){if(e&1&&(o(0,"td"),s(1),L(2,"date"),a()),e&2){let d=_().$implicit;l(),D(" ",ye(2,1,d.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function yt(e,r){if(e&1&&(o(0,"span"),s(1),a()),e&2){let d=_().$implicit;l(),D(" ",d.ActionString," ")}}function Dt(e,r){if(e&1&&(o(0,"li"),s(1),a()),e&2){let d=r.$implicit;l(),D(" ",d," ")}}function xt(e,r){if(e&1&&(o(0,"ul",21),W(1,Dt,2,1,"li",null,R),a()),e&2){let d=_().$implicit;l(),B(d.ActionString)}}function Tt(e,r){if(e&1&&(o(0,"span",22),S(1,"i",23),a()),e&2){let d=_().$implicit;h("title",we("Delivery : ",d.DeliveryState,`
|
|
1
|
+
import{a as et,b as tt,c as it}from"./chunk-Q2QX5AAJ.js";import"./chunk-AZOCRKXK.js";import{a as de}from"./chunk-GVI6GJHY.js";import"./chunk-RNWHARPK.js";import{a as Ke,b as Qe,c as Ze,e as qe,f as Je,g as Xe}from"./chunk-R2XT5M5F.js";import{e as $e,k as Ue,l as Ge,m as je,n as Ye,o as He}from"./chunk-ZW2TMVZP.js";import"./chunk-2F4DTZCZ.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import"./chunk-FCEXPGTK.js";import"./chunk-UH5C5HXK.js";import{a as ze}from"./chunk-2IASUYTM.js";import"./chunk-OPXITNRF.js";import{a as Be,b as Le,c as Ae}from"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-WHHW4IZT.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OIMOM7S.js";import{c as Ve,d as Ie,e as Ne}from"./chunk-6KWG6O5L.js";import"./chunk-4RLWHMI6.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import{h as ke,i as ae}from"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import{qa as We}from"./chunk-5PMKN6PM.js";import{a as oe}from"./chunk-AGBJEXIM.js";import{b as Pe,e as Ee}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{b as ne,c as x}from"./chunk-JBEKD57G.js";import{m as Oe,n as Re}from"./chunk-EDEZ3JLR.js";import{A as ie,b as Te,c as be,h as ee,m as te,x as Me}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import{v as Fe,w as re}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{I as xe,c as O,i as X,j as $,m as V}from"./chunk-LNJUGHOX.js";import{$b as w,$c as q,Bc as fe,Cc as ge,Dc as _e,Gb as k,Ha as g,Hc as N,Mb as Y,Mc as s,Nc as F,Oc as D,Qc as b,Rc as M,Sc as P,Wc as Ce,Yc as we,Z as G,Zc as Z,_c as ve,aa as ce,ad as Se,bc as v,dc as R,ea as j,ec as W,fc as B,gc as h,hc as o,hd as L,ic as a,id as H,jc as S,jd as ye,lb as he,m as me,ma as ue,nb as l,pd as J,qc as T,ra as y,sb as A,sd as De,td as I,v as Q,vc as C,xa as c,xc as _,ya as u}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as se,b as pe}from"./chunk-66YHNWRR.js";var lt=e=>({"over-due":e});function dt(e,r){if(e&1&&(o(0,"tr",6)(1,"td"),s(2),a(),o(3,"td"),s(4),a(),o(5,"td"),s(6),a(),o(7,"td"),s(8),a()()),e&2){let d=r.$implicit,t=r.$index;h("ngClass",q(5,lt,d.Exception)),l(2),F(t+1),l(2),F(d.Number),l(2),F(d.Status),l(2),F(d.Exception)}}function st(e,r){if(e&1&&W(0,dt,9,7,"tr",6,R),e&2){let d,t=_();B((d=t.downloadResult())==null?null:d.Body)}}function pt(e,r){e&1&&(o(0,"tr",5)(1,"td",7)(2,"div",8),S(3,"i",9),a(),o(4,"h4",10),s(5," There is no order to processed "),a()()())}var nt=(()=>{let r=class r{constructor(){this.downloadResult=I()}ngOnInit(){}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:15,vars:1,consts:[[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[1,"text-center"],[3,"ngClass"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(o(0,"div",0)(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr"),S(5,"th",4),o(6,"th"),s(7,"Order Number"),a(),o(8,"th"),s(9,"Status"),a(),o(10,"th"),s(11,"Exception"),a()()(),o(12,"tbody"),w(13,st,2,0)(14,pt,6,0,"tr",5),a()()()()),n&2){let p;l(13),v(((p=i.downloadResult())==null||p.Body==null?null:p.Body.length)>0?13:14)}},dependencies:[V,O],encapsulation:2});let e=r;return e})();var ct=e=>({"full-width":e}),ut=()=>({standalone:!0}),ot=(()=>{let r=class r{constructor(){this.datePipe=y($),this.fullWidth=I(!1),this.timeChange=new A}ngOnInit(){}onTimeChange(t){let n=null;t&&(n=this.datePipe.transform(t,"HH:mm")),this.timeChange.emit(n),this.onTimePickerChange()}onShowCalendar(){let t=document.getElementById("dropdown-filter");if(t){var n=new bootstrap.Dropdown(t);n&&(n._config.autoClose="inside")}}onTimePickerChange(){let t=document.getElementById("dropdown-filter");if(t){var n=new bootstrap.Dropdown(t);n&&(n._config.autoClose="outside")}}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["app-timepicker"]],inputs:{time:"time",fullWidth:[1,"fullWidth"]},outputs:{timeChange:"timeChange"},decls:4,vars:8,consts:[["myCalendar",""],["styleClass","custom-height","id","shippingTime","appendTo","body",3,"ngModelChange","onSelect","ngClass","baseZIndex","ngModel","timeOnly","ngModelOptions"],["size","small","label","Close",3,"click"]],template:function(n,i){if(n&1){let p=T();o(0,"p-datepicker",1,0),P("ngModelChange",function(m){return c(p),M(i.time,m)||(i.time=m),u(m)}),C("ngModelChange",function(m){return c(p),u(i.onTimeChange(m))})("onSelect",function(){return c(p),u(i.onShowCalendar())}),o(2,"p-footer")(3,"p-button",2),C("click",function(){return c(p),N(1).hideOverlay(),u(i.onShowCalendar())}),a()()()}n&2&&(h("ngClass",q(5,ct,i.fullWidth()))("baseZIndex",1100),b("ngModel",i.time),h("timeOnly",!0)("ngModelOptions",ve(7,ut)))},dependencies:[V,O,ie,ee,te,it,tt,et,We],styles:["p-datepicker span.p-datepicker.custom-height{height:44px;width:70px} p-datepicker.full-width span.p-datepicker.custom-height{height:44px;width:100%!important}"]});let e=r;return e})();var z=(()=>{let r=class r{constructor(){this.httpService=y(Ee),this.toastr=y(Pe),this.datePipe=y($)}gerChannelDetailById(t){return this.httpService.post(oe.GetChannelDetail,{ID:t})}getOrderPreview(t){return this.httpService.post(oe.GetOrderPreviewV2,t)}getDownloadOrder(t){return this.httpService.post(oe.GetDownloadOrderV2,t)}onPreviewOrder(t){return this.validateDatePreview(t)?this.getOrderPreview(t).pipe(j(n=>{n.Data?.length===0&&this.toastrEmptyPreview(t)})):me}toastrEmptyPreview(t){let n=this.datePipe.transform(t.From,"dd MMM yyyy"),i=this.datePipe.transform(t.To,"dd MMM yyyy"),p=t.TimeFrom?t.TimeFrom:"",f=t.TimeTo?t.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${p} to ${i} ${f}!`,"No Orders!")}validateDatePreview(t){let n=!0;return t.downloadType==!0?x.getDaysDiff(t?.From,t?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):x.getDaysDiff(t?.From,t?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(t,n){let i=x.formatTitleFromDate(new Date(t),new Date(n)),p=this.datePipe.transform(t,i),f=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":p+"-"} ${f}`}};r.\u0275fac=function(n){return new(n||r)},r.\u0275prov=ue({token:r,factory:r.\u0275fac});let e=r;return e})();function ht(e,r){if(e&1&&(o(0,"ng-option",7),S(1,"img",17),s(2),a()),e&2){let d=r.$implicit;h("value",d.ID),l(),h("src",d==null?null:d.Img,he),l(),D("",d.Name," ")}}function ft(e,r){if(e&1){let d=T();o(0,"div",8)(1,"div",4)(2,"h5"),s(3,"Type"),a(),o(4,"p",5),s(5,"Select Type want to download"),a()(),o(6,"div",4)(7,"div",18)(8,"div")(9,"mat-radio-group",19),P("ngModelChange",function(n){c(d);let i=_();return M(i.downloadType,n)||(i.downloadType=n),u(n)}),C("ngModelChange",function(){c(d);let n=_();return u(n.onDownloadTypeChange())}),o(10,"mat-radio-button",20),s(11," Orders "),a(),o(12,"mat-radio-button",21),s(13," Disbursement "),a()()()(),o(14,"div",22)(15,"div",23),S(16,"i",24),a(),o(17,"p",25),s(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(e&2){let d=_();l(9),b("ngModel",d.downloadType),l(),h("value",!1),l(2),h("value",!0)}}function gt(e,r){e&1&&(o(0,"p",5),s(1," Select Disbursement date "),o(2,"span",26),s(3,"(payment date / order complete date)"),a(),s(4," of the channel you want to download (Max 1 Week). "),a())}function _t(e,r){e&1&&(o(0,"p",5),s(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function Ct(e,r){if(e&1){let d=T();o(0,"div",16)(1,"app-timepicker",27),P("timeChange",function(n){c(d);let i=_();return M(i.startTime,n)||(i.startTime=n),u(n)}),C("timeChange",function(){c(d);let n=_();return u(n.onStartTimeChange())}),a(),o(2,"span",28),s(3,"-"),a(),o(4,"app-timepicker",27),P("timeChange",function(n){c(d);let i=_();return M(i.endTime,n)||(i.endTime=n),u(n)}),C("timeChange",function(){c(d);let n=_();return u(n.onEndTimeChange())}),a()()}if(e&2){let d=_();l(),b("time",d.startTime),l(3),b("time",d.endTime)}}var at=(()=>{let r=class r{constructor(){this.reset=I(!1),this.authService=y(ae),this.tokenService=y(ke),this.downloadService=y(z),this.downloadType=g(!1),this.selectedChannelId=g(null),this.channelOptions=g(this.authService.getChannels()),this.channelType=ne,this.selectedChannel=g(null),this.showTimePicker=g(!1),this.startDate=g(null),this.endDate=g(null),this.startTime=g("00:00"),this.endTime=g("23:59"),this.minDate=g(new Date),this.maxDate=g(new Date),this.filterData=new A,this._onRememberMeChange=De({alias:"onRememberMeChange"}),this.rememberMe=g(!1),J(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0}),this.initDateValidation()}initDateValidation(){let t=this.tokenService?.getTokenValue(),n=t?.DownloadRange?JSON.parse(t?.DownloadRange):0;if(n<=0)this.minDate.set(null),this.maxDate.set(null);else{let i=new Date,p=x.addDays(i,n-1);this.minDate.set(p)}}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(t=>t.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(Q(t=>t?.Model),G(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let t=1;this.startDate()&&this.endDate()&&(t=x.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>t==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}onChangeRememberMe(t){this._onRememberMeChange.emit(t)}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange",_onRememberMeChange:"onRememberMeChange"},features:[Z([z,$e()])],decls:32,vars:13,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"row","mt-6"],[1,"col-12","d-flex","align-items-center"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker","min","max"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel","maxlength"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"col-6","d-flex","align-items-center","gap-2","mt-10"],["type","checkbox",2,"width","16px","height","16px",3,"ngModelChange","ngModel"],[1,"ms-2"],[1,"mt-8","d-flex","align-items-center"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let p=T();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),s(5,"Select a Channel"),a(),o(6,"p",5),s(7,"Select Channel want to download order"),a()(),o(8,"div",4)(9,"ng-select",6),P("ngModelChange",function(m){return c(p),M(i.selectedChannelId,m)||(i.selectedChannelId=m),u(m)}),C("ngModelChange",function(){return c(p),u(i.onSelectChannel())}),W(10,ht,3,3,"ng-option",7,R),a()()(),w(12,ft,19,3,"div",8),L(13,"async"),o(14,"div",8)(15,"div",4)(16,"h5"),s(17,"Date Range"),a(),w(18,gt,5,0,"p",5)(19,_t,2,0,"p",5),a(),o(20,"div",4)(21,"div",9)(22,"mat-date-range-input",10)(23,"input",11),P("ngModelChange",function(m){return c(p),M(i.startDate,m)||(i.startDate=m),u(m)}),C("click",function(){c(p);let m=N(26);return u(m.open())}),a(),o(24,"input",12),P("ngModelChange",function(m){return c(p),M(i.endDate,m)||(i.endDate=m),u(m)}),C("click",function(){c(p);let m=N(26);return u(m.open())})("ngModelChange",function(){return c(p),u(i.onFilterDateChange())}),a()(),S(25,"mat-date-range-picker",null,0),a(),o(27,"div",13)(28,"input",14),P("ngModelChange",function(m){return c(p),M(i.rememberMe,m)||(i.rememberMe=m),u(m)}),C("ngModelChange",function(m){return c(p),u(i.onChangeRememberMe(m))}),a(),o(29,"h5",15),s(30,"Save Date"),a()(),w(31,Ct,5,2,"div",16),a()()()()}if(n&2){let p,f,m=N(26);l(9),h("clearable",!1),b("ngModel",i.selectedChannelId),l(),B(i.channelOptions()),l(2),v((p=H(13,11,i.channelDetail$))!=null&&p.ServiceFeeWriteOff&&((p=i.selectedChannel())==null?null:p.TypeID)==i.channelType.Tokopedia?12:-1),l(6),v(i.downloadType()&&((f=i.selectedChannel())==null?null:f.TypeID)==i.channelType.Tokopedia?18:19),l(4),h("rangePicker",m)("min",i.minDate())("max",i.maxDate()),l(),b("ngModel",i.startDate),l(),b("ngModel",i.endDate),l(4),b("ngModel",i.rememberMe),l(3),v(i.showTimePicker()?31:-1)}},dependencies:[V,Ne,Ie,Ve,Ae,Be,Le,ie,be,Te,ee,Me,te,ot,Ye,Ue,He,Ge,je,X],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]});let e=r;return e})();var E=(function(e){return e.ALL="all",e.SYNC="sync",e.WRONG="wrong",e.UNSYNC="unsync",e})(E||{});var U=(function(e){return e[e.DoNothing=0]="DoNothing",e[e.New=1]="New",e[e.Update=2]="Update",e})(U||{});var wt=(e,r)=>({"over-due-today":e,"over-due":r});function vt(e,r){if(e&1&&(o(0,"th",17),s(1),a()),e&2){let d=_();l(),D(" ",d.selectedChannel()?"Created Date":"Last Status Update"," ")}}function St(e,r){if(e&1&&(o(0,"td"),s(1),L(2,"date"),a()),e&2){let d=_().$implicit;l(),D(" ",ye(2,1,d.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function yt(e,r){if(e&1&&(o(0,"span"),s(1),a()),e&2){let d=_().$implicit;l(),D(" ",d.ActionString," ")}}function Dt(e,r){if(e&1&&(o(0,"li"),s(1),a()),e&2){let d=r.$implicit;l(),D(" ",d," ")}}function xt(e,r){if(e&1&&(o(0,"ul",21),W(1,Dt,2,1,"li",null,R),a()),e&2){let d=_().$implicit;l(),B(d.ActionString)}}function Tt(e,r){if(e&1&&(o(0,"span",22),S(1,"i",23),a()),e&2){let d=_().$implicit;h("title",we("Delivery : ",d.DeliveryState,`
|
|
2
2
|
Payment : `,d.PaymentState))}}function bt(e,r){if(e&1&&(o(0,"tr")(1,"td"),s(2),a(),o(3,"td"),s(4),a(),w(5,St,3,4,"td"),o(6,"td")(7,"span"),s(8),a(),s(9),a(),o(10,"td",20)(11,"span"),s(12),a(),s(13),a(),o(14,"td"),w(15,yt,2,1,"span"),w(16,xt,3,0,"ul",21),a(),o(17,"td"),w(18,Tt,2,3,"span",22),a()()),e&2){let d,t=r.$implicit,n=r.$index,i=_(2);l(2),F(n+1),l(2),F(t.Number),l(),v(((d=i.selectedChannel())==null?null:d.TypeID)!=i.channelType.Shopee&&((d=i.selectedChannel())==null?null:d.TypeID)!==i.channelType.Tiktok?5:-1),l(3),D("",t.ChannelStatus," - "),l(),D("",t.ChannelStatusDescription," "),l(),h("ngClass",Se(12,wt,(t==null?null:t.Action)==i.actionPreviewOrder.Update,(t==null?null:t.Action)==i.actionPreviewOrder.New))("matTooltip",t.POSStatus==91||t.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),l(2),D("",t.POSStatus," - "),l(),D("",t.POSStatusDescription," "),l(2),v(t.ActionString.length==1?15:-1),l(),v(t.ActionString.length>1?16:-1),l(2),v(t.ChannelStatus!=99&&t.POSStatus!=99?18:-1)}}function Mt(e,r){if(e&1&&W(0,bt,19,15,"tr",null,R),e&2){let d=_();B(d.displayPreviewData())}}function Pt(e,r){e&1&&(o(0,"tr",19)(1,"td",24)(2,"div",25),S(3,"i",26),a(),o(4,"h4",27),s(5," There is no order to processed "),a()()())}var rt=(()=>{let r=class r{constructor(){this.orderPreview=I(),this.selectedChannel=I(),this.channelType=ne,this.allData=g(0),this.syncData=g(0),this.wrongData=g(0),this.unsyncData=g(0),this.pillStatus=g(E.ALL),this.actionPreviewOrder=U,this.previewStatus=E,this.displayPreviewData=g([]),this.exportOrders=new A,J(()=>{this.orderPreview()&&(this.filterPreviewData(E.ALL),this.initLengthStatusData())},{allowSignalWrites:!0})}filterPreviewData(t){this.pillStatus.update(()=>t),this.displayPreviewData.update(()=>this.filterDataByStatus(t))}initLengthStatusData(){this.wrongData.update(()=>this.filterDataByStatus(E.WRONG).length),this.syncData.update(()=>this.filterDataByStatus(E.SYNC).length),this.allData.update(()=>this.orderPreview().length),this.unsyncData.update(()=>this.filterDataByStatus(E.UNSYNC).length)}filterDataByStatus(t){let n=[];switch(t){case E.ALL:n=this.orderPreview();break;case E.SYNC:n=this.orderPreview().filter(i=>i.Action==U.DoNothing);break;case E.WRONG:n=this.orderPreview().filter(i=>i.Action==U.Update);break;case E.UNSYNC:n=this.orderPreview().filter(i=>i.Action==U.New);break}return n}onExportOrders(){this.exportOrders.emit()}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["preview-step"]],inputs:{orderPreview:[1,"orderPreview"],selectedChannel:[1,"selectedChannel"]},outputs:{exportOrders:"onExportOrders"},decls:40,vars:10,consts:[[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"col-12","d-flex","justify-content-between","align-items-end",2,"padding-left","0px","padding-right","0px"],[1,"nav","nav-pills"],[1,"nav-item","me-3"],[1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],[1,"nav-item","mx-3"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%"],["width","10%"],[1,"text-center"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div")(5,"ul",4)(6,"li",5)(7,"button",6),C("click",function(){return i.filterPreviewData(i.previewStatus.ALL)}),s(8),a()(),o(9,"li",7)(10,"button",8),C("click",function(){return i.filterPreviewData(i.previewStatus.SYNC)}),s(11),a()(),o(12,"li",7)(13,"button",9),C("click",function(){return i.filterPreviewData(i.previewStatus.WRONG)}),s(14),a()(),o(15,"li",7)(16,"button",10),C("click",function(){return i.filterPreviewData(i.previewStatus.UNSYNC)}),s(17),a()()()(),o(18,"div")(19,"button",11),C("click",function(){return i.onExportOrders()}),S(20,"i",12),o(21,"span"),s(22,"Export"),a()()()()(),o(23,"table",13)(24,"thead",14)(25,"tr"),S(26,"th",15),o(27,"th",16),s(28,"Number"),a(),w(29,vt,2,1,"th",17),o(30,"th",18),s(31,"Channel Status"),a(),o(32,"th",18),s(33,"POS Status"),a(),o(34,"th"),s(35,"Action"),a(),S(36,"th",15),a()(),o(37,"tbody"),w(38,Mt,2,0)(39,Pt,6,0,"tr",19),a()()()()),n&2){let p,f;l(7),h("ngClass",i.pillStatus()=="all"?"btn-secondary text-white":"btn-outline-dark"),l(),D(" All (",i.allData(),") "),l(2),h("ngClass",i.pillStatus()=="sync"?"btn-success":"btn-outline-success"),l(),D(" Existing (",i.syncData(),") "),l(2),h("ngClass",i.pillStatus()=="wrong"?"btn-warning text-white":"btn-outline-warning"),l(),D(" Wrong Status (",i.wrongData(),") "),l(2),h("ngClass",i.pillStatus()=="unsync"?"btn-danger":"btn-outline-danger"),l(),D(" Missing (",i.unsyncData(),") "),l(12),v(((p=i.selectedChannel())==null?null:p.TypeID)!=i.channelType.Shopee&&((p=i.selectedChannel())==null?null:p.TypeID)!==i.channelType.Tiktok?29:-1),l(9),v(((f=i.displayPreviewData())==null?null:f.length)>0?38:39)}},dependencies:[V,O,re,Fe,$],encapsulation:2});let e=r;return e})();var Et=["stepper"];function kt(e,r){if(e&1){let d=T();o(0,"div",2)(1,"button",20),C("click",function(){c(d);let n=_();return u(n.onStepperBack())}),s(2," Back "),a(),o(3,"button",21),C("click",function(){c(d);let n=_();return u(n.onNextStep())}),s(4," Next "),a()()}if(e&2){let d=_();l(3),h("disabled",d.disabledNextFilter())}}function Vt(e,r){if(e&1){let d=T();o(0,"button",22),C("click",function(){c(d);let n=_();return u(n.onNextStep())}),s(1," Next "),a()}if(e&2){let d=_();h("disabled",d.disabledNextFilter())}}function It(e,r){if(e&1){let d=T();o(0,"button",23),C("click",function(){c(d);let n=_();return u(n.onNewDownload())}),S(1,"i",24),s(2," New "),a()}}function Nt(e,r){e&1&&(S(0,"i",25),o(1,"span"),s(2,"Filter"),a())}function Ft(e,r){e&1&&(S(0,"i",26),o(1,"span"),s(2,"Preview"),a())}function Ot(e,r){if(e&1){let d=T();o(0,"preview-step",27),C("onExportOrders",function(){c(d);let n=_();return u(n.onExportOrders())}),a()}e&2&&h("orderPreview",r)}function Rt(e,r){e&1&&(S(0,"i",28),o(1,"span"),s(2,"Finish"),a())}function Wt(e,r){e&1&&S(0,"complete-step",16),e&2&&h("downloadResult",r)}function Bt(e,r){e&1&&(o(0,"h6"),s(1,"1"),a())}function Lt(e,r){e&1&&(o(0,"h6"),s(1,"2"),a())}function At(e,r){e&1&&(o(0,"h6"),s(1,"3"),a())}var cn=(()=>{let r=class r{constructor(){this.downloadService=y(z),this.orderService=y(de),this.productService=y(ze),this.authService=y(ae),this.stepperSelectedIndex=g(0),this.disabledNextFilter=g(!0),this.isResetFilter=g(!1),this.pageTitle=g("Download to POS"),this.cacheKey=g(x.GuidEMpty),this.rememberMe=g(!1)}onFilterChange(t){this.filter=t,this.validateDisabledNext()}validateDisabledNext(){this.disabledNextFilter.update(()=>x.IsEmpty(this.filter?.channelId)||!x.isValidDate(this.filter.startDate)||!x.isValidDate(this.filter.endDate))}onNextStep(){switch(this.stepper.selectedIndex){case 0:this.onPreview();let t=this.productService.findChannelById(this.filter.channelId,this.authService.getChannels());this.setPageTitle(`Preview ${t?.Name}`);break;case 1:this.onDownload(),this.setPageTitle("Download");break}}onStepperNext(){this.stepper.selected.completed=!0,this.stepper.next()}onPreview(){let t={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,IsDisbursement:this.filter.downloadType};x.IsNotEmpty(this.filter.startTime)&&(t=pe(se({},t),{TimeFrom:this.filter.startTime+":00",TimeTo:this.filter.endTime+":00"})),this.orderPreview$=this.downloadService.onPreviewOrder(t).pipe(j(n=>{n.Data?.length>0&&(this.cacheKey.update(()=>n.CacheKey),this.onStepperNext())}),Q(n=>n.Data),G(1))}onExportOrders(){let t={ID:this.filter.channelId,From:this.filter.startDate?this.filter.startDate:null,To:this.filter.endDate?this.filter.endDate:null},n=`Orders ${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)}`;this.orderService.exportOrders(t,n).subscribe()}onDownload(){let t={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,ListPreview:[],IsDisbursement:this.filter.downloadType,CacheKey:this.cacheKey()};this.downloadPreview$=this.orderPreview$.pipe(ce(n=>(t.ListPreview=n,this.downloadService.getDownloadOrder(t))),j(()=>{this.onStepperNext()}),G(1))}setPageTitle(t){this.pageTitle.update(()=>`
|
|
3
3
|
${t} (${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)})
|
|
4
4
|
`)}onStepperBack(){this.stepper.previous(),this.pageTitle.update(()=>"Download to POS")}onNewDownload(){this.isResetFilter.update(()=>!this.rememberMe()),this.stepper.reset(),this.stepperSelectedIndex.update(()=>0),this.orderPreview$=null,this.downloadPreview$=null,this.pageTitle.update(()=>"Download to POS")}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["app-download-v2"]],viewQuery:function(n,i){if(n&1&&fe(Et,5),n&2){let p;ge(p=_e())&&(i.stepper=p.first)}},features:[Z([z,de,{provide:Ke,useValue:{displayDefaultIndicatorType:!1}}])],decls:26,vars:21,consts:[["stepper",""],[3,"hideSearchBox","hideSearchDropdown","headerTitle","description"],[1,"btn-group","me-3"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"disabled"],[1,"btn","btn-outline-secondary","btn-fill","d-flex","align-items-center","gap-2"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["linear","",1,"w-100","stepper-download",3,"selectedIndexChange","ngClass","selectedIndex"],["state","filter",3,"completed","editable"],["matStepLabel",""],[1,"w-100",3,"onFilterChange","onRememberMeChange","reset"],["state","preview",3,"editable","completed"],[3,"orderPreview"],["state","finish"],[3,"downloadResult"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","bg-success","text-white",3,"click","disabled"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"click","disabled"],[1,"btn","btn-outline-secondary","btn-fill","d-flex","align-items-center","gap-2",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt"],[1,"fa-solid","fa-filter","me-3"],[1,"fa-solid","fa-file","me-3"],[3,"onExportOrders","orderPreview"],[1,"fa-solid","fa-flag","me-3"]],template:function(n,i){if(n&1){let p=T();o(0,"mainpanel",1)(1,"actions"),w(2,kt,5,1,"div",2),w(3,Vt,2,1,"button",3),w(4,It,3,0,"button",4),a(),o(5,"content")(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8)(10,"mat-stepper",9,0),P("selectedIndexChange",function(m){return c(p),M(i.stepperSelectedIndex,m)||(i.stepperSelectedIndex=m),u(m)}),o(12,"mat-step",10),Y(13,Nt,3,0,"ng-template",11),o(14,"filter-step",12),C("onFilterChange",function(m){return c(p),u(i.onFilterChange(m))})("onRememberMeChange",function(m){return c(p),u(i.rememberMe.set(m))}),a()(),o(15,"mat-step",13),Y(16,Ft,3,0,"ng-template",11),w(17,Ot,1,1,"preview-step",14),L(18,"async"),a(),o(19,"mat-step",15),Y(20,Rt,3,0,"ng-template",11),w(21,Wt,1,1,"complete-step",16),L(22,"async"),a(),Y(23,Bt,2,0,"ng-template",17)(24,Lt,2,0,"ng-template",18)(25,At,2,0,"ng-template",19),a()()()()()()()}if(n&2){let p,f,m=N(11);h("hideSearchBox",!0)("hideSearchDropdown",!0)("headerTitle",i.pageTitle())("description",i.pageTitle()),l(2),v(i.stepperSelectedIndex()==1?2:-1),l(),v(i.stepperSelectedIndex()==0?3:-1),l(),v(i.stepperSelectedIndex()==2?4:-1),l(6),h("ngClass",Ce("last-edited-step-"+m.selectedIndex)),b("selectedIndex",i.stepperSelectedIndex),l(2),h("completed",!1)("editable",i.stepperSelectedIndex()!=2),l(2),h("reset",i.isResetFilter()),l(),h("editable",i.stepperSelectedIndex()!=2)("completed",!1),l(2),v((p=H(18,17,i.orderPreview$))?17:-1,p),l(4),v((f=H(22,19,i.downloadPreview$))?21:-1,f)}},dependencies:[V,O,nt,at,rt,Xe,qe,Qe,Je,Ze,Re,Oe,xe,re,X],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.vertical-radio{display:flex;flex-direction:column;margin:15px 0}.mt-1rem{margin-top:1rem}.dateRange{padding-top:.8rem;padding-bottom:.8rem}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}.form-label-group.radio.download-type{height:45.5938px!important;border-radius:.375rem!important}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as oe}from"./chunk-
|
|
1
|
+
import{a as oe}from"./chunk-KZSTYKIP.js";import{a as E}from"./chunk-GVI6GJHY.js";import{a as le}from"./chunk-S7CKRTJV.js";import{a as re}from"./chunk-7JQEF4XX.js";import"./chunk-AFIF6VRM.js";import"./chunk-ZW2TMVZP.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import"./chunk-FCEXPGTK.js";import"./chunk-QFSA7CU4.js";import"./chunk-OPXITNRF.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import"./chunk-N5AE5WMQ.js";import{a as ie}from"./chunk-FHER4TFY.js";import{a as ae}from"./chunk-5KYN6Y7M.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import{a as ne}from"./chunk-PDCVMSLL.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import"./chunk-AGBJEXIM.js";import"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import"./chunk-JBEKD57G.js";import{m as ee,n as te}from"./chunk-EDEZ3JLR.js";import{A as Y,c as K,h as Q,m as U,o as X}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import{v as Z,w as $}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as j,j as q,l as G,m as J}from"./chunk-LNJUGHOX.js";import{$b as F,Gb as D,Ha as W,Mc as a,Nc as w,Qc as C,Rc as f,Sc as g,Tc as k,Uc as A,Vc as z,Z as P,Zc as H,bc as N,cc as L,ec as B,fc as I,gc as h,hc as e,hd as b,ic as t,id as M,jc as y,jd as R,nb as r,qc as v,ra as O,vc as x,xa as u,xc as S,ya as c}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as T,b as V}from"./chunk-66YHNWRR.js";function de(d,m){if(d&1&&(e(0,"tr")(1,"td"),a(2),t(),e(3,"td"),y(4,"order-link",26),t(),e(5,"td"),a(6),t(),e(7,"td"),a(8),b(9,"number"),t(),e(10,"td"),a(11),b(12,"date"),t(),e(13,"td"),y(14,"app-channel-logo",27),t()()),d&2){let o=m.$implicit;r(2),w(o.Outlet),r(2),h("order",o),r(2),w(o.Customer),r(2),w(M(9,6,o.Amount)),r(3),w(R(12,8,o.Created,"dd MMM yyyy HH:mm")),r(3),h("typeId",o==null?null:o.TypeID)}}function me(d,m){if(d&1){let o=v();e(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),a(5,"Outlet"),t(),e(6,"th",21),a(7,"Order number"),t(),e(8,"th"),a(9,"Customer"),t(),e(10,"th",22),a(11,"Amount"),t(),e(12,"th",23),a(13," Created On "),t(),e(14,"th",24),a(15,"Channel"),t()()(),e(16,"tbody"),B(17,de,15,11,"tr",null,L),t()(),e(19,"app-custom-paginator",25),x("next",function(){u(o);let p=S();return c(p.initCancelledOrders())})("previous",function(){u(o);let p=S();return c(p.initCancelledOrders())}),t()()}if(d&2){let o=S(),l=z(0);r(17),I(l),r(2),h("filter",o.filter())("totaldata",l==null?null:l.length)("paginationTotal",l==null?null:l.length)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}function pe(d,m){d&1&&(e(0,"div",16),y(1,"app-empty-state"),t())}var We=(()=>{let m=class m{constructor(){this.orderService=O(E),this.filter=W({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:l=>{this.initFromDate(l)},error:l=>{console.error("Error fetching default date:",l),this.initFromDate(null)}})}initFromDate(l){this.filter.update(p=>V(T({},p),{From:l})),this.initCancelledOrders()}initCancelledOrders(){this.cancelledOrders$=this.orderService.getCancelledOrders(this.filter()).pipe(P(1))}};m.\u0275fac=function(p){return new(p||m)},m.\u0275cmp=D({type:m,selectors:[["app-cancelled"]],features:[H([E])],decls:34,vars:11,consts:[["headerTitle","Cancelled","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"],[3,"order"],[3,"typeId"]],template:function(p,n){if(p&1){let s=v();k(0),b(1,"async"),e(2,"mainpanel",0),x("onSubmit",function(){return u(s),c(n.initCancelledOrders())}),g("textChange",function(i){return u(s),f(n.filter().Number,i)||(n.filter().Number=i),c(i)}),e(3,"actions")(4,"a",1),y(5,"i",2),e(6,"span"),a(7,"Order Fulfillment Display"),t()()(),e(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),t(),e(12,"app-channel-options-v2",4),g("ngModelChange",function(i){return u(s),f(n.filter().ListChannelID,i)||(n.filter().ListChannelID=i),c(i)}),t()(),e(13,"div",5)(14,"label",3),a(15,"From/To"),t(),e(16,"div",6)(17,"datepicker",7),g("dateChange",function(i){return u(s),f(n.filter().From,i)||(n.filter().From=i),c(i)}),t()(),e(18,"div")(19,"datepicker",8),g("dateChange",function(i){return u(s),f(n.filter().To,i)||(n.filter().To=i),c(i)}),t()()(),e(20,"div",5)(21,"label",9),a(22,"Page Number"),t(),e(23,"input",10),g("ngModelChange",function(i){return u(s),f(n.filter().PageNumber,i)||(n.filter().PageNumber=i),c(i)}),t()(),e(24,"div",5)(25,"label",9),a(26,"Page Size"),t(),e(27,"input",11),g("ngModelChange",function(i){return u(s),f(n.filter().PageSize,i)||(n.filter().PageSize=i),c(i)}),t()()(),e(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),F(32,me,20,5,"div",15)(33,pe,2,0,"div",16),t()()()()()}if(p&2){let s=A(M(1,8,n.cancelledOrders$));r(2),C("text",n.filter().Number),r(10),h("multiple",!0),C("ngModel",n.filter().ListChannelID),r(5),C("date",n.filter().From),r(2),C("date",n.filter().To),r(4),C("ngModel",n.filter().PageNumber),r(4),C("ngModel",n.filter().PageSize),r(5),N((s==null?null:s.length)>0?32:33)}},dependencies:[J,te,ee,re,ne,Y,K,X,Q,U,le,$,Z,oe,ie,ae,j,G,q],encapsulation:2});let d=m;return d})();export{We as CancelledComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as x}from"./chunk-QXRG5XYP.js";import{a as Xe,b as ye,c as Ye,d as Qe,e as we,f as et,g as Se,h as tt,i as Q,j as ve,k as R}from"./chunk-RXLMJGUY.js";import{a as ot}from"./chunk-AGBJEXIM.js";import{e as oe}from"./chunk-OXWPYJNB.js";import{b as me,c as F}from"./chunk-JBEKD57G.js";import{b as rt}from"./chunk-YTHY4IFS.js";import{a as nt}from"./chunk-ZETUYNFJ.js";import{F as Ze,n as Ge,o as Je}from"./chunk-LNJUGHOX.js";import{Ca as Ve,F as Le,G as Ue,Ha as ne,Hb as q,La as qe,O as he,S as $e,T as He,Va as z,Z as pe,aa as B,ba as fe,c as m,ea as Y,f as Ne,ga as We,ha as Ke,j as Be,k as Me,ma as T,n as Z,na as K,o as re,p as M,pa as P,q as X,qa as g,ra as O,tb as V,ua as ge,v as j,w as Fe,wa as ze,zd as H}from"./chunk-ZYJ6LAJ3.js";import{b as w}from"./chunk-WFMAM73Y.js";import{a as de,i as k}from"./chunk-66YHNWRR.js";var it={production:!0,version:"5.48.
|
|
1
|
+
import{a as x}from"./chunk-QXRG5XYP.js";import{a as Xe,b as ye,c as Ye,d as Qe,e as we,f as et,g as Se,h as tt,i as Q,j as ve,k as R}from"./chunk-RXLMJGUY.js";import{a as ot}from"./chunk-AGBJEXIM.js";import{e as oe}from"./chunk-OXWPYJNB.js";import{b as me,c as F}from"./chunk-JBEKD57G.js";import{b as rt}from"./chunk-YTHY4IFS.js";import{a as nt}from"./chunk-ZETUYNFJ.js";import{F as Ze,n as Ge,o as Je}from"./chunk-LNJUGHOX.js";import{Ca as Ve,F as Le,G as Ue,Ha as ne,Hb as q,La as qe,O as he,S as $e,T as He,Va as z,Z as pe,aa as B,ba as fe,c as m,ea as Y,f as Ne,ga as We,ha as Ke,j as Be,k as Me,ma as T,n as Z,na as K,o as re,p as M,pa as P,q as X,qa as g,ra as O,tb as V,ua as ge,v as j,w as Fe,wa as ze,zd as H}from"./chunk-ZYJ6LAJ3.js";import{b as w}from"./chunk-WFMAM73Y.js";import{a as de,i as k}from"./chunk-66YHNWRR.js";var it={production:!0,version:"5.48.2",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var Ct="firebase",Dt="11.10.0";Q(Ct,Dt,"app");var G=new We("ANGULARFIRE2_VERSION");var st=(r,o)=>{let s=o?[o]:tt(),e=[];return s.forEach(t=>{t.container.getProvider(r).instances.forEach(i=>{e.includes(i)||e.push(i)})}),e},ke=(function(r){return r[r.SILENT=0]="SILENT",r[r.WARN=1]="WARN",r[r.VERBOSE=2]="VERBOSE",r})(ke||{}),Lr=H()&&typeof Zone<"u"?ke.WARN:ke.SILENT;var ie=class{zone;delegate;constructor(o,s=Me){this.zone=o,this.delegate=s}now(){return this.delegate.now()}schedule(o,s,e){let t=this.zone,n=function(i){t?t.runGuarded(()=>{o.apply(this,[i])}):o.apply(this,[i])};return this.delegate.schedule(n,s,e)}},Ae=(()=>{class r{outsideAngular;insideAngular;constructor(){let s=O(V);this.outsideAngular=s.runOutsideAngular(()=>new ie(typeof Zone>"u"?void 0:Zone.current)),this.insideAngular=s.run(()=>new ie(typeof Zone>"u"?void 0:Zone.current,Be))}static \u0275fac=function(e){return new(e||r)};static \u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var xt=new Map,Rt={activated:!1,tokenObservers:[]},_t={initialized:!1,enabled:!1};function _(r){return xt.get(r)||Object.assign({},Rt)}function ut(){return _t}var jt="https://content-firebaseappcheck.googleapis.com/v1";var Ot="exchangeDebugToken",at={OFFSET_DURATION:300*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:960*1e3},Zr=1440*60*1e3;var Ie=class{constructor(o,s,e,t,n){if(this.operation=o,this.retryPolicy=s,this.getWaitDuration=e,this.lowerBound=t,this.upperBound=n,this.pending=null,this.nextErrorWaitInterval=t,t>n)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(o){return k(this,null,function*(){this.stop();try{this.pending=new ye,this.pending.promise.catch(s=>{}),yield Nt(this.getNextRun(o)),this.pending.resolve(),yield this.pending.promise,this.pending=new ye,this.pending.promise.catch(s=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(s){this.retryPolicy(s)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(o){if(o)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let s=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),s}}};function Nt(r){return new Promise(o=>{setTimeout(o,r)})}var Bt={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},U=new Qe("appCheck","AppCheck",Bt);function dt(r){if(!_(r).activated)throw U.create("use-before-activation",{appName:r.name})}function ht(e,t){return k(this,arguments,function*({url:r,body:o},s){let n={"Content-Type":"application/json"},i=s.getImmediate({optional:!0});if(i){let h=yield i.getHeartbeatsHeader();h&&(n["X-Firebase-Client"]=h)}let a={method:"POST",body:JSON.stringify(o),headers:n},l;try{l=yield fetch(r,a)}catch(h){throw U.create("fetch-network-error",{originalErrorMessage:h?.message})}if(l.status!==200)throw U.create("fetch-status-error",{httpStatus:l.status});let c;try{c=yield l.json()}catch(h){throw U.create("fetch-parse-error",{originalErrorMessage:h?.message})}let u=c.ttl.match(/^([\d.]+)(s)$/);if(!u||!u[2]||isNaN(Number(u[1])))throw U.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${c.ttl}`});let f=Number(u[1])*1e3,d=Date.now();return{token:c.token,expireTimeMillis:d+f,issuedAtTimeMillis:d}})}function pt(r,o){let{projectId:s,appId:e,apiKey:t}=r.options;return{url:`${jt}/projects/${s}/apps/${e}:${Ot}?key=${t}`,body:{debug_token:o}}}var Mt="firebase-app-check-database",Ft=1,Te="firebase-app-check-store";var se=null;function Lt(){return se||(se=new Promise((r,o)=>{try{let s=indexedDB.open(Mt,Ft);s.onsuccess=e=>{r(e.target.result)},s.onerror=e=>{var t;o(U.create("storage-open",{originalErrorMessage:(t=e.target.error)===null||t===void 0?void 0:t.message}))},s.onupgradeneeded=e=>{let t=e.target.result;switch(e.oldVersion){case 0:t.createObjectStore(Te,{keyPath:"compositeKey"})}}}catch(s){o(U.create("storage-open",{originalErrorMessage:s?.message}))}}),se)}function Ut(r,o){return $t(Ht(r),o)}function $t(r,o){return k(this,null,function*(){let e=(yield Lt()).transaction(Te,"readwrite"),n=e.objectStore(Te).put({compositeKey:r,value:o});return new Promise((i,a)=>{n.onsuccess=l=>{i()},e.onerror=l=>{var c;a(U.create("storage-set",{originalErrorMessage:(c=l.target.error)===null||c===void 0?void 0:c.message}))}})})}function Ht(r){return`${r.options.appId}-${r.name}`}var ee=new et("@firebase/app-check");function be(r,o){return Ye()?Ut(r,o).catch(s=>{ee.warn(`Failed to write token to IndexedDB. Error: ${s}`)}):Promise.resolve()}function ft(){return ut().enabled}function gt(){return k(this,null,function*(){let r=ut();if(r.enabled&&r.token)return r.token.promise;throw Error(`
|
|
2
2
|
Can't get debug token in production mode.
|
|
3
3
|
`)})}var Wt={error:"UNKNOWN_ERROR"};function Kt(r){return Xe.encodeString(JSON.stringify(r),!1)}function Ce(r,o=!1,s=!1){return k(this,null,function*(){let e=r.app;dt(e);let t=_(e),n=t.token,i;if(n&&!te(n)&&(t.token=void 0,n=void 0),!n){let c=yield t.cachedTokenPromise;c&&(te(c)?n=c:yield be(e,void 0))}if(!o&&n&&te(n))return{token:n.token};let a=!1;if(ft())try{t.exchangeTokenPromise||(t.exchangeTokenPromise=ht(pt(e,yield gt()),r.heartbeatServiceProvider).finally(()=>{t.exchangeTokenPromise=void 0}),a=!0);let c=yield t.exchangeTokenPromise;return yield be(e,c),t.token=c,{token:c.token}}catch(c){return c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?ee.warn(c.message):s&&ee.error(c),Ee(c)}try{t.exchangeTokenPromise||(t.exchangeTokenPromise=t.provider.getToken().finally(()=>{t.exchangeTokenPromise=void 0}),a=!0),n=yield _(e).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?ee.warn(c.message):s&&ee.error(c),i=c}let l;return n?i?te(n)?l={token:n.token,internalError:i}:l=Ee(i):(l={token:n.token},t.token=n,yield be(e,n)):l=Ee(i),a&&Gt(e,l),l})}function zt(r){return k(this,null,function*(){let o=r.app;dt(o);let{provider:s}=_(o);if(ft()){let e=yield gt(),{token:t}=yield ht(pt(o,e),r.heartbeatServiceProvider);return{token:t}}else{let{token:e}=yield s.getToken();return{token:e}}})}function Vt(r,o,s,e){let{app:t}=r,n=_(t),i={next:s,error:e,type:o};if(n.tokenObservers=[...n.tokenObservers,i],n.token&&te(n.token)){let a=n.token;Promise.resolve().then(()=>{s({token:a.token}),ct(r)}).catch(()=>{})}n.cachedTokenPromise.then(()=>ct(r))}function mt(r,o){let s=_(r),e=s.tokenObservers.filter(t=>t.next!==o);e.length===0&&s.tokenRefresher&&s.tokenRefresher.isRunning()&&s.tokenRefresher.stop(),s.tokenObservers=e}function ct(r){let{app:o}=r,s=_(o),e=s.tokenRefresher;e||(e=qt(r),s.tokenRefresher=e),!e.isRunning()&&s.isTokenAutoRefreshEnabled&&e.start()}function qt(r){let{app:o}=r;return new Ie(()=>k(null,null,function*(){let s=_(o),e;if(s.token?e=yield Ce(r,!0):e=yield Ce(r),e.error)throw e.error;if(e.internalError)throw e.internalError}),()=>!0,()=>{let s=_(o);if(s.token){let e=s.token.issuedAtTimeMillis+(s.token.expireTimeMillis-s.token.issuedAtTimeMillis)*.5+3e5,t=s.token.expireTimeMillis-300*1e3;return e=Math.min(e,t),Math.max(0,e-Date.now())}else return 0},at.RETRIAL_MIN_WAIT,at.RETRIAL_MAX_WAIT)}function Gt(r,o){let s=_(r).tokenObservers;for(let e of s)try{e.type==="EXTERNAL"&&o.error!=null?e.error(o.error):e.next(o)}catch{}}function te(r){return r.expireTimeMillis-Date.now()>0}function Ee(r){return{token:Kt(Wt),error:r}}var De=class{constructor(o,s){this.app=o,this.heartbeatServiceProvider=s}_delete(){let{tokenObservers:o}=_(this.app);for(let s of o)mt(this.app,s.next);return Promise.resolve()}};function Jt(r,o){return new De(r,o)}function Zt(r){return{getToken:o=>Ce(r,o),getLimitedUseToken:()=>zt(r),addTokenListener:o=>Vt(r,"INTERNAL",o),removeTokenListener:o=>mt(r.app,o)}}var Xt="@firebase/app-check",Yt="0.10.1";var Qt="app-check",lt="app-check-internal";function er(){Se(new we(Qt,r=>{let o=r.getProvider("app").getImmediate(),s=r.getProvider("heartbeat");return Jt(o,s)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((r,o,s)=>{r.getProvider(lt).initialize()})),Se(new we(lt,r=>{let o=r.getProvider("app-check").getImmediate();return Zt(o)},"PUBLIC").setInstantiationMode("EXPLICIT")),Q(Xt,Yt)}er();var tr="app-check";var ae=class{constructor(){return st(tr)}};var rr=["localhost","0.0.0.0","127.0.0.1"],hn=typeof window<"u"&&rr.includes(window.location.hostname);var yt=(()=>{let o=class o{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let t=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return typeof t=="string"&&(t=[t]),t||[]}ParseToken(e){try{let n=e.split(".")[0].replace("-","+").replace("_","/"),i=JSON.parse(window.atob(n)),l=e.split(".")[1].replace("-","+").replace("_","/"),c=JSON.parse(window.atob(l));return c.header=i,c}catch{return!1}}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=T({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var ir="firebase",sr="11.10.0";R.registerVersion(ir,sr,"app-compat");var ar=["ngOnDestroy"],St=(r,o,s,e={})=>new Proxy(r,{get:(t,n)=>s.runOutsideAngular(()=>{if(r[n])return e?.spy?.get&&e.spy.get(n,r[n]),r[n];if(ar.indexOf(n)>-1)return()=>{};let i=o.toPromise().then(a=>{let l=a?.[n];return typeof l=="function"?l.bind(a):l?.then?l.then(c=>s.run(()=>c)):s.run(()=>l)});return new Proxy(()=>{},{get:(a,l)=>i[l],apply:(a,l,c)=>i.then(u=>{let f=u?.(...c);return e?.spy?.apply&&e.spy.apply(n,c,f),f})})})});var ce=class{constructor(o){return o}},le=new P("angularfire2.app.options"),ue=new P("angularfire2.app.name");function Pe(r,o,s){let e=typeof s=="string"&&s||"[DEFAULT]",t=typeof s=="object"&&s||{};t.name=t.name||e;let i=R.apps.filter(a=>a&&a.name===t.name)[0]||o.runOutsideAngular(()=>R.initializeApp(r,t));try{if(JSON.stringify(r)!==JSON.stringify(i.options)){let a=!!module.hot;cr("error",`${i.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new ce(i)}var cr=(r,...o)=>{H()&&typeof console<"u"&&console[r](...o)},lr={provide:ce,useFactory:Pe,deps:[le,V,[new qe,ue]]},ii=(()=>{class r{static initializeApp(s,e){return{ngModule:r,providers:[{provide:le,useValue:s},{provide:ue,useValue:e}]}}constructor(s){R.registerVersion("angularfire",G.full,"core"),R.registerVersion("angularfire",G.full,"app-compat"),R.registerVersion("angular",Ke.full,s.toString())}static \u0275fac=function(e){return new(e||r)(g(z))};static \u0275mod=q({type:r});static \u0275inj=K({providers:[lr]})}return r})();function vt(r,o,s,e,t){let[,n,i]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===r)||[];if(n)return ur(t,i)||(wt("error",`${o} was already initialized on the ${s} Firebase App with different settings.${dr?" You may need to reload as Firebase is not HMR aware.":""}`),wt("warn",{is:t,was:i})),n;{let a=e();return globalThis.\u0275AngularfireInstanceCache.push([r,a,t]),a}}function ur(r,o){try{return r.toString()===o.toString()}catch{return r===o}}var dr=typeof module<"u"&&!!module.hot,wt=(r,...o)=>{H()&&typeof console<"u"&&console[r](...o)};globalThis.\u0275AngularfireInstanceCache||=[];var hr=new P("angularfire2.auth.use-emulator"),pr=new P("angularfire2.auth.settings"),fr=new P("angularfire2.auth.tenant-id"),gr=new P("angularfire2.auth.langugage-code"),mr=new P("angularfire2.auth.use-device-language"),yr=new P("angularfire.auth.persistence"),wr=(r,o,s,e,t,n,i,a)=>vt(`${r.name}.auth`,"AngularFireAuth",r.name,()=>{let l=o.runOutsideAngular(()=>r.auth());if(s&&l.useEmulator(...s),e&&(l.tenantId=e),l.languageCode=t,n&&l.useDeviceLanguage(),i)for(let[c,u]of Object.entries(i))l.settings[c]=u;return a&&l.setPersistence(a),l},[s,e,t,n,i,a]),xe=(()=>{class r{injector=O(ge);authState;idToken;user;idTokenResult;credential;constructor(s,e,t,n,i,a,l,c,u,f,d,h){let p=new Ne,y=X(void 0).pipe(Z(i.outsideAngular),B(()=>n.runOutsideAngular(()=>import("./chunk-XRLXIT7I.js"))),j(()=>Pe(s,n,e)),j(C=>wr(C,n,a,c,u,f,l,d)),pe({bufferSize:1,refCount:!1}));if(Je(t))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=X(null);else{y.pipe(He()).subscribe();let C=y.pipe(B(I=>I.getRedirectResult().then(N=>N,()=>null)),rt(this.injector),pe({bufferSize:1,refCount:!1})),W=y.pipe(B(I=>new m(N=>({unsubscribe:n.runOutsideAngular(()=>I.onAuthStateChanged($=>N.next($),$=>N.error($),()=>N.complete()))})))),J=y.pipe(B(I=>new m(N=>({unsubscribe:n.runOutsideAngular(()=>I.onIdTokenChanged($=>N.next($),$=>N.error($),()=>N.complete()))}))));this.authState=C.pipe(fe(W),re(i.outsideAngular),Z(i.insideAngular)),this.user=C.pipe(fe(J),re(i.outsideAngular),Z(i.insideAngular)),this.idToken=this.user.pipe(B(I=>I?M(I.getIdToken()):X(null))),this.idTokenResult=this.user.pipe(B(I=>I?M(I.getIdTokenResult()):X(null))),this.credential=Le(C,p,this.authState.pipe(Ue(I=>!I))).pipe(j(I=>I?.user?I:null),re(i.outsideAngular),Z(i.insideAngular))}return St(this,y,n,{spy:{apply:(C,W,J)=>{(C.startsWith("signIn")||C.startsWith("createUser"))&&J.then(I=>p.next(I))}}})}static \u0275fac=function(e){return new(e||r)(g(le),g(ue,8),g(z),g(V),g(Ae),g(hr,8),g(pr,8),g(fr,8),g(gr,8),g(mr,8),g(yr,8),g(ae,8))};static \u0275prov=T({token:r,factory:r.\u0275fac,providedIn:"any"})}return r})(),ki=(()=>{class r{constructor(){R.registerVersion("angularfire",G.full,"auth-compat")}static \u0275fac=function(e){return new(e||r)};static \u0275mod=q({type:r});static \u0275inj=K({providers:[xe]})}return r})();var A=(function(r){return r.readonly="readonly",r.readwrite="readwrite",r})(A||{}),kt=new P(null),At=new P("Indexed DB"),vr=new P("Server Indexed DB");function kr(r,o){return r.objectStoreNames.contains(o)}function D(r,o,s){if(!r){s("You need to use the openDatabase function to create a database before you query it!");return}kr(r,o)||s(`objectStore does not exists: ${o}`)}function b(r,o){let s=r.transaction(o.storeName,o.dbMode);return s.onerror=o.error,s.onabort=o.abort,s}function E(r,o,s,e){return{storeName:o,dbMode:r,error:t=>{s(t)},abort:t=>{s(t)}}}var _e=[];function S(r,o,s,e){return new Promise((t,n)=>{r||n("IndexedDB not available");let i=r.open(o,s),a;i.onsuccess=()=>{a=i.result,_e.push(a),t(a)},i.onerror=()=>{n(`IndexedDB error: ${i.error}`)},typeof e=="function"&&(i.onupgradeneeded=l=>{e(l,a)})})}function Re(r,o,s,e,t){return k(this,null,function*(){return new Promise((n,i)=>{if(!r)return;let a=r.open(o,s);a.onupgradeneeded=l=>k(null,null,function*(){let c=l.target.result,u=e.map(d=>k(null,null,function*(){if(!c.objectStoreNames.contains(d.store)){let h=c.createObjectStore(d.store,d.storeConfig);for(let p of d.storeSchema)h.createIndex(p.name,p.keypath,p.options)}}));yield Promise.all(u);let f=t&&t();if(f){let d=Object.keys(f).map(h=>parseInt(h,10)).filter(h=>h>l.oldVersion).sort((h,p)=>h-p);for(let h of d)f[h](c,a.transaction)}c.close(),n()}),a.onsuccess=l=>{l.target.result.close(),n()},a.onerror=l=>{i(l)}})})}function Ar(r,o,s){if(!r||!o||!s)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new m(e=>{try{let t=o+1,n=indexedDB.open(r,t);n.onupgradeneeded=i=>{let a=i.target.result;a.deleteObjectStore(s),a.close(),console.log("onupgradeneeded"),e.next(),e.complete()},n.onerror=i=>e.error(i)}catch(t){e.error(t)}})}function br(r){return new Promise((o,s)=>{if(!r){s(new Error("No database to close"));return}try{r.close(),o()}catch(e){s(`Error closing database: ${e}`)}})}function v(){return function(r,o,s){let e=s.value;return s.value=function(...t){let n=e.apply(this,t);return n instanceof m?n.pipe($e(()=>k(this,null,function*(){let i=_e.map(a=>k(this,null,function*(){yield br(a)}));yield Promise.all(i),_e.length=0}))):n},s}}var Oe=(()=>{let o=class o{constructor(e,t){this.dbConfigs=e,this.indexedDB=t,this.defaultDatabaseName=null,Object.values(this.dbConfigs).forEach((n,i,a)=>this.instanciateConfig(n,a.length===1))}instanciateConfig(e,t){return k(this,null,function*(){if(!e.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if((e.isDefault??!1)&&this.defaultDatabaseName)throw new Error("NgxIndexedDB: Only one database can be set as default");((e.isDefault??!1)&&!this.defaultDatabaseName||t)&&(this.defaultDatabaseName=e.name,this.selectedDb=e.name),yield Re(this.indexedDB,e.name,e.version,e.objectStoresMeta,e.migrationFactory),S(this.indexedDB,e.name).then(n=>{n.version!==e.version&&(H()&&(console.warn(`
|
|
4
4
|
Your DB Config doesn't match the most recent version of the DB with name ${e.name}, please update it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as x}from"./chunk-PMVDQ2OP.js";import{a as O}from"./chunk-E66QUDQF.js";import{a as p}from"./chunk-
|
|
1
|
+
import{a as x}from"./chunk-PMVDQ2OP.js";import{a as O}from"./chunk-E66QUDQF.js";import{a as p}from"./chunk-ADKAX3OO.js";import"./chunk-4VNQYYVV.js";import{b}from"./chunk-FKGKMEDE.js";import"./chunk-ZKIO2ZQ6.js";import{a as m}from"./chunk-UCEZJNIL.js";import{a as P}from"./chunk-36U7D4LI.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import"./chunk-FCEXPGTK.js";import{c as C}from"./chunk-5BSPSA4O.js";import"./chunk-FULVA6QB.js";import"./chunk-HPINZVE4.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import"./chunk-ZSUWHVKX.js";import"./chunk-N5AE5WMQ.js";import"./chunk-6OJQRHIZ.js";import{e as f}from"./chunk-6KWG6O5L.js";import{a as h}from"./chunk-PDCVMSLL.js";import"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-AGBJEXIM.js";import"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import"./chunk-JBEKD57G.js";import{n as M}from"./chunk-EDEZ3JLR.js";import{A as g}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import{w as u}from"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{E as s,I as a,m as i}from"./chunk-LNJUGHOX.js";import{Gb as l,Hb as r,jc as c,na as e}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var w=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=l({type:t,selectors:[["app-products"]],standalone:!1,decls:1,vars:0,template:function(n,N){n&1&&c(0,"router-outlet")},dependencies:[s],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=t;return o})();var v=[{path:"",component:w,children:[{path:"",redirectTo:"status",pathMatch:"full"},{path:"status",loadChildren:()=>import("./chunk-QCV5XC3U.js").then(o=>o.StatusModule),canActivate:[m,p]},{path:"download",loadChildren:()=>import("./chunk-Y77WYZ6Y.js").then(o=>o.DownloadModule),canActivate:[m,p]},{path:"upload",loadComponent:()=>import("./chunk-UBTALPOC.js").then(o=>o.ProductUploadComponent),data:{title:"Upload Product"},canActivate:[m,p]}]}],y=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,a.forChild(v)]});let o=t;return o})();var Y=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=r({type:t}),t.\u0275inj=e({imports:[i,g,a,y,u,M,f,b,h,C,P,O,x]});let o=t;return o})();export{Y as ProductModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-UCEZJNIL.js";import{a as b}from"./chunk-IM5M2CAI.js";import{a as y,b as C}from"./chunk-A7PUMY67.js";import"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-AGBJEXIM.js";import"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import"./chunk-JBEKD57G.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{E as v,I as o,m as h}from"./chunk-LNJUGHOX.js";import{Gb as l,Hb as s,Zc as f,gc as c,hc as u,ic as d,jc as i,na as m,nb as p}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var T=(()=>{let e=class e{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"},{Title:"Different Inventory",Url:"/menu/inventory/channel_summary"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=l({type:e,selectors:[["app-inventory"]],features:[f([b])],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,M){n&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),i(3,"nav-tab",2),d()()(),i(4,"router-outlet")),n&2&&(p(3),c("Tabs",M.inventoryTabs))},dependencies:[C,y,o,v],encapsulation:2});let t=e;return t})();var S=[{path:"",component:T,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-RCBY7EIY.js").then(t=>t.MultiChannelComparison)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-MKADKY44.js").then(t=>t.SingleChannelComparisonComponent)},canActivate:[r],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-CAZ7U2IL.js").then(t=>t.ChannelSummaryComponent)},canActivate:[r],data:{title:"Different Inventory"}}]}],G=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=s({type:e}),e.\u0275inj=m({imports:[h,o.forChild(S)]});let t=e;return t})();export{G as InventoryRoutingModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as re}from"./chunk-7JQEF4XX.js";import{a as pe,b as me}from"./chunk-FKGKMEDE.js";import"./chunk-ZKIO2ZQ6.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import"./chunk-FCEXPGTK.js";import"./chunk-FULVA6QB.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import"./chunk-N5AE5WMQ.js";import{a as te,b as ne,d as ie,e as ae}from"./chunk-6KWG6O5L.js";import{i as ee}from"./chunk-
|
|
1
|
+
import{a as re}from"./chunk-7JQEF4XX.js";import{a as pe,b as me}from"./chunk-FKGKMEDE.js";import"./chunk-ZKIO2ZQ6.js";import"./chunk-ZTHO6JJM.js";import"./chunk-SHUYFOQI.js";import"./chunk-FCEXPGTK.js";import"./chunk-FULVA6QB.js";import"./chunk-D2J64VUP.js";import"./chunk-6Q6L5NUD.js";import"./chunk-C7N6EI73.js";import"./chunk-GPHNPV7O.js";import"./chunk-4YCSITNV.js";import"./chunk-WHHW4IZT.js";import"./chunk-N5AE5WMQ.js";import{a as te,b as ne,d as ie,e as ae}from"./chunk-6KWG6O5L.js";import{i as ee}from"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-AGBJEXIM.js";import{e as Z}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import{c as Y}from"./chunk-JBEKD57G.js";import{m as oe,n as le}from"./chunk-EDEZ3JLR.js";import{A as X,h as K,m as Q}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{i as k,j as H,k as U,m as G}from"./chunk-LNJUGHOX.js";import{$b as R,Gb as P,Mb as B,Mc as s,Nc as f,Oc as y,Qc as z,Rc as A,Sc as V,Z as M,Zc as J,aa as D,ac as T,bc as $,cc as F,ec as j,fc as O,g as L,gc as h,hc as a,hd as c,ic as o,id as d,jc as u,jd as W,lb as S,ma as w,nb as p,qc as q,ra as g,v as I,vc as v,xa as E,xc as x,ya as N}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import{a as _}from"./chunk-66YHNWRR.js";var b=(()=>{let t=class t{constructor(){this.httpService=g(Z),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(D(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=_(_({},e),n),this._pageination.next(e)}};t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=w({token:t,factory:t.\u0275fac});let i=t;return i})();function ce(i,t){if(i&1&&(a(0,"span",10),u(1,"img",11),o(),s(2)),i&2){let l=t.item;p(),h("src",l.Img,S)("alt",l.Name),p(),y(" ",l.Name," ")}}function de(i,t){if(i&1&&(a(0,"tr")(1,"td"),u(2,"img",17),a(3,"span"),s(4),o()(),a(5,"td")(6,"span",18),s(7),c(8,"json"),o()(),a(9,"td"),s(10),c(11,"json"),o(),a(12,"td"),s(13),c(14,"date"),o()()),i&2){let l=t.$implicit;p(2),h("src",l.Img,S),p(2),y(" ",l.ChannelName," "),p(3),f(d(8,5,l.Request)),p(3),f(d(11,7,l.Response)),p(3),f(W(14,9,l.Created,"dd-MM-yyyy hh:mm:ss"))}}function he(i,t){if(i&1){let l=q();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"),j(13,de,15,12,"tr",null,F),c(15,"async"),o()(),a(16,"mat-paginator",16),c(17,"async"),c(18,"async"),c(19,"async"),c(20,"async"),v("page",function(e){E(l);let r=x();return N(r.channelLogService.onPaginationChange(e))}),o()()}if(i&2){let l,n,e,r,m=x();p(13),O((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),u(1,"app-empty-state"),o())}var qe=(()=>{let t=class t{constructor(){this.channelLogService=g(b),this.authService=g(ee),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(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=Y.getChannelLogoByTypeId(e.TypeID),e)):n.Data=[],n)),M(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=P({type:t,selectors:[["app-channel-log"]],features:[J([b])],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"],[1,""]],template:function(e,r){if(e&1&&(a(0,"mainpanel",0),v("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),V("ngModelChange",function(C){return A(r.channelID,C)||(r.channelID=C),C}),B(7,ce,3,3,"ng-template",4),o()()()(),a(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),R(12,he,21,13,"div",8),c(13,"async"),T(14,ge,2,0,"div",9),o()()()()()),e&2){let m;h("hideSearchBox",!0),p(6),h("clearable",!0)("items",r.channelOptions),z("ngModel",r.channelID),p(6),$(((m=d(13,5,r.channelLogs$))==null||m.Data==null?null:m.Data.length)>0?12:14)}},dependencies:[G,le,oe,re,me,pe,ae,ie,te,ne,X,K,Q,k,U,H],encapsulation:2});let i=t;return i})();export{qe as ChannelLogComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as _}from"./chunk-
|
|
1
|
+
import{f as _}from"./chunk-I723PUUO.js";import{c as a}from"./chunk-JBEKD57G.js";import{G as k,I as C}from"./chunk-LNJUGHOX.js";import{$b as I,Gb as v,Mc as u,Oc as p,ad as D,bc as g,gc as s,hc as c,ic as m,lb as b,ma as h,nb as l,od as f,ra as o,td as x,xc as d}from"./chunk-ZYJ6LAJ3.js";var y=(()=>{let e=class e{constructor(){this.localDataService=o(_),this.baseUrl=this.localDataService.getHostName()}getBaseUrl(n){let r="";return a.IsNotEmpty(n.ID)?r=`https://${this.baseUrl}/menu/Orders/Orders/Customer_Invoice/Info?ID=${n.ID}`:r="/menu/Order/detail",r}};e.\u0275fac=function(r){return new(r||e)},e.\u0275prov=h({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();var U=(t,e)=>({Number:t,Outlet:e});function L(t,e){if(t&1&&(c(0,"a",0),u(1),m()),t&2){let i,n=d();s("href",n.baseUrl(),b),l(),p(" ",(i=n.order())==null?null:i.Number," ")}}function S(t,e){if(t&1&&(c(0,"a",1),u(1),m()),t&2){let i,n,r=d();s("routerLink",r.baseUrl())("queryParams",D(3,U,(i=r.order())==null?null:i.Number,(i=r.order())==null?null:i.Outlet)),l(),p(" ",(n=r.order())==null?null:n.Number," ")}}var z=(()=>{let e=class e{constructor(){this.order=x(),this.generateLinkService=o(y),this.baseUrl=f(()=>this.generateLinkService.getBaseUrl(this.order())),this.hasOrderID=f(()=>a.IsNotEmpty(this.order()?.ID))}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=v({type:e,selectors:[["order-link"]],inputs:{order:[1,"order"]},decls:2,vars:1,consts:[["target","_blank",3,"href"],["target","_blank",3,"routerLink","queryParams"]],template:function(r,N){r&1&&I(0,L,2,2,"a",0)(1,S,2,6,"a",1),r&2&&g(N.hasOrderID()?0:1)},dependencies:[C,k],encapsulation:2});let t=e;return t})();export{z as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Q}from"./chunk-6OJQRHIZ.js";import{a as q}from"./chunk-FHER4TFY.js";import{a as X}from"./chunk-
|
|
1
|
+
import{a as Q}from"./chunk-6OJQRHIZ.js";import{a as q}from"./chunk-FHER4TFY.js";import{a as X}from"./chunk-5KYN6Y7M.js";import"./chunk-3JRUKSV3.js";import"./chunk-SJ5MC42H.js";import"./chunk-4RLWHMI6.js";import"./chunk-NWB7EVME.js";import{a as J}from"./chunk-PDCVMSLL.js";import"./chunk-AFDI4TD4.js";import"./chunk-4RG5YR7N.js";import"./chunk-5MV3UFJQ.js";import"./chunk-E6AMKEQR.js";import"./chunk-IGKMJFKP.js";import"./chunk-ITGVXYDV.js";import"./chunk-HK5FXZE4.js";import"./chunk-KJE5GRQ4.js";import"./chunk-4ILDFTIG.js";import"./chunk-A6QXXKPR.js";import"./chunk-I723PUUO.js";import"./chunk-QXRG5XYP.js";import"./chunk-RXLMJGUY.js";import"./chunk-M4ZE35XK.js";import"./chunk-L7WZ6U4T.js";import"./chunk-LOWGZOML.js";import"./chunk-5PMKN6PM.js";import{a as M}from"./chunk-AGBJEXIM.js";import{e as Z}from"./chunk-OXWPYJNB.js";import"./chunk-XBIHN6D3.js";import"./chunk-JBEKD57G.js";import{m as j,n as z}from"./chunk-EDEZ3JLR.js";import{A as H,h as $,m as G}from"./chunk-L3W6SG2T.js";import"./chunk-YTHY4IFS.js";import"./chunk-ZETUYNFJ.js";import"./chunk-STYL7ETF.js";import"./chunk-XLIPGDSC.js";import{G as O,I as W,i as N,l as R,m as F}from"./chunk-LNJUGHOX.js";import{$b as I,Gb as U,Ha as V,Mc as a,Nc as g,Qc as P,Rc as T,Sc as B,Tc as A,Z as b,bc as k,cc as E,ec as L,fc as K,gc as s,hc as e,hd as v,ic as t,id as y,jc as c,lb as D,nb as l,qc as w,ra as x,vc as h,xa as u,xc as S,ya as d}from"./chunk-ZYJ6LAJ3.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function Y(r,p){if(r&1){let o=w();e(0,"img",21),h("click",function(m){u(o);let i=S().$implicit,n=S();return d(n.onZoomImage(m,i==null?null:i.ImageUrl))}),t()}if(r&2){let o=S().$implicit;s("src",o==null?null:o.ThumbnailUrl,D)}}function ee(r,p){r&1&&c(0,"img",17)}function te(r,p){if(r&1&&(e(0,"tr")(1,"td")(2,"div",15),I(3,Y,1,1,"img",16)(4,ee,1,0,"img",17),t()(),e(5,"td"),a(6),t(),e(7,"td"),a(8),t(),e(9,"td")(10,"div",18),c(11,"app-channel-logo",19),e(12,"span"),a(13),t()()(),e(14,"td",20),a(15),v(16,"number"),t()()),r&2){let o=p.$implicit;l(3),k(o.ImageUrl?3:4),l(3),g(o.Name),l(2),g(o.SKU),l(3),s("typeId",o.TypeID),l(2),g(o.ChannelName),l(2),g(y(16,6,o.Count))}}var we=(()=>{let p=class p{constructor(){this.httpService=x(Z),this.biggerPictureService=x(Q),this.filter=V({PageNumber:1,RowCount:20,ListChannelID:[]}),this.rowCountApi=M.GetMultilistingSKUCount,this.initMultipleListingSKU()}initMultipleListingSKU(){this.multipleListingSKU$=this.httpService.post(M.GetMultiListingSKU,this.filter()).pipe(b(1))}onZoomImage(_,m){this.biggerPictureService.openBiggerPicture(_,m)}};p.\u0275fac=function(m){return new(m||p)},p.\u0275cmp=U({type:p,selectors:[["app-duplicate-sku-v2"]],decls:33,vars:8,consts:[["headerTitle","Duplicate SKU","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit","hideSearchBox"],["routerLink","/menu/products/status/duplicate-sku",1,"d-flex","align-items-center","gap-2","btn","btn-outline-secondary","btn-lg"],[1,"fa-solid","fa-credit-card"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[2,"width","200px"],[2,"width","250px"],[1,"text-end",2,"width","50px"],[3,"next","previous","filter","totaldata","rowCountApi"],[2,"padding-right","0px"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],[1,"d-flex","align-items-center"],[3,"typeId"],[1,"text-end"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"]],template:function(m,i){if(m&1){let n=w();A(0),v(1,"async"),e(2,"mainpanel",0),h("onSubmit",function(){return u(n),d(i.initMultipleListingSKU())}),e(3,"actions")(4,"a",1),c(5,"i",2),e(6,"span"),a(7,"Card View"),t()()(),e(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),t(),e(12,"app-channel-options-v2",4),B("ngModelChange",function(C){return u(n),T(i.filter().ListChannelID,C)||(i.filter().ListChannelID=C),d(C)}),t()()(),e(13,"content")(14,"div",5)(15,"div",6)(16,"div",7)(17,"table",8)(18,"thead",9)(19,"tr"),c(20,"th",10),e(21,"th"),a(22,"Product"),t(),e(23,"th",11),a(24,"SKU"),t(),e(25,"th",12),a(26,"Channel"),t(),e(27,"th",13),a(28,"Count"),t()()(),e(29,"tbody"),L(30,te,17,8,"tr",null,E),t()(),e(32,"app-custom-paginator",14),h("next",function(){return u(n),d(i.initMultipleListingSKU())})("previous",function(){return u(n),d(i.initMultipleListingSKU())}),t()()()()()()}if(m&2){let n=y(1,6,i.multipleListingSKU$);l(2),s("hideSearchBox",!0),l(10),s("multiple",!0),P("ngModel",i.filter().ListChannelID),l(18),K(n==null?null:n.Data),l(2),s("filter",i.filter())("totaldata",n==null||n.Data==null?null:n.Data.length)("rowCountApi",i.rowCountApi)}},dependencies:[F,z,j,J,W,O,q,X,H,$,G,N,R],encapsulation:2});let r=p;return r})();export{we as DuplicateSkuV2Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as F}from"./chunk-5X2E3W32.js";import{a as x}from"./chunk-
|
|
1
|
+
import{a as F}from"./chunk-5X2E3W32.js";import{a as x}from"./chunk-2IASUYTM.js";import{i as E}from"./chunk-I723PUUO.js";import{a as T}from"./chunk-AGBJEXIM.js";import{b as w,e as d}from"./chunk-OXWPYJNB.js";import{b as i,c as g}from"./chunk-JBEKD57G.js";import{F as D}from"./chunk-LNJUGHOX.js";import{B as U,G as C,Ha as j,J as l,g as A,ma as s,q as u,ra as p,v as I}from"./chunk-ZYJ6LAJ3.js";var H=(()=>{let o=class o{constructor(){this.httpService=p(d)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(l(r=>u(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(r=>({value_id:r.value_id,name:r.name}))})),t}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var R=(()=>{let o=class o{constructor(){this.httpService=p(d)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(l(r=>u(null)))}generateAttribute(t){let e;return t.map(r=>(r.type=="PRODUCT_PROPERTY"?e={id:r.id,name:r.name,type:r.type,values:r.values}:e={id:r.id,name:r.values[0].id,type:r.type},e))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var V=(()=>{let o=class o{constructor(){this.httpService=p(d)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var z=(()=>{let o=class o{constructor(){this.httpService=p(d)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var y=class{};var v=class{};var G=(()=>{let o=class o{constructor(){this.httpService=p(d)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var N=(()=>{let o=class o{constructor(){this.httpService=p(d)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var O=(()=>{let o=class o{constructor(){this.httpService=p(d)}uploadProduct(t){return this.httpService.post(T.UploadPlugoProduct,t).pipe(l(e=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var Bt=(()=>{let o=class o{constructor(){this.authService=p(E),this.productService=p(x),this.shoppeUploadService=p(H),this.tiktokUploadService=p(R),this.lazadaUploadService=p(V),this.tokopediaUploadService=p(G),this.wooUploadService=p(z),this.shopifyUploadService=p(N),this.plugoUploadService=p(O),this.toastrHandlingService=p(F),this.toastr=p(w),this.router=p(D),this.httpService=p(d),this._selectedProduct=new A(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(C(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return j(t.map(r=>{let c=new y;return c.id=r.ID,c.name=r.Name,c.type=r.TypeID,c.categoryId=null,c.attributes=[],c.selected=!1,c}))}onUploadProduct(t){let e=t.filter(r=>r.selected&&g.IsNotEmpty(r.categoryId)||r.selected&&(r.type==i.Shopify||r.type==i.ShopifyV2||r.type==i.Plugo));if(e.length>0){let r=this.generateDataForUpload(e);this.uploadProduct(r)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);U(e).pipe(I(r=>{let c=[];return r.filter(f=>g.IsNotEmpty(f)).forEach(f=>{c=[...c,...f]}),c})).subscribe({next:(r=[])=>{g.IsNotEmpty(r)&&this.toastrHandlingService.showToastrUploadMultiple(r),this.hasSuccessRes(r)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(r=>{r?.Response.Success_list?.length>0&&g.IsNotEmpty(r)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],r=[],c=[],f=[],S=[],k=[],P=[],b=[];t.forEach(n=>{switch(n.ChannelType){case i.Shopee:r.push(n);break;case i.Tiktok:e.push(n);break;case i.Lazada:c.push(n);break;case i.Tokopedia:f.push(n);break;case i.WooCommerce:S.push(n);break;case i.Shopify:k.push(n);break;case i.ShopifyV2:P.push(n);break;case i.Plugo:b.push(n);break}});let h=[];return[{type:i.Shopee,data:r},{type:i.Tiktok,data:e},{type:i.Lazada,data:c},{type:i.Tokopedia,data:f},{type:i.WooCommerce,data:S},{type:i.Shopify,data:k},{type:i.ShopifyV2,data:P},{type:i.Plugo,data:b}].filter(n=>n.data.length>0).forEach(n=>{switch(n.type){case i.Shopee:h.push(this.shoppeUploadService.uploadProduct(r));break;case i.Tiktok:h.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:h.push(this.lazadaUploadService.uploadProduct(c));break;case i.Tokopedia:h.push(this.tokopediaUploadService.uploadProduct(f));break;case i.WooCommerce:h.push(this.wooUploadService.uploadProduct(S));break;case i.Shopify:h.push(this.shopifyUploadService.uploadProduct(k));break;case i.ShopifyV2:h.push(this.shopifyUploadService.uploadProduct(P));break;case i.Plugo:h.push(this.plugoUploadService.uploadProduct(b));break}}),h}generateDataForUpload(t){let e=[];return t.forEach(r=>{let c=new v;c.ChannelID=r.id,c.ChannelType=r.type,c.Products=this._selectedProduct.getValue(),r.type==i.Shopify||r.type==i.ShopifyV2?delete c.CategoryID:c.CategoryID=r.categoryId,c=this.generateAttributeHttpRequest(r,c),e.push(c)}),e}generateAttributeHttpRequest(t,e){return t.type==i.WooCommerce||t.type==i.Shopify||t.type==i.ShopifyV2?e.Attribute=t.attributes[0]:t.type==i.Tiktok?(e.Attributes=this.formatAttributes(t.type,t.attributes),e.listing_platforms=t.listing_platforms):e.Attributes=this.formatAttributes(t.type,t.attributes),e}formatAttributes(t,e){let r;switch(t){case i.Shopee:r=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:r=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:r=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:r=e;break;case i.Shopify:r=e;break;case i.ShopifyV2:r=e;break;default:r=[];break}return r}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();export{H as a,R as b,V as c,z as d,Bt as e};
|