@feedmepos/mf-inventory-portal 1.2.7-dev.5 → 1.2.7-dev.7

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 (46) hide show
  1. package/dist/{App-D-KXb_V4.js → App-Bp3RZliL.js} +1 -1
  2. package/dist/{ApprovalView-CsKOxurA.js → ApprovalView-GJRR3rcl.js} +2 -2
  3. package/dist/{BindingsDialog-kjERSnxa.js → BindingsDialog-CAEU5bJn.js} +2 -2
  4. package/dist/{BindingsPicker-EVKOOG5B.js → BindingsPicker-bORI4mV1.js} +1 -1
  5. package/dist/{BindingsTable-B1JqtkAz.js → BindingsTable-CuH5tXgK.js} +1 -1
  6. package/dist/{ClosingDraftView-DHMT4v-d.js → ClosingDraftView-CadMahym.js} +2 -2
  7. package/dist/{ClosingTemplateView-BOkJvuFp.js → ClosingTemplateView-D3o4odDY.js} +2 -2
  8. package/dist/{DeliveryOrderPrintPreview-CPKPeJQI.js → DeliveryOrderPrintPreview-CsHfTBcq.js} +1 -1
  9. package/dist/{FmAdminBadge-pU1X5Yn4.js → FmAdminBadge-CzMn-J60.js} +1 -1
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BqmttydS.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Vp1K2ZCX.js} +3 -3
  11. package/dist/{FmMultiselectDialog-CwqvhCpx.js → FmMultiselectDialog-B8ArrIt7.js} +1 -1
  12. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Dbej6KBu.js → FmUnitInput.vue_vue_type_script_setup_true_lang-HndkjqBa.js} +1 -1
  13. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-XjYJ03c6.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-8ubEC227.js} +1 -1
  14. package/dist/{IngredientGroupView-Dj1wbUXi.js → IngredientGroupView-CwKJnrhc.js} +2 -2
  15. package/dist/{IngredientsView-B7AKdwz5.js → IngredientsView-K4NOgofz.js} +166 -163
  16. package/dist/{IntegrationView-Dyb-shZZ.js → IntegrationView-BIRbf4l3.js} +4 -4
  17. package/dist/{InventoryBindingForm-8Mo0N4ti.js → InventoryBindingForm-DWyymzbI.js} +1 -1
  18. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-3Q8zHn_i.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DyQrNaoP.js} +3 -3
  19. package/dist/{InventoryBindingSummary-B9-I5Jo_.js → InventoryBindingSummary-CXbQXbqS.js} +1 -1
  20. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-8vhGMGrt.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Bj_HAWfH.js} +1 -1
  21. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-B-wDdcG4.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DU2Qpd8s.js} +1 -1
  22. package/dist/{PublishView-BsTvJ-rb.js → PublishView-CehXv5wb.js} +1 -1
  23. package/dist/{PurchaseOrderPrintPreview-B4S020Dy.js → PurchaseOrderPrintPreview-Uf0DxlXw.js} +1 -1
  24. package/dist/{ReceiveRequestView-BpH2TvAE.js → ReceiveRequestView-ByIAx9ej.js} +8 -8
  25. package/dist/{RecipeView-CnE96AES.js → RecipeView-YwG4k-4A.js} +3 -3
  26. package/dist/{StockView-DSxsDKW2.js → StockView-C6cH0sRY.js} +250 -247
  27. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Bc0fwGq2.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DbiWKY49.js} +1 -1
  28. package/dist/{SupplierView-Cv-FJVM7.js → SupplierView-CC3KnRbQ.js} +4 -4
  29. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DDnhftMb.js → TransferDetails.vue_vue_type_script_setup_true_lang-Ctx-rXrn.js} +6 -6
  30. package/dist/{TransferTemplateView-CpguVi60.js → TransferTemplateView-SCtPnAd9.js} +7 -7
  31. package/dist/{UnitView-CbtWqtXO.js → UnitView-DJkTEgLx.js} +3 -3
  32. package/dist/{WarehouseView-JYKSCpwD.js → WarehouseView-B7lrZDx5.js} +1 -1
  33. package/dist/{app-CoQo_jq8.js → app-DSCOQo53.js} +207 -207
  34. package/dist/app.js +1 -1
  35. package/dist/{decimal-IHcKpXSH.js → decimal-BZnhdSsA.js} +1 -1
  36. package/dist/{format-unit-display-I8vKcqcG.js → format-unit-display-d7QLVQil.js} +3 -3
  37. package/dist/{index-C5WsQ8SM.js → index-Bhroqat1.js} +1 -1
  38. package/dist/{index-Dr4zDNEV.js → index-Dyt2acoh.js} +1 -1
  39. package/dist/{purchase-order-template-R8t_fJYZ.js → purchase-order-template-DiLZPW9w.js} +1 -1
  40. package/dist/{stock-BRaT53YB.js → stock-CQFxEDCX.js} +1 -1
  41. package/dist/{supplier-C6KmsrC2.js → supplier-dlDvID4f.js} +1 -1
  42. package/dist/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/{use-ingredient-select-dialog-DkjF8Xtg.js → use-ingredient-select-dialog-B2IP0HFs.js} +1 -1
  44. package/dist/{use-inventory-binding-dialog-mzDIl-dW.js → use-inventory-binding-dialog-5KDq4yCL.js} +1 -1
  45. package/package.json +4 -4
  46. /package/dist/components/{SubsidiaryTreeDialog.vue.d.ts → netsuite/SubsidiaryTreeDialog.vue.d.ts} +0 -0
@@ -1,19 +1,19 @@
1
- import { defineComponent as ce, ref as N, computed as P, resolveComponent as j, openBlock as S, createBlock as z, withCtx as I, createElementVNode as e, normalizeClass as ge, toDisplayString as _, createVNode as g, createElementBlock as O, Fragment as te, renderList as ie, unref as i, h as be, watch as xe, isRef as Ue, createCommentVNode as ae, reactive as it, mergeModels as Ye, useModel as ut, onMounted as He, createTextVNode as ue, normalizeStyle as Ze, Teleport as ct, normalizeProps as Ae, mergeProps as Ve } from "vue";
2
- import { u as pe, a0 as dt, f as Ee, h as mt, a as Pe, F as Ge, a1 as pt, w as Ie, k as me, X as ft, t as Se, $ as Fe, A as vt, M as yt, Z as ve, a2 as _t, a3 as oe, a4 as bt, a5 as Ke, o as ht, s as kt, a6 as gt, a7 as xt, a8 as St, a9 as Ce, aa as Ft, ab as et, Y as q, ac as wt, z as tt, ad as he, ae as $t, af as At, q as Be, n as We, r as Vt, c as Ct, ag as Bt, ah as Mt, ai as Dt, aj as jt, ak as It, b as Tt, K as Ut, _ as Ht, L as Et, O as Pt, P as qe } from "./app-CoQo_jq8.js";
3
- import { u as Re, a as ye } from "./stock-BRaT53YB.js";
4
- import { g as we } from "./decimal-IHcKpXSH.js";
5
- import { e as Rt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-B-wDdcG4.js";
6
- import { _ as Te, S as Me, g as st, a as Ot } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Bc0fwGq2.js";
1
+ import { defineComponent as ce, ref as N, computed as P, resolveComponent as j, openBlock as S, createBlock as z, withCtx as I, createElementVNode as e, normalizeClass as ge, toDisplayString as _, createVNode as g, createElementBlock as R, Fragment as te, renderList as ie, unref as i, h as be, watch as xe, isRef as Ue, createCommentVNode as oe, 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, a0 as dt, f as He, h as mt, a as Pe, F as Ge, a1 as pt, w as Ie, k as me, X as ft, t as Se, $ as Fe, A as vt, M as yt, Z as ve, a2 as _t, a3 as se, a4 as bt, a5 as Ke, o as kt, s as ht, a6 as gt, a7 as xt, a8 as St, a9 as Ce, aa as Ft, ab as et, Y as q, ac as wt, z as tt, ad as ke, ae as $t, af as At, q as Be, n as We, r as Vt, c as Ct, ag as Bt, ah as Mt, ai as Dt, aj as jt, ak as It, b as Tt, K as Ut, _ as Et, L as Ht, O as Pt, P as qe } from "./app-DSCOQo53.js";
3
+ import { u as Re, a as ye } from "./stock-CQFxEDCX.js";
4
+ import { g as we } from "./decimal-BZnhdSsA.js";
5
+ import { e as Rt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DU2Qpd8s.js";
6
+ import { _ as Te, S as Me, g as st, a as Ot } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DbiWKY49.js";
7
7
  import { _ as Nt } 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 Lt } from "@feedmepos/ui-library";
10
10
  import { defineStore as zt } from "pinia";
11
- import { u as Yt } from "./use-inventory-binding-dialog-mzDIl-dW.js";
12
- import { _ as Gt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-8vhGMGrt.js";
11
+ import { u as Yt } from "./use-inventory-binding-dialog-5KDq4yCL.js";
12
+ import { _ as Gt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Bj_HAWfH.js";
13
13
  import { E as Kt } from "./empty-placeholder-wf6-BWE8.js";
14
- import { F as Wt } from "./FmAdminBadge-pU1X5Yn4.js";
14
+ import { F as Wt } from "./FmAdminBadge-CzMn-J60.js";
15
15
  import "./array-Ca8T3f_G.js";
16
- var ke = /* @__PURE__ */ ((b) => (b.History = "History", b.Convert = "Convert", b.Adjust = "Adjust", b))(ke || {});
16
+ var he = /* @__PURE__ */ ((b) => (b.History = "History", b.Convert = "Convert", b.Adjust = "Adjust", b))(he || {});
17
17
  const qt = [
18
18
  {
19
19
  translationKey: "inventory.stock.action.history",
@@ -81,16 +81,16 @@ async function Jt(b) {
81
81
  c
82
82
  );
83
83
  }
84
- function $e(b, k) {
84
+ function $e(b, h) {
85
85
  const c = localStorage.getItem(`uom:${b._id}`);
86
- return c ? c === k._id ? {
86
+ return c ? c === h._id ? {
87
87
  type: "unit"
88
- } : k.measurements.find((o) => o.id === c) ? {
88
+ } : h.measurements.find((o) => o.id === c) ? {
89
89
  type: "measurement",
90
90
  measurement: c
91
91
  } : {
92
92
  type: "unit"
93
- } : b.trackingMeasurement && k.measurements.find((o) => o.id === b.trackingMeasurement) ? {
93
+ } : b.trackingMeasurement && h.measurements.find((o) => o.id === b.trackingMeasurement) ? {
94
94
  type: "measurement",
95
95
  measurement: b.trackingMeasurement
96
96
  } : {
@@ -106,11 +106,11 @@ const Qt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
106
106
  defaultTrackingMeasurement: {}
107
107
  },
108
108
  setup(b) {
109
- function k(C) {
109
+ function h(C) {
110
110
  return `uom:${C._id}`;
111
111
  }
112
112
  function c(C) {
113
- const l = k(o.sku);
113
+ const l = h(o.sku);
114
114
  C ? localStorage.setItem(l, C) : localStorage.setItem(l, o.unit._id), A.value = $e(o.sku, o.unit);
115
115
  }
116
116
  const o = b, A = N($e(o.sku, o.unit)), p = P(() => {
@@ -157,7 +157,7 @@ const Qt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
157
157
  ], 2)
158
158
  ]),
159
159
  default: I(() => [
160
- (S(!0), O(te, null, ie(p.value, (w) => (S(), z(y, {
160
+ (S(!0), R(te, null, ie(p.value, (w) => (S(), z(y, {
161
161
  key: w.value ?? 0,
162
162
  label: w.label,
163
163
  "model-value": m(w),
@@ -171,18 +171,18 @@ const Qt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
171
171
  }), Zt = { class: "whitespace-nowrap" }, en = /* @__PURE__ */ ce({
172
172
  __name: "StockHeaderPreview",
173
173
  setup(b) {
174
- const { t: k } = de();
174
+ const { t: h } = de();
175
175
  return (c, o) => (S(), z(Nt, null, {
176
176
  default: I(() => [
177
- e("div", Zt, _(i(k)("inventory.stock.prediction.daysRemaining")), 1)
177
+ e("div", Zt, _(i(h)("inventory.stock.prediction.daysRemaining")), 1)
178
178
  ]),
179
179
  _: 1
180
180
  }));
181
181
  }
182
182
  }), rt = zt("stockActions", () => {
183
- const b = N(!1), k = pe(), c = Re(), o = nt(), A = _e(), p = Oe(), { t: m } = de();
183
+ const b = N(!1), h = pe(), c = Re(), o = nt(), A = _e(), p = Oe(), { t: m } = de();
184
184
  async function v() {
185
- if (k._currentLocation) {
185
+ if (h._currentLocation) {
186
186
  b.value = !0;
187
187
  try {
188
188
  await c.readStockBalance(), await c.readProductBalance(), await o.readStockEstimateBalance();
@@ -199,7 +199,7 @@ const Qt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
199
199
  }
200
200
  const F = N();
201
201
  async function C($) {
202
- var M, D, E;
202
+ var M, D, H;
203
203
  if (!!!((D = (M = $.convert) == null ? void 0 : M.inventoryBindings) != null && D.length)) {
204
204
  p.open({
205
205
  title: m("inventory.stock.error.convert.title"),
@@ -208,11 +208,11 @@ const Qt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
208
208
  return;
209
209
  }
210
210
  const x = {
211
- maxCount: ((E = c.productBalance.find(({ id: R }) => R === $._id)) == null ? void 0 : E.count) || 0,
211
+ maxCount: ((H = c.productBalance.find(({ id: O }) => O === $._id)) == null ? void 0 : H.count) || 0,
212
212
  sku: $,
213
213
  show: !0,
214
- "onUpdate:show"(R) {
215
- F.value.show = R;
214
+ "onUpdate:show"(O) {
215
+ F.value.show = O;
216
216
  },
217
217
  onSubmitted() {
218
218
  v();
@@ -246,15 +246,15 @@ const Qt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
246
246
  y.value = n;
247
247
  }
248
248
  function w($, n) {
249
- const r = Ee(n);
249
+ const r = He(n);
250
250
  switch ($) {
251
- case ke.History:
251
+ case he.History:
252
252
  B(r);
253
253
  return;
254
- case ke.Convert:
254
+ case he.Convert:
255
255
  C(r);
256
256
  return;
257
- case ke.Adjust:
257
+ case he.Adjust:
258
258
  s(r);
259
259
  return;
260
260
  }
@@ -269,7 +269,7 @@ const Qt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ c
269
269
  };
270
270
  });
271
271
  function tn() {
272
- const b = pe(), k = rt(), { t: c } = de();
272
+ const b = pe(), h = rt(), { t: c } = de();
273
273
  return {
274
274
  columnDefs: [
275
275
  {
@@ -325,7 +325,7 @@ function tn() {
325
325
  var p;
326
326
  return mt(
327
327
  ((p = b._currentLocation) == null ? void 0 : p.type) === "restaurant" ? qt : Xt,
328
- (m) => k.onActionMenu(m, A.row.original)
328
+ (m) => h.onActionMenu(m, A.row.original)
329
329
  );
330
330
  },
331
331
  enableSorting: !1,
@@ -353,19 +353,19 @@ const nn = {
353
353
  isInteger(b = "Must be an integer") {
354
354
  return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error = b), this);
355
355
  },
356
- min(b, k) {
356
+ min(b, h) {
357
357
  if (this.error) return this;
358
358
  try {
359
- typeof this.context == "number" ? +this.context < b && (this.error = k ?? `Must be at least ${b}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < b && (this.error = k ?? `Must be at least ${b}`) : this.error = "Length cannot be determined";
359
+ typeof this.context == "number" ? +this.context < b && (this.error = h ?? `Must be at least ${b}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < b && (this.error = h ?? `Must be at least ${b}`) : 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(b, k) {
365
+ max(b, h) {
366
366
  if (this.error) return this;
367
367
  try {
368
- typeof this.context == "number" ? +this.context > b && (this.error = k ?? `Must be at most ${b}`) : "length" in this.context ? +this.context.length > b && (this.error = k ?? `Must be at most ${b}`) : this.error = "Length cannot be determined";
368
+ typeof this.context == "number" ? +this.context > b && (this.error = h ?? `Must be at most ${b}`) : "length" in this.context ? +this.context.length > b && (this.error = h ?? `Must be at most ${b}`) : this.error = "Length cannot be determined";
369
369
  } catch {
370
370
  this.error = "Length cannot be determined";
371
371
  }
@@ -383,11 +383,11 @@ const on = { class: "flex items-center" }, sn = { class: "fm-typo-en-title-md-80
383
383
  show: { type: Boolean }
384
384
  },
385
385
  emits: ["update:show", "submitted"],
386
- setup(b, { expose: k, emit: c }) {
386
+ setup(b, { expose: h, emit: c }) {
387
387
  const o = b, A = c, p = Yt(), m = Pe(), v = ye(), F = _e(), { t: C } = de(), l = N(0), s = N(null), y = P(() => m.skus), B = P(
388
388
  () => {
389
- var h, t;
390
- return (((t = (h = o.sku) == null ? void 0 : h.convert) == null ? void 0 : t.inventoryBindings) ?? []).filter(
389
+ var k, t;
390
+ return (((t = (k = o.sku) == null ? void 0 : k.convert) == null ? void 0 : t.inventoryBindings) ?? []).filter(
391
391
  (a) => a.type === Ge.enum.SKU
392
392
  );
393
393
  }
@@ -395,34 +395,34 @@ const on = { class: "flex items-center" }, sn = { class: "fm-typo-en-title-md-80
395
395
  get() {
396
396
  return !!s.value;
397
397
  },
398
- set(h) {
399
- h ? s.value = Ee(B.value) : (s.value = null, l.value = Math.min(l.value, o.maxCount ?? 0));
398
+ set(k) {
399
+ k ? s.value = He(B.value) : (s.value = null, l.value = Math.min(l.value, o.maxCount ?? 0));
400
400
  }
401
401
  }), $ = N(!1);
402
- xe([() => o.show], ([h]) => {
403
- h && (l.value = 0);
402
+ xe([() => o.show], ([k]) => {
403
+ k && (l.value = 0);
404
404
  });
405
405
  function n() {
406
406
  J(o.sku, Se(l.value), s.value);
407
407
  }
408
- function r(h) {
408
+ function r(k) {
409
409
  if (s.value)
410
410
  return !0;
411
- const t = Je(h).isInteger().max(o.maxCount ?? 0).error ?? "";
411
+ const t = Je(k).isInteger().max(o.maxCount ?? 0).error ?? "";
412
412
  return t || !0;
413
413
  }
414
- function x(h) {
414
+ function x(k) {
415
415
  var f;
416
416
  const t = (f = o.sku.convert) != null && f.measurement ? o.sku.unit.measurements.find((V) => {
417
- var H;
418
- return V.id === ((H = o.sku.convert) == null ? void 0 : H.measurement);
419
- }) ?? null : null, a = Ie(o.sku.unit, t), d = _t(+h);
417
+ var E;
418
+ return V.id === ((E = o.sku.convert) == null ? void 0 : E.measurement);
419
+ }) ?? null : null, a = Ie(o.sku.unit, t), d = _t(+k);
420
420
  return Je(d).isInteger().max(a).error ? "Precision cannot be more than " + a : !0;
421
421
  }
422
422
  const M = P(
423
423
  () => {
424
- var h, t;
425
- return (h = o.sku.convert) != null && h.measurement ? (t = o.sku.unit.measurements.find((a) => {
424
+ var k, t;
425
+ return (k = o.sku.convert) != null && k.measurement ? (t = o.sku.unit.measurements.find((a) => {
426
426
  var d;
427
427
  return a.id === ((d = o.sku.convert) == null ? void 0 : d.measurement);
428
428
  })) == null ? void 0 : t.abbrev : o.sku.unit.abbrev;
@@ -437,45 +437,45 @@ const on = { class: "flex items-center" }, sn = { class: "fm-typo-en-title-md-80
437
437
  }).inventoryBindings.filter((f) => "success" in f && f.success).map((f) => f).map((f) => f.binding);
438
438
  return (u = s.value ?? t) == null ? void 0 : u.map((f) => {
439
439
  var Z, le, ee, re, Le;
440
- const V = m.skus.find((fe) => fe._id === f.id), H = ((Z = f.measurement) == null ? void 0 : Z.abbrev) ?? ((le = V == null ? void 0 : V.unit) == null ? void 0 : le.abbrev), K = (ee = o.sku.convert) != null && ee.measurement ? o.sku.unit.measurements.find((fe) => {
440
+ const V = m.skus.find((fe) => fe._id === f.id), E = ((Z = f.measurement) == null ? void 0 : Z.abbrev) ?? ((le = V == null ? void 0 : V.unit) == null ? void 0 : le.abbrev), K = (ee = o.sku.convert) != null && ee.measurement ? o.sku.unit.measurements.find((fe) => {
441
441
  var ze;
442
442
  return fe.id === ((ze = o.sku.convert) == null ? void 0 : ze.measurement);
443
- }) ?? null : null, se = Ie(o.sku.unit, K), U = x(`${l.value}`) === !0 ? me(
443
+ }) ?? null : null, ae = Ie(o.sku.unit, K), U = x(`${l.value}`) === !0 ? me(
444
444
  ft(
445
445
  f.amount,
446
- Se(+l.value, se)
446
+ Se(+l.value, ae)
447
447
  ),
448
448
  !1
449
449
  ) : "0", Y = (Le = (re = s.value) == null ? void 0 : re.find((fe) => fe.id === (V == null ? void 0 : V._id))) == null ? void 0 : Le.amount, W = Y ? me(Y, !1) : null;
450
450
  return {
451
451
  sku: V,
452
452
  convertAmount: W ?? U,
453
- abbrev: H
453
+ abbrev: E
454
454
  };
455
455
  });
456
- }), E = N();
457
- k({
456
+ }), H = N();
457
+ h({
458
458
  validateInputs: () => {
459
- var h, t;
460
- (t = (h = E.value) == null ? void 0 : h.validateInputs) == null || t.call(h);
459
+ var k, t;
460
+ (t = (k = H.value) == null ? void 0 : k.validateInputs) == null || t.call(k);
461
461
  },
462
462
  resetInputsValidation: () => {
463
- var h, t;
464
- (t = (h = E.value) == null ? void 0 : h.resetInputsValidation) == null || t.call(h);
463
+ var k, t;
464
+ (t = (k = H.value) == null ? void 0 : k.resetInputsValidation) == null || t.call(k);
465
465
  },
466
466
  resetInputs: () => {
467
- var h, t;
468
- (t = (h = E.value) == null ? void 0 : h.resetInputs) == null || t.call(h);
467
+ var k, t;
468
+ (t = (k = H.value) == null ? void 0 : k.resetInputs) == null || t.call(k);
469
469
  }
470
470
  });
471
- const R = Ne(o, "show");
472
- async function J(h, t, a) {
471
+ const O = Ne(o, "show");
472
+ async function J(k, t, a) {
473
473
  $.value = !0;
474
474
  try {
475
475
  await v.convertSku({
476
476
  conversions: [
477
477
  {
478
- doc: h,
478
+ doc: k,
479
479
  amount: t,
480
480
  overrides: a == null ? void 0 : a.map((d) => ({
481
481
  ...d,
@@ -491,80 +491,80 @@ const on = { class: "flex items-center" }, sn = { class: "fm-typo-en-title-md-80
491
491
  } catch (d) {
492
492
  F.open({
493
493
  title: "Something went wrong",
494
- message: `Cannot convert ${h.name}. Please try again.`,
494
+ message: `Cannot convert ${k.name}. Please try again.`,
495
495
  type: "error"
496
- }), console.error("error at converting stock amount", h, t, d);
496
+ }), console.error("error at converting stock amount", k, t, d);
497
497
  } finally {
498
498
  $.value = !1;
499
499
  }
500
500
  }
501
- function X(h, t, a) {
501
+ function X(k, t, a) {
502
502
  const d = +t;
503
503
  let u = a;
504
- t.length > 0 && isFinite(d) ? u = a.map((f) => (f.id !== h || (f.amount = ve(d)), f)) : u = a.map((f) => (f.id !== h || (f.amount = { amount: 0, precision: 0 }), f)), s.value = u;
504
+ t.length > 0 && isFinite(d) ? u = a.map((f) => (f.id !== k || (f.amount = ve(d)), f)) : u = a.map((f) => (f.id !== k || (f.amount = { amount: 0, precision: 0 }), f)), s.value = u;
505
505
  }
506
- function T(h) {
507
- const t = y.value.find((a) => a._id === h);
506
+ function T(k) {
507
+ const t = y.value.find((a) => a._id === k);
508
508
  return t ? st(t.unit, !0) : [];
509
509
  }
510
- function L(h, t) {
511
- const a = T(h), d = a.find((u) => u.value === t) ?? a.find((u) => u.value === null);
510
+ function L(k, t) {
511
+ const a = T(k), d = a.find((u) => u.value === t) ?? a.find((u) => u.value === null);
512
512
  return d ? {
513
513
  ...d,
514
514
  label: d.abbrev
515
515
  } : null;
516
516
  }
517
- function G(h, t, a) {
517
+ function G(k, t, a) {
518
518
  let d;
519
519
  if (t === null)
520
- d = a.map((u) => (u.id !== h || (u.measurement = null), u)) ?? [];
520
+ d = a.map((u) => (u.id !== k || (u.measurement = null), u)) ?? [];
521
521
  else {
522
- const u = y.value.find((f) => f._id === h);
522
+ const u = y.value.find((f) => f._id === k);
523
523
  d = a.map((f) => {
524
- var V, H;
525
- return f.id !== h || (f.measurement = (H = (V = u == null ? void 0 : u.unit) == null ? void 0 : V.measurements) == null ? void 0 : H.find((K) => K.id === t)), f;
524
+ var V, E;
525
+ return f.id !== k || (f.measurement = (E = (V = u == null ? void 0 : u.unit) == null ? void 0 : V.measurements) == null ? void 0 : E.find((K) => K.id === t)), f;
526
526
  }) ?? [];
527
527
  }
528
528
  s.value = d;
529
529
  }
530
- function Q(h, t) {
531
- const a = t.filter((d) => d.id !== h);
530
+ function Q(k, t) {
531
+ const a = t.filter((d) => d.id !== k);
532
532
  s.value = a;
533
533
  }
534
534
  function ne() {
535
- const h = (s.value ?? []).map((t) => ({
535
+ const k = (s.value ?? []).map((t) => ({
536
536
  ...t,
537
537
  type: Ge.enum.SKU
538
538
  }));
539
539
  p.promptIngredientsBinding(
540
- h,
540
+ k,
541
541
  (t) => s.value = t,
542
542
  o.sku._id
543
543
  );
544
544
  }
545
545
  return xe(
546
546
  () => o.show,
547
- (h) => {
548
- h || (s.value = null, l.value = 0);
547
+ (k) => {
548
+ k || (s.value = null, l.value = 0);
549
549
  }
550
- ), (h, t) => {
551
- const a = j("FmTextField"), d = j("FmForm"), u = j("FmCard"), f = j("FmSwitch"), V = j("FmFormGroup"), H = j("FmSelect"), K = j("FmButton"), se = j("FmSideSheet");
552
- return S(), z(se, {
550
+ ), (k, t) => {
551
+ const a = j("FmTextField"), d = j("FmForm"), u = j("FmCard"), f = j("FmSwitch"), V = j("FmFormGroup"), E = j("FmSelect"), K = j("FmButton"), ae = j("FmSideSheet");
552
+ return S(), z(ae, {
553
553
  "dismiss-away": "",
554
- modelValue: i(R),
555
- "onUpdate:modelValue": t[3] || (t[3] = (U) => Ue(R) ? R.value = U : null),
554
+ modelValue: i(O),
555
+ "onUpdate:modelValue": t[3] || (t[3] = (U) => Ue(O) ? O.value = U : null),
556
556
  "max-width": 500
557
557
  }, {
558
558
  "side-sheet-header": I(() => [
559
559
  e("div", on, [
560
- e("div", sn, _(i(C)("inventory.stock.convert.title", { name: h.sku.name })), 1)
560
+ e("div", sn, _(i(C)("inventory.stock.convert.title", { name: k.sku.name })), 1)
561
561
  ])
562
562
  ]),
563
563
  default: I(() => [
564
564
  e("div", an, [
565
565
  g(d, {
566
566
  ref_key: "formRef",
567
- ref: E,
567
+ ref: H,
568
568
  onValidationSuccess: n
569
569
  }, {
570
570
  default: I(() => [
@@ -575,7 +575,7 @@ const on = { class: "flex items-center" }, sn = { class: "fm-typo-en-title-md-80
575
575
  label: i(C)("inventory.stock.convert.amount"),
576
576
  rules: [r, x, i(Fe)(0)],
577
577
  "append-text": M.value,
578
- "helper-text": s.value ? void 0 : `Max ${h.maxCount} ${M.value}`
578
+ "helper-text": s.value ? void 0 : `Max ${k.maxCount} ${M.value}`
579
579
  }, null, 8, ["disabled", "model-value", "label", "rules", "append-text", "helper-text"])
580
580
  ]),
581
581
  _: 1
@@ -587,9 +587,9 @@ const on = { class: "flex items-center" }, sn = { class: "fm-typo-en-title-md-80
587
587
  default: I(() => [
588
588
  e("div", ln, [
589
589
  e("div", rn, _(i(C)("inventory.stock.convert.deductionSummary")), 1),
590
- (S(!0), O(te, null, ie(D.value, (U) => {
590
+ (S(!0), R(te, null, ie(D.value, (U) => {
591
591
  var Y, W;
592
- return S(), O("div", {
592
+ return S(), R("div", {
593
593
  key: (Y = U.sku) == null ? void 0 : Y._id,
594
594
  class: "flex items-center"
595
595
  }, [
@@ -611,14 +611,14 @@ const on = { class: "flex items-center" }, sn = { class: "fm-typo-en-title-md-80
611
611
  label: i(C)("inventory.stock.convert.overrideDeduction"),
612
612
  "label-placement": "right"
613
613
  }, null, 8, ["modelValue", "label"]),
614
- w.value ? (S(), O(te, { key: 0 }, [
614
+ w.value ? (S(), R(te, { key: 0 }, [
615
615
  g(V, {
616
616
  modelValue: s.value,
617
617
  rules: [i(vt)(1, "Must have at least one ingredient binding")]
618
618
  }, null, 8, ["modelValue", "rules"]),
619
619
  e("div", mn, [
620
620
  e("div", pn, _(i(C)("inventory.stock.convert.ingredients")), 1),
621
- (S(!0), O(te, null, ie(s.value, (U) => (S(), z(V, {
621
+ (S(!0), R(te, null, ie(s.value, (U) => (S(), z(V, {
622
622
  key: U.id,
623
623
  disabled: $.value,
624
624
  modelValue: +i(me)(U.amount ?? { amount: 1, precision: 0 }),
@@ -644,7 +644,7 @@ const on = { class: "flex items-center" }, sn = { class: "fm-typo-en-title-md-80
644
644
  "onUpdate:modelValue": (ee) => X(U.id, ee, s.value ?? []),
645
645
  invalid: Y
646
646
  }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
647
- g(H, {
647
+ g(E, {
648
648
  disabled: $.value,
649
649
  class: "translate-y-[2px]",
650
650
  items: T(U.id),
@@ -676,7 +676,7 @@ const on = { class: "flex items-center" }, sn = { class: "fm-typo-en-title-md-80
676
676
  onClick: ne
677
677
  }, null, 8, ["label"])
678
678
  ])
679
- ], 64)) : ae("", !0)
679
+ ], 64)) : oe("", !0)
680
680
  ])
681
681
  ]),
682
682
  _: 1
@@ -690,7 +690,7 @@ const on = { class: "flex items-center" }, sn = { class: "fm-typo-en-title-md-80
690
690
  label: i(C)("inventory.stock.convert.convertButton"),
691
691
  onClick: t[2] || (t[2] = (U) => {
692
692
  var Y, W;
693
- return (W = (Y = E.value) == null ? void 0 : Y.validateInputs) == null ? void 0 : W.call(Y);
693
+ return (W = (Y = H.value) == null ? void 0 : Y.validateInputs) == null ? void 0 : W.call(Y);
694
694
  })
695
695
  }, null, 8, ["loading", "label"])
696
696
  ])
@@ -700,50 +700,50 @@ const on = { class: "flex items-center" }, sn = { class: "fm-typo-en-title-md-80
700
700
  };
701
701
  }
702
702
  });
703
- function De(b, k) {
704
- const c = Se(b, k);
703
+ function De(b, h) {
704
+ const c = Se(b, h);
705
705
  return { ...c, amount: -c.amount };
706
706
  }
707
- function Qe(b, k) {
708
- return Se(Math.abs(b), k);
707
+ function Qe(b, h) {
708
+ return Se(Math.abs(b), h);
709
709
  }
710
710
  const je = {
711
- [oe.enum.DAMAGE]: {
711
+ [se.enum.DAMAGE]: {
712
712
  label: "Waste",
713
713
  toAdjustmentAmount: De
714
714
  },
715
- [oe.enum.THEFT]: {
715
+ [se.enum.THEFT]: {
716
716
  label: "Theft",
717
717
  toAdjustmentAmount: De
718
718
  },
719
- [oe.enum.LOSE]: {
719
+ [se.enum.LOSE]: {
720
720
  label: "Lose",
721
721
  toAdjustmentAmount: De
722
722
  },
723
- [oe.enum.EXTRA]: {
723
+ [se.enum.EXTRA]: {
724
724
  label: "Extra",
725
725
  toAdjustmentAmount: Qe
726
726
  },
727
- [oe.enum.PURCHASE]: {
727
+ [se.enum.PURCHASE]: {
728
728
  label: "Purchase",
729
729
  toAdjustmentAmount: Qe
730
730
  }
731
- }, bn = { class: "col-span-2 flex" }, hn = { class: "fm-typo-en-body-lg-600 flex-1" }, kn = /* @__PURE__ */ ce({
731
+ }, bn = { class: "col-span-2 flex" }, kn = { class: "fm-typo-en-body-lg-600 flex-1" }, hn = /* @__PURE__ */ ce({
732
732
  __name: "AdjustedItemForm",
733
733
  props: {
734
734
  modelValue: {},
735
735
  disabled: { type: Boolean }
736
736
  },
737
737
  emits: ["update:modelValue", "click:delete"],
738
- setup(b, { emit: k }) {
739
- const c = b, o = k, A = P(
738
+ setup(b, { emit: h }) {
739
+ const c = b, o = h, A = P(
740
740
  () => Object.keys(je).map((l) => ({
741
741
  label: bt(l),
742
742
  value: l
743
743
  }))
744
744
  ), p = P(() => st(c.modelValue.doc.unit, !0)), m = P({
745
745
  get() {
746
- return c.modelValue.type ?? oe.enum.PURCHASE;
746
+ return c.modelValue.type ?? se.enum.PURCHASE;
747
747
  },
748
748
  set(l) {
749
749
  const s = {
@@ -801,7 +801,7 @@ const je = {
801
801
  }, {
802
802
  default: I(() => [
803
803
  e("div", bn, [
804
- e("div", hn, _(l.modelValue.doc.name), 1),
804
+ e("div", kn, _(l.modelValue.doc.name), 1),
805
805
  g(y, {
806
806
  variant: "tertiary",
807
807
  "prepend-icon": "delete",
@@ -815,7 +815,7 @@ const je = {
815
815
  items: A.value,
816
816
  modelValue: m.value,
817
817
  "onUpdate:modelValue": s[1] || (s[1] = (n) => m.value = n),
818
- rules: [i(ht)()],
818
+ rules: [i(kt)()],
819
819
  "label-mark": "required"
820
820
  }, null, 8, ["disabled", "items", "modelValue", "rules"]),
821
821
  g(Gt, {
@@ -856,13 +856,13 @@ const je = {
856
856
  show: { type: Boolean }
857
857
  },
858
858
  emits: ["update:show", "submitted"],
859
- setup(b, { expose: k, emit: c }) {
859
+ setup(b, { expose: h, emit: c }) {
860
860
  const o = b, A = c, p = Pe(), m = Oe(), v = ye(), F = _e(), C = N(!1), { t: l } = de();
861
861
  function s() {
862
- $(Ee(w));
862
+ $(He(w));
863
863
  }
864
864
  const y = N();
865
- k({
865
+ h({
866
866
  validateInputs: () => {
867
867
  var x, M;
868
868
  (M = (x = y.value) == null ? void 0 : x.validateInputs) == null || M.call(x);
@@ -881,7 +881,7 @@ const je = {
881
881
  adjustments: [
882
882
  {
883
883
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
884
- type: oe.enum.PURCHASE,
884
+ type: se.enum.PURCHASE,
885
885
  doc: o.stock,
886
886
  measurement: null,
887
887
  remark: "",
@@ -893,7 +893,7 @@ const je = {
893
893
  x && (w.remark = "", w.adjustments = [
894
894
  {
895
895
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
896
- type: oe.enum.PURCHASE,
896
+ type: se.enum.PURCHASE,
897
897
  doc: o.stock,
898
898
  measurement: null,
899
899
  remark: "",
@@ -906,13 +906,13 @@ const je = {
906
906
  try {
907
907
  await v.adjustSku({
908
908
  remark: x.remark,
909
- adjustments: x.adjustments.map(({ doc: M, remark: D, type: E, amount: R, measurement: J }) => ({
909
+ adjustments: x.adjustments.map(({ doc: M, remark: D, type: H, amount: O, measurement: J }) => ({
910
910
  id: M._id,
911
- amount: R,
911
+ amount: O,
912
912
  measurement: J,
913
913
  remark: D,
914
914
  doc: M,
915
- type: E
915
+ type: H
916
916
  }))
917
917
  }), A("update:show", !1), A("submitted");
918
918
  } catch (M) {
@@ -930,10 +930,10 @@ const je = {
930
930
  label: D.name,
931
931
  sublabel: D.code,
932
932
  value: D._id
933
- })), M = x.filter((D) => w.adjustments.find((E) => E.doc._id === D.value)).map((D) => D.value);
933
+ })), M = x.filter((D) => w.adjustments.find((H) => H.doc._id === D.value)).map((D) => D.value);
934
934
  m.open({
935
935
  title: "Select ingredients",
936
- contentComponent: kt,
936
+ contentComponent: ht,
937
937
  contentComponentProps: {
938
938
  items: x,
939
939
  modelValue: M
@@ -952,10 +952,10 @@ const je = {
952
952
  }
953
953
  }).onPrimary((D) => {
954
954
  w.adjustments = D.map(
955
- (E) => w.adjustments.find((R) => R.doc._id === E) ?? {
955
+ (H) => w.adjustments.find((O) => O.doc._id === H) ?? {
956
956
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
957
- type: oe.enum.PURCHASE,
958
- doc: p.skus.find((R) => R._id === E),
957
+ type: se.enum.PURCHASE,
958
+ doc: p.skus.find((O) => O._id === H),
959
959
  measurement: null,
960
960
  remark: "",
961
961
  amount: ve(1)
@@ -967,7 +967,7 @@ const je = {
967
967
  w.adjustments.splice(x, 1);
968
968
  }
969
969
  return (x, M) => {
970
- const D = j("FmTextarea"), E = j("FmButton"), R = j("FmForm"), J = j("FmSideSheet");
970
+ const D = j("FmTextarea"), H = j("FmButton"), O = j("FmForm"), J = j("FmSideSheet");
971
971
  return S(), z(J, {
972
972
  modelValue: i(B),
973
973
  "onUpdate:modelValue": M[2] || (M[2] = (X) => Ue(B) ? B.value = X : null),
@@ -980,7 +980,7 @@ const je = {
980
980
  ])
981
981
  ]),
982
982
  default: I(() => [
983
- g(R, {
983
+ g(O, {
984
984
  class: "w-full flex flex-col gap-12",
985
985
  ref_key: "formRef",
986
986
  ref: y,
@@ -994,14 +994,14 @@ const je = {
994
994
  }, null, 8, ["label", "modelValue"]),
995
995
  e("div", Sn, [
996
996
  e("div", Fn, _(i(l)("inventory.stock.adjust.adjustedItems")), 1),
997
- g(E, {
997
+ g(H, {
998
998
  "prepend-icon": "add",
999
999
  variant: "tertiary",
1000
1000
  size: "md",
1001
1001
  onClick: n
1002
1002
  })
1003
1003
  ]),
1004
- (S(!0), O(te, null, ie(w.adjustments, (X, T) => (S(), z(kn, {
1004
+ (S(!0), R(te, null, ie(w.adjustments, (X, T) => (S(), z(hn, {
1005
1005
  key: X.id,
1006
1006
  modelValue: w.adjustments[T],
1007
1007
  "onUpdate:modelValue": (L) => w.adjustments[T] = L,
@@ -1013,7 +1013,7 @@ const je = {
1013
1013
  ]),
1014
1014
  "side-sheet-footer": I(() => [
1015
1015
  e("div", wn, [
1016
- g(E, {
1016
+ g(H, {
1017
1017
  label: i(l)("inventory.stock.adjust.adjustButton"),
1018
1018
  loading: C.value,
1019
1019
  onClick: M[1] || (M[1] = (X) => {
@@ -1027,7 +1027,7 @@ const je = {
1027
1027
  }, 8, ["modelValue"]);
1028
1028
  };
1029
1029
  }
1030
- }), An = gt((b, k) => ({
1030
+ }), An = gt((b, h) => ({
1031
1031
  // TODO: remove once latest inventory backend has been push
1032
1032
  async findBillsByBusinessId(c, o, A) {
1033
1033
  const p = `${b.businessesBackendUrl}/${c}/reports/find-many`, m = {
@@ -1036,18 +1036,18 @@ const je = {
1036
1036
  restaurantIds: o,
1037
1037
  ids: A
1038
1038
  };
1039
- return await k.post(p, m);
1039
+ return await h.post(p, m);
1040
1040
  },
1041
1041
  async findBillsById(c) {
1042
1042
  const A = pe().currentLocationDBName, p = `${b.inventoryBackendUrl}/${A}/bill/search`, m = {
1043
1043
  ids: c
1044
1044
  };
1045
- return await k.post(p, m);
1045
+ return await h.post(p, m);
1046
1046
  }
1047
1047
  })), Vn = {
1048
1048
  key: 0,
1049
1049
  class: "flex justify-center items-center h-32"
1050
- }, Cn = { class: "mb-3" }, Bn = { class: "flex flex-col gap-8" }, Mn = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, Dn = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, jn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, In = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Tn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Un = { class: "flex flex-col w-full px-2" }, Hn = { class: "flex gap-2" }, En = /* @__PURE__ */ ce({
1050
+ }, Cn = { class: "mb-3" }, Bn = { class: "flex flex-col gap-8" }, Mn = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, Dn = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, jn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, In = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Tn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Un = { class: "flex flex-col w-full px-2" }, En = { class: "flex gap-2" }, Hn = /* @__PURE__ */ ce({
1051
1051
  __name: "AmendAdjustmentForm",
1052
1052
  props: /* @__PURE__ */ Ye({
1053
1053
  adjustmentId: {}
@@ -1056,12 +1056,12 @@ const je = {
1056
1056
  modelModifiers: {}
1057
1057
  }),
1058
1058
  emits: /* @__PURE__ */ Ye(["refreshHistory"], ["update:modelValue"]),
1059
- setup(b, { emit: k }) {
1060
- const c = b, o = k, A = ye(), p = ut(b, "modelValue"), m = N(!1), v = N(!1), F = N(!1), C = N({
1059
+ setup(b, { emit: h }) {
1060
+ const c = b, o = h, A = ye(), p = ut(b, "modelValue"), m = N(!1), v = N(!1), F = N(!1), C = N({
1061
1061
  _id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
1062
1062
  skus: []
1063
1063
  }), l = N();
1064
- He(async () => {
1064
+ Ee(async () => {
1065
1065
  m.value = !0;
1066
1066
  const n = await A.readSingleAdjustment(c.adjustmentId);
1067
1067
  if (!n) throw new Error("Adjustment not found");
@@ -1073,10 +1073,10 @@ const je = {
1073
1073
  const n = {};
1074
1074
  Object.keys(p.value || {}).forEach((M) => {
1075
1075
  var D;
1076
- Object.keys(((D = p.value) == null ? void 0 : D[M]) || {}).forEach((E) => {
1076
+ Object.keys(((D = p.value) == null ? void 0 : D[M]) || {}).forEach((H) => {
1077
1077
  var J, X;
1078
- const R = (X = (J = p.value) == null ? void 0 : J[M]) == null ? void 0 : X[Number(E)];
1079
- R && B(R.amount) > 0 && (n[M] || (n[M] = []), n[M].push(R));
1078
+ const O = (X = (J = p.value) == null ? void 0 : J[M]) == null ? void 0 : X[Number(H)];
1079
+ O && B(O.amount) > 0 && (n[M] || (n[M] = []), n[M].push(O));
1080
1080
  });
1081
1081
  }), await A.revertWastageAdjustment({
1082
1082
  targetWastageAdjustmentId: c.adjustmentId,
@@ -1086,8 +1086,8 @@ const je = {
1086
1086
  function y(n, r, x) {
1087
1087
  return P({
1088
1088
  get: () => {
1089
- var D, E, R;
1090
- const M = (R = (E = (D = p.value) == null ? void 0 : D[n]) == null ? void 0 : E[r]) == null ? void 0 : R.amount;
1089
+ var D, H, O;
1090
+ const M = (O = (H = (D = p.value) == null ? void 0 : D[n]) == null ? void 0 : H[r]) == null ? void 0 : O.amount;
1091
1091
  return M ? B(M, !0) : 0;
1092
1092
  },
1093
1093
  set: (M) => {
@@ -1095,7 +1095,7 @@ const je = {
1095
1095
  const D = { ...p.value };
1096
1096
  D[n] || (D[n] = {}), D[n][r] = {
1097
1097
  amount: Ce.fromNumber(M),
1098
- type: oe.Enum.WASTAGE,
1098
+ type: se.Enum.WASTAGE,
1099
1099
  measurement: x
1100
1100
  }, p.value = D;
1101
1101
  }
@@ -1112,7 +1112,7 @@ const je = {
1112
1112
  return r === 0 ? "N/A" : (n + r).toString();
1113
1113
  }
1114
1114
  return (n, r) => {
1115
- const x = j("FmIcon"), M = j("FmStepperField"), D = j("FmCard"), E = j("FmForm"), R = j("FmSpacer"), J = j("FmButton"), X = j("FmDialog");
1115
+ const x = j("FmIcon"), M = j("FmStepperField"), D = j("FmCard"), H = j("FmForm"), O = j("FmSpacer"), J = j("FmButton"), X = j("FmDialog");
1116
1116
  return S(), z(X, {
1117
1117
  modelValue: F.value,
1118
1118
  "onUpdate:modelValue": r[4] || (r[4] = (T) => F.value = T),
@@ -1140,8 +1140,8 @@ const je = {
1140
1140
  "dialog-footer": I(() => [
1141
1141
  e("div", Un, [
1142
1142
  r[13] || (r[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
- e("div", Hn, [
1144
- g(R),
1143
+ e("div", En, [
1144
+ g(O),
1145
1145
  g(J, {
1146
1146
  class: "sm:w-full xs:w-full",
1147
1147
  label: "Close",
@@ -1160,7 +1160,7 @@ const je = {
1160
1160
  ])
1161
1161
  ]),
1162
1162
  default: I(() => [
1163
- m.value ? (S(), O("div", Vn)) : (S(), z(E, {
1163
+ m.value ? (S(), R("div", Vn)) : (S(), z(H, {
1164
1164
  key: 1,
1165
1165
  ref_key: "formRef",
1166
1166
  ref: l,
@@ -1179,8 +1179,8 @@ const je = {
1179
1179
  ue(" " + _(i(xt)(i(St)(C.value._id))), 1)
1180
1180
  ]),
1181
1181
  e("div", Bn, [
1182
- (S(!0), O(te, null, ie(C.value.skus, (T, L) => (S(), O(te, { key: L }, [
1183
- (S(!0), O(te, null, ie(T.amounts, (G, Q) => (S(), z(D, {
1182
+ (S(!0), R(te, null, ie(C.value.skus, (T, L) => (S(), R(te, { key: L }, [
1183
+ (S(!0), R(te, null, ie(T.amounts, (G, Q) => (S(), z(D, {
1184
1184
  key: Q,
1185
1185
  variant: "outlined",
1186
1186
  class: "p-2"
@@ -1252,11 +1252,11 @@ const je = {
1252
1252
  bills: { default: () => [] }
1253
1253
  },
1254
1254
  emits: ["refreshHistory"],
1255
- setup(b, { emit: k }) {
1255
+ setup(b, { emit: h }) {
1256
1256
  const c = b, o = N(!1);
1257
1257
  at();
1258
1258
  const A = N(), p = N(null), m = P(() => p.value === null ? "unset" : o.value ? `${p.value}px` : "0px");
1259
- He(() => {
1259
+ Ee(() => {
1260
1260
  var l;
1261
1261
  p.value = ((l = A.value) == null ? void 0 : l.scrollHeight) || 0;
1262
1262
  });
@@ -1331,7 +1331,7 @@ const je = {
1331
1331
  size: "md"
1332
1332
  }, null, 8, ["name"])
1333
1333
  ]),
1334
- (S(!0), O(te, null, ie(v.value, ($, n) => (S(), O("div", {
1334
+ (S(!0), R(te, null, ie(v.value, ($, n) => (S(), R("div", {
1335
1335
  key: n,
1336
1336
  class: "flex flex-row py-1",
1337
1337
  style: { "font-size": "0.8rem" }
@@ -1355,14 +1355,14 @@ const je = {
1355
1355
  transition: "max-height 0.2s ease-out"
1356
1356
  })
1357
1357
  }, [
1358
- C.value.length ? (S(), O("hr", Nn)) : ae("", !0),
1359
- (S(!0), O(te, null, ie(C.value, ($) => (S(), O("div", {
1358
+ C.value.length ? (S(), R("hr", Nn)) : oe("", !0),
1359
+ (S(!0), R(te, null, ie(C.value, ($) => (S(), R("div", {
1360
1360
  key: $.time,
1361
1361
  class: "flex gap-1 w-full"
1362
1362
  }, [
1363
1363
  e("div", Ln, _($.time), 1),
1364
1364
  e("div", zn, [
1365
- (S(!0), O(te, null, ie($.adjustments, (n) => (S(), O("div", {
1365
+ (S(!0), R(te, null, ie($.adjustments, (n) => (S(), R("div", {
1366
1366
  key: n.name,
1367
1367
  class: "flex gap-1"
1368
1368
  }, [
@@ -1387,9 +1387,9 @@ const je = {
1387
1387
  })
1388
1388
  ]),
1389
1389
  _: 2
1390
- }, 1024)) : ae("", !0),
1391
- n.remark ? (S(), O("span", Kn, " # " + _(n.remark), 1)) : ae("", !0),
1392
- n.name === i(oe).Enum.CLOSING ? (S(), O("span", Wn, " Actual Balance: " + _(n.toBalance) + " " + _(n.baseUnit), 1)) : ae("", !0)
1390
+ }, 1024)) : oe("", !0),
1391
+ n.remark ? (S(), R("span", Kn, " # " + _(n.remark), 1)) : oe("", !0),
1392
+ n.name === i(se).Enum.CLOSING ? (S(), R("span", Wn, " Actual Balance: " + _(n.toBalance) + " " + _(n.baseUnit), 1)) : oe("", !0)
1393
1393
  ]),
1394
1394
  e("div", {
1395
1395
  class: ge({
@@ -1398,12 +1398,12 @@ const je = {
1398
1398
  "ml-auto": !0
1399
1399
  })
1400
1400
  }, _(n.amount), 3),
1401
- n.name === i(oe).Enum.WASTAGE ? (S(), z(En, {
1401
+ n.name === i(se).Enum.WASTAGE ? (S(), z(Hn, {
1402
1402
  key: 0,
1403
1403
  adjustmentId: n.adjustmentId,
1404
1404
  onRefreshHistory: s[1] || (s[1] = (r) => l.$emit("refreshHistory"))
1405
- }, null, 8, ["adjustmentId"])) : ae("", !0),
1406
- n.cost ? (S(), O("div", qn, " (" + _(i(he)(n.cost, !1, n.cost.precision)) + ") ", 1)) : ae("", !0)
1405
+ }, null, 8, ["adjustmentId"])) : oe("", !0),
1406
+ n.cost ? (S(), R("div", qn, " (" + _(i(ke)(n.cost, !1, n.cost.precision)) + ") ", 1)) : oe("", !0)
1407
1407
  ]))), 128))
1408
1408
  ])
1409
1409
  ]))), 128))
@@ -1415,20 +1415,20 @@ const je = {
1415
1415
  };
1416
1416
  }
1417
1417
  });
1418
- function Jn(b, k) {
1418
+ function Jn(b, h) {
1419
1419
  var p;
1420
- const c = Object.keys(oe.enum).reduce(
1420
+ const c = Object.keys(se.enum).reduce(
1421
1421
  (m, v) => (m[v] = { amount: 0, precision: 0 }, m),
1422
1422
  {}
1423
1423
  );
1424
- if (!k)
1424
+ if (!h)
1425
1425
  return Object.entries(c).reduce(
1426
1426
  (m, [v]) => (m[v] = q.fromNumber(0), m),
1427
1427
  {}
1428
1428
  );
1429
1429
  const A = b.flatMap((m) => {
1430
1430
  var v;
1431
- return ((v = m.skus) == null ? void 0 : v.filter((F) => F.sku._id === k._id)) ?? [];
1431
+ return ((v = m.skus) == null ? void 0 : v.filter((F) => F.sku._id === h._id)) ?? [];
1432
1432
  }).flatMap((m) => m.amounts);
1433
1433
  for (const m of A) {
1434
1434
  const v = m.measurement ? q.multiply([m.measurement.conversion, m.amount]) : m.amount;
@@ -1444,18 +1444,18 @@ function Jn(b, k) {
1444
1444
  `${q.toFormatString({
1445
1445
  value: C,
1446
1446
  precision: 4
1447
- })} ${k.unit.abbrev}`, m;
1447
+ })} ${h.unit.abbrev}`, m;
1448
1448
  },
1449
1449
  {}
1450
1450
  );
1451
1451
  }
1452
- function Qn(b, k) {
1453
- if (!k)
1452
+ function Qn(b, h) {
1453
+ if (!h)
1454
1454
  return null;
1455
1455
  let c = null;
1456
1456
  const A = b.flatMap((p) => {
1457
1457
  var m;
1458
- return ((m = p.skus) == null ? void 0 : m.filter((v) => v.sku._id === k._id)) ?? [];
1458
+ return ((m = p.skus) == null ? void 0 : m.filter((v) => v.sku._id === h._id)) ?? [];
1459
1459
  }).flatMap((p) => {
1460
1460
  var m;
1461
1461
  return !p.history || ((m = p.history) == null ? void 0 : m.length) === 0 ? [] : p.history[0];
@@ -1463,7 +1463,7 @@ function Qn(b, k) {
1463
1463
  for (const p of A) {
1464
1464
  const m = p.amounts;
1465
1465
  for (const v of m) {
1466
- if (v.type !== oe.Enum.SALES)
1466
+ if (v.type !== se.Enum.SALES)
1467
1467
  continue;
1468
1468
  const F = v.measurement ? q.multiply([v.measurement.conversion, v.amount]) : v.amount;
1469
1469
  c ?? (c = q.fromNumber(0)), c = q.add([c, F]);
@@ -1472,7 +1472,7 @@ function Qn(b, k) {
1472
1472
  return c != null ? (c.amount = Math.abs(c.amount), `${q.toFormatString({
1473
1473
  value: c,
1474
1474
  precision: 4
1475
- })} ${k.unit.abbrev}`) : null;
1475
+ })} ${h.unit.abbrev}`) : null;
1476
1476
  }
1477
1477
  const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = { class: "flex-1 line-clamp-2" }, to = { class: "flex flex-col gap-32 w-full h-full" }, no = { class: "flex items-center relative gap-4" }, oo = { class: "flex-1" }, so = {
1478
1478
  key: 0,
@@ -1483,7 +1483,7 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1483
1483
  }, ro = { class: "pb-16" }, io = { class: "fm-typo-cn-body-lg-600" }, uo = {
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
- }, co = { class: "flex flex-col gap-1" }, mo = { class: "text-fm-color-typo-secondary" }, po = { class: "font-bold" }, fo = { class: "flex flex-col gap-1" }, vo = { class: "text-fm-color-typo-secondary flex" }, yo = { class: "font-bold" }, _o = { class: "flex flex-col gap-1" }, bo = { class: "text-fm-color-typo-secondary" }, ho = { class: "font-bold" }, ko = { class: "flex flex-col gap-1" }, go = { class: "text-fm-color-typo-secondary" }, xo = { class: "font-bold" }, So = { class: "flex flex-col gap-1" }, Fo = { class: "text-fm-color-typo-secondary" }, wo = { class: "font-bold" }, $o = { class: "flex flex-col gap-1" }, Ao = { class: "text-fm-color-typo-secondary" }, Vo = { class: "font-bold" }, Co = { class: "flex flex-col gap-1" }, Bo = { class: "text-fm-color-typo-secondary" }, Mo = { class: "font-bold" }, Do = { class: "flex flex-col gap-1" }, jo = { class: "text-fm-color-typo-secondary" }, Io = { class: "font-bold" }, To = { class: "flex flex-col gap-1" }, Uo = { class: "text-fm-color-typo-secondary" }, Ho = { class: "font-bold" }, Eo = {
1486
+ }, co = { class: "flex flex-col gap-1" }, mo = { class: "text-fm-color-typo-secondary" }, po = { class: "font-bold" }, fo = { class: "flex flex-col gap-1" }, vo = { class: "text-fm-color-typo-secondary flex" }, yo = { class: "font-bold" }, _o = { class: "flex flex-col gap-1" }, bo = { class: "text-fm-color-typo-secondary" }, ko = { class: "font-bold" }, ho = { class: "flex flex-col gap-1" }, go = { class: "text-fm-color-typo-secondary" }, xo = { class: "font-bold" }, So = { class: "flex flex-col gap-1" }, Fo = { class: "text-fm-color-typo-secondary" }, wo = { class: "font-bold" }, $o = { class: "flex flex-col gap-1" }, Ao = { class: "text-fm-color-typo-secondary" }, Vo = { class: "font-bold" }, Co = { class: "flex flex-col gap-1" }, Bo = { class: "text-fm-color-typo-secondary" }, Mo = { class: "font-bold" }, Do = { class: "flex flex-col gap-1" }, jo = { class: "text-fm-color-typo-secondary" }, Io = { class: "font-bold" }, To = { class: "flex flex-col gap-1" }, Uo = { class: "text-fm-color-typo-secondary" }, Eo = { class: "font-bold" }, Ho = {
1487
1487
  key: 0,
1488
1488
  class: "flex flex-col gap-8"
1489
1489
  }, Po = { class: "flex" }, Ro = { class: "flex-1 flex flex-col gap-1" }, Oo = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, No = { class: "font-bold" }, Lo = { class: "flex-1 flex flex-col gap-1" }, zo = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Yo = { class: "flex flex-col gap-1" }, Go = { class: "font-bold" }, Ko = {
@@ -1497,7 +1497,7 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1497
1497
  },
1498
1498
  emits: ["update:show"],
1499
1499
  setup(b) {
1500
- const k = at(), c = Re(), o = ye(), A = An(), p = pe(), m = Ct(), { t: v } = de(), F = b, C = N(!1), l = _e(), s = N($t(0));
1500
+ const h = at(), c = Re(), o = ye(), A = An(), p = pe(), m = Ct(), { t: v } = de(), F = b, C = N(!1), l = _e(), s = N($t(0));
1501
1501
  async function y() {
1502
1502
  C.value = !0;
1503
1503
  try {
@@ -1512,7 +1512,7 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1512
1512
  C.value = !1;
1513
1513
  }
1514
1514
  }
1515
- He(() => {
1515
+ Ee(() => {
1516
1516
  y();
1517
1517
  }), xe([() => s.value, () => F.sku], () => {
1518
1518
  y();
@@ -1527,8 +1527,8 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1527
1527
  const V = f.effectiveAt ?? ot(f._id);
1528
1528
  if (!V)
1529
1529
  return u;
1530
- const H = n(new Date(V), a);
1531
- return u[H] ?? (u[H] = []), u[H].push(f), u;
1530
+ const E = n(new Date(V), a);
1531
+ return u[E] ?? (u[E] = []), u[E].push(f), u;
1532
1532
  },
1533
1533
  {}
1534
1534
  );
@@ -1555,20 +1555,20 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1555
1555
  t.length && ($.value = await A.findBillsById(t).catch((a) => {
1556
1556
  var f;
1557
1557
  console.error("Error on using latest bill API, retrying using legacy api", a);
1558
- const d = ((f = k.currentBusiness.value) == null ? void 0 : f._id) ?? "", u = p.currentLocation.doc._id;
1558
+ const d = ((f = h.currentBusiness.value) == null ? void 0 : f._id) ?? "", u = p.currentLocation.doc._id;
1559
1559
  return A.findBillsByBusinessId(d, [u], t);
1560
1560
  }));
1561
1561
  }
1562
1562
  const D = P(() => {
1563
1563
  const t = B.value, a = F.sku;
1564
1564
  return Jn(t, a);
1565
- }), E = P(() => {
1565
+ }), H = P(() => {
1566
1566
  const t = B.value, a = F.sku;
1567
1567
  return Qn(t, a);
1568
- }), R = P(() => {
1568
+ }), O = P(() => {
1569
1569
  const t = [...B.value].computeFirst((d) => {
1570
1570
  var f, V;
1571
- const u = (V = (f = d.skus) == null ? void 0 : f.find) == null ? void 0 : V.call(f, (H) => H.sku._id === F.sku._id);
1571
+ const u = (V = (f = d.skus) == null ? void 0 : f.find) == null ? void 0 : V.call(f, (E) => E.sku._id === F.sku._id);
1572
1572
  return u == null ? void 0 : u.fromBalance;
1573
1573
  }) ?? {
1574
1574
  amount: 0,
@@ -1581,7 +1581,7 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1581
1581
  }), J = P(() => {
1582
1582
  const t = [...B.value].reverse().computeFirst((d) => {
1583
1583
  var f, V;
1584
- const u = (V = (f = d.skus) == null ? void 0 : f.find) == null ? void 0 : V.call(f, (H) => H.sku._id === F.sku._id);
1584
+ const u = (V = (f = d.skus) == null ? void 0 : f.find) == null ? void 0 : V.call(f, (E) => E.sku._id === F.sku._id);
1585
1585
  return u == null ? void 0 : u.toBalance;
1586
1586
  }) ?? {
1587
1587
  amount: 0,
@@ -1597,22 +1597,22 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1597
1597
  (u, f) => {
1598
1598
  const V = f.cost;
1599
1599
  if (!V) return u;
1600
- const H = {
1600
+ const E = {
1601
1601
  ...At(u, Math.max(u.precision, V.precision)),
1602
1602
  currency: V.currency
1603
1603
  };
1604
1604
  return {
1605
- ...et(H, V),
1605
+ ...et(E, V),
1606
1606
  currency: u.currency
1607
1607
  };
1608
1608
  },
1609
1609
  {
1610
1610
  amount: 0,
1611
1611
  precision: 0,
1612
- currency: Be((d = k.currentCountry) == null ? void 0 : d.value)
1612
+ currency: Be((d = h.currentCountry) == null ? void 0 : d.value)
1613
1613
  }
1614
1614
  );
1615
- return he(a, !1, a.precision);
1615
+ return ke(a, !1, a.precision);
1616
1616
  });
1617
1617
  function T() {
1618
1618
  const { startDate: t, endDate: a } = Dt(s.value);
@@ -1622,25 +1622,25 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1622
1622
  });
1623
1623
  }
1624
1624
  const L = P(() => F.sku.valuation === We.Enum.FIFO ? v("inventory.ingredient.valuationMethod.FIFO") : v("inventory.ingredient.valuationMethod.WAVG")), G = P(() => {
1625
- var H, K, se, U;
1625
+ var E, K, ae, U;
1626
1626
  const t = [...B.value].reverse().computeFirst((Y) => {
1627
1627
  var W, Z;
1628
1628
  return (Z = (W = Y.skus) == null ? void 0 : W.find) == null ? void 0 : Z.call(W, (le) => le.sku._id === F.sku._id);
1629
1629
  });
1630
1630
  if (!t) return "No data";
1631
1631
  const a = [...t.amounts].reverse()[0], d = {
1632
- amount: ((H = a.cost) == null ? void 0 : H.amount) ?? 0,
1632
+ amount: ((E = a.cost) == null ? void 0 : E.amount) ?? 0,
1633
1633
  precision: ((K = a.cost) == null ? void 0 : K.precision) ?? 0
1634
1634
  }, u = a.amount, f = u.amount == 0 ? q.fromNumber(0) : q.divide([d, u]);
1635
1635
  return {
1636
1636
  ...q.multiply([f, u]),
1637
- currency: ((se = a.cost) == null ? void 0 : se.currency) || Be(((U = k.currentCountry) == null ? void 0 : U.value) ?? Vt)
1637
+ currency: ((ae = a.cost) == null ? void 0 : ae.currency) || Be(((U = h.currentCountry) == null ? void 0 : U.value) ?? Vt)
1638
1638
  };
1639
1639
  }), Q = P(() => {
1640
1640
  var d;
1641
1641
  const t = [...B.value].reverse().computeFirst((u) => {
1642
- var V, H;
1643
- const f = (H = (V = u.skus) == null ? void 0 : V.find) == null ? void 0 : H.call(V, (K) => K.sku._id === F.sku._id);
1642
+ var V, E;
1643
+ const f = (E = (V = u.skus) == null ? void 0 : V.find) == null ? void 0 : E.call(V, (K) => K.sku._id === F.sku._id);
1644
1644
  return f == null ? void 0 : f.toCostBalances;
1645
1645
  });
1646
1646
  return t ? {
@@ -1648,7 +1648,7 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1648
1648
  amount: 0,
1649
1649
  precision: 0
1650
1650
  }),
1651
- currency: Be((d = k.currentCountry) == null ? void 0 : d.value)
1651
+ currency: Be((d = h.currentCountry) == null ? void 0 : d.value)
1652
1652
  } : "No data";
1653
1653
  });
1654
1654
  function ne() {
@@ -1658,13 +1658,13 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1658
1658
  endDate: a
1659
1659
  });
1660
1660
  }
1661
- const h = Ne(F, "show");
1661
+ const k = Ne(F, "show");
1662
1662
  return (t, a) => {
1663
- const d = j("FmButton"), u = j("FmField"), f = j("FmDateRangePicker"), V = j("FmSpacer"), H = j("FmCircularProgress"), K = j("FmIcon"), se = j("FmTooltip"), U = j("FmMenuDivider"), Y = j("FmChip"), W = j("FmCardSection"), Z = j("FmCard"), le = j("FmSideSheet");
1663
+ const d = j("FmButton"), u = j("FmField"), f = j("FmDateRangePicker"), V = j("FmSpacer"), E = j("FmCircularProgress"), K = j("FmIcon"), ae = j("FmTooltip"), U = j("FmMenuDivider"), Y = j("FmChip"), W = j("FmCardSection"), Z = j("FmCard"), le = j("FmSideSheet");
1664
1664
  return S(), z(le, {
1665
1665
  "dismiss-away": "",
1666
- modelValue: i(h),
1667
- "onUpdate:modelValue": a[4] || (a[4] = (ee) => Ue(h) ? h.value = ee : null),
1666
+ modelValue: i(k),
1667
+ "onUpdate:modelValue": a[4] || (a[4] = (ee) => Ue(k) ? k.value = ee : null),
1668
1668
  "close-button": !1,
1669
1669
  "max-width": 560
1670
1670
  }, {
@@ -1674,7 +1674,7 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1674
1674
  g(d, {
1675
1675
  variant: "tertiary",
1676
1676
  "prepend-icon": "close",
1677
- onClick: a[0] || (a[0] = (ee) => h.value = !1)
1677
+ onClick: a[0] || (a[0] = (ee) => k.value = !1)
1678
1678
  })
1679
1679
  ])
1680
1680
  ]),
@@ -1717,13 +1717,13 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1717
1717
  "prepend-icon": "navigate_next"
1718
1718
  })
1719
1719
  ]),
1720
- C.value ? (S(), O("div", so, [
1720
+ C.value ? (S(), R("div", so, [
1721
1721
  g(V),
1722
- g(H, { size: "xl" }),
1722
+ g(E, { size: "xl" }),
1723
1723
  e("div", ao, _(i(v)("inventory.stock.history.loading")), 1),
1724
1724
  g(V),
1725
1725
  g(V)
1726
- ])) : w.value && ((ee = w.value) == null ? void 0 : ee.length) > 0 ? (S(), O("div", lo, [
1726
+ ])) : w.value && ((ee = w.value) == null ? void 0 : ee.length) > 0 ? (S(), R("div", lo, [
1727
1727
  g(Z, { variant: "outlined" }, {
1728
1728
  default: I(() => [
1729
1729
  g(W, { class: "flex flex-col gap-4" }, {
@@ -1739,11 +1739,11 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1739
1739
  e("div", fo, [
1740
1740
  e("div", vo, [
1741
1741
  ue(_(i(v)("inventory.stock.history.summary.totalSales")) + "  ", 1),
1742
- E.value != null ? (S(), z(se, {
1742
+ H.value != null ? (S(), z(ae, {
1743
1743
  key: 0,
1744
1744
  variant: "plain",
1745
1745
  placement: "top",
1746
- content: `Before: ${E.value}`,
1746
+ content: `Before: ${H.value}`,
1747
1747
  "z-index": 50
1748
1748
  }, {
1749
1749
  default: I(() => [
@@ -1753,15 +1753,15 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1753
1753
  })
1754
1754
  ]),
1755
1755
  _: 1
1756
- }, 8, ["content"])) : ae("", !0)
1756
+ }, 8, ["content"])) : oe("", !0)
1757
1757
  ]),
1758
1758
  e("div", yo, _(D.value.SALES), 1)
1759
1759
  ]),
1760
1760
  e("div", _o, [
1761
1761
  e("div", bo, _(i(v)("inventory.stock.history.summary.totalLose")), 1),
1762
- e("div", ho, _(D.value.LOSE), 1)
1762
+ e("div", ko, _(D.value.LOSE), 1)
1763
1763
  ]),
1764
- e("div", ko, [
1764
+ e("div", ho, [
1765
1765
  e("div", go, _(i(v)("inventory.stock.history.summary.totalRequest")), 1),
1766
1766
  e("div", xo, _(D.value.REQUEST), 1)
1767
1767
  ]),
@@ -1779,14 +1779,14 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1779
1779
  ]),
1780
1780
  e("div", Do, [
1781
1781
  e("div", jo, _(i(v)("inventory.stock.history.summary.openingBalance")), 1),
1782
- e("div", Io, _(R.value), 1)
1782
+ e("div", Io, _(O.value), 1)
1783
1783
  ]),
1784
1784
  e("div", To, [
1785
1785
  e("div", Uo, _(i(v)("inventory.stock.history.summary.lastStockBalance")), 1),
1786
- e("div", Ho, _(J.value), 1)
1786
+ e("div", Eo, _(J.value), 1)
1787
1787
  ])
1788
1788
  ]),
1789
- i(m).enableTotalCost ? (S(), O("div", Eo, [
1789
+ i(m).enableTotalCost ? (S(), R("div", Ho, [
1790
1790
  g(U, { class: "w-full" }),
1791
1791
  e("div", Po, [
1792
1792
  e("div", Ro, [
@@ -1794,7 +1794,7 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1794
1794
  default: I(() => [
1795
1795
  e("div", Oo, [
1796
1796
  ue(_(i(v)("inventory.stock.history.estimatedValue")) + " ", 1),
1797
- g(se, {
1797
+ g(ae, {
1798
1798
  variant: "plain",
1799
1799
  placement: "top",
1800
1800
  content: `[${L.value}] ${i(v)("inventory.stock.history.estimatedValueTooltip")}`,
@@ -1813,18 +1813,18 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1813
1813
  _: 1
1814
1814
  }),
1815
1815
  e("div", No, [
1816
- t.sku.valuation === i(We).Enum.FIFO ? (S(), O(te, { key: 0 }, [
1816
+ t.sku.valuation === i(We).Enum.FIFO ? (S(), R(te, { key: 0 }, [
1817
1817
  g(Y, {
1818
1818
  label: "FIFO",
1819
1819
  compact: ""
1820
1820
  }),
1821
- ue(" " + _(typeof Q.value != "string" ? i(he)(
1821
+ ue(" " + _(typeof Q.value != "string" ? i(ke)(
1822
1822
  Q.value,
1823
1823
  !1,
1824
1824
  Q.value.precision
1825
1825
  ) : Q.value), 1)
1826
- ], 64)) : (S(), O(te, { key: 1 }, [
1827
- ue(_(typeof G.value != "string" ? i(he)(
1826
+ ], 64)) : (S(), R(te, { key: 1 }, [
1827
+ ue(_(typeof G.value != "string" ? i(ke)(
1828
1828
  G.value,
1829
1829
  !1,
1830
1830
  G.value.precision
@@ -1837,7 +1837,7 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1837
1837
  default: I(() => [
1838
1838
  e("div", zo, [
1839
1839
  ue(_(i(v)("inventory.stock.history.costSold")) + " ", 1),
1840
- g(se, {
1840
+ g(ae, {
1841
1841
  variant: "plain",
1842
1842
  placement: "top",
1843
1843
  "z-index": 50
@@ -1860,7 +1860,7 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1860
1860
  e("div", Go, _(X.value), 1)
1861
1861
  ])
1862
1862
  ])
1863
- ])) : ae("", !0)
1863
+ ])) : oe("", !0)
1864
1864
  ]),
1865
1865
  _: 1
1866
1866
  })
@@ -1868,7 +1868,7 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1868
1868
  _: 1
1869
1869
  }),
1870
1870
  a[5] || (a[5] = e("div", null, null, -1)),
1871
- (S(!0), O(te, null, ie(w.value, (re) => (S(), O(te, {
1871
+ (S(!0), R(te, null, ie(w.value, (re) => (S(), R(te, {
1872
1872
  key: re.date
1873
1873
  }, [
1874
1874
  t.sku ? (S(), z(Xn, {
@@ -1877,9 +1877,9 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1877
1877
  sku: t.sku,
1878
1878
  bills: $.value,
1879
1879
  onRefreshHistory: y
1880
- }, null, 8, ["record", "sku", "bills"])) : ae("", !0)
1880
+ }, null, 8, ["record", "sku", "bills"])) : oe("", !0)
1881
1881
  ], 64))), 128))
1882
- ])) : (S(), O("div", Ko, [
1882
+ ])) : (S(), R("div", Ko, [
1883
1883
  g(V),
1884
1884
  e("div", null, [
1885
1885
  e("img", {
@@ -1899,25 +1899,28 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1899
1899
  }, 8, ["modelValue"]);
1900
1900
  };
1901
1901
  }
1902
- }), Qo = { class: "flex items-center gap-1" }, Zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, es = { class: "flex flex-col gap-8" }, ts = { class: "flex flex-col" }, ns = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, os = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, hs = /* @__PURE__ */ ce({
1902
+ }), Qo = {
1903
+ key: 0,
1904
+ class: "flex items-center gap-1"
1905
+ }, Zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, es = { class: "flex flex-col gap-8" }, ts = { class: "flex flex-col" }, ns = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, os = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ks = /* @__PURE__ */ ce({
1903
1906
  __name: "StockView",
1904
1907
  setup(b) {
1905
- const { t: k } = de(), c = Pe(), o = pe(), A = Re(), p = rt(), m = ye(), v = nt(), F = Tt(), { columnDefs: C } = tn(), l = Oe();
1908
+ const { t: h } = de(), c = Pe(), o = pe(), A = Re(), p = rt(), m = ye(), v = nt(), F = Tt(), { columnDefs: C } = tn(), l = Oe();
1906
1909
  o.watchLocation($);
1907
1910
  const s = P(
1908
1911
  () => new Set(F.getAvailableItems(F.businessSubsidiaryId))
1909
1912
  ), y = N(!1), B = _e();
1910
1913
  async function w() {
1911
1914
  l.open({
1912
- title: k("inventory.stock.stock_balance.refreshBalance"),
1913
- message: k("inventory.stock.stock_balance.refreshBalanceDescription"),
1915
+ title: h("inventory.stock.stock_balance.refreshBalance"),
1916
+ message: h("inventory.stock.stock_balance.refreshBalanceDescription"),
1914
1917
  closeButton: !0,
1915
1918
  primaryActions: {
1916
- text: k("common.confirm"),
1919
+ text: h("common.confirm"),
1917
1920
  close: !0
1918
1921
  },
1919
1922
  secondaryActions: {
1920
- text: k("common.close"),
1923
+ text: h("common.close"),
1921
1924
  close: !0,
1922
1925
  variant: "tertiary"
1923
1926
  }
@@ -1936,8 +1939,8 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1936
1939
  await A.readStockBalance(), await A.readProductBalance(), await v.readStockEstimateBalance();
1937
1940
  } catch (T) {
1938
1941
  B.open({
1939
- title: k("inventory.stock.error.title"),
1940
- message: k("inventory.stock.error.message"),
1942
+ title: h("inventory.stock.error.title"),
1943
+ message: h("inventory.stock.error.message"),
1941
1944
  type: "error"
1942
1945
  }), console.error("error on fetch stock balance", T);
1943
1946
  } finally {
@@ -1965,19 +1968,19 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1965
1968
  trackingUnitAbbrev: G ? ((d = L.unit.measurements.find((u) => u.id === G)) == null ? void 0 : d.abbrev) ?? "" : L.unit.abbrev
1966
1969
  };
1967
1970
  });
1968
- }), r = N(""), x = N(!0), { breakpoints: M } = Lt(), D = P(() => M.value.xs || M.value.sm), E = P(() => D.value ? 10 : 20), R = Ut(), J = P(() => [
1971
+ }), r = N(""), x = N(!0), { breakpoints: M } = Lt(), D = P(() => M.value.xs || M.value.sm), H = P(() => D.value ? 10 : 20), O = Ut(), J = P(() => [
1969
1972
  {
1970
- label: k("inventory.stock.stock_balance.refreshBalance"),
1973
+ label: h("inventory.stock.stock_balance.refreshBalance"),
1971
1974
  value: "refresh-balance",
1972
1975
  isPrimary: !0,
1973
1976
  prependIcon: "calculate"
1974
1977
  },
1975
1978
  {
1976
- label: k("inventory.common.refresh"),
1979
+ label: h("inventory.common.refresh"),
1977
1980
  value: "refresh"
1978
1981
  },
1979
1982
  {
1980
- label: k("inventory.common.export"),
1983
+ label: h("inventory.common.export"),
1981
1984
  value: "export"
1982
1985
  }
1983
1986
  ]);
@@ -1993,13 +1996,13 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
1993
1996
  }
1994
1997
  return (T, L) => {
1995
1998
  const G = j("FmSwitch"), Q = j("FmTable");
1996
- return S(), z(Ht, {
1997
- title: i(k)("inventory.stock.title"),
1999
+ return S(), z(Et, {
2000
+ title: i(h)("inventory.stock.title"),
1998
2001
  actions: J.value,
1999
2002
  "onClick:action": X
2000
2003
  }, {
2001
2004
  default: I(() => {
2002
- var ne, h, t, a;
2005
+ var ne, k, t, a;
2003
2006
  return [
2004
2007
  e("div", {
2005
2008
  class: ge([
@@ -2010,33 +2013,33 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
2010
2013
  }
2011
2014
  ])
2012
2015
  }, [
2013
- g(Et, {
2016
+ g(Ht, {
2014
2017
  searchable: "",
2015
2018
  "change-location": "",
2016
2019
  search: r.value,
2017
2020
  "onUpdate:search": L[1] || (L[1] = (d) => r.value = d)
2018
2021
  }, {
2019
2022
  default: I(() => [
2020
- e("div", Qo, [
2021
- e("span", Zo, _(i(k)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
2023
+ i(F).isEnabled ? (S(), R("div", Qo, [
2024
+ e("span", Zo, _(i(h)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
2022
2025
  g(Ot),
2023
2026
  g(G, {
2024
2027
  modelValue: x.value,
2025
2028
  "onUpdate:modelValue": L[0] || (L[0] = (d) => x.value = d)
2026
2029
  }, null, 8, ["modelValue"])
2027
- ])
2030
+ ])) : oe("", !0)
2028
2031
  ]),
2029
2032
  _: 1
2030
2033
  }, 8, ["search"]),
2031
2034
  (S(), z(Q, {
2032
- style: Ze(i(R).tableHeight),
2035
+ style: Ze(i(O).tableHeight),
2033
2036
  "column-defs": i(C),
2034
2037
  "row-data": n.value,
2035
2038
  "search-value": r.value,
2036
2039
  loading: y.value || !i(o)._currentLocation,
2037
2040
  key: (ne = i(o)._currentLocation) == null ? void 0 : ne.dbName,
2038
2041
  onRowClick: L[2] || (L[2] = (d) => i(p).showSkuHistory(d.original)),
2039
- "page-size": E.value
2042
+ "page-size": H.value
2040
2043
  }, {
2041
2044
  "list-row": I((d) => [
2042
2045
  g(Pt, {
@@ -2044,14 +2047,14 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
2044
2047
  onRowClick: i(p).showSkuHistory
2045
2048
  }, {
2046
2049
  default: I((u) => {
2047
- var f, V, H, K, se, U, Y, W, Z, le;
2050
+ var f, V, E, K, ae, U, Y, W, Z, le;
2048
2051
  return [
2049
2052
  e("div", es, [
2050
2053
  e("div", ts, [
2051
2054
  e("div", ns, [
2052
2055
  g(i(qe), {
2053
- render: (H = (V = (f = u.code) == null ? void 0 : f.column) == null ? void 0 : V.columnDef) == null ? void 0 : H.cell,
2054
- props: (se = (K = u.code) == null ? void 0 : K.getContext) == null ? void 0 : se.call(K)
2056
+ render: (E = (V = (f = u.code) == null ? void 0 : f.column) == null ? void 0 : V.columnDef) == null ? void 0 : E.cell,
2057
+ props: (ae = (K = u.code) == null ? void 0 : K.getContext) == null ? void 0 : ae.call(K)
2055
2058
  }, null, 8, ["render", "props"])
2056
2059
  ]),
2057
2060
  e("div", os, [
@@ -2085,9 +2088,9 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
2085
2088
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
2086
2089
  ], 2),
2087
2090
  (S(), z(ct, { to: "body" }, [
2088
- (h = i(p).stockHistoryProps) != null && h.sku ? (S(), z(Jo, Ae(Ve({ key: 0 }, i(p).stockHistoryProps)), null, 16)) : ae("", !0),
2089
- (t = i(p).convertSkuDialogProps) != null && t.sku ? (S(), z(_n, Ae(Ve({ key: 1 }, i(p).convertSkuDialogProps)), null, 16)) : ae("", !0),
2090
- (a = i(p).adjustSkuDialogProps) != null && a.stock ? (S(), z($n, Ae(Ve({ key: 2 }, i(p).adjustSkuDialogProps)), null, 16)) : ae("", !0)
2091
+ (k = i(p).stockHistoryProps) != null && k.sku ? (S(), z(Jo, Ae(Ve({ key: 0 }, i(p).stockHistoryProps)), null, 16)) : oe("", !0),
2092
+ (t = i(p).convertSkuDialogProps) != null && t.sku ? (S(), z(_n, Ae(Ve({ key: 1 }, i(p).convertSkuDialogProps)), null, 16)) : oe("", !0),
2093
+ (a = i(p).adjustSkuDialogProps) != null && a.stock ? (S(), z($n, Ae(Ve({ key: 2 }, i(p).adjustSkuDialogProps)), null, 16)) : oe("", !0)
2091
2094
  ]))
2092
2095
  ];
2093
2096
  }),
@@ -2097,5 +2100,5 @@ const Zn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, eo = {
2097
2100
  }
2098
2101
  });
2099
2102
  export {
2100
- hs as default
2103
+ ks as default
2101
2104
  };