@feedmepos/mf-inventory-portal 1.6.1-dev.0 → 1.6.1-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-CL5dPCEj.js → App-tsLr4IOP.js} +5 -5
- package/dist/{ApprovalView-DKJibNlK.js → ApprovalView-CQjXRw8C.js} +24 -23
- package/dist/{BindingsDialog-DLJXu8Dw.js → BindingsDialog-CxDEdC6C.js} +2 -2
- package/dist/{BindingsPicker-CW6Tk9JI.js → BindingsPicker-BkAb19vW.js} +2 -2
- package/dist/{BindingsTable-3JJEAQz3.js → BindingsTable-1wVrUeMy.js} +3 -3
- package/dist/BulkReceiveRequestView-CcMDC8AO.js +2000 -0
- package/dist/{ClosingDraftView-DVoWnPTQ.js → ClosingDraftView-B80djffM.js} +14 -14
- package/dist/{ClosingHistoryView-qWjIbBsX.js → ClosingHistoryView-DHvyhey_.js} +247 -247
- package/dist/{ClosingTemplateView-C3Hf510z.js → ClosingTemplateView-DqX2g8PI.js} +14 -14
- package/dist/{DefaultView-wBhT3ag9.js → DefaultView-oPI1wm7e.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-VnG9wrNu.js → DeliveryOrderPrintPreview-D59Lf8S5.js} +11 -11
- package/dist/{ReceiveRequestView-DIPZCXxV.js → EmailDialog.vue_vue_type_script_setup_true_lang-BVhjsBP3.js} +12571 -12873
- package/dist/FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CLTI25iw.js +61 -0
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C4pvSYN-.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-RpCYckxf.js} +2 -2
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BqJ3SnfZ.js +237 -0
- package/dist/{FmMultiselectDialog-C7P1UET0.js → FmMultiselectDialog-BZlf6oZl.js} +50 -44
- package/dist/{FmMultiselectDialog-Dru64kWF.js → FmMultiselectDialog-DMQjKOrJ.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BklBxBGT.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DvQvV6jN.js} +5 -5
- package/dist/{ImportView-C9w-sF5E.js → ImportView-BWAllFBa.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BuphGYe2.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CYLpzpdL.js} +1 -1
- package/dist/{IngredientGroupView-BZqXPr_n.js → IngredientGroupView-B_qUY9ik.js} +5 -5
- package/dist/{IngredientsView-DgTPgkN9.js → IngredientsView-DHo7Ywtt.js} +15 -15
- package/dist/{IntegrationExplorerView-B8U3LTtj.js → IntegrationExplorerView-BiYdzcS3.js} +5 -5
- package/dist/{IntegrationView-QyHxizvF.js → IntegrationView-e0R16LLC.js} +13 -13
- package/dist/{InventoryBindingForm-NRwFwJt5.js → InventoryBindingForm-C6BZhtqn.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-C-If3KBe.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-7FoOHhX8.js} +5 -5
- package/dist/{InventoryBindingSummary-DqI3M6jQ.js → InventoryBindingSummary-C5AQnnCs.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Xt_1oU-z.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CTWexpNg.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DFYTlv_K.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Dzr8FeSh.js} +1 -1
- package/dist/{PublishView-2ytn8EUo.js → PublishView-C0ErXWjz.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-Bqim_q38.js → PurchaseOrderPrintPreview-BifBn6Fo.js} +9 -9
- package/dist/ReceiveRequestView-5w1OX2de.js +345 -0
- package/dist/{RecipeView-Bs326Ew3.js → RecipeView-I_FnrtHB.js} +17 -17
- package/dist/{SettingsView-frX_dI_K.js → SettingsView-pHCzYXZr.js} +4 -4
- package/dist/{StockView-Us8Wx8y_.js → StockView-BO-LR1WR.js} +28 -27
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Du8BI_cZ.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Dz9VvX-B.js} +1 -1
- package/dist/{SupplierView-8dnHAbK3.js → SupplierView-Bn-ul1j8.js} +12 -12
- package/dist/{SurchargeView-CfqjYiBs.js → SurchargeView-Da-H4FzH.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-_03vSZ4W.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-Do-wa8bS.js} +6 -5
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CAb7UWFP.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DcBA8hzp.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-B58A7dWI.js → TransferDetails.vue_vue_type_script_setup_true_lang-F7bFaIip.js} +1440 -1433
- package/dist/{TransferTemplateView-CI84cmV5.js → TransferTemplateView-IncI48M6.js} +20 -20
- package/dist/{UnitCostHistoryView-DXolsbDT.js → UnitCostHistoryView-0mbMN39f.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-Bpoawj7B.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DM0t-SJD.js} +4 -4
- package/dist/{UnitView-DT3fcagF.js → UnitView-mq5WIx8v.js} +7 -7
- package/dist/WarehouseView-CrD6agyt.js +1079 -0
- package/dist/{WastageTemplateView-Bc5CZJ58.js → WastageTemplateView-MrS6QsDh.js} +14 -14
- package/dist/api/purchase-order.d.ts +2 -1
- package/dist/api/supplier.d.ts +1 -0
- package/dist/{app-DpMCzQql.js → app-DV7aQ_cQ.js} +1363 -999
- package/dist/app.d.ts +354 -2
- package/dist/app.js +1 -1
- package/dist/{closing-template-CaFX19g1.js → closing-template-DJ_1EoSh.js} +1 -1
- package/dist/components/FmCoordinateInputProps.d.ts +1 -0
- package/dist/components/FmMultiselectDialog.vue.d.ts +8 -4
- package/dist/components/FmMultiselectDialogProps.d.ts +1 -0
- package/dist/components/MultiLocationSelector.vue.d.ts +202 -0
- package/dist/components/map/coordinates.d.ts +13 -0
- package/dist/{date2-DBsUy1HH.js → date2-M311L05t.js} +1 -1
- package/dist/{dayjs.min-BVKjPmJE.js → dayjs.min-9zk0IgeS.js} +12 -12
- package/dist/{decimal-DKl2dUd0.js → decimal-iv0YYQk_.js} +2 -2
- package/dist/{defineDeepModel-YeHxg9wN.js → defineDeepModel-CgMeJpz5.js} +1 -1
- package/dist/{duplicate-template-Dyx4X380.js → duplicate-template-CGWTaWeS.js} +1 -1
- package/dist/{feature-ltFu24H8.js → feature-CKH-cZsq.js} +70 -65
- package/dist/{format-time-from-id-D3lPFiqA.js → format-time-from-id-DaxR-jQl.js} +1 -1
- package/dist/{format-unit-display-CD8C9YZc.js → format-unit-display-C4vI4fRV.js} +12 -12
- package/dist/{googlemap-BGi_aKUA.js → googlemap-D9vA7GsS.js} +48 -35
- package/dist/{import-export.helper-BJ5Lz4Gg.js → import-export.helper-zsEeF3Qb.js} +6 -6
- package/dist/{index-TQKBiFuU.js → index-CBQF1IDr.js} +3 -3
- package/dist/{index-JOemzj27.js → index-Cu1y898s.js} +1 -1
- package/dist/{index-B8xTUvTH.js → index-DZ-7c-AR.js} +1 -1
- package/dist/{inventory-core-dart.default-Xz0fuxVn.js → inventory-core-dart.default-Czt49AGY.js} +1 -1
- package/dist/jszip.min-DuMMMB7Y.js +2322 -0
- package/dist/{lz-string-DAdPi3YY.js → lz-string-BpMyCNFt.js} +1 -1
- package/dist/{netsuite-qr2wHoV5.js → netsuite-BEwbzOju.js} +2 -2
- package/dist/{number-xgIylzEb.js → number-H0O0vBDD.js} +3 -3
- package/dist/{predefined-templates-j5MqD37J.js → predefined-templates-gzc0FRzN.js} +1 -1
- package/dist/{purchase-order-template-CglLUVxv.js → purchase-order-template-BDat5HvG.js} +1 -1
- package/dist/{recalculationUtils-O8dnzyPD.js → recalculationUtils-hksr7WVZ.js} +1 -1
- package/dist/router/name.d.ts +1 -0
- package/dist/{rules-BPu-CBAX.js → rules-BJJYOD6y.js} +2 -2
- package/dist/{stock-VM7b7_Km.js → stock-CKMkhKG-.js} +1 -1
- package/dist/stores/feature.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/supplier-D8G3A4Fh.js +83 -0
- package/dist/{surcharge-CUUDBYUf.js → surcharge-DPwNFa1t.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-D6eW0fAO.js → uom-rules-DoYkZ5ZU.js} +1 -1
- package/dist/{use-ingredient-select-dialog-Cd700UkI.js → use-ingredient-select-dialog-D0mBasQT.js} +2 -2
- package/dist/{use-inventory-binding-dialog-Cf8wC8AI.js → use-inventory-binding-dialog-C6HEtbBs.js} +2 -2
- package/dist/{use-template-enabled-locations-D1AVostH.js → use-template-enabled-locations-CnEcb7h4.js} +2 -2
- package/dist/{use-transfer-locations-uOi6cGul.js → use-transfer-locations-BmqLOJob.js} +8 -8
- package/dist/{useHrmPermission-DEu2Lyei.js → useHrmPermission-O-zOwblR.js} +1 -1
- package/dist/{useNavigationMenu-DuIGSnMd.js → useNavigationMenu-B-LGFL0q.js} +43 -38
- package/dist/{useSseClient-D1uc8ZIc.js → useSseClient-BDjXWGbT.js} +3 -3
- package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +2 -0
- package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +194 -0
- package/dist/views/receive-request-bulk/BulkReceiveRequestView.vue.d.ts +3 -0
- package/dist/views/receive-request-bulk/components/CreateTransferWizard.vue.d.ts +25 -0
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +4138 -0
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +771 -0
- package/dist/{vue-i18n-DElpxFA8.js → vue-i18n-BfVinz9g.js} +99 -99
- package/dist/{xlsx.util-Cm8s0ZJD.js → xlsx.util-BkECcQ9d.js} +3 -3
- package/package.json +5 -4
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Bkh9LvJQ.js +0 -293
- package/dist/WarehouseView-C1BHChSJ.js +0 -1077
- package/dist/supplier-W00UQBDk.js +0 -78
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as se, ref as g, computed as
|
|
1
|
+
import { defineComponent as se, ref as g, computed as D, watch as ce, resolveComponent as w, openBlock as n, createElementBlock as y, createBlock as z, withModifiers as me, createCommentVNode as b, createVNode as _, withCtx as R, createElementVNode as o, toDisplayString as a, unref as s, Fragment as Q, createTextVNode as ee, renderList as ne, normalizeClass as fe, h as q, Teleport as pe } from "vue";
|
|
2
2
|
import { _ as ge } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js";
|
|
3
3
|
import { useI18n as ie, useCoreStore as he } from "@feedmepos/mf-common";
|
|
4
|
-
import { E as re, B as N, a as _e, u as be } from "./app-
|
|
4
|
+
import { E as re, B as N, a as _e, u as be } from "./app-DV7aQ_cQ.js";
|
|
5
5
|
import { F as ue } from "./FmAdminBadge-DjnBAgyv.js";
|
|
6
|
-
import { _ as ke } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import { _ as ke } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BqJ3SnfZ.js";
|
|
7
7
|
import { useSnackbar as de, useDialog as xe } from "@feedmepos/ui-library";
|
|
8
|
-
import { u as
|
|
9
|
-
import { g as
|
|
10
|
-
import { _ as we } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-
|
|
11
|
-
const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col gap-16" },
|
|
8
|
+
import { u as ve } from "./stock-CKMkhKG-.js";
|
|
9
|
+
import { g as ye, f as De } from "./recalculationUtils-hksr7WVZ.js";
|
|
10
|
+
import { _ as we } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-DM0t-SJD.js";
|
|
11
|
+
const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col gap-16" }, $e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ce = { class: "flex flex-col gap-8" }, Ae = { class: "fm-typo-en-body-md-600" }, Fe = { class: "flex flex-col gap-8" }, Re = { class: "fm-typo-en-body-md-600" }, Ie = { class: "flex items-center gap-8 mb-8" }, Te = {
|
|
12
12
|
key: 2,
|
|
13
13
|
class: "text-red-500 text-sm mt-2"
|
|
14
|
-
},
|
|
14
|
+
}, Be = { class: "fm-typo-en-body-sm-400" }, Le = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "p-12 border border-fm-color-border-primary rounded-8 bg-fm-color-background-secondary"
|
|
17
17
|
}, Oe = {
|
|
@@ -47,23 +47,23 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
47
47
|
showButton: { type: Boolean }
|
|
48
48
|
},
|
|
49
49
|
emits: ["submitted"],
|
|
50
|
-
setup(ae, { expose:
|
|
51
|
-
const K = V, { t } = ie(), O =
|
|
50
|
+
setup(ae, { expose: k, emit: V }) {
|
|
51
|
+
const K = V, { t } = ie(), O = ve(), I = re(), x = de(), S = g(!1), v = g(""), m = g(""), C = g(!1), E = g([]), l = g(!1), i = g([]), $ = g(!1), h = g([]), F = g(!1), T = D(() => ye(E.value)), U = D(() => {
|
|
52
52
|
if (!v.value) return [];
|
|
53
|
-
const r =
|
|
54
|
-
return r ?
|
|
55
|
-
}), W =
|
|
53
|
+
const r = T.value.find((e) => e.value === v.value);
|
|
54
|
+
return r ? T.value.filter((e) => e.date.getTime() > r.date.getTime()).sort((e, d) => d.date.getTime() - e.date.getTime()) : [];
|
|
55
|
+
}), W = D({
|
|
56
56
|
get: () => {
|
|
57
|
-
if (
|
|
57
|
+
if (C.value && m.value) {
|
|
58
58
|
const r = E.value.find((e) => N(e._id) === m.value);
|
|
59
59
|
return (r == null ? void 0 : r._id) || m.value;
|
|
60
60
|
}
|
|
61
61
|
return m.value;
|
|
62
62
|
},
|
|
63
63
|
set: (r) => {
|
|
64
|
-
|
|
64
|
+
C.value && r ? m.value = N(r) : m.value = r;
|
|
65
65
|
}
|
|
66
|
-
}), H =
|
|
66
|
+
}), H = D(() => {
|
|
67
67
|
if (v.value)
|
|
68
68
|
try {
|
|
69
69
|
const r = N(v.value);
|
|
@@ -72,7 +72,7 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
72
72
|
} catch (r) {
|
|
73
73
|
console.error("Error parsing date from closing ID:", r);
|
|
74
74
|
}
|
|
75
|
-
}), Y =
|
|
75
|
+
}), Y = D(() => {
|
|
76
76
|
if (!v.value || !m.value) return "";
|
|
77
77
|
const r = N(v.value), e = m.value;
|
|
78
78
|
if (r && e) {
|
|
@@ -81,16 +81,16 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
81
81
|
return t("inventory.stock.recalculation.error.endDateBeforeOpening");
|
|
82
82
|
}
|
|
83
83
|
return "";
|
|
84
|
-
}), M =
|
|
84
|
+
}), M = D(() => !!v.value && !!m.value && !Y.value), j = D(() => i.value.some(
|
|
85
85
|
(r) => !r.completedAt && !r.failedReason
|
|
86
86
|
));
|
|
87
87
|
async function X() {
|
|
88
|
-
|
|
88
|
+
S.value = !0, await Promise.all([oe(), Z()]), v.value = "", m.value = "", C.value = !1;
|
|
89
89
|
}
|
|
90
90
|
function te() {
|
|
91
|
-
|
|
91
|
+
S.value = !1;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
k({
|
|
94
94
|
open: X,
|
|
95
95
|
close: te
|
|
96
96
|
});
|
|
@@ -100,7 +100,7 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
100
100
|
const r = await I.getLastNClosings(30);
|
|
101
101
|
E.value = r;
|
|
102
102
|
} catch (r) {
|
|
103
|
-
console.error("Error fetching recent closings:", r),
|
|
103
|
+
console.error("Error fetching recent closings:", r), x.open({
|
|
104
104
|
title: t("common.error"),
|
|
105
105
|
message: "Failed to fetch recent closings",
|
|
106
106
|
type: "error"
|
|
@@ -110,14 +110,14 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
async function Z() {
|
|
113
|
-
|
|
113
|
+
$.value = !0;
|
|
114
114
|
try {
|
|
115
115
|
const r = await O.recalculation.recalculationRequests();
|
|
116
|
-
|
|
116
|
+
i.value = r;
|
|
117
117
|
} catch (r) {
|
|
118
118
|
console.error("Error fetching recalculation requests:", r);
|
|
119
119
|
} finally {
|
|
120
|
-
|
|
120
|
+
$.value = !1;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
async function G() {
|
|
@@ -133,7 +133,7 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
133
133
|
);
|
|
134
134
|
h.value = r;
|
|
135
135
|
} catch {
|
|
136
|
-
|
|
136
|
+
x.open({
|
|
137
137
|
title: t("common.error"),
|
|
138
138
|
message: "Failed to fetch affected closing drafts",
|
|
139
139
|
type: "error"
|
|
@@ -160,13 +160,13 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
160
160
|
const r = h.value.map((e) => e._id);
|
|
161
161
|
await O.recalculation.scheduleInvalidateClosingDraftCache(r);
|
|
162
162
|
}
|
|
163
|
-
|
|
163
|
+
x.open({
|
|
164
164
|
title: t("common.success"),
|
|
165
165
|
message: "Stock recalculation has been scheduled successfully",
|
|
166
166
|
type: "success"
|
|
167
|
-
}), await Z(),
|
|
167
|
+
}), await Z(), S.value = !1, K("submitted");
|
|
168
168
|
} catch (r) {
|
|
169
|
-
console.error("Error scheduling recalculation:", r),
|
|
169
|
+
console.error("Error scheduling recalculation:", r), x.open({
|
|
170
170
|
title: t("common.error"),
|
|
171
171
|
message: "Failed to schedule stock recalculation",
|
|
172
172
|
type: "error"
|
|
@@ -177,7 +177,7 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
return (r, e) => {
|
|
180
|
-
const d =
|
|
180
|
+
const d = w("FmButton"), B = w("FmSelect"), c = w("FmRadio"), p = w("FmDatePicker"), A = w("FmAlert"), P = w("FmDialog");
|
|
181
181
|
return n(), y("div", null, [
|
|
182
182
|
r.showButton ? (n(), z(d, {
|
|
183
183
|
key: 0,
|
|
@@ -186,100 +186,100 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
186
186
|
onClick: me(X, ["stop"])
|
|
187
187
|
})) : b("", !0),
|
|
188
188
|
_(P, {
|
|
189
|
-
modelValue:
|
|
190
|
-
"onUpdate:modelValue": e[7] || (e[7] = (u) =>
|
|
189
|
+
modelValue: S.value,
|
|
190
|
+
"onUpdate:modelValue": e[7] || (e[7] = (u) => S.value = u),
|
|
191
191
|
"close-button": "",
|
|
192
192
|
dismissAway: "",
|
|
193
193
|
"max-width": "600px"
|
|
194
194
|
}, {
|
|
195
195
|
"dialog-header": R(() => [
|
|
196
|
-
o("div", Se, a(
|
|
196
|
+
o("div", Se, a(s(t)("inventory.stock.recalculation.title")), 1)
|
|
197
197
|
]),
|
|
198
198
|
"dialog-footer": R(() => [
|
|
199
199
|
j.value ? (n(), y("div", et, [
|
|
200
200
|
_(d, {
|
|
201
201
|
variant: "tertiary",
|
|
202
|
-
onClick: e[6] || (e[6] = (u) =>
|
|
203
|
-
label:
|
|
202
|
+
onClick: e[6] || (e[6] = (u) => S.value = !1),
|
|
203
|
+
label: s(t)("common.close")
|
|
204
204
|
}, null, 8, ["label"])
|
|
205
205
|
])) : (n(), y("div", qe, [
|
|
206
206
|
_(d, {
|
|
207
207
|
variant: "tertiary",
|
|
208
|
-
onClick: e[5] || (e[5] = (u) =>
|
|
208
|
+
onClick: e[5] || (e[5] = (u) => S.value = !1),
|
|
209
209
|
disabled: l.value,
|
|
210
|
-
label:
|
|
210
|
+
label: s(t)("common.cancel")
|
|
211
211
|
}, null, 8, ["disabled", "label"]),
|
|
212
212
|
_(d, {
|
|
213
213
|
variant: "primary",
|
|
214
214
|
onClick: J,
|
|
215
215
|
disabled: !M.value || l.value,
|
|
216
216
|
loading: l.value,
|
|
217
|
-
label:
|
|
217
|
+
label: s(t)("inventory.stock.recalculation.schedule")
|
|
218
218
|
}, null, 8, ["disabled", "loading", "label"])
|
|
219
219
|
]))
|
|
220
220
|
]),
|
|
221
221
|
default: R(() => [
|
|
222
222
|
o("div", Ve, [
|
|
223
|
-
o("div",
|
|
223
|
+
o("div", $e, a(s(t)("inventory.stock.recalculation.description")), 1),
|
|
224
224
|
j.value ? b("", !0) : (n(), y(Q, { key: 0 }, [
|
|
225
|
-
o("div",
|
|
225
|
+
o("div", Ce, [
|
|
226
226
|
o("p", Ae, [
|
|
227
|
-
ee(a(
|
|
227
|
+
ee(a(s(t)("inventory.stock.recalculation.openingDate")) + " ", 1),
|
|
228
228
|
e[8] || (e[8] = o("span", { class: "text-fm-color-system-error-300" }, "*", -1))
|
|
229
229
|
]),
|
|
230
230
|
e[9] || (e[9] = o("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mb-4" }, " Showing the last 30 closing records. Select the opening date to start recalculation. ", -1)),
|
|
231
|
-
_(
|
|
231
|
+
_(B, {
|
|
232
232
|
modelValue: v.value,
|
|
233
233
|
"onUpdate:modelValue": e[0] || (e[0] = (u) => v.value = u),
|
|
234
|
-
items:
|
|
235
|
-
placeholder:
|
|
234
|
+
items: T.value,
|
|
235
|
+
placeholder: s(t)("inventory.stock.recalculation.selectOpening"),
|
|
236
236
|
loading: l.value,
|
|
237
237
|
disabled: l.value
|
|
238
238
|
}, null, 8, ["modelValue", "items", "placeholder", "loading", "disabled"])
|
|
239
239
|
]),
|
|
240
240
|
o("div", Fe, [
|
|
241
241
|
o("p", Re, [
|
|
242
|
-
ee(a(
|
|
242
|
+
ee(a(s(t)("inventory.stock.recalculation.untilDate")) + " ", 1),
|
|
243
243
|
e[10] || (e[10] = o("span", { class: "text-fm-color-system-error-300" }, "*", -1))
|
|
244
244
|
]),
|
|
245
245
|
o("div", Ie, [
|
|
246
246
|
_(c, {
|
|
247
|
-
modelValue:
|
|
248
|
-
"onUpdate:modelValue": e[1] || (e[1] = (u) =>
|
|
247
|
+
modelValue: C.value,
|
|
248
|
+
"onUpdate:modelValue": e[1] || (e[1] = (u) => C.value = u),
|
|
249
249
|
value: !1,
|
|
250
|
-
label:
|
|
250
|
+
label: s(t)("inventory.stock.recalculation.selectByDate")
|
|
251
251
|
}, null, 8, ["modelValue", "label"]),
|
|
252
252
|
_(c, {
|
|
253
|
-
modelValue:
|
|
254
|
-
"onUpdate:modelValue": e[2] || (e[2] = (u) =>
|
|
253
|
+
modelValue: C.value,
|
|
254
|
+
"onUpdate:modelValue": e[2] || (e[2] = (u) => C.value = u),
|
|
255
255
|
value: !0,
|
|
256
|
-
label:
|
|
256
|
+
label: s(t)("inventory.stock.recalculation.selectByClosing")
|
|
257
257
|
}, null, 8, ["modelValue", "label"])
|
|
258
258
|
]),
|
|
259
|
-
|
|
259
|
+
C.value ? (n(), z(B, {
|
|
260
260
|
key: 1,
|
|
261
261
|
modelValue: W.value,
|
|
262
262
|
"onUpdate:modelValue": e[4] || (e[4] = (u) => W.value = u),
|
|
263
263
|
items: U.value,
|
|
264
|
-
placeholder:
|
|
264
|
+
placeholder: s(t)("inventory.stock.recalculation.selectClosing"),
|
|
265
265
|
loading: l.value,
|
|
266
266
|
disabled: !v.value || l.value
|
|
267
|
-
}, null, 8, ["modelValue", "items", "placeholder", "loading", "disabled"])) : (n(), z(
|
|
267
|
+
}, null, 8, ["modelValue", "items", "placeholder", "loading", "disabled"])) : (n(), z(p, {
|
|
268
268
|
key: 0,
|
|
269
269
|
modelValue: m.value,
|
|
270
270
|
"onUpdate:modelValue": e[3] || (e[3] = (u) => m.value = u),
|
|
271
|
-
placeholder:
|
|
271
|
+
placeholder: s(t)("inventory.stock.recalculation.selectDate"),
|
|
272
272
|
min: H.value,
|
|
273
273
|
disabled: !v.value || l.value
|
|
274
274
|
}, null, 8, ["modelValue", "placeholder", "min", "disabled"])),
|
|
275
|
-
Y.value ? (n(), y("div",
|
|
275
|
+
Y.value ? (n(), y("div", Te, a(Y.value), 1)) : b("", !0)
|
|
276
276
|
]),
|
|
277
277
|
v.value && m.value && !Y.value ? (n(), z(A, {
|
|
278
278
|
key: 0,
|
|
279
279
|
type: "info"
|
|
280
280
|
}, {
|
|
281
281
|
default: R(() => [
|
|
282
|
-
o("div",
|
|
282
|
+
o("div", Be, a(s(t)("inventory.stock.recalculation.info")), 1)
|
|
283
283
|
]),
|
|
284
284
|
_: 1
|
|
285
285
|
})) : b("", !0),
|
|
@@ -298,32 +298,32 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
298
298
|
]))
|
|
299
299
|
])) : b("", !0)
|
|
300
300
|
], 64)),
|
|
301
|
-
|
|
302
|
-
o("p", Ke, a(
|
|
301
|
+
i.value.length > 0 ? (n(), y("div", Me, [
|
|
302
|
+
o("p", Ke, a(s(t)("inventory.stock.recalculation.recentRequests")), 1),
|
|
303
303
|
o("div", He, [
|
|
304
|
-
(n(!0), y(Q, null, ne(
|
|
305
|
-
var
|
|
304
|
+
(n(!0), y(Q, null, ne(i.value, (u) => {
|
|
305
|
+
var f;
|
|
306
306
|
return n(), y("div", {
|
|
307
307
|
key: u._id,
|
|
308
308
|
class: "p-12 border border-fm-color-border-primary rounded-8 flex flex-col gap-4"
|
|
309
309
|
}, [
|
|
310
310
|
o("div", je, [
|
|
311
|
-
o("div", ze, a(
|
|
311
|
+
o("div", ze, a(s(t)("inventory.stock.recalculation.requestedAt")) + ": " + a(new Date(u.createdAt).toLocaleString()), 1),
|
|
312
312
|
o("div", We, [
|
|
313
|
-
(
|
|
313
|
+
(f = u.meta) != null && f.openingType ? (n(), y("div", Ye, a(u.meta.openingType === "stockSnapshot" ? "Snapshot" : "Closing"), 1)) : b("", !0),
|
|
314
314
|
o("div", {
|
|
315
315
|
class: fe(["fm-typo-en-body-xs-600 px-8 py-4 rounded-4", {
|
|
316
316
|
"bg-fm-color-system-error-100 text-fm-color-system-error-500": u.failedReason,
|
|
317
317
|
"bg-fm-color-system-success-100 text-fm-color-system-success-500": u.completedAt,
|
|
318
318
|
"bg-fm-color-system-info-100 text-fm-color-system-info-500": !u.failedReason && !u.completedAt
|
|
319
319
|
}])
|
|
320
|
-
}, a(u.failedReason ?
|
|
320
|
+
}, a(u.failedReason ? s(t)("inventory.stock.recalculation.status.failed") : u.completedAt ? s(t)("inventory.stock.recalculation.status.completed") : s(t)("inventory.stock.recalculation.status.inProgress")), 3)
|
|
321
321
|
])
|
|
322
322
|
]),
|
|
323
|
-
o("div", Ge, a(
|
|
324
|
-
o("div", Je, a(
|
|
325
|
-
u.createdBy ? (n(), y("div", Qe, a(
|
|
326
|
-
u.completedAt ? (n(), y("div", Xe, a(
|
|
323
|
+
o("div", Ge, a(s(t)("inventory.stock.recalculation.from")) + ": " + a(new Date(u.recalculateStartDate).toLocaleDateString()), 1),
|
|
324
|
+
o("div", Je, a(s(t)("inventory.stock.recalculation.to")) + ": " + a(new Date(u.recalculateEndDate).toLocaleDateString()), 1),
|
|
325
|
+
u.createdBy ? (n(), y("div", Qe, a(s(t)("inventory.stock.recalculation.requestedBy")) + ": " + a(u.createdBy.name || u.createdBy.id), 1)) : b("", !0),
|
|
326
|
+
u.completedAt ? (n(), y("div", Xe, a(s(t)("inventory.stock.recalculation.completedAt")) + ": " + a(new Date(u.completedAt).toLocaleString()), 1)) : b("", !0),
|
|
327
327
|
u.failedReason ? (n(), y("div", Ze, a(u.failedReason), 1)) : b("", !0)
|
|
328
328
|
]);
|
|
329
329
|
}), 128))
|
|
@@ -348,13 +348,13 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
348
348
|
}, ft = {
|
|
349
349
|
key: 1,
|
|
350
350
|
class: "flex flex-col gap-8"
|
|
351
|
-
},
|
|
351
|
+
}, vt = { class: "fm-typo-en-body-sm-600" }, yt = { class: "flex flex-col gap-4" }, pt = { key: 0 }, gt = { key: 1 }, ht = { key: 2 }, _t = {
|
|
352
352
|
key: 1,
|
|
353
353
|
class: "flex flex-col gap-8"
|
|
354
354
|
}, bt = { class: "fm-typo-en-body-md-600" }, kt = { class: "flex flex-col gap-8 max-h-[300px] overflow-y-auto" }, xt = { class: "flex items-center justify-between" }, Dt = { class: "fm-typo-en-body-sm-600" }, wt = { class: "flex items-center gap-8" }, St = {
|
|
355
355
|
key: 0,
|
|
356
356
|
class: "fm-typo-en-body-xs-600 px-8 py-4 rounded-4 bg-fm-color-neutral-100 text-fm-color-typo-secondary"
|
|
357
|
-
}, Vt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
|
|
357
|
+
}, Vt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, $t = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ct = {
|
|
358
358
|
key: 0,
|
|
359
359
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
360
360
|
}, At = {
|
|
@@ -369,18 +369,18 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
369
369
|
}, It = {
|
|
370
370
|
key: 1,
|
|
371
371
|
class: "flex gap-8 ml-auto"
|
|
372
|
-
},
|
|
372
|
+
}, Tt = /* @__PURE__ */ se({
|
|
373
373
|
__name: "SnapshotRecalculationDialog",
|
|
374
374
|
props: {
|
|
375
375
|
showButton: { type: Boolean }
|
|
376
376
|
},
|
|
377
377
|
emits: ["submitted"],
|
|
378
|
-
setup(ae, { expose:
|
|
379
|
-
const K = V, { t } = ie(), O =
|
|
380
|
-
() =>
|
|
381
|
-
), U =
|
|
378
|
+
setup(ae, { expose: k, emit: V }) {
|
|
379
|
+
const K = V, { t } = ie(), O = ve(), I = re(), x = de(), S = g(!1), v = g(""), m = g(""), C = g([]), E = g([]), l = g(!1), i = g([]), $ = g(!1), h = g([]), F = g(!1), T = D(
|
|
380
|
+
() => ye(C.value, E.value)
|
|
381
|
+
), U = D(() => De(
|
|
382
382
|
h.value.filter((e) => !!e.closingId).map((e) => ({ closingId: e.closingId, draftCreatedAt: new Date(N(e._id)) }))
|
|
383
|
-
)), W =
|
|
383
|
+
)), W = D(() => {
|
|
384
384
|
if (v.value)
|
|
385
385
|
try {
|
|
386
386
|
const e = N(v.value);
|
|
@@ -389,7 +389,7 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
389
389
|
} catch (e) {
|
|
390
390
|
console.error("Error parsing date from opening ID:", e);
|
|
391
391
|
}
|
|
392
|
-
}), H =
|
|
392
|
+
}), H = D(() => {
|
|
393
393
|
if (!v.value || !m.value) return "";
|
|
394
394
|
const e = N(v.value);
|
|
395
395
|
if (e && m.value) {
|
|
@@ -398,20 +398,20 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
398
398
|
return t("inventory.stock.recalculation.error.endDateBeforeOpening");
|
|
399
399
|
}
|
|
400
400
|
return "";
|
|
401
|
-
}), Y =
|
|
401
|
+
}), Y = D(() => {
|
|
402
402
|
if (!m.value) return !1;
|
|
403
403
|
const e = new Date(m.value), d = /* @__PURE__ */ new Date();
|
|
404
404
|
return d.setHours(0, 0, 0, 0), e.setHours(0, 0, 0, 0), e >= d;
|
|
405
|
-
}), M =
|
|
405
|
+
}), M = D(() => !!v.value && !!m.value && !H.value), j = D(() => i.value.some(
|
|
406
406
|
(e) => !e.completedAt && !e.failedReason
|
|
407
407
|
));
|
|
408
408
|
async function X() {
|
|
409
|
-
|
|
409
|
+
S.value = !0, await Promise.all([oe(), Z(), G()]), v.value = "", m.value = "";
|
|
410
410
|
}
|
|
411
411
|
function te() {
|
|
412
|
-
|
|
412
|
+
S.value = !1;
|
|
413
413
|
}
|
|
414
|
-
|
|
414
|
+
k({
|
|
415
415
|
open: X,
|
|
416
416
|
close: te
|
|
417
417
|
});
|
|
@@ -419,9 +419,9 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
419
419
|
l.value = !0;
|
|
420
420
|
try {
|
|
421
421
|
const e = await I.getLastNClosings(30);
|
|
422
|
-
|
|
422
|
+
C.value = e;
|
|
423
423
|
} catch (e) {
|
|
424
|
-
console.error("Error fetching recent closings:", e),
|
|
424
|
+
console.error("Error fetching recent closings:", e), x.open({
|
|
425
425
|
title: t("common.error"),
|
|
426
426
|
message: "Failed to fetch recent closings",
|
|
427
427
|
type: "error"
|
|
@@ -439,14 +439,14 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
441
|
async function G() {
|
|
442
|
-
|
|
442
|
+
$.value = !0;
|
|
443
443
|
try {
|
|
444
444
|
const e = await O.recalculation.recalculationRequests();
|
|
445
|
-
|
|
445
|
+
i.value = e;
|
|
446
446
|
} catch (e) {
|
|
447
447
|
console.error("Error fetching recalculation requests:", e);
|
|
448
448
|
} finally {
|
|
449
|
-
|
|
449
|
+
$.value = !1;
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
async function J() {
|
|
@@ -464,7 +464,7 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
464
464
|
);
|
|
465
465
|
h.value = d;
|
|
466
466
|
} catch {
|
|
467
|
-
|
|
467
|
+
x.open({
|
|
468
468
|
title: t("common.error"),
|
|
469
469
|
message: "Failed to fetch affected closing drafts",
|
|
470
470
|
type: "error"
|
|
@@ -490,16 +490,16 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
490
490
|
untilDate: e.toISOString(),
|
|
491
491
|
recalculateBySnapshot: !0
|
|
492
492
|
}), h.value.length > 0) {
|
|
493
|
-
const d = h.value.map((
|
|
493
|
+
const d = h.value.map((B) => B._id);
|
|
494
494
|
await O.recalculation.scheduleInvalidateClosingDraftCache(d);
|
|
495
495
|
}
|
|
496
|
-
|
|
496
|
+
x.open({
|
|
497
497
|
title: t("common.success"),
|
|
498
498
|
message: "Stock recalculation has been scheduled successfully",
|
|
499
499
|
type: "success"
|
|
500
|
-
}), await G(),
|
|
500
|
+
}), await G(), S.value = !1, K("submitted");
|
|
501
501
|
} catch (e) {
|
|
502
|
-
console.error("Error scheduling recalculation:", e),
|
|
502
|
+
console.error("Error scheduling recalculation:", e), x.open({
|
|
503
503
|
title: t("common.error"),
|
|
504
504
|
message: "Failed to schedule stock recalculation",
|
|
505
505
|
type: "error"
|
|
@@ -510,76 +510,76 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
512
|
return (e, d) => {
|
|
513
|
-
const
|
|
513
|
+
const B = w("FmButton"), c = w("FmSelect"), p = w("FmDatePicker"), A = w("FmSnackbar"), P = w("FmAlert"), u = w("FmDialog");
|
|
514
514
|
return n(), y("div", null, [
|
|
515
|
-
e.showButton ? (n(), z(
|
|
515
|
+
e.showButton ? (n(), z(B, {
|
|
516
516
|
key: 0,
|
|
517
517
|
"prepend-icon": "info",
|
|
518
518
|
variant: "tertiary",
|
|
519
519
|
onClick: me(X, ["stop"])
|
|
520
520
|
})) : b("", !0),
|
|
521
521
|
_(u, {
|
|
522
|
-
modelValue:
|
|
523
|
-
"onUpdate:modelValue": d[4] || (d[4] = (
|
|
522
|
+
modelValue: S.value,
|
|
523
|
+
"onUpdate:modelValue": d[4] || (d[4] = (f) => S.value = f),
|
|
524
524
|
"close-button": "",
|
|
525
525
|
dismissAway: "",
|
|
526
526
|
"max-width": "600px"
|
|
527
527
|
}, {
|
|
528
528
|
"dialog-header": R(() => [
|
|
529
|
-
o("div", ot, a(
|
|
529
|
+
o("div", ot, a(s(t)("inventory.stock.recalculation.title")), 1)
|
|
530
530
|
]),
|
|
531
531
|
"dialog-footer": R(() => [
|
|
532
532
|
j.value ? (n(), y("div", It, [
|
|
533
|
-
_(
|
|
533
|
+
_(B, {
|
|
534
534
|
variant: "tertiary",
|
|
535
|
-
onClick: d[3] || (d[3] = (
|
|
536
|
-
label:
|
|
535
|
+
onClick: d[3] || (d[3] = (f) => S.value = !1),
|
|
536
|
+
label: s(t)("common.close")
|
|
537
537
|
}, null, 8, ["label"])
|
|
538
538
|
])) : (n(), y("div", Rt, [
|
|
539
|
-
_(
|
|
539
|
+
_(B, {
|
|
540
540
|
variant: "tertiary",
|
|
541
|
-
onClick: d[2] || (d[2] = (
|
|
541
|
+
onClick: d[2] || (d[2] = (f) => S.value = !1),
|
|
542
542
|
disabled: l.value,
|
|
543
|
-
label:
|
|
543
|
+
label: s(t)("common.cancel")
|
|
544
544
|
}, null, 8, ["disabled", "label"]),
|
|
545
|
-
_(
|
|
545
|
+
_(B, {
|
|
546
546
|
variant: "primary",
|
|
547
547
|
onClick: r,
|
|
548
548
|
disabled: !M.value || l.value,
|
|
549
549
|
loading: l.value,
|
|
550
|
-
label:
|
|
550
|
+
label: s(t)("inventory.stock.recalculation.schedule")
|
|
551
551
|
}, null, 8, ["disabled", "loading", "label"])
|
|
552
552
|
]))
|
|
553
553
|
]),
|
|
554
554
|
default: R(() => [
|
|
555
555
|
o("div", at, [
|
|
556
|
-
o("div", lt, a(
|
|
556
|
+
o("div", lt, a(s(t)("inventory.stock.recalculation.description")), 1),
|
|
557
557
|
j.value ? b("", !0) : (n(), y(Q, { key: 0 }, [
|
|
558
558
|
o("div", nt, [
|
|
559
559
|
o("p", st, [
|
|
560
|
-
ee(a(
|
|
560
|
+
ee(a(s(t)("inventory.stock.recalculation.openingDate")) + " ", 1),
|
|
561
561
|
d[5] || (d[5] = o("span", { class: "text-fm-color-system-error-300" }, "*", -1))
|
|
562
562
|
]),
|
|
563
563
|
d[6] || (d[6] = o("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mb-4" }, " Select from the last 30 closing or snapshot records as the opening date for recalculation. ", -1)),
|
|
564
564
|
_(c, {
|
|
565
565
|
modelValue: v.value,
|
|
566
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
567
|
-
items:
|
|
568
|
-
placeholder:
|
|
566
|
+
"onUpdate:modelValue": d[0] || (d[0] = (f) => v.value = f),
|
|
567
|
+
items: T.value,
|
|
568
|
+
placeholder: s(t)("inventory.stock.recalculation.selectOpening"),
|
|
569
569
|
loading: l.value,
|
|
570
570
|
disabled: l.value
|
|
571
571
|
}, null, 8, ["modelValue", "items", "placeholder", "loading", "disabled"])
|
|
572
572
|
]),
|
|
573
573
|
o("div", it, [
|
|
574
574
|
o("p", ct, [
|
|
575
|
-
ee(a(
|
|
575
|
+
ee(a(s(t)("inventory.stock.recalculation.untilDate")) + " ", 1),
|
|
576
576
|
d[7] || (d[7] = o("span", { class: "text-fm-color-system-error-300" }, "*", -1))
|
|
577
577
|
]),
|
|
578
578
|
d[8] || (d[8] = o("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mb-4" }, " Select the end date for recalculation. Must be after the selected opening date. ", -1)),
|
|
579
|
-
_(
|
|
579
|
+
_(p, {
|
|
580
580
|
modelValue: m.value,
|
|
581
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
582
|
-
placeholder:
|
|
581
|
+
"onUpdate:modelValue": d[1] || (d[1] = (f) => m.value = f),
|
|
582
|
+
placeholder: s(t)("inventory.stock.recalculation.selectDate"),
|
|
583
583
|
min: W.value,
|
|
584
584
|
disabled: !v.value || l.value
|
|
585
585
|
}, null, 8, ["modelValue", "placeholder", "min", "disabled"]),
|
|
@@ -596,53 +596,53 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
596
596
|
type: "info"
|
|
597
597
|
}, {
|
|
598
598
|
default: R(() => [
|
|
599
|
-
o("div", dt, a(
|
|
599
|
+
o("div", dt, a(s(t)("inventory.stock.recalculation.info")), 1)
|
|
600
600
|
]),
|
|
601
601
|
_: 1
|
|
602
602
|
})) : b("", !0),
|
|
603
603
|
h.value.length > 0 ? (n(), y("div", ut, [
|
|
604
604
|
F.value ? (n(), y("div", mt, " Loading affected closing drafts... ")) : (n(), y("div", ft, [
|
|
605
|
-
o("div",
|
|
606
|
-
o("div",
|
|
607
|
-
(n(!0), y(Q, null, ne(h.value, (
|
|
608
|
-
key:
|
|
605
|
+
o("div", vt, " Affected closing draft(s): " + a(h.value.length), 1),
|
|
606
|
+
o("div", yt, [
|
|
607
|
+
(n(!0), y(Q, null, ne(h.value, (f) => (n(), y("div", {
|
|
608
|
+
key: f._id,
|
|
609
609
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
610
610
|
}, [
|
|
611
611
|
d[9] || (d[9] = ee(" • ")),
|
|
612
|
-
|
|
613
|
-
|
|
612
|
+
f.closingId && U.value.get(f.closingId) ? (n(), y("span", pt, a(U.value.get(f.closingId)), 1)) : (n(), y("span", gt, a(f._id), 1)),
|
|
613
|
+
f.effectiveAt ? (n(), y("span", ht, " (" + a(new Date(f.effectiveAt).toLocaleString()) + ") ", 1)) : b("", !0)
|
|
614
614
|
]))), 128))
|
|
615
615
|
])
|
|
616
616
|
]))
|
|
617
617
|
])) : b("", !0)
|
|
618
618
|
], 64)),
|
|
619
|
-
|
|
620
|
-
o("p", bt, a(
|
|
619
|
+
i.value.length > 0 ? (n(), y("div", _t, [
|
|
620
|
+
o("p", bt, a(s(t)("inventory.stock.recalculation.recentRequests")), 1),
|
|
621
621
|
o("div", kt, [
|
|
622
|
-
(n(!0), y(Q, null, ne(
|
|
622
|
+
(n(!0), y(Q, null, ne(i.value, (f) => {
|
|
623
623
|
var le;
|
|
624
624
|
return n(), y("div", {
|
|
625
|
-
key:
|
|
625
|
+
key: f._id,
|
|
626
626
|
class: "p-12 border border-fm-color-border-primary rounded-8 flex flex-col gap-4"
|
|
627
627
|
}, [
|
|
628
628
|
o("div", xt, [
|
|
629
|
-
o("div", Dt, a(
|
|
629
|
+
o("div", Dt, a(s(t)("inventory.stock.recalculation.requestedAt")) + ": " + a(new Date(f.createdAt).toLocaleString()), 1),
|
|
630
630
|
o("div", wt, [
|
|
631
|
-
(le =
|
|
631
|
+
(le = f.meta) != null && le.openingType ? (n(), y("div", St, a(f.meta.openingType === "stockSnapshot" ? "Snapshot" : "Closing"), 1)) : b("", !0),
|
|
632
632
|
o("div", {
|
|
633
633
|
class: fe(["fm-typo-en-body-xs-600 px-8 py-4 rounded-4", {
|
|
634
|
-
"bg-fm-color-system-error-100 text-fm-color-system-error-500":
|
|
635
|
-
"bg-fm-color-system-success-100 text-fm-color-system-success-500":
|
|
636
|
-
"bg-fm-color-system-info-100 text-fm-color-system-info-500": !
|
|
634
|
+
"bg-fm-color-system-error-100 text-fm-color-system-error-500": f.failedReason,
|
|
635
|
+
"bg-fm-color-system-success-100 text-fm-color-system-success-500": f.completedAt,
|
|
636
|
+
"bg-fm-color-system-info-100 text-fm-color-system-info-500": !f.failedReason && !f.completedAt
|
|
637
637
|
}])
|
|
638
|
-
}, a(
|
|
638
|
+
}, a(f.failedReason ? s(t)("inventory.stock.recalculation.status.failed") : f.completedAt ? s(t)("inventory.stock.recalculation.status.completed") : s(t)("inventory.stock.recalculation.status.inProgress")), 3)
|
|
639
639
|
])
|
|
640
640
|
]),
|
|
641
|
-
o("div", Vt, a(
|
|
642
|
-
o("div",
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
641
|
+
o("div", Vt, a(s(t)("inventory.stock.recalculation.from")) + ": " + a(new Date(f.recalculateStartDate).toLocaleDateString()), 1),
|
|
642
|
+
o("div", $t, a(s(t)("inventory.stock.recalculation.to")) + ": " + a(new Date(f.recalculateEndDate).toLocaleDateString()), 1),
|
|
643
|
+
f.createdBy ? (n(), y("div", Ct, a(s(t)("inventory.stock.recalculation.requestedBy")) + ": " + a(f.createdBy.name || f.createdBy.id), 1)) : b("", !0),
|
|
644
|
+
f.completedAt ? (n(), y("div", At, a(s(t)("inventory.stock.recalculation.completedAt")) + ": " + a(new Date(f.completedAt).toLocaleString()), 1)) : b("", !0),
|
|
645
|
+
f.failedReason ? (n(), y("div", Ft, a(f.failedReason), 1)) : b("", !0)
|
|
646
646
|
]);
|
|
647
647
|
}), 128))
|
|
648
648
|
])
|
|
@@ -654,7 +654,7 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
654
654
|
]);
|
|
655
655
|
};
|
|
656
656
|
}
|
|
657
|
-
}),
|
|
657
|
+
}), Bt = { class: "fm-typo-en-heading-lg-600" }, Lt = { class: "flex flex-col gap-16" }, Ot = { class: "flex flex-col gap-4" }, Et = { class: "fm-typo-en-label-md-400 text-fm-color-typo-secondary" }, Ut = { class: "fm-typo-en-body-md-400" }, Pt = { class: "flex flex-col gap-4" }, Nt = { class: "fm-typo-en-label-md-400 text-fm-color-typo-secondary" }, Mt = { class: "fm-typo-en-body-md-400" }, Kt = { class: "flex flex-col gap-4" }, Ht = { class: "fm-typo-en-label-md-400 text-fm-color-typo-secondary" }, jt = { class: "flex gap-8 ml-auto" }, zt = /* @__PURE__ */ se({
|
|
658
658
|
__name: "ClosingDetailDialog",
|
|
659
659
|
props: {
|
|
660
660
|
modelValue: { type: Boolean },
|
|
@@ -662,32 +662,32 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
662
662
|
data: {}
|
|
663
663
|
},
|
|
664
664
|
emits: ["update:modelValue"],
|
|
665
|
-
setup(ae, { emit:
|
|
666
|
-
const { t: V } = ie(), K = _e(), t = ae, O =
|
|
665
|
+
setup(ae, { emit: k }) {
|
|
666
|
+
const { t: V } = ie(), K = _e(), t = ae, O = k, I = D({
|
|
667
667
|
get: () => t.modelValue,
|
|
668
668
|
set: (l) => O("update:modelValue", l)
|
|
669
|
-
}),
|
|
669
|
+
}), x = g("");
|
|
670
670
|
ce(I, (l) => {
|
|
671
|
-
l || (
|
|
671
|
+
l || (x.value = "");
|
|
672
672
|
});
|
|
673
|
-
const
|
|
673
|
+
const S = D(() => {
|
|
674
674
|
var l;
|
|
675
675
|
return ((l = t.data) == null ? void 0 : l.skus) ?? [];
|
|
676
|
-
}), v =
|
|
676
|
+
}), v = D(() => {
|
|
677
677
|
var h;
|
|
678
678
|
const l = (h = t.data) == null ? void 0 : h._id;
|
|
679
679
|
if (!l) return "-";
|
|
680
|
-
const
|
|
681
|
-
return new Date(
|
|
682
|
-
}), m =
|
|
683
|
-
const
|
|
680
|
+
const i = N(l);
|
|
681
|
+
return new Date(i).toLocaleString();
|
|
682
|
+
}), m = D(() => t.type === "closing" ? V("inventory.closing.history.closingDetail", "Closing Detail") : V("inventory.closing.history.snapshotDetail", "Snapshot Detail")), C = D(() => S.value.map((l) => {
|
|
683
|
+
const i = K.skuById[l.id] ?? null, $ = !i;
|
|
684
684
|
return {
|
|
685
685
|
id: l.id,
|
|
686
|
-
sku:
|
|
687
|
-
skuName: (
|
|
688
|
-
skuCode: (
|
|
686
|
+
sku: i,
|
|
687
|
+
skuName: (i == null ? void 0 : i.name) ?? l.id,
|
|
688
|
+
skuCode: (i == null ? void 0 : i.code) ?? "-",
|
|
689
689
|
balance: l.balance ?? { amount: 0, precision: 0 },
|
|
690
|
-
isMissing:
|
|
690
|
+
isMissing: $,
|
|
691
691
|
costs: l.costs,
|
|
692
692
|
weightedAverage: l.weightedAverage
|
|
693
693
|
};
|
|
@@ -696,9 +696,9 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
696
696
|
accessorKey: "skuName",
|
|
697
697
|
header: () => V("inventory.ingredient.name", "Ingredient Name"),
|
|
698
698
|
cell: (l) => {
|
|
699
|
-
const
|
|
700
|
-
return
|
|
701
|
-
q("span", {},
|
|
699
|
+
const i = l.row.original;
|
|
700
|
+
return i.isMissing ? q("div", { class: "flex items-center gap-8" }, [
|
|
701
|
+
q("span", {}, i.id),
|
|
702
702
|
q(
|
|
703
703
|
"span",
|
|
704
704
|
{
|
|
@@ -718,16 +718,16 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
718
718
|
header: () => V("inventory.closing.history.balance", "Balance"),
|
|
719
719
|
cell: (l) => {
|
|
720
720
|
var h;
|
|
721
|
-
const
|
|
722
|
-
if (
|
|
723
|
-
return `${
|
|
724
|
-
const
|
|
725
|
-
unit:
|
|
726
|
-
sku:
|
|
727
|
-
amount:
|
|
728
|
-
defaultTrackingMeasurement:
|
|
721
|
+
const i = l.row.original;
|
|
722
|
+
if (i.isMissing || !((h = i.sku) != null && h.unit))
|
|
723
|
+
return `${i.balance.amount / Math.pow(10, i.balance.precision)}`;
|
|
724
|
+
const $ = {
|
|
725
|
+
unit: i.sku.unit,
|
|
726
|
+
sku: i.sku,
|
|
727
|
+
amount: i.balance,
|
|
728
|
+
defaultTrackingMeasurement: i.sku.trackingMeasurement ?? void 0
|
|
729
729
|
};
|
|
730
|
-
return q(we,
|
|
730
|
+
return q(we, $);
|
|
731
731
|
},
|
|
732
732
|
size: 180
|
|
733
733
|
},
|
|
@@ -735,49 +735,49 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
735
735
|
accessorKey: "weightedAverage",
|
|
736
736
|
header: () => V("inventory.closing.history.weightedAvgCost", "Weighted Avg Cost"),
|
|
737
737
|
cell: (l) => {
|
|
738
|
-
const
|
|
739
|
-
if (!
|
|
740
|
-
const
|
|
741
|
-
return `${F} ${
|
|
738
|
+
const i = l.getValue();
|
|
739
|
+
if (!i) return "-";
|
|
740
|
+
const $ = i.amount ?? 0, h = i.precision ?? 0, F = i.currency ?? "", T = $ / Math.pow(10, h);
|
|
741
|
+
return `${F} ${T.toFixed(2)}`;
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
744
|
];
|
|
745
|
-
return (l,
|
|
746
|
-
const
|
|
747
|
-
return n(), z(
|
|
745
|
+
return (l, i) => {
|
|
746
|
+
const $ = w("FmTextField"), h = w("FmTable"), F = w("FmButton"), T = w("FmDialog");
|
|
747
|
+
return n(), z(T, {
|
|
748
748
|
modelValue: I.value,
|
|
749
|
-
"onUpdate:modelValue":
|
|
749
|
+
"onUpdate:modelValue": i[2] || (i[2] = (U) => I.value = U),
|
|
750
750
|
"close-button": "",
|
|
751
751
|
dismissAway: "",
|
|
752
752
|
"max-width": "900px"
|
|
753
753
|
}, {
|
|
754
754
|
"dialog-header": R(() => [
|
|
755
|
-
o("div",
|
|
755
|
+
o("div", Bt, a(m.value), 1)
|
|
756
756
|
]),
|
|
757
757
|
default: R(() => {
|
|
758
758
|
var U;
|
|
759
759
|
return [
|
|
760
760
|
o("div", Lt, [
|
|
761
761
|
o("div", Ot, [
|
|
762
|
-
o("div", Et, a(t.type === "closing" ?
|
|
762
|
+
o("div", Et, a(t.type === "closing" ? s(V)("inventory.closing.history.closingId") : s(V)("inventory.closing.history.snapshotId", "Snapshot ID")), 1),
|
|
763
763
|
o("div", Ut, a(((U = t.data) == null ? void 0 : U._id) ?? "-"), 1)
|
|
764
764
|
]),
|
|
765
765
|
o("div", Pt, [
|
|
766
|
-
o("div", Nt, a(
|
|
766
|
+
o("div", Nt, a(s(V)("inventory.closing.history.date")), 1),
|
|
767
767
|
o("div", Mt, a(v.value), 1)
|
|
768
768
|
]),
|
|
769
769
|
o("div", Kt, [
|
|
770
|
-
o("div", Ht, a(
|
|
771
|
-
_(
|
|
772
|
-
modelValue:
|
|
773
|
-
"onUpdate:modelValue":
|
|
770
|
+
o("div", Ht, a(s(V)("inventory.closing.history.ingredientBalances", "Ingredient Balances")) + " (" + a(S.value.length) + ") ", 1),
|
|
771
|
+
_($, {
|
|
772
|
+
modelValue: x.value,
|
|
773
|
+
"onUpdate:modelValue": i[0] || (i[0] = (W) => x.value = W),
|
|
774
774
|
placeholder: "Filter by code or name"
|
|
775
775
|
}, null, 8, ["modelValue"]),
|
|
776
776
|
_(h, {
|
|
777
|
-
"row-data":
|
|
777
|
+
"row-data": C.value,
|
|
778
778
|
"column-defs": E,
|
|
779
779
|
pagination: { pageSize: 10 },
|
|
780
|
-
"search-value":
|
|
780
|
+
"search-value": x.value
|
|
781
781
|
}, null, 8, ["row-data", "search-value"])
|
|
782
782
|
])
|
|
783
783
|
])
|
|
@@ -787,7 +787,7 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
787
787
|
o("div", jt, [
|
|
788
788
|
_(F, {
|
|
789
789
|
variant: "tertiary",
|
|
790
|
-
onClick:
|
|
790
|
+
onClick: i[1] || (i[1] = (U) => I.value = !1),
|
|
791
791
|
label: "Close"
|
|
792
792
|
})
|
|
793
793
|
])
|
|
@@ -796,14 +796,14 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
796
796
|
}, 8, ["modelValue"]);
|
|
797
797
|
};
|
|
798
798
|
}
|
|
799
|
-
}), Wt = { class: "flex flex-col gap-16 p-16" }, Yt = { class: "flex flex-col gap-16" },
|
|
799
|
+
}), Wt = { class: "flex flex-col gap-16 p-16" }, Yt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Gt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Jt = { class: "flex flex-col gap-16" }, Qt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xt = { class: "flex gap-8 ml-auto" }, co = /* @__PURE__ */ se({
|
|
800
800
|
__name: "ClosingHistoryView",
|
|
801
801
|
setup(ae) {
|
|
802
|
-
var d,
|
|
803
|
-
const { t:
|
|
804
|
-
{ label: "
|
|
805
|
-
{ label: "
|
|
806
|
-
], v = g([]), m = g(!1),
|
|
802
|
+
var d, B;
|
|
803
|
+
const { t: k } = ie(), V = re(), K = be(), t = he(), O = xe(), I = de(), x = g("closings"), S = D(() => [
|
|
804
|
+
{ label: k("inventory.closing.history.closingsTab"), value: "closings" },
|
|
805
|
+
{ label: k("inventory.closing.history.snapshotsTab"), value: "snapshots" }
|
|
806
|
+
]), v = g([]), m = g(!1), C = g([]), E = g(!1), l = g(!1), i = g("closing"), $ = g(null);
|
|
807
807
|
function h(c) {
|
|
808
808
|
return [
|
|
809
809
|
c.getFullYear(),
|
|
@@ -811,17 +811,17 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
811
811
|
String(c.getDate()).padStart(2, "0")
|
|
812
812
|
].join("-");
|
|
813
813
|
}
|
|
814
|
-
const F = () => h(new Date(Date.now() - 864e5)),
|
|
814
|
+
const F = () => h(new Date(Date.now() - 864e5)), T = g(F()), U = D(() => {
|
|
815
815
|
const c = [];
|
|
816
|
-
return
|
|
816
|
+
return x.value === "closings" ? c.push(
|
|
817
817
|
{
|
|
818
|
-
label:
|
|
818
|
+
label: k("inventory.stock.recalculation.title"),
|
|
819
819
|
value: "recalculation",
|
|
820
820
|
prependIcon: "history",
|
|
821
821
|
isAdminOnly: !0
|
|
822
822
|
},
|
|
823
823
|
{
|
|
824
|
-
label:
|
|
824
|
+
label: k("inventory.closing.history.initiate_opening"),
|
|
825
825
|
value: "initiateOpening",
|
|
826
826
|
prependIcon: "add_box",
|
|
827
827
|
isAdminOnly: !0
|
|
@@ -833,13 +833,13 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
833
833
|
}
|
|
834
834
|
) : c.push(
|
|
835
835
|
{
|
|
836
|
-
label: `${
|
|
836
|
+
label: `${k("inventory.stock.recalculation.title")} (BETA)`,
|
|
837
837
|
value: "recalculation",
|
|
838
838
|
prependIcon: "history",
|
|
839
839
|
isAdminOnly: !0
|
|
840
840
|
},
|
|
841
841
|
{
|
|
842
|
-
label: `${
|
|
842
|
+
label: `${k("inventory.closing.history.initiate_snapshot")} (BETA)`,
|
|
843
843
|
value: "initiateStockSnapshot",
|
|
844
844
|
prependIcon: "camera",
|
|
845
845
|
isAdminOnly: !0
|
|
@@ -852,10 +852,10 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
852
852
|
), c;
|
|
853
853
|
}), W = g(), H = g();
|
|
854
854
|
function Y(c) {
|
|
855
|
-
var
|
|
855
|
+
var p, A;
|
|
856
856
|
switch (c) {
|
|
857
857
|
case "recalculation":
|
|
858
|
-
return
|
|
858
|
+
return x.value === "closings" ? (p = W.value) == null ? void 0 : p.open() : (A = H.value) == null ? void 0 : A.open();
|
|
859
859
|
case "initiateOpening": {
|
|
860
860
|
O.open({
|
|
861
861
|
title: "Initiate Opening Balance",
|
|
@@ -877,7 +877,7 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
877
877
|
break;
|
|
878
878
|
}
|
|
879
879
|
case "initiateStockSnapshot": {
|
|
880
|
-
|
|
880
|
+
T.value = F(), M.value = !0;
|
|
881
881
|
break;
|
|
882
882
|
}
|
|
883
883
|
case "refreshOpening": {
|
|
@@ -894,7 +894,7 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
894
894
|
async function te() {
|
|
895
895
|
j.value = !0;
|
|
896
896
|
try {
|
|
897
|
-
await V.initiateStockSnapshot(
|
|
897
|
+
await V.initiateStockSnapshot(T.value), I.open({
|
|
898
898
|
message: "Stock snapshot created successfully.",
|
|
899
899
|
type: "success"
|
|
900
900
|
}), M.value = !1, await J();
|
|
@@ -911,41 +911,41 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
911
911
|
...(d = t.sessionUser.value) != null && d.role.isAdmin ? [
|
|
912
912
|
{
|
|
913
913
|
accessorKey: "_id",
|
|
914
|
-
header: () => q(ue, {}, () => `${
|
|
914
|
+
header: () => q(ue, {}, () => `${k("inventory.closing.history.closingId")}`),
|
|
915
915
|
cell: (c) => c.getValue()
|
|
916
916
|
}
|
|
917
917
|
] : [],
|
|
918
918
|
{
|
|
919
919
|
accessorKey: "_id",
|
|
920
920
|
id: "date",
|
|
921
|
-
header: () =>
|
|
921
|
+
header: () => k("inventory.closing.history.date"),
|
|
922
922
|
cell: (c) => {
|
|
923
|
-
const
|
|
923
|
+
const p = c.getValue(), A = N(p);
|
|
924
924
|
return new Date(A).toLocaleDateString();
|
|
925
925
|
}
|
|
926
926
|
},
|
|
927
927
|
{
|
|
928
928
|
accessorKey: "_id",
|
|
929
929
|
id: "time",
|
|
930
|
-
header: () =>
|
|
930
|
+
header: () => k("inventory.closing.history.time"),
|
|
931
931
|
cell: (c) => {
|
|
932
|
-
const
|
|
932
|
+
const p = c.getValue(), A = N(p);
|
|
933
933
|
return new Date(A).toLocaleTimeString();
|
|
934
934
|
}
|
|
935
935
|
},
|
|
936
936
|
{
|
|
937
937
|
accessorKey: "ref",
|
|
938
|
-
header: () =>
|
|
938
|
+
header: () => k("inventory.closing.history.createdFrom"),
|
|
939
939
|
cell: (c) => c.getValue() || "-"
|
|
940
940
|
}
|
|
941
941
|
], Z = [
|
|
942
|
-
...(
|
|
942
|
+
...(B = t.sessionUser.value) != null && B.role.isAdmin ? [
|
|
943
943
|
{
|
|
944
944
|
accessorKey: "_id",
|
|
945
945
|
header: () => q(
|
|
946
946
|
ue,
|
|
947
947
|
{},
|
|
948
|
-
() => `${
|
|
948
|
+
() => `${k("inventory.closing.history.snapshotId", "Snapshot ID")}`
|
|
949
949
|
),
|
|
950
950
|
cell: (c) => c.getValue()
|
|
951
951
|
}
|
|
@@ -953,24 +953,24 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
953
953
|
{
|
|
954
954
|
accessorKey: "_id",
|
|
955
955
|
id: "date",
|
|
956
|
-
header: () =>
|
|
956
|
+
header: () => k("inventory.closing.history.date"),
|
|
957
957
|
cell: (c) => {
|
|
958
|
-
const
|
|
958
|
+
const p = c.getValue(), A = N(p);
|
|
959
959
|
return new Date(A).toLocaleDateString();
|
|
960
960
|
}
|
|
961
961
|
},
|
|
962
962
|
{
|
|
963
963
|
accessorKey: "_id",
|
|
964
964
|
id: "time",
|
|
965
|
-
header: () =>
|
|
965
|
+
header: () => k("inventory.closing.history.time"),
|
|
966
966
|
cell: (c) => {
|
|
967
|
-
const
|
|
967
|
+
const p = c.getValue(), A = N(p);
|
|
968
968
|
return new Date(A).toLocaleTimeString();
|
|
969
969
|
}
|
|
970
970
|
},
|
|
971
971
|
{
|
|
972
972
|
accessorKey: "remark",
|
|
973
|
-
header: () =>
|
|
973
|
+
header: () => k("inventory.closing.history.createdFrom"),
|
|
974
974
|
cell: (c) => c.getValue() || "-"
|
|
975
975
|
}
|
|
976
976
|
];
|
|
@@ -992,27 +992,27 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
992
992
|
E.value = !0;
|
|
993
993
|
try {
|
|
994
994
|
const c = await V.getLastNStockSnapshots(30);
|
|
995
|
-
|
|
995
|
+
C.value = c;
|
|
996
996
|
} catch (c) {
|
|
997
|
-
console.error("Error fetching stock snapshots:", c),
|
|
997
|
+
console.error("Error fetching stock snapshots:", c), C.value = [];
|
|
998
998
|
} finally {
|
|
999
999
|
E.value = !1;
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
1002
|
}
|
|
1003
1003
|
function r(c) {
|
|
1004
|
-
|
|
1004
|
+
i.value = "closing", $.value = c, l.value = !0;
|
|
1005
1005
|
}
|
|
1006
1006
|
function e(c) {
|
|
1007
|
-
|
|
1007
|
+
i.value = "snapshot", $.value = c, l.value = !0;
|
|
1008
1008
|
}
|
|
1009
1009
|
return K.watchLocation(async () => {
|
|
1010
1010
|
K.currentLocationDBName && (await G(), await J());
|
|
1011
|
-
}), (c,
|
|
1012
|
-
const A =
|
|
1011
|
+
}), (c, p) => {
|
|
1012
|
+
const A = w("FmTabs"), P = w("FmTable"), u = w("FmDatePicker"), f = w("FmButton"), le = w("FmDialog");
|
|
1013
1013
|
return n(), z(ge, {
|
|
1014
1014
|
actions: U.value,
|
|
1015
|
-
title:
|
|
1015
|
+
title: s(k)("inventory.closing.history.title"),
|
|
1016
1016
|
"onClick:action": Y
|
|
1017
1017
|
}, {
|
|
1018
1018
|
default: R(() => [
|
|
@@ -1022,78 +1022,78 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
1022
1022
|
"hide-filter-options": !0
|
|
1023
1023
|
}),
|
|
1024
1024
|
_(A, {
|
|
1025
|
-
"model-value":
|
|
1026
|
-
"onUpdate:modelValue":
|
|
1027
|
-
items:
|
|
1028
|
-
}, null, 8, ["model-value"]),
|
|
1029
|
-
|
|
1030
|
-
|
|
1025
|
+
"model-value": x.value,
|
|
1026
|
+
"onUpdate:modelValue": p[0] || (p[0] = (L) => x.value = L),
|
|
1027
|
+
items: S.value
|
|
1028
|
+
}, null, 8, ["model-value", "items"]),
|
|
1029
|
+
x.value === "closings" ? (n(), y(Q, { key: 0 }, [
|
|
1030
|
+
o("div", Yt, a(s(k)("inventory.closing.history.closingsDescription")), 1),
|
|
1031
1031
|
_(P, {
|
|
1032
1032
|
loading: m.value,
|
|
1033
1033
|
"row-data": v.value,
|
|
1034
1034
|
"column-defs": oe,
|
|
1035
|
-
onRowClick:
|
|
1035
|
+
onRowClick: p[1] || (p[1] = (L) => r(L.original))
|
|
1036
1036
|
}, null, 8, ["loading", "row-data"])
|
|
1037
1037
|
], 64)) : b("", !0),
|
|
1038
|
-
|
|
1039
|
-
|
|
1038
|
+
x.value === "snapshots" ? (n(), y(Q, { key: 1 }, [
|
|
1039
|
+
o("div", Gt, a(s(k)("inventory.closing.history.snapshotsDescription")), 1),
|
|
1040
1040
|
_(P, {
|
|
1041
1041
|
loading: E.value,
|
|
1042
|
-
"row-data":
|
|
1042
|
+
"row-data": C.value,
|
|
1043
1043
|
"column-defs": Z,
|
|
1044
|
-
onRowClick:
|
|
1044
|
+
onRowClick: p[2] || (p[2] = (L) => e(L.original))
|
|
1045
1045
|
}, null, 8, ["loading", "row-data"])
|
|
1046
1046
|
], 64)) : b("", !0)
|
|
1047
1047
|
]),
|
|
1048
|
-
(n(), z(
|
|
1048
|
+
(n(), z(pe, { to: "body" }, [
|
|
1049
1049
|
_(tt, {
|
|
1050
1050
|
"show-button": !1,
|
|
1051
1051
|
ref_key: "recalculationDialogRef",
|
|
1052
1052
|
ref: W,
|
|
1053
|
-
onSubmitted:
|
|
1053
|
+
onSubmitted: p[3] || (p[3] = (L) => G())
|
|
1054
1054
|
}, null, 512),
|
|
1055
|
-
_(
|
|
1055
|
+
_(Tt, {
|
|
1056
1056
|
"show-button": !1,
|
|
1057
1057
|
ref_key: "snapshotRecalculationDialogRef",
|
|
1058
1058
|
ref: H,
|
|
1059
|
-
onSubmitted:
|
|
1059
|
+
onSubmitted: p[4] || (p[4] = (L) => J())
|
|
1060
1060
|
}, null, 512),
|
|
1061
1061
|
_(zt, {
|
|
1062
1062
|
modelValue: l.value,
|
|
1063
|
-
"onUpdate:modelValue":
|
|
1064
|
-
type:
|
|
1065
|
-
data:
|
|
1063
|
+
"onUpdate:modelValue": p[5] || (p[5] = (L) => l.value = L),
|
|
1064
|
+
type: i.value,
|
|
1065
|
+
data: $.value
|
|
1066
1066
|
}, null, 8, ["modelValue", "type", "data"]),
|
|
1067
1067
|
_(le, {
|
|
1068
1068
|
modelValue: M.value,
|
|
1069
|
-
"onUpdate:modelValue":
|
|
1069
|
+
"onUpdate:modelValue": p[8] || (p[8] = (L) => M.value = L),
|
|
1070
1070
|
"close-button": "",
|
|
1071
1071
|
dismissAway: "",
|
|
1072
1072
|
"max-width": "400px"
|
|
1073
1073
|
}, {
|
|
1074
|
-
"dialog-header": R(() =>
|
|
1074
|
+
"dialog-header": R(() => p[9] || (p[9] = [
|
|
1075
1075
|
o("div", { class: "fm-typo-en-heading-lg-600" }, "Initiate Stock Snapshot", -1)
|
|
1076
1076
|
])),
|
|
1077
1077
|
default: R(() => [
|
|
1078
|
-
o("div",
|
|
1079
|
-
|
|
1078
|
+
o("div", Jt, [
|
|
1079
|
+
o("div", Qt, a(s(k)("inventory.closing.history.snapshotsDescription")), 1),
|
|
1080
1080
|
_(u, {
|
|
1081
|
-
modelValue:
|
|
1082
|
-
"onUpdate:modelValue":
|
|
1081
|
+
modelValue: T.value,
|
|
1082
|
+
"onUpdate:modelValue": p[6] || (p[6] = (L) => T.value = L),
|
|
1083
1083
|
label: "Snapshot Date",
|
|
1084
|
-
max:
|
|
1084
|
+
max: s(X)
|
|
1085
1085
|
}, null, 8, ["modelValue", "max"])
|
|
1086
1086
|
])
|
|
1087
1087
|
]),
|
|
1088
1088
|
"dialog-footer": R(() => [
|
|
1089
|
-
o("div",
|
|
1090
|
-
_(
|
|
1089
|
+
o("div", Xt, [
|
|
1090
|
+
_(f, {
|
|
1091
1091
|
variant: "tertiary",
|
|
1092
|
-
onClick:
|
|
1092
|
+
onClick: p[7] || (p[7] = (L) => M.value = !1),
|
|
1093
1093
|
label: "Cancel",
|
|
1094
1094
|
disabled: j.value
|
|
1095
1095
|
}, null, 8, ["disabled"]),
|
|
1096
|
-
_(
|
|
1096
|
+
_(f, {
|
|
1097
1097
|
variant: "primary",
|
|
1098
1098
|
onClick: te,
|
|
1099
1099
|
label: "Confirm",
|
|
@@ -1111,5 +1111,5 @@ const Se = { class: "fm-typo-en-heading-lg-600" }, Ve = { class: "flex flex-col
|
|
|
1111
1111
|
}
|
|
1112
1112
|
});
|
|
1113
1113
|
export {
|
|
1114
|
-
|
|
1114
|
+
co as default
|
|
1115
1115
|
};
|