@feedmepos/mf-inventory-portal 1.3.13 → 1.3.14-dev.1

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 (88) hide show
  1. package/dist/App-Cb6qfRCz.js +445 -0
  2. package/dist/{ApprovalView-ClQU6bq0.js → ApprovalView-BxioAXpO.js} +7 -7
  3. package/dist/{BindingsDialog--w8amPhB.js → BindingsDialog-Dn_hP7Ji.js} +13 -13
  4. package/dist/{BindingsPicker-CLZ2cy95.js → BindingsPicker-BEXOUaoI.js} +2 -2
  5. package/dist/{BindingsTable-DMKnwFJt.js → BindingsTable-CsRLA5J_.js} +3 -3
  6. package/dist/{ClosingDraftView-DOSvb2cx.js → ClosingDraftView-DoH9ZcGA.js} +136 -136
  7. package/dist/{ClosingHistoryView-Dbysx1Ca.js → ClosingHistoryView-BWf_gIrc.js} +32 -32
  8. package/dist/{ClosingTemplateView-kOWpFBhr.js → ClosingTemplateView-BKRxzvQX.js} +14 -14
  9. package/dist/{DeliveryOrderPrintPreview-CTrf0b97.js → DeliveryOrderPrintPreview-HzspgQXj.js} +11 -11
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-HLHu23Ly.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DstxeP1q.js} +20 -20
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BTwfJTx3.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-E9FFFhwx.js} +2 -2
  12. package/dist/{FmMultiselectDialog-D8AXgAuO.js → FmMultiselectDialog-3uKA-o0f.js} +1 -1
  13. package/dist/{FmMultiselectDialog-ByvnmkuF.js → FmMultiselectDialog-uFZKKIiO.js} +2 -2
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-B8Jp-237.js → FmUnitInput.vue_vue_type_script_setup_true_lang-C1KGaqi7.js} +18 -18
  15. package/dist/{ImportView-B8jTVkI3.js → ImportView-zrNDzp3k.js} +6 -6
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-D3bMh_iG.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-B2vMgXVZ.js} +1 -1
  17. package/dist/{IngredientGroupView-DEZHQArP.js → IngredientGroupView-HcAKvPur.js} +5 -5
  18. package/dist/{IngredientsView-D_0aKc2P.js → IngredientsView-CRB5UN-e.js} +15 -15
  19. package/dist/{IntegrationExplorerView-RNQ89fRN.js → IntegrationExplorerView-k3IHeiOU.js} +5 -5
  20. package/dist/{IntegrationView-HyqeX65i.js → IntegrationView-B3WeQTDB.js} +13 -13
  21. package/dist/{InventoryBindingForm-GXWU6jVC.js → InventoryBindingForm-B-7SQKl2.js} +1 -1
  22. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BSWEOGs7.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DhPu_GyE.js} +15 -15
  23. package/dist/{InventoryBindingSummary-Dcsun-ae.js → InventoryBindingSummary-Swi6A3W2.js} +1 -1
  24. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BPHzJFkv.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Duv0At06.js} +1 -1
  25. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-eaX2F6rA.js → PremiumBadge.vue_vue_type_script_setup_true_lang--gt60IlU.js} +9 -9
  26. package/dist/{PublishView-BzaSX1CF.js → PublishView-B9HJT61I.js} +11 -11
  27. package/dist/{PurchaseOrderPrintPreview-Dq9RVILX.js → PurchaseOrderPrintPreview-sClUXkgt.js} +9 -9
  28. package/dist/{ReceiveRequestView-CUR65B8h.js → ReceiveRequestView-BbS55juS.js} +23 -23
  29. package/dist/{RecipeView-DA1exNa3.js → RecipeView-BH3asOD4.js} +50 -50
  30. package/dist/{SettingsView-G9VVMREu.js → SettingsView-BJAMNNhr.js} +30 -30
  31. package/dist/StockView-DMLFY7d1.js +2439 -0
  32. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DflfaS_i.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DeiLMVin.js} +1 -1
  33. package/dist/{SupplierView-Br3PxWl6.js → SupplierView-C3uBrEcc.js} +12 -12
  34. package/dist/{SurchargeView-DnC875ic.js → SurchargeView-S9ByD9Nd.js} +6 -6
  35. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DxElZDE3.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-ha60Wy7z.js} +2 -2
  36. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DncbuAH1.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CfyCEElN.js} +1 -1
  37. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-R0DRQHII.js → TransferDetails.vue_vue_type_script_setup_true_lang-CKfs-ns0.js} +790 -806
  38. package/dist/{TransferTemplateView-CN-1iASP.js → TransferTemplateView-zbn5CGiZ.js} +17 -17
  39. package/dist/{UnitCostHistoryView-HMfTl2Rl.js → UnitCostHistoryView-LhvAybS8.js} +246 -243
  40. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BQSRm_uN.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-E2QCl521.js} +4 -4
  41. package/dist/{UnitView-2J7SxbnX.js → UnitView-6oUdlUVo.js} +24 -24
  42. package/dist/{WarehouseView-EIXt8wd0.js → WarehouseView-DQFe99KT.js} +5 -5
  43. package/dist/{WastageTemplateView-B8yQevPX.js → WastageTemplateView-BiYZqiT2.js} +14 -14
  44. package/dist/{app-DZ_O5S5y.js → app-SnX9gL_k.js} +23514 -22309
  45. package/dist/app.d.ts +6 -6
  46. package/dist/app.js +2 -2
  47. package/dist/{closing-template-C3F4uA55.js → closing-template-Ch--jBk-.js} +1 -1
  48. package/dist/components/HrmPermissionGuard.vue.d.ts +54 -0
  49. package/dist/composable/useHrmPermission.d.ts +17 -0
  50. package/dist/{date2-DoKx3vEH.js → date2-CGqqJOqr.js} +1 -1
  51. package/dist/{dayjs.min-BzKmIVU5.js → dayjs.min-JnfBpNSN.js} +1 -1
  52. package/dist/{decimal-CHryhQrv.js → decimal-C-2MQYNP.js} +2 -2
  53. package/dist/{defineDeepModel-Dt72PPYN.js → defineDeepModel-CUJCBuvw.js} +1 -1
  54. package/dist/{duplicate-template-k0PYkiot.js → duplicate-template-BXg5EQRC.js} +1 -1
  55. package/dist/{export-D0nU9NCc.js → export-DUsFBcmf.js} +1 -1
  56. package/dist/{feature-DTXvUM9q.js → feature-gkhmly57.js} +28 -28
  57. package/dist/{format-time-from-id-CjML4YH3.js → format-time-from-id-D1RhcKfL.js} +1 -1
  58. package/dist/{format-unit-display-BASnDwRJ.js → format-unit-display-DXs_-yEW.js} +11 -11
  59. package/dist/{import-export.helper-BGRAKGXv.js → import-export.helper-B84wW0eo.js} +6 -6
  60. package/dist/{index-FhahM2dg.js → index-D3XgyMwL.js} +1 -1
  61. package/dist/{index-Db7jD-CU.js → index-Dp1GAjHf.js} +3 -3
  62. package/dist/{index-D5qTaOFp.js → index-artVJVqL.js} +1 -1
  63. package/dist/{inventory-core-dart.default-Cvvr8rpN.js → inventory-core-dart.default-Bu1oVkLC.js} +10 -10
  64. package/dist/{lodash-B4Uj749H.js → lodash-DZbYS5Vn.js} +1 -1
  65. package/dist/{lz-string-Ckbaw1Bu.js → lz-string-nX96TtT6.js} +17 -17
  66. package/dist/{netsuite-B4O7LRpC.js → netsuite-DQkJKCH9.js} +109 -109
  67. package/dist/{number-9PlMlR2G.js → number-gRrApZRj.js} +7 -7
  68. package/dist/{predefined-templates-BqAy88Rp.js → predefined-templates-D9bzSOz_.js} +1 -1
  69. package/dist/{purchase-order-template-KkhC0FCL.js → purchase-order-template-BiE_We2X.js} +1 -1
  70. package/dist/{recalculationUtils-Rj0SZQO3.js → recalculationUtils-zNt-EW5S.js} +1 -1
  71. package/dist/router/route-permission.d.ts +10 -0
  72. package/dist/{rules-BvLBkdfK.js → rules-CWFFr_mA.js} +2 -2
  73. package/dist/{stock-CoG3l91v.js → stock-C-34Vuxz.js} +3 -3
  74. package/dist/{stock-yUbmIey0.js → stock-V4Oy4QHQ.js} +28 -27
  75. package/dist/{supplier-Qlox4B8s.js → supplier-DbYagMhS.js} +16 -16
  76. package/dist/{surcharge-CsAxFX-L.js → surcharge-CcvvfLHB.js} +5 -5
  77. package/dist/tsconfig.app.tsbuildinfo +1 -1
  78. package/dist/{use-ingredient-select-dialog-BOtDFKQO.js → use-ingredient-select-dialog-B4jFgJ5b.js} +2 -2
  79. package/dist/{use-inventory-binding-dialog-Dz5NbeEn.js → use-inventory-binding-dialog-20flYyGE.js} +2 -2
  80. package/dist/{use-template-enabled-locations-MNNKqChl.js → use-template-enabled-locations-CpDMbAGF.js} +2 -2
  81. package/dist/useHrmPermission-CZW6u2TS.js +16 -0
  82. package/dist/views/receive-request/composables/use-order-draft-permission.d.ts +2 -5
  83. package/dist/{vue-i18n-BqX2td3b.js → vue-i18n-CUrz9OVK.js} +389 -389
  84. package/dist/{xlsx-CtRIIkxr.js → xlsx-DBsOBE1z.js} +1 -1
  85. package/dist/{xlsx.util-Bd4_86rn.js → xlsx.util-xziohm10.js} +1 -1
  86. package/package.json +5 -4
  87. package/dist/App-Dm-YoD_v.js +0 -411
  88. package/dist/StockView-3J7Gkskb.js +0 -2406
@@ -1,26 +1,26 @@
1
1
  import { defineComponent as je, ref as K, computed as U, onMounted as ct, resolveComponent as W, openBlock as k, createElementBlock as V, Fragment as ie, createTextVNode as me, createBlock as ae, withCtx as Z, createElementVNode as n, toDisplayString as O, unref as l, createVNode as F, createCommentVNode as H, h as $, watch as Le, renderList as ke, reactive as Ct, isRef as ut, normalizeClass as Se, normalizeStyle as Bt, createSlots as Qt, Teleport as Zt, mergeProps as Jt } from "vue";
2
2
  import { u as Xt, _ as en } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-sUxHOj47.js";
3
- import { useCoreStore as It, useI18n as tt } from "@feedmepos/mf-common";
4
- import { useSnackbar as nt, useDialog as tn, components as _e, useProxiedModel as Tt, useBreakpoints as nn } from "@feedmepos/ui-library";
5
- import { o as an, u as Oe, M as se, y as ee, s as jt, v as Ie, O as xe, D as Te, c as on, a as dt, k as sn } from "./app-DZ_O5S5y.js";
3
+ import { useCoreStore as Tt, useI18n as tt } from "@feedmepos/mf-common";
4
+ import { useSnackbar as nt, useDialog as tn, components as _e, useProxiedModel as It, useBreakpoints as nn } from "@feedmepos/ui-library";
5
+ import { p as an, u as Oe, Q as se, A as ee, v as jt, x as Te, T as xe, G as Ie, c as on, a as dt, l as sn } from "./app-SnX9gL_k.js";
6
6
  import { defineStore as Pt, storeToRefs as rn } from "pinia";
7
- import { b as Xe, e as Vt, f as ln, a as Ce } from "./date2-DoKx3vEH.js";
8
- import { R as cn } from "./rules-BvLBkdfK.js";
9
- import { e as mt, a as it, t as Mt, c as ze, l as Ut, m as Rt, j as Nt, k as Et, o as ne } from "./number-9PlMlR2G.js";
10
- import { b as un, d as dn } from "./xlsx.util-Bd4_86rn.js";
11
- import { u as mn } from "./stock-CoG3l91v.js";
12
- import { u as at } from "./stock-yUbmIey0.js";
7
+ import { b as Xe, e as Vt, f as ln, a as Ce } from "./date2-CGqqJOqr.js";
8
+ import { R as cn } from "./rules-CWFFr_mA.js";
9
+ import { e as mt, a as it, t as Mt, c as ze, l as Ut, m as Rt, j as Nt, k as Et, o as ne } from "./number-gRrApZRj.js";
10
+ import { b as un, d as dn } from "./xlsx.util-xziohm10.js";
11
+ import { u as mn } from "./stock-C-34Vuxz.js";
12
+ import { u as at } from "./stock-V4Oy4QHQ.js";
13
13
  import { D as St, R as Re } from "./row-action.enum-Co_O4qD9.js";
14
14
  import { c as fn } from "./component-kqxARxvM.js";
15
- import { f as pn } from "./format-time-from-id-CjML4YH3.js";
16
- import { f as vn } from "./recalculationUtils-Rj0SZQO3.js";
17
- import { _ as yn } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BTwfJTx3.js";
15
+ import { f as pn } from "./format-time-from-id-D1RhcKfL.js";
16
+ import { f as vn } from "./recalculationUtils-zNt-EW5S.js";
17
+ import { _ as yn } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-E9FFFhwx.js";
18
18
  import { E as gn } from "./empty-placeholder-wf6-BWE8.js";
19
19
  import { F as $t } from "./FmAdminBadge-DjnBAgyv.js";
20
- import { u as bn } from "./vue-i18n-BqX2td3b.js";
21
- import { F as hn } from "./decimal-CHryhQrv.js";
22
- import { r as _n, u as Ze, w as kn } from "./xlsx-CtRIIkxr.js";
23
- import { d as wn } from "./dayjs.min-BzKmIVU5.js";
20
+ import { u as bn } from "./vue-i18n-CUrz9OVK.js";
21
+ import { F as hn } from "./decimal-C-2MQYNP.js";
22
+ import { r as _n, u as Ze, w as kn } from "./xlsx-DBsOBE1z.js";
23
+ import { d as wn } from "./dayjs.min-JnfBpNSN.js";
24
24
  import { F as xn } from "./FmDroppableField-J0xUsOTV.js";
25
25
  import { _ as Dn } from "./FmConfirmationButton.vue_vue_type_script_setup_true_lang-DLrMEGFR.js";
26
26
  import { _ as An, F as Qe } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
@@ -83,7 +83,7 @@ const He = an((a, t) => {
83
83
  return "Mark as Failed";
84
84
  }
85
85
  throw new Error(`Unknown action: ${t.action}`);
86
- }), I = U(() => {
86
+ }), T = U(() => {
87
87
  switch (t.action) {
88
88
  case se.enum.approveDraft:
89
89
  return "primary";
@@ -214,7 +214,7 @@ const He = an((a, t) => {
214
214
  F(b, {
215
215
  label: C.value,
216
216
  type: "submit",
217
- variant: I.value,
217
+ variant: T.value,
218
218
  loading: c.value
219
219
  }, null, 8, ["label", "variant", "loading"])
220
220
  ])
@@ -225,19 +225,19 @@ const He = an((a, t) => {
225
225
  ], 64));
226
226
  };
227
227
  }
228
- }), In = ze(0);
228
+ }), Tn = ze(0);
229
229
  function Lt(a) {
230
230
  const t = a.measurementsAmounts.groupBy((o) => o.measurement.id), e = a.sku.unit.measurements.reduce((o, h) => {
231
231
  var f, C;
232
- const c = ((C = (f = t.get(h.id)) == null ? void 0 : f[0]) == null ? void 0 : C.amount) ?? In, r = mt(h.conversion, c);
232
+ const c = ((C = (f = t.get(h.id)) == null ? void 0 : f[0]) == null ? void 0 : C.amount) ?? Tn, r = mt(h.conversion, c);
233
233
  return o + +it(r);
234
234
  }, +it(a.baseAmount));
235
235
  return Mt(e, a.baseAmount.precision);
236
236
  }
237
- const Tn = ze(0), jn = ze(100);
237
+ const In = ze(0), jn = ze(100);
238
238
  function Pn(a, t, e, o, h, c, r, f) {
239
239
  var q, de, E, B, re;
240
- const C = Lt(a), I = o ?? C, i = Ut(I, t), P = t.amount === 0 ? null : Rt(i, {
240
+ const C = Lt(a), T = o ?? C, i = Ut(T, t), P = t.amount === 0 ? null : Rt(i, {
241
241
  ...t,
242
242
  amount: Math.abs(t.amount)
243
243
  }), M = P ? mt(P, jn) : null, N = ((q = a.sku.defaultCost) == null ? void 0 : q.costPerUnit) ?? { amount: 0, precision: 0 }, j = Number(ee.toFormatString({ value: N })), x = ((E = (de = a.sku.defaultCost) == null ? void 0 : de.measurement) == null ? void 0 : E.conversion) ?? {
@@ -245,7 +245,7 @@ function Pn(a, t, e, o, h, c, r, f) {
245
245
  precision: 0
246
246
  }, d = Number(
247
247
  ee.toFormatString({ value: x })
248
- ), p = h ? Number(ee.toFormatString({ value: h })) : 0, u = Number(ee.toFormatString({ value: t })), g = Number(ee.toFormatString({ value: I })), b = g - u, D = b * j / d, S = g * j / d, Y = u * j / d, te = {};
248
+ ), p = h ? Number(ee.toFormatString({ value: h })) : 0, u = Number(ee.toFormatString({ value: t })), g = Number(ee.toFormatString({ value: T })), b = g - u, D = b * j / d, S = g * j / d, Y = u * j / d, te = {};
249
249
  return r && c && r.forEach((w) => {
250
250
  const J = { amount: 0, precision: 0 }, X = c[w];
251
251
  if (X) {
@@ -340,7 +340,7 @@ function Un(a, t = [], e = []) {
340
340
  // Dynamic adjustment type columns
341
341
  ...t.map((r) => ({
342
342
  id: `adjustment_${r}`,
343
- name: Ie(r)
343
+ name: Te(r)
344
344
  })),
345
345
  {
346
346
  id: "systemBalance",
@@ -387,7 +387,7 @@ function Un(a, t = [], e = []) {
387
387
  // Dynamic custom attribute columns
388
388
  ...e.map((r) => ({
389
389
  id: `customAttr_${r}`,
390
- name: Ie(r)
390
+ name: Te(r)
391
391
  }))
392
392
  ];
393
393
  }
@@ -407,13 +407,13 @@ function Rn(a, t, e, o = []) {
407
407
  if (a.adjustmentSnapshot)
408
408
  for (const w of a.adjustmentSnapshot)
409
409
  w.adjustmentsByType && (Object.keys(w.adjustmentsByType).forEach((J) => f.add(J)), C.set(w.skuId, w.adjustmentsByType));
410
- const I = ["receive", "sales", "wastage"], i = [];
411
- I.forEach((w) => {
410
+ const T = ["receive", "sales", "wastage"], i = [];
411
+ T.forEach((w) => {
412
412
  f.has(w) && (i.push(w), f.delete(w));
413
413
  });
414
414
  const P = Array.from(f).sort(), M = [...i, ...P], N = [...a.items, ...a.negativeStockItems ?? []], j = zt(N), x = N.map((w) => {
415
415
  var le, De, $e;
416
- const J = ((le = h.get(w.sku._id)) == null ? void 0 : le[0]) ?? Tn, X = ((De = j == null ? void 0 : j.get(w.sku._id)) == null ? void 0 : De[0]) ?? [], fe = r.get(w.sku._id), Pe = C.get(w.sku._id);
416
+ const J = ((le = h.get(w.sku._id)) == null ? void 0 : le[0]) ?? In, X = ((De = j == null ? void 0 : j.get(w.sku._id)) == null ? void 0 : De[0]) ?? [], fe = r.get(w.sku._id), Pe = C.get(w.sku._id);
417
417
  return Pn(
418
418
  w,
419
419
  J,
@@ -424,7 +424,7 @@ function Rn(a, t, e, o = []) {
424
424
  M,
425
425
  o
426
426
  );
427
- }), d = Mn(N), u = It().currentBusiness.value, g = Un(d, M, o), b = [
427
+ }), d = Mn(N), u = Tt().currentBusiness.value, g = Un(d, M, o), b = [
428
428
  ["Business name:", u == null ? void 0 : u.name],
429
429
  ["Business ID:", u == null ? void 0 : u._id],
430
430
  ["Menu version", u == null ? void 0 : u.menuVersion],
@@ -469,8 +469,8 @@ const Nn = { class: "flex flex-col" }, En = {
469
469
  if (t.draft.effectiveAt)
470
470
  o.value = new Date(t.draft.effectiveAt);
471
471
  else {
472
- const I = new Date(t.draft.createdAt);
473
- I.setHours(23, 59, 59, 999), o.value = I;
472
+ const T = new Date(t.draft.createdAt);
473
+ T.setHours(23, 59, 59, 999), o.value = T;
474
474
  }
475
475
  h.value = !0;
476
476
  });
@@ -478,9 +478,9 @@ const Nn = { class: "flex flex-col" }, En = {
478
478
  get() {
479
479
  return o.value === null ? "" : Xe(o.value);
480
480
  },
481
- set(I) {
482
- if (I) {
483
- const i = /* @__PURE__ */ new Date(`${I} ${r.value}`);
481
+ set(T) {
482
+ if (T) {
483
+ const i = /* @__PURE__ */ new Date(`${T} ${r.value}`);
484
484
  i.setSeconds(59, 999), o.value = i;
485
485
  } else
486
486
  o.value = null;
@@ -489,9 +489,9 @@ const Nn = { class: "flex flex-col" }, En = {
489
489
  get() {
490
490
  return o.value === null ? "" : Vt(o.value);
491
491
  },
492
- set(I) {
493
- if (I) {
494
- const i = /* @__PURE__ */ new Date(`${c.value} ${I}`);
492
+ set(T) {
493
+ if (T) {
494
+ const i = /* @__PURE__ */ new Date(`${c.value} ${T}`);
495
495
  i.setSeconds(59, 999), o.value = i;
496
496
  } else
497
497
  o.value = null;
@@ -500,7 +500,7 @@ const Nn = { class: "flex flex-col" }, En = {
500
500
  async function C() {
501
501
  e.value = !0, t.onFinished(o.value.toISOString());
502
502
  }
503
- return (I, i) => {
503
+ return (T, i) => {
504
504
  const P = W("FmLabel"), M = W("FmDatePicker"), N = W("FmTimePicker"), j = W("FmButton"), x = W("FmForm");
505
505
  return h.value ? (k(), ae(x, {
506
506
  key: 1,
@@ -549,7 +549,7 @@ const Nn = { class: "flex flex-col" }, En = {
549
549
  F(j, {
550
550
  label: "Cancel",
551
551
  variant: "tertiary",
552
- onClick: i[2] || (i[2] = (d) => I.onCancel())
552
+ onClick: i[2] || (i[2] = (d) => T.onCancel())
553
553
  }),
554
554
  F(j, {
555
555
  label: "Refresh balance",
@@ -576,7 +576,7 @@ const Nn = { class: "flex flex-col" }, En = {
576
576
  };
577
577
  f.value = b, r.value = !0;
578
578
  }
579
- async function I(g) {
579
+ async function T(g) {
580
580
  var D;
581
581
  if (g.status === xe.enum.COMPLETED) {
582
582
  const S = g.closingAdjustmentId;
@@ -601,7 +601,7 @@ const Nn = { class: "flex flex-col" }, En = {
601
601
  b || (e.open({
602
602
  title: "Exporting",
603
603
  message: "Fetching data..."
604
- }), b = await I(g)), Rn(g, b, D ?? [], S ?? []);
604
+ }), b = await T(g)), Rn(g, b, D ?? [], S ?? []);
605
605
  }
606
606
  function P(g, b, D) {
607
607
  t.open({
@@ -744,7 +744,7 @@ function Je(a) {
744
744
  const Ot = Pt(
745
745
  "closingDraftTable",
746
746
  function() {
747
- const { t } = tt(), e = It(), o = et(), h = K(new Array()), c = K(!1), r = Oe(), f = He();
747
+ const { t } = tt(), e = Tt(), o = et(), h = K(new Array()), c = K(!1), r = Oe(), f = He();
748
748
  async function C() {
749
749
  if (h.value = [], !!r._currentLocation) {
750
750
  c.value = !0;
@@ -758,7 +758,7 @@ const Ot = Pt(
758
758
  }
759
759
  }
760
760
  }
761
- async function I(d) {
761
+ async function T(d) {
762
762
  if (!h.value.find((p) => p._id) && r._currentLocation) {
763
763
  c.value = !0;
764
764
  try {
@@ -776,7 +776,7 @@ const Ot = Pt(
776
776
  }
777
777
  function i(d) {
778
778
  const p = vn(
779
- d.filter((u) => !!u.closingId).map((u) => ({ closingId: u.closingId, draftCreatedAt: new Date(Te(u._id)) }))
779
+ d.filter((u) => !!u.closingId).map((u) => ({ closingId: u.closingId, draftCreatedAt: new Date(Ie(u._id)) }))
780
780
  );
781
781
  return d.map((u) => ({
782
782
  ...u,
@@ -823,7 +823,7 @@ const Ot = Pt(
823
823
  cell(d) {
824
824
  return pn(`${d.getValue()}`);
825
825
  },
826
- sortingFn: (d, p) => new Date(Te(d.original._id)).getTime() - new Date(Te(p.original._id)).getTime(),
826
+ sortingFn: (d, p) => new Date(Ie(d.original._id)).getTime() - new Date(Ie(p.original._id)).getTime(),
827
827
  enableSorting: !0
828
828
  },
829
829
  {
@@ -842,7 +842,7 @@ const Ot = Pt(
842
842
  cell(d) {
843
843
  const p = d.row.original;
844
844
  let u = d.getValue();
845
- return u || (u = Te(p._id)), Ce(u);
845
+ return u || (u = Ie(p._id)), Ce(u);
846
846
  },
847
847
  enableSorting: !0,
848
848
  size: 230
@@ -920,7 +920,7 @@ const Ot = Pt(
920
920
  {
921
921
  class: ["fm-status-badge", Je(u)]
922
922
  },
923
- Ie(u)
923
+ Te(u)
924
924
  )
925
925
  );
926
926
  }
@@ -998,7 +998,7 @@ const Ot = Pt(
998
998
  drafts: h,
999
999
  loading: c,
1000
1000
  fetchDrafts: C,
1001
- loadDraft: I,
1001
+ loadDraft: T,
1002
1002
  updateDraftRef: P
1003
1003
  };
1004
1004
  }
@@ -1024,7 +1024,7 @@ const Ot = Pt(
1024
1024
  },
1025
1025
  emits: ["update:show", "refresh", "approve"],
1026
1026
  setup(a, { emit: t }) {
1027
- const { FmStepper: e, FmStep: o, FmDialog: h, FmButton: c } = _e, { t: r } = bn(), f = dt(), C = a, I = t, i = U(
1027
+ const { FmStepper: e, FmStep: o, FmDialog: h, FmButton: c } = _e, { t: r } = bn(), f = dt(), C = a, T = t, i = U(
1028
1028
  () => {
1029
1029
  var E, B;
1030
1030
  return ((E = C.draft) == null ? void 0 : E.stockSnapshot) && ((B = C.draft) == null ? void 0 : B.stockSnapshot) !== void 0;
@@ -1061,7 +1061,7 @@ const Ot = Pt(
1061
1061
  return i.value ? ((E = M.value) == null ? void 0 : E.filter((B) => !P.value[B.id]).map((B) => B.id)) ?? [] : [];
1062
1062
  }), j = U({
1063
1063
  get: () => C.show,
1064
- set: (E) => I("update:show", E)
1064
+ set: (E) => T("update:show", E)
1065
1065
  }), x = K(1), d = () => x.value > 1, p = () => x.value > 2, u = () => !1;
1066
1066
  function g(E) {
1067
1067
  return E === 1 ? i.value : E === 2 ? N.value.length == 0 : !1;
@@ -1097,7 +1097,7 @@ const Ot = Pt(
1097
1097
  }
1098
1098
  );
1099
1099
  function te() {
1100
- I("refresh");
1100
+ T("refresh");
1101
1101
  }
1102
1102
  function oe() {
1103
1103
  x.value < 3 && (x.value = D(x.value));
@@ -1106,7 +1106,7 @@ const Ot = Pt(
1106
1106
  x.value > 1 && (x.value = S(x.value));
1107
1107
  }
1108
1108
  function de() {
1109
- I("approve");
1109
+ T("approve");
1110
1110
  }
1111
1111
  return (E, B) => {
1112
1112
  const re = W("FmIcon");
@@ -1263,10 +1263,10 @@ const Ot = Pt(
1263
1263
  }, Sa = { class: "flex gap-12 content-stretch" }, $a = {
1264
1264
  class: "flex flex-col w-24",
1265
1265
  name: "circles"
1266
- }, Fa = { class: "flex-1 flex flex-col items-center" }, Ba = { class: "flex-1 flex flex-col items-center" }, Ia = {
1266
+ }, Fa = { class: "flex-1 flex flex-col items-center" }, Ba = { class: "flex-1 flex flex-col items-center" }, Ta = {
1267
1267
  class: "py-12 flex flex-col gap-4",
1268
1268
  name: "received-at header"
1269
- }, Ta = { class: "fm-typo-en-body-lg-400" }, ja = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Pa = { class: "flex gap-12 content-stretch" }, Va = {
1269
+ }, Ia = { class: "fm-typo-en-body-lg-400" }, ja = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Pa = { class: "flex gap-12 content-stretch" }, Va = {
1270
1270
  class: "flex flex-col w-24",
1271
1271
  name: "circles"
1272
1272
  }, Ma = { class: "flex-1 flex flex-col items-center" }, Ua = {
@@ -1286,7 +1286,7 @@ const Ot = Pt(
1286
1286
  }), h = Ot(), c = U(() => {
1287
1287
  var v, s;
1288
1288
  return (v = e.draft) != null && v.closingId ? ((s = h.drafts.find((_) => _._id === e.draft._id)) == null ? void 0 : s.closingIdDisplay) ?? null : null;
1289
- }), r = et(), f = Tt(e, "show"), C = K(!1), I = K(!1), i = K(!1), P = K(new Array()), M = K(new Array()), N = K([]), j = at(), x = He(), d = nt(), p = dt(), u = Oe(), g = Ct({}), b = U(() => new Set(
1289
+ }), r = et(), f = It(e, "show"), C = K(!1), T = K(!1), i = K(!1), P = K(new Array()), M = K(new Array()), N = K([]), j = at(), x = He(), d = nt(), p = dt(), u = Oe(), g = Ct({}), b = U(() => new Set(
1290
1290
  p.skus.filter((v) => {
1291
1291
  var s;
1292
1292
  return g[(s = v.customAttributes) == null ? void 0 : s.tag];
@@ -1353,8 +1353,8 @@ const Ot = Pt(
1353
1353
  if ((y = e.draft) != null && y.adjustmentSnapshot)
1354
1354
  for (const G of e.draft.adjustmentSnapshot)
1355
1355
  G.adjustmentsByType && Object.keys(G.adjustmentsByType).forEach((Q) => A.add(Q));
1356
- const T = ["receive", "sales", "wastage"], z = [];
1357
- T.forEach((G) => {
1356
+ const I = ["receive", "sales", "wastage"], z = [];
1357
+ I.forEach((G) => {
1358
1358
  A.has(G) && (z.push(G), A.delete(G));
1359
1359
  });
1360
1360
  const L = Array.from(A).sort();
@@ -1371,7 +1371,7 @@ const Ot = Pt(
1371
1371
  }
1372
1372
  async function re() {
1373
1373
  var s, _;
1374
- if (!(((s = e.draft) == null ? void 0 : s.effectiveAt) ?? (e.draft ? Te((_ = e.draft) == null ? void 0 : _._id) : null))) {
1374
+ if (!(((s = e.draft) == null ? void 0 : s.effectiveAt) ?? (e.draft ? Ie((_ = e.draft) == null ? void 0 : _._id) : null))) {
1375
1375
  d.open({
1376
1376
  title: "Cannot refresh",
1377
1377
  message: "Effective date is not available for this draft.",
@@ -1385,12 +1385,12 @@ const Ot = Pt(
1385
1385
  },
1386
1386
  async (m) => {
1387
1387
  var z;
1388
- I.value = !0;
1389
- const y = (z = e.draft) == null ? void 0 : z._rev, A = 30, T = 2e3;
1388
+ T.value = !0;
1389
+ const y = (z = e.draft) == null ? void 0 : z._rev, A = 30, I = 2e3;
1390
1390
  try {
1391
1391
  await j.recalculation.scheduleCalculateStockSnapshotAtDate(m, e.draft._id);
1392
1392
  let L = null;
1393
- for (let G = 0; G < A && (L = await x.getDraft(e.draft._id).delayed(T), L._rev === y); G++)
1393
+ for (let G = 0; G < A && (L = await x.getDraft(e.draft._id).delayed(I), L._rev === y); G++)
1394
1394
  ;
1395
1395
  if (!L || L._rev === y) {
1396
1396
  d.open({
@@ -1412,14 +1412,14 @@ const Ot = Pt(
1412
1412
  type: "error"
1413
1413
  }), console.error("error refreshing stock balances", L);
1414
1414
  } finally {
1415
- I.value = !1;
1415
+ T.value = !1;
1416
1416
  }
1417
1417
  }
1418
1418
  );
1419
1419
  }
1420
1420
  async function w() {
1421
1421
  var s, _;
1422
- if (!(((s = e.draft) == null ? void 0 : s.effectiveAt) ?? (e.draft ? Te((_ = e.draft) == null ? void 0 : _._id) : null))) {
1422
+ if (!(((s = e.draft) == null ? void 0 : s.effectiveAt) ?? (e.draft ? Ie((_ = e.draft) == null ? void 0 : _._id) : null))) {
1423
1423
  d.open({
1424
1424
  title: "Cannot refresh",
1425
1425
  message: "Effective date is not available for this draft.",
@@ -1467,7 +1467,7 @@ const Ot = Pt(
1467
1467
  header: () => "Name",
1468
1468
  size: 350,
1469
1469
  cell(_) {
1470
- const m = _.row.original, y = m.adjustedDiffPercentage, A = typeof y == "number" && Math.abs(y) > 10, T = $("div", { class: "flex flex-col gap-4" }, [
1470
+ const m = _.row.original, y = m.adjustedDiffPercentage, A = typeof y == "number" && Math.abs(y) > 10, I = $("div", { class: "flex flex-col gap-4" }, [
1471
1471
  $(
1472
1472
  "div",
1473
1473
  {
@@ -1500,7 +1500,7 @@ const Ot = Pt(
1500
1500
  },
1501
1501
  default() {
1502
1502
  return $("div", { class: "flex items-center gap-4 justify-start w-full" }, [
1503
- T
1503
+ I
1504
1504
  ]);
1505
1505
  }
1506
1506
  }
@@ -1512,7 +1512,7 @@ const Ot = Pt(
1512
1512
  (_) => ({
1513
1513
  id: `customAttr_${_}`,
1514
1514
  accessorFn: (m) => m.customAttributeValues[_],
1515
- header: () => le(Ie(_)),
1515
+ header: () => le(Te(_)),
1516
1516
  size: 160,
1517
1517
  cell(m) {
1518
1518
  const y = m.row.original.customAttributeValues[_];
@@ -1542,7 +1542,7 @@ const Ot = Pt(
1542
1542
  size: 120,
1543
1543
  cell(_) {
1544
1544
  var z;
1545
- const m = _.row.original, y = m.costUnit, A = m.baseUnit, T = y ?? A;
1545
+ const m = _.row.original, y = m.costUnit, A = m.baseUnit, I = y ?? A;
1546
1546
  if (y && y !== A) {
1547
1547
  const L = te.value.find((Q) => Q._id === m.id), G = (z = L == null ? void 0 : L.defaultCost) == null ? void 0 : z.measurement;
1548
1548
  if (G) {
@@ -1551,7 +1551,7 @@ const Ot = Pt(
1551
1551
  $(
1552
1552
  "span",
1553
1553
  { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" },
1554
- T
1554
+ I
1555
1555
  ),
1556
1556
  $("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, [
1557
1557
  "1 ",
@@ -1562,7 +1562,7 @@ const Ot = Pt(
1562
1562
  ]);
1563
1563
  }
1564
1564
  }
1565
- return T;
1565
+ return I;
1566
1566
  }
1567
1567
  },
1568
1568
  {
@@ -1583,7 +1583,7 @@ const Ot = Pt(
1583
1583
  (_) => ({
1584
1584
  id: `adjustment_${_}`,
1585
1585
  accessorFn: (m) => m.adjustmentAmounts[_] ?? { amount: 0, precision: 0 },
1586
- header: () => le(Ie(_)),
1586
+ header: () => le(Te(_)),
1587
1587
  size: 150,
1588
1588
  cell(m) {
1589
1589
  const y = m.row.original.adjustmentAmounts[_] ?? { amount: 0, precision: 0 };
@@ -1619,9 +1619,9 @@ const Ot = Pt(
1619
1619
  var L;
1620
1620
  const m = _.row.original, y = ee.fromNumber(m.physicalBalance);
1621
1621
  let A = !0;
1622
- const T = (L = M.value.find((G) => G.id === m.id)) == null ? void 0 : L.balance;
1622
+ const I = (L = M.value.find((G) => G.id === m.id)) == null ? void 0 : L.balance;
1623
1623
  let z;
1624
- return T && !ee.equals({ a: y, b: T }) ? (A = !1, z = ne(T)) : z = ne(m.physicalBalance), $("div", { class: "flex flex-col" }, [
1624
+ return I && !ee.equals({ a: y, b: I }) ? (A = !1, z = ne(I)) : z = ne(m.physicalBalance), $("div", { class: "flex flex-col" }, [
1625
1625
  $(
1626
1626
  "span",
1627
1627
  { class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-primary" },
@@ -1707,9 +1707,9 @@ const Ot = Pt(
1707
1707
  size: 180,
1708
1708
  cell(_) {
1709
1709
  var G;
1710
- const m = _.row.original, y = m.stockTakeValue, A = te.value.find((Q) => Q._id === m.id), T = (G = A == null ? void 0 : A.defaultCost) == null ? void 0 : G.measurement, z = m.physicalBalance, L = m.costPerUnit;
1711
- if (T) {
1712
- const Q = ee.toFormatString({ value: T.conversion }), ve = `${ne(z, { minPrecision: 2, maxPrecision: 4 })} ${m.baseUnit} ÷ ${Q} × ${L} ${o.value}`;
1710
+ const m = _.row.original, y = m.stockTakeValue, A = te.value.find((Q) => Q._id === m.id), I = (G = A == null ? void 0 : A.defaultCost) == null ? void 0 : G.measurement, z = m.physicalBalance, L = m.costPerUnit;
1711
+ if (I) {
1712
+ const Q = ee.toFormatString({ value: I.conversion }), ve = `${ne(z, { minPrecision: 2, maxPrecision: 4 })} ${m.baseUnit} ÷ ${Q} × ${L} ${o.value}`;
1713
1713
  return $(
1714
1714
  _e.FmTooltip,
1715
1715
  { zIndex: 51 },
@@ -1757,9 +1757,9 @@ const Ot = Pt(
1757
1757
  size: 180,
1758
1758
  cell(_) {
1759
1759
  var G;
1760
- const m = _.row.original, y = m.systemValue, A = te.value.find((Q) => Q._id === m.id), T = (G = A == null ? void 0 : A.defaultCost) == null ? void 0 : G.measurement, z = m.systemBalance, L = m.costPerUnit;
1761
- if (T) {
1762
- const Q = ee.toFormatString({ value: T.conversion }), ve = `${ne(z, { minPrecision: 2, maxPrecision: 4 })} ${m.baseUnit} ÷ ${Q} × ${L} ${o.value}`;
1760
+ const m = _.row.original, y = m.systemValue, A = te.value.find((Q) => Q._id === m.id), I = (G = A == null ? void 0 : A.defaultCost) == null ? void 0 : G.measurement, z = m.systemBalance, L = m.costPerUnit;
1761
+ if (I) {
1762
+ const Q = ee.toFormatString({ value: I.conversion }), ve = `${ne(z, { minPrecision: 2, maxPrecision: 4 })} ${m.baseUnit} ÷ ${Q} × ${L} ${o.value}`;
1763
1763
  return $(
1764
1764
  _e.FmTooltip,
1765
1765
  { zIndex: 51 },
@@ -1805,7 +1805,7 @@ const Ot = Pt(
1805
1805
  header: () => "Amounts",
1806
1806
  enableSorting: !1,
1807
1807
  cell(_) {
1808
- const m = _.row.original, y = (T, z) => $(
1808
+ const m = _.row.original, y = (I, z) => $(
1809
1809
  _e.FmTooltip,
1810
1810
  { zIndex: 50 },
1811
1811
  {
@@ -1816,7 +1816,7 @@ const Ot = Pt(
1816
1816
  class: "fm-typo-en-body-lg-400 py-4 px-8 border-1 border-fm-color-typo-secondary fm-corner-radius-md line-clamp-1"
1817
1817
  },
1818
1818
  [
1819
- $("span", { class: "text-fm-color-typo-primary" }, `${T} `),
1819
+ $("span", { class: "text-fm-color-typo-primary" }, `${I} `),
1820
1820
  $(
1821
1821
  "span",
1822
1822
  {
@@ -1829,16 +1829,16 @@ const Ot = Pt(
1829
1829
  );
1830
1830
  },
1831
1831
  content() {
1832
- return `${T} ${z}`;
1832
+ return `${I} ${z}`;
1833
1833
  }
1834
1834
  }
1835
1835
  );
1836
- let A = Array.from({ length: v }).map((T, z) => {
1836
+ let A = Array.from({ length: v }).map((I, z) => {
1837
1837
  if (!m[`measurementAmount${z}`])
1838
1838
  return null;
1839
1839
  const L = m[`measurementAmount${z}`], G = m[`measurementAbbrev${z}`];
1840
1840
  return y(L, G);
1841
- }).filter((T) => T);
1841
+ }).filter((I) => I);
1842
1842
  return (m.baseUnitAmount || !A.length) && (A = [y(m.baseUnitAmount, m.baseUnit), ...A]), $(
1843
1843
  "div",
1844
1844
  {
@@ -1860,7 +1860,7 @@ const Ot = Pt(
1860
1860
  )) ?? {};
1861
1861
  return te.value.map((y) => {
1862
1862
  var vt, yt, gt, bt, ht, _t, kt, wt, xt, Dt, At;
1863
- const A = (vt = X.value.get(y._id)) == null ? void 0 : vt[0], T = ((yt = J.value.get(y._id)) == null ? void 0 : yt[0]) ?? de, z = ((gt = y.defaultCost) == null ? void 0 : gt.costPerUnit) ?? de, L = Number(ee.toFormatString({ value: z })), G = ((ht = (bt = y.defaultCost) == null ? void 0 : bt.measurement) == null ? void 0 : ht.conversion) ?? {
1863
+ const A = (vt = X.value.get(y._id)) == null ? void 0 : vt[0], I = ((yt = J.value.get(y._id)) == null ? void 0 : yt[0]) ?? de, z = ((gt = y.defaultCost) == null ? void 0 : gt.costPerUnit) ?? de, L = Number(ee.toFormatString({ value: z })), G = ((ht = (bt = y.defaultCost) == null ? void 0 : bt.measurement) == null ? void 0 : ht.conversion) ?? {
1864
1864
  amount: 1,
1865
1865
  precision: 0
1866
1866
  }, Q = Number(
@@ -1870,7 +1870,7 @@ const Ot = Pt(
1870
1870
  const be = R[ue] ?? { amount: 0, precision: 0 }, he = Be == null ? void 0 : Be[ue];
1871
1871
  he && (R[ue] = Nt(be, he));
1872
1872
  }), !A) {
1873
- const ue = Number(ee.toFormatString({ value: T })), be = 0 - ue, he = be * L / Q, Ge = 0, Gt = ue * L / Q;
1873
+ const ue = Number(ee.toFormatString({ value: I })), be = 0 - ue, he = be * L / Q, Ge = 0, Gt = ue * L / Q;
1874
1874
  return {
1875
1875
  id: y._id,
1876
1876
  code: y.code,
@@ -1897,11 +1897,11 @@ const Ot = Pt(
1897
1897
  (ue) => ue.id === y._id
1898
1898
  )) == null ? void 0 : xt.balance, we = Ut(
1899
1899
  pe ?? ce,
1900
- T
1901
- ), Ue = T.amount === 0 ? null : Rt(we, {
1902
- ...T,
1903
- amount: Math.abs(T.amount)
1904
- }), qe = Ue ? mt(Ue, E) : null, st = Number(ee.toFormatString({ value: T })), rt = Number(ee.toFormatString({ value: ce })), pt = rt - st, Wt = pt * L / Q, Kt = rt * L / Q, qt = st * L / Q;
1900
+ I
1901
+ ), Ue = I.amount === 0 ? null : Rt(we, {
1902
+ ...I,
1903
+ amount: Math.abs(I.amount)
1904
+ }), qe = Ue ? mt(Ue, E) : null, st = Number(ee.toFormatString({ value: I })), rt = Number(ee.toFormatString({ value: ce })), pt = rt - st, Wt = pt * L / Q, Kt = rt * L / Q, qt = st * L / Q;
1905
1905
  return {
1906
1906
  id: y._id,
1907
1907
  code: y.code,
@@ -1949,11 +1949,11 @@ const Ot = Pt(
1949
1949
  // actionAt: props.draft.approvedAt,
1950
1950
  actionBy: e.draft.approvedBy,
1951
1951
  remark: e.draft.approveRemark
1952
- } : (s = e.draft.rejectionHistory) == null ? void 0 : s.computeFirst((T) => ({
1953
- action: `Reject at ${Ce(T.rejectedAt)}`,
1952
+ } : (s = e.draft.rejectionHistory) == null ? void 0 : s.computeFirst((I) => ({
1953
+ action: `Reject at ${Ce(I.rejectedAt)}`,
1954
1954
  // actionAt: e.rejectedAt,
1955
- actionBy: T.rejectedBy,
1956
- remark: T.rejectRemark
1955
+ actionBy: I.rejectedBy,
1956
+ remark: I.rejectRemark
1957
1957
  }));
1958
1958
  return [
1959
1959
  c.value ? {
@@ -1982,11 +1982,11 @@ const Ot = Pt(
1982
1982
  },
1983
1983
  {
1984
1984
  label: "Effective at",
1985
- value: Ce(e.draft.effectiveAt ?? Te((m = e.draft) == null ? void 0 : m._id))
1985
+ value: Ce(e.draft.effectiveAt ?? Ie((m = e.draft) == null ? void 0 : m._id))
1986
1986
  },
1987
1987
  {
1988
1988
  label: "Using template",
1989
- value: ((y = e.draft.usingTemplates.find((T) => T)) == null ? void 0 : y.name) ?? "None"
1989
+ value: ((y = e.draft.usingTemplates.find((I) => I)) == null ? void 0 : y.name) ?? "None"
1990
1990
  },
1991
1991
  e.draft.remark ? {
1992
1992
  label: "Remark",
@@ -2004,7 +2004,7 @@ const Ot = Pt(
2004
2004
  label: "Action remark",
2005
2005
  value: v.remark
2006
2006
  } : null
2007
- ].filter((T) => T).map((T) => T);
2007
+ ].filter((I) => I).map((I) => I);
2008
2008
  }), ot = [
2009
2009
  {
2010
2010
  label: "Overview",
@@ -2017,14 +2017,14 @@ const Ot = Pt(
2017
2017
  ], Ee = K(ot[0]), Me = U(() => {
2018
2018
  var m, y, A;
2019
2019
  const v = ((m = e.draft) == null ? void 0 : m.activityLogs) ?? [], s = ((y = e.draft) == null ? void 0 : y.rejectionHistory) ?? [];
2020
- for (const T of s)
2020
+ for (const I of s)
2021
2021
  v.find(
2022
- (L) => `${L.action}_${L.performedAt}` == `${se.enum.rejectDraft}_${T.rejectedAt}`
2022
+ (L) => `${L.action}_${L.performedAt}` == `${se.enum.rejectDraft}_${I.rejectedAt}`
2023
2023
  ) || v.push({
2024
2024
  action: se.enum.rejectDraft,
2025
- performedAt: T.rejectedAt,
2026
- performedBy: T.rejectedBy,
2027
- remark: T.rejectRemark
2025
+ performedAt: I.rejectedAt,
2026
+ performedBy: I.rejectedBy,
2027
+ remark: I.rejectRemark
2028
2028
  });
2029
2029
  return (A = e.draft) != null && A.approvedAt && (v.find(
2030
2030
  (z) => {
@@ -2036,18 +2036,18 @@ const Ot = Pt(
2036
2036
  performedAt: e.draft.approvedAt,
2037
2037
  performedBy: e.draft.approvedBy ?? { name: "Unknown", id: "unknown" },
2038
2038
  remark: e.draft.approveRemark
2039
- })), v.sort((T, z) => new Date(z.performedAt).getTime() - new Date(T.performedAt).getTime()).map(
2040
- (T) => ({
2041
- header: Ie(T.action),
2042
- date: Ce(T.performedAt),
2039
+ })), v.sort((I, z) => new Date(z.performedAt).getTime() - new Date(I.performedAt).getTime()).map(
2040
+ (I) => ({
2041
+ header: Te(I.action),
2042
+ date: Ce(I.performedAt),
2043
2043
  info: [
2044
2044
  {
2045
2045
  label: "Performed by",
2046
- values: [T.performedBy.name]
2046
+ values: [I.performedBy.name]
2047
2047
  },
2048
2048
  {
2049
2049
  label: "Remark",
2050
- values: [T.remark ?? ""]
2050
+ values: [I.remark ?? ""]
2051
2051
  }
2052
2052
  ]
2053
2053
  })
@@ -2068,7 +2068,7 @@ const Ot = Pt(
2068
2068
  ));
2069
2069
  }
2070
2070
  return (v, s) => {
2071
- const _ = W("FmButtonGroup"), m = W("FmMenuDivider"), y = W("FmCard"), A = W("FmButton"), T = W("FmCircularProgress"), z = W("FmChip"), L = W("FmTextField"), G = W("FmIcon"), Q = W("FmTable"), ve = W("FmSpacer"), ge = W("FmTooltip"), Be = W("FmSideSheet");
2071
+ const _ = W("FmButtonGroup"), m = W("FmMenuDivider"), y = W("FmCard"), A = W("FmButton"), I = W("FmCircularProgress"), z = W("FmChip"), L = W("FmTextField"), G = W("FmIcon"), Q = W("FmTable"), ve = W("FmSpacer"), ge = W("FmTooltip"), Be = W("FmSideSheet");
2072
2072
  return k(), V(ie, null, [
2073
2073
  F(Be, {
2074
2074
  "dismiss-away": "",
@@ -2160,7 +2160,7 @@ const Ot = Pt(
2160
2160
  n("div", ia, [
2161
2161
  n("div", {
2162
2162
  class: Se(["fm-status-badge", l(Je)(((R = v.draft) == null ? void 0 : R.status) ?? "DRAFT")])
2163
- }, O(l(Ie)(((ce = v.draft) == null ? void 0 : ce.status) ?? "")), 3)
2163
+ }, O(l(Te)(((ce = v.draft) == null ? void 0 : ce.status) ?? "")), 3)
2164
2164
  ])
2165
2165
  ]),
2166
2166
  F(m),
@@ -2191,7 +2191,7 @@ const Ot = Pt(
2191
2191
  "text-color": "primary",
2192
2192
  "bg-color": "transparent",
2193
2193
  "border-color": "primary",
2194
- loading: I.value,
2194
+ loading: T.value,
2195
2195
  onClick: re
2196
2196
  }, null, 8, ["loading"])) : H("", !0),
2197
2197
  F($t, null, {
@@ -2203,7 +2203,7 @@ const Ot = Pt(
2203
2203
  "text-color": "primary",
2204
2204
  "bg-color": "transparent",
2205
2205
  "border-color": "primary",
2206
- loading: I.value,
2206
+ loading: T.value,
2207
2207
  onClick: w
2208
2208
  }, null, 8, ["loading"])
2209
2209
  ]),
@@ -2229,7 +2229,7 @@ const Ot = Pt(
2229
2229
  s[14] || (s[14] = n("div", { class: "h-80" }, null, -1)),
2230
2230
  n("div", ga, [
2231
2231
  n("div", null, [
2232
- F(T, { size: "md" })
2232
+ F(I, { size: "md" })
2233
2233
  ]),
2234
2234
  s[13] || (s[13] = n("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fetching info... ", -1))
2235
2235
  ]),
@@ -2335,8 +2335,8 @@ const Ot = Pt(
2335
2335
  }, null, 2)
2336
2336
  ])
2337
2337
  ]),
2338
- n("div", Ia, [
2339
- n("div", Ta, O(R.header), 1),
2338
+ n("div", Ta, [
2339
+ n("div", Ia, O(R.header), 1),
2340
2340
  n("div", ja, O(R.date), 1)
2341
2341
  ])
2342
2342
  ]),
@@ -2402,7 +2402,7 @@ const Ot = Pt(
2402
2402
  key: 0,
2403
2403
  show: We.value,
2404
2404
  "onUpdate:show": s[10] || (s[10] = (R) => We.value = R),
2405
- refreshing: I.value,
2405
+ refreshing: T.value,
2406
2406
  approving: Ke.value,
2407
2407
  draft: e.draft,
2408
2408
  onRefresh: re,
@@ -2419,7 +2419,7 @@ async function Wa(a) {
2419
2419
  o.onload = (h) => {
2420
2420
  var c;
2421
2421
  try {
2422
- const r = (c = h.target) == null ? void 0 : c.result, f = _n(r, { type: "array" }), C = f.SheetNames[0], I = f.Sheets[C], i = Ze.sheet_to_json(I, {
2422
+ const r = (c = h.target) == null ? void 0 : c.result, f = _n(r, { type: "array" }), C = f.SheetNames[0], T = f.Sheets[C], i = Ze.sheet_to_json(T, {
2423
2423
  header: 1,
2424
2424
  defval: ""
2425
2425
  }), P = (u) => String(u).trim().toLowerCase().replace(/^\uFEFF/, ""), M = i.findIndex(
@@ -2546,12 +2546,12 @@ function Qa() {
2546
2546
  };
2547
2547
  return await i.createQuickModeDraftWithItems(d);
2548
2548
  }
2549
- function I() {
2549
+ function T() {
2550
2550
  var P;
2551
2551
  const i = ((P = h.currentLocation) == null ? void 0 : P.name) ?? "template";
2552
2552
  Ga(o.skus, i);
2553
2553
  }
2554
- return { mergedItems: a, unrecognisedItemCodes: t, hasBlockingErrors: r, isLoading: e, onFileUpload: f, submit: C, downloadTemplate: I };
2554
+ return { mergedItems: a, unrecognisedItemCodes: t, hasBlockingErrors: r, isLoading: e, onFileUpload: f, submit: C, downloadTemplate: T };
2555
2555
  }
2556
2556
  const Za = { class: "flex flex-col gap-16" }, Ja = {
2557
2557
  key: 0,
@@ -2613,8 +2613,8 @@ const Za = { class: "flex flex-col gap-16" }, Ja = {
2613
2613
  id: "variance",
2614
2614
  header: () => e("inventory.closing.draft.createDraft.previewTable.variance"),
2615
2615
  cell: (f) => {
2616
- const I = f.row.original.variance, i = I < 0 ? "text-fm-color-danger-default" : I > 0 ? "text-fm-color-success-default" : "";
2617
- return $("span", { class: i }, ne(I));
2616
+ const T = f.row.original.variance, i = T < 0 ? "text-fm-color-danger-default" : T > 0 ? "text-fm-color-success-default" : "";
2617
+ return $("span", { class: i }, ne(T));
2618
2618
  }
2619
2619
  },
2620
2620
  {
@@ -2622,9 +2622,9 @@ const Za = { class: "flex flex-col gap-16" }, Ja = {
2622
2622
  header: () => e("inventory.closing.draft.createDraft.previewTable.variancePercentage"),
2623
2623
  size: 130,
2624
2624
  cell: (f) => {
2625
- const C = f.row.original, I = C.systemBalance.amount / Math.pow(10, C.systemBalance.precision), i = I === 0 ? null : Math.max(
2625
+ const C = f.row.original, T = C.systemBalance.amount / Math.pow(10, C.systemBalance.precision), i = T === 0 ? null : Math.max(
2626
2626
  -100,
2627
- Math.min(100, Math.round(C.variance / Math.abs(I) * 1e4) / 100)
2627
+ Math.min(100, Math.round(C.variance / Math.abs(T) * 1e4) / 100)
2628
2628
  );
2629
2629
  if (i === null)
2630
2630
  return $(
@@ -2654,19 +2654,19 @@ const Za = { class: "flex flex-col gap-16" }, Ja = {
2654
2654
  id: "status",
2655
2655
  header: () => e("inventory.common.status"),
2656
2656
  cell: (f) => {
2657
- const C = f.row.original.status, I = c.value[C];
2658
- return I ? $(
2657
+ const C = f.row.original.status, T = c.value[C];
2658
+ return T ? $(
2659
2659
  "span",
2660
2660
  {
2661
- class: `px-8 py-2 rounded-4 ${I.bgColor} ${I.textColor} fm-typo-en-label-sm-400`
2661
+ class: `px-8 py-2 rounded-4 ${T.bgColor} ${T.textColor} fm-typo-en-label-sm-400`
2662
2662
  },
2663
- `${I.icon} ${I.label}`
2663
+ `${T.icon} ${T.label}`
2664
2664
  ) : null;
2665
2665
  }
2666
2666
  }
2667
2667
  ];
2668
2668
  return (f, C) => {
2669
- const I = W("FmTable");
2669
+ const T = W("FmTable");
2670
2670
  return k(), V("div", Za, [
2671
2671
  o.value.length > 0 ? (k(), V("div", Ja, [
2672
2672
  me(O(l(e)("inventory.closing.draft.createDraft.previewTable.cannotSubmitNegative")) + " ", 1),
@@ -2690,7 +2690,7 @@ const Za = { class: "flex flex-col gap-16" }, Ja = {
2690
2690
  }, O(i), 1))), 128))
2691
2691
  ])
2692
2692
  ])) : H("", !0),
2693
- F(I, {
2693
+ F(T, {
2694
2694
  "row-data": t.items,
2695
2695
  "column-defs": r,
2696
2696
  pagination: { pageSize: 20 }
@@ -2711,7 +2711,7 @@ const Za = { class: "flex flex-col gap-16" }, Ja = {
2711
2711
  },
2712
2712
  emits: ["update:show", "submitted"],
2713
2713
  setup(a, { emit: t }) {
2714
- const e = a, o = t, h = Tt(e, "show"), { t: c } = tt(), r = nt(), f = K("upload"), C = K(null), I = K(!1), { mergedItems: i, unrecognisedItemCodes: P, hasBlockingErrors: M, isLoading: N, onFileUpload: j, submit: x, downloadTemplate: d } = Qa(), p = U(
2714
+ const e = a, o = t, h = It(e, "show"), { t: c } = tt(), r = nt(), f = K("upload"), C = K(null), T = K(!1), { mergedItems: i, unrecognisedItemCodes: P, hasBlockingErrors: M, isLoading: N, onFileUpload: j, submit: x, downloadTemplate: d } = Qa(), p = U(
2715
2715
  () => C.value && !N.value && i.value.length > 0
2716
2716
  ), u = U(() => {
2717
2717
  const S = i.value.filter(
@@ -2742,7 +2742,7 @@ const Za = { class: "flex flex-col gap-16" }, Ja = {
2742
2742
  C.value = S, await j(S);
2743
2743
  }
2744
2744
  async function b() {
2745
- I.value = !0;
2745
+ T.value = !0;
2746
2746
  try {
2747
2747
  await x(), D(), o("submitted"), r.open({
2748
2748
  title: "Success",
@@ -2756,7 +2756,7 @@ const Za = { class: "flex flex-col gap-16" }, Ja = {
2756
2756
  type: "error"
2757
2757
  });
2758
2758
  } finally {
2759
- I.value = !1;
2759
+ T.value = !1;
2760
2760
  }
2761
2761
  }
2762
2762
  Le(h, (S) => {
@@ -2894,8 +2894,8 @@ const Za = { class: "flex flex-col gap-16" }, Ja = {
2894
2894
  f.value === "preview" ? (k(), ae(Dn, {
2895
2895
  key: 2,
2896
2896
  label: l(c)("inventory.closing.draft.createDraft.submit"),
2897
- disabled: l(M) || l(i).length === 0 || I.value,
2898
- loading: I.value,
2897
+ disabled: l(M) || l(i).length === 0 || T.value,
2898
+ loading: T.value,
2899
2899
  "confirm-title": l(c)("inventory.closing.draft.createDraft.confirmTitle"),
2900
2900
  "confirm-message": l(c)("inventory.closing.draft.createDraft.confirmMessage"),
2901
2901
  onConfirm: b
@@ -2924,7 +2924,7 @@ const Za = { class: "flex flex-col gap-16" }, Ja = {
2924
2924
  setup(a) {
2925
2925
  const { t } = tt(), { viewDraft: e } = et(), { viewClosingDraftProps: o, viewClosingDraftShow: h } = rn(et()), c = Oe(), r = Ot(), f = Xt(), { breakpoints: C } = nn();
2926
2926
  c.watchLocation(r.fetchDrafts);
2927
- const I = U(() => r.loading), i = K(""), P = K(!1), M = U(() => C.value.xs || C.value.sm), N = U(() => M.value ? 10 : 20), j = U(() => {
2927
+ const T = U(() => r.loading), i = K(""), P = K(!1), M = U(() => C.value.xs || C.value.sm), N = U(() => M.value ? 10 : 20), j = U(() => {
2928
2928
  var u;
2929
2929
  return ((u = c.currentLocation) == null ? void 0 : u.type) === sn.enum.warehouse;
2930
2930
  });
@@ -2984,7 +2984,7 @@ const Za = { class: "flex flex-col gap-16" }, Ja = {
2984
2984
  "column-defs": l(r).columnDefs,
2985
2985
  "row-data": l(r).drafts,
2986
2986
  "search-value": i.value,
2987
- loading: I.value,
2987
+ loading: T.value,
2988
2988
  onRowClick: g[1] || (g[1] = (D) => l(e)(D.original)),
2989
2989
  "page-size": N.value
2990
2990
  }, {