@feedmepos/mf-inventory-portal 0.0.25-dev.37 → 0.0.25-dev.39
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-C0_9-oDP.js → App-B7L9LuKI.js} +2 -2
- package/dist/{ApprovalView-BDUbQAH0.js → ApprovalView-P7uUdpuJ.js} +2 -2
- package/dist/{BindingsDialog-BvKDyWAP.js → BindingsDialog-E4j9FuOl.js} +2 -2
- package/dist/{BindingsPicker-zAexcP3H.js → BindingsPicker-3mrWImf-.js} +1 -1
- package/dist/{BindingsTable-6dPndhbk.js → BindingsTable-DMoC7BEJ.js} +1 -1
- package/dist/{ClosingDraftView-NwwxcHA-.js → ClosingDraftView-hUFOQ9pI.js} +241 -237
- package/dist/{ClosingTemplateView-Cfh0BZXH.js → ClosingTemplateView-DGG2zD13.js} +2 -2
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DKxW0e2c.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BjYwi7Vb.js} +3 -3
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CD0p0eOE.js → FmUnitInput.vue_vue_type_script_setup_true_lang-B7CfRiCR.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-eGofs51J.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DH5ud0qJ.js} +1 -1
- package/dist/{IngredientGroupView-Cz4zcWgF.js → IngredientGroupView-D63u-gSo.js} +1 -1
- package/dist/{IngredientsView-Ctmor1Ds.js → IngredientsView-DzzIoie9.js} +115 -106
- package/dist/{IntegrationView-DYV2ISmc.js → IntegrationView-SO7nVoSn.js} +1 -1
- package/dist/{InventoryBindingForm-Be75Cpzd.js → InventoryBindingForm-CNBLyKuy.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-D8dK7h0Z.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-gcdA5y3h.js} +3 -3
- package/dist/{InventoryBindingSummary-Cw1Woc3L.js → InventoryBindingSummary-Cx5doszw.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BhKk5nMz.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-uBLwHGx6.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DECtXs-3.js → PremiumBadge.vue_vue_type_script_setup_true_lang-U-MNov1N.js} +1 -1
- package/dist/{PublishView-D9mnP1d8.js → PublishView-C7-F5H_l.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-2DOgQczG.js → PurchaseOrderPrintPreview-Cn1MGNQG.js} +1 -1
- package/dist/ReceiveRequestView-1ltlDUjA.js +2577 -0
- package/dist/{RecipeView-DTwkk7M_.js → RecipeView-CFEr9txv.js} +3 -3
- package/dist/{StockView-cd047f5L.js → StockView-BCuZoG8u.js} +7 -7
- package/dist/{SupplierView-CkYiC3sV.js → SupplierView-BFZYyzZE.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CE3vSlpG.js → TransferDetails.vue_vue_type_script_setup_true_lang-XKOcF4q9.js} +19 -20
- package/dist/TransferTemplateView-DAcRo6jQ.js +1526 -0
- package/dist/{UnitView-C-1I-kVv.js → UnitView-IzqKR_Ue.js} +3 -3
- package/dist/{WarehouseView-CJTtNzco.js → WarehouseView-D_lYd_zi.js} +1 -1
- package/dist/api/stock.d.ts +1 -0
- package/dist/{app-C720GM9g.js → app-D8JtDgcD.js} +1660 -1659
- package/dist/app.js +1 -1
- package/dist/{decimal-BCdHyq3s.js → decimal-BzA7nhoj.js} +1 -1
- package/dist/{feature-Df0TfAlQ.js → feature-DZpzqRzb.js} +1 -1
- package/dist/{format-unit-display-DhVGfJ3A.js → format-unit-display-gJA_tWyb.js} +2 -2
- package/dist/{index-BcO0U3XD.js → index-4_4oJqYY.js} +2 -2
- package/dist/{stock-AgQ9Kd12.js → stock-Cw4_XPhT.js} +29 -25
- package/dist/{supplier-y6wN-U1P.js → supplier-FQRxjLKh.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-DedAlRiZ.js → use-ingredient-select-dialog-CxxnIrMR.js} +1 -1
- package/dist/{use-inventory-binding-dialog-D6ESCCxB.js → use-inventory-binding-dialog-C9t7UpkK.js} +1 -1
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +3 -2
- package/dist/{vue-i18n-C4yPgaCz.js → vue-i18n-UenefCe4.js} +321 -321
- package/package.json +3 -3
- package/dist/ReceiveRequestView-Ss803mII.js +0 -2547
- package/dist/TransferTemplateView-C6-6Db2r.js +0 -1524
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as ke, ref as V, resolveComponent as
|
|
2
|
-
import { W as
|
|
3
|
-
import { useCoreStore as ut, useI18n as
|
|
1
|
+
import { defineComponent as ke, ref as V, resolveComponent as E, openBlock as x, createBlock as J, withCtx as Y, createElementVNode as o, createTextVNode as De, toDisplayString as z, unref as g, createVNode as _, h as k, reactive as Ve, computed as H, onMounted as Ye, watch as Ke, isRef as Te, createElementBlock as $, Fragment as W, createCommentVNode as ne, normalizeClass as me, renderList as ve, normalizeStyle as Re, Teleport as Ge, mergeProps as We } from "vue";
|
|
2
|
+
import { W as qe, u as we, aj as q, l as Ze, J as Ce, i as P, t as Je, K as ye, p as Qe, q as Xe, r as et, ak as Me, al as Pe, a6 as Ie, am as tt, an as le, ac as at, ai as oe, T as Ue, D as Fe, h as xe, f as nt, e as ot, a as st, y as rt, _ as lt, z as ct, B as it, E as he } from "./app-D8JtDgcD.js";
|
|
3
|
+
import { useCoreStore as ut, useI18n as Ee } from "@feedmepos/mf-common";
|
|
4
4
|
import { useSnackbar as je, useDialog as dt, useProxiedModel as mt, components as de, useBreakpoints as ft } from "@feedmepos/ui-library";
|
|
5
|
-
import { defineStore as
|
|
6
|
-
import { u as
|
|
7
|
-
import { E as
|
|
8
|
-
const Se =
|
|
5
|
+
import { defineStore as He, storeToRefs as pt } from "pinia";
|
|
6
|
+
import { u as Le, a as vt } from "./stock-Cw4_XPhT.js";
|
|
7
|
+
import { E as yt } from "./empty-placeholder-wf6-BWE8.js";
|
|
8
|
+
const Se = qe((n, r) => {
|
|
9
9
|
function e() {
|
|
10
10
|
return we().currentLocation.dbName;
|
|
11
11
|
}
|
|
@@ -27,7 +27,7 @@ const Se = Ze((n, r) => {
|
|
|
27
27
|
return r.post(b, i);
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
}),
|
|
30
|
+
}), gt = { class: "fm-typo-en-body-lg-400" }, bt = { class: "fm-typo-en-body-lg-600" }, xt = { class: "flex gap-12 py-8 justify-end w-full" }, $e = /* @__PURE__ */ ke({
|
|
31
31
|
__name: "ClosingDraftAction",
|
|
32
32
|
props: {
|
|
33
33
|
draft: {},
|
|
@@ -63,32 +63,32 @@ const Se = Ze((n, r) => {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return (D, l) => {
|
|
66
|
-
const
|
|
67
|
-
return x(), J(
|
|
66
|
+
const T = E("FmTextField"), R = E("FmButton"), I = E("FmForm");
|
|
67
|
+
return x(), J(I, {
|
|
68
68
|
onValidationSuccess: h,
|
|
69
69
|
class: "flex flex-col gap-32",
|
|
70
70
|
disabled: b.value
|
|
71
71
|
}, {
|
|
72
72
|
default: Y(() => [
|
|
73
|
-
o("div",
|
|
73
|
+
o("div", gt, [
|
|
74
74
|
l[2] || (l[2] = De(" You are about to ")),
|
|
75
|
-
o("span",
|
|
75
|
+
o("span", bt, z(D.action == g(q).enum.approveDraft ? "approve" : "reject"), 1),
|
|
76
76
|
l[3] || (l[3] = De(" this draft. Please provider a remark to justify this action. "))
|
|
77
77
|
]),
|
|
78
|
-
_(
|
|
78
|
+
_(T, {
|
|
79
79
|
modelValue: e.value,
|
|
80
80
|
"onUpdate:modelValue": l[0] || (l[0] = (s) => e.value = s),
|
|
81
81
|
label: "Remark",
|
|
82
82
|
"label-mark": "required",
|
|
83
|
-
rules: [g(
|
|
83
|
+
rules: [g(Ze)()]
|
|
84
84
|
}, null, 8, ["modelValue", "rules"]),
|
|
85
|
-
o("div",
|
|
86
|
-
_(
|
|
85
|
+
o("div", xt, [
|
|
86
|
+
_(R, {
|
|
87
87
|
label: "Cancel",
|
|
88
88
|
variant: "tertiary",
|
|
89
89
|
onClick: l[1] || (l[1] = (s) => D.onCancel())
|
|
90
90
|
}),
|
|
91
|
-
_(
|
|
91
|
+
_(R, {
|
|
92
92
|
label: D.action == g(q).enum.approveDraft ? "Approve" : "Reject",
|
|
93
93
|
type: "submit",
|
|
94
94
|
variant: D.action == g(q).enum.approveDraft ? "primary" : "destructive",
|
|
@@ -100,43 +100,43 @@ const Se = Ze((n, r) => {
|
|
|
100
100
|
}, 8, ["disabled"]);
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
}),
|
|
104
|
-
function
|
|
103
|
+
}), ht = ye(0);
|
|
104
|
+
function ze(n) {
|
|
105
105
|
const r = n.measurementsAmounts.groupBy((i) => i.measurement.id), e = n.sku.unit.measurements.reduce((i, u) => {
|
|
106
106
|
var D, l;
|
|
107
|
-
const b = ((l = (D = r.get(u.id)) == null ? void 0 : D[0]) == null ? void 0 : l.amount) ??
|
|
108
|
-
return i + +
|
|
109
|
-
}, +
|
|
110
|
-
return
|
|
107
|
+
const b = ((l = (D = r.get(u.id)) == null ? void 0 : D[0]) == null ? void 0 : l.amount) ?? ht, h = Ce(u.conversion, b);
|
|
108
|
+
return i + +P(h);
|
|
109
|
+
}, +P(n.baseAmount));
|
|
110
|
+
return Je(e, n.baseAmount.precision);
|
|
111
111
|
}
|
|
112
|
-
const
|
|
113
|
-
function
|
|
114
|
-
const i =
|
|
112
|
+
const At = ye(0), _t = ye(100);
|
|
113
|
+
function Dt(n, r, e) {
|
|
114
|
+
const i = ze(n), u = Me(i, r), b = r.amount === 0 ? null : Pe(u, {
|
|
115
115
|
...r,
|
|
116
116
|
amount: Math.abs(r.amount)
|
|
117
|
-
}), h = b ? Ce(b,
|
|
117
|
+
}), h = b ? Ce(b, _t) : null;
|
|
118
118
|
return {
|
|
119
119
|
code: n.sku.code,
|
|
120
120
|
name: n.sku.name,
|
|
121
121
|
baseUnit: n.sku.unit.abbrev,
|
|
122
|
-
baseUnitAmount: +
|
|
122
|
+
baseUnitAmount: +P(n.baseAmount),
|
|
123
123
|
...n.measurementsAmounts.filter(
|
|
124
|
-
(l) =>
|
|
124
|
+
(l) => kt(l.measurement) && e.includes(l.measurement.id)
|
|
125
125
|
).reduce(
|
|
126
|
-
(l,
|
|
126
|
+
(l, T, R) => (l[`measurementAbbrev${R}`] = `(${T.measurement.abbrev}) × ${P(T.measurement.conversion)}`, l[`measurementAmount${R}`] = +P(T.amount), l),
|
|
127
127
|
{}
|
|
128
128
|
),
|
|
129
|
-
systemBalance: +
|
|
130
|
-
physicalBalance: +
|
|
131
|
-
adjustedAmount: +
|
|
132
|
-
adjustedDiffPercentage: h ? +
|
|
129
|
+
systemBalance: +P(r),
|
|
130
|
+
physicalBalance: +P(i),
|
|
131
|
+
adjustedAmount: +P(u),
|
|
132
|
+
adjustedDiffPercentage: h ? +P(Ie(h, 2)) : null
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function kt(n) {
|
|
136
136
|
return !n.abbrev.toLocaleLowerCase().includes("inactive");
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
const r =
|
|
138
|
+
function wt(n) {
|
|
139
|
+
const r = Ne(n);
|
|
140
140
|
return n.reduce(
|
|
141
141
|
(e, i) => {
|
|
142
142
|
var u;
|
|
@@ -145,13 +145,13 @@ function kt(n) {
|
|
|
145
145
|
0
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function Ne(n) {
|
|
149
149
|
return n.groupBy(
|
|
150
150
|
(r) => r.sku._id,
|
|
151
151
|
(r) => r.measurementsAmounts.filter((e) => !e.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((e) => e.measurement.id)
|
|
152
152
|
);
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function Ct(n) {
|
|
155
155
|
return [
|
|
156
156
|
{
|
|
157
157
|
id: "code",
|
|
@@ -197,54 +197,54 @@ function wt(n) {
|
|
|
197
197
|
])
|
|
198
198
|
];
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
var
|
|
200
|
+
function jt(n, r) {
|
|
201
|
+
var S, y, v, B, N, C, U;
|
|
202
202
|
const e = r.groupBy(
|
|
203
|
-
(
|
|
204
|
-
(
|
|
205
|
-
), i = [...n.items, ...n.negativeStockItems ?? []], u =
|
|
203
|
+
(M) => M.id,
|
|
204
|
+
(M) => M.balance
|
|
205
|
+
), i = [...n.items, ...n.negativeStockItems ?? []], u = Ne(i), b = i.map((M) => {
|
|
206
206
|
var K, se;
|
|
207
|
-
const Q = ((K = e.get(
|
|
208
|
-
return
|
|
209
|
-
}), h =
|
|
207
|
+
const Q = ((K = e.get(M.sku._id)) == null ? void 0 : K[0]) ?? At, X = ((se = u == null ? void 0 : u.get(M.sku._id)) == null ? void 0 : se[0]) ?? [];
|
|
208
|
+
return Dt(M, Q, X);
|
|
209
|
+
}), h = wt(i), l = ut().currentBusiness.value, T = Ct(h), R = [
|
|
210
210
|
["Business name:", l == null ? void 0 : l.name],
|
|
211
211
|
["Business ID:", l == null ? void 0 : l._id],
|
|
212
212
|
["Menu version", l == null ? void 0 : l.menuVersion],
|
|
213
213
|
["Created at", new Date(n.createdAt)],
|
|
214
|
-
["Created by", (
|
|
214
|
+
["Created by", (S = n.createdBy) == null ? void 0 : S.name],
|
|
215
215
|
["Updated at", new Date(n.updatedAt)],
|
|
216
216
|
["Updated by", (y = n.updatedBy) == null ? void 0 : y.name],
|
|
217
217
|
["Recent action", n.approvedAt ? "Approve" : n.rejectionHistory ? "Reject" : ""],
|
|
218
218
|
[
|
|
219
219
|
"Action by",
|
|
220
|
-
n.approvedAt ? (v = n.approvedBy) == null ? void 0 : v.name : n.rejectionHistory ? (N = (
|
|
220
|
+
n.approvedAt ? (v = n.approvedBy) == null ? void 0 : v.name : n.rejectionHistory ? (N = (B = n.rejectionHistory[0]) == null ? void 0 : B.rejectedBy) == null ? void 0 : N.name : ""
|
|
221
221
|
],
|
|
222
222
|
[
|
|
223
223
|
"Action at",
|
|
224
|
-
n.approvedAt ? new Date(n.approvedAt) : n.rejectionHistory ? new Date((
|
|
224
|
+
n.approvedAt ? new Date(n.approvedAt) : n.rejectionHistory ? new Date((C = n.rejectionHistory[0]) == null ? void 0 : C.rejectedAt) : ""
|
|
225
225
|
],
|
|
226
226
|
[
|
|
227
227
|
"Action remark",
|
|
228
|
-
n.approvedAt ? n.approveRemark : n.rejectionHistory ? new Date((
|
|
228
|
+
n.approvedAt ? n.approveRemark : n.rejectionHistory ? new Date((U = n.rejectionHistory[0]) == null ? void 0 : U.rejectRemark) : ""
|
|
229
229
|
],
|
|
230
230
|
[],
|
|
231
|
-
|
|
232
|
-
...b.map((
|
|
233
|
-
],
|
|
234
|
-
return
|
|
231
|
+
T.map((M) => M.name),
|
|
232
|
+
...b.map((M) => T.map((Q) => M[Q.id]))
|
|
233
|
+
], I = T.map((M) => `system:${M.id}`), s = Qe(R, I), p = `[${l == null ? void 0 : l.name}] closing draft (${Xe(new Date(n.updatedAt))}).xlsx`;
|
|
234
|
+
return et(s, p), p;
|
|
235
235
|
}
|
|
236
|
-
const _e =
|
|
236
|
+
const _e = He(
|
|
237
237
|
"closingDraftActions",
|
|
238
238
|
function() {
|
|
239
|
-
const r = dt(), e = je(), i =
|
|
239
|
+
const r = dt(), e = je(), i = tt(), u = Se(), b = Le(), h = V(!1), D = V();
|
|
240
240
|
function l(y) {
|
|
241
241
|
const v = {
|
|
242
242
|
draft: y
|
|
243
243
|
};
|
|
244
244
|
D.value = v, h.value = !0;
|
|
245
245
|
}
|
|
246
|
-
async function
|
|
247
|
-
var
|
|
246
|
+
async function T(y) {
|
|
247
|
+
var B;
|
|
248
248
|
if (y.status === le.enum.COMPLETED) {
|
|
249
249
|
const N = y.closingId;
|
|
250
250
|
if (!N)
|
|
@@ -255,18 +255,18 @@ const _e = Le(
|
|
|
255
255
|
}), console.error("Closing draft is completed but closing document cannot be found.", {
|
|
256
256
|
draftId: y == null ? void 0 : y._id
|
|
257
257
|
}), [];
|
|
258
|
-
const
|
|
259
|
-
return (
|
|
258
|
+
const C = await i.getClosingById(N);
|
|
259
|
+
return (C == null ? void 0 : C.skus) ?? [];
|
|
260
260
|
} else
|
|
261
|
-
return await b.readStockBalance(), ((
|
|
261
|
+
return await b.readStockBalance(), ((B = b.stockBalance) == null ? void 0 : B.skus) ?? [];
|
|
262
262
|
}
|
|
263
|
-
async function
|
|
263
|
+
async function R(y, v) {
|
|
264
264
|
v || (e.open({
|
|
265
265
|
title: "Exporting",
|
|
266
266
|
message: "Fetching data..."
|
|
267
|
-
}), v = await
|
|
267
|
+
}), v = await T(y)), jt(y, v);
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function I(y, v) {
|
|
270
270
|
r.open({
|
|
271
271
|
title: "Approve draft",
|
|
272
272
|
contentComponent: $e,
|
|
@@ -308,16 +308,16 @@ const _e = Le(
|
|
|
308
308
|
type: "success"
|
|
309
309
|
}), v == null || v();
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function S() {
|
|
312
312
|
h.value = !1;
|
|
313
313
|
}
|
|
314
314
|
return {
|
|
315
315
|
viewDraft: l,
|
|
316
|
-
closeDraftDialog:
|
|
317
|
-
approveDraft:
|
|
316
|
+
closeDraftDialog: S,
|
|
317
|
+
approveDraft: I,
|
|
318
318
|
rejectDraft: s,
|
|
319
319
|
syncDraft: p,
|
|
320
|
-
exportDraft:
|
|
320
|
+
exportDraft: R,
|
|
321
321
|
viewClosingDraftShow: h,
|
|
322
322
|
viewClosingDraftProps: D
|
|
323
323
|
};
|
|
@@ -335,10 +335,10 @@ function Ae(n) {
|
|
|
335
335
|
return "fm-status-badge-complete";
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
const
|
|
338
|
+
const St = He(
|
|
339
339
|
"closingDraftTable",
|
|
340
340
|
function() {
|
|
341
|
-
const { t: r } =
|
|
341
|
+
const { t: r } = Ee(), e = _e(), i = V(new Array()), u = V(!1), b = we(), h = Se();
|
|
342
342
|
async function D() {
|
|
343
343
|
if (i.value = [], !!b._currentLocation) {
|
|
344
344
|
u.value = !0;
|
|
@@ -358,7 +358,7 @@ const jt = Le(
|
|
|
358
358
|
try {
|
|
359
359
|
const [p] = await Promise.all([
|
|
360
360
|
h.getDraft(s),
|
|
361
|
-
new Promise((
|
|
361
|
+
new Promise((S) => setTimeout(S, 1e3))
|
|
362
362
|
]);
|
|
363
363
|
i.value = [p];
|
|
364
364
|
} catch (p) {
|
|
@@ -368,19 +368,19 @@ const jt = Le(
|
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
function
|
|
371
|
+
function T() {
|
|
372
372
|
e.closeDraftDialog(), D();
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function R(s, p) {
|
|
375
375
|
switch (p = ot(p), s) {
|
|
376
376
|
case xe.Details:
|
|
377
377
|
return e.viewDraft(p);
|
|
378
378
|
case xe.Export:
|
|
379
379
|
return e.exportDraft(p);
|
|
380
380
|
case q.enum.approveDraft:
|
|
381
|
-
return e.approveDraft(p,
|
|
381
|
+
return e.approveDraft(p, T);
|
|
382
382
|
case q.enum.rejectDraft:
|
|
383
|
-
return e.rejectDraft(p,
|
|
383
|
+
return e.rejectDraft(p, T);
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
return {
|
|
@@ -425,7 +425,7 @@ const jt = Le(
|
|
|
425
425
|
id: "recentRemark",
|
|
426
426
|
accessorFn: (s) => {
|
|
427
427
|
var p;
|
|
428
|
-
return (s == null ? void 0 : s.approveRemark) ?? ((p = s == null ? void 0 : s.rejectionHistory) == null ? void 0 : p.computeFirst((
|
|
428
|
+
return (s == null ? void 0 : s.approveRemark) ?? ((p = s == null ? void 0 : s.rejectionHistory) == null ? void 0 : p.computeFirst((S) => S.rejectRemark)) ?? s.remark;
|
|
429
429
|
},
|
|
430
430
|
header: () => "Recent remark"
|
|
431
431
|
},
|
|
@@ -436,8 +436,8 @@ const jt = Le(
|
|
|
436
436
|
enableSorting: !1,
|
|
437
437
|
cell(s) {
|
|
438
438
|
var N;
|
|
439
|
-
const p = s.row.original,
|
|
440
|
-
return
|
|
439
|
+
const p = s.row.original, S = p.status, y = new Date(p.updatedAt), v = (N = p == null ? void 0 : p.rejectionHistory) == null ? void 0 : N.computeFirst((C) => C.rejectedAt), B = v ? new Date(v) : null;
|
|
440
|
+
return S === "DRAFT" && B ? B.getTime() > y.getTime() ? k(
|
|
441
441
|
"div",
|
|
442
442
|
{
|
|
443
443
|
class: "flex"
|
|
@@ -469,9 +469,9 @@ const jt = Le(
|
|
|
469
469
|
k(
|
|
470
470
|
"div",
|
|
471
471
|
{
|
|
472
|
-
class: ["fm-status-badge", Ae(
|
|
472
|
+
class: ["fm-status-badge", Ae(S)]
|
|
473
473
|
},
|
|
474
|
-
|
|
474
|
+
Ue(S)
|
|
475
475
|
)
|
|
476
476
|
);
|
|
477
477
|
}
|
|
@@ -479,7 +479,7 @@ const jt = Le(
|
|
|
479
479
|
{
|
|
480
480
|
id: "action",
|
|
481
481
|
cell(s) {
|
|
482
|
-
const p = s.row.original,
|
|
482
|
+
const p = s.row.original, S = [
|
|
483
483
|
Fe[xe.Details],
|
|
484
484
|
Fe[xe.Export]
|
|
485
485
|
], y = [
|
|
@@ -496,10 +496,10 @@ const jt = Le(
|
|
|
496
496
|
];
|
|
497
497
|
return nt(
|
|
498
498
|
[
|
|
499
|
-
...
|
|
499
|
+
...S,
|
|
500
500
|
...p.status === le.enum.DRAFT ? y : []
|
|
501
501
|
],
|
|
502
|
-
(v) =>
|
|
502
|
+
(v) => R(v, p)
|
|
503
503
|
);
|
|
504
504
|
},
|
|
505
505
|
enableSorting: !1,
|
|
@@ -516,34 +516,34 @@ const jt = Le(
|
|
|
516
516
|
loadDraft: l
|
|
517
517
|
};
|
|
518
518
|
}
|
|
519
|
-
),
|
|
519
|
+
), Bt = { class: "w-full flex flex-col gap-32" }, Ft = { class: "flex justify-between" }, $t = { class: "flex" }, Tt = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, Rt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mt = { class: "flex gap-1" }, Pt = { class: "fm-typo-en-body-lg-600" }, It = { class: "flex flex-col gap-16" }, Ut = { class: "flex items-center" }, Et = { key: 0 }, Ht = {
|
|
520
520
|
key: 0,
|
|
521
521
|
class: "w-full flex flex-col items-center"
|
|
522
|
-
},
|
|
522
|
+
}, Lt = { class: "flex items-center gap-8" }, zt = {
|
|
523
523
|
key: 0,
|
|
524
524
|
class: "flex gap-8"
|
|
525
|
-
},
|
|
525
|
+
}, Nt = { class: "overflow-x-auto" }, Ot = {
|
|
526
526
|
key: 1,
|
|
527
527
|
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
528
|
-
},
|
|
528
|
+
}, Vt = {
|
|
529
529
|
key: 0,
|
|
530
530
|
class: "flex flex-col items-center gap-8 h-full"
|
|
531
|
-
},
|
|
531
|
+
}, Yt = ["src"], Kt = {
|
|
532
532
|
key: 1,
|
|
533
533
|
class: "px-4 flex flex-col"
|
|
534
|
-
},
|
|
534
|
+
}, Gt = { class: "flex gap-12 content-stretch" }, Wt = {
|
|
535
535
|
class: "flex flex-col w-24",
|
|
536
536
|
name: "circles"
|
|
537
|
-
},
|
|
537
|
+
}, qt = { class: "flex-1 flex flex-col items-center" }, Zt = { class: "flex-1 flex flex-col items-center" }, Jt = {
|
|
538
538
|
class: "py-12 flex flex-col gap-4",
|
|
539
539
|
name: "received-at header"
|
|
540
|
-
},
|
|
540
|
+
}, Qt = { class: "fm-typo-en-body-lg-400" }, Xt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ea = { class: "flex gap-12 content-stretch" }, ta = {
|
|
541
541
|
class: "flex flex-col w-24",
|
|
542
542
|
name: "circles"
|
|
543
|
-
},
|
|
543
|
+
}, aa = { class: "flex-1 flex flex-col items-center" }, na = {
|
|
544
544
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
545
545
|
name: "delivery details"
|
|
546
|
-
},
|
|
546
|
+
}, oa = { class: "flex flex-col gap-8" }, sa = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ra = { class: "flex flex-col gap-4" }, la = { class: "flex gap-8" }, ca = /* @__PURE__ */ ke({
|
|
547
547
|
__name: "ClosingDraftDialog",
|
|
548
548
|
props: {
|
|
549
549
|
show: { type: Boolean },
|
|
@@ -551,38 +551,38 @@ const jt = Le(
|
|
|
551
551
|
},
|
|
552
552
|
emits: ["submitted"],
|
|
553
553
|
setup(n, { emit: r }) {
|
|
554
|
-
const e = n, i =
|
|
555
|
-
|
|
554
|
+
const e = n, i = Le(), u = _e(), b = mt(e, "show"), h = V(!1), D = V(!1), l = V(new Array()), T = vt(), R = je(), I = st(), s = Ve({}), p = H(() => new Set(
|
|
555
|
+
I.skus.filter((a) => {
|
|
556
556
|
var t;
|
|
557
557
|
return s[(t = a.customAttributes) == null ? void 0 : t.tag];
|
|
558
558
|
}).map((a) => a._id)
|
|
559
|
-
)),
|
|
559
|
+
)), S = r, y = H(() => {
|
|
560
560
|
var t, c;
|
|
561
561
|
const a = [...((t = e.draft) == null ? void 0 : t.items) ?? [], ...((c = e.draft) == null ? void 0 : c.negativeStockItems) ?? []];
|
|
562
562
|
return p.value.size ? a.filter((m) => p.value.has(m.sku._id)) : a;
|
|
563
|
-
}), v =
|
|
563
|
+
}), v = H(() => {
|
|
564
564
|
const a = y.value.map((t) => t.sku);
|
|
565
565
|
return a.sort((t, c) => t.code.localeCompare(c.code)), a;
|
|
566
|
-
}),
|
|
566
|
+
}), B = H(() => y.value.groupBy(
|
|
567
567
|
(t) => t.sku._id,
|
|
568
568
|
(t) => t.measurementsAmounts.filter((c) => !c.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((c) => c.measurement.id)
|
|
569
569
|
));
|
|
570
|
-
|
|
570
|
+
Ye(U), Ke(
|
|
571
571
|
() => e.show,
|
|
572
572
|
(a) => {
|
|
573
|
-
a && (te.value = ee[0],
|
|
573
|
+
a && (te.value = ee[0], U());
|
|
574
574
|
}
|
|
575
575
|
);
|
|
576
|
-
const N = ye(0),
|
|
577
|
-
async function
|
|
576
|
+
const N = ye(0), C = ye(100);
|
|
577
|
+
async function U() {
|
|
578
578
|
var t, c, m;
|
|
579
579
|
h.value = !0;
|
|
580
580
|
const a = ((t = e.draft) == null ? void 0 : t.status) === le.enum.COMPLETED;
|
|
581
581
|
try {
|
|
582
|
-
if (await
|
|
583
|
-
const d = e.draft.
|
|
582
|
+
if (await I.init(), a) {
|
|
583
|
+
const d = e.draft.closingAdjustmentId;
|
|
584
584
|
if (!d) {
|
|
585
|
-
|
|
585
|
+
R.open({
|
|
586
586
|
title: "Something went wrong",
|
|
587
587
|
message: "Closing draft is completed but closing document cannot be found.",
|
|
588
588
|
type: "error"
|
|
@@ -591,12 +591,16 @@ const jt = Le(
|
|
|
591
591
|
});
|
|
592
592
|
return;
|
|
593
593
|
}
|
|
594
|
-
const f = await
|
|
595
|
-
l.value = (
|
|
594
|
+
const f = await T.readAdjustmentById(d), w = (f == null ? void 0 : f.skus) ?? [];
|
|
595
|
+
l.value = w.map((F) => ({
|
|
596
|
+
id: F.sku._id,
|
|
597
|
+
balance: F.fromBalance,
|
|
598
|
+
costs: F.fromCostBalances
|
|
599
|
+
}));
|
|
596
600
|
} else
|
|
597
601
|
await i.readStockBalance(), l.value = ((m = i.stockBalance) == null ? void 0 : m.skus) ?? [];
|
|
598
602
|
} catch (d) {
|
|
599
|
-
|
|
603
|
+
R.open({
|
|
600
604
|
title: "Something went wrong",
|
|
601
605
|
message: "Something went wrong when fetching info. Please try again.",
|
|
602
606
|
type: "error"
|
|
@@ -605,12 +609,12 @@ const jt = Le(
|
|
|
605
609
|
h.value = !1;
|
|
606
610
|
}
|
|
607
611
|
}
|
|
608
|
-
const
|
|
612
|
+
const M = H(
|
|
609
613
|
() => l.value.groupBy(
|
|
610
614
|
(a) => a.id,
|
|
611
615
|
(a) => a.balance
|
|
612
616
|
)
|
|
613
|
-
), Q =
|
|
617
|
+
), Q = H(() => y.value.groupBy((a) => a.sku._id));
|
|
614
618
|
function X(a) {
|
|
615
619
|
return k(
|
|
616
620
|
de.FmTooltip,
|
|
@@ -625,10 +629,10 @@ const jt = Le(
|
|
|
625
629
|
}
|
|
626
630
|
);
|
|
627
631
|
}
|
|
628
|
-
const K =
|
|
632
|
+
const K = H(() => {
|
|
629
633
|
const a = v.value.reduce((c, m) => {
|
|
630
634
|
var d, f;
|
|
631
|
-
return Math.max(c, ((f = (d =
|
|
635
|
+
return Math.max(c, ((f = (d = B.value) == null ? void 0 : d.get(m._id)) == null ? void 0 : f[0].length) ?? 0);
|
|
632
636
|
}, 0);
|
|
633
637
|
return [
|
|
634
638
|
{
|
|
@@ -637,7 +641,7 @@ const jt = Le(
|
|
|
637
641
|
header: () => "Name",
|
|
638
642
|
size: 350,
|
|
639
643
|
cell(c) {
|
|
640
|
-
const m = c.row.original, d = m.adjustedDiffPercentage, f = typeof d == "number" && Math.abs(d) > 10,
|
|
644
|
+
const m = c.row.original, d = m.adjustedDiffPercentage, f = typeof d == "number" && Math.abs(d) > 10, w = k("div", { class: "flex flex-col gap-4" }, [
|
|
641
645
|
k(
|
|
642
646
|
"div",
|
|
643
647
|
{
|
|
@@ -670,7 +674,7 @@ const jt = Le(
|
|
|
670
674
|
},
|
|
671
675
|
default() {
|
|
672
676
|
return k("div", { class: "flex items-center gap-4 justify-start w-full" }, [
|
|
673
|
-
|
|
677
|
+
w
|
|
674
678
|
]);
|
|
675
679
|
}
|
|
676
680
|
}
|
|
@@ -753,7 +757,7 @@ const jt = Le(
|
|
|
753
757
|
header: () => "Amounts",
|
|
754
758
|
enableSorting: !1,
|
|
755
759
|
cell(c) {
|
|
756
|
-
const m = c.row.original, d = (
|
|
760
|
+
const m = c.row.original, d = (w, F) => k(
|
|
757
761
|
de.FmTooltip,
|
|
758
762
|
{ zIndex: 50 },
|
|
759
763
|
{
|
|
@@ -764,29 +768,29 @@ const jt = Le(
|
|
|
764
768
|
class: "fm-typo-en-body-md-400 py-4 px-8 border-1 border-fm-color-typo-secondary fm-corner-radius-md line-clamp-1"
|
|
765
769
|
},
|
|
766
770
|
[
|
|
767
|
-
k("span", { class: "text-fm-color-typo-primary" }, `${
|
|
771
|
+
k("span", { class: "text-fm-color-typo-primary" }, `${w} `),
|
|
768
772
|
k(
|
|
769
773
|
"span",
|
|
770
774
|
{
|
|
771
775
|
class: "text-fm-color-typo-secondary",
|
|
772
776
|
style: { maxWidth: "80px" }
|
|
773
777
|
},
|
|
774
|
-
|
|
778
|
+
F
|
|
775
779
|
)
|
|
776
780
|
]
|
|
777
781
|
);
|
|
778
782
|
},
|
|
779
783
|
content() {
|
|
780
|
-
return `${
|
|
784
|
+
return `${w} ${F}`;
|
|
781
785
|
}
|
|
782
786
|
}
|
|
783
787
|
);
|
|
784
|
-
let f = Array.from({ length: a }).map((
|
|
785
|
-
if (!m[`measurementAmount${
|
|
788
|
+
let f = Array.from({ length: a }).map((w, F) => {
|
|
789
|
+
if (!m[`measurementAmount${F}`])
|
|
786
790
|
return null;
|
|
787
|
-
const
|
|
788
|
-
return d(
|
|
789
|
-
}).filter((
|
|
791
|
+
const j = m[`measurementAmount${F}`], ie = m[`measurementAbbrev${F}`];
|
|
792
|
+
return d(j, ie);
|
|
793
|
+
}).filter((w) => w);
|
|
790
794
|
return (m.baseUnitAmount || !f.length) && (f = [d(m.baseUnitAmount, m.baseUnit), ...f]), k(
|
|
791
795
|
"div",
|
|
792
796
|
{
|
|
@@ -800,39 +804,39 @@ const jt = Le(
|
|
|
800
804
|
}
|
|
801
805
|
}
|
|
802
806
|
];
|
|
803
|
-
}), se =
|
|
804
|
-
var
|
|
805
|
-
const t = (
|
|
807
|
+
}), se = H(() => K.value.map((a) => a.size ?? 0).reduce((a, t) => a + t)), ce = V(""), fe = H(() => v.value.map((a) => {
|
|
808
|
+
var j, ie;
|
|
809
|
+
const t = (j = Q.value.get(a._id)) == null ? void 0 : j[0], c = ((ie = M.value.get(a._id)) == null ? void 0 : ie[0]) ?? N;
|
|
806
810
|
if (!t)
|
|
807
811
|
return {
|
|
808
812
|
code: a.code,
|
|
809
813
|
name: a.name,
|
|
810
814
|
baseUnit: a.unit.abbrev,
|
|
811
815
|
baseUnitAmount: 0,
|
|
812
|
-
systemBalance: +
|
|
816
|
+
systemBalance: +P(c),
|
|
813
817
|
physicalBalance: 0,
|
|
814
|
-
adjustedAmount: -+
|
|
818
|
+
adjustedAmount: -+P(c),
|
|
815
819
|
adjustedDiffPercentage: -100
|
|
816
820
|
};
|
|
817
|
-
const m =
|
|
821
|
+
const m = ze(t), d = Me(m, c), f = c.amount === 0 ? null : Pe(d, {
|
|
818
822
|
...c,
|
|
819
823
|
amount: Math.abs(c.amount)
|
|
820
|
-
}),
|
|
824
|
+
}), w = f ? Ce(f, C) : null;
|
|
821
825
|
return {
|
|
822
826
|
code: a.code,
|
|
823
827
|
name: a.name,
|
|
824
828
|
baseUnit: a.unit.abbrev,
|
|
825
|
-
baseUnitAmount: +
|
|
829
|
+
baseUnitAmount: +P(t.baseAmount),
|
|
826
830
|
...t.measurementsAmounts.filter((ae) => {
|
|
827
831
|
var G, re, be;
|
|
828
|
-
return (be = (re = (G =
|
|
829
|
-
}).reduce((ae, G, re) => (ae[`measurementAbbrev${re}`] = `(${G.measurement.abbrev}) × ${
|
|
830
|
-
systemBalance: +
|
|
831
|
-
physicalBalance: +
|
|
832
|
-
adjustedAmount: +
|
|
833
|
-
adjustedDiffPercentage:
|
|
832
|
+
return (be = (re = (G = B.value) == null ? void 0 : G.get(a._id)) == null ? void 0 : re[0]) == null ? void 0 : be.includes(ae.measurement.id);
|
|
833
|
+
}).reduce((ae, G, re) => (ae[`measurementAbbrev${re}`] = `(${G.measurement.abbrev}) × ${P(G.measurement.conversion)}`, ae[`measurementAmount${re}`] = +P(G.amount), ae), {}),
|
|
834
|
+
systemBalance: +P(c),
|
|
835
|
+
physicalBalance: +P(m),
|
|
836
|
+
adjustedAmount: +P(d),
|
|
837
|
+
adjustedDiffPercentage: w ? +P(Ie(w, 2)) : null
|
|
834
838
|
};
|
|
835
|
-
})), ge =
|
|
839
|
+
})), ge = H(() => {
|
|
836
840
|
var t, c, m;
|
|
837
841
|
if (!e.draft) return [];
|
|
838
842
|
const a = e.draft.approvedAt ? {
|
|
@@ -897,7 +901,7 @@ const jt = Le(
|
|
|
897
901
|
label: "Action history",
|
|
898
902
|
value: "history"
|
|
899
903
|
}
|
|
900
|
-
], te = V(ee[0]), Z =
|
|
904
|
+
], te = V(ee[0]), Z = H(() => {
|
|
901
905
|
var t, c, m, d;
|
|
902
906
|
return [
|
|
903
907
|
...(((t = e.draft) == null ? void 0 : t.rejectionHistory) ?? []).map(
|
|
@@ -933,18 +937,18 @@ const jt = Le(
|
|
|
933
937
|
}
|
|
934
938
|
] : []
|
|
935
939
|
];
|
|
936
|
-
}), pe =
|
|
937
|
-
var d, f,
|
|
940
|
+
}), pe = H(() => {
|
|
941
|
+
var d, f, w, F;
|
|
938
942
|
if ((d = e == null ? void 0 : e.draft) != null && d.approvedAt) return "Draft is already approved.";
|
|
939
943
|
if (((f = e.draft) == null ? void 0 : f.status) !== le.enum.DRAFT) return "Status is not draft.";
|
|
940
|
-
const a = fe.value.some((
|
|
944
|
+
const a = fe.value.some((j) => j.physicalBalance < 0), t = ((F = (w = i.stockBalance.skus) == null ? void 0 : w.filter((j) => j.balance.amount < 0)) == null ? void 0 : F.map((j) => j.id)) ?? [], c = new Set(v.value.map((j) => j._id)), m = t.filter((j) => !c.has(j)).length;
|
|
941
945
|
return [
|
|
942
946
|
a ? "Negative total exist." : null,
|
|
943
947
|
m ? "Negative stock is not included in this draft. Reopen draft in POS and apply changes." : null
|
|
944
|
-
].filter((
|
|
948
|
+
].filter((j) => j).join(" ");
|
|
945
949
|
});
|
|
946
950
|
return (a, t) => {
|
|
947
|
-
const c =
|
|
951
|
+
const c = E("FmButtonGroup"), m = E("FmMenuDivider"), d = E("FmCard"), f = E("FmButton"), w = E("FmCircularProgress"), F = E("FmTextField"), j = E("FmIcon"), ie = E("FmChip"), ae = E("FmTable"), G = E("FmSpacer"), re = E("FmTooltip"), be = E("FmSideSheet");
|
|
948
952
|
return x(), J(be, {
|
|
949
953
|
"dismiss-away": "",
|
|
950
954
|
"max-width": 9999,
|
|
@@ -955,8 +959,8 @@ const jt = Le(
|
|
|
955
959
|
"side-sheet-footer": Y(() => {
|
|
956
960
|
var A, L, O, ue;
|
|
957
961
|
return [
|
|
958
|
-
o("div",
|
|
959
|
-
((A = e.draft) == null ? void 0 : A.status) === g(le).enum.DRAFT ? (x(),
|
|
962
|
+
o("div", la, [
|
|
963
|
+
((A = e.draft) == null ? void 0 : A.status) === g(le).enum.DRAFT ? (x(), $(W, { key: 0 }, [
|
|
960
964
|
pe.value ? (x(), J(re, {
|
|
961
965
|
key: 0,
|
|
962
966
|
"z-index": 51
|
|
@@ -969,21 +973,21 @@ const jt = Le(
|
|
|
969
973
|
disabled: "",
|
|
970
974
|
key: "approve key",
|
|
971
975
|
label: "Approve",
|
|
972
|
-
onClick: t[3] || (t[3] = () => e.draft && g(u).approveDraft(e.draft, () =>
|
|
976
|
+
onClick: t[3] || (t[3] = () => e.draft && g(u).approveDraft(e.draft, () => S("submitted")))
|
|
973
977
|
})
|
|
974
978
|
]),
|
|
975
979
|
_: 1
|
|
976
980
|
})) : (x(), J(f, {
|
|
977
981
|
key: "approve key",
|
|
978
982
|
label: "Approve",
|
|
979
|
-
onClick: t[4] || (t[4] = () => e.draft && g(u).approveDraft(e.draft, () =>
|
|
983
|
+
onClick: t[4] || (t[4] = () => e.draft && g(u).approveDraft(e.draft, () => S("submitted")))
|
|
980
984
|
}))
|
|
981
985
|
], 64)) : ne("", !0),
|
|
982
986
|
((L = e.draft) == null ? void 0 : L.status) === g(le).enum.DRAFT ? (x(), J(f, {
|
|
983
987
|
key: 1,
|
|
984
988
|
label: "Reject",
|
|
985
989
|
variant: "destructive",
|
|
986
|
-
onClick: t[5] || (t[5] = () => e.draft && g(u).rejectDraft(e.draft, () =>
|
|
990
|
+
onClick: t[5] || (t[5] = () => e.draft && g(u).rejectDraft(e.draft, () => S("submitted")))
|
|
987
991
|
})) : ne("", !0),
|
|
988
992
|
(O = e.draft) != null && O.approvedAt && ((ue = e.draft) == null ? void 0 : ue.status) !== g(le).enum.COMPLETED ? (x(), J(f, {
|
|
989
993
|
key: 2,
|
|
@@ -991,7 +995,7 @@ const jt = Le(
|
|
|
991
995
|
loading: D.value,
|
|
992
996
|
onClick: t[6] || (t[6] = () => {
|
|
993
997
|
e.draft && (D.value = !0, g(u).syncDraft(e.draft, () => {
|
|
994
|
-
D.value = !1,
|
|
998
|
+
D.value = !1, S("submitted");
|
|
995
999
|
}));
|
|
996
1000
|
})
|
|
997
1001
|
}, null, 8, ["loading"])) : ne("", !0),
|
|
@@ -1004,7 +1008,7 @@ const jt = Le(
|
|
|
1004
1008
|
];
|
|
1005
1009
|
}),
|
|
1006
1010
|
default: Y(() => [
|
|
1007
|
-
o("div",
|
|
1011
|
+
o("div", Bt, [
|
|
1008
1012
|
o("div", null, [
|
|
1009
1013
|
_(c, {
|
|
1010
1014
|
items: ee,
|
|
@@ -1012,7 +1016,7 @@ const jt = Le(
|
|
|
1012
1016
|
"onUpdate:modelValue": t[0] || (t[0] = (A) => te.value = A)
|
|
1013
1017
|
}, null, 8, ["modelValue"])
|
|
1014
1018
|
]),
|
|
1015
|
-
te.value.value === "overview" ? (x(),
|
|
1019
|
+
te.value.value === "overview" ? (x(), $(W, { key: 0 }, [
|
|
1016
1020
|
_(d, {
|
|
1017
1021
|
variant: "outlined",
|
|
1018
1022
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
@@ -1020,34 +1024,34 @@ const jt = Le(
|
|
|
1020
1024
|
default: Y(() => {
|
|
1021
1025
|
var A, L;
|
|
1022
1026
|
return [
|
|
1023
|
-
o("div",
|
|
1027
|
+
o("div", Ft, [
|
|
1024
1028
|
t[9] || (t[9] = o("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
|
|
1025
|
-
o("div",
|
|
1029
|
+
o("div", $t, [
|
|
1026
1030
|
o("div", {
|
|
1027
1031
|
class: me(["fm-status-badge", g(Ae)(((A = a.draft) == null ? void 0 : A.status) ?? "DRAFT")])
|
|
1028
|
-
}, z(g(
|
|
1032
|
+
}, z(g(Ue)(((L = a.draft) == null ? void 0 : L.status) ?? "")), 3)
|
|
1029
1033
|
])
|
|
1030
1034
|
]),
|
|
1031
1035
|
_(m),
|
|
1032
|
-
o("div",
|
|
1033
|
-
(x(!0),
|
|
1036
|
+
o("div", Tt, [
|
|
1037
|
+
(x(!0), $(W, null, ve(ge.value, (O, ue) => (x(), $("div", {
|
|
1034
1038
|
class: "flex flex-col gap-4",
|
|
1035
1039
|
key: ue
|
|
1036
1040
|
}, [
|
|
1037
|
-
o("div",
|
|
1038
|
-
o("div",
|
|
1041
|
+
o("div", Rt, [
|
|
1042
|
+
o("div", Mt, z(O.label), 1)
|
|
1039
1043
|
]),
|
|
1040
|
-
o("div",
|
|
1044
|
+
o("div", Pt, z(O.value), 1)
|
|
1041
1045
|
]))), 128))
|
|
1042
1046
|
])
|
|
1043
1047
|
];
|
|
1044
1048
|
}),
|
|
1045
1049
|
_: 1
|
|
1046
1050
|
}),
|
|
1047
|
-
o("div",
|
|
1048
|
-
o("div",
|
|
1051
|
+
o("div", It, [
|
|
1052
|
+
o("div", Ut, [
|
|
1049
1053
|
t[10] || (t[10] = o("div", { class: "flex-1 fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Closing items ", -1)),
|
|
1050
|
-
h.value ? ne("", !0) : (x(),
|
|
1054
|
+
h.value ? ne("", !0) : (x(), $("div", Et, [
|
|
1051
1055
|
_(f, {
|
|
1052
1056
|
label: "Export data",
|
|
1053
1057
|
"prepend-icon": "download",
|
|
@@ -1059,25 +1063,25 @@ const jt = Le(
|
|
|
1059
1063
|
})
|
|
1060
1064
|
]))
|
|
1061
1065
|
]),
|
|
1062
|
-
h.value ? (x(),
|
|
1066
|
+
h.value ? (x(), $("div", Ht, [
|
|
1063
1067
|
t[12] || (t[12] = o("div", { class: "h-80" }, null, -1)),
|
|
1064
|
-
o("div",
|
|
1068
|
+
o("div", Lt, [
|
|
1065
1069
|
o("div", null, [
|
|
1066
|
-
_(
|
|
1070
|
+
_(w, { size: "md" })
|
|
1067
1071
|
]),
|
|
1068
1072
|
t[11] || (t[11] = o("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fetching info... ", -1))
|
|
1069
1073
|
]),
|
|
1070
1074
|
t[13] || (t[13] = o("div", { class: "h-80" }, null, -1))
|
|
1071
|
-
])) : (x(),
|
|
1075
|
+
])) : (x(), $(W, { key: 1 }, [
|
|
1072
1076
|
o("div", null, [
|
|
1073
|
-
_(
|
|
1077
|
+
_(F, {
|
|
1074
1078
|
modelValue: ce.value,
|
|
1075
1079
|
"onUpdate:modelValue": t[2] || (t[2] = (A) => ce.value = A),
|
|
1076
1080
|
placeholder: "Filter items"
|
|
1077
1081
|
}, null, 8, ["modelValue"])
|
|
1078
1082
|
]),
|
|
1079
|
-
g(
|
|
1080
|
-
(x(!0),
|
|
1083
|
+
g(I).skuTags.size ? (x(), $("div", zt, [
|
|
1084
|
+
(x(!0), $(W, null, ve(g(I).skuTags.keys(), (A) => (x(), J(ie, {
|
|
1081
1085
|
key: `${A}`,
|
|
1082
1086
|
label: `${A}`,
|
|
1083
1087
|
selectable: "",
|
|
@@ -1085,7 +1089,7 @@ const jt = Le(
|
|
|
1085
1089
|
onClick: (L) => s[`${A}`] = !s[`${A}`]
|
|
1086
1090
|
}, {
|
|
1087
1091
|
default: Y(() => [
|
|
1088
|
-
s[`${A}`] ? (x(), J(
|
|
1092
|
+
s[`${A}`] ? (x(), J(j, {
|
|
1089
1093
|
key: 0,
|
|
1090
1094
|
name: "check",
|
|
1091
1095
|
class: "text-white",
|
|
@@ -1104,7 +1108,7 @@ const jt = Le(
|
|
|
1104
1108
|
_: 2
|
|
1105
1109
|
}, 1032, ["label", "selected", "onClick"]))), 128))
|
|
1106
1110
|
])) : ne("", !0),
|
|
1107
|
-
o("div",
|
|
1111
|
+
o("div", Nt, [
|
|
1108
1112
|
o("div", {
|
|
1109
1113
|
style: Re({ minWidth: `${se.value}px` })
|
|
1110
1114
|
}, [
|
|
@@ -1118,12 +1122,12 @@ const jt = Le(
|
|
|
1118
1122
|
], 64))
|
|
1119
1123
|
])
|
|
1120
1124
|
], 64)) : ne("", !0),
|
|
1121
|
-
te.value.value === "history" ? (x(),
|
|
1122
|
-
Z.value.length ? (x(),
|
|
1123
|
-
(x(!0),
|
|
1124
|
-
o("div",
|
|
1125
|
-
o("div",
|
|
1126
|
-
o("div",
|
|
1125
|
+
te.value.value === "history" ? (x(), $("div", Ot, [
|
|
1126
|
+
Z.value.length ? (x(), $("div", Kt, [
|
|
1127
|
+
(x(!0), $(W, null, ve(Z.value, (A, L) => (x(), $(W, { key: L }, [
|
|
1128
|
+
o("div", Gt, [
|
|
1129
|
+
o("div", Wt, [
|
|
1130
|
+
o("div", qt, [
|
|
1127
1131
|
o("div", {
|
|
1128
1132
|
class: me([
|
|
1129
1133
|
{
|
|
@@ -1135,7 +1139,7 @@ const jt = Le(
|
|
|
1135
1139
|
}, null, 2)
|
|
1136
1140
|
]),
|
|
1137
1141
|
t[16] || (t[16] = o("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
1138
|
-
o("div",
|
|
1142
|
+
o("div", Zt, [
|
|
1139
1143
|
o("div", {
|
|
1140
1144
|
class: me([
|
|
1141
1145
|
{
|
|
@@ -1147,14 +1151,14 @@ const jt = Le(
|
|
|
1147
1151
|
}, null, 2)
|
|
1148
1152
|
])
|
|
1149
1153
|
]),
|
|
1150
|
-
o("div",
|
|
1151
|
-
o("div",
|
|
1152
|
-
o("div",
|
|
1154
|
+
o("div", Jt, [
|
|
1155
|
+
o("div", Qt, z(A.header), 1),
|
|
1156
|
+
o("div", Xt, z(A.date), 1)
|
|
1153
1157
|
])
|
|
1154
1158
|
]),
|
|
1155
|
-
o("div",
|
|
1156
|
-
o("div",
|
|
1157
|
-
o("div",
|
|
1159
|
+
o("div", ea, [
|
|
1160
|
+
o("div", ta, [
|
|
1161
|
+
o("div", aa, [
|
|
1158
1162
|
o("div", {
|
|
1159
1163
|
class: me([
|
|
1160
1164
|
{
|
|
@@ -1166,21 +1170,21 @@ const jt = Le(
|
|
|
1166
1170
|
}, null, 2)
|
|
1167
1171
|
])
|
|
1168
1172
|
]),
|
|
1169
|
-
o("div",
|
|
1173
|
+
o("div", na, [
|
|
1170
1174
|
_(d, {
|
|
1171
1175
|
variant: "outlined",
|
|
1172
1176
|
class: "py-12 px-16"
|
|
1173
1177
|
}, {
|
|
1174
1178
|
default: Y(() => [
|
|
1175
|
-
o("div",
|
|
1176
|
-
(x(!0),
|
|
1179
|
+
o("div", oa, [
|
|
1180
|
+
(x(!0), $(W, null, ve(A.info, (O, ue) => (x(), $("div", {
|
|
1177
1181
|
key: ue,
|
|
1178
1182
|
class: "flex flex-col gap-4"
|
|
1179
1183
|
}, [
|
|
1180
|
-
o("div",
|
|
1181
|
-
o("div",
|
|
1182
|
-
(x(!0),
|
|
1183
|
-
key:
|
|
1184
|
+
o("div", sa, z(O == null ? void 0 : O.label), 1),
|
|
1185
|
+
o("div", ra, [
|
|
1186
|
+
(x(!0), $(W, null, ve(O == null ? void 0 : O.values, (Be, Oe) => (x(), $("div", {
|
|
1187
|
+
key: Oe,
|
|
1184
1188
|
class: "fm-typo-en-body-lg-600"
|
|
1185
1189
|
}, z(Be), 1))), 128))
|
|
1186
1190
|
])
|
|
@@ -1192,13 +1196,13 @@ const jt = Le(
|
|
|
1192
1196
|
])
|
|
1193
1197
|
])
|
|
1194
1198
|
], 64))), 128))
|
|
1195
|
-
])) : (x(),
|
|
1199
|
+
])) : (x(), $("div", Vt, [
|
|
1196
1200
|
_(G),
|
|
1197
1201
|
o("div", null, [
|
|
1198
1202
|
o("img", {
|
|
1199
|
-
src: g(
|
|
1203
|
+
src: g(yt),
|
|
1200
1204
|
alt: "List is empty"
|
|
1201
|
-
}, null, 8,
|
|
1205
|
+
}, null, 8, Yt)
|
|
1202
1206
|
]),
|
|
1203
1207
|
t[14] || (t[14] = o("div", { class: "fm-typo-en-body-lg-600" }, z("No records found"), -1)),
|
|
1204
1208
|
t[15] || (t[15] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, z("You can track approval and rejection history here"), -1)),
|
|
@@ -1212,22 +1216,22 @@ const jt = Le(
|
|
|
1212
1216
|
}, 8, ["model-value"]);
|
|
1213
1217
|
};
|
|
1214
1218
|
}
|
|
1215
|
-
}),
|
|
1219
|
+
}), ia = { class: "flex-1 flex flex-col gap-8" }, ua = { class: "flex flex-col" }, da = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ma = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, fa = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, pa = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, _a = /* @__PURE__ */ ke({
|
|
1216
1220
|
__name: "ClosingDraftView",
|
|
1217
1221
|
setup(n) {
|
|
1218
|
-
const { t: r } =
|
|
1222
|
+
const { t: r } = Ee(), { viewDraft: e } = _e(), { viewClosingDraftProps: i, viewClosingDraftShow: u } = pt(_e()), b = we(), h = St(), D = rt(), { breakpoints: l } = ft();
|
|
1219
1223
|
b.watchLocation(h.fetchDrafts);
|
|
1220
|
-
const
|
|
1224
|
+
const T = H(() => h.loading), R = V(""), I = H(() => l.value.xs || l.value.sm), s = H(() => I.value ? 10 : 20);
|
|
1221
1225
|
function p(v) {
|
|
1222
1226
|
switch (v) {
|
|
1223
1227
|
case "refresh":
|
|
1224
1228
|
return h.fetchDrafts();
|
|
1225
1229
|
}
|
|
1226
1230
|
}
|
|
1227
|
-
function
|
|
1231
|
+
function S(v) {
|
|
1228
1232
|
return v;
|
|
1229
1233
|
}
|
|
1230
|
-
const y =
|
|
1234
|
+
const y = H(() => I.value ? [
|
|
1231
1235
|
{
|
|
1232
1236
|
label: "Refresh",
|
|
1233
1237
|
value: "refresh",
|
|
@@ -1240,9 +1244,9 @@ const jt = Le(
|
|
|
1240
1244
|
isPrimary: !1
|
|
1241
1245
|
}
|
|
1242
1246
|
]);
|
|
1243
|
-
return (v,
|
|
1244
|
-
const N =
|
|
1245
|
-
return x(),
|
|
1247
|
+
return (v, B) => {
|
|
1248
|
+
const N = E("FmTable");
|
|
1249
|
+
return x(), $(W, null, [
|
|
1246
1250
|
_(lt, {
|
|
1247
1251
|
title: g(r)("inventory.closing.draft.title"),
|
|
1248
1252
|
actions: y.value,
|
|
@@ -1253,63 +1257,63 @@ const jt = Le(
|
|
|
1253
1257
|
class: me([
|
|
1254
1258
|
"flex flex-col gap-8 max-h-full",
|
|
1255
1259
|
{
|
|
1256
|
-
"p-0":
|
|
1257
|
-
"px-24 ": !
|
|
1260
|
+
"p-0": I.value,
|
|
1261
|
+
"px-24 ": !I.value
|
|
1258
1262
|
}
|
|
1259
1263
|
])
|
|
1260
1264
|
}, [
|
|
1261
1265
|
_(ct, {
|
|
1262
1266
|
"change-location": "",
|
|
1263
1267
|
searchable: "",
|
|
1264
|
-
search:
|
|
1265
|
-
"onUpdate:search":
|
|
1268
|
+
search: R.value,
|
|
1269
|
+
"onUpdate:search": B[0] || (B[0] = (C) => R.value = C)
|
|
1266
1270
|
}, null, 8, ["search"]),
|
|
1267
1271
|
_(N, {
|
|
1268
1272
|
style: Re(g(D).tableHeight),
|
|
1269
1273
|
"column-defs": g(h).columnDefs,
|
|
1270
1274
|
"row-data": g(h).drafts,
|
|
1271
|
-
"search-value":
|
|
1272
|
-
loading:
|
|
1273
|
-
onRowClick:
|
|
1275
|
+
"search-value": R.value,
|
|
1276
|
+
loading: T.value,
|
|
1277
|
+
onRowClick: B[1] || (B[1] = (C) => g(e)(C.original)),
|
|
1274
1278
|
"page-size": s.value
|
|
1275
1279
|
}, {
|
|
1276
|
-
"list-row": Y((
|
|
1280
|
+
"list-row": Y((C) => [
|
|
1277
1281
|
_(it, {
|
|
1278
|
-
row:
|
|
1279
|
-
onRowClick: (
|
|
1282
|
+
row: C,
|
|
1283
|
+
onRowClick: (U) => g(e)(U)
|
|
1280
1284
|
}, {
|
|
1281
|
-
default: Y((
|
|
1282
|
-
var
|
|
1285
|
+
default: Y((U) => {
|
|
1286
|
+
var M, Q, X, K, se, ce, fe, ge, ee, te, Z, pe, a, t, c, m, d, f, w, F;
|
|
1283
1287
|
return [
|
|
1284
|
-
o("div",
|
|
1285
|
-
o("div",
|
|
1286
|
-
o("div",
|
|
1288
|
+
o("div", ia, [
|
|
1289
|
+
o("div", ua, [
|
|
1290
|
+
o("div", da, [
|
|
1287
1291
|
_(g(he), {
|
|
1288
|
-
render: (X = (Q = (
|
|
1289
|
-
props: (se = (K =
|
|
1292
|
+
render: (X = (Q = (M = U._id) == null ? void 0 : M.column) == null ? void 0 : Q.columnDef) == null ? void 0 : X.cell,
|
|
1293
|
+
props: (se = (K = U._id) == null ? void 0 : K.getContext) == null ? void 0 : se.call(K)
|
|
1290
1294
|
}, null, 8, ["render", "props"])
|
|
1291
1295
|
]),
|
|
1292
|
-
o("div",
|
|
1296
|
+
o("div", ma, [
|
|
1293
1297
|
_(g(he), {
|
|
1294
|
-
render: (ge = (fe = (ce =
|
|
1295
|
-
props: (te = (ee =
|
|
1298
|
+
render: (ge = (fe = (ce = U.name) == null ? void 0 : ce.column) == null ? void 0 : fe.columnDef) == null ? void 0 : ge.cell,
|
|
1299
|
+
props: (te = (ee = U.name) == null ? void 0 : ee.getContext) == null ? void 0 : te.call(ee)
|
|
1296
1300
|
}, null, 8, ["render", "props"])
|
|
1297
1301
|
]),
|
|
1298
|
-
o("div",
|
|
1299
|
-
...
|
|
1300
|
-
...
|
|
1302
|
+
o("div", fa, z([
|
|
1303
|
+
...C.original.items.slice(0, 3).map((j) => j.sku.name),
|
|
1304
|
+
...C.original.items.length >= 3 ? [`and ${C.original.items.length - 3} more items`] : []
|
|
1301
1305
|
].join(", ")), 1),
|
|
1302
|
-
o("div",
|
|
1306
|
+
o("div", pa, [
|
|
1303
1307
|
_(g(he), {
|
|
1304
|
-
render: (a = (pe = (Z =
|
|
1305
|
-
props: (c = (t =
|
|
1308
|
+
render: (a = (pe = (Z = U.ref) == null ? void 0 : Z.column) == null ? void 0 : pe.columnDef) == null ? void 0 : a.cell,
|
|
1309
|
+
props: (c = (t = U.ref) == null ? void 0 : t.getContext) == null ? void 0 : c.call(t)
|
|
1306
1310
|
}, null, 8, ["render", "props"])
|
|
1307
1311
|
])
|
|
1308
1312
|
]),
|
|
1309
1313
|
o("div", null, [
|
|
1310
1314
|
_(g(he), {
|
|
1311
|
-
render: (f = (d = (m =
|
|
1312
|
-
props: (
|
|
1315
|
+
render: (f = (d = (m = U.status) == null ? void 0 : m.column) == null ? void 0 : d.columnDef) == null ? void 0 : f.cell,
|
|
1316
|
+
props: (F = (w = U.status) == null ? void 0 : w.getContext) == null ? void 0 : F.call(w)
|
|
1313
1317
|
}, null, 8, ["render", "props"])
|
|
1314
1318
|
])
|
|
1315
1319
|
])
|
|
@@ -1324,11 +1328,11 @@ const jt = Le(
|
|
|
1324
1328
|
]),
|
|
1325
1329
|
_: 1
|
|
1326
1330
|
}, 8, ["title", "actions"]),
|
|
1327
|
-
(x(), J(
|
|
1328
|
-
_(
|
|
1331
|
+
(x(), J(Ge, { to: "body" }, [
|
|
1332
|
+
_(ca, We(g(i), {
|
|
1329
1333
|
show: g(u),
|
|
1330
|
-
"onUpdate:show":
|
|
1331
|
-
onSubmitted:
|
|
1334
|
+
"onUpdate:show": B[2] || (B[2] = (C) => Te(u) ? u.value = C : null),
|
|
1335
|
+
onSubmitted: B[3] || (B[3] = () => (u.value = !1, g(h).fetchDrafts()))
|
|
1332
1336
|
}), null, 16, ["show"])
|
|
1333
1337
|
]))
|
|
1334
1338
|
], 64);
|
|
@@ -1336,5 +1340,5 @@ const jt = Le(
|
|
|
1336
1340
|
}
|
|
1337
1341
|
});
|
|
1338
1342
|
export {
|
|
1339
|
-
|
|
1343
|
+
_a as default
|
|
1340
1344
|
};
|