@feedmepos/mf-inventory-portal 0.0.25-dev.50 → 0.0.25-dev.52

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 (44) hide show
  1. package/dist/{App-B7fIlPKw.js → App-DkPiRPu7.js} +34 -34
  2. package/dist/{ApprovalView-Dp20w8em.js → ApprovalView-BEF-qPdZ.js} +20 -20
  3. package/dist/{BindingsDialog-BIHCuoDe.js → BindingsDialog-B6vjaPiA.js} +4 -4
  4. package/dist/{BindingsPicker-DoM1Dh1y.js → BindingsPicker-BmWf3j6H.js} +7 -7
  5. package/dist/{BindingsTable-ChJYIxrf.js → BindingsTable-VVNmzkzf.js} +1 -1
  6. package/dist/{ClosingDraftView-L4EHR0Sb.js → ClosingDraftView-C6sNEHK5.js} +120 -120
  7. package/dist/{ClosingTemplateView-CFVINyCr.js → ClosingTemplateView-5k8R-fMI.js} +285 -285
  8. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Dn-DgO81.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DclFOxv5.js} +37 -37
  9. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CdWkJ2U-.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BFqAE1ZI.js} +32 -32
  10. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BN2ec0EU.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DwAyTAFy.js} +1 -1
  11. package/dist/{IngredientGroupView-Vz6XV_-q.js → IngredientGroupView-DAeurvqt.js} +1 -1
  12. package/dist/{IngredientsView-D1lmg_97.js → IngredientsView-Ca8fShPE.js} +4 -4
  13. package/dist/{IntegrationView-CfDmLYwt.js → IntegrationView-Db4XlQvK.js} +62 -62
  14. package/dist/{InventoryBindingForm-C68ZfWme.js → InventoryBindingForm-BTtpF1P5.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bd13FqsE.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-ByJPHKqO.js} +15 -15
  16. package/dist/{InventoryBindingSummary-DT9cg2b4.js → InventoryBindingSummary-Bb5gN9Bu.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BfhvXVHK.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D4vUOy_R.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Dvj1F-DM.js → PremiumBadge.vue_vue_type_script_setup_true_lang-fFfOjNOU.js} +3 -3
  19. package/dist/{PublishView-DMzULnCX.js → PublishView-BqE9qfwb.js} +25 -25
  20. package/dist/{PurchaseOrderPrintPreview-D6wcth8H.js → PurchaseOrderPrintPreview-Cp6a-P8I.js} +1 -1
  21. package/dist/{ReceiveRequestView-DsX41zj-.js → ReceiveRequestView-DKPPCyAU.js} +52 -52
  22. package/dist/{RecipeView-DlKk9-tm.js → RecipeView-BEsrqzuU.js} +3 -3
  23. package/dist/{StockView-CNmvVK0V.js → StockView-DplJi2OM.js} +573 -569
  24. package/dist/{SupplierView-BcoOgM67.js → SupplierView-DL3D84U2.js} +7 -7
  25. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CDDvq_mI.js → TransferDetails.vue_vue_type_script_setup_true_lang-BzFkrRui.js} +120 -120
  26. package/dist/{TransferTemplateView-BI96LQfP.js → TransferTemplateView-DakAYozL.js} +153 -153
  27. package/dist/{UnitView-BF2eBWtF.js → UnitView-C_Wqv69Z.js} +3 -3
  28. package/dist/{WarehouseView-joOR4EsJ.js → WarehouseView-CeoVZ9cs.js} +19 -19
  29. package/dist/{app-DavuMSpS.js → app-CulzKCFs.js} +6375 -5538
  30. package/dist/app.d.ts +842 -0
  31. package/dist/app.js +1 -1
  32. package/dist/{decimal-C_LJTg2_.js → decimal-DdjfkmJS.js} +1 -1
  33. package/dist/{feature-D3M-bziy.js → feature-jwErVPVw.js} +1 -1
  34. package/dist/{format-unit-display-BebmN2s-.js → format-unit-display-BMC3HZ0N.js} +30 -30
  35. package/dist/helper/number.d.ts +1 -1
  36. package/dist/{index-DzshvJTA.js → index-BDCZItPF.js} +1 -1
  37. package/dist/{index-BDEeA1dY.js → index-C7-QVxlo.js} +1 -1
  38. package/dist/{stock-CHVVTrSI.js → stock-Czw9__W8.js} +1 -1
  39. package/dist/{supplier-Ddl4sUpm.js → supplier-f0XPCLm-.js} +1 -1
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/{use-ingredient-select-dialog-Z6bbIKfM.js → use-ingredient-select-dialog-DDeNnPW0.js} +1 -1
  42. package/dist/{use-inventory-binding-dialog-Dj45RBWc.js → use-inventory-binding-dialog-BTE0Ceov.js} +1 -1
  43. package/dist/{vue-i18n-Cak3W4nS.js → vue-i18n-B0gOxrrS.js} +153 -153
  44. package/package.json +3 -3
@@ -1,30 +1,30 @@
1
- import { defineComponent as ke, ref as V, resolveComponent as E, openBlock as x, createBlock as Q, withCtx as Y, createElementVNode as o, createTextVNode as De, toDisplayString as z, unref as y, createVNode as _, h as k, reactive as Ye, computed as H, onMounted as Ke, watch as Ge, isRef as Te, createElementBlock as T, Fragment as W, createCommentVNode as ne, normalizeClass as me, renderList as ve, normalizeStyle as Re, Teleport as We, mergeProps as qe } from "vue";
2
- import { W as Ze, u as we, aj as q, l as Je, J as je, i as P, t as Qe, K as ye, q as Xe, r as et, s as tt, ak as Me, al as Pe, a6 as Ie, am as le, ac as at, ai as oe, T as Ue, D as Fe, h as xe, f as nt, e as ot, a as st, z as rt, _ as lt, B as ct, C as it, E as he } from "./app-DavuMSpS.js";
1
+ import { defineComponent as ke, ref as V, resolveComponent as E, openBlock as x, createBlock as X, withCtx as Y, createElementVNode as o, createTextVNode as De, toDisplayString as z, unref as y, createVNode as _, h as k, reactive as Ye, computed as H, onMounted as Ke, watch as Ge, isRef as Te, createElementBlock as T, Fragment as q, createCommentVNode as ne, normalizeClass as me, renderList as ve, normalizeStyle as Re, Teleport as qe, mergeProps as We } from "vue";
2
+ import { X as Ze, u as we, ak as W, l as Je, J as je, i as P, t as Xe, K as ye, q as Qe, r as et, s as tt, al as Me, am as Pe, a7 as Ie, an as le, ad as at, aj as oe, V as Ue, D as Fe, h as xe, f as nt, e as ot, a as st, z as rt, _ as lt, B as ct, C as it, E as he } from "./app-CulzKCFs.js";
3
3
  import { useCoreStore as ut, useI18n as Ee } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as Ce, useDialog as dt, useProxiedModel as mt, components as de, useBreakpoints as ft } from "@feedmepos/ui-library";
5
5
  import { defineStore as He, storeToRefs as pt } from "pinia";
6
- import { a as Le, u as ze } from "./stock-CHVVTrSI.js";
6
+ import { a as Le, u as ze } from "./stock-Czw9__W8.js";
7
7
  import { E as vt } from "./empty-placeholder-wf6-BWE8.js";
8
- const Se = Ze((n, r) => {
8
+ const Se = Ze((n, s) => {
9
9
  function e() {
10
10
  return we().currentLocation.dbName;
11
11
  }
12
12
  return {
13
13
  async getDraft(i) {
14
14
  const u = e(), g = `${n.inventoryBackendUrl}/${u}/closing-draft/${i}`;
15
- return r.get(g);
15
+ return s.get(g);
16
16
  },
17
17
  async readDrafts() {
18
18
  const i = e(), u = `${n.inventoryBackendUrl}/${i}/closing-draft`;
19
- return r.get(u);
19
+ return s.get(u);
20
20
  },
21
21
  async runOperation(i) {
22
22
  const u = e(), g = `${n.inventoryBackendUrl}/${u}/closing-draft/run-operation`;
23
- return r.post(g, i);
23
+ return s.post(g, i);
24
24
  },
25
25
  async sync(i) {
26
26
  const u = e(), g = `${n.inventoryBackendUrl}/${u}/closing-draft/sync`;
27
- return r.post(g, i);
27
+ return s.post(g, i);
28
28
  }
29
29
  };
30
30
  }), yt = { class: "fm-typo-en-body-lg-400" }, gt = { class: "fm-typo-en-body-lg-600" }, bt = { class: "flex gap-12 py-8 justify-end w-full" }, $e = /* @__PURE__ */ ke({
@@ -36,14 +36,14 @@ const Se = Ze((n, r) => {
36
36
  onFinished: { type: Function }
37
37
  },
38
38
  setup(n) {
39
- const r = n, e = V(), i = Se(), u = Ce(), g = V(!1);
39
+ const s = n, e = V(), i = Se(), u = Ce(), g = V(!1);
40
40
  async function h() {
41
41
  g.value = !0;
42
42
  try {
43
43
  await i.runOperation({
44
- _id: r.draft._id,
45
- _rev: r.draft._rev ?? "",
46
- action: r.action,
44
+ _id: s.draft._id,
45
+ _rev: s.draft._rev ?? "",
46
+ action: s.action,
47
47
  data: {
48
48
  remark: e.value
49
49
  }
@@ -51,7 +51,7 @@ const Se = Ze((n, r) => {
51
51
  title: "Success",
52
52
  message: "Action submitted",
53
53
  type: "success"
54
- }), r.onFinished();
54
+ }), s.onFinished();
55
55
  } catch (D) {
56
56
  u.open({
57
57
  title: "Something went wrong",
@@ -64,7 +64,7 @@ const Se = Ze((n, r) => {
64
64
  }
65
65
  return (D, l) => {
66
66
  const R = E("FmTextField"), M = E("FmButton"), U = E("FmForm");
67
- return x(), Q(U, {
67
+ return x(), X(U, {
68
68
  onValidationSuccess: h,
69
69
  class: "flex flex-col gap-32",
70
70
  disabled: g.value
@@ -72,12 +72,12 @@ const Se = Ze((n, r) => {
72
72
  default: Y(() => [
73
73
  o("div", yt, [
74
74
  l[2] || (l[2] = De(" You are about to ")),
75
- o("span", gt, z(D.action == y(q).enum.approveDraft ? "approve" : "reject"), 1),
75
+ o("span", gt, z(D.action == y(W).enum.approveDraft ? "approve" : "reject"), 1),
76
76
  l[3] || (l[3] = De(" this draft. Please provider a remark to justify this action. "))
77
77
  ]),
78
78
  _(R, {
79
79
  modelValue: e.value,
80
- "onUpdate:modelValue": l[0] || (l[0] = (s) => e.value = s),
80
+ "onUpdate:modelValue": l[0] || (l[0] = (r) => e.value = r),
81
81
  label: "Remark",
82
82
  "label-mark": "required",
83
83
  rules: [y(Je)()]
@@ -86,12 +86,12 @@ const Se = Ze((n, r) => {
86
86
  _(M, {
87
87
  label: "Cancel",
88
88
  variant: "tertiary",
89
- onClick: l[1] || (l[1] = (s) => D.onCancel())
89
+ onClick: l[1] || (l[1] = (r) => D.onCancel())
90
90
  }),
91
91
  _(M, {
92
- label: D.action == y(q).enum.approveDraft ? "Approve" : "Reject",
92
+ label: D.action == y(W).enum.approveDraft ? "Approve" : "Reject",
93
93
  type: "submit",
94
- variant: D.action == y(q).enum.approveDraft ? "primary" : "destructive",
94
+ variant: D.action == y(W).enum.approveDraft ? "primary" : "destructive",
95
95
  loading: g.value
96
96
  }, null, 8, ["label", "variant", "loading"])
97
97
  ])
@@ -102,18 +102,18 @@ const Se = Ze((n, r) => {
102
102
  }
103
103
  }), xt = ye(0);
104
104
  function Ne(n) {
105
- const r = n.measurementsAmounts.groupBy((i) => i.measurement.id), e = n.sku.unit.measurements.reduce((i, u) => {
105
+ const s = n.measurementsAmounts.groupBy((i) => i.measurement.id), e = n.sku.unit.measurements.reduce((i, u) => {
106
106
  var D, l;
107
- const g = ((l = (D = r.get(u.id)) == null ? void 0 : D[0]) == null ? void 0 : l.amount) ?? xt, h = je(u.conversion, g);
107
+ const g = ((l = (D = s.get(u.id)) == null ? void 0 : D[0]) == null ? void 0 : l.amount) ?? xt, h = je(u.conversion, g);
108
108
  return i + +P(h);
109
109
  }, +P(n.baseAmount));
110
- return Qe(e, n.baseAmount.precision);
110
+ return Xe(e, n.baseAmount.precision);
111
111
  }
112
112
  const ht = ye(0), At = ye(100);
113
- function _t(n, r, e) {
114
- const i = Ne(n), u = Me(i, r), g = r.amount === 0 ? null : Pe(u, {
115
- ...r,
116
- amount: Math.abs(r.amount)
113
+ function _t(n, s, e) {
114
+ const i = Ne(n), u = Me(i, s), g = s.amount === 0 ? null : Pe(u, {
115
+ ...s,
116
+ amount: Math.abs(s.amount)
117
117
  }), h = g ? je(g, At) : null;
118
118
  return {
119
119
  code: n.sku.code,
@@ -126,7 +126,7 @@ function _t(n, r, e) {
126
126
  (l, R, M) => (l[`measurementAbbrev${M}`] = `(${R.measurement.abbrev}) × ${P(R.measurement.conversion)}`, l[`measurementAmount${M}`] = +P(R.amount), l),
127
127
  {}
128
128
  ),
129
- systemBalance: +P(r),
129
+ systemBalance: +P(s),
130
130
  physicalBalance: +P(i),
131
131
  adjustedAmount: +P(u),
132
132
  adjustedDiffPercentage: h ? +P(Ie(h, 2)) : null
@@ -136,19 +136,19 @@ function Dt(n) {
136
136
  return !n.abbrev.toLocaleLowerCase().includes("inactive");
137
137
  }
138
138
  function kt(n) {
139
- const r = Oe(n);
139
+ const s = Oe(n);
140
140
  return n.reduce(
141
141
  (e, i) => {
142
142
  var u;
143
- return Math.max(e, ((u = r == null ? void 0 : r.get(i.sku._id)) == null ? void 0 : u[0].length) ?? 0);
143
+ return Math.max(e, ((u = s == null ? void 0 : s.get(i.sku._id)) == null ? void 0 : u[0].length) ?? 0);
144
144
  },
145
145
  0
146
146
  );
147
147
  }
148
148
  function Oe(n) {
149
149
  return n.groupBy(
150
- (r) => r.sku._id,
151
- (r) => r.measurementsAmounts.filter((e) => !e.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((e) => e.measurement.id)
150
+ (s) => s.sku._id,
151
+ (s) => s.measurementsAmounts.filter((e) => !e.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((e) => e.measurement.id)
152
152
  );
153
153
  }
154
154
  function wt(n) {
@@ -197,15 +197,15 @@ function wt(n) {
197
197
  ])
198
198
  ];
199
199
  }
200
- function jt(n, r) {
200
+ function jt(n, s) {
201
201
  var B, b, v, F, N, C, I;
202
- const e = r.groupBy(
202
+ const e = s.groupBy(
203
203
  (w) => w.id,
204
204
  (w) => w.balance
205
205
  ), i = [...n.items, ...n.negativeStockItems ?? []], u = Oe(i), g = i.map((w) => {
206
206
  var K, se;
207
- const Z = ((K = e.get(w.sku._id)) == null ? void 0 : K[0]) ?? ht, X = ((se = u == null ? void 0 : u.get(w.sku._id)) == null ? void 0 : se[0]) ?? [];
208
- return _t(w, Z, X);
207
+ const Z = ((K = e.get(w.sku._id)) == null ? void 0 : K[0]) ?? ht, Q = ((se = u == null ? void 0 : u.get(w.sku._id)) == null ? void 0 : se[0]) ?? [];
208
+ return _t(w, Z, Q);
209
209
  }), h = kt(i), l = ut().currentBusiness.value, R = wt(h), M = [
210
210
  ["Business name:", l == null ? void 0 : l.name],
211
211
  ["Business ID:", l == null ? void 0 : l._id],
@@ -230,13 +230,13 @@ function jt(n, r) {
230
230
  [],
231
231
  R.map((w) => w.name),
232
232
  ...g.map((w) => R.map((Z) => w[Z.id]))
233
- ], U = R.map((w) => `system:${w.id}`), s = Xe(M, U), p = `[${l == null ? void 0 : l.name}] closing draft (${et(new Date(n.updatedAt))}).xlsx`;
234
- return tt(s, p), p;
233
+ ], U = R.map((w) => `system:${w.id}`), r = Qe(M, U), p = `[${l == null ? void 0 : l.name}] closing draft (${et(new Date(n.updatedAt))}).xlsx`;
234
+ return tt(r, p), p;
235
235
  }
236
236
  const _e = He(
237
237
  "closingDraftActions",
238
238
  function() {
239
- const r = dt(), e = Ce(), i = Le(), u = Se(), g = ze(), h = V(!1), D = V();
239
+ const s = dt(), e = Ce(), i = Le(), u = Se(), g = ze(), h = V(!1), D = V();
240
240
  function l(b) {
241
241
  const v = {
242
242
  draft: b
@@ -271,30 +271,30 @@ const _e = He(
271
271
  }), v = await R(b)), jt(b, v);
272
272
  }
273
273
  function U(b, v) {
274
- r.open({
274
+ s.open({
275
275
  title: "Approve draft",
276
276
  contentComponent: $e,
277
277
  contentComponentProps: {
278
278
  draft: b,
279
- action: q.enum.approveDraft,
279
+ action: W.enum.approveDraft,
280
280
  onFinished: () => {
281
- r.close(), v == null || v();
281
+ s.close(), v == null || v();
282
282
  },
283
- onCancel: () => r.close()
283
+ onCancel: () => s.close()
284
284
  }
285
285
  });
286
286
  }
287
- function s(b, v) {
288
- r.open({
287
+ function r(b, v) {
288
+ s.open({
289
289
  title: "Reject draft",
290
290
  contentComponent: $e,
291
291
  contentComponentProps: {
292
292
  draft: b,
293
- action: q.enum.rejectDraft,
293
+ action: W.enum.rejectDraft,
294
294
  onFinished: () => {
295
- r.close(), v == null || v();
295
+ s.close(), v == null || v();
296
296
  },
297
- onCancel: () => r.close()
297
+ onCancel: () => s.close()
298
298
  }
299
299
  });
300
300
  }
@@ -302,7 +302,7 @@ const _e = He(
302
302
  await u.sync({
303
303
  _id: b._id,
304
304
  _rev: b._rev ?? "",
305
- action: q.enum.approveDraft,
305
+ action: W.enum.approveDraft,
306
306
  data: {
307
307
  remark: b.remark ?? ""
308
308
  }
@@ -319,7 +319,7 @@ const _e = He(
319
319
  viewDraft: l,
320
320
  closeDraftDialog: B,
321
321
  approveDraft: U,
322
- rejectDraft: s,
322
+ rejectDraft: r,
323
323
  syncDraft: p,
324
324
  exportDraft: M,
325
325
  viewClosingDraftShow: h,
@@ -342,26 +342,26 @@ function Ae(n) {
342
342
  const Ct = He(
343
343
  "closingDraftTable",
344
344
  function() {
345
- const { t: r } = Ee(), e = _e(), i = V(new Array()), u = V(!1), g = we(), h = Se();
345
+ const { t: s } = Ee(), e = _e(), i = V(new Array()), u = V(!1), g = we(), h = Se();
346
346
  async function D() {
347
347
  if (i.value = [], !!g._currentLocation) {
348
348
  u.value = !0;
349
349
  try {
350
- const [s] = await Promise.all([h.readDrafts()]).delayed(1e3);
351
- i.value = s.reverse();
352
- } catch (s) {
353
- console.log("Something went wrong when fetching drafts:", s);
350
+ const [r] = await Promise.all([h.readDrafts()]).delayed(1e3);
351
+ i.value = r.reverse();
352
+ } catch (r) {
353
+ console.log("Something went wrong when fetching drafts:", r);
354
354
  } finally {
355
355
  u.value = !1;
356
356
  }
357
357
  }
358
358
  }
359
- async function l(s) {
359
+ async function l(r) {
360
360
  if (!i.value.find((p) => p._id) && g._currentLocation) {
361
361
  u.value = !0;
362
362
  try {
363
363
  const [p] = await Promise.all([
364
- h.getDraft(s),
364
+ h.getDraft(r),
365
365
  new Promise((B) => setTimeout(B, 1e3))
366
366
  ]);
367
367
  i.value = [p];
@@ -375,15 +375,15 @@ const Ct = He(
375
375
  function R() {
376
376
  e.closeDraftDialog(), D();
377
377
  }
378
- function M(s, p) {
379
- switch (p = ot(p), s) {
378
+ function M(r, p) {
379
+ switch (p = ot(p), r) {
380
380
  case xe.Details:
381
381
  return e.viewDraft(p);
382
382
  case xe.Export:
383
383
  return e.exportDraft(p);
384
- case q.enum.approveDraft:
384
+ case W.enum.approveDraft:
385
385
  return e.approveDraft(p, R);
386
- case q.enum.rejectDraft:
386
+ case W.enum.rejectDraft:
387
387
  return e.rejectDraft(p, R);
388
388
  }
389
389
  }
@@ -392,15 +392,15 @@ const Ct = He(
392
392
  {
393
393
  id: "_id",
394
394
  accessorKey: "_id",
395
- header: () => r("inventory.closing.table.createdAt"),
396
- cell(s) {
397
- return at(`${s.getValue()}`);
395
+ header: () => s("inventory.closing.table.createdAt"),
396
+ cell(r) {
397
+ return at(`${r.getValue()}`);
398
398
  },
399
399
  enableSorting: !0
400
400
  },
401
401
  {
402
402
  id: "updatedAt",
403
- accessorFn: (s) => oe(s.updatedAt),
403
+ accessorFn: (r) => oe(r.updatedAt),
404
404
  header: () => "Updated at",
405
405
  enableSorting: !0,
406
406
  size: 200
@@ -414,11 +414,11 @@ const Ct = He(
414
414
  },
415
415
  {
416
416
  id: "noOfItems",
417
- accessorFn: (s) => {
417
+ accessorFn: (r) => {
418
418
  var p;
419
- return s.items.length + (((p = s.negativeStockItems) == null ? void 0 : p.length) ?? 0);
419
+ return r.items.length + (((p = r.negativeStockItems) == null ? void 0 : p.length) ?? 0);
420
420
  },
421
- header: () => r("inventory.closing.table.noOfItems"),
421
+ header: () => s("inventory.closing.table.noOfItems"),
422
422
  enableSorting: !1,
423
423
  meta: {
424
424
  width: "10rem",
@@ -427,20 +427,20 @@ const Ct = He(
427
427
  },
428
428
  {
429
429
  id: "recentRemark",
430
- accessorFn: (s) => {
430
+ accessorFn: (r) => {
431
431
  var p;
432
- return (s == null ? void 0 : s.approveRemark) ?? ((p = s == null ? void 0 : s.rejectionHistory) == null ? void 0 : p.computeFirst((B) => B.rejectRemark)) ?? s.remark;
432
+ return (r == null ? void 0 : r.approveRemark) ?? ((p = r == null ? void 0 : r.rejectionHistory) == null ? void 0 : p.computeFirst((B) => B.rejectRemark)) ?? r.remark;
433
433
  },
434
434
  header: () => "Recent remark"
435
435
  },
436
436
  {
437
437
  id: "status",
438
- accessorFn: (s) => s.status,
439
- header: () => r("inventory.closing.table.status"),
438
+ accessorFn: (r) => r.status,
439
+ header: () => s("inventory.closing.table.status"),
440
440
  enableSorting: !1,
441
- cell(s) {
441
+ cell(r) {
442
442
  var N;
443
- const p = s.row.original, B = p.status, b = new Date(p.updatedAt), v = (N = p == null ? void 0 : p.rejectionHistory) == null ? void 0 : N.computeFirst((C) => C.rejectedAt), F = v ? new Date(v) : null;
443
+ const p = r.row.original, B = p.status, b = new Date(p.updatedAt), v = (N = p == null ? void 0 : p.rejectionHistory) == null ? void 0 : N.computeFirst((C) => C.rejectedAt), F = v ? new Date(v) : null;
444
444
  return B === "DRAFT" && F ? F.getTime() > b.getTime() ? k(
445
445
  "div",
446
446
  {
@@ -482,20 +482,20 @@ const Ct = He(
482
482
  },
483
483
  {
484
484
  id: "action",
485
- cell(s) {
486
- const p = s.row.original, B = [
485
+ cell(r) {
486
+ const p = r.row.original, B = [
487
487
  Fe[xe.Details],
488
488
  Fe[xe.Export]
489
489
  ], b = [
490
490
  {
491
491
  translationKey: "inventory.closing.draft.approveDraft",
492
492
  color: "text-fm-color-typo-primary",
493
- value: q.enum.approveDraft
493
+ value: W.enum.approveDraft
494
494
  },
495
495
  {
496
496
  translationKey: "inventory.closing.draft.rejectDraft",
497
497
  color: "text-fm-color-typo-error",
498
- value: q.enum.rejectDraft
498
+ value: W.enum.rejectDraft
499
499
  }
500
500
  ];
501
501
  return nt(
@@ -538,10 +538,10 @@ const Ct = He(
538
538
  }, Kt = { class: "flex gap-12 content-stretch" }, Gt = {
539
539
  class: "flex flex-col w-24",
540
540
  name: "circles"
541
- }, Wt = { class: "flex-1 flex flex-col items-center" }, qt = { class: "flex-1 flex flex-col items-center" }, Zt = {
541
+ }, qt = { class: "flex-1 flex flex-col items-center" }, Wt = { class: "flex-1 flex flex-col items-center" }, Zt = {
542
542
  class: "py-12 flex flex-col gap-4",
543
543
  name: "received-at header"
544
- }, Jt = { class: "fm-typo-en-body-lg-400" }, Qt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Xt = { class: "flex gap-12 content-stretch" }, ea = {
544
+ }, Jt = { class: "fm-typo-en-body-lg-400" }, Xt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Qt = { class: "flex gap-12 content-stretch" }, ea = {
545
545
  class: "flex flex-col w-24",
546
546
  name: "circles"
547
547
  }, ta = { class: "flex-1 flex flex-col items-center" }, aa = {
@@ -554,13 +554,13 @@ const Ct = He(
554
554
  draft: {}
555
555
  },
556
556
  emits: ["submitted"],
557
- setup(n, { emit: r }) {
558
- const e = n, i = ze(), u = _e(), g = mt(e, "show"), h = V(!1), D = V(!1), l = V(new Array()), R = Le(), M = Ce(), U = st(), s = Ye({}), p = H(() => new Set(
557
+ setup(n, { emit: s }) {
558
+ const e = n, i = ze(), u = _e(), g = mt(e, "show"), h = V(!1), D = V(!1), l = V(new Array()), R = Le(), M = Ce(), U = st(), r = Ye({}), p = H(() => new Set(
559
559
  U.skus.filter((a) => {
560
560
  var t;
561
- return s[(t = a.customAttributes) == null ? void 0 : t.tag];
561
+ return r[(t = a.customAttributes) == null ? void 0 : t.tag];
562
562
  }).map((a) => a._id)
563
- )), B = r, b = H(() => {
563
+ )), B = s, b = H(() => {
564
564
  var t, c;
565
565
  const a = [...((t = e.draft) == null ? void 0 : t.items) ?? [], ...((c = e.draft) == null ? void 0 : c.negativeStockItems) ?? []];
566
566
  return p.value.size ? a.filter((m) => p.value.has(m.sku._id)) : a;
@@ -619,7 +619,7 @@ const Ct = He(
619
619
  (a) => a.balance
620
620
  )
621
621
  ), Z = H(() => b.value.groupBy((a) => a.sku._id));
622
- function X(a) {
622
+ function Q(a) {
623
623
  return k(
624
624
  de.FmTooltip,
625
625
  { zIndex: 51, placement: "left", class: "w-full flex justify-end" },
@@ -693,7 +693,7 @@ const Ct = He(
693
693
  {
694
694
  id: "physicalBalance",
695
695
  accessorKey: "physicalBalance",
696
- header: () => X("Actual balance"),
696
+ header: () => Q("Actual balance"),
697
697
  size: 200,
698
698
  meta: {
699
699
  textAlign: "right"
@@ -702,7 +702,7 @@ const Ct = He(
702
702
  {
703
703
  id: "systemBalance",
704
704
  accessorKey: "systemBalance",
705
- header: () => X("Balance"),
705
+ header: () => Q("Balance"),
706
706
  size: 200,
707
707
  meta: {
708
708
  textAlign: "right"
@@ -711,7 +711,7 @@ const Ct = He(
711
711
  {
712
712
  id: "adjustedAmount",
713
713
  accessorKey: "adjustedAmount",
714
- header: () => X("Adjusted balance"),
714
+ header: () => Q("Adjusted balance"),
715
715
  size: 200,
716
716
  meta: {
717
717
  textAlign: "right"
@@ -953,7 +953,7 @@ const Ct = He(
953
953
  });
954
954
  return (a, t) => {
955
955
  const c = E("FmButtonGroup"), m = E("FmMenuDivider"), d = E("FmCard"), f = E("FmButton"), j = E("FmCircularProgress"), $ = E("FmTextField"), S = E("FmIcon"), ie = E("FmChip"), ae = E("FmTable"), G = E("FmSpacer"), re = E("FmTooltip"), be = E("FmSideSheet");
956
- return x(), Q(be, {
956
+ return x(), X(be, {
957
957
  "dismiss-away": "",
958
958
  "max-width": 9999,
959
959
  "model-value": y(g),
@@ -964,8 +964,8 @@ const Ct = He(
964
964
  var A, L, O, ue;
965
965
  return [
966
966
  o("div", ra, [
967
- ((A = e.draft) == null ? void 0 : A.status) === y(le).enum.DRAFT ? (x(), T(W, { key: 0 }, [
968
- pe.value ? (x(), Q(re, {
967
+ ((A = e.draft) == null ? void 0 : A.status) === y(le).enum.DRAFT ? (x(), T(q, { key: 0 }, [
968
+ pe.value ? (x(), X(re, {
969
969
  key: 0,
970
970
  "z-index": 51
971
971
  }, {
@@ -981,19 +981,19 @@ const Ct = He(
981
981
  })
982
982
  ]),
983
983
  _: 1
984
- })) : (x(), Q(f, {
984
+ })) : (x(), X(f, {
985
985
  key: "approve key",
986
986
  label: "Approve",
987
987
  onClick: t[4] || (t[4] = () => e.draft && y(u).approveDraft(e.draft, () => B("submitted")))
988
988
  }))
989
989
  ], 64)) : ne("", !0),
990
- ((L = e.draft) == null ? void 0 : L.status) === y(le).enum.DRAFT ? (x(), Q(f, {
990
+ ((L = e.draft) == null ? void 0 : L.status) === y(le).enum.DRAFT ? (x(), X(f, {
991
991
  key: 1,
992
992
  label: "Reject",
993
993
  variant: "destructive",
994
994
  onClick: t[5] || (t[5] = () => e.draft && y(u).rejectDraft(e.draft, () => B("submitted")))
995
995
  })) : ne("", !0),
996
- (O = e.draft) != null && O.approvedAt && ((ue = e.draft) == null ? void 0 : ue.status) !== y(le).enum.COMPLETED ? (x(), Q(f, {
996
+ (O = e.draft) != null && O.approvedAt && ((ue = e.draft) == null ? void 0 : ue.status) !== y(le).enum.COMPLETED ? (x(), X(f, {
997
997
  key: 2,
998
998
  label: "Sync",
999
999
  loading: D.value,
@@ -1020,7 +1020,7 @@ const Ct = He(
1020
1020
  "onUpdate:modelValue": t[0] || (t[0] = (A) => te.value = A)
1021
1021
  }, null, 8, ["modelValue"])
1022
1022
  ]),
1023
- te.value.value === "overview" ? (x(), T(W, { key: 0 }, [
1023
+ te.value.value === "overview" ? (x(), T(q, { key: 0 }, [
1024
1024
  _(d, {
1025
1025
  variant: "outlined",
1026
1026
  class: "flex flex-col gap-8 px-12 py-16"
@@ -1038,7 +1038,7 @@ const Ct = He(
1038
1038
  ]),
1039
1039
  _(m),
1040
1040
  o("div", $t, [
1041
- (x(!0), T(W, null, ve(ge.value, (O, ue) => (x(), T("div", {
1041
+ (x(!0), T(q, null, ve(ge.value, (O, ue) => (x(), T("div", {
1042
1042
  class: "flex flex-col gap-4",
1043
1043
  key: ue
1044
1044
  }, [
@@ -1076,7 +1076,7 @@ const Ct = He(
1076
1076
  t[11] || (t[11] = o("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fetching info... ", -1))
1077
1077
  ]),
1078
1078
  t[13] || (t[13] = o("div", { class: "h-80" }, null, -1))
1079
- ])) : (x(), T(W, { key: 1 }, [
1079
+ ])) : (x(), T(q, { key: 1 }, [
1080
1080
  o("div", null, [
1081
1081
  _($, {
1082
1082
  modelValue: ce.value,
@@ -1085,15 +1085,15 @@ const Ct = He(
1085
1085
  }, null, 8, ["modelValue"])
1086
1086
  ]),
1087
1087
  y(U).skuTags.size ? (x(), T("div", Lt, [
1088
- (x(!0), T(W, null, ve(y(U).skuTags.keys(), (A) => (x(), Q(ie, {
1088
+ (x(!0), T(q, null, ve(y(U).skuTags.keys(), (A) => (x(), X(ie, {
1089
1089
  key: `${A}`,
1090
1090
  label: `${A}`,
1091
1091
  selectable: "",
1092
- selected: s[`${A}`],
1093
- onClick: (L) => s[`${A}`] = !s[`${A}`]
1092
+ selected: r[`${A}`],
1093
+ onClick: (L) => r[`${A}`] = !r[`${A}`]
1094
1094
  }, {
1095
1095
  default: Y(() => [
1096
- s[`${A}`] ? (x(), Q(S, {
1096
+ r[`${A}`] ? (x(), X(S, {
1097
1097
  key: 0,
1098
1098
  name: "check",
1099
1099
  class: "text-white",
@@ -1103,8 +1103,8 @@ const Ct = He(
1103
1103
  class: me([
1104
1104
  "",
1105
1105
  {
1106
- "text-white fm-typo-en-body-md-600": s[`${A}`],
1107
- "text-fm-color-typo-primary fm-typo-en-body-md-400": !s[`${A}`]
1106
+ "text-white fm-typo-en-body-md-600": r[`${A}`],
1107
+ "text-fm-color-typo-primary fm-typo-en-body-md-400": !r[`${A}`]
1108
1108
  }
1109
1109
  ])
1110
1110
  }, z(A), 3)
@@ -1128,10 +1128,10 @@ const Ct = He(
1128
1128
  ], 64)) : ne("", !0),
1129
1129
  te.value.value === "history" ? (x(), T("div", Nt, [
1130
1130
  J.value.length ? (x(), T("div", Yt, [
1131
- (x(!0), T(W, null, ve(J.value, (A, L) => (x(), T(W, { key: L }, [
1131
+ (x(!0), T(q, null, ve(J.value, (A, L) => (x(), T(q, { key: L }, [
1132
1132
  o("div", Kt, [
1133
1133
  o("div", Gt, [
1134
- o("div", Wt, [
1134
+ o("div", qt, [
1135
1135
  o("div", {
1136
1136
  class: me([
1137
1137
  {
@@ -1143,7 +1143,7 @@ const Ct = He(
1143
1143
  }, null, 2)
1144
1144
  ]),
1145
1145
  t[16] || (t[16] = o("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
1146
- o("div", qt, [
1146
+ o("div", Wt, [
1147
1147
  o("div", {
1148
1148
  class: me([
1149
1149
  {
@@ -1157,10 +1157,10 @@ const Ct = He(
1157
1157
  ]),
1158
1158
  o("div", Zt, [
1159
1159
  o("div", Jt, z(A.header), 1),
1160
- o("div", Qt, z(A.date), 1)
1160
+ o("div", Xt, z(A.date), 1)
1161
1161
  ])
1162
1162
  ]),
1163
- o("div", Xt, [
1163
+ o("div", Qt, [
1164
1164
  o("div", ea, [
1165
1165
  o("div", ta, [
1166
1166
  o("div", {
@@ -1181,13 +1181,13 @@ const Ct = He(
1181
1181
  }, {
1182
1182
  default: Y(() => [
1183
1183
  o("div", na, [
1184
- (x(!0), T(W, null, ve(A.info, (O, ue) => (x(), T("div", {
1184
+ (x(!0), T(q, null, ve(A.info, (O, ue) => (x(), T("div", {
1185
1185
  key: ue,
1186
1186
  class: "flex flex-col gap-4"
1187
1187
  }, [
1188
1188
  o("div", oa, z(O == null ? void 0 : O.label), 1),
1189
1189
  o("div", sa, [
1190
- (x(!0), T(W, null, ve(O == null ? void 0 : O.values, (Be, Ve) => (x(), T("div", {
1190
+ (x(!0), T(q, null, ve(O == null ? void 0 : O.values, (Be, Ve) => (x(), T("div", {
1191
1191
  key: Ve,
1192
1192
  class: "fm-typo-en-body-lg-600"
1193
1193
  }, z(Be), 1))), 128))
@@ -1223,9 +1223,9 @@ const Ct = He(
1223
1223
  }), ca = { class: "flex-1 flex flex-col gap-8" }, ia = { class: "flex flex-col" }, ua = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, da = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, ma = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, fa = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Aa = /* @__PURE__ */ ke({
1224
1224
  __name: "ClosingDraftView",
1225
1225
  setup(n) {
1226
- const { t: r } = Ee(), { viewDraft: e } = _e(), { viewClosingDraftProps: i, viewClosingDraftShow: u } = pt(_e()), g = we(), h = Ct(), D = rt(), { breakpoints: l } = ft();
1226
+ const { t: s } = Ee(), { viewDraft: e } = _e(), { viewClosingDraftProps: i, viewClosingDraftShow: u } = pt(_e()), g = we(), h = Ct(), D = rt(), { breakpoints: l } = ft();
1227
1227
  g.watchLocation(h.fetchDrafts);
1228
- const R = H(() => h.loading), M = V(""), U = H(() => l.value.xs || l.value.sm), s = H(() => U.value ? 10 : 20);
1228
+ const R = H(() => h.loading), M = V(""), U = H(() => l.value.xs || l.value.sm), r = H(() => U.value ? 10 : 20);
1229
1229
  function p(v) {
1230
1230
  switch (v) {
1231
1231
  case "refresh":
@@ -1237,22 +1237,22 @@ const Ct = He(
1237
1237
  }
1238
1238
  const b = H(() => U.value ? [
1239
1239
  {
1240
- label: "Refresh",
1240
+ label: s("inventory.common.refresh"),
1241
1241
  value: "refresh",
1242
1242
  isPrimary: !1
1243
1243
  }
1244
1244
  ] : [
1245
1245
  {
1246
- label: "Refresh",
1246
+ label: s("inventory.common.refresh"),
1247
1247
  value: "refresh",
1248
1248
  isPrimary: !1
1249
1249
  }
1250
1250
  ]);
1251
1251
  return (v, F) => {
1252
1252
  const N = E("FmTable");
1253
- return x(), T(W, null, [
1253
+ return x(), T(q, null, [
1254
1254
  _(lt, {
1255
- title: y(r)("inventory.closing.draft.title"),
1255
+ title: y(s)("inventory.closing.draft.title"),
1256
1256
  actions: b.value,
1257
1257
  "onClick:action": p
1258
1258
  }, {
@@ -1279,7 +1279,7 @@ const Ct = He(
1279
1279
  "search-value": M.value,
1280
1280
  loading: R.value,
1281
1281
  onRowClick: F[1] || (F[1] = (C) => y(e)(C.original)),
1282
- "page-size": s.value
1282
+ "page-size": r.value
1283
1283
  }, {
1284
1284
  "list-row": Y((C) => [
1285
1285
  _(it, {
@@ -1287,13 +1287,13 @@ const Ct = He(
1287
1287
  onRowClick: (I) => y(e)(I)
1288
1288
  }, {
1289
1289
  default: Y((I) => {
1290
- var w, Z, X, K, se, ce, fe, ge, ee, te, J, pe, a, t, c, m, d, f, j, $;
1290
+ var w, Z, Q, K, se, ce, fe, ge, ee, te, J, pe, a, t, c, m, d, f, j, $;
1291
1291
  return [
1292
1292
  o("div", ca, [
1293
1293
  o("div", ia, [
1294
1294
  o("div", ua, [
1295
1295
  _(y(he), {
1296
- render: (X = (Z = (w = I._id) == null ? void 0 : w.column) == null ? void 0 : Z.columnDef) == null ? void 0 : X.cell,
1296
+ render: (Q = (Z = (w = I._id) == null ? void 0 : w.column) == null ? void 0 : Z.columnDef) == null ? void 0 : Q.cell,
1297
1297
  props: (se = (K = I._id) == null ? void 0 : K.getContext) == null ? void 0 : se.call(K)
1298
1298
  }, null, 8, ["render", "props"])
1299
1299
  ]),
@@ -1332,8 +1332,8 @@ const Ct = He(
1332
1332
  ]),
1333
1333
  _: 1
1334
1334
  }, 8, ["title", "actions"]),
1335
- (x(), Q(We, { to: "body" }, [
1336
- _(la, qe(y(i), {
1335
+ (x(), X(qe, { to: "body" }, [
1336
+ _(la, We(y(i), {
1337
1337
  show: y(u),
1338
1338
  "onUpdate:show": F[2] || (F[2] = (C) => Te(u) ? u.value = C : null),
1339
1339
  onSubmitted: F[3] || (F[3] = () => (u.value = !1, y(h).fetchDrafts()))