@feedmepos/mf-inventory-portal 1.3.14 → 1.3.16-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/App-BckRpjrE.js +309 -0
  2. package/dist/{ApprovalView-BVszC4Cw.js → ApprovalView-C5rVI_O7.js} +17 -17
  3. package/dist/{BindingsDialog-B3L_3xdo.js → BindingsDialog-Y530TN7D.js} +13 -13
  4. package/dist/{BindingsPicker-A4togB2v.js → BindingsPicker-BbQ9Ygep.js} +2 -2
  5. package/dist/{BindingsTable-DacoMdY6.js → BindingsTable-ClHmMFLP.js} +3 -3
  6. package/dist/{ClosingDraftView-C9tvMgLl.js → ClosingDraftView-Dn16j97_.js} +15 -15
  7. package/dist/{ClosingHistoryView-CqqzqSqU.js → ClosingHistoryView-BK7KJbbf.js} +5 -5
  8. package/dist/{ClosingTemplateView-CLi0XE8S.js → ClosingTemplateView-D2petgop.js} +14 -14
  9. package/dist/DefaultView-CdCpGT5n.js +31 -0
  10. package/dist/{DeliveryOrderPrintPreview-DEHEfd80.js → DeliveryOrderPrintPreview-C_S4SG8h.js} +11 -11
  11. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-GT5YUrJz.js +76 -0
  12. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-xxS4P6uo.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-q8fQfbEV.js} +2 -2
  13. package/dist/{FmMultiselectDialog-CR2peMEL.js → FmMultiselectDialog-6JADZ5xC.js} +1 -1
  14. package/dist/{FmMultiselectDialog-FGR8t9rz.js → FmMultiselectDialog-BEkAAZZp.js} +16 -16
  15. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DgXOsVLe.js → FmUnitInput.vue_vue_type_script_setup_true_lang-kaW8FwP5.js} +6 -5
  16. package/dist/{ImportView-CEI0QqGz.js → ImportView-D8i5_GO9.js} +6 -6
  17. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-cRgKjHY0.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-baV8qK0P.js} +1 -1
  18. package/dist/{IngredientGroupView-DEELNMpl.js → IngredientGroupView-BiqFuJx0.js} +5 -5
  19. package/dist/{IngredientsView-D3OcjZdT.js → IngredientsView-CQHobUvF.js} +15 -15
  20. package/dist/{IntegrationExplorerView-ByPpT3hC.js → IntegrationExplorerView-BFbGH5-S.js} +5 -5
  21. package/dist/{IntegrationView-BSqlJBp-.js → IntegrationView-UF8UwPNk.js} +81 -81
  22. package/dist/{InventoryBindingForm-SgmyJvCs.js → InventoryBindingForm-DB4LwgzC.js} +1 -1
  23. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-GLipe2bO.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Dc0sxYMV.js} +5 -5
  24. package/dist/{InventoryBindingSummary-D6deGR6B.js → InventoryBindingSummary-Bwn4HZy5.js} +1 -1
  25. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DGDL-t7m.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BvBOo5wi.js} +1 -1
  26. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-ff1rPUJW.js → PremiumBadge.vue_vue_type_script_setup_true_lang-D2wiVygJ.js} +7 -7
  27. package/dist/{PublishView-7TAa2QQB.js → PublishView-BFac9M5C.js} +15 -15
  28. package/dist/{PurchaseOrderPrintPreview-DhcnInSW.js → PurchaseOrderPrintPreview-tree07u5.js} +11 -11
  29. package/dist/{ReceiveRequestView-Z3JYH3gf.js → ReceiveRequestView-DLERk28I.js} +30 -29
  30. package/dist/RecipeView-DDgN0DkI.js +2898 -0
  31. package/dist/{SettingsView-F_BWUxoq.js → SettingsView-BWw7AhqT.js} +4 -4
  32. package/dist/StockView-D0wW54eN.js +2439 -0
  33. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CxNgi5uv.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Btor1W6X.js} +1 -1
  34. package/dist/{SupplierView-DklOXwHD.js → SupplierView-Bd_PLuYt.js} +12 -12
  35. package/dist/{SurchargeView-DcImorUr.js → SurchargeView-F1B_fcv-.js} +16 -16
  36. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-xdLxGAOM.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-95m2qnoM.js} +2 -2
  37. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bu4XKhII.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DHKDRFgr.js} +1 -1
  38. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DMrRfwKD.js → TransferDetails.vue_vue_type_script_setup_true_lang-BC0PNCtM.js} +812 -828
  39. package/dist/{TransferTemplateView-DTdlSI2b.js → TransferTemplateView-DM8qOCpO.js} +20 -19
  40. package/dist/{UnitCostHistoryView-CQ_DJE-t.js → UnitCostHistoryView-Bzocbij3.js} +246 -243
  41. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-QuejzcCL.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BDzz91rl.js} +4 -4
  42. package/dist/{UnitView-DzcCdCGw.js → UnitView-EndrhMnI.js} +7 -7
  43. package/dist/{WarehouseView-BYj9DD1N.js → WarehouseView-BJZELae1.js} +25 -25
  44. package/dist/{WastageTemplateView--w6an2Ar.js → WastageTemplateView-s6ZiQR8E.js} +14 -14
  45. package/dist/{app-CPlgHGkC.js → app-CaGW5ogt.js} +23768 -22367
  46. package/dist/app.d.ts +148 -6
  47. package/dist/app.js +5 -5
  48. package/dist/{closing-template-B9JOB9ah.js → closing-template-CUgXd6Na.js} +1 -1
  49. package/dist/components/HrmPermissionGuard.vue.d.ts +54 -0
  50. package/dist/composable/useHrmPermission.d.ts +17 -0
  51. package/dist/composable/useInventoryAccess.d.ts +11 -0
  52. package/dist/composable/useNavigationMenu.d.ts +14 -0
  53. package/dist/{date2-Ci9tlLMJ.js → date2-fQDP1Rtk.js} +1 -1
  54. package/dist/{dayjs.min-DTx2lmq6.js → dayjs.min-UwaUKDHA.js} +32 -32
  55. package/dist/{decimal-iKhH_VJO.js → decimal-CKysiOcn.js} +2 -2
  56. package/dist/{defineDeepModel-C25T8oyP.js → defineDeepModel-CwM7TJuT.js} +1 -1
  57. package/dist/{duplicate-template-BptIBRQ3.js → duplicate-template-Bb5b_40t.js} +1 -1
  58. package/dist/{empty-placeholder-wf6-BWE8.js → empty-placeholder-B0QU467o.js} +1 -1
  59. package/dist/{export-CKuVd5pP.js → export-nbyx5EYR.js} +1 -1
  60. package/dist/{feature-CXMSo4z7.js → feature-Dqme8-Xr.js} +22 -22
  61. package/dist/{format-time-from-id-Bk60g6lh.js → format-time-from-id-DsRN_JB-.js} +1 -1
  62. package/dist/{format-unit-display-C4nf8hG8.js → format-unit-display-Df1v6CMC.js} +11 -11
  63. package/dist/{import-export.helper-BDzsQcYD.js → import-export.helper-QInnTLhY.js} +6 -6
  64. package/dist/{index-CUVlQagt.js → index-BCwp1fKe.js} +3 -3
  65. package/dist/{index-DiKOwY5C.js → index-CbwjQK_M.js} +1 -1
  66. package/dist/{index-DTszDSPO.js → index-Cij7rBSm.js} +1 -1
  67. package/dist/{inventory-core-dart.default-Cn3sonot.js → inventory-core-dart.default-Bgq3Sd7C.js} +10 -10
  68. package/dist/{lodash-DGOK6ZkA.js → lodash-B15PREHg.js} +1 -1
  69. package/dist/{lz-string-QrWbdmw6.js → lz-string-DdnEcXDA.js} +21 -21
  70. package/dist/{netsuite-DglgyKcZ.js → netsuite-NcBlI9QO.js} +37 -37
  71. package/dist/{number-Ut7u2ZEE.js → number-DQ-rkxYN.js} +11 -11
  72. package/dist/{predefined-templates-DZtFebPU.js → predefined-templates-zYAuXO9-.js} +1 -1
  73. package/dist/{purchase-order-template-DhNVhXmD.js → purchase-order-template-DcoKKoiW.js} +1 -1
  74. package/dist/{recalculationUtils-CqJRd9B2.js → recalculationUtils-MW6hf5oz.js} +1 -1
  75. package/dist/router/name.d.ts +1 -0
  76. package/dist/router/route-permission.d.ts +10 -0
  77. package/dist/{rules-BIm67nl_.js → rules-CxC7ePEb.js} +2 -2
  78. package/dist/{stock-Dc4_U69J.js → stock-Bly2vXJq.js} +28 -27
  79. package/dist/{stock-CzdMn9n8.js → stock-Bqk5_C4b.js} +3 -3
  80. package/dist/{supplier-De5G6CeF.js → supplier-B0yIc028.js} +2 -2
  81. package/dist/{surcharge-CN5FtDZq.js → surcharge-BZa9y16I.js} +8 -8
  82. package/dist/tsconfig.app.tsbuildinfo +1 -1
  83. package/dist/{use-ingredient-select-dialog-Wy4CtYcZ.js → use-ingredient-select-dialog-BGPPfGO-.js} +2 -2
  84. package/dist/{use-inventory-binding-dialog-C1LCH0jV.js → use-inventory-binding-dialog-DUsjKdNr.js} +2 -2
  85. package/dist/{use-template-enabled-locations-BfZFcXZ_.js → use-template-enabled-locations-D2EWKhWK.js} +2 -2
  86. package/dist/use-transfer-locations-BRQbfZYI.js +116 -0
  87. package/dist/useHrmPermission-BZSfcBwi.js +16 -0
  88. package/dist/useNavigationMenu-C7F5h-H5.js +162 -0
  89. package/dist/views/DefaultView.vue.d.ts +2 -0
  90. package/dist/views/receive-request/composables/use-order-draft-permission.d.ts +2 -5
  91. package/dist/views/recipe/components/recipe-bulk-editor/RecipeBulkEditorDialog.vue.d.ts +19 -0
  92. package/dist/views/recipe/components/recipe-bulk-editor/RecipeBulkEditorQueryStep.vue.d.ts +2 -0
  93. package/dist/views/recipe/components/recipe-bulk-editor/RecipeBulkEditorSummaryStep.vue.d.ts +2 -0
  94. package/dist/views/recipe/composables/use-recipe-bulk-editor.d.ts +634 -0
  95. package/dist/{vue-i18n-CvVV4Xof.js → vue-i18n-BuXEP0EQ.js} +348 -348
  96. package/dist/{xlsx-lawW6Hwh.js → xlsx-C0BSmeBh.js} +1 -1
  97. package/dist/{xlsx.util-DSCqPt8v.js → xlsx.util-CyLHh8k-.js} +1 -1
  98. package/package.json +4 -3
  99. package/dist/App-BQZQFNKG.js +0 -411
  100. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BDZVaj3l.js +0 -188
  101. package/dist/RecipeView--ALwYD-O.js +0 -1692
  102. package/dist/StockView-BLrquJf2.js +0 -2406
@@ -1,63 +1,66 @@
1
- import { ref as h, defineComponent as Q, computed as b, resolveComponent as L, openBlock as u, createElementBlock as g, createVNode as p, withModifiers as oe, withCtx as A, createElementVNode as t, toDisplayString as n, unref as r, Fragment as O, createTextVNode as H, createCommentVNode as F, createBlock as T, renderList as se, normalizeClass as E, normalizeStyle as ae, Teleport as X } from "vue";
2
- import { u as ne, _ as le } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-sUxHOj47.js";
3
- import { o as re, u as J, a as Z } from "./app-CPlgHGkC.js";
4
- import { useSnackbar as q, useBreakpoints as ie } from "@feedmepos/ui-library";
5
- import { _ as ce } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-xxS4P6uo.js";
6
- import { useI18n as ee, useCoreStore as ue } from "@feedmepos/mf-common";
7
- import { b as Y } from "./date2-Ci9tlLMJ.js";
8
- import { d as j } from "./number-Ut7u2ZEE.js";
1
+ import { ref as x, defineComponent as Q, computed as h, resolveComponent as U, openBlock as d, createElementBlock as _, createVNode as g, withModifiers as se, withCtx as $, createElementVNode as t, toDisplayString as a, unref as r, Fragment as O, createTextVNode as H, createCommentVNode as L, createBlock as M, renderList as ne, normalizeClass as E, normalizeStyle as ae, Teleport as X } from "vue";
2
+ import { u as le, _ as re } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-sUxHOj47.js";
3
+ import { m as ie, u as J, a as Z } from "./app-CaGW5ogt.js";
4
+ import { useSnackbar as q, useBreakpoints as ce } from "@feedmepos/ui-library";
5
+ import { _ as ue } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-q8fQfbEV.js";
6
+ import { useCoreStore as ee, useI18n as te } from "@feedmepos/mf-common";
7
+ import { b as Y } from "./date2-fQDP1Rtk.js";
8
+ import { d as j } from "./number-DQ-rkxYN.js";
9
9
  import { F as de } from "./FmAdminBadge-DjnBAgyv.js";
10
10
  import { P as me, J as fe } from "./app-DiX-EfV6.js";
11
- const te = re((w, _) => {
12
- const i = J();
11
+ const oe = ie((D, C) => {
12
+ const i = J(), v = ee();
13
13
  return {
14
- async getLatestCostForAllSkus(d) {
15
- const o = `${w.inventoryBackendUrl}/api/unit-cost-history?locationId=${encodeURIComponent(d)}`;
16
- return await _.get(o);
14
+ async getLatestCostForAllSkus(o) {
15
+ var m;
16
+ const f = ((m = v.currentBusiness.value) == null ? void 0 : m._id) ?? "", c = `${D.inventoryBackendUrl}/${f}/api/unit-cost-history?locationId=${encodeURIComponent(o)}`;
17
+ return await C.get(c);
17
18
  },
18
- async recalculate(d) {
19
- const o = `${w.inventoryBackendUrl}/api/unit-cost-history/recalculate`;
20
- return await _.post(o, d);
19
+ async recalculate(o) {
20
+ var m;
21
+ const f = ((m = v.currentBusiness.value) == null ? void 0 : m._id) ?? "", c = `${D.inventoryBackendUrl}/${f}/api/unit-cost-history/recalculate`;
22
+ return await C.post(c, o);
21
23
  },
22
- async getJobStatus(d) {
23
- const o = `${w.inventoryBackendUrl}/api/unit-cost-history/jobs/${d}`;
24
- return await _.get(o);
24
+ async getJobStatus(o) {
25
+ var m;
26
+ const f = ((m = v.currentBusiness.value) == null ? void 0 : m._id) ?? "", c = `${D.inventoryBackendUrl}/${f}/api/unit-cost-history/jobs/${o}`;
27
+ return await C.get(c);
25
28
  },
26
29
  async listRecentRecalculationRequests() {
27
- var C;
28
- const d = (C = i._currentLocation) == null ? void 0 : C.dbName;
29
- if (!d) return [];
30
- const o = `${w.inventoryBackendUrl}/api/unit-cost-history/recalculation-requests?location=${encodeURIComponent(d)}`;
31
- return await _.get(o);
30
+ var m, B;
31
+ const o = (m = i._currentLocation) == null ? void 0 : m.dbName;
32
+ if (!o) return [];
33
+ const f = ((B = v.currentBusiness.value) == null ? void 0 : B._id) ?? "", c = `${D.inventoryBackendUrl}/${f}/api/unit-cost-history/recalculation-requests?location=${encodeURIComponent(o)}`;
34
+ return await C.get(c);
32
35
  }
33
36
  };
34
37
  });
35
38
  function ye() {
36
- const w = te(), _ = J(), i = h([]), d = h(!1);
39
+ const D = oe(), C = J(), i = x([]), v = x(!1);
37
40
  async function o() {
38
- if (!_._currentLocation)
41
+ if (!C._currentLocation)
39
42
  return [];
40
- d.value = !0;
43
+ v.value = !0;
41
44
  try {
42
- const C = _.currentLocation.doc._id, m = await w.getLatestCostForAllSkus(C);
43
- return i.value = m, m;
45
+ const f = C.currentLocation.doc._id, c = await D.getLatestCostForAllSkus(f);
46
+ return i.value = c, c;
44
47
  } finally {
45
- d.value = !1;
48
+ v.value = !1;
46
49
  }
47
50
  }
48
51
  return {
49
52
  historyData: i,
50
- isLoading: d,
53
+ isLoading: v,
51
54
  fetchHistory: o
52
55
  };
53
56
  }
54
- const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col gap-16" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, be = { class: "flex flex-col gap-8" }, he = { class: "fm-typo-en-body-md-600" }, _e = { class: "flex flex-col gap-8" }, xe = { class: "fm-typo-en-body-md-600" }, Ce = {
57
+ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col gap-16" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, be = { class: "flex flex-col gap-8" }, _e = { class: "fm-typo-en-body-md-600" }, he = { class: "flex flex-col gap-8" }, xe = { class: "fm-typo-en-body-md-600" }, Ce = {
55
58
  key: 0,
56
59
  class: "text-red-500 text-sm mt-2"
57
60
  }, ke = { class: "fm-typo-en-body-sm-400" }, Se = {
58
61
  key: 1,
59
62
  class: "flex flex-col gap-8"
60
- }, we = { class: "fm-typo-en-body-md-600" }, De = { class: "flex flex-col gap-8 max-h-[300px] overflow-y-auto" }, Ae = { class: "flex items-center justify-between" }, $e = { class: "fm-typo-en-body-sm-600" }, Re = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ie = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Fe = {
63
+ }, we = { class: "fm-typo-en-body-md-600" }, De = { class: "flex flex-col gap-8 max-h-[300px] overflow-y-auto" }, Ae = { class: "flex items-center justify-between" }, $e = { class: "fm-typo-en-body-sm-600" }, Ie = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Re = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Fe = {
61
64
  key: 0,
62
65
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
63
66
  }, Le = {
@@ -66,185 +69,185 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
66
69
  }, Ue = {
67
70
  key: 2,
68
71
  class: "fm-typo-en-body-xs-400 text-fm-color-system-error-500"
69
- }, Ne = {
72
+ }, Be = {
70
73
  key: 0,
71
74
  class: "flex gap-8 ml-auto"
72
- }, Be = {
75
+ }, Ne = {
73
76
  key: 1,
74
77
  class: "flex gap-8 ml-auto"
75
78
  }, Ve = /* @__PURE__ */ Q({
76
79
  __name: "UnitCostRecalculationDialog",
77
80
  emits: ["submitted"],
78
- setup(w, { expose: _, emit: i }) {
79
- const d = i, { t: o } = ee(), C = te(), m = q(), U = ue(), M = J(), x = h(!1), s = h(""), a = h(""), v = h(!1), $ = h([]), B = h(!1), D = b(() => {
80
- if (!s.value || !a.value) return "";
81
- const f = new Date(s.value).getTime();
82
- return new Date(a.value).getTime() <= f ? o("inventory.unitCost.recalculation.error.endDateBeforeStart") : "";
83
- }), R = b(() => !!s.value && !!a.value && !D.value), k = b(() => $.value.some(
84
- (f) => !f.completedAt && !f.failedReason
81
+ setup(D, { expose: C, emit: i }) {
82
+ const v = i, { t: o } = te(), f = oe(), c = q(), m = ee(), B = J(), k = x(!1), s = x(""), n = x(""), b = x(!1), I = x([]), V = x(!1), A = h(() => {
83
+ if (!s.value || !n.value) return "";
84
+ const y = new Date(s.value).getTime();
85
+ return new Date(n.value).getTime() <= y ? o("inventory.unitCost.recalculation.error.endDateBeforeStart") : "";
86
+ }), R = h(() => !!s.value && !!n.value && !A.value), S = h(() => I.value.some(
87
+ (y) => !y.completedAt && !y.failedReason
85
88
  ));
86
- async function V() {
87
- x.value = !0, await K();
88
- const f = /* @__PURE__ */ new Date();
89
- a.value = f.toISOString().split("T")[0];
90
- const c = new Date(f.getFullYear(), 0, 1);
91
- s.value = c.toISOString().split("T")[0];
89
+ async function T() {
90
+ k.value = !0, await K();
91
+ const y = /* @__PURE__ */ new Date();
92
+ n.value = y.toISOString().split("T")[0];
93
+ const u = new Date(y.getFullYear(), 0, 1);
94
+ s.value = u.toISOString().split("T")[0];
92
95
  }
93
96
  function P() {
94
- x.value = !1;
97
+ k.value = !1;
95
98
  }
96
- _({
97
- open: V,
99
+ C({
100
+ open: T,
98
101
  close: P
99
102
  });
100
103
  async function K() {
101
- B.value = !0;
104
+ V.value = !0;
102
105
  try {
103
- const f = await C.listRecentRecalculationRequests();
104
- $.value = f;
105
- } catch (f) {
106
- console.error("Error fetching recalculation requests:", f);
106
+ const y = await f.listRecentRecalculationRequests();
107
+ I.value = y;
108
+ } catch (y) {
109
+ console.error("Error fetching recalculation requests:", y);
107
110
  } finally {
108
- B.value = !1;
111
+ V.value = !1;
109
112
  }
110
113
  }
111
114
  async function W() {
112
- var f, c;
115
+ var y, u;
113
116
  if (R.value) {
114
- v.value = !0;
117
+ b.value = !0;
115
118
  try {
116
- const S = ((f = U.currentBusiness.value) == null ? void 0 : f._id) ?? "", N = ((c = M._currentLocation) == null ? void 0 : c.dbName) ?? "";
117
- if (!S)
119
+ const w = ((y = m.currentBusiness.value) == null ? void 0 : y._id) ?? "", N = ((u = B._currentLocation) == null ? void 0 : u.dbName) ?? "";
120
+ if (!w)
118
121
  throw new Error("No active business selected");
119
122
  if (!N)
120
123
  throw new Error("No active location selected");
121
- await C.recalculate({
122
- businessId: S,
124
+ await f.recalculate({
125
+ businessId: w,
123
126
  locationId: N,
124
127
  startDate: s.value,
125
- endDate: a.value
126
- }), m.open({
128
+ endDate: n.value
129
+ }), c.open({
127
130
  title: o("common.success"),
128
131
  message: o("inventory.unitCost.recalculation.successMessage"),
129
132
  type: "success"
130
- }), await K(), x.value = !1, d("submitted");
131
- } catch (S) {
132
- console.error("Error scheduling recalculation:", S), m.open({
133
+ }), await K(), k.value = !1, v("submitted");
134
+ } catch (w) {
135
+ console.error("Error scheduling recalculation:", w), c.open({
133
136
  title: o("common.error"),
134
137
  message: o("inventory.unitCost.recalculation.errorMessage"),
135
138
  type: "error"
136
139
  });
137
140
  } finally {
138
- v.value = !1;
141
+ b.value = !1;
139
142
  }
140
143
  }
141
144
  }
142
- return (f, c) => {
143
- const S = L("FmButton"), N = L("FmDatePicker"), G = L("FmAlert"), l = L("FmDialog");
144
- return u(), g("div", null, [
145
- p(S, {
145
+ return (y, u) => {
146
+ const w = U("FmButton"), N = U("FmDatePicker"), G = U("FmAlert"), l = U("FmDialog");
147
+ return d(), _("div", null, [
148
+ g(w, {
146
149
  "prepend-icon": "info",
147
150
  variant: "tertiary",
148
- onClick: oe(V, ["stop"])
151
+ onClick: se(T, ["stop"])
149
152
  }),
150
- p(l, {
151
- modelValue: x.value,
152
- "onUpdate:modelValue": c[4] || (c[4] = (e) => x.value = e),
153
+ g(l, {
154
+ modelValue: k.value,
155
+ "onUpdate:modelValue": u[4] || (u[4] = (e) => k.value = e),
153
156
  "close-button": "",
154
157
  dismissAway: "",
155
158
  "max-width": "600px"
156
159
  }, {
157
- "dialog-header": A(() => [
158
- t("div", pe, n(r(o)("inventory.unitCost.recalculation.title")), 1)
160
+ "dialog-header": $(() => [
161
+ t("div", pe, a(r(o)("inventory.unitCost.recalculation.title")), 1)
159
162
  ]),
160
- "dialog-footer": A(() => [
161
- k.value ? (u(), g("div", Be, [
162
- p(S, {
163
+ "dialog-footer": $(() => [
164
+ S.value ? (d(), _("div", Ne, [
165
+ g(w, {
163
166
  variant: "tertiary",
164
- onClick: c[3] || (c[3] = (e) => x.value = !1),
167
+ onClick: u[3] || (u[3] = (e) => k.value = !1),
165
168
  label: r(o)("common.close")
166
169
  }, null, 8, ["label"])
167
- ])) : (u(), g("div", Ne, [
168
- p(S, {
170
+ ])) : (d(), _("div", Be, [
171
+ g(w, {
169
172
  variant: "tertiary",
170
- onClick: c[2] || (c[2] = (e) => x.value = !1),
171
- disabled: v.value,
173
+ onClick: u[2] || (u[2] = (e) => k.value = !1),
174
+ disabled: b.value,
172
175
  label: r(o)("common.cancel")
173
176
  }, null, 8, ["disabled", "label"]),
174
- p(S, {
177
+ g(w, {
175
178
  variant: "primary",
176
179
  onClick: W,
177
- disabled: !R.value || v.value,
178
- loading: v.value,
180
+ disabled: !R.value || b.value,
181
+ loading: b.value,
179
182
  label: r(o)("inventory.unitCost.recalculation.schedule")
180
183
  }, null, 8, ["disabled", "loading", "label"])
181
184
  ]))
182
185
  ]),
183
- default: A(() => [
186
+ default: $(() => [
184
187
  t("div", ve, [
185
- t("div", ge, n(r(o)("inventory.unitCost.recalculation.description")), 1),
186
- k.value ? F("", !0) : (u(), g(O, { key: 0 }, [
188
+ t("div", ge, a(r(o)("inventory.unitCost.recalculation.description")), 1),
189
+ S.value ? L("", !0) : (d(), _(O, { key: 0 }, [
187
190
  t("div", be, [
188
- t("p", he, [
189
- H(n(r(o)("inventory.unitCost.recalculation.startDate")) + " ", 1),
190
- c[5] || (c[5] = t("span", { class: "text-fm-color-system-error-300" }, "*", -1))
191
+ t("p", _e, [
192
+ H(a(r(o)("inventory.unitCost.recalculation.startDate")) + " ", 1),
193
+ u[5] || (u[5] = t("span", { class: "text-fm-color-system-error-300" }, "*", -1))
191
194
  ]),
192
- p(N, {
195
+ g(N, {
193
196
  modelValue: s.value,
194
- "onUpdate:modelValue": c[0] || (c[0] = (e) => s.value = e),
197
+ "onUpdate:modelValue": u[0] || (u[0] = (e) => s.value = e),
195
198
  placeholder: r(o)("inventory.unitCost.recalculation.selectStartDate"),
196
- disabled: v.value
199
+ disabled: b.value
197
200
  }, null, 8, ["modelValue", "placeholder", "disabled"])
198
201
  ]),
199
- t("div", _e, [
202
+ t("div", he, [
200
203
  t("p", xe, [
201
- H(n(r(o)("inventory.unitCost.recalculation.endDate")) + " ", 1),
202
- c[6] || (c[6] = t("span", { class: "text-fm-color-system-error-300" }, "*", -1))
204
+ H(a(r(o)("inventory.unitCost.recalculation.endDate")) + " ", 1),
205
+ u[6] || (u[6] = t("span", { class: "text-fm-color-system-error-300" }, "*", -1))
203
206
  ]),
204
- p(N, {
205
- modelValue: a.value,
206
- "onUpdate:modelValue": c[1] || (c[1] = (e) => a.value = e),
207
+ g(N, {
208
+ modelValue: n.value,
209
+ "onUpdate:modelValue": u[1] || (u[1] = (e) => n.value = e),
207
210
  placeholder: r(o)("inventory.unitCost.recalculation.selectEndDate"),
208
- disabled: !s.value || v.value,
211
+ disabled: !s.value || b.value,
209
212
  min: s.value
210
213
  }, null, 8, ["modelValue", "placeholder", "disabled", "min"]),
211
- D.value ? (u(), g("div", Ce, n(D.value), 1)) : F("", !0)
214
+ A.value ? (d(), _("div", Ce, a(A.value), 1)) : L("", !0)
212
215
  ]),
213
- s.value && a.value && !D.value ? (u(), T(G, {
216
+ s.value && n.value && !A.value ? (d(), M(G, {
214
217
  key: 0,
215
218
  type: "info"
216
219
  }, {
217
- default: A(() => [
218
- t("div", ke, n(r(o)("inventory.unitCost.recalculation.info")), 1)
220
+ default: $(() => [
221
+ t("div", ke, a(r(o)("inventory.unitCost.recalculation.info")), 1)
219
222
  ]),
220
223
  _: 1
221
- })) : F("", !0)
224
+ })) : L("", !0)
222
225
  ], 64)),
223
- $.value.length > 0 ? (u(), g("div", Se, [
224
- t("p", we, n(r(o)("inventory.unitCost.recalculation.recentRequests")), 1),
226
+ I.value.length > 0 ? (d(), _("div", Se, [
227
+ t("p", we, a(r(o)("inventory.unitCost.recalculation.recentRequests")), 1),
225
228
  t("div", De, [
226
- (u(!0), g(O, null, se($.value, (e) => (u(), g("div", {
229
+ (d(!0), _(O, null, ne(I.value, (e) => (d(), _("div", {
227
230
  key: e._id,
228
231
  class: "p-12 border border-fm-color-border-primary rounded-8 flex flex-col gap-4"
229
232
  }, [
230
233
  t("div", Ae, [
231
- t("div", $e, n(r(o)("inventory.unitCost.recalculation.requestedAt")) + ": " + n(new Date(e.createdAt).toLocaleString()), 1),
234
+ t("div", $e, a(r(o)("inventory.unitCost.recalculation.requestedAt")) + ": " + a(new Date(e.createdAt).toLocaleString()), 1),
232
235
  t("div", {
233
236
  class: E(["fm-typo-en-body-xs-600 px-8 py-4 rounded-4", {
234
237
  "bg-fm-color-system-error-100 text-fm-color-system-error-500": e.failedReason,
235
238
  "bg-fm-color-system-success-100 text-fm-color-system-success-500": e.completedAt,
236
239
  "bg-fm-color-system-info-100 text-fm-color-system-info-500": !e.failedReason && !e.completedAt
237
240
  }])
238
- }, n(e.failedReason ? r(o)("inventory.unitCost.recalculation.status.failed") : e.completedAt ? r(o)("inventory.unitCost.recalculation.status.completed") : r(o)("inventory.unitCost.recalculation.status.inProgress")), 3)
241
+ }, a(e.failedReason ? r(o)("inventory.unitCost.recalculation.status.failed") : e.completedAt ? r(o)("inventory.unitCost.recalculation.status.completed") : r(o)("inventory.unitCost.recalculation.status.inProgress")), 3)
239
242
  ]),
240
- t("div", Re, n(r(o)("inventory.unitCost.recalculation.from")) + ": " + n(new Date(e.recalculateStartDate).toLocaleDateString()), 1),
241
- t("div", Ie, n(r(o)("inventory.unitCost.recalculation.to")) + ": " + n(new Date(e.recalculateEndDate).toLocaleDateString()), 1),
242
- e.createdBy ? (u(), g("div", Fe, n(r(o)("inventory.unitCost.recalculation.requestedBy")) + ": " + n(e.createdBy.name || e.createdBy._id), 1)) : F("", !0),
243
- e.completedAt ? (u(), g("div", Le, n(r(o)("inventory.unitCost.recalculation.completedAt")) + ": " + n(new Date(e.completedAt).toLocaleString()), 1)) : F("", !0),
244
- e.failedReason ? (u(), g("div", Ue, n(e.failedReason), 1)) : F("", !0)
243
+ t("div", Ie, a(r(o)("inventory.unitCost.recalculation.from")) + ": " + a(new Date(e.recalculateStartDate).toLocaleDateString()), 1),
244
+ t("div", Re, a(r(o)("inventory.unitCost.recalculation.to")) + ": " + a(new Date(e.recalculateEndDate).toLocaleDateString()), 1),
245
+ e.createdBy ? (d(), _("div", Fe, a(r(o)("inventory.unitCost.recalculation.requestedBy")) + ": " + a(e.createdBy.name || e.createdBy._id), 1)) : L("", !0),
246
+ e.completedAt ? (d(), _("div", Le, a(r(o)("inventory.unitCost.recalculation.completedAt")) + ": " + a(new Date(e.completedAt).toLocaleString()), 1)) : L("", !0),
247
+ e.failedReason ? (d(), _("div", Ue, a(e.failedReason), 1)) : L("", !0)
245
248
  ]))), 128))
246
249
  ])
247
- ])) : F("", !0)
250
+ ])) : L("", !0)
248
251
  ])
249
252
  ]),
250
253
  _: 1
@@ -260,128 +263,128 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
260
263
  props: {
261
264
  record: {}
262
265
  },
263
- setup(w, { expose: _ }) {
264
- const i = w, d = Z(), o = h(!1), C = b(() => {
266
+ setup(D, { expose: C }) {
267
+ const i = D, v = Z(), o = x(!1), f = h(() => {
265
268
  var s;
266
- return (s = i.record) != null && s.skuId ? d.skus.find((a) => a._id === i.record.skuId) : null;
267
- }), m = b(() => {
269
+ return (s = i.record) != null && s.skuId ? v.skus.find((n) => n._id === i.record.skuId) : null;
270
+ }), c = h(() => {
268
271
  if (!i.record || !i.record.previousCost) return null;
269
- const s = i.record.previousCost.amount, v = i.record.cost.amount - s;
272
+ const s = i.record.previousCost.amount, b = i.record.cost.amount - s;
270
273
  return {
271
- amount: Math.abs(v),
274
+ amount: Math.abs(b),
272
275
  precision: i.record.cost.precision,
273
276
  currency: i.record.cost.currency,
274
- isIncrease: v > 0
277
+ isIncrease: b > 0
275
278
  };
276
- }), U = b(() => i.record ? {
279
+ }), m = h(() => i.record ? {
277
280
  default: "Default",
278
281
  weightedAverage: "Weighted Average (WAVG)",
279
282
  netsuite: "NetSuite",
280
283
  "netsuite-average": "NetSuite Average"
281
284
  }[i.record.mechanism] || i.record.mechanism : "");
282
- b(() => {
285
+ h(() => {
283
286
  var s;
284
287
  return !((s = i.record) != null && s.meta) || i.record.mechanism !== "netsuite" ? null : i.record.meta;
285
288
  });
286
- function M() {
289
+ function B() {
287
290
  o.value = !0;
288
291
  }
289
- function x() {
292
+ function k() {
290
293
  o.value = !1;
291
294
  }
292
- return _({
293
- open: M,
294
- close: x
295
- }), (s, a) => {
296
- const v = L("FmMenuDivider"), $ = L("FmCard"), B = L("FmButton"), D = L("FmSideSheet");
297
- return u(), T(D, {
295
+ return C({
296
+ open: B,
297
+ close: k
298
+ }), (s, n) => {
299
+ const b = U("FmMenuDivider"), I = U("FmCard"), V = U("FmButton"), A = U("FmSideSheet");
300
+ return d(), M(A, {
298
301
  "model-value": o.value,
299
- "onUpdate:modelValue": a[0] || (a[0] = (R) => o.value = R),
302
+ "onUpdate:modelValue": n[0] || (n[0] = (R) => o.value = R),
300
303
  header: "Unit Cost History Details",
301
304
  "close-button": "",
302
305
  "dismiss-away": "",
303
306
  "max-width": 500
304
307
  }, {
305
- "side-sheet-footer": A(() => [
308
+ "side-sheet-footer": $(() => [
306
309
  t("div", ot, [
307
- p(B, {
310
+ g(V, {
308
311
  variant: "tertiary",
309
- onClick: x,
312
+ onClick: k,
310
313
  label: "Close"
311
314
  })
312
315
  ])
313
316
  ]),
314
- default: A(() => [
315
- s.record ? (u(), g("div", Te, [
316
- p($, {
317
+ default: $(() => [
318
+ s.record ? (d(), _("div", Te, [
319
+ g(I, {
317
320
  variant: "outlined",
318
321
  class: "flex flex-col gap-8 px-12 py-16"
319
322
  }, {
320
- default: A(() => {
321
- var R, k;
323
+ default: $(() => {
324
+ var R, S;
322
325
  return [
323
- a[8] || (a[8] = t("div", { class: "flex justify-between" }, [
326
+ n[8] || (n[8] = t("div", { class: "flex justify-between" }, [
324
327
  t("div", { class: "fm-typo-en-body-lg-600" }, "Details")
325
328
  ], -1)),
326
- p(v),
329
+ g(b),
327
330
  t("div", Me, [
328
331
  t("div", ze, [
329
332
  t("div", He, [
330
- a[1] || (a[1] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Ingredient Code", -1)),
331
- t("div", Ee, n((R = C.value) == null ? void 0 : R.code), 1)
333
+ n[1] || (n[1] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Ingredient Code", -1)),
334
+ t("div", Ee, a((R = f.value) == null ? void 0 : R.code), 1)
332
335
  ]),
333
336
  t("div", Pe, [
334
- a[2] || (a[2] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Ingredient Name", -1)),
335
- t("div", Ke, n((k = C.value) == null ? void 0 : k.name), 1)
337
+ n[2] || (n[2] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Ingredient Name", -1)),
338
+ t("div", Ke, a((S = f.value) == null ? void 0 : S.name), 1)
336
339
  ]),
337
340
  t("div", Oe, [
338
- a[3] || (a[3] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "New Cost", -1)),
341
+ n[3] || (n[3] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "New Cost", -1)),
339
342
  t("div", Ye, [
340
- H(n(r(j)(s.record.cost, !0, s.record.cost.precision)) + " ", 1),
341
- m.value ? (u(), g("div", {
343
+ H(a(r(j)(s.record.cost, !0, s.record.cost.precision)) + " ", 1),
344
+ c.value ? (d(), _("div", {
342
345
  key: 0,
343
346
  class: E(["fm-typo-en-body-md-600 flex items-center gap-4", {
344
- "text-fm-color-system-success-500": m.value.isIncrease,
345
- "text-fm-color-system-error-500": !m.value.isIncrease
347
+ "text-fm-color-system-success-500": c.value.isIncrease,
348
+ "text-fm-color-system-error-500": !c.value.isIncrease
346
349
  }])
347
350
  }, [
348
351
  t("span", {
349
352
  class: E({
350
- "text-red-500": m.value.isIncrease,
351
- "text-green-600": !m.value.isIncrease
353
+ "text-red-500": c.value.isIncrease,
354
+ "text-green-600": !c.value.isIncrease
352
355
  })
353
- }, n(m.value.isIncrease ? "↑" : "↓"), 3),
356
+ }, a(c.value.isIncrease ? "↑" : "↓"), 3),
354
357
  t("span", {
355
358
  class: E({
356
- "text-red-500": m.value.isIncrease,
357
- "text-green-600": !m.value.isIncrease
359
+ "text-red-500": c.value.isIncrease,
360
+ "text-green-600": !c.value.isIncrease
358
361
  })
359
- }, n(m.value.isIncrease ? "Increase" : "Decrease"), 3)
360
- ], 2)) : F("", !0)
362
+ }, a(c.value.isIncrease ? "Increase" : "Decrease"), 3)
363
+ ], 2)) : L("", !0)
361
364
  ])
362
365
  ]),
363
366
  t("div", je, [
364
- a[4] || (a[4] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Previous Cost", -1)),
365
- t("div", Je, n(s.record.previousCost ? r(j)(
367
+ n[4] || (n[4] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Previous Cost", -1)),
368
+ t("div", Je, a(s.record.previousCost ? r(j)(
366
369
  s.record.previousCost,
367
370
  !0,
368
371
  s.record.previousCost.precision
369
372
  ) : "-"), 1)
370
373
  ]),
371
374
  t("div", We, [
372
- a[5] || (a[5] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Mechanism", -1)),
373
- t("div", Ge, n(U.value), 1)
375
+ n[5] || (n[5] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Mechanism", -1)),
376
+ t("div", Ge, a(m.value), 1)
374
377
  ]),
375
378
  t("div", Qe, [
376
- a[6] || (a[6] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Snapshot At", -1)),
377
- t("div", Xe, n(r(Y)(new Date(s.record.snapshotAt))) + " " + n(new Date(s.record.snapshotAt).toLocaleTimeString()), 1)
379
+ n[6] || (n[6] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Snapshot At", -1)),
380
+ t("div", Xe, a(r(Y)(new Date(s.record.snapshotAt))) + " " + a(new Date(s.record.snapshotAt).toLocaleTimeString()), 1)
378
381
  ]),
379
382
  t("div", Ze, [
380
- a[7] || (a[7] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Updated At", -1)),
383
+ n[7] || (n[7] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Updated At", -1)),
381
384
  t("div", qe, [
382
- s.record.updatedAt ? (u(), g(O, { key: 0 }, [
383
- H(n(r(Y)(new Date(s.record.updatedAt))) + " " + n(new Date(s.record.updatedAt).toLocaleTimeString()), 1)
384
- ], 64)) : (u(), g(O, { key: 1 }, [
385
+ s.record.updatedAt ? (d(), _(O, { key: 0 }, [
386
+ H(a(r(Y)(new Date(s.record.updatedAt))) + " " + a(new Date(s.record.updatedAt).toLocaleTimeString()), 1)
387
+ ], 64)) : (d(), _(O, { key: 1 }, [
385
388
  H("-")
386
389
  ], 64))
387
390
  ])
@@ -392,19 +395,19 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
392
395
  }),
393
396
  _: 1
394
397
  }),
395
- p(de, null, {
396
- default: A(() => [
397
- p($, {
398
+ g(de, null, {
399
+ default: $(() => [
400
+ g(I, {
398
401
  variant: "outlined",
399
402
  class: "flex flex-col gap-8 px-12 py-16"
400
403
  }, {
401
- default: A(() => [
402
- a[9] || (a[9] = t("div", { class: "flex justify-between" }, [
404
+ default: $(() => [
405
+ n[9] || (n[9] = t("div", { class: "flex justify-between" }, [
403
406
  t("div", { class: "fm-typo-en-body-lg-600" }, "Raw data")
404
407
  ], -1)),
405
- p(v),
408
+ g(b),
406
409
  t("div", et, [
407
- t("pre", tt, n(JSON.stringify(s.record, null, 2)) + `
410
+ t("pre", tt, a(JSON.stringify(s.record, null, 2)) + `
408
411
  `, 1)
409
412
  ])
410
413
  ]),
@@ -413,7 +416,7 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
413
416
  ]),
414
417
  _: 1
415
418
  })
416
- ])) : F("", !0)
419
+ ])) : L("", !0)
417
420
  ]),
418
421
  _: 1
419
422
  }, 8, ["model-value"]);
@@ -421,19 +424,19 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
421
424
  }
422
425
  }), yt = /* @__PURE__ */ Q({
423
426
  __name: "UnitCostHistoryView",
424
- setup(w) {
425
- const { t: _ } = ee(), i = J(), d = Z(), o = q(), C = ne(), { breakpoints: m } = ie(), U = b(() => m.value.xs || m.value.sm), M = b(() => U.value ? 10 : 20), x = h(), s = h(), a = h(null), { historyData: v, isLoading: $, fetchHistory: B } = ye(), D = h(""), R = b(() => [
427
+ setup(D) {
428
+ const { t: C } = te(), i = J(), v = Z(), o = q(), f = le(), { breakpoints: c } = ce(), m = h(() => c.value.xs || c.value.sm), B = h(() => m.value ? 10 : 20), k = x(), s = x(), n = x(null), { historyData: b, isLoading: I, fetchHistory: V } = ye(), A = x(""), R = h(() => [
426
429
  {
427
430
  type: "string",
428
431
  key: "skuCode",
429
432
  entity: "sku",
430
- values: d.skus.map((e) => e.code)
433
+ values: v.skus.map((e) => e.code)
431
434
  },
432
435
  {
433
436
  type: "string",
434
437
  key: "skuName",
435
438
  entity: "sku",
436
- values: d.skus.map((e) => e.name)
439
+ values: v.skus.map((e) => e.name)
437
440
  },
438
441
  {
439
442
  type: "string",
@@ -441,12 +444,12 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
441
444
  entity: "sku",
442
445
  values: ["weightedAverage", "netsuite", "netsuite-average"]
443
446
  }
444
- ]), k = h(null);
445
- i.watchLocation(V);
446
- async function V() {
447
+ ]), S = x(null);
448
+ i.watchLocation(T);
449
+ async function T() {
447
450
  if (i._currentLocation)
448
451
  try {
449
- await B();
452
+ await V();
450
453
  } catch (l) {
451
454
  o.open({
452
455
  title: "Error",
@@ -455,36 +458,36 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
455
458
  }), console.error("Error fetching unit cost history:", l);
456
459
  }
457
460
  }
458
- const P = b(() => {
461
+ const P = h(() => {
459
462
  const l = /* @__PURE__ */ new Map();
460
- for (const e of d.skus)
463
+ for (const e of v.skus)
461
464
  l.set(e._id, e);
462
465
  return l;
463
- }), K = b(() => {
464
- let l = v.value;
465
- if (k.value) {
466
- const e = me.build(k.value);
467
- l = l.filter((y) => {
468
- const I = P.value.get(y.skuId);
466
+ }), K = h(() => {
467
+ let l = b.value;
468
+ if (S.value) {
469
+ const e = me.build(S.value);
470
+ l = l.filter((p) => {
471
+ const F = P.value.get(p.skuId);
469
472
  return fe(
470
473
  {
471
- skuCode: (I == null ? void 0 : I.code) ?? y.skuId,
472
- skuName: (I == null ? void 0 : I.name) ?? y.skuId,
473
- mechanism: y.mechanism
474
+ skuCode: (F == null ? void 0 : F.code) ?? p.skuId,
475
+ skuName: (F == null ? void 0 : F.name) ?? p.skuId,
476
+ mechanism: p.mechanism
474
477
  },
475
478
  e
476
479
  );
477
480
  });
478
481
  }
479
482
  return l.map((e) => {
480
- const y = P.value.get(e.skuId);
483
+ const p = P.value.get(e.skuId);
481
484
  return {
482
485
  ...e,
483
- skuCode: (y == null ? void 0 : y.code) ?? e.skuId,
484
- skuName: (y == null ? void 0 : y.name) ?? "Unknown SKU"
486
+ skuCode: (p == null ? void 0 : p.code) ?? e.skuId,
487
+ skuName: (p == null ? void 0 : p.name) ?? "Unknown SKU"
485
488
  };
486
489
  });
487
- }), W = b(() => [
490
+ }), W = h(() => [
488
491
  {
489
492
  accessorKey: "snapshotAt",
490
493
  header: () => "Snapshot At",
@@ -548,13 +551,13 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
548
551
  cell: (l) => {
549
552
  const e = l.row.original.updatedAt;
550
553
  if (!e) return "-";
551
- const y = new Date(e);
552
- return Y(y) + " " + y.toLocaleTimeString();
554
+ const p = new Date(e);
555
+ return Y(p) + " " + p.toLocaleTimeString();
553
556
  },
554
557
  enableSorting: !0,
555
558
  size: 180
556
559
  }
557
- ]), f = b(() => [
560
+ ]), y = h(() => [
558
561
  {
559
562
  label: "Recalculate Cost History",
560
563
  value: "recalculate",
@@ -563,81 +566,81 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
563
566
  isAdminOnly: !0
564
567
  },
565
568
  {
566
- label: _("inventory.common.refresh"),
569
+ label: C("inventory.common.refresh"),
567
570
  value: "refresh"
568
571
  }
569
572
  ]);
570
- function c() {
573
+ function u() {
571
574
  var l;
572
- (l = x.value) == null || l.open();
575
+ (l = k.value) == null || l.open();
573
576
  }
574
- function S() {
575
- V();
577
+ function w() {
578
+ T();
576
579
  }
577
580
  function N(l) {
578
581
  var e;
579
- a.value = l, (e = s.value) == null || e.open();
582
+ n.value = l, (e = s.value) == null || e.open();
580
583
  }
581
584
  function G(l) {
582
585
  switch (l) {
583
586
  case "recalculate":
584
- return c();
587
+ return u();
585
588
  case "refresh":
586
- return V();
589
+ return T();
587
590
  }
588
591
  }
589
592
  return (l, e) => {
590
- const y = L("FmTable");
591
- return u(), T(le, {
593
+ const p = U("FmTable");
594
+ return d(), M(re, {
592
595
  title: "Unit Cost History",
593
- actions: f.value,
596
+ actions: y.value,
594
597
  "onClick:action": G
595
598
  }, {
596
- default: A(() => {
597
- var I;
599
+ default: $(() => {
600
+ var F;
598
601
  return [
599
602
  t("div", {
600
603
  class: E([
601
604
  "flex flex-col gap-8 max-h-full",
602
605
  {
603
- "p-0": U.value,
604
- "px-24": !U.value
606
+ "p-0": m.value,
607
+ "px-24": !m.value
605
608
  }
606
609
  ])
607
610
  }, [
608
- p(ce, {
611
+ g(ue, {
609
612
  searchable: "",
610
613
  "change-location": "",
611
- search: D.value,
612
- "onUpdate:search": e[0] || (e[0] = (z) => D.value = z),
614
+ search: A.value,
615
+ "onUpdate:search": e[0] || (e[0] = (z) => A.value = z),
613
616
  filterable: "",
614
617
  "filter-attributes": R.value,
615
- filter: k.value,
616
- "onUpdate:filter": e[1] || (e[1] = (z) => k.value = z)
618
+ filter: S.value,
619
+ "onUpdate:filter": e[1] || (e[1] = (z) => S.value = z)
617
620
  }, null, 8, ["search", "filter-attributes", "filter"]),
618
- (u(), T(y, {
619
- key: `${(I = r(i)._currentLocation) == null ? void 0 : I.dbName}-${JSON.stringify(k.value)}`,
620
- style: ae(r(C).tableHeight),
621
+ (d(), M(p, {
622
+ key: `${(F = r(i)._currentLocation) == null ? void 0 : F.dbName}-${JSON.stringify(S.value)}`,
623
+ style: ae(r(f).tableHeight),
621
624
  "column-defs": W.value,
622
625
  "row-data": K.value,
623
- "search-value": D.value,
624
- loading: r($) || !r(i)._currentLocation,
625
- "page-size": M.value,
626
+ "search-value": A.value,
627
+ loading: r(I) || !r(i)._currentLocation,
628
+ "page-size": B.value,
626
629
  onRowClick: e[2] || (e[2] = (z) => N(z.original))
627
630
  }, null, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
628
631
  ], 2),
629
- (u(), T(X, { to: "body" }, [
630
- p(Ve, {
632
+ (d(), M(X, { to: "body" }, [
633
+ g(Ve, {
631
634
  ref_key: "recalculationDialogRef",
632
- ref: x,
633
- onSubmitted: S
635
+ ref: k,
636
+ onSubmitted: w
634
637
  }, null, 512)
635
638
  ])),
636
- (u(), T(X, { to: "body" }, [
637
- p(st, {
639
+ (d(), M(X, { to: "body" }, [
640
+ g(st, {
638
641
  ref_key: "detailsSideSheetRef",
639
642
  ref: s,
640
- record: a.value
643
+ record: n.value
641
644
  }, null, 8, ["record"])
642
645
  ]))
643
646
  ];