@feedmepos/mf-inventory-portal 1.2.13 → 1.2.14

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 (76) hide show
  1. package/dist/App-BKUu2y4m.js +286 -0
  2. package/dist/{ApprovalView-BWX6xBQs.js → ApprovalView-BXIr-aOO.js} +26 -26
  3. package/dist/{BindingsDialog-CuwkcDKX.js → BindingsDialog-BDxyU1ai.js} +2 -2
  4. package/dist/{BindingsPicker-BibFsY0g.js → BindingsPicker-CtlglFHZ.js} +10 -10
  5. package/dist/{BindingsTable-AdjKwSPH.js → BindingsTable-CAkqyxwU.js} +1 -1
  6. package/dist/{ClosingDraftView-DWFHP9nE.js → ClosingDraftView-uqekYW8F.js} +44 -44
  7. package/dist/{ClosingTemplateView-DOCF5f_u.js → ClosingTemplateView-T75Sz9_T.js} +26 -26
  8. package/dist/{DeliveryOrderPrintPreview-DNDtL_Vo.js → DeliveryOrderPrintPreview-DHhQSQ2B.js} +10 -10
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BWhINOE8.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Dcof4mm-.js} +15 -15
  10. package/dist/{FmMultiselectDialog-Dfo04ak5.js → FmMultiselectDialog-WIXHw0Uk.js} +4 -4
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DGVs4zLl.js → FmUnitInput.vue_vue_type_script_setup_true_lang-V7qRyodl.js} +54 -54
  12. package/dist/ImportView-D6K4u2to.js +1303 -0
  13. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BESx2u4Y.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DXSaHlBC.js} +1 -1
  14. package/dist/{IngredientGroupView-M9sXlnE0.js → IngredientGroupView-337gZxja.js} +19 -20
  15. package/dist/IngredientsView-BFB5W9wU.js +2240 -0
  16. package/dist/{IntegrationView-BlUNz1yc.js → IntegrationView-DBZir_ru.js} +3 -3
  17. package/dist/{InventoryBindingForm-CvQ5zh6v.js → InventoryBindingForm-D4T5aJjL.js} +1 -1
  18. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BEAEmPsU.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CxeoVbtU.js} +12 -12
  19. package/dist/{InventoryBindingSummary-CsJ-6G2P.js → InventoryBindingSummary-Cb0OLH16.js} +1 -1
  20. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DjN_ktl1.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BBayB4R3.js} +1 -1
  21. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BN_e7k7U.js → PremiumBadge.vue_vue_type_script_setup_true_lang-C9en2Mi_.js} +1 -1
  22. package/dist/{PublishView-DZgCyLK2.js → PublishView-BM5b29AM.js} +25 -25
  23. package/dist/{PurchaseOrderPrintPreview-CB2xvQ33.js → PurchaseOrderPrintPreview-Dml3m5ao.js} +12 -12
  24. package/dist/{ReceiveRequestView-DgDHOS-Y.js → ReceiveRequestView-Ceya3bOZ.js} +131 -132
  25. package/dist/RecipeView-Bw3qnkmy.js +636 -0
  26. package/dist/{StockView-eJOngk08.js → StockView-Dum7wayi.js} +165 -166
  27. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BMFfegsk.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BCMz3BUb.js} +1 -1
  28. package/dist/{SupplierView-BS8rBAKC.js → SupplierView-BRePnXQP.js} +4 -4
  29. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-4Kll7qk7.js +3385 -0
  30. package/dist/{TransferTemplateView-By5Ci4Yg.js → TransferTemplateView-DzcNysRM.js} +166 -166
  31. package/dist/UnitView-Dd9vLRU0.js +674 -0
  32. package/dist/{WarehouseView-4ZLSJXYc.js → WarehouseView-C1T2VVo_.js} +32 -32
  33. package/dist/api/inventory.d.ts +306 -0
  34. package/dist/api/purchase-order.d.ts +1 -0
  35. package/dist/{app-D2lun71R.js → app-DU_GXTW3.js} +11730 -11115
  36. package/dist/app.d.ts +421 -0
  37. package/dist/app.js +1 -1
  38. package/dist/{closing-template-Cm1TtVzm.js → closing-template-DhM1Taa8.js} +1 -1
  39. package/dist/{decimal-eeicE4jp.js → decimal-CB27myvl.js} +1 -1
  40. package/dist/{format-unit-display-vHKazw0l.js → format-unit-display-Bou8fmKm.js} +24 -24
  41. package/dist/helper/number.d.ts +1 -0
  42. package/dist/import-export.helper-Bstm4Lwa.js +243 -0
  43. package/dist/{index-C5s-1g7c.js → index-B14XCvps.js} +1 -1
  44. package/dist/{index-DvX9cMJV.js → index-B9_waZl0.js} +1 -1
  45. package/dist/{purchase-order-template-uTs7bR89.js → purchase-order-template-DKQSKCx3.js} +1 -1
  46. package/dist/router/name.d.ts +1 -0
  47. package/dist/{stock-CL2LNdXp.js → stock-CWx63kov.js} +1 -1
  48. package/dist/stores/feature.d.ts +2 -0
  49. package/dist/stores/inventory.d.ts +26 -199
  50. package/dist/{supplier-CuzoW2k4.js → supplier-BMV0Wr8s.js} +1 -1
  51. package/dist/tsconfig.app.tsbuildinfo +1 -1
  52. package/dist/{use-ingredient-select-dialog-Cpg4lHHC.js → use-ingredient-select-dialog-B6k49FYb.js} +4 -4
  53. package/dist/{use-inventory-binding-dialog-h4M4ICQK.js → use-inventory-binding-dialog-D_ai3vrG.js} +1 -1
  54. package/dist/views/import/ImportView.vue.d.ts +3 -0
  55. package/dist/views/import/components/ImportDialog.vue.d.ts +2 -0
  56. package/dist/views/import/helper/import-export.helper.d.ts +4 -0
  57. package/dist/views/ingredients/helper/import-export.helper.d.ts +3 -1
  58. package/dist/views/receive-request/components/delivery-order-form/SystemTrailDialog.vue.d.ts +17 -0
  59. package/dist/views/receive-request/components/netsuite/NetSuiteTransactionChangeLog.vue.d.ts +15 -0
  60. package/dist/views/recipe/RecipeView.vue.d.ts +1 -0
  61. package/dist/views/recipe/components/import-recipes/ImportRecipeItem.vue.d.ts +16 -0
  62. package/dist/views/recipe/components/import-recipes/ImportRecipes.vue.d.ts +2 -0
  63. package/dist/views/recipe/helper/import-recipe.d.ts +48 -0
  64. package/dist/views/unit/UnitView.vue.d.ts +1 -0
  65. package/dist/views/unit/components/import-units/ImportUnitItem.vue.d.ts +12 -0
  66. package/dist/views/unit/components/import-units/ImportUnitItemProps.d.ts +6 -0
  67. package/dist/views/unit/components/import-units/ImportUnits.vue.d.ts +9 -0
  68. package/dist/views/unit/components/import-units/ImportUnitsProps.d.ts +5 -0
  69. package/dist/views/unit/helper/import-export.helper.d.ts +40 -0
  70. package/package.json +2 -2
  71. package/dist/App-ZoXow3DD.js +0 -276
  72. package/dist/IngredientsView-DUwhH3j1.js +0 -2475
  73. package/dist/RecipeView-DQDfwCJd.js +0 -621
  74. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-w98ibfql.js +0 -3060
  75. package/dist/UnitView-DmuWMFlA.js +0 -667
  76. package/dist/array-Ca8T3f_G.js +0 -44
@@ -1,26 +1,25 @@
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";
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, a1 as mt, f as He, h as Pe, i as pt, a as Re, F as We, a2 as vt, y as je, l as me, Y as ft, t as Se, a0 as Fe, A as yt, M as _t, $ as ye, a3 as bt, a4 as ne, a5 as kt, a6 as qe, q as gt, w as ht, a7 as xt, a8 as St, a9 as Ft, aa as Ce, ab as wt, ac as nt, Z as X, ad as $t, X as ot, ae as ke, af as At, ag as Vt, s as Me, p as Xe, v as Ct, c as Mt, ah as Bt, ai as Dt, aj as It, ak as jt, al as Tt, b as Ut, N as Et, H as Ht, E as Pt, G as Rt, I as Ot, J as Nt, K as Je } from "./app-DU_GXTW3.js";
3
+ import { u as Oe, a as _e } from "./stock-CWx63kov.js";
4
+ import { g as we } from "./decimal-CB27myvl.js";
5
+ import { e as Lt, u as st, i as at, _ as Qe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-C9en2Mi_.js";
6
+ import { _ as Te, S as Be, g as lt, a as zt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BCMz3BUb.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-h4M4ICQK.js";
12
- import { _ as qt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DjN_ktl1.js";
11
+ import { u as Wt } from "./use-inventory-binding-dialog-D_ai3vrG.js";
12
+ import { _ as qt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BBayB4R3.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",
@@ -112,7 +111,7 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
112
111
  const c = g(o.sku);
113
112
  C ? localStorage.setItem(c, C) : localStorage.setItem(c, o.unit._id), j.value = $e(o.sku, o.unit);
114
113
  }
115
- const o = b, j = N($e(o.sku, o.unit)), h = E(() => {
114
+ const o = b, j = N($e(o.sku, o.unit)), h = H(() => {
116
115
  const { measurements: C } = o.unit;
117
116
  return [
118
117
  {
@@ -128,7 +127,7 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
128
127
  function d({ value: C }) {
129
128
  return u(j).type === "unit" ? C === null : C === u(j).measurement;
130
129
  }
131
- const i = E(
130
+ const i = H(
132
131
  () => {
133
132
  var C;
134
133
  return ((C = h.value.find((c) => d(c))) == null ? void 0 : C.label) ?? "";
@@ -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, H;
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")
@@ -207,7 +206,7 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
207
206
  return;
208
207
  }
209
208
  const w = {
210
- maxCount: ((H = p.productBalance.find(({ id: P }) => P === V._id)) == null ? void 0 : H.count) || 0,
209
+ maxCount: ((E = p.productBalance.find(({ id: P }) => P === V._id)) == null ? void 0 : E.count) || 0,
211
210
  sku: V,
212
211
  show: !0,
213
212
  "onUpdate:show"(P) {
@@ -245,7 +244,7 @@ const en = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
245
244
  v.value = n;
246
245
  }
247
246
  function A(V, n) {
248
- const r = Ee(n);
247
+ const r = He(n);
249
248
  switch (V) {
250
249
  case ge.History:
251
250
  $(r);
@@ -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
  },
@@ -404,26 +403,26 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
404
403
  },
405
404
  emits: ["update:show", "submitted"],
406
405
  setup(b, { expose: g, emit: p }) {
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(
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(
408
407
  () => {
409
408
  var y, t;
410
409
  return (((t = (y = o.sku) == null ? void 0 : y.convert) == null ? void 0 : t.inventoryBindings) ?? []).filter(
411
410
  (s) => s.type === We.enum.SKU
412
411
  );
413
412
  }
414
- ), A = E({
413
+ ), A = H({
415
414
  get() {
416
415
  return !!l.value;
417
416
  },
418
417
  set(y) {
419
- y ? l.value = Ee($.value) : (l.value = null, c.value = Math.min(c.value, o.maxCount ?? 0));
418
+ y ? l.value = He($.value) : (l.value = null, c.value = Math.min(c.value, o.maxCount ?? 0));
420
419
  }
421
420
  }), V = N(!1);
422
421
  xe([() => o.show], ([y]) => {
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 = E(
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 = E(() => {
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) ?? [],
@@ -473,23 +472,23 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
473
472
  abbrev: U
474
473
  };
475
474
  });
476
- }), H = N();
475
+ }), E = N();
477
476
  g({
478
477
  validateInputs: () => {
479
478
  var y, t;
480
- (t = (y = H.value) == null ? void 0 : y.validateInputs) == null || t.call(y);
479
+ (t = (y = E.value) == null ? void 0 : y.validateInputs) == null || t.call(y);
481
480
  },
482
481
  resetInputsValidation: () => {
483
482
  var y, t;
484
- (t = (y = H.value) == null ? void 0 : y.resetInputsValidation) == null || t.call(y);
483
+ (t = (y = E.value) == null ? void 0 : y.resetInputsValidation) == null || t.call(y);
485
484
  },
486
485
  resetInputs: () => {
487
486
  var y, t;
488
- (t = (y = H.value) == null ? void 0 : y.resetInputs) == null || t.call(y);
487
+ (t = (y = E.value) == null ? void 0 : y.resetInputs) == null || t.call(y);
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;
@@ -584,7 +583,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
584
583
  e("div", rn, [
585
584
  k(f, {
586
585
  ref_key: "formRef",
587
- ref: H,
586
+ ref: E,
588
587
  onValidationSuccess: n
589
588
  }, {
590
589
  default: I(() => [
@@ -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,7 +606,7 @@ 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) => {
609
+ (F(!0), O(Z, null, ie(B.value, (T) => {
611
610
  var K, W;
612
611
  return F(), O("div", {
613
612
  key: (K = T.sku) == null ? void 0 : K._id,
@@ -661,7 +660,7 @@ 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 ?? []),
663
+ "onUpdate:modelValue": (q) => J(T.id, q, l.value ?? []),
665
664
  invalid: K
666
665
  }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
667
666
  k(U, {
@@ -710,7 +709,7 @@ const an = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-80
710
709
  label: u(C)("inventory.stock.convert.convertButton"),
711
710
  onClick: t[2] || (t[2] = (T) => {
712
711
  var K, W;
713
- return (W = (K = H.value) == null ? void 0 : K.validateInputs) == null ? void 0 : W.call(K);
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
  ])
@@ -756,12 +755,12 @@ const Ie = {
756
755
  },
757
756
  emits: ["update:modelValue", "click:delete"],
758
757
  setup(b, { emit: g }) {
759
- const p = b, o = g, j = E(
758
+ const p = b, o = g, j = H(
760
759
  () => Object.keys(Ie).map((c) => ({
761
760
  label: kt(c),
762
761
  value: c
763
762
  }))
764
- ), h = E(() => lt(p.modelValue.doc.unit, !0)), d = E({
763
+ ), h = H(() => lt(p.modelValue.doc.unit, !0)), d = H({
765
764
  get() {
766
765
  return p.modelValue.type ?? ne.enum.PURCHASE;
767
766
  },
@@ -776,7 +775,7 @@ const Ie = {
776
775
  v.precision
777
776
  ), o("update:modelValue", l);
778
777
  }
779
- }), i = E({
778
+ }), i = H({
780
779
  get() {
781
780
  const c = qe(p.modelValue.amount);
782
781
  return +me(c);
@@ -790,7 +789,7 @@ const Ie = {
790
789
  v.precision
791
790
  ), o("update:modelValue", l);
792
791
  }
793
- }), x = E({
792
+ }), x = H({
794
793
  get() {
795
794
  var c;
796
795
  return ((c = p.modelValue.measurement) == null ? void 0 : c.id) ?? null;
@@ -802,7 +801,7 @@ const Ie = {
802
801
  };
803
802
  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);
804
803
  }
805
- }), C = E({
804
+ }), C = H({
806
805
  get() {
807
806
  return p.modelValue.remark ?? "";
808
807
  },
@@ -879,21 +878,21 @@ const Ie = {
879
878
  setup(b, { expose: g, emit: p }) {
880
879
  const o = b, j = p, h = Re(), d = Le(), i = _e(), x = be(), C = N(!1), { t: c } = de();
881
880
  function l() {
882
- V(Ee(A));
881
+ V(He(A));
883
882
  }
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: H, 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,
935
- type: H
931
+ measurement: Q,
932
+ remark: B,
933
+ doc: M,
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((H) => H.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,12 +969,12 @@ const Ie = {
970
969
  close: !0,
971
970
  variant: "tertiary"
972
971
  }
973
- }).onPrimary((M) => {
974
- A.adjustments = M.map(
975
- (H) => A.adjustments.find((P) => P.doc._id === H) ?? {
972
+ }).onPrimary((B) => {
973
+ A.adjustments = B.map(
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,
978
- doc: h.skus.find((P) => P._id === H),
977
+ doc: h.skus.find((P) => P._id === E),
979
978
  measurement: null,
980
979
  remark: "",
981
980
  amount: ye(1)
@@ -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"), H = D("FmButton"), P = D("FmForm"), J = D("FmSideSheet");
991
- return F(), G(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,22 +1006,22 @@ 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),
1017
- k(H, {
1016
+ k(E, {
1018
1017
  "prepend-icon": "add",
1019
1018
  variant: "tertiary",
1020
1019
  size: "md",
1021
1020
  onClick: n
1022
1021
  })
1023
1022
  ]),
1024
- (F(!0), O(Z, null, ie(A.adjustments, (Q, R) => (F(), G(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)
@@ -1033,10 +1032,10 @@ const Ie = {
1033
1032
  ]),
1034
1033
  "side-sheet-footer": I(() => [
1035
1034
  e("div", An, [
1036
- k(H, {
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,10 +1063,10 @@ 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" }, 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({
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
1071
  props: /* @__PURE__ */ Ke({
1073
1072
  adjustmentId: {}
@@ -1081,7 +1080,7 @@ const Ie = {
1081
1080
  _id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
1082
1081
  skus: []
1083
1082
  }), c = N();
1084
- He(async () => {
1083
+ Ee(async () => {
1085
1084
  d.value = !0;
1086
1085
  const n = await j.readSingleAdjustment(p.adjustmentId);
1087
1086
  if (!n) throw new Error("Adjustment not found");
@@ -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((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));
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,
@@ -1104,20 +1103,20 @@ const Ie = {
1104
1103
  }), o("refreshHistory"), x.value = !1, h.value = {};
1105
1104
  }
1106
1105
  function v(n, r, w) {
1107
- return E({
1106
+ return H({
1108
1107
  get: () => {
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;
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"), H = D("FmForm"), P = D("FmSpacer"), J = D("FmButton"), Q = D("FmDialog");
1136
- return F(), G(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
@@ -1158,18 +1157,18 @@ const Ie = {
1158
1157
  e("div", null, "Amend Adjustment", -1)
1159
1158
  ])),
1160
1159
  "dialog-footer": I(() => [
1161
- e("div", En, [
1160
+ e("div", Hn, [
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(), G(H, {
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(), G(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",
@@ -1231,7 +1230,7 @@ const Ie = {
1231
1230
  u(Fe)(-1)
1232
1231
  ]
1233
1232
  }, null, 8, ["model-value", "onUpdate:modelValue", "helper-text", "append-text", "rules"]),
1234
- e("div", Hn, [
1233
+ e("div", En, [
1235
1234
  r[10] || (r[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
1236
1235
  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)),
1237
1236
  ue(" " + _(V(
@@ -1261,10 +1260,10 @@ const Ie = {
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: {},
@@ -1275,12 +1274,12 @@ const Ie = {
1275
1274
  setup(b, { emit: g }) {
1276
1275
  const p = b, o = N(!1);
1277
1276
  Ne();
1278
- const j = N(), h = N(null), d = E(() => h.value === null ? "unset" : o.value ? `${h.value}px` : "0px");
1279
- He(() => {
1277
+ const j = N(), h = N(null), d = H(() => h.value === null ? "unset" : o.value ? `${h.value}px` : "0px");
1278
+ Ee(() => {
1280
1279
  var c;
1281
1280
  h.value = ((c = j.value) == null ? void 0 : c.scrollHeight) || 0;
1282
1281
  });
1283
- const i = E(() => {
1282
+ const i = H(() => {
1284
1283
  var V;
1285
1284
  const c = p.record.adjustments, l = p.sku, v = {}, A = c.flatMap((n) => {
1286
1285
  var r;
@@ -1298,7 +1297,7 @@ const Ie = {
1298
1297
  })} ${l.unit.abbrev}`, n),
1299
1298
  {}
1300
1299
  );
1301
- }), { t: x } = de(), C = E(() => p.record.adjustmentsByTime.map(({ date: c, adjustments: l }) => ({
1300
+ }), { t: x } = de(), C = H(() => p.record.adjustmentsByTime.map(({ date: c, adjustments: l }) => ({
1302
1301
  time: $t(new Date(c)),
1303
1302
  adjustments: l.flatMap(
1304
1303
  (v) => {
@@ -1423,7 +1422,7 @@ const Ie = {
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" }, Ho = { class: "flex flex-col gap-1" }, Eo = { 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
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 {
@@ -1532,7 +1531,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1532
1531
  C.value = !1;
1533
1532
  }
1534
1533
  }
1535
- He(() => {
1534
+ Ee(() => {
1536
1535
  v();
1537
1536
  }), xe([() => l.value, () => x.sku], () => {
1538
1537
  v();
@@ -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,13 +1578,13 @@ 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 = E(() => {
1581
+ const B = H(() => {
1583
1582
  const t = $.value, s = x.sku;
1584
1583
  return Zn(t, s);
1585
- }), H = E(() => {
1584
+ }), E = H(() => {
1586
1585
  const t = $.value, s = x.sku;
1587
1586
  return eo(t, s);
1588
- }), P = E(() => {
1587
+ }), P = H(() => {
1589
1588
  const t = [...$.value].computeFirst((f) => {
1590
1589
  var a, S;
1591
1590
  const m = (S = (a = f.skus) == null ? void 0 : a.find) == null ? void 0 : S.call(a, (U) => U.sku._id === x.sku._id);
@@ -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 = E(() => {
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 = E(() => {
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);
@@ -1641,7 +1640,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1641
1640
  endDate: s
1642
1641
  });
1643
1642
  }
1644
- const oe = E(() => x.sku.valuation === Xe.Enum.FIFO ? i("inventory.ingredient.valuationMethod.FIFO") : i("inventory.ingredient.valuationMethod.WAVG")), L = E(() => {
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
1645
  const t = [...$.value].reverse().computeFirst((K) => {
1647
1646
  var W, ae;
@@ -1654,9 +1653,9 @@ 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
- }), Y = E(() => {
1658
+ }), Y = H(() => {
1660
1659
  var f;
1661
1660
  const t = [...$.value].reverse().computeFirst((m) => {
1662
1661
  var S, U;
@@ -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() {
@@ -1754,16 +1753,16 @@ 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
- H.value != null ? (F(), G(se, {
1761
+ E.value != null ? (F(), G(se, {
1763
1762
  key: 0,
1764
1763
  variant: "plain",
1765
1764
  placement: "top",
1766
- content: `Before: ${H.value}`,
1765
+ content: `Before: ${E.value}`,
1767
1766
  "z-index": 50
1768
1767
  }, {
1769
1768
  default: I(() => [
@@ -1775,42 +1774,42 @@ 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),
1802
1801
  e("div", Uo, _(P.value), 1)
1803
1802
  ]),
1804
- e("div", Ho, [
1805
- e("div", Eo, _(u(i)("inventory.stock.history.summary.lastStockBalance")), 1),
1806
- e("div", Po, _(J.value), 1)
1803
+ e("div", Eo, [
1804
+ e("div", Ho, _(u(i)("inventory.stock.history.summary.lastStockBalance")), 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),
@@ -1853,7 +1852,7 @@ 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
1857
  e("div", Go, [
1859
1858
  ue(_(u(i)("inventory.stock.history.costSold")) + " ", 1),
@@ -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(), G(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,12 +1921,12 @@ 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();
1929
1928
  o.watchLocation(V);
1930
- const v = E(
1929
+ const v = H(
1931
1930
  () => new Set(x.getAvailableItems(x.businessSubsidiaryId))
1932
1931
  ), $ = N(!1);
1933
1932
  async function A() {
@@ -1968,7 +1967,7 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1968
1967
  }
1969
1968
  }
1970
1969
  }
1971
- const n = E(() => [
1970
+ const n = H(() => [
1972
1971
  {
1973
1972
  type: "string",
1974
1973
  key: "status",
@@ -1985,12 +1984,12 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
1985
1984
  type: "string"
1986
1985
  }
1987
1986
  ]
1988
- }), w = E(() => {
1987
+ }), w = H(() => {
1989
1988
  var le, y, t;
1990
- const L = r.value ? Ht.build(r.value) : null, Y = [];
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 = Et(
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: H } = Gt(), P = E(() => H.value.xs || H.value.sm), J = E(() => P.value ? 10 : 20), Q = Pt(), R = E(() => [
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",
@@ -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
@@ -2089,14 +2088,14 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
2089
2088
  _: 1
2090
2089
  }, 8, ["search", "filter-attributes", "filter"]),
2091
2090
  (F(), G(y, {
2092
- style: tt(u(Q).tableHeight),
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, {
@@ -2109,13 +2108,13 @@ const to = { class: "flex items-center w-full fm-typo-en-title-md-800" }, no = {
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
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"])
@@ -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
  };