@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.
- package/dist/App-BQZQFNKG.js +411 -0
- package/dist/{ApprovalView-CfF2FqsE.js → ApprovalView-BVszC4Cw.js} +12 -12
- package/dist/{BindingsDialog-H-juP-az.js → BindingsDialog-B3L_3xdo.js} +13 -13
- package/dist/{BindingsPicker-ClruHF7p.js → BindingsPicker-A4togB2v.js} +2 -2
- package/dist/{BindingsTable-Bx9pbFOO.js → BindingsTable-DacoMdY6.js} +3 -3
- package/dist/{ClosingDraftView-DN97Tao5.js → ClosingDraftView-C9tvMgLl.js} +16 -16
- package/dist/{ClosingHistoryView-DsRYUqa2.js → ClosingHistoryView-CqqzqSqU.js} +5 -5
- package/dist/{ClosingTemplateView-f9zfsxCu.js → ClosingTemplateView-CLi0XE8S.js} +15 -15
- package/dist/{DeliveryOrderPrintPreview-BMK4kBCQ.js → DeliveryOrderPrintPreview-DEHEfd80.js} +11 -11
- 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
- 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
- package/dist/{FmMultiselectDialog-BazT9oUX.js → FmMultiselectDialog-CR2peMEL.js} +1 -1
- package/dist/{FmMultiselectDialog-_gUuhudi.js → FmMultiselectDialog-FGR8t9rz.js} +16 -16
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BBtAgdsA.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DgXOsVLe.js} +4 -4
- package/dist/{ImportView-jpkwuCXO.js → ImportView-CEI0QqGz.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DLJnF4do.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-cRgKjHY0.js} +1 -1
- package/dist/{IngredientGroupView-x3t1hyNn.js → IngredientGroupView-DEELNMpl.js} +6 -6
- package/dist/{IngredientsView-BzWTnlb4.js → IngredientsView-D3OcjZdT.js} +16 -16
- package/dist/{IntegrationExplorerView-Bca3owbx.js → IntegrationExplorerView-ByPpT3hC.js} +5 -5
- package/dist/{IntegrationView-Dh1c4Qyo.js → IntegrationView-BSqlJBp-.js} +81 -81
- package/dist/{InventoryBindingForm-B1sI1TGZ.js → InventoryBindingForm-SgmyJvCs.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-7NeE7Xos.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-GLipe2bO.js} +5 -5
- package/dist/{InventoryBindingSummary-R8zHPc52.js → InventoryBindingSummary-D6deGR6B.js} +1 -1
- 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
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-ChC9sEIk.js → PremiumBadge.vue_vue_type_script_setup_true_lang-ff1rPUJW.js} +7 -7
- package/dist/{PublishView-Bqp8Ww4J.js → PublishView-7TAa2QQB.js} +15 -15
- package/dist/{PurchaseOrderPrintPreview-D7TCn8U-.js → PurchaseOrderPrintPreview-DhcnInSW.js} +11 -11
- package/dist/ReceiveRequestView-Z3JYH3gf.js +36203 -0
- package/dist/{RecipeView-D8Mvgji9.js → RecipeView--ALwYD-O.js} +16 -16
- package/dist/{SettingsView-BJScLK9z.js → SettingsView-F_BWUxoq.js} +4 -4
- package/dist/StockView-BLrquJf2.js +2406 -0
- 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
- package/dist/{SupplierView-DdBBIV8W.js → SupplierView-DklOXwHD.js} +13 -13
- package/dist/{SurchargeView-DisBUPIs.js → SurchargeView-DcImorUr.js} +17 -17
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CZ3Q3BAf.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-xdLxGAOM.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CC7F5HVc.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bu4XKhII.js} +1 -1
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DMrRfwKD.js +3890 -0
- package/dist/{TransferTemplateView-7ICJMF9z.js → TransferTemplateView-DTdlSI2b.js} +18 -18
- package/dist/{UnitCostHistoryView-BMRDBQ58.js → UnitCostHistoryView-CQ_DJE-t.js} +243 -246
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-mNXHzLN3.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-QuejzcCL.js} +4 -4
- package/dist/{UnitView-uUUYOjYn.js → UnitView-DzcCdCGw.js} +8 -8
- package/dist/{WarehouseView-BfMf_iuj.js → WarehouseView-BYj9DD1N.js} +26 -26
- package/dist/{WastageTemplateView-BQYjJGZ-.js → WastageTemplateView--w6an2Ar.js} +15 -15
- package/dist/api/email.d.ts +54 -0
- package/dist/{app-B_zMegJc.js → app-CPlgHGkC.js} +22314 -23519
- package/dist/app.d.ts +14 -22
- package/dist/app.js +2 -2
- package/dist/{closing-template-9vhx5Ji1.js → closing-template-B9JOB9ah.js} +1 -1
- package/dist/components/row-action.enum.d.ts +2 -1
- package/dist/{date2-BMCS_Dsc.js → date2-Ci9tlLMJ.js} +1 -1
- package/dist/{dayjs.min-Dl26OaXo.js → dayjs.min-DTx2lmq6.js} +26 -26
- package/dist/{decimal-e6OK2jkR.js → decimal-iKhH_VJO.js} +2 -2
- package/dist/{defineDeepModel-BvLlwxnd.js → defineDeepModel-C25T8oyP.js} +1 -1
- package/dist/{duplicate-template-Cnhu8Rxw.js → duplicate-template-BptIBRQ3.js} +1 -1
- package/dist/{empty-placeholder-B0QU467o.js → empty-placeholder-wf6-BWE8.js} +1 -1
- package/dist/{export-CGvyGmeo.js → export-CKuVd5pP.js} +1 -1
- package/dist/{feature-Do41WWzx.js → feature-CXMSo4z7.js} +121 -116
- package/dist/{format-time-from-id-CqX_KaUG.js → format-time-from-id-Bk60g6lh.js} +1 -1
- package/dist/{format-unit-display-D8qWmRXP.js → format-unit-display-C4nf8hG8.js} +12 -12
- package/dist/{import-export.helper-85V8Ib5e.js → import-export.helper-BDzsQcYD.js} +6 -6
- package/dist/{index-C-CwnjUn.js → index-CUVlQagt.js} +3 -3
- package/dist/{index-CtUF9Nsv.js → index-DTszDSPO.js} +1 -1
- package/dist/{index-Cg3aLEhT.js → index-DiKOwY5C.js} +1 -1
- package/dist/{inventory-core-dart.default-B64FzAla.js → inventory-core-dart.default-Cn3sonot.js} +10 -10
- package/dist/{lodash-U9ycVPlv.js → lodash-DGOK6ZkA.js} +1 -1
- package/dist/{lz-string-0CgVsQoC.js → lz-string-QrWbdmw6.js} +21 -21
- package/dist/{netsuite-Du7-sXJt.js → netsuite-DglgyKcZ.js} +37 -37
- package/dist/{number-iJAzDfmj.js → number-Ut7u2ZEE.js} +11 -11
- package/dist/{predefined-templates-LlSrXOXm.js → predefined-templates-DZtFebPU.js} +1 -1
- package/dist/{purchase-order-template-DFuXb0rr.js → purchase-order-template-DhNVhXmD.js} +1 -1
- package/dist/{recalculationUtils-DWPnMW1G.js → recalculationUtils-CqJRd9B2.js} +1 -1
- package/dist/router/name.d.ts +0 -1
- package/dist/{row-action.enum-Co_O4qD9.js → row-action.enum-DQ9bJ_uv.js} +7 -1
- package/dist/{rules-DefSKiUN.js → rules-BIm67nl_.js} +2 -2
- package/dist/{stock-BfF6peMd.js → stock-CzdMn9n8.js} +3 -3
- package/dist/{stock-Cx1BwdWs.js → stock-Dc4_U69J.js} +27 -28
- package/dist/stores/feature.d.ts +2 -0
- package/dist/{supplier-CU3iqdGr.js → supplier-De5G6CeF.js} +2 -2
- package/dist/{surcharge-D77J5opH.js → surcharge-CN5FtDZq.js} +8 -8
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-B-jxV-79.js → use-ingredient-select-dialog-Wy4CtYcZ.js} +2 -2
- package/dist/{use-inventory-binding-dialog-BdTd5qPl.js → use-inventory-binding-dialog-C1LCH0jV.js} +2 -2
- package/dist/{use-template-enabled-locations-vFvaCjlH.js → use-template-enabled-locations-BfZFcXZ_.js} +2 -2
- package/dist/views/receive-request/components/email-dialog/EmailDialog.vue.d.ts +20 -0
- package/dist/views/receive-request/components/email-dialog/EmailDialogProps.d.ts +13 -0
- package/dist/views/receive-request/composables/use-order-draft-permission.d.ts +5 -2
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +3 -0
- package/dist/vue-i18n-CvVV4Xof.js +2365 -0
- package/dist/{xlsx-o7n1whCa.js → xlsx-lawW6Hwh.js} +570 -570
- package/dist/{xlsx.util-D6nPboPW.js → xlsx.util-DSCqPt8v.js} +1 -1
- package/package.json +2 -2
- package/dist/App-D1_jkD6L.js +0 -309
- package/dist/DefaultView-COVVxOrF.js +0 -31
- package/dist/ReceiveRequestView-oNBVAMYu.js +0 -2817
- package/dist/StockView-CRRdVCcD.js +0 -2439
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-BLlg1Vka.js +0 -3837
- package/dist/components/HrmPermissionGuard.vue.d.ts +0 -54
- package/dist/composable/useHrmPermission.d.ts +0 -17
- package/dist/composable/useInventoryAccess.d.ts +0 -11
- package/dist/composable/useNavigationMenu.d.ts +0 -14
- package/dist/router/route-permission.d.ts +0 -10
- package/dist/useHrmPermission-CekUhyck.js +0 -16
- package/dist/useNavigationMenu-BiLWMIip.js +0 -162
- package/dist/views/DefaultView.vue.d.ts +0 -2
- package/dist/vue-i18n-C3_OsgSl.js +0 -2365
|
@@ -1,66 +1,63 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { u as
|
|
3
|
-
import {
|
|
4
|
-
import { useSnackbar as q, useBreakpoints as
|
|
5
|
-
import { _ as
|
|
6
|
-
import {
|
|
7
|
-
import { b as Y } from "./date2-
|
|
8
|
-
import { d as j } from "./number-
|
|
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
|
|
12
|
-
const i = J()
|
|
11
|
+
const te = re((w, _) => {
|
|
12
|
+
const i = J();
|
|
13
13
|
return {
|
|
14
|
-
async getLatestCostForAllSkus(
|
|
15
|
-
|
|
16
|
-
|
|
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(
|
|
20
|
-
|
|
21
|
-
|
|
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(
|
|
25
|
-
|
|
26
|
-
|
|
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
|
|
31
|
-
const
|
|
32
|
-
if (!
|
|
33
|
-
const
|
|
34
|
-
return await
|
|
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
|
|
36
|
+
const w = te(), _ = J(), i = h([]), d = h(!1);
|
|
40
37
|
async function o() {
|
|
41
|
-
if (!
|
|
38
|
+
if (!_._currentLocation)
|
|
42
39
|
return [];
|
|
43
|
-
|
|
40
|
+
d.value = !0;
|
|
44
41
|
try {
|
|
45
|
-
const
|
|
46
|
-
return i.value =
|
|
42
|
+
const C = _.currentLocation.doc._id, m = await w.getLatestCostForAllSkus(C);
|
|
43
|
+
return i.value = m, m;
|
|
47
44
|
} finally {
|
|
48
|
-
|
|
45
|
+
d.value = !1;
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
48
|
return {
|
|
52
49
|
historyData: i,
|
|
53
|
-
isLoading:
|
|
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" },
|
|
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" },
|
|
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
|
-
},
|
|
69
|
+
}, Ne = {
|
|
73
70
|
key: 0,
|
|
74
71
|
class: "flex gap-8 ml-auto"
|
|
75
|
-
},
|
|
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(
|
|
82
|
-
const
|
|
83
|
-
if (!s.value || !
|
|
84
|
-
const
|
|
85
|
-
return new Date(
|
|
86
|
-
}), R =
|
|
87
|
-
(
|
|
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
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
s.value =
|
|
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
|
-
|
|
94
|
+
x.value = !1;
|
|
98
95
|
}
|
|
99
|
-
|
|
100
|
-
open:
|
|
96
|
+
_({
|
|
97
|
+
open: V,
|
|
101
98
|
close: P
|
|
102
99
|
});
|
|
103
100
|
async function K() {
|
|
104
|
-
|
|
101
|
+
B.value = !0;
|
|
105
102
|
try {
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
} catch (
|
|
109
|
-
console.error("Error fetching recalculation requests:",
|
|
103
|
+
const f = await C.listRecentRecalculationRequests();
|
|
104
|
+
$.value = f;
|
|
105
|
+
} catch (f) {
|
|
106
|
+
console.error("Error fetching recalculation requests:", f);
|
|
110
107
|
} finally {
|
|
111
|
-
|
|
108
|
+
B.value = !1;
|
|
112
109
|
}
|
|
113
110
|
}
|
|
114
111
|
async function W() {
|
|
115
|
-
var
|
|
112
|
+
var f, c;
|
|
116
113
|
if (R.value) {
|
|
117
|
-
|
|
114
|
+
v.value = !0;
|
|
118
115
|
try {
|
|
119
|
-
const
|
|
120
|
-
if (!
|
|
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
|
|
125
|
-
businessId:
|
|
121
|
+
await C.recalculate({
|
|
122
|
+
businessId: S,
|
|
126
123
|
locationId: N,
|
|
127
124
|
startDate: s.value,
|
|
128
|
-
endDate:
|
|
129
|
-
}),
|
|
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(),
|
|
134
|
-
} catch (
|
|
135
|
-
console.error("Error scheduling recalculation:",
|
|
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
|
-
|
|
138
|
+
v.value = !1;
|
|
142
139
|
}
|
|
143
140
|
}
|
|
144
141
|
}
|
|
145
|
-
return (
|
|
146
|
-
const
|
|
147
|
-
return
|
|
148
|
-
|
|
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:
|
|
148
|
+
onClick: oe(V, ["stop"])
|
|
152
149
|
}),
|
|
153
|
-
|
|
154
|
-
modelValue:
|
|
155
|
-
"onUpdate:modelValue":
|
|
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,
|
|
157
|
+
"dialog-header": A(() => [
|
|
158
|
+
t("div", pe, n(r(o)("inventory.unitCost.recalculation.title")), 1)
|
|
162
159
|
]),
|
|
163
|
-
"dialog-footer":
|
|
164
|
-
|
|
165
|
-
|
|
160
|
+
"dialog-footer": A(() => [
|
|
161
|
+
k.value ? (u(), g("div", Be, [
|
|
162
|
+
p(S, {
|
|
166
163
|
variant: "tertiary",
|
|
167
|
-
onClick:
|
|
164
|
+
onClick: c[3] || (c[3] = (e) => x.value = !1),
|
|
168
165
|
label: r(o)("common.close")
|
|
169
166
|
}, null, 8, ["label"])
|
|
170
|
-
])) : (
|
|
171
|
-
|
|
167
|
+
])) : (u(), g("div", Ne, [
|
|
168
|
+
p(S, {
|
|
172
169
|
variant: "tertiary",
|
|
173
|
-
onClick:
|
|
174
|
-
disabled:
|
|
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
|
-
|
|
174
|
+
p(S, {
|
|
178
175
|
variant: "primary",
|
|
179
176
|
onClick: W,
|
|
180
|
-
disabled: !R.value ||
|
|
181
|
-
loading:
|
|
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,
|
|
189
|
-
|
|
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",
|
|
192
|
-
H(
|
|
193
|
-
|
|
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
|
-
|
|
192
|
+
p(N, {
|
|
196
193
|
modelValue: s.value,
|
|
197
|
-
"onUpdate:modelValue":
|
|
194
|
+
"onUpdate:modelValue": c[0] || (c[0] = (e) => s.value = e),
|
|
198
195
|
placeholder: r(o)("inventory.unitCost.recalculation.selectStartDate"),
|
|
199
|
-
disabled:
|
|
196
|
+
disabled: v.value
|
|
200
197
|
}, null, 8, ["modelValue", "placeholder", "disabled"])
|
|
201
198
|
]),
|
|
202
|
-
t("div",
|
|
199
|
+
t("div", _e, [
|
|
203
200
|
t("p", xe, [
|
|
204
|
-
H(
|
|
205
|
-
|
|
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
|
-
|
|
208
|
-
modelValue:
|
|
209
|
-
"onUpdate:modelValue":
|
|
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 ||
|
|
208
|
+
disabled: !s.value || v.value,
|
|
212
209
|
min: s.value
|
|
213
210
|
}, null, 8, ["modelValue", "placeholder", "disabled", "min"]),
|
|
214
|
-
|
|
211
|
+
D.value ? (u(), g("div", Ce, n(D.value), 1)) : F("", !0)
|
|
215
212
|
]),
|
|
216
|
-
s.value &&
|
|
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,
|
|
217
|
+
default: A(() => [
|
|
218
|
+
t("div", ke, n(r(o)("inventory.unitCost.recalculation.info")), 1)
|
|
222
219
|
]),
|
|
223
220
|
_: 1
|
|
224
|
-
})) :
|
|
221
|
+
})) : F("", !0)
|
|
225
222
|
], 64)),
|
|
226
|
-
|
|
227
|
-
t("p", we,
|
|
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
|
-
(
|
|
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,
|
|
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
|
-
},
|
|
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",
|
|
244
|
-
t("div",
|
|
245
|
-
e.createdBy ? (
|
|
246
|
-
e.completedAt ? (
|
|
247
|
-
e.failedReason ? (
|
|
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
|
-
])) :
|
|
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(
|
|
267
|
-
const i =
|
|
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 ?
|
|
270
|
-
}),
|
|
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,
|
|
269
|
+
const s = i.record.previousCost.amount, v = i.record.cost.amount - s;
|
|
273
270
|
return {
|
|
274
|
-
amount: Math.abs(
|
|
271
|
+
amount: Math.abs(v),
|
|
275
272
|
precision: i.record.cost.precision,
|
|
276
273
|
currency: i.record.cost.currency,
|
|
277
|
-
isIncrease:
|
|
274
|
+
isIncrease: v > 0
|
|
278
275
|
};
|
|
279
|
-
}),
|
|
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
|
-
|
|
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
|
|
286
|
+
function M() {
|
|
290
287
|
o.value = !0;
|
|
291
288
|
}
|
|
292
|
-
function
|
|
289
|
+
function x() {
|
|
293
290
|
o.value = !1;
|
|
294
291
|
}
|
|
295
|
-
return
|
|
296
|
-
open:
|
|
297
|
-
close:
|
|
298
|
-
}), (s,
|
|
299
|
-
const
|
|
300
|
-
return
|
|
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":
|
|
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
|
-
|
|
307
|
+
p(B, {
|
|
311
308
|
variant: "tertiary",
|
|
312
|
-
onClick:
|
|
309
|
+
onClick: x,
|
|
313
310
|
label: "Close"
|
|
314
311
|
})
|
|
315
312
|
])
|
|
316
313
|
]),
|
|
317
|
-
default:
|
|
318
|
-
s.record ? (
|
|
319
|
-
|
|
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,
|
|
320
|
+
default: A(() => {
|
|
321
|
+
var R, k;
|
|
325
322
|
return [
|
|
326
|
-
|
|
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
|
-
|
|
326
|
+
p(v),
|
|
330
327
|
t("div", Me, [
|
|
331
328
|
t("div", ze, [
|
|
332
329
|
t("div", He, [
|
|
333
|
-
|
|
334
|
-
t("div", Ee,
|
|
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
|
-
|
|
338
|
-
t("div", Ke,
|
|
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
|
-
|
|
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(
|
|
344
|
-
|
|
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":
|
|
348
|
-
"text-fm-color-system-error-500": !
|
|
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":
|
|
354
|
-
"text-green-600": !
|
|
350
|
+
"text-red-500": m.value.isIncrease,
|
|
351
|
+
"text-green-600": !m.value.isIncrease
|
|
355
352
|
})
|
|
356
|
-
},
|
|
353
|
+
}, n(m.value.isIncrease ? "↑" : "↓"), 3),
|
|
357
354
|
t("span", {
|
|
358
355
|
class: E({
|
|
359
|
-
"text-red-500":
|
|
360
|
-
"text-green-600": !
|
|
356
|
+
"text-red-500": m.value.isIncrease,
|
|
357
|
+
"text-green-600": !m.value.isIncrease
|
|
361
358
|
})
|
|
362
|
-
},
|
|
363
|
-
], 2)) :
|
|
359
|
+
}, n(m.value.isIncrease ? "Increase" : "Decrease"), 3)
|
|
360
|
+
], 2)) : F("", !0)
|
|
364
361
|
])
|
|
365
362
|
]),
|
|
366
363
|
t("div", je, [
|
|
367
|
-
|
|
368
|
-
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)(
|
|
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
|
-
|
|
376
|
-
t("div", Ge,
|
|
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
|
-
|
|
380
|
-
t("div", Xe,
|
|
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
|
-
|
|
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 ? (
|
|
386
|
-
H(
|
|
387
|
-
], 64)) : (
|
|
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
|
-
|
|
399
|
-
default:
|
|
400
|
-
|
|
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
|
-
|
|
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
|
-
|
|
405
|
+
p(v),
|
|
409
406
|
t("div", et, [
|
|
410
|
-
t("pre", tt,
|
|
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
|
-
])) :
|
|
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(
|
|
428
|
-
const { t:
|
|
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:
|
|
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:
|
|
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
|
-
]),
|
|
448
|
-
i.watchLocation(
|
|
449
|
-
async function
|
|
444
|
+
]), k = h(null);
|
|
445
|
+
i.watchLocation(V);
|
|
446
|
+
async function V() {
|
|
450
447
|
if (i._currentLocation)
|
|
451
448
|
try {
|
|
452
|
-
await
|
|
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 =
|
|
458
|
+
const P = b(() => {
|
|
462
459
|
const l = /* @__PURE__ */ new Map();
|
|
463
|
-
for (const e of
|
|
460
|
+
for (const e of d.skus)
|
|
464
461
|
l.set(e._id, e);
|
|
465
462
|
return l;
|
|
466
|
-
}), K =
|
|
467
|
-
let l =
|
|
468
|
-
if (
|
|
469
|
-
const e = me.build(
|
|
470
|
-
l = l.filter((
|
|
471
|
-
const
|
|
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: (
|
|
475
|
-
skuName: (
|
|
476
|
-
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
|
|
480
|
+
const y = P.value.get(e.skuId);
|
|
484
481
|
return {
|
|
485
482
|
...e,
|
|
486
|
-
skuCode: (
|
|
487
|
-
skuName: (
|
|
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 =
|
|
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
|
|
555
|
-
return Y(
|
|
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
|
-
]),
|
|
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:
|
|
566
|
+
label: _("inventory.common.refresh"),
|
|
570
567
|
value: "refresh"
|
|
571
568
|
}
|
|
572
569
|
]);
|
|
573
|
-
function
|
|
570
|
+
function c() {
|
|
574
571
|
var l;
|
|
575
|
-
(l =
|
|
572
|
+
(l = x.value) == null || l.open();
|
|
576
573
|
}
|
|
577
|
-
function
|
|
578
|
-
|
|
574
|
+
function S() {
|
|
575
|
+
V();
|
|
579
576
|
}
|
|
580
577
|
function N(l) {
|
|
581
578
|
var e;
|
|
582
|
-
|
|
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
|
|
584
|
+
return c();
|
|
588
585
|
case "refresh":
|
|
589
|
-
return
|
|
586
|
+
return V();
|
|
590
587
|
}
|
|
591
588
|
}
|
|
592
589
|
return (l, e) => {
|
|
593
|
-
const
|
|
594
|
-
return
|
|
590
|
+
const y = L("FmTable");
|
|
591
|
+
return u(), T(le, {
|
|
595
592
|
title: "Unit Cost History",
|
|
596
|
-
actions:
|
|
593
|
+
actions: f.value,
|
|
597
594
|
"onClick:action": G
|
|
598
595
|
}, {
|
|
599
|
-
default:
|
|
600
|
-
var
|
|
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":
|
|
607
|
-
"px-24": !
|
|
603
|
+
"p-0": U.value,
|
|
604
|
+
"px-24": !U.value
|
|
608
605
|
}
|
|
609
606
|
])
|
|
610
607
|
}, [
|
|
611
|
-
|
|
608
|
+
p(ce, {
|
|
612
609
|
searchable: "",
|
|
613
610
|
"change-location": "",
|
|
614
|
-
search:
|
|
615
|
-
"onUpdate:search": e[0] || (e[0] = (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:
|
|
619
|
-
"onUpdate:filter": e[1] || (e[1] = (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
|
-
(
|
|
622
|
-
key: `${(
|
|
623
|
-
style: ae(r(
|
|
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":
|
|
627
|
-
loading: r(
|
|
628
|
-
"page-size":
|
|
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
|
-
(
|
|
633
|
-
|
|
629
|
+
(u(), T(X, { to: "body" }, [
|
|
630
|
+
p(Ve, {
|
|
634
631
|
ref_key: "recalculationDialogRef",
|
|
635
|
-
ref:
|
|
636
|
-
onSubmitted:
|
|
632
|
+
ref: x,
|
|
633
|
+
onSubmitted: S
|
|
637
634
|
}, null, 512)
|
|
638
635
|
])),
|
|
639
|
-
(
|
|
640
|
-
|
|
636
|
+
(u(), T(X, { to: "body" }, [
|
|
637
|
+
p(st, {
|
|
641
638
|
ref_key: "detailsSideSheetRef",
|
|
642
639
|
ref: s,
|
|
643
|
-
record:
|
|
640
|
+
record: a.value
|
|
644
641
|
}, null, 8, ["record"])
|
|
645
642
|
]))
|
|
646
643
|
];
|