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

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 (105) hide show
  1. package/dist/App-BQZQFNKG.js +411 -0
  2. package/dist/{ApprovalView-CfF2FqsE.js → ApprovalView-BVszC4Cw.js} +12 -12
  3. package/dist/{BindingsDialog-H-juP-az.js → BindingsDialog-B3L_3xdo.js} +13 -13
  4. package/dist/{BindingsPicker-ClruHF7p.js → BindingsPicker-A4togB2v.js} +2 -2
  5. package/dist/{BindingsTable-Bx9pbFOO.js → BindingsTable-DacoMdY6.js} +3 -3
  6. package/dist/{ClosingDraftView-DN97Tao5.js → ClosingDraftView-C9tvMgLl.js} +16 -16
  7. package/dist/{ClosingHistoryView-DsRYUqa2.js → ClosingHistoryView-CqqzqSqU.js} +5 -5
  8. package/dist/{ClosingTemplateView-f9zfsxCu.js → ClosingTemplateView-CLi0XE8S.js} +15 -15
  9. package/dist/{DeliveryOrderPrintPreview-BMK4kBCQ.js → DeliveryOrderPrintPreview-DEHEfd80.js} +11 -11
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bqj_Ygmo.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BDZVaj3l.js} +16 -16
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CK1ha_AY.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-xxS4P6uo.js} +2 -2
  12. package/dist/{FmMultiselectDialog-BazT9oUX.js → FmMultiselectDialog-CR2peMEL.js} +1 -1
  13. package/dist/{FmMultiselectDialog-_gUuhudi.js → FmMultiselectDialog-FGR8t9rz.js} +16 -16
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BBtAgdsA.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DgXOsVLe.js} +4 -4
  15. package/dist/{ImportView-jpkwuCXO.js → ImportView-CEI0QqGz.js} +6 -6
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DLJnF4do.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-cRgKjHY0.js} +1 -1
  17. package/dist/{IngredientGroupView-x3t1hyNn.js → IngredientGroupView-DEELNMpl.js} +6 -6
  18. package/dist/{IngredientsView-BzWTnlb4.js → IngredientsView-D3OcjZdT.js} +16 -16
  19. package/dist/{IntegrationExplorerView-Bca3owbx.js → IntegrationExplorerView-ByPpT3hC.js} +5 -5
  20. package/dist/{IntegrationView-Dh1c4Qyo.js → IntegrationView-BSqlJBp-.js} +81 -81
  21. package/dist/{InventoryBindingForm-B1sI1TGZ.js → InventoryBindingForm-SgmyJvCs.js} +1 -1
  22. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-7NeE7Xos.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-GLipe2bO.js} +5 -5
  23. package/dist/{InventoryBindingSummary-R8zHPc52.js → InventoryBindingSummary-D6deGR6B.js} +1 -1
  24. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DMJVh7Nt.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DGDL-t7m.js} +1 -1
  25. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-ChC9sEIk.js → PremiumBadge.vue_vue_type_script_setup_true_lang-ff1rPUJW.js} +7 -7
  26. package/dist/{PublishView-Bqp8Ww4J.js → PublishView-7TAa2QQB.js} +15 -15
  27. package/dist/{PurchaseOrderPrintPreview-D7TCn8U-.js → PurchaseOrderPrintPreview-DhcnInSW.js} +11 -11
  28. package/dist/ReceiveRequestView-Z3JYH3gf.js +36203 -0
  29. package/dist/{RecipeView-D8Mvgji9.js → RecipeView--ALwYD-O.js} +16 -16
  30. package/dist/{SettingsView-BJScLK9z.js → SettingsView-F_BWUxoq.js} +4 -4
  31. package/dist/StockView-BLrquJf2.js +2406 -0
  32. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DUKv_LV6.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CxNgi5uv.js} +1 -1
  33. package/dist/{SupplierView-DdBBIV8W.js → SupplierView-DklOXwHD.js} +13 -13
  34. package/dist/{SurchargeView-DisBUPIs.js → SurchargeView-DcImorUr.js} +17 -17
  35. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CZ3Q3BAf.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-xdLxGAOM.js} +2 -2
  36. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CC7F5HVc.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bu4XKhII.js} +1 -1
  37. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DMrRfwKD.js +3890 -0
  38. package/dist/{TransferTemplateView-7ICJMF9z.js → TransferTemplateView-DTdlSI2b.js} +18 -18
  39. package/dist/{UnitCostHistoryView-BMRDBQ58.js → UnitCostHistoryView-CQ_DJE-t.js} +243 -246
  40. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-mNXHzLN3.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-QuejzcCL.js} +4 -4
  41. package/dist/{UnitView-uUUYOjYn.js → UnitView-DzcCdCGw.js} +8 -8
  42. package/dist/{WarehouseView-BfMf_iuj.js → WarehouseView-BYj9DD1N.js} +26 -26
  43. package/dist/{WastageTemplateView-BQYjJGZ-.js → WastageTemplateView--w6an2Ar.js} +15 -15
  44. package/dist/api/email.d.ts +54 -0
  45. package/dist/{app-B_zMegJc.js → app-CPlgHGkC.js} +22314 -23519
  46. package/dist/app.d.ts +14 -22
  47. package/dist/app.js +2 -2
  48. package/dist/{closing-template-9vhx5Ji1.js → closing-template-B9JOB9ah.js} +1 -1
  49. package/dist/components/row-action.enum.d.ts +2 -1
  50. package/dist/{date2-BMCS_Dsc.js → date2-Ci9tlLMJ.js} +1 -1
  51. package/dist/{dayjs.min-Dl26OaXo.js → dayjs.min-DTx2lmq6.js} +26 -26
  52. package/dist/{decimal-e6OK2jkR.js → decimal-iKhH_VJO.js} +2 -2
  53. package/dist/{defineDeepModel-BvLlwxnd.js → defineDeepModel-C25T8oyP.js} +1 -1
  54. package/dist/{duplicate-template-Cnhu8Rxw.js → duplicate-template-BptIBRQ3.js} +1 -1
  55. package/dist/{empty-placeholder-B0QU467o.js → empty-placeholder-wf6-BWE8.js} +1 -1
  56. package/dist/{export-CGvyGmeo.js → export-CKuVd5pP.js} +1 -1
  57. package/dist/{feature-Do41WWzx.js → feature-CXMSo4z7.js} +121 -116
  58. package/dist/{format-time-from-id-CqX_KaUG.js → format-time-from-id-Bk60g6lh.js} +1 -1
  59. package/dist/{format-unit-display-D8qWmRXP.js → format-unit-display-C4nf8hG8.js} +12 -12
  60. package/dist/{import-export.helper-85V8Ib5e.js → import-export.helper-BDzsQcYD.js} +6 -6
  61. package/dist/{index-C-CwnjUn.js → index-CUVlQagt.js} +3 -3
  62. package/dist/{index-CtUF9Nsv.js → index-DTszDSPO.js} +1 -1
  63. package/dist/{index-Cg3aLEhT.js → index-DiKOwY5C.js} +1 -1
  64. package/dist/{inventory-core-dart.default-B64FzAla.js → inventory-core-dart.default-Cn3sonot.js} +10 -10
  65. package/dist/{lodash-U9ycVPlv.js → lodash-DGOK6ZkA.js} +1 -1
  66. package/dist/{lz-string-0CgVsQoC.js → lz-string-QrWbdmw6.js} +21 -21
  67. package/dist/{netsuite-Du7-sXJt.js → netsuite-DglgyKcZ.js} +37 -37
  68. package/dist/{number-iJAzDfmj.js → number-Ut7u2ZEE.js} +11 -11
  69. package/dist/{predefined-templates-LlSrXOXm.js → predefined-templates-DZtFebPU.js} +1 -1
  70. package/dist/{purchase-order-template-DFuXb0rr.js → purchase-order-template-DhNVhXmD.js} +1 -1
  71. package/dist/{recalculationUtils-DWPnMW1G.js → recalculationUtils-CqJRd9B2.js} +1 -1
  72. package/dist/router/name.d.ts +0 -1
  73. package/dist/{row-action.enum-Co_O4qD9.js → row-action.enum-DQ9bJ_uv.js} +7 -1
  74. package/dist/{rules-DefSKiUN.js → rules-BIm67nl_.js} +2 -2
  75. package/dist/{stock-BfF6peMd.js → stock-CzdMn9n8.js} +3 -3
  76. package/dist/{stock-Cx1BwdWs.js → stock-Dc4_U69J.js} +27 -28
  77. package/dist/stores/feature.d.ts +2 -0
  78. package/dist/{supplier-CU3iqdGr.js → supplier-De5G6CeF.js} +2 -2
  79. package/dist/{surcharge-D77J5opH.js → surcharge-CN5FtDZq.js} +8 -8
  80. package/dist/tsconfig.app.tsbuildinfo +1 -1
  81. package/dist/{use-ingredient-select-dialog-B-jxV-79.js → use-ingredient-select-dialog-Wy4CtYcZ.js} +2 -2
  82. package/dist/{use-inventory-binding-dialog-BdTd5qPl.js → use-inventory-binding-dialog-C1LCH0jV.js} +2 -2
  83. package/dist/{use-template-enabled-locations-vFvaCjlH.js → use-template-enabled-locations-BfZFcXZ_.js} +2 -2
  84. package/dist/views/receive-request/components/email-dialog/EmailDialog.vue.d.ts +20 -0
  85. package/dist/views/receive-request/components/email-dialog/EmailDialogProps.d.ts +13 -0
  86. package/dist/views/receive-request/composables/use-order-draft-permission.d.ts +5 -2
  87. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +3 -0
  88. package/dist/vue-i18n-CvVV4Xof.js +2365 -0
  89. package/dist/{xlsx-o7n1whCa.js → xlsx-lawW6Hwh.js} +570 -570
  90. package/dist/{xlsx.util-D6nPboPW.js → xlsx.util-DSCqPt8v.js} +1 -1
  91. package/package.json +2 -2
  92. package/dist/App-D1_jkD6L.js +0 -309
  93. package/dist/DefaultView-COVVxOrF.js +0 -31
  94. package/dist/ReceiveRequestView-oNBVAMYu.js +0 -2817
  95. package/dist/StockView-CRRdVCcD.js +0 -2439
  96. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-BLlg1Vka.js +0 -3837
  97. package/dist/components/HrmPermissionGuard.vue.d.ts +0 -54
  98. package/dist/composable/useHrmPermission.d.ts +0 -17
  99. package/dist/composable/useInventoryAccess.d.ts +0 -11
  100. package/dist/composable/useNavigationMenu.d.ts +0 -14
  101. package/dist/router/route-permission.d.ts +0 -10
  102. package/dist/useHrmPermission-CekUhyck.js +0 -16
  103. package/dist/useNavigationMenu-BiLWMIip.js +0 -162
  104. package/dist/views/DefaultView.vue.d.ts +0 -2
  105. package/dist/vue-i18n-C3_OsgSl.js +0 -2365
@@ -1,66 +1,63 @@
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-B_zMegJc.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-CK1ha_AY.js";
6
- import { useCoreStore as ee, useI18n as te } from "@feedmepos/mf-common";
7
- import { b as Y } from "./date2-BMCS_Dsc.js";
8
- import { d as j } from "./number-iJAzDfmj.js";
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";
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 oe = ie((D, C) => {
12
- const i = J(), v = ee();
11
+ const te = re((w, _) => {
12
+ const i = J();
13
13
  return {
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);
14
+ async getLatestCostForAllSkus(d) {
15
+ const o = `${w.inventoryBackendUrl}/api/unit-cost-history?locationId=${encodeURIComponent(d)}`;
16
+ return await _.get(o);
18
17
  },
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);
18
+ async recalculate(d) {
19
+ const o = `${w.inventoryBackendUrl}/api/unit-cost-history/recalculate`;
20
+ return await _.post(o, d);
23
21
  },
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);
22
+ async getJobStatus(d) {
23
+ const o = `${w.inventoryBackendUrl}/api/unit-cost-history/jobs/${d}`;
24
+ return await _.get(o);
28
25
  },
29
26
  async listRecentRecalculationRequests() {
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);
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);
35
32
  }
36
33
  };
37
34
  });
38
35
  function ye() {
39
- const D = oe(), C = J(), i = x([]), v = x(!1);
36
+ const w = te(), _ = J(), i = h([]), d = h(!1);
40
37
  async function o() {
41
- if (!C._currentLocation)
38
+ if (!_._currentLocation)
42
39
  return [];
43
- v.value = !0;
40
+ d.value = !0;
44
41
  try {
45
- const f = C.currentLocation.doc._id, c = await D.getLatestCostForAllSkus(f);
46
- return i.value = c, c;
42
+ const C = _.currentLocation.doc._id, m = await w.getLatestCostForAllSkus(C);
43
+ return i.value = m, m;
47
44
  } finally {
48
- v.value = !1;
45
+ d.value = !1;
49
46
  }
50
47
  }
51
48
  return {
52
49
  historyData: i,
53
- isLoading: v,
50
+ isLoading: d,
54
51
  fetchHistory: o
55
52
  };
56
53
  }
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 = {
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 = {
58
55
  key: 0,
59
56
  class: "text-red-500 text-sm mt-2"
60
57
  }, ke = { class: "fm-typo-en-body-sm-400" }, Se = {
61
58
  key: 1,
62
59
  class: "flex flex-col gap-8"
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 = {
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 = {
64
61
  key: 0,
65
62
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
66
63
  }, Le = {
@@ -69,185 +66,185 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
69
66
  }, Ue = {
70
67
  key: 2,
71
68
  class: "fm-typo-en-body-xs-400 text-fm-color-system-error-500"
72
- }, Be = {
69
+ }, Ne = {
73
70
  key: 0,
74
71
  class: "flex gap-8 ml-auto"
75
- }, Ne = {
72
+ }, Be = {
76
73
  key: 1,
77
74
  class: "flex gap-8 ml-auto"
78
75
  }, Ve = /* @__PURE__ */ Q({
79
76
  __name: "UnitCostRecalculationDialog",
80
77
  emits: ["submitted"],
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
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
88
85
  ));
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];
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];
95
92
  }
96
93
  function P() {
97
- k.value = !1;
94
+ x.value = !1;
98
95
  }
99
- C({
100
- open: T,
96
+ _({
97
+ open: V,
101
98
  close: P
102
99
  });
103
100
  async function K() {
104
- V.value = !0;
101
+ B.value = !0;
105
102
  try {
106
- const y = await f.listRecentRecalculationRequests();
107
- I.value = y;
108
- } catch (y) {
109
- console.error("Error fetching recalculation requests:", y);
103
+ const f = await C.listRecentRecalculationRequests();
104
+ $.value = f;
105
+ } catch (f) {
106
+ console.error("Error fetching recalculation requests:", f);
110
107
  } finally {
111
- V.value = !1;
108
+ B.value = !1;
112
109
  }
113
110
  }
114
111
  async function W() {
115
- var y, u;
112
+ var f, c;
116
113
  if (R.value) {
117
- b.value = !0;
114
+ v.value = !0;
118
115
  try {
119
- const w = ((y = m.currentBusiness.value) == null ? void 0 : y._id) ?? "", N = ((u = B._currentLocation) == null ? void 0 : u.dbName) ?? "";
120
- if (!w)
116
+ const S = ((f = U.currentBusiness.value) == null ? void 0 : f._id) ?? "", N = ((c = M._currentLocation) == null ? void 0 : c.dbName) ?? "";
117
+ if (!S)
121
118
  throw new Error("No active business selected");
122
119
  if (!N)
123
120
  throw new Error("No active location selected");
124
- await f.recalculate({
125
- businessId: w,
121
+ await C.recalculate({
122
+ businessId: S,
126
123
  locationId: N,
127
124
  startDate: s.value,
128
- endDate: n.value
129
- }), c.open({
125
+ endDate: a.value
126
+ }), m.open({
130
127
  title: o("common.success"),
131
128
  message: o("inventory.unitCost.recalculation.successMessage"),
132
129
  type: "success"
133
- }), await K(), k.value = !1, v("submitted");
134
- } catch (w) {
135
- console.error("Error scheduling recalculation:", w), c.open({
130
+ }), await K(), x.value = !1, d("submitted");
131
+ } catch (S) {
132
+ console.error("Error scheduling recalculation:", S), m.open({
136
133
  title: o("common.error"),
137
134
  message: o("inventory.unitCost.recalculation.errorMessage"),
138
135
  type: "error"
139
136
  });
140
137
  } finally {
141
- b.value = !1;
138
+ v.value = !1;
142
139
  }
143
140
  }
144
141
  }
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, {
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, {
149
146
  "prepend-icon": "info",
150
147
  variant: "tertiary",
151
- onClick: se(T, ["stop"])
148
+ onClick: oe(V, ["stop"])
152
149
  }),
153
- g(l, {
154
- modelValue: k.value,
155
- "onUpdate:modelValue": u[4] || (u[4] = (e) => k.value = e),
150
+ p(l, {
151
+ modelValue: x.value,
152
+ "onUpdate:modelValue": c[4] || (c[4] = (e) => x.value = e),
156
153
  "close-button": "",
157
154
  dismissAway: "",
158
155
  "max-width": "600px"
159
156
  }, {
160
- "dialog-header": $(() => [
161
- t("div", pe, a(r(o)("inventory.unitCost.recalculation.title")), 1)
157
+ "dialog-header": A(() => [
158
+ t("div", pe, n(r(o)("inventory.unitCost.recalculation.title")), 1)
162
159
  ]),
163
- "dialog-footer": $(() => [
164
- S.value ? (d(), _("div", Ne, [
165
- g(w, {
160
+ "dialog-footer": A(() => [
161
+ k.value ? (u(), g("div", Be, [
162
+ p(S, {
166
163
  variant: "tertiary",
167
- onClick: u[3] || (u[3] = (e) => k.value = !1),
164
+ onClick: c[3] || (c[3] = (e) => x.value = !1),
168
165
  label: r(o)("common.close")
169
166
  }, null, 8, ["label"])
170
- ])) : (d(), _("div", Be, [
171
- g(w, {
167
+ ])) : (u(), g("div", Ne, [
168
+ p(S, {
172
169
  variant: "tertiary",
173
- onClick: u[2] || (u[2] = (e) => k.value = !1),
174
- disabled: b.value,
170
+ onClick: c[2] || (c[2] = (e) => x.value = !1),
171
+ disabled: v.value,
175
172
  label: r(o)("common.cancel")
176
173
  }, null, 8, ["disabled", "label"]),
177
- g(w, {
174
+ p(S, {
178
175
  variant: "primary",
179
176
  onClick: W,
180
- disabled: !R.value || b.value,
181
- loading: b.value,
177
+ disabled: !R.value || v.value,
178
+ loading: v.value,
182
179
  label: r(o)("inventory.unitCost.recalculation.schedule")
183
180
  }, null, 8, ["disabled", "loading", "label"])
184
181
  ]))
185
182
  ]),
186
- default: $(() => [
183
+ default: A(() => [
187
184
  t("div", ve, [
188
- t("div", ge, a(r(o)("inventory.unitCost.recalculation.description")), 1),
189
- S.value ? L("", !0) : (d(), _(O, { key: 0 }, [
185
+ t("div", ge, n(r(o)("inventory.unitCost.recalculation.description")), 1),
186
+ k.value ? F("", !0) : (u(), g(O, { key: 0 }, [
190
187
  t("div", be, [
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))
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))
194
191
  ]),
195
- g(N, {
192
+ p(N, {
196
193
  modelValue: s.value,
197
- "onUpdate:modelValue": u[0] || (u[0] = (e) => s.value = e),
194
+ "onUpdate:modelValue": c[0] || (c[0] = (e) => s.value = e),
198
195
  placeholder: r(o)("inventory.unitCost.recalculation.selectStartDate"),
199
- disabled: b.value
196
+ disabled: v.value
200
197
  }, null, 8, ["modelValue", "placeholder", "disabled"])
201
198
  ]),
202
- t("div", he, [
199
+ t("div", _e, [
203
200
  t("p", xe, [
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))
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))
206
203
  ]),
207
- g(N, {
208
- modelValue: n.value,
209
- "onUpdate:modelValue": u[1] || (u[1] = (e) => n.value = e),
204
+ p(N, {
205
+ modelValue: a.value,
206
+ "onUpdate:modelValue": c[1] || (c[1] = (e) => a.value = e),
210
207
  placeholder: r(o)("inventory.unitCost.recalculation.selectEndDate"),
211
- disabled: !s.value || b.value,
208
+ disabled: !s.value || v.value,
212
209
  min: s.value
213
210
  }, null, 8, ["modelValue", "placeholder", "disabled", "min"]),
214
- A.value ? (d(), _("div", Ce, a(A.value), 1)) : L("", !0)
211
+ D.value ? (u(), g("div", Ce, n(D.value), 1)) : F("", !0)
215
212
  ]),
216
- s.value && n.value && !A.value ? (d(), M(G, {
213
+ s.value && a.value && !D.value ? (u(), T(G, {
217
214
  key: 0,
218
215
  type: "info"
219
216
  }, {
220
- default: $(() => [
221
- t("div", ke, a(r(o)("inventory.unitCost.recalculation.info")), 1)
217
+ default: A(() => [
218
+ t("div", ke, n(r(o)("inventory.unitCost.recalculation.info")), 1)
222
219
  ]),
223
220
  _: 1
224
- })) : L("", !0)
221
+ })) : F("", !0)
225
222
  ], 64)),
226
- I.value.length > 0 ? (d(), _("div", Se, [
227
- t("p", we, a(r(o)("inventory.unitCost.recalculation.recentRequests")), 1),
223
+ $.value.length > 0 ? (u(), g("div", Se, [
224
+ t("p", we, n(r(o)("inventory.unitCost.recalculation.recentRequests")), 1),
228
225
  t("div", De, [
229
- (d(!0), _(O, null, ne(I.value, (e) => (d(), _("div", {
226
+ (u(!0), g(O, null, se($.value, (e) => (u(), g("div", {
230
227
  key: e._id,
231
228
  class: "p-12 border border-fm-color-border-primary rounded-8 flex flex-col gap-4"
232
229
  }, [
233
230
  t("div", Ae, [
234
- t("div", $e, a(r(o)("inventory.unitCost.recalculation.requestedAt")) + ": " + a(new Date(e.createdAt).toLocaleString()), 1),
231
+ t("div", $e, n(r(o)("inventory.unitCost.recalculation.requestedAt")) + ": " + n(new Date(e.createdAt).toLocaleString()), 1),
235
232
  t("div", {
236
233
  class: E(["fm-typo-en-body-xs-600 px-8 py-4 rounded-4", {
237
234
  "bg-fm-color-system-error-100 text-fm-color-system-error-500": e.failedReason,
238
235
  "bg-fm-color-system-success-100 text-fm-color-system-success-500": e.completedAt,
239
236
  "bg-fm-color-system-info-100 text-fm-color-system-info-500": !e.failedReason && !e.completedAt
240
237
  }])
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)
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)
242
239
  ]),
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)
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)
248
245
  ]))), 128))
249
246
  ])
250
- ])) : L("", !0)
247
+ ])) : F("", !0)
251
248
  ])
252
249
  ]),
253
250
  _: 1
@@ -263,128 +260,128 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
263
260
  props: {
264
261
  record: {}
265
262
  },
266
- setup(D, { expose: C }) {
267
- const i = D, v = Z(), o = x(!1), f = h(() => {
263
+ setup(w, { expose: _ }) {
264
+ const i = w, d = Z(), o = h(!1), C = b(() => {
268
265
  var s;
269
- return (s = i.record) != null && s.skuId ? v.skus.find((n) => n._id === i.record.skuId) : null;
270
- }), c = h(() => {
266
+ return (s = i.record) != null && s.skuId ? d.skus.find((a) => a._id === i.record.skuId) : null;
267
+ }), m = b(() => {
271
268
  if (!i.record || !i.record.previousCost) return null;
272
- const s = i.record.previousCost.amount, b = i.record.cost.amount - s;
269
+ const s = i.record.previousCost.amount, v = i.record.cost.amount - s;
273
270
  return {
274
- amount: Math.abs(b),
271
+ amount: Math.abs(v),
275
272
  precision: i.record.cost.precision,
276
273
  currency: i.record.cost.currency,
277
- isIncrease: b > 0
274
+ isIncrease: v > 0
278
275
  };
279
- }), m = h(() => i.record ? {
276
+ }), U = b(() => i.record ? {
280
277
  default: "Default",
281
278
  weightedAverage: "Weighted Average (WAVG)",
282
279
  netsuite: "NetSuite",
283
280
  "netsuite-average": "NetSuite Average"
284
281
  }[i.record.mechanism] || i.record.mechanism : "");
285
- h(() => {
282
+ b(() => {
286
283
  var s;
287
284
  return !((s = i.record) != null && s.meta) || i.record.mechanism !== "netsuite" ? null : i.record.meta;
288
285
  });
289
- function B() {
286
+ function M() {
290
287
  o.value = !0;
291
288
  }
292
- function k() {
289
+ function x() {
293
290
  o.value = !1;
294
291
  }
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, {
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, {
301
298
  "model-value": o.value,
302
- "onUpdate:modelValue": n[0] || (n[0] = (R) => o.value = R),
299
+ "onUpdate:modelValue": a[0] || (a[0] = (R) => o.value = R),
303
300
  header: "Unit Cost History Details",
304
301
  "close-button": "",
305
302
  "dismiss-away": "",
306
303
  "max-width": 500
307
304
  }, {
308
- "side-sheet-footer": $(() => [
305
+ "side-sheet-footer": A(() => [
309
306
  t("div", ot, [
310
- g(V, {
307
+ p(B, {
311
308
  variant: "tertiary",
312
- onClick: k,
309
+ onClick: x,
313
310
  label: "Close"
314
311
  })
315
312
  ])
316
313
  ]),
317
- default: $(() => [
318
- s.record ? (d(), _("div", Te, [
319
- g(I, {
314
+ default: A(() => [
315
+ s.record ? (u(), g("div", Te, [
316
+ p($, {
320
317
  variant: "outlined",
321
318
  class: "flex flex-col gap-8 px-12 py-16"
322
319
  }, {
323
- default: $(() => {
324
- var R, S;
320
+ default: A(() => {
321
+ var R, k;
325
322
  return [
326
- n[8] || (n[8] = t("div", { class: "flex justify-between" }, [
323
+ a[8] || (a[8] = t("div", { class: "flex justify-between" }, [
327
324
  t("div", { class: "fm-typo-en-body-lg-600" }, "Details")
328
325
  ], -1)),
329
- g(b),
326
+ p(v),
330
327
  t("div", Me, [
331
328
  t("div", ze, [
332
329
  t("div", He, [
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)
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)
335
332
  ]),
336
333
  t("div", Pe, [
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)
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)
339
336
  ]),
340
337
  t("div", Oe, [
341
- n[3] || (n[3] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "New Cost", -1)),
338
+ a[3] || (a[3] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "New Cost", -1)),
342
339
  t("div", Ye, [
343
- H(a(r(j)(s.record.cost, !0, s.record.cost.precision)) + " ", 1),
344
- c.value ? (d(), _("div", {
340
+ H(n(r(j)(s.record.cost, !0, s.record.cost.precision)) + " ", 1),
341
+ m.value ? (u(), g("div", {
345
342
  key: 0,
346
343
  class: E(["fm-typo-en-body-md-600 flex items-center gap-4", {
347
- "text-fm-color-system-success-500": c.value.isIncrease,
348
- "text-fm-color-system-error-500": !c.value.isIncrease
344
+ "text-fm-color-system-success-500": m.value.isIncrease,
345
+ "text-fm-color-system-error-500": !m.value.isIncrease
349
346
  }])
350
347
  }, [
351
348
  t("span", {
352
349
  class: E({
353
- "text-red-500": c.value.isIncrease,
354
- "text-green-600": !c.value.isIncrease
350
+ "text-red-500": m.value.isIncrease,
351
+ "text-green-600": !m.value.isIncrease
355
352
  })
356
- }, a(c.value.isIncrease ? "↑" : "↓"), 3),
353
+ }, n(m.value.isIncrease ? "↑" : "↓"), 3),
357
354
  t("span", {
358
355
  class: E({
359
- "text-red-500": c.value.isIncrease,
360
- "text-green-600": !c.value.isIncrease
356
+ "text-red-500": m.value.isIncrease,
357
+ "text-green-600": !m.value.isIncrease
361
358
  })
362
- }, a(c.value.isIncrease ? "Increase" : "Decrease"), 3)
363
- ], 2)) : L("", !0)
359
+ }, n(m.value.isIncrease ? "Increase" : "Decrease"), 3)
360
+ ], 2)) : F("", !0)
364
361
  ])
365
362
  ]),
366
363
  t("div", je, [
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)(
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)(
369
366
  s.record.previousCost,
370
367
  !0,
371
368
  s.record.previousCost.precision
372
369
  ) : "-"), 1)
373
370
  ]),
374
371
  t("div", We, [
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)
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)
377
374
  ]),
378
375
  t("div", Qe, [
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)
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)
381
378
  ]),
382
379
  t("div", Ze, [
383
- n[7] || (n[7] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Updated At", -1)),
380
+ a[7] || (a[7] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Updated At", -1)),
384
381
  t("div", qe, [
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 }, [
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 }, [
388
385
  H("-")
389
386
  ], 64))
390
387
  ])
@@ -395,19 +392,19 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
395
392
  }),
396
393
  _: 1
397
394
  }),
398
- g(de, null, {
399
- default: $(() => [
400
- g(I, {
395
+ p(de, null, {
396
+ default: A(() => [
397
+ p($, {
401
398
  variant: "outlined",
402
399
  class: "flex flex-col gap-8 px-12 py-16"
403
400
  }, {
404
- default: $(() => [
405
- n[9] || (n[9] = t("div", { class: "flex justify-between" }, [
401
+ default: A(() => [
402
+ a[9] || (a[9] = t("div", { class: "flex justify-between" }, [
406
403
  t("div", { class: "fm-typo-en-body-lg-600" }, "Raw data")
407
404
  ], -1)),
408
- g(b),
405
+ p(v),
409
406
  t("div", et, [
410
- t("pre", tt, a(JSON.stringify(s.record, null, 2)) + `
407
+ t("pre", tt, n(JSON.stringify(s.record, null, 2)) + `
411
408
  `, 1)
412
409
  ])
413
410
  ]),
@@ -416,7 +413,7 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
416
413
  ]),
417
414
  _: 1
418
415
  })
419
- ])) : L("", !0)
416
+ ])) : F("", !0)
420
417
  ]),
421
418
  _: 1
422
419
  }, 8, ["model-value"]);
@@ -424,19 +421,19 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
424
421
  }
425
422
  }), yt = /* @__PURE__ */ Q({
426
423
  __name: "UnitCostHistoryView",
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(() => [
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(() => [
429
426
  {
430
427
  type: "string",
431
428
  key: "skuCode",
432
429
  entity: "sku",
433
- values: v.skus.map((e) => e.code)
430
+ values: d.skus.map((e) => e.code)
434
431
  },
435
432
  {
436
433
  type: "string",
437
434
  key: "skuName",
438
435
  entity: "sku",
439
- values: v.skus.map((e) => e.name)
436
+ values: d.skus.map((e) => e.name)
440
437
  },
441
438
  {
442
439
  type: "string",
@@ -444,12 +441,12 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
444
441
  entity: "sku",
445
442
  values: ["weightedAverage", "netsuite", "netsuite-average"]
446
443
  }
447
- ]), S = x(null);
448
- i.watchLocation(T);
449
- async function T() {
444
+ ]), k = h(null);
445
+ i.watchLocation(V);
446
+ async function V() {
450
447
  if (i._currentLocation)
451
448
  try {
452
- await V();
449
+ await B();
453
450
  } catch (l) {
454
451
  o.open({
455
452
  title: "Error",
@@ -458,36 +455,36 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
458
455
  }), console.error("Error fetching unit cost history:", l);
459
456
  }
460
457
  }
461
- const P = h(() => {
458
+ const P = b(() => {
462
459
  const l = /* @__PURE__ */ new Map();
463
- for (const e of v.skus)
460
+ for (const e of d.skus)
464
461
  l.set(e._id, e);
465
462
  return l;
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);
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);
472
469
  return fe(
473
470
  {
474
- skuCode: (F == null ? void 0 : F.code) ?? p.skuId,
475
- skuName: (F == null ? void 0 : F.name) ?? p.skuId,
476
- mechanism: p.mechanism
471
+ skuCode: (I == null ? void 0 : I.code) ?? y.skuId,
472
+ skuName: (I == null ? void 0 : I.name) ?? y.skuId,
473
+ mechanism: y.mechanism
477
474
  },
478
475
  e
479
476
  );
480
477
  });
481
478
  }
482
479
  return l.map((e) => {
483
- const p = P.value.get(e.skuId);
480
+ const y = P.value.get(e.skuId);
484
481
  return {
485
482
  ...e,
486
- skuCode: (p == null ? void 0 : p.code) ?? e.skuId,
487
- skuName: (p == null ? void 0 : p.name) ?? "Unknown SKU"
483
+ skuCode: (y == null ? void 0 : y.code) ?? e.skuId,
484
+ skuName: (y == null ? void 0 : y.name) ?? "Unknown SKU"
488
485
  };
489
486
  });
490
- }), W = h(() => [
487
+ }), W = b(() => [
491
488
  {
492
489
  accessorKey: "snapshotAt",
493
490
  header: () => "Snapshot At",
@@ -551,13 +548,13 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
551
548
  cell: (l) => {
552
549
  const e = l.row.original.updatedAt;
553
550
  if (!e) return "-";
554
- const p = new Date(e);
555
- return Y(p) + " " + p.toLocaleTimeString();
551
+ const y = new Date(e);
552
+ return Y(y) + " " + y.toLocaleTimeString();
556
553
  },
557
554
  enableSorting: !0,
558
555
  size: 180
559
556
  }
560
- ]), y = h(() => [
557
+ ]), f = b(() => [
561
558
  {
562
559
  label: "Recalculate Cost History",
563
560
  value: "recalculate",
@@ -566,81 +563,81 @@ const pe = { class: "fm-typo-en-heading-lg-600" }, ve = { class: "flex flex-col
566
563
  isAdminOnly: !0
567
564
  },
568
565
  {
569
- label: C("inventory.common.refresh"),
566
+ label: _("inventory.common.refresh"),
570
567
  value: "refresh"
571
568
  }
572
569
  ]);
573
- function u() {
570
+ function c() {
574
571
  var l;
575
- (l = k.value) == null || l.open();
572
+ (l = x.value) == null || l.open();
576
573
  }
577
- function w() {
578
- T();
574
+ function S() {
575
+ V();
579
576
  }
580
577
  function N(l) {
581
578
  var e;
582
- n.value = l, (e = s.value) == null || e.open();
579
+ a.value = l, (e = s.value) == null || e.open();
583
580
  }
584
581
  function G(l) {
585
582
  switch (l) {
586
583
  case "recalculate":
587
- return u();
584
+ return c();
588
585
  case "refresh":
589
- return T();
586
+ return V();
590
587
  }
591
588
  }
592
589
  return (l, e) => {
593
- const p = U("FmTable");
594
- return d(), M(re, {
590
+ const y = L("FmTable");
591
+ return u(), T(le, {
595
592
  title: "Unit Cost History",
596
- actions: y.value,
593
+ actions: f.value,
597
594
  "onClick:action": G
598
595
  }, {
599
- default: $(() => {
600
- var F;
596
+ default: A(() => {
597
+ var I;
601
598
  return [
602
599
  t("div", {
603
600
  class: E([
604
601
  "flex flex-col gap-8 max-h-full",
605
602
  {
606
- "p-0": m.value,
607
- "px-24": !m.value
603
+ "p-0": U.value,
604
+ "px-24": !U.value
608
605
  }
609
606
  ])
610
607
  }, [
611
- g(ue, {
608
+ p(ce, {
612
609
  searchable: "",
613
610
  "change-location": "",
614
- search: A.value,
615
- "onUpdate:search": e[0] || (e[0] = (z) => A.value = z),
611
+ search: D.value,
612
+ "onUpdate:search": e[0] || (e[0] = (z) => D.value = z),
616
613
  filterable: "",
617
614
  "filter-attributes": R.value,
618
- filter: S.value,
619
- "onUpdate:filter": e[1] || (e[1] = (z) => S.value = z)
615
+ filter: k.value,
616
+ "onUpdate:filter": e[1] || (e[1] = (z) => k.value = z)
620
617
  }, null, 8, ["search", "filter-attributes", "filter"]),
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),
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),
624
621
  "column-defs": W.value,
625
622
  "row-data": K.value,
626
- "search-value": A.value,
627
- loading: r(I) || !r(i)._currentLocation,
628
- "page-size": B.value,
623
+ "search-value": D.value,
624
+ loading: r($) || !r(i)._currentLocation,
625
+ "page-size": M.value,
629
626
  onRowClick: e[2] || (e[2] = (z) => N(z.original))
630
627
  }, null, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
631
628
  ], 2),
632
- (d(), M(X, { to: "body" }, [
633
- g(Ve, {
629
+ (u(), T(X, { to: "body" }, [
630
+ p(Ve, {
634
631
  ref_key: "recalculationDialogRef",
635
- ref: k,
636
- onSubmitted: w
632
+ ref: x,
633
+ onSubmitted: S
637
634
  }, null, 512)
638
635
  ])),
639
- (d(), M(X, { to: "body" }, [
640
- g(st, {
636
+ (u(), T(X, { to: "body" }, [
637
+ p(st, {
641
638
  ref_key: "detailsSideSheetRef",
642
639
  ref: s,
643
- record: n.value
640
+ record: a.value
644
641
  }, null, 8, ["record"])
645
642
  ]))
646
643
  ];