@feedmepos/mf-inventory-portal 1.2.3 → 1.2.4-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/{App-CSdfULWS.js → App-CdweYGJb.js} +1 -1
  2. package/dist/{ApprovalView-DTwnAFlM.js → ApprovalView-N5aTAawv.js} +8 -8
  3. package/dist/{BindingsDialog-Bv24Ys1r.js → BindingsDialog-CF43nBIL.js} +2 -2
  4. package/dist/{BindingsPicker-D-HNXv6l.js → BindingsPicker-UXffTvIT.js} +1 -1
  5. package/dist/{BindingsTable-B5xE1kAV.js → BindingsTable-bGEdChlq.js} +1 -1
  6. package/dist/{ClosingDraftView-BbLjS-QV.js → ClosingDraftView-CU6ncRGd.js} +93 -93
  7. package/dist/{ClosingTemplateView-Do0CkGUH.js → ClosingTemplateView-B7hlv-ol.js} +17 -17
  8. package/dist/{DeliveryOrderPrintPreview-B2YhyN59.js → DeliveryOrderPrintPreview-BHsASpvc.js} +7 -7
  9. package/dist/{FmAdminBadge-Cj1R2Bi0.js → FmAdminBadge-phxApe08.js} +3 -3
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C1pSdLfz.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CQi8T-o4.js} +11 -11
  11. package/dist/{FmMultiselectDialog-eq994oQ-.js → FmMultiselectDialog-Cw7978N9.js} +1 -1
  12. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BheQFvJF.js → FmUnitInput.vue_vue_type_script_setup_true_lang-m_DVEWZp.js} +24 -24
  13. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DDbMiztC.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CK2uHzWs.js} +1 -1
  14. package/dist/{IngredientGroupView-DNAdO4WQ.js → IngredientGroupView-BLlM22XE.js} +31 -31
  15. package/dist/{IngredientsView-d-wTEFTk.js → IngredientsView-D-MLnQUs.js} +689 -671
  16. package/dist/{IntegrationView-COWJlO4B.js → IntegrationView-DS8GfDcu.js} +299 -297
  17. package/dist/{InventoryBindingForm-DngxfNzM.js → InventoryBindingForm-Cxl3010v.js} +1 -1
  18. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CfIUE7Oj.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DVytESGu.js} +39 -39
  19. package/dist/{InventoryBindingSummary-ZepcUPQ3.js → InventoryBindingSummary-BPLbgkdU.js} +1 -1
  20. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-rynZcLum.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D6G0tvu8.js} +4 -4
  21. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CDfN66ys.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DIgC7Vso.js} +1 -1
  22. package/dist/{PublishView-DuRaDpQj.js → PublishView-C7M3-gQh.js} +1 -1
  23. package/dist/{PurchaseOrderPrintPreview-CiwFb-cX.js → PurchaseOrderPrintPreview-ZhFYuurj.js} +6 -6
  24. package/dist/{ReceiveRequestView-CMtXbZFg.js → ReceiveRequestView-BCdKPhsr.js} +110 -110
  25. package/dist/{RecipeView-C9MuhpHd.js → RecipeView-DUmXQOxV.js} +19 -19
  26. package/dist/{StockView-CzDFioRG.js → StockView-BcxAyI7w.js} +135 -135
  27. package/dist/{SupplierView-BKHKbhGh.js → SupplierView-q04_80bh.js} +3 -3
  28. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-alkGEMZE.js → TransferDetails.vue_vue_type_script_setup_true_lang-CBFgpKee.js} +6 -6
  29. package/dist/{TransferTemplateView-B-iTVtoR.js → TransferTemplateView-Cfcu-qeJ.js} +57 -57
  30. package/dist/{UnitView-9cX60HUq.js → UnitView-BAPZkTQp.js} +27 -27
  31. package/dist/{WarehouseView-Bt54k8Fr.js → WarehouseView-9AkOoqZV.js} +8 -8
  32. package/dist/{app-D68Nrj_W.js → app-Bcq0U90V.js} +9646 -9600
  33. package/dist/app.js +1 -1
  34. package/dist/{decimal-DwlcTwF4.js → decimal-Dhnp84Mk.js} +1 -1
  35. package/dist/{format-unit-display-B7zglpxP.js → format-unit-display-X0is3zJN.js} +57 -57
  36. package/dist/{index-CaMvI8x0.js → index-Bb9d1Qcc.js} +1 -1
  37. package/dist/{index-B4zWtnox.js → index-CnqZ1tak.js} +1 -1
  38. package/dist/{stock-FiZmySc9.js → stock-DcD5Tbqe.js} +1 -1
  39. package/dist/{supplier-AxlUb2WF.js → supplier-njZB-A08.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-CFxbHyQu.js} +1 -1
  42. package/dist/{use-inventory-binding-dialog-TU1dCDcj.js → use-inventory-binding-dialog-CtvdrDNH.js} +1 -1
  43. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +157 -12
  44. package/package.json +1 -1
@@ -1,17 +1,17 @@
1
1
  import { defineComponent as ce, ref as N, computed as R, resolveComponent as D, openBlock as x, createBlock as L, withCtx as I, createElementVNode as e, normalizeClass as ge, toDisplayString as h, createVNode as g, createElementBlock as O, Fragment as ne, renderList as re, unref as i, h as he, watch as xe, isRef as Ue, createCommentVNode as se, reactive as it, mergeModels as Ye, useModel as ut, onMounted as Ee, createTextVNode as ue, normalizeStyle as Ze, Teleport as ct, normalizeProps as Ae, mergeProps as Ve } from "vue";
2
- import { u as pe, W as dt, f as He, h as mt, a as Pe, F as Ge, X as pt, Y as Ie, j as me, P as ft, t as Se, V as Fe, A as vt, M as yt, T as ve, Z as _t, $ as oe, a0 as ht, a1 as We, m as kt, a2 as bt, a3 as gt, a4 as xt, a5 as St, a6 as Ce, a7 as Ft, a8 as et, Q as X, a9 as wt, s as tt, aa as ke, ab as $t, ac as At, o as Be, l as Ke, p as Vt, c as Ct, ad as Bt, ae as Mt, af as Dt, ag as jt, ah as It, B as Tt, _ as Ut, C as Et, E as Ht, G as qe } from "./app-D68Nrj_W.js";
3
- import { u as Re, a as ye } from "./stock-FiZmySc9.js";
4
- import { g as we } from "./decimal-DwlcTwF4.js";
5
- import { e as Pt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-CDfN66ys.js";
6
- import { _ as Te, S as Me, g as st } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
2
+ import { u as pe, X as dt, f as He, h as mt, a as Pe, F as Ge, Y as pt, Z as Ie, j as me, Q as ft, t as Se, W as Fe, A as vt, M as yt, V as ve, $ as _t, a0 as oe, a1 as ht, a2 as We, n as kt, a3 as bt, a4 as gt, a5 as xt, a6 as St, a7 as Ce, a8 as Ft, a9 as et, T as X, aa as wt, v as tt, ab as ke, ac as $t, ad as At, p as Me, m as Ke, q as Vt, c as Ct, ae as Mt, af as Bt, ag as Dt, ah as jt, ai as It, C as Tt, _ as Ut, E as Et, G as Ht, J as qe } from "./app-Bcq0U90V.js";
3
+ import { u as Re, a as ye } from "./stock-DcD5Tbqe.js";
4
+ import { g as we } from "./decimal-Dhnp84Mk.js";
5
+ import { e as Pt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DIgC7Vso.js";
6
+ import { _ as Te, S as Be, g as st } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
7
7
  import { _ as Rt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
8
8
  import { useI18n as de, useCoreStore as at } from "@feedmepos/mf-common";
9
9
  import { useSnackbar as _e, useDialog as Oe, useProxiedModel as Ne, useBreakpoints as Ot } from "@feedmepos/ui-library";
10
10
  import { defineStore as Nt } from "pinia";
11
- import { u as Lt } from "./use-inventory-binding-dialog-TU1dCDcj.js";
12
- import { _ as zt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-rynZcLum.js";
11
+ import { u as Lt } from "./use-inventory-binding-dialog-CtvdrDNH.js";
12
+ import { _ as zt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D6G0tvu8.js";
13
13
  import { E as Yt } from "./empty-placeholder-wf6-BWE8.js";
14
- import { F as Gt } from "./FmAdminBadge-Cj1R2Bi0.js";
14
+ import { F as Gt } from "./FmAdminBadge-phxApe08.js";
15
15
  import "./array-Ca8T3f_G.js";
16
16
  var be = /* @__PURE__ */ ((y) => (y.History = "History", y.Convert = "Convert", y.Adjust = "Adjust", y))(be || {});
17
17
  const Wt = [
@@ -136,8 +136,8 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
136
136
  }
137
137
  ), $ = N(!1);
138
138
  return (C, a) => {
139
- const s = D("FmIcon"), _ = D("FmMenuItem"), B = D("FmMenu");
140
- return x(), L(B, {
139
+ const s = D("FmIcon"), _ = D("FmMenuItem"), M = D("FmMenu");
140
+ return x(), L(M, {
141
141
  "stop-click-propagation": "",
142
142
  onMenuChanged: a[0] || (a[0] = (S) => $.value = S)
143
143
  }, {
@@ -168,13 +168,13 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
168
168
  });
169
169
  };
170
170
  }
171
- }), Qt = { class: "whitespace-nowrap" }, Jt = /* @__PURE__ */ ce({
171
+ }), Jt = { class: "whitespace-nowrap" }, Qt = /* @__PURE__ */ ce({
172
172
  __name: "StockHeaderPreview",
173
173
  setup(y) {
174
174
  const { t: b } = de();
175
175
  return (u, o) => (x(), L(Rt, null, {
176
176
  default: I(() => [
177
- e("div", Qt, h(i(b)("inventory.stock.prediction.daysRemaining")), 1)
177
+ e("div", Jt, h(i(b)("inventory.stock.prediction.daysRemaining")), 1)
178
178
  ]),
179
179
  _: 1
180
180
  }));
@@ -199,8 +199,8 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
199
199
  }
200
200
  const $ = N();
201
201
  async function C(F) {
202
- var M, j, P;
203
- if (!!!((j = (M = F.convert) == null ? void 0 : M.inventoryBindings) != null && j.length)) {
202
+ var B, j, P;
203
+ if (!!!((j = (B = F.convert) == null ? void 0 : B.inventoryBindings) != null && j.length)) {
204
204
  p.open({
205
205
  title: c("inventory.stock.error.convert.title"),
206
206
  message: c("inventory.stock.error.convert.message")
@@ -235,7 +235,7 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
235
235
  a.value = n;
236
236
  }
237
237
  const _ = N();
238
- async function B(F) {
238
+ async function M(F) {
239
239
  const n = {
240
240
  sku: F,
241
241
  show: !0,
@@ -249,7 +249,7 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
249
249
  const l = He(n);
250
250
  switch (F) {
251
251
  case be.History:
252
- B(l);
252
+ M(l);
253
253
  return;
254
254
  case be.Convert:
255
255
  C(l);
@@ -263,7 +263,7 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
263
263
  fetchStockBalance: v,
264
264
  onActionMenu: S,
265
265
  stockHistoryProps: _,
266
- showSkuHistory: B,
266
+ showSkuHistory: M,
267
267
  convertSkuDialogProps: $,
268
268
  adjustSkuDialogProps: a
269
269
  };
@@ -301,7 +301,7 @@ function Zt() {
301
301
  {
302
302
  accessorKey: "day",
303
303
  id: "expireDate",
304
- header: () => he(Jt),
304
+ header: () => he(Qt),
305
305
  enableSorting: !0,
306
306
  sortUndefined: "last",
307
307
  cell(A) {
@@ -311,7 +311,7 @@ function Zt() {
311
311
  return he(Te, {
312
312
  days: p
313
313
  });
314
- const $ = p <= c ? Me.low : p <= v ? Me.mid : Me.high;
314
+ const $ = p <= c ? Be.low : p <= v ? Be.mid : Be.high;
315
315
  return he(Te, {
316
316
  days: p,
317
317
  level: $
@@ -372,7 +372,7 @@ const en = {
372
372
  return this;
373
373
  }
374
374
  };
375
- function Qe(y) {
375
+ function Je(y) {
376
376
  return { ...en, context: y };
377
377
  }
378
378
  const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-800" }, on = { class: "flex flex-col gap-24 w-full" }, sn = { class: "flex flex-col gap-8" }, an = { class: "fm-typo-en-body-lg-600" }, ln = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary flex-grow" }, rn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-error" }, un = { class: "flex flex-col p-16 gap-8" }, cn = { class: "flex flex-col gap-4" }, dn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border-b py-12 px-16" }, mn = { class: "grid grid-cols-[auto_100px_100px_48px] xs:grid-cols-[auto_80px_120px_48px] gap-8 px-8 items-center" }, pn = { class: "xs:col-span-3" }, fn = { class: "flex gap-8" }, vn = /* @__PURE__ */ ce({
@@ -384,7 +384,7 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
384
384
  },
385
385
  emits: ["update:show", "submitted"],
386
386
  setup(y, { expose: b, emit: u }) {
387
- const o = y, A = u, p = Lt(), c = Pe(), v = ye(), $ = _e(), { t: C } = de(), a = N(0), s = N(null), _ = R(() => c.skus), B = R(
387
+ const o = y, A = u, p = Lt(), c = Pe(), v = ye(), $ = _e(), { t: C } = de(), a = N(0), s = N(null), _ = R(() => c.skus), M = R(
388
388
  () => {
389
389
  var m, t;
390
390
  return (((t = (m = o.sku) == null ? void 0 : m.convert) == null ? void 0 : t.inventoryBindings) ?? []).filter(
@@ -396,7 +396,7 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
396
396
  return !!s.value;
397
397
  },
398
398
  set(m) {
399
- m ? s.value = He(B.value) : (s.value = null, a.value = Math.min(a.value, o.maxCount ?? 0));
399
+ m ? s.value = He(M.value) : (s.value = null, a.value = Math.min(a.value, o.maxCount ?? 0));
400
400
  }
401
401
  }), F = N(!1);
402
402
  xe([() => o.show], ([m]) => {
@@ -408,7 +408,7 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
408
408
  function l(m) {
409
409
  if (s.value)
410
410
  return !0;
411
- const t = Qe(m).isInteger().max(o.maxCount ?? 0).error ?? "";
411
+ const t = Je(m).isInteger().max(o.maxCount ?? 0).error ?? "";
412
412
  return t || !0;
413
413
  }
414
414
  function w(m) {
@@ -417,9 +417,9 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
417
417
  var H;
418
418
  return V.id === ((H = o.sku.convert) == null ? void 0 : H.measurement);
419
419
  }) ?? null : null, r = Ie(o.sku.unit, t), k = _t(+m);
420
- return Qe(k).isInteger().max(r).error ? "Precision cannot be more than " + r : !0;
420
+ return Je(k).isInteger().max(r).error ? "Precision cannot be more than " + r : !0;
421
421
  }
422
- const M = R(
422
+ const B = R(
423
423
  () => {
424
424
  var m, t;
425
425
  return (m = o.sku.convert) != null && m.measurement ? (t = o.sku.unit.measurements.find((r) => {
@@ -446,10 +446,10 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
446
446
  Se(+a.value, ee)
447
447
  ),
448
448
  !1
449
- ) : "0", q = (Le = (ae = s.value) == null ? void 0 : ae.find((fe) => fe.id === (V == null ? void 0 : V._id))) == null ? void 0 : Le.amount, J = q ? me(q, !1) : null;
449
+ ) : "0", q = (Le = (ae = s.value) == null ? void 0 : ae.find((fe) => fe.id === (V == null ? void 0 : V._id))) == null ? void 0 : Le.amount, Q = q ? me(q, !1) : null;
450
450
  return {
451
451
  sku: V,
452
- convertAmount: J ?? E,
452
+ convertAmount: Q ?? E,
453
453
  abbrev: H
454
454
  };
455
455
  });
@@ -527,7 +527,7 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
527
527
  }
528
528
  s.value = k;
529
529
  }
530
- function Q(m, t) {
530
+ function J(m, t) {
531
531
  const r = t.filter((k) => k.id !== m);
532
532
  s.value = r;
533
533
  }
@@ -574,8 +574,8 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
574
574
  "onUpdate:modelValue": t[0] || (t[0] = (E) => a.value = E),
575
575
  label: i(C)("inventory.stock.convert.amount"),
576
576
  rules: [l, w, i(Fe)(0)],
577
- "append-text": M.value,
578
- "helper-text": s.value ? void 0 : `Max ${m.maxCount} ${M.value}`
577
+ "append-text": B.value,
578
+ "helper-text": s.value ? void 0 : `Max ${m.maxCount} ${B.value}`
579
579
  }, null, 8, ["disabled", "model-value", "label", "rules", "append-text", "helper-text"])
580
580
  ]),
581
581
  _: 1
@@ -588,12 +588,12 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
588
588
  e("div", sn, [
589
589
  e("div", an, h(i(C)("inventory.stock.convert.deductionSummary")), 1),
590
590
  (x(!0), O(ne, null, re(j.value, (E) => {
591
- var q, J;
591
+ var q, Q;
592
592
  return x(), O("div", {
593
593
  key: (q = E.sku) == null ? void 0 : q._id,
594
594
  class: "flex items-center"
595
595
  }, [
596
- e("div", ln, h((J = E.sku) == null ? void 0 : J.name), 1),
596
+ e("div", ln, h((Q = E.sku) == null ? void 0 : Q.name), 1),
597
597
  e("div", rn, " -" + h(E.convertAmount) + " " + h(E.abbrev), 1)
598
598
  ]);
599
599
  }), 128))
@@ -631,10 +631,10 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
631
631
  ]
632
632
  }, {
633
633
  default: I(({ invalid: q }) => {
634
- var J, le, ie;
634
+ var Q, le, ie;
635
635
  return [
636
636
  e("div", mn, [
637
- e("div", pn, h((J = _.value.find((te) => te._id === E.id)) == null ? void 0 : J.name), 1),
637
+ e("div", pn, h((Q = _.value.find((te) => te._id === E.id)) == null ? void 0 : Q.name), 1),
638
638
  g(r, {
639
639
  class: "xs:col-span-2",
640
640
  disabled: F.value,
@@ -660,7 +660,7 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
660
660
  type: "button",
661
661
  variant: "tertiary",
662
662
  icon: "delete",
663
- onClick: (te) => Q(E.id, s.value ?? [])
663
+ onClick: (te) => J(E.id, s.value ?? [])
664
664
  }, null, 8, ["disabled", "onClick"])
665
665
  ])
666
666
  ];
@@ -689,8 +689,8 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
689
689
  loading: F.value,
690
690
  label: i(C)("inventory.stock.convert.convertButton"),
691
691
  onClick: t[2] || (t[2] = (E) => {
692
- var q, J;
693
- return (J = (q = P.value) == null ? void 0 : q.validateInputs) == null ? void 0 : J.call(q);
692
+ var q, Q;
693
+ return (Q = (q = P.value) == null ? void 0 : q.validateInputs) == null ? void 0 : Q.call(q);
694
694
  })
695
695
  }, null, 8, ["loading", "label"])
696
696
  ])
@@ -704,7 +704,7 @@ function De(y, b) {
704
704
  const u = Se(y, b);
705
705
  return { ...u, amount: -u.amount };
706
706
  }
707
- function Je(y, b) {
707
+ function Qe(y, b) {
708
708
  return Se(Math.abs(y), b);
709
709
  }
710
710
  const je = {
@@ -722,11 +722,11 @@ const je = {
722
722
  },
723
723
  [oe.enum.EXTRA]: {
724
724
  label: "Extra",
725
- toAdjustmentAmount: Je
725
+ toAdjustmentAmount: Qe
726
726
  },
727
727
  [oe.enum.PURCHASE]: {
728
728
  label: "Purchase",
729
- toAdjustmentAmount: Je
729
+ toAdjustmentAmount: Qe
730
730
  }
731
731
  }, yn = { class: "col-span-2 flex" }, _n = { class: "fm-typo-en-body-lg-600 flex-1" }, hn = /* @__PURE__ */ ce({
732
732
  __name: "AdjustedItemForm",
@@ -776,11 +776,11 @@ const je = {
776
776
  return ((a = u.modelValue.measurement) == null ? void 0 : a.id) ?? null;
777
777
  },
778
778
  set(a) {
779
- var _, B;
779
+ var _, M;
780
780
  const s = {
781
781
  ...u.modelValue
782
782
  };
783
- s.measurement = ((B = (_ = u.modelValue.doc.unit) == null ? void 0 : _.measurements) == null ? void 0 : B.find((S) => S.id === a)) ?? null, o("update:modelValue", s);
783
+ s.measurement = ((M = (_ = u.modelValue.doc.unit) == null ? void 0 : _.measurements) == null ? void 0 : M.find((S) => S.id === a)) ?? null, o("update:modelValue", s);
784
784
  }
785
785
  }), C = R({
786
786
  get() {
@@ -794,7 +794,7 @@ const je = {
794
794
  }
795
795
  });
796
796
  return (a, s) => {
797
- const _ = D("FmButton"), B = D("FmSelect"), S = D("FmTextarea"), F = D("FmCard");
797
+ const _ = D("FmButton"), M = D("FmSelect"), S = D("FmTextarea"), F = D("FmCard");
798
798
  return x(), L(F, {
799
799
  variant: "outlined",
800
800
  class: "grid grid-cols-2 gap-8 p-16"
@@ -808,7 +808,7 @@ const je = {
808
808
  onClick: s[0] || (s[0] = (n) => o("click:delete"))
809
809
  })
810
810
  ]),
811
- g(B, {
811
+ g(M, {
812
812
  disabled: a.disabled,
813
813
  class: "col-span-2",
814
814
  label: "Type",
@@ -829,7 +829,7 @@ const je = {
829
829
  "onUpdate:modelValue": s[2] || (s[2] = (n) => v.value = n),
830
830
  rules: [i(Fe)(0)]
831
831
  }, null, 8, ["disabled", "step", "modelValue", "rules"]),
832
- g(B, {
832
+ g(M, {
833
833
  disabled: a.disabled,
834
834
  label: "Unit",
835
835
  items: p.value,
@@ -864,19 +864,19 @@ const je = {
864
864
  const _ = N();
865
865
  b({
866
866
  validateInputs: () => {
867
- var w, M;
868
- (M = (w = _.value) == null ? void 0 : w.validateInputs) == null || M.call(w);
867
+ var w, B;
868
+ (B = (w = _.value) == null ? void 0 : w.validateInputs) == null || B.call(w);
869
869
  },
870
870
  resetInputsValidation: () => {
871
- var w, M;
872
- (M = (w = _.value) == null ? void 0 : w.resetInputsValidation) == null || M.call(w);
871
+ var w, B;
872
+ (B = (w = _.value) == null ? void 0 : w.resetInputsValidation) == null || B.call(w);
873
873
  },
874
874
  resetInputs: () => {
875
- var w, M;
876
- (M = (w = _.value) == null ? void 0 : w.resetInputs) == null || M.call(w);
875
+ var w, B;
876
+ (B = (w = _.value) == null ? void 0 : w.resetInputs) == null || B.call(w);
877
877
  }
878
878
  });
879
- const B = Ne(o, "show"), S = it({
879
+ const M = Ne(o, "show"), S = it({
880
880
  remark: "",
881
881
  adjustments: [
882
882
  {
@@ -906,21 +906,21 @@ const je = {
906
906
  try {
907
907
  await v.adjustSku({
908
908
  remark: w.remark,
909
- adjustments: w.adjustments.map(({ doc: M, remark: j, type: P, amount: T, measurement: Y }) => ({
910
- id: M._id,
909
+ adjustments: w.adjustments.map(({ doc: B, remark: j, type: P, amount: T, measurement: Y }) => ({
910
+ id: B._id,
911
911
  amount: T,
912
912
  measurement: Y,
913
913
  remark: j,
914
- doc: M,
914
+ doc: B,
915
915
  type: P
916
916
  }))
917
917
  }), A("update:show", !1), A("submitted");
918
- } catch (M) {
918
+ } catch (B) {
919
919
  $.open({
920
920
  title: a("inventory.stock.adjust.error.title"),
921
921
  message: a("inventory.stock.adjust.error.message"),
922
922
  type: "error"
923
- }), console.log("error on adjust ingredients", w, M);
923
+ }), console.log("error on adjust ingredients", w, B);
924
924
  } finally {
925
925
  C.value = !1;
926
926
  }
@@ -930,13 +930,13 @@ const je = {
930
930
  label: j.name,
931
931
  sublabel: j.code,
932
932
  value: j._id
933
- })), M = w.filter((j) => S.adjustments.find((P) => P.doc._id === j.value)).map((j) => j.value);
933
+ })), B = w.filter((j) => S.adjustments.find((P) => P.doc._id === j.value)).map((j) => j.value);
934
934
  c.open({
935
935
  title: "Select ingredients",
936
936
  contentComponent: bt,
937
937
  contentComponentProps: {
938
938
  items: w,
939
- modelValue: M
939
+ modelValue: B
940
940
  },
941
941
  overlay: !0,
942
942
  closeButton: !0,
@@ -966,11 +966,11 @@ const je = {
966
966
  function l(w) {
967
967
  S.adjustments.splice(w, 1);
968
968
  }
969
- return (w, M) => {
969
+ return (w, B) => {
970
970
  const j = D("FmTextarea"), P = D("FmButton"), T = D("FmForm"), Y = D("FmSideSheet");
971
971
  return x(), L(Y, {
972
- modelValue: i(B),
973
- "onUpdate:modelValue": M[2] || (M[2] = (W) => Ue(B) ? B.value = W : null),
972
+ modelValue: i(M),
973
+ "onUpdate:modelValue": B[2] || (B[2] = (W) => Ue(M) ? M.value = W : null),
974
974
  "dismiss-away": "",
975
975
  "max-width": 500
976
976
  }, {
@@ -990,7 +990,7 @@ const je = {
990
990
  g(j, {
991
991
  label: i(a)("inventory.stock.adjust.remark"),
992
992
  modelValue: S.remark,
993
- "onUpdate:modelValue": M[0] || (M[0] = (W) => S.remark = W)
993
+ "onUpdate:modelValue": B[0] || (B[0] = (W) => S.remark = W)
994
994
  }, null, 8, ["label", "modelValue"]),
995
995
  e("div", gn, [
996
996
  e("div", xn, h(i(a)("inventory.stock.adjust.adjustedItems")), 1),
@@ -1016,7 +1016,7 @@ const je = {
1016
1016
  g(P, {
1017
1017
  label: i(a)("inventory.stock.adjust.adjustButton"),
1018
1018
  loading: C.value,
1019
- onClick: M[1] || (M[1] = (W) => {
1019
+ onClick: B[1] || (B[1] = (W) => {
1020
1020
  var U, Z;
1021
1021
  return (Z = (U = _.value) == null ? void 0 : U.validateInputs) == null ? void 0 : Z.call(U);
1022
1022
  })
@@ -1047,7 +1047,7 @@ const je = {
1047
1047
  })), $n = {
1048
1048
  key: 0,
1049
1049
  class: "flex justify-center items-center h-32"
1050
- }, An = { class: "mb-3" }, Vn = { class: "flex flex-col gap-8" }, Cn = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, Bn = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, Mn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Dn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, jn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, In = { class: "flex flex-col w-full px-2" }, Tn = { class: "flex gap-2" }, Un = /* @__PURE__ */ ce({
1050
+ }, An = { class: "mb-3" }, Vn = { class: "flex flex-col gap-8" }, Cn = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, Mn = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, Bn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Dn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, jn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, In = { class: "flex flex-col w-full px-2" }, Tn = { class: "flex gap-2" }, Un = /* @__PURE__ */ ce({
1051
1051
  __name: "AmendAdjustmentForm",
1052
1052
  props: /* @__PURE__ */ Ye({
1053
1053
  adjustmentId: {}
@@ -1071,12 +1071,12 @@ const je = {
1071
1071
  var l, w;
1072
1072
  if ((w = (l = a == null ? void 0 : a.value) == null ? void 0 : l.validateInputs) == null || w.call(l), !v.value) return;
1073
1073
  const n = {};
1074
- Object.keys(p.value || {}).forEach((M) => {
1074
+ Object.keys(p.value || {}).forEach((B) => {
1075
1075
  var j;
1076
- Object.keys(((j = p.value) == null ? void 0 : j[M]) || {}).forEach((P) => {
1076
+ Object.keys(((j = p.value) == null ? void 0 : j[B]) || {}).forEach((P) => {
1077
1077
  var Y, W;
1078
- const T = (W = (Y = p.value) == null ? void 0 : Y[M]) == null ? void 0 : W[Number(P)];
1079
- T && B(T.amount) > 0 && (n[M] || (n[M] = []), n[M].push(T));
1078
+ const T = (W = (Y = p.value) == null ? void 0 : Y[B]) == null ? void 0 : W[Number(P)];
1079
+ T && M(T.amount) > 0 && (n[B] || (n[B] = []), n[B].push(T));
1080
1080
  });
1081
1081
  }), await A.revertWastageAdjustment({
1082
1082
  targetWastageAdjustmentId: u.adjustmentId,
@@ -1087,21 +1087,21 @@ const je = {
1087
1087
  return R({
1088
1088
  get: () => {
1089
1089
  var j, P, T;
1090
- const M = (T = (P = (j = p.value) == null ? void 0 : j[n]) == null ? void 0 : P[l]) == null ? void 0 : T.amount;
1091
- return M ? B(M, !0) : 0;
1090
+ const B = (T = (P = (j = p.value) == null ? void 0 : j[n]) == null ? void 0 : P[l]) == null ? void 0 : T.amount;
1091
+ return B ? M(B, !0) : 0;
1092
1092
  },
1093
- set: (M) => {
1093
+ set: (B) => {
1094
1094
  p.value || (p.value = {});
1095
1095
  const j = { ...p.value };
1096
1096
  j[n] || (j[n] = {}), j[n][l] = {
1097
- amount: Ce.fromNumber(M),
1097
+ amount: Ce.fromNumber(B),
1098
1098
  type: oe.Enum.WASTAGE,
1099
1099
  measurement: w
1100
1100
  }, p.value = j;
1101
1101
  }
1102
1102
  });
1103
1103
  }
1104
- function B(n, l = !0) {
1104
+ function M(n, l = !0) {
1105
1105
  const w = Number(Ce.toFormatString({ value: n }));
1106
1106
  return l ? Math.abs(w) : w;
1107
1107
  }
@@ -1112,7 +1112,7 @@ const je = {
1112
1112
  return l === 0 ? "N/A" : (n + l).toString();
1113
1113
  }
1114
1114
  return (n, l) => {
1115
- const w = D("FmIcon"), M = D("FmStepperField"), j = D("FmCard"), P = D("FmForm"), T = D("FmSpacer"), Y = D("FmButton"), W = D("FmDialog");
1115
+ const w = D("FmIcon"), B = D("FmStepperField"), j = D("FmCard"), P = D("FmForm"), T = D("FmSpacer"), Y = D("FmButton"), W = D("FmDialog");
1116
1116
  return x(), L(W, {
1117
1117
  modelValue: $.value,
1118
1118
  "onUpdate:modelValue": l[4] || (l[4] = (U) => $.value = U),
@@ -1180,18 +1180,18 @@ const je = {
1180
1180
  ]),
1181
1181
  e("div", Vn, [
1182
1182
  (x(!0), O(ne, null, re(C.value.skus, (U, Z) => (x(), O(ne, { key: Z }, [
1183
- (x(!0), O(ne, null, re(U.amounts, (z, Q) => (x(), L(j, {
1184
- key: Q,
1183
+ (x(!0), O(ne, null, re(U.amounts, (z, J) => (x(), L(j, {
1184
+ key: J,
1185
1185
  variant: "outlined",
1186
1186
  class: "p-2"
1187
1187
  }, {
1188
1188
  default: I(() => [
1189
1189
  e("div", Cn, [
1190
- e("span", Bn, h(U.sku.code), 1),
1190
+ e("span", Mn, h(U.sku.code), 1),
1191
1191
  e("span", null, h(U.sku.name), 1)
1192
1192
  ]),
1193
1193
  l[12] || (l[12] = e("hr", { class: "m-2" }, null, -1)),
1194
- e("div", Mn, [
1194
+ e("div", Bn, [
1195
1195
  l[8] || (l[8] = e("span", { class: "fm-typo-en-body-lg-600" }, "Adjustment type:", -1)),
1196
1196
  e("span", null, h(z.type), 1)
1197
1197
  ]),
@@ -1199,15 +1199,15 @@ const je = {
1199
1199
  l[9] || (l[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
1200
1200
  e("span", null, h(i(Ce).toFormatString({ value: z.amount })) + " " + h(S(U, z)), 1)
1201
1201
  ]),
1202
- g(M, {
1203
- "model-value": _(U.sku._id, Q).value,
1204
- "onUpdate:modelValue": (G) => _(U.sku._id, Q).value = G,
1202
+ g(B, {
1203
+ "model-value": _(U.sku._id, J).value,
1204
+ "onUpdate:modelValue": (G) => _(U.sku._id, J).value = G,
1205
1205
  class: "mb-3",
1206
1206
  label: "Adjust Amount (Leave 0 to skip)",
1207
- "helper-text": `Max: ${B(z.amount)}`,
1207
+ "helper-text": `Max: ${M(z.amount)}`,
1208
1208
  "append-text": S(U, z),
1209
1209
  rules: [
1210
- (G) => G <= B(z.amount) || `Cannot be more than ${B(z.amount)}`,
1210
+ (G) => G <= M(z.amount) || `Cannot be more than ${M(z.amount)}`,
1211
1211
  i(Fe)(-1)
1212
1212
  ]
1213
1213
  }, null, 8, ["model-value", "onUpdate:modelValue", "helper-text", "append-text", "rules"]),
@@ -1215,8 +1215,8 @@ const je = {
1215
1215
  l[10] || (l[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
1216
1216
  l[11] || (l[11] = e("span", { class: "text-fm-color-system-warning-400 fm-typo-en-body-sm-400" }, "* It's an estimate for your reference, as it didn't include all the reversals related to this adjustment", -1)),
1217
1217
  ue(" " + h(F(
1218
- B(z.amount, !1),
1219
- _(U.sku._id, Q).value
1218
+ M(z.amount, !1),
1219
+ _(U.sku._id, J).value
1220
1220
  )) + " " + h(S(U, z)), 1)
1221
1221
  ])
1222
1222
  ]),
@@ -1282,8 +1282,8 @@ const je = {
1282
1282
  time: wt(new Date(a)),
1283
1283
  adjustments: s.flatMap(
1284
1284
  (_) => {
1285
- var B, S;
1286
- return ((S = (B = _.skus) == null ? void 0 : B.map) == null ? void 0 : S.call(B, (F) => {
1285
+ var M, S;
1286
+ return ((S = (M = _.skus) == null ? void 0 : M.map) == null ? void 0 : S.call(M, (F) => {
1287
1287
  var n, l;
1288
1288
  return {
1289
1289
  ...F,
@@ -1296,7 +1296,7 @@ const je = {
1296
1296
  }
1297
1297
  ).flatMap((_) => {
1298
1298
  var F;
1299
- const B = (F = u.bills.find((n) => n._id === _.ref)) == null ? void 0 : F.seqNumber, S = B ? $("inventory.stock.record.bill", [B]) : "";
1299
+ const M = (F = u.bills.find((n) => n._id === _.ref)) == null ? void 0 : F.seqNumber, S = M ? $("inventory.stock.record.bill", [M]) : "";
1300
1300
  return _.amounts.map((n) => {
1301
1301
  var l;
1302
1302
  return {
@@ -1316,7 +1316,7 @@ const je = {
1316
1316
  })
1317
1317
  })));
1318
1318
  return (a, s) => {
1319
- const _ = D("FmIcon"), B = D("FmTooltip"), S = D("FmCard");
1319
+ const _ = D("FmIcon"), M = D("FmTooltip"), S = D("FmCard");
1320
1320
  return x(), L(S, { variant: "outlined" }, {
1321
1321
  default: I(() => [
1322
1322
  e("div", En, [
@@ -1368,7 +1368,7 @@ const je = {
1368
1368
  }, [
1369
1369
  e("div", Ln, [
1370
1370
  ue(h(i($)(`inventory.inventoryAdjustment.type.${n.name}`)) + " ", 1),
1371
- n.backdateFrom ? (x(), L(B, {
1371
+ n.backdateFrom ? (x(), L(M, {
1372
1372
  key: 0,
1373
1373
  variant: "plain",
1374
1374
  placement: "top",
@@ -1474,7 +1474,7 @@ function Xn(y, b) {
1474
1474
  precision: 4
1475
1475
  })} ${b.unit.abbrev}`) : null;
1476
1476
  }
1477
- const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = { class: "flex-1 line-clamp-2" }, Zn = { class: "flex flex-col gap-32 w-full h-full" }, eo = { class: "flex items-center relative gap-4" }, to = { class: "flex-1" }, no = {
1477
+ const Jn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Qn = { class: "flex-1 line-clamp-2" }, Zn = { class: "flex flex-col gap-32 w-full h-full" }, eo = { class: "flex items-center relative gap-4" }, to = { class: "flex-1" }, no = {
1478
1478
  key: 0,
1479
1479
  class: "flex-1 flex flex-col items-center gap-16"
1480
1480
  }, oo = { class: "fm-typo-en-body-lg-400 translate-x-4" }, so = {
@@ -1483,7 +1483,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1483
1483
  }, ao = { class: "pb-16" }, lo = { class: "fm-typo-cn-body-lg-600" }, ro = {
1484
1484
  class: "grid gap-12 fm-typo-en-body-md-400",
1485
1485
  style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
1486
- }, io = { class: "flex flex-col gap-1" }, uo = { class: "text-fm-color-typo-secondary" }, co = { class: "font-bold" }, mo = { class: "flex flex-col gap-1" }, po = { class: "text-fm-color-typo-secondary flex" }, fo = { class: "font-bold" }, vo = { class: "flex flex-col gap-1" }, yo = { class: "text-fm-color-typo-secondary" }, _o = { class: "font-bold" }, ho = { class: "flex flex-col gap-1" }, ko = { class: "text-fm-color-typo-secondary" }, bo = { class: "font-bold" }, go = { class: "flex flex-col gap-1" }, xo = { class: "text-fm-color-typo-secondary" }, So = { class: "font-bold" }, Fo = { class: "flex flex-col gap-1" }, wo = { class: "text-fm-color-typo-secondary" }, $o = { class: "font-bold" }, Ao = { class: "flex flex-col gap-1" }, Vo = { class: "text-fm-color-typo-secondary" }, Co = { class: "font-bold" }, Bo = { class: "flex flex-col gap-1" }, Mo = { class: "text-fm-color-typo-secondary" }, Do = { class: "font-bold" }, jo = { class: "flex flex-col gap-1" }, Io = { class: "text-fm-color-typo-secondary" }, To = { class: "font-bold" }, Uo = {
1486
+ }, io = { class: "flex flex-col gap-1" }, uo = { class: "text-fm-color-typo-secondary" }, co = { class: "font-bold" }, mo = { class: "flex flex-col gap-1" }, po = { class: "text-fm-color-typo-secondary flex" }, fo = { class: "font-bold" }, vo = { class: "flex flex-col gap-1" }, yo = { class: "text-fm-color-typo-secondary" }, _o = { class: "font-bold" }, ho = { class: "flex flex-col gap-1" }, ko = { class: "text-fm-color-typo-secondary" }, bo = { class: "font-bold" }, go = { class: "flex flex-col gap-1" }, xo = { class: "text-fm-color-typo-secondary" }, So = { class: "font-bold" }, Fo = { class: "flex flex-col gap-1" }, wo = { class: "text-fm-color-typo-secondary" }, $o = { class: "font-bold" }, Ao = { class: "flex flex-col gap-1" }, Vo = { class: "text-fm-color-typo-secondary" }, Co = { class: "font-bold" }, Mo = { class: "flex flex-col gap-1" }, Bo = { class: "text-fm-color-typo-secondary" }, Do = { class: "font-bold" }, jo = { class: "flex flex-col gap-1" }, Io = { class: "text-fm-color-typo-secondary" }, To = { class: "font-bold" }, Uo = {
1487
1487
  key: 0,
1488
1488
  class: "flex flex-col gap-8"
1489
1489
  }, Eo = { class: "flex" }, Ho = { class: "flex-1 flex flex-col gap-1" }, Po = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Ro = { class: "font-bold" }, Oo = { class: "flex-1 flex flex-col gap-1" }, No = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Lo = { class: "flex flex-col gap-1" }, zo = { class: "font-bold" }, Yo = {
@@ -1517,7 +1517,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1517
1517
  }), xe([() => s.value, () => $.sku], () => {
1518
1518
  _();
1519
1519
  });
1520
- const B = N([]), S = N([]), F = N(new Array());
1520
+ const M = N([]), S = N([]), F = N(new Array());
1521
1521
  function n(t, r) {
1522
1522
  return r === "day" ? It(t) : tt(t);
1523
1523
  }
@@ -1540,18 +1540,18 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1540
1540
  async function w() {
1541
1541
  let t = await o.readStockAdjustment(
1542
1542
  $.sku._id,
1543
- Bt(new Date(s.value.startDate)).toISOString(),
1544
- Mt(new Date(s.value.endDate)).toISOString()
1543
+ Mt(new Date(s.value.startDate)).toISOString(),
1544
+ Bt(new Date(s.value.endDate)).toISOString()
1545
1545
  );
1546
- B.value = t;
1546
+ M.value = t;
1547
1547
  const r = t.filter(({ ref: k }) => k == null ? void 0 : k.startsWith("bill_")).map(({ ref: k }) => k);
1548
- await M(r), S.value = l(t, "day").map(({ date: k, adjustments: d }) => ({
1548
+ await B(r), S.value = l(t, "day").map(({ date: k, adjustments: d }) => ({
1549
1549
  date: k,
1550
1550
  adjustments: d,
1551
1551
  adjustmentsByTime: l(d, "minute")
1552
1552
  }));
1553
1553
  }
1554
- async function M(t) {
1554
+ async function B(t) {
1555
1555
  t.length && (F.value = await A.findBillsById(t).catch((r) => {
1556
1556
  var f;
1557
1557
  console.error("Error on using latest bill API, retrying using legacy api", r);
@@ -1560,13 +1560,13 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1560
1560
  }));
1561
1561
  }
1562
1562
  const j = R(() => {
1563
- const t = B.value, r = $.sku;
1563
+ const t = M.value, r = $.sku;
1564
1564
  return qn(t, r);
1565
1565
  }), P = R(() => {
1566
- const t = B.value, r = $.sku;
1566
+ const t = M.value, r = $.sku;
1567
1567
  return Xn(t, r);
1568
1568
  }), T = R(() => {
1569
- const t = [...B.value].computeFirst((k) => {
1569
+ const t = [...M.value].computeFirst((k) => {
1570
1570
  var f, V;
1571
1571
  const d = (V = (f = k.skus) == null ? void 0 : f.find) == null ? void 0 : V.call(f, (H) => H.sku._id === $.sku._id);
1572
1572
  return d == null ? void 0 : d.fromBalance;
@@ -1579,7 +1579,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1579
1579
  precision: 4
1580
1580
  })} ${r.unit.abbrev}` : "";
1581
1581
  }), Y = R(() => {
1582
- const t = [...B.value].reverse().computeFirst((k) => {
1582
+ const t = [...M.value].reverse().computeFirst((k) => {
1583
1583
  var f, V;
1584
1584
  const d = (V = (f = k.skus) == null ? void 0 : f.find) == null ? void 0 : V.call(f, (H) => H.sku._id === $.sku._id);
1585
1585
  return d == null ? void 0 : d.toBalance;
@@ -1590,7 +1590,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1590
1590
  return r ? `${X.toFormatString({ value: t, precision: 4 })} ${r.unit.abbrev}` : "";
1591
1591
  }), W = R(() => {
1592
1592
  var k;
1593
- const r = B.value.flatMap((d) => {
1593
+ const r = M.value.flatMap((d) => {
1594
1594
  var f;
1595
1595
  return ((f = d.skus) == null ? void 0 : f.flatMap((V) => V.amounts)) ?? [];
1596
1596
  }).filter((d) => d.amount.amount < 0).reduce(
@@ -1609,7 +1609,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1609
1609
  {
1610
1610
  amount: 0,
1611
1611
  precision: 0,
1612
- currency: Be((k = b.currentCountry) == null ? void 0 : k.value)
1612
+ currency: Me((k = b.currentCountry) == null ? void 0 : k.value)
1613
1613
  }
1614
1614
  );
1615
1615
  return ke(r, !1, r.precision);
@@ -1623,9 +1623,9 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1623
1623
  }
1624
1624
  const Z = R(() => $.sku.valuation === Ke.Enum.FIFO ? v("inventory.ingredient.valuationMethod.FIFO") : v("inventory.ingredient.valuationMethod.WAVG")), z = R(() => {
1625
1625
  var H, K, ee, E;
1626
- const t = [...B.value].reverse().computeFirst((q) => {
1627
- var J, le;
1628
- return (le = (J = q.skus) == null ? void 0 : J.find) == null ? void 0 : le.call(J, (ie) => ie.sku._id === $.sku._id);
1626
+ const t = [...M.value].reverse().computeFirst((q) => {
1627
+ var Q, le;
1628
+ return (le = (Q = q.skus) == null ? void 0 : Q.find) == null ? void 0 : le.call(Q, (ie) => ie.sku._id === $.sku._id);
1629
1629
  });
1630
1630
  if (!t) return "No data";
1631
1631
  const r = [...t.amounts].reverse()[0], k = {
@@ -1634,11 +1634,11 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1634
1634
  }, d = r.amount, f = d.amount == 0 ? X.fromNumber(0) : X.divide([k, d]);
1635
1635
  return {
1636
1636
  ...X.multiply([f, d]),
1637
- currency: ((ee = r.cost) == null ? void 0 : ee.currency) || Be(((E = b.currentCountry) == null ? void 0 : E.value) ?? Vt)
1637
+ currency: ((ee = r.cost) == null ? void 0 : ee.currency) || Me(((E = b.currentCountry) == null ? void 0 : E.value) ?? Vt)
1638
1638
  };
1639
- }), Q = R(() => {
1639
+ }), J = R(() => {
1640
1640
  var k;
1641
- const t = [...B.value].reverse().computeFirst((d) => {
1641
+ const t = [...M.value].reverse().computeFirst((d) => {
1642
1642
  var V, H;
1643
1643
  const f = (H = (V = d.skus) == null ? void 0 : V.find) == null ? void 0 : H.call(V, (K) => K.sku._id === $.sku._id);
1644
1644
  return f == null ? void 0 : f.toCostBalances;
@@ -1648,7 +1648,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1648
1648
  amount: 0,
1649
1649
  precision: 0
1650
1650
  }),
1651
- currency: Be((k = b.currentCountry) == null ? void 0 : k.value)
1651
+ currency: Me((k = b.currentCountry) == null ? void 0 : k.value)
1652
1652
  } : "No data";
1653
1653
  });
1654
1654
  function G() {
@@ -1660,7 +1660,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1660
1660
  }
1661
1661
  const m = Ne($, "show");
1662
1662
  return (t, r) => {
1663
- const k = D("FmButton"), d = D("FmField"), f = D("FmDateRangePicker"), V = D("FmSpacer"), H = D("FmCircularProgress"), K = D("FmIcon"), ee = D("FmTooltip"), E = D("FmMenuDivider"), q = D("FmChip"), J = D("FmCardSection"), le = D("FmCard"), ie = D("FmSideSheet");
1663
+ const k = D("FmButton"), d = D("FmField"), f = D("FmDateRangePicker"), V = D("FmSpacer"), H = D("FmCircularProgress"), K = D("FmIcon"), ee = D("FmTooltip"), E = D("FmMenuDivider"), q = D("FmChip"), Q = D("FmCardSection"), le = D("FmCard"), ie = D("FmSideSheet");
1664
1664
  return x(), L(ie, {
1665
1665
  "dismiss-away": "",
1666
1666
  modelValue: i(m),
@@ -1669,8 +1669,8 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1669
1669
  "max-width": 560
1670
1670
  }, {
1671
1671
  "side-sheet-header": I(() => [
1672
- e("div", Qn, [
1673
- e("div", Jn, h(i(v)("inventory.stock.history.title", [t.sku.name])), 1),
1672
+ e("div", Jn, [
1673
+ e("div", Qn, h(i(v)("inventory.stock.history.title", [t.sku.name])), 1),
1674
1674
  g(k, {
1675
1675
  variant: "tertiary",
1676
1676
  "prepend-icon": "close",
@@ -1726,7 +1726,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1726
1726
  ])) : S.value && ((te = S.value) == null ? void 0 : te.length) > 0 ? (x(), O("div", so, [
1727
1727
  g(le, { variant: "outlined" }, {
1728
1728
  default: I(() => [
1729
- g(J, { class: "flex flex-col gap-4" }, {
1729
+ g(Q, { class: "flex flex-col gap-4" }, {
1730
1730
  default: I(() => [
1731
1731
  e("div", ao, [
1732
1732
  e("div", lo, h(i(v)("inventory.stock.history.summary.title")), 1)
@@ -1777,8 +1777,8 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1777
1777
  e("div", Vo, h(i(v)("inventory.stock.history.summary.totalDamage")), 1),
1778
1778
  e("div", Co, h(j.value.DAMAGE), 1)
1779
1779
  ]),
1780
- e("div", Bo, [
1781
- e("div", Mo, h(i(v)("inventory.stock.history.summary.openingBalance")), 1),
1780
+ e("div", Mo, [
1781
+ e("div", Bo, h(i(v)("inventory.stock.history.summary.openingBalance")), 1),
1782
1782
  e("div", Do, h(T.value), 1)
1783
1783
  ]),
1784
1784
  e("div", jo, [
@@ -1818,11 +1818,11 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1818
1818
  label: "FIFO",
1819
1819
  compact: ""
1820
1820
  }),
1821
- ue(" " + h(typeof Q.value != "string" ? i(ke)(
1822
- Q.value,
1821
+ ue(" " + h(typeof J.value != "string" ? i(ke)(
1822
+ J.value,
1823
1823
  !1,
1824
- Q.value.precision
1825
- ) : Q.value), 1)
1824
+ J.value.precision
1825
+ ) : J.value), 1)
1826
1826
  ], 64)) : (x(), O(ne, { key: 1 }, [
1827
1827
  ue(h(typeof z.value != "string" ? i(ke)(
1828
1828
  z.value,
@@ -1899,11 +1899,11 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1899
1899
  }, 8, ["modelValue"]);
1900
1900
  };
1901
1901
  }
1902
- }), Xo = { class: "flex flex-col gap-8" }, Qo = { class: "flex flex-col" }, Jo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Zo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, vs = /* @__PURE__ */ ce({
1902
+ }), Xo = { class: "flex flex-col gap-8" }, Jo = { class: "flex flex-col" }, Qo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Zo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, vs = /* @__PURE__ */ ce({
1903
1903
  __name: "StockView",
1904
1904
  setup(y) {
1905
1905
  const { t: b } = de(), u = Pe(), o = pe(), A = Re(), p = rt(), c = ye(), v = nt(), { columnDefs: $ } = Zt(), C = Oe();
1906
- o.watchLocation(B);
1906
+ o.watchLocation(M);
1907
1907
  const a = N(!1), s = _e();
1908
1908
  async function _() {
1909
1909
  C.open({
@@ -1927,7 +1927,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1927
1927
  });
1928
1928
  });
1929
1929
  }
1930
- async function B() {
1930
+ async function M() {
1931
1931
  if (o._currentLocation) {
1932
1932
  a.value = !0;
1933
1933
  try {
@@ -1945,11 +1945,11 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1945
1945
  }
1946
1946
  const S = R(
1947
1947
  () => u.skus.map((T) => {
1948
- var z, Q, G;
1948
+ var z, J, G;
1949
1949
  const Y = T.trackingMeasurement;
1950
- let W = (Q = (z = A.stockBalance.skus) == null ? void 0 : z.find(
1950
+ let W = (J = (z = A.stockBalance.skus) == null ? void 0 : z.find(
1951
1951
  (m) => m.id === T._id
1952
- )) == null ? void 0 : Q.balance, U = v.inventoryForecast.skus.find(
1952
+ )) == null ? void 0 : J.balance, U = v.inventoryForecast.skus.find(
1953
1953
  (m) => m.id === T._id
1954
1954
  );
1955
1955
  return {
@@ -1962,7 +1962,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1962
1962
  trackingUnitAbbrev: Y ? ((G = T.unit.measurements.find((m) => m.id === Y)) == null ? void 0 : G.abbrev) ?? "" : T.unit.abbrev
1963
1963
  };
1964
1964
  })
1965
- ), F = N(""), { breakpoints: n } = Ot(), l = R(() => n.value.xs || n.value.sm), w = R(() => l.value ? 10 : 20), M = Tt(), j = R(() => [
1965
+ ), F = N(""), { breakpoints: n } = Ot(), l = R(() => n.value.xs || n.value.sm), w = R(() => l.value ? 10 : 20), B = Tt(), j = R(() => [
1966
1966
  {
1967
1967
  label: b("inventory.stock.stock_balance.refreshBalance"),
1968
1968
  value: "refresh-balance",
@@ -1983,7 +1983,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1983
1983
  case "refresh-balance":
1984
1984
  return _();
1985
1985
  case "refresh":
1986
- return B();
1986
+ return M();
1987
1987
  case "export":
1988
1988
  return qt(S.value);
1989
1989
  }
@@ -1996,7 +1996,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1996
1996
  "onClick:action": P
1997
1997
  }, {
1998
1998
  default: I(() => {
1999
- var U, Z, z, Q;
1999
+ var U, Z, z, J;
2000
2000
  return [
2001
2001
  e("div", {
2002
2002
  class: ge([
@@ -2014,7 +2014,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
2014
2014
  "onUpdate:search": Y[0] || (Y[0] = (G) => F.value = G)
2015
2015
  }, null, 8, ["search"]),
2016
2016
  (x(), L(W, {
2017
- style: Ze(i(M).tableHeight),
2017
+ style: Ze(i(B).tableHeight),
2018
2018
  "column-defs": i($),
2019
2019
  "row-data": S.value,
2020
2020
  "search-value": F.value,
@@ -2032,8 +2032,8 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
2032
2032
  var t, r, k, d, f, V, H, K, ee, E;
2033
2033
  return [
2034
2034
  e("div", Xo, [
2035
- e("div", Qo, [
2036
- e("div", Jo, [
2035
+ e("div", Jo, [
2036
+ e("div", Qo, [
2037
2037
  g(i(qe), {
2038
2038
  render: (k = (r = (t = m.code) == null ? void 0 : t.column) == null ? void 0 : r.columnDef) == null ? void 0 : k.cell,
2039
2039
  props: (f = (d = m.code) == null ? void 0 : d.getContext) == null ? void 0 : f.call(d)
@@ -2072,7 +2072,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
2072
2072
  (x(), L(ct, { to: "body" }, [
2073
2073
  (Z = i(p).stockHistoryProps) != null && Z.sku ? (x(), L(qo, Ae(Ve({ key: 0 }, i(p).stockHistoryProps)), null, 16)) : se("", !0),
2074
2074
  (z = i(p).convertSkuDialogProps) != null && z.sku ? (x(), L(vn, Ae(Ve({ key: 1 }, i(p).convertSkuDialogProps)), null, 16)) : se("", !0),
2075
- (Q = i(p).adjustSkuDialogProps) != null && Q.stock ? (x(), L(Fn, Ae(Ve({ key: 2 }, i(p).adjustSkuDialogProps)), null, 16)) : se("", !0)
2075
+ (J = i(p).adjustSkuDialogProps) != null && J.stock ? (x(), L(Fn, Ae(Ve({ key: 2 }, i(p).adjustSkuDialogProps)), null, 16)) : se("", !0)
2076
2076
  ]))
2077
2077
  ];
2078
2078
  }),