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

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