marketplacepos 5.46.1 → 5.46.3
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-ZVKOEYH7.js → chunk-25N6ECN7.js} +1 -1
- package/Marketplace/chunk-2REDCSBO.js +1 -0
- package/Marketplace/{chunk-BAXQ2L7B.js → chunk-2WHJU6CS.js} +1 -1
- package/Marketplace/chunk-3NCIMELL.js +5 -0
- package/Marketplace/{chunk-FB2AEPXA.js → chunk-4PL4XC3C.js} +1 -1
- package/Marketplace/{chunk-L7TKCTLD.js → chunk-53AH4SKO.js} +1 -1
- package/Marketplace/{chunk-FGFIV3VO.js → chunk-57MSCWQ4.js} +1 -1
- package/Marketplace/chunk-6EMUVAZD.js +1 -0
- package/Marketplace/{chunk-CRKCNTXF.js → chunk-6GQN3CZ7.js} +1 -1
- package/Marketplace/{chunk-LOU3DIPY.js → chunk-6L24E3SM.js} +1 -1
- package/Marketplace/{chunk-2SGPD432.js → chunk-764WEWDX.js} +1 -1
- package/Marketplace/{chunk-T43QRQH5.js → chunk-7NGIEICQ.js} +1 -1
- package/Marketplace/{chunk-GPGD3XQH.js → chunk-ACNBNSCK.js} +1 -1
- package/Marketplace/{chunk-3BALA33G.js → chunk-B3HL4DNT.js} +1 -1
- package/Marketplace/chunk-B3RO2S3D.js +1 -0
- package/Marketplace/{chunk-CGEIIRYF.js → chunk-BPAZ4TES.js} +1 -1
- package/Marketplace/{chunk-GKRWJPI3.js → chunk-BXXJEM76.js} +1 -1
- package/Marketplace/{chunk-3YP6ORBR.js → chunk-C7YK5TDP.js} +1 -1
- package/Marketplace/{chunk-ZUYGRGXM.js → chunk-CTDSVBZQ.js} +1 -1
- package/Marketplace/{chunk-WAZXTB4X.js → chunk-DGIH7HSJ.js} +1 -1
- package/Marketplace/{chunk-V6UNCLNJ.js → chunk-DSAVJZIH.js} +2 -2
- package/Marketplace/{chunk-YB4KXB2C.js → chunk-E42O4ZCH.js} +1 -1
- package/Marketplace/chunk-EOYO5KJW.js +1 -0
- package/Marketplace/{chunk-NLPXBGIX.js → chunk-EPCXMVX3.js} +1 -1
- package/Marketplace/chunk-ER3SGZ7B.js +1 -0
- package/Marketplace/{chunk-6CIQBRO4.js → chunk-ESDWGP24.js} +1 -1
- package/Marketplace/chunk-GHFADTRR.js +1 -0
- package/Marketplace/{chunk-6VYFG4AQ.js → chunk-HAJDTNAW.js} +1 -1
- package/Marketplace/chunk-IJVKHW3C.js +1 -0
- package/Marketplace/chunk-JGKNYWZY.js +1 -0
- package/Marketplace/chunk-JOZJZEGN.js +1 -0
- package/Marketplace/chunk-JUHGMPX2.js +1 -0
- package/Marketplace/{chunk-6U4YIJLC.js → chunk-K5YVT6CU.js} +2 -2
- package/Marketplace/{chunk-ORLTYLPA.js → chunk-LSSYGFVV.js} +1 -1
- package/Marketplace/{chunk-KRQHTRFM.js → chunk-M7DDFDPD.js} +1 -1
- package/Marketplace/chunk-MP3G42LL.js +1 -0
- package/Marketplace/chunk-O73TXSTZ.js +1 -0
- package/Marketplace/{chunk-DB7C3AL2.js → chunk-OCJXLFB4.js} +2 -2
- package/Marketplace/chunk-PBHJGJHF.js +1 -0
- package/Marketplace/{chunk-HITTNWB6.js → chunk-PHLSX23M.js} +1 -1
- package/Marketplace/chunk-QOG52KD3.js +1 -0
- package/Marketplace/chunk-QPC5ZTYC.js +1 -0
- package/Marketplace/chunk-QSERFP5U.js +1 -0
- package/Marketplace/chunk-QTTNQJAK.js +1 -0
- package/Marketplace/chunk-RTF4FRXW.js +3 -0
- package/Marketplace/{chunk-UHJEXTOG.js → chunk-RU43F4UK.js} +1 -1
- package/Marketplace/chunk-RXQX7567.js +1 -0
- package/Marketplace/{chunk-LFGPYQCI.js → chunk-SBLG2UP7.js} +1 -1
- package/Marketplace/{chunk-DSYYZDXI.js → chunk-TG5SFCNG.js} +1 -1
- package/Marketplace/{chunk-HHO2NGCF.js → chunk-THMNZQLX.js} +1 -1
- package/Marketplace/{chunk-NWWYOZ4V.js → chunk-TKV7XWBT.js} +1 -1
- package/Marketplace/{chunk-SZGOLKC6.js → chunk-TYSVSEYQ.js} +1 -1
- package/Marketplace/{chunk-TGQ5CJ3A.js → chunk-UDXV6RW2.js} +1 -1
- package/Marketplace/{chunk-IWKRZSYG.js → chunk-V33UHV5X.js} +1 -1
- package/Marketplace/{chunk-TE5EYKIN.js → chunk-V54LZUEC.js} +1 -1
- package/Marketplace/chunk-VHOREEP5.js +1 -0
- package/Marketplace/chunk-VODHIYRA.js +1 -0
- package/Marketplace/{chunk-OE7TF7SI.js → chunk-W4MTON2T.js} +1 -1
- package/Marketplace/{chunk-DZEO4HK4.js → chunk-WBKGEDL6.js} +1 -1
- package/Marketplace/{chunk-2XWZQCUR.js → chunk-WHBI5II7.js} +1 -1
- package/Marketplace/{chunk-OVPVQS4J.js → chunk-WIMLQM6B.js} +1 -1
- package/Marketplace/{chunk-RJ5D24ZW.js → chunk-WY37QAZ4.js} +1 -1
- package/Marketplace/{chunk-4TDVVQ64.js → chunk-XMZNTZ72.js} +1 -1
- package/Marketplace/{chunk-4LZODV4E.js → chunk-XSCE2K6J.js} +1 -1
- package/Marketplace/{chunk-77MWKV5I.js → chunk-XSJBP4EN.js} +2 -2
- package/Marketplace/chunk-YIKOIRZU.js +1 -0
- package/Marketplace/{chunk-UGG2CIUU.js → chunk-ZC7VX6UG.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/main-CVD4P432.js +1 -0
- package/package.json +1 -1
- package/Marketplace/chunk-26ZM2UD3.js +0 -1
- package/Marketplace/chunk-2Z7CPNRS.js +0 -1
- package/Marketplace/chunk-3VUO4APC.js +0 -1
- package/Marketplace/chunk-7DJXZQ7M.js +0 -1
- package/Marketplace/chunk-EFI2CLNP.js +0 -1
- package/Marketplace/chunk-EI65NYTN.js +0 -1
- package/Marketplace/chunk-F2533PAC.js +0 -1
- package/Marketplace/chunk-FHWKSD5A.js +0 -3
- package/Marketplace/chunk-FIAI5SPR.js +0 -1
- package/Marketplace/chunk-FTWATKXK.js +0 -1
- package/Marketplace/chunk-ISUN5G42.js +0 -5
- package/Marketplace/chunk-JYCBJ7CC.js +0 -1
- package/Marketplace/chunk-KCFCXS2F.js +0 -1
- package/Marketplace/chunk-KFOHH7PE.js +0 -1
- package/Marketplace/chunk-M7LXGXUM.js +0 -1
- package/Marketplace/chunk-MJNFY4NT.js +0 -1
- package/Marketplace/chunk-OAG6OVUY.js +0 -1
- package/Marketplace/chunk-OHVOVAKD.js +0 -1
- package/Marketplace/chunk-OJZ7NGRW.js +0 -1
- package/Marketplace/chunk-PW42BQIY.js +0 -1
- package/Marketplace/chunk-RM2OSYMV.js +0 -1
- package/Marketplace/chunk-VIDSOLHF.js +0 -1
- package/Marketplace/chunk-ZXTHWBJ4.js +0 -1
- package/Marketplace/main-RRL4BIVO.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as xe,b as ve}from"./chunk-77MWKV5I.js";import{a as ge,b as Ce,c as Se}from"./chunk-UHJEXTOG.js";import{a as be}from"./chunk-ZVKOEYH7.js";import{a as F}from"./chunk-GKRWJPI3.js";import{a as ye}from"./chunk-67HPC5Y3.js";import"./chunk-XPCRS7AL.js";import"./chunk-MX5SR3SR.js";import{a as he}from"./chunk-OLANEXLB.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-JVNHFIYT.js";import{a as fe}from"./chunk-HHO2NGCF.js";import"./chunk-3YP6ORBR.js";import{a as _e}from"./chunk-LDL3A7NM.js";import"./chunk-FHWKSD5A.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as de}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PYXL7UF7.js";import{b as se}from"./chunk-PW42BQIY.js";import{m as ce,n as ue}from"./chunk-HJXYT6MI.js";import{A as ae,b as ie,c as ne,h as oe,m as re,o as le}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as me,s as pe}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as Z,k as $,m as ee,n as te}from"./chunk-FXQKRJWU.js";import{$c as w,Ac as H,Bc as Q,Cc as j,Gb as W,Gc as d,Hc as T,Ic as R,Kc as g,Lc as C,Mb as b,Mc as S,Nc as q,Oc as U,Pc as P,Qc as G,Ra as O,Rc as J,Sc as K,Yb as h,Z as L,ac as D,ad as E,bd as X,dc as x,ea as I,ec as B,gc as A,hc as z,ic as i,jc as n,kc as u,oc as v,pa as V,pb as k,rb as l,rd as Y,tc as f,uc as c,ya as m,za as p}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as M,b as N}from"./chunk-66YHNWRR.js";var Te=["contextMenu"],we=()=>[],Me=r=>({"td-cell-hover":r});function Ve(r,_){if(r&1){let e=v();i(0,"button",20),f("click",function(){m(e);let t=c();return p(t.setMultipleFulfillment())}),d(1," Set Fulfillment "),n()}}function Re(r,_){if(r&1&&u(0,"variants-dropdown",37),r&2){let e=c().$implicit;h("variants",e==null?null:e.Variants)}}function Ee(r,_){if(r&1&&u(0,"variant-with-image",38),r&2){let e=c().$implicit;h("variant",e==null?null:e.Variants[0])}}function Oe(r,_){if(r&1&&(i(0,"span"),d(1),n()),r&2){let e=c().$implicit;l(),R("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Pe(r,_){if(r&1){let e=v();i(0,"div",40)(1,"button",44),f("click",function(){m(e);let t=c().$implicit,s=c(2);return p(s.refreshShippingAndRefNumber(t))}),u(2,"i",45),n()()}}function Fe(r,_){if(r&1){let e=v();i(0,"button",46),f("click",function(){m(e);let t=c().$implicit,s=c(2);return p(s.onSetFulfillment(t))}),d(1," Set Fulfillment "),n()}}function Ne(r,_){if(r&1){let e=v();i(0,"tr")(1,"td")(2,"input",30),S("ngModelChange",function(t){let s=m(e).$implicit;return C(s.selected,t)||(s.selected=t),p(t)}),f("ngModelChange",function(){m(e);let t=c(2),s=P(0);return p(t.onSelectOrder(s))}),n()(),i(3,"td")(4,"div",31),u(5,"img",32),w(6,"channelImage"),i(7,"div",33)(8,"div"),d(9),n(),i(10,"small",34)(11,"span"),d(12),n()()()()(),i(13,"td")(14,"div",35)(15,"div"),u(16,"order-link",36),n(),i(17,"small"),d(18),w(19,"date"),n()()(),i(20,"td"),d(21),n(),i(22,"td"),b(23,Re,1,1,"variants-dropdown",37)(24,Ee,1,1,"variant-with-image",38),n(),i(25,"td",39),d(26),w(27,"number"),n(),i(28,"td",40)(29,"div",41)(30,"div",35)(31,"div",42)(32,"span"),d(33),n(),b(34,Oe,2,1,"span"),n(),i(35,"small"),d(36),n()(),b(37,Pe,3,0,"div",40),n()(),i(38,"td",40),b(39,Fe,2,0,"button",43),n()()}if(r&2){let e=_.$implicit,o=c(2);l(2),g("ngModel",e.selected),h("disabled",o.selectedChannelType()!=null&&o.selectedChannelType()!=e.MarketType),l(3),h("src",E(6,18,e==null?null:e.MarketType),k)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),l(4),T(e.Outlet),l(3),T(e.ChannelName),l(4),h("order",e),l(2),R(" ",X(19,20,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),l(3),T(e.Customer),l(),D(K(25,Me,(e.Variants==null?null:e.Variants.length)>1)),l(),x((e.Variants==null?null:e.Variants.length)>1?23:24),l(3),T(E(27,23,e.Amount)),l(7),T(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),l(),x(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?34:-1),l(2),R(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),l(),x(!(e.LogisticService!=null&&e.LogisticService.Name)||!e.ReferenceNumber?37:-1),l(2),x((e==null?null:e.MarketType)!=o.channelType.WooCommerce?39:-1)}}function Le(r,_){if(r&1){let e=v();i(0,"div",17)(1,"table",21)(2,"thead",22)(3,"tr",23),u(4,"th",24),i(5,"th",25),d(6,"Outlet"),n(),i(7,"th",25),d(8,"Number"),n(),i(9,"th",25),d(10,"Customer"),n(),i(11,"th"),d(12,"Items"),n(),i(13,"th",26),d(14,"Amount"),n(),i(15,"th",27),d(16,"Shipping"),n(),u(17,"th",28),n()(),i(18,"tbody"),A(19,Ne,40,27,"tr",null,B),n()(),i(21,"app-custom-paginator",29),f("next",function(){m(e);let t=c();return p(t.initReadyToShip())})("previous",function(){m(e);let t=c();return p(t.initReadyToShip())}),n()()}if(r&2){let e=c(),o=P(0);l(19),z(o),l(2),h("filter",e.filter())("totaldata",o==null?null:o.length)}}function Ie(r,_){r&1&&(i(0,"div",18),u(1,"app-empty-state"),n())}var dt=(()=>{class r{constructor(){this.toastr=V(de),this.orderService=V(F),this.fulfillmentService=V(xe),this.channelType=se,this.selectedOrders=O([]),this.selectedChannelType=Y(()=>{let e=null;return this.selectedOrders().length>0&&(e=this.selectedOrders()[0].MarketType),e}),this.filter=O({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"}]}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(o=>N(M({},o),{From:e})),this.initReadyToShip()}initReadyToShip(){this.readyToShip$=this.orderService.getReadyToShipOrders(this.filter()).pipe(I(()=>{this.selectedOrders.set([])}),L(1))}onFilterChange(e){this.filter.update(o=>M(M({},o),e))}onSetFulfillment(e){this.fulfillmentService.setFulfillmentOrder(e).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}refreshShippingAndRefNumber(e){this.orderService.refreshShippingCourier(e.ShopID,e.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),this.initReadyToShip()})}setMultipleFulfillment(){this.fulfillmentService.setFulfillmentMultipleOrders(this.selectedOrders()).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}onSelectOrder(e){let o=e.filter(t=>t.selected);this.selectedOrders.set(o)}onMouseHover(e,o){(!o.LogisticService?.Name||!o.ReferenceNumber)&&this.contextMenuEl.show(e,o)}onSelectContextItem(e){e.item?.id==="refresh"&&this.refreshShippingAndRefNumber(e.data)}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275cmp=W({type:r,selectors:[["app-ready-to-ship"]],viewQuery:function(o,t){if(o&1&&H(Te,5),o&2){let s;Q(s=j())&&(t.contextMenuEl=s.first)}},features:[G([F])],decls:37,vars:14,consts:[["contextMenu",""],["headerTitle","To Ship","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],[1,"btn","btn-outline-secondary","shadow","rounded"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","100px"],[2,"width","150px"],["rowCountApi","/api/orders/toshipcount",3,"next","previous","filter","totaldata"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"actions-cell"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem"],["matTooltip","Retrieve shipping courier and reference number",1,"btn","btn-icon-only",3,"click"],[1,"fa-solid","fa-arrows-rotate","fs-6"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(o,t){if(o&1){let s=v();q(0),w(1,"async"),i(2,"mainpanel",1),f("onSubmit",function(){return m(s),p(t.initReadyToShip())}),S("textChange",function(a){return m(s),C(t.filter().Number,a)||(t.filter().Number=a),p(a)}),i(3,"actions"),b(4,Ve,2,0,"button",2),i(5,"a",3),u(6,"i",4),i(7,"span"),d(8,"Order Fulfillment Display"),n()()(),i(9,"filters")(10,"div")(11,"label",5),d(12,"Channel"),n(),i(13,"channel-select-options",6),S("ngModelChange",function(a){return m(s),C(t.filter().ListChannelID,a)||(t.filter().ListChannelID=a),p(a)}),n()(),i(14,"div",7)(15,"label",5),d(16,"From/To"),n(),i(17,"div",8)(18,"datepicker",9),S("dateChange",function(a){return m(s),C(t.filter().From,a)||(t.filter().From=a),p(a)}),n()(),i(19,"div")(20,"datepicker",10),S("dateChange",function(a){return m(s),C(t.filter().To,a)||(t.filter().To=a),p(a)}),n()()(),i(21,"div",7)(22,"label",11),d(23,"Page Number"),n(),i(24,"input",12),S("ngModelChange",function(a){return m(s),C(t.filter().PageNumber,a)||(t.filter().PageNumber=a),p(a)}),n()(),i(25,"div",7)(26,"label",11),d(27,"Page Size"),n(),i(28,"input",13),S("ngModelChange",function(a){return m(s),C(t.filter().PageSize,a)||(t.filter().PageSize=a),p(a)}),n()()(),i(29,"content")(30,"div",14)(31,"div",15)(32,"div",16),b(33,Le,22,2,"div",17)(34,Ie,2,0,"div",18),n()()()()(),i(35,"app-context-menu",19,0),f("onSelectItem",function(a){return m(s),p(t.onSelectContextItem(a))}),n()}if(o&2){let s=U(E(1,10,t.readyToShip$)||J(13,we));l(2),g("text",t.filter().Number),l(2),x(t.selectedOrders().length>0?4:-1),l(9),h("multiple",!0),g("ngModel",t.filter().ListChannelID),l(5),g("date",t.filter().From),l(2),g("date",t.filter().To),l(4),g("ngModel",t.filter().PageNumber),l(4),g("ngModel",t.filter().PageSize),l(5),x(s.length>0?33:34),l(2),h("items",t.contextMenuItems)}},dependencies:[te,Z,ee,$,ue,ce,he,_e,ae,ne,le,ie,oe,re,ge,Ce,Se,ye,fe,be,pe,me,ve],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], div[_ngcontent-%COMP%]:hover.actions-cell .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"]})}}return r})();export{dt as ReadyToShipComponent};
|
|
1
|
+
import{a as xe,b as ve}from"./chunk-XSJBP4EN.js";import{a as ge,b as Ce,c as Se}from"./chunk-RU43F4UK.js";import{a as be}from"./chunk-25N6ECN7.js";import{a as F}from"./chunk-BXXJEM76.js";import{a as ye}from"./chunk-67HPC5Y3.js";import"./chunk-XPCRS7AL.js";import"./chunk-MX5SR3SR.js";import{a as he}from"./chunk-OLANEXLB.js";import"./chunk-PFY5UG5D.js";import"./chunk-KS7ACI26.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import"./chunk-RC5PUUVM.js";import"./chunk-JVNHFIYT.js";import{a as fe}from"./chunk-THMNZQLX.js";import"./chunk-C7YK5TDP.js";import"./chunk-ACIMXBIC.js";import{a as _e}from"./chunk-LDL3A7NM.js";import"./chunk-RTF4FRXW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as de}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import"./chunk-PYXL7UF7.js";import{b as se}from"./chunk-RXQX7567.js";import{m as ce,n as ue}from"./chunk-HJXYT6MI.js";import{A as ae,b as ie,c as ne,h as oe,m as re,o as le}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as me,s as pe}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{j as Z,k as $,m as ee,n as te}from"./chunk-FXQKRJWU.js";import{$c as w,Ac as H,Bc as Q,Cc as j,Gb as W,Gc as d,Hc as T,Ic as R,Kc as g,Lc as C,Mb as b,Mc as S,Nc as q,Oc as U,Pc as P,Qc as G,Ra as O,Rc as J,Sc as K,Yb as h,Z as L,ac as D,ad as E,bd as X,dc as x,ea as I,ec as B,gc as A,hc as z,ic as i,jc as n,kc as u,oc as v,pa as V,pb as k,rb as l,rd as Y,tc as f,uc as c,ya as m,za as p}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as M,b as N}from"./chunk-66YHNWRR.js";var Te=["contextMenu"],we=()=>[],Me=r=>({"td-cell-hover":r});function Ve(r,_){if(r&1){let e=v();i(0,"button",20),f("click",function(){m(e);let t=c();return p(t.setMultipleFulfillment())}),d(1," Set Fulfillment "),n()}}function Re(r,_){if(r&1&&u(0,"variants-dropdown",37),r&2){let e=c().$implicit;h("variants",e==null?null:e.Variants)}}function Ee(r,_){if(r&1&&u(0,"variant-with-image",38),r&2){let e=c().$implicit;h("variant",e==null?null:e.Variants[0])}}function Oe(r,_){if(r&1&&(i(0,"span"),d(1),n()),r&2){let e=c().$implicit;l(),R("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Pe(r,_){if(r&1){let e=v();i(0,"div",40)(1,"button",44),f("click",function(){m(e);let t=c().$implicit,s=c(2);return p(s.refreshShippingAndRefNumber(t))}),u(2,"i",45),n()()}}function Fe(r,_){if(r&1){let e=v();i(0,"button",46),f("click",function(){m(e);let t=c().$implicit,s=c(2);return p(s.onSetFulfillment(t))}),d(1," Set Fulfillment "),n()}}function Ne(r,_){if(r&1){let e=v();i(0,"tr")(1,"td")(2,"input",30),S("ngModelChange",function(t){let s=m(e).$implicit;return C(s.selected,t)||(s.selected=t),p(t)}),f("ngModelChange",function(){m(e);let t=c(2),s=P(0);return p(t.onSelectOrder(s))}),n()(),i(3,"td")(4,"div",31),u(5,"img",32),w(6,"channelImage"),i(7,"div",33)(8,"div"),d(9),n(),i(10,"small",34)(11,"span"),d(12),n()()()()(),i(13,"td")(14,"div",35)(15,"div"),u(16,"order-link",36),n(),i(17,"small"),d(18),w(19,"date"),n()()(),i(20,"td"),d(21),n(),i(22,"td"),b(23,Re,1,1,"variants-dropdown",37)(24,Ee,1,1,"variant-with-image",38),n(),i(25,"td",39),d(26),w(27,"number"),n(),i(28,"td",40)(29,"div",41)(30,"div",35)(31,"div",42)(32,"span"),d(33),n(),b(34,Oe,2,1,"span"),n(),i(35,"small"),d(36),n()(),b(37,Pe,3,0,"div",40),n()(),i(38,"td",40),b(39,Fe,2,0,"button",43),n()()}if(r&2){let e=_.$implicit,o=c(2);l(2),g("ngModel",e.selected),h("disabled",o.selectedChannelType()!=null&&o.selectedChannelType()!=e.MarketType),l(3),h("src",E(6,18,e==null?null:e.MarketType),k)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),l(4),T(e.Outlet),l(3),T(e.ChannelName),l(4),h("order",e),l(2),R(" ",X(19,20,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),l(3),T(e.Customer),l(),D(K(25,Me,(e.Variants==null?null:e.Variants.length)>1)),l(),x((e.Variants==null?null:e.Variants.length)>1?23:24),l(3),T(E(27,23,e.Amount)),l(7),T(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),l(),x(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?34:-1),l(2),R(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),l(),x(!(e.LogisticService!=null&&e.LogisticService.Name)||!e.ReferenceNumber?37:-1),l(2),x((e==null?null:e.MarketType)!=o.channelType.WooCommerce?39:-1)}}function Le(r,_){if(r&1){let e=v();i(0,"div",17)(1,"table",21)(2,"thead",22)(3,"tr",23),u(4,"th",24),i(5,"th",25),d(6,"Outlet"),n(),i(7,"th",25),d(8,"Number"),n(),i(9,"th",25),d(10,"Customer"),n(),i(11,"th"),d(12,"Items"),n(),i(13,"th",26),d(14,"Amount"),n(),i(15,"th",27),d(16,"Shipping"),n(),u(17,"th",28),n()(),i(18,"tbody"),A(19,Ne,40,27,"tr",null,B),n()(),i(21,"app-custom-paginator",29),f("next",function(){m(e);let t=c();return p(t.initReadyToShip())})("previous",function(){m(e);let t=c();return p(t.initReadyToShip())}),n()()}if(r&2){let e=c(),o=P(0);l(19),z(o),l(2),h("filter",e.filter())("totaldata",o==null?null:o.length)}}function Ie(r,_){r&1&&(i(0,"div",18),u(1,"app-empty-state"),n())}var dt=(()=>{class r{constructor(){this.toastr=V(de),this.orderService=V(F),this.fulfillmentService=V(xe),this.channelType=se,this.selectedOrders=O([]),this.selectedChannelType=Y(()=>{let e=null;return this.selectedOrders().length>0&&(e=this.selectedOrders()[0].MarketType),e}),this.filter=O({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"}]}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(o=>N(M({},o),{From:e})),this.initReadyToShip()}initReadyToShip(){this.readyToShip$=this.orderService.getReadyToShipOrders(this.filter()).pipe(I(()=>{this.selectedOrders.set([])}),L(1))}onFilterChange(e){this.filter.update(o=>M(M({},o),e))}onSetFulfillment(e){this.fulfillmentService.setFulfillmentOrder(e).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}refreshShippingAndRefNumber(e){this.orderService.refreshShippingCourier(e.ShopID,e.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),this.initReadyToShip()})}setMultipleFulfillment(){this.fulfillmentService.setFulfillmentMultipleOrders(this.selectedOrders()).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}onSelectOrder(e){let o=e.filter(t=>t.selected);this.selectedOrders.set(o)}onMouseHover(e,o){(!o.LogisticService?.Name||!o.ReferenceNumber)&&this.contextMenuEl.show(e,o)}onSelectContextItem(e){e.item?.id==="refresh"&&this.refreshShippingAndRefNumber(e.data)}static{this.\u0275fac=function(o){return new(o||r)}}static{this.\u0275cmp=W({type:r,selectors:[["app-ready-to-ship"]],viewQuery:function(o,t){if(o&1&&H(Te,5),o&2){let s;Q(s=j())&&(t.contextMenuEl=s.first)}},features:[G([F])],decls:37,vars:14,consts:[["contextMenu",""],["headerTitle","To Ship","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],[1,"btn","btn-outline-secondary","shadow","rounded"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","100px"],[2,"width","150px"],["rowCountApi","/api/orders/toshipcount",3,"next","previous","filter","totaldata"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"actions-cell"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem"],["matTooltip","Retrieve shipping courier and reference number",1,"btn","btn-icon-only",3,"click"],[1,"fa-solid","fa-arrows-rotate","fs-6"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(o,t){if(o&1){let s=v();q(0),w(1,"async"),i(2,"mainpanel",1),f("onSubmit",function(){return m(s),p(t.initReadyToShip())}),S("textChange",function(a){return m(s),C(t.filter().Number,a)||(t.filter().Number=a),p(a)}),i(3,"actions"),b(4,Ve,2,0,"button",2),i(5,"a",3),u(6,"i",4),i(7,"span"),d(8,"Order Fulfillment Display"),n()()(),i(9,"filters")(10,"div")(11,"label",5),d(12,"Channel"),n(),i(13,"channel-select-options",6),S("ngModelChange",function(a){return m(s),C(t.filter().ListChannelID,a)||(t.filter().ListChannelID=a),p(a)}),n()(),i(14,"div",7)(15,"label",5),d(16,"From/To"),n(),i(17,"div",8)(18,"datepicker",9),S("dateChange",function(a){return m(s),C(t.filter().From,a)||(t.filter().From=a),p(a)}),n()(),i(19,"div")(20,"datepicker",10),S("dateChange",function(a){return m(s),C(t.filter().To,a)||(t.filter().To=a),p(a)}),n()()(),i(21,"div",7)(22,"label",11),d(23,"Page Number"),n(),i(24,"input",12),S("ngModelChange",function(a){return m(s),C(t.filter().PageNumber,a)||(t.filter().PageNumber=a),p(a)}),n()(),i(25,"div",7)(26,"label",11),d(27,"Page Size"),n(),i(28,"input",13),S("ngModelChange",function(a){return m(s),C(t.filter().PageSize,a)||(t.filter().PageSize=a),p(a)}),n()()(),i(29,"content")(30,"div",14)(31,"div",15)(32,"div",16),b(33,Le,22,2,"div",17)(34,Ie,2,0,"div",18),n()()()()(),i(35,"app-context-menu",19,0),f("onSelectItem",function(a){return m(s),p(t.onSelectContextItem(a))}),n()}if(o&2){let s=U(E(1,10,t.readyToShip$)||J(13,we));l(2),g("text",t.filter().Number),l(2),x(t.selectedOrders().length>0?4:-1),l(9),h("multiple",!0),g("ngModel",t.filter().ListChannelID),l(5),g("date",t.filter().From),l(2),g("date",t.filter().To),l(4),g("ngModel",t.filter().PageNumber),l(4),g("ngModel",t.filter().PageSize),l(5),x(s.length>0?33:34),l(2),h("items",t.contextMenuItems)}},dependencies:[te,Z,ee,$,ue,ce,he,_e,ae,ne,le,ie,oe,re,ge,Ce,Se,ye,fe,be,pe,me,ve],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], div[_ngcontent-%COMP%]:hover.actions-cell .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"]})}}return r})();export{dt as ReadyToShipComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as U,b as $,c as E}from"./chunk-KSHWHTCH.js";import{h as L}from"./chunk-
|
|
1
|
+
import{a as U,b as $,c as E}from"./chunk-KSHWHTCH.js";import{h as L}from"./chunk-RTF4FRXW.js";import{a as n}from"./chunk-CGOB6Y3X.js";import{b as A,e as B}from"./chunk-WN5DZGA4.js";import{b as l,c as z}from"./chunk-RXQX7567.js";import{A as x,a as R,h as w,m as D}from"./chunk-5PS6ZS3N.js";import{r as F,s as G}from"./chunk-MFQQEEHJ.js";import{f as k,n as P}from"./chunk-FXQKRJWU.js";import{$b as _,Gb as b,Gc as y,Ic as T,Ka as f,Mb as v,Qc as O,Tc as I,Yb as s,aa as u,ea as d,ia as g,ic as h,ja as C,jc as m,oa as a,rb as c,tc as S,uc as M,v as p}from"./chunk-OJMQBH6T.js";var j=(i,r)=>({color:i,"font-weight":r});function K(i,r){if(i&1&&(h(0,"mat-radio-button",2),y(1),m()),i&2){let t=r.$implicit,e=r.index,o=M();_(I(7,j,o.model==t.Key&&o.activeBold?"#0976b4":"",o.model==t.Key&&o.activeBold?"700":"")),s("disabled",o.exception==t.Value)("matTooltip",o.title.length>0?o.title[e]:"")("value",t.Key)("name",o.name),c(),T("",t.Value," ")}}var rt=(()=>{class i{constructor(){this.model=null,this.disabled=!1,this.modelChange=new f,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold="",this.onChange=()=>{},this.onTouched=()=>{}}writeValue(t){this.model=t}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.disabled=t}change(t){let e=t&&t.value!==void 0?t.value:t;this.model=e,this.modelChange.emit(e),this.onChange(e),this.onTouched()}static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275cmp=b({type:i,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},features:[O([{provide:R,useExisting:g(()=>i),multi:!0}])],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(e,o){e&1&&(h(0,"mat-radio-group",0),S("ngModelChange",function(N){return o.change(N)}),v(1,K,2,10,"mat-radio-button",1),m()),e&2&&(s("disabled",o.disabled)("ngModel",o.model),c(),s("ngForOf",o.options))},dependencies:[P,k,E,U,$,x,w,D,G,F],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px}html[_ngcontent-%COMP%]{--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]})}}return i})();var ut=(()=>{class i{constructor(t,e,o){this.httpService=t,this.toastr=e,this.tokenService=o}saveChannel(t){return this.httpService.post("/api/Channel/SubmitChannel",t).pipe(u(e=>this.tokenService.refreshToken().pipe(p(o=>e))))}getLastSync(t){return this.httpService.get(`${n.ChannelGetLastSyncByID}/?ID=${t}`)}getChannel(t){return this.httpService.post(n.GetChannel,t)}getChannelLoader(){return this.httpService.get(n.GetChannelLoader)}testShopID(t){return this.httpService.post(n.TestShopID,t).pipe(d(e=>{this.showTostrSuccessTestShopID(e)}))}updateChannelIndex(t){return this.httpService.post(n.UpdateChannelIndex,t)}deleteChannel(t){return this.httpService.post(n.DeleteChannel,t)}mapChannelImage(t){return t.map(e=>(e.img=z.getChannelLogoByTypeId(e.TypeID),e))}showTostrSuccessTestShopID(t){let e="";for(var o in t)e+=o+" : "+t[o]+"<br/>";this.toastr.success(e,"Success",{enableHtml:!0,closeButton:!0,positionClass:"toast-bottom-right"})}getRegisterByOutletName(t){return this.httpService.post(n.GetRegisterByOutletName,{Outlet:t})}getChannelRowCount(t){return this.httpService.post(n.GetChannelRowCount,t).pipe(p(e=>e.Count))}getChannelWarehouse(t){return this.httpService.get(`${n.GetChannelWarehouse}/?ChannelID=${t}`)}unSynchronizedWarehouse(t){return this.httpService.delete(`${n.UnSynchronizedWarehouse}?ID=${t}`)}authorizedChannel(t){let e=this.getApiAuthorize(t);return this.httpService.post(`/api/${e}`,null).pipe(d(o=>{window.open(o.Url,"_blank")}))}getApiAuthorize(t){let e;switch(t){case l.Shopee:e="ChannelAuthorization/ShopeeV2_URL";break;case l.Tiktok:e="ChannelAuthorization/Tiktok_URL";break;case l.Lazada:e="ChannelAuthorization/Lazada_URL";break}return e}static{this.\u0275fac=function(e){return new(e||i)(a(B),a(A),a(L))}}static{this.\u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{ut as a,rt as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as tt,b as it,c as nt}from"./chunk-6H2KAYSB.js";import"./chunk-EYONZQ2W.js";import{a as pe}from"./chunk-GKRWJPI3.js";import"./chunk-MX5SR3SR.js";import{a as Qe,b as Ze,c as qe,e as Je,f as Xe,g as et}from"./chunk-BMYBLBSP.js";import{e as Ye,k as $e,l as Ge,m as je,n as He,o as Ke}from"./chunk-KS7ACI26.js";import"./chunk-PHUHUFYL.js";import{a as Le,b as Ae,c as ze}from"./chunk-KSHWHTCH.js";import"./chunk-HVCIQI7B.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-VFATXJRG.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import{a as Ue}from"./chunk-KRQHTRFM.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-JBT7GBCM.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import{ma as Be}from"./chunk-RC5PUUVM.js";import"./chunk-JVNHFIYT.js";import"./chunk-6VYFG4AQ.js";import{h as Ve,i as re}from"./chunk-FHWKSD5A.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as oe}from"./chunk-CGOB6Y3X.js";import{b as Pe,e as Ie}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as ke,d as Fe,e as Oe}from"./chunk-PYXL7UF7.js";import{b as ne,c as D}from"./chunk-PW42BQIY.js";import{m as Re,n as We}from"./chunk-HJXYT6MI.js";import{A as ie,b as be,c as Me,h as ee,m as te,x as Ee}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as Ne,s as ae}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{J as Te,d as F,f as L,g as A,j as X,k as z,n as I}from"./chunk-FXQKRJWU.js";import{$c as W,Ac as Ce,Bc as Se,Cc as ve,Fc as x,Gb as P,Gc as p,Hc as k,Ic as S,Ka as B,Kc as T,Lc as b,Mb as w,Mc as M,Na as ue,Oa as O,Qc as Q,Ra as f,Rc as ye,Sc as Z,Tc as De,Yb as d,Z as $,aa as ce,ad as j,bd as xe,cd as q,dc as V,ea as G,ic as o,ja as he,jc as r,kc as C,lc as N,m as me,mc as R,oc as v,pa as y,pb as fe,rb as l,sd as J,tc as g,uc as _,v as K,xb as _e,xc as ge,ya as c,yc as we,za as h}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as se,b as de}from"./chunk-66YHNWRR.js";var pt=t=>({"over-due":t});function st(t,m){if(t&1&&(o(0,"tr",8)(1,"td"),p(2),r(),o(3,"td"),p(4),r(),o(5,"td"),p(6),r(),o(7,"td"),p(8),r()()),t&2){let e=m.$implicit,n=m.index;d("ngClass",Z(5,pt,e.Exception)),l(2),k(n+1),l(2),k(e.Number),l(2),k(e.Status),l(2),k(e.Exception)}}function dt(t,m){if(t&1&&(N(0),w(1,st,9,7,"tr",7),R()),t&2){let e,n=_();l(),d("ngForOf",(e=n.downloadResult())==null?null:e.Body)}}function mt(t,m){t&1&&(o(0,"tr",9)(1,"td",10)(2,"div",11),C(3,"i",12),r(),o(4,"h4",13),p(5," There is no order to processed "),r()()())}var ot=(()=>{class t{constructor(){this.downloadResult=O()}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=P({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:16,vars:2,consts:[["EMPTY_DOWNLOAD",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[4,"ngIf","ngIfElse"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(o(0,"div",1)(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr"),C(5,"th",5),o(6,"th"),p(7,"Order Number"),r(),o(8,"th"),p(9,"Status"),r(),o(10,"th"),p(11,"Exception"),r()()(),o(12,"tbody"),w(13,dt,2,1,"ng-container",6)(14,mt,6,0,"ng-template",null,0,q),r()()()()),n&2){let a,u=x(15);l(13),d("ngIf",((a=i.downloadResult())==null||a.Body==null?null:a.Body.length)>0)("ngIfElse",u)}},dependencies:[I,F,L,A],encapsulation:2})}}return t})();var ht=t=>({"full-width":t}),ut=()=>({standalone:!0}),rt=(()=>{class t{constructor(e){this.datePipe=e,this.fullWidth=!1,this.timeChange=new B}ngOnInit(){}onTimeChange(e){let n=null;e&&(n=this.datePipe.transform(e,"HH:mm")),this.timeChange.emit(n),this.onTimePickerChange()}onShowCalendar(){let e=document.getElementById("dropdown-filter");if(e){var n=new bootstrap.Dropdown(e);n&&(n._config.autoClose="inside")}}onTimePickerChange(){let e=document.getElementById("dropdown-filter");if(e){var n=new bootstrap.Dropdown(e);n&&(n._config.autoClose="outside")}}static{this.\u0275fac=function(n){return new(n||t)(_e(z))}}static{this.\u0275cmp=P({type:t,selectors:[["app-timepicker"]],inputs:{time:"time",fullWidth:"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 a=v();o(0,"p-datepicker",1,0),M("ngModelChange",function(s){return c(a),b(i.time,s)||(i.time=s),h(s)}),g("ngModelChange",function(s){return c(a),h(i.onTimeChange(s))})("onSelect",function(){return c(a),h(i.onShowCalendar())}),o(2,"p-footer")(3,"p-button",2),g("click",function(){return c(a),x(1).hideOverlay(),h(i.onShowCalendar())}),r()()()}n&2&&(d("ngClass",Z(5,ht,i.fullWidth))("baseZIndex",1100),T("ngModel",i.time),d("timeOnly",!0)("ngModelOptions",ye(7,ut)))},dependencies:[I,F,ie,ee,te,nt,it,tt,Be],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}"]})}}return t})();var Y=(()=>{class t{constructor(){this.httpService=y(Ie),this.toastr=y(Pe),this.datePipe=y(z)}gerChannelDetailById(e){return this.httpService.post(oe.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(oe.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(oe.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(G(n=>{n.Data?.length===0&&this.toastrEmptyPreview(e)})):me}toastrEmptyPreview(e){let n=this.datePipe.transform(e.From,"dd MMM yyyy"),i=this.datePipe.transform(e.To,"dd MMM yyyy"),a=e.TimeFrom?e.TimeFrom:"",u=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${a} to ${i} ${u}!`,"No Orders!")}validateDatePreview(e){let n=!0;return e.downloadType==!0?D.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):D.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(e,n){let i=D.formatTitleFromDate(new Date(e),new Date(n)),a=this.datePipe.transform(e,i),u=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":a+"-"} ${u}`}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=he({token:t,factory:t.\u0275fac})}}return t})();function ft(t,m){if(t&1&&(o(0,"ng-option",16),C(1,"img",17),p(2),r()),t&2){let e=m.$implicit;d("value",e.ID),l(),d("src",e==null?null:e.Img,fe),l(),S("",e.Name," ")}}function _t(t,m){if(t&1){let e=v();o(0,"div",8)(1,"div",4)(2,"h5"),p(3,"Type"),r(),o(4,"p",5),p(5,"Select Type want to download"),r()(),o(6,"div",4)(7,"div",18)(8,"div")(9,"mat-radio-group",19),M("ngModelChange",function(i){c(e);let a=_();return b(a.downloadType,i)||(a.downloadType=i),h(i)}),g("ngModelChange",function(){c(e);let i=_();return h(i.onDownloadTypeChange())}),o(10,"mat-radio-button",20),p(11," Orders "),r(),o(12,"mat-radio-button",21),p(13," Disbursement "),r()()()(),o(14,"div",22)(15,"div",23),C(16,"i",24),r(),o(17,"p",25),p(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),r()()()()}if(t&2){let e=_();l(9),T("ngModel",e.downloadType),l(),d("value",!1),l(2),d("value",!0)}}function gt(t,m){t&1&&(o(0,"p",5),p(1," Select Disbursement date "),o(2,"span",26),p(3,"(payment date / order complete date)"),r(),p(4," of the channel you want to download (Max 1 Week). "),r())}function wt(t,m){t&1&&(o(0,"p",5),p(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),r())}function Ct(t,m){if(t&1){let e=v();o(0,"div",12)(1,"app-timepicker",27),M("timeChange",function(i){c(e);let a=_();return b(a.startTime,i)||(a.startTime=i),h(i)}),g("timeChange",function(){c(e);let i=_();return h(i.onStartTimeChange())}),r(),o(2,"span",28),p(3,"-"),r(),o(4,"app-timepicker",27),M("timeChange",function(i){c(e);let a=_();return b(a.endTime,i)||(a.endTime=i),h(i)}),g("timeChange",function(){c(e);let i=_();return h(i.onEndTimeChange())}),r()()}if(t&2){let e=_();l(),T("time",e.startTime),l(3),T("time",e.endTime)}}var at=(()=>{class t{constructor(){this.reset=O(!1),this.authService=y(re),this.tokenService=y(Ve),this.downloadService=y(Y),this.downloadType=f(!1),this.selectedChannelId=f(null),this.channelOptions=f(this.authService.getChannels()),this.channelType=ne,this.selectedChannel=f(null),this.showTimePicker=f(!1),this.startDate=f(null),this.endDate=f(null),this.startTime=f("00:00"),this.endTime=f("23:59"),this.minDate=f(new Date),this.maxDate=f(new Date),this.filterData=new B,this._onRememberMeChange=ue({alias:"onRememberMeChange"}),this.rememberMe=f(!1),J(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0}),this.initDateValidation()}initDateValidation(){let e=this.tokenService?.getTokenValue(),n=e?.DownloadRange?JSON.parse(e?.DownloadRange):0;if(n<=0)this.minDate.set(null),this.maxDate.set(null);else{let i=new Date,a=D.addDays(i,n-1);this.minDate.set(a)}}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(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(K(e=>e?.Model),$(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=D.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==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(e){this._onRememberMeChange.emit(e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=P({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange",_onRememberMeChange:"onRememberMeChange"},features:[Q([Y,Ye()])],decls:32,vars:14,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",4,"ngFor","ngForOf"],[1,"row","mt-6"],["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,"mt-8"],[1,"col-6","d-flex","align-items-center","gap-2"],["type","checkbox",2,"width","16px","height","16px",3,"ngModelChange","ngModel"],[1,"ms-2","fw-bold"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let a=v();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),p(5,"Select a Channel"),r(),o(6,"p",5),p(7,"Select Channel want to download order"),r()(),o(8,"div",4)(9,"ng-select",6),M("ngModelChange",function(s){return c(a),b(i.selectedChannelId,s)||(i.selectedChannelId=s),h(s)}),g("ngModelChange",function(){return c(a),h(i.onSelectChannel())}),w(10,ft,3,3,"ng-option",7),r()()(),w(11,_t,19,3,"div",8),W(12,"async"),o(13,"div",8)(14,"div",4)(15,"h5"),p(16,"Date Range"),r(),w(17,gt,5,0,"p",5)(18,wt,2,0,"p",5),r(),o(19,"div",4)(20,"div",2)(21,"mat-date-range-input",9)(22,"input",10),M("ngModelChange",function(s){return c(a),b(i.startDate,s)||(i.startDate=s),h(s)}),g("click",function(){c(a);let s=x(25);return h(s.open())}),r(),o(23,"input",11),M("ngModelChange",function(s){return c(a),b(i.endDate,s)||(i.endDate=s),h(s)}),g("click",function(){c(a);let s=x(25);return h(s.open())})("ngModelChange",function(){return c(a),h(i.onFilterDateChange())}),r()(),C(24,"mat-date-range-picker",null,0),r(),w(26,Ct,5,2,"div",12),r()(),o(27,"div",8)(28,"div",13)(29,"input",14),M("ngModelChange",function(s){return c(a),b(i.rememberMe,s)||(i.rememberMe=s),h(s)}),g("ngModelChange",function(s){return c(a),h(i.onChangeRememberMe(s))}),r(),o(30,"h5",15),p(31,"Remember Me"),r()()()()()}if(n&2){let a,u,s=x(25);l(9),d("clearable",!1),T("ngModel",i.selectedChannelId),l(),d("ngForOf",i.channelOptions()),l(),V((a=j(12,12,i.channelDetail$))!=null&&a.ServiceFeeWriteOff&&((a=i.selectedChannel())==null?null:a.TypeID)==i.channelType.Tokopedia?11:-1),l(6),V(i.downloadType()&&((u=i.selectedChannel())==null?null:u.TypeID)==i.channelType.Tokopedia?17:18),l(4),d("rangePicker",s)("min",i.minDate())("max",i.maxDate()),l(),T("ngModel",i.startDate),l(),T("ngModel",i.endDate),l(3),V(i.showTimePicker()?26:-1),l(3),T("ngModel",i.rememberMe)}},dependencies:[I,L,X,Oe,Fe,ke,ze,Le,Ae,ie,Me,be,ee,Ee,te,rt,He,$e,Ke,Ge,je],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}"]})}}return t})();var E=function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t}(E||{});var U=function(t){return t[t.DoNothing=0]="DoNothing",t[t.New=1]="New",t[t.Update=2]="Update",t}(U||{});var St=(t,m)=>({"over-due-today":t,"over-due":m});function vt(t,m){if(t&1&&(o(0,"th",21),p(1),r()),t&2){let e=_();l(),S(" ",e.selectedChannel()?"Created Date":"Last Status Update"," ")}}function yt(t,m){if(t&1&&(o(0,"td"),p(1),W(2,"date"),r()),t&2){let e=_().$implicit;l(),S(" ",xe(2,1,e.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function Dt(t,m){if(t&1&&(o(0,"span"),p(1),r()),t&2){let e=_().$implicit;l(),S(" ",e.ActionString," ")}}function xt(t,m){if(t&1&&(o(0,"li"),p(1),r()),t&2){let e=m.$implicit;l(),S(" ",e," ")}}function Tt(t,m){if(t&1&&(o(0,"ul",27),w(1,xt,2,1,"li",22),r()),t&2){let e=_().$implicit;l(),d("ngForOf",e.ActionString)}}function bt(t,m){if(t&1&&(o(0,"span",28),C(1,"i",29),r()),t&2){let e=_().$implicit;we("title","Delivery : ",e.DeliveryState,`
|
|
1
|
+
import{a as tt,b as it,c as nt}from"./chunk-6H2KAYSB.js";import"./chunk-EYONZQ2W.js";import{a as pe}from"./chunk-BXXJEM76.js";import"./chunk-MX5SR3SR.js";import{a as Qe,b as Ze,c as qe,e as Je,f as Xe,g as et}from"./chunk-BMYBLBSP.js";import{e as Ye,k as $e,l as Ge,m as je,n as He,o as Ke}from"./chunk-KS7ACI26.js";import"./chunk-PHUHUFYL.js";import{a as Le,b as Ae,c as ze}from"./chunk-KSHWHTCH.js";import"./chunk-HVCIQI7B.js";import"./chunk-3GDM5JNY.js";import"./chunk-XXT6F2ZS.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import"./chunk-VFATXJRG.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import{a as Ue}from"./chunk-M7DDFDPD.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-JBT7GBCM.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import{ma as Be}from"./chunk-RC5PUUVM.js";import"./chunk-JVNHFIYT.js";import"./chunk-HAJDTNAW.js";import"./chunk-ACIMXBIC.js";import{h as Ve,i as re}from"./chunk-RTF4FRXW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import{a as oe}from"./chunk-CGOB6Y3X.js";import{b as Pe,e as Ie}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as ke,d as Fe,e as Oe}from"./chunk-PYXL7UF7.js";import{b as ne,c as D}from"./chunk-RXQX7567.js";import{m as Re,n as We}from"./chunk-HJXYT6MI.js";import{A as ie,b as be,c as Me,h as ee,m as te,x as Ee}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import{r as Ne,s as ae}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{J as Te,d as F,f as L,g as A,j as X,k as z,n as I}from"./chunk-FXQKRJWU.js";import{$c as W,Ac as Ce,Bc as Se,Cc as ve,Fc as x,Gb as P,Gc as p,Hc as k,Ic as S,Ka as B,Kc as T,Lc as b,Mb as w,Mc as M,Na as ue,Oa as O,Qc as Q,Ra as f,Rc as ye,Sc as Z,Tc as De,Yb as d,Z as $,aa as ce,ad as j,bd as xe,cd as q,dc as V,ea as G,ic as o,ja as he,jc as r,kc as C,lc as N,m as me,mc as R,oc as v,pa as y,pb as fe,rb as l,sd as J,tc as g,uc as _,v as K,xb as _e,xc as ge,ya as c,yc as we,za as h}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import{a as se,b as de}from"./chunk-66YHNWRR.js";var pt=t=>({"over-due":t});function st(t,m){if(t&1&&(o(0,"tr",8)(1,"td"),p(2),r(),o(3,"td"),p(4),r(),o(5,"td"),p(6),r(),o(7,"td"),p(8),r()()),t&2){let e=m.$implicit,n=m.index;d("ngClass",Z(5,pt,e.Exception)),l(2),k(n+1),l(2),k(e.Number),l(2),k(e.Status),l(2),k(e.Exception)}}function dt(t,m){if(t&1&&(N(0),w(1,st,9,7,"tr",7),R()),t&2){let e,n=_();l(),d("ngForOf",(e=n.downloadResult())==null?null:e.Body)}}function mt(t,m){t&1&&(o(0,"tr",9)(1,"td",10)(2,"div",11),C(3,"i",12),r(),o(4,"h4",13),p(5," There is no order to processed "),r()()())}var ot=(()=>{class t{constructor(){this.downloadResult=O()}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=P({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:16,vars:2,consts:[["EMPTY_DOWNLOAD",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[4,"ngIf","ngIfElse"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(o(0,"div",1)(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr"),C(5,"th",5),o(6,"th"),p(7,"Order Number"),r(),o(8,"th"),p(9,"Status"),r(),o(10,"th"),p(11,"Exception"),r()()(),o(12,"tbody"),w(13,dt,2,1,"ng-container",6)(14,mt,6,0,"ng-template",null,0,q),r()()()()),n&2){let a,u=x(15);l(13),d("ngIf",((a=i.downloadResult())==null||a.Body==null?null:a.Body.length)>0)("ngIfElse",u)}},dependencies:[I,F,L,A],encapsulation:2})}}return t})();var ht=t=>({"full-width":t}),ut=()=>({standalone:!0}),rt=(()=>{class t{constructor(e){this.datePipe=e,this.fullWidth=!1,this.timeChange=new B}ngOnInit(){}onTimeChange(e){let n=null;e&&(n=this.datePipe.transform(e,"HH:mm")),this.timeChange.emit(n),this.onTimePickerChange()}onShowCalendar(){let e=document.getElementById("dropdown-filter");if(e){var n=new bootstrap.Dropdown(e);n&&(n._config.autoClose="inside")}}onTimePickerChange(){let e=document.getElementById("dropdown-filter");if(e){var n=new bootstrap.Dropdown(e);n&&(n._config.autoClose="outside")}}static{this.\u0275fac=function(n){return new(n||t)(_e(z))}}static{this.\u0275cmp=P({type:t,selectors:[["app-timepicker"]],inputs:{time:"time",fullWidth:"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 a=v();o(0,"p-datepicker",1,0),M("ngModelChange",function(s){return c(a),b(i.time,s)||(i.time=s),h(s)}),g("ngModelChange",function(s){return c(a),h(i.onTimeChange(s))})("onSelect",function(){return c(a),h(i.onShowCalendar())}),o(2,"p-footer")(3,"p-button",2),g("click",function(){return c(a),x(1).hideOverlay(),h(i.onShowCalendar())}),r()()()}n&2&&(d("ngClass",Z(5,ht,i.fullWidth))("baseZIndex",1100),T("ngModel",i.time),d("timeOnly",!0)("ngModelOptions",ye(7,ut)))},dependencies:[I,F,ie,ee,te,nt,it,tt,Be],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}"]})}}return t})();var Y=(()=>{class t{constructor(){this.httpService=y(Ie),this.toastr=y(Pe),this.datePipe=y(z)}gerChannelDetailById(e){return this.httpService.post(oe.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(oe.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(oe.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(G(n=>{n.Data?.length===0&&this.toastrEmptyPreview(e)})):me}toastrEmptyPreview(e){let n=this.datePipe.transform(e.From,"dd MMM yyyy"),i=this.datePipe.transform(e.To,"dd MMM yyyy"),a=e.TimeFrom?e.TimeFrom:"",u=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${a} to ${i} ${u}!`,"No Orders!")}validateDatePreview(e){let n=!0;return e.downloadType==!0?D.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):D.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(e,n){let i=D.formatTitleFromDate(new Date(e),new Date(n)),a=this.datePipe.transform(e,i),u=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":a+"-"} ${u}`}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=he({token:t,factory:t.\u0275fac})}}return t})();function ft(t,m){if(t&1&&(o(0,"ng-option",16),C(1,"img",17),p(2),r()),t&2){let e=m.$implicit;d("value",e.ID),l(),d("src",e==null?null:e.Img,fe),l(),S("",e.Name," ")}}function _t(t,m){if(t&1){let e=v();o(0,"div",8)(1,"div",4)(2,"h5"),p(3,"Type"),r(),o(4,"p",5),p(5,"Select Type want to download"),r()(),o(6,"div",4)(7,"div",18)(8,"div")(9,"mat-radio-group",19),M("ngModelChange",function(i){c(e);let a=_();return b(a.downloadType,i)||(a.downloadType=i),h(i)}),g("ngModelChange",function(){c(e);let i=_();return h(i.onDownloadTypeChange())}),o(10,"mat-radio-button",20),p(11," Orders "),r(),o(12,"mat-radio-button",21),p(13," Disbursement "),r()()()(),o(14,"div",22)(15,"div",23),C(16,"i",24),r(),o(17,"p",25),p(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),r()()()()}if(t&2){let e=_();l(9),T("ngModel",e.downloadType),l(),d("value",!1),l(2),d("value",!0)}}function gt(t,m){t&1&&(o(0,"p",5),p(1," Select Disbursement date "),o(2,"span",26),p(3,"(payment date / order complete date)"),r(),p(4," of the channel you want to download (Max 1 Week). "),r())}function wt(t,m){t&1&&(o(0,"p",5),p(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),r())}function Ct(t,m){if(t&1){let e=v();o(0,"div",12)(1,"app-timepicker",27),M("timeChange",function(i){c(e);let a=_();return b(a.startTime,i)||(a.startTime=i),h(i)}),g("timeChange",function(){c(e);let i=_();return h(i.onStartTimeChange())}),r(),o(2,"span",28),p(3,"-"),r(),o(4,"app-timepicker",27),M("timeChange",function(i){c(e);let a=_();return b(a.endTime,i)||(a.endTime=i),h(i)}),g("timeChange",function(){c(e);let i=_();return h(i.onEndTimeChange())}),r()()}if(t&2){let e=_();l(),T("time",e.startTime),l(3),T("time",e.endTime)}}var at=(()=>{class t{constructor(){this.reset=O(!1),this.authService=y(re),this.tokenService=y(Ve),this.downloadService=y(Y),this.downloadType=f(!1),this.selectedChannelId=f(null),this.channelOptions=f(this.authService.getChannels()),this.channelType=ne,this.selectedChannel=f(null),this.showTimePicker=f(!1),this.startDate=f(null),this.endDate=f(null),this.startTime=f("00:00"),this.endTime=f("23:59"),this.minDate=f(new Date),this.maxDate=f(new Date),this.filterData=new B,this._onRememberMeChange=ue({alias:"onRememberMeChange"}),this.rememberMe=f(!1),J(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0}),this.initDateValidation()}initDateValidation(){let e=this.tokenService?.getTokenValue(),n=e?.DownloadRange?JSON.parse(e?.DownloadRange):0;if(n<=0)this.minDate.set(null),this.maxDate.set(null);else{let i=new Date,a=D.addDays(i,n-1);this.minDate.set(a)}}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(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(K(e=>e?.Model),$(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=D.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==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(e){this._onRememberMeChange.emit(e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=P({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange",_onRememberMeChange:"onRememberMeChange"},features:[Q([Y,Ye()])],decls:32,vars:14,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",4,"ngFor","ngForOf"],[1,"row","mt-6"],["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,"mt-8"],[1,"col-6","d-flex","align-items-center","gap-2"],["type","checkbox",2,"width","16px","height","16px",3,"ngModelChange","ngModel"],[1,"ms-2","fw-bold"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let a=v();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),p(5,"Select a Channel"),r(),o(6,"p",5),p(7,"Select Channel want to download order"),r()(),o(8,"div",4)(9,"ng-select",6),M("ngModelChange",function(s){return c(a),b(i.selectedChannelId,s)||(i.selectedChannelId=s),h(s)}),g("ngModelChange",function(){return c(a),h(i.onSelectChannel())}),w(10,ft,3,3,"ng-option",7),r()()(),w(11,_t,19,3,"div",8),W(12,"async"),o(13,"div",8)(14,"div",4)(15,"h5"),p(16,"Date Range"),r(),w(17,gt,5,0,"p",5)(18,wt,2,0,"p",5),r(),o(19,"div",4)(20,"div",2)(21,"mat-date-range-input",9)(22,"input",10),M("ngModelChange",function(s){return c(a),b(i.startDate,s)||(i.startDate=s),h(s)}),g("click",function(){c(a);let s=x(25);return h(s.open())}),r(),o(23,"input",11),M("ngModelChange",function(s){return c(a),b(i.endDate,s)||(i.endDate=s),h(s)}),g("click",function(){c(a);let s=x(25);return h(s.open())})("ngModelChange",function(){return c(a),h(i.onFilterDateChange())}),r()(),C(24,"mat-date-range-picker",null,0),r(),w(26,Ct,5,2,"div",12),r()(),o(27,"div",8)(28,"div",13)(29,"input",14),M("ngModelChange",function(s){return c(a),b(i.rememberMe,s)||(i.rememberMe=s),h(s)}),g("ngModelChange",function(s){return c(a),h(i.onChangeRememberMe(s))}),r(),o(30,"h5",15),p(31,"Remember Me"),r()()()()()}if(n&2){let a,u,s=x(25);l(9),d("clearable",!1),T("ngModel",i.selectedChannelId),l(),d("ngForOf",i.channelOptions()),l(),V((a=j(12,12,i.channelDetail$))!=null&&a.ServiceFeeWriteOff&&((a=i.selectedChannel())==null?null:a.TypeID)==i.channelType.Tokopedia?11:-1),l(6),V(i.downloadType()&&((u=i.selectedChannel())==null?null:u.TypeID)==i.channelType.Tokopedia?17:18),l(4),d("rangePicker",s)("min",i.minDate())("max",i.maxDate()),l(),T("ngModel",i.startDate),l(),T("ngModel",i.endDate),l(3),V(i.showTimePicker()?26:-1),l(3),T("ngModel",i.rememberMe)}},dependencies:[I,L,X,Oe,Fe,ke,ze,Le,Ae,ie,Me,be,ee,Ee,te,rt,He,$e,Ke,Ge,je],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}"]})}}return t})();var E=function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t}(E||{});var U=function(t){return t[t.DoNothing=0]="DoNothing",t[t.New=1]="New",t[t.Update=2]="Update",t}(U||{});var St=(t,m)=>({"over-due-today":t,"over-due":m});function vt(t,m){if(t&1&&(o(0,"th",21),p(1),r()),t&2){let e=_();l(),S(" ",e.selectedChannel()?"Created Date":"Last Status Update"," ")}}function yt(t,m){if(t&1&&(o(0,"td"),p(1),W(2,"date"),r()),t&2){let e=_().$implicit;l(),S(" ",xe(2,1,e.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function Dt(t,m){if(t&1&&(o(0,"span"),p(1),r()),t&2){let e=_().$implicit;l(),S(" ",e.ActionString," ")}}function xt(t,m){if(t&1&&(o(0,"li"),p(1),r()),t&2){let e=m.$implicit;l(),S(" ",e," ")}}function Tt(t,m){if(t&1&&(o(0,"ul",27),w(1,xt,2,1,"li",22),r()),t&2){let e=_().$implicit;l(),d("ngForOf",e.ActionString)}}function bt(t,m){if(t&1&&(o(0,"span",28),C(1,"i",29),r()),t&2){let e=_().$implicit;we("title","Delivery : ",e.DeliveryState,`
|
|
2
2
|
Payment : `,e.PaymentState,"")}}function Mt(t,m){if(t&1&&(o(0,"tr")(1,"td"),p(2),r(),o(3,"td"),p(4),r(),w(5,yt,3,4,"td",23),o(6,"td")(7,"span"),p(8),r(),p(9),r(),o(10,"td",24)(11,"span"),p(12),r(),p(13),r(),o(14,"td"),w(15,Dt,2,1,"span",23)(16,Tt,2,1,"ul",25),r(),o(17,"td"),w(18,bt,2,3,"span",26),r()()),t&2){let e,n=m.$implicit,i=m.index,a=_(2);l(2),k(i+1),l(2),k(n.Number),l(),d("ngIf",((e=a.selectedChannel())==null?null:e.TypeID)!=a.channelType.Shopee&&((e=a.selectedChannel())==null?null:e.TypeID)!==a.channelType.Tiktok),l(3),S("",n.ChannelStatus," - "),l(),S("",n.ChannelStatusDescription," "),l(),d("ngClass",De(12,St,(n==null?null:n.Action)==a.actionPreviewOrder.Update,(n==null?null:n.Action)==a.actionPreviewOrder.New))("matTooltip",n.POSStatus==91||n.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),l(2),S("",n.POSStatus," - "),l(),S("",n.POSStatusDescription," "),l(2),d("ngIf",n.ActionString.length==1),l(),d("ngIf",n.ActionString.length>1),l(2),d("ngIf",n.ChannelStatus!=99&&n.POSStatus!=99)}}function Et(t,m){if(t&1&&(N(0),w(1,Mt,19,15,"tr",22),R()),t&2){let e=_();l(),d("ngForOf",e.displayPreviewData())}}function Pt(t,m){t&1&&(o(0,"tr",30)(1,"td",31)(2,"div",32),C(3,"i",33),r(),o(4,"h4",34),p(5," There is no order to processed "),r()()())}var lt=(()=>{class t{constructor(){this.orderPreview=O(),this.selectedChannel=O(),this.channelType=ne,this.allData=f(0),this.syncData=f(0),this.wrongData=f(0),this.unsyncData=f(0),this.pillStatus=f(E.ALL),this.actionPreviewOrder=U,this.previewStatus=E,this.displayPreviewData=f([]),this.exportOrders=new B,J(()=>{this.orderPreview()&&(this.filterPreviewData(E.ALL),this.initLengthStatusData())},{allowSignalWrites:!0})}filterPreviewData(e){this.pillStatus.update(()=>e),this.displayPreviewData.update(()=>this.filterDataByStatus(e))}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(e){let n=[];switch(e){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()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=P({type:t,selectors:[["preview-step"]],inputs:{orderPreview:[1,"orderPreview"],selectedChannel:[1,"selectedChannel"]},outputs:{exportOrders:"onExportOrders"},decls:41,vars:11,consts:[["EMPTY",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"col-12","d-flex","justify-content-between","align-items-end",2,"padding-left","0px","padding-right","0px"],[1,"nav","nav-pills"],[1,"nav-item","me-3"],[1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],[1,"nav-item","mx-3"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["width","15%"],[4,"ngFor","ngForOf"],[4,"ngIf"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1){let a=v();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div")(5,"ul",5)(6,"li",6)(7,"button",7),g("click",function(){return c(a),h(i.filterPreviewData(i.previewStatus.ALL))}),p(8),r()(),o(9,"li",8)(10,"button",9),g("click",function(){return c(a),h(i.filterPreviewData(i.previewStatus.SYNC))}),p(11),r()(),o(12,"li",8)(13,"button",10),g("click",function(){return c(a),h(i.filterPreviewData(i.previewStatus.WRONG))}),p(14),r()(),o(15,"li",8)(16,"button",11),g("click",function(){return c(a),h(i.filterPreviewData(i.previewStatus.UNSYNC))}),p(17),r()()()(),o(18,"div")(19,"button",12),g("click",function(){return c(a),h(i.onExportOrders())}),C(20,"i",13),o(21,"span"),p(22,"Export"),r()()()()(),o(23,"table",14)(24,"thead",15)(25,"tr"),C(26,"th",16),o(27,"th",17),p(28,"Number"),r(),w(29,vt,2,1,"th",18),o(30,"th",19),p(31,"Channel Status"),r(),o(32,"th",19),p(33,"POS Status"),r(),o(34,"th"),p(35,"Action"),r(),C(36,"th",16),r()(),o(37,"tbody"),w(38,Et,2,1,"ng-container",20)(39,Pt,6,0,"ng-template",null,0,q),r()()()()}if(n&2){let a,u,s=x(40);l(7),d("ngClass",i.pillStatus()=="all"?"btn-secondary text-white":"btn-outline-dark"),l(),S(" All (",i.allData(),") "),l(2),d("ngClass",i.pillStatus()=="sync"?"btn-success":"btn-outline-success"),l(),S(" Existing (",i.syncData(),") "),l(2),d("ngClass",i.pillStatus()=="wrong"?"btn-warning text-white":"btn-outline-warning"),l(),S(" Wrong Status (",i.wrongData(),") "),l(2),d("ngClass",i.pillStatus()=="unsync"?"btn-danger":"btn-outline-danger"),l(),S(" Missing (",i.unsyncData(),") "),l(12),d("ngIf",((a=i.selectedChannel())==null?null:a.TypeID)!=i.channelType.Shopee&&((a=i.selectedChannel())==null?null:a.TypeID)!==i.channelType.Tiktok),l(9),d("ngIf",((u=i.displayPreviewData())==null?null:u.length)>0)("ngIfElse",s)}},dependencies:[I,F,L,A,z,ae,Ne],encapsulation:2})}}return t})();var It=["stepper"];function Vt(t,m){if(t&1){let e=v();o(0,"div",2)(1,"button",19),g("click",function(){c(e);let i=_();return h(i.onStepperBack())}),p(2," Back "),r(),o(3,"button",20),g("click",function(){c(e);let i=_();return h(i.onNextStep())}),p(4," Next "),r()()}if(t&2){let e=_();l(3),d("disabled",e.disabledNextFilter())}}function kt(t,m){if(t&1){let e=v();o(0,"button",21),g("click",function(){c(e);let i=_();return h(i.onNextStep())}),p(1," Next "),r()}if(t&2){let e=_();d("disabled",e.disabledNextFilter())}}function Ft(t,m){if(t&1){let e=v();o(0,"button",22),g("click",function(){c(e);let i=_();return h(i.onNewDownload())}),C(1,"i",23),p(2," New "),r()}}function Ot(t,m){t&1&&(C(0,"i",24),o(1,"span"),p(2,"Filter"),r())}function Nt(t,m){t&1&&(C(0,"i",25),o(1,"span"),p(2,"Preview"),r())}function Rt(t,m){if(t&1){let e=v();N(0),o(1,"preview-step",26),g("onExportOrders",function(){c(e);let i=_();return h(i.onExportOrders())}),r(),R()}if(t&2){let e=m.ngIf;l(),d("orderPreview",e)}}function Wt(t,m){t&1&&(C(0,"i",27),o(1,"span"),p(2,"Finish"),r())}function Bt(t,m){if(t&1&&(N(0),C(1,"complete-step",28),R()),t&2){let e=m.ngIf;l(),d("downloadResult",e)}}function Lt(t,m){t&1&&(o(0,"h6"),p(1,"1"),r())}function At(t,m){t&1&&(o(0,"h6"),p(1,"2"),r())}function zt(t,m){t&1&&(o(0,"h6"),p(1,"3"),r())}var hn=(()=>{class t{constructor(){this.downloadService=y(Y),this.orderService=y(pe),this.productService=y(Ue),this.authService=y(re),this.stepperSelectedIndex=f(0),this.disabledNextFilter=f(!0),this.isResetFilter=f(!1),this.pageTitle=f("Download to POS"),this.cacheKey=f(D.GuidEMpty),this.rememberMe=f(!1)}onFilterChange(e){this.filter=e,this.validateDisabledNext()}validateDisabledNext(){this.disabledNextFilter.update(()=>D.IsEmpty(this.filter?.channelId)||!D.isValidDate(this.filter.startDate)||!D.isValidDate(this.filter.endDate))}onNextStep(){switch(this.stepper.selectedIndex){case 0:this.onPreview();let e=this.productService.findChannelById(this.filter.channelId,this.authService.getChannels());this.setPageTitle(`Preview ${e?.Name}`);break;case 1:this.onDownload(),this.setPageTitle("Download");break}}onStepperNext(){this.stepper.selected.completed=!0,this.stepper.next()}onPreview(){let e={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,IsDisbursement:this.filter.downloadType};D.IsNotEmpty(this.filter.startTime)&&(e=de(se({},e),{TimeFrom:this.filter.startTime+":00",TimeTo:this.filter.endTime+":00"})),this.orderPreview$=this.downloadService.onPreviewOrder(e).pipe(G(n=>{n.Data?.length>0&&(this.cacheKey.update(()=>n.CacheKey),this.onStepperNext())}),K(n=>n.Data),$(1))}onExportOrders(){let e={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(e,n).subscribe()}onDownload(){let e={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=>(e.ListPreview=n,this.downloadService.getDownloadOrder(e))),G(()=>{this.onStepperNext()}),$(1))}setPageTitle(e){this.pageTitle.update(()=>`
|
|
3
3
|
${e} (${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")}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=P({type:t,selectors:[["app-download-v2"]],viewQuery:function(n,i){if(n&1&&Ce(It,5),n&2){let a;Se(a=ve())&&(i.stepper=a.first)}},features:[Q([Y,pe,{provide:Qe,useValue:{displayDefaultIndicatorType:!1}}])],decls:26,vars:20,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"],[4,"ngIf"],["state","finish"],["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"],[3,"downloadResult"]],template:function(n,i){if(n&1){let a=v();o(0,"mainpanel",1)(1,"actions"),w(2,Vt,5,1,"div",2)(3,kt,2,1,"button",3)(4,Ft,3,0,"button",4),r(),o(5,"content")(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8)(10,"mat-stepper",9,0),M("selectedIndexChange",function(s){return c(a),b(i.stepperSelectedIndex,s)||(i.stepperSelectedIndex=s),h(s)}),o(12,"mat-step",10),w(13,Ot,3,0,"ng-template",11),o(14,"filter-step",12),g("onFilterChange",function(s){return c(a),h(i.onFilterChange(s))})("onRememberMeChange",function(s){return c(a),h(i.rememberMe.set(s))}),r()(),o(15,"mat-step",13),w(16,Nt,3,0,"ng-template",11)(17,Rt,2,1,"ng-container",14),W(18,"async"),r(),o(19,"mat-step",15),w(20,Wt,3,0,"ng-template",11)(21,Bt,2,1,"ng-container",14),W(22,"async"),r(),w(23,Lt,2,0,"ng-template",16)(24,At,2,0,"ng-template",17)(25,zt,2,0,"ng-template",18),r()()()()()()()}if(n&2){let a=x(11);d("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),ge("ngClass","last-edited-step-"+a.selectedIndex),T("selectedIndex",i.stepperSelectedIndex),l(2),d("completed",!1)("editable",i.stepperSelectedIndex()!=2),l(2),d("reset",i.isResetFilter()),l(),d("editable",i.stepperSelectedIndex()!=2)("completed",!1),l(2),d("ngIf",j(18,16,i.orderPreview$)),l(4),d("ngIf",j(22,18,i.downloadPreview$))}},dependencies:[I,F,A,X,ot,at,lt,et,Je,Ze,Xe,qe,We,Re,Te,ae],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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as ht}from"./chunk-KSHWHTCH.js";import"./chunk-HVCIQI7B.js";import"./chunk-EHUVS2VB.js";import{b as ut}from"./chunk-YTCIQBSO.js";import"./chunk-W3JTS22H.js";import"./chunk-6OMSPZZC.js";import{a as Z}from"./chunk-UMP6ZMEJ.js";import"./chunk-JVNHFIYT.js";import{i as rt}from"./chunk-RTF4FRXW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import"./chunk-CGOB6Y3X.js";import{b as et,e as it}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{a as st,b as at,d as lt,e as ct}from"./chunk-PYXL7UF7.js";import{b as h,c as tt}from"./chunk-RXQX7567.js";import{m as dt,n as gt}from"./chunk-HJXYT6MI.js";import{A as Y,h as Q,m as X}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import{b as nt,c as ot}from"./chunk-ERXVXBTU.js";import{r as mt,s as pt}from"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{J as y,f as J,g as G,j as q,n as L}from"./chunk-FXQKRJWU.js";import{$c as C,Fc as P,Gb as V,Gc as a,Hb as S,Hc as u,Ic as W,Kc as w,Lc as D,Mb as g,Mc as R,Nc as $,Oc as A,Pc as H,Sc as z,Yb as l,Z as M,aa as F,ad as x,cd as U,ea as k,ic as o,jc as r,ka as f,kc as j,lc as T,mc as N,oc as O,pb as K,q as B,rb as s,tc as I,uc as c,v,xb as _,ya as b,za as E}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var Ct=e=>[e];function xt(e,m){if(e&1&&(o(0,"span",15),j(1,"img",16),r(),o(2,"span"),a(3),r()),e&2){let t=m.item;s(),l("src",t.Img,K)("alt",t.Name),s(2),W(" ",t.Name," ")}}function Lt(e,m){if(e&1){let t=O();T(0),$(1),C(2,"async"),o(3,"a",17),I("click",function(){b(t);let n=H(1),p=c();return E(p.submitLogistics(n))}),a(4,"Submit"),r(),N()}if(e&2){let t=c();s(),A(x(2,0,t.logisticServices$))}}function yt(e,m){}function vt(e,m){if(e&1){let t=O();o(0,"ng-select",20),R("ngModelChange",function(n){b(t);let p=c(2).$implicit;return D(p.ProductSKU,n)||(p.ProductSKU=n),E(n)}),r()}if(e&2){let t=c().ngIf,i=c().$implicit;w("ngModel",i.ProductSKU),l("items",t)}}function Mt(e,m){if(e&1&&(o(0,"span"),a(1),r()),e&2){let t=c(2).$implicit;s(),u(t.ProductSKU||"-")}}function bt(e,m){if(e&1&&(T(0),g(1,yt,0,0,"ng-template",19)(2,vt,1,2,"ng-template",null,0,U)(4,Mt,2,1,"ng-template",null,1,U),N()),e&2){let t=P(3),i=P(5),n=c(2);s(),l("ngxPermissionsOnly",z(3,Ct,n.logisticEditRole))("ngxPermissionsOnlyThen",t)("ngxPermissionsOnlyElse",i)}}function Et(e,m){if(e&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td"),a(4),r(),o(5,"td"),a(6),r(),o(7,"td"),g(8,bt,6,5,"ng-container",18),C(9,"async"),r()()),e&2){let t=m.$implicit,i=c();s(2),u(t.Name),s(2),u(t.Service),s(2),u(t.TypeString),s(2),l("ngIf",x(9,4,i.logisticOptions$))}}var _t=(()=>{class e{constructor(t,i,n){this.http=t,this.toastr=i,this.authService=n,this.filter={ChannelID:""},this.logisticEditRole=Z.LogisticUpdate,this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let t=[h.WooCommerce,h.Lazada,h.Shopify,h.Plugo,h.Tokopedia];this.channelOptions=this.channelOptions.map(i=>(t.forEach(n=>{i.TypeID===n&&(i.disabled=!0)}),i))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(t=>{this.filter=t.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(M(1))}submitLogistics(t){this.clonedLogisticServices$.pipe(v(i=>t.map(n=>(i.findIndex(d=>d.Name===n.Name&&d.ProductSKU==n.ProductSKU)==-1&&(n.IsChange=!0),n))),F(i=>this.http.post("/api/Logistic/Submit",i))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter).pipe(v(t=>t.map(i=>(i.ProductSKU=tt.IsEmpty(i.ProductSKU)?null:i.ProductSKU,i))),k(t=>{let i=JSON.parse(JSON.stringify(t));this.clonedLogisticServices$=B(i)}),M(1))}iniTitle(){let t=this.channelOptions.find(i=>i.ID==this.filter.ChannelID);this.channelName=t?t.Name:null}static{this.\u0275fac=function(i){return new(i||e)(_(it),_(et),_(rt))}}static{this.\u0275cmp=V({type:e,selectors:[["app-logistic"]],standalone:!1,decls:28,vars:9,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"],[4,"ngFor","ngForOf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[4,"ngIf"],[3,"ngxPermissionsOnly","ngxPermissionsOnlyThen","ngxPermissionsOnlyElse"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(i,n){i&1&&(o(0,"mainpanel",2),I("onSubmit",function(){return n.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",3),a(4,"Select a Channel"),r(),o(5,"ng-select",4),R("ngModelChange",function(d){return D(n.filter.ChannelID,d)||(n.filter.ChannelID=d),d}),g(6,xt,4,3,"ng-template",5),r()()(),o(7,"actions"),g(8,Lt,5,3,"ng-container",6),r(),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"),a(18,"Logistic"),r(),o(19,"th"),a(20,"Service"),r(),o(21,"th"),a(22,"Type"),r(),o(23,"th"),a(24,"Logistic Service"),r()()(),o(25,"tbody"),g(26,Et,10,6,"tr",14),C(27,"async"),r()()()()()()()()),i&2&&(l("headerTitle","Logistic Courier - "+n.channelName)("hideSearchDropdown",!1),s(5),l("clearable",!1)("items",n.channelOptions),w("ngModel",n.filter.ChannelID),s(3),l("ngxPermissionsOnly",n.logisticEditRole),s(18),l("ngForOf",x(27,7,n.logisticServices$)))},dependencies:[J,G,Q,X,dt,lt,st,at,mt,nt,q],encapsulation:2})}}return e})();var Tt=[{path:"",component:_t}],St=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=S({type:e})}static{this.\u0275inj=f({imports:[L,y.forChild(Tt)]})}}return e})();var oe=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=S({type:e})}static{this.\u0275inj=f({imports:[L,y,St,Y,gt,ct,ut,ht,pt,ot]})}}return e})();export{oe as LogisticModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as fe,b as _e}from"./chunk-FGRPTNDB.js";import{a as ge}from"./chunk-EHBCYQSG.js";import{a as pe}from"./chunk-A44LN77B.js";import{a as le,b as se}from"./chunk-PQQSREEC.js";import{b as de}from"./chunk-GRYGUILI.js";import{b as me}from"./chunk-OXWPLJEW.js";import"./chunk-HVCIQI7B.js";import"./chunk-QS22J2SC.js";import"./chunk-EHUVS2VB.js";import{a as ue}from"./chunk-WHBI5II7.js";import{a as he}from"./chunk-RGAWEFPQ.js";import{c as Ce,d as B,e as U}from"./chunk-TKV7XWBT.js";import"./chunk-YTCIQBSO.js";import"./chunk-LYPHZP72.js";import"./chunk-EPBVNII2.js";import"./chunk-UZWED4UK.js";import"./chunk-4YRBARG2.js";import"./chunk-5CKVZBHM.js";import"./chunk-BKRCW7SH.js";import"./chunk-RGAKHXPF.js";import"./chunk-T2OSIFLN.js";import"./chunk-QW4EOJRM.js";import"./chunk-RHHHL4OR.js";import{a as ce}from"./chunk-M7DDFDPD.js";import"./chunk-Q4N2QUV6.js";import"./chunk-7G6GQTSH.js";import"./chunk-IHSGQFDX.js";import"./chunk-MO53T3IK.js";import"./chunk-W3JTS22H.js";import"./chunk-SDUUFQUI.js";import"./chunk-6L7TD5DW.js";import"./chunk-6OMSPZZC.js";import"./chunk-3RK6DDJD.js";import"./chunk-HIC5QC3Y.js";import"./chunk-JBT7GBCM.js";import"./chunk-UMP6ZMEJ.js";import"./chunk-YQLOB7IQ.js";import"./chunk-OZ7LWNOK.js";import"./chunk-YFDFIBAG.js";import{na as re}from"./chunk-RC5PUUVM.js";import"./chunk-JVNHFIYT.js";import"./chunk-C7YK5TDP.js";import"./chunk-HAJDTNAW.js";import"./chunk-ACIMXBIC.js";import{i as O}from"./chunk-RTF4FRXW.js";import"./chunk-Z3ITXK3D.js";import"./chunk-TGMCGROM.js";import{a as k}from"./chunk-CGOB6Y3X.js";import{b as ee,e as te}from"./chunk-WN5DZGA4.js";import"./chunk-4NEKWRL7.js";import{c as $}from"./chunk-RXQX7567.js";import{d as ie,l as ne,m as oe,n as ae}from"./chunk-HJXYT6MI.js";import{A as N,a as X,c as Y,h as E,m as L,o as Z}from"./chunk-5PS6ZS3N.js";import"./chunk-V3USB3ZU.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{g as q,j as K,m as Q,n as D}from"./chunk-FXQKRJWU.js";import{$c as v,G as W,Gb as T,Gc as C,Hc as A,Kb as H,Kc as _,Lc as P,Mb as f,Mc as w,Nc as J,Oa as V,Qc as F,Ra as M,Yb as m,Z as j,ad as x,dc as z,ea as G,ic as r,jc as p,kc as y,oc as I,pa as S,pb as R,rb as d,tc as u,uc as h,xb as b,ya as l,za as s}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function be(o,g){if(o&1&&(r(0,"div",6),y(1,"img",7),r(2,"div"),C(3),p()()),o&2){let e=g.$implicit;d(),m("src",e.logo,R),d(2),A(e.Name)}}function ye(o,g){if(o&1){let e=I();r(0,"p-multiselect",4,0),u("click",function(){l(e);let t=h();return s(t.onClickSelect())}),w("ngModelChange",function(t){l(e);let n=h();return P(n.selectedChannels,t)||(n.selectedChannels=t),s(t)}),u("ngModelChange",function(t){l(e);let n=h();return s(n.onChannelChange(t))}),f(2,be,4,2,"ng-template",5),p()}if(o&2){let e=h();m("options",e.options())("placeholder",e.placeholder()),_("ngModel",e.selectedChannels),m("showClear",e.clearable())("autofocusFilter",!0)("maxSelectedLabels",e.maxSelectedLabels())}}function Ie(o,g){if(o&1&&(r(0,"div",6),y(1,"img",7),r(2,"div"),C(3),p()()),o&2){let e=g.$implicit;d(),m("src",e.logo,R),d(2),A(e.Name)}}function Ve(o,g){if(o&1){let e=I();r(0,"p-select",8,1),u("click",function(){l(e);let t=h();return s(t.onClickSelect())}),w("ngModelChange",function(t){l(e);let n=h();return P(n.selectedChannels,t)||(n.selectedChannels=t),s(t)}),u("ngModelChange",function(t){l(e);let n=h();return s(n.onChannelChange(t))}),f(2,Ie,4,2,"ng-template",5),p()}if(o&2){let e=h();m("options",e.options())("placeholder",e.placeholder()),_("ngModel",e.selectedChannels),m("showClear",e.clearable())("autofocusFilter",!0)("filter",!0)}}var Pe=(()=>{class o extends pe{constructor(){super(),this.authService=S(O),this.multiple=V(!1),this.clearable=V(!0),this.placeholder=V("Select Channels"),this.options=M(this.authService.getChannels()),this.maxSelectedLabels=V(6),this.onChange=e=>{}}ngAfterViewInit(){this.initTopPosition()}onChannelChange(e){this.onChange(e)}onClickSelect(){setTimeout(()=>{this.adjustOverlayPosition()},0)}writeValue(e){this.selectedChannels=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}static{this.\u0275fac=function(i){return new(i||o)}}static{this.\u0275cmp=T({type:o,selectors:[["app-channel-options-v2"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"],placeholder:[1,"placeholder"],maxSelectedLabels:[1,"maxSelectedLabels"]},features:[F([{provide:X,multi:!0,useExisting:o}]),H],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,t){i&1&&f(0,ye,3,6,"p-multiselect",2)(1,Ve,3,6,"p-select",3),i&2&&z(t.multiple()?0:1)},dependencies:[D,_e,fe,re,me,N,E,L,se,le],encapsulation:2})}}return o})();function Me(o,g){if(o&1){let e=I();r(0,"button",16),u("click",function(){l(e);let t=h().ngIf,n=h();return s(n.onUpdateItems(t))}),y(1,"i",17),C(2," Update "),p()}}function ve(o,g){if(o&1&&(r(0,"div"),f(1,Me,3,0,"button",15),p()),o&2){let e=g.ngIf,i=h();d(),m("ngIf",i.productService.hasSelectionVariant(e))}}var mt=(()=>{class o{constructor(e,i,t,n,c){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=c,this.infinitePagination=S(B),this.updateResHandling=S(U),this.mainPanelService=S(ne),this.channelOptions=M([]),this.searchFilter=M({PageNumber:1,RowCount:50,filterModel:1,text:"",ListChannelID:[]}),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(j())}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(G(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter.set(e.Filter),this.mainPanelService.openModalFilter()}))}onShowDifferencePrice(e){let i=1;e&&(i=3),this.searchFilter.update(t=>(t.filterModel=i,t)),this.infinitePagination.reloadPagination(this.searchFilter())}onSearch(e){this.searchFilter.update(i=>(i.text=e,i)),this.infinitePagination.reloadPagination(this.searchFilter()),this.filterSelectedChannels()}onUpdateItems(e){let i=JSON.parse(JSON.stringify(this.channelOptions())),t=this.productService.selectedVariantProduct(e);this.dialog.open(he,{data:{title:"Updating Price",selectedItems:t,channels:i},width:"400px"}).afterClosed().pipe(W(n=>$.IsNotEmpty(n))).subscribe(n=>{this.channelOptions.set(n),this.updatePrice(e)})}filterSelectedChannels(){let i=this.authService.getChannels().filter(t=>this.searchFilter().ListChannelID?.indexOf(t.ID)!==-1);this.channelOptions.set(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(a=>({ID:a.ID,Code:a.Code,Price:a.UnitPrice})),c={ListChannelID:this.getSelectedChannels().map(a=>a.ID),ListPrice:t};this.http.post(k.UpdateChannelPrice,c).subscribe(a=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(a),this.resetSelectedChannels()})}}updatePriceByVariant(e){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post(k.UpdatePriceById,i).subscribe(t=>{this.infinitePagination.reloadPagination(this.searchFilter()),this.handlingUpdatePrice(t)})}handlingUpdatePrice(e){let i=e?.Response?.success_list,t=e?.Response?.failure_list,n=this.getSelectedChannels();i?.length>0||t?.length>0?this.updateResHandling.responseHandling(i,t,"Price",n):this.toastr.error(e[0]?.Exception,"Error")}openExportDialog(){this.dialog.open(de,{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(e=>(e.forEach(i=>{i.selected=!1}),e))}getSelectedChannels(){return this.channelOptions().filter(e=>e.selected)}static{this.\u0275fac=function(i){return new(i||o)(b(te),b(ee),b(ie),b(ce),b(O))}}static{this.\u0275cmp=T({type:o,selectors:[["app-price-pos-channel"]],features:[F([B,Q,ge,U])],decls:32,vars:23,consts:[["headerTitle","Price Comparison","textButton","Search",3,"onSubmit"],[1,"d-flex"],[4,"ngIf"],[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"],[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","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(i,t){if(i&1){let n=I();J(0),v(1,"async"),r(2,"mainpanel",0),u("onSubmit",function(a){return l(n),s(t.onSearch(a))}),r(3,"actions")(4,"div",1),f(5,ve,2,1,"div",2),v(6,"async"),r(7,"button",3),u("click",function(){return l(n),s(t.openExportDialog())}),y(8,"i",4),r(9,"span"),C(10,"Export"),p()()()(),r(11,"filters")(12,"div",5)(13,"label",6),C(14,"Channel"),p(),r(15,"app-channel-options-v2",7),w("ngModelChange",function(a){return l(n),P(t.searchFilter().ListChannelID,a)||(t.searchFilter().ListChannelID=a),s(a)}),p()(),r(16,"div",5)(17,"label",8),C(18,"Page Number"),p(),r(19,"input",9),w("ngModelChange",function(a){return l(n),P(t.searchFilter().PageNumber,a)||(t.searchFilter().PageNumber=a),s(a)}),p()(),r(20,"div")(21,"label",8),C(22,"Page Size"),p(),r(23,"input",9),w("ngModelChange",function(a){return l(n),P(t.searchFilter().RowCount,a)||(t.searchFilter().RowCount=a),s(a)}),p()()(),r(24,"content")(25,"div",10)(26,"div",11)(27,"div",12)(28,"app-table",13),v(29,"async"),u("onToggle",function(a){return l(n),s(t.onShowDifferencePrice(a))})("onSubmit",function(a){return l(n),s(t.updatePriceByVariant(a))}),p(),r(30,"infinite-paginator",14),v(31,"async"),u("onNextPage",function(){return l(n),s(t.infinitePagination.onNextPage(t.searchFilter()))})("onLastPage",function(){return l(n),s(t.infinitePagination.onLastPage(t.searchFilter()))})("onGetRowCount",function(){return l(n),s(t.infinitePagination.getRowCount(t.searchFilter()))}),p()()()()()()}i&2&&(x(1,15,t.loader$),d(5),m("ngIf",x(6,17,t.data$)),d(10),m("multiple",!0),_("ngModel",t.searchFilter().ListChannelID),d(4),_("ngModel",t.searchFilter().PageNumber),d(4),_("ngModel",t.searchFilter().RowCount),d(5),m("showProductToggle",!0)("data",x(29,19,t.data$))("channel",t.channelOptions())("hiddenIPOSInventory",!1),d(2),m("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",x(31,21,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[D,q,K,N,Y,Z,E,L,Ce,ae,oe,ue,Pe],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return o})();export{mt as PricePosChannelComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m,b as l}from"./chunk-WRJFUNM3.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as i,J as u}from"./chunk-FXQKRJWU.js";import{Gb as r,Yb as p,ic as s,jc as a,kc as o,rb as n}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var c=(()=>{class t{constructor(){this.tabs=[{Title:"Users",Url:"/menu/users/users",Description:""},{Title:"Groups",Url:"/menu/users/groups",Description:""},{Title:"Setup",Url:"/menu/users/setup",Description:""}]}static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=r({type:t,selectors:[["app-user-menu"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(e,f){e&1&&(s(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),a()()(),o(4,"router-outlet")),e&2&&(n(3),p("Tabs",f.tabs)("usePermissions",!0))},dependencies:[l,m,u,i],encapsulation:2})}}return t})(),T=[{path:"",component:c,children:[{path:"users",loadComponent(){return import("./chunk-
|
|
1
|
+
import{a as m,b as l}from"./chunk-WRJFUNM3.js";import"./chunk-ERXVXBTU.js";import"./chunk-MFQQEEHJ.js";import"./chunk-GZKOMS4T.js";import{F as i,J as u}from"./chunk-FXQKRJWU.js";import{Gb as r,Yb as p,ic as s,jc as a,kc as o,rb as n}from"./chunk-OJMQBH6T.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var c=(()=>{class t{constructor(){this.tabs=[{Title:"Users",Url:"/menu/users/users",Description:""},{Title:"Groups",Url:"/menu/users/groups",Description:""},{Title:"Setup",Url:"/menu/users/setup",Description:""}]}static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=r({type:t,selectors:[["app-user-menu"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(e,f){e&1&&(s(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),a()()(),o(4,"router-outlet")),e&2&&(n(3),p("Tabs",f.tabs)("usePermissions",!0))},dependencies:[l,m,u,i],encapsulation:2})}}return t})(),T=[{path:"",component:c,children:[{path:"users",loadComponent(){return import("./chunk-TYSVSEYQ.js").then(t=>t.UsersComponent)},data:{title:"Users"}},{path:"users/form",loadComponent(){return import("./chunk-WIMLQM6B.js").then(t=>t.UserFormComponent)},data:{title:"Users Form"}},{path:"users/info",loadComponent(){return import("./chunk-SBLG2UP7.js").then(t=>t.UserInfoComponent)},data:{title:"Users Info"}},{path:"groups",loadComponent(){return import("./chunk-GQXYHXWJ.js").then(t=>t.GroupsComponent)},data:{title:"Groups"}},{path:"setup",loadComponent(){return import("./chunk-HERZ7KEM.js").then(t=>t.SetupInfoComponent)},data:{title:"Setup Info"}},{path:"setup/form",loadComponent(){return import("./chunk-S3FZRSRP.js").then(t=>t.SetupFormComponent)},data:{title:"Setup Form"}},{path:"groups/form",loadComponent(){return import("./chunk-SLEJQAL7.js").then(t=>t.GroupsFormComponent)},data:{title:"Groups Form"}},{path:"groups/info",loadComponent(){return import("./chunk-CJ4F7QUO.js").then(t=>t.GroupInfoComponent)},data:{title:"Groups Info"}},{path:"**",redirectTo:"users",pathMatch:"full"},{path:"",pathMatch:"full",redirectTo:"users"}]}];export{c as UserMenuComponent,T as userRoutes};
|