marketplacepos 5.41.5 → 5.41.6
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-VGEOTRB7.js → chunk-25HVJVYO.js} +1 -1
- package/Marketplace/{chunk-JPIOBYM7.js → chunk-34CTATL6.js} +1 -1
- package/Marketplace/{chunk-FBBW443I.js → chunk-3OD47PUU.js} +1 -1
- package/Marketplace/{chunk-PYD2QHHH.js → chunk-5KHDEW35.js} +1 -1
- package/Marketplace/{chunk-YCPKCFMZ.js → chunk-73OLUI2Z.js} +1 -1
- package/Marketplace/{chunk-WKHHCF3P.js → chunk-743EWFUY.js} +1 -1
- package/Marketplace/{chunk-BTYHZ3BG.js → chunk-AB3DHTC7.js} +1 -1
- package/Marketplace/{chunk-U2V4KOQS.js → chunk-ACV6YALZ.js} +1 -1
- package/Marketplace/{chunk-J4K6QW3J.js → chunk-BB5SMGW7.js} +1 -1
- package/Marketplace/{chunk-BFYBCKXD.js → chunk-CTUXL543.js} +1 -1
- package/Marketplace/{chunk-HDF7PEIR.js → chunk-DFRA5ORA.js} +1 -1
- package/Marketplace/{chunk-5DX5OS45.js → chunk-F2X5N2W5.js} +2 -2
- package/Marketplace/{chunk-E2FP3UH3.js → chunk-FJVZ33X4.js} +1 -1
- package/Marketplace/{chunk-CCX62ZEW.js → chunk-HUEPKUQW.js} +1 -1
- package/Marketplace/{chunk-72DJCVV6.js → chunk-HW3FX455.js} +1 -1
- package/Marketplace/{chunk-FMUQPVVH.js → chunk-I4QWUPXR.js} +1 -1
- package/Marketplace/{chunk-67JBJ45X.js → chunk-IHYEQWAY.js} +1 -1
- package/Marketplace/{chunk-VQ4QGCSU.js → chunk-IIBM2V3E.js} +1 -1
- package/Marketplace/{chunk-CGVOFFIH.js → chunk-IINERY5O.js} +1 -1
- package/Marketplace/{chunk-64MZV5WU.js → chunk-JB6W72VA.js} +1 -1
- package/Marketplace/{chunk-JNXB7GCX.js → chunk-LNXJNBJQ.js} +1 -1
- package/Marketplace/{chunk-W7OL4JR7.js → chunk-LQZTRBOB.js} +1 -1
- package/Marketplace/{chunk-56WGJNPW.js → chunk-NTGWFIOH.js} +1 -1
- package/Marketplace/{chunk-HGCZ7LIZ.js → chunk-OHN3VXQV.js} +1 -1
- package/Marketplace/{chunk-5LUTNBYZ.js → chunk-OIZORVCZ.js} +1 -1
- package/Marketplace/{chunk-MZBZH6JP.js → chunk-OOKURHR4.js} +1 -1
- package/Marketplace/{chunk-NN2JDRQD.js → chunk-OQNYXG6U.js} +1 -1
- package/Marketplace/{chunk-CNL3HZIH.js → chunk-PV6JAW7E.js} +1 -1
- package/Marketplace/{chunk-HIY3ODHB.js → chunk-PWJ2Z5EH.js} +2 -2
- package/Marketplace/{chunk-QJIMFZTN.js → chunk-SUC77PQU.js} +1 -1
- package/Marketplace/{chunk-LIWNKZGW.js → chunk-T6Q5SGJG.js} +1 -1
- package/Marketplace/{chunk-A5LJ5SMN.js → chunk-UQVGVHST.js} +1 -1
- package/Marketplace/{chunk-2BV355IK.js → chunk-YJ6KE7ER.js} +1 -1
- package/Marketplace/{chunk-QQJN7OGE.js → chunk-Z2PI4IS6.js} +1 -1
- package/Marketplace/{chunk-6ZUAJPGL.js → chunk-ZOVPSET6.js} +1 -1
- package/Marketplace/{chunk-2VSUESZZ.js → chunk-ZSHPWPPL.js} +1 -1
- package/Marketplace/{chunk-PGHURUHZ.js → chunk-ZTQGQXIT.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-UY5LIWLP.js → main-36VYJM2O.js} +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as je,b as Ke}from"./chunk-5GX2GLRY.js";import"./chunk-JBKHY4HH.js";import{a as Ae,b as $e,c as ze,e as Ye,f as Ue,g as Ge}from"./chunk-IYYVZ6B6.js";import"./chunk-RVYGL22E.js";import"./chunk-6XFYITUD.js";import{i as Ne,j as We,k as Re,l as Be,m as Le}from"./chunk-75BDXSG3.js";import"./chunk-D54NUPYF.js";import{a as Oe}from"./chunk-EGTYAIU5.js";import"./chunk-6ALHX2I4.js";import"./chunk-4G3QN54S.js";import{a as Ve,b as Fe,c as ke}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import"./chunk-MNFHFW3E.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-Q2OEJFVT.js";import{c as De,d as Te,e as be}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as Z,l as ee}from"./chunk-67JBJ45X.js";import{b as ye,e as xe}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as Ie,n as Me}from"./chunk-ITTRZMEX.js";import{r as Ee,s as Pe}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as we,h as Ce,m as Se,y as ve}from"./chunk-DPLEMBB4.js";import{b as X,c as x}from"./chunk-PXB4YEY3.js";import{J as ge,d as R,f as B,g as L,j as q,k as J,n as F}from"./chunk-GPEVUTDI.js";import{$c as _e,Ac as he,Dc as T,Eb as I,Ec as l,Fc as V,Gc as S,Ic as b,Jc as E,Ka as j,Kb as g,Kc as P,Na as k,Oc as K,Qa as _,Qc as ue,Rc as fe,Wb as d,Z as z,Zc as W,_c as U,aa as oe,ad as H,bc as M,ea as Y,gc as r,hc as a,ic as C,ja as le,jc as O,kc as N,m as re,mc as y,ob as pe,pa as v,qb as o,qd as Q,rc as w,sc as h,v as G,vc as se,wc as de,ya as m,yc as me,za as c,zc as ce}from"./chunk-T5ONJF63.js";import{a as ne,b as ae}from"./chunk-K2H6WANG.js";var Je=t=>({"over-due":t});function Xe(t,s){if(t&1&&(r(0,"tr",8)(1,"td"),l(2),a(),r(3,"td"),l(4),a(),r(5,"td"),l(6),a(),r(7,"td"),l(8),a()()),t&2){let e=s.$implicit,n=s.index;d("ngClass",ue(5,Je,e.Exception)),o(2),V(n+1),o(2),V(e.Number),o(2),V(e.Status),o(2),V(e.Exception)}}function Ze(t,s){if(t&1&&(O(0),g(1,Xe,9,7,"tr",7),N()),t&2){let e,n=h();o(),d("ngForOf",(e=n.downloadResult())==null?null:e.Body)}}function et(t,s){t&1&&(r(0,"tr",9)(1,"td",10)(2,"div",11),C(3,"i",12),a(),r(4,"h4",13),l(5," There is no order to processed "),a()()())}var He=(()=>{class t{constructor(){this.downloadResult=k()}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:16,vars:2,consts:[["EMPTY_DOWNLOAD",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[4,"ngIf","ngIfElse"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(r(0,"div",1)(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr"),C(5,"th",5),r(6,"th"),l(7,"Order Number"),a(),r(8,"th"),l(9,"Status"),a(),r(10,"th"),l(11,"Exception"),a()()(),r(12,"tbody"),g(13,Ze,2,1,"ng-container",6)(14,et,6,0,"ng-template",null,0,H),a()()()()),n&2){let p,u=T(15);o(13),d("ngIf",((p=i.downloadResult())==null||p.Body==null?null:p.Body.length)>0)("ngIfElse",u)}},dependencies:[F,R,B,L],encapsulation:2})}}return t})();var A=(()=>{class t{constructor(){this.httpService=v(xe),this.toastr=v(ye),this.datePipe=v(J)}gerChannelDetailById(e){return this.httpService.post(Z.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(Z.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(Z.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(Y(n=>{n.Data?.length===0&&this.toastrEmptyPreview(e)})):re}toastrEmptyPreview(e){let n=this.datePipe.transform(e.From,"dd MMM yyyy"),i=this.datePipe.transform(e.To,"dd MMM yyyy"),p=e.TimeFrom?e.TimeFrom:"",u=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${p} to ${i} ${u}!`,"No Orders!")}validateDatePreview(e){let n=!0;return e.downloadType==!0?x.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):x.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(e,n){let i=x.formatTitleFromDate(new Date(e),new Date(n)),p=this.datePipe.transform(e,i),u=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":p+"-"} ${u}`}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac})}}return t})();function tt(t,s){if(t&1&&(r(0,"ng-option",13),C(1,"img",14),l(2),a()),t&2){let e=s.$implicit;d("value",e.ID),o(),d("src",e==null?null:e.Img,pe),o(),S("",e.Name," ")}}function it(t,s){if(t&1){let e=y();r(0,"div",8)(1,"div",4)(2,"h5"),l(3,"Type"),a(),r(4,"p",5),l(5,"Select Type want to download"),a()(),r(6,"div",4)(7,"div",15)(8,"div")(9,"mat-radio-group",16),P("ngModelChange",function(i){m(e);let p=h();return E(p.downloadType,i)||(p.downloadType=i),c(i)}),w("ngModelChange",function(){m(e);let i=h();return c(i.onDownloadTypeChange())}),r(10,"mat-radio-button",17),l(11," Orders "),a(),r(12,"mat-radio-button",18),l(13," Disbursement "),a()()()(),r(14,"div",19)(15,"div",20),C(16,"i",21),a(),r(17,"p",22),l(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(t&2){let e=h();o(9),b("ngModel",e.downloadType),o(),d("value",!1),o(2),d("value",!0)}}function nt(t,s){t&1&&(r(0,"p",5),l(1," Select Disbursement date "),r(2,"span",23),l(3,"(payment date / order complete date)"),a(),l(4," of the channel you want to download (Max 1 Week). "),a())}function at(t,s){t&1&&(r(0,"p",5),l(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function rt(t,s){if(t&1){let e=y();r(0,"div",12)(1,"app-timepicker",24),P("timeChange",function(i){m(e);let p=h();return E(p.startTime,i)||(p.startTime=i),c(i)}),w("timeChange",function(){m(e);let i=h();return c(i.onStartTimeChange())}),a(),r(2,"span",25),l(3,"-"),a(),r(4,"app-timepicker",24),P("timeChange",function(i){m(e);let p=h();return E(p.endTime,i)||(p.endTime=i),c(i)}),w("timeChange",function(){m(e);let i=h();return c(i.onEndTimeChange())}),a()()}if(t&2){let e=h();o(),b("time",e.startTime),o(3),b("time",e.endTime)}}var Qe=(()=>{class t{constructor(){this.reset=k(!1),this.authService=v(ee),this.downloadService=v(A),this.downloadType=_(!1),this.selectedChannelId=_(null),this.channelOptions=_(this.authService.getChannels()),this.channelType=X,this.selectedChannel=_(null),this.showTimePicker=_(!1),this.startDate=_(null),this.endDate=_(null),this.startTime=_("00:00"),this.endTime=_("23:59"),this.filterData=new j,Q(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0})}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(G(e=>e?.Model),z(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=x.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange"},features:[K([A])],decls:27,vars:11,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"mt-8"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let p=y();r(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),l(5,"Select a Channel"),a(),r(6,"p",5),l(7,"Select Channel want to download order"),a()(),r(8,"div",4)(9,"ng-select",6),P("ngModelChange",function(f){return m(p),E(i.selectedChannelId,f)||(i.selectedChannelId=f),c(f)}),w("ngModelChange",function(){return m(p),c(i.onSelectChannel())}),g(10,tt,3,3,"ng-option",7),a()()(),g(11,it,19,3,"div",8),W(12,"async"),r(13,"div",8)(14,"div",4)(15,"h5"),l(16,"Date Range"),a(),g(17,nt,5,0,"p",5)(18,at,2,0,"p",5),a(),r(19,"div",4)(20,"div",2)(21,"mat-date-range-input",9)(22,"input",10),P("ngModelChange",function(f){return m(p),E(i.startDate,f)||(i.startDate=f),c(f)}),w("click",function(){m(p);let f=T(25);return c(f.open())}),a(),r(23,"input",11),P("ngModelChange",function(f){return m(p),E(i.endDate,f)||(i.endDate=f),c(f)}),w("click",function(){m(p);let f=T(25);return c(f.open())})("ngModelChange",function(){return m(p),c(i.onFilterDateChange())}),a()(),C(24,"mat-date-range-picker",null,0),a(),g(26,rt,5,2,"div",12),a()()()()}if(n&2){let p,u,f=T(25);o(9),d("clearable",!1),b("ngModel",i.selectedChannelId),o(),d("ngForOf",i.channelOptions()),o(),M((p=U(12,9,i.channelDetail$))!=null&&p.ServiceFeeWriteOff&&((p=i.selectedChannel())==null?null:p.TypeID)==i.channelType.Tokopedia?11:-1),o(6),M(i.downloadType()&&((u=i.selectedChannel())==null?null:u.TypeID)==i.channelType.Tokopedia?17:18),o(4),d("rangePicker",f),o(),b("ngModel",i.startDate),o(),b("ngModel",i.endDate),o(3),M(i.showTimePicker()?26:-1)}},dependencies:[F,B,q,be,Te,De,ke,Ve,Fe,ve,we,Ce,Se,Ke,Be,Ne,Le,We,Re],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]})}}return t})();var D=function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t}(D||{});var $=function(t){return t[t.DoNothing=0]="DoNothing",t[t.New=1]="New",t[t.Update=2]="Update",t}($||{});var ot=(t,s)=>({"over-due-today":t,"over-due":s});function lt(t,s){if(t&1&&(r(0,"th",21),l(1),a()),t&2){let e=h();o(),S(" ",e.selectedChannel()?"Created Date":"Last Status Update"," ")}}function pt(t,s){if(t&1&&(r(0,"td"),l(1),W(2,"date"),a()),t&2){let e=h().$implicit;o(),S(" ",_e(2,1,e.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function st(t,s){if(t&1&&(r(0,"span"),l(1),a()),t&2){let e=h().$implicit;o(),S(" ",e.ActionString," ")}}function dt(t,s){if(t&1&&(r(0,"li"),l(1),a()),t&2){let e=s.$implicit;o(),S(" ",e," ")}}function mt(t,s){if(t&1&&(r(0,"ul",27),g(1,dt,2,1,"li",22),a()),t&2){let e=h().$implicit;o(),d("ngForOf",e.ActionString)}}function ct(t,s){if(t&1&&(r(0,"span",28),C(1,"i",29),a()),t&2){let e=h().$implicit;de("title","Delivery : ",e.DeliveryState,`
|
|
1
|
+
import{a as je,b as Ke}from"./chunk-5GX2GLRY.js";import"./chunk-JBKHY4HH.js";import{a as Ae,b as $e,c as ze,e as Ye,f as Ue,g as Ge}from"./chunk-IYYVZ6B6.js";import"./chunk-RVYGL22E.js";import"./chunk-6XFYITUD.js";import{i as Ne,j as We,k as Re,l as Be,m as Le}from"./chunk-75BDXSG3.js";import"./chunk-D54NUPYF.js";import{a as Oe}from"./chunk-EGTYAIU5.js";import"./chunk-6ALHX2I4.js";import"./chunk-4G3QN54S.js";import{a as Ve,b as Fe,c as ke}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import"./chunk-MNFHFW3E.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-Q2OEJFVT.js";import{c as De,d as Te,e as be}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as Z,l as ee}from"./chunk-IHYEQWAY.js";import{b as ye,e as xe}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as Ie,n as Me}from"./chunk-ITTRZMEX.js";import{r as Ee,s as Pe}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{c as we,h as Ce,m as Se,y as ve}from"./chunk-DPLEMBB4.js";import{b as X,c as x}from"./chunk-PXB4YEY3.js";import{J as ge,d as R,f as B,g as L,j as q,k as J,n as F}from"./chunk-GPEVUTDI.js";import{$c as _e,Ac as he,Dc as T,Eb as I,Ec as l,Fc as V,Gc as S,Ic as b,Jc as E,Ka as j,Kb as g,Kc as P,Na as k,Oc as K,Qa as _,Qc as ue,Rc as fe,Wb as d,Z as z,Zc as W,_c as U,aa as oe,ad as H,bc as M,ea as Y,gc as r,hc as a,ic as C,ja as le,jc as O,kc as N,m as re,mc as y,ob as pe,pa as v,qb as o,qd as Q,rc as w,sc as h,v as G,vc as se,wc as de,ya as m,yc as me,za as c,zc as ce}from"./chunk-T5ONJF63.js";import{a as ne,b as ae}from"./chunk-K2H6WANG.js";var Je=t=>({"over-due":t});function Xe(t,s){if(t&1&&(r(0,"tr",8)(1,"td"),l(2),a(),r(3,"td"),l(4),a(),r(5,"td"),l(6),a(),r(7,"td"),l(8),a()()),t&2){let e=s.$implicit,n=s.index;d("ngClass",ue(5,Je,e.Exception)),o(2),V(n+1),o(2),V(e.Number),o(2),V(e.Status),o(2),V(e.Exception)}}function Ze(t,s){if(t&1&&(O(0),g(1,Xe,9,7,"tr",7),N()),t&2){let e,n=h();o(),d("ngForOf",(e=n.downloadResult())==null?null:e.Body)}}function et(t,s){t&1&&(r(0,"tr",9)(1,"td",10)(2,"div",11),C(3,"i",12),a(),r(4,"h4",13),l(5," There is no order to processed "),a()()())}var He=(()=>{class t{constructor(){this.downloadResult=k()}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:16,vars:2,consts:[["EMPTY_DOWNLOAD",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[4,"ngIf","ngIfElse"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(r(0,"div",1)(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr"),C(5,"th",5),r(6,"th"),l(7,"Order Number"),a(),r(8,"th"),l(9,"Status"),a(),r(10,"th"),l(11,"Exception"),a()()(),r(12,"tbody"),g(13,Ze,2,1,"ng-container",6)(14,et,6,0,"ng-template",null,0,H),a()()()()),n&2){let p,u=T(15);o(13),d("ngIf",((p=i.downloadResult())==null||p.Body==null?null:p.Body.length)>0)("ngIfElse",u)}},dependencies:[F,R,B,L],encapsulation:2})}}return t})();var A=(()=>{class t{constructor(){this.httpService=v(xe),this.toastr=v(ye),this.datePipe=v(J)}gerChannelDetailById(e){return this.httpService.post(Z.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(Z.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(Z.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(Y(n=>{n.Data?.length===0&&this.toastrEmptyPreview(e)})):re}toastrEmptyPreview(e){let n=this.datePipe.transform(e.From,"dd MMM yyyy"),i=this.datePipe.transform(e.To,"dd MMM yyyy"),p=e.TimeFrom?e.TimeFrom:"",u=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${p} to ${i} ${u}!`,"No Orders!")}validateDatePreview(e){let n=!0;return e.downloadType==!0?x.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):x.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(e,n){let i=x.formatTitleFromDate(new Date(e),new Date(n)),p=this.datePipe.transform(e,i),u=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":p+"-"} ${u}`}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac})}}return t})();function tt(t,s){if(t&1&&(r(0,"ng-option",13),C(1,"img",14),l(2),a()),t&2){let e=s.$implicit;d("value",e.ID),o(),d("src",e==null?null:e.Img,pe),o(),S("",e.Name," ")}}function it(t,s){if(t&1){let e=y();r(0,"div",8)(1,"div",4)(2,"h5"),l(3,"Type"),a(),r(4,"p",5),l(5,"Select Type want to download"),a()(),r(6,"div",4)(7,"div",15)(8,"div")(9,"mat-radio-group",16),P("ngModelChange",function(i){m(e);let p=h();return E(p.downloadType,i)||(p.downloadType=i),c(i)}),w("ngModelChange",function(){m(e);let i=h();return c(i.onDownloadTypeChange())}),r(10,"mat-radio-button",17),l(11," Orders "),a(),r(12,"mat-radio-button",18),l(13," Disbursement "),a()()()(),r(14,"div",19)(15,"div",20),C(16,"i",21),a(),r(17,"p",22),l(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(t&2){let e=h();o(9),b("ngModel",e.downloadType),o(),d("value",!1),o(2),d("value",!0)}}function nt(t,s){t&1&&(r(0,"p",5),l(1," Select Disbursement date "),r(2,"span",23),l(3,"(payment date / order complete date)"),a(),l(4," of the channel you want to download (Max 1 Week). "),a())}function at(t,s){t&1&&(r(0,"p",5),l(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function rt(t,s){if(t&1){let e=y();r(0,"div",12)(1,"app-timepicker",24),P("timeChange",function(i){m(e);let p=h();return E(p.startTime,i)||(p.startTime=i),c(i)}),w("timeChange",function(){m(e);let i=h();return c(i.onStartTimeChange())}),a(),r(2,"span",25),l(3,"-"),a(),r(4,"app-timepicker",24),P("timeChange",function(i){m(e);let p=h();return E(p.endTime,i)||(p.endTime=i),c(i)}),w("timeChange",function(){m(e);let i=h();return c(i.onEndTimeChange())}),a()()}if(t&2){let e=h();o(),b("time",e.startTime),o(3),b("time",e.endTime)}}var Qe=(()=>{class t{constructor(){this.reset=k(!1),this.authService=v(ee),this.downloadService=v(A),this.downloadType=_(!1),this.selectedChannelId=_(null),this.channelOptions=_(this.authService.getChannels()),this.channelType=X,this.selectedChannel=_(null),this.showTimePicker=_(!1),this.startDate=_(null),this.endDate=_(null),this.startTime=_("00:00"),this.endTime=_("23:59"),this.filterData=new j,Q(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0})}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(G(e=>e?.Model),z(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=x.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange"},features:[K([A])],decls:27,vars:11,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"mt-8"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let p=y();r(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),l(5,"Select a Channel"),a(),r(6,"p",5),l(7,"Select Channel want to download order"),a()(),r(8,"div",4)(9,"ng-select",6),P("ngModelChange",function(f){return m(p),E(i.selectedChannelId,f)||(i.selectedChannelId=f),c(f)}),w("ngModelChange",function(){return m(p),c(i.onSelectChannel())}),g(10,tt,3,3,"ng-option",7),a()()(),g(11,it,19,3,"div",8),W(12,"async"),r(13,"div",8)(14,"div",4)(15,"h5"),l(16,"Date Range"),a(),g(17,nt,5,0,"p",5)(18,at,2,0,"p",5),a(),r(19,"div",4)(20,"div",2)(21,"mat-date-range-input",9)(22,"input",10),P("ngModelChange",function(f){return m(p),E(i.startDate,f)||(i.startDate=f),c(f)}),w("click",function(){m(p);let f=T(25);return c(f.open())}),a(),r(23,"input",11),P("ngModelChange",function(f){return m(p),E(i.endDate,f)||(i.endDate=f),c(f)}),w("click",function(){m(p);let f=T(25);return c(f.open())})("ngModelChange",function(){return m(p),c(i.onFilterDateChange())}),a()(),C(24,"mat-date-range-picker",null,0),a(),g(26,rt,5,2,"div",12),a()()()()}if(n&2){let p,u,f=T(25);o(9),d("clearable",!1),b("ngModel",i.selectedChannelId),o(),d("ngForOf",i.channelOptions()),o(),M((p=U(12,9,i.channelDetail$))!=null&&p.ServiceFeeWriteOff&&((p=i.selectedChannel())==null?null:p.TypeID)==i.channelType.Tokopedia?11:-1),o(6),M(i.downloadType()&&((u=i.selectedChannel())==null?null:u.TypeID)==i.channelType.Tokopedia?17:18),o(4),d("rangePicker",f),o(),b("ngModel",i.startDate),o(),b("ngModel",i.endDate),o(3),M(i.showTimePicker()?26:-1)}},dependencies:[F,B,q,be,Te,De,ke,Ve,Fe,ve,we,Ce,Se,Ke,Be,Ne,Le,We,Re],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]})}}return t})();var D=function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t}(D||{});var $=function(t){return t[t.DoNothing=0]="DoNothing",t[t.New=1]="New",t[t.Update=2]="Update",t}($||{});var ot=(t,s)=>({"over-due-today":t,"over-due":s});function lt(t,s){if(t&1&&(r(0,"th",21),l(1),a()),t&2){let e=h();o(),S(" ",e.selectedChannel()?"Created Date":"Last Status Update"," ")}}function pt(t,s){if(t&1&&(r(0,"td"),l(1),W(2,"date"),a()),t&2){let e=h().$implicit;o(),S(" ",_e(2,1,e.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function st(t,s){if(t&1&&(r(0,"span"),l(1),a()),t&2){let e=h().$implicit;o(),S(" ",e.ActionString," ")}}function dt(t,s){if(t&1&&(r(0,"li"),l(1),a()),t&2){let e=s.$implicit;o(),S(" ",e," ")}}function mt(t,s){if(t&1&&(r(0,"ul",27),g(1,dt,2,1,"li",22),a()),t&2){let e=h().$implicit;o(),d("ngForOf",e.ActionString)}}function ct(t,s){if(t&1&&(r(0,"span",28),C(1,"i",29),a()),t&2){let e=h().$implicit;de("title","Delivery : ",e.DeliveryState,`
|
|
2
2
|
Payment : `,e.PaymentState,"")}}function ht(t,s){if(t&1&&(r(0,"tr")(1,"td"),l(2),a(),r(3,"td"),l(4),a(),g(5,pt,3,4,"td",23),r(6,"td")(7,"span"),l(8),a(),l(9),a(),r(10,"td",24)(11,"span"),l(12),a(),l(13),a(),r(14,"td"),g(15,st,2,1,"span",23)(16,mt,2,1,"ul",25),a(),r(17,"td"),g(18,ct,2,3,"span",26),a()()),t&2){let e,n=s.$implicit,i=s.index,p=h(2);o(2),V(i+1),o(2),V(n.Number),o(),d("ngIf",((e=p.selectedChannel())==null?null:e.TypeID)!=p.channelType.Shopee&&((e=p.selectedChannel())==null?null:e.TypeID)!==p.channelType.Tiktok),o(3),S("",n.ChannelStatus," - "),o(),S("",n.ChannelStatusDescription," "),o(),d("ngClass",fe(12,ot,(n==null?null:n.Action)==p.actionPreviewOrder.Update,(n==null?null:n.Action)==p.actionPreviewOrder.New))("matTooltip",n.POSStatus==91||n.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),o(2),S("",n.POSStatus," - "),o(),S("",n.POSStatusDescription," "),o(2),d("ngIf",n.ActionString.length==1),o(),d("ngIf",n.ActionString.length>1),o(2),d("ngIf",n.ChannelStatus!=99&&n.POSStatus!=99)}}function ut(t,s){if(t&1&&(O(0),g(1,ht,19,15,"tr",22),N()),t&2){let e=h();o(),d("ngForOf",e.displayPreviewData())}}function ft(t,s){t&1&&(r(0,"tr",30)(1,"td",31)(2,"div",32),C(3,"i",33),a(),r(4,"h4",34),l(5," There is no order to processed "),a()()())}var qe=(()=>{class t{constructor(){this.orderPreview=k(),this.selectedChannel=k(),this.channelType=X,this.allData=_(0),this.syncData=_(0),this.wrongData=_(0),this.unsyncData=_(0),this.pillStatus=_(D.ALL),this.actionPreviewOrder=$,this.previewStatus=D,this.displayPreviewData=_([]),this.exportOrders=new j,Q(()=>{this.orderPreview()&&(this.filterPreviewData(D.ALL),this.initLengthStatusData())},{allowSignalWrites:!0})}filterPreviewData(e){this.pillStatus.update(()=>e),this.displayPreviewData.update(()=>this.filterDataByStatus(e))}initLengthStatusData(){this.wrongData.update(()=>this.filterDataByStatus(D.WRONG).length),this.syncData.update(()=>this.filterDataByStatus(D.SYNC).length),this.allData.update(()=>this.orderPreview().length),this.unsyncData.update(()=>this.filterDataByStatus(D.UNSYNC).length)}filterDataByStatus(e){let n=[];switch(e){case D.ALL:n=this.orderPreview();break;case D.SYNC:n=this.orderPreview().filter(i=>i.Action==$.DoNothing);break;case D.WRONG:n=this.orderPreview().filter(i=>i.Action==$.Update);break;case D.UNSYNC:n=this.orderPreview().filter(i=>i.Action==$.New);break}return n}onExportOrders(){this.exportOrders.emit()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["preview-step"]],inputs:{orderPreview:[1,"orderPreview"],selectedChannel:[1,"selectedChannel"]},outputs:{exportOrders:"onExportOrders"},decls:41,vars:11,consts:[["EMPTY",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"col-12","d-flex","justify-content-between","align-items-end",2,"padding-left","0px","padding-right","0px"],[1,"nav","nav-pills"],[1,"nav-item","me-3"],[1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],[1,"nav-item","mx-3"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["width","15%"],[4,"ngFor","ngForOf"],[4,"ngIf"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1){let p=y();r(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div")(5,"ul",5)(6,"li",6)(7,"button",7),w("click",function(){return m(p),c(i.filterPreviewData(i.previewStatus.ALL))}),l(8),a()(),r(9,"li",8)(10,"button",9),w("click",function(){return m(p),c(i.filterPreviewData(i.previewStatus.SYNC))}),l(11),a()(),r(12,"li",8)(13,"button",10),w("click",function(){return m(p),c(i.filterPreviewData(i.previewStatus.WRONG))}),l(14),a()(),r(15,"li",8)(16,"button",11),w("click",function(){return m(p),c(i.filterPreviewData(i.previewStatus.UNSYNC))}),l(17),a()()()(),r(18,"div")(19,"button",12),w("click",function(){return m(p),c(i.onExportOrders())}),C(20,"i",13),r(21,"span"),l(22,"Export"),a()()()()(),r(23,"table",14)(24,"thead",15)(25,"tr"),C(26,"th",16),r(27,"th",17),l(28,"Number"),a(),g(29,lt,2,1,"th",18),r(30,"th",19),l(31,"Channel Status"),a(),r(32,"th",19),l(33,"POS Status"),a(),r(34,"th"),l(35,"Action"),a(),C(36,"th",16),a()(),r(37,"tbody"),g(38,ut,2,1,"ng-container",20)(39,ft,6,0,"ng-template",null,0,H),a()()()()}if(n&2){let p,u,f=T(40);o(7),d("ngClass",i.pillStatus()=="all"?"btn-secondary text-white":"btn-outline-dark"),o(),S(" All (",i.allData(),") "),o(2),d("ngClass",i.pillStatus()=="sync"?"btn-success":"btn-outline-success"),o(),S(" Existing (",i.syncData(),") "),o(2),d("ngClass",i.pillStatus()=="wrong"?"btn-warning text-white":"btn-outline-warning"),o(),S(" Wrong Status (",i.wrongData(),") "),o(2),d("ngClass",i.pillStatus()=="unsync"?"btn-danger":"btn-outline-danger"),o(),S(" Missing (",i.unsyncData(),") "),o(12),d("ngIf",((p=i.selectedChannel())==null?null:p.TypeID)!=i.channelType.Shopee&&((p=i.selectedChannel())==null?null:p.TypeID)!==i.channelType.Tiktok),o(9),d("ngIf",((u=i.displayPreviewData())==null?null:u.length)>0)("ngIfElse",f)}},dependencies:[F,R,B,L,J,Pe,Ee],encapsulation:2})}}return t})();var _t=["stepper"];function gt(t,s){if(t&1){let e=y();r(0,"div",2)(1,"button",19),w("click",function(){m(e);let i=h();return c(i.onStepperBack())}),l(2," Back "),a(),r(3,"button",20),w("click",function(){m(e);let i=h();return c(i.onNextStep())}),l(4," Next "),a()()}if(t&2){let e=h();o(3),d("disabled",e.disabledNextFilter())}}function wt(t,s){if(t&1){let e=y();r(0,"button",21),w("click",function(){m(e);let i=h();return c(i.onNextStep())}),l(1," Next "),a()}if(t&2){let e=h();d("disabled",e.disabledNextFilter())}}function Ct(t,s){if(t&1){let e=y();r(0,"button",22),w("click",function(){m(e);let i=h();return c(i.onNewDownload())}),C(1,"i",23),l(2," New "),a()}}function St(t,s){t&1&&(C(0,"i",24),r(1,"span"),l(2,"Filter"),a())}function vt(t,s){t&1&&(C(0,"i",25),r(1,"span"),l(2,"Preview"),a())}function yt(t,s){if(t&1){let e=y();O(0),r(1,"preview-step",26),w("onExportOrders",function(){m(e);let i=h();return c(i.onExportOrders())}),a(),N()}if(t&2){let e=s.ngIf;o(),d("orderPreview",e)}}function xt(t,s){t&1&&(C(0,"i",27),r(1,"span"),l(2,"Finish"),a())}function Dt(t,s){if(t&1&&(O(0),C(1,"complete-step",28),N()),t&2){let e=s.ngIf;o(),d("downloadResult",e)}}function Tt(t,s){t&1&&(r(0,"h6"),l(1,"1"),a())}function bt(t,s){t&1&&(r(0,"h6"),l(1,"2"),a())}function Et(t,s){t&1&&(r(0,"h6"),l(1,"3"),a())}var Li=(()=>{class t{constructor(){this.downloadService=v(A),this.orderService=v(je),this.productService=v(Oe),this.authService=v(ee),this.stepperSelectedIndex=_(0),this.disabledNextFilter=_(!0),this.isResetFilter=_(!1),this.pageTitle=_("Download to POS"),this.cacheKey=_(x.GuidEMpty)}onFilterChange(e){this.filter=e,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 e=this.productService.findChannelById(this.filter.channelId,this.authService.getChannels());this.setPageTitle(`Preview ${e?.Name}`);break;case 1:this.onDownload(),this.setPageTitle("Download");break}}onStepperNext(){this.stepper.selected.completed=!0,this.stepper.next()}onPreview(){let e={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,IsDisbursement:this.filter.downloadType};x.IsNotEmpty(this.filter.startTime)&&(e=ae(ne({},e),{TimeFrom:this.filter.startTime+":00",TimeTo:this.filter.endTime+":00"})),this.orderPreview$=this.downloadService.onPreviewOrder(e).pipe(Y(n=>{n.Data?.length>0&&(this.cacheKey.update(()=>n.CacheKey),this.onStepperNext())}),G(n=>n.Data),z(1))}onExportOrders(){let e={ID:this.filter.channelId,From:this.filter.startDate?this.filter.startDate:null,To:this.filter.endDate?this.filter.endDate:null},n=`Orders ${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)}`;this.orderService.exportOrders(e,n).subscribe()}onDownload(){let e={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,ListPreview:[],IsDisbursement:this.filter.downloadType,CacheKey:this.cacheKey()};this.downloadPreview$=this.orderPreview$.pipe(oe(n=>(e.ListPreview=n,this.downloadService.getDownloadOrder(e))),Y(()=>{this.onStepperNext()}),z(1))}setPageTitle(e){this.pageTitle.update(()=>`
|
|
3
3
|
${e} (${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)})
|
|
4
4
|
`)}onStepperBack(){this.stepper.previous(),this.pageTitle.update(()=>"Download to POS")}onNewDownload(){this.isResetFilter.update(()=>!0),this.stepper.reset(),this.stepperSelectedIndex.update(()=>0),this.orderPreview$=null,this.downloadPreview$=null,this.pageTitle.update(()=>"Download to POS")}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["app-download-v2"]],viewQuery:function(n,i){if(n&1&&me(_t,5),n&2){let p;ce(p=he())&&(i.stepper=p.first)}},features:[K([A,{provide:Ae,useValue:{displayDefaultIndicatorType:!1}}])],decls:26,vars:20,consts:[["stepper",""],[3,"hideSearchBox","hideSearchDropdown","headerTitle","description"],[1,"btn-group","me-3"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"disabled"],[1,"btn","btn-outline-secondary","btn-fill"],[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","reset"],["state","preview",3,"editable","completed"],[4,"ngIf"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","bg-success","text-white",3,"click","disabled"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"click","disabled"],[1,"btn","btn-outline-secondary","btn-fill",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[1,"fa-solid","fa-filter","me-3"],[1,"fa-solid","fa-file","me-3"],[3,"onExportOrders","orderPreview"],[1,"fa-solid","fa-flag","me-3"],[3,"downloadResult"]],template:function(n,i){if(n&1){let p=y();r(0,"mainpanel",1)(1,"actions"),g(2,gt,5,1,"div",2)(3,wt,2,1,"button",3)(4,Ct,3,0,"button",4),a(),r(5,"content")(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8)(10,"mat-stepper",9,0),P("selectedIndexChange",function(f){return m(p),E(i.stepperSelectedIndex,f)||(i.stepperSelectedIndex=f),c(f)}),r(12,"mat-step",10),g(13,St,3,0,"ng-template",11),r(14,"filter-step",12),w("onFilterChange",function(f){return m(p),c(i.onFilterChange(f))}),a()(),r(15,"mat-step",13),g(16,vt,3,0,"ng-template",11)(17,yt,2,1,"ng-container",14),W(18,"async"),a(),r(19,"mat-step",15),g(20,xt,3,0,"ng-template",11)(21,Dt,2,1,"ng-container",14),W(22,"async"),a(),g(23,Tt,2,0,"ng-template",16)(24,bt,2,0,"ng-template",17)(25,Et,2,0,"ng-template",18),a()()()()()()()}if(n&2){let p=T(11);d("hideSearchBox",!0)("hideSearchDropdown",!0)("headerTitle",i.pageTitle())("description",i.pageTitle()),o(2),M(i.stepperSelectedIndex()==1?2:-1),o(),M(i.stepperSelectedIndex()==0?3:-1),o(),M(i.stepperSelectedIndex()==2?4:-1),o(6),se("ngClass","last-edited-step-"+p.selectedIndex),b("selectedIndex",i.stepperSelectedIndex),o(2),d("completed",!1)("editable",i.stepperSelectedIndex()!=2),o(2),d("reset",i.isResetFilter()),o(),d("editable",i.stepperSelectedIndex()!=2)("completed",!1),o(2),d("ngIf",U(18,16,i.orderPreview$)),o(4),d("ngIf",U(22,18,i.downloadPreview$))}},dependencies:[F,R,L,q,He,Qe,qe,Ge,Ye,$e,Ue,ze,Me,Ie,ge],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,4 +1,4 @@
|
|
|
1
|
-
import{a as Ae,b as Ct}from"./chunk-5GX2GLRY.js";import{a as H}from"./chunk-KVP6OL4J.js";import"./chunk-77IUCPIQ.js";import"./chunk-JBKHY4HH.js";import{a as ne,b as ae,c as ot}from"./chunk-RGR34QZ3.js";import"./chunk-MS4AQ6UA.js";import{a as oe}from"./chunk-ZD5LURJS.js";import{b as ht}from"./chunk-ICSMRW7O.js";import"./chunk-YXFTLQ5M.js";import{g as _t}from"./chunk-IYYVZ6B6.js";import"./chunk-RVYGL22E.js";import{a as pt,b as mt}from"./chunk-OE2JYQHN.js";import"./chunk-7GQIIDFF.js";import"./chunk-6XFYITUD.js";import{a as ft,b as St}from"./chunk-OLSC6KHB.js";import{a as re,b as lt}from"./chunk-COBHWPGI.js";import{a as st}from"./chunk-VETHPEVU.js";import{m as gt}from"./chunk-75BDXSG3.js";import"./chunk-D54NUPYF.js";import"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-4G3QN54S.js";import"./chunk-3RK6DDJD.js";import{a as j}from"./chunk-UBMI3NQH.js";import{b as ut}from"./chunk-7FUVW73P.js";import{b as ct}from"./chunk-M3SJUKTG.js";import{c as dt}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a as le}from"./chunk-
|
|
1
|
+
import{a as Ae,b as Ct}from"./chunk-5GX2GLRY.js";import{a as H}from"./chunk-KVP6OL4J.js";import"./chunk-77IUCPIQ.js";import"./chunk-JBKHY4HH.js";import{a as ne,b as ae,c as ot}from"./chunk-RGR34QZ3.js";import"./chunk-MS4AQ6UA.js";import{a as oe}from"./chunk-ZD5LURJS.js";import{b as ht}from"./chunk-ICSMRW7O.js";import"./chunk-YXFTLQ5M.js";import{g as _t}from"./chunk-IYYVZ6B6.js";import"./chunk-RVYGL22E.js";import{a as pt,b as mt}from"./chunk-OE2JYQHN.js";import"./chunk-7GQIIDFF.js";import"./chunk-6XFYITUD.js";import{a as ft,b as St}from"./chunk-OLSC6KHB.js";import{a as re,b as lt}from"./chunk-COBHWPGI.js";import{a as st}from"./chunk-VETHPEVU.js";import{m as gt}from"./chunk-75BDXSG3.js";import"./chunk-D54NUPYF.js";import"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-4G3QN54S.js";import"./chunk-3RK6DDJD.js";import{a as j}from"./chunk-UBMI3NQH.js";import{b as ut}from"./chunk-7FUVW73P.js";import{b as ct}from"./chunk-M3SJUKTG.js";import{c as dt}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a as le}from"./chunk-5KHDEW35.js";import"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import"./chunk-RIHLYYZU.js";import"./chunk-Q2OEJFVT.js";import{a as ee,b as te,d as ie,e as $e}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{a as He,h as me,l as $}from"./chunk-IHYEQWAY.js";import{b as Ve,e as R}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{b as tt,d as ue,f as it,g as nt,h as at,m as G,n as rt}from"./chunk-ITTRZMEX.js";import{s as et}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as ke,c as Q,h as B,m as z,o as Z,y as Ze}from"./chunk-DPLEMBB4.js";import{b as w,c as N}from"./chunk-PXB4YEY3.js";import{E as Xe,F as Qe,H as X,J as Le,f as A,g as F,j as Oe,k as V,m as W,n as he}from"./chunk-GPEVUTDI.js";import{$c as k,Aa as Ge,B as qe,Ba as je,Dc as U,Eb as L,Ec as l,Fb as Me,Fc as u,G as Ye,Gc as I,Ic as C,Jc as b,Kb as f,Kc as y,Pc as K,Rc as pe,Wb as d,Z as be,Zc as T,_c as M,aa as Je,ad as q,ea as Ie,gc as i,hc as n,ic as S,ja as Ne,jc as P,ka as De,kc as E,mc as D,oa as se,ob as O,qb as o,rc as v,sc as s,v as J,wb as x,xa as Ke,ya as g,za as h}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var bt=(()=>{class r{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[He.downloadOrder]},{Title:"Log",Url:"/menu/Order/Download_Order_Log",Permissions:[He.downloadOrder]}]}ngOnInit(){}static{this.\u0275fac=function(a){return new(a||r)}}static{this.\u0275cmp=L({type:r,selectors:[["app-orders"]],standalone:!1,decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(a,t){a&1&&(i(0,"nav",0)(1,"div",1)(2,"div"),S(3,"nav-tab",2),n()()(),S(4,"router-outlet")),a&2&&(o(3),d("Tabs",t.ObjectOrderTabs)("usePermissions",!0))},dependencies:[pt,Qe],encapsulation:2})}}return r})();var Fe=(()=>{class r{constructor(e,a){this.http=e,this.toastr=a}acceptTokopediaOrders(e){return this.http.post("/api/Orders/AcceptOrderTokopedia",e).pipe(Ie(a=>{this.tokopediaAcceptOrderHandler(a)}))}tokopediaAcceptOrderHandler(e){let a=e.filter(m=>m.Status==!1),t=e.filter(m=>m.Status==!0);if(a.length==0&&t.length>0){let m=`<ol>${this.generateSuccessMessage(t)}</ol>`;this.toastr.success(m,"Success",{enableHtml:!0})}else if(a.length>0&&t.length>0){let m=`<ol>
|
|
2
2
|
${this.generateSuccessMessage(t)}
|
|
3
3
|
${this.generateErrorMessage(a)}
|
|
4
|
-
</ol>`;this.toastr.warning(m,"Warning",{enableHtml:!0})}else{let m=`<ol>${this.generateErrorMessage(a)}</ol>`;this.toastr.error(m,"Error",{enableHtml:!0})}}generateSuccessMessage(e){let a="";return e.forEach(t=>{a+=`<li><b>${t.OrderNumber}</b> was successfully Accept</li>`}),a}generateErrorMessage(e){let a="";return e.forEach(t=>{a+=`<li><b>${t.OrderNumber}</b> ${t.Message}</li>`}),a}static{this.\u0275fac=function(a){return new(a||r)(se(R),se(Ve))}}static{this.\u0275prov=Ne({token:r,factory:r.\u0275fac})}}return r})();function Ot(r,c){if(r&1){let e=D();P(0),i(1,"button",20),v("click",function(){g(e);let t=s().ngIf,m=s();return h(m.onAcceptOrder(t))}),S(2,"i",21),l(3," Accept "),n(),E()}}function Lt(r,c){if(r&1&&(P(0),f(1,Ot,4,0,"ng-container",3),E()),r&2){let e=s();o(),d("ngIf",e.isTokopediaAvailable&&e.isTokopediaSelected)}}function kt(r,c){if(r&1&&(i(0,"span",22),S(1,"img",23),n(),l(2)),r&2){let e=c.item;o(),d("src",e==null?null:e.Img,O),o(),I(" ",e.Name," ")}}function Vt(r,c){if(r&1){let e=D();P(0),i(1,"th",35)(2,"input",36),y("ngModelChange",function(t){g(e);let m=s(3);return b(m.isCheckAll,t)||(m.isCheckAll=t),h(t)}),v("ngModelChange",function(){g(e);let t=s(2).ngIf,m=s();return h(m.onSelectAllOrderData(t))}),n()(),E()}if(r&2){let e=s(3);o(2),C("ngModel",e.isCheckAll)}}function At(r,c){if(r&1){let e=D();P(0),i(1,"input",36),y("ngModelChange",function(t){g(e);let m=s(2).$implicit;return b(m.selected,t)||(m.selected=t),h(t)}),v("ngModelChange",function(){g(e);let t=s(4).ngIf,m=s();return h(m.onSelectOrderData(t))}),n(),E()}if(r&2){let e=s(2).$implicit;o(),C("ngModel",e.selected)}}function Ft(r,c){if(r&1&&(P(0),i(1,"td"),f(2,At,2,1,"ng-container",3),n(),E()),r&2){let e=s().$implicit,a=s(3);o(2),d("ngIf",e.Type==a.tokopediaType)}}function Rt(r,c){if(r&1&&(P(0),i(1,"span"),l(2),n(),E()),r&2){let e=s().$implicit;o(2),u(e.Number)}}function Wt(r,c){if(r&1&&(i(0,"a",38),l(1),n()),r&2){let e=s().$implicit,a=s(3);d("href",a.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+e.ID,O),o(),u(e.Number)}}function Bt(r,c){if(r&1&&(i(0,"tr"),f(1,Ft,3,1,"ng-container",3),i(2,"td"),l(3),n(),i(4,"td"),f(5,Rt,3,1,"ng-container",24)(6,Wt,2,2,"ng-template",null,1,q),n(),i(8,"td"),l(9),n(),i(10,"td"),l(11),T(12,"date"),n(),i(13,"td"),S(14,"app-channel-logo",37),n()()),r&2){let e=c.$implicit,a=U(7),t=s(3);o(),d("ngIf",t.isTokopediaAvailable),o(2),u(e.Outlet),o(2),d("ngIf",e.ID==t.guidEmpty)("ngIfElse",a),o(4),u(e.Customer),o(2),u(k(12,7,e.Created,"dd MMM yyyy HH:mm")),o(3),d("typeId",e.Type)}}function zt(r,c){if(r&1){let e=D();P(0),i(1,"div",25)(2,"table",26),v("matSortChange",function(t){g(e);let m=s(2);return h(m.onSort(t))}),i(3,"thead",27)(4,"tr",28),f(5,Vt,3,1,"ng-container",3),i(6,"th",29),l(7,"Outlet"),n(),i(8,"th",30),l(9,"Order number"),n(),i(10,"th"),l(11,"Customer"),n(),i(12,"th",31),l(13," Created On "),n(),i(14,"th",32),l(15,"Channel"),n()()(),i(16,"tbody"),f(17,Bt,15,10,"tr",33),n()(),i(18,"app-mat-paginator-no-count",34),T(19,"async"),T(20,"async"),v("total",function(){g(e);let t=s(2);return h(t.getPaginatonTotal())})("next",function(){g(e);let t=s(2);return h(t.onNextPage())})("previous",function(){g(e);let t=s(2);return h(t.onPreviousPage())}),n()(),E()}if(r&2){let e,a=s().ngIf,t=s();o(5),d("ngIf",t.isTokopediaAvailable&&a),o(12),d("ngForOf",a),o(),d("filter",t.filter)("totaldata",(e=M(19,5,t.newOrdersData$))==null?null:e.length)("paginationTotal",M(20,7,t.paginationTotal$))}}function Gt(r,c){if(r&1&&(P(0),f(1,zt,21,9,"ng-container",24),E()),r&2){let e=c.ngIf;s();let a=U(36);o(),d("ngIf",(e==null?null:e.length)>0)("ngIfElse",a)}}function jt(r,c){r&1&&(i(0,"div",39),S(1,"app-empty-state"),n())}var yt=(()=>{class r{constructor(e,a,t,m){this.localDataService=e,this.orderService=a,this.acceptOrderService=t,this.authService=m,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=N.GuidEMpty,this.tokopediaType=w.Tokopedia,this.isTokopediaSelected=!1,this.isTokopediaAvailable=!1,this.isCheckAll=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initLoadPage()}initLoadPage(){this.orderService.loadInitialPage().subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.getNewOrders()})}getNewOrders(){let e={PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.sourceObs$=this.orderService.getNewOrders(e).pipe(be()),this.newOrdersData$=this.sourceObs$.pipe(Ie(a=>{a.filter(m=>m.Type==w.Tokopedia).length>0&&(this.isTokopediaAvailable=!0)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID,this.filter.From,this.filter.To).pipe(be())}onNextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getNewOrders()}onPreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getNewOrders()}onSelectOrderData(e){this.isTokopediaSelected=!1,e.filter(t=>t.selected).length>0&&(this.isTokopediaSelected=!0)}onSelectAllOrderData(e){e=e.map(a=>(a.Type==w.Tokopedia&&(a.selected=this.isCheckAll),a)),this.onSelectOrderData(e)}onAcceptOrder(e){let a=this.getSelectedTokopediaOrders(e);this.acceptOrderService.acceptTokopediaOrders(a).subscribe(t=>{this.isTokopediaSelected=!1,location.reload()})}getSelectedTokopediaOrders(e){return e.filter(t=>t.selected).map(t=>t.Number)}onSort(e){if(e.direction==""){this.newOrdersData$=this.sourceObs$;return}if(e.active=="created"){let a=e.direction=="asc";this.newOrdersData$=this.newOrdersData$.pipe(J(t=>(t=t.sort((m,_)=>N.compare(m.Created,_.Created,a)),t)))}}static{this.\u0275fac=function(a){return new(a||r)(x(me),x(Ae),x(Fe),x($))}}static{this.\u0275cmp=L({type:r,selectors:[["app-new-order"]],standalone:!1,decls:37,vars:15,consts:[["EMPTY_STATE",""],["NOT_EMPTY",""],["headerTitle","1 - New Order","searchBoxPlaceHolder","Search Orders...",3,"onSubmit","hideSearchBox"],[4,"ngIf"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[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,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-check"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[2,"width","5px"],["type","checkbox",3,"ngModelChange","ngModel"],[3,"typeId"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=D();i(0,"mainpanel",2),v("onSubmit",function(){return g(m),h(t.getNewOrders())}),i(1,"actions"),f(2,Lt,2,1,"ng-container",3),T(3,"async"),i(4,"a",4),S(5,"i",5),i(6,"span"),l(7,"Visit our Fulfillment Display System"),n()()(),i(8,"filters")(9,"div")(10,"label",6),l(11,"Channel"),n(),i(12,"ng-select",7),y("ngModelChange",function(p){return g(m),b(t.filter.ListChannelID,p)||(t.filter.ListChannelID=p),h(p)}),f(13,kt,3,2,"ng-template",8),n()(),i(14,"div",9)(15,"label",10),l(16,"Page Number"),n(),i(17,"input",11),y("ngModelChange",function(p){return g(m),b(t.filter.PageNumber,p)||(t.filter.PageNumber=p),h(p)}),n()(),i(18,"div",9)(19,"label",10),l(20,"Page Size"),n(),i(21,"input",12),y("ngModelChange",function(p){return g(m),b(t.filter.PageSize,p)||(t.filter.PageSize=p),h(p)}),n()(),i(22,"div",9)(23,"label",13),l(24,"From/To"),n(),i(25,"div",14)(26,"datepicker",15),y("dateChange",function(p){return g(m),b(t.filter.From,p)||(t.filter.From=p),h(p)}),n()(),i(27,"div")(28,"datepicker",16),y("dateChange",function(p){return g(m),b(t.filter.To,p)||(t.filter.To=p),h(p)}),n()()()(),i(29,"content")(30,"div",17)(31,"div",18)(32,"div",19),f(33,Gt,2,2,"ng-container",3),T(34,"async"),f(35,jt,2,0,"ng-template",null,0,q),n()()()()()}a&2&&(d("hideSearchBox",!0),o(2),d("ngIf",M(3,11,t.newOrdersData$)),o(10),d("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),d("ngIf",M(34,13,t.newOrdersData$)))},dependencies:[A,F,Q,Z,ke,B,z,G,ie,ee,te,j,re,oe,ne,ae,H,Oe,V],encapsulation:2})}}return r})();var Ht=()=>["/menu/Order"];function Ut(r,c){if(r&1&&(i(0,"tr")(1,"td"),l(2),n(),i(3,"td"),l(4),T(5,"number"),n(),i(6,"td"),l(7),T(8,"number"),n()()),r&2){let e=c.$implicit;o(2),u(e.Code),o(2),u(M(5,3,e.Quantity)),o(3),u(M(8,5,e.Price))}}function qt(r,c){if(r&1&&(i(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),l(5,"Outlet Info"),n()(),i(6,"div",4)(7,"div",9),l(8," Outlet : "),n(),i(9,"div",9),l(10),n()(),i(11,"div",4)(12,"div",9),l(13," Date : "),n(),i(14,"div",9),l(15),T(16,"date"),n()(),i(17,"div",4)(18,"div",9),l(19," Status : "),n(),i(20,"div",9),l(21),n()(),i(22,"div",4)(23,"div",9),l(24," Tax Type : "),n(),i(25,"div",9),l(26),n()(),i(27,"div",4)(28,"div",9),l(29," Due Date : "),n(),i(30,"div",9),l(31),T(32,"date"),n()()(),i(33,"div",6)(34,"div",7)(35,"h3",8),l(36,"Customer Info"),n()(),i(37,"div",4)(38,"div",9),l(39," Name : "),n(),i(40,"div",9),l(41),n()(),i(42,"div",4)(43,"div",9),l(44," Email : "),n(),i(45,"div",9),l(46),n()(),i(47,"div",4)(48,"div",9),l(49," Mobile : "),n(),i(50,"div",9),l(51),n()()()(),i(52,"div",10)(53,"h3",11),l(54,"Products Sold"),n(),i(55,"div",12)(56,"table",13)(57,"thead",14)(58,"tr",15)(59,"th"),l(60,"Code"),n(),i(61,"th"),l(62,"Quantity"),n(),i(63,"th"),l(64,"Price"),n()()(),i(65,"tbody"),f(66,Ut,9,7,"tr",16),n()()()()()),r&2){let e=s();o(10),I(" ",e.model.Outlet," "),o(5),I(" ",k(16,9,e.model.Date,"dd MMM yyyy")," "),o(6),I(" ",e.model.Delivery," "),o(5),I(" ",e.model.TaxType," "),o(5),I(" ",k(32,12,e.model.DueDate,"dd MMM yyyy")," "),o(10),I(" ",e.model.Customer.Name," "),o(5),I(" ",e.model.Customer.Email," "),o(5),I(" ",e.model.Customer.Mobile," "),o(15),d("ngForOf",e.model.Variants)}}var vt=(()=>{class r{constructor(e,a){this.http=e,this.url=a,this.number=this.url.snapshot.queryParams.Number,this.outlet=this.url.snapshot.queryParams.Outlet}ngOnInit(){this.Load()}Load(){var e={Number:this.number,Outlet:this.outlet};this.http.post("/api/orders/GetInvoiceDetail",e).subscribe(a=>{this.model=a})}static{this.\u0275fac=function(a){return new(a||r)(x(R),x(Xe))}}static{this.\u0275cmp=L({type:r,selectors:[["app-detail-order"]],standalone:!1,decls:7,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-secondary","btn-fill","btn-lg","me-3",3,"routerLink"],[1,"container"],["class","row",4,"ngIf"],[1,"row"],[1,"col-4"],[1,"border","my-3","py-3","col-12"],[1,"row","m-2"],[1,"text-center"],[1,"col"],[1,"col-8"],[1,"text-center","my-3","py-3"],[1,"table-responsive"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),n()(),i(4,"content")(5,"div",2),f(6,qt,67,15,"div",3),n()()()),a&2&&(d("headerTitle","Order #"+t.number)("hideSearchBox",!0)("hideSearchDropdown",!0),o(2),d("routerLink",K(5,Ht)),o(4),d("ngIf",t.model))},dependencies:[A,F,G,X,W,V],encapsulation:2})}}return r})();var xt=(()=>{class r{constructor(e){this.dialogRef=e,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}static{this.\u0275fac=function(a){return new(a||r)(x(tt))}}static{this.\u0275cmp=L({type:r,selectors:[["app-print-tokopedia"]],standalone:!1,decls:17,vars:1,consts:[[1,"container-fluid"],[1,"text-center","mb-4","fw-bold","mt-6"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"ngModelChange","ngModel"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click"]],template:function(a,t){a&1&&(i(0,"div",0)(1,"h2",1),l(2,"Cetak label pesanan"),n(),i(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),l(7,"Kamu akan mencetak label yang berisi detail pesanan"),n(),i(8,"div",5)(9,"mat-checkbox",6),y("ngModelChange",function(_){return b(t.tandaiSudahDicetak,_)||(t.tandaiSudahDicetak=_),_}),n(),i(10,"span",7),l(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),n()()()()(),i(12,"mat-dialog-actions",8)(13,"button",9),v("click",function(){return t.onCancel()}),l(14,"Cancel"),n(),i(15,"button",10),v("click",function(){return t.onPrint()}),l(16,"Cetak Pesanan"),n()()()),a&2&&(o(9),C("ngModel",t.tandaiSudahDicetak))},dependencies:[B,z,ft,nt,it],encapsulation:2})}}return r})();var We=(()=>{class r{constructor(e,a,t){this.http=e,this.toastr=a,this.dialog=t}getTokopediaShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/Tokopedia/Multiple",{Orders:e}).pipe(J(a=>(a=a.map(t=>(t.ChannelType=w.Tokopedia,t)),a)))}getTiktokShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/TIktok/Multiple",{Orders:e}).pipe(J(a=>(a=a.map(t=>(t.ChannelType=w.Tiktok,t)),a)))}getShopeeShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/shopee/Multiple",{Orders:e}).pipe(J(a=>(a=a.map(t=>(t.ChannelType=w.Shopee,t)),a)))}getLazadaShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/lazada/Multiple",{Orders:e}).pipe(J(a=>(a=a.map(t=>(t.ChannelType=w.Lazada,t)),a)))}printShippingLabelTokopedia(e){let a={OrderNumber:e,Printed:!0};this.dialog.open(xt).afterClosed().pipe(Ye(t=>t!==void 0),Je(t=>(a.Printed=t,this.http.post("api/v1/Shippinglabel/Tokopedia",a)))).subscribe(t=>{let m=window.open("about:blank","_blank");m.document.write(t.File),m.document.close()})}printShippingLabelTiktok(e,a){let t={ShopID:a,OrderNumber:e};this.http.post("api/v1/Shippinglabel/Tiktok",t).subscribe(m=>{m.data!=null?window.open(m.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print")})}printShippingLabelShopee(e,a){let t={ShopID:a,OrderNumber:e};this.http.post("api/v1/Shippinglabel/shopee/DownloadShipping",t).subscribe(m=>{var _=Uint8Array.from(atob(m.File),ze=>ze.charCodeAt(0)),p=new Blob([_],{type:"octet/stream"});N.openDownloadFile(p,`${e}.pdf`)})}printShippingLabelLazada(e,a){let t={ShopID:a,OrderNumber:e};this.http.post("api/v1/Shippinglabel/Lazada/DownloadShipping",t).subscribe(m=>{m.result.data!=null?window.open(m.result.data.pdf_url,"_blank"):this.toastr.error(m.message,"Cannot Print")})}static{this.\u0275fac=function(a){return new(a||r)(se(R),se(Ve),se(ue))}}static{this.\u0275prov=Ne({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var de=function(r){return r.SPX="https://res.cloudinary.com/pos/image/upload/v1698216798/APP/Print%20Shipping%20Label/SPX_Logo.png",r.SICEPAT="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/SiCepat_Logo.png",r.JNT="https://res.cloudinary.com/pos/image/upload/v1698216792/APP/Print%20Shipping%20Label/J_T_Logo.png",r.ANTERAJA="https://res.cloudinary.com/pos/image/upload/v1698218271/APP/Print%20Shipping%20Label/anteraja_Logo.png",r.JNE="https://res.cloudinary.com/pos/image/upload/v1698216791/APP/Print%20Shipping%20Label/JNE_Logo.png",r.GRAB="https://res.cloudinary.com/pos/image/upload/v1698216794/APP/Print%20Shipping%20Label/GrabExpress_Logo.png",r.GOSEND="https://res.cloudinary.com/pos/image/upload/v1698218375/APP/Print%20Shipping%20Label/Gosend_Logo.png",r.LAZADA_EXPRESS="https://res.cloudinary.com/pos/image/upload/v1698914677/icons/Marketplace%20logo/lazada-Logistics.png",r}(de||{});var Ce=function(r){return r.TOKOPEDIA="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/Tokopedia_Logo.png",r.SHOPEE="https://res.cloudinary.com/pos/image/upload/v1698219243/APP/Print%20Shipping%20Label/shopee-logo.png",r.LAZADA="https://res.cloudinary.com/pos/image/upload/v1698912333/icons/Marketplace%20logo/Lazada_icon.png",r.TIKTOK="https://res.cloudinary.com/pos/image/upload/v1645761565/icons/Marketplace%20logo/tiktok-logo.png",r}(Ce||{});function Jt(r,c){if(r&1&&(P(0),i(1,"div",36)(2,"div",12)(3,"div",37),l(4),n()(),i(5,"div",12)(6,"div",37),l(7),n()()(),E()),r&2){let e=s();o(4),I(" ",e.recipient==null?null:e.recipient.City," "),o(3),I(" ",e.recipient==null?null:e.recipient.District," ")}}function Kt(r,c){if(r&1&&(P(0),i(1,"div")(2,"span",15),l(3,"Berat: "),n(),i(4,"span",18),l(5),n()(),E()),r&2){let e=s();o(5),I("",e.shippingLabel==null?null:e.shippingLabel.Weight," gr")}}function Xt(r,c){if(r&1&&(P(0),i(1,"div",38)(2,"span",14),l(3,"Batas Kirim:"),n(),i(4,"span",18),l(5),T(6,"date"),n()(),E()),r&2){let e=s();o(5),u(k(6,1,e.logistic==null?null:e.logistic.Batas_kirim,"dd-MM-yyy"))}}function Qt(r,c){if(r&1&&(P(0),i(1,"div",38)(2,"span",14),l(3,"No.Pesanan:"),n(),i(4,"span",18),l(5),n()(),E()),r&2){let e=s();o(5),u(e.shippingLabel==null?null:e.shippingLabel.OrderNumber)}}function Zt(r,c){if(r&1&&(i(0,"tr")(1,"td",39),l(2),n(),i(3,"td"),l(4),n(),i(5,"td"),l(6),n(),i(7,"td"),l(8),T(9,"number"),n()()),r&2){let e=c.$implicit,a=c.index;o(2),u(a+1),o(2),u(e.Product_Name),o(2),u(e.SKU),o(2),u(M(9,4,e.Quantity))}}var Be=(()=>{class r{constructor(){this.minDate=N.MinDate,this.channelType=w}ngOnChanges(e){e.shippingLabel&&e.shippingLabel.currentValue&&(this.initShippingLabel(),this.getShippingLogo(),this.getChannelLogo())}ngAfterViewInit(){this.initBarcodeConfig()}getChannelLogo(){switch(this.shippingLabel.ChannelType){case w.Tokopedia:this.marketplaceLogo=Ce.TOKOPEDIA;break;case w.Shopee:this.marketplaceLogo=Ce.SHOPEE;break;case w.Lazada:this.marketplaceLogo=Ce.LAZADA;break;case w.Tiktok:this.marketplaceLogo=Ce.TIKTOK;break}}getShippingLogo(){let e=this.shippingLabel.Logistic.Logistic_Name;e=e?.toLowerCase(),e.includes("anteraja")?this.shippingLogo=de.ANTERAJA:e.includes("grabexpress")?this.shippingLogo=de.GRAB:e.includes("jne")?this.shippingLogo=de.JNE:e.includes("gosend")?this.shippingLogo=de.GOSEND:e.includes("j&t")||e.includes("jnt")?this.shippingLogo=de.JNT:e.includes("sicepat")?this.shippingLogo=de.SICEPAT:e.includes("spx")?this.shippingLogo=de.SPX:(e.includes("lex")||e.includes("lx")||e.includes("lazada express"))&&(this.shippingLogo=de.LAZADA_EXPRESS)}initShippingLabel(){this.recipient=this.shippingLabel.Recipient,this.store=this.shippingLabel.Store,this.products=this.shippingLabel.Products,this.logistic=this.shippingLabel.Logistic}initBarcodeConfig(){if(N.IsNotEmpty(this.logistic?.Resi_Number)){let e=this.logistic?.Resi_Number;JsBarcode(`#RESI${this.id}`,this.logistic?.Resi_Number,{displayValue:!1,width:e.length>15?1:1.5,height:40})}N.IsNotEmpty(this.shippingLabel?.OrderNumber)&&JsBarcode(`#NO${this.id}`,this.shippingLabel?.OrderNumber,{displayValue:!1,width:this.shippingLabel?.OrderNumber.length>15?.5:1,height:40})}static{this.\u0275fac=function(a){return new(a||r)}}static{this.\u0275cmp=L({type:r,selectors:[["app-shipping-label"]],inputs:{shippingLabel:"shippingLabel",id:"id"},features:[Ke],decls:87,vars:20,consts:[[1,"label-container"],[2,"border","1px solid","padding","12px"],[1,"row","mb-2"],[1,"col-12"],[1,"d-flex","align-items-center","justify-content-between"],["width","105px",1,"border-0",3,"src"],[1,"mb-4"],[1,"row","mb-1"],[1,"text-center","fw-bold","border","p-2","fs-5","border-dark"],[1,"me-2"],[1,"col-12","text-center"],[3,"id"],[1,"col-6"],[1,"d-flex"],[1,"fw-bold","fs-6","me-1"],[1,"fw-bold","fs-6"],[1,"mt-2"],[1,"mb-0","fs-6",2,"max-width","200px","word-wrap","break-word"],[1,"fs-6"],[1,"fs-6",2,"word-wrap","break-word","max-width","160px"],[4,"ngIf"],[1,"row","px-6"],[1,"col-5","border","border-dark","border-end-0","text-center","p-2"],[1,"col-7","border","border-dark","p-2","text-center","fs-6"],[1,"fst-italic"],[1,"row"],[1,"col-5","pt-4",2,"padding-right","0px"],[1,"d-flex","justify-content-between"],[1,"col-7","text-center"],[1,"mt-1",3,"id"],[1,"table","table-sm","fs-6"],[1,"text-center",2,"width","5px"],[2,"width","150px"],[2,"width","50px"],[2,"width","25px"],[4,"ngFor","ngForOf"],[1,"row","mb-4"],[1,"text-center","fw-bold","border","p-2","fs-6","border-dark","text-uppercase"],[1,"mt-4"],[1,"text-center"]],template:function(a,t){a&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div"),S(6,"img",5),n(),i(7,"div")(8,"h4"),l(9),n()(),i(10,"div"),S(11,"img",5),n()()()(),i(12,"div",6),S(13,"hr"),n(),i(14,"div",7)(15,"div",3)(16,"div",8)(17,"span",9),l(18),n(),i(19,"span"),l(20),n()()()(),i(21,"div",7)(22,"div",10),Ge(),S(23,"svg",11),n()(),je(),i(24,"div",6),S(25,"hr"),n(),i(26,"div",2)(27,"div",12)(28,"div",13)(29,"div",14),l(30,"Penerima: "),n(),i(31,"div",15),l(32),n()(),i(33,"div",16)(34,"span",15),l(35,"Alamat Pengiriman:"),n(),i(36,"div",17),l(37),n()()(),i(38,"div",12)(39,"div",13)(40,"div",14),l(41,"Pengirim: "),n(),i(42,"div")(43,"div",15),l(44),n(),i(45,"div",18),l(46),n(),i(47,"div",19),l(48),n()()(),S(49,"div"),n()(),f(50,Jt,8,2,"ng-container",20),i(51,"div",21)(52,"div",22)(53,"div",15),l(54,"CASHLESS"),n()(),i(55,"div",23)(56,"small",24),l(57,"Penjual tidak perlu membayar ongkos kirim ke kurir"),n()()(),i(58,"div",25)(59,"div",26)(60,"div",27),f(61,Kt,6,1,"ng-container",20),i(62,"div")(63,"span",15),l(64,"COD: "),n(),i(65,"span",18),l(66),T(67,"number"),n()()(),f(68,Xt,7,4,"ng-container",20)(69,Qt,6,1,"ng-container",20),n(),i(70,"div",28),Ge(),S(71,"svg",29),n()()(),je(),i(72,"div",25)(73,"div",3)(74,"table",30)(75,"thead")(76,"tr")(77,"th",31),l(78,"No."),n(),i(79,"th",32),l(80,"Nama Produk"),n(),i(81,"th",33),l(82,"SKU"),n(),i(83,"th",34),l(84,"Qty"),n()()(),i(85,"tbody"),f(86,Zt,10,6,"tr",35),n()()()()()),a&2&&(o(6),d("src",t.marketplaceLogo,O),o(3),u(t.logistic==null?null:t.logistic.Service),o(2),d("src",t.shippingLogo,O),o(7),I(" ",(t.shippingLabel==null?null:t.shippingLabel.ChannelType)==(t.channelType==null?null:t.channelType.Tokopedia)?"Kode Booking: ":"No. Resi: "," "),o(2),u(t.logistic==null?null:t.logistic.Resi_Number),o(3),d("id","RESI"+t.id),o(9),u(t.recipient==null?null:t.recipient.Name),o(5),I(" ",t.recipient==null?null:t.recipient.Address," "),o(7),u(t.store==null?null:t.store.Name),o(2),u(t.store==null?null:t.store.Phone),o(2),I(" ",t.store==null?null:t.store.Address," "),o(2),d("ngIf",(t.recipient==null?null:t.recipient.City)&&(t.recipient==null?null:t.recipient.District)),o(11),d("ngIf",t.shippingLabel==null?null:t.shippingLabel.Weight),o(5),I("Rp. ",t.shippingLabel!=null&&t.shippingLabel.IsCOD?M(67,18,t.shippingLabel==null||t.shippingLabel.SummaryPrice==null?null:t.shippingLabel.SummaryPrice.Total):0,""),o(2),d("ngIf",(t.logistic==null?null:t.logistic.Batas_kirim)&&(t.logistic==null?null:t.logistic.Batas_kirim)!==t.minDate),o(),d("ngIf",t.shippingLabel==null?null:t.shippingLabel.OrderNumber),o(2),d("id","NO"+t.id),o(15),d("ngForOf",t.products))},dependencies:[he,A,F,W,V],styles:[".table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border:none!important}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-transform:capitalize;padding:4px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:none!important;padding:2px 2px 2px 5px!important;font-size:10px}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.4509803922)}.label-container[_ngcontent-%COMP%]{width:465px;float:left}hr[_ngcontent-%COMP%]{opacity:.8;margin:0}"]})}}return r})();var ei=()=>["/menu/Order/detail"],ti=(r,c)=>({Number:r,Outlet:c});function ii(r,c){if(r&1){let e=D();P(0),i(1,"button",21),v("click",function(){g(e);let t=s();return h(t.onPrintMultipleShippingLabel())}),S(2,"i",22),i(3,"span"),l(4,"Print Shipping Label"),n()(),E()}}function ni(r,c){if(r&1&&(i(0,"span",23),S(1,"img",24),n(),l(2)),r&2){let e=c.item;o(),d("src",e==null?null:e.Img,O)("alt",e.Name),o(),I(" ",e.Name," ")}}function ai(r,c){if(r&1){let e=D();P(0),i(1,"input",31),y("ngModelChange",function(t){g(e);let m=s().$implicit;return b(m.Selected,t)||(m.Selected=t),h(t)}),v("ngModelChange",function(){g(e);let t=s(3).ngIf,m=s();return h(m.onSelectReadyToShip(t))}),n(),E()}if(r&2){let e=s().$implicit;o(),C("ngModel",e.Selected)}}function ri(r,c){if(r&1&&(i(0,"a",44),l(1),n()),r&2){let e=s().$implicit;d("routerLink",K(3,ei))("queryParams",pe(4,ti,e.Number,e.Outlet)),o(),u(e.Number)}}function oi(r,c){if(r&1&&(i(0,"a",45),l(1),n()),r&2){let e=s().$implicit,a=s(3);d("href",a.domain+e.ID,O),o(),u(e.Number)}}function li(r,c){if(r&1){let e=D();i(0,"a",46),v("click",function(){g(e);let t=s().$implicit,m=s(3);return h(m.onPrintShippingLabel(t.Number,t.ShopID,t.TypeID))}),S(1,"i",47),n()}}function pi(r,c){if(r&1&&(i(0,"tr")(1,"td"),f(2,ai,2,1,"ng-container",4),n(),i(3,"td"),l(4),n(),i(5,"td"),f(6,ri,2,7,"a",39)(7,oi,2,2,"a",40),n(),i(8,"td"),l(9),n(),i(10,"td"),l(11),T(12,"number"),n(),i(13,"td"),l(14),T(15,"date"),n(),i(16,"td"),S(17,"app-channel-logo",41),n(),i(18,"td",42),f(19,li,2,0,"a",43),n()()),r&2){let e=c.$implicit,a=s(3);o(2),d("ngIf",e.TypeID==a.channelType.Shopee||e.TypeID==a.channelType.Tokopedia||e.TypeID==a.channelType.Tiktok),o(2),u(e.Outlet),o(2),d("ngIf",a.guidEmpty==e.ID),o(),d("ngIf",a.guidEmpty!=e.ID),o(2),u(e.Customer),o(2),u(M(12,9,e.Amount)),o(3),u(k(15,11,e.Date,"dd MMM yyyy")),o(3),d("typeId",e.TypeID),o(2),d("ngIf",e.TypeID==a.channelType.Shopee||e.TypeID==a.channelType.Tokopedia||e.TypeID==a.channelType.Tiktok||e.TypeID==a.channelType.Lazada)}}function mi(r,c){if(r&1){let e=D();P(0),i(1,"div",26)(2,"table",27),v("matSortChange",function(t){g(e);let m=s(2);return h(m.onSort(t))}),i(3,"thead",28)(4,"tr",29)(5,"th",30)(6,"input",31),y("ngModelChange",function(t){g(e);let m=s(2);return b(m.isCheckAll,t)||(m.isCheckAll=t),h(t)}),v("ngModelChange",function(){g(e);let t=s().ngIf,m=s();return h(m.onSelectAllReadyToShip(t))}),n()(),i(7,"th",32),l(8,"Outlet"),n(),i(9,"th",33),l(10,"Order number"),n(),i(11,"th"),l(12,"Customer"),n(),i(13,"th",34),l(14,"Amount"),n(),i(15,"th",35),l(16,"Date"),n(),i(17,"th",36),l(18,"Channel"),n(),S(19,"th",37),n()(),i(20,"tbody"),f(21,pi,20,14,"tr",20),n()(),i(22,"app-mat-paginator-no-count",38),T(23,"async"),T(24,"async"),v("total",function(){g(e);let t=s(2);return h(t.getRowCount())})("next",function(){g(e);let t=s(2);return h(t.NextPage())})("previous",function(){g(e);let t=s(2);return h(t.PreviousPage())}),n()(),E()}if(r&2){let e,a=s().ngIf,t=s();o(6),C("ngModel",t.isCheckAll),o(15),d("ngForOf",a),o(),d("filter",t.filter)("totaldata",(e=M(23,5,t.readyToShip$))==null?null:e.length)("paginationTotal",M(24,7,t.paginationTotal$))}}function di(r,c){if(r&1&&(P(0),f(1,mi,25,9,"ng-container",25),E()),r&2){let e=c.ngIf;s();let a=U(35);o(),d("ngIf",e.length>0)("ngIfElse",a)}}function si(r,c){r&1&&(i(0,"div",48),S(1,"app-empty-state"),n())}function ci(r,c){r&1&&(P(0),i(1,"div",50),l(2,"\xA0"),n(),E())}function gi(r,c){if(r&1&&(P(0),S(1,"app-shipping-label",49),f(2,ci,3,0,"ng-container",4),E()),r&2){let e=c.$implicit,a=c.index,t=s();o(),d("shippingLabel",e)("id",a),o(),d("ngIf",a!==(t.shippingLabels==null?null:t.shippingLabels.length)-1)}}var Tt=(()=>{class r{constructor(e,a,t,m,_,p){this.http=e,this.localDataService=a,this.dialog=t,this.shippingLabelService=m,this.datePipe=_,this.authService=p,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.channelType=w,this.guidEmpty=N.GuidEMpty,this.selectedReadyToShip=[],this.isCheckAll=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.getReadyToShip()})}getReadyToShip(e){var a={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.sourceObs$=this.http.post("api/orders/GetReadyToShip",a).pipe(J(t=>t.Data),be(1)),this.readyToShip$=this.sourceObs$}onPrintMultipleShippingLabel(){let e=this.filterReadyToShipByChannel(this.selectedReadyToShip,w.Tokopedia),a=this.filterReadyToShipByChannel(this.selectedReadyToShip,w.Shopee),t=this.filterReadyToShipByChannel(this.selectedReadyToShip,w.Tiktok),m=[];e.length>0&&m.push(this.shippingLabelService.getTokopediaShippingLabel(this.shippingLabelPayload(e))),a.length>0&&m.push(this.shippingLabelService.getShopeeShippingLabel(this.shippingLabelPayload(a))),t.length>0&&m.push(this.shippingLabelService.getTiktokShippingLabel(this.shippingLabelPayload(t))),qe(m).pipe(J(_=>_.reduce((p,ze)=>p.concat(ze),[]))).subscribe({next:_=>{this.shippingLabels=_,this.printShippingLabel()}})}filterReadyToShipByChannel(e,a){return e.filter(t=>t.TypeID==a)}shippingLabelPayload(e){return e.map(a=>({ShopID:a.ShopID,OrderNumber:a.Number}))}printShippingLabel(){setTimeout(()=>{this.setPdfname(),window.print()},500)}onPrintShippingLabel(e,a,t){switch(t){case w.Tokopedia:this.shippingLabelService.printShippingLabelTokopedia(e);break;case w.Tiktok:this.shippingLabelService.printShippingLabelTiktok(e,a);break;case w.Shopee:this.shippingLabelService.printShippingLabelShopee(e,a);break;case w.Lazada:this.shippingLabelService.printShippingLabelLazada(e,a);break}}setPdfname(){if(this.selectedReadyToShip.length>1){let e=new Date,a=this.datePipe.transform(e,"dd-MM-yyyy"),t=this.datePipe.transform(e,"HH-mm");document.title=`ShippingLabel_${a}_${t}`}else{let e=this.selectedReadyToShip[0].Number;document.title=`ShippingLabel_${e}`}}getSelectedReadyToShip(e){return e.filter(a=>a.Selected)}getRowCount(){var e={PaymentState:"Unpaid",DeliveryState:"Unsent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.paginationTotal$=this.http.post("api/orders/GetRowCount",e).pipe(J(a=>a?.Total))}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getReadyToShip()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getReadyToShip()}onSort(e){if(e.direction==""){this.readyToShip$=this.sourceObs$;return}if(e.active=="date"){let a=e.direction=="asc";this.readyToShip$=this.readyToShip$.pipe(J(t=>t.sort((m,_)=>N.compare(m.Date,_.Date,a))))}}onSelectReadyToShip(e){this.selectedReadyToShip=this.getSelectedReadyToShip(e)}onSelectAllReadyToShip(e){e=e.map(a=>((a.TypeID==w.Tokopedia||a.TypeID==w.Shopee||a.TypeID==w.Lazada)&&(a.Selected=this.isCheckAll),a)),this.selectedReadyToShip=this.getSelectedReadyToShip(e)}static{this.\u0275fac=function(a){return new(a||r)(x(R),x(me),x(ue),x(We),x(V),x($))}}static{this.\u0275cmp=L({type:r,selectors:[["app-ready-to-ship"]],standalone:!1,decls:38,vars:13,consts:[["EMPTY_STATE",""],["headerTitle","2 - Ready to Ship","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[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,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],[1,"print_containers"],[4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","date",2,"width","130px"],[2,"width","114px"],[2,"width","10px"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[3,"shippingLabel","id"],[1,"page-break"]],template:function(a,t){if(a&1){let m=D();i(0,"mainpanel",1),v("onSubmit",function(p){return g(m),h(t.getReadyToShip(p))}),i(1,"actions")(2,"a",2),S(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),n()(),f(6,ii,5,0,"ng-container",4),n(),i(7,"filters")(8,"div")(9,"label",5),l(10,"Channel"),n(),i(11,"ng-select",6),y("ngModelChange",function(p){return g(m),b(t.filter.ListChannelID,p)||(t.filter.ListChannelID=p),h(p)}),f(12,ni,3,3,"ng-template",7),n()(),i(13,"div",8)(14,"label",9),l(15,"Page Number"),n(),i(16,"input",10),y("ngModelChange",function(p){return g(m),b(t.filter.PageNumber,p)||(t.filter.PageNumber=p),h(p)}),n()(),i(17,"div",8)(18,"label",9),l(19,"Page Size"),n(),i(20,"input",11),y("ngModelChange",function(p){return g(m),b(t.filter.PageSize,p)||(t.filter.PageSize=p),h(p)}),n()(),i(21,"div",8)(22,"label",12),l(23,"From/To"),n(),i(24,"div",13)(25,"datepicker",14),y("dateChange",function(p){return g(m),b(t.filter.From,p)||(t.filter.From=p),h(p)}),n()(),i(26,"div")(27,"datepicker",15),y("dateChange",function(p){return g(m),b(t.filter.To,p)||(t.filter.To=p),h(p)}),n()()()(),i(28,"content")(29,"div",16)(30,"div",17)(31,"div",18),f(32,di,2,2,"ng-container",4),T(33,"async"),f(34,si,2,0,"ng-template",null,0,q),n()()()()(),i(36,"div",19),f(37,gi,3,3,"ng-container",20),n()}a&2&&(o(6),d("ngIf",t.selectedReadyToShip.length>0),o(5),d("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),d("ngIf",M(33,11,t.readyToShip$)),o(5),d("ngForOf",t.shippingLabels))},dependencies:[A,F,Q,Z,ke,B,z,G,X,ie,ee,te,j,re,oe,ne,ae,H,Be,Oe,W,V],styles:[".print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block}}@media print{.page-break[_ngcontent-%COMP%]{page-break-after:always}}"]})}}return r})();var hi=()=>["/menu/Order/detail"],ui=(r,c)=>({Number:r,Outlet:c});function _i(r,c){if(r&1&&(i(0,"span",19),S(1,"img",20),n(),l(2)),r&2){let e=c.item;o(),d("src",e==null?null:e.Img,O)("alt",e.Name),o(),I(" ",e.Name," ")}}function fi(r,c){if(r&1&&(i(0,"a",35),l(1),n()),r&2){let e=s().$implicit;d("routerLink",K(3,hi))("queryParams",pe(4,ui,e.Number,e.Outlet)),o(),u(e.Number)}}function Si(r,c){if(r&1&&(i(0,"a",36),l(1),n()),r&2){let e=s().$implicit,a=s(2);d("href",a.domain+e.ID,O),o(),u(e.Number)}}function Ci(r,c){if(r&1&&(i(0,"tr")(1,"td"),l(2),n(),i(3,"td"),f(4,fi,2,7,"a",32)(5,Si,2,2,"a",33),n(),i(6,"td"),l(7),n(),i(8,"td"),l(9),T(10,"number"),n(),i(11,"td"),l(12),T(13,"date"),n(),i(14,"td"),S(15,"app-channel-logo",34),n()()),r&2){let e=c.$implicit,a=s(2);o(2),u(e.Outlet),o(2),d("ngIf",a.hasGuidEmpty(e.ID)),o(),d("ngIf",!a.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,7,e.Amount)),o(3),u(k(13,9,e.Created,"dd MMM yyyy HH:mm")),o(3),d("typeId",e.TypeID)}}function bi(r,c){if(r&1){let e=D();P(0),i(1,"div",21)(2,"table",22),v("matSortChange",function(t){g(e);let m=s();return h(m.onSort(t))}),i(3,"thead",23)(4,"tr",24)(5,"th",25),l(6,"Outlet"),n(),i(7,"th",26),l(8,"Order number"),n(),i(9,"th"),l(10,"Customer"),n(),i(11,"th",27),l(12,"Amount"),n(),i(13,"th",28),l(14," Created On "),n(),i(15,"th",29),l(16,"Channel"),n()()(),i(17,"tbody"),f(18,Ci,16,12,"tr",30),n()(),i(19,"app-mat-paginator-no-count",31),v("total",function(){g(e);let t=s();return h(t.StoreRowsCountAPIResult())})("next",function(){g(e);let t=s();return h(t.NextPage())})("previous",function(){g(e);let t=s();return h(t.PreviousPage())}),n()(),E()}if(r&2){let e=s();o(18),d("ngForOf",e.data),o(),d("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function yi(r,c){r&1&&(i(0,"div",37),S(1,"app-empty-state"),n())}var wt=(()=>{class r{constructor(e,a,t){this.http=e,this.localDataService=a,this.authService=t,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=w,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}hasGuidEmpty(e){return e==N.GuidEMpty}Get(e){var a={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetShipped",a).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"Unpaid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(a=>{this.paginationTotal=a.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let a=e.direction=="asc";this.data=this.data.sort((t,m)=>N.compare(t.Created,m.Created,a))}}static{this.\u0275fac=function(a){return new(a||r)(x(R),x(me),x($))}}static{this.\u0275cmp=L({type:r,selectors:[["app-shipped"]],standalone:!1,decls:34,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","3 - Shipped","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[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,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=D();i(0,"mainpanel",1),v("onSubmit",function(p){return g(m),h(t.Get(p))}),i(1,"actions")(2,"a",2),S(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),n()()(),i(6,"filters")(7,"div")(8,"label",4),l(9,"Channel"),n(),i(10,"ng-select",5),y("ngModelChange",function(p){return g(m),b(t.filter.ListChannelID,p)||(t.filter.ListChannelID=p),h(p)}),f(11,_i,3,3,"ng-template",6),n()(),i(12,"div",7)(13,"label",8),l(14,"Page Number"),n(),i(15,"input",9),y("ngModelChange",function(p){return g(m),b(t.filter.PageNumber,p)||(t.filter.PageNumber=p),h(p)}),n()(),i(16,"div",7)(17,"label",8),l(18,"Page Size"),n(),i(19,"input",10),y("ngModelChange",function(p){return g(m),b(t.filter.PageSize,p)||(t.filter.PageSize=p),h(p)}),n()(),i(20,"div",7)(21,"label",11),l(22,"From/To"),n(),i(23,"div",12)(24,"datepicker",13),y("dateChange",function(p){return g(m),b(t.filter.From,p)||(t.filter.From=p),h(p)}),n()(),i(25,"div")(26,"datepicker",14),y("dateChange",function(p){return g(m),b(t.filter.To,p)||(t.filter.To=p),h(p)}),n()()()(),i(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),f(31,bi,20,4,"ng-container",18)(32,yi,2,0,"ng-template",null,0,q),n()()()()()}if(a&2){let m=U(33);o(10),d("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),d("ngIf",t.data&&t.data.length>0)("ngIfElse",m)}},dependencies:[A,F,Q,Z,B,z,G,X,ie,ee,te,j,re,oe,ne,ae,H,W,V],encapsulation:2})}}return r})();var vi=()=>["/menu/Order/detail"],xi=(r,c)=>({Number:r,Outlet:c});function Ti(r,c){if(r&1&&(i(0,"span",19),S(1,"img",20),n(),l(2)),r&2){let e=c.item;o(),d("src",e==null?null:e.Img,O)("alt",e.Name),o(),I(" ",e.Name," ")}}function wi(r,c){if(r&1&&(i(0,"a",35),l(1),n()),r&2){let e=s().$implicit;d("routerLink",K(3,vi))("queryParams",pe(4,xi,e.Number,e.Outlet)),o(),u(e.Number)}}function Pi(r,c){if(r&1&&(i(0,"a",36),l(1),n()),r&2){let e=s().$implicit,a=s(2);d("href",a.customerInfoUrl+e.ID,O),o(),u(e.Number)}}function Ei(r,c){if(r&1&&(i(0,"tr")(1,"td"),l(2),n(),i(3,"td"),f(4,wi,2,7,"a",32)(5,Pi,2,2,"a",33),n(),i(6,"td"),l(7),n(),i(8,"td"),l(9),T(10,"number"),n(),i(11,"td"),l(12),T(13,"date"),n(),i(14,"td"),S(15,"app-channel-logo",34),n()()),r&2){let e=c.$implicit,a=s(2);o(2),u(e.Outlet),o(2),d("ngIf",a.hasGuidEmpty(e.ID)),o(),d("ngIf",!a.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,7,e.Amount)),o(3),u(k(13,9,e.Created,"dd MMM yyyy HH:mm")),o(3),d("typeId",e.TypeID)}}function Ii(r,c){if(r&1){let e=D();P(0),i(1,"div",21)(2,"table",22),v("matSortChange",function(t){g(e);let m=s();return h(m.onSort(t))}),i(3,"thead",23)(4,"tr",24)(5,"th",25),l(6,"Outlet"),n(),i(7,"th",26),l(8,"Order number"),n(),i(9,"th"),l(10,"Customer"),n(),i(11,"th",27),l(12,"Amount"),n(),i(13,"th",28),l(14," Created On "),n(),i(15,"th",29),l(16,"Channel"),n()()(),i(17,"tbody"),f(18,Ei,16,12,"tr",30),n()(),i(19,"app-mat-paginator-no-count",31),v("total",function(){g(e);let t=s();return h(t.StoreRowsCountAPIResult())})("next",function(){g(e);let t=s();return h(t.NextPage())})("previous",function(){g(e);let t=s();return h(t.PreviousPage())}),n()(),E()}if(r&2){let e=s();o(18),d("ngForOf",e.data),o(),d("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function Ni(r,c){r&1&&(i(0,"div",37),S(1,"app-empty-state"),n())}var Pt=(()=>{class r{constructor(e,a){this.http=e,this.authService=a,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=w,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==N.GuidEMpty}getChannelLogo(e){return N.getChannelLogoByTypeId(e)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.customerInfoUrl=`${this.authService.getDomain()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var a={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetDelivered ",a).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"Paid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(a=>{this.paginationTotal=a.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let a=e.direction=="asc";this.data=this.data.sort((t,m)=>N.compare(t.Created,m.Created,a))}}static{this.\u0275fac=function(a){return new(a||r)(x(R),x($))}}static{this.\u0275cmp=L({type:r,selectors:[["app-delivered"]],standalone:!1,decls:34,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","4 - Completed","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[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,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=D();i(0,"mainpanel",1),v("onSubmit",function(p){return g(m),h(t.Get(p))}),i(1,"actions")(2,"a",2),S(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),n()()(),i(6,"filters")(7,"div")(8,"label",4),l(9,"Channel"),n(),i(10,"ng-select",5),y("ngModelChange",function(p){return g(m),b(t.filter.ListChannelID,p)||(t.filter.ListChannelID=p),h(p)}),f(11,Ti,3,3,"ng-template",6),n()(),i(12,"div",7)(13,"label",8),l(14,"Page Number"),n(),i(15,"input",9),y("ngModelChange",function(p){return g(m),b(t.filter.PageNumber,p)||(t.filter.PageNumber=p),h(p)}),n()(),i(16,"div",7)(17,"label",8),l(18,"Page Size"),n(),i(19,"input",10),y("ngModelChange",function(p){return g(m),b(t.filter.PageSize,p)||(t.filter.PageSize=p),h(p)}),n()(),i(20,"div",7)(21,"label",11),l(22,"From/To"),n(),i(23,"div",12)(24,"datepicker",13),y("dateChange",function(p){return g(m),b(t.filter.From,p)||(t.filter.From=p),h(p)}),n()(),i(25,"div")(26,"datepicker",14),y("dateChange",function(p){return g(m),b(t.filter.To,p)||(t.filter.To=p),h(p)}),n()()()(),i(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),f(31,Ii,20,4,"ng-container",18)(32,Ni,2,0,"ng-template",null,0,q),n()()()()()}if(a&2){let m=U(33);o(10),d("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),d("ngIf",t.data&&t.data.length>0)("ngIfElse",m)}},dependencies:[A,F,Q,Z,B,z,G,X,ie,ee,te,j,re,oe,ne,ae,H,W,V],encapsulation:2})}}return r})();var Di=()=>["/menu/Order/detail"],Mi=(r,c)=>({Number:r,Outlet:c});function Oi(r,c){if(r&1&&(i(0,"span",21),S(1,"img",22),n(),l(2)),r&2){let e=c.item;o(),d("src",e==null?null:e.Img,O)("alt",e.Name),o(),I(" ",e.Name," ")}}function Li(r,c){if(r&1&&(i(0,"a",38),l(1),n()),r&2){let e=s().$implicit;d("routerLink",K(3,Di))("queryParams",pe(4,Mi,e.Number,e.Outlet)),o(),u(e.Number)}}function ki(r,c){if(r&1&&(i(0,"a",39),l(1),n()),r&2){let e=s().$implicit,a=s(2);d("href",a.domain+e.ID,O),o(),u(e.Number)}}function Vi(r,c){if(r&1&&(i(0,"tr")(1,"td"),l(2),n(),i(3,"td"),f(4,Li,2,7,"a",35)(5,ki,2,2,"a",36),n(),i(6,"td"),l(7),n(),i(8,"td"),l(9),T(10,"number"),n(),i(11,"td"),l(12),T(13,"date"),n(),i(14,"td"),l(15),n(),i(16,"td"),S(17,"app-channel-logo",37),n()()),r&2){let e=c.$implicit,a=s(2);o(2),u(e.Outlet),o(2),d("ngIf",a.hasGuidEmpty(e.ID)),o(),d("ngIf",!a.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,8,e.Amount)),o(3),u(k(13,10,e.Created,"dd MMM yyyy HH:mm")),o(3),u(e.State),o(2),d("typeId",e.TypeID)}}function Ai(r,c){if(r&1){let e=D();P(0),i(1,"div",23)(2,"table",24),v("matSortChange",function(t){g(e);let m=s();return h(m.onSort(t))}),i(3,"thead",25)(4,"tr",26)(5,"th",27),l(6,"Outlet"),n(),i(7,"th",28),l(8,"Order number"),n(),i(9,"th"),l(10,"Customer"),n(),i(11,"th",29),l(12,"Amount"),n(),i(13,"th",30),l(14," Created On "),n(),i(15,"th",31),l(16,"Status"),n(),i(17,"th",32),l(18,"Channel"),n()()(),i(19,"tbody"),f(20,Vi,18,13,"tr",33),n()(),i(21,"app-mat-paginator-no-count",34),v("total",function(){g(e);let t=s();return h(t.StoreRowsCountAPIResult())})("next",function(){g(e);let t=s();return h(t.NextPage())})("previous",function(){g(e);let t=s();return h(t.PreviousPage())}),n()(),E()}if(r&2){let e=s();o(20),d("ngForOf",e.data),o(),d("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function Fi(r,c){r&1&&(i(0,"div",40),S(1,"app-empty-state"),n())}var Et=(()=>{class r{constructor(e,a,t,m){this.http=e,this.localDataService=a,this.authService=t,this.dialog=m,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==N.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var a={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetAll",a).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.Data],this.totaldata=this.data.length})}openExportDialog(){this.dialog.open(ht,{data:{title:"Export Order All",pageNumber:this.filter.PageNumber,rowCount:this.filter.PageSize,filterExport:this.filter,getRowCountApi:"orders/GetRowCount",exportApi:"orders/GetExportAll"}}).afterClosed().subscribe()}changePage(e){this.filter=e,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"",DeliveryState:"",Bin:!1,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(a=>{this.paginationTotal=a.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let a=e.direction=="asc";this.data=this.data.sort((t,m)=>N.compare(t.Created,m.Created,a))}}static{this.\u0275fac=function(a){return new(a||r)(x(R),x(me),x($),x(ue))}}static{this.\u0275cmp=L({type:r,selectors:[["app-all-order"]],standalone:!1,decls:38,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","All","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[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,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","135px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=D();i(0,"mainpanel",1),v("onSubmit",function(p){return g(m),h(t.Get(p))}),i(1,"actions")(2,"a",2),S(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),n()(),i(6,"button",4),v("click",function(){return g(m),h(t.openExportDialog())}),S(7,"i",5),i(8,"span"),l(9,"Export"),n()()(),i(10,"filters")(11,"div")(12,"label",6),l(13,"Channel"),n(),i(14,"ng-select",7),y("ngModelChange",function(p){return g(m),b(t.filter.ListChannelID,p)||(t.filter.ListChannelID=p),h(p)}),f(15,Oi,3,3,"ng-template",8),n()(),i(16,"div",9)(17,"label",10),l(18,"Page Number"),n(),i(19,"input",11),y("ngModelChange",function(p){return g(m),b(t.filter.PageNumber,p)||(t.filter.PageNumber=p),h(p)}),n()(),i(20,"div",9)(21,"label",10),l(22,"Page Size"),n(),i(23,"input",12),y("ngModelChange",function(p){return g(m),b(t.filter.PageSize,p)||(t.filter.PageSize=p),h(p)}),n()(),i(24,"div",9)(25,"label",13),l(26,"From/To"),n(),i(27,"div",14)(28,"datepicker",15),y("dateChange",function(p){return g(m),b(t.filter.From,p)||(t.filter.From=p),h(p)}),n()(),i(29,"div")(30,"datepicker",16),y("dateChange",function(p){return g(m),b(t.filter.To,p)||(t.filter.To=p),h(p)}),n()()()(),i(31,"content")(32,"div",17)(33,"div",18)(34,"div",19),f(35,Ai,22,4,"ng-container",20)(36,Fi,2,0,"ng-template",null,0,q),n()()()()()}if(a&2){let m=U(37);o(14),d("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),d("ngIf",t.data&&t.data.length>0)("ngIfElse",m)}},dependencies:[A,F,Q,Z,B,z,G,X,ie,ee,te,j,re,oe,ne,ae,H,W,V],encapsulation:2})}}return r})();var Ri=()=>["/menu/Order/detail"],Wi=(r,c)=>({Number:r,Outlet:c});function Bi(r,c){if(r&1&&(i(0,"span",20),S(1,"img",21),n(),l(2)),r&2){let e=c.item;o(),d("src",e==null?null:e.Img,O)("alt",e.Name),o(),I(" ",e.Name," ")}}function zi(r,c){if(r&1&&(i(0,"a",36),l(1),n()),r&2){let e=s().$implicit;d("routerLink",K(3,Ri))("queryParams",pe(4,Wi,e.Number,e.Outlet)),o(),u(e.Number)}}function Gi(r,c){if(r&1&&(i(0,"a",37),l(1),n()),r&2){let e=s().$implicit,a=s(2);d("href",a.domain+e.ID,O),o(),u(e.Number)}}function ji(r,c){if(r&1&&(i(0,"tr")(1,"td"),l(2),n(),i(3,"td"),f(4,zi,2,7,"a",33)(5,Gi,2,2,"a",34),n(),i(6,"td"),l(7),n(),i(8,"td"),l(9),T(10,"number"),n(),i(11,"td"),l(12),T(13,"date"),n(),i(14,"td"),S(15,"app-channel-logo",35),n()()),r&2){let e=c.$implicit,a=s(2);o(2),u(e.Outlet),o(2),d("ngIf",a.hasGuidEmpty(e.ID)),o(),d("ngIf",!a.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,7,e.Amount)),o(3),u(k(13,9,e.Created,"dd MMM yyyy HH:mm")),o(3),d("typeId",e.TypeID)}}function Hi(r,c){if(r&1){let e=D();P(0),i(1,"div",22)(2,"table",23),v("matSortChange",function(t){g(e);let m=s();return h(m.onSort(t))}),i(3,"thead",24)(4,"tr",25)(5,"th",26),l(6,"Outlet"),n(),i(7,"th",27),l(8,"Order number"),n(),i(9,"th"),l(10,"Customer"),n(),i(11,"th",28),l(12,"Amount"),n(),i(13,"th",29),l(14," Created On "),n(),i(15,"th",30),l(16,"Channel"),n()()(),i(17,"tbody"),f(18,ji,16,12,"tr",31),n()(),i(19,"app-mat-paginator-no-count",32),v("total",function(){g(e);let t=s();return h(t.StoreRowsCountAPIResult())})("next",function(){g(e);let t=s();return h(t.NextPage())})("previous",function(){g(e);let t=s();return h(t.PreviousPage())}),n()(),E()}if(r&2){let e=s();o(18),d("ngForOf",e.data),o(),d("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function Ui(r,c){r&1&&(i(0,"div",38),S(1,"app-empty-state"),n())}var It=(()=>{class r{constructor(e,a,t){this.http=e,this.localDataService=a,this.authService=t,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],Note:"",From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==N.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var a={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,Note:this.filter.Note,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetCancelled ",a).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"",DeliveryState:"",Bin:!0,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(a=>{this.paginationTotal=a.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}getChannelLogo(e){return N.getChannelLogoByTypeId(e)}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let a=e.direction=="asc";this.data=this.data.sort((t,m)=>N.compare(t.Created,m.Created,a))}}static{this.\u0275fac=function(a){return new(a||r)(x(R),x(me),x($))}}static{this.\u0275cmp=L({type:r,selectors:[["app-cancelled"]],standalone:!1,decls:38,vars:11,consts:[["EMPTY_STATE",""],["headerTitle","99 - Cancelled","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[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"],["type","text","name","Note",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=D();i(0,"mainpanel",1),v("onSubmit",function(p){return g(m),h(t.Get(p))}),i(1,"actions")(2,"a",2),S(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),n()()(),i(6,"filters")(7,"div")(8,"label",4),l(9,"Channel"),n(),i(10,"ng-select",5),y("ngModelChange",function(p){return g(m),b(t.filter.ListChannelID,p)||(t.filter.ListChannelID=p),h(p)}),f(11,Bi,3,3,"ng-template",6),n()(),i(12,"div",7)(13,"label",8),l(14,"Page Number"),n(),i(15,"input",9),y("ngModelChange",function(p){return g(m),b(t.filter.PageNumber,p)||(t.filter.PageNumber=p),h(p)}),n()(),i(16,"div",7)(17,"label",8),l(18,"Page Size"),n(),i(19,"input",10),y("ngModelChange",function(p){return g(m),b(t.filter.PageSize,p)||(t.filter.PageSize=p),h(p)}),n()(),i(20,"div",7)(21,"label",8),l(22,"Note"),n(),i(23,"input",11),y("ngModelChange",function(p){return g(m),b(t.filter.Note,p)||(t.filter.Note=p),h(p)}),n()(),i(24,"div",7)(25,"label",12),l(26,"From/To"),n(),i(27,"div",13)(28,"datepicker",14),y("dateChange",function(p){return g(m),b(t.filter.From,p)||(t.filter.From=p),h(p)}),n()(),i(29,"div")(30,"datepicker",15),y("dateChange",function(p){return g(m),b(t.filter.To,p)||(t.filter.To=p),h(p)}),n()()()(),i(31,"content")(32,"div",16)(33,"div",17)(34,"div",18),f(35,Hi,20,4,"ng-container",19)(36,Ui,2,0,"ng-template",null,0,q),n()()()()()}if(a&2){let m=U(37);o(10),d("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(4),C("ngModel",t.filter.Note),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),d("ngIf",t.data&&t.data.length>0)("ngIfElse",m)}},dependencies:[A,F,Q,Z,B,z,G,X,ie,ee,te,j,re,oe,ne,ae,H,W,V],encapsulation:2})}}return r})();var qi=[{path:"",component:bt,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:yt,canActivate:[le],data:{title:"New Order"}},{path:"detail",component:vt,canActivate:[le],data:{title:"Orders detail"}},{path:"ready_to_ship",component:Tt,canActivate:[le],data:{title:"Ready To Ship"}},{path:"Shipped",component:wt,canActivate:[le],data:{title:"Shipped"}},{path:"Delivered",component:Pt,canActivate:[le],data:{title:"Delivered"}},{path:"All",component:Et,canActivate:[le],data:{title:"All Order"}},{path:"Cancelled",component:It,canActivate:[le],data:{title:"Cancelled"}},{path:"Download",loadComponent(){return import("./chunk-CNL3HZIH.js").then(r=>r.DownloadV2Component)},canActivate:[le],data:{title:"Download"}},{path:"Download_Order_Log",loadComponent:()=>import("./chunk-JNXB7GCX.js").then(r=>r.DownloadOrderLogComponent),canActivate:[le],data:{title:"Download Order Log"}},{path:"Download_Order_Log/Detail",loadComponent:()=>import("./chunk-JTZJTXCN.js").then(r=>r.DownloadOrderDetailComponent),canActivate:[le],data:{title:"Download Order Log Detail"}}]}],Nt=(()=>{class r{static{this.\u0275fac=function(a){return new(a||r)}}static{this.\u0275mod=Me({type:r})}static{this.\u0275inj=De({imports:[he,Le.forChild(qi)]})}}return r})();var Va=(()=>{class r{static{this.\u0275fac=function(a){return new(a||r)}}static{this.\u0275mod=Me({type:r})}static{this.\u0275inj=De({providers:[Ae,Fe,We],imports:[he,Ze,Nt,mt,rt,ut,Le,$e,gt,st,j,_t,et,lt,St,at,ct,ot,H,Be,Ct,dt]})}}return r})();export{Va as OrdersModule};
|
|
4
|
+
</ol>`;this.toastr.warning(m,"Warning",{enableHtml:!0})}else{let m=`<ol>${this.generateErrorMessage(a)}</ol>`;this.toastr.error(m,"Error",{enableHtml:!0})}}generateSuccessMessage(e){let a="";return e.forEach(t=>{a+=`<li><b>${t.OrderNumber}</b> was successfully Accept</li>`}),a}generateErrorMessage(e){let a="";return e.forEach(t=>{a+=`<li><b>${t.OrderNumber}</b> ${t.Message}</li>`}),a}static{this.\u0275fac=function(a){return new(a||r)(se(R),se(Ve))}}static{this.\u0275prov=Ne({token:r,factory:r.\u0275fac})}}return r})();function Ot(r,c){if(r&1){let e=D();P(0),i(1,"button",20),v("click",function(){g(e);let t=s().ngIf,m=s();return h(m.onAcceptOrder(t))}),S(2,"i",21),l(3," Accept "),n(),E()}}function Lt(r,c){if(r&1&&(P(0),f(1,Ot,4,0,"ng-container",3),E()),r&2){let e=s();o(),d("ngIf",e.isTokopediaAvailable&&e.isTokopediaSelected)}}function kt(r,c){if(r&1&&(i(0,"span",22),S(1,"img",23),n(),l(2)),r&2){let e=c.item;o(),d("src",e==null?null:e.Img,O),o(),I(" ",e.Name," ")}}function Vt(r,c){if(r&1){let e=D();P(0),i(1,"th",35)(2,"input",36),y("ngModelChange",function(t){g(e);let m=s(3);return b(m.isCheckAll,t)||(m.isCheckAll=t),h(t)}),v("ngModelChange",function(){g(e);let t=s(2).ngIf,m=s();return h(m.onSelectAllOrderData(t))}),n()(),E()}if(r&2){let e=s(3);o(2),C("ngModel",e.isCheckAll)}}function At(r,c){if(r&1){let e=D();P(0),i(1,"input",36),y("ngModelChange",function(t){g(e);let m=s(2).$implicit;return b(m.selected,t)||(m.selected=t),h(t)}),v("ngModelChange",function(){g(e);let t=s(4).ngIf,m=s();return h(m.onSelectOrderData(t))}),n(),E()}if(r&2){let e=s(2).$implicit;o(),C("ngModel",e.selected)}}function Ft(r,c){if(r&1&&(P(0),i(1,"td"),f(2,At,2,1,"ng-container",3),n(),E()),r&2){let e=s().$implicit,a=s(3);o(2),d("ngIf",e.Type==a.tokopediaType)}}function Rt(r,c){if(r&1&&(P(0),i(1,"span"),l(2),n(),E()),r&2){let e=s().$implicit;o(2),u(e.Number)}}function Wt(r,c){if(r&1&&(i(0,"a",38),l(1),n()),r&2){let e=s().$implicit,a=s(3);d("href",a.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+e.ID,O),o(),u(e.Number)}}function Bt(r,c){if(r&1&&(i(0,"tr"),f(1,Ft,3,1,"ng-container",3),i(2,"td"),l(3),n(),i(4,"td"),f(5,Rt,3,1,"ng-container",24)(6,Wt,2,2,"ng-template",null,1,q),n(),i(8,"td"),l(9),n(),i(10,"td"),l(11),T(12,"date"),n(),i(13,"td"),S(14,"app-channel-logo",37),n()()),r&2){let e=c.$implicit,a=U(7),t=s(3);o(),d("ngIf",t.isTokopediaAvailable),o(2),u(e.Outlet),o(2),d("ngIf",e.ID==t.guidEmpty)("ngIfElse",a),o(4),u(e.Customer),o(2),u(k(12,7,e.Created,"dd MMM yyyy HH:mm")),o(3),d("typeId",e.Type)}}function zt(r,c){if(r&1){let e=D();P(0),i(1,"div",25)(2,"table",26),v("matSortChange",function(t){g(e);let m=s(2);return h(m.onSort(t))}),i(3,"thead",27)(4,"tr",28),f(5,Vt,3,1,"ng-container",3),i(6,"th",29),l(7,"Outlet"),n(),i(8,"th",30),l(9,"Order number"),n(),i(10,"th"),l(11,"Customer"),n(),i(12,"th",31),l(13," Created On "),n(),i(14,"th",32),l(15,"Channel"),n()()(),i(16,"tbody"),f(17,Bt,15,10,"tr",33),n()(),i(18,"app-mat-paginator-no-count",34),T(19,"async"),T(20,"async"),v("total",function(){g(e);let t=s(2);return h(t.getPaginatonTotal())})("next",function(){g(e);let t=s(2);return h(t.onNextPage())})("previous",function(){g(e);let t=s(2);return h(t.onPreviousPage())}),n()(),E()}if(r&2){let e,a=s().ngIf,t=s();o(5),d("ngIf",t.isTokopediaAvailable&&a),o(12),d("ngForOf",a),o(),d("filter",t.filter)("totaldata",(e=M(19,5,t.newOrdersData$))==null?null:e.length)("paginationTotal",M(20,7,t.paginationTotal$))}}function Gt(r,c){if(r&1&&(P(0),f(1,zt,21,9,"ng-container",24),E()),r&2){let e=c.ngIf;s();let a=U(36);o(),d("ngIf",(e==null?null:e.length)>0)("ngIfElse",a)}}function jt(r,c){r&1&&(i(0,"div",39),S(1,"app-empty-state"),n())}var yt=(()=>{class r{constructor(e,a,t,m){this.localDataService=e,this.orderService=a,this.acceptOrderService=t,this.authService=m,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=N.GuidEMpty,this.tokopediaType=w.Tokopedia,this.isTokopediaSelected=!1,this.isTokopediaAvailable=!1,this.isCheckAll=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initLoadPage()}initLoadPage(){this.orderService.loadInitialPage().subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.getNewOrders()})}getNewOrders(){let e={PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.sourceObs$=this.orderService.getNewOrders(e).pipe(be()),this.newOrdersData$=this.sourceObs$.pipe(Ie(a=>{a.filter(m=>m.Type==w.Tokopedia).length>0&&(this.isTokopediaAvailable=!0)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID,this.filter.From,this.filter.To).pipe(be())}onNextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getNewOrders()}onPreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getNewOrders()}onSelectOrderData(e){this.isTokopediaSelected=!1,e.filter(t=>t.selected).length>0&&(this.isTokopediaSelected=!0)}onSelectAllOrderData(e){e=e.map(a=>(a.Type==w.Tokopedia&&(a.selected=this.isCheckAll),a)),this.onSelectOrderData(e)}onAcceptOrder(e){let a=this.getSelectedTokopediaOrders(e);this.acceptOrderService.acceptTokopediaOrders(a).subscribe(t=>{this.isTokopediaSelected=!1,location.reload()})}getSelectedTokopediaOrders(e){return e.filter(t=>t.selected).map(t=>t.Number)}onSort(e){if(e.direction==""){this.newOrdersData$=this.sourceObs$;return}if(e.active=="created"){let a=e.direction=="asc";this.newOrdersData$=this.newOrdersData$.pipe(J(t=>(t=t.sort((m,_)=>N.compare(m.Created,_.Created,a)),t)))}}static{this.\u0275fac=function(a){return new(a||r)(x(me),x(Ae),x(Fe),x($))}}static{this.\u0275cmp=L({type:r,selectors:[["app-new-order"]],standalone:!1,decls:37,vars:15,consts:[["EMPTY_STATE",""],["NOT_EMPTY",""],["headerTitle","1 - New Order","searchBoxPlaceHolder","Search Orders...",3,"onSubmit","hideSearchBox"],[4,"ngIf"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[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,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-check"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[2,"width","5px"],["type","checkbox",3,"ngModelChange","ngModel"],[3,"typeId"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=D();i(0,"mainpanel",2),v("onSubmit",function(){return g(m),h(t.getNewOrders())}),i(1,"actions"),f(2,Lt,2,1,"ng-container",3),T(3,"async"),i(4,"a",4),S(5,"i",5),i(6,"span"),l(7,"Visit our Fulfillment Display System"),n()()(),i(8,"filters")(9,"div")(10,"label",6),l(11,"Channel"),n(),i(12,"ng-select",7),y("ngModelChange",function(p){return g(m),b(t.filter.ListChannelID,p)||(t.filter.ListChannelID=p),h(p)}),f(13,kt,3,2,"ng-template",8),n()(),i(14,"div",9)(15,"label",10),l(16,"Page Number"),n(),i(17,"input",11),y("ngModelChange",function(p){return g(m),b(t.filter.PageNumber,p)||(t.filter.PageNumber=p),h(p)}),n()(),i(18,"div",9)(19,"label",10),l(20,"Page Size"),n(),i(21,"input",12),y("ngModelChange",function(p){return g(m),b(t.filter.PageSize,p)||(t.filter.PageSize=p),h(p)}),n()(),i(22,"div",9)(23,"label",13),l(24,"From/To"),n(),i(25,"div",14)(26,"datepicker",15),y("dateChange",function(p){return g(m),b(t.filter.From,p)||(t.filter.From=p),h(p)}),n()(),i(27,"div")(28,"datepicker",16),y("dateChange",function(p){return g(m),b(t.filter.To,p)||(t.filter.To=p),h(p)}),n()()()(),i(29,"content")(30,"div",17)(31,"div",18)(32,"div",19),f(33,Gt,2,2,"ng-container",3),T(34,"async"),f(35,jt,2,0,"ng-template",null,0,q),n()()()()()}a&2&&(d("hideSearchBox",!0),o(2),d("ngIf",M(3,11,t.newOrdersData$)),o(10),d("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),d("ngIf",M(34,13,t.newOrdersData$)))},dependencies:[A,F,Q,Z,ke,B,z,G,ie,ee,te,j,re,oe,ne,ae,H,Oe,V],encapsulation:2})}}return r})();var Ht=()=>["/menu/Order"];function Ut(r,c){if(r&1&&(i(0,"tr")(1,"td"),l(2),n(),i(3,"td"),l(4),T(5,"number"),n(),i(6,"td"),l(7),T(8,"number"),n()()),r&2){let e=c.$implicit;o(2),u(e.Code),o(2),u(M(5,3,e.Quantity)),o(3),u(M(8,5,e.Price))}}function qt(r,c){if(r&1&&(i(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),l(5,"Outlet Info"),n()(),i(6,"div",4)(7,"div",9),l(8," Outlet : "),n(),i(9,"div",9),l(10),n()(),i(11,"div",4)(12,"div",9),l(13," Date : "),n(),i(14,"div",9),l(15),T(16,"date"),n()(),i(17,"div",4)(18,"div",9),l(19," Status : "),n(),i(20,"div",9),l(21),n()(),i(22,"div",4)(23,"div",9),l(24," Tax Type : "),n(),i(25,"div",9),l(26),n()(),i(27,"div",4)(28,"div",9),l(29," Due Date : "),n(),i(30,"div",9),l(31),T(32,"date"),n()()(),i(33,"div",6)(34,"div",7)(35,"h3",8),l(36,"Customer Info"),n()(),i(37,"div",4)(38,"div",9),l(39," Name : "),n(),i(40,"div",9),l(41),n()(),i(42,"div",4)(43,"div",9),l(44," Email : "),n(),i(45,"div",9),l(46),n()(),i(47,"div",4)(48,"div",9),l(49," Mobile : "),n(),i(50,"div",9),l(51),n()()()(),i(52,"div",10)(53,"h3",11),l(54,"Products Sold"),n(),i(55,"div",12)(56,"table",13)(57,"thead",14)(58,"tr",15)(59,"th"),l(60,"Code"),n(),i(61,"th"),l(62,"Quantity"),n(),i(63,"th"),l(64,"Price"),n()()(),i(65,"tbody"),f(66,Ut,9,7,"tr",16),n()()()()()),r&2){let e=s();o(10),I(" ",e.model.Outlet," "),o(5),I(" ",k(16,9,e.model.Date,"dd MMM yyyy")," "),o(6),I(" ",e.model.Delivery," "),o(5),I(" ",e.model.TaxType," "),o(5),I(" ",k(32,12,e.model.DueDate,"dd MMM yyyy")," "),o(10),I(" ",e.model.Customer.Name," "),o(5),I(" ",e.model.Customer.Email," "),o(5),I(" ",e.model.Customer.Mobile," "),o(15),d("ngForOf",e.model.Variants)}}var vt=(()=>{class r{constructor(e,a){this.http=e,this.url=a,this.number=this.url.snapshot.queryParams.Number,this.outlet=this.url.snapshot.queryParams.Outlet}ngOnInit(){this.Load()}Load(){var e={Number:this.number,Outlet:this.outlet};this.http.post("/api/orders/GetInvoiceDetail",e).subscribe(a=>{this.model=a})}static{this.\u0275fac=function(a){return new(a||r)(x(R),x(Xe))}}static{this.\u0275cmp=L({type:r,selectors:[["app-detail-order"]],standalone:!1,decls:7,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-secondary","btn-fill","btn-lg","me-3",3,"routerLink"],[1,"container"],["class","row",4,"ngIf"],[1,"row"],[1,"col-4"],[1,"border","my-3","py-3","col-12"],[1,"row","m-2"],[1,"text-center"],[1,"col"],[1,"col-8"],[1,"text-center","my-3","py-3"],[1,"table-responsive"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"]],template:function(a,t){a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),n()(),i(4,"content")(5,"div",2),f(6,qt,67,15,"div",3),n()()()),a&2&&(d("headerTitle","Order #"+t.number)("hideSearchBox",!0)("hideSearchDropdown",!0),o(2),d("routerLink",K(5,Ht)),o(4),d("ngIf",t.model))},dependencies:[A,F,G,X,W,V],encapsulation:2})}}return r})();var xt=(()=>{class r{constructor(e){this.dialogRef=e,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}static{this.\u0275fac=function(a){return new(a||r)(x(tt))}}static{this.\u0275cmp=L({type:r,selectors:[["app-print-tokopedia"]],standalone:!1,decls:17,vars:1,consts:[[1,"container-fluid"],[1,"text-center","mb-4","fw-bold","mt-6"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"ngModelChange","ngModel"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click"]],template:function(a,t){a&1&&(i(0,"div",0)(1,"h2",1),l(2,"Cetak label pesanan"),n(),i(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),l(7,"Kamu akan mencetak label yang berisi detail pesanan"),n(),i(8,"div",5)(9,"mat-checkbox",6),y("ngModelChange",function(_){return b(t.tandaiSudahDicetak,_)||(t.tandaiSudahDicetak=_),_}),n(),i(10,"span",7),l(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),n()()()()(),i(12,"mat-dialog-actions",8)(13,"button",9),v("click",function(){return t.onCancel()}),l(14,"Cancel"),n(),i(15,"button",10),v("click",function(){return t.onPrint()}),l(16,"Cetak Pesanan"),n()()()),a&2&&(o(9),C("ngModel",t.tandaiSudahDicetak))},dependencies:[B,z,ft,nt,it],encapsulation:2})}}return r})();var We=(()=>{class r{constructor(e,a,t){this.http=e,this.toastr=a,this.dialog=t}getTokopediaShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/Tokopedia/Multiple",{Orders:e}).pipe(J(a=>(a=a.map(t=>(t.ChannelType=w.Tokopedia,t)),a)))}getTiktokShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/TIktok/Multiple",{Orders:e}).pipe(J(a=>(a=a.map(t=>(t.ChannelType=w.Tiktok,t)),a)))}getShopeeShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/shopee/Multiple",{Orders:e}).pipe(J(a=>(a=a.map(t=>(t.ChannelType=w.Shopee,t)),a)))}getLazadaShippingLabel(e){return this.http.post("/api/v1/Shippinglabel/lazada/Multiple",{Orders:e}).pipe(J(a=>(a=a.map(t=>(t.ChannelType=w.Lazada,t)),a)))}printShippingLabelTokopedia(e){let a={OrderNumber:e,Printed:!0};this.dialog.open(xt).afterClosed().pipe(Ye(t=>t!==void 0),Je(t=>(a.Printed=t,this.http.post("api/v1/Shippinglabel/Tokopedia",a)))).subscribe(t=>{let m=window.open("about:blank","_blank");m.document.write(t.File),m.document.close()})}printShippingLabelTiktok(e,a){let t={ShopID:a,OrderNumber:e};this.http.post("api/v1/Shippinglabel/Tiktok",t).subscribe(m=>{m.data!=null?window.open(m.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print")})}printShippingLabelShopee(e,a){let t={ShopID:a,OrderNumber:e};this.http.post("api/v1/Shippinglabel/shopee/DownloadShipping",t).subscribe(m=>{var _=Uint8Array.from(atob(m.File),ze=>ze.charCodeAt(0)),p=new Blob([_],{type:"octet/stream"});N.openDownloadFile(p,`${e}.pdf`)})}printShippingLabelLazada(e,a){let t={ShopID:a,OrderNumber:e};this.http.post("api/v1/Shippinglabel/Lazada/DownloadShipping",t).subscribe(m=>{m.result.data!=null?window.open(m.result.data.pdf_url,"_blank"):this.toastr.error(m.message,"Cannot Print")})}static{this.\u0275fac=function(a){return new(a||r)(se(R),se(Ve),se(ue))}}static{this.\u0275prov=Ne({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var de=function(r){return r.SPX="https://res.cloudinary.com/pos/image/upload/v1698216798/APP/Print%20Shipping%20Label/SPX_Logo.png",r.SICEPAT="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/SiCepat_Logo.png",r.JNT="https://res.cloudinary.com/pos/image/upload/v1698216792/APP/Print%20Shipping%20Label/J_T_Logo.png",r.ANTERAJA="https://res.cloudinary.com/pos/image/upload/v1698218271/APP/Print%20Shipping%20Label/anteraja_Logo.png",r.JNE="https://res.cloudinary.com/pos/image/upload/v1698216791/APP/Print%20Shipping%20Label/JNE_Logo.png",r.GRAB="https://res.cloudinary.com/pos/image/upload/v1698216794/APP/Print%20Shipping%20Label/GrabExpress_Logo.png",r.GOSEND="https://res.cloudinary.com/pos/image/upload/v1698218375/APP/Print%20Shipping%20Label/Gosend_Logo.png",r.LAZADA_EXPRESS="https://res.cloudinary.com/pos/image/upload/v1698914677/icons/Marketplace%20logo/lazada-Logistics.png",r}(de||{});var Ce=function(r){return r.TOKOPEDIA="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/Tokopedia_Logo.png",r.SHOPEE="https://res.cloudinary.com/pos/image/upload/v1698219243/APP/Print%20Shipping%20Label/shopee-logo.png",r.LAZADA="https://res.cloudinary.com/pos/image/upload/v1698912333/icons/Marketplace%20logo/Lazada_icon.png",r.TIKTOK="https://res.cloudinary.com/pos/image/upload/v1645761565/icons/Marketplace%20logo/tiktok-logo.png",r}(Ce||{});function Jt(r,c){if(r&1&&(P(0),i(1,"div",36)(2,"div",12)(3,"div",37),l(4),n()(),i(5,"div",12)(6,"div",37),l(7),n()()(),E()),r&2){let e=s();o(4),I(" ",e.recipient==null?null:e.recipient.City," "),o(3),I(" ",e.recipient==null?null:e.recipient.District," ")}}function Kt(r,c){if(r&1&&(P(0),i(1,"div")(2,"span",15),l(3,"Berat: "),n(),i(4,"span",18),l(5),n()(),E()),r&2){let e=s();o(5),I("",e.shippingLabel==null?null:e.shippingLabel.Weight," gr")}}function Xt(r,c){if(r&1&&(P(0),i(1,"div",38)(2,"span",14),l(3,"Batas Kirim:"),n(),i(4,"span",18),l(5),T(6,"date"),n()(),E()),r&2){let e=s();o(5),u(k(6,1,e.logistic==null?null:e.logistic.Batas_kirim,"dd-MM-yyy"))}}function Qt(r,c){if(r&1&&(P(0),i(1,"div",38)(2,"span",14),l(3,"No.Pesanan:"),n(),i(4,"span",18),l(5),n()(),E()),r&2){let e=s();o(5),u(e.shippingLabel==null?null:e.shippingLabel.OrderNumber)}}function Zt(r,c){if(r&1&&(i(0,"tr")(1,"td",39),l(2),n(),i(3,"td"),l(4),n(),i(5,"td"),l(6),n(),i(7,"td"),l(8),T(9,"number"),n()()),r&2){let e=c.$implicit,a=c.index;o(2),u(a+1),o(2),u(e.Product_Name),o(2),u(e.SKU),o(2),u(M(9,4,e.Quantity))}}var Be=(()=>{class r{constructor(){this.minDate=N.MinDate,this.channelType=w}ngOnChanges(e){e.shippingLabel&&e.shippingLabel.currentValue&&(this.initShippingLabel(),this.getShippingLogo(),this.getChannelLogo())}ngAfterViewInit(){this.initBarcodeConfig()}getChannelLogo(){switch(this.shippingLabel.ChannelType){case w.Tokopedia:this.marketplaceLogo=Ce.TOKOPEDIA;break;case w.Shopee:this.marketplaceLogo=Ce.SHOPEE;break;case w.Lazada:this.marketplaceLogo=Ce.LAZADA;break;case w.Tiktok:this.marketplaceLogo=Ce.TIKTOK;break}}getShippingLogo(){let e=this.shippingLabel.Logistic.Logistic_Name;e=e?.toLowerCase(),e.includes("anteraja")?this.shippingLogo=de.ANTERAJA:e.includes("grabexpress")?this.shippingLogo=de.GRAB:e.includes("jne")?this.shippingLogo=de.JNE:e.includes("gosend")?this.shippingLogo=de.GOSEND:e.includes("j&t")||e.includes("jnt")?this.shippingLogo=de.JNT:e.includes("sicepat")?this.shippingLogo=de.SICEPAT:e.includes("spx")?this.shippingLogo=de.SPX:(e.includes("lex")||e.includes("lx")||e.includes("lazada express"))&&(this.shippingLogo=de.LAZADA_EXPRESS)}initShippingLabel(){this.recipient=this.shippingLabel.Recipient,this.store=this.shippingLabel.Store,this.products=this.shippingLabel.Products,this.logistic=this.shippingLabel.Logistic}initBarcodeConfig(){if(N.IsNotEmpty(this.logistic?.Resi_Number)){let e=this.logistic?.Resi_Number;JsBarcode(`#RESI${this.id}`,this.logistic?.Resi_Number,{displayValue:!1,width:e.length>15?1:1.5,height:40})}N.IsNotEmpty(this.shippingLabel?.OrderNumber)&&JsBarcode(`#NO${this.id}`,this.shippingLabel?.OrderNumber,{displayValue:!1,width:this.shippingLabel?.OrderNumber.length>15?.5:1,height:40})}static{this.\u0275fac=function(a){return new(a||r)}}static{this.\u0275cmp=L({type:r,selectors:[["app-shipping-label"]],inputs:{shippingLabel:"shippingLabel",id:"id"},features:[Ke],decls:87,vars:20,consts:[[1,"label-container"],[2,"border","1px solid","padding","12px"],[1,"row","mb-2"],[1,"col-12"],[1,"d-flex","align-items-center","justify-content-between"],["width","105px",1,"border-0",3,"src"],[1,"mb-4"],[1,"row","mb-1"],[1,"text-center","fw-bold","border","p-2","fs-5","border-dark"],[1,"me-2"],[1,"col-12","text-center"],[3,"id"],[1,"col-6"],[1,"d-flex"],[1,"fw-bold","fs-6","me-1"],[1,"fw-bold","fs-6"],[1,"mt-2"],[1,"mb-0","fs-6",2,"max-width","200px","word-wrap","break-word"],[1,"fs-6"],[1,"fs-6",2,"word-wrap","break-word","max-width","160px"],[4,"ngIf"],[1,"row","px-6"],[1,"col-5","border","border-dark","border-end-0","text-center","p-2"],[1,"col-7","border","border-dark","p-2","text-center","fs-6"],[1,"fst-italic"],[1,"row"],[1,"col-5","pt-4",2,"padding-right","0px"],[1,"d-flex","justify-content-between"],[1,"col-7","text-center"],[1,"mt-1",3,"id"],[1,"table","table-sm","fs-6"],[1,"text-center",2,"width","5px"],[2,"width","150px"],[2,"width","50px"],[2,"width","25px"],[4,"ngFor","ngForOf"],[1,"row","mb-4"],[1,"text-center","fw-bold","border","p-2","fs-6","border-dark","text-uppercase"],[1,"mt-4"],[1,"text-center"]],template:function(a,t){a&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div"),S(6,"img",5),n(),i(7,"div")(8,"h4"),l(9),n()(),i(10,"div"),S(11,"img",5),n()()()(),i(12,"div",6),S(13,"hr"),n(),i(14,"div",7)(15,"div",3)(16,"div",8)(17,"span",9),l(18),n(),i(19,"span"),l(20),n()()()(),i(21,"div",7)(22,"div",10),Ge(),S(23,"svg",11),n()(),je(),i(24,"div",6),S(25,"hr"),n(),i(26,"div",2)(27,"div",12)(28,"div",13)(29,"div",14),l(30,"Penerima: "),n(),i(31,"div",15),l(32),n()(),i(33,"div",16)(34,"span",15),l(35,"Alamat Pengiriman:"),n(),i(36,"div",17),l(37),n()()(),i(38,"div",12)(39,"div",13)(40,"div",14),l(41,"Pengirim: "),n(),i(42,"div")(43,"div",15),l(44),n(),i(45,"div",18),l(46),n(),i(47,"div",19),l(48),n()()(),S(49,"div"),n()(),f(50,Jt,8,2,"ng-container",20),i(51,"div",21)(52,"div",22)(53,"div",15),l(54,"CASHLESS"),n()(),i(55,"div",23)(56,"small",24),l(57,"Penjual tidak perlu membayar ongkos kirim ke kurir"),n()()(),i(58,"div",25)(59,"div",26)(60,"div",27),f(61,Kt,6,1,"ng-container",20),i(62,"div")(63,"span",15),l(64,"COD: "),n(),i(65,"span",18),l(66),T(67,"number"),n()()(),f(68,Xt,7,4,"ng-container",20)(69,Qt,6,1,"ng-container",20),n(),i(70,"div",28),Ge(),S(71,"svg",29),n()()(),je(),i(72,"div",25)(73,"div",3)(74,"table",30)(75,"thead")(76,"tr")(77,"th",31),l(78,"No."),n(),i(79,"th",32),l(80,"Nama Produk"),n(),i(81,"th",33),l(82,"SKU"),n(),i(83,"th",34),l(84,"Qty"),n()()(),i(85,"tbody"),f(86,Zt,10,6,"tr",35),n()()()()()),a&2&&(o(6),d("src",t.marketplaceLogo,O),o(3),u(t.logistic==null?null:t.logistic.Service),o(2),d("src",t.shippingLogo,O),o(7),I(" ",(t.shippingLabel==null?null:t.shippingLabel.ChannelType)==(t.channelType==null?null:t.channelType.Tokopedia)?"Kode Booking: ":"No. Resi: "," "),o(2),u(t.logistic==null?null:t.logistic.Resi_Number),o(3),d("id","RESI"+t.id),o(9),u(t.recipient==null?null:t.recipient.Name),o(5),I(" ",t.recipient==null?null:t.recipient.Address," "),o(7),u(t.store==null?null:t.store.Name),o(2),u(t.store==null?null:t.store.Phone),o(2),I(" ",t.store==null?null:t.store.Address," "),o(2),d("ngIf",(t.recipient==null?null:t.recipient.City)&&(t.recipient==null?null:t.recipient.District)),o(11),d("ngIf",t.shippingLabel==null?null:t.shippingLabel.Weight),o(5),I("Rp. ",t.shippingLabel!=null&&t.shippingLabel.IsCOD?M(67,18,t.shippingLabel==null||t.shippingLabel.SummaryPrice==null?null:t.shippingLabel.SummaryPrice.Total):0,""),o(2),d("ngIf",(t.logistic==null?null:t.logistic.Batas_kirim)&&(t.logistic==null?null:t.logistic.Batas_kirim)!==t.minDate),o(),d("ngIf",t.shippingLabel==null?null:t.shippingLabel.OrderNumber),o(2),d("id","NO"+t.id),o(15),d("ngForOf",t.products))},dependencies:[he,A,F,W,V],styles:[".table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{border:none!important}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-transform:capitalize;padding:4px!important}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border:none!important;padding:2px 2px 2px 5px!important;font-size:10px}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.4509803922)}.label-container[_ngcontent-%COMP%]{width:465px;float:left}hr[_ngcontent-%COMP%]{opacity:.8;margin:0}"]})}}return r})();var ei=()=>["/menu/Order/detail"],ti=(r,c)=>({Number:r,Outlet:c});function ii(r,c){if(r&1){let e=D();P(0),i(1,"button",21),v("click",function(){g(e);let t=s();return h(t.onPrintMultipleShippingLabel())}),S(2,"i",22),i(3,"span"),l(4,"Print Shipping Label"),n()(),E()}}function ni(r,c){if(r&1&&(i(0,"span",23),S(1,"img",24),n(),l(2)),r&2){let e=c.item;o(),d("src",e==null?null:e.Img,O)("alt",e.Name),o(),I(" ",e.Name," ")}}function ai(r,c){if(r&1){let e=D();P(0),i(1,"input",31),y("ngModelChange",function(t){g(e);let m=s().$implicit;return b(m.Selected,t)||(m.Selected=t),h(t)}),v("ngModelChange",function(){g(e);let t=s(3).ngIf,m=s();return h(m.onSelectReadyToShip(t))}),n(),E()}if(r&2){let e=s().$implicit;o(),C("ngModel",e.Selected)}}function ri(r,c){if(r&1&&(i(0,"a",44),l(1),n()),r&2){let e=s().$implicit;d("routerLink",K(3,ei))("queryParams",pe(4,ti,e.Number,e.Outlet)),o(),u(e.Number)}}function oi(r,c){if(r&1&&(i(0,"a",45),l(1),n()),r&2){let e=s().$implicit,a=s(3);d("href",a.domain+e.ID,O),o(),u(e.Number)}}function li(r,c){if(r&1){let e=D();i(0,"a",46),v("click",function(){g(e);let t=s().$implicit,m=s(3);return h(m.onPrintShippingLabel(t.Number,t.ShopID,t.TypeID))}),S(1,"i",47),n()}}function pi(r,c){if(r&1&&(i(0,"tr")(1,"td"),f(2,ai,2,1,"ng-container",4),n(),i(3,"td"),l(4),n(),i(5,"td"),f(6,ri,2,7,"a",39)(7,oi,2,2,"a",40),n(),i(8,"td"),l(9),n(),i(10,"td"),l(11),T(12,"number"),n(),i(13,"td"),l(14),T(15,"date"),n(),i(16,"td"),S(17,"app-channel-logo",41),n(),i(18,"td",42),f(19,li,2,0,"a",43),n()()),r&2){let e=c.$implicit,a=s(3);o(2),d("ngIf",e.TypeID==a.channelType.Shopee||e.TypeID==a.channelType.Tokopedia||e.TypeID==a.channelType.Tiktok),o(2),u(e.Outlet),o(2),d("ngIf",a.guidEmpty==e.ID),o(),d("ngIf",a.guidEmpty!=e.ID),o(2),u(e.Customer),o(2),u(M(12,9,e.Amount)),o(3),u(k(15,11,e.Date,"dd MMM yyyy")),o(3),d("typeId",e.TypeID),o(2),d("ngIf",e.TypeID==a.channelType.Shopee||e.TypeID==a.channelType.Tokopedia||e.TypeID==a.channelType.Tiktok||e.TypeID==a.channelType.Lazada)}}function mi(r,c){if(r&1){let e=D();P(0),i(1,"div",26)(2,"table",27),v("matSortChange",function(t){g(e);let m=s(2);return h(m.onSort(t))}),i(3,"thead",28)(4,"tr",29)(5,"th",30)(6,"input",31),y("ngModelChange",function(t){g(e);let m=s(2);return b(m.isCheckAll,t)||(m.isCheckAll=t),h(t)}),v("ngModelChange",function(){g(e);let t=s().ngIf,m=s();return h(m.onSelectAllReadyToShip(t))}),n()(),i(7,"th",32),l(8,"Outlet"),n(),i(9,"th",33),l(10,"Order number"),n(),i(11,"th"),l(12,"Customer"),n(),i(13,"th",34),l(14,"Amount"),n(),i(15,"th",35),l(16,"Date"),n(),i(17,"th",36),l(18,"Channel"),n(),S(19,"th",37),n()(),i(20,"tbody"),f(21,pi,20,14,"tr",20),n()(),i(22,"app-mat-paginator-no-count",38),T(23,"async"),T(24,"async"),v("total",function(){g(e);let t=s(2);return h(t.getRowCount())})("next",function(){g(e);let t=s(2);return h(t.NextPage())})("previous",function(){g(e);let t=s(2);return h(t.PreviousPage())}),n()(),E()}if(r&2){let e,a=s().ngIf,t=s();o(6),C("ngModel",t.isCheckAll),o(15),d("ngForOf",a),o(),d("filter",t.filter)("totaldata",(e=M(23,5,t.readyToShip$))==null?null:e.length)("paginationTotal",M(24,7,t.paginationTotal$))}}function di(r,c){if(r&1&&(P(0),f(1,mi,25,9,"ng-container",25),E()),r&2){let e=c.ngIf;s();let a=U(35);o(),d("ngIf",e.length>0)("ngIfElse",a)}}function si(r,c){r&1&&(i(0,"div",48),S(1,"app-empty-state"),n())}function ci(r,c){r&1&&(P(0),i(1,"div",50),l(2,"\xA0"),n(),E())}function gi(r,c){if(r&1&&(P(0),S(1,"app-shipping-label",49),f(2,ci,3,0,"ng-container",4),E()),r&2){let e=c.$implicit,a=c.index,t=s();o(),d("shippingLabel",e)("id",a),o(),d("ngIf",a!==(t.shippingLabels==null?null:t.shippingLabels.length)-1)}}var Tt=(()=>{class r{constructor(e,a,t,m,_,p){this.http=e,this.localDataService=a,this.dialog=t,this.shippingLabelService=m,this.datePipe=_,this.authService=p,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.channelType=w,this.guidEmpty=N.GuidEMpty,this.selectedReadyToShip=[],this.isCheckAll=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.getReadyToShip()})}getReadyToShip(e){var a={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.sourceObs$=this.http.post("api/orders/GetReadyToShip",a).pipe(J(t=>t.Data),be(1)),this.readyToShip$=this.sourceObs$}onPrintMultipleShippingLabel(){let e=this.filterReadyToShipByChannel(this.selectedReadyToShip,w.Tokopedia),a=this.filterReadyToShipByChannel(this.selectedReadyToShip,w.Shopee),t=this.filterReadyToShipByChannel(this.selectedReadyToShip,w.Tiktok),m=[];e.length>0&&m.push(this.shippingLabelService.getTokopediaShippingLabel(this.shippingLabelPayload(e))),a.length>0&&m.push(this.shippingLabelService.getShopeeShippingLabel(this.shippingLabelPayload(a))),t.length>0&&m.push(this.shippingLabelService.getTiktokShippingLabel(this.shippingLabelPayload(t))),qe(m).pipe(J(_=>_.reduce((p,ze)=>p.concat(ze),[]))).subscribe({next:_=>{this.shippingLabels=_,this.printShippingLabel()}})}filterReadyToShipByChannel(e,a){return e.filter(t=>t.TypeID==a)}shippingLabelPayload(e){return e.map(a=>({ShopID:a.ShopID,OrderNumber:a.Number}))}printShippingLabel(){setTimeout(()=>{this.setPdfname(),window.print()},500)}onPrintShippingLabel(e,a,t){switch(t){case w.Tokopedia:this.shippingLabelService.printShippingLabelTokopedia(e);break;case w.Tiktok:this.shippingLabelService.printShippingLabelTiktok(e,a);break;case w.Shopee:this.shippingLabelService.printShippingLabelShopee(e,a);break;case w.Lazada:this.shippingLabelService.printShippingLabelLazada(e,a);break}}setPdfname(){if(this.selectedReadyToShip.length>1){let e=new Date,a=this.datePipe.transform(e,"dd-MM-yyyy"),t=this.datePipe.transform(e,"HH-mm");document.title=`ShippingLabel_${a}_${t}`}else{let e=this.selectedReadyToShip[0].Number;document.title=`ShippingLabel_${e}`}}getSelectedReadyToShip(e){return e.filter(a=>a.Selected)}getRowCount(){var e={PaymentState:"Unpaid",DeliveryState:"Unsent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.paginationTotal$=this.http.post("api/orders/GetRowCount",e).pipe(J(a=>a?.Total))}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getReadyToShip()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getReadyToShip()}onSort(e){if(e.direction==""){this.readyToShip$=this.sourceObs$;return}if(e.active=="date"){let a=e.direction=="asc";this.readyToShip$=this.readyToShip$.pipe(J(t=>t.sort((m,_)=>N.compare(m.Date,_.Date,a))))}}onSelectReadyToShip(e){this.selectedReadyToShip=this.getSelectedReadyToShip(e)}onSelectAllReadyToShip(e){e=e.map(a=>((a.TypeID==w.Tokopedia||a.TypeID==w.Shopee||a.TypeID==w.Lazada)&&(a.Selected=this.isCheckAll),a)),this.selectedReadyToShip=this.getSelectedReadyToShip(e)}static{this.\u0275fac=function(a){return new(a||r)(x(R),x(me),x(ue),x(We),x(V),x($))}}static{this.\u0275cmp=L({type:r,selectors:[["app-ready-to-ship"]],standalone:!1,decls:38,vars:13,consts:[["EMPTY_STATE",""],["headerTitle","2 - Ready to Ship","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[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,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3","d-print-none"],[1,"row"],[1,"col-md-12"],[1,"print_containers"],[4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","5px"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","date",2,"width","130px"],[2,"width","114px"],[2,"width","10px"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[3,"shippingLabel","id"],[1,"page-break"]],template:function(a,t){if(a&1){let m=D();i(0,"mainpanel",1),v("onSubmit",function(p){return g(m),h(t.getReadyToShip(p))}),i(1,"actions")(2,"a",2),S(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),n()(),f(6,ii,5,0,"ng-container",4),n(),i(7,"filters")(8,"div")(9,"label",5),l(10,"Channel"),n(),i(11,"ng-select",6),y("ngModelChange",function(p){return g(m),b(t.filter.ListChannelID,p)||(t.filter.ListChannelID=p),h(p)}),f(12,ni,3,3,"ng-template",7),n()(),i(13,"div",8)(14,"label",9),l(15,"Page Number"),n(),i(16,"input",10),y("ngModelChange",function(p){return g(m),b(t.filter.PageNumber,p)||(t.filter.PageNumber=p),h(p)}),n()(),i(17,"div",8)(18,"label",9),l(19,"Page Size"),n(),i(20,"input",11),y("ngModelChange",function(p){return g(m),b(t.filter.PageSize,p)||(t.filter.PageSize=p),h(p)}),n()(),i(21,"div",8)(22,"label",12),l(23,"From/To"),n(),i(24,"div",13)(25,"datepicker",14),y("dateChange",function(p){return g(m),b(t.filter.From,p)||(t.filter.From=p),h(p)}),n()(),i(26,"div")(27,"datepicker",15),y("dateChange",function(p){return g(m),b(t.filter.To,p)||(t.filter.To=p),h(p)}),n()()()(),i(28,"content")(29,"div",16)(30,"div",17)(31,"div",18),f(32,di,2,2,"ng-container",4),T(33,"async"),f(34,si,2,0,"ng-template",null,0,q),n()()()()(),i(36,"div",19),f(37,gi,3,3,"ng-container",20),n()}a&2&&(o(6),d("ngIf",t.selectedReadyToShip.length>0),o(5),d("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),d("ngIf",M(33,11,t.readyToShip$)),o(5),d("ngForOf",t.shippingLabels))},dependencies:[A,F,Q,Z,ke,B,z,G,X,ie,ee,te,j,re,oe,ne,ae,H,Be,Oe,W,V],styles:[".print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block}}@media print{.page-break[_ngcontent-%COMP%]{page-break-after:always}}"]})}}return r})();var hi=()=>["/menu/Order/detail"],ui=(r,c)=>({Number:r,Outlet:c});function _i(r,c){if(r&1&&(i(0,"span",19),S(1,"img",20),n(),l(2)),r&2){let e=c.item;o(),d("src",e==null?null:e.Img,O)("alt",e.Name),o(),I(" ",e.Name," ")}}function fi(r,c){if(r&1&&(i(0,"a",35),l(1),n()),r&2){let e=s().$implicit;d("routerLink",K(3,hi))("queryParams",pe(4,ui,e.Number,e.Outlet)),o(),u(e.Number)}}function Si(r,c){if(r&1&&(i(0,"a",36),l(1),n()),r&2){let e=s().$implicit,a=s(2);d("href",a.domain+e.ID,O),o(),u(e.Number)}}function Ci(r,c){if(r&1&&(i(0,"tr")(1,"td"),l(2),n(),i(3,"td"),f(4,fi,2,7,"a",32)(5,Si,2,2,"a",33),n(),i(6,"td"),l(7),n(),i(8,"td"),l(9),T(10,"number"),n(),i(11,"td"),l(12),T(13,"date"),n(),i(14,"td"),S(15,"app-channel-logo",34),n()()),r&2){let e=c.$implicit,a=s(2);o(2),u(e.Outlet),o(2),d("ngIf",a.hasGuidEmpty(e.ID)),o(),d("ngIf",!a.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,7,e.Amount)),o(3),u(k(13,9,e.Created,"dd MMM yyyy HH:mm")),o(3),d("typeId",e.TypeID)}}function bi(r,c){if(r&1){let e=D();P(0),i(1,"div",21)(2,"table",22),v("matSortChange",function(t){g(e);let m=s();return h(m.onSort(t))}),i(3,"thead",23)(4,"tr",24)(5,"th",25),l(6,"Outlet"),n(),i(7,"th",26),l(8,"Order number"),n(),i(9,"th"),l(10,"Customer"),n(),i(11,"th",27),l(12,"Amount"),n(),i(13,"th",28),l(14," Created On "),n(),i(15,"th",29),l(16,"Channel"),n()()(),i(17,"tbody"),f(18,Ci,16,12,"tr",30),n()(),i(19,"app-mat-paginator-no-count",31),v("total",function(){g(e);let t=s();return h(t.StoreRowsCountAPIResult())})("next",function(){g(e);let t=s();return h(t.NextPage())})("previous",function(){g(e);let t=s();return h(t.PreviousPage())}),n()(),E()}if(r&2){let e=s();o(18),d("ngForOf",e.data),o(),d("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function yi(r,c){r&1&&(i(0,"div",37),S(1,"app-empty-state"),n())}var wt=(()=>{class r{constructor(e,a,t){this.http=e,this.localDataService=a,this.authService=t,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=w,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}hasGuidEmpty(e){return e==N.GuidEMpty}Get(e){var a={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetShipped",a).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"Unpaid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(a=>{this.paginationTotal=a.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let a=e.direction=="asc";this.data=this.data.sort((t,m)=>N.compare(t.Created,m.Created,a))}}static{this.\u0275fac=function(a){return new(a||r)(x(R),x(me),x($))}}static{this.\u0275cmp=L({type:r,selectors:[["app-shipped"]],standalone:!1,decls:34,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","3 - Shipped","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[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,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=D();i(0,"mainpanel",1),v("onSubmit",function(p){return g(m),h(t.Get(p))}),i(1,"actions")(2,"a",2),S(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),n()()(),i(6,"filters")(7,"div")(8,"label",4),l(9,"Channel"),n(),i(10,"ng-select",5),y("ngModelChange",function(p){return g(m),b(t.filter.ListChannelID,p)||(t.filter.ListChannelID=p),h(p)}),f(11,_i,3,3,"ng-template",6),n()(),i(12,"div",7)(13,"label",8),l(14,"Page Number"),n(),i(15,"input",9),y("ngModelChange",function(p){return g(m),b(t.filter.PageNumber,p)||(t.filter.PageNumber=p),h(p)}),n()(),i(16,"div",7)(17,"label",8),l(18,"Page Size"),n(),i(19,"input",10),y("ngModelChange",function(p){return g(m),b(t.filter.PageSize,p)||(t.filter.PageSize=p),h(p)}),n()(),i(20,"div",7)(21,"label",11),l(22,"From/To"),n(),i(23,"div",12)(24,"datepicker",13),y("dateChange",function(p){return g(m),b(t.filter.From,p)||(t.filter.From=p),h(p)}),n()(),i(25,"div")(26,"datepicker",14),y("dateChange",function(p){return g(m),b(t.filter.To,p)||(t.filter.To=p),h(p)}),n()()()(),i(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),f(31,bi,20,4,"ng-container",18)(32,yi,2,0,"ng-template",null,0,q),n()()()()()}if(a&2){let m=U(33);o(10),d("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),d("ngIf",t.data&&t.data.length>0)("ngIfElse",m)}},dependencies:[A,F,Q,Z,B,z,G,X,ie,ee,te,j,re,oe,ne,ae,H,W,V],encapsulation:2})}}return r})();var vi=()=>["/menu/Order/detail"],xi=(r,c)=>({Number:r,Outlet:c});function Ti(r,c){if(r&1&&(i(0,"span",19),S(1,"img",20),n(),l(2)),r&2){let e=c.item;o(),d("src",e==null?null:e.Img,O)("alt",e.Name),o(),I(" ",e.Name," ")}}function wi(r,c){if(r&1&&(i(0,"a",35),l(1),n()),r&2){let e=s().$implicit;d("routerLink",K(3,vi))("queryParams",pe(4,xi,e.Number,e.Outlet)),o(),u(e.Number)}}function Pi(r,c){if(r&1&&(i(0,"a",36),l(1),n()),r&2){let e=s().$implicit,a=s(2);d("href",a.customerInfoUrl+e.ID,O),o(),u(e.Number)}}function Ei(r,c){if(r&1&&(i(0,"tr")(1,"td"),l(2),n(),i(3,"td"),f(4,wi,2,7,"a",32)(5,Pi,2,2,"a",33),n(),i(6,"td"),l(7),n(),i(8,"td"),l(9),T(10,"number"),n(),i(11,"td"),l(12),T(13,"date"),n(),i(14,"td"),S(15,"app-channel-logo",34),n()()),r&2){let e=c.$implicit,a=s(2);o(2),u(e.Outlet),o(2),d("ngIf",a.hasGuidEmpty(e.ID)),o(),d("ngIf",!a.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,7,e.Amount)),o(3),u(k(13,9,e.Created,"dd MMM yyyy HH:mm")),o(3),d("typeId",e.TypeID)}}function Ii(r,c){if(r&1){let e=D();P(0),i(1,"div",21)(2,"table",22),v("matSortChange",function(t){g(e);let m=s();return h(m.onSort(t))}),i(3,"thead",23)(4,"tr",24)(5,"th",25),l(6,"Outlet"),n(),i(7,"th",26),l(8,"Order number"),n(),i(9,"th"),l(10,"Customer"),n(),i(11,"th",27),l(12,"Amount"),n(),i(13,"th",28),l(14," Created On "),n(),i(15,"th",29),l(16,"Channel"),n()()(),i(17,"tbody"),f(18,Ei,16,12,"tr",30),n()(),i(19,"app-mat-paginator-no-count",31),v("total",function(){g(e);let t=s();return h(t.StoreRowsCountAPIResult())})("next",function(){g(e);let t=s();return h(t.NextPage())})("previous",function(){g(e);let t=s();return h(t.PreviousPage())}),n()(),E()}if(r&2){let e=s();o(18),d("ngForOf",e.data),o(),d("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function Ni(r,c){r&1&&(i(0,"div",37),S(1,"app-empty-state"),n())}var Pt=(()=>{class r{constructor(e,a){this.http=e,this.authService=a,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=w,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==N.GuidEMpty}getChannelLogo(e){return N.getChannelLogoByTypeId(e)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.customerInfoUrl=`${this.authService.getDomain()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var a={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetDelivered ",a).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"Paid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(a=>{this.paginationTotal=a.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let a=e.direction=="asc";this.data=this.data.sort((t,m)=>N.compare(t.Created,m.Created,a))}}static{this.\u0275fac=function(a){return new(a||r)(x(R),x($))}}static{this.\u0275cmp=L({type:r,selectors:[["app-delivered"]],standalone:!1,decls:34,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","4 - Completed","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[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,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=D();i(0,"mainpanel",1),v("onSubmit",function(p){return g(m),h(t.Get(p))}),i(1,"actions")(2,"a",2),S(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),n()()(),i(6,"filters")(7,"div")(8,"label",4),l(9,"Channel"),n(),i(10,"ng-select",5),y("ngModelChange",function(p){return g(m),b(t.filter.ListChannelID,p)||(t.filter.ListChannelID=p),h(p)}),f(11,Ti,3,3,"ng-template",6),n()(),i(12,"div",7)(13,"label",8),l(14,"Page Number"),n(),i(15,"input",9),y("ngModelChange",function(p){return g(m),b(t.filter.PageNumber,p)||(t.filter.PageNumber=p),h(p)}),n()(),i(16,"div",7)(17,"label",8),l(18,"Page Size"),n(),i(19,"input",10),y("ngModelChange",function(p){return g(m),b(t.filter.PageSize,p)||(t.filter.PageSize=p),h(p)}),n()(),i(20,"div",7)(21,"label",11),l(22,"From/To"),n(),i(23,"div",12)(24,"datepicker",13),y("dateChange",function(p){return g(m),b(t.filter.From,p)||(t.filter.From=p),h(p)}),n()(),i(25,"div")(26,"datepicker",14),y("dateChange",function(p){return g(m),b(t.filter.To,p)||(t.filter.To=p),h(p)}),n()()()(),i(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),f(31,Ii,20,4,"ng-container",18)(32,Ni,2,0,"ng-template",null,0,q),n()()()()()}if(a&2){let m=U(33);o(10),d("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),d("ngIf",t.data&&t.data.length>0)("ngIfElse",m)}},dependencies:[A,F,Q,Z,B,z,G,X,ie,ee,te,j,re,oe,ne,ae,H,W,V],encapsulation:2})}}return r})();var Di=()=>["/menu/Order/detail"],Mi=(r,c)=>({Number:r,Outlet:c});function Oi(r,c){if(r&1&&(i(0,"span",21),S(1,"img",22),n(),l(2)),r&2){let e=c.item;o(),d("src",e==null?null:e.Img,O)("alt",e.Name),o(),I(" ",e.Name," ")}}function Li(r,c){if(r&1&&(i(0,"a",38),l(1),n()),r&2){let e=s().$implicit;d("routerLink",K(3,Di))("queryParams",pe(4,Mi,e.Number,e.Outlet)),o(),u(e.Number)}}function ki(r,c){if(r&1&&(i(0,"a",39),l(1),n()),r&2){let e=s().$implicit,a=s(2);d("href",a.domain+e.ID,O),o(),u(e.Number)}}function Vi(r,c){if(r&1&&(i(0,"tr")(1,"td"),l(2),n(),i(3,"td"),f(4,Li,2,7,"a",35)(5,ki,2,2,"a",36),n(),i(6,"td"),l(7),n(),i(8,"td"),l(9),T(10,"number"),n(),i(11,"td"),l(12),T(13,"date"),n(),i(14,"td"),l(15),n(),i(16,"td"),S(17,"app-channel-logo",37),n()()),r&2){let e=c.$implicit,a=s(2);o(2),u(e.Outlet),o(2),d("ngIf",a.hasGuidEmpty(e.ID)),o(),d("ngIf",!a.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,8,e.Amount)),o(3),u(k(13,10,e.Created,"dd MMM yyyy HH:mm")),o(3),u(e.State),o(2),d("typeId",e.TypeID)}}function Ai(r,c){if(r&1){let e=D();P(0),i(1,"div",23)(2,"table",24),v("matSortChange",function(t){g(e);let m=s();return h(m.onSort(t))}),i(3,"thead",25)(4,"tr",26)(5,"th",27),l(6,"Outlet"),n(),i(7,"th",28),l(8,"Order number"),n(),i(9,"th"),l(10,"Customer"),n(),i(11,"th",29),l(12,"Amount"),n(),i(13,"th",30),l(14," Created On "),n(),i(15,"th",31),l(16,"Status"),n(),i(17,"th",32),l(18,"Channel"),n()()(),i(19,"tbody"),f(20,Vi,18,13,"tr",33),n()(),i(21,"app-mat-paginator-no-count",34),v("total",function(){g(e);let t=s();return h(t.StoreRowsCountAPIResult())})("next",function(){g(e);let t=s();return h(t.NextPage())})("previous",function(){g(e);let t=s();return h(t.PreviousPage())}),n()(),E()}if(r&2){let e=s();o(20),d("ngForOf",e.data),o(),d("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function Fi(r,c){r&1&&(i(0,"div",40),S(1,"app-empty-state"),n())}var Et=(()=>{class r{constructor(e,a,t,m){this.http=e,this.localDataService=a,this.authService=t,this.dialog=m,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==N.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var a={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetAll",a).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.Data],this.totaldata=this.data.length})}openExportDialog(){this.dialog.open(ht,{data:{title:"Export Order All",pageNumber:this.filter.PageNumber,rowCount:this.filter.PageSize,filterExport:this.filter,getRowCountApi:"orders/GetRowCount",exportApi:"orders/GetExportAll"}}).afterClosed().subscribe()}changePage(e){this.filter=e,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"",DeliveryState:"",Bin:!1,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(a=>{this.paginationTotal=a.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let a=e.direction=="asc";this.data=this.data.sort((t,m)=>N.compare(t.Created,m.Created,a))}}static{this.\u0275fac=function(a){return new(a||r)(x(R),x(me),x($),x(ue))}}static{this.\u0275cmp=L({type:r,selectors:[["app-all-order"]],standalone:!1,decls:38,vars:10,consts:[["EMPTY_STATE",""],["headerTitle","All","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[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,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","135px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=D();i(0,"mainpanel",1),v("onSubmit",function(p){return g(m),h(t.Get(p))}),i(1,"actions")(2,"a",2),S(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),n()(),i(6,"button",4),v("click",function(){return g(m),h(t.openExportDialog())}),S(7,"i",5),i(8,"span"),l(9,"Export"),n()()(),i(10,"filters")(11,"div")(12,"label",6),l(13,"Channel"),n(),i(14,"ng-select",7),y("ngModelChange",function(p){return g(m),b(t.filter.ListChannelID,p)||(t.filter.ListChannelID=p),h(p)}),f(15,Oi,3,3,"ng-template",8),n()(),i(16,"div",9)(17,"label",10),l(18,"Page Number"),n(),i(19,"input",11),y("ngModelChange",function(p){return g(m),b(t.filter.PageNumber,p)||(t.filter.PageNumber=p),h(p)}),n()(),i(20,"div",9)(21,"label",10),l(22,"Page Size"),n(),i(23,"input",12),y("ngModelChange",function(p){return g(m),b(t.filter.PageSize,p)||(t.filter.PageSize=p),h(p)}),n()(),i(24,"div",9)(25,"label",13),l(26,"From/To"),n(),i(27,"div",14)(28,"datepicker",15),y("dateChange",function(p){return g(m),b(t.filter.From,p)||(t.filter.From=p),h(p)}),n()(),i(29,"div")(30,"datepicker",16),y("dateChange",function(p){return g(m),b(t.filter.To,p)||(t.filter.To=p),h(p)}),n()()()(),i(31,"content")(32,"div",17)(33,"div",18)(34,"div",19),f(35,Ai,22,4,"ng-container",20)(36,Fi,2,0,"ng-template",null,0,q),n()()()()()}if(a&2){let m=U(37);o(14),d("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),d("ngIf",t.data&&t.data.length>0)("ngIfElse",m)}},dependencies:[A,F,Q,Z,B,z,G,X,ie,ee,te,j,re,oe,ne,ae,H,W,V],encapsulation:2})}}return r})();var Ri=()=>["/menu/Order/detail"],Wi=(r,c)=>({Number:r,Outlet:c});function Bi(r,c){if(r&1&&(i(0,"span",20),S(1,"img",21),n(),l(2)),r&2){let e=c.item;o(),d("src",e==null?null:e.Img,O)("alt",e.Name),o(),I(" ",e.Name," ")}}function zi(r,c){if(r&1&&(i(0,"a",36),l(1),n()),r&2){let e=s().$implicit;d("routerLink",K(3,Ri))("queryParams",pe(4,Wi,e.Number,e.Outlet)),o(),u(e.Number)}}function Gi(r,c){if(r&1&&(i(0,"a",37),l(1),n()),r&2){let e=s().$implicit,a=s(2);d("href",a.domain+e.ID,O),o(),u(e.Number)}}function ji(r,c){if(r&1&&(i(0,"tr")(1,"td"),l(2),n(),i(3,"td"),f(4,zi,2,7,"a",33)(5,Gi,2,2,"a",34),n(),i(6,"td"),l(7),n(),i(8,"td"),l(9),T(10,"number"),n(),i(11,"td"),l(12),T(13,"date"),n(),i(14,"td"),S(15,"app-channel-logo",35),n()()),r&2){let e=c.$implicit,a=s(2);o(2),u(e.Outlet),o(2),d("ngIf",a.hasGuidEmpty(e.ID)),o(),d("ngIf",!a.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(M(10,7,e.Amount)),o(3),u(k(13,9,e.Created,"dd MMM yyyy HH:mm")),o(3),d("typeId",e.TypeID)}}function Hi(r,c){if(r&1){let e=D();P(0),i(1,"div",22)(2,"table",23),v("matSortChange",function(t){g(e);let m=s();return h(m.onSort(t))}),i(3,"thead",24)(4,"tr",25)(5,"th",26),l(6,"Outlet"),n(),i(7,"th",27),l(8,"Order number"),n(),i(9,"th"),l(10,"Customer"),n(),i(11,"th",28),l(12,"Amount"),n(),i(13,"th",29),l(14," Created On "),n(),i(15,"th",30),l(16,"Channel"),n()()(),i(17,"tbody"),f(18,ji,16,12,"tr",31),n()(),i(19,"app-mat-paginator-no-count",32),v("total",function(){g(e);let t=s();return h(t.StoreRowsCountAPIResult())})("next",function(){g(e);let t=s();return h(t.NextPage())})("previous",function(){g(e);let t=s();return h(t.PreviousPage())}),n()(),E()}if(r&2){let e=s();o(18),d("ngForOf",e.data),o(),d("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function Ui(r,c){r&1&&(i(0,"div",38),S(1,"app-empty-state"),n())}var It=(()=>{class r{constructor(e,a,t){this.http=e,this.localDataService=a,this.authService=t,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],Note:"",From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==N.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(e=>{this.filter.PageNumber=e.Filter.PageNumber,this.filter.PageSize=e.Filter.RowCount,this.filter.From=e.Filter.From,this.filter.To=e.Filter.To,this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(e){var a={Number:e,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID,Note:this.filter.Note,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetCancelled ",a).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.Data],this.totaldata=this.data.length})}changePage(e){this.filter.PageNumber=e.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){var e={PaymentState:"",DeliveryState:"",Bin:!0,ListChannelID:this.filter.ListChannelID,From:this.filter.From,To:this.filter.To};this.http.post("api/orders/GetRowCount",e).subscribe(a=>{this.paginationTotal=a.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}getChannelLogo(e){return N.getChannelLogoByTypeId(e)}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let a=e.direction=="asc";this.data=this.data.sort((t,m)=>N.compare(t.Created,m.Created,a))}}static{this.\u0275fac=function(a){return new(a||r)(x(R),x(me),x($))}}static{this.\u0275cmp=L({type:r,selectors:[["app-cancelled"]],standalone:!1,decls:38,vars:11,consts:[["EMPTY_STATE",""],["headerTitle","99 - Cancelled","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["href","https://ods.dealpos.app","target","_blank",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[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"],["type","text","name","Note",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table-responsive"],["matSort","",1,"table","table-hover",3,"matSortChange"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],["mat-sort-header","created",2,"width","130px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"total","next","previous","filter","totaldata","paginationTotal"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(a,t){if(a&1){let m=D();i(0,"mainpanel",1),v("onSubmit",function(p){return g(m),h(t.Get(p))}),i(1,"actions")(2,"a",2),S(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),n()()(),i(6,"filters")(7,"div")(8,"label",4),l(9,"Channel"),n(),i(10,"ng-select",5),y("ngModelChange",function(p){return g(m),b(t.filter.ListChannelID,p)||(t.filter.ListChannelID=p),h(p)}),f(11,Bi,3,3,"ng-template",6),n()(),i(12,"div",7)(13,"label",8),l(14,"Page Number"),n(),i(15,"input",9),y("ngModelChange",function(p){return g(m),b(t.filter.PageNumber,p)||(t.filter.PageNumber=p),h(p)}),n()(),i(16,"div",7)(17,"label",8),l(18,"Page Size"),n(),i(19,"input",10),y("ngModelChange",function(p){return g(m),b(t.filter.PageSize,p)||(t.filter.PageSize=p),h(p)}),n()(),i(20,"div",7)(21,"label",8),l(22,"Note"),n(),i(23,"input",11),y("ngModelChange",function(p){return g(m),b(t.filter.Note,p)||(t.filter.Note=p),h(p)}),n()(),i(24,"div",7)(25,"label",12),l(26,"From/To"),n(),i(27,"div",13)(28,"datepicker",14),y("dateChange",function(p){return g(m),b(t.filter.From,p)||(t.filter.From=p),h(p)}),n()(),i(29,"div")(30,"datepicker",15),y("dateChange",function(p){return g(m),b(t.filter.To,p)||(t.filter.To=p),h(p)}),n()()()(),i(31,"content")(32,"div",16)(33,"div",17)(34,"div",18),f(35,Hi,20,4,"ng-container",19)(36,Ui,2,0,"ng-template",null,0,q),n()()()()()}if(a&2){let m=U(37);o(10),d("clearable",!0)("multiple",!0)("items",t.channelOptions),C("ngModel",t.filter.ListChannelID),o(5),C("ngModel",t.filter.PageNumber),o(4),C("ngModel",t.filter.PageSize),o(4),C("ngModel",t.filter.Note),o(5),C("date",t.filter.From),o(2),C("date",t.filter.To),o(5),d("ngIf",t.data&&t.data.length>0)("ngIfElse",m)}},dependencies:[A,F,Q,Z,B,z,G,X,ie,ee,te,j,re,oe,ne,ae,H,W,V],encapsulation:2})}}return r})();var qi=[{path:"",component:bt,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:yt,canActivate:[le],data:{title:"New Order"}},{path:"detail",component:vt,canActivate:[le],data:{title:"Orders detail"}},{path:"ready_to_ship",component:Tt,canActivate:[le],data:{title:"Ready To Ship"}},{path:"Shipped",component:wt,canActivate:[le],data:{title:"Shipped"}},{path:"Delivered",component:Pt,canActivate:[le],data:{title:"Delivered"}},{path:"All",component:Et,canActivate:[le],data:{title:"All Order"}},{path:"Cancelled",component:It,canActivate:[le],data:{title:"Cancelled"}},{path:"Download",loadComponent(){return import("./chunk-PV6JAW7E.js").then(r=>r.DownloadV2Component)},canActivate:[le],data:{title:"Download"}},{path:"Download_Order_Log",loadComponent:()=>import("./chunk-LNXJNBJQ.js").then(r=>r.DownloadOrderLogComponent),canActivate:[le],data:{title:"Download Order Log"}},{path:"Download_Order_Log/Detail",loadComponent:()=>import("./chunk-JTZJTXCN.js").then(r=>r.DownloadOrderDetailComponent),canActivate:[le],data:{title:"Download Order Log Detail"}}]}],Nt=(()=>{class r{static{this.\u0275fac=function(a){return new(a||r)}}static{this.\u0275mod=Me({type:r})}static{this.\u0275inj=De({imports:[he,Le.forChild(qi)]})}}return r})();var Va=(()=>{class r{static{this.\u0275fac=function(a){return new(a||r)}}static{this.\u0275mod=Me({type:r})}static{this.\u0275inj=De({providers:[Ae,Fe,We],imports:[he,Ze,Nt,mt,rt,ut,Le,$e,gt,st,j,_t,et,lt,St,at,ct,ot,H,Be,Ct,dt]})}}return r})();export{Va as OrdersModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ae}from"./chunk-YXFTLQ5M.js";import{c as re}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import"./chunk-G6EG5QJS.js";import{a as X,b as Y,d as Z,e as ee}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-QCZIDOKW.js";import{l as Q}from"./chunk-
|
|
1
|
+
import{b as ae}from"./chunk-YXFTLQ5M.js";import{c as re}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import"./chunk-G6EG5QJS.js";import{a as X,b as Y,d as Z,e as ee}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-QCZIDOKW.js";import{l as Q}from"./chunk-IHYEQWAY.js";import{b as G,e as q}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{m as ne,n as oe}from"./chunk-ITTRZMEX.js";import{r as te,s as ie}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{h as A,m as H,y as z}from"./chunk-DPLEMBB4.js";import{b as d,c as J}from"./chunk-PXB4YEY3.js";import{J as b,f as W,g as $,j as k,n as v}from"./chunk-GPEVUTDI.js";import{Eb as V,Ec as s,Fb as S,Fc as _,Gc as B,Ic as O,Jc as P,Kb as g,Kc as D,Wb as l,Z as M,Zc as C,_c as L,aa as F,ea as R,gc as o,hc as r,ic as j,jc as I,ka as u,kc as T,mc as w,ob as K,q as U,qb as a,rc as E,sc as h,v as y,wb as f,ya as x,za as N}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";function me(i,m){if(i&1&&(o(0,"span",13),j(1,"img",14),r(),o(2,"span"),s(3),r()),i&2){let t=m.item;a(),l("src",t.Img,K)("alt",t.Name),a(2),B(" ",t.Name," ")}}function pe(i,m){if(i&1){let t=w();I(0),o(1,"a",15),E("click",function(){let n=x(t).ngIf,c=h();return N(c.submitLogistics(n))}),s(2,"Submit"),r(),T()}}function de(i,m){if(i&1){let t=w();I(0),o(1,"ng-select",16),D("ngModelChange",function(n){x(t);let c=h().$implicit;return P(c.ProductSKU,n)||(c.ProductSKU=n),N(n)}),r(),T()}if(i&2){let t=m.ngIf,e=h().$implicit;a(),O("ngModel",e.ProductSKU),l("items",t)}}function ge(i,m){if(i&1&&(o(0,"tr")(1,"td"),s(2),r(),o(3,"td"),s(4),r(),o(5,"td"),s(6),r(),o(7,"td"),g(8,de,2,2,"ng-container",4),C(9,"async"),r()()),i&2){let t=m.$implicit,e=h();a(2),_(t.Name),a(2),_(t.Service),a(2),_(t.TypeString),a(2),l("ngIf",L(9,4,e.logisticOptions$))}}var le=(()=>{class i{constructor(t,e,n){this.http=t,this.toastr=e,this.authService=n,this.filter={ChannelID:""},this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let t=[d.WooCommerce,d.Lazada,d.Shopify,d.Plugo,d.Tokopedia];this.channelOptions=this.channelOptions.map(e=>(t.forEach(n=>{e.TypeID===n&&(e.disabled=!0)}),e))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(t=>{this.filter=t.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(M(1))}submitLogistics(t){this.clonedLogisticServices$.pipe(y(e=>t.map(n=>(e.findIndex(p=>p.Name===n.Name&&p.ProductSKU==n.ProductSKU)==-1&&(n.IsChange=!0),n))),F(e=>this.http.post("/api/Logistic/Submit",e))).subscribe(()=>{this.toastr.success("Logistic service updated successfully.","Success"),this.getLogisticService()})}getLogisticService(){this.iniTitle(),this.logisticServices$=this.http.post("/api/Logistic/Get",this.filter).pipe(y(t=>t.map(e=>(e.ProductSKU=J.IsEmpty(e.ProductSKU)?null:e.ProductSKU,e))),R(t=>{let e=JSON.parse(JSON.stringify(t));this.clonedLogisticServices$=U(e)}),M(1))}iniTitle(){let t=this.channelOptions.find(e=>e.ID==this.filter.ChannelID);this.channelName=t?t.Name:null}static{this.\u0275fac=function(e){return new(e||i)(f(q),f(G),f(Q))}}static{this.\u0275cmp=V({type:i,selectors:[["app-logistic"]],standalone:!1,decls:29,vars:11,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(e,n){e&1&&(o(0,"mainpanel",0),E("onSubmit",function(){return n.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",1),s(4,"Select a Channel"),r(),o(5,"ng-select",2),D("ngModelChange",function(p){return P(n.filter.ChannelID,p)||(n.filter.ChannelID=p),p}),g(6,me,4,3,"ng-template",3),r()()(),o(7,"actions"),g(8,pe,3,0,"ng-container",4),C(9,"async"),r(),o(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr",11)(18,"th"),s(19,"Logistic"),r(),o(20,"th"),s(21,"Service"),r(),o(22,"th"),s(23,"Type"),r(),o(24,"th"),s(25,"Logistic Service"),r()()(),o(26,"tbody"),g(27,ge,10,6,"tr",12),C(28,"async"),r()()()()()()()()),e&2&&(l("headerTitle","Logistic Courier - "+n.channelName)("hideSearchDropdown",!1),a(5),l("clearable",!1)("items",n.channelOptions),O("ngModel",n.filter.ChannelID),a(3),l("ngIf",L(9,7,n.logisticServices$)),a(19),l("ngForOf",L(28,9,n.logisticServices$)))},dependencies:[W,$,A,H,ne,Z,X,Y,te,k],encapsulation:2})}}return i})();var he=[{path:"",component:le}],ce=(()=>{class i{static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275mod=S({type:i})}static{this.\u0275inj=u({imports:[v,b.forChild(he)]})}}return i})();var $e=(()=>{class i{static{this.\u0275fac=function(e){return new(e||i)}}static{this.\u0275mod=S({type:i})}static{this.\u0275inj=u({imports:[v,b,ce,z,oe,ee,ae,re,ie]})}}return i})();export{$e as LogisticModule};
|