marketplacepos 5.51.0 → 5.51.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-53B6D5OR.js → chunk-26E54WQH.js} +1 -1
- package/Marketplace/{chunk-AZEH7PMO.js → chunk-3KECTTUV.js} +1 -1
- package/Marketplace/{chunk-WEJBY3OB.js → chunk-4XA7JWTB.js} +1 -1
- package/Marketplace/{chunk-BLOGT3TL.js → chunk-575TS45M.js} +1 -1
- package/Marketplace/{chunk-ZMSM2NR7.js → chunk-75RVMUFO.js} +1 -1
- package/Marketplace/{chunk-36OIR6DM.js → chunk-AMQMYSQR.js} +1 -1
- package/Marketplace/{chunk-7E6JD2PT.js → chunk-APQWBZOM.js} +1 -1
- package/Marketplace/{chunk-EYYKWIXP.js → chunk-AVSAALDJ.js} +1 -1
- package/Marketplace/{chunk-AF6XAQPY.js → chunk-AVTQG66S.js} +1 -1
- package/Marketplace/{chunk-T62YFSKW.js → chunk-BKVIOCLH.js} +1 -1
- package/Marketplace/{chunk-IXNEMOFX.js → chunk-BZ7QY7N3.js} +1 -1
- package/Marketplace/{chunk-GD5I7ADU.js → chunk-CHCAQ4NV.js} +1 -1
- package/Marketplace/{chunk-Q5IVQP3E.js → chunk-DCMOITWM.js} +1 -1
- package/Marketplace/{chunk-VBVBTC2P.js → chunk-DOQD3RMB.js} +1 -1
- package/Marketplace/{chunk-YF7CCYHF.js → chunk-DV3BDHBL.js} +1 -1
- package/Marketplace/{chunk-OPCGCQMZ.js → chunk-DVJ7VXWL.js} +1 -1
- package/Marketplace/{chunk-XSOP2OTT.js → chunk-DW7R34MP.js} +1 -1
- package/Marketplace/{chunk-J4RDYEJC.js → chunk-EXKAFEQL.js} +1 -1
- package/Marketplace/{chunk-HT2MSA66.js → chunk-FQM4RKLX.js} +1 -1
- package/Marketplace/{chunk-EGJMTFNO.js → chunk-GYQHWDWX.js} +1 -1
- package/Marketplace/{chunk-SASGSPGQ.js → chunk-HO6XCGRR.js} +1 -1
- package/Marketplace/{chunk-HZTKN5RX.js → chunk-HPQDUJXF.js} +1 -1
- package/Marketplace/{chunk-E6W25RW5.js → chunk-ICY32GYN.js} +1 -1
- package/Marketplace/{chunk-ILFUI3MT.js → chunk-ILFG3IYB.js} +1 -1
- package/Marketplace/{chunk-4JCS7WPV.js → chunk-IUJ6UX3L.js} +1 -1
- package/Marketplace/{chunk-62YNPW6Q.js → chunk-J4552BMI.js} +1 -1
- package/Marketplace/{chunk-M5JNIPMS.js → chunk-JUN3HVEV.js} +1 -1
- package/Marketplace/{chunk-BKCKASH3.js → chunk-KHGTW7IV.js} +1 -1
- package/Marketplace/{chunk-364CDNZV.js → chunk-KVLHLMO4.js} +1 -1
- package/Marketplace/{chunk-5YQUGH5Z.js → chunk-LB276KSA.js} +1 -1
- package/Marketplace/{chunk-3Q6QZGLZ.js → chunk-MG7B4OWR.js} +1 -1
- package/Marketplace/{chunk-T3CN3WQD.js → chunk-MRWGPCR7.js} +1 -1
- package/Marketplace/{chunk-2PMJPSC4.js → chunk-N6VPSXF7.js} +2 -2
- package/Marketplace/{chunk-K2CHDL7K.js → chunk-NEB6AMMM.js} +1 -1
- package/Marketplace/{chunk-4ITXH35D.js → chunk-NKN7T3C3.js} +1 -1
- package/Marketplace/{chunk-C64L25TP.js → chunk-NMOQXVWS.js} +1 -1
- package/Marketplace/{chunk-7RIUHK6K.js → chunk-NUF326RW.js} +1 -1
- package/Marketplace/{chunk-SLQ42VND.js → chunk-NX3QFU4A.js} +1 -1
- package/Marketplace/{chunk-LWUMLKSO.js → chunk-OEUA6IL2.js} +1 -1
- package/Marketplace/{chunk-OJI34QN5.js → chunk-PGQYHHH3.js} +1 -1
- package/Marketplace/{chunk-6DGG765N.js → chunk-Q3Z7EEVP.js} +1 -1
- package/Marketplace/{chunk-ZMMMNVOU.js → chunk-QJ7SMXW4.js} +1 -1
- package/Marketplace/{chunk-LOVYZLSU.js → chunk-QLFVXMNJ.js} +1 -1
- package/Marketplace/{chunk-TLTFNFAB.js → chunk-QPELTSKE.js} +1 -1
- package/Marketplace/{chunk-ZXFWQ6VJ.js → chunk-QUIZLT5F.js} +1 -1
- package/Marketplace/{chunk-LCN52IJT.js → chunk-REDQ2L7Y.js} +1 -1
- package/Marketplace/{chunk-7QDKBMEA.js → chunk-SLCKHYT3.js} +1 -1
- package/Marketplace/{chunk-XAL6YLNQ.js → chunk-U4ARIHUF.js} +1 -1
- package/Marketplace/{chunk-A4X7F4MN.js → chunk-UHWLUO2C.js} +1 -1
- package/Marketplace/{chunk-R3BRUX7Z.js → chunk-UJAA73LE.js} +1 -1
- package/Marketplace/{chunk-EX4C4ZW4.js → chunk-UOFJCKS5.js} +1 -1
- package/Marketplace/{chunk-6IZWIEUD.js → chunk-VRD2D2BP.js} +1 -1
- package/Marketplace/{chunk-WH76SMZT.js → chunk-WZQRKTBN.js} +1 -1
- package/Marketplace/{chunk-BVW7WI5I.js → chunk-YFR3EI3B.js} +1 -1
- package/Marketplace/{chunk-OMY5ASFA.js → chunk-YMOSVDG5.js} +1 -1
- package/Marketplace/{chunk-25Q56ATV.js → chunk-YSYA7XCF.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-SOO5LINL.js → main-I5THR2C3.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as ot}from"./chunk-BZWZ64N5.js";import{a as lt}from"./chunk-
|
|
1
|
+
import{e as ot}from"./chunk-BZWZ64N5.js";import{a as lt}from"./chunk-QUIZLT5F.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as at}from"./chunk-7KG3DC5J.js";import{a as rt}from"./chunk-ZZYFVEJO.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import{b as it}from"./chunk-KHGTW7IV.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as nt}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-JTKEMQZT.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{c as K}from"./chunk-UPRDDI4K.js";import{A as et,h as Z,m as tt}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{e as Q}from"./chunk-D6JH2KV4.js";import{e as X,g as Y}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as U,B as G,q,w as A,y as J}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as z,Hb as L,Nc as l,Oc as x,Pc as w,Rc as V,Sc as k,Tc as H,Xc as O,Z as v,ac as g,ad as W,bd as j,ca as E,cc as S,ec as F,f as D,fc as R,gc as $,hc as d,ic as o,id as c,jc as a,jd as u,kc as N,kd as I,lb as M,mb as P,ob as p,ra as b,rc as B,v as _,wc as T,ya as C,yc as s,za as h}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var pt=(i,r)=>({"bg-gradient-danger":i,"bg-gradient-warning":r}),st=()=>["/menu/products/status/notification/detail"],ct=i=>({ID:i});function mt(i,r){if(i&1&&(l(0),c(1,"number"),o(2,"span"),l(3,"s"),a()),i&2){let n=s().$implicit;w(" ",I(1,1,n.DurationInSecond,"1.1-1")," ")}}function dt(i,r){i&1&&l(0," - ")}function ut(i,r){if(i&1&&(o(0,"tr",11)(1,"td")(2,"a",12),N(3,"img",13),o(4,"span"),l(5),a()()(),o(6,"td")(7,"b"),l(8),a(),N(9,"div",14),a(),o(10,"td"),g(11,mt,4,4)(12,dt,1,0),a(),o(13,"td"),l(14),a(),o(15,"td"),l(16),c(17,"date"),a()()),i&2){let n=r.$implicit;d("ngClass",j(14,pt,n.Status==1,n.Status==0)),p(2),d("routerLink",z(17,st))("queryParams",W(18,ct,n.ID)),p(),d("src",O(n.Img),P),p(2),x(n.Name),p(3),x(n.Label),p(),d("innerHTML",n.Message,M),p(2),S(n.DurationInSecond?11:12),p(3),x(n.StatusLabel),p(2),w(" ",I(17,11,n.Created,"dd MMM yyyy HH:mm")," ")}}function ft(i,r){if(i&1){let n=B();o(0,"div",5)(1,"div",15)(2,"app-custom-paginator",16),c(3,"async"),c(4,"async"),T("total",function(){C(n);let t=s(2);return h(t.getRowCount())})("next",function(){C(n);let t=s(2);return h(t.getNotifications())})("previous",function(){C(n);let t=s(2);return h(t.getNotifications())}),a()()()}if(i&2){let n=s(),e=s();p(2),d("filter",e.filter)("totaldata",n==null?null:n.length)("paginationTotal",u(3,4,e.rowCount$))("hasClicked",u(4,6,e.rowCount$))}}function _t(i,r){i&1&&g(0,ft,5,8,"div",5),i&2&&S(r.length>0?0:-1)}var $t=(()=>{let r=class r{constructor(){this.http=b(Q),this.notificationService=b(it),this.filter=new at,this.destroy$=new D}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(E(this.destroy$)).subscribe(e=>{e.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(e=>{this.filter=e.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let e={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",e).pipe(_(t=>t.Data),_(t=>(t=this.setChannelLogoToNotifications(t),t=this.setTimeToSecond(t),t)),v(1))}setTimeToSecond(e){return e=e.map(t=>(t.DurationInSecond=parseInt(t.Duration)/1e3,t)),e}setChannelLogoToNotifications(e){return e=e.map(t=>(t.Img=K.getChannelLogoByTypeId(t.TypeID),t)),e}getRowCount(){let e={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",e).pipe(_(t=>t.Count),v(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};r.\u0275fac=function(t){return new(t||r)},r.\u0275cmp=L({type:r,selectors:[["app-notification"]],decls:33,vars:6,consts:[["headerTitle","Product Scan Job","hideSearchBox","true",3,"onSubmit"],["routerLink","/menu/products/status/notificationV2",1,"btn","btn-outline-secondary","btn-lg"],[1,"mb-2"],[3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(t,m){if(t&1&&(o(0,"mainpanel",0),T("onSubmit",function(){return m.onFilter()}),o(1,"actions")(2,"a",1),l(3," Scan Job V2 "),a()(),o(4,"filters")(5,"div")(6,"h6",2),l(7,"Channel"),a(),o(8,"app-channel-options-v2",3),H("ngModelChange",function(y){return k(m.filter.ChannelID,y)||(m.filter.ChannelID=y),y}),a()()(),o(9,"content")(10,"div",4)(11,"div",5)(12,"div",6)(13,"div",7)(14,"table",8)(15,"thead",9)(16,"tr",10)(17,"th"),l(18,"Channel"),a(),o(19,"th"),l(20,"Process"),a(),o(21,"th"),l(22,"Duration"),a(),o(23,"th"),l(24,"Status"),a(),o(25,"th"),l(26,"Created"),a()()(),o(27,"tbody"),R(28,ut,18,20,"tr",11,F),c(30,"async"),a()()()()(),g(31,_t,1,1),c(32,"async"),a()()()),t&2){let f;p(8),V("ngModel",m.filter.ChannelID),p(20),$(u(30,2,m.notifications$)),p(3),S((f=u(32,4,m.notifications$))?31:-1,f)}},dependencies:[G,q,et,Z,tt,nt,rt,ot,Y,X,lt,A,U,J],encapsulation:2});let i=r;return i})();export{$t as NotificationComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as le,b as se}from"./chunk-R3BRUX7Z.js";import"./chunk-FH2KAM6J.js";import{a as ce}from"./chunk-A6SP65CH.js";import{c as pe,d as M,e as V}from"./chunk-C67KF7MG.js";import{a as ae}from"./chunk-TYSM3R5E.js";import"./chunk-JKRELT7N.js";import"./chunk-WTHYLNPX.js";import{a as te,b as ie,c as ne,d as oe}from"./chunk-TUY6YGYA.js";import"./chunk-76AVMRJU.js";import"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import{e as $}from"./chunk-BZWZ64N5.js";import{a as re}from"./chunk-ZXFWQ6VJ.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import"./chunk-DLHIDOS3.js";import{a as ee}from"./chunk-LCN52IJT.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-BKCKASH3.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{a as Y,b as Z}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{c as X}from"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-ZSUWHVKX.js";import{h as q}from"./chunk-62YNPW6Q.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as D}from"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{c as G}from"./chunk-UPRDDI4K.js";import{A as Q,c as J,h as K,m as j,o as z}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as k,e as x}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as W,B as H,w as U}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{G as E,Hb as L,Ia as b,Nc as g,Rc as P,Sc as f,Tc as _,Uc as B,Z as O,_c as A,ac as T,cc as I,ea as R,hc as u,ic as a,id as S,jc as p,jd as y,kc as v,ob as h,ra as c,rc as N,wc as C,ya as l,yc as w,za as s}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function he(m,d){if(m&1){let F=N();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 de(m,d){if(m&1&&(a(0,"div"),T(1,he,3,0,"button",15),p()),m&2){let F=w();h(),I(F.productService.hasSelectionVariant(d)?1:-1)}}var qe=(()=>{let d=class d{constructor(){this.http=c(x),this.toastr=c(k),this.dialog=c(X),this.productService=c(ee),this.authService=c(q),this.placeholderService=c(ne),this.infinitePagination=c(M),this.updateResHandling=c(V),this.mainPanelService=c(Y),this.channelOptions=b([]),this.searchFilter=b({PageNumber:1,RowCount:50,filterModel:1,text:"",ListChannelID:[],SearchType:te.NameOnly,NumberFilterComparator:ie.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(le,{data:{title:"Updating Price",selectedItems:e,channels:n},width:"400px"}).afterClosed().pipe(E(r=>G.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(D.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(D.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(ae,{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([M,W,ce,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=N();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,de,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,Q,J,z,K,j,pe,Z,se,re,$,oe,U],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let m=d;return m})();export{qe as PricePosChannelComponent};
|
|
1
|
+
import{a as le,b as se}from"./chunk-UJAA73LE.js";import"./chunk-FH2KAM6J.js";import{a as ce}from"./chunk-A6SP65CH.js";import{c as pe,d as M,e as V}from"./chunk-C67KF7MG.js";import{a as ae}from"./chunk-TYSM3R5E.js";import"./chunk-JKRELT7N.js";import"./chunk-WTHYLNPX.js";import{a as te,b as ie,c as ne,d as oe}from"./chunk-TUY6YGYA.js";import"./chunk-76AVMRJU.js";import"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import{e as $}from"./chunk-BZWZ64N5.js";import{a as re}from"./chunk-QUIZLT5F.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import"./chunk-DLHIDOS3.js";import{a as ee}from"./chunk-REDQ2L7Y.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-KHGTW7IV.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{a as Y,b as Z}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{c as X}from"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-ZSUWHVKX.js";import{h as q}from"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as D}from"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{c as G}from"./chunk-UPRDDI4K.js";import{A as Q,c as J,h as K,m as j,o as z}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as k,e as x}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as W,B as H,w as U}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{G as E,Hb as L,Ia as b,Nc as g,Rc as P,Sc as f,Tc as _,Uc as B,Z as O,_c as A,ac as T,cc as I,ea as R,hc as u,ic as a,id as S,jc as p,jd as y,kc as v,ob as h,ra as c,rc as N,wc as C,ya as l,yc as w,za as s}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function he(m,d){if(m&1){let F=N();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 de(m,d){if(m&1&&(a(0,"div"),T(1,he,3,0,"button",15),p()),m&2){let F=w();h(),I(F.productService.hasSelectionVariant(d)?1:-1)}}var qe=(()=>{let d=class d{constructor(){this.http=c(x),this.toastr=c(k),this.dialog=c(X),this.productService=c(ee),this.authService=c(q),this.placeholderService=c(ne),this.infinitePagination=c(M),this.updateResHandling=c(V),this.mainPanelService=c(Y),this.channelOptions=b([]),this.searchFilter=b({PageNumber:1,RowCount:50,filterModel:1,text:"",ListChannelID:[],SearchType:te.NameOnly,NumberFilterComparator:ie.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(le,{data:{title:"Updating Price",selectedItems:e,channels:n},width:"400px"}).afterClosed().pipe(E(r=>G.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(D.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(D.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(ae,{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([M,W,ce,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=N();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,de,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,Q,J,z,K,j,pe,Z,se,re,$,oe,U],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let m=d;return m})();export{qe as PricePosChannelComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-WZQRKTBN.js";import{a as g,b as d}from"./chunk-75IM3UUA.js";import"./chunk-UEXWQT5J.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import"./chunk-D6JH2KV4.js";import{c as m}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as l,hc as p,ic as c,jc as i,kc as r,ob as a}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var u=(()=>{let e=class e{constructor(){this.channelTabs=[{Title:"Channel",Url:"/menu/channel/marketplace"},{Title:"POS",Url:"/menu/channel/pos"}]}};e.\u0275fac=function(o){return new(o||e)},e.\u0275cmp=l({type:e,selectors:[["app-channels"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(o,s){o&1&&(c(0,"nav",0)(1,"div",1)(2,"div"),r(3,"nav-tab",2),i()()(),r(4,"router-outlet")),o&2&&(a(3),p("Tabs",s.channelTabs))},dependencies:[d,g,m],styles:[".form-label-group[_ngcontent-%COMP%]{position:relative;margin-bottom:1rem}.form-label-group[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-radius:.25rem!important;border-color:#c8d3df}.form-label-group[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important}.form-label-group[_ngcontent-%COMP%] > label[_ngcontent-%COMP%]{width:auto;position:absolute;top:1.125rem;left:.75rem;display:block;margin-bottom:0;line-height:1.5;color:#ccc;pointer-events:none;cursor:text;border:1px solid transparent;border-radius:.25rem;transition:all .1s ease-in-out;font-size:.875rem}.form-label-group[_ngcontent-%COMP%] > textarea[_ngcontent-%COMP%]{padding:.75rem;color:#343434;resize:both;font-size:.875rem;border-radius:.25rem;border-color:#c8d3df}.form-label-group[_ngcontent-%COMP%] > textarea[_ngcontent-%COMP%] ~ label[_ngcontent-%COMP%]{top:.9375rem}.form-label-group[_ngcontent-%COMP%] > textarea[_ngcontent-%COMP%]:focus{border:solid 1.5px #1A73E8!important}.form-label-group[_ngcontent-%COMP%] > textarea[_ngcontent-%COMP%]:focus ~ label[_ngcontent-%COMP%]{top:1rem;left:.78125rem}.form-label-group[_ngcontent-%COMP%] > ng-select[_ngcontent-%COMP%] .ng-select-container{min-height:3.625rem;border-color:#c8d3df;box-shadow:none}.form-label-group[_ngcontent-%COMP%] > ng-select[_ngcontent-%COMP%] ~ label[_ngcontent-%COMP%]{display:inline-block;top:-.625rem;background-color:#fff;font-size:.75rem!important;color:#9da2a6;padding:0 .25rem;z-index:1002;left:.5rem}.form-label-group.multiple[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-input{padding-left:.25rem!important}.form-label-group.multiple[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-placeholder{top:18px!important}.form-label-group.radio[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;border-radius:.25rem!important;border:solid 1px #c8d3df}.form-label-group.radio[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{font-size:.75rem!important;top:-10px!important;padding:0 .25rem;left:.5rem}.form-label-group.empty[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] ~ label[_ngcontent-%COMP%]{display:none}.form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::-webkit-input-placeholder, .form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:-ms-input-placeholder, .form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::-ms-input-placeholder, .form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::-moz-placeholder, .form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder, .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-webkit-input-placeholder, .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:-ms-input-placeholder, .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-ms-input-placeholder, .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::-moz-placeholder, .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]::placeholder{color:transparent}.form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:not(:placeholder-shown) ~ label[_ngcontent-%COMP%], .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:not(:placeholder-shown) ~ label[_ngcontent-%COMP%]{background-color:#fff;font-size:.75rem!important;color:#9da2a6;top:-10px!important;padding:0 .25rem;left:.5rem}.form-label-group[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:not(:placeholder-shown):focus ~ label[_ngcontent-%COMP%], .form-label-group[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:not(:placeholder-shown):focus ~ label[_ngcontent-%COMP%]{color:#3f8aec}.form-label-group[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-placeholder{padding-left:.25rem;color:#ccc!important;font-size:.875rem}.form-label-group[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-has-value .ng-value{padding-left:.25rem;font-size:.875rem}.form-label-group[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-value-container{overflow:initial!important}.form-label-group[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%] .ng-input{top:auto!important;padding-left:.875rem!important;font-size:.875rem}"]});let t=e;return t})();var v=[{path:"",component:u,children:[{path:"",redirectTo:"marketplace",pathMatch:"full"},{path:"marketplace",loadComponent(){return import("./chunk-CKFHJ3IS.js").then(t=>t.MarketplaceComponent)},canActivate:[n],data:{title:"List"}},{path:"marketplace/form",loadComponent(){return import("./chunk-MS5NHG4Z.js").then(t=>t.MarketplaceFormComponent)},canActivate:[n],data:{title:"Add new Channel"}},{path:"marketplace/view",loadComponent(){return import("./chunk-56NTLHVB.js").then(t=>t.MarketplaceViewComponent)},canActivate:[n],data:{title:"Marketplace View"}},{path:"marketplace/add",loadComponent(){return import("./chunk-GQT5IVF5.js").then(t=>t.MarketplaceAddComponent)},canActivate:[n],data:{title:"Marketplace Add"}},{path:"pos",loadComponent(){return import("./chunk-UMIGDHOS.js").then(t=>t.PosComponent)},canActivate:[n],data:{title:"POS"}},{path:"pos/edit",loadComponent(){return import("./chunk-XHWASSX2.js").then(t=>t.EditComponent)},canActivate:[n],data:{title:"POS Edit"}}]}];export{v as routes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as z,b as B}from"./chunk-VVNLTDLG.js";import{b as j}from"./chunk-OHAT7WXU.js";import{a as W,b as A,c as U}from"./chunk-JU4ZP3HI.js";import{a as P}from"./chunk-A6QXXKPR.js";import{la as N}from"./chunk-JTKEMQZT.js";import{h as D}from"./chunk-
|
|
1
|
+
import{a as z,b as B}from"./chunk-VVNLTDLG.js";import{b as j}from"./chunk-OHAT7WXU.js";import{a as W,b as A,c as U}from"./chunk-JU4ZP3HI.js";import{a as P}from"./chunk-A6QXXKPR.js";import{la as N}from"./chunk-JTKEMQZT.js";import{h as D}from"./chunk-J4552BMI.js";import{A as I,a as F,h as k,m as E}from"./chunk-6UM4NHOR.js";import{Hb as V,Lb as v,Nb as _,Nc as x,Oc as S,Rc as w,Sc as b,Tc as y,_c as O,ac as T,cc as L,hc as p,ic as c,jc as u,kc as g,mb as h,ob as m,ra as M,rc as f,ud as d,wc as C,ya as r,yc as a,za as s}from"./chunk-OHGMB7HJ.js";function G(n,o){if(n&1&&(c(0,"div",6),g(1,"img",7),c(2,"div"),x(3),u()()),n&2){let e=o.$implicit;m(),p("src",e.logo,h),m(2),S(e.Name)}}function R(n,o){if(n&1){let e=f();c(0,"p-multiselect",4,0),C("click",function(){r(e);let i=a();return s(i.onClickSelect())}),y("ngModelChange",function(i){r(e);let l=a();return b(l.selectedChannels,i)||(l.selectedChannels=i),s(i)}),C("ngModelChange",function(i){r(e);let l=a();return s(l.onChannelChange(i))}),_(2,G,4,2,"ng-template",5),u()}if(n&2){let e=a();p("options",e.options())("placeholder",e.placeholder()),w("ngModel",e.selectedChannels),p("showClear",e.clearable())("autofocusFilter",!0)("maxSelectedLabels",e.maxSelectedLabels())}}function q(n,o){if(n&1&&(c(0,"div",6),g(1,"img",7),c(2,"div"),x(3),u()()),n&2){let e=o.$implicit;m(),p("src",e.logo,h),m(2),S(e.Name)}}function H(n,o){if(n&1){let e=f();c(0,"p-select",8,1),C("click",function(){r(e);let i=a();return s(i.onClickSelect())}),y("ngModelChange",function(i){r(e);let l=a();return b(l.selectedChannels,i)||(l.selectedChannels=i),s(i)}),C("ngModelChange",function(i){r(e);let l=a();return s(l.onChannelChange(i))}),_(2,q,4,2,"ng-template",5),u()}if(n&2){let e=a();p("options",e.options())("placeholder",e.placeholder()),w("ngModel",e.selectedChannels),p("showClear",e.clearable())("autofocusFilter",!0)("filter",!0)}}var re=(()=>{let o=class o extends U{constructor(){super(),this.authService=M(D),this.multiple=d(!1),this.clearable=d(!0),this.placeholder=d("Select Channels"),this.options=d(this.authService.getChannels()),this.maxSelectedLabels=d(6),this.onChange=t=>{}}onChannelChange(t){this.multiple()?t=t||[]:t=t||P.GuidEmpty,this.onChange(t)}onClickSelect(){this.initTopPosition(),setTimeout(()=>{this.adjustOverlayPosition()},0)}writeValue(t){this.selectedChannels=t}registerOnChange(t){this.onChange=t}registerOnTouched(t){}setDisabledState(t){}};o.\u0275fac=function(i){return new(i||o)},o.\u0275cmp=V({type:o,selectors:[["app-channel-options-v2"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"],placeholder:[1,"placeholder"],options:[1,"options"],maxSelectedLabels:[1,"maxSelectedLabels"]},features:[O([{provide:F,multi:!0,useExisting:o}]),v],decls:2,vars:1,consts:[["multiSelect",""],["select",""],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"options","placeholder","ngModel","showClear","autofocusFilter","filter"],["optionLabel","Name","optionValue","ID","display","chip","id","multiSelect","appendTo","body",1,"w-100",2,"--p-multiselect-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","maxSelectedLabels"],["pTemplate","item"],[1,"d-flex","align-items-center","gap-2"],[2,"width","18px",3,"src"],["optionLabel","Name","optionValue","ID","appendTo","body",1,"w-100",2,"--p-select-padding-y","12px",3,"click","ngModelChange","options","placeholder","ngModel","showClear","autofocusFilter","filter"]],template:function(i,l){i&1&&T(0,R,3,6,"p-multiselect",2)(1,H,3,6,"p-select",3),i&2&&L(l.multiple()?0:1)},dependencies:[B,z,N,j,I,k,E,A,W],encapsulation:2});let n=o;return n})();export{re as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as P,b as v}from"./chunk-
|
|
1
|
+
import{a as P,b as v}from"./chunk-KHGTW7IV.js";import{h as I}from"./chunk-J4552BMI.js";import{a as f}from"./chunk-AGBJEXIM.js";import{c as i}from"./chunk-UPRDDI4K.js";import{b as m,e as g}from"./chunk-D6JH2KV4.js";import{J as h,ea as l,ma as C,qa as u,r as c,ra as S}from"./chunk-OHGMB7HJ.js";var R=(()=>{let o=class o{constructor(t,e,n){this.httpService=t,this.toastrService=e,this.notificationService=n,this.authService=S(I),this.scanChannelToastr=S(P),this.channelOptions=this.authService.getChannels()}loader(t=i.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:t})}LoadInPOS(t=i.GuidEMpty){return this.httpService.post("/api/product/LoadInPOS",{ID:t})}filterChannelByTypeId(t,e){return t.filter(n=>e.findIndex(a=>n.TypeID==a)!==-1)}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(t){let e={ID:t};return this.httpService.post("/api/product/TotalProductLive",e)}clearCacheChannel(t){let e={ID:t};return this.httpService.post("/api/Channel/ClearCacheChannel",e)}detachProduct(t){return this.httpService.post("/api/product/Detach",t)}uploadSingleProduct(t,e){let n={Channel:e,Products:t};return this.httpService.post("api/product/UploadMultipleChannel",n).pipe(l(a=>{this.showToastrSuccessUploadSingle(a,t[0])}),h(a=>(this.showToastErrorUploadSingle(a,t[0]),c(()=>new Error(a)))))}uploadMultipleProduct(t,e){let n={Channel:e,Products:t};return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",n).pipe(l(a=>{this.showToastrUploadMultiple(a.Message)}),h(a=>(this.showToastrUploadMultiple(a.error?.Message),c(()=>new Error(a)))))}uploadNotInChannel(t,e){let n={Products:t,Channel:e};return this.httpService.post("/api/product/UploadProductNotInChannelToChannel",n).pipe(l(a=>{this.showToastrUploadMultiple(a)}),h(a=>(this.showToastrUploadMultiple(a.error?.Message),c(()=>new Error(a)))))}scanSingle(t,e){let n={ID:t,SKU:e};return this.httpService.post("/api/product/ScanSingle",n)}scanNotInChannel(t){let e={ID:t};return this.httpService.post("/api/product/ScanNotinChannel",e)}findAllSoldInChannel(t){return this.httpService.post("/api/product/GetSoldInChannel",t)}scanAll(t,e,n,a=!1){let s={ID:t,ScanFull:e,UpdatedProduct:n,Async:a};return this.httpService.post("/api/product/ScanOptimized",s)}scanAsyncProductV2(t,e,n){let a={ID:t,ScanFull:e,UpdatedProduct:n,Async:!0};return this.httpService.post(f.ScanAsyncProductV2,a).pipe(l(s=>{this.notificationService.subscribeToJobGroup(s.JobID)}))}scanSyncProductV2(t,e,n){let a={ID:t,ScanFull:e,UpdatedProduct:n,Async:!1};return this.httpService.post(f.ScanSyncProductV2,a)}scanProductV2(t,e,n,a=!1){let s=this.findChannelById(t,this.channelOptions);return a?this.scanAsyncProductV2(t,e,n).pipe(l(r=>{this.scanChannelToastr.showToast({text:"Scan Job Started",detail:`JobID: ${r.JobID}`,severity:"info",data:{channelName:s.Name,channelTypeId:s.TypeID,jobId:r.JobID}})})):this.scanSyncProductV2(t,e,n).pipe(l(r=>{this.successToastrScanAllProduct(r,s,!n)}))}scanCompareToPos(t){return this.httpService.post("/api/product/CompareMarketplaceToPOS",t)}getVariantCodesProduct(t){return(t.Variants||[]).map(a=>a.Code)}downloadMultipleProduct(t){let e=t.map(n=>({ChannelItemID:n.ChannelItemID,ChannelID:n.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",e).pipe(l(n=>{this.toastrService.success(`${n.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(t){let e={ChannelItemID:t.ChannelItemID,ChannelID:t.ChannelID};return this.httpService.post("/api/product/DownloadProductFromChannel",e).pipe(l(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(t=[]){let e=[];return t.forEach(n=>{n.Variants.forEach(a=>{e=[...e,a.Code]})}),e}filterUnselectedChannel(t,e){let n=[];t.forEach(s=>{n=[...n,...s.Channel]});let a;if(!n||n.length==0)a=e;else{let s=[];a=e.filter(r=>(s=n.filter(d=>d.ChannelID==r.ID),s.length!==t.length))}return a}findChannelById(t,e){return e.find(n=>n.ID==t)}sortChannel(t=[]){return t.sort((e,n)=>e.TypeID<n.TypeID?1:e.TypeID===n.TypeID?0:-1)}hasSelection(t=[]){return this.selectedProduct(t).length>0}selectedProduct(t=[]){return t.filter(e=>e.selected)}hasSelectionVariant(t){return this.selectedVariantProduct(t).length>0}selectedVariantProduct(t){let e=[];return t.forEach(n=>{e=[...e,...n.Variants!=null?n.Variants.filter(a=>a.selected):""]}),e}getChannelProduct(t){let e=t.Variants||[],n=[];for(let a of e)if(a.Channel!=null)for(let s of a.Channel)n.filter(r=>r.ChannelID==s.ChannelID).length==0&&n.push(s);return this.sortChannel(n)}successToastrScanAllProduct(t,e,n){let a=t.InChannel?t?.InChannel?.Product:0,s=t?.NotInPOS?.Product?t?.NotInPOS?.Product:0,r=i.IsNotEmpty(t.LastUpdate)?i.convertToReadableDate(t.LastUpdate):null;n?this.toastrService.success(`
|
|
2
2
|
${s+a} product updates in ${e.Name} </br>
|
|
3
3
|
(${a} In Channel + ${s} Not In Pos)
|
|
4
4
|
${i.IsNotEmpty(r)?"since "+r:""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as U}from"./chunk-BZWZ64N5.js";import{a as Y}from"./chunk-
|
|
1
|
+
import{e as U}from"./chunk-BZWZ64N5.js";import{a as Y}from"./chunk-QUIZLT5F.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as G}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-JTKEMQZT.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as R}from"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import{A as J,c as j,h as F,m as H}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as B,e as I}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as k,w as P,z as W}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as M,Ia as g,Nc as i,Oc as T,Rc as b,Sc as v,Tc as _,Uc as V,Vc as D,Wc as S,Z as x,ac as N,cc as O,hc as f,ic as e,id as w,jc as t,jd as y,kc as L,ob as a,ra as h,rc as E,wc as C,ya as m,yc as A,za as c}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function z(o,l){if(o&1&&(e(0,"pre",21),i(1),w(2,"json"),t()),o&2){A();let q=S(25);a(),T(y(2,1,q))}}function K(o,l){o&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var me=(()=>{let l=class l{constructor(){this.httpService=h(I),this.toastr=h(B),this.selectedChannel=g(null),this.orderNumber=g(null)}fetchLog(){if(!this.selectedChannel()||!this.orderNumber()){this.toastr.warning("Please select a channel and enter an order number","Warning");return}this.orderLog$=this.httpService.post(R.GetOrderApiLog,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(x(1))}copyToClipboard(p){if(!p)return;let s=typeof p=="string"?p:JSON.stringify(p,null,2);navigator.clipboard.writeText(s),this.toastr.success("Copied to clipboard!","Success")}};l.\u0275fac=function(s){return new(s||l)},l.\u0275cmp=M({type:l,selectors:[["app-order-api"]],decls:40,vars:9,consts:[["headerTitle","Origin Order Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","orderLogText"],[1,"text-center","my-12","text-muted"]],template:function(s,n){if(s&1){let d=E();e(0,"mainpanel",0)(1,"actions")(2,"button",1),C("click",function(){return m(d),c(n.fetchLog())}),L(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," View logs related to Order API activities. "),t()(),e(15,"div",9)(16,"app-channel-options-v2",10),_("ngModelChange",function(r){return m(d),v(n.selectedChannel,r)||(n.selectedChannel=r),c(r)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Order Number"),t(),e(21,"p",8),i(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),_("ngModelChange",function(r){return m(d),v(n.orderNumber,r)||(n.orderNumber=r),c(r)}),t()()()()(),V(25),w(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),C("click",function(){m(d);let r=S(25);return c(n.copyToClipboard(r))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),N(38,z,3,3,"pre",21)(39,K,2,0,"p",22),t()()()()()()()()()}if(s&2){f("hideSearchBox",!0)("hideSearchDropdown",!0),a(16),b("ngModel",n.selectedChannel),a(8),b("ngModel",n.orderNumber),a();let d=D(y(26,6,n.orderLog$));a(8),f("disabled",!d),a(5),O(d?38:39)}},dependencies:[k,G,U,J,j,F,H,Y,P,W],encapsulation:2});let o=l;return o})();export{me as OrderApiComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h}from"./chunk-DE3FRI5N.js";import{a as o}from"./chunk-
|
|
1
|
+
import{a as h}from"./chunk-DE3FRI5N.js";import{a as o}from"./chunk-WZQRKTBN.js";import{a as v,b as d}from"./chunk-75IM3UUA.js";import"./chunk-UEXWQT5J.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import"./chunk-D6JH2KV4.js";import{c,g as u}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as i,_c as s,hc as m,ic as p,jc as l,kc as r,ob as a}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var f=(()=>{let n=class n{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"}]}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=i({type:n,selectors:[["app-inventory"]],features:[s([h])],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(t,C){t&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),r(3,"nav-tab",2),l()()(),r(4,"router-outlet")),t&2&&(a(3),m("Tabs",C.inventoryTabs))},dependencies:[d,v,u,c],encapsulation:2});let e=n;return e})();var U=[{path:"",component:f,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-DV3BDHBL.js").then(e=>e.MultiChannelComparison)},canActivate:[o],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-JUN3HVEV.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[o],data:{title:"Inventory Comparison"}},{path:"channel_summary",loadComponent(){return import("./chunk-NEB6AMMM.js").then(e=>e.ChannelSummaryComponent)},canActivate:[o],data:{title:"Different Inventory"}}]}];export{U as routes};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as de}from"./chunk-L6CRWJ2O.js";import{a as Xe,b as et,c as tt}from"./chunk-PUSOOHGT.js";import"./chunk-ET33HPF3.js";import"./chunk-VYI7JYH5.js";import"./chunk-OH5T7D7O.js";import{a as He,b as Ke,c as Qe,e as Ze,f as qe,g as Je}from"./chunk-3WGAMHZW.js";import{a as We,b as Be,c as Le}from"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import{c as Fe,d as Oe,e as Re}from"./chunk-BZWZ64N5.js";import{a as $e}from"./chunk-LCN52IJT.js";import"./chunk-3T5VLB63.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-BKCKASH3.js";import"./chunk-A6QXXKPR.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as Ne}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as re}from"./chunk-UEXWQT5J.js";import"./chunk-JHSG3KRS.js";import{f as ze,g as Ue,h as Ge,i as je,j as Ye}from"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-TBVMCNS2.js";import{e as Ae}from"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import{ka as Pe}from"./chunk-JTKEMQZT.js";import{c as Ie}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{h as ie}from"./chunk-62YNPW6Q.js";import{a as Me}from"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as te}from"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as ee,c as x}from"./chunk-UPRDDI4K.js";import{A as ae,b as Ee,c as ke,h as ne,m as oe,x as Ve}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as xe,e as Te}from"./chunk-D6JH2KV4.js";import{g as be}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as V,q as O,w as X,y as $}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as ve,Cc as fe,Dc as ge,Ec as _e,Hb as k,Ia as g,Ic as N,Nb as Y,Nc as s,Oc as F,Pc as D,Rc as b,Sc as M,Tc as P,Xc as Ce,Z as G,Zc as we,_c as Z,aa as ce,ac as w,ad as q,bd as Se,cc as v,ea as j,ec as R,fc as W,gc as B,hc as h,ic as o,id as L,jc as a,jd as H,kc as S,kd as ye,m as me,ma as ue,mb as he,ob as l,qd as J,ra as y,rc as T,tb as A,td as De,ud as I,v as Q,wc as C,ya as c,yc as _,za as u}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as se,b as pe}from"./chunk-66YHNWRR.js";var rt=e=>({"over-due":e});function lt(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,rt,d.Exception)),l(2),F(t+1),l(2),F(d.Number),l(2),F(d.Status),l(2),F(d.Exception)}}function dt(e,r){if(e&1&&W(0,lt,9,7,"tr",6,R),e&2){let d,t=_();B((d=t.downloadResult())==null?null:d.Body)}}function st(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 it=(()=>{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,dt,2,0)(14,st,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 mt=e=>({"full-width":e}),ct=()=>({standalone:!0}),nt=(()=>{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,mt,i.fullWidth()))("baseZIndex",1100),b("ngModel",i.time),h("timeOnly",!0)("ngModelOptions",ve(7,ct)))},dependencies:[V,O,ae,ne,oe,tt,et,Xe,Pe],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(Te),this.toastr=y(xe),this.datePipe=y($)}gerChannelDetailById(t){return this.httpService.post(te.GetChannelDetail,{ID:t})}getOrderPreview(t){return this.httpService.post(te.GetOrderPreviewV2,t)}getDownloadOrder(t){return this.httpService.post(te.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 ut(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 ht(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 ft(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 gt(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 _t(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 ot=(()=>{let r=class r{constructor(){this.reset=I(!1),this.authService=y(ie),this.tokenService=y(Me),this.downloadService=y(z),this.downloadType=g(!1),this.selectedChannelId=g(null),this.channelOptions=g(this.authService.getChannels()),this.channelType=ee,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,Ae()])],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,ut,3,3,"ng-option",7,R),a()()(),w(12,ht,19,3,"div",8),L(13,"async"),o(14,"div",8)(15,"div",4)(16,"h5"),s(17,"Date Range"),a(),w(18,ft,5,0,"p",5)(19,gt,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,_t,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,Re,Oe,Fe,Le,We,Be,ae,ke,Ee,ne,Ve,oe,nt,je,ze,Ye,Ue,Ge,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 Ct=(e,r)=>({"over-due-today":e,"over-due":r});function wt(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 vt(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 St(e,r){if(e&1&&(o(0,"span"),s(1),a()),e&2){let d=_().$implicit;l(),D(" ",d.ActionString," ")}}function yt(e,r){if(e&1&&(o(0,"li"),s(1),a()),e&2){let d=r.$implicit;l(),D(" ",d," ")}}function Dt(e,r){if(e&1&&(o(0,"ul",21),W(1,yt,2,1,"li",null,R),a()),e&2){let d=_().$implicit;l(),B(d.ActionString)}}function xt(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 de}from"./chunk-L6CRWJ2O.js";import{a as Xe,b as et,c as tt}from"./chunk-PUSOOHGT.js";import"./chunk-ET33HPF3.js";import"./chunk-VYI7JYH5.js";import"./chunk-OH5T7D7O.js";import{a as He,b as Ke,c as Qe,e as Ze,f as qe,g as Je}from"./chunk-3WGAMHZW.js";import{a as We,b as Be,c as Le}from"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import{c as Fe,d as Oe,e as Re}from"./chunk-BZWZ64N5.js";import{a as $e}from"./chunk-REDQ2L7Y.js";import"./chunk-3T5VLB63.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-KHGTW7IV.js";import"./chunk-A6QXXKPR.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as Ne}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as re}from"./chunk-UEXWQT5J.js";import"./chunk-JHSG3KRS.js";import{f as ze,g as Ue,h as Ge,i as je,j as Ye}from"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-TBVMCNS2.js";import{e as Ae}from"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import{ka as Pe}from"./chunk-JTKEMQZT.js";import{c as Ie}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{h as ie}from"./chunk-J4552BMI.js";import{a as Me}from"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as te}from"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as ee,c as x}from"./chunk-UPRDDI4K.js";import{A as ae,b as Ee,c as ke,h as ne,m as oe,x as Ve}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as xe,e as Te}from"./chunk-D6JH2KV4.js";import{g as be}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as V,q as O,w as X,y as $}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as ve,Cc as fe,Dc as ge,Ec as _e,Hb as k,Ia as g,Ic as N,Nb as Y,Nc as s,Oc as F,Pc as D,Rc as b,Sc as M,Tc as P,Xc as Ce,Z as G,Zc as we,_c as Z,aa as ce,ac as w,ad as q,bd as Se,cc as v,ea as j,ec as R,fc as W,gc as B,hc as h,ic as o,id as L,jc as a,jd as H,kc as S,kd as ye,m as me,ma as ue,mb as he,ob as l,qd as J,ra as y,rc as T,tb as A,td as De,ud as I,v as Q,wc as C,ya as c,yc as _,za as u}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as se,b as pe}from"./chunk-66YHNWRR.js";var rt=e=>({"over-due":e});function lt(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,rt,d.Exception)),l(2),F(t+1),l(2),F(d.Number),l(2),F(d.Status),l(2),F(d.Exception)}}function dt(e,r){if(e&1&&W(0,lt,9,7,"tr",6,R),e&2){let d,t=_();B((d=t.downloadResult())==null?null:d.Body)}}function st(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 it=(()=>{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,dt,2,0)(14,st,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 mt=e=>({"full-width":e}),ct=()=>({standalone:!0}),nt=(()=>{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,mt,i.fullWidth()))("baseZIndex",1100),b("ngModel",i.time),h("timeOnly",!0)("ngModelOptions",ve(7,ct)))},dependencies:[V,O,ae,ne,oe,tt,et,Xe,Pe],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(Te),this.toastr=y(xe),this.datePipe=y($)}gerChannelDetailById(t){return this.httpService.post(te.GetChannelDetail,{ID:t})}getOrderPreview(t){return this.httpService.post(te.GetOrderPreviewV2,t)}getDownloadOrder(t){return this.httpService.post(te.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 ut(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 ht(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 ft(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 gt(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 _t(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 ot=(()=>{let r=class r{constructor(){this.reset=I(!1),this.authService=y(ie),this.tokenService=y(Me),this.downloadService=y(z),this.downloadType=g(!1),this.selectedChannelId=g(null),this.channelOptions=g(this.authService.getChannels()),this.channelType=ee,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,Ae()])],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,ut,3,3,"ng-option",7,R),a()()(),w(12,ht,19,3,"div",8),L(13,"async"),o(14,"div",8)(15,"div",4)(16,"h5"),s(17,"Date Range"),a(),w(18,ft,5,0,"p",5)(19,gt,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,_t,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,Re,Oe,Fe,Le,We,Be,ae,ke,Ee,ne,Ve,oe,nt,je,ze,Ye,Ue,Ge,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 Ct=(e,r)=>({"over-due-today":e,"over-due":r});function wt(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 vt(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 St(e,r){if(e&1&&(o(0,"span"),s(1),a()),e&2){let d=_().$implicit;l(),D(" ",d.ActionString," ")}}function yt(e,r){if(e&1&&(o(0,"li"),s(1),a()),e&2){let d=r.$implicit;l(),D(" ",d," ")}}function Dt(e,r){if(e&1&&(o(0,"ul",21),W(1,yt,2,1,"li",null,R),a()),e&2){let d=_().$implicit;l(),B(d.ActionString)}}function xt(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 Tt(e,r){if(e&1&&(o(0,"tr")(1,"td"),s(2),a(),o(3,"td"),s(4),a(),w(5,vt,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,St,2,1,"span"),w(16,Dt,3,0,"ul",21),a(),o(17,"td"),w(18,xt,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,Ct,(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 bt(e,r){if(e&1&&W(0,Tt,19,15,"tr",null,R),e&2){let d=_();B(d.displayPreviewData())}}function Mt(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 at=(()=>{let r=class r{constructor(){this.orderPreview=I(),this.selectedChannel=I(),this.channelType=ee,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,wt,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,bt,2,0)(39,Mt,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,Ie,$],encapsulation:2});let e=r;return e})();var Pt=["stepper"];function Et(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 kt(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 Vt(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 It(e,r){e&1&&(S(0,"i",25),o(1,"span"),s(2,"Filter"),a())}function Nt(e,r){e&1&&(S(0,"i",26),o(1,"span"),s(2,"Preview"),a())}function Ft(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 Ot(e,r){e&1&&(S(0,"i",28),o(1,"span"),s(2,"Finish"),a())}function Rt(e,r){e&1&&S(0,"complete-step",16),e&2&&h("downloadResult",r)}function Wt(e,r){e&1&&(o(0,"h6"),s(1,"1"),a())}function Bt(e,r){e&1&&(o(0,"h6"),s(1,"2"),a())}function Lt(e,r){e&1&&(o(0,"h6"),s(1,"3"),a())}var pn=(()=>{let r=class r{constructor(){this.downloadService=y(z),this.orderService=y(de),this.productService=y($e),this.authService=y(ie),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(Pt,5),n&2){let p;ge(p=_e())&&(i.stepper=p.first)}},features:[Z([z,de,{provide:He,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,Et,5,1,"div",2),w(3,kt,2,1,"button",3),w(4,Vt,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,It,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,Nt,3,0,"ng-template",11),w(17,Ft,1,1,"preview-step",14),L(18,"async"),a(),o(19,"mat-step",15),Y(20,Ot,3,0,"ng-template",11),w(21,Rt,1,1,"complete-step",16),L(22,"async"),a(),Y(23,Wt,2,0,"ng-template",17)(24,Bt,2,0,"ng-template",18)(25,Lt,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,it,ot,at,Je,Ze,Ke,qe,Qe,Ne,be,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 ve}from"./chunk-FH2KAM6J.js";import{a as Se,b as we}from"./chunk-C67KF7MG.js";import{a as Te,b as ye}from"./chunk-JKRELT7N.js";import{a as fe}from"./chunk-DLHIDOS3.js";import{a as pe,b as ge,c as ue,g as he,i as Ce,j as xe}from"./chunk-IA7NJXJD.js";import{a as _e}from"./chunk-UEXWQT5J.js";import{b as be}from"./chunk-M27MYADT.js";import{a as le}from"./chunk-UDNUDL5Z.js";import{c as me}from"./chunk-IZZY74PN.js";import{a as D}from"./chunk-ZSUWHVKX.js";import{h as se}from"./chunk-62YNPW6Q.js";import{a as ae,b as re,c as ce}from"./chunk-NB2H6KA7.js";import{c as Z}from"./chunk-UPRDDI4K.js";import{A as L,b as de,h as $,m as B}from"./chunk-6UM4NHOR.js";import{A as ie,B as oe,q as te,v as ne}from"./chunk-CGSMHTKB.js";import{G,Hb as N,Ia as R,Ic as z,Nb as T,Nc as _,Oc as F,Pc as P,Rc as E,Sc as k,Tc as O,Xc as Y,ac as u,ad as M,bd as J,ca as K,cc as h,dc as I,ec as X,f as q,fc as v,gc as S,hc as d,ic as r,id as U,jc as s,jd as H,kc as w,kd as Q,ld as ee,mb as y,ob as c,qc as j,ra as b,rc as C,tb as A,ud as V,wc as x,ya as p,yc as a,za as g}from"./chunk-OHGMB7HJ.js";function Fe(t,l){if(t&1){let e=C();r(0,"span")(1,"mat-checkbox",4),x("change",function(n){p(e);let o=a();return g(o.onSelectAll(n==null?null:n.checked))}),r(2,"h5",5),_(3,"Select All"),s()()()}}function Pe(t,l){if(t&1){let e=C();r(0,"li")(1,"mat-checkbox",6),O("ngModelChange",function(n){let o=p(e).$implicit;return k(o.selected,n)||(o.selected=n),g(n)}),r(2,"div",7),w(3,"img",8),r(4,"h5",9),_(5),s()()()()}if(t&2){let e=l.$implicit;c(),E("ngModel",e.selected),c(2),d("src",e.Img,y),c(2),F(e.Name)}}var dt=(()=>{let l=class l{constructor(){this.data=b(ge),this.dialogRef=b(pe),this.selectedItems=this.data.selectedItems,this.channels=this.data.channels}ngOnInit(){this.initModalConfig()}initModalConfig(){let i=this.data.title?this.data.title:"Updating Inventory";this.modalConfig=new Ce,this.modalConfig.title=i}onSelectAll(i){this.channels=this.channels.map(n=>(n.selected=i,n))}onOk(){this.dialogRef.close(this.channels)}onClose(){this.dialogRef.close()}get getSelectedChannel(){return this.channels.filter(i=>i.selected)}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=N({type:l,selectors:[["app-modal-update-channels"]],decls:7,vars:3,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[2,"overflow-y","auto","max-height","28rem"],[1,"no-bullet",2,"margin-bottom","0px !important","overflow","hidden"],["color","primary",1,"me-6",3,"change"],[1,"fw-light"],["color","primary",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src"],[1,"fw-light","ms-2","my-auto"]],template:function(n,o){n&1&&(r(0,"modal-material",0),x("onOk",function(){return o.onOk()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),r(1,"div",1)(2,"div",2),u(3,Fe,4,0,"span"),r(4,"ul",3),v(5,Pe,6,3,"li",null,I),s()()()()),n&2&&(d("dynamicValidated",(o.getSelectedChannel==null?null:o.getSelectedChannel.length)>0)("config",o.modalConfig),c(3),h((o.channels==null?null:o.channels.length)>1?3:-1),c(2),S(o.channels))},dependencies:[xe,ve,L,$,B],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]});let t=l;return t})();var W=t=>[t],Ee=t=>({"text-decoration-line-through":t}),ke=t=>({"text-danger":t}),Oe=(t,l)=>({"bg-gradient-warning":t,"cell-hover pointer":l});function Ve(t,l){if(t&1){let e=C();r(0,"mat-slide-toggle",10),x("toggleChange",function(){p(e);let n=a();return n.toggleStatus=!n.toggleStatus,g(n.onToggle())}),r(1,"small",11),_(2),s()()}if(t&2){let e=a();c(2),P(" ",e.productToggleTitle?e.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function De(t,l){if(t&1){let e=C();r(0,"th")(1,"input",13),O("ngModelChange",function(n){p(e);let o=a(2);return k(o.checkboxState,n)||(o.checkboxState=n),g(n)}),x("ngModelChange",function(){p(e);let n=a(2);return g(n.onCheckboxStateChange())}),s()()}if(t&2){let e=a(2);c(),E("ngModel",e.checkboxState)}}function Ne(t,l){if(t&1&&(T(0,De,2,1,"ng-template",12),r(1,"th",8),_(2,"POS"),s()),t&2){let e=a();d("ngxPermissionsOnly",M(1,W,e.rolePriceEdit))}}function Ue(t,l){if(t&1&&(r(0,"th",9)(1,"div",14)(2,"div",15),w(3,"img",16),r(4,"div",17),_(5),U(6,"stringLimit"),s()()()()),t&2){let e=l.$implicit;c(2),d("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),c(),d("src",e==null?null:e.Img,y),c(2),P(" ",Q(6,3,e.Name,20)," ")}}function $e(t,l){t&1&&j(0)}function Be(t,l){if(t&1&&T(0,$e,1,0,"ng-container",29),t&2){a(2);let e=z(5);d("ngTemplateOutlet",e)}}function Le(t,l){if(t&1&&T(0,Be,1,1,"ng-template",12),t&2){let e=a(4);d("ngxPermissionsOnly",M(1,W,e.roleInventoryUpdate))}}function We(t,l){t&1&&j(0)}function Re(t,l){if(t&1&&T(0,We,1,0,"ng-container",29),t&2){a(2);let e=z(5);d("ngTemplateOutlet",e)}}function Ae(t,l){if(t&1&&T(0,Re,1,1,"ng-template",12),t&2){let e=a(4);d("ngxPermissionsOnly",M(1,W,e.rolePriceEdit))}}function je(t,l){if(t&1){let e=C();r(0,"div")(1,"input",30),O("ngModelChange",function(n){p(e);let o=a(4).$implicit;return k(o.selected,n)||(o.selected=n),g(n)}),x("ngModelChange",function(){p(e);let n=a(4).$implicit,o=a();return g(o.onCheckboxStateProduct(n.ID))}),s()()}if(t&2){let e=a(4).$implicit;c(),E("ngModel",e.selected),d("disabled",!(e!=null&&e.Category))}}function ze(t,l){if(t&1&&u(0,je,2,2,"div"),t&2){let e=a(3).$implicit;h((e==null||e.Variants==null?null:e.Variants.length)>1?0:-1)}}function He(t,l){if(t&1){let e=C();r(0,"img",31),x("click",function(n){p(e);let o=a(3).$implicit,m=a();return g(m.onZoomImage(n,o==null?null:o.ImageUrl))}),s()}if(t&2){let e=a(3).$implicit;d("src",Y(e==null?null:e.ThumbnailUrl),y)}}function Ze(t,l){t&1&&w(0,"img",26)}function qe(t,l){if(t&1&&(r(0,"td",23)(1,"div",24),u(2,Le,1,3,null,12)(3,Ae,1,3,null,12),T(4,ze,1,1,"ng-template",null,0,ee),r(6,"div"),u(7,He,1,2,"img",25)(8,Ze,1,0,"img",26),s()()(),r(9,"td",27)(10,"div"),_(11),s(),r(12,"small",28),_(13),s()()),t&2){let e=a(2).$implicit,i=a();d("rowSpan",e==null?null:e.Variants.length),c(2),h(i.table()=="inventory"?2:3),c(5),h(e!=null&&e.ThumbnailUrl?7:8),c(2),d("rowSpan",e==null?null:e.Variants.length),c(2),F(e==null?null:e.Name),c(),d("ngClass",M(7,ke,!(e!=null&&e.Category))),c(),P("(",e!=null&&e.Category?e==null?null:e.Category:"Not Found In POS",")")}}function Ge(t,l){if(t&1&&(r(0,"a",22),w(1,"i",32),s()),t&2){let e=a().$implicit,i=a(2);d("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),y)}}function Ke(t,l){if(t&1){let e=C();r(0,"input",35),O("ngModelChange",function(n){p(e);let o=a(3).$implicit;return k(o.selected,n)||(o.selected=n),g(n)}),s()}if(t&2){let e=a(3).$implicit,i=a().$implicit;E("ngModel",e.selected),d("disabled",!(i!=null&&i.Category))}}function Xe(t,l){if(t&1&&(r(0,"td",33),u(1,Ke,1,2,"input",34),s()),t&2){let e=a(2).$implicit,i=a(2);c(),h(i.printPOS(e)>=0||i.table()=="price"?1:-1)}}function Ye(t,l){if(t&1&&(T(0,Xe,2,1,"ng-template",12),r(1,"td",19),_(2),U(3,"number"),s()),t&2){let e=a().$implicit,i=a(2);d("ngxPermissionsOnly",M(4,W,i.rolePriceEdit)),c(2),F(H(3,2,i.printPOS(e)))}}function Je(t,l){if(t&1){let e=C();r(0,"td",38),x("click",function(){p(e);let n=a().$implicit,o=a().$implicit,m=a().$implicit,f=a();return g(f.onUpdateData(m.Name,o,n.ID,m.ChannelItemID))}),r(1,"div",39)(2,"div",40),_(3),U(4,"number"),s(),r(5,"a",41),x("click",function(n){return p(e),g(n==null?null:n.stopPropagation())}),w(6,"i",32),s()()()}if(t&2){let e=l,i=a(2).$implicit,n=a(2);d("ngClass",J(5,Oe,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1,n.hasPriceEdit()&&n.table()=="price"||n.hasInventoryEdit()&&n.table()=="inventory")),c(3),P(" ",H(4,3,n.printItem(e))," "),c(2),d("href",e.Url,y)}}function Qe(t,l){t&1&&(r(0,"td",37)(1,"div",39)(2,"span"),_(3,"X"),s()()())}function et(t,l){if(t&1&&u(0,Je,7,8,"td",36)(1,Qe,4,0,"td",37),t&2){let e,i=l.$implicit,n=a().$implicit,o=a(2);h((e=o.getItemFromChannel(n,i))?0:1,e)}}function tt(t,l){if(t&1&&(r(0,"tr"),u(1,qe,14,9),r(2,"td",18),_(3),s(),r(4,"td",19)(5,"div",20)(6,"div",21),_(7),s(),r(8,"div",17),u(9,Ge,2,1,"a",22),s()()(),u(10,Ye,4,6),v(11,et,2,1,null,null,I),s()),t&2){let e=l.$implicit,i=l.$index,n=a().$implicit,o=a();c(),h(i==0?1:-1),c(2),F(e==null?null:e.Model),c(2),d("matTooltip",e.Discontinued?o.discontinuedVariantMsg:""),c(),d("ngClass",M(7,Ee,e.Discontinued)),c(),P(" ",e.Code," "),c(2),h(n.Category?9:-1),c(),h(o.hiddenIPOSInventory()==!1?10:-1),c(),S(o.channel())}}function nt(t,l){if(t&1&&(r(0,"tbody"),v(1,tt,13,9,"tr",null,I),s()),t&2){let e=l.$implicit;c(),S(e.Variants)}}var Nt=(()=>{let l=class l{constructor(){this.dialog=b(ue),this.biggerPictureService=b(fe),this.authService=b(se),this.permissionsService=b(ae),this.table=V(void 0),this.channel=V(void 0),this.showProductToggle=V(!1),this.multiwarehouse=V(!1),this.hiddenIPOSInventory=V(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=D.PriceUpdate,this.roleInventoryUpdate=D.InventoryUpdate,this.hasPriceEdit=R(!1),this.hasInventoryEdit=R(!1),this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new A,this.destroy$=new q,this.toggle=new A,this.hostName=this.authService.getDomain()}ngOnInit(){this.initRoles();let i=this.table();i=="inventory"?this.stockHeader="Stock":i=="price"&&(this.stockHeader="Price")}initRoles(){this.permissionsService.hasPermission(D.InventoryUpdate).then(i=>this.hasInventoryEdit.set(i)),this.permissionsService.hasPermission(D.PriceUpdate).then(i=>this.hasPriceEdit.set(i))}onCheckboxStateProduct(i){let n=this.data.filter(o=>o.ID==i);n.length>0&&(n=n.map(o=>(o.Variants=o.Variants.map(m=>(m.selected=o.selected,m)),o)))}onCheckboxStateChange(){this.data=this.data.map(i=>(i.Variants=i.Variants.map(n=>(n.selected=this.checkboxState,n)),i))}getItemFromChannel(i,n){return i.Channel.find(m=>Z.IsNotEmpty(n.LocationID)?m.LocationID==n.LocationID:m.ChannelID==n.ID)}printItem(i){let n=this.table();if(n=="inventory")return i.Inventory;if(n=="price")return i.Price}onUpdateData(i,n,o,m){let f=this.table();this.hasPriceEdit()&&f=="price"&&this.onOpenDialogUpdate(i,n,o,m),this.hasInventoryEdit()&&f=="inventory"&&this.onOpenDialogUpdate(i,n,o,m)}onOpenDialogUpdate(i,n,o,m){this.dialog.open(Se,{data:{Name:i,Variant:n,ChannelID:o,Table:this.table(),ChannelItemID:m}}).afterClosed().pipe(G(f=>Z.IsNotEmpty(f)),K(this.destroy$)).subscribe(f=>{this.onSubmit.emit(f)})}printPOS(i){let n=this.table();return n=="inventory"?i.Inventory?i.Inventory:0:n=="price"?i.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(i,n){this.biggerPictureService.openBiggerPicture(i,n)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=N({type:l,selectors:[["app-table"]],inputs:{data:"data",table:[1,"table"],channel:[1,"channel"],showProductToggle:[1,"showProductToggle"],productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:18,vars:2,consts:[["checkbox_update",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],["scope","col"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-end"],[1,"border","rounded","w-img","cursor-pointer",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0",3,"ngClass"],[1,"table-white","text-center",2,"color","red"],[1,"p-0",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"]],template:function(n,o){n&1&&(r(0,"div",1)(1,"table",2)(2,"thead",3)(3,"tr")(4,"th",4)(5,"div",5)(6,"div"),_(7,"Product"),s(),u(8,Ve,3,1,"mat-slide-toggle",6),s()(),r(9,"th",7),_(10,"Variant"),s(),r(11,"th",8),_(12,"SKU"),s(),u(13,Ne,3,3),v(14,Ue,7,6,"th",9,X),s()(),v(16,nt,3,0,"tbody",null,I),s()()),n&2&&(c(8),h(o.showProductToggle()?8:-1),c(5),h(o.hiddenIPOSInventory()==!1?13:-1),c(),S(o.channel()),c(2),S(o.data))},dependencies:[oe,te,ne,L,de,$,B,ye,Te,he,le,be,ce,re,_e,me,ie,we],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]});let t=l;return t})();export{dt as a,Nt as b};
|
|
1
|
+
import{a as ve}from"./chunk-FH2KAM6J.js";import{a as Se,b as we}from"./chunk-C67KF7MG.js";import{a as Te,b as ye}from"./chunk-JKRELT7N.js";import{a as fe}from"./chunk-DLHIDOS3.js";import{a as pe,b as ge,c as ue,g as he,i as Ce,j as xe}from"./chunk-IA7NJXJD.js";import{a as _e}from"./chunk-UEXWQT5J.js";import{b as be}from"./chunk-M27MYADT.js";import{a as le}from"./chunk-UDNUDL5Z.js";import{c as me}from"./chunk-IZZY74PN.js";import{a as D}from"./chunk-ZSUWHVKX.js";import{h as se}from"./chunk-J4552BMI.js";import{a as ae,b as re,c as ce}from"./chunk-NB2H6KA7.js";import{c as Z}from"./chunk-UPRDDI4K.js";import{A as L,b as de,h as $,m as B}from"./chunk-6UM4NHOR.js";import{A as ie,B as oe,q as te,v as ne}from"./chunk-CGSMHTKB.js";import{G,Hb as N,Ia as R,Ic as z,Nb as T,Nc as _,Oc as F,Pc as P,Rc as E,Sc as k,Tc as O,Xc as Y,ac as u,ad as M,bd as J,ca as K,cc as h,dc as I,ec as X,f as q,fc as v,gc as S,hc as d,ic as r,id as U,jc as s,jd as H,kc as w,kd as Q,ld as ee,mb as y,ob as c,qc as j,ra as b,rc as C,tb as A,ud as V,wc as x,ya as p,yc as a,za as g}from"./chunk-OHGMB7HJ.js";function Fe(t,l){if(t&1){let e=C();r(0,"span")(1,"mat-checkbox",4),x("change",function(n){p(e);let o=a();return g(o.onSelectAll(n==null?null:n.checked))}),r(2,"h5",5),_(3,"Select All"),s()()()}}function Pe(t,l){if(t&1){let e=C();r(0,"li")(1,"mat-checkbox",6),O("ngModelChange",function(n){let o=p(e).$implicit;return k(o.selected,n)||(o.selected=n),g(n)}),r(2,"div",7),w(3,"img",8),r(4,"h5",9),_(5),s()()()()}if(t&2){let e=l.$implicit;c(),E("ngModel",e.selected),c(2),d("src",e.Img,y),c(2),F(e.Name)}}var dt=(()=>{let l=class l{constructor(){this.data=b(ge),this.dialogRef=b(pe),this.selectedItems=this.data.selectedItems,this.channels=this.data.channels}ngOnInit(){this.initModalConfig()}initModalConfig(){let i=this.data.title?this.data.title:"Updating Inventory";this.modalConfig=new Ce,this.modalConfig.title=i}onSelectAll(i){this.channels=this.channels.map(n=>(n.selected=i,n))}onOk(){this.dialogRef.close(this.channels)}onClose(){this.dialogRef.close()}get getSelectedChannel(){return this.channels.filter(i=>i.selected)}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=N({type:l,selectors:[["app-modal-update-channels"]],decls:7,vars:3,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[2,"overflow-y","auto","max-height","28rem"],[1,"no-bullet",2,"margin-bottom","0px !important","overflow","hidden"],["color","primary",1,"me-6",3,"change"],[1,"fw-light"],["color","primary",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"channelLogo-md",3,"src"],[1,"fw-light","ms-2","my-auto"]],template:function(n,o){n&1&&(r(0,"modal-material",0),x("onOk",function(){return o.onOk()})("onClose",function(){return o.onClose()})("onCancel",function(){return o.onClose()}),r(1,"div",1)(2,"div",2),u(3,Fe,4,0,"span"),r(4,"ul",3),v(5,Pe,6,3,"li",null,I),s()()()()),n&2&&(d("dynamicValidated",(o.getSelectedChannel==null?null:o.getSelectedChannel.length)>0)("config",o.modalConfig),c(3),h((o.channels==null?null:o.channels.length)>1?3:-1),c(2),S(o.channels))},dependencies:[xe,ve,L,$,B],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]});let t=l;return t})();var W=t=>[t],Ee=t=>({"text-decoration-line-through":t}),ke=t=>({"text-danger":t}),Oe=(t,l)=>({"bg-gradient-warning":t,"cell-hover pointer":l});function Ve(t,l){if(t&1){let e=C();r(0,"mat-slide-toggle",10),x("toggleChange",function(){p(e);let n=a();return n.toggleStatus=!n.toggleStatus,g(n.onToggle())}),r(1,"small",11),_(2),s()()}if(t&2){let e=a();c(2),P(" ",e.productToggleTitle?e.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function De(t,l){if(t&1){let e=C();r(0,"th")(1,"input",13),O("ngModelChange",function(n){p(e);let o=a(2);return k(o.checkboxState,n)||(o.checkboxState=n),g(n)}),x("ngModelChange",function(){p(e);let n=a(2);return g(n.onCheckboxStateChange())}),s()()}if(t&2){let e=a(2);c(),E("ngModel",e.checkboxState)}}function Ne(t,l){if(t&1&&(T(0,De,2,1,"ng-template",12),r(1,"th",8),_(2,"POS"),s()),t&2){let e=a();d("ngxPermissionsOnly",M(1,W,e.rolePriceEdit))}}function Ue(t,l){if(t&1&&(r(0,"th",9)(1,"div",14)(2,"div",15),w(3,"img",16),r(4,"div",17),_(5),U(6,"stringLimit"),s()()()()),t&2){let e=l.$implicit;c(2),d("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),c(),d("src",e==null?null:e.Img,y),c(2),P(" ",Q(6,3,e.Name,20)," ")}}function $e(t,l){t&1&&j(0)}function Be(t,l){if(t&1&&T(0,$e,1,0,"ng-container",29),t&2){a(2);let e=z(5);d("ngTemplateOutlet",e)}}function Le(t,l){if(t&1&&T(0,Be,1,1,"ng-template",12),t&2){let e=a(4);d("ngxPermissionsOnly",M(1,W,e.roleInventoryUpdate))}}function We(t,l){t&1&&j(0)}function Re(t,l){if(t&1&&T(0,We,1,0,"ng-container",29),t&2){a(2);let e=z(5);d("ngTemplateOutlet",e)}}function Ae(t,l){if(t&1&&T(0,Re,1,1,"ng-template",12),t&2){let e=a(4);d("ngxPermissionsOnly",M(1,W,e.rolePriceEdit))}}function je(t,l){if(t&1){let e=C();r(0,"div")(1,"input",30),O("ngModelChange",function(n){p(e);let o=a(4).$implicit;return k(o.selected,n)||(o.selected=n),g(n)}),x("ngModelChange",function(){p(e);let n=a(4).$implicit,o=a();return g(o.onCheckboxStateProduct(n.ID))}),s()()}if(t&2){let e=a(4).$implicit;c(),E("ngModel",e.selected),d("disabled",!(e!=null&&e.Category))}}function ze(t,l){if(t&1&&u(0,je,2,2,"div"),t&2){let e=a(3).$implicit;h((e==null||e.Variants==null?null:e.Variants.length)>1?0:-1)}}function He(t,l){if(t&1){let e=C();r(0,"img",31),x("click",function(n){p(e);let o=a(3).$implicit,m=a();return g(m.onZoomImage(n,o==null?null:o.ImageUrl))}),s()}if(t&2){let e=a(3).$implicit;d("src",Y(e==null?null:e.ThumbnailUrl),y)}}function Ze(t,l){t&1&&w(0,"img",26)}function qe(t,l){if(t&1&&(r(0,"td",23)(1,"div",24),u(2,Le,1,3,null,12)(3,Ae,1,3,null,12),T(4,ze,1,1,"ng-template",null,0,ee),r(6,"div"),u(7,He,1,2,"img",25)(8,Ze,1,0,"img",26),s()()(),r(9,"td",27)(10,"div"),_(11),s(),r(12,"small",28),_(13),s()()),t&2){let e=a(2).$implicit,i=a();d("rowSpan",e==null?null:e.Variants.length),c(2),h(i.table()=="inventory"?2:3),c(5),h(e!=null&&e.ThumbnailUrl?7:8),c(2),d("rowSpan",e==null?null:e.Variants.length),c(2),F(e==null?null:e.Name),c(),d("ngClass",M(7,ke,!(e!=null&&e.Category))),c(),P("(",e!=null&&e.Category?e==null?null:e.Category:"Not Found In POS",")")}}function Ge(t,l){if(t&1&&(r(0,"a",22),w(1,"i",32),s()),t&2){let e=a().$implicit,i=a(2);d("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),y)}}function Ke(t,l){if(t&1){let e=C();r(0,"input",35),O("ngModelChange",function(n){p(e);let o=a(3).$implicit;return k(o.selected,n)||(o.selected=n),g(n)}),s()}if(t&2){let e=a(3).$implicit,i=a().$implicit;E("ngModel",e.selected),d("disabled",!(i!=null&&i.Category))}}function Xe(t,l){if(t&1&&(r(0,"td",33),u(1,Ke,1,2,"input",34),s()),t&2){let e=a(2).$implicit,i=a(2);c(),h(i.printPOS(e)>=0||i.table()=="price"?1:-1)}}function Ye(t,l){if(t&1&&(T(0,Xe,2,1,"ng-template",12),r(1,"td",19),_(2),U(3,"number"),s()),t&2){let e=a().$implicit,i=a(2);d("ngxPermissionsOnly",M(4,W,i.rolePriceEdit)),c(2),F(H(3,2,i.printPOS(e)))}}function Je(t,l){if(t&1){let e=C();r(0,"td",38),x("click",function(){p(e);let n=a().$implicit,o=a().$implicit,m=a().$implicit,f=a();return g(f.onUpdateData(m.Name,o,n.ID,m.ChannelItemID))}),r(1,"div",39)(2,"div",40),_(3),U(4,"number"),s(),r(5,"a",41),x("click",function(n){return p(e),g(n==null?null:n.stopPropagation())}),w(6,"i",32),s()()()}if(t&2){let e=l,i=a(2).$implicit,n=a(2);d("ngClass",J(5,Oe,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1,n.hasPriceEdit()&&n.table()=="price"||n.hasInventoryEdit()&&n.table()=="inventory")),c(3),P(" ",H(4,3,n.printItem(e))," "),c(2),d("href",e.Url,y)}}function Qe(t,l){t&1&&(r(0,"td",37)(1,"div",39)(2,"span"),_(3,"X"),s()()())}function et(t,l){if(t&1&&u(0,Je,7,8,"td",36)(1,Qe,4,0,"td",37),t&2){let e,i=l.$implicit,n=a().$implicit,o=a(2);h((e=o.getItemFromChannel(n,i))?0:1,e)}}function tt(t,l){if(t&1&&(r(0,"tr"),u(1,qe,14,9),r(2,"td",18),_(3),s(),r(4,"td",19)(5,"div",20)(6,"div",21),_(7),s(),r(8,"div",17),u(9,Ge,2,1,"a",22),s()()(),u(10,Ye,4,6),v(11,et,2,1,null,null,I),s()),t&2){let e=l.$implicit,i=l.$index,n=a().$implicit,o=a();c(),h(i==0?1:-1),c(2),F(e==null?null:e.Model),c(2),d("matTooltip",e.Discontinued?o.discontinuedVariantMsg:""),c(),d("ngClass",M(7,Ee,e.Discontinued)),c(),P(" ",e.Code," "),c(2),h(n.Category?9:-1),c(),h(o.hiddenIPOSInventory()==!1?10:-1),c(),S(o.channel())}}function nt(t,l){if(t&1&&(r(0,"tbody"),v(1,tt,13,9,"tr",null,I),s()),t&2){let e=l.$implicit;c(),S(e.Variants)}}var Nt=(()=>{let l=class l{constructor(){this.dialog=b(ue),this.biggerPictureService=b(fe),this.authService=b(se),this.permissionsService=b(ae),this.table=V(void 0),this.channel=V(void 0),this.showProductToggle=V(!1),this.multiwarehouse=V(!1),this.hiddenIPOSInventory=V(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=D.PriceUpdate,this.roleInventoryUpdate=D.InventoryUpdate,this.hasPriceEdit=R(!1),this.hasInventoryEdit=R(!1),this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new A,this.destroy$=new q,this.toggle=new A,this.hostName=this.authService.getDomain()}ngOnInit(){this.initRoles();let i=this.table();i=="inventory"?this.stockHeader="Stock":i=="price"&&(this.stockHeader="Price")}initRoles(){this.permissionsService.hasPermission(D.InventoryUpdate).then(i=>this.hasInventoryEdit.set(i)),this.permissionsService.hasPermission(D.PriceUpdate).then(i=>this.hasPriceEdit.set(i))}onCheckboxStateProduct(i){let n=this.data.filter(o=>o.ID==i);n.length>0&&(n=n.map(o=>(o.Variants=o.Variants.map(m=>(m.selected=o.selected,m)),o)))}onCheckboxStateChange(){this.data=this.data.map(i=>(i.Variants=i.Variants.map(n=>(n.selected=this.checkboxState,n)),i))}getItemFromChannel(i,n){return i.Channel.find(m=>Z.IsNotEmpty(n.LocationID)?m.LocationID==n.LocationID:m.ChannelID==n.ID)}printItem(i){let n=this.table();if(n=="inventory")return i.Inventory;if(n=="price")return i.Price}onUpdateData(i,n,o,m){let f=this.table();this.hasPriceEdit()&&f=="price"&&this.onOpenDialogUpdate(i,n,o,m),this.hasInventoryEdit()&&f=="inventory"&&this.onOpenDialogUpdate(i,n,o,m)}onOpenDialogUpdate(i,n,o,m){this.dialog.open(Se,{data:{Name:i,Variant:n,ChannelID:o,Table:this.table(),ChannelItemID:m}}).afterClosed().pipe(G(f=>Z.IsNotEmpty(f)),K(this.destroy$)).subscribe(f=>{this.onSubmit.emit(f)})}printPOS(i){let n=this.table();return n=="inventory"?i.Inventory?i.Inventory:0:n=="price"?i.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(i,n){this.biggerPictureService.openBiggerPicture(i,n)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};l.\u0275fac=function(n){return new(n||l)},l.\u0275cmp=N({type:l,selectors:[["app-table"]],inputs:{data:"data",table:[1,"table"],channel:[1,"channel"],showProductToggle:[1,"showProductToggle"],productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:18,vars:2,consts:[["checkbox_update",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],["scope","col"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-end"],[1,"border","rounded","w-img","cursor-pointer",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0",3,"ngClass"],[1,"table-white","text-center",2,"color","red"],[1,"p-0",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"]],template:function(n,o){n&1&&(r(0,"div",1)(1,"table",2)(2,"thead",3)(3,"tr")(4,"th",4)(5,"div",5)(6,"div"),_(7,"Product"),s(),u(8,Ve,3,1,"mat-slide-toggle",6),s()(),r(9,"th",7),_(10,"Variant"),s(),r(11,"th",8),_(12,"SKU"),s(),u(13,Ne,3,3),v(14,Ue,7,6,"th",9,X),s()(),v(16,nt,3,0,"tbody",null,I),s()()),n&2&&(c(8),h(o.showProductToggle()?8:-1),c(5),h(o.hiddenIPOSInventory()==!1?13:-1),c(),S(o.channel()),c(2),S(o.data))},dependencies:[oe,te,ne,L,de,$,B,ye,Te,he,le,be,ce,re,_e,me,ie,we],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]});let t=l;return t})();export{dt as a,Nt as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as re,b as pe}from"./chunk-TVEI5B2O.js";import"./chunk-VG66LDXQ.js";import"./chunk-LR2YCE6M.js";import{a as ne,b as ie,d as ae,e as oe}from"./chunk-BZWZ64N5.js";import{a as le}from"./chunk-27DIE2YS.js";import{b as te}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-JRCXHF2X.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{h as X}from"./chunk-
|
|
1
|
+
import{a as re,b as pe}from"./chunk-TVEI5B2O.js";import"./chunk-VG66LDXQ.js";import"./chunk-LR2YCE6M.js";import{a as ne,b as ie,d as ae,e as oe}from"./chunk-BZWZ64N5.js";import{a as le}from"./chunk-27DIE2YS.js";import{b as te}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-JRCXHF2X.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{h as X}from"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{c as K}from"./chunk-UPRDDI4K.js";import{A as ee,h as Y,m as Z}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{e as Q}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as G,w as k,y as H,z as U}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as B,Nb as P,Nc as s,Oc as f,Pc as y,Rc as z,Sc as A,Tc as V,Z as D,_c as J,aa as M,ac as R,bc as T,cc as $,dc as F,fc as j,g as L,gc as O,hc as h,ic as a,id as c,jc as o,jd as d,kc as u,kd as W,ma as w,mb as S,ob as p,ra as g,rc as q,v as I,wc as v,ya as E,yc as x,za as N}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as _}from"./chunk-66YHNWRR.js";var b=(()=>{let t=class t{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(M(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 se(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 ce(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 de(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,ce,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 he(i,t){i&1&&(a(0,"div",9),u(1,"app-empty-state"),o())}var je=(()=>{let t=class t{constructor(){this.channelLogService=g(b),this.authService=g(X),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=K.getChannelLogoByTypeId(e.TypeID),e)):n.Data=[],n)),D(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=B({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}),P(7,se,3,3,"ng-template",4),o()()()(),a(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),R(12,de,21,13,"div",8),c(13,"async"),T(14,he,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,te,le,pe,re,oe,ae,ne,ie,ee,Y,Z,k,U,H],encapsulation:2});let i=t;return i})();export{je as ChannelLogComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ae,b as ce,d as pe}from"./chunk-BZWZ64N5.js";import{b as se}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import{c as le}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{a as ie}from"./chunk-ZSUWHVKX.js";import{h as te}from"./chunk-
|
|
1
|
+
import{a as ae,b as ce,d as pe}from"./chunk-BZWZ64N5.js";import{b as se}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import{c as le}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{a as ie}from"./chunk-ZSUWHVKX.js";import{h as te}from"./chunk-J4552BMI.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import{b as Z,c as ee}from"./chunk-NB2H6KA7.js";import{b as g,c as Q}from"./chunk-UPRDDI4K.js";import{A as re,h as ne,m as oe}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as X,e as Y}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{w as q}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as B,Ic as E,Nb as u,Nc as c,Oc as h,Pc as H,Rc as T,Sc as O,Tc as P,Uc as z,Vc as J,Wc as j,Z as x,aa as I,ac as k,ad as G,cc as F,ea as D,ec as R,fc as K,gc as V,hc as m,ic as o,id as S,jc as l,jd as f,kc as W,ld as N,mb as U,ob as a,oc as $,pc as A,q as M,ra as _,rc as v,v as C,wc as b,ya as L,yc as p,za as y}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var me=t=>[t];function de(t,s){if(t&1&&(o(0,"span",14),W(1,"img",15),l(),o(2,"span"),c(3),l()),t&2){let r=s.item;a(),m("src",r.Img,U)("alt",r.Name),a(2),H(" ",r.Name," ")}}function ge(t,s){if(t&1){let r=v();$(0),z(1),S(2,"async"),o(3,"a",16),b("click",function(){L(r);let e=j(1),n=p();return y(n.submitLogistics(e))}),c(4,"Submit"),l(),A()}if(t&2){let r=p();a(),J(f(2,0,r.logisticServices$))}}function he(t,s){}function _e(t,s){if(t&1){let r=v();o(0,"ng-select",18),P("ngModelChange",function(e){L(r);let n=p(2).$implicit;return O(n.ProductSKU,e)||(n.ProductSKU=e),y(e)}),l()}if(t&2){let r=p(),i=p().$implicit;T("ngModel",i.ProductSKU),m("items",r)}}function ue(t,s){if(t&1&&(o(0,"span"),c(1),l()),t&2){let r=p(2).$implicit;a(),h(r.ProductSKU||"-")}}function Se(t,s){if(t&1&&u(0,he,0,0,"ng-template",17)(1,_e,1,2,"ng-template",null,0,N)(3,ue,2,1,"ng-template",null,1,N),t&2){let r=E(2),i=E(4),e=p(2);m("ngxPermissionsOnly",G(3,me,e.logisticEditRole))("ngxPermissionsOnlyThen",r)("ngxPermissionsOnlyElse",i)}}function fe(t,s){if(t&1&&(o(0,"tr")(1,"td"),c(2),l(),o(3,"td"),c(4),l(),o(5,"td"),c(6),l(),o(7,"td"),k(8,Se,5,5),S(9,"async"),l()()),t&2){let r,i=s.$implicit,e=p();a(2),h(i.Name),a(2),h(i.Service),a(2),h(i.TypeString),a(2),F((r=f(9,4,e.logisticOptions$))?8:-1,r)}}var Re=(()=>{let s=class s{constructor(){this.http=_(Y),this.toastr=_(X),this.authService=_(te),this.filter={ChannelID:""},this.logisticEditRole=ie.LogisticUpdate,this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let i=[g.WooCommerce,g.Lazada,g.Shopify,g.Plugo,g.Tokopedia];this.channelOptions=this.channelOptions.map(e=>(i.forEach(n=>{e.TypeID===n&&(e.disabled=!0)}),e))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(i=>{this.filter=i.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(x(1))}submitLogistics(i){this.clonedLogisticServices$.pipe(C(e=>i.map(n=>(e.findIndex(d=>d.Name===n.Name&&d.ProductSKU==n.ProductSKU)==-1&&(n.IsChange=!0),n))),I(e=>this.http.post("/api/Logistic/Submit",e))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter).pipe(C(i=>i.map(e=>(e.ProductSKU=Q.IsEmpty(e.ProductSKU)?null:e.ProductSKU,e))),D(i=>{let e=JSON.parse(JSON.stringify(i));this.clonedLogisticServices$=M(e)}),x(1))}iniTitle(){let i=this.channelOptions.find(e=>e.ID==this.filter.ChannelID);this.channelName=i?i.Name:null}};s.\u0275fac=function(e){return new(e||s)},s.\u0275cmp=B({type:s,selectors:[["app-logistic"]],decls:29,vars:8,consts:[["thenBlock",""],["elseBlock",""],["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[4,"ngxPermissionsOnly"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[3,"ngxPermissionsOnly","ngxPermissionsOnlyThen","ngxPermissionsOnlyElse"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(e,n){e&1&&(o(0,"mainpanel",2),b("onSubmit",function(){return n.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",3),c(4,"Select a Channel"),l(),o(5,"ng-select",4),P("ngModelChange",function(d){return O(n.filter.ChannelID,d)||(n.filter.ChannelID=d),d}),u(6,de,4,3,"ng-template",5),l()()(),o(7,"actions"),u(8,ge,5,3,"ng-container",6),l(),o(9,"content")(10,"div",7)(11,"div",8)(12,"div",9)(13,"div",10)(14,"table",11)(15,"thead",12)(16,"tr",13)(17,"th"),c(18,"Logistic"),l(),o(19,"th"),c(20,"Service"),l(),o(21,"th"),c(22,"Type"),l(),o(23,"th"),c(24,"Logistic Service"),l()()(),o(25,"tbody"),K(26,fe,10,6,"tr",null,R),S(28,"async"),l()()()()()()()()),e&2&&(m("headerTitle","Logistic Courier - "+n.channelName)("hideSearchDropdown",!1),a(5),m("clearable",!1)("items",n.channelOptions),T("ngModel",n.filter.ChannelID),a(3),m("ngxPermissionsOnly",n.logisticEditRole),a(18),V(f(28,6,n.logisticServices$)))},dependencies:[se,pe,re,ne,oe,ae,ce,ee,Z,le,q],encapsulation:2});let t=s;return t})();export{Re as LogisticComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h}from"./chunk-
|
|
1
|
+
import{h}from"./chunk-J4552BMI.js";import{a as u}from"./chunk-NB2H6KA7.js";import{b as l}from"./chunk-D6JH2KV4.js";import{d as p}from"./chunk-UB3ZV5NW.js";import{ma as c,qa as t}from"./chunk-OHGMB7HJ.js";var g=(()=>{let e=class e{constructor(s,i,r,n){this.toastr=s,this.authService=i,this.router=r,this.permissionService=n}canActivate(s,i){let r=JSON.parse(window.localStorage.getItem("user")),n=new Date,a=!1;if(r!=null){let m=new Date(r?.Token?.expiredAt);n<m?a=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return a}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}};e.\u0275fac=function(i){return new(i||e)(t(l),t(h),t(p),t(u))},e.\u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"});let o=e;return o})();export{g as a};
|