dealpos 1.0.0

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 (238) hide show
  1. package/POS/3rdpartylicenses.txt +1645 -0
  2. package/POS/assets/icons/icon-128x128.png +0 -0
  3. package/POS/assets/icons/icon-144x144.png +0 -0
  4. package/POS/assets/icons/icon-152x152.png +0 -0
  5. package/POS/assets/icons/icon-192x192.png +0 -0
  6. package/POS/assets/icons/icon-384x384.png +0 -0
  7. package/POS/assets/icons/icon-512x512.png +0 -0
  8. package/POS/assets/icons/icon-72x72.png +0 -0
  9. package/POS/assets/icons/icon-96x96.png +0 -0
  10. package/POS/chunk-26YXEYJK.js +1 -0
  11. package/POS/chunk-2DNKBN6G.js +1 -0
  12. package/POS/chunk-2FKYC63K.js +1 -0
  13. package/POS/chunk-2FWFPV5I.js +1 -0
  14. package/POS/chunk-2OSKJOSS.js +1 -0
  15. package/POS/chunk-2OXMYDYT.js +1 -0
  16. package/POS/chunk-2OZMF5DL.js +1 -0
  17. package/POS/chunk-2W3MAOOP.js +1 -0
  18. package/POS/chunk-33XCA4ER.js +14 -0
  19. package/POS/chunk-35V3VL6F.js +1 -0
  20. package/POS/chunk-3A7KA4YN.js +1 -0
  21. package/POS/chunk-3BODNSIH.js +1 -0
  22. package/POS/chunk-3FOIEYAT.js +4 -0
  23. package/POS/chunk-3PFXZUB6.js +7 -0
  24. package/POS/chunk-3QABPVXZ.js +3 -0
  25. package/POS/chunk-4BDQDYVB.js +1 -0
  26. package/POS/chunk-4CBDK52E.js +4 -0
  27. package/POS/chunk-4G26RHGA.js +1 -0
  28. package/POS/chunk-4MX7Q77M.js +2 -0
  29. package/POS/chunk-4UAHOTBD.js +1 -0
  30. package/POS/chunk-56EQRIAH.js +1 -0
  31. package/POS/chunk-5KBFQLSN.js +1 -0
  32. package/POS/chunk-5W7F4VJH.js +1 -0
  33. package/POS/chunk-64PDX5ZX.js +1 -0
  34. package/POS/chunk-65YDOCXF.js +1 -0
  35. package/POS/chunk-67VBXFVT.js +6 -0
  36. package/POS/chunk-6BQZINLH.js +1 -0
  37. package/POS/chunk-6L6CIH5M.js +1 -0
  38. package/POS/chunk-6PXJEE4K.js +1 -0
  39. package/POS/chunk-6S4Q5VRA.js +1 -0
  40. package/POS/chunk-75STMWUR.js +6 -0
  41. package/POS/chunk-76C33PK5.js +1 -0
  42. package/POS/chunk-77D6X2SQ.js +11 -0
  43. package/POS/chunk-7DWKYGA4.js +1 -0
  44. package/POS/chunk-7M6CWVRI.js +1 -0
  45. package/POS/chunk-7Q3437BR.js +1 -0
  46. package/POS/chunk-AA32I4UN.js +1 -0
  47. package/POS/chunk-AJMKP7YZ.js +1 -0
  48. package/POS/chunk-AOJW6WJT.js +1 -0
  49. package/POS/chunk-AOPKPEVH.js +1 -0
  50. package/POS/chunk-APJK7OH2.js +2 -0
  51. package/POS/chunk-APYNCJ2H.js +1 -0
  52. package/POS/chunk-AUYYX2UQ.js +45 -0
  53. package/POS/chunk-AVDGNFC7.js +1 -0
  54. package/POS/chunk-AWGZKLLY.js +1 -0
  55. package/POS/chunk-AYKDALBT.js +1 -0
  56. package/POS/chunk-B2OT7HA4.js +4 -0
  57. package/POS/chunk-B36XIZVJ.js +1 -0
  58. package/POS/chunk-B5FODXLM.js +1 -0
  59. package/POS/chunk-B7RM5KKA.js +1 -0
  60. package/POS/chunk-BCVO66L3.js +5 -0
  61. package/POS/chunk-BETKNHFK.js +1 -0
  62. package/POS/chunk-BH2ZVZIU.js +1 -0
  63. package/POS/chunk-BHXS5IA6.js +1 -0
  64. package/POS/chunk-BLZEDUEI.js +1 -0
  65. package/POS/chunk-BYXBJQAS.js +0 -0
  66. package/POS/chunk-BZC5JINN.js +5 -0
  67. package/POS/chunk-C43IYFVU.js +1 -0
  68. package/POS/chunk-CBW7IA6S.js +1 -0
  69. package/POS/chunk-CCGPOEE3.js +4 -0
  70. package/POS/chunk-CFIFFKWA.js +1 -0
  71. package/POS/chunk-CI45CZMG.js +1 -0
  72. package/POS/chunk-CJO25BBP.js +1 -0
  73. package/POS/chunk-CLL3TEL5.js +1 -0
  74. package/POS/chunk-CPUGWH3I.js +1 -0
  75. package/POS/chunk-CPW6IWAB.js +1 -0
  76. package/POS/chunk-CRSUSQ3W.js +1 -0
  77. package/POS/chunk-CW27R4N3.js +2 -0
  78. package/POS/chunk-CWU5DTSS.js +1 -0
  79. package/POS/chunk-CY2FQLP4.js +1 -0
  80. package/POS/chunk-DRGWLGRP.js +1 -0
  81. package/POS/chunk-DXF4M3Z6.js +1 -0
  82. package/POS/chunk-E72IOARD.js +1 -0
  83. package/POS/chunk-EA7CLJMQ.js +18 -0
  84. package/POS/chunk-ECMSF3OR.js +1 -0
  85. package/POS/chunk-EOFWQEK7.js +1 -0
  86. package/POS/chunk-EQOB7536.js +156 -0
  87. package/POS/chunk-ESD5O3BQ.js +1 -0
  88. package/POS/chunk-EZCHVNC5.js +3 -0
  89. package/POS/chunk-F3ZYFWTM.js +1 -0
  90. package/POS/chunk-F6GAPEFT.js +1 -0
  91. package/POS/chunk-FBR7TAEJ.js +5 -0
  92. package/POS/chunk-FE5LZK5I.js +1 -0
  93. package/POS/chunk-FOEYBSQT.js +2 -0
  94. package/POS/chunk-FWVI7M5F.js +1 -0
  95. package/POS/chunk-G4DDQBH4.js +1 -0
  96. package/POS/chunk-GDFWXFK2.js +1 -0
  97. package/POS/chunk-GHQFOULJ.js +2 -0
  98. package/POS/chunk-GNSQPTDB.js +1 -0
  99. package/POS/chunk-GSLPZSSX.js +1 -0
  100. package/POS/chunk-GVXSG66Q.js +1 -0
  101. package/POS/chunk-H55AJAX5.js +8 -0
  102. package/POS/chunk-HIRUHGYD.js +2 -0
  103. package/POS/chunk-HKR2C3HA.js +1 -0
  104. package/POS/chunk-HSOC6U4B.js +1 -0
  105. package/POS/chunk-I6CGSFEU.js +1 -0
  106. package/POS/chunk-I6YPWC52.js +1 -0
  107. package/POS/chunk-IDDHFZWG.js +1 -0
  108. package/POS/chunk-IE5R6YWY.js +1 -0
  109. package/POS/chunk-IOQ3OION.js +1 -0
  110. package/POS/chunk-IUKSWU5B.js +1 -0
  111. package/POS/chunk-IY6EDHBT.js +1 -0
  112. package/POS/chunk-IZGPRDGN.js +2 -0
  113. package/POS/chunk-J3W6DQKW.js +1 -0
  114. package/POS/chunk-JLWKTGB2.js +1 -0
  115. package/POS/chunk-JM3SJLS7.js +1 -0
  116. package/POS/chunk-JNUC6PO5.js +1 -0
  117. package/POS/chunk-K5XVN3MT.js +1 -0
  118. package/POS/chunk-KBQ5ZM55.js +1 -0
  119. package/POS/chunk-KCNSCS4R.js +1 -0
  120. package/POS/chunk-KI2MQKDF.js +1 -0
  121. package/POS/chunk-KNRLGMUT.js +1 -0
  122. package/POS/chunk-KR4OPCRF.js +1 -0
  123. package/POS/chunk-KW4B7WMB.js +1 -0
  124. package/POS/chunk-KYX6U2UX.js +1 -0
  125. package/POS/chunk-KZNSGBGF.js +2 -0
  126. package/POS/chunk-L3UWNQXB.js +1 -0
  127. package/POS/chunk-LHWN2J4H.js +15 -0
  128. package/POS/chunk-LJUP6CCS.js +1 -0
  129. package/POS/chunk-LY4FOMQ6.css +1 -0
  130. package/POS/chunk-LZ3SKBTU.js +1 -0
  131. package/POS/chunk-M5ONTRWK.js +1 -0
  132. package/POS/chunk-MA7NEQCZ.js +1 -0
  133. package/POS/chunk-MDKYCLYA.js +17 -0
  134. package/POS/chunk-MGDA6GY6.js +1 -0
  135. package/POS/chunk-MWWGZRMN.js +1 -0
  136. package/POS/chunk-NCATMO6T.js +1 -0
  137. package/POS/chunk-NDAI7L23.js +1 -0
  138. package/POS/chunk-NHUK6IK5.js +40 -0
  139. package/POS/chunk-NUZ5K7GT.js +1 -0
  140. package/POS/chunk-O2PELRQA.js +1 -0
  141. package/POS/chunk-OUOP65JB.js +1 -0
  142. package/POS/chunk-OXSD6KML.js +1 -0
  143. package/POS/chunk-PEOMRJUI.js +3 -0
  144. package/POS/chunk-PHGK3EAU.js +1 -0
  145. package/POS/chunk-PLC4GZ67.js +1 -0
  146. package/POS/chunk-PTF6AQY6.js +1 -0
  147. package/POS/chunk-PTXKBWBA.js +1 -0
  148. package/POS/chunk-Q3SJOSAG.js +1 -0
  149. package/POS/chunk-QBDEGNJP.js +1 -0
  150. package/POS/chunk-QCTMAR3L.js +1 -0
  151. package/POS/chunk-QZWOQRAM.js +1 -0
  152. package/POS/chunk-R5VG3XDC.js +1 -0
  153. package/POS/chunk-R7NR3M2Q.js +1 -0
  154. package/POS/chunk-RBKYZOZX.js +3 -0
  155. package/POS/chunk-RHQGCHFI.js +1 -0
  156. package/POS/chunk-RL3GYZVU.js +8 -0
  157. package/POS/chunk-RRKCUSBB.js +1 -0
  158. package/POS/chunk-S4OLP2TR.js +18 -0
  159. package/POS/chunk-SDH32O74.js +1 -0
  160. package/POS/chunk-SE7OFLAL.js +1 -0
  161. package/POS/chunk-SEVYM4GA.js +1 -0
  162. package/POS/chunk-SGRJ5YG2.js +1 -0
  163. package/POS/chunk-SNNLFZQ3.js +3 -0
  164. package/POS/chunk-SVNOJVQF.js +1 -0
  165. package/POS/chunk-TCLYGBIP.js +1 -0
  166. package/POS/chunk-TIDDF777.js +1 -0
  167. package/POS/chunk-TJQIORGG.js +1 -0
  168. package/POS/chunk-TK5H65DN.js +1 -0
  169. package/POS/chunk-TLHNFDPP.js +1 -0
  170. package/POS/chunk-TVNDX4KA.js +3 -0
  171. package/POS/chunk-TX6G2LAN.js +1 -0
  172. package/POS/chunk-U3O6FO5X.js +1 -0
  173. package/POS/chunk-UJMXJABS.js +1 -0
  174. package/POS/chunk-UNGT7KQO.js +1 -0
  175. package/POS/chunk-UPRH3DLS.js +1 -0
  176. package/POS/chunk-UVFDCVT4.js +2 -0
  177. package/POS/chunk-V22EVF6N.js +1 -0
  178. package/POS/chunk-V4RKZMUB.js +11 -0
  179. package/POS/chunk-VBOV2ZGQ.js +1 -0
  180. package/POS/chunk-VGGNSOCP.js +1 -0
  181. package/POS/chunk-VLGOEX3D.js +24 -0
  182. package/POS/chunk-VPAQFQA7.js +1 -0
  183. package/POS/chunk-VSMYP4AC.js +1 -0
  184. package/POS/chunk-VXCP4DBC.js +1 -0
  185. package/POS/chunk-W43P2XHR.js +1 -0
  186. package/POS/chunk-W7PIRMKD.js +1 -0
  187. package/POS/chunk-WG6PV6VL.js +4 -0
  188. package/POS/chunk-WK4T26FX.js +2 -0
  189. package/POS/chunk-WKS7JIOA.js +1 -0
  190. package/POS/chunk-WKXE4B24.js +1 -0
  191. package/POS/chunk-WLRXTHLM.js +1 -0
  192. package/POS/chunk-WSZGVB3P.js +1 -0
  193. package/POS/chunk-WXHOQKTU.js +1 -0
  194. package/POS/chunk-X55EKFUZ.js +1 -0
  195. package/POS/chunk-X7QMXCEW.js +4 -0
  196. package/POS/chunk-XIGLLWLV.js +1 -0
  197. package/POS/chunk-XRKZOON6.js +4 -0
  198. package/POS/chunk-XW2QKXZF.js +5 -0
  199. package/POS/chunk-XZPCPUT7.js +1 -0
  200. package/POS/chunk-Y5SPDICN.js +2 -0
  201. package/POS/chunk-Y7XBMFXR.js +1 -0
  202. package/POS/chunk-YATUCULL.js +1 -0
  203. package/POS/chunk-YBFOOZH4.js +2 -0
  204. package/POS/chunk-YBINYTS7.js +1 -0
  205. package/POS/chunk-YE2HNBMX.js +1 -0
  206. package/POS/chunk-YENHZRM5.js +9 -0
  207. package/POS/chunk-YHCFOJEX.js +1 -0
  208. package/POS/chunk-YKBQYDEJ.js +2 -0
  209. package/POS/chunk-YPFXYXHP.js +8 -0
  210. package/POS/chunk-YRHYSRBM.js +1 -0
  211. package/POS/chunk-YRITVFOW.js +1 -0
  212. package/POS/chunk-YRNTUREW.js +1 -0
  213. package/POS/chunk-YXRRTX7W.js +1 -0
  214. package/POS/chunk-Z426RGUL.js +24 -0
  215. package/POS/chunk-ZB45Y55B.js +1 -0
  216. package/POS/chunk-ZGRVB4IB.js +1 -0
  217. package/POS/chunk-ZJ3TX62Q.js +1 -0
  218. package/POS/chunk-ZKWXTWYY.js +1 -0
  219. package/POS/index.html +33 -0
  220. package/POS/main-CNMNNNEI.js +4 -0
  221. package/POS/main-VPAR6OBK.css +1 -0
  222. package/POS/manifest.webmanifest +59 -0
  223. package/POS/media/color-727V6BA6.png +0 -0
  224. package/POS/media/hue-3YTJE6JS.png +0 -0
  225. package/POS/media/primeicons-4GST5W3O.woff2 +0 -0
  226. package/POS/media/primeicons-DHQU4SEP.svg +345 -0
  227. package/POS/media/primeicons-GEFHGEHP.ttf +0 -0
  228. package/POS/media/primeicons-P53SE5CV.woff +0 -0
  229. package/POS/media/primeicons-RSSEDYLY.eot +0 -0
  230. package/POS/polyfills-FHOOFFEX.js +2 -0
  231. package/POS/scripts-3E2G6IZ4.js +10 -0
  232. package/POS/styles-T7FPZRNG.css +25 -0
  233. package/Styles/Master/app_custom.css +18 -0
  234. package/Styles/Master/login_custom.css +0 -0
  235. package/Styles/Print/PaperSize8cm_custom.css +1 -0
  236. package/Styles/Print/PaperSizeA4_custom.css +1 -0
  237. package/StylesB/Master/app_custom.css +0 -0
  238. package/package.json +1 -0
@@ -0,0 +1,3 @@
1
+ import{a as Er}from"./chunk-QCTMAR3L.js";import{a as Mr}from"./chunk-BETKNHFK.js";import{a as Sn}from"./chunk-SEVYM4GA.js";import{a as br,b as Dr,c as Tr}from"./chunk-CRSUSQ3W.js";import{a as Pr}from"./chunk-CWU5DTSS.js";import{a as Ir}from"./chunk-YATUCULL.js";import{b as wr}from"./chunk-3A7KA4YN.js";import{a as Cn}from"./chunk-IDDHFZWG.js";import{d as tr}from"./chunk-3FOIEYAT.js";import"./chunk-CFIFFKWA.js";import"./chunk-OXSD6KML.js";import"./chunk-BHXS5IA6.js";import{a as Ve}from"./chunk-CW27R4N3.js";import{a as ar,b as sr,e as lr,f as mr,g as pr}from"./chunk-4BDQDYVB.js";import{H as or}from"./chunk-MDKYCLYA.js";import"./chunk-TK5H65DN.js";import"./chunk-F6GAPEFT.js";import"./chunk-6L6CIH5M.js";import"./chunk-PLC4GZ67.js";import{e as rr}from"./chunk-AVDGNFC7.js";import"./chunk-BYXBJQAS.js";import"./chunk-J3W6DQKW.js";import"./chunk-NUZ5K7GT.js";import"./chunk-NDAI7L23.js";import"./chunk-RL3GYZVU.js";import{a as Ki}from"./chunk-6PXJEE4K.js";import{a as xn}from"./chunk-UJMXJABS.js";import{a as gr,b as fr,c as hr,d as yr,e as Cr,f as xr}from"./chunk-F3ZYFWTM.js";import{a as vr}from"./chunk-GHQFOULJ.js";import{a as ur}from"./chunk-AYKDALBT.js";import{a as st}from"./chunk-LJUP6CCS.js";import"./chunk-KYX6U2UX.js";import"./chunk-MGDA6GY6.js";import{b as si}from"./chunk-ECMSF3OR.js";import{a as dr}from"./chunk-WXHOQKTU.js";import"./chunk-6BQZINLH.js";import"./chunk-SE7OFLAL.js";import"./chunk-KNRLGMUT.js";import{a as cr}from"./chunk-WLRXTHLM.js";import"./chunk-YENHZRM5.js";import"./chunk-LZ3SKBTU.js";import"./chunk-5W7F4VJH.js";import{g as nr}from"./chunk-GVXSG66Q.js";import"./chunk-IE5R6YWY.js";import{a as Xi,d as Ot,e as er}from"./chunk-XW2QKXZF.js";import{a as Sr}from"./chunk-B7RM5KKA.js";import"./chunk-IY6EDHBT.js";import"./chunk-B5FODXLM.js";import"./chunk-IOQ3OION.js";import"./chunk-C43IYFVU.js";import{b as _r}from"./chunk-YKBQYDEJ.js";import"./chunk-G4DDQBH4.js";import{a as Ui}from"./chunk-ZJ3TX62Q.js";import{b as ir}from"./chunk-CLL3TEL5.js";import{a as vn,b as jt}from"./chunk-VXCP4DBC.js";import"./chunk-EZCHVNC5.js";import"./chunk-7DWKYGA4.js";import"./chunk-64PDX5ZX.js";import{a as At}from"./chunk-AOJW6WJT.js";import"./chunk-APYNCJ2H.js";import"./chunk-BYXBJQAS.js";import{a as Or}from"./chunk-35V3VL6F.js";import"./chunk-CJO25BBP.js";import{a as Co,b as Li}from"./chunk-Z426RGUL.js";import{g as Mt}from"./chunk-PEOMRJUI.js";import"./chunk-TVNDX4KA.js";import"./chunk-U3O6FO5X.js";import"./chunk-AJMKP7YZ.js";import{a as at,b as Yi}from"./chunk-M5ONTRWK.js";import{a as $i,b as Le}from"./chunk-W7PIRMKD.js";import{d as hn,e as Zi}from"./chunk-Y5SPDICN.js";import{a as Qi,b as Ri,c as Bi}from"./chunk-7M6CWVRI.js";import{a as Pe}from"./chunk-YBINYTS7.js";import"./chunk-AA32I4UN.js";import"./chunk-Q3SJOSAG.js";import"./chunk-QZWOQRAM.js";import"./chunk-KI2MQKDF.js";import{a as Ji}from"./chunk-ZGRVB4IB.js";import{c as Wi,e as qi,g as Gi}from"./chunk-I6YPWC52.js";import{a as Pt,b as ke}from"./chunk-FBR7TAEJ.js";import{a as yn}from"./chunk-CPW6IWAB.js";import{g as re,h as fn}from"./chunk-XRKZOON6.js";import"./chunk-4CBDK52E.js";import{a as un,b as ie}from"./chunk-CBW7IA6S.js";import"./chunk-VPAQFQA7.js";import"./chunk-AOPKPEVH.js";import{K as Oe,N as wt,O as Et,h as Hi,i as _n,j as he,k as Te,l as bt,m as ne,o as we,p as Ee,q as ue}from"./chunk-V4RKZMUB.js";import{Aa as It,Ba as Fi,la as Ni}from"./chunk-2FKYC63K.js";import{O as gn,g as Tt}from"./chunk-2W3MAOOP.js";import"./chunk-AWGZKLLY.js";import"./chunk-DXF4M3Z6.js";import{a as zi,e as ce,f as Dt}from"./chunk-WK4T26FX.js";import"./chunk-BCVO66L3.js";import"./chunk-LHWN2J4H.js";import{a as se}from"./chunk-2FWFPV5I.js";import{B as St,C as rt,D as ot,b as ji,c as De,h as $,i as Ct,l as it,n as pe,r as ki,s as vt,t as xt}from"./chunk-4G26RHGA.js";import{a as Ai}from"./chunk-R7NR3M2Q.js";import{a as Vi}from"./chunk-MA7NEQCZ.js";import{a as N,c as ai,d as G}from"./chunk-26YXEYJK.js";import"./chunk-WG6PV6VL.js";import{a as A}from"./chunk-RRKCUSBB.js";import{$b as I,$c as Z,Ab as o,Bb as g,Ca as ge,Cb as H,Db as W,E as _e,Ea as on,Fa as an,Fb as v,Hc as cn,I as dt,Ib as f,J as bi,Kb as c,Ld as yt,Nd as je,Ob as Ei,Od as be,P as nn,Pa as F,Pc as tt,Qa as gt,Qd as Kt,Rc as J,Sa as Ue,Sb as ln,Sc as q,Sd as fe,Tb as mn,Ua as s,Ub as pn,Va as S,W as rn,Xc as ht,Yb as ee,Zb as l,Zc as nt,_ as X,_a as sn,_b as x,ac as $t,ba as ve,bb as z,cc as P,cd as Ie,d as xe,da as j,dc as D,eb as le,ec as T,fd as Mi,gb as _,gc as Q,ha as L,hc as te,ia as ut,ic as U,jc as ft,jd as Oi,k as en,ka as Di,la as h,mb as p,nb as Pi,o as tn,ob as ri,p as Si,pa as E,pb as Ti,qa as _t,qb as de,qc as C,qd as dn,rc as w,sc as V,t as Se,u as Ii,ub as me,vb as wi,wa as d,wb as oi,wc as R,xa as u,xb as Ze,yb as Ye,zb as a}from"./chunk-H55AJAX5.js";import{a as M,b as k,g as ii,j as Xt}from"./chunk-KW4B7WMB.js";var li=(t=>(t[t.AdjustDifferences=1]="AdjustDifferences",t[t.CountQuantity=2]="CountQuantity",t))(li||{});var mi=(n=>(n[n.Draft=1]="Draft",n[n.Pending=2]="Pending",n[n.Rejected=3]="Rejected",n[n.Accepted=4]="Accepted",n))(mi||{});var kr=()=>["/menu/Adjustment/Adjustment/Archive/Form"],Vt=i=>({ID:i}),Vr=()=>["/print/Adjustment"],Dn=(i,e)=>({"text-success":i,"text-danger":e}),vo=(i,e)=>({"text-danger":i,"text-success":e});function xo(i,e){if(i&1){let t=v();a(0,"div",7)(1,"button",25),f("click",function(){d(t);let n=c(2);return u(n.reject())}),g(2,"i",26),l(3,"Reject"),o(),a(4,"button",25),f("click",function(){d(t);let n=c(2);return u(n.accept())}),g(5,"i",27),l(6,"Accept "),o()()}}function So(i,e){if(i&1&&(a(0,"a",28),g(1,"i",29),l(2,"Resume "),o()),i&2){let t=c(3);p("routerLink",te(2,kr))("queryParams",U(3,Vt,t.data.ID))}}function Io(i,e){if(i&1){let t=v();a(0,"button",25),f("click",function(){d(t);let n=c(3);return u(n.onSubmit())}),g(1,"i",30),l(2,"Submit "),o()}}function bo(i,e){if(i&1&&_(0,So,3,5,"a",28)(1,Io,3,0,"button",8),i&2){let t=c(2);me(t.data.Adjustment.StateID==t.adjustmentState.Draft?0:-1),s(),me(t.data.Adjustment.StateID==t.adjustmentState.Draft?1:-1)}}function Do(i,e){if(i&1&&(a(0,"a",28),g(1,"i",29),l(2,"Edit "),o()),i&2){let t=c(3);p("routerLink",te(2,kr))("queryParams",U(3,Vt,t.data.ID))}}function Po(i,e){if(i&1&&_(0,Do,3,5,"a",28),i&2){let t=c(2);me(t.data.Adjustment.TypeID==t.adjustmentType.AdjustDifferences&&(t.data.Adjustment.StateID==t.adjustmentState.Pending||t.data.Adjustment.StateID==t.adjustmentState.Accepted)?0:-1)}}function To(i,e){if(i&1){let t=v();a(0,"button",25),f("click",function(){d(t);let n=c(2);return u(n.delete())}),g(1,"i",31),l(2,"Delete "),o()}}function wo(i,e){if(i&1&&(a(0,"tr")(1,"th"),l(2,"Journal Link"),o(),a(3,"td"),l(4,":"),o(),a(5,"td")(6,"a",32),l(7,"View Journal"),o()()()),i&2){let t=c(2);s(6),Ei("href","https://accounting.dealpos.app/pages/journal-entry;TransID=",t.data.ID,"",gt)}}function Eo(i,e){i&1&&(a(0,"div",38),g(1,"div",40),o())}function Mo(i,e){if(i&1&&(a(0,"div",10)(1,"div",34)(2,"h4"),l(3),C(4,"date"),o(),a(5,"p",35),l(6),C(7,"date"),o()(),a(8,"div",36),g(9,"i",37),_(10,Eo,2,0,"div",38),o(),a(11,"div",39)(12,"h4"),l(13),o(),a(14,"p",35),l(15),o()()()),i&2){let t=c(),r=t.$implicit,n=t.$index,m=c(2);s(3),x(V(4,7,r.Date,"dd MMM yyyy")),s(3),x(V(7,10,r.Date,"HH:mm a")),s(3),Pi("color",n==0?"blue":"black"),s(),me(n!=m.data.StatusProcess.length-1?10:-1),s(3),x(r.Status),s(2),x(r.Creator)}}function Oo(i,e){if(i&1&&_(0,Mo,16,13,"div",33),i&2){let t=e.$implicit;p("ngIf",t.Date)}}function Ao(i,e){if(i&1){let t=v();a(0,"a",60),f("click",function(){d(t);let n=c(3);return u(n.exportCSV(n.csvConverter,n.adjustmentTypeStatus!==-1&&n.adjustmentTypeStatus===1?"Adjustment/AdjustmentInfoExport":"Adjustment/AdjustmentCountedExport","Adjustment#"+n.data.Adjustment.Number+".csv"))}),g(1,"i",61),l(2,"Export"),o()}}function jo(i,e){i&1&&(H(0),a(1,"th",62),l(2,"Qty"),o(),W())}function ko(i,e){i&1&&(H(0),a(1,"th",62),l(2,"Counted"),o(),a(3,"th",62),l(4,"Expected"),o(),W())}function Vo(i,e){i&1&&(a(0,"th",62),l(1,"Expected"),o(),a(2,"th",62),l(3,"Counted"),o())}function No(i,e){if(i&1&&(_(0,ko,5,0,"ng-container",52)(1,Vo,4,0,"ng-template",null,3,R),a(3,"th",62),l(4,"Difference"),o()),i&2){let t=ee(2),r=c(3);p("ngIf",r.data.Adjustment.TypeID===2&&(r.data.Adjustment.StateID===1||r.data.Adjustment.StateID===2))("ngIfElse",t)}}function Fo(i,e){i&1&&(a(0,"th",63),l(1," Cost "),o())}function Uo(i,e){i&1&&(a(0,"th",63),l(1," Price "),o())}function Lo(i,e){if(i&1&&(H(0),g(1,"p",68),W()),i&2){let t=c().$implicit;s(),p("innerHTML",t.Note,F)}}function Qo(i,e){if(i&1&&(H(0),a(1,"td",69),l(2),o(),W()),i&2){let t=c().$implicit;s(),de(ft(3,Dn,t.Quantity>0,t.Quantity<0)),s(),I(" ",t.Quantity," ")}}function Ro(i,e){if(i&1&&(H(0),a(1,"td",69),l(2),o(),a(3,"td",69),l(4),o(),W()),i&2){let t=c(2).$implicit;s(2),I(" ",t.Counted," "),s(2),I(" ",t.Expected," ")}}function Bo(i,e){if(i&1&&(a(0,"td",69),l(1),o(),a(2,"td",69),l(3),o()),i&2){let t=c(2).$implicit;s(),I(" ",t.Expected," "),s(2),I(" ",t.Counted," ")}}function Ho(i,e){if(i&1&&(_(0,Ro,5,2,"ng-container",52)(1,Bo,4,2,"ng-template",null,3,R),a(3,"td",69),l(4),C(5,"number"),o()),i&2){let t=ee(2),r=c().$implicit,n=c(3);p("ngIf",n.data.Adjustment.TypeID===2&&(n.data.Adjustment.StateID===1||n.data.Adjustment.StateID===2))("ngIfElse",t),s(3),de(ft(7,vo,r.Expected>r.Counted,r.Expected<r.Counted)),s(),I(" ",w(5,5,r.Difference)," ")}}function Wo(i,e){if(i&1&&(g(0,"td",70),C(1,"number")),i&2){let t=c().$implicit;p("innerHTML",w(1,1,t.UnitCost),F)}}function qo(i,e){if(i&1&&(g(0,"td",70),C(1,"number")),i&2){let t=c().$implicit;p("innerHTML",w(1,1,t.UnitPrice),F)}}function Go(i,e){if(i&1&&(a(0,"tr"),g(1,"td",64),a(2,"td")(3,"a",65),l(4),o(),a(5,"div"),l(6),o(),g(7,"app-serial-note",66),_(8,Lo,2,1,"ng-container",21),o(),_(9,Qo,3,6,"ng-container",52)(10,Ho,6,10,"ng-template",null,4,R)(12,Wo,2,3,"td",67)(13,qo,2,3,"td",67),o()),i&2){let t=e.$implicit,r=e.index,n=ee(11),m=c(3);s(),p("innerHTML",r+1+".",F),s(2),p("queryParams",U(10,Vt,t.VariantID)),s(),x(t.Name),s(2),x(t.Code),s(),p("serials",t.Serial),s(),p("ngIf",t.Note!=null),s(),p("ngIf",m.data.Adjustment.TypeID==m.adjustmentType.AdjustDifferences||m.data.Adjustment.StateID==m.adjustmentState.Accepted&&m.data.Adjustment.TypeID==m.adjustmentType.CountQuantity)("ngIfElse",n),s(3),p("ngIf",m.roleService.product.Cost),s(),p("ngIf",m.roleService.sell.PriceVisible)}}function zo(i,e){if(i&1&&(a(0,"b"),C(1,"sum"),C(2,"sum"),l(3),C(4,"sum"),C(5,"number"),o()),i&2){let t=c(3);de(ft(14,Dn,V(1,3,t.data.DifferencesArray,"Quantity")>0,V(2,6,t.data.DifferencesArray,"Quantity")<0)),s(3),x(w(5,12,V(4,9,t.data.DifferencesArray,"Quantity")))}}function $o(i,e){if(i&1&&(a(0,"b",71),C(1,"sum"),C(2,"sum"),l(3),C(4,"sum"),C(5,"number"),o()),i&2){let t=c(3);p("ngClass",ft(13,Dn,V(1,2,t.data.DifferencesArray,"Difference")>0,V(2,5,t.data.DifferencesArray,"Difference")<0)),s(3),I(" ",w(5,11,V(4,8,t.data.DifferencesArray,"Difference"))," ")}}function Ko(i,e){if(i&1&&(a(0,"td",72)(1,"b"),l(2),C(3,"sum"),C(4,"number"),o()()),i&2){let t=c(3);s(2),x(w(4,4,V(3,1,t.data.DifferencesArray,"TotalCost")))}}function Jo(i,e){if(i&1&&(a(0,"td",73)(1,"b"),l(2),C(3,"sum"),C(4,"number"),o()()),i&2){let t=c(3);s(2),x(w(4,4,V(3,1,t.data.DifferencesArray,"TotalPrice")))}}function Zo(i,e){if(i&1&&(a(0,"div",12)(1,"div",41)(2,"div")(3,"h2"),l(4),a(5,"small",42),l(6),o()()(),a(7,"div",43)(8,"a",44),g(9,"i",45),l(10,"Print "),o(),_(11,Ao,3,0,"a",46),o()(),a(12,"div",18)(13,"div",47)(14,"table",48)(15,"thead",49)(16,"tr")(17,"th",50),l(18,"No"),o(),a(19,"th",51),l(20,"Name"),o(),_(21,jo,3,0,"ng-container",52)(22,No,5,2,"ng-template",null,1,R)(24,Fo,2,0,"th",53)(25,Uo,2,0,"th",53),o()(),a(26,"tbody"),_(27,Go,14,12,"tr",54),o(),a(28,"tfoot")(29,"tr")(30,"td",55)(31,"b"),l(32,"Total :"),o()(),a(33,"td",56),_(34,zo,6,17,"b",57)(35,$o,6,16,"ng-template",null,2,R),o(),_(37,Ko,5,6,"td",58)(38,Jo,5,6,"td",59),o()()()()()()),i&2){let t=ee(23),r=ee(36),n=c(2);s(4),I(" ",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity?"Adjusted":"Counted"," Inventory"),s(2),I(" (",n.data.DifferencesArray.length," SKU)"),s(2),p("routerLink",te(15,Vr))("queryParams",U(16,Vt,n.paramId)),s(3),p("ngIf",n.roleService.global.Export),s(10),p("ngIf",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity)("ngIfElse",t),s(3),p("ngIf",n.roleService.product.Cost),s(),p("ngIf",n.roleService.sell.PriceVisible),s(2),p("ngForOf",n.data.DifferencesArray),s(3),p("colSpan",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity?2:4),s(4),p("ngIf",n.data.Adjustment.TypeID==n.adjustmentType.AdjustDifferences||n.data.Adjustment.StateID==n.adjustmentState.Accepted&&n.data.Adjustment.TypeID==n.adjustmentType.CountQuantity)("ngIfElse",r),s(3),p("ngIf",n.roleService.product.Cost),s(),p("ngIf",n.roleService.sell.PriceVisible)}}function Yo(i,e){if(i&1&&(a(0,"h2"),l(1," Counted Inventory "),a(2,"small",42),l(3),o()()),i&2){let t=c(3);s(3),I("(",t.data.CountedArray.length," SKU)")}}function Xo(i,e){if(i&1){let t=v();a(0,"a",60),f("click",function(){d(t);let n=c(3);return u(n.exportCSV(n.csvConverter,"Adjustment/AdjustmentCountedExport","Adjustment_Counted#"+n.data.Adjustment.Number+".csv"))}),g(1,"i",61),l(2,"Export"),o()}}function ea(i,e){if(i&1&&(a(0,"tr"),g(1,"td",64),a(2,"td")(3,"a",65),l(4),o(),a(5,"div"),l(6),o()(),a(7,"td",69),l(8),o(),a(9,"td",69),l(10),o(),a(11,"td",69),l(12),o()()),i&2){let t=e.$implicit,r=e.index;s(),p("innerHTML",r+1+".",F),s(2),p("queryParams",U(9,Vt,t.VariantID)),s(),x(t.Name),s(2),x(t.Code),s(2),x(t.Counted),s(2),x(t.Expected),s(),de(ft(11,Dn,t.Difference>0,t.Difference<0)),s(),I(" ",t.Difference," ")}}function ta(i,e){if(i&1&&(a(0,"div",12)(1,"div",41)(2,"div"),_(3,Yo,4,1,"h2",21),o(),a(4,"div",43)(5,"a",44),g(6,"i",45),l(7,"Print "),o(),_(8,Xo,3,0,"a",46),o()(),a(9,"div",18)(10,"div",47)(11,"table",48)(12,"thead",49)(13,"tr")(14,"th",50),l(15,"No"),o(),a(16,"th",51),l(17,"Name"),o(),a(18,"th",74),l(19,"Counted"),o(),a(20,"th",74),l(21,"Expected"),o(),a(22,"th",74),l(23,"Difference"),o()()(),a(24,"tbody"),_(25,ea,13,14,"tr",54),o()()()()()),i&2){let t=c(2);s(3),p("ngIf",t.data.CountedArray.length>0&&t.data.Adjustment.TypeID==t.adjustmentState.Pending),s(2),p("routerLink",te(5,Vr))("queryParams",U(6,Vt,t.paramId)),s(3),p("ngIf",t.roleService.global.Export),s(17),p("ngForOf",t.data.CountedArray)}}function na(i,e){if(i&1&&(a(0,"mainpanel-cmp",6)(1,"actions"),_(2,xo,7,0,"div",7),a(3,"div",7),_(4,bo,2,2)(5,Po,1,1)(6,To,3,0,"button",8),o()(),a(7,"content")(8,"div",9)(9,"div",10)(10,"div",11)(11,"div",12)(12,"div",13)(13,"div",14),g(14,"h2",15,0),a(16,"div",16),g(17,"i",17),a(18,"span"),l(19),o()()()(),a(20,"div",18)(21,"table",19)(22,"tr")(23,"th"),l(24,"Date"),o(),a(25,"td"),l(26,":"),o(),g(27,"td",20),o(),a(28,"tr")(29,"th"),l(30,"PIC"),o(),a(31,"td"),l(32,":"),o(),g(33,"td",20),o(),a(34,"tr")(35,"th"),l(36,"Type"),o(),a(37,"td"),l(38,":"),o(),g(39,"td",20),o(),a(40,"tr")(41,"th"),l(42,"Note"),o(),a(43,"td"),l(44,":"),o(),g(45,"td",20),o(),_(46,wo,8,2,"tr",21),a(47,"tr")(48,"th"),l(49,"Tag"),o(),a(50,"td"),l(51,":"),o(),g(52,"td",20),o()()()(),a(53,"div")(54,"div",12)(55,"div",13)(56,"h2"),l(57,"Status"),o()(),a(58,"div",18),Ze(59,Oo,1,1,"div",10,wi),o()()()(),a(61,"div",22),_(62,Zo,39,18,"div",23)(63,ta,26,8,"div",23),o()(),g(64,"pos-footer-alert",24),o()()()),i&2){let t=ee(15),r=c();p("pageData",r.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),s(2),me(r.hasAccRejButton?2:-1),s(2),me(r.roleService.adjustment.Create?4:-1),s(),me(r.roleService.adjustment.Edit?5:-1),s(),me(r.roleService.adjustment.Delete?6:-1),s(8),p("matTooltip",t.classList.contains("text-truncate")?r.data.Adjustment.OutletName:"")("innerHTML",r.data.Adjustment.OutletName,F),s(2),p("ngClass",r.determineStatusClasses),s(),p("ngClass",r.getStatusIconClasses),s(2),x((r.data.Adjustment==null?null:r.data.Adjustment.StateLabel)||""),s(8),p("innerHTML",r.data.Adjustment.Date,F),s(6),p("innerHTML",r.data.Adjustment.PIC,F),s(6),p("innerHTML",r.data.Adjustment.TypeLabel,F),s(6),p("innerHTML",r.data.Adjustment.Note,F),s(),p("ngIf",r.data.AppsAccoutingActive&&r.roleService.accounting.View),s(6),p("innerHTML",r.data.Adjustment.TagName,F),s(7),Ye(r.data.StatusProcess),s(3),p("ngIf",r.data.DifferencesArray.length>0),s(),p("ngIf",(r.data.CountedArray==null?null:r.data.CountedArray.length)>0&&r.data.Adjustment.TypeID==r.adjustmentState.Pending),s(),p("created",r.data.CreatedInfo.Created)("modified",r.data.CreatedInfo.Modified)}}var In=class i extends Pe{constructor(t,r,n,m,y,b,oe,Y){super(t,r,"Adjustment/AuditInventoryAdjustmentInfo",null,null,m);this.httpService=r;this.toastr=n;this.csvConverter=y;this.router=b;this.roleService=oe;this.dialog=Y;this.initQueryParam()}paramId;hasAccRejButton=!1;isEditable=!1;adjustmentType=li;adjustmentState=mi;preGetList(){let t=this.route.snapshot.queryParams;this.pageData.Filter=t}initQueryParam(){let t=this.route.snapshot.queryParams;this.paramId=t.ID}postInit(t){this.menuData.H=t.PageTitle,t.Adjustment.StateID==2&&this.roleService.adjustment.Approval&&t.Config.WithApproval?this.hasAccRejButton=!0:this.hasAccRejButton=!1,(this.data.Adjustment.StateID==1||this.data.Adjustment.StateID==2)&&(this.isEditable=!0)}exportCSV(t,r,n){this.httpService.get(`/api/${r}`,[{key:"ID",value:this.paramId}]).subscribe(m=>{t.convertToCSV(m,n)})}reject(){if(!confirm("Are you sure you want to reject this?"))return;let t={ID:this.data.Adjustment.ID};this.httpService.post("/API/Adjustment/RejectCountedItem",t).subscribe({next:r=>{this.toastr.success("Success reject adjustment",se.Success),this.hasAccRejButton=!1,this.isEditable=!1,this.getListData()}})}accept(){if(!confirm("Are you sure you want to accept this?"))return;let t={ID:this.data.Adjustment.ID};this.httpService.post("/API/Adjustment/AcceptCountedItem",t).subscribe({next:r=>{this.toastr.success("Success accept adjustment",se.Success),this.hasAccRejButton=!1,this.isEditable=!1,this.getListData()}})}delete(){confirm("Are you sure you want to delete this?")&&this.httpService.delete("/api/Adjustment/DeleteInventoryAdjustmentInfo",{params:[{key:"ID",value:this.data.Adjustment.ID}]}).subscribe(()=>{this.toastr.success("Success delete record.",se.Success),this.router.navigate(["/menu/Adjustment/Adjustment/Archive"])})}get determineStatusClasses(){let t=this.data?.Adjustment?.StateLabel;return t?{"bg-draft":t.includes("Draft"),"bg-in-review":t.includes("Pending"),"bg-rejected":t.includes("Rejected"),"bg-accepted":t.includes("Accepted")}:{"bg-draft":!1,"bg-in-review":!1,"bg-rejected":!1,"bg-accepted":!1}}get getStatusIconClasses(){let t=this.data?.Adjustment?.StateLabel;return t?{"fa-check":t.includes("Accepted"),"fa-bookmark":t.includes("Draft"),"fa-hourglass-start":t.includes("Pending"),"fa-xmark":t.includes("Rejected")}:{"fa-check":!1,"fa-bookmark":!1,"fa-hourglass-start":!1,"fa-xmark":!1}}onSubmit(){this.dialog.open(Er,{data:{title:"Submit Review",message:`
2
+ <h4>Are you sure you want to Change status to pending review?</h4>
3
+ `,headerType:se.Warning}}).afterClosed().pipe(_e(t=>t===!0),X(()=>this.httpService.post(Oe.AdjusmentSubmitReview,{ID:this.data.Adjustment.ID}))).subscribe(t=>{this.toastr.success(t.Message,se.Success),this.getListData()})}get adjustmentTypeStatus(){return this.data?this.data.Adjustment.TypeID==this.adjustmentType.AdjustDifferences||this.data.Adjustment.StateID==this.adjustmentState.Accepted&&this.data.Adjustment.TypeID==this.adjustmentType.CountQuantity?1:2:-1}static \u0275fac=function(r){return new(r||i)(S(ie),S(A),S(fe),S(yt),S(Ve),S(je),S(G),S(ne))};static \u0275cmp=E({type:i,selectors:[["POS-adjustment-info"]],features:[le],decls:1,vars:1,consts:[["outletName",""],["NOTACC",""],["COUNTEDTOTAL",""],["ELSE_BLOCK",""],["NOTACCDATA",""],[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"btn-group","me-4"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-4"],[1,"card"],[1,"card-header"],[1,"d-flex","gap-4"],[1,"text-truncate",3,"matTooltip","innerHTML"],[1,"badge","rounded-pill","d-flex","align-items-center","gap-3","fs-6",3,"ngClass"],[1,"fa-solid",3,"ngClass"],[1,"card-body"],[1,"table-sm","table-borderless"],[3,"innerHTML"],[4,"ngIf"],[1,"col-sm-8"],["class","card",4,"ngIf"],[3,"created","modified"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-thumbs-down","me-3"],[1,"fa-solid","fa-thumbs-up","me-3"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-pen-to-square","me-3"],[1,"fa-solid","fa-floppy-disk","me-3"],[1,"fa-solid","fa-trash","me-3"],[3,"href"],["class","row",4,"ngIf"],[1,"col","text-end"],[1,"mt-3"],[1,"col-3","text-center","position-relative"],[1,"fa-solid","fa-angle-up","current-status-icon"],[1,"d-flex","justify-content-center","h-100"],[1,"col-5"],[1,"timeline"],[1,"card-header","d-flex","justify-content-between"],[1,"fst-italic","fs-6"],[1,"btn-group"],["target","_blank",1,"btn","btn-outline-secondary","btn-sm",3,"routerLink","queryParams"],[1,"fa-solid","fa-print","me-3"],["class","btn btn-outline-secondary btn-sm","role","button",3,"click",4,"ngIf"],[1,"table-responsive"],[1,"table"],[1,"thead-light"],[1,"text-center",2,"width","1px"],[2,"width","300px"],[4,"ngIf","ngIfElse"],["class","text-end","style","width: 120px",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"text-end","empty-column",3,"colSpan"],[1,"text-end","empty-column"],[3,"class",4,"ngIf","ngIfElse"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Cost",4,"ngIf"],["class","text-end empty-column","matTooltipPosition","above","matTooltip","Total from Quantity x Price",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary","btn-sm",3,"click"],[1,"fa-solid","fa-upload","me-3"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","120px"],[1,"text-center",3,"innerHTML"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[3,"serials"],["class","text-end",3,"innerHTML",4,"ngIf"],[1,"special-TinyMCE","fst-italic","text-warning","mb-0",2,"word-break","break-all",3,"innerHTML"],[1,"text-end"],[1,"text-end",3,"innerHTML"],[3,"ngClass"],["matTooltipPosition","above","matTooltip","Total from Quantity x Cost",1,"text-end","empty-column"],["matTooltipPosition","above","matTooltip","Total from Quantity x Price",1,"text-end","empty-column"],[1,"text-end",2,"width","100px"]],template:function(r,n){r&1&&_(0,na,65,22,"mainpanel-cmp",5),r&2&&p("ngIf",n.data)},dependencies:[tt,J,q,be,re,It,At,Sn,Z,nt,Tt],styles:[".current-status-icon[_ngcontent-%COMP%]{background-color:#fff;border-radius:50%;box-shadow:0 2px #b8b8b8;width:35px;height:35px;font-size:35px}.timeline[_ngcontent-%COMP%]{border-left:3px solid #e1e1e1;height:100%;width:0px}.bg-draft[_ngcontent-%COMP%]{background-color:#ffa72a!important}.bg-in-review[_ngcontent-%COMP%]{background-color:#7e7e7e!important}.bg-rejected[_ngcontent-%COMP%]{background-color:#ff382e!important}.bg-accepted[_ngcontent-%COMP%]{background-color:#2fad1a!important}"]})};var ra=()=>["/menu/Adjustment/Adjustment/Archive/Form"],oa=()=>["/menu/Adjustment/Adjustment/Archive/Info"],aa=i=>({ID:i}),sa=i=>({"text-success":i}),la=i=>({"text-danger":i});function ma(i,e){if(i&1){let t=v();a(0,"a",21),f("click",function(){d(t);let n=c(2);return u(n.httpPostListID("Adjustment/DeleteInventoryAdjustmentList"))}),g(1,"i",22),l(2,"Delete "),o()}}function pa(i,e){if(i&1){let t=v();a(0,"button",23),f("click",function(){d(t);let n=c(2);return u(n.openExportModal())}),g(1,"i",24),l(2," Export "),o()}}function ca(i,e){i&1&&(a(0,"a",25),l(1,"New"),o()),i&2&&p("routerLink",te(1,ra))}function da(i,e){if(i&1){let t=v();a(0,"div")(1,"div",26)(2,"h6"),l(3,"Outlet"),o(),a(4,"ng-select",27),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.EntityID,n)||(m.pageData.Filter.EntityID=n),u(n)}),o(),a(5,"h6"),l(6,"Date From - To"),o(),a(7,"div",28)(8,"div",29)(9,"datepicker",30),T("dateChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.From,n)||(m.pageData.Filter.From=n),u(n)}),o()(),a(10,"div",31)(11,"datepicker",32),T("dateChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.To,n)||(m.pageData.Filter.To=n),u(n)}),o()()(),a(12,"h6"),l(13,"Quantity From - To"),o(),a(14,"div",33)(15,"input",34),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.QuantityFrom,n)||(m.pageData.Filter.QuantityFrom=n),u(n)}),o(),l(16," - "),a(17,"input",34),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.QuantityTo,n)||(m.pageData.Filter.QuantityTo=n),u(n)}),o()(),a(18,"h6"),l(19,"State"),o(),a(20,"ng-select",35),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.State,n)||(m.pageData.Filter.State=n),u(n)}),o(),a(21,"h6"),l(22,"Adjustment Type"),o(),a(23,"ng-select",36),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.Type,n)||(m.pageData.Filter.Type=n),u(n)}),o(),a(24,"h6"),l(25,"Adjustment Tag"),o(),a(26,"ng-select",37),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.TagID,n)||(m.pageData.Filter.TagID=n),u(n)}),o(),a(27,"h6"),l(28,"Rows"),o(),a(29,"input",38),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.RowCount,n)||(m.pageData.Filter.RowCount=n),u(n)}),o(),a(30,"h6"),l(31,"Exclude Zero"),o(),a(32,"radio-options",39),T("modelChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.ExcludeZero,n)||(m.pageData.Filter.ExcludeZero=n),u(n)}),o()()()}if(i&2){let t=c(2);s(4),p("items",t.pageData.Options.Entities),P("ngModel",t.pageData.Filter.EntityID),s(5),p("isFloatingLabel",!1),P("date",t.pageData.Filter.From),s(2),p("isFloatingLabel",!1),P("date",t.pageData.Filter.To),s(4),P("ngModel",t.pageData.Filter.QuantityFrom),s(2),P("ngModel",t.pageData.Filter.QuantityTo),s(3),p("items",t.pageData.Options.States),P("ngModel",t.pageData.Filter.State),s(3),p("items",t.pageData.Options.Types),P("ngModel",t.pageData.Filter.Type),s(3),p("items",t.pageData.Options.AdjustmentTagsOptions),P("ngModel",t.pageData.Filter.TagID),s(3),P("ngModel",t.pageData.Filter.RowCount),p("max",1e4),s(3),P("model",t.pageData.Filter.ExcludeZero)}}function ua(i,e){if(i&1){let t=v();a(0,"th",40)(1,"input",41),f("change",function(n){d(t);let m=c(2);return u(m.onSelectAllData(n.target.checked))}),o()()}}function _a(i,e){i&1&&(a(0,"th",18),l(1,"Cost"),o())}function ga(i,e){if(i&1){let t=v();a(0,"td")(1,"input",48),T("ngModelChange",function(n){d(t);let m=c().$implicit;return D(m.selected,n)||(m.selected=n),u(n)}),o()()}if(i&2){let t=c().$implicit;s(),P("ngModel",t.selected)}}function fa(i,e){if(i&1&&(a(0,"td",45),l(1),C(2,"quantityFraction"),o()),i&2){let t=c().$implicit;s(),I(" ",w(2,1,t.Quantity)," ")}}function ha(i,e){if(i&1&&(a(0,"td",45),l(1),C(2,"quantityFraction"),o()),i&2){let t=c().$implicit;de(U(5,sa,t.Quantity>0)),s(),I(" +",w(2,3,t.Quantity)," ")}}function ya(i,e){if(i&1&&(a(0,"td",45),l(1),C(2,"quantityFraction"),o()),i&2){let t=c().$implicit;de(U(5,la,t.Quantity<0)),s(),I(" ",w(2,3,t.Quantity)," ")}}function Ca(i,e){if(i&1&&(a(0,"td",45),l(1),C(2,"amountFraction"),o()),i&2){let t=c().$implicit;s(),x(w(2,1,t.Cost))}}function va(i,e){if(i&1&&(a(0,"tr",42),_(1,ga,2,1,"td",43),a(2,"td"),l(3),o(),a(4,"td")(5,"a",44),l(6),o()(),a(7,"td"),l(8),C(9,"date"),o(),a(10,"td",45),l(11),C(12,"number"),o(),_(13,fa,3,3,"td",46)(14,ha,3,7,"td",47)(15,ya,3,7,"td",47),a(16,"td"),l(17),o(),_(18,Ca,3,3,"td",45),a(19,"td"),l(20),o(),a(21,"td"),l(22),o()()),i&2){let t=e.$implicit,r=c(2);s(),p("ngIf",r.roleService.adjustment.Delete),s(2),x(t.EntityName),s(2),p("routerLink",te(21,oa))("queryParams",U(22,aa,t.ID)),s(),x(t.Number),s(2),x(V(9,16,t.Date,"dd MMM yyyy")),s(3),x(w(12,19,t.SKUCount)),s(2),p("ngIf",t.Quantity==0),s(),p("ngIf",t.Quantity>0),s(),p("ngIf",t.Quantity<0),s(2),x(t.TypeLabel),s(),me(!(r.roleService==null||r.roleService.product==null)&&r.roleService.product.Cost?18:-1),s(),Ti(r.stateColored(+t.StateID)),s(),I(" ",t.StateLabel," "),s(2),x(t.Note)}}function xa(i,e){if(i&1){let t=v();a(0,"mainpanel-cmp",2),T("textChange",function(n){d(t);let m=c();return D(m.pageData.Filter.Number,n)||(m.pageData.Filter.Number=n),u(n)}),f("onSubmit",function(){d(t);let n=c();return u(n.searchFromPageOne())}),T("filterChange",function(n){d(t);let m=c();return D(m.pageData.Filter,n)||(m.pageData.Filter=n),u(n)}),a(1,"actions")(2,"a",3),g(3,"i",4),l(4,"Download Scanner App "),o(),_(5,ma,3,0,"a",5)(6,pa,3,0,"button",6)(7,ca,2,2,"a",7),o(),a(8,"filters"),_(9,da,33,17,"ng-template",null,0,R),o(),a(11,"content")(12,"div",8)(13,"div",9)(14,"table",10)(15,"thead",11)(16,"tr"),_(17,ua,2,0,"th",12),a(18,"th",13),l(19,"Outlet"),o(),a(20,"th",13),l(21,"Number"),o(),a(22,"th",14),l(23,"Date"),o(),a(24,"th",15),l(25,"SKU"),o(),a(26,"th",16),l(27," Qty "),o(),a(28,"th",17),l(29,"Type"),o(),_(30,_a,2,0,"th",18),a(31,"th",14),l(32,"State"),o(),a(33,"th"),l(34,"Note"),o()()(),a(35,"tbody"),_(36,va,23,24,"tr",19),o()()(),a(37,"POS-complex-pagination",20),f("jumpToPage",function(){d(t);let n=c();return u(n.getListData())})("previousPage",function(){d(t);let n=c();return u(n.getListData())})("nextPage",function(){d(t);let n=c();return u(n.getListData())}),o()()()()}if(i&2){let t=c();p("pageData",t.menuData),P("text",t.pageData.Filter.Number),p("isFilterOnDropdown",!1),P("filter",t.pageData.Filter),s(5),p("ngIf",t.getSelectedData().length>0),s(),p("ngIf",t.roleService.global.Export),s(),p("ngIf",t.roleService.adjustment.Create),s(10),p("ngIf",t.roleService.adjustment.Delete),s(13),me(!(t.roleService==null||t.roleService.product==null)&&t.roleService.product.Cost?30:-1),s(6),p("ngForOf",t.data.Data),s(),p("total",t.data.Data.length)("pageData",t.pageData)}}var Pn=class i extends Pe{constructor(t,r,n,m,y,b){super(t,r,"Adjustment/GetInventoryAdjustmentList","AdjustmentLoader/GetInventoryAdjustmentList",n);this.toastr=n;this.csvConverter=m;this.roleService=y;this.matDialog=b}hideMore=!1;openExportModal(){this.matDialog.open(Le,{data:{title:"Inventory Adjustment",exportTypes:[{ID:"AdjustmentExport/GetInventoryAdjustmentList",Value:"Default",FileName:"Inventory Adjustment"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/GetInventoryAdjustmentListCount",pagination:!0}})}stateColored(t){switch(t){case 1:return{color:"#FFA72A"};case 2:return{color:"#7E7E7E"};case 3:return{color:"#FF382E"};case 4:return{color:"#2FAD1A"}}}static \u0275fac=function(r){return new(r||i)(S(ie),S(A),S(fe),S(Ve),S(G),S(ne))};static \u0275cmp=E({type:i,selectors:[["POS-inventory-adjustment"]],features:[le],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["href","https://www.dealpos.co.id/tour/scanner","target","_blank",1,"btn","btn-outline-secondary","me-3"],[1,"fa-solid","fa-scanner","me-3"],["class","btn btn-outline-secondary me-5",3,"click",4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["class","button btn btn-success",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],["style","width: 14px",4,"ngIf"],[2,"width","120px"],[2,"width","100px"],[1,"text-end",2,"width","55px"],["matTooltipPosition","above","matTooltip","Adjusted Quantity",1,"text-end",2,"width","50px"],[2,"width","130px"],[1,"text-end",2,"width","95px"],["class","border-bottom",4,"ngFor","ngForOf"],["api","Adjustment/GetInventoryAdjustmentListCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-5",3,"click"],[1,"fa-solid","fa-trash","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"button","btn","btn-success",3,"routerLink"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModelChange","items","ngModel"],[1,"row"],[1,"col-6","pe-2"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"col-6","ps-2"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"d-flex","align-items-center",2,"column-gap","8px"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an State",3,"ngModelChange","items","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","Choose an Type",3,"ngModelChange","items","ngModel"],["bindLabel","Name","bindValue","ID","placeholder","Choose an Tags",3,"ngModelChange","items","ngModel"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","ngModel","max"],[3,"modelChange","model"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"border-bottom"],[4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end"],["class","text-end",4,"ngIf"],["class","text-end",3,"class",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(r,n){r&1&&_(0,xa,38,12,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[J,q,be,re,De,ji,$,pe,Ot,ce,at,hn,ke,It,Z,nt,Ki,Ji]})};var Tn=class i{config;dialogRef=h(Te);data=h(bt);filterKeys=["From","To","PageNumber","RowCount","EntityID","TagID"];httpService=h(A);summaryData=z(null);constructor(){this.config=new we,this.config.title="Total Adjustment Summary",this.config.hideFooter=!0,this.config.customWidth="382px"}ngOnInit(){console.log("DialogAdjustmentSummaryComponent",this.data.pageData),console.log("data",this.data);let e=Object.entries(this.data.pageData).filter(([r,n])=>this.filterKeys.includes(r)).map(([r,n])=>{if(r==="From"||r==="To"){let m=new Date(n);return{[r]:new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit"}).format(m).replace(/(\d{4})\/(\d{2})\/(\d{2})/,"$1-$2-$3")+"T00:00:00.000"}}return{[r]:n}}),t=e.reduce((r,n)=>M(M({},r),n),{});this.httpService.post("api/Adjustment/AuditAdjustmentSumReport",t).pipe(Se(r=>r.Data),j(r=>this.summaryData.set(r))).subscribe(),console.log("tdf",e)}onOK(){}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["pos-dialog-adjustment-summary"]],standalone:!0,features:[Q],decls:29,vars:13,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid"],[1,"table","table-bordered"],[1,"py-2",2,"width","40%"],[1,"text-end","py-2"]],template:function(t,r){t&1&&(a(0,"modal-material",0),f("onCancel",function(){return r.dialogRef.close()})("onClose",function(){return r.dialogRef.close()}),a(1,"content")(2,"div",1)(3,"table",2)(4,"tbody")(5,"tr")(6,"th",3),l(7,"Quantity"),o(),a(8,"td",4),l(9),C(10,"number"),o()(),a(11,"tr")(12,"th",3),l(13,"Weight"),o(),a(14,"td",4),l(15),C(16,"number"),o()(),a(17,"tr")(18,"th",3),l(19,"Total Cost"),o(),a(20,"td",4),l(21),C(22,"number"),o()(),a(23,"tr")(24,"th",3),l(25,"Total Price"),o(),a(26,"td",4),l(27),C(28,"number"),o()()()()()()()),t&2&&(p("config",r.config),s(9),I(" ",w(10,5,r.summaryData().Quantity)," "),s(6),I(" ",w(16,7,r.summaryData().Weight)," "),s(6),I(" ",w(22,9,r.summaryData().TotalCost)," "),s(6),I(" ",w(28,11,r.summaryData().TotalPrice)," "))},dependencies:[ue,Ee,Ie,Z],changeDetection:0})};var Sa=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Ia=i=>({ID:i});function ba(i,e){if(i&1){let t=v();a(0,"button",4),f("click",function(){d(t);let n=c();return u(n.openExportModal())}),g(1,"i",5),l(2," Export "),o()}}function Da(i,e){if(i&1){let t=v();a(0,"div",6)(1,"h6"),l(2,"Outlets"),o(),a(3,"outlet-selector",7),T("ngModelChange",function(n){d(t);let m=c();return D(m.pageData.Filter.EntityID,n)||(m.pageData.Filter.EntityID=n),u(n)}),o(),a(4,"h6"),l(5,"From"),o(),a(6,"datepicker",8),T("dateChange",function(n){d(t);let m=c();return D(m.pageData.Filter.From,n)||(m.pageData.Filter.From=n),u(n)}),o(),a(7,"h6"),l(8,"To"),o(),a(9,"datepicker",9),T("dateChange",function(n){d(t);let m=c();return D(m.pageData.Filter.To,n)||(m.pageData.Filter.To=n),u(n)}),o(),a(10,"h6"),l(11,"Adjustment Tag"),o(),a(12,"ng-select",10),T("ngModelChange",function(n){d(t);let m=c();return D(m.pageData.Filter.TagID,n)||(m.pageData.Filter.TagID=n),u(n)}),o()()}if(i&2){let t=c();s(3),p("accessType",2),P("ngModel",t.pageData.Filter.EntityID),p("multiple",!1),s(3),p("isFloatingLabel",!1),P("date",t.pageData.Filter.From),s(3),p("isFloatingLabel",!1),P("date",t.pageData.Filter.To),s(3),p("items",t.pageData.Options.AdjustmentTagsOptions),P("ngModel",t.pageData.Filter.TagID)}}function Pa(i,e){i&1&&(a(0,"th",22),l(1," @ Cost "),o())}function Ta(i,e){i&1&&(a(0,"th",22),l(1," @ Price "),o())}function wa(i,e){if(i&1&&(a(0,"th",36),l(1),C(2,"number"),o()),i&2){let t=c().$implicit;s(),I(" ",w(2,1,t.UnitCost)," ")}}function Ea(i,e){if(i&1&&(a(0,"th",36),l(1),C(2,"number"),o()),i&2){let t=c().$implicit;s(),I(" ",w(2,1,t.UnitPrice)," ")}}function Ma(i,e){if(i&1&&(a(0,"tr")(1,"th",32),l(2),o(),a(3,"th",33),l(4),o(),a(5,"th",34),l(6),C(7,"number"),o(),_(8,wa,3,3,"th",35)(9,Ea,3,3,"th",35),o()),i&2){let t=e.$implicit,r=c(3);s(2),I(" ",t.VariantName," "),s(2),I(" ",t.VariantCode," "),s(2),I(" ",w(7,5,t.Quantity)," "),s(2),p("ngIf",r.roleService.product.Cost),s(),p("ngIf",r.roleService.sell.UnitPriceEditor)}}function Oa(i,e){if(i&1&&(a(0,"div")(1,"div",23)(2,"div",24)(3,"a",25),g(4,"span",26),C(5,"date"),g(6,"small",27),C(7,"date"),a(8,"small",28),l(9),o()()()(),a(10,"div")(11,"strong",29),l(12),o(),g(13,"div",30),o(),a(14,"table",31)(15,"tbody"),_(16,Ma,10,7,"tr",18),o()()()),i&2){let t=e.$implicit;s(3),p("routerLink",te(14,Sa))("queryParams",U(15,Ia,t.ID)),s(),p("innerHTML",t.EntityName+" #"+t.Number+" - "+V(5,8,t.Created,"dd MMM yyyy"),F),s(2),p("innerHTML","("+V(7,11,t.Created,"HH:mm")+")",F),s(3),I(" ",t.PIC,""),s(3),I("[Q:",t.Quantity,"]"),s(),p("innerHTML",t.Note,F),s(3),p("ngForOf",t.Items)}}function Aa(i,e){if(i&1){let t=v();a(0,"div",11)(1,"table",12)(2,"thead",13)(3,"tr")(4,"th",14),l(5,"Name"),o(),a(6,"th",15),l(7,"Code"),o(),a(8,"th",16),l(9,"Qty"),o(),_(10,Pa,2,0,"th",17)(11,Ta,2,0,"th",17),o()()(),_(12,Oa,17,17,"div",18),a(13,"div",19)(14,"button",20),f("click",function(){d(t);let n=c();return u(n.onDialogSummary())}),l(15," View Adjustment Summary "),o()(),a(16,"POS-complex-pagination",21),f("jumpToPage",function(){d(t);let n=c();return u(n.getListData())})("previousPage",function(){d(t);let n=c();return u(n.getListData())})("nextPage",function(){d(t);let n=c();return u(n.getListData())}),o()()}if(i&2){let t=c();s(10),p("ngIf",t.roleService.product.Cost),s(),p("ngIf",t.roleService.sell.UnitPriceEditor),s(),p("ngForOf",t.data.Data),s(4),p("total",t.data.Data.length)("pageData",t.pageData)}}var wn=class i extends Pe{constructor(t,r,n,m,y){super(t,r,"Adjustment/AuditAdjustmentReport","AdjustmentLoader/AuditAdjustmentReport",void 0,void 0,!0);this.httpService=r;this.csvConverter=n;this.roleService=m;this.matDialog=y}dataEndpoint="/api/Adjustment/AuditAdjustmentReport";loaderEndpoint="/api/AdjustmentLoader/AuditAdjustmentReport";countEndpoint="/api/Adjustment/AuditAdjustmentReportCount";data$;loader$;loader;onOpenExportDialog(t){}openExportModal(){this.matDialog.open(Le,{data:{title:"Adjustment Report",exportTypes:[{ID:"AdjustmentExport/AuditAdjustmentReport",Value:"Default",FileName:"Adjustment Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Adjustment/AuditAdjustmentReportCount",pagination:!0}})}preInitList(){super.preInitList();let t=this.pageData.Options.AdjustmentTagsOptions.findIndex(r=>r.ID===this.pageData.Filter.TagID);this.pageData=k(M({},this.pageData),{Filter:k(M({},this.pageData.Filter),{TagID:t!==-1?this.pageData.Filter.TagID:null})})}onDialogSummary(){this.matDialog.open(Tn,{data:{pageData:this.pageData.Filter}})}static \u0275fac=function(r){return new(r||i)(S(ie),S(A),S(Ve),S(G),S(ne))};static \u0275cmp=E({type:i,selectors:[["POS-adjustment-reports"]],features:[le],decls:8,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","Choose a tag","bindLabel","Name","bindValue","ID","appendTo","body",3,"ngModelChange","items","ngModel"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","w-100"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[1,"text-end",2,"width","60px"],[1,"text-end",2,"width","50px"],["class","text-end","style","width: 80px",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"d-flex","justify-content-center","w-100","my-6"],["type","button",1,"btn","btn-outline-primary",3,"click"],["api","Adjustment/AuditAdjustmentReportCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"text-end",2,"width","80px"],[1,"d-lg-flex","mt-sm-0"],[1,"mt-5","ms-3"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHTML"],[1,"fst-italic","text-dark",3,"innerHTML"],[1,"fst-italic","text-dark"],[1,"text-danger","ms-3"],[3,"innerHTML"],[1,"table","table-bordered"],[1,"fw-normal",2,"width","645px","word-break","break-all"],[1,"fw-normal","text-end",2,"width","60px","word-break","break-all"],[1,"fw-normal","text-end",2,"width","50px"],["class","fw-normal text-end","style","width: 80px",4,"ngIf"],[1,"fw-normal","text-end",2,"width","80px"]],template:function(r,n){if(r&1){let m=v();a(0,"mainpanel-cmp",1),T("textChange",function(b){return d(m),D(n.pageData.Filter.Number,b)||(n.pageData.Filter.Number=b),u(b)}),f("onSubmit",function(){return d(m),u(n.searchFromPageOne())}),T("filterChange",function(b){return d(m),D(n.pageData.Filter,b)||(n.pageData.Filter=b),u(b)}),a(1,"actions"),_(2,ba,3,0,"button",2),o(),a(3,"filters"),_(4,Da,13,9,"ng-template",null,0,R),o(),a(6,"content"),_(7,Aa,17,5,"div",3),o()()}r&2&&(p("pageData",n.menuData),P("text",n.pageData.Filter.Number),p("isFilterOnDropdown",!1),P("filter",n.pageData.Filter),s(2),p("ngIf",n.roleService.global.Export),s(5),p("ngIf",n.data&&n.data.Data))},dependencies:[J,q,be,re,$,pe,Ot,ce,at,yn,Z,nt]})};var ja=i=>({show:i});function ka(i,e){if(i&1){let t=v();a(0,"button",25),f("click",function(){d(t);let n=c(2);return u(n.ok())}),l(1,"Upload"),o()}}function Va(i,e){if(i&1){let t=v();a(0,"button",25),f("click",function(){d(t);let n=c(2);return u(n.confirmAdjustment())}),l(1,"Confirm Adjustment"),o()}}function Na(i,e){if(i&1&&(a(0,"div",26),l(1),C(2,"limitText"),o()),i&2){let t=e.item;p("title",(t==null||t.Name==null?null:t.Name.length)>23?t.Name:""),s(),I(" ",V(2,2,t.Name,25)," ")}}function Fa(i,e){if(i&1){let t=v();a(0,"div",27)(1,"button",28),g(2,"i",29),l(3," Download Current Inventory "),o(),a(4,"ul",30)(5,"li")(6,"a",31),f("click",function(){d(t);let n=c(2);return u(n.downloadData(0))}),g(7,"i",32),l(8," Download CSV "),o()(),a(9,"li")(10,"a",33),f("click",function(){d(t);let n=c(2);return u(n.downloadData(1))}),g(11,"i",34),l(12," Download XLSX "),o()()()()}}function Ua(i,e){if(i&1&&(a(0,"tr",40),g(1,"td",41)(2,"td",41)(3,"td",42),C(4,"number"),g(5,"td",42),C(6,"number"),g(7,"td",42),C(8,"number"),o()),i&2){let t=e.$implicit;de(t.QuantityDifferences<0?"danger":"success"),s(),p("innerHTML",t.Name,F),s(),p("innerHTML",t.Code,F),s(),p("innerHTML",w(4,9,t.Expected),F),s(2),p("innerHTML",w(6,11,t.Counted),F),s(2),de(t.QuantityDifferences<0?"text-danger":"text-success"),p("innerHTML",w(8,13,t.QuantityDifferences),F)}}function La(i,e){if(i&1&&(a(0,"table",35)(1,"thead",36)(2,"tr")(3,"th"),l(4,"Name"),o(),a(5,"th",37),l(6,"Code"),o(),a(7,"th",38),l(8,"Expected Stock"),o(),a(9,"th",38),l(10,"Counted Stock "),o(),a(11,"th",38),l(12,"Differences "),o()()(),a(13,"tbody"),_(14,Ua,9,15,"tr",39),o()()),i&2){let t=c(2);s(14),p("ngForOf",t.opNames)}}function Qa(i,e){if(i&1){let t=v();a(0,"mainpanel-cmp",1)(1,"actions"),_(2,ka,2,0,"button",2)(3,Va,2,0,"button",2),o(),a(4,"content")(5,"div",3)(6,"div",4)(7,"div",5)(8,"h5",6),l(9,"Outlet"),o(),a(10,"small",7),l(11,"Stock take location"),o()(),a(12,"div",8)(13,"div",9)(14,"div",10)(15,"div")(16,"ng-select",11),T("ngModelChange",function(n){d(t);let m=c();return D(m.formData.EntityID,n)||(m.formData.EntityID=n),u(n)}),f("change",function(n){d(t);let m=c();return u(m.getEntityName(n))}),_(17,Na,3,5,"ng-template",12),o()(),_(18,Fa,13,0,"div",13),o()()()(),a(19,"div",4)(20,"div",5)(21,"h5",6),l(22,"Counted Inventory"),o(),a(23,"small",7),l(24,".csv format"),o()(),a(25,"div",8)(26,"div",9)(27,"div",14)(28,"input",15),f("change",function(n){d(t);let m=c();return u(m.onSelectFile(n.target))}),o()()()()(),a(29,"div",16)(30,"div",5)(31,"h5",6),l(32,"Advanced"),o(),a(33,"small",7),l(34,"More Options"),o()(),a(35,"div",8)(36,"div",9)(37,"div",17)(38,"label",6),l(39,"Product Without Inventory"),o(),a(40,"small",18),l(41,"Download product Without Inventories"),o(),a(42,"div",19)(43,"radio-options",20),T("modelChange",function(n){d(t);let m=c();return D(m.formData.ProductWithoutInventory,n)||(m.formData.ProductWithoutInventory=n),u(n)}),o()()()()(),_(44,La,15,1,"table",21),o(),a(45,"a",22),l(46,"More Options"),o(),a(47,"div",23)(48,"div",24),l(49,"Tips"),o(),a(50,"ol")(51,"li"),l(52,"Choose your outlet then download the csv spreadsheet"),o(),a(53,"li"),l(54,"Fill the Quantity column beside the Expected column"),o(),a(55,"li"),l(56,"Upload your file using the Green Button on the top right corner"),o(),a(57,"li"),l(58,"Analyze the upload file on your screen and Confirm the Adjustment."),o(),a(59,"li"),l(60,'Inventory Adjustment only works for Product with type "Standard" / product with stock.'),o(),a(61,"li"),l(62,'"Composite" Product is not shown in the CSV you Download.'),o()()()()()()}if(i&2){let t=c();p("pageData",t.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),s(2),p("ngIf",t.roleService.adjustment.Create&&!t.uploaded),s(),p("ngIf",t.uploaded),s(13),p("items",t.pageData.Entities),P("ngModel",t.formData.EntityID),s(2),p("ngIf",t.roleService.adjustment.Create||t.roleService.adjustment.Edit),s(11),de(U(13,ja,t.opNames.length>0)),s(14),p("options",t.productOptions),P("model",t.formData.ProductWithoutInventory),s(),p("ngIf",t.opNames.length>0)}}var En=class i extends Pe{constructor(t,r,n,m,y,b,oe){super(t,r,null,"Outlet/GetByUserAccessWrite");this.toastr=n;this.csvConverter=m;this.router=y;this.roleService=b;this.exp=oe;this.formData={},this.opNames=[]}formData;outletName;flag;uploaded=!1;opNames;productOptions=[{Key:"0",Value:"No"},{Key:"1",Value:"Yes"},{Key:"-1",Value:"Exclude Zero"}];csvResult;file;preInitList(){this.formData.EntityID=this.pageData.Entities[0].ID,this.outletName=this.pageData.Entities[0].Name,this.formData.ProductWithoutInventory="1"}onSelectFile(t){this.file=t.files[0]}ok(){let t=new FormData;t.append("Data",this.file),t.append("EntityID",this.formData.EntityID),t.append("ProductWithoutInventory",this.formData.ProductWithoutInventory),this.httpService.postFormData("/API/Adjustment/GetPreviewImportCSV",t).subscribe({next:r=>{this.opNames=r,this.uploaded=!0}})}downloadData(t){t==0?this.exp.exportCSV("InventoryExport/GetStockTakeSpreadsheet",this.formData):this.exp.exportXlsx("InventoryExport/GetStockTakeSpreadsheet",this.formData)}getEntityName(t){this.outletName=t.Name}getFormatedDate(){let t=new Date,r=(t.getDate()<10?"0":"")+t.getDate(),n=(t.getMonth()+1<10?"0":"")+(t.getMonth()+1),m=t.getFullYear().toString().substr(-2);return r+n+m}confirmAdjustment(){let t=[];if(this.opNames.forEach(m=>{let y={VariantID:m.ID,Quantity:m.QuantityDifferences,Cost:m.UnitCost,Price:m.UnitPrice};t.push(y)}),t.length<1)return alert("You must atleast have one item to adjust!"),!1;let r=new Date;this.formData.InventoryDate!=null&&(r=new Date(this.formData.InventoryDate));let n={Order:{EntityID:this.formData.EntityID,Date:r},Items:t,TypeID:1};this.httpService.post("/API/Adjustment/SubmitUseDefault",n).subscribe({next:m=>{this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Info"],{queryParams:{ID:m.OrderID}}).then(()=>window.location.reload())},error:m=>{}})}static \u0275fac=function(r){return new(r||i)(S(ie),S(A),S(fe),S(Ve),S(je),S(G),S($i))};static \u0275cmp=E({type:i,selectors:[["POS-csv-stock-take"]],features:[le],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"row","border-bottom","mt-10","ms-2"],[1,"col-md-2"],[1,"fw-bold"],[1,"h6","fst-italic"],[1,"col-md-10"],[1,"row"],[1,"col-md-12","mb-10",2,"display","flex"],["bindLabel","Name","bindValue","ID",2,"width","200px",3,"ngModelChange","change","items","ngModel"],["ng-option-tmp",""],["class","dropdown ms-3",4,"ngIf"],["id","import-section",1,"col-md-6","mb-10"],["accept",".csv","id","csv","type","file","name","myfile",1,"form-control",3,"change"],[1,"row","extra-options","border-bottom","mt-10","ms-2","collapse"],[1,"col-md-5"],[1,"ms-3","h6","fst-italic"],[1,"form-floating-outline","radio","border","rounded",2,"padding-top","14px"],["name","productInventory",3,"modelChange","options","model"],["class","table table-bordered mt-3",4,"ngIf"],["data-bs-toggle","collapse","data-bs-target",".extra-options","aria-expanded","true",1,"more","ms-2"],[1,"border","mt-5","ms-2"],[1,"fst-italic","text-primary","fw-bold","h5","ms-12","mt-3"],[1,"btn","btn-success",3,"click"],[3,"title"],[1,"dropdown","ms-3"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","dropdown-toggle","mb-2",2,"height","37px !important","font-size","12px !important"],[1,"fa","fa-download","me-3"],[1,"dropdown-menu","dropdown-menu-start"],["role","button",1,"dropdown-item",3,"click"],[1,"fa-solid","fa-file-csv","me-3","mb-1"],["role","button",1,"dropdown-item","mt-2",3,"click"],[1,"fa-solid","fa-file-excel","me-3","mb-1"],[1,"table","table-bordered","mt-3"],[1,"thead-light","sticky-top-thead"],[2,"width","150px"],[1,"text-end",2,"width","120px"],["class","red",3,"class",4,"ngFor","ngForOf"],[1,"red"],[3,"innerHTML"],[1,"text-end",3,"innerHTML"]],template:function(r,n){r&1&&_(0,Qa,63,15,"mainpanel-cmp",0),r&2&&p("ngIf",n.pageData)},dependencies:[J,q,re,$,pe,ce,zi,hn,Z,Ui],styles:[".col-md-5[_ngcontent-%COMP%]{font-size:.875rem;height:fit-content}.col-md-5.date[_ngcontent-%COMP%] datepicker[_ngcontent-%COMP%] .mat-mdc-form-field-infix input{font-size:14px;padding-bottom:3px}"]})};var Mn=class extends un{constructor(t,r){super(t);this.httpService=r;this.loaderApi="/API/AdjustmentLoader/StockTakeByCSV",this.productsApi="/API/Adjustment/GetSpreadsheetPagination",this.submitApi="/API/Adjustment/SubmitUseDefault",this.requestPayload=3,this.products=this.originalProducts=[],this.getDataFromLoader()}loaderData;products;originalProducts;adjustmentID;completeInfo;error;loaderApi;productsApi;submitApi;requestPayload;getDataFromLoader(){this.menuData$.pipe(bi(()=>this.httpService.post(this.loaderApi,this.requestPayload))).subscribe(t=>this.loaderData=t)}getProduct(t){this.products=[],this.httpService.post(this.productsApi,t).subscribe(r=>{r.forEach(n=>{n.Counted="",this.products.push(n),this.originalProducts.push(n)})})}submitAdjustment(t){this.beforeSubmit(),this.httpService.post(this.submitApi,t).subscribe({next:r=>{this.adjustmentID=r.OrderID,this.completeInfo=r,this.error=null,this.onSubmitSuccess()},error:r=>{this.error=r,this.onSubmiterror()}})}onSubmitSuccess(){}beforeSubmit(){}onSubmiterror(){}};var Ba=["stepper"],Fr=i=>({"nb-button-override":i}),Ha=i=>({custom:i}),Ur=()=>["/menu/Products/Catalog/Variants/Info"],ci=i=>({ID:i}),Wa=i=>({"bg-gradient-warning":i}),qa=i=>({Filter:i}),Ga=()=>["/menu/Adjustment/Adjustment/Archive/Info"];function za(i,e){if(i&1){let t=v();a(0,"button",9),f("click",function(){d(t);let n=c(2);return u(n.validateFilter())}),l(1," Next "),o()}if(i&2){let t=c(2);p("disabled",!t.roleService.adjustment.Create)}}function $a(i,e){if(i&1){let t=v();a(0,"div",10)(1,"button",11),f("click",function(){d(t);let n=c(2);return u(n.stepper.previous())}),l(2," Back "),o(),a(3,"button",12),f("click",function(){d(t);let n=c(2);return u(n.stepper.next())}),l(4," Next "),o()()}if(i&2){let t=c(2);p("ngClass",U(1,Fr,t.currentSubStatus!=t.subStatusEnum.PAID))}}function Ka(i,e){if(i&1){let t=v();a(0,"div",10)(1,"button",13),f("click",function(){d(t);let n=c(2);return u(n.stepper.previous())}),l(2," Back "),o(),a(3,"button",14),f("click",function(){d(t);let n=c(2);return u(n.stepper.next())}),l(4," Confirm Adjustment "),o()()}if(i&2){let t=c(2);p("ngClass",U(1,Fr,t.currentSubStatus!=t.subStatusEnum.PAID))}}function Ja(i,e){i&1&&(g(0,"i",57),l(1,"Filter"))}function Za(i,e){i&1&&(a(0,"small",58),l(1,"Outlet option is required."),o())}function Ya(i,e){i&1&&(g(0,"i",59),l(1,"Input"))}function Xa(i,e){i&1&&(a(0,"th",45),l(1," Expected "),o())}function es(i,e){i&1&&(a(0,"th",45),l(1," Changes "),o())}function ts(i,e){if(i&1&&(a(0,"td"),l(1),o()),i&2){let t=c().$implicit;s(),I(" ",t.Quantity," ")}}function ns(i,e){if(i&1&&(a(0,"td"),l(1),g(2,"i",66),l(3),o()),i&2){let t=c().$implicit;ri("bg-gradient-danger",t.Counted<t.Quantity)("bg-gradient-success",t.Counted>t.Quantity),s(),I(" ",t.Quantity," "),s(2),$t(" ",t.Counted," (",(t.Counted-t.Quantity>0?"+":"")+(t.Counted-t.Quantity),") ")}}function is(i,e){if(i&1){let t=v();a(0,"i",67),f("click",function(){d(t);let n=c().$implicit,m=c(3);return u(m.clear(n))}),o()}}function rs(i,e){if(i&1){let t=v();a(0,"tr")(1,"td"),l(2),o(),a(3,"td",60),l(4),o(),a(5,"td",60),l(6),o(),a(7,"td")(8,"a",61),l(9),o()(),a(10,"td"),l(11),o(),_(12,ts,2,1,"td",47),a(13,"td")(14,"input",62,2),T("ngModelChange",function(n){let m=d(t).$implicit;return D(m.Counted,n)||(m.Counted=n),u(n)}),f("ngModelChange",function(){let n=d(t).$implicit,m=ee(15),y=c(3);return u(y.onReset(n,m))}),o()(),_(16,ns,4,7,"td",63),a(17,"td",64),_(18,is,1,0,"i",65),o()()}if(i&2){let t=e.$implicit,r=e.index,n=c(3);s(2),x(r+1+"."),s(2),I(" ",t.CategoryName," "),s(2),I(" ",t.ProductName," "),s(2),p("routerLink",te(14,Ur))("queryParams",U(15,ci,t.ID)),s(),x(t.Model),s(2),x(t.Code),s(),p("ngIf",n.roleService.inventory.View),s(2),de(U(17,Wa,t.Counted!==""&&t.Counted!=t.Quantity&&!n.roleService.inventory.View)),p("modifyValueOnWheel",!1),P("ngModel",t.Counted),s(2),p("ngIf",t.Counted!==""&&n.roleService.inventory.View),s(2),p("ngIf",t.Counted!=="")}}function os(i,e){if(i&1){let t=v();H(0),a(1,"POS-complex-pagination",68),f("jumpToPage",function(){d(t);let n=c(3);return u(n.getProduct(n.filter))})("previousPage",function(){d(t);let n=c(3);return u(n.getProduct(n.filter))})("nextPage",function(){d(t);let n=c(3);return u(n.getProduct(n.filter))}),o(),W()}if(i&2){let t=c(3);s(),p("total",t.products.length)("pageData",U(2,qa,t.filter))}}function as(i,e){i&1&&(g(0,"i",69),l(1,"Review"))}function ss(i,e){i&1&&(a(0,"th",45),l(1," Expected "),o())}function ls(i,e){i&1&&(a(0,"th",45),l(1," Differences "),o())}function ms(i,e){if(i&1&&(a(0,"td"),l(1),o()),i&2){let t=c(2).$implicit;s(),I(" ",t.Quantity," ")}}function ps(i,e){if(i&1&&(a(0,"span"),l(1),o()),i&2){let t=c(3).$implicit;s(),I("+",t.Counted-t.Quantity,"")}}function cs(i,e){if(i&1&&(a(0,"span"),l(1),o()),i&2){let t=c(3).$implicit;s(),x(t.Counted-t.Quantity)}}function ds(i,e){if(i&1&&(a(0,"td"),_(1,ps,2,1,"span",47)(2,cs,2,1,"span",47),o()),i&2){let t=c(2).$implicit;s(),p("ngIf",t.Counted>=t.Quantity),s(),p("ngIf",t.Counted<t.Quantity)}}function us(i,e){if(i&1&&(a(0,"tr")(1,"td"),l(2),o(),a(3,"td",60),l(4),o(),a(5,"td")(6,"a",61),l(7),o()(),a(8,"td"),l(9),o(),_(10,ms,2,1,"td",47),a(11,"td"),l(12),o(),_(13,ds,3,2,"td",47),o()),i&2){let t=c(),r=t.$implicit,n=t.index,m=c(3);ri("soft-yellow",r.Counted<r.Quantity)("soft-green",r.Counted>r.Quantity),s(2),x(n+1+"."),s(2),I(" ",r.ProductName," "),s(2),p("routerLink",te(13,Ur))("queryParams",U(14,ci,r.ID)),s(),x(r.Model),s(2),x(r.Code),s(),p("ngIf",m.roleService.inventory.View),s(2),I(" ",r.Counted," "),s(),p("ngIf",m.roleService.inventory.View)}}function _s(i,e){if(i&1&&(H(0),_(1,us,14,16,"tr",70),W()),i&2){let t=e.$implicit;s(),p("ngIf",t.Counted!=="")}}function gs(i,e){i&1&&(g(0,"i",71),l(1,"Finish"))}function fs(i,e){if(i&1&&(a(0,"div",72),g(1,"i",73),l(2),o()),i&2){let t=c(3);s(2),I("",t.error.error.Message," ")}}function hs(i,e){if(i&1){let t=v();a(0,"mat-stepper",15,0),f("selectionChange",function(n){d(t);let m=c(2);return u(m.onNextStep(n))}),a(2,"mat-step",16),_(3,Ja,2,0,"ng-template",17),a(4,"div",18)(5,"div",19)(6,"div",20)(7,"div",19)(8,"h3",21),l(9,"Outlet"),o()(),a(10,"div",22)(11,"ng-select",23,1),f("change",function(){d(t);let n=c(2);return u(n.toggleIsFilterFilled())}),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.filter.EntityID,n)||(m.filter.EntityID=n),u(n)}),o(),_(13,Za,2,0,"small",24),o()()(),a(14,"div",25)(15,"div",20)(16,"div",19)(17,"h3",21),l(18," Category "),a(19,"small",26)(20,"em"),l(21,"Optional"),o()()()(),a(22,"div",22)(23,"POS-product-category-select",27),T("selectedCategoryIDChange",function(n){d(t);let m=c(2);return D(m.filter.CategoryID,n)||(m.filter.CategoryID=n),u(n)}),o()()()(),a(24,"div",25)(25,"div",20)(26,"div",19)(27,"h3",21),l(28," Contain Text "),a(29,"small",26)(30,"em"),l(31,"Optional"),o()()()(),a(32,"div",28)(33,"input",29),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.filter.ProductName,n)||(m.filter.ProductName=n),u(n)}),o()()()(),a(34,"div",25)(35,"div",20)(36,"div",19)(37,"div",30)(38,"h3",31),l(39,"Tag"),o(),a(40,"small",26)(41,"em"),l(42,"Optional"),o()()()(),a(43,"div",28)(44,"ng-select",32),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.filter.TagID,n)||(m.filter.TagID=n),u(n)}),o()()()(),a(45,"div",25)(46,"div",20)(47,"div",19)(48,"h3",21),l(49,"Storage Location"),o()(),a(50,"div",22)(51,"POS-storage-location-select",33),f("selectedCategoryIDChange",function(n){d(t);let m=c(2);return u(m.onSelectStorageLocation(n))}),o()()()(),a(52,"div",25)(53,"div",20)(54,"div",19)(55,"h3",21),l(56," Note "),a(57,"small",26)(58,"em"),l(59,"Optional"),o()()()(),a(60,"div",22)(61,"textarea",34),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.note,n)||(m.note=n),u(n)}),o()()()()()(),a(62,"mat-step",35),_(63,Ya,2,0,"ng-template",17),a(64,"div",36)(65,"table",37),f("matSortChange",function(n){d(t);let m=c(2);return u(m.sortData(n))}),a(66,"thead",38)(67,"tr")(68,"th",39),l(69,"No"),o(),a(70,"th",40),l(71," Category "),o(),a(72,"th",41),l(73," Product "),o(),a(74,"th",42),l(75,"Variant"),o(),a(76,"th",43),l(77,"Code"),o(),_(78,Xa,2,0,"th",44),a(79,"th",45),l(80,"Counted"),o(),_(81,es,2,0,"th",44),g(82,"th",39),o()(),a(83,"tbody"),_(84,rs,19,19,"tr",46),o()(),_(85,os,2,4,"ng-container",47),o()(),a(86,"mat-step",48),_(87,as,2,0,"ng-template",17),a(88,"div",49)(89,"div",50)(90,"table",51),f("matSortChange",function(n){d(t);let m=c(2);return u(m.sortData(n))}),a(91,"thead",52)(92,"tr"),g(93,"th",39),a(94,"th",53),l(95," Name "),o(),a(96,"th",54),l(97,"Variant"),o(),a(98,"th",45),l(99,"Code"),o(),_(100,ss,2,0,"th",44),a(101,"th",45),l(102,"Counted"),o(),_(103,ls,2,0,"th",44),o()(),a(104,"tbody"),_(105,_s,2,1,"ng-container",46),o()()()()(),a(106,"mat-step",55),_(107,gs,2,0,"ng-template",17)(108,fs,3,1,"div",56),o()()}if(i&2){let t=ee(12),r=c(2);p("linear",!0),s(2),p("completed",r.isFilterFilled),s(9),de(U(24,Ha,t.touched&&r.filter.EntityID==null)),p("items",r.loaderData.Entities),P("ngModel",r.filter.EntityID),p("clearable",!1),s(2),p("ngIf",t.touched&&r.filter.EntityID==null),s(10),P("selectedCategoryID",r.filter.CategoryID),p("showClear",!0),s(10),P("ngModel",r.filter.ProductName),s(11),p("items",r.loaderData.AdjustmentTagsOptions),P("ngModel",r.filter.TagID),p("clearable",!1),s(7),p("showClear",!0),s(10),P("ngModel",r.note),s(17),p("ngIf",r.roleService.inventory.View),s(3),p("ngIf",r.roleService.inventory.View),s(3),p("ngForOf",r.products),s(),p("ngIf",r.products.length>0),s(15),p("ngIf",r.roleService.inventory.View),s(3),p("ngIf",r.roleService.inventory.View),s(2),p("ngForOf",r.reviewedItems),s(3),p("ngIf",r.error)}}function ys(i,e){i&1&&(a(0,"div",90),l(1," Difference "),o())}function Cs(i,e){if(i&1&&(a(0,"div",95),l(1),o()),i&2){let t=c().$implicit;de(t.Quantity-t.OriginalQuantity<0?"text-danger":"text-success"),s(),I(" ",(t.Quantity-t.OriginalQuantity>0?"+":" ")+(t.Quantity-t.OriginalQuantity)," ")}}function vs(i,e){if(i&1&&(a(0,"div",97)(1,"div",94),l(2),o(),a(3,"div",95),l(4),o(),_(5,Cs,2,3,"div",96),o()),i&2){let t=e.$implicit,r=c(3);s(2),$t("",t.Name," (",t.Model,")"),s(2),x(t.Quantity),s(),p("ngIf",r.roleService.inventory.View)}}function xs(i,e){if(i&1&&(a(0,"div",95),C(1,"sum"),C(2,"sum"),l(3),C(4,"sum"),C(5,"sum"),C(6,"sum"),C(7,"sum"),o()),i&2){let t=c(3);de(V(1,3,t.displayedItems,"Quantity")-V(2,6,t.displayedItems,"OriginalQuantity")<0?"text-danger":"text-success"),s(3),I(" ",(V(4,9,t.displayedItems,"Quantity")-V(5,12,t.displayedItems,"OriginalQuantity")>0?"+":" ")+(V(6,15,t.displayedItems,"Quantity")-V(7,18,t.displayedItems,"OriginalQuantity"))," ")}}function Ss(i,e){if(i&1){let t=v();a(0,"div",74)(1,"div",75)(2,"div",76)(3,"div",77)(4,"h1",78),g(5,"i",71),l(6,"Inventory Adjustment Completed "),o()(),a(7,"div",79)(8,"div",80)(9,"div",81)(10,"a",82),f("click",function(){d(t);let n=c(2);return u(n.newStockCount())}),l(11,"New Adjustment (F8)"),o()()()()()(),a(12,"div",83)(13,"div",76)(14,"div",84)(15,"h2",85)(16,"a",86),l(17),o()()(),a(18,"div",87)(19,"div",88)(20,"div",89),l(21," Product Name (Variant) "),o(),a(22,"div",90),l(23,"Counted"),o(),_(24,ys,2,0,"div",91),o(),_(25,vs,6,4,"div",92),a(26,"div",93)(27,"div",94),l(28,"Total"),o(),a(29,"div",95),l(30),C(31,"sum"),o(),_(32,xs,8,21,"div",96),o()()()()()}if(i&2){let t=c(2);s(16),p("routerLink",te(10,Ga))("queryParams",U(11,ci,t.adjustmentID)),s(),I("Adjustment #",t.completeInfo.InvoiceNumber,""),s(7),p("ngIf",t.roleService.inventory.View),s(),p("ngForOf",t.displayedItems),s(5),x(V(31,7,t.displayedItems,"Quantity")),s(2),p("ngIf",t.roleService.inventory.View)}}function Is(i,e){if(i&1){let t=v();a(0,"mainpanel-cmp",4),T("textChange",function(n){d(t);let m=c();return D(m.filter.ProductName,n)||(m.filter.ProductName=n),u(n)}),f("onSubmit",function(){d(t);let n=c();return u(n.filterProduct())}),a(1,"actions"),_(2,za,2,1,"button",5)(3,$a,5,3,"div",6)(4,Ka,5,3,"div",6),o(),a(5,"content"),_(6,hs,109,26,"mat-stepper",7)(7,Ss,33,13,"div",8),o()()}if(i&2){let t=c();p("pageData",t.menuData),P("text",t.filter.ProductName),p("hideSearchBox",t.currentStep!="input")("hideSearchDropdown",!0),s(2),p("ngIf",t.currentStep=="filter"),s(),p("ngIf",t.currentStep=="input"),s(),p("ngIf",t.currentStep=="review"),s(2),p("ngIf",!t.isCompleted),s(),p("ngIf",t.isCompleted)}}var On=class i extends Mn{constructor(t,r,n,m,y){super(t,r);this.toastr=n;this.ngZone=m;this.roleService=y;this.isFilterFilled=!1,this.filter={CategoryID:null,EntityID:null,ProductName:"",SupplierID:N.GuidEmpty,RowCount:500,PageNumber:1,TagID:null,StorageID:N.GuidEmpty},this.oldFilter={CategoryID:"dummy",EntityID:"dummy",ProductName:"dummy",SupplierID:"dummy",RowCount:500,PageNumber:1,TagID:null,StorageID:N.GuidEmpty},this.Items=[],this.initSubscriptionStatus()}stepper;isFilterFilled;currentStep="filter";Items;reviewedItems=[];displayedItems=[];note;isCompleted=!1;filter;oldFilter;currentSubStatus;subStatusEnum=Ai;ngOnDestroy(){}initSubscriptionStatus(){this.currentSubStatus=parseInt(localStorage.getItem("SubscriptionStatus"))}onSelectStorageLocation(t){this.filter=k(M({},this.filter),{StorageID:t})}handleF8(){this.currentStep=="finish"&&this.newStockCount()}handleNextButton(){this.stepper&&this.ngZone.run(()=>{this.roleService.adjustment.Create&&(this.isFilterFilled?this.stepper.next():this.validateFilter())})}onReset(t,r){r.value==""&&this.clear(t)}handlePreviousButton(){this.stepper&&this.ngZone.run(()=>{this.stepper.previous()})}toggleIsFilterFilled(){this.isFilterFilled=!0}updateFilterStorage(t){this.filter=k(M({},this.filter),{StorageID:t})}onNextStep(t){if(t.selectedStep.label=="filter")this.currentStep="filter";else if(t.selectedStep.label=="input")this.currentStep="input",(this.oldFilter.CategoryID!=this.filter.CategoryID||this.oldFilter.EntityID!=this.filter.EntityID||this.filter.ProductName!=this.oldFilter.ProductName)&&(this.getProduct(this.filter),this.oldFilter=Object.assign({},this.filter));else if(t.selectedStep.label=="review"){this.products=this.originalProducts,this.currentStep="review";let r=0;this.products.forEach(n=>{n.Counted!==""&&n.Counted!=n.Quantity&&(n.Status=n.Counted>n.Quantity?"Over":"Under",r++)}),this.reviewedItems=this.products.filter(n=>n.Counted!==""),r&&!this.roleService.inventory.View&&this.toastr.warning("There are some items inventory that does not match! Click next to automatically adjust inventory.",se.Warning)}else if(t.selectedStep.label=="finish"){this.products=this.originalProducts,this.currentStep="finish",this.Items=[],this.products.forEach(m=>{if(m.Counted!==""){let y={Name:m.ProductName,Cost:m.UnitCost,Price:m.UnitPrice,Quantity:m.Counted,OriginalQuantity:m.Quantity,VariantID:m.ID,Model:m.Model};this.Items.push(y)}});let r={Date:new Date,EntityID:this.filter.EntityID,Note:this.note,ID:this.adjustmentID||N.GuidEmpty,TagID:this.filter.TagID},n={Items:this.Items,Order:r,TypeID:2};this.displayedItems=this.Items.filter(m=>m.Quantity-m.OriginalQuantity!=0),this.submitAdjustment(n)}}validateFilter(){if(!this.isFilterFilled){this.toastr.error("Outlet is required",se.Error);return}this.stepper.next()}clear(t){t.Counted=""}newStockCount(){window.location.reload()}beforeSubmit(){this.isCompleted=!0}onSubmiterror(){this.isCompleted=!1}sortData(t){let r=this.products.slice();if(!t.active||t.direction===""){this.products=this.originalProducts;return}this.products=r.sort((n,m)=>{let y=t.direction==="asc",b=typeof n[t.active];switch(N.IsEmpty(n.Code)&&(n.Code=""),N.IsEmpty(m.Code)&&(m.Code=""),b){case"string":return N.compare(n[t.active].toLocaleLowerCase(),m[t.active].toLocaleLowerCase(),y);case"number":return N.compare(n[t.active],m[t.active],y);default:return 0}})}filterProduct(){this.filter.PageNumber=1,this.getProduct(this.filter)}static \u0275fac=function(r){return new(r||i)(S(ie),S(A),S(fe),S(an),S(G))};static \u0275cmp=E({type:i,selectors:[["POS-spreadsheet-stock-take"]],viewQuery:function(r,n){if(r&1&&ln(Ba,5),r&2){let m;mn(m=pn())&&(n.stepper=m.first)}},hostBindings:function(r,n){r&1&&f("keydown.F8",function(){return n.handleF8()},!1,Ue)("keydown.ArrowRight",function(){return n.handleNextButton()},!1,Ue)("keydown.ArrowLeft",function(){return n.handlePreviousButton()},!1,Ue)},features:[le],decls:1,vars:1,consts:[["stepper",""],["outletFilter","ngModel"],["input",""],[3,"pageData","text","hideSearchBox","hideSearchDropdown","textChange","onSubmit",4,"ngIf"],[3,"textChange","onSubmit","pageData","text","hideSearchBox","hideSearchDropdown"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page","class","btn btn-success ms-auto me-0 d-block",3,"disabled","click",4,"ngIf"],["class","mt-5 nb-button",3,"ngClass",4,"ngIf"],[3,"linear","selectionChange",4,"ngIf"],["class","container-fluid row mt-5",4,"ngIf"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success","ms-auto","me-0","d-block",3,"click","disabled"],[1,"mt-5","nb-button",3,"ngClass"],["mat-button","","mat-raised-button","","matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-2",3,"click"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn","btn-success",3,"click"],["mat-button","","mat-raised-button","","matTooltip","Press left arrow key to go to the next page",1,"btn","btn-outline-secondary","me-5",3,"click"],["mat-button","","mat-raised-button","","matTooltip","Press right arrow key to go to the next page",1,"btn","btn-success",3,"click"],[3,"selectionChange","linear"],["label","filter",3,"completed"],["matStepLabel",""],[1,"row","px-5","w-50","mx-auto"],[1,"col-12"],[1,"row"],[1,"fw-normal","text-dark","m-0"],[1,"col-12","mt-3"],["dropdownPosition","bottom","placeholder","Choose an outlet","bindLabel","Name","bindValue","ID",3,"change","ngModelChange","items","ngModel","clearable"],["style","color: red",4,"ngIf"],[1,"col-12",2,"margin-top","25px"],[1,"text-body-secondary","h6"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],[1,"col-12","mt-3","mb-0"],["type","text","name","text","placeholder","Type the product name you want to adjust",1,"form-control",3,"ngModelChange","ngModel"],[1,"d-flex","gap-4","align-items-baseline","w-100"],[1,"fw-normal","text-dark","m-0","d-inline-block"],["bindLabel","Name","bindValue","ID","placeholder","Choose an adjustment tag",3,"ngModelChange","items","ngModel","clearable"],["endPoint","api/catalog/product/GetProductStorageOptions",1,"tree-select-as-filter",3,"selectedCategoryIDChange","showClear"],["rows","6","type","text","name","note",1,"form-control",3,"ngModelChange","ngModel"],["label","input"],[1,"container-fluid",2,"height","calc(100vh - 180px)","overflow","auto","padding","0 24px","padding-bottom","20px"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","30px"],["mat-sort-header","CategoryName",2,"width","175px"],["mat-sort-header","ProductName",2,"width","200px"],["mat-sort-header","Model",2,"width","100px"],["mat-sort-header","Code",2,"width","75px"],["style","width: 75px",4,"ngIf"],[2,"width","75px"],[4,"ngFor","ngForOf"],[4,"ngIf"],["label","review"],[1,"container-fluid",2,"padding","0 24px"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom","w-100",2,"table-layout","fixed",3,"matSortChange"],[1,"thead-light"],["mat-sort-header","ProductName",2,"width","175px"],[2,"width","150px"],["label","finish"],["class","alert",4,"ngIf"],[1,"fa-solid","fa-filter","me-3"],[2,"color","red"],[1,"fa-solid","fa-calculator","me-3"],[2,"word-break","break-word"],["target","_blank",2,"color","#0976b4 !important",3,"routerLink","queryParams"],["type","text","autoNum","",1,"form-control",3,"ngModelChange","modifyValueOnWheel","ngModel"],[3,"bg-gradient-danger","bg-gradient-success",4,"ngIf"],[1,"text-center"],["class","fa-solid fa-delete-left fa-2x clear align-middle","matTooltipPosition","above","matTooltip","reset counter",3,"click",4,"ngIf"],[1,"fa-solid","fa-right-long"],["matTooltipPosition","above","matTooltip","reset counter",1,"fa-solid","fa-delete-left","fa-2x","clear","align-middle",3,"click"],["api","Adjustment/GetSpreadsheetCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"fa-solid","fa-user-check","me-3"],[3,"soft-yellow","soft-green",4,"ngIf"],[1,"fa-solid","fa-check","me-3"],[1,"alert"],[1,"fa-solid","fa-circle-exclamation","me-3"],[1,"container-fluid","row","mt-5"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px","border-bottom","1px solid rgba(0, 0, 0, 0.125)","background-color","rgba(203, 203, 210, 0.15) !important"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body"],[1,"row","justify-content-between"],[1,"col-6",2,"font-size","14px"],[1,"col-3",2,"font-size","14px"],["class","col-3","style","font-size: 14px",4,"ngIf"],["class","row justify-content-between my-5",4,"ngFor","ngForOf"],[1,"row","justify-content-between","fw-bold"],[1,"col-6"],[1,"col-3"],["class","col-3",3,"class",4,"ngIf"],[1,"row","justify-content-between","my-5"]],template:function(r,n){r&1&&_(0,Is,8,9,"mainpanel-cmp",3),r&2&&p("ngIf",n.loaderData)},dependencies:[Cn,tt,J,q,be,re,De,$,pe,ce,at,lr,sr,mr,ke,It,Qi,Ri,Mt,Tt],styles:['@import"https://fonts.googleapis.com/icon?family=Material+Icons";ng-select.custom[_ngcontent-%COMP%] .ng-select-container{border:1px solid red!important}.soft-green[_ngcontent-%COMP%]{background-color:#acd1af}.sticky-top-thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{top:0!important}.soft-yellow[_ngcontent-%COMP%]{background-color:#eeee9b}.alert[_ngcontent-%COMP%]{color:#691917;background-color:#f4d6d5;border-color:#f0c5c4}input[_ngcontent-%COMP%]::-webkit-outer-spin-button, input[_ngcontent-%COMP%]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.nb-button[_ngcontent-%COMP%]{position:absolute;right:10px;top:-2px;z-index:9999}.nb-button-override[_ngcontent-%COMP%]{top:40px!important} .mat-horizontal-content-container{padding:0!important} .main-panel-content{padding-bottom:0!important}']})};var bs=()=>["/menu/Products/Catalog/Products/Info"],Ds=i=>({ID:i});function Ps(i,e){if(i&1){let t=v();a(0,"button",13),f("click",function(){d(t);let n=c(2);return u(n.confirmAdjust())}),l(1,"Confirm Adjustment"),o()}}function Ts(i,e){if(i&1){let t=v();a(0,"div")(1,"div",14)(2,"h6"),l(3,"Outlets"),o(),a(4,"ng-select",15),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.EntityID,n)||(m.pageData.Filter.EntityID=n),u(n)}),o()()()}if(i&2){let t=c(2);s(4),p("items",t.pageData.Entities),P("ngModel",t.pageData.Filter.EntityID)}}function ws(i,e){if(i&1){let t=v();a(0,"tr",16)(1,"td"),g(2,"a",17),o(),g(3,"td",18)(4,"td",18)(5,"td",18)(6,"td",19)(7,"td",19),a(8,"td",20)(9,"input",21),T("ngModelChange",function(n){let m=d(t).$implicit;return D(m.NewQuantity,n)||(m.NewQuantity=n),u(n)}),o()(),a(10,"td",20),l(11),C(12,"number"),o(),a(13,"td")(14,"a",22),f("click",function(){let n=d(t).$implicit,m=c(2);return u(m.confirmAdjust(n))}),l(15,"Adjust"),o()()()}if(i&2){let t=e.$implicit;s(2),p("routerLink",te(12,bs))("queryParams",U(13,Ds,t.ProductID))("innerHTML",t.ProductName,F),s(),p("innerHTML",t.ParentCode,F),s(),p("innerHTML",t.Model,F),s(),p("innerHTML",t.ParentModel,F),s(),p("innerHTML",t.Ratio,F),s(),p("innerHTML",t.Inventory,F),s(2),P("ngModel",t.NewQuantity),s(2),I(" ",w(12,10,t.Inventory-t.NewQuantity*t.Ratio)," ")}}function Es(i,e){if(i&1){let t=v();a(0,"mainpanel-cmp",2),f("onSubmit",function(){d(t);let n=c();return u(n.searchFromPageOne())}),T("filterChange",function(n){d(t);let m=c();return D(m.pageData.Filter,n)||(m.pageData.Filter=n),u(n)}),a(1,"actions"),_(2,Ps,2,0,"button",3),o(),a(3,"filters"),_(4,Ts,5,2,"ng-template",null,0,R),o(),a(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th"),l(13,"Product Name"),o(),a(14,"th",8),l(15,"Code"),o(),a(16,"th",8),l(17,"From"),o(),a(18,"th",8),l(19,"To"),o(),a(20,"th",9),l(21,"Ratio"),o(),a(22,"th",9),l(23,"Inventory"),o(),a(24,"th",10),l(25,"Convert Qty "),o(),a(26,"th",10),l(27,"Remaining"),o(),g(28,"th",11),o()(),a(29,"tbody"),_(30,ws,16,15,"tr",12),o()()()()()()}if(i&2){let t=c();p("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),P("filter",t.pageData.Filter),s(2),p("ngIf",t.roleService.adjustment.Create),s(28),p("ngForOf",t.Items)}}var An=class i extends Pe{constructor(t,r,n,m,y){super(t,r,"Adjustment/GetAdjustToParentList","Outlet/GetByUserAccessWrite");this.toastr=n;this.router=m;this.roleService=y}Items;preGetList(){N.IsEmpty(this.pageData.Filter.EntityID)&&(this.pageData.Filter.EntityID=this.pageData.Entities[0].ID)}postInit(t){this.Items=t,this.Items.forEach(r=>r.NewQuantity=Math.floor(r.Inventory/r.Ratio))}confirmAdjust(t){let r=[],n=[];if(t?n.push(t):n=this.Items,n.forEach(y=>{let b={VariantID:y.ParentID,Quantity:y.NewQuantity,Cost:y.UnitCost*y.Ratio,Price:y.UnitPrice*y.Ratio};r.push(b),b={VariantID:y.ID,Quantity:y.NewQuantity*y.Ratio*-1,Cost:y.UnitCost,Price:y.UnitPrice},r.push(b)}),r.length<1)return alert("You must atleast have one item to adjust!"),!1;if(N.IsEmpty(this.pageData.Filter.EntityID))return alert("Outlet is require"),!1;let m={Order:{EntityID:this.pageData.Filter.EntityID},Items:r};this.httpService.post("/API/Adjustment/SubmitUseDefault",m).subscribe({next:y=>{y.Success?this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Info"],{queryParams:{ID:y.OrderID}}).then(()=>window.location.reload()):this.toastr.success(y.Message,se.Success)},error:y=>{this.toastr.error(y,se.Error)}})}static \u0275fac=function(r){return new(r||i)(S(ie),S(A),S(fe),S(je),S(G))};static \u0275cmp=E({type:i,selectors:[["POS-convert-inventory"]],features:[le],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","125px"],[1,"text-end",2,"width","125px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"btn","btn-success",3,"click"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","appendTo","body",3,"ngModelChange","items","ngModel"],[1,"border-bottom"],[3,"routerLink","queryParams","innerHTML"],[3,"innerHTML"],[1,"text-end",3,"innerHTML"],[1,"text-end"],["type","text","autoNum","",1,"text-end",3,"ngModelChange","ngModel"],[3,"click"]],template:function(r,n){r&1&&_(0,Es,31,6,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[J,q,be,re,De,$,pe,ce,ke,Z]})};function Ms(i,e){if(i&1){let t=v();a(0,"button",16),f("click",function(){d(t);let n=c();return u(n.openExportModal())}),g(1,"i",17),l(2," Export"),o()}}function Os(i,e){if(i&1){let t=v();a(0,"td",14)(1,"input",21),T("ngModelChange",function(n){d(t);let m=c().$implicit;return D(m.Quantity,n)||(m.Quantity=n),u(n)}),o()()}if(i&2){let t=c().$implicit;s(),P("ngModel",t.Quantity)}}function As(i,e){if(i&1&&(a(0,"td",14),l(1),o()),i&2){let t=c().$implicit;s(),I(" ",t.Quantity,"")}}function js(i,e){if(i&1){let t=v();a(0,"tr",18)(1,"td")(2,"i",19),f("click",function(){let n=d(t).index,m=c();return u(m.products.splice(n,1))}),o()(),a(3,"td"),l(4),o(),a(5,"td",14),l(6),o(),_(7,Os,2,1,"td",20)(8,As,2,1,"td",20),o()}if(i&2){let t=e.$implicit,r=c();s(4),x(t.Name),s(2),x(t.Code),s(),p("ngIf",r.roleService.adjustment.InventoryProductCount),s(),p("ngIf",!r.roleService.adjustment.InventoryProductCount)}}var jn=class i extends un{constructor(t,r,n,m,y){super(t);this.httpService=r;this.csvConverter=n;this.roleService=m;this.matDialog=y;this.products=[],this.menuData$.subscribe()}productCode;products;onBarcodeEnter(t){let r=this.products.findIndex(n=>n.Code===t);r!=-1?this.products[r].Quantity++:this.httpService.post("/API/catalog/product/ProductCountByCode",{code:t}).subscribe(n=>{n.Quantity=1,this.products.push(n)}),this.productCode=null}openExportModal(){var t={Products:this.products,Export:!0};this.matDialog.open(Le,{data:{title:"Count Product Inventory",exportTypes:[{ID:"ProductExport/ProductCountInventory",Value:"Default",FileName:"Count Product Inventory"}],filterExport:t,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(S(ie),S(A),S(Ve),S(G),S(ne))};static \u0275cmp=E({type:i,selectors:[["POS-count-product-inventory"]],features:[le],decls:27,vars:6,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"cashier"],[1,"cart","big-cart","scan-cart"],[1,"barcode","barcode_counter","text-end"],[1,"me-5"],["aria-hidden","true",1,"fa-solid","fa-barcode","fa-2x","icon"],["type","text","placeholder","Scan Barcode Here","autofocus","",2,"width","200px",3,"keyup.enter","ngModelChange","ngModel"],[1,"content"],[1,"table"],["id","tableGrid",1,"cart","table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],["width","15px"],[1,"text-end"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"border-bottom"],[1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],["class","text-end",4,"ngIf"],["type","text","autoNum","",1,"text-end",3,"ngModelChange","ngModel"]],template:function(r,n){r&1&&(a(0,"mainpanel-cmp",0)(1,"actions"),_(2,Ms,3,0,"button",1),o(),a(3,"content")(4,"div",2)(5,"section",3)(6,"main")(7,"section",4)(8,"div",5)(9,"span",6),l(10,"Barcode"),o(),g(11,"i",7),a(12,"input",8),f("keyup.enter",function(){return n.onBarcodeEnter(n.productCode)}),T("ngModelChange",function(y){return D(n.productCode,y)||(n.productCode=y),y}),o()(),a(13,"div",9)(14,"div",10)(15,"table",11)(16,"thead",12)(17,"tr"),g(18,"th",13),a(19,"th"),l(20,"Name"),o(),a(21,"th",14),l(22,"Code"),o(),a(23,"th",14),l(24,"Qty"),o()()(),a(25,"tbody"),_(26,js,9,4,"tr",15),o()()()()()()()()()()),r&2&&(p("pageData",n.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),s(2),p("ngIf",n.roleService.global.Export),s(10),P("ngModel",n.productCode),s(14),p("ngForOf",n.products))},dependencies:[J,q,re,De,$,pe,ke],styles:[".barcode_counter[_ngcontent-%COMP%]{position:fixed;right:10px;bottom:20px;background:#fff;border:1px solid #ddd;padding:8px 10px;border-radius:3px}.barcode_counter[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{border-radius:3px;border:1px solid #b7b7b7;background-repeat:no-repeat;background-position:5px -211px;padding:4px 5px 4px 35px}.barcode_counter[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{position:relative;left:35px;vertical-align:middle}.barcode_counter[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:5px;color:#868686;left:30px;position:relative;margin-left:-25px}"]})};function ks(i,e){if(i&1){let t=v();a(0,"button",15),f("click",function(){d(t);let n=c(2);return u(n.openExportModal())}),g(1,"i",16),l(2," Export"),o()}}function Vs(i,e){if(i&1){let t=v();a(0,"div")(1,"div",17)(2,"h6"),l(3,"Outlets"),o(),a(4,"ng-select",18),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.EntityID,n)||(m.pageData.Filter.EntityID=n),u(n)}),o(),a(5,"h6"),l(6,"Category"),o(),a(7,"POS-product-category-select",19),T("selectedCategoryIDChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.CategoryID,n)||(m.pageData.Filter.CategoryID=n),u(n)}),o(),a(8,"h6"),l(9,"Sort By"),o(),a(10,"ng-select",20),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.SortByid,n)||(m.pageData.Filter.SortByid=n),u(n)}),o()()()}if(i&2){let t=c(2);s(4),p("items",t.pageData.Options.Entities),P("ngModel",t.pageData.Filter.EntityID),s(3),P("selectedCategoryID",t.pageData.Filter.CategoryID),p("showClear",!0),s(3),p("items",t.pageData.Options.SortBy),P("ngModel",t.pageData.Filter.SortByid)}}function Ns(i,e){if(i&1&&(a(0,"span"),l(1),o()),i&2){let t=e.$implicit;s(),x(t+" ")}}function Fs(i,e){if(i&1&&(a(0,"tr")(1,"td"),l(2),o(),a(3,"td"),l(4),o(),a(5,"td",14),l(6),C(7,"number"),o(),a(8,"td",14),l(9),C(10,"number"),o(),a(11,"td",21),_(12,Ns,2,1,"span",11),o()()),i&2){let t=e.$implicit;s(2),x(t.ProductCode),s(2),x(t.ProductName),s(2),x(w(7,5,t.UnitPrice)),s(3),x(w(10,7,t.Qty)),s(3),p("ngForOf",t.Models)}}function Us(i,e){if(i&1){let t=v();a(0,"mainpanel-cmp",2),f("onSubmit",function(){d(t);let n=c();return u(n.searchFromPageOne())}),T("filterChange",function(n){d(t);let m=c();return D(m.pageData.Filter,n)||(m.pageData.Filter=n),u(n)}),a(1,"actions"),_(2,ks,3,0,"button",3),o(),a(3,"filters"),_(4,Vs,11,6,"ng-template",null,0,R),o(),a(6,"content")(7,"div",4)(8,"table",5)(9,"thead",6)(10,"tr")(11,"th",7),l(12,"Code"),o(),a(13,"th",8),l(14,"Name"),o(),a(15,"th",9),l(16,"UnitPrice"),o(),a(17,"th",10),l(18,"Qty"),o(),a(19,"th"),l(20,"Available Models"),o()()(),a(21,"tbody"),_(22,Fs,13,9,"tr",11),o(),a(23,"tfoot")(24,"tr",12),g(25,"td",13),a(26,"td",14),l(27),C(28,"sum"),C(29,"number"),o(),g(30,"td"),o()()()()()()}if(i&2){let t=c();p("pageData",t.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),P("filter",t.pageData.Filter),s(2),p("ngIf",t.roleService.global.Export),s(20),p("ngForOf",t.data.Data),s(5),x(w(29,10,V(28,7,t.data.Data,"Qty")))}}var kn=class i extends Pe{constructor(t,r,n,m,y){super(t,r,"catalog/product/GetOutletProductSheet","catalog/ProductLoader/GetOutletProductSheet");this.csvConverter=n;this.roleService=m;this.matDialog=y}openExportModal(){this.matDialog.open(Le,{data:{title:"Product Sheet",exportTypes:[{ID:"ProductExport/GetOutletProductSheet",Value:"Default",FileName:"Product Sheet"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}static \u0275fac=function(r){return new(r||i)(S(ie),S(A),S(Ve),S(G),S(ne))};static \u0275cmp=E({type:i,selectors:[["POS-product-sheet"]],features:[le],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter","onSubmit","filterChange",4,"ngIf"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","70px"],[2,"width","260px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","100px"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","3"],[1,"text-end"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","placeholder","Choose an outlet","bindLabel","Name","bindValue","ID",3,"ngModelChange","items","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel"],[2,"word-spacing","20px"]],template:function(r,n){r&1&&_(0,Us,31,12,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[J,q,re,$,pe,ce,Mt,Z,Tt]})};var Lr=ii(Xi());var B=class i{INITIAL_STATE={loadForm:{},outlet:{ID:N.GuidEmpty,Name:""},isOpenDialog:!0,isComplete:!1,adjustmentState:0,quickeyItems:{},cartItems:[],order:{Date:(0,Lr.default)().utcOffset("+07:00").format(),EntityID:"",ID:N.GuidEmpty,StateID:4,TypeID:1,Number:"",PIC:"",Note:"",TagID:0},orderComplete:{},NewOrderID:""};#e=Sr(this.INITIAL_STATE);AppConfigJSON=this.#e.select(e=>e.loadForm().AppConfigJSON);LoadForm=this.#e.select(e=>e.loadForm());IsOpenDialog=this.#e.select(e=>e.isOpenDialog());Outlets=this.#e.select(e=>e.loadForm().Entities);Outlet=this.#e.select(e=>e.outlet());IsComplete=this.#e.select(e=>e.isComplete());QuickeyItems=this.#e.select(e=>e.quickeyItems());AdjustmentTypes=this.#e.select(e=>Array.isArray(e.loadForm().AdjustmentTypes)?e.loadForm().AdjustmentTypes.map(t=>k(M({},t),{Value:t.Value.replaceAll("Adjust Differences","Adjust").replaceAll("Update Inventory","Count")})):e.loadForm().AdjustmentTypes);CartItems=this.#e.select(e=>e.cartItems());QtyCartItems=this.#e.select(e=>e.cartItems().reduce((t,r)=>t+r.Quantity,0));Order=this.#e.select(e=>e.order());OrderComplete=this.#e.select(e=>e.orderComplete());AdjustmentState=this.#e.select(e=>e.adjustmentState());SubTotal=this.#e.select(e=>e.cartItems().reduce((t,r)=>t+r.Variant.UnitPrice*r.Quantity,0));NewOrderID=this.#e.select(e=>e.NewOrderID());constructor(){switch(this.AdjustmentState()){case 0:this.onChangeIsOpenDialog(!0);break;case 1:this.onChangeIsOpenDialog(!1);break;case 2:this.onChangeIsOpenDialog(!1);break}}onChangeLoadform(e){this.#e.update("loadForm",e)}onChangeIsOpenDialog(e){this.#e.update("isOpenDialog",e)}onChangeOutlet(e){this.#e.update("outlet",e)}onChangeAdjustmentState(e){this.#e.update("adjustmentState",e)}onChangeQuickeyItems(e){this.#e.update("quickeyItems",e)}onChangeCartItems(e){this.#e.update("cartItems",e)}onChangeIsComplete(){this.#e.update("isComplete",!this.IsComplete())}onChangeAdjustmentOrder(e){this.#e.update("order",e)}onChangeOrderComplete(e){this.#e.update("orderComplete",e)}onChangeNewOrderID(e){this.#e.update("NewOrderID",e)}onResetState(){this.#e.reset()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})};var di=class{ID;VariantID;Quantity;Cost;Price;Expense;Discount;DiscountAmount;Note;Taxable;LoyaltyPoint;EntityID;UnitQuantity;VariantUnitQuantity;InventoryTypeID;Variant;SalesID;UnitCost;UnitPrice;SplitQuantity;isMaxInventory;PromotionGift;constructor(e,t,r,n,m,y,b,oe,Y,ae,Ce,Me,Re,Be,He,We,qe,Ge,ze,$e,Ke,Je){this.ID=e,this.VariantID=t,this.Quantity=r,this.Cost=n,this.Price=m,this.Expense=y,this.Discount=b,this.DiscountAmount=oe,this.Note=Y,this.Taxable=ae,this.LoyaltyPoint=Ce,this.EntityID=Me,this.UnitQuantity=Re,this.VariantUnitQuantity=Be,this.InventoryTypeID=He,this.Variant=We,this.SalesID=qe,this.UnitCost=Ge,this.UnitPrice=ze,this.SplitQuantity=$e,this.isMaxInventory=Ke,this.PromotionGift=Je}},Vn=class i{adapt(e){return new di(e.ID??null,e.VariantID??null,e.Quantity??null,e.Cost??null,e.Price??null,e.Expense??null,e.Discount??null,e.DiscountAmount??null,e.Note??null,e.Taxable??null,e.LoyaltyPoint??null,e.EntityID??null,e.UnitQuantity??null,e.VariantUnitQuantity??null,e.InventoryTypeID??null,e.Variant??null,e.SalesID??null,e.UnitCost??null,e.UnitPrice??null,e.SplitQuantity??null,e.isMaxInventory??null,e.PromotionGift??null)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})},ui=class{constructor(e,t,r,n,m,y,b,oe,Y,ae,Ce,Me,Re,Be,He,We,qe,Ge,ze,$e,Ke,Je,Lt,Qt,Rt,Bt,Ht,Wt,qt,Gt,zt){this.ID=e,this.Name=t,this.Code=r,this.UnitCost=n,this.UnitPrice=m,this.UnitExpense=y,this.UnitQuantity=b,this.PriceDiscount=oe,this.UnitPriceOriginal=Y,this.Description=ae,this.UOM=Ce,this.UOMName=Me,this.ImageUrl=Re,this.TypeID=Be,this.SellPriceType=He,this.OnHand=We,this.Ordered=qe,this.OrderPrice=Ge,this.OrderPriceDiscount=ze,this.Taxable=$e,this.LoyaltyPoint=Ke,this.CategoryName=Je,this.CategoryID=Lt,this.CategoryTypeID=Qt,this.PriceNote=Rt,this.PaymentTypeID=Bt,this.ThumbnailUrl=Ht,this.Storage=Wt,this.Component=qt,this.PriceBook=Gt,this.VariantUnitQuantity=zt}ID;Name;Code;UnitCost;UnitPrice;UnitExpense;UnitQuantity;PriceDiscount;UnitPriceOriginal;Description;UOM;UOMName;ImageUrl;TypeID;SellPriceType;OnHand;Ordered;OrderPrice;OrderPriceDiscount;Taxable;LoyaltyPoint;CategoryName;CategoryID;CategoryTypeID;PriceNote;PaymentTypeID;ThumbnailUrl;Storage;Component;PriceBook;VariantUnitQuantity},Nn=class i{adapt(e){return new ui(e.ID??null,e.Name??null,e.Code??null,e.UnitCost??null,e.UnitPrice??null,e.UnitExpense??null,e.UnitQuantity??null,e.PriceDiscount??null,e.UnitPriceOriginal??null,e.Description??null,e.UOM??null,e.UOMName??null,e.ImageUrl??null,e.TypeID??null,e.SellPriceType??null,e.OnHand??null,e.Ordered??null,e.OrderPrice??null,e.OrderPriceDiscount??null,e.Taxable??null,e.LoyaltyPoint??null,e.CategoryName??null,e.CategoryID??null,e.CategoryTypeID??null,e.PriceNote??null,e.PaymentTypeID??null,e.ThumbnailUrl??null,e.Storage??null,e.Component??null,e.PriceBook??null,e.VariantUnitQuantity??null)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})};var Fn=class i{adapt(e){return{ID:e.ID,VariantID:e.VariantID,Quantity:e.Quantity,Cost:e.Cost,Price:e.Price,Expense:e.Expense,Discount:e.Discount,DiscountAmount:e.DiscountAmount,Note:e.Note,Taxable:e.Taxable,Serial:e.Serial,LoyaltyPoint:e.LoyaltyPoint,EntityID:e.EntityID,UnitQuantity:e.UnitQuantity,VariantUnitQuantity:e.VariantUnitQuantity,InventoryTypeID:e.InventoryTypeID,Variant:e.Variant,SalesID:e.SalesID,UnitCost:e.UnitCost,UnitPrice:e.UnitPrice,SplitQuantity:e.SplitQuantity,isMaxInventory:e.IsMaxInventory,PromotionGift:e.PromotionGift}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})},Un=class i{adapt(e){return{ID:e.ID,Name:e.Name,Code:e.Code,UnitCost:e.UnitCost,UnitPrice:e.UnitPrice,UnitExpense:e.UnitExpense,UnitQuantity:e.UnitQuantity,PriceDiscount:e.PriceDiscount,UnitPriceOriginal:e.UnitPriceOriginal,Description:e.Description,UOM:e.UOM,UOMName:e.UOMName,ImageUrl:e.ImageUrl,TypeID:e.TypeID,SellPriceType:e.SellPriceType,OnHand:e.OnHand,Ordered:e.Ordered,OrderPrice:e.OrderPrice,OrderPriceDiscount:e.OrderPriceDiscount,Taxable:e.OrderPriceDiscount,LoyaltyPoint:e.LoyaltyPoint,CategoryName:e.CategoryName,CategoryID:e.CategoryID,CategoryTypeID:e.CategoryTypeID,PriceNote:e.PriceNote,PaymentTypeID:e.PaymentTypeID,ThumbnailUrl:e.ThumbnailUrl,Storage:e.Storage,Component:e.Component,PriceBook:e.PriceBook,VariantUnitQuantity:e.VariantUnitQuantity}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})},Qr=class i{adapt(e){return{Number:e.Number,Quantity:e.Quantity,ExpiryDate:e.ExpiryDate}}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ne=class i{destroy$=new xe;#e=h(B);#t=h(A);#n=h(Vn);#i=h(Nn);#r=h(ge);#o=h(Fn);#a=h(Un);constructor(){}processOrder(){let e=[...this.#e.CartItems()].map(t=>k(M({},this.#o.adapt(t)),{EntityID:N.GuidEmpty,Note:t.Note??"",SalesID:t.SalesID??"",isMaxInventory:!1,PromotionGift:!1,SplitQuantity:0,UnitCost:t.Cost,Cost:t.Cost,Variant:k(M({},this.#a.adapt(t.Variant)),{Taxable:!!t.Variant.Taxable})}));if(this.#e.AdjustmentState()===0){let t={Items:[...e],Order:{Date:this.#e.Order().Date,EntityID:this.#e.Outlet().ID,ID:N.GuidEmpty,Number:this.#e.Order().Number,StateID:this.#e.Order().StateID,TypeID:this.#e.Order().TypeID,Note:this.#e.Order().Note,PIC:this.#e.Order().PIC,TagID:this.#e.Order().TagID},NewOrderID:this.#e.NewOrderID()};return this.#t.post(Oe.SubmitAdjustment,t).pipe(ve(this.destroy$))}if(this.#e.AdjustmentState()===1){let t=k(M({},this.#e.LoadForm().Data),{Order:k(M({},this.#e.LoadForm().Data.Order),{Note:this.#e.Order().Note,PIC:this.#e.Order().PIC,TagID:this.#e.Order().TagID,Number:this.#e.Order().Number||this.#e.LoadForm().Data.Order.Number,StateID:this.#e.Order().StateID,Date:this.#e.Order().Date||this.#e.LoadForm().Data.Order.Date}),Items:[...e]});return this.#t.post(Oe.SubmitAdjustment,t).pipe(ve(this.destroy$))}}onUpdateOrderState(e,t){if(Object.keys(this.#e.Order()).includes(e)){let n=k(M({},this.#e.Order()),{[e]:t});this.#e.onChangeAdjustmentOrder(n)}else console.error(`Error updating order state with key ${e}`)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ft=class i{destroy$=new xe;#e=h(A);#t=h(B);#n=h(ge);orderService=h(Ne);getLoadForm$=this.#e.post("/API/Adjustment/LoadForm",{EntityID:N.GuidEmpty,ID:N.GuidEmpty}).pipe(_n(),j(e=>{this.#t.onChangeLoadform(e)}));constructor(){}httpRequestLoadForm$(e){return he(this.#t.IsComplete,{injector:this.#n}).pipe(ve(this.destroy$),_e(t=>!t),X(t=>this.#e.post("/API/Adjustment/LoadForm",M({EntityID:"00000000-0000-0000-0000-000000000000",ID:"00000000-0000-0000-0000-000000000000"},e))),j(t=>{this.#t.onChangeLoadform(t),this.orderService.onUpdateOrderState("TypeID",t.AppConfigJSON.ModuleAdjustment.Advance.AdjustmentInputType)}))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ln=class i{destroy$=new xe;#e=h(B);#t=h(A);#n=h(Ne);#i=h(ge);constructor(){this.initialize()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}initialize(){Ii([he(this.#e.Outlet,{injector:this.#i}),he(this.#e.AdjustmentState,{injector:this.#i}),he(this.#e.IsComplete,{injector:this.#i})]).pipe(_n(),_e(([e,t,r])=>N.IsNotEmpty(e.ID)&&!r),X(([e,t])=>this.handleStateChange(e,t))).subscribe()}handleStateChange(e,t){switch(t){case 0:return this.handleStateZero(e);case 1:return this.handleStateOne(e);default:return en}}handleStateZero(e){return this.#t.get(`/api/AdjustmentLoader/LoadRegister?EntityID=${e.ID}&IsEdit=false`).pipe(ve(this.destroy$),j(t=>{this.#e.onChangeQuickeyItems(t.QuickKey),this.#n.onUpdateOrderState("Number",t.Number),this.#e.onChangeNewOrderID(t.NewOrderID)}))}handleStateOne(e){return this.getQuickey(e.ID).pipe(ve(this.destroy$),j(t=>{this.#e.onChangeQuickeyItems(t)}))}getQuickey(e){return this.#t.get(Oe.GetQuickKeyByEntityID,[{key:"ID",value:e}])}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})};var _i=class{get Variant(){return this._Variant}set Variant(e){this._Variant=e}get QtyRequested(){return this._QtyRequested}set QtyRequested(e){this._QtyRequested=e}get TotalPrice(){return this._TotalPrice}set TotalPrice(e){this._TotalPrice=e}get SalesName(){return this._SalesName}set SalesName(e){this._SalesName=e}get PriceNote(){return this._PriceNote}set PriceNote(e){this._PriceNote=e}get SalesID(){return this._SalesID}set SalesID(e){this._SalesID=e}get InventoryTypeID(){return this._InventoryTypeID}set InventoryTypeID(e){this._InventoryTypeID=e}get ID(){return this._ID}set ID(e){this._ID=e}get Code(){return this._Code}set Code(e){this._Code=e}get VariantID(){return this._VariantID}set VariantID(e){this._VariantID=e}get Quantity(){return this._Quantity}set Quantity(e){this._Quantity=e}get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(e){this._UnitQuantity=e}get Expense(){return this._Expense}set Expense(e){this._Expense=e}get Cost(){return this._Cost}set Cost(e){this._Cost=e}get Price(){return this._Price}set Price(e){this._Price=e}get Discount(){return this._Discount}set Discount(e){this._Discount=e}get Note(){return this._Note}set Note(e){this._Note=e}get Taxable(){return this._Taxable}set Taxable(e){this._Taxable=e}get LoyaltyPoint(){return this._LoyaltyPoint}set LoyaltyPoint(e){this._LoyaltyPoint=e}get UnitPriceOriginal(){return this._UnitPriceOriginal}set UnitPriceOriginal(e){this._UnitPriceOriginal=e}get DiscountAmount(){return this._DiscountAmount}set DiscountAmount(e){this._DiscountAmount=e}get Name(){return this._Name}set Name(e){this._Name=e}get PriceTypeID(){return this._PriceTypeID}set PriceTypeID(e){this._PriceTypeID=e}get Storage(){return this._Storage}set Storage(e){this._Storage=e}get Serial(){return this._Serial}set Serial(e){this._Serial=e}get ThumbnailUrl(){return this._ThumbnailUrl}set ThumbnailUrl(e){this._ThumbnailUrl=e}get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}get TypeID(){return this._TypeID}set TypeID(e){this._TypeID=e}get VariantUnitQuantity(){return this._VariantUnitQuantity}set VariantUnitQuantity(e){this._VariantUnitQuantity=e}get UOM(){return this._UOM}set UOM(e){this._UOM=e}get UOMName(){return this._UOMName}set UOMName(e){this._UOMName=e}_Variant;_QtyRequested;_TotalPrice;_SalesName;_PriceNote;_SalesID;_InventoryTypeID;_ID;_Code;_VariantID;_Quantity;_UnitQuantity;_Expense;_Cost;_Price;_Discount;_Note;_Taxable;_LoyaltyPoint;_UnitPriceOriginal;_DiscountAmount;_Name;_PriceTypeID;_Storage;_Serial;_ThumbnailUrl;_UnitPrice;_TypeID;_VariantUnitQuantity;_UOM;_UOMName;constructor(e,t,r,n,m,y,b,oe,Y,ae,Ce,Me,Re,Be,He,We,qe,Ge,ze,$e,Ke,Je,Lt,Qt,Rt,Bt,Ht,Wt,qt,Gt,zt){this._Variant=e,this._QtyRequested=t,this._TotalPrice=r,this._SalesName=n,this._PriceNote=m,this._SalesID=y,this._InventoryTypeID=b,this._ID=oe,this._Code=Y,this._VariantID=ae,this._Quantity=Ce,this._UnitQuantity=Me,this._Expense=Re,this._Cost=Be,this._Price=He,this._Discount=We,this._Note=qe,this._Taxable=Ge,this._LoyaltyPoint=ze,this._UnitPriceOriginal=$e,this._DiscountAmount=Ke,this._Name=Je,this._PriceTypeID=Lt,this._Storage=Qt,this._Serial=Rt,this._ThumbnailUrl=Bt,this._UnitPrice=Ht,this._TypeID=Wt,this._VariantUnitQuantity=qt,this._UOM=Gt,this._UOMName=zt}toJSON(){return{Variant:this.Variant,QtyRequested:this.QtyRequested,TotalPrice:this.TotalPrice,SalesName:this.SalesName,PriceNote:this.PriceNote,SalesID:this.SalesID,InventoryTypeID:this.InventoryTypeID,ID:this.ID,Code:this.Code,VariantID:this.VariantID,Quantity:this.Quantity,UnitQuantity:this.UnitQuantity,Expense:this.Expense,Cost:this.Cost,Price:this.Price,Discount:this.Discount,Note:this.Note,Taxable:this.Taxable,LoyaltyPoint:this.LoyaltyPoint,UnitPriceOriginal:this.UnitPriceOriginal,DiscountAmount:this.DiscountAmount,Name:this.Name,PriceTypeID:this.PriceTypeID,Storage:this.Storage,Serial:this.Serial,ThumbnailUrl:this.ThumbnailUrl,UnitPrice:this.UnitPrice,TypeID:this.TypeID,VariantUnitQuantity:this.VariantUnitQuantity,UOM:this.UOM,UOMName:this.UOMName}}},gi=class{get OnHand(){return this._OnHand}set OnHand(e){this._OnHand=e}get CategoryName(){return this._CategoryName}set CategoryName(e){this._CategoryName=e}get CategoryTypeID(){return this._CategoryTypeID}set CategoryTypeID(e){this._CategoryTypeID=e}get PriceTypeID(){return this._PriceTypeID}set PriceTypeID(e){this._PriceTypeID=e}get PriceNote(){return this._PriceNote}set PriceNote(e){this._PriceNote=e}get UnitPriceOriginal(){return this._UnitPriceOriginal}set UnitPriceOriginal(e){this._UnitPriceOriginal=e}get Ordered(){return this._Ordered}set Ordered(e){this._Ordered=e}get BrandName(){return this._BrandName}set BrandName(e){this._BrandName=e}get ImageUrl(){return this._ImageUrl}set ImageUrl(e){this._ImageUrl=e}get ThumbnailUrl(){return this._ThumbnailUrl}set ThumbnailUrl(e){this._ThumbnailUrl=e}get Component(){return this._Component}set Component(e){this._Component=e}get PriceBook(){return this._PriceBook}set PriceBook(e){this._PriceBook=e}get UOMName(){return this._UOMName}set UOMName(e){this._UOMName=e}get Storage(){return this._Storage}set Storage(e){this._Storage=e}get CategoryID(){return this._CategoryID}set CategoryID(e){this._CategoryID=e}get DiscountAmount(){return this._DiscountAmount}set DiscountAmount(e){this._DiscountAmount=e}get VariantUnitQuantity(){return this._VariantUnitQuantity}set VariantUnitQuantity(e){this._VariantUnitQuantity=e}get ProductCreated(){return this._ProductCreated}set ProductCreated(e){this._ProductCreated=e}get ProductID(){return this._ProductID}set ProductID(e){this._ProductID=e}get ProductIndex(){return this._ProductIndex}set ProductIndex(e){this._ProductIndex=e}get Code(){return this._Code}set Code(e){this._Code=e}get TypeID(){return this._TypeID}set TypeID(e){this._TypeID=e}get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(e){this._UnitQuantity=e}get SalesCommission(){return this._SalesCommission}set SalesCommission(e){this._SalesCommission=e}get Description(){return this._Description}set Description(e){this._Description=e}get Image(){return this._Image}set Image(e){this._Image=e}get Discontinued(){return this._Discontinued}set Discontinued(e){this._Discontinued=e}get Taxable(){return this._Taxable}set Taxable(e){this._Taxable=e}get LoyaltyPoint(){return this._LoyaltyPoint}set LoyaltyPoint(e){this._LoyaltyPoint=e}get PackSize(){return this._PackSize}set PackSize(e){this._PackSize=e}get CreatorId(){return this._CreatorId}set CreatorId(e){this._CreatorId=e}get Created(){return this._Created}set Created(e){this._Created=e}get UnitExpense(){return this._UnitExpense}set UnitExpense(e){this._UnitExpense=e}get SellPriceType(){return this._SellPriceType}set SellPriceType(e){this._SellPriceType=e}get VariantType(){return this._VariantType}set VariantType(e){this._VariantType=e}get CostCurrencyID(){return this._CostCurrencyID}set CostCurrencyID(e){this._CostCurrencyID=e}get UnitCost(){return this._UnitCost}set UnitCost(e){this._UnitCost=e}get OrderPrice(){return this._OrderPrice}set OrderPrice(e){this._OrderPrice=e}get OrderPriceDiscount(){return this._OrderPriceDiscount}set OrderPriceDiscount(e){this._OrderPriceDiscount=e}get OrderPriceDiscountDetail(){return this._OrderPriceDiscountDetail}set OrderPriceDiscountDetail(e){this._OrderPriceDiscountDetail=e}get PriceCurrencyID(){return this._PriceCurrencyID}set PriceCurrencyID(e){this._PriceCurrencyID=e}get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}get PriceDiscount(){return this._PriceDiscount}set PriceDiscount(e){this._PriceDiscount=e}get PaymentTypeID(){return this._PaymentTypeID}set PaymentTypeID(e){this._PaymentTypeID=e}get PaymentTypeString(){return this._PaymentTypeString}set PaymentTypeString(e){this._PaymentTypeString=e}get SellPriceTypeString(){return this._SellPriceTypeString}set SellPriceTypeString(e){this._SellPriceTypeString=e}get Weight(){return this._Weight}set Weight(e){this._Weight=e}get CostCurrencySymbol(){return this._CostCurrencySymbol}set CostCurrencySymbol(e){this._CostCurrencySymbol=e}get PriceCurrencySymbol(){return this._PriceCurrencySymbol}set PriceCurrencySymbol(e){this._PriceCurrencySymbol=e}get UOM(){return this._UOM}set UOM(e){this._UOM=e}get MeasurementID(){return this._MeasurementID}set MeasurementID(e){this._MeasurementID=e}get UOMQ(){return this._UOMQ}set UOMQ(e){this._UOMQ=e}get Name(){return this._Name}set Name(e){this._Name=e}get Model(){return this._Model}set Model(e){this._Model=e}get ID(){return this._ID}set ID(e){this._ID=e}_OnHand;_CategoryName;_CategoryTypeID;_PriceTypeID;_PriceNote;_UnitPriceOriginal;_Ordered;_BrandName;_ImageUrl;_ThumbnailUrl;_Component;_PriceBook;_UOMName;_Storage;_CategoryID;_DiscountAmount;_VariantUnitQuantity;_ProductCreated;_ProductID;_ProductIndex;_Code;_TypeID;_UnitQuantity;_SalesCommission;_Description;_Image;_Discontinued;_Taxable;_LoyaltyPoint;_PackSize;_CreatorId;_Created;_UnitExpense;_SellPriceType;_VariantType;_CostCurrencyID;_UnitCost;_OrderPrice;_OrderPriceDiscount;_OrderPriceDiscountDetail;_PriceCurrencyID;_UnitPrice;_PriceDiscount;_PaymentTypeID;_PaymentTypeString;_SellPriceTypeString;_Weight;_CostCurrencySymbol;_PriceCurrencySymbol;_UOM;_MeasurementID;_UOMQ;_Name;_Model;_ID;constructor(e,t,r,n,m,y,b,oe,Y,ae,Ce,Me,Re,Be,He,We,qe,Ge,ze,$e,Ke,Je,Lt,Qt,Rt,Bt,Ht,Wt,qt,Gt,zt,$r,Kr,Jr,Zr,Yr,Xr,eo,to,no,io,ro,oo,ao,so,lo,mo,po,co,uo,_o,go,fo,ho,yo){this._OnHand=e,this._CategoryName=t,this._CategoryTypeID=r,this._PriceTypeID=n,this._PriceNote=m,this._UnitPriceOriginal=y,this._Ordered=b,this._BrandName=oe,this._ImageUrl=Y,this._ThumbnailUrl=ae,this._Component=Ce,this._PriceBook=Me,this._UOMName=Re,this._Storage=Be,this._CategoryID=He,this._DiscountAmount=We,this._VariantUnitQuantity=qe,this._ProductCreated=Ge,this._ProductID=ze,this._ProductIndex=$e,this._Code=Ke,this._TypeID=Je,this._UnitQuantity=Lt,this._SalesCommission=Qt,this._Description=Rt,this._Image=Bt,this._Discontinued=Ht,this._Taxable=Wt,this._LoyaltyPoint=qt,this._PackSize=Gt,this._CreatorId=zt,this._Created=$r,this._UnitExpense=Kr,this._SellPriceType=Jr,this._VariantType=Zr,this._CostCurrencyID=Yr,this._UnitCost=Xr,this._OrderPrice=eo,this._OrderPriceDiscount=to,this._OrderPriceDiscountDetail=no,this._PriceCurrencyID=io,this._UnitPrice=ro,this._PriceDiscount=oo,this._PaymentTypeID=ao,this._PaymentTypeString=so,this._SellPriceTypeString=lo,this._Weight=mo,this._CostCurrencySymbol=po,this._PriceCurrencySymbol=co,this._UOM=uo,this._MeasurementID=_o,this._UOMQ=go,this._Name=fo,this._Model=ho,this._ID=yo}toJSON(){return{OnHand:this.OnHand,CategoryName:this.CategoryName,CategoryTypeID:this.CategoryTypeID,PriceTypeID:this.PriceTypeID,PriceNote:this.PriceNote,UnitPriceOriginal:this.UnitPriceOriginal,Ordered:this.Ordered,BrandName:this.BrandName,ImageUrl:this.ImageUrl,ThumbnailUrl:this.ThumbnailUrl,Component:this.Component,PriceBook:this.PriceBook,UOMName:this.UOMName,Storage:this.Storage,CategoryID:this.CategoryID,DiscountAmount:this.DiscountAmount,VariantUnitQuantity:this.VariantUnitQuantity,ProductCreated:this.ProductCreated,ProductID:this.ProductID,ProductIndex:this.ProductIndex,Code:this.Code,TypeID:this.TypeID,UnitQuantity:this.UnitQuantity,SalesCommission:this.SalesCommission,Description:this.Description,Image:this.Image,Discontinued:this.Discontinued,Taxable:this.Taxable,LoyaltyPoint:this.LoyaltyPoint,PackSize:this.PackSize,CreatorId:this.CreatorId,Created:this.Created,UnitExpense:this.UnitExpense,SellPriceType:this.SellPriceType,VariantType:this.VariantType,CostCurrencyID:this.CostCurrencyID,UnitCost:this.UnitCost,OrderPrice:this.OrderPrice,OrderPriceDiscount:this.OrderPriceDiscount,OrderPriceDiscountDetail:this.OrderPriceDiscountDetail,PriceCurrencyID:this.PriceCurrencyID,UnitPrice:this.UnitPrice,PriceDiscount:this.PriceDiscount,PaymentTypeID:this.PaymentTypeID,PaymentTypeString:this.PaymentTypeString,SellPriceTypeString:this.SellPriceTypeString,Weight:this.Weight,CostCurrencySymbol:this.CostCurrencySymbol,PriceCurrencySymbol:this.PriceCurrencySymbol,UOM:this.UOM,MeasurementID:this.MeasurementID,UOMQ:this.UOMQ,Name:this.Name,Model:this.Model,ID:this.ID}}},Qe=class i{adapt(e){return new _i(e.Variant??null,e.QtyRequested??null,e.TotalPrice??null,e.SalesName??null,e.PriceNote??null,e.SalesID??null,e.InventoryTypeID??null,e.ID??null,e.Code??null,e.VariantID??null,e.Quantity??null,e.UnitQuantity??null,e.Expense??null,e.Cost??null,e.Price??null,e.Discount??null,e.Note??null,e.Taxable??null,e.LoyaltyPoint??null,e.UnitPriceOriginal??null,e.DiscountAmount??null,e.Name??null,e.PriceTypeID??null,e.Storage??null,e.Serial??null,e.ThumbnailUrl??null,e.UnitPrice??null,e.TypeID??null,e.VariantUnitQuantity??null,e.UOM??null,e.UOMName??null).toJSON()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})},Ut=class i{adapt(e){return new gi(e.OnHand??null,e.CategoryName??null,e.CategoryTypeID??null,e.PriceTypeID??null,e.PriceNote??null,e.UnitPriceOriginal??null,e.Ordered??null,e.BrandName??null,e.ImageUrl??null,e.ThumbnailUrl??null,e.Component??null,e.PriceBook??null,e.UOMName??null,e.Storage??null,e.CategoryID??null,e.DiscountAmount??null,e.VariantUnitQuantity??null,e.ProductCreated??null,e.ProductID??null,e.ProductIndex??null,e.Code??null,e.TypeID??null,e.UnitQuantity??null,e.SalesCommission??null,e.Description??null,e.Image??null,e.Discontinued??null,e.Taxable??null,e.LoyaltyPoint??null,e.PackSize??null,e.CreatorId??null,e.Created??null,e.UnitExpense??null,e.SellPriceType??null,e.VariantType??null,e.CostCurrencyID??null,e.UnitCost??null,e.OrderPrice??null,e.OrderPriceDiscount??null,e.OrderPriceDiscountDetail??null,e.PriceCurrencyID??null,e.UnitPrice??null,e.PriceDiscount??null,e.PaymentTypeID??null,e.PaymentTypeString??null,e.SellPriceTypeString??null,e.Weight??null,e.CostCurrencySymbol??null,e.PriceCurrencySymbol??null,e.UOM??null,e.MeasurementID??null,e.UOMQ??null,e.Name??null,e.Model??null,e.ID??null).toJSON()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})};var Qn=class i{modalConfig;storeService=h(B);#e=h(St);#t=h(Te);form;constructor(){this.modalConfig=new we,this.modalConfig.customWidth="400px",this.modalConfig.title="Adjustment Note",this.modalConfig.disableKeyup=!0}generateForm(){this.form=this.#e.group({PIC:[this.storeService.Order().PIC||""],Note:[this.storeService.Order().Note||""],TagID:new it(this.storeService.Order().TagID||null)})}onOK(){let e=this.form.value;this.#t.close(e)}onCancel(){this.#t.close()}ngOnInit(){this.generateForm()}handleKeyDown(e){console.log("event",e),e.code==="F2"&&this.onOK()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["POS-modal-cart-note"]],hostBindings:function(t,r){t&1&&f("keydown",function(m){return r.handleKeyDown(m)},!1,Ue)},standalone:!0,features:[Q],decls:15,vars:3,consts:[[3,"onOk","onCancel","onClose","config"],[1,"w-100","h-100","d-flex","flex-column","gap-4",3,"formGroup"],[1,"w-100"],[1,"mb-3"],["placeholder","Choose Adjustment Tag","formControlName","TagID","bindLabel","Name","bindValue","ID","appendTo","body",3,"items"],["type","text","formControlName","PIC",1,"form-control","w-100","height-input"],["formControlName","Note","rows","4",1,"form-control","w-100","ps-2"]],template:function(t,r){t&1&&(a(0,"modal-material",0),f("onOk",function(){return r.onOK()})("onCancel",function(){return r.onCancel()})("onClose",function(){return r.onCancel()}),a(1,"content")(2,"div",1)(3,"div",2)(4,"strong",3),l(5,"Tag"),o(),g(6,"ng-select",4),o(),a(7,"div",2)(8,"strong",3),l(9,"PIC"),o(),g(10,"input",5),o(),a(11,"div",2)(12,"strong",3),l(13,"Note"),o(),g(14,"textarea",6),o()()()()),t&2&&(p("config",r.modalConfig),s(2),p("formGroup",r.form),s(4),p("items",r.storeService.LoadForm().AdjustmentTags))},dependencies:[ue,Ee,rt,De,$,Ct,ot,vt,xt,Dt,ce]})};var Rn=class i{modalConfig;#e=h(Te);constructor(){this.modalConfig=new we,this.modalConfig.customWidth="400px",this.modalConfig.title="Void Transaction?"}onOK(){this.#e.close({type:"OK",data:null})}onCancel(){this.#e.close({type:"Cancel",data:null})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["POS-modal-cart-void"]],standalone:!0,features:[Q],decls:5,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"fw-normal"]],template:function(t,r){t&1&&(a(0,"modal-material",0),f("onOk",function(){return r.onOK()})("onCancel",function(){return r.onCancel()})("onClose",function(){return r.onCancel()}),a(1,"content")(2,"div",1)(3,"h4",2),l(4,"This will erase all current data. Are you sure?"),o()()()()),t&2&&p("config",r.modalConfig)},dependencies:[ue,Ee]})};var ye=class i{variantSearchCTRL=new it({});#e=h(B);#t=h(A);#n=h(ge);#i=h(Qe);#r=h(ne);#o=h(Ut);destroy$=new xe;toastr=h(fe);httpGetVariantByID(e,t=!0){let r={entityID:this.#e.Outlet().ID,id:e};return this.#t.post("/API/catalog/variant/GetVariantByID",r).pipe(Se(n=>this.generateCartItem(n)),j(n=>{t&&this.onAddCartItem(n)}))}httpRequestVariantByCode(e){let{Digit:t,QuantityDivider:r,Regex:n}=this.#e.LoadForm().AppConfigJSON.ModuleAdjustment.DigitalScale;if(e.length===t){let y=new RegExp(n).exec(e);if(Object.is(y,null))return this.#t.get(`${Oe.GetVariantByCode}?Code=${e}&EntityID=${this.#e.Outlet().ID}`).pipe(Se(b=>this.generateCartItem(b)),j(b=>{this.onAddCartItem(b)}));{let b=y[1],oe=parseFloat(y[2])/r;return this.#t.get(`${Oe.GetVariantByCode}?Code=${b}&EntityID=${this.#e.Outlet().ID}`).pipe(Se(Y=>this.generateCartItem(Y)),j(Y=>{this.onAddCartItem(Y,!1,oe)}),dt(Y=>(this.toastr.info("Matching Regex Rule to Barcode","Digital Scale"),this.#t.get(`${Oe.GetVariantByCode}?Code=${e}&EntityID=${this.#e.Outlet().ID}`).pipe(Se(ae=>this.generateCartItem(ae)),j(ae=>{this.onAddCartItem(ae)})))))}}else return this.#t.get(`${Oe.GetVariantByCode}?Code=${e}&EntityID=${this.#e.Outlet().ID}`).pipe(Se(m=>this.generateCartItem(m)),j(m=>{this.onAddCartItem(m)}))}httpRequestGetInventoryByVariantID(e){return he(this.#e.Outlet,{injector:this.#n}).pipe(ve(this.destroy$),_e(t=>N.IsNotEmpty(t.ID)),nn(),X(t=>this.#t.get(Oe.GetVariantStockByID,[{key:"EntityID",value:t.ID},{key:"ID",value:e}])))}addItemByVariantID(e){this.httpGetVariantByID(e).pipe(ve(this.destroy$)).subscribe()}onAddCartItem(e,t=!1,r=1){let n=this.#e.CartItems(),m=n.findIndex(b=>b.VariantID===e.VariantID),y=[];m!==-1?t?y=[...n,e]:(n[m].Quantity+=r,y=[...n]):y=[...n,k(M({},e),{Quantity:r})],this.#e.onChangeCartItems(y)}generateCartItem(e){return this.#i.adapt(k(M({},e),{ID:N.GuidEmpty,Cost:e.UnitCost,Expense:e.UnitCost,SplitQuantity:0,UnitCost:e.UnitCost,InventoryTypeID:4,Price:e.UnitPrice,Name:e.Name,ThumbnailUrl:e.ThumbnailUrl,UnitPrice:e.UnitPrice,UnitQuantity:e.UnitQuantity,Quantity:1,Code:e.Code,TypeID:e.TypeID,Discount:e.PriceDiscount,EntityID:N.GuidEmpty,VariantUnitQuantity:e.VariantUnitQuantity,Storage:e.Storage,UOM:e.UOM,UOMName:e.UOMName,VariantID:e.ID,Variant:this.#o.adapt(e)}))}onRemoveCartItem(e){let t=this.#e.CartItems().filter((r,n)=>e!==n);this.#e.onChangeCartItems(t)}onOpenCartNoteModal(){return this.#r.open(Qn)}onOpenCartVoidModal(){return this.#r.open(Rn)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})};var Qs=(i,e)=>e.key,Rs=i=>({selected:i}),Bs=()=>["/menu/Products/Catalog/Variants/Info"];function Hs(i,e){if(i&1){let t=v();a(0,"a",8),f("click",function(){d(t);let n=c().$implicit,m=c();return u(m.onTabChange(n.key))}),l(1),o()}if(i&2){let t=c().$implicit,r=c();p("ngClass",U(2,Rs,r.activeTab().key===t.key)),s(),I(" ",t.label," ")}}function Ws(i,e){if(i&1&&_(0,Hs,2,4,"a",7),i&2){let t=e.$implicit;me(t.isVisible?0:-1)}}function qs(i,e){i&1&&(a(0,"div",12)(1,"h5"),l(2,"Cost"),o(),g(3,"input",18),o())}function Gs(i,e){if(i&1){let t=v();a(0,"div",5)(1,"div",9)(2,"div",10)(3,"h5"),l(4,"Qty"),o(),g(5,"input",11,0),o(),a(7,"div",12)(8,"h5"),l(9,"Price"),o(),g(10,"input",13),o(),_(11,qs,4,0,"div",14),o(),H(12),a(13,"div",9)(14,"div",15)(15,"h5",16),l(16,"Note"),o(),a(17,"POS-tinymce-editor",17),f("valueChange",function(n){d(t);let m=c();return u(m.onNoteChange(n))}),o()()(),W(),o()}if(i&2){let t,r=c();p("formGroup",r.form),s(11),p("ngIf",r.roleService.product.Cost),s(6),p("value",(t=r.form.get("Note"))==null?null:t.value)}}function zs(i,e){if(i&1&&g(0,"img",30),i&2){let t=c(3);p("ngSrc",t.cartItem.ThumbnailUrl)}}function $s(i,e){i&1&&_(0,zs,1,1,"ng-template")}function Ks(i,e){i&1&&(H(0),g(1,"i",31),a(2,"h6"),l(3,"No Image"),o(),W())}function Js(i,e){if(i&1&&(H(0),a(1,"div",19)(2,"div",20)(3,"a",21),_(4,$s,1,0)(5,Ks,4,0,"ng-container"),o()(),a(6,"div",22)(7,"div",23),g(8,"i",24),a(9,"div",25),l(10," Inventory "),o()(),a(11,"table",26)(12,"tbody")(13,"tr")(14,"td",27),l(15," On Hand "),o(),a(16,"td",28),l(17),o()(),a(18,"tr")(19,"td",29),l(20,"Allocated"),o(),a(21,"td",28),l(22),o()(),a(23,"tr")(24,"td",29),l(25,"Available"),o(),a(26,"td",28),l(27),o()(),a(28,"tr")(29,"td",29),l(30,"ROP"),o(),a(31,"td",28),l(32),o()(),a(33,"tr")(34,"td",29),l(35,"Max"),o(),a(36,"td",28)(37,"span"),l(38),o()()()()()()(),W()),i&2){let t=c();s(3),p("routerLink",te(7,Bs)),s(),me(t.cartItem.ThumbnailUrl?4:5),s(13),I(" ",t.inventory().ON_HAND," "),s(5),I(" ",t.inventory().ALLOCATED," "),s(5),I(" ",t.inventory().AVAILABLE," "),s(5),I(" ",t.inventory().ROP," "),s(6),x(t.inventory().MAX)}}function Zs(i,e){if(i&1){let t=v();a(0,"POS-tab-serial",32),T("variantChange",function(n){d(t);let m=c();return D(m.cartItem,n)||(m.cartItem=n),u(n)})("serialsChange",function(n){d(t);let m=c();return D(m.serials,n)||(m.serials=n),u(n)}),o()}if(i&2){let t=c();p("isEditBuyForm",!1)("outletID",t.storeService.Outlet().ID),P("variant",t.cartItem)("serials",t.serials)}}var Bn=class i{constructor(e){this.data=e;this.cartItem=JSON.parse(JSON.stringify(this.storeService.CartItems()[this.data.index])),this.modalConfig.title=this.cartItem.Variant.Name,this.modalConfig.customWidth="650px",this.modalConfig.bodyScrollable=!0}storeService=h(B);roleService=h(G);modalConfig=new we;cartItem;form;tabs=z([]);activeTab=cn(()=>this.tabs().filter(e=>e.isActive)[0]);isItemSerial=z(!1);inventory=z({ON_HAND:0,ALLOCATED:0,AVAILABLE:0,ROP:0,MAX:0});serials=[];#e=h(St);#t=h(Te);#n=h(Qe);#i=h(ye);#r=h(ge);#o=h(fe);itemQuantity=z(1);itemPrice=z("");itemCost=z("");itemNote=z("");onTabChange(e){let t=this.tabs().map(r=>r.key===e?k(M({},r),{isActive:!0}):k(M({},r),{isActive:!1}));this.tabs.set(t)}generateForm(){this.form=this.#e.group({Quantity:this.cartItem.Quantity??0,Price:this.cartItem.Price??0,Cost:this.cartItem.Cost??0,Note:this.cartItem.Note??""})}ngOnInit(){he(this.storeService.CartItems,{injector:this.#r}).pipe(j(e=>{this.cartItem=e[this.data.index]})).subscribe(),this.generateForm(),this.isItemSerial.set(this.checkIsSerial()),this.tabs.set([{key:0,value:"cart",label:"Cart",isActive:!0,isVisible:!0},{key:1,value:"product",label:"Product",isActive:!1,isVisible:this.roleService.inventory.View&&this.cartItem.Variant.Name.length>0},{key:2,value:"serial",label:"Serial",isActive:!1,isVisible:!0}]),this.requestUnitInStock().subscribe({next:e=>this.inventory.set(k(M({},this.inventory()),{ALLOCATED:Number(e.Allocated),MAX:Number(e.Max),ON_HAND:Number(e.OnHand),ROP:Number(e.ROP),AVAILABLE:Number(+e.OnHand-+e.Allocated)}))}),this.form.valueChanges.pipe(j(e=>{let t=this.storeService.CartItems().reduce((r,n,m)=>(this.data.index===m?r.push(M({},this.#n.adapt(k(M({},n),{Quantity:+e.Quantity,Price:+e.Price,Cost:+e.Cost,Note:e.Note})))):r.push(n),r),[]);this.storeService.onChangeCartItems(t)}),st("edit")).subscribe()}onNoteChange(e){this.form.get("Note").setValue(e)}onOK(){if(this.checkIsSerial()){if(Array.isArray(this.cartItem.Serial)&&this.cartItem.Serial.length){let e=this.cartItem.Serial.reduce((t,r)=>t+r.Quantity,0);if(this.cartItem.Quantity!==e){this.#o.warning("Serial must be equal with the quantity",se.Warning);return}}if(this.cartItem.Quantity<0){let e=this.storeService.CartItems().reduce((t,r,n)=>(this.data.index===n?t.push(M({},this.#n.adapt(k(M({},r),{Quantity:+this.cartItem.Quantity,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):t.push(r),t),[]);this.storeService.onChangeCartItems(e)}if(this.cartItem.Quantity>0){let e=this.storeService.CartItems().reduce((t,r,n)=>(this.data.index===n?t.push(M({},this.#n.adapt(k(M({},r),{Quantity:+this.cartItem.Quantity,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value,Serial:this.cartItem.Serial})))):t.push(r),t),[]);this.storeService.onChangeCartItems(e)}}else{let e=this.storeService.CartItems().reduce((t,r,n)=>(this.data.index===n?t.push(M({},this.#n.adapt(k(M({},r),{Quantity:+this.form.get("Quantity")?.value,Price:+this.form.get("Price")?.value,Cost:+this.form.get("Cost")?.value,Note:this.form.get("Note")?.value})))):t.push(r),t),[]);this.storeService.onChangeCartItems(e)}this.#t.close()}checkIsSerial(){return this.cartItem.Variant!==void 0?this.cartItem.Variant.TypeID===4:!1}requestUnitInStock(){if(N.IsEmpty(this.storeService.Outlet().ID)){this.#o.error("Please select outlet before proceding...",se.Error);return}return he(this.activeTab,{injector:this.#r}).pipe(_e(e=>e.key===1),nn(),X(e=>this.#i.httpRequestGetInventoryByVariantID(this.cartItem.VariantID)))}onCancel(){this.#t.close()}static \u0275fac=function(t){return new(t||i)(S(bt))};static \u0275cmp=E({type:i,selectors:[["adjustment-modal-edit-product"]],standalone:!0,features:[Q],decls:11,vars:2,consts:[["qty",""],[3,"onOk","onCancel","onClose","config"],[1,"container","w-100","h-100"],[1,"row","border-bottom"],[1,"container-fluid","mt-5"],[3,"formGroup"],[3,"isEditBuyForm","outletID","variant","serials"],[1,"btn","btn-link",3,"ngClass"],[1,"btn","btn-link",3,"click","ngClass"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["formControlName","Price","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],["class","col-auto ps-0",4,"ngIf"],[1,"col-12"],[1,"mb-5"],["height","220px",3,"valueChange","value"],["formControlName","Cost","type","text","autoNum","",1,"mt-5","form-control",2,"width","100px"],[1,"row"],[1,"col-sm-4","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink"],[1,"col-sm-6"],[1,"d-flex"],["aria-hidden","true",1,"fa-archive","fa-solid","fa-1x","pt-3","pe-2"],[2,"font-size","15px","font-family","'Roboto Slab'"],[1,"table","table-bordered","text-center","inventory-table"],[1,"table-light","text-start",2,"width","100px"],[1,"text-end"],[1,"table-light","text-start"],["width","400","height","400",1,"border","rounded",3,"ngSrc"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[3,"variantChange","serialsChange","isEditBuyForm","outletID","variant","serials"]],template:function(t,r){if(t&1&&(a(0,"modal-material",1),f("onOk",function(){return r.onOK()})("onCancel",function(){return r.onCancel()})("onClose",function(){return r.onCancel()}),a(1,"content")(2,"div",2)(3,"div",3)(4,"div"),Ze(5,Ws,1,1,null,null,Qs),o()()(),a(7,"div",4),_(8,Gs,18,3,"div",5)(9,Js,39,8,"ng-container")(10,Zs,1,4,"POS-tab-serial",6),o()()()),t&2){let n;p("config",r.modalConfig),s(5),Ye(r.tabs()),s(3),me((n=r.activeTab().key)===0?8:n===1?9:n===2?10:-1)}},dependencies:[ue,Ee,Ie,tt,q,ot,De,$,Ct,vt,xt,jt,vn,Kt,be,Mi,xn,Pt,ke],styles:[".bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}autocompleteV2[_ngcontent-%COMP%] mat-form-field input{padding:10px 15px!important}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}.inventory-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .inventory-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:6px!important}p-chips[_ngcontent-%COMP%] ul.p-inputtext{width:570px;max-width:570px;border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] ul.p-inputtext li.p-chips-input-token>input[type=text]{border:none}p-chips[_ngcontent-%COMP%] .p-chips .p-chips-multiple-container:not(.p-disabled):hover{border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container{display:inline-block}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container .p-chips-token{margin:2px;background:#96bf48}"]})};function Ys(i,e){if(i&1){let t=v();a(0,"div",27)(1,"button",28),f("click",function(){d(t);let n=c().index,m=c(2);return u(m.onReturnVariant(n))}),l(2," Return "),o(),a(3,"button",28),f("click",function(){d(t);let n=c().index,m=c(2);return u(m.onPurchaseVariant(n))}),l(4," Purchase "),o()()}}function Xs(i,e){if(i&1&&(a(0,"td",29),l(1),o()),i&2){let t=c().index;s(),I(" ",t+1,". ")}}function el(i,e){if(i&1){let t=v();H(0),a(1,"div",30)(2,"img",31),f("error",function(n){d(t);let m=c(3);return u(m.onErrorImage(n))}),o()(),W()}if(i&2){let t=c().$implicit;s(2),p("src",t.Variant.ThumbnailUrl,gt)("alt",t.Variant.Name)}}function tl(i,e){i&1&&(a(0,"div",32),g(1,"i",33),o())}function nl(i,e){if(i&1&&(a(0,"span"),l(1),C(2,"number"),o()),i&2){let t=c().$implicit;s(),x(w(2,1,t.Quantity))}}function il(i,e){i&1&&(a(0,"span",34),l(1," x "),o())}function rl(i,e){if(i&1&&(a(0,"span"),l(1),C(2,"number"),o()),i&2){let t=c().$implicit;s(),x(w(2,1,t.UnitQuantity))}}function ol(i,e){if(i&1&&(H(0),a(1,"small",35),l(2),o(),W()),i&2){let t=c().$implicit;s(2),x(t.Variant.UOM?t.Variant.UOMName:"")}}function al(i,e){if(i&1&&(H(0),a(1,"div",36),l(2),C(3,"number"),o(),W()),i&2){let t=c().$implicit;s(2),I(" ",V(3,1,t.Price,"1.0-4")," ")}}function sl(i,e){if(i&1){let t=v();H(0),a(1,"tr",7),f("click",function(){let n=d(t).index,m=c(2);return u(m.onOpenModalEditProduct(n))}),_(2,Ys,5,0,"ng-template",null,1,R)(4,Xs,2,1,"td",8),a(5,"td",9)(6,"div",10),_(7,el,3,2,"ng-container",3)(8,tl,2,0,"ng-template",null,2,R),a(10,"div",11)(11,"div"),l(12),o(),a(13,"span",12),l(14),o(),a(15,"div"),g(16,"app-serial-note",13),o(),g(17,"small",14),o()()(),a(18,"td",15)(19,"div",16)(20,"div",17)(21,"span"),_(22,nl,3,3,"span",18)(23,il,2,0,"span",19)(24,rl,3,3,"span",18),o(),_(25,ol,3,1,"ng-container",18),o()()(),a(26,"td"),_(27,al,4,4,"ng-container",18),o(),a(28,"td")(29,"div",20),l(30),C(31,"number"),o()(),a(32,"td",21)(33,"div",16)(34,"div",22),l(35),C(36,"number"),o()()(),a(37,"td",23)(38,"div",24)(39,"span",25),f("click",function(){let n=d(t).index,m=c(2);return u(m.removeCartItem(n))}),g(40,"i",26),o()()()(),W()}if(i&2){let t,r,n=e.$implicit,m=ee(3),y=ee(9),b=c(2);s(),p("cdkContextMenuTriggerFor",m)("cdkDragDisabled",b.isMobileDevice()),s(3),p("ngIf",(t=b.AppConfigJSON())==null?null:t.ModuleSell.Grid.RowNumberVisible),s(3),p("ngIf",n.Variant.ThumbnailUrl)("ngIfElse",y),s(5),x(n.Variant.Name),s(2),x(n.Variant.Code),s(2),p("serials",n.Serial),s(),p("innerHtml",n.Note,F),s(5),p("ngIf",n.Quantity!=1||n.UnitQuantity>1),s(),p("ngIf",n.UnitQuantity>1||n.UnitQuantity<-1),s(),p("ngIf",n.UnitQuantity>1||n.UnitQuantity<-1),s(),p("ngIf",n.Variant.UOM&&((r=b.AppConfigJSON())==null||r.ModuleSell==null?null:r.ModuleSell.Grid.UOMVisible)),s(2),p("ngIf",n.UnitPrice!==n.Total&&n.Quantity>1),s(3),I(" ",n.Discount?w(31,16,n.Discount*-1)+"%":""," "),s(5),I(" ",b.roleService.product!=null&&b.roleService.product.Price?w(36,18,+n.Quantity*+n.Variant.UnitPrice):" - "," ")}}function ll(i,e){if(i&1){let t=v();H(0),a(1,"table",4)(2,"tbody",5),f("cdkDropListDropped",function(n){d(t);let m=c();return u(m.onDrop(n))}),_(3,sl,41,20,"ng-container",6),o()(),W()}if(i&2){let t=c();s(3),p("ngForOf",t.CartItems())}}function ml(i,e){i&1&&(a(0,"div",37)(1,"div",38)(2,"div",39)(3,"div",40)(4,"div",41),g(5,"i",42),o(),a(6,"div",43)(7,"span"),l(8,"Empty Cart"),o(),g(9,"br"),a(10,"span"),l(11,"Add products to the cart"),o(),g(12,"br"),a(13,"span"),l(14,"or scan barcode"),o()()()()()())}var Hn=class i{roleService=h(G);storeService=h(B);cartService=h(ye);matDialog=h(ne);renderer=h(sn);#e=h(Qe);CartItems=this.storeService.CartItems;AppConfigJSON=this.storeService.AppConfigJSON;onDrop(e){}onOpenModalEditProduct(e){let t=this.matDialog.open(Bn,{data:{index:e}})}removeCartItem(e){this.cartService.onRemoveCartItem(e)}onErrorImage(e){console.log("img erro",e);let t=e.target;this.renderer.setStyle(t,"border","1px solid #dddddd"),this.renderer.setStyle(t,"border-radius","4px"),this.renderer.setAttribute(t,"alt","")}onReturnVariant(e){let t=this.storeService.CartItems().reduce((r,n,m)=>(e===m?r.push(M({},this.#e.adapt(k(M({},n),{Quantity:-Math.abs(n.Quantity),TotalPrice:-Math.abs(n.Quantity)*n.Price})))):r.push(n),r),[]);this.storeService.onChangeCartItems(t)}onPurchaseVariant(e){let t=this.storeService.CartItems().reduce((r,n,m)=>(e===m?r.push(M({},this.#e.adapt(k(M({},n),{Quantity:Math.abs(n.Quantity),TotalPrice:Math.abs(n.Quantity)*n.Price})))):r.push(n),r),[]);this.storeService.onChangeCartItems(t)}isMobileDevice(){let e=navigator.userAgent||"";return/android|avantgo|bada\/|blackberry|bb10|blazer|compal|elaine|fennec|hiptop|iemobile|iphone|ipod|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|acer|airn|al(av|ca)|amoi|anex|anyw|aptu|ar(ch|go)|as(te|us)|attw|au(di|m)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw(n|u)|c55\/|capi|ccwa|cdm|cell|chtm|cldc|cmd|co(mp|nd)|craw|da(it|ll)|dbte|dc|devi|dica|dmob|do(c|p)o|ds(12|d)|el(ai)|em(l2)|er(ic|k0)|esl8|ez(40|os|wa|ze)|fetc|fly|g1 u|g560|gene|gf5|gmo|go(\.w|od)|gr(ad|un)|haie|hcit|hd(m|p|t)|hei|hi(pt|ta)|hp i|hs(c)|ht(c|tp)|hu(aw|tc)|i(ma|go)|i230|iac|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(v)a|jbro|jemu|jigs|kddi|keji|kgt|klon|kpt |kwc|kyo|le(no|xi)|lg( g|\/k|50)|libw|lynx|m1|m3ga|m50|ma(te|ui|xo)|mc(01|21)|me(rc|ri)|mi(o8|oa)|mmef|mo(01|bi|zz)|mt(50|p1)|mwbp|mywa|n10|n20|n30|n50|n70|ne(c|m)|nok|nzph|o2im|opwv|oran|pdxg|pg(13|c)|phil|pire|pl(ay|uc)|pn|po(ck|se)|prox|psio|pt|qa|qc(07|12|21|60)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55|sa(ma|ny)|sc(01|p)|sdk|se(c|47|mc)|sgh|shar|sie|sk|sl45|sm(al|t5)|so(ft|ny)|sp(01|v)|sy|t2(18|50)|t6(00|18)|ta(gt)|tcl|tdg|tim|tmo|to(pl)|ts(70|m3)|tx|up(\.b)|utst|v400|v750|veri|vi(te)|vk(40)|vm40|voda|vx(52|53|60|70)|w3c|webc|whit|wi(g|nc)|wmlb|wonu|x700|yas|zeto|zte/i.test(e.substring(0,4))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["adjustment-cart-display"]],standalone:!0,features:[Q],decls:3,vars:2,consts:[["EMPTY_CART",""],["context_menu",""],["NO_IMAGE",""],[4,"ngIf","ngIfElse"],[1,"table","table-borderless"],["cdkDropList","",3,"cdkDropListDropped"],[4,"ngFor","ngForOf"],["cdkDrag","",1,"border-bottom",2,"padding-left","12px",3,"click","cdkContextMenuTriggerFor","cdkDragDisabled"],["style","width: 10px; padding-left: 12px",4,"ngIf"],[1,"pe-0",2,"width","50%","padding-left","12px"],[1,"d-flex","align-items-center"],[1,"d-block","ms-6",2,"line-height","18px"],[1,"fw-normal","fs-6","text-muted"],[3,"serials"],["title","Note",1,"special-TinyMCE","m-0","fst-italic","d-block",3,"innerHtml"],[1,"px-0","text-end",2,"width","15%"],[1,"d-flex","align-items-center","justify-content-end"],[1,"d-flex","text-end","fw-normal","align-items-center",2,"line-height","20px"],[4,"ngIf"],["class","fs-6",4,"ngIf"],[1,"fw-normal","fs-5","text-danger"],["data-test","total",1,"pe-0"],[1,"fs-5"],[1,"mt-6","ps-0"],[1,"d-flex","justify-content-end","align-items-center"],["role","button","title","Delete Item",1,"fs-3","cursor-pointer",3,"click"],[1,"fa","fa-trash","text-danger","fs-4"],["cdkMenu","",1,"example-menu"],["cdkMenuItem","",1,"example-menu-item",3,"click"],[2,"width","10px","padding-left","12px"],[1,""],[1,"object-fit-contain",2,"height","55px","width","55px",3,"error","src","alt"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"fs-6"],["title","UOM",1,"ps-1","fs-5"],[1,"fs-5","text-end"],[1,"row","g-0","h-100"],[1,"col-12"],[1,"d-flex","justify-content-center","align-items-center","h-100"],[1,"row"],[1,"col-12","d-flex","justify-content-center"],[1,"fa-regular","fa-cart-arrow-up","text-secondary",2,"font-size","110px"],[1,"col-12","justify-content-center","text-center","mt-5","empty-cart-description","text-secondary","headings-font-family"]],template:function(t,r){if(t&1&&_(0,ll,4,1,"ng-container",3)(1,ml,15,0,"ng-template",null,0,R),t&2){let n=ee(2);p("ngIf",r.CartItems().length>0)("ngIfElse",n)}},dependencies:[q,qi,J,Wi,At,Z,Cr,hr,fr,yr],styles:[".item-image[_ngcontent-%COMP%]{height:50px;width:56px;display:block;border:solid 1px #dddddd;border-radius:5px}.example-menu[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column;min-width:180px;max-width:280px;background-color:#fff;padding:6px 0}.example-menu-item[_ngcontent-%COMP%]{background-color:transparent;cursor:pointer;border:none;-webkit-user-select:none;user-select:none;min-width:64px;line-height:36px;padding:0 16px;display:flex;align-items:center;flex-direction:row;flex:1}.example-menu-item[_ngcontent-%COMP%]:hover{background-color:#f5f5f5}.example-menu-item[_ngcontent-%COMP%]:active{background-color:#dcdcdc} .cdk-menu.cdk-menu-group.example-menu{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}"]})};var Wn=class i{storeService=h(B);cartService=h(ye);orderService=h(Ne);loadFormService=h(Ft);roleService=h(G);#e=h(je);onProcess=new on;onOpenModalNote=new on;onOpenModalVoid=new on;constructor(){}onProcessHandler(){this.onProcess.emit()}onOpenModalNoteHandler(){this.onOpenModalNote.emit(),this.cartService.onOpenCartNoteModal().afterClosed().subscribe({next:t=>{Object.keys(t).forEach(r=>{this.orderService.onUpdateOrderState(r,t[r])})}})}onOpenModalVoidHandler(){this.onOpenModalVoid.emit(),this.cartService.onOpenCartVoidModal().afterClosed().pipe(_e(t=>t.type==="OK"),X(()=>this.loadFormService.getLoadForm$),j(()=>{this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeCartItems([]),this.storeService.onChangeIsOpenDialog(!1),this.#e.navigate(["/menu/Adjustment/Adjustment/Archive/Form"])})).subscribe()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["adjustment-cart-action"]],outputs:{onProcess:"onProcess",onOpenModalNote:"onOpenModalNote",onOpenModalVoid:"onOpenModalVoid"},standalone:!0,features:[Q],decls:13,vars:2,consts:[[1,"row","g-0","pb-6","px-5"],[1,"col-5","d-flex","justify-content-between","pe-5",2,"column-gap","12px"],["type","button",1,"btn","btn-gray","fs-3","py-6","headings-font-family",2,"flex-grow","1",3,"click"],[1,"fa-regular","fa-note-sticky","fa-xl"],["type","button",1,"btn","btn-gray","fs-3","px-0","py-6","headings-font-family","d-flex","gap-2","justify-content-center","align-items-center",2,"flex-grow","8",3,"click"],[1,"fa-solid","fa-rectangle-xmark"],[1,"col-7"],["type","button",1,"btn","btn-success","w-100","fs-3","px-0","py-6",2,"border-left","0.1px solid #fff",3,"click"],[1,"fs-6"]],template:function(t,r){t&1&&(a(0,"div",0)(1,"div",1)(2,"button",2),f("click",function(){return r.onOpenModalNoteHandler()}),g(3,"i",3),o(),a(4,"button",4),f("click",function(){return r.onOpenModalVoidHandler()}),g(5,"i",5),a(6,"span"),l(7,"Void"),o()()(),a(8,"div",6)(9,"button",7),f("click",function(){return r.onProcessHandler()}),l(10," Process "),a(11,"small",8),l(12),o()()()()),t&2&&(s(12),$t("(",r.storeService.CartItems().length," items, ",r.storeService.QtyCartItems()," Qty)"))},styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};function pl(i,e){if(i&1&&(a(0,"div",6)(1,"div",7)(2,"div"),l(3),o(),a(4,"small",8),l(5),o()(),a(6,"div",9)(7,"span"),l(8),C(9,"number"),o()()()),i&2){let t=e.data;s(3),x(t==null?null:t.Value),s(2),x(t==null?null:t.Code),s(3),x(w(9,3,t==null?null:t.UnitPrice))}}var qn=class i{cartService=h(ye);query=new it({});#e=h(A);storeService=h(B);skipXHR=!1;spinnerService=h(Or);constructor(){}onBarcodeScan(e){console.log("Scanned barcode:",e),this.cartService.httpRequestVariantByCode(e).pipe().subscribe()}ngOnInit(){this.query.valueChanges.pipe(st("query"),_e(e=>e&&Object.keys(e).length>0),j(e=>{this.spinnerService.show()}),X(e=>{this.spinnerService.show();let t;if(e.type==="ID")t=this.cartService.httpGetVariantByID(e.str);else if(e.type==="Code")t=this.cartService.httpRequestVariantByCode(e.str);else return en;return t.pipe(dt(r=>r.status>=400&&r.status<=451?(console.error("Variant not found:",r.message),tn(null)):Si(()=>r)))}),j(()=>{this.spinnerService.hide()})).subscribe({next:e=>{},error:e=>{this.spinnerService.hide(),console.error("An error occurred:",e)}})}onSelectVariant(e){this.cartService.addItemByVariantID(e)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["adjustment-cart-header"]],standalone:!0,features:[Q],decls:7,vars:4,consts:[["itemTemplate",""],[1,"row"],[1,"col"],[1,""],[1,"px-4","py-4"],["inputID","product","requestUrl","/API/AC/GetVariantSuggestionByCodeNNameWithEntityID","prefixIcon","fa fa-barcode","placeholder","Search product by name / code","localStorage","products","notFoundMessageFor","product","data_cy","txt-product",1,"form-control","autocomplete-product",3,"onInputEnter","onSelect","clearOnSelect","useCustomTemplate","itemTemplate","outletId"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"],[1,"ps-4"]],template:function(t,r){if(t&1){let n=v();a(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"autocompleteV2",5),f("onInputEnter",function(y){return d(n),u(r.onBarcodeScan(y))})("onSelect",function(y){return d(n),u(r.onSelectVariant(y))}),o()(),_(5,pl,10,5,"ng-template",null,0,R),o()()()}if(t&2){let n=ee(6);s(4),p("clearOnSelect",!0)("useCustomTemplate",!0)("itemTemplate",n)("outletId",r.storeService.Outlet().ID)}},dependencies:[Ie,Z,or,rt,ot,Et,wt],styles:["[_nghost-%COMP%] autocompleteV2.autocomplete-product>mat-form-field>input{height:38px!important;border-radius:.375rem}[_nghost-%COMP%] autocompleteV2.autocomplete-product>mat-form-field>div.position-relative>span.prefix-icon{top:10px}"]})};var fi=class{constructor(e,t,r,n,m,y,b,oe,Y,ae,Ce){this._StateID=e,this._StateLabel=t,this._Success=r,this._Message=n,this._InvoiceID=m,this._OrderID=y,this._InvoiceNumber=b,this._PrintMode=oe,this._DeliveryID=Y,this._PaymentStateID=ae,this._PaymentStateLabel=Ce}_StateID;get StateID(){return this._StateID}set StateID(e){this._StateID=e}_StateLabel;get StateLabel(){return this._StateLabel}set StateLabel(e){this._StateLabel=e}_Success;get Success(){return this._Success}set Success(e){this._Success=e}_Message;get Message(){return this._Message}set Message(e){this._Message=e}_InvoiceID;get InvoiceID(){return this._InvoiceID}set InvoiceID(e){this._InvoiceID=e}_OrderID;get OrderID(){return this._OrderID}set OrderID(e){this._OrderID=e}_InvoiceNumber;get InvoiceNumber(){return this._InvoiceNumber}set InvoiceNumber(e){this._InvoiceNumber=e}_PrintMode;get PrintMode(){return this._PrintMode}set PrintMode(e){this._PrintMode=e}_DeliveryID;get DeliveryID(){return this._DeliveryID}set DeliveryID(e){this._DeliveryID=e}_PaymentStateID;get PaymentStateID(){return this._PaymentStateID}set PaymentStateID(e){this._PaymentStateID=e}_PaymentStateLabel;get PaymentStateLabel(){return this._PaymentStateLabel}set PaymentStateLabel(e){this._PaymentStateLabel=e}toJSON(){return{StateID:this.StateID,StateLabel:this.StateLabel,Success:this.Success,Message:this.Message,InvoiceID:this.InvoiceID,OrderID:this.OrderID,InvoiceNumber:this.InvoiceNumber,PrintMode:this.PrintMode,DeliveryID:this.DeliveryID,PaymentStateID:this.PaymentStateID,PaymentStateLabel:this.PaymentStateLabel}}},Gn=class i{adapt(e){return new fi(e.StateID,e.StateLabel,e.Success,e.Message,e.InvoiceID,e.OrderID,e.InvoiceNumber,e.PrintMode,e.DeliveryID,e.PaymentStateID,e.PaymentStateLabel).toJSON()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})};var cl=(i,e)=>e.key;function dl(i,e){if(i&1){let t=v();a(0,"div",3),f("click",function(){let n=d(t).$implicit,m=c();return u(m.submit(n.key))}),g(1,"i",4),l(2),o()}if(i&2){let t=e.$implicit;s(),p("ngClass",t.icon),s(),I(" ",t.label," ")}}var zn=class i{constructor(e,t){this.dialogRef=e;this.data=t;this.config=new we,this.config.title="Adjustment Progress",this.config.hideFooter=!0,this.config.hideOk=!0,this.config.hideCancel=!0}config;adjustmentState=z([]);onClose(){this.dialogRef.close({role:"close"})}onCancel(){this.dialogRef.close({role:"cancel"})}ngOnInit(){this.adjustmentState.set([{key:1,value:"draft",label:"Draft",icon:"fa-file-pen"},{key:2,value:"submitted",label:"Submit for Review",icon:"fa-user-magnifying-glass"}])}submit(e){this.dialogRef.close({role:"ok",data:e})}static \u0275fac=function(t){return new(t||i)(S(Te),S(bt))};static \u0275cmp=E({type:i,selectors:[["POS-modal-with-approval"]],standalone:!0,features:[Q],decls:5,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid","d-flex","gap-3","justify-content-between",2,"width","500px"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px"],[1,"btn","btn-outline-secondary",2,"font-size","18px","width","250px",3,"click"],[1,"fa-solid",3,"ngClass"]],template:function(t,r){t&1&&(a(0,"modal-material",0),f("onCancel",function(){return r.dialogRef.close()})("onClose",function(){return r.dialogRef.close()}),a(1,"content")(2,"div",1),Ze(3,dl,3,2,"div",2,cl),o()()()),t&2&&(p("config",r.config),s(3),Ye(r.adjustmentState()))},dependencies:[Ie,tt,ue,Ee]})};var $n=class i{destroy$=new xe;#e=h(Ne);#t=h(B);#n=h(Gn);injector=h(ge);toastr=h(fe);matDialog=h(ne);constructor(){}ngOnInit(){}onProcessOrder(){if(N.IsEmpty(this.#t.Outlet().ID)){this.toastr.error("Please select outlet before proceeding..",se.Error);return}if(this.#t.CartItems().length==0){this.toastr.error("You must have at least one item.",se.Error);return}if(N.IsEmpty(this.#t.Order().Number)){this.toastr.error("Number cannot be empty.",se.Error);return}if(this.#t.Order().TypeID==2){let e=[...this.#t.CartItems()].map(r=>r.VariantID),t=new Set(e);if(e.length!=t.size){this.toastr.error("Count adjustment type doesn't allow the same product/code in different rows. Please check again!","Submit Restricted!");return}}this.#t.AppConfigJSON().ModuleAdjustment.Basic.Workflow==1?this.#e.processOrder().pipe(ve(this.destroy$)).subscribe({next:e=>{this.#t.onChangeIsComplete(),this.#t.onChangeOrderComplete(this.#n.adapt(e))},error:e=>{console.log("error",e)}}):(console.log(this.#t.Order().StateID),he(this.#t.LoadForm,{injector:this.injector}).pipe(X(e=>!e.Data||e.Data&&e.Data.Order.StateID&&e.Data.Order.StateID==1?this.matDialog.open(zn).afterClosed().pipe(_e(t=>t!=null&&t.role==="ok"),j(t=>{let r=t.data;this.#e.onUpdateOrderState("StateID",Number(r))}),X(()=>this.#e.processOrder())):this.#e.processOrder()),j(e=>{this.#t.onChangeIsComplete(),this.#t.onChangeOrderComplete(this.#n.adapt(e))})).subscribe())}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["adjustment-cart"]],standalone:!0,features:[Q],decls:9,vars:0,consts:[[1,"h-100","d-flex","flex-column"],[1,"pt-4"],[1,"row"],[1,"col"],["PinScrollingBottom","",1,"",2,"overflow-y","auto","flex","1 1 0%","max-height","calc(100vh - 170px)"],[1,""],[3,"onProcess"]],template:function(t,r){t&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),g(4,"adjustment-cart-header"),o()()(),a(5,"div",4),g(6,"adjustment-cart-display"),o(),a(7,"div",5)(8,"adjustment-cart-action",6),f("onProcess",function(){return r.onProcessOrder()}),o()()())},dependencies:[Hn,Wn,qn,Ir]})};function ul(i,e){if(i&1&&(a(0,"div",25)(1,"div",26),l(2),o(),a(3,"div",26),l(4),o()()),i&2){let t=e.$implicit;s(2),x(t.Variant.Name),s(2),x(t.Quantity)}}var Kn=class i{menu$;storeService=h(B);#e=h(je);#t=h(ie);#n=h(dn);cartItems;fullContainerEl=document.getElementById("full-container");constructor(){this.#t.setMenu$(),this.menu$=this.#t.menu$.pipe(Se(e=>k(M({},e),{H:"Inventory Adjustment",T:e.T.replace("undefined","Inventory Adjustment")})),j(e=>this.#n.setTitle(e.T)))}ngAfterViewInit(){this.fullContainerEl.classList.remove("full-container")}ngOnDestroy(){this.fullContainerEl.classList.add("full-container")}handleF8(){this.onNewAdjustment()}onPrintReceipt(){return Xt(this,null,function*(){window.open(`/print/Adjustment?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onGotoAdjustmentDetail(){return Xt(this,null,function*(){window.open(`/menu/Adjustment/Adjustment/Archive/Info?ID=${this.storeService.OrderComplete().OrderID}`,"_blank")})}onNewAdjustment(){return Xt(this,null,function*(){this.storeService.onChangeCartItems([]),yield this.#e.navigate(["menu/Adjustment/Adjustment/Archive/Form"],{queryParams:{}}),this.storeService.onChangeAdjustmentState(0),this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeIsComplete(),this.storeService.onChangeCartItems([])})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["adjustment-order-complete"]],hostBindings:function(t,r){t&1&&f("keydown.F8",function(){return r.handleF8()},!1,Ue)},inputs:{cartItems:"cartItems"},standalone:!0,features:[Q],decls:36,vars:11,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"order-complete","mt-6"],[1,"container-fluid"],[1,"row"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"fa-solid","fa-check","me-3"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"card-footer"],[1,"d-flex","justify-content-between","py-5"],["target","_blank",1,"btn","bg-light-gray","btn-secondary",3,"click"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px"],[1,"fst-italic"],["target","_blank",1,"",2,"cursor","pointer",3,"href"],[1,"card-body"],["class","row justify-content-between mb-3",4,"ngFor","ngForOf"],[1,"row","justify-content-end","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col-4","text-end"],[1,"row","justify-content-between","mb-3"],[1,"col","text-end"]],template:function(t,r){t&1&&(a(0,"mainpanel-cmp",0),C(1,"async"),a(2,"content")(3,"section",1)(4,"div",2)(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"h1",7),g(10,"i",8),l(11,"Inventory Adjustment Complete "),o()(),a(12,"div",9)(13,"div",10)(14,"div",11)(15,"a",12),f("click",function(){return r.onNewAdjustment()}),l(16," New Adjustment (F8)"),o()()()(),a(17,"div",13)(18,"div",14)(19,"a",15),f("click",function(){return r.onPrintReceipt()}),g(20,"i",16),l(21,"Print Receipt"),o()()()()(),a(22,"div",17)(23,"div",5)(24,"div",18)(25,"h3",19)(26,"a",20),l(27),o()()(),a(28,"div",21),_(29,ul,5,2,"div",22),a(30,"div",23)(31,"div",24),l(32,"Total:"),o(),a(33,"div",24),l(34),C(35,"number"),o()()()()()()()()()()),t&2&&(p("pageData",w(1,7,r.menu$))("hideSearchDropdown",!0)("hideSearchBox",!0),s(26),p("href","/menu/Adjustment/Adjustment/Archive/Info?ID="+r.storeService.OrderComplete().OrderID,gt),s(),I("Adjustment #",r.storeService.OrderComplete().InvoiceNumber,""),s(2),p("ngForOf",r.cartItems),s(5),I(" ",w(35,9,r.storeService.QtyCartItems())," "))},dependencies:[ht,Z,fn,re,J,gn],styles:[".print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block;text-align:left}.order-complete[_ngcontent-%COMP%]{display:none}}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.125);padding-bottom:.9375rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:2rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{max-width:500px;margin-top:30px;margin-bottom:30px}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle;line-height:15px!important}"]})};var _l=["qty"];function gl(i,e){if(i&1&&(a(0,"div",16)(1,"div",17)(2,"div"),l(3),o(),a(4,"small",18),l(5),o()()()),i&2){let t=e.data;s(3),x(t==null?null:t.Value),s(2),x(t==null?null:t.Code)}}var Yt=class i{modalConfig=new we;cartService=h(ye);cartItem=z(null);query=new it(null);form;#e=h(Te);unsubscribe$=new xe;#t=h(St);quantityRef;focusTimeoutID;ngZone=h(an);constructor(){this.modalConfig.customWidth="650px",this.modalConfig.title="Add Item"}onOK(){this.#e.close({type:"OK"});let e=this.cartItem();e.Quantity=this.form.get("Quantity").value,e.Price=this.form.get("Price").value,e.Cost=this.form.get("Cost").value,e.Note=this.form.get("Note").value,this.cartService.onAddCartItem(e,!0,e.Quantity)}onChangeNote(e){this.form.get("Note").setValue(e)}onClose(){this.#e.close({type:"close"})}onCancel(){this.#e.close({type:"cancel"})}initForm(){this.form=this.#t.group({Quantity:[""],Price:[""],Cost:[""],Note:[""]})}ngOnInit(){this.initForm(),this.query.valueChanges.pipe(ve(this.unsubscribe$),X(e=>this.cartService.httpGetVariantByID(e,!1).pipe()),st("get cart item")).subscribe({next:e=>{this.focusTimeoutID=setTimeout(()=>{this.quantityRef&&this.quantityRef.nativeElement&&(this.quantityRef.nativeElement.focus(),this.quantityRef.nativeElement.select())},0),this.cartItem.set(e),this.form.patchValue({Quantity:e.Quantity,Price:e.Price,Cost:e.Cost,Note:e.Note}),this.modalConfig.title=e.Variant.Name}})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete(),this.focusTimeoutID&&clearTimeout(this.focusTimeoutID)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["adjustment-modal-cart-add"]],viewQuery:function(t,r){if(t&1&&ln(_l,5),t&2){let n;mn(n=pn())&&(r.quantityRef=n.first)}},standalone:!0,features:[Q],decls:29,vars:7,consts:[["itemTemplate",""],["qty",""],[3,"onCancel","onClose","onOk","config"],[1,"container","w-100","h-100"],[1,"row"],[1,"col-12"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"keyup.enter","formControl","renderThumbnail","useCustomTemplate","itemTemplate"],[3,"formGroup"],[1,"row","mt-5"],[1,"col-auto"],["autoNum","","formControlName","Quantity","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"col-auto","ps-0"],["autoNum","","formControlName","Price","type","text",1,"mt-5","form-control",2,"width","100px"],["autoNum","","formControlName","Cost","type","text",1,"mt-5","form-control",2,"width","100px"],[1,"mb-5"],["height","220px",3,"valueChange","value"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[1,"ms-3","text-wrap","text-break"],[1,"opacity-75"]],template:function(t,r){if(t&1){let n=v();a(0,"modal-material",2),f("onCancel",function(){return d(n),u(r.onCancel())})("onClose",function(){return d(n),u(r.onCancel())})("onOk",function(){return d(n),u(r.onOK())}),a(1,"content")(2,"div",3)(3,"div",4)(4,"div",5)(5,"autocompleteV2",6),f("keyup.enter",function(y){return d(n),u(y.stopPropagation())}),o(),_(6,gl,6,2,"ng-template",null,0,R),o()(),a(8,"div",7)(9,"div",8)(10,"div",9)(11,"h5"),l(12,"Qty"),o(),g(13,"input",10,1),o(),a(15,"div",11)(16,"h5"),l(17,"Price"),o(),g(18,"input",12),o(),a(19,"div",11)(20,"h5"),l(21,"Cost"),o(),g(22,"input",13),o()(),H(23),a(24,"div",8)(25,"div",5)(26,"h5",14),l(27,"Note"),o(),a(28,"POS-tinymce-editor",15),f("valueChange",function(y){return d(n),u(r.onChangeNote(y))}),o()()(),W(),o()()()()}if(t&2){let n,m=ee(7);p("config",r.modalConfig),s(5),p("formControl",r.query)("renderThumbnail",!0)("useCustomTemplate",!0)("itemTemplate",m),s(3),p("formGroup",r.form),s(20),p("value",(n=r.form.get("Note"))==null?null:n.value)}},dependencies:[Pt,ke,Et,wt,ue,Ee,tr,De,$,Ct,ot,ki,vt,xt,jt,vn]})};var Br=ii(Co());function fl(i,e){if(i&1){let t=v();H(0),a(1,"POS-uppy",3),f("onParser",function(n){d(t);let m=c(2);return u(m.onParser(n))})("fileUploaded",function(n){d(t);let m=c(2);return u(m.onUploadCsv(n))})("fileRemoved",function(){d(t);let n=c(2);return u(n.onRemovedFile())}),o(),W()}if(i&2){let t=c(2);s(),p("sampleUrl",t.sampleURL)}}function hl(i,e){if(i&1){let t=v();H(0),a(1,"POS-uppy",3),f("onParser",function(n){d(t);let m=c(2);return u(m.onParser(n))})("fileUploaded",function(n){d(t);let m=c(2);return u(m.onUploadCsv(n))})("fileRemoved",function(){d(t);let n=c(2);return u(n.onRemovedFile())}),o(),W()}if(i&2){let t=c(2);s(),p("sampleUrl",t.sampleURL)}}function yl(i,e){if(i&1&&_(0,fl,2,1,"ng-container",2)(1,hl,2,1,"ng-container",2),i&2){let t=c();p("ngIf",t.uploadState()===t.uploadStateEnum.Idle||t.uploadState()===t.uploadStateEnum.Uploading),s(),p("ngIf",t.uploadState()===t.uploadStateEnum.Success||t.uploadState()===t.uploadStateEnum.Error)}}var Jn=class i{modalConfig;sampleURL;fileInput=z(null);unsubscribe$=new xe;#e=h(Te);#t=h(A);#n=h(B);#i=h(ye);#r=h(ge);cartItem=z([]);skipEmptyLines=!0;rowCount=z(0);rowEmpty=z(0);totalRows=cn(()=>this.rowCount()-this.rowEmpty());file=z(null);uploadState=z(0);uploadStateEnum=cr;constructor(){this.modalConfig=new we,this.modalConfig.title="Import Items",this.modalConfig.customWidth="500px",this.sampleURL="https://cdn.dealpos.xyz/web-import-template/ImportItem_Adjustment_TemplateV2.csv"}onOK(){this.uploadState.set(1);let e={EntityID:this.#n.Outlet().ID,CartItems:this.cartItem()};return this.#t.post("/API/Adjustment/UploadCsvV2",e).pipe(st("response"),dt(t=>(t instanceof Oi&&this.uploadState.set(3),[])),j(t=>{Array.isArray(t)&&t.length>0&&(this.uploadState.set(2),t.forEach(r=>this.#i.onAddCartItem(r,!0,r.Quantity)),this.#e.close())}),rn(1)).subscribe()}onCancel(){this.#e.close()}onClose(){this.#e.close()}assignFile(e){this.fileInput.set(e)}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}ngOnInit(){}onRemovedFile(){this.file.set(null),this.rowCount.set(0),this.rowEmpty.set(0)}onUploadCsv(e){let t;e instanceof Blob&&(t=new File([e],"file.csv",{type:e.type})),e instanceof File&&(t=e),this.file.set(t),Br.default.parse(t,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:r=>{let n=r.split(/\r?\n/).slice(1);return n[n.length-1]===""&&n.pop(),this.rowCount.set(n.length),n.forEach(m=>{m.split(",").every(b=>b==="")&&this.rowEmpty.update(b=>b+=1)}),r},error(r,n){console.log("ERROR",r,n)},complete:(r,n)=>{console.log("COMPLETE",r),this.cartItem.set(r.data),console.log("row count",this.rowCount),console.log("row empy",this.rowEmpty)}})}onParser(e){console.log("row",e),this.cartItem.set(e)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["adjustment-modal-cart-upload"]],standalone:!0,features:[Q],decls:3,vars:1,consts:[["modalContent",""],[3,"onOk","onCancel","onClose","config"],[4,"ngIf"],[3,"onParser","fileUploaded","fileRemoved","sampleUrl"]],template:function(t,r){if(t&1){let n=v();a(0,"modal-material",1),f("onOk",function(){return d(n),u(r.onOK())})("onCancel",function(){return d(n),u(r.onClose())})("onClose",function(){return d(n),u(r.onClose())}),_(1,yl,2,2,"ng-template",null,0,R),o()}t&2&&p("config",r.modalConfig)},dependencies:[Ie,q,ue,Ee,Li]})};function Cl(i,e){if(i&1){let t=v();a(0,"li",11),f("click",function(){let n=d(t).$implicit,m=c(3);return u(m.onClickMenu(n))}),g(1,"POS-dropdown-item-more-action",12),o()}if(i&2){let t=e.$implicit;s(),p("icon",t.icon)("label",t.title)}}function vl(i,e){if(i&1&&Ze(0,Cl,2,2,"li",10,oi),i&2){let t=c().$implicit;Ye(t.children)}}function xl(i,e){if(i&1&&(a(0,"div",7)(1,"div",8),l(2),o(),g(3,"div",9),_(4,vl,2,0),o()),i&2){let t=e.$implicit;s(2),x(t.title),s(2),me(t.children.length>0?4:-1)}}var Zn=class i{menu=z([]);#e=h(ne);router=h(je);handleF8(){this.#e.openDialogs&&this.#e.openDialogs.length>0||this.#e.open(Yt)}constructor(){}ngOnInit(){this.#t()}#t(){let e=[{title:"Item",icon:"",children:[{title:"Add",value:"add",icon:"fa-circle-plus fa-solid"},{title:"Upload",icon:"fa-solid fa-upload",value:"upload"}]}];this.menu.set(e)}onClickMenu(e){switch(e.value){case"add":this.#e.open(Yt);break;case"upload":this.#e.open(Jn);break;case"adjustment v1":this.router.navigate(["/menu/Adjustment/Adjustment/Archive/Form"]);break}}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["adjustment-more-actions"]],hostBindings:function(t,r){t&1&&f("keydown.F4",function(m){return r.handleF8(m)},!1,Ue)},standalone:!0,features:[Q],decls:10,vars:0,consts:[["id","moreMenu","data-bs-toggle","dropdown",1,"d-flex","align-items-center","cursor-pointer"],[1,"me-2"],[1,"fa-solid","fa-caret-down","fa-lg"],[1,"fs-6","headings-font-family","pb-1"],[1,"h-100","d-flex","align-items-center","justify-content-between"],["aria-labelledby","moreMenu",1,"dropdown-menu","more-actions",2,"min-width","300px"],[1,"d-flex"],[1,"dropdown-header","text-dark","col"],[1,"h5","mb-4"],[1,"dropdown-divider","m-0"],[1,"cursor-pointer"],[1,"cursor-pointer",3,"click"],[3,"icon","label"]],template:function(t,r){t&1&&(a(0,"span",0)(1,"span",1),g(2,"i",2),o(),a(3,"span",3),l(4,"More Actions"),o()(),a(5,"div",4)(6,"div",5)(7,"div",6),Ze(8,xl,5,2,"div",7,oi),o()()()),t&2&&(s(8),Ye(r.menu()))},dependencies:[xr]})};var hi=class{constructor(e,t,r,n){this._Order=e,this._Items=t,this._OrderItems=r,this._CountedItems=n}_Order;get Order(){return this._Order}set Order(e){this._Order=e}_Items;get Items(){return this._Items}set Items(e){this._Items=e}_OrderItems;get OrderItems(){return this._OrderItems}set OrderItems(e){this._OrderItems=e}_CountedItems;get CountedItems(){return this._CountedItems}set CountedItems(e){this._CountedItems=e}},Yn=class i{adapt(e){return new hi(e.Order,e.Items,e.OrderItems,e.CountedItems)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})},yi=class{constructor(e,t,r,n,m,y,b,oe,Y,ae,Ce,Me,Re,Be,He,We,qe,Ge,ze,$e,Ke,Je){this._EntityID=e,this._Number=t,this._Date=r,this._PIC=n,this._Note=m,this._EntityName=y,this._StateID=b,this._StateLabel=oe,this._ReviewDate=Y,this._ReviewerID=ae,this._TypeID=Ce,this._TypeLabel=Me,this._Quantity=Re,this._UnitPrice=Be,this._UnitCost=He,this._TotalPrice=We,this._AdjustedQuantity=qe,this._CreatorID=Ge,this._Created=ze,this._ModifierID=$e,this._Modified=Ke,this._ID=Je}_EntityID;get EntityID(){return this._EntityID}set EntityID(e){this._EntityID=e}_Number;get Number(){return this._Number}set Number(e){this._Number=e}_Date;get Date(){return this._Date}set Date(e){this._Date=e}_PIC;get PIC(){return this._PIC}set PIC(e){this._PIC=e}_Note;get Note(){return this._Note}set Note(e){this._Note=e}_EntityName;get EntityName(){return this._EntityName}set EntityName(e){this._EntityName=e}_StateID;get StateID(){return this._StateID}set StateID(e){this._StateID=e}_StateLabel;get StateLabel(){return this._StateLabel}set StateLabel(e){this._StateLabel=e}_ReviewDate;get ReviewDate(){return this._ReviewDate}set ReviewDate(e){this._ReviewDate=e}_ReviewerID;get ReviewerID(){return this._ReviewerID}set ReviewerID(e){this._ReviewerID=e}_TypeID;get TypeID(){return this._TypeID}set TypeID(e){this._TypeID=e}_TypeLabel;get TypeLabel(){return this._TypeLabel}set TypeLabel(e){this._TypeLabel=e}_Quantity;get Quantity(){return this._Quantity}set Quantity(e){this._Quantity=e}_UnitPrice;get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}_UnitCost;get UnitCost(){return this._UnitCost}set UnitCost(e){this._UnitCost=e}_TotalPrice;get TotalPrice(){return this._TotalPrice}set TotalPrice(e){this._TotalPrice=e}_AdjustedQuantity;get AdjustedQuantity(){return this._AdjustedQuantity}set AdjustedQuantity(e){this._AdjustedQuantity=e}_CreatorID;get CreatorID(){return this._CreatorID}set CreatorID(e){this._CreatorID=e}_Created;get Created(){return this._Created}set Created(e){this._Created=e}_ModifierID;get ModifierID(){return this._ModifierID}set ModifierID(e){this._ModifierID=e}_Modified;get Modified(){return this._Modified}set Modified(e){this._Modified=e}_ID;get ID(){return this._ID}set ID(e){this._ID=e}},Hr=class i{adapt(e){return new yi(e.EntityID,e.Number,e.Date,e.PIC,e.Note,e.EntityName,e.StateID,e.StateLabel,e.ReviewDate,e.ReviewerID,e.TypeID,e.TypeLabel,e.Quantity,e.UnitPrice,e.UnitCost,e.TotalPrice,e.AdjustedQuantity,e.CreatorID,e.Created,e.ModifierID,e.Modified,e.ID)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})},Ci=class{constructor(e,t,r,n,m,y,b,oe,Y,ae,Ce,Me){this._LostNFoundID=e,this._UnitCost=t,this._InventoryTypeID=r,this._UnitPrice=n,this._Discount=m,this._VariantID=y,this._Note=b,this._Quantity=oe,this._UnitQuantity=Y,this._Index=ae,this._Serial=Ce,this._ID=Me}_LostNFoundID;get LostNFoundID(){return this._LostNFoundID}set LostNFoundID(e){this._LostNFoundID=e}_UnitCost;get UnitCost(){return this._UnitCost}set UnitCost(e){this._UnitCost=e}_InventoryTypeID;get InventoryTypeID(){return this._InventoryTypeID}set InventoryTypeID(e){this._InventoryTypeID=e}_UnitPrice;get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}_Discount;get Discount(){return this._Discount}set Discount(e){this._Discount=e}_VariantID;get VariantID(){return this._VariantID}set VariantID(e){this._VariantID=e}_Note;get Note(){return this._Note}set Note(e){this._Note=e}_Quantity;get Quantity(){return this._Quantity}set Quantity(e){this._Quantity=e}_UnitQuantity;get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(e){this._UnitQuantity=e}_Index;get Index(){return this._Index}set Index(e){this._Index=e}_Serial;get Serial(){return this._Serial}set Serial(e){this._Serial=e}_ID;get ID(){return this._ID}set ID(e){this._ID=e}},Wr=class i{adapt(e){return new Ci(e.LostNFoundID,e.UnitCost,e.InventoryTypeID,e.UnitPrice,e.Discount,e.VariantID,e.Note,e.Quantity,e.UnitQuantity,e.Index,e.Serial,e.ID)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})},vi=class{constructor(e,t,r,n,m,y,b,oe,Y,ae,Ce,Me){this._ParentID=e,this._Start=t,this._Finish=r,this._UnitPrice=n,this._UnitCost=m,this._VariantID=y,this._Note=b,this._Quantity=oe,this._UnitQuantity=Y,this._Index=ae,this._Serial=Ce,this._ID=Me}_ParentID;get ParentID(){return this._ParentID}set ParentID(e){this._ParentID=e}_Start;get Start(){return this._Start}set Start(e){this._Start=e}_Finish;get Finish(){return this._Finish}set Finish(e){this._Finish=e}_UnitPrice;get UnitPrice(){return this._UnitPrice}set UnitPrice(e){this._UnitPrice=e}_UnitCost;get UnitCost(){return this._UnitCost}set UnitCost(e){this._UnitCost=e}_VariantID;get VariantID(){return this._VariantID}set VariantID(e){this._VariantID=e}_Note;get Note(){return this._Note}set Note(e){this._Note=e}_Quantity;get Quantity(){return this._Quantity}set Quantity(e){this._Quantity=e}_UnitQuantity;get UnitQuantity(){return this._UnitQuantity}set UnitQuantity(e){this._UnitQuantity=e}_Index;get Index(){return this._Index}set Index(e){this._Index=e}_Serial;get Serial(){return this._Serial}set Serial(e){this._Serial=e}_ID;get ID(){return this._ID}set ID(e){this._ID=e}},qr=class i{adapt(e){return new vi(e.ParentID,e.Start,e.Finish,e.UnitPrice,e.UnitCost,e.VariantID,e.Note,e.Quantity,e.UnitQuantity,e.Index,e.Serial,e.ID)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})};var Gr=ii(Xi());function Sl(i,e){if(i&1&&(H(0),g(1,"adjustment-order-complete",2),W()),i&2){let t=c();s(),p("cartItems",t.storeService.CartItems())}}function Il(i,e){if(i&1){let t=v();a(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"POS-select-outlet-form",8),C(6,"async"),f("ngModelChange",function(n){d(t);let m=c();return u(m.storeService.onChangeOutlet(n))}),o(),a(7,"POS-invoice-number-form",9),C(8,"async"),f("ngModelChange",function(n){d(t);let m=c();return u(m.onInvoiceNumberChange(n))}),o()(),a(9,"POS-invoice-date",10),f("ngModelChange",function(n){d(t);let m=c();return u(m.onChangeOrderDate(n))}),o()()(),a(10,"div",11)(11,"div",12)(12,"div",13),g(13,"adjustment-more-actions"),o(),a(14,"div",14),g(15,"i",15),a(16,"ng-select",16),f("ngModelChange",function(n){d(t);let m=c();return u(m.onChangeAdjustmentType(n))}),o()()()()(),a(17,"div",17)(18,"div",18)(19,"POS-quick-key",19),f("onSelectVariant",function(n){d(t);let m=c();return u(m.onSelectVariant(n))}),o()(),a(20,"div",20),g(21,"adjustment-cart"),o()()()}if(i&2){let t=c();s(5),p("disabled",t.storeService.AdjustmentState()===1)("isOpenAfterLoad",w(6,16,t.isOpenDiaglog$))("outlets",t.storeService.Outlets())("ngModel",t.storeService.Outlet()),s(2),p("ngModel",t.storeService.Order().Number)("transactionType",w(8,18,t.transactionType$))("disabled",!(t.roleService.global!=null&&t.roleService.global.Number)),s(2),p("ngModel",t.storeService.Order().Date)("disabled",!(t.roleService.global!=null&&t.roleService.global.Date))("tooltip",t.roleService.global!=null&&t.roleService.global.Date?"":"Date role is required"),s(7),p("clearable",!1)("ngModel",t.storeService.Order().TypeID)("disabled",!!t.storeService.Order().TypeID&&t.storeService.AdjustmentState()===1)("items",t.storeService.AdjustmentTypes()),s(3),p("quickKey",t.storeService.QuickeyItems())("outletID",t.storeService.Outlet().ID)}}var Xn=class i{isOpenDialog=z(!0);loadFormService=h(Ft);intercom=h(Vi);storeService=h(B);quickeyService=h(Ln);cartService=h(ye);orderService=h(Ne);isOpenDiaglog$;Outlets$;loadForm$;adjustmentEditDataAdapter=h(Yn);roleService=h(G);#e=h(Qe);#t=h(Ut);#n=h(yt);transactionType$=this.#n.queryParamMap.pipe(Se(e=>(e.has("ID"),"Adjustment")));title=h(dn);injector=h(ge);renderer=h(sn);test=[];ngOnInit(){this.storeService.onResetState(),this.intercom.hideLauncher();let e=JSON.parse(localStorage.getItem("AccountInfo"));this.title.setTitle(e.BrandName+" POS | Inventory Adjustment"),this.test=this.storeService.Outlets()&&this.storeService.Outlets().filter((t,r)=>r===0),this.#n.queryParamMap.pipe(X(t=>{if(t.has("ID")){this.storeService.onChangeAdjustmentState(1);let r={EntityID:"00000000-0000-0000-0000-000000000000",ID:t.get("ID")};return this.storeService.onChangeIsOpenDialog(!1),this.storeService.onChangeAdjustmentState(1),this.loadFormService.httpRequestLoadForm$(r).pipe(j(n=>{if(n.Data&&Object.keys(n.Data).length>0&&Object.keys(this.storeService.LoadForm().Data).length>0){this.orderService.onUpdateOrderState("Number",n.Data.Order.Number),this.orderService.onUpdateOrderState("Date",new Date(n.Data.Order.Date)),this.orderService.onUpdateOrderState("StateID",n.Data.Order.StateID),this.orderService.onUpdateOrderState("TypeID",n.Data.Order.TypeID),this.orderService.onUpdateOrderState("EntityID",n.Data.Order.EntityID);let m=n.Data.Items.map(y=>this.#e.adapt(k(M({},y),{Variant:this.#t.adapt(y.Variant)})));if(this.storeService.onChangeCartItems(m),this.orderService.onUpdateOrderState("PIC",n.Data.Order.PIC),this.orderService.onUpdateOrderState("Note",n.Data.Order.Note),this.orderService.onUpdateOrderState("TagID",n.Data.Order.TagID),n.Entities.length>0){let y=n.Entities.findIndex(b=>b.ID===n.Data.Order.EntityID);y!==-1&&this.storeService.onChangeOutlet(n.Entities[y])}}}))}return this.storeService.onChangeAdjustmentState(0),this.loadFormService.httpRequestLoadForm$()})).subscribe({}),he(this.storeService.IsOpenDialog,{injector:this.injector}).pipe().subscribe(),this.isOpenDiaglog$=he(this.storeService.IsOpenDialog,{injector:this.injector})}onChangeAdjustmentType(e){let t=this.storeService.AdjustmentTypes().filter(r=>r.Key===e)[0];this.orderService.onUpdateOrderState("TypeID",t.Key)}onInvoiceNumberChange(e){this.orderService.onUpdateOrderState("Number",e)}onChangeOrderDate(e){this.orderService.onUpdateOrderState("Date",(0,Gr.default)(e).startOf("day").format("YYYY-MM-DDTHH:mm:ss.SSS"))}onSelectVariant(e){this.cartService.addItemByVariantID(e)}ngOnDestroy(){this.storeService.onResetState(),this.intercom.showLauncher()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["POS-adjustment-v2"]],standalone:!0,features:[Q],decls:3,vars:2,consts:[["ON_GOING",""],[4,"ngIf","ngIfElse"],[3,"cartItems"],[1,"container-fluid","overflow-x-hidden"],[1,"row","header","border-bottom"],[1,"col-5","border-end"],[1,"left-toolbar-container","h-100","d-flex","align-items-center","justify-content-between"],[1,"d-flex","flex-column"],[3,"ngModelChange","disabled","isOpenAfterLoad","outlets","ngModel"],[3,"ngModelChange","ngModel","transactionType","disabled"],[3,"ngModelChange","ngModel","disabled","tooltip"],[1,"col-7","d-flex","align-items-center"],[1,"row","flex-grow-1"],[1,"col-4","d-flex","align-items-center"],[1,"col","ps-0","d-flex","align-items-center","justify-content-end","gap-1"],[1,"fa-regular","fa-sliders"],["bindLabel","Value","bindValue","Key","placeholder","Choose...",1,"",3,"ngModelChange","clearable","ngModel","disabled","items"],[1,"row","content"],[1,"col-5","border-end",2,"height","inherit"],[3,"onSelectVariant","quickKey","outletID"],[1,"col-7",2,"height","calc(100% - 0)","padding","0"]],template:function(t,r){if(t&1&&_(0,Sl,2,1,"ng-container",1)(1,Il,22,20,"ng-template",null,0,R),t&2){let n=ee(2);p("ngIf",r.storeService.IsComplete())("ngIfElse",n)}},dependencies:[q,ht,ir,_r,gr,ur,rt,$,pe,Dt,ce,$n,Kn,Zn],styles:[".left-toolbar-container[_ngcontent-%COMP%]{position:relative}.left-toolbar-container[_ngcontent-%COMP%] POS-invoice-number-form[_ngcontent-%COMP%]{position:absolute;top:34px;left:28px}.header[_ngcontent-%COMP%]{min-height:60px}.content[_ngcontent-%COMP%]{height:calc(100vh - 60px);overflow:hidden}.supplier-more-menu[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.cart-display[_ngcontent-%COMP%]{flex-grow:1;height:0px;overflow-y:auto}input[_ngcontent-%COMP%]{width:100%;height:38px!important;border:0;border-bottom:1px solid #ced4da;padding-left:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i[_ngcontent-%COMP%]{font-size:16px;top:10.6px;left:13px}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]{transition:.4s}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(1){-webkit-transform:rotate(-45deg) translate(-8px,4px);transform:rotate(-45deg) translate(-8px,4px)}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(2){opacity:0}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(45deg) translate(-5px,0px);transform:rotate(45deg) translate(-5px)}.mobile-button[_ngcontent-%COMP%]{display:none}@media (max-width: 990px){.mobile-button[_ngcontent-%COMP%]{display:block}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.more-actions[_ngcontent-%COMP%] div.d-flex[_ngcontent-%COMP%]{width:30rem}[_nghost-%COMP%] .ng-select .ng-select-container{border:none}"]})};var bl=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Dl=i=>({ID:i});function Pl(i,e){if(i&1){let t=v();a(0,"button",11),f("click",function(){d(t);let n=c(2);return u(n.openExportModal())}),g(1,"i",12),l(2," Export "),o()}}function Tl(i,e){if(i&1){let t=v();a(0,"div")(1,"div",13)(2,"h6"),l(3,"Variant"),o(),a(4,"autocompleteV2",14),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.ID,n)||(m.pageData.Filter.ID=n),u(n)}),o(),a(5,"h6"),l(6,"Outlet"),o(),a(7,"ng-select",15),T("ngModelChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.EntityID,n)||(m.pageData.Filter.EntityID=n),u(n)}),o(),a(8,"h6"),l(9,"From"),o(),a(10,"datepicker",16),T("dateChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.From,n)||(m.pageData.Filter.From=n),u(n)}),o(),a(11,"h6"),l(12,"To"),o(),a(13,"datepicker",17),T("dateChange",function(n){d(t);let m=c(2);return D(m.pageData.Filter.To,n)||(m.pageData.Filter.To=n),u(n)}),o()()()}if(i&2){let t=c(2);s(4),P("ngModel",t.pageData.Filter.ID),p("inputTextValue",t.pageData.Filter.VariantName),s(3),p("items",t.pageData.Options.Entities),P("ngModel",t.pageData.Filter.EntityID),s(3),p("isFloatingLabel",!1),P("date",t.pageData.Filter.From),s(3),p("isFloatingLabel",!1),P("date",t.pageData.Filter.To)}}function wl(i,e){i&1&&(a(0,"th"),l(1,"Variant"),o())}function El(i,e){if(i&1&&(a(0,"td"),l(1),o()),i&2){let t=c().$implicit;s(),x(t.Name)}}function Ml(i,e){if(i&1&&(a(0,"tr",18),_(1,El,2,1,"td",8),C(2,"async"),a(3,"td"),l(4),o(),a(5,"td")(6,"a",19),l(7),o()(),a(8,"td"),l(9),C(10,"number"),o(),a(11,"td"),l(12),C(13,"date"),o()()),i&2){let t=e.$implicit,r=c(2);s(),p("ngIf",!w(2,7,r.isRedirect$)),s(3),x(t.EntityName),s(2),p("routerLink",te(14,bl))("queryParams",U(15,Dl,t.ID)),s(),x(t.Number),s(2),x(w(10,9,t.Quantity)),s(3),x(V(13,11,t.Date,"dd/MM/yy"))}}function Ol(i,e){if(i&1){let t=v();a(0,"mainpanel-cmp",2),T("textChange",function(n){d(t);let m=c();return D(m.pageData.Filter.Number,n)||(m.pageData.Filter.Number=n),u(n)}),f("onSubmit",function(){d(t);let n=c();return u(n.searchFromPageOne())}),T("filterChange",function(n){d(t);let m=c();return D(m.pageData.Filter,n)||(m.pageData.Filter=n),u(n)}),a(1,"actions"),_(2,Pl,3,0,"button",3),o(),a(3,"filters"),_(4,Tl,14,8,"ng-template",null,0,R),o(),a(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr"),_(12,wl,2,0,"th",8),C(13,"async"),a(14,"th"),l(15,"Outlet"),o(),a(16,"th"),l(17,"Number"),o(),a(18,"th"),l(19,"Quantity"),o(),a(20,"th"),l(21,"Date"),o()()(),a(22,"tbody"),_(23,Ml,14,17,"tr",9),o()()(),a(24,"POS-complex-pagination",10),f("jumpToPage",function(){d(t);let n=c();return u(n.getListData())})("previousPage",function(){d(t);let n=c();return u(n.getListData())})("nextPage",function(){d(t);let n=c();return u(n.getListData())}),o()()()()}if(i&2){let t=c();p("pageData",t.menuData),P("text",t.pageData.Filter.Number),p("isFilterOnDropdown",!1),P("filter",t.pageData.Filter),s(2),p("ngIf",t.roleService.global.Export),s(10),p("ngIf",!w(13,9,t.isRedirect$)),s(11),p("ngForOf",t.data.Data),s(),p("total",t.data.Data==null?null:t.data.Data.length)("pageData",t.pageData)}}var ei=class i extends Pe{constructor(t,r,n,m,y){super(t,r,"catalog/product/GetAdjustmentHistory","catalog/productLoader/GetAdjustmentHistoryLoader",null,n);this.matDialog=m;this.roleService=y;this.isRedirect$=tn(this.route.snapshot.queryParamMap).pipe(Se(b=>b.has("ID")),rn(1))}isRedirect$;openExportModal(){this.matDialog.open(Le,{data:{title:"Adjustment History",exportTypes:[{ID:"ProductExport/GetAdjustmentHistory",Value:"Default",FileName:"Adjustment History"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"catalog/product/GetCountAdjustmentHistory",pagination:!0}})}static \u0275fac=function(r){return new(r||i)(S(ie),S(A),S(yt),S(ne),S(G))};static \u0275cmp=E({type:i,selectors:[["POS-history-variant"]],features:[le],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[4,"ngIf"],["class","border-bottom",4,"ngFor","ngForOf"],["api","catalog/product/GetCountAdjustmentHistory",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName","placeholder","Variant","inputID","ID","notFoundMessageFor","variant",1,"form-control","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModelChange","items","ngModel"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],[1,"border-bottom"],["target","_blank",3,"routerLink","queryParams"]],template:function(r,n){r&1&&_(0,Ol,25,11,"mainpanel-cmp",1),r&2&&p("ngIf",n.data)},dependencies:[J,q,be,re,$,pe,Ot,ce,wt,at,ht,Z,nt]})};var Al=[{path:"Adjustment/Archive",component:Pn},{path:"Adjustment/Archive/Info",component:In},{path:"Adjustment/Archive/Form",component:Xn,canActivate:[Mr],data:{roles:[ai.adjustment.Create,ai.adjustment.Edit]}},{path:"Tools/Count_Product_Inventory",component:jn},{path:"Tools/Convert_Inventory_to_Parent_UOM",component:An},{path:"Tools/Product_Sheet",component:kn},{path:"Report/Adjustment",component:wn},{path:"History/Variant",component:ei},{path:"Adjustment/Stock_Take_by_Web_Spreadsheet",component:On},{path:"Adjustment/Stock_Take_by_CSV",component:En},{path:"",redirectTo:"Adjustment/Archive",pathMatch:"full"}],ti=class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=_t({type:i});static \u0275inj=ut({imports:[Kt.forChild(Al),Kt]})};var xi=class i{constructor(e){this.http=e}currentUntilPage;toggleFetchTotalData;totalData;pageNumber;isNextBtnDisabled;isOnLastPage;calcCurrentUntilPage(e,t,r){this.currentUntilPage=e*(t-1)+r}setPageNumber(e){this.pageNumber=e}setPaginationButtonState(e,t,r){r==0?this.isNextBtnDisabled=!0:this.isNextBtnDisabled=!(r<e*t)}setTotalData(e,t,r){this.toggleFetchTotalData=!0,this.http.post(e,t).pipe(j(r)).subscribe(n=>this.totalData=n)}setPaginationState(e,t,r){this.calcCurrentUntilPage(e,t,r),this.setPageNumber(t),this.setPaginationButtonState(e,t,r)}static \u0275fac=function(t){return new(t||i)(Di(A))};static \u0275prov=L({token:i,factory:i.\u0275fac,providedIn:"root"})};var ni=class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=_t({type:i});static \u0275inj=ut({imports:[Ie]})};var zr=class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=_t({type:i});static \u0275inj=ut({imports:[Cn,Ie,ti,fn,rt,gn,er,Dt,br,Dr,Et,ue,rr,Gi,Yi,ue,pr,ar,si,Zi,Pt,Fi,Hi,nr,Ni,wr,si,Bi,Pr,Tr,dr,jt,vr,ni,At,Mt,yn,xn,Sn]})};export{zr as AdjustmentModule};