@feedmepos/mf-inventory-portal 1.2.64 → 1.2.66-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-apJIvz1w.js → App-BUNonuLz.js} +82 -78
- package/dist/{ApprovalView-CnT6gEI8.js → ApprovalView-BlS1tfbh.js} +6 -6
- package/dist/{BindingsDialog-DLEGDbV2.js → BindingsDialog-tRpsVTm0.js} +5 -5
- package/dist/{BindingsPicker-1Xt1vCu9.js → BindingsPicker-CUvkqcAG.js} +3 -3
- package/dist/{BindingsTable-_0cOM0Kx.js → BindingsTable-B86pWYMk.js} +5 -5
- package/dist/{ClosingDraftView-DsVPsN87.js → ClosingDraftView-gMVnQcWw.js} +226 -224
- package/dist/ClosingHistoryView-DhbE1pEl.js +1147 -0
- package/dist/{ClosingTemplateView-DB3F1wul.js → ClosingTemplateView-Ywbdj05y.js} +15 -15
- package/dist/{DeliveryOrderPrintPreview-CglCMgHc.js → DeliveryOrderPrintPreview-BPhVNc_r.js} +7 -7
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-MMPTJodu.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BrPh_Nvx.js} +16 -16
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CCID5O2Y.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CkUwLhut.js} +3 -3
- package/dist/{FmMultiselectDialog-B8xFmCsH.js → FmMultiselectDialog-C6E_KMFO.js} +1 -1
- package/dist/{FmMultiselectDialog-lQM1qEEW.js → FmMultiselectDialog-DBXpkw5b.js} +16 -16
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BLDz8wwK.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D-ZqJ8sU.js} +23 -22
- package/dist/{ImportView-DeC-MPFn.js → ImportView-DV1e51qk.js} +7 -7
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BGDZlmsr.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DkQL7hK2.js} +1 -1
- package/dist/{IngredientGroupView-CuFwQ8Bo.js → IngredientGroupView-CdXGO34J.js} +6 -6
- package/dist/{IngredientsView-CfloqEqn.js → IngredientsView-D2qffNiJ.js} +26 -25
- package/dist/{IntegrationView-CFU0yG6C.js → IntegrationView-RFJIHXQv.js} +19 -18
- package/dist/{InventoryBindingForm-i7eNurS2.js → InventoryBindingForm-CPn-IXgg.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-zOo9YVJe.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-0Vrih8D5.js} +17 -16
- package/dist/{InventoryBindingSummary-BbHLCdjj.js → InventoryBindingSummary-B_WUQ6By.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-NEPqmkHR.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BmDuR4Yb.js} +5 -5
- package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-DhIHSpzG.js +93 -0
- package/dist/{PublishView-CbwCLtph.js → PublishView-BtTSOUyL.js} +9 -9
- package/dist/{PurchaseOrderPrintPreview-DLhgjhHB.js → PurchaseOrderPrintPreview-CxhMPx5u.js} +11 -11
- package/dist/{ReceiveRequestView-CE2aQR-o.js → ReceiveRequestView-CsqEjf7r.js} +144 -142
- package/dist/RecipeView-DASoba97.js +1558 -0
- package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-mvRR4CrP.js +254 -0
- package/dist/StockView-B4Km4DgB.js +2395 -0
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-D0BDdq4d.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cki-LAZR.js} +1 -1
- package/dist/{SupplierView-wSzWjZLY.js → SupplierView-CrzFvBIx.js} +21 -20
- package/dist/{SurchargeView-G8OyE60y.js → SurchargeView-BoNWpxFY.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CROQL761.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-Dcp5vZPM.js} +3 -3
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-IAknr-ye.js +292 -0
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D1AGDeEP.js → TransferDetails.vue_vue_type_script_setup_true_lang-D9aNX0oM.js} +131 -130
- package/dist/{TransferTemplateView-CVfi8jsk.js → TransferTemplateView-DwIU0paO.js} +23 -22
- package/dist/UnitCostHistoryView-Bjs4RwyR.js +651 -0
- package/dist/UnitDisplayControl.vue_vue_type_script_setup_true_lang-BH0PxivU.js +137 -0
- package/dist/{UnitView-Dn3nuQHm.js → UnitView-BbQ0jOgS.js} +12 -10
- package/dist/{WarehouseView-GSxQ_Ev2.js → WarehouseView-DzPttKzE.js} +6 -6
- package/dist/WastageTemplateView-CxyZz5JC.js +2327 -0
- package/dist/api/adjustment-template.d.ts +1 -0
- package/dist/api/closing.d.ts +2 -0
- package/dist/api/inventory.d.ts +126 -36
- package/dist/api/netsuite.d.ts +8 -1
- package/dist/api/stock.d.ts +5 -1
- package/dist/api/unit-cost-history.d.ts +28 -0
- package/dist/{app-CYbiMVcX.js → app-EoCCjoRh.js} +9021 -7945
- package/dist/app.d.ts +236 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-Dq16W8vW.js → closing-template-O_hzhisU.js} +5 -1
- package/dist/components/TemplatePublishDialog.d.ts +1 -0
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +37 -1
- package/dist/components/shell/inventory/binding-dialog.vue.d.ts +14 -0
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +16 -1
- package/dist/{date2-De3BHKh5.js → date2-CTHKdfXp.js} +1 -1
- package/dist/{dayjs.min-DxdfVXA-.js → dayjs.min-Ccv4NdEp.js} +16 -16
- package/dist/decimal-tRyklLh0.js +99 -0
- package/dist/{defineDeepModel-2n_afItE.js → defineDeepModel-rmOd66to.js} +1 -1
- package/dist/{duplicate-template-DM7YIgor.js → duplicate-template-k8Erwdzo.js} +1 -1
- package/dist/export-TmaGpV98.js +25 -0
- package/dist/{feature-_nNpSZuh.js → feature-D4-lt7R6.js} +94 -89
- package/dist/{format-time-from-id-D5HSMsS-.js → format-time-from-id-Cru7cG1h.js} +1 -1
- package/dist/{format-unit-display-CQUFDxVm.js → format-unit-display-DZDD796a.js} +16 -15
- package/dist/{import-export.helper-BoxczUsX.js → import-export.helper-BjzXGudc.js} +16 -15
- package/dist/{index-B6nDUCCe.js → index-BeEz64I1.js} +3 -3
- package/dist/{index-Cp_mpu5S.js → index-DKCY6354.js} +1471 -1412
- package/dist/{index-CdfF5GGW.js → index-gGbN4qbt.js} +1 -1
- package/dist/{lodash-2R7Rgorb.js → lodash-BSCFf0k7.js} +1 -1
- package/dist/{netsuite-Bss4fURp.js → netsuite-DwoCq3Mv.js} +92 -92
- package/dist/number-CEUoMyIk.js +138 -0
- package/dist/{purchase-order-template-CBSvv0b2.js → purchase-order-template-DWTdjo9l.js} +1 -1
- package/dist/router/name.d.ts +1 -0
- package/dist/rules-CyW1Bx31.js +98 -0
- package/dist/{stock-DMX_hH5c.js → stock-DYWJ4DZW.js} +28 -27
- package/dist/stock-Ds3GNgHG.js +75 -0
- package/dist/stores/feature.d.ts +2 -0
- package/dist/stores/integration/netsuite.d.ts +8 -1
- package/dist/stores/inventory.d.ts +120 -30
- package/dist/{supplier-Cf5HW15s.js → supplier-DwUb1oVo.js} +2 -2
- package/dist/{surcharge-CyReT8lG.js → surcharge-UTJFNBLN.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-BCyydlHR.js → use-ingredient-select-dialog-D8A3bPTe.js} +2 -2
- package/dist/{use-inventory-binding-dialog-WGQs-_2i.js → use-inventory-binding-dialog-DFmiAQ9d.js} +2 -2
- package/dist/{use-template-enabled-locations-2-B0nlqUjb.js → use-template-enabled-locations-2-snlITfW8.js} +2 -2
- package/dist/views/adjustment-template/wastage-template/table.d.ts +10 -1
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +68 -12
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +204 -36
- package/dist/views/closing-history/ClosingDetailDialog.vue.d.ts +23 -0
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +8 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +96 -12
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +96 -12
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +18 -18
- package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +14 -0
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +32 -4
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +28 -0
- package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +169 -0
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryBindingAlternative.vue.d.ts +43 -0
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryBindingRule.vue.d.ts +25 -0
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryRecipeBindingV2Field.vue.d.ts +125 -0
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventorySkuBindingV2Field.vue.d.ts +129 -0
- package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-alternative-table.d.ts +30 -0
- package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +4 -0
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +8 -1
- package/dist/views/integration/components/netsuite/InventoryTransferIngredientTable.vue.d.ts +16 -2
- package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +33 -5
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +16 -2
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +32 -4
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +8 -1
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +41 -6
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +246 -36
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +287 -42
- package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +16 -0
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -0
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +16 -2
- package/dist/views/stock/components/dialog/SnapshotRecalculationDialog.vue.d.ts +11 -0
- package/dist/views/stock/components/dialog/recalculationUtils.d.ts +16 -0
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +16 -2
- package/dist/views/transfer-template/components/transfer-template-form/components/NetSuiteCustomCodeSelection.vue.d.ts +16 -2
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +16 -2
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +8 -1
- package/dist/views/transfer-template/composables/use-netsuite-custom-field.d.ts +24 -3
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +96 -12
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +96 -12
- package/dist/views/unit-cost-history/UnitCostHistoryView.vue.d.ts +2 -0
- package/dist/views/unit-cost-history/components/UnitCostDetailsSideSheet.vue.d.ts +19 -0
- package/dist/views/unit-cost-history/components/UnitCostRecalculationDialog.vue.d.ts +11 -0
- package/dist/views/unit-cost-history/composables/use-unit-cost-history.d.ts +65 -0
- package/dist/{vue-i18n-DwS_fjo9.js → vue-i18n-CY4442Fb.js} +510 -510
- package/dist/{xlsx-9MOvXxhT.js → xlsx-Kc1XotGV.js} +1 -1
- package/dist/{xlsx.util-D1DdGA1N.js → xlsx.util-Dy4jmPyv.js} +1 -1
- package/package.json +1 -1
- package/dist/ClosingHistoryView-YrEVWvGu.js +0 -447
- package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-BDVHkTSE.js +0 -116
- package/dist/RecipeView-B-gmrXHR.js +0 -646
- package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js +0 -251
- package/dist/StockView-BNe2_5bA.js +0 -2520
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CwV2luel.js +0 -263
- package/dist/WastageTemplateView-BG-y48uc.js +0 -2388
- package/dist/rules-T-fs8_4_.js +0 -327
- package/dist/stock-CFWu5bRA.js +0 -75
|
@@ -0,0 +1,651 @@
|
|
|
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 { F as ne, u as le, _ as re } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-mvRR4CrP.js";
|
|
3
|
+
import { o as ie, u as J, a as Z } from "./app-EoCCjoRh.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-CkUwLhut.js";
|
|
6
|
+
import { useI18n as ee, useCoreStore as de } from "@feedmepos/mf-common";
|
|
7
|
+
import { d as Y } from "./date2-CTHKdfXp.js";
|
|
8
|
+
import { d as j } from "./number-CEUoMyIk.js";
|
|
9
|
+
import { P as me, J as fe } from "./app-DiX-EfV6.js";
|
|
10
|
+
const te = ie((w, _) => {
|
|
11
|
+
const i = J();
|
|
12
|
+
return {
|
|
13
|
+
async getLatestCostForAllSkus(d) {
|
|
14
|
+
const o = `${w.inventoryBackendUrl}/api/unit-cost-history?locationId=${encodeURIComponent(d)}`;
|
|
15
|
+
return await _.get(o);
|
|
16
|
+
},
|
|
17
|
+
async recalculate(d) {
|
|
18
|
+
const o = `${w.inventoryBackendUrl}/api/unit-cost-history/recalculate`;
|
|
19
|
+
return await _.post(o, d);
|
|
20
|
+
},
|
|
21
|
+
async getJobStatus(d) {
|
|
22
|
+
const o = `${w.inventoryBackendUrl}/api/unit-cost-history/jobs/${d}`;
|
|
23
|
+
return await _.get(o);
|
|
24
|
+
},
|
|
25
|
+
async listRecentRecalculationRequests() {
|
|
26
|
+
var C;
|
|
27
|
+
const d = (C = i._currentLocation) == null ? void 0 : C.dbName;
|
|
28
|
+
if (!d) return [];
|
|
29
|
+
const o = `${w.inventoryBackendUrl}/api/unit-cost-history/recalculation-requests?location=${encodeURIComponent(d)}`;
|
|
30
|
+
return await _.get(o);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
function ye() {
|
|
35
|
+
const w = te(), _ = J(), i = h([]), d = h(!1);
|
|
36
|
+
async function o() {
|
|
37
|
+
if (!_._currentLocation)
|
|
38
|
+
return [];
|
|
39
|
+
d.value = !0;
|
|
40
|
+
try {
|
|
41
|
+
const C = _.currentLocation.doc._id, m = await w.getLatestCostForAllSkus(C);
|
|
42
|
+
return i.value = m, m;
|
|
43
|
+
} finally {
|
|
44
|
+
d.value = !1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
historyData: i,
|
|
49
|
+
isLoading: d,
|
|
50
|
+
fetchHistory: o
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
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 = {
|
|
54
|
+
key: 0,
|
|
55
|
+
class: "text-red-500 text-sm mt-2"
|
|
56
|
+
}, ke = { class: "fm-typo-en-body-sm-400" }, Se = {
|
|
57
|
+
key: 1,
|
|
58
|
+
class: "flex flex-col gap-8"
|
|
59
|
+
}, 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 = {
|
|
60
|
+
key: 0,
|
|
61
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
62
|
+
}, Le = {
|
|
63
|
+
key: 1,
|
|
64
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
65
|
+
}, Ue = {
|
|
66
|
+
key: 2,
|
|
67
|
+
class: "fm-typo-en-body-xs-400 text-fm-color-system-error-500"
|
|
68
|
+
}, Ne = {
|
|
69
|
+
key: 0,
|
|
70
|
+
class: "flex gap-8 ml-auto"
|
|
71
|
+
}, Be = {
|
|
72
|
+
key: 1,
|
|
73
|
+
class: "flex gap-8 ml-auto"
|
|
74
|
+
}, Ve = /* @__PURE__ */ Q({
|
|
75
|
+
__name: "UnitCostRecalculationDialog",
|
|
76
|
+
emits: ["submitted"],
|
|
77
|
+
setup(w, { expose: _, emit: i }) {
|
|
78
|
+
const d = i, { t: o } = ee(), C = te(), m = q(), U = de(), M = J(), x = h(!1), s = h(""), a = h(""), v = h(!1), $ = h([]), B = h(!1), D = b(() => {
|
|
79
|
+
if (!s.value || !a.value) return "";
|
|
80
|
+
const f = new Date(s.value).getTime();
|
|
81
|
+
return new Date(a.value).getTime() <= f ? o("inventory.unitCost.recalculation.error.endDateBeforeStart") : "";
|
|
82
|
+
}), R = b(() => !!s.value && !!a.value && !D.value), k = b(() => $.value.some(
|
|
83
|
+
(f) => !f.completedAt && !f.failedReason
|
|
84
|
+
));
|
|
85
|
+
async function V() {
|
|
86
|
+
x.value = !0, await K();
|
|
87
|
+
const f = /* @__PURE__ */ new Date();
|
|
88
|
+
a.value = f.toISOString().split("T")[0];
|
|
89
|
+
const c = new Date(f.getFullYear(), 0, 1);
|
|
90
|
+
s.value = c.toISOString().split("T")[0];
|
|
91
|
+
}
|
|
92
|
+
function P() {
|
|
93
|
+
x.value = !1;
|
|
94
|
+
}
|
|
95
|
+
_({
|
|
96
|
+
open: V,
|
|
97
|
+
close: P
|
|
98
|
+
});
|
|
99
|
+
async function K() {
|
|
100
|
+
B.value = !0;
|
|
101
|
+
try {
|
|
102
|
+
const f = await C.listRecentRecalculationRequests();
|
|
103
|
+
$.value = f;
|
|
104
|
+
} catch (f) {
|
|
105
|
+
console.error("Error fetching recalculation requests:", f);
|
|
106
|
+
} finally {
|
|
107
|
+
B.value = !1;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async function W() {
|
|
111
|
+
var f, c;
|
|
112
|
+
if (R.value) {
|
|
113
|
+
v.value = !0;
|
|
114
|
+
try {
|
|
115
|
+
const S = ((f = U.currentBusiness.value) == null ? void 0 : f._id) ?? "", N = ((c = M._currentLocation) == null ? void 0 : c.dbName) ?? "";
|
|
116
|
+
if (!S)
|
|
117
|
+
throw new Error("No active business selected");
|
|
118
|
+
if (!N)
|
|
119
|
+
throw new Error("No active location selected");
|
|
120
|
+
await C.recalculate({
|
|
121
|
+
businessId: S,
|
|
122
|
+
locationId: N,
|
|
123
|
+
startDate: s.value,
|
|
124
|
+
endDate: a.value
|
|
125
|
+
}), m.open({
|
|
126
|
+
title: o("common.success"),
|
|
127
|
+
message: o("inventory.unitCost.recalculation.successMessage"),
|
|
128
|
+
type: "success"
|
|
129
|
+
}), await K(), x.value = !1, d("submitted");
|
|
130
|
+
} catch (S) {
|
|
131
|
+
console.error("Error scheduling recalculation:", S), m.open({
|
|
132
|
+
title: o("common.error"),
|
|
133
|
+
message: o("inventory.unitCost.recalculation.errorMessage"),
|
|
134
|
+
type: "error"
|
|
135
|
+
});
|
|
136
|
+
} finally {
|
|
137
|
+
v.value = !1;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return (f, c) => {
|
|
142
|
+
const S = L("FmButton"), N = L("FmDatePicker"), G = L("FmAlert"), l = L("FmDialog");
|
|
143
|
+
return u(), g("div", null, [
|
|
144
|
+
p(S, {
|
|
145
|
+
"prepend-icon": "info",
|
|
146
|
+
variant: "tertiary",
|
|
147
|
+
onClick: oe(V, ["stop"])
|
|
148
|
+
}),
|
|
149
|
+
p(l, {
|
|
150
|
+
modelValue: x.value,
|
|
151
|
+
"onUpdate:modelValue": c[4] || (c[4] = (e) => x.value = e),
|
|
152
|
+
"close-button": "",
|
|
153
|
+
dismissAway: "",
|
|
154
|
+
"max-width": "600px"
|
|
155
|
+
}, {
|
|
156
|
+
"dialog-header": A(() => [
|
|
157
|
+
t("div", pe, n(r(o)("inventory.unitCost.recalculation.title")), 1)
|
|
158
|
+
]),
|
|
159
|
+
"dialog-footer": A(() => [
|
|
160
|
+
k.value ? (u(), g("div", Be, [
|
|
161
|
+
p(S, {
|
|
162
|
+
variant: "tertiary",
|
|
163
|
+
onClick: c[3] || (c[3] = (e) => x.value = !1),
|
|
164
|
+
label: r(o)("common.close")
|
|
165
|
+
}, null, 8, ["label"])
|
|
166
|
+
])) : (u(), g("div", Ne, [
|
|
167
|
+
p(S, {
|
|
168
|
+
variant: "tertiary",
|
|
169
|
+
onClick: c[2] || (c[2] = (e) => x.value = !1),
|
|
170
|
+
disabled: v.value,
|
|
171
|
+
label: r(o)("common.cancel")
|
|
172
|
+
}, null, 8, ["disabled", "label"]),
|
|
173
|
+
p(S, {
|
|
174
|
+
variant: "primary",
|
|
175
|
+
onClick: W,
|
|
176
|
+
disabled: !R.value || v.value,
|
|
177
|
+
loading: v.value,
|
|
178
|
+
label: r(o)("inventory.unitCost.recalculation.schedule")
|
|
179
|
+
}, null, 8, ["disabled", "loading", "label"])
|
|
180
|
+
]))
|
|
181
|
+
]),
|
|
182
|
+
default: A(() => [
|
|
183
|
+
t("div", ve, [
|
|
184
|
+
t("div", ge, n(r(o)("inventory.unitCost.recalculation.description")), 1),
|
|
185
|
+
k.value ? F("", !0) : (u(), g(O, { key: 0 }, [
|
|
186
|
+
t("div", be, [
|
|
187
|
+
t("p", he, [
|
|
188
|
+
H(n(r(o)("inventory.unitCost.recalculation.startDate")) + " ", 1),
|
|
189
|
+
c[5] || (c[5] = t("span", { class: "text-fm-color-system-error-300" }, "*", -1))
|
|
190
|
+
]),
|
|
191
|
+
p(N, {
|
|
192
|
+
modelValue: s.value,
|
|
193
|
+
"onUpdate:modelValue": c[0] || (c[0] = (e) => s.value = e),
|
|
194
|
+
placeholder: r(o)("inventory.unitCost.recalculation.selectStartDate"),
|
|
195
|
+
disabled: v.value
|
|
196
|
+
}, null, 8, ["modelValue", "placeholder", "disabled"])
|
|
197
|
+
]),
|
|
198
|
+
t("div", _e, [
|
|
199
|
+
t("p", xe, [
|
|
200
|
+
H(n(r(o)("inventory.unitCost.recalculation.endDate")) + " ", 1),
|
|
201
|
+
c[6] || (c[6] = t("span", { class: "text-fm-color-system-error-300" }, "*", -1))
|
|
202
|
+
]),
|
|
203
|
+
p(N, {
|
|
204
|
+
modelValue: a.value,
|
|
205
|
+
"onUpdate:modelValue": c[1] || (c[1] = (e) => a.value = e),
|
|
206
|
+
placeholder: r(o)("inventory.unitCost.recalculation.selectEndDate"),
|
|
207
|
+
disabled: !s.value || v.value,
|
|
208
|
+
min: s.value
|
|
209
|
+
}, null, 8, ["modelValue", "placeholder", "disabled", "min"]),
|
|
210
|
+
D.value ? (u(), g("div", Ce, n(D.value), 1)) : F("", !0)
|
|
211
|
+
]),
|
|
212
|
+
s.value && a.value && !D.value ? (u(), T(G, {
|
|
213
|
+
key: 0,
|
|
214
|
+
type: "info"
|
|
215
|
+
}, {
|
|
216
|
+
default: A(() => [
|
|
217
|
+
t("div", ke, n(r(o)("inventory.unitCost.recalculation.info")), 1)
|
|
218
|
+
]),
|
|
219
|
+
_: 1
|
|
220
|
+
})) : F("", !0)
|
|
221
|
+
], 64)),
|
|
222
|
+
$.value.length > 0 ? (u(), g("div", Se, [
|
|
223
|
+
t("p", we, n(r(o)("inventory.unitCost.recalculation.recentRequests")), 1),
|
|
224
|
+
t("div", De, [
|
|
225
|
+
(u(!0), g(O, null, se($.value, (e) => (u(), g("div", {
|
|
226
|
+
key: e._id,
|
|
227
|
+
class: "p-12 border border-fm-color-border-primary rounded-8 flex flex-col gap-4"
|
|
228
|
+
}, [
|
|
229
|
+
t("div", Ae, [
|
|
230
|
+
t("div", $e, n(r(o)("inventory.unitCost.recalculation.requestedAt")) + ": " + n(new Date(e.createdAt).toLocaleString()), 1),
|
|
231
|
+
t("div", {
|
|
232
|
+
class: E(["fm-typo-en-body-xs-600 px-8 py-4 rounded-4", {
|
|
233
|
+
"bg-fm-color-system-error-100 text-fm-color-system-error-500": e.failedReason,
|
|
234
|
+
"bg-fm-color-system-success-100 text-fm-color-system-success-500": e.completedAt,
|
|
235
|
+
"bg-fm-color-system-info-100 text-fm-color-system-info-500": !e.failedReason && !e.completedAt
|
|
236
|
+
}])
|
|
237
|
+
}, 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)
|
|
238
|
+
]),
|
|
239
|
+
t("div", Re, n(r(o)("inventory.unitCost.recalculation.from")) + ": " + n(new Date(e.recalculateStartDate).toLocaleDateString()), 1),
|
|
240
|
+
t("div", Ie, n(r(o)("inventory.unitCost.recalculation.to")) + ": " + n(new Date(e.recalculateEndDate).toLocaleDateString()), 1),
|
|
241
|
+
e.createdBy ? (u(), g("div", Fe, n(r(o)("inventory.unitCost.recalculation.requestedBy")) + ": " + n(e.createdBy.name || e.createdBy._id), 1)) : F("", !0),
|
|
242
|
+
e.completedAt ? (u(), g("div", Le, n(r(o)("inventory.unitCost.recalculation.completedAt")) + ": " + n(new Date(e.completedAt).toLocaleString()), 1)) : F("", !0),
|
|
243
|
+
e.failedReason ? (u(), g("div", Ue, n(e.failedReason), 1)) : F("", !0)
|
|
244
|
+
]))), 128))
|
|
245
|
+
])
|
|
246
|
+
])) : F("", !0)
|
|
247
|
+
])
|
|
248
|
+
]),
|
|
249
|
+
_: 1
|
|
250
|
+
}, 8, ["modelValue"])
|
|
251
|
+
]);
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
}), Te = {
|
|
255
|
+
key: 0,
|
|
256
|
+
class: "flex flex-col gap-24"
|
|
257
|
+
}, Me = { class: "flex flex-col gap-8" }, ze = { class: "flex flex-col gap-5" }, He = { class: "flex flex-col gap-4" }, Ee = { class: "fm-typo-en-body-lg-600 flex gap-2" }, Pe = { class: "flex flex-col gap-4" }, Ke = { class: "fm-typo-en-body-lg-600 flex gap-2" }, Oe = { class: "flex flex-col gap-4" }, Ye = { class: "fm-typo-en-body-lg-600 flex gap-2" }, je = { class: "flex flex-col gap-4" }, Je = { class: "fm-typo-en-body-lg-600" }, We = { class: "flex flex-col gap-4" }, Ge = { class: "fm-typo-en-body-lg-600" }, Qe = { class: "flex flex-col gap-4" }, Xe = { class: "fm-typo-en-body-lg-600" }, Ze = { class: "flex flex-col gap-4" }, qe = { class: "fm-typo-en-body-lg-600" }, et = { class: "flex flex-col gap-8" }, tt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary whitespace-pre-wrap" }, ot = { class: "flex gap-4" }, st = /* @__PURE__ */ Q({
|
|
258
|
+
__name: "UnitCostDetailsSideSheet",
|
|
259
|
+
props: {
|
|
260
|
+
record: {}
|
|
261
|
+
},
|
|
262
|
+
setup(w, { expose: _ }) {
|
|
263
|
+
const i = w, d = Z(), o = h(!1), C = b(() => {
|
|
264
|
+
var s;
|
|
265
|
+
return (s = i.record) != null && s.skuId ? d.skus.find((a) => a._id === i.record.skuId) : null;
|
|
266
|
+
}), m = b(() => {
|
|
267
|
+
if (!i.record || !i.record.previousCost) return null;
|
|
268
|
+
const s = i.record.previousCost.amount, v = i.record.cost.amount - s;
|
|
269
|
+
return {
|
|
270
|
+
amount: Math.abs(v),
|
|
271
|
+
precision: i.record.cost.precision,
|
|
272
|
+
currency: i.record.cost.currency,
|
|
273
|
+
isIncrease: v > 0
|
|
274
|
+
};
|
|
275
|
+
}), U = b(() => i.record ? {
|
|
276
|
+
default: "Default",
|
|
277
|
+
weightedAverage: "Weighted Average (WAVG)",
|
|
278
|
+
netsuite: "NetSuite",
|
|
279
|
+
"netsuite-average": "NetSuite Average"
|
|
280
|
+
}[i.record.mechanism] || i.record.mechanism : "");
|
|
281
|
+
b(() => {
|
|
282
|
+
var s;
|
|
283
|
+
return !((s = i.record) != null && s.meta) || i.record.mechanism !== "netsuite" ? null : i.record.meta;
|
|
284
|
+
});
|
|
285
|
+
function M() {
|
|
286
|
+
o.value = !0;
|
|
287
|
+
}
|
|
288
|
+
function x() {
|
|
289
|
+
o.value = !1;
|
|
290
|
+
}
|
|
291
|
+
return _({
|
|
292
|
+
open: M,
|
|
293
|
+
close: x
|
|
294
|
+
}), (s, a) => {
|
|
295
|
+
const v = L("FmMenuDivider"), $ = L("FmCard"), B = L("FmButton"), D = L("FmSideSheet");
|
|
296
|
+
return u(), T(D, {
|
|
297
|
+
"model-value": o.value,
|
|
298
|
+
"onUpdate:modelValue": a[0] || (a[0] = (R) => o.value = R),
|
|
299
|
+
header: "Unit Cost History Details",
|
|
300
|
+
"close-button": "",
|
|
301
|
+
"dismiss-away": "",
|
|
302
|
+
"max-width": 500
|
|
303
|
+
}, {
|
|
304
|
+
"side-sheet-footer": A(() => [
|
|
305
|
+
t("div", ot, [
|
|
306
|
+
p(B, {
|
|
307
|
+
variant: "tertiary",
|
|
308
|
+
onClick: x,
|
|
309
|
+
label: "Close"
|
|
310
|
+
})
|
|
311
|
+
])
|
|
312
|
+
]),
|
|
313
|
+
default: A(() => [
|
|
314
|
+
s.record ? (u(), g("div", Te, [
|
|
315
|
+
p($, {
|
|
316
|
+
variant: "outlined",
|
|
317
|
+
class: "flex flex-col gap-8 px-12 py-16"
|
|
318
|
+
}, {
|
|
319
|
+
default: A(() => {
|
|
320
|
+
var R, k;
|
|
321
|
+
return [
|
|
322
|
+
a[8] || (a[8] = t("div", { class: "flex justify-between" }, [
|
|
323
|
+
t("div", { class: "fm-typo-en-body-lg-600" }, "Details")
|
|
324
|
+
], -1)),
|
|
325
|
+
p(v),
|
|
326
|
+
t("div", Me, [
|
|
327
|
+
t("div", ze, [
|
|
328
|
+
t("div", He, [
|
|
329
|
+
a[1] || (a[1] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Ingredient Code", -1)),
|
|
330
|
+
t("div", Ee, n((R = C.value) == null ? void 0 : R.code), 1)
|
|
331
|
+
]),
|
|
332
|
+
t("div", Pe, [
|
|
333
|
+
a[2] || (a[2] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Ingredient Name", -1)),
|
|
334
|
+
t("div", Ke, n((k = C.value) == null ? void 0 : k.name), 1)
|
|
335
|
+
]),
|
|
336
|
+
t("div", Oe, [
|
|
337
|
+
a[3] || (a[3] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "New Cost", -1)),
|
|
338
|
+
t("div", Ye, [
|
|
339
|
+
H(n(r(j)(s.record.cost, !0, s.record.cost.precision)) + " ", 1),
|
|
340
|
+
m.value ? (u(), g("div", {
|
|
341
|
+
key: 0,
|
|
342
|
+
class: E(["fm-typo-en-body-md-600 flex items-center gap-4", {
|
|
343
|
+
"text-fm-color-system-success-500": m.value.isIncrease,
|
|
344
|
+
"text-fm-color-system-error-500": !m.value.isIncrease
|
|
345
|
+
}])
|
|
346
|
+
}, [
|
|
347
|
+
t("span", {
|
|
348
|
+
class: E({
|
|
349
|
+
"text-red-500": m.value.isIncrease,
|
|
350
|
+
"text-green-600": !m.value.isIncrease
|
|
351
|
+
})
|
|
352
|
+
}, n(m.value.isIncrease ? "↑" : "↓"), 3),
|
|
353
|
+
t("span", {
|
|
354
|
+
class: E({
|
|
355
|
+
"text-red-500": m.value.isIncrease,
|
|
356
|
+
"text-green-600": !m.value.isIncrease
|
|
357
|
+
})
|
|
358
|
+
}, n(m.value.isIncrease ? "Increase" : "Decrease"), 3)
|
|
359
|
+
], 2)) : F("", !0)
|
|
360
|
+
])
|
|
361
|
+
]),
|
|
362
|
+
t("div", je, [
|
|
363
|
+
a[4] || (a[4] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Previous Cost", -1)),
|
|
364
|
+
t("div", Je, n(s.record.previousCost ? r(j)(
|
|
365
|
+
s.record.previousCost,
|
|
366
|
+
!0,
|
|
367
|
+
s.record.previousCost.precision
|
|
368
|
+
) : "-"), 1)
|
|
369
|
+
]),
|
|
370
|
+
t("div", We, [
|
|
371
|
+
a[5] || (a[5] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Mechanism", -1)),
|
|
372
|
+
t("div", Ge, n(U.value), 1)
|
|
373
|
+
]),
|
|
374
|
+
t("div", Qe, [
|
|
375
|
+
a[6] || (a[6] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Snapshot At", -1)),
|
|
376
|
+
t("div", Xe, n(r(Y)(new Date(s.record.snapshotAt))) + " " + n(new Date(s.record.snapshotAt).toLocaleTimeString()), 1)
|
|
377
|
+
]),
|
|
378
|
+
t("div", Ze, [
|
|
379
|
+
a[7] || (a[7] = t("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Updated At", -1)),
|
|
380
|
+
t("div", qe, [
|
|
381
|
+
s.record.updatedAt ? (u(), g(O, { key: 0 }, [
|
|
382
|
+
H(n(r(Y)(new Date(s.record.updatedAt))) + " " + n(new Date(s.record.updatedAt).toLocaleTimeString()), 1)
|
|
383
|
+
], 64)) : (u(), g(O, { key: 1 }, [
|
|
384
|
+
H("-")
|
|
385
|
+
], 64))
|
|
386
|
+
])
|
|
387
|
+
])
|
|
388
|
+
])
|
|
389
|
+
])
|
|
390
|
+
];
|
|
391
|
+
}),
|
|
392
|
+
_: 1
|
|
393
|
+
}),
|
|
394
|
+
p(ne, null, {
|
|
395
|
+
default: A(() => [
|
|
396
|
+
p($, {
|
|
397
|
+
variant: "outlined",
|
|
398
|
+
class: "flex flex-col gap-8 px-12 py-16"
|
|
399
|
+
}, {
|
|
400
|
+
default: A(() => [
|
|
401
|
+
a[9] || (a[9] = t("div", { class: "flex justify-between" }, [
|
|
402
|
+
t("div", { class: "fm-typo-en-body-lg-600" }, "Raw data")
|
|
403
|
+
], -1)),
|
|
404
|
+
p(v),
|
|
405
|
+
t("div", et, [
|
|
406
|
+
t("pre", tt, n(JSON.stringify(s.record, null, 2)) + `
|
|
407
|
+
`, 1)
|
|
408
|
+
])
|
|
409
|
+
]),
|
|
410
|
+
_: 1
|
|
411
|
+
})
|
|
412
|
+
]),
|
|
413
|
+
_: 1
|
|
414
|
+
})
|
|
415
|
+
])) : F("", !0)
|
|
416
|
+
]),
|
|
417
|
+
_: 1
|
|
418
|
+
}, 8, ["model-value"]);
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
}), ft = /* @__PURE__ */ Q({
|
|
422
|
+
__name: "UnitCostHistoryView",
|
|
423
|
+
setup(w) {
|
|
424
|
+
const { t: _ } = ee(), i = J(), d = Z(), o = q(), C = le(), { breakpoints: m } = ce(), 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(() => [
|
|
425
|
+
{
|
|
426
|
+
type: "string",
|
|
427
|
+
key: "skuCode",
|
|
428
|
+
entity: "sku",
|
|
429
|
+
values: d.skus.map((e) => e.code)
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
type: "string",
|
|
433
|
+
key: "skuName",
|
|
434
|
+
entity: "sku",
|
|
435
|
+
values: d.skus.map((e) => e.name)
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
type: "string",
|
|
439
|
+
key: "mechanism",
|
|
440
|
+
entity: "sku",
|
|
441
|
+
values: ["weightedAverage", "netsuite", "netsuite-average"]
|
|
442
|
+
}
|
|
443
|
+
]), k = h(null);
|
|
444
|
+
i.watchLocation(V);
|
|
445
|
+
async function V() {
|
|
446
|
+
if (i._currentLocation)
|
|
447
|
+
try {
|
|
448
|
+
await B();
|
|
449
|
+
} catch (l) {
|
|
450
|
+
o.open({
|
|
451
|
+
title: "Error",
|
|
452
|
+
message: "Failed to fetch unit cost history. Please try again.",
|
|
453
|
+
type: "error"
|
|
454
|
+
}), console.error("Error fetching unit cost history:", l);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
const P = b(() => {
|
|
458
|
+
const l = /* @__PURE__ */ new Map();
|
|
459
|
+
for (const e of d.skus)
|
|
460
|
+
l.set(e._id, e);
|
|
461
|
+
return l;
|
|
462
|
+
}), K = b(() => {
|
|
463
|
+
let l = v.value;
|
|
464
|
+
if (k.value) {
|
|
465
|
+
const e = me.build(k.value);
|
|
466
|
+
l = l.filter((y) => {
|
|
467
|
+
const I = P.value.get(y.skuId);
|
|
468
|
+
return fe(
|
|
469
|
+
{
|
|
470
|
+
skuCode: (I == null ? void 0 : I.code) ?? y.skuId,
|
|
471
|
+
skuName: (I == null ? void 0 : I.name) ?? y.skuId,
|
|
472
|
+
mechanism: y.mechanism
|
|
473
|
+
},
|
|
474
|
+
e
|
|
475
|
+
);
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
return l.map((e) => {
|
|
479
|
+
const y = P.value.get(e.skuId);
|
|
480
|
+
return {
|
|
481
|
+
...e,
|
|
482
|
+
skuCode: (y == null ? void 0 : y.code) ?? e.skuId,
|
|
483
|
+
skuName: (y == null ? void 0 : y.name) ?? "Unknown SKU"
|
|
484
|
+
};
|
|
485
|
+
});
|
|
486
|
+
}), W = b(() => [
|
|
487
|
+
{
|
|
488
|
+
accessorKey: "snapshotAt",
|
|
489
|
+
header: () => "Snapshot At",
|
|
490
|
+
cell: (l) => {
|
|
491
|
+
const e = new Date(l.row.original.snapshotAt);
|
|
492
|
+
return Y(e) + " " + e.toLocaleTimeString();
|
|
493
|
+
},
|
|
494
|
+
enableSorting: !0,
|
|
495
|
+
size: 180
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
accessorKey: "skuCode",
|
|
499
|
+
header: () => "SKU Code",
|
|
500
|
+
enableSorting: !0,
|
|
501
|
+
size: 150
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
accessorKey: "skuName",
|
|
505
|
+
header: () => "SKU Name",
|
|
506
|
+
enableSorting: !0,
|
|
507
|
+
size: "auto"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
accessorKey: "previousCost",
|
|
511
|
+
header: () => "Previous Cost",
|
|
512
|
+
cell: (l) => {
|
|
513
|
+
const e = l.row.original.previousCost;
|
|
514
|
+
return e ? j(e, !1, e.precision) : "-";
|
|
515
|
+
},
|
|
516
|
+
enableSorting: !1,
|
|
517
|
+
size: 150
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
accessorKey: "cost",
|
|
521
|
+
header: () => "Current Cost",
|
|
522
|
+
cell: (l) => {
|
|
523
|
+
const e = l.row.original.cost;
|
|
524
|
+
return e ? j(e, !1, e.precision) : "-";
|
|
525
|
+
},
|
|
526
|
+
enableSorting: !1,
|
|
527
|
+
size: 150
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
accessorKey: "mechanism",
|
|
531
|
+
header: () => "Mechanism",
|
|
532
|
+
cell: (l) => {
|
|
533
|
+
const e = l.row.original.mechanism;
|
|
534
|
+
return {
|
|
535
|
+
default: "Default",
|
|
536
|
+
weightedAverage: "Weighted Average",
|
|
537
|
+
netsuite: "NetSuite",
|
|
538
|
+
"netsuite-average": "NetSuite Average"
|
|
539
|
+
}[e] ?? e;
|
|
540
|
+
},
|
|
541
|
+
enableSorting: !0,
|
|
542
|
+
size: 150
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
accessorKey: "updatedAt",
|
|
546
|
+
header: () => "Updated At",
|
|
547
|
+
cell: (l) => {
|
|
548
|
+
const e = l.row.original.updatedAt;
|
|
549
|
+
if (!e) return "-";
|
|
550
|
+
const y = new Date(e);
|
|
551
|
+
return Y(y) + " " + y.toLocaleTimeString();
|
|
552
|
+
},
|
|
553
|
+
enableSorting: !0,
|
|
554
|
+
size: 180
|
|
555
|
+
}
|
|
556
|
+
]), f = b(() => [
|
|
557
|
+
{
|
|
558
|
+
label: "Recalculate Cost History",
|
|
559
|
+
value: "recalculate",
|
|
560
|
+
isPrimary: !0,
|
|
561
|
+
prependIcon: "calculate",
|
|
562
|
+
isAdminOnly: !0
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
label: _("inventory.common.refresh"),
|
|
566
|
+
value: "refresh"
|
|
567
|
+
}
|
|
568
|
+
]);
|
|
569
|
+
function c() {
|
|
570
|
+
var l;
|
|
571
|
+
(l = x.value) == null || l.open();
|
|
572
|
+
}
|
|
573
|
+
function S() {
|
|
574
|
+
V();
|
|
575
|
+
}
|
|
576
|
+
function N(l) {
|
|
577
|
+
var e;
|
|
578
|
+
a.value = l, (e = s.value) == null || e.open();
|
|
579
|
+
}
|
|
580
|
+
function G(l) {
|
|
581
|
+
switch (l) {
|
|
582
|
+
case "recalculate":
|
|
583
|
+
return c();
|
|
584
|
+
case "refresh":
|
|
585
|
+
return V();
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
return (l, e) => {
|
|
589
|
+
const y = L("FmTable");
|
|
590
|
+
return u(), T(re, {
|
|
591
|
+
title: "Unit Cost History",
|
|
592
|
+
actions: f.value,
|
|
593
|
+
"onClick:action": G
|
|
594
|
+
}, {
|
|
595
|
+
default: A(() => {
|
|
596
|
+
var I;
|
|
597
|
+
return [
|
|
598
|
+
t("div", {
|
|
599
|
+
class: E([
|
|
600
|
+
"flex flex-col gap-8 max-h-full",
|
|
601
|
+
{
|
|
602
|
+
"p-0": U.value,
|
|
603
|
+
"px-24": !U.value
|
|
604
|
+
}
|
|
605
|
+
])
|
|
606
|
+
}, [
|
|
607
|
+
p(ue, {
|
|
608
|
+
searchable: "",
|
|
609
|
+
"change-location": "",
|
|
610
|
+
search: D.value,
|
|
611
|
+
"onUpdate:search": e[0] || (e[0] = (z) => D.value = z),
|
|
612
|
+
filterable: "",
|
|
613
|
+
"filter-attributes": R.value,
|
|
614
|
+
filter: k.value,
|
|
615
|
+
"onUpdate:filter": e[1] || (e[1] = (z) => k.value = z)
|
|
616
|
+
}, null, 8, ["search", "filter-attributes", "filter"]),
|
|
617
|
+
(u(), T(y, {
|
|
618
|
+
key: `${(I = r(i)._currentLocation) == null ? void 0 : I.dbName}-${JSON.stringify(k.value)}`,
|
|
619
|
+
style: ae(r(C).tableHeight),
|
|
620
|
+
"column-defs": W.value,
|
|
621
|
+
"row-data": K.value,
|
|
622
|
+
"search-value": D.value,
|
|
623
|
+
loading: r($) || !r(i)._currentLocation,
|
|
624
|
+
"page-size": M.value,
|
|
625
|
+
onRowClick: e[2] || (e[2] = (z) => N(z.original))
|
|
626
|
+
}, null, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
627
|
+
], 2),
|
|
628
|
+
(u(), T(X, { to: "body" }, [
|
|
629
|
+
p(Ve, {
|
|
630
|
+
ref_key: "recalculationDialogRef",
|
|
631
|
+
ref: x,
|
|
632
|
+
onSubmitted: S
|
|
633
|
+
}, null, 512)
|
|
634
|
+
])),
|
|
635
|
+
(u(), T(X, { to: "body" }, [
|
|
636
|
+
p(st, {
|
|
637
|
+
ref_key: "detailsSideSheetRef",
|
|
638
|
+
ref: s,
|
|
639
|
+
record: a.value
|
|
640
|
+
}, null, 8, ["record"])
|
|
641
|
+
]))
|
|
642
|
+
];
|
|
643
|
+
}),
|
|
644
|
+
_: 1
|
|
645
|
+
}, 8, ["actions"]);
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
export {
|
|
650
|
+
ft as default
|
|
651
|
+
};
|