marketplacepos 5.39.2 → 5.39.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/Marketplace/3rdpartylicenses.txt +8 -8
  2. package/Marketplace/{chunk-UJHSZRBK.js → chunk-247FG3AQ.js} +2 -2
  3. package/Marketplace/{chunk-6QM6RQ5F.js → chunk-2BBMPSAE.js} +1 -1
  4. package/Marketplace/{chunk-XYJMVPQE.js → chunk-2G6NLWKN.js} +1 -1
  5. package/Marketplace/chunk-2OEG7XBN.js +1 -0
  6. package/Marketplace/chunk-3A5R5QQM.js +1 -0
  7. package/Marketplace/chunk-4ASUM4N5.js +1 -0
  8. package/Marketplace/{chunk-MSNWTSDH.js → chunk-4G3QN54S.js} +1 -1
  9. package/Marketplace/chunk-4KAAAY37.js +1 -0
  10. package/Marketplace/{chunk-YWRRGL7S.js → chunk-4UHIPN3P.js} +2 -2
  11. package/Marketplace/{chunk-YNZOWISG.js → chunk-5MRT2EFE.js} +1 -1
  12. package/Marketplace/{chunk-UOLG267G.js → chunk-5QJ5RR7W.js} +1 -1
  13. package/Marketplace/{chunk-LWDDTE3V.js → chunk-62PFQNHJ.js} +1 -1
  14. package/Marketplace/chunk-6ALHX2I4.js +1 -0
  15. package/Marketplace/{chunk-LIQRQYKZ.js → chunk-6IAGGRZN.js} +1 -1
  16. package/Marketplace/{chunk-BZ3AJFKZ.js → chunk-6XFYITUD.js} +1 -1
  17. package/Marketplace/{chunk-4BKQVHMV.js → chunk-7477X7LJ.js} +1 -1
  18. package/Marketplace/{chunk-ZUKHXAUV.js → chunk-75BDXSG3.js} +10 -10
  19. package/Marketplace/{chunk-ACIMXBIC.js → chunk-77IUCPIQ.js} +1 -1
  20. package/Marketplace/{chunk-IE3ZBJEK.js → chunk-7FUVW73P.js} +1 -1
  21. package/Marketplace/chunk-7GQIIDFF.js +4 -0
  22. package/Marketplace/{chunk-FZDXTSZF.js → chunk-7TWBIV3T.js} +1 -1
  23. package/Marketplace/chunk-AMXLXRQK.js +1 -0
  24. package/Marketplace/{chunk-36DIM5LG.js → chunk-B2R7GSHL.js} +1 -1
  25. package/Marketplace/chunk-BGN2D3PG.js +8 -0
  26. package/Marketplace/{chunk-5SXUJ5XH.js → chunk-BIQHA7UA.js} +4 -4
  27. package/Marketplace/{chunk-XMUA7ACY.js → chunk-BUFEIJAI.js} +1 -1
  28. package/Marketplace/{chunk-4YVLPJDF.js → chunk-CH2MLZU7.js} +1 -1
  29. package/Marketplace/{chunk-3SYZKYR6.js → chunk-CLKCSTGQ.js} +1 -1
  30. package/Marketplace/{chunk-THCM5TEN.js → chunk-COBHWPGI.js} +1 -1
  31. package/Marketplace/{chunk-44EXJBCW.js → chunk-D54NUPYF.js} +1 -1
  32. package/Marketplace/chunk-DI4V7KMK.js +1 -0
  33. package/Marketplace/{chunk-5JWYKH72.js → chunk-DPLEMBB4.js} +1 -1
  34. package/Marketplace/chunk-DZ2EE5MV.js +1 -0
  35. package/Marketplace/chunk-E3HMIPER.js +2 -0
  36. package/Marketplace/chunk-E3J2KTY6.js +1 -0
  37. package/Marketplace/{chunk-K7HUCVG7.js → chunk-EGTYAIU5.js} +1 -1
  38. package/Marketplace/chunk-ESGKEE7X.js +1 -0
  39. package/Marketplace/chunk-F2HZCHWV.js +1 -0
  40. package/Marketplace/{chunk-JNXIAVS4.js → chunk-G6EG5QJS.js} +1 -1
  41. package/Marketplace/{chunk-634DNHPF.js → chunk-GBABJLPQ.js} +1 -1
  42. package/Marketplace/{chunk-DWDTKK42.js → chunk-GBXNTL4E.js} +1 -1
  43. package/Marketplace/{chunk-MFZLTVCS.js → chunk-GHQH62TZ.js} +1 -1
  44. package/Marketplace/{chunk-2SABH24F.js → chunk-GMUCTLAX.js} +1 -1
  45. package/Marketplace/chunk-GPEVUTDI.js +2 -0
  46. package/Marketplace/chunk-HIO6MIJ5.js +1 -0
  47. package/Marketplace/{chunk-RYW4LQLR.js → chunk-HKR6N5HS.js} +1 -1
  48. package/Marketplace/{chunk-IQEG7SF6.js → chunk-HKYVBAMV.js} +1 -1
  49. package/Marketplace/{chunk-MKVZZJMP.js → chunk-IEYFOHME.js} +1 -1
  50. package/Marketplace/chunk-IIJMZKPL.js +1 -0
  51. package/Marketplace/chunk-IMLK4UIO.js +1 -0
  52. package/Marketplace/{chunk-2UZPOENK.js → chunk-IYYVZ6B6.js} +1 -1
  53. package/Marketplace/{chunk-RTUTYVTE.js → chunk-J3P46Z53.js} +1 -1
  54. package/Marketplace/{chunk-6ZQHMI2W.js → chunk-J7AGLBPL.js} +1 -1
  55. package/Marketplace/{chunk-QJHGG2N2.js → chunk-JBKHY4HH.js} +1 -1
  56. package/Marketplace/chunk-JLGRTH4V.js +1 -0
  57. package/Marketplace/chunk-JTI77225.js +1 -0
  58. package/Marketplace/{chunk-UH6522CN.js → chunk-JXSMH6I7.js} +1 -1
  59. package/Marketplace/chunk-K2H6WANG.js +1 -0
  60. package/Marketplace/{chunk-WAGDS532.js → chunk-KHWTOD6H.js} +1 -1
  61. package/Marketplace/{chunk-NN3LQDDR.js → chunk-KQOYVGBL.js} +1 -1
  62. package/Marketplace/chunk-KVP6OL4J.js +2 -0
  63. package/Marketplace/{chunk-PQZGUDGJ.js → chunk-KXZCGKQW.js} +1 -1
  64. package/Marketplace/{chunk-5H2O45YV.js → chunk-LPXBSHUI.js} +1 -1
  65. package/Marketplace/{chunk-CPUDVFIN.js → chunk-M3SJUKTG.js} +1 -1
  66. package/Marketplace/chunk-M5JM7ESN.js +1 -0
  67. package/Marketplace/{chunk-OPL2QMKR.js → chunk-MATSRG2L.js} +1 -1
  68. package/Marketplace/{chunk-NB5JKHKF.js → chunk-MNFHFW3E.js} +1 -1
  69. package/Marketplace/chunk-OBEQQ7SG.js +5 -0
  70. package/Marketplace/{chunk-HCZDLZLY.js → chunk-OE2JYQHN.js} +1 -1
  71. package/Marketplace/{chunk-I44JKLRE.js → chunk-OLSC6KHB.js} +1 -1
  72. package/Marketplace/chunk-OND3VUTC.js +1 -0
  73. package/Marketplace/{chunk-GJLXEA4Q.js → chunk-PPDHTO44.js} +1 -1
  74. package/Marketplace/chunk-PRGFOMED.js +1 -0
  75. package/Marketplace/chunk-PXB4YEY3.js +1 -0
  76. package/Marketplace/{chunk-V27YSSV4.js → chunk-Q2OEJFVT.js} +1 -1
  77. package/Marketplace/{chunk-ZUFLZMHT.js → chunk-Q72ZXPDP.js} +1 -1
  78. package/Marketplace/{chunk-LLXJSB37.js → chunk-QCZIDOKW.js} +1 -1
  79. package/Marketplace/{chunk-PB4FDU3V.js → chunk-QHVE4FSO.js} +1 -1
  80. package/Marketplace/{chunk-JSN6B77E.js → chunk-QQTJ6WWI.js} +1 -1
  81. package/Marketplace/chunk-R57ID7TM.js +5 -0
  82. package/Marketplace/{chunk-NQV7LHIV.js → chunk-RGR34QZ3.js} +1 -1
  83. package/Marketplace/{chunk-PRVOIBMJ.js → chunk-RIHLYYZU.js} +1 -1
  84. package/Marketplace/{chunk-APOFECEW.js → chunk-RVYGL22E.js} +1 -1
  85. package/Marketplace/chunk-T5ONJF63.js +7 -0
  86. package/Marketplace/chunk-T6QOFDEE.js +1 -0
  87. package/Marketplace/{chunk-3S7C3CCV.js → chunk-TMFFA26Y.js} +1 -1
  88. package/Marketplace/chunk-TXDFQTPS.js +1 -0
  89. package/Marketplace/chunk-TXQ2Y7CX.js +2 -0
  90. package/Marketplace/chunk-U5F33N6P.js +1 -0
  91. package/Marketplace/{chunk-HSHDGVNA.js → chunk-UBMI3NQH.js} +1 -1
  92. package/Marketplace/chunk-UHPJJSQV.js +1 -0
  93. package/Marketplace/chunk-UKY2FX27.js +1 -0
  94. package/Marketplace/chunk-UL7IZTZY.js +1 -0
  95. package/Marketplace/chunk-UXDL6TJZ.js +1 -0
  96. package/Marketplace/{chunk-A3HRO7UA.js → chunk-V2OJQHE3.js} +1 -1
  97. package/Marketplace/{chunk-TGMCGROM.js → chunk-V5WYSCVT.js} +1 -1
  98. package/Marketplace/chunk-VETHPEVU.js +1 -0
  99. package/Marketplace/{chunk-FFM752SB.js → chunk-VGXQU74M.js} +1 -1
  100. package/Marketplace/{chunk-X2N6PWY3.js → chunk-VSEWXNVC.js} +1 -1
  101. package/Marketplace/{chunk-TLTSPO4H.js → chunk-W6I24KUL.js} +1 -1
  102. package/Marketplace/{chunk-PHCYCYXH.js → chunk-WAW37FIG.js} +1 -1
  103. package/Marketplace/chunk-X2YQZSF2.js +2 -0
  104. package/Marketplace/chunk-XM6GN4VF.js +1 -0
  105. package/Marketplace/{chunk-2IRI6JVT.js → chunk-Y4ULR7K5.js} +1 -1
  106. package/Marketplace/chunk-YIUQQGOQ.js +1 -0
  107. package/Marketplace/{chunk-KP7SEM5B.js → chunk-YR2WEZDG.js} +1 -1
  108. package/Marketplace/{chunk-ZEAT7ZWR.js → chunk-YXFTLQ5M.js} +1 -1
  109. package/Marketplace/{chunk-CXIBIPS5.js → chunk-ZD5LURJS.js} +1 -1
  110. package/Marketplace/{chunk-YOGRCIUI.js → chunk-ZZVNB72Q.js} +1 -1
  111. package/Marketplace/index.html +2 -2
  112. package/Marketplace/main-LD4CQ4J5.js +1 -0
  113. package/Marketplace/{styles-6YCMRXAM.css → styles-VTPGUJ5G.css} +1 -1
  114. package/package.json +1 -1
  115. package/Marketplace/chunk-3H6MA53M.js +0 -1
  116. package/Marketplace/chunk-3WXGD5DP.js +0 -1
  117. package/Marketplace/chunk-4NOCCDHL.js +0 -5
  118. package/Marketplace/chunk-53AJT5VM.js +0 -1
  119. package/Marketplace/chunk-56I7OOXQ.js +0 -1
  120. package/Marketplace/chunk-66YHNWRR.js +0 -1
  121. package/Marketplace/chunk-7SLPBFFW.js +0 -1
  122. package/Marketplace/chunk-AGFQ7PHZ.js +0 -5
  123. package/Marketplace/chunk-CDNNFRZK.js +0 -1
  124. package/Marketplace/chunk-COUBJIJH.js +0 -2
  125. package/Marketplace/chunk-CVSACPFR.js +0 -1
  126. package/Marketplace/chunk-DU3Y35HL.js +0 -1
  127. package/Marketplace/chunk-E2QYALEB.js +0 -1
  128. package/Marketplace/chunk-EOW4JKRF.js +0 -1
  129. package/Marketplace/chunk-EU2KAMEK.js +0 -1
  130. package/Marketplace/chunk-G27ALLTY.js +0 -1
  131. package/Marketplace/chunk-G3L7WQ4A.js +0 -1
  132. package/Marketplace/chunk-GCECFUOP.js +0 -1
  133. package/Marketplace/chunk-GJ35EMJI.js +0 -1
  134. package/Marketplace/chunk-GQH7OSVY.js +0 -1
  135. package/Marketplace/chunk-GWD5JYLQ.js +0 -1
  136. package/Marketplace/chunk-HP3XWVNT.js +0 -1
  137. package/Marketplace/chunk-IFLSHEST.js +0 -1
  138. package/Marketplace/chunk-JJVUZJ74.js +0 -1
  139. package/Marketplace/chunk-JYT2OOPZ.js +0 -1
  140. package/Marketplace/chunk-KC6OLUBI.js +0 -1
  141. package/Marketplace/chunk-KESNVJB4.js +0 -1
  142. package/Marketplace/chunk-KKZXQMQT.js +0 -1
  143. package/Marketplace/chunk-LH62Q4FX.js +0 -1
  144. package/Marketplace/chunk-LHT5E52E.js +0 -1
  145. package/Marketplace/chunk-LXSQIECO.js +0 -1
  146. package/Marketplace/chunk-MKR6QJ6R.js +0 -5
  147. package/Marketplace/chunk-NK7MW7P2.js +0 -1
  148. package/Marketplace/chunk-NKBSETRE.js +0 -8
  149. package/Marketplace/chunk-NUZJZQNI.js +0 -1
  150. package/Marketplace/chunk-PW2T7JJM.js +0 -1
  151. package/Marketplace/chunk-PW42BQIY.js +0 -1
  152. package/Marketplace/chunk-R6NI5QG7.js +0 -1
  153. package/Marketplace/chunk-RQEJ664D.js +0 -1
  154. package/Marketplace/chunk-RUSH2VVJ.js +0 -1
  155. package/Marketplace/chunk-T2QY5RTH.js +0 -1
  156. package/Marketplace/chunk-TUXYNJAG.js +0 -2
  157. package/Marketplace/chunk-U2DPEH7K.js +0 -1
  158. package/Marketplace/chunk-UODMSFAI.js +0 -1
  159. package/Marketplace/chunk-UPA7TFVG.js +0 -2
  160. package/Marketplace/chunk-VFLAHRB4.js +0 -7
  161. package/Marketplace/chunk-VXIVMTCD.js +0 -1
  162. package/Marketplace/chunk-VXTTE6TO.js +0 -1
  163. package/Marketplace/chunk-WJLXIV7I.js +0 -1
  164. package/Marketplace/chunk-WLZKVYHT.js +0 -1
  165. package/Marketplace/chunk-ZNZULA6U.js +0 -1
  166. package/Marketplace/chunk-ZYKVIUE6.js +0 -1
  167. package/Marketplace/main-7RWGLHW6.js +0 -1
@@ -1 +0,0 @@
1
- import{a as ye,b as ge}from"./chunk-HCZDLZLY.js";import{a as _}from"./chunk-4NOCCDHL.js";import"./chunk-ACIMXBIC.js";import"./chunk-ZUKHXAUV.js";import"./chunk-6ZQHMI2W.js";import"./chunk-CDNNFRZK.js";import"./chunk-3RK6DDJD.js";import{a as R}from"./chunk-2IRI6JVT.js";import"./chunk-NB5JKHKF.js";import"./chunk-ZUFLZMHT.js";import"./chunk-YOGRCIUI.js";import"./chunk-SDUUFQUI.js";import"./chunk-JNXIAVS4.js";import"./chunk-PRVOIBMJ.js";import"./chunk-V27YSSV4.js";import"./chunk-T2QY5RTH.js";import"./chunk-PQZGUDGJ.js";import"./chunk-LLXJSB37.js";import"./chunk-YWRRGL7S.js";import{e as he}from"./chunk-XMUA7ACY.js";import"./chunk-K5XRGNWG.js";import"./chunk-TGMCGROM.js";import"./chunk-WAGDS532.js";import{m as w,n as ue}from"./chunk-5SXUJ5XH.js";import"./chunk-3S7C3CCV.js";import"./chunk-PHCYCYXH.js";import{y as fe}from"./chunk-5JWYKH72.js";import{c as d}from"./chunk-PW42BQIY.js";import"./chunk-KESNVJB4.js";import"./chunk-GQH7OSVY.js";import{F as pe,H as de,J as ce,f as ae,g as F,j as le,k as P,m as me,n as se}from"./chunk-UPA7TFVG.js";import{$b as $,$c as B,Fb as T,Fc as p,Gb as Z,Gc as j,Hc as J,Jc as y,Kc as g,Lb as h,Lc as C,Oa as V,Qc as re,Vc as oe,Xb as m,Z as Q,_c as k,cc as H,dc as ee,ea as z,fc as te,gc as ie,hc as r,ic as a,ja as q,jc as v,ka as X,mc as ne,oa as Y,pb as G,qd as U,rb as l,sc as b,tc as u,wc as K,xb as f}from"./chunk-VFLAHRB4.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var Ce=(()=>{class n{constructor(){this.reportTabs=[{Title:"1.Create Order",Url:"/menu/sync-log/order/sync-order"},{Title:"2.Convert Order To Invoice",Url:"/menu/sync-log/order/convert-to-invoice"},{Title:"3.Create Invoice",Url:"/menu/sync-log/order/invoice"},{Title:"4.Create Outbound Logistic",Url:"/menu/sync-log/order/delivery"},{Title:"5.Add Payment",Url:"/menu/sync-log/order/payment"},{Title:"6.Void Invoice",Url:"/menu/sync-log/order/void-invoice"},{Title:"All",Url:"/menu/sync-log/order/all"}]}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=T({type:n,selectors:[["app-order"]],standalone:!1,decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(i,t){i&1&&(r(0,"nav",0)(1,"div",1)(2,"div"),v(3,"nav-tab",2),a()()(),v(4,"router-outlet")),i&2&&(l(3),m("Tabs",t.reportTabs))},dependencies:[ye,pe],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]})}}return n})();var S=class{};var I=(()=>{class n{constructor(e){this.http=e}GetLoader(){return this.http.post("/api/Report/GetLoader",{})}GetSyncOrder(e){return new Promise((i,t)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(s=>{i(s)})})}GetSyncInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/CreateInvoice",JSON.stringify(e)).subscribe(s=>{i(s)})})}GetSyncVoidInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/Void",JSON.stringify(e)).subscribe(s=>{i(s)})})}GetSyncConvertInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/ConvertToInvoice",JSON.stringify(e)).subscribe(s=>{i(s)})})}GetSyncDelivery(e){return new Promise((i,t)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(s=>{i(s)})})}GetSyncPayment(e){return new Promise((i,t)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(s=>{i(s)})})}getAllReport(e){return this.http.post("/api/Report/all",JSON.stringify(e))}static{this.\u0275fac=function(i){return new(i||n)(Y(he))}}static{this.\u0275prov=q({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var O=function(n){return n[n.OK=200]="OK",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.CONFLICT=409]="CONFLICT",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n}(O||{});var De=()=>["/menu/log/order"],Ee=(n,c,e,i,t)=>({responseCode:n,From:c,to:e,actionType:i,ChannelID:t});function Oe(n,c){if(n&1&&(r(0,"th",6)(1,"div",7)(2,"h4"),p(3),a(),r(4,"small",8),p(5),a()()()),n&2){let e=c.$implicit,i=u();l(3),j(e),l(),$(i.getTextBgColor(e)),l(),j(i.getHeaderStatusDesc(e))}}function Re(n,c){if(n&1&&(r(0,"a",12),p(1),k(2,"number"),a()),n&2){let e=u().$implicit,i=u().$implicit,t=u();m("routerLink",re(5,De))("queryParams",oe(6,Ee,e.Key,t.fromQueryParam,t.toQueryParam,t.type,i.ChannelID)),l(),J(" ",B(2,3,e.Value)," ")}}function Le(n,c){n&1&&(r(0,"span",13),p(1,"-"),a())}function xe(n,c){if(n&1&&(r(0,"td",11),h(1,Re,3,12,"a",12)(2,Le,2,0,"span",13),a()),n&2){let e=c.$implicit;l(),H(e.Value?1:2)}}function Me(n,c){if(n&1&&(r(0,"tr")(1,"td")(2,"a",9),v(3,"img",10),a()(),r(4,"td")(5,"div")(6,"a",9),p(7),a()(),r(8,"div"),p(9),a()(),te(10,xe,3,1,"td",11,ee),a()),n&2){let e=c.$implicit,i=u();l(2),K("href",e.Url,G),l(),m("src",i.getChannelLogo(e.Type),G),l(3),K("href",e.Url,G),l(),j(e.Name),l(2),j(e.Url),l(),ie(e.list)}}function ke(n,c){if(n&1&&(r(0,"td",11)(1,"div",17),p(2),k(3,"number"),a()()),n&2){let e=c.$implicit;l(2),J(" ",B(3,1,e.total)," ")}}function Be(n,c){if(n&1&&(r(0,"tfoot")(1,"tr")(2,"td",14)(3,"div",15),p(4,"Total"),a()(),h(5,ke,4,3,"td",16),a()()),n&2){let e=u();l(5),m("ngForOf",e.logsCalculation())}}var D=(()=>{class n{constructor(){this.header=V(),this.result=V(),this.orderedHeader=U(()=>this.header().sort((e,i)=>e-i)),this.logsOrdered=U(()=>{let e=this.result();return e=e.map(i=>(this.orderedHeader().forEach(t=>{i.list.findIndex(o=>o.Key===t)===-1&&i.list.push({Key:t,Value:0}),i.list.sort((o,A)=>o.Key-A.Key)}),i)),e}),this.logsCalculation=U(()=>{let e=this.concatStatusCode(),i=[];return this.orderedHeader().forEach(t=>{let o=e.filter(A=>A.Key===t).reduce((A,we)=>A+we.Value,0);i.push({status:t,total:o})}),i}),this.type=null,this.headerStatus=O,this.listCalculationStatusCode=[]}set from(e){e&&(this.fromQueryParam=new Date(e).toJSON().toString())}set to(e){e&&(this.toQueryParam=new Date(e).toJSON().toString())}getHeaderStatusDesc(e){let i=null;switch(e){case O.BAD_REQUEST:i="BAD REQUEST";break;case O.CONFLICT:i="CONFLICT";break;case O.INTERNAL_SERVER_ERROR:i="INTERNAL SERVER ERROR";break;case O.NOT_FOUND:i="NOT FOUND";break;default:i="OK";break}return i}getTextBgColor(e){let i=null;switch(e){case O.OK:i="bg-success";break;case O.INTERNAL_SERVER_ERROR:i="bg-danger";break;default:i="bg-warning";break}return i}getChannelLogo(e){return d.getChannelLogoByTypeId(e)}concatStatusCode(){return this.logsOrdered().map(e=>e.list).reduce((e,i)=>[...e,...i],[])}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=T({type:n,selectors:[["app-table-report"]],inputs:{header:[1,"header"],result:[1,"result"],from:"from",to:"to",type:"type"},standalone:!1,decls:10,vars:3,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","5%"],["class","text-start","style","width: 10%",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],[1,"text-start",2,"width","10%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],[1,"text-start"],[1,"h3","text-primary","fw-bold","ms-1",3,"routerLink","queryParams"],[1,"h3","fw-bold","ms-1"],["colspan","2"],[1,"text-center","h3","fw-bold"],["class","text-start",4,"ngFor","ngForOf"],[1,"d-inline-block","h3","text-primary","fw-bold","ms-1"]],template:function(i,t){i&1&&(r(0,"table",0)(1,"thead",1)(2,"tr"),v(3,"th",2),r(4,"th",3),p(5,"Channel"),a(),h(6,Oe,6,4,"th",4),a()(),r(7,"tbody"),h(8,Me,12,5,"tr",5),a(),h(9,Be,6,1,"tfoot"),a()),i&2&&(l(6),m("ngForOf",t.orderedHeader()),l(2),m("ngForOf",t.logsOrdered()),l(),H(t.logsCalculation().length>0?9:-1))},dependencies:[ae,de,me],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]})}}return n})();function Ne(n,c){if(n&1&&(r(0,"div",7)(1,"div",8),v(2,"app-table-report",9),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",0)}}var ve=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S,this.pageTitle="New Order";let t=new Date;this.maxDate=t,this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-sales-order"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.getChannelLogs()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,Ne,3,5,"div",6),a()()()),i&2&&(m("headerTitle",t.pageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();function We(n,c){if(n&1&&(r(0,"div",7)(1,"div",8),v(2,"app-table-report",9),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",1)}}var Te=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-invoice"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,We,3,5,"div",6),a()()()),i&2&&(m("headerTitle",t.PageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();function Ae(n,c){if(n&1&&(r(0,"div",8)(1,"div",9),v(2,"app-table-report",10),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",3)}}var _e=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S;let t=new Date;this.maxDate=t,this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-delivery"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"filterDate"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div",1)(3,"label",2),p(4,"From/To"),a(),r(5,"div",3)(6,"datepicker",4),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",5),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",6),h(11,Ae,3,5,"div",7),a()()()),i&2&&(m("headerTitle",t.PageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();function je(n,c){if(n&1&&(r(0,"div",7)(1,"div",8),v(2,"app-table-report",9),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",4)}}var Se=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S,this.PageTitle="Completed";let t=new Date;this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-payment"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,je,3,5,"div",6),a()()()),i&2&&(m("headerTitle",t.PageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();function Ge(n,c){n&1&&ne(0)}function Ue(n,c){if(n&1&&(r(0,"div",8)(1,"div",9),v(2,"app-table-report",10),a()()),n&2){let e=c.ngIf,i=u();l(2),m("result",e.Body)("header",e.Header)("from",i.filter==null?null:i.filter.From)("to",i.filter==null?null:i.filter.To)}}var be=(()=>{class n{constructor(e,i){this.reportOrderService=e,this.datePipe=i,this.filter=new S}ngOnInit(){this.initFilter(),this.initLoader()}initFilter(){let e=new Date;this.minDate=d.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`All (${e==null?"":i+"-"} ${t})`}initLoader(){this.pageLoader$=this.reportOrderService.GetLoader().pipe(z(e=>{this.filter=e,this.updatePageTitle(),this.initData()}))}initData(){this.reportData$=this.reportOrderService.getAllReport(this.filter).pipe(Q())}onFilter(){this.updatePageTitle(),this.initData()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-all"]],standalone:!1,decls:15,vars:10,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[4,"ngIf"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,Ge,1,0,"ng-container",6),k(12,"async"),h(13,Ue,3,4,"div",7),k(14,"async"),a()()()),i&2&&(m("headerTitle",t.pageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",B(12,6,t.pageLoader$)),l(2),m("ngIf",B(14,8,t.reportData$)))},dependencies:[F,w,_,D,le],encapsulation:2})}}return n})();function Ve(n,c){if(n&1&&(r(0,"div",7)(1,"div",8),v(2,"app-table-report",9),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",1)}}var Fe=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S,this.PageTitle="Convert Sales Order To Invoice";let t=new Date;this.maxDate=t,this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Convert Sales Order To Invoice (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-convert-invoice"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,Ve,3,5,"div",6),a()()()),i&2&&(m("headerTitle",t.PageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();function He(n,c){if(n&1&&(r(0,"div",7)(1,"div",8),v(2,"app-table-report",9),a()()),n&2){let e=u();l(2),m("result",e.result)("header",e.header)("from",e.filter.From)("to",e.filter.To)("type",1)}}var Pe=(()=>{class n{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new S,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=d.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=d.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}static{this.\u0275fac=function(i){return new(i||n)(f(I),f(P))}}static{this.\u0275cmp=T({type:n,selectors:[["app-void-invoice"]],standalone:!1,decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(r(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),r(1,"filters")(2,"div")(3,"label",1),p(4,"From/To"),a(),r(5,"div",2)(6,"datepicker",3),C("dateChange",function(o){return g(t.filter.From,o)||(t.filter.From=o),o}),a()(),r(7,"div")(8,"datepicker",4),C("dateChange",function(o){return g(t.filter.To,o)||(t.filter.To=o),o}),a()()()(),r(9,"content")(10,"div",5),h(11,He,3,5,"div",6),a()()()),i&2&&(m("headerTitle",t.PageTitle)("hideSearchBox",!0),l(6),y("date",t.filter.From),l(2),y("date",t.filter.To),l(3),m("ngIf",t.result))},dependencies:[F,w,_,D],encapsulation:2})}}return n})();var Ke=[{path:"",component:Ce,children:[{path:"",redirectTo:"all",pathMatch:"full"},{path:"sync-order",component:ve,canActivate:[R],data:{title:"Sync Order"}},{path:"convert-to-invoice",component:Fe,canActivate:[R],data:{title:"Sync Convert to Invoice"}},{path:"invoice",component:Te,canActivate:[R],data:{title:"Sync Invoice"}},{path:"delivery",component:_e,canActivate:[R],data:{title:"Sync Delivery"}},{path:"payment",component:Se,canActivate:[R],data:{title:"Sync Payment"}},{path:"void-invoice",component:Pe,canActivate:[R],data:{title:"Sync void invoice"}},{path:"all",component:be,canActivate:[R],data:{title:"All Report"}}]}],Gt=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=Z({type:n})}static{this.\u0275inj=X({imports:[se,ge,fe,ue,_,ce.forChild(Ke)]})}}return n})();export{Gt as OrderModule};
@@ -1,8 +0,0 @@
1
- import{a as Ce,b as be,c as We}from"./chunk-JSN6B77E.js";import{a as Re}from"./chunk-IFLSHEST.js";import"./chunk-QJHGG2N2.js";import{a as ae,b as re,c as ht}from"./chunk-NQV7LHIV.js";import"./chunk-MS4AQ6UA.js";import{a as le}from"./chunk-CXIBIPS5.js";import{b as It}from"./chunk-MKVZZJMP.js";import"./chunk-ZEAT7ZWR.js";import{a as Ot,b as Mt,c as Lt,d as kt,e as Vt,f as Ft,g as At}from"./chunk-2UZPOENK.js";import"./chunk-APOFECEW.js";import{a as ut,b as ft}from"./chunk-HCZDLZLY.js";import{a as J}from"./chunk-4NOCCDHL.js";import"./chunk-ACIMXBIC.js";import"./chunk-BZ3AJFKZ.js";import{b as Rt}from"./chunk-I44JKLRE.js";import{a as oe,b as gt}from"./chunk-THCM5TEN.js";import{d as xt,k as bt,l as Tt,m as Dt,n as Et,o as Pt}from"./chunk-ZUKHXAUV.js";import"./chunk-44EXJBCW.js";import"./chunk-FZDXTSZF.js";import{a as vt}from"./chunk-K7HUCVG7.js";import"./chunk-6ZQHMI2W.js";import"./chunk-CDNNFRZK.js";import"./chunk-MSNWTSDH.js";import"./chunk-3RK6DDJD.js";import{a as $}from"./chunk-HSHDGVNA.js";import{b as Nt}from"./chunk-IE3ZBJEK.js";import{b as wt}from"./chunk-CPUDVFIN.js";import{a as St,b as Ct,c as yt}from"./chunk-MFZLTVCS.js";import"./chunk-4YVLPJDF.js";import{a as ne}from"./chunk-2IRI6JVT.js";import"./chunk-NB5JKHKF.js";import"./chunk-ZUFLZMHT.js";import"./chunk-YOGRCIUI.js";import"./chunk-SDUUFQUI.js";import"./chunk-JNXIAVS4.js";import"./chunk-PRVOIBMJ.js";import"./chunk-V27YSSV4.js";import{a as te,b as ie,c as pt,d as K,e as mt}from"./chunk-LIQRQYKZ.js";import"./chunk-T2QY5RTH.js";import"./chunk-PQZGUDGJ.js";import"./chunk-LLXJSB37.js";import{a as Ke,h as me,l as q}from"./chunk-YWRRGL7S.js";import{b as Fe,e as B}from"./chunk-XMUA7ACY.js";import"./chunk-K5XRGNWG.js";import"./chunk-TGMCGROM.js";import"./chunk-WAGDS532.js";import{d as Ae,h as ct,m as z,n as _t}from"./chunk-5SXUJ5XH.js";import{r as st,s as dt}from"./chunk-3S7C3CCV.js";import"./chunk-PHCYCYXH.js";import{b as Ve,c as H,h as U,m as Y,o as ee,y as lt}from"./chunk-5JWYKH72.js";import{b as N,c as I}from"./chunk-PW42BQIY.js";import"./chunk-KESNVJB4.js";import"./chunk-GQH7OSVY.js";import{E as Le,F as ot,H as j,J as ke,d as rt,f as A,g as R,j as fe,k as V,m as G,n as Se}from"./chunk-UPA7TFVG.js";import{$c as O,Aa as Ue,B as Xe,Ba as Ye,Ec as M,Fb as k,Fc as l,Gb as Me,Gc as u,Hc as v,Jc as C,Kc as y,Lb as g,Lc as x,Pc as nt,Qc as Q,Ra as et,Rc as at,Sc as Z,Xb as s,Z as _e,_c as E,ad as F,bd as W,cc as qe,ea as Ne,hc as i,ic as a,ja as Qe,jc as f,ka as Oe,kc as T,lc as D,nc as P,oa as He,pb as L,rb as o,sc as w,tc as d,v as de,wc as tt,xa as Ze,xb as b,xc as it,ya as _,za as h}from"./chunk-VFLAHRB4.js";import"./chunk-EU2KAMEK.js";import{a as Je,b as $e}from"./chunk-66YHNWRR.js";var Wt=(()=>{class n{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:[Ke.downloadOrder]},{Title:"Log",Url:"/menu/Order/Download_Order_Log",Permissions:[Ke.downloadOrder]}]}ngOnInit(){}static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275cmp=k({type:n,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(r,t){r&1&&(i(0,"nav",0)(1,"div",1)(2,"div"),f(3,"nav-tab",2),a()()(),f(4,"router-outlet")),r&2&&(o(3),s("Tabs",t.ObjectOrderTabs)("usePermissions",!0))},dependencies:[ut,ot],encapsulation:2})}}return n})();var Be=(()=>{class n{constructor(e,r){this.http=e,this.toastr=r}acceptTokopediaOrders(e){return this.http.post("/api/Orders/AcceptOrderTokopedia",e).pipe(Ne(r=>{this.tokopediaAcceptOrderHandler(r)}))}tokopediaAcceptOrderHandler(e){let r=e.filter(p=>p.Status==!1),t=e.filter(p=>p.Status==!0);if(r.length==0&&t.length>0){let p=`<ol>${this.generateSuccessMessage(t)}</ol>`;this.toastr.success(p,"Success",{enableHtml:!0})}else if(r.length>0&&t.length>0){let p=`<ol>
2
- ${this.generateSuccessMessage(t)}
3
- ${this.generateErrorMessage(r)}
4
- </ol>`;this.toastr.warning(p,"Warning",{enableHtml:!0})}else{let p=`<ol>${this.generateErrorMessage(r)}</ol>`;this.toastr.error(p,"Error",{enableHtml:!0})}}generateSuccessMessage(e){let r="";return e.forEach(t=>{r+=`<li><b>${t.OrderNumber}</b> was successfully Accept</li>`}),r}generateErrorMessage(e){let r="";return e.forEach(t=>{r+=`<li><b>${t.OrderNumber}</b> ${t.Message}</li>`}),r}static{this.\u0275fac=function(r){return new(r||n)(He(B),He(Fe))}}static{this.\u0275prov=Qe({token:n,factory:n.\u0275fac})}}return n})();function Qt(n,c){if(n&1){let e=P();T(0),i(1,"button",20),w("click",function(){_(e);let t=d().ngIf,p=d();return h(p.onAcceptOrder(t))}),f(2,"i",21),l(3," Accept "),a(),D()}}function Zt(n,c){if(n&1&&(T(0),g(1,Qt,4,0,"ng-container",3),D()),n&2){let e=d();o(),s("ngIf",e.isTokopediaAvailable&&e.isTokopediaSelected)}}function ei(n,c){if(n&1&&(i(0,"span",22),f(1,"img",23),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,L),o(),v(" ",e.Name," ")}}function ti(n,c){if(n&1){let e=P();T(0),i(1,"th",35)(2,"input",36),x("ngModelChange",function(t){_(e);let p=d(3);return y(p.isCheckAll,t)||(p.isCheckAll=t),h(t)}),w("ngModelChange",function(){_(e);let t=d(2).ngIf,p=d();return h(p.onSelectAllOrderData(t))}),a()(),D()}if(n&2){let e=d(3);o(2),C("ngModel",e.isCheckAll)}}function ii(n,c){if(n&1){let e=P();T(0),i(1,"input",36),x("ngModelChange",function(t){_(e);let p=d(2).$implicit;return y(p.selected,t)||(p.selected=t),h(t)}),w("ngModelChange",function(){_(e);let t=d(4).ngIf,p=d();return h(p.onSelectOrderData(t))}),a(),D()}if(n&2){let e=d(2).$implicit;o(),C("ngModel",e.selected)}}function ni(n,c){if(n&1&&(T(0),i(1,"td"),g(2,ii,2,1,"ng-container",3),a(),D()),n&2){let e=d().$implicit,r=d(3);o(2),s("ngIf",e.Type==r.tokopediaType)}}function ai(n,c){if(n&1&&(T(0),i(1,"span"),l(2),a(),D()),n&2){let e=d().$implicit;o(2),u(e.Number)}}function ri(n,c){if(n&1&&(i(0,"a",38),l(1),a()),n&2){let e=d().$implicit,r=d(3);s("href",r.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+e.ID,L),o(),u(e.Number)}}function oi(n,c){if(n&1&&(i(0,"tr"),g(1,ni,3,1,"ng-container",3),i(2,"td"),l(3),a(),i(4,"td"),g(5,ai,3,1,"ng-container",24)(6,ri,2,2,"ng-template",null,1,W),a(),i(8,"td"),l(9),a(),i(10,"td"),l(11),E(12,"date"),a(),i(13,"td"),f(14,"app-channel-logo",37),a()()),n&2){let e=c.$implicit,r=M(7),t=d(3);o(),s("ngIf",t.isTokopediaAvailable),o(2),u(e.Outlet),o(2),s("ngIf",e.ID==t.guidEmpty)("ngIfElse",r),o(4),u(e.Customer),o(2),u(F(12,7,e.Created,"dd MMM yyyy HH:mm")),o(3),s("typeId",e.Type)}}function li(n,c){if(n&1){let e=P();T(0),i(1,"div",25)(2,"table",26),w("matSortChange",function(t){_(e);let p=d(2);return h(p.onSort(t))}),i(3,"thead",27)(4,"tr",28),g(5,ti,3,1,"ng-container",3),i(6,"th",29),l(7,"Outlet"),a(),i(8,"th",30),l(9,"Order number"),a(),i(10,"th"),l(11,"Customer"),a(),i(12,"th",31),l(13," Created On "),a(),i(14,"th",32),l(15,"Channel"),a()()(),i(16,"tbody"),g(17,oi,15,10,"tr",33),a()(),i(18,"app-mat-paginator-no-count",34),E(19,"async"),E(20,"async"),w("total",function(){_(e);let t=d(2);return h(t.getPaginatonTotal())})("next",function(){_(e);let t=d(2);return h(t.onNextPage())})("previous",function(){_(e);let t=d(2);return h(t.onPreviousPage())}),a()(),D()}if(n&2){let e,r=d().ngIf,t=d();o(5),s("ngIf",t.isTokopediaAvailable&&r),o(12),s("ngForOf",r),o(),s("filter",t.filter)("totaldata",(e=O(19,5,t.newOrdersData$))==null?null:e.length)("paginationTotal",O(20,7,t.paginationTotal$))}}function pi(n,c){if(n&1&&(T(0),g(1,li,21,9,"ng-container",24),D()),n&2){let e=c.ngIf;d();let r=M(36);o(),s("ngIf",(e==null?null:e.length)>0)("ngIfElse",r)}}function mi(n,c){n&1&&(i(0,"div",39),f(1,"app-empty-state"),a())}var Bt=(()=>{class n{constructor(e,r,t,p){this.localDataService=e,this.orderService=r,this.acceptOrderService=t,this.authService=p,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=I.GuidEMpty,this.tokopediaType=N.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(_e()),this.newOrdersData$=this.sourceObs$.pipe(Ne(r=>{r.filter(p=>p.Type==N.Tokopedia).length>0&&(this.isTokopediaAvailable=!0)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID,this.filter.From,this.filter.To).pipe(_e())}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(r=>(r.Type==N.Tokopedia&&(r.selected=this.isCheckAll),r)),this.onSelectOrderData(e)}onAcceptOrder(e){let r=this.getSelectedTokopediaOrders(e);this.acceptOrderService.acceptTokopediaOrders(r).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 r=e.direction=="asc";this.newOrdersData$=this.newOrdersData$.pipe(de(t=>(t=t.sort((p,S)=>I.compare(p.Created,S.Created,r)),t)))}}static{this.\u0275fac=function(r){return new(r||n)(b(me),b(Ce),b(Be),b(q))}}static{this.\u0275cmp=k({type:n,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(r,t){if(r&1){let p=P();i(0,"mainpanel",2),w("onSubmit",function(){return _(p),h(t.getNewOrders())}),i(1,"actions"),g(2,Zt,2,1,"ng-container",3),E(3,"async"),i(4,"a",4),f(5,"i",5),i(6,"span"),l(7,"Visit our Fulfillment Display System"),a()()(),i(8,"filters")(9,"div")(10,"label",6),l(11,"Channel"),a(),i(12,"ng-select",7),x("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(13,ei,3,2,"ng-template",8),a()(),i(14,"div",9)(15,"label",10),l(16,"Page Number"),a(),i(17,"input",11),x("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(18,"div",9)(19,"label",10),l(20,"Page Size"),a(),i(21,"input",12),x("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(22,"div",9)(23,"label",13),l(24,"From/To"),a(),i(25,"div",14)(26,"datepicker",15),x("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(27,"div")(28,"datepicker",16),x("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(29,"content")(30,"div",17)(31,"div",18)(32,"div",19),g(33,pi,2,2,"ng-container",3),E(34,"async"),g(35,mi,2,0,"ng-template",null,0,W),a()()()()()}r&2&&(s("hideSearchBox",!0),o(2),s("ngIf",O(3,11,t.newOrdersData$)),o(10),s("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),s("ngIf",O(34,13,t.newOrdersData$)))},dependencies:[A,R,H,ee,Ve,U,Y,z,K,te,ie,$,oe,le,ae,re,J,fe,V],encapsulation:2})}}return n})();var si=()=>["/menu/Order"];function di(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),l(4),E(5,"number"),a(),i(6,"td"),l(7),E(8,"number"),a()()),n&2){let e=c.$implicit;o(2),u(e.Code),o(2),u(O(5,3,e.Quantity)),o(3),u(O(8,5,e.Price))}}function ci(n,c){if(n&1&&(i(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),l(5,"Outlet Info"),a()(),i(6,"div",4)(7,"div",9),l(8," Outlet : "),a(),i(9,"div",9),l(10),a()(),i(11,"div",4)(12,"div",9),l(13," Date : "),a(),i(14,"div",9),l(15),E(16,"date"),a()(),i(17,"div",4)(18,"div",9),l(19," Status : "),a(),i(20,"div",9),l(21),a()(),i(22,"div",4)(23,"div",9),l(24," Tax Type : "),a(),i(25,"div",9),l(26),a()(),i(27,"div",4)(28,"div",9),l(29," Due Date : "),a(),i(30,"div",9),l(31),E(32,"date"),a()()(),i(33,"div",6)(34,"div",7)(35,"h3",8),l(36,"Customer Info"),a()(),i(37,"div",4)(38,"div",9),l(39," Name : "),a(),i(40,"div",9),l(41),a()(),i(42,"div",4)(43,"div",9),l(44," Email : "),a(),i(45,"div",9),l(46),a()(),i(47,"div",4)(48,"div",9),l(49," Mobile : "),a(),i(50,"div",9),l(51),a()()()(),i(52,"div",10)(53,"h3",11),l(54,"Products Sold"),a(),i(55,"div",12)(56,"table",13)(57,"thead",14)(58,"tr",15)(59,"th"),l(60,"Code"),a(),i(61,"th"),l(62,"Quantity"),a(),i(63,"th"),l(64,"Price"),a()()(),i(65,"tbody"),g(66,di,9,7,"tr",16),a()()()()()),n&2){let e=d();o(10),v(" ",e.model.Outlet," "),o(5),v(" ",F(16,9,e.model.Date,"dd MMM yyyy")," "),o(6),v(" ",e.model.Delivery," "),o(5),v(" ",e.model.TaxType," "),o(5),v(" ",F(32,12,e.model.DueDate,"dd MMM yyyy")," "),o(10),v(" ",e.model.Customer.Name," "),o(5),v(" ",e.model.Customer.Email," "),o(5),v(" ",e.model.Customer.Mobile," "),o(15),s("ngForOf",e.model.Variants)}}var zt=(()=>{class n{constructor(e,r){this.http=e,this.url=r,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(r=>{this.model=r})}static{this.\u0275fac=function(r){return new(r||n)(b(B),b(Le))}}static{this.\u0275cmp=k({type:n,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(r,t){r&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),l(3,"Back"),a()(),i(4,"content")(5,"div",2),g(6,ci,67,15,"div",3),a()()()),r&2&&(s("headerTitle","Order #"+t.number)("hideSearchBox",!0)("hideSearchDropdown",!0),o(2),s("routerLink",Q(5,si)),o(4),s("ngIf",t.model))},dependencies:[A,R,z,j,G,V],encapsulation:2})}}return n})();var se=function(n){return n.SPX="https://res.cloudinary.com/pos/image/upload/v1698216798/APP/Print%20Shipping%20Label/SPX_Logo.png",n.SICEPAT="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/SiCepat_Logo.png",n.JNT="https://res.cloudinary.com/pos/image/upload/v1698216792/APP/Print%20Shipping%20Label/J_T_Logo.png",n.ANTERAJA="https://res.cloudinary.com/pos/image/upload/v1698218271/APP/Print%20Shipping%20Label/anteraja_Logo.png",n.JNE="https://res.cloudinary.com/pos/image/upload/v1698216791/APP/Print%20Shipping%20Label/JNE_Logo.png",n.GRAB="https://res.cloudinary.com/pos/image/upload/v1698216794/APP/Print%20Shipping%20Label/GrabExpress_Logo.png",n.GOSEND="https://res.cloudinary.com/pos/image/upload/v1698218375/APP/Print%20Shipping%20Label/Gosend_Logo.png",n.LAZADA_EXPRESS="https://res.cloudinary.com/pos/image/upload/v1698914677/icons/Marketplace%20logo/lazada-Logistics.png",n}(se||{});var ve=function(n){return n.TOKOPEDIA="https://res.cloudinary.com/pos/image/upload/v1698216793/APP/Print%20Shipping%20Label/Tokopedia_Logo.png",n.SHOPEE="https://res.cloudinary.com/pos/image/upload/v1698219243/APP/Print%20Shipping%20Label/shopee-logo.png",n.LAZADA="https://res.cloudinary.com/pos/image/upload/v1698912333/icons/Marketplace%20logo/Lazada_icon.png",n.TIKTOK="https://res.cloudinary.com/pos/image/upload/v1645761565/icons/Marketplace%20logo/tiktok-logo.png",n}(ve||{});function _i(n,c){if(n&1&&(T(0),i(1,"div",36)(2,"div",12)(3,"div",37),l(4),a()(),i(5,"div",12)(6,"div",37),l(7),a()()(),D()),n&2){let e=d();o(4),v(" ",e.recipient==null?null:e.recipient.City," "),o(3),v(" ",e.recipient==null?null:e.recipient.District," ")}}function hi(n,c){if(n&1&&(T(0),i(1,"div")(2,"span",15),l(3,"Berat: "),a(),i(4,"span",18),l(5),a()(),D()),n&2){let e=d();o(5),v("",e.shippingLabel==null?null:e.shippingLabel.Weight," gr")}}function gi(n,c){if(n&1&&(T(0),i(1,"div",38)(2,"span",14),l(3,"Batas Kirim:"),a(),i(4,"span",18),l(5),E(6,"date"),a()(),D()),n&2){let e=d();o(5),u(F(6,1,e.logistic==null?null:e.logistic.Batas_kirim,"dd-MM-yyy"))}}function ui(n,c){if(n&1&&(T(0),i(1,"div",38)(2,"span",14),l(3,"No.Pesanan:"),a(),i(4,"span",18),l(5),a()(),D()),n&2){let e=d();o(5),u(e.shippingLabel==null?null:e.shippingLabel.OrderNumber)}}function fi(n,c){if(n&1&&(i(0,"tr")(1,"td",39),l(2),a(),i(3,"td"),l(4),a(),i(5,"td"),l(6),a(),i(7,"td"),l(8),E(9,"number"),a()()),n&2){let e=c.$implicit,r=c.index;o(2),u(r+1),o(2),u(e.Product_Name),o(2),u(e.SKU),o(2),u(O(9,4,e.Quantity))}}var Ge=(()=>{class n{constructor(){this.minDate=I.MinDate,this.channelType=N}ngOnChanges(e){e.shippingLabel&&e.shippingLabel.currentValue&&(this.initShippingLabel(),this.getShippingLogo(),this.getChannelLogo())}ngAfterViewInit(){this.initBarcodeConfig()}getChannelLogo(){switch(this.shippingLabel.ChannelType){case N.Tokopedia:this.marketplaceLogo=ve.TOKOPEDIA;break;case N.Shopee:this.marketplaceLogo=ve.SHOPEE;break;case N.Lazada:this.marketplaceLogo=ve.LAZADA;break;case N.Tiktok:this.marketplaceLogo=ve.TIKTOK;break}}getShippingLogo(){let e=this.shippingLabel.Logistic.Logistic_Name;e=e?.toLowerCase(),e.includes("anteraja")?this.shippingLogo=se.ANTERAJA:e.includes("grabexpress")?this.shippingLogo=se.GRAB:e.includes("jne")?this.shippingLogo=se.JNE:e.includes("gosend")?this.shippingLogo=se.GOSEND:e.includes("j&t")||e.includes("jnt")?this.shippingLogo=se.JNT:e.includes("sicepat")?this.shippingLogo=se.SICEPAT:e.includes("spx")?this.shippingLogo=se.SPX:(e.includes("lex")||e.includes("lx")||e.includes("lazada express"))&&(this.shippingLogo=se.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(I.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})}I.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(r){return new(r||n)}}static{this.\u0275cmp=k({type:n,selectors:[["app-shipping-label"]],inputs:{shippingLabel:"shippingLabel",id:"id"},features:[Ze],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(r,t){r&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div"),f(6,"img",5),a(),i(7,"div")(8,"h4"),l(9),a()(),i(10,"div"),f(11,"img",5),a()()()(),i(12,"div",6),f(13,"hr"),a(),i(14,"div",7)(15,"div",3)(16,"div",8)(17,"span",9),l(18),a(),i(19,"span"),l(20),a()()()(),i(21,"div",7)(22,"div",10),Ue(),f(23,"svg",11),a()(),Ye(),i(24,"div",6),f(25,"hr"),a(),i(26,"div",2)(27,"div",12)(28,"div",13)(29,"div",14),l(30,"Penerima: "),a(),i(31,"div",15),l(32),a()(),i(33,"div",16)(34,"span",15),l(35,"Alamat Pengiriman:"),a(),i(36,"div",17),l(37),a()()(),i(38,"div",12)(39,"div",13)(40,"div",14),l(41,"Pengirim: "),a(),i(42,"div")(43,"div",15),l(44),a(),i(45,"div",18),l(46),a(),i(47,"div",19),l(48),a()()(),f(49,"div"),a()(),g(50,_i,8,2,"ng-container",20),i(51,"div",21)(52,"div",22)(53,"div",15),l(54,"CASHLESS"),a()(),i(55,"div",23)(56,"small",24),l(57,"Penjual tidak perlu membayar ongkos kirim ke kurir"),a()()(),i(58,"div",25)(59,"div",26)(60,"div",27),g(61,hi,6,1,"ng-container",20),i(62,"div")(63,"span",15),l(64,"COD: "),a(),i(65,"span",18),l(66),E(67,"number"),a()()(),g(68,gi,7,4,"ng-container",20)(69,ui,6,1,"ng-container",20),a(),i(70,"div",28),Ue(),f(71,"svg",29),a()()(),Ye(),i(72,"div",25)(73,"div",3)(74,"table",30)(75,"thead")(76,"tr")(77,"th",31),l(78,"No."),a(),i(79,"th",32),l(80,"Nama Produk"),a(),i(81,"th",33),l(82,"SKU"),a(),i(83,"th",34),l(84,"Qty"),a()()(),i(85,"tbody"),g(86,fi,10,6,"tr",35),a()()()()()),r&2&&(o(6),s("src",t.marketplaceLogo,L),o(3),u(t.logistic==null?null:t.logistic.Service),o(2),s("src",t.shippingLogo,L),o(7),v(" ",(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),s("id","RESI"+t.id),o(9),u(t.recipient==null?null:t.recipient.Name),o(5),v(" ",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),v(" ",t.store==null?null:t.store.Address," "),o(2),s("ngIf",(t.recipient==null?null:t.recipient.City)&&(t.recipient==null?null:t.recipient.District)),o(11),s("ngIf",t.shippingLabel==null?null:t.shippingLabel.Weight),o(5),v("Rp. ",t.shippingLabel!=null&&t.shippingLabel.IsCOD?O(67,18,t.shippingLabel==null||t.shippingLabel.SummaryPrice==null?null:t.shippingLabel.SummaryPrice.Total):0,""),o(2),s("ngIf",(t.logistic==null?null:t.logistic.Batas_kirim)&&(t.logistic==null?null:t.logistic.Batas_kirim)!==t.minDate),o(),s("ngIf",t.shippingLabel==null?null:t.shippingLabel.OrderNumber),o(2),s("id","NO"+t.id),o(15),s("ngForOf",t.products))},dependencies:[Se,A,R,G,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 n})();var yi=()=>["/menu/Order/detail"],xi=(n,c)=>({Number:n,Outlet:c});function wi(n,c){if(n&1){let e=P();T(0),i(1,"button",21),w("click",function(){_(e);let t=d();return h(t.onPrintMultipleShippingLabel())}),f(2,"i",22),i(3,"span"),l(4,"Print Shipping Label"),a()(),D()}}function vi(n,c){if(n&1&&(i(0,"span",23),f(1,"img",24),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,L)("alt",e.Name),o(),v(" ",e.Name," ")}}function bi(n,c){if(n&1){let e=P();T(0),i(1,"input",31),x("ngModelChange",function(t){_(e);let p=d().$implicit;return y(p.Selected,t)||(p.Selected=t),h(t)}),w("ngModelChange",function(){_(e);let t=d(3).ngIf,p=d();return h(p.onSelectReadyToShip(t))}),a(),D()}if(n&2){let e=d().$implicit;o(),C("ngModel",e.Selected)}}function Ti(n,c){if(n&1&&(i(0,"a",44),l(1),a()),n&2){let e=d().$implicit;s("routerLink",Q(3,yi))("queryParams",Z(4,xi,e.Number,e.Outlet)),o(),u(e.Number)}}function Di(n,c){if(n&1&&(i(0,"a",45),l(1),a()),n&2){let e=d().$implicit,r=d(3);s("href",r.domain+e.ID,L),o(),u(e.Number)}}function Ei(n,c){if(n&1){let e=P();i(0,"a",46),w("click",function(){_(e);let t=d().$implicit,p=d(3);return h(p.onPrintShippingLabel(t.Number,t.ShopID,t.TypeID))}),f(1,"i",47),a()}}function Pi(n,c){if(n&1&&(i(0,"tr")(1,"td"),g(2,bi,2,1,"ng-container",4),a(),i(3,"td"),l(4),a(),i(5,"td"),g(6,Ti,2,7,"a",39)(7,Di,2,2,"a",40),a(),i(8,"td"),l(9),a(),i(10,"td"),l(11),E(12,"number"),a(),i(13,"td"),l(14),E(15,"date"),a(),i(16,"td"),f(17,"app-channel-logo",41),a(),i(18,"td",42),g(19,Ei,2,0,"a",43),a()()),n&2){let e=c.$implicit,r=d(3);o(2),s("ngIf",e.TypeID==r.channelType.Shopee||e.TypeID==r.channelType.Tokopedia||e.TypeID==r.channelType.Tiktok),o(2),u(e.Outlet),o(2),s("ngIf",r.guidEmpty==e.ID),o(),s("ngIf",r.guidEmpty!=e.ID),o(2),u(e.Customer),o(2),u(O(12,9,e.Amount)),o(3),u(F(15,11,e.Date,"dd MMM yyyy")),o(3),s("typeId",e.TypeID),o(2),s("ngIf",e.TypeID==r.channelType.Shopee||e.TypeID==r.channelType.Tokopedia||e.TypeID==r.channelType.Tiktok||e.TypeID==r.channelType.Lazada)}}function Ii(n,c){if(n&1){let e=P();T(0),i(1,"div",26)(2,"table",27),w("matSortChange",function(t){_(e);let p=d(2);return h(p.onSort(t))}),i(3,"thead",28)(4,"tr",29)(5,"th",30)(6,"input",31),x("ngModelChange",function(t){_(e);let p=d(2);return y(p.isCheckAll,t)||(p.isCheckAll=t),h(t)}),w("ngModelChange",function(){_(e);let t=d().ngIf,p=d();return h(p.onSelectAllReadyToShip(t))}),a()(),i(7,"th",32),l(8,"Outlet"),a(),i(9,"th",33),l(10,"Order number"),a(),i(11,"th"),l(12,"Customer"),a(),i(13,"th",34),l(14,"Amount"),a(),i(15,"th",35),l(16,"Date"),a(),i(17,"th",36),l(18,"Channel"),a(),f(19,"th",37),a()(),i(20,"tbody"),g(21,Pi,20,14,"tr",20),a()(),i(22,"app-mat-paginator-no-count",38),E(23,"async"),E(24,"async"),w("total",function(){_(e);let t=d(2);return h(t.getRowCount())})("next",function(){_(e);let t=d(2);return h(t.NextPage())})("previous",function(){_(e);let t=d(2);return h(t.PreviousPage())}),a()(),D()}if(n&2){let e,r=d().ngIf,t=d();o(6),C("ngModel",t.isCheckAll),o(15),s("ngForOf",r),o(),s("filter",t.filter)("totaldata",(e=O(23,5,t.readyToShip$))==null?null:e.length)("paginationTotal",O(24,7,t.paginationTotal$))}}function Ni(n,c){if(n&1&&(T(0),g(1,Ii,25,9,"ng-container",25),D()),n&2){let e=c.ngIf;d();let r=M(35);o(),s("ngIf",e.length>0)("ngIfElse",r)}}function Oi(n,c){n&1&&(i(0,"div",48),f(1,"app-empty-state"),a())}function Mi(n,c){n&1&&(T(0),i(1,"div",50),l(2,"\xA0"),a(),D())}function Li(n,c){if(n&1&&(T(0),f(1,"app-shipping-label",49),g(2,Mi,3,0,"ng-container",4),D()),n&2){let e=c.$implicit,r=c.index,t=d();o(),s("shippingLabel",e)("id",r),o(),s("ngIf",r!==(t.shippingLabels==null?null:t.shippingLabels.length)-1)}}var Gt=(()=>{class n{constructor(e,r,t,p,S,m){this.http=e,this.localDataService=r,this.dialog=t,this.shippingLabelService=p,this.datePipe=S,this.authService=m,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.channelType=N,this.guidEmpty=I.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 r={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",r).pipe(de(t=>t.Data),_e(1)),this.readyToShip$=this.sourceObs$}onPrintMultipleShippingLabel(){let e=this.filterReadyToShipByChannel(this.selectedReadyToShip,N.Tokopedia),r=this.filterReadyToShipByChannel(this.selectedReadyToShip,N.Shopee),t=this.filterReadyToShipByChannel(this.selectedReadyToShip,N.Tiktok),p=[];e.length>0&&p.push(this.shippingLabelService.getTokopediaShippingLabel(this.shippingLabelPayload(e))),r.length>0&&p.push(this.shippingLabelService.getShopeeShippingLabel(this.shippingLabelPayload(r))),t.length>0&&p.push(this.shippingLabelService.getTiktokShippingLabel(this.shippingLabelPayload(t))),Xe(p).pipe(de(S=>S.reduce((m,je)=>m.concat(je),[]))).subscribe({next:S=>{this.shippingLabels=S,this.printShippingLabel()}})}filterReadyToShipByChannel(e,r){return e.filter(t=>t.TypeID==r)}shippingLabelPayload(e){return e.map(r=>({ShopID:r.ShopID,OrderNumber:r.Number}))}printShippingLabel(){setTimeout(()=>{this.setPdfname(),window.print()},500)}onPrintShippingLabel(e,r,t){switch(t){case N.Tokopedia:this.shippingLabelService.printShippingLabelTokopedia(e);break;case N.Tiktok:this.shippingLabelService.printShippingLabelTiktok(e,r);break;case N.Shopee:this.shippingLabelService.printShippingLabelShopee(e,r);break;case N.Lazada:this.shippingLabelService.printShippingLabelLazada(e,r);break}}setPdfname(){if(this.selectedReadyToShip.length>1){let e=new Date,r=this.datePipe.transform(e,"dd-MM-yyyy"),t=this.datePipe.transform(e,"HH-mm");document.title=`ShippingLabel_${r}_${t}`}else{let e=this.selectedReadyToShip[0].Number;document.title=`ShippingLabel_${e}`}}getSelectedReadyToShip(e){return e.filter(r=>r.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(de(r=>r?.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 r=e.direction=="asc";this.readyToShip$=this.readyToShip$.pipe(de(t=>t.sort((p,S)=>I.compare(p.Date,S.Date,r))))}}onSelectReadyToShip(e){this.selectedReadyToShip=this.getSelectedReadyToShip(e)}onSelectAllReadyToShip(e){e=e.map(r=>((r.TypeID==N.Tokopedia||r.TypeID==N.Shopee||r.TypeID==N.Lazada)&&(r.Selected=this.isCheckAll),r)),this.selectedReadyToShip=this.getSelectedReadyToShip(e)}static{this.\u0275fac=function(r){return new(r||n)(b(B),b(me),b(Ae),b(Re),b(V),b(q))}}static{this.\u0275cmp=k({type:n,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(r,t){if(r&1){let p=P();i(0,"mainpanel",1),w("onSubmit",function(m){return _(p),h(t.getReadyToShip(m))}),i(1,"actions")(2,"a",2),f(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),a()(),g(6,wi,5,0,"ng-container",4),a(),i(7,"filters")(8,"div")(9,"label",5),l(10,"Channel"),a(),i(11,"ng-select",6),x("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(12,vi,3,3,"ng-template",7),a()(),i(13,"div",8)(14,"label",9),l(15,"Page Number"),a(),i(16,"input",10),x("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(17,"div",8)(18,"label",9),l(19,"Page Size"),a(),i(20,"input",11),x("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(21,"div",8)(22,"label",12),l(23,"From/To"),a(),i(24,"div",13)(25,"datepicker",14),x("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(26,"div")(27,"datepicker",15),x("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(28,"content")(29,"div",16)(30,"div",17)(31,"div",18),g(32,Ni,2,2,"ng-container",4),E(33,"async"),g(34,Oi,2,0,"ng-template",null,0,W),a()()()()(),i(36,"div",19),g(37,Li,3,3,"ng-container",20),a()}r&2&&(o(6),s("ngIf",t.selectedReadyToShip.length>0),o(5),s("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),s("ngIf",O(33,11,t.readyToShip$)),o(5),s("ngForOf",t.shippingLabels))},dependencies:[A,R,H,ee,Ve,U,Y,z,j,K,te,ie,$,oe,le,ae,re,J,Ge,fe,G,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 n})();var ki=()=>["/menu/Order/detail"],Vi=(n,c)=>({Number:n,Outlet:c});function Fi(n,c){if(n&1&&(i(0,"span",19),f(1,"img",20),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,L)("alt",e.Name),o(),v(" ",e.Name," ")}}function Ai(n,c){if(n&1&&(i(0,"a",35),l(1),a()),n&2){let e=d().$implicit;s("routerLink",Q(3,ki))("queryParams",Z(4,Vi,e.Number,e.Outlet)),o(),u(e.Number)}}function Ri(n,c){if(n&1&&(i(0,"a",36),l(1),a()),n&2){let e=d().$implicit,r=d(2);s("href",r.domain+e.ID,L),o(),u(e.Number)}}function Wi(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),g(4,Ai,2,7,"a",32)(5,Ri,2,2,"a",33),a(),i(6,"td"),l(7),a(),i(8,"td"),l(9),E(10,"number"),a(),i(11,"td"),l(12),E(13,"date"),a(),i(14,"td"),f(15,"app-channel-logo",34),a()()),n&2){let e=c.$implicit,r=d(2);o(2),u(e.Outlet),o(2),s("ngIf",r.hasGuidEmpty(e.ID)),o(),s("ngIf",!r.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(O(10,7,e.Amount)),o(3),u(F(13,9,e.Created,"dd MMM yyyy HH:mm")),o(3),s("typeId",e.TypeID)}}function Bi(n,c){if(n&1){let e=P();T(0),i(1,"div",21)(2,"table",22),w("matSortChange",function(t){_(e);let p=d();return h(p.onSort(t))}),i(3,"thead",23)(4,"tr",24)(5,"th",25),l(6,"Outlet"),a(),i(7,"th",26),l(8,"Order number"),a(),i(9,"th"),l(10,"Customer"),a(),i(11,"th",27),l(12,"Amount"),a(),i(13,"th",28),l(14," Created On "),a(),i(15,"th",29),l(16,"Channel"),a()()(),i(17,"tbody"),g(18,Wi,16,12,"tr",30),a()(),i(19,"app-mat-paginator-no-count",31),w("total",function(){_(e);let t=d();return h(t.StoreRowsCountAPIResult())})("next",function(){_(e);let t=d();return h(t.NextPage())})("previous",function(){_(e);let t=d();return h(t.PreviousPage())}),a()(),D()}if(n&2){let e=d();o(18),s("ngForOf",e.data),o(),s("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function zi(n,c){n&1&&(i(0,"div",37),f(1,"app-empty-state"),a())}var jt=(()=>{class n{constructor(e,r,t){this.http=e,this.localDataService=r,this.authService=t,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=N,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==I.GuidEMpty}Get(e){var r={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",r).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(r=>{this.paginationTotal=r.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 r=e.direction=="asc";this.data=this.data.sort((t,p)=>I.compare(t.Created,p.Created,r))}}static{this.\u0275fac=function(r){return new(r||n)(b(B),b(me),b(q))}}static{this.\u0275cmp=k({type:n,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(r,t){if(r&1){let p=P();i(0,"mainpanel",1),w("onSubmit",function(m){return _(p),h(t.Get(m))}),i(1,"actions")(2,"a",2),f(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),a()()(),i(6,"filters")(7,"div")(8,"label",4),l(9,"Channel"),a(),i(10,"ng-select",5),x("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(11,Fi,3,3,"ng-template",6),a()(),i(12,"div",7)(13,"label",8),l(14,"Page Number"),a(),i(15,"input",9),x("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(16,"div",7)(17,"label",8),l(18,"Page Size"),a(),i(19,"input",10),x("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(20,"div",7)(21,"label",11),l(22,"From/To"),a(),i(23,"div",12)(24,"datepicker",13),x("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(25,"div")(26,"datepicker",14),x("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),g(31,Bi,20,4,"ng-container",18)(32,zi,2,0,"ng-template",null,0,W),a()()()()()}if(r&2){let p=M(33);o(10),s("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),s("ngIf",t.data&&t.data.length>0)("ngIfElse",p)}},dependencies:[A,R,H,ee,U,Y,z,j,K,te,ie,$,oe,le,ae,re,J,G,V],encapsulation:2})}}return n})();var Gi=()=>["/menu/Order/detail"],ji=(n,c)=>({Number:n,Outlet:c});function Hi(n,c){if(n&1&&(i(0,"span",19),f(1,"img",20),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,L)("alt",e.Name),o(),v(" ",e.Name," ")}}function Ui(n,c){if(n&1&&(i(0,"a",35),l(1),a()),n&2){let e=d().$implicit;s("routerLink",Q(3,Gi))("queryParams",Z(4,ji,e.Number,e.Outlet)),o(),u(e.Number)}}function Yi(n,c){if(n&1&&(i(0,"a",36),l(1),a()),n&2){let e=d().$implicit,r=d(2);s("href",r.customerInfoUrl+e.ID,L),o(),u(e.Number)}}function qi(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),g(4,Ui,2,7,"a",32)(5,Yi,2,2,"a",33),a(),i(6,"td"),l(7),a(),i(8,"td"),l(9),E(10,"number"),a(),i(11,"td"),l(12),E(13,"date"),a(),i(14,"td"),f(15,"app-channel-logo",34),a()()),n&2){let e=c.$implicit,r=d(2);o(2),u(e.Outlet),o(2),s("ngIf",r.hasGuidEmpty(e.ID)),o(),s("ngIf",!r.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(O(10,7,e.Amount)),o(3),u(F(13,9,e.Created,"dd MMM yyyy HH:mm")),o(3),s("typeId",e.TypeID)}}function Ki(n,c){if(n&1){let e=P();T(0),i(1,"div",21)(2,"table",22),w("matSortChange",function(t){_(e);let p=d();return h(p.onSort(t))}),i(3,"thead",23)(4,"tr",24)(5,"th",25),l(6,"Outlet"),a(),i(7,"th",26),l(8,"Order number"),a(),i(9,"th"),l(10,"Customer"),a(),i(11,"th",27),l(12,"Amount"),a(),i(13,"th",28),l(14," Created On "),a(),i(15,"th",29),l(16,"Channel"),a()()(),i(17,"tbody"),g(18,qi,16,12,"tr",30),a()(),i(19,"app-mat-paginator-no-count",31),w("total",function(){_(e);let t=d();return h(t.StoreRowsCountAPIResult())})("next",function(){_(e);let t=d();return h(t.NextPage())})("previous",function(){_(e);let t=d();return h(t.PreviousPage())}),a()(),D()}if(n&2){let e=d();o(18),s("ngForOf",e.data),o(),s("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function Ji(n,c){n&1&&(i(0,"div",37),f(1,"app-empty-state"),a())}var Ht=(()=>{class n{constructor(e,r){this.http=e,this.authService=r,this.filter={PageNumber:null,PageSize:null,ListChannelID:[],From:null,To:null},this.totaldata=0,this.paginationTotal=0,this.channelType=N,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.Load()}hasGuidEmpty(e){return e==I.GuidEMpty}getChannelLogo(e){return I.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 r={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 ",r).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(r=>{this.paginationTotal=r.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 r=e.direction=="asc";this.data=this.data.sort((t,p)=>I.compare(t.Created,p.Created,r))}}static{this.\u0275fac=function(r){return new(r||n)(b(B),b(q))}}static{this.\u0275cmp=k({type:n,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(r,t){if(r&1){let p=P();i(0,"mainpanel",1),w("onSubmit",function(m){return _(p),h(t.Get(m))}),i(1,"actions")(2,"a",2),f(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),a()()(),i(6,"filters")(7,"div")(8,"label",4),l(9,"Channel"),a(),i(10,"ng-select",5),x("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(11,Hi,3,3,"ng-template",6),a()(),i(12,"div",7)(13,"label",8),l(14,"Page Number"),a(),i(15,"input",9),x("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(16,"div",7)(17,"label",8),l(18,"Page Size"),a(),i(19,"input",10),x("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(20,"div",7)(21,"label",11),l(22,"From/To"),a(),i(23,"div",12)(24,"datepicker",13),x("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(25,"div")(26,"datepicker",14),x("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(27,"content")(28,"div",15)(29,"div",16)(30,"div",17),g(31,Ki,20,4,"ng-container",18)(32,Ji,2,0,"ng-template",null,0,W),a()()()()()}if(r&2){let p=M(33);o(10),s("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),s("ngIf",t.data&&t.data.length>0)("ngIfElse",p)}},dependencies:[A,R,H,ee,U,Y,z,j,K,te,ie,$,oe,le,ae,re,J,G,V],encapsulation:2})}}return n})();var $i=()=>["/menu/Order/detail"],Xi=(n,c)=>({Number:n,Outlet:c});function Qi(n,c){if(n&1&&(i(0,"span",21),f(1,"img",22),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,L)("alt",e.Name),o(),v(" ",e.Name," ")}}function Zi(n,c){if(n&1&&(i(0,"a",38),l(1),a()),n&2){let e=d().$implicit;s("routerLink",Q(3,$i))("queryParams",Z(4,Xi,e.Number,e.Outlet)),o(),u(e.Number)}}function en(n,c){if(n&1&&(i(0,"a",39),l(1),a()),n&2){let e=d().$implicit,r=d(2);s("href",r.domain+e.ID,L),o(),u(e.Number)}}function tn(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),g(4,Zi,2,7,"a",35)(5,en,2,2,"a",36),a(),i(6,"td"),l(7),a(),i(8,"td"),l(9),E(10,"number"),a(),i(11,"td"),l(12),E(13,"date"),a(),i(14,"td"),l(15),a(),i(16,"td"),f(17,"app-channel-logo",37),a()()),n&2){let e=c.$implicit,r=d(2);o(2),u(e.Outlet),o(2),s("ngIf",r.hasGuidEmpty(e.ID)),o(),s("ngIf",!r.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(O(10,8,e.Amount)),o(3),u(F(13,10,e.Created,"dd MMM yyyy HH:mm")),o(3),u(e.State),o(2),s("typeId",e.TypeID)}}function nn(n,c){if(n&1){let e=P();T(0),i(1,"div",23)(2,"table",24),w("matSortChange",function(t){_(e);let p=d();return h(p.onSort(t))}),i(3,"thead",25)(4,"tr",26)(5,"th",27),l(6,"Outlet"),a(),i(7,"th",28),l(8,"Order number"),a(),i(9,"th"),l(10,"Customer"),a(),i(11,"th",29),l(12,"Amount"),a(),i(13,"th",30),l(14," Created On "),a(),i(15,"th",31),l(16,"Status"),a(),i(17,"th",32),l(18,"Channel"),a()()(),i(19,"tbody"),g(20,tn,18,13,"tr",33),a()(),i(21,"app-mat-paginator-no-count",34),w("total",function(){_(e);let t=d();return h(t.StoreRowsCountAPIResult())})("next",function(){_(e);let t=d();return h(t.NextPage())})("previous",function(){_(e);let t=d();return h(t.PreviousPage())}),a()(),D()}if(n&2){let e=d();o(20),s("ngForOf",e.data),o(),s("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function an(n,c){n&1&&(i(0,"div",40),f(1,"app-empty-state"),a())}var Ut=(()=>{class n{constructor(e,r,t,p){this.http=e,this.localDataService=r,this.authService=t,this.dialog=p,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==I.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 r={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",r).subscribe(t=>{this.data=t.Data,this.sourceData=[...t.Data],this.totaldata=this.data.length})}openExportDialog(){this.dialog.open(It,{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(r=>{this.paginationTotal=r.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 r=e.direction=="asc";this.data=this.data.sort((t,p)=>I.compare(t.Created,p.Created,r))}}static{this.\u0275fac=function(r){return new(r||n)(b(B),b(me),b(q),b(Ae))}}static{this.\u0275cmp=k({type:n,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(r,t){if(r&1){let p=P();i(0,"mainpanel",1),w("onSubmit",function(m){return _(p),h(t.Get(m))}),i(1,"actions")(2,"a",2),f(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),a()(),i(6,"button",4),w("click",function(){return _(p),h(t.openExportDialog())}),f(7,"i",5),i(8,"span"),l(9,"Export"),a()()(),i(10,"filters")(11,"div")(12,"label",6),l(13,"Channel"),a(),i(14,"ng-select",7),x("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(15,Qi,3,3,"ng-template",8),a()(),i(16,"div",9)(17,"label",10),l(18,"Page Number"),a(),i(19,"input",11),x("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(20,"div",9)(21,"label",10),l(22,"Page Size"),a(),i(23,"input",12),x("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(24,"div",9)(25,"label",13),l(26,"From/To"),a(),i(27,"div",14)(28,"datepicker",15),x("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(29,"div")(30,"datepicker",16),x("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(31,"content")(32,"div",17)(33,"div",18)(34,"div",19),g(35,nn,22,4,"ng-container",20)(36,an,2,0,"ng-template",null,0,W),a()()()()()}if(r&2){let p=M(37);o(14),s("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),s("ngIf",t.data&&t.data.length>0)("ngIfElse",p)}},dependencies:[A,R,H,ee,U,Y,z,j,K,te,ie,$,oe,le,ae,re,J,G,V],encapsulation:2})}}return n})();var rn=()=>["/menu/Order/detail"],on=(n,c)=>({Number:n,Outlet:c});function ln(n,c){if(n&1&&(i(0,"span",20),f(1,"img",21),a(),l(2)),n&2){let e=c.item;o(),s("src",e==null?null:e.Img,L)("alt",e.Name),o(),v(" ",e.Name," ")}}function pn(n,c){if(n&1&&(i(0,"a",36),l(1),a()),n&2){let e=d().$implicit;s("routerLink",Q(3,rn))("queryParams",Z(4,on,e.Number,e.Outlet)),o(),u(e.Number)}}function mn(n,c){if(n&1&&(i(0,"a",37),l(1),a()),n&2){let e=d().$implicit,r=d(2);s("href",r.domain+e.ID,L),o(),u(e.Number)}}function sn(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),g(4,pn,2,7,"a",33)(5,mn,2,2,"a",34),a(),i(6,"td"),l(7),a(),i(8,"td"),l(9),E(10,"number"),a(),i(11,"td"),l(12),E(13,"date"),a(),i(14,"td"),f(15,"app-channel-logo",35),a()()),n&2){let e=c.$implicit,r=d(2);o(2),u(e.Outlet),o(2),s("ngIf",r.hasGuidEmpty(e.ID)),o(),s("ngIf",!r.hasGuidEmpty(e.ID)),o(2),u(e.Customer),o(2),u(O(10,7,e.Amount)),o(3),u(F(13,9,e.Created,"dd MMM yyyy HH:mm")),o(3),s("typeId",e.TypeID)}}function dn(n,c){if(n&1){let e=P();T(0),i(1,"div",22)(2,"table",23),w("matSortChange",function(t){_(e);let p=d();return h(p.onSort(t))}),i(3,"thead",24)(4,"tr",25)(5,"th",26),l(6,"Outlet"),a(),i(7,"th",27),l(8,"Order number"),a(),i(9,"th"),l(10,"Customer"),a(),i(11,"th",28),l(12,"Amount"),a(),i(13,"th",29),l(14," Created On "),a(),i(15,"th",30),l(16,"Channel"),a()()(),i(17,"tbody"),g(18,sn,16,12,"tr",31),a()(),i(19,"app-mat-paginator-no-count",32),w("total",function(){_(e);let t=d();return h(t.StoreRowsCountAPIResult())})("next",function(){_(e);let t=d();return h(t.NextPage())})("previous",function(){_(e);let t=d();return h(t.PreviousPage())}),a()(),D()}if(n&2){let e=d();o(18),s("ngForOf",e.data),o(),s("filter",e.filter)("totaldata",e.totaldata)("paginationTotal",e.paginationTotal)}}function cn(n,c){n&1&&(i(0,"div",38),f(1,"app-empty-state"),a())}var Yt=(()=>{class n{constructor(e,r,t){this.http=e,this.localDataService=r,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==I.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 r={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 ",r).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(r=>{this.paginationTotal=r.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}getChannelLogo(e){return I.getChannelLogoByTypeId(e)}onSort(e){if(e.direction==""){this.data=this.sourceData;return}if(e.active=="created"){let r=e.direction=="asc";this.data=this.data.sort((t,p)=>I.compare(t.Created,p.Created,r))}}static{this.\u0275fac=function(r){return new(r||n)(b(B),b(me),b(q))}}static{this.\u0275cmp=k({type:n,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(r,t){if(r&1){let p=P();i(0,"mainpanel",1),w("onSubmit",function(m){return _(p),h(t.Get(m))}),i(1,"actions")(2,"a",2),f(3,"i",3),i(4,"span"),l(5,"Visit our Fulfillment Display System"),a()()(),i(6,"filters")(7,"div")(8,"label",4),l(9,"Channel"),a(),i(10,"ng-select",5),x("ngModelChange",function(m){return _(p),y(t.filter.ListChannelID,m)||(t.filter.ListChannelID=m),h(m)}),g(11,ln,3,3,"ng-template",6),a()(),i(12,"div",7)(13,"label",8),l(14,"Page Number"),a(),i(15,"input",9),x("ngModelChange",function(m){return _(p),y(t.filter.PageNumber,m)||(t.filter.PageNumber=m),h(m)}),a()(),i(16,"div",7)(17,"label",8),l(18,"Page Size"),a(),i(19,"input",10),x("ngModelChange",function(m){return _(p),y(t.filter.PageSize,m)||(t.filter.PageSize=m),h(m)}),a()(),i(20,"div",7)(21,"label",8),l(22,"Note"),a(),i(23,"input",11),x("ngModelChange",function(m){return _(p),y(t.filter.Note,m)||(t.filter.Note=m),h(m)}),a()(),i(24,"div",7)(25,"label",12),l(26,"From/To"),a(),i(27,"div",13)(28,"datepicker",14),x("dateChange",function(m){return _(p),y(t.filter.From,m)||(t.filter.From=m),h(m)}),a()(),i(29,"div")(30,"datepicker",15),x("dateChange",function(m){return _(p),y(t.filter.To,m)||(t.filter.To=m),h(m)}),a()()()(),i(31,"content")(32,"div",16)(33,"div",17)(34,"div",18),g(35,dn,20,4,"ng-container",19)(36,cn,2,0,"ng-template",null,0,W),a()()()()()}if(r&2){let p=M(37);o(10),s("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),s("ngIf",t.data&&t.data.length>0)("ngIfElse",p)}},dependencies:[A,R,H,ee,U,Y,z,j,K,te,ie,$,oe,le,ae,re,J,G,V],encapsulation:2})}}return n})();var _n=(n,c)=>({"over-due-today":n,"over-due":c}),hn=n=>({"over-due":n});function gn(n,c){n&1&&(T(0),i(1,"a",19),l(2," Download V2 "),a(),D())}function un(n,c){if(n&1){let e=P();T(0),i(1,"div",20)(2,"button",21),w("click",function(){_(e),d();let t=M(12);return h(t.previous())}),l(3," Back "),a(),i(4,"button",22),w("click",function(){_(e);let t=d(),p=M(12);return h(t.onNext(p))}),l(5," Next "),a()(),D()}if(n&2){let e=d();o(4),s("disabled",e.checkDisabledNextFilter())}}function fn(n,c){if(n&1){let e=P();T(0),i(1,"button",23),w("click",function(){_(e);let t=d(),p=M(12);return h(t.onNext(p))}),l(2," Next "),a(),D()}if(n&2){let e=d();o(),s("disabled",e.checkDisabledNextFilter())}}function Sn(n,c){if(n&1){let e=P();T(0),i(1,"button",24),w("click",function(){_(e);let t=d(),p=M(12);return h(t.onNew(p))}),f(2,"i",25),l(3," New "),a(),D()}}function Cn(n,c){n&1&&(f(0,"i",26),i(1,"span"),l(2,"Filter"),a())}function yn(n,c){if(n&1&&(i(0,"ng-option",36),f(1,"img",37),l(2),a()),n&2){let e=c.$implicit;s("value",e.ID),o(),s("src",e==null?null:e.Img,L),o(),v("",e.Name," ")}}function xn(n,c){if(n&1){let e=P();i(0,"div",32)(1,"div",28)(2,"h5"),l(3,"Type"),a(),i(4,"p",29),l(5," Select Type want to download "),a()(),i(6,"div",28)(7,"div",38)(8,"div")(9,"mat-radio-group",39),x("ngModelChange",function(t){_(e);let p=d(2);return y(p.downloadType,t)||(p.downloadType=t),h(t)}),i(10,"mat-radio-button",40),l(11," Orders "),a(),i(12,"mat-radio-button",41),l(13," Disbursement "),a()()()(),i(14,"div",42)(15,"div",43),f(16,"i",44),a(),i(17,"p",45),l(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),a()()()()}if(n&2){let e=d(2);o(9),C("ngModel",e.downloadType),o(),s("value",!1),o(2),s("value",!0)}}function wn(n,c){n&1&&(i(0,"p",29),l(1," Select Disbursement date "),i(2,"span",46),l(3,"(payment date / order complete date)"),a(),l(4," of the channel you want to download (Max 1 Week). "),a())}function vn(n,c){n&1&&(i(0,"p",29),l(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),a())}function bn(n,c){if(n&1){let e=P();T(0),i(1,"div",47)(2,"app-timepicker",48),x("timeChange",function(t){_(e);let p=d(2);return y(p.timeFrom,t)||(p.timeFrom=t),h(t)}),a(),i(3,"span",49),l(4,"-"),a(),i(5,"app-timepicker",48),x("timeChange",function(t){_(e);let p=d(2);return y(p.timeTo,t)||(p.timeTo=t),h(t)}),a()(),D()}if(n&2){let e=d(2);o(2),C("time",e.timeFrom),o(3),C("time",e.timeTo)}}function Tn(n,c){if(n&1){let e=P();i(0,"div",27)(1,"div",8)(2,"div",7)(3,"div",28)(4,"h5"),l(5,"Select a Channel"),a(),i(6,"p",29),l(7," Select Channel want to download order "),a()(),i(8,"div",28)(9,"ng-select",30),x("ngModelChange",function(t){_(e);let p=d();return y(p.channelID,t)||(p.channelID=t),h(t)}),w("ngModelChange",function(){_(e);let t=d();return h(t.onSelectChannel())}),g(10,yn,3,3,"ng-option",31),a()()(),g(11,xn,19,3,"div",32),E(12,"async"),i(13,"div",32)(14,"div",28)(15,"h5"),l(16,"Date Range"),a(),g(17,wn,5,0,"p",29)(18,vn,2,0,"p",29),a(),i(19,"div",28)(20,"div",8)(21,"mat-date-range-input",33)(22,"input",34),x("ngModelChange",function(t){_(e);let p=d();return y(p.startDate,t)||(p.startDate=t),h(t)}),w("click",function(){_(e);let t=M(25);return h(t.open())}),a(),i(23,"input",35),x("ngModelChange",function(t){_(e);let p=d();return y(p.endDate,t)||(p.endDate=t),h(t)}),w("click",function(){_(e);let t=M(25);return h(t.open())})("ngModelChange",function(){_(e);let t=d();return h(t.onFilterDateChange())}),a()(),f(24,"mat-date-range-picker",null,1),a(),g(26,bn,6,2,"ng-container",5),a()()()()}if(n&2){let e,r=M(25),t=d();o(9),s("clearable",!1),C("ngModel",t.channelID),o(),s("ngForOf",t.channelOptions),o(),qe((e=O(12,9,t.channelDetail$))!=null&&e.ServiceFeeWriteOff?11:-1),o(6),qe(t.downloadType()&&(t.currentChannel==null?null:t.currentChannel.TypeID)==t.channelType.Tokopedia?17:18),o(4),s("rangePicker",r),o(),C("ngModel",t.startDate),o(),C("ngModel",t.endDate),o(3),s("ngIf",t.showTimePicker)}}function Dn(n,c){n&1&&(f(0,"i",50),i(1,"span"),l(2,"Preview"),a())}function En(n,c){if(n&1&&(i(0,"th",72),l(1),a()),n&2){let e=d(3);o(),v(" ",e.currentChannel?"Created Date":"Last Status Update"," ")}}function Pn(n,c){if(n&1&&(i(0,"td"),l(1),E(2,"date"),a()),n&2){let e=d().$implicit;o(),v(" ",F(2,1,e.Date,"dd MMM yyyy HH:mm:ss")," ")}}function In(n,c){if(n&1&&(i(0,"span"),l(1),a()),n&2){let e=d().$implicit;o(),v(" ",e.ActionString," ")}}function Nn(n,c){if(n&1&&(i(0,"li"),l(1),a()),n&2){let e=c.$implicit;o(),v(" ",e," ")}}function On(n,c){if(n&1&&(i(0,"ul",77),g(1,Nn,2,1,"li",73),a()),n&2){let e=d().$implicit;o(),s("ngForOf",e.ActionString)}}function Mn(n,c){if(n&1&&(i(0,"span",78),f(1,"i",79),a()),n&2){let e=d().$implicit;it("title","Delivery : ",e.DeliveryState,`
5
- Payment : `,e.PaymentState,"")}}function Ln(n,c){if(n&1&&(i(0,"tr")(1,"td"),l(2),a(),i(3,"td"),l(4),a(),g(5,Pn,3,4,"td",5),i(6,"td")(7,"span"),l(8),a(),l(9),a(),i(10,"td",74)(11,"span"),l(12),a(),l(13),a(),i(14,"td"),g(15,In,2,1,"span",5)(16,On,2,1,"ul",75),a(),i(17,"td"),g(18,Mn,2,3,"span",76),a()()),n&2){let e=c.$implicit,r=c.index,t=d(4);o(2),u(r+1),o(2),u(e.Number),o(),s("ngIf",(t.currentChannel==null?null:t.currentChannel.TypeID)!=t.channelType.Shopee&&(t.currentChannel==null?null:t.currentChannel.TypeID)!==t.channelType.Tiktok),o(3),v("",e.ChannelStatus," - "),o(),v("",e.ChannelStatusDescription," "),o(),s("ngClass",Z(12,_n,(e==null?null:e.Action)==t.actionPreviewOrder.Update,(e==null?null:e.Action)==t.actionPreviewOrder.New))("matTooltip",e.POSStatus==91||e.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),o(2),v("",e.POSStatus," - "),o(),v("",e.POSStatusDescription," "),o(2),s("ngIf",e.ActionString.length==1),o(),s("ngIf",e.ActionString.length>1),o(2),s("ngIf",e.ChannelStatus!=99&&e.POSStatus!=99)}}function kn(n,c){if(n&1&&(T(0),g(1,Ln,19,15,"tr",73),D()),n&2){let e=d(3);o(),s("ngForOf",e.displayedPreviewData)}}function Vn(n,c){n&1&&(i(0,"tr",80)(1,"td",81)(2,"div",82),f(3,"i",83),a(),i(4,"h4",84),l(5," There is no order to processed "),a()()())}function Fn(n,c){if(n&1){let e=P();i(0,"div",52)(1,"div",53)(2,"div",54)(3,"div",55)(4,"div")(5,"ul",56)(6,"li",57)(7,"button",58),w("click",function(){_(e);let t=d(2);return h(t.filterPreviewData(t.previewStatus.ALL))}),l(8),a()(),i(9,"li",59)(10,"button",60),w("click",function(){_(e);let t=d(2);return h(t.filterPreviewData(t.previewStatus.SYNC))}),l(11),a()(),i(12,"li",59)(13,"button",61),w("click",function(){_(e);let t=d(2);return h(t.filterPreviewData(t.previewStatus.WRONG))}),l(14),a()(),i(15,"li",59)(16,"button",62),w("click",function(){_(e);let t=d(2);return h(t.filterPreviewData(t.previewStatus.UNSYNC))}),l(17),a()()()(),i(18,"div")(19,"button",63),w("click",function(){_(e);let t=d(2);return h(t.exportOrders())}),f(20,"i",64),i(21,"span"),l(22,"Export"),a()()()()(),i(23,"table",65)(24,"thead",66)(25,"tr"),f(26,"th",67),i(27,"th",68),l(28,"Number"),a(),g(29,En,2,1,"th",69),i(30,"th",70),l(31,"Channel Status"),a(),i(32,"th",70),l(33,"POS Status"),a(),i(34,"th"),l(35,"Action"),a(),f(36,"th",67),a()(),i(37,"tbody"),g(38,kn,2,1,"ng-container",71)(39,Vn,6,0,"ng-template",null,2,W),a()()()()}if(n&2){let e=M(40),r=d(2);o(7),s("ngClass",r.pillStatus=="all"?"btn-secondary text-white":"btn-outline-dark"),o(),v(" All (",r.allData,") "),o(2),s("ngClass",r.pillStatus=="sync"?"btn-success":"btn-outline-success"),o(),v(" Existing (",r.syncData,") "),o(2),s("ngClass",r.pillStatus=="wrong"?"btn-warning text-white":"btn-outline-warning"),o(),v(" Wrong Status (",r.wrongData,") "),o(2),s("ngClass",r.pillStatus=="unsync"?"btn-danger":"btn-outline-danger"),o(),v(" Missing (",r.unsyncData,") "),o(12),s("ngIf",(r.currentChannel==null?null:r.currentChannel.TypeID)!=r.channelType.Shopee&&(r.currentChannel==null?null:r.currentChannel.TypeID)!==r.channelType.Tiktok),o(9),s("ngIf",r.displayedPreviewData.length>0)("ngIfElse",e)}}function An(n,c){if(n&1&&g(0,Fn,41,11,"div",51),n&2){let e=d();s("ngIf",e.currentState=="preview")}}function Rn(n,c){n&1&&(f(0,"i",85),i(1,"span"),l(2,"Finish"),a())}function Wn(n,c){if(n&1&&(i(0,"tr",87)(1,"td"),l(2),a(),i(3,"td"),l(4),a(),i(5,"td"),l(6),a(),i(7,"td"),l(8),a()()),n&2){let e=c.$implicit,r=c.index;s("ngClass",at(5,hn,e.Exception)),o(2),u(r+1),o(2),u(e.Number),o(2),u(e.Status),o(2),u(e.Exception)}}function Bn(n,c){if(n&1&&(T(0),g(1,Wn,9,7,"tr",86),D()),n&2){let e=d(3);o(),s("ngForOf",e.downloadData)}}function zn(n,c){n&1&&(i(0,"tr",80)(1,"td",81)(2,"div",82),f(3,"i",83),a(),i(4,"h4",84),l(5," There is no order to processed "),a()()())}function Gn(n,c){if(n&1&&(i(0,"div",52)(1,"div",53)(2,"table",65)(3,"thead",66)(4,"tr"),f(5,"th",67),i(6,"th"),l(7,"Order Number"),a(),i(8,"th"),l(9,"Status"),a(),i(10,"th"),l(11,"Exception"),a()()(),i(12,"tbody"),g(13,Bn,2,1,"ng-container",71)(14,zn,6,0,"ng-template",null,3,W),a()()()()),n&2){let e=M(15),r=d(2);o(13),s("ngIf",(r.downloadData==null?null:r.downloadData.length)>0)("ngIfElse",e)}}function jn(n,c){if(n&1&&g(0,Gn,16,2,"div",51),n&2){let e=d();s("ngIf",e.currentState=="finish")}}function Hn(n,c){n&1&&(i(0,"h6"),l(1,"1"),a())}function Un(n,c){n&1&&(i(0,"h6"),l(1,"2"),a())}function Yn(n,c){n&1&&(i(0,"h6"),l(1,"3"),a())}var X=function(n){return n.ALL="all",n.SYNC="sync",n.WRONG="wrong",n.UNSYNC="unsync",n}(X||{}),qt=(()=>{class n{constructor(e,r,t,p,S,m,je){this.http=e,this.toastr=r,this.datePipe=t,this.url=p,this.productService=S,this.orderService=m,this.authService=je,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=N,this.previewStatus=X,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=be,this.cacheKey="",this.showTimePicker=!1,this.downloadType=et(!1),this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initTimeFilter(),this.url.queryParams.subscribe(e=>{this.channelID=e.ChannelID,this.startDate=new Date(e.Date),this.endDate=new Date(e.Date)})}initTimeFilter(){this.timeFrom="00:00",this.timeTo="23:59"}onDownload(e){let r={ID:this.channelID,From:this.startDate,To:this.endDate,ListPreview:this.downloadedPreviewData,IsDisbursement:this.downloadType(),cacheKey:this.cacheKey};this.http.post("/api/Orders/Download",r).subscribe(t=>{this.downloadData=t.Body,this.onStepperNext(e)})}onPreview(e){if(!this.validateDatePreview())return;let r={ID:this.channelID,From:this.startDate,To:this.endDate,IsDisbursement:this.downloadType()};this.showTimePicker&&(r=$e(Je({},r),{TimeFrom:this.timeFrom+":00",TimeTo:this.timeTo+":00"})),this.http.post("/api/Orders/Preview",r).subscribe(t=>{if(t.Data.length==0){this.toastrEmptyPreview();return}this.cacheKey=t.cacheKey,this.previewData=t.Data,this.groupingPreviewData(),this.filterPreviewData(X.ALL),this.initLengthStatusData(),this.onStepperNext(e)})}toastrEmptyPreview(){let e=this.datePipe.transform(this.startDate,"dd MMM yyyy"),r=this.datePipe.transform(this.endDate,"dd MMM yyyy"),t=this.showTimePicker?this.timeFrom+":00":"",p=this.showTimePicker?this.timeTo+":00":"";this.toastr.info(`There is no orders from ${e} ${t} to ${r} ${p}!`,"No Orders!")}validateDatePreview(){let e=!0;return this.downloadType()==!0?I.getDaysDiff(this.startDate,this.endDate)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Failed"),e=!1):I.getDaysDiff(this.startDate,this.endDate)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Failed"),e=!1),e}onSelectChannel(){this.currentChannel=this.channelOptions.find(e=>e.ID==this.channelID),this.initGetChannelDetail()}initGetChannelDetail(){this.currentChannel.TypeID==N.Tokopedia?this.channelDetail$=this.http.post("/api/ChannelLoader/GetChannelView",{ID:this.currentChannel.ID}).pipe(de(e=>e?.Model),_e(1)):this.channelDetail$=null}setPageTitle(e){this.pageTitle=`
6
- ${e} (${this.getDateTitle()})
7
- `}getDateTitle(){let e=I.formatTitleFromDate(new Date(this.startDate),new Date(this.endDate)),r=this.datePipe.transform(this.startDate,e),t=this.datePipe.transform(this.endDate,"dd MMM yyyy");return`${e==null?"":r+"-"} ${t}`}onNew(e){this.channelID=null,this.startDate=null,this.endDate=null,this.pageTitle="Download to POS",this.channelDetail$=null,e.reset()}groupingPreviewData(){let e=this.filterDataByStatus(X.UNSYNC),r=this.filterDataByStatus(X.WRONG),t=[];this.currentChannel.TypeID==N.Tokopedia&&(t=this.filterDataByStatus(X.SYNC)),this.downloadedPreviewData=[...t,...e,...r]}filterDataByStatus(e){let r=[];switch(e){case X.ALL:r=this.previewData;break;case X.SYNC:r=this.previewData.filter(t=>t.Action==be.DoNothing);break;case X.WRONG:r=this.previewData.filter(t=>t.Action==be.Update);break;case X.UNSYNC:r=this.previewData.filter(t=>t.Action==be.New);break}return r}filterPreviewData(e){this.pillStatus=e,this.displayedPreviewData=this.filterDataByStatus(e)}initLengthStatusData(){this.wrongData=this.filterDataByStatus(X.WRONG).length,this.allData=this.previewData.length,this.syncData=this.filterDataByStatus(X.SYNC).length,this.unsyncData=this.filterDataByStatus(X.UNSYNC).length}getTypeID(){var e=this.channelOptions.find(r=>r.ID==this.channelID)?.TypeID;return e??0}onStepperChange(e){this.currentState=e.selectedStep.state}onStepperNext(e){e.selected.completed=!0,e.next()}onNext(e){switch(this.currentState){case"filter":this.onPreview(e);break;case"preview":this.onDownload(e);break}}stepChange(e){switch(e?.selectedStep?.state){case"filter":this.pageTitle="Download To POS",this.resetPreviewData();break;case"preview":let r=this.productService.findChannelById(this.channelID,this.channelOptions);this.setPageTitle(`Preview ${r?.Name}`);break;case"finish":this.setPageTitle("Download");break}}resetPreviewData(){this.displayedPreviewData=[],this.previewData=[],this.initLengthStatusData()}checkDisabledNextFilter(){let e=!I.isValidDate(this.startDate)||!I.isValidDate(this.endDate),r=I.IsEmpty(this.channelID);return e||r}exportOrders(){let e={ID:this.channelID,From:this.startDate,To:this.endDate},r=`Orders ${this.getDateTitle()}`;this.orderService.exportOrders(e,r).subscribe()}onFilterDateChange(){let e=1;this.startDate&&this.endDate&&(e=I.getDaysDiff(this.startDate,this.endDate)),this.showTimePicker=e==0}static{this.\u0275fac=function(r){return new(r||n)(b(B),b(Fe),b(V),b(Le),b(vt),b(Ce),b(q))}}static{this.\u0275cmp=k({type:n,selectors:[["app-download"]],standalone:!1,features:[nt([{provide:Ot,useValue:{displayDefaultIndicatorType:!1}}])],decls:25,vars:13,consts:[["stepper",""],["picker",""],["EMPTY",""],["EMPTY_DOWNLOAD",""],[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[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,"selectionChange","ngClass"],["state","filter",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","preview",3,"editable","completed"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],["routerLink","/menu/Order/Download",1,"btn","btn-outline-secondary","btn-fill","me-3"],[1,"btn-group","me-3"],[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,"row","pt-2",2,"width","63%","margin-right","40px"],[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"],[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"],[1,"mt-8"],[3,"timeChange","time"],[1,"mx-4"],[1,"fa-solid","fa-file","me-3"],["class","row pt-2",4,"ngIf"],[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"],["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"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"]],template:function(r,t){if(r&1){let p=P();i(0,"mainpanel",4)(1,"actions"),g(2,gn,3,0,"ng-container",5)(3,un,6,1,"ng-container",5)(4,fn,3,1,"ng-container",5)(5,Sn,4,0,"ng-container",5),a(),i(6,"content")(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"mat-stepper",10,0),w("selectionChange",function(m){return _(p),h(t.stepChange(m))})("selectionChange",function(m){return _(p),h(t.onStepperChange(m))}),i(13,"mat-step",11),g(14,Cn,3,0,"ng-template",12)(15,Tn,27,11,"ng-template",13),a(),i(16,"mat-step",14),g(17,Dn,3,0,"ng-template",12)(18,An,1,1,"ng-template",13),a(),i(19,"mat-step",15),g(20,Rn,3,0,"ng-template",12)(21,jn,1,1,"ng-template",13),a(),g(22,Hn,2,0,"ng-template",16)(23,Un,2,0,"ng-template",17)(24,Yn,2,0,"ng-template",18),a()()()()()()()}if(r&2){let p=M(12);s("headerTitle",t.pageTitle)("description",t.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),o(2),s("ngIf",t.currentState=="filter"),o(),s("ngIf",t.currentState=="preview"),o(),s("ngIf",t.currentState=="filter"),o(),s("ngIf",t.currentState=="finish"),o(6),tt("ngClass","last-edited-step-"+p.selectedIndex),o(2),s("editable",t.currentState!="finish")("completed",!1),o(3),s("editable",t.currentState!="finish")("completed",!1)}},dependencies:[rt,A,R,H,U,Y,z,j,K,pt,bt,Tt,Dt,Et,Vt,Mt,Ft,Lt,kt,st,We,St,Ct,fe,V],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}
8
- `],encapsulation:2})}}return n})();var qn=[{path:"",component:Wt,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:Bt,canActivate:[ne],data:{title:"New Order"}},{path:"detail",component:zt,canActivate:[ne],data:{title:"Orders detail"}},{path:"ready_to_ship",component:Gt,canActivate:[ne],data:{title:"Ready To Ship"}},{path:"Shipped",component:jt,canActivate:[ne],data:{title:"Shipped"}},{path:"Delivered",component:Ht,canActivate:[ne],data:{title:"Delivered"}},{path:"All",component:Ut,canActivate:[ne],data:{title:"All Order"}},{path:"Cancelled",component:Yt,canActivate:[ne],data:{title:"Cancelled"}},{path:"Download/V1",component:qt,canActivate:[ne],data:{title:"Download V1"}},{path:"Download",loadComponent(){return import("./chunk-MKR6QJ6R.js").then(n=>n.DownloadV2Component)},canActivate:[ne],data:{title:"Download"}},{path:"Download_Order_Log",loadComponent:()=>import("./chunk-56I7OOXQ.js").then(n=>n.DownloadOrderLogComponent),canActivate:[ne],data:{title:"Download Order Log"}},{path:"Download_Order_Log/Detail",loadComponent:()=>import("./chunk-WLZKVYHT.js").then(n=>n.DownloadOrderDetailComponent),canActivate:[ne],data:{title:"Download Order Log Detail"}}]}],Kt=(()=>{class n{static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275mod=Me({type:n})}static{this.\u0275inj=Oe({imports:[Se,ke.forChild(qn)]})}}return n})();var Kr=(()=>{class n{static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275mod=Me({type:n})}static{this.\u0275inj=Oe({providers:[Ce,Be,Re],imports:[Se,lt,Kt,ft,_t,Nt,ke,mt,Pt,xt,$,At,dt,gt,Rt,ct,wt,ht,J,Ge,We,yt]})}}return n})();export{Kr as OrdersModule};
@@ -1 +0,0 @@
1
- import{a as V}from"./chunk-4BKQVHMV.js";import{a as j,b as q}from"./chunk-OPL2QMKR.js";import{Y as $}from"./chunk-MSNWTSDH.js";import{r as U,s as W}from"./chunk-3S7C3CCV.js";import{a as I,h as R,m as A,y as D}from"./chunk-5JWYKH72.js";import{b as s,c as a}from"./chunk-PW42BQIY.js";import{a as F}from"./chunk-KESNVJB4.js";import{j as O,n as z}from"./chunk-UPA7TFVG.js";import{$c as x,Fb as w,Fc as y,Ga as _,Hc as M,Jc as v,Ka as T,Kc as L,Lb as g,Lc as P,Oa as h,Pc as B,Ra as c,Xb as d,Z as b,_c as E,cc as k,hc as u,ia as S,ic as r,pa as m,rb as p,sc as f,tc as N,v as C}from"./chunk-VFLAHRB4.js";function J(n,G){if(n&1&&(u(0,"div",4),y(1),r()),n&2){let e=N();p(),M(" ",e.selectedCategoryLabel()," ")}}function K(n,G){n&1&&(u(0,"label",3),y(1,"Channel"),r())}var he=(()=>{class n{constructor(){this.multiwarehousTreeService=m(V),this.destroyRef=m(_),this.selectedCategoryLabel=c("Select a Channel"),this.disabled=c(!1),this.selectedNode=c(null),this.multiple=h(!1),this.floatingLabel=h(!1),this.onChannelChange=new T,this.channels$=this.multiwarehousTreeService.getChannelTree$().pipe(C(e=>e.map(t=>{t.children=t.children.map(i=>(i.icon="fa-solid fa-warehouse",i));let o=this.getChannelType(t.typeid);return t.icon=`custom-icon-${o}`,t.expandedIcon=null,t.collapsedIcon=null,t.styleClass=`custom-icon-${o}`,t.logo=a.getChannelLogoByTypeId(t.typeId),t})),b(1)),this.htmlBody=document.querySelector("body"),this.onChange=e=>{},this.onTouched=()=>{}}getChannelType(e){switch(e){case s.Tokopedia:return"tokopedia";case s.Shopee:return"shopee";case s.Lazada:return"lazada";case s.Shopify:return"shopify";case s.WooCommerce:return"woocommerce";case s.Tiktok:return"tiktok";case s.Plugo:return"plugo"}}initSelectedNode(e){this.channels$.pipe(F(this.destroyRef)).subscribe(t=>{if(this.multiple()){let o=[];for(let i of e){let l=a.searchByIdWithParentDFS(t,i),H=Object.assign({},l);o.push(H)}this.selectedNode.set(o),this.emitMultipleNodes()}else{let o=a.searchByIdWithParentDFS(t,e),i=Object.assign({},o);this.selectedNode.set(i),this.emitSingleNode(i)}})}onNodeSelect(e){let t=Object.assign({},e.node);this.multiple()?this.emitMultipleNodes():this.emitSingleNode(t)}emitMultipleNodes(){let e=Object.assign([],this.selectedNode()),t=e.map(o=>o.id);this.onChange(t),this.onChannelChange.emit(e),this.generateLabel()}emitSingleNode(e){this.onChange(e.id),this.onChannelChange.emit(e),this.generateLabel()}onNodeUnSelect(e){if(this.multiple()){let t=e.node;this.selectedNode.update(o=>o.filter(i=>i.id!==t.id)),this.emitMultipleNodes(),this.generateLabel()}}generateLabel(){let e="Select a Channel";if(this.multiple()){e="";for(let t of this.selectedNode())e+=a.getLabelPathTree(t)+", ";this.selectedCategoryLabel.set(e)}else{let t=this.selectedNode();t?(e=a.getLabelPathTree(t),this.selectedCategoryLabel.set(e)):this.selectedCategoryLabel.set(e)}}onClear(){this.onChange(null)}onClick(){let e=this.getBodyTop(),t=document.querySelector(".p-overlay.p-component"),o=e+t.getBoundingClientRect().top,i=t.getAttribute("style")||"";t.setAttribute("style",`${i} top: ${o+e}px;`)}getBodyTop(){return this.htmlBody.getBoundingClientRect().top*-1}writeValue(e){a.IsNotEmpty(e)&&this.initSelectedNode(e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled.set(e)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=w({type:n,selectors:[["multiwarehouse-tree-select"]],inputs:{multiple:[1,"multiple"],floatingLabel:[1,"floatingLabel"]},outputs:{onChannelChange:"onChannelChange"},features:[B([{provide:I,useExisting:S(()=>n),multi:!0}])],decls:5,vars:9,consts:[["matTooltipPosition","above",1,"p-float-label",3,"matTooltip"],["appendTo","body","containerStyleClass","w-100","id","selectChannel",1,"multiwarehouse-select",3,"click","onNodeSelect","ngModelChange","onClear","onNodeUnselect","filter","filterInputAutoFocus","options","ngModel","selectionMode"],["pTemplate","value","type","default"],["for","selectChannel"],["matTooltipPosition","above"]],template:function(t,o){t&1&&(u(0,"span",0)(1,"p-treeSelect",1),E(2,"async"),f("click",function(){return o.onClick()})("onNodeSelect",function(l){return o.onNodeSelect(l)}),P("ngModelChange",function(l){return L(o.selectedNode,l)||(o.selectedNode=l),l}),f("onClear",function(){return o.onClear()})("onNodeUnselect",function(l){return o.onNodeUnSelect(l)}),g(3,J,2,1,"ng-template",2),r(),g(4,K,2,0,"label",3),r()),t&2&&(d("matTooltip",o.selectedCategoryLabel()),p(),d("filter",!0)("filterInputAutoFocus",!0)("options",x(2,7,o.channels$)),v("ngModel",o.selectedNode),d("selectionMode",o.multiple()?"multiple":"single"),p(3),k(o.floatingLabel()?4:-1))},dependencies:[z,O,q,j,$,D,R,A,W,U],styles:["[_nghost-%COMP%] .p-treeselect{width:100%;display:inline-flex;border:1px solid #ced4da;font-size:.875rem!important} .p-element .p-icon-wrapper{width:14px} .p-float-label .multiwarehouse-select.p-treeselect{padding:7px!important;min-height:.6rem!important} .custom-icon-tokopedia.p-tree-node-icon, .custom-icon-shopee.p-tree-node-icon, .custom-icon-woocommerce.p-tree-node-icon, .custom-icon-lazada.p-tree-node-icon, .custom-icon-tiktok.p-tree-node-icon, .custom-icon-shopify.p-tree-node-icon, .custom-icon-plugo.p-tree-node-icon{background-size:contain;background-repeat:no-repeat;width:20px;height:20px;display:inline-block} .custom-icon-tokopedia.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png)} .custom-icon-woocommerce.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp)} .custom-icon-shopee.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png)} .custom-icon-tiktok.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png)} .custom-icon-lazada.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1680681836/icons/marketplace_icons/Lazadanew.png)} .custom-icon-shopify.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1707987435/icons/marketplace_icons/shopify.png)} .custom-icon-plugo.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1739236419/icons/marketplace_icons/plugo.ico)} .custom-icon-shopee .fa-warehouse.p-tree-node-icon, .custom-icon-tiktok .fa-warehouse.p-tree-node-icon, .custom-icon-tokopedia .fa-warehouse.p-tree-node-icon, .custom-icon-lazada .fa-warehouse.p-tree-node-icon, .custom-icon-shopify .fa-warehouse.p-tree-node-icon, .custom-icon-woocommerce .fa-warehouse.p-tree-node-icon, .custom-icon-plugo .fa-warehouse.p-tree-node-icon{background-image:none!important;display:inline-block!important}"]})}}return n})();export{he as a};
@@ -1 +0,0 @@
1
- import{a as Ie,b as Ve,c as Re}from"./chunk-LXSQIECO.js";import{a as Le}from"./chunk-JYT2OOPZ.js";import{a as Ee}from"./chunk-2SABH24F.js";import{a as Pe}from"./chunk-CXIBIPS5.js";import{a as Fe}from"./chunk-4NOCCDHL.js";import"./chunk-ACIMXBIC.js";import"./chunk-ZUKHXAUV.js";import"./chunk-6ZQHMI2W.js";import"./chunk-CDNNFRZK.js";import"./chunk-3RK6DDJD.js";import{a as Me}from"./chunk-7SLPBFFW.js";import"./chunk-NB5JKHKF.js";import"./chunk-ZUFLZMHT.js";import"./chunk-YOGRCIUI.js";import"./chunk-SDUUFQUI.js";import"./chunk-JNXIAVS4.js";import"./chunk-PRVOIBMJ.js";import"./chunk-V27YSSV4.js";import{c as $,d as ee,e as te}from"./chunk-LIQRQYKZ.js";import"./chunk-T2QY5RTH.js";import"./chunk-PQZGUDGJ.js";import"./chunk-LLXJSB37.js";import{j as M}from"./chunk-YWRRGL7S.js";import{b as ve,e as U}from"./chunk-XMUA7ACY.js";import"./chunk-K5XRGNWG.js";import"./chunk-TGMCGROM.js";import"./chunk-WAGDS532.js";import{b as ie,c as ne,d as De,e as oe,f as re,g as be,h as ae,m as we,n as Oe}from"./chunk-5SXUJ5XH.js";import{r as Te,s as xe}from"./chunk-3S7C3CCV.js";import"./chunk-PHCYCYXH.js";import{c as ye,h as B,m as z,o as ke,y as V}from"./chunk-5JWYKH72.js";import{b as y,c as H}from"./chunk-PW42BQIY.js";import"./chunk-KESNVJB4.js";import"./chunk-GQH7OSVY.js";import{j as Se,k as j,m as Ce,n as O}from"./chunk-UPA7TFVG.js";import{$b as K,$c as X,Fb as D,Fc as a,G as pe,Gc as C,Hc as Q,Jc as k,Kc as v,Lb as E,Lc as T,Mc as ue,Na as q,Nc as he,Oa as J,Oc as ge,Pc as fe,Qc as _e,Ra as f,Rc as Y,Xb as u,Z as me,_c as x,aa as le,ad as I,cc as P,dc as L,fc as N,gc as A,hc as o,ic as r,ja as F,jc as b,nc as w,pa as c,pb as de,qd as Z,rb as p,sc as m,tc as h,v as W,ya as _,za as S}from"./chunk-VFLAHRB4.js";import"./chunk-EU2KAMEK.js";import{a as G,b as ce}from"./chunk-66YHNWRR.js";var Ne=i=>({"text-muted":i});function qe(i,g){if(i&1){let e=w();o(0,"div",10),m("click",function(){_(e);let n=h();return S(n.onSelectDelivery("DROP_OFF"))}),o(1,"div",11),b(2,"i",12),o(3,"h3",13),a(4,"Drop off"),r()(),o(5,"p",14),a(6," You can drop off your package at the nearest shipping counter in your city. "),r()()}if(i&2){let e=h();K(Y(2,Ne,e.selectedDelivery()==="PICK_UP"))}}function Je(i,g){if(i&1){let e=w();o(0,"div",10),m("click",function(){_(e);let n=h();return S(n.onSelectDelivery("PICK_UP"))}),o(1,"div",11),b(2,"i",15),o(3,"h3",13),a(4,"Pick up"),r()(),o(5,"p",14),a(6," The courier will collect the package from your address. "),r()()}if(i&2){let e=h();K(Y(2,Ne,e.selectedDelivery()==="DROP_OFF"))}}var Ae=(()=>{class i{constructor(){this.data=c(ne),this.dialogRef=c(ie),this.selectedDelivery=f("DROP_OFF"),this.showPickup=f(!0),this.showDropOff=f(!0),this.initOptionsCondition()}onSelectDelivery(e){this.selectedDelivery.set(e)}initOptionsCondition(){switch(this.data.channelType){case y.Shopee:break;case y.Tiktok:this.showPickup.set(this.data.options?.Form?.information?.can_pickup),this.showDropOff.set(this.data.options?.Form?.information?.can_drop_off);break}}onConfirm(){this.dialogRef.close(this.selectedDelivery())}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=D({type:i,selectors:[["app-delivery-dialog"]],decls:16,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-8"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"ms-2"],[1,"text-secondary-emphasis"],[1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[1,"pb-0"],[1,"d-flex","align-items-center","justify-content-center","gap-12"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"class"],[1,"d-flex","justify-content-center",2,"margin-top","1.5rem"],[1,"btn","btn-success",2,"width","70px",3,"click"],["role","button",1,"delivery-option","d-flex","flex-column","align-items-center","justify-content-center","p-4","cursor-pointer",3,"click"],[1,"text-center"],[1,"fa-solid","fa-cart-shopping-fast","fa-4x"],[1,"mt-4"],[1,"text-center","mt-4","lh-sm"],[1,"fa-solid","fa-hand-holding-box","fa-4x"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),a(4,"Delivery Order"),r(),o(5,"div",3),a(6,"Your selected order(s) will be set to"),r()(),o(7,"div")(8,"i",4),m("click",function(){return n.onClose()}),r()()()(),o(9,"mat-dialog-content",5)(10,"div",6),E(11,qe,7,4,"div",7)(12,Je,7,4,"div",7),r(),o(13,"div",8)(14,"button",9),m("click",function(){return n.onConfirm()}),a(15," OK "),r()()()),t&2&&(p(11),P(n.showPickup()?11:-1),p(),P(n.showDropOff()?12:-1))},dependencies:[O,ae,oe,re],styles:[".delivery-option[_ngcontent-%COMP%]{width:14rem;height:12rem;border:1px solid #656565}.delivery-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:0}.delivery-option.text-muted[_ngcontent-%COMP%]{opacity:.7;border-color:#bebebe}"]})}}return i})();function Xe(i,g){if(i&1&&(o(0,"ng-option",3),a(1),r()),i&2){let e=g.$implicit;u("value",e==null?null:e.address_id)("matTooltip",e==null?null:e.address),p(),C(e==null?null:e.address)}}function Ze(i,g){if(i&1&&(o(0,"ng-option",6)(1,"span",7),a(2),x(3,"date"),r(),o(4,"span"),a(5),r()()),i&2){let e=g.$implicit;u("value",e==null?null:e.pickup_time_id),p(2),C(I(3,3,e==null?null:e.date,"d MMMM")),p(3),C(e==null?null:e.time_text)}}var Be=(()=>{class i{constructor(){this.shippingOptions=J(),this.onFormChanges=q(),this.addressList=Z(()=>this.shippingOptions()?.response?.pickup?.address_list||[]),this.selectedShipping=f(null),this.timeOptions=f(this.convertTimestampToDate(this.addressList()[0]?.time_slot_list||[])),this.pickupTime=f(null)}onAddressChange(e){let t=this.addressList().find(n=>n.address_id===e);this.timeOptions.set(this.convertTimestampToDate(t?.time_slot_list||[])),this.pickupTime.set(null)}onValueChanges(){this.onFormChanges.emit({address_id:this.selectedShipping(),pickup_time_id:this.pickupTime()})}convertTimestampToDate(e){return e.map(t=>{let n=new Date(t.date*1e3);return ce(G({},t),{date:n})})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=D({type:i,selectors:[["shopee-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:12,vars:4,consts:[[1,"mb-6"],["for","address",1,"mb-2","text-muted"],["id","address","placeholder","Select Address to Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value","matTooltip"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Date Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"label",1),a(2,"Address"),r(),o(3,"ng-select",2),T("ngModelChange",function(s){return v(n.selectedShipping,s)||(n.selectedShipping=s),s}),m("ngModelChange",function(s){return n.onAddressChange(s),n.onValueChanges()}),N(4,Xe,2,3,"ng-option",3,L),r()(),o(6,"div",0)(7,"label",4),a(8,"Date"),r(),o(9,"ng-select",5),T("ngModelChange",function(s){return v(n.pickupTime,s)||(n.pickupTime=s),s}),m("ngModelChange",function(){return n.onValueChanges()}),N(10,Ze,6,6,"ng-option",6,L),r()()),t&2&&(p(3),u("clearable",!1),k("ngModel",n.selectedShipping),p(),A(n.addressList()),p(5),u("clearable",!1),k("ngModel",n.pickupTime),p(),A(n.timeOptions()))},dependencies:[O,j,te,ee,$,V,B,z,xe,Te],encapsulation:2})}}return i})();function $e(i,g){if(i&1&&(o(0,"ng-option",3)(1,"span",4),a(2),x(3,"date"),r(),o(4,"span"),a(5),x(6,"date"),r(),o(7,"span",5),a(8,"-"),r(),o(9,"span"),a(10),x(11,"date"),r()()),i&2){let e=g.$implicit,t=g.$index;u("value",t),p(2),C(I(3,4,e==null?null:e.start_date,"d MMMM")),p(3),C(I(6,7,e==null?null:e.start_date,"HH:mm")),p(5),C(I(11,10,e==null?null:e.end_date,"HH:mm"))}}var ze=(()=>{class i{constructor(){this.shippingOptions=J(),this.onFormChanges=q(),this.timeOptions=Z(()=>this.shippingOptions()?.Options?.pickup_slots),this.selectedTimeIndex=f(null)}onValueChanges(){let e=this.timeOptions()[this.selectedTimeIndex()];this.onFormChanges.emit({start_time:e?.start_time,end_time:e?.end_time})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=D({type:i,selectors:[["tiktok-pickup"]],inputs:{shippingOptions:[1,"shippingOptions"]},outputs:{onFormChanges:"onFormChanges"},decls:6,vars:2,consts:[[1,"mb-6"],["for","timepicker",1,"mb-2","text-muted"],["id","timepicker","placeholder","Select Time Pickup","appendTo","body",1,"shipping-timepicker",3,"ngModelChange","clearable","ngModel"],[3,"value"],[1,"me-2"],[1,"mx-1"]],template:function(t,n){t&1&&(o(0,"div",0)(1,"label",1),a(2,"Time"),r(),o(3,"ng-select",2),T("ngModelChange",function(s){return v(n.selectedTimeIndex,s)||(n.selectedTimeIndex=s),s}),m("ngModelChange",function(){return n.onValueChanges()}),N(4,$e,12,13,"ng-option",3,L),r()()),t&2&&(p(3),u("clearable",!1),k("ngModel",n.selectedTimeIndex),p(),A(n.timeOptions()))},dependencies:[O,j,te,ee,$,V,B,z],encapsulation:2})}}return i})();function et(i,g){if(i&1){let e=w();o(0,"shopee-pickup",10),m("onFormChanges",function(n){_(e);let l=h();return S(l.onFormChanges(n))}),r()}if(i&2){let e=h();u("shippingOptions",e.dialogData.shippingOptions)}}function tt(i,g){if(i&1){let e=w();o(0,"tiktok-pickup",10),m("onFormChanges",function(n){_(e);let l=h();return S(l.onFormChanges(n))}),r()}if(i&2){let e=h();u("shippingOptions",e.dialogData.shippingOptions)}}var He=(()=>{class i{constructor(){this.dialogRef=c(ie),this.dialogData=c(ne),this.shippingOptions=f(this.dialogData.shippingOptions),this.channelType=f(this.dialogData.channelType),this.order=f(this.dialogData.order),this.channelTypeEnum=y,this.pickupData=f(null)}onFormChanges(e){this.pickupData.set(e)}onClose(){this.dialogRef.close()}onSave(){let e=this.generatePickupData();this.dialogRef.close(e)}generatePickupData(){switch(this.channelType()){case y.Shopee:return{OrderNumber:this.order().Number,ShopID:this.order().ShopID,pickup:this.pickupData()};case y.Tiktok:return{handover_method:"PICKUP",PackageID:this.shippingOptions().Form?.information?.PackageID,ShopID:this.order().ShopID,pickup_slot:this.pickupData()}}}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=D({type:i,selectors:[["app-pickup-dialog"]],decls:21,vars:2,consts:[["mat-dialog-title","",1,"mt-12","mb-6"],[1,"d-flex","justify-content-between","align-items-start","lh-lg"],[1,"lh-base","mt-6"],[1,"text-muted","fs-6"],["role","button",1,"fa-solid","fa-xmark","text-muted","cursor-pointer","fs-3",3,"click"],[2,"padding-bottom","10px"],[3,"shippingOptions"],[1,"d-flex","justify-content-end","align-items-center","w-100","pe-8","mb-4"],[1,"btn","btn-outline-secondary","me-4",2,"width","70px",3,"click"],[1,"btn","btn-success",2,"width","70px",3,"click"],[3,"onFormChanges","shippingOptions"]],template:function(t,n){if(t&1&&(o(0,"div",0)(1,"div",1)(2,"div")(3,"h3"),a(4,"Set Pickup"),r(),o(5,"div",2)(6,"div",3),a(7,"Shipping Method"),r(),o(8,"div",3),a(9),r()()(),o(10,"div")(11,"i",4),m("click",function(){return n.onClose()}),r()()()(),o(12,"mat-dialog-content",5),E(13,et,1,1,"shopee-pickup",6)(14,tt,1,1,"tiktok-pickup",6),r(),o(15,"mat-dialog-actions")(16,"div",7)(17,"button",8),m("click",function(){return n.onClose()}),a(18," Cancel "),r(),o(19,"button",9),m("click",function(){return n.onSave()}),a(20," Ok "),r()()()),t&2){let l,s;p(9),Q(" ",!((l=n.order())==null||l.LogisticService==null)&&l.LogisticService.Name?(l=n.order())==null||l.LogisticService==null?null:l.LogisticService.Name:"-"," "),p(4),P((s=n.channelType())===n.channelTypeEnum.Shopee?13:s===n.channelTypeEnum.Tiktok?14:-1)}},dependencies:[O,ae,oe,be,re,V,Be,ze],styles:['ng-select.shipping-timepicker .ng-arrow{border:none!important;width:0;height:0} ng-select.shipping-timepicker .ng-arrow-wrapper{width:28px;display:flex;align-items:center;justify-content:center} ng-select.shipping-timepicker .ng-arrow-wrapper:after{content:"\\f107";font-family:"Font Awesome 6 Pro","Font Awesome 6 Free","Font Awesome 5 Pro","Font Awesome 5 Free";font-style:normal;font-weight:400!important;font-size:16px;line-height:1;display:inline-block;color:#6b7280;pointer-events:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:auto}.label-opacity[_ngcontent-%COMP%]{opacity:.7}']})}}return i})();var se=(()=>{class i{constructor(){this.httpService=c(U)}getReadyToShipOrders(e){return this.httpService.post(M.GetToShip,e).pipe(W(t=>t?.Data))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=F({token:i,factory:i.\u0275fac})}}return i})();var Ue=(()=>{class i{constructor(){this.httpService=c(U)}getShippingOptions(e,t){return this.httpService.post(M.GetTiktokShippingOptions,{OrderNumber:e,ShopID:t}).pipe(W(n=>this.formatDatePickUpOptions(n)))}pickupOrder(e){return this.httpService.post(M.TiktokSelectShipping,e)}dropOffOrder(e,t){let n={handover_method:"DROP_OFF",PackageID:e,ShopID:t};return this.httpService.post(M.TiktokSelectShipping,n)}formatDatePickUpOptions(e){return e?.Options?.pickup_slots&&(e.Options.pickup_slots=e?.Options?.pickup_slots.map(t=>{let n=H.convertTimestampToDate(t.start_time),l=H.convertTimestampToDate(t.end_time);return t.start_date=n,t.end_date=l,t})),e}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=F({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Ge=(()=>{class i{constructor(){this.httpService=c(U)}getShippingOptions(e,t){return this.httpService.post(M.GetShopeeShippingOptions,{OrderNumber:e,ShopID:t})}pickupOrder(e){return this.httpService.post(M.ShopeeSelectShipping,e)}dropOffOrder(e,t){let n={OrderNumber:e,ShopID:t,dropoff:{}};return this.httpService.post(M.ShopeeSelectShipping,n)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=F({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Ke=(()=>{class i{constructor(){this.shopeeShippingService=c(Ge),this.tiktokShippingService=c(Ue)}getShippingOptions(e,t,n){switch(n){case y.Shopee:return this.getShopeeShippingOptions(e,t);case y.Tiktok:return this.getTiktokShippingOptions(e,t)}}pickupOrder(e,t){switch(e.MarketType){case y.Shopee:return this.shopeeShippingService.pickupOrder(t);case y.Tiktok:return this.tiktokShippingService.pickupOrder(t)}}dropOffOrder(e,t){switch(e.MarketType){case y.Shopee:return this.shopeeShippingService.dropOffOrder(e.Number,e.ShopID);case y.Tiktok:let n=t?.Form?.information?.PackageID;return this.tiktokShippingService.dropOffOrder(n,e.ShopID)}}getShopeeShippingOptions(e,t){return this.shopeeShippingService.getShippingOptions(e,t)}getTiktokShippingOptions(e,t){return this.tiktokShippingService.getShippingOptions(e,t)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=F({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var it=()=>[],nt=i=>({"td-cell-hover":i});function ot(i,g){if(i&1&&b(0,"variants-dropdown",28),i&2){let e=h().$implicit;u("variants",e==null?null:e.Variants)}}function rt(i,g){if(i&1&&b(0,"variant-with-image",29),i&2){let e=h().$implicit;u("variant",e==null?null:e.Variants[0])}}function at(i,g){if(i&1&&(o(0,"span"),a(1),r()),i&2){let e=h().$implicit;p(),C(e.LogisticService==null?null:e.LogisticService.Option)}}function pt(i,g){if(i&1){let e=w();o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"div",24)(5,"div",25)(6,"div"),b(7,"img",26),x(8,"channelImage"),r(),o(9,"div"),b(10,"order-link",27),r()(),o(11,"small"),a(12),x(13,"date"),r()()(),o(14,"td"),a(15),r(),o(16,"td"),E(17,ot,1,1,"variants-dropdown",28)(18,rt,1,1,"variant-with-image",29),r(),o(19,"td",30),a(20),x(21,"number"),r(),o(22,"td")(23,"span"),a(24),r(),E(25,at,2,1,"span"),r(),o(26,"td",31)(27,"button",32),m("click",function(){let n=_(e).$implicit,l=h(2);return S(l.onSetFulfillment(n))}),a(28," Set Fulfillment "),r()()()}if(i&2){let e=g.$implicit;p(2),C(e.Outlet),p(5),u("src",X(8,12,e==null?null:e.MarketType),de)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),p(3),u("order",e),p(2),Q(" ",I(13,14,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),p(3),C(e.Customer),p(),K(Y(19,nt,(e.Variants==null?null:e.Variants.length)>1)),p(),P((e.Variants==null?null:e.Variants.length)>1?17:18),p(3),C(X(21,17,e.Amount)),p(4),C(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),p(),P(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?25:-1)}}function lt(i,g){if(i&1){let e=w();o(0,"div",13)(1,"table",15)(2,"thead",16)(3,"tr",17)(4,"th",18),a(5,"Outlet"),r(),o(6,"th",19),a(7,"Number"),r(),o(8,"th",19),a(9,"Customer"),r(),o(10,"th"),a(11,"Items"),r(),o(12,"th",20),a(13,"Amount"),r(),o(14,"th",21),a(15,"Shipping"),r(),b(16,"th",22),r()(),o(17,"tbody"),N(18,pt,29,21,"tr",null,L),r()(),o(20,"app-custom-paginator",23),m("next",function(){_(e);let n=h();return S(n.initReadyToShip())})("previous",function(){_(e);let n=h();return S(n.initReadyToShip())}),r()()}if(i&2){let e=h(),t=ge(0);p(18),A(t),p(2),u("filter",e.filter())("totaldata",t==null?null:t.length)}}function st(i,g){i&1&&(o(0,"div",14),b(1,"app-empty-state"),r())}var Ii=(()=>{class i{constructor(){this.readyToShipService=c(se),this.dialog=c(De),this.pickupService=c(Ke),this.toastr=c(ve),this.filter=f({PageNumber:1,PageSize:100,ListChannelID:[],From:new Date,To:new Date})}ngOnInit(){this.initReadyToShip()}initReadyToShip(){this.readyToShip$=this.readyToShipService.getReadyToShipOrders(this.filter()).pipe(me(1))}onFilterChange(e){this.filter.update(t=>G(G({},t),e))}onSetFulfillment(e){this.pickupService.getShippingOptions(e.Number,e.ShopID,e.MarketType).pipe(le(t=>this.dialog.open(Ae,{height:"400px",width:"530px",data:{options:t,channelType:e.MarketType}}).afterClosed().pipe(pe(n=>H.IsNotEmpty(n)),W(n=>({type:n,order:e,options:t}))))).subscribe(t=>{t.type=="PICK_UP"?this.onSelectPickup(t.order,t.options):this.onSelectDropOff(t.order,t.options)})}onSelectPickup(e,t){this.dialog.open(He,{width:"530px",data:{order:e,shippingOptions:t,channelType:e.MarketType},disableClose:!0}).afterClosed().pipe(pe(n=>H.IsNotEmpty(n)),le(n=>this.pickupService.pickupOrder(e,n))).subscribe(()=>{this.toastr.success("Pickup order created successfully","Success"),this.initReadyToShip()})}onSelectDropOff(e,t){this.pickupService.dropOffOrder(e,t).subscribe(()=>{this.toastr.success("Drop-off order created successfully","Success"),this.initReadyToShip()})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=D({type:i,selectors:[["app-ready-to-ship"]],features:[fe([se])],decls:29,vars:12,consts:[["headerTitle","To Ship","searchBoxPlaceHolder","Search Orders...",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","100px"],[2,"width","250px"],[1,"text-end",2,"width","150px"],[2,"width","150px"],[2,"width","160px"],["rowCountApi","/api/orders/toshipcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","14px","padding-bottom","2.5px",3,"src","alt"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"actions-cell"],[1,"btn","btn-success","btn-sm",2,"--bs-btn-padding-y","0.25rem","--bs-btn-padding-x","0.5rem","--bs-btn-font-size","0.75rem",3,"click"]],template:function(t,n){if(t&1){let l=w();ue(0),x(1,"async"),o(2,"mainpanel",0),m("onSubmit",function(){return _(l),S(n.initReadyToShip())}),o(3,"filters")(4,"div")(5,"label",1),a(6,"From/To"),r(),o(7,"channel-select-options",2),T("ngModelChange",function(d){return _(l),v(n.filter().ListChannelID,d)||(n.filter().ListChannelID=d),S(d)}),r()(),o(8,"div",3)(9,"label",1),a(10,"From/To"),r(),o(11,"div",4)(12,"datepicker",5),T("dateChange",function(d){return _(l),v(n.filter().From,d)||(n.filter().From=d),S(d)}),r()(),o(13,"div")(14,"datepicker",6),T("dateChange",function(d){return _(l),v(n.filter().To,d)||(n.filter().To=d),S(d)}),r()()(),o(15,"div",3)(16,"label",7),a(17,"Page Number"),r(),o(18,"input",8),T("ngModelChange",function(d){return _(l),v(n.filter().PageNumber,d)||(n.filter().PageNumber=d),S(d)}),r()(),o(19,"div",3)(20,"label",7),a(21,"Page Size"),r(),o(22,"input",9),T("ngModelChange",function(d){return _(l),v(n.filter().PageSize,d)||(n.filter().PageSize=d),S(d)}),r()()(),o(23,"content")(24,"div",10)(25,"div",11)(26,"div",12),E(27,lt,21,2,"div",13)(28,st,2,0,"div",14),r()()()()()}if(t&2){let l=he(X(1,8,n.readyToShip$)||_e(11,it));p(2),u("hideSearchBox",!0),p(5),u("multiple",!0),k("ngModel",n.filter().ListChannelID),p(5),k("date",n.filter().From),p(2),k("date",n.filter().To),p(4),k("ngModel",n.filter().PageNumber),p(4),k("ngModel",n.filter().PageSize),p(5),P(l.length>0?27:28)}},dependencies:[O,Se,Ce,j,Oe,we,Pe,Me,V,ye,ke,B,z,Ie,Ve,Re,Fe,Ee,Le],styles:[".actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{opacity:0;visibility:hidden;transition:opacity .12s ease-in-out}tr[_ngcontent-%COMP%]:hover .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:hover .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%]:focus-within .btn[_ngcontent-%COMP%], .actions-cell[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]:focus{opacity:1;visibility:visible}"]})}}return i})();export{Ii as ReadyToShipComponent};
@@ -1 +0,0 @@
1
- var s=function(o){return o[o.Tokopedia=1]="Tokopedia",o[o.WooCommerce=2]="WooCommerce",o[o.None=3]="None",o[o.KalCare=4]="KalCare",o[o.Shopee=5]="Shopee",o[o.Tiktok=6]="Tiktok",o[o.Lazada=7]="Lazada",o[o.Shopify=8]="Shopify",o[o.Plugo=9]="Plugo",o}(s||{});var i=function(o){return o.SHOOPE="https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png",o.WOOCOMMERCE="https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp",o.TOKOPEDIA="https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png",o.TIKTOK="https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png",o.LAZADA="https://res.cloudinary.com/pos/image/upload/v1680681836/icons/marketplace_icons/Lazadanew.png",o.KALCARE="https://res.cloudinary.com/pos/image/upload/v1654230268/icons/marketplace_icons/kalcare.png",o.SHOPIFY="https://res.cloudinary.com/pos/image/upload/v1707987435/icons/marketplace_icons/shopify.png",o.PLUGO="https://res.cloudinary.com/pos/image/upload/v1739236419/icons/marketplace_icons/plugo.ico",o.PLUGONEW="https://res.cloudinary.com/pos/image/upload/v1739263497/icons/marketplace_icons/plugonew.ico",o}(i||{});var D=(()=>{class o{static{this.GuidEMpty="00000000-0000-0000-0000-000000000000"}static{this.MinDate="0001-01-01T00:00:00"}static IsNotEmpty(t){return t!=""&&t!=o.GuidEMpty&&t!=null&&t!=null}static IsEmpty(t){return t==""||t==null||t==null||t==o.GuidEMpty}static getChannelLogoByTypeId(t){let e;switch(t){case s.Tokopedia:e=i.TOKOPEDIA;break;case s.Shopee:e=i.SHOOPE;break;case s.WooCommerce:e=i.WOOCOMMERCE;break;case s.Lazada:e=i.LAZADA;break;case s.Tiktok:e=i.TIKTOK;break;case s.KalCare:e=i.KALCARE;break;case s.Shopify:e=i.SHOPIFY;break;case s.Plugo:e=i.PLUGO;break}return e}static getChannelLogoByName(t=""){t=t.toLowerCase();let e;switch(t){case"tokopedia":e=i.TOKOPEDIA;break;case"shoppe":e=i.SHOOPE;break;case"woocommerce":e=i.WOOCOMMERCE;break;case"tiktok":e=i.TIKTOK;break;case"lazada":e=i.LAZADA;break;case"kalCare":e=i.KALCARE;break;case"plugo":e=i.PLUGO;break}return e}static getChannelName(t){let e;switch(t){case s.Shopee:e="Shopee";break;case s.Tokopedia:e="Tokopedia";break;case s.Lazada:e="Lazada";break;case s.Tiktok:e="Tiktok";break;case s.WooCommerce:e="WooCommerce";break;case s.KalCare:e="KalCare";break;case s.Plugo:e="Plugo";break}return e}static assignChannelLogo(t){return t=t.map(e=>(e.logo=this.getChannelLogoByTypeId(e.TypeID),e)),t}static getCssChannelColor(t){let e;switch(t){case s.Shopee:e="#ee4d2d";break;case s.Tokopedia:e="var(--G500,#03AC0E)";break;case s.Lazada:e="#FF00B2";break;case s.Tiktok:e="black";break;case s.WooCommerce:e="#674399";break;case s.KalCare:e="rgb(128, 188, 0)";break;case s.Plugo:e="#F2A954";break}return e}static getDaysDiff(t,e){var a=e.getTime()-t.getTime(),r=a/(1e3*60*60*24);return r}static addDays(t,e){let a=new Date(Number(t));return a.setDate(t.getDate()-e),a}static isValidDate(t){return t instanceof Date&&!isNaN(t)}static getImageInfo(t){return new Promise((e,a)=>{let r=new Image;r.src=t,r.decode().then(()=>{e({img:t,height:r.height,width:r.width})}).catch(()=>{a(new Error(`Image load error for ${t}`))})})}static formatTitleFromDate(t,e){let a=null,r=new Date(t),c=new Date(e);return r.getDate()!=c.getDate()&&(a="dd"),r.getMonth()!=c.getMonth()&&(a="dd MMM"),r.getFullYear()!=c.getFullYear()&&(a="dd MMM yyyy"),a}static openDownloadFile(t,e){var a=window.URL.createObjectURL(t),r=document.createElement("a");r.href=a,r.download=e,r.click()}static compare(t,e,a){return(t<e?-1:1)*(a?1:-1)}static isDateExpired(t){let e=new Date,a=!1;return t.getTime()<e.getTime()&&(a=!0),a}static getLabelPathTree(t){let e=[],a=t;for(;a;)e.unshift(a.label),a=a.parent;return e.join(" / ")}static searchByIdWithParentDFS(t,e){let a=[...t],r;for(typeof e=="number"?r=JSON.stringify(e):r=e;a.length>0;){let c=a.pop();if(c.id===r)return c;if(c.children&&c.children.length>0)for(let n of c.children)n.parent=c,a.push(n)}return null}static getTimeDifference(t){let e=new Date(t),a=new Date,r=Math.abs(e.getTime()-a.getTime()),c=1e3,n=6e4,d=60*n,l=24*d,m=Math.floor(r/l),u=Math.floor(r%l/d),p=Math.floor(r%d/n),g=Math.floor(r%n/c);return{days:m,hours:u,minutes:p,seconds:g}}static convertToReadableDate(t){let{days:e,hours:a,minutes:r,seconds:c}=o.getTimeDifference(t),n="";return e>0&&a>0&&r>0&&(n=`${e} days, ${a} hours and ${r} minutes ago`),e>0&&a>0&&r==0&&(n=`${e} days and ${a} hours ago`),e>0&&a==0&&(n=`${e} days ago`),e==0&&a>0&&r>0&&(n=`${a} hours and ${r} minutes ago`),e==0&&a>0&&r==0&&(n=`${a} hours ago`),e==0&&a==0&&r>0&&(n=`${r} minutes ago`),e==0&&a==0&&r==0&&c>0&&(n=`${c} seconds ago`),n}static isValidGUID(t){return/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(t)}static convertTimestampToDate(t){if(!Number.isFinite(t))return new Date(t);let e=t<1e12?t*1e3:t;return new Date(e)}}return o})();export{i as a,s as b,D as c};
@@ -1 +0,0 @@
1
- import"./chunk-66YHNWRR.js";var o=[{path:"",loadComponent(){return import("./chunk-HP3XWVNT.js").then(t=>t.OrdersV2Component)},children:[{path:"to-ship",loadComponent(){return import("./chunk-PW2T7JJM.js").then(t=>t.ReadyToShipComponent)},title:"To Ship"},{path:"awaiting-collection",loadComponent(){return import("./chunk-G27ALLTY.js").then(t=>t.AwaitingCollectionComponent)},title:"Awaiting Collection"},{path:"shipped",loadComponent(){return import("./chunk-VXIVMTCD.js").then(t=>t.ShippedComponent)},title:"Shipped"},{path:"completed",loadComponent(){return import("./chunk-E2QYALEB.js").then(t=>t.CompletedComponent)},title:"Completed"},{path:"all",loadComponent(){return import("./chunk-WJLXIV7I.js").then(t=>t.AllComponent)},title:"All Orders"},{path:"cancelled",loadComponent(){return import("./chunk-KC6OLUBI.js").then(t=>t.CancelledComponent)},title:"Cancelled"},{path:"download",loadComponent(){return import("./chunk-MKR6QJ6R.js").then(t=>t.DownloadV2Component)},title:"Download"},{path:"log",loadComponent(){return import("./chunk-56I7OOXQ.js").then(t=>t.DownloadOrderLogComponent)},title:"Download Log"},{path:"",pathMatch:"full",redirectTo:"to-ship"}]}];export{o as routes};
@@ -1 +0,0 @@
1
- import{a as M}from"./chunk-RYW4LQLR.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as B}from"./chunk-LHT5E52E.js";import{a as Ve,b as Te}from"./chunk-MKVZZJMP.js";import{a as be,b as Fe}from"./chunk-ZEAT7ZWR.js";import"./chunk-FZDXTSZF.js";import{a as ye}from"./chunk-K7HUCVG7.js";import"./chunk-6ZQHMI2W.js";import"./chunk-CDNNFRZK.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YVLPJDF.js";import"./chunk-YOGRCIUI.js";import{a as ve}from"./chunk-FFM752SB.js";import"./chunk-SDUUFQUI.js";import"./chunk-JNXIAVS4.js";import"./chunk-PRVOIBMJ.js";import"./chunk-V27YSSV4.js";import{a as Ce,b as ue,d as fe,e as xe}from"./chunk-LIQRQYKZ.js";import"./chunk-T2QY5RTH.js";import"./chunk-PQZGUDGJ.js";import"./chunk-LLXJSB37.js";import{a as se,l as he}from"./chunk-YWRRGL7S.js";import{b as _e,e as me}from"./chunk-XMUA7ACY.js";import"./chunk-K5XRGNWG.js";import"./chunk-TGMCGROM.js";import"./chunk-WAGDS532.js";import{d as Se,l as Pe,m as Ie,n as we}from"./chunk-5SXUJ5XH.js";import"./chunk-3S7C3CCV.js";import"./chunk-PHCYCYXH.js";import{b as ie,c as oe,h as ae,m as re,o as le,y as ce}from"./chunk-5JWYKH72.js";import{c as pe}from"./chunk-PW42BQIY.js";import"./chunk-KESNVJB4.js";import{b as de,c as ge}from"./chunk-GQH7OSVY.js";import{d as X,g as Y,j as ee,m as D,n as te,q as ne}from"./chunk-UPA7TFVG.js";import{$c as V,Ec as H,Fb as z,Fc as d,G as W,Gc as R,Hc as b,Jc as I,Kc as w,Lb as h,Lc as y,Pc as J,Rc as F,Xb as p,Z as A,_c as v,ad as Z,bd as Q,cc as S,dc as N,ea as $,fc as k,gc as L,hc as a,ic as c,jc as P,kc as G,lc as q,nc as f,pa as j,pb as T,rb as l,sc as C,tc as r,wc as K,xb as u,ya as _,za as m}from"./chunk-VFLAHRB4.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var U=i=>[i],Re=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i}),Ue=i=>({"ms-10":i});function Oe(i,s){if(i&1&&(a(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let e=s.item;l(),p("src",e==null?null:e.Img,T),l(),b(" ",e.Name," ")}}function We(i,s){if(i&1){let e=f();a(0,"button",16),C("click",function(){_(e);let t=r().ngIf,o=r(2);return m(o.updateStock(t))}),P(1,"i",17),d(2," Update "),c()}}function Ae(i,s){if(i&1){let e=f();a(0,"actions")(1,"div",12),h(2,We,3,0,"button",13),a(3,"button",14),C("click",function(){_(e);let t=r(2);return m(t.openExportDialog())}),P(4,"i",15),a(5,"span"),d(6,"Export"),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(2),p("ngIf",n.productService.hasSelectionVariant(e))}}function $e(i,s){if(i&1){let e=f();a(0,"th")(1,"input",32),C("change",function(t){_(e);let o=r().ngIf,g=r(2);return m(g.onSelectAllSKU(t.target.checked,o))}),c()()}}function je(i,s){if(i&1){let e=f();a(0,"input",51),y("ngModelChange",function(t){_(e);let o=r(4).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),C("ngModelChange",function(){_(e);let t=r(4).$implicit,o=r(3);return m(o.onCheckboxStateProduct(t))}),c()}if(i&2){let e=r(4).$implicit;I("ngModel",e.selected)}}function ze(i,s){if(i&1&&h(0,je,1,1,"ng-template",26),i&2){let e=r(6);p("ngxPermissionsOnly",F(1,U,e.rolePriceEdit))}}function Ge(i,s){if(i&1){let e=f();G(0),a(1,"img",52),C("click",function(t){_(e);let o=r(3).$implicit,g=r(3);return m(g.onZoomImage(t,o==null?null:o.ImageUrl))}),c(),q()}if(i&2){let e=r(3).$implicit;l(),K("src",e.ThumbnailUrl,T)}}function qe(i,s){i&1&&P(0,"img",53)}function Ke(i,s){if(i&1&&(a(0,"small",50),d(1),c()),i&2){let e=r(3).$implicit;l(),b("(",e.Category,")")}}function He(i,s){if(i&1&&(a(0,"td",44)(1,"div",45),h(2,ze,1,3,null,26),a(3,"div",46),h(4,Ge,2,1,"ng-container",47)(5,qe,1,0,"ng-template",null,0,Q),c()()(),a(7,"td",48)(8,"span",49),d(9),c(),h(10,Ke,2,1,"small",50),c()),i&2){let e=H(6),n=r(2).$implicit;p("rowSpan",n.Variants.length),l(2),S((n.Variants==null?null:n.Variants.length)>1?2:-1),l(),p("ngClass",F(8,Ue,(n.Variants==null?null:n.Variants.length)<=1)),l(),p("ngIf",n.ThumbnailUrl)("ngIfElse",e),l(3),p("rowSpan",n.Variants.length),l(2),R(n.Name),l(),S(n.Category?10:-1)}}function Je(i,s){if(i&1){let e=f();a(0,"input",56),y("ngModelChange",function(t){_(e);let o=r(2).$implicit;return w(o.selected,t)||(o.selected=t),m(t)}),c()}if(i&2){let e=r(2).$implicit;I("ngModel",e.selected)}}function Ze(i,s){if(i&1&&(a(0,"td",54),h(1,Je,1,1,"input",55),c()),i&2){let e=r().$implicit;l(),S(e.UnitPrice>=0?1:-1)}}function Qe(i,s){i&1&&(a(0,"div",36),d(1," Not Found "),c())}function Xe(i,s){if(i&1&&(a(0,"div"),d(1),v(2,"number"),c()),i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.UnitPrice)," ")}}function Ye(i,s){if(i&1&&(a(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let e=r().$implicit,n=r(4);l(),p("href",n.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),T)}}function et(i,s){if(i&1){let e=f();a(0,"div",58),C("click",function(){_(e);let t=r().$implicit,o=r().$implicit,g=r(2).ngIf,x=r();return m(x.openTableDialog(t,o,g))}),d(1),v(2,"number"),c()}if(i&2){let e=r().$implicit;l(),b(" ",V(2,1,e.Channel[0]==null?null:e.Channel[0].Price)," ")}}function tt(i,s){if(i&1){let e=f();a(0,"tr",33),h(1,He,11,10),a(2,"td",24),d(3),c(),a(4,"td",27)(5,"span",34),d(6),c()(),h(7,Ze,2,1,"ng-template",26),a(8,"td",27)(9,"div",35),h(10,Qe,2,0,"div",36)(11,Xe,3,3,"div")(12,Ye,3,1,"div",37),c()(),a(13,"td",38)(14,"div",35),h(15,et,3,3,"div",39),a(16,"div",37)(17,"a",40),P(18,"i",41),c()(),a(19,"div",37)(20,"div",42),C("click",function(){let t=_(e).$implicit,o=r(4);return m(o.refreshPrice(t))}),P(21,"i",43),c()()()()()}if(i&2){let e=s.$implicit,n=s.$index,t=r(4);l(),S(n==0?1:-1),l(2),R(e.Model),l(2),p("matTooltip",e.Discontinued?t.discontinuedVariantMsg:"")("ngClass",F(12,Re,e.Discontinued)),l(),b(" ",e.Code," "),l(),p("ngxPermissionsOnly",F(14,U,t.rolePriceEdit)),l(3),S((e.Channel[0]==null?null:e.Channel[0].Description)!=null?10:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?11:-1),l(),S((e.Channel[0]==null?null:e.Channel[0].Description)==null?12:-1),l(),p("ngClass",F(16,Be,e.UnitPrice!=(e.Channel[0]==null?null:e.Channel[0].Price))),l(2),S(e.Channel.length>0?15:-1),l(2),p("href",e.Channel[0]==null?null:e.Channel[0].Url,T)}}function nt(i,s){if(i&1&&k(0,tt,22,18,"tr",33,N),i&2){let e=s.$implicit;L(e.Variants)}}function it(i,s){if(i&1){let e=f();a(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),a(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(t){_(e);let o=r(2);return w(o.toggleDifferentInventory,t)||(o.toggleDifferentInventory=t),m(t)}),C("toggleChange",function(){_(e);let t=r(2);return m(t.onToggleDifferentInventory())}),a(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),a(12,"th",24),d(13,"Variant"),c(),a(14,"th",25),d(15,"SKU"),c(),h(16,$e,2,0,"ng-template",26),a(17,"th",27),d(18,"POS"),c(),a(19,"th",27)(20,"div",28),C("click",function(){_(e);let t=r(2);return m(t.openModalFilter())}),P(21,"img",29),a(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),a(25,"tbody"),k(26,nt,2,0,null,null,N),c()(),a(28,"infinite-paginator",31),v(29,"async"),C("onNextPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){_(e);let t=r(2);return m(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){_(e);let t=r(2);return m(t.infinitePagination.getRowCount(t.searchFilter))}),c()()()()}if(i&2){let e=s.ngIf,n=r(2);l(9),I("ngModel",n.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",F(16,U,n.rolePriceEdit)),l(4),p("matTooltip",(n.selectedChannel==null||n.selectedChannel.Name==null?null:n.selectedChannel.Name.length)>=20?n.selectedChannel==null?null:n.selectedChannel.Name:""),l(),p("src",n.selectedChannel==null?null:n.selectedChannel.Img,T),l(2),b(" ",Z(24,11,n.selectedChannel==null?null:n.selectedChannel.Name,20)," "),l(3),L(e),l(2),p("totalData",n.infinitePagination.totalData())("hideCount",n.infinitePagination.hideCount())("rowCount",V(29,14,n.infinitePagination.totalRowCount$))("pageNumber",n.infinitePagination.pageNumber())("disableNextButton",n.infinitePagination.disableNextButton())("goToLastPage",n.infinitePagination.isLastPage())}}function ot(i,s){if(i&1){let e=f();a(0,"mainpanel",2),y("textChange",function(t){_(e);let o=r();return w(o.searchFilter.text,t)||(o.searchFilter.text=t),m(t)}),C("onSubmit",function(){_(e);let t=r();return m(t.onSearch())}),a(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),a(5,"ng-select",4),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.ChannelID,t)||(o.searchFilter.ChannelID=t),m(t)}),h(6,Oe,3,2,"ng-template",5),c()(),a(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),a(10,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.PageNumber,t)||(o.searchFilter.PageNumber=t),m(t)}),c()(),a(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),a(14,"input",8),y("ngModelChange",function(t){_(e);let o=r();return w(o.searchFilter.RowCount,t)||(o.searchFilter.RowCount=t),m(t)}),c()()(),h(15,Ae,7,1,"actions",9),v(16,"async"),h(17,it,30,18,"content",9),v(18,"async"),c()}if(i&2){let e=r();p("headerTitle",e.pageTitle),I("text",e.searchFilter.text),l(5),p("clearable",!1)("items",e.channelOptions),I("ngModel",e.searchFilter.ChannelID),l(5),I("ngModel",e.searchFilter.PageNumber),l(4),I("ngModel",e.searchFilter.RowCount),l(),p("ngIf",V(16,9,e.data$)),l(2),p("ngIf",V(18,11,e.data$))}}var At=(()=>{class i{constructor(e,n,t,o,g,x,O,Ne,ke,Le){this.http=e,this.toastr=n,this.dialog=t,this.productService=o,this.biggerPictureService=g,this.inventoryService=x,this.authService=O,this.mainPanelService=Ne,this.exportService=ke,this.decimalPipe=Le,this.infinitePagination=j(B),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=se.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe(A(1)),this.channelOptions=O.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe($(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=E.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=E.ALL:this.searchFilter.filterModel=E.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let t=this.productService.selectedVariantProduct(e).map(g=>({ID:g.ID,ChannelID:g.Channel[0].ChannelID,Code:g.Code,Price:g.UnitPrice})),o={ListChannelID:[this.searchFilter.ChannelID],ListPrice:t};this.http.post("/api/Price/UpdateChannel",o).subscribe(g=>{this.onSearch(),this.handlingUpdateStock(g.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,t=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",t,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(t=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,t){let o=JSON.parse(JSON.stringify(e));this.dialog.open(De,{data:{Name:n.Name,Variant:o,ChannelID:o?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:o?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(W(x=>pe.IsNotEmpty(x))).subscribe(x=>{this.updateItemAfterDialog(x,e)})}updateItemAfterDialog(e,n){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(o=>{let g=this.productService.findChannelById(t.ID,this.channelOptions),x=t.Price?this.decimalPipe.transform(t.Price):t.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${g.Name} to ${x}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=t.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(t=>(t.Variants=t.Variants.map(o=>(o.selected=e,o)),t))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Te,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(u(me),u(_e),u(Se),u(ye),u(ve),u(M),u(he),u(Pe),u(Ve),u(D))}}static{this.\u0275cmp=z({type:i,selectors:[["app-price-single-channel"]],features:[J([B,M,ne("https://res.cloudinary.com/"),D])],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,t){n&1&&(h(0,ot,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",V(1,1,t.loader$))},dependencies:[te,X,Y,ee,D,we,Ie,xe,fe,Ce,ue,ce,oe,le,ie,ae,re,Ee,Me,ge,de,Fe,be],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0})}}return i})();export{At as PriceSingleChannelComponent};