@feedmepos/mf-inventory-portal 1.2.2-dev.1 → 1.2.2-dev.3

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 (106) hide show
  1. package/dist/{App-C9XQOsrP.js → App-DAab61Y3.js} +1 -1
  2. package/dist/{ApprovalView-1GBi8VK8.js → ApprovalView-BDt_IdgV.js} +2 -2
  3. package/dist/{BindingsDialog-D1jgrgHp.js → BindingsDialog-FF8USPP4.js} +2 -2
  4. package/dist/{BindingsPicker-BWpkVmRH.js → BindingsPicker-KFcppldz.js} +1 -1
  5. package/dist/{BindingsTable-C3a5rQsU.js → BindingsTable-jwQ801Fk.js} +1 -1
  6. package/dist/{ClosingDraftView-M1VZ7Ubp.js → ClosingDraftView-CYPkcKxk.js} +2 -2
  7. package/dist/{ClosingTemplateView-ubVOShkx.js → ClosingTemplateView-1UuB2aef.js} +2 -2
  8. package/dist/{DeliveryOrderPrintPreview-D8k7olwU.js → DeliveryOrderPrintPreview-NnfinFpy.js} +1 -1
  9. package/dist/FmAdminBadge-wjcRz0_J.js +44 -0
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BzWLBxUC.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CUlu-YXe.js} +3 -3
  11. package/dist/{FmMultiselectDialog-DZlmvlH-.js → FmMultiselectDialog-Bum2P_DE.js} +1 -1
  12. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-qJ57T17v.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CnIQI968.js} +1 -1
  13. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BmWJSWWs.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CqGPRyAt.js} +1 -1
  14. package/dist/{IngredientGroupView-Lc4juIpn.js → IngredientGroupView-C7Z3zbzK.js} +2 -2
  15. package/dist/{IngredientsView-B7ilCUo1.js → IngredientsView-C8vAKCQU.js} +4 -4
  16. package/dist/{IntegrationView-CBbQi9eX.js → IntegrationView-BB-_EU26.js} +1282 -1267
  17. package/dist/{InventoryBindingForm-BYDnLY-B.js → InventoryBindingForm-Rjs3yODh.js} +1 -1
  18. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DB_91rQK.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-D9vjJDxP.js} +3 -3
  19. package/dist/{InventoryBindingSummary-CLk6_myJ.js → InventoryBindingSummary-BNy7uiUu.js} +1 -1
  20. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-TERMQx9m.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BApjHkbC.js} +1 -1
  21. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DMS_1RZd.js → PremiumBadge.vue_vue_type_script_setup_true_lang-C7wG_6bX.js} +1 -1
  22. package/dist/{PublishView-BzYVIzVH.js → PublishView-Btmo1Exg.js} +8 -8
  23. package/dist/{PurchaseOrderPrintPreview-DkhYCWlU.js → PurchaseOrderPrintPreview-DahOAnSq.js} +1 -1
  24. package/dist/{ReceiveRequestView-DYfMcV1P.js → ReceiveRequestView-DpLlm9By.js} +8 -8
  25. package/dist/{RecipeView-0v-PiaZL.js → RecipeView-BS3oR694.js} +3 -3
  26. package/dist/{StockView-DmVv6yZd.js → StockView-A1vau_vI.js} +837 -838
  27. package/dist/{SupplierView-EFvZjuXh.js → SupplierView-A-m1kPUl.js} +3 -3
  28. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-BgOY6LqL.js +2494 -0
  29. package/dist/{TransferTemplateView-B6dh3lAb.js → TransferTemplateView-BZMpQ0E_.js} +6 -6
  30. package/dist/{UnitView-Dwg-DzVw.js → UnitView-Bn6Kx8tl.js} +3 -3
  31. package/dist/{WarehouseView-DL0AMn3R.js → WarehouseView-0nCmwtBo.js} +1 -1
  32. package/dist/api/food-market-hub.d.ts +1 -1
  33. package/dist/api/inventory.d.ts +18 -18
  34. package/dist/api/netsuite.d.ts +19 -18
  35. package/dist/app-FwO7QbKs.js +153774 -0
  36. package/dist/app.d.ts +8 -8
  37. package/dist/app.js +1 -1
  38. package/dist/components/FmAdminBadge.vue.d.ts +1 -4
  39. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +7 -7
  40. package/dist/components/shell/inventory/binding-dialog.vue.d.ts +2 -2
  41. package/dist/components/shell/inventory/binding-ui.vue.d.ts +4 -4
  42. package/dist/{decimal-eRlOd74V.js → decimal-CRt-kBvR.js} +1 -1
  43. package/dist/{format-unit-display-CYusbGmI.js → format-unit-display-C9RjXfAz.js} +2 -2
  44. package/dist/{index-BxmvJ-ui.js → index-B18gU7C5.js} +1 -1
  45. package/dist/{index-khYeCDt1.js → index-B8xXPx48.js} +1 -1
  46. package/dist/{stock-B0suhBSW.js → stock-CJ8thbAt.js} +1 -1
  47. package/dist/stores/integration/foodmarkethub.d.ts +1 -1
  48. package/dist/stores/integration/netsuite.d.ts +9 -9
  49. package/dist/stores/inventory.d.ts +37 -37
  50. package/dist/stores/supplier.d.ts +24 -24
  51. package/dist/stores/warehouse.d.ts +1 -2
  52. package/dist/style.css +1 -1
  53. package/dist/{supplier-JDcv1lRx.js → supplier-Ci3-VSI6.js} +1 -1
  54. package/dist/tsconfig.app.tsbuildinfo +1 -1
  55. package/dist/{use-ingredient-select-dialog-w6dHX9B4.js → use-ingredient-select-dialog-B4k3p-nd.js} +1 -1
  56. package/dist/{use-inventory-binding-dialog--7QT5_-Q.js → use-inventory-binding-dialog-B7HiDfIi.js} +1 -1
  57. package/dist/views/adjustment-template/wastage-template/actions.d.ts +12 -12
  58. package/dist/views/adjustment-template/wastage-template/form/WastageTemplateItemTable.vue.d.ts +2 -2
  59. package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +1 -1
  60. package/dist/views/adjustment-template/wastage-template/table.d.ts +12 -12
  61. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +32 -32
  62. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +96 -96
  63. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +3 -3
  64. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +36 -36
  65. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -36
  66. package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +2 -2
  67. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +6 -6
  68. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +4 -4
  69. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +3 -3
  70. package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +2 -2
  71. package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +2 -2
  72. package/dist/views/integration/components/netsuite/InventoryTransfer.vue.d.ts +2 -2
  73. package/dist/views/integration/components/netsuite/InventoryTransferIngredientTable.vue.d.ts +10 -10
  74. package/dist/views/integration/components/netsuite/PurchaseOrder.vue.d.ts +2 -2
  75. package/dist/views/integration/components/netsuite/TransferOrder.vue.d.ts +2 -2
  76. package/dist/views/integration/components/netsuite/business/BusinessNetSuiteSideSheet.vue.d.ts +6 -6
  77. package/dist/views/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +2 -2
  78. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +450 -94
  79. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +10 -10
  80. package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +20 -20
  81. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +5 -5
  82. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +111 -22
  83. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +669 -135
  84. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +780 -157
  85. package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +2 -2
  86. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +10 -10
  87. package/dist/views/stock/components/dialog/AmendAdjustmentForm.vue.d.ts +4 -4
  88. package/dist/views/supplier/components/SupplierForm.vue.d.ts +2 -2
  89. package/dist/views/supplier/components/SupplierSupplyItemField.vue.d.ts +2 -2
  90. package/dist/views/supplier/composables/use-supplier-table.d.ts +1 -1
  91. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +12 -12
  92. package/dist/views/transfer-template/components/transfer-template-form/components/NetSuiteCustomCodeSelection.vue.d.ts +8 -8
  93. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +10 -10
  94. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
  95. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +5 -5
  96. package/dist/views/transfer-template/composables/use-netsuite-custom-field.d.ts +15 -15
  97. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +72 -72
  98. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +72 -72
  99. package/dist/views/unit/components/unit-form/UnitForm.vue.d.ts +2 -2
  100. package/dist/views/unit/components/unit-summary/UnitSummary.vue.d.ts +2 -2
  101. package/dist/views/unit/composables/use-unit-table.d.ts +1 -1
  102. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -4
  103. package/package.json +1 -1
  104. package/dist/FmAdminBadge-BFDkedmh.js +0 -34
  105. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-B7Y2vAlL.js +0 -2336
  106. package/dist/app-D6kqZa_9.js +0 -130114
@@ -1,19 +1,19 @@
1
- import { defineComponent as ce, ref as N, computed as R, resolveComponent as D, openBlock as F, createBlock as L, withCtx as I, createElementVNode as e, normalizeClass as ge, toDisplayString as _, createVNode as x, createElementBlock as O, Fragment as ne, renderList as le, unref as r, h as he, watch as xe, isRef as Ue, createCommentVNode as se, reactive as it, mergeModels as Ye, useModel as ut, onMounted as Ee, createTextVNode as ue, normalizeStyle as Ze, Teleport as ct, normalizeProps as Ae, mergeProps as Ve } from "vue";
2
- import { u as pe, W as dt, f as He, h as mt, a as Pe, F as Ge, X as pt, Y as Ie, j as me, P as ft, t as Se, V as Fe, A as vt, M as yt, T as ve, Z as _t, $ as oe, a0 as ht, a1 as We, m as kt, a2 as bt, a3 as gt, a4 as xt, a5 as St, a6 as Ce, a7 as Ft, a8 as et, Q as X, a9 as wt, s as tt, aa as ke, ab as $t, ac as At, o as Be, l as Ke, p as Vt, c as Ct, ad as Bt, ae as Mt, af as Dt, ag as jt, ah as It, B as Tt, _ as Ut, C as Et, E as Ht, G as qe } from "./app-D6kqZa_9.js";
3
- import { u as Re, a as ye } from "./stock-B0suhBSW.js";
4
- import { g as we } from "./decimal-eRlOd74V.js";
5
- import { e as Pt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DMS_1RZd.js";
1
+ import { defineComponent as ce, ref as N, computed as R, resolveComponent as D, openBlock as x, createBlock as L, withCtx as I, createElementVNode as e, normalizeClass as ge, toDisplayString as h, createVNode as g, createElementBlock as O, Fragment as ne, renderList as re, unref as i, h as he, watch as xe, isRef as Ue, createCommentVNode as se, reactive as it, mergeModels as Ye, useModel as ut, onMounted as Ee, createTextVNode as ue, normalizeStyle as Ze, Teleport as ct, normalizeProps as Ae, mergeProps as Ve } from "vue";
2
+ import { u as pe, W as dt, f as He, h as mt, a as Pe, F as Ge, X as pt, Y as Ie, j as me, P as ft, t as Se, V as Fe, A as vt, M as yt, T as ve, Z as _t, $ as oe, a0 as ht, a1 as We, m as kt, a2 as bt, a3 as gt, a4 as xt, a5 as St, a6 as Ce, a7 as Ft, a8 as et, Q as X, a9 as wt, s as tt, aa as ke, ab as $t, ac as At, o as Be, l as Ke, p as Vt, c as Ct, ad as Bt, ae as Mt, af as Dt, ag as jt, ah as It, B as Tt, _ as Ut, C as Et, E as Ht, G as qe } from "./app-FwO7QbKs.js";
3
+ import { u as Re, a as ye } from "./stock-CJ8thbAt.js";
4
+ import { g as we } from "./decimal-CRt-kBvR.js";
5
+ import { e as Pt, u as nt, i as ot, _ as Xe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-C7wG_6bX.js";
6
6
  import { _ as Te, S as Me, g as st } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
7
7
  import { _ as Rt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
8
8
  import { useI18n as de, useCoreStore as at } from "@feedmepos/mf-common";
9
9
  import { useSnackbar as _e, useDialog as Oe, useProxiedModel as Ne, useBreakpoints as Ot } from "@feedmepos/ui-library";
10
10
  import { defineStore as Nt } from "pinia";
11
- import { u as Lt } from "./use-inventory-binding-dialog--7QT5_-Q.js";
12
- import { _ as zt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-TERMQx9m.js";
11
+ import { u as Lt } from "./use-inventory-binding-dialog-B7HiDfIi.js";
12
+ import { _ as zt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BApjHkbC.js";
13
13
  import { E as Yt } from "./empty-placeholder-wf6-BWE8.js";
14
- import { F as Gt } from "./FmAdminBadge-BFDkedmh.js";
14
+ import { F as Gt } from "./FmAdminBadge-wjcRz0_J.js";
15
15
  import "./array-Ca8T3f_G.js";
16
- var be = /* @__PURE__ */ ((v) => (v.History = "History", v.Convert = "Convert", v.Adjust = "Adjust", v))(be || {});
16
+ var be = /* @__PURE__ */ ((y) => (y.History = "History", y.Convert = "Convert", y.Adjust = "Adjust", y))(be || {});
17
17
  const Wt = [
18
18
  {
19
19
  translationKey: "inventory.stock.action.history",
@@ -41,7 +41,7 @@ const Wt = [
41
41
  /* Adjust */
42
42
  }
43
43
  ];
44
- async function qt(v) {
44
+ async function qt(y) {
45
45
  const u = `${(pe().currentLocation.name || "").replace(
46
46
  / /g,
47
47
  "_"
@@ -50,7 +50,7 @@ async function qt(v) {
50
50
  [
51
51
  {
52
52
  name: "stock",
53
- data: v,
53
+ data: y,
54
54
  columns: [
55
55
  {
56
56
  name: "Code",
@@ -72,7 +72,7 @@ async function qt(v) {
72
72
  selector: (o) => {
73
73
  var p;
74
74
  const A = $e(o, o.unit);
75
- return A.type === "unit" ? o.unit.abbrev : ((p = o.unit.measurements.find((l) => l.id === A.measurement)) == null ? void 0 : p.abbrev) || "";
75
+ return A.type === "unit" ? o.unit.abbrev : ((p = o.unit.measurements.find((c) => c.id === A.measurement)) == null ? void 0 : p.abbrev) || "";
76
76
  }
77
77
  }
78
78
  ]
@@ -81,23 +81,23 @@ async function qt(v) {
81
81
  u
82
82
  );
83
83
  }
84
- function $e(v, g) {
85
- const u = localStorage.getItem(`uom:${v._id}`);
86
- return u ? u === g._id ? {
84
+ function $e(y, b) {
85
+ const u = localStorage.getItem(`uom:${y._id}`);
86
+ return u ? u === b._id ? {
87
87
  type: "unit"
88
- } : g.measurements.find((o) => o.id === u) ? {
88
+ } : b.measurements.find((o) => o.id === u) ? {
89
89
  type: "measurement",
90
90
  measurement: u
91
91
  } : {
92
92
  type: "unit"
93
- } : v.trackingMeasurement && g.measurements.find((o) => o.id === v.trackingMeasurement) ? {
93
+ } : y.trackingMeasurement && b.measurements.find((o) => o.id === y.trackingMeasurement) ? {
94
94
  type: "measurement",
95
- measurement: v.trackingMeasurement
95
+ measurement: y.trackingMeasurement
96
96
  } : {
97
97
  type: "unit"
98
98
  };
99
99
  }
100
- const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ ce({
100
+ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, lt = /* @__PURE__ */ ce({
101
101
  __name: "UnitDisplayControl",
102
102
  props: {
103
103
  unit: {},
@@ -105,63 +105,63 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
105
105
  amount: {},
106
106
  defaultTrackingMeasurement: {}
107
107
  },
108
- setup(v) {
109
- function g($) {
110
- return `uom:${$._id}`;
108
+ setup(y) {
109
+ function b(C) {
110
+ return `uom:${C._id}`;
111
111
  }
112
- function u($) {
113
- const i = g(o.sku);
114
- $ ? localStorage.setItem(i, $) : localStorage.setItem(i, o.unit._id), A.value = $e(o.sku, o.unit);
112
+ function u(C) {
113
+ const a = b(o.sku);
114
+ C ? localStorage.setItem(a, C) : localStorage.setItem(a, o.unit._id), A.value = $e(o.sku, o.unit);
115
115
  }
116
- const o = v, A = N($e(o.sku, o.unit)), p = R(() => {
117
- const { measurements: $ } = o.unit;
116
+ const o = y, A = N($e(o.sku, o.unit)), p = R(() => {
117
+ const { measurements: C } = o.unit;
118
118
  return [
119
119
  {
120
120
  label: `${we(o.amount, o.unit)}`,
121
121
  value: null
122
122
  },
123
- ...$.map(({ id: i }) => ({
124
- label: `${we(o.amount, o.unit, i)}`,
125
- value: i
123
+ ...C.map(({ id: a }) => ({
124
+ label: `${we(o.amount, o.unit, a)}`,
125
+ value: a
126
126
  }))
127
127
  ];
128
128
  });
129
- function l({ value: $ }) {
130
- return r(A).type === "unit" ? $ === null : $ === r(A).measurement;
129
+ function c({ value: C }) {
130
+ return i(A).type === "unit" ? C === null : C === i(A).measurement;
131
131
  }
132
- const f = R(
132
+ const v = R(
133
133
  () => {
134
- var $;
135
- return (($ = p.value.find((i) => l(i))) == null ? void 0 : $.label) ?? "";
134
+ var C;
135
+ return ((C = p.value.find((a) => c(a))) == null ? void 0 : C.label) ?? "";
136
136
  }
137
- ), B = N(!1);
138
- return ($, i) => {
139
- const s = D("FmIcon"), V = D("FmMenuItem"), k = D("FmMenu");
140
- return F(), L(k, {
137
+ ), $ = N(!1);
138
+ return (C, a) => {
139
+ const s = D("FmIcon"), _ = D("FmMenuItem"), B = D("FmMenu");
140
+ return x(), L(B, {
141
141
  "stop-click-propagation": "",
142
- onMenuChanged: i[0] || (i[0] = (S) => B.value = S)
142
+ onMenuChanged: a[0] || (a[0] = (S) => $.value = S)
143
143
  }, {
144
144
  "menu-button": I(() => [
145
145
  e("button", {
146
146
  type: "button",
147
147
  class: ge([
148
148
  "w-full text-left flex items-center gap-8 cursor-pointer fm-corner-radius-sm px-8 py-4 border bg-white",
149
- B.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
149
+ $.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
150
150
  ])
151
151
  }, [
152
- e("div", Xt, _(f.value), 1),
153
- x(s, {
152
+ e("div", Xt, h(v.value), 1),
153
+ g(s, {
154
154
  class: "text-fm-color-neutral-gray-400",
155
155
  name: "expand_more"
156
156
  })
157
157
  ], 2)
158
158
  ]),
159
159
  default: I(() => [
160
- (F(!0), O(ne, null, le(p.value, (S) => (F(), L(V, {
160
+ (x(!0), O(ne, null, re(p.value, (S) => (x(), L(_, {
161
161
  key: S.value ?? 0,
162
162
  label: S.label,
163
- "model-value": l(S),
164
- onClick: (M) => u(S.value)
163
+ "model-value": c(S),
164
+ onClick: (F) => u(S.value)
165
165
  }, null, 8, ["label", "model-value", "onClick"]))), 128))
166
166
  ]),
167
167
  _: 1
@@ -170,106 +170,106 @@ const Xt = { class: "fm-typo-en-body-md-400 flex-grow" }, rt = /* @__PURE__ */ c
170
170
  }
171
171
  }), Qt = { class: "whitespace-nowrap" }, Jt = /* @__PURE__ */ ce({
172
172
  __name: "StockHeaderPreview",
173
- setup(v) {
174
- const { t: g } = de();
175
- return (u, o) => (F(), L(Rt, null, {
173
+ setup(y) {
174
+ const { t: b } = de();
175
+ return (u, o) => (x(), L(Rt, null, {
176
176
  default: I(() => [
177
- e("div", Qt, _(r(g)("inventory.stock.prediction.daysRemaining")), 1)
177
+ e("div", Qt, h(i(b)("inventory.stock.prediction.daysRemaining")), 1)
178
178
  ]),
179
179
  _: 1
180
180
  }));
181
181
  }
182
- }), lt = Nt("stockActions", () => {
183
- const v = N(!1), g = pe(), u = Re(), o = nt(), A = _e(), p = Oe(), { t: l } = de();
184
- async function f() {
185
- if (g._currentLocation) {
186
- v.value = !0;
182
+ }), rt = Nt("stockActions", () => {
183
+ const y = N(!1), b = pe(), u = Re(), o = nt(), A = _e(), p = Oe(), { t: c } = de();
184
+ async function v() {
185
+ if (b._currentLocation) {
186
+ y.value = !0;
187
187
  try {
188
188
  await u.readStockBalance(), await u.readProductBalance(), await o.readStockEstimateBalance();
189
189
  } catch {
190
190
  A.open({
191
- title: l("inventory.stock.error.title"),
192
- message: l("inventory.stock.error.message"),
191
+ title: c("inventory.stock.error.title"),
192
+ message: c("inventory.stock.error.message"),
193
193
  type: "error"
194
194
  });
195
195
  } finally {
196
- v.value = !1;
196
+ y.value = !1;
197
197
  }
198
198
  }
199
199
  }
200
- const B = N();
201
- async function $(M) {
202
- var w, j, P;
203
- if (!!!((j = (w = M.convert) == null ? void 0 : w.inventoryBindings) != null && j.length)) {
200
+ const $ = N();
201
+ async function C(F) {
202
+ var M, j, P;
203
+ if (!!!((j = (M = F.convert) == null ? void 0 : M.inventoryBindings) != null && j.length)) {
204
204
  p.open({
205
- title: l("inventory.stock.error.convert.title"),
206
- message: l("inventory.stock.error.convert.message")
205
+ title: c("inventory.stock.error.convert.title"),
206
+ message: c("inventory.stock.error.convert.message")
207
207
  });
208
208
  return;
209
209
  }
210
- const y = {
211
- maxCount: ((P = u.productBalance.find(({ id: T }) => T === M._id)) == null ? void 0 : P.count) || 0,
212
- sku: M,
210
+ const w = {
211
+ maxCount: ((P = u.productBalance.find(({ id: T }) => T === F._id)) == null ? void 0 : P.count) || 0,
212
+ sku: F,
213
213
  show: !0,
214
214
  "onUpdate:show"(T) {
215
- B.value.show = T;
215
+ $.value.show = T;
216
216
  },
217
217
  onSubmitted() {
218
- f();
218
+ v();
219
219
  }
220
220
  };
221
- B.value = y;
221
+ $.value = w;
222
222
  }
223
- const i = N();
224
- async function s(M) {
225
- const h = {
226
- stock: M,
223
+ const a = N();
224
+ async function s(F) {
225
+ const n = {
226
+ stock: F,
227
227
  show: !0,
228
- "onUpdate:show"(t) {
229
- i.value.show = t;
228
+ "onUpdate:show"(l) {
229
+ a.value.show = l;
230
230
  },
231
231
  onSubmitted() {
232
- f();
232
+ v();
233
233
  }
234
234
  };
235
- i.value = h;
235
+ a.value = n;
236
236
  }
237
- const V = N();
238
- async function k(M) {
239
- const h = {
240
- sku: M,
237
+ const _ = N();
238
+ async function B(F) {
239
+ const n = {
240
+ sku: F,
241
241
  show: !0,
242
- "onUpdate:show"(t) {
243
- V.value.show = t;
242
+ "onUpdate:show"(l) {
243
+ _.value.show = l;
244
244
  }
245
245
  };
246
- V.value = h;
246
+ _.value = n;
247
247
  }
248
- function S(M, h) {
249
- const t = He(h);
250
- switch (M) {
248
+ function S(F, n) {
249
+ const l = He(n);
250
+ switch (F) {
251
251
  case be.History:
252
- k(t);
252
+ B(l);
253
253
  return;
254
254
  case be.Convert:
255
- $(t);
255
+ C(l);
256
256
  return;
257
257
  case be.Adjust:
258
- s(t);
258
+ s(l);
259
259
  return;
260
260
  }
261
261
  }
262
262
  return {
263
- fetchStockBalance: f,
263
+ fetchStockBalance: v,
264
264
  onActionMenu: S,
265
- stockHistoryProps: V,
266
- showSkuHistory: k,
267
- convertSkuDialogProps: B,
268
- adjustSkuDialogProps: i
265
+ stockHistoryProps: _,
266
+ showSkuHistory: B,
267
+ convertSkuDialogProps: $,
268
+ adjustSkuDialogProps: a
269
269
  };
270
270
  });
271
271
  function Zt() {
272
- const v = pe(), g = lt(), { t: u } = de();
272
+ const y = pe(), b = rt(), { t: u } = de();
273
273
  return {
274
274
  columnDefs: [
275
275
  {
@@ -288,13 +288,13 @@ function Zt() {
288
288
  id: "UOM",
289
289
  header: () => u("inventory.stock.balance"),
290
290
  cell(A) {
291
- const p = A.row.original, l = {
291
+ const p = A.row.original, c = {
292
292
  unit: p.unit,
293
293
  sku: p,
294
294
  amount: p.balance,
295
295
  defaultTrackingMeasurement: p.trackingMeasurement ?? void 0
296
296
  };
297
- return he(rt, l);
297
+ return he(lt, c);
298
298
  },
299
299
  size: 180
300
300
  },
@@ -305,16 +305,16 @@ function Zt() {
305
305
  enableSorting: !0,
306
306
  sortUndefined: "last",
307
307
  cell(A) {
308
- var i, s;
309
- const p = A.row.original.day, l = (i = A.row.original.thresholds) == null ? void 0 : i.low, f = (s = A.row.original.thresholds) == null ? void 0 : s.mid;
310
- if (typeof p != "number" || typeof l != "number" || typeof f != "number")
308
+ var a, s;
309
+ const p = A.row.original.day, c = (a = A.row.original.thresholds) == null ? void 0 : a.low, v = (s = A.row.original.thresholds) == null ? void 0 : s.mid;
310
+ if (typeof p != "number" || typeof c != "number" || typeof v != "number")
311
311
  return he(Te, {
312
312
  days: p
313
313
  });
314
- const B = p <= l ? Me.low : p <= f ? Me.mid : Me.high;
314
+ const $ = p <= c ? Me.low : p <= v ? Me.mid : Me.high;
315
315
  return he(Te, {
316
316
  days: p,
317
- level: B
317
+ level: $
318
318
  });
319
319
  },
320
320
  size: 200
@@ -324,8 +324,8 @@ function Zt() {
324
324
  cell(A) {
325
325
  var p;
326
326
  return mt(
327
- ((p = v._currentLocation) == null ? void 0 : p.type) === "restaurant" ? Wt : Kt,
328
- (l) => g.onActionMenu(l, A.row.original)
327
+ ((p = y._currentLocation) == null ? void 0 : p.type) === "restaurant" ? Wt : Kt,
328
+ (c) => b.onActionMenu(c, A.row.original)
329
329
  );
330
330
  },
331
331
  enableSorting: !1,
@@ -341,41 +341,41 @@ function Zt() {
341
341
  const en = {
342
342
  context: null,
343
343
  error: null,
344
- isRequired(v = "This field is required") {
345
- return `${this.context ?? ""}`.length === 0 && (this.error = v), this;
344
+ isRequired(y = "This field is required") {
345
+ return `${this.context ?? ""}`.length === 0 && (this.error = y), this;
346
346
  },
347
- isString(v = "Must be a valid string") {
348
- return this.error ? this : (typeof this.context != "string" && (this.error ?? (this.error = v)), this);
347
+ isString(y = "Must be a valid string") {
348
+ return this.error ? this : (typeof this.context != "string" && (this.error ?? (this.error = y)), this);
349
349
  },
350
350
  toInt() {
351
351
  return this.error ? this : (this.context = +this.context, this);
352
352
  },
353
- isInteger(v = "Must be an integer") {
354
- return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error = v), this);
353
+ isInteger(y = "Must be an integer") {
354
+ return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error = y), this);
355
355
  },
356
- min(v, g) {
356
+ min(y, b) {
357
357
  if (this.error) return this;
358
358
  try {
359
- typeof this.context == "number" ? +this.context < v && (this.error = g ?? `Must be at least ${v}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < v && (this.error = g ?? `Must be at least ${v}`) : this.error = "Length cannot be determined";
359
+ typeof this.context == "number" ? +this.context < y && (this.error = b ?? `Must be at least ${y}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < y && (this.error = b ?? `Must be at least ${y}`) : this.error = "Length cannot be determined";
360
360
  } catch {
361
361
  this.error = "Length cannot be determined";
362
362
  }
363
363
  return this;
364
364
  },
365
- max(v, g) {
365
+ max(y, b) {
366
366
  if (this.error) return this;
367
367
  try {
368
- typeof this.context == "number" ? +this.context > v && (this.error = g ?? `Must be at most ${v}`) : "length" in this.context ? +this.context.length > v && (this.error = g ?? `Must be at most ${v}`) : this.error = "Length cannot be determined";
368
+ typeof this.context == "number" ? +this.context > y && (this.error = b ?? `Must be at most ${y}`) : "length" in this.context ? +this.context.length > y && (this.error = b ?? `Must be at most ${y}`) : this.error = "Length cannot be determined";
369
369
  } catch {
370
370
  this.error = "Length cannot be determined";
371
371
  }
372
372
  return this;
373
373
  }
374
374
  };
375
- function Qe(v) {
376
- return { ...en, context: v };
375
+ function Qe(y) {
376
+ return { ...en, context: y };
377
377
  }
378
- const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-800" }, on = { class: "flex flex-col gap-24 w-full" }, sn = { class: "flex flex-col gap-8" }, an = { class: "fm-typo-en-body-lg-600" }, rn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary flex-grow" }, ln = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-error" }, un = { class: "flex flex-col p-16 gap-8" }, cn = { class: "flex flex-col gap-4" }, dn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border-b py-12 px-16" }, mn = { class: "grid grid-cols-[auto_100px_100px_48px] xs:grid-cols-[auto_80px_120px_48px] gap-8 px-8 items-center" }, pn = { class: "xs:col-span-3" }, fn = { class: "flex gap-8" }, vn = /* @__PURE__ */ ce({
378
+ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-800" }, on = { class: "flex flex-col gap-24 w-full" }, sn = { class: "flex flex-col gap-8" }, an = { class: "fm-typo-en-body-lg-600" }, ln = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary flex-grow" }, rn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-error" }, un = { class: "flex flex-col p-16 gap-8" }, cn = { class: "flex flex-col gap-4" }, dn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border-b py-12 px-16" }, mn = { class: "grid grid-cols-[auto_100px_100px_48px] xs:grid-cols-[auto_80px_120px_48px] gap-8 px-8 items-center" }, pn = { class: "xs:col-span-3" }, fn = { class: "flex gap-8" }, vn = /* @__PURE__ */ ce({
379
379
  __name: "ConvertSkuDialog",
380
380
  props: {
381
381
  sku: {},
@@ -383,280 +383,280 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
383
383
  show: { type: Boolean }
384
384
  },
385
385
  emits: ["update:show", "submitted"],
386
- setup(v, { expose: g, emit: u }) {
387
- const o = v, A = u, p = Lt(), l = Pe(), f = ye(), B = _e(), { t: $ } = de(), i = N(0), s = N(null), V = R(() => l.skus), k = R(
386
+ setup(y, { expose: b, emit: u }) {
387
+ const o = y, A = u, p = Lt(), c = Pe(), v = ye(), $ = _e(), { t: C } = de(), a = N(0), s = N(null), _ = R(() => c.skus), B = R(
388
388
  () => {
389
- var d, n;
390
- return (((n = (d = o.sku) == null ? void 0 : d.convert) == null ? void 0 : n.inventoryBindings) ?? []).filter(
391
- (a) => a.type === Ge.enum.SKU
389
+ var m, t;
390
+ return (((t = (m = o.sku) == null ? void 0 : m.convert) == null ? void 0 : t.inventoryBindings) ?? []).filter(
391
+ (r) => r.type === Ge.enum.SKU
392
392
  );
393
393
  }
394
394
  ), S = R({
395
395
  get() {
396
396
  return !!s.value;
397
397
  },
398
- set(d) {
399
- d ? s.value = He(k.value) : (s.value = null, i.value = Math.min(i.value, o.maxCount ?? 0));
398
+ set(m) {
399
+ m ? s.value = He(B.value) : (s.value = null, a.value = Math.min(a.value, o.maxCount ?? 0));
400
400
  }
401
- }), M = N(!1);
402
- xe([() => o.show], ([d]) => {
403
- d && (i.value = 0);
401
+ }), F = N(!1);
402
+ xe([() => o.show], ([m]) => {
403
+ m && (a.value = 0);
404
404
  });
405
- function h() {
406
- Y(o.sku, Se(i.value), s.value);
405
+ function n() {
406
+ Y(o.sku, Se(a.value), s.value);
407
407
  }
408
- function t(d) {
408
+ function l(m) {
409
409
  if (s.value)
410
410
  return !0;
411
- const n = Qe(d).isInteger().max(o.maxCount ?? 0).error ?? "";
412
- return n || !0;
411
+ const t = Qe(m).isInteger().max(o.maxCount ?? 0).error ?? "";
412
+ return t || !0;
413
413
  }
414
- function y(d) {
415
- var m;
416
- const n = (m = o.sku.convert) != null && m.measurement ? o.sku.unit.measurements.find((C) => {
414
+ function w(m) {
415
+ var f;
416
+ const t = (f = o.sku.convert) != null && f.measurement ? o.sku.unit.measurements.find((V) => {
417
417
  var H;
418
- return C.id === ((H = o.sku.convert) == null ? void 0 : H.measurement);
419
- }) ?? null : null, a = Ie(o.sku.unit, n), b = _t(+d);
420
- return Qe(b).isInteger().max(a).error ? "Precision cannot be more than " + a : !0;
418
+ return V.id === ((H = o.sku.convert) == null ? void 0 : H.measurement);
419
+ }) ?? null : null, r = Ie(o.sku.unit, t), k = _t(+m);
420
+ return Qe(k).isInteger().max(r).error ? "Precision cannot be more than " + r : !0;
421
421
  }
422
- const w = R(
422
+ const M = R(
423
423
  () => {
424
- var d, n;
425
- return (d = o.sku.convert) != null && d.measurement ? (n = o.sku.unit.measurements.find((a) => {
426
- var b;
427
- return a.id === ((b = o.sku.convert) == null ? void 0 : b.measurement);
428
- })) == null ? void 0 : n.abbrev : o.sku.unit.abbrev;
424
+ var m, t;
425
+ return (m = o.sku.convert) != null && m.measurement ? (t = o.sku.unit.measurements.find((r) => {
426
+ var k;
427
+ return r.id === ((k = o.sku.convert) == null ? void 0 : k.measurement);
428
+ })) == null ? void 0 : t.abbrev : o.sku.unit.abbrev;
429
429
  }
430
430
  ), j = R(() => {
431
- var b, c;
432
- const n = pt({
433
- bindings: ((b = o.sku.convert) == null ? void 0 : b.inventoryBindings) ?? [],
434
- skus: l.skus,
435
- skuGroups: l.skuGroups,
436
- recipes: l.recipes
437
- }).inventoryBindings.filter((m) => "success" in m && m.success).map((m) => m).map((m) => m.binding);
438
- return (c = s.value ?? n) == null ? void 0 : c.map((m) => {
439
- var re, ie, te, ae, Le;
440
- const C = l.skus.find((fe) => fe._id === m.id), H = ((re = m.measurement) == null ? void 0 : re.abbrev) ?? ((ie = C == null ? void 0 : C.unit) == null ? void 0 : ie.abbrev), K = (te = o.sku.convert) != null && te.measurement ? o.sku.unit.measurements.find((fe) => {
431
+ var k, d;
432
+ const t = pt({
433
+ bindings: ((k = o.sku.convert) == null ? void 0 : k.inventoryBindings) ?? [],
434
+ skus: c.skus,
435
+ skuGroups: c.skuGroups,
436
+ recipes: c.recipes
437
+ }).inventoryBindings.filter((f) => "success" in f && f.success).map((f) => f).map((f) => f.binding);
438
+ return (d = s.value ?? t) == null ? void 0 : d.map((f) => {
439
+ var le, ie, te, ae, Le;
440
+ const V = c.skus.find((fe) => fe._id === f.id), H = ((le = f.measurement) == null ? void 0 : le.abbrev) ?? ((ie = V == null ? void 0 : V.unit) == null ? void 0 : ie.abbrev), K = (te = o.sku.convert) != null && te.measurement ? o.sku.unit.measurements.find((fe) => {
441
441
  var ze;
442
442
  return fe.id === ((ze = o.sku.convert) == null ? void 0 : ze.measurement);
443
- }) ?? null : null, ee = Ie(o.sku.unit, K), E = y(`${i.value}`) === !0 ? me(
443
+ }) ?? null : null, ee = Ie(o.sku.unit, K), E = w(`${a.value}`) === !0 ? me(
444
444
  ft(
445
- m.amount,
446
- Se(+i.value, ee)
445
+ f.amount,
446
+ Se(+a.value, ee)
447
447
  ),
448
448
  !1
449
- ) : "0", q = (Le = (ae = s.value) == null ? void 0 : ae.find((fe) => fe.id === (C == null ? void 0 : C._id))) == null ? void 0 : Le.amount, J = q ? me(q, !1) : null;
449
+ ) : "0", q = (Le = (ae = s.value) == null ? void 0 : ae.find((fe) => fe.id === (V == null ? void 0 : V._id))) == null ? void 0 : Le.amount, J = q ? me(q, !1) : null;
450
450
  return {
451
- sku: C,
451
+ sku: V,
452
452
  convertAmount: J ?? E,
453
453
  abbrev: H
454
454
  };
455
455
  });
456
456
  }), P = N();
457
- g({
457
+ b({
458
458
  validateInputs: () => {
459
- var d, n;
460
- (n = (d = P.value) == null ? void 0 : d.validateInputs) == null || n.call(d);
459
+ var m, t;
460
+ (t = (m = P.value) == null ? void 0 : m.validateInputs) == null || t.call(m);
461
461
  },
462
462
  resetInputsValidation: () => {
463
- var d, n;
464
- (n = (d = P.value) == null ? void 0 : d.resetInputsValidation) == null || n.call(d);
463
+ var m, t;
464
+ (t = (m = P.value) == null ? void 0 : m.resetInputsValidation) == null || t.call(m);
465
465
  },
466
466
  resetInputs: () => {
467
- var d, n;
468
- (n = (d = P.value) == null ? void 0 : d.resetInputs) == null || n.call(d);
467
+ var m, t;
468
+ (t = (m = P.value) == null ? void 0 : m.resetInputs) == null || t.call(m);
469
469
  }
470
470
  });
471
471
  const T = Ne(o, "show");
472
- async function Y(d, n, a) {
473
- M.value = !0;
472
+ async function Y(m, t, r) {
473
+ F.value = !0;
474
474
  try {
475
- await f.convertSku({
475
+ await v.convertSku({
476
476
  conversions: [
477
477
  {
478
- doc: d,
479
- amount: n,
480
- overrides: a == null ? void 0 : a.map((b) => ({
481
- ...b,
478
+ doc: m,
479
+ amount: t,
480
+ overrides: r == null ? void 0 : r.map((k) => ({
481
+ ...k,
482
482
  amount: {
483
- ...b.amount,
484
- amount: -1 * Math.abs(b.amount.amount)
483
+ ...k.amount,
484
+ amount: -1 * Math.abs(k.amount.amount)
485
485
  // ensure truly negative
486
486
  }
487
487
  }))
488
488
  }
489
489
  ]
490
490
  }), A("update:show", !1), A("submitted");
491
- } catch (b) {
492
- B.open({
491
+ } catch (k) {
492
+ $.open({
493
493
  title: "Something went wrong",
494
- message: `Cannot convert ${d.name}. Please try again.`,
494
+ message: `Cannot convert ${m.name}. Please try again.`,
495
495
  type: "error"
496
- }), console.error("error at converting stock amount", d, n, b);
496
+ }), console.error("error at converting stock amount", m, t, k);
497
497
  } finally {
498
- M.value = !1;
498
+ F.value = !1;
499
499
  }
500
500
  }
501
- function W(d, n, a) {
502
- const b = +n;
503
- let c = a;
504
- n.length > 0 && isFinite(b) ? c = a.map((m) => (m.id !== d || (m.amount = ve(b)), m)) : c = a.map((m) => (m.id !== d || (m.amount = { amount: 0, precision: 0 }), m)), s.value = c;
501
+ function W(m, t, r) {
502
+ const k = +t;
503
+ let d = r;
504
+ t.length > 0 && isFinite(k) ? d = r.map((f) => (f.id !== m || (f.amount = ve(k)), f)) : d = r.map((f) => (f.id !== m || (f.amount = { amount: 0, precision: 0 }), f)), s.value = d;
505
505
  }
506
- function U(d) {
507
- const n = V.value.find((a) => a._id === d);
508
- return n ? st(n.unit, !0) : [];
506
+ function U(m) {
507
+ const t = _.value.find((r) => r._id === m);
508
+ return t ? st(t.unit, !0) : [];
509
509
  }
510
- function Z(d, n) {
511
- const a = U(d), b = a.find((c) => c.value === n) ?? a.find((c) => c.value === null);
512
- return b ? {
513
- ...b,
514
- label: b.abbrev
510
+ function Z(m, t) {
511
+ const r = U(m), k = r.find((d) => d.value === t) ?? r.find((d) => d.value === null);
512
+ return k ? {
513
+ ...k,
514
+ label: k.abbrev
515
515
  } : null;
516
516
  }
517
- function z(d, n, a) {
518
- let b;
519
- if (n === null)
520
- b = a.map((c) => (c.id !== d || (c.measurement = null), c)) ?? [];
517
+ function z(m, t, r) {
518
+ let k;
519
+ if (t === null)
520
+ k = r.map((d) => (d.id !== m || (d.measurement = null), d)) ?? [];
521
521
  else {
522
- const c = V.value.find((m) => m._id === d);
523
- b = a.map((m) => {
524
- var C, H;
525
- return m.id !== d || (m.measurement = (H = (C = c == null ? void 0 : c.unit) == null ? void 0 : C.measurements) == null ? void 0 : H.find((K) => K.id === n)), m;
522
+ const d = _.value.find((f) => f._id === m);
523
+ k = r.map((f) => {
524
+ var V, H;
525
+ return f.id !== m || (f.measurement = (H = (V = d == null ? void 0 : d.unit) == null ? void 0 : V.measurements) == null ? void 0 : H.find((K) => K.id === t)), f;
526
526
  }) ?? [];
527
527
  }
528
- s.value = b;
528
+ s.value = k;
529
529
  }
530
- function Q(d, n) {
531
- const a = n.filter((b) => b.id !== d);
532
- s.value = a;
530
+ function Q(m, t) {
531
+ const r = t.filter((k) => k.id !== m);
532
+ s.value = r;
533
533
  }
534
534
  function G() {
535
- const d = (s.value ?? []).map((n) => ({
536
- ...n,
535
+ const m = (s.value ?? []).map((t) => ({
536
+ ...t,
537
537
  type: Ge.enum.SKU
538
538
  }));
539
539
  p.promptIngredientsBinding(
540
- d,
541
- (n) => s.value = n,
540
+ m,
541
+ (t) => s.value = t,
542
542
  o.sku._id
543
543
  );
544
544
  }
545
545
  return xe(
546
546
  () => o.show,
547
- (d) => {
548
- d || (s.value = null, i.value = 0);
547
+ (m) => {
548
+ m || (s.value = null, a.value = 0);
549
549
  }
550
- ), (d, n) => {
551
- const a = D("FmTextField"), b = D("FmForm"), c = D("FmCard"), m = D("FmSwitch"), C = D("FmFormGroup"), H = D("FmSelect"), K = D("FmButton"), ee = D("FmSideSheet");
552
- return F(), L(ee, {
550
+ ), (m, t) => {
551
+ const r = D("FmTextField"), k = D("FmForm"), d = D("FmCard"), f = D("FmSwitch"), V = D("FmFormGroup"), H = D("FmSelect"), K = D("FmButton"), ee = D("FmSideSheet");
552
+ return x(), L(ee, {
553
553
  "dismiss-away": "",
554
- modelValue: r(T),
555
- "onUpdate:modelValue": n[3] || (n[3] = (E) => Ue(T) ? T.value = E : null),
554
+ modelValue: i(T),
555
+ "onUpdate:modelValue": t[3] || (t[3] = (E) => Ue(T) ? T.value = E : null),
556
556
  "max-width": 500
557
557
  }, {
558
558
  "side-sheet-header": I(() => [
559
559
  e("div", tn, [
560
- e("div", nn, _(r($)("inventory.stock.convert.title", { name: d.sku.name })), 1)
560
+ e("div", nn, h(i(C)("inventory.stock.convert.title", { name: m.sku.name })), 1)
561
561
  ])
562
562
  ]),
563
563
  default: I(() => [
564
564
  e("div", on, [
565
- x(b, {
565
+ g(k, {
566
566
  ref_key: "formRef",
567
567
  ref: P,
568
- onValidationSuccess: h
568
+ onValidationSuccess: n
569
569
  }, {
570
570
  default: I(() => [
571
- x(a, {
572
- disabled: M.value,
573
- "model-value": i.value,
574
- "onUpdate:modelValue": n[0] || (n[0] = (E) => i.value = E),
575
- label: r($)("inventory.stock.convert.amount"),
576
- rules: [t, y, r(Fe)(0)],
577
- "append-text": w.value,
578
- "helper-text": s.value ? void 0 : `Max ${d.maxCount} ${w.value}`
571
+ g(r, {
572
+ disabled: F.value,
573
+ "model-value": a.value,
574
+ "onUpdate:modelValue": t[0] || (t[0] = (E) => a.value = E),
575
+ label: i(C)("inventory.stock.convert.amount"),
576
+ rules: [l, w, i(Fe)(0)],
577
+ "append-text": M.value,
578
+ "helper-text": s.value ? void 0 : `Max ${m.maxCount} ${M.value}`
579
579
  }, null, 8, ["disabled", "model-value", "label", "rules", "append-text", "helper-text"])
580
580
  ]),
581
581
  _: 1
582
582
  }, 512),
583
- x(c, {
583
+ g(d, {
584
584
  variant: "outlined",
585
585
  class: "p-16"
586
586
  }, {
587
587
  default: I(() => [
588
588
  e("div", sn, [
589
- e("div", an, _(r($)("inventory.stock.convert.deductionSummary")), 1),
590
- (F(!0), O(ne, null, le(j.value, (E) => {
589
+ e("div", an, h(i(C)("inventory.stock.convert.deductionSummary")), 1),
590
+ (x(!0), O(ne, null, re(j.value, (E) => {
591
591
  var q, J;
592
- return F(), O("div", {
592
+ return x(), O("div", {
593
593
  key: (q = E.sku) == null ? void 0 : q._id,
594
594
  class: "flex items-center"
595
595
  }, [
596
- e("div", rn, _((J = E.sku) == null ? void 0 : J.name), 1),
597
- e("div", ln, " -" + _(E.convertAmount) + " " + _(E.abbrev), 1)
596
+ e("div", ln, h((J = E.sku) == null ? void 0 : J.name), 1),
597
+ e("div", rn, " -" + h(E.convertAmount) + " " + h(E.abbrev), 1)
598
598
  ]);
599
599
  }), 128))
600
600
  ])
601
601
  ]),
602
602
  _: 1
603
603
  }),
604
- x(c, { variant: "outlined" }, {
604
+ g(d, { variant: "outlined" }, {
605
605
  default: I(() => [
606
606
  e("div", un, [
607
- x(m, {
607
+ g(f, {
608
608
  value: "",
609
609
  modelValue: S.value,
610
- "onUpdate:modelValue": n[1] || (n[1] = (E) => S.value = E),
611
- label: r($)("inventory.stock.convert.overrideDeduction"),
610
+ "onUpdate:modelValue": t[1] || (t[1] = (E) => S.value = E),
611
+ label: i(C)("inventory.stock.convert.overrideDeduction"),
612
612
  "label-placement": "right"
613
613
  }, null, 8, ["modelValue", "label"]),
614
- S.value ? (F(), O(ne, { key: 0 }, [
615
- x(C, {
614
+ S.value ? (x(), O(ne, { key: 0 }, [
615
+ g(V, {
616
616
  modelValue: s.value,
617
- rules: [r(vt)(1, "Must have at least one ingredient binding")]
617
+ rules: [i(vt)(1, "Must have at least one ingredient binding")]
618
618
  }, null, 8, ["modelValue", "rules"]),
619
619
  e("div", cn, [
620
- e("div", dn, _(r($)("inventory.stock.convert.ingredients")), 1),
621
- (F(!0), O(ne, null, le(s.value, (E) => (F(), L(C, {
620
+ e("div", dn, h(i(C)("inventory.stock.convert.ingredients")), 1),
621
+ (x(!0), O(ne, null, re(s.value, (E) => (x(), L(V, {
622
622
  key: E.id,
623
- disabled: M.value,
624
- modelValue: +r(me)(E.amount ?? { amount: 1, precision: 0 }),
623
+ disabled: F.value,
624
+ modelValue: +i(me)(E.amount ?? { amount: 1, precision: 0 }),
625
625
  rules: [
626
- r(yt)(
627
- V.value.find((q) => q._id === E.id).unit,
626
+ i(yt)(
627
+ _.value.find((q) => q._id === E.id).unit,
628
628
  E.measurement
629
629
  ),
630
- r(Fe)(0)
630
+ i(Fe)(0)
631
631
  ]
632
632
  }, {
633
633
  default: I(({ invalid: q }) => {
634
- var J, re, ie;
634
+ var J, le, ie;
635
635
  return [
636
636
  e("div", mn, [
637
- e("div", pn, _((J = V.value.find((te) => te._id === E.id)) == null ? void 0 : J.name), 1),
638
- x(a, {
637
+ e("div", pn, h((J = _.value.find((te) => te._id === E.id)) == null ? void 0 : J.name), 1),
638
+ g(r, {
639
639
  class: "xs:col-span-2",
640
- disabled: M.value,
641
- modelValue: +r(me)(
640
+ disabled: F.value,
641
+ modelValue: +i(me)(
642
642
  E.amount ?? { amount: 1, precision: 0 }
643
643
  ),
644
644
  "onUpdate:modelValue": (te) => W(E.id, te, s.value ?? []),
645
645
  invalid: q
646
646
  }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
647
- x(H, {
648
- disabled: M.value,
647
+ g(H, {
648
+ disabled: F.value,
649
649
  class: "translate-y-[2px]",
650
650
  items: U(E.id),
651
- "model-value": (ie = Z(E.id, (re = E.measurement) == null ? void 0 : re.id)) == null ? void 0 : ie.value,
651
+ "model-value": (ie = Z(E.id, (le = E.measurement) == null ? void 0 : le.id)) == null ? void 0 : ie.value,
652
652
  "onUpdate:modelValue": (te) => z(E.id, te, s.value ?? []),
653
653
  invalid: q
654
654
  }, {
655
- "helper-text": I(() => n[4] || (n[4] = [])),
655
+ "helper-text": I(() => t[4] || (t[4] = [])),
656
656
  _: 2
657
657
  }, 1032, ["disabled", "items", "model-value", "onUpdate:modelValue", "invalid"]),
658
- x(K, {
659
- disabled: M.value,
658
+ g(K, {
659
+ disabled: F.value,
660
660
  type: "button",
661
661
  variant: "tertiary",
662
662
  icon: "delete",
@@ -669,9 +669,9 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
669
669
  }, 1032, ["disabled", "modelValue", "rules"]))), 128))
670
670
  ]),
671
671
  e("div", null, [
672
- x(K, {
672
+ g(K, {
673
673
  icon: "link",
674
- label: r($)("inventory.stock.convert.linkIngredient"),
674
+ label: i(C)("inventory.stock.convert.linkIngredient"),
675
675
  variant: "plain",
676
676
  onClick: G
677
677
  }, null, 8, ["label"])
@@ -685,10 +685,10 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
685
685
  ]),
686
686
  "side-sheet-footer": I(() => [
687
687
  e("div", fn, [
688
- x(K, {
689
- loading: M.value,
690
- label: r($)("inventory.stock.convert.convertButton"),
691
- onClick: n[2] || (n[2] = (E) => {
688
+ g(K, {
689
+ loading: F.value,
690
+ label: i(C)("inventory.stock.convert.convertButton"),
691
+ onClick: t[2] || (t[2] = (E) => {
692
692
  var q, J;
693
693
  return (J = (q = P.value) == null ? void 0 : q.validateInputs) == null ? void 0 : J.call(q);
694
694
  })
@@ -700,12 +700,12 @@ const tn = { class: "flex items-center" }, nn = { class: "fm-typo-en-title-md-80
700
700
  };
701
701
  }
702
702
  });
703
- function De(v, g) {
704
- const u = Se(v, g);
703
+ function De(y, b) {
704
+ const u = Se(y, b);
705
705
  return { ...u, amount: -u.amount };
706
706
  }
707
- function Je(v, g) {
708
- return Se(Math.abs(v), g);
707
+ function Je(y, b) {
708
+ return Se(Math.abs(y), b);
709
709
  }
710
710
  const je = {
711
711
  [oe.enum.DAMAGE]: {
@@ -735,113 +735,113 @@ const je = {
735
735
  disabled: { type: Boolean }
736
736
  },
737
737
  emits: ["update:modelValue", "click:delete"],
738
- setup(v, { emit: g }) {
739
- const u = v, o = g, A = R(
740
- () => Object.keys(je).map((i) => ({
741
- label: ht(i),
742
- value: i
738
+ setup(y, { emit: b }) {
739
+ const u = y, o = b, A = R(
740
+ () => Object.keys(je).map((a) => ({
741
+ label: ht(a),
742
+ value: a
743
743
  }))
744
- ), p = R(() => st(u.modelValue.doc.unit, !0)), l = R({
744
+ ), p = R(() => st(u.modelValue.doc.unit, !0)), c = R({
745
745
  get() {
746
746
  return u.modelValue.type ?? oe.enum.PURCHASE;
747
747
  },
748
- set(i) {
748
+ set(a) {
749
749
  const s = {
750
750
  ...u.modelValue
751
751
  };
752
- s.type = i;
753
- const V = We(u.modelValue.amount);
752
+ s.type = a;
753
+ const _ = We(u.modelValue.amount);
754
754
  s.amount = je[s.type].toAdjustmentAmount(
755
- +me(V),
756
- V.precision
755
+ +me(_),
756
+ _.precision
757
757
  ), o("update:modelValue", s);
758
758
  }
759
- }), f = R({
759
+ }), v = R({
760
760
  get() {
761
- const i = We(u.modelValue.amount);
762
- return +me(i);
761
+ const a = We(u.modelValue.amount);
762
+ return +me(a);
763
763
  },
764
- set(i) {
764
+ set(a) {
765
765
  const s = {
766
766
  ...u.modelValue
767
- }, V = ve(i);
768
- s.amount = je[l.value].toAdjustmentAmount(
769
- i,
770
- V.precision
767
+ }, _ = ve(a);
768
+ s.amount = je[c.value].toAdjustmentAmount(
769
+ a,
770
+ _.precision
771
771
  ), o("update:modelValue", s);
772
772
  }
773
- }), B = R({
773
+ }), $ = R({
774
774
  get() {
775
- var i;
776
- return ((i = u.modelValue.measurement) == null ? void 0 : i.id) ?? null;
775
+ var a;
776
+ return ((a = u.modelValue.measurement) == null ? void 0 : a.id) ?? null;
777
777
  },
778
- set(i) {
779
- var V, k;
778
+ set(a) {
779
+ var _, B;
780
780
  const s = {
781
781
  ...u.modelValue
782
782
  };
783
- s.measurement = ((k = (V = u.modelValue.doc.unit) == null ? void 0 : V.measurements) == null ? void 0 : k.find((S) => S.id === i)) ?? null, o("update:modelValue", s);
783
+ s.measurement = ((B = (_ = u.modelValue.doc.unit) == null ? void 0 : _.measurements) == null ? void 0 : B.find((S) => S.id === a)) ?? null, o("update:modelValue", s);
784
784
  }
785
- }), $ = R({
785
+ }), C = R({
786
786
  get() {
787
787
  return u.modelValue.remark ?? "";
788
788
  },
789
- set(i) {
789
+ set(a) {
790
790
  const s = {
791
791
  ...u.modelValue
792
792
  };
793
- s.remark = i, o("update:modelValue", s);
793
+ s.remark = a, o("update:modelValue", s);
794
794
  }
795
795
  });
796
- return (i, s) => {
797
- const V = D("FmButton"), k = D("FmSelect"), S = D("FmTextarea"), M = D("FmCard");
798
- return F(), L(M, {
796
+ return (a, s) => {
797
+ const _ = D("FmButton"), B = D("FmSelect"), S = D("FmTextarea"), F = D("FmCard");
798
+ return x(), L(F, {
799
799
  variant: "outlined",
800
800
  class: "grid grid-cols-2 gap-8 p-16"
801
801
  }, {
802
802
  default: I(() => [
803
803
  e("div", yn, [
804
- e("div", _n, _(i.modelValue.doc.name), 1),
805
- x(V, {
804
+ e("div", _n, h(a.modelValue.doc.name), 1),
805
+ g(_, {
806
806
  variant: "tertiary",
807
807
  "prepend-icon": "delete",
808
- onClick: s[0] || (s[0] = (h) => o("click:delete"))
808
+ onClick: s[0] || (s[0] = (n) => o("click:delete"))
809
809
  })
810
810
  ]),
811
- x(k, {
812
- disabled: i.disabled,
811
+ g(B, {
812
+ disabled: a.disabled,
813
813
  class: "col-span-2",
814
814
  label: "Type",
815
815
  items: A.value,
816
- modelValue: l.value,
817
- "onUpdate:modelValue": s[1] || (s[1] = (h) => l.value = h),
818
- rules: [r(kt)()],
816
+ modelValue: c.value,
817
+ "onUpdate:modelValue": s[1] || (s[1] = (n) => c.value = n),
818
+ rules: [i(kt)()],
819
819
  "label-mark": "required"
820
820
  }, null, 8, ["disabled", "items", "modelValue", "rules"]),
821
- x(zt, {
822
- disabled: i.disabled,
821
+ g(zt, {
822
+ disabled: a.disabled,
823
823
  label: "Amount",
824
- step: +r(me)({
824
+ step: +i(me)({
825
825
  amount: 1,
826
- precision: r(Ie)(i.modelValue.doc.unit, i.modelValue.measurement)
826
+ precision: i(Ie)(a.modelValue.doc.unit, a.modelValue.measurement)
827
827
  }),
828
- modelValue: f.value,
829
- "onUpdate:modelValue": s[2] || (s[2] = (h) => f.value = h),
830
- rules: [r(Fe)(0)]
828
+ modelValue: v.value,
829
+ "onUpdate:modelValue": s[2] || (s[2] = (n) => v.value = n),
830
+ rules: [i(Fe)(0)]
831
831
  }, null, 8, ["disabled", "step", "modelValue", "rules"]),
832
- x(k, {
833
- disabled: i.disabled,
832
+ g(B, {
833
+ disabled: a.disabled,
834
834
  label: "Unit",
835
835
  items: p.value,
836
- modelValue: B.value,
837
- "onUpdate:modelValue": s[3] || (s[3] = (h) => B.value = h)
836
+ modelValue: $.value,
837
+ "onUpdate:modelValue": s[3] || (s[3] = (n) => $.value = n)
838
838
  }, null, 8, ["disabled", "items", "modelValue"]),
839
- x(S, {
839
+ g(S, {
840
840
  class: "col-span-2",
841
- disabled: i.disabled,
841
+ disabled: a.disabled,
842
842
  label: "Remark",
843
- modelValue: $.value,
844
- "onUpdate:modelValue": s[4] || (s[4] = (h) => $.value = h),
843
+ modelValue: C.value,
844
+ "onUpdate:modelValue": s[4] || (s[4] = (n) => C.value = n),
845
845
  "label-mark": "optional"
846
846
  }, null, 8, ["disabled", "modelValue"])
847
847
  ]),
@@ -856,27 +856,27 @@ const je = {
856
856
  show: { type: Boolean }
857
857
  },
858
858
  emits: ["update:show", "submitted"],
859
- setup(v, { expose: g, emit: u }) {
860
- const o = v, A = u, p = Pe(), l = Oe(), f = ye(), B = _e(), $ = N(!1), { t: i } = de();
859
+ setup(y, { expose: b, emit: u }) {
860
+ const o = y, A = u, p = Pe(), c = Oe(), v = ye(), $ = _e(), C = N(!1), { t: a } = de();
861
861
  function s() {
862
- M(He(S));
862
+ F(He(S));
863
863
  }
864
- const V = N();
865
- g({
864
+ const _ = N();
865
+ b({
866
866
  validateInputs: () => {
867
- var y, w;
868
- (w = (y = V.value) == null ? void 0 : y.validateInputs) == null || w.call(y);
867
+ var w, M;
868
+ (M = (w = _.value) == null ? void 0 : w.validateInputs) == null || M.call(w);
869
869
  },
870
870
  resetInputsValidation: () => {
871
- var y, w;
872
- (w = (y = V.value) == null ? void 0 : y.resetInputsValidation) == null || w.call(y);
871
+ var w, M;
872
+ (M = (w = _.value) == null ? void 0 : w.resetInputsValidation) == null || M.call(w);
873
873
  },
874
874
  resetInputs: () => {
875
- var y, w;
876
- (w = (y = V.value) == null ? void 0 : y.resetInputs) == null || w.call(y);
875
+ var w, M;
876
+ (M = (w = _.value) == null ? void 0 : w.resetInputs) == null || M.call(w);
877
877
  }
878
878
  });
879
- const k = Ne(o, "show"), S = it({
879
+ const B = Ne(o, "show"), S = it({
880
880
  remark: "",
881
881
  adjustments: [
882
882
  {
@@ -889,8 +889,8 @@ const je = {
889
889
  }
890
890
  ]
891
891
  });
892
- xe([() => o.show], ([y]) => {
893
- y && (S.remark = "", S.adjustments = [
892
+ xe([() => o.show], ([w]) => {
893
+ w && (S.remark = "", S.adjustments = [
894
894
  {
895
895
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
896
896
  type: oe.enum.PURCHASE,
@@ -901,42 +901,42 @@ const je = {
901
901
  }
902
902
  ]);
903
903
  });
904
- async function M(y) {
905
- $.value = !0;
904
+ async function F(w) {
905
+ C.value = !0;
906
906
  try {
907
- await f.adjustSku({
908
- remark: y.remark,
909
- adjustments: y.adjustments.map(({ doc: w, remark: j, type: P, amount: T, measurement: Y }) => ({
910
- id: w._id,
907
+ await v.adjustSku({
908
+ remark: w.remark,
909
+ adjustments: w.adjustments.map(({ doc: M, remark: j, type: P, amount: T, measurement: Y }) => ({
910
+ id: M._id,
911
911
  amount: T,
912
912
  measurement: Y,
913
913
  remark: j,
914
- doc: w,
914
+ doc: M,
915
915
  type: P
916
916
  }))
917
917
  }), A("update:show", !1), A("submitted");
918
- } catch (w) {
919
- B.open({
920
- title: i("inventory.stock.adjust.error.title"),
921
- message: i("inventory.stock.adjust.error.message"),
918
+ } catch (M) {
919
+ $.open({
920
+ title: a("inventory.stock.adjust.error.title"),
921
+ message: a("inventory.stock.adjust.error.message"),
922
922
  type: "error"
923
- }), console.log("error on adjust ingredients", y, w);
923
+ }), console.log("error on adjust ingredients", w, M);
924
924
  } finally {
925
- $.value = !1;
925
+ C.value = !1;
926
926
  }
927
927
  }
928
- function h() {
929
- const y = p.skus.map((j) => ({
928
+ function n() {
929
+ const w = p.skus.map((j) => ({
930
930
  label: j.name,
931
931
  sublabel: j.code,
932
932
  value: j._id
933
- })), w = y.filter((j) => S.adjustments.find((P) => P.doc._id === j.value)).map((j) => j.value);
934
- l.open({
933
+ })), M = w.filter((j) => S.adjustments.find((P) => P.doc._id === j.value)).map((j) => j.value);
934
+ c.open({
935
935
  title: "Select ingredients",
936
936
  contentComponent: bt,
937
937
  contentComponentProps: {
938
- items: y,
939
- modelValue: w
938
+ items: w,
939
+ modelValue: M
940
940
  },
941
941
  overlay: !0,
942
942
  closeButton: !0,
@@ -963,49 +963,49 @@ const je = {
963
963
  );
964
964
  });
965
965
  }
966
- function t(y) {
967
- S.adjustments.splice(y, 1);
966
+ function l(w) {
967
+ S.adjustments.splice(w, 1);
968
968
  }
969
- return (y, w) => {
969
+ return (w, M) => {
970
970
  const j = D("FmTextarea"), P = D("FmButton"), T = D("FmForm"), Y = D("FmSideSheet");
971
- return F(), L(Y, {
972
- modelValue: r(k),
973
- "onUpdate:modelValue": w[2] || (w[2] = (W) => Ue(k) ? k.value = W : null),
971
+ return x(), L(Y, {
972
+ modelValue: i(B),
973
+ "onUpdate:modelValue": M[2] || (M[2] = (W) => Ue(B) ? B.value = W : null),
974
974
  "dismiss-away": "",
975
975
  "max-width": 500
976
976
  }, {
977
977
  "side-sheet-header": I(() => [
978
978
  e("div", kn, [
979
- e("div", bn, _(r(i)("inventory.stock.adjust.title")), 1)
979
+ e("div", bn, h(i(a)("inventory.stock.adjust.title")), 1)
980
980
  ])
981
981
  ]),
982
982
  default: I(() => [
983
- x(T, {
983
+ g(T, {
984
984
  class: "w-full flex flex-col gap-12",
985
985
  ref_key: "formRef",
986
- ref: V,
986
+ ref: _,
987
987
  onValidationSuccess: s
988
988
  }, {
989
989
  default: I(() => [
990
- x(j, {
991
- label: r(i)("inventory.stock.adjust.remark"),
990
+ g(j, {
991
+ label: i(a)("inventory.stock.adjust.remark"),
992
992
  modelValue: S.remark,
993
- "onUpdate:modelValue": w[0] || (w[0] = (W) => S.remark = W)
993
+ "onUpdate:modelValue": M[0] || (M[0] = (W) => S.remark = W)
994
994
  }, null, 8, ["label", "modelValue"]),
995
995
  e("div", gn, [
996
- e("div", xn, _(r(i)("inventory.stock.adjust.adjustedItems")), 1),
997
- x(P, {
996
+ e("div", xn, h(i(a)("inventory.stock.adjust.adjustedItems")), 1),
997
+ g(P, {
998
998
  "prepend-icon": "add",
999
999
  variant: "tertiary",
1000
1000
  size: "md",
1001
- onClick: h
1001
+ onClick: n
1002
1002
  })
1003
1003
  ]),
1004
- (F(!0), O(ne, null, le(S.adjustments, (W, U) => (F(), L(hn, {
1004
+ (x(!0), O(ne, null, re(S.adjustments, (W, U) => (x(), L(hn, {
1005
1005
  key: W.id,
1006
1006
  modelValue: S.adjustments[U],
1007
1007
  "onUpdate:modelValue": (Z) => S.adjustments[U] = Z,
1008
- "onClick:delete": (Z) => t(U)
1008
+ "onClick:delete": (Z) => l(U)
1009
1009
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onClick:delete"]))), 128))
1010
1010
  ]),
1011
1011
  _: 1
@@ -1013,12 +1013,12 @@ const je = {
1013
1013
  ]),
1014
1014
  "side-sheet-footer": I(() => [
1015
1015
  e("div", Sn, [
1016
- x(P, {
1017
- label: r(i)("inventory.stock.adjust.adjustButton"),
1018
- loading: $.value,
1019
- onClick: w[1] || (w[1] = (W) => {
1016
+ g(P, {
1017
+ label: i(a)("inventory.stock.adjust.adjustButton"),
1018
+ loading: C.value,
1019
+ onClick: M[1] || (M[1] = (W) => {
1020
1020
  var U, Z;
1021
- return (Z = (U = V.value) == null ? void 0 : U.validateInputs) == null ? void 0 : Z.call(U);
1021
+ return (Z = (U = _.value) == null ? void 0 : U.validateInputs) == null ? void 0 : Z.call(U);
1022
1022
  })
1023
1023
  }, null, 8, ["label", "loading"])
1024
1024
  ])
@@ -1027,22 +1027,22 @@ const je = {
1027
1027
  }, 8, ["modelValue"]);
1028
1028
  };
1029
1029
  }
1030
- }), wn = gt((v, g) => ({
1030
+ }), wn = gt((y, b) => ({
1031
1031
  // TODO: remove once latest inventory backend has been push
1032
1032
  async findBillsByBusinessId(u, o, A) {
1033
- const p = `${v.businessesBackendUrl}/${u}/reports/find-many`, l = {
1033
+ const p = `${y.businessesBackendUrl}/${u}/reports/find-many`, c = {
1034
1034
  // type: TYPE.bill,
1035
1035
  type: "bill",
1036
1036
  restaurantIds: o,
1037
1037
  ids: A
1038
1038
  };
1039
- return await g.post(p, l);
1039
+ return await b.post(p, c);
1040
1040
  },
1041
1041
  async findBillsById(u) {
1042
- const A = pe().currentLocationDBName, p = `${v.inventoryBackendUrl}/${A}/bill/search`, l = {
1042
+ const A = pe().currentLocationDBName, p = `${y.inventoryBackendUrl}/${A}/bill/search`, c = {
1043
1043
  ids: u
1044
1044
  };
1045
- return await g.post(p, l);
1045
+ return await b.post(p, c);
1046
1046
  }
1047
1047
  })), $n = {
1048
1048
  key: 0,
@@ -1056,100 +1056,100 @@ const je = {
1056
1056
  modelModifiers: {}
1057
1057
  }),
1058
1058
  emits: /* @__PURE__ */ Ye(["refreshHistory"], ["update:modelValue"]),
1059
- setup(v, { emit: g }) {
1060
- const u = v, o = g, A = ye(), p = ut(v, "modelValue"), l = N(!1), f = N(!1), B = N(!1), $ = N({
1059
+ setup(y, { emit: b }) {
1060
+ const u = y, o = b, A = ye(), p = ut(y, "modelValue"), c = N(!1), v = N(!1), $ = N(!1), C = N({
1061
1061
  _id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
1062
1062
  skus: []
1063
- }), i = N();
1063
+ }), a = N();
1064
1064
  Ee(async () => {
1065
- l.value = !0;
1066
- const h = await A.readSingleAdjustment(u.adjustmentId);
1067
- if (!h) throw new Error("Adjustment not found");
1068
- $.value = h, l.value = !1;
1065
+ c.value = !0;
1066
+ const n = await A.readSingleAdjustment(u.adjustmentId);
1067
+ if (!n) throw new Error("Adjustment not found");
1068
+ C.value = n, c.value = !1;
1069
1069
  });
1070
1070
  async function s() {
1071
- var t, y;
1072
- if ((y = (t = i == null ? void 0 : i.value) == null ? void 0 : t.validateInputs) == null || y.call(t), !f.value) return;
1073
- const h = {};
1074
- Object.keys(p.value || {}).forEach((w) => {
1071
+ var l, w;
1072
+ if ((w = (l = a == null ? void 0 : a.value) == null ? void 0 : l.validateInputs) == null || w.call(l), !v.value) return;
1073
+ const n = {};
1074
+ Object.keys(p.value || {}).forEach((M) => {
1075
1075
  var j;
1076
- Object.keys(((j = p.value) == null ? void 0 : j[w]) || {}).forEach((P) => {
1076
+ Object.keys(((j = p.value) == null ? void 0 : j[M]) || {}).forEach((P) => {
1077
1077
  var Y, W;
1078
- const T = (W = (Y = p.value) == null ? void 0 : Y[w]) == null ? void 0 : W[Number(P)];
1079
- T && k(T.amount) > 0 && (h[w] || (h[w] = []), h[w].push(T));
1078
+ const T = (W = (Y = p.value) == null ? void 0 : Y[M]) == null ? void 0 : W[Number(P)];
1079
+ T && B(T.amount) > 0 && (n[M] || (n[M] = []), n[M].push(T));
1080
1080
  });
1081
1081
  }), await A.revertWastageAdjustment({
1082
1082
  targetWastageAdjustmentId: u.adjustmentId,
1083
- amountsGoingToAdjust: h
1084
- }), o("refreshHistory"), B.value = !1, p.value = {};
1083
+ amountsGoingToAdjust: n
1084
+ }), o("refreshHistory"), $.value = !1, p.value = {};
1085
1085
  }
1086
- function V(h, t, y) {
1086
+ function _(n, l, w) {
1087
1087
  return R({
1088
1088
  get: () => {
1089
1089
  var j, P, T;
1090
- const w = (T = (P = (j = p.value) == null ? void 0 : j[h]) == null ? void 0 : P[t]) == null ? void 0 : T.amount;
1091
- return w ? k(w, !0) : 0;
1090
+ const M = (T = (P = (j = p.value) == null ? void 0 : j[n]) == null ? void 0 : P[l]) == null ? void 0 : T.amount;
1091
+ return M ? B(M, !0) : 0;
1092
1092
  },
1093
- set: (w) => {
1093
+ set: (M) => {
1094
1094
  p.value || (p.value = {});
1095
1095
  const j = { ...p.value };
1096
- j[h] || (j[h] = {}), j[h][t] = {
1097
- amount: Ce.fromNumber(w),
1096
+ j[n] || (j[n] = {}), j[n][l] = {
1097
+ amount: Ce.fromNumber(M),
1098
1098
  type: oe.Enum.WASTAGE,
1099
- measurement: y
1099
+ measurement: w
1100
1100
  }, p.value = j;
1101
1101
  }
1102
1102
  });
1103
1103
  }
1104
- function k(h, t = !0) {
1105
- const y = Number(Ce.toFormatString({ value: h }));
1106
- return t ? Math.abs(y) : y;
1104
+ function B(n, l = !0) {
1105
+ const w = Number(Ce.toFormatString({ value: n }));
1106
+ return l ? Math.abs(w) : w;
1107
1107
  }
1108
- function S(h, t) {
1109
- return t.measurement ? t.measurement.abbrev : h.sku.unit.abbrev;
1108
+ function S(n, l) {
1109
+ return l.measurement ? l.measurement.abbrev : n.sku.unit.abbrev;
1110
1110
  }
1111
- function M(h, t) {
1112
- return t === 0 ? "N/A" : (h + t).toString();
1111
+ function F(n, l) {
1112
+ return l === 0 ? "N/A" : (n + l).toString();
1113
1113
  }
1114
- return (h, t) => {
1115
- const y = D("FmIcon"), w = D("FmStepperField"), j = D("FmCard"), P = D("FmForm"), T = D("FmSpacer"), Y = D("FmButton"), W = D("FmDialog");
1116
- return F(), L(W, {
1117
- modelValue: B.value,
1118
- "onUpdate:modelValue": t[4] || (t[4] = (U) => B.value = U),
1114
+ return (n, l) => {
1115
+ const w = D("FmIcon"), M = D("FmStepperField"), j = D("FmCard"), P = D("FmForm"), T = D("FmSpacer"), Y = D("FmButton"), W = D("FmDialog");
1116
+ return x(), L(W, {
1117
+ modelValue: $.value,
1118
+ "onUpdate:modelValue": l[4] || (l[4] = (U) => $.value = U),
1119
1119
  overlay: !0
1120
1120
  }, {
1121
1121
  "dialog-button": I(() => [
1122
- e("button", {
1123
- onClick: t[0] || (t[0] = (U) => B.value = !0),
1124
- class: "rounded-md hover:bg-gray-100 transition-colors"
1125
- }, [
1126
- x(Gt, null, {
1127
- default: I(() => [
1128
- x(y, {
1122
+ g(Gt, null, {
1123
+ default: I(() => [
1124
+ e("button", {
1125
+ onClick: l[0] || (l[0] = (U) => $.value = !0),
1126
+ class: "rounded-md hover:bg-gray-100 transition-colors"
1127
+ }, [
1128
+ g(w, {
1129
1129
  name: "edit",
1130
1130
  size: "sm"
1131
1131
  })
1132
- ]),
1133
- _: 1
1134
- })
1135
- ])
1132
+ ])
1133
+ ]),
1134
+ _: 1
1135
+ })
1136
1136
  ]),
1137
- "dialog-header": I(() => t[5] || (t[5] = [
1137
+ "dialog-header": I(() => l[5] || (l[5] = [
1138
1138
  e("div", null, "Amend Adjustment", -1)
1139
1139
  ])),
1140
1140
  "dialog-footer": I(() => [
1141
1141
  e("div", In, [
1142
- t[13] || (t[13] = e("span", { class: "text-fm-color-system-warning-400 fm-typo-en-body-sm-400" }, "1. New adjustment EXTRA will be created for each reversal", -1)),
1142
+ l[13] || (l[13] = e("span", { class: "text-fm-color-system-warning-400 fm-typo-en-body-sm-400" }, "1. New adjustment EXTRA will be created for each reversal", -1)),
1143
1143
  e("div", Tn, [
1144
- x(T),
1145
- x(Y, {
1144
+ g(T),
1145
+ g(Y, {
1146
1146
  class: "sm:w-full xs:w-full",
1147
1147
  label: "Close",
1148
1148
  size: "md",
1149
1149
  variant: "tertiary",
1150
- onClick: t[3] || (t[3] = (U) => B.value = !1)
1150
+ onClick: l[3] || (l[3] = (U) => $.value = !1)
1151
1151
  }),
1152
- x(Y, {
1152
+ g(Y, {
1153
1153
  class: "sm:w-full xs:w-full",
1154
1154
  label: "Submit",
1155
1155
  size: "md",
@@ -1160,64 +1160,64 @@ const je = {
1160
1160
  ])
1161
1161
  ]),
1162
1162
  default: I(() => [
1163
- l.value ? (F(), O("div", $n)) : (F(), L(P, {
1163
+ c.value ? (x(), O("div", $n)) : (x(), L(P, {
1164
1164
  key: 1,
1165
1165
  ref_key: "formRef",
1166
- ref: i,
1167
- onValidationFailed: t[1] || (t[1] = () => {
1168
- f.value = !1;
1166
+ ref: a,
1167
+ onValidationFailed: l[1] || (l[1] = () => {
1168
+ v.value = !1;
1169
1169
  }),
1170
- onValidationSuccess: t[2] || (t[2] = () => {
1171
- f.value = !0;
1170
+ onValidationSuccess: l[2] || (l[2] = () => {
1171
+ v.value = !0;
1172
1172
  }),
1173
1173
  blameFormChildOnValidationFailed: ""
1174
1174
  }, {
1175
1175
  default: I(() => [
1176
1176
  e("p", An, [
1177
- t[6] || (t[6] = e("b", null, "Date:", -1)),
1178
- t[7] || (t[7] = e("br", null, null, -1)),
1179
- ue(" " + _(r(xt)(r(St)($.value._id))), 1)
1177
+ l[6] || (l[6] = e("b", null, "Date:", -1)),
1178
+ l[7] || (l[7] = e("br", null, null, -1)),
1179
+ ue(" " + h(i(xt)(i(St)(C.value._id))), 1)
1180
1180
  ]),
1181
1181
  e("div", Vn, [
1182
- (F(!0), O(ne, null, le($.value.skus, (U, Z) => (F(), O(ne, { key: Z }, [
1183
- (F(!0), O(ne, null, le(U.amounts, (z, Q) => (F(), L(j, {
1182
+ (x(!0), O(ne, null, re(C.value.skus, (U, Z) => (x(), O(ne, { key: Z }, [
1183
+ (x(!0), O(ne, null, re(U.amounts, (z, Q) => (x(), L(j, {
1184
1184
  key: Q,
1185
1185
  variant: "outlined",
1186
1186
  class: "p-2"
1187
1187
  }, {
1188
1188
  default: I(() => [
1189
1189
  e("div", Cn, [
1190
- e("span", Bn, _(U.sku.code), 1),
1191
- e("span", null, _(U.sku.name), 1)
1190
+ e("span", Bn, h(U.sku.code), 1),
1191
+ e("span", null, h(U.sku.name), 1)
1192
1192
  ]),
1193
- t[12] || (t[12] = e("hr", { class: "m-2" }, null, -1)),
1193
+ l[12] || (l[12] = e("hr", { class: "m-2" }, null, -1)),
1194
1194
  e("div", Mn, [
1195
- t[8] || (t[8] = e("span", { class: "fm-typo-en-body-lg-600" }, "Adjustment type:", -1)),
1196
- e("span", null, _(z.type), 1)
1195
+ l[8] || (l[8] = e("span", { class: "fm-typo-en-body-lg-600" }, "Adjustment type:", -1)),
1196
+ e("span", null, h(z.type), 1)
1197
1197
  ]),
1198
1198
  e("div", Dn, [
1199
- t[9] || (t[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
1200
- e("span", null, _(r(Ce).toFormatString({ value: z.amount })) + " " + _(S(U, z)), 1)
1199
+ l[9] || (l[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
1200
+ e("span", null, h(i(Ce).toFormatString({ value: z.amount })) + " " + h(S(U, z)), 1)
1201
1201
  ]),
1202
- x(w, {
1203
- "model-value": V(U.sku._id, Q).value,
1204
- "onUpdate:modelValue": (G) => V(U.sku._id, Q).value = G,
1202
+ g(M, {
1203
+ "model-value": _(U.sku._id, Q).value,
1204
+ "onUpdate:modelValue": (G) => _(U.sku._id, Q).value = G,
1205
1205
  class: "mb-3",
1206
1206
  label: "Adjust Amount (Leave 0 to skip)",
1207
- "helper-text": `Max: ${k(z.amount)}`,
1207
+ "helper-text": `Max: ${B(z.amount)}`,
1208
1208
  "append-text": S(U, z),
1209
1209
  rules: [
1210
- (G) => G <= k(z.amount) || `Cannot be more than ${k(z.amount)}`,
1211
- r(Fe)(-1)
1210
+ (G) => G <= B(z.amount) || `Cannot be more than ${B(z.amount)}`,
1211
+ i(Fe)(-1)
1212
1212
  ]
1213
1213
  }, null, 8, ["model-value", "onUpdate:modelValue", "helper-text", "append-text", "rules"]),
1214
1214
  e("div", jn, [
1215
- t[10] || (t[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
1216
- t[11] || (t[11] = e("span", { class: "text-fm-color-system-warning-400 fm-typo-en-body-sm-400" }, "* It's an estimate for your reference, as it didn't include all the reversals related to this adjustment", -1)),
1217
- ue(" " + _(M(
1218
- k(z.amount, !1),
1219
- V(U.sku._id, Q).value
1220
- )) + " " + _(S(U, z)), 1)
1215
+ l[10] || (l[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
1216
+ l[11] || (l[11] = e("span", { class: "text-fm-color-system-warning-400 fm-typo-en-body-sm-400" }, "* It's an estimate for your reference, as it didn't include all the reversals related to this adjustment", -1)),
1217
+ ue(" " + h(F(
1218
+ B(z.amount, !1),
1219
+ _(U.sku._id, Q).value
1220
+ )) + " " + h(S(U, z)), 1)
1221
1221
  ])
1222
1222
  ]),
1223
1223
  _: 2
@@ -1252,160 +1252,159 @@ const je = {
1252
1252
  bills: { default: () => [] }
1253
1253
  },
1254
1254
  emits: ["refreshHistory"],
1255
- setup(v, { emit: g }) {
1256
- const u = v, o = N(!1), A = at(), p = N(), l = N(null), f = R(() => l.value === null ? "unset" : o.value ? `${l.value}px` : "0px");
1255
+ setup(y, { emit: b }) {
1256
+ const u = y, o = N(!1);
1257
+ at();
1258
+ const A = N(), p = N(null), c = R(() => p.value === null ? "unset" : o.value ? `${p.value}px` : "0px");
1257
1259
  Ee(() => {
1258
- var s;
1259
- l.value = ((s = p.value) == null ? void 0 : s.scrollHeight) || 0;
1260
+ var a;
1261
+ p.value = ((a = A.value) == null ? void 0 : a.scrollHeight) || 0;
1260
1262
  });
1261
- const B = R(() => {
1262
- var h;
1263
- const s = u.record.adjustments, V = u.sku, k = {}, M = s.flatMap((t) => {
1264
- var y;
1265
- return ((y = t.skus) == null ? void 0 : y.filter((w) => w.sku._id === V._id)) ?? [];
1266
- }).flatMap((t) => t.amounts);
1267
- for (const t of M) {
1268
- const y = t.measurement ? Ft(t.measurement.conversion, t.amount) : t.amount;
1269
- k[h = t.type] ?? (k[h] = { amount: 0, precision: 0 }), k[t.type] = et(y, k[t.type]);
1263
+ const v = R(() => {
1264
+ var F;
1265
+ const a = u.record.adjustments, s = u.sku, _ = {}, S = a.flatMap((n) => {
1266
+ var l;
1267
+ return ((l = n.skus) == null ? void 0 : l.filter((w) => w.sku._id === s._id)) ?? [];
1268
+ }).flatMap((n) => n.amounts);
1269
+ for (const n of S) {
1270
+ const l = n.measurement ? Ft(n.measurement.conversion, n.amount) : n.amount;
1271
+ _[F = n.type] ?? (_[F] = { amount: 0, precision: 0 }), _[n.type] = et(l, _[n.type]);
1270
1272
  }
1271
- return Object.entries(k).reduce(
1272
- (t, [y, w]) => (t[y] = /// comment, because without it formatter makes code uglier
1273
+ return Object.entries(_).reduce(
1274
+ (n, [l, w]) => (n[l] = /// comment, because without it formatter makes code uglier
1273
1275
  `${X.toFormatString({
1274
1276
  value: w,
1275
1277
  precision: 4
1276
- })} ${V.unit.abbrev}`, t),
1278
+ })} ${s.unit.abbrev}`, n),
1277
1279
  {}
1278
1280
  );
1279
- }), { t: $ } = de(), i = R(() => u.record.adjustmentsByTime.map(({ date: s, adjustments: V }) => ({
1280
- time: wt(new Date(s)),
1281
- adjustments: V.flatMap(
1282
- (k) => {
1283
- var S, M;
1284
- return ((M = (S = k.skus) == null ? void 0 : S.map) == null ? void 0 : M.call(S, (h) => {
1285
- var t, y;
1281
+ }), { t: $ } = de(), C = R(() => u.record.adjustmentsByTime.map(({ date: a, adjustments: s }) => ({
1282
+ time: wt(new Date(a)),
1283
+ adjustments: s.flatMap(
1284
+ (_) => {
1285
+ var B, S;
1286
+ return ((S = (B = _.skus) == null ? void 0 : B.map) == null ? void 0 : S.call(B, (F) => {
1287
+ var n, l;
1286
1288
  return {
1287
- ...h,
1288
- ref: k.ref,
1289
- backdateFrom: k.effectiveAt != null ? ot(k._id) : null,
1290
- toBalance: (y = (t = k.skus) == null ? void 0 : t[0]) == null ? void 0 : y.toBalance,
1291
- adjustmentId: k._id
1289
+ ...F,
1290
+ ref: _.ref,
1291
+ backdateFrom: _.effectiveAt != null ? ot(_._id) : null,
1292
+ toBalance: (l = (n = _.skus) == null ? void 0 : n[0]) == null ? void 0 : l.toBalance,
1293
+ adjustmentId: _._id
1292
1294
  };
1293
1295
  })) ?? [];
1294
1296
  }
1295
- ).flatMap((k) => {
1296
- var h;
1297
- const S = (h = u.bills.find((t) => t._id === k.ref)) == null ? void 0 : h.seqNumber, M = S ? $("inventory.stock.record.bill", [S]) : "";
1298
- return k.amounts.map((t) => {
1299
- var y;
1297
+ ).flatMap((_) => {
1298
+ var F;
1299
+ const B = (F = u.bills.find((n) => n._id === _.ref)) == null ? void 0 : F.seqNumber, S = B ? $("inventory.stock.record.bill", [B]) : "";
1300
+ return _.amounts.map((n) => {
1301
+ var l;
1300
1302
  return {
1301
- amount: `${X.toFormatString({ value: t.amount, precision: 4 })} ${((y = t.measurement) == null ? void 0 : y.abbrev) ?? k.sku.unit.abbrev}`,
1302
- backdateFrom: k.backdateFrom,
1303
- name: t.type,
1304
- remark: t.remark || M || "",
1305
- cost: t.cost,
1303
+ amount: `${X.toFormatString({ value: n.amount, precision: 4 })} ${((l = n.measurement) == null ? void 0 : l.abbrev) ?? _.sku.unit.abbrev}`,
1304
+ backdateFrom: _.backdateFrom,
1305
+ name: n.type,
1306
+ remark: n.remark || S || "",
1307
+ cost: n.cost,
1306
1308
  toBalance: X.toFormatString({
1307
- value: k.toBalance ?? X.fromNumber(0),
1309
+ value: _.toBalance ?? X.fromNumber(0),
1308
1310
  precision: 4
1309
1311
  }),
1310
- baseUnit: k.sku.unit.abbrev,
1311
- adjustmentId: k.adjustmentId
1312
+ baseUnit: _.sku.unit.abbrev,
1313
+ adjustmentId: _.adjustmentId
1312
1314
  };
1313
1315
  });
1314
1316
  })
1315
1317
  })));
1316
- return (s, V) => {
1317
- const k = D("FmIcon"), S = D("FmTooltip"), M = D("FmCard");
1318
- return F(), L(M, { variant: "outlined" }, {
1318
+ return (a, s) => {
1319
+ const _ = D("FmIcon"), B = D("FmTooltip"), S = D("FmCard");
1320
+ return x(), L(S, { variant: "outlined" }, {
1319
1321
  default: I(() => [
1320
1322
  e("div", En, [
1321
1323
  e("div", {
1322
1324
  class: "flex items-center cursor-pointer mb-1",
1323
- onClick: V[0] || (V[0] = (h) => o.value = !o.value)
1325
+ onClick: s[0] || (s[0] = (F) => o.value = !o.value)
1324
1326
  }, [
1325
- e("div", Hn, _(s.record.date), 1),
1326
- x(k, {
1327
+ e("div", Hn, h(a.record.date), 1),
1328
+ g(_, {
1327
1329
  name: o.value ? "expand_more" : "expand_less",
1328
1330
  color: "#777777",
1329
1331
  size: "md"
1330
1332
  }, null, 8, ["name"])
1331
1333
  ]),
1332
- (F(!0), O(ne, null, le(B.value, (h, t) => (F(), O("div", {
1333
- key: t,
1334
+ (x(!0), O(ne, null, re(v.value, (F, n) => (x(), O("div", {
1335
+ key: n,
1334
1336
  class: "flex flex-row py-1",
1335
1337
  style: { "font-size": "0.8rem" }
1336
1338
  }, [
1337
- e("div", Pn, _(r($)(`inventory.inventoryAdjustment.type.${t}`)), 1),
1339
+ e("div", Pn, h(i($)(`inventory.inventoryAdjustment.type.${n}`)), 1),
1338
1340
  e("div", {
1339
1341
  class: ge({
1340
- "text-fm-color-typo-error": h.startsWith("-"),
1341
- "text-fm-color-typo-success": !h.startsWith("-"),
1342
+ "text-fm-color-typo-error": F.startsWith("-"),
1343
+ "text-fm-color-typo-success": !F.startsWith("-"),
1342
1344
  "ml-auto": !0
1343
1345
  })
1344
- }, _(h), 3)
1346
+ }, h(F), 3)
1345
1347
  ]))), 128)),
1346
1348
  e("div", {
1347
1349
  ref_key: "detailRef",
1348
- ref: p,
1350
+ ref: A,
1349
1351
  style: Ze({
1350
1352
  fontSize: "0.8rem",
1351
- maxHeight: f.value,
1353
+ maxHeight: c.value,
1352
1354
  overflow: "hidden",
1353
1355
  transition: "max-height 0.2s ease-out"
1354
1356
  })
1355
1357
  }, [
1356
- i.value.length ? (F(), O("hr", Rn)) : se("", !0),
1357
- (F(!0), O(ne, null, le(i.value, (h) => (F(), O("div", {
1358
- key: h.time,
1358
+ C.value.length ? (x(), O("hr", Rn)) : se("", !0),
1359
+ (x(!0), O(ne, null, re(C.value, (F) => (x(), O("div", {
1360
+ key: F.time,
1359
1361
  class: "flex gap-1 w-full"
1360
1362
  }, [
1361
- e("div", On, _(h.time), 1),
1363
+ e("div", On, h(F.time), 1),
1362
1364
  e("div", Nn, [
1363
- (F(!0), O(ne, null, le(h.adjustments, (t) => {
1364
- var y;
1365
- return F(), O("div", {
1366
- key: t.name,
1367
- class: "flex gap-1"
1368
- }, [
1369
- e("div", Ln, [
1370
- ue(_(r($)(`inventory.inventoryAdjustment.type.${t.name}`)) + " ", 1),
1371
- t.backdateFrom ? (F(), L(S, {
1372
- key: 0,
1373
- variant: "plain",
1374
- placement: "top",
1375
- "z-index": 50
1376
- }, {
1377
- content: I(() => [
1378
- e("div", zn, _(r($)("inventory.stock.record.backdate", [
1379
- r(tt)(new Date(t.backdateFrom))
1380
- ])), 1)
1381
- ]),
1382
- default: I(() => [
1383
- x(k, {
1384
- name: "info",
1385
- size: "sm",
1386
- color: "primary"
1387
- })
1388
- ]),
1389
- _: 2
1390
- }, 1024)) : se("", !0),
1391
- t.remark ? (F(), O("span", Yn, " # " + _(t.remark), 1)) : se("", !0),
1392
- t.name === r(oe).Enum.CLOSING ? (F(), O("span", Gn, " Actual Balance: " + _(t.toBalance) + " " + _(t.baseUnit), 1)) : se("", !0)
1393
- ]),
1394
- e("div", {
1395
- class: ge({
1396
- "text-fm-color-typo-error": t.amount.startsWith("-"),
1397
- "text-fm-color-typo-success": !t.amount.startsWith("-"),
1398
- "ml-auto": !0
1399
- })
1400
- }, _(t.amount), 3),
1401
- t.name === r(oe).Enum.WASTAGE && ((y = r(A).sessionUser.value) != null && y.role.isAdmin) ? (F(), L(Un, {
1365
+ (x(!0), O(ne, null, re(F.adjustments, (n) => (x(), O("div", {
1366
+ key: n.name,
1367
+ class: "flex gap-1"
1368
+ }, [
1369
+ e("div", Ln, [
1370
+ ue(h(i($)(`inventory.inventoryAdjustment.type.${n.name}`)) + " ", 1),
1371
+ n.backdateFrom ? (x(), L(B, {
1402
1372
  key: 0,
1403
- adjustmentId: t.adjustmentId,
1404
- onRefreshHistory: V[1] || (V[1] = (w) => s.$emit("refreshHistory"))
1405
- }, null, 8, ["adjustmentId"])) : se("", !0),
1406
- t.cost ? (F(), O("div", Wn, " (" + _(r(ke)(t.cost, !1, t.cost.precision)) + ") ", 1)) : se("", !0)
1407
- ]);
1408
- }), 128))
1373
+ variant: "plain",
1374
+ placement: "top",
1375
+ "z-index": 50
1376
+ }, {
1377
+ content: I(() => [
1378
+ e("div", zn, h(i($)("inventory.stock.record.backdate", [
1379
+ i(tt)(new Date(n.backdateFrom))
1380
+ ])), 1)
1381
+ ]),
1382
+ default: I(() => [
1383
+ g(_, {
1384
+ name: "info",
1385
+ size: "sm",
1386
+ color: "primary"
1387
+ })
1388
+ ]),
1389
+ _: 2
1390
+ }, 1024)) : se("", !0),
1391
+ n.remark ? (x(), O("span", Yn, " # " + h(n.remark), 1)) : se("", !0),
1392
+ n.name === i(oe).Enum.CLOSING ? (x(), O("span", Gn, " Actual Balance: " + h(n.toBalance) + " " + h(n.baseUnit), 1)) : se("", !0)
1393
+ ]),
1394
+ e("div", {
1395
+ class: ge({
1396
+ "text-fm-color-typo-error": n.amount.startsWith("-"),
1397
+ "text-fm-color-typo-success": !n.amount.startsWith("-"),
1398
+ "ml-auto": !0
1399
+ })
1400
+ }, h(n.amount), 3),
1401
+ n.name === i(oe).Enum.WASTAGE ? (x(), L(Un, {
1402
+ key: 0,
1403
+ adjustmentId: n.adjustmentId,
1404
+ onRefreshHistory: s[1] || (s[1] = (l) => a.$emit("refreshHistory"))
1405
+ }, null, 8, ["adjustmentId"])) : se("", !0),
1406
+ n.cost ? (x(), O("div", Wn, " (" + h(i(ke)(n.cost, !1, n.cost.precision)) + ") ", 1)) : se("", !0)
1407
+ ]))), 128))
1409
1408
  ])
1410
1409
  ]))), 128))
1411
1410
  ], 4)
@@ -1416,64 +1415,64 @@ const je = {
1416
1415
  };
1417
1416
  }
1418
1417
  });
1419
- function qn(v, g) {
1418
+ function qn(y, b) {
1420
1419
  var p;
1421
1420
  const u = Object.keys(oe.enum).reduce(
1422
- (l, f) => (l[f] = { amount: 0, precision: 0 }, l),
1421
+ (c, v) => (c[v] = { amount: 0, precision: 0 }, c),
1423
1422
  {}
1424
1423
  );
1425
- if (!g)
1424
+ if (!b)
1426
1425
  return Object.entries(u).reduce(
1427
- (l, [f]) => (l[f] = X.fromNumber(0), l),
1426
+ (c, [v]) => (c[v] = X.fromNumber(0), c),
1428
1427
  {}
1429
1428
  );
1430
- const A = v.flatMap((l) => {
1431
- var f;
1432
- return ((f = l.skus) == null ? void 0 : f.filter((B) => B.sku._id === g._id)) ?? [];
1433
- }).flatMap((l) => l.amounts);
1434
- for (const l of A) {
1435
- const f = l.measurement ? X.multiply([l.measurement.conversion, l.amount]) : l.amount;
1436
- u[p = l.type] ?? (u[p] = { amount: 0, precision: 0 }), u[l.type] = X.add([f, u[l.type]]);
1429
+ const A = y.flatMap((c) => {
1430
+ var v;
1431
+ return ((v = c.skus) == null ? void 0 : v.filter(($) => $.sku._id === b._id)) ?? [];
1432
+ }).flatMap((c) => c.amounts);
1433
+ for (const c of A) {
1434
+ const v = c.measurement ? X.multiply([c.measurement.conversion, c.amount]) : c.amount;
1435
+ u[p = c.type] ?? (u[p] = { amount: 0, precision: 0 }), u[c.type] = X.add([v, u[c.type]]);
1437
1436
  }
1438
1437
  return Object.entries(u).reduce(
1439
- (l, [f, B]) => {
1440
- const $ = {
1441
- ...B,
1442
- amount: Math.abs(B.amount)
1438
+ (c, [v, $]) => {
1439
+ const C = {
1440
+ ...$,
1441
+ amount: Math.abs($.amount)
1443
1442
  };
1444
- return l[f] = /// comment, because without it formatter makes code uglier
1443
+ return c[v] = /// comment, because without it formatter makes code uglier
1445
1444
  `${X.toFormatString({
1446
- value: $,
1445
+ value: C,
1447
1446
  precision: 4
1448
- })} ${g.unit.abbrev}`, l;
1447
+ })} ${b.unit.abbrev}`, c;
1449
1448
  },
1450
1449
  {}
1451
1450
  );
1452
1451
  }
1453
- function Xn(v, g) {
1454
- if (!g)
1452
+ function Xn(y, b) {
1453
+ if (!b)
1455
1454
  return null;
1456
1455
  let u = null;
1457
- const A = v.flatMap((p) => {
1458
- var l;
1459
- return ((l = p.skus) == null ? void 0 : l.filter((f) => f.sku._id === g._id)) ?? [];
1456
+ const A = y.flatMap((p) => {
1457
+ var c;
1458
+ return ((c = p.skus) == null ? void 0 : c.filter((v) => v.sku._id === b._id)) ?? [];
1460
1459
  }).flatMap((p) => {
1461
- var l;
1462
- return !p.history || ((l = p.history) == null ? void 0 : l.length) === 0 ? [] : p.history[0];
1460
+ var c;
1461
+ return !p.history || ((c = p.history) == null ? void 0 : c.length) === 0 ? [] : p.history[0];
1463
1462
  });
1464
1463
  for (const p of A) {
1465
- const l = p.amounts;
1466
- for (const f of l) {
1467
- if (f.type !== oe.Enum.SALES)
1464
+ const c = p.amounts;
1465
+ for (const v of c) {
1466
+ if (v.type !== oe.Enum.SALES)
1468
1467
  continue;
1469
- const B = f.measurement ? X.multiply([f.measurement.conversion, f.amount]) : f.amount;
1470
- u ?? (u = X.fromNumber(0)), u = X.add([u, B]);
1468
+ const $ = v.measurement ? X.multiply([v.measurement.conversion, v.amount]) : v.amount;
1469
+ u ?? (u = X.fromNumber(0)), u = X.add([u, $]);
1471
1470
  }
1472
1471
  }
1473
1472
  return u != null ? (u.amount = Math.abs(u.amount), `${X.toFormatString({
1474
1473
  value: u,
1475
1474
  precision: 4
1476
- })} ${g.unit.abbrev}`) : null;
1475
+ })} ${b.unit.abbrev}`) : null;
1477
1476
  }
1478
1477
  const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = { class: "flex-1 line-clamp-2" }, Zn = { class: "flex flex-col gap-32 w-full h-full" }, eo = { class: "flex items-center relative gap-4" }, to = { class: "flex-1" }, no = {
1479
1478
  key: 0,
@@ -1481,7 +1480,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1481
1480
  }, oo = { class: "fm-typo-en-body-lg-400 translate-x-4" }, so = {
1482
1481
  key: 1,
1483
1482
  class: "flex flex-col gap-12"
1484
- }, ao = { class: "pb-16" }, ro = { class: "fm-typo-cn-body-lg-600" }, lo = {
1483
+ }, ao = { class: "pb-16" }, lo = { class: "fm-typo-cn-body-lg-600" }, ro = {
1485
1484
  class: "grid gap-12 fm-typo-en-body-md-400",
1486
1485
  style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
1487
1486
  }, io = { class: "flex flex-col gap-1" }, uo = { class: "text-fm-color-typo-secondary" }, co = { class: "font-bold" }, mo = { class: "flex flex-col gap-1" }, po = { class: "text-fm-color-typo-secondary flex" }, fo = { class: "font-bold" }, vo = { class: "flex flex-col gap-1" }, yo = { class: "text-fm-color-typo-secondary" }, _o = { class: "font-bold" }, ho = { class: "flex flex-col gap-1" }, ko = { class: "text-fm-color-typo-secondary" }, bo = { class: "font-bold" }, go = { class: "flex flex-col gap-1" }, xo = { class: "text-fm-color-typo-secondary" }, So = { class: "font-bold" }, Fo = { class: "flex flex-col gap-1" }, wo = { class: "text-fm-color-typo-secondary" }, $o = { class: "font-bold" }, Ao = { class: "flex flex-col gap-1" }, Vo = { class: "text-fm-color-typo-secondary" }, Co = { class: "font-bold" }, Bo = { class: "flex flex-col gap-1" }, Mo = { class: "text-fm-color-typo-secondary" }, Do = { class: "font-bold" }, jo = { class: "flex flex-col gap-1" }, Io = { class: "text-fm-color-typo-secondary" }, To = { class: "font-bold" }, Uo = {
@@ -1497,185 +1496,185 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1497
1496
  show: { type: Boolean }
1498
1497
  },
1499
1498
  emits: ["update:show"],
1500
- setup(v) {
1501
- const g = at(), u = Re(), o = ye(), A = wn(), p = pe(), l = Ct(), { t: f } = de(), B = v, $ = N(!1), i = _e(), s = N($t(0));
1502
- async function V() {
1503
- $.value = !0;
1499
+ setup(y) {
1500
+ const b = at(), u = Re(), o = ye(), A = wn(), p = pe(), c = Ct(), { t: v } = de(), $ = y, C = N(!1), a = _e(), s = N($t(0));
1501
+ async function _() {
1502
+ C.value = !0;
1504
1503
  try {
1505
- await y(), await u.readStockBalance();
1506
- } catch (n) {
1507
- i.open({
1504
+ await w(), await u.readStockBalance();
1505
+ } catch (t) {
1506
+ a.open({
1508
1507
  title: "Something went wrong",
1509
1508
  message: "Cannot fetch stock history. Please try again.",
1510
1509
  type: "error"
1511
- }), console.log("failed at fetching item adjustment history", B.sku, s, n);
1510
+ }), console.log("failed at fetching item adjustment history", $.sku, s, t);
1512
1511
  } finally {
1513
- $.value = !1;
1512
+ C.value = !1;
1514
1513
  }
1515
1514
  }
1516
1515
  Ee(() => {
1517
- V();
1518
- }), xe([() => s.value, () => B.sku], () => {
1519
- V();
1516
+ _();
1517
+ }), xe([() => s.value, () => $.sku], () => {
1518
+ _();
1520
1519
  });
1521
- const k = N([]), S = N([]), M = N(new Array());
1522
- function h(n, a) {
1523
- return a === "day" ? It(n) : tt(n);
1520
+ const B = N([]), S = N([]), F = N(new Array());
1521
+ function n(t, r) {
1522
+ return r === "day" ? It(t) : tt(t);
1524
1523
  }
1525
- function t(n, a) {
1526
- const b = n.reduce(
1527
- (c, m) => {
1528
- const C = m.effectiveAt ?? ot(m._id);
1529
- if (!C)
1530
- return c;
1531
- const H = h(new Date(C), a);
1532
- return c[H] ?? (c[H] = []), c[H].push(m), c;
1524
+ function l(t, r) {
1525
+ const k = t.reduce(
1526
+ (d, f) => {
1527
+ const V = f.effectiveAt ?? ot(f._id);
1528
+ if (!V)
1529
+ return d;
1530
+ const H = n(new Date(V), r);
1531
+ return d[H] ?? (d[H] = []), d[H].push(f), d;
1533
1532
  },
1534
1533
  {}
1535
1534
  );
1536
- return Object.keys(b).map((c) => ({
1537
- date: c,
1538
- adjustments: b[c]
1535
+ return Object.keys(k).map((d) => ({
1536
+ date: d,
1537
+ adjustments: k[d]
1539
1538
  }));
1540
1539
  }
1541
- async function y() {
1542
- let n = await o.readStockAdjustment(
1543
- B.sku._id,
1540
+ async function w() {
1541
+ let t = await o.readStockAdjustment(
1542
+ $.sku._id,
1544
1543
  Bt(new Date(s.value.startDate)).toISOString(),
1545
1544
  Mt(new Date(s.value.endDate)).toISOString()
1546
1545
  );
1547
- k.value = n;
1548
- const a = n.filter(({ ref: b }) => b == null ? void 0 : b.startsWith("bill_")).map(({ ref: b }) => b);
1549
- await w(a), S.value = t(n, "day").map(({ date: b, adjustments: c }) => ({
1550
- date: b,
1551
- adjustments: c,
1552
- adjustmentsByTime: t(c, "minute")
1546
+ B.value = t;
1547
+ const r = t.filter(({ ref: k }) => k == null ? void 0 : k.startsWith("bill_")).map(({ ref: k }) => k);
1548
+ await M(r), S.value = l(t, "day").map(({ date: k, adjustments: d }) => ({
1549
+ date: k,
1550
+ adjustments: d,
1551
+ adjustmentsByTime: l(d, "minute")
1553
1552
  }));
1554
1553
  }
1555
- async function w(n) {
1556
- n.length && (M.value = await A.findBillsById(n).catch((a) => {
1557
- var m;
1558
- console.error("Error on using latest bill API, retrying using legacy api", a);
1559
- const b = ((m = g.currentBusiness.value) == null ? void 0 : m._id) ?? "", c = p.currentLocation.doc._id;
1560
- return A.findBillsByBusinessId(b, [c], n);
1554
+ async function M(t) {
1555
+ t.length && (F.value = await A.findBillsById(t).catch((r) => {
1556
+ var f;
1557
+ console.error("Error on using latest bill API, retrying using legacy api", r);
1558
+ const k = ((f = b.currentBusiness.value) == null ? void 0 : f._id) ?? "", d = p.currentLocation.doc._id;
1559
+ return A.findBillsByBusinessId(k, [d], t);
1561
1560
  }));
1562
1561
  }
1563
1562
  const j = R(() => {
1564
- const n = k.value, a = B.sku;
1565
- return qn(n, a);
1563
+ const t = B.value, r = $.sku;
1564
+ return qn(t, r);
1566
1565
  }), P = R(() => {
1567
- const n = k.value, a = B.sku;
1568
- return Xn(n, a);
1566
+ const t = B.value, r = $.sku;
1567
+ return Xn(t, r);
1569
1568
  }), T = R(() => {
1570
- const n = [...k.value].computeFirst((b) => {
1571
- var m, C;
1572
- const c = (C = (m = b.skus) == null ? void 0 : m.find) == null ? void 0 : C.call(m, (H) => H.sku._id === B.sku._id);
1573
- return c == null ? void 0 : c.fromBalance;
1569
+ const t = [...B.value].computeFirst((k) => {
1570
+ var f, V;
1571
+ const d = (V = (f = k.skus) == null ? void 0 : f.find) == null ? void 0 : V.call(f, (H) => H.sku._id === $.sku._id);
1572
+ return d == null ? void 0 : d.fromBalance;
1574
1573
  }) ?? {
1575
1574
  amount: 0,
1576
1575
  precision: 0
1577
- }, a = B.sku;
1578
- return a ? `${X.toFormatString({
1579
- value: n,
1576
+ }, r = $.sku;
1577
+ return r ? `${X.toFormatString({
1578
+ value: t,
1580
1579
  precision: 4
1581
- })} ${a.unit.abbrev}` : "";
1580
+ })} ${r.unit.abbrev}` : "";
1582
1581
  }), Y = R(() => {
1583
- const n = [...k.value].reverse().computeFirst((b) => {
1584
- var m, C;
1585
- const c = (C = (m = b.skus) == null ? void 0 : m.find) == null ? void 0 : C.call(m, (H) => H.sku._id === B.sku._id);
1586
- return c == null ? void 0 : c.toBalance;
1582
+ const t = [...B.value].reverse().computeFirst((k) => {
1583
+ var f, V;
1584
+ const d = (V = (f = k.skus) == null ? void 0 : f.find) == null ? void 0 : V.call(f, (H) => H.sku._id === $.sku._id);
1585
+ return d == null ? void 0 : d.toBalance;
1587
1586
  }) ?? {
1588
1587
  amount: 0,
1589
1588
  precision: 0
1590
- }, a = B.sku;
1591
- return a ? `${X.toFormatString({ value: n, precision: 4 })} ${a.unit.abbrev}` : "";
1589
+ }, r = $.sku;
1590
+ return r ? `${X.toFormatString({ value: t, precision: 4 })} ${r.unit.abbrev}` : "";
1592
1591
  }), W = R(() => {
1593
- var b;
1594
- const a = k.value.flatMap((c) => {
1595
- var m;
1596
- return ((m = c.skus) == null ? void 0 : m.flatMap((C) => C.amounts)) ?? [];
1597
- }).filter((c) => c.amount.amount < 0).reduce(
1598
- (c, m) => {
1599
- const C = m.cost;
1600
- if (!C) return c;
1592
+ var k;
1593
+ const r = B.value.flatMap((d) => {
1594
+ var f;
1595
+ return ((f = d.skus) == null ? void 0 : f.flatMap((V) => V.amounts)) ?? [];
1596
+ }).filter((d) => d.amount.amount < 0).reduce(
1597
+ (d, f) => {
1598
+ const V = f.cost;
1599
+ if (!V) return d;
1601
1600
  const H = {
1602
- ...At(c, Math.max(c.precision, C.precision)),
1603
- currency: C.currency
1601
+ ...At(d, Math.max(d.precision, V.precision)),
1602
+ currency: V.currency
1604
1603
  };
1605
1604
  return {
1606
- ...et(H, C),
1607
- currency: c.currency
1605
+ ...et(H, V),
1606
+ currency: d.currency
1608
1607
  };
1609
1608
  },
1610
1609
  {
1611
1610
  amount: 0,
1612
1611
  precision: 0,
1613
- currency: Be((b = g.currentCountry) == null ? void 0 : b.value)
1612
+ currency: Be((k = b.currentCountry) == null ? void 0 : k.value)
1614
1613
  }
1615
1614
  );
1616
- return ke(a, !1, a.precision);
1615
+ return ke(r, !1, r.precision);
1617
1616
  });
1618
1617
  function U() {
1619
- const { startDate: n, endDate: a } = Dt(s.value);
1620
- n !== null && a !== null && (s.value = {
1621
- startDate: n,
1622
- endDate: a
1618
+ const { startDate: t, endDate: r } = Dt(s.value);
1619
+ t !== null && r !== null && (s.value = {
1620
+ startDate: t,
1621
+ endDate: r
1623
1622
  });
1624
1623
  }
1625
- const Z = R(() => B.sku.valuation === Ke.Enum.FIFO ? f("inventory.ingredient.valuationMethod.FIFO") : f("inventory.ingredient.valuationMethod.WAVG")), z = R(() => {
1624
+ const Z = R(() => $.sku.valuation === Ke.Enum.FIFO ? v("inventory.ingredient.valuationMethod.FIFO") : v("inventory.ingredient.valuationMethod.WAVG")), z = R(() => {
1626
1625
  var H, K, ee, E;
1627
- const n = [...k.value].reverse().computeFirst((q) => {
1628
- var J, re;
1629
- return (re = (J = q.skus) == null ? void 0 : J.find) == null ? void 0 : re.call(J, (ie) => ie.sku._id === B.sku._id);
1626
+ const t = [...B.value].reverse().computeFirst((q) => {
1627
+ var J, le;
1628
+ return (le = (J = q.skus) == null ? void 0 : J.find) == null ? void 0 : le.call(J, (ie) => ie.sku._id === $.sku._id);
1630
1629
  });
1631
- if (!n) return "No data";
1632
- const a = [...n.amounts].reverse()[0], b = {
1633
- amount: ((H = a.cost) == null ? void 0 : H.amount) ?? 0,
1634
- precision: ((K = a.cost) == null ? void 0 : K.precision) ?? 0
1635
- }, c = a.amount, m = c.amount == 0 ? X.fromNumber(0) : X.divide([b, c]);
1630
+ if (!t) return "No data";
1631
+ const r = [...t.amounts].reverse()[0], k = {
1632
+ amount: ((H = r.cost) == null ? void 0 : H.amount) ?? 0,
1633
+ precision: ((K = r.cost) == null ? void 0 : K.precision) ?? 0
1634
+ }, d = r.amount, f = d.amount == 0 ? X.fromNumber(0) : X.divide([k, d]);
1636
1635
  return {
1637
- ...X.multiply([m, c]),
1638
- currency: ((ee = a.cost) == null ? void 0 : ee.currency) || Be(((E = g.currentCountry) == null ? void 0 : E.value) ?? Vt)
1636
+ ...X.multiply([f, d]),
1637
+ currency: ((ee = r.cost) == null ? void 0 : ee.currency) || Be(((E = b.currentCountry) == null ? void 0 : E.value) ?? Vt)
1639
1638
  };
1640
1639
  }), Q = R(() => {
1641
- var b;
1642
- const n = [...k.value].reverse().computeFirst((c) => {
1643
- var C, H;
1644
- const m = (H = (C = c.skus) == null ? void 0 : C.find) == null ? void 0 : H.call(C, (K) => K.sku._id === B.sku._id);
1645
- return m == null ? void 0 : m.toCostBalances;
1640
+ var k;
1641
+ const t = [...B.value].reverse().computeFirst((d) => {
1642
+ var V, H;
1643
+ const f = (H = (V = d.skus) == null ? void 0 : V.find) == null ? void 0 : H.call(V, (K) => K.sku._id === $.sku._id);
1644
+ return f == null ? void 0 : f.toCostBalances;
1646
1645
  });
1647
- return n ? {
1648
- ...n.reduce((c, m) => X.add([c, X.fromDinero(m.cost)]), {
1646
+ return t ? {
1647
+ ...t.reduce((d, f) => X.add([d, X.fromDinero(f.cost)]), {
1649
1648
  amount: 0,
1650
1649
  precision: 0
1651
1650
  }),
1652
- currency: Be((b = g.currentCountry) == null ? void 0 : b.value)
1651
+ currency: Be((k = b.currentCountry) == null ? void 0 : k.value)
1653
1652
  } : "No data";
1654
1653
  });
1655
1654
  function G() {
1656
- const { startDate: n, endDate: a } = jt(s.value);
1657
- n !== null && a !== null && (s.value = {
1658
- startDate: n,
1659
- endDate: a
1655
+ const { startDate: t, endDate: r } = jt(s.value);
1656
+ t !== null && r !== null && (s.value = {
1657
+ startDate: t,
1658
+ endDate: r
1660
1659
  });
1661
1660
  }
1662
- const d = Ne(B, "show");
1663
- return (n, a) => {
1664
- const b = D("FmButton"), c = D("FmField"), m = D("FmDateRangePicker"), C = D("FmSpacer"), H = D("FmCircularProgress"), K = D("FmIcon"), ee = D("FmTooltip"), E = D("FmMenuDivider"), q = D("FmChip"), J = D("FmCardSection"), re = D("FmCard"), ie = D("FmSideSheet");
1665
- return F(), L(ie, {
1661
+ const m = Ne($, "show");
1662
+ return (t, r) => {
1663
+ const k = D("FmButton"), d = D("FmField"), f = D("FmDateRangePicker"), V = D("FmSpacer"), H = D("FmCircularProgress"), K = D("FmIcon"), ee = D("FmTooltip"), E = D("FmMenuDivider"), q = D("FmChip"), J = D("FmCardSection"), le = D("FmCard"), ie = D("FmSideSheet");
1664
+ return x(), L(ie, {
1666
1665
  "dismiss-away": "",
1667
- modelValue: r(d),
1668
- "onUpdate:modelValue": a[4] || (a[4] = (te) => Ue(d) ? d.value = te : null),
1666
+ modelValue: i(m),
1667
+ "onUpdate:modelValue": r[4] || (r[4] = (te) => Ue(m) ? m.value = te : null),
1669
1668
  "close-button": !1,
1670
1669
  "max-width": 560
1671
1670
  }, {
1672
1671
  "side-sheet-header": I(() => [
1673
1672
  e("div", Qn, [
1674
- e("div", Jn, _(r(f)("inventory.stock.history.title", [n.sku.name])), 1),
1675
- x(b, {
1673
+ e("div", Jn, h(i(v)("inventory.stock.history.title", [t.sku.name])), 1),
1674
+ g(k, {
1676
1675
  variant: "tertiary",
1677
1676
  "prepend-icon": "close",
1678
- onClick: a[0] || (a[0] = (te) => d.value = !1)
1677
+ onClick: r[0] || (r[0] = (te) => m.value = !1)
1679
1678
  })
1680
1679
  ])
1681
1680
  ]),
@@ -1685,21 +1684,21 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1685
1684
  e("div", Zn, [
1686
1685
  e("div", eo, [
1687
1686
  e("div", to, [
1688
- x(m, {
1687
+ g(f, {
1689
1688
  modelValue: s.value,
1690
- "onUpdate:modelValue": a[1] || (a[1] = (ae) => s.value = ae),
1689
+ "onUpdate:modelValue": r[1] || (r[1] = (ae) => s.value = ae),
1691
1690
  "show-predefined-range": "",
1692
1691
  "start-label": "",
1693
1692
  "end-label": "",
1694
1693
  "z-index": 50
1695
1694
  }, {
1696
1695
  "trigger-button": I(({ opened: ae }) => [
1697
- x(c, {
1696
+ g(d, {
1698
1697
  "prepend-icon": "calendar_month",
1699
1698
  focused: ae
1700
1699
  }, {
1701
1700
  default: I(() => [
1702
- ue(_(s.value.startDate) + " - " + _(s.value.endDate), 1)
1701
+ ue(h(s.value.startDate) + " - " + h(s.value.endDate), 1)
1703
1702
  ]),
1704
1703
  _: 2
1705
1704
  }, 1032, ["focused"])
@@ -1707,40 +1706,40 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1707
1706
  _: 1
1708
1707
  }, 8, ["modelValue"])
1709
1708
  ]),
1710
- x(b, {
1709
+ g(k, {
1711
1710
  variant: "tertiary",
1712
- onClick: a[2] || (a[2] = (ae) => U()),
1711
+ onClick: r[2] || (r[2] = (ae) => U()),
1713
1712
  "prepend-icon": "navigate_before"
1714
1713
  }),
1715
- x(b, {
1714
+ g(k, {
1716
1715
  variant: "tertiary",
1717
- onClick: a[3] || (a[3] = (ae) => G()),
1716
+ onClick: r[3] || (r[3] = (ae) => G()),
1718
1717
  "prepend-icon": "navigate_next"
1719
1718
  })
1720
1719
  ]),
1721
- $.value ? (F(), O("div", no, [
1722
- x(C),
1723
- x(H, { size: "xl" }),
1724
- e("div", oo, _(r(f)("inventory.stock.history.loading")), 1),
1725
- x(C),
1726
- x(C)
1727
- ])) : S.value && ((te = S.value) == null ? void 0 : te.length) > 0 ? (F(), O("div", so, [
1728
- x(re, { variant: "outlined" }, {
1720
+ C.value ? (x(), O("div", no, [
1721
+ g(V),
1722
+ g(H, { size: "xl" }),
1723
+ e("div", oo, h(i(v)("inventory.stock.history.loading")), 1),
1724
+ g(V),
1725
+ g(V)
1726
+ ])) : S.value && ((te = S.value) == null ? void 0 : te.length) > 0 ? (x(), O("div", so, [
1727
+ g(le, { variant: "outlined" }, {
1729
1728
  default: I(() => [
1730
- x(J, { class: "flex flex-col gap-4" }, {
1729
+ g(J, { class: "flex flex-col gap-4" }, {
1731
1730
  default: I(() => [
1732
1731
  e("div", ao, [
1733
- e("div", ro, _(r(f)("inventory.stock.history.summary.title")), 1)
1732
+ e("div", lo, h(i(v)("inventory.stock.history.summary.title")), 1)
1734
1733
  ]),
1735
- e("div", lo, [
1734
+ e("div", ro, [
1736
1735
  e("div", io, [
1737
- e("div", uo, _(r(f)("inventory.stock.history.summary.totalPurchase")), 1),
1738
- e("div", co, _(j.value.PURCHASE), 1)
1736
+ e("div", uo, h(i(v)("inventory.stock.history.summary.totalPurchase")), 1),
1737
+ e("div", co, h(j.value.PURCHASE), 1)
1739
1738
  ]),
1740
1739
  e("div", mo, [
1741
1740
  e("div", po, [
1742
- ue(_(r(f)("inventory.stock.history.summary.totalSales")) + "  ", 1),
1743
- P.value != null ? (F(), L(ee, {
1741
+ ue(h(i(v)("inventory.stock.history.summary.totalSales")) + "  ", 1),
1742
+ P.value != null ? (x(), L(ee, {
1744
1743
  key: 0,
1745
1744
  variant: "plain",
1746
1745
  placement: "top",
@@ -1748,7 +1747,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1748
1747
  "z-index": 50
1749
1748
  }, {
1750
1749
  default: I(() => [
1751
- x(K, {
1750
+ g(K, {
1752
1751
  name: "warning",
1753
1752
  size: "sm"
1754
1753
  })
@@ -1756,53 +1755,53 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1756
1755
  _: 1
1757
1756
  }, 8, ["content"])) : se("", !0)
1758
1757
  ]),
1759
- e("div", fo, _(j.value.SALES), 1)
1758
+ e("div", fo, h(j.value.SALES), 1)
1760
1759
  ]),
1761
1760
  e("div", vo, [
1762
- e("div", yo, _(r(f)("inventory.stock.history.summary.totalLose")), 1),
1763
- e("div", _o, _(j.value.LOSE), 1)
1761
+ e("div", yo, h(i(v)("inventory.stock.history.summary.totalLose")), 1),
1762
+ e("div", _o, h(j.value.LOSE), 1)
1764
1763
  ]),
1765
1764
  e("div", ho, [
1766
- e("div", ko, _(r(f)("inventory.stock.history.summary.totalRequest")), 1),
1767
- e("div", bo, _(j.value.REQUEST), 1)
1765
+ e("div", ko, h(i(v)("inventory.stock.history.summary.totalRequest")), 1),
1766
+ e("div", bo, h(j.value.REQUEST), 1)
1768
1767
  ]),
1769
1768
  e("div", go, [
1770
- e("div", xo, _(r(f)("inventory.stock.history.summary.totalReceive")), 1),
1771
- e("div", So, _(j.value.RECEIVE), 1)
1769
+ e("div", xo, h(i(v)("inventory.stock.history.summary.totalReceive")), 1),
1770
+ e("div", So, h(j.value.RECEIVE), 1)
1772
1771
  ]),
1773
1772
  e("div", Fo, [
1774
- e("div", wo, _(r(f)("inventory.stock.history.summary.totalConvert")), 1),
1775
- e("div", $o, _(j.value.CONVERT), 1)
1773
+ e("div", wo, h(i(v)("inventory.stock.history.summary.totalConvert")), 1),
1774
+ e("div", $o, h(j.value.CONVERT), 1)
1776
1775
  ]),
1777
1776
  e("div", Ao, [
1778
- e("div", Vo, _(r(f)("inventory.stock.history.summary.totalDamage")), 1),
1779
- e("div", Co, _(j.value.DAMAGE), 1)
1777
+ e("div", Vo, h(i(v)("inventory.stock.history.summary.totalDamage")), 1),
1778
+ e("div", Co, h(j.value.DAMAGE), 1)
1780
1779
  ]),
1781
1780
  e("div", Bo, [
1782
- e("div", Mo, _(r(f)("inventory.stock.history.summary.openingBalance")), 1),
1783
- e("div", Do, _(T.value), 1)
1781
+ e("div", Mo, h(i(v)("inventory.stock.history.summary.openingBalance")), 1),
1782
+ e("div", Do, h(T.value), 1)
1784
1783
  ]),
1785
1784
  e("div", jo, [
1786
- e("div", Io, _(r(f)("inventory.stock.history.summary.lastStockBalance")), 1),
1787
- e("div", To, _(Y.value), 1)
1785
+ e("div", Io, h(i(v)("inventory.stock.history.summary.lastStockBalance")), 1),
1786
+ e("div", To, h(Y.value), 1)
1788
1787
  ])
1789
1788
  ]),
1790
- r(l).enableTotalCost ? (F(), O("div", Uo, [
1791
- x(E, { class: "w-full" }),
1789
+ i(c).enableTotalCost ? (x(), O("div", Uo, [
1790
+ g(E, { class: "w-full" }),
1792
1791
  e("div", Eo, [
1793
1792
  e("div", Ho, [
1794
- x(Xe, { "z-index": 50 }, {
1793
+ g(Xe, { "z-index": 50 }, {
1795
1794
  default: I(() => [
1796
1795
  e("div", Po, [
1797
- ue(_(r(f)("inventory.stock.history.estimatedValue")) + " ", 1),
1798
- x(ee, {
1796
+ ue(h(i(v)("inventory.stock.history.estimatedValue")) + " ", 1),
1797
+ g(ee, {
1799
1798
  variant: "plain",
1800
1799
  placement: "top",
1801
- content: `[${Z.value}] ${r(f)("inventory.stock.history.estimatedValueTooltip")}`,
1800
+ content: `[${Z.value}] ${i(v)("inventory.stock.history.estimatedValueTooltip")}`,
1802
1801
  "z-index": 50
1803
1802
  }, {
1804
1803
  default: I(() => [
1805
- x(K, {
1804
+ g(K, {
1806
1805
  name: "help",
1807
1806
  size: "sm"
1808
1807
  })
@@ -1814,18 +1813,18 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1814
1813
  _: 1
1815
1814
  }),
1816
1815
  e("div", Ro, [
1817
- n.sku.valuation === r(Ke).Enum.FIFO ? (F(), O(ne, { key: 0 }, [
1818
- x(q, {
1816
+ t.sku.valuation === i(Ke).Enum.FIFO ? (x(), O(ne, { key: 0 }, [
1817
+ g(q, {
1819
1818
  label: "FIFO",
1820
1819
  compact: ""
1821
1820
  }),
1822
- ue(" " + _(typeof Q.value != "string" ? r(ke)(
1821
+ ue(" " + h(typeof Q.value != "string" ? i(ke)(
1823
1822
  Q.value,
1824
1823
  !1,
1825
1824
  Q.value.precision
1826
1825
  ) : Q.value), 1)
1827
- ], 64)) : (F(), O(ne, { key: 1 }, [
1828
- ue(_(typeof z.value != "string" ? r(ke)(
1826
+ ], 64)) : (x(), O(ne, { key: 1 }, [
1827
+ ue(h(typeof z.value != "string" ? i(ke)(
1829
1828
  z.value,
1830
1829
  !1,
1831
1830
  z.value.precision
@@ -1834,20 +1833,20 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1834
1833
  ])
1835
1834
  ]),
1836
1835
  e("div", Oo, [
1837
- x(Xe, { "z-index": 50 }, {
1836
+ g(Xe, { "z-index": 50 }, {
1838
1837
  default: I(() => [
1839
1838
  e("div", No, [
1840
- ue(_(r(f)("inventory.stock.history.costSold")) + " ", 1),
1841
- x(ee, {
1839
+ ue(h(i(v)("inventory.stock.history.costSold")) + " ", 1),
1840
+ g(ee, {
1842
1841
  variant: "plain",
1843
1842
  placement: "top",
1844
1843
  "z-index": 50
1845
1844
  }, {
1846
1845
  content: I(() => [
1847
- e("div", Lo, _(r(f)("inventory.stock.history.costSoldTooltip")), 1)
1846
+ e("div", Lo, h(i(v)("inventory.stock.history.costSoldTooltip")), 1)
1848
1847
  ]),
1849
1848
  default: I(() => [
1850
- x(K, {
1849
+ g(K, {
1851
1850
  name: "help",
1852
1851
  size: "sm"
1853
1852
  })
@@ -1858,7 +1857,7 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1858
1857
  ]),
1859
1858
  _: 1
1860
1859
  }),
1861
- e("div", zo, _(W.value), 1)
1860
+ e("div", zo, h(W.value), 1)
1862
1861
  ])
1863
1862
  ])
1864
1863
  ])) : se("", !0)
@@ -1868,30 +1867,30 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1868
1867
  ]),
1869
1868
  _: 1
1870
1869
  }),
1871
- a[5] || (a[5] = e("div", null, null, -1)),
1872
- (F(!0), O(ne, null, le(S.value, (ae) => (F(), O(ne, {
1870
+ r[5] || (r[5] = e("div", null, null, -1)),
1871
+ (x(!0), O(ne, null, re(S.value, (ae) => (x(), O(ne, {
1873
1872
  key: ae.date
1874
1873
  }, [
1875
- n.sku ? (F(), L(Kn, {
1874
+ t.sku ? (x(), L(Kn, {
1876
1875
  key: 0,
1877
1876
  record: ae,
1878
- sku: n.sku,
1879
- bills: M.value,
1880
- onRefreshHistory: V
1877
+ sku: t.sku,
1878
+ bills: F.value,
1879
+ onRefreshHistory: _
1881
1880
  }, null, 8, ["record", "sku", "bills"])) : se("", !0)
1882
1881
  ], 64))), 128))
1883
- ])) : (F(), O("div", Yo, [
1884
- x(C),
1882
+ ])) : (x(), O("div", Yo, [
1883
+ g(V),
1885
1884
  e("div", null, [
1886
1885
  e("img", {
1887
- src: r(Yt),
1886
+ src: i(Yt),
1888
1887
  alt: "List is empty"
1889
1888
  }, null, 8, Go)
1890
1889
  ]),
1891
- e("div", Wo, _(r(f)("inventory.stock.history.noRecords")), 1),
1892
- e("div", Ko, _(r(f)("inventory.stock.history.changeDateRange")), 1),
1893
- x(C),
1894
- x(C)
1890
+ e("div", Wo, h(i(v)("inventory.stock.history.noRecords")), 1),
1891
+ e("div", Ko, h(i(v)("inventory.stock.history.changeDateRange")), 1),
1892
+ g(V),
1893
+ g(V)
1895
1894
  ]))
1896
1895
  ])
1897
1896
  ];
@@ -1902,45 +1901,45 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1902
1901
  }
1903
1902
  }), Xo = { class: "flex flex-col gap-8" }, Qo = { class: "flex flex-col" }, Jo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Zo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, vs = /* @__PURE__ */ ce({
1904
1903
  __name: "StockView",
1905
- setup(v) {
1906
- const { t: g } = de(), u = Pe(), o = pe(), A = Re(), p = lt(), l = ye(), f = nt(), { columnDefs: B } = Zt(), $ = Oe();
1907
- o.watchLocation(k);
1908
- const i = N(!1), s = _e();
1909
- async function V() {
1910
- $.open({
1911
- title: g("inventory.stock.stock_balance.refreshBalance"),
1912
- message: g("inventory.stock.stock_balance.refreshBalanceDescription"),
1904
+ setup(y) {
1905
+ const { t: b } = de(), u = Pe(), o = pe(), A = Re(), p = rt(), c = ye(), v = nt(), { columnDefs: $ } = Zt(), C = Oe();
1906
+ o.watchLocation(B);
1907
+ const a = N(!1), s = _e();
1908
+ async function _() {
1909
+ C.open({
1910
+ title: b("inventory.stock.stock_balance.refreshBalance"),
1911
+ message: b("inventory.stock.stock_balance.refreshBalanceDescription"),
1913
1912
  closeButton: !0,
1914
1913
  primaryActions: {
1915
- text: g("common.confirm"),
1914
+ text: b("common.confirm"),
1916
1915
  close: !0
1917
1916
  },
1918
1917
  secondaryActions: {
1919
- text: g("common.close"),
1918
+ text: b("common.close"),
1920
1919
  close: !0,
1921
1920
  variant: "tertiary"
1922
1921
  }
1923
1922
  }).onPrimary(async () => {
1924
- await l.recalculation.refreshCurrentBalances(), s.open({
1923
+ await c.recalculation.refreshCurrentBalances(), s.open({
1925
1924
  title: "Refresh Stock Balance",
1926
1925
  message: "Stock balance refresh has been queued. This may take a moment to complete.",
1927
1926
  type: "success"
1928
1927
  });
1929
1928
  });
1930
1929
  }
1931
- async function k() {
1930
+ async function B() {
1932
1931
  if (o._currentLocation) {
1933
- i.value = !0;
1932
+ a.value = !0;
1934
1933
  try {
1935
- await A.readStockBalance(), await A.readProductBalance(), await f.readStockEstimateBalance();
1934
+ await A.readStockBalance(), await A.readProductBalance(), await v.readStockEstimateBalance();
1936
1935
  } catch (T) {
1937
1936
  s.open({
1938
- title: g("inventory.stock.error.title"),
1939
- message: g("inventory.stock.error.message"),
1937
+ title: b("inventory.stock.error.title"),
1938
+ message: b("inventory.stock.error.message"),
1940
1939
  type: "error"
1941
1940
  }), console.error("error on fetch stock balance", T);
1942
1941
  } finally {
1943
- i.value = !1;
1942
+ a.value = !1;
1944
1943
  }
1945
1944
  }
1946
1945
  }
@@ -1949,9 +1948,9 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1949
1948
  var z, Q, G;
1950
1949
  const Y = T.trackingMeasurement;
1951
1950
  let W = (Q = (z = A.stockBalance.skus) == null ? void 0 : z.find(
1952
- (d) => d.id === T._id
1953
- )) == null ? void 0 : Q.balance, U = f.inventoryForecast.skus.find(
1954
- (d) => d.id === T._id
1951
+ (m) => m.id === T._id
1952
+ )) == null ? void 0 : Q.balance, U = v.inventoryForecast.skus.find(
1953
+ (m) => m.id === T._id
1955
1954
  );
1956
1955
  return {
1957
1956
  ...T,
@@ -1960,39 +1959,39 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
1960
1959
  precision: 0
1961
1960
  },
1962
1961
  day: (U == null ? void 0 : U.depletionDays) ?? void 0,
1963
- trackingUnitAbbrev: Y ? ((G = T.unit.measurements.find((d) => d.id === Y)) == null ? void 0 : G.abbrev) ?? "" : T.unit.abbrev
1962
+ trackingUnitAbbrev: Y ? ((G = T.unit.measurements.find((m) => m.id === Y)) == null ? void 0 : G.abbrev) ?? "" : T.unit.abbrev
1964
1963
  };
1965
1964
  })
1966
- ), M = N(""), { breakpoints: h } = Ot(), t = R(() => h.value.xs || h.value.sm), y = R(() => t.value ? 10 : 20), w = Tt(), j = R(() => [
1965
+ ), F = N(""), { breakpoints: n } = Ot(), l = R(() => n.value.xs || n.value.sm), w = R(() => l.value ? 10 : 20), M = Tt(), j = R(() => [
1967
1966
  {
1968
- label: g("inventory.stock.stock_balance.refreshBalance"),
1967
+ label: b("inventory.stock.stock_balance.refreshBalance"),
1969
1968
  value: "refresh-balance",
1970
1969
  isPrimary: !0,
1971
1970
  prependIcon: "calculate"
1972
1971
  },
1973
1972
  {
1974
- label: g("inventory.common.refresh"),
1973
+ label: b("inventory.common.refresh"),
1975
1974
  value: "refresh"
1976
1975
  },
1977
1976
  {
1978
- label: g("inventory.common.export"),
1977
+ label: b("inventory.common.export"),
1979
1978
  value: "export"
1980
1979
  }
1981
1980
  ]);
1982
1981
  function P(T) {
1983
1982
  switch (T) {
1984
1983
  case "refresh-balance":
1985
- return V();
1984
+ return _();
1986
1985
  case "refresh":
1987
- return k();
1986
+ return B();
1988
1987
  case "export":
1989
1988
  return qt(S.value);
1990
1989
  }
1991
1990
  }
1992
1991
  return (T, Y) => {
1993
1992
  const W = D("FmTable");
1994
- return F(), L(Ut, {
1995
- title: r(g)("inventory.stock.title"),
1993
+ return x(), L(Ut, {
1994
+ title: i(b)("inventory.stock.title"),
1996
1995
  actions: j.value,
1997
1996
  "onClick:action": P
1998
1997
  }, {
@@ -2003,57 +2002,57 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
2003
2002
  class: ge([
2004
2003
  "flex flex-col gap-8 max-h-full",
2005
2004
  {
2006
- "p-0": t.value,
2007
- "px-24 ": !t.value
2005
+ "p-0": l.value,
2006
+ "px-24 ": !l.value
2008
2007
  }
2009
2008
  ])
2010
2009
  }, [
2011
- x(Et, {
2010
+ g(Et, {
2012
2011
  searchable: "",
2013
2012
  "change-location": "",
2014
- search: M.value,
2015
- "onUpdate:search": Y[0] || (Y[0] = (G) => M.value = G)
2013
+ search: F.value,
2014
+ "onUpdate:search": Y[0] || (Y[0] = (G) => F.value = G)
2016
2015
  }, null, 8, ["search"]),
2017
- (F(), L(W, {
2018
- style: Ze(r(w).tableHeight),
2019
- "column-defs": r(B),
2016
+ (x(), L(W, {
2017
+ style: Ze(i(M).tableHeight),
2018
+ "column-defs": i($),
2020
2019
  "row-data": S.value,
2021
- "search-value": M.value,
2022
- loading: i.value || !r(o)._currentLocation,
2023
- key: (U = r(o)._currentLocation) == null ? void 0 : U.dbName,
2024
- onRowClick: Y[1] || (Y[1] = (G) => r(p).showSkuHistory(G.original)),
2025
- "page-size": y.value
2020
+ "search-value": F.value,
2021
+ loading: a.value || !i(o)._currentLocation,
2022
+ key: (U = i(o)._currentLocation) == null ? void 0 : U.dbName,
2023
+ onRowClick: Y[1] || (Y[1] = (G) => i(p).showSkuHistory(G.original)),
2024
+ "page-size": w.value
2026
2025
  }, {
2027
2026
  "list-row": I((G) => [
2028
- x(Ht, {
2027
+ g(Ht, {
2029
2028
  row: G,
2030
- onRowClick: r(p).showSkuHistory
2029
+ onRowClick: i(p).showSkuHistory
2031
2030
  }, {
2032
- default: I((d) => {
2033
- var n, a, b, c, m, C, H, K, ee, E;
2031
+ default: I((m) => {
2032
+ var t, r, k, d, f, V, H, K, ee, E;
2034
2033
  return [
2035
2034
  e("div", Xo, [
2036
2035
  e("div", Qo, [
2037
2036
  e("div", Jo, [
2038
- x(r(qe), {
2039
- render: (b = (a = (n = d.code) == null ? void 0 : n.column) == null ? void 0 : a.columnDef) == null ? void 0 : b.cell,
2040
- props: (m = (c = d.code) == null ? void 0 : c.getContext) == null ? void 0 : m.call(c)
2037
+ g(i(qe), {
2038
+ render: (k = (r = (t = m.code) == null ? void 0 : t.column) == null ? void 0 : r.columnDef) == null ? void 0 : k.cell,
2039
+ props: (f = (d = m.code) == null ? void 0 : d.getContext) == null ? void 0 : f.call(d)
2041
2040
  }, null, 8, ["render", "props"])
2042
2041
  ]),
2043
2042
  e("div", Zo, [
2044
- x(r(qe), {
2045
- render: (K = (H = (C = d.name) == null ? void 0 : C.column) == null ? void 0 : H.columnDef) == null ? void 0 : K.cell,
2046
- props: (E = (ee = d.name) == null ? void 0 : ee.getContext) == null ? void 0 : E.call(ee)
2043
+ g(i(qe), {
2044
+ render: (K = (H = (V = m.name) == null ? void 0 : V.column) == null ? void 0 : H.columnDef) == null ? void 0 : K.cell,
2045
+ props: (E = (ee = m.name) == null ? void 0 : ee.getContext) == null ? void 0 : E.call(ee)
2047
2046
  }, null, 8, ["render", "props"])
2048
2047
  ])
2049
2048
  ]),
2050
2049
  e("div", null, [
2051
- x(Te, {
2050
+ g(Te, {
2052
2051
  days: G.original.day
2053
2052
  }, null, 8, ["days"])
2054
2053
  ]),
2055
2054
  e("div", null, [
2056
- x(rt, {
2055
+ g(lt, {
2057
2056
  class: "xs:w-[160px]",
2058
2057
  unit: G.original.unit,
2059
2058
  sku: G.original,
@@ -2070,10 +2069,10 @@ const Qn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Jn = {
2070
2069
  _: 1
2071
2070
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
2072
2071
  ], 2),
2073
- (F(), L(ct, { to: "body" }, [
2074
- (Z = r(p).stockHistoryProps) != null && Z.sku ? (F(), L(qo, Ae(Ve({ key: 0 }, r(p).stockHistoryProps)), null, 16)) : se("", !0),
2075
- (z = r(p).convertSkuDialogProps) != null && z.sku ? (F(), L(vn, Ae(Ve({ key: 1 }, r(p).convertSkuDialogProps)), null, 16)) : se("", !0),
2076
- (Q = r(p).adjustSkuDialogProps) != null && Q.stock ? (F(), L(Fn, Ae(Ve({ key: 2 }, r(p).adjustSkuDialogProps)), null, 16)) : se("", !0)
2072
+ (x(), L(ct, { to: "body" }, [
2073
+ (Z = i(p).stockHistoryProps) != null && Z.sku ? (x(), L(qo, Ae(Ve({ key: 0 }, i(p).stockHistoryProps)), null, 16)) : se("", !0),
2074
+ (z = i(p).convertSkuDialogProps) != null && z.sku ? (x(), L(vn, Ae(Ve({ key: 1 }, i(p).convertSkuDialogProps)), null, 16)) : se("", !0),
2075
+ (Q = i(p).adjustSkuDialogProps) != null && Q.stock ? (x(), L(Fn, Ae(Ve({ key: 2 }, i(p).adjustSkuDialogProps)), null, 16)) : se("", !0)
2077
2076
  ]))
2078
2077
  ];
2079
2078
  }),