@feedmepos/mf-inventory-portal 1.2.11-dev.2 → 1.2.12-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/{App-7THD1njR.js → App-DAWBJNxz.js} +44 -40
  2. package/dist/{ApprovalView-DMEJRr68.js → ApprovalView-B2WUwSN4.js} +30 -30
  3. package/dist/{BindingsDialog-BNzLPDnk.js → BindingsDialog-C3OOcB8g.js} +2 -2
  4. package/dist/{BindingsPicker-b6IVAFK_.js → BindingsPicker-R3Zz0fWB.js} +1 -1
  5. package/dist/{BindingsTable-C-4XGO_N.js → BindingsTable-B46C8p7M.js} +1 -1
  6. package/dist/{ClosingDraftView-DVTloUym.js → ClosingDraftView-a_QhmaM4.js} +180 -180
  7. package/dist/{ClosingTemplateView-C-eHKV0N.js → ClosingTemplateView-CEVmIsVw.js} +3 -3
  8. package/dist/{DeliveryOrderPrintPreview-ChIV_Wxd.js → DeliveryOrderPrintPreview-BeQFF6sn.js} +1 -1
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DPkGmSYU.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DIG9NwPj.js} +3 -3
  10. package/dist/{FmMultiselectDialog-aRqxOX4h.js → FmMultiselectDialog-BunyF2O-.js} +1 -1
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-_MPI8AAx.js → FmUnitInput.vue_vue_type_script_setup_true_lang-Bx0dzfHO.js} +39 -39
  12. package/dist/ImportView-CwBeBbXz.js +1220 -0
  13. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BiHvGyAN.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CfwprwJN.js} +1 -1
  14. package/dist/{IngredientGroupView-DtExVKaV.js → IngredientGroupView-CIPTj0hf.js} +16 -17
  15. package/dist/IngredientsView-BwBaeLtw.js +2240 -0
  16. package/dist/{IntegrationView-LnHPQMs8.js → IntegrationView-CvRD-5O6.js} +57 -57
  17. package/dist/{InventoryBindingForm-Cm9TOWWe.js → InventoryBindingForm-DLQTH1di.js} +1 -1
  18. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DwGz8gLR.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-XvIklIYw.js} +31 -31
  19. package/dist/{InventoryBindingSummary-BQ6ysLf9.js → InventoryBindingSummary-BGFSPQIw.js} +1 -1
  20. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B_ASTDtr.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B3J0i5IU.js} +1 -1
  21. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DdFHN7A8.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CyMRTB5L.js} +1 -1
  22. package/dist/{PublishView-Dg_U3hW1.js → PublishView-7g0bx6KO.js} +16 -16
  23. package/dist/{PurchaseOrderPrintPreview-DnwHiTGF.js → PurchaseOrderPrintPreview-LEfLcjkd.js} +1 -1
  24. package/dist/{ReceiveRequestView-CIzZf6q8.js → ReceiveRequestView-DUNfHRGf.js} +193 -194
  25. package/dist/RecipeView-XzqGQg_a.js +636 -0
  26. package/dist/{StockView-D6RmCUZZ.js → StockView-vZr9etBj.js} +165 -166
  27. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BAcaiBqq.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-3_csD6uU.js} +1 -1
  28. package/dist/{SupplierView-DmJXuznz.js → SupplierView-CUORFWJW.js} +52 -52
  29. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-9wk6mQHT.js → TransferDetails.vue_vue_type_script_setup_true_lang-DhXoNkss.js} +5 -5
  30. package/dist/{TransferTemplateView-wcXRmuoK.js → TransferTemplateView-DeliKkYY.js} +97 -97
  31. package/dist/UnitView-B4NCl6jJ.js +674 -0
  32. package/dist/{WarehouseView-643lOh1p.js → WarehouseView-jLGGlnwV.js} +32 -32
  33. package/dist/api/inventory.d.ts +306 -0
  34. package/dist/{app-CsyUwsea.js → app-DJcCTZjT.js} +7663 -7341
  35. package/dist/app.d.ts +169 -0
  36. package/dist/app.js +1 -1
  37. package/dist/{closing-template-DaHVCTUh.js → closing-template-hM43IpP-.js} +1 -1
  38. package/dist/{decimal-DveC9JMl.js → decimal-BVu2HlCS.js} +1 -1
  39. package/dist/{format-unit-display-_9FgoZom.js → format-unit-display-C-M_AirC.js} +25 -25
  40. package/dist/helper/number.d.ts +1 -0
  41. package/dist/import-export.helper-C05Vl6i-.js +243 -0
  42. package/dist/{index-ChAOZMz9.js → index-CNQtmSfJ.js} +1 -1
  43. package/dist/{index-CZmm0Xbi.js → index-v6hU4gAy.js} +1 -1
  44. package/dist/{purchase-order-template-D2kAwN4O.js → purchase-order-template-BBCEFnbo.js} +1 -1
  45. package/dist/router/name.d.ts +1 -0
  46. package/dist/{stock-CL0X5Bnh.js → stock-CK3LBQmj.js} +1 -1
  47. package/dist/stores/inventory.d.ts +26 -199
  48. package/dist/{supplier-D3mOSUzY.js → supplier-CoCAyG12.js} +1 -1
  49. package/dist/tsconfig.app.tsbuildinfo +1 -1
  50. package/dist/{use-ingredient-select-dialog-Ba-l0gZ1.js → use-ingredient-select-dialog-DYfpyC4u.js} +1 -1
  51. package/dist/{use-inventory-binding-dialog-CpaprD6M.js → use-inventory-binding-dialog-CDwm6TPx.js} +1 -1
  52. package/dist/views/import/ImportView.vue.d.ts +3 -0
  53. package/dist/views/import/components/ImportDialog.vue.d.ts +2 -0
  54. package/dist/views/import/helper/import-export.helper.d.ts +4 -0
  55. package/dist/views/ingredients/helper/import-export.helper.d.ts +3 -1
  56. package/dist/views/recipe/RecipeView.vue.d.ts +1 -0
  57. package/dist/views/recipe/components/import-recipes/ImportRecipeItem.vue.d.ts +16 -0
  58. package/dist/views/recipe/components/import-recipes/ImportRecipes.vue.d.ts +2 -0
  59. package/dist/views/recipe/helper/import-recipe.d.ts +48 -0
  60. package/dist/views/unit/UnitView.vue.d.ts +1 -0
  61. package/dist/views/unit/components/import-units/ImportUnitItem.vue.d.ts +12 -0
  62. package/dist/views/unit/components/import-units/ImportUnitItemProps.d.ts +6 -0
  63. package/dist/views/unit/components/import-units/ImportUnits.vue.d.ts +9 -0
  64. package/dist/views/unit/components/import-units/ImportUnitsProps.d.ts +5 -0
  65. package/dist/views/unit/helper/import-export.helper.d.ts +40 -0
  66. package/package.json +3 -3
  67. package/dist/IngredientsView-DQUK8EMq.js +0 -2475
  68. package/dist/RecipeView-BQeJBUvu.js +0 -621
  69. package/dist/UnitView-C1cxS42T.js +0 -667
  70. package/dist/array-Ca8T3f_G.js +0 -44
@@ -1,26 +1,25 @@
1
- import { defineComponent as ce, ref as N, computed as H, resolveComponent as D, openBlock as F, createBlock as K, 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 Ge, 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, a2 as mt, f as He, h as Pe, i as pt, a as Re, F as We, a3 as vt, x as je, l as me, Z as ft, t as Se, a1 as Fe, A as yt, M as _t, a0 as ye, a4 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, $ 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 Et, K as Ht, L as Pt, O as Rt, P as Ot, Q as Nt, T as Qe } from "./app-CsyUwsea.js";
3
- import { u as Oe, a as _e } from "./stock-CL0X5Bnh.js";
4
- import { g as we } from "./decimal-DveC9JMl.js";
5
- import { e as Lt, u as st, i as at, _ as Je } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DdFHN7A8.js";
6
- import { _ as Te, S as Me, g as lt, a as zt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BAcaiBqq.js";
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-DJcCTZjT.js";
3
+ import { u as Oe, a as _e } from "./stock-CK3LBQmj.js";
4
+ import { g as we } from "./decimal-BVu2HlCS.js";
5
+ import { e as Lt, u as st, i as at, _ as Qe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-CyMRTB5L.js";
6
+ import { _ as Te, S as Be, g as lt, a as zt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-3_csD6uU.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
- import { useSnackbar as be, useDialog as Le, useProxiedModel as ze, useBreakpoints as Kt } from "@feedmepos/ui-library";
10
- import { defineStore as Gt } from "pinia";
11
- import { u as Wt } from "./use-inventory-binding-dialog-CpaprD6M.js";
12
- import { _ as qt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B_ASTDtr.js";
9
+ import { useSnackbar as be, useDialog as Le, useProxiedModel as ze, useBreakpoints as Gt } from "@feedmepos/ui-library";
10
+ import { defineStore as Kt } from "pinia";
11
+ import { u as Wt } from "./use-inventory-binding-dialog-CDwm6TPx.js";
12
+ import { _ as qt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B3J0i5IU.js";
13
13
  import { E as Xt } from "./empty-placeholder-wf6-BWE8.js";
14
- import "./array-Ca8T3f_G.js";
15
14
  var ge = /* @__PURE__ */ ((b) => (b.History = "History", b.Convert = "Convert", b.Adjust = "Adjust", b))(ge || {});
16
- const Qt = [
15
+ const Jt = [
17
16
  {
18
17
  translationKey: "inventory.stock.action.history",
19
18
  color: "text-neutral-700",
20
19
  value: "History"
21
20
  /* History */
22
21
  }
23
- ], Jt = [
22
+ ], Qt = [
24
23
  {
25
24
  translationKey: "inventory.stock.action.history",
26
25
  color: "text-neutral-700",
@@ -136,7 +135,7 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
136
135
  ), x = N(!1);
137
136
  return (C, c) => {
138
137
  const l = D("FmIcon"), v = D("FmMenuItem"), $ = D("FmMenu");
139
- return F(), K($, {
138
+ return F(), G($, {
140
139
  "stop-click-propagation": "",
141
140
  onMenuChanged: c[0] || (c[0] = (A) => x.value = A)
142
141
  }, {
@@ -156,7 +155,7 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
156
155
  ], 2)
157
156
  ]),
158
157
  default: I(() => [
159
- (F(!0), O(Z, null, ie(h.value, (A) => (F(), K(v, {
158
+ (F(!0), O(Z, null, ie(h.value, (A) => (F(), G(v, {
160
159
  key: A.value ?? 0,
161
160
  label: A.label,
162
161
  "model-value": d(A),
@@ -171,14 +170,14 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
171
170
  __name: "StockHeaderPreview",
172
171
  setup(b) {
173
172
  const { t: g } = de();
174
- return (p, o) => (F(), K(Yt, null, {
173
+ return (p, o) => (F(), G(Yt, null, {
175
174
  default: I(() => [
176
175
  e("div", tn, _(u(g)("inventory.stock.prediction.daysRemaining")), 1)
177
176
  ]),
178
177
  _: 1
179
178
  }));
180
179
  }
181
- }), it = Gt("stockActions", () => {
180
+ }), it = Kt("stockActions", () => {
182
181
  const b = N(!1), g = ve(), p = Oe(), o = st(), j = be(), h = Le(), { t: d } = de();
183
182
  async function i() {
184
183
  if (g._currentLocation) {
@@ -198,8 +197,8 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
198
197
  }
199
198
  const x = N();
200
199
  async function C(V) {
201
- var B, M, E;
202
- if (!!!((M = (B = V.convert) == null ? void 0 : B.inventoryBindings) != null && M.length)) {
200
+ var M, B, E;
201
+ if (!!!((B = (M = V.convert) == null ? void 0 : M.inventoryBindings) != null && B.length)) {
203
202
  h.open({
204
203
  title: d("inventory.stock.error.convert.title"),
205
204
  message: d("inventory.stock.error.convert.message")
@@ -331,7 +330,7 @@ function on() {
331
330
  return pe(Te, {
332
331
  days: i
333
332
  });
334
- const c = i <= x ? Me.low : i <= C ? Me.mid : Me.high;
333
+ const c = i <= x ? Be.low : i <= C ? Be.mid : Be.high;
335
334
  return pe(Te, {
336
335
  days: i,
337
336
  level: c
@@ -344,7 +343,7 @@ function on() {
344
343
  cell(d) {
345
344
  var i;
346
345
  return pt(
347
- ((i = b._currentLocation) == null ? void 0 : i.type) === "restaurant" ? Qt : Jt,
346
+ ((i = b._currentLocation) == null ? void 0 : i.type) === "restaurant" ? Jt : Qt,
348
347
  (x) => g.onActionMenu(x, d.row.original)
349
348
  );
350
349
  },
@@ -423,7 +422,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
423
422
  y && (c.value = 0);
424
423
  });
425
424
  function n() {
426
- J(o.sku, Se(c.value), l.value);
425
+ Q(o.sku, Se(c.value), l.value);
427
426
  }
428
427
  function r(y) {
429
428
  if (l.value)
@@ -439,7 +438,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
439
438
  }) ?? null : null, s = je(o.sku.unit, t), f = bt(+y);
440
439
  return Ze(f).isInteger().max(s).error ? "Precision cannot be more than " + s : !0;
441
440
  }
442
- const B = H(
441
+ const M = H(
443
442
  () => {
444
443
  var y, t;
445
444
  return (y = o.sku.convert) != null && y.measurement ? (t = o.sku.unit.measurements.find((s) => {
@@ -447,7 +446,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
447
446
  return s.id === ((f = o.sku.convert) == null ? void 0 : f.measurement);
448
447
  })) == null ? void 0 : t.abbrev : o.sku.unit.abbrev;
449
448
  }
450
- ), M = H(() => {
449
+ ), B = H(() => {
451
450
  var f, m;
452
451
  const t = vt({
453
452
  bindings: ((f = o.sku.convert) == null ? void 0 : f.inventoryBindings) ?? [],
@@ -458,15 +457,15 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
458
457
  return (m = l.value ?? t) == null ? void 0 : m.map((a) => {
459
458
  var ae, re, q, ee, Ye;
460
459
  const S = d.skus.find((fe) => fe._id === a.id), U = ((ae = a.measurement) == null ? void 0 : ae.abbrev) ?? ((re = S == null ? void 0 : S.unit) == null ? void 0 : re.abbrev), z = (q = o.sku.convert) != null && q.measurement ? o.sku.unit.measurements.find((fe) => {
461
- var Ke;
462
- return fe.id === ((Ke = o.sku.convert) == null ? void 0 : Ke.measurement);
460
+ var Ge;
461
+ return fe.id === ((Ge = o.sku.convert) == null ? void 0 : Ge.measurement);
463
462
  }) ?? null : null, se = je(o.sku.unit, z), T = w(`${c.value}`) === !0 ? me(
464
463
  ft(
465
464
  a.amount,
466
465
  Se(+c.value, se)
467
466
  ),
468
467
  !1
469
- ) : "0", G = (Ye = (ee = l.value) == null ? void 0 : ee.find((fe) => fe.id === (S == null ? void 0 : S._id))) == null ? void 0 : Ye.amount, W = G ? me(G, !1) : null;
468
+ ) : "0", K = (Ye = (ee = l.value) == null ? void 0 : ee.find((fe) => fe.id === (S == null ? void 0 : S._id))) == null ? void 0 : Ye.amount, W = K ? me(K, !1) : null;
470
469
  return {
471
470
  sku: S,
472
471
  convertAmount: W ?? T,
@@ -489,7 +488,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
489
488
  }
490
489
  });
491
490
  const P = ze(o, "show");
492
- async function J(y, t, s) {
491
+ async function Q(y, t, s) {
493
492
  V.value = !0;
494
493
  try {
495
494
  await i.convertSku({
@@ -518,7 +517,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
518
517
  V.value = !1;
519
518
  }
520
519
  }
521
- function Q(y, t, s) {
520
+ function J(y, t, s) {
522
521
  const f = +t;
523
522
  let m = s;
524
523
  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;
@@ -569,7 +568,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
569
568
  }
570
569
  ), (y, t) => {
571
570
  const s = D("FmTextField"), f = D("FmForm"), m = D("FmCard"), a = D("FmSwitch"), S = D("FmFormGroup"), U = D("FmSelect"), z = D("FmButton"), se = D("FmSideSheet");
572
- return F(), K(se, {
571
+ return F(), G(se, {
573
572
  "dismiss-away": "",
574
573
  modelValue: u(P),
575
574
  "onUpdate:modelValue": t[3] || (t[3] = (T) => Ue(P) ? P.value = T : null),
@@ -594,8 +593,8 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
594
593
  "onUpdate:modelValue": t[0] || (t[0] = (T) => c.value = T),
595
594
  label: u(C)("inventory.stock.convert.amount"),
596
595
  rules: [r, w, u(Fe)(0)],
597
- "append-text": B.value,
598
- "helper-text": l.value ? void 0 : `Max ${y.maxCount} ${B.value}`
596
+ "append-text": M.value,
597
+ "helper-text": l.value ? void 0 : `Max ${y.maxCount} ${M.value}`
599
598
  }, null, 8, ["disabled", "model-value", "label", "rules", "append-text", "helper-text"])
600
599
  ]),
601
600
  _: 1
@@ -607,10 +606,10 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
607
606
  default: I(() => [
608
607
  e("div", un, [
609
608
  e("div", cn, _(u(C)("inventory.stock.convert.deductionSummary")), 1),
610
- (F(!0), O(Z, null, ie(M.value, (T) => {
611
- var G, W;
609
+ (F(!0), O(Z, null, ie(B.value, (T) => {
610
+ var K, W;
612
611
  return F(), O("div", {
613
- key: (G = T.sku) == null ? void 0 : G._id,
612
+ key: (K = T.sku) == null ? void 0 : K._id,
614
613
  class: "flex items-center"
615
614
  }, [
616
615
  e("div", dn, _((W = T.sku) == null ? void 0 : W.name), 1),
@@ -638,19 +637,19 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
638
637
  }, null, 8, ["modelValue", "rules"]),
639
638
  e("div", vn, [
640
639
  e("div", fn, _(u(C)("inventory.stock.convert.ingredients")), 1),
641
- (F(!0), O(Z, null, ie(l.value, (T) => (F(), K(S, {
640
+ (F(!0), O(Z, null, ie(l.value, (T) => (F(), G(S, {
642
641
  key: T.id,
643
642
  disabled: V.value,
644
643
  modelValue: +u(me)(T.amount ?? { amount: 1, precision: 0 }),
645
644
  rules: [
646
645
  u(_t)(
647
- v.value.find((G) => G._id === T.id).unit,
646
+ v.value.find((K) => K._id === T.id).unit,
648
647
  T.measurement
649
648
  ),
650
649
  u(Fe)(0)
651
650
  ]
652
651
  }, {
653
- default: I(({ invalid: G }) => {
652
+ default: I(({ invalid: K }) => {
654
653
  var W, ae, re;
655
654
  return [
656
655
  e("div", yn, [
@@ -661,8 +660,8 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
661
660
  modelValue: +u(me)(
662
661
  T.amount ?? { amount: 1, precision: 0 }
663
662
  ),
664
- "onUpdate:modelValue": (q) => Q(T.id, q, l.value ?? []),
665
- invalid: G
663
+ "onUpdate:modelValue": (q) => J(T.id, q, l.value ?? []),
664
+ invalid: K
666
665
  }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
667
666
  k(U, {
668
667
  disabled: V.value,
@@ -670,7 +669,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
670
669
  items: R(T.id),
671
670
  "model-value": (re = oe(T.id, (ae = T.measurement) == null ? void 0 : ae.id)) == null ? void 0 : re.value,
672
671
  "onUpdate:modelValue": (q) => L(T.id, q, l.value ?? []),
673
- invalid: G
672
+ invalid: K
674
673
  }, {
675
674
  "helper-text": I(() => t[4] || (t[4] = [])),
676
675
  _: 2
@@ -709,8 +708,8 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
709
708
  loading: V.value,
710
709
  label: u(C)("inventory.stock.convert.convertButton"),
711
710
  onClick: t[2] || (t[2] = (T) => {
712
- var G, W;
713
- return (W = (G = E.value) == null ? void 0 : G.validateInputs) == null ? void 0 : W.call(G);
711
+ var K, W;
712
+ return (W = (K = E.value) == null ? void 0 : K.validateInputs) == null ? void 0 : W.call(K);
714
713
  })
715
714
  }, null, 8, ["loading", "label"])
716
715
  ])
@@ -815,7 +814,7 @@ const Ie = {
815
814
  });
816
815
  return (c, l) => {
817
816
  const v = D("FmButton"), $ = D("FmSelect"), A = D("FmTextarea"), V = D("FmCard");
818
- return F(), K(V, {
817
+ return F(), G(V, {
819
818
  variant: "outlined",
820
819
  class: "grid grid-cols-2 gap-8 p-16"
821
820
  }, {
@@ -884,16 +883,16 @@ const Ie = {
884
883
  const v = N();
885
884
  g({
886
885
  validateInputs: () => {
887
- var w, B;
888
- (B = (w = v.value) == null ? void 0 : w.validateInputs) == null || B.call(w);
886
+ var w, M;
887
+ (M = (w = v.value) == null ? void 0 : w.validateInputs) == null || M.call(w);
889
888
  },
890
889
  resetInputsValidation: () => {
891
- var w, B;
892
- (B = (w = v.value) == null ? void 0 : w.resetInputsValidation) == null || B.call(w);
890
+ var w, M;
891
+ (M = (w = v.value) == null ? void 0 : w.resetInputsValidation) == null || M.call(w);
893
892
  },
894
893
  resetInputs: () => {
895
- var w, B;
896
- (B = (w = v.value) == null ? void 0 : w.resetInputs) == null || B.call(w);
894
+ var w, M;
895
+ (M = (w = v.value) == null ? void 0 : w.resetInputs) == null || M.call(w);
897
896
  }
898
897
  });
899
898
  const $ = ze(o, "show"), A = ut({
@@ -926,37 +925,37 @@ const Ie = {
926
925
  try {
927
926
  await i.adjustSku({
928
927
  remark: w.remark,
929
- adjustments: w.adjustments.map(({ doc: B, remark: M, type: E, amount: P, measurement: J }) => ({
930
- id: B._id,
928
+ adjustments: w.adjustments.map(({ doc: M, remark: B, type: E, amount: P, measurement: Q }) => ({
929
+ id: M._id,
931
930
  amount: P,
932
- measurement: J,
933
- remark: M,
934
- doc: B,
931
+ measurement: Q,
932
+ remark: B,
933
+ doc: M,
935
934
  type: E
936
935
  }))
937
936
  }), j("update:show", !1), j("submitted");
938
- } catch (B) {
937
+ } catch (M) {
939
938
  x.open({
940
939
  title: c("inventory.stock.adjust.error.title"),
941
940
  message: c("inventory.stock.adjust.error.message"),
942
941
  type: "error"
943
- }), console.log("error on adjust ingredients", w, B);
942
+ }), console.log("error on adjust ingredients", w, M);
944
943
  } finally {
945
944
  C.value = !1;
946
945
  }
947
946
  }
948
947
  function n() {
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((E) => E.doc._id === M.value)).map((M) => M.value);
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);
954
953
  d.open({
955
954
  title: "Select ingredients",
956
955
  contentComponent: ht,
957
956
  contentComponentProps: {
958
957
  items: w,
959
- modelValue: B
958
+ modelValue: M
960
959
  },
961
960
  overlay: !0,
962
961
  closeButton: !0,
@@ -970,8 +969,8 @@ const Ie = {
970
969
  close: !0,
971
970
  variant: "tertiary"
972
971
  }
973
- }).onPrimary((M) => {
974
- A.adjustments = M.map(
972
+ }).onPrimary((B) => {
973
+ A.adjustments = B.map(
975
974
  (E) => A.adjustments.find((P) => P.doc._id === E) ?? {
976
975
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
977
976
  type: ne.enum.PURCHASE,
@@ -986,11 +985,11 @@ const Ie = {
986
985
  function r(w) {
987
986
  A.adjustments.splice(w, 1);
988
987
  }
989
- return (w, B) => {
990
- const M = D("FmTextarea"), E = D("FmButton"), P = D("FmForm"), J = D("FmSideSheet");
991
- return F(), K(J, {
988
+ return (w, M) => {
989
+ const B = D("FmTextarea"), E = D("FmButton"), P = D("FmForm"), Q = D("FmSideSheet");
990
+ return F(), G(Q, {
992
991
  modelValue: u($),
993
- "onUpdate:modelValue": B[2] || (B[2] = (Q) => Ue($) ? $.value = Q : null),
992
+ "onUpdate:modelValue": M[2] || (M[2] = (J) => Ue($) ? $.value = J : null),
994
993
  "dismiss-away": "",
995
994
  "max-width": 500
996
995
  }, {
@@ -1007,10 +1006,10 @@ const Ie = {
1007
1006
  onValidationSuccess: l
1008
1007
  }, {
1009
1008
  default: I(() => [
1010
- k(M, {
1009
+ k(B, {
1011
1010
  label: u(c)("inventory.stock.adjust.remark"),
1012
1011
  modelValue: A.remark,
1013
- "onUpdate:modelValue": B[0] || (B[0] = (Q) => A.remark = Q)
1012
+ "onUpdate:modelValue": M[0] || (M[0] = (J) => A.remark = J)
1014
1013
  }, null, 8, ["label", "modelValue"]),
1015
1014
  e("div", wn, [
1016
1015
  e("div", $n, _(u(c)("inventory.stock.adjust.adjustedItems")), 1),
@@ -1021,8 +1020,8 @@ const Ie = {
1021
1020
  onClick: n
1022
1021
  })
1023
1022
  ]),
1024
- (F(!0), O(Z, null, ie(A.adjustments, (Q, R) => (F(), K(xn, {
1025
- key: Q.id,
1023
+ (F(!0), O(Z, null, ie(A.adjustments, (J, R) => (F(), G(xn, {
1024
+ key: J.id,
1026
1025
  modelValue: A.adjustments[R],
1027
1026
  "onUpdate:modelValue": (oe) => A.adjustments[R] = oe,
1028
1027
  "onClick:delete": (oe) => r(R)
@@ -1036,7 +1035,7 @@ const Ie = {
1036
1035
  k(E, {
1037
1036
  label: u(c)("inventory.stock.adjust.adjustButton"),
1038
1037
  loading: C.value,
1039
- onClick: B[1] || (B[1] = (Q) => {
1038
+ onClick: M[1] || (M[1] = (J) => {
1040
1039
  var R, oe;
1041
1040
  return (oe = (R = v.value) == null ? void 0 : R.validateInputs) == null ? void 0 : oe.call(R);
1042
1041
  })
@@ -1064,18 +1063,18 @@ const Ie = {
1064
1063
  };
1065
1064
  return await g.post(h, d);
1066
1065
  }
1067
- })), Bn = {
1066
+ })), Mn = {
1068
1067
  key: 0,
1069
1068
  class: "flex justify-center items-center h-32"
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" }, 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({
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({
1071
1070
  __name: "AmendAdjustmentForm",
1072
- props: /* @__PURE__ */ Ge({
1071
+ props: /* @__PURE__ */ Ke({
1073
1072
  adjustmentId: {}
1074
1073
  }, {
1075
1074
  modelValue: {},
1076
1075
  modelModifiers: {}
1077
1076
  }),
1078
- emits: /* @__PURE__ */ Ge(["refreshHistory"], ["update:modelValue"]),
1077
+ emits: /* @__PURE__ */ Ke(["refreshHistory"], ["update:modelValue"]),
1079
1078
  setup(b, { emit: g }) {
1080
1079
  const p = b, o = g, j = _e(), h = ct(b, "modelValue"), d = N(!1), i = N(!1), x = N(!1), C = N({
1081
1080
  _id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
@@ -1091,12 +1090,12 @@ const Ie = {
1091
1090
  var r, w;
1092
1091
  if ((w = (r = c == null ? void 0 : c.value) == null ? void 0 : r.validateInputs) == null || w.call(r), !i.value) return;
1093
1092
  const n = {};
1094
- Object.keys(h.value || {}).forEach((B) => {
1095
- var M;
1096
- Object.keys(((M = h.value) == null ? void 0 : M[B]) || {}).forEach((E) => {
1097
- var J, Q;
1098
- const P = (Q = (J = h.value) == null ? void 0 : J[B]) == null ? void 0 : Q[Number(E)];
1099
- P && $(P.amount) > 0 && (n[B] || (n[B] = []), n[B].push(P));
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));
1100
1099
  });
1101
1100
  }), await j.revertWastageAdjustment({
1102
1101
  targetWastageAdjustmentId: p.adjustmentId,
@@ -1106,18 +1105,18 @@ const Ie = {
1106
1105
  function v(n, r, w) {
1107
1106
  return H({
1108
1107
  get: () => {
1109
- var M, E, P;
1110
- const B = (P = (E = (M = h.value) == null ? void 0 : M[n]) == null ? void 0 : E[r]) == null ? void 0 : P.amount;
1111
- return B ? $(B, !0) : 0;
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;
1112
1111
  },
1113
- set: (B) => {
1112
+ set: (M) => {
1114
1113
  h.value || (h.value = {});
1115
- const M = { ...h.value };
1116
- M[n] || (M[n] = {}), M[n][r] = {
1117
- amount: Ce.fromNumber(B),
1114
+ const B = { ...h.value };
1115
+ B[n] || (B[n] = {}), B[n][r] = {
1116
+ amount: Ce.fromNumber(M),
1118
1117
  type: ne.Enum.WASTAGE,
1119
1118
  measurement: w
1120
- }, h.value = M;
1119
+ }, h.value = B;
1121
1120
  }
1122
1121
  });
1123
1122
  }
@@ -1132,8 +1131,8 @@ const Ie = {
1132
1131
  return r === 0 ? "N/A" : (n + r).toString();
1133
1132
  }
1134
1133
  return (n, r) => {
1135
- const w = D("FmIcon"), B = D("FmStepperField"), M = D("FmCard"), E = D("FmForm"), P = D("FmSpacer"), J = D("FmButton"), Q = D("FmDialog");
1136
- return F(), K(Q, {
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, {
1137
1136
  modelValue: x.value,
1138
1137
  "onUpdate:modelValue": r[4] || (r[4] = (R) => x.value = R),
1139
1138
  overlay: !0
@@ -1162,14 +1161,14 @@ const Ie = {
1162
1161
  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)),
1163
1162
  e("div", Pn, [
1164
1163
  k(P),
1165
- k(J, {
1164
+ k(Q, {
1166
1165
  class: "sm:w-full xs:w-full",
1167
1166
  label: "Close",
1168
1167
  size: "md",
1169
1168
  variant: "tertiary",
1170
1169
  onClick: r[3] || (r[3] = (R) => x.value = !1)
1171
1170
  }),
1172
- k(J, {
1171
+ k(Q, {
1173
1172
  class: "sm:w-full xs:w-full",
1174
1173
  label: "Submit",
1175
1174
  size: "md",
@@ -1180,7 +1179,7 @@ const Ie = {
1180
1179
  ])
1181
1180
  ]),
1182
1181
  default: I(() => [
1183
- d.value ? (F(), O("div", Bn)) : (F(), K(E, {
1182
+ d.value ? (F(), O("div", Mn)) : (F(), G(E, {
1184
1183
  key: 1,
1185
1184
  ref_key: "formRef",
1186
1185
  ref: c,
@@ -1193,14 +1192,14 @@ const Ie = {
1193
1192
  blameFormChildOnValidationFailed: ""
1194
1193
  }, {
1195
1194
  default: I(() => [
1196
- e("p", Mn, [
1195
+ e("p", Bn, [
1197
1196
  r[6] || (r[6] = e("b", null, "Date:", -1)),
1198
1197
  r[7] || (r[7] = e("br", null, null, -1)),
1199
1198
  ue(" " + _(u(St)(u(Ft)(C.value._id))), 1)
1200
1199
  ]),
1201
1200
  e("div", Dn, [
1202
1201
  (F(!0), O(Z, null, ie(C.value.skus, (R, oe) => (F(), O(Z, { key: oe }, [
1203
- (F(!0), O(Z, null, ie(R.amounts, (L, Y) => (F(), K(M, {
1202
+ (F(!0), O(Z, null, ie(R.amounts, (L, Y) => (F(), G(B, {
1204
1203
  key: Y,
1205
1204
  variant: "outlined",
1206
1205
  class: "p-2"
@@ -1219,7 +1218,7 @@ const Ie = {
1219
1218
  r[9] || (r[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
1220
1219
  e("span", null, _(u(Ce).toFormatString({ value: L.amount })) + " " + _(A(R, L)), 1)
1221
1220
  ]),
1222
- k(B, {
1221
+ k(M, {
1223
1222
  "model-value": v(R.sku._id, Y).value,
1224
1223
  "onUpdate:modelValue": (le) => v(R.sku._id, Y).value = le,
1225
1224
  class: "mb-3",
@@ -1255,16 +1254,16 @@ const Ie = {
1255
1254
  }), On = { class: "p-16" }, Nn = { class: "fm-typo-en-body-md-600 flex-grow" }, Ln = { class: "flex-grow text-fm-color-typo-secondary" }, zn = {
1256
1255
  key: 0,
1257
1256
  class: "my-5"
1258
- }, Yn = { class: "text-neutral-400" }, Kn = { class: "flex-grow" }, Gn = { class: "flex gap-1" }, Wn = { class: "flex flex-col gap-1" }, qn = {
1257
+ }, Yn = { class: "text-neutral-400" }, Gn = { class: "flex-grow" }, Kn = { class: "flex gap-1" }, Wn = { class: "flex flex-col gap-1" }, qn = {
1259
1258
  key: 1,
1260
1259
  class: "t-system text-fsecondary"
1261
1260
  }, Xn = {
1262
1261
  key: 2,
1263
1262
  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"
1264
- }, Qn = {
1263
+ }, Jn = {
1265
1264
  key: 1,
1266
1265
  class: "shrink-0 text-fm-color-typo-secondary"
1267
- }, Jn = /* @__PURE__ */ ce({
1266
+ }, Qn = /* @__PURE__ */ ce({
1268
1267
  __name: "StockRecordCard",
1269
1268
  props: {
1270
1269
  record: {},
@@ -1337,7 +1336,7 @@ const Ie = {
1337
1336
  })));
1338
1337
  return (c, l) => {
1339
1338
  const v = D("FmIcon"), $ = D("FmTooltip"), A = D("FmCard");
1340
- return F(), K(A, { variant: "outlined" }, {
1339
+ return F(), G(A, { variant: "outlined" }, {
1341
1340
  default: I(() => [
1342
1341
  e("div", On, [
1343
1342
  e("div", {
@@ -1381,14 +1380,14 @@ const Ie = {
1381
1380
  class: "flex gap-1 w-full"
1382
1381
  }, [
1383
1382
  e("div", Yn, _(V.time), 1),
1384
- e("div", Kn, [
1383
+ e("div", Gn, [
1385
1384
  (F(!0), O(Z, null, ie(V.adjustments, (n) => (F(), O("div", {
1386
1385
  key: n.name,
1387
1386
  class: "flex gap-1"
1388
1387
  }, [
1389
- e("div", Gn, [
1388
+ e("div", Kn, [
1390
1389
  ue(_(u(x)(`inventory.inventoryAdjustment.type.${n.name}`)) + " ", 1),
1391
- n.backdateFrom ? (F(), K($, {
1390
+ n.backdateFrom ? (F(), G($, {
1392
1391
  key: 0,
1393
1392
  variant: "plain",
1394
1393
  placement: "top",
@@ -1418,12 +1417,12 @@ const Ie = {
1418
1417
  "ml-auto": !0
1419
1418
  })
1420
1419
  }, _(n.amount), 3),
1421
- n.name === u(ne).Enum.WASTAGE ? (F(), K(Rn, {
1420
+ n.name === u(ne).Enum.WASTAGE ? (F(), G(Rn, {
1422
1421
  key: 0,
1423
1422
  adjustmentId: n.adjustmentId,
1424
1423
  onRefreshHistory: l[1] || (l[1] = (r) => c.$emit("refreshHistory"))
1425
1424
  }, null, 8, ["adjustmentId"])) : te("", !0),
1426
- n.cost ? (F(), O("div", Qn, " (" + _(u(ke)(n.cost, !1, n.cost.precision)) + ") ", 1)) : te("", !0)
1425
+ n.cost ? (F(), O("div", Jn, " (" + _(u(ke)(n.cost, !1, n.cost.precision)) + ") ", 1)) : te("", !0)
1427
1426
  ]))), 128))
1428
1427
  ])
1429
1428
  ]))), 128))
@@ -1503,13 +1502,13 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1503
1502
  }, uo = { class: "pb-16" }, co = { class: "fm-typo-cn-body-lg-600" }, mo = {
1504
1503
  class: "grid gap-12 fm-typo-en-body-md-400",
1505
1504
  style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
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" }, Eo = { class: "flex flex-col gap-1" }, Ho = { class: "text-fm-color-typo-secondary" }, Po = { class: "font-bold" }, Ro = {
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 = {
1507
1506
  key: 0,
1508
1507
  class: "flex flex-col gap-8"
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" }, Ko = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Go = { class: "flex flex-col gap-1" }, Wo = { class: "font-bold" }, qo = {
1508
+ }, 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 = {
1510
1509
  key: 2,
1511
1510
  class: "flex-1 flex flex-col items-center gap-8"
1512
- }, Xo = ["src"], Qo = { class: "font-bold text-lg" }, Jo = { class: "text-xs text-neutral-400 text-center" }, Zo = /* @__PURE__ */ ce({
1511
+ }, Xo = ["src"], Jo = { class: "font-bold text-lg" }, Qo = { class: "text-xs text-neutral-400 text-center" }, Zo = /* @__PURE__ */ ce({
1513
1512
  __name: "StockHistory",
1514
1513
  props: {
1515
1514
  sku: {},
@@ -1517,7 +1516,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1517
1516
  },
1518
1517
  emits: ["update:show"],
1519
1518
  setup(b) {
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));
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));
1521
1520
  async function v() {
1522
1521
  C.value = !0;
1523
1522
  try {
@@ -1560,18 +1559,18 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1560
1559
  async function w() {
1561
1560
  let t = await o.readStockAdjustment(
1562
1561
  x.sku._id,
1563
- Mt(new Date(l.value.startDate)).toISOString(),
1562
+ Bt(new Date(l.value.startDate)).toISOString(),
1564
1563
  Dt(new Date(l.value.endDate)).toISOString()
1565
1564
  );
1566
1565
  $.value = t;
1567
1566
  const s = t.filter(({ ref: f }) => f == null ? void 0 : f.startsWith("bill_")).map(({ ref: f }) => f);
1568
- await B(s), A.value = r(t, "day").map(({ date: f, adjustments: m }) => ({
1567
+ await M(s), A.value = r(t, "day").map(({ date: f, adjustments: m }) => ({
1569
1568
  date: f,
1570
1569
  adjustments: m,
1571
1570
  adjustmentsByTime: r(m, "minute")
1572
1571
  }));
1573
1572
  }
1574
- async function B(t) {
1573
+ async function M(t) {
1575
1574
  t.length && (V.value = await j.findBillsById(t).catch((s) => {
1576
1575
  var a;
1577
1576
  console.error("Error on using latest bill API, retrying using legacy api", s);
@@ -1579,7 +1578,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1579
1578
  return j.findBillsByBusinessId(f, [m], t);
1580
1579
  }));
1581
1580
  }
1582
- const M = H(() => {
1581
+ const B = H(() => {
1583
1582
  const t = $.value, s = x.sku;
1584
1583
  return Zn(t, s);
1585
1584
  }), E = H(() => {
@@ -1598,7 +1597,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1598
1597
  value: t,
1599
1598
  precision: 4
1600
1599
  })} ${s.unit.abbrev}` : "";
1601
- }), J = H(() => {
1600
+ }), Q = H(() => {
1602
1601
  const t = [...$.value].reverse().computeFirst((f) => {
1603
1602
  var a, S;
1604
1603
  const m = (S = (a = f.skus) == null ? void 0 : a.find) == null ? void 0 : S.call(a, (U) => U.sku._id === x.sku._id);
@@ -1608,7 +1607,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1608
1607
  precision: 0
1609
1608
  }, s = x.sku;
1610
1609
  return s ? `${X.toFormatString({ value: t, precision: 4 })} ${s.unit.abbrev}` : "";
1611
- }), Q = H(() => {
1610
+ }), J = H(() => {
1612
1611
  var f;
1613
1612
  const s = $.value.flatMap((m) => {
1614
1613
  var a;
@@ -1629,7 +1628,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1629
1628
  {
1630
1629
  amount: 0,
1631
1630
  precision: 0,
1632
- currency: Be((f = g.currentCountry) == null ? void 0 : f.value)
1631
+ currency: Me((f = g.currentCountry) == null ? void 0 : f.value)
1633
1632
  }
1634
1633
  );
1635
1634
  return ke(s, !1, s.precision);
@@ -1643,9 +1642,9 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1643
1642
  }
1644
1643
  const oe = H(() => x.sku.valuation === Xe.Enum.FIFO ? i("inventory.ingredient.valuationMethod.FIFO") : i("inventory.ingredient.valuationMethod.WAVG")), L = H(() => {
1645
1644
  var U, z, se, T;
1646
- const t = [...$.value].reverse().computeFirst((G) => {
1645
+ const t = [...$.value].reverse().computeFirst((K) => {
1647
1646
  var W, ae;
1648
- return (ae = (W = G.skus) == null ? void 0 : W.find) == null ? void 0 : ae.call(W, (re) => re.sku._id === x.sku._id);
1647
+ return (ae = (W = K.skus) == null ? void 0 : W.find) == null ? void 0 : ae.call(W, (re) => re.sku._id === x.sku._id);
1649
1648
  });
1650
1649
  if (!t) return "No data";
1651
1650
  const s = [...t.amounts].reverse()[0], f = {
@@ -1654,7 +1653,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1654
1653
  }, m = s.amount, a = m.amount == 0 ? X.fromNumber(0) : X.divide([f, m]);
1655
1654
  return {
1656
1655
  ...X.multiply([a, m]),
1657
- currency: ((se = s.cost) == null ? void 0 : se.currency) || Be(((T = g.currentCountry) == null ? void 0 : T.value) ?? Ct)
1656
+ currency: ((se = s.cost) == null ? void 0 : se.currency) || Me(((T = g.currentCountry) == null ? void 0 : T.value) ?? Ct)
1658
1657
  };
1659
1658
  }), Y = H(() => {
1660
1659
  var f;
@@ -1668,7 +1667,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1668
1667
  amount: 0,
1669
1668
  precision: 0
1670
1669
  }),
1671
- currency: Be((f = g.currentCountry) == null ? void 0 : f.value)
1670
+ currency: Me((f = g.currentCountry) == null ? void 0 : f.value)
1672
1671
  } : "No data";
1673
1672
  });
1674
1673
  function le() {
@@ -1680,8 +1679,8 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1680
1679
  }
1681
1680
  const y = ze(x, "show");
1682
1681
  return (t, s) => {
1683
- const f = D("FmButton"), m = D("FmField"), a = D("FmDateRangePicker"), S = D("FmSpacer"), U = D("FmCircularProgress"), z = D("FmIcon"), se = D("FmTooltip"), T = D("FmMenuDivider"), G = D("FmChip"), W = D("FmCardSection"), ae = D("FmCard"), re = D("FmSideSheet");
1684
- return F(), K(re, {
1682
+ const f = D("FmButton"), m = D("FmField"), a = D("FmDateRangePicker"), S = D("FmSpacer"), U = D("FmCircularProgress"), z = D("FmIcon"), se = D("FmTooltip"), T = D("FmMenuDivider"), K = D("FmChip"), W = D("FmCardSection"), ae = D("FmCard"), re = D("FmSideSheet");
1683
+ return F(), G(re, {
1685
1684
  "dismiss-away": "",
1686
1685
  modelValue: u(y),
1687
1686
  "onUpdate:modelValue": s[4] || (s[4] = (q) => Ue(y) ? y.value = q : null),
@@ -1754,12 +1753,12 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1754
1753
  e("div", mo, [
1755
1754
  e("div", po, [
1756
1755
  e("div", vo, _(u(i)("inventory.stock.history.summary.totalPurchase")), 1),
1757
- e("div", fo, _(M.value.PURCHASE), 1)
1756
+ e("div", fo, _(B.value.PURCHASE), 1)
1758
1757
  ]),
1759
1758
  e("div", yo, [
1760
1759
  e("div", _o, [
1761
1760
  ue(_(u(i)("inventory.stock.history.summary.totalSales")) + "  ", 1),
1762
- E.value != null ? (F(), K(se, {
1761
+ E.value != null ? (F(), G(se, {
1763
1762
  key: 0,
1764
1763
  variant: "plain",
1765
1764
  placement: "top",
@@ -1775,27 +1774,27 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1775
1774
  _: 1
1776
1775
  }, 8, ["content"])) : te("", !0)
1777
1776
  ]),
1778
- e("div", bo, _(M.value.SALES), 1)
1777
+ e("div", bo, _(B.value.SALES), 1)
1779
1778
  ]),
1780
1779
  e("div", ko, [
1781
1780
  e("div", go, _(u(i)("inventory.stock.history.summary.totalLose")), 1),
1782
- e("div", ho, _(M.value.LOSE), 1)
1781
+ e("div", ho, _(B.value.LOSE), 1)
1783
1782
  ]),
1784
1783
  e("div", xo, [
1785
1784
  e("div", So, _(u(i)("inventory.stock.history.summary.totalRequest")), 1),
1786
- e("div", Fo, _(M.value.REQUEST), 1)
1785
+ e("div", Fo, _(B.value.REQUEST), 1)
1787
1786
  ]),
1788
1787
  e("div", wo, [
1789
1788
  e("div", $o, _(u(i)("inventory.stock.history.summary.totalReceive")), 1),
1790
- e("div", Ao, _(M.value.RECEIVE), 1)
1789
+ e("div", Ao, _(B.value.RECEIVE), 1)
1791
1790
  ]),
1792
1791
  e("div", Vo, [
1793
1792
  e("div", Co, _(u(i)("inventory.stock.history.summary.totalConvert")), 1),
1794
- e("div", Bo, _(M.value.CONVERT), 1)
1793
+ e("div", Mo, _(B.value.CONVERT), 1)
1795
1794
  ]),
1796
- e("div", Mo, [
1795
+ e("div", Bo, [
1797
1796
  e("div", Do, _(u(i)("inventory.stock.history.summary.totalDamage")), 1),
1798
- e("div", Io, _(M.value.DAMAGE), 1)
1797
+ e("div", Io, _(B.value.DAMAGE), 1)
1799
1798
  ]),
1800
1799
  e("div", jo, [
1801
1800
  e("div", To, _(u(i)("inventory.stock.history.summary.openingBalance")), 1),
@@ -1803,14 +1802,14 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1803
1802
  ]),
1804
1803
  e("div", Eo, [
1805
1804
  e("div", Ho, _(u(i)("inventory.stock.history.summary.lastStockBalance")), 1),
1806
- e("div", Po, _(J.value), 1)
1805
+ e("div", Po, _(Q.value), 1)
1807
1806
  ])
1808
1807
  ]),
1809
1808
  u(d).enableTotalCost ? (F(), O("div", Ro, [
1810
1809
  k(T, { class: "w-full" }),
1811
1810
  e("div", Oo, [
1812
1811
  e("div", No, [
1813
- k(Je, { "z-index": 50 }, {
1812
+ k(Qe, { "z-index": 50 }, {
1814
1813
  default: I(() => [
1815
1814
  e("div", Lo, [
1816
1815
  ue(_(u(i)("inventory.stock.history.estimatedValue")) + " ", 1),
@@ -1834,7 +1833,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1834
1833
  }),
1835
1834
  e("div", zo, [
1836
1835
  t.sku.valuation === u(Xe).Enum.FIFO ? (F(), O(Z, { key: 0 }, [
1837
- k(G, {
1836
+ k(K, {
1838
1837
  label: "FIFO",
1839
1838
  compact: ""
1840
1839
  }),
@@ -1853,9 +1852,9 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1853
1852
  ])
1854
1853
  ]),
1855
1854
  e("div", Yo, [
1856
- k(Je, { "z-index": 50 }, {
1855
+ k(Qe, { "z-index": 50 }, {
1857
1856
  default: I(() => [
1858
- e("div", Ko, [
1857
+ e("div", Go, [
1859
1858
  ue(_(u(i)("inventory.stock.history.costSold")) + " ", 1),
1860
1859
  k(se, {
1861
1860
  variant: "plain",
@@ -1863,7 +1862,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1863
1862
  "z-index": 50
1864
1863
  }, {
1865
1864
  content: I(() => [
1866
- e("div", Go, _(u(i)("inventory.stock.history.costSoldTooltip")), 1)
1865
+ e("div", Ko, _(u(i)("inventory.stock.history.costSoldTooltip")), 1)
1867
1866
  ]),
1868
1867
  default: I(() => [
1869
1868
  k(z, {
@@ -1877,7 +1876,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1877
1876
  ]),
1878
1877
  _: 1
1879
1878
  }),
1880
- e("div", Wo, _(Q.value), 1)
1879
+ e("div", Wo, _(J.value), 1)
1881
1880
  ])
1882
1881
  ])
1883
1882
  ])) : te("", !0)
@@ -1891,7 +1890,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1891
1890
  (F(!0), O(Z, null, ie(A.value, (ee) => (F(), O(Z, {
1892
1891
  key: ee.date
1893
1892
  }, [
1894
- t.sku ? (F(), K(Jn, {
1893
+ t.sku ? (F(), G(Qn, {
1895
1894
  key: 0,
1896
1895
  record: ee,
1897
1896
  sku: t.sku,
@@ -1907,8 +1906,8 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1907
1906
  alt: "List is empty"
1908
1907
  }, null, 8, Xo)
1909
1908
  ]),
1910
- e("div", Qo, _(u(i)("inventory.stock.history.noRecords")), 1),
1911
- e("div", Jo, _(u(i)("inventory.stock.history.changeDateRange")), 1),
1909
+ e("div", Jo, _(u(i)("inventory.stock.history.noRecords")), 1),
1910
+ e("div", Qo, _(u(i)("inventory.stock.history.changeDateRange")), 1),
1912
1911
  k(S),
1913
1912
  k(S)
1914
1913
  ]))
@@ -1922,7 +1921,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1922
1921
  }), es = {
1923
1922
  key: 0,
1924
1923
  class: "flex items-center gap-1"
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({
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({
1926
1925
  __name: "StockView",
1927
1926
  setup(b) {
1928
1927
  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();
@@ -1990,7 +1989,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1990
1989
  const L = r.value ? Et.build(r.value) : null, Y = [];
1991
1990
  for (const s of p.skus) {
1992
1991
  let f = !0;
1993
- if (x.isEnabled && M.value && v.value && f && (f = v.value.has(s._id)), L && f && (f = Ht(
1992
+ if (x.isEnabled && B.value && v.value && f && (f = v.value.has(s._id)), L && f && (f = Ht(
1994
1993
  {
1995
1994
  status: s.isInactive ? "Inactive" : "Active"
1996
1995
  },
@@ -2015,7 +2014,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
2015
2014
  }
2016
2015
  }
2017
2016
  return Y;
2018
- }), B = N(""), M = N(!0), { breakpoints: E } = Kt(), P = H(() => E.value.xs || E.value.sm), J = H(() => P.value ? 10 : 20), Q = Pt(), R = H(() => [
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(() => [
2019
2018
  {
2020
2019
  label: g("inventory.stock.stock_balance.refreshBalance"),
2021
2020
  value: "refresh-balance",
@@ -2043,7 +2042,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
2043
2042
  }
2044
2043
  return (L, Y) => {
2045
2044
  const le = D("FmSwitch"), y = D("FmTable");
2046
- return F(), K(Rt, {
2045
+ return F(), G(Rt, {
2047
2046
  title: u(g)("inventory.stock.title"),
2048
2047
  actions: R.value,
2049
2048
  "onClick:action": oe
@@ -2063,8 +2062,8 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
2063
2062
  k(Ot, {
2064
2063
  searchable: "",
2065
2064
  "change-location": "",
2066
- search: B.value,
2067
- "onUpdate:search": Y[1] || (Y[1] = (a) => B.value = a),
2065
+ search: M.value,
2066
+ "onUpdate:search": Y[1] || (Y[1] = (a) => M.value = a),
2068
2067
  "hide-filter-options": !0,
2069
2068
  filterable: "",
2070
2069
  "filter-attributes": n.value,
@@ -2078,8 +2077,8 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
2078
2077
  k(Pe, null, {
2079
2078
  default: I(() => [
2080
2079
  k(le, {
2081
- modelValue: M.value,
2082
- "onUpdate:modelValue": Y[0] || (Y[0] = (a) => M.value = a)
2080
+ modelValue: B.value,
2081
+ "onUpdate:modelValue": Y[0] || (Y[0] = (a) => B.value = a)
2083
2082
  }, null, 8, ["modelValue"])
2084
2083
  ]),
2085
2084
  _: 1
@@ -2088,15 +2087,15 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
2088
2087
  ]),
2089
2088
  _: 1
2090
2089
  }, 8, ["search", "filter-attributes", "filter"]),
2091
- (F(), K(y, {
2092
- style: tt(u(Q).tableHeight),
2090
+ (F(), G(y, {
2091
+ style: tt(u(J).tableHeight),
2093
2092
  "column-defs": u(C),
2094
2093
  "row-data": w.value,
2095
- "search-value": B.value,
2094
+ "search-value": M.value,
2096
2095
  loading: $.value || !u(o)._currentLocation,
2097
2096
  key: (t = u(o)._currentLocation) == null ? void 0 : t.dbName,
2098
2097
  onRowClick: Y[3] || (Y[3] = (a) => u(h).showSkuHistory(a.original)),
2099
- "page-size": J.value
2098
+ "page-size": Q.value
2100
2099
  }, {
2101
2100
  "list-row": I((a) => [
2102
2101
  k(Nt, {
@@ -2104,18 +2103,18 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
2104
2103
  onRowClick: u(h).showSkuHistory
2105
2104
  }, {
2106
2105
  default: I((S) => {
2107
- var U, z, se, T, G, W, ae, re, q, ee;
2106
+ var U, z, se, T, K, W, ae, re, q, ee;
2108
2107
  return [
2109
2108
  e("div", ns, [
2110
2109
  e("div", os, [
2111
2110
  e("div", ss, [
2112
- k(u(Qe), {
2111
+ k(u(Je), {
2113
2112
  render: (se = (z = (U = S.code) == null ? void 0 : U.column) == null ? void 0 : z.columnDef) == null ? void 0 : se.cell,
2114
- props: (G = (T = S.code) == null ? void 0 : T.getContext) == null ? void 0 : G.call(T)
2113
+ props: (K = (T = S.code) == null ? void 0 : T.getContext) == null ? void 0 : K.call(T)
2115
2114
  }, null, 8, ["render", "props"])
2116
2115
  ]),
2117
2116
  e("div", as, [
2118
- k(u(Qe), {
2117
+ k(u(Je), {
2119
2118
  render: (re = (ae = (W = S.name) == null ? void 0 : W.column) == null ? void 0 : ae.columnDef) == null ? void 0 : re.cell,
2120
2119
  props: (ee = (q = S.name) == null ? void 0 : q.getContext) == null ? void 0 : ee.call(q)
2121
2120
  }, null, 8, ["render", "props"])
@@ -2144,10 +2143,10 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
2144
2143
  _: 1
2145
2144
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
2146
2145
  ], 2),
2147
- (F(), K(dt, { to: "body" }, [
2148
- (s = u(h).stockHistoryProps) != null && s.sku ? (F(), K(Zo, Ae(Ve({ key: 0 }, u(h).stockHistoryProps)), null, 16)) : te("", !0),
2149
- (f = u(h).convertSkuDialogProps) != null && f.sku ? (F(), K(kn, Ae(Ve({ key: 1 }, u(h).convertSkuDialogProps)), null, 16)) : te("", !0),
2150
- (m = u(h).adjustSkuDialogProps) != null && m.stock ? (F(), K(Vn, Ae(Ve({ key: 2 }, u(h).adjustSkuDialogProps)), null, 16)) : te("", !0)
2146
+ (F(), G(dt, { to: "body" }, [
2147
+ (s = u(h).stockHistoryProps) != null && s.sku ? (F(), G(Zo, Ae(Ve({ key: 0 }, u(h).stockHistoryProps)), null, 16)) : te("", !0),
2148
+ (f = u(h).convertSkuDialogProps) != null && f.sku ? (F(), G(kn, Ae(Ve({ key: 1 }, u(h).convertSkuDialogProps)), null, 16)) : te("", !0),
2149
+ (m = u(h).adjustSkuDialogProps) != null && m.stock ? (F(), G(Vn, Ae(Ve({ key: 2 }, u(h).adjustSkuDialogProps)), null, 16)) : te("", !0)
2151
2150
  ]))
2152
2151
  ];
2153
2152
  }),
@@ -2157,5 +2156,5 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
2157
2156
  }
2158
2157
  });
2159
2158
  export {
2160
- gs as default
2159
+ ks as default
2161
2160
  };