@feedmepos/mf-inventory-portal 1.2.0-dev.4 → 1.2.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 (43) hide show
  1. package/dist/{App-B23hTt8P.js → App-BqaRC0Sb.js} +1 -1
  2. package/dist/{ApprovalView-BDlbBg8N.js → ApprovalView-DwRrbVDo.js} +2 -2
  3. package/dist/{BindingsDialog-De55nslG.js → BindingsDialog-DUVKv10-.js} +2 -2
  4. package/dist/{BindingsPicker-Dzq-QKnj.js → BindingsPicker-Daib_iq4.js} +1 -1
  5. package/dist/{BindingsTable-BkZVEDqh.js → BindingsTable-Bv9UmcJP.js} +1 -1
  6. package/dist/{ClosingDraftView-Uu-1KA0k.js → ClosingDraftView-sJ_zRPeo.js} +2 -2
  7. package/dist/{ClosingTemplateView-fmm3ZqYc.js → ClosingTemplateView-cNgXHq1r.js} +2 -2
  8. package/dist/{DeliveryOrderPrintPreview-DxhaGpb0.js → DeliveryOrderPrintPreview-DZPcRAja.js} +1 -1
  9. package/dist/{FmAdminBadge-P98dVu_i.js → FmAdminBadge-oCnz8SW6.js} +1 -1
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CoKsh-hs.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BKR8C4p_.js} +3 -3
  11. package/dist/{FmMultiselectDialog-Cn8-Sd9S.js → FmMultiselectDialog-CZmwOkrb.js} +1 -1
  12. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-D56QhrTV.js → FmUnitInput.vue_vue_type_script_setup_true_lang-C-2V2bGc.js} +1 -1
  13. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DOaUhZjQ.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BGnoF1Zz.js} +1 -1
  14. package/dist/{IngredientGroupView-j5LbaClZ.js → IngredientGroupView-CAVYpEj3.js} +2 -2
  15. package/dist/{IngredientsView-y-JGogdT.js → IngredientsView-CHHeAJH_.js} +4 -4
  16. package/dist/{IntegrationView-BooM88Uh.js → IntegrationView-DdLFyZ4H.js} +3 -3
  17. package/dist/{InventoryBindingForm-DOM5HcgN.js → InventoryBindingForm-C7BdEDtM.js} +1 -1
  18. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-B7QPYtZP.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-B7DND2dQ.js} +3 -3
  19. package/dist/{InventoryBindingSummary-CnJHhG_U.js → InventoryBindingSummary-IZ7F-Lti.js} +1 -1
  20. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DOfNI7E2.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-sgqVSlUB.js} +1 -1
  21. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-D1Iqw5DF.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DeF32bHu.js} +1 -1
  22. package/dist/{PublishView-Xq1JT1BI.js → PublishView-DkgfYneI.js} +1 -1
  23. package/dist/{PurchaseOrderPrintPreview-BkS4Q1YJ.js → PurchaseOrderPrintPreview-CltLC4o4.js} +1 -1
  24. package/dist/{ReceiveRequestView-CKE_si_R.js → ReceiveRequestView-Dj7ji0DY.js} +8 -8
  25. package/dist/{RecipeView-muNNMb4o.js → RecipeView-BukmKdVG.js} +3 -3
  26. package/dist/{StockView-BMDBAEPn.js → StockView-wxRCw_w-.js} +214 -213
  27. package/dist/{SupplierView-BS4lKS85.js → SupplierView-DE_M_9kd.js} +3 -3
  28. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-B8tk0rVh.js → TransferDetails.vue_vue_type_script_setup_true_lang-eqUOnJoM.js} +6 -6
  29. package/dist/{TransferTemplateView-C7mzg1Yt.js → TransferTemplateView-gWGBCF3u.js} +6 -6
  30. package/dist/{UnitView-BOfWrYoc.js → UnitView-BgwDmGZo.js} +3 -3
  31. package/dist/{WarehouseView-CbHfwxXJ.js → WarehouseView-BdccenhO.js} +1 -1
  32. package/dist/{app-D0rTMX1S.js → app-CruHLH1e.js} +3957 -3954
  33. package/dist/app.d.ts +3 -0
  34. package/dist/app.js +1 -1
  35. package/dist/{decimal-BL0xwFU9.js → decimal-izbvCC1j.js} +1 -1
  36. package/dist/{format-unit-display-D4XPYOff.js → format-unit-display-4SAdfyZB.js} +2 -2
  37. package/dist/{index-BWDn1UVH.js → index-B6GGthLw.js} +1 -1
  38. package/dist/{index-BWjTZvhM.js → index-CnQloOEo.js} +1 -1
  39. package/dist/{stock-sYtaHuhh.js → stock-BJP5BB5b.js} +1 -1
  40. package/dist/{supplier-B8VC44Gc.js → supplier-CTVE1lHO.js} +1 -1
  41. package/dist/{use-ingredient-select-dialog-DnYfVhkU.js → use-ingredient-select-dialog-CM80TfX0.js} +1 -1
  42. package/dist/{use-inventory-binding-dialog-D3blZbxh.js → use-inventory-binding-dialog-D_omdhgn.js} +1 -1
  43. package/package.json +1 -1
@@ -1,17 +1,17 @@
1
- import { defineComponent as ce, ref as N, computed as R, resolveComponent as D, openBlock as F, createBlock as L, withCtx as I, createElementVNode as e, normalizeClass as ge, toDisplayString as _, createVNode as g, createElementBlock as O, Fragment as ne, renderList as le, unref as r, 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 Me, l as Ke, p as Vt, c as Ct, ad as Mt, ae as Bt, 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-D0rTMX1S.js";
3
- import { u as Re, a as ye } from "./stock-sYtaHuhh.js";
4
- import { g as we } from "./decimal-BL0xwFU9.js";
5
- import { e as Pt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-D1Iqw5DF.js";
6
- import { _ as Te, S as Be, g as st } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
1
+ import { defineComponent as ce, ref as N, computed as R, resolveComponent as D, openBlock as F, createBlock as L, withCtx as I, createElementVNode as e, normalizeClass as ge, toDisplayString as _, createVNode as x, createElementBlock as O, Fragment as ne, renderList as le, unref as r, 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-CruHLH1e.js";
3
+ import { u as Re, a as ye } from "./stock-BJP5BB5b.js";
4
+ import { g as we } from "./decimal-izbvCC1j.js";
5
+ import { e as Pt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DeF32bHu.js";
6
+ import { _ as Te, S as Me, 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-D3blZbxh.js";
12
- import { _ as zt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DOfNI7E2.js";
11
+ import { u as Lt } from "./use-inventory-binding-dialog-D_omdhgn.js";
12
+ import { _ as zt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-sgqVSlUB.js";
13
13
  import { E as Yt } from "./empty-placeholder-wf6-BWE8.js";
14
- import { F as Gt } from "./FmAdminBadge-P98dVu_i.js";
14
+ import { F as Gt } from "./FmAdminBadge-oCnz8SW6.js";
15
15
  import "./array-Ca8T3f_G.js";
16
16
  var be = /* @__PURE__ */ ((v) => (v.History = "History", v.Convert = "Convert", v.Adjust = "Adjust", v))(be || {});
17
17
  const Wt = [
@@ -81,16 +81,16 @@ async function qt(v) {
81
81
  u
82
82
  );
83
83
  }
84
- function $e(v, x) {
84
+ function $e(v, g) {
85
85
  const u = localStorage.getItem(`uom:${v._id}`);
86
- return u ? u === x._id ? {
86
+ return u ? u === g._id ? {
87
87
  type: "unit"
88
- } : x.measurements.find((o) => o.id === u) ? {
88
+ } : g.measurements.find((o) => o.id === u) ? {
89
89
  type: "measurement",
90
90
  measurement: u
91
91
  } : {
92
92
  type: "unit"
93
- } : v.trackingMeasurement && x.measurements.find((o) => o.id === v.trackingMeasurement) ? {
93
+ } : v.trackingMeasurement && g.measurements.find((o) => o.id === v.trackingMeasurement) ? {
94
94
  type: "measurement",
95
95
  measurement: v.trackingMeasurement
96
96
  } : {
@@ -106,11 +106,11 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
106
106
  defaultTrackingMeasurement: {}
107
107
  },
108
108
  setup(v) {
109
- function x($) {
109
+ function g($) {
110
110
  return `uom:${$._id}`;
111
111
  }
112
112
  function u($) {
113
- const i = x(o.sku);
113
+ const i = g(o.sku);
114
114
  $ ? localStorage.setItem(i, $) : localStorage.setItem(i, o.unit._id), A.value = $e(o.sku, o.unit);
115
115
  }
116
116
  const o = v, A = N($e(o.sku, o.unit)), p = R(() => {
@@ -134,23 +134,23 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
134
134
  var $;
135
135
  return (($ = p.value.find((i) => l(i))) == null ? void 0 : $.label) ?? "";
136
136
  }
137
- ), M = N(!1);
137
+ ), B = N(!1);
138
138
  return ($, i) => {
139
139
  const s = D("FmIcon"), V = D("FmMenuItem"), k = D("FmMenu");
140
140
  return F(), L(k, {
141
141
  "stop-click-propagation": "",
142
- onMenuChanged: i[0] || (i[0] = (S) => M.value = S)
142
+ onMenuChanged: i[0] || (i[0] = (S) => B.value = S)
143
143
  }, {
144
144
  "menu-button": I(() => [
145
145
  e("button", {
146
146
  type: "button",
147
147
  class: ge([
148
148
  "w-full text-left flex items-center gap-8 cursor-pointer fm-corner-radius-sm px-8 py-4 border bg-white",
149
- M.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
149
+ B.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
150
150
  ])
151
151
  }, [
152
152
  e("div", Xt, _(f.value), 1),
153
- g(s, {
153
+ x(s, {
154
154
  class: "text-fm-color-neutral-gray-400",
155
155
  name: "expand_more"
156
156
  })
@@ -161,7 +161,7 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
161
161
  key: S.value ?? 0,
162
162
  label: S.label,
163
163
  "model-value": l(S),
164
- onClick: (B) => u(S.value)
164
+ onClick: (M) => u(S.value)
165
165
  }, null, 8, ["label", "model-value", "onClick"]))), 128))
166
166
  ]),
167
167
  _: 1
@@ -171,18 +171,18 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
171
171
  }), Qt = { class: "whitespace-nowrap" }, Jt = /* @__PURE__ */ ce({
172
172
  __name: "StockHeaderPreview",
173
173
  setup(v) {
174
- const { t: x } = de();
174
+ const { t: g } = de();
175
175
  return (u, o) => (F(), L(Rt, null, {
176
176
  default: I(() => [
177
- e("div", Qt, _(r(x)("inventory.stock.prediction.daysRemaining")), 1)
177
+ e("div", Qt, _(r(g)("inventory.stock.prediction.daysRemaining")), 1)
178
178
  ]),
179
179
  _: 1
180
180
  }));
181
181
  }
182
182
  }), lt = Nt("stockActions", () => {
183
- const v = N(!1), x = pe(), u = Re(), o = nt(), A = _e(), p = Oe(), { t: l } = de();
183
+ const v = N(!1), g = pe(), u = Re(), o = nt(), A = _e(), p = Oe(), { t: l } = de();
184
184
  async function f() {
185
- if (x._currentLocation) {
185
+ if (g._currentLocation) {
186
186
  v.value = !0;
187
187
  try {
188
188
  await u.readStockBalance(), await u.readProductBalance(), await o.readStockEstimateBalance();
@@ -197,10 +197,10 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
197
197
  }
198
198
  }
199
199
  }
200
- const M = N();
201
- async function $(B) {
200
+ const B = N();
201
+ async function $(M) {
202
202
  var w, j, P;
203
- if (!!!((j = (w = B.convert) == null ? void 0 : w.inventoryBindings) != null && j.length)) {
203
+ if (!!!((j = (w = M.convert) == null ? void 0 : w.inventoryBindings) != null && j.length)) {
204
204
  p.open({
205
205
  title: l("inventory.stock.error.convert.title"),
206
206
  message: l("inventory.stock.error.convert.message")
@@ -208,22 +208,22 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
208
208
  return;
209
209
  }
210
210
  const y = {
211
- maxCount: ((P = u.productBalance.find(({ id: T }) => T === B._id)) == null ? void 0 : P.count) || 0,
212
- sku: B,
211
+ maxCount: ((P = u.productBalance.find(({ id: T }) => T === M._id)) == null ? void 0 : P.count) || 0,
212
+ sku: M,
213
213
  show: !0,
214
214
  "onUpdate:show"(T) {
215
- M.value.show = T;
215
+ B.value.show = T;
216
216
  },
217
217
  onSubmitted() {
218
218
  f();
219
219
  }
220
220
  };
221
- M.value = y;
221
+ B.value = y;
222
222
  }
223
223
  const i = N();
224
- async function s(B) {
224
+ async function s(M) {
225
225
  const h = {
226
- stock: B,
226
+ stock: M,
227
227
  show: !0,
228
228
  "onUpdate:show"(t) {
229
229
  i.value.show = t;
@@ -235,9 +235,9 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
235
235
  i.value = h;
236
236
  }
237
237
  const V = N();
238
- async function k(B) {
238
+ async function k(M) {
239
239
  const h = {
240
- sku: B,
240
+ sku: M,
241
241
  show: !0,
242
242
  "onUpdate:show"(t) {
243
243
  V.value.show = t;
@@ -245,9 +245,9 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
245
245
  };
246
246
  V.value = h;
247
247
  }
248
- function S(B, h) {
248
+ function S(M, h) {
249
249
  const t = He(h);
250
- switch (B) {
250
+ switch (M) {
251
251
  case be.History:
252
252
  k(t);
253
253
  return;
@@ -264,12 +264,12 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
264
264
  onActionMenu: S,
265
265
  stockHistoryProps: V,
266
266
  showSkuHistory: k,
267
- convertSkuDialogProps: M,
267
+ convertSkuDialogProps: B,
268
268
  adjustSkuDialogProps: i
269
269
  };
270
270
  });
271
271
  function Zt() {
272
- const v = pe(), x = lt(), { t: u } = de();
272
+ const v = pe(), g = lt(), { t: u } = de();
273
273
  return {
274
274
  columnDefs: [
275
275
  {
@@ -311,10 +311,10 @@ function Zt() {
311
311
  return he(Te, {
312
312
  days: p
313
313
  });
314
- const M = p <= l ? Be.low : p <= f ? Be.mid : Be.high;
314
+ const B = p <= l ? Me.low : p <= f ? Me.mid : Me.high;
315
315
  return he(Te, {
316
316
  days: p,
317
- level: M
317
+ level: B
318
318
  });
319
319
  },
320
320
  size: 200
@@ -325,7 +325,7 @@ function Zt() {
325
325
  var p;
326
326
  return mt(
327
327
  ((p = v._currentLocation) == null ? void 0 : p.type) === "restaurant" ? Wt : Kt,
328
- (l) => x.onActionMenu(l, A.row.original)
328
+ (l) => g.onActionMenu(l, A.row.original)
329
329
  );
330
330
  },
331
331
  enableSorting: !1,
@@ -353,19 +353,19 @@ const en = {
353
353
  isInteger(v = "Must be an integer") {
354
354
  return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error = v), this);
355
355
  },
356
- min(v, x) {
356
+ min(v, g) {
357
357
  if (this.error) return this;
358
358
  try {
359
- typeof this.context == "number" ? +this.context < v && (this.error = x ?? `Must be at least ${v}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < v && (this.error = x ?? `Must be at least ${v}`) : this.error = "Length cannot be determined";
359
+ typeof this.context == "number" ? +this.context < v && (this.error = g ?? `Must be at least ${v}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < v && (this.error = g ?? `Must be at least ${v}`) : this.error = "Length cannot be determined";
360
360
  } catch {
361
361
  this.error = "Length cannot be determined";
362
362
  }
363
363
  return this;
364
364
  },
365
- max(v, x) {
365
+ max(v, g) {
366
366
  if (this.error) return this;
367
367
  try {
368
- typeof this.context == "number" ? +this.context > v && (this.error = x ?? `Must be at most ${v}`) : "length" in this.context ? +this.context.length > v && (this.error = x ?? `Must be at most ${v}`) : this.error = "Length cannot be determined";
368
+ typeof this.context == "number" ? +this.context > v && (this.error = g ?? `Must be at most ${v}`) : "length" in this.context ? +this.context.length > v && (this.error = g ?? `Must be at most ${v}`) : this.error = "Length cannot be determined";
369
369
  } catch {
370
370
  this.error = "Length cannot be determined";
371
371
  }
@@ -383,8 +383,8 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
383
383
  show: { type: Boolean }
384
384
  },
385
385
  emits: ["update:show", "submitted"],
386
- setup(v, { expose: x, emit: u }) {
387
- const o = v, A = u, p = Lt(), l = Pe(), f = ye(), M = _e(), { t: $ } = de(), i = N(0), s = N(null), V = R(() => l.skus), k = R(
386
+ setup(v, { expose: g, emit: u }) {
387
+ const o = v, A = u, p = Lt(), l = Pe(), f = ye(), B = _e(), { t: $ } = de(), i = N(0), s = N(null), V = R(() => l.skus), k = R(
388
388
  () => {
389
389
  var d, n;
390
390
  return (((n = (d = o.sku) == null ? void 0 : d.convert) == null ? void 0 : n.inventoryBindings) ?? []).filter(
@@ -398,7 +398,7 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
398
398
  set(d) {
399
399
  d ? s.value = He(k.value) : (s.value = null, i.value = Math.min(i.value, o.maxCount ?? 0));
400
400
  }
401
- }), B = N(!1);
401
+ }), M = N(!1);
402
402
  xe([() => o.show], ([d]) => {
403
403
  d && (i.value = 0);
404
404
  });
@@ -454,7 +454,7 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
454
454
  };
455
455
  });
456
456
  }), P = N();
457
- x({
457
+ g({
458
458
  validateInputs: () => {
459
459
  var d, n;
460
460
  (n = (d = P.value) == null ? void 0 : d.validateInputs) == null || n.call(d);
@@ -470,7 +470,7 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
470
470
  });
471
471
  const T = Ne(o, "show");
472
472
  async function Y(d, n, a) {
473
- B.value = !0;
473
+ M.value = !0;
474
474
  try {
475
475
  await f.convertSku({
476
476
  conversions: [
@@ -489,13 +489,13 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
489
489
  ]
490
490
  }), A("update:show", !1), A("submitted");
491
491
  } catch (b) {
492
- M.open({
492
+ B.open({
493
493
  title: "Something went wrong",
494
494
  message: `Cannot convert ${d.name}. Please try again.`,
495
495
  type: "error"
496
496
  }), console.error("error at converting stock amount", d, n, b);
497
497
  } finally {
498
- B.value = !1;
498
+ M.value = !1;
499
499
  }
500
500
  }
501
501
  function W(d, n, a) {
@@ -562,14 +562,14 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
562
562
  ]),
563
563
  default: I(() => [
564
564
  e("div", on, [
565
- g(b, {
565
+ x(b, {
566
566
  ref_key: "formRef",
567
567
  ref: P,
568
568
  onValidationSuccess: h
569
569
  }, {
570
570
  default: I(() => [
571
- g(a, {
572
- disabled: B.value,
571
+ x(a, {
572
+ disabled: M.value,
573
573
  "model-value": i.value,
574
574
  "onUpdate:modelValue": n[0] || (n[0] = (E) => i.value = E),
575
575
  label: r($)("inventory.stock.convert.amount"),
@@ -580,7 +580,7 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
580
580
  ]),
581
581
  _: 1
582
582
  }, 512),
583
- g(c, {
583
+ x(c, {
584
584
  variant: "outlined",
585
585
  class: "p-16"
586
586
  }, {
@@ -601,10 +601,10 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
601
601
  ]),
602
602
  _: 1
603
603
  }),
604
- g(c, { variant: "outlined" }, {
604
+ x(c, { variant: "outlined" }, {
605
605
  default: I(() => [
606
606
  e("div", un, [
607
- g(m, {
607
+ x(m, {
608
608
  value: "",
609
609
  modelValue: S.value,
610
610
  "onUpdate:modelValue": n[1] || (n[1] = (E) => S.value = E),
@@ -612,7 +612,7 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
612
612
  "label-placement": "right"
613
613
  }, null, 8, ["modelValue", "label"]),
614
614
  S.value ? (F(), O(ne, { key: 0 }, [
615
- g(C, {
615
+ x(C, {
616
616
  modelValue: s.value,
617
617
  rules: [r(vt)(1, "Must have at least one ingredient binding")]
618
618
  }, null, 8, ["modelValue", "rules"]),
@@ -620,7 +620,7 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
620
620
  e("div", dn, _(r($)("inventory.stock.convert.ingredients")), 1),
621
621
  (F(!0), O(ne, null, le(s.value, (E) => (F(), L(C, {
622
622
  key: E.id,
623
- disabled: B.value,
623
+ disabled: M.value,
624
624
  modelValue: +r(me)(E.amount ?? { amount: 1, precision: 0 }),
625
625
  rules: [
626
626
  r(yt)(
@@ -635,17 +635,17 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
635
635
  return [
636
636
  e("div", mn, [
637
637
  e("div", pn, _((J = V.value.find((te) => te._id === E.id)) == null ? void 0 : J.name), 1),
638
- g(a, {
638
+ x(a, {
639
639
  class: "xs:col-span-2",
640
- disabled: B.value,
640
+ disabled: M.value,
641
641
  modelValue: +r(me)(
642
642
  E.amount ?? { amount: 1, precision: 0 }
643
643
  ),
644
644
  "onUpdate:modelValue": (te) => W(E.id, te, s.value ?? []),
645
645
  invalid: q
646
646
  }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
647
- g(H, {
648
- disabled: B.value,
647
+ x(H, {
648
+ disabled: M.value,
649
649
  class: "translate-y-[2px]",
650
650
  items: U(E.id),
651
651
  "model-value": (ie = Z(E.id, (re = E.measurement) == null ? void 0 : re.id)) == null ? void 0 : ie.value,
@@ -655,8 +655,8 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
655
655
  "helper-text": I(() => n[4] || (n[4] = [])),
656
656
  _: 2
657
657
  }, 1032, ["disabled", "items", "model-value", "onUpdate:modelValue", "invalid"]),
658
- g(K, {
659
- disabled: B.value,
658
+ x(K, {
659
+ disabled: M.value,
660
660
  type: "button",
661
661
  variant: "tertiary",
662
662
  icon: "delete",
@@ -669,7 +669,7 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
669
669
  }, 1032, ["disabled", "modelValue", "rules"]))), 128))
670
670
  ]),
671
671
  e("div", null, [
672
- g(K, {
672
+ x(K, {
673
673
  icon: "link",
674
674
  label: r($)("inventory.stock.convert.linkIngredient"),
675
675
  variant: "plain",
@@ -685,8 +685,8 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
685
685
  ]),
686
686
  "side-sheet-footer": I(() => [
687
687
  e("div", fn, [
688
- g(K, {
689
- loading: B.value,
688
+ x(K, {
689
+ loading: M.value,
690
690
  label: r($)("inventory.stock.convert.convertButton"),
691
691
  onClick: n[2] || (n[2] = (E) => {
692
692
  var q, J;
@@ -700,12 +700,12 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
700
700
  };
701
701
  }
702
702
  });
703
- function De(v, x) {
704
- const u = Se(v, x);
703
+ function De(v, g) {
704
+ const u = Se(v, g);
705
705
  return { ...u, amount: -u.amount };
706
706
  }
707
- function Je(v, x) {
708
- return Se(Math.abs(v), x);
707
+ function Je(v, g) {
708
+ return Se(Math.abs(v), g);
709
709
  }
710
710
  const je = {
711
711
  [oe.enum.DAMAGE]: {
@@ -735,8 +735,8 @@ const je = {
735
735
  disabled: { type: Boolean }
736
736
  },
737
737
  emits: ["update:modelValue", "click:delete"],
738
- setup(v, { emit: x }) {
739
- const u = v, o = x, A = R(
738
+ setup(v, { emit: g }) {
739
+ const u = v, o = g, A = R(
740
740
  () => Object.keys(je).map((i) => ({
741
741
  label: ht(i),
742
742
  value: i
@@ -770,7 +770,7 @@ const je = {
770
770
  V.precision
771
771
  ), o("update:modelValue", s);
772
772
  }
773
- }), M = R({
773
+ }), B = R({
774
774
  get() {
775
775
  var i;
776
776
  return ((i = u.modelValue.measurement) == null ? void 0 : i.id) ?? null;
@@ -794,21 +794,21 @@ const je = {
794
794
  }
795
795
  });
796
796
  return (i, s) => {
797
- const V = D("FmButton"), k = D("FmSelect"), S = D("FmTextarea"), B = D("FmCard");
798
- return F(), L(B, {
797
+ const V = D("FmButton"), k = D("FmSelect"), S = D("FmTextarea"), M = D("FmCard");
798
+ return F(), L(M, {
799
799
  variant: "outlined",
800
800
  class: "grid grid-cols-2 gap-8 p-16"
801
801
  }, {
802
802
  default: I(() => [
803
803
  e("div", yn, [
804
804
  e("div", _n, _(i.modelValue.doc.name), 1),
805
- g(V, {
805
+ x(V, {
806
806
  variant: "tertiary",
807
807
  "prepend-icon": "delete",
808
808
  onClick: s[0] || (s[0] = (h) => o("click:delete"))
809
809
  })
810
810
  ]),
811
- g(k, {
811
+ x(k, {
812
812
  disabled: i.disabled,
813
813
  class: "col-span-2",
814
814
  label: "Type",
@@ -818,7 +818,7 @@ const je = {
818
818
  rules: [r(kt)()],
819
819
  "label-mark": "required"
820
820
  }, null, 8, ["disabled", "items", "modelValue", "rules"]),
821
- g(zt, {
821
+ x(zt, {
822
822
  disabled: i.disabled,
823
823
  label: "Amount",
824
824
  step: +r(me)({
@@ -829,14 +829,14 @@ const je = {
829
829
  "onUpdate:modelValue": s[2] || (s[2] = (h) => f.value = h),
830
830
  rules: [r(Fe)(0)]
831
831
  }, null, 8, ["disabled", "step", "modelValue", "rules"]),
832
- g(k, {
832
+ x(k, {
833
833
  disabled: i.disabled,
834
834
  label: "Unit",
835
835
  items: p.value,
836
- modelValue: M.value,
837
- "onUpdate:modelValue": s[3] || (s[3] = (h) => M.value = h)
836
+ modelValue: B.value,
837
+ "onUpdate:modelValue": s[3] || (s[3] = (h) => B.value = h)
838
838
  }, null, 8, ["disabled", "items", "modelValue"]),
839
- g(S, {
839
+ x(S, {
840
840
  class: "col-span-2",
841
841
  disabled: i.disabled,
842
842
  label: "Remark",
@@ -856,13 +856,13 @@ const je = {
856
856
  show: { type: Boolean }
857
857
  },
858
858
  emits: ["update:show", "submitted"],
859
- setup(v, { expose: x, emit: u }) {
860
- const o = v, A = u, p = Pe(), l = Oe(), f = ye(), M = _e(), $ = N(!1), { t: i } = de();
859
+ setup(v, { expose: g, emit: u }) {
860
+ const o = v, A = u, p = Pe(), l = Oe(), f = ye(), B = _e(), $ = N(!1), { t: i } = de();
861
861
  function s() {
862
- B(He(S));
862
+ M(He(S));
863
863
  }
864
864
  const V = N();
865
- x({
865
+ g({
866
866
  validateInputs: () => {
867
867
  var y, w;
868
868
  (w = (y = V.value) == null ? void 0 : y.validateInputs) == null || w.call(y);
@@ -901,7 +901,7 @@ const je = {
901
901
  }
902
902
  ]);
903
903
  });
904
- async function B(y) {
904
+ async function M(y) {
905
905
  $.value = !0;
906
906
  try {
907
907
  await f.adjustSku({
@@ -916,7 +916,7 @@ const je = {
916
916
  }))
917
917
  }), A("update:show", !1), A("submitted");
918
918
  } catch (w) {
919
- M.open({
919
+ B.open({
920
920
  title: i("inventory.stock.adjust.error.title"),
921
921
  message: i("inventory.stock.adjust.error.message"),
922
922
  type: "error"
@@ -980,21 +980,21 @@ const je = {
980
980
  ])
981
981
  ]),
982
982
  default: I(() => [
983
- g(T, {
983
+ x(T, {
984
984
  class: "w-full flex flex-col gap-12",
985
985
  ref_key: "formRef",
986
986
  ref: V,
987
987
  onValidationSuccess: s
988
988
  }, {
989
989
  default: I(() => [
990
- g(j, {
990
+ x(j, {
991
991
  label: r(i)("inventory.stock.adjust.remark"),
992
992
  modelValue: S.remark,
993
993
  "onUpdate:modelValue": w[0] || (w[0] = (W) => S.remark = W)
994
994
  }, null, 8, ["label", "modelValue"]),
995
995
  e("div", gn, [
996
996
  e("div", xn, _(r(i)("inventory.stock.adjust.adjustedItems")), 1),
997
- g(P, {
997
+ x(P, {
998
998
  "prepend-icon": "add",
999
999
  variant: "tertiary",
1000
1000
  size: "md",
@@ -1013,7 +1013,7 @@ const je = {
1013
1013
  ]),
1014
1014
  "side-sheet-footer": I(() => [
1015
1015
  e("div", Sn, [
1016
- g(P, {
1016
+ x(P, {
1017
1017
  label: r(i)("inventory.stock.adjust.adjustButton"),
1018
1018
  loading: $.value,
1019
1019
  onClick: w[1] || (w[1] = (W) => {
@@ -1027,7 +1027,7 @@ const je = {
1027
1027
  }, 8, ["modelValue"]);
1028
1028
  };
1029
1029
  }
1030
- }), wn = gt((v, x) => ({
1030
+ }), wn = gt((v, g) => ({
1031
1031
  // TODO: remove once latest inventory backend has been push
1032
1032
  async findBillsByBusinessId(u, o, A) {
1033
1033
  const p = `${v.businessesBackendUrl}/${u}/reports/find-many`, l = {
@@ -1036,18 +1036,18 @@ const je = {
1036
1036
  restaurantIds: o,
1037
1037
  ids: A
1038
1038
  };
1039
- return await x.post(p, l);
1039
+ return await g.post(p, l);
1040
1040
  },
1041
1041
  async findBillsById(u) {
1042
1042
  const A = pe().currentLocationDBName, p = `${v.inventoryBackendUrl}/${A}/bill/search`, l = {
1043
1043
  ids: u
1044
1044
  };
1045
- return await x.post(p, l);
1045
+ return await g.post(p, l);
1046
1046
  }
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" }, 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({
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({
1051
1051
  __name: "AmendAdjustmentForm",
1052
1052
  props: /* @__PURE__ */ Ye({
1053
1053
  adjustmentId: {}
@@ -1056,8 +1056,8 @@ const je = {
1056
1056
  modelModifiers: {}
1057
1057
  }),
1058
1058
  emits: /* @__PURE__ */ Ye(["refreshHistory"], ["update:modelValue"]),
1059
- setup(v, { emit: x }) {
1060
- const u = v, o = x, A = ye(), p = ut(v, "modelValue"), l = N(!1), f = N(!1), M = N(!1), $ = N({
1059
+ setup(v, { emit: g }) {
1060
+ const u = v, o = g, A = ye(), p = ut(v, "modelValue"), l = N(!1), f = N(!1), B = N(!1), $ = N({
1061
1061
  _id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
1062
1062
  skus: []
1063
1063
  }), i = N();
@@ -1081,7 +1081,7 @@ const je = {
1081
1081
  }), await A.revertWastageAdjustment({
1082
1082
  targetWastageAdjustmentId: u.adjustmentId,
1083
1083
  amountsGoingToAdjust: h
1084
- }), o("refreshHistory"), M.value = !1, p.value = {};
1084
+ }), o("refreshHistory"), B.value = !1, p.value = {};
1085
1085
  }
1086
1086
  function V(h, t, y) {
1087
1087
  return R({
@@ -1108,24 +1108,24 @@ const je = {
1108
1108
  function S(h, t) {
1109
1109
  return t.measurement ? t.measurement.abbrev : h.sku.unit.abbrev;
1110
1110
  }
1111
- function B(h, t) {
1111
+ function M(h, t) {
1112
1112
  return t === 0 ? "N/A" : (h + t).toString();
1113
1113
  }
1114
1114
  return (h, t) => {
1115
1115
  const y = D("FmIcon"), w = D("FmStepperField"), j = D("FmCard"), P = D("FmForm"), T = D("FmSpacer"), Y = D("FmButton"), W = D("FmDialog");
1116
1116
  return F(), L(W, {
1117
- modelValue: M.value,
1118
- "onUpdate:modelValue": t[4] || (t[4] = (U) => M.value = U),
1117
+ modelValue: B.value,
1118
+ "onUpdate:modelValue": t[4] || (t[4] = (U) => B.value = U),
1119
1119
  overlay: !0
1120
1120
  }, {
1121
1121
  "dialog-button": I(() => [
1122
1122
  e("button", {
1123
- onClick: t[0] || (t[0] = (U) => M.value = !0),
1123
+ onClick: t[0] || (t[0] = (U) => B.value = !0),
1124
1124
  class: "rounded-md hover:bg-gray-100 transition-colors"
1125
1125
  }, [
1126
- g(Gt, null, {
1126
+ x(Gt, null, {
1127
1127
  default: I(() => [
1128
- g(y, {
1128
+ x(y, {
1129
1129
  name: "edit",
1130
1130
  size: "sm"
1131
1131
  })
@@ -1141,15 +1141,15 @@ const je = {
1141
1141
  e("div", In, [
1142
1142
  t[13] || (t[13] = e("span", { class: "text-fm-color-system-warning-400 fm-typo-en-body-sm-400" }, "1. New adjustment EXTRA will be created for each reversal", -1)),
1143
1143
  e("div", Tn, [
1144
- g(T),
1145
- g(Y, {
1144
+ x(T),
1145
+ x(Y, {
1146
1146
  class: "sm:w-full xs:w-full",
1147
1147
  label: "Close",
1148
1148
  size: "md",
1149
1149
  variant: "tertiary",
1150
- onClick: t[3] || (t[3] = (U) => M.value = !1)
1150
+ onClick: t[3] || (t[3] = (U) => B.value = !1)
1151
1151
  }),
1152
- g(Y, {
1152
+ x(Y, {
1153
1153
  class: "sm:w-full xs:w-full",
1154
1154
  label: "Submit",
1155
1155
  size: "md",
@@ -1187,11 +1187,11 @@ const je = {
1187
1187
  }, {
1188
1188
  default: I(() => [
1189
1189
  e("div", Cn, [
1190
- e("span", Mn, _(U.sku.code), 1),
1190
+ e("span", Bn, _(U.sku.code), 1),
1191
1191
  e("span", null, _(U.sku.name), 1)
1192
1192
  ]),
1193
1193
  t[12] || (t[12] = e("hr", { class: "m-2" }, null, -1)),
1194
- e("div", Bn, [
1194
+ e("div", Mn, [
1195
1195
  t[8] || (t[8] = e("span", { class: "fm-typo-en-body-lg-600" }, "Adjustment type:", -1)),
1196
1196
  e("span", null, _(z.type), 1)
1197
1197
  ]),
@@ -1199,7 +1199,7 @@ const je = {
1199
1199
  t[9] || (t[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
1200
1200
  e("span", null, _(r(Ce).toFormatString({ value: z.amount })) + " " + _(S(U, z)), 1)
1201
1201
  ]),
1202
- g(w, {
1202
+ x(w, {
1203
1203
  "model-value": V(U.sku._id, Q).value,
1204
1204
  "onUpdate:modelValue": (G) => V(U.sku._id, Q).value = G,
1205
1205
  class: "mb-3",
@@ -1214,7 +1214,7 @@ const je = {
1214
1214
  e("div", jn, [
1215
1215
  t[10] || (t[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
1216
1216
  t[11] || (t[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
- ue(" " + _(B(
1217
+ ue(" " + _(M(
1218
1218
  k(z.amount, !1),
1219
1219
  V(U.sku._id, Q).value
1220
1220
  )) + " " + _(S(U, z)), 1)
@@ -1252,19 +1252,19 @@ const je = {
1252
1252
  bills: { default: () => [] }
1253
1253
  },
1254
1254
  emits: ["refreshHistory"],
1255
- setup(v, { emit: x }) {
1255
+ setup(v, { emit: g }) {
1256
1256
  const u = v, o = N(!1), A = at(), p = N(), l = N(null), f = R(() => l.value === null ? "unset" : o.value ? `${l.value}px` : "0px");
1257
1257
  Ee(() => {
1258
1258
  var s;
1259
1259
  l.value = ((s = p.value) == null ? void 0 : s.scrollHeight) || 0;
1260
1260
  });
1261
- const M = R(() => {
1261
+ const B = R(() => {
1262
1262
  var h;
1263
- const s = u.record.adjustments, V = u.sku, k = {}, B = s.flatMap((t) => {
1263
+ const s = u.record.adjustments, V = u.sku, k = {}, M = s.flatMap((t) => {
1264
1264
  var y;
1265
1265
  return ((y = t.skus) == null ? void 0 : y.filter((w) => w.sku._id === V._id)) ?? [];
1266
1266
  }).flatMap((t) => t.amounts);
1267
- for (const t of B) {
1267
+ for (const t of M) {
1268
1268
  const y = t.measurement ? Ft(t.measurement.conversion, t.amount) : t.amount;
1269
1269
  k[h = t.type] ?? (k[h] = { amount: 0, precision: 0 }), k[t.type] = et(y, k[t.type]);
1270
1270
  }
@@ -1280,8 +1280,8 @@ const je = {
1280
1280
  time: wt(new Date(s)),
1281
1281
  adjustments: V.flatMap(
1282
1282
  (k) => {
1283
- var S, B;
1284
- return ((B = (S = k.skus) == null ? void 0 : S.map) == null ? void 0 : B.call(S, (h) => {
1283
+ var S, M;
1284
+ return ((M = (S = k.skus) == null ? void 0 : S.map) == null ? void 0 : M.call(S, (h) => {
1285
1285
  var t, y;
1286
1286
  return {
1287
1287
  ...h,
@@ -1294,14 +1294,14 @@ const je = {
1294
1294
  }
1295
1295
  ).flatMap((k) => {
1296
1296
  var h;
1297
- const S = (h = u.bills.find((t) => t._id === k.ref)) == null ? void 0 : h.seqNumber, B = S ? $("inventory.stock.record.bill", [S]) : "";
1297
+ const S = (h = u.bills.find((t) => t._id === k.ref)) == null ? void 0 : h.seqNumber, M = S ? $("inventory.stock.record.bill", [S]) : "";
1298
1298
  return k.amounts.map((t) => {
1299
1299
  var y;
1300
1300
  return {
1301
1301
  amount: `${X.toFormatString({ value: t.amount, precision: 4 })} ${((y = t.measurement) == null ? void 0 : y.abbrev) ?? k.sku.unit.abbrev}`,
1302
1302
  backdateFrom: k.backdateFrom,
1303
1303
  name: t.type,
1304
- remark: t.remark || B || "",
1304
+ remark: t.remark || M || "",
1305
1305
  cost: t.cost,
1306
1306
  toBalance: X.toFormatString({
1307
1307
  value: k.toBalance ?? X.fromNumber(0),
@@ -1314,8 +1314,8 @@ const je = {
1314
1314
  })
1315
1315
  })));
1316
1316
  return (s, V) => {
1317
- const k = D("FmIcon"), S = D("FmTooltip"), B = D("FmCard");
1318
- return F(), L(B, { variant: "outlined" }, {
1317
+ const k = D("FmIcon"), S = D("FmTooltip"), M = D("FmCard");
1318
+ return F(), L(M, { variant: "outlined" }, {
1319
1319
  default: I(() => [
1320
1320
  e("div", En, [
1321
1321
  e("div", {
@@ -1323,13 +1323,13 @@ const je = {
1323
1323
  onClick: V[0] || (V[0] = (h) => o.value = !o.value)
1324
1324
  }, [
1325
1325
  e("div", Hn, _(s.record.date), 1),
1326
- g(k, {
1326
+ x(k, {
1327
1327
  name: o.value ? "expand_more" : "expand_less",
1328
1328
  color: "#777777",
1329
1329
  size: "md"
1330
1330
  }, null, 8, ["name"])
1331
1331
  ]),
1332
- (F(!0), O(ne, null, le(M.value, (h, t) => (F(), O("div", {
1332
+ (F(!0), O(ne, null, le(B.value, (h, t) => (F(), O("div", {
1333
1333
  key: t,
1334
1334
  class: "flex flex-row py-1",
1335
1335
  style: { "font-size": "0.8rem" }
@@ -1380,7 +1380,7 @@ const je = {
1380
1380
  ])), 1)
1381
1381
  ]),
1382
1382
  default: I(() => [
1383
- g(k, {
1383
+ x(k, {
1384
1384
  name: "info",
1385
1385
  size: "sm",
1386
1386
  color: "primary"
@@ -1416,47 +1416,47 @@ const je = {
1416
1416
  };
1417
1417
  }
1418
1418
  });
1419
- function qn(v, x) {
1419
+ function qn(v, g) {
1420
1420
  var p;
1421
1421
  const u = Object.keys(oe.enum).reduce(
1422
1422
  (l, f) => (l[f] = { amount: 0, precision: 0 }, l),
1423
1423
  {}
1424
1424
  );
1425
- if (!x)
1425
+ if (!g)
1426
1426
  return Object.entries(u).reduce(
1427
1427
  (l, [f]) => (l[f] = X.fromNumber(0), l),
1428
1428
  {}
1429
1429
  );
1430
1430
  const A = v.flatMap((l) => {
1431
1431
  var f;
1432
- return ((f = l.skus) == null ? void 0 : f.filter((M) => M.sku._id === x._id)) ?? [];
1432
+ return ((f = l.skus) == null ? void 0 : f.filter((B) => B.sku._id === g._id)) ?? [];
1433
1433
  }).flatMap((l) => l.amounts);
1434
1434
  for (const l of A) {
1435
1435
  const f = l.measurement ? X.multiply([l.measurement.conversion, l.amount]) : l.amount;
1436
1436
  u[p = l.type] ?? (u[p] = { amount: 0, precision: 0 }), u[l.type] = X.add([f, u[l.type]]);
1437
1437
  }
1438
1438
  return Object.entries(u).reduce(
1439
- (l, [f, M]) => {
1439
+ (l, [f, B]) => {
1440
1440
  const $ = {
1441
- ...M,
1442
- amount: Math.abs(M.amount)
1441
+ ...B,
1442
+ amount: Math.abs(B.amount)
1443
1443
  };
1444
1444
  return l[f] = /// comment, because without it formatter makes code uglier
1445
1445
  `${X.toFormatString({
1446
1446
  value: $,
1447
1447
  precision: 4
1448
- })} ${x.unit.abbrev}`, l;
1448
+ })} ${g.unit.abbrev}`, l;
1449
1449
  },
1450
1450
  {}
1451
1451
  );
1452
1452
  }
1453
- function Xn(v, x) {
1454
- if (!x)
1453
+ function Xn(v, g) {
1454
+ if (!g)
1455
1455
  return null;
1456
1456
  let u = null;
1457
1457
  const A = v.flatMap((p) => {
1458
1458
  var l;
1459
- return ((l = p.skus) == null ? void 0 : l.filter((f) => f.sku._id === x._id)) ?? [];
1459
+ return ((l = p.skus) == null ? void 0 : l.filter((f) => f.sku._id === g._id)) ?? [];
1460
1460
  }).flatMap((p) => {
1461
1461
  var l;
1462
1462
  return !p.history || ((l = p.history) == null ? void 0 : l.length) === 0 ? [] : p.history[0];
@@ -1466,14 +1466,14 @@ function Xn(v, x) {
1466
1466
  for (const f of l) {
1467
1467
  if (f.type !== oe.Enum.SALES)
1468
1468
  continue;
1469
- const M = f.measurement ? X.multiply([f.measurement.conversion, f.amount]) : f.amount;
1470
- u ?? (u = X.fromNumber(0)), u = X.add([u, M]);
1469
+ const B = f.measurement ? X.multiply([f.measurement.conversion, f.amount]) : f.amount;
1470
+ u ?? (u = X.fromNumber(0)), u = X.add([u, B]);
1471
1471
  }
1472
1472
  }
1473
1473
  return u != null ? (u.amount = Math.abs(u.amount), `${X.toFormatString({
1474
1474
  value: u,
1475
1475
  precision: 4
1476
- })} ${x.unit.abbrev}`) : null;
1476
+ })} ${g.unit.abbrev}`) : null;
1477
1477
  }
1478
1478
  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 = {
1479
1479
  key: 0,
@@ -1484,7 +1484,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1484
1484
  }, ao = { class: "pb-16" }, ro = { class: "fm-typo-cn-body-lg-600" }, lo = {
1485
1485
  class: "grid gap-12 fm-typo-en-body-md-400",
1486
1486
  style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
1487
- }, 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
+ }, 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 = {
1488
1488
  key: 0,
1489
1489
  class: "flex flex-col gap-8"
1490
1490
  }, 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 = {
@@ -1498,7 +1498,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1498
1498
  },
1499
1499
  emits: ["update:show"],
1500
1500
  setup(v) {
1501
- const x = at(), u = Re(), o = ye(), A = wn(), p = pe(), l = Ct(), { t: f } = de(), M = v, $ = N(!1), i = _e(), s = N($t(0));
1501
+ const g = at(), u = Re(), o = ye(), A = wn(), p = pe(), l = Ct(), { t: f } = de(), B = v, $ = N(!1), i = _e(), s = N($t(0));
1502
1502
  async function V() {
1503
1503
  $.value = !0;
1504
1504
  try {
@@ -1508,17 +1508,17 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1508
1508
  title: "Something went wrong",
1509
1509
  message: "Cannot fetch stock history. Please try again.",
1510
1510
  type: "error"
1511
- }), console.log("failed at fetching item adjustment history", M.sku, s, n);
1511
+ }), console.log("failed at fetching item adjustment history", B.sku, s, n);
1512
1512
  } finally {
1513
1513
  $.value = !1;
1514
1514
  }
1515
1515
  }
1516
1516
  Ee(() => {
1517
1517
  V();
1518
- }), xe([() => s.value, () => M.sku], () => {
1518
+ }), xe([() => s.value, () => B.sku], () => {
1519
1519
  V();
1520
1520
  });
1521
- const k = N([]), S = N([]), B = N(new Array());
1521
+ const k = N([]), S = N([]), M = N(new Array());
1522
1522
  function h(n, a) {
1523
1523
  return a === "day" ? It(n) : tt(n);
1524
1524
  }
@@ -1540,9 +1540,9 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1540
1540
  }
1541
1541
  async function y() {
1542
1542
  let n = await o.readStockAdjustment(
1543
- M.sku._id,
1544
- Mt(new Date(s.value.startDate)).toISOString(),
1545
- Bt(new Date(s.value.endDate)).toISOString()
1543
+ B.sku._id,
1544
+ Bt(new Date(s.value.startDate)).toISOString(),
1545
+ Mt(new Date(s.value.endDate)).toISOString()
1546
1546
  );
1547
1547
  k.value = n;
1548
1548
  const a = n.filter(({ ref: b }) => b == null ? void 0 : b.startsWith("bill_")).map(({ ref: b }) => b);
@@ -1553,28 +1553,28 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1553
1553
  }));
1554
1554
  }
1555
1555
  async function w(n) {
1556
- n.length && (B.value = await A.findBillsById(n).catch((a) => {
1556
+ n.length && (M.value = await A.findBillsById(n).catch((a) => {
1557
1557
  var m;
1558
1558
  console.error("Error on using latest bill API, retrying using legacy api", a);
1559
- const b = ((m = x.currentBusiness.value) == null ? void 0 : m._id) ?? "", c = p.currentLocation.doc._id;
1559
+ const b = ((m = g.currentBusiness.value) == null ? void 0 : m._id) ?? "", c = p.currentLocation.doc._id;
1560
1560
  return A.findBillsByBusinessId(b, [c], n);
1561
1561
  }));
1562
1562
  }
1563
1563
  const j = R(() => {
1564
- const n = k.value, a = M.sku;
1564
+ const n = k.value, a = B.sku;
1565
1565
  return qn(n, a);
1566
1566
  }), P = R(() => {
1567
- const n = k.value, a = M.sku;
1567
+ const n = k.value, a = B.sku;
1568
1568
  return Xn(n, a);
1569
1569
  }), T = R(() => {
1570
1570
  const n = [...k.value].computeFirst((b) => {
1571
1571
  var m, C;
1572
- const c = (C = (m = b.skus) == null ? void 0 : m.find) == null ? void 0 : C.call(m, (H) => H.sku._id === M.sku._id);
1572
+ const c = (C = (m = b.skus) == null ? void 0 : m.find) == null ? void 0 : C.call(m, (H) => H.sku._id === B.sku._id);
1573
1573
  return c == null ? void 0 : c.fromBalance;
1574
1574
  }) ?? {
1575
1575
  amount: 0,
1576
1576
  precision: 0
1577
- }, a = M.sku;
1577
+ }, a = B.sku;
1578
1578
  return a ? `${X.toFormatString({
1579
1579
  value: n,
1580
1580
  precision: 4
@@ -1582,12 +1582,12 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1582
1582
  }), Y = R(() => {
1583
1583
  const n = [...k.value].reverse().computeFirst((b) => {
1584
1584
  var m, C;
1585
- const c = (C = (m = b.skus) == null ? void 0 : m.find) == null ? void 0 : C.call(m, (H) => H.sku._id === M.sku._id);
1585
+ const c = (C = (m = b.skus) == null ? void 0 : m.find) == null ? void 0 : C.call(m, (H) => H.sku._id === B.sku._id);
1586
1586
  return c == null ? void 0 : c.toBalance;
1587
1587
  }) ?? {
1588
1588
  amount: 0,
1589
1589
  precision: 0
1590
- }, a = M.sku;
1590
+ }, a = B.sku;
1591
1591
  return a ? `${X.toFormatString({ value: n, precision: 4 })} ${a.unit.abbrev}` : "";
1592
1592
  }), W = R(() => {
1593
1593
  var b;
@@ -1610,7 +1610,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1610
1610
  {
1611
1611
  amount: 0,
1612
1612
  precision: 0,
1613
- currency: Me((b = x.currentCountry) == null ? void 0 : b.value)
1613
+ currency: Be((b = g.currentCountry) == null ? void 0 : b.value)
1614
1614
  }
1615
1615
  );
1616
1616
  return ke(a, !1, a.precision);
@@ -1622,11 +1622,11 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1622
1622
  endDate: a
1623
1623
  });
1624
1624
  }
1625
- const Z = R(() => M.sku.valuation === Ke.Enum.FIFO ? f("inventory.ingredient.valuationMethod.FIFO") : f("inventory.ingredient.valuationMethod.WAVG")), z = R(() => {
1625
+ const Z = R(() => B.sku.valuation === Ke.Enum.FIFO ? f("inventory.ingredient.valuationMethod.FIFO") : f("inventory.ingredient.valuationMethod.WAVG")), z = R(() => {
1626
1626
  var H, K, ee, E;
1627
1627
  const n = [...k.value].reverse().computeFirst((q) => {
1628
1628
  var J, re;
1629
- return (re = (J = q.skus) == null ? void 0 : J.find) == null ? void 0 : re.call(J, (ie) => ie.sku._id === M.sku._id);
1629
+ return (re = (J = q.skus) == null ? void 0 : J.find) == null ? void 0 : re.call(J, (ie) => ie.sku._id === B.sku._id);
1630
1630
  });
1631
1631
  if (!n) return "No data";
1632
1632
  const a = [...n.amounts].reverse()[0], b = {
@@ -1635,13 +1635,13 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1635
1635
  }, c = a.amount, m = c.amount == 0 ? X.fromNumber(0) : X.divide([b, c]);
1636
1636
  return {
1637
1637
  ...X.multiply([m, c]),
1638
- currency: ((ee = a.cost) == null ? void 0 : ee.currency) || Me(((E = x.currentCountry) == null ? void 0 : E.value) ?? Vt)
1638
+ currency: ((ee = a.cost) == null ? void 0 : ee.currency) || Be(((E = g.currentCountry) == null ? void 0 : E.value) ?? Vt)
1639
1639
  };
1640
1640
  }), Q = R(() => {
1641
1641
  var b;
1642
1642
  const n = [...k.value].reverse().computeFirst((c) => {
1643
1643
  var C, H;
1644
- const m = (H = (C = c.skus) == null ? void 0 : C.find) == null ? void 0 : H.call(C, (K) => K.sku._id === M.sku._id);
1644
+ const m = (H = (C = c.skus) == null ? void 0 : C.find) == null ? void 0 : H.call(C, (K) => K.sku._id === B.sku._id);
1645
1645
  return m == null ? void 0 : m.toCostBalances;
1646
1646
  });
1647
1647
  return n ? {
@@ -1649,7 +1649,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1649
1649
  amount: 0,
1650
1650
  precision: 0
1651
1651
  }),
1652
- currency: Me((b = x.currentCountry) == null ? void 0 : b.value)
1652
+ currency: Be((b = g.currentCountry) == null ? void 0 : b.value)
1653
1653
  } : "No data";
1654
1654
  });
1655
1655
  function G() {
@@ -1659,7 +1659,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1659
1659
  endDate: a
1660
1660
  });
1661
1661
  }
1662
- const d = Ne(M, "show");
1662
+ const d = Ne(B, "show");
1663
1663
  return (n, a) => {
1664
1664
  const b = D("FmButton"), c = D("FmField"), m = D("FmDateRangePicker"), C = D("FmSpacer"), H = D("FmCircularProgress"), K = D("FmIcon"), ee = D("FmTooltip"), E = D("FmMenuDivider"), q = D("FmChip"), J = D("FmCardSection"), re = D("FmCard"), ie = D("FmSideSheet");
1665
1665
  return F(), L(ie, {
@@ -1672,7 +1672,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1672
1672
  "side-sheet-header": I(() => [
1673
1673
  e("div", Qn, [
1674
1674
  e("div", Jn, _(r(f)("inventory.stock.history.title", [n.sku.name])), 1),
1675
- g(b, {
1675
+ x(b, {
1676
1676
  variant: "tertiary",
1677
1677
  "prepend-icon": "close",
1678
1678
  onClick: a[0] || (a[0] = (te) => d.value = !1)
@@ -1685,7 +1685,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1685
1685
  e("div", Zn, [
1686
1686
  e("div", eo, [
1687
1687
  e("div", to, [
1688
- g(m, {
1688
+ x(m, {
1689
1689
  modelValue: s.value,
1690
1690
  "onUpdate:modelValue": a[1] || (a[1] = (ae) => s.value = ae),
1691
1691
  "show-predefined-range": "",
@@ -1694,7 +1694,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1694
1694
  "z-index": 50
1695
1695
  }, {
1696
1696
  "trigger-button": I(({ opened: ae }) => [
1697
- g(c, {
1697
+ x(c, {
1698
1698
  "prepend-icon": "calendar_month",
1699
1699
  focused: ae
1700
1700
  }, {
@@ -1707,27 +1707,27 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1707
1707
  _: 1
1708
1708
  }, 8, ["modelValue"])
1709
1709
  ]),
1710
- g(b, {
1710
+ x(b, {
1711
1711
  variant: "tertiary",
1712
1712
  onClick: a[2] || (a[2] = (ae) => U()),
1713
1713
  "prepend-icon": "navigate_before"
1714
1714
  }),
1715
- g(b, {
1715
+ x(b, {
1716
1716
  variant: "tertiary",
1717
1717
  onClick: a[3] || (a[3] = (ae) => G()),
1718
1718
  "prepend-icon": "navigate_next"
1719
1719
  })
1720
1720
  ]),
1721
1721
  $.value ? (F(), O("div", no, [
1722
- g(C),
1723
- g(H, { size: "xl" }),
1722
+ x(C),
1723
+ x(H, { size: "xl" }),
1724
1724
  e("div", oo, _(r(f)("inventory.stock.history.loading")), 1),
1725
- g(C),
1726
- g(C)
1725
+ x(C),
1726
+ x(C)
1727
1727
  ])) : S.value && ((te = S.value) == null ? void 0 : te.length) > 0 ? (F(), O("div", so, [
1728
- g(re, { variant: "outlined" }, {
1728
+ x(re, { variant: "outlined" }, {
1729
1729
  default: I(() => [
1730
- g(J, { class: "flex flex-col gap-4" }, {
1730
+ x(J, { class: "flex flex-col gap-4" }, {
1731
1731
  default: I(() => [
1732
1732
  e("div", ao, [
1733
1733
  e("div", ro, _(r(f)("inventory.stock.history.summary.title")), 1)
@@ -1748,7 +1748,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1748
1748
  "z-index": 50
1749
1749
  }, {
1750
1750
  default: I(() => [
1751
- g(K, {
1751
+ x(K, {
1752
1752
  name: "warning",
1753
1753
  size: "sm"
1754
1754
  })
@@ -1778,8 +1778,8 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1778
1778
  e("div", Vo, _(r(f)("inventory.stock.history.summary.totalDamage")), 1),
1779
1779
  e("div", Co, _(j.value.DAMAGE), 1)
1780
1780
  ]),
1781
- e("div", Mo, [
1782
- e("div", Bo, _(r(f)("inventory.stock.history.summary.openingBalance")), 1),
1781
+ e("div", Bo, [
1782
+ e("div", Mo, _(r(f)("inventory.stock.history.summary.openingBalance")), 1),
1783
1783
  e("div", Do, _(T.value), 1)
1784
1784
  ]),
1785
1785
  e("div", jo, [
@@ -1788,21 +1788,21 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1788
1788
  ])
1789
1789
  ]),
1790
1790
  r(l).enableTotalCost ? (F(), O("div", Uo, [
1791
- g(E, { class: "w-full" }),
1791
+ x(E, { class: "w-full" }),
1792
1792
  e("div", Eo, [
1793
1793
  e("div", Ho, [
1794
- g(Xe, { "z-index": 50 }, {
1794
+ x(Xe, { "z-index": 50 }, {
1795
1795
  default: I(() => [
1796
1796
  e("div", Po, [
1797
1797
  ue(_(r(f)("inventory.stock.history.estimatedValue")) + " ", 1),
1798
- g(ee, {
1798
+ x(ee, {
1799
1799
  variant: "plain",
1800
1800
  placement: "top",
1801
1801
  content: `[${Z.value}] ${r(f)("inventory.stock.history.estimatedValueTooltip")}`,
1802
1802
  "z-index": 50
1803
1803
  }, {
1804
1804
  default: I(() => [
1805
- g(K, {
1805
+ x(K, {
1806
1806
  name: "help",
1807
1807
  size: "sm"
1808
1808
  })
@@ -1815,7 +1815,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1815
1815
  }),
1816
1816
  e("div", Ro, [
1817
1817
  n.sku.valuation === r(Ke).Enum.FIFO ? (F(), O(ne, { key: 0 }, [
1818
- g(q, {
1818
+ x(q, {
1819
1819
  label: "FIFO",
1820
1820
  compact: ""
1821
1821
  }),
@@ -1834,11 +1834,11 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1834
1834
  ])
1835
1835
  ]),
1836
1836
  e("div", Oo, [
1837
- g(Xe, { "z-index": 50 }, {
1837
+ x(Xe, { "z-index": 50 }, {
1838
1838
  default: I(() => [
1839
1839
  e("div", No, [
1840
1840
  ue(_(r(f)("inventory.stock.history.costSold")) + " ", 1),
1841
- g(ee, {
1841
+ x(ee, {
1842
1842
  variant: "plain",
1843
1843
  placement: "top",
1844
1844
  "z-index": 50
@@ -1847,7 +1847,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1847
1847
  e("div", Lo, _(r(f)("inventory.stock.history.costSoldTooltip")), 1)
1848
1848
  ]),
1849
1849
  default: I(() => [
1850
- g(K, {
1850
+ x(K, {
1851
1851
  name: "help",
1852
1852
  size: "sm"
1853
1853
  })
@@ -1876,12 +1876,12 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1876
1876
  key: 0,
1877
1877
  record: ae,
1878
1878
  sku: n.sku,
1879
- bills: B.value,
1879
+ bills: M.value,
1880
1880
  onRefreshHistory: V
1881
1881
  }, null, 8, ["record", "sku", "bills"])) : se("", !0)
1882
1882
  ], 64))), 128))
1883
1883
  ])) : (F(), O("div", Yo, [
1884
- g(C),
1884
+ x(C),
1885
1885
  e("div", null, [
1886
1886
  e("img", {
1887
1887
  src: r(Yt),
@@ -1890,8 +1890,8 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1890
1890
  ]),
1891
1891
  e("div", Wo, _(r(f)("inventory.stock.history.noRecords")), 1),
1892
1892
  e("div", Ko, _(r(f)("inventory.stock.history.changeDateRange")), 1),
1893
- g(C),
1894
- g(C)
1893
+ x(C),
1894
+ x(C)
1895
1895
  ]))
1896
1896
  ])
1897
1897
  ];
@@ -1903,19 +1903,20 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1903
1903
  }), 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({
1904
1904
  __name: "StockView",
1905
1905
  setup(v) {
1906
- const { t: x } = de(), u = Pe(), o = pe(), A = Re(), p = lt(), l = ye(), f = nt(), { columnDefs: M } = Zt(), $ = Oe();
1906
+ const { t: g } = de(), u = Pe(), o = pe(), A = Re(), p = lt(), l = ye(), f = nt(), { columnDefs: B } = Zt(), $ = Oe();
1907
1907
  o.watchLocation(k);
1908
1908
  const i = N(!1), s = _e();
1909
1909
  async function V() {
1910
1910
  $.open({
1911
- title: "Are you sure you want to refresh the stock balance?",
1911
+ title: g("inventory.stock.stock_balance.refreshBalance"),
1912
+ message: g("inventory.stock.stock_balance.refreshBalanceDescription"),
1912
1913
  closeButton: !0,
1913
1914
  primaryActions: {
1914
- text: x("common.confirm"),
1915
+ text: g("common.confirm"),
1915
1916
  close: !0
1916
1917
  },
1917
1918
  secondaryActions: {
1918
- text: x("common.close"),
1919
+ text: g("common.close"),
1919
1920
  close: !0,
1920
1921
  variant: "tertiary"
1921
1922
  }
@@ -1934,8 +1935,8 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1934
1935
  await A.readStockBalance(), await A.readProductBalance(), await f.readStockEstimateBalance();
1935
1936
  } catch (T) {
1936
1937
  s.open({
1937
- title: x("inventory.stock.error.title"),
1938
- message: x("inventory.stock.error.message"),
1938
+ title: g("inventory.stock.error.title"),
1939
+ message: g("inventory.stock.error.message"),
1939
1940
  type: "error"
1940
1941
  }), console.error("error on fetch stock balance", T);
1941
1942
  } finally {
@@ -1962,19 +1963,19 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1962
1963
  trackingUnitAbbrev: Y ? ((G = T.unit.measurements.find((d) => d.id === Y)) == null ? void 0 : G.abbrev) ?? "" : T.unit.abbrev
1963
1964
  };
1964
1965
  })
1965
- ), B = N(""), { breakpoints: h } = Ot(), t = R(() => h.value.xs || h.value.sm), y = R(() => t.value ? 10 : 20), w = Tt(), j = R(() => [
1966
+ ), M = N(""), { breakpoints: h } = Ot(), t = R(() => h.value.xs || h.value.sm), y = R(() => t.value ? 10 : 20), w = Tt(), j = R(() => [
1966
1967
  {
1967
- label: x("inventory.stock.stock_balance.refreshBalance"),
1968
+ label: g("inventory.stock.stock_balance.refreshBalance"),
1968
1969
  value: "refresh-balance",
1969
1970
  isPrimary: !0,
1970
1971
  prependIcon: "calculate"
1971
1972
  },
1972
1973
  {
1973
- label: x("inventory.common.refresh"),
1974
+ label: g("inventory.common.refresh"),
1974
1975
  value: "refresh"
1975
1976
  },
1976
1977
  {
1977
- label: x("inventory.common.export"),
1978
+ label: g("inventory.common.export"),
1978
1979
  value: "export"
1979
1980
  }
1980
1981
  ]);
@@ -1991,7 +1992,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1991
1992
  return (T, Y) => {
1992
1993
  const W = D("FmTable");
1993
1994
  return F(), L(Ut, {
1994
- title: r(x)("inventory.stock.title"),
1995
+ title: r(g)("inventory.stock.title"),
1995
1996
  actions: j.value,
1996
1997
  "onClick:action": P
1997
1998
  }, {
@@ -2007,24 +2008,24 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
2007
2008
  }
2008
2009
  ])
2009
2010
  }, [
2010
- g(Et, {
2011
+ x(Et, {
2011
2012
  searchable: "",
2012
2013
  "change-location": "",
2013
- search: B.value,
2014
- "onUpdate:search": Y[0] || (Y[0] = (G) => B.value = G)
2014
+ search: M.value,
2015
+ "onUpdate:search": Y[0] || (Y[0] = (G) => M.value = G)
2015
2016
  }, null, 8, ["search"]),
2016
2017
  (F(), L(W, {
2017
2018
  style: Ze(r(w).tableHeight),
2018
- "column-defs": r(M),
2019
+ "column-defs": r(B),
2019
2020
  "row-data": S.value,
2020
- "search-value": B.value,
2021
+ "search-value": M.value,
2021
2022
  loading: i.value || !r(o)._currentLocation,
2022
2023
  key: (U = r(o)._currentLocation) == null ? void 0 : U.dbName,
2023
2024
  onRowClick: Y[1] || (Y[1] = (G) => r(p).showSkuHistory(G.original)),
2024
2025
  "page-size": y.value
2025
2026
  }, {
2026
2027
  "list-row": I((G) => [
2027
- g(Ht, {
2028
+ x(Ht, {
2028
2029
  row: G,
2029
2030
  onRowClick: r(p).showSkuHistory
2030
2031
  }, {
@@ -2034,25 +2035,25 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
2034
2035
  e("div", Xo, [
2035
2036
  e("div", Qo, [
2036
2037
  e("div", Jo, [
2037
- g(r(qe), {
2038
+ x(r(qe), {
2038
2039
  render: (b = (a = (n = d.code) == null ? void 0 : n.column) == null ? void 0 : a.columnDef) == null ? void 0 : b.cell,
2039
2040
  props: (m = (c = d.code) == null ? void 0 : c.getContext) == null ? void 0 : m.call(c)
2040
2041
  }, null, 8, ["render", "props"])
2041
2042
  ]),
2042
2043
  e("div", Zo, [
2043
- g(r(qe), {
2044
+ x(r(qe), {
2044
2045
  render: (K = (H = (C = d.name) == null ? void 0 : C.column) == null ? void 0 : H.columnDef) == null ? void 0 : K.cell,
2045
2046
  props: (E = (ee = d.name) == null ? void 0 : ee.getContext) == null ? void 0 : E.call(ee)
2046
2047
  }, null, 8, ["render", "props"])
2047
2048
  ])
2048
2049
  ]),
2049
2050
  e("div", null, [
2050
- g(Te, {
2051
+ x(Te, {
2051
2052
  days: G.original.day
2052
2053
  }, null, 8, ["days"])
2053
2054
  ]),
2054
2055
  e("div", null, [
2055
- g(rt, {
2056
+ x(rt, {
2056
2057
  class: "xs:w-[160px]",
2057
2058
  unit: G.original.unit,
2058
2059
  sku: G.original,