@feedmepos/mf-inventory-portal 1.2.41 → 1.2.42-dev.2

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 (87) hide show
  1. package/dist/{App-BIte52Pp.js → App-tCZXxWWi.js} +3 -3
  2. package/dist/{ApprovalView-JfMRinbO.js → ApprovalView-DsoqQiwe.js} +5 -5
  3. package/dist/{BindingsDialog-vWWVE53r.js → BindingsDialog-BCXWR50h.js} +8 -8
  4. package/dist/{BindingsPicker-CaioRGQF.js → BindingsPicker-B3O_g_Nv.js} +3 -3
  5. package/dist/{BindingsTable-C7wQYr4Q.js → BindingsTable-C9WLnkpX.js} +3 -3
  6. package/dist/{ClosingDraftView-BQUPmOGf.js → ClosingDraftView-SgUfLfsI.js} +8 -8
  7. package/dist/{ClosingHistoryView-DJCPMxxe.js → ClosingHistoryView-DZnzhSNn.js} +22 -22
  8. package/dist/{ClosingTemplateView-2G5nlEZD.js → ClosingTemplateView-VKu9x3Nz.js} +14 -14
  9. package/dist/{DeliveryOrderPrintPreview-52SJyur7.js → DeliveryOrderPrintPreview-CD_43MIv.js} +9 -9
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D4y509uw.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DbVm-oVE.js} +59 -60
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Bu4F9apP.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-UocERxk1.js} +2 -2
  12. package/dist/{FmMultiselectDialog-DFjTvhrL.js → FmMultiselectDialog-BnSC4X04.js} +1 -1
  13. package/dist/{FmMultiselectDialog-ynZ3ZEkp.js → FmMultiselectDialog-CsohyGSW.js} +2 -2
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CHZcrzs1.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BiRrQ1MQ.js} +3 -3
  15. package/dist/{ImportView-B7cWiUlq.js → ImportView-uqB1qMsv.js} +6 -6
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DLLVwbc_.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CfypjWW9.js} +1 -1
  17. package/dist/{IngredientGroupView-BheK-hr7.js → IngredientGroupView-eN4sBErO.js} +5 -5
  18. package/dist/{IngredientsView-CcBD0nYz.js → IngredientsView-DQvn_4YD.js} +14 -14
  19. package/dist/{IntegrationView-BjSMrWJi.js → IntegrationView-DCy2Ovro.js} +12 -12
  20. package/dist/{InventoryBindingForm-CA0jI2fl.js → InventoryBindingForm-Bi_8m5gH.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BREhgetj.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CO_qBo1J.js} +14 -14
  22. package/dist/{InventoryBindingSummary-BwTziKzM.js → InventoryBindingSummary-BGFGNEaq.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C3U2CRwm.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CTzDO5jB.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Oz2AyEGP.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Bcs3g9F2.js} +2 -2
  25. package/dist/{PublishView-TMhQAsyu.js → PublishView-BX8Ed4Fw.js} +3 -3
  26. package/dist/{PurchaseOrderPrintPreview-DuYNXbd4.js → PurchaseOrderPrintPreview-D6N8SLTM.js} +9 -9
  27. package/dist/ReceiveRequestView-CbP7cF9S.js +2873 -0
  28. package/dist/{RecipeView-DppUQeYL.js → RecipeView-qjmtVVz0.js} +8 -8
  29. package/dist/{StockView-DAm5kNok.js → StockView-CKjuCvQc.js} +344 -341
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BkGdp_SI.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BpsE9HjF.js} +1 -1
  31. package/dist/{SupplierView-DYBw03Op.js → SupplierView-0Wkmi0vZ.js} +11 -11
  32. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-DGb1ngHq.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-js9xKiOh.js} +2 -2
  33. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CiAORJrZ.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CFQjYlPf.js} +1 -1
  34. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Bng7t5aA.js → TransferDetails.vue_vue_type_script_setup_true_lang-EHUIhMvO.js} +430 -430
  35. package/dist/{TransferTemplateView-BsSwtFY0.js → TransferTemplateView-B686QVLm.js} +354 -354
  36. package/dist/{UnitView-sCwSm5jh.js → UnitView-D3TwY-Rl.js} +6 -6
  37. package/dist/{WarehouseView-CU5qLsQL.js → WarehouseView-wuSCGpc4.js} +5 -5
  38. package/dist/{WastageTemplateView-DiqGE7E3.js → WastageTemplateView-BhVG1haN.js} +14 -14
  39. package/dist/{app-CRAhcbhd.js → app-lUdYxPdT.js} +2372 -2303
  40. package/dist/app.js +7 -7
  41. package/dist/{closing-template-DYislCMF.js → closing-template-5nZX2GD3.js} +1 -1
  42. package/dist/{date2-C-xZ8cqf.js → date2-BPDWKAmI.js} +1 -1
  43. package/dist/{dayjs.min-BLcebhHP.js → dayjs.min-CRgiNB25.js} +21 -21
  44. package/dist/{decimal-UKannZrQ.js → decimal-xfLGGBXv.js} +2 -2
  45. package/dist/{defineDeepModel-D8ScMZZw.js → defineDeepModel-D_Oxy2Kx.js} +1 -1
  46. package/dist/{duplicate-template-De-74YH6.js → duplicate-template-Blu_HX7A.js} +1 -1
  47. package/dist/feature-BQk-YWoV.js +25699 -0
  48. package/dist/{format-time-from-id-Cop0w9qb.js → format-time-from-id-DUZwcLw9.js} +1 -1
  49. package/dist/{format-unit-display-1G-lIy-O.js → format-unit-display-D-X5mzYF.js} +245 -246
  50. package/dist/helper/object.d.ts +21 -0
  51. package/dist/helper/reactivity.d.ts +11 -0
  52. package/dist/helper/reactivity.spec.d.ts +1 -0
  53. package/dist/{import-export.helper-DwtwMGUg.js → import-export.helper-BgbvcSvd.js} +5 -5
  54. package/dist/{index-mHuFfoTd.js → index-BaMcL6nD.js} +9 -9
  55. package/dist/{index-CZVxWvXs.js → index-BvxQIPJI.js} +3 -3
  56. package/dist/{index-D0Jbqka0.js → index-tnlv1Cb_.js} +1 -1
  57. package/dist/{lodash-ChFp_-Yp.js → lodash-C9Qka4SS.js} +1 -1
  58. package/dist/{netsuite-51c6h4mk.js → netsuite-Dns3RQor.js} +70 -70
  59. package/dist/{purchase-order-template-BmmBT4iS.js → purchase-order-template-Yfp5lQ6o.js} +1 -1
  60. package/dist/{rules-BleXdYUs.js → rules-2gDRiI3y.js} +3 -3
  61. package/dist/{stock-B-nJZjoG.js → stock-D3amnnvm.js} +1 -1
  62. package/dist/{stock-6SYODLp6.js → stock-DMwTxyEy.js} +3 -3
  63. package/dist/{supplier-BuYvvMKA.js → supplier-Bi2nswlc.js} +2 -2
  64. package/dist/tsconfig.app.tsbuildinfo +1 -1
  65. package/dist/{use-ingredient-select-dialog-Bh5T8TmW.js → use-ingredient-select-dialog-B3j2244S.js} +2 -2
  66. package/dist/{use-inventory-binding-dialog-Dh0hVzGV.js → use-inventory-binding-dialog-cEzQyw4F.js} +2 -2
  67. package/dist/{use-template-enabled-locations-2-pEIG0Sd8.js → use-template-enabled-locations-2-CnbMSpm9.js} +2 -2
  68. package/dist/views/receive-request/components/netsuite/NetSuitePanel.vue.d.ts +3 -2
  69. package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +3 -2
  70. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +23 -2554
  71. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +6 -0
  72. package/dist/views/receive-request/components/transfer-form/composables/use-purchase-order-form-controller.d.ts +22 -0
  73. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +3 -2
  74. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +1 -1
  75. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +6 -6
  76. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +7 -7
  77. package/dist/views/receive-request/helper/get-transfer-type.d.ts +1 -2
  78. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +3 -2
  79. package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImportItemProps.d.ts +3 -2
  80. package/dist/views/transfer-template/helpers/import-export.helper.d.ts +4 -3
  81. package/dist/{vue-i18n-DRHpfOaU.js → vue-i18n-D6IE7fks.js} +459 -459
  82. package/dist/{xlsx-DzVz917g.js → xlsx-By0V1CHo.js} +398 -398
  83. package/dist/{xlsx.util-D6AoBHGt.js → xlsx.util-DH2bvm7W.js} +1 -1
  84. package/package.json +3 -3
  85. package/dist/ReceiveRequestView-CHBSuE63.js +0 -2841
  86. package/dist/feature-D_iKVPEM.js +0 -20162
  87. package/dist/views/receive-request/constants/purchase-order-transaction-type.d.ts +0 -4
@@ -1,26 +1,26 @@
1
- import { defineComponent as ue, ref as O, computed as P, resolveComponent as U, openBlock as $, createBlock as z, withCtx as T, createElementVNode as e, normalizeClass as _e, toDisplayString as v, createVNode as y, createElementBlock as Y, Fragment as oe, renderList as ie, unref as a, h as ye, watch as xe, isRef as je, createCommentVNode as te, reactive as nt, mergeModels as qe, useModel as pt, onMounted as Le, createTextVNode as de, normalizeStyle as ot, Teleport as ft, normalizeProps as Te, mergeProps as He } from "vue";
1
+ import { defineComponent as ue, ref as O, computed as P, resolveComponent as U, openBlock as $, createBlock as z, withCtx as T, createElementVNode as e, normalizeClass as _e, toDisplayString as v, createVNode as y, createElementBlock as Y, Fragment as ne, renderList as ie, unref as a, h as ye, watch as xe, isRef as je, createCommentVNode as te, reactive as ot, mergeModels as qe, useModel as pt, onMounted as Le, createTextVNode as de, normalizeStyle as nt, Teleport as ft, normalizeProps as Te, mergeProps as He } from "vue";
2
2
  import { F as ze, u as vt, _ as yt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
3
- import { u as be, c as De, a as Be, F as Xe, E as _t, B as ne, t as kt, o as bt, z as gt, s as Q, h as Ee, i as ht, e as xt } from "./app-CRAhcbhd.js";
4
- import { u as Me } from "./stock-6SYODLp6.js";
3
+ import { u as be, c as De, a as Be, F as Xe, G as _t, C as oe, v as kt, o as bt, A as gt, s as Q, h as Ee, i as ht, e as xt } from "./app-lUdYxPdT.js";
4
+ import { u as Me } from "./stock-DMwTxyEy.js";
5
5
  import { c as St, _ as Ft, F as Je } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
6
- import { g as Se } from "./decimal-UKannZrQ.js";
7
- import { d as pe } from "./dayjs.min-BLcebhHP.js";
8
- import { e as wt, u as st, i as at, _ as Qe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-Oz2AyEGP.js";
9
- import { _ as Ne, S as Pe, g as lt, a as $t } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BkGdp_SI.js";
6
+ import { g as Se } from "./decimal-xfLGGBXv.js";
7
+ import { d as pe } from "./dayjs.min-CRgiNB25.js";
8
+ import { e as wt, u as st, i as at, _ as Qe } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-Bcs3g9F2.js";
9
+ import { _ as Ne, S as Pe, g as lt, a as $t } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BpsE9HjF.js";
10
10
  import { _ as At } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
11
11
  import { useI18n as ce, useCoreStore as Ge } from "@feedmepos/mf-common";
12
12
  import { useSnackbar as ge, useDialog as Ie, useProxiedModel as Ue, useBreakpoints as Vt } from "@feedmepos/ui-library";
13
13
  import { defineStore as Ct } from "pinia";
14
- import { g as Ye, a as ve, f as jt, t as Ae, h as Ve, A as Dt, M as Bt, d as ke, i as Mt, j as Ze, k as rt, l as Ke, R as It, e as we, m as Ut } from "./rules-BleXdYUs.js";
15
- import { u as he } from "./stock-B-nJZjoG.js";
16
- import { u as Tt } from "./use-inventory-binding-dialog-Dh0hVzGV.js";
17
- import { a as it } from "./FmMultiselectDialog-ynZ3ZEkp.js";
18
- import { _ as Ht } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C3U2CRwm.js";
19
- import { a as Et, b as Pt, f as ut, t as Rt, c as Ot, p as Nt, n as Yt, d as Lt } from "./date2-C-xZ8cqf.js";
20
- import { i as zt, _ as Gt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Bu4F9apP.js";
14
+ import { g as Ye, a as ve, f as jt, t as Ae, h as Ve, A as Dt, M as Bt, d as ke, i as Mt, j as Ze, k as rt, l as Ke, R as It, e as we, m as Ut } from "./rules-2gDRiI3y.js";
15
+ import { u as he } from "./stock-D3amnnvm.js";
16
+ import { u as Tt } from "./use-inventory-binding-dialog-cEzQyw4F.js";
17
+ import { a as it } from "./FmMultiselectDialog-CsohyGSW.js";
18
+ import { _ as Ht } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CTzDO5jB.js";
19
+ import { a as Et, b as Pt, f as ut, t as Rt, c as Ot, p as Nt, n as Yt, d as Lt } from "./date2-BPDWKAmI.js";
20
+ import { i as zt, _ as Gt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-UocERxk1.js";
21
21
  import { E as Kt } from "./empty-placeholder-wf6-BWE8.js";
22
- import { F as Re, u as Wt } from "./feature-D_iKVPEM.js";
23
- import { u as qt } from "./netsuite-51c6h4mk.js";
22
+ import { F as Re, u as Wt } from "./feature-BQk-YWoV.js";
23
+ import { u as qt } from "./netsuite-Dns3RQor.js";
24
24
  import { N as Xt, H as Jt } from "./app-uBuHtW8m.js";
25
25
  var $e = /* @__PURE__ */ ((k) => (k.History = "History", k.Convert = "Convert", k.Adjust = "Adjust", k))($e || {});
26
26
  const Qt = [
@@ -50,7 +50,7 @@ const Qt = [
50
50
  /* Adjust */
51
51
  }
52
52
  ];
53
- async function en(k) {
53
+ async function eo(k) {
54
54
  const d = `${(be().currentLocation.name || "").replace(
55
55
  / /g,
56
56
  "_"
@@ -71,17 +71,17 @@ async function en(k) {
71
71
  },
72
72
  {
73
73
  name: "Balance",
74
- selector: (o) => {
75
- const A = Ce(o, o.unit);
76
- return A.type === "unit" ? Se(o.balance, o.unit, null, !1) : Se(o.balance, o.unit, A.measurement, !1);
74
+ selector: (n) => {
75
+ const A = Ce(n, n.unit);
76
+ return A.type === "unit" ? Se(n.balance, n.unit, null, !1) : Se(n.balance, n.unit, A.measurement, !1);
77
77
  }
78
78
  },
79
79
  {
80
80
  name: "Unit",
81
- selector: (o) => {
81
+ selector: (n) => {
82
82
  var S;
83
- const A = Ce(o, o.unit);
84
- return A.type === "unit" ? o.unit.abbrev : ((S = o.unit.measurements.find((m) => m.id === A.measurement)) == null ? void 0 : S.abbrev) || "";
83
+ const A = Ce(n, n.unit);
84
+ return A.type === "unit" ? n.unit.abbrev : ((S = n.unit.measurements.find((m) => m.id === A.measurement)) == null ? void 0 : S.abbrev) || "";
85
85
  }
86
86
  }
87
87
  ]
@@ -94,19 +94,19 @@ function Ce(k, g) {
94
94
  const d = localStorage.getItem(`uom:${k._id}`);
95
95
  return d ? d === g._id ? {
96
96
  type: "unit"
97
- } : g.measurements.find((o) => o.id === d) ? {
97
+ } : g.measurements.find((n) => n.id === d) ? {
98
98
  type: "measurement",
99
99
  measurement: d
100
100
  } : {
101
101
  type: "unit"
102
- } : k.trackingMeasurement && g.measurements.find((o) => o.id === k.trackingMeasurement) ? {
102
+ } : k.trackingMeasurement && g.measurements.find((n) => n.id === k.trackingMeasurement) ? {
103
103
  type: "measurement",
104
104
  measurement: k.trackingMeasurement
105
105
  } : {
106
106
  type: "unit"
107
107
  };
108
108
  }
109
- const tn = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ ue({
109
+ const to = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ ue({
110
110
  __name: "UnitDisplayControl",
111
111
  props: {
112
112
  unit: {},
@@ -119,18 +119,18 @@ const tn = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ u
119
119
  return `uom:${j._id}`;
120
120
  }
121
121
  function d(j) {
122
- const w = g(o.sku);
123
- j ? localStorage.setItem(w, j) : localStorage.setItem(w, o.unit._id), A.value = Ce(o.sku, o.unit);
122
+ const w = g(n.sku);
123
+ j ? localStorage.setItem(w, j) : localStorage.setItem(w, n.unit._id), A.value = Ce(n.sku, n.unit);
124
124
  }
125
- const o = k, A = O(Ce(o.sku, o.unit)), S = P(() => {
126
- const { measurements: j } = o.unit;
125
+ const n = k, A = O(Ce(n.sku, n.unit)), S = P(() => {
126
+ const { measurements: j } = n.unit;
127
127
  return [
128
128
  {
129
- label: `${Se(o.amount, o.unit)}`,
129
+ label: `${Se(n.amount, n.unit)}`,
130
130
  value: null
131
131
  },
132
132
  ...j.map(({ id: w }) => ({
133
- label: `${Se(o.amount, o.unit, w)}`,
133
+ label: `${Se(n.amount, n.unit, w)}`,
134
134
  value: w
135
135
  }))
136
136
  ];
@@ -158,7 +158,7 @@ const tn = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ u
158
158
  F.value ? "border-fm-color-primary" : "border-fm-color-neutral-gray-100"
159
159
  ])
160
160
  }, [
161
- e("div", tn, v(i.value), 1),
161
+ e("div", to, v(i.value), 1),
162
162
  y(u, {
163
163
  class: "text-fm-color-neutral-gray-400",
164
164
  name: "expand_more"
@@ -166,7 +166,7 @@ const tn = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ u
166
166
  ], 2)
167
167
  ]),
168
168
  default: T(() => [
169
- ($(!0), Y(oe, null, ie(S.value, (B) => ($(), z(b, {
169
+ ($(!0), Y(ne, null, ie(S.value, (B) => ($(), z(b, {
170
170
  key: B.value ?? 0,
171
171
  label: B.label,
172
172
  "model-value": m(B),
@@ -177,24 +177,24 @@ const tn = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ u
177
177
  });
178
178
  };
179
179
  }
180
- }), nn = { class: "whitespace-nowrap" }, on = /* @__PURE__ */ ue({
180
+ }), oo = { class: "whitespace-nowrap" }, no = /* @__PURE__ */ ue({
181
181
  __name: "StockHeaderPreview",
182
182
  setup(k) {
183
183
  const { t: g } = ce();
184
- return (d, o) => ($(), z(At, null, {
184
+ return (d, n) => ($(), z(At, null, {
185
185
  default: T(() => [
186
- e("div", nn, v(a(g)("inventory.stock.prediction.daysRemaining")), 1)
186
+ e("div", oo, v(a(g)("inventory.stock.prediction.daysRemaining")), 1)
187
187
  ]),
188
188
  _: 1
189
189
  }));
190
190
  }
191
191
  }), dt = Ct("stockActions", () => {
192
- const k = O(!1), g = be(), d = Me(), o = st(), A = ge(), S = Ie(), { t: m } = ce();
192
+ const k = O(!1), g = be(), d = Me(), n = st(), A = ge(), S = Ie(), { t: m } = ce();
193
193
  async function i() {
194
194
  if (g._currentLocation) {
195
195
  k.value = !0;
196
196
  try {
197
- await d.readStockBalance(), await d.readProductBalance(), await o.readStockEstimateBalance();
197
+ await d.readStockBalance(), await d.readProductBalance(), await n.readStockEstimateBalance();
198
198
  } catch {
199
199
  A.open({
200
200
  title: m("inventory.stock.error.title"),
@@ -277,26 +277,26 @@ const tn = { class: "fm-typo-en-body-md-400 flex-grow" }, ct = /* @__PURE__ */ u
277
277
  adjustSkuDialogProps: w
278
278
  };
279
279
  });
280
- function sn() {
280
+ function so() {
281
281
  var S;
282
- const k = be(), g = dt(), d = Ge(), { t: o } = ce();
282
+ const k = be(), g = dt(), d = Ge(), { t: n } = ce();
283
283
  return {
284
284
  columnDefs: [
285
285
  {
286
286
  accessorKey: "code",
287
- header: () => o("inventory.stock.code"),
287
+ header: () => n("inventory.stock.code"),
288
288
  enableSorting: !0,
289
289
  size: 300
290
290
  },
291
291
  {
292
292
  accessorKey: "name",
293
- header: () => o("inventory.stock.product"),
293
+ header: () => n("inventory.stock.product"),
294
294
  enableSorting: !0,
295
295
  size: "auto"
296
296
  },
297
297
  {
298
298
  id: "UOM",
299
- header: () => o("inventory.stock.balance"),
299
+ header: () => n("inventory.stock.balance"),
300
300
  cell(m) {
301
301
  const i = m.row.original, F = {
302
302
  unit: i.unit,
@@ -311,7 +311,7 @@ function sn() {
311
311
  ...(S = d.sessionUser.value) != null && S.role.isAdmin ? [
312
312
  {
313
313
  accessorKey: "isInactive",
314
- header: () => ye(ze, {}, () => `${o("inventory.ingredient.status.title")}`),
314
+ header: () => ye(ze, {}, () => `${n("inventory.ingredient.status.title")}`),
315
315
  cell(m) {
316
316
  const i = m.row.original.isInactive;
317
317
  return ye(
@@ -322,7 +322,7 @@ function sn() {
322
322
  i ? "bg-red-100 text-red-700" : "bg-green-100 text-green-700"
323
323
  ].join(" ")
324
324
  },
325
- o(i ? "inventory.ingredient.status.inactive" : "inventory.ingredient.status.active")
325
+ n(i ? "inventory.ingredient.status.inactive" : "inventory.ingredient.status.active")
326
326
  );
327
327
  },
328
328
  enableSorting: !0
@@ -331,7 +331,7 @@ function sn() {
331
331
  {
332
332
  accessorKey: "day",
333
333
  id: "expireDate",
334
- header: () => ye(on),
334
+ header: () => ye(no),
335
335
  enableSorting: !0,
336
336
  sortUndefined: "last",
337
337
  cell(m) {
@@ -368,7 +368,7 @@ function sn() {
368
368
  ]
369
369
  };
370
370
  }
371
- const an = {
371
+ const ao = {
372
372
  context: null,
373
373
  error: null,
374
374
  isRequired(k = "This field is required") {
@@ -403,9 +403,9 @@ const an = {
403
403
  }
404
404
  };
405
405
  function et(k) {
406
- return { ...an, context: k };
406
+ return { ...ao, context: k };
407
407
  }
408
- const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-800" }, un = { class: "flex flex-col gap-24 w-full" }, cn = { class: "flex flex-col gap-8" }, dn = { class: "fm-typo-en-body-lg-600" }, mn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary flex-grow" }, pn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-error" }, fn = { class: "flex flex-col p-16 gap-8" }, vn = { class: "flex flex-col gap-4" }, yn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border-b py-12 px-16" }, _n = { class: "grid grid-cols-[auto_100px_100px_48px] xs:grid-cols-[auto_80px_120px_48px] gap-8 px-8 items-center" }, kn = { class: "xs:col-span-3" }, bn = { class: "flex gap-8" }, gn = /* @__PURE__ */ ue({
408
+ const lo = { class: "flex items-center" }, ro = { class: "fm-typo-en-title-md-800" }, io = { class: "flex flex-col gap-24 w-full" }, uo = { class: "flex flex-col gap-8" }, co = { class: "fm-typo-en-body-lg-600" }, mo = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary flex-grow" }, po = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-error" }, fo = { class: "flex flex-col p-16 gap-8" }, vo = { class: "flex flex-col gap-4" }, yo = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border-b py-12 px-16" }, _o = { class: "grid grid-cols-[auto_100px_100px_48px] xs:grid-cols-[auto_80px_120px_48px] gap-8 px-8 items-center" }, ko = { class: "xs:col-span-3" }, bo = { class: "flex gap-8" }, go = /* @__PURE__ */ ue({
409
409
  __name: "ConvertSkuDialog",
410
410
  props: {
411
411
  sku: {},
@@ -414,10 +414,10 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
414
414
  },
415
415
  emits: ["update:show", "submitted"],
416
416
  setup(k, { expose: g, emit: d }) {
417
- const o = k, A = d, S = Tt(), m = Be(), i = he(), F = ge(), { t: j } = ce(), w = O(0), u = O(null), b = P(() => m.skus), C = P(
417
+ const n = k, A = d, S = Tt(), m = Be(), i = he(), F = ge(), { t: j } = ce(), w = O(0), u = O(null), b = P(() => m.skus), C = P(
418
418
  () => {
419
- var p, n;
420
- return (((n = (p = o.sku) == null ? void 0 : p.convert) == null ? void 0 : n.inventoryBindings) ?? []).filter(
419
+ var p, o;
420
+ return (((o = (p = n.sku) == null ? void 0 : p.convert) == null ? void 0 : o.inventoryBindings) ?? []).filter(
421
421
  (r) => r.type === Xe.enum.SKU
422
422
  );
423
423
  }
@@ -426,51 +426,51 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
426
426
  return !!u.value;
427
427
  },
428
428
  set(p) {
429
- p ? u.value = De(C.value) : (u.value = null, w.value = Math.min(w.value, o.maxCount ?? 0));
429
+ p ? u.value = De(C.value) : (u.value = null, w.value = Math.min(w.value, n.maxCount ?? 0));
430
430
  }
431
431
  }), D = O(!1);
432
- xe([() => o.show], ([p]) => {
432
+ xe([() => n.show], ([p]) => {
433
433
  p && (w.value = 0);
434
434
  });
435
435
  function s() {
436
- N(o.sku, Ae(w.value), u.value);
436
+ N(n.sku, Ae(w.value), u.value);
437
437
  }
438
438
  function t(p) {
439
439
  if (u.value)
440
440
  return !0;
441
- const n = et(p).isInteger().max(o.maxCount ?? 0).error ?? "";
442
- return n || !0;
441
+ const o = et(p).isInteger().max(n.maxCount ?? 0).error ?? "";
442
+ return o || !0;
443
443
  }
444
444
  function l(p) {
445
445
  var f;
446
- const n = (f = o.sku.convert) != null && f.measurement ? o.sku.unit.measurements.find((M) => {
446
+ const o = (f = n.sku.convert) != null && f.measurement ? n.sku.unit.measurements.find((M) => {
447
447
  var I;
448
- return M.id === ((I = o.sku.convert) == null ? void 0 : I.measurement);
449
- }) ?? null : null, r = Ye(o.sku.unit, n), h = Mt(+p);
448
+ return M.id === ((I = n.sku.convert) == null ? void 0 : I.measurement);
449
+ }) ?? null : null, r = Ye(n.sku.unit, o), h = Mt(+p);
450
450
  return et(h).isInteger().max(r).error ? "Precision cannot be more than " + r : !0;
451
451
  }
452
452
  const x = P(
453
453
  () => {
454
- var p, n;
455
- return (p = o.sku.convert) != null && p.measurement ? (n = o.sku.unit.measurements.find((r) => {
454
+ var p, o;
455
+ return (p = n.sku.convert) != null && p.measurement ? (o = n.sku.unit.measurements.find((r) => {
456
456
  var h;
457
- return r.id === ((h = o.sku.convert) == null ? void 0 : h.measurement);
458
- })) == null ? void 0 : n.abbrev : o.sku.unit.abbrev;
457
+ return r.id === ((h = n.sku.convert) == null ? void 0 : h.measurement);
458
+ })) == null ? void 0 : o.abbrev : n.sku.unit.abbrev;
459
459
  }
460
460
  ), _ = P(() => {
461
461
  var h, c;
462
- const n = _t({
463
- bindings: ((h = o.sku.convert) == null ? void 0 : h.inventoryBindings) ?? [],
462
+ const o = _t({
463
+ bindings: ((h = n.sku.convert) == null ? void 0 : h.inventoryBindings) ?? [],
464
464
  skus: m.skus,
465
465
  skuGroups: m.skuGroups,
466
466
  recipes: m.recipes
467
467
  }).inventoryBindings.filter((f) => "success" in f && f.success).map((f) => f).map((f) => f.binding);
468
- return (c = u.value ?? n) == null ? void 0 : c.map((f) => {
468
+ return (c = u.value ?? o) == null ? void 0 : c.map((f) => {
469
469
  var le, re, Z, ae, fe;
470
- const M = m.skus.find((me) => me._id === f.id), I = ((le = f.measurement) == null ? void 0 : le.abbrev) ?? ((re = M == null ? void 0 : M.unit) == null ? void 0 : re.abbrev), G = (Z = o.sku.convert) != null && Z.measurement ? o.sku.unit.measurements.find((me) => {
470
+ const M = m.skus.find((me) => me._id === f.id), I = ((le = f.measurement) == null ? void 0 : le.abbrev) ?? ((re = M == null ? void 0 : M.unit) == null ? void 0 : re.abbrev), G = (Z = n.sku.convert) != null && Z.measurement ? n.sku.unit.measurements.find((me) => {
471
471
  var We;
472
- return me.id === ((We = o.sku.convert) == null ? void 0 : We.measurement);
473
- }) ?? null : null, se = Ye(o.sku.unit, G), E = l(`${w.value}`) === !0 ? ve(
472
+ return me.id === ((We = n.sku.convert) == null ? void 0 : We.measurement);
473
+ }) ?? null : null, se = Ye(n.sku.unit, G), E = l(`${w.value}`) === !0 ? ve(
474
474
  jt(
475
475
  f.amount,
476
476
  Ae(+w.value, se)
@@ -486,27 +486,27 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
486
486
  }), V = O();
487
487
  g({
488
488
  validateInputs: () => {
489
- var p, n;
490
- (n = (p = V.value) == null ? void 0 : p.validateInputs) == null || n.call(p);
489
+ var p, o;
490
+ (o = (p = V.value) == null ? void 0 : p.validateInputs) == null || o.call(p);
491
491
  },
492
492
  resetInputsValidation: () => {
493
- var p, n;
494
- (n = (p = V.value) == null ? void 0 : p.resetInputsValidation) == null || n.call(p);
493
+ var p, o;
494
+ (o = (p = V.value) == null ? void 0 : p.resetInputsValidation) == null || o.call(p);
495
495
  },
496
496
  resetInputs: () => {
497
- var p, n;
498
- (n = (p = V.value) == null ? void 0 : p.resetInputs) == null || n.call(p);
497
+ var p, o;
498
+ (o = (p = V.value) == null ? void 0 : p.resetInputs) == null || o.call(p);
499
499
  }
500
500
  });
501
- const H = Ue(o, "show");
502
- async function N(p, n, r) {
501
+ const H = Ue(n, "show");
502
+ async function N(p, o, r) {
503
503
  D.value = !0;
504
504
  try {
505
505
  await i.convertSku({
506
506
  conversions: [
507
507
  {
508
508
  doc: p,
509
- amount: n,
509
+ amount: o,
510
510
  overrides: r == null ? void 0 : r.map((h) => ({
511
511
  ...h,
512
512
  amount: {
@@ -523,75 +523,75 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
523
523
  title: "Something went wrong",
524
524
  message: `Cannot convert ${p.name}. Please try again.`,
525
525
  type: "error"
526
- }), console.error("error at converting stock amount", p, n, h);
526
+ }), console.error("error at converting stock amount", p, o, h);
527
527
  } finally {
528
528
  D.value = !1;
529
529
  }
530
530
  }
531
- function K(p, n, r) {
532
- const h = +n;
531
+ function K(p, o, r) {
532
+ const h = +o;
533
533
  let c = r;
534
- n.length > 0 && isFinite(h) ? c = r.map((f) => (f.id !== p || (f.amount = ke(h)), f)) : c = r.map((f) => (f.id !== p || (f.amount = { amount: 0, precision: 0 }), f)), u.value = c;
534
+ o.length > 0 && isFinite(h) ? c = r.map((f) => (f.id !== p || (f.amount = ke(h)), f)) : c = r.map((f) => (f.id !== p || (f.amount = { amount: 0, precision: 0 }), f)), u.value = c;
535
535
  }
536
536
  function R(p) {
537
- const n = b.value.find((r) => r._id === p);
538
- return n ? lt(n.unit, !0) : [];
537
+ const o = b.value.find((r) => r._id === p);
538
+ return o ? lt(o.unit, !0) : [];
539
539
  }
540
- function X(p, n) {
541
- const r = R(p), h = r.find((c) => c.value === n) ?? r.find((c) => c.value === null);
540
+ function X(p, o) {
541
+ const r = R(p), h = r.find((c) => c.value === o) ?? r.find((c) => c.value === null);
542
542
  return h ? {
543
543
  ...h,
544
544
  label: h.abbrev
545
545
  } : null;
546
546
  }
547
- function L(p, n, r) {
547
+ function L(p, o, r) {
548
548
  let h;
549
- if (n === null)
549
+ if (o === null)
550
550
  h = r.map((c) => (c.id !== p || (c.measurement = null), c)) ?? [];
551
551
  else {
552
552
  const c = b.value.find((f) => f._id === p);
553
553
  h = r.map((f) => {
554
554
  var M, I;
555
- return f.id !== p || (f.measurement = (I = (M = c == null ? void 0 : c.unit) == null ? void 0 : M.measurements) == null ? void 0 : I.find((G) => G.id === n)), f;
555
+ return f.id !== p || (f.measurement = (I = (M = c == null ? void 0 : c.unit) == null ? void 0 : M.measurements) == null ? void 0 : I.find((G) => G.id === o)), f;
556
556
  }) ?? [];
557
557
  }
558
558
  u.value = h;
559
559
  }
560
- function ee(p, n) {
561
- const r = n.filter((h) => h.id !== p);
560
+ function ee(p, o) {
561
+ const r = o.filter((h) => h.id !== p);
562
562
  u.value = r;
563
563
  }
564
564
  function J() {
565
- const p = (u.value ?? []).map((n) => ({
566
- ...n,
565
+ const p = (u.value ?? []).map((o) => ({
566
+ ...o,
567
567
  type: Xe.enum.SKU
568
568
  }));
569
569
  S.promptIngredientsBinding(
570
570
  p,
571
- (n) => u.value = n,
572
- o.sku._id
571
+ (o) => u.value = o,
572
+ n.sku._id
573
573
  );
574
574
  }
575
575
  return xe(
576
- () => o.show,
576
+ () => n.show,
577
577
  (p) => {
578
578
  p || (u.value = null, w.value = 0);
579
579
  }
580
- ), (p, n) => {
580
+ ), (p, o) => {
581
581
  const r = U("FmTextField"), h = U("FmForm"), c = U("FmCard"), f = U("FmSwitch"), M = U("FmFormGroup"), I = U("FmSelect"), G = U("FmButton"), se = U("FmSideSheet");
582
582
  return $(), z(se, {
583
583
  "dismiss-away": "",
584
584
  modelValue: a(H),
585
- "onUpdate:modelValue": n[3] || (n[3] = (E) => je(H) ? H.value = E : null),
585
+ "onUpdate:modelValue": o[3] || (o[3] = (E) => je(H) ? H.value = E : null),
586
586
  "max-width": 500
587
587
  }, {
588
588
  "side-sheet-header": T(() => [
589
- e("div", ln, [
590
- e("div", rn, v(a(j)("inventory.stock.convert.title", { name: p.sku.name })), 1)
589
+ e("div", lo, [
590
+ e("div", ro, v(a(j)("inventory.stock.convert.title", { name: p.sku.name })), 1)
591
591
  ])
592
592
  ]),
593
593
  default: T(() => [
594
- e("div", un, [
594
+ e("div", io, [
595
595
  y(h, {
596
596
  ref_key: "formRef",
597
597
  ref: V,
@@ -601,7 +601,7 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
601
601
  y(r, {
602
602
  disabled: D.value,
603
603
  "model-value": w.value,
604
- "onUpdate:modelValue": n[0] || (n[0] = (E) => w.value = E),
604
+ "onUpdate:modelValue": o[0] || (o[0] = (E) => w.value = E),
605
605
  label: a(j)("inventory.stock.convert.amount"),
606
606
  rules: [t, l, a(Ve)(0)],
607
607
  "append-text": x.value,
@@ -615,16 +615,16 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
615
615
  class: "p-16"
616
616
  }, {
617
617
  default: T(() => [
618
- e("div", cn, [
619
- e("div", dn, v(a(j)("inventory.stock.convert.deductionSummary")), 1),
620
- ($(!0), Y(oe, null, ie(_.value, (E) => {
618
+ e("div", uo, [
619
+ e("div", co, v(a(j)("inventory.stock.convert.deductionSummary")), 1),
620
+ ($(!0), Y(ne, null, ie(_.value, (E) => {
621
621
  var W, q;
622
622
  return $(), Y("div", {
623
623
  key: (W = E.sku) == null ? void 0 : W._id,
624
624
  class: "flex items-center"
625
625
  }, [
626
- e("div", mn, v((q = E.sku) == null ? void 0 : q.name), 1),
627
- e("div", pn, " -" + v(E.convertAmount) + " " + v(E.abbrev), 1)
626
+ e("div", mo, v((q = E.sku) == null ? void 0 : q.name), 1),
627
+ e("div", po, " -" + v(E.convertAmount) + " " + v(E.abbrev), 1)
628
628
  ]);
629
629
  }), 128))
630
630
  ])
@@ -633,22 +633,22 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
633
633
  }),
634
634
  y(c, { variant: "outlined" }, {
635
635
  default: T(() => [
636
- e("div", fn, [
636
+ e("div", fo, [
637
637
  y(f, {
638
638
  value: "",
639
639
  modelValue: B.value,
640
- "onUpdate:modelValue": n[1] || (n[1] = (E) => B.value = E),
640
+ "onUpdate:modelValue": o[1] || (o[1] = (E) => B.value = E),
641
641
  label: a(j)("inventory.stock.convert.overrideDeduction"),
642
642
  "label-placement": "right"
643
643
  }, null, 8, ["modelValue", "label"]),
644
- B.value ? ($(), Y(oe, { key: 0 }, [
644
+ B.value ? ($(), Y(ne, { key: 0 }, [
645
645
  y(M, {
646
646
  modelValue: u.value,
647
647
  rules: [a(Dt)(1, "Must have at least one ingredient binding")]
648
648
  }, null, 8, ["modelValue", "rules"]),
649
- e("div", vn, [
650
- e("div", yn, v(a(j)("inventory.stock.convert.ingredients")), 1),
651
- ($(!0), Y(oe, null, ie(u.value, (E) => ($(), z(M, {
649
+ e("div", vo, [
650
+ e("div", yo, v(a(j)("inventory.stock.convert.ingredients")), 1),
651
+ ($(!0), Y(ne, null, ie(u.value, (E) => ($(), z(M, {
652
652
  key: E.id,
653
653
  disabled: D.value,
654
654
  modelValue: +a(ve)(E.amount ?? { amount: 1, precision: 0 }),
@@ -663,8 +663,8 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
663
663
  default: T(({ invalid: W }) => {
664
664
  var q, le, re;
665
665
  return [
666
- e("div", _n, [
667
- e("div", kn, v((q = b.value.find((Z) => Z._id === E.id)) == null ? void 0 : q.name), 1),
666
+ e("div", _o, [
667
+ e("div", ko, v((q = b.value.find((Z) => Z._id === E.id)) == null ? void 0 : q.name), 1),
668
668
  y(r, {
669
669
  class: "xs:col-span-2",
670
670
  disabled: D.value,
@@ -682,7 +682,7 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
682
682
  "onUpdate:modelValue": (Z) => L(E.id, Z, u.value ?? []),
683
683
  invalid: W
684
684
  }, {
685
- "helper-text": T(() => n[4] || (n[4] = [])),
685
+ "helper-text": T(() => o[4] || (o[4] = [])),
686
686
  _: 2
687
687
  }, 1032, ["disabled", "items", "model-value", "onUpdate:modelValue", "invalid"]),
688
688
  y(G, {
@@ -714,11 +714,11 @@ const ln = { class: "flex items-center" }, rn = { class: "fm-typo-en-title-md-80
714
714
  ])
715
715
  ]),
716
716
  "side-sheet-footer": T(() => [
717
- e("div", bn, [
717
+ e("div", bo, [
718
718
  y(G, {
719
719
  loading: D.value,
720
720
  label: a(j)("inventory.stock.convert.convertButton"),
721
- onClick: n[2] || (n[2] = (E) => {
721
+ onClick: o[2] || (o[2] = (E) => {
722
722
  var W, q;
723
723
  return (q = (W = V.value) == null ? void 0 : W.validateInputs) == null ? void 0 : q.call(W);
724
724
  })
@@ -738,31 +738,31 @@ function tt(k, g) {
738
738
  return Ae(Math.abs(k), g);
739
739
  }
740
740
  const Oe = {
741
- [ne.enum.DAMAGE]: {
741
+ [oe.enum.DAMAGE]: {
742
742
  label: "Damage",
743
743
  toAdjustmentAmount: Fe
744
744
  },
745
- [ne.enum.WASTAGE]: {
745
+ [oe.enum.WASTAGE]: {
746
746
  label: "Wastage",
747
747
  toAdjustmentAmount: Fe
748
748
  },
749
- [ne.enum.THEFT]: {
749
+ [oe.enum.THEFT]: {
750
750
  label: "Theft",
751
751
  toAdjustmentAmount: Fe
752
752
  },
753
- [ne.enum.LOSE]: {
753
+ [oe.enum.LOSE]: {
754
754
  label: "Lose",
755
755
  toAdjustmentAmount: Fe
756
756
  },
757
- [ne.enum.EXTRA]: {
757
+ [oe.enum.EXTRA]: {
758
758
  label: "Extra",
759
759
  toAdjustmentAmount: tt
760
760
  },
761
- [ne.enum.PURCHASE]: {
761
+ [oe.enum.PURCHASE]: {
762
762
  label: "Purchase",
763
763
  toAdjustmentAmount: tt
764
764
  }
765
- }, hn = { class: "col-span-2 flex" }, xn = { class: "fm-typo-en-body-lg-600 flex-1" }, Sn = { class: "col-span-2 flex flex-col gap-4" }, Fn = { class: "flex gap-4 text-fm-color-typo-primary fm-typo-en-body-lg-600" }, mt = /* @__PURE__ */ ue({
765
+ }, ho = { class: "col-span-2 flex" }, xo = { class: "flex-1" }, So = { class: "fm-typo-en-body-lg-600" }, Fo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wo = { class: "col-span-2 flex flex-col gap-4" }, $o = { class: "flex gap-4 text-fm-color-typo-primary fm-typo-en-body-lg-600" }, mt = /* @__PURE__ */ ue({
766
766
  __name: "AdjustedItemForm",
767
767
  props: {
768
768
  modelValue: {},
@@ -770,14 +770,14 @@ const Oe = {
770
770
  },
771
771
  emits: ["update:modelValue", "click:delete"],
772
772
  setup(k, { emit: g }) {
773
- const d = k, o = g, { t: A } = ce(), S = Me(), m = P(
773
+ const d = k, n = g, { t: A } = ce(), S = Me(), m = P(
774
774
  () => Object.keys(Oe).map((t) => ({
775
775
  label: kt(t),
776
776
  value: t
777
777
  }))
778
778
  ), i = P(() => lt(d.modelValue.doc.unit, !0)), F = P({
779
779
  get() {
780
- return d.modelValue.type ?? ne.enum.PURCHASE;
780
+ return d.modelValue.type ?? oe.enum.PURCHASE;
781
781
  },
782
782
  set(t) {
783
783
  const l = {
@@ -788,7 +788,7 @@ const Oe = {
788
788
  l.amount = Oe[l.type].toAdjustmentAmount(
789
789
  +ve(x),
790
790
  x.precision
791
- ), o("update:modelValue", l);
791
+ ), n("update:modelValue", l);
792
792
  }
793
793
  }), j = P({
794
794
  get() {
@@ -802,7 +802,7 @@ const Oe = {
802
802
  l.amount = Oe[F.value].toAdjustmentAmount(
803
803
  t,
804
804
  x.precision
805
- ), o("update:modelValue", l);
805
+ ), n("update:modelValue", l);
806
806
  }
807
807
  }), w = P({
808
808
  get() {
@@ -814,7 +814,7 @@ const Oe = {
814
814
  const l = {
815
815
  ...d.modelValue
816
816
  };
817
- l.measurement = ((_ = (x = d.modelValue.doc.unit) == null ? void 0 : x.measurements) == null ? void 0 : _.find((V) => V.id === t)) ?? null, o("update:modelValue", l);
817
+ l.measurement = ((_ = (x = d.modelValue.doc.unit) == null ? void 0 : x.measurements) == null ? void 0 : _.find((V) => V.id === t)) ?? null, n("update:modelValue", l);
818
818
  }
819
819
  }), u = P({
820
820
  get() {
@@ -824,7 +824,7 @@ const Oe = {
824
824
  const l = {
825
825
  ...d.modelValue
826
826
  };
827
- l.remark = t, o("update:modelValue", l);
827
+ l.remark = t, n("update:modelValue", l);
828
828
  }
829
829
  }), b = P(() => {
830
830
  var l;
@@ -845,12 +845,15 @@ const Oe = {
845
845
  class: "grid grid-cols-2 gap-8 p-16"
846
846
  }, {
847
847
  default: T(() => [
848
- e("div", hn, [
849
- e("div", xn, v(t.modelValue.doc.name), 1),
848
+ e("div", ho, [
849
+ e("div", xo, [
850
+ e("div", So, v(t.modelValue.doc.name), 1),
851
+ e("div", Fo, v(t.modelValue.doc.code), 1)
852
+ ]),
850
853
  y(x, {
851
854
  variant: "tertiary",
852
855
  "prepend-icon": "delete",
853
- onClick: l[0] || (l[0] = (N) => o("click:delete"))
856
+ onClick: l[0] || (l[0] = (N) => n("click:delete"))
854
857
  })
855
858
  ]),
856
859
  y(_, {
@@ -889,8 +892,8 @@ const Oe = {
889
892
  "onUpdate:modelValue": l[4] || (l[4] = (N) => u.value = N),
890
893
  "label-mark": "optional"
891
894
  }, null, 8, ["disabled", "modelValue"]),
892
- e("div", Sn, [
893
- e("div", Fn, v(a(A)("inventory.stock.stock_adjustment.stockAfter")), 1),
895
+ e("div", wo, [
896
+ e("div", $o, v(a(A)("inventory.stock.stock_adjustment.stockAfter")), 1),
894
897
  e("div", {
895
898
  class: _e(["fm-typo-en-body-lg-600", s.value ? "text-red-700" : "text-green-700"])
896
899
  }, v(D.value), 3)
@@ -900,7 +903,7 @@ const Oe = {
900
903
  });
901
904
  };
902
905
  }
903
- }), wn = { class: "flex items-center" }, $n = { class: "fm-typo-en-title-md-800" }, An = { class: "flex items-center" }, Vn = { class: "fm-typo-en-title-sm-800 flex-1" }, Cn = { class: "flex gap-8" }, jn = /* @__PURE__ */ ue({
906
+ }), Ao = { class: "flex items-center" }, Vo = { class: "fm-typo-en-title-md-800" }, Co = { class: "flex items-center" }, jo = { class: "fm-typo-en-title-sm-800 flex-1" }, Do = { class: "flex gap-8" }, Bo = /* @__PURE__ */ ue({
904
907
  __name: "AdjustSkuDialog",
905
908
  props: {
906
909
  stock: {},
@@ -908,7 +911,7 @@ const Oe = {
908
911
  },
909
912
  emits: ["update:show", "submitted"],
910
913
  setup(k, { expose: g, emit: d }) {
911
- const o = k, A = d, S = Be(), m = Ie(), i = he(), F = ge(), j = O(!1), { t: w } = ce();
914
+ const n = k, A = d, S = Be(), m = Ie(), i = he(), F = ge(), j = O(!1), { t: w } = ce();
912
915
  function u() {
913
916
  D(De(B));
914
917
  }
@@ -927,25 +930,25 @@ const Oe = {
927
930
  (x = (l = b.value) == null ? void 0 : l.resetInputs) == null || x.call(l);
928
931
  }
929
932
  });
930
- const C = Ue(o, "show"), B = nt({
933
+ const C = Ue(n, "show"), B = ot({
931
934
  remark: "",
932
935
  adjustments: [
933
936
  {
934
937
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
935
- type: ne.enum.PURCHASE,
936
- doc: o.stock,
938
+ type: oe.enum.PURCHASE,
939
+ doc: n.stock,
937
940
  measurement: null,
938
941
  remark: "",
939
942
  amount: ke(1)
940
943
  }
941
944
  ]
942
945
  });
943
- xe([() => o.show], ([l]) => {
946
+ xe([() => n.show], ([l]) => {
944
947
  l && (B.remark = "", B.adjustments = [
945
948
  {
946
949
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
947
- type: ne.enum.PURCHASE,
948
- doc: o.stock,
950
+ type: oe.enum.PURCHASE,
951
+ doc: n.stock,
949
952
  measurement: null,
950
953
  remark: "",
951
954
  amount: ke(1)
@@ -1005,7 +1008,7 @@ const Oe = {
1005
1008
  B.adjustments = _.map(
1006
1009
  (V) => B.adjustments.find((H) => H.doc._id === V) ?? {
1007
1010
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
1008
- type: ne.enum.PURCHASE,
1011
+ type: oe.enum.PURCHASE,
1009
1012
  doc: S.skus.find((H) => H._id === V),
1010
1013
  measurement: null,
1011
1014
  remark: "",
@@ -1026,8 +1029,8 @@ const Oe = {
1026
1029
  "max-width": 500
1027
1030
  }, {
1028
1031
  "side-sheet-header": T(() => [
1029
- e("div", wn, [
1030
- e("div", $n, v(a(w)("inventory.stock.adjust.title")), 1)
1032
+ e("div", Ao, [
1033
+ e("div", Vo, v(a(w)("inventory.stock.adjust.title")), 1)
1031
1034
  ])
1032
1035
  ]),
1033
1036
  default: T(() => [
@@ -1043,8 +1046,8 @@ const Oe = {
1043
1046
  modelValue: B.remark,
1044
1047
  "onUpdate:modelValue": x[0] || (x[0] = (K) => B.remark = K)
1045
1048
  }, null, 8, ["label", "modelValue"]),
1046
- e("div", An, [
1047
- e("div", Vn, v(a(w)("inventory.stock.adjust.adjustedItems")), 1),
1049
+ e("div", Co, [
1050
+ e("div", jo, v(a(w)("inventory.stock.adjust.adjustedItems")), 1),
1048
1051
  y(V, {
1049
1052
  "prepend-icon": "add",
1050
1053
  variant: "tertiary",
@@ -1052,7 +1055,7 @@ const Oe = {
1052
1055
  onClick: s
1053
1056
  })
1054
1057
  ]),
1055
- ($(!0), Y(oe, null, ie(B.adjustments, (K, R) => ($(), z(mt, {
1058
+ ($(!0), Y(ne, null, ie(B.adjustments, (K, R) => ($(), z(mt, {
1056
1059
  key: K.id,
1057
1060
  modelValue: B.adjustments[R],
1058
1061
  "onUpdate:modelValue": (X) => B.adjustments[R] = X,
@@ -1063,7 +1066,7 @@ const Oe = {
1063
1066
  }, 512)
1064
1067
  ]),
1065
1068
  "side-sheet-footer": T(() => [
1066
- e("div", Cn, [
1069
+ e("div", Do, [
1067
1070
  y(V, {
1068
1071
  label: a(w)("inventory.stock.adjust.adjustButton"),
1069
1072
  loading: j.value,
@@ -1078,14 +1081,14 @@ const Oe = {
1078
1081
  }, 8, ["modelValue"]);
1079
1082
  };
1080
1083
  }
1081
- }), Dn = { class: "flex items-center w-full gap-8" }, Bn = { class: "fm-typo-en-title-md-800 flex-1" }, Mn = { class: "flex flex-col gap-16" }, In = { class: "flex flex-col gap-4" }, Un = { class: "fm-typo-en-body-md-600" }, Tn = { class: "flex gap-8 items-start" }, Hn = { class: "flex-1 min-w-0" }, En = { class: "flex-1 min-w-0" }, Pn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Rn = { class: "flex items-center" }, On = { class: "fm-typo-en-title-sm-800 flex-1" }, Nn = { class: "flex gap-8" }, Yn = /* @__PURE__ */ ue({
1084
+ }), Mo = { class: "flex items-center w-full gap-8" }, Io = { class: "fm-typo-en-title-md-800 flex-1" }, Uo = { class: "flex flex-col gap-16" }, To = { class: "flex flex-col gap-4" }, Ho = { class: "fm-typo-en-body-md-600" }, Eo = { class: "flex gap-8 items-start" }, Po = { class: "flex-1 min-w-0" }, Ro = { class: "flex-1 min-w-0" }, Oo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, No = { class: "flex items-center" }, Yo = { class: "fm-typo-en-title-sm-800 flex-1" }, Lo = { class: "flex gap-8" }, zo = /* @__PURE__ */ ue({
1082
1085
  __name: "StockAdjustmentSideSheet",
1083
1086
  props: {
1084
1087
  show: { type: Boolean }
1085
1088
  },
1086
1089
  emits: ["update:show", "submitted"],
1087
1090
  setup(k, { emit: g }) {
1088
- const d = k, o = g, { t: A } = ce(), S = Be(), m = he(), i = Ie(), F = ge(), j = Ue(d, "show"), w = O(!1), u = nt({
1091
+ const d = k, n = g, { t: A } = ce(), S = Be(), m = he(), i = Ie(), F = ge(), j = Ue(d, "show"), w = O(!1), u = ot({
1089
1092
  remark: "",
1090
1093
  effectiveAt: /* @__PURE__ */ new Date(),
1091
1094
  adjustments: []
@@ -1141,7 +1144,7 @@ const Oe = {
1141
1144
  u.adjustments = H.map(
1142
1145
  (N) => u.adjustments.find((K) => K.doc._id === N) ?? {
1143
1146
  id: "",
1144
- type: ne.enum.PURCHASE,
1147
+ type: oe.enum.PURCHASE,
1145
1148
  doc: s.value[N],
1146
1149
  measurement: null,
1147
1150
  remark: "",
@@ -1178,7 +1181,7 @@ const Oe = {
1178
1181
  adjustments: _,
1179
1182
  effectiveAt: u.effectiveAt.toISOString()
1180
1183
  };
1181
- await m.adjustSku(De(V)), o("submitted"), o("update:show", !1);
1184
+ await m.adjustSku(De(V)), n("submitted"), n("update:show", !1);
1182
1185
  } catch (_) {
1183
1186
  F.open({
1184
1187
  title: A("inventory.stock.adjust.error.title"),
@@ -1199,22 +1202,22 @@ const Oe = {
1199
1202
  onAfterEnter: D
1200
1203
  }, {
1201
1204
  "side-sheet-header": T(() => [
1202
- e("div", Dn, [
1203
- e("div", Bn, v(a(A)("inventory.stock.stock_adjustment.title")), 1)
1205
+ e("div", Mo, [
1206
+ e("div", Io, v(a(A)("inventory.stock.stock_adjustment.title")), 1)
1204
1207
  ])
1205
1208
  ]),
1206
1209
  default: T(() => [
1207
- e("div", Mn, [
1210
+ e("div", Uo, [
1208
1211
  y(H, {
1209
1212
  label: a(A)("inventory.stock.adjust.remark"),
1210
1213
  modelValue: u.remark,
1211
1214
  "onUpdate:modelValue": V[0] || (V[0] = (L) => u.remark = L),
1212
1215
  "label-mark": "optional"
1213
1216
  }, null, 8, ["label", "modelValue"]),
1214
- e("div", In, [
1215
- e("label", Un, v(a(A)("inventory.stock.stock_adjustment.effectiveAt")), 1),
1216
- e("div", Tn, [
1217
- e("div", Hn, [
1217
+ e("div", To, [
1218
+ e("label", Ho, v(a(A)("inventory.stock.stock_adjustment.effectiveAt")), 1),
1219
+ e("div", Eo, [
1220
+ e("div", Po, [
1218
1221
  y(N, {
1219
1222
  class: "w-full",
1220
1223
  modelValue: b.value,
@@ -1223,7 +1226,7 @@ const Oe = {
1223
1226
  max: a(pe)().format("YYYY-MM-DD")
1224
1227
  }, null, 8, ["modelValue", "max"])
1225
1228
  ]),
1226
- e("div", En, [
1229
+ e("div", Ro, [
1227
1230
  y(K, {
1228
1231
  class: "w-full",
1229
1232
  modelValue: C.value,
@@ -1232,10 +1235,10 @@ const Oe = {
1232
1235
  }, null, 8, ["modelValue"])
1233
1236
  ])
1234
1237
  ]),
1235
- e("div", Pn, v(a(A)("inventory.stock.stock_adjustment.immediateHint")), 1)
1238
+ e("div", Oo, v(a(A)("inventory.stock.stock_adjustment.immediateHint")), 1)
1236
1239
  ]),
1237
- e("div", Rn, [
1238
- e("div", On, v(a(A)("inventory.stock.adjust.adjustedItems")), 1),
1240
+ e("div", No, [
1241
+ e("div", Yo, v(a(A)("inventory.stock.adjust.adjustedItems")), 1),
1239
1242
  y(R, {
1240
1243
  "prepend-icon": "add",
1241
1244
  variant: "tertiary",
@@ -1243,7 +1246,7 @@ const Oe = {
1243
1246
  onClick: t
1244
1247
  })
1245
1248
  ]),
1246
- ($(!0), Y(oe, null, ie(u.adjustments, (L, ee) => ($(), z(mt, {
1249
+ ($(!0), Y(ne, null, ie(u.adjustments, (L, ee) => ($(), z(mt, {
1247
1250
  key: L.id,
1248
1251
  modelValue: u.adjustments[ee],
1249
1252
  "onUpdate:modelValue": (J) => u.adjustments[ee] = J,
@@ -1252,7 +1255,7 @@ const Oe = {
1252
1255
  ])
1253
1256
  ]),
1254
1257
  "side-sheet-footer": T(() => [
1255
- e("div", Nn, [
1258
+ e("div", Lo, [
1256
1259
  y(R, {
1257
1260
  label: a(A)("common.confirm"),
1258
1261
  loading: w.value,
@@ -1261,7 +1264,7 @@ const Oe = {
1261
1264
  y(R, {
1262
1265
  label: a(A)("common.close"),
1263
1266
  variant: "tertiary",
1264
- onClick: V[3] || (V[3] = (L) => o("update:show", !1))
1267
+ onClick: V[3] || (V[3] = (L) => n("update:show", !1))
1265
1268
  }, null, 8, ["label"])
1266
1269
  ])
1267
1270
  ]),
@@ -1269,13 +1272,13 @@ const Oe = {
1269
1272
  }, 8, ["modelValue"]);
1270
1273
  };
1271
1274
  }
1272
- }), Ln = bt((k, g) => ({
1275
+ }), Go = bt((k, g) => ({
1273
1276
  // TODO: remove once latest inventory backend has been push
1274
- async findBillsByBusinessId(d, o, A) {
1277
+ async findBillsByBusinessId(d, n, A) {
1275
1278
  const S = `${k.businessesBackendUrl}/${d}/reports/find-many`, m = {
1276
1279
  // type: TYPE.bill,
1277
1280
  type: "bill",
1278
- restaurantIds: o,
1281
+ restaurantIds: n,
1279
1282
  ids: A
1280
1283
  };
1281
1284
  return await g.post(S, m);
@@ -1286,10 +1289,10 @@ const Oe = {
1286
1289
  };
1287
1290
  return await g.post(S, m);
1288
1291
  }
1289
- })), zn = {
1292
+ })), Ko = {
1290
1293
  key: 0,
1291
1294
  class: "flex justify-center items-center h-32"
1292
- }, Gn = { class: "mb-3" }, Kn = { class: "flex flex-col gap-8" }, Wn = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, qn = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, Xn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Jn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Qn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Zn = { class: "flex flex-col w-full px-2" }, eo = { class: "flex gap-2" }, to = /* @__PURE__ */ ue({
1295
+ }, Wo = { class: "mb-3" }, qo = { class: "flex flex-col gap-8" }, Xo = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, Jo = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, Qo = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, Zo = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, en = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, tn = { class: "flex flex-col w-full px-2" }, on = { class: "flex gap-2" }, nn = /* @__PURE__ */ ue({
1293
1296
  __name: "AmendAdjustmentForm",
1294
1297
  props: /* @__PURE__ */ qe({
1295
1298
  adjustmentId: {}
@@ -1299,7 +1302,7 @@ const Oe = {
1299
1302
  }),
1300
1303
  emits: /* @__PURE__ */ qe(["refreshHistory"], ["update:modelValue"]),
1301
1304
  setup(k, { emit: g }) {
1302
- const d = k, o = g, A = he(), S = pt(k, "modelValue"), m = O(!1), i = O(!1), F = O(!1), j = O({
1305
+ const d = k, n = g, A = he(), S = pt(k, "modelValue"), m = O(!1), i = O(!1), F = O(!1), j = O({
1303
1306
  _id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
1304
1307
  skus: []
1305
1308
  }), w = O();
@@ -1323,7 +1326,7 @@ const Oe = {
1323
1326
  }), await A.revertWastageAdjustment({
1324
1327
  targetWastageAdjustmentId: d.adjustmentId,
1325
1328
  amountsGoingToAdjust: s
1326
- }), o("refreshHistory"), F.value = !1, S.value = {};
1329
+ }), n("refreshHistory"), F.value = !1, S.value = {};
1327
1330
  }
1328
1331
  function b(s, t, l) {
1329
1332
  return P({
@@ -1337,7 +1340,7 @@ const Oe = {
1337
1340
  const _ = { ...S.value };
1338
1341
  _[s] || (_[s] = {}), _[s][t] = {
1339
1342
  amount: Re.fromNumber(x),
1340
- type: ne.Enum.WASTAGE,
1343
+ type: oe.Enum.WASTAGE,
1341
1344
  measurement: l
1342
1345
  }, S.value = _;
1343
1346
  }
@@ -1380,9 +1383,9 @@ const Oe = {
1380
1383
  e("div", null, "Amend Adjustment", -1)
1381
1384
  ])),
1382
1385
  "dialog-footer": T(() => [
1383
- e("div", Zn, [
1386
+ e("div", tn, [
1384
1387
  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)),
1385
- e("div", eo, [
1388
+ e("div", on, [
1386
1389
  y(H),
1387
1390
  y(N, {
1388
1391
  class: "sm:w-full xs:w-full",
@@ -1402,7 +1405,7 @@ const Oe = {
1402
1405
  ])
1403
1406
  ]),
1404
1407
  default: T(() => [
1405
- m.value ? ($(), Y("div", zn)) : ($(), z(V, {
1408
+ m.value ? ($(), Y("div", Ko)) : ($(), z(V, {
1406
1409
  key: 1,
1407
1410
  ref_key: "formRef",
1408
1411
  ref: w,
@@ -1415,29 +1418,29 @@ const Oe = {
1415
1418
  blameFormChildOnValidationFailed: ""
1416
1419
  }, {
1417
1420
  default: T(() => [
1418
- e("p", Gn, [
1421
+ e("p", Wo, [
1419
1422
  t[6] || (t[6] = e("b", null, "Date:", -1)),
1420
1423
  t[7] || (t[7] = e("br", null, null, -1)),
1421
1424
  de(" " + v(a(Et)(a(gt)(j.value._id))), 1)
1422
1425
  ]),
1423
- e("div", Kn, [
1424
- ($(!0), Y(oe, null, ie(j.value.skus, (R, X) => ($(), Y(oe, { key: X }, [
1425
- ($(!0), Y(oe, null, ie(R.amounts, (L, ee) => ($(), z(_, {
1426
+ e("div", qo, [
1427
+ ($(!0), Y(ne, null, ie(j.value.skus, (R, X) => ($(), Y(ne, { key: X }, [
1428
+ ($(!0), Y(ne, null, ie(R.amounts, (L, ee) => ($(), z(_, {
1426
1429
  key: ee,
1427
1430
  variant: "outlined",
1428
1431
  class: "p-2"
1429
1432
  }, {
1430
1433
  default: T(() => [
1431
- e("div", Wn, [
1432
- e("span", qn, v(R.sku.code), 1),
1434
+ e("div", Xo, [
1435
+ e("span", Jo, v(R.sku.code), 1),
1433
1436
  e("span", null, v(R.sku.name), 1)
1434
1437
  ]),
1435
1438
  t[12] || (t[12] = e("hr", { class: "m-2" }, null, -1)),
1436
- e("div", Xn, [
1439
+ e("div", Qo, [
1437
1440
  t[8] || (t[8] = e("span", { class: "fm-typo-en-body-lg-600" }, "Adjustment type:", -1)),
1438
1441
  e("span", null, v(L.type), 1)
1439
1442
  ]),
1440
- e("div", Jn, [
1443
+ e("div", Zo, [
1441
1444
  t[9] || (t[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
1442
1445
  e("span", null, v(a(Re).toFormatString({ value: L.amount })) + " " + v(B(R, L)), 1)
1443
1446
  ]),
@@ -1453,7 +1456,7 @@ const Oe = {
1453
1456
  a(Ve)(-1)
1454
1457
  ]
1455
1458
  }, null, 8, ["model-value", "onUpdate:modelValue", "helper-text", "append-text", "rules"]),
1456
- e("div", Qn, [
1459
+ e("div", en, [
1457
1460
  t[10] || (t[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
1458
1461
  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)),
1459
1462
  de(" " + v(D(
@@ -1474,19 +1477,19 @@ const Oe = {
1474
1477
  }, 8, ["modelValue"]);
1475
1478
  };
1476
1479
  }
1477
- }), no = { class: "p-16" }, oo = { class: "fm-typo-en-body-md-600 flex-grow" }, so = { class: "flex-grow text-fm-color-typo-secondary" }, ao = {
1480
+ }), sn = { class: "p-16" }, an = { class: "fm-typo-en-body-md-600 flex-grow" }, ln = { class: "flex-grow text-fm-color-typo-secondary" }, rn = {
1478
1481
  key: 0,
1479
1482
  class: "my-5"
1480
- }, lo = { class: "text-neutral-400" }, ro = { class: "flex-grow" }, io = { class: "flex gap-1" }, uo = { class: "flex flex-col gap-1" }, co = {
1483
+ }, un = { class: "text-neutral-400" }, cn = { class: "flex-grow" }, dn = { class: "flex gap-1" }, mn = { class: "flex flex-col gap-1" }, pn = {
1481
1484
  key: 1,
1482
1485
  class: "t-system text-fsecondary"
1483
- }, mo = {
1486
+ }, fn = {
1484
1487
  key: 3,
1485
1488
  class: "inline-flex items-center rounded-md bg-yellow-400/10 px-2 text-xs font-medium text-yellow-500 inset-ring inset-ring-yellow-400/20"
1486
- }, po = {
1489
+ }, vn = {
1487
1490
  key: 1,
1488
1491
  class: "shrink-0 text-fm-color-typo-secondary"
1489
- }, fo = /* @__PURE__ */ ue({
1492
+ }, yn = /* @__PURE__ */ ue({
1490
1493
  __name: "StockRecordCard",
1491
1494
  props: {
1492
1495
  record: {},
@@ -1495,9 +1498,9 @@ const Oe = {
1495
1498
  },
1496
1499
  emits: ["refreshHistory"],
1497
1500
  setup(k, { emit: g }) {
1498
- const d = k, o = O(!1);
1501
+ const d = k, n = O(!1);
1499
1502
  Ge();
1500
- const A = O(), S = O(null), m = P(() => S.value === null ? "unset" : o.value ? `${S.value}px` : "0px");
1503
+ const A = O(), S = O(null), m = P(() => S.value === null ? "unset" : n.value ? `${S.value}px` : "0px");
1501
1504
  Le(() => {
1502
1505
  var w;
1503
1506
  S.value = ((w = A.value) == null ? void 0 : w.scrollHeight) || 0;
@@ -1562,24 +1565,24 @@ const Oe = {
1562
1565
  const b = U("FmIcon"), C = U("FmTooltip"), B = U("FmCard");
1563
1566
  return $(), z(B, { variant: "outlined" }, {
1564
1567
  default: T(() => [
1565
- e("div", no, [
1568
+ e("div", sn, [
1566
1569
  e("div", {
1567
1570
  class: "flex items-center cursor-pointer mb-1",
1568
- onClick: u[0] || (u[0] = (D) => o.value = !o.value)
1571
+ onClick: u[0] || (u[0] = (D) => n.value = !n.value)
1569
1572
  }, [
1570
- e("div", oo, v(w.record.date), 1),
1573
+ e("div", an, v(w.record.date), 1),
1571
1574
  y(b, {
1572
- name: o.value ? "expand_more" : "expand_less",
1575
+ name: n.value ? "expand_more" : "expand_less",
1573
1576
  color: "#777777",
1574
1577
  size: "md"
1575
1578
  }, null, 8, ["name"])
1576
1579
  ]),
1577
- ($(!0), Y(oe, null, ie(i.value, (D, s) => ($(), Y("div", {
1580
+ ($(!0), Y(ne, null, ie(i.value, (D, s) => ($(), Y("div", {
1578
1581
  key: s,
1579
1582
  class: "flex flex-row py-1",
1580
1583
  style: { "font-size": "0.8rem" }
1581
1584
  }, [
1582
- e("div", so, v(a(F)(`inventory.inventoryAdjustment.type.${s}`)), 1),
1585
+ e("div", ln, v(a(F)(`inventory.inventoryAdjustment.type.${s}`)), 1),
1583
1586
  e("div", {
1584
1587
  class: _e({
1585
1588
  "text-fm-color-typo-error": D.startsWith("-"),
@@ -1591,25 +1594,25 @@ const Oe = {
1591
1594
  e("div", {
1592
1595
  ref_key: "detailRef",
1593
1596
  ref: A,
1594
- style: ot({
1597
+ style: nt({
1595
1598
  fontSize: "0.8rem",
1596
1599
  maxHeight: m.value,
1597
1600
  overflow: "hidden",
1598
1601
  transition: "max-height 0.2s ease-out"
1599
1602
  })
1600
1603
  }, [
1601
- j.value.length ? ($(), Y("hr", ao)) : te("", !0),
1602
- ($(!0), Y(oe, null, ie(j.value, (D) => ($(), Y("div", {
1604
+ j.value.length ? ($(), Y("hr", rn)) : te("", !0),
1605
+ ($(!0), Y(ne, null, ie(j.value, (D) => ($(), Y("div", {
1603
1606
  key: D.time,
1604
1607
  class: "flex gap-1 w-full"
1605
1608
  }, [
1606
- e("div", lo, v(D.time), 1),
1607
- e("div", ro, [
1608
- ($(!0), Y(oe, null, ie(D.adjustments, (s) => ($(), Y("div", {
1609
+ e("div", un, v(D.time), 1),
1610
+ e("div", cn, [
1611
+ ($(!0), Y(ne, null, ie(D.adjustments, (s) => ($(), Y("div", {
1609
1612
  key: s.name,
1610
1613
  class: "flex gap-1"
1611
1614
  }, [
1612
- e("div", io, [
1615
+ e("div", dn, [
1613
1616
  de(v(a(F)(`inventory.inventoryAdjustment.type.${s.name}`)) + " ", 1),
1614
1617
  s.backdateFrom ? ($(), z(C, {
1615
1618
  key: 0,
@@ -1618,7 +1621,7 @@ const Oe = {
1618
1621
  "z-index": 50
1619
1622
  }, {
1620
1623
  content: T(() => [
1621
- e("div", uo, v(a(F)("inventory.stock.record.backdate", [
1624
+ e("div", mn, v(a(F)("inventory.stock.record.backdate", [
1622
1625
  a(ut)(new Date(s.backdateFrom))
1623
1626
  ])), 1)
1624
1627
  ]),
@@ -1631,12 +1634,12 @@ const Oe = {
1631
1634
  ]),
1632
1635
  _: 2
1633
1636
  }, 1024)) : te("", !0),
1634
- s.billRemark ? ($(), Y("span", co, " # " + v(s.billRemark), 1)) : te("", !0),
1637
+ s.billRemark ? ($(), Y("span", pn, " # " + v(s.billRemark), 1)) : te("", !0),
1635
1638
  s.remark ? ($(), Y("span", {
1636
1639
  key: 2,
1637
1640
  class: _e(s.billRemark ? "text-xs text-gray-400" : "")
1638
1641
  }, v(s.billRemark ? `(${s.remark})` : `# ${s.remark}`), 3)) : te("", !0),
1639
- s.name === a(ne).Enum.CLOSING ? ($(), Y("span", mo, " Actual Balance: " + v(s.toBalance) + " " + v(s.baseUnit), 1)) : te("", !0)
1642
+ s.name === a(oe).Enum.CLOSING ? ($(), Y("span", fn, " Actual Balance: " + v(s.toBalance) + " " + v(s.baseUnit), 1)) : te("", !0)
1640
1643
  ]),
1641
1644
  e("div", {
1642
1645
  class: _e({
@@ -1645,12 +1648,12 @@ const Oe = {
1645
1648
  "ml-auto": !0
1646
1649
  })
1647
1650
  }, v(s.amount), 3),
1648
- s.name === a(ne).Enum.WASTAGE ? ($(), z(to, {
1651
+ s.name === a(oe).Enum.WASTAGE ? ($(), z(nn, {
1649
1652
  key: 0,
1650
1653
  adjustmentId: s.adjustmentId,
1651
1654
  onRefreshHistory: u[1] || (u[1] = (t) => w.$emit("refreshHistory"))
1652
1655
  }, null, 8, ["adjustmentId"])) : te("", !0),
1653
- s.cost ? ($(), Y("div", po, " (" + v(a(we)(s.cost, !1, s.cost.precision)) + ") ", 1)) : te("", !0)
1656
+ s.cost ? ($(), Y("div", vn, " (" + v(a(we)(s.cost, !1, s.cost.precision)) + ") ", 1)) : te("", !0)
1654
1657
  ]))), 128))
1655
1658
  ])
1656
1659
  ]))), 128))
@@ -1662,9 +1665,9 @@ const Oe = {
1662
1665
  };
1663
1666
  }
1664
1667
  });
1665
- function vo(k, g) {
1668
+ function _n(k, g) {
1666
1669
  var S;
1667
- const d = Object.keys(ne.enum).reduce(
1670
+ const d = Object.keys(oe.enum).reduce(
1668
1671
  (m, i) => (m[i] = { amount: 0, precision: 0 }, m),
1669
1672
  {}
1670
1673
  );
@@ -1696,7 +1699,7 @@ function vo(k, g) {
1696
1699
  {}
1697
1700
  );
1698
1701
  }
1699
- function yo(k, g) {
1702
+ function kn(k, g) {
1700
1703
  if (!g)
1701
1704
  return null;
1702
1705
  let d = null;
@@ -1710,7 +1713,7 @@ function yo(k, g) {
1710
1713
  for (const S of A) {
1711
1714
  const m = S.amounts;
1712
1715
  for (const i of m) {
1713
- if (i.type !== ne.Enum.SALES)
1716
+ if (i.type !== oe.Enum.SALES)
1714
1717
  continue;
1715
1718
  const F = i.measurement ? Q.multiply([i.measurement.conversion, i.amount]) : i.amount;
1716
1719
  d ?? (d = Q.fromNumber(0)), d = Q.add([d, F]);
@@ -1721,22 +1724,22 @@ function yo(k, g) {
1721
1724
  precision: 4
1722
1725
  })} ${g.unit.abbrev}`) : null;
1723
1726
  }
1724
- const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = { class: "flex-1 line-clamp-2" }, bo = { class: "flex flex-col gap-32 w-full h-full" }, go = { class: "flex items-center relative gap-4" }, ho = { class: "flex-1" }, xo = {
1727
+ const bn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, gn = { class: "flex-1 line-clamp-2" }, hn = { class: "flex flex-col gap-32 w-full h-full" }, xn = { class: "flex items-center relative gap-4" }, Sn = { class: "flex-1" }, Fn = {
1725
1728
  key: 0,
1726
1729
  class: "flex-1 flex flex-col items-center gap-16"
1727
- }, So = { class: "fm-typo-en-body-lg-400 translate-x-4" }, Fo = {
1730
+ }, wn = { class: "fm-typo-en-body-lg-400 translate-x-4" }, $n = {
1728
1731
  key: 1,
1729
1732
  class: "flex flex-col gap-12"
1730
- }, wo = { class: "pb-16" }, $o = { class: "fm-typo-cn-body-lg-600" }, Ao = {
1733
+ }, An = { class: "pb-16" }, Vn = { class: "fm-typo-cn-body-lg-600" }, Cn = {
1731
1734
  class: "grid gap-12 fm-typo-en-body-md-400",
1732
1735
  style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
1733
- }, Vo = { class: "flex flex-col gap-1" }, Co = { class: "text-fm-color-typo-secondary" }, jo = { class: "font-bold" }, Do = { class: "flex flex-col gap-1" }, Bo = { class: "text-fm-color-typo-secondary flex" }, Mo = { class: "font-bold" }, Io = { class: "flex flex-col gap-1" }, Uo = { class: "text-fm-color-typo-secondary" }, To = { class: "font-bold" }, Ho = { class: "flex flex-col gap-1" }, Eo = { class: "text-fm-color-typo-secondary" }, Po = { class: "font-bold" }, Ro = { class: "flex flex-col gap-1" }, Oo = { class: "text-fm-color-typo-secondary" }, No = { class: "font-bold" }, Yo = { class: "flex flex-col gap-1" }, Lo = { class: "text-fm-color-typo-secondary" }, zo = { class: "font-bold" }, Go = { class: "flex flex-col gap-1" }, Ko = { class: "text-fm-color-typo-secondary" }, Wo = { class: "font-bold" }, qo = { class: "flex flex-col gap-1" }, Xo = { class: "text-fm-color-typo-secondary" }, Jo = { class: "font-bold" }, Qo = { class: "flex flex-col gap-1" }, Zo = { class: "text-fm-color-typo-secondary" }, es = { class: "font-bold" }, ts = {
1736
+ }, jn = { class: "flex flex-col gap-1" }, Dn = { class: "text-fm-color-typo-secondary" }, Bn = { class: "font-bold" }, Mn = { class: "flex flex-col gap-1" }, In = { class: "text-fm-color-typo-secondary flex" }, Un = { class: "font-bold" }, Tn = { class: "flex flex-col gap-1" }, Hn = { class: "text-fm-color-typo-secondary" }, En = { class: "font-bold" }, Pn = { class: "flex flex-col gap-1" }, Rn = { class: "text-fm-color-typo-secondary" }, On = { class: "font-bold" }, Nn = { class: "flex flex-col gap-1" }, Yn = { class: "text-fm-color-typo-secondary" }, Ln = { class: "font-bold" }, zn = { class: "flex flex-col gap-1" }, Gn = { class: "text-fm-color-typo-secondary" }, Kn = { class: "font-bold" }, Wn = { class: "flex flex-col gap-1" }, qn = { class: "text-fm-color-typo-secondary" }, Xn = { class: "font-bold" }, Jn = { class: "flex flex-col gap-1" }, Qn = { class: "text-fm-color-typo-secondary" }, Zn = { class: "font-bold" }, es = { class: "flex flex-col gap-1" }, ts = { class: "text-fm-color-typo-secondary" }, os = { class: "font-bold" }, ns = {
1734
1737
  key: 0,
1735
1738
  class: "flex flex-col gap-8"
1736
- }, ns = { class: "flex" }, os = { class: "flex-1 flex flex-col gap-1" }, ss = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, as = { class: "font-bold" }, ls = { class: "flex-1 flex flex-col gap-1" }, rs = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, is = { class: "flex flex-col gap-1" }, us = { class: "font-bold" }, cs = {
1739
+ }, ss = { class: "flex" }, as = { class: "flex-1 flex flex-col gap-1" }, ls = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, rs = { class: "font-bold" }, is = { class: "flex-1 flex flex-col gap-1" }, us = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, cs = { class: "flex flex-col gap-1" }, ds = { class: "font-bold" }, ms = {
1737
1740
  key: 2,
1738
1741
  class: "flex-1 flex flex-col items-center gap-8"
1739
- }, ds = ["src"], ms = { class: "font-bold text-lg" }, ps = { class: "text-xs text-neutral-400 text-center" }, fs = /* @__PURE__ */ ue({
1742
+ }, ps = ["src"], fs = { class: "font-bold text-lg" }, vs = { class: "text-xs text-neutral-400 text-center" }, ys = /* @__PURE__ */ ue({
1740
1743
  __name: "StockHistory",
1741
1744
  props: {
1742
1745
  sku: {},
@@ -1744,17 +1747,17 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
1744
1747
  },
1745
1748
  emits: ["update:show"],
1746
1749
  setup(k) {
1747
- const g = Ge(), d = Me(), o = he(), A = Ln(), S = be(), m = Wt(), { t: i } = ce(), F = k, j = O(!1), w = ge(), u = O(zt(0));
1750
+ const g = Ge(), d = Me(), n = he(), A = Go(), S = be(), m = Wt(), { t: i } = ce(), F = k, j = O(!1), w = ge(), u = O(zt(0));
1748
1751
  async function b() {
1749
1752
  j.value = !0;
1750
1753
  try {
1751
1754
  await l(), await d.readStockBalance();
1752
- } catch (n) {
1755
+ } catch (o) {
1753
1756
  w.open({
1754
1757
  title: "Something went wrong",
1755
1758
  message: "Cannot fetch stock history. Please try again.",
1756
1759
  type: "error"
1757
- }), console.log("failed at fetching item adjustment history", F.sku, u, n);
1760
+ }), console.log("failed at fetching item adjustment history", F.sku, u, o);
1758
1761
  } finally {
1759
1762
  j.value = !1;
1760
1763
  }
@@ -1765,11 +1768,11 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
1765
1768
  b();
1766
1769
  });
1767
1770
  const C = O([]), B = O([]), D = O(new Array());
1768
- function s(n, r) {
1769
- return r === "day" ? Lt(n) : ut(n);
1771
+ function s(o, r) {
1772
+ return r === "day" ? Lt(o) : ut(o);
1770
1773
  }
1771
- function t(n, r) {
1772
- const h = n.reduce(
1774
+ function t(o, r) {
1775
+ const h = o.reduce(
1773
1776
  (c, f) => {
1774
1777
  const M = f.effectiveAt ?? at(f._id);
1775
1778
  if (!M)
@@ -1785,35 +1788,35 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
1785
1788
  }));
1786
1789
  }
1787
1790
  async function l() {
1788
- let n = await o.readStockAdjustment(
1791
+ let o = await n.readStockAdjustment(
1789
1792
  F.sku._id,
1790
1793
  Rt(new Date(u.value.startDate)).toISOString(),
1791
1794
  Ot(new Date(u.value.endDate)).toISOString()
1792
1795
  );
1793
- C.value = n;
1794
- const r = n.filter(({ ref: h }) => h == null ? void 0 : h.startsWith("bill_")).map(({ ref: h }) => h);
1795
- await x(r), B.value = t(n, "day").map(({ date: h, adjustments: c }) => ({
1796
+ C.value = o;
1797
+ const r = o.filter(({ ref: h }) => h == null ? void 0 : h.startsWith("bill_")).map(({ ref: h }) => h);
1798
+ await x(r), B.value = t(o, "day").map(({ date: h, adjustments: c }) => ({
1796
1799
  date: h,
1797
1800
  adjustments: c,
1798
1801
  adjustmentsByTime: t(c, "minute")
1799
1802
  }));
1800
1803
  }
1801
- async function x(n) {
1802
- n.length && (D.value = await A.findBillsById(n).catch((r) => {
1804
+ async function x(o) {
1805
+ o.length && (D.value = await A.findBillsById(o).catch((r) => {
1803
1806
  var f;
1804
1807
  console.error("Error on using latest bill API, retrying using legacy api", r);
1805
1808
  const h = ((f = g.currentBusiness.value) == null ? void 0 : f._id) ?? "", c = S.currentLocation.doc._id;
1806
- return A.findBillsByBusinessId(h, [c], n);
1809
+ return A.findBillsByBusinessId(h, [c], o);
1807
1810
  }));
1808
1811
  }
1809
1812
  const _ = P(() => {
1810
- const n = C.value, r = F.sku;
1811
- return vo(n, r);
1813
+ const o = C.value, r = F.sku;
1814
+ return _n(o, r);
1812
1815
  }), V = P(() => {
1813
- const n = C.value, r = F.sku;
1814
- return yo(n, r);
1816
+ const o = C.value, r = F.sku;
1817
+ return kn(o, r);
1815
1818
  }), H = P(() => {
1816
- const n = [...C.value].computeFirst((h) => {
1819
+ const o = [...C.value].computeFirst((h) => {
1817
1820
  var f, M;
1818
1821
  const c = (M = (f = h.skus) == null ? void 0 : f.find) == null ? void 0 : M.call(f, (I) => I.sku._id === F.sku._id);
1819
1822
  return c == null ? void 0 : c.fromBalance;
@@ -1822,11 +1825,11 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
1822
1825
  precision: 0
1823
1826
  }, r = F.sku;
1824
1827
  return r ? `${Q.toFormatString({
1825
- value: n,
1828
+ value: o,
1826
1829
  precision: 4
1827
1830
  })} ${r.unit.abbrev}` : "";
1828
1831
  }), N = P(() => {
1829
- const n = [...C.value].reverse().computeFirst((h) => {
1832
+ const o = [...C.value].reverse().computeFirst((h) => {
1830
1833
  var f, M;
1831
1834
  const c = (M = (f = h.skus) == null ? void 0 : f.find) == null ? void 0 : M.call(f, (I) => I.sku._id === F.sku._id);
1832
1835
  return c == null ? void 0 : c.toBalance;
@@ -1834,7 +1837,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
1834
1837
  amount: 0,
1835
1838
  precision: 0
1836
1839
  }, r = F.sku;
1837
- return r ? `${Q.toFormatString({ value: n, precision: 4 })} ${r.unit.abbrev}` : "";
1840
+ return r ? `${Q.toFormatString({ value: o, precision: 4 })} ${r.unit.abbrev}` : "";
1838
1841
  }), K = P(() => {
1839
1842
  var h;
1840
1843
  const r = C.value.flatMap((c) => {
@@ -1862,20 +1865,20 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
1862
1865
  return we(r, !1, r.precision);
1863
1866
  });
1864
1867
  function R() {
1865
- const { startDate: n, endDate: r } = Nt(u.value);
1866
- n !== null && r !== null && (u.value = {
1867
- startDate: n,
1868
+ const { startDate: o, endDate: r } = Nt(u.value);
1869
+ o !== null && r !== null && (u.value = {
1870
+ startDate: o,
1868
1871
  endDate: r
1869
1872
  });
1870
1873
  }
1871
1874
  const X = P(() => i("inventory.ingredient.valuationMethod.WAVG")), L = P(() => {
1872
1875
  var I, G, se, E;
1873
- const n = [...C.value].reverse().computeFirst((W) => {
1876
+ const o = [...C.value].reverse().computeFirst((W) => {
1874
1877
  var q, le;
1875
1878
  return (le = (q = W.skus) == null ? void 0 : q.find) == null ? void 0 : le.call(q, (re) => re.sku._id === F.sku._id);
1876
1879
  });
1877
- if (!n) return "No data";
1878
- const r = [...n.amounts].reverse()[0], h = {
1880
+ if (!o) return "No data";
1881
+ const r = [...o.amounts].reverse()[0], h = {
1879
1882
  amount: ((I = r.cost) == null ? void 0 : I.amount) ?? 0,
1880
1883
  precision: ((G = r.cost) == null ? void 0 : G.precision) ?? 0
1881
1884
  }, c = r.amount, f = c.amount == 0 ? Q.fromNumber(0) : Q.divide([h, c]);
@@ -1885,13 +1888,13 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
1885
1888
  };
1886
1889
  }), ee = P(() => {
1887
1890
  var h;
1888
- const n = [...C.value].reverse().computeFirst((c) => {
1891
+ const o = [...C.value].reverse().computeFirst((c) => {
1889
1892
  var M, I;
1890
1893
  const f = (I = (M = c.skus) == null ? void 0 : M.find) == null ? void 0 : I.call(M, (G) => G.sku._id === F.sku._id);
1891
1894
  return f == null ? void 0 : f.toCostBalances;
1892
1895
  });
1893
- return n ? {
1894
- ...n.reduce((c, f) => Q.add([c, Q.fromDinero(f.cost)]), {
1896
+ return o ? {
1897
+ ...o.reduce((c, f) => Q.add([c, Q.fromDinero(f.cost)]), {
1895
1898
  amount: 0,
1896
1899
  precision: 0
1897
1900
  }),
@@ -1899,14 +1902,14 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
1899
1902
  } : "No data";
1900
1903
  });
1901
1904
  function J() {
1902
- const { startDate: n, endDate: r } = Yt(u.value);
1903
- n !== null && r !== null && (u.value = {
1904
- startDate: n,
1905
+ const { startDate: o, endDate: r } = Yt(u.value);
1906
+ o !== null && r !== null && (u.value = {
1907
+ startDate: o,
1905
1908
  endDate: r
1906
1909
  });
1907
1910
  }
1908
1911
  const p = Ue(F, "show");
1909
- return (n, r) => {
1912
+ return (o, r) => {
1910
1913
  const h = U("FmButton"), c = U("FmField"), f = U("FmDateRangePicker"), M = U("FmSpacer"), I = U("FmCircularProgress"), G = U("FmIcon"), se = U("FmTooltip"), E = U("FmMenuDivider"), W = U("FmChip"), q = U("FmCardSection"), le = U("FmCard"), re = U("FmSideSheet");
1911
1914
  return $(), z(re, {
1912
1915
  "dismiss-away": "",
@@ -1916,8 +1919,8 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
1916
1919
  "max-width": 560
1917
1920
  }, {
1918
1921
  "side-sheet-header": T(() => [
1919
- e("div", _o, [
1920
- e("div", ko, v(a(i)("inventory.stock.history.title", [n.sku.name])), 1),
1922
+ e("div", bn, [
1923
+ e("div", gn, v(a(i)("inventory.stock.history.title", [o.sku.name])), 1),
1921
1924
  y(h, {
1922
1925
  variant: "tertiary",
1923
1926
  "prepend-icon": "close",
@@ -1928,9 +1931,9 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
1928
1931
  default: T(() => {
1929
1932
  var Z;
1930
1933
  return [
1931
- e("div", bo, [
1932
- e("div", go, [
1933
- e("div", ho, [
1934
+ e("div", hn, [
1935
+ e("div", xn, [
1936
+ e("div", Sn, [
1934
1937
  y(f, {
1935
1938
  modelValue: u.value,
1936
1939
  "onUpdate:modelValue": r[1] || (r[1] = (ae) => u.value = ae),
@@ -1964,27 +1967,27 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
1964
1967
  "prepend-icon": "navigate_next"
1965
1968
  })
1966
1969
  ]),
1967
- j.value ? ($(), Y("div", xo, [
1970
+ j.value ? ($(), Y("div", Fn, [
1968
1971
  y(M),
1969
1972
  y(I, { size: "xl" }),
1970
- e("div", So, v(a(i)("inventory.stock.history.loading")), 1),
1973
+ e("div", wn, v(a(i)("inventory.stock.history.loading")), 1),
1971
1974
  y(M),
1972
1975
  y(M)
1973
- ])) : B.value && ((Z = B.value) == null ? void 0 : Z.length) > 0 ? ($(), Y("div", Fo, [
1976
+ ])) : B.value && ((Z = B.value) == null ? void 0 : Z.length) > 0 ? ($(), Y("div", $n, [
1974
1977
  y(le, { variant: "outlined" }, {
1975
1978
  default: T(() => [
1976
1979
  y(q, { class: "flex flex-col gap-4" }, {
1977
1980
  default: T(() => [
1978
- e("div", wo, [
1979
- e("div", $o, v(a(i)("inventory.stock.history.summary.title")), 1)
1981
+ e("div", An, [
1982
+ e("div", Vn, v(a(i)("inventory.stock.history.summary.title")), 1)
1980
1983
  ]),
1981
- e("div", Ao, [
1982
- e("div", Vo, [
1983
- e("div", Co, v(a(i)("inventory.stock.history.summary.totalPurchase")), 1),
1984
- e("div", jo, v(_.value.PURCHASE), 1)
1984
+ e("div", Cn, [
1985
+ e("div", jn, [
1986
+ e("div", Dn, v(a(i)("inventory.stock.history.summary.totalPurchase")), 1),
1987
+ e("div", Bn, v(_.value.PURCHASE), 1)
1985
1988
  ]),
1986
- e("div", Do, [
1987
- e("div", Bo, [
1989
+ e("div", Mn, [
1990
+ e("div", In, [
1988
1991
  de(v(a(i)("inventory.stock.history.summary.totalSales")) + "  ", 1),
1989
1992
  V.value != null ? ($(), z(se, {
1990
1993
  key: 0,
@@ -2002,44 +2005,44 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2002
2005
  _: 1
2003
2006
  }, 8, ["content"])) : te("", !0)
2004
2007
  ]),
2005
- e("div", Mo, v(_.value.SALES), 1)
2008
+ e("div", Un, v(_.value.SALES), 1)
2006
2009
  ]),
2007
- e("div", Io, [
2008
- e("div", Uo, v(a(i)("inventory.stock.history.summary.totalLose")), 1),
2009
- e("div", To, v(_.value.LOSE), 1)
2010
+ e("div", Tn, [
2011
+ e("div", Hn, v(a(i)("inventory.stock.history.summary.totalLose")), 1),
2012
+ e("div", En, v(_.value.LOSE), 1)
2010
2013
  ]),
2011
- e("div", Ho, [
2012
- e("div", Eo, v(a(i)("inventory.stock.history.summary.totalRequest")), 1),
2013
- e("div", Po, v(_.value.REQUEST), 1)
2014
+ e("div", Pn, [
2015
+ e("div", Rn, v(a(i)("inventory.stock.history.summary.totalRequest")), 1),
2016
+ e("div", On, v(_.value.REQUEST), 1)
2014
2017
  ]),
2015
- e("div", Ro, [
2016
- e("div", Oo, v(a(i)("inventory.stock.history.summary.totalReceive")), 1),
2017
- e("div", No, v(_.value.RECEIVE), 1)
2018
+ e("div", Nn, [
2019
+ e("div", Yn, v(a(i)("inventory.stock.history.summary.totalReceive")), 1),
2020
+ e("div", Ln, v(_.value.RECEIVE), 1)
2018
2021
  ]),
2019
- e("div", Yo, [
2020
- e("div", Lo, v(a(i)("inventory.stock.history.summary.totalConvert")), 1),
2021
- e("div", zo, v(_.value.CONVERT), 1)
2022
+ e("div", zn, [
2023
+ e("div", Gn, v(a(i)("inventory.stock.history.summary.totalConvert")), 1),
2024
+ e("div", Kn, v(_.value.CONVERT), 1)
2022
2025
  ]),
2023
- e("div", Go, [
2024
- e("div", Ko, v(a(i)("inventory.stock.history.summary.totalDamage")), 1),
2025
- e("div", Wo, v(_.value.DAMAGE), 1)
2026
+ e("div", Wn, [
2027
+ e("div", qn, v(a(i)("inventory.stock.history.summary.totalDamage")), 1),
2028
+ e("div", Xn, v(_.value.DAMAGE), 1)
2026
2029
  ]),
2027
- e("div", qo, [
2028
- e("div", Xo, v(a(i)("inventory.stock.history.summary.openingBalance")), 1),
2029
- e("div", Jo, v(H.value), 1)
2030
+ e("div", Jn, [
2031
+ e("div", Qn, v(a(i)("inventory.stock.history.summary.openingBalance")), 1),
2032
+ e("div", Zn, v(H.value), 1)
2030
2033
  ]),
2031
- e("div", Qo, [
2032
- e("div", Zo, v(a(i)("inventory.stock.history.summary.lastStockBalance")), 1),
2033
- e("div", es, v(N.value), 1)
2034
+ e("div", es, [
2035
+ e("div", ts, v(a(i)("inventory.stock.history.summary.lastStockBalance")), 1),
2036
+ e("div", os, v(N.value), 1)
2034
2037
  ])
2035
2038
  ]),
2036
- a(m).enableTotalCost ? ($(), Y("div", ts, [
2039
+ a(m).enableTotalCost ? ($(), Y("div", ns, [
2037
2040
  y(E, { class: "w-full" }),
2038
- e("div", ns, [
2039
- e("div", os, [
2041
+ e("div", ss, [
2042
+ e("div", as, [
2040
2043
  y(Qe, { "z-index": 50 }, {
2041
2044
  default: T(() => [
2042
- e("div", ss, [
2045
+ e("div", ls, [
2043
2046
  de(v(a(i)("inventory.stock.history.estimatedValue")) + " ", 1),
2044
2047
  y(se, {
2045
2048
  variant: "plain",
@@ -2059,8 +2062,8 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2059
2062
  ]),
2060
2063
  _: 1
2061
2064
  }),
2062
- e("div", as, [
2063
- n.sku.valuation === a(xt).Enum.FIFO ? ($(), Y(oe, { key: 0 }, [
2065
+ e("div", rs, [
2066
+ o.sku.valuation === a(xt).Enum.FIFO ? ($(), Y(ne, { key: 0 }, [
2064
2067
  y(W, {
2065
2068
  label: "FIFO",
2066
2069
  compact: ""
@@ -2070,7 +2073,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2070
2073
  !1,
2071
2074
  ee.value.precision
2072
2075
  ) : ee.value), 1)
2073
- ], 64)) : ($(), Y(oe, { key: 1 }, [
2076
+ ], 64)) : ($(), Y(ne, { key: 1 }, [
2074
2077
  de(v(typeof L.value != "string" ? a(we)(
2075
2078
  L.value,
2076
2079
  !1,
@@ -2079,10 +2082,10 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2079
2082
  ], 64))
2080
2083
  ])
2081
2084
  ]),
2082
- e("div", ls, [
2085
+ e("div", is, [
2083
2086
  y(Qe, { "z-index": 50 }, {
2084
2087
  default: T(() => [
2085
- e("div", rs, [
2088
+ e("div", us, [
2086
2089
  de(v(a(i)("inventory.stock.history.costSold")) + " ", 1),
2087
2090
  y(se, {
2088
2091
  variant: "plain",
@@ -2090,7 +2093,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2090
2093
  "z-index": 50
2091
2094
  }, {
2092
2095
  content: T(() => [
2093
- e("div", is, v(a(i)("inventory.stock.history.costSoldTooltip")), 1)
2096
+ e("div", cs, v(a(i)("inventory.stock.history.costSoldTooltip")), 1)
2094
2097
  ]),
2095
2098
  default: T(() => [
2096
2099
  y(G, {
@@ -2104,7 +2107,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2104
2107
  ]),
2105
2108
  _: 1
2106
2109
  }),
2107
- e("div", us, v(K.value), 1)
2110
+ e("div", ds, v(K.value), 1)
2108
2111
  ])
2109
2112
  ])
2110
2113
  ])) : te("", !0)
@@ -2115,27 +2118,27 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2115
2118
  _: 1
2116
2119
  }),
2117
2120
  r[5] || (r[5] = e("div", null, null, -1)),
2118
- ($(!0), Y(oe, null, ie(B.value, (ae) => ($(), Y(oe, {
2121
+ ($(!0), Y(ne, null, ie(B.value, (ae) => ($(), Y(ne, {
2119
2122
  key: ae.date
2120
2123
  }, [
2121
- n.sku ? ($(), z(fo, {
2124
+ o.sku ? ($(), z(yn, {
2122
2125
  key: 0,
2123
2126
  record: ae,
2124
- sku: n.sku,
2127
+ sku: o.sku,
2125
2128
  bills: D.value,
2126
2129
  onRefreshHistory: b
2127
2130
  }, null, 8, ["record", "sku", "bills"])) : te("", !0)
2128
2131
  ], 64))), 128))
2129
- ])) : ($(), Y("div", cs, [
2132
+ ])) : ($(), Y("div", ms, [
2130
2133
  y(M),
2131
2134
  e("div", null, [
2132
2135
  e("img", {
2133
2136
  src: a(Kt),
2134
2137
  alt: "List is empty"
2135
- }, null, 8, ds)
2138
+ }, null, 8, ps)
2136
2139
  ]),
2137
- e("div", ms, v(a(i)("inventory.stock.history.noRecords")), 1),
2138
- e("div", ps, v(a(i)("inventory.stock.history.changeDateRange")), 1),
2140
+ e("div", fs, v(a(i)("inventory.stock.history.noRecords")), 1),
2141
+ e("div", vs, v(a(i)("inventory.stock.history.changeDateRange")), 1),
2139
2142
  y(M),
2140
2143
  y(M)
2141
2144
  ]))
@@ -2146,14 +2149,14 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2146
2149
  }, 8, ["modelValue"]);
2147
2150
  };
2148
2151
  }
2149
- }), vs = {
2152
+ }), _s = {
2150
2153
  key: 0,
2151
2154
  class: "flex items-center gap-1"
2152
- }, ys = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _s = { class: "flex flex-col gap-8" }, ks = { class: "flex flex-col" }, bs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, gs = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, zs = /* @__PURE__ */ ue({
2155
+ }, ks = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, bs = { class: "flex flex-col gap-8" }, gs = { class: "flex flex-col" }, hs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xs = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, Ks = /* @__PURE__ */ ue({
2153
2156
  __name: "StockView",
2154
2157
  setup(k) {
2155
- const { t: g } = ce(), d = Be(), o = be(), A = Me(), S = dt(), m = he(), i = st(), F = qt(), { columnDefs: j } = sn(), w = Ie(), u = ge();
2156
- o.watchLocation(D);
2158
+ const { t: g } = ce(), d = Be(), n = be(), A = Me(), S = dt(), m = he(), i = st(), F = qt(), { columnDefs: j } = so(), w = Ie(), u = ge();
2159
+ n.watchLocation(D);
2157
2160
  const b = P(
2158
2161
  () => new Set(F.getAvailableItems(F.businessSubsidiaryId))
2159
2162
  ), C = O(!1);
@@ -2180,7 +2183,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2180
2183
  });
2181
2184
  }
2182
2185
  async function D() {
2183
- if (o._currentLocation) {
2186
+ if (n._currentLocation) {
2184
2187
  C.value = !0;
2185
2188
  try {
2186
2189
  await A.readStockBalance(), await A.readProductBalance(), await i.readStockEstimateBalance();
@@ -2213,7 +2216,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2213
2216
  }
2214
2217
  ]
2215
2218
  }), l = P(() => {
2216
- var n, r, h;
2219
+ var o, r, h;
2217
2220
  const J = t.value ? Xt.build(t.value) : null, p = [];
2218
2221
  for (const c of d.skus) {
2219
2222
  let f = !0;
@@ -2224,7 +2227,7 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2224
2227
  J
2225
2228
  )), f) {
2226
2229
  const M = c.trackingMeasurement;
2227
- let I = (r = (n = A.stockBalance.skus) == null ? void 0 : n.find(
2230
+ let I = (r = (o = A.stockBalance.skus) == null ? void 0 : o.find(
2228
2231
  (E) => E.id === c._id
2229
2232
  )) == null ? void 0 : r.balance, G = i.inventoryForecast.skus.find(
2230
2233
  (E) => E.id === c._id
@@ -2273,13 +2276,13 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2273
2276
  case "refresh":
2274
2277
  return D();
2275
2278
  case "export":
2276
- return en(l.value);
2279
+ return eo(l.value);
2277
2280
  case "stockAdjustment":
2278
2281
  return L();
2279
2282
  }
2280
2283
  }
2281
2284
  return (J, p) => {
2282
- const n = U("FmSwitch"), r = U("FmTable");
2285
+ const o = U("FmSwitch"), r = U("FmTable");
2283
2286
  return $(), z(yt, {
2284
2287
  title: a(g)("inventory.stock.title"),
2285
2288
  actions: R.value,
@@ -2309,12 +2312,12 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2309
2312
  "onUpdate:filter": p[2] || (p[2] = (I) => t.value = I)
2310
2313
  }, {
2311
2314
  default: T(() => [
2312
- a(F).isEnabled ? ($(), Y("div", vs, [
2313
- e("span", ys, v(a(g)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
2315
+ a(F).isEnabled ? ($(), Y("div", _s, [
2316
+ e("span", ks, v(a(g)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
2314
2317
  y($t),
2315
2318
  y(ze, null, {
2316
2319
  default: T(() => [
2317
- y(n, {
2320
+ y(o, {
2318
2321
  modelValue: _.value,
2319
2322
  "onUpdate:modelValue": p[0] || (p[0] = (I) => _.value = I)
2320
2323
  }, null, 8, ["modelValue"])
@@ -2326,12 +2329,12 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2326
2329
  _: 1
2327
2330
  }, 8, ["search", "filter-attributes", "filter"]),
2328
2331
  ($(), z(r, {
2329
- style: ot(a(K).tableHeight),
2332
+ style: nt(a(K).tableHeight),
2330
2333
  "column-defs": a(j),
2331
2334
  "row-data": l.value,
2332
2335
  "search-value": x.value,
2333
- loading: C.value || !a(o)._currentLocation,
2334
- key: (h = a(o)._currentLocation) == null ? void 0 : h.dbName,
2336
+ loading: C.value || !a(n)._currentLocation,
2337
+ key: (h = a(n)._currentLocation) == null ? void 0 : h.dbName,
2335
2338
  onRowClick: p[3] || (p[3] = (I) => a(S).showSkuHistory(I.original)),
2336
2339
  "page-size": N.value
2337
2340
  }, {
@@ -2343,15 +2346,15 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2343
2346
  default: T((G) => {
2344
2347
  var se, E, W, q, le, re, Z, ae, fe, me;
2345
2348
  return [
2346
- e("div", _s, [
2347
- e("div", ks, [
2348
- e("div", bs, [
2349
+ e("div", bs, [
2350
+ e("div", gs, [
2351
+ e("div", hs, [
2349
2352
  y(a(Je), {
2350
2353
  render: (W = (E = (se = G.code) == null ? void 0 : se.column) == null ? void 0 : E.columnDef) == null ? void 0 : W.cell,
2351
2354
  props: (le = (q = G.code) == null ? void 0 : q.getContext) == null ? void 0 : le.call(q)
2352
2355
  }, null, 8, ["render", "props"])
2353
2356
  ]),
2354
- e("div", gs, [
2357
+ e("div", xs, [
2355
2358
  y(a(Je), {
2356
2359
  render: (ae = (Z = (re = G.name) == null ? void 0 : re.column) == null ? void 0 : Z.columnDef) == null ? void 0 : ae.cell,
2357
2360
  props: (me = (fe = G.name) == null ? void 0 : fe.getContext) == null ? void 0 : me.call(fe)
@@ -2382,10 +2385,10 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2382
2385
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
2383
2386
  ], 2),
2384
2387
  ($(), z(ft, { to: "body" }, [
2385
- (c = a(S).stockHistoryProps) != null && c.sku ? ($(), z(fs, Te(He({ key: 0 }, a(S).stockHistoryProps)), null, 16)) : te("", !0),
2386
- (f = a(S).convertSkuDialogProps) != null && f.sku ? ($(), z(gn, Te(He({ key: 1 }, a(S).convertSkuDialogProps)), null, 16)) : te("", !0),
2387
- (M = a(S).adjustSkuDialogProps) != null && M.stock ? ($(), z(jn, Te(He({ key: 2 }, a(S).adjustSkuDialogProps)), null, 16)) : te("", !0),
2388
- X.value ? ($(), z(Yn, {
2388
+ (c = a(S).stockHistoryProps) != null && c.sku ? ($(), z(ys, Te(He({ key: 0 }, a(S).stockHistoryProps)), null, 16)) : te("", !0),
2389
+ (f = a(S).convertSkuDialogProps) != null && f.sku ? ($(), z(go, Te(He({ key: 1 }, a(S).convertSkuDialogProps)), null, 16)) : te("", !0),
2390
+ (M = a(S).adjustSkuDialogProps) != null && M.stock ? ($(), z(Bo, Te(He({ key: 2 }, a(S).adjustSkuDialogProps)), null, 16)) : te("", !0),
2391
+ X.value ? ($(), z(zo, {
2389
2392
  key: 3,
2390
2393
  show: X.value,
2391
2394
  "onUpdate:show": p[4] || (p[4] = (I) => X.value = I),
@@ -2400,5 +2403,5 @@ const _o = { class: "flex items-center w-full fm-typo-en-title-md-800" }, ko = {
2400
2403
  }
2401
2404
  });
2402
2405
  export {
2403
- zs as default
2406
+ Ks as default
2404
2407
  };