marketplacepos 5.38.2 → 5.38.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 (166) hide show
  1. package/Marketplace/3rdpartylicenses.txt +8 -8
  2. package/Marketplace/{chunk-TCRZNHID.js → chunk-3LQNSF7T.js} +1 -1
  3. package/Marketplace/chunk-3NDNZO2L.js +2 -0
  4. package/Marketplace/{chunk-BTW46HYC.js → chunk-3PJZW7HF.js} +2 -2
  5. package/Marketplace/{chunk-FMXSAVJ5.js → chunk-3SDQ2PXY.js} +1 -1
  6. package/Marketplace/chunk-4AOCYXXV.js +1 -0
  7. package/Marketplace/chunk-4ASUM4N5.js +1 -0
  8. package/Marketplace/chunk-4FI4YSVV.js +8 -0
  9. package/Marketplace/{chunk-YNZOWISG.js → chunk-5MRT2EFE.js} +1 -1
  10. package/Marketplace/{chunk-LHKT5TT3.js → chunk-5RI4KPF6.js} +2 -2
  11. package/Marketplace/chunk-5XVUQWLZ.js +2 -0
  12. package/Marketplace/{chunk-LWDDTE3V.js → chunk-62PFQNHJ.js} +1 -1
  13. package/Marketplace/chunk-662ELWF5.js +1 -0
  14. package/Marketplace/chunk-6ALHX2I4.js +1 -0
  15. package/Marketplace/{chunk-LIQRQYKZ.js → chunk-6IAGGRZN.js} +1 -1
  16. package/Marketplace/{chunk-4BKQVHMV.js → chunk-7477X7LJ.js} +1 -1
  17. package/Marketplace/{chunk-ACIMXBIC.js → chunk-77IUCPIQ.js} +1 -1
  18. package/Marketplace/chunk-7CDZNNWL.js +1 -0
  19. package/Marketplace/chunk-7POQ3C3K.js +1 -0
  20. package/Marketplace/{chunk-FZDXTSZF.js → chunk-7TWBIV3T.js} +1 -1
  21. package/Marketplace/chunk-AHACTT37.js +1 -0
  22. package/Marketplace/{chunk-67IT7XVS.js → chunk-AL3REAHH.js} +1 -1
  23. package/Marketplace/chunk-AVI5X2TT.js +1 -0
  24. package/Marketplace/chunk-B5LX5TOF.js +1 -0
  25. package/Marketplace/{chunk-XMUA7ACY.js → chunk-BUFEIJAI.js} +1 -1
  26. package/Marketplace/{chunk-V6IICLFE.js → chunk-CBHXQUMA.js} +1 -1
  27. package/Marketplace/{chunk-4YVLPJDF.js → chunk-CH2MLZU7.js} +1 -1
  28. package/Marketplace/{chunk-3SYZKYR6.js → chunk-CLKCSTGQ.js} +1 -1
  29. package/Marketplace/{chunk-THCM5TEN.js → chunk-COBHWPGI.js} +1 -1
  30. package/Marketplace/{chunk-I5QRFRRD.js → chunk-CRC6ZWYT.js} +1 -1
  31. package/Marketplace/{chunk-S4HBPSOW.js → chunk-CVQMAWML.js} +1 -1
  32. package/Marketplace/chunk-CZUJNA5G.js +1 -0
  33. package/Marketplace/{chunk-CHBBBCQU.js → chunk-DP3Z5OLA.js} +1 -1
  34. package/Marketplace/{chunk-5JWYKH72.js → chunk-DPLEMBB4.js} +1 -1
  35. package/Marketplace/{chunk-DWDTKK42.js → chunk-E6HA2AGS.js} +1 -1
  36. package/Marketplace/{chunk-K7HUCVG7.js → chunk-EGTYAIU5.js} +1 -1
  37. package/Marketplace/{chunk-ZX5YQUYQ.js → chunk-F7NU25EB.js} +1 -1
  38. package/Marketplace/{chunk-JNXIAVS4.js → chunk-G6EG5QJS.js} +1 -1
  39. package/Marketplace/{chunk-JAC62SW3.js → chunk-G6T2QL55.js} +1 -1
  40. package/Marketplace/{chunk-634DNHPF.js → chunk-GBABJLPQ.js} +1 -1
  41. package/Marketplace/{chunk-HPX77FXZ.js → chunk-GBD4FIF3.js} +1 -1
  42. package/Marketplace/{chunk-MFZLTVCS.js → chunk-GHQH62TZ.js} +1 -1
  43. package/Marketplace/chunk-GPEVUTDI.js +2 -0
  44. package/Marketplace/chunk-H55YXRO5.js +1 -0
  45. package/Marketplace/chunk-HAUNYMEG.js +5 -0
  46. package/Marketplace/chunk-HLBD2ZRF.js +2 -0
  47. package/Marketplace/chunk-IIJMZKPL.js +1 -0
  48. package/Marketplace/{chunk-5SXUJ5XH.js → chunk-ITTRZMEX.js} +4 -4
  49. package/Marketplace/{chunk-2UZPOENK.js → chunk-IYYVZ6B6.js} +1 -1
  50. package/Marketplace/{chunk-RTUTYVTE.js → chunk-J3P46Z53.js} +1 -1
  51. package/Marketplace/chunk-JIBVE3DE.js +1 -0
  52. package/Marketplace/chunk-JTZJTXCN.js +1 -0
  53. package/Marketplace/chunk-K2H6WANG.js +1 -0
  54. package/Marketplace/{chunk-SG52OFBZ.js → chunk-K5ZBGZ47.js} +1 -1
  55. package/Marketplace/{chunk-WAGDS532.js → chunk-KHWTOD6H.js} +1 -1
  56. package/Marketplace/{chunk-RXP4QJHL.js → chunk-KVKFKGDQ.js} +1 -1
  57. package/Marketplace/{chunk-PQZGUDGJ.js → chunk-KXZCGKQW.js} +1 -1
  58. package/Marketplace/{chunk-EAU6FVQT.js → chunk-LEHTNMIE.js} +1 -1
  59. package/Marketplace/{chunk-IPYYFOPE.js → chunk-LLZSSV5A.js} +1 -1
  60. package/Marketplace/{chunk-SZ22GHDY.js → chunk-LOJPRXKZ.js} +1 -1
  61. package/Marketplace/chunk-LRHLOGXM.js +1 -0
  62. package/Marketplace/{chunk-NB5JKHKF.js → chunk-MNFHFW3E.js} +1 -1
  63. package/Marketplace/chunk-NEXCPJGQ.js +1 -0
  64. package/Marketplace/{chunk-KP7SEM5B.js → chunk-OAS72QB2.js} +1 -1
  65. package/Marketplace/{chunk-HCZDLZLY.js → chunk-OE2JYQHN.js} +1 -1
  66. package/Marketplace/chunk-OJVDCT5U.js +2 -0
  67. package/Marketplace/{chunk-I44JKLRE.js → chunk-OLSC6KHB.js} +1 -1
  68. package/Marketplace/chunk-OOJNZDBG.js +1 -0
  69. package/Marketplace/chunk-PG3IYBPX.js +1 -0
  70. package/Marketplace/{chunk-GJLXEA4Q.js → chunk-PPDHTO44.js} +1 -1
  71. package/Marketplace/chunk-PUJ4JVT2.js +4 -0
  72. package/Marketplace/chunk-PXB4YEY3.js +1 -0
  73. package/Marketplace/{chunk-7Q6UDUDK.js → chunk-PXU3DWYL.js} +1 -1
  74. package/Marketplace/chunk-PZTMYAA7.js +1 -0
  75. package/Marketplace/{chunk-V27YSSV4.js → chunk-Q2OEJFVT.js} +1 -1
  76. package/Marketplace/{chunk-ZUFLZMHT.js → chunk-Q72ZXPDP.js} +1 -1
  77. package/Marketplace/{chunk-LLXJSB37.js → chunk-QCZIDOKW.js} +1 -1
  78. package/Marketplace/{chunk-NQV7LHIV.js → chunk-RGR34QZ3.js} +1 -1
  79. package/Marketplace/{chunk-PRVOIBMJ.js → chunk-RIHLYYZU.js} +1 -1
  80. package/Marketplace/{chunk-APOFECEW.js → chunk-RVYGL22E.js} +1 -1
  81. package/Marketplace/chunk-S6WP72HC.js +1 -0
  82. package/Marketplace/chunk-T5ONJF63.js +7 -0
  83. package/Marketplace/chunk-T6QOFDEE.js +1 -0
  84. package/Marketplace/{chunk-ELDNUVIH.js → chunk-TB6SAKPJ.js} +1 -1
  85. package/Marketplace/{chunk-3S7C3CCV.js → chunk-TMFFA26Y.js} +1 -1
  86. package/Marketplace/chunk-TZXF4K2V.js +1 -0
  87. package/Marketplace/{chunk-HSHDGVNA.js → chunk-UBMI3NQH.js} +1 -1
  88. package/Marketplace/{chunk-IZCEOKBE.js → chunk-UDOCTVWA.js} +1 -1
  89. package/Marketplace/chunk-UIM3W5B7.js +1 -0
  90. package/Marketplace/{chunk-CDAB4RAT.js → chunk-UPZ35RUO.js} +1 -1
  91. package/Marketplace/{chunk-TGMCGROM.js → chunk-V5WYSCVT.js} +1 -1
  92. package/Marketplace/{chunk-FFM752SB.js → chunk-VGXQU74M.js} +1 -1
  93. package/Marketplace/chunk-VOXQUD5E.js +1 -0
  94. package/Marketplace/chunk-VSJIQ3SX.js +1 -0
  95. package/Marketplace/chunk-W3X2KRUQ.js +1 -0
  96. package/Marketplace/{chunk-PHCYCYXH.js → chunk-WAW37FIG.js} +1 -1
  97. package/Marketplace/chunk-WFEOCQ7B.js +1 -0
  98. package/Marketplace/{chunk-IQEG7SF6.js → chunk-XFCMKJV6.js} +1 -1
  99. package/Marketplace/chunk-XYZPGDD2.js +5 -0
  100. package/Marketplace/chunk-YIUQQGOQ.js +1 -0
  101. package/Marketplace/{chunk-ZEAT7ZWR.js → chunk-YXFTLQ5M.js} +1 -1
  102. package/Marketplace/chunk-Z3KIQHIK.js +1 -0
  103. package/Marketplace/{chunk-CXIBIPS5.js → chunk-ZD5LURJS.js} +1 -1
  104. package/Marketplace/chunk-ZHN24KZM.js +1 -0
  105. package/Marketplace/{chunk-3FCJ4HSW.js → chunk-ZS3HQV2S.js} +1 -1
  106. package/Marketplace/{chunk-UX7JCPZZ.js → chunk-ZYWCWZDR.js} +1 -1
  107. package/Marketplace/{chunk-YOGRCIUI.js → chunk-ZZVNB72Q.js} +1 -1
  108. package/Marketplace/index.html +2 -2
  109. package/Marketplace/main-TARO2A2O.js +1 -0
  110. package/Marketplace/{styles-FQFG5OHY.css → styles-6IZYQNTO.css} +1 -1
  111. package/package.json +1 -1
  112. package/Marketplace/chunk-2FSWKVW2.js +0 -5
  113. package/Marketplace/chunk-2WX4KRTS.js +0 -1
  114. package/Marketplace/chunk-3H6MA53M.js +0 -1
  115. package/Marketplace/chunk-66YHNWRR.js +0 -1
  116. package/Marketplace/chunk-6BGGLLB3.js +0 -1
  117. package/Marketplace/chunk-7SLPBFFW.js +0 -1
  118. package/Marketplace/chunk-AHLRE6UG.js +0 -1
  119. package/Marketplace/chunk-B2EMWVNF.js +0 -1
  120. package/Marketplace/chunk-BLEP5X4N.js +0 -1
  121. package/Marketplace/chunk-CDNNFRZK.js +0 -1
  122. package/Marketplace/chunk-D7HXHNZ2.js +0 -1
  123. package/Marketplace/chunk-E7PTAPC2.js +0 -1
  124. package/Marketplace/chunk-ECT4LXWX.js +0 -1
  125. package/Marketplace/chunk-EU2KAMEK.js +0 -1
  126. package/Marketplace/chunk-F7GZCBBK.js +0 -1
  127. package/Marketplace/chunk-FDTSK7U4.js +0 -1
  128. package/Marketplace/chunk-FZZFKUA6.js +0 -1
  129. package/Marketplace/chunk-GCECFUOP.js +0 -1
  130. package/Marketplace/chunk-GJ35EMJI.js +0 -1
  131. package/Marketplace/chunk-GQH7OSVY.js +0 -1
  132. package/Marketplace/chunk-HP3XWVNT.js +0 -1
  133. package/Marketplace/chunk-IFLSHEST.js +0 -1
  134. package/Marketplace/chunk-ISBNY3BW.js +0 -1
  135. package/Marketplace/chunk-IURGBAYA.js +0 -1
  136. package/Marketplace/chunk-KEJE3NY3.js +0 -2
  137. package/Marketplace/chunk-KESNVJB4.js +0 -1
  138. package/Marketplace/chunk-KFBOPHX3.js +0 -1
  139. package/Marketplace/chunk-KLK56V5W.js +0 -5
  140. package/Marketplace/chunk-L532YTS3.js +0 -1
  141. package/Marketplace/chunk-LWGJZHI6.js +0 -1
  142. package/Marketplace/chunk-LXSQIECO.js +0 -1
  143. package/Marketplace/chunk-N5FUA6YZ.js +0 -8
  144. package/Marketplace/chunk-N5J4Q6XU.js +0 -1
  145. package/Marketplace/chunk-NLMYFEYT.js +0 -1
  146. package/Marketplace/chunk-ODYALJ4L.js +0 -1
  147. package/Marketplace/chunk-OQ6GAJZC.js +0 -1
  148. package/Marketplace/chunk-OQCIFQ6E.js +0 -1
  149. package/Marketplace/chunk-PW42BQIY.js +0 -1
  150. package/Marketplace/chunk-RH3MWQCS.js +0 -1
  151. package/Marketplace/chunk-RP5BC3NS.js +0 -1
  152. package/Marketplace/chunk-S6JH7OX2.js +0 -1
  153. package/Marketplace/chunk-SNSUFM3F.js +0 -1
  154. package/Marketplace/chunk-T2QY5RTH.js +0 -1
  155. package/Marketplace/chunk-TO3EP6I2.js +0 -1
  156. package/Marketplace/chunk-U5FRJVIW.js +0 -2
  157. package/Marketplace/chunk-UPA7TFVG.js +0 -2
  158. package/Marketplace/chunk-VFLAHRB4.js +0 -7
  159. package/Marketplace/chunk-VHIGKLLN.js +0 -5
  160. package/Marketplace/chunk-VQIOJJQU.js +0 -1
  161. package/Marketplace/chunk-WLZKVYHT.js +0 -1
  162. package/Marketplace/chunk-YZTAHFSS.js +0 -1
  163. package/Marketplace/chunk-ZBQYXB3O.js +0 -1
  164. package/Marketplace/chunk-ZJ33U67R.js +0 -1
  165. package/Marketplace/chunk-ZNZULA6U.js +0 -1
  166. package/Marketplace/main-NTODVC3B.js +0 -1
@@ -1,8 +0,0 @@
1
- import{a as Ce,b as be,c as We}from"./chunk-CHBBBCQU.js";import{a as Re}from"./chunk-IFLSHEST.js";import"./chunk-FMXSAVJ5.js";import{a as Ke}from"./chunk-BVIRHZTZ.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 Pt}from"./chunk-TCRZNHID.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-VHIGKLLN.js";import"./chunk-ACIMXBIC.js";import"./chunk-IZCEOKBE.js";import{b as Rt}from"./chunk-I44JKLRE.js";import"./chunk-HPX77FXZ.js";import{a as oe,b as gt}from"./chunk-THCM5TEN.js";import{a as Nt}from"./chunk-IPYYFOPE.js";import{i as vt,j as bt,k as Tt,l as Dt,m as Et}from"./chunk-I5QRFRRD.js";import"./chunk-FZDXTSZF.js";import{a as wt}from"./chunk-K7HUCVG7.js";import"./chunk-SZ22GHDY.js";import"./chunk-CDNNFRZK.js";import"./chunk-3RK6DDJD.js";import{a as $}from"./chunk-HSHDGVNA.js";import{b as It}from"./chunk-S4HBPSOW.js";import{b as xt}from"./chunk-EAU6FVQT.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-ZX5YQUYQ.js";import"./chunk-ZUFLZMHT.js";import"./chunk-NB5JKHKF.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{g as me,j as q}from"./chunk-BTW46HYC.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(Pt,{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(wt),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,vt,bt,Tt,Dt,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-KLK56V5W.js").then(n=>n.DownloadV2Component)},canActivate:[ne],data:{title:"Download"}},{path:"Download_Order_Log",loadComponent:()=>import("./chunk-AHLRE6UG.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,It,ke,mt,Et,Nt,$,At,dt,gt,Rt,ct,xt,ht,J,Ge,We,yt]})}}return n})();export{Kr as OrdersModule};
@@ -1 +0,0 @@
1
- import{a as X}from"./chunk-LWGJZHI6.js";import{a as Q}from"./chunk-KP7SEM5B.js";import{c as Y,d as D}from"./chunk-OQCIFQ6E.js";import"./chunk-BVIRHZTZ.js";import{b as K}from"./chunk-TCRZNHID.js";import"./chunk-ZEAT7ZWR.js";import"./chunk-I44JKLRE.js";import"./chunk-FZDXTSZF.js";import{a as J}from"./chunk-K7HUCVG7.js";import"./chunk-SZ22GHDY.js";import"./chunk-CDNNFRZK.js";import"./chunk-3RK6DDJD.js";import"./chunk-4YVLPJDF.js";import"./chunk-YOGRCIUI.js";import"./chunk-FFM752SB.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{j as $}from"./chunk-BTW46HYC.js";import{b as G,e as W}from"./chunk-XMUA7ACY.js";import"./chunk-K5XRGNWG.js";import"./chunk-TGMCGROM.js";import"./chunk-WAGDS532.js";import{d as H,m as q,n as z}from"./chunk-5SXUJ5XH.js";import"./chunk-3S7C3CCV.js";import"./chunk-PHCYCYXH.js";import{c as B,h as O,m as U,o as j,y as k}from"./chunk-5JWYKH72.js";import"./chunk-PW42BQIY.js";import"./chunk-KESNVJB4.js";import"./chunk-GQH7OSVY.js";import{g as R,j as L,m as x,n as A}from"./chunk-UPA7TFVG.js";import{$c as C,Fb as N,Fc as g,G as V,Jc as S,Kc as v,Lb as f,Lc as y,Pc as E,Xb as u,Z as T,_c as _,ea as F,hc as a,ic as p,jc as I,nc as b,pa as M,rb as d,sc as P,tc as o,xb as h,ya as s,za as l}from"./chunk-VFLAHRB4.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";function Z(r,w){if(r&1){let e=b();a(0,"button",15),P("click",function(){s(e);let t=o().ngIf,n=o(2);return l(n.onUpdateItems(t))}),I(1,"i",16),g(2," Update "),p()}}function ee(r,w){if(r&1&&(a(0,"div"),f(1,Z,3,0,"button",14),p()),r&2){let e=w.ngIf,i=o(2);d(),u("ngIf",i.productService.hasSelectionVariant(e))}}function te(r,w){if(r&1){let e=b();a(0,"mainpanel",1),P("onSubmit",function(t){s(e);let n=o();return l(n.onSearch(t))}),a(1,"actions")(2,"div",2),f(3,ee,2,1,"div",3),_(4,"async"),a(5,"button",4),P("click",function(){s(e);let t=o();return l(t.openExportDialog())}),I(6,"i",5),a(7,"span"),g(8,"Export"),p()()()(),a(9,"filters")(10,"div")(11,"label",6),g(12,"Page Number"),p(),a(13,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.PageNumber,t)||(n.searchFilter.PageNumber=t),l(t)}),p()(),a(14,"div",8)(15,"label",6),g(16,"Page Size"),p(),a(17,"input",7),y("ngModelChange",function(t){s(e);let n=o();return v(n.searchFilter.RowCount,t)||(n.searchFilter.RowCount=t),l(t)}),p()()(),a(18,"content")(19,"div",9)(20,"div",10)(21,"div",11)(22,"app-table",12),_(23,"async"),P("onToggle",function(t){s(e);let n=o();return l(n.onShowDifferencePrice(t))})("onSubmit",function(t){s(e);let n=o();return l(n.updatePriceByVariant(t))}),p(),a(24,"infinite-paginator",13),_(25,"async"),P("onNextPage",function(){s(e);let t=o();return l(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){s(e);let t=o();return l(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){s(e);let t=o();return l(t.infinitePagination.getRowCount(t.searchFilter))}),p()()()()()()}if(r&2){let e=o();u("textButton","Search"),d(3),u("ngIf",C(4,14,e.data$)),d(10),S("ngModel",e.searchFilter.PageNumber),d(4),S("ngModel",e.searchFilter.RowCount),d(5),u("showProductToggle",!0)("data",C(23,16,e.data$))("channel",e.channelOptions)("hiddenIPOSInventory",!1),d(2),u("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",C(25,18,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}var be=(()=>{class r{constructor(e,i,t,n,m,c){this.http=e,this.toastr=i,this.dialog=t,this.productService=n,this.authService=m,this.decimalPipe=c,this.infinitePagination=M(D),this.loaderAPI="PriceLoader/LoadMultiple",this.getDataAPI="Price/GetMultipleChannelComparison",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.data$=this.infinitePagination.data$.pipe(T()),this.pageData={Title:"Price",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!0},{Title:"Price Realtime",Url:"/menu/price/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.getDataAPI,this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.loader$=this.http.post(`/api/${this.loaderAPI}`).pipe(F(e=>{e.Filter={PageNumber:e.Filter.PageNumber,RowCount:e.Filter.RowCount,filterModel:1},this.searchFilter=e.Filter,this.infinitePagination.reloadPagination(this.searchFilter)}))}onShowDifferencePrice(e){this.searchFilter.filterModel=1,e&&(this.searchFilter.filterModel=3),this.infinitePagination.reloadPagination(this.searchFilter)}onSearch(e){this.searchFilter.text=e,this.infinitePagination.reloadPagination(this.searchFilter)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let n=i.map(c=>({ID:c.ID,Code:c.Code,Price:c.UnitPrice}));var t=this.channelOptions.filter(c=>c.selected).map(c=>c.ID);let m={ListChannelID:t,ListPrice:n};this.http.post("/api/Price/UpdateChannel",m).subscribe(c=>{this.infinitePagination.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+m.ListPrice.length+" items in "+m.ListChannelID.length+" channels","Success")})}}updatePriceByVariant(e){let i={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:e.Price-0,VariantID:e.ID};this.http.post("/api/Price/UpdatePriceByID",i).subscribe(t=>{let n=this.productService.findChannelById(i.ID,this.channelOptions),m=i.Price?this.decimalPipe.transform(i.Price):i.Price;this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") price in "+n.Name+" to "+m,"Success"),this.infinitePagination.reloadPagination(this.searchFilter)})}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Q,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(V(t=>t!==void 0)).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openExportDialog(){this.dialog.open(K,{data:{title:"Export Multi Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportMultipleChannelComparison"}}).afterClosed().subscribe()}static{this.\u0275fac=function(i){return new(i||r)(h(W),h(G),h(H),h(J),h($),h(x))}}static{this.\u0275cmp=N({type:r,selectors:[["app-price-pos-channel"]],features:[E([D,x])],decls:2,vars:3,consts:[["headerTitle","Price Comparison",3,"textButton","onSubmit",4,"ngIf"],["headerTitle","Price Comparison",3,"onSubmit","textButton"],[1,"d-flex"],[4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["productToggleTitle","FILTER DIFFERENT PRICE","table","price",3,"onToggle","onSubmit","showProductToggle","data","channel","hiddenIPOSInventory"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"]],template:function(i,t){i&1&&(f(0,te,26,20,"mainpanel",0),_(1,"async")),i&2&&u("ngIf",C(1,1,t.loader$))},dependencies:[A,R,L,k,B,j,O,U,Y,z,q,X],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]})}}return r})();export{be as PricePosChannelComponent};
@@ -1 +0,0 @@
1
- import{a as ke}from"./chunk-SG52OFBZ.js";import{a as De}from"./chunk-KP7SEM5B.js";import{a as W}from"./chunk-XHAXYWZ7.js";import{a as Oe,b as Ve,c as Ne,d as J}from"./chunk-OQCIFQ6E.js";import{a as ue}from"./chunk-BVIRHZTZ.js";import{a as Te}from"./chunk-GJLXEA4Q.js";import{a as we}from"./chunk-7KG3DC5J.js";import{b as Ee}from"./chunk-TCRZNHID.js";import"./chunk-ZEAT7ZWR.js";import"./chunk-I44JKLRE.js";import"./chunk-FZDXTSZF.js";import{a as Fe}from"./chunk-K7HUCVG7.js";import"./chunk-SZ22GHDY.js";import"./chunk-CDNNFRZK.js";import"./chunk-3RK6DDJD.js";import{a as ve,b as Ie,c as ye}from"./chunk-MFZLTVCS.js";import"./chunk-4YVLPJDF.js";import"./chunk-YOGRCIUI.js";import{a as Me}from"./chunk-FFM752SB.js";import"./chunk-SDUUFQUI.js";import"./chunk-JNXIAVS4.js";import"./chunk-PRVOIBMJ.js";import"./chunk-V27YSSV4.js";import"./chunk-LIQRQYKZ.js";import"./chunk-T2QY5RTH.js";import"./chunk-PQZGUDGJ.js";import"./chunk-LLXJSB37.js";import{j as xe}from"./chunk-BTW46HYC.js";import{b as he,e as ge}from"./chunk-XMUA7ACY.js";import"./chunk-K5XRGNWG.js";import"./chunk-TGMCGROM.js";import"./chunk-WAGDS532.js";import{d as Pe,m as be,n as Se}from"./chunk-5SXUJ5XH.js";import{r as A,s as j}from"./chunk-3S7C3CCV.js";import"./chunk-PHCYCYXH.js";import{b as _e,h as R,m as L,y as $}from"./chunk-5JWYKH72.js";import{c as U}from"./chunk-PW42BQIY.js";import"./chunk-KESNVJB4.js";import{b as Ce,c as fe}from"./chunk-GQH7OSVY.js";import{d as se,f as k,g as me,j as pe,m as de,n as B}from"./chunk-UPA7TFVG.js";import{$c as y,Ec as z,Fb as N,Fc as p,G as K,Gc as re,Hc as f,Jc as D,Ka as ee,Kc as O,Lb as u,Lc as V,Pc as ae,Ra as te,Rc as w,Sc as le,Xb as s,Z as G,_b as ne,_c as b,ad as ce,bd as H,cc as ie,dc as M,ea as Y,fc as E,gc as T,hc as o,ic as a,jc as P,kc as S,lc as v,nc as I,pa as Q,pb as F,rb as r,sc as h,tc as m,v as q,wc as oe,xb as x,ya as g,za as C}from"./chunk-VFLAHRB4.js";import"./chunk-EU2KAMEK.js";import{a as X,b as Z}from"./chunk-66YHNWRR.js";var We=(n,c)=>({color:n,"font-weight":c});function Ke(n,c){if(n&1&&(o(0,"mat-radio-button",2),p(1),a()),n&2){let e=c.$implicit,i=c.index,t=m();ne(le(7,We,t.model==e.Key&&t.activeBold?"#0976b4":"",t.model==e.Key&&t.activeBold?"700":"")),s("disabled",t.exception==e.Value)("matTooltip",t.title.length>0?t.title[i]:"")("value",e.Key)("name",t.name),r(),f("",e.Value," ")}}var Be=(()=>{class n{constructor(){this.disabled=!1,this.modelChange=new ee,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(e){this.modelChange.emit(e)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=N({type:n,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(i,t){i&1&&(o(0,"mat-radio-group",0),h("ngModelChange",function(d){return t.change(d)}),u(1,Ke,2,10,"mat-radio-button",1),a()),i&2&&(s("disabled",t.disabled)("ngModel",t.model),r(),s("ngForOf",t.options))},dependencies:[B,k,ye,ve,Ie,$,R,L,j,A],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px}html[_ngcontent-%COMP%]{--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]})}}return n})();var Re=n=>[n],Ge=n=>({"text-decoration-line-through":n}),ze=n=>({"border-bottom":n}),He=n=>({"bg-gradient-warning":n});function Je(n,c){if(n&1){let e=I();S(0),o(1,"div")(2,"label",21),p(3,"Channel"),a(),o(4,"channel-select-options",22),V("ngModelChange",function(t){g(e);let l=m();return O(l.searchFilter.ListChannelID,t)||(l.searchFilter.ListChannelID=t),C(t)}),a()(),o(5,"div",23)(6,"label",24),p(7,"Filter by"),a(),o(8,"lib-radio-options",25),V("modelChange",function(t){g(e);let l=m();return O(l.searchFilter.filterModel,t)||(l.searchFilter.filterModel=t),C(t)}),a()(),v()}if(n&2){let e=m();r(4),s("multiple",!0),D("ngModel",e.searchFilter.ListChannelID),r(4),D("model",e.searchFilter.filterModel),s("options",e.filterTypeOptions)}}function Xe(n,c){if(n&1){let e=I();o(0,"button",27),h("click",function(){g(e);let t=m().ngIf,l=m();return C(l.onUpdateItems(t))}),P(1,"i",28),p(2," Update "),a()}}function Ze(n,c){if(n&1&&(S(0),o(1,"div",4),u(2,Xe,3,0,"button",26),a(),v()),n&2){let e=c.ngIf,i=m();r(2),s("ngIf",i.productService.hasSelectionVariant(e))}}function qe(n,c){if(n&1&&(o(0,"th",15)(1,"div",29),P(2,"img",30),o(3,"div",31),p(4),b(5,"stringLimit"),a()()()),n&2){let e=c.$implicit;r(),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,F),r(2),f(" ",ce(5,3,e.Name,20)," ")}}function Ye(n,c){if(n&1){let e=I();o(0,"th")(1,"input",32),V("ngModelChange",function(t){g(e);let l=m();return O(l.checkboxState,t)||(l.checkboxState=t),C(t)}),h("ngModelChange",function(){g(e);let t=m();return C(t.onSelectAllData())}),a()()}if(n&2){let e=m();r(),D("ngModel",e.checkboxState)}}function Qe(n,c){n&1&&(o(0,"th",33)(1,"span"),p(2,"Expected"),a(),o(3,"span",34),p(4,"(POS)"),a()(),o(5,"th",33),p(6,"Channel"),a())}function et(n,c){if(n&1){let e=I();o(0,"img",47),h("click",function(t){g(e);let l=m(3).$implicit,d=m(2);return C(d.onZoomImage(t,l==null?null:l.ImageUrl))}),a()}if(n&2){let e=m(3).$implicit;oe("src",e==null?null:e.ImageUrl,F)}}function tt(n,c){n&1&&P(0,"img",48)}function nt(n,c){if(n&1&&(o(0,"small",46),p(1),a()),n&2){let e=m(3).$implicit;r(),f("(",e==null?null:e.Category,")")}}function it(n,c){if(n&1&&(S(0),o(1,"td",42),u(2,et,1,1,"img",43)(3,tt,1,0,"ng-template",null,0,H),a(),o(5,"td",44)(6,"h5",45),p(7),a(),u(8,nt,2,1,"small",46),a(),v()),n&2){let e=z(4),i=m().$index,t=m().$implicit,l=m().ngIf;r(),s("rowSpan",t==null?null:t.Variants.length)("ngClass",w(7,ze,i+1==l.length)),r(),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",e),r(3),s("rowSpan",t==null?null:t.Variants.length),r(2),re(t==null?null:t.Name),r(),ie(t!=null&&t.Category?8:-1)}}function ot(n,c){if(n&1){let e=I();o(0,"td",49)(1,"input",32),V("ngModelChange",function(t){g(e);let l=m().$implicit;return O(l.selected,t)||(l.selected=t),C(t)}),a()()}if(n&2){let e=m().$implicit;r(),D("ngModel",e.selected)}}function rt(n,c){if(n&1){let e=I();S(0),o(1,"td",51),p(2),b(3,"number"),a(),o(4,"td",52),h("click",function(){let t=g(e).$implicit,l=m(2).$implicit,d=m().$implicit,_=m(2);return C(_.openTableDialog(l,d,t))}),o(5,"div",53)(6,"div",54),p(7),b(8,"number"),a(),o(9,"a",55),h("click",function(t){return g(e),C(t==null?null:t.stopPropagation())}),P(10,"i",40),a()()(),v()}if(n&2){let e=c.$implicit;r(2),f(" ",y(3,4,e.PriceExpected)," "),r(2),s("ngClass",w(8,He,e.Price!=e.PriceExpected)),r(3),f(" ",y(8,6,e.Price)," "),r(2),s("href",e.Url,F)}}function at(n,c){n&1&&(o(0,"td",56),p(1," X "),a(),o(2,"td",56),p(3," X "),a())}function lt(n,c){if(n&1&&(S(0),u(1,rt,11,10,"ng-container",50)(2,at,4,0,"ng-template",null,1,H),v()),n&2){let e=c.$implicit,i=z(3),t=m().$implicit,l=m(3);r(),s("ngIf",l.getItemFromChannel(t,e.ID))("ngIfElse",i)}}function ct(n,c){if(n&1&&(o(0,"tr"),u(1,it,9,9,"ng-container",3),o(2,"td",35),p(3),a(),o(4,"td",36)(5,"div",37)(6,"div",38),p(7),a(),o(8,"div",31)(9,"a",39),P(10,"i",40),a()()()(),u(11,ot,2,1,"ng-template",19)(12,lt,4,2,"ng-container",41),a()),n&2){let e=c.$implicit,i=c.$index,t=m(3);r(),s("ngIf",i==0),r(2),f(" ",e==null?null:e.Model," "),r(),s("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),r(2),s("ngClass",w(8,Ge,e.Discontinued)),r(),f(" ",e==null?null:e.Code," "),r(2),s("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),F),r(2),s("ngxPermissionsOnly",w(10,Re,t.rolePriceEdit)),r(),s("ngForOf",t.channels())}}function st(n,c){if(n&1&&(o(0,"tbody"),E(1,ct,13,12,"tr",null,M),a()),n&2){let e=c.$implicit;r(),T(e.Variants)}}function mt(n,c){if(n&1&&(S(0),E(1,st,3,0,"tbody",null,M),v()),n&2){let e=c.ngIf;r(),T(e)}}var qt=(()=>{class n{constructor(e,i,t,l,d,_,Le){this.http=e,this.toastr=i,this.dialog=t,this.productService=l,this.authService=d,this.biggerPictureService=_,this.paginationService=Le,this.infinitePagination=Q(J),this.searchFilter=new we,this.checkboxState=!1,this.rolePriceEdit=ue.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.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=te([]),this.filterTypeOptions=[{Key:W.ALL,Value:"All"},{Key:W.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let e=this.searchFilter.ListChannelID,i=[];U.IsEmpty(e)||e?.length==0?i=this.channelOptions:i=this.channelOptions.filter(t=>e.findIndex(l=>l==t.ID)>-1),this.channels.update(()=>i)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(G(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(Y(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=W.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),G(1))}onSelectAllData(){this.data$=this.data$.pipe(q(e=>(e.map(i=>(i.Variants&&(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t))),i)),e)))}onFilter(e){this.searchFilter.text=e;let i=Z(X({},this.searchFilter),{text:e,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(_=>_.ID),d={ListChannelID:this.channelOptions.filter(_=>_.selected).map(_=>_.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:_=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:_=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,i){return e.Channel.find(t=>t.ChannelID==i)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(De,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(K(t=>U.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openTableDialog(e,i,t){let l=JSON.parse(JSON.stringify(e));this.dialog.open(Oe,{data:{Name:i.Name,Variant:l,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(K(_=>U.IsNotEmpty(_))).subscribe(_=>{this.updateProductPrice(_,t)})}updateProductPrice(e,i){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(l=>{i.Price=t.Price;let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${d.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Ee,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}static{this.\u0275fac=function(i){return new(i||n)(x(ge),x(he),x(Pe),x(Fe),x(xe),x(Me),x(Te))}}static{this.\u0275cmp=N({type:n,selectors:[["app-custom-channel-price"]],features:[ae([J])],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(i,t){i&1&&(o(0,"mainpanel",2),h("onSubmit",function(d){return t.onFilter(d)}),o(1,"filters"),u(2,Je,9,4,"ng-container",3),b(3,"async"),a(),o(4,"actions")(5,"div",4),u(6,Ze,3,1,"ng-container",3),b(7,"async"),o(8,"button",5),h("click",function(){return t.openExportDialog()}),P(9,"i",6),o(10,"span"),p(11,"Export"),a()()()(),o(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),P(20,"th",14),E(21,qe,6,6,"th",15,M),a(),o(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),a()(),o(27,"th",17),p(28,"Variant"),a(),o(29,"th",18),p(30,"SKU"),a(),u(31,Ye,2,1,"ng-template",19),E(32,Qe,7,0,null,null,M),a()(),u(34,mt,3,0,"ng-container",3),b(35,"async"),a(),o(36,"infinite-paginator",20),b(37,"async"),h("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),a()()()()()()()),i&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",y(3,13,t.loader$)),r(4),s("ngIf",y(7,15,t.data$)),r(15),T(t.channels()),r(10),s("ngxPermissionsOnly",w(21,Re,t.rolePriceEdit)),r(),T(t.channels()),r(2),s("ngIf",y(35,17,t.data$)),r(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",y(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[B,se,k,me,pe,de,Se,be,$,_e,R,L,Ne,Be,j,A,Ve,fe,Ce,ke],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]})}}return n})();export{qt as CustomChannelPriceComponent};
@@ -1 +0,0 @@
1
- import{a as me,b as se,c as ce}from"./chunk-LXSQIECO.js";import{a as ue}from"./chunk-F7GZCBBK.js";import{a as de}from"./chunk-SG52OFBZ.js";import{a as le}from"./chunk-CXIBIPS5.js";import{a as pe}from"./chunk-VHIGKLLN.js";import"./chunk-ACIMXBIC.js";import"./chunk-IPYYFOPE.js";import"./chunk-I5QRFRRD.js";import"./chunk-SZ22GHDY.js";import"./chunk-CDNNFRZK.js";import"./chunk-3RK6DDJD.js";import{a as ae}from"./chunk-7SLPBFFW.js";import"./chunk-ZUFLZMHT.js";import"./chunk-NB5JKHKF.js";import"./chunk-YOGRCIUI.js";import"./chunk-SDUUFQUI.js";import"./chunk-JNXIAVS4.js";import"./chunk-PRVOIBMJ.js";import"./chunk-V27YSSV4.js";import"./chunk-LIQRQYKZ.js";import"./chunk-T2QY5RTH.js";import"./chunk-PQZGUDGJ.js";import"./chunk-LLXJSB37.js";import{h as ie}from"./chunk-BTW46HYC.js";import{e as te}from"./chunk-XMUA7ACY.js";import"./chunk-K5XRGNWG.js";import"./chunk-TGMCGROM.js";import"./chunk-WAGDS532.js";import{m as re,n as oe}from"./chunk-5SXUJ5XH.js";import{s as ne}from"./chunk-3S7C3CCV.js";import"./chunk-PHCYCYXH.js";import{c as X,h as Y,m as Z,o as $,y as ee}from"./chunk-5JWYKH72.js";import"./chunk-PW42BQIY.js";import"./chunk-KESNVJB4.js";import"./chunk-GQH7OSVY.js";import{j as q,k as J,m as K,n as Q}from"./chunk-UPA7TFVG.js";import{$b as W,$c as b,Fb as F,Fc as l,Gc as S,Hc as k,Jc as f,Kc as g,Lb as y,Lc as C,Mc as z,Nc as A,Oc as j,Pc as H,Qc as R,Ra as O,Rc as U,Xb as c,_c as w,ad as G,cc as E,dc as D,fc as N,gc as B,hc as t,ic as i,ja as L,jc as _,nc as M,pa as x,pb as I,rb as o,sc as V,tc as u,v as T,ya as d,za as m}from"./chunk-VFLAHRB4.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var P=(()=>{class n{constructor(){this.httpService=x(te)}getShippedOrders(e){return this.httpService.post(ie.GetShipped,e).pipe(T(p=>p.Data||[]))}static{this.\u0275fac=function(p){return new(p||n)}}static{this.\u0275prov=L({token:n,factory:n.\u0275fac})}}return n})();var _e=()=>[],Se=n=>({"td-cell-hover":n});function fe(n,h){if(n&1&&_(0,"variants-dropdown",27),n&2){let e=u().$implicit;c("variants",e==null?null:e.Variants)}}function ge(n,h){if(n&1&&_(0,"variant-with-image",28),n&2){let e=u().$implicit;c("variant",e==null?null:e.Variants[0])}}function Ce(n,h){if(n&1&&(t(0,"span"),l(1),i()),n&2){let e=u().$implicit;o(),S(e.LogisticService==null?null:e.LogisticService.Option)}}function ve(n,h){if(n&1&&(t(0,"tr")(1,"td"),l(2),i(),t(3,"td")(4,"div",23)(5,"div",24)(6,"div"),_(7,"img",25),w(8,"channelImage"),i(),t(9,"div"),_(10,"order-link",26),i()(),t(11,"small"),l(12),w(13,"date"),i()()(),t(14,"td"),l(15),i(),t(16,"td"),y(17,fe,1,1,"variants-dropdown",27)(18,ge,1,1,"variant-with-image",28),i(),t(19,"td",29),l(20),w(21,"number"),i(),t(22,"td")(23,"span"),l(24),i(),y(25,Ce,2,1,"span"),i()()),n&2){let e=h.$implicit;o(2),S(e.Outlet),o(5),c("src",b(8,12,e==null?null:e.MarketType),I)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),o(3),c("order",e),o(2),k(" ",G(13,14,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),o(3),S(e.Customer),o(),W(U(19,Se,(e.Variants==null?null:e.Variants.length)>1)),o(),E((e.Variants==null?null:e.Variants.length)>1?17:18),o(3),S(b(21,17,e.Amount)),o(4),S(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),o(),E(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?25:-1)}}function we(n,h){if(n&1){let e=M();t(0,"div",13)(1,"table",15)(2,"thead",16)(3,"tr",17)(4,"th",18),l(5,"Outlet"),i(),t(6,"th",19),l(7,"Number"),i(),t(8,"th",19),l(9,"Customer"),i(),t(10,"th"),l(11,"Items"),i(),t(12,"th",20),l(13,"Amount"),i(),t(14,"th",21),l(15,"Shipping"),i()()(),t(16,"tbody"),N(17,ve,26,21,"tr",null,D),i()(),t(19,"app-custom-paginator",22),V("next",function(){d(e);let r=u();return m(r.initShippedOrders())})("previous",function(){d(e);let r=u();return m(r.initShippedOrders())}),i()()}if(n&2){let e=u(),p=j(0);o(17),B(p),o(2),c("filter",e.filter())("totaldata",p==null?null:p.length)}}function xe(n,h){n&1&&(t(0,"div",14),_(1,"app-empty-state"),i())}var Ke=(()=>{class n{constructor(){this.shippedService=x(P),this.filter=O({PageNumber:1,PageSize:100,ListChannelID:[],From:new Date,To:new Date})}ngOnInit(){this.initShippedOrders()}initShippedOrders(){this.shippedOrders$=this.shippedService.getShippedOrders(this.filter())}static{this.\u0275fac=function(p){return new(p||n)}}static{this.\u0275cmp=F({type:n,selectors:[["app-shipped"]],features:[H([P])],decls:29,vars:12,consts:[["headerTitle","Shipped","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"],["rowCountApi","/api/orders/shippedcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","12px","padding-bottom","2.5px",3,"src","alt"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"]],template:function(p,r){if(p&1){let s=M();z(0),w(1,"async"),t(2,"mainpanel",0),V("onSubmit",function(){return d(s),m(r.initShippedOrders())}),t(3,"filters")(4,"div")(5,"label",1),l(6,"From/To"),i(),t(7,"channel-select-options",2),C("ngModelChange",function(a){return d(s),g(r.filter().ListChannelID,a)||(r.filter().ListChannelID=a),m(a)}),i()(),t(8,"div",3)(9,"label",1),l(10,"From/To"),i(),t(11,"div",4)(12,"datepicker",5),C("dateChange",function(a){return d(s),g(r.filter().From,a)||(r.filter().From=a),m(a)}),i()(),t(13,"div")(14,"datepicker",6),C("dateChange",function(a){return d(s),g(r.filter().To,a)||(r.filter().To=a),m(a)}),i()()(),t(15,"div",3)(16,"label",7),l(17,"Page Number"),i(),t(18,"input",8),C("ngModelChange",function(a){return d(s),g(r.filter().PageNumber,a)||(r.filter().PageNumber=a),m(a)}),i()(),t(19,"div",3)(20,"label",7),l(21,"Page Size"),i(),t(22,"input",9),C("ngModelChange",function(a){return d(s),g(r.filter().PageSize,a)||(r.filter().PageSize=a),m(a)}),i()()(),t(23,"content")(24,"div",10)(25,"div",11)(26,"div",12),y(27,we,20,2,"div",13)(28,xe,2,0,"div",14),i()()()()()}if(p&2){let s=A(b(1,8,r.shippedOrders$)||R(11,_e));o(2),c("hideSearchBox",!0),o(5),c("multiple",!0),f("ngModel",r.filter().ListChannelID),o(5),f("date",r.filter().From),o(2),f("date",r.filter().To),o(4),f("ngModel",r.filter().PageNumber),o(4),f("ngModel",r.filter().PageSize),o(5),E(s.length>0?27:28)}},dependencies:[Q,q,K,J,oe,re,le,ae,ee,X,$,Y,Z,me,se,ce,pe,de,ne,ue],encapsulation:2})}}return n})();export{Ke as ShippedComponent};
@@ -1 +0,0 @@
1
- import{a as ge}from"./chunk-IFLSHEST.js";import{a as ue,b as Ce,c as he}from"./chunk-LXSQIECO.js";import{a as _e}from"./chunk-F7GZCBBK.js";import{a as se}from"./chunk-SG52OFBZ.js";import{a as ce}from"./chunk-CXIBIPS5.js";import{a as de}from"./chunk-VHIGKLLN.js";import"./chunk-ACIMXBIC.js";import"./chunk-I44JKLRE.js";import"./chunk-IPYYFOPE.js";import"./chunk-I5QRFRRD.js";import"./chunk-SZ22GHDY.js";import"./chunk-CDNNFRZK.js";import"./chunk-3RK6DDJD.js";import{a as me}from"./chunk-7SLPBFFW.js";import"./chunk-ZUFLZMHT.js";import"./chunk-NB5JKHKF.js";import"./chunk-YOGRCIUI.js";import"./chunk-SDUUFQUI.js";import"./chunk-JNXIAVS4.js";import"./chunk-PRVOIBMJ.js";import"./chunk-V27YSSV4.js";import"./chunk-LIQRQYKZ.js";import"./chunk-T2QY5RTH.js";import"./chunk-PQZGUDGJ.js";import"./chunk-LLXJSB37.js";import{h as oe}from"./chunk-BTW46HYC.js";import{b as ie,e as ne}from"./chunk-XMUA7ACY.js";import"./chunk-K5XRGNWG.js";import"./chunk-TGMCGROM.js";import"./chunk-WAGDS532.js";import{m as le,n as pe}from"./chunk-5SXUJ5XH.js";import{r as ae,s as re}from"./chunk-3S7C3CCV.js";import"./chunk-PHCYCYXH.js";import{c as Y,h as Z,m as $,o as ee,y as te}from"./chunk-5JWYKH72.js";import{b as v}from"./chunk-PW42BQIY.js";import"./chunk-KESNVJB4.js";import"./chunk-GQH7OSVY.js";import{j as J,k as K,m as Q,n as X}from"./chunk-UPA7TFVG.js";import{$b as D,$c as E,Fb as F,Fc as l,Gc as _,Hc as z,Jc as f,Kc as S,Lb as y,Lc as w,Mc as j,Nc as H,Oc as R,Pc as U,Ra as I,Rc as G,Xb as s,Z as P,_c as x,ad as q,cc as L,dc as W,fc as B,gc as O,hc as i,ic as t,ja as k,jc as g,nc as T,pa as h,pb as N,rb as a,sc as A,tc as u,v as M,ya as c,za as d}from"./chunk-VFLAHRB4.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var V=(()=>{class n{constructor(){this.httpService=h(ne),this.shippingLabelService=h(ge),this.toastrService=h(ie)}getAwaitingCollectionOrders(e){return this.httpService.post(oe.GetAwaitingCollection,e).pipe(M(p=>p?.Data))}printShippingLabel(e){switch(e?.MarketType){case v.Shopee:this.shippingLabelService.printShippingLabelShopee(e.Number,e.ShopID);break;case v.Tiktok:this.shippingLabelService.printShippingLabelTiktok(e.Number,e.ShopID);break;case v.Tokopedia:this.shippingLabelService.printShippingLabelTokopedia(e.Number);break;case v.Lazada:this.shippingLabelService.printShippingLabelLazada(e.Number,e.ShopID);break;case v.Shopify:this.toastrService.error("Shopify not supported","Error Not supported");break}}static{this.\u0275fac=function(p){return new(p||n)}}static{this.\u0275prov=k({token:n,factory:n.\u0275fac})}}return n})();var Se=n=>({"td-cell-hover":n});function we(n,C){if(n&1&&g(0,"variants-dropdown",28),n&2){let e=u().$implicit;s("variants",e==null?null:e.Variants)}}function ve(n,C){if(n&1&&g(0,"variant-with-image",29),n&2){let e=u().$implicit;s("variant",e==null?null:e.Variants[0])}}function be(n,C){if(n&1&&(i(0,"span"),l(1),t()),n&2){let e=u().$implicit;a(),_(e.LogisticService==null?null:e.LogisticService.Option)}}function xe(n,C){if(n&1){let e=T();i(0,"tr")(1,"td"),l(2),t(),i(3,"td")(4,"div",24)(5,"div",25)(6,"div"),g(7,"img",26),x(8,"channelImage"),t(),i(9,"div"),g(10,"order-link",27),t()(),i(11,"small"),l(12),x(13,"date"),t()()(),i(14,"td"),l(15),t(),i(16,"td"),y(17,we,1,1,"variants-dropdown",28)(18,ve,1,1,"variant-with-image",29),t(),i(19,"td",30),l(20),x(21,"number"),t(),i(22,"td")(23,"span"),l(24),t(),y(25,be,2,1,"span"),t(),i(26,"td",31)(27,"button",32),A("click",function(){let o=c(e).$implicit,m=u(2);return d(m.onPrintShippingLabel(o))}),g(28,"i",33),t()()()}if(n&2){let e=C.$implicit;a(2),_(e.Outlet),a(5),s("src",E(8,12,e==null?null:e.MarketType),N)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),a(3),s("order",e),a(2),z(" ",q(13,14,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),a(3),_(e.Customer),a(),D(G(19,Se,(e.Variants==null?null:e.Variants.length)>1)),a(),L((e.Variants==null?null:e.Variants.length)>1?17:18),a(3),_(E(21,17,e.Amount)),a(4),_(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),a(),L(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?25:-1)}}function ye(n,C){if(n&1){let e=T();i(0,"div",13)(1,"table",15)(2,"thead",16)(3,"tr",17)(4,"th",18),l(5,"Outlet"),t(),i(6,"th",19),l(7,"Number"),t(),i(8,"th",19),l(9,"Customer"),t(),i(10,"th"),l(11,"Items"),t(),i(12,"th",20),l(13,"Amount"),t(),i(14,"th",21),l(15,"Shipping"),t(),g(16,"th",22),t()(),i(17,"tbody"),B(18,xe,29,21,"tr",null,W),t()(),i(20,"app-custom-paginator",23),A("next",function(){c(e);let o=u();return d(o.initAwaitingCollection())})("previous",function(){c(e);let o=u();return d(o.initAwaitingCollection())}),t()()}if(n&2){let e=u(),p=R(0);a(18),O(p),a(2),s("filter",e.filter())("totaldata",p==null?null:p.length)}}function Le(n,C){n&1&&(i(0,"div",14),g(1,"app-empty-state"),t())}var it=(()=>{class n{constructor(){this.awaitingCollectionService=h(V),this.filter=I({PageNumber:1,PageSize:100,ListChannelID:[],From:null,To:null})}ngOnInit(){this.initAwaitingCollection()}initAwaitingCollection(){this.awaitingCollections$=this.awaitingCollectionService.getAwaitingCollectionOrders(this.filter()).pipe(P(1))}onPrintShippingLabel(e){this.awaitingCollectionService.printShippingLabel(e)}static{this.\u0275fac=function(p){return new(p||n)}}static{this.\u0275cmp=F({type:n,selectors:[["app-awaiting-collection"]],features:[U([V])],decls:29,vars:11,consts:[["headerTitle","Awaiting Collection","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","10px"],["rowCountApi","/api/orders/awaitingcollectioncount",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,"text-end","td-cell-hover"],["type","button","aria-label","Print order","title","Print","matTooltip","Print shipping label",1,"btn","p-0","border-0","bg-transparent",3,"click"],[1,"fa-solid","fa-print","fs-3"]],template:function(p,o){if(p&1){let m=T();j(0),x(1,"async"),i(2,"mainpanel",0),A("onSubmit",function(){return c(m),d(o.initAwaitingCollection())}),i(3,"filters")(4,"div")(5,"label",1),l(6,"From/To"),t(),i(7,"channel-select-options",2),w("ngModelChange",function(r){return c(m),S(o.filter().ListChannelID,r)||(o.filter().ListChannelID=r),d(r)}),t()(),i(8,"div",3)(9,"label",1),l(10,"From/To"),t(),i(11,"div",4)(12,"datepicker",5),w("dateChange",function(r){return c(m),S(o.filter().From,r)||(o.filter().From=r),d(r)}),t()(),i(13,"div")(14,"datepicker",6),w("dateChange",function(r){return c(m),S(o.filter().To,r)||(o.filter().To=r),d(r)}),t()()(),i(15,"div",3)(16,"label",7),l(17,"Page Number"),t(),i(18,"input",8),w("ngModelChange",function(r){return c(m),S(o.filter().PageNumber,r)||(o.filter().PageNumber=r),d(r)}),t()(),i(19,"div",3)(20,"label",7),l(21,"Page Size"),t(),i(22,"input",9),w("ngModelChange",function(r){return c(m),S(o.filter().PageSize,r)||(o.filter().PageSize=r),d(r)}),t()()(),i(23,"content")(24,"div",10)(25,"div",11)(26,"div",12),y(27,ye,21,2,"div",13)(28,Le,2,0,"div",14),t()()()()()}if(p&2){let m=H(E(1,8,o.awaitingCollections$));a(2),s("hideSearchBox",!0),a(5),s("multiple",!0),f("ngModel",o.filter().ListChannelID),a(5),f("date",o.filter().From),a(2),f("date",o.filter().To),a(4),f("ngModel",o.filter().PageNumber),a(4),f("ngModel",o.filter().PageSize),a(5),L((m==null?null:m.length)>0?27:28)}},dependencies:[X,J,Q,K,pe,le,ce,me,te,Y,ee,Z,$,ue,Ce,he,de,se,re,ae,_e],encapsulation:2})}}return n})();export{it as AwaitingCollectionComponent};
@@ -1 +0,0 @@
1
- import{a as rt}from"./chunk-BVIRHZTZ.js";import{a as bt}from"./chunk-FZDXTSZF.js";import{b as xt}from"./chunk-SZ22GHDY.js";import{a as Ct}from"./chunk-PRVOIBMJ.js";import{e as st}from"./chunk-XMUA7ACY.js";import{b as ut,c as gt,h as ht,j as ft,k as _t}from"./chunk-5SXUJ5XH.js";import{r as pt,s as dt}from"./chunk-3S7C3CCV.js";import{c as it,h as nt,m as ot,y as at}from"./chunk-5JWYKH72.js";import{b as lt}from"./chunk-PW42BQIY.js";import{a as mt,c as ct}from"./chunk-GQH7OSVY.js";import{g as V,i as et,m as L,n as R}from"./chunk-UPA7TFVG.js";import{$c as y,Ec as S,Fb as M,Fc as m,G,Gc as w,Hc as k,Ib as K,Jc as X,K as U,Ka as D,Kc as Z,Lb as u,Lc as tt,Oa as h,Ra as _,X as z,Xb as g,Z as J,_c as I,bd as $,ca as W,cc as P,ea as O,f as j,fa as Y,g as A,hc as r,ic as l,ja as H,jc as B,kc as T,lc as v,mc as Q,nc as f,oa as q,qd as N,rb as a,sc as C,tc as s,v as b,xb as E,ya as p,za as d}from"./chunk-VFLAHRB4.js";function Tt(e,c){e&1&&Q(0)}function vt(e,c){if(e&1&&(T(0),u(1,Tt,1,0,"ng-container",5),v()),e&2){s(2);let t=S(4);a(),g("ngTemplateOutlet",t)}}function wt(e,c){if(e&1&&(r(0,"div",6)(1,"label"),m(2,"Editing Data"),l(),r(3,"div")(4,"span"),m(5),I(6,"number"),l()()()),e&2){let t=s(2);a(5),w(y(6,1,t.value))}}function It(e,c){if(e&1&&(T(0),u(1,vt,2,1,"ng-container",4)(2,wt,7,3,"ng-template",null,1,$),v()),e&2){let t=S(3),i=s();a(),g("ngIf",i.hasPriceEdit)("ngIfElse",t)}}function yt(e,c){if(e&1){let t=f();r(0,"div",7)(1,"input",8),tt("ngModelChange",function(n){p(t);let o=s();return Z(o.value,n)||(o.value=n),d(n)}),l(),r(2,"label",9),m(3),l()()}if(e&2){let t=s();a(),X("ngModel",t.value),g("max",t.maxEditInventory),a(2),w(t.item.Table)}}var Ht=(()=>{class e{constructor(t,i,n){this.dialogRef=t,this.item=i,this.permissionService=n,this.maxEditInventory=1e5,this.permissionService.hasPermission(rt.price).then(o=>this.hasPriceEdit=o)}ngOnInit(){this.selectedChannel=this.item.Variant.Channel.find(t=>t.ChannelID==this.item.ChannelID),this.selectedChannel.ID=this.item.Variant.ID,this.selectedChannel.Sku=this.item.Variant.Code,this.item.Table=="inventory"?(this.value=this.selectedChannel.Inventory,this.maxEditInventory=this.selectedChannel?.TypeID==lt.Tokopedia?1e5:null):this.item.Table=="price"&&(this.value=this.selectedChannel.Price,this.maxEditInventory=null),this.selectedChannel.ItemName=this.item.Name,this.selectedChannel.VarName=this.item.Variant.Model,this.initModalConfig()}initModalConfig(){let t=this.item.Table=="inventory"?"Update Inventory":"Update Price";this.modalConfig=new ft,this.modalConfig.title=`${t} ${this.item?.Name} in ${this.selectedChannel?.Title}`}onSubmit(){this.item.Table=="inventory"?this.selectedChannel.Inventory=this.value:this.item.Table=="price"&&(this.selectedChannel.Price=this.value),this.dialogRef.close(this.selectedChannel)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(i){return new(i||e)(E(ut),E(gt),E(mt))}}static{this.\u0275cmp=M({type:e,selectors:[["app-table-dialog"]],decls:5,vars:4,consts:[["INVENTORY",""],["DISABLED",""],[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],["matTooltipPosition","above","matTooltip","Cannot edit Unit Price because you dont have access ProductEditor role",1,"info-label-group","mt-3",2,"background","#e9ecef","opacity","1"],[1,"form-label-group","mt-3"],["type","text","name","edit","autoNum","",1,"form-control",3,"ngModelChange","ngModel","max"],["for","edit",1,"text-capitalize"]],template:function(i,n){if(i&1){let o=f();r(0,"modal-material",2),C("onClose",function(){return p(o),d(n.onClose())})("onCancel",function(){return p(o),d(n.onClose())})("onOk",function(){return p(o),d(n.onSubmit())}),r(1,"div",3),u(2,It,4,2,"ng-container",4)(3,yt,4,3,"ng-template",null,0,$),l()()}if(i&2){let o=S(4);g("dynamicValidated",n.value)("config",n.modalConfig),a(2),g("ngIf",n.item.Table=="price")("ngIfElse",o)}},dependencies:[R,V,et,L,ht,Ct,xt,bt,_t,at,it,nt,ot,ct,dt,pt],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-left:1rem;margin-right:1rem}.mat-dialog-content[_ngcontent-%COMP%]{padding-left:.5rem;padding-right:.5rem;margin-left:.5rem;margin-right:.5rem}.font-lg[_ngcontent-%COMP%]{font-size:large}.font-lgr[_ngcontent-%COMP%]{font-size:larger}"]})}}return e})();var Kt=(()=>{class e{transform(t,i,n=0){if(!t)return t;let o=i?parseInt(i,10):10;return t.length>o?t.substring(n,o)+"...":t}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275pipe=K({name:"stringLimit",type:e,pure:!0})}}return e})();function Nt(e,c){if(e&1){let t=f();r(0,"span",6),C("click",function(){p(t);let n=s();return d(n.onGetRowCount())}),r(1,"i",7),m(2,"?"),l()()}}function Dt(e,c){if(e&1&&(T(0),r(1,"span"),m(2),I(3,"number"),l(),v()),e&2){let t=s();a(2),w(y(3,1,t.rowCount()))}}function Et(e,c){if(e&1){let t=f();r(0,"a",10),C("click",function(){p(t);let n=s(2);return d(n.onNextPage())}),B(1,"i",11),m(2," Next"),l()}}function Mt(e,c){if(e&1){let t=f();r(0,"a",12),C("click",function(){p(t);let n=s(2);return d(n.onLastPage())}),B(1,"i",13),m(2," Last"),l()}}function St(e,c){if(e&1&&(r(0,"div",5),u(1,Et,3,0,"a",8)(2,Mt,3,0,"a",9),l()),e&2){let t=s();a(),P(t.disableNextButton()&&!t.goToLastPage()?1:-1),a(),P(t.disableNextButton()&&!t.goToLastPage()?2:-1)}}var ie=(()=>{class e{constructor(){this.totalData=h(0),this.rowCount=h(),this.pageNumber=h(),this.disableNextButton=h(),this.goToLastPage=h(),this.hideCount=h(),this.nextPage=new D,this.lastPage=new D,this.getRowCount=new D}onNextPage(){this.nextPage.emit()}onLastPage(){this.lastPage.emit()}onGetRowCount(){this.getRowCount.emit()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=M({type:e,selectors:[["infinite-paginator"]],inputs:{totalData:[1,"totalData"],rowCount:[1,"rowCount"],pageNumber:[1,"pageNumber"],disableNextButton:[1,"disableNextButton"],goToLastPage:[1,"goToLastPage"],hideCount:[1,"hideCount"]},outputs:{nextPage:"onNextPage",lastPage:"onLastPage",getRowCount:"onGetRowCount"},decls:9,vars:7,consts:[[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],[2,"cursor","pointer"],[4,"ngIf"],[1,"btn-group"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary","border-start-0",3,"click"],[1,"fas","fa-share"]],template:function(i,n){i&1&&(r(0,"div",0)(1,"div",1)(2,"div",2),m(3),I(4,"number"),u(5,Nt,3,0,"span",3)(6,Dt,4,3,"ng-container",4),m(7),l()(),u(8,St,3,2,"div",5),l()),i&2&&(a(3),k(" Showing 1 - ",y(4,5,n.totalData())," of "),a(2),P(n.hideCount()?5:-1),a(),g("ngIf",!n.hideCount()&&n.rowCount()),a(),k(" records ~ ",n.pageNumber()," Page "),a(),P(n.totalData()>0?8:-1))},dependencies:[R,V,L],encapsulation:2})}}return e})();var se=(()=>{class e{constructor(t){this.http=t,this.pagination$=new A(null),this._pageNumber=_(1),this.pageNumber=N(()=>this._pageNumber()),this._hideCount=_(!0),this.hideCount=N(()=>this._hideCount()),this._disableNextButton=_(!0),this.disableNextButton=N(()=>this._disableNextButton()),this._goToLastPage=_(!1),this.isLastPage=N(()=>this._goToLastPage()),this.totalData=_(0),this.destroy$=new j,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this._pageNumber.set(t.PageNumber)}setPaginationButtonState(t,i){i==0?this._disableNextButton.set(!0):this._disableNextButton.set(!(i<t.RowCount*t.PageNumber))}reloadPagination(t){t.PageNumber=1,this.pagination$.next(t),this._hideCount.set(!0),this._goToLastPage.set(!1)}onLastPage(t={}){let i=JSON.parse(JSON.stringify(t));this.totalRowCount$=this.http.post(`/api/${this.fethRowCountEndpoint}`,i).pipe(b(n=>n.Total),O(n=>{this._hideCount.set(!1),i.RowCount=n,i.PageNumber=1,this.pagination$.next(i),this._goToLastPage.set(!0)}))}paginationFunction(){return this.pagination$.pipe(W(this.destroy$),G(t=>t!=null),U(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(b(i=>i.Data?i.Data:[]))),Y(this.pagination$),z((t,i)=>{let[n,o]=t,[x]=i;return o.PageNumber==1?[x,o]:[n.concat(x),o]}),O(([t,i])=>{this.setPageNumberFooter(i);let n=this.calculateProductLength(t);this.totalData.set(n),this.setPaginationButtonState(i,n)}),b(([t])=>t),J())}getRowCount(t){this._hideCount.set(!1),this.totalRowCount$=this.http.post(`/API/${this.fethRowCountEndpoint}`,t).pipe(b(i=>i.Total))}calculateProductLength(t=[]){return t.reduce((n,o)=>n+(o.Variants?.length?o.Variants?.length:0),0)}static{this.\u0275fac=function(i){return new(i||e)(q(st))}}static{this.\u0275prov=H({token:e,factory:e.\u0275fac})}}return e})();export{Ht as a,Kt as b,ie as c,se as d};
@@ -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{a as M}from"./chunk-JAC62SW3.js";import{a as E}from"./chunk-XHAXYWZ7.js";import{a as De,b as Ee,c as Me,d as B}from"./chunk-OQCIFQ6E.js";import{a as se}from"./chunk-BVIRHZTZ.js";import{a as Ve,b as Te}from"./chunk-TCRZNHID.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-SZ22GHDY.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{j as he}from"./chunk-BTW46HYC.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};
@@ -1 +0,0 @@
1
- import{b as c}from"./chunk-HCZDLZLY.js";import{a as l}from"./chunk-ZX5YQUYQ.js";import"./chunk-BTW46HYC.js";import"./chunk-XMUA7ACY.js";import"./chunk-K5XRGNWG.js";import"./chunk-TGMCGROM.js";import{n as u}from"./chunk-5SXUJ5XH.js";import"./chunk-3S7C3CCV.js";import"./chunk-PHCYCYXH.js";import{y as s}from"./chunk-5JWYKH72.js";import"./chunk-PW42BQIY.js";import"./chunk-KESNVJB4.js";import"./chunk-GQH7OSVY.js";import{F as a,J as n,n as i}from"./chunk-UPA7TFVG.js";import{Fb as p,Gb as r,jc as d,ka as e}from"./chunk-VFLAHRB4.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var M=(()=>{class t{constructor(){}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=p({type:t,selectors:[["app-report"]],standalone:!1,decls:1,vars:0,template:function(o,C){o&1&&d(0,"router-outlet")},dependencies:[a],styles:["ul[_ngcontent-%COMP%] > li.dropdown-item[_ngcontent-%COMP%]{font-size:.6875rem!important}"]})}}return t})();var R=[{path:"",component:M,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",loadChildren:()=>import("./chunk-B2EMWVNF.js").then(t=>t.OrderModule),canActivate:[l]}]}],h=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=r({type:t})}static{this.\u0275inj=e({imports:[i,n.forChild(R)]})}}return t})();var S=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=r({type:t})}static{this.\u0275inj=e({imports:[i,c,h,s,u,n]})}}return t})();export{S as ReportModule};
@@ -1 +0,0 @@
1
- import{a as pt}from"./chunk-V6IICLFE.js";import{a as Ct}from"./chunk-EAU6FVQT.js";import{a as mt,b as ct}from"./chunk-MFZLTVCS.js";import{c as ft}from"./chunk-ZUFLZMHT.js";import{f as ht}from"./chunk-V27YSSV4.js";import{b as D,c as P,j as E,k}from"./chunk-5SXUJ5XH.js";import{r as O}from"./chunk-3S7C3CCV.js";import{h as dt,m as st}from"./chunk-5JWYKH72.js";import{b as s,c as f}from"./chunk-PW42BQIY.js";import{G as rt,d as W,f as B,g as K,j as ot,m as lt}from"./chunk-UPA7TFVG.js";import{$c as x,Ec as it,Fb as T,Fc as r,Gc as u,Hc as y,Jc as V,Kc as N,Lb as g,Lc as U,Ra as Z,Rc as R,Wb as j,Xb as d,Z as Q,_c as I,bd as at,cc as z,dc as tt,fc as et,gc as nt,hc as a,ic as l,jc as _,kc as G,lc as H,nc as F,pa as X,pb as b,rb as o,sc as S,tc as h,v as q,xb as C,ya as A,za as L}from"./chunk-VFLAHRB4.js";function Mt(e,p){if(e&1&&(a(0,"mat-option",10)(1,"div",11),_(2,"img",12),a(3,"span"),r(4),l()()()),e&2){let t=p.$implicit;d("value",t.ID)("disabled",t.disabled),o(),d("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),o(),d("src",t.Img,b),o(2),u(t.Name)}}function bt(e,p){if(e&1){let t=F();a(0,"div",13)(1,"label",14),r(2,"Scan Type"),l(),a(3,"mat-radio-group",15),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.ScanFull,i)||(m.filter.ScanFull=i),L(i)}),a(4,"mat-radio-button",16),r(5," Full (Include Inactive Products) "),l(),a(6,"mat-radio-button",17),r(7," Active "),l()()()}if(e&2){let t=h();o(3),V("ngModel",t.filter.ScanFull),o(),d("value",!0),o(2),d("value",!1)}}function Tt(e,p){e&1&&(a(0,"span"),r(1,"Never"),l())}function It(e,p){if(e&1&&(a(0,"span"),r(1),I(2,"async"),l()),e&2){let t=h(2);o(),u(x(2,1,t.lastSync$))}}function xt(e,p){if(e&1){let t=F();a(0,"div",8)(1,"label",3)(2,"span",18),r(3,"Last Scan:"),l(),g(4,Tt,2,0,"span"),I(5,"async"),g(6,It,3,3,"span"),l(),a(7,"mat-radio-group",19),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.UpdatedProduct,i)||(m.filter.UpdatedProduct=i),L(i)}),a(8,"mat-radio-button",20),r(9," Scan All Products "),l(),a(10,"mat-radio-button",21),r(11),l()()()}if(e&2){let t=h();o(4),z(x(5,6,t.lastSync$)==null?4:6),o(3),V("ngModel",t.filter.UpdatedProduct),o(),d("value",!1),o(2),d("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),o(),y(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Ot(e,p){if(e&1){let t=F();a(0,"div",8)(1,"label",3),r(2," Scan Option "),l(),a(3,"mat-radio-group",22),U("ngModelChange",function(i){A(t);let m=h();return N(m.filter.Async,i)||(m.filter.Async=i),L(i)}),a(4,"mat-radio-button",23),r(5," Asynchronous (Get Notified when Complete) "),l(),a(6,"mat-radio-button",24),r(7," Synchronous (Wait until Complete) "),l()()()}if(e&2){let t=h();o(3),V("ngModel",t.filter.Async),o(),d("value",!0),o(2),d("value",!1)}}var Xt=(()=>{class e{constructor(t,n,i){this.dialogRef=t,this.data=n,this.router=i,this.channelService=X(pt),this.channelType=s,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(n.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(n.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==s.Tiktok||t.TypeID==s.Tokopedia||t.TypeID==s.Lazada||t.TypeID==s.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let n=this.filterChannelById(t);this.selectedChannel=n,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(q(n=>(this.selectedChannel.LastSync=n.LastSync,this.setDefaultConfigUpdate(),f.IsNotEmpty(n.LastSync)?f.convertToReadableDate(n.LastSync):null)),Q(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==s.Shopee||this.selectedChannel.TypeID==s.Tiktok||this.selectedChannel.TypeID==s.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=s.WooCommerce&&this.selectedChannel?.TypeID!=s.KalCare&&this.selectedChannel?.TypeID!=s.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let n;return this.channelOptions&&(n=this.channelOptions.find(i=>i.ID==t)),n}submit(){this.selectedChannel.TypeID==s.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return f.IsNotEmpty(t)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||e)(C(D),C(P),C(rt))}}static{this.\u0275cmp=T({type:e,selectors:[["app-scan-dialog"]],standalone:!1,decls:11,vars:8,consts:[[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","disabled","ngModel"],["class","channel-option",3,"value","disabled",4,"ngFor","ngForOf"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],[1,"channel-option",3,"value","disabled"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","round",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","round",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(n,i){n&1&&(a(0,"modal-material",0),S("onOk",function(){return i.submit()})("onClose",function(){return i.onClose()})("onCancel",function(){return i.onClose()}),a(1,"div",1)(2,"div",2)(3,"label",3),r(4,"Select a Channel"),l(),a(5,"mat-form-field",4)(6,"mat-select",5),U("ngModelChange",function(c){return N(i.filter.ChannelID,c)||(i.filter.ChannelID=c),c}),S("ngModelChange",function(c){return i.onSelectChannel(c)}),g(7,Mt,5,5,"mat-option",6),l()(),g(8,bt,8,3,"div",7)(9,xt,12,8,"div",8)(10,Ot,8,3,"div",9),l()()()),n&2&&(d("dynamicValidated",i.isNotEmpty(i.filter.ChannelID))("config",i.modalConfig),o(6),d("disabled",i.disabledChannelOption),V("ngModel",i.filter.ChannelID),o(),d("ngForOf",i.channelOptions),o(),d("ngIf",!i.isSingleChannel&&i.isNotEmpty(i.filter.ChannelID)),o(),z(i.hasScanUpdate&&i.selectedChannel?9:-1),o(),d("ngIf",!i.isSingleChannel&&i.isNotEmpty(i.filter.ChannelID)))},dependencies:[B,K,dt,st,mt,ct,ht,Ct,ft,O,k,ot],encapsulation:2})}}return e})();var v=function(e){return e.Tokopedia="https://seller.tokopedia.com",e.Shoope="https://seller.shopee.co.id",e.Tiktok="https://seller-id.tiktok.com",e.WooCommerce="https://woocommerce.dealpos.app",e.Lazada="https://sellercenter.lazada.co.id",e}(v||{});var Dt=e=>({"is-disabled":e});function Pt(e,p){if(e&1&&(G(0),a(1,"tr")(2,"td",11),r(3),l(),a(4,"td",11),r(5),l(),a(6,"td",12)(7,"p",13),r(8,"Product Not in Channel!"),l()()(),H()),e&2){let t=h().$implicit;o(3),y(" ",t==null?null:t.Model,""),o(2),y(" ",t==null?null:t.Code,"")}}function Et(e,p){if(e&1&&(a(0,"td",11),r(1),l()),e&2){let t=h(3).$implicit;j("rowspan",t.Channel.length),o(),y(" ",t==null?null:t.Model,"")}}function kt(e,p){if(e&1&&(a(0,"td",11),r(1),l()),e&2){let t=h(3).$implicit;j("rowspan",t.Channel.length),o(),y(" ",t==null?null:t.Code,"")}}function wt(e,p){if(e&1&&(a(0,"tr"),g(1,Et,2,2,"td",14)(2,kt,2,2,"td",14),a(3,"td",11)(4,"div",15)(5,"a",16),_(6,"img",17),l(),a(7,"div",18),r(8),l()()(),a(9,"td",11),r(10),I(11,"number"),l(),a(12,"td",19),r(13),I(14,"number"),l(),a(15,"td",19)(16,"a",20),_(17,"i",21),a(18,"span",22),r(19,"Edit"),l()()()()),e&2){let t=p.$implicit,n=p.index,i=h(3);o(),d("ngIf",n==0),o(),d("ngIf",n==0),o(3),d("href",t.Url,b)("title",t.Title),o(),d("src",i.getChannelLogo(t.TypeID),b),o(),d("matTooltip",(t==null||t.Name==null?null:t.Name.length)>55?t==null?null:t.Name:""),o(),y(" ",t.Name," "),o(2),u(x(11,12,t.Price)),o(3),u(x(14,14,t.Inventory)),o(3),d("href",i.getHyperlinkSellerCenter(t),b)("ngClass",R(16,Dt,t.TypeID==i.channelType.KalCare))("matTooltip",t.TypeID!=i.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function Vt(e,p){if(e&1&&g(0,wt,20,18,"tr",9),e&2){let t=h().$implicit;d("ngForOf",t==null?null:t.Channel)}}function Nt(e,p){if(e&1&&(G(0),g(1,Pt,9,2,"ng-container",10)(2,Vt,1,1,"ng-template",null,0,at),H()),e&2){let t=p.$implicit,n=it(3);o(),d("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",n)}}var le=(()=>{class e{constructor(t,n){this.data=t,this.dialogRef=n,this.channelType=s,this.variants=t.variants,this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideCancel=!0,this.modalConfig.hideOk=!0}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let n="javascript:void(0)";switch(t.TypeID){case s.Shopee:n=`${v.Shoope}/portal/product/${t.ChannelItemID}`;break;case s.Tiktok:n=`${v.Tiktok}/product/edit/${t.ChannelItemID}`;break;case s.Tokopedia:n=`${v.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case s.WooCommerce:n=`${v.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case s.Lazada:n=`${v.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return n}static{this.\u0275fac=function(n){return new(n||e)(C(P),C(D))}}static{this.\u0275cmp=T({type:e,selectors:[["app-modal-variant"]],standalone:!1,decls:22,vars:2,consts:[["printChannelModal",""],[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-pencil","me-2",2,"font-size","10px"],[1,"fs-6"]],template:function(n,i){n&1&&(a(0,"modal-material",1),S("onCancel",function(){return i.dialogRef.close()}),a(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr")(5,"th",5),r(6," VARIANT "),a(7,"sup"),_(8,"i",6),l()(),a(9,"th",5),r(10,"SKU"),l(),a(11,"th",5),r(12," PRODUCT "),a(13,"sup"),_(14,"i",7),l()(),a(15,"th",5),r(16,"PRICE"),l(),a(17,"th",8),r(18,"INVENTORY"),l(),_(19,"th",5),l()(),a(20,"tbody"),g(21,Nt,4,2,"ng-container",9),l()()()()),n&2&&(d("config",i.modalConfig),o(21),d("ngForOf",i.variants))},dependencies:[W,B,K,O,k,lt],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]})}}return e})();var Ut=e=>({"bg-gradient-warning":e});function At(e,p){if(e&1&&(a(0,"tr",5)(1,"td"),r(2),l(),a(3,"td",6),r(4),l()()),e&2){let t=p.$implicit;d("matTooltip",t.duplicateMessage),o(2),u(t==null?null:t.Name),o(),d("ngClass",R(4,Ut,t.isDuplicate)),o(),u(t!=null&&t.ChannelVariationSKU?t==null?null:t.ChannelVariationSKU:"Not Assigned")}}var fe=(()=>{class e{constructor(t,n){this.data=t,this.dialogRef=n,this.variants=Z([])}ngOnInit(){this.initModalConfig(),this.initVariants()}initVariants(){let t=this.data?.variants,n={},i=[],m=t.filter(c=>f.IsEmpty(c.ChannelVariationSKU));t.filter(c=>f.IsNotEmpty(c.ChannelVariationSKU)).forEach((c,M,J)=>{n[c.ChannelVariationSKU]=J.filter(w=>w.ChannelVariationSKU===c.ChannelVariationSKU)}),Object.keys(n).forEach(c=>{n[c].length>1&&(n[c]=n[c].map((M,J,w)=>{let Y=`SKU ${M.ChannelVariationSKU} is duplicated with variant`;return w.forEach(($,vt)=>{$.Name!==M.Name&&(Y+=` ${w.length>2?$.Name+(vt!==w.length-1?",":""):$.Name}`)}),M.duplicateMessage=Y,M.isDuplicate=!0,M})),i.push(...n[c])}),i.push(...m),this.variants.set(i)}initModalConfig(){this.modalConfig=new E,this.modalConfig.title=this.data?.title,this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0,this.modalConfig.bodyScrollable=!0}static{this.\u0275fac=function(n){return new(n||e)(C(P),C(D))}}static{this.\u0275cmp=T({type:e,selectors:[["app-modal-variants"]],standalone:!1,decls:12,vars:1,consts:[[3,"onCancel","config"],["content",""],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"sticky-top"],["matTooltipPosition","above",3,"matTooltip"],[3,"ngClass"]],template:function(n,i){n&1&&(a(0,"modal-material",0),S("onCancel",function(){return i.dialogRef.close()}),a(1,"div",1)(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4),r(6,"Variant"),l(),a(7,"th",4),r(8,"SKU"),l()()(),a(9,"tbody"),et(10,At,5,6,"tr",5,tt),l()()()()),n&2&&(d("config",i.modalConfig),o(10),nt(i.variants()))},dependencies:[W,O,k],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#f6f6f6!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}"]})}}return e})();export{Xt as a,le as b,fe as c};