marketplacepos 5.51.0 → 5.51.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-53B6D5OR.js → chunk-2JS77RTQ.js} +1 -1
- package/Marketplace/{chunk-OPCGCQMZ.js → chunk-2MC4ICGX.js} +1 -1
- package/Marketplace/{chunk-SLQ42VND.js → chunk-3OPIBKGC.js} +1 -1
- package/Marketplace/{chunk-7RIUHK6K.js → chunk-4H6YQH5Y.js} +1 -1
- package/Marketplace/{chunk-25Q56ATV.js → chunk-5EGTHBHU.js} +1 -1
- package/Marketplace/{chunk-E6W25RW5.js → chunk-5ZKD2ZJE.js} +1 -1
- package/Marketplace/{chunk-2PMJPSC4.js → chunk-6KAANNEH.js} +2 -2
- package/Marketplace/{chunk-C64L25TP.js → chunk-6ZRATZJD.js} +1 -1
- package/Marketplace/{chunk-6DGG765N.js → chunk-772J5O6W.js} +1 -1
- package/Marketplace/{chunk-YF7CCYHF.js → chunk-7RPUDPF6.js} +1 -1
- package/Marketplace/{chunk-J4RDYEJC.js → chunk-A24BFVXA.js} +1 -1
- package/Marketplace/{chunk-LOVYZLSU.js → chunk-BQFOS7WM.js} +1 -1
- package/Marketplace/{chunk-LWUMLKSO.js → chunk-CKH47T4N.js} +1 -1
- package/Marketplace/{chunk-T3CN3WQD.js → chunk-D765LK7G.js} +1 -1
- package/Marketplace/{chunk-36OIR6DM.js → chunk-E22EMCMR.js} +1 -1
- package/Marketplace/{chunk-VBVBTC2P.js → chunk-FSLUPR5I.js} +1 -1
- package/Marketplace/{chunk-364CDNZV.js → chunk-FYQFBMXR.js} +1 -1
- package/Marketplace/{chunk-ILFUI3MT.js → chunk-GJANGM3E.js} +1 -1
- package/Marketplace/{chunk-Q5IVQP3E.js → chunk-GRQA7Y7Y.js} +1 -1
- package/Marketplace/{chunk-ZMSM2NR7.js → chunk-GYCHAJYH.js} +1 -1
- package/Marketplace/{chunk-SASGSPGQ.js → chunk-HEK6DTVD.js} +1 -1
- package/Marketplace/{chunk-3Q6QZGLZ.js → chunk-HIGPOY23.js} +1 -1
- package/Marketplace/{chunk-AZEH7PMO.js → chunk-JNBROTGJ.js} +1 -1
- package/Marketplace/{chunk-GD5I7ADU.js → chunk-LI2DXLEI.js} +1 -1
- package/Marketplace/{chunk-EX4C4ZW4.js → chunk-LITY3VSE.js} +1 -1
- package/Marketplace/{chunk-A4X7F4MN.js → chunk-LPJSEQGR.js} +1 -1
- package/Marketplace/{chunk-EGJMTFNO.js → chunk-M3EGUVW7.js} +1 -1
- package/Marketplace/{chunk-HZTKN5RX.js → chunk-NJYWKADT.js} +1 -1
- package/Marketplace/{chunk-7QDKBMEA.js → chunk-NYBCG2UK.js} +1 -1
- package/Marketplace/{chunk-WH76SMZT.js → chunk-PDIHZKEM.js} +1 -1
- package/Marketplace/{chunk-AF6XAQPY.js → chunk-PG2DZ63W.js} +1 -1
- package/Marketplace/chunk-PPG26QRX.js +1 -0
- package/Marketplace/{chunk-BKCKASH3.js → chunk-PRMV4INM.js} +1 -1
- package/Marketplace/{chunk-4JCS7WPV.js → chunk-QCUYDIE3.js} +1 -1
- package/Marketplace/{chunk-HT2MSA66.js → chunk-QKXMWSIJ.js} +1 -1
- package/Marketplace/{chunk-R3BRUX7Z.js → chunk-QREYZRXT.js} +1 -1
- package/Marketplace/{chunk-EYYKWIXP.js → chunk-QVK3OFDS.js} +1 -1
- package/Marketplace/{chunk-BLOGT3TL.js → chunk-RIGKFQ2Q.js} +1 -1
- package/Marketplace/{chunk-ZXFWQ6VJ.js → chunk-RQI26KZX.js} +1 -1
- package/Marketplace/{chunk-T62YFSKW.js → chunk-SU5GJKTU.js} +1 -1
- package/Marketplace/{chunk-TLTFNFAB.js → chunk-TBDHXPBR.js} +1 -1
- package/Marketplace/{chunk-XSOP2OTT.js → chunk-TFCSRACM.js} +1 -1
- package/Marketplace/{chunk-6IZWIEUD.js → chunk-TIGXYFOW.js} +1 -1
- package/Marketplace/{chunk-4ITXH35D.js → chunk-UAQIEHEC.js} +1 -1
- package/Marketplace/{chunk-LCN52IJT.js → chunk-V7V5O62J.js} +1 -1
- package/Marketplace/{chunk-OJI34QN5.js → chunk-VR7NFJRO.js} +1 -1
- package/Marketplace/{chunk-K2CHDL7K.js → chunk-VWETHESQ.js} +1 -1
- package/Marketplace/{chunk-7E6JD2PT.js → chunk-VYYJFRP5.js} +1 -1
- package/Marketplace/{chunk-5YQUGH5Z.js → chunk-W4GP3QI7.js} +1 -1
- package/Marketplace/{chunk-IXNEMOFX.js → chunk-XR3S3ZAY.js} +1 -1
- package/Marketplace/{chunk-ZMMMNVOU.js → chunk-YEVETIZF.js} +1 -1
- package/Marketplace/{chunk-62YNPW6Q.js → chunk-YH3KWMUX.js} +1 -1
- package/Marketplace/{chunk-M5JNIPMS.js → chunk-YM4QLIHR.js} +1 -1
- package/Marketplace/{chunk-XAL6YLNQ.js → chunk-YNWLLBHM.js} +1 -1
- package/Marketplace/{chunk-BVW7WI5I.js → chunk-YTEEAEDW.js} +1 -1
- package/Marketplace/{chunk-WEJBY3OB.js → chunk-Z53UJ4A4.js} +1 -1
- package/Marketplace/{chunk-OMY5ASFA.js → chunk-ZCJEYG3D.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-SOO5LINL.js → main-TW7CIXAJ.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-5NWJOQN5.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ve,b as xe}from"./chunk-RIIIECQH.js";import{a as ge}from"./chunk-JWDQVXQP.js";import{a as Ce,b as Se}from"./chunk-K5WSFDNA.js";import{a as be}from"./chunk-VBVBTC2P.js";import{a as N}from"./chunk-L6CRWJ2O.js";import{a as ye}from"./chunk-PV4OJSZI.js";import"./chunk-FSOZOROI.js";import"./chunk-VYI7JYH5.js";import"./chunk-BZWZ64N5.js";import{a as fe}from"./chunk-ZXFWQ6VJ.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as he}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as _e}from"./chunk-27DIE2YS.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as ue}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as ce}from"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as pe}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-62YNPW6Q.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as ne}from"./chunk-UPRDDI4K.js";import{A as me,b as re,c as le,h as ae,m as se,o as de}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as oe}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as te,B as ie,w as $,y as ee}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as K,Cc as H,Dc as Q,Ec as j,Hb as D,Ia as P,Mc as q,Nc as d,Oc as w,Pc as M,Rc as C,Sc as S,Tc as y,Uc as U,Vc as G,Wc as F,Z as I,_c as J,ac as v,ad as X,cc as x,dc as B,ea as k,fc as A,gc as z,hc as f,ic as t,id as V,jc as n,jd as O,kc as h,kd as Y,mb as W,ob as a,pd as Z,ra as E,rc as T,wc as g,ya as p,yc as u,za as c}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as R,b as L}from"./chunk-66YHNWRR.js";var Te=["contextMenu"],we=()=>[],Me=l=>({"td-cell-hover":l});function Ve(l,m){if(l&1){let e=T();t(0,"button",20),g("click",function(){p(e);let r=u();return c(r.setMultipleFulfillment())}),d(1," Set Fulfillment "),n()}}function Re(l,m){if(l&1&&h(0,"variants-dropdown",38),l&2){let e=u().$implicit;f("variants",e==null?null:e.Variants)}}function Ee(l,m){if(l&1&&h(0,"variant-with-image",39),l&2){let e=u().$implicit;f("variant",e==null?null:e.Variants[0])}}function Oe(l,m){if(l&1&&(t(0,"span"),d(1),n()),l&2){let e=u().$implicit;a(),M("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Pe(l,m){if(l&1){let e=T();t(0,"div",41)(1,"button",45),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.refreshShippingAndRefNumber(r))}),h(2,"i",46),n()()}}function Fe(l,m){if(l&1){let e=T();t(0,"button",47),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.onSetFulfillment(r))}),d(1," Set Fulfillment "),n()}}function Ne(l,m){if(l&1){let e=T();t(0,"tr")(1,"td")(2,"input",30),y("ngModelChange",function(r){let o=p(e).$implicit;return S(o.selected,r)||(o.selected=r),c(r)}),g("ngModelChange",function(){p(e);let r=u(2),o=F(0);return c(r.onSelectOrder(o))}),n()(),t(3,"td")(4,"div",31),h(5,"img",32),V(6,"channelImage"),t(7,"div",33)(8,"div"),d(9),n(),t(10,"small",34)(11,"span"),d(12),n()()()()(),t(13,"td")(14,"div",35)(15,"div"),h(16,"order-link",36),n(),t(17,"small"),d(18),V(19,"date"),n(),h(20,"br"),t(21,"small"),h(22,"i",37),d(23),n()()(),t(24,"td"),v(25,Re,1,1,"variants-dropdown",38)(26,Ee,1,1,"variant-with-image",39),n(),t(27,"td",40),d(28),V(29,"number"),n(),t(30,"td",41)(31,"div",42)(32,"div",35)(33,"div",43)(34,"span"),d(35),n(),v(36,Oe,2,1,"span"),n(),t(37,"small"),d(38),n()(),v(39,Pe,3,0,"div",41),n()(),t(40,"td",41),v(41,Fe,2,0,"button",44),n()()}if(l&2){let e=m.$implicit,i=u(2);a(2),C("ngModel",e.selected),f("disabled",i.selectedChannelType()!=null&&i.selectedChannelType()!=e.MarketType),a(3),f("src",O(6,18,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),a(4),w(e.Outlet),a(3),w(e.ChannelName),a(4),f("order",e),a(2),M(" ",Y(19,20,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),a(5),M(" ",e.Customer," "),a(),q(X(25,Me,(e.Variants==null?null:e.Variants.length)>1)),a(),x((e.Variants==null?null:e.Variants.length)>1?25:26),a(3),w(O(29,23,e.Amount)),a(7),w(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),a(),x(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?36:-1),a(2),M(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),a(),x(!(e.LogisticService!=null&&e.LogisticService.Name)||!e.ReferenceNumber?39:-1),a(2),x((e==null?null:e.MarketType)!=i.channelType.WooCommerce?41:-1)}}function Le(l,m){if(l&1){let e=T();t(0,"div",17)(1,"table",21)(2,"thead",22)(3,"tr",23),h(4,"th",24),t(5,"th",25),d(6,"Outlet"),n(),t(7,"th",25),d(8,"Number"),n(),t(9,"th"),d(10,"Items"),n(),t(11,"th",26),d(12,"Amount"),n(),t(13,"th",27),d(14,"Shipping"),n(),h(15,"th",28),n()(),t(16,"tbody"),A(17,Ne,42,27,"tr",null,B),n()(),t(19,"app-custom-paginator",29),g("next",function(){p(e);let r=u();return c(r.initReadyToShip())})("previous",function(){p(e);let r=u();return c(r.initReadyToShip())}),n()()}if(l&2){let e=u(),i=F(0);a(17),z(i),a(2),f("filter",e.filter())("totaldata",i==null?null:i.length)}}function Ie(l,m){l&1&&(t(0,"div",18),h(1,"app-empty-state"),n())}var st=(()=>{let m=class m{constructor(){this.toastr=E(oe),this.orderService=E(N),this.fulfillmentService=E(ve),this.channelType=ne,this.selectedOrders=P([]),this.selectedChannelType=Z(()=>{let i=null;return this.selectedOrders().length>0&&(i=this.selectedOrders()[0].MarketType),i}),this.filter=P({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"}]}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:i=>{this.initFromDate(i)},error:i=>{console.error("Error fetching default date:",i),this.initFromDate(null)}})}initFromDate(i){this.filter.update(r=>L(R({},r),{From:i})),this.initReadyToShip()}initReadyToShip(){this.readyToShip$=this.orderService.getReadyToShipOrders(this.filter()).pipe(k(()=>{this.selectedOrders.set([])}),I(1))}onFilterChange(i){this.filter.update(r=>R(R({},r),i))}onSetFulfillment(i){this.fulfillmentService.setFulfillmentOrder(i).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}refreshShippingAndRefNumber(i){this.orderService.refreshShippingCourier(i.ShopID,i.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),this.initReadyToShip()})}setMultipleFulfillment(){this.fulfillmentService.setFulfillmentMultipleOrders(this.selectedOrders()).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}onSelectOrder(i){let r=i.filter(o=>o.selected);this.selectedOrders.set(r)}onMouseHover(i,r){(!r.LogisticService?.Name||!r.ReferenceNumber)&&this.contextMenuEl.show(i,r)}onSelectContextItem(i){i.item?.id==="refresh"&&this.refreshShippingAndRefNumber(i.data)}};m.\u0275fac=function(r){return new(r||m)},m.\u0275cmp=D({type:m,selectors:[["app-ready-to-ship"]],viewQuery:function(r,o){if(r&1&&H(Te,5),r&2){let _;Q(_=j())&&(o.contextMenuEl=_.first)}},features:[J([N])],decls:37,vars:14,consts:[["contextMenu",""],["headerTitle","To Ship","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],[1,"btn","btn-outline-secondary","shadow","rounded"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],[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"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"actions-cell"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem"],["matTooltip","Retrieve shipping courier and reference number",1,"btn","btn-icon-only",3,"click"],[1,"fa-solid","fa-arrows-rotate","fs-6"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(r,o){if(r&1){let _=T();U(0),V(1,"async"),t(2,"mainpanel",1),g("onSubmit",function(){return p(_),c(o.initReadyToShip())}),y("textChange",function(s){return p(_),S(o.filter().Number,s)||(o.filter().Number=s),c(s)}),t(3,"actions"),v(4,Ve,2,0,"button",2),t(5,"a",3),h(6,"i",4),t(7,"span"),d(8,"Order Fulfillment Display"),n()()(),t(9,"filters")(10,"div")(11,"label",5),d(12,"Channel"),n(),t(13,"app-channel-options-v2",6),y("ngModelChange",function(s){return p(_),S(o.filter().ListChannelID,s)||(o.filter().ListChannelID=s),c(s)}),n()(),t(14,"div",7)(15,"label",5),d(16,"From/To"),n(),t(17,"div",8)(18,"datepicker",9),y("dateChange",function(s){return p(_),S(o.filter().From,s)||(o.filter().From=s),c(s)}),n()(),t(19,"div")(20,"datepicker",10),y("dateChange",function(s){return p(_),S(o.filter().To,s)||(o.filter().To=s),c(s)}),n()()(),t(21,"div",7)(22,"label",11),d(23,"Page Number"),n(),t(24,"input",12),y("ngModelChange",function(s){return p(_),S(o.filter().PageNumber,s)||(o.filter().PageNumber=s),c(s)}),n()(),t(25,"div",7)(26,"label",11),d(27,"Page Size"),n(),t(28,"input",13),y("ngModelChange",function(s){return p(_),S(o.filter().PageSize,s)||(o.filter().PageSize=s),c(s)}),n()()(),t(29,"content")(30,"div",14)(31,"div",15)(32,"div",16),v(33,Le,20,2,"div",17)(34,Ie,2,0,"div",18),n()()()()(),t(35,"app-context-menu",19,0),g("onSelectItem",function(s){return p(_),c(o.onSelectContextItem(s))}),n()}if(r&2){let _=G(O(1,10,o.readyToShip$)||K(13,we));a(2),C("text",o.filter().Number),a(2),x(o.selectedOrders().length>0?4:-1),a(9),f("multiple",!0),C("ngModel",o.filter().ListChannelID),a(5),C("date",o.filter().From),a(2),C("date",o.filter().To),a(4),C("ngModel",o.filter().PageNumber),a(4),C("ngModel",o.filter().PageSize),a(5),x(_.length>0?33:34),a(2),f("items",o.contextMenuItems)}},dependencies:[ie,ue,_e,he,me,le,de,re,ae,se,Ce,Se,ye,be,ce,pe,xe,fe,$,te,ee,ge],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], div[_ngcontent-%COMP%]:hover.actions-cell .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"]});let l=m;return l})();export{st as ReadyToShipComponent};
|
|
1
|
+
import{a as ve,b as xe}from"./chunk-RIIIECQH.js";import{a as ge}from"./chunk-JWDQVXQP.js";import{a as Ce,b as Se}from"./chunk-K5WSFDNA.js";import{a as be}from"./chunk-FSLUPR5I.js";import{a as N}from"./chunk-L6CRWJ2O.js";import{a as ye}from"./chunk-PV4OJSZI.js";import"./chunk-FSOZOROI.js";import"./chunk-VYI7JYH5.js";import"./chunk-BZWZ64N5.js";import{a as fe}from"./chunk-RQI26KZX.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as he}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as _e}from"./chunk-27DIE2YS.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as ue}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as ce}from"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as pe}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-YH3KWMUX.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as ne}from"./chunk-UPRDDI4K.js";import{A as me,b as re,c as le,h as ae,m as se,o as de}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as oe}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as te,B as ie,w as $,y as ee}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as K,Cc as H,Dc as Q,Ec as j,Hb as D,Ia as P,Mc as q,Nc as d,Oc as w,Pc as M,Rc as C,Sc as S,Tc as y,Uc as U,Vc as G,Wc as F,Z as I,_c as J,ac as v,ad as X,cc as x,dc as B,ea as k,fc as A,gc as z,hc as f,ic as t,id as V,jc as n,jd as O,kc as h,kd as Y,mb as W,ob as a,pd as Z,ra as E,rc as T,wc as g,ya as p,yc as u,za as c}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as R,b as L}from"./chunk-66YHNWRR.js";var Te=["contextMenu"],we=()=>[],Me=l=>({"td-cell-hover":l});function Ve(l,m){if(l&1){let e=T();t(0,"button",20),g("click",function(){p(e);let r=u();return c(r.setMultipleFulfillment())}),d(1," Set Fulfillment "),n()}}function Re(l,m){if(l&1&&h(0,"variants-dropdown",38),l&2){let e=u().$implicit;f("variants",e==null?null:e.Variants)}}function Ee(l,m){if(l&1&&h(0,"variant-with-image",39),l&2){let e=u().$implicit;f("variant",e==null?null:e.Variants[0])}}function Oe(l,m){if(l&1&&(t(0,"span"),d(1),n()),l&2){let e=u().$implicit;a(),M("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Pe(l,m){if(l&1){let e=T();t(0,"div",41)(1,"button",45),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.refreshShippingAndRefNumber(r))}),h(2,"i",46),n()()}}function Fe(l,m){if(l&1){let e=T();t(0,"button",47),g("click",function(){p(e);let r=u().$implicit,o=u(2);return c(o.onSetFulfillment(r))}),d(1," Set Fulfillment "),n()}}function Ne(l,m){if(l&1){let e=T();t(0,"tr")(1,"td")(2,"input",30),y("ngModelChange",function(r){let o=p(e).$implicit;return S(o.selected,r)||(o.selected=r),c(r)}),g("ngModelChange",function(){p(e);let r=u(2),o=F(0);return c(r.onSelectOrder(o))}),n()(),t(3,"td")(4,"div",31),h(5,"img",32),V(6,"channelImage"),t(7,"div",33)(8,"div"),d(9),n(),t(10,"small",34)(11,"span"),d(12),n()()()()(),t(13,"td")(14,"div",35)(15,"div"),h(16,"order-link",36),n(),t(17,"small"),d(18),V(19,"date"),n(),h(20,"br"),t(21,"small"),h(22,"i",37),d(23),n()()(),t(24,"td"),v(25,Re,1,1,"variants-dropdown",38)(26,Ee,1,1,"variant-with-image",39),n(),t(27,"td",40),d(28),V(29,"number"),n(),t(30,"td",41)(31,"div",42)(32,"div",35)(33,"div",43)(34,"span"),d(35),n(),v(36,Oe,2,1,"span"),n(),t(37,"small"),d(38),n()(),v(39,Pe,3,0,"div",41),n()(),t(40,"td",41),v(41,Fe,2,0,"button",44),n()()}if(l&2){let e=m.$implicit,i=u(2);a(2),C("ngModel",e.selected),f("disabled",i.selectedChannelType()!=null&&i.selectedChannelType()!=e.MarketType),a(3),f("src",O(6,18,e==null?null:e.MarketType),W)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),a(4),w(e.Outlet),a(3),w(e.ChannelName),a(4),f("order",e),a(2),M(" ",Y(19,20,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),a(5),M(" ",e.Customer," "),a(),q(X(25,Me,(e.Variants==null?null:e.Variants.length)>1)),a(),x((e.Variants==null?null:e.Variants.length)>1?25:26),a(3),w(O(29,23,e.Amount)),a(7),w(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),a(),x(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?36:-1),a(2),M(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),a(),x(!(e.LogisticService!=null&&e.LogisticService.Name)||!e.ReferenceNumber?39:-1),a(2),x((e==null?null:e.MarketType)!=i.channelType.WooCommerce?41:-1)}}function Le(l,m){if(l&1){let e=T();t(0,"div",17)(1,"table",21)(2,"thead",22)(3,"tr",23),h(4,"th",24),t(5,"th",25),d(6,"Outlet"),n(),t(7,"th",25),d(8,"Number"),n(),t(9,"th"),d(10,"Items"),n(),t(11,"th",26),d(12,"Amount"),n(),t(13,"th",27),d(14,"Shipping"),n(),h(15,"th",28),n()(),t(16,"tbody"),A(17,Ne,42,27,"tr",null,B),n()(),t(19,"app-custom-paginator",29),g("next",function(){p(e);let r=u();return c(r.initReadyToShip())})("previous",function(){p(e);let r=u();return c(r.initReadyToShip())}),n()()}if(l&2){let e=u(),i=F(0);a(17),z(i),a(2),f("filter",e.filter())("totaldata",i==null?null:i.length)}}function Ie(l,m){l&1&&(t(0,"div",18),h(1,"app-empty-state"),n())}var st=(()=>{let m=class m{constructor(){this.toastr=E(oe),this.orderService=E(N),this.fulfillmentService=E(ve),this.channelType=ne,this.selectedOrders=P([]),this.selectedChannelType=Z(()=>{let i=null;return this.selectedOrders().length>0&&(i=this.selectedOrders()[0].MarketType),i}),this.filter=P({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null}),this.contextMenuItems=[{id:"refresh",label:"Refresh Shipping",icon:"fa-solid fa-arrows-rotate"}]}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:i=>{this.initFromDate(i)},error:i=>{console.error("Error fetching default date:",i),this.initFromDate(null)}})}initFromDate(i){this.filter.update(r=>L(R({},r),{From:i})),this.initReadyToShip()}initReadyToShip(){this.readyToShip$=this.orderService.getReadyToShipOrders(this.filter()).pipe(k(()=>{this.selectedOrders.set([])}),I(1))}onFilterChange(i){this.filter.update(r=>R(R({},r),i))}onSetFulfillment(i){this.fulfillmentService.setFulfillmentOrder(i).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}refreshShippingAndRefNumber(i){this.orderService.refreshShippingCourier(i.ShopID,i.Number).subscribe(()=>{this.toastr.success("Shipping courier and reference number refreshed","Success"),this.initReadyToShip()})}setMultipleFulfillment(){this.fulfillmentService.setFulfillmentMultipleOrders(this.selectedOrders()).subscribe(()=>{this.toastr.success("Fulfillment set successfully","Success"),this.initReadyToShip()})}onSelectOrder(i){let r=i.filter(o=>o.selected);this.selectedOrders.set(r)}onMouseHover(i,r){(!r.LogisticService?.Name||!r.ReferenceNumber)&&this.contextMenuEl.show(i,r)}onSelectContextItem(i){i.item?.id==="refresh"&&this.refreshShippingAndRefNumber(i.data)}};m.\u0275fac=function(r){return new(r||m)},m.\u0275cmp=D({type:m,selectors:[["app-ready-to-ship"]],viewQuery:function(r,o){if(r&1&&H(Te,5),r&2){let _;Q(_=j())&&(o.contextMenuEl=_.first)}},features:[J([N])],decls:37,vars:14,consts:[["contextMenu",""],["headerTitle","To Ship","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],[1,"btn","btn-outline-secondary","shadow","rounded"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[3,"onSelectItem","items"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],[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"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"actions-cell"],[1,"d-flex","align-items-center","gap-6"],[1,"d-flex","align-items-end","gap-2"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem"],["matTooltip","Retrieve shipping courier and reference number",1,"btn","btn-icon-only",3,"click"],[1,"fa-solid","fa-arrows-rotate","fs-6"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(r,o){if(r&1){let _=T();U(0),V(1,"async"),t(2,"mainpanel",1),g("onSubmit",function(){return p(_),c(o.initReadyToShip())}),y("textChange",function(s){return p(_),S(o.filter().Number,s)||(o.filter().Number=s),c(s)}),t(3,"actions"),v(4,Ve,2,0,"button",2),t(5,"a",3),h(6,"i",4),t(7,"span"),d(8,"Order Fulfillment Display"),n()()(),t(9,"filters")(10,"div")(11,"label",5),d(12,"Channel"),n(),t(13,"app-channel-options-v2",6),y("ngModelChange",function(s){return p(_),S(o.filter().ListChannelID,s)||(o.filter().ListChannelID=s),c(s)}),n()(),t(14,"div",7)(15,"label",5),d(16,"From/To"),n(),t(17,"div",8)(18,"datepicker",9),y("dateChange",function(s){return p(_),S(o.filter().From,s)||(o.filter().From=s),c(s)}),n()(),t(19,"div")(20,"datepicker",10),y("dateChange",function(s){return p(_),S(o.filter().To,s)||(o.filter().To=s),c(s)}),n()()(),t(21,"div",7)(22,"label",11),d(23,"Page Number"),n(),t(24,"input",12),y("ngModelChange",function(s){return p(_),S(o.filter().PageNumber,s)||(o.filter().PageNumber=s),c(s)}),n()(),t(25,"div",7)(26,"label",11),d(27,"Page Size"),n(),t(28,"input",13),y("ngModelChange",function(s){return p(_),S(o.filter().PageSize,s)||(o.filter().PageSize=s),c(s)}),n()()(),t(29,"content")(30,"div",14)(31,"div",15)(32,"div",16),v(33,Le,20,2,"div",17)(34,Ie,2,0,"div",18),n()()()()(),t(35,"app-context-menu",19,0),g("onSelectItem",function(s){return p(_),c(o.onSelectContextItem(s))}),n()}if(r&2){let _=G(O(1,10,o.readyToShip$)||K(13,we));a(2),C("text",o.filter().Number),a(2),x(o.selectedOrders().length>0?4:-1),a(9),f("multiple",!0),C("ngModel",o.filter().ListChannelID),a(5),C("date",o.filter().From),a(2),C("date",o.filter().To),a(4),C("ngModel",o.filter().PageNumber),a(4),C("ngModel",o.filter().PageSize),a(5),x(_.length>0?33:34),a(2),f("items",o.contextMenuItems)}},dependencies:[ie,ue,_e,he,me,le,de,re,ae,se,Ce,Se,ye,be,ce,pe,xe,fe,$,te,ee,ge],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], div[_ngcontent-%COMP%]:hover.actions-cell .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"]});let l=m;return l})();export{st as ReadyToShipComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as re,b as pe}from"./chunk-TVEI5B2O.js";import"./chunk-VG66LDXQ.js";import"./chunk-LR2YCE6M.js";import{a as ne,b as ie,d as ae,e as oe}from"./chunk-BZWZ64N5.js";import{a as le}from"./chunk-27DIE2YS.js";import{b as te}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-JRCXHF2X.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{h as X}from"./chunk-
|
|
1
|
+
import{a as re,b as pe}from"./chunk-TVEI5B2O.js";import"./chunk-VG66LDXQ.js";import"./chunk-LR2YCE6M.js";import{a as ne,b as ie,d as ae,e as oe}from"./chunk-BZWZ64N5.js";import{a as le}from"./chunk-27DIE2YS.js";import{b as te}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-JRCXHF2X.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{h as X}from"./chunk-YH3KWMUX.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{c as K}from"./chunk-UPRDDI4K.js";import{A as ee,h as Y,m as Z}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{e as Q}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as G,w as k,y as H,z as U}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as B,Nb as P,Nc as s,Oc as f,Pc as y,Rc as z,Sc as A,Tc as V,Z as D,_c as J,aa as M,ac as R,bc as T,cc as $,dc as F,fc as j,g as L,gc as O,hc as h,ic as a,id as c,jc as o,jd as d,kc as u,kd as W,ma as w,mb as S,ob as p,ra as g,rc as q,v as I,wc as v,ya as E,yc as x,za as N}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as _}from"./chunk-66YHNWRR.js";var b=(()=>{let t=class t{constructor(){this.httpService=g(Q),this._pageination=new L({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(M(n=>this.getLogs$(n).pipe()))}getLogs$(n){return this.httpService.post("/api/Channel/GetChannelLogPaged",n)}onPaginationChange(n){let e=this._pageination.value;e.PageNumber=n.pageIndex+1,this._pageination.next(e)}onFilter(n){let e=this._pageination.value;e.PageNumber=1,e=_(_({},e),n),this._pageination.next(e)}};t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=w({token:t,factory:t.\u0275fac});let i=t;return i})();function se(i,t){if(i&1&&(a(0,"span",10),u(1,"img",11),o(),s(2)),i&2){let l=t.item;p(),h("src",l.Img,S)("alt",l.Name),p(),y(" ",l.Name," ")}}function ce(i,t){if(i&1&&(a(0,"tr")(1,"td"),u(2,"img",17),a(3,"span"),s(4),o()(),a(5,"td")(6,"span",18),s(7),c(8,"json"),o()(),a(9,"td"),s(10),c(11,"json"),o(),a(12,"td"),s(13),c(14,"date"),o()()),i&2){let l=t.$implicit;p(2),h("src",l.Img,S),p(2),y(" ",l.ChannelName," "),p(3),f(d(8,5,l.Request)),p(3),f(d(11,7,l.Response)),p(3),f(W(14,9,l.Created,"dd-MM-yyyy hh:mm:ss"))}}function de(i,t){if(i&1){let l=q();a(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),s(5,"Channel"),o(),a(6,"th"),s(7,"Request"),o(),a(8,"th"),s(9,"Response"),o(),a(10,"th",15),s(11,"Created"),o()()(),a(12,"tbody"),j(13,ce,15,12,"tr",null,F),c(15,"async"),o()(),a(16,"mat-paginator",16),c(17,"async"),c(18,"async"),c(19,"async"),c(20,"async"),v("page",function(e){E(l);let r=x();return N(r.channelLogService.onPaginationChange(e))}),o()()}if(i&2){let l,n,e,r,m=x();p(13),O((l=d(15,3,m.channelLogs$))==null?null:l.Data),p(3),h("length",(n=d(17,5,m.channelLogs$))==null?null:n.Count)("pageSize",(e=d(18,7,m.filter$))==null?null:e.RowCount)("pageIndex",(r=d(19,9,m.filter$))!=null&&r.PageNumber?0:((r=d(20,11,m.filter$))==null?null:r.PageNumber)-1)}}function he(i,t){i&1&&(a(0,"div",9),u(1,"app-empty-state"),o())}var je=(()=>{let t=class t{constructor(){this.channelLogService=g(b),this.authService=g(X),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(I(n=>(n.Data?n.Data=n.Data.map(e=>(e.Response=e.Response?JSON.parse(e.Response):"",e.Request=e.Request?JSON.parse(e.Request):"",e.Img=K.getChannelLogoByTypeId(e.TypeID),e)):n.Data=[],n)),D(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=B({type:t,selectors:[["app-channel-log"]],features:[J([b])],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"],[1,""]],template:function(e,r){if(e&1&&(a(0,"mainpanel",0),v("onSubmit",function(){return r.onSubmitFilter()}),a(1,"filters")(2,"div",1)(3,"div")(4,"label",2),s(5,"Channel"),o(),a(6,"ng-select",3),V("ngModelChange",function(C){return A(r.channelID,C)||(r.channelID=C),C}),P(7,se,3,3,"ng-template",4),o()()()(),a(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),R(12,de,21,13,"div",8),c(13,"async"),T(14,he,2,0,"div",9),o()()()()()),e&2){let m;h("hideSearchBox",!0),p(6),h("clearable",!0)("items",r.channelOptions),z("ngModel",r.channelID),p(6),$(((m=d(13,5,r.channelLogs$))==null||m.Data==null?null:m.Data.length)>0?12:14)}},dependencies:[G,te,le,pe,re,oe,ae,ne,ie,ee,Y,Z,k,U,H],encapsulation:2});let i=t;return i})();export{je as ChannelLogComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as de}from"./chunk-L6CRWJ2O.js";import{a as Xe,b as et,c as tt}from"./chunk-PUSOOHGT.js";import"./chunk-ET33HPF3.js";import"./chunk-VYI7JYH5.js";import"./chunk-OH5T7D7O.js";import{a as He,b as Ke,c as Qe,e as Ze,f as qe,g as Je}from"./chunk-3WGAMHZW.js";import{a as We,b as Be,c as Le}from"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import{c as Fe,d as Oe,e as Re}from"./chunk-BZWZ64N5.js";import{a as $e}from"./chunk-LCN52IJT.js";import"./chunk-3T5VLB63.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-BKCKASH3.js";import"./chunk-A6QXXKPR.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as Ne}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as re}from"./chunk-UEXWQT5J.js";import"./chunk-JHSG3KRS.js";import{f as ze,g as Ue,h as Ge,i as je,j as Ye}from"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-TBVMCNS2.js";import{e as Ae}from"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import{ka as Pe}from"./chunk-JTKEMQZT.js";import{c as Ie}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{h as ie}from"./chunk-62YNPW6Q.js";import{a as Me}from"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as te}from"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as ee,c as x}from"./chunk-UPRDDI4K.js";import{A as ae,b as Ee,c as ke,h as ne,m as oe,x as Ve}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as xe,e as Te}from"./chunk-D6JH2KV4.js";import{g as be}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as V,q as O,w as X,y as $}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as ve,Cc as fe,Dc as ge,Ec as _e,Hb as k,Ia as g,Ic as N,Nb as Y,Nc as s,Oc as F,Pc as D,Rc as b,Sc as M,Tc as P,Xc as Ce,Z as G,Zc as we,_c as Z,aa as ce,ac as w,ad as q,bd as Se,cc as v,ea as j,ec as R,fc as W,gc as B,hc as h,ic as o,id as L,jc as a,jd as H,kc as S,kd as ye,m as me,ma as ue,mb as he,ob as l,qd as J,ra as y,rc as T,tb as A,td as De,ud as I,v as Q,wc as C,ya as c,yc as _,za as u}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as se,b as pe}from"./chunk-66YHNWRR.js";var rt=e=>({"over-due":e});function lt(e,r){if(e&1&&(o(0,"tr",6)(1,"td"),s(2),a(),o(3,"td"),s(4),a(),o(5,"td"),s(6),a(),o(7,"td"),s(8),a()()),e&2){let d=r.$implicit,t=r.$index;h("ngClass",q(5,rt,d.Exception)),l(2),F(t+1),l(2),F(d.Number),l(2),F(d.Status),l(2),F(d.Exception)}}function dt(e,r){if(e&1&&W(0,lt,9,7,"tr",6,R),e&2){let d,t=_();B((d=t.downloadResult())==null?null:d.Body)}}function st(e,r){e&1&&(o(0,"tr",5)(1,"td",7)(2,"div",8),S(3,"i",9),a(),o(4,"h4",10),s(5," There is no order to processed "),a()()())}var it=(()=>{let r=class r{constructor(){this.downloadResult=I()}ngOnInit(){}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:15,vars:1,consts:[[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[1,"text-center"],[3,"ngClass"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(o(0,"div",0)(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr"),S(5,"th",4),o(6,"th"),s(7,"Order Number"),a(),o(8,"th"),s(9,"Status"),a(),o(10,"th"),s(11,"Exception"),a()()(),o(12,"tbody"),w(13,dt,2,0)(14,st,6,0,"tr",5),a()()()()),n&2){let p;l(13),v(((p=i.downloadResult())==null||p.Body==null?null:p.Body.length)>0?13:14)}},dependencies:[V,O],encapsulation:2});let e=r;return e})();var mt=e=>({"full-width":e}),ct=()=>({standalone:!0}),nt=(()=>{let r=class r{constructor(){this.datePipe=y($),this.fullWidth=I(!1),this.timeChange=new A}ngOnInit(){}onTimeChange(t){let n=null;t&&(n=this.datePipe.transform(t,"HH:mm")),this.timeChange.emit(n),this.onTimePickerChange()}onShowCalendar(){let t=document.getElementById("dropdown-filter");if(t){var n=new bootstrap.Dropdown(t);n&&(n._config.autoClose="inside")}}onTimePickerChange(){let t=document.getElementById("dropdown-filter");if(t){var n=new bootstrap.Dropdown(t);n&&(n._config.autoClose="outside")}}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["app-timepicker"]],inputs:{time:"time",fullWidth:[1,"fullWidth"]},outputs:{timeChange:"timeChange"},decls:4,vars:8,consts:[["myCalendar",""],["styleClass","custom-height","id","shippingTime","appendTo","body",3,"ngModelChange","onSelect","ngClass","baseZIndex","ngModel","timeOnly","ngModelOptions"],["size","small","label","Close",3,"click"]],template:function(n,i){if(n&1){let p=T();o(0,"p-datepicker",1,0),P("ngModelChange",function(m){return c(p),M(i.time,m)||(i.time=m),u(m)}),C("ngModelChange",function(m){return c(p),u(i.onTimeChange(m))})("onSelect",function(){return c(p),u(i.onShowCalendar())}),o(2,"p-footer")(3,"p-button",2),C("click",function(){return c(p),N(1).hideOverlay(),u(i.onShowCalendar())}),a()()()}n&2&&(h("ngClass",q(5,mt,i.fullWidth()))("baseZIndex",1100),b("ngModel",i.time),h("timeOnly",!0)("ngModelOptions",ve(7,ct)))},dependencies:[V,O,ae,ne,oe,tt,et,Xe,Pe],styles:["p-datepicker span.p-datepicker.custom-height{height:44px;width:70px} p-datepicker.full-width span.p-datepicker.custom-height{height:44px;width:100%!important}"]});let e=r;return e})();var z=(()=>{let r=class r{constructor(){this.httpService=y(Te),this.toastr=y(xe),this.datePipe=y($)}gerChannelDetailById(t){return this.httpService.post(te.GetChannelDetail,{ID:t})}getOrderPreview(t){return this.httpService.post(te.GetOrderPreviewV2,t)}getDownloadOrder(t){return this.httpService.post(te.GetDownloadOrderV2,t)}onPreviewOrder(t){return this.validateDatePreview(t)?this.getOrderPreview(t).pipe(j(n=>{n.Data?.length===0&&this.toastrEmptyPreview(t)})):me}toastrEmptyPreview(t){let n=this.datePipe.transform(t.From,"dd MMM yyyy"),i=this.datePipe.transform(t.To,"dd MMM yyyy"),p=t.TimeFrom?t.TimeFrom:"",f=t.TimeTo?t.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${p} to ${i} ${f}!`,"No Orders!")}validateDatePreview(t){let n=!0;return t.downloadType==!0?x.getDaysDiff(t?.From,t?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):x.getDaysDiff(t?.From,t?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(t,n){let i=x.formatTitleFromDate(new Date(t),new Date(n)),p=this.datePipe.transform(t,i),f=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":p+"-"} ${f}`}};r.\u0275fac=function(n){return new(n||r)},r.\u0275prov=ue({token:r,factory:r.\u0275fac});let e=r;return e})();function ut(e,r){if(e&1&&(o(0,"ng-option",7),S(1,"img",17),s(2),a()),e&2){let d=r.$implicit;h("value",d.ID),l(),h("src",d==null?null:d.Img,he),l(),D("",d.Name," ")}}function ht(e,r){if(e&1){let d=T();o(0,"div",8)(1,"div",4)(2,"h5"),s(3,"Type"),a(),o(4,"p",5),s(5,"Select Type want to download"),a()(),o(6,"div",4)(7,"div",18)(8,"div")(9,"mat-radio-group",19),P("ngModelChange",function(n){c(d);let i=_();return M(i.downloadType,n)||(i.downloadType=n),u(n)}),C("ngModelChange",function(){c(d);let n=_();return u(n.onDownloadTypeChange())}),o(10,"mat-radio-button",20),s(11," Orders "),a(),o(12,"mat-radio-button",21),s(13," Disbursement "),a()()()(),o(14,"div",22)(15,"div",23),S(16,"i",24),a(),o(17,"p",25),s(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(e&2){let d=_();l(9),b("ngModel",d.downloadType),l(),h("value",!1),l(2),h("value",!0)}}function ft(e,r){e&1&&(o(0,"p",5),s(1," Select Disbursement date "),o(2,"span",26),s(3,"(payment date / order complete date)"),a(),s(4," of the channel you want to download (Max 1 Week). "),a())}function gt(e,r){e&1&&(o(0,"p",5),s(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function _t(e,r){if(e&1){let d=T();o(0,"div",16)(1,"app-timepicker",27),P("timeChange",function(n){c(d);let i=_();return M(i.startTime,n)||(i.startTime=n),u(n)}),C("timeChange",function(){c(d);let n=_();return u(n.onStartTimeChange())}),a(),o(2,"span",28),s(3,"-"),a(),o(4,"app-timepicker",27),P("timeChange",function(n){c(d);let i=_();return M(i.endTime,n)||(i.endTime=n),u(n)}),C("timeChange",function(){c(d);let n=_();return u(n.onEndTimeChange())}),a()()}if(e&2){let d=_();l(),b("time",d.startTime),l(3),b("time",d.endTime)}}var ot=(()=>{let r=class r{constructor(){this.reset=I(!1),this.authService=y(ie),this.tokenService=y(Me),this.downloadService=y(z),this.downloadType=g(!1),this.selectedChannelId=g(null),this.channelOptions=g(this.authService.getChannels()),this.channelType=ee,this.selectedChannel=g(null),this.showTimePicker=g(!1),this.startDate=g(null),this.endDate=g(null),this.startTime=g("00:00"),this.endTime=g("23:59"),this.minDate=g(new Date),this.maxDate=g(new Date),this.filterData=new A,this._onRememberMeChange=De({alias:"onRememberMeChange"}),this.rememberMe=g(!1),J(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0}),this.initDateValidation()}initDateValidation(){let t=this.tokenService?.getTokenValue(),n=t?.DownloadRange?JSON.parse(t?.DownloadRange):0;if(n<=0)this.minDate.set(null),this.maxDate.set(null);else{let i=new Date,p=x.addDays(i,n-1);this.minDate.set(p)}}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(t=>t.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(Q(t=>t?.Model),G(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let t=1;this.startDate()&&this.endDate()&&(t=x.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>t==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}onChangeRememberMe(t){this._onRememberMeChange.emit(t)}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange",_onRememberMeChange:"onRememberMeChange"},features:[Z([z,Ae()])],decls:32,vars:13,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"row","mt-6"],[1,"col-12","d-flex","align-items-center"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker","min","max"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel","maxlength"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"col-6","d-flex","align-items-center","gap-2","mt-10"],["type","checkbox",2,"width","16px","height","16px",3,"ngModelChange","ngModel"],[1,"ms-2"],[1,"mt-8","d-flex","align-items-center"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let p=T();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),s(5,"Select a Channel"),a(),o(6,"p",5),s(7,"Select Channel want to download order"),a()(),o(8,"div",4)(9,"ng-select",6),P("ngModelChange",function(m){return c(p),M(i.selectedChannelId,m)||(i.selectedChannelId=m),u(m)}),C("ngModelChange",function(){return c(p),u(i.onSelectChannel())}),W(10,ut,3,3,"ng-option",7,R),a()()(),w(12,ht,19,3,"div",8),L(13,"async"),o(14,"div",8)(15,"div",4)(16,"h5"),s(17,"Date Range"),a(),w(18,ft,5,0,"p",5)(19,gt,2,0,"p",5),a(),o(20,"div",4)(21,"div",9)(22,"mat-date-range-input",10)(23,"input",11),P("ngModelChange",function(m){return c(p),M(i.startDate,m)||(i.startDate=m),u(m)}),C("click",function(){c(p);let m=N(26);return u(m.open())}),a(),o(24,"input",12),P("ngModelChange",function(m){return c(p),M(i.endDate,m)||(i.endDate=m),u(m)}),C("click",function(){c(p);let m=N(26);return u(m.open())})("ngModelChange",function(){return c(p),u(i.onFilterDateChange())}),a()(),S(25,"mat-date-range-picker",null,0),a(),o(27,"div",13)(28,"input",14),P("ngModelChange",function(m){return c(p),M(i.rememberMe,m)||(i.rememberMe=m),u(m)}),C("ngModelChange",function(m){return c(p),u(i.onChangeRememberMe(m))}),a(),o(29,"h5",15),s(30,"Save Date"),a()(),w(31,_t,5,2,"div",16),a()()()()}if(n&2){let p,f,m=N(26);l(9),h("clearable",!1),b("ngModel",i.selectedChannelId),l(),B(i.channelOptions()),l(2),v((p=H(13,11,i.channelDetail$))!=null&&p.ServiceFeeWriteOff&&((p=i.selectedChannel())==null?null:p.TypeID)==i.channelType.Tokopedia?12:-1),l(6),v(i.downloadType()&&((f=i.selectedChannel())==null?null:f.TypeID)==i.channelType.Tokopedia?18:19),l(4),h("rangePicker",m)("min",i.minDate())("max",i.maxDate()),l(),b("ngModel",i.startDate),l(),b("ngModel",i.endDate),l(4),b("ngModel",i.rememberMe),l(3),v(i.showTimePicker()?31:-1)}},dependencies:[V,Re,Oe,Fe,Le,We,Be,ae,ke,Ee,ne,Ve,oe,nt,je,ze,Ye,Ue,Ge,X],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]});let e=r;return e})();var E=(function(e){return e.ALL="all",e.SYNC="sync",e.WRONG="wrong",e.UNSYNC="unsync",e})(E||{});var U=(function(e){return e[e.DoNothing=0]="DoNothing",e[e.New=1]="New",e[e.Update=2]="Update",e})(U||{});var Ct=(e,r)=>({"over-due-today":e,"over-due":r});function wt(e,r){if(e&1&&(o(0,"th",17),s(1),a()),e&2){let d=_();l(),D(" ",d.selectedChannel()?"Created Date":"Last Status Update"," ")}}function vt(e,r){if(e&1&&(o(0,"td"),s(1),L(2,"date"),a()),e&2){let d=_().$implicit;l(),D(" ",ye(2,1,d.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function St(e,r){if(e&1&&(o(0,"span"),s(1),a()),e&2){let d=_().$implicit;l(),D(" ",d.ActionString," ")}}function yt(e,r){if(e&1&&(o(0,"li"),s(1),a()),e&2){let d=r.$implicit;l(),D(" ",d," ")}}function Dt(e,r){if(e&1&&(o(0,"ul",21),W(1,yt,2,1,"li",null,R),a()),e&2){let d=_().$implicit;l(),B(d.ActionString)}}function xt(e,r){if(e&1&&(o(0,"span",22),S(1,"i",23),a()),e&2){let d=_().$implicit;h("title",we("Delivery : ",d.DeliveryState,`
|
|
1
|
+
import{a as de}from"./chunk-L6CRWJ2O.js";import{a as Xe,b as et,c as tt}from"./chunk-PUSOOHGT.js";import"./chunk-ET33HPF3.js";import"./chunk-VYI7JYH5.js";import"./chunk-OH5T7D7O.js";import{a as He,b as Ke,c as Qe,e as Ze,f as qe,g as Je}from"./chunk-3WGAMHZW.js";import{a as We,b as Be,c as Le}from"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import{c as Fe,d as Oe,e as Re}from"./chunk-BZWZ64N5.js";import{a as $e}from"./chunk-V7V5O62J.js";import"./chunk-3T5VLB63.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-PRMV4INM.js";import"./chunk-A6QXXKPR.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as Ne}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as re}from"./chunk-UEXWQT5J.js";import"./chunk-JHSG3KRS.js";import{f as ze,g as Ue,h as Ge,i as je,j as Ye}from"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-TBVMCNS2.js";import{e as Ae}from"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import{ka as Pe}from"./chunk-JTKEMQZT.js";import{c as Ie}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{h as ie}from"./chunk-YH3KWMUX.js";import{a as Me}from"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as te}from"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import{b as ee,c as x}from"./chunk-UPRDDI4K.js";import{A as ae,b as Ee,c as ke,h as ne,m as oe,x as Ve}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as xe,e as Te}from"./chunk-D6JH2KV4.js";import{g as be}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as V,q as O,w as X,y as $}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as ve,Cc as fe,Dc as ge,Ec as _e,Hb as k,Ia as g,Ic as N,Nb as Y,Nc as s,Oc as F,Pc as D,Rc as b,Sc as M,Tc as P,Xc as Ce,Z as G,Zc as we,_c as Z,aa as ce,ac as w,ad as q,bd as Se,cc as v,ea as j,ec as R,fc as W,gc as B,hc as h,ic as o,id as L,jc as a,jd as H,kc as S,kd as ye,m as me,ma as ue,mb as he,ob as l,qd as J,ra as y,rc as T,tb as A,td as De,ud as I,v as Q,wc as C,ya as c,yc as _,za as u}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as se,b as pe}from"./chunk-66YHNWRR.js";var rt=e=>({"over-due":e});function lt(e,r){if(e&1&&(o(0,"tr",6)(1,"td"),s(2),a(),o(3,"td"),s(4),a(),o(5,"td"),s(6),a(),o(7,"td"),s(8),a()()),e&2){let d=r.$implicit,t=r.$index;h("ngClass",q(5,rt,d.Exception)),l(2),F(t+1),l(2),F(d.Number),l(2),F(d.Status),l(2),F(d.Exception)}}function dt(e,r){if(e&1&&W(0,lt,9,7,"tr",6,R),e&2){let d,t=_();B((d=t.downloadResult())==null?null:d.Body)}}function st(e,r){e&1&&(o(0,"tr",5)(1,"td",7)(2,"div",8),S(3,"i",9),a(),o(4,"h4",10),s(5," There is no order to processed "),a()()())}var it=(()=>{let r=class r{constructor(){this.downloadResult=I()}ngOnInit(){}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:15,vars:1,consts:[[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[1,"text-center"],[3,"ngClass"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(o(0,"div",0)(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr"),S(5,"th",4),o(6,"th"),s(7,"Order Number"),a(),o(8,"th"),s(9,"Status"),a(),o(10,"th"),s(11,"Exception"),a()()(),o(12,"tbody"),w(13,dt,2,0)(14,st,6,0,"tr",5),a()()()()),n&2){let p;l(13),v(((p=i.downloadResult())==null||p.Body==null?null:p.Body.length)>0?13:14)}},dependencies:[V,O],encapsulation:2});let e=r;return e})();var mt=e=>({"full-width":e}),ct=()=>({standalone:!0}),nt=(()=>{let r=class r{constructor(){this.datePipe=y($),this.fullWidth=I(!1),this.timeChange=new A}ngOnInit(){}onTimeChange(t){let n=null;t&&(n=this.datePipe.transform(t,"HH:mm")),this.timeChange.emit(n),this.onTimePickerChange()}onShowCalendar(){let t=document.getElementById("dropdown-filter");if(t){var n=new bootstrap.Dropdown(t);n&&(n._config.autoClose="inside")}}onTimePickerChange(){let t=document.getElementById("dropdown-filter");if(t){var n=new bootstrap.Dropdown(t);n&&(n._config.autoClose="outside")}}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["app-timepicker"]],inputs:{time:"time",fullWidth:[1,"fullWidth"]},outputs:{timeChange:"timeChange"},decls:4,vars:8,consts:[["myCalendar",""],["styleClass","custom-height","id","shippingTime","appendTo","body",3,"ngModelChange","onSelect","ngClass","baseZIndex","ngModel","timeOnly","ngModelOptions"],["size","small","label","Close",3,"click"]],template:function(n,i){if(n&1){let p=T();o(0,"p-datepicker",1,0),P("ngModelChange",function(m){return c(p),M(i.time,m)||(i.time=m),u(m)}),C("ngModelChange",function(m){return c(p),u(i.onTimeChange(m))})("onSelect",function(){return c(p),u(i.onShowCalendar())}),o(2,"p-footer")(3,"p-button",2),C("click",function(){return c(p),N(1).hideOverlay(),u(i.onShowCalendar())}),a()()()}n&2&&(h("ngClass",q(5,mt,i.fullWidth()))("baseZIndex",1100),b("ngModel",i.time),h("timeOnly",!0)("ngModelOptions",ve(7,ct)))},dependencies:[V,O,ae,ne,oe,tt,et,Xe,Pe],styles:["p-datepicker span.p-datepicker.custom-height{height:44px;width:70px} p-datepicker.full-width span.p-datepicker.custom-height{height:44px;width:100%!important}"]});let e=r;return e})();var z=(()=>{let r=class r{constructor(){this.httpService=y(Te),this.toastr=y(xe),this.datePipe=y($)}gerChannelDetailById(t){return this.httpService.post(te.GetChannelDetail,{ID:t})}getOrderPreview(t){return this.httpService.post(te.GetOrderPreviewV2,t)}getDownloadOrder(t){return this.httpService.post(te.GetDownloadOrderV2,t)}onPreviewOrder(t){return this.validateDatePreview(t)?this.getOrderPreview(t).pipe(j(n=>{n.Data?.length===0&&this.toastrEmptyPreview(t)})):me}toastrEmptyPreview(t){let n=this.datePipe.transform(t.From,"dd MMM yyyy"),i=this.datePipe.transform(t.To,"dd MMM yyyy"),p=t.TimeFrom?t.TimeFrom:"",f=t.TimeTo?t.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${p} to ${i} ${f}!`,"No Orders!")}validateDatePreview(t){let n=!0;return t.downloadType==!0?x.getDaysDiff(t?.From,t?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):x.getDaysDiff(t?.From,t?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(t,n){let i=x.formatTitleFromDate(new Date(t),new Date(n)),p=this.datePipe.transform(t,i),f=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":p+"-"} ${f}`}};r.\u0275fac=function(n){return new(n||r)},r.\u0275prov=ue({token:r,factory:r.\u0275fac});let e=r;return e})();function ut(e,r){if(e&1&&(o(0,"ng-option",7),S(1,"img",17),s(2),a()),e&2){let d=r.$implicit;h("value",d.ID),l(),h("src",d==null?null:d.Img,he),l(),D("",d.Name," ")}}function ht(e,r){if(e&1){let d=T();o(0,"div",8)(1,"div",4)(2,"h5"),s(3,"Type"),a(),o(4,"p",5),s(5,"Select Type want to download"),a()(),o(6,"div",4)(7,"div",18)(8,"div")(9,"mat-radio-group",19),P("ngModelChange",function(n){c(d);let i=_();return M(i.downloadType,n)||(i.downloadType=n),u(n)}),C("ngModelChange",function(){c(d);let n=_();return u(n.onDownloadTypeChange())}),o(10,"mat-radio-button",20),s(11," Orders "),a(),o(12,"mat-radio-button",21),s(13," Disbursement "),a()()()(),o(14,"div",22)(15,"div",23),S(16,"i",24),a(),o(17,"p",25),s(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(e&2){let d=_();l(9),b("ngModel",d.downloadType),l(),h("value",!1),l(2),h("value",!0)}}function ft(e,r){e&1&&(o(0,"p",5),s(1," Select Disbursement date "),o(2,"span",26),s(3,"(payment date / order complete date)"),a(),s(4," of the channel you want to download (Max 1 Week). "),a())}function gt(e,r){e&1&&(o(0,"p",5),s(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function _t(e,r){if(e&1){let d=T();o(0,"div",16)(1,"app-timepicker",27),P("timeChange",function(n){c(d);let i=_();return M(i.startTime,n)||(i.startTime=n),u(n)}),C("timeChange",function(){c(d);let n=_();return u(n.onStartTimeChange())}),a(),o(2,"span",28),s(3,"-"),a(),o(4,"app-timepicker",27),P("timeChange",function(n){c(d);let i=_();return M(i.endTime,n)||(i.endTime=n),u(n)}),C("timeChange",function(){c(d);let n=_();return u(n.onEndTimeChange())}),a()()}if(e&2){let d=_();l(),b("time",d.startTime),l(3),b("time",d.endTime)}}var ot=(()=>{let r=class r{constructor(){this.reset=I(!1),this.authService=y(ie),this.tokenService=y(Me),this.downloadService=y(z),this.downloadType=g(!1),this.selectedChannelId=g(null),this.channelOptions=g(this.authService.getChannels()),this.channelType=ee,this.selectedChannel=g(null),this.showTimePicker=g(!1),this.startDate=g(null),this.endDate=g(null),this.startTime=g("00:00"),this.endTime=g("23:59"),this.minDate=g(new Date),this.maxDate=g(new Date),this.filterData=new A,this._onRememberMeChange=De({alias:"onRememberMeChange"}),this.rememberMe=g(!1),J(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0}),this.initDateValidation()}initDateValidation(){let t=this.tokenService?.getTokenValue(),n=t?.DownloadRange?JSON.parse(t?.DownloadRange):0;if(n<=0)this.minDate.set(null),this.maxDate.set(null);else{let i=new Date,p=x.addDays(i,n-1);this.minDate.set(p)}}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(t=>t.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(Q(t=>t?.Model),G(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let t=1;this.startDate()&&this.endDate()&&(t=x.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>t==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}onChangeRememberMe(t){this._onRememberMeChange.emit(t)}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange",_onRememberMeChange:"onRememberMeChange"},features:[Z([z,Ae()])],decls:32,vars:13,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"row","mt-6"],[1,"col-12","d-flex","align-items-center"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker","min","max"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel","maxlength"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"col-6","d-flex","align-items-center","gap-2","mt-10"],["type","checkbox",2,"width","16px","height","16px",3,"ngModelChange","ngModel"],[1,"ms-2"],[1,"mt-8","d-flex","align-items-center"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let p=T();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),s(5,"Select a Channel"),a(),o(6,"p",5),s(7,"Select Channel want to download order"),a()(),o(8,"div",4)(9,"ng-select",6),P("ngModelChange",function(m){return c(p),M(i.selectedChannelId,m)||(i.selectedChannelId=m),u(m)}),C("ngModelChange",function(){return c(p),u(i.onSelectChannel())}),W(10,ut,3,3,"ng-option",7,R),a()()(),w(12,ht,19,3,"div",8),L(13,"async"),o(14,"div",8)(15,"div",4)(16,"h5"),s(17,"Date Range"),a(),w(18,ft,5,0,"p",5)(19,gt,2,0,"p",5),a(),o(20,"div",4)(21,"div",9)(22,"mat-date-range-input",10)(23,"input",11),P("ngModelChange",function(m){return c(p),M(i.startDate,m)||(i.startDate=m),u(m)}),C("click",function(){c(p);let m=N(26);return u(m.open())}),a(),o(24,"input",12),P("ngModelChange",function(m){return c(p),M(i.endDate,m)||(i.endDate=m),u(m)}),C("click",function(){c(p);let m=N(26);return u(m.open())})("ngModelChange",function(){return c(p),u(i.onFilterDateChange())}),a()(),S(25,"mat-date-range-picker",null,0),a(),o(27,"div",13)(28,"input",14),P("ngModelChange",function(m){return c(p),M(i.rememberMe,m)||(i.rememberMe=m),u(m)}),C("ngModelChange",function(m){return c(p),u(i.onChangeRememberMe(m))}),a(),o(29,"h5",15),s(30,"Save Date"),a()(),w(31,_t,5,2,"div",16),a()()()()}if(n&2){let p,f,m=N(26);l(9),h("clearable",!1),b("ngModel",i.selectedChannelId),l(),B(i.channelOptions()),l(2),v((p=H(13,11,i.channelDetail$))!=null&&p.ServiceFeeWriteOff&&((p=i.selectedChannel())==null?null:p.TypeID)==i.channelType.Tokopedia?12:-1),l(6),v(i.downloadType()&&((f=i.selectedChannel())==null?null:f.TypeID)==i.channelType.Tokopedia?18:19),l(4),h("rangePicker",m)("min",i.minDate())("max",i.maxDate()),l(),b("ngModel",i.startDate),l(),b("ngModel",i.endDate),l(4),b("ngModel",i.rememberMe),l(3),v(i.showTimePicker()?31:-1)}},dependencies:[V,Re,Oe,Fe,Le,We,Be,ae,ke,Ee,ne,Ve,oe,nt,je,ze,Ye,Ue,Ge,X],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]});let e=r;return e})();var E=(function(e){return e.ALL="all",e.SYNC="sync",e.WRONG="wrong",e.UNSYNC="unsync",e})(E||{});var U=(function(e){return e[e.DoNothing=0]="DoNothing",e[e.New=1]="New",e[e.Update=2]="Update",e})(U||{});var Ct=(e,r)=>({"over-due-today":e,"over-due":r});function wt(e,r){if(e&1&&(o(0,"th",17),s(1),a()),e&2){let d=_();l(),D(" ",d.selectedChannel()?"Created Date":"Last Status Update"," ")}}function vt(e,r){if(e&1&&(o(0,"td"),s(1),L(2,"date"),a()),e&2){let d=_().$implicit;l(),D(" ",ye(2,1,d.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function St(e,r){if(e&1&&(o(0,"span"),s(1),a()),e&2){let d=_().$implicit;l(),D(" ",d.ActionString," ")}}function yt(e,r){if(e&1&&(o(0,"li"),s(1),a()),e&2){let d=r.$implicit;l(),D(" ",d," ")}}function Dt(e,r){if(e&1&&(o(0,"ul",21),W(1,yt,2,1,"li",null,R),a()),e&2){let d=_().$implicit;l(),B(d.ActionString)}}function xt(e,r){if(e&1&&(o(0,"span",22),S(1,"i",23),a()),e&2){let d=_().$implicit;h("title",we("Delivery : ",d.DeliveryState,`
|
|
2
2
|
Payment : `,d.PaymentState))}}function Tt(e,r){if(e&1&&(o(0,"tr")(1,"td"),s(2),a(),o(3,"td"),s(4),a(),w(5,vt,3,4,"td"),o(6,"td")(7,"span"),s(8),a(),s(9),a(),o(10,"td",20)(11,"span"),s(12),a(),s(13),a(),o(14,"td"),w(15,St,2,1,"span"),w(16,Dt,3,0,"ul",21),a(),o(17,"td"),w(18,xt,2,3,"span",22),a()()),e&2){let d,t=r.$implicit,n=r.$index,i=_(2);l(2),F(n+1),l(2),F(t.Number),l(),v(((d=i.selectedChannel())==null?null:d.TypeID)!=i.channelType.Shopee&&((d=i.selectedChannel())==null?null:d.TypeID)!==i.channelType.Tiktok?5:-1),l(3),D("",t.ChannelStatus," - "),l(),D("",t.ChannelStatusDescription," "),l(),h("ngClass",Se(12,Ct,(t==null?null:t.Action)==i.actionPreviewOrder.Update,(t==null?null:t.Action)==i.actionPreviewOrder.New))("matTooltip",t.POSStatus==91||t.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),l(2),D("",t.POSStatus," - "),l(),D("",t.POSStatusDescription," "),l(2),v(t.ActionString.length==1?15:-1),l(),v(t.ActionString.length>1?16:-1),l(2),v(t.ChannelStatus!=99&&t.POSStatus!=99?18:-1)}}function bt(e,r){if(e&1&&W(0,Tt,19,15,"tr",null,R),e&2){let d=_();B(d.displayPreviewData())}}function Mt(e,r){e&1&&(o(0,"tr",19)(1,"td",24)(2,"div",25),S(3,"i",26),a(),o(4,"h4",27),s(5," There is no order to processed "),a()()())}var at=(()=>{let r=class r{constructor(){this.orderPreview=I(),this.selectedChannel=I(),this.channelType=ee,this.allData=g(0),this.syncData=g(0),this.wrongData=g(0),this.unsyncData=g(0),this.pillStatus=g(E.ALL),this.actionPreviewOrder=U,this.previewStatus=E,this.displayPreviewData=g([]),this.exportOrders=new A,J(()=>{this.orderPreview()&&(this.filterPreviewData(E.ALL),this.initLengthStatusData())},{allowSignalWrites:!0})}filterPreviewData(t){this.pillStatus.update(()=>t),this.displayPreviewData.update(()=>this.filterDataByStatus(t))}initLengthStatusData(){this.wrongData.update(()=>this.filterDataByStatus(E.WRONG).length),this.syncData.update(()=>this.filterDataByStatus(E.SYNC).length),this.allData.update(()=>this.orderPreview().length),this.unsyncData.update(()=>this.filterDataByStatus(E.UNSYNC).length)}filterDataByStatus(t){let n=[];switch(t){case E.ALL:n=this.orderPreview();break;case E.SYNC:n=this.orderPreview().filter(i=>i.Action==U.DoNothing);break;case E.WRONG:n=this.orderPreview().filter(i=>i.Action==U.Update);break;case E.UNSYNC:n=this.orderPreview().filter(i=>i.Action==U.New);break}return n}onExportOrders(){this.exportOrders.emit()}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["preview-step"]],inputs:{orderPreview:[1,"orderPreview"],selectedChannel:[1,"selectedChannel"]},outputs:{exportOrders:"onExportOrders"},decls:40,vars:10,consts:[[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"col-12","d-flex","justify-content-between","align-items-end",2,"padding-left","0px","padding-right","0px"],[1,"nav","nav-pills"],[1,"nav-item","me-3"],[1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],[1,"nav-item","mx-3"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%"],["width","10%"],[1,"text-center"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div")(5,"ul",4)(6,"li",5)(7,"button",6),C("click",function(){return i.filterPreviewData(i.previewStatus.ALL)}),s(8),a()(),o(9,"li",7)(10,"button",8),C("click",function(){return i.filterPreviewData(i.previewStatus.SYNC)}),s(11),a()(),o(12,"li",7)(13,"button",9),C("click",function(){return i.filterPreviewData(i.previewStatus.WRONG)}),s(14),a()(),o(15,"li",7)(16,"button",10),C("click",function(){return i.filterPreviewData(i.previewStatus.UNSYNC)}),s(17),a()()()(),o(18,"div")(19,"button",11),C("click",function(){return i.onExportOrders()}),S(20,"i",12),o(21,"span"),s(22,"Export"),a()()()()(),o(23,"table",13)(24,"thead",14)(25,"tr"),S(26,"th",15),o(27,"th",16),s(28,"Number"),a(),w(29,wt,2,1,"th",17),o(30,"th",18),s(31,"Channel Status"),a(),o(32,"th",18),s(33,"POS Status"),a(),o(34,"th"),s(35,"Action"),a(),S(36,"th",15),a()(),o(37,"tbody"),w(38,bt,2,0)(39,Mt,6,0,"tr",19),a()()()()),n&2){let p,f;l(7),h("ngClass",i.pillStatus()=="all"?"btn-secondary text-white":"btn-outline-dark"),l(),D(" All (",i.allData(),") "),l(2),h("ngClass",i.pillStatus()=="sync"?"btn-success":"btn-outline-success"),l(),D(" Existing (",i.syncData(),") "),l(2),h("ngClass",i.pillStatus()=="wrong"?"btn-warning text-white":"btn-outline-warning"),l(),D(" Wrong Status (",i.wrongData(),") "),l(2),h("ngClass",i.pillStatus()=="unsync"?"btn-danger":"btn-outline-danger"),l(),D(" Missing (",i.unsyncData(),") "),l(12),v(((p=i.selectedChannel())==null?null:p.TypeID)!=i.channelType.Shopee&&((p=i.selectedChannel())==null?null:p.TypeID)!==i.channelType.Tiktok?29:-1),l(9),v(((f=i.displayPreviewData())==null?null:f.length)>0?38:39)}},dependencies:[V,O,re,Ie,$],encapsulation:2});let e=r;return e})();var Pt=["stepper"];function Et(e,r){if(e&1){let d=T();o(0,"div",2)(1,"button",20),C("click",function(){c(d);let n=_();return u(n.onStepperBack())}),s(2," Back "),a(),o(3,"button",21),C("click",function(){c(d);let n=_();return u(n.onNextStep())}),s(4," Next "),a()()}if(e&2){let d=_();l(3),h("disabled",d.disabledNextFilter())}}function kt(e,r){if(e&1){let d=T();o(0,"button",22),C("click",function(){c(d);let n=_();return u(n.onNextStep())}),s(1," Next "),a()}if(e&2){let d=_();h("disabled",d.disabledNextFilter())}}function Vt(e,r){if(e&1){let d=T();o(0,"button",23),C("click",function(){c(d);let n=_();return u(n.onNewDownload())}),S(1,"i",24),s(2," New "),a()}}function It(e,r){e&1&&(S(0,"i",25),o(1,"span"),s(2,"Filter"),a())}function Nt(e,r){e&1&&(S(0,"i",26),o(1,"span"),s(2,"Preview"),a())}function Ft(e,r){if(e&1){let d=T();o(0,"preview-step",27),C("onExportOrders",function(){c(d);let n=_();return u(n.onExportOrders())}),a()}e&2&&h("orderPreview",r)}function Ot(e,r){e&1&&(S(0,"i",28),o(1,"span"),s(2,"Finish"),a())}function Rt(e,r){e&1&&S(0,"complete-step",16),e&2&&h("downloadResult",r)}function Wt(e,r){e&1&&(o(0,"h6"),s(1,"1"),a())}function Bt(e,r){e&1&&(o(0,"h6"),s(1,"2"),a())}function Lt(e,r){e&1&&(o(0,"h6"),s(1,"3"),a())}var pn=(()=>{let r=class r{constructor(){this.downloadService=y(z),this.orderService=y(de),this.productService=y($e),this.authService=y(ie),this.stepperSelectedIndex=g(0),this.disabledNextFilter=g(!0),this.isResetFilter=g(!1),this.pageTitle=g("Download to POS"),this.cacheKey=g(x.GuidEMpty),this.rememberMe=g(!1)}onFilterChange(t){this.filter=t,this.validateDisabledNext()}validateDisabledNext(){this.disabledNextFilter.update(()=>x.IsEmpty(this.filter?.channelId)||!x.isValidDate(this.filter.startDate)||!x.isValidDate(this.filter.endDate))}onNextStep(){switch(this.stepper.selectedIndex){case 0:this.onPreview();let t=this.productService.findChannelById(this.filter.channelId,this.authService.getChannels());this.setPageTitle(`Preview ${t?.Name}`);break;case 1:this.onDownload(),this.setPageTitle("Download");break}}onStepperNext(){this.stepper.selected.completed=!0,this.stepper.next()}onPreview(){let t={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,IsDisbursement:this.filter.downloadType};x.IsNotEmpty(this.filter.startTime)&&(t=pe(se({},t),{TimeFrom:this.filter.startTime+":00",TimeTo:this.filter.endTime+":00"})),this.orderPreview$=this.downloadService.onPreviewOrder(t).pipe(j(n=>{n.Data?.length>0&&(this.cacheKey.update(()=>n.CacheKey),this.onStepperNext())}),Q(n=>n.Data),G(1))}onExportOrders(){let t={ID:this.filter.channelId,From:this.filter.startDate?this.filter.startDate:null,To:this.filter.endDate?this.filter.endDate:null},n=`Orders ${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)}`;this.orderService.exportOrders(t,n).subscribe()}onDownload(){let t={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,ListPreview:[],IsDisbursement:this.filter.downloadType,CacheKey:this.cacheKey()};this.downloadPreview$=this.orderPreview$.pipe(ce(n=>(t.ListPreview=n,this.downloadService.getDownloadOrder(t))),j(()=>{this.onStepperNext()}),G(1))}setPageTitle(t){this.pageTitle.update(()=>`
|
|
3
3
|
${t} (${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)})
|
|
4
4
|
`)}onStepperBack(){this.stepper.previous(),this.pageTitle.update(()=>"Download to POS")}onNewDownload(){this.isResetFilter.update(()=>!this.rememberMe()),this.stepper.reset(),this.stepperSelectedIndex.update(()=>0),this.orderPreview$=null,this.downloadPreview$=null,this.pageTitle.update(()=>"Download to POS")}};r.\u0275fac=function(n){return new(n||r)},r.\u0275cmp=k({type:r,selectors:[["app-download-v2"]],viewQuery:function(n,i){if(n&1&&fe(Pt,5),n&2){let p;ge(p=_e())&&(i.stepper=p.first)}},features:[Z([z,de,{provide:He,useValue:{displayDefaultIndicatorType:!1}}])],decls:26,vars:21,consts:[["stepper",""],[3,"hideSearchBox","hideSearchDropdown","headerTitle","description"],[1,"btn-group","me-3"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"disabled"],[1,"btn","btn-outline-secondary","btn-fill","d-flex","align-items-center","gap-2"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["linear","",1,"w-100","stepper-download",3,"selectedIndexChange","ngClass","selectedIndex"],["state","filter",3,"completed","editable"],["matStepLabel",""],[1,"w-100",3,"onFilterChange","onRememberMeChange","reset"],["state","preview",3,"editable","completed"],[3,"orderPreview"],["state","finish"],[3,"downloadResult"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","bg-success","text-white",3,"click","disabled"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"click","disabled"],[1,"btn","btn-outline-secondary","btn-fill","d-flex","align-items-center","gap-2",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt"],[1,"fa-solid","fa-filter","me-3"],[1,"fa-solid","fa-file","me-3"],[3,"onExportOrders","orderPreview"],[1,"fa-solid","fa-flag","me-3"]],template:function(n,i){if(n&1){let p=T();o(0,"mainpanel",1)(1,"actions"),w(2,Et,5,1,"div",2),w(3,kt,2,1,"button",3),w(4,Vt,3,0,"button",4),a(),o(5,"content")(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8)(10,"mat-stepper",9,0),P("selectedIndexChange",function(m){return c(p),M(i.stepperSelectedIndex,m)||(i.stepperSelectedIndex=m),u(m)}),o(12,"mat-step",10),Y(13,It,3,0,"ng-template",11),o(14,"filter-step",12),C("onFilterChange",function(m){return c(p),u(i.onFilterChange(m))})("onRememberMeChange",function(m){return c(p),u(i.rememberMe.set(m))}),a()(),o(15,"mat-step",13),Y(16,Nt,3,0,"ng-template",11),w(17,Ft,1,1,"preview-step",14),L(18,"async"),a(),o(19,"mat-step",15),Y(20,Ot,3,0,"ng-template",11),w(21,Rt,1,1,"complete-step",16),L(22,"async"),a(),Y(23,Wt,2,0,"ng-template",17)(24,Bt,2,0,"ng-template",18)(25,Lt,2,0,"ng-template",19),a()()()()()()()}if(n&2){let p,f,m=N(11);h("hideSearchBox",!0)("hideSearchDropdown",!0)("headerTitle",i.pageTitle())("description",i.pageTitle()),l(2),v(i.stepperSelectedIndex()==1?2:-1),l(),v(i.stepperSelectedIndex()==0?3:-1),l(),v(i.stepperSelectedIndex()==2?4:-1),l(6),h("ngClass",Ce("last-edited-step-"+m.selectedIndex)),b("selectedIndex",i.stepperSelectedIndex),l(2),h("completed",!1)("editable",i.stepperSelectedIndex()!=2),l(2),h("reset",i.isResetFilter()),l(),h("editable",i.stepperSelectedIndex()!=2)("completed",!1),l(2),v((p=H(18,17,i.orderPreview$))?17:-1,p),l(4),v((f=H(22,19,i.downloadPreview$))?21:-1,f)}},dependencies:[V,O,it,ot,at,Je,Ze,Ke,qe,Qe,Ne,be,re,X],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.vertical-radio{display:flex;flex-direction:column;margin:15px 0}.mt-1rem{margin-top:1rem}.dateRange{padding-top:.8rem;padding-bottom:.8rem}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}.form-label-group.radio.download-type{height:45.5938px!important;border-radius:.375rem!important}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as pe,b as se}from"./chunk-K5WSFDNA.js";import{a as ue}from"./chunk-
|
|
1
|
+
import{a as pe,b as se}from"./chunk-K5WSFDNA.js";import{a as ue}from"./chunk-FSLUPR5I.js";import{a as F}from"./chunk-L6CRWJ2O.js";import{a as ce}from"./chunk-PV4OJSZI.js";import{a as de}from"./chunk-RQI26KZX.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import{a as me}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as ae}from"./chunk-27DIE2YS.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as re}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import{a as le}from"./chunk-UEXWQT5J.js";import"./chunk-3SCX7IMW.js";import"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-M27MYADT.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import{c as oe}from"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-YH3KWMUX.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import{A as ne,c as $,h as ee,m as te,o as ie}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{A as Y,B as Z,w as Q,x as U,y as X}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{$c as G,Hb as W,Ia as N,Mc as z,Nc as l,Oc as V,Pc as A,Rc as h,Sc as S,Tc as w,Uc as R,Vc as H,Wc as j,Z as L,_c as q,ac as x,ad as J,bc as B,cc as b,dc as D,fc as I,gc as k,hc as y,ic as i,id as _,jc as n,jd as f,kc as C,kd as K,ob as r,ra as O,rc as T,wc as E,ya as c,yc as g,za as u}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import{a as M,b as P}from"./chunk-66YHNWRR.js";var _e=()=>[],fe=t=>({"td-cell-hover":t});function Ce(t,m){if(t&1&&C(0,"variants-dropdown",26),t&2){let e=g().$implicit;y("variants",e==null?null:e.Variants)}}function ge(t,m){if(t&1&&C(0,"variant-with-image",27),t&2){let e=g().$implicit;y("variant",e==null?null:e.Variants[0])}}function he(t,m){if(t&1&&(i(0,"span"),l(1),n()),t&2){let e=g().$implicit;r(),A("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function Se(t,m){t&1&&l(0," Awaiting Collection ")}function we(t,m){t&1&&l(0," Shipped ")}function ve(t,m){t&1&&l(0," Completed ")}function ye(t,m){t&1&&l(0," To Ship ")}function xe(t,m){t&1&&l(0," - ")}function be(t,m){if(t&1&&(i(0,"tr")(1,"td")(2,"div",23)(3,"div"),C(4,"order-link",24),n(),i(5,"small"),l(6),_(7,"date"),n(),C(8,"br"),i(9,"small"),C(10,"i",25),l(11),n()()(),i(12,"td"),x(13,Ce,1,1,"variants-dropdown",26)(14,ge,1,1,"variant-with-image",27),n(),i(15,"td"),l(16),_(17,"number"),n(),i(18,"td")(19,"div",23)(20,"div",28)(21,"span"),l(22),n(),x(23,he,2,1,"span"),n(),i(24,"small"),l(25),n()()(),i(26,"td"),x(27,Se,1,0),_(28,"lowercase"),_(29,"lowercase"),_(30,"lowercase"),_(31,"lowercase"),_(32,"lowercase"),_(33,"lowercase"),B(34,we,1,0)(35,ve,1,0)(36,ye,1,0)(37,xe,1,0),n()()),t&2){let e=m.$implicit;r(4),y("order",e),r(2),A(" ",K(7,11,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),r(5),A(" ",e.Customer," "),r(),z(J(28,fe,(e.Variants==null?null:e.Variants.length)>1)),r(),b((e.Variants==null?null:e.Variants.length)>1?13:14),r(3),V(f(17,14,e.Amount)),r(6),V(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),r(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?23:-1),r(2),A(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," "),r(2),b(f(28,16,e.Fulfillment)==="awaitingcollection"?27:f(29,18,e.Fulfillment)==="sent"&&f(30,20,e.Payment)==="unpaid"?34:f(31,22,e.Payment)==="paid"?35:f(32,24,e.Payment)==="unpaid"&&f(33,26,e.Fulfillment)==="unsent"?36:37)}}function Ae(t,m){if(t&1){let e=T();i(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),l(5,"Number"),n(),i(6,"th"),l(7,"Items"),n(),i(8,"th",21),l(9,"Amount"),n(),i(10,"th",21),l(11,"Fulfillment"),n(),i(12,"th",21),l(13,"Order Status"),n()()(),i(14,"tbody"),I(15,be,38,30,"tr",null,D),n()(),i(17,"app-custom-paginator",22),E("next",function(){c(e);let p=g();return u(p.initAllOrders())})("previous",function(){c(e);let p=g();return u(p.initAllOrders())}),n()()}if(t&2){let e=g(),d=j(0);r(15),k(d),r(2),y("filter",e.filter())("totaldata",d==null?null:d.length)}}function Te(t,m){t&1&&(i(0,"div",16),C(1,"app-empty-state"),n())}var Ke=(()=>{let m=class m{constructor(){this.orderService=O(F),this.filter=N({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:null})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:d=>{this.initFromDate(d)},error:d=>{console.error("Error fetching default date:",d),this.initFromDate(null)}})}initFromDate(d){this.filter.update(p=>P(M({},p),{From:d})),this.initAllOrders()}initAllOrders(){this.allOrders$=this.orderService.getAllOrders(this.filter()).pipe(L(1))}};m.\u0275fac=function(p){return new(p||m)},m.\u0275cmp=W({type:m,selectors:[["app-all"]],features:[q([F])],decls:34,vars:12,consts:[["headerTitle","All Orders","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],["rowCountApi","/api/orders/allcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"d-flex","align-items-end","gap-2"]],template:function(p,a){if(p&1){let s=T();R(0),_(1,"async"),i(2,"mainpanel",0),E("onSubmit",function(){return c(s),u(a.initAllOrders())}),w("textChange",function(o){return c(s),S(a.filter().Number,o)||(a.filter().Number=o),u(o)}),i(3,"actions")(4,"a",1),C(5,"i",2),i(6,"span"),l(7,"Order Fulfillment Display"),n()()(),i(8,"filters")(9,"div")(10,"label",3),l(11,"Channel"),n(),i(12,"app-channel-options-v2",4),w("ngModelChange",function(o){return c(s),S(a.filter().ListChannelID,o)||(a.filter().ListChannelID=o),u(o)}),n()(),i(13,"div",5)(14,"label",3),l(15,"From/To"),n(),i(16,"div",6)(17,"datepicker",7),w("dateChange",function(o){return c(s),S(a.filter().From,o)||(a.filter().From=o),u(o)}),n()(),i(18,"div")(19,"datepicker",8),w("dateChange",function(o){return c(s),S(a.filter().To,o)||(a.filter().To=o),u(o)}),n()()(),i(20,"div",5)(21,"label",9),l(22,"Page Number"),n(),i(23,"input",10),w("ngModelChange",function(o){return c(s),S(a.filter().PageNumber,o)||(a.filter().PageNumber=o),u(o)}),n()(),i(24,"div",5)(25,"label",9),l(26,"Page Size"),n(),i(27,"input",11),w("ngModelChange",function(o){return c(s),S(a.filter().PageSize,o)||(a.filter().PageSize=o),u(o)}),n()()(),i(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),x(32,Ae,18,2,"div",15)(33,Te,2,0,"div",16),n()()()()()}if(p&2){let s=H(f(1,8,a.allOrders$)||G(11,_e));r(2),h("text",a.filter().Number),r(10),y("multiple",!0),h("ngModel",a.filter().ListChannelID),r(5),h("date",a.filter().From),r(2),h("date",a.filter().To),r(4),h("ngModel",a.filter().PageNumber),r(4),h("ngModel",a.filter().PageSize),r(5),b((s==null?null:s.length)>0?32:33)}},dependencies:[Z,re,ae,me,ne,$,ie,ee,te,pe,se,ce,le,oe,ue,de,Q,U,Y,X],encapsulation:2});let t=m;return t})();export{Ke as AllComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as F}from"./chunk-TQROQOXU.js";import{a as x}from"./chunk-
|
|
1
|
+
import{a as F}from"./chunk-TQROQOXU.js";import{a as x}from"./chunk-V7V5O62J.js";import{h as E}from"./chunk-YH3KWMUX.js";import{a as T}from"./chunk-AGBJEXIM.js";import{b as i,c as g}from"./chunk-UPRDDI4K.js";import{b as D,e as d}from"./chunk-D6JH2KV4.js";import{d as w}from"./chunk-UB3ZV5NW.js";import{B as U,G as C,Ia as j,J as l,g as A,ma as s,q as u,ra as p,v as I}from"./chunk-OHGMB7HJ.js";var H=(()=>{let o=class o{constructor(){this.httpService=p(d)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(l(r=>u(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(r=>({value_id:r.value_id,name:r.name}))})),t}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var R=(()=>{let o=class o{constructor(){this.httpService=p(d)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(l(r=>u(null)))}generateAttribute(t){let e;return t.map(r=>(r.type=="PRODUCT_PROPERTY"?e={id:r.id,name:r.name,type:r.type,values:r.values}:e={id:r.id,name:r.values[0].id,type:r.type},e))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var V=(()=>{let o=class o{constructor(){this.httpService=p(d)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var z=(()=>{let o=class o{constructor(){this.httpService=p(d)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var y=class{};var v=class{};var G=(()=>{let o=class o{constructor(){this.httpService=p(d)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var N=(()=>{let o=class o{constructor(){this.httpService=p(d)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var O=(()=>{let o=class o{constructor(){this.httpService=p(d)}uploadProduct(t){return this.httpService.post(T.UploadPlugoProduct,t).pipe(l(e=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();var Bt=(()=>{let o=class o{constructor(){this.authService=p(E),this.productService=p(x),this.shoppeUploadService=p(H),this.tiktokUploadService=p(R),this.lazadaUploadService=p(V),this.tokopediaUploadService=p(G),this.wooUploadService=p(z),this.shopifyUploadService=p(N),this.plugoUploadService=p(O),this.toastrHandlingService=p(F),this.toastr=p(D),this.router=p(w),this.httpService=p(d),this._selectedProduct=new A(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(C(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return j(t.map(r=>{let c=new y;return c.id=r.ID,c.name=r.Name,c.type=r.TypeID,c.categoryId=null,c.attributes=[],c.selected=!1,c}))}onUploadProduct(t){let e=t.filter(r=>r.selected&&g.IsNotEmpty(r.categoryId)||r.selected&&(r.type==i.Shopify||r.type==i.ShopifyV2||r.type==i.Plugo));if(e.length>0){let r=this.generateDataForUpload(e);this.uploadProduct(r)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);U(e).pipe(I(r=>{let c=[];return r.filter(f=>g.IsNotEmpty(f)).forEach(f=>{c=[...c,...f]}),c})).subscribe({next:(r=[])=>{g.IsNotEmpty(r)&&this.toastrHandlingService.showToastrUploadMultiple(r),this.hasSuccessRes(r)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(r=>{r?.Response.Success_list?.length>0&&g.IsNotEmpty(r)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],r=[],c=[],f=[],S=[],k=[],P=[],b=[];t.forEach(n=>{switch(n.ChannelType){case i.Shopee:r.push(n);break;case i.Tiktok:e.push(n);break;case i.Lazada:c.push(n);break;case i.Tokopedia:f.push(n);break;case i.WooCommerce:S.push(n);break;case i.Shopify:k.push(n);break;case i.ShopifyV2:P.push(n);break;case i.Plugo:b.push(n);break}});let h=[];return[{type:i.Shopee,data:r},{type:i.Tiktok,data:e},{type:i.Lazada,data:c},{type:i.Tokopedia,data:f},{type:i.WooCommerce,data:S},{type:i.Shopify,data:k},{type:i.ShopifyV2,data:P},{type:i.Plugo,data:b}].filter(n=>n.data.length>0).forEach(n=>{switch(n.type){case i.Shopee:h.push(this.shoppeUploadService.uploadProduct(r));break;case i.Tiktok:h.push(this.tiktokUploadService.uploadProduct(e));break;case i.Lazada:h.push(this.lazadaUploadService.uploadProduct(c));break;case i.Tokopedia:h.push(this.tokopediaUploadService.uploadProduct(f));break;case i.WooCommerce:h.push(this.wooUploadService.uploadProduct(S));break;case i.Shopify:h.push(this.shopifyUploadService.uploadProduct(k));break;case i.ShopifyV2:h.push(this.shopifyUploadService.uploadProduct(P));break;case i.Plugo:h.push(this.plugoUploadService.uploadProduct(b));break}}),h}generateDataForUpload(t){let e=[];return t.forEach(r=>{let c=new v;c.ChannelID=r.id,c.ChannelType=r.type,c.Products=this._selectedProduct.getValue(),r.type==i.Shopify||r.type==i.ShopifyV2?delete c.CategoryID:c.CategoryID=r.categoryId,c=this.generateAttributeHttpRequest(r,c),e.push(c)}),e}generateAttributeHttpRequest(t,e){return t.type==i.WooCommerce||t.type==i.Shopify||t.type==i.ShopifyV2?e.Attribute=t.attributes[0]:t.type==i.Tiktok?(e.Attributes=this.formatAttributes(t.type,t.attributes),e.listing_platforms=t.listing_platforms):e.Attributes=this.formatAttributes(t.type,t.attributes),e}formatAttributes(t,e){let r;switch(t){case i.Shopee:r=this.shoppeUploadService.generateAttribute(e);break;case i.Tiktok:r=this.tiktokUploadService.generateAttribute(e);break;case i.WooCommerce:r=this.tiktokUploadService.generateAttribute(e);break;case i.Tokopedia:r=e;break;case i.Shopify:r=e;break;case i.ShopifyV2:r=e;break;default:r=[];break}return r}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let a=o;return a})();export{H as a,R as b,V as c,z as d,Bt as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as U}from"./chunk-BZWZ64N5.js";import{a as Y}from"./chunk-
|
|
1
|
+
import{e as U}from"./chunk-BZWZ64N5.js";import{a as Y}from"./chunk-RQI26KZX.js";import"./chunk-VVNLTDLG.js";import"./chunk-OHAT7WXU.js";import"./chunk-L4EPB2CQ.js";import"./chunk-GNXSEYJF.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as G}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-JTKEMQZT.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-YH3KWMUX.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import{a as R}from"./chunk-AGBJEXIM.js";import"./chunk-NB2H6KA7.js";import"./chunk-UPRDDI4K.js";import{A as J,c as j,h as F,m as H}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as B,e as I}from"./chunk-D6JH2KV4.js";import"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as k,w as P,z as W}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as M,Ia as g,Nc as i,Oc as T,Rc as b,Sc as v,Tc as _,Uc as V,Vc as D,Wc as S,Z as x,ac as N,cc as O,hc as f,ic as e,id as w,jc as t,jd as y,kc as L,ob as a,ra as h,rc as E,wc as C,ya as m,yc as A,za as c}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function z(o,l){if(o&1&&(e(0,"pre",21),i(1),w(2,"json"),t()),o&2){A();let q=S(25);a(),T(y(2,1,q))}}function K(o,l){o&1&&(e(0,"p",22),i(1," Your data will be shown here once it's available "),t())}var me=(()=>{let l=class l{constructor(){this.httpService=h(I),this.toastr=h(B),this.selectedChannel=g(null),this.orderNumber=g(null)}fetchLog(){if(!this.selectedChannel()||!this.orderNumber()){this.toastr.warning("Please select a channel and enter an order number","Warning");return}this.orderLog$=this.httpService.post(R.GetOrderApiLog,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).pipe(x(1))}copyToClipboard(p){if(!p)return;let s=typeof p=="string"?p:JSON.stringify(p,null,2);navigator.clipboard.writeText(s),this.toastr.success("Copied to clipboard!","Success")}};l.\u0275fac=function(s){return new(s||l)},l.\u0275cmp=M({type:l,selectors:[["app-order-api"]],decls:40,vars:9,consts:[["headerTitle","Origin Order Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body"],[1,"col-sm-12"],[1,"form-group","position-relative"],["id","orderLogText"],[1,"text-center","my-12","text-muted"]],template:function(s,n){if(s&1){let d=E();e(0,"mainpanel",0)(1,"actions")(2,"button",1),C("click",function(){return m(d),c(n.fetchLog())}),L(3,"i",2),i(4," Search "),t()(),e(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),i(12,"Channel"),t(),e(13,"p",8),i(14," View logs related to Order API activities. "),t()(),e(15,"div",9)(16,"app-channel-options-v2",10),_("ngModelChange",function(r){return m(d),v(n.selectedChannel,r)||(n.selectedChannel=r),c(r)}),t()()(),e(17,"div",11)(18,"div",7)(19,"h6"),i(20,"Order Number"),t(),e(21,"p",8),i(22," Order or Invoice number from Channel. "),t()(),e(23,"div",9)(24,"input",12),_("ngModelChange",function(r){return m(d),v(n.orderNumber,r)||(n.orderNumber=r),c(r)}),t()()()()(),V(25),w(26,"async"),e(27,"div",13)(28,"div",14)(29,"div",15)(30,"div",16)(31,"h5"),i(32,"Response"),t(),e(33,"button",17),C("click",function(){m(d);let r=S(25);return c(n.copyToClipboard(r))}),i(34," Copy "),t()(),e(35,"div",18)(36,"div",19)(37,"div",20),N(38,z,3,3,"pre",21)(39,K,2,0,"p",22),t()()()()()()()()()}if(s&2){f("hideSearchBox",!0)("hideSearchDropdown",!0),a(16),b("ngModel",n.selectedChannel),a(8),b("ngModel",n.orderNumber),a();let d=D(y(26,6,n.orderLog$));a(8),f("disabled",!d),a(5),O(d?38:39)}},dependencies:[k,G,U,J,j,F,H,Y,P,W],encapsulation:2});let o=l;return o})();export{me as OrderApiComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h}from"./chunk-
|
|
1
|
+
import{h}from"./chunk-YH3KWMUX.js";import{a as u}from"./chunk-NB2H6KA7.js";import{b as l}from"./chunk-D6JH2KV4.js";import{d as p}from"./chunk-UB3ZV5NW.js";import{ma as c,qa as t}from"./chunk-OHGMB7HJ.js";var g=(()=>{let e=class e{constructor(s,i,r,n){this.toastr=s,this.authService=i,this.router=r,this.permissionService=n}canActivate(s,i){let r=JSON.parse(window.localStorage.getItem("user")),n=new Date,a=!1;if(r!=null){let m=new Date(r?.Token?.expiredAt);n<m?a=!0:(this.authService.logout(),this.onTokenExpired())}else this.router.navigate([""]),this.onTokenExpired();return a}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired")}};e.\u0275fac=function(i){return new(i||e)(t(l),t(h),t(p),t(u))},e.\u0275prov=c({token:e,factory:e.\u0275fac,providedIn:"root"});let o=e;return o})();export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as it,b as ct}from"./chunk-Z3PLQ27X.js";import"./chunk-VG66LDXQ.js";import{e as rt}from"./chunk-HZTKN5RX.js";import"./chunk-TQROQOXU.js";import{a as ut}from"./chunk-IQGRGC3E.js";import{a as T}from"./chunk-KOQLZV3N.js";import"./chunk-6F37VT6M.js";import"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import"./chunk-BKR7YPEW.js";import{d as nt}from"./chunk-BZWZ64N5.js";import{a as at}from"./chunk-7KG3DC5J.js";import{a as mt}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as ht}from"./chunk-27DIE2YS.js";import{a as ot}from"./chunk-LCN52IJT.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-BKCKASH3.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as et}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{c as X,h as tt}from"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import{f as lt,g as st,h as dt,i as pt}from"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{a as D}from"./chunk-ZSUWHVKX.js";import{h as Z}from"./chunk-62YNPW6Q.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import{b as j,c as z}from"./chunk-NB2H6KA7.js";import{b as F,c as _}from"./chunk-UPRDDI4K.js";import{A as Q,c as Y,h as q,m as K}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as W,e as H}from"./chunk-D6JH2KV4.js";import{d as $}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{G as y,Hb as U,Ic as O,Nb as A,Nc as w,Pc as V,Rc as E,Sc as N,Tc as R,aa as B,ac as P,ad as I,cc as f,ec as L,fc as G,gc as J,hc as g,ic as h,jc as u,kc as b,ob as r,oc as v,pc as M,ra as C,rc as S,wc as m,ya as l,yc as a,za as s}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var k=o=>[o];function _t(o,c){if(o&1){let t=S();h(0,"button",15),m("click",function(){l(t);let i=a(2);return s(i.onDetachMultipleProduct())}),b(1,"i",16),w(2),u()}if(o&2){let t,e=a(2);r(2),V("Detach (",(t=e.productService.selectedProduct(e.products))==null?null:t.length,") ")}}function gt(o,c){if(o&1&&(v(0),P(1,_t,3,1,"button",14),M()),o&2){let t=a();r(),f(t.productService.hasSelection(t.products)?1:-1)}}function Ct(o,c){if(o&1){let t=S();h(0,"button",18),m("click",function(){l(t);let i=a(3);return s(i.onOpenScanDialog())}),b(1,"i",19),w(2," Scan Channel "),u()}}function Pt(o,c){if(o&1&&P(0,Ct,3,0,"button",17),o&2){let t=a(2);f(t.productService.hasSelection(t.products)?-1:0)}}function ft(o,c){if(o&1&&(v(0),P(1,Pt,1,1),M()),o&2){let t=a();r(),f(t.productService.hasSelection(t.products)?-1:1)}}function St(o,c){if(o&1){let t=S();h(0,"button",21),m("click",function(){l(t);let i=a(2);return s(i.onScanMultipleProduct())}),b(1,"i",19),w(2),u()}if(o&2){let t,e=a(2);r(2),V(" Scan (",(t=e.productService.selectedProduct(e.products))==null?null:t.length,") ")}}function xt(o,c){if(o&1&&(v(0),P(1,St,3,1,"button",20),M()),o&2){let t=a();r(),f(t.productService.hasSelection(t.products)&&t.multipeScanChannels.length>0?1:-1)}}function bt(o,c){if(o&1){let t=S();h(0,"button",23),m("click",function(){l(t);let i=a(2);return s(i.onUploadMultipleProduct())}),b(1,"i",24),w(2),u()}if(o&2){let t,e=a(2);r(2),V(" Upload (",(t=e.productService.selectedProduct(e.products))==null?null:t.length,") ")}}function wt(o,c){if(o&1&&(v(0),P(1,bt,3,1,"button",22),M()),o&2){let t=a();r(),f(t.productService.hasSelection(t.products)?1:-1)}}function yt(o,c){if(o&1){let t=S();h(0,"div",11)(1,"app-product-card",25),m("onUpload",function(){let i=l(t).$implicit,n=a();return s(n.onUploadToMultipleChannel(i))})("onScan",function(){let i=l(t).$implicit,n=a();return s(n.onScanSingleProduct(i))})("onDescEvent",function(){let i=l(t).$index,n=a();return s(n.onOpenDialogVariant(i))})("onCheckBoxChange",function(i){let n=l(t).$implicit;return s(n.selected=i)})("onDetach",function(){let i=l(t).$implicit,n=a();return s(n.onDetachProduct([i]))}),u()()}if(o&2){let t=c.$implicit,e=a();r(),g("productId",t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",e.productService.getChannelProduct(t))("code",e.getVariantCode(t==null?null:t.Variants))("showCheckBox",(t==null?null:t.Channel.length)<e.channelOptions.length)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function vt(o,c){o&1&&(h(0,"div",12),b(1,"app-empty-state"),u())}function Mt(o,c){if(o&1){let t=S();h(0,"div",13)(1,"div",26)(2,"app-custom-paginator",27),m("next",function(){l(t);let i=a();return s(i.getProducts())})("previous",function(){l(t);let i=a();return s(i.getProducts())}),u()()()}if(o&2){let t=a();r(2),g("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var ie=(()=>{let c=class c{constructor(){this.http=C(H),this.toastr=C(W),this.dialog=C(X),this.productService=C(ot),this.authService=C(Z),this.uploadProductService=C(rt),this.route=C($),this.searchFilter=new at,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.scanProductRole=D.ProductScan,this.uploadProductRole=D.ProductUpload,this.detachProductRole=D.ProductDetach,this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(e=>{this.Categories=e.Options.Categories,this.searchFilter.PageNumber=e.Filter.PageNumber,this.searchFilter.RowCount=e.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=e.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[F.Tokopedia,F.Tiktok])}getProducts(){let e={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",e).subscribe(i=>{this.products=i.Data,this.rowCount=i.Total==null?this.searchFilter.RowCount:i.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=_.GuidEMpty,this.dialog.open(T,{data:{filter:e,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(n=>_.IsNotEmpty(n))).subscribe(n=>{this.searchFilter.ChannelID=n.ChannelID,this.searchFilter.ScanFull=n.ScanFull,this.searchFilter.UpdatedProduct=n.UpdatedProduct,this.searchFilter.Async=n.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(e,i,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(e){let i=this.products[e]?.Variants||[];this.dialog.open(it,{data:{title:this.products[e].Name,variants:i}})}onUploadMultipleProduct(){let e=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(e),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(e){this.uploadProductService.setSelectedProduct([e]),this.route.navigate(["/menu/products/upload"])}searchProduct(e){this.searchFilter.text=e,this.getProducts()}onScanMultipleProduct(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=_.GuidEMpty;let i=this.productService.filterChannelByTypeId(this.channelOptions,[F.Tokopedia,F.Tiktok]);this.dialog.open(T,{data:{filter:e,channelOptions:i,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(p=>_.IsNotEmpty(p))).subscribe(p=>{this.searchFilter.ChannelID=p.ChannelID,this.searchFilter.ScanFull=p.ScanFull,this.searchFilter.UpdatedProduct=p.UpdatedProduct;let x=this.productService.selectedProduct(this.products),d=this.productService.getVariantCodesProducts(x);this.scanSingleProduct(d)})}onScanSingleProduct(e){let i=JSON.parse(JSON.stringify(this.searchFilter));i.ChannelID=_.GuidEMpty,this.dialog.open(T,{data:{filter:i,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(n=>_.IsNotEmpty(n))).subscribe(n=>{this.searchFilter.ChannelID=n.ChannelID;let p=this.productService.getVariantCodesProduct(e);this.scanSingleProduct(p)})}scanSingleProduct(e){this.productService.scanSingle(this.searchFilter.ChannelID,e).subscribe({next:i=>{if(i)this.toastr.success("Successfully Scan ","Success");else{let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${n?.Name} `,"Error")}this.searchFilter.ChannelID=_.GuidEMpty,i&&this.getProducts()},error:i=>{this.searchFilter.ChannelID=_.GuidEMpty}})}getVariantCode(e=[]){let i;return e?.length>1&&(i=(e[0].model?e[0].model:"")+e[0].Code),e?.length==1&&(i=e[0].Code),i}onDetachProduct(e){let i=[];e.forEach(n=>{n.Channel=_.assignChannelLogo(n.Channel),i.push(...n.Channel)}),this.dialog.open(ct,{width:"600px",data:[...i]}).afterClosed().pipe(y(n=>_.IsNotEmpty(n)),B(n=>this.productService.detachProduct(n))).subscribe(n=>{this.toastr.success(n.Message,tt.Success),this.getProducts()})}onDetachMultipleProduct(){let e=this.productService.selectedProduct(this.products);this.onDetachProduct(e)}};c.\u0275fac=function(i){return new(i||c)},c.\u0275cmp=U({type:c,selectors:[["app-in-pos"]],decls:24,vars:21,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],[4,"ngxPermissionsOnly"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"]],template:function(i,n){if(i&1){let p=S();h(0,"mainpanel",1),m("onSubmit",function(d){return l(p),s(n.searchProduct(d))}),h(1,"actions"),A(2,gt,2,1,"ng-container",2)(3,ft,2,1,"ng-container",2)(4,xt,2,1,"ng-container",2)(5,wt,2,1,"ng-container",2),u(),h(6,"filters")(7,"div")(8,"label",3),w(9,"Category"),u(),h(10,"ng-select",4),m("ngModelChange",function(d){return l(p),s(n.searchFilter.Category=d)}),u()(),h(11,"div",5)(12,"mat-date-range-input",6)(13,"input",7),R("ngModelChange",function(d){return l(p),N(n.startDate,d)||(n.startDate=d),s(d)}),m("click",function(){l(p);let d=O(16);return s(d.open())}),u(),h(14,"input",8),R("ngModelChange",function(d){return l(p),N(n.endDate,d)||(n.endDate=d),s(d)}),m("click",function(){l(p);let d=O(16);return s(d.open())}),u()(),b(15,"mat-date-range-picker",null,0),u()(),h(17,"content")(18,"div",9)(19,"div",10),G(20,yt,2,11,"div",11,L),P(22,vt,2,0,"div",12),u(),P(23,Mt,3,5,"div",13),u()()()}if(i&2){let p=O(16);g("headerTitle","In POS ("+n.rowCount+")"),r(2),g("ngxPermissionsOnly",I(13,k,n.detachProductRole)),r(),g("ngxPermissionsOnly",I(15,k,n.scanProductRole)),r(),g("ngxPermissionsOnly",I(17,k,n.scanProductRole)),r(),g("ngxPermissionsOnly",I(19,k,n.scanProductRole)),r(5),g("clearable",!0)("items",n.Categories)("ngModel",n.searchFilter.Category),r(2),g("rangePicker",p),r(),E("ngModel",n.startDate),r(),E("ngModel",n.endDate),r(6),J(n.products),r(2),f(n.products.length==0?22:-1),r(),f(n.products.length>0?23:-1)}},dependencies:[et,Q,Y,q,K,z,j,nt,lt,st,dt,pt,ut,ht,mt],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]});let o=c;return o})();export{ie as InPosComponent};
|
|
1
|
+
import{a as it,b as ct}from"./chunk-Z3PLQ27X.js";import"./chunk-VG66LDXQ.js";import{e as rt}from"./chunk-NJYWKADT.js";import"./chunk-TQROQOXU.js";import{a as ut}from"./chunk-IQGRGC3E.js";import{a as T}from"./chunk-KOQLZV3N.js";import"./chunk-6F37VT6M.js";import"./chunk-2EGTHH3W.js";import"./chunk-LR2YCE6M.js";import"./chunk-BKR7YPEW.js";import{d as nt}from"./chunk-BZWZ64N5.js";import{a as at}from"./chunk-7KG3DC5J.js";import{a as mt}from"./chunk-ZZYFVEJO.js";import"./chunk-DLHIDOS3.js";import{a as ht}from"./chunk-27DIE2YS.js";import{a as ot}from"./chunk-V7V5O62J.js";import"./chunk-JU4ZP3HI.js";import"./chunk-3T5VLB63.js";import"./chunk-STOW2RQN.js";import"./chunk-GLBJ4Y4T.js";import"./chunk-XTNXL2IY.js";import"./chunk-KOUB5HRK.js";import"./chunk-QETZ5VDX.js";import"./chunk-WIRXMAIF.js";import"./chunk-S22I47XG.js";import"./chunk-3NCMRK7E.js";import"./chunk-PRMV4INM.js";import"./chunk-A6QXXKPR.js";import"./chunk-6Q4BDCI5.js";import"./chunk-C4MTEDSW.js";import"./chunk-JMRRXRKO.js";import{b as et}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import{c as X,h as tt}from"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import{f as lt,g as st,h as dt,i as pt}from"./chunk-K4Q33QIR.js";import"./chunk-JRCXHF2X.js";import"./chunk-TBVMCNS2.js";import"./chunk-RM6ZXD3O.js";import"./chunk-R2XKB6UH.js";import"./chunk-RO7WOCSA.js";import"./chunk-3RK6DDJD.js";import"./chunk-UDNUDL5Z.js";import"./chunk-CVHFVFZQ.js";import"./chunk-ZC526ERX.js";import"./chunk-NJNRUDU6.js";import"./chunk-XUDE7VBC.js";import"./chunk-WAZWPRUG.js";import"./chunk-6H7M43WO.js";import"./chunk-HO2TMGLM.js";import"./chunk-JTKEMQZT.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import{a as D}from"./chunk-ZSUWHVKX.js";import{h as Z}from"./chunk-YH3KWMUX.js";import"./chunk-X2CTSYKS.js";import"./chunk-QXRG5XYP.js";import"./chunk-AGBJEXIM.js";import{b as j,c as z}from"./chunk-NB2H6KA7.js";import{b as F,c as _}from"./chunk-UPRDDI4K.js";import{A as Q,c as Y,h as q,m as K}from"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import"./chunk-RXLMJGUY.js";import{b as W,e as H}from"./chunk-D6JH2KV4.js";import{d as $}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{G as y,Hb as U,Ic as O,Nb as A,Nc as w,Pc as V,Rc as E,Sc as N,Tc as R,aa as B,ac as P,ad as I,cc as f,ec as L,fc as G,gc as J,hc as g,ic as h,jc as u,kc as b,ob as r,oc as v,pc as M,ra as C,rc as S,wc as m,ya as l,yc as a,za as s}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";var k=o=>[o];function _t(o,c){if(o&1){let t=S();h(0,"button",15),m("click",function(){l(t);let i=a(2);return s(i.onDetachMultipleProduct())}),b(1,"i",16),w(2),u()}if(o&2){let t,e=a(2);r(2),V("Detach (",(t=e.productService.selectedProduct(e.products))==null?null:t.length,") ")}}function gt(o,c){if(o&1&&(v(0),P(1,_t,3,1,"button",14),M()),o&2){let t=a();r(),f(t.productService.hasSelection(t.products)?1:-1)}}function Ct(o,c){if(o&1){let t=S();h(0,"button",18),m("click",function(){l(t);let i=a(3);return s(i.onOpenScanDialog())}),b(1,"i",19),w(2," Scan Channel "),u()}}function Pt(o,c){if(o&1&&P(0,Ct,3,0,"button",17),o&2){let t=a(2);f(t.productService.hasSelection(t.products)?-1:0)}}function ft(o,c){if(o&1&&(v(0),P(1,Pt,1,1),M()),o&2){let t=a();r(),f(t.productService.hasSelection(t.products)?-1:1)}}function St(o,c){if(o&1){let t=S();h(0,"button",21),m("click",function(){l(t);let i=a(2);return s(i.onScanMultipleProduct())}),b(1,"i",19),w(2),u()}if(o&2){let t,e=a(2);r(2),V(" Scan (",(t=e.productService.selectedProduct(e.products))==null?null:t.length,") ")}}function xt(o,c){if(o&1&&(v(0),P(1,St,3,1,"button",20),M()),o&2){let t=a();r(),f(t.productService.hasSelection(t.products)&&t.multipeScanChannels.length>0?1:-1)}}function bt(o,c){if(o&1){let t=S();h(0,"button",23),m("click",function(){l(t);let i=a(2);return s(i.onUploadMultipleProduct())}),b(1,"i",24),w(2),u()}if(o&2){let t,e=a(2);r(2),V(" Upload (",(t=e.productService.selectedProduct(e.products))==null?null:t.length,") ")}}function wt(o,c){if(o&1&&(v(0),P(1,bt,3,1,"button",22),M()),o&2){let t=a();r(),f(t.productService.hasSelection(t.products)?1:-1)}}function yt(o,c){if(o&1){let t=S();h(0,"div",11)(1,"app-product-card",25),m("onUpload",function(){let i=l(t).$implicit,n=a();return s(n.onUploadToMultipleChannel(i))})("onScan",function(){let i=l(t).$implicit,n=a();return s(n.onScanSingleProduct(i))})("onDescEvent",function(){let i=l(t).$index,n=a();return s(n.onOpenDialogVariant(i))})("onCheckBoxChange",function(i){let n=l(t).$implicit;return s(n.selected=i)})("onDetach",function(){let i=l(t).$implicit,n=a();return s(n.onDetachProduct([i]))}),u()()}if(o&2){let t=c.$implicit,e=a();r(),g("productId",t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",e.productService.getChannelProduct(t))("code",e.getVariantCode(t==null?null:t.Variants))("showCheckBox",(t==null?null:t.Channel.length)<e.channelOptions.length)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function vt(o,c){o&1&&(h(0,"div",12),b(1,"app-empty-state"),u())}function Mt(o,c){if(o&1){let t=S();h(0,"div",13)(1,"div",26)(2,"app-custom-paginator",27),m("next",function(){l(t);let i=a();return s(i.getProducts())})("previous",function(){l(t);let i=a();return s(i.getProducts())}),u()()()}if(o&2){let t=a();r(2),g("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var ie=(()=>{let c=class c{constructor(){this.http=C(H),this.toastr=C(W),this.dialog=C(X),this.productService=C(ot),this.authService=C(Z),this.uploadProductService=C(rt),this.route=C($),this.searchFilter=new at,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.scanProductRole=D.ProductScan,this.uploadProductRole=D.ProductUpload,this.detachProductRole=D.ProductDetach,this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(e=>{this.Categories=e.Options.Categories,this.searchFilter.PageNumber=e.Filter.PageNumber,this.searchFilter.RowCount=e.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=e.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[F.Tokopedia,F.Tiktok])}getProducts(){let e={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",e).subscribe(i=>{this.products=i.Data,this.rowCount=i.Total==null?this.searchFilter.RowCount:i.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=_.GuidEMpty,this.dialog.open(T,{data:{filter:e,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(n=>_.IsNotEmpty(n))).subscribe(n=>{this.searchFilter.ChannelID=n.ChannelID,this.searchFilter.ScanFull=n.ScanFull,this.searchFilter.UpdatedProduct=n.UpdatedProduct,this.searchFilter.Async=n.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(e,i,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(e){let i=this.products[e]?.Variants||[];this.dialog.open(it,{data:{title:this.products[e].Name,variants:i}})}onUploadMultipleProduct(){let e=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(e),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(e){this.uploadProductService.setSelectedProduct([e]),this.route.navigate(["/menu/products/upload"])}searchProduct(e){this.searchFilter.text=e,this.getProducts()}onScanMultipleProduct(){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=_.GuidEMpty;let i=this.productService.filterChannelByTypeId(this.channelOptions,[F.Tokopedia,F.Tiktok]);this.dialog.open(T,{data:{filter:e,channelOptions:i,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(p=>_.IsNotEmpty(p))).subscribe(p=>{this.searchFilter.ChannelID=p.ChannelID,this.searchFilter.ScanFull=p.ScanFull,this.searchFilter.UpdatedProduct=p.UpdatedProduct;let x=this.productService.selectedProduct(this.products),d=this.productService.getVariantCodesProducts(x);this.scanSingleProduct(d)})}onScanSingleProduct(e){let i=JSON.parse(JSON.stringify(this.searchFilter));i.ChannelID=_.GuidEMpty,this.dialog.open(T,{data:{filter:i,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(n=>_.IsNotEmpty(n))).subscribe(n=>{this.searchFilter.ChannelID=n.ChannelID;let p=this.productService.getVariantCodesProduct(e);this.scanSingleProduct(p)})}scanSingleProduct(e){this.productService.scanSingle(this.searchFilter.ChannelID,e).subscribe({next:i=>{if(i)this.toastr.success("Successfully Scan ","Success");else{let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${n?.Name} `,"Error")}this.searchFilter.ChannelID=_.GuidEMpty,i&&this.getProducts()},error:i=>{this.searchFilter.ChannelID=_.GuidEMpty}})}getVariantCode(e=[]){let i;return e?.length>1&&(i=(e[0].model?e[0].model:"")+e[0].Code),e?.length==1&&(i=e[0].Code),i}onDetachProduct(e){let i=[];e.forEach(n=>{n.Channel=_.assignChannelLogo(n.Channel),i.push(...n.Channel)}),this.dialog.open(ct,{width:"600px",data:[...i]}).afterClosed().pipe(y(n=>_.IsNotEmpty(n)),B(n=>this.productService.detachProduct(n))).subscribe(n=>{this.toastr.success(n.Message,tt.Success),this.getProducts()})}onDetachMultipleProduct(){let e=this.productService.selectedProduct(this.products);this.onDetachProduct(e)}};c.\u0275fac=function(i){return new(i||c)},c.\u0275cmp=U({type:c,selectors:[["app-in-pos"]],decls:24,vars:21,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],[4,"ngxPermissionsOnly"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"]],template:function(i,n){if(i&1){let p=S();h(0,"mainpanel",1),m("onSubmit",function(d){return l(p),s(n.searchProduct(d))}),h(1,"actions"),A(2,gt,2,1,"ng-container",2)(3,ft,2,1,"ng-container",2)(4,xt,2,1,"ng-container",2)(5,wt,2,1,"ng-container",2),u(),h(6,"filters")(7,"div")(8,"label",3),w(9,"Category"),u(),h(10,"ng-select",4),m("ngModelChange",function(d){return l(p),s(n.searchFilter.Category=d)}),u()(),h(11,"div",5)(12,"mat-date-range-input",6)(13,"input",7),R("ngModelChange",function(d){return l(p),N(n.startDate,d)||(n.startDate=d),s(d)}),m("click",function(){l(p);let d=O(16);return s(d.open())}),u(),h(14,"input",8),R("ngModelChange",function(d){return l(p),N(n.endDate,d)||(n.endDate=d),s(d)}),m("click",function(){l(p);let d=O(16);return s(d.open())}),u()(),b(15,"mat-date-range-picker",null,0),u()(),h(17,"content")(18,"div",9)(19,"div",10),G(20,yt,2,11,"div",11,L),P(22,vt,2,0,"div",12),u(),P(23,Mt,3,5,"div",13),u()()()}if(i&2){let p=O(16);g("headerTitle","In POS ("+n.rowCount+")"),r(2),g("ngxPermissionsOnly",I(13,k,n.detachProductRole)),r(),g("ngxPermissionsOnly",I(15,k,n.scanProductRole)),r(),g("ngxPermissionsOnly",I(17,k,n.scanProductRole)),r(),g("ngxPermissionsOnly",I(19,k,n.scanProductRole)),r(5),g("clearable",!0)("items",n.Categories)("ngModel",n.searchFilter.Category),r(2),g("rangePicker",p),r(),E("ngModel",n.startDate),r(),E("ngModel",n.endDate),r(6),J(n.products),r(2),f(n.products.length==0?22:-1),r(),f(n.products.length>0?23:-1)}},dependencies:[et,Q,Y,q,K,z,j,nt,lt,st,dt,pt,ut,ht,mt],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]});let o=c;return o})();export{ie as InPosComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as L}from"./chunk-27DIE2YS.js";import{b as A}from"./chunk-SNRWOTPO.js";import"./chunk-ROS2QMKF.js";import"./chunk-IA7NJXJD.js";import"./chunk-UEXWQT5J.js";import"./chunk-IZZY74PN.js";import"./chunk-O3BS4AC6.js";import"./chunk-6UM4NHOR.js";import"./chunk-RQUCYFCB.js";import{e as F}from"./chunk-D6JH2KV4.js";import{b as H,e as P,g as k}from"./chunk-UB3ZV5NW.js";import"./chunk-JPWGFXZT.js";import{B as R,w as $,y as I}from"./chunk-CGSMHTKB.js";import"./chunk-XBIHN6D3.js";import{Hb as E,Kb as f,Nc as a,Pc as m,Z as D,ac as C,bc as w,cc as b,ea as v,ec as g,fc as M,gc as O,hc as B,ic as i,id as c,jc as n,jd as s,kc as T,kd as x,ob as l,q as y,ra as h,v as S,yc as _}from"./chunk-OHGMB7HJ.js";import"./chunk-WFMAM73Y.js";import"./chunk-66YHNWRR.js";function N(t,e){if(t&1&&(i(0,"tr")(1,"td"),a(2),n(),i(3,"td"),a(4),c(5,"newlineToComma"),n(),i(6,"td"),a(7),c(8,"date"),n(),i(9,"td"),a(10),c(11,"date"),n(),i(12,"td"),a(13),c(14,"duration"),n(),i(15,"td"),a(16),n()()),t&2){let p=e.$implicit;l(2),m(" ",p.Number," "),l(2),m(" ",s(5,6,p.Status)," "),l(3),m(" ",x(8,8,p.Created,"dd MMM yyyy - HH:mm")," "),l(3),m(" ",x(11,11,p.Updated,"dd MMM yyyy - HH:mm")," "),l(3),m(" ",s(14,14,p.Duration)," "),l(3),m(" ",p.Exception," ")}}function j(t,e){if(t&1&&(i(0,"div",5)(1,"table",7)(2,"thead")(3,"tr",8)(4,"th",9),a(5,"Number"),n(),i(6,"th",10),a(7,"Action(s)"),n(),i(8,"th",9),a(9,"Order Created Date"),n(),i(10,"th",9),a(11,"Order Updated Date"),n(),i(12,"th",11),a(13,"Duration"),n(),i(14,"th"),a(15,"Exception"),n()()(),i(16,"tbody"),M(17,N,17,16,"tr",null,g),c(19,"async"),n()()()),t&2){let p=_();l(17),O(s(19,0,p.orderDetails$))}}function U(t,e){t&1&&(i(0,"div",6),T(1,"app-empty-state"),n())}var q=(()=>{let e=class e{transform(o){if(o<1e3)return`${o} ms`;let r=o/1e3;if(r<60)return`${r.toFixed(2)} s`;let d=r/60;return d<60?`${d.toFixed(2)} m`:`${(d/60).toFixed(2)} h`}};e.\u0275fac=function(r){return new(r||e)},e.\u0275pipe=f({name:"duration",type:e,pure:!0});let t=e;return t})(),z=(()=>{let e=class e{transform(o){return o?o.replace(/\r?\n/g,", "):""}};e.\u0275fac=function(r){return new(r||e)},e.\u0275pipe=f({name:"newlineToComma",type:e,pure:!0});let t=e;return t})(),ne=(()=>{let e=class e{constructor(){this.route=h(H),this.httpService=h(F),this.orderDetails$=y([])}ngOnInit(){this.initOrderDetails()}initOrderDetails(){let o=this.route.snapshot?.queryParams;this.orderDetails$=this.httpService.post("/api/Orders/DownloadOrderLogsDetail",{ID:o.ID}).pipe(v(r=>{let d=r?.hits[0]?._source;this.headerTitle=`${d?.ChannelName} (${d?.DateRange})`}),S(r=>r?.hits[0]._source?.Detail),D(1))}};e.\u0275fac=function(r){return new(r||e)},e.\u0275cmp=E({type:e,selectors:[["app-download-order-detail"]],decls:11,vars:7,consts:[[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/order/log",1,"btn","btn-secondary","btn-fill","btn-lg","me-2"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table","table-hover"],[1,"table-light"],[2,"width","200px"],[2,"width","250px"],[2,"width","100px"]],template:function(r,d){if(r&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),a(3,"Back"),n()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4),C(8,j,20,2,"div",5),c(9,"async"),w(10,U,2,0,"div",6),n()()()()()),r&2){let u;B("headerTitle",d.headerTitle)("description",d.headerTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),l(8),b(((u=s(9,5,d.orderDetails$))==null?null:u.length)>0?8:10)}},dependencies:[R,A,L,k,P,$,I,q,z],encapsulation:2});let t=e;return t})();export{ne as DownloadOrderDetailComponent,q as DurationPipe,z as NewlineToCommaPipe};
|