@feedmepos/mf-inventory-portal 1.5.8 → 1.5.9-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/{App-CkuUHPEo.js → App-CRKhmCwm.js} +4 -4
  2. package/dist/{ApprovalView-DubepVw0.js → ApprovalView-BdvNZ3Mi.js} +7 -7
  3. package/dist/{BindingsDialog-B4WNBwyC.js → BindingsDialog-UieCgCDS.js} +13 -13
  4. package/dist/{BindingsPicker-BRrLqG1M.js → BindingsPicker-Bo7xvsut.js} +2 -2
  5. package/dist/{BindingsTable-CsL2_ZUy.js → BindingsTable-CUaQzSBn.js} +3 -3
  6. package/dist/ClosingDraftView-QgRaat2h.js +3335 -0
  7. package/dist/{ClosingHistoryView-C9Hidhix.js → ClosingHistoryView-C_qw6v7h.js} +469 -459
  8. package/dist/{ClosingTemplateView-gzJmYQLL.js → ClosingTemplateView-BAsHjB3H.js} +14 -14
  9. package/dist/{DefaultView-Wd26nwBn.js → DefaultView-CaWfkTXn.js} +2 -2
  10. package/dist/{DeliveryOrderPrintPreview-5Jm6QgAP.js → DeliveryOrderPrintPreview-Dv2fXveZ.js} +2 -2
  11. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bye4GWOd.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BFzPTyKA.js} +2 -2
  12. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D0u8X0Bk.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Y_AhN6qb.js} +2 -2
  13. package/dist/{FmMultiselectDialog-BuXhazyF.js → FmMultiselectDialog-DT28lMdK.js} +1 -1
  14. package/dist/{FmMultiselectDialog-CrbCQvck.js → FmMultiselectDialog-e4dbq-bB.js} +2 -2
  15. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-U0Io6FhR.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CO2Uom0f.js} +111 -110
  16. package/dist/{ImportView-PBP1w1_z.js → ImportView-Brvxm1EN.js} +6 -6
  17. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BvlBuk3S.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DSqbdU3A.js} +1 -1
  18. package/dist/{IngredientGroupView-ZavZf2r_.js → IngredientGroupView-CqqD1_5X.js} +5 -5
  19. package/dist/{IngredientsView-DXKIqdoR.js → IngredientsView-BmOSo8oo.js} +17 -17
  20. package/dist/{IntegrationExplorerView-D-7q6p_s.js → IntegrationExplorerView-CZH3568k.js} +5 -5
  21. package/dist/{IntegrationView-ByvhMaCO.js → IntegrationView-CJv9Ps4v.js} +13 -13
  22. package/dist/{InventoryBindingForm-DAAeny2A.js → InventoryBindingForm-BZVAC4x1.js} +1 -1
  23. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DpR5ySFv.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BPl9weMj.js} +5 -5
  24. package/dist/{InventoryBindingSummary-CZBnbomV.js → InventoryBindingSummary-C7Xl5Fd7.js} +1 -1
  25. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BJ6gswNM.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CyjRq3A-.js} +1 -1
  26. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-mlVRfnxo.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DIoYx-x4.js} +1 -1
  27. package/dist/{PublishView-CsMKko5l.js → PublishView-DHK3MPsP.js} +3 -3
  28. package/dist/{PurchaseOrderPrintPreview-B-jchSYL.js → PurchaseOrderPrintPreview-DLg01buw.js} +2 -2
  29. package/dist/{ReceiveRequestView-DfOcn_OW.js → ReceiveRequestView-B1n42VJ5.js} +25 -25
  30. package/dist/{RecipeView-C-1PuiaO.js → RecipeView-BOEfiTuN.js} +19 -19
  31. package/dist/{SettingsView-C3vB5Vjb.js → SettingsView-Bqx3woVD.js} +4 -4
  32. package/dist/{StockView-BAXULvMh.js → StockView-UjWpz_eL.js} +775 -765
  33. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BI_hHa88.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BxyFAK_X.js} +1 -1
  34. package/dist/{SupplierView-B9y9d6C0.js → SupplierView-_zK2xohX.js} +12 -12
  35. package/dist/{SurchargeView-D3lq3G0g.js → SurchargeView-BtUebfil.js} +6 -6
  36. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-D54FjCtg.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DF3seGmT.js} +2 -2
  37. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bi-9US2G.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bpo1u5g2.js} +1 -1
  38. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BkmO63qQ.js → TransferDetails.vue_vue_type_script_setup_true_lang-B_kdNBCT.js} +20 -20
  39. package/dist/{TransferTemplateView-B7hDis-b.js → TransferTemplateView-OlHTVdCG.js} +18 -18
  40. package/dist/{UnitCostHistoryView-DR-RJ6lO.js → UnitCostHistoryView-BIvYaMio.js} +4 -4
  41. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-WSYbNJL_.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DqTis1lE.js} +4 -4
  42. package/dist/{UnitView-Dx3NUFp2.js → UnitView-DAtDiu3f.js} +9 -9
  43. package/dist/{WarehouseView-CSmq2xhS.js → WarehouseView-B3mXQpoO.js} +5 -5
  44. package/dist/{WastageTemplateView-Bya8Ptja.js → WastageTemplateView-BOoybeCb.js} +14 -14
  45. package/dist/api/error.d.ts +6 -3
  46. package/dist/{app-BtIUZZer.js → app-cwueji6m.js} +10353 -10377
  47. package/dist/app.d.ts +8 -0
  48. package/dist/app.js +4 -4
  49. package/dist/{closing-template-CY4I4oi6.js → closing-template-CobmAqhD.js} +1 -1
  50. package/dist/{date2-BXHREmqe.js → date2-D_-j6u1x.js} +1 -1
  51. package/dist/{dayjs.min-B15_mmz6.js → dayjs.min-iDeAwg0n.js} +1 -1
  52. package/dist/{decimal-CfCuBc7o.js → decimal-DcHr_uvI.js} +2 -2
  53. package/dist/{defineDeepModel-CeW3ETAv.js → defineDeepModel-BhC1n6G-.js} +1 -1
  54. package/dist/{duplicate-template-CTHciPHW.js → duplicate-template-Y9iggS9l.js} +1 -1
  55. package/dist/{export-CCbJ-2Gk.js → export-CAHG4EbP.js} +2 -2
  56. package/dist/{feature-RoG35971.js → feature-BhK4XmmS.js} +86 -86
  57. package/dist/{format-time-from-id-q1T46zz9.js → format-time-from-id-2IFiQNTX.js} +1 -1
  58. package/dist/{format-unit-display-DUaKGmsk.js → format-unit-display-CTYZvXcZ.js} +11 -11
  59. package/dist/helper/uom-rules.d.ts +12 -0
  60. package/dist/{import-export.helper-B2ZzXsyT.js → import-export.helper-DtWH9atw.js} +6 -6
  61. package/dist/{index-CKErlM6H.js → index-Ckhb0CMq.js} +1 -1
  62. package/dist/{index-CF466Sy_.js → index-dfAAA8HA.js} +3 -3
  63. package/dist/{index-BC06YbP9.js → index-iGt85nBk.js} +1 -1
  64. package/dist/{inventory-core-dart.default-BEB7pV9M.js → inventory-core-dart.default-R1tOn2RS.js} +1319 -1264
  65. package/dist/{lz-string-D3Jm7T7Q.js → lz-string-DUT6tVSg.js} +1 -1
  66. package/dist/{menu-usage-module-BiCPifRX.js → menu-usage-module-D7cxkbEk.js} +11 -12
  67. package/dist/netsuite-BiF6Fo7G.js +9381 -0
  68. package/dist/{number-C6mI12qg.js → number-Cqsx9s88.js} +3 -3
  69. package/dist/{predefined-templates-DfpzUsNl.js → predefined-templates-CHExzSjx.js} +1 -1
  70. package/dist/{purchase-order-template-Dq3N4vgB.js → purchase-order-template-_FfLY2u1.js} +1 -1
  71. package/dist/{recalculationUtils-D0A7mbSs.js → recalculationUtils-KdVSBljW.js} +1 -1
  72. package/dist/{rules-Dajxj04v.js → rules-DB26S6qs.js} +2 -2
  73. package/dist/{stock-D6d8tS4B.js → stock-n6h8HkNk.js} +1 -1
  74. package/dist/{supplier-CkfePT6a.js → supplier-6K9Cbfcf.js} +2 -2
  75. package/dist/{surcharge-C3uSQoRw.js → surcharge-BV03ItuR.js} +1 -1
  76. package/dist/tsconfig.app.tsbuildinfo +1 -1
  77. package/dist/uom-rules-CzTxRiqL.js +21 -0
  78. package/dist/{use-ingredient-select-dialog-C3zCgi5E.js → use-ingredient-select-dialog-Bs_4jjVy.js} +2 -2
  79. package/dist/{use-inventory-binding-dialog-CsDrU6sx.js → use-inventory-binding-dialog-CgtoqJ2D.js} +2 -2
  80. package/dist/{use-template-enabled-locations-DpZY_R7j.js → use-template-enabled-locations-C6fQtFF0.js} +2 -2
  81. package/dist/{use-transfer-locations-DlHF5kG-.js → use-transfer-locations-DI48leYd.js} +2 -2
  82. package/dist/{useHrmPermission-C1G3BVpn.js → useHrmPermission-Co1Jgyvq.js} +1 -1
  83. package/dist/{useNavigationMenu-tNJYWFkU.js → useNavigationMenu-JenXwvSv.js} +2 -2
  84. package/dist/{useSseClient-4qu-xO3k.js → useSseClient-gIA58rTS.js} +3 -3
  85. package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +11 -2
  86. package/dist/{vue-i18n-eqPSat_0.js → vue-i18n-C3I0upD3.js} +331 -331
  87. package/dist/{xlsx-DB2JHegF.js → xlsx-4BYDayT5.js} +1 -1
  88. package/dist/{xlsx.util-TwDCO4ay.js → xlsx.util-CD_xD6ZX.js} +3 -3
  89. package/package.json +1 -1
  90. package/dist/ClosingDraftView-Psl49bhd.js +0 -3202
  91. package/dist/lodash-D9rnJgGZ.js +0 -3678
  92. package/dist/netsuite-CuPJ_UTs.js +0 -5708
@@ -1,34 +1,34 @@
1
- import { defineComponent as ve, openBlock as V, createBlock as ne, withCtx as M, createElementVNode as e, toDisplayString as v, unref as s, ref as Y, h as be, computed as T, watch as Fe, resolveComponent as B, isRef as Ee, createVNode as _, createElementBlock as q, Fragment as ue, renderList as fe, createCommentVNode as se, normalizeClass as He, reactive as _t, mergeModels as nt, useModel as jt, onMounted as qe, createTextVNode as ye, normalizeStyle as kt, watchEffect as Vt, renderSlot as st, onUnmounted as Ct, Teleport as Dt, normalizeProps as at, mergeProps as ze } from "vue";
1
+ import { defineComponent as ve, openBlock as V, createBlock as ne, withCtx as M, createElementVNode as e, toDisplayString as p, unref as s, ref as Y, h as be, computed as T, watch as Fe, resolveComponent as B, isRef as Pe, createVNode as _, createElementBlock as q, Fragment as ue, renderList as fe, createCommentVNode as se, normalizeClass as He, reactive as _t, mergeModels as nt, useModel as jt, onMounted as qe, createTextVNode as ye, normalizeStyle as kt, watchEffect as Vt, renderSlot as st, onUnmounted as Ct, Teleport as Dt, normalizeProps as at, mergeProps as ze } from "vue";
2
2
  import { u as Bt, _ as Mt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js";
3
- import { u as Se, c as Re, a as Ne, F as lt, t as It, D as ie, s as Ht, m as Tt, B as Pt, w as oe, f as Ce, h as rt, d as it, J as ge, K as De } from "./app-BtIUZZer.js";
4
- import { u as Oe, a as Ut } from "./useSseClient-4qu-xO3k.js";
5
- import { c as Et } from "./component-kqxARxvM.js";
6
- import { _ as ht, o as Rt } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-WSYbNJL_.js";
7
- import { _ as Ke, S as Ge, g as bt, a as Nt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BI_hHa88.js";
3
+ import { u as Se, c as Re, a as Ne, F as rt, t as It, D as ie, s as Ht, m as Tt, B as Et, w as oe, f as Ce, h as lt, d as it, J as ge, K as De } from "./app-cwueji6m.js";
4
+ import { u as Oe, a as Ut } from "./useSseClient-gIA58rTS.js";
5
+ import { c as Pt } from "./component-kqxARxvM.js";
6
+ import { _ as ht, o as Rt } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-DqTis1lE.js";
7
+ import { _ as Ke, S as Ge, g as bt, a as Nt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BxyFAK_X.js";
8
8
  import { _ as Ot } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
9
9
  import { useI18n as pe, useCoreStore as Xe } from "@feedmepos/mf-common";
10
- import { u as gt, i as Te, _ as ut } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-mlVRfnxo.js";
10
+ import { u as gt, i as Te, _ as ut } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DIoYx-x4.js";
11
11
  import { useSnackbar as we, useDialog as Le, useProxiedModel as Ye, useBreakpoints as Lt } from "@feedmepos/ui-library";
12
12
  import { defineStore as Yt } from "pinia";
13
13
  import { F as Je } from "./FmAdminBadge-DjnBAgyv.js";
14
- import { g as $e, a as he, e as zt, t as Pe, c as xe, f as Gt, h as ct, i as xt, j as Qe, d as Me, k as Wt } from "./number-C6mI12qg.js";
15
- import { u as Ae } from "./stock-D6d8tS4B.js";
16
- import { c as Ue, A as Kt, M as qt, R as Xt } from "./rules-Dajxj04v.js";
17
- import { u as Jt } from "./use-inventory-binding-dialog-CsDrU6sx.js";
18
- import { a as St } from "./FmMultiselectDialog-CrbCQvck.js";
19
- import { d as ke } from "./dayjs.min-B15_mmz6.js";
20
- import { _ as Qt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BJ6gswNM.js";
21
- import { g as Zt } from "./decimal-CfCuBc7o.js";
22
- import { a as eo, c as to, f as wt, t as dt, d as mt, p as oo, n as no, b as so } from "./date2-BXHREmqe.js";
23
- import { i as ao, _ as lo } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D0u8X0Bk.js";
24
- import { _ as ro } from "./empty-placeholder-B0QU467o.js";
25
- import { F as _e } from "./inventory-core-dart.default-BEB7pV9M.js";
26
- import { u as io } from "./feature-RoG35971.js";
27
- import { u as At } from "./useHrmPermission-C1G3BVpn.js";
14
+ import { g as $e, a as he, e as zt, t as Ee, c as xe, f as Gt, h as ct, i as xt, j as Qe, d as Me, k as Wt } from "./number-Cqsx9s88.js";
15
+ import { u as Ae } from "./stock-n6h8HkNk.js";
16
+ import { c as Ue, A as Kt, M as qt, R as Xt } from "./rules-DB26S6qs.js";
17
+ import { u as Jt } from "./use-inventory-binding-dialog-CgtoqJ2D.js";
18
+ import { a as St } from "./FmMultiselectDialog-e4dbq-bB.js";
19
+ import { d as ke } from "./dayjs.min-iDeAwg0n.js";
20
+ import { _ as Qt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CyjRq3A-.js";
21
+ import { g as Zt } from "./decimal-DcHr_uvI.js";
22
+ import { a as eo, c as to, f as wt, t as dt, d as mt, p as oo, n as no, b as so } from "./date2-D_-j6u1x.js";
23
+ import { i as ao, _ as ro } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Y_AhN6qb.js";
24
+ import { _ as lo } from "./empty-placeholder-B0QU467o.js";
25
+ import { F as _e } from "./inventory-core-dart.default-R1tOn2RS.js";
26
+ import { u as io } from "./feature-BhK4XmmS.js";
27
+ import { u as At } from "./useHrmPermission-Co1Jgyvq.js";
28
28
  import { _ as uo, F as ft } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
29
- import { u as co } from "./netsuite-CuPJ_UTs.js";
29
+ import { u as co } from "./netsuite-BiF6Fo7G.js";
30
30
  import { P as mo, J as fo } from "./app-DiX-EfV6.js";
31
- var Ie = /* @__PURE__ */ ((w) => (w.History = "History", w.Convert = "Convert", w.Adjust = "Adjust", w))(Ie || {});
31
+ var Ie = /* @__PURE__ */ ((A) => (A.History = "History", A.Convert = "Convert", A.Adjust = "Adjust", A))(Ie || {});
32
32
  const vo = [
33
33
  {
34
34
  translationKey: "inventory.stock.action.history",
@@ -57,74 +57,74 @@ const vo = [
57
57
  }
58
58
  ], yo = { class: "whitespace-nowrap" }, _o = /* @__PURE__ */ ve({
59
59
  __name: "StockHeaderPreview",
60
- setup(w) {
61
- const { t: m } = pe();
62
- return (k, p) => (V(), ne(Ot, null, {
60
+ setup(A) {
61
+ const { t: u } = pe();
62
+ return (k, y) => (V(), ne(Ot, null, {
63
63
  default: M(() => [
64
- e("div", yo, v(s(m)("inventory.stock.prediction.daysRemaining")), 1)
64
+ e("div", yo, p(s(u)("inventory.stock.prediction.daysRemaining")), 1)
65
65
  ]),
66
66
  _: 1
67
67
  }));
68
68
  }
69
69
  }), Ft = Yt("stockActions", () => {
70
- const w = Y(!1), m = Se(), k = Oe(), p = gt(), x = we(), j = Le(), { t: u } = pe();
71
- async function l() {
72
- if (m._currentLocation) {
73
- w.value = !0;
70
+ const A = Y(!1), u = Se(), k = Oe(), y = gt(), S = we(), j = Le(), { t: d } = pe();
71
+ async function r() {
72
+ if (u._currentLocation) {
73
+ A.value = !0;
74
74
  try {
75
- await k.readStockBalance(), await k.readProductBalance(), await p.readStockEstimateBalance();
75
+ await k.readStockBalance(), await k.readProductBalance(), await y.readStockEstimateBalance();
76
76
  } catch {
77
- x.open({
78
- title: u("inventory.stock.error.title"),
79
- message: u("inventory.stock.error.message"),
77
+ S.open({
78
+ title: d("inventory.stock.error.title"),
79
+ message: d("inventory.stock.error.message"),
80
80
  type: "error"
81
81
  });
82
82
  } finally {
83
- w.value = !1;
83
+ A.value = !1;
84
84
  }
85
85
  }
86
86
  }
87
87
  const b = Y();
88
- async function R(S) {
89
- var $, P, N;
90
- if (!!!((P = ($ = S.convert) == null ? void 0 : $.inventoryBindings) != null && P.length)) {
88
+ async function R(w) {
89
+ var $, E, N;
90
+ if (!!!((E = ($ = w.convert) == null ? void 0 : $.inventoryBindings) != null && E.length)) {
91
91
  j.open({
92
- title: u("inventory.stock.error.convert.title"),
93
- message: u("inventory.stock.error.convert.message")
92
+ title: d("inventory.stock.error.convert.title"),
93
+ message: d("inventory.stock.error.convert.message")
94
94
  });
95
95
  return;
96
96
  }
97
97
  const n = {
98
- maxCount: ((N = k.productBalance.find(({ id: O }) => O === S._id)) == null ? void 0 : N.count) || 0,
99
- sku: S,
98
+ maxCount: ((N = k.productBalance.find(({ id: O }) => O === w._id)) == null ? void 0 : N.count) || 0,
99
+ sku: w,
100
100
  show: !0,
101
101
  "onUpdate:show"(O) {
102
102
  b.value.show = O;
103
103
  },
104
104
  onSubmitted() {
105
- l();
105
+ r();
106
106
  }
107
107
  };
108
108
  b.value = n;
109
109
  }
110
110
  const C = Y();
111
- async function r(S) {
111
+ async function l(w) {
112
112
  const o = {
113
- stock: S,
113
+ stock: w,
114
114
  show: !0,
115
115
  "onUpdate:show"(t) {
116
116
  C.value.show = t;
117
117
  },
118
118
  onSubmitted() {
119
- l();
119
+ r();
120
120
  }
121
121
  };
122
122
  C.value = o;
123
123
  }
124
124
  const a = Y();
125
- async function D(S) {
125
+ async function D(w) {
126
126
  const o = {
127
- sku: S,
127
+ sku: w,
128
128
  show: !0,
129
129
  "onUpdate:show"(t) {
130
130
  a.value.show = t;
@@ -132,9 +132,9 @@ const vo = [
132
132
  };
133
133
  a.value = o;
134
134
  }
135
- function c(S, o) {
135
+ function m(w, o) {
136
136
  const t = Re(o);
137
- switch (S) {
137
+ switch (w) {
138
138
  case Ie.History:
139
139
  D(t);
140
140
  return;
@@ -142,13 +142,13 @@ const vo = [
142
142
  R(t);
143
143
  return;
144
144
  case Ie.Adjust:
145
- r(t);
145
+ l(t);
146
146
  return;
147
147
  }
148
148
  }
149
149
  return {
150
- fetchStockBalance: l,
151
- onActionMenu: c,
150
+ fetchStockBalance: r,
151
+ onActionMenu: m,
152
152
  stockHistoryProps: a,
153
153
  showSkuHistory: D,
154
154
  convertSkuDialogProps: b,
@@ -157,30 +157,30 @@ const vo = [
157
157
  });
158
158
  function ko() {
159
159
  var j;
160
- const w = Se(), m = Ft(), k = Xe(), { t: p } = pe();
160
+ const A = Se(), u = Ft(), k = Xe(), { t: y } = pe();
161
161
  return {
162
162
  columnDefs: [
163
163
  {
164
164
  accessorKey: "code",
165
- header: () => p("inventory.stock.code"),
165
+ header: () => y("inventory.stock.code"),
166
166
  enableSorting: !0,
167
167
  size: 300
168
168
  },
169
169
  {
170
170
  accessorKey: "name",
171
- header: () => p("inventory.stock.product"),
171
+ header: () => y("inventory.stock.product"),
172
172
  enableSorting: !0,
173
173
  size: "auto"
174
174
  },
175
175
  {
176
176
  id: "UOM",
177
- header: () => p("inventory.stock.balance"),
178
- cell(u) {
179
- const l = u.row.original, b = {
180
- unit: l.unit,
181
- sku: l,
182
- amount: l.balance,
183
- defaultTrackingMeasurement: l.trackingMeasurement ?? void 0
177
+ header: () => y("inventory.stock.balance"),
178
+ cell(d) {
179
+ const r = d.row.original, b = {
180
+ unit: r.unit,
181
+ sku: r,
182
+ amount: r.balance,
183
+ defaultTrackingMeasurement: r.trackingMeasurement ?? void 0
184
184
  };
185
185
  return be(ht, b);
186
186
  },
@@ -189,18 +189,18 @@ function ko() {
189
189
  ...(j = k.sessionUser.value) != null && j.role.isAdmin ? [
190
190
  {
191
191
  accessorKey: "isInactive",
192
- header: () => be(Je, {}, () => `${p("inventory.ingredient.status.title")}`),
193
- cell(u) {
194
- const l = u.row.original.isInactive;
192
+ header: () => be(Je, {}, () => `${y("inventory.ingredient.status.title")}`),
193
+ cell(d) {
194
+ const r = d.row.original.isInactive;
195
195
  return be(
196
196
  "span",
197
197
  {
198
198
  class: [
199
199
  "inline-block px-3 py-1 rounded-full text-xs font-semibold",
200
- l ? "bg-red-100 text-red-700" : "bg-green-100 text-green-700"
200
+ r ? "bg-red-100 text-red-700" : "bg-green-100 text-green-700"
201
201
  ].join(" ")
202
202
  },
203
- p(l ? "inventory.ingredient.status.inactive" : "inventory.ingredient.status.active")
203
+ y(r ? "inventory.ingredient.status.inactive" : "inventory.ingredient.status.active")
204
204
  );
205
205
  },
206
206
  enableSorting: !0
@@ -212,29 +212,29 @@ function ko() {
212
212
  header: () => be(_o),
213
213
  enableSorting: !0,
214
214
  sortUndefined: "last",
215
- cell(u) {
216
- var D, c;
217
- const l = u.row.original.day, b = u.row.original.operator, R = (D = u.row.original.thresholds) == null ? void 0 : D.low, C = (c = u.row.original.thresholds) == null ? void 0 : c.mid;
218
- if (typeof l != "number" || typeof R != "number" || typeof C != "number")
215
+ cell(d) {
216
+ var D, m;
217
+ const r = d.row.original.day, b = d.row.original.operator, R = (D = d.row.original.thresholds) == null ? void 0 : D.low, C = (m = d.row.original.thresholds) == null ? void 0 : m.mid;
218
+ if (typeof r != "number" || typeof R != "number" || typeof C != "number")
219
219
  return be(Ke, {
220
- days: l,
220
+ days: r,
221
221
  operator: b
222
222
  });
223
- const r = l <= R ? Ge.low : l <= C ? Ge.mid : Ge.high;
223
+ const l = r <= R ? Ge.low : r <= C ? Ge.mid : Ge.high;
224
224
  return be(Ke, {
225
- days: l,
226
- level: r
225
+ days: r,
226
+ level: l
227
227
  });
228
228
  },
229
229
  size: 200
230
230
  },
231
231
  {
232
232
  id: "action",
233
- cell(u) {
234
- var l;
235
- return Et(
236
- ((l = w._currentLocation) == null ? void 0 : l.type) === "restaurant" ? vo : po,
237
- (b) => m.onActionMenu(b, u.row.original)
233
+ cell(d) {
234
+ var r;
235
+ return Pt(
236
+ ((r = A._currentLocation) == null ? void 0 : r.type) === "restaurant" ? vo : po,
237
+ (b) => u.onActionMenu(b, d.row.original)
238
238
  );
239
239
  },
240
240
  enableSorting: !1,
@@ -250,39 +250,39 @@ function ko() {
250
250
  const ho = {
251
251
  context: null,
252
252
  error: null,
253
- isRequired(w = "This field is required") {
254
- return `${this.context ?? ""}`.length === 0 && (this.error = w), this;
253
+ isRequired(A = "This field is required") {
254
+ return `${this.context ?? ""}`.length === 0 && (this.error = A), this;
255
255
  },
256
- isString(w = "Must be a valid string") {
257
- return this.error ? this : (typeof this.context != "string" && (this.error ?? (this.error = w)), this);
256
+ isString(A = "Must be a valid string") {
257
+ return this.error ? this : (typeof this.context != "string" && (this.error ?? (this.error = A)), this);
258
258
  },
259
259
  toInt() {
260
260
  return this.error ? this : (this.context = +this.context, this);
261
261
  },
262
- isInteger(w = "Must be an integer") {
263
- return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error = w), this);
262
+ isInteger(A = "Must be an integer") {
263
+ return this.error ? this : (this.toInt(), isNaN(this.context) && (this.error = A), this);
264
264
  },
265
- min(w, m) {
265
+ min(A, u) {
266
266
  if (this.error) return this;
267
267
  try {
268
- typeof this.context == "number" ? +this.context < w && (this.error = m ?? `Must be at least ${w}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < w && (this.error = m ?? `Must be at least ${w}`) : this.error = "Length cannot be determined";
268
+ typeof this.context == "number" ? +this.context < A && (this.error = u ?? `Must be at least ${A}`) : Object.prototype.hasOwnProperty.call(this.context, "length") ? +this.context.length < A && (this.error = u ?? `Must be at least ${A}`) : this.error = "Length cannot be determined";
269
269
  } catch {
270
270
  this.error = "Length cannot be determined";
271
271
  }
272
272
  return this;
273
273
  },
274
- max(w, m) {
274
+ max(A, u) {
275
275
  if (this.error) return this;
276
276
  try {
277
- typeof this.context == "number" ? +this.context > w && (this.error = m ?? `Must be at most ${w}`) : "length" in this.context ? +this.context.length > w && (this.error = m ?? `Must be at most ${w}`) : this.error = "Length cannot be determined";
277
+ typeof this.context == "number" ? +this.context > A && (this.error = u ?? `Must be at most ${A}`) : "length" in this.context ? +this.context.length > A && (this.error = u ?? `Must be at most ${A}`) : this.error = "Length cannot be determined";
278
278
  } catch {
279
279
  this.error = "Length cannot be determined";
280
280
  }
281
281
  return this;
282
282
  }
283
283
  };
284
- function vt(w) {
285
- return { ...ho, context: w };
284
+ function vt(A) {
285
+ return { ...ho, context: A };
286
286
  }
287
287
  const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-800" }, xo = { class: "flex flex-col gap-24 w-full" }, So = { class: "flex flex-col gap-8" }, wo = { class: "fm-typo-en-body-lg-600" }, Ao = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary flex-grow" }, Fo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-error" }, $o = { class: "flex flex-col p-16 gap-8" }, jo = { class: "flex flex-col gap-4" }, Vo = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border-b py-12 px-16" }, Co = { class: "grid grid-cols-[auto_100px_100px_48px] xs:grid-cols-[auto_80px_120px_48px] gap-8 px-8 items-center" }, Do = { class: "xs:col-span-3" }, Bo = { class: "flex gap-8" }, Mo = /* @__PURE__ */ ve({
288
288
  __name: "ConvertSkuDialog",
@@ -292,100 +292,100 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
292
292
  show: { type: Boolean }
293
293
  },
294
294
  emits: ["update:show", "submitted"],
295
- setup(w, { expose: m, emit: k }) {
296
- const p = w, x = k, j = Jt(), u = Ne(), l = Ae(), b = we(), { t: R } = pe(), C = Y(0), r = Y(null), a = T(() => u.skus), D = T(
295
+ setup(A, { expose: u, emit: k }) {
296
+ const y = A, S = k, j = Jt(), d = Ne(), r = Ae(), b = we(), { t: R } = pe(), C = Y(0), l = Y(null), a = T(() => d.skus), D = T(
297
297
  () => {
298
- var g, A;
299
- return (((A = (g = p.sku) == null ? void 0 : g.convert) == null ? void 0 : A.inventoryBindings) ?? []).filter(
300
- (G) => G.type === lt.enum.SKU
298
+ var g, F;
299
+ return (((F = (g = y.sku) == null ? void 0 : g.convert) == null ? void 0 : F.inventoryBindings) ?? []).filter(
300
+ (G) => G.type === rt.enum.SKU
301
301
  );
302
302
  }
303
- ), c = T({
303
+ ), m = T({
304
304
  get() {
305
- return !!r.value;
305
+ return !!l.value;
306
306
  },
307
307
  set(g) {
308
- g ? r.value = Re(D.value) : (r.value = null, C.value = Math.min(C.value, p.maxCount ?? 0));
308
+ g ? l.value = Re(D.value) : (l.value = null, C.value = Math.min(C.value, y.maxCount ?? 0));
309
309
  }
310
- }), S = Y(!1);
311
- Fe([() => p.show], ([g]) => {
310
+ }), w = Y(!1);
311
+ Fe([() => y.show], ([g]) => {
312
312
  g && (C.value = 0);
313
313
  });
314
314
  function o() {
315
- L(p.sku, Pe(C.value), r.value);
315
+ L(y.sku, Ee(C.value), l.value);
316
316
  }
317
317
  function t(g) {
318
- if (r.value)
318
+ if (l.value)
319
319
  return !0;
320
- const A = vt(g).isInteger().max(p.maxCount ?? 0).error ?? "";
321
- return A || !0;
320
+ const F = vt(g).isInteger().max(y.maxCount ?? 0).error ?? "";
321
+ return F || !0;
322
322
  }
323
323
  function n(g) {
324
324
  var I;
325
- const A = (I = p.sku.convert) != null && I.measurement ? p.sku.unit.measurements.find((i) => {
325
+ const F = (I = y.sku.convert) != null && I.measurement ? y.sku.unit.measurements.find((c) => {
326
326
  var h;
327
- return i.id === ((h = p.sku.convert) == null ? void 0 : h.measurement);
328
- }) ?? null : null, G = $e(p.sku.unit, A), H = Gt(+g);
327
+ return c.id === ((h = y.sku.convert) == null ? void 0 : h.measurement);
328
+ }) ?? null : null, G = $e(y.sku.unit, F), H = Gt(+g);
329
329
  return vt(H).isInteger().max(G).error ? "Precision cannot be more than " + G : !0;
330
330
  }
331
331
  const $ = T(
332
332
  () => {
333
- var g, A;
334
- return (g = p.sku.convert) != null && g.measurement ? (A = p.sku.unit.measurements.find((G) => {
333
+ var g, F;
334
+ return (g = y.sku.convert) != null && g.measurement ? (F = y.sku.unit.measurements.find((G) => {
335
335
  var H;
336
- return G.id === ((H = p.sku.convert) == null ? void 0 : H.measurement);
337
- })) == null ? void 0 : A.abbrev : p.sku.unit.abbrev;
336
+ return G.id === ((H = y.sku.convert) == null ? void 0 : H.measurement);
337
+ })) == null ? void 0 : F.abbrev : y.sku.unit.abbrev;
338
338
  }
339
- ), P = T(() => {
339
+ ), E = T(() => {
340
340
  var H, J;
341
- const A = It({
342
- bindings: ((H = p.sku.convert) == null ? void 0 : H.inventoryBindings) ?? [],
343
- skus: u.skus,
344
- skuGroups: u.skuGroups,
345
- recipes: u.recipes
341
+ const F = It({
342
+ bindings: ((H = y.sku.convert) == null ? void 0 : H.inventoryBindings) ?? [],
343
+ skus: d.skus,
344
+ skuGroups: d.skuGroups,
345
+ recipes: d.recipes
346
346
  }).inventoryBindings.filter((I) => "success" in I && I.success).map((I) => I).map((I) => I.binding);
347
- return (J = r.value ?? A) == null ? void 0 : J.map((I) => {
347
+ return (J = l.value ?? F) == null ? void 0 : J.map((I) => {
348
348
  var ee, ae, Q, W, te;
349
- const i = u.skus.find((re) => re._id === I.id), h = ((ee = I.measurement) == null ? void 0 : ee.abbrev) ?? ((ae = i == null ? void 0 : i.unit) == null ? void 0 : ae.abbrev), y = (Q = p.sku.convert) != null && Q.measurement ? p.sku.unit.measurements.find((re) => {
349
+ const c = d.skus.find((le) => le._id === I.id), h = ((ee = I.measurement) == null ? void 0 : ee.abbrev) ?? ((ae = c == null ? void 0 : c.unit) == null ? void 0 : ae.abbrev), f = (Q = y.sku.convert) != null && Q.measurement ? y.sku.unit.measurements.find((le) => {
350
350
  var ce;
351
- return re.id === ((ce = p.sku.convert) == null ? void 0 : ce.measurement);
352
- }) ?? null : null, f = $e(p.sku.unit, y), d = n(`${C.value}`) === !0 ? he(
351
+ return le.id === ((ce = y.sku.convert) == null ? void 0 : ce.measurement);
352
+ }) ?? null : null, v = $e(y.sku.unit, f), i = n(`${C.value}`) === !0 ? he(
353
353
  zt(
354
354
  I.amount,
355
- Pe(+C.value, f)
355
+ Ee(+C.value, v)
356
356
  ),
357
357
  !1
358
- ) : "0", F = (te = (W = r.value) == null ? void 0 : W.find((re) => re.id === (i == null ? void 0 : i._id))) == null ? void 0 : te.amount, E = F ? he(F, !1) : null;
358
+ ) : "0", x = (te = (W = l.value) == null ? void 0 : W.find((le) => le.id === (c == null ? void 0 : c._id))) == null ? void 0 : te.amount, P = x ? he(x, !1) : null;
359
359
  return {
360
- sku: i,
361
- convertAmount: E ?? d,
360
+ sku: c,
361
+ convertAmount: P ?? i,
362
362
  abbrev: h
363
363
  };
364
364
  });
365
365
  }), N = Y();
366
- m({
366
+ u({
367
367
  validateInputs: () => {
368
- var g, A;
369
- (A = (g = N.value) == null ? void 0 : g.validateInputs) == null || A.call(g);
368
+ var g, F;
369
+ (F = (g = N.value) == null ? void 0 : g.validateInputs) == null || F.call(g);
370
370
  },
371
371
  resetInputsValidation: () => {
372
- var g, A;
373
- (A = (g = N.value) == null ? void 0 : g.resetInputsValidation) == null || A.call(g);
372
+ var g, F;
373
+ (F = (g = N.value) == null ? void 0 : g.resetInputsValidation) == null || F.call(g);
374
374
  },
375
375
  resetInputs: () => {
376
- var g, A;
377
- (A = (g = N.value) == null ? void 0 : g.resetInputs) == null || A.call(g);
376
+ var g, F;
377
+ (F = (g = N.value) == null ? void 0 : g.resetInputs) == null || F.call(g);
378
378
  }
379
379
  });
380
- const O = Ye(p, "show");
381
- async function L(g, A, G) {
382
- S.value = !0;
380
+ const O = Ye(y, "show");
381
+ async function L(g, F, G) {
382
+ w.value = !0;
383
383
  try {
384
- await l.convertSku({
384
+ await r.convertSku({
385
385
  conversions: [
386
386
  {
387
387
  doc: g,
388
- amount: A,
388
+ amount: F,
389
389
  overrides: G == null ? void 0 : G.map((H) => ({
390
390
  ...H,
391
391
  amount: {
@@ -396,77 +396,77 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
396
396
  }))
397
397
  }
398
398
  ]
399
- }), x("update:show", !1), x("submitted");
399
+ }), S("update:show", !1), S("submitted");
400
400
  } catch (H) {
401
401
  b.open({
402
402
  title: "Something went wrong",
403
403
  message: `Cannot convert ${g.name}. Please try again.`,
404
404
  type: "error"
405
- }), console.error("error at converting stock amount", g, A, H);
405
+ }), console.error("error at converting stock amount", g, F, H);
406
406
  } finally {
407
- S.value = !1;
407
+ w.value = !1;
408
408
  }
409
409
  }
410
- function X(g, A, G) {
411
- const H = +A;
410
+ function X(g, F, G) {
411
+ const H = +F;
412
412
  let J = G;
413
- A.length > 0 && isFinite(H) ? J = G.map((I) => (I.id !== g || (I.amount = xe(H)), I)) : J = G.map((I) => (I.id !== g || (I.amount = { amount: 0, precision: 0 }), I)), r.value = J;
413
+ F.length > 0 && isFinite(H) ? J = G.map((I) => (I.id !== g || (I.amount = xe(H)), I)) : J = G.map((I) => (I.id !== g || (I.amount = { amount: 0, precision: 0 }), I)), l.value = J;
414
414
  }
415
415
  function z(g) {
416
- const A = a.value.find((G) => G._id === g);
417
- return A ? bt(A.unit, !0) : [];
416
+ const F = a.value.find((G) => G._id === g);
417
+ return F ? bt(F.unit, !0) : [];
418
418
  }
419
- function K(g, A) {
420
- const G = z(g), H = G.find((J) => J.value === A) ?? G.find((J) => J.value === null);
419
+ function K(g, F) {
420
+ const G = z(g), H = G.find((J) => J.value === F) ?? G.find((J) => J.value === null);
421
421
  return H ? {
422
422
  ...H,
423
423
  label: H.abbrev
424
424
  } : null;
425
425
  }
426
- function U(g, A, G) {
426
+ function U(g, F, G) {
427
427
  let H;
428
- if (A === null)
428
+ if (F === null)
429
429
  H = G.map((J) => (J.id !== g || (J.measurement = null), J)) ?? [];
430
430
  else {
431
431
  const J = a.value.find((I) => I._id === g);
432
432
  H = G.map((I) => {
433
- var i, h;
434
- return I.id !== g || (I.measurement = (h = (i = J == null ? void 0 : J.unit) == null ? void 0 : i.measurements) == null ? void 0 : h.find((y) => y.id === A)), I;
433
+ var c, h;
434
+ return I.id !== g || (I.measurement = (h = (c = J == null ? void 0 : J.unit) == null ? void 0 : c.measurements) == null ? void 0 : h.find((f) => f.id === F)), I;
435
435
  }) ?? [];
436
436
  }
437
- r.value = H;
437
+ l.value = H;
438
438
  }
439
- function Z(g, A) {
440
- const G = A.filter((H) => H.id !== g);
441
- r.value = G;
439
+ function Z(g, F) {
440
+ const G = F.filter((H) => H.id !== g);
441
+ l.value = G;
442
442
  }
443
- function le() {
444
- const g = (r.value ?? []).map((A) => ({
445
- ...A,
446
- type: lt.enum.SKU
443
+ function re() {
444
+ const g = (l.value ?? []).map((F) => ({
445
+ ...F,
446
+ type: rt.enum.SKU
447
447
  }));
448
448
  j.promptIngredientsBinding(
449
449
  g,
450
- (A) => r.value = A,
451
- p.sku._id
450
+ (F) => l.value = F,
451
+ y.sku._id
452
452
  );
453
453
  }
454
454
  return Fe(
455
- () => p.show,
455
+ () => y.show,
456
456
  (g) => {
457
- g || (r.value = null, C.value = 0);
457
+ g || (l.value = null, C.value = 0);
458
458
  }
459
- ), (g, A) => {
460
- const G = B("FmTextField"), H = B("FmForm"), J = B("FmCard"), I = B("FmSwitch"), i = B("FmFormGroup"), h = B("FmSelect"), y = B("FmButton"), f = B("FmSideSheet");
461
- return V(), ne(f, {
459
+ ), (g, F) => {
460
+ const G = B("FmTextField"), H = B("FmForm"), J = B("FmCard"), I = B("FmSwitch"), c = B("FmFormGroup"), h = B("FmSelect"), f = B("FmButton"), v = B("FmSideSheet");
461
+ return V(), ne(v, {
462
462
  "dismiss-away": "",
463
463
  modelValue: s(O),
464
- "onUpdate:modelValue": A[3] || (A[3] = (d) => Ee(O) ? O.value = d : null),
464
+ "onUpdate:modelValue": F[3] || (F[3] = (i) => Pe(O) ? O.value = i : null),
465
465
  "max-width": 500
466
466
  }, {
467
467
  "side-sheet-header": M(() => [
468
468
  e("div", bo, [
469
- e("div", go, v(s(R)("inventory.stock.convert.title", { name: g.sku.name })), 1)
469
+ e("div", go, p(s(R)("inventory.stock.convert.title", { name: g.sku.name })), 1)
470
470
  ])
471
471
  ]),
472
472
  default: M(() => [
@@ -478,13 +478,13 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
478
478
  }, {
479
479
  default: M(() => [
480
480
  _(G, {
481
- disabled: S.value,
481
+ disabled: w.value,
482
482
  "model-value": C.value,
483
- "onUpdate:modelValue": A[0] || (A[0] = (d) => C.value = d),
483
+ "onUpdate:modelValue": F[0] || (F[0] = (i) => C.value = i),
484
484
  label: s(R)("inventory.stock.convert.amount"),
485
485
  rules: [t, n, s(Ue)(0)],
486
486
  "append-text": $.value,
487
- "helper-text": r.value ? void 0 : `Max ${g.maxCount} ${$.value}`
487
+ "helper-text": l.value ? void 0 : `Max ${g.maxCount} ${$.value}`
488
488
  }, null, 8, ["disabled", "model-value", "label", "rules", "append-text", "helper-text"])
489
489
  ]),
490
490
  _: 1
@@ -495,15 +495,15 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
495
495
  }, {
496
496
  default: M(() => [
497
497
  e("div", So, [
498
- e("div", wo, v(s(R)("inventory.stock.convert.deductionSummary")), 1),
499
- (V(!0), q(ue, null, fe(P.value, (d) => {
500
- var F, E;
498
+ e("div", wo, p(s(R)("inventory.stock.convert.deductionSummary")), 1),
499
+ (V(!0), q(ue, null, fe(E.value, (i) => {
500
+ var x, P;
501
501
  return V(), q("div", {
502
- key: (F = d.sku) == null ? void 0 : F._id,
502
+ key: (x = i.sku) == null ? void 0 : x._id,
503
503
  class: "flex items-center"
504
504
  }, [
505
- e("div", Ao, v((E = d.sku) == null ? void 0 : E.name), 1),
506
- e("div", Fo, " -" + v(d.convertAmount) + " " + v(d.abbrev), 1)
505
+ e("div", Ao, p((P = i.sku) == null ? void 0 : P.name), 1),
506
+ e("div", Fo, " -" + p(i.convertAmount) + " " + p(i.abbrev), 1)
507
507
  ]);
508
508
  }), 128))
509
509
  ])
@@ -515,61 +515,61 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
515
515
  e("div", $o, [
516
516
  _(I, {
517
517
  value: "",
518
- modelValue: c.value,
519
- "onUpdate:modelValue": A[1] || (A[1] = (d) => c.value = d),
518
+ modelValue: m.value,
519
+ "onUpdate:modelValue": F[1] || (F[1] = (i) => m.value = i),
520
520
  label: s(R)("inventory.stock.convert.overrideDeduction"),
521
521
  "label-placement": "right"
522
522
  }, null, 8, ["modelValue", "label"]),
523
- c.value ? (V(), q(ue, { key: 0 }, [
524
- _(i, {
525
- modelValue: r.value,
523
+ m.value ? (V(), q(ue, { key: 0 }, [
524
+ _(c, {
525
+ modelValue: l.value,
526
526
  rules: [s(Kt)(1, "Must have at least one ingredient binding")]
527
527
  }, null, 8, ["modelValue", "rules"]),
528
528
  e("div", jo, [
529
- e("div", Vo, v(s(R)("inventory.stock.convert.ingredients")), 1),
530
- (V(!0), q(ue, null, fe(r.value, (d) => (V(), ne(i, {
531
- key: d.id,
532
- disabled: S.value,
533
- modelValue: +s(he)(d.amount ?? { amount: 1, precision: 0 }),
529
+ e("div", Vo, p(s(R)("inventory.stock.convert.ingredients")), 1),
530
+ (V(!0), q(ue, null, fe(l.value, (i) => (V(), ne(c, {
531
+ key: i.id,
532
+ disabled: w.value,
533
+ modelValue: +s(he)(i.amount ?? { amount: 1, precision: 0 }),
534
534
  rules: [
535
535
  s(qt)(
536
- a.value.find((F) => F._id === d.id).unit,
537
- d.measurement
536
+ a.value.find((x) => x._id === i.id).unit,
537
+ i.measurement
538
538
  ),
539
539
  s(Ue)(0)
540
540
  ]
541
541
  }, {
542
- default: M(({ invalid: F }) => {
543
- var E, ee, ae;
542
+ default: M(({ invalid: x }) => {
543
+ var P, ee, ae;
544
544
  return [
545
545
  e("div", Co, [
546
- e("div", Do, v((E = a.value.find((Q) => Q._id === d.id)) == null ? void 0 : E.name), 1),
546
+ e("div", Do, p((P = a.value.find((Q) => Q._id === i.id)) == null ? void 0 : P.name), 1),
547
547
  _(G, {
548
548
  class: "xs:col-span-2",
549
- disabled: S.value,
549
+ disabled: w.value,
550
550
  modelValue: +s(he)(
551
- d.amount ?? { amount: 1, precision: 0 }
551
+ i.amount ?? { amount: 1, precision: 0 }
552
552
  ),
553
- "onUpdate:modelValue": (Q) => X(d.id, Q, r.value ?? []),
554
- invalid: F
553
+ "onUpdate:modelValue": (Q) => X(i.id, Q, l.value ?? []),
554
+ invalid: x
555
555
  }, null, 8, ["disabled", "modelValue", "onUpdate:modelValue", "invalid"]),
556
556
  _(h, {
557
- disabled: S.value,
557
+ disabled: w.value,
558
558
  class: "translate-y-[2px]",
559
- items: z(d.id),
560
- "model-value": (ae = K(d.id, (ee = d.measurement) == null ? void 0 : ee.id)) == null ? void 0 : ae.value,
561
- "onUpdate:modelValue": (Q) => U(d.id, Q, r.value ?? []),
562
- invalid: F
559
+ items: z(i.id),
560
+ "model-value": (ae = K(i.id, (ee = i.measurement) == null ? void 0 : ee.id)) == null ? void 0 : ae.value,
561
+ "onUpdate:modelValue": (Q) => U(i.id, Q, l.value ?? []),
562
+ invalid: x
563
563
  }, {
564
- "helper-text": M(() => A[4] || (A[4] = [])),
564
+ "helper-text": M(() => F[4] || (F[4] = [])),
565
565
  _: 2
566
566
  }, 1032, ["disabled", "items", "model-value", "onUpdate:modelValue", "invalid"]),
567
- _(y, {
568
- disabled: S.value,
567
+ _(f, {
568
+ disabled: w.value,
569
569
  type: "button",
570
570
  variant: "tertiary",
571
571
  icon: "delete",
572
- onClick: (Q) => Z(d.id, r.value ?? [])
572
+ onClick: (Q) => Z(i.id, l.value ?? [])
573
573
  }, null, 8, ["disabled", "onClick"])
574
574
  ])
575
575
  ];
@@ -578,11 +578,11 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
578
578
  }, 1032, ["disabled", "modelValue", "rules"]))), 128))
579
579
  ]),
580
580
  e("div", null, [
581
- _(y, {
581
+ _(f, {
582
582
  icon: "link",
583
583
  label: s(R)("inventory.stock.convert.linkIngredient"),
584
584
  variant: "plain",
585
- onClick: le
585
+ onClick: re
586
586
  }, null, 8, ["label"])
587
587
  ])
588
588
  ], 64)) : se("", !0)
@@ -594,12 +594,12 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
594
594
  ]),
595
595
  "side-sheet-footer": M(() => [
596
596
  e("div", Bo, [
597
- _(y, {
598
- loading: S.value,
597
+ _(f, {
598
+ loading: w.value,
599
599
  label: s(R)("inventory.stock.convert.convertButton"),
600
- onClick: A[2] || (A[2] = (d) => {
601
- var F, E;
602
- return (E = (F = N.value) == null ? void 0 : F.validateInputs) == null ? void 0 : E.call(F);
600
+ onClick: F[2] || (F[2] = (i) => {
601
+ var x, P;
602
+ return (P = (x = N.value) == null ? void 0 : x.validateInputs) == null ? void 0 : P.call(x);
603
603
  })
604
604
  }, null, 8, ["loading", "label"])
605
605
  ])
@@ -609,12 +609,12 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
609
609
  };
610
610
  }
611
611
  });
612
- function Be(w, m) {
613
- const k = Pe(w, m);
612
+ function Be(A, u) {
613
+ const k = Ee(A, u);
614
614
  return { ...k, amount: -k.amount };
615
615
  }
616
- function pt(w, m) {
617
- return Pe(Math.abs(w), m);
616
+ function pt(A, u) {
617
+ return Ee(Math.abs(A), u);
618
618
  }
619
619
  const We = {
620
620
  [ie.enum.DAMAGE]: {
@@ -641,7 +641,7 @@ const We = {
641
641
  label: "Purchase",
642
642
  toAdjustmentAmount: pt
643
643
  }
644
- }, Io = { class: "col-span-2 flex" }, Ho = { class: "flex-1" }, To = { class: "fm-typo-en-body-lg-600" }, Po = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Uo = { class: "col-span-2 flex flex-col gap-4" }, Eo = { class: "flex gap-4 text-fm-color-typo-primary fm-typo-en-body-lg-600" }, Ro = {
644
+ }, Io = { class: "col-span-2 flex" }, Ho = { class: "flex-1" }, To = { class: "fm-typo-en-body-lg-600" }, Eo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Uo = { class: "col-span-2 flex flex-col gap-4" }, Po = { class: "flex gap-4 text-fm-color-typo-primary fm-typo-en-body-lg-600" }, Ro = {
645
645
  key: 0,
646
646
  class: "fm-typo-en-body-md-400 text-fm-color-typo-warning"
647
647
  }, $t = /* @__PURE__ */ ve({
@@ -652,13 +652,13 @@ const We = {
652
652
  isBackdate: { type: Boolean }
653
653
  },
654
654
  emits: ["update:modelValue", "click:delete"],
655
- setup(w, { emit: m }) {
656
- const k = w, p = m, { t: x } = pe(), j = Oe(), u = T(
655
+ setup(A, { emit: u }) {
656
+ const k = A, y = u, { t: S } = pe(), j = Oe(), d = T(
657
657
  () => Object.keys(We).map((t) => ({
658
658
  label: Ht(t),
659
659
  value: t
660
660
  }))
661
- ), l = T(() => bt(k.modelValue.doc.unit, !0)), b = T({
661
+ ), r = T(() => bt(k.modelValue.doc.unit, !0)), b = T({
662
662
  get() {
663
663
  return k.modelValue.type ?? ie.enum.PURCHASE;
664
664
  },
@@ -671,7 +671,7 @@ const We = {
671
671
  n.amount = We[n.type].toAdjustmentAmount(
672
672
  +he($),
673
673
  $.precision
674
- ), p("update:modelValue", n);
674
+ ), y("update:modelValue", n);
675
675
  }
676
676
  }), R = T({
677
677
  get() {
@@ -685,7 +685,7 @@ const We = {
685
685
  n.amount = We[b.value].toAdjustmentAmount(
686
686
  t,
687
687
  $.precision
688
- ), p("update:modelValue", n);
688
+ ), y("update:modelValue", n);
689
689
  }
690
690
  }), C = T({
691
691
  get() {
@@ -693,13 +693,13 @@ const We = {
693
693
  return ((t = k.modelValue.measurement) == null ? void 0 : t.id) ?? null;
694
694
  },
695
695
  set(t) {
696
- var $, P;
696
+ var $, E;
697
697
  const n = {
698
698
  ...k.modelValue
699
699
  };
700
- n.measurement = ((P = ($ = k.modelValue.doc.unit) == null ? void 0 : $.measurements) == null ? void 0 : P.find((N) => N.id === t)) ?? null, p("update:modelValue", n);
700
+ n.measurement = ((E = ($ = k.modelValue.doc.unit) == null ? void 0 : $.measurements) == null ? void 0 : E.find((N) => N.id === t)) ?? null, y("update:modelValue", n);
701
701
  }
702
- }), r = T({
702
+ }), l = T({
703
703
  get() {
704
704
  return k.modelValue.remark ?? "";
705
705
  },
@@ -707,7 +707,7 @@ const We = {
707
707
  const n = {
708
708
  ...k.modelValue
709
709
  };
710
- n.remark = t, p("update:modelValue", n);
710
+ n.remark = t, y("update:modelValue", n);
711
711
  }
712
712
  }), a = T(() => {
713
713
  var n;
@@ -716,15 +716,15 @@ const We = {
716
716
  }), D = T(() => {
717
717
  const t = k.modelValue.amount, n = k.modelValue.measurement;
718
718
  return n ? xt(t, n.conversion) : t;
719
- }), c = T(
719
+ }), m = T(
720
720
  () => k.isBackdate ? a.value : Qe(a.value, D.value)
721
- ), S = T(
722
- () => Zt(c.value, k.modelValue.doc.unit)
721
+ ), w = T(
722
+ () => Zt(m.value, k.modelValue.doc.unit)
723
723
  ), o = T(
724
724
  () => !k.isBackdate && D.value.amount < 0
725
725
  );
726
726
  return (t, n) => {
727
- const $ = B("FmButton"), P = B("FmSelect"), N = B("FmTextarea"), O = B("FmCard");
727
+ const $ = B("FmButton"), E = B("FmSelect"), N = B("FmTextarea"), O = B("FmCard");
728
728
  return V(), ne(O, {
729
729
  variant: "outlined",
730
730
  class: "grid grid-cols-2 gap-8 p-16"
@@ -732,20 +732,20 @@ const We = {
732
732
  default: M(() => [
733
733
  e("div", Io, [
734
734
  e("div", Ho, [
735
- e("div", To, v(t.modelValue.doc.name), 1),
736
- e("div", Po, v(t.modelValue.doc.code), 1)
735
+ e("div", To, p(t.modelValue.doc.name), 1),
736
+ e("div", Eo, p(t.modelValue.doc.code), 1)
737
737
  ]),
738
738
  _($, {
739
739
  variant: "tertiary",
740
740
  "prepend-icon": "delete",
741
- onClick: n[0] || (n[0] = (L) => p("click:delete"))
741
+ onClick: n[0] || (n[0] = (L) => y("click:delete"))
742
742
  })
743
743
  ]),
744
- _(P, {
744
+ _(E, {
745
745
  disabled: t.disabled,
746
746
  class: "col-span-2",
747
747
  label: "Type",
748
- items: u.value,
748
+ items: d.value,
749
749
  modelValue: b.value,
750
750
  "onUpdate:modelValue": n[1] || (n[1] = (L) => b.value = L),
751
751
  rules: [s(Xt)()],
@@ -762,10 +762,10 @@ const We = {
762
762
  "onUpdate:modelValue": n[2] || (n[2] = (L) => R.value = L),
763
763
  rules: [s(Ue)(0)]
764
764
  }, null, 8, ["disabled", "step", "modelValue", "rules"]),
765
- _(P, {
765
+ _(E, {
766
766
  disabled: t.disabled,
767
767
  label: "Unit",
768
- items: l.value,
768
+ items: r.value,
769
769
  modelValue: C.value,
770
770
  "onUpdate:modelValue": n[3] || (n[3] = (L) => C.value = L)
771
771
  }, null, 8, ["disabled", "items", "modelValue"]),
@@ -773,16 +773,16 @@ const We = {
773
773
  class: "col-span-2",
774
774
  disabled: t.disabled,
775
775
  label: "Remark",
776
- modelValue: r.value,
777
- "onUpdate:modelValue": n[4] || (n[4] = (L) => r.value = L),
776
+ modelValue: l.value,
777
+ "onUpdate:modelValue": n[4] || (n[4] = (L) => l.value = L),
778
778
  "label-mark": "optional"
779
779
  }, null, 8, ["disabled", "modelValue"]),
780
780
  e("div", Uo, [
781
- e("div", Eo, v(s(x)("inventory.stock.stock_adjustment.stockAfter")), 1),
781
+ e("div", Po, p(s(S)("inventory.stock.stock_adjustment.stockAfter")), 1),
782
782
  e("div", {
783
783
  class: He(["fm-typo-en-body-lg-600", o.value ? "text-red-700" : "text-green-700"])
784
- }, v(S.value), 3),
785
- t.isBackdate ? (V(), q("div", Ro, v(s(x)("inventory.stock.stock_adjustment.backdatePreviewWarning")), 1)) : se("", !0)
784
+ }, p(w.value), 3),
785
+ t.isBackdate ? (V(), q("div", Ro, p(s(S)("inventory.stock.stock_adjustment.backdatePreviewWarning")), 1)) : se("", !0)
786
786
  ])
787
787
  ]),
788
788
  _: 1
@@ -796,13 +796,13 @@ const We = {
796
796
  show: { type: Boolean }
797
797
  },
798
798
  emits: ["update:show", "submitted"],
799
- setup(w, { expose: m, emit: k }) {
800
- const p = w, x = k, j = Ne(), u = Le(), l = Ae(), b = we(), R = Y(!1), { t: C } = pe();
801
- function r() {
802
- S(Re(c));
799
+ setup(A, { expose: u, emit: k }) {
800
+ const y = A, S = k, j = Ne(), d = Le(), r = Ae(), b = we(), R = Y(!1), { t: C } = pe();
801
+ function l() {
802
+ w(Re(m));
803
803
  }
804
804
  const a = Y();
805
- m({
805
+ u({
806
806
  validateInputs: () => {
807
807
  var n, $;
808
808
  ($ = (n = a.value) == null ? void 0 : n.validateInputs) == null || $.call(n);
@@ -816,45 +816,45 @@ const We = {
816
816
  ($ = (n = a.value) == null ? void 0 : n.resetInputs) == null || $.call(n);
817
817
  }
818
818
  });
819
- const D = Ye(p, "show"), c = _t({
819
+ const D = Ye(y, "show"), m = _t({
820
820
  remark: "",
821
821
  adjustments: [
822
822
  {
823
823
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
824
824
  type: ie.enum.PURCHASE,
825
- doc: p.stock,
825
+ doc: y.stock,
826
826
  measurement: null,
827
827
  remark: "",
828
828
  amount: xe(1)
829
829
  }
830
830
  ]
831
831
  });
832
- Fe([() => p.show], ([n]) => {
833
- n && (c.remark = "", c.adjustments = [
832
+ Fe([() => y.show], ([n]) => {
833
+ n && (m.remark = "", m.adjustments = [
834
834
  {
835
835
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
836
836
  type: ie.enum.PURCHASE,
837
- doc: p.stock,
837
+ doc: y.stock,
838
838
  measurement: null,
839
839
  remark: "",
840
840
  amount: xe(1)
841
841
  }
842
842
  ]);
843
843
  });
844
- async function S(n) {
844
+ async function w(n) {
845
845
  R.value = !0;
846
846
  try {
847
- await l.adjustSku({
847
+ await r.adjustSku({
848
848
  remark: n.remark,
849
- adjustments: n.adjustments.map(({ doc: $, remark: P, type: N, amount: O, measurement: L }) => ({
849
+ adjustments: n.adjustments.map(({ doc: $, remark: E, type: N, amount: O, measurement: L }) => ({
850
850
  id: $._id,
851
851
  amount: O,
852
852
  measurement: L,
853
- remark: P,
853
+ remark: E,
854
854
  doc: $,
855
855
  type: N
856
856
  }))
857
- }), x("update:show", !1), x("submitted");
857
+ }), S("update:show", !1), S("submitted");
858
858
  } catch ($) {
859
859
  b.open({
860
860
  title: C("inventory.stock.adjust.error.title"),
@@ -866,12 +866,12 @@ const We = {
866
866
  }
867
867
  }
868
868
  function o() {
869
- const n = j.skus.map((P) => ({
870
- label: P.name,
871
- sublabel: P.code,
872
- value: P._id
873
- })), $ = n.filter((P) => c.adjustments.find((N) => N.doc._id === P.value)).map((P) => P.value);
874
- u.open({
869
+ const n = j.skus.map((E) => ({
870
+ label: E.name,
871
+ sublabel: E.code,
872
+ value: E._id
873
+ })), $ = n.filter((E) => m.adjustments.find((N) => N.doc._id === E.value)).map((E) => E.value);
874
+ d.open({
875
875
  title: "Select ingredients",
876
876
  contentComponent: St,
877
877
  contentComponentProps: {
@@ -890,9 +890,9 @@ const We = {
890
890
  close: !0,
891
891
  variant: "tertiary"
892
892
  }
893
- }).onPrimary((P) => {
894
- c.adjustments = P.map(
895
- (N) => c.adjustments.find((O) => O.doc._id === N) ?? {
893
+ }).onPrimary((E) => {
894
+ m.adjustments = E.map(
895
+ (N) => m.adjustments.find((O) => O.doc._id === N) ?? {
896
896
  id: `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Math.random().toString(16).slice(2, 8)}`,
897
897
  type: ie.enum.PURCHASE,
898
898
  doc: j.skus.find((O) => O._id === N),
@@ -904,19 +904,19 @@ const We = {
904
904
  });
905
905
  }
906
906
  function t(n) {
907
- c.adjustments.splice(n, 1);
907
+ m.adjustments.splice(n, 1);
908
908
  }
909
909
  return (n, $) => {
910
- const P = B("FmTextarea"), N = B("FmButton"), O = B("FmForm"), L = B("FmSideSheet");
910
+ const E = B("FmTextarea"), N = B("FmButton"), O = B("FmForm"), L = B("FmSideSheet");
911
911
  return V(), ne(L, {
912
912
  modelValue: s(D),
913
- "onUpdate:modelValue": $[2] || ($[2] = (X) => Ee(D) ? D.value = X : null),
913
+ "onUpdate:modelValue": $[2] || ($[2] = (X) => Pe(D) ? D.value = X : null),
914
914
  "dismiss-away": "",
915
915
  "max-width": 500
916
916
  }, {
917
917
  "side-sheet-header": M(() => [
918
918
  e("div", No, [
919
- e("div", Oo, v(s(C)("inventory.stock.adjust.title")), 1)
919
+ e("div", Oo, p(s(C)("inventory.stock.adjust.title")), 1)
920
920
  ])
921
921
  ]),
922
922
  default: M(() => [
@@ -924,16 +924,16 @@ const We = {
924
924
  class: "w-full flex flex-col gap-12",
925
925
  ref_key: "formRef",
926
926
  ref: a,
927
- onValidationSuccess: r
927
+ onValidationSuccess: l
928
928
  }, {
929
929
  default: M(() => [
930
- _(P, {
930
+ _(E, {
931
931
  label: s(C)("inventory.stock.adjust.remark"),
932
- modelValue: c.remark,
933
- "onUpdate:modelValue": $[0] || ($[0] = (X) => c.remark = X)
932
+ modelValue: m.remark,
933
+ "onUpdate:modelValue": $[0] || ($[0] = (X) => m.remark = X)
934
934
  }, null, 8, ["label", "modelValue"]),
935
935
  e("div", Lo, [
936
- e("div", Yo, v(s(C)("inventory.stock.adjust.adjustedItems")), 1),
936
+ e("div", Yo, p(s(C)("inventory.stock.adjust.adjustedItems")), 1),
937
937
  _(N, {
938
938
  "prepend-icon": "add",
939
939
  variant: "tertiary",
@@ -941,10 +941,10 @@ const We = {
941
941
  onClick: o
942
942
  })
943
943
  ]),
944
- (V(!0), q(ue, null, fe(c.adjustments, (X, z) => (V(), ne($t, {
944
+ (V(!0), q(ue, null, fe(m.adjustments, (X, z) => (V(), ne($t, {
945
945
  key: X.id,
946
- modelValue: c.adjustments[z],
947
- "onUpdate:modelValue": (K) => c.adjustments[z] = K,
946
+ modelValue: m.adjustments[z],
947
+ "onUpdate:modelValue": (K) => m.adjustments[z] = K,
948
948
  "onClick:delete": (K) => t(z)
949
949
  }, null, 8, ["modelValue", "onUpdate:modelValue", "onClick:delete"]))), 128))
950
950
  ]),
@@ -976,35 +976,35 @@ const We = {
976
976
  show: { type: Boolean }
977
977
  },
978
978
  emits: ["update:show", "submitted"],
979
- setup(w, { emit: m }) {
980
- const k = w, p = m, { t: x } = pe(), j = Ne(), u = Ae(), l = Le(), b = we(), R = Ye(k, "show"), C = Y(!1), r = _t({
979
+ setup(A, { emit: u }) {
980
+ const k = A, y = u, { t: S } = pe(), j = Ne(), d = Ae(), r = Le(), b = we(), R = Ye(k, "show"), C = Y(!1), l = _t({
981
981
  remark: "",
982
982
  effectiveAt: /* @__PURE__ */ new Date(),
983
983
  adjustments: []
984
- }), a = Y(!1), D = Y(ke().format("YYYY-MM-DD")), c = Y(ke().format("HH:mm")), S = Y();
985
- Fe([D, c], () => {
986
- if (D.value && c.value) {
987
- const K = ke(`${D.value} ${c.value}`, "YYYY-MM-DD HH:mm");
988
- K.isValid() && (r.effectiveAt = K.toDate());
984
+ }), a = Y(!1), D = Y(ke().format("YYYY-MM-DD")), m = Y(ke().format("HH:mm")), w = Y();
985
+ Fe([D, m], () => {
986
+ if (D.value && m.value) {
987
+ const K = ke(`${D.value} ${m.value}`, "YYYY-MM-DD HH:mm");
988
+ K.isValid() && (l.effectiveAt = K.toDate());
989
989
  }
990
990
  });
991
- const o = T(() => `${D.value} ${c.value}`);
991
+ const o = T(() => `${D.value} ${m.value}`);
992
992
  function t() {
993
993
  if (!a.value) return !0;
994
- const K = ke(`${D.value} ${c.value}`, "YYYY-MM-DD HH:mm");
995
- if (!K.isValid()) return x("inventory.stock.stock_adjustment.invalidDateTime");
994
+ const K = ke(`${D.value} ${m.value}`, "YYYY-MM-DD HH:mm");
995
+ if (!K.isValid()) return S("inventory.stock.stock_adjustment.invalidDateTime");
996
996
  const U = ke();
997
997
  if (K.isAfter(U))
998
- return x("inventory.stock.stock_adjustment.futureDateNotAllowed");
998
+ return S("inventory.stock.stock_adjustment.futureDateNotAllowed");
999
999
  const Z = U.subtract(yt, "day");
1000
- return K.isBefore(Z) ? x("inventory.stock.stock_adjustment.backdateLimitError", { days: yt }) : !0;
1000
+ return K.isBefore(Z) ? S("inventory.stock.stock_adjustment.backdateLimitError", { days: yt }) : !0;
1001
1001
  }
1002
- const n = T(() => [() => t()]), $ = T(() => r.adjustments.length === 0 || t() !== !0);
1003
- function P() {
1004
- r.remark = "", r.effectiveAt = /* @__PURE__ */ new Date(), r.adjustments = [], a.value = !1, D.value = ke(r.effectiveAt).format("YYYY-MM-DD"), c.value = ke(r.effectiveAt).format("HH:mm");
1002
+ const n = T(() => [() => t()]), $ = T(() => l.adjustments.length === 0 || t() !== !0);
1003
+ function E() {
1004
+ l.remark = "", l.effectiveAt = /* @__PURE__ */ new Date(), l.adjustments = [], a.value = !1, D.value = ke(l.effectiveAt).format("YYYY-MM-DD"), m.value = ke(l.effectiveAt).format("HH:mm");
1005
1005
  }
1006
1006
  function N() {
1007
- P();
1007
+ E();
1008
1008
  }
1009
1009
  const O = T(() => {
1010
1010
  const K = {};
@@ -1017,9 +1017,9 @@ const We = {
1017
1017
  label: Z.name,
1018
1018
  sublabel: Z.code,
1019
1019
  value: Z._id
1020
- })), U = r.adjustments.map((Z) => Z.doc._id);
1021
- l.open({
1022
- title: x("inventory.stock.adjust.selectIngredients"),
1020
+ })), U = l.adjustments.map((Z) => Z.doc._id);
1021
+ r.open({
1022
+ title: S("inventory.stock.adjust.selectIngredients"),
1023
1023
  contentComponent: St,
1024
1024
  contentComponentProps: {
1025
1025
  items: K,
@@ -1030,20 +1030,20 @@ const We = {
1030
1030
  closeButton: !0,
1031
1031
  dismissAway: !0,
1032
1032
  primaryActions: {
1033
- text: x("common.confirm"),
1033
+ text: S("common.confirm"),
1034
1034
  close: !0
1035
1035
  },
1036
1036
  secondaryActions: {
1037
- text: x("common.close"),
1037
+ text: S("common.close"),
1038
1038
  close: !0,
1039
1039
  variant: "tertiary"
1040
1040
  }
1041
1041
  }).onPrimary((Z) => {
1042
- r.adjustments = Z.map(
1043
- (le) => r.adjustments.find((g) => g.doc._id === le) ?? {
1042
+ l.adjustments = Z.map(
1043
+ (re) => l.adjustments.find((g) => g.doc._id === re) ?? {
1044
1044
  id: "",
1045
1045
  type: ie.enum.PURCHASE,
1046
- doc: O.value[le],
1046
+ doc: O.value[re],
1047
1047
  measurement: null,
1048
1048
  remark: "",
1049
1049
  amount: xe(1)
@@ -1052,38 +1052,38 @@ const We = {
1052
1052
  });
1053
1053
  }
1054
1054
  function X(K) {
1055
- r.adjustments.splice(K, 1);
1055
+ l.adjustments.splice(K, 1);
1056
1056
  }
1057
1057
  async function z() {
1058
- if (r.adjustments.length === 0) {
1058
+ if (l.adjustments.length === 0) {
1059
1059
  b.open({
1060
- title: x("inventory.stock.error.title"),
1061
- message: x("inventory.stock.stock_adjustment.noAdjustments"),
1060
+ title: S("inventory.stock.error.title"),
1061
+ message: S("inventory.stock.stock_adjustment.noAdjustments"),
1062
1062
  type: "warning"
1063
1063
  });
1064
1064
  return;
1065
1065
  }
1066
1066
  C.value = !0;
1067
1067
  try {
1068
- const K = r.adjustments.map(
1069
- ({ doc: Z, remark: le, type: g, amount: A, measurement: G }) => ({
1068
+ const K = l.adjustments.map(
1069
+ ({ doc: Z, remark: re, type: g, amount: F, measurement: G }) => ({
1070
1070
  id: Z._id,
1071
- amount: A,
1071
+ amount: F,
1072
1072
  measurement: G,
1073
- remark: le,
1073
+ remark: re,
1074
1074
  doc: Z,
1075
1075
  type: g
1076
1076
  })
1077
1077
  ), U = {
1078
- remark: r.remark,
1078
+ remark: l.remark,
1079
1079
  adjustments: K,
1080
- ...a.value ? { effectiveAt: r.effectiveAt.toISOString() } : {}
1080
+ ...a.value ? { effectiveAt: l.effectiveAt.toISOString() } : {}
1081
1081
  };
1082
- await u.adjustSku(Re(U)), p("submitted"), p("update:show", !1);
1082
+ await d.adjustSku(Re(U)), y("submitted"), y("update:show", !1);
1083
1083
  } catch (K) {
1084
1084
  b.open({
1085
- title: x("inventory.stock.adjust.error.title"),
1086
- message: x("inventory.stock.adjust.error.message"),
1085
+ title: S("inventory.stock.adjust.error.title"),
1086
+ message: S("inventory.stock.adjust.error.message"),
1087
1087
  type: "error"
1088
1088
  }), console.error("error on stock adjustment", K);
1089
1089
  } finally {
@@ -1091,57 +1091,57 @@ const We = {
1091
1091
  }
1092
1092
  }
1093
1093
  return (K, U) => {
1094
- const Z = B("FmTextarea"), le = B("FmSwitch"), g = B("FmDatePicker"), A = B("FmTimePicker"), G = B("FmFormGroup"), H = B("FmButton"), J = B("FmForm"), I = B("FmSideSheet");
1094
+ const Z = B("FmTextarea"), re = B("FmSwitch"), g = B("FmDatePicker"), F = B("FmTimePicker"), G = B("FmFormGroup"), H = B("FmButton"), J = B("FmForm"), I = B("FmSideSheet");
1095
1095
  return V(), ne(I, {
1096
1096
  modelValue: s(R),
1097
- "onUpdate:modelValue": U[6] || (U[6] = (i) => Ee(R) ? R.value = i : null),
1097
+ "onUpdate:modelValue": U[6] || (U[6] = (c) => Pe(R) ? R.value = c : null),
1098
1098
  "dismiss-away": "",
1099
1099
  "max-width": 560,
1100
1100
  onAfterEnter: N
1101
1101
  }, {
1102
1102
  "side-sheet-header": M(() => [
1103
1103
  e("div", Wo, [
1104
- e("div", Ko, v(s(x)("inventory.stock.stock_adjustment.title")), 1)
1104
+ e("div", Ko, p(s(S)("inventory.stock.stock_adjustment.title")), 1)
1105
1105
  ])
1106
1106
  ]),
1107
1107
  default: M(() => [
1108
1108
  _(J, {
1109
1109
  class: "flex flex-col gap-16",
1110
1110
  ref_key: "formRef",
1111
- ref: S,
1111
+ ref: w,
1112
1112
  onValidationSuccess: z
1113
1113
  }, {
1114
1114
  default: M(() => [
1115
1115
  _(Z, {
1116
- label: s(x)("inventory.stock.adjust.remark"),
1117
- modelValue: r.remark,
1118
- "onUpdate:modelValue": U[0] || (U[0] = (i) => r.remark = i),
1116
+ label: s(S)("inventory.stock.adjust.remark"),
1117
+ modelValue: l.remark,
1118
+ "onUpdate:modelValue": U[0] || (U[0] = (c) => l.remark = c),
1119
1119
  "label-mark": "optional"
1120
1120
  }, null, 8, ["label", "modelValue"]),
1121
- _(le, {
1121
+ _(re, {
1122
1122
  value: "",
1123
1123
  "model-value": a.value,
1124
- "onUpdate:modelValue": U[1] || (U[1] = (i) => a.value = i),
1125
- label: s(x)("inventory.stock.stock_adjustment.backdateLabel"),
1126
- sublabel: s(x)("inventory.stock.stock_adjustment.backdateSublabel"),
1124
+ "onUpdate:modelValue": U[1] || (U[1] = (c) => a.value = c),
1125
+ label: s(S)("inventory.stock.stock_adjustment.backdateLabel"),
1126
+ sublabel: s(S)("inventory.stock.stock_adjustment.backdateSublabel"),
1127
1127
  labelPlacement: "right"
1128
1128
  }, null, 8, ["model-value", "label", "sublabel"]),
1129
1129
  a.value ? (V(), q("div", qo, [
1130
- e("label", Xo, v(s(x)("inventory.stock.stock_adjustment.effectiveAt")), 1),
1130
+ e("label", Xo, p(s(S)("inventory.stock.stock_adjustment.effectiveAt")), 1),
1131
1131
  e("div", Jo, [
1132
1132
  e("div", Qo, [
1133
1133
  _(g, {
1134
1134
  class: "w-full",
1135
1135
  modelValue: D.value,
1136
- "onUpdate:modelValue": U[2] || (U[2] = (i) => D.value = i),
1136
+ "onUpdate:modelValue": U[2] || (U[2] = (c) => D.value = c),
1137
1137
  clearable: !1
1138
1138
  }, null, 8, ["modelValue"])
1139
1139
  ]),
1140
1140
  e("div", Zo, [
1141
- _(A, {
1141
+ _(F, {
1142
1142
  class: "w-full",
1143
- modelValue: c.value,
1144
- "onUpdate:modelValue": U[3] || (U[3] = (i) => c.value = i),
1143
+ modelValue: m.value,
1144
+ "onUpdate:modelValue": U[3] || (U[3] = (c) => m.value = c),
1145
1145
  format: "HH:mm"
1146
1146
  }, null, 8, ["modelValue"])
1147
1147
  ])
@@ -1150,10 +1150,10 @@ const We = {
1150
1150
  "model-value": o.value,
1151
1151
  rules: n.value
1152
1152
  }, null, 8, ["model-value", "rules"]),
1153
- e("div", en, v(s(x)("inventory.stock.stock_adjustment.immediateHint")), 1)
1153
+ e("div", en, p(s(S)("inventory.stock.stock_adjustment.immediateHint")), 1)
1154
1154
  ])) : se("", !0),
1155
1155
  e("div", tn, [
1156
- e("div", on, v(s(x)("inventory.stock.adjust.adjustedItems")), 1),
1156
+ e("div", on, p(s(S)("inventory.stock.adjust.adjustedItems")), 1),
1157
1157
  _(H, {
1158
1158
  "prepend-icon": "add",
1159
1159
  variant: "tertiary",
@@ -1161,12 +1161,12 @@ const We = {
1161
1161
  onClick: L
1162
1162
  })
1163
1163
  ]),
1164
- (V(!0), q(ue, null, fe(r.adjustments, (i, h) => (V(), ne($t, {
1165
- key: i.doc._id,
1166
- modelValue: r.adjustments[h],
1167
- "onUpdate:modelValue": (y) => r.adjustments[h] = y,
1164
+ (V(!0), q(ue, null, fe(l.adjustments, (c, h) => (V(), ne($t, {
1165
+ key: c.doc._id,
1166
+ modelValue: l.adjustments[h],
1167
+ "onUpdate:modelValue": (f) => l.adjustments[h] = f,
1168
1168
  "is-backdate": a.value,
1169
- "onClick:delete": (y) => X(h)
1169
+ "onClick:delete": (f) => X(h)
1170
1170
  }, null, 8, ["modelValue", "onUpdate:modelValue", "is-backdate", "onClick:delete"]))), 128))
1171
1171
  ]),
1172
1172
  _: 1
@@ -1175,18 +1175,18 @@ const We = {
1175
1175
  "side-sheet-footer": M(() => [
1176
1176
  e("div", nn, [
1177
1177
  _(H, {
1178
- label: s(x)("common.confirm"),
1178
+ label: s(S)("common.confirm"),
1179
1179
  loading: C.value,
1180
1180
  disabled: $.value,
1181
- onClick: U[4] || (U[4] = (i) => {
1182
- var h, y;
1183
- return (y = (h = S.value) == null ? void 0 : h.validateInputs) == null ? void 0 : y.call(h);
1181
+ onClick: U[4] || (U[4] = (c) => {
1182
+ var h, f;
1183
+ return (f = (h = w.value) == null ? void 0 : h.validateInputs) == null ? void 0 : f.call(h);
1184
1184
  })
1185
1185
  }, null, 8, ["label", "loading", "disabled"]),
1186
1186
  _(H, {
1187
- label: s(x)("common.close"),
1187
+ label: s(S)("common.close"),
1188
1188
  variant: "tertiary",
1189
- onClick: U[5] || (U[5] = (i) => p("update:show", !1))
1189
+ onClick: U[5] || (U[5] = (c) => y("update:show", !1))
1190
1190
  }, null, 8, ["label"])
1191
1191
  ])
1192
1192
  ]),
@@ -1194,27 +1194,27 @@ const We = {
1194
1194
  }, 8, ["modelValue"]);
1195
1195
  };
1196
1196
  }
1197
- }), an = Tt((w, m) => ({
1197
+ }), an = Tt((A, u) => ({
1198
1198
  // TODO: remove once latest inventory backend has been push
1199
- async findBillsByBusinessId(k, p, x) {
1200
- const j = `${w.businessesBackendUrl}/${k}/reports/find-many`, u = {
1199
+ async findBillsByBusinessId(k, y, S) {
1200
+ const j = `${A.businessesBackendUrl}/${k}/reports/find-many`, d = {
1201
1201
  // type: TYPE.bill,
1202
1202
  type: "bill",
1203
- restaurantIds: p,
1204
- ids: x
1203
+ restaurantIds: y,
1204
+ ids: S
1205
1205
  };
1206
- return await m.post(j, u);
1206
+ return await u.post(j, d);
1207
1207
  },
1208
1208
  async findBillsById(k) {
1209
- const x = Se().currentLocationDBName, j = `${w.inventoryBackendUrl}/${x}/bill/search`, u = {
1209
+ const S = Se().currentLocationDBName, j = `${A.inventoryBackendUrl}/${S}/bill/search`, d = {
1210
1210
  ids: k
1211
1211
  };
1212
- return await m.post(j, u);
1212
+ return await u.post(j, d);
1213
1213
  }
1214
- })), ln = {
1214
+ })), rn = {
1215
1215
  key: 0,
1216
1216
  class: "flex justify-center items-center h-32"
1217
- }, rn = { class: "mb-3" }, un = { class: "flex flex-col gap-8" }, cn = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, dn = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, mn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, fn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, vn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, pn = { class: "flex flex-col w-full px-2" }, yn = { class: "flex gap-2" }, _n = /* @__PURE__ */ ve({
1217
+ }, ln = { class: "mb-3" }, un = { class: "flex flex-col gap-8" }, cn = { class: "flex flex-col text-fm-color-typo-primary mb-3 text-center" }, dn = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-sm-600" }, mn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, fn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, vn = { class: "flex flex-col gap-4 text-fm-color-typo-primary mb-3" }, pn = { class: "flex flex-col w-full px-2" }, yn = { class: "flex gap-2" }, _n = /* @__PURE__ */ ve({
1218
1218
  __name: "AmendAdjustmentForm",
1219
1219
  props: /* @__PURE__ */ nt({
1220
1220
  adjustmentId: {}
@@ -1223,35 +1223,35 @@ const We = {
1223
1223
  modelModifiers: {}
1224
1224
  }),
1225
1225
  emits: /* @__PURE__ */ nt(["refreshHistory"], ["update:modelValue"]),
1226
- setup(w, { emit: m }) {
1227
- const k = w, p = m, x = Ae(), j = jt(w, "modelValue"), u = Y(!1), l = Y(!1), b = Y(!1), R = Y({
1226
+ setup(A, { emit: u }) {
1227
+ const k = A, y = u, S = Ae(), j = jt(A, "modelValue"), d = Y(!1), r = Y(!1), b = Y(!1), R = Y({
1228
1228
  _id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
1229
1229
  skus: []
1230
1230
  }), C = Y();
1231
1231
  qe(async () => {
1232
- u.value = !0;
1233
- const o = await x.readSingleAdjustment(k.adjustmentId);
1232
+ d.value = !0;
1233
+ const o = await S.readSingleAdjustment(k.adjustmentId);
1234
1234
  if (!o) throw new Error("Adjustment not found");
1235
- R.value = o, u.value = !1;
1235
+ R.value = o, d.value = !1;
1236
1236
  });
1237
- async function r() {
1237
+ async function l() {
1238
1238
  var t, n;
1239
- if ((n = (t = C == null ? void 0 : C.value) == null ? void 0 : t.validateInputs) == null || n.call(t), !l.value) return;
1239
+ if ((n = (t = C == null ? void 0 : C.value) == null ? void 0 : t.validateInputs) == null || n.call(t), !r.value) return;
1240
1240
  const o = {};
1241
1241
  Object.keys(j.value || {}).forEach(($) => {
1242
- var P;
1243
- Object.keys(((P = j.value) == null ? void 0 : P[$]) || {}).forEach((N) => {
1242
+ var E;
1243
+ Object.keys(((E = j.value) == null ? void 0 : E[$]) || {}).forEach((N) => {
1244
1244
  var L, X;
1245
1245
  const O = (X = (L = j.value) == null ? void 0 : L[$]) == null ? void 0 : X[Number(N)];
1246
1246
  O && D(O.amount) > 0 && (o[$] || (o[$] = []), o[$].push(O));
1247
1247
  });
1248
- }), await x.revertWastageAdjustment({
1248
+ }), await S.revertWastageAdjustment({
1249
1249
  targetWastageAdjustmentId: k.adjustmentId,
1250
1250
  amountsGoingToAdjust: o
1251
- }), p("refreshHistory"), b.value = !1, j.value = {};
1251
+ }), y("refreshHistory"), b.value = !1, j.value = {};
1252
1252
  }
1253
1253
  function a(o) {
1254
- const { skuId: t, idx: n, unit: $, measurement: P } = o;
1254
+ const { skuId: t, idx: n, unit: $, measurement: E } = o;
1255
1255
  return T({
1256
1256
  get: () => {
1257
1257
  var L, X, z;
@@ -1267,7 +1267,7 @@ const We = {
1267
1267
  precision: $e($)
1268
1268
  }),
1269
1269
  type: ie.Enum.WASTAGE,
1270
- measurement: P
1270
+ measurement: E
1271
1271
  }, j.value = O;
1272
1272
  }
1273
1273
  });
@@ -1276,16 +1276,16 @@ const We = {
1276
1276
  const n = Number(_e.toFormatString({ value: o }));
1277
1277
  return t ? Math.abs(n) : n;
1278
1278
  }
1279
- function c(o, t) {
1279
+ function m(o, t) {
1280
1280
  return t.measurement ? t.measurement.abbrev : o.sku.unit.abbrev;
1281
1281
  }
1282
- function S(o, t) {
1282
+ function w(o, t) {
1283
1283
  if (t.amount === 0) return "N/A";
1284
1284
  const n = _e.add([o, t]);
1285
1285
  return n ? _e.toFormatString({ value: n }) : "N/A";
1286
1286
  }
1287
1287
  return (o, t) => {
1288
- const n = B("FmIcon"), $ = B("FmStepperField"), P = B("FmCard"), N = B("FmForm"), O = B("FmSpacer"), L = B("FmButton"), X = B("FmDialog");
1288
+ const n = B("FmIcon"), $ = B("FmStepperField"), E = B("FmCard"), N = B("FmForm"), O = B("FmSpacer"), L = B("FmButton"), X = B("FmDialog");
1289
1289
  return V(), ne(X, {
1290
1290
  modelValue: b.value,
1291
1291
  "onUpdate:modelValue": t[4] || (t[4] = (z) => b.value = z),
@@ -1327,50 +1327,50 @@ const We = {
1327
1327
  label: "Submit",
1328
1328
  size: "md",
1329
1329
  variant: "primary",
1330
- onClick: r
1330
+ onClick: l
1331
1331
  })
1332
1332
  ])
1333
1333
  ])
1334
1334
  ]),
1335
1335
  default: M(() => [
1336
- u.value ? (V(), q("div", ln)) : (V(), ne(N, {
1336
+ d.value ? (V(), q("div", rn)) : (V(), ne(N, {
1337
1337
  key: 1,
1338
1338
  ref_key: "formRef",
1339
1339
  ref: C,
1340
1340
  onValidationFailed: t[1] || (t[1] = () => {
1341
- l.value = !1;
1341
+ r.value = !1;
1342
1342
  }),
1343
1343
  onValidationSuccess: t[2] || (t[2] = () => {
1344
- l.value = !0;
1344
+ r.value = !0;
1345
1345
  }),
1346
1346
  blameFormChildOnValidationFailed: ""
1347
1347
  }, {
1348
1348
  default: M(() => [
1349
- e("p", rn, [
1349
+ e("p", ln, [
1350
1350
  t[6] || (t[6] = e("b", null, "Date:", -1)),
1351
1351
  t[7] || (t[7] = e("br", null, null, -1)),
1352
- ye(" " + v(s(eo)(s(Pt)(R.value._id))), 1)
1352
+ ye(" " + p(s(eo)(s(Et)(R.value._id))), 1)
1353
1353
  ]),
1354
1354
  e("div", un, [
1355
1355
  (V(!0), q(ue, null, fe(R.value.skus, (z, K) => (V(), q(ue, { key: K }, [
1356
- (V(!0), q(ue, null, fe(z.amounts, (U, Z) => (V(), ne(P, {
1356
+ (V(!0), q(ue, null, fe(z.amounts, (U, Z) => (V(), ne(E, {
1357
1357
  key: Z,
1358
1358
  variant: "outlined",
1359
1359
  class: "p-2"
1360
1360
  }, {
1361
1361
  default: M(() => [
1362
1362
  e("div", cn, [
1363
- e("span", dn, v(z.sku.code), 1),
1364
- e("span", null, v(z.sku.name), 1)
1363
+ e("span", dn, p(z.sku.code), 1),
1364
+ e("span", null, p(z.sku.name), 1)
1365
1365
  ]),
1366
1366
  t[12] || (t[12] = e("hr", { class: "m-2" }, null, -1)),
1367
1367
  e("div", mn, [
1368
1368
  t[8] || (t[8] = e("span", { class: "fm-typo-en-body-lg-600" }, "Adjustment type:", -1)),
1369
- e("span", null, v(U.type), 1)
1369
+ e("span", null, p(U.type), 1)
1370
1370
  ]),
1371
1371
  e("div", fn, [
1372
1372
  t[9] || (t[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
1373
- e("span", null, v(s(_e).toFormatString({ value: U.amount })) + " " + v(c(z, U)), 1)
1373
+ e("span", null, p(s(_e).toFormatString({ value: U.amount })) + " " + p(m(z, U)), 1)
1374
1374
  ]),
1375
1375
  _($, {
1376
1376
  "max-fraction-digits": s($e)(z.sku.unit),
@@ -1379,24 +1379,24 @@ const We = {
1379
1379
  idx: Z,
1380
1380
  unit: z.sku.unit
1381
1381
  }).value,
1382
- "onUpdate:modelValue": (le) => a({
1382
+ "onUpdate:modelValue": (re) => a({
1383
1383
  skuId: z.sku._id,
1384
1384
  idx: Z,
1385
1385
  unit: z.sku.unit
1386
- }).value = le,
1386
+ }).value = re,
1387
1387
  class: "mb-3",
1388
1388
  label: "Adjust Amount (Leave 0 to skip)",
1389
1389
  "helper-text": `Max: ${D(U.amount)}`,
1390
- "append-text": c(z, U),
1390
+ "append-text": m(z, U),
1391
1391
  rules: [
1392
- (le) => le <= D(U.amount) || `Cannot be more than ${D(U.amount)}`,
1392
+ (re) => re <= D(U.amount) || `Cannot be more than ${D(U.amount)}`,
1393
1393
  s(Ue)(-1)
1394
1394
  ]
1395
1395
  }, null, 8, ["max-fraction-digits", "model-value", "onUpdate:modelValue", "helper-text", "append-text", "rules"]),
1396
1396
  e("div", vn, [
1397
1397
  t[10] || (t[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
1398
1398
  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)),
1399
- ye(" " + v(S(
1399
+ ye(" " + p(w(
1400
1400
  U.amount,
1401
1401
  s(_e).fromNumber(
1402
1402
  a({
@@ -1405,7 +1405,7 @@ const We = {
1405
1405
  unit: z.sku.unit
1406
1406
  }).value
1407
1407
  )
1408
- )) + " " + v(c(z, U)), 1)
1408
+ )) + " " + p(m(z, U)), 1)
1409
1409
  ])
1410
1410
  ]),
1411
1411
  _: 2
@@ -1444,55 +1444,55 @@ const We = {
1444
1444
  unitCostHistory: { default: () => [] },
1445
1445
  costMechanism: { default: "adjustment" }
1446
1446
  },
1447
- setup(w) {
1448
- const m = w;
1449
- function k(C, r) {
1450
- if (m.costMechanism === "adjustment")
1447
+ setup(A) {
1448
+ const u = A;
1449
+ function k(C, l) {
1450
+ if (u.costMechanism === "adjustment")
1451
1451
  return null;
1452
- const a = m.unitCostHistory.filter(
1453
- (S) => S.mechanism === m.costMechanism && S.skuId === m.sku._id
1452
+ const a = u.unitCostHistory.filter(
1453
+ (w) => w.mechanism === u.costMechanism && w.skuId === u.sku._id
1454
1454
  );
1455
1455
  if (a.length === 0) return null;
1456
- const D = a.find((S) => {
1457
- const o = S.meta;
1456
+ const D = a.find((w) => {
1457
+ const o = w.meta;
1458
1458
  return (o == null ? void 0 : o.adjustmentId) === C;
1459
1459
  });
1460
1460
  if (D) return D.cost;
1461
- const c = [...a].filter((S) => new Date(S.snapshotAt) <= new Date(r)).sort((S, o) => new Date(o.snapshotAt).getTime() - new Date(S.snapshotAt).getTime());
1462
- return c.length > 0 ? c[0].cost : null;
1461
+ const m = [...a].filter((w) => new Date(w.snapshotAt) <= new Date(l)).sort((w, o) => new Date(o.snapshotAt).getTime() - new Date(w.snapshotAt).getTime());
1462
+ return m.length > 0 ? m[0].cost : null;
1463
1463
  }
1464
- const p = Y(!1), x = Y(), j = Y(null), u = T(() => j.value === null ? "unset" : p.value ? `${j.value}px` : "0px");
1464
+ const y = Y(!1), S = Y(), j = Y(null), d = T(() => j.value === null ? "unset" : y.value ? `${j.value}px` : "0px");
1465
1465
  qe(() => {
1466
1466
  var C;
1467
- j.value = ((C = x.value) == null ? void 0 : C.scrollHeight) || 0;
1467
+ j.value = ((C = S.value) == null ? void 0 : C.scrollHeight) || 0;
1468
1468
  });
1469
- const l = T(() => {
1470
- var S;
1471
- const C = m.record.adjustments, r = m.sku, a = {}, c = C.flatMap((o) => {
1469
+ const r = T(() => {
1470
+ var w;
1471
+ const C = u.record.adjustments, l = u.sku, a = {}, m = C.flatMap((o) => {
1472
1472
  var t;
1473
- return ((t = o.skus) == null ? void 0 : t.filter((n) => n.sku._id === r._id)) ?? [];
1473
+ return ((t = o.skus) == null ? void 0 : t.filter((n) => n.sku._id === l._id)) ?? [];
1474
1474
  }).flatMap((o) => o.amounts);
1475
- for (const o of c) {
1475
+ for (const o of m) {
1476
1476
  const t = o.measurement ? xt(o.measurement.conversion, o.amount) : o.amount;
1477
- a[S = o.type] ?? (a[S] = { amount: 0, precision: 0 }), a[o.type] = Qe(t, a[o.type]);
1477
+ a[w = o.type] ?? (a[w] = { amount: 0, precision: 0 }), a[o.type] = Qe(t, a[o.type]);
1478
1478
  }
1479
1479
  return Object.entries(a).reduce(
1480
1480
  (o, [t, n]) => (o[t] = /// comment, because without it formatter makes code uglier
1481
1481
  `${oe.toFormatString({
1482
1482
  value: n,
1483
1483
  precision: 4
1484
- })} ${r.unit.abbrev}`, o),
1484
+ })} ${l.unit.abbrev}`, o),
1485
1485
  {}
1486
1486
  );
1487
- }), { t: b } = pe(), R = T(() => m.record.adjustmentsByTime.map(({ date: C, adjustments: r }) => ({
1487
+ }), { t: b } = pe(), R = T(() => u.record.adjustmentsByTime.map(({ date: C, adjustments: l }) => ({
1488
1488
  time: to(new Date(C)),
1489
- adjustments: r.flatMap(
1489
+ adjustments: l.flatMap(
1490
1490
  (a) => {
1491
- var D, c;
1492
- return ((c = (D = a.skus) == null ? void 0 : D.map) == null ? void 0 : c.call(D, (S) => {
1491
+ var D, m;
1492
+ return ((m = (D = a.skus) == null ? void 0 : D.map) == null ? void 0 : m.call(D, (w) => {
1493
1493
  var o, t;
1494
1494
  return {
1495
- ...S,
1495
+ ...w,
1496
1496
  ref: a.ref,
1497
1497
  reason: a.reason,
1498
1498
  adjustmentRemark: a.remark,
@@ -1505,7 +1505,7 @@ const We = {
1505
1505
  }
1506
1506
  ).flatMap((a) => {
1507
1507
  var t;
1508
- const D = (t = m.bills.find((n) => n._id === a.ref)) == null ? void 0 : t.seqNumber, c = D ? b("inventory.stock.record.bill", [D]) : "", S = a.adjustmentTime ?? (/* @__PURE__ */ new Date()).toISOString(), o = k(a.adjustmentId, S);
1508
+ const D = (t = u.bills.find((n) => n._id === a.ref)) == null ? void 0 : t.seqNumber, m = D ? b("inventory.stock.record.bill", [D]) : "", w = a.adjustmentTime ?? (/* @__PURE__ */ new Date()).toISOString(), o = k(a.adjustmentId, w);
1509
1509
  return (a.amounts || []).filter((n) => n != null).map((n) => {
1510
1510
  var N;
1511
1511
  let $ = n.cost;
@@ -1519,13 +1519,13 @@ const We = {
1519
1519
  currency: o.currency
1520
1520
  };
1521
1521
  }
1522
- let P = "";
1523
- return c ? P = n.remark || "" : P = [a.adjustmentRemark, n.remark].filter((L) => L).join("/"), {
1522
+ let E = "";
1523
+ return m ? E = n.remark || "" : E = [a.adjustmentRemark, n.remark].filter((L) => L).join("/"), {
1524
1524
  amount: `${oe.toFormatString({ value: n.amount, precision: 4 })} ${((N = n.measurement) == null ? void 0 : N.abbrev) ?? a.sku.unit.abbrev}`,
1525
1525
  backdateFrom: a.backdateFrom,
1526
1526
  name: n.type,
1527
- billRemark: c,
1528
- remark: P,
1527
+ billRemark: m,
1528
+ remark: E,
1529
1529
  reason: a.reason || "",
1530
1530
  cost: $,
1531
1531
  toBalance: oe.toFormatString({
@@ -1538,59 +1538,59 @@ const We = {
1538
1538
  });
1539
1539
  })
1540
1540
  })));
1541
- return (C, r) => {
1542
- const a = B("FmIcon"), D = B("FmTooltip"), c = B("FmCard");
1543
- return V(), ne(c, { variant: "outlined" }, {
1541
+ return (C, l) => {
1542
+ const a = B("FmIcon"), D = B("FmTooltip"), m = B("FmCard");
1543
+ return V(), ne(m, { variant: "outlined" }, {
1544
1544
  default: M(() => [
1545
1545
  e("div", kn, [
1546
1546
  e("div", {
1547
1547
  class: "flex items-center cursor-pointer mb-1",
1548
- onClick: r[0] || (r[0] = (S) => p.value = !p.value)
1548
+ onClick: l[0] || (l[0] = (w) => y.value = !y.value)
1549
1549
  }, [
1550
- e("div", hn, v(C.record.date), 1),
1550
+ e("div", hn, p(C.record.date), 1),
1551
1551
  _(a, {
1552
- name: p.value ? "expand_more" : "expand_less",
1552
+ name: y.value ? "expand_more" : "expand_less",
1553
1553
  color: "#777777",
1554
1554
  size: "md"
1555
1555
  }, null, 8, ["name"])
1556
1556
  ]),
1557
- (V(!0), q(ue, null, fe(l.value, (S, o) => (V(), q("div", {
1557
+ (V(!0), q(ue, null, fe(r.value, (w, o) => (V(), q("div", {
1558
1558
  key: o,
1559
1559
  class: "flex flex-row py-1",
1560
1560
  style: { "font-size": "0.8rem" }
1561
1561
  }, [
1562
- e("div", bn, v(s(b)(`inventory.inventoryAdjustment.type.${o}`)), 1),
1562
+ e("div", bn, p(s(b)(`inventory.inventoryAdjustment.type.${o}`)), 1),
1563
1563
  e("div", {
1564
1564
  class: He({
1565
- "text-fm-color-typo-error": S.startsWith("-"),
1566
- "text-fm-color-typo-success": !S.startsWith("-"),
1565
+ "text-fm-color-typo-error": w.startsWith("-"),
1566
+ "text-fm-color-typo-success": !w.startsWith("-"),
1567
1567
  "ml-auto": !0
1568
1568
  })
1569
- }, v(S), 3)
1569
+ }, p(w), 3)
1570
1570
  ]))), 128)),
1571
1571
  e("div", {
1572
1572
  ref_key: "detailRef",
1573
- ref: x,
1573
+ ref: S,
1574
1574
  style: kt({
1575
1575
  fontSize: "0.8rem",
1576
- maxHeight: u.value,
1576
+ maxHeight: d.value,
1577
1577
  overflow: "hidden",
1578
1578
  transition: "max-height 0.2s ease-out"
1579
1579
  })
1580
1580
  }, [
1581
1581
  R.value.length ? (V(), q("hr", gn)) : se("", !0),
1582
- (V(!0), q(ue, null, fe(R.value, (S) => (V(), q("div", {
1583
- key: S.time,
1582
+ (V(!0), q(ue, null, fe(R.value, (w) => (V(), q("div", {
1583
+ key: w.time,
1584
1584
  class: "flex gap-1 w-full"
1585
1585
  }, [
1586
- e("div", xn, v(S.time), 1),
1586
+ e("div", xn, p(w.time), 1),
1587
1587
  e("div", Sn, [
1588
- (V(!0), q(ue, null, fe(S.adjustments, (o) => (V(), q("div", {
1588
+ (V(!0), q(ue, null, fe(w.adjustments, (o) => (V(), q("div", {
1589
1589
  key: o.name,
1590
1590
  class: "flex gap-1"
1591
1591
  }, [
1592
1592
  e("div", wn, [
1593
- ye(v(s(b)(`inventory.inventoryAdjustment.type.${o.name}`)) + " ", 1),
1593
+ ye(p(s(b)(`inventory.inventoryAdjustment.type.${o.name}`)) + " ", 1),
1594
1594
  o.backdateFrom ? (V(), ne(D, {
1595
1595
  key: 0,
1596
1596
  variant: "plain",
@@ -1598,7 +1598,7 @@ const We = {
1598
1598
  "z-index": 50
1599
1599
  }, {
1600
1600
  content: M(() => [
1601
- e("div", An, v(s(b)("inventory.stock.record.backdate", [
1601
+ e("div", An, p(s(b)("inventory.stock.record.backdate", [
1602
1602
  s(wt)(new Date(o.backdateFrom))
1603
1603
  ])), 1)
1604
1604
  ]),
@@ -1611,11 +1611,11 @@ const We = {
1611
1611
  ]),
1612
1612
  _: 2
1613
1613
  }, 1024)) : se("", !0),
1614
- o.billRemark ? (V(), q("span", Fn, " # " + v(o.billRemark), 1)) : se("", !0),
1615
- o.billRemark && o.remark ? (V(), q("span", $n, " (" + v(o.remark) + ") ", 1)) : se("", !0),
1616
- !o.billRemark && o.reason ? (V(), q("span", jn, " (" + v(o.reason) + ") ", 1)) : se("", !0),
1617
- !o.billRemark && o.remark ? (V(), q("span", Vn, " # " + v(o.remark), 1)) : se("", !0),
1618
- o.name === s(ie).Enum.CLOSING ? (V(), q("span", Cn, " Actual Balance: " + v(o.toBalance) + " " + v(o.baseUnit), 1)) : se("", !0)
1614
+ o.billRemark ? (V(), q("span", Fn, " # " + p(o.billRemark), 1)) : se("", !0),
1615
+ o.billRemark && o.remark ? (V(), q("span", $n, " (" + p(o.remark) + ") ", 1)) : se("", !0),
1616
+ !o.billRemark && o.reason ? (V(), q("span", jn, " (" + p(o.reason) + ") ", 1)) : se("", !0),
1617
+ !o.billRemark && o.remark ? (V(), q("span", Vn, " # " + p(o.remark), 1)) : se("", !0),
1618
+ o.name === s(ie).Enum.CLOSING ? (V(), q("span", Cn, " Actual Balance: " + p(o.toBalance) + " " + p(o.baseUnit), 1)) : se("", !0)
1619
1619
  ]),
1620
1620
  e("div", {
1621
1621
  class: He({
@@ -1623,13 +1623,13 @@ const We = {
1623
1623
  "text-fm-color-typo-success": !o.amount.startsWith("-"),
1624
1624
  "ml-auto": !0
1625
1625
  })
1626
- }, v(o.amount), 3),
1626
+ }, p(o.amount), 3),
1627
1627
  o.name === s(ie).Enum.WASTAGE ? (V(), ne(_n, {
1628
1628
  key: 0,
1629
1629
  adjustmentId: o.adjustmentId,
1630
- onRefreshHistory: r[1] || (r[1] = (t) => C.$emit("refreshHistory"))
1630
+ onRefreshHistory: l[1] || (l[1] = (t) => C.$emit("refreshHistory"))
1631
1631
  }, null, 8, ["adjustmentId"])) : se("", !0),
1632
- o.cost ? (V(), q("div", Dn, " (" + v(s(Me)(o.cost, !1, o.cost.precision)) + ") ", 1)) : se("", !0)
1632
+ o.cost ? (V(), q("div", Dn, " (" + p(s(Me)(o.cost, !1, o.cost.precision)) + ") ", 1)) : se("", !0)
1633
1633
  ]))), 128))
1634
1634
  ])
1635
1635
  ]))), 128))
@@ -1641,66 +1641,66 @@ const We = {
1641
1641
  };
1642
1642
  }
1643
1643
  });
1644
- function Mn(w, m) {
1644
+ function Mn(A, u) {
1645
1645
  var j;
1646
1646
  const k = Object.keys(ie.enum).reduce(
1647
- (u, l) => (u[l] = { amount: 0, precision: 0 }, u),
1647
+ (d, r) => (d[r] = { amount: 0, precision: 0 }, d),
1648
1648
  {}
1649
1649
  );
1650
- if (!m)
1650
+ if (!u)
1651
1651
  return Object.entries(k).reduce(
1652
- (u, [l]) => (u[l] = oe.fromNumber(0), u),
1652
+ (d, [r]) => (d[r] = oe.fromNumber(0), d),
1653
1653
  {}
1654
1654
  );
1655
- const x = w.flatMap((u) => {
1656
- var l;
1657
- return ((l = u.skus) == null ? void 0 : l.filter((b) => b.sku._id === m._id)) ?? [];
1658
- }).flatMap((u) => u.amounts);
1659
- for (const u of x) {
1660
- const l = u.measurement ? oe.multiply([u.measurement.conversion, u.amount]) : u.amount;
1661
- k[j = u.type] ?? (k[j] = { amount: 0, precision: 0 }), k[u.type] = oe.add([l, k[u.type]]);
1655
+ const S = A.flatMap((d) => {
1656
+ var r;
1657
+ return ((r = d.skus) == null ? void 0 : r.filter((b) => b.sku._id === u._id)) ?? [];
1658
+ }).flatMap((d) => d.amounts);
1659
+ for (const d of S) {
1660
+ const r = d.measurement ? oe.multiply([d.measurement.conversion, d.amount]) : d.amount;
1661
+ k[j = d.type] ?? (k[j] = { amount: 0, precision: 0 }), k[d.type] = oe.add([r, k[d.type]]);
1662
1662
  }
1663
1663
  return Object.entries(k).reduce(
1664
- (u, [l, b]) => {
1664
+ (d, [r, b]) => {
1665
1665
  const R = {
1666
1666
  ...b,
1667
1667
  amount: Math.abs(b.amount)
1668
1668
  };
1669
- return u[l] = /// comment, because without it formatter makes code uglier
1669
+ return d[r] = /// comment, because without it formatter makes code uglier
1670
1670
  `${oe.toFormatString({
1671
1671
  value: R,
1672
1672
  precision: 4
1673
- })} ${m.unit.abbrev}`, u;
1673
+ })} ${u.unit.abbrev}`, d;
1674
1674
  },
1675
1675
  {}
1676
1676
  );
1677
1677
  }
1678
- function In(w, m) {
1679
- if (!m)
1678
+ function In(A, u) {
1679
+ if (!u)
1680
1680
  return null;
1681
1681
  let k = null;
1682
- const x = w.flatMap((j) => {
1683
- var u;
1684
- return ((u = j.skus) == null ? void 0 : u.filter((l) => l.sku._id === m._id)) ?? [];
1682
+ const S = A.flatMap((j) => {
1683
+ var d;
1684
+ return ((d = j.skus) == null ? void 0 : d.filter((r) => r.sku._id === u._id)) ?? [];
1685
1685
  }).flatMap((j) => {
1686
- var u;
1687
- return !j.history || ((u = j.history) == null ? void 0 : u.length) === 0 ? [] : j.history[0];
1686
+ var d;
1687
+ return !j.history || ((d = j.history) == null ? void 0 : d.length) === 0 ? [] : j.history[0];
1688
1688
  });
1689
- for (const j of x) {
1690
- const u = j.amounts;
1691
- for (const l of u) {
1692
- if (l.type !== ie.Enum.SALES)
1689
+ for (const j of S) {
1690
+ const d = j.amounts;
1691
+ for (const r of d) {
1692
+ if (r.type !== ie.Enum.SALES)
1693
1693
  continue;
1694
- const b = l.measurement ? oe.multiply([l.measurement.conversion, l.amount]) : l.amount;
1694
+ const b = r.measurement ? oe.multiply([r.measurement.conversion, r.amount]) : r.amount;
1695
1695
  k ?? (k = oe.fromNumber(0)), k = oe.add([k, b]);
1696
1696
  }
1697
1697
  }
1698
1698
  return k != null ? (k.amount = Math.abs(k.amount), `${oe.toFormatString({
1699
1699
  value: k,
1700
1700
  precision: 4
1701
- })} ${m.unit.abbrev}`) : null;
1701
+ })} ${u.unit.abbrev}`) : null;
1702
1702
  }
1703
- const Hn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Tn = { class: "flex-1 line-clamp-2" }, Pn = { class: "flex flex-col gap-32 w-full h-full" }, Un = { class: "flex items-center relative gap-4" }, En = { class: "flex-1" }, Rn = {
1703
+ const Hn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Tn = { class: "flex-1 line-clamp-2" }, En = { class: "flex flex-col gap-32 w-full h-full" }, Un = { class: "flex items-center relative gap-4" }, Pn = { class: "flex-1" }, Rn = {
1704
1704
  key: 0,
1705
1705
  class: "flex-1 flex flex-col items-center gap-16"
1706
1706
  }, Nn = { class: "fm-typo-en-body-lg-400 translate-x-4" }, On = {
@@ -1709,7 +1709,7 @@ const Hn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Tn = {
1709
1709
  }, Ln = { class: "pb-16" }, Yn = { class: "fm-typo-cn-body-lg-600" }, zn = {
1710
1710
  class: "grid gap-12 fm-typo-en-body-md-400",
1711
1711
  style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
1712
- }, Gn = { class: "flex flex-col gap-1" }, Wn = { class: "text-fm-color-typo-secondary" }, Kn = { class: "font-bold" }, qn = { class: "flex flex-col gap-1" }, Xn = { class: "text-fm-color-typo-secondary flex" }, Jn = { class: "font-bold" }, Qn = { class: "flex flex-col gap-1" }, Zn = { class: "text-fm-color-typo-secondary" }, es = { class: "font-bold" }, ts = { class: "flex flex-col gap-1" }, os = { class: "text-fm-color-typo-secondary" }, ns = { class: "font-bold" }, ss = { class: "flex flex-col gap-1" }, as = { class: "text-fm-color-typo-secondary" }, ls = { class: "font-bold" }, rs = { class: "flex flex-col gap-1" }, is = { class: "text-fm-color-typo-secondary" }, us = { class: "font-bold" }, cs = { class: "flex flex-col gap-1" }, ds = { class: "text-fm-color-typo-secondary" }, ms = { class: "font-bold" }, fs = { class: "flex flex-col gap-1" }, vs = { class: "text-fm-color-typo-secondary" }, ps = { class: "font-bold" }, ys = { class: "flex flex-col gap-1" }, _s = { class: "text-fm-color-typo-secondary" }, ks = { class: "font-bold" }, hs = {
1712
+ }, Gn = { class: "flex flex-col gap-1" }, Wn = { class: "text-fm-color-typo-secondary" }, Kn = { class: "font-bold" }, qn = { class: "flex flex-col gap-1" }, Xn = { class: "text-fm-color-typo-secondary flex" }, Jn = { class: "font-bold" }, Qn = { class: "flex flex-col gap-1" }, Zn = { class: "text-fm-color-typo-secondary" }, es = { class: "font-bold" }, ts = { class: "flex flex-col gap-1" }, os = { class: "text-fm-color-typo-secondary" }, ns = { class: "font-bold" }, ss = { class: "flex flex-col gap-1" }, as = { class: "text-fm-color-typo-secondary" }, rs = { class: "font-bold" }, ls = { class: "flex flex-col gap-1" }, is = { class: "text-fm-color-typo-secondary" }, us = { class: "font-bold" }, cs = { class: "flex flex-col gap-1" }, ds = { class: "text-fm-color-typo-secondary" }, ms = { class: "font-bold" }, fs = { class: "flex flex-col gap-1" }, vs = { class: "text-fm-color-typo-secondary" }, ps = { class: "font-bold" }, ys = { class: "flex flex-col gap-1" }, _s = { class: "text-fm-color-typo-secondary" }, ks = { class: "font-bold" }, hs = {
1713
1713
  key: 0,
1714
1714
  class: "flex flex-col gap-8"
1715
1715
  }, bs = { class: "flex" }, gs = { class: "flex-1 flex flex-col gap-1" }, xs = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Ss = { class: "font-bold" }, ws = { class: "flex-1 flex flex-col gap-1" }, As = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Fs = { class: "flex flex-col gap-1" }, $s = { class: "font-bold" }, js = {
@@ -1722,238 +1722,238 @@ const Hn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Tn = {
1722
1722
  show: { type: Boolean }
1723
1723
  },
1724
1724
  emits: ["update:show"],
1725
- setup(w) {
1726
- const m = Xe(), k = Oe(), p = Ae(), x = an(), j = Se(), u = io(), { t: l } = pe(), b = w, R = Y(!1), C = we(), r = Y("adjustment"), a = Y([
1725
+ setup(A) {
1726
+ const u = Xe(), k = Oe(), y = Ae(), S = an(), j = Se(), d = io(), { t: r } = pe(), b = A, R = Y(!1), C = we(), l = Y("adjustment"), a = Y([
1727
1727
  { label: "Adjustment (Default)", value: "adjustment" }
1728
- ]), D = Y([]), c = Y(ao(0));
1729
- async function S() {
1728
+ ]), D = Y([]), m = Y(ao(0));
1729
+ async function w() {
1730
1730
  R.value = !0;
1731
1731
  try {
1732
1732
  await N(), await k.readStockBalance();
1733
- } catch (i) {
1733
+ } catch (c) {
1734
1734
  C.open({
1735
1735
  title: "Something went wrong",
1736
1736
  message: "Cannot fetch stock history. Please try again.",
1737
1737
  type: "error"
1738
- }), console.log("failed at fetching item adjustment history", b.sku, c, i);
1738
+ }), console.log("failed at fetching item adjustment history", b.sku, m, c);
1739
1739
  } finally {
1740
1740
  R.value = !1;
1741
1741
  }
1742
1742
  }
1743
1743
  qe(() => {
1744
- S();
1745
- }), Fe([() => c.value, () => b.sku], () => {
1746
- S();
1744
+ w();
1745
+ }), Fe([() => m.value, () => b.sku], () => {
1746
+ w();
1747
1747
  });
1748
1748
  const o = Y([]), t = Y([]), n = Y(new Array());
1749
- function $(i, h) {
1750
- return h === "day" ? so(i) : wt(i);
1749
+ function $(c, h) {
1750
+ return h === "day" ? so(c) : wt(c);
1751
1751
  }
1752
- function P(i, h) {
1753
- const y = i.reduce(
1754
- (f, d) => {
1755
- const F = d.effectiveAt ?? Te(d._id);
1756
- if (!F)
1757
- return f;
1758
- const E = $(new Date(F), h);
1759
- return f[E] ?? (f[E] = []), f[E].push(d), f;
1752
+ function E(c, h) {
1753
+ const f = c.reduce(
1754
+ (v, i) => {
1755
+ const x = i.effectiveAt ?? Te(i._id);
1756
+ if (!x)
1757
+ return v;
1758
+ const P = $(new Date(x), h);
1759
+ return v[P] ?? (v[P] = []), v[P].push(i), v;
1760
1760
  },
1761
1761
  {}
1762
1762
  );
1763
- return Object.keys(y).map((f) => ({
1764
- date: f,
1765
- adjustments: y[f]
1763
+ return Object.keys(f).map((v) => ({
1764
+ date: v,
1765
+ adjustments: f[v]
1766
1766
  }));
1767
1767
  }
1768
1768
  async function N() {
1769
- let i = await p.readStockAdjustment(
1769
+ let c = await y.readStockAdjustment(
1770
1770
  b.sku._id,
1771
- dt(new Date(c.value.startDate)).toISOString(),
1772
- mt(new Date(c.value.endDate)).toISOString()
1771
+ dt(new Date(m.value.startDate)).toISOString(),
1772
+ mt(new Date(m.value.endDate)).toISOString()
1773
1773
  );
1774
- o.value = i;
1775
- const h = i.filter(({ ref: y }) => y == null ? void 0 : y.startsWith("bill_")).map(({ ref: y }) => y);
1776
- await O(h), t.value = P(i, "day").map(({ date: y, adjustments: f }) => ({
1777
- date: y,
1778
- adjustments: f,
1779
- adjustmentsByTime: P(f, "minute")
1774
+ o.value = c;
1775
+ const h = c.filter(({ ref: f }) => f == null ? void 0 : f.startsWith("bill_")).map(({ ref: f }) => f);
1776
+ await O(h), t.value = E(c, "day").map(({ date: f, adjustments: v }) => ({
1777
+ date: f,
1778
+ adjustments: v,
1779
+ adjustmentsByTime: E(v, "minute")
1780
1780
  }));
1781
1781
  try {
1782
- const y = await p.readUnitCostHistory(
1782
+ const f = await y.readUnitCostHistory(
1783
1783
  b.sku._id,
1784
- dt(new Date(c.value.startDate)).toISOString(),
1785
- mt(new Date(c.value.endDate)).toISOString()
1784
+ dt(new Date(m.value.startDate)).toISOString(),
1785
+ mt(new Date(m.value.endDate)).toISOString()
1786
1786
  );
1787
- D.value = y;
1788
- const f = /* @__PURE__ */ new Set();
1789
- y.forEach((F) => {
1790
- f.add(F.mechanism);
1787
+ D.value = f;
1788
+ const v = /* @__PURE__ */ new Set();
1789
+ f.forEach((x) => {
1790
+ v.add(x.mechanism);
1791
1791
  });
1792
- const d = [{ label: "Default", value: "adjustment" }];
1793
- f.has(ge.Enum.weightedAverage) && d.push({
1792
+ const i = [{ label: "Default", value: "adjustment" }];
1793
+ v.has(ge.Enum.weightedAverage) && i.push({
1794
1794
  label: "Weighted Average (Beta)",
1795
1795
  value: ge.Enum.weightedAverage
1796
- }), f.has(ge.Enum.netsuite) && d.push({ label: "NetSuite (Beta)", value: ge.Enum.netsuite }), f.has(ge.Enum["netsuite-average"]) && d.push({
1796
+ }), v.has(ge.Enum.netsuite) && i.push({ label: "NetSuite (Beta)", value: ge.Enum.netsuite }), v.has(ge.Enum["netsuite-average"]) && i.push({
1797
1797
  label: "NetSuite Average (Beta)",
1798
1798
  value: ge.Enum["netsuite-average"]
1799
- }), a.value = d, !f.has(r.value) && r.value !== "adjustment" && (r.value = "adjustment");
1800
- } catch (y) {
1801
- console.error("Failed to fetch unit cost history:", y);
1799
+ }), a.value = i, !v.has(l.value) && l.value !== "adjustment" && (l.value = "adjustment");
1800
+ } catch (f) {
1801
+ console.error("Failed to fetch unit cost history:", f);
1802
1802
  }
1803
1803
  }
1804
- async function O(i) {
1805
- i.length && (n.value = await x.findBillsById(i).catch((h) => {
1806
- var d;
1804
+ async function O(c) {
1805
+ c.length && (n.value = await S.findBillsById(c).catch((h) => {
1806
+ var i;
1807
1807
  console.error("Error on using latest bill API, retrying using legacy api", h);
1808
- const y = ((d = m.currentBusiness.value) == null ? void 0 : d._id) ?? "", f = j.currentLocation.doc._id;
1809
- return x.findBillsByBusinessId(y, [f], i);
1808
+ const f = ((i = u.currentBusiness.value) == null ? void 0 : i._id) ?? "", v = j.currentLocation.doc._id;
1809
+ return S.findBillsByBusinessId(f, [v], c);
1810
1810
  }));
1811
1811
  }
1812
1812
  const L = T(() => {
1813
- const i = o.value, h = b.sku;
1814
- return Mn(i, h);
1813
+ const c = o.value, h = b.sku;
1814
+ return Mn(c, h);
1815
1815
  }), X = T(() => {
1816
- const i = o.value, h = b.sku;
1817
- return In(i, h);
1816
+ const c = o.value, h = b.sku;
1817
+ return In(c, h);
1818
1818
  }), z = T(() => {
1819
- const i = [...o.value].computeFirst((y) => {
1820
- var d, F;
1821
- const f = (F = (d = y.skus) == null ? void 0 : d.find) == null ? void 0 : F.call(d, (E) => E.sku._id === b.sku._id);
1822
- return f == null ? void 0 : f.fromBalance;
1819
+ const c = [...o.value].computeFirst((f) => {
1820
+ var i, x;
1821
+ const v = (x = (i = f.skus) == null ? void 0 : i.find) == null ? void 0 : x.call(i, (P) => P.sku._id === b.sku._id);
1822
+ return v == null ? void 0 : v.fromBalance;
1823
1823
  }) ?? {
1824
1824
  amount: 0,
1825
1825
  precision: 0
1826
1826
  }, h = b.sku;
1827
1827
  return h ? `${oe.toFormatString({
1828
- value: i,
1828
+ value: c,
1829
1829
  precision: 4
1830
1830
  })} ${h.unit.abbrev}` : "";
1831
1831
  }), K = T(() => {
1832
- const i = [...o.value].reverse().computeFirst((y) => {
1833
- var d, F;
1834
- const f = (F = (d = y.skus) == null ? void 0 : d.find) == null ? void 0 : F.call(d, (E) => E.sku._id === b.sku._id);
1835
- return f == null ? void 0 : f.toBalance;
1832
+ const c = [...o.value].reverse().computeFirst((f) => {
1833
+ var i, x;
1834
+ const v = (x = (i = f.skus) == null ? void 0 : i.find) == null ? void 0 : x.call(i, (P) => P.sku._id === b.sku._id);
1835
+ return v == null ? void 0 : v.toBalance;
1836
1836
  }) ?? {
1837
1837
  amount: 0,
1838
1838
  precision: 0
1839
1839
  }, h = b.sku;
1840
- return h ? `${oe.toFormatString({ value: i, precision: 4 })} ${h.unit.abbrev}` : "";
1840
+ return h ? `${oe.toFormatString({ value: c, precision: 4 })} ${h.unit.abbrev}` : "";
1841
1841
  }), U = T(() => {
1842
- var y;
1843
- const h = o.value.flatMap((f) => {
1844
- var d;
1845
- return ((d = f.skus) == null ? void 0 : d.flatMap((F) => F.amounts)) ?? [];
1846
- }).filter((f) => f.amount.amount < 0).reduce(
1847
- (f, d) => {
1848
- const F = d.cost;
1849
- if (!F) return f;
1850
- const E = {
1851
- ...Wt(f, Math.max(f.precision, F.precision)),
1852
- currency: F.currency
1842
+ var f;
1843
+ const h = o.value.flatMap((v) => {
1844
+ var i;
1845
+ return ((i = v.skus) == null ? void 0 : i.flatMap((x) => x.amounts)) ?? [];
1846
+ }).filter((v) => v.amount.amount < 0).reduce(
1847
+ (v, i) => {
1848
+ const x = i.cost;
1849
+ if (!x) return v;
1850
+ const P = {
1851
+ ...Wt(v, Math.max(v.precision, x.precision)),
1852
+ currency: x.currency
1853
1853
  };
1854
1854
  return {
1855
- ...Qe(E, F),
1856
- currency: f.currency
1855
+ ...Qe(P, x),
1856
+ currency: v.currency
1857
1857
  };
1858
1858
  },
1859
1859
  {
1860
1860
  amount: 0,
1861
1861
  precision: 0,
1862
- currency: Ce((y = m.currentCountry) == null ? void 0 : y.value)
1862
+ currency: Ce((f = u.currentCountry) == null ? void 0 : f.value)
1863
1863
  }
1864
1864
  );
1865
1865
  return Me(h, !1, h.precision);
1866
1866
  });
1867
1867
  function Z() {
1868
- const { startDate: i, endDate: h } = oo(c.value);
1869
- i !== null && h !== null && (c.value = {
1870
- startDate: i,
1868
+ const { startDate: c, endDate: h } = oo(m.value);
1869
+ c !== null && h !== null && (m.value = {
1870
+ startDate: c,
1871
1871
  endDate: h
1872
1872
  });
1873
1873
  }
1874
- const le = T(() => l("inventory.ingredient.valuationMethod.WAVG"));
1875
- function g(i, h) {
1876
- if (r.value === "adjustment")
1874
+ const re = T(() => r("inventory.ingredient.valuationMethod.WAVG"));
1875
+ function g(c, h) {
1876
+ if (l.value === "adjustment")
1877
1877
  return null;
1878
- const y = D.value.filter(
1879
- (F) => F.mechanism === r.value && F.skuId === b.sku._id
1878
+ const f = D.value.filter(
1879
+ (x) => x.mechanism === l.value && x.skuId === b.sku._id
1880
1880
  );
1881
- if (y.length === 0) return null;
1882
- const f = y.find((F) => {
1883
- const E = F.meta;
1884
- return (E == null ? void 0 : E.adjustmentId) === i;
1881
+ if (f.length === 0) return null;
1882
+ const v = f.find((x) => {
1883
+ const P = x.meta;
1884
+ return (P == null ? void 0 : P.adjustmentId) === c;
1885
1885
  });
1886
- if (f) return f.cost;
1887
- const d = [...y].filter((F) => new Date(F.snapshotAt) <= new Date(h)).sort((F, E) => new Date(E.snapshotAt).getTime() - new Date(F.snapshotAt).getTime());
1888
- return d.length > 0 ? d[0].cost : null;
1886
+ if (v) return v.cost;
1887
+ const i = [...f].filter((x) => new Date(x.snapshotAt) <= new Date(h)).sort((x, P) => new Date(P.snapshotAt).getTime() - new Date(x.snapshotAt).getTime());
1888
+ return i.length > 0 ? i[0].cost : null;
1889
1889
  }
1890
- const A = T(() => {
1891
- var f, d, F, E, ee, ae;
1892
- const i = [...o.value].reverse().find((Q) => {
1890
+ const F = T(() => {
1891
+ var v, i, x, P, ee, ae;
1892
+ const c = [...o.value].reverse().find((Q) => {
1893
1893
  var W, te;
1894
- return (te = (W = Q.skus) == null ? void 0 : W.find) == null ? void 0 : te.call(W, (re) => re.sku._id === b.sku._id);
1894
+ return (te = (W = Q.skus) == null ? void 0 : W.find) == null ? void 0 : te.call(W, (le) => le.sku._id === b.sku._id);
1895
1895
  });
1896
- if (!i) return "No data";
1897
- const h = (f = i.skus) == null ? void 0 : f.find((Q) => Q.sku._id === b.sku._id);
1896
+ if (!c) return "No data";
1897
+ const h = (v = c.skus) == null ? void 0 : v.find((Q) => Q.sku._id === b.sku._id);
1898
1898
  if (!h) return "No data";
1899
- const y = h.toBalance;
1900
- if (r.value === "adjustment") {
1899
+ const f = h.toBalance;
1900
+ if (l.value === "adjustment") {
1901
1901
  const Q = [...h.amounts].reverse()[0], W = {
1902
- amount: ((d = Q.cost) == null ? void 0 : d.amount) ?? 0,
1903
- precision: ((F = Q.cost) == null ? void 0 : F.precision) ?? 0
1904
- }, te = Q.amount, re = te.amount == 0 ? oe.fromNumber(0) : oe.divide([W, te]);
1902
+ amount: ((i = Q.cost) == null ? void 0 : i.amount) ?? 0,
1903
+ precision: ((x = Q.cost) == null ? void 0 : x.precision) ?? 0
1904
+ }, te = Q.amount, le = te.amount == 0 ? oe.fromNumber(0) : oe.divide([W, te]);
1905
1905
  return {
1906
- ...oe.multiply([re, y]),
1907
- currency: ((E = Q.cost) == null ? void 0 : E.currency) || Ce(((ee = m.currentCountry) == null ? void 0 : ee.value) ?? rt)
1906
+ ...oe.multiply([le, f]),
1907
+ currency: ((P = Q.cost) == null ? void 0 : P.currency) || Ce(((ee = u.currentCountry) == null ? void 0 : ee.value) ?? lt)
1908
1908
  };
1909
1909
  } else {
1910
- const Q = i.effectiveAt ?? Te(i._id), W = g(
1911
- i._id,
1910
+ const Q = c.effectiveAt ?? Te(c._id), W = g(
1911
+ c._id,
1912
1912
  Q ?? (/* @__PURE__ */ new Date()).toISOString()
1913
1913
  );
1914
1914
  if (!W) return "No data";
1915
1915
  const te = oe.fromDinero(W);
1916
1916
  return {
1917
- ...oe.multiply([te, y]),
1918
- currency: W.currency || Ce(((ae = m.currentCountry) == null ? void 0 : ae.value) ?? rt)
1917
+ ...oe.multiply([te, f]),
1918
+ currency: W.currency || Ce(((ae = u.currentCountry) == null ? void 0 : ae.value) ?? lt)
1919
1919
  };
1920
1920
  }
1921
1921
  }), G = T(() => {
1922
- var y;
1923
- const i = [...o.value].reverse().computeFirst((f) => {
1924
- var F, E;
1925
- const d = (E = (F = f.skus) == null ? void 0 : F.find) == null ? void 0 : E.call(F, (ee) => ee.sku._id === b.sku._id);
1926
- return d == null ? void 0 : d.toCostBalances;
1922
+ var f;
1923
+ const c = [...o.value].reverse().computeFirst((v) => {
1924
+ var x, P;
1925
+ const i = (P = (x = v.skus) == null ? void 0 : x.find) == null ? void 0 : P.call(x, (ee) => ee.sku._id === b.sku._id);
1926
+ return i == null ? void 0 : i.toCostBalances;
1927
1927
  });
1928
- return i ? {
1929
- ...i.reduce((f, d) => oe.add([f, oe.fromDinero(d.cost)]), {
1928
+ return c ? {
1929
+ ...c.reduce((v, i) => oe.add([v, oe.fromDinero(i.cost)]), {
1930
1930
  amount: 0,
1931
1931
  precision: 0
1932
1932
  }),
1933
- currency: Ce((y = m.currentCountry) == null ? void 0 : y.value)
1933
+ currency: Ce((f = u.currentCountry) == null ? void 0 : f.value)
1934
1934
  } : "No data";
1935
- }), H = T(() => b.sku.valuation === it.Enum.FIFO ? G.value : A.value);
1935
+ }), H = T(() => b.sku.valuation === it.Enum.FIFO ? G.value : F.value);
1936
1936
  function J() {
1937
- const { startDate: i, endDate: h } = no(c.value);
1938
- i !== null && h !== null && (c.value = {
1939
- startDate: i,
1937
+ const { startDate: c, endDate: h } = no(m.value);
1938
+ c !== null && h !== null && (m.value = {
1939
+ startDate: c,
1940
1940
  endDate: h
1941
1941
  });
1942
1942
  }
1943
1943
  const I = Ye(b, "show");
1944
- return (i, h) => {
1945
- const y = B("FmButton"), f = B("FmField"), d = B("FmDateRangePicker"), F = B("FmSpacer"), E = B("FmCircularProgress"), ee = B("FmIcon"), ae = B("FmTooltip"), Q = B("FmMenuDivider"), W = B("FmChip"), te = B("FmSelect"), re = B("FmCardSection"), ce = B("FmCard"), je = B("FmSideSheet");
1944
+ return (c, h) => {
1945
+ const f = B("FmButton"), v = B("FmField"), i = B("FmDateRangePicker"), x = B("FmSpacer"), P = B("FmCircularProgress"), ee = B("FmIcon"), ae = B("FmTooltip"), Q = B("FmMenuDivider"), W = B("FmChip"), te = B("FmSelect"), le = B("FmCardSection"), ce = B("FmCard"), je = B("FmSideSheet");
1946
1946
  return V(), ne(je, {
1947
1947
  "dismiss-away": "",
1948
1948
  modelValue: s(I),
1949
- "onUpdate:modelValue": h[5] || (h[5] = (me) => Ee(I) ? I.value = me : null),
1949
+ "onUpdate:modelValue": h[5] || (h[5] = (me) => Pe(I) ? I.value = me : null),
1950
1950
  "close-button": !1,
1951
1951
  "max-width": 560
1952
1952
  }, {
1953
1953
  "side-sheet-header": M(() => [
1954
1954
  e("div", Hn, [
1955
- e("div", Tn, v(s(l)("inventory.stock.history.title", [i.sku.name])), 1),
1956
- _(y, {
1955
+ e("div", Tn, p(s(r)("inventory.stock.history.title", [c.sku.name])), 1),
1956
+ _(f, {
1957
1957
  variant: "tertiary",
1958
1958
  "prepend-icon": "close",
1959
1959
  onClick: h[0] || (h[0] = (me) => I.value = !1)
@@ -1963,24 +1963,24 @@ const Hn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Tn = {
1963
1963
  default: M(() => {
1964
1964
  var me;
1965
1965
  return [
1966
- e("div", Pn, [
1966
+ e("div", En, [
1967
1967
  e("div", Un, [
1968
- e("div", En, [
1969
- _(d, {
1970
- modelValue: c.value,
1971
- "onUpdate:modelValue": h[1] || (h[1] = (de) => c.value = de),
1968
+ e("div", Pn, [
1969
+ _(i, {
1970
+ modelValue: m.value,
1971
+ "onUpdate:modelValue": h[1] || (h[1] = (de) => m.value = de),
1972
1972
  "show-predefined-range": "",
1973
1973
  "start-label": "",
1974
1974
  "end-label": "",
1975
1975
  "z-index": 50
1976
1976
  }, {
1977
1977
  "trigger-button": M(({ opened: de }) => [
1978
- _(f, {
1978
+ _(v, {
1979
1979
  "prepend-icon": "calendar_month",
1980
1980
  focused: de
1981
1981
  }, {
1982
1982
  default: M(() => [
1983
- ye(v(c.value.startDate) + " - " + v(c.value.endDate), 1)
1983
+ ye(p(m.value.startDate) + " - " + p(m.value.endDate), 1)
1984
1984
  ]),
1985
1985
  _: 2
1986
1986
  }, 1032, ["focused"])
@@ -1988,39 +1988,39 @@ const Hn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Tn = {
1988
1988
  _: 1
1989
1989
  }, 8, ["modelValue"])
1990
1990
  ]),
1991
- _(y, {
1991
+ _(f, {
1992
1992
  variant: "tertiary",
1993
1993
  onClick: h[2] || (h[2] = (de) => Z()),
1994
1994
  "prepend-icon": "navigate_before"
1995
1995
  }),
1996
- _(y, {
1996
+ _(f, {
1997
1997
  variant: "tertiary",
1998
1998
  onClick: h[3] || (h[3] = (de) => J()),
1999
1999
  "prepend-icon": "navigate_next"
2000
2000
  })
2001
2001
  ]),
2002
2002
  R.value ? (V(), q("div", Rn, [
2003
- _(F),
2004
- _(E, { size: "xl" }),
2005
- e("div", Nn, v(s(l)("inventory.stock.history.loading")), 1),
2006
- _(F),
2007
- _(F)
2003
+ _(x),
2004
+ _(P, { size: "xl" }),
2005
+ e("div", Nn, p(s(r)("inventory.stock.history.loading")), 1),
2006
+ _(x),
2007
+ _(x)
2008
2008
  ])) : t.value && ((me = t.value) == null ? void 0 : me.length) > 0 ? (V(), q("div", On, [
2009
2009
  _(ce, { variant: "outlined" }, {
2010
2010
  default: M(() => [
2011
- _(re, { class: "flex flex-col gap-4" }, {
2011
+ _(le, { class: "flex flex-col gap-4" }, {
2012
2012
  default: M(() => [
2013
2013
  e("div", Ln, [
2014
- e("div", Yn, v(s(l)("inventory.stock.history.summary.title")), 1)
2014
+ e("div", Yn, p(s(r)("inventory.stock.history.summary.title")), 1)
2015
2015
  ]),
2016
2016
  e("div", zn, [
2017
2017
  e("div", Gn, [
2018
- e("div", Wn, v(s(l)("inventory.stock.history.summary.totalPurchase")), 1),
2019
- e("div", Kn, v(L.value.PURCHASE), 1)
2018
+ e("div", Wn, p(s(r)("inventory.stock.history.summary.totalPurchase")), 1),
2019
+ e("div", Kn, p(L.value.PURCHASE), 1)
2020
2020
  ]),
2021
2021
  e("div", qn, [
2022
2022
  e("div", Xn, [
2023
- ye(v(s(l)("inventory.stock.history.summary.totalSales")) + "  ", 1),
2023
+ ye(p(s(r)("inventory.stock.history.summary.totalSales")) + "  ", 1),
2024
2024
  X.value != null ? (V(), ne(ae, {
2025
2025
  key: 0,
2026
2026
  variant: "plain",
@@ -2037,49 +2037,49 @@ const Hn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Tn = {
2037
2037
  _: 1
2038
2038
  }, 8, ["content"])) : se("", !0)
2039
2039
  ]),
2040
- e("div", Jn, v(L.value.SALES), 1)
2040
+ e("div", Jn, p(L.value.SALES), 1)
2041
2041
  ]),
2042
2042
  e("div", Qn, [
2043
- e("div", Zn, v(s(l)("inventory.stock.history.summary.totalLose")), 1),
2044
- e("div", es, v(L.value.LOSE), 1)
2043
+ e("div", Zn, p(s(r)("inventory.stock.history.summary.totalLose")), 1),
2044
+ e("div", es, p(L.value.LOSE), 1)
2045
2045
  ]),
2046
2046
  e("div", ts, [
2047
- e("div", os, v(s(l)("inventory.stock.history.summary.totalRequest")), 1),
2048
- e("div", ns, v(L.value.REQUEST), 1)
2047
+ e("div", os, p(s(r)("inventory.stock.history.summary.totalRequest")), 1),
2048
+ e("div", ns, p(L.value.REQUEST), 1)
2049
2049
  ]),
2050
2050
  e("div", ss, [
2051
- e("div", as, v(s(l)("inventory.stock.history.summary.totalReceive")), 1),
2052
- e("div", ls, v(L.value.RECEIVE), 1)
2051
+ e("div", as, p(s(r)("inventory.stock.history.summary.totalReceive")), 1),
2052
+ e("div", rs, p(L.value.RECEIVE), 1)
2053
2053
  ]),
2054
- e("div", rs, [
2055
- e("div", is, v(s(l)("inventory.stock.history.summary.totalConvert")), 1),
2056
- e("div", us, v(L.value.CONVERT), 1)
2054
+ e("div", ls, [
2055
+ e("div", is, p(s(r)("inventory.stock.history.summary.totalConvert")), 1),
2056
+ e("div", us, p(L.value.CONVERT), 1)
2057
2057
  ]),
2058
2058
  e("div", cs, [
2059
- e("div", ds, v(s(l)("inventory.stock.history.summary.totalDamage")), 1),
2060
- e("div", ms, v(L.value.DAMAGE), 1)
2059
+ e("div", ds, p(s(r)("inventory.stock.history.summary.totalDamage")), 1),
2060
+ e("div", ms, p(L.value.DAMAGE), 1)
2061
2061
  ]),
2062
2062
  e("div", fs, [
2063
- e("div", vs, v(s(l)("inventory.stock.history.summary.openingBalance")), 1),
2064
- e("div", ps, v(z.value), 1)
2063
+ e("div", vs, p(s(r)("inventory.stock.history.summary.openingBalance")), 1),
2064
+ e("div", ps, p(z.value), 1)
2065
2065
  ]),
2066
2066
  e("div", ys, [
2067
- e("div", _s, v(s(l)("inventory.stock.history.summary.lastStockBalance")), 1),
2068
- e("div", ks, v(K.value), 1)
2067
+ e("div", _s, p(s(r)("inventory.stock.history.summary.lastStockBalance")), 1),
2068
+ e("div", ks, p(K.value), 1)
2069
2069
  ])
2070
2070
  ]),
2071
- s(u).enableTotalCost ? (V(), q("div", hs, [
2071
+ s(d).enableTotalCost ? (V(), q("div", hs, [
2072
2072
  _(Q, { class: "w-full" }),
2073
2073
  e("div", bs, [
2074
2074
  e("div", gs, [
2075
2075
  _(ut, { "z-index": 50 }, {
2076
2076
  default: M(() => [
2077
2077
  e("div", xs, [
2078
- ye(v(s(l)("inventory.stock.history.estimatedValue")) + " ", 1),
2078
+ ye(p(s(r)("inventory.stock.history.estimatedValue")) + " ", 1),
2079
2079
  _(ae, {
2080
2080
  variant: "plain",
2081
2081
  placement: "top",
2082
- content: `[${le.value}] ${s(l)("inventory.stock.history.estimatedValueTooltip")}`,
2082
+ content: `[${re.value}] ${s(r)("inventory.stock.history.estimatedValueTooltip")}`,
2083
2083
  "z-index": 50
2084
2084
  }, {
2085
2085
  default: M(() => [
@@ -2095,18 +2095,18 @@ const Hn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Tn = {
2095
2095
  _: 1
2096
2096
  }),
2097
2097
  e("div", Ss, [
2098
- i.sku.valuation === s(it).Enum.FIFO ? (V(), q(ue, { key: 0 }, [
2098
+ c.sku.valuation === s(it).Enum.FIFO ? (V(), q(ue, { key: 0 }, [
2099
2099
  _(W, {
2100
2100
  label: "FIFO",
2101
2101
  compact: ""
2102
2102
  }),
2103
- ye(" " + v(typeof H.value != "string" ? s(Me)(
2103
+ ye(" " + p(typeof H.value != "string" ? s(Me)(
2104
2104
  H.value,
2105
2105
  !1,
2106
2106
  H.value.precision
2107
2107
  ) : H.value), 1)
2108
2108
  ], 64)) : (V(), q(ue, { key: 1 }, [
2109
- ye(v(typeof H.value != "string" ? s(Me)(
2109
+ ye(p(typeof H.value != "string" ? s(Me)(
2110
2110
  H.value,
2111
2111
  !1,
2112
2112
  H.value.precision
@@ -2114,8 +2114,8 @@ const Hn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Tn = {
2114
2114
  ], 64))
2115
2115
  ]),
2116
2116
  _(te, {
2117
- modelValue: r.value,
2118
- "onUpdate:modelValue": h[4] || (h[4] = (de) => r.value = de),
2117
+ modelValue: l.value,
2118
+ "onUpdate:modelValue": h[4] || (h[4] = (de) => l.value = de),
2119
2119
  items: a.value,
2120
2120
  compact: "",
2121
2121
  size: "sm",
@@ -2126,14 +2126,14 @@ const Hn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Tn = {
2126
2126
  _(ut, { "z-index": 50 }, {
2127
2127
  default: M(() => [
2128
2128
  e("div", As, [
2129
- ye(v(s(l)("inventory.stock.history.costSold")) + " ", 1),
2129
+ ye(p(s(r)("inventory.stock.history.costSold")) + " ", 1),
2130
2130
  _(ae, {
2131
2131
  variant: "plain",
2132
2132
  placement: "top",
2133
2133
  "z-index": 50
2134
2134
  }, {
2135
2135
  content: M(() => [
2136
- e("div", Fs, v(s(l)("inventory.stock.history.costSoldTooltip")), 1)
2136
+ e("div", Fs, p(s(r)("inventory.stock.history.costSoldTooltip")), 1)
2137
2137
  ]),
2138
2138
  default: M(() => [
2139
2139
  _(ee, {
@@ -2147,7 +2147,7 @@ const Hn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Tn = {
2147
2147
  ]),
2148
2148
  _: 1
2149
2149
  }),
2150
- e("div", $s, v(U.value), 1)
2150
+ e("div", $s, p(U.value), 1)
2151
2151
  ])
2152
2152
  ])
2153
2153
  ])) : se("", !0)
@@ -2161,28 +2161,28 @@ const Hn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Tn = {
2161
2161
  (V(!0), q(ue, null, fe(t.value, (de) => (V(), q(ue, {
2162
2162
  key: de.date
2163
2163
  }, [
2164
- i.sku ? (V(), ne(Bn, {
2164
+ c.sku ? (V(), ne(Bn, {
2165
2165
  key: 0,
2166
2166
  record: de,
2167
- sku: i.sku,
2167
+ sku: c.sku,
2168
2168
  bills: n.value,
2169
2169
  "unit-cost-history": D.value,
2170
- "cost-mechanism": r.value,
2171
- onRefreshHistory: S
2170
+ "cost-mechanism": l.value,
2171
+ onRefreshHistory: w
2172
2172
  }, null, 8, ["record", "sku", "bills", "unit-cost-history", "cost-mechanism"])) : se("", !0)
2173
2173
  ], 64))), 128))
2174
2174
  ])) : (V(), q("div", js, [
2175
- _(F),
2175
+ _(x),
2176
2176
  e("div", null, [
2177
2177
  e("img", {
2178
- src: s(ro),
2178
+ src: s(lo),
2179
2179
  alt: "List is empty"
2180
2180
  }, null, 8, Vs)
2181
2181
  ]),
2182
- e("div", Cs, v(s(l)("inventory.stock.history.noRecords")), 1),
2183
- e("div", Ds, v(s(l)("inventory.stock.history.changeDateRange")), 1),
2184
- _(F),
2185
- _(F)
2182
+ e("div", Cs, p(s(r)("inventory.stock.history.noRecords")), 1),
2183
+ e("div", Ds, p(s(r)("inventory.stock.history.changeDateRange")), 1),
2184
+ _(x),
2185
+ _(x)
2186
2186
  ]))
2187
2187
  ])
2188
2188
  ];
@@ -2198,20 +2198,20 @@ const Hn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, Tn = {
2198
2198
  permissions: { default: void 0 },
2199
2199
  mode: { default: "all" }
2200
2200
  },
2201
- setup(w) {
2202
- const m = w, k = T(() => {
2203
- const x = [];
2204
- return m.permission && x.push(m.permission), m.permissions && x.push(...m.permissions), x;
2201
+ setup(A) {
2202
+ const u = A, k = T(() => {
2203
+ const S = [];
2204
+ return u.permission && S.push(u.permission), u.permissions && S.push(...u.permissions), S;
2205
2205
  });
2206
2206
  Vt(() => {
2207
2207
  });
2208
- const { hasPermission: p } = At(k, () => m.mode);
2209
- return (x, j) => s(p) ? st(x.$slots, "default", { key: 0 }) : st(x.$slots, "fallback", { key: 1 });
2208
+ const { hasPermission: y } = At(k, () => u.mode);
2209
+ return (S, j) => s(y) ? st(S.$slots, "default", { key: 0 }) : st(S.$slots, "fallback", { key: 1 });
2210
2210
  }
2211
2211
  });
2212
- function Is(w) {
2213
- const m = Ut(), k = Se(), p = Y(!1), x = Y(null), j = Y(null);
2214
- let u = null, l = !1, b = !1;
2212
+ function Is(A) {
2213
+ const u = Ut(), k = Se(), y = Y(!1), S = Y(null), j = Y(null);
2214
+ let d = null, r = !1, b = !1;
2215
2215
  function R() {
2216
2216
  if (b) return;
2217
2217
  const a = k.currentLocationDBName;
@@ -2220,11 +2220,11 @@ function Is(w) {
2220
2220
  const D = {
2221
2221
  type: "refresh-balance",
2222
2222
  params: { locationId: a }
2223
- }, { unsubscribe: c, initialState: S } = m.subscribe(
2223
+ }, { unsubscribe: m, initialState: w } = u.subscribe(
2224
2224
  D,
2225
2225
  C
2226
2226
  );
2227
- u = c, S.then((o) => {
2227
+ d = m, w.then((o) => {
2228
2228
  o != null && o.initialState && C(o.initialState);
2229
2229
  }).catch((o) => {
2230
2230
  console.error("Failed to fetch refresh-balance initial state", o);
@@ -2233,89 +2233,94 @@ function Is(w) {
2233
2233
  async function C(a) {
2234
2234
  var D;
2235
2235
  if (!(!b || !a)) {
2236
- if (x.value = a, a.completedAt && (j.value = a.completedAt), a.message === "processing" || !a.completedAt && !a.message) {
2237
- l = !0, p.value = !0;
2236
+ if (S.value = a, a.completedAt && (j.value = a.completedAt), a.message === "processing" || !a.completedAt && !a.message) {
2237
+ r = !0, y.value = !0;
2238
2238
  return;
2239
2239
  }
2240
2240
  if (a.message === "completed" || a.completedAt) {
2241
- if (!l) return;
2242
- r();
2241
+ if (!r) return;
2242
+ l();
2243
2243
  try {
2244
- await w.onCompleted();
2245
- } catch (c) {
2246
- console.error("Failed to reload after refresh", c);
2244
+ await A.onCompleted();
2245
+ } catch (m) {
2246
+ console.error("Failed to reload after refresh", m);
2247
2247
  }
2248
2248
  return;
2249
2249
  }
2250
2250
  if (a.message === "error") {
2251
- const c = a.error ?? "Failed to refresh stock balance.";
2252
- r(), await ((D = w.onError) == null ? void 0 : D.call(w, c));
2251
+ const m = a.error ?? "Failed to refresh stock balance.";
2252
+ l(), await ((D = A.onError) == null ? void 0 : D.call(A, m));
2253
2253
  }
2254
2254
  }
2255
2255
  }
2256
- function r() {
2257
- u && (u(), u = null), b = !1, l = !1, p.value = !1, x.value = null;
2256
+ function l() {
2257
+ d && (d(), d = null), b = !1, r = !1, y.value = !1, S.value = null;
2258
2258
  }
2259
2259
  return Ct(() => {
2260
- r();
2260
+ l();
2261
2261
  }), {
2262
- refreshing: p,
2263
- refreshStatus: x,
2262
+ refreshing: y,
2263
+ refreshStatus: S,
2264
2264
  lastCompletedAt: j,
2265
2265
  startListening: R,
2266
- stopListening: r
2266
+ stopListening: l
2267
2267
  };
2268
2268
  }
2269
2269
  const Hs = {
2270
2270
  key: 0,
2271
2271
  class: "flex items-center gap-1"
2272
- }, Ts = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ps = { class: "flex flex-col gap-8" }, Us = { class: "flex flex-col" }, Es = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Rs = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, _a = /* @__PURE__ */ ve({
2272
+ }, Ts = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Es = { class: "flex flex-col gap-8" }, Us = { class: "flex flex-col" }, Ps = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Rs = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, _a = /* @__PURE__ */ ve({
2273
2273
  __name: "StockView",
2274
- setup(w) {
2275
- const { t: m } = pe(), k = Ne(), p = Se(), x = Oe(), j = Ft(), u = Ae(), l = gt(), b = co(), { columnDefs: R } = ko(), C = Xe(), { hasPermission: r } = At(
2276
- T(() => [{ action: De.Action.manage, subject: De.Subject.Business.inventory_stockAdjustment }])
2274
+ setup(A) {
2275
+ const { t: u } = pe(), k = Ne(), y = Se(), S = Oe(), j = Ft(), d = Ae(), r = gt(), b = co(), { columnDefs: R } = ko(), C = Xe(), { hasPermission: l } = At(
2276
+ T(() => [
2277
+ {
2278
+ action: De.Action.manage,
2279
+ subject: De.Subject.Business.inventory_stockAdjustment
2280
+ }
2281
+ ])
2277
2282
  ), a = T(
2278
2283
  () => {
2279
- var y;
2280
- return r.value || ((y = C.sessionUser.value) == null ? void 0 : y.role.isAdmin);
2284
+ var f;
2285
+ return l.value || ((f = C.sessionUser.value) == null ? void 0 : f.role.isAdmin);
2281
2286
  }
2282
- ), D = Le(), c = we();
2283
- p.watchLocation(X);
2284
- const S = T(
2287
+ ), D = Le(), m = we();
2288
+ y.watchLocation(X);
2289
+ const w = T(
2285
2290
  () => new Set(b.getAvailableItems(b.businessSubsidiaryId))
2286
- ), o = Y(!1), t = Y(!1), { refreshing: n, lastCompletedAt: $, startListening: P, stopListening: N } = Is({
2291
+ ), o = Y(!1), t = Y(!1), { refreshing: n, lastCompletedAt: $, startListening: E, stopListening: N } = Is({
2287
2292
  onCompleted: async () => {
2288
- await X(), t.value = !1, c.open({
2293
+ await X(), t.value = !1, m.open({
2289
2294
  title: "Balance refreshed",
2290
2295
  message: "Stock balance has been recalculated.",
2291
2296
  type: "success"
2292
2297
  });
2293
2298
  },
2294
- onError: (y) => {
2295
- t.value = !1, c.open({
2296
- title: "Refresh failed",
2297
- message: y,
2299
+ onError: (f) => {
2300
+ t.value = !1, console.log("Error refreshing stock balance", f), m.open({
2301
+ title: u("inventory.common.refreshFailed"),
2302
+ message: f || u("inventory.stock.stock_balance.refreshBalanceError"),
2298
2303
  type: "error"
2299
2304
  });
2300
2305
  }
2301
2306
  }), O = T(() => n.value || t.value);
2302
2307
  async function L() {
2303
- P();
2304
- const y = m("inventory.stock.stock_balance.refreshBalanceDescription"), f = $.value ? `${y}
2308
+ E();
2309
+ const f = u("inventory.stock.stock_balance.refreshBalanceDescription"), v = $.value ? `${f}
2305
2310
 
2306
- Last refreshed: ${new Date($.value).toLocaleString()}` : y;
2311
+ Last refreshed: ${new Date($.value).toLocaleString()}` : f;
2307
2312
  D.open({
2308
- title: m("inventory.stock.stock_balance.refreshBalance"),
2309
- message: f,
2313
+ title: u("inventory.stock.stock_balance.refreshBalance"),
2314
+ message: v,
2310
2315
  closeButton: !0,
2311
2316
  primaryActions: {
2312
- text: m("common.confirm"),
2317
+ text: u("common.confirm"),
2313
2318
  close: !1,
2314
2319
  isLoading: O,
2315
2320
  disabled: O
2316
2321
  },
2317
2322
  secondaryActions: {
2318
- text: m("common.close"),
2323
+ text: u("common.close"),
2319
2324
  close: !0,
2320
2325
  variant: "tertiary",
2321
2326
  disabled: O
@@ -2324,11 +2329,13 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : y;
2324
2329
  if (!t.value) {
2325
2330
  t.value = !0;
2326
2331
  try {
2327
- await u.recalculation.refreshCurrentBalances();
2328
- } catch (d) {
2329
- console.error("Failed to queue refresh balance", d), t.value = !1, c.open({
2330
- title: "Refresh failed",
2331
- message: "Failed to queue stock balance refresh. Please try again.",
2332
+ await d.recalculation.refreshCurrentBalances();
2333
+ } catch (i) {
2334
+ console.log("Failed to queue refresh balan22ce", typeof i);
2335
+ const x = typeof i == "object" ? JSON.stringify(i) : String(i);
2336
+ console.log("Error details:", x), t.value = !1, m.open({
2337
+ title: u("inventory.common.refreshFailed"),
2338
+ message: (i instanceof Error ? i.message : null) ?? u("inventory.stock.stock_balance.refreshBalanceError"),
2332
2339
  type: "error"
2333
2340
  });
2334
2341
  }
@@ -2338,16 +2345,16 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : y;
2338
2345
  });
2339
2346
  }
2340
2347
  async function X() {
2341
- if (p._currentLocation) {
2348
+ if (y._currentLocation) {
2342
2349
  o.value = !0;
2343
2350
  try {
2344
- await x.readStockBalance(), await x.readProductBalance(), await l.readStockEstimateBalance();
2345
- } catch (y) {
2346
- c.open({
2347
- title: m("inventory.stock.error.title"),
2348
- message: m("inventory.stock.error.message"),
2351
+ await S.readStockBalance(), await S.readProductBalance(), await r.readStockEstimateBalance();
2352
+ } catch (f) {
2353
+ m.open({
2354
+ title: u("inventory.stock.error.title"),
2355
+ message: u("inventory.stock.error.message"),
2349
2356
  type: "error"
2350
- }), console.error("error on fetch stock balance", y);
2357
+ }), console.error("error on fetch stock balance", f);
2351
2358
  } finally {
2352
2359
  o.value = !1;
2353
2360
  }
@@ -2371,23 +2378,23 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : y;
2371
2378
  }
2372
2379
  ]
2373
2380
  }), U = T(() => {
2374
- var d, F, E;
2375
- const y = K.value ? mo.build(K.value) : null, f = [];
2381
+ var i, x, P;
2382
+ const f = K.value ? mo.build(K.value) : null, v = [];
2376
2383
  for (const ee of k.skus) {
2377
2384
  let ae = !0;
2378
- if (b.isEnabled && le.value && S.value && ae && (ae = S.value.has(ee._id)), y && ae && (ae = fo(
2385
+ if (b.isEnabled && re.value && w.value && ae && (ae = w.value.has(ee._id)), f && ae && (ae = fo(
2379
2386
  {
2380
2387
  status: ee.isInactive ? "Inactive" : "Active"
2381
2388
  },
2382
- y
2389
+ f
2383
2390
  )), ae) {
2384
2391
  const Q = ee.trackingMeasurement;
2385
- let W = (F = (d = x.stockBalance.skus) == null ? void 0 : d.find(
2392
+ let W = (x = (i = S.stockBalance.skus) == null ? void 0 : i.find(
2386
2393
  (ce) => ce.id === ee._id
2387
- )) == null ? void 0 : F.balance, te = l.inventoryForecast.skus.find(
2394
+ )) == null ? void 0 : x.balance, te = r.inventoryForecast.skus.find(
2388
2395
  (ce) => ce.id === ee._id
2389
2396
  );
2390
- const re = {
2397
+ const le = {
2391
2398
  ...ee,
2392
2399
  balance: W ?? {
2393
2400
  amount: 0,
@@ -2395,39 +2402,39 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : y;
2395
2402
  },
2396
2403
  operator: te == null ? void 0 : te.operator,
2397
2404
  day: (te == null ? void 0 : te.depletionDays) ?? void 0,
2398
- trackingUnitAbbrev: Q ? ((E = ee.unit.measurements.find((ce) => ce.id === Q)) == null ? void 0 : E.abbrev) ?? "" : ee.unit.abbrev
2405
+ trackingUnitAbbrev: Q ? ((P = ee.unit.measurements.find((ce) => ce.id === Q)) == null ? void 0 : P.abbrev) ?? "" : ee.unit.abbrev
2399
2406
  };
2400
- f.push(re);
2407
+ v.push(le);
2401
2408
  }
2402
2409
  }
2403
- return f;
2404
- }), Z = Y(""), le = Y(!0), { breakpoints: g } = Lt(), A = T(() => g.value.xs || g.value.sm), G = T(() => A.value ? 10 : 20), H = Bt(), J = T(() => {
2405
- const y = [
2410
+ return v;
2411
+ }), Z = Y(""), re = Y(!0), { breakpoints: g } = Lt(), F = T(() => g.value.xs || g.value.sm), G = T(() => F.value ? 10 : 20), H = Bt(), J = T(() => {
2412
+ const f = [
2406
2413
  {
2407
- label: m("inventory.stock.stock_balance.refreshBalance"),
2414
+ label: u("inventory.stock.stock_balance.refreshBalance"),
2408
2415
  value: "refresh-balance",
2409
2416
  isPrimary: !0,
2410
2417
  prependIcon: "calculate"
2411
2418
  },
2412
2419
  {
2413
- label: m("inventory.common.refresh"),
2420
+ label: u("inventory.common.refresh"),
2414
2421
  value: "refresh"
2415
2422
  },
2416
2423
  {
2417
- label: m("inventory.common.export"),
2424
+ label: u("inventory.common.export"),
2418
2425
  value: "export"
2419
2426
  }
2420
2427
  ];
2421
- return a.value && y.push({
2422
- label: m("inventory.stock.stock_adjustment.title"),
2428
+ return a.value && f.push({
2429
+ label: u("inventory.stock.stock_adjustment.title"),
2423
2430
  value: "stockAdjustment"
2424
- }), y;
2431
+ }), f;
2425
2432
  }), I = Y(!1);
2426
- function i() {
2433
+ function c() {
2427
2434
  I.value = !0;
2428
2435
  }
2429
- function h(y) {
2430
- switch (y) {
2436
+ function h(f) {
2437
+ switch (f) {
2431
2438
  case "refresh-balance":
2432
2439
  return L();
2433
2440
  case "refresh":
@@ -2435,48 +2442,48 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : y;
2435
2442
  case "export":
2436
2443
  return Rt(U.value);
2437
2444
  case "stockAdjustment":
2438
- return i();
2445
+ return c();
2439
2446
  }
2440
2447
  }
2441
- return (y, f) => {
2442
- const d = B("FmSwitch"), F = B("FmTable");
2448
+ return (f, v) => {
2449
+ const i = B("FmSwitch"), x = B("FmTable");
2443
2450
  return V(), ne(Mt, {
2444
- title: s(m)("inventory.stock.title"),
2451
+ title: s(u)("inventory.stock.title"),
2445
2452
  actions: J.value,
2446
2453
  "onClick:action": h
2447
2454
  }, {
2448
2455
  default: M(() => {
2449
- var E, ee, ae, Q;
2456
+ var P, ee, ae, Q;
2450
2457
  return [
2451
2458
  e("div", {
2452
2459
  class: He([
2453
2460
  "flex flex-col gap-8 max-h-full",
2454
2461
  {
2455
- "p-0": A.value,
2456
- "px-24 ": !A.value
2462
+ "p-0": F.value,
2463
+ "px-24 ": !F.value
2457
2464
  }
2458
2465
  ])
2459
2466
  }, [
2460
- _(lo, {
2467
+ _(ro, {
2461
2468
  searchable: "",
2462
2469
  "change-location": "",
2463
2470
  search: Z.value,
2464
- "onUpdate:search": f[1] || (f[1] = (W) => Z.value = W),
2471
+ "onUpdate:search": v[1] || (v[1] = (W) => Z.value = W),
2465
2472
  "hide-filter-options": !0,
2466
2473
  filterable: "",
2467
2474
  "filter-attributes": z.value,
2468
2475
  filter: K.value,
2469
- "onUpdate:filter": f[2] || (f[2] = (W) => K.value = W)
2476
+ "onUpdate:filter": v[2] || (v[2] = (W) => K.value = W)
2470
2477
  }, {
2471
2478
  default: M(() => [
2472
2479
  s(b).isEnabled ? (V(), q("div", Hs, [
2473
- e("span", Ts, v(s(m)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
2480
+ e("span", Ts, p(s(u)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
2474
2481
  _(Nt),
2475
2482
  _(Je, null, {
2476
2483
  default: M(() => [
2477
- _(d, {
2478
- modelValue: le.value,
2479
- "onUpdate:modelValue": f[0] || (f[0] = (W) => le.value = W)
2484
+ _(i, {
2485
+ modelValue: re.value,
2486
+ "onUpdate:modelValue": v[0] || (v[0] = (W) => re.value = W)
2480
2487
  }, null, 8, ["modelValue"])
2481
2488
  ]),
2482
2489
  _: 1
@@ -2485,14 +2492,14 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : y;
2485
2492
  ]),
2486
2493
  _: 1
2487
2494
  }, 8, ["search", "filter-attributes", "filter"]),
2488
- (V(), ne(F, {
2495
+ (V(), ne(x, {
2489
2496
  style: kt(s(H).tableHeight),
2490
2497
  "column-defs": s(R),
2491
2498
  "row-data": U.value,
2492
2499
  "search-value": Z.value,
2493
- loading: o.value || s(n) || !s(p)._currentLocation,
2494
- key: (E = s(p)._currentLocation) == null ? void 0 : E.dbName,
2495
- onRowClick: f[3] || (f[3] = (W) => s(j).showSkuHistory(W.original)),
2500
+ loading: o.value || s(n) || !s(y)._currentLocation,
2501
+ key: (P = s(y)._currentLocation) == null ? void 0 : P.dbName,
2502
+ onRowClick: v[3] || (v[3] = (W) => s(j).showSkuHistory(W.original)),
2496
2503
  "page-size": G.value
2497
2504
  }, {
2498
2505
  "list-row": M((W) => [
@@ -2501,13 +2508,13 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : y;
2501
2508
  onRowClick: s(j).showSkuHistory
2502
2509
  }, {
2503
2510
  default: M((te) => {
2504
- var re, ce, je, me, de, Ze, et, tt, Ve, ot;
2511
+ var le, ce, je, me, de, Ze, et, tt, Ve, ot;
2505
2512
  return [
2506
- e("div", Ps, [
2513
+ e("div", Es, [
2507
2514
  e("div", Us, [
2508
- e("div", Es, [
2515
+ e("div", Ps, [
2509
2516
  _(s(ft), {
2510
- render: (je = (ce = (re = te.code) == null ? void 0 : re.column) == null ? void 0 : ce.columnDef) == null ? void 0 : je.cell,
2517
+ render: (je = (ce = (le = te.code) == null ? void 0 : le.column) == null ? void 0 : ce.columnDef) == null ? void 0 : je.cell,
2511
2518
  props: (de = (me = te.code) == null ? void 0 : me.getContext) == null ? void 0 : de.call(me)
2512
2519
  }, null, 8, ["render", "props"])
2513
2520
  ]),
@@ -2545,17 +2552,20 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : y;
2545
2552
  (ee = s(j).stockHistoryProps) != null && ee.sku ? (V(), ne(Bs, at(ze({ key: 0 }, s(j).stockHistoryProps)), null, 16)) : se("", !0),
2546
2553
  (ae = s(j).convertSkuDialogProps) != null && ae.sku ? (V(), ne(Mo, at(ze({ key: 1 }, s(j).convertSkuDialogProps)), null, 16)) : se("", !0),
2547
2554
  (Q = s(j).adjustSkuDialogProps) != null && Q.stock ? (V(), ne(Go, ze({ key: 2 }, s(j).adjustSkuDialogProps, {
2548
- onSubmitted: f[4] || (f[4] = (W) => X())
2555
+ onSubmitted: v[4] || (v[4] = (W) => X())
2549
2556
  }), null, 16)) : se("", !0),
2550
2557
  _(Ms, {
2551
- permission: { action: s(De).Action.manage, subject: s(De).Subject.Business.inventory_stockAdjustment }
2558
+ permission: {
2559
+ action: s(De).Action.manage,
2560
+ subject: s(De).Subject.Business.inventory_stockAdjustment
2561
+ }
2552
2562
  }, {
2553
2563
  default: M(() => [
2554
2564
  I.value ? (V(), ne(sn, {
2555
2565
  key: 0,
2556
2566
  show: I.value,
2557
- "onUpdate:show": f[5] || (f[5] = (W) => I.value = W),
2558
- onSubmitted: f[6] || (f[6] = (W) => X())
2567
+ "onUpdate:show": v[5] || (v[5] = (W) => I.value = W),
2568
+ onSubmitted: v[6] || (v[6] = (W) => X())
2559
2569
  }, null, 8, ["show"])) : se("", !0)
2560
2570
  ]),
2561
2571
  _: 1