@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.
- package/dist/App-BckRpjrE.js +309 -0
- package/dist/{ApprovalView-BVszC4Cw.js → ApprovalView-C5rVI_O7.js} +17 -17
- package/dist/{BindingsDialog-B3L_3xdo.js → BindingsDialog-Y530TN7D.js} +13 -13
- package/dist/{BindingsPicker-A4togB2v.js → BindingsPicker-BbQ9Ygep.js} +2 -2
- package/dist/{BindingsTable-DacoMdY6.js → BindingsTable-ClHmMFLP.js} +3 -3
- package/dist/{ClosingDraftView-C9tvMgLl.js → ClosingDraftView-Dn16j97_.js} +15 -15
- package/dist/{ClosingHistoryView-CqqzqSqU.js → ClosingHistoryView-BK7KJbbf.js} +5 -5
- package/dist/{ClosingTemplateView-CLi0XE8S.js → ClosingTemplateView-D2petgop.js} +14 -14
- package/dist/DefaultView-CdCpGT5n.js +31 -0
- package/dist/{DeliveryOrderPrintPreview-DEHEfd80.js → DeliveryOrderPrintPreview-C_S4SG8h.js} +11 -11
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-GT5YUrJz.js +76 -0
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-xxS4P6uo.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-q8fQfbEV.js} +2 -2
- package/dist/{FmMultiselectDialog-CR2peMEL.js → FmMultiselectDialog-6JADZ5xC.js} +1 -1
- package/dist/{FmMultiselectDialog-FGR8t9rz.js → FmMultiselectDialog-BEkAAZZp.js} +16 -16
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DgXOsVLe.js → FmUnitInput.vue_vue_type_script_setup_true_lang-kaW8FwP5.js} +6 -5
- package/dist/{ImportView-CEI0QqGz.js → ImportView-D8i5_GO9.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-cRgKjHY0.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-baV8qK0P.js} +1 -1
- package/dist/{IngredientGroupView-DEELNMpl.js → IngredientGroupView-BiqFuJx0.js} +5 -5
- package/dist/{IngredientsView-D3OcjZdT.js → IngredientsView-CQHobUvF.js} +15 -15
- package/dist/{IntegrationExplorerView-ByPpT3hC.js → IntegrationExplorerView-BFbGH5-S.js} +5 -5
- package/dist/{IntegrationView-BSqlJBp-.js → IntegrationView-UF8UwPNk.js} +81 -81
- package/dist/{InventoryBindingForm-SgmyJvCs.js → InventoryBindingForm-DB4LwgzC.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-GLipe2bO.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Dc0sxYMV.js} +5 -5
- package/dist/{InventoryBindingSummary-D6deGR6B.js → InventoryBindingSummary-Bwn4HZy5.js} +1 -1
- 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
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-ff1rPUJW.js → PremiumBadge.vue_vue_type_script_setup_true_lang-D2wiVygJ.js} +7 -7
- package/dist/{PublishView-7TAa2QQB.js → PublishView-BFac9M5C.js} +15 -15
- package/dist/{PurchaseOrderPrintPreview-DhcnInSW.js → PurchaseOrderPrintPreview-tree07u5.js} +11 -11
- package/dist/{ReceiveRequestView-Z3JYH3gf.js → ReceiveRequestView-DLERk28I.js} +30 -29
- package/dist/RecipeView-DDgN0DkI.js +2898 -0
- package/dist/{SettingsView-F_BWUxoq.js → SettingsView-BWw7AhqT.js} +4 -4
- package/dist/StockView-D0wW54eN.js +2439 -0
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CxNgi5uv.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Btor1W6X.js} +1 -1
- package/dist/{SupplierView-DklOXwHD.js → SupplierView-Bd_PLuYt.js} +12 -12
- package/dist/{SurchargeView-DcImorUr.js → SurchargeView-F1B_fcv-.js} +16 -16
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-xdLxGAOM.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-95m2qnoM.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Bu4XKhII.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DHKDRFgr.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DMrRfwKD.js → TransferDetails.vue_vue_type_script_setup_true_lang-BC0PNCtM.js} +812 -828
- package/dist/{TransferTemplateView-DTdlSI2b.js → TransferTemplateView-DM8qOCpO.js} +20 -19
- package/dist/{UnitCostHistoryView-CQ_DJE-t.js → UnitCostHistoryView-Bzocbij3.js} +246 -243
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-QuejzcCL.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BDzz91rl.js} +4 -4
- package/dist/{UnitView-DzcCdCGw.js → UnitView-EndrhMnI.js} +7 -7
- package/dist/{WarehouseView-BYj9DD1N.js → WarehouseView-BJZELae1.js} +25 -25
- package/dist/{WastageTemplateView--w6an2Ar.js → WastageTemplateView-s6ZiQR8E.js} +14 -14
- package/dist/{app-CPlgHGkC.js → app-CaGW5ogt.js} +23768 -22367
- package/dist/app.d.ts +148 -6
- package/dist/app.js +5 -5
- package/dist/{closing-template-B9JOB9ah.js → closing-template-CUgXd6Na.js} +1 -1
- package/dist/components/HrmPermissionGuard.vue.d.ts +54 -0
- package/dist/composable/useHrmPermission.d.ts +17 -0
- package/dist/composable/useInventoryAccess.d.ts +11 -0
- package/dist/composable/useNavigationMenu.d.ts +14 -0
- package/dist/{date2-Ci9tlLMJ.js → date2-fQDP1Rtk.js} +1 -1
- package/dist/{dayjs.min-DTx2lmq6.js → dayjs.min-UwaUKDHA.js} +32 -32
- package/dist/{decimal-iKhH_VJO.js → decimal-CKysiOcn.js} +2 -2
- package/dist/{defineDeepModel-C25T8oyP.js → defineDeepModel-CwM7TJuT.js} +1 -1
- package/dist/{duplicate-template-BptIBRQ3.js → duplicate-template-Bb5b_40t.js} +1 -1
- package/dist/{empty-placeholder-wf6-BWE8.js → empty-placeholder-B0QU467o.js} +1 -1
- package/dist/{export-CKuVd5pP.js → export-nbyx5EYR.js} +1 -1
- package/dist/{feature-CXMSo4z7.js → feature-Dqme8-Xr.js} +22 -22
- package/dist/{format-time-from-id-Bk60g6lh.js → format-time-from-id-DsRN_JB-.js} +1 -1
- package/dist/{format-unit-display-C4nf8hG8.js → format-unit-display-Df1v6CMC.js} +11 -11
- package/dist/{import-export.helper-BDzsQcYD.js → import-export.helper-QInnTLhY.js} +6 -6
- package/dist/{index-CUVlQagt.js → index-BCwp1fKe.js} +3 -3
- package/dist/{index-DiKOwY5C.js → index-CbwjQK_M.js} +1 -1
- package/dist/{index-DTszDSPO.js → index-Cij7rBSm.js} +1 -1
- package/dist/{inventory-core-dart.default-Cn3sonot.js → inventory-core-dart.default-Bgq3Sd7C.js} +10 -10
- package/dist/{lodash-DGOK6ZkA.js → lodash-B15PREHg.js} +1 -1
- package/dist/{lz-string-QrWbdmw6.js → lz-string-DdnEcXDA.js} +21 -21
- package/dist/{netsuite-DglgyKcZ.js → netsuite-NcBlI9QO.js} +37 -37
- package/dist/{number-Ut7u2ZEE.js → number-DQ-rkxYN.js} +11 -11
- package/dist/{predefined-templates-DZtFebPU.js → predefined-templates-zYAuXO9-.js} +1 -1
- package/dist/{purchase-order-template-DhNVhXmD.js → purchase-order-template-DcoKKoiW.js} +1 -1
- package/dist/{recalculationUtils-CqJRd9B2.js → recalculationUtils-MW6hf5oz.js} +1 -1
- package/dist/router/name.d.ts +1 -0
- package/dist/router/route-permission.d.ts +10 -0
- package/dist/{rules-BIm67nl_.js → rules-CxC7ePEb.js} +2 -2
- package/dist/{stock-Dc4_U69J.js → stock-Bly2vXJq.js} +28 -27
- package/dist/{stock-CzdMn9n8.js → stock-Bqk5_C4b.js} +3 -3
- package/dist/{supplier-De5G6CeF.js → supplier-B0yIc028.js} +2 -2
- package/dist/{surcharge-CN5FtDZq.js → surcharge-BZa9y16I.js} +8 -8
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-Wy4CtYcZ.js → use-ingredient-select-dialog-BGPPfGO-.js} +2 -2
- package/dist/{use-inventory-binding-dialog-C1LCH0jV.js → use-inventory-binding-dialog-DUsjKdNr.js} +2 -2
- package/dist/{use-template-enabled-locations-BfZFcXZ_.js → use-template-enabled-locations-D2EWKhWK.js} +2 -2
- package/dist/use-transfer-locations-BRQbfZYI.js +116 -0
- package/dist/useHrmPermission-BZSfcBwi.js +16 -0
- package/dist/useNavigationMenu-C7F5h-H5.js +162 -0
- package/dist/views/DefaultView.vue.d.ts +2 -0
- package/dist/views/receive-request/composables/use-order-draft-permission.d.ts +2 -5
- package/dist/views/recipe/components/recipe-bulk-editor/RecipeBulkEditorDialog.vue.d.ts +19 -0
- package/dist/views/recipe/components/recipe-bulk-editor/RecipeBulkEditorQueryStep.vue.d.ts +2 -0
- package/dist/views/recipe/components/recipe-bulk-editor/RecipeBulkEditorSummaryStep.vue.d.ts +2 -0
- package/dist/views/recipe/composables/use-recipe-bulk-editor.d.ts +634 -0
- package/dist/{vue-i18n-CvVV4Xof.js → vue-i18n-BuXEP0EQ.js} +348 -348
- package/dist/{xlsx-lawW6Hwh.js → xlsx-C0BSmeBh.js} +1 -1
- package/dist/{xlsx.util-DSCqPt8v.js → xlsx.util-CyLHh8k-.js} +1 -1
- package/package.json +4 -3
- package/dist/App-BQZQFNKG.js +0 -411
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BDZVaj3l.js +0 -188
- package/dist/RecipeView--ALwYD-O.js +0 -1692
- package/dist/StockView-BLrquJf2.js +0 -2406
|
@@ -1,63 +1,66 @@
|
|
|
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 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
|
|
12
|
-
const i = J();
|
|
11
|
+
const oe = ie((D, C) => {
|
|
12
|
+
const i = J(), v = ee();
|
|
13
13
|
return {
|
|
14
|
-
async getLatestCostForAllSkus(
|
|
15
|
-
|
|
16
|
-
|
|
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(
|
|
19
|
-
|
|
20
|
-
|
|
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(
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
28
|
-
const
|
|
29
|
-
if (!
|
|
30
|
-
const
|
|
31
|
-
return await
|
|
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
|
|
39
|
+
const D = oe(), C = J(), i = x([]), v = x(!1);
|
|
37
40
|
async function o() {
|
|
38
|
-
if (!
|
|
41
|
+
if (!C._currentLocation)
|
|
39
42
|
return [];
|
|
40
|
-
|
|
43
|
+
v.value = !0;
|
|
41
44
|
try {
|
|
42
|
-
const
|
|
43
|
-
return i.value =
|
|
45
|
+
const f = C.currentLocation.doc._id, c = await D.getLatestCostForAllSkus(f);
|
|
46
|
+
return i.value = c, c;
|
|
44
47
|
} finally {
|
|
45
|
-
|
|
48
|
+
v.value = !1;
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
return {
|
|
49
52
|
historyData: i,
|
|
50
|
-
isLoading:
|
|
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" },
|
|
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" },
|
|
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
|
-
},
|
|
72
|
+
}, Be = {
|
|
70
73
|
key: 0,
|
|
71
74
|
class: "flex gap-8 ml-auto"
|
|
72
|
-
},
|
|
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(
|
|
79
|
-
const
|
|
80
|
-
if (!s.value || !
|
|
81
|
-
const
|
|
82
|
-
return new Date(
|
|
83
|
-
}), R =
|
|
84
|
-
(
|
|
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
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
s.value =
|
|
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
|
-
|
|
97
|
+
k.value = !1;
|
|
95
98
|
}
|
|
96
|
-
|
|
97
|
-
open:
|
|
99
|
+
C({
|
|
100
|
+
open: T,
|
|
98
101
|
close: P
|
|
99
102
|
});
|
|
100
103
|
async function K() {
|
|
101
|
-
|
|
104
|
+
V.value = !0;
|
|
102
105
|
try {
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
} catch (
|
|
106
|
-
console.error("Error fetching recalculation requests:",
|
|
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
|
-
|
|
111
|
+
V.value = !1;
|
|
109
112
|
}
|
|
110
113
|
}
|
|
111
114
|
async function W() {
|
|
112
|
-
var
|
|
115
|
+
var y, u;
|
|
113
116
|
if (R.value) {
|
|
114
|
-
|
|
117
|
+
b.value = !0;
|
|
115
118
|
try {
|
|
116
|
-
const
|
|
117
|
-
if (!
|
|
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
|
|
122
|
-
businessId:
|
|
124
|
+
await f.recalculate({
|
|
125
|
+
businessId: w,
|
|
123
126
|
locationId: N,
|
|
124
127
|
startDate: s.value,
|
|
125
|
-
endDate:
|
|
126
|
-
}),
|
|
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(),
|
|
131
|
-
} catch (
|
|
132
|
-
console.error("Error scheduling recalculation:",
|
|
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
|
-
|
|
141
|
+
b.value = !1;
|
|
139
142
|
}
|
|
140
143
|
}
|
|
141
144
|
}
|
|
142
|
-
return (
|
|
143
|
-
const
|
|
144
|
-
return
|
|
145
|
-
|
|
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:
|
|
151
|
+
onClick: se(T, ["stop"])
|
|
149
152
|
}),
|
|
150
|
-
|
|
151
|
-
modelValue:
|
|
152
|
-
"onUpdate:modelValue":
|
|
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":
|
|
158
|
-
t("div", pe,
|
|
160
|
+
"dialog-header": $(() => [
|
|
161
|
+
t("div", pe, a(r(o)("inventory.unitCost.recalculation.title")), 1)
|
|
159
162
|
]),
|
|
160
|
-
"dialog-footer":
|
|
161
|
-
|
|
162
|
-
|
|
163
|
+
"dialog-footer": $(() => [
|
|
164
|
+
S.value ? (d(), _("div", Ne, [
|
|
165
|
+
g(w, {
|
|
163
166
|
variant: "tertiary",
|
|
164
|
-
onClick:
|
|
167
|
+
onClick: u[3] || (u[3] = (e) => k.value = !1),
|
|
165
168
|
label: r(o)("common.close")
|
|
166
169
|
}, null, 8, ["label"])
|
|
167
|
-
])) : (
|
|
168
|
-
|
|
170
|
+
])) : (d(), _("div", Be, [
|
|
171
|
+
g(w, {
|
|
169
172
|
variant: "tertiary",
|
|
170
|
-
onClick:
|
|
171
|
-
disabled:
|
|
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
|
-
|
|
177
|
+
g(w, {
|
|
175
178
|
variant: "primary",
|
|
176
179
|
onClick: W,
|
|
177
|
-
disabled: !R.value ||
|
|
178
|
-
loading:
|
|
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:
|
|
186
|
+
default: $(() => [
|
|
184
187
|
t("div", ve, [
|
|
185
|
-
t("div", ge,
|
|
186
|
-
|
|
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",
|
|
189
|
-
H(
|
|
190
|
-
|
|
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
|
-
|
|
195
|
+
g(N, {
|
|
193
196
|
modelValue: s.value,
|
|
194
|
-
"onUpdate:modelValue":
|
|
197
|
+
"onUpdate:modelValue": u[0] || (u[0] = (e) => s.value = e),
|
|
195
198
|
placeholder: r(o)("inventory.unitCost.recalculation.selectStartDate"),
|
|
196
|
-
disabled:
|
|
199
|
+
disabled: b.value
|
|
197
200
|
}, null, 8, ["modelValue", "placeholder", "disabled"])
|
|
198
201
|
]),
|
|
199
|
-
t("div",
|
|
202
|
+
t("div", he, [
|
|
200
203
|
t("p", xe, [
|
|
201
|
-
H(
|
|
202
|
-
|
|
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
|
-
|
|
205
|
-
modelValue:
|
|
206
|
-
"onUpdate:modelValue":
|
|
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 ||
|
|
211
|
+
disabled: !s.value || b.value,
|
|
209
212
|
min: s.value
|
|
210
213
|
}, null, 8, ["modelValue", "placeholder", "disabled", "min"]),
|
|
211
|
-
|
|
214
|
+
A.value ? (d(), _("div", Ce, a(A.value), 1)) : L("", !0)
|
|
212
215
|
]),
|
|
213
|
-
s.value &&
|
|
216
|
+
s.value && n.value && !A.value ? (d(), M(G, {
|
|
214
217
|
key: 0,
|
|
215
218
|
type: "info"
|
|
216
219
|
}, {
|
|
217
|
-
default:
|
|
218
|
-
t("div", ke,
|
|
220
|
+
default: $(() => [
|
|
221
|
+
t("div", ke, a(r(o)("inventory.unitCost.recalculation.info")), 1)
|
|
219
222
|
]),
|
|
220
223
|
_: 1
|
|
221
|
-
})) :
|
|
224
|
+
})) : L("", !0)
|
|
222
225
|
], 64)),
|
|
223
|
-
|
|
224
|
-
t("p", we,
|
|
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
|
-
(
|
|
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,
|
|
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
|
-
},
|
|
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",
|
|
241
|
-
t("div",
|
|
242
|
-
e.createdBy ? (
|
|
243
|
-
e.completedAt ? (
|
|
244
|
-
e.failedReason ? (
|
|
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
|
-
])) :
|
|
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(
|
|
264
|
-
const i =
|
|
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 ?
|
|
267
|
-
}),
|
|
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,
|
|
272
|
+
const s = i.record.previousCost.amount, b = i.record.cost.amount - s;
|
|
270
273
|
return {
|
|
271
|
-
amount: Math.abs(
|
|
274
|
+
amount: Math.abs(b),
|
|
272
275
|
precision: i.record.cost.precision,
|
|
273
276
|
currency: i.record.cost.currency,
|
|
274
|
-
isIncrease:
|
|
277
|
+
isIncrease: b > 0
|
|
275
278
|
};
|
|
276
|
-
}),
|
|
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
|
-
|
|
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
|
|
289
|
+
function B() {
|
|
287
290
|
o.value = !0;
|
|
288
291
|
}
|
|
289
|
-
function
|
|
292
|
+
function k() {
|
|
290
293
|
o.value = !1;
|
|
291
294
|
}
|
|
292
|
-
return
|
|
293
|
-
open:
|
|
294
|
-
close:
|
|
295
|
-
}), (s,
|
|
296
|
-
const
|
|
297
|
-
return
|
|
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":
|
|
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":
|
|
308
|
+
"side-sheet-footer": $(() => [
|
|
306
309
|
t("div", ot, [
|
|
307
|
-
|
|
310
|
+
g(V, {
|
|
308
311
|
variant: "tertiary",
|
|
309
|
-
onClick:
|
|
312
|
+
onClick: k,
|
|
310
313
|
label: "Close"
|
|
311
314
|
})
|
|
312
315
|
])
|
|
313
316
|
]),
|
|
314
|
-
default:
|
|
315
|
-
s.record ? (
|
|
316
|
-
|
|
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:
|
|
321
|
-
var R,
|
|
323
|
+
default: $(() => {
|
|
324
|
+
var R, S;
|
|
322
325
|
return [
|
|
323
|
-
|
|
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
|
-
|
|
329
|
+
g(b),
|
|
327
330
|
t("div", Me, [
|
|
328
331
|
t("div", ze, [
|
|
329
332
|
t("div", He, [
|
|
330
|
-
|
|
331
|
-
t("div", Ee,
|
|
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
|
-
|
|
335
|
-
t("div", Ke,
|
|
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
|
-
|
|
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(
|
|
341
|
-
|
|
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":
|
|
345
|
-
"text-fm-color-system-error-500": !
|
|
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":
|
|
351
|
-
"text-green-600": !
|
|
353
|
+
"text-red-500": c.value.isIncrease,
|
|
354
|
+
"text-green-600": !c.value.isIncrease
|
|
352
355
|
})
|
|
353
|
-
},
|
|
356
|
+
}, a(c.value.isIncrease ? "↑" : "↓"), 3),
|
|
354
357
|
t("span", {
|
|
355
358
|
class: E({
|
|
356
|
-
"text-red-500":
|
|
357
|
-
"text-green-600": !
|
|
359
|
+
"text-red-500": c.value.isIncrease,
|
|
360
|
+
"text-green-600": !c.value.isIncrease
|
|
358
361
|
})
|
|
359
|
-
},
|
|
360
|
-
], 2)) :
|
|
362
|
+
}, a(c.value.isIncrease ? "Increase" : "Decrease"), 3)
|
|
363
|
+
], 2)) : L("", !0)
|
|
361
364
|
])
|
|
362
365
|
]),
|
|
363
366
|
t("div", je, [
|
|
364
|
-
|
|
365
|
-
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)(
|
|
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
|
-
|
|
373
|
-
t("div", Ge,
|
|
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
|
-
|
|
377
|
-
t("div", Xe,
|
|
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
|
-
|
|
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 ? (
|
|
383
|
-
H(
|
|
384
|
-
], 64)) : (
|
|
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
|
-
|
|
396
|
-
default:
|
|
397
|
-
|
|
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:
|
|
402
|
-
|
|
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
|
-
|
|
408
|
+
g(b),
|
|
406
409
|
t("div", et, [
|
|
407
|
-
t("pre", tt,
|
|
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
|
-
])) :
|
|
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(
|
|
425
|
-
const { t:
|
|
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:
|
|
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:
|
|
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
|
-
]),
|
|
445
|
-
i.watchLocation(
|
|
446
|
-
async function
|
|
447
|
+
]), S = x(null);
|
|
448
|
+
i.watchLocation(T);
|
|
449
|
+
async function T() {
|
|
447
450
|
if (i._currentLocation)
|
|
448
451
|
try {
|
|
449
|
-
await
|
|
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 =
|
|
461
|
+
const P = h(() => {
|
|
459
462
|
const l = /* @__PURE__ */ new Map();
|
|
460
|
-
for (const e of
|
|
463
|
+
for (const e of v.skus)
|
|
461
464
|
l.set(e._id, e);
|
|
462
465
|
return l;
|
|
463
|
-
}), K =
|
|
464
|
-
let l =
|
|
465
|
-
if (
|
|
466
|
-
const e = me.build(
|
|
467
|
-
l = l.filter((
|
|
468
|
-
const
|
|
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: (
|
|
472
|
-
skuName: (
|
|
473
|
-
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
|
|
483
|
+
const p = P.value.get(e.skuId);
|
|
481
484
|
return {
|
|
482
485
|
...e,
|
|
483
|
-
skuCode: (
|
|
484
|
-
skuName: (
|
|
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 =
|
|
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
|
|
552
|
-
return Y(
|
|
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
|
-
]),
|
|
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:
|
|
569
|
+
label: C("inventory.common.refresh"),
|
|
567
570
|
value: "refresh"
|
|
568
571
|
}
|
|
569
572
|
]);
|
|
570
|
-
function
|
|
573
|
+
function u() {
|
|
571
574
|
var l;
|
|
572
|
-
(l =
|
|
575
|
+
(l = k.value) == null || l.open();
|
|
573
576
|
}
|
|
574
|
-
function
|
|
575
|
-
|
|
577
|
+
function w() {
|
|
578
|
+
T();
|
|
576
579
|
}
|
|
577
580
|
function N(l) {
|
|
578
581
|
var e;
|
|
579
|
-
|
|
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
|
|
587
|
+
return u();
|
|
585
588
|
case "refresh":
|
|
586
|
-
return
|
|
589
|
+
return T();
|
|
587
590
|
}
|
|
588
591
|
}
|
|
589
592
|
return (l, e) => {
|
|
590
|
-
const
|
|
591
|
-
return
|
|
593
|
+
const p = U("FmTable");
|
|
594
|
+
return d(), M(re, {
|
|
592
595
|
title: "Unit Cost History",
|
|
593
|
-
actions:
|
|
596
|
+
actions: y.value,
|
|
594
597
|
"onClick:action": G
|
|
595
598
|
}, {
|
|
596
|
-
default:
|
|
597
|
-
var
|
|
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":
|
|
604
|
-
"px-24": !
|
|
606
|
+
"p-0": m.value,
|
|
607
|
+
"px-24": !m.value
|
|
605
608
|
}
|
|
606
609
|
])
|
|
607
610
|
}, [
|
|
608
|
-
|
|
611
|
+
g(ue, {
|
|
609
612
|
searchable: "",
|
|
610
613
|
"change-location": "",
|
|
611
|
-
search:
|
|
612
|
-
"onUpdate:search": e[0] || (e[0] = (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:
|
|
616
|
-
"onUpdate:filter": e[1] || (e[1] = (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
|
-
(
|
|
619
|
-
key: `${(
|
|
620
|
-
style: ae(r(
|
|
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":
|
|
624
|
-
loading: r(
|
|
625
|
-
"page-size":
|
|
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
|
-
(
|
|
630
|
-
|
|
632
|
+
(d(), M(X, { to: "body" }, [
|
|
633
|
+
g(Ve, {
|
|
631
634
|
ref_key: "recalculationDialogRef",
|
|
632
|
-
ref:
|
|
633
|
-
onSubmitted:
|
|
635
|
+
ref: k,
|
|
636
|
+
onSubmitted: w
|
|
634
637
|
}, null, 512)
|
|
635
638
|
])),
|
|
636
|
-
(
|
|
637
|
-
|
|
639
|
+
(d(), M(X, { to: "body" }, [
|
|
640
|
+
g(st, {
|
|
638
641
|
ref_key: "detailsSideSheetRef",
|
|
639
642
|
ref: s,
|
|
640
|
-
record:
|
|
643
|
+
record: n.value
|
|
641
644
|
}, null, 8, ["record"])
|
|
642
645
|
]))
|
|
643
646
|
];
|