@feedmepos/mf-inventory-portal 1.2.50 → 1.2.51

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 (69) hide show
  1. package/dist/{App-DssF0b6P.js → App-BJ_vKOR1.js} +3 -3
  2. package/dist/{ApprovalView-DTCayLqE.js → ApprovalView-B_prTTtl.js} +5 -5
  3. package/dist/{BindingsDialog-C2-THIG0.js → BindingsDialog-BPuKgJIk.js} +2 -2
  4. package/dist/{BindingsPicker-Q9W92GzO.js → BindingsPicker-Dv_cmEil.js} +2 -2
  5. package/dist/{BindingsTable-BQo8HpbF.js → BindingsTable-BNSfYRfq.js} +3 -3
  6. package/dist/{ClosingDraftView-B0spMbZd.js → ClosingDraftView-C78tcaJ3.js} +391 -404
  7. package/dist/{ClosingHistoryView-DDVibMzL.js → ClosingHistoryView-DY8liEk3.js} +3 -3
  8. package/dist/{ClosingTemplateView-BSiNTpkH.js → ClosingTemplateView-pJXEcrjO.js} +14 -14
  9. package/dist/{DeliveryOrderPrintPreview-P9JASYcM.js → DeliveryOrderPrintPreview-Bu_l-kxu.js} +1 -1
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DkvLYf5A.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Dgibb-Fh.js} +4 -4
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CaQq9jpc.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DHe5G3kX.js} +2 -2
  12. package/dist/{FmMultiselectDialog-DKEGwdyz.js → FmMultiselectDialog-C3iCMK5I.js} +1 -1
  13. package/dist/{FmMultiselectDialog-BgLyRNeD.js → FmMultiselectDialog-CDONDKxE.js} +2 -2
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-H5xYFc6B.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CefvebOx.js} +3 -3
  15. package/dist/{ImportView-CKg0Z3Bz.js → ImportView-JrenRgiI.js} +6 -6
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-y1qeqeUV.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CSdxodp6.js} +1 -1
  17. package/dist/{IngredientGroupView-DntDNlVX.js → IngredientGroupView-aDFq_ZDh.js} +5 -5
  18. package/dist/{IngredientsView-B93tavZW.js → IngredientsView-DSh3UqDg.js} +14 -14
  19. package/dist/{IntegrationView-CqEe7SWR.js → IntegrationView-KhZ78uxM.js} +12 -12
  20. package/dist/{InventoryBindingForm-9E3VsD4v.js → InventoryBindingForm-DZu0CZYh.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Dgy_eFxJ.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-YuCn0irA.js} +4 -4
  22. package/dist/{InventoryBindingSummary-DTcoWk_n.js → InventoryBindingSummary-DZxLhZ_-.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CIDw4WOz.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DAwpZY3n.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Dao7XifY.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CPDxwz-V.js} +2 -2
  25. package/dist/{PublishView-GDJsOfeY.js → PublishView-CLnQ7NBN.js} +3 -3
  26. package/dist/{PurchaseOrderPrintPreview-DFeZT5Zi.js → PurchaseOrderPrintPreview-DiBztBma.js} +1 -1
  27. package/dist/{ReceiveRequestView-BvYpGKEB.js → ReceiveRequestView-_TOSnDGJ.js} +18 -18
  28. package/dist/{RecipeView-DyJs2lsk.js → RecipeView-BPIMvoTw.js} +8 -8
  29. package/dist/{StockView-Cvwfcsf7.js → StockView-CI8MUJay.js} +15 -15
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CMFiW6FL.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DEBHEMkh.js} +1 -1
  31. package/dist/{SupplierView-C6rIxQOg.js → SupplierView-COihDMNY.js} +11 -11
  32. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-6C5vAumx.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-D-c0Ayis.js} +2 -2
  33. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bc0MVyK_.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D8vbPlie.js} +1 -1
  34. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BSNIRZx3.js → TransferDetails.vue_vue_type_script_setup_true_lang-BVuuw11z.js} +599 -598
  35. package/dist/{TransferTemplateView-BVRXLZGK.js → TransferTemplateView-B2NNfrEq.js} +15 -15
  36. package/dist/{UnitView-B9n1vDtN.js → UnitView-ZsbM07hw.js} +6 -6
  37. package/dist/{WarehouseView-oyEVpI9M.js → WarehouseView-Cd5RFu5v.js} +5 -5
  38. package/dist/{WastageTemplateView-DCdR4fhu.js → WastageTemplateView-DpikyyZW.js} +14 -14
  39. package/dist/{app-_hCz0958.js → app-CySQTQxj.js} +7 -7
  40. package/dist/app.js +1 -1
  41. package/dist/{closing-template-y0kvKjaN.js → closing-template-DXGjC5AG.js} +1 -1
  42. package/dist/{date2-Ct3mwV73.js → date2-BWoUn1K_.js} +1 -1
  43. package/dist/{dayjs.min-iDh15Qvq.js → dayjs.min-cMW8olEu.js} +1 -1
  44. package/dist/{decimal-DliTT0vp.js → decimal-8BRzZQU6.js} +2 -2
  45. package/dist/{defineDeepModel-DmVg-VGa.js → defineDeepModel-AsUZ-DyW.js} +1 -1
  46. package/dist/{duplicate-template-BO8LvPWq.js → duplicate-template-CyHfZR3S.js} +1 -1
  47. package/dist/{feature-Dk3_0hiC.js → feature-Dm0FnWf9.js} +47 -40
  48. package/dist/{format-time-from-id-DOmxxVYQ.js → format-time-from-id-C9lmv5BP.js} +1 -1
  49. package/dist/{format-unit-display-BuliV6Fn.js → format-unit-display-BV8pJisO.js} +10 -10
  50. package/dist/{import-export.helper-DpWf4zh7.js → import-export.helper-Djxw_H5S.js} +5 -5
  51. package/dist/{index-BZ9fyZbO.js → index-8hCa5_Gb.js} +1 -1
  52. package/dist/{index-C6nEuFpg.js → index-D6u3kywf.js} +1 -1
  53. package/dist/{index-CY6-px7W.js → index-DidYtgNc.js} +3 -3
  54. package/dist/{lodash-DDMf37Aw.js → lodash-CW_Ea6mA.js} +1 -1
  55. package/dist/{netsuite-CVg13Lx5.js → netsuite-BEto-z0v.js} +3 -3
  56. package/dist/{purchase-order-template-C9GqlQL3.js → purchase-order-template-BTzjcgrO.js} +1 -1
  57. package/dist/{rules-9-OxHCjJ.js → rules-DkVWS5mF.js} +3 -3
  58. package/dist/{stock-CjJKvKsB.js → stock-CHw8pI8V.js} +3 -3
  59. package/dist/{stock-D7gYQHth.js → stock-D8hLHgeN.js} +1 -1
  60. package/dist/stores/feature.d.ts +2 -0
  61. package/dist/{supplier-z1X1B4yZ.js → supplier-Dv83IfQr.js} +2 -2
  62. package/dist/tsconfig.app.tsbuildinfo +1 -1
  63. package/dist/{use-ingredient-select-dialog-B4u8ttOK.js → use-ingredient-select-dialog-CJjd4g-6.js} +2 -2
  64. package/dist/{use-inventory-binding-dialog-CaFu9DlH.js → use-inventory-binding-dialog-D4g79p5S.js} +2 -2
  65. package/dist/{use-template-enabled-locations-2-KQU0hLX3.js → use-template-enabled-locations-2-Cg2iqQdq.js} +2 -2
  66. package/dist/{vue-i18n-UG5lCeUG.js → vue-i18n-kUcLfpvT.js} +2 -2
  67. package/dist/{xlsx-INrtkMe5.js → xlsx-BjeMbhDF.js} +1 -1
  68. package/dist/{xlsx.util-OqI8IJfw.js → xlsx.util-9eMlJfd9.js} +1 -1
  69. package/package.json +3 -3
@@ -1,20 +1,20 @@
1
- import { defineComponent as Te, ref as q, computed as V, onMounted as Xe, resolveComponent as K, openBlock as x, createElementBlock as P, Fragment as ie, createTextVNode as ce, createBlock as ue, withCtx as Y, createElementVNode as n, toDisplayString as X, unref as v, createVNode as k, createCommentVNode as te, h as F, watch as Ne, renderList as Ce, reactive as Vt, isRef as gt, normalizeClass as $e, normalizeStyle as bt, Teleport as Mt, mergeProps as Lt } from "vue";
2
- import { F as Ze, u as Nt, _ as Et } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
1
+ import { defineComponent as Te, ref as Q, computed as V, onMounted as Je, resolveComponent as K, openBlock as x, createElementBlock as P, Fragment as ie, createTextVNode as ce, createBlock as me, withCtx as q, createElementVNode as n, toDisplayString as X, unref as v, createVNode as k, createCommentVNode as ne, h as F, watch as Ne, renderList as Ce, reactive as Vt, isRef as gt, normalizeClass as $e, normalizeStyle as bt, Teleport as Mt, mergeProps as Lt } from "vue";
2
+ import { F as vt, u as Nt, _ as Et } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
3
3
  import { useCoreStore as ht, useI18n as kt } from "@feedmepos/mf-common";
4
- import { useSnackbar as et, useDialog as zt, components as be, useProxiedModel as Ht, useBreakpoints as Ot } from "@feedmepos/ui-library";
5
- import { o as Kt, u as Ye, I as W, s as H, J as _t, K as he, A as Ee, v as ze, c as Yt, a as xt } from "./app-_hCz0958.js";
4
+ import { useSnackbar as Xe, useDialog as zt, components as be, useProxiedModel as Ht, useBreakpoints as Ot } from "@feedmepos/ui-library";
5
+ import { o as Kt, u as Ye, I as Z, s as z, J as _t, K as he, A as Ee, v as ze, c as Yt, a as xt } from "./app-CySQTQxj.js";
6
6
  import { defineStore as Dt, storeToRefs as Qt } from "pinia";
7
- import { d as Oe, e as At, f as qt, a as De } from "./date2-Ct3mwV73.js";
8
- import { R as Gt, f as tt, a as Je, t as Wt, d as Be, o as wt, p as St, m as Ft, l as Zt } from "./rules-9-OxHCjJ.js";
9
- import { b as Jt, d as Xt } from "./xlsx.util-OqI8IJfw.js";
10
- import { u as Ct } from "./stock-CjJKvKsB.js";
11
- import { u as at } from "./stock-D7gYQHth.js";
7
+ import { d as Oe, e as At, f as qt, a as De } from "./date2-BWoUn1K_.js";
8
+ import { R as Gt, f as et, a as Ze, t as Wt, d as Be, o as wt, p as St, m as Ft, l as Zt } from "./rules-DkVWS5mF.js";
9
+ import { b as Jt, d as Xt } from "./xlsx.util-9eMlJfd9.js";
10
+ import { u as Ct } from "./stock-CHw8pI8V.js";
11
+ import { u as tt } from "./stock-D8hLHgeN.js";
12
12
  import { D as yt, R as Fe } from "./row-action.enum-BcW_L_nE.js";
13
13
  import { c as ea, _ as ta, F as Le } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
14
- import { f as aa } from "./format-time-from-id-DOmxxVYQ.js";
15
- import { _ as na } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CaQq9jpc.js";
14
+ import { f as aa } from "./format-time-from-id-C9lmv5BP.js";
15
+ import { _ as na } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DHe5G3kX.js";
16
16
  import { E as oa } from "./empty-placeholder-wf6-BWE8.js";
17
- import { u as sa } from "./vue-i18n-UG5lCeUG.js";
17
+ import { u as sa } from "./vue-i18n-kUcLfpvT.js";
18
18
  const Qe = Kt((c, o) => {
19
19
  function e() {
20
20
  return Ye().currentLocation.dbName;
@@ -60,33 +60,33 @@ const Qe = Kt((c, o) => {
60
60
  onFinished: { type: Function }
61
61
  },
62
62
  setup(c) {
63
- const o = c, e = q(), d = Qe(), h = et(), g = q(!1), f = q(null), M = q(!1), U = V(() => {
63
+ const o = c, e = Q(), d = Qe(), h = Xe(), g = Q(!1), f = Q(null), M = Q(!1), U = V(() => {
64
64
  switch (o.action) {
65
- case W.enum.approveDraft:
65
+ case Z.enum.approveDraft:
66
66
  return "Approve";
67
- case W.enum.rejectDraft:
67
+ case Z.enum.rejectDraft:
68
68
  return "Reject";
69
- case W.enum.markAsFailed:
69
+ case Z.enum.markAsFailed:
70
70
  return "Mark as Failed";
71
71
  }
72
72
  throw new Error(`Unknown action: ${o.action}`);
73
73
  }), R = V(() => {
74
74
  switch (o.action) {
75
- case W.enum.approveDraft:
75
+ case Z.enum.approveDraft:
76
76
  return "primary";
77
- case W.enum.rejectDraft:
77
+ case Z.enum.rejectDraft:
78
78
  return "destructive";
79
- case W.enum.markAsFailed:
79
+ case Z.enum.markAsFailed:
80
80
  return "destructive";
81
81
  }
82
82
  throw new Error(`Unknown action: ${o.action}`);
83
83
  });
84
- Xe(() => {
84
+ Je(() => {
85
85
  if (o.draft.effectiveAt)
86
86
  f.value = new Date(o.draft.effectiveAt);
87
87
  else {
88
- const s = new Date(o.draft.createdAt);
89
- s.setHours(23, 59, 59, 999), f.value = s;
88
+ const r = new Date(o.draft.createdAt);
89
+ r.setHours(23, 59, 59, 999), f.value = r;
90
90
  }
91
91
  M.value = !0;
92
92
  });
@@ -94,9 +94,9 @@ const Qe = Kt((c, o) => {
94
94
  get() {
95
95
  return f.value === null ? "" : Oe(f.value);
96
96
  },
97
- set(s) {
98
- if (s) {
99
- const t = /* @__PURE__ */ new Date(`${s} ${E.value}`);
97
+ set(r) {
98
+ if (r) {
99
+ const t = /* @__PURE__ */ new Date(`${r} ${E.value}`);
100
100
  t.setSeconds(59, 999), f.value = t;
101
101
  } else
102
102
  f.value = null;
@@ -105,18 +105,18 @@ const Qe = Kt((c, o) => {
105
105
  get() {
106
106
  return f.value === null ? "" : At(f.value);
107
107
  },
108
- set(s) {
109
- if (s) {
110
- const t = /* @__PURE__ */ new Date(`${_.value} ${s}`);
108
+ set(r) {
109
+ if (r) {
110
+ const t = /* @__PURE__ */ new Date(`${_.value} ${r}`);
111
111
  t.setSeconds(59, 999), f.value = t;
112
112
  } else
113
113
  f.value = null;
114
114
  }
115
115
  }), j = V(() => f.value ? f.value.getTime() > (/* @__PURE__ */ new Date()).getTime() : !1);
116
- async function G(s) {
116
+ async function G(r) {
117
117
  g.value = !0;
118
118
  try {
119
- s ? await d.runOperationV1({
119
+ r ? await d.runOperationV1({
120
120
  _id: o.draft._id,
121
121
  _rev: o.draft._rev ?? "",
122
122
  action: o.action,
@@ -147,71 +147,58 @@ const Qe = Kt((c, o) => {
147
147
  g.value = !1;
148
148
  }
149
149
  }
150
- return (s, t) => {
151
- const C = K("FmLabel"), I = K("FmDatePicker"), Z = K("FmTimePicker"), y = K("FmTextField"), l = K("FmButton"), $ = K("FmForm");
152
- return M.value ? (x(), ue($, {
150
+ return (r, t) => {
151
+ const C = K("FmLabel"), I = K("FmDatePicker"), W = K("FmTimePicker"), y = K("FmTextField"), i = K("FmButton"), $ = K("FmForm");
152
+ return M.value ? (x(), me($, {
153
153
  key: 1,
154
154
  onValidationSuccess: G,
155
155
  class: "flex flex-col gap-32",
156
156
  disabled: g.value
157
157
  }, {
158
- default: Y(() => [
158
+ default: q(() => [
159
159
  n("div", ra, [
160
- t[5] || (t[5] = ce(" You are about to ")),
160
+ t[4] || (t[4] = ce(" You are about to ")),
161
161
  n("span", la, X(U.value), 1),
162
- t[6] || (t[6] = ce(" this draft. Please provide a remark to justify this action. "))
162
+ t[5] || (t[5] = ce(" this draft. Please provide a remark to justify this action. "))
163
163
  ]),
164
- s.action === v(W).enum.approveDraft ? (x(), P("div", ia, [
164
+ r.action === v(Z).enum.approveDraft ? (x(), P("div", ia, [
165
165
  k(C, { class: "fm-typo-en-body-lg-600" }, {
166
- default: Y(() => t[7] || (t[7] = [
166
+ default: q(() => t[6] || (t[6] = [
167
167
  ce("Closing Date")
168
168
  ])),
169
169
  _: 1
170
170
  }),
171
171
  k(I, {
172
172
  modelValue: _.value,
173
- "onUpdate:modelValue": t[0] || (t[0] = (z) => _.value = z),
173
+ "onUpdate:modelValue": t[0] || (t[0] = (H) => _.value = H),
174
174
  max: v(Oe)(/* @__PURE__ */ new Date())
175
175
  }, null, 8, ["modelValue", "max"]),
176
176
  k(C, { class: "fm-typo-en-body-lg-600" }, {
177
- default: Y(() => t[8] || (t[8] = [
177
+ default: q(() => t[7] || (t[7] = [
178
178
  ce("Closing Time")
179
179
  ])),
180
180
  _: 1
181
181
  }),
182
- k(Z, {
182
+ k(W, {
183
183
  modelValue: E.value,
184
- "onUpdate:modelValue": t[1] || (t[1] = (z) => E.value = z)
184
+ "onUpdate:modelValue": t[1] || (t[1] = (H) => E.value = H)
185
185
  }, null, 8, ["modelValue"]),
186
- j.value ? (x(), P("div", ca, " Cannot select future date ")) : te("", !0)
187
- ])) : te("", !0),
186
+ j.value ? (x(), P("div", ca, " Cannot select future date ")) : ne("", !0)
187
+ ])) : ne("", !0),
188
188
  k(y, {
189
189
  modelValue: e.value,
190
- "onUpdate:modelValue": t[2] || (t[2] = (z) => e.value = z),
190
+ "onUpdate:modelValue": t[2] || (t[2] = (H) => e.value = H),
191
191
  label: "Remark",
192
192
  "label-mark": "required",
193
193
  rules: [v(Gt)()]
194
194
  }, null, 8, ["modelValue", "rules"]),
195
195
  n("div", ua, [
196
- k(l, {
196
+ k(i, {
197
197
  label: "Cancel",
198
198
  variant: "tertiary",
199
- onClick: t[3] || (t[3] = (z) => s.onCancel())
199
+ onClick: t[3] || (t[3] = (H) => r.onCancel())
200
200
  }),
201
- s.action === v(W).enum.approveDraft ? (x(), ue(Ze, { key: 0 }, {
202
- default: Y(() => [
203
- k(l, {
204
- label: "Approve (Legacy)",
205
- type: "button",
206
- onClick: t[4] || (t[4] = (z) => G(!0)),
207
- variant: R.value,
208
- loading: g.value,
209
- disabled: j.value
210
- }, null, 8, ["variant", "loading", "disabled"])
211
- ]),
212
- _: 1
213
- })) : te("", !0),
214
- k(l, {
201
+ k(i, {
215
202
  label: U.value,
216
203
  type: "submit",
217
204
  variant: R.value,
@@ -229,49 +216,49 @@ const Qe = Kt((c, o) => {
229
216
  function $t(c) {
230
217
  const o = c.measurementsAmounts.groupBy((d) => d.measurement.id), e = c.sku.unit.measurements.reduce((d, h) => {
231
218
  var M, U;
232
- const g = ((U = (M = o.get(h.id)) == null ? void 0 : M[0]) == null ? void 0 : U.amount) ?? da, f = tt(h.conversion, g);
233
- return d + +Je(f);
234
- }, +Je(c.baseAmount));
219
+ const g = ((U = (M = o.get(h.id)) == null ? void 0 : M[0]) == null ? void 0 : U.amount) ?? da, f = et(h.conversion, g);
220
+ return d + +Ze(f);
221
+ }, +Ze(c.baseAmount));
235
222
  return Wt(e, c.baseAmount.precision);
236
223
  }
237
224
  const ma = Be(0), fa = Be(100), Bt = "N/A";
238
225
  function pa(c, o, e, d, h, g) {
239
- var ae, oe, w, ee, de;
226
+ var te, oe, w, ee, ue;
240
227
  const f = $t(c), M = d ?? f, U = wt(M, o), R = o.amount === 0 ? null : St(U, {
241
228
  ...o,
242
229
  amount: Math.abs(o.amount)
243
- }), _ = R ? tt(R, fa) : null, E = ((ae = c.sku.defaultCost) == null ? void 0 : ae.costPerUnit) ?? { amount: 0, precision: 0 }, j = Number(H.toFormatString({ value: E })), G = ((w = (oe = c.sku.defaultCost) == null ? void 0 : oe.measurement) == null ? void 0 : w.conversion) ?? {
230
+ }), _ = R ? et(R, fa) : null, E = ((te = c.sku.defaultCost) == null ? void 0 : te.costPerUnit) ?? { amount: 0, precision: 0 }, j = Number(z.toFormatString({ value: E })), G = ((w = (oe = c.sku.defaultCost) == null ? void 0 : oe.measurement) == null ? void 0 : w.conversion) ?? {
244
231
  amount: 1,
245
232
  precision: 0
246
- }, s = Number(
247
- H.toFormatString({ value: G })
248
- ), t = h ? Number(H.toFormatString({ value: h })) : 0, C = Number(H.toFormatString({ value: o })), I = Number(H.toFormatString({ value: M })), Z = C - I, y = Z * j / s, l = I * j / s, $ = C * j / s;
233
+ }, r = Number(
234
+ z.toFormatString({ value: G })
235
+ ), t = h ? Number(z.toFormatString({ value: h })) : 0, C = Number(z.toFormatString({ value: o })), I = Number(z.toFormatString({ value: M })), W = C - I, y = W * j / r, i = I * j / r, $ = C * j / r;
249
236
  return {
250
237
  code: c.sku.code,
251
238
  name: c.sku.name,
252
239
  baseUnit: c.sku.unit.abbrev,
253
- costUnit: ((de = (ee = c.sku.defaultCost) == null ? void 0 : ee.measurement) == null ? void 0 : de.abbrev) ?? null,
254
- baseUnitAmount: Number(H.toFormatString({ value: c.baseAmount })),
240
+ costUnit: ((ue = (ee = c.sku.defaultCost) == null ? void 0 : ee.measurement) == null ? void 0 : ue.abbrev) ?? null,
241
+ baseUnitAmount: Number(z.toFormatString({ value: c.baseAmount })),
255
242
  ...c.measurementsAmounts.filter(
256
243
  (A) => va(A.measurement) && e.includes(A.measurement.id)
257
244
  ).reduce(
258
- (A, D, J) => (A[`measurementAbbrev${J}`] = `(${D.measurement.abbrev}) × ${H.toFormatString({ value: D.measurement.conversion })}`, A[`measurementAmount${J}`] = Number(H.toFormatString({ value: D.amount })), A),
245
+ (A, D, J) => (A[`measurementAbbrev${J}`] = `(${D.measurement.abbrev}) × ${z.toFormatString({ value: D.measurement.conversion })}`, A[`measurementAmount${J}`] = Number(z.toFormatString({ value: D.amount })), A),
259
246
  {}
260
247
  ),
261
248
  systemBalance: C,
262
249
  physicalBalance: I,
263
- adjustedAmount: Number(H.toFormatString({ value: U })),
250
+ adjustedAmount: Number(z.toFormatString({ value: U })),
264
251
  adjustedDiffPercentage: _ ? Number(
265
- H.toFormatString({
252
+ z.toFormatString({
266
253
  value: Ft(_, 2)
267
254
  })
268
255
  ) : null,
269
256
  costPerUnit: j,
270
257
  opening: t,
271
258
  adjustmentTypes: g ?? Bt,
272
- varianceQty: Z,
259
+ varianceQty: W,
273
260
  varianceInCost: y,
274
- stockTakeValue: l,
261
+ stockTakeValue: i,
275
262
  systemValue: $
276
263
  };
277
264
  }
@@ -374,7 +361,7 @@ function ga(c) {
374
361
  ];
375
362
  }
376
363
  function ba(c, o, e) {
377
- var Z, y, l, $, z, ae, oe;
364
+ var W, y, i, $, H, te, oe;
378
365
  const d = o.groupBy(
379
366
  (w) => w.id,
380
367
  (w) => w.balance
@@ -393,31 +380,31 @@ function ba(c, o, e) {
393
380
  }
394
381
  const M = [...c.items, ...c.negativeStockItems ?? []], U = Tt(M), R = M.map((w) => {
395
382
  var J, O, re;
396
- const ee = ((J = d.get(w.sku._id)) == null ? void 0 : J[0]) ?? ma, de = ((O = U == null ? void 0 : U.get(w.sku._id)) == null ? void 0 : O[0]) ?? [], A = g.get(w.sku._id), D = f.get(w.sku._id);
383
+ const ee = ((J = d.get(w.sku._id)) == null ? void 0 : J[0]) ?? ma, ue = ((O = U == null ? void 0 : U.get(w.sku._id)) == null ? void 0 : O[0]) ?? [], A = g.get(w.sku._id), D = f.get(w.sku._id);
397
384
  return pa(
398
385
  w,
399
386
  ee,
400
- de,
387
+ ue,
401
388
  (re = h.get(w.sku._id)) == null ? void 0 : re[0],
402
389
  A,
403
390
  D
404
391
  );
405
- }), _ = ya(M), j = ht().currentBusiness.value, G = ga(_), s = [
392
+ }), _ = ya(M), j = ht().currentBusiness.value, G = ga(_), r = [
406
393
  ["Business name:", j == null ? void 0 : j.name],
407
394
  ["Business ID:", j == null ? void 0 : j._id],
408
395
  ["Menu version", j == null ? void 0 : j.menuVersion],
409
396
  ["Created at", new Date(c.createdAt)],
410
- ["Created by", (Z = c.createdBy) == null ? void 0 : Z.name],
397
+ ["Created by", (W = c.createdBy) == null ? void 0 : W.name],
411
398
  ["Updated at", new Date(c.updatedAt)],
412
399
  ["Updated by", (y = c.updatedBy) == null ? void 0 : y.name],
413
400
  ["Recent action", c.approvedAt ? "Approve" : c.rejectionHistory ? "Reject" : ""],
414
401
  [
415
402
  "Action by",
416
- c.approvedAt ? (l = c.approvedBy) == null ? void 0 : l.name : c.rejectionHistory ? (z = ($ = c.rejectionHistory[0]) == null ? void 0 : $.rejectedBy) == null ? void 0 : z.name : ""
403
+ c.approvedAt ? (i = c.approvedBy) == null ? void 0 : i.name : c.rejectionHistory ? (H = ($ = c.rejectionHistory[0]) == null ? void 0 : $.rejectedBy) == null ? void 0 : H.name : ""
417
404
  ],
418
405
  [
419
406
  "Action at",
420
- c.approvedAt ? new Date(c.approvedAt) : c.rejectionHistory ? new Date((ae = c.rejectionHistory[0]) == null ? void 0 : ae.rejectedAt) : ""
407
+ c.approvedAt ? new Date(c.approvedAt) : c.rejectionHistory ? new Date((te = c.rejectionHistory[0]) == null ? void 0 : te.rejectedAt) : ""
421
408
  ],
422
409
  [
423
410
  "Action remark",
@@ -426,7 +413,7 @@ function ba(c, o, e) {
426
413
  [],
427
414
  G.map((w) => w.name),
428
415
  ...R.map((w) => G.map((ee) => w[ee.id]))
429
- ], t = G.map((w) => `system:${w.id}`), C = Jt(s, t), I = `[${j == null ? void 0 : j.name}] closing draft (${qt(new Date(c.updatedAt))}).xlsx`;
416
+ ], t = G.map((w) => `system:${w.id}`), C = Jt(r, t), I = `[${j == null ? void 0 : j.name}] closing draft (${qt(new Date(c.updatedAt))}).xlsx`;
430
417
  return Xt(C, I), I;
431
418
  }
432
419
  const ha = { class: "flex flex-col" }, ka = {
@@ -441,9 +428,9 @@ const ha = { class: "flex flex-col" }, ka = {
441
428
  },
442
429
  setup(c) {
443
430
  const o = c;
444
- at();
445
- const e = q(!1), d = q(null), h = q(!1);
446
- Xe(() => {
431
+ tt();
432
+ const e = Q(!1), d = Q(null), h = Q(!1);
433
+ Je(() => {
447
434
  if (o.draft.effectiveAt)
448
435
  d.value = new Date(o.draft.effectiveAt);
449
436
  else {
@@ -479,14 +466,14 @@ const ha = { class: "flex flex-col" }, ka = {
479
466
  e.value = !0, o.onFinished(d.value.toISOString());
480
467
  }
481
468
  return (R, _) => {
482
- const E = K("FmLabel"), j = K("FmDatePicker"), G = K("FmTimePicker"), s = K("FmButton"), t = K("FmForm");
483
- return h.value ? (x(), ue(t, {
469
+ const E = K("FmLabel"), j = K("FmDatePicker"), G = K("FmTimePicker"), r = K("FmButton"), t = K("FmForm");
470
+ return h.value ? (x(), me(t, {
484
471
  key: 1,
485
472
  onValidationSuccess: U,
486
473
  class: "flex flex-col gap-32",
487
474
  disabled: e.value
488
475
  }, {
489
- default: Y(() => [
476
+ default: q(() => [
490
477
  _[5] || (_[5] = n("div", { class: "fm-typo-en-body-lg-400" }, [
491
478
  n("p", null, [
492
479
  ce(" Performing "),
@@ -501,7 +488,7 @@ const ha = { class: "flex flex-col" }, ka = {
501
488
  ], -1)),
502
489
  n("div", ha, [
503
490
  k(E, { class: "fm-typo-en-body-lg-600" }, {
504
- default: Y(() => _[3] || (_[3] = [
491
+ default: q(() => _[3] || (_[3] = [
505
492
  ce("Closing Date")
506
493
  ])),
507
494
  _: 1
@@ -512,7 +499,7 @@ const ha = { class: "flex flex-col" }, ka = {
512
499
  max: v(Oe)(/* @__PURE__ */ new Date())
513
500
  }, null, 8, ["modelValue", "max"]),
514
501
  k(E, { class: "fm-typo-en-body-lg-600" }, {
515
- default: Y(() => _[4] || (_[4] = [
502
+ default: q(() => _[4] || (_[4] = [
516
503
  ce("Closing Time")
517
504
  ])),
518
505
  _: 1
@@ -521,15 +508,15 @@ const ha = { class: "flex flex-col" }, ka = {
521
508
  modelValue: f.value,
522
509
  "onUpdate:modelValue": _[1] || (_[1] = (C) => f.value = C)
523
510
  }, null, 8, ["modelValue"]),
524
- M.value ? (x(), P("div", ka, " Cannot select future date ")) : te("", !0)
511
+ M.value ? (x(), P("div", ka, " Cannot select future date ")) : ne("", !0)
525
512
  ]),
526
513
  n("div", _a, [
527
- k(s, {
514
+ k(r, {
528
515
  label: "Cancel",
529
516
  variant: "tertiary",
530
517
  onClick: _[2] || (_[2] = (C) => R.onCancel())
531
518
  }),
532
- k(s, {
519
+ k(r, {
533
520
  label: "Refresh balance",
534
521
  type: "submit",
535
522
  variant: "primary",
@@ -547,18 +534,18 @@ const ha = { class: "flex flex-col" }, ka = {
547
534
  }), Ke = Dt(
548
535
  "closingDraftActions",
549
536
  function() {
550
- const o = zt(), e = et(), d = at(), h = Qe(), g = Ct(), f = q(!1), M = q();
537
+ const o = zt(), e = Xe(), d = tt(), h = Qe(), g = Ct(), f = Q(!1), M = Q();
551
538
  function U(y) {
552
- const l = {
539
+ const i = {
553
540
  draft: y
554
541
  };
555
- M.value = l, f.value = !0;
542
+ M.value = i, f.value = !0;
556
543
  }
557
544
  async function R(y) {
558
545
  var $;
559
546
  if (y.status === he.enum.COMPLETED) {
560
- const z = y.closingAdjustmentId;
561
- if (!z)
547
+ const H = y.closingAdjustmentId;
548
+ if (!H)
562
549
  return e.open({
563
550
  title: "Something went wrong",
564
551
  message: "Closing draft is completed but closing document cannot be found.",
@@ -566,8 +553,8 @@ const ha = { class: "flex flex-col" }, ka = {
566
553
  }), console.error("Closing draft is completed but closing document cannot be found.", {
567
554
  draftId: y._id
568
555
  }), [];
569
- const ae = await d.readAdjustmentById(z);
570
- return ((ae == null ? void 0 : ae.skus) ?? []).map((w) => ({
556
+ const te = await d.readAdjustmentById(H);
557
+ return ((te == null ? void 0 : te.skus) ?? []).map((w) => ({
571
558
  id: w.sku._id,
572
559
  balance: w.fromBalance,
573
560
  costs: w.fromCostBalances
@@ -575,21 +562,21 @@ const ha = { class: "flex flex-col" }, ka = {
575
562
  } else
576
563
  return await g.readStockBalance(), (($ = g.stockBalance) == null ? void 0 : $.skus) ?? [];
577
564
  }
578
- async function _(y, l, $) {
579
- l || (e.open({
565
+ async function _(y, i, $) {
566
+ i || (e.open({
580
567
  title: "Exporting",
581
568
  message: "Fetching data..."
582
- }), l = await R(y)), ba(y, l, $ ?? []);
569
+ }), i = await R(y)), ba(y, i, $ ?? []);
583
570
  }
584
- function E(y, l, $) {
571
+ function E(y, i, $) {
585
572
  o.open({
586
573
  title: "Approve draft",
587
574
  contentComponent: We,
588
575
  contentComponentProps: {
589
576
  draft: y,
590
- action: W.enum.approveDraft,
577
+ action: Z.enum.approveDraft,
591
578
  onFinished: () => {
592
- o.close(), l == null || l();
579
+ o.close(), i == null || i();
593
580
  },
594
581
  onCancel: () => {
595
582
  o.close();
@@ -599,39 +586,39 @@ const ha = { class: "flex flex-col" }, ka = {
599
586
  $ == null || $();
600
587
  });
601
588
  }
602
- function j(y, l) {
589
+ function j(y, i) {
603
590
  o.open({
604
591
  title: "Reject draft",
605
592
  contentComponent: We,
606
593
  contentComponentProps: {
607
594
  draft: y,
608
- action: W.enum.rejectDraft,
595
+ action: Z.enum.rejectDraft,
609
596
  onFinished: () => {
610
- o.close(), l == null || l();
597
+ o.close(), i == null || i();
611
598
  },
612
599
  onCancel: () => o.close()
613
600
  }
614
601
  });
615
602
  }
616
- function G(y, l) {
603
+ function G(y, i) {
617
604
  o.open({
618
605
  title: "Mark draft as failed",
619
606
  contentComponent: We,
620
607
  contentComponentProps: {
621
608
  draft: y,
622
- action: W.enum.markAsFailed,
609
+ action: Z.enum.markAsFailed,
623
610
  onFinished: () => {
624
- o.close(), l == null || l();
611
+ o.close(), i == null || i();
625
612
  },
626
613
  onCancel: () => o.close()
627
614
  }
628
615
  });
629
616
  }
630
- async function s(y, l) {
617
+ async function r(y, i) {
631
618
  await h.sync({
632
619
  _id: y._id,
633
620
  _rev: y._rev ?? "",
634
- action: W.enum.approveDraft,
621
+ action: Z.enum.approveDraft,
635
622
  data: {
636
623
  remark: y.remark ?? ""
637
624
  }
@@ -639,22 +626,22 @@ const ha = { class: "flex flex-col" }, ka = {
639
626
  title: "Success",
640
627
  message: "Sync requested",
641
628
  type: "success"
642
- }), l == null || l();
629
+ }), i == null || i();
643
630
  }
644
631
  function t() {
645
632
  f.value = !1;
646
633
  }
647
- async function C(y, l, $) {
634
+ async function C(y, i, $) {
648
635
  await o.open({
649
636
  title: "Refresh balance",
650
637
  contentComponent: xa,
651
638
  contentComponentProps: {
652
639
  draft: y,
653
- onFinished: (z) => {
654
- o.close(), $ == null || $(z);
640
+ onFinished: (H) => {
641
+ o.close(), $ == null || $(H);
655
642
  },
656
643
  onCancel: async () => {
657
- o.close(), l == null || l();
644
+ o.close(), i == null || i();
658
645
  }
659
646
  }
660
647
  });
@@ -673,7 +660,7 @@ const ha = { class: "flex flex-col" }, ka = {
673
660
  });
674
661
  });
675
662
  }
676
- async function Z(y, l) {
663
+ async function W(y, i) {
677
664
  try {
678
665
  e.open({
679
666
  title: "Cloning",
@@ -682,7 +669,7 @@ const ha = { class: "flex flex-col" }, ka = {
682
669
  title: "Success",
683
670
  message: "Draft cloned successfully",
684
671
  type: "success"
685
- }), l == null || l();
672
+ }), i == null || i();
686
673
  } catch ($) {
687
674
  e.open({
688
675
  title: "Error",
@@ -697,10 +684,10 @@ const ha = { class: "flex flex-col" }, ka = {
697
684
  approveDraft: E,
698
685
  rejectDraft: j,
699
686
  markAsFailed: G,
700
- syncDraft: s,
687
+ syncDraft: r,
701
688
  exportDraft: _,
702
689
  refreshBalance: C,
703
- cloneDraft: Z,
690
+ cloneDraft: W,
704
691
  viewClosingDraftShow: f,
705
692
  viewClosingDraftProps: M,
706
693
  invalidateDraftCache: I
@@ -722,26 +709,26 @@ function He(c) {
722
709
  const Da = Dt(
723
710
  "closingDraftTable",
724
711
  function() {
725
- const { t: o } = kt(), e = ht(), d = Ke(), h = q(new Array()), g = q(!1), f = Ye(), M = Qe();
712
+ const { t: o } = kt(), e = ht(), d = Ke(), h = Q(new Array()), g = Q(!1), f = Ye(), M = Qe();
726
713
  async function U() {
727
714
  if (h.value = [], !!f._currentLocation) {
728
715
  g.value = !0;
729
716
  try {
730
- const [s] = await Promise.all([M.readDrafts()]).delayed(1e3);
731
- h.value = s.reverse();
732
- } catch (s) {
733
- console.log("Something went wrong when fetching drafts:", s);
717
+ const [r] = await Promise.all([M.readDrafts()]).delayed(1e3);
718
+ h.value = r.reverse();
719
+ } catch (r) {
720
+ console.log("Something went wrong when fetching drafts:", r);
734
721
  } finally {
735
722
  g.value = !1;
736
723
  }
737
724
  }
738
725
  }
739
- async function R(s) {
726
+ async function R(r) {
740
727
  if (!h.value.find((t) => t._id) && f._currentLocation) {
741
728
  g.value = !0;
742
729
  try {
743
730
  const [t] = await Promise.all([
744
- M.getDraft(s),
731
+ M.getDraft(r),
745
732
  new Promise((C) => setTimeout(C, 1e3))
746
733
  ]);
747
734
  h.value = [t];
@@ -752,26 +739,26 @@ const Da = Dt(
752
739
  }
753
740
  }
754
741
  }
755
- function _(s) {
756
- h.value = h.value.map((t) => t._id === s._id ? {
757
- ...s,
742
+ function _(r) {
743
+ h.value = h.value.map((t) => t._id === r._id ? {
744
+ ...r,
758
745
  _rev: t._rev
759
746
  } : t);
760
747
  }
761
748
  function E() {
762
749
  d.closeDraftDialog(), U();
763
750
  }
764
- function j(s, t) {
765
- switch (t = Yt(t), s) {
751
+ function j(r, t) {
752
+ switch (t = Yt(t), r) {
766
753
  case Fe.Details:
767
754
  return d.viewDraft(t);
768
755
  case Fe.Export:
769
756
  return d.exportDraft(t);
770
- case W.enum.approveDraft:
757
+ case Z.enum.approveDraft:
771
758
  return d.approveDraft(t, E);
772
- case W.enum.rejectDraft:
759
+ case Z.enum.rejectDraft:
773
760
  return d.rejectDraft(t, E);
774
- case W.enum.markAsFailed:
761
+ case Z.enum.markAsFailed:
775
762
  return d.markAsFailed(t, E);
776
763
  case Fe.Duplicate:
777
764
  return d.cloneDraft(t, E);
@@ -783,17 +770,17 @@ const Da = Dt(
783
770
  id: "_id",
784
771
  accessorKey: "_id",
785
772
  header: () => o("inventory.closing.table.createdAt"),
786
- cell(s) {
787
- return aa(`${s.getValue()}`);
773
+ cell(r) {
774
+ return aa(`${r.getValue()}`);
788
775
  },
789
776
  enableSorting: !0
790
777
  },
791
778
  {
792
779
  accessorKey: "effectiveAt",
793
780
  header: () => "Effective at",
794
- cell(s) {
795
- const t = s.row.original;
796
- let C = s.getValue();
781
+ cell(r) {
782
+ const t = r.row.original;
783
+ let C = r.getValue();
797
784
  return C || (C = Ee(t._id)), De(C);
798
785
  },
799
786
  enableSorting: !0,
@@ -801,7 +788,7 @@ const Da = Dt(
801
788
  },
802
789
  {
803
790
  id: "updatedAt",
804
- accessorFn: (s) => De(s.updatedAt),
791
+ accessorFn: (r) => De(r.updatedAt),
805
792
  header: () => "Updated at",
806
793
  enableSorting: !0,
807
794
  size: 200
@@ -815,9 +802,9 @@ const Da = Dt(
815
802
  },
816
803
  {
817
804
  id: "noOfItems",
818
- accessorFn: (s) => {
805
+ accessorFn: (r) => {
819
806
  var t;
820
- return s.items.length + (((t = s.negativeStockItems) == null ? void 0 : t.length) ?? 0);
807
+ return r.items.length + (((t = r.negativeStockItems) == null ? void 0 : t.length) ?? 0);
821
808
  },
822
809
  header: () => o("inventory.closing.table.noOfItems"),
823
810
  enableSorting: !1,
@@ -828,20 +815,20 @@ const Da = Dt(
828
815
  },
829
816
  {
830
817
  id: "recentRemark",
831
- accessorFn: (s) => {
818
+ accessorFn: (r) => {
832
819
  var t;
833
- return (s == null ? void 0 : s.approveRemark) ?? ((t = s == null ? void 0 : s.rejectionHistory) == null ? void 0 : t.computeFirst((C) => C.rejectRemark)) ?? s.remark;
820
+ return (r == null ? void 0 : r.approveRemark) ?? ((t = r == null ? void 0 : r.rejectionHistory) == null ? void 0 : t.computeFirst((C) => C.rejectRemark)) ?? r.remark;
834
821
  },
835
822
  header: () => "Recent remark"
836
823
  },
837
824
  {
838
825
  id: "status",
839
- accessorFn: (s) => s.status,
826
+ accessorFn: (r) => r.status,
840
827
  header: () => o("inventory.closing.table.status"),
841
828
  enableSorting: !1,
842
- cell(s) {
843
- var l;
844
- const t = s.row.original, C = t.status, I = new Date(t.updatedAt), Z = (l = t == null ? void 0 : t.rejectionHistory) == null ? void 0 : l.computeFirst(($) => $.rejectedAt), y = Z ? new Date(Z) : null;
829
+ cell(r) {
830
+ var i;
831
+ const t = r.row.original, C = t.status, I = new Date(t.updatedAt), W = (i = t == null ? void 0 : t.rejectionHistory) == null ? void 0 : i.computeFirst(($) => $.rejectedAt), y = W ? new Date(W) : null;
845
832
  return C === "DRAFT" && y ? y.getTime() > I.getTime() ? F(
846
833
  "div",
847
834
  {
@@ -883,26 +870,26 @@ const Da = Dt(
883
870
  },
884
871
  {
885
872
  id: "action",
886
- cell(s) {
887
- var l;
888
- const t = s.row.original, C = ((l = e.sessionUser.value) == null ? void 0 : l.role.isAdmin) ?? !1, I = [
873
+ cell(r) {
874
+ var i;
875
+ const t = r.row.original, C = ((i = e.sessionUser.value) == null ? void 0 : i.role.isAdmin) ?? !1, I = [
889
876
  yt[Fe.Details],
890
877
  yt[Fe.Export]
891
- ], Z = [
878
+ ], W = [
892
879
  {
893
880
  translationKey: "inventory.closing.draft.approveDraft",
894
881
  color: "text-fm-color-typo-primary",
895
- value: W.enum.approveDraft
882
+ value: Z.enum.approveDraft
896
883
  },
897
884
  {
898
885
  translationKey: "inventory.closing.draft.rejectDraft",
899
886
  color: "text-fm-color-typo-error",
900
- value: W.enum.rejectDraft
887
+ value: Z.enum.rejectDraft
901
888
  },
902
889
  {
903
890
  translationKey: "inventory.closing.draft.markAsFailed",
904
891
  color: "text-fm-color-typo-error",
905
- value: W.enum.markAsFailed
892
+ value: Z.enum.markAsFailed
906
893
  }
907
894
  ], y = C && t.status !== he.enum.DRAFT ? [
908
895
  {
@@ -914,7 +901,7 @@ const Da = Dt(
914
901
  return ea(
915
902
  [
916
903
  ...I,
917
- ...t.status === he.enum.DRAFT ? Z : []
904
+ ...t.status === he.enum.DRAFT ? W : []
918
905
  ],
919
906
  ($) => j($, t),
920
907
  y
@@ -964,17 +951,17 @@ const Da = Dt(
964
951
  }
965
952
  ), E = V(() => {
966
953
  var J, O, re;
967
- const A = ((J = U.draft) == null ? void 0 : J.items.map((Q) => ({
968
- id: Q.sku._id,
969
- code: Q.sku.code,
970
- name: Q.sku.name
971
- }))) ?? [], D = ((re = (O = U.draft) == null ? void 0 : O.negativeStockItems) == null ? void 0 : re.map((Q) => ({
972
- id: Q.sku._id,
973
- code: Q.sku.code,
974
- name: Q.sku.name
954
+ const A = ((J = U.draft) == null ? void 0 : J.items.map((Y) => ({
955
+ id: Y.sku._id,
956
+ code: Y.sku.code,
957
+ name: Y.sku.name
958
+ }))) ?? [], D = ((re = (O = U.draft) == null ? void 0 : O.negativeStockItems) == null ? void 0 : re.map((Y) => ({
959
+ id: Y.sku._id,
960
+ code: Y.sku.code,
961
+ name: Y.sku.name
975
962
  }))) ?? [];
976
963
  return [...A, ...D].reduce(
977
- (Q, ve) => (Q[ve.id] = ve, Q),
964
+ (Y, ve) => (Y[ve.id] = ve, Y),
978
965
  {}
979
966
  );
980
967
  }), j = V(
@@ -992,31 +979,31 @@ const Da = Dt(
992
979
  ), G = V(() => {
993
980
  var A;
994
981
  return _.value ? ((A = j.value) == null ? void 0 : A.filter((D) => !E.value[D.id]).map((D) => D.id)) ?? [] : [];
995
- }), s = V({
982
+ }), r = V({
996
983
  get: () => U.show,
997
984
  set: (A) => R("update:show", A)
998
- }), t = q(1), C = () => t.value > 1, I = () => t.value > 2, Z = () => !1;
985
+ }), t = Q(1), C = () => t.value > 1, I = () => t.value > 2, W = () => !1;
999
986
  function y(A) {
1000
987
  return A === 1 ? _.value : A === 2 ? G.value.length == 0 : !1;
1001
988
  }
1002
- const l = V(() => !_.value || G.value.length > 0);
989
+ const i = V(() => !_.value || G.value.length > 0);
1003
990
  function $(A) {
1004
991
  let D = A + 1;
1005
992
  for (; D <= 3 && y(D); ) D++;
1006
993
  return D > 3 ? 3 : D;
1007
994
  }
1008
- function z(A) {
995
+ function H(A) {
1009
996
  let D = A - 1;
1010
997
  for (; D >= 1 && y(D); ) D--;
1011
998
  return D < 1 ? 1 : D;
1012
999
  }
1013
- function ae() {
1014
- return _.value ? l.value ? 3 : 2 : 1;
1000
+ function te() {
1001
+ return _.value ? i.value ? 3 : 2 : 1;
1015
1002
  }
1016
1003
  Ne(
1017
1004
  () => U.show,
1018
1005
  (A) => {
1019
- A && (t.value = ae());
1006
+ A && (t.value = te());
1020
1007
  }
1021
1008
  ), Ne(
1022
1009
  () => _.value,
@@ -1036,35 +1023,35 @@ const Da = Dt(
1036
1023
  t.value < 3 && (t.value = $(t.value));
1037
1024
  }
1038
1025
  function ee() {
1039
- t.value > 1 && (t.value = z(t.value));
1026
+ t.value > 1 && (t.value = H(t.value));
1040
1027
  }
1041
- function de() {
1028
+ function ue() {
1042
1029
  R("approve");
1043
1030
  }
1044
1031
  return (A, D) => {
1045
1032
  const J = K("FmIcon");
1046
- return x(), ue(v(h), {
1047
- modelValue: s.value,
1048
- "onUpdate:modelValue": D[1] || (D[1] = (O) => s.value = O),
1033
+ return x(), me(v(h), {
1034
+ modelValue: r.value,
1035
+ "onUpdate:modelValue": D[1] || (D[1] = (O) => r.value = O),
1049
1036
  "max-width": 600
1050
1037
  }, {
1051
- "dialog-header": Y(() => [
1038
+ "dialog-header": q(() => [
1052
1039
  n("div", Aa, X(v(f)("inventory.closing.approval.title")), 1)
1053
1040
  ]),
1054
- default: Y(() => [
1041
+ default: q(() => [
1055
1042
  n("div", wa, [
1056
1043
  k(v(e), {
1057
1044
  modelValue: t.value,
1058
1045
  "onUpdate:modelValue": D[0] || (D[0] = (O) => t.value = O),
1059
1046
  orientation: "vertical"
1060
1047
  }, {
1061
- default: Y(() => [
1048
+ default: q(() => [
1062
1049
  k(v(d), {
1063
1050
  value: 1,
1064
1051
  title: v(f)("inventory.closing.approval.step.generateReport.title"),
1065
1052
  complete: C
1066
1053
  }, {
1067
- default: Y(() => [
1054
+ default: q(() => [
1068
1055
  n("div", Sa, X(v(f)("inventory.closing.approval.step.generateReport.description")), 1),
1069
1056
  t.value === 1 ? (x(), P("div", Fa, [
1070
1057
  k(v(g), {
@@ -1081,7 +1068,7 @@ const Da = Dt(
1081
1068
  onClick: w
1082
1069
  }, null, 8, ["label", "disabled"])
1083
1070
  ])
1084
- ])) : te("", !0)
1071
+ ])) : ne("", !0)
1085
1072
  ]),
1086
1073
  _: 1
1087
1074
  }, 8, ["title"]),
@@ -1091,7 +1078,7 @@ const Da = Dt(
1091
1078
  disabled: () => !_.value,
1092
1079
  complete: I
1093
1080
  }, {
1094
- default: Y(() => [
1081
+ default: q(() => [
1095
1082
  n("div", $a, X(j.value.length > 0 ? `${v(f)("inventory.closing.approval.step.negativeItems.resolveMessage")} [${v(f)("inventory.closing.approval.step.negativeItems.itemsHeader")} (${G.value.length})]` : v(f)("inventory.closing.approval.step.negativeItems.noItemsMessage")), 1),
1096
1083
  t.value === 2 ? (x(), P("div", Ba, [
1097
1084
  j.value.length > 0 ? (x(), P("div", Ta, [
@@ -1118,7 +1105,7 @@ const Da = Dt(
1118
1105
  n("div", Pa, X(O.name), 1)
1119
1106
  ]))), 128))
1120
1107
  ])
1121
- ])) : te("", !0),
1108
+ ])) : ne("", !0),
1122
1109
  n("div", Va, [
1123
1110
  k(v(g), {
1124
1111
  label: v(f)("inventory.common.back"),
@@ -1127,21 +1114,21 @@ const Da = Dt(
1127
1114
  }, null, 8, ["label"]),
1128
1115
  k(v(g), {
1129
1116
  label: v(f)("inventory.common.continue"),
1130
- disabled: l.value,
1117
+ disabled: i.value,
1131
1118
  onClick: w
1132
1119
  }, null, 8, ["label", "disabled"])
1133
1120
  ])
1134
- ])) : te("", !0)
1121
+ ])) : ne("", !0)
1135
1122
  ]),
1136
1123
  _: 1
1137
1124
  }, 8, ["title", "disabled"]),
1138
1125
  k(v(d), {
1139
1126
  value: 3,
1140
1127
  title: v(f)("inventory.closing.approval.step.approval.title"),
1141
- disabled: () => l.value,
1142
- complete: Z
1128
+ disabled: () => i.value,
1129
+ complete: W
1143
1130
  }, {
1144
- default: Y(() => [
1131
+ default: q(() => [
1145
1132
  n("div", Ma, X(v(f)("inventory.closing.approval.step.approval.warning")), 1),
1146
1133
  t.value === 3 ? (x(), P("div", La, [
1147
1134
  k(v(g), {
@@ -1152,11 +1139,11 @@ const Da = Dt(
1152
1139
  k(v(g), {
1153
1140
  label: v(f)("inventory.common.approve"),
1154
1141
  variant: "destructive",
1155
- disabled: l.value,
1142
+ disabled: i.value,
1156
1143
  loading: A.approving,
1157
- onClick: de
1144
+ onClick: ue
1158
1145
  }, null, 8, ["label", "disabled", "loading"])
1159
- ])) : te("", !0)
1146
+ ])) : ne("", !0)
1160
1147
  ]),
1161
1148
  _: 1
1162
1149
  }, 8, ["title", "disabled"])
@@ -1212,29 +1199,29 @@ const Da = Dt(
1212
1199
  return u === "MYR" ? "RM" : u;
1213
1200
  });
1214
1201
  Ct();
1215
- const h = Ke(), g = Ht(e, "show"), f = q(!1), M = q(!1), U = q(!1), R = q(new Array()), _ = q(new Array()), E = q([]), j = at(), G = Qe(), s = et(), t = xt(), C = Ye(), I = Vt({}), Z = V(() => new Set(
1202
+ const h = Ke(), g = Ht(e, "show"), f = Q(!1), M = Q(!1), U = Q(!1), R = Q(new Array()), _ = Q(new Array()), E = Q([]), j = tt(), G = Qe(), r = Xe(), t = xt(), C = Ye(), I = Vt({}), W = V(() => new Set(
1216
1203
  t.skus.filter((u) => {
1217
1204
  var a;
1218
1205
  return I[(a = u.customAttributes) == null ? void 0 : a.tag];
1219
1206
  }).map((u) => u._id)
1220
- )), y = o, l = q({
1207
+ )), y = o, i = Q({
1221
1208
  templateItem: !0,
1222
1209
  nonTemplateItem: !0
1223
1210
  }), $ = V(() => {
1224
1211
  var a, p;
1225
1212
  const u = [...((a = e.draft) == null ? void 0 : a.items) ?? [], ...((p = e.draft) == null ? void 0 : p.negativeStockItems) ?? []];
1226
- return Z.value.size ? u.filter((r) => Z.value.has(r.sku._id)) : u;
1227
- }), z = V(() => {
1213
+ return W.value.size ? u.filter((s) => W.value.has(s.sku._id)) : u;
1214
+ }), H = V(() => {
1228
1215
  const u = $.value.map((a) => a.sku);
1229
1216
  return u.sort((a, p) => a.code.localeCompare(p.code)), u;
1230
- }), ae = V(() => $.value.groupBy(
1217
+ }), te = V(() => $.value.groupBy(
1231
1218
  (a) => a.sku._id,
1232
1219
  (a) => a.measurementsAmounts.filter((p) => !p.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((p) => p.measurement.id)
1233
1220
  ));
1234
- Xe(ee), Ne(
1221
+ Je(ee), Ne(
1235
1222
  () => e.show,
1236
1223
  (u) => {
1237
- u && (_e.value = ke[0], ee(), l.value = {
1224
+ u && (_e.value = ke[0], ee(), i.value = {
1238
1225
  templateItem: !0,
1239
1226
  nonTemplateItem: !0
1240
1227
  });
@@ -1242,7 +1229,7 @@ const Da = Dt(
1242
1229
  );
1243
1230
  const oe = Be(0), w = Be(100);
1244
1231
  async function ee() {
1245
- var a, p, r, i;
1232
+ var a, p, s, l;
1246
1233
  if (!C._currentLocation) return;
1247
1234
  f.value = !0;
1248
1235
  const u = ((a = e.draft) == null ? void 0 : a.status) === he.enum.COMPLETED;
@@ -1251,7 +1238,7 @@ const Da = Dt(
1251
1238
  if (await t.init(), u) {
1252
1239
  const L = e.draft.closingAdjustmentId;
1253
1240
  if (!L) {
1254
- s.open({
1241
+ r.open({
1255
1242
  title: "Something went wrong",
1256
1243
  message: "Closing draft is completed but closing document cannot be found.",
1257
1244
  type: "error"
@@ -1260,8 +1247,8 @@ const Da = Dt(
1260
1247
  });
1261
1248
  return;
1262
1249
  }
1263
- const N = await j.readAdjustmentById(L), me = (N == null ? void 0 : N.skus) ?? [];
1264
- for (const fe of me) {
1250
+ const N = await j.readAdjustmentById(L), de = (N == null ? void 0 : N.skus) ?? [];
1251
+ for (const fe of de) {
1265
1252
  const Ae = {
1266
1253
  id: fe.sku._id,
1267
1254
  balance: fe.fromBalance,
@@ -1274,9 +1261,9 @@ const Da = Dt(
1274
1261
  R.value.push(Ae), _.value.push(T);
1275
1262
  }
1276
1263
  } else
1277
- R.value = ((r = e.draft) == null ? void 0 : r.stockSnapshot) ?? [];
1264
+ R.value = ((s = e.draft) == null ? void 0 : s.stockSnapshot) ?? [];
1278
1265
  const m = /* @__PURE__ */ new Set();
1279
- if ((i = e.draft) != null && i.adjustmentSnapshot)
1266
+ if ((l = e.draft) != null && l.adjustmentSnapshot)
1280
1267
  for (const L of e.draft.adjustmentSnapshot)
1281
1268
  L.adjustmentsByType && Object.keys(L.adjustmentsByType).forEach((N) => m.add(N));
1282
1269
  const b = ["receive", "sales", "wastage"], B = [];
@@ -1286,7 +1273,7 @@ const Da = Dt(
1286
1273
  const S = Array.from(m).sort();
1287
1274
  E.value = [...B, ...S];
1288
1275
  } catch (m) {
1289
- s.open({
1276
+ r.open({
1290
1277
  title: "Something went wrong",
1291
1278
  message: "Something went wrong when fetching info. Please try again.",
1292
1279
  type: "error"
@@ -1295,10 +1282,10 @@ const Da = Dt(
1295
1282
  f.value = !1;
1296
1283
  }
1297
1284
  }
1298
- async function de() {
1285
+ async function ue() {
1299
1286
  var a, p;
1300
1287
  if (!(((a = e.draft) == null ? void 0 : a.effectiveAt) ?? (e.draft ? Ee((p = e.draft) == null ? void 0 : p._id) : null))) {
1301
- s.open({
1288
+ r.open({
1302
1289
  title: "Cannot refresh",
1303
1290
  message: "Effective date is not available for this draft.",
1304
1291
  type: "error"
@@ -1309,30 +1296,30 @@ const Da = Dt(
1309
1296
  e.draft,
1310
1297
  () => {
1311
1298
  },
1312
- async (r) => {
1299
+ async (s) => {
1313
1300
  var B;
1314
1301
  M.value = !0;
1315
- const i = (B = e.draft) == null ? void 0 : B._rev, m = 30, b = 2e3;
1302
+ const l = (B = e.draft) == null ? void 0 : B._rev, m = 30, b = 2e3;
1316
1303
  try {
1317
- await j.recalculation.scheduleCalculateStockSnapshotAtDate(r, e.draft._id);
1304
+ await j.recalculation.scheduleCalculateStockSnapshotAtDate(s, e.draft._id);
1318
1305
  let S = null;
1319
- for (let L = 0; L < m && (S = await G.getDraft(e.draft._id).delayed(b), S._rev === i); L++)
1306
+ for (let L = 0; L < m && (S = await G.getDraft(e.draft._id).delayed(b), S._rev === l); L++)
1320
1307
  ;
1321
- if (!S || S._rev === i) {
1322
- s.open({
1308
+ if (!S || S._rev === l) {
1309
+ r.open({
1323
1310
  title: "Refresh failed",
1324
1311
  message: "Failed to refresh stock balance. Please try again.",
1325
1312
  type: "error"
1326
1313
  }), console.error("error refreshing stock balances: there is no change in _rev");
1327
1314
  return;
1328
1315
  }
1329
- y("refresh", S), R.value = S.stockSnapshot ?? [], s.open({
1316
+ y("refresh", S), R.value = S.stockSnapshot ?? [], r.open({
1330
1317
  title: "Balance refreshed",
1331
1318
  message: "Stock balance has been recalculated.",
1332
1319
  type: "success"
1333
1320
  }), g.value = !1;
1334
1321
  } catch (S) {
1335
- s.open({
1322
+ r.open({
1336
1323
  title: "Refresh failed",
1337
1324
  message: "Failed to refresh stock balance. Please try again.",
1338
1325
  type: "error"
@@ -1346,7 +1333,7 @@ const Da = Dt(
1346
1333
  async function A() {
1347
1334
  var a, p;
1348
1335
  if (!(((a = e.draft) == null ? void 0 : a.effectiveAt) ?? (e.draft ? Ee((p = e.draft) == null ? void 0 : p._id) : null))) {
1349
- s.open({
1336
+ r.open({
1350
1337
  title: "Cannot refresh",
1351
1338
  message: "Effective date is not available for this draft.",
1352
1339
  type: "error"
@@ -1367,7 +1354,7 @@ const Da = Dt(
1367
1354
  var u;
1368
1355
  return (u = e.draft) != null && u.opening ? new Map(e.draft.opening.map((a) => [a.skuId, a.balance])) : /* @__PURE__ */ new Map();
1369
1356
  });
1370
- function Q(u, a) {
1357
+ function Y(u, a) {
1371
1358
  return F(
1372
1359
  be.FmTooltip,
1373
1360
  { zIndex: 51, placement: "left", class: "w-full flex justify-end" },
@@ -1382,9 +1369,9 @@ const Da = Dt(
1382
1369
  );
1383
1370
  }
1384
1371
  const ve = V(() => {
1385
- const u = z.value.reduce((p, r) => {
1386
- var i, m;
1387
- return Math.max(p, ((m = (i = ae.value) == null ? void 0 : i.get(r._id)) == null ? void 0 : m[0].length) ?? 0);
1372
+ const u = H.value.reduce((p, s) => {
1373
+ var l, m;
1374
+ return Math.max(p, ((m = (l = te.value) == null ? void 0 : l.get(s._id)) == null ? void 0 : m[0].length) ?? 0);
1388
1375
  }, 0);
1389
1376
  return [
1390
1377
  {
@@ -1393,7 +1380,7 @@ const Da = Dt(
1393
1380
  header: () => "Name",
1394
1381
  size: 350,
1395
1382
  cell(p) {
1396
- const r = p.row.original, i = r.adjustedDiffPercentage, m = typeof i == "number" && Math.abs(i) > 10, b = F("div", { class: "flex flex-col gap-4" }, [
1383
+ const s = p.row.original, l = s.adjustedDiffPercentage, m = typeof l == "number" && Math.abs(l) > 10, b = F("div", { class: "flex flex-col gap-4" }, [
1397
1384
  F(
1398
1385
  "div",
1399
1386
  {
@@ -1402,7 +1389,7 @@ const Da = Dt(
1402
1389
  m ? " text-fm-color-system-error-300" : "text-fm-color-typo-primary"
1403
1390
  ]
1404
1391
  },
1405
- r.name
1392
+ s.name
1406
1393
  ),
1407
1394
  F(
1408
1395
  "div",
@@ -1412,7 +1399,7 @@ const Da = Dt(
1412
1399
  m ? " text-fm-color-system-error-300" : "text-fm-color-typo-secondary"
1413
1400
  ]
1414
1401
  },
1415
- r.code
1402
+ s.code
1416
1403
  )
1417
1404
  ]);
1418
1405
  return F(
@@ -1422,7 +1409,7 @@ const Da = Dt(
1422
1409
  },
1423
1410
  {
1424
1411
  content() {
1425
- return m ? "Adjustment difference is more than 10%." : `${r.code} - ${r.name}`;
1412
+ return m ? "Adjustment difference is more than 10%." : `${s.code} - ${s.name}`;
1426
1413
  },
1427
1414
  default() {
1428
1415
  return F("div", { class: "flex items-center gap-4 justify-start w-full" }, [
@@ -1436,11 +1423,11 @@ const Da = Dt(
1436
1423
  {
1437
1424
  id: "costPerUnit",
1438
1425
  accessorKey: "costPerUnit",
1439
- header: () => Q("Cost per unit"),
1426
+ header: () => Y("Cost per unit"),
1440
1427
  size: 160,
1441
1428
  cell(p) {
1442
- const r = p.row.original.costPerUnit;
1443
- return F("div", { class: "text-right" }, r.toFixed(2));
1429
+ const s = p.row.original.costPerUnit;
1430
+ return F("div", { class: "text-right" }, s.toFixed(2));
1444
1431
  },
1445
1432
  meta: {
1446
1433
  textAlign: "right"
@@ -1452,9 +1439,9 @@ const Da = Dt(
1452
1439
  size: 120,
1453
1440
  cell(p) {
1454
1441
  var B;
1455
- const r = p.row.original, i = r.costUnit, m = r.baseUnit, b = i ?? m;
1456
- if (i && i !== m) {
1457
- const S = z.value.find((N) => N._id === r.id), L = (B = S == null ? void 0 : S.defaultCost) == null ? void 0 : B.measurement;
1442
+ const s = p.row.original, l = s.costUnit, m = s.baseUnit, b = l ?? m;
1443
+ if (l && l !== m) {
1444
+ const S = H.value.find((N) => N._id === s.id), L = (B = S == null ? void 0 : S.defaultCost) == null ? void 0 : B.measurement;
1458
1445
  if (L) {
1459
1446
  const N = L.conversion.amount / Math.pow(10, L.conversion.precision);
1460
1447
  return F("div", { class: "flex flex-col" }, [
@@ -1465,7 +1452,7 @@ const Da = Dt(
1465
1452
  ),
1466
1453
  F("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, [
1467
1454
  "1 ",
1468
- F("span", { class: "fm-typo-en-body-sm-600" }, i),
1455
+ F("span", { class: "fm-typo-en-body-sm-600" }, l),
1469
1456
  ` = ${N} `,
1470
1457
  F("span", { class: "fm-typo-en-body-sm-600" }, m)
1471
1458
  ])
@@ -1478,11 +1465,11 @@ const Da = Dt(
1478
1465
  {
1479
1466
  id: "opening",
1480
1467
  accessorKey: "opening",
1481
- header: () => Q("Opening (B/F)", "The opening balance brought forward from previous period."),
1468
+ header: () => Y("Opening (B/F)", "The opening balance brought forward from previous period."),
1482
1469
  size: 150,
1483
1470
  cell(p) {
1484
- const r = p.row.original.opening;
1485
- return F("div", { class: "text-right" }, r.toFixed(2));
1471
+ const s = p.row.original.opening;
1472
+ return F("div", { class: "text-right" }, s.toFixed(2));
1486
1473
  },
1487
1474
  meta: {
1488
1475
  textAlign: "right"
@@ -1492,12 +1479,12 @@ const Da = Dt(
1492
1479
  ...E.value.map(
1493
1480
  (p) => ({
1494
1481
  id: `adjustment_${p}`,
1495
- accessorFn: (r) => r.adjustmentAmounts[p] ?? { amount: 0, precision: 0 },
1496
- header: () => Q(ze(p)),
1482
+ accessorFn: (s) => s.adjustmentAmounts[p] ?? { amount: 0, precision: 0 },
1483
+ header: () => Y(ze(p)),
1497
1484
  size: 150,
1498
- cell(r) {
1499
- const i = r.row.original.adjustmentAmounts[p] ?? { amount: 0, precision: 0 };
1500
- return F("div", { class: "text-right" }, Je(i));
1485
+ cell(s) {
1486
+ const l = s.row.original.adjustmentAmounts[p] ?? { amount: 0, precision: 0 };
1487
+ return F("div", { class: "text-right" }, Ze(l));
1501
1488
  },
1502
1489
  meta: {
1503
1490
  textAlign: "right"
@@ -1507,7 +1494,7 @@ const Da = Dt(
1507
1494
  {
1508
1495
  id: "systemBalance",
1509
1496
  accessorKey: "systemBalance",
1510
- header: () => Q("System Balance", "The system calculated balance before stock take."),
1497
+ header: () => Y("System Balance", "The system calculated balance before stock take."),
1511
1498
  size: 200,
1512
1499
  meta: {
1513
1500
  textAlign: "right"
@@ -1516,20 +1503,20 @@ const Da = Dt(
1516
1503
  {
1517
1504
  id: "physicalBalance",
1518
1505
  accessorFn: (p) => {
1519
- var i;
1520
- const r = (i = _.value.find((m) => m.id === p.id)) == null ? void 0 : i.balance;
1521
- return r ? H.toFormatString({ value: r }) : p.physicalBalance;
1506
+ var l;
1507
+ const s = (l = _.value.find((m) => m.id === p.id)) == null ? void 0 : l.balance;
1508
+ return s ? z.toFormatString({ value: s }) : p.physicalBalance;
1522
1509
  },
1523
- header: () => Q("Stock Take balance", "The physical balance recorded during stock take."),
1510
+ header: () => Y("Stock Take balance", "The physical balance recorded during stock take."),
1524
1511
  cell(p) {
1525
1512
  var S;
1526
- const r = p.row.original, i = H.fromNumber(r.physicalBalance);
1527
- let m = !0, b = r.physicalBalance;
1528
- const B = (S = _.value.find((L) => L.id === r.id)) == null ? void 0 : S.balance;
1529
- return B && (H.equals({
1530
- a: i,
1513
+ const s = p.row.original, l = z.fromNumber(s.physicalBalance);
1514
+ let m = !0, b = s.physicalBalance;
1515
+ const B = (S = _.value.find((L) => L.id === s.id)) == null ? void 0 : S.balance;
1516
+ return B && (z.equals({
1517
+ a: l,
1531
1518
  b: B
1532
- }) || (m = !1, b = Number(H.toFormatString({ value: B })))), F("div", { class: "flex flex-col" }, [
1519
+ }) || (m = !1, b = Number(z.toFormatString({ value: B })))), F("div", { class: "flex flex-col" }, [
1533
1520
  F(
1534
1521
  "span",
1535
1522
  { class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-primary" },
@@ -1538,7 +1525,7 @@ const Da = Dt(
1538
1525
  m ? null : F(
1539
1526
  "span",
1540
1527
  { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
1541
- `Draft: ${r.physicalBalance.toString()}`
1528
+ `Draft: ${s.physicalBalance.toString()}`
1542
1529
  )
1543
1530
  ]);
1544
1531
  },
@@ -1550,7 +1537,7 @@ const Da = Dt(
1550
1537
  {
1551
1538
  id: "adjustedAmount",
1552
1539
  accessorKey: "adjustedAmount",
1553
- header: () => Q("Variance", "The difference between Stock Take balance and System Balance."),
1540
+ header: () => Y("Variance", "The difference between Stock Take balance and System Balance."),
1554
1541
  size: 200,
1555
1542
  meta: {
1556
1543
  textAlign: "right"
@@ -1559,14 +1546,14 @@ const Da = Dt(
1559
1546
  {
1560
1547
  id: "varianceInCost",
1561
1548
  accessorKey: "varianceInCost",
1562
- header: () => Q(`Variance (${d.value})`),
1549
+ header: () => Y(`Variance (${d.value})`),
1563
1550
  size: 150,
1564
1551
  cell(p) {
1565
- const r = p.row.original.varianceInCost;
1552
+ const s = p.row.original.varianceInCost;
1566
1553
  return F(
1567
1554
  "div",
1568
1555
  { class: "text-right" },
1569
- r.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })
1556
+ s.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })
1570
1557
  );
1571
1558
  },
1572
1559
  meta: {
@@ -1576,25 +1563,25 @@ const Da = Dt(
1576
1563
  {
1577
1564
  id: "adjustedDiffPercentage",
1578
1565
  accessorKey: "adjustedDiffPercentage",
1579
- header: () => Q(
1566
+ header: () => Y(
1580
1567
  "Variance (%)",
1581
1568
  "Difference between Stock Take balance and System Balance in percentage."
1582
1569
  ),
1583
1570
  size: 200,
1584
1571
  cell(p) {
1585
- const r = p.row.original.adjustedDiffPercentage;
1586
- if (!r) return Dn;
1587
- const i = r.toFixed(2);
1588
- if (i === "0.00")
1572
+ const s = p.row.original.adjustedDiffPercentage;
1573
+ if (!s) return Dn;
1574
+ const l = s.toFixed(2);
1575
+ if (l === "0.00")
1589
1576
  return F("div", { class: "flex items-center gap-4 justify-end" }, ["0.00"]);
1590
- const m = r > 0;
1577
+ const m = s > 0;
1591
1578
  return F("div", { class: "flex items-center gap-4 justify-end" }, [
1592
1579
  F(be.FmIcon, {
1593
1580
  name: m ? "arrow_drop_up" : "arrow_drop_down",
1594
1581
  color: m ? "system-success-300" : "system-error-300",
1595
1582
  size: "md"
1596
1583
  }),
1597
- i
1584
+ l
1598
1585
  ]);
1599
1586
  },
1600
1587
  meta: {
@@ -1604,25 +1591,25 @@ const Da = Dt(
1604
1591
  {
1605
1592
  id: "stockTakeValue",
1606
1593
  accessorKey: "stockTakeValue",
1607
- header: () => Q(`Stock take value (${d.value})`),
1594
+ header: () => Y(`Stock take value (${d.value})`),
1608
1595
  size: 180,
1609
1596
  cell(p) {
1610
1597
  var L;
1611
- const r = p.row.original, i = r.stockTakeValue, m = z.value.find((N) => N._id === r.id), b = (L = m == null ? void 0 : m.defaultCost) == null ? void 0 : L.measurement, B = r.physicalBalance, S = r.costPerUnit;
1598
+ const s = p.row.original, l = s.stockTakeValue, m = H.value.find((N) => N._id === s.id), b = (L = m == null ? void 0 : m.defaultCost) == null ? void 0 : L.measurement, B = s.physicalBalance, S = s.costPerUnit;
1612
1599
  if (b) {
1613
- const N = H.toFormatString({ value: b.conversion }), me = `${B.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} ${r.baseUnit} ÷ ${N} × ${S} ${d.value}`;
1600
+ const N = z.toFormatString({ value: b.conversion }), de = `${B.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} ${s.baseUnit} ÷ ${N} × ${S} ${d.value}`;
1614
1601
  return F(
1615
1602
  be.FmTooltip,
1616
1603
  { zIndex: 51 },
1617
1604
  {
1618
1605
  content() {
1619
- return me;
1606
+ return de;
1620
1607
  },
1621
1608
  default() {
1622
1609
  return F(
1623
1610
  "div",
1624
1611
  { class: "text-right" },
1625
- i.toLocaleString("en-US", {
1612
+ l.toLocaleString("en-US", {
1626
1613
  minimumFractionDigits: 2,
1627
1614
  maximumFractionDigits: 4
1628
1615
  })
@@ -1631,7 +1618,7 @@ const Da = Dt(
1631
1618
  }
1632
1619
  );
1633
1620
  } else {
1634
- const N = `${B.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} ${r.baseUnit} × ${S} ${d.value}`;
1621
+ const N = `${B.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })} ${s.baseUnit} × ${S} ${d.value}`;
1635
1622
  return F(
1636
1623
  be.FmTooltip,
1637
1624
  { zIndex: 51 },
@@ -1643,7 +1630,7 @@ const Da = Dt(
1643
1630
  return F(
1644
1631
  "div",
1645
1632
  { class: "text-right" },
1646
- i.toLocaleString("en-US", {
1633
+ l.toLocaleString("en-US", {
1647
1634
  minimumFractionDigits: 2,
1648
1635
  maximumFractionDigits: 4
1649
1636
  })
@@ -1660,25 +1647,25 @@ const Da = Dt(
1660
1647
  {
1661
1648
  id: "systemValue",
1662
1649
  accessorKey: "systemValue",
1663
- header: () => Q(`System value (${d.value})`),
1650
+ header: () => Y(`System value (${d.value})`),
1664
1651
  size: 180,
1665
1652
  cell(p) {
1666
1653
  var L;
1667
- const r = p.row.original, i = r.systemValue, m = z.value.find((N) => N._id === r.id), b = (L = m == null ? void 0 : m.defaultCost) == null ? void 0 : L.measurement, B = r.systemBalance, S = r.costPerUnit;
1654
+ const s = p.row.original, l = s.systemValue, m = H.value.find((N) => N._id === s.id), b = (L = m == null ? void 0 : m.defaultCost) == null ? void 0 : L.measurement, B = s.systemBalance, S = s.costPerUnit;
1668
1655
  if (b) {
1669
- const N = H.toFormatString({ value: b.conversion }), me = `${B.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })} ${r.baseUnit} ÷ ${N} × ${S} ${d.value}`;
1656
+ const N = z.toFormatString({ value: b.conversion }), de = `${B.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })} ${s.baseUnit} ÷ ${N} × ${S} ${d.value}`;
1670
1657
  return F(
1671
1658
  be.FmTooltip,
1672
1659
  { zIndex: 51 },
1673
1660
  {
1674
1661
  content() {
1675
- return me;
1662
+ return de;
1676
1663
  },
1677
1664
  default() {
1678
1665
  return F(
1679
1666
  "div",
1680
1667
  { class: "text-right" },
1681
- i.toLocaleString("en-US", {
1668
+ l.toLocaleString("en-US", {
1682
1669
  minimumFractionDigits: 2,
1683
1670
  maximumFractionDigits: 4
1684
1671
  })
@@ -1687,7 +1674,7 @@ const Da = Dt(
1687
1674
  }
1688
1675
  );
1689
1676
  } else {
1690
- const N = `${B.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })} ${r.baseUnit} × ${S} ${d.value}`;
1677
+ const N = `${B.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4 })} ${s.baseUnit} × ${S} ${d.value}`;
1691
1678
  return F(
1692
1679
  be.FmTooltip,
1693
1680
  { zIndex: 51 },
@@ -1699,7 +1686,7 @@ const Da = Dt(
1699
1686
  return F(
1700
1687
  "div",
1701
1688
  { class: "text-right" },
1702
- i.toLocaleString("en-US", {
1689
+ l.toLocaleString("en-US", {
1703
1690
  minimumFractionDigits: 2,
1704
1691
  maximumFractionDigits: 4
1705
1692
  })
@@ -1718,7 +1705,7 @@ const Da = Dt(
1718
1705
  header: () => "Amounts",
1719
1706
  enableSorting: !1,
1720
1707
  cell(p) {
1721
- const r = p.row.original, i = (b, B) => F(
1708
+ const s = p.row.original, l = (b, B) => F(
1722
1709
  be.FmTooltip,
1723
1710
  { zIndex: 50 },
1724
1711
  {
@@ -1747,12 +1734,12 @@ const Da = Dt(
1747
1734
  }
1748
1735
  );
1749
1736
  let m = Array.from({ length: u }).map((b, B) => {
1750
- if (!r[`measurementAmount${B}`])
1737
+ if (!s[`measurementAmount${B}`])
1751
1738
  return null;
1752
- const S = r[`measurementAmount${B}`], L = r[`measurementAbbrev${B}`];
1753
- return i(S, L);
1739
+ const S = s[`measurementAmount${B}`], L = s[`measurementAbbrev${B}`];
1740
+ return l(S, L);
1754
1741
  }).filter((b) => b);
1755
- return (r.baseUnitAmount || !m.length) && (m = [i(r.baseUnitAmount, r.baseUnit), ...m]), F(
1742
+ return (s.baseUnitAmount || !m.length) && (m = [l(s.baseUnitAmount, s.baseUnit), ...m]), F(
1756
1743
  "div",
1757
1744
  {
1758
1745
  class: "flex gap-8 flex-nowrap",
@@ -1765,37 +1752,37 @@ const Da = Dt(
1765
1752
  }
1766
1753
  }
1767
1754
  ];
1768
- }), je = V(() => ve.value.map((u) => u.size ?? 0).reduce((u, a) => u + a)), we = q(""), Ie = V(() => {
1769
- var p, r;
1770
- const u = ((r = (p = e.draft) == null ? void 0 : p.negativeStockItems) == null ? void 0 : r.reduce(
1771
- (i, m) => (i[m.sku._id] = m, i),
1755
+ }), je = V(() => ve.value.map((u) => u.size ?? 0).reduce((u, a) => u + a)), we = Q(""), Ie = V(() => {
1756
+ var p, s;
1757
+ const u = ((s = (p = e.draft) == null ? void 0 : p.negativeStockItems) == null ? void 0 : s.reduce(
1758
+ (l, m) => (l[m.sku._id] = m, l),
1772
1759
  {}
1773
1760
  )) ?? {};
1774
- return z.value.map((i) => {
1775
- var st, rt, lt, it, ct, ut, dt, mt, ft, pt, vt;
1776
- const m = (st = J.value.get(i._id)) == null ? void 0 : st[0], b = ((rt = D.value.get(i._id)) == null ? void 0 : rt[0]) ?? oe, B = ((lt = i.defaultCost) == null ? void 0 : lt.costPerUnit) ?? oe, S = Number(H.toFormatString({ value: B })), L = ((ct = (it = i.defaultCost) == null ? void 0 : it.measurement) == null ? void 0 : ct.conversion) ?? {
1761
+ return H.value.map((l) => {
1762
+ var ot, st, rt, lt, it, ct, ut, dt, mt, ft, pt;
1763
+ const m = (ot = J.value.get(l._id)) == null ? void 0 : ot[0], b = ((st = D.value.get(l._id)) == null ? void 0 : st[0]) ?? oe, B = ((rt = l.defaultCost) == null ? void 0 : rt.costPerUnit) ?? oe, S = Number(z.toFormatString({ value: B })), L = ((it = (lt = l.defaultCost) == null ? void 0 : lt.measurement) == null ? void 0 : it.conversion) ?? {
1777
1764
  amount: 1,
1778
1765
  precision: 0
1779
1766
  }, N = Number(
1780
- H.toFormatString({ value: L })
1781
- ), me = re.value.get(i._id), fe = me ? Number(H.toFormatString({ value: me })) : 0, Ae = O.value.get(i._id), T = {};
1767
+ z.toFormatString({ value: L })
1768
+ ), de = re.value.get(l._id), fe = de ? Number(z.toFormatString({ value: de })) : 0, Ae = O.value.get(l._id), T = {};
1782
1769
  if (E.value.forEach((se) => {
1783
1770
  const pe = T[se] ?? { amount: 0, precision: 0 }, ye = Ae == null ? void 0 : Ae[se];
1784
1771
  ye && (T[se] = Zt(pe, ye));
1785
1772
  }), !m) {
1786
- const se = Number(H.toFormatString({ value: b })), pe = se - 0, ye = pe * S / N, Me = 0, Pt = se * S / N;
1773
+ const se = Number(z.toFormatString({ value: b })), pe = se - 0, ye = pe * S / N, Me = 0, Pt = se * S / N;
1787
1774
  return {
1788
- id: i._id,
1789
- code: i.code,
1790
- name: i.name,
1791
- costUnit: ((dt = (ut = i.defaultCost) == null ? void 0 : ut.measurement) == null ? void 0 : dt.abbrev) ?? null,
1792
- baseUnit: i.unit.abbrev,
1775
+ id: l._id,
1776
+ code: l.code,
1777
+ name: l.name,
1778
+ costUnit: ((ut = (ct = l.defaultCost) == null ? void 0 : ct.measurement) == null ? void 0 : ut.abbrev) ?? null,
1779
+ baseUnit: l.unit.abbrev,
1793
1780
  baseUnitAmount: 0,
1794
1781
  systemBalance: se,
1795
1782
  physicalBalance: 0,
1796
1783
  adjustedAmount: -se,
1797
1784
  adjustedDiffPercentage: -100,
1798
- isTemplateItem: !u[i._id],
1785
+ isTemplateItem: !u[l._id],
1799
1786
  costPerUnit: S,
1800
1787
  opening: fe,
1801
1788
  varianceQty: pe,
@@ -1805,46 +1792,46 @@ const Da = Dt(
1805
1792
  adjustmentAmounts: T
1806
1793
  };
1807
1794
  }
1808
- const ne = $t(m), le = (ft = (mt = _.value) == null ? void 0 : mt.find(
1809
- (se) => se.id === i._id
1810
- )) == null ? void 0 : ft.balance, ge = wt(
1811
- le ?? ne,
1795
+ const ae = $t(m), le = (mt = (dt = _.value) == null ? void 0 : dt.find(
1796
+ (se) => se.id === l._id
1797
+ )) == null ? void 0 : mt.balance, ge = wt(
1798
+ le ?? ae,
1812
1799
  b
1813
1800
  ), Se = b.amount === 0 ? null : St(ge, {
1814
1801
  ...b,
1815
1802
  amount: Math.abs(b.amount)
1816
- }), Ve = Se ? tt(Se, w) : null, qe = Number(H.toFormatString({ value: b })), Ge = Number(H.toFormatString({ value: ne })), ot = qe - Ge, It = ot * S / N, Ut = Ge * S / N, Rt = qe * S / N;
1803
+ }), Ve = Se ? et(Se, w) : null, qe = Number(z.toFormatString({ value: b })), Ge = Number(z.toFormatString({ value: ae })), nt = qe - Ge, It = nt * S / N, Ut = Ge * S / N, Rt = qe * S / N;
1817
1804
  return {
1818
- id: i._id,
1819
- code: i.code,
1820
- name: i.name,
1821
- costUnit: ((vt = (pt = i.defaultCost) == null ? void 0 : pt.measurement) == null ? void 0 : vt.abbrev) ?? null,
1822
- baseUnit: i.unit.abbrev,
1823
- baseUnitAmount: Number(H.toFormatString({ value: m.baseAmount })),
1805
+ id: l._id,
1806
+ code: l.code,
1807
+ name: l.name,
1808
+ costUnit: ((pt = (ft = l.defaultCost) == null ? void 0 : ft.measurement) == null ? void 0 : pt.abbrev) ?? null,
1809
+ baseUnit: l.unit.abbrev,
1810
+ baseUnitAmount: Number(z.toFormatString({ value: m.baseAmount })),
1824
1811
  ...m.measurementsAmounts.filter((se) => {
1825
1812
  var pe, ye, Me;
1826
- return (Me = (ye = (pe = ae.value) == null ? void 0 : pe.get(i._id)) == null ? void 0 : ye[0]) == null ? void 0 : Me.includes(se.measurement.id);
1827
- }).reduce((se, pe, ye) => (se[`measurementAbbrev${ye}`] = `(${pe.measurement.abbrev}) × ${H.toFormatString({ value: pe.measurement.conversion })}`, se[`measurementAmount${ye}`] = Number(H.toFormatString({ value: pe.amount })), se), {}),
1813
+ return (Me = (ye = (pe = te.value) == null ? void 0 : pe.get(l._id)) == null ? void 0 : ye[0]) == null ? void 0 : Me.includes(se.measurement.id);
1814
+ }).reduce((se, pe, ye) => (se[`measurementAbbrev${ye}`] = `(${pe.measurement.abbrev}) × ${z.toFormatString({ value: pe.measurement.conversion })}`, se[`measurementAmount${ye}`] = Number(z.toFormatString({ value: pe.amount })), se), {}),
1828
1815
  systemBalance: qe,
1829
1816
  physicalBalance: Ge,
1830
- adjustedAmount: Number(H.toFormatString({ value: ge })),
1817
+ adjustedAmount: Number(z.toFormatString({ value: ge })),
1831
1818
  adjustedDiffPercentage: Ve ? Number(
1832
- H.toFormatString({
1819
+ z.toFormatString({
1833
1820
  value: Ft(Ve, 2)
1834
1821
  })
1835
1822
  ) : null,
1836
- isTemplateItem: !u[i._id],
1823
+ isTemplateItem: !u[l._id],
1837
1824
  costPerUnit: S,
1838
1825
  opening: fe,
1839
- varianceQty: ot,
1826
+ varianceQty: nt,
1840
1827
  varianceInCost: It,
1841
1828
  stockTakeValue: Ut,
1842
1829
  systemValue: Rt,
1843
1830
  adjustmentAmounts: T
1844
1831
  };
1845
- }).filter((i) => !!(i.isTemplateItem && l.value.templateItem || !i.isTemplateItem && l.value.nonTemplateItem));
1832
+ }).filter((l) => !!(l.isTemplateItem && i.value.templateItem || !l.isTemplateItem && i.value.nonTemplateItem));
1846
1833
  }), Ue = V(() => {
1847
- var a, p, r, i, m;
1834
+ var a, p, s, l, m;
1848
1835
  if (!e.draft) return [];
1849
1836
  const u = e.draft.approvedAt ? {
1850
1837
  action: `Approve at ${De(e.draft.approvedAt)}`,
@@ -1880,11 +1867,11 @@ const Da = Dt(
1880
1867
  },
1881
1868
  {
1882
1869
  label: "Effective at",
1883
- value: De(e.draft.effectiveAt ?? Ee((r = e.draft) == null ? void 0 : r._id))
1870
+ value: De(e.draft.effectiveAt ?? Ee((s = e.draft) == null ? void 0 : s._id))
1884
1871
  },
1885
1872
  {
1886
1873
  label: "Using template",
1887
- value: ((i = e.draft.usingTemplates.find((b) => b)) == null ? void 0 : i.name) ?? "None"
1874
+ value: ((l = e.draft.usingTemplates.find((b) => b)) == null ? void 0 : l.name) ?? "None"
1888
1875
  },
1889
1876
  e.draft.remark ? {
1890
1877
  label: "Remark",
@@ -1912,14 +1899,14 @@ const Da = Dt(
1912
1899
  label: "Action history",
1913
1900
  value: "history"
1914
1901
  }
1915
- ], _e = q(ke[0]), xe = V(() => {
1916
- var r, i, m;
1917
- const u = ((r = e.draft) == null ? void 0 : r.activityLogs) ?? [], a = ((i = e.draft) == null ? void 0 : i.rejectionHistory) ?? [];
1902
+ ], _e = Q(ke[0]), xe = V(() => {
1903
+ var s, l, m;
1904
+ const u = ((s = e.draft) == null ? void 0 : s.activityLogs) ?? [], a = ((l = e.draft) == null ? void 0 : l.rejectionHistory) ?? [];
1918
1905
  for (const b of a)
1919
1906
  u.find(
1920
- (S) => `${S.action}_${S.performedAt}` == `${W.enum.rejectDraft}_${b.rejectedAt}`
1907
+ (S) => `${S.action}_${S.performedAt}` == `${Z.enum.rejectDraft}_${b.rejectedAt}`
1921
1908
  ) || u.push({
1922
- action: W.enum.rejectDraft,
1909
+ action: Z.enum.rejectDraft,
1923
1910
  performedAt: b.rejectedAt,
1924
1911
  performedBy: b.rejectedBy,
1925
1912
  remark: b.rejectRemark
@@ -1927,10 +1914,10 @@ const Da = Dt(
1927
1914
  return (m = e.draft) != null && m.approvedAt && (u.find(
1928
1915
  (B) => {
1929
1916
  var S;
1930
- return `${B.action}_${B.performedAt}` == `${W.enum.approveDraft}_${(S = e.draft) == null ? void 0 : S.approvedAt}`;
1917
+ return `${B.action}_${B.performedAt}` == `${Z.enum.approveDraft}_${(S = e.draft) == null ? void 0 : S.approvedAt}`;
1931
1918
  }
1932
1919
  ) || u.push({
1933
- action: W.enum.approveDraft,
1920
+ action: Z.enum.approveDraft,
1934
1921
  performedAt: e.draft.approvedAt,
1935
1922
  performedBy: e.draft.approvedBy ?? { name: "Unknown", id: "unknown" },
1936
1923
  remark: e.draft.approveRemark
@@ -1950,7 +1937,7 @@ const Da = Dt(
1950
1937
  ]
1951
1938
  })
1952
1939
  );
1953
- }), Re = q(!1), Pe = q(!1), nt = V(() => {
1940
+ }), Re = Q(!1), Pe = Q(!1), at = V(() => {
1954
1941
  var u;
1955
1942
  return ((u = e.draft) == null ? void 0 : u.status) !== he.enum.DRAFT ? "Status is not draft." : null;
1956
1943
  });
@@ -1966,7 +1953,7 @@ const Da = Dt(
1966
1953
  ));
1967
1954
  }
1968
1955
  return (u, a) => {
1969
- const p = K("FmButtonGroup"), r = K("FmMenuDivider"), i = K("FmCard"), m = K("FmButton"), b = K("FmCircularProgress"), B = K("FmChip"), S = K("FmTextField"), L = K("FmIcon"), N = K("FmTable"), me = K("FmSpacer"), fe = K("FmTooltip"), Ae = K("FmSideSheet");
1956
+ const p = K("FmButtonGroup"), s = K("FmMenuDivider"), l = K("FmCard"), m = K("FmButton"), b = K("FmCircularProgress"), B = K("FmChip"), S = K("FmTextField"), L = K("FmIcon"), N = K("FmTable"), de = K("FmSpacer"), fe = K("FmTooltip"), Ae = K("FmSideSheet");
1970
1957
  return x(), P(ie, null, [
1971
1958
  k(Ae, {
1972
1959
  "dismiss-away": "",
@@ -1975,20 +1962,20 @@ const Da = Dt(
1975
1962
  "onUpdate:modelValue": a[9] || (a[9] = (T) => gt(g) ? g.value = T : null),
1976
1963
  header: "Closing details"
1977
1964
  }, {
1978
- "side-sheet-footer": Y(() => {
1979
- var T, ne, le, ge;
1965
+ "side-sheet-footer": q(() => {
1966
+ var T, ae, le, ge;
1980
1967
  return [
1981
1968
  n("div", xn, [
1982
1969
  ((T = e.draft) == null ? void 0 : T.status) === v(he).enum.DRAFT ? (x(), P(ie, { key: 0 }, [
1983
- nt.value ? (x(), ue(fe, {
1970
+ at.value ? (x(), me(fe, {
1984
1971
  key: 0,
1985
1972
  "z-index": 51,
1986
1973
  placement: "right"
1987
1974
  }, {
1988
- content: Y(() => [
1989
- ce(X(nt.value), 1)
1975
+ content: q(() => [
1976
+ ce(X(at.value), 1)
1990
1977
  ]),
1991
- default: Y(() => [
1978
+ default: q(() => [
1992
1979
  k(m, {
1993
1980
  disabled: "",
1994
1981
  key: "approve key",
@@ -1996,20 +1983,20 @@ const Da = Dt(
1996
1983
  })
1997
1984
  ]),
1998
1985
  _: 1
1999
- })) : (x(), ue(m, {
1986
+ })) : (x(), me(m, {
2000
1987
  key: "approve key",
2001
1988
  label: "Approve",
2002
1989
  onClick: a[5] || (a[5] = (Se) => Re.value = !0)
2003
1990
  }))
2004
- ], 64)) : te("", !0),
2005
- ((ne = e.draft) == null ? void 0 : ne.status) === v(he).enum.DRAFT ? (x(), ue(m, {
1991
+ ], 64)) : ne("", !0),
1992
+ ((ae = e.draft) == null ? void 0 : ae.status) === v(he).enum.DRAFT ? (x(), me(m, {
2006
1993
  key: 1,
2007
1994
  label: "Reject",
2008
1995
  variant: "destructive",
2009
1996
  onClick: a[6] || (a[6] = () => e.draft && v(h).rejectDraft(e.draft, () => y("submitted")))
2010
- })) : te("", !0),
2011
- (le = e.draft) != null && le.approvedAt && ((ge = e.draft) == null ? void 0 : ge.status) !== v(he).enum.COMPLETED ? (x(), ue(Ze, { key: 2 }, {
2012
- default: Y(() => [
1997
+ })) : ne("", !0),
1998
+ (le = e.draft) != null && le.approvedAt && ((ge = e.draft) == null ? void 0 : ge.status) !== v(he).enum.COMPLETED ? (x(), me(vt, { key: 2 }, {
1999
+ default: q(() => [
2013
2000
  k(m, {
2014
2001
  label: "Sync",
2015
2002
  loading: U.value,
@@ -2021,7 +2008,7 @@ const Da = Dt(
2021
2008
  }, null, 8, ["loading"])
2022
2009
  ]),
2023
2010
  _: 1
2024
- })) : te("", !0),
2011
+ })) : ne("", !0),
2025
2012
  k(m, {
2026
2013
  label: "Close",
2027
2014
  variant: "tertiary",
@@ -2030,7 +2017,7 @@ const Da = Dt(
2030
2017
  ])
2031
2018
  ];
2032
2019
  }),
2033
- default: Y(() => [
2020
+ default: q(() => [
2034
2021
  n("div", Ea, [
2035
2022
  n("div", null, [
2036
2023
  k(p, {
@@ -2040,22 +2027,22 @@ const Da = Dt(
2040
2027
  }, null, 8, ["modelValue"])
2041
2028
  ]),
2042
2029
  _e.value.value === "overview" ? (x(), P(ie, { key: 0 }, [
2043
- k(i, {
2030
+ k(l, {
2044
2031
  variant: "outlined",
2045
2032
  class: "flex flex-col gap-8 px-12 py-16"
2046
2033
  }, {
2047
- default: Y(() => {
2048
- var T, ne;
2034
+ default: q(() => {
2035
+ var T, ae;
2049
2036
  return [
2050
2037
  n("div", za, [
2051
2038
  a[11] || (a[11] = n("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
2052
2039
  n("div", Ha, [
2053
2040
  n("div", {
2054
2041
  class: $e(["fm-status-badge", v(He)(((T = u.draft) == null ? void 0 : T.status) ?? "DRAFT")])
2055
- }, X(v(ze)(((ne = u.draft) == null ? void 0 : ne.status) ?? "")), 3)
2042
+ }, X(v(ze)(((ae = u.draft) == null ? void 0 : ae.status) ?? "")), 3)
2056
2043
  ])
2057
2044
  ]),
2058
- k(r),
2045
+ k(s),
2059
2046
  n("div", Oa, [
2060
2047
  (x(!0), P(ie, null, Ce(Ue.value, (le, ge) => (x(), P("div", {
2061
2048
  class: "flex flex-col gap-4",
@@ -2074,8 +2061,8 @@ const Da = Dt(
2074
2061
  n("div", qa, [
2075
2062
  n("div", Ga, [
2076
2063
  a[12] || (a[12] = n("div", { class: "flex-1 fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Closing items ", -1)),
2077
- f.value ? te("", !0) : (x(), P("div", Wa, [
2078
- u.draft && u.draft.status !== v(he).enum.COMPLETED ? (x(), ue(m, {
2064
+ f.value ? ne("", !0) : (x(), P("div", Wa, [
2065
+ u.draft && u.draft.status !== v(he).enum.COMPLETED ? (x(), me(m, {
2079
2066
  key: 0,
2080
2067
  label: "Refresh balance",
2081
2068
  "prepend-icon": "refresh",
@@ -2084,10 +2071,10 @@ const Da = Dt(
2084
2071
  "bg-color": "transparent",
2085
2072
  "border-color": "primary",
2086
2073
  loading: M.value,
2087
- onClick: de
2088
- }, null, 8, ["loading"])) : te("", !0),
2089
- k(Ze, null, {
2090
- default: Y(() => [
2074
+ onClick: ue
2075
+ }, null, 8, ["loading"])) : ne("", !0),
2076
+ k(vt, null, {
2077
+ default: q(() => [
2091
2078
  k(m, {
2092
2079
  label: "Invalidate Draft Cache",
2093
2080
  "prepend-icon": "refresh",
@@ -2130,13 +2117,13 @@ const Da = Dt(
2130
2117
  n("div", en, [
2131
2118
  k(B, {
2132
2119
  label: "Template Item(s)",
2133
- selected: l.value.templateItem,
2134
- onClick: a[2] || (a[2] = (T) => l.value.templateItem = !l.value.templateItem)
2120
+ selected: i.value.templateItem,
2121
+ onClick: a[2] || (a[2] = (T) => i.value.templateItem = !i.value.templateItem)
2135
2122
  }, null, 8, ["selected"]),
2136
2123
  k(B, {
2137
2124
  label: "Non-template Item(s)",
2138
- selected: l.value.nonTemplateItem,
2139
- onClick: a[3] || (a[3] = (T) => l.value.nonTemplateItem = !l.value.nonTemplateItem)
2125
+ selected: i.value.nonTemplateItem,
2126
+ onClick: a[3] || (a[3] = (T) => i.value.nonTemplateItem = !i.value.nonTemplateItem)
2140
2127
  }, null, 8, ["selected"])
2141
2128
  ]),
2142
2129
  k(S, {
@@ -2146,20 +2133,20 @@ const Da = Dt(
2146
2133
  }, null, 8, ["modelValue"])
2147
2134
  ]),
2148
2135
  v(t).skuTags.size ? (x(), P("div", tn, [
2149
- (x(!0), P(ie, null, Ce(v(t).skuTags.keys(), (T) => (x(), ue(B, {
2136
+ (x(!0), P(ie, null, Ce(v(t).skuTags.keys(), (T) => (x(), me(B, {
2150
2137
  key: `${T}`,
2151
2138
  label: `${T}`,
2152
2139
  selectable: "",
2153
2140
  selected: I[`${T}`],
2154
- onClick: (ne) => I[`${T}`] = !I[`${T}`]
2141
+ onClick: (ae) => I[`${T}`] = !I[`${T}`]
2155
2142
  }, {
2156
- default: Y(() => [
2157
- I[`${T}`] ? (x(), ue(L, {
2143
+ default: q(() => [
2144
+ I[`${T}`] ? (x(), me(L, {
2158
2145
  key: 0,
2159
2146
  name: "check",
2160
2147
  class: "text-white",
2161
2148
  size: "sm"
2162
- })) : te("", !0),
2149
+ })) : ne("", !0),
2163
2150
  n("span", {
2164
2151
  class: $e([
2165
2152
  "",
@@ -2172,7 +2159,7 @@ const Da = Dt(
2172
2159
  ]),
2173
2160
  _: 2
2174
2161
  }, 1032, ["label", "selected", "onClick"]))), 128))
2175
- ])) : te("", !0),
2162
+ ])) : ne("", !0),
2176
2163
  n("div", an, [
2177
2164
  n("div", {
2178
2165
  style: bt({ height: "600px", minWidth: `${je.value}px` })
@@ -2186,18 +2173,18 @@ const Da = Dt(
2186
2173
  ])
2187
2174
  ], 64))
2188
2175
  ])
2189
- ], 64)) : te("", !0),
2176
+ ], 64)) : ne("", !0),
2190
2177
  _e.value.value === "history" ? (x(), P("div", nn, [
2191
2178
  xe.value.length ? (x(), P("div", rn, [
2192
- (x(!0), P(ie, null, Ce(xe.value, (T, ne) => (x(), P(ie, { key: ne }, [
2179
+ (x(!0), P(ie, null, Ce(xe.value, (T, ae) => (x(), P(ie, { key: ae }, [
2193
2180
  n("div", ln, [
2194
2181
  n("div", cn, [
2195
2182
  n("div", un, [
2196
2183
  n("div", {
2197
2184
  class: $e([
2198
2185
  {
2199
- "bg-fm-color-primary": ne !== 0,
2200
- "bg-white": ne === 0
2186
+ "bg-fm-color-primary": ae !== 0,
2187
+ "bg-white": ae === 0
2201
2188
  },
2202
2189
  "w-[2px] h-full"
2203
2190
  ])
@@ -2208,8 +2195,8 @@ const Da = Dt(
2208
2195
  n("div", {
2209
2196
  class: $e([
2210
2197
  {
2211
- "bg-fm-color-primary": ne < xe.value.length - 1,
2212
- "bg-white": ne >= xe.value.length - 1
2198
+ "bg-fm-color-primary": ae < xe.value.length - 1,
2199
+ "bg-white": ae >= xe.value.length - 1
2213
2200
  },
2214
2201
  "w-[2px] h-full"
2215
2202
  ])
@@ -2227,8 +2214,8 @@ const Da = Dt(
2227
2214
  n("div", {
2228
2215
  class: $e([
2229
2216
  {
2230
- "bg-fm-color-primary": ne < xe.value.length - 1,
2231
- "bg-white": ne >= xe.value.length - 1
2217
+ "bg-fm-color-primary": ae < xe.value.length - 1,
2218
+ "bg-white": ae >= xe.value.length - 1
2232
2219
  },
2233
2220
  "w-[2px] h-full"
2234
2221
  ])
@@ -2236,11 +2223,11 @@ const Da = Dt(
2236
2223
  ])
2237
2224
  ]),
2238
2225
  n("div", bn, [
2239
- k(i, {
2226
+ k(l, {
2240
2227
  variant: "outlined",
2241
2228
  class: "py-12 px-16"
2242
2229
  }, {
2243
- default: Y(() => [
2230
+ default: q(() => [
2244
2231
  n("div", hn, [
2245
2232
  (x(!0), P(ie, null, Ce(T.info, (le, ge) => (x(), P("div", {
2246
2233
  key: ge,
@@ -2262,7 +2249,7 @@ const Da = Dt(
2262
2249
  ])
2263
2250
  ], 64))), 128))
2264
2251
  ])) : (x(), P("div", on, [
2265
- k(me),
2252
+ k(de),
2266
2253
  n("div", null, [
2267
2254
  n("img", {
2268
2255
  src: v(oa),
@@ -2271,24 +2258,24 @@ const Da = Dt(
2271
2258
  ]),
2272
2259
  a[16] || (a[16] = n("div", { class: "fm-typo-en-body-lg-600" }, X("No records found"), -1)),
2273
2260
  a[17] || (a[17] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, X("You can track approval and rejection history here"), -1)),
2274
- k(me),
2275
- k(me)
2261
+ k(de),
2262
+ k(de)
2276
2263
  ]))
2277
- ])) : te("", !0)
2264
+ ])) : ne("", !0)
2278
2265
  ])
2279
2266
  ]),
2280
2267
  _: 1
2281
2268
  }, 8, ["model-value"]),
2282
- v(g) && e.draft ? (x(), ue(Na, {
2269
+ v(g) && e.draft ? (x(), me(Na, {
2283
2270
  key: 0,
2284
2271
  show: Re.value,
2285
2272
  "onUpdate:show": a[10] || (a[10] = (T) => Re.value = T),
2286
2273
  refreshing: M.value,
2287
2274
  approving: Pe.value,
2288
2275
  draft: e.draft,
2289
- onRefresh: de,
2276
+ onRefresh: ue,
2290
2277
  onApprove: jt
2291
- }, null, 8, ["show", "refreshing", "approving", "draft"])) : te("", !0)
2278
+ }, null, 8, ["show", "refreshing", "approving", "draft"])) : ne("", !0)
2292
2279
  ], 64);
2293
2280
  };
2294
2281
  }
@@ -2297,14 +2284,14 @@ const Da = Dt(
2297
2284
  setup(c) {
2298
2285
  const { t: o } = kt(), { viewDraft: e } = Ke(), { viewClosingDraftProps: d, viewClosingDraftShow: h } = Qt(Ke()), g = Ye(), f = Da(), M = Nt(), { breakpoints: U } = Ot();
2299
2286
  g.watchLocation(f.fetchDrafts);
2300
- const R = V(() => f.loading), _ = q(""), E = V(() => U.value.xs || U.value.sm), j = V(() => E.value ? 10 : 20);
2287
+ const R = V(() => f.loading), _ = Q(""), E = V(() => U.value.xs || U.value.sm), j = V(() => E.value ? 10 : 20);
2301
2288
  function G(C) {
2302
2289
  switch (C) {
2303
2290
  case "refresh":
2304
2291
  return f.fetchDrafts();
2305
2292
  }
2306
2293
  }
2307
- function s(C) {
2294
+ function r(C) {
2308
2295
  return C;
2309
2296
  }
2310
2297
  const t = V(() => E.value ? [
@@ -2321,14 +2308,14 @@ const Da = Dt(
2321
2308
  }
2322
2309
  ]);
2323
2310
  return (C, I) => {
2324
- const Z = K("FmTable");
2311
+ const W = K("FmTable");
2325
2312
  return x(), P(ie, null, [
2326
2313
  k(Et, {
2327
2314
  title: v(o)("inventory.closing.draft.title"),
2328
2315
  actions: t.value,
2329
2316
  "onClick:action": G
2330
2317
  }, {
2331
- default: Y(() => [
2318
+ default: q(() => [
2332
2319
  n("div", {
2333
2320
  class: $e([
2334
2321
  "flex flex-col gap-8 max-h-full",
@@ -2344,7 +2331,7 @@ const Da = Dt(
2344
2331
  search: _.value,
2345
2332
  "onUpdate:search": I[0] || (I[0] = (y) => _.value = y)
2346
2333
  }, null, 8, ["search"]),
2347
- k(Z, {
2334
+ k(W, {
2348
2335
  style: bt(v(M).tableHeight),
2349
2336
  "column-defs": v(f).columnDefs,
2350
2337
  "row-data": v(f).drafts,
@@ -2353,26 +2340,26 @@ const Da = Dt(
2353
2340
  onRowClick: I[1] || (I[1] = (y) => v(e)(y.original)),
2354
2341
  "page-size": j.value
2355
2342
  }, {
2356
- "list-row": Y((y) => [
2343
+ "list-row": q((y) => [
2357
2344
  k(ta, {
2358
2345
  row: y,
2359
- onRowClick: (l) => v(e)(l)
2346
+ onRowClick: (i) => v(e)(i)
2360
2347
  }, {
2361
- default: Y((l) => {
2362
- var $, z, ae, oe, w, ee, de, A, D, J, O, re, Q, ve, je, we, Ie, Ue, ke, _e;
2348
+ default: q((i) => {
2349
+ var $, H, te, oe, w, ee, ue, A, D, J, O, re, Y, ve, je, we, Ie, Ue, ke, _e;
2363
2350
  return [
2364
2351
  n("div", wn, [
2365
2352
  n("div", Sn, [
2366
2353
  n("div", Fn, [
2367
2354
  k(v(Le), {
2368
- render: (ae = (z = ($ = l._id) == null ? void 0 : $.column) == null ? void 0 : z.columnDef) == null ? void 0 : ae.cell,
2369
- props: (w = (oe = l._id) == null ? void 0 : oe.getContext) == null ? void 0 : w.call(oe)
2355
+ render: (te = (H = ($ = i._id) == null ? void 0 : $.column) == null ? void 0 : H.columnDef) == null ? void 0 : te.cell,
2356
+ props: (w = (oe = i._id) == null ? void 0 : oe.getContext) == null ? void 0 : w.call(oe)
2370
2357
  }, null, 8, ["render", "props"])
2371
2358
  ]),
2372
2359
  n("div", Cn, [
2373
2360
  k(v(Le), {
2374
- render: (A = (de = (ee = l.name) == null ? void 0 : ee.column) == null ? void 0 : de.columnDef) == null ? void 0 : A.cell,
2375
- props: (J = (D = l.name) == null ? void 0 : D.getContext) == null ? void 0 : J.call(D)
2361
+ render: (A = (ue = (ee = i.name) == null ? void 0 : ee.column) == null ? void 0 : ue.columnDef) == null ? void 0 : A.cell,
2362
+ props: (J = (D = i.name) == null ? void 0 : D.getContext) == null ? void 0 : J.call(D)
2376
2363
  }, null, 8, ["render", "props"])
2377
2364
  ]),
2378
2365
  n("div", $n, X([
@@ -2381,15 +2368,15 @@ const Da = Dt(
2381
2368
  ].join(", ")), 1),
2382
2369
  n("div", Bn, [
2383
2370
  k(v(Le), {
2384
- render: (Q = (re = (O = l.ref) == null ? void 0 : O.column) == null ? void 0 : re.columnDef) == null ? void 0 : Q.cell,
2385
- props: (je = (ve = l.ref) == null ? void 0 : ve.getContext) == null ? void 0 : je.call(ve)
2371
+ render: (Y = (re = (O = i.ref) == null ? void 0 : O.column) == null ? void 0 : re.columnDef) == null ? void 0 : Y.cell,
2372
+ props: (je = (ve = i.ref) == null ? void 0 : ve.getContext) == null ? void 0 : je.call(ve)
2386
2373
  }, null, 8, ["render", "props"])
2387
2374
  ])
2388
2375
  ]),
2389
2376
  n("div", null, [
2390
2377
  k(v(Le), {
2391
- render: (Ue = (Ie = (we = l.status) == null ? void 0 : we.column) == null ? void 0 : Ie.columnDef) == null ? void 0 : Ue.cell,
2392
- props: (_e = (ke = l.status) == null ? void 0 : ke.getContext) == null ? void 0 : _e.call(ke)
2378
+ render: (Ue = (Ie = (we = i.status) == null ? void 0 : we.column) == null ? void 0 : Ie.columnDef) == null ? void 0 : Ue.cell,
2379
+ props: (_e = (ke = i.status) == null ? void 0 : ke.getContext) == null ? void 0 : _e.call(ke)
2393
2380
  }, null, 8, ["render", "props"])
2394
2381
  ])
2395
2382
  ])
@@ -2404,7 +2391,7 @@ const Da = Dt(
2404
2391
  ]),
2405
2392
  _: 1
2406
2393
  }, 8, ["title", "actions"]),
2407
- (x(), ue(Mt, { to: "body" }, [
2394
+ (x(), me(Mt, { to: "body" }, [
2408
2395
  k(An, Lt(v(d), {
2409
2396
  show: v(h),
2410
2397
  "onUpdate:show": I[2] || (I[2] = (y) => gt(h) ? h.value = y : null),