@feedmepos/mf-inventory-portal 1.2.12-dev.3 → 1.2.13

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 (74) hide show
  1. package/dist/{App-D5hXQpVn.js → App-ZoXow3DD.js} +40 -44
  2. package/dist/{ApprovalView-B__WDklZ.js → ApprovalView-BWX6xBQs.js} +30 -30
  3. package/dist/{BindingsDialog-DXdwRSnn.js → BindingsDialog-CuwkcDKX.js} +2 -2
  4. package/dist/{BindingsPicker-CqAD3aHc.js → BindingsPicker-BibFsY0g.js} +1 -1
  5. package/dist/{BindingsTable-DVNjpusl.js → BindingsTable-AdjKwSPH.js} +1 -1
  6. package/dist/{ClosingDraftView-DL678GBB.js → ClosingDraftView-DWFHP9nE.js} +129 -129
  7. package/dist/{ClosingTemplateView-DThiXLtp.js → ClosingTemplateView-DOCF5f_u.js} +28 -28
  8. package/dist/{DeliveryOrderPrintPreview-B2MB9S6a.js → DeliveryOrderPrintPreview-DNDtL_Vo.js} +1 -1
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BNxs6Bcr.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BWhINOE8.js} +3 -3
  10. package/dist/{FmMultiselectDialog-B45ZLjVp.js → FmMultiselectDialog-Dfo04ak5.js} +1 -1
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-D8ks6AEM.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DGVs4zLl.js} +45 -45
  12. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-C5zIvG2h.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BESx2u4Y.js} +1 -1
  13. package/dist/{IngredientGroupView-D95dFXIZ.js → IngredientGroupView-M9sXlnE0.js} +32 -31
  14. package/dist/IngredientsView-DUwhH3j1.js +2475 -0
  15. package/dist/{IntegrationView-9m3N_9lW.js → IntegrationView-BlUNz1yc.js} +57 -57
  16. package/dist/{InventoryBindingForm-kLoQskao.js → InventoryBindingForm-CvQ5zh6v.js} +1 -1
  17. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BytErBcK.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BEAEmPsU.js} +31 -31
  18. package/dist/{InventoryBindingSummary-Dg0FH7ad.js → InventoryBindingSummary-CsJ-6G2P.js} +1 -1
  19. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BKrUNLuG.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DjN_ktl1.js} +1 -1
  20. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BL1f817e.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BN_e7k7U.js} +1 -1
  21. package/dist/{PublishView-BcOHSAj3.js → PublishView-DZgCyLK2.js} +15 -15
  22. package/dist/{PurchaseOrderPrintPreview-UfF8RVkv.js → PurchaseOrderPrintPreview-CB2xvQ33.js} +1 -1
  23. package/dist/{ReceiveRequestView-D_y_xNUb.js → ReceiveRequestView-DgDHOS-Y.js} +63 -62
  24. package/dist/RecipeView-DQDfwCJd.js +621 -0
  25. package/dist/{StockView-ciU6aAV7.js → StockView-eJOngk08.js} +166 -165
  26. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-XwDTGpR-.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BMFfegsk.js} +1 -1
  27. package/dist/{SupplierView-DFwtALPg.js → SupplierView-BS8rBAKC.js} +492 -490
  28. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-w98ibfql.js +3060 -0
  29. package/dist/{TransferTemplateView-BXr_GqTi.js → TransferTemplateView-By5Ci4Yg.js} +48 -48
  30. package/dist/UnitView-DmuWMFlA.js +667 -0
  31. package/dist/{WarehouseView-BYd0bPhi.js → WarehouseView-4ZLSJXYc.js} +32 -32
  32. package/dist/api/inventory.d.ts +0 -306
  33. package/dist/api/purchase-order.d.ts +0 -1
  34. package/dist/{app-Bb0-8bRg.js → app-D2lun71R.js} +11108 -11723
  35. package/dist/app.d.ts +0 -421
  36. package/dist/app.js +1 -1
  37. package/dist/array-Ca8T3f_G.js +44 -0
  38. package/dist/{closing-template-DPVNEyI7.js → closing-template-Cm1TtVzm.js} +1 -1
  39. package/dist/{decimal-BdBZYISm.js → decimal-eeicE4jp.js} +1 -1
  40. package/dist/{format-unit-display-DlmCwWo_.js → format-unit-display-vHKazw0l.js} +25 -25
  41. package/dist/helper/number.d.ts +0 -1
  42. package/dist/{index-CqBKFj1B.js → index-C5s-1g7c.js} +1 -1
  43. package/dist/{index-CKFmV1Pk.js → index-DvX9cMJV.js} +1 -1
  44. package/dist/{purchase-order-template-CLtEYr5E.js → purchase-order-template-uTs7bR89.js} +1 -1
  45. package/dist/router/name.d.ts +0 -1
  46. package/dist/{stock-nHQhfe2W.js → stock-CL2LNdXp.js} +1 -1
  47. package/dist/stores/feature.d.ts +0 -2
  48. package/dist/stores/inventory.d.ts +199 -26
  49. package/dist/{supplier-DuOjLpOa.js → supplier-CuzoW2k4.js} +1 -1
  50. package/dist/tsconfig.app.tsbuildinfo +1 -1
  51. package/dist/{use-ingredient-select-dialog-B-11Eqlm.js → use-ingredient-select-dialog-Cpg4lHHC.js} +1 -1
  52. package/dist/{use-inventory-binding-dialog-DhLSdRtp.js → use-inventory-binding-dialog-h4M4ICQK.js} +1 -1
  53. package/dist/views/ingredients/helper/import-export.helper.d.ts +1 -3
  54. package/dist/views/recipe/RecipeView.vue.d.ts +0 -1
  55. package/dist/views/unit/UnitView.vue.d.ts +0 -1
  56. package/package.json +2 -2
  57. package/dist/ImportView-EXm_g_jD.js +0 -1303
  58. package/dist/IngredientsView-MF1USuZI.js +0 -2240
  59. package/dist/RecipeView-DOaU9GIF.js +0 -636
  60. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CdA5_lEz.js +0 -3221
  61. package/dist/UnitView-CAXHvh3n.js +0 -674
  62. package/dist/import-export.helper-B04wszRI.js +0 -243
  63. package/dist/views/import/ImportView.vue.d.ts +0 -3
  64. package/dist/views/import/components/ImportDialog.vue.d.ts +0 -2
  65. package/dist/views/import/helper/import-export.helper.d.ts +0 -4
  66. package/dist/views/receive-request/components/delivery-order-form/SystemTrailDialog.vue.d.ts +0 -17
  67. package/dist/views/recipe/components/import-recipes/ImportRecipeItem.vue.d.ts +0 -16
  68. package/dist/views/recipe/components/import-recipes/ImportRecipes.vue.d.ts +0 -2
  69. package/dist/views/recipe/helper/import-recipe.d.ts +0 -48
  70. package/dist/views/unit/components/import-units/ImportUnitItem.vue.d.ts +0 -12
  71. package/dist/views/unit/components/import-units/ImportUnitItemProps.d.ts +0 -6
  72. package/dist/views/unit/components/import-units/ImportUnits.vue.d.ts +0 -9
  73. package/dist/views/unit/components/import-units/ImportUnitsProps.d.ts +0 -5
  74. package/dist/views/unit/helper/import-export.helper.d.ts +0 -40
@@ -1,25 +1,26 @@
1
- import { defineComponent as ce, ref as N, computed as H, resolveComponent as D, openBlock as F, createBlock as G, withCtx as I, createElementVNode as e, normalizeClass as he, toDisplayString as _, createVNode as k, createElementBlock as O, Fragment as Z, renderList as ie, unref as u, h as pe, watch as xe, isRef as Ue, createCommentVNode as te, reactive as ut, mergeModels as Ke, useModel as ct, onMounted as Ee, createTextVNode as ue, normalizeStyle as tt, Teleport as dt, normalizeProps as Ae, mergeProps as Ve } from "vue";
2
- import { u as ve, a0 as mt, f as He, h as Pe, i as pt, a as Re, F as We, a1 as vt, x as je, l as me, X as ft, t as Se, $ as Fe, A as yt, M as _t, Z as ye, a2 as bt, a3 as ne, a4 as kt, a5 as qe, p as gt, v as ht, a6 as xt, a7 as St, a8 as Ft, a9 as Ce, aa as wt, ab as nt, Y as X, ac as $t, W as ot, ad as ke, ae as At, af as Vt, r as Me, o as Xe, s as Ct, c as Mt, ag as Bt, ah as Dt, ai as It, aj as jt, ak as Tt, b as Ut, N as Et, H as Ht, C as Pt, E as Rt, G as Ot, I as Nt, J as Je } from "./app-Bb0-8bRg.js";
3
- import { u as Oe, a as _e } from "./stock-nHQhfe2W.js";
4
- import { g as we } from "./decimal-BdBZYISm.js";
5
- import { e as Lt, u as st, i as at, _ as Qe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BL1f817e.js";
6
- import { _ as Te, S as Be, g as lt, a as zt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-XwDTGpR-.js";
1
+ import { defineComponent as ce, ref as N, computed as E, resolveComponent as D, openBlock as F, createBlock as G, withCtx as I, createElementVNode as e, normalizeClass as he, toDisplayString as _, createVNode as k, createElementBlock as O, Fragment as Z, renderList as ie, unref as u, h as pe, watch as xe, isRef as Ue, createCommentVNode as te, reactive as ut, mergeModels as Ke, useModel as ct, onMounted as He, createTextVNode as ue, normalizeStyle as tt, Teleport as dt, normalizeProps as Ae, mergeProps as Ve } from "vue";
2
+ import { u as ve, a3 as mt, f as Ee, h as Pe, i as pt, a as Re, F as We, a4 as vt, x as je, l as me, $ as ft, t as Se, a2 as Fe, A as yt, M as _t, a1 as ye, H as bt, a5 as ne, a6 as kt, a7 as qe, p as gt, v as ht, a8 as xt, a9 as St, aa as Ft, ab as Ce, ac as wt, ad as nt, a0 as X, ae as $t, B as ot, af as ke, ag as At, ah as Vt, r as Be, o as Xe, s as Ct, c as Bt, ai as Mt, aj as Dt, ak as It, al as jt, am as Tt, b as Ut, N as Ht, L as Et, O as Pt, P as Rt, Q as Ot, T as Nt, V as Qe } from "./app-D2lun71R.js";
3
+ import { u as Oe, a as _e } from "./stock-CL2LNdXp.js";
4
+ import { g as we } from "./decimal-eeicE4jp.js";
5
+ import { e as Lt, u as st, i as at, _ as Je } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BN_e7k7U.js";
6
+ import { _ as Te, S as Me, g as lt, a as zt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BMFfegsk.js";
7
7
  import { _ as Yt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
8
8
  import { useI18n as de, useCoreStore as Ne } from "@feedmepos/mf-common";
9
9
  import { useSnackbar as be, useDialog as Le, useProxiedModel as ze, useBreakpoints as Gt } from "@feedmepos/ui-library";
10
10
  import { defineStore as Kt } from "pinia";
11
- import { u as Wt } from "./use-inventory-binding-dialog-DhLSdRtp.js";
12
- import { _ as qt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BKrUNLuG.js";
11
+ import { u as Wt } from "./use-inventory-binding-dialog-h4M4ICQK.js";
12
+ import { _ as qt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DjN_ktl1.js";
13
13
  import { E as Xt } from "./empty-placeholder-wf6-BWE8.js";
14
+ import "./array-Ca8T3f_G.js";
14
15
  var ge = /* @__PURE__ */ ((b) => (b.History = "History", b.Convert = "Convert", b.Adjust = "Adjust", b))(ge || {});
15
- const Jt = [
16
+ const Qt = [
16
17
  {
17
18
  translationKey: "inventory.stock.action.history",
18
19
  color: "text-neutral-700",
19
20
  value: "History"
20
21
  /* History */
21
22
  }
22
- ], Qt = [
23
+ ], Jt = [
23
24
  {
24
25
  translationKey: "inventory.stock.action.history",
25
26
  color: "text-neutral-700",
@@ -111,7 +112,7 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
111
112
  const c = g(o.sku);
112
113
  C ? localStorage.setItem(c, C) : localStorage.setItem(c, o.unit._id), j.value = $e(o.sku, o.unit);
113
114
  }
114
- const o = b, j = N($e(o.sku, o.unit)), h = H(() => {
115
+ const o = b, j = N($e(o.sku, o.unit)), h = E(() => {
115
116
  const { measurements: C } = o.unit;
116
117
  return [
117
118
  {
@@ -127,7 +128,7 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
127
128
  function d({ value: C }) {
128
129
  return u(j).type === "unit" ? C === null : C === u(j).measurement;
129
130
  }
130
- const i = H(
131
+ const i = E(
131
132
  () => {
132
133
  var C;
133
134
  return ((C = h.value.find((c) => d(c))) == null ? void 0 : C.label) ?? "";
@@ -197,8 +198,8 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
197
198
  }
198
199
  const x = N();
199
200
  async function C(V) {
200
- var M, B, E;
201
- if (!!!((B = (M = V.convert) == null ? void 0 : M.inventoryBindings) != null && B.length)) {
201
+ var B, M, H;
202
+ if (!!!((M = (B = V.convert) == null ? void 0 : B.inventoryBindings) != null && M.length)) {
202
203
  h.open({
203
204
  title: d("inventory.stock.error.convert.title"),
204
205
  message: d("inventory.stock.error.convert.message")
@@ -206,7 +207,7 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
206
207
  return;
207
208
  }
208
209
  const w = {
209
- maxCount: ((E = p.productBalance.find(({ id: P }) => P === V._id)) == null ? void 0 : E.count) || 0,
210
+ maxCount: ((H = p.productBalance.find(({ id: P }) => P === V._id)) == null ? void 0 : H.count) || 0,
210
211
  sku: V,
211
212
  show: !0,
212
213
  "onUpdate:show"(P) {
@@ -244,7 +245,7 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
244
245
  v.value = n;
245
246
  }
246
247
  function A(V, n) {
247
- const r = He(n);
248
+ const r = Ee(n);
248
249
  switch (V) {
249
250
  case ge.History:
250
251
  $(r);
@@ -330,7 +331,7 @@ function on() {
330
331
  return pe(Te, {
331
332
  days: i
332
333
  });
333
- const c = i <= x ? Be.low : i <= C ? Be.mid : Be.high;
334
+ const c = i <= x ? Me.low : i <= C ? Me.mid : Me.high;
334
335
  return pe(Te, {
335
336
  days: i,
336
337
  level: c
@@ -343,7 +344,7 @@ function on() {
343
344
  cell(d) {
344
345
  var i;
345
346
  return pt(
346
- ((i = b._currentLocation) == null ? void 0 : i.type) === "restaurant" ? Jt : Qt,
347
+ ((i = b._currentLocation) == null ? void 0 : i.type) === "restaurant" ? Qt : Jt,
347
348
  (x) => g.onActionMenu(x, d.row.original)
348
349
  );
349
350
  },
@@ -403,26 +404,26 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
403
404
  },
404
405
  emits: ["update:show", "submitted"],
405
406
  setup(b, { expose: g, emit: p }) {
406
- const o = b, j = p, h = Wt(), d = Re(), i = _e(), x = be(), { t: C } = de(), c = N(0), l = N(null), v = H(() => d.skus), $ = H(
407
+ const o = b, j = p, h = Wt(), d = Re(), i = _e(), x = be(), { t: C } = de(), c = N(0), l = N(null), v = E(() => d.skus), $ = E(
407
408
  () => {
408
409
  var y, t;
409
410
  return (((t = (y = o.sku) == null ? void 0 : y.convert) == null ? void 0 : t.inventoryBindings) ?? []).filter(
410
411
  (s) => s.type === We.enum.SKU
411
412
  );
412
413
  }
413
- ), A = H({
414
+ ), A = E({
414
415
  get() {
415
416
  return !!l.value;
416
417
  },
417
418
  set(y) {
418
- y ? l.value = He($.value) : (l.value = null, c.value = Math.min(c.value, o.maxCount ?? 0));
419
+ y ? l.value = Ee($.value) : (l.value = null, c.value = Math.min(c.value, o.maxCount ?? 0));
419
420
  }
420
421
  }), V = N(!1);
421
422
  xe([() => o.show], ([y]) => {
422
423
  y && (c.value = 0);
423
424
  });
424
425
  function n() {
425
- Q(o.sku, Se(c.value), l.value);
426
+ J(o.sku, Se(c.value), l.value);
426
427
  }
427
428
  function r(y) {
428
429
  if (l.value)
@@ -438,7 +439,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
438
439
  }) ?? null : null, s = je(o.sku.unit, t), f = bt(+y);
439
440
  return Ze(f).isInteger().max(s).error ? "Precision cannot be more than " + s : !0;
440
441
  }
441
- const M = H(
442
+ const B = E(
442
443
  () => {
443
444
  var y, t;
444
445
  return (y = o.sku.convert) != null && y.measurement ? (t = o.sku.unit.measurements.find((s) => {
@@ -446,7 +447,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
446
447
  return s.id === ((f = o.sku.convert) == null ? void 0 : f.measurement);
447
448
  })) == null ? void 0 : t.abbrev : o.sku.unit.abbrev;
448
449
  }
449
- ), B = H(() => {
450
+ ), M = E(() => {
450
451
  var f, m;
451
452
  const t = vt({
452
453
  bindings: ((f = o.sku.convert) == null ? void 0 : f.inventoryBindings) ?? [],
@@ -472,23 +473,23 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
472
473
  abbrev: U
473
474
  };
474
475
  });
475
- }), E = N();
476
+ }), H = N();
476
477
  g({
477
478
  validateInputs: () => {
478
479
  var y, t;
479
- (t = (y = E.value) == null ? void 0 : y.validateInputs) == null || t.call(y);
480
+ (t = (y = H.value) == null ? void 0 : y.validateInputs) == null || t.call(y);
480
481
  },
481
482
  resetInputsValidation: () => {
482
483
  var y, t;
483
- (t = (y = E.value) == null ? void 0 : y.resetInputsValidation) == null || t.call(y);
484
+ (t = (y = H.value) == null ? void 0 : y.resetInputsValidation) == null || t.call(y);
484
485
  },
485
486
  resetInputs: () => {
486
487
  var y, t;
487
- (t = (y = E.value) == null ? void 0 : y.resetInputs) == null || t.call(y);
488
+ (t = (y = H.value) == null ? void 0 : y.resetInputs) == null || t.call(y);
488
489
  }
489
490
  });
490
491
  const P = ze(o, "show");
491
- async function Q(y, t, s) {
492
+ async function J(y, t, s) {
492
493
  V.value = !0;
493
494
  try {
494
495
  await i.convertSku({
@@ -517,7 +518,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
517
518
  V.value = !1;
518
519
  }
519
520
  }
520
- function J(y, t, s) {
521
+ function Q(y, t, s) {
521
522
  const f = +t;
522
523
  let m = s;
523
524
  t.length > 0 && isFinite(f) ? m = s.map((a) => (a.id !== y || (a.amount = ye(f)), a)) : m = s.map((a) => (a.id !== y || (a.amount = { amount: 0, precision: 0 }), a)), l.value = m;
@@ -583,7 +584,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
583
584
  e("div", rn, [
584
585
  k(f, {
585
586
  ref_key: "formRef",
586
- ref: E,
587
+ ref: H,
587
588
  onValidationSuccess: n
588
589
  }, {
589
590
  default: I(() => [
@@ -593,8 +594,8 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
593
594
  "onUpdate:modelValue": t[0] || (t[0] = (T) => c.value = T),
594
595
  label: u(C)("inventory.stock.convert.amount"),
595
596
  rules: [r, w, u(Fe)(0)],
596
- "append-text": M.value,
597
- "helper-text": l.value ? void 0 : `Max ${y.maxCount} ${M.value}`
597
+ "append-text": B.value,
598
+ "helper-text": l.value ? void 0 : `Max ${y.maxCount} ${B.value}`
598
599
  }, null, 8, ["disabled", "model-value", "label", "rules", "append-text", "helper-text"])
599
600
  ]),
600
601
  _: 1
@@ -606,7 +607,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
606
607
  default: I(() => [
607
608
  e("div", un, [
608
609
  e("div", cn, _(u(C)("inventory.stock.convert.deductionSummary")), 1),
609
- (F(!0), O(Z, null, ie(B.value, (T) => {
610
+ (F(!0), O(Z, null, ie(M.value, (T) => {
610
611
  var K, W;
611
612
  return F(), O("div", {
612
613
  key: (K = T.sku) == null ? void 0 : K._id,
@@ -660,7 +661,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
660
661
  modelValue: +u(me)(
661
662
  T.amount ?? { amount: 1, precision: 0 }
662
663
  ),
663
- "onUpdate:modelValue": (q) => J(T.id, q, l.value ?? []),
664
+ "onUpdate:modelValue": (q) => Q(T.id, q, l.value ?? []),
664
665
  invalid: K
665
666
  }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
666
667
  k(U, {
@@ -709,7 +710,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
709
710
  label: u(C)("inventory.stock.convert.convertButton"),
710
711
  onClick: t[2] || (t[2] = (T) => {
711
712
  var K, W;
712
- return (W = (K = E.value) == null ? void 0 : K.validateInputs) == null ? void 0 : W.call(K);
713
+ return (W = (K = H.value) == null ? void 0 : K.validateInputs) == null ? void 0 : W.call(K);
713
714
  })
714
715
  }, null, 8, ["loading", "label"])
715
716
  ])
@@ -755,12 +756,12 @@ const Ie = {
755
756
  },
756
757
  emits: ["update:modelValue", "click:delete"],
757
758
  setup(b, { emit: g }) {
758
- const p = b, o = g, j = H(
759
+ const p = b, o = g, j = E(
759
760
  () => Object.keys(Ie).map((c) => ({
760
761
  label: kt(c),
761
762
  value: c
762
763
  }))
763
- ), h = H(() => lt(p.modelValue.doc.unit, !0)), d = H({
764
+ ), h = E(() => lt(p.modelValue.doc.unit, !0)), d = E({
764
765
  get() {
765
766
  return p.modelValue.type ?? ne.enum.PURCHASE;
766
767
  },
@@ -775,7 +776,7 @@ const Ie = {
775
776
  v.precision
776
777
  ), o("update:modelValue", l);
777
778
  }
778
- }), i = H({
779
+ }), i = E({
779
780
  get() {
780
781
  const c = qe(p.modelValue.amount);
781
782
  return +me(c);
@@ -789,7 +790,7 @@ const Ie = {
789
790
  v.precision
790
791
  ), o("update:modelValue", l);
791
792
  }
792
- }), x = H({
793
+ }), x = E({
793
794
  get() {
794
795
  var c;
795
796
  return ((c = p.modelValue.measurement) == null ? void 0 : c.id) ?? null;
@@ -801,7 +802,7 @@ const Ie = {
801
802
  };
802
803
  l.measurement = (($ = (v = p.modelValue.doc.unit) == null ? void 0 : v.measurements) == null ? void 0 : $.find((A) => A.id === c)) ?? null, o("update:modelValue", l);
803
804
  }
804
- }), C = H({
805
+ }), C = E({
805
806
  get() {
806
807
  return p.modelValue.remark ?? "";
807
808
  },
@@ -878,21 +879,21 @@ const Ie = {
878
879
  setup(b, { expose: g, emit: p }) {
879
880
  const o = b, j = p, h = Re(), d = Le(), i = _e(), x = be(), C = N(!1), { t: c } = de();
880
881
  function l() {
881
- V(He(A));
882
+ V(Ee(A));
882
883
  }
883
884
  const v = N();
884
885
  g({
885
886
  validateInputs: () => {
886
- var w, M;
887
- (M = (w = v.value) == null ? void 0 : w.validateInputs) == null || M.call(w);
887
+ var w, B;
888
+ (B = (w = v.value) == null ? void 0 : w.validateInputs) == null || B.call(w);
888
889
  },
889
890
  resetInputsValidation: () => {
890
- var w, M;
891
- (M = (w = v.value) == null ? void 0 : w.resetInputsValidation) == null || M.call(w);
891
+ var w, B;
892
+ (B = (w = v.value) == null ? void 0 : w.resetInputsValidation) == null || B.call(w);
892
893
  },
893
894
  resetInputs: () => {
894
- var w, M;
895
- (M = (w = v.value) == null ? void 0 : w.resetInputs) == null || M.call(w);
895
+ var w, B;
896
+ (B = (w = v.value) == null ? void 0 : w.resetInputs) == null || B.call(w);
896
897
  }
897
898
  });
898
899
  const $ = ze(o, "show"), A = ut({
@@ -925,37 +926,37 @@ const Ie = {
925
926
  try {
926
927
  await i.adjustSku({
927
928
  remark: w.remark,
928
- adjustments: w.adjustments.map(({ doc: M, remark: B, type: E, amount: P, measurement: Q }) => ({
929
- id: M._id,
929
+ adjustments: w.adjustments.map(({ doc: B, remark: M, type: H, amount: P, measurement: J }) => ({
930
+ id: B._id,
930
931
  amount: P,
931
- measurement: Q,
932
- remark: B,
933
- doc: M,
934
- type: E
932
+ measurement: J,
933
+ remark: M,
934
+ doc: B,
935
+ type: H
935
936
  }))
936
937
  }), j("update:show", !1), j("submitted");
937
- } catch (M) {
938
+ } catch (B) {
938
939
  x.open({
939
940
  title: c("inventory.stock.adjust.error.title"),
940
941
  message: c("inventory.stock.adjust.error.message"),
941
942
  type: "error"
942
- }), console.log("error on adjust ingredients", w, M);
943
+ }), console.log("error on adjust ingredients", w, B);
943
944
  } finally {
944
945
  C.value = !1;
945
946
  }
946
947
  }
947
948
  function n() {
948
- const w = h.skus.map((B) => ({
949
- label: B.name,
950
- sublabel: B.code,
951
- value: B._id
952
- })), M = w.filter((B) => A.adjustments.find((E) => E.doc._id === B.value)).map((B) => B.value);
949
+ const w = h.skus.map((M) => ({
950
+ label: M.name,
951
+ sublabel: M.code,
952
+ value: M._id
953
+ })), B = w.filter((M) => A.adjustments.find((H) => H.doc._id === M.value)).map((M) => M.value);
953
954
  d.open({
954
955
  title: "Select ingredients",
955
956
  contentComponent: ht,
956
957
  contentComponentProps: {
957
958
  items: w,
958
- modelValue: M
959
+ modelValue: B
959
960
  },
960
961
  overlay: !0,
961
962
  closeButton: !0,
@@ -969,12 +970,12 @@ const Ie = {
969
970
  close: !0,
970
971
  variant: "tertiary"
971
972
  }
972
- }).onPrimary((B) => {
973
- A.adjustments = B.map(
974
- (E) => A.adjustments.find((P) => P.doc._id === E) ?? {
973
+ }).onPrimary((M) => {
974
+ A.adjustments = M.map(
975
+ (H) => A.adjustments.find((P) => P.doc._id === H) ?? {
975
976
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
976
977
  type: ne.enum.PURCHASE,
977
- doc: h.skus.find((P) => P._id === E),
978
+ doc: h.skus.find((P) => P._id === H),
978
979
  measurement: null,
979
980
  remark: "",
980
981
  amount: ye(1)
@@ -985,11 +986,11 @@ const Ie = {
985
986
  function r(w) {
986
987
  A.adjustments.splice(w, 1);
987
988
  }
988
- return (w, M) => {
989
- const B = D("FmTextarea"), E = D("FmButton"), P = D("FmForm"), Q = D("FmSideSheet");
990
- return F(), G(Q, {
989
+ return (w, B) => {
990
+ const M = D("FmTextarea"), H = D("FmButton"), P = D("FmForm"), J = D("FmSideSheet");
991
+ return F(), G(J, {
991
992
  modelValue: u($),
992
- "onUpdate:modelValue": M[2] || (M[2] = (J) => Ue($) ? $.value = J : null),
993
+ "onUpdate:modelValue": B[2] || (B[2] = (Q) => Ue($) ? $.value = Q : null),
993
994
  "dismiss-away": "",
994
995
  "max-width": 500
995
996
  }, {
@@ -1006,22 +1007,22 @@ const Ie = {
1006
1007
  onValidationSuccess: l
1007
1008
  }, {
1008
1009
  default: I(() => [
1009
- k(B, {
1010
+ k(M, {
1010
1011
  label: u(c)("inventory.stock.adjust.remark"),
1011
1012
  modelValue: A.remark,
1012
- "onUpdate:modelValue": M[0] || (M[0] = (J) => A.remark = J)
1013
+ "onUpdate:modelValue": B[0] || (B[0] = (Q) => A.remark = Q)
1013
1014
  }, null, 8, ["label", "modelValue"]),
1014
1015
  e("div", wn, [
1015
1016
  e("div", $n, _(u(c)("inventory.stock.adjust.adjustedItems")), 1),
1016
- k(E, {
1017
+ k(H, {
1017
1018
  "prepend-icon": "add",
1018
1019
  variant: "tertiary",
1019
1020
  size: "md",
1020
1021
  onClick: n
1021
1022
  })
1022
1023
  ]),
1023
- (F(!0), O(Z, null, ie(A.adjustments, (J, R) => (F(), G(xn, {
1024
- key: J.id,
1024
+ (F(!0), O(Z, null, ie(A.adjustments, (Q, R) => (F(), G(xn, {
1025
+ key: Q.id,
1025
1026
  modelValue: A.adjustments[R],
1026
1027
  "onUpdate:modelValue": (oe) => A.adjustments[R] = oe,
1027
1028
  "onClick:delete": (oe) => r(R)
@@ -1032,10 +1033,10 @@ const Ie = {
1032
1033
  ]),
1033
1034
  "side-sheet-footer": I(() => [
1034
1035
  e("div", An, [
1035
- k(E, {
1036
+ k(H, {
1036
1037
  label: u(c)("inventory.stock.adjust.adjustButton"),
1037
1038
  loading: C.value,
1038
- onClick: M[1] || (M[1] = (J) => {
1039
+ onClick: B[1] || (B[1] = (Q) => {
1039
1040
  var R, oe;
1040
1041
  return (oe = (R = v.value) == null ? void 0 : R.validateInputs) == null ? void 0 : oe.call(R);
1041
1042
  })
@@ -1063,10 +1064,10 @@ const Ie = {
1063
1064
  };
1064
1065
  return await g.post(h, d);
1065
1066
  }
1066
- })), Mn = {
1067
+ })), Bn = {
1067
1068
  key: 0,
1068
1069
  class: "flex justify-center items-center h-32"
1069
- }, Bn = { class: "mb-3" }, Dn = { class: "flex flex-col gap-8" }, In = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, jn = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, Tn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Un = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, En = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Hn = { class: "flex flex-col w-full px-2" }, Pn = { class: "flex gap-2" }, Rn = /* @__PURE__ */ ce({
1070
+ }, Mn = { class: "mb-3" }, Dn = { class: "flex flex-col gap-8" }, In = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, jn = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, Tn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Un = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Hn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, En = { class: "flex flex-col w-full px-2" }, Pn = { class: "flex gap-2" }, Rn = /* @__PURE__ */ ce({
1070
1071
  __name: "AmendAdjustmentForm",
1071
1072
  props: /* @__PURE__ */ Ke({
1072
1073
  adjustmentId: {}
@@ -1080,7 +1081,7 @@ const Ie = {
1080
1081
  _id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
1081
1082
  skus: []
1082
1083
  }), c = N();
1083
- Ee(async () => {
1084
+ He(async () => {
1084
1085
  d.value = !0;
1085
1086
  const n = await j.readSingleAdjustment(p.adjustmentId);
1086
1087
  if (!n) throw new Error("Adjustment not found");
@@ -1090,12 +1091,12 @@ const Ie = {
1090
1091
  var r, w;
1091
1092
  if ((w = (r = c == null ? void 0 : c.value) == null ? void 0 : r.validateInputs) == null || w.call(r), !i.value) return;
1092
1093
  const n = {};
1093
- Object.keys(h.value || {}).forEach((M) => {
1094
- var B;
1095
- Object.keys(((B = h.value) == null ? void 0 : B[M]) || {}).forEach((E) => {
1096
- var Q, J;
1097
- const P = (J = (Q = h.value) == null ? void 0 : Q[M]) == null ? void 0 : J[Number(E)];
1098
- P && $(P.amount) > 0 && (n[M] || (n[M] = []), n[M].push(P));
1094
+ Object.keys(h.value || {}).forEach((B) => {
1095
+ var M;
1096
+ Object.keys(((M = h.value) == null ? void 0 : M[B]) || {}).forEach((H) => {
1097
+ var J, Q;
1098
+ const P = (Q = (J = h.value) == null ? void 0 : J[B]) == null ? void 0 : Q[Number(H)];
1099
+ P && $(P.amount) > 0 && (n[B] || (n[B] = []), n[B].push(P));
1099
1100
  });
1100
1101
  }), await j.revertWastageAdjustment({
1101
1102
  targetWastageAdjustmentId: p.adjustmentId,
@@ -1103,20 +1104,20 @@ const Ie = {
1103
1104
  }), o("refreshHistory"), x.value = !1, h.value = {};
1104
1105
  }
1105
1106
  function v(n, r, w) {
1106
- return H({
1107
+ return E({
1107
1108
  get: () => {
1108
- var B, E, P;
1109
- const M = (P = (E = (B = h.value) == null ? void 0 : B[n]) == null ? void 0 : E[r]) == null ? void 0 : P.amount;
1110
- return M ? $(M, !0) : 0;
1109
+ var M, H, P;
1110
+ const B = (P = (H = (M = h.value) == null ? void 0 : M[n]) == null ? void 0 : H[r]) == null ? void 0 : P.amount;
1111
+ return B ? $(B, !0) : 0;
1111
1112
  },
1112
- set: (M) => {
1113
+ set: (B) => {
1113
1114
  h.value || (h.value = {});
1114
- const B = { ...h.value };
1115
- B[n] || (B[n] = {}), B[n][r] = {
1116
- amount: Ce.fromNumber(M),
1115
+ const M = { ...h.value };
1116
+ M[n] || (M[n] = {}), M[n][r] = {
1117
+ amount: Ce.fromNumber(B),
1117
1118
  type: ne.Enum.WASTAGE,
1118
1119
  measurement: w
1119
- }, h.value = B;
1120
+ }, h.value = M;
1120
1121
  }
1121
1122
  });
1122
1123
  }
@@ -1131,8 +1132,8 @@ const Ie = {
1131
1132
  return r === 0 ? "N/A" : (n + r).toString();
1132
1133
  }
1133
1134
  return (n, r) => {
1134
- const w = D("FmIcon"), M = D("FmStepperField"), B = D("FmCard"), E = D("FmForm"), P = D("FmSpacer"), Q = D("FmButton"), J = D("FmDialog");
1135
- return F(), G(J, {
1135
+ const w = D("FmIcon"), B = D("FmStepperField"), M = D("FmCard"), H = D("FmForm"), P = D("FmSpacer"), J = D("FmButton"), Q = D("FmDialog");
1136
+ return F(), G(Q, {
1136
1137
  modelValue: x.value,
1137
1138
  "onUpdate:modelValue": r[4] || (r[4] = (R) => x.value = R),
1138
1139
  overlay: !0
@@ -1157,18 +1158,18 @@ const Ie = {
1157
1158
  e("div", null, "Amend Adjustment", -1)
1158
1159
  ])),
1159
1160
  "dialog-footer": I(() => [
1160
- e("div", Hn, [
1161
+ e("div", En, [
1161
1162
  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)),
1162
1163
  e("div", Pn, [
1163
1164
  k(P),
1164
- k(Q, {
1165
+ k(J, {
1165
1166
  class: "sm:w-full xs:w-full",
1166
1167
  label: "Close",
1167
1168
  size: "md",
1168
1169
  variant: "tertiary",
1169
1170
  onClick: r[3] || (r[3] = (R) => x.value = !1)
1170
1171
  }),
1171
- k(Q, {
1172
+ k(J, {
1172
1173
  class: "sm:w-full xs:w-full",
1173
1174
  label: "Submit",
1174
1175
  size: "md",
@@ -1179,7 +1180,7 @@ const Ie = {
1179
1180
  ])
1180
1181
  ]),
1181
1182
  default: I(() => [
1182
- d.value ? (F(), O("div", Mn)) : (F(), G(E, {
1183
+ d.value ? (F(), O("div", Bn)) : (F(), G(H, {
1183
1184
  key: 1,
1184
1185
  ref_key: "formRef",
1185
1186
  ref: c,
@@ -1192,14 +1193,14 @@ const Ie = {
1192
1193
  blameFormChildOnValidationFailed: ""
1193
1194
  }, {
1194
1195
  default: I(() => [
1195
- e("p", Bn, [
1196
+ e("p", Mn, [
1196
1197
  r[6] || (r[6] = e("b", null, "Date:", -1)),
1197
1198
  r[7] || (r[7] = e("br", null, null, -1)),
1198
1199
  ue(" " + _(u(St)(u(Ft)(C.value._id))), 1)
1199
1200
  ]),
1200
1201
  e("div", Dn, [
1201
1202
  (F(!0), O(Z, null, ie(C.value.skus, (R, oe) => (F(), O(Z, { key: oe }, [
1202
- (F(!0), O(Z, null, ie(R.amounts, (L, Y) => (F(), G(B, {
1203
+ (F(!0), O(Z, null, ie(R.amounts, (L, Y) => (F(), G(M, {
1203
1204
  key: Y,
1204
1205
  variant: "outlined",
1205
1206
  class: "p-2"
@@ -1218,7 +1219,7 @@ const Ie = {
1218
1219
  r[9] || (r[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
1219
1220
  e("span", null, _(u(Ce).toFormatString({ value: L.amount })) + " " + _(A(R, L)), 1)
1220
1221
  ]),
1221
- k(M, {
1222
+ k(B, {
1222
1223
  "model-value": v(R.sku._id, Y).value,
1223
1224
  "onUpdate:modelValue": (le) => v(R.sku._id, Y).value = le,
1224
1225
  class: "mb-3",
@@ -1230,7 +1231,7 @@ const Ie = {
1230
1231
  u(Fe)(-1)
1231
1232
  ]
1232
1233
  }, null, 8, ["model-value", "onUpdate:modelValue", "helper-text", "append-text", "rules"]),
1233
- e("div", En, [
1234
+ e("div", Hn, [
1234
1235
  r[10] || (r[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
1235
1236
  r[11] || (r[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)),
1236
1237
  ue(" " + _(V(
@@ -1260,10 +1261,10 @@ const Ie = {
1260
1261
  }, Xn = {
1261
1262
  key: 2,
1262
1263
  class: "inline-flex items-center rounded-md bg-yellow-400/10 px-2 text-xs font-medium text-yellow-500 inset-ring inset-ring-yellow-400/20"
1263
- }, Jn = {
1264
+ }, Qn = {
1264
1265
  key: 1,
1265
1266
  class: "shrink-0 text-fm-color-typo-secondary"
1266
- }, Qn = /* @__PURE__ */ ce({
1267
+ }, Jn = /* @__PURE__ */ ce({
1267
1268
  __name: "StockRecordCard",
1268
1269
  props: {
1269
1270
  record: {},
@@ -1274,12 +1275,12 @@ const Ie = {
1274
1275
  setup(b, { emit: g }) {
1275
1276
  const p = b, o = N(!1);
1276
1277
  Ne();
1277
- const j = N(), h = N(null), d = H(() => h.value === null ? "unset" : o.value ? `${h.value}px` : "0px");
1278
- Ee(() => {
1278
+ const j = N(), h = N(null), d = E(() => h.value === null ? "unset" : o.value ? `${h.value}px` : "0px");
1279
+ He(() => {
1279
1280
  var c;
1280
1281
  h.value = ((c = j.value) == null ? void 0 : c.scrollHeight) || 0;
1281
1282
  });
1282
- const i = H(() => {
1283
+ const i = E(() => {
1283
1284
  var V;
1284
1285
  const c = p.record.adjustments, l = p.sku, v = {}, A = c.flatMap((n) => {
1285
1286
  var r;
@@ -1297,7 +1298,7 @@ const Ie = {
1297
1298
  })} ${l.unit.abbrev}`, n),
1298
1299
  {}
1299
1300
  );
1300
- }), { t: x } = de(), C = H(() => p.record.adjustmentsByTime.map(({ date: c, adjustments: l }) => ({
1301
+ }), { t: x } = de(), C = E(() => p.record.adjustmentsByTime.map(({ date: c, adjustments: l }) => ({
1301
1302
  time: $t(new Date(c)),
1302
1303
  adjustments: l.flatMap(
1303
1304
  (v) => {
@@ -1422,7 +1423,7 @@ const Ie = {
1422
1423
  adjustmentId: n.adjustmentId,
1423
1424
  onRefreshHistory: l[1] || (l[1] = (r) => c.$emit("refreshHistory"))
1424
1425
  }, null, 8, ["adjustmentId"])) : te("", !0),
1425
- n.cost ? (F(), O("div", Jn, " (" + _(u(ke)(n.cost, !1, n.cost.precision)) + ") ", 1)) : te("", !0)
1426
+ n.cost ? (F(), O("div", Qn, " (" + _(u(ke)(n.cost, !1, n.cost.precision)) + ") ", 1)) : te("", !0)
1426
1427
  ]))), 128))
1427
1428
  ])
1428
1429
  ]))), 128))
@@ -1502,13 +1503,13 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1502
1503
  }, uo = { class: "pb-16" }, co = { class: "fm-typo-cn-body-lg-600" }, mo = {
1503
1504
  class: "grid gap-12 fm-typo-en-body-md-400",
1504
1505
  style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
1505
- }, po = { class: "flex flex-col gap-1" }, vo = { class: "text-fm-color-typo-secondary" }, fo = { class: "font-bold" }, yo = { class: "flex flex-col gap-1" }, _o = { class: "text-fm-color-typo-secondary flex" }, bo = { class: "font-bold" }, ko = { class: "flex flex-col gap-1" }, go = { class: "text-fm-color-typo-secondary" }, ho = { class: "font-bold" }, xo = { class: "flex flex-col gap-1" }, So = { class: "text-fm-color-typo-secondary" }, Fo = { class: "font-bold" }, wo = { class: "flex flex-col gap-1" }, $o = { class: "text-fm-color-typo-secondary" }, Ao = { class: "font-bold" }, Vo = { class: "flex flex-col gap-1" }, Co = { class: "text-fm-color-typo-secondary" }, Mo = { class: "font-bold" }, Bo = { class: "flex flex-col gap-1" }, Do = { class: "text-fm-color-typo-secondary" }, Io = { class: "font-bold" }, jo = { class: "flex flex-col gap-1" }, To = { class: "text-fm-color-typo-secondary" }, Uo = { class: "font-bold" }, Eo = { class: "flex flex-col gap-1" }, Ho = { class: "text-fm-color-typo-secondary" }, Po = { class: "font-bold" }, Ro = {
1506
+ }, po = { class: "flex flex-col gap-1" }, vo = { class: "text-fm-color-typo-secondary" }, fo = { class: "font-bold" }, yo = { class: "flex flex-col gap-1" }, _o = { class: "text-fm-color-typo-secondary flex" }, bo = { class: "font-bold" }, ko = { class: "flex flex-col gap-1" }, go = { class: "text-fm-color-typo-secondary" }, ho = { class: "font-bold" }, xo = { class: "flex flex-col gap-1" }, So = { class: "text-fm-color-typo-secondary" }, Fo = { class: "font-bold" }, wo = { class: "flex flex-col gap-1" }, $o = { class: "text-fm-color-typo-secondary" }, Ao = { class: "font-bold" }, Vo = { class: "flex flex-col gap-1" }, Co = { class: "text-fm-color-typo-secondary" }, Bo = { class: "font-bold" }, Mo = { class: "flex flex-col gap-1" }, Do = { class: "text-fm-color-typo-secondary" }, Io = { class: "font-bold" }, jo = { class: "flex flex-col gap-1" }, To = { class: "text-fm-color-typo-secondary" }, Uo = { class: "font-bold" }, Ho = { class: "flex flex-col gap-1" }, Eo = { class: "text-fm-color-typo-secondary" }, Po = { class: "font-bold" }, Ro = {
1506
1507
  key: 0,
1507
1508
  class: "flex flex-col gap-8"
1508
1509
  }, Oo = { class: "flex" }, No = { class: "flex-1 flex flex-col gap-1" }, Lo = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, zo = { class: "font-bold" }, Yo = { class: "flex-1 flex flex-col gap-1" }, Go = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Ko = { class: "flex flex-col gap-1" }, Wo = { class: "font-bold" }, qo = {
1509
1510
  key: 2,
1510
1511
  class: "flex-1 flex flex-col items-center gap-8"
1511
- }, Xo = ["src"], Jo = { class: "font-bold text-lg" }, Qo = { class: "text-xs text-neutral-400 text-center" }, Zo = /* @__PURE__ */ ce({
1512
+ }, Xo = ["src"], Qo = { class: "font-bold text-lg" }, Jo = { class: "text-xs text-neutral-400 text-center" }, Zo = /* @__PURE__ */ ce({
1512
1513
  __name: "StockHistory",
1513
1514
  props: {
1514
1515
  sku: {},
@@ -1516,7 +1517,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1516
1517
  },
1517
1518
  emits: ["update:show"],
1518
1519
  setup(b) {
1519
- const g = Ne(), p = Oe(), o = _e(), j = Cn(), h = ve(), d = Mt(), { t: i } = de(), x = b, C = N(!1), c = be(), l = N(At(0));
1520
+ const g = Ne(), p = Oe(), o = _e(), j = Cn(), h = ve(), d = Bt(), { t: i } = de(), x = b, C = N(!1), c = be(), l = N(At(0));
1520
1521
  async function v() {
1521
1522
  C.value = !0;
1522
1523
  try {
@@ -1531,7 +1532,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1531
1532
  C.value = !1;
1532
1533
  }
1533
1534
  }
1534
- Ee(() => {
1535
+ He(() => {
1535
1536
  v();
1536
1537
  }), xe([() => l.value, () => x.sku], () => {
1537
1538
  v();
@@ -1559,18 +1560,18 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1559
1560
  async function w() {
1560
1561
  let t = await o.readStockAdjustment(
1561
1562
  x.sku._id,
1562
- Bt(new Date(l.value.startDate)).toISOString(),
1563
+ Mt(new Date(l.value.startDate)).toISOString(),
1563
1564
  Dt(new Date(l.value.endDate)).toISOString()
1564
1565
  );
1565
1566
  $.value = t;
1566
1567
  const s = t.filter(({ ref: f }) => f == null ? void 0 : f.startsWith("bill_")).map(({ ref: f }) => f);
1567
- await M(s), A.value = r(t, "day").map(({ date: f, adjustments: m }) => ({
1568
+ await B(s), A.value = r(t, "day").map(({ date: f, adjustments: m }) => ({
1568
1569
  date: f,
1569
1570
  adjustments: m,
1570
1571
  adjustmentsByTime: r(m, "minute")
1571
1572
  }));
1572
1573
  }
1573
- async function M(t) {
1574
+ async function B(t) {
1574
1575
  t.length && (V.value = await j.findBillsById(t).catch((s) => {
1575
1576
  var a;
1576
1577
  console.error("Error on using latest bill API, retrying using legacy api", s);
@@ -1578,13 +1579,13 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1578
1579
  return j.findBillsByBusinessId(f, [m], t);
1579
1580
  }));
1580
1581
  }
1581
- const B = H(() => {
1582
+ const M = E(() => {
1582
1583
  const t = $.value, s = x.sku;
1583
1584
  return Zn(t, s);
1584
- }), E = H(() => {
1585
+ }), H = E(() => {
1585
1586
  const t = $.value, s = x.sku;
1586
1587
  return eo(t, s);
1587
- }), P = H(() => {
1588
+ }), P = E(() => {
1588
1589
  const t = [...$.value].computeFirst((f) => {
1589
1590
  var a, S;
1590
1591
  const m = (S = (a = f.skus) == null ? void 0 : a.find) == null ? void 0 : S.call(a, (U) => U.sku._id === x.sku._id);
@@ -1597,7 +1598,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1597
1598
  value: t,
1598
1599
  precision: 4
1599
1600
  })} ${s.unit.abbrev}` : "";
1600
- }), Q = H(() => {
1601
+ }), J = E(() => {
1601
1602
  const t = [...$.value].reverse().computeFirst((f) => {
1602
1603
  var a, S;
1603
1604
  const m = (S = (a = f.skus) == null ? void 0 : a.find) == null ? void 0 : S.call(a, (U) => U.sku._id === x.sku._id);
@@ -1607,7 +1608,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1607
1608
  precision: 0
1608
1609
  }, s = x.sku;
1609
1610
  return s ? `${X.toFormatString({ value: t, precision: 4 })} ${s.unit.abbrev}` : "";
1610
- }), J = H(() => {
1611
+ }), Q = E(() => {
1611
1612
  var f;
1612
1613
  const s = $.value.flatMap((m) => {
1613
1614
  var a;
@@ -1628,7 +1629,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1628
1629
  {
1629
1630
  amount: 0,
1630
1631
  precision: 0,
1631
- currency: Me((f = g.currentCountry) == null ? void 0 : f.value)
1632
+ currency: Be((f = g.currentCountry) == null ? void 0 : f.value)
1632
1633
  }
1633
1634
  );
1634
1635
  return ke(s, !1, s.precision);
@@ -1640,7 +1641,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1640
1641
  endDate: s
1641
1642
  });
1642
1643
  }
1643
- const oe = H(() => x.sku.valuation === Xe.Enum.FIFO ? i("inventory.ingredient.valuationMethod.FIFO") : i("inventory.ingredient.valuationMethod.WAVG")), L = H(() => {
1644
+ const oe = E(() => x.sku.valuation === Xe.Enum.FIFO ? i("inventory.ingredient.valuationMethod.FIFO") : i("inventory.ingredient.valuationMethod.WAVG")), L = E(() => {
1644
1645
  var U, z, se, T;
1645
1646
  const t = [...$.value].reverse().computeFirst((K) => {
1646
1647
  var W, ae;
@@ -1653,9 +1654,9 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1653
1654
  }, m = s.amount, a = m.amount == 0 ? X.fromNumber(0) : X.divide([f, m]);
1654
1655
  return {
1655
1656
  ...X.multiply([a, m]),
1656
- currency: ((se = s.cost) == null ? void 0 : se.currency) || Me(((T = g.currentCountry) == null ? void 0 : T.value) ?? Ct)
1657
+ currency: ((se = s.cost) == null ? void 0 : se.currency) || Be(((T = g.currentCountry) == null ? void 0 : T.value) ?? Ct)
1657
1658
  };
1658
- }), Y = H(() => {
1659
+ }), Y = E(() => {
1659
1660
  var f;
1660
1661
  const t = [...$.value].reverse().computeFirst((m) => {
1661
1662
  var S, U;
@@ -1667,7 +1668,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1667
1668
  amount: 0,
1668
1669
  precision: 0
1669
1670
  }),
1670
- currency: Me((f = g.currentCountry) == null ? void 0 : f.value)
1671
+ currency: Be((f = g.currentCountry) == null ? void 0 : f.value)
1671
1672
  } : "No data";
1672
1673
  });
1673
1674
  function le() {
@@ -1753,16 +1754,16 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1753
1754
  e("div", mo, [
1754
1755
  e("div", po, [
1755
1756
  e("div", vo, _(u(i)("inventory.stock.history.summary.totalPurchase")), 1),
1756
- e("div", fo, _(B.value.PURCHASE), 1)
1757
+ e("div", fo, _(M.value.PURCHASE), 1)
1757
1758
  ]),
1758
1759
  e("div", yo, [
1759
1760
  e("div", _o, [
1760
1761
  ue(_(u(i)("inventory.stock.history.summary.totalSales")) + "  ", 1),
1761
- E.value != null ? (F(), G(se, {
1762
+ H.value != null ? (F(), G(se, {
1762
1763
  key: 0,
1763
1764
  variant: "plain",
1764
1765
  placement: "top",
1765
- content: `Before: ${E.value}`,
1766
+ content: `Before: ${H.value}`,
1766
1767
  "z-index": 50
1767
1768
  }, {
1768
1769
  default: I(() => [
@@ -1774,42 +1775,42 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1774
1775
  _: 1
1775
1776
  }, 8, ["content"])) : te("", !0)
1776
1777
  ]),
1777
- e("div", bo, _(B.value.SALES), 1)
1778
+ e("div", bo, _(M.value.SALES), 1)
1778
1779
  ]),
1779
1780
  e("div", ko, [
1780
1781
  e("div", go, _(u(i)("inventory.stock.history.summary.totalLose")), 1),
1781
- e("div", ho, _(B.value.LOSE), 1)
1782
+ e("div", ho, _(M.value.LOSE), 1)
1782
1783
  ]),
1783
1784
  e("div", xo, [
1784
1785
  e("div", So, _(u(i)("inventory.stock.history.summary.totalRequest")), 1),
1785
- e("div", Fo, _(B.value.REQUEST), 1)
1786
+ e("div", Fo, _(M.value.REQUEST), 1)
1786
1787
  ]),
1787
1788
  e("div", wo, [
1788
1789
  e("div", $o, _(u(i)("inventory.stock.history.summary.totalReceive")), 1),
1789
- e("div", Ao, _(B.value.RECEIVE), 1)
1790
+ e("div", Ao, _(M.value.RECEIVE), 1)
1790
1791
  ]),
1791
1792
  e("div", Vo, [
1792
1793
  e("div", Co, _(u(i)("inventory.stock.history.summary.totalConvert")), 1),
1793
- e("div", Mo, _(B.value.CONVERT), 1)
1794
+ e("div", Bo, _(M.value.CONVERT), 1)
1794
1795
  ]),
1795
- e("div", Bo, [
1796
+ e("div", Mo, [
1796
1797
  e("div", Do, _(u(i)("inventory.stock.history.summary.totalDamage")), 1),
1797
- e("div", Io, _(B.value.DAMAGE), 1)
1798
+ e("div", Io, _(M.value.DAMAGE), 1)
1798
1799
  ]),
1799
1800
  e("div", jo, [
1800
1801
  e("div", To, _(u(i)("inventory.stock.history.summary.openingBalance")), 1),
1801
1802
  e("div", Uo, _(P.value), 1)
1802
1803
  ]),
1803
- e("div", Eo, [
1804
- e("div", Ho, _(u(i)("inventory.stock.history.summary.lastStockBalance")), 1),
1805
- e("div", Po, _(Q.value), 1)
1804
+ e("div", Ho, [
1805
+ e("div", Eo, _(u(i)("inventory.stock.history.summary.lastStockBalance")), 1),
1806
+ e("div", Po, _(J.value), 1)
1806
1807
  ])
1807
1808
  ]),
1808
1809
  u(d).enableTotalCost ? (F(), O("div", Ro, [
1809
1810
  k(T, { class: "w-full" }),
1810
1811
  e("div", Oo, [
1811
1812
  e("div", No, [
1812
- k(Qe, { "z-index": 50 }, {
1813
+ k(Je, { "z-index": 50 }, {
1813
1814
  default: I(() => [
1814
1815
  e("div", Lo, [
1815
1816
  ue(_(u(i)("inventory.stock.history.estimatedValue")) + " ", 1),
@@ -1852,7 +1853,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1852
1853
  ])
1853
1854
  ]),
1854
1855
  e("div", Yo, [
1855
- k(Qe, { "z-index": 50 }, {
1856
+ k(Je, { "z-index": 50 }, {
1856
1857
  default: I(() => [
1857
1858
  e("div", Go, [
1858
1859
  ue(_(u(i)("inventory.stock.history.costSold")) + " ", 1),
@@ -1876,7 +1877,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1876
1877
  ]),
1877
1878
  _: 1
1878
1879
  }),
1879
- e("div", Wo, _(J.value), 1)
1880
+ e("div", Wo, _(Q.value), 1)
1880
1881
  ])
1881
1882
  ])
1882
1883
  ])) : te("", !0)
@@ -1890,7 +1891,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1890
1891
  (F(!0), O(Z, null, ie(A.value, (ee) => (F(), O(Z, {
1891
1892
  key: ee.date
1892
1893
  }, [
1893
- t.sku ? (F(), G(Qn, {
1894
+ t.sku ? (F(), G(Jn, {
1894
1895
  key: 0,
1895
1896
  record: ee,
1896
1897
  sku: t.sku,
@@ -1906,8 +1907,8 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1906
1907
  alt: "List is empty"
1907
1908
  }, null, 8, Xo)
1908
1909
  ]),
1909
- e("div", Jo, _(u(i)("inventory.stock.history.noRecords")), 1),
1910
- e("div", Qo, _(u(i)("inventory.stock.history.changeDateRange")), 1),
1910
+ e("div", Qo, _(u(i)("inventory.stock.history.noRecords")), 1),
1911
+ e("div", Jo, _(u(i)("inventory.stock.history.changeDateRange")), 1),
1911
1912
  k(S),
1912
1913
  k(S)
1913
1914
  ]))
@@ -1921,12 +1922,12 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1921
1922
  }), es = {
1922
1923
  key: 0,
1923
1924
  class: "flex items-center gap-1"
1924
- }, ts = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ns = { class: "flex flex-col gap-8" }, os = { class: "flex flex-col" }, ss = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, as = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ks = /* @__PURE__ */ ce({
1925
+ }, ts = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ns = { class: "flex flex-col gap-8" }, os = { class: "flex flex-col" }, ss = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, as = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, gs = /* @__PURE__ */ ce({
1925
1926
  __name: "StockView",
1926
1927
  setup(b) {
1927
1928
  const { t: g } = de(), p = Re(), o = ve(), j = Oe(), h = it(), d = _e(), i = st(), x = Ut(), { columnDefs: C } = on(), c = Le(), l = be();
1928
1929
  o.watchLocation(V);
1929
- const v = H(
1930
+ const v = E(
1930
1931
  () => new Set(x.getAvailableItems(x.businessSubsidiaryId))
1931
1932
  ), $ = N(!1);
1932
1933
  async function A() {
@@ -1967,7 +1968,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1967
1968
  }
1968
1969
  }
1969
1970
  }
1970
- const n = H(() => [
1971
+ const n = E(() => [
1971
1972
  {
1972
1973
  type: "string",
1973
1974
  key: "status",
@@ -1984,12 +1985,12 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1984
1985
  type: "string"
1985
1986
  }
1986
1987
  ]
1987
- }), w = H(() => {
1988
+ }), w = E(() => {
1988
1989
  var le, y, t;
1989
- const L = r.value ? Et.build(r.value) : null, Y = [];
1990
+ const L = r.value ? Ht.build(r.value) : null, Y = [];
1990
1991
  for (const s of p.skus) {
1991
1992
  let f = !0;
1992
- if (x.isEnabled && B.value && v.value && f && (f = v.value.has(s._id)), L && f && (f = Ht(
1993
+ if (x.isEnabled && M.value && v.value && f && (f = v.value.has(s._id)), L && f && (f = Et(
1993
1994
  {
1994
1995
  status: s.isInactive ? "Inactive" : "Active"
1995
1996
  },
@@ -2014,7 +2015,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
2014
2015
  }
2015
2016
  }
2016
2017
  return Y;
2017
- }), M = N(""), B = N(!0), { breakpoints: E } = Gt(), P = H(() => E.value.xs || E.value.sm), Q = H(() => P.value ? 10 : 20), J = Pt(), R = H(() => [
2018
+ }), B = N(""), M = N(!0), { breakpoints: H } = Gt(), P = E(() => H.value.xs || H.value.sm), J = E(() => P.value ? 10 : 20), Q = Pt(), R = E(() => [
2018
2019
  {
2019
2020
  label: g("inventory.stock.stock_balance.refreshBalance"),
2020
2021
  value: "refresh-balance",
@@ -2062,8 +2063,8 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
2062
2063
  k(Ot, {
2063
2064
  searchable: "",
2064
2065
  "change-location": "",
2065
- search: M.value,
2066
- "onUpdate:search": Y[1] || (Y[1] = (a) => M.value = a),
2066
+ search: B.value,
2067
+ "onUpdate:search": Y[1] || (Y[1] = (a) => B.value = a),
2067
2068
  "hide-filter-options": !0,
2068
2069
  filterable: "",
2069
2070
  "filter-attributes": n.value,
@@ -2077,8 +2078,8 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
2077
2078
  k(Pe, null, {
2078
2079
  default: I(() => [
2079
2080
  k(le, {
2080
- modelValue: B.value,
2081
- "onUpdate:modelValue": Y[0] || (Y[0] = (a) => B.value = a)
2081
+ modelValue: M.value,
2082
+ "onUpdate:modelValue": Y[0] || (Y[0] = (a) => M.value = a)
2082
2083
  }, null, 8, ["modelValue"])
2083
2084
  ]),
2084
2085
  _: 1
@@ -2088,14 +2089,14 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
2088
2089
  _: 1
2089
2090
  }, 8, ["search", "filter-attributes", "filter"]),
2090
2091
  (F(), G(y, {
2091
- style: tt(u(J).tableHeight),
2092
+ style: tt(u(Q).tableHeight),
2092
2093
  "column-defs": u(C),
2093
2094
  "row-data": w.value,
2094
- "search-value": M.value,
2095
+ "search-value": B.value,
2095
2096
  loading: $.value || !u(o)._currentLocation,
2096
2097
  key: (t = u(o)._currentLocation) == null ? void 0 : t.dbName,
2097
2098
  onRowClick: Y[3] || (Y[3] = (a) => u(h).showSkuHistory(a.original)),
2098
- "page-size": Q.value
2099
+ "page-size": J.value
2099
2100
  }, {
2100
2101
  "list-row": I((a) => [
2101
2102
  k(Nt, {
@@ -2108,13 +2109,13 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
2108
2109
  e("div", ns, [
2109
2110
  e("div", os, [
2110
2111
  e("div", ss, [
2111
- k(u(Je), {
2112
+ k(u(Qe), {
2112
2113
  render: (se = (z = (U = S.code) == null ? void 0 : U.column) == null ? void 0 : z.columnDef) == null ? void 0 : se.cell,
2113
2114
  props: (K = (T = S.code) == null ? void 0 : T.getContext) == null ? void 0 : K.call(T)
2114
2115
  }, null, 8, ["render", "props"])
2115
2116
  ]),
2116
2117
  e("div", as, [
2117
- k(u(Je), {
2118
+ k(u(Qe), {
2118
2119
  render: (re = (ae = (W = S.name) == null ? void 0 : W.column) == null ? void 0 : ae.columnDef) == null ? void 0 : re.cell,
2119
2120
  props: (ee = (q = S.name) == null ? void 0 : q.getContext) == null ? void 0 : ee.call(q)
2120
2121
  }, null, 8, ["render", "props"])
@@ -2156,5 +2157,5 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
2156
2157
  }
2157
2158
  });
2158
2159
  export {
2159
- ks as default
2160
+ gs as default
2160
2161
  };