@feedmepos/mf-inventory-portal 1.2.30-dev.1 → 1.2.30

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 (84) hide show
  1. package/dist/{App-kX4bqoEe.js → App-CZJre5y8.js} +57 -55
  2. package/dist/{ApprovalView-DCNKqVE2.js → ApprovalView-CnxHxojY.js} +34 -28
  3. package/dist/{BindingsDialog-d7f1f8gf.js → BindingsDialog-C6lCOPNs.js} +2 -2
  4. package/dist/{BindingsPicker-2HJOx0QW.js → BindingsPicker-DZtFKLQ5.js} +6 -5
  5. package/dist/{BindingsTable-CPAjxOZG.js → BindingsTable-BmQGLuJ4.js} +28 -24
  6. package/dist/{ClosingDraftView-CUng41eo.js → ClosingDraftView-KLtlh31f.js} +183 -175
  7. package/dist/{ClosingHistoryView-CcGc2NwU.js → ClosingHistoryView-Rf1yMhMj.js} +43 -41
  8. package/dist/ClosingTemplateView-C_IiKnGx.js +2019 -0
  9. package/dist/{DeliveryOrderPrintPreview-BsM-CCc5.js → DeliveryOrderPrintPreview-UF7V005U.js} +15 -14
  10. package/dist/FmDroppableField-J0xUsOTV.js +154 -0
  11. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-cuggJ5Xd.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BcMvEdc0.js} +74 -72
  12. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CqAeF0wL.js +279 -0
  13. package/dist/{FmMultiselectDialog-BGbrqXUF.js → FmMultiselectDialog-B0aKuf2o.js} +1 -1
  14. package/dist/FmMultiselectDialog-BasrjBFA.js +597 -0
  15. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-isogcN1O.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CaYJJkXz.js} +51 -49
  16. package/dist/{ImportView-wAVrMEwL.js → ImportView-DRSoz0uM.js} +81 -74
  17. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVUF4I2Q.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DA8SlWPy.js} +5 -5
  18. package/dist/{IngredientGroupView-BZczeXdL.js → IngredientGroupView-D5Laak2-.js} +73 -65
  19. package/dist/{IngredientsView-D5N5Y1ZY.js → IngredientsView-TG3fPQhR.js} +358 -345
  20. package/dist/{IntegrationView-Hrslmuc1.js → IntegrationView-CElpjyo7.js} +219 -209
  21. package/dist/{InventoryBindingForm-DH6wgxOG.js → InventoryBindingForm-CBgxRYBd.js} +1 -1
  22. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Drr5vD6f.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Ys5GBHoQ.js} +41 -40
  23. package/dist/{InventoryBindingSummary-BU1ehpQZ.js → InventoryBindingSummary-OK3vNWhi.js} +1 -1
  24. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-1ueC4GfZ.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-9QRntUlk.js} +5 -5
  25. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-FHcU1zZt.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Bc01NoOn.js} +22 -21
  26. package/dist/{PublishView-CQtj0f31.js → PublishView-CLMfiLjP.js} +26 -23
  27. package/dist/{PurchaseOrderPrintPreview-BQyXtHST.js → PurchaseOrderPrintPreview-Dy77yWDC.js} +10 -9
  28. package/dist/{ReceiveRequestView-Dm-h_SrY.js → ReceiveRequestView-BhD-NaHE.js} +478 -462
  29. package/dist/{RecipeView-DNNRvr1w.js → RecipeView-RWaO94w_.js} +73 -64
  30. package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-DY7TaxPK.js +251 -0
  31. package/dist/{StockView-CaOm5BCx.js → StockView-D5t8OxaG.js} +292 -282
  32. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Z91XRszD.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-3Asf1TGd.js} +1 -1
  33. package/dist/{SupplierView-JSII9qwL.js → SupplierView-DiospFKq.js} +92 -80
  34. package/dist/SystemTrailDialog.vue_vue_type_script_setup_true_lang-DfCHteOF.js +177 -0
  35. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +135 -0
  36. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CNtvx-LA.js +123 -0
  37. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Mehd4lGs.js → TransferDetails.vue_vue_type_script_setup_true_lang-p959Op4k.js} +318 -305
  38. package/dist/{TransferTemplateView-DyCpNKJd.js → TransferTemplateView-ePZFdZ0p.js} +228 -216
  39. package/dist/{UnitView-CqN7mlJ2.js → UnitView-Banlxw7y.js} +70 -63
  40. package/dist/{WarehouseView-gFWD-m8e.js → WarehouseView-BL-p5hbi.js} +123 -114
  41. package/dist/WastageTemplateView-B1pmSuW0.js +2288 -0
  42. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  43. package/dist/app-EpEEb8EO.js +64040 -0
  44. package/dist/app-rgirz_52.js +8024 -0
  45. package/dist/app.d.ts +0 -21
  46. package/dist/app.js +6 -6
  47. package/dist/closing-template-zIjwO1_E.js +117 -0
  48. package/dist/date2-Dnc8Y81g.js +116 -0
  49. package/dist/dayjs.min-TdUgzmww.js +282 -0
  50. package/dist/{decimal-DfF_g5rc.js → decimal-C6s3GvGb.js} +4 -3
  51. package/dist/defineDeepModel-BSaaXVBF.js +19 -0
  52. package/dist/duplicate-template-Bw0H416G.js +34 -0
  53. package/dist/feature-C95Hao53.js +20162 -0
  54. package/dist/form-mode.enum-BKiNVH6A.js +4 -0
  55. package/dist/format-time-from-id-DlbHo6kY.js +15 -0
  56. package/dist/{format-unit-display-ivAljvlo.js → format-unit-display-QBS54q0R.js} +308 -297
  57. package/dist/{import-export.helper-B2MWv9v7.js → import-export.helper-CUKCKtP7.js} +56 -52
  58. package/dist/index-CFn_9RMm.js +45 -0
  59. package/dist/{index-DZaT0ZaL.js → index-S9Ak__QC.js} +1 -1
  60. package/dist/{index-BbhuWHyh.js → index-goD-WGVb.js} +16 -14
  61. package/dist/lodash-gq8IrP4j.js +3678 -0
  62. package/dist/netsuite-CnhAKyAO.js +4316 -0
  63. package/dist/{purchase-order-template-DdybMC_P.js → purchase-order-template-CBIpWdEW.js} +1 -1
  64. package/dist/router/shared.spec.d.ts +1 -0
  65. package/dist/row-action.enum-BcW_L_nE.js +67 -0
  66. package/dist/rules-DKklsaS1.js +201 -0
  67. package/dist/{stock-BYagIdsj.js → stock-3K93Mif9.js} +1 -1
  68. package/dist/{stock-V4ciPiBe.js → stock-BW8fen3H.js} +11 -10
  69. package/dist/style.css +1 -1
  70. package/dist/{supplier-CgtB1I9I.js → supplier-CObCSfot.js} +27 -26
  71. package/dist/tsconfig.app.tsbuildinfo +1 -1
  72. package/dist/{use-ingredient-select-dialog-BIQovyZX.js → use-ingredient-select-dialog-DwvQiaVW.js} +4 -3
  73. package/dist/{use-inventory-binding-dialog-DyjicXgc.js → use-inventory-binding-dialog-CuLEHLDM.js} +4 -3
  74. package/dist/use-template-enabled-locations-2-DkUJeppb.js +111 -0
  75. package/dist/views/adjustment-template/wastage-template/table.d.ts +1 -1
  76. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +0 -1
  77. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +1 -13
  78. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +0 -12
  79. package/dist/vue-i18n-CUznvVzc.js +2365 -0
  80. package/dist/xlsx-bT1p3YVR.js +24004 -0
  81. package/dist/xlsx.util-Cr9DpDFb.js +78 -0
  82. package/package.json +5 -5
  83. package/dist/ClosingTemplateView-D8IAdhDb.js +0 -2041
  84. package/dist/app-CnQ49Lyb.js +0 -131483
@@ -1,12 +1,20 @@
1
- import { defineComponent as Ee, ref as Y, computed as V, onMounted as We, resolveComponent as z, openBlock as w, createElementBlock as E, Fragment as le, createTextVNode as oe, createBlock as ie, withCtx as W, createElementVNode as i, toDisplayString as ae, unref as $, createVNode as _, createCommentVNode as ne, h as A, reactive as Bt, watch as Tt, isRef as ft, normalizeClass as Se, renderList as $e, normalizeStyle as pt, Teleport as jt, mergeProps as It } from "vue";
2
- import { aa as Ut, u as ze, ax as H, am as Le, ay as vt, r as Pt, Z as qe, n as Qe, t as Mt, a0 as Be, W as Rt, Y as Vt, X as Lt, az as gt, aA as yt, $ as R, ah as bt, aB as ht, aC as he, an as Nt, ac as Ge, ab as ke, a6 as Re, D as dt, j as Pe, i as Et, f as zt, a as Ot, a9 as Ht, h as Yt, G as Kt, I as Qt, J as Gt, K as Wt, L as Me } from "./app-CnQ49Lyb.js";
3
- import { useCoreStore as qt, useI18n as kt } from "@feedmepos/mf-common";
4
- import { useSnackbar as Ze, useDialog as Zt, useProxiedModel as Jt, components as be, useBreakpoints as Xt } from "@feedmepos/ui-library";
5
- import { defineStore as xt, storeToRefs as ea } from "pinia";
6
- import { u as Dt } from "./stock-V4ciPiBe.js";
7
- import { u as Je } from "./stock-BYagIdsj.js";
1
+ import { defineComponent as Ee, ref as Y, computed as V, onMounted as qe, resolveComponent as z, openBlock as w, createElementBlock as E, Fragment as le, createTextVNode as oe, createBlock as ie, withCtx as q, createElementVNode as i, toDisplayString as ae, unref as $, createVNode as _, createCommentVNode as ne, h as A, reactive as Bt, watch as Tt, isRef as ft, normalizeClass as Se, renderList as $e, normalizeStyle as pt, Teleport as jt, mergeProps as It } from "vue";
2
+ import { F as Ut, u as Pt, _ as Rt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DY7TaxPK.js";
3
+ import { useCoreStore as Mt, useI18n as vt } from "@feedmepos/mf-common";
4
+ import { useSnackbar as We, useDialog as Vt, useProxiedModel as Lt, components as be, useBreakpoints as Nt } from "@feedmepos/ui-library";
5
+ import { o as Et, u as ze, E as O, s as M, G as gt, H as he, z as Qe, t as Me, c as zt, a as Ht } from "./app-EpEEb8EO.js";
6
+ import { defineStore as yt, storeToRefs as Ot } from "pinia";
7
+ import { d as Le, e as bt, f as Yt, a as ke } from "./date2-Dnc8Y81g.js";
8
+ import { R as Kt, f as Ze, a as Ge, t as Qt, d as Be, o as ht, p as kt, m as xt, l as Gt } from "./rules-DKklsaS1.js";
9
+ import { b as qt, d as Wt } from "./xlsx.util-Cr9DpDFb.js";
10
+ import { u as Dt } from "./stock-BW8fen3H.js";
11
+ import { u as Je } from "./stock-3K93Mif9.js";
12
+ import { D as dt, R as Pe } from "./row-action.enum-BcW_L_nE.js";
13
+ import { c as Zt, _ as Jt, F as Re } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
14
+ import { f as Xt } from "./format-time-from-id-DlbHo6kY.js";
15
+ import { _ as ea } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CqAeF0wL.js";
8
16
  import { E as ta } from "./empty-placeholder-wf6-BWE8.js";
9
- const Oe = Ut((s, o) => {
17
+ const He = Et((s, o) => {
10
18
  function e() {
11
19
  return ze().currentLocation.dbName;
12
20
  }
@@ -47,28 +55,28 @@ const Oe = Ut((s, o) => {
47
55
  onFinished: { type: Function }
48
56
  },
49
57
  setup(s) {
50
- const o = s, e = Y(), m = Oe(), x = Ze(), h = Y(!1), g = Y(null), P = Y(!1), L = V(() => {
58
+ const o = s, e = Y(), m = He(), x = We(), h = Y(!1), g = Y(null), P = Y(!1), L = V(() => {
51
59
  switch (o.action) {
52
- case H.enum.approveDraft:
60
+ case O.enum.approveDraft:
53
61
  return "Online Approve (Beta)";
54
- case H.enum.rejectDraft:
62
+ case O.enum.rejectDraft:
55
63
  return "Reject";
56
- case H.enum.markAsFailed:
64
+ case O.enum.markAsFailed:
57
65
  return "Mark as Failed";
58
66
  }
59
67
  throw new Error(`Unknown action: ${o.action}`);
60
- }), M = V(() => {
68
+ }), R = V(() => {
61
69
  switch (o.action) {
62
- case H.enum.approveDraft:
70
+ case O.enum.approveDraft:
63
71
  return "primary";
64
- case H.enum.rejectDraft:
72
+ case O.enum.rejectDraft:
65
73
  return "destructive";
66
- case H.enum.markAsFailed:
74
+ case O.enum.markAsFailed:
67
75
  return "destructive";
68
76
  }
69
77
  throw new Error(`Unknown action: ${o.action}`);
70
78
  });
71
- We(() => {
79
+ qe(() => {
72
80
  if (o.draft.effectiveAt)
73
81
  g.value = new Date(o.draft.effectiveAt);
74
82
  else {
@@ -90,7 +98,7 @@ const Oe = Ut((s, o) => {
90
98
  }
91
99
  }), N = V({
92
100
  get() {
93
- return g.value === null ? "" : vt(g.value);
101
+ return g.value === null ? "" : bt(g.value);
94
102
  },
95
103
  set(c) {
96
104
  if (c) {
@@ -135,22 +143,22 @@ const Oe = Ut((s, o) => {
135
143
  }
136
144
  }
137
145
  return (c, u) => {
138
- const I = z("FmLabel"), y = z("FmDatePicker"), b = z("FmTimePicker"), C = z("FmTextField"), T = z("FmButton"), O = z("FmForm");
139
- return P.value ? (w(), ie(O, {
146
+ const I = z("FmLabel"), y = z("FmDatePicker"), b = z("FmTimePicker"), C = z("FmTextField"), T = z("FmButton"), H = z("FmForm");
147
+ return P.value ? (w(), ie(H, {
140
148
  key: 1,
141
149
  onValidationSuccess: v,
142
150
  class: "flex flex-col gap-32",
143
151
  disabled: h.value
144
152
  }, {
145
- default: W(() => [
153
+ default: q(() => [
146
154
  i("div", aa, [
147
155
  u[5] || (u[5] = oe(" You are about to ")),
148
156
  i("span", na, ae(L.value), 1),
149
157
  u[6] || (u[6] = oe(" this draft. Please provide a remark to justify this action. "))
150
158
  ]),
151
- c.action === $(H).enum.approveDraft ? (w(), E("div", oa, [
159
+ c.action === $(O).enum.approveDraft ? (w(), E("div", oa, [
152
160
  _(I, { class: "fm-typo-en-body-lg-600" }, {
153
- default: W(() => u[7] || (u[7] = [
161
+ default: q(() => u[7] || (u[7] = [
154
162
  oe("Closing Date")
155
163
  ])),
156
164
  _: 1
@@ -161,7 +169,7 @@ const Oe = Ut((s, o) => {
161
169
  max: $(Le)(/* @__PURE__ */ new Date())
162
170
  }, null, 8, ["modelValue", "max"]),
163
171
  _(I, { class: "fm-typo-en-body-lg-600" }, {
164
- default: W(() => u[8] || (u[8] = [
172
+ default: q(() => u[8] || (u[8] = [
165
173
  oe("Closing Time")
166
174
  ])),
167
175
  _: 1
@@ -177,7 +185,7 @@ const Oe = Ut((s, o) => {
177
185
  "onUpdate:modelValue": u[2] || (u[2] = (K) => e.value = K),
178
186
  label: "Remark",
179
187
  "label-mark": "required",
180
- rules: [$(Pt)()]
188
+ rules: [$(Kt)()]
181
189
  }, null, 8, ["modelValue", "rules"]),
182
190
  i("div", ra, [
183
191
  _(T, {
@@ -185,19 +193,19 @@ const Oe = Ut((s, o) => {
185
193
  variant: "tertiary",
186
194
  onClick: u[3] || (u[3] = (K) => c.onCancel())
187
195
  }),
188
- c.action === $(H).enum.approveDraft ? (w(), ie(T, {
196
+ c.action === $(O).enum.approveDraft ? (w(), ie(T, {
189
197
  key: 0,
190
198
  label: "Approve",
191
199
  type: "button",
192
200
  onClick: u[4] || (u[4] = (K) => v(!0)),
193
- variant: M.value,
201
+ variant: R.value,
194
202
  loading: h.value,
195
203
  disabled: B.value
196
204
  }, null, 8, ["variant", "loading", "disabled"])) : ne("", !0),
197
205
  _(T, {
198
206
  label: L.value,
199
207
  type: "submit",
200
- variant: M.value,
208
+ variant: R.value,
201
209
  loading: h.value,
202
210
  disabled: B.value
203
211
  }, null, 8, ["label", "variant", "loading", "disabled"])
@@ -213,41 +221,41 @@ const Oe = Ut((s, o) => {
213
221
  function At(s) {
214
222
  const o = s.measurementsAmounts.groupBy((m) => m.measurement.id), e = s.sku.unit.measurements.reduce((m, x) => {
215
223
  var P, L;
216
- const h = ((L = (P = o.get(x.id)) == null ? void 0 : P[0]) == null ? void 0 : L.amount) ?? la, g = qe(x.conversion, h);
217
- return m + +Qe(g);
218
- }, +Qe(s.baseAmount));
219
- return Mt(e, s.baseAmount.precision);
224
+ const h = ((L = (P = o.get(x.id)) == null ? void 0 : P[0]) == null ? void 0 : L.amount) ?? la, g = Ze(x.conversion, h);
225
+ return m + +Ge(g);
226
+ }, +Ge(s.baseAmount));
227
+ return Qt(e, s.baseAmount.precision);
220
228
  }
221
229
  const ia = Be(0), ca = Be(100), _t = "N/A";
222
230
  function ua(s, o, e, m, x, h) {
223
231
  var Q, Z, S, X, me;
224
- const g = At(s), P = m ?? g, L = gt(P, o), M = o.amount === 0 ? null : yt(L, {
232
+ const g = At(s), P = m ?? g, L = ht(P, o), R = o.amount === 0 ? null : kt(L, {
225
233
  ...o,
226
234
  amount: Math.abs(o.amount)
227
- }), k = M ? qe(M, ca) : null, N = ((Q = s.sku.defaultCost) == null ? void 0 : Q.costPerUnit) ?? { amount: 0, precision: 0 }, B = Number(R.toFormatString({ value: N })), v = ((S = (Z = s.sku.defaultCost) == null ? void 0 : Z.measurement) == null ? void 0 : S.conversion) ?? {
235
+ }), k = R ? Ze(R, ca) : null, N = ((Q = s.sku.defaultCost) == null ? void 0 : Q.costPerUnit) ?? { amount: 0, precision: 0 }, B = Number(M.toFormatString({ value: N })), v = ((S = (Z = s.sku.defaultCost) == null ? void 0 : Z.measurement) == null ? void 0 : S.conversion) ?? {
228
236
  amount: 1,
229
237
  precision: 0
230
238
  }, c = Number(
231
- R.toFormatString({ value: v })
232
- ), u = x ? Number(R.toFormatString({ value: x })) : 0, I = Number(R.toFormatString({ value: o })), y = Number(R.toFormatString({ value: P })), b = I - y, C = b * B / c, T = y * B / c, O = I * B / c;
239
+ M.toFormatString({ value: v })
240
+ ), u = x ? Number(M.toFormatString({ value: x })) : 0, I = Number(M.toFormatString({ value: o })), y = Number(M.toFormatString({ value: P })), b = I - y, C = b * B / c, T = y * B / c, H = I * B / c;
233
241
  return {
234
242
  code: s.sku.code,
235
243
  name: s.sku.name,
236
244
  baseUnit: s.sku.unit.abbrev,
237
245
  costUnit: ((me = (X = s.sku.defaultCost) == null ? void 0 : X.measurement) == null ? void 0 : me.abbrev) ?? null,
238
- baseUnitAmount: Number(R.toFormatString({ value: s.baseAmount })),
246
+ baseUnitAmount: Number(M.toFormatString({ value: s.baseAmount })),
239
247
  ...s.measurementsAmounts.filter(
240
248
  (ee) => ma(ee.measurement) && e.includes(ee.measurement.id)
241
249
  ).reduce(
242
- (ee, se, de) => (ee[`measurementAbbrev${de}`] = `(${se.measurement.abbrev}) × ${R.toFormatString({ value: se.measurement.conversion })}`, ee[`measurementAmount${de}`] = Number(R.toFormatString({ value: se.amount })), ee),
250
+ (ee, se, de) => (ee[`measurementAbbrev${de}`] = `(${se.measurement.abbrev}) × ${M.toFormatString({ value: se.measurement.conversion })}`, ee[`measurementAmount${de}`] = Number(M.toFormatString({ value: se.amount })), ee),
243
251
  {}
244
252
  ),
245
253
  systemBalance: I,
246
254
  physicalBalance: y,
247
- adjustedAmount: Number(R.toFormatString({ value: L })),
255
+ adjustedAmount: Number(M.toFormatString({ value: L })),
248
256
  adjustedDiffPercentage: k ? Number(
249
- R.toFormatString({
250
- value: bt(k, 2)
257
+ M.toFormatString({
258
+ value: xt(k, 2)
251
259
  })
252
260
  ) : null,
253
261
  costPerUnit: B,
@@ -256,7 +264,7 @@ function ua(s, o, e, m, x, h) {
256
264
  varianceQty: b,
257
265
  varianceInCost: C,
258
266
  stockTakeValue: T,
259
- systemValue: O
267
+ systemValue: H
260
268
  };
261
269
  }
262
270
  function ma(s) {
@@ -279,7 +287,7 @@ function wt(s) {
279
287
  );
280
288
  }
281
289
  function fa(s) {
282
- const o = ht(), e = o === "MYR" ? "RM" : o;
290
+ const o = gt(), e = o === "MYR" ? "RM" : o;
283
291
  return [
284
292
  {
285
293
  id: "code",
@@ -358,7 +366,7 @@ function fa(s) {
358
366
  ];
359
367
  }
360
368
  function pa(s, o, e) {
361
- var b, C, T, O, K, Q, Z;
369
+ var b, C, T, H, K, Q, Z;
362
370
  const m = o.groupBy(
363
371
  (S) => S.id,
364
372
  (S) => S.balance
@@ -375,7 +383,7 @@ function pa(s, o, e) {
375
383
  const X = Object.keys(S.adjustmentsByType).join(", ");
376
384
  g.set(S.skuId, X || _t);
377
385
  }
378
- const P = [...s.items, ...s.negativeStockItems ?? []], L = wt(P), M = P.map((S) => {
386
+ const P = [...s.items, ...s.negativeStockItems ?? []], L = wt(P), R = P.map((S) => {
379
387
  var de, xe, De;
380
388
  const X = ((de = m.get(S.sku._id)) == null ? void 0 : de[0]) ?? ia, me = ((xe = L == null ? void 0 : L.get(S.sku._id)) == null ? void 0 : xe[0]) ?? [], ee = h.get(S.sku._id), se = g.get(S.sku._id);
381
389
  return ua(
@@ -386,7 +394,7 @@ function pa(s, o, e) {
386
394
  ee,
387
395
  se
388
396
  );
389
- }), k = da(P), B = qt().currentBusiness.value, v = fa(k), c = [
397
+ }), k = da(P), B = Mt().currentBusiness.value, v = fa(k), c = [
390
398
  ["Business name:", B == null ? void 0 : B.name],
391
399
  ["Business ID:", B == null ? void 0 : B._id],
392
400
  ["Menu version", B == null ? void 0 : B.menuVersion],
@@ -397,7 +405,7 @@ function pa(s, o, e) {
397
405
  ["Recent action", s.approvedAt ? "Approve" : s.rejectionHistory ? "Reject" : ""],
398
406
  [
399
407
  "Action by",
400
- s.approvedAt ? (T = s.approvedBy) == null ? void 0 : T.name : s.rejectionHistory ? (K = (O = s.rejectionHistory[0]) == null ? void 0 : O.rejectedBy) == null ? void 0 : K.name : ""
408
+ s.approvedAt ? (T = s.approvedBy) == null ? void 0 : T.name : s.rejectionHistory ? (K = (H = s.rejectionHistory[0]) == null ? void 0 : H.rejectedBy) == null ? void 0 : K.name : ""
401
409
  ],
402
410
  [
403
411
  "Action at",
@@ -409,9 +417,9 @@ function pa(s, o, e) {
409
417
  ],
410
418
  [],
411
419
  v.map((S) => S.name),
412
- ...M.map((S) => v.map((X) => S[X.id]))
413
- ], u = v.map((S) => `system:${S.id}`), I = Rt(c, u), y = `[${B == null ? void 0 : B.name}] closing draft (${Vt(new Date(s.updatedAt))}).xlsx`;
414
- return Lt(I, y), y;
420
+ ...R.map((S) => v.map((X) => S[X.id]))
421
+ ], u = v.map((S) => `system:${S.id}`), I = qt(c, u), y = `[${B == null ? void 0 : B.name}] closing draft (${Yt(new Date(s.updatedAt))}).xlsx`;
422
+ return Wt(I, y), y;
415
423
  }
416
424
  const va = { class: "flex flex-col" }, ga = {
417
425
  key: 0,
@@ -427,12 +435,12 @@ const va = { class: "flex flex-col" }, ga = {
427
435
  const o = s;
428
436
  Je();
429
437
  const e = Y(!1), m = Y(null), x = Y(!1);
430
- We(() => {
438
+ qe(() => {
431
439
  if (o.draft.effectiveAt)
432
440
  m.value = new Date(o.draft.effectiveAt);
433
441
  else {
434
- const M = new Date(o.draft.createdAt);
435
- M.setHours(23, 59, 59, 999), m.value = M;
442
+ const R = new Date(o.draft.createdAt);
443
+ R.setHours(23, 59, 59, 999), m.value = R;
436
444
  }
437
445
  x.value = !0;
438
446
  });
@@ -440,20 +448,20 @@ const va = { class: "flex flex-col" }, ga = {
440
448
  get() {
441
449
  return m.value === null ? "" : Le(m.value);
442
450
  },
443
- set(M) {
444
- if (M) {
445
- const k = /* @__PURE__ */ new Date(`${M} ${g.value}`);
451
+ set(R) {
452
+ if (R) {
453
+ const k = /* @__PURE__ */ new Date(`${R} ${g.value}`);
446
454
  k.setSeconds(59, 999), m.value = k;
447
455
  } else
448
456
  m.value = null;
449
457
  }
450
458
  }), g = V({
451
459
  get() {
452
- return m.value === null ? "" : vt(m.value);
460
+ return m.value === null ? "" : bt(m.value);
453
461
  },
454
- set(M) {
455
- if (M) {
456
- const k = /* @__PURE__ */ new Date(`${h.value} ${M}`);
462
+ set(R) {
463
+ if (R) {
464
+ const k = /* @__PURE__ */ new Date(`${h.value} ${R}`);
457
465
  k.setSeconds(59, 999), m.value = k;
458
466
  } else
459
467
  m.value = null;
@@ -462,7 +470,7 @@ const va = { class: "flex flex-col" }, ga = {
462
470
  async function L() {
463
471
  e.value = !0, o.onFinished(m.value.toISOString());
464
472
  }
465
- return (M, k) => {
473
+ return (R, k) => {
466
474
  const N = z("FmLabel"), B = z("FmDatePicker"), v = z("FmTimePicker"), c = z("FmButton"), u = z("FmForm");
467
475
  return x.value ? (w(), ie(u, {
468
476
  key: 1,
@@ -470,7 +478,7 @@ const va = { class: "flex flex-col" }, ga = {
470
478
  class: "flex flex-col gap-32",
471
479
  disabled: e.value
472
480
  }, {
473
- default: W(() => [
481
+ default: q(() => [
474
482
  k[5] || (k[5] = i("div", { class: "fm-typo-en-body-lg-400" }, [
475
483
  i("p", null, [
476
484
  oe(" Performing "),
@@ -485,7 +493,7 @@ const va = { class: "flex flex-col" }, ga = {
485
493
  ], -1)),
486
494
  i("div", va, [
487
495
  _(N, { class: "fm-typo-en-body-lg-600" }, {
488
- default: W(() => k[3] || (k[3] = [
496
+ default: q(() => k[3] || (k[3] = [
489
497
  oe("Closing Date")
490
498
  ])),
491
499
  _: 1
@@ -496,7 +504,7 @@ const va = { class: "flex flex-col" }, ga = {
496
504
  max: $(Le)(/* @__PURE__ */ new Date())
497
505
  }, null, 8, ["modelValue", "max"]),
498
506
  _(N, { class: "fm-typo-en-body-lg-600" }, {
499
- default: W(() => k[4] || (k[4] = [
507
+ default: q(() => k[4] || (k[4] = [
500
508
  oe("Closing Time")
501
509
  ])),
502
510
  _: 1
@@ -511,7 +519,7 @@ const va = { class: "flex flex-col" }, ga = {
511
519
  _(c, {
512
520
  label: "Cancel",
513
521
  variant: "tertiary",
514
- onClick: k[2] || (k[2] = (I) => M.onCancel())
522
+ onClick: k[2] || (k[2] = (I) => R.onCancel())
515
523
  }),
516
524
  _(c, {
517
525
  label: "Refresh balance",
@@ -528,17 +536,17 @@ const va = { class: "flex flex-col" }, ga = {
528
536
  ], 64));
529
537
  };
530
538
  }
531
- }), Ne = xt(
539
+ }), Ne = yt(
532
540
  "closingDraftActions",
533
541
  function() {
534
- const o = Zt(), e = Ze(), m = Je(), x = Oe(), h = Dt(), g = Y(!1), P = Y();
542
+ const o = Vt(), e = We(), m = Je(), x = He(), h = Dt(), g = Y(!1), P = Y();
535
543
  function L(y) {
536
544
  const b = {
537
545
  draft: y
538
546
  };
539
547
  P.value = b, g.value = !0;
540
548
  }
541
- async function M(y) {
549
+ async function R(y) {
542
550
  var C;
543
551
  if (y.status === he.enum.COMPLETED) {
544
552
  const T = y.closingAdjustmentId;
@@ -550,8 +558,8 @@ const va = { class: "flex flex-col" }, ga = {
550
558
  }), console.error("Closing draft is completed but closing document cannot be found.", {
551
559
  draftId: y._id
552
560
  }), [];
553
- const O = await m.readAdjustmentById(T);
554
- return ((O == null ? void 0 : O.skus) ?? []).map((Q) => ({
561
+ const H = await m.readAdjustmentById(T);
562
+ return ((H == null ? void 0 : H.skus) ?? []).map((Q) => ({
555
563
  id: Q.sku._id,
556
564
  balance: Q.fromBalance,
557
565
  costs: Q.fromCostBalances
@@ -563,7 +571,7 @@ const va = { class: "flex flex-col" }, ga = {
563
571
  b || (e.open({
564
572
  title: "Exporting",
565
573
  message: "Fetching data..."
566
- }), b = await M(y)), pa(y, b, C ?? []);
574
+ }), b = await R(y)), pa(y, b, C ?? []);
567
575
  }
568
576
  function N(y, b) {
569
577
  o.open({
@@ -571,7 +579,7 @@ const va = { class: "flex flex-col" }, ga = {
571
579
  contentComponent: Ke,
572
580
  contentComponentProps: {
573
581
  draft: y,
574
- action: H.enum.approveDraft,
582
+ action: O.enum.approveDraft,
575
583
  onFinished: () => {
576
584
  o.close(), b == null || b();
577
585
  },
@@ -585,7 +593,7 @@ const va = { class: "flex flex-col" }, ga = {
585
593
  contentComponent: Ke,
586
594
  contentComponentProps: {
587
595
  draft: y,
588
- action: H.enum.rejectDraft,
596
+ action: O.enum.rejectDraft,
589
597
  onFinished: () => {
590
598
  o.close(), b == null || b();
591
599
  },
@@ -599,7 +607,7 @@ const va = { class: "flex flex-col" }, ga = {
599
607
  contentComponent: Ke,
600
608
  contentComponentProps: {
601
609
  draft: y,
602
- action: H.enum.markAsFailed,
610
+ action: O.enum.markAsFailed,
603
611
  onFinished: () => {
604
612
  o.close(), b == null || b();
605
613
  },
@@ -611,7 +619,7 @@ const va = { class: "flex flex-col" }, ga = {
611
619
  await x.sync({
612
620
  _id: y._id,
613
621
  _rev: y._rev ?? "",
614
- action: H.enum.approveDraft,
622
+ action: O.enum.approveDraft,
615
623
  data: {
616
624
  remark: y.remark ?? ""
617
625
  }
@@ -665,10 +673,10 @@ function Ve(s) {
665
673
  return "fm-status-badge-complete";
666
674
  }
667
675
  }
668
- const ha = xt(
676
+ const ha = yt(
669
677
  "closingDraftTable",
670
678
  function() {
671
- const { t: o } = kt(), e = Ne(), m = Y(new Array()), x = Y(!1), h = ze(), g = Oe();
679
+ const { t: o } = vt(), e = Ne(), m = Y(new Array()), x = Y(!1), h = ze(), g = He();
672
680
  async function P() {
673
681
  if (m.value = [], !!h._currentLocation) {
674
682
  x.value = !0;
@@ -698,7 +706,7 @@ const ha = xt(
698
706
  }
699
707
  }
700
708
  }
701
- function M(v) {
709
+ function R(v) {
702
710
  m.value = m.value.map((c) => c._id === v._id ? {
703
711
  ...v,
704
712
  _rev: c._rev
@@ -713,11 +721,11 @@ const ha = xt(
713
721
  return e.viewDraft(c);
714
722
  case Pe.Export:
715
723
  return e.exportDraft(c);
716
- case H.enum.approveDraft:
724
+ case O.enum.approveDraft:
717
725
  return e.approveDraft(c, k);
718
- case H.enum.rejectDraft:
726
+ case O.enum.rejectDraft:
719
727
  return e.rejectDraft(c, k);
720
- case H.enum.markAsFailed:
728
+ case O.enum.markAsFailed:
721
729
  return e.markAsFailed(c, k);
722
730
  }
723
731
  }
@@ -728,7 +736,7 @@ const ha = xt(
728
736
  accessorKey: "_id",
729
737
  header: () => o("inventory.closing.table.createdAt"),
730
738
  cell(v) {
731
- return Nt(`${v.getValue()}`);
739
+ return Xt(`${v.getValue()}`);
732
740
  },
733
741
  enableSorting: !0
734
742
  },
@@ -738,7 +746,7 @@ const ha = xt(
738
746
  cell(v) {
739
747
  const c = v.row.original;
740
748
  let u = v.getValue();
741
- return u || (u = Ge(c._id)), ke(u);
749
+ return u || (u = Qe(c._id)), ke(u);
742
750
  },
743
751
  enableSorting: !0,
744
752
  size: 200
@@ -820,7 +828,7 @@ const ha = xt(
820
828
  {
821
829
  class: ["fm-status-badge", Ve(u)]
822
830
  },
823
- Re(u)
831
+ Me(u)
824
832
  )
825
833
  );
826
834
  }
@@ -835,20 +843,20 @@ const ha = xt(
835
843
  {
836
844
  translationKey: "inventory.closing.draft.approveDraft",
837
845
  color: "text-fm-color-typo-primary",
838
- value: H.enum.approveDraft
846
+ value: O.enum.approveDraft
839
847
  },
840
848
  {
841
849
  translationKey: "inventory.closing.draft.rejectDraft",
842
850
  color: "text-fm-color-typo-error",
843
- value: H.enum.rejectDraft
851
+ value: O.enum.rejectDraft
844
852
  },
845
853
  {
846
854
  translationKey: "inventory.closing.draft.markAsFailed",
847
855
  color: "text-fm-color-typo-error",
848
- value: H.enum.markAsFailed
856
+ value: O.enum.markAsFailed
849
857
  }
850
858
  ];
851
- return Et(
859
+ return Zt(
852
860
  [
853
861
  ...u,
854
862
  ...c.status === he.enum.DRAFT ? I : []
@@ -868,7 +876,7 @@ const ha = xt(
868
876
  loading: x,
869
877
  fetchDrafts: P,
870
878
  loadDraft: L,
871
- updateDraftRef: M
879
+ updateDraftRef: R
872
880
  };
873
881
  }
874
882
  ), ka = { class: "w-full flex flex-col gap-32" }, xa = { class: "flex justify-between" }, Da = { class: "flex" }, Aa = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, _a = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wa = { class: "flex gap-1" }, Sa = { class: "fm-typo-en-body-lg-600" }, Fa = { class: "flex flex-col gap-16" }, Ca = { class: "flex items-center" }, $a = {
@@ -880,10 +888,10 @@ const ha = xt(
880
888
  }, Ta = { class: "flex items-center gap-8" }, ja = { class: "flex flex-col gap-8" }, Ia = { class: "flex gap-8" }, Ua = {
881
889
  key: 0,
882
890
  class: "flex gap-8"
883
- }, Pa = { class: "overflow-x-auto" }, Ma = {
891
+ }, Pa = { class: "overflow-x-auto" }, Ra = {
884
892
  key: 1,
885
893
  class: "flex-1 xs:w-screen xs:max-w-full"
886
- }, Ra = {
894
+ }, Ma = {
887
895
  key: 0,
888
896
  class: "flex flex-col items-center gap-8 h-full"
889
897
  }, Va = ["src"], La = {
@@ -892,13 +900,13 @@ const ha = xt(
892
900
  }, Na = { class: "flex gap-12 content-stretch" }, Ea = {
893
901
  class: "flex flex-col w-24",
894
902
  name: "circles"
895
- }, za = { class: "flex-1 flex flex-col items-center" }, Oa = { class: "flex-1 flex flex-col items-center" }, Ha = {
903
+ }, za = { class: "flex-1 flex flex-col items-center" }, Ha = { class: "flex-1 flex flex-col items-center" }, Oa = {
896
904
  class: "py-12 flex flex-col gap-4",
897
905
  name: "received-at header"
898
906
  }, Ya = { class: "fm-typo-en-body-lg-400" }, Ka = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Qa = { class: "flex gap-12 content-stretch" }, Ga = {
899
907
  class: "flex flex-col w-24",
900
908
  name: "circles"
901
- }, Wa = { class: "flex-1 flex flex-col items-center" }, qa = {
909
+ }, qa = { class: "flex-1 flex flex-col items-center" }, Wa = {
902
910
  class: "py-12 flex flex-col gap-4 flex-1",
903
911
  name: "delivery details"
904
912
  }, Za = { class: "flex flex-col gap-8" }, Ja = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Xa = { class: "flex flex-col gap-4" }, en = { class: "flex gap-8" }, tn = "N/A", an = /* @__PURE__ */ Ee({
@@ -910,14 +918,14 @@ const ha = xt(
910
918
  emits: ["submitted", "refresh"],
911
919
  setup(s, { emit: o }) {
912
920
  const e = s, m = V(() => {
913
- const r = ht();
921
+ const r = gt();
914
922
  return r === "MYR" ? "RM" : r;
915
- }), x = Dt(), h = Ne(), g = Jt(e, "show"), P = Y(!1), L = Y(!1), M = Y(!1), k = Y(new Array()), N = Y(new Array()), B = Y([]), v = Je(), c = Oe(), u = Ze(), I = Ot(), y = ze(), b = Bt({}), C = V(() => new Set(
923
+ }), x = Dt(), h = Ne(), g = Lt(e, "show"), P = Y(!1), L = Y(!1), R = Y(!1), k = Y(new Array()), N = Y(new Array()), B = Y([]), v = Je(), c = He(), u = We(), I = Ht(), y = ze(), b = Bt({}), C = V(() => new Set(
916
924
  I.skus.filter((r) => {
917
925
  var t;
918
926
  return b[(t = r.customAttributes) == null ? void 0 : t.tag];
919
927
  }).map((r) => r._id)
920
- )), T = o, O = Y({
928
+ )), T = o, H = Y({
921
929
  templateItem: !0,
922
930
  nonTemplateItem: !0
923
931
  }), K = V(() => {
@@ -931,10 +939,10 @@ const ha = xt(
931
939
  (t) => t.sku._id,
932
940
  (t) => t.measurementsAmounts.filter((d) => !d.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((d) => d.measurement.id)
933
941
  ));
934
- We(me), Tt(
942
+ qe(me), Tt(
935
943
  () => e.show,
936
944
  (r) => {
937
- r && (ge.value = ve[0], me(), O.value = {
945
+ r && (ge.value = ve[0], me(), H.value = {
938
946
  templateItem: !0,
939
947
  nonTemplateItem: !0
940
948
  });
@@ -997,7 +1005,7 @@ const ha = xt(
997
1005
  }
998
1006
  async function ee() {
999
1007
  var t, d;
1000
- if (!(((t = e.draft) == null ? void 0 : t.effectiveAt) ?? (e.draft ? Ge((d = e.draft) == null ? void 0 : d._id) : null))) {
1008
+ if (!(((t = e.draft) == null ? void 0 : t.effectiveAt) ?? (e.draft ? Qe((d = e.draft) == null ? void 0 : d._id) : null))) {
1001
1009
  u.open({
1002
1010
  title: "Cannot refresh",
1003
1011
  message: "Effective date is not available for this draft.",
@@ -1181,11 +1189,11 @@ const ha = xt(
1181
1189
  (d) => ({
1182
1190
  id: `adjustment_${d}`,
1183
1191
  accessorFn: (a) => a.adjustmentAmounts[d] ?? { amount: 0, precision: 0 },
1184
- header: () => te(Re(d)),
1192
+ header: () => te(Me(d)),
1185
1193
  size: 150,
1186
1194
  cell(a) {
1187
1195
  const n = a.row.original.adjustmentAmounts[d] ?? { amount: 0, precision: 0 };
1188
- return A("div", { class: "text-right" }, Qe(n));
1196
+ return A("div", { class: "text-right" }, Ge(n));
1189
1197
  },
1190
1198
  meta: {
1191
1199
  textAlign: "right"
@@ -1206,18 +1214,18 @@ const ha = xt(
1206
1214
  accessorFn: (d) => {
1207
1215
  var n;
1208
1216
  const a = (n = N.value.find((l) => l.id === d.id)) == null ? void 0 : n.balance;
1209
- return a ? R.toFormatString({ value: a }) : d.physicalBalance;
1217
+ return a ? M.toFormatString({ value: a }) : d.physicalBalance;
1210
1218
  },
1211
1219
  header: () => te("Stock Take balance", "The physical balance recorded during stock take."),
1212
1220
  cell(d) {
1213
1221
  var p;
1214
- const a = d.row.original, n = R.fromNumber(a.physicalBalance);
1222
+ const a = d.row.original, n = M.fromNumber(a.physicalBalance);
1215
1223
  let l = !0, f = a.physicalBalance;
1216
1224
  const D = (p = N.value.find((j) => j.id === a.id)) == null ? void 0 : p.balance;
1217
- return D && (R.equals({
1225
+ return D && (M.equals({
1218
1226
  a: n,
1219
1227
  b: D
1220
- }) || (l = !1, f = Number(R.toFormatString({ value: D })))), A("div", { class: "flex flex-col" }, [
1228
+ }) || (l = !1, f = Number(M.toFormatString({ value: D })))), A("div", { class: "flex flex-col" }, [
1221
1229
  A(
1222
1230
  "span",
1223
1231
  { class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-primary" },
@@ -1298,7 +1306,7 @@ const ha = xt(
1298
1306
  var j;
1299
1307
  const a = d.row.original, n = a.stockTakeValue, l = Q.value.find((U) => U._id === a.id), f = (j = l == null ? void 0 : l.defaultCost) == null ? void 0 : j.measurement, D = a.physicalBalance, p = a.costPerUnit;
1300
1308
  if (f) {
1301
- const U = R.toFormatString({ value: f.conversion }), re = `${D.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} ${a.baseUnit} ÷ ${U} × ${p} ${m.value}`;
1309
+ const U = M.toFormatString({ value: f.conversion }), re = `${D.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} ${a.baseUnit} ÷ ${U} × ${p} ${m.value}`;
1302
1310
  return A(
1303
1311
  be.FmTooltip,
1304
1312
  { zIndex: 51 },
@@ -1354,7 +1362,7 @@ const ha = xt(
1354
1362
  var j;
1355
1363
  const a = d.row.original, n = a.systemValue, l = Q.value.find((U) => U._id === a.id), f = (j = l == null ? void 0 : l.defaultCost) == null ? void 0 : j.measurement, D = a.systemBalance, p = a.costPerUnit;
1356
1364
  if (f) {
1357
- const U = R.toFormatString({ value: f.conversion }), re = `${D.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })} ${a.baseUnit} ÷ ${U} × ${p} ${m.value}`;
1365
+ const U = M.toFormatString({ value: f.conversion }), re = `${D.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })} ${a.baseUnit} ÷ ${U} × ${p} ${m.value}`;
1358
1366
  return A(
1359
1367
  be.FmTooltip,
1360
1368
  { zIndex: 51 },
@@ -1461,17 +1469,17 @@ const ha = xt(
1461
1469
  )) ?? {};
1462
1470
  return Q.value.map((n) => {
1463
1471
  var tt, at, nt, ot, st, rt, lt, it, ct, ut, mt;
1464
- const l = (tt = de.value.get(n._id)) == null ? void 0 : tt[0], f = ((at = se.value.get(n._id)) == null ? void 0 : at[0]) ?? S, D = ((nt = n.defaultCost) == null ? void 0 : nt.costPerUnit) ?? S, p = Number(R.toFormatString({ value: D })), j = ((st = (ot = n.defaultCost) == null ? void 0 : ot.measurement) == null ? void 0 : st.conversion) ?? {
1472
+ const l = (tt = de.value.get(n._id)) == null ? void 0 : tt[0], f = ((at = se.value.get(n._id)) == null ? void 0 : at[0]) ?? S, D = ((nt = n.defaultCost) == null ? void 0 : nt.costPerUnit) ?? S, p = Number(M.toFormatString({ value: D })), j = ((st = (ot = n.defaultCost) == null ? void 0 : ot.measurement) == null ? void 0 : st.conversion) ?? {
1465
1473
  amount: 1,
1466
1474
  precision: 0
1467
1475
  }, U = Number(
1468
- R.toFormatString({ value: j })
1469
- ), re = De.value.get(n._id), ce = re ? Number(R.toFormatString({ value: re })) : 0, _e = xe.value.get(n._id), F = {};
1470
- if (B.value.forEach((q) => {
1471
- const ue = F[q] ?? { amount: 0, precision: 0 }, fe = _e == null ? void 0 : _e[q];
1472
- fe && (F[q] = Ht(ue, fe));
1476
+ M.toFormatString({ value: j })
1477
+ ), re = De.value.get(n._id), ce = re ? Number(M.toFormatString({ value: re })) : 0, _e = xe.value.get(n._id), F = {};
1478
+ if (B.value.forEach((W) => {
1479
+ const ue = F[W] ?? { amount: 0, precision: 0 }, fe = _e == null ? void 0 : _e[W];
1480
+ fe && (F[W] = Gt(ue, fe));
1473
1481
  }), !l) {
1474
- const q = Number(R.toFormatString({ value: f })), ue = q - 0, fe = ue * p / U, Ue = 0, $t = q * p / U;
1482
+ const W = Number(M.toFormatString({ value: f })), ue = W - 0, fe = ue * p / U, Ue = 0, $t = W * p / U;
1475
1483
  return {
1476
1484
  id: n._id,
1477
1485
  code: n.code,
@@ -1479,9 +1487,9 @@ const ha = xt(
1479
1487
  costUnit: ((lt = (rt = n.defaultCost) == null ? void 0 : rt.measurement) == null ? void 0 : lt.abbrev) ?? null,
1480
1488
  baseUnit: n.unit.abbrev,
1481
1489
  baseUnitAmount: 0,
1482
- systemBalance: q,
1490
+ systemBalance: W,
1483
1491
  physicalBalance: 0,
1484
- adjustedAmount: -q,
1492
+ adjustedAmount: -W,
1485
1493
  adjustedDiffPercentage: -100,
1486
1494
  isTemplateItem: !r[n._id],
1487
1495
  costPerUnit: p,
@@ -1494,31 +1502,31 @@ const ha = xt(
1494
1502
  };
1495
1503
  }
1496
1504
  const G = At(l), J = (ct = (it = N.value) == null ? void 0 : it.find(
1497
- (q) => q.id === n._id
1498
- )) == null ? void 0 : ct.balance, pe = gt(
1505
+ (W) => W.id === n._id
1506
+ )) == null ? void 0 : ct.balance, pe = ht(
1499
1507
  J ?? G,
1500
1508
  f
1501
- ), Ce = f.amount === 0 ? null : yt(pe, {
1509
+ ), Ce = f.amount === 0 ? null : kt(pe, {
1502
1510
  ...f,
1503
1511
  amount: Math.abs(f.amount)
1504
- }), Ie = Ce ? qe(Ce, X) : null, He = Number(R.toFormatString({ value: f })), Ye = Number(R.toFormatString({ value: G })), et = He - Ye, St = et * p / U, Ft = Ye * p / U, Ct = He * p / U;
1512
+ }), Ie = Ce ? Ze(Ce, X) : null, Oe = Number(M.toFormatString({ value: f })), Ye = Number(M.toFormatString({ value: G })), et = Oe - Ye, St = et * p / U, Ft = Ye * p / U, Ct = Oe * p / U;
1505
1513
  return {
1506
1514
  id: n._id,
1507
1515
  code: n.code,
1508
1516
  name: n.name,
1509
1517
  costUnit: ((mt = (ut = n.defaultCost) == null ? void 0 : ut.measurement) == null ? void 0 : mt.abbrev) ?? null,
1510
1518
  baseUnit: n.unit.abbrev,
1511
- baseUnitAmount: Number(R.toFormatString({ value: l.baseAmount })),
1512
- ...l.measurementsAmounts.filter((q) => {
1519
+ baseUnitAmount: Number(M.toFormatString({ value: l.baseAmount })),
1520
+ ...l.measurementsAmounts.filter((W) => {
1513
1521
  var ue, fe, Ue;
1514
- return (Ue = (fe = (ue = Z.value) == null ? void 0 : ue.get(n._id)) == null ? void 0 : fe[0]) == null ? void 0 : Ue.includes(q.measurement.id);
1515
- }).reduce((q, ue, fe) => (q[`measurementAbbrev${fe}`] = `(${ue.measurement.abbrev}) × ${R.toFormatString({ value: ue.measurement.conversion })}`, q[`measurementAmount${fe}`] = Number(R.toFormatString({ value: ue.amount })), q), {}),
1516
- systemBalance: He,
1522
+ return (Ue = (fe = (ue = Z.value) == null ? void 0 : ue.get(n._id)) == null ? void 0 : fe[0]) == null ? void 0 : Ue.includes(W.measurement.id);
1523
+ }).reduce((W, ue, fe) => (W[`measurementAbbrev${fe}`] = `(${ue.measurement.abbrev}) × ${M.toFormatString({ value: ue.measurement.conversion })}`, W[`measurementAmount${fe}`] = Number(M.toFormatString({ value: ue.amount })), W), {}),
1524
+ systemBalance: Oe,
1517
1525
  physicalBalance: Ye,
1518
- adjustedAmount: Number(R.toFormatString({ value: pe })),
1526
+ adjustedAmount: Number(M.toFormatString({ value: pe })),
1519
1527
  adjustedDiffPercentage: Ie ? Number(
1520
- R.toFormatString({
1521
- value: bt(Ie, 2)
1528
+ M.toFormatString({
1529
+ value: xt(Ie, 2)
1522
1530
  })
1523
1531
  ) : null,
1524
1532
  isTemplateItem: !r[n._id],
@@ -1530,7 +1538,7 @@ const ha = xt(
1530
1538
  systemValue: Ct,
1531
1539
  adjustmentAmounts: F
1532
1540
  };
1533
- }).filter((n) => !!(n.isTemplateItem && O.value.templateItem || !n.isTemplateItem && O.value.nonTemplateItem));
1541
+ }).filter((n) => !!(n.isTemplateItem && H.value.templateItem || !n.isTemplateItem && H.value.nonTemplateItem));
1534
1542
  }), je = V(() => {
1535
1543
  var t, d, a, n, l;
1536
1544
  if (!e.draft) return [];
@@ -1568,7 +1576,7 @@ const ha = xt(
1568
1576
  },
1569
1577
  {
1570
1578
  label: "Effective at",
1571
- value: ke(e.draft.effectiveAt ?? Ge((a = e.draft) == null ? void 0 : a._id))
1579
+ value: ke(e.draft.effectiveAt ?? Qe((a = e.draft) == null ? void 0 : a._id))
1572
1580
  },
1573
1581
  {
1574
1582
  label: "Using template",
@@ -1605,9 +1613,9 @@ const ha = xt(
1605
1613
  const r = ((a = e.draft) == null ? void 0 : a.activityLogs) ?? [], t = ((n = e.draft) == null ? void 0 : n.rejectionHistory) ?? [];
1606
1614
  for (const f of t)
1607
1615
  r.find(
1608
- (p) => `${p.action}_${p.performedAt}` == `${H.enum.rejectDraft}_${f.rejectedAt}`
1616
+ (p) => `${p.action}_${p.performedAt}` == `${O.enum.rejectDraft}_${f.rejectedAt}`
1609
1617
  ) || r.push({
1610
- action: H.enum.rejectDraft,
1618
+ action: O.enum.rejectDraft,
1611
1619
  performedAt: f.rejectedAt,
1612
1620
  performedBy: f.rejectedBy,
1613
1621
  remark: f.rejectRemark
@@ -1615,16 +1623,16 @@ const ha = xt(
1615
1623
  return (l = e.draft) != null && l.approvedAt && (r.find(
1616
1624
  (D) => {
1617
1625
  var p;
1618
- return `${D.action}_${D.performedAt}` == `${H.enum.approveDraft}_${(p = e.draft) == null ? void 0 : p.approvedAt}`;
1626
+ return `${D.action}_${D.performedAt}` == `${O.enum.approveDraft}_${(p = e.draft) == null ? void 0 : p.approvedAt}`;
1619
1627
  }
1620
1628
  ) || r.push({
1621
- action: H.enum.approveDraft,
1629
+ action: O.enum.approveDraft,
1622
1630
  performedAt: e.draft.approvedAt,
1623
1631
  performedBy: e.draft.approvedBy ?? { name: "Unknown", id: "unknown" },
1624
1632
  remark: e.draft.approveRemark
1625
1633
  })), r.sort((f, D) => new Date(D.performedAt).getTime() - new Date(f.performedAt).getTime()).map(
1626
1634
  (f) => ({
1627
- header: Re(f.action),
1635
+ header: Me(f.action),
1628
1636
  date: ke(f.performedAt),
1629
1637
  info: [
1630
1638
  {
@@ -1657,7 +1665,7 @@ const ha = xt(
1657
1665
  "onUpdate:modelValue": t[10] || (t[10] = (F) => ft(g) ? g.value = F : null),
1658
1666
  header: "Closing details"
1659
1667
  }, {
1660
- "side-sheet-footer": W(() => {
1668
+ "side-sheet-footer": q(() => {
1661
1669
  var F, G, J, pe;
1662
1670
  return [
1663
1671
  i("div", en, [
@@ -1667,10 +1675,10 @@ const ha = xt(
1667
1675
  "z-index": 51,
1668
1676
  placement: "right"
1669
1677
  }, {
1670
- content: W(() => [
1678
+ content: q(() => [
1671
1679
  oe(ae(Xe.value), 1)
1672
1680
  ]),
1673
- default: W(() => [
1681
+ default: q(() => [
1674
1682
  _(l, {
1675
1683
  disabled: "",
1676
1684
  key: "approve key",
@@ -1691,14 +1699,14 @@ const ha = xt(
1691
1699
  variant: "destructive",
1692
1700
  onClick: t[7] || (t[7] = () => e.draft && $(h).rejectDraft(e.draft, () => T("submitted")))
1693
1701
  })) : ne("", !0),
1694
- (J = e.draft) != null && J.approvedAt && ((pe = e.draft) == null ? void 0 : pe.status) !== $(he).enum.COMPLETED ? (w(), ie(Yt, { key: 2 }, {
1695
- default: W(() => [
1702
+ (J = e.draft) != null && J.approvedAt && ((pe = e.draft) == null ? void 0 : pe.status) !== $(he).enum.COMPLETED ? (w(), ie(Ut, { key: 2 }, {
1703
+ default: q(() => [
1696
1704
  _(l, {
1697
1705
  label: "Sync",
1698
- loading: M.value,
1706
+ loading: R.value,
1699
1707
  onClick: t[8] || (t[8] = () => {
1700
- e.draft && (M.value = !0, $(h).syncDraft(e.draft, () => {
1701
- M.value = !1, T("submitted");
1708
+ e.draft && (R.value = !0, $(h).syncDraft(e.draft, () => {
1709
+ R.value = !1, T("submitted");
1702
1710
  }));
1703
1711
  })
1704
1712
  }, null, 8, ["loading"])
@@ -1713,7 +1721,7 @@ const ha = xt(
1713
1721
  ])
1714
1722
  ];
1715
1723
  }),
1716
- default: W(() => [
1724
+ default: q(() => [
1717
1725
  i("div", ka, [
1718
1726
  i("div", null, [
1719
1727
  _(d, {
@@ -1727,7 +1735,7 @@ const ha = xt(
1727
1735
  variant: "outlined",
1728
1736
  class: "flex flex-col gap-8 px-12 py-16"
1729
1737
  }, {
1730
- default: W(() => {
1738
+ default: q(() => {
1731
1739
  var F, G;
1732
1740
  return [
1733
1741
  i("div", xa, [
@@ -1735,7 +1743,7 @@ const ha = xt(
1735
1743
  i("div", Da, [
1736
1744
  i("div", {
1737
1745
  class: Se(["fm-status-badge", $(Ve)(((F = r.draft) == null ? void 0 : F.status) ?? "DRAFT")])
1738
- }, ae($(Re)(((G = r.draft) == null ? void 0 : G.status) ?? "")), 3)
1746
+ }, ae($(Me)(((G = r.draft) == null ? void 0 : G.status) ?? "")), 3)
1739
1747
  ])
1740
1748
  ]),
1741
1749
  _(a),
@@ -1798,13 +1806,13 @@ const ha = xt(
1798
1806
  i("div", Ia, [
1799
1807
  _(D, {
1800
1808
  label: "Template Item(s)",
1801
- selected: O.value.templateItem,
1802
- onClick: t[2] || (t[2] = (F) => O.value.templateItem = !O.value.templateItem)
1809
+ selected: H.value.templateItem,
1810
+ onClick: t[2] || (t[2] = (F) => H.value.templateItem = !H.value.templateItem)
1803
1811
  }, null, 8, ["selected"]),
1804
1812
  _(D, {
1805
1813
  label: "Non-template Item(s)",
1806
- selected: O.value.nonTemplateItem,
1807
- onClick: t[3] || (t[3] = (F) => O.value.nonTemplateItem = !O.value.nonTemplateItem)
1814
+ selected: H.value.nonTemplateItem,
1815
+ onClick: t[3] || (t[3] = (F) => H.value.nonTemplateItem = !H.value.nonTemplateItem)
1808
1816
  }, null, 8, ["selected"])
1809
1817
  ]),
1810
1818
  _(p, {
@@ -1821,7 +1829,7 @@ const ha = xt(
1821
1829
  selected: b[`${F}`],
1822
1830
  onClick: (G) => b[`${F}`] = !b[`${F}`]
1823
1831
  }, {
1824
- default: W(() => [
1832
+ default: q(() => [
1825
1833
  b[`${F}`] ? (w(), ie(j, {
1826
1834
  key: 0,
1827
1835
  name: "check",
@@ -1855,7 +1863,7 @@ const ha = xt(
1855
1863
  ], 64))
1856
1864
  ])
1857
1865
  ], 64)) : ne("", !0),
1858
- ge.value.value === "history" ? (w(), E("div", Ma, [
1866
+ ge.value.value === "history" ? (w(), E("div", Ra, [
1859
1867
  ye.value.length ? (w(), E("div", La, [
1860
1868
  (w(!0), E(le, null, $e(ye.value, (F, G) => (w(), E(le, { key: G }, [
1861
1869
  i("div", Na, [
@@ -1872,7 +1880,7 @@ const ha = xt(
1872
1880
  }, null, 2)
1873
1881
  ]),
1874
1882
  t[18] || (t[18] = i("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
1875
- i("div", Oa, [
1883
+ i("div", Ha, [
1876
1884
  i("div", {
1877
1885
  class: Se([
1878
1886
  {
@@ -1884,14 +1892,14 @@ const ha = xt(
1884
1892
  }, null, 2)
1885
1893
  ])
1886
1894
  ]),
1887
- i("div", Ha, [
1895
+ i("div", Oa, [
1888
1896
  i("div", Ya, ae(F.header), 1),
1889
1897
  i("div", Ka, ae(F.date), 1)
1890
1898
  ])
1891
1899
  ]),
1892
1900
  i("div", Qa, [
1893
1901
  i("div", Ga, [
1894
- i("div", Wa, [
1902
+ i("div", qa, [
1895
1903
  i("div", {
1896
1904
  class: Se([
1897
1905
  {
@@ -1903,12 +1911,12 @@ const ha = xt(
1903
1911
  }, null, 2)
1904
1912
  ])
1905
1913
  ]),
1906
- i("div", qa, [
1914
+ i("div", Wa, [
1907
1915
  _(n, {
1908
1916
  variant: "outlined",
1909
1917
  class: "py-12 px-16"
1910
1918
  }, {
1911
- default: W(() => [
1919
+ default: q(() => [
1912
1920
  i("div", Za, [
1913
1921
  (w(!0), E(le, null, $e(F.info, (J, pe) => (w(), E("div", {
1914
1922
  key: pe,
@@ -1929,7 +1937,7 @@ const ha = xt(
1929
1937
  ])
1930
1938
  ])
1931
1939
  ], 64))), 128))
1932
- ])) : (w(), E("div", Ra, [
1940
+ ])) : (w(), E("div", Ma, [
1933
1941
  _(re),
1934
1942
  i("div", null, [
1935
1943
  i("img", {
@@ -1949,12 +1957,12 @@ const ha = xt(
1949
1957
  }, 8, ["model-value"]);
1950
1958
  };
1951
1959
  }
1952
- }), nn = { class: "flex-1 flex flex-col gap-8" }, on = { class: "flex flex-col" }, sn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, ln = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, cn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, kn = /* @__PURE__ */ Ee({
1960
+ }), nn = { class: "flex-1 flex flex-col gap-8" }, on = { class: "flex flex-col" }, sn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, ln = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, cn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Cn = /* @__PURE__ */ Ee({
1953
1961
  __name: "ClosingDraftView",
1954
1962
  setup(s) {
1955
- const { t: o } = kt(), { viewDraft: e } = Ne(), { viewClosingDraftProps: m, viewClosingDraftShow: x } = ea(Ne()), h = ze(), g = ha(), P = Kt(), { breakpoints: L } = Xt();
1963
+ const { t: o } = vt(), { viewDraft: e } = Ne(), { viewClosingDraftProps: m, viewClosingDraftShow: x } = Ot(Ne()), h = ze(), g = ha(), P = Pt(), { breakpoints: L } = Nt();
1956
1964
  h.watchLocation(g.fetchDrafts);
1957
- const M = V(() => g.loading), k = Y(""), N = V(() => L.value.xs || L.value.sm), B = V(() => N.value ? 10 : 20);
1965
+ const R = V(() => g.loading), k = Y(""), N = V(() => L.value.xs || L.value.sm), B = V(() => N.value ? 10 : 20);
1958
1966
  function v(I) {
1959
1967
  switch (I) {
1960
1968
  case "refresh":
@@ -1980,12 +1988,12 @@ const ha = xt(
1980
1988
  return (I, y) => {
1981
1989
  const b = z("FmTable");
1982
1990
  return w(), E(le, null, [
1983
- _(Qt, {
1991
+ _(Rt, {
1984
1992
  title: $(o)("inventory.closing.draft.title"),
1985
1993
  actions: u.value,
1986
1994
  "onClick:action": v
1987
1995
  }, {
1988
- default: W(() => [
1996
+ default: q(() => [
1989
1997
  i("div", {
1990
1998
  class: Se([
1991
1999
  "flex flex-col gap-8 max-h-full",
@@ -1995,7 +2003,7 @@ const ha = xt(
1995
2003
  }
1996
2004
  ])
1997
2005
  }, [
1998
- _(Gt, {
2006
+ _(ea, {
1999
2007
  "change-location": "",
2000
2008
  searchable: "",
2001
2009
  search: k.value,
@@ -2006,28 +2014,28 @@ const ha = xt(
2006
2014
  "column-defs": $(g).columnDefs,
2007
2015
  "row-data": $(g).drafts,
2008
2016
  "search-value": k.value,
2009
- loading: M.value,
2017
+ loading: R.value,
2010
2018
  onRowClick: y[1] || (y[1] = (C) => $(e)(C.original)),
2011
2019
  "page-size": B.value
2012
2020
  }, {
2013
- "list-row": W((C) => [
2014
- _(Wt, {
2021
+ "list-row": q((C) => [
2022
+ _(Jt, {
2015
2023
  row: C,
2016
2024
  onRowClick: (T) => $(e)(T)
2017
2025
  }, {
2018
- default: W((T) => {
2019
- var O, K, Q, Z, S, X, me, ee, se, de, xe, De, te, Ae, Te, we, Fe, je, ve, ge;
2026
+ default: q((T) => {
2027
+ var H, K, Q, Z, S, X, me, ee, se, de, xe, De, te, Ae, Te, we, Fe, je, ve, ge;
2020
2028
  return [
2021
2029
  i("div", nn, [
2022
2030
  i("div", on, [
2023
2031
  i("div", sn, [
2024
- _($(Me), {
2025
- render: (Q = (K = (O = T._id) == null ? void 0 : O.column) == null ? void 0 : K.columnDef) == null ? void 0 : Q.cell,
2032
+ _($(Re), {
2033
+ render: (Q = (K = (H = T._id) == null ? void 0 : H.column) == null ? void 0 : K.columnDef) == null ? void 0 : Q.cell,
2026
2034
  props: (S = (Z = T._id) == null ? void 0 : Z.getContext) == null ? void 0 : S.call(Z)
2027
2035
  }, null, 8, ["render", "props"])
2028
2036
  ]),
2029
2037
  i("div", rn, [
2030
- _($(Me), {
2038
+ _($(Re), {
2031
2039
  render: (ee = (me = (X = T.name) == null ? void 0 : X.column) == null ? void 0 : me.columnDef) == null ? void 0 : ee.cell,
2032
2040
  props: (de = (se = T.name) == null ? void 0 : se.getContext) == null ? void 0 : de.call(se)
2033
2041
  }, null, 8, ["render", "props"])
@@ -2037,14 +2045,14 @@ const ha = xt(
2037
2045
  ...C.original.items.length >= 3 ? [`and ${C.original.items.length - 3} more items`] : []
2038
2046
  ].join(", ")), 1),
2039
2047
  i("div", cn, [
2040
- _($(Me), {
2048
+ _($(Re), {
2041
2049
  render: (te = (De = (xe = T.ref) == null ? void 0 : xe.column) == null ? void 0 : De.columnDef) == null ? void 0 : te.cell,
2042
2050
  props: (Te = (Ae = T.ref) == null ? void 0 : Ae.getContext) == null ? void 0 : Te.call(Ae)
2043
2051
  }, null, 8, ["render", "props"])
2044
2052
  ])
2045
2053
  ]),
2046
2054
  i("div", null, [
2047
- _($(Me), {
2055
+ _($(Re), {
2048
2056
  render: (je = (Fe = (we = T.status) == null ? void 0 : we.column) == null ? void 0 : Fe.columnDef) == null ? void 0 : je.cell,
2049
2057
  props: (ge = (ve = T.status) == null ? void 0 : ve.getContext) == null ? void 0 : ge.call(ve)
2050
2058
  }, null, 8, ["render", "props"])
@@ -2074,5 +2082,5 @@ const ha = xt(
2074
2082
  }
2075
2083
  });
2076
2084
  export {
2077
- kn as default
2085
+ Cn as default
2078
2086
  };