@feedmepos/mf-inventory-portal 1.2.3 → 1.2.4

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-CSdfULWS.js → App-BU_WSlx-.js} +1 -1
  2. package/dist/{ApprovalView-DTwnAFlM.js → ApprovalView-l2DdsNXH.js} +8 -8
  3. package/dist/{BindingsDialog-Bv24Ys1r.js → BindingsDialog-B4tQ9oQ2.js} +2 -2
  4. package/dist/{BindingsPicker-D-HNXv6l.js → BindingsPicker-mVGeJMi2.js} +1 -1
  5. package/dist/{BindingsTable-B5xE1kAV.js → BindingsTable-CQfPvj8g.js} +1 -1
  6. package/dist/{ClosingDraftView-BbLjS-QV.js → ClosingDraftView-BJOcWcjt.js} +93 -93
  7. package/dist/{ClosingTemplateView-Do0CkGUH.js → ClosingTemplateView-DaYjDBPc.js} +17 -17
  8. package/dist/{DeliveryOrderPrintPreview-B2YhyN59.js → DeliveryOrderPrintPreview-vHQa4Pma.js} +7 -7
  9. package/dist/{FmAdminBadge-Cj1R2Bi0.js → FmAdminBadge-DUYqoh_b.js} +3 -3
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C1pSdLfz.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-SmAbact2.js} +11 -11
  11. package/dist/{FmMultiselectDialog-eq994oQ-.js → FmMultiselectDialog-CKfAAKn7.js} +1 -1
  12. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BheQFvJF.js → FmUnitInput.vue_vue_type_script_setup_true_lang-a967Y4eW.js} +24 -24
  13. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DDbMiztC.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CBI-U1s2.js} +1 -1
  14. package/dist/{IngredientGroupView-DNAdO4WQ.js → IngredientGroupView-CeQ7PRmJ.js} +31 -31
  15. package/dist/{IngredientsView-d-wTEFTk.js → IngredientsView-BmN-1mUc.js} +689 -671
  16. package/dist/{IntegrationView-COWJlO4B.js → IntegrationView-Cm4jdNzA.js} +299 -297
  17. package/dist/{InventoryBindingForm-DngxfNzM.js → InventoryBindingForm-CbDjrC3O.js} +1 -1
  18. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CfIUE7Oj.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BLuD-xKb.js} +39 -39
  19. package/dist/{InventoryBindingSummary-ZepcUPQ3.js → InventoryBindingSummary-nBwMH1KR.js} +1 -1
  20. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-rynZcLum.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-EAczeEql.js} +4 -4
  21. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CDfN66ys.js → PremiumBadge.vue_vue_type_script_setup_true_lang-xF4w1bLo.js} +1 -1
  22. package/dist/{PublishView-DuRaDpQj.js → PublishView-CJbpgj4t.js} +1 -1
  23. package/dist/{PurchaseOrderPrintPreview-CiwFb-cX.js → PurchaseOrderPrintPreview-CKL-ESMG.js} +6 -6
  24. package/dist/{ReceiveRequestView-CMtXbZFg.js → ReceiveRequestView-BXup2Y5i.js} +110 -110
  25. package/dist/{RecipeView-C9MuhpHd.js → RecipeView-CYiaWfO2.js} +19 -19
  26. package/dist/{StockView-CzDFioRG.js → StockView-B5ZGzrsN.js} +135 -135
  27. package/dist/{SupplierView-BKHKbhGh.js → SupplierView-DpJB7y5J.js} +3 -3
  28. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-alkGEMZE.js → TransferDetails.vue_vue_type_script_setup_true_lang-Bnw-GVII.js} +6 -6
  29. package/dist/{TransferTemplateView-B-iTVtoR.js → TransferTemplateView-2x7CoPG6.js} +57 -57
  30. package/dist/{UnitView-9cX60HUq.js → UnitView-D7gJR81B.js} +27 -27
  31. package/dist/{WarehouseView-Bt54k8Fr.js → WarehouseView-Cdmvo8AX.js} +8 -8
  32. package/dist/{app-D68Nrj_W.js → app-7RQRfUWP.js} +9646 -9600
  33. package/dist/app.js +1 -1
  34. package/dist/{decimal-DwlcTwF4.js → decimal-BG61A172.js} +1 -1
  35. package/dist/{format-unit-display-B7zglpxP.js → format-unit-display-BcCVYu07.js} +57 -57
  36. package/dist/{index-CaMvI8x0.js → index-B9eaFsQz.js} +1 -1
  37. package/dist/{index-B4zWtnox.js → index-BP5fDtDw.js} +1 -1
  38. package/dist/{stock-FiZmySc9.js → stock-B59nAkMB.js} +1 -1
  39. package/dist/{supplier-AxlUb2WF.js → supplier-T0SjVZcK.js} +1 -1
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/{use-ingredient-select-dialog-BH-QS0jx.js → use-ingredient-select-dialog-Rvaune-D.js} +1 -1
  42. package/dist/{use-inventory-binding-dialog-TU1dCDcj.js → use-inventory-binding-dialog-DNSWmOzX.js} +1 -1
  43. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +157 -12
  44. package/package.json +3 -3
@@ -1,9 +1,9 @@
1
- import { defineComponent as je, ref as E, computed as P, onMounted as Pe, resolveComponent as T, openBlock as w, createElementBlock as R, Fragment as q, createTextVNode as G, createBlock as Z, withCtx as Y, createElementVNode as n, toDisplayString as K, unref as S, createVNode as D, createCommentVNode as Q, h as I, reactive as et, watch as tt, isRef as Ve, normalizeClass as me, renderList as ve, normalizeStyle as ze, Teleport as at, mergeProps as nt } from "vue";
2
- import { a3 as ot, u as $e, ap as L, ah as Ne, aq as Oe, m as st, P as Me, j as N, t as rt, T as ye, r as lt, s as ct, v as it, ar as Ye, as as Ke, ac as Ge, at as se, ai as ut, a5 as Ie, a4 as re, a0 as Re, D as He, i as we, h as dt, f as mt, a as ft, B as pt, _ as vt, C as yt, E as gt, G as Ce } from "./app-D68Nrj_W.js";
1
+ import { defineComponent as Fe, ref as E, computed as P, onMounted as Pe, resolveComponent as T, openBlock as w, createElementBlock as R, Fragment as q, createTextVNode as G, createBlock as Z, withCtx as Y, createElementVNode as n, toDisplayString as K, unref as S, createVNode as D, createCommentVNode as Q, h as I, reactive as et, watch as tt, isRef as He, normalizeClass as me, renderList as ve, normalizeStyle as ze, Teleport as at, mergeProps as nt } from "vue";
2
+ import { a4 as ot, u as $e, aq as L, ai as Ne, ar as Oe, n as st, Q as Me, j as N, t as rt, V as ye, s as lt, v as ct, w as it, as as Ye, at as Ke, ad as Ge, au as se, aj as ut, a6 as Ie, a5 as re, a1 as Re, D as Ve, i as we, h as dt, f as mt, a as ft, C as pt, _ as vt, E as yt, G as gt, J as Ce } from "./app-7RQRfUWP.js";
3
3
  import { useCoreStore as bt, useI18n as qe } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as Ue, useDialog as At, useProxiedModel as Dt, components as de, useBreakpoints as kt } from "@feedmepos/ui-library";
5
5
  import { defineStore as We, storeToRefs as _t } from "pinia";
6
- import { a as Le, u as Ze } from "./stock-FiZmySc9.js";
6
+ import { a as Le, u as Ze } from "./stock-B59nAkMB.js";
7
7
  import { E as ht } from "./empty-placeholder-wf6-BWE8.js";
8
8
  const Be = ot((l, o) => {
9
9
  function e() {
@@ -30,7 +30,7 @@ const Be = ot((l, o) => {
30
30
  }), xt = { class: "fm-typo-en-body-lg-400" }, wt = { class: "fm-typo-en-body-lg-600" }, Ct = {
31
31
  key: 0,
32
32
  class: "flex flex-col"
33
- }, St = { class: "flex gap-12 py-8 justify-end w-full" }, Te = /* @__PURE__ */ je({
33
+ }, St = { class: "flex gap-12 py-8 justify-end w-full" }, Te = /* @__PURE__ */ Fe({
34
34
  __name: "ClosingDraftAction",
35
35
  props: {
36
36
  draft: {},
@@ -75,12 +75,12 @@ const Be = ot((l, o) => {
75
75
  },
76
76
  set(s) {
77
77
  if (s) {
78
- const a = /* @__PURE__ */ new Date(`${s} ${H.value}`);
78
+ const a = /* @__PURE__ */ new Date(`${s} ${V.value}`);
79
79
  a.setSeconds(59, 999), v.value = a;
80
80
  } else
81
81
  v.value = null;
82
82
  }
83
- }), H = P({
83
+ }), V = P({
84
84
  get() {
85
85
  return v.value === null ? "" : Oe(v.value);
86
86
  },
@@ -119,7 +119,7 @@ const Be = ot((l, o) => {
119
119
  }
120
120
  }
121
121
  return (s, a) => {
122
- const k = T("FmLabel"), V = T("FmDatePicker"), m = T("FmTimePicker"), p = T("FmTextField"), C = T("FmButton"), $ = T("FmForm");
122
+ const k = T("FmLabel"), H = T("FmDatePicker"), m = T("FmTimePicker"), p = T("FmTextField"), C = T("FmButton"), $ = T("FmForm");
123
123
  return M.value ? (w(), Z($, {
124
124
  key: 1,
125
125
  onValidationSuccess: O,
@@ -139,9 +139,9 @@ const Be = ot((l, o) => {
139
139
  ])),
140
140
  _: 1
141
141
  }),
142
- D(V, {
142
+ D(H, {
143
143
  modelValue: B.value,
144
- "onUpdate:modelValue": a[0] || (a[0] = (F) => B.value = F)
144
+ "onUpdate:modelValue": a[0] || (a[0] = (j) => B.value = j)
145
145
  }, null, 8, ["modelValue"]),
146
146
  D(k, { class: "fm-typo-en-body-lg-600" }, {
147
147
  default: Y(() => a[7] || (a[7] = [
@@ -150,13 +150,13 @@ const Be = ot((l, o) => {
150
150
  _: 1
151
151
  }),
152
152
  D(m, {
153
- modelValue: H.value,
154
- "onUpdate:modelValue": a[1] || (a[1] = (F) => H.value = F)
153
+ modelValue: V.value,
154
+ "onUpdate:modelValue": a[1] || (a[1] = (j) => V.value = j)
155
155
  }, null, 8, ["modelValue"])
156
156
  ])) : Q("", !0),
157
157
  D(p, {
158
158
  modelValue: e.value,
159
- "onUpdate:modelValue": a[2] || (a[2] = (F) => e.value = F),
159
+ "onUpdate:modelValue": a[2] || (a[2] = (j) => e.value = j),
160
160
  label: "Remark",
161
161
  "label-mark": "required",
162
162
  rules: [S(st)()]
@@ -165,7 +165,7 @@ const Be = ot((l, o) => {
165
165
  D(C, {
166
166
  label: "Cancel",
167
167
  variant: "tertiary",
168
- onClick: a[3] || (a[3] = (F) => s.onCancel())
168
+ onClick: a[3] || (a[3] = (j) => s.onCancel())
169
169
  }),
170
170
  D(C, {
171
171
  label: d.value,
@@ -181,16 +181,16 @@ const Be = ot((l, o) => {
181
181
  ], 64));
182
182
  };
183
183
  }
184
- }), Ft = ye(0);
184
+ }), jt = ye(0);
185
185
  function Je(l) {
186
186
  const o = l.measurementsAmounts.groupBy((c) => c.measurement.id), e = l.sku.unit.measurements.reduce((c, f) => {
187
187
  var M, d;
188
- const h = ((d = (M = o.get(f.id)) == null ? void 0 : M[0]) == null ? void 0 : d.amount) ?? Ft, v = Me(f.conversion, h);
188
+ const h = ((d = (M = o.get(f.id)) == null ? void 0 : M[0]) == null ? void 0 : d.amount) ?? jt, v = Me(f.conversion, h);
189
189
  return c + +N(v);
190
190
  }, +N(l.baseAmount));
191
191
  return rt(e, l.baseAmount.precision);
192
192
  }
193
- const jt = ye(0), $t = ye(100);
193
+ const Ft = ye(0), $t = ye(100);
194
194
  function Bt(l, o, e) {
195
195
  const c = Je(l), f = Ye(c, o), h = o.amount === 0 ? null : Ke(f, {
196
196
  ...o,
@@ -279,14 +279,14 @@ function Rt(l) {
279
279
  ];
280
280
  }
281
281
  function Pt(l, o) {
282
- var a, k, V, m, p, C, $;
282
+ var a, k, H, m, p, C, $;
283
283
  const e = o.groupBy(
284
- (F) => F.id,
285
- (F) => F.balance
286
- ), c = [...l.items, ...l.negativeStockItems ?? []], f = Qe(c), h = c.map((F) => {
284
+ (j) => j.id,
285
+ (j) => j.balance
286
+ ), c = [...l.items, ...l.negativeStockItems ?? []], f = Qe(c), h = c.map((j) => {
287
287
  var W, le;
288
- const X = ((W = e.get(F.sku._id)) == null ? void 0 : W[0]) ?? jt, J = ((le = f == null ? void 0 : f.get(F.sku._id)) == null ? void 0 : le[0]) ?? [];
289
- return Bt(F, X, J);
288
+ const X = ((W = e.get(j.sku._id)) == null ? void 0 : W[0]) ?? Ft, J = ((le = f == null ? void 0 : f.get(j.sku._id)) == null ? void 0 : le[0]) ?? [];
289
+ return Bt(j, X, J);
290
290
  }), v = It(c), d = bt().currentBusiness.value, y = Rt(v), B = [
291
291
  ["Business name:", d == null ? void 0 : d.name],
292
292
  ["Business ID:", d == null ? void 0 : d._id],
@@ -298,7 +298,7 @@ function Pt(l, o) {
298
298
  ["Recent action", l.approvedAt ? "Approve" : l.rejectionHistory ? "Reject" : ""],
299
299
  [
300
300
  "Action by",
301
- l.approvedAt ? (V = l.approvedBy) == null ? void 0 : V.name : l.rejectionHistory ? (p = (m = l.rejectionHistory[0]) == null ? void 0 : m.rejectedBy) == null ? void 0 : p.name : ""
301
+ l.approvedAt ? (H = l.approvedBy) == null ? void 0 : H.name : l.rejectionHistory ? (p = (m = l.rejectionHistory[0]) == null ? void 0 : m.rejectedBy) == null ? void 0 : p.name : ""
302
302
  ],
303
303
  [
304
304
  "Action at",
@@ -309,12 +309,12 @@ function Pt(l, o) {
309
309
  l.approvedAt ? l.approveRemark : l.rejectionHistory ? new Date(($ = l.rejectionHistory[0]) == null ? void 0 : $.rejectRemark) : ""
310
310
  ],
311
311
  [],
312
- y.map((F) => F.name),
313
- ...h.map((F) => y.map((X) => F[X.id]))
314
- ], H = y.map((F) => `system:${F.id}`), O = lt(B, H), s = `[${d == null ? void 0 : d.name}] closing draft (${ct(new Date(l.updatedAt))}).xlsx`;
312
+ y.map((j) => j.name),
313
+ ...h.map((j) => y.map((X) => j[X.id]))
314
+ ], V = y.map((j) => `system:${j.id}`), O = lt(B, V), s = `[${d == null ? void 0 : d.name}] closing draft (${ct(new Date(l.updatedAt))}).xlsx`;
315
315
  return it(O, s), s;
316
316
  }
317
- const Mt = { class: "flex flex-col" }, Ut = { class: "flex gap-12 py-8 justify-end w-full" }, Lt = /* @__PURE__ */ je({
317
+ const Mt = { class: "flex flex-col" }, Ut = { class: "flex gap-12 py-8 justify-end w-full" }, Lt = /* @__PURE__ */ Fe({
318
318
  __name: "RefreshBalanceAction",
319
319
  props: {
320
320
  draft: {},
@@ -361,7 +361,7 @@ const Mt = { class: "flex flex-col" }, Ut = { class: "flex gap-12 py-8 justify-e
361
361
  e.value = !0, o.onFinished(c.value.toISOString());
362
362
  }
363
363
  return (d, y) => {
364
- const B = T("FmLabel"), H = T("FmDatePicker"), O = T("FmTimePicker"), s = T("FmButton"), a = T("FmForm");
364
+ const B = T("FmLabel"), V = T("FmDatePicker"), O = T("FmTimePicker"), s = T("FmButton"), a = T("FmForm");
365
365
  return f.value ? (w(), Z(a, {
366
366
  key: 1,
367
367
  onValidationSuccess: M,
@@ -388,7 +388,7 @@ const Mt = { class: "flex flex-col" }, Ut = { class: "flex gap-12 py-8 justify-e
388
388
  ])),
389
389
  _: 1
390
390
  }),
391
- D(H, {
391
+ D(V, {
392
392
  modelValue: h.value,
393
393
  "onUpdate:modelValue": y[0] || (y[0] = (k) => h.value = k)
394
394
  }, null, 8, ["modelValue"]),
@@ -423,7 +423,7 @@ const Mt = { class: "flex flex-col" }, Ut = { class: "flex gap-12 py-8 justify-e
423
423
  ], 64));
424
424
  };
425
425
  }
426
- }), Fe = We(
426
+ }), je = We(
427
427
  "closingDraftActions",
428
428
  function() {
429
429
  const o = At(), e = Ue(), c = Le(), f = Be(), h = Ze(), v = E(!1), M = E();
@@ -445,8 +445,8 @@ const Mt = { class: "flex flex-col" }, Ut = { class: "flex gap-12 py-8 justify-e
445
445
  }), console.error("Closing draft is completed but closing document cannot be found.", {
446
446
  draftId: m._id
447
447
  }), [];
448
- const F = await c.readAdjustmentById($);
449
- return ((F == null ? void 0 : F.skus) ?? []).map((J) => ({
448
+ const j = await c.readAdjustmentById($);
449
+ return ((j == null ? void 0 : j.skus) ?? []).map((J) => ({
450
450
  id: J.sku._id,
451
451
  balance: J.fromBalance,
452
452
  costs: J.fromCostBalances
@@ -460,7 +460,7 @@ const Mt = { class: "flex flex-col" }, Ut = { class: "flex gap-12 py-8 justify-e
460
460
  message: "Fetching data..."
461
461
  }), p = await y(m)), Pt(m, p);
462
462
  }
463
- function H(m, p) {
463
+ function V(m, p) {
464
464
  o.open({
465
465
  title: "Approve draft",
466
466
  contentComponent: Te,
@@ -519,7 +519,7 @@ const Mt = { class: "flex flex-col" }, Ut = { class: "flex gap-12 py-8 justify-e
519
519
  function k() {
520
520
  v.value = !1;
521
521
  }
522
- async function V(m, p, C) {
522
+ async function H(m, p, C) {
523
523
  await o.open({
524
524
  title: "Refresh balance",
525
525
  contentComponent: Lt,
@@ -537,12 +537,12 @@ const Mt = { class: "flex flex-col" }, Ut = { class: "flex gap-12 py-8 justify-e
537
537
  return {
538
538
  viewDraft: d,
539
539
  closeDraftDialog: k,
540
- approveDraft: H,
540
+ approveDraft: V,
541
541
  rejectDraft: O,
542
542
  markAsFailed: s,
543
543
  syncDraft: a,
544
544
  exportDraft: B,
545
- refreshBalance: V,
545
+ refreshBalance: H,
546
546
  viewClosingDraftShow: v,
547
547
  viewClosingDraftProps: M
548
548
  };
@@ -563,7 +563,7 @@ function Se(l) {
563
563
  const Et = We(
564
564
  "closingDraftTable",
565
565
  function() {
566
- const { t: o } = qe(), e = Fe(), c = E(new Array()), f = E(!1), h = $e(), v = Be();
566
+ const { t: o } = qe(), e = je(), c = E(new Array()), f = E(!1), h = $e(), v = Be();
567
567
  async function M() {
568
568
  if (c.value = [], !!h._currentLocation) {
569
569
  f.value = !0;
@@ -602,7 +602,7 @@ const Et = We(
602
602
  function B() {
603
603
  e.closeDraftDialog(), M();
604
604
  }
605
- function H(s, a) {
605
+ function V(s, a) {
606
606
  switch (a = mt(a), s) {
607
607
  case we.Details:
608
608
  return e.viewDraft(a);
@@ -680,8 +680,8 @@ const Et = We(
680
680
  enableSorting: !1,
681
681
  cell(s) {
682
682
  var C;
683
- const a = s.row.original, k = a.status, V = new Date(a.updatedAt), m = (C = a == null ? void 0 : a.rejectionHistory) == null ? void 0 : C.computeFirst(($) => $.rejectedAt), p = m ? new Date(m) : null;
684
- return k === "DRAFT" && p ? p.getTime() > V.getTime() ? I(
683
+ const a = s.row.original, k = a.status, H = new Date(a.updatedAt), m = (C = a == null ? void 0 : a.rejectionHistory) == null ? void 0 : C.computeFirst(($) => $.rejectedAt), p = m ? new Date(m) : null;
684
+ return k === "DRAFT" && p ? p.getTime() > H.getTime() ? I(
685
685
  "div",
686
686
  {
687
687
  class: "flex"
@@ -724,9 +724,9 @@ const Et = We(
724
724
  id: "action",
725
725
  cell(s) {
726
726
  const a = s.row.original, k = [
727
- He[we.Details],
728
- He[we.Export]
729
- ], V = [
727
+ Ve[we.Details],
728
+ Ve[we.Export]
729
+ ], H = [
730
730
  {
731
731
  translationKey: "inventory.closing.draft.approveDraft",
732
732
  color: "text-fm-color-typo-primary",
@@ -746,9 +746,9 @@ const Et = We(
746
746
  return dt(
747
747
  [
748
748
  ...k,
749
- ...a.status === se.enum.DRAFT ? V : []
749
+ ...a.status === se.enum.DRAFT ? H : []
750
750
  ],
751
- (m) => H(m, a)
751
+ (m) => V(m, a)
752
752
  );
753
753
  },
754
754
  enableSorting: !1,
@@ -766,7 +766,7 @@ const Et = We(
766
766
  updateDraftRef: y
767
767
  };
768
768
  }
769
- ), Ht = { class: "w-full flex flex-col gap-32" }, Vt = { class: "flex justify-between" }, zt = { class: "flex" }, Nt = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, Ot = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yt = { class: "flex gap-1" }, Kt = { class: "fm-typo-en-body-lg-600" }, Gt = { class: "flex flex-col gap-16" }, qt = { class: "flex items-center" }, Wt = {
769
+ ), Vt = { class: "w-full flex flex-col gap-32" }, Ht = { class: "flex justify-between" }, zt = { class: "flex" }, Nt = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, Ot = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yt = { class: "flex gap-1" }, Kt = { class: "fm-typo-en-body-lg-600" }, Gt = { class: "flex flex-col gap-16" }, qt = { class: "flex items-center" }, Wt = {
770
770
  key: 0,
771
771
  class: "flex gap-8"
772
772
  }, Zt = {
@@ -796,7 +796,7 @@ const Et = We(
796
796
  }, va = { class: "flex-1 flex flex-col items-center" }, ya = {
797
797
  class: "py-12 flex flex-col gap-4 flex-1",
798
798
  name: "delivery details"
799
- }, ga = { class: "flex flex-col gap-8" }, ba = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Aa = { class: "flex flex-col gap-4" }, Da = { class: "flex gap-8" }, ka = /* @__PURE__ */ je({
799
+ }, ga = { class: "flex flex-col gap-8" }, ba = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Aa = { class: "flex flex-col gap-4" }, Da = { class: "flex gap-8" }, ka = /* @__PURE__ */ Fe({
800
800
  __name: "ClosingDraftDialog",
801
801
  props: {
802
802
  show: { type: Boolean },
@@ -804,7 +804,7 @@ const Et = We(
804
804
  },
805
805
  emits: ["submitted", "refresh"],
806
806
  setup(l, { emit: o }) {
807
- const e = l, c = Ze(), f = Fe(), h = Dt(e, "show"), v = E(!1), M = E(!1), d = E(!1), y = E(new Array()), B = Le(), H = Be(), O = Ue(), s = ft(), a = $e(), k = et({}), V = P(() => new Set(
807
+ const e = l, c = Ze(), f = je(), h = Dt(e, "show"), v = E(!1), M = E(!1), d = E(!1), y = E(new Array()), B = Le(), V = Be(), O = Ue(), s = ft(), a = $e(), k = et({}), H = P(() => new Set(
808
808
  s.skus.filter((r) => {
809
809
  var t;
810
810
  return k[(t = r.customAttributes) == null ? void 0 : t.tag];
@@ -815,11 +815,11 @@ const Et = We(
815
815
  }), C = P(() => {
816
816
  var t, b;
817
817
  const r = [...((t = e.draft) == null ? void 0 : t.items) ?? [], ...((b = e.draft) == null ? void 0 : b.negativeStockItems) ?? []];
818
- return V.value.size ? r.filter((g) => V.value.has(g.sku._id)) : r;
818
+ return H.value.size ? r.filter((g) => H.value.has(g.sku._id)) : r;
819
819
  }), $ = P(() => {
820
820
  const r = C.value.map((t) => t.sku);
821
821
  return r.sort((t, b) => t.code.localeCompare(b.code)), r;
822
- }), F = P(() => C.value.groupBy(
822
+ }), j = P(() => C.value.groupBy(
823
823
  (t) => t.sku._id,
824
824
  (t) => t.measurementsAmounts.filter((b) => !b.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((b) => b.measurement.id)
825
825
  ));
@@ -852,10 +852,10 @@ const Et = We(
852
852
  return;
853
853
  }
854
854
  const i = await B.readAdjustmentById(u), A = (i == null ? void 0 : i.skus) ?? [];
855
- y.value = A.map((j) => ({
856
- id: j.sku._id,
857
- balance: j.fromBalance,
858
- costs: j.fromCostBalances
855
+ y.value = A.map((F) => ({
856
+ id: F.sku._id,
857
+ balance: F.fromBalance,
858
+ costs: F.fromCostBalances
859
859
  }));
860
860
  } else
861
861
  y.value = ((g = e.draft) == null ? void 0 : g.stockSnapshot) ?? [];
@@ -884,13 +884,13 @@ const Et = We(
884
884
  () => {
885
885
  },
886
886
  async (g) => {
887
- var j;
887
+ var F;
888
888
  M.value = !0;
889
- const u = (j = e.draft) == null ? void 0 : j._rev, i = 30, A = 2e3;
889
+ const u = (F = e.draft) == null ? void 0 : F._rev, i = 30, A = 2e3;
890
890
  try {
891
891
  await B.recalculation.scheduleCalculateStockSnapshotAtDate(g, e.draft._id);
892
892
  let x = null;
893
- for (let te = 0; te < i && (x = await H.getDraft(e.draft._id).delayed(A), x._rev === u); te++)
893
+ for (let te = 0; te < i && (x = await V.getDraft(e.draft._id).delayed(A), x._rev === u); te++)
894
894
  ;
895
895
  if (!x || x._rev === u) {
896
896
  O.open({
@@ -940,7 +940,7 @@ const Et = We(
940
940
  const ce = P(() => {
941
941
  const r = $.value.reduce((b, g) => {
942
942
  var u, i;
943
- return Math.max(b, ((i = (u = F.value) == null ? void 0 : u.get(g._id)) == null ? void 0 : i[0].length) ?? 0);
943
+ return Math.max(b, ((i = (u = j.value) == null ? void 0 : u.get(g._id)) == null ? void 0 : i[0].length) ?? 0);
944
944
  }, 0);
945
945
  return [
946
946
  {
@@ -1065,7 +1065,7 @@ const Et = We(
1065
1065
  header: () => "Amounts",
1066
1066
  enableSorting: !1,
1067
1067
  cell(b) {
1068
- const g = b.row.original, u = (A, j) => I(
1068
+ const g = b.row.original, u = (A, F) => I(
1069
1069
  de.FmTooltip,
1070
1070
  { zIndex: 50 },
1071
1071
  {
@@ -1083,20 +1083,20 @@ const Et = We(
1083
1083
  class: "text-fm-color-typo-secondary",
1084
1084
  style: { maxWidth: "80px" }
1085
1085
  },
1086
- j
1086
+ F
1087
1087
  )
1088
1088
  ]
1089
1089
  );
1090
1090
  },
1091
1091
  content() {
1092
- return `${A} ${j}`;
1092
+ return `${A} ${F}`;
1093
1093
  }
1094
1094
  }
1095
1095
  );
1096
- let i = Array.from({ length: r }).map((A, j) => {
1097
- if (!g[`measurementAmount${j}`])
1096
+ let i = Array.from({ length: r }).map((A, F) => {
1097
+ if (!g[`measurementAmount${F}`])
1098
1098
  return null;
1099
- const x = g[`measurementAmount${j}`], te = g[`measurementAbbrev${j}`];
1099
+ const x = g[`measurementAmount${F}`], te = g[`measurementAbbrev${F}`];
1100
1100
  return u(x, te);
1101
1101
  }).filter((A) => A);
1102
1102
  return (g.baseUnitAmount || !i.length) && (i = [u(g.baseUnitAmount, g.baseUnit), ...i]), I(
@@ -1133,7 +1133,7 @@ const Et = We(
1133
1133
  adjustedDiffPercentage: -100,
1134
1134
  isTemplateItem: !r[u._id]
1135
1135
  };
1136
- const j = Je(i), x = Ye(j, A), te = A.amount === 0 ? null : Ke(x, {
1136
+ const F = Je(i), x = Ye(F, A), te = A.amount === 0 ? null : Ke(x, {
1137
1137
  ...A,
1138
1138
  amount: Math.abs(A.amount)
1139
1139
  }), ke = te ? Me(te, J) : null;
@@ -1144,10 +1144,10 @@ const Et = We(
1144
1144
  baseUnitAmount: +N(i.baseAmount),
1145
1145
  ...i.measurementsAmounts.filter((_) => {
1146
1146
  var U, z, ae;
1147
- return (ae = (z = (U = F.value) == null ? void 0 : U.get(u._id)) == null ? void 0 : z[0]) == null ? void 0 : ae.includes(_.measurement.id);
1147
+ return (ae = (z = (U = j.value) == null ? void 0 : U.get(u._id)) == null ? void 0 : z[0]) == null ? void 0 : ae.includes(_.measurement.id);
1148
1148
  }).reduce((_, U, z) => (_[`measurementAbbrev${z}`] = `(${U.measurement.abbrev}) × ${N(U.measurement.conversion)}`, _[`measurementAmount${z}`] = +N(U.amount), _), {}),
1149
1149
  systemBalance: +N(A),
1150
- physicalBalance: +N(j),
1150
+ physicalBalance: +N(F),
1151
1151
  adjustedAmount: +N(x),
1152
1152
  adjustedDiffPercentage: ke ? +N(Ge(ke, 2)) : null,
1153
1153
  isTemplateItem: !r[u._id]
@@ -1231,16 +1231,16 @@ const Et = We(
1231
1231
  remark: A.rejectRemark
1232
1232
  });
1233
1233
  return (i = e.draft) != null && i.approvedAt && (r.find(
1234
- (j) => {
1234
+ (F) => {
1235
1235
  var x;
1236
- return `${j.action}_${j.performedAt}` == `${L.enum.approveDraft}_${(x = e.draft) == null ? void 0 : x.approvedAt}`;
1236
+ return `${F.action}_${F.performedAt}` == `${L.enum.approveDraft}_${(x = e.draft) == null ? void 0 : x.approvedAt}`;
1237
1237
  }
1238
1238
  ) || r.push({
1239
1239
  action: L.enum.approveDraft,
1240
1240
  performedAt: e.draft.approvedAt,
1241
1241
  performedBy: e.draft.approvedBy ?? { name: "Unknown", id: "unknown" },
1242
1242
  remark: e.draft.approveRemark
1243
- })), r.sort((A, j) => new Date(j.performedAt).getTime() - new Date(A.performedAt).getTime()).map(
1243
+ })), r.sort((A, F) => new Date(F.performedAt).getTime() - new Date(A.performedAt).getTime()).map(
1244
1244
  (A) => ({
1245
1245
  header: Re(A.action),
1246
1246
  date: re(A.performedAt),
@@ -1257,22 +1257,22 @@ const Et = We(
1257
1257
  })
1258
1258
  );
1259
1259
  }), pe = P(() => {
1260
- var u, i, A, j;
1260
+ var u, i, A, F;
1261
1261
  if ((u = e == null ? void 0 : e.draft) != null && u.approvedAt) return "Draft is already approved.";
1262
1262
  if (((i = e.draft) == null ? void 0 : i.status) !== se.enum.DRAFT) return "Status is not draft.";
1263
- const r = fe.value.some((x) => x.physicalBalance < 0), t = ((j = (A = c.stockBalance.skus) == null ? void 0 : A.filter((x) => x.balance.amount < 0)) == null ? void 0 : j.map((x) => x.id)) ?? [], b = new Set($.value.map((x) => x._id)), g = t.filter((x) => !b.has(x)).length;
1263
+ const r = fe.value.some((x) => x.physicalBalance < 0), t = ((F = (A = c.stockBalance.skus) == null ? void 0 : A.filter((x) => x.balance.amount < 0)) == null ? void 0 : F.map((x) => x.id)) ?? [], b = new Set($.value.map((x) => x._id)), g = t.filter((x) => !b.has(x)).length;
1264
1264
  return [
1265
1265
  r ? "Negative total exist." : null,
1266
1266
  g ? "Negative stock is not included in this draft. Reopen draft in POS and apply changes." : null
1267
1267
  ].filter((x) => x).join(" ");
1268
1268
  });
1269
1269
  return (r, t) => {
1270
- const b = T("FmButtonGroup"), g = T("FmMenuDivider"), u = T("FmCard"), i = T("FmButton"), A = T("FmCircularProgress"), j = T("FmChip"), x = T("FmTextField"), te = T("FmIcon"), ke = T("FmTable"), _e = T("FmSpacer"), he = T("FmTooltip"), xe = T("FmSideSheet");
1270
+ const b = T("FmButtonGroup"), g = T("FmMenuDivider"), u = T("FmCard"), i = T("FmButton"), A = T("FmCircularProgress"), F = T("FmChip"), x = T("FmTextField"), te = T("FmIcon"), ke = T("FmTable"), _e = T("FmSpacer"), he = T("FmTooltip"), xe = T("FmSideSheet");
1271
1271
  return w(), Z(xe, {
1272
1272
  "dismiss-away": "",
1273
1273
  "max-width": 9999,
1274
1274
  "model-value": S(h),
1275
- "onUpdate:modelValue": t[10] || (t[10] = (_) => Ve(h) ? h.value = _ : null),
1275
+ "onUpdate:modelValue": t[10] || (t[10] = (_) => He(h) ? h.value = _ : null),
1276
1276
  header: "Closing details"
1277
1277
  }, {
1278
1278
  "side-sheet-footer": Y(() => {
@@ -1327,7 +1327,7 @@ const Et = We(
1327
1327
  ];
1328
1328
  }),
1329
1329
  default: Y(() => [
1330
- n("div", Ht, [
1330
+ n("div", Vt, [
1331
1331
  n("div", null, [
1332
1332
  D(b, {
1333
1333
  items: ne,
@@ -1343,7 +1343,7 @@ const Et = We(
1343
1343
  default: Y(() => {
1344
1344
  var _, U;
1345
1345
  return [
1346
- n("div", Vt, [
1346
+ n("div", Ht, [
1347
1347
  t[11] || (t[11] = n("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
1348
1348
  n("div", zt, [
1349
1349
  n("div", {
@@ -1405,12 +1405,12 @@ const Et = We(
1405
1405
  ])) : (w(), R(q, { key: 1 }, [
1406
1406
  n("div", Qt, [
1407
1407
  n("div", Xt, [
1408
- D(j, {
1408
+ D(F, {
1409
1409
  label: "Template Item(s)",
1410
1410
  selected: p.value.templateItem,
1411
1411
  onClick: t[2] || (t[2] = (_) => p.value.templateItem = !p.value.templateItem)
1412
1412
  }, null, 8, ["selected"]),
1413
- D(j, {
1413
+ D(F, {
1414
1414
  label: "Non-template Item(s)",
1415
1415
  selected: p.value.nonTemplateItem,
1416
1416
  onClick: t[3] || (t[3] = (_) => p.value.nonTemplateItem = !p.value.nonTemplateItem)
@@ -1423,7 +1423,7 @@ const Et = We(
1423
1423
  }, null, 8, ["modelValue"])
1424
1424
  ]),
1425
1425
  S(s).skuTags.size ? (w(), R("div", ea, [
1426
- (w(!0), R(q, null, ve(S(s).skuTags.keys(), (_) => (w(), Z(j, {
1426
+ (w(!0), R(q, null, ve(S(s).skuTags.keys(), (_) => (w(), Z(F, {
1427
1427
  key: `${_}`,
1428
1428
  label: `${_}`,
1429
1429
  selectable: "",
@@ -1558,22 +1558,22 @@ const Et = We(
1558
1558
  }, 8, ["model-value"]);
1559
1559
  };
1560
1560
  }
1561
- }), _a = { class: "flex-1 flex flex-col gap-8" }, ha = { class: "flex flex-col" }, xa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wa = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Ca = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Sa = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Pa = /* @__PURE__ */ je({
1561
+ }), _a = { class: "flex-1 flex flex-col gap-8" }, ha = { class: "flex flex-col" }, xa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wa = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Ca = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Sa = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Pa = /* @__PURE__ */ Fe({
1562
1562
  __name: "ClosingDraftView",
1563
1563
  setup(l) {
1564
- const { t: o } = qe(), { viewDraft: e } = Fe(), { viewClosingDraftProps: c, viewClosingDraftShow: f } = _t(Fe()), h = $e(), v = Et(), M = pt(), { breakpoints: d } = kt();
1564
+ const { t: o } = qe(), { viewDraft: e } = je(), { viewClosingDraftProps: c, viewClosingDraftShow: f } = _t(je()), h = $e(), v = Et(), M = pt(), { breakpoints: d } = kt();
1565
1565
  h.watchLocation(v.fetchDrafts);
1566
- const y = P(() => v.loading), B = E(""), H = P(() => d.value.xs || d.value.sm), O = P(() => H.value ? 10 : 20);
1567
- function s(V) {
1568
- switch (V) {
1566
+ const y = P(() => v.loading), B = E(""), V = P(() => d.value.xs || d.value.sm), O = P(() => V.value ? 10 : 20);
1567
+ function s(H) {
1568
+ switch (H) {
1569
1569
  case "refresh":
1570
1570
  return v.fetchDrafts();
1571
1571
  }
1572
1572
  }
1573
- function a(V) {
1574
- return V;
1573
+ function a(H) {
1574
+ return H;
1575
1575
  }
1576
- const k = P(() => H.value ? [
1576
+ const k = P(() => V.value ? [
1577
1577
  {
1578
1578
  label: o("inventory.common.refresh"),
1579
1579
  value: "refresh",
@@ -1586,7 +1586,7 @@ const Et = We(
1586
1586
  isPrimary: !1
1587
1587
  }
1588
1588
  ]);
1589
- return (V, m) => {
1589
+ return (H, m) => {
1590
1590
  const p = T("FmTable");
1591
1591
  return w(), R(q, null, [
1592
1592
  D(vt, {
@@ -1599,8 +1599,8 @@ const Et = We(
1599
1599
  class: me([
1600
1600
  "flex flex-col gap-8 max-h-full",
1601
1601
  {
1602
- "p-0": H.value,
1603
- "px-24 ": !H.value
1602
+ "p-0": V.value,
1603
+ "px-24 ": !V.value
1604
1604
  }
1605
1605
  ])
1606
1606
  }, [
@@ -1625,13 +1625,13 @@ const Et = We(
1625
1625
  onRowClick: ($) => S(e)($)
1626
1626
  }, {
1627
1627
  default: Y(($) => {
1628
- var F, X, J, W, le, ge, be, ie, ce, Ae, ue, fe, De, ne, oe, ee, pe, r, t, b;
1628
+ var j, X, J, W, le, ge, be, ie, ce, Ae, ue, fe, De, ne, oe, ee, pe, r, t, b;
1629
1629
  return [
1630
1630
  n("div", _a, [
1631
1631
  n("div", ha, [
1632
1632
  n("div", xa, [
1633
1633
  D(S(Ce), {
1634
- render: (J = (X = (F = $._id) == null ? void 0 : F.column) == null ? void 0 : X.columnDef) == null ? void 0 : J.cell,
1634
+ render: (J = (X = (j = $._id) == null ? void 0 : j.column) == null ? void 0 : X.columnDef) == null ? void 0 : J.cell,
1635
1635
  props: (le = (W = $._id) == null ? void 0 : W.getContext) == null ? void 0 : le.call(W)
1636
1636
  }, null, 8, ["render", "props"])
1637
1637
  ]),
@@ -1673,7 +1673,7 @@ const Et = We(
1673
1673
  (w(), Z(at, { to: "body" }, [
1674
1674
  D(ka, nt(S(c), {
1675
1675
  show: S(f),
1676
- "onUpdate:show": m[2] || (m[2] = (C) => Ve(f) ? f.value = C : null),
1676
+ "onUpdate:show": m[2] || (m[2] = (C) => He(f) ? f.value = C : null),
1677
1677
  onSubmitted: m[3] || (m[3] = () => (f.value = !1, S(v).fetchDrafts())),
1678
1678
  onRefresh: m[4] || (m[4] = (C) => S(v).updateDraftRef(C))
1679
1679
  }), null, 16, ["show"])