@feedmepos/mf-inventory-portal 1.1.7 → 1.1.8-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-Q1owgYie.js → App-BvRPk8r0.js} +1 -1
- package/dist/{ApprovalView-BC6549i5.js → ApprovalView-DYAYe7uy.js} +2 -2
- package/dist/{BindingsDialog-0QfXxRu_.js → BindingsDialog-VoHfQhMW.js} +2 -2
- package/dist/{BindingsPicker-BgwXjm2p.js → BindingsPicker-CoOkCvpg.js} +1 -1
- package/dist/{BindingsTable-DpFr3UiN.js → BindingsTable-DzzFx5xu.js} +1 -1
- package/dist/{ClosingDraftView-BAXB-oYb.js → ClosingDraftView-CZsy11rD.js} +443 -432
- package/dist/{ClosingTemplateView-D4JIKbHj.js → ClosingTemplateView-Bj-x_GU4.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-DhhQcRX8.js → DeliveryOrderPrintPreview-Bcz5WfwW.js} +5 -5
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C1r4dUi1.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BpFSCKsz.js} +13 -13
- package/dist/{FmMultiselectDialog-CMapyW92.js → FmMultiselectDialog-BJIqX_SK.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CGKgWump.js → FmUnitInput.vue_vue_type_script_setup_true_lang-mVSQ2I5N.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BLXeAd6v.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CSGvWr8O.js} +1 -1
- package/dist/{IngredientGroupView-CYsjNj8v.js → IngredientGroupView-B1fCs1nF.js} +2 -2
- package/dist/{IngredientsView-dnmBJKzG.js → IngredientsView-DofmtwQn.js} +4 -4
- package/dist/{IntegrationView-DEX-OtIi.js → IntegrationView-DLD4NSbp.js} +3 -3
- package/dist/{InventoryBindingForm-DzvL-l4u.js → InventoryBindingForm-XJsAC-dY.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Cv5t5HYo.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-hNB8fYjm.js} +3 -3
- package/dist/{InventoryBindingSummary-nwF3dcR4.js → InventoryBindingSummary-DfzeOl1I.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CUZi-c3G.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-MOE2VUUZ.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CQzdlmJ0.js → PremiumBadge.vue_vue_type_script_setup_true_lang-OjJt9ktd.js} +1 -1
- package/dist/{PublishView-BuWPjyoB.js → PublishView-FdEXnmsN.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-2uET9tFI.js → PurchaseOrderPrintPreview-rsUteyWj.js} +7 -7
- package/dist/{ReceiveRequestView-BZtuKeJT.js → ReceiveRequestView-D4C5IQ4-.js} +8 -8
- package/dist/{RecipeView-BbXj7r6o.js → RecipeView-B4yNvOcr.js} +3 -3
- package/dist/{StockView-DKcR_Kmp.js → StockView-DG9aBKaB.js} +609 -594
- package/dist/{SupplierView-CdpHCgy7.js → SupplierView-CZQaJmxI.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-SFt9tDex.js → TransferDetails.vue_vue_type_script_setup_true_lang-Dqnoihdu.js} +254 -253
- package/dist/{TransferTemplateView-DuutgPoJ.js → TransferTemplateView-DRMXmJLR.js} +6 -6
- package/dist/{UnitView-ghRUvZ4b.js → UnitView-C4oLhnNS.js} +3 -3
- package/dist/{WarehouseView-CdL4qG7c.js → WarehouseView-DsG7mfVs.js} +1 -1
- package/dist/{app-Ve0uP1Mz.js → app-CgF1rPXv.js} +215 -215
- package/dist/app.js +1 -1
- package/dist/{decimal-BMp-Vzzy.js → decimal-CpWWvDL9.js} +1 -1
- package/dist/{format-unit-display-eeJk710H.js → format-unit-display-D6XjvIoo.js} +2 -2
- package/dist/{index-BEkSWejP.js → index-CvGaJD6f.js} +1 -1
- package/dist/{index-B9iRubzb.js → index-CxMXOjf5.js} +1 -1
- package/dist/{stock-CaNAztA8.js → stock-CsvylMvm.js} +1 -1
- package/dist/{supplier-BgFEcnyT.js → supplier-CdEmZWhZ.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-kdyHK268.js → use-ingredient-select-dialog-Bw8WMW30.js} +1 -1
- package/dist/{use-inventory-binding-dialog-BCWV0llB.js → use-inventory-binding-dialog-C_SHwceI.js} +1 -1
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { defineComponent as je, ref as E, computed as P, onMounted as
|
|
2
|
-
import { a3 as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { useSnackbar as
|
|
5
|
-
import { defineStore as
|
|
6
|
-
import { a as
|
|
7
|
-
import { E as
|
|
8
|
-
const Be =
|
|
1
|
+
import { defineComponent as je, ref as E, computed as P, onMounted as Pe, resolveComponent as T, openBlock as w, createElementBlock as R, Fragment as q, createTextVNode as G, createBlock as Z, withCtx as Y, createElementVNode as n, toDisplayString as K, unref as S, createVNode as D, createCommentVNode as Q, h as I, reactive as et, watch as tt, isRef as Ve, normalizeClass as me, renderList as ve, normalizeStyle as ze, Teleport as at, mergeProps as nt } from "vue";
|
|
2
|
+
import { a3 as ot, u as $e, an as L, ae as Ne, ao as Oe, m as st, P as Me, j as N, t as rt, T as ye, r as lt, s as ct, v as it, ap as Ye, aq as Ke, a9 as Ge, ar as se, af as ut, as as Ie, am as re, a0 as Re, D as He, i as we, h as dt, f as mt, a as ft, B as pt, _ as vt, C as yt, E as gt, G as Ce } from "./app-CgF1rPXv.js";
|
|
3
|
+
import { useCoreStore as bt, useI18n as qe } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as Ue, useDialog as At, useProxiedModel as Dt, components as de, useBreakpoints as kt } from "@feedmepos/ui-library";
|
|
5
|
+
import { defineStore as We, storeToRefs as _t } from "pinia";
|
|
6
|
+
import { a as Le, u as Ze } from "./stock-CsvylMvm.js";
|
|
7
|
+
import { E as ht } from "./empty-placeholder-wf6-BWE8.js";
|
|
8
|
+
const Be = ot((l, o) => {
|
|
9
9
|
function e() {
|
|
10
10
|
return $e().currentLocation.dbName;
|
|
11
11
|
}
|
|
12
12
|
return {
|
|
13
|
-
async getDraft(
|
|
14
|
-
const
|
|
15
|
-
return o.get(
|
|
13
|
+
async getDraft(c) {
|
|
14
|
+
const f = e(), h = `${l.inventoryBackendUrl}/${f}/closing-draft/${c}`;
|
|
15
|
+
return o.get(h);
|
|
16
16
|
},
|
|
17
17
|
async readDrafts() {
|
|
18
|
-
const
|
|
19
|
-
return o.get(
|
|
18
|
+
const c = e(), f = `${l.inventoryBackendUrl}/${c}/closing-draft`;
|
|
19
|
+
return o.get(f);
|
|
20
20
|
},
|
|
21
|
-
async runOperation(
|
|
22
|
-
const
|
|
23
|
-
return o.post(
|
|
21
|
+
async runOperation(c) {
|
|
22
|
+
const f = e(), h = `${l.inventoryBackendUrl}/${f}/closing-draft/run-operation`;
|
|
23
|
+
return o.post(h, c);
|
|
24
24
|
},
|
|
25
|
-
async sync(
|
|
26
|
-
const
|
|
27
|
-
return o.post(
|
|
25
|
+
async sync(c) {
|
|
26
|
+
const f = e(), h = `${l.inventoryBackendUrl}/${f}/closing-draft/sync`;
|
|
27
|
+
return o.post(h, c);
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
}),
|
|
30
|
+
}), xt = { class: "fm-typo-en-body-lg-400" }, wt = { class: "fm-typo-en-body-lg-600" }, Ct = {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "flex flex-col"
|
|
33
|
-
},
|
|
33
|
+
}, St = { class: "flex gap-12 py-8 justify-end w-full" }, Te = /* @__PURE__ */ je({
|
|
34
34
|
__name: "ClosingDraftAction",
|
|
35
35
|
props: {
|
|
36
36
|
draft: {},
|
|
@@ -39,7 +39,7 @@ const Be = nt((l, o) => {
|
|
|
39
39
|
onFinished: { type: Function }
|
|
40
40
|
},
|
|
41
41
|
setup(l) {
|
|
42
|
-
const o = l, e = E(),
|
|
42
|
+
const o = l, e = E(), c = Be(), f = Ue(), h = E(!1), v = E(null), M = E(!1), d = P(() => {
|
|
43
43
|
switch (o.action) {
|
|
44
44
|
case L.enum.approveDraft:
|
|
45
45
|
return "Approve";
|
|
@@ -60,80 +60,80 @@ const Be = nt((l, o) => {
|
|
|
60
60
|
}
|
|
61
61
|
throw new Error(`Unknown action: ${o.action}`);
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
Pe(() => {
|
|
64
64
|
if (o.draft.effectiveAt)
|
|
65
|
-
|
|
65
|
+
v.value = new Date(o.draft.effectiveAt);
|
|
66
66
|
else {
|
|
67
67
|
const s = new Date(o.draft.createdAt);
|
|
68
|
-
s.setHours(23, 59, 59, 999),
|
|
68
|
+
s.setHours(23, 59, 59, 999), v.value = s;
|
|
69
69
|
}
|
|
70
70
|
M.value = !0;
|
|
71
71
|
});
|
|
72
72
|
const B = P({
|
|
73
73
|
get() {
|
|
74
|
-
return
|
|
74
|
+
return v.value === null ? "" : Ne(v.value);
|
|
75
75
|
},
|
|
76
76
|
set(s) {
|
|
77
77
|
if (s) {
|
|
78
78
|
const a = /* @__PURE__ */ new Date(`${s} ${H.value}`);
|
|
79
|
-
a.setSeconds(59, 999),
|
|
79
|
+
a.setSeconds(59, 999), v.value = a;
|
|
80
80
|
} else
|
|
81
|
-
|
|
81
|
+
v.value = null;
|
|
82
82
|
}
|
|
83
83
|
}), H = P({
|
|
84
84
|
get() {
|
|
85
|
-
return
|
|
85
|
+
return v.value === null ? "" : Oe(v.value);
|
|
86
86
|
},
|
|
87
87
|
set(s) {
|
|
88
88
|
if (s) {
|
|
89
89
|
const a = /* @__PURE__ */ new Date(`${B.value} ${s}`);
|
|
90
|
-
a.setSeconds(59, 999),
|
|
90
|
+
a.setSeconds(59, 999), v.value = a;
|
|
91
91
|
} else
|
|
92
|
-
|
|
92
|
+
v.value = null;
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
async function O() {
|
|
96
|
-
|
|
96
|
+
h.value = !0;
|
|
97
97
|
try {
|
|
98
|
-
await
|
|
98
|
+
await c.runOperation({
|
|
99
99
|
_id: o.draft._id,
|
|
100
100
|
_rev: o.draft._rev ?? "",
|
|
101
101
|
action: o.action,
|
|
102
102
|
data: {
|
|
103
|
-
effectiveAt:
|
|
103
|
+
effectiveAt: v.value ? v.value.toISOString() : null,
|
|
104
104
|
remark: e.value
|
|
105
105
|
}
|
|
106
|
-
}).delayed(500),
|
|
106
|
+
}).delayed(500), f.open({
|
|
107
107
|
title: "Success",
|
|
108
108
|
message: "Action submitted",
|
|
109
109
|
type: "success"
|
|
110
110
|
}), o.onFinished();
|
|
111
111
|
} catch (s) {
|
|
112
|
-
|
|
112
|
+
f.open({
|
|
113
113
|
title: "Something went wrong",
|
|
114
114
|
message: "Unable to submit action. Please try again",
|
|
115
115
|
type: "error"
|
|
116
116
|
}), console.error("error on submit closing draft action", s);
|
|
117
117
|
} finally {
|
|
118
|
-
|
|
118
|
+
h.value = !1;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
return (s, a) => {
|
|
122
|
-
const
|
|
123
|
-
return M.value ? (
|
|
122
|
+
const k = T("FmLabel"), V = T("FmDatePicker"), m = T("FmTimePicker"), p = T("FmTextField"), C = T("FmButton"), $ = T("FmForm");
|
|
123
|
+
return M.value ? (w(), Z($, {
|
|
124
124
|
key: 1,
|
|
125
125
|
onValidationSuccess: O,
|
|
126
126
|
class: "flex flex-col gap-32",
|
|
127
|
-
disabled:
|
|
127
|
+
disabled: h.value
|
|
128
128
|
}, {
|
|
129
129
|
default: Y(() => [
|
|
130
|
-
n("div",
|
|
130
|
+
n("div", xt, [
|
|
131
131
|
a[4] || (a[4] = G(" You are about to ")),
|
|
132
|
-
n("span",
|
|
132
|
+
n("span", wt, K(d.value), 1),
|
|
133
133
|
a[5] || (a[5] = G(" this draft. Please provide a remark to justify this action. "))
|
|
134
134
|
]),
|
|
135
|
-
s.action === S(L).enum.approveDraft ? (
|
|
136
|
-
D(
|
|
135
|
+
s.action === S(L).enum.approveDraft ? (w(), R("div", Ct, [
|
|
136
|
+
D(k, { class: "fm-typo-en-body-lg-600" }, {
|
|
137
137
|
default: Y(() => a[6] || (a[6] = [
|
|
138
138
|
G("Closing Date")
|
|
139
139
|
])),
|
|
@@ -143,96 +143,96 @@ const Be = nt((l, o) => {
|
|
|
143
143
|
modelValue: B.value,
|
|
144
144
|
"onUpdate:modelValue": a[0] || (a[0] = (F) => B.value = F)
|
|
145
145
|
}, null, 8, ["modelValue"]),
|
|
146
|
-
D(
|
|
146
|
+
D(k, { class: "fm-typo-en-body-lg-600" }, {
|
|
147
147
|
default: Y(() => a[7] || (a[7] = [
|
|
148
148
|
G("Closing Time")
|
|
149
149
|
])),
|
|
150
150
|
_: 1
|
|
151
151
|
}),
|
|
152
|
-
D(
|
|
152
|
+
D(m, {
|
|
153
153
|
modelValue: H.value,
|
|
154
154
|
"onUpdate:modelValue": a[1] || (a[1] = (F) => H.value = F)
|
|
155
155
|
}, null, 8, ["modelValue"])
|
|
156
156
|
])) : Q("", !0),
|
|
157
|
-
D(
|
|
157
|
+
D(p, {
|
|
158
158
|
modelValue: e.value,
|
|
159
159
|
"onUpdate:modelValue": a[2] || (a[2] = (F) => e.value = F),
|
|
160
160
|
label: "Remark",
|
|
161
161
|
"label-mark": "required",
|
|
162
|
-
rules: [S(
|
|
162
|
+
rules: [S(st)()]
|
|
163
163
|
}, null, 8, ["modelValue", "rules"]),
|
|
164
|
-
n("div",
|
|
164
|
+
n("div", St, [
|
|
165
165
|
D(C, {
|
|
166
166
|
label: "Cancel",
|
|
167
167
|
variant: "tertiary",
|
|
168
168
|
onClick: a[3] || (a[3] = (F) => s.onCancel())
|
|
169
169
|
}),
|
|
170
170
|
D(C, {
|
|
171
|
-
label:
|
|
171
|
+
label: d.value,
|
|
172
172
|
type: "submit",
|
|
173
173
|
variant: y.value,
|
|
174
|
-
loading:
|
|
174
|
+
loading: h.value
|
|
175
175
|
}, null, 8, ["label", "variant", "loading"])
|
|
176
176
|
])
|
|
177
177
|
]),
|
|
178
178
|
_: 1
|
|
179
|
-
}, 8, ["disabled"])) : (
|
|
179
|
+
}, 8, ["disabled"])) : (w(), R(q, { key: 0 }, [
|
|
180
180
|
G("Loading")
|
|
181
181
|
], 64));
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
}),
|
|
185
|
-
function
|
|
186
|
-
const o = l.measurementsAmounts.groupBy((
|
|
187
|
-
var M,
|
|
188
|
-
const
|
|
189
|
-
return
|
|
190
|
-
}, +
|
|
191
|
-
return
|
|
184
|
+
}), Ft = ye(0);
|
|
185
|
+
function Je(l) {
|
|
186
|
+
const o = l.measurementsAmounts.groupBy((c) => c.measurement.id), e = l.sku.unit.measurements.reduce((c, f) => {
|
|
187
|
+
var M, d;
|
|
188
|
+
const h = ((d = (M = o.get(f.id)) == null ? void 0 : M[0]) == null ? void 0 : d.amount) ?? Ft, v = Me(f.conversion, h);
|
|
189
|
+
return c + +N(v);
|
|
190
|
+
}, +N(l.baseAmount));
|
|
191
|
+
return rt(e, l.baseAmount.precision);
|
|
192
192
|
}
|
|
193
|
-
const
|
|
194
|
-
function
|
|
195
|
-
const
|
|
193
|
+
const jt = ye(0), $t = ye(100);
|
|
194
|
+
function Bt(l, o, e) {
|
|
195
|
+
const c = Je(l), f = Ye(c, o), h = o.amount === 0 ? null : Ke(f, {
|
|
196
196
|
...o,
|
|
197
197
|
amount: Math.abs(o.amount)
|
|
198
|
-
}),
|
|
198
|
+
}), v = h ? Me(h, $t) : null;
|
|
199
199
|
return {
|
|
200
200
|
code: l.sku.code,
|
|
201
201
|
name: l.sku.name,
|
|
202
202
|
baseUnit: l.sku.unit.abbrev,
|
|
203
|
-
baseUnitAmount: +
|
|
203
|
+
baseUnitAmount: +N(l.baseAmount),
|
|
204
204
|
...l.measurementsAmounts.filter(
|
|
205
|
-
(
|
|
205
|
+
(d) => Tt(d.measurement) && e.includes(d.measurement.id)
|
|
206
206
|
).reduce(
|
|
207
|
-
(
|
|
207
|
+
(d, y, B) => (d[`measurementAbbrev${B}`] = `(${y.measurement.abbrev}) × ${N(y.measurement.conversion)}`, d[`measurementAmount${B}`] = +N(y.amount), d),
|
|
208
208
|
{}
|
|
209
209
|
),
|
|
210
|
-
systemBalance: +
|
|
211
|
-
physicalBalance: +
|
|
212
|
-
adjustedAmount: +
|
|
213
|
-
adjustedDiffPercentage:
|
|
210
|
+
systemBalance: +N(o),
|
|
211
|
+
physicalBalance: +N(c),
|
|
212
|
+
adjustedAmount: +N(f),
|
|
213
|
+
adjustedDiffPercentage: v ? +N(Ge(v, 2)) : null
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function Tt(l) {
|
|
217
217
|
return !l.abbrev.toLocaleLowerCase().includes("inactive");
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
const o =
|
|
219
|
+
function It(l) {
|
|
220
|
+
const o = Qe(l);
|
|
221
221
|
return l.reduce(
|
|
222
|
-
(e,
|
|
223
|
-
var
|
|
224
|
-
return Math.max(e, ((
|
|
222
|
+
(e, c) => {
|
|
223
|
+
var f;
|
|
224
|
+
return Math.max(e, ((f = o == null ? void 0 : o.get(c.sku._id)) == null ? void 0 : f[0].length) ?? 0);
|
|
225
225
|
},
|
|
226
226
|
0
|
|
227
227
|
);
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function Qe(l) {
|
|
230
230
|
return l.groupBy(
|
|
231
231
|
(o) => o.sku._id,
|
|
232
232
|
(o) => o.measurementsAmounts.filter((e) => !e.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((e) => e.measurement.id)
|
|
233
233
|
);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function Rt(l) {
|
|
236
236
|
return [
|
|
237
237
|
{
|
|
238
238
|
id: "code",
|
|
@@ -266,39 +266,39 @@ function It(l) {
|
|
|
266
266
|
id: "baseUnit",
|
|
267
267
|
name: "Base unit"
|
|
268
268
|
},
|
|
269
|
-
...Array.from({ length: l }).flatMap((e,
|
|
269
|
+
...Array.from({ length: l }).flatMap((e, c) => [
|
|
270
270
|
{
|
|
271
|
-
id: `measurementAmount${
|
|
272
|
-
name: `UOM amount ${
|
|
271
|
+
id: `measurementAmount${c}`,
|
|
272
|
+
name: `UOM amount ${c + 1}`
|
|
273
273
|
},
|
|
274
274
|
{
|
|
275
|
-
id: `measurementAbbrev${
|
|
276
|
-
name: `UOM ${
|
|
275
|
+
id: `measurementAbbrev${c}`,
|
|
276
|
+
name: `UOM ${c + 1}`
|
|
277
277
|
}
|
|
278
278
|
])
|
|
279
279
|
];
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
var a,
|
|
281
|
+
function Pt(l, o) {
|
|
282
|
+
var a, k, V, m, p, C, $;
|
|
283
283
|
const e = o.groupBy(
|
|
284
284
|
(F) => F.id,
|
|
285
285
|
(F) => F.balance
|
|
286
|
-
),
|
|
287
|
-
var W,
|
|
288
|
-
const X = ((W = e.get(F.sku._id)) == null ? void 0 : W[0]) ??
|
|
289
|
-
return
|
|
290
|
-
}),
|
|
291
|
-
["Business name:",
|
|
292
|
-
["Business ID:",
|
|
293
|
-
["Menu version",
|
|
286
|
+
), c = [...l.items, ...l.negativeStockItems ?? []], f = Qe(c), h = c.map((F) => {
|
|
287
|
+
var W, le;
|
|
288
|
+
const X = ((W = e.get(F.sku._id)) == null ? void 0 : W[0]) ?? jt, J = ((le = f == null ? void 0 : f.get(F.sku._id)) == null ? void 0 : le[0]) ?? [];
|
|
289
|
+
return Bt(F, X, J);
|
|
290
|
+
}), v = It(c), d = bt().currentBusiness.value, y = Rt(v), B = [
|
|
291
|
+
["Business name:", d == null ? void 0 : d.name],
|
|
292
|
+
["Business ID:", d == null ? void 0 : d._id],
|
|
293
|
+
["Menu version", d == null ? void 0 : d.menuVersion],
|
|
294
294
|
["Created at", new Date(l.createdAt)],
|
|
295
295
|
["Created by", (a = l.createdBy) == null ? void 0 : a.name],
|
|
296
296
|
["Updated at", new Date(l.updatedAt)],
|
|
297
|
-
["Updated by", (
|
|
297
|
+
["Updated by", (k = l.updatedBy) == null ? void 0 : k.name],
|
|
298
298
|
["Recent action", l.approvedAt ? "Approve" : l.rejectionHistory ? "Reject" : ""],
|
|
299
299
|
[
|
|
300
300
|
"Action by",
|
|
301
|
-
l.approvedAt ? (V = l.approvedBy) == null ? void 0 : V.name : l.rejectionHistory ? (
|
|
301
|
+
l.approvedAt ? (V = l.approvedBy) == null ? void 0 : V.name : l.rejectionHistory ? (p = (m = l.rejectionHistory[0]) == null ? void 0 : m.rejectedBy) == null ? void 0 : p.name : ""
|
|
302
302
|
],
|
|
303
303
|
[
|
|
304
304
|
"Action at",
|
|
@@ -310,11 +310,11 @@ function Rt(l, o) {
|
|
|
310
310
|
],
|
|
311
311
|
[],
|
|
312
312
|
y.map((F) => F.name),
|
|
313
|
-
...
|
|
314
|
-
], H = y.map((F) => `system:${F.id}`), O =
|
|
315
|
-
return
|
|
313
|
+
...h.map((F) => y.map((X) => F[X.id]))
|
|
314
|
+
], H = y.map((F) => `system:${F.id}`), O = lt(B, H), s = `[${d == null ? void 0 : d.name}] closing draft (${ct(new Date(l.updatedAt))}).xlsx`;
|
|
315
|
+
return it(O, s), s;
|
|
316
316
|
}
|
|
317
|
-
const
|
|
317
|
+
const Mt = { class: "flex flex-col" }, Ut = { class: "flex gap-12 py-8 justify-end w-full" }, Lt = /* @__PURE__ */ je({
|
|
318
318
|
__name: "RefreshBalanceAction",
|
|
319
319
|
props: {
|
|
320
320
|
draft: {},
|
|
@@ -323,46 +323,46 @@ const Pt = { class: "flex flex-col" }, Mt = { class: "flex gap-12 py-8 justify-e
|
|
|
323
323
|
},
|
|
324
324
|
setup(l) {
|
|
325
325
|
const o = l;
|
|
326
|
-
|
|
327
|
-
const e = E(!1),
|
|
328
|
-
|
|
326
|
+
Le();
|
|
327
|
+
const e = E(!1), c = E(null), f = E(!1);
|
|
328
|
+
Pe(() => {
|
|
329
329
|
if (o.draft.effectiveAt)
|
|
330
|
-
|
|
330
|
+
c.value = new Date(o.draft.effectiveAt);
|
|
331
331
|
else {
|
|
332
|
-
const
|
|
333
|
-
|
|
332
|
+
const d = new Date(o.draft.createdAt);
|
|
333
|
+
d.setHours(23, 59, 59, 999), c.value = d;
|
|
334
334
|
}
|
|
335
|
-
|
|
335
|
+
f.value = !0;
|
|
336
336
|
});
|
|
337
|
-
const
|
|
337
|
+
const h = P({
|
|
338
338
|
get() {
|
|
339
|
-
return
|
|
339
|
+
return c.value === null ? "" : Ne(c.value);
|
|
340
340
|
},
|
|
341
|
-
set(
|
|
342
|
-
if (
|
|
343
|
-
const y = /* @__PURE__ */ new Date(`${
|
|
344
|
-
y.setSeconds(59, 999),
|
|
341
|
+
set(d) {
|
|
342
|
+
if (d) {
|
|
343
|
+
const y = /* @__PURE__ */ new Date(`${d} ${v.value}`);
|
|
344
|
+
y.setSeconds(59, 999), c.value = y;
|
|
345
345
|
} else
|
|
346
|
-
|
|
346
|
+
c.value = null;
|
|
347
347
|
}
|
|
348
|
-
}),
|
|
348
|
+
}), v = P({
|
|
349
349
|
get() {
|
|
350
|
-
return
|
|
350
|
+
return c.value === null ? "" : Oe(c.value);
|
|
351
351
|
},
|
|
352
|
-
set(
|
|
353
|
-
if (
|
|
354
|
-
const y = /* @__PURE__ */ new Date(`${
|
|
355
|
-
y.setSeconds(59, 999),
|
|
352
|
+
set(d) {
|
|
353
|
+
if (d) {
|
|
354
|
+
const y = /* @__PURE__ */ new Date(`${h.value} ${d}`);
|
|
355
|
+
y.setSeconds(59, 999), c.value = y;
|
|
356
356
|
} else
|
|
357
|
-
|
|
357
|
+
c.value = null;
|
|
358
358
|
}
|
|
359
359
|
});
|
|
360
360
|
async function M() {
|
|
361
|
-
e.value = !0, o.onFinished(
|
|
361
|
+
e.value = !0, o.onFinished(c.value.toISOString());
|
|
362
362
|
}
|
|
363
|
-
return (
|
|
363
|
+
return (d, y) => {
|
|
364
364
|
const B = T("FmLabel"), H = T("FmDatePicker"), O = T("FmTimePicker"), s = T("FmButton"), a = T("FmForm");
|
|
365
|
-
return
|
|
365
|
+
return f.value ? (w(), Z(a, {
|
|
366
366
|
key: 1,
|
|
367
367
|
onValidationSuccess: M,
|
|
368
368
|
class: "flex flex-col gap-32",
|
|
@@ -381,7 +381,7 @@ const Pt = { class: "flex flex-col" }, Mt = { class: "flex gap-12 py-8 justify-e
|
|
|
381
381
|
G(" the effective date and time. ")
|
|
382
382
|
])
|
|
383
383
|
], -1)),
|
|
384
|
-
n("div",
|
|
384
|
+
n("div", Mt, [
|
|
385
385
|
D(B, { class: "fm-typo-en-body-lg-600" }, {
|
|
386
386
|
default: Y(() => y[3] || (y[3] = [
|
|
387
387
|
G("Closing Date")
|
|
@@ -389,8 +389,8 @@ const Pt = { class: "flex flex-col" }, Mt = { class: "flex gap-12 py-8 justify-e
|
|
|
389
389
|
_: 1
|
|
390
390
|
}),
|
|
391
391
|
D(H, {
|
|
392
|
-
modelValue:
|
|
393
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
392
|
+
modelValue: h.value,
|
|
393
|
+
"onUpdate:modelValue": y[0] || (y[0] = (k) => h.value = k)
|
|
394
394
|
}, null, 8, ["modelValue"]),
|
|
395
395
|
D(B, { class: "fm-typo-en-body-lg-600" }, {
|
|
396
396
|
default: Y(() => y[4] || (y[4] = [
|
|
@@ -399,15 +399,15 @@ const Pt = { class: "flex flex-col" }, Mt = { class: "flex gap-12 py-8 justify-e
|
|
|
399
399
|
_: 1
|
|
400
400
|
}),
|
|
401
401
|
D(O, {
|
|
402
|
-
modelValue:
|
|
403
|
-
"onUpdate:modelValue": y[1] || (y[1] = (
|
|
402
|
+
modelValue: v.value,
|
|
403
|
+
"onUpdate:modelValue": y[1] || (y[1] = (k) => v.value = k)
|
|
404
404
|
}, null, 8, ["modelValue"])
|
|
405
405
|
]),
|
|
406
|
-
n("div",
|
|
406
|
+
n("div", Ut, [
|
|
407
407
|
D(s, {
|
|
408
408
|
label: "Cancel",
|
|
409
409
|
variant: "tertiary",
|
|
410
|
-
onClick: y[2] || (y[2] = (
|
|
410
|
+
onClick: y[2] || (y[2] = (k) => d.onCancel())
|
|
411
411
|
}),
|
|
412
412
|
D(s, {
|
|
413
413
|
label: "Refresh balance",
|
|
@@ -418,132 +418,132 @@ const Pt = { class: "flex flex-col" }, Mt = { class: "flex gap-12 py-8 justify-e
|
|
|
418
418
|
])
|
|
419
419
|
]),
|
|
420
420
|
_: 1
|
|
421
|
-
}, 8, ["disabled"])) : (
|
|
421
|
+
}, 8, ["disabled"])) : (w(), R(q, { key: 0 }, [
|
|
422
422
|
G("Loading")
|
|
423
423
|
], 64));
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
|
-
}), Fe =
|
|
426
|
+
}), Fe = We(
|
|
427
427
|
"closingDraftActions",
|
|
428
428
|
function() {
|
|
429
|
-
const o =
|
|
430
|
-
function
|
|
431
|
-
const
|
|
432
|
-
draft:
|
|
429
|
+
const o = At(), e = Ue(), c = Le(), f = Be(), h = Ze(), v = E(!1), M = E();
|
|
430
|
+
function d(m) {
|
|
431
|
+
const p = {
|
|
432
|
+
draft: m
|
|
433
433
|
};
|
|
434
|
-
M.value =
|
|
434
|
+
M.value = p, v.value = !0;
|
|
435
435
|
}
|
|
436
|
-
async function y(
|
|
436
|
+
async function y(m) {
|
|
437
437
|
var C;
|
|
438
|
-
if (
|
|
439
|
-
const $ =
|
|
438
|
+
if (m.status === se.enum.COMPLETED) {
|
|
439
|
+
const $ = m.closingAdjustmentId;
|
|
440
440
|
if (!$)
|
|
441
441
|
return e.open({
|
|
442
442
|
title: "Something went wrong",
|
|
443
443
|
message: "Closing draft is completed but closing document cannot be found.",
|
|
444
444
|
type: "error"
|
|
445
445
|
}), console.error("Closing draft is completed but closing document cannot be found.", {
|
|
446
|
-
draftId:
|
|
446
|
+
draftId: m._id
|
|
447
447
|
}), [];
|
|
448
|
-
const F = await
|
|
448
|
+
const F = await c.readAdjustmentById($);
|
|
449
449
|
return ((F == null ? void 0 : F.skus) ?? []).map((J) => ({
|
|
450
450
|
id: J.sku._id,
|
|
451
451
|
balance: J.fromBalance,
|
|
452
452
|
costs: J.fromCostBalances
|
|
453
453
|
}));
|
|
454
454
|
} else
|
|
455
|
-
return await
|
|
455
|
+
return await h.readStockBalance(), ((C = h.stockBalance) == null ? void 0 : C.skus) ?? [];
|
|
456
456
|
}
|
|
457
|
-
async function B(
|
|
458
|
-
|
|
457
|
+
async function B(m, p) {
|
|
458
|
+
p || (e.open({
|
|
459
459
|
title: "Exporting",
|
|
460
460
|
message: "Fetching data..."
|
|
461
|
-
}),
|
|
461
|
+
}), p = await y(m)), Pt(m, p);
|
|
462
462
|
}
|
|
463
|
-
function H(
|
|
463
|
+
function H(m, p) {
|
|
464
464
|
o.open({
|
|
465
465
|
title: "Approve draft",
|
|
466
466
|
contentComponent: Te,
|
|
467
467
|
contentComponentProps: {
|
|
468
|
-
draft:
|
|
468
|
+
draft: m,
|
|
469
469
|
action: L.enum.approveDraft,
|
|
470
470
|
onFinished: () => {
|
|
471
|
-
o.close(),
|
|
471
|
+
o.close(), p == null || p();
|
|
472
472
|
},
|
|
473
473
|
onCancel: () => o.close()
|
|
474
474
|
}
|
|
475
475
|
});
|
|
476
476
|
}
|
|
477
|
-
function O(
|
|
477
|
+
function O(m, p) {
|
|
478
478
|
o.open({
|
|
479
479
|
title: "Reject draft",
|
|
480
480
|
contentComponent: Te,
|
|
481
481
|
contentComponentProps: {
|
|
482
|
-
draft:
|
|
482
|
+
draft: m,
|
|
483
483
|
action: L.enum.rejectDraft,
|
|
484
484
|
onFinished: () => {
|
|
485
|
-
o.close(),
|
|
485
|
+
o.close(), p == null || p();
|
|
486
486
|
},
|
|
487
487
|
onCancel: () => o.close()
|
|
488
488
|
}
|
|
489
489
|
});
|
|
490
490
|
}
|
|
491
|
-
function s(
|
|
491
|
+
function s(m, p) {
|
|
492
492
|
o.open({
|
|
493
493
|
title: "Mark draft as failed",
|
|
494
494
|
contentComponent: Te,
|
|
495
495
|
contentComponentProps: {
|
|
496
|
-
draft:
|
|
496
|
+
draft: m,
|
|
497
497
|
action: L.enum.markAsFailed,
|
|
498
498
|
onFinished: () => {
|
|
499
|
-
o.close(),
|
|
499
|
+
o.close(), p == null || p();
|
|
500
500
|
},
|
|
501
501
|
onCancel: () => o.close()
|
|
502
502
|
}
|
|
503
503
|
});
|
|
504
504
|
}
|
|
505
|
-
async function a(
|
|
506
|
-
await
|
|
507
|
-
_id:
|
|
508
|
-
_rev:
|
|
505
|
+
async function a(m, p) {
|
|
506
|
+
await f.sync({
|
|
507
|
+
_id: m._id,
|
|
508
|
+
_rev: m._rev ?? "",
|
|
509
509
|
action: L.enum.approveDraft,
|
|
510
510
|
data: {
|
|
511
|
-
remark:
|
|
511
|
+
remark: m.remark ?? ""
|
|
512
512
|
}
|
|
513
513
|
}).delayed(500), e.open({
|
|
514
514
|
title: "Success",
|
|
515
515
|
message: "Sync requested",
|
|
516
516
|
type: "success"
|
|
517
|
-
}),
|
|
517
|
+
}), p == null || p();
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
|
|
519
|
+
function k() {
|
|
520
|
+
v.value = !1;
|
|
521
521
|
}
|
|
522
|
-
async function V(
|
|
522
|
+
async function V(m, p, C) {
|
|
523
523
|
await o.open({
|
|
524
524
|
title: "Refresh balance",
|
|
525
|
-
contentComponent:
|
|
525
|
+
contentComponent: Lt,
|
|
526
526
|
contentComponentProps: {
|
|
527
|
-
draft:
|
|
527
|
+
draft: m,
|
|
528
528
|
onFinished: ($) => {
|
|
529
529
|
o.close(), C == null || C($);
|
|
530
530
|
},
|
|
531
531
|
onCancel: async () => {
|
|
532
|
-
o.close(),
|
|
532
|
+
o.close(), p == null || p();
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
});
|
|
536
536
|
}
|
|
537
537
|
return {
|
|
538
|
-
viewDraft:
|
|
539
|
-
closeDraftDialog:
|
|
538
|
+
viewDraft: d,
|
|
539
|
+
closeDraftDialog: k,
|
|
540
540
|
approveDraft: H,
|
|
541
541
|
rejectDraft: O,
|
|
542
542
|
markAsFailed: s,
|
|
543
543
|
syncDraft: a,
|
|
544
544
|
exportDraft: B,
|
|
545
545
|
refreshBalance: V,
|
|
546
|
-
viewClosingDraftShow:
|
|
546
|
+
viewClosingDraftShow: v,
|
|
547
547
|
viewClosingDraftProps: M
|
|
548
548
|
};
|
|
549
549
|
}
|
|
@@ -560,41 +560,41 @@ function Se(l) {
|
|
|
560
560
|
return "fm-status-badge-complete";
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
|
-
const
|
|
563
|
+
const Et = We(
|
|
564
564
|
"closingDraftTable",
|
|
565
565
|
function() {
|
|
566
|
-
const { t: o } =
|
|
566
|
+
const { t: o } = qe(), e = Fe(), c = E(new Array()), f = E(!1), h = $e(), v = Be();
|
|
567
567
|
async function M() {
|
|
568
|
-
if (
|
|
569
|
-
|
|
568
|
+
if (c.value = [], !!h._currentLocation) {
|
|
569
|
+
f.value = !0;
|
|
570
570
|
try {
|
|
571
|
-
const [s] = await Promise.all([
|
|
572
|
-
|
|
571
|
+
const [s] = await Promise.all([v.readDrafts()]).delayed(1e3);
|
|
572
|
+
c.value = s.reverse();
|
|
573
573
|
} catch (s) {
|
|
574
574
|
console.log("Something went wrong when fetching drafts:", s);
|
|
575
575
|
} finally {
|
|
576
|
-
|
|
576
|
+
f.value = !1;
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
|
-
async function
|
|
581
|
-
if (!
|
|
582
|
-
|
|
580
|
+
async function d(s) {
|
|
581
|
+
if (!c.value.find((a) => a._id) && h._currentLocation) {
|
|
582
|
+
f.value = !0;
|
|
583
583
|
try {
|
|
584
584
|
const [a] = await Promise.all([
|
|
585
|
-
|
|
586
|
-
new Promise((
|
|
585
|
+
v.getDraft(s),
|
|
586
|
+
new Promise((k) => setTimeout(k, 1e3))
|
|
587
587
|
]);
|
|
588
|
-
|
|
588
|
+
c.value = [a];
|
|
589
589
|
} catch (a) {
|
|
590
590
|
console.log("Something went wrong when fetching drafts:", a);
|
|
591
591
|
} finally {
|
|
592
|
-
|
|
592
|
+
f.value = !1;
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
595
|
}
|
|
596
596
|
function y(s) {
|
|
597
|
-
|
|
597
|
+
c.value = c.value.map((a) => a._id === s._id ? {
|
|
598
598
|
...s,
|
|
599
599
|
_rev: a._rev
|
|
600
600
|
} : a);
|
|
@@ -603,7 +603,7 @@ const Lt = qe(
|
|
|
603
603
|
e.closeDraftDialog(), M();
|
|
604
604
|
}
|
|
605
605
|
function H(s, a) {
|
|
606
|
-
switch (a =
|
|
606
|
+
switch (a = mt(a), s) {
|
|
607
607
|
case we.Details:
|
|
608
608
|
return e.viewDraft(a);
|
|
609
609
|
case we.Export:
|
|
@@ -623,13 +623,24 @@ const Lt = qe(
|
|
|
623
623
|
accessorKey: "_id",
|
|
624
624
|
header: () => o("inventory.closing.table.createdAt"),
|
|
625
625
|
cell(s) {
|
|
626
|
-
return
|
|
626
|
+
return ut(`${s.getValue()}`);
|
|
627
627
|
},
|
|
628
628
|
enableSorting: !0
|
|
629
629
|
},
|
|
630
|
+
{
|
|
631
|
+
accessorKey: "effectiveAt",
|
|
632
|
+
header: () => "Effective at",
|
|
633
|
+
cell(s) {
|
|
634
|
+
const a = s.row.original;
|
|
635
|
+
let k = s.getValue();
|
|
636
|
+
return k || (k = Ie(a._id)), re(k);
|
|
637
|
+
},
|
|
638
|
+
enableSorting: !0,
|
|
639
|
+
size: 200
|
|
640
|
+
},
|
|
630
641
|
{
|
|
631
642
|
id: "updatedAt",
|
|
632
|
-
accessorFn: (s) =>
|
|
643
|
+
accessorFn: (s) => re(s.updatedAt),
|
|
633
644
|
header: () => "Updated at",
|
|
634
645
|
enableSorting: !0,
|
|
635
646
|
size: 200
|
|
@@ -658,7 +669,7 @@ const Lt = qe(
|
|
|
658
669
|
id: "recentRemark",
|
|
659
670
|
accessorFn: (s) => {
|
|
660
671
|
var a;
|
|
661
|
-
return (s == null ? void 0 : s.approveRemark) ?? ((a = s == null ? void 0 : s.rejectionHistory) == null ? void 0 : a.computeFirst((
|
|
672
|
+
return (s == null ? void 0 : s.approveRemark) ?? ((a = s == null ? void 0 : s.rejectionHistory) == null ? void 0 : a.computeFirst((k) => k.rejectRemark)) ?? s.remark;
|
|
662
673
|
},
|
|
663
674
|
header: () => "Recent remark"
|
|
664
675
|
},
|
|
@@ -669,8 +680,8 @@ const Lt = qe(
|
|
|
669
680
|
enableSorting: !1,
|
|
670
681
|
cell(s) {
|
|
671
682
|
var C;
|
|
672
|
-
const a = s.row.original,
|
|
673
|
-
return
|
|
683
|
+
const a = s.row.original, k = a.status, V = new Date(a.updatedAt), m = (C = a == null ? void 0 : a.rejectionHistory) == null ? void 0 : C.computeFirst(($) => $.rejectedAt), p = m ? new Date(m) : null;
|
|
684
|
+
return k === "DRAFT" && p ? p.getTime() > V.getTime() ? I(
|
|
674
685
|
"div",
|
|
675
686
|
{
|
|
676
687
|
class: "flex"
|
|
@@ -702,9 +713,9 @@ const Lt = qe(
|
|
|
702
713
|
I(
|
|
703
714
|
"div",
|
|
704
715
|
{
|
|
705
|
-
class: ["fm-status-badge", Se(
|
|
716
|
+
class: ["fm-status-badge", Se(k)]
|
|
706
717
|
},
|
|
707
|
-
|
|
718
|
+
Re(k)
|
|
708
719
|
)
|
|
709
720
|
);
|
|
710
721
|
}
|
|
@@ -712,9 +723,9 @@ const Lt = qe(
|
|
|
712
723
|
{
|
|
713
724
|
id: "action",
|
|
714
725
|
cell(s) {
|
|
715
|
-
const a = s.row.original,
|
|
716
|
-
|
|
717
|
-
|
|
726
|
+
const a = s.row.original, k = [
|
|
727
|
+
He[we.Details],
|
|
728
|
+
He[we.Export]
|
|
718
729
|
], V = [
|
|
719
730
|
{
|
|
720
731
|
translationKey: "inventory.closing.draft.approveDraft",
|
|
@@ -732,12 +743,12 @@ const Lt = qe(
|
|
|
732
743
|
value: L.enum.markAsFailed
|
|
733
744
|
}
|
|
734
745
|
];
|
|
735
|
-
return
|
|
746
|
+
return dt(
|
|
736
747
|
[
|
|
737
|
-
...
|
|
748
|
+
...k,
|
|
738
749
|
...a.status === se.enum.DRAFT ? V : []
|
|
739
750
|
],
|
|
740
|
-
(
|
|
751
|
+
(m) => H(m, a)
|
|
741
752
|
);
|
|
742
753
|
},
|
|
743
754
|
enableSorting: !1,
|
|
@@ -748,44 +759,44 @@ const Lt = qe(
|
|
|
748
759
|
}
|
|
749
760
|
}
|
|
750
761
|
],
|
|
751
|
-
drafts:
|
|
752
|
-
loading:
|
|
762
|
+
drafts: c,
|
|
763
|
+
loading: f,
|
|
753
764
|
fetchDrafts: M,
|
|
754
|
-
loadDraft:
|
|
765
|
+
loadDraft: d,
|
|
755
766
|
updateDraftRef: y
|
|
756
767
|
};
|
|
757
768
|
}
|
|
758
|
-
),
|
|
769
|
+
), Ht = { class: "w-full flex flex-col gap-32" }, Vt = { class: "flex justify-between" }, zt = { class: "flex" }, Nt = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, Ot = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yt = { class: "flex gap-1" }, Kt = { class: "fm-typo-en-body-lg-600" }, Gt = { class: "flex flex-col gap-16" }, qt = { class: "flex items-center" }, Wt = {
|
|
759
770
|
key: 0,
|
|
760
771
|
class: "flex gap-8"
|
|
761
|
-
},
|
|
772
|
+
}, Zt = {
|
|
762
773
|
key: 0,
|
|
763
774
|
class: "w-full flex flex-col items-center"
|
|
764
|
-
},
|
|
775
|
+
}, Jt = { class: "flex items-center gap-8" }, Qt = { class: "flex flex-col gap-8" }, Xt = { class: "flex gap-8" }, ea = {
|
|
765
776
|
key: 0,
|
|
766
777
|
class: "flex gap-8"
|
|
767
|
-
},
|
|
778
|
+
}, ta = { class: "overflow-x-auto" }, aa = {
|
|
768
779
|
key: 1,
|
|
769
780
|
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
770
|
-
},
|
|
781
|
+
}, na = {
|
|
771
782
|
key: 0,
|
|
772
783
|
class: "flex flex-col items-center gap-8 h-full"
|
|
773
|
-
},
|
|
784
|
+
}, oa = ["src"], sa = {
|
|
774
785
|
key: 1,
|
|
775
786
|
class: "px-4 flex flex-col"
|
|
776
|
-
},
|
|
787
|
+
}, ra = { class: "flex gap-12 content-stretch" }, la = {
|
|
777
788
|
class: "flex flex-col w-24",
|
|
778
789
|
name: "circles"
|
|
779
|
-
},
|
|
790
|
+
}, ca = { class: "flex-1 flex flex-col items-center" }, ia = { class: "flex-1 flex flex-col items-center" }, ua = {
|
|
780
791
|
class: "py-12 flex flex-col gap-4",
|
|
781
792
|
name: "received-at header"
|
|
782
|
-
},
|
|
793
|
+
}, da = { class: "fm-typo-en-body-lg-400" }, ma = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, fa = { class: "flex gap-12 content-stretch" }, pa = {
|
|
783
794
|
class: "flex flex-col w-24",
|
|
784
795
|
name: "circles"
|
|
785
|
-
},
|
|
796
|
+
}, va = { class: "flex-1 flex flex-col items-center" }, ya = {
|
|
786
797
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
787
798
|
name: "delivery details"
|
|
788
|
-
},
|
|
799
|
+
}, ga = { class: "flex flex-col gap-8" }, ba = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Aa = { class: "flex flex-col gap-4" }, Da = { class: "flex gap-8" }, ka = /* @__PURE__ */ je({
|
|
789
800
|
__name: "ClosingDraftDialog",
|
|
790
801
|
props: {
|
|
791
802
|
show: { type: Boolean },
|
|
@@ -793,12 +804,12 @@ const Lt = qe(
|
|
|
793
804
|
},
|
|
794
805
|
emits: ["submitted", "refresh"],
|
|
795
806
|
setup(l, { emit: o }) {
|
|
796
|
-
const e = l,
|
|
807
|
+
const e = l, c = Ze(), f = Fe(), h = Dt(e, "show"), v = E(!1), M = E(!1), d = E(!1), y = E(new Array()), B = Le(), H = Be(), O = Ue(), s = ft(), a = $e(), k = et({}), V = P(() => new Set(
|
|
797
808
|
s.skus.filter((r) => {
|
|
798
809
|
var t;
|
|
799
|
-
return
|
|
810
|
+
return k[(t = r.customAttributes) == null ? void 0 : t.tag];
|
|
800
811
|
}).map((r) => r._id)
|
|
801
|
-
)),
|
|
812
|
+
)), m = o, p = E({
|
|
802
813
|
templateItem: !0,
|
|
803
814
|
nonTemplateItem: !0
|
|
804
815
|
}), C = P(() => {
|
|
@@ -812,10 +823,10 @@ const Lt = qe(
|
|
|
812
823
|
(t) => t.sku._id,
|
|
813
824
|
(t) => t.measurementsAmounts.filter((b) => !b.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((b) => b.measurement.id)
|
|
814
825
|
));
|
|
815
|
-
|
|
826
|
+
Pe(W), tt(
|
|
816
827
|
() => e.show,
|
|
817
828
|
(r) => {
|
|
818
|
-
r && (oe.value = ne[0], W(),
|
|
829
|
+
r && (oe.value = ne[0], W(), p.value = {
|
|
819
830
|
templateItem: !0,
|
|
820
831
|
nonTemplateItem: !0
|
|
821
832
|
});
|
|
@@ -825,12 +836,12 @@ const Lt = qe(
|
|
|
825
836
|
async function W() {
|
|
826
837
|
var t, b, g;
|
|
827
838
|
if (!a._currentLocation) return;
|
|
828
|
-
|
|
839
|
+
v.value = !0;
|
|
829
840
|
const r = ((t = e.draft) == null ? void 0 : t.status) === se.enum.COMPLETED;
|
|
830
841
|
try {
|
|
831
842
|
if (await s.init(), r) {
|
|
832
|
-
const
|
|
833
|
-
if (!
|
|
843
|
+
const u = e.draft.closingAdjustmentId;
|
|
844
|
+
if (!u) {
|
|
834
845
|
O.open({
|
|
835
846
|
title: "Something went wrong",
|
|
836
847
|
message: "Closing draft is completed but closing document cannot be found.",
|
|
@@ -840,7 +851,7 @@ const Lt = qe(
|
|
|
840
851
|
});
|
|
841
852
|
return;
|
|
842
853
|
}
|
|
843
|
-
const
|
|
854
|
+
const i = await B.readAdjustmentById(u), A = (i == null ? void 0 : i.skus) ?? [];
|
|
844
855
|
y.value = A.map((j) => ({
|
|
845
856
|
id: j.sku._id,
|
|
846
857
|
balance: j.fromBalance,
|
|
@@ -848,19 +859,19 @@ const Lt = qe(
|
|
|
848
859
|
}));
|
|
849
860
|
} else
|
|
850
861
|
y.value = ((g = e.draft) == null ? void 0 : g.stockSnapshot) ?? [];
|
|
851
|
-
} catch (
|
|
862
|
+
} catch (u) {
|
|
852
863
|
O.open({
|
|
853
864
|
title: "Something went wrong",
|
|
854
865
|
message: "Something went wrong when fetching info. Please try again.",
|
|
855
866
|
type: "error"
|
|
856
|
-
}), console.error("error on fetch stock balances",
|
|
867
|
+
}), console.error("error on fetch stock balances", u);
|
|
857
868
|
} finally {
|
|
858
|
-
|
|
869
|
+
v.value = !1;
|
|
859
870
|
}
|
|
860
871
|
}
|
|
861
|
-
async function
|
|
872
|
+
async function le() {
|
|
862
873
|
var t, b;
|
|
863
|
-
if (!(((t = e.draft) == null ? void 0 : t.effectiveAt) ?? ((b = e.draft) == null ? void 0 : b.
|
|
874
|
+
if (!(((t = e.draft) == null ? void 0 : t.effectiveAt) ?? (e.draft ? Ie((b = e.draft) == null ? void 0 : b._id) : null))) {
|
|
864
875
|
O.open({
|
|
865
876
|
title: "Cannot refresh",
|
|
866
877
|
message: "Effective date is not available for this draft.",
|
|
@@ -868,20 +879,20 @@ const Lt = qe(
|
|
|
868
879
|
});
|
|
869
880
|
return;
|
|
870
881
|
}
|
|
871
|
-
await
|
|
882
|
+
await f.refreshBalance(
|
|
872
883
|
e.draft,
|
|
873
884
|
() => {
|
|
874
885
|
},
|
|
875
886
|
async (g) => {
|
|
876
887
|
var j;
|
|
877
888
|
M.value = !0;
|
|
878
|
-
const
|
|
889
|
+
const u = (j = e.draft) == null ? void 0 : j._rev, i = 30, A = 2e3;
|
|
879
890
|
try {
|
|
880
891
|
await B.recalculation.scheduleCalculateStockSnapshotAtDate(g, e.draft._id);
|
|
881
|
-
let
|
|
882
|
-
for (let te = 0; te <
|
|
892
|
+
let x = null;
|
|
893
|
+
for (let te = 0; te < i && (x = await H.getDraft(e.draft._id).delayed(A), x._rev === u); te++)
|
|
883
894
|
;
|
|
884
|
-
if (!
|
|
895
|
+
if (!x || x._rev === u) {
|
|
885
896
|
O.open({
|
|
886
897
|
title: "Refresh failed",
|
|
887
898
|
message: "Failed to refresh stock balance. Please try again.",
|
|
@@ -889,17 +900,17 @@ const Lt = qe(
|
|
|
889
900
|
}), console.error("error refreshing stock balances: there is no change in _rev");
|
|
890
901
|
return;
|
|
891
902
|
}
|
|
892
|
-
|
|
903
|
+
m("refresh", x), y.value = x.stockSnapshot ?? [], O.open({
|
|
893
904
|
title: "Balance refreshed",
|
|
894
905
|
message: "Stock balance has been recalculated.",
|
|
895
906
|
type: "success"
|
|
896
907
|
});
|
|
897
|
-
} catch (
|
|
908
|
+
} catch (x) {
|
|
898
909
|
O.open({
|
|
899
910
|
title: "Refresh failed",
|
|
900
911
|
message: "Failed to refresh stock balance. Please try again.",
|
|
901
912
|
type: "error"
|
|
902
|
-
}), console.error("error refreshing stock balances",
|
|
913
|
+
}), console.error("error refreshing stock balances", x);
|
|
903
914
|
} finally {
|
|
904
915
|
M.value = !1;
|
|
905
916
|
}
|
|
@@ -926,10 +937,10 @@ const Lt = qe(
|
|
|
926
937
|
}
|
|
927
938
|
);
|
|
928
939
|
}
|
|
929
|
-
const
|
|
940
|
+
const ce = P(() => {
|
|
930
941
|
const r = $.value.reduce((b, g) => {
|
|
931
|
-
var
|
|
932
|
-
return Math.max(b, ((
|
|
942
|
+
var u, i;
|
|
943
|
+
return Math.max(b, ((i = (u = F.value) == null ? void 0 : u.get(g._id)) == null ? void 0 : i[0].length) ?? 0);
|
|
933
944
|
}, 0);
|
|
934
945
|
return [
|
|
935
946
|
{
|
|
@@ -938,13 +949,13 @@ const Lt = qe(
|
|
|
938
949
|
header: () => "Name",
|
|
939
950
|
size: 350,
|
|
940
951
|
cell(b) {
|
|
941
|
-
const g = b.row.original,
|
|
952
|
+
const g = b.row.original, u = g.adjustedDiffPercentage, i = typeof u == "number" && Math.abs(u) > 10, A = I("div", { class: "flex flex-col gap-4" }, [
|
|
942
953
|
I(
|
|
943
954
|
"div",
|
|
944
955
|
{
|
|
945
956
|
class: [
|
|
946
957
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
947
|
-
|
|
958
|
+
i ? " text-fm-color-system-error-300" : "text-fm-color-typo-primary"
|
|
948
959
|
]
|
|
949
960
|
},
|
|
950
961
|
g.name
|
|
@@ -954,7 +965,7 @@ const Lt = qe(
|
|
|
954
965
|
{
|
|
955
966
|
class: [
|
|
956
967
|
"line-clamp-1 fm-typo-en-body-md-400",
|
|
957
|
-
|
|
968
|
+
i ? " text-fm-color-system-error-300" : "text-fm-color-typo-secondary"
|
|
958
969
|
]
|
|
959
970
|
},
|
|
960
971
|
g.code
|
|
@@ -967,7 +978,7 @@ const Lt = qe(
|
|
|
967
978
|
},
|
|
968
979
|
{
|
|
969
980
|
content() {
|
|
970
|
-
return
|
|
981
|
+
return i ? "Adjustment difference is more than 10%." : `${g.code} - ${g.name}`;
|
|
971
982
|
},
|
|
972
983
|
default() {
|
|
973
984
|
return I("div", { class: "flex items-center gap-4 justify-start w-full" }, [
|
|
@@ -1032,17 +1043,17 @@ const Lt = qe(
|
|
|
1032
1043
|
cell(b) {
|
|
1033
1044
|
const g = b.row.original.adjustedDiffPercentage;
|
|
1034
1045
|
if (!g) return "N/A";
|
|
1035
|
-
const
|
|
1036
|
-
if (
|
|
1046
|
+
const u = g.toFixed(2);
|
|
1047
|
+
if (u === "0.00")
|
|
1037
1048
|
return I("div", { class: "flex items-center gap-4 justify-end" }, ["0.00"]);
|
|
1038
|
-
const
|
|
1049
|
+
const i = g > 0;
|
|
1039
1050
|
return I("div", { class: "flex items-center gap-4 justify-end" }, [
|
|
1040
1051
|
I(de.FmIcon, {
|
|
1041
|
-
name:
|
|
1042
|
-
color:
|
|
1052
|
+
name: i ? "arrow_drop_up" : "arrow_drop_down",
|
|
1053
|
+
color: i ? "system-success-300" : "system-error-300",
|
|
1043
1054
|
size: "md"
|
|
1044
1055
|
}),
|
|
1045
|
-
|
|
1056
|
+
u
|
|
1046
1057
|
]);
|
|
1047
1058
|
},
|
|
1048
1059
|
meta: {
|
|
@@ -1054,7 +1065,7 @@ const Lt = qe(
|
|
|
1054
1065
|
header: () => "Amounts",
|
|
1055
1066
|
enableSorting: !1,
|
|
1056
1067
|
cell(b) {
|
|
1057
|
-
const g = b.row.original,
|
|
1068
|
+
const g = b.row.original, u = (A, j) => I(
|
|
1058
1069
|
de.FmTooltip,
|
|
1059
1070
|
{ zIndex: 50 },
|
|
1060
1071
|
{
|
|
@@ -1082,84 +1093,84 @@ const Lt = qe(
|
|
|
1082
1093
|
}
|
|
1083
1094
|
}
|
|
1084
1095
|
);
|
|
1085
|
-
let
|
|
1096
|
+
let i = Array.from({ length: r }).map((A, j) => {
|
|
1086
1097
|
if (!g[`measurementAmount${j}`])
|
|
1087
1098
|
return null;
|
|
1088
|
-
const
|
|
1089
|
-
return
|
|
1099
|
+
const x = g[`measurementAmount${j}`], te = g[`measurementAbbrev${j}`];
|
|
1100
|
+
return u(x, te);
|
|
1090
1101
|
}).filter((A) => A);
|
|
1091
|
-
return (g.baseUnitAmount || !
|
|
1102
|
+
return (g.baseUnitAmount || !i.length) && (i = [u(g.baseUnitAmount, g.baseUnit), ...i]), I(
|
|
1092
1103
|
"div",
|
|
1093
1104
|
{
|
|
1094
1105
|
class: "flex gap-8 flex-nowrap",
|
|
1095
1106
|
style: {
|
|
1096
|
-
minWidth: `${120 *
|
|
1107
|
+
minWidth: `${120 * i.length}px`
|
|
1097
1108
|
}
|
|
1098
1109
|
},
|
|
1099
|
-
|
|
1110
|
+
i
|
|
1100
1111
|
);
|
|
1101
1112
|
}
|
|
1102
1113
|
}
|
|
1103
1114
|
];
|
|
1104
|
-
}), Ae = P(() =>
|
|
1115
|
+
}), Ae = P(() => ce.value.map((r) => r.size ?? 0).reduce((r, t) => r + t)), ue = E(""), fe = P(() => {
|
|
1105
1116
|
var b, g;
|
|
1106
1117
|
const r = ((g = (b = e.draft) == null ? void 0 : b.negativeStockItems) == null ? void 0 : g.reduce(
|
|
1107
|
-
(
|
|
1118
|
+
(u, i) => (u[i.sku._id] = i, u),
|
|
1108
1119
|
{}
|
|
1109
1120
|
)) ?? {};
|
|
1110
|
-
return $.value.map((
|
|
1121
|
+
return $.value.map((u) => {
|
|
1111
1122
|
var he, xe;
|
|
1112
|
-
const
|
|
1113
|
-
if (!
|
|
1123
|
+
const i = (he = be.value.get(u._id)) == null ? void 0 : he[0], A = ((xe = ge.value.get(u._id)) == null ? void 0 : xe[0]) ?? X;
|
|
1124
|
+
if (!i)
|
|
1114
1125
|
return {
|
|
1115
|
-
code:
|
|
1116
|
-
name:
|
|
1117
|
-
baseUnit:
|
|
1126
|
+
code: u.code,
|
|
1127
|
+
name: u.name,
|
|
1128
|
+
baseUnit: u.unit.abbrev,
|
|
1118
1129
|
baseUnitAmount: 0,
|
|
1119
|
-
systemBalance: +
|
|
1130
|
+
systemBalance: +N(A),
|
|
1120
1131
|
physicalBalance: 0,
|
|
1121
|
-
adjustedAmount: -+
|
|
1132
|
+
adjustedAmount: -+N(A),
|
|
1122
1133
|
adjustedDiffPercentage: -100,
|
|
1123
|
-
isTemplateItem: !r[
|
|
1134
|
+
isTemplateItem: !r[u._id]
|
|
1124
1135
|
};
|
|
1125
|
-
const j =
|
|
1136
|
+
const j = Je(i), x = Ye(j, A), te = A.amount === 0 ? null : Ke(x, {
|
|
1126
1137
|
...A,
|
|
1127
1138
|
amount: Math.abs(A.amount)
|
|
1128
|
-
}), ke = te ?
|
|
1139
|
+
}), ke = te ? Me(te, J) : null;
|
|
1129
1140
|
return {
|
|
1130
|
-
code:
|
|
1131
|
-
name:
|
|
1132
|
-
baseUnit:
|
|
1133
|
-
baseUnitAmount: +
|
|
1134
|
-
...
|
|
1135
|
-
var U,
|
|
1136
|
-
return (ae = (
|
|
1137
|
-
}).reduce((
|
|
1138
|
-
systemBalance: +
|
|
1139
|
-
physicalBalance: +
|
|
1140
|
-
adjustedAmount: +
|
|
1141
|
-
adjustedDiffPercentage: ke ? +
|
|
1142
|
-
isTemplateItem: !r[
|
|
1141
|
+
code: u.code,
|
|
1142
|
+
name: u.name,
|
|
1143
|
+
baseUnit: u.unit.abbrev,
|
|
1144
|
+
baseUnitAmount: +N(i.baseAmount),
|
|
1145
|
+
...i.measurementsAmounts.filter((_) => {
|
|
1146
|
+
var U, z, ae;
|
|
1147
|
+
return (ae = (z = (U = F.value) == null ? void 0 : U.get(u._id)) == null ? void 0 : z[0]) == null ? void 0 : ae.includes(_.measurement.id);
|
|
1148
|
+
}).reduce((_, U, z) => (_[`measurementAbbrev${z}`] = `(${U.measurement.abbrev}) × ${N(U.measurement.conversion)}`, _[`measurementAmount${z}`] = +N(U.amount), _), {}),
|
|
1149
|
+
systemBalance: +N(A),
|
|
1150
|
+
physicalBalance: +N(j),
|
|
1151
|
+
adjustedAmount: +N(x),
|
|
1152
|
+
adjustedDiffPercentage: ke ? +N(Ge(ke, 2)) : null,
|
|
1153
|
+
isTemplateItem: !r[u._id]
|
|
1143
1154
|
};
|
|
1144
|
-
}).filter((
|
|
1155
|
+
}).filter((u) => !!(u.isTemplateItem && p.value.templateItem || !u.isTemplateItem && p.value.nonTemplateItem));
|
|
1145
1156
|
}), De = P(() => {
|
|
1146
|
-
var t, b, g;
|
|
1157
|
+
var t, b, g, u;
|
|
1147
1158
|
if (!e.draft) return [];
|
|
1148
1159
|
const r = e.draft.approvedAt ? {
|
|
1149
|
-
action: `Approve at ${
|
|
1160
|
+
action: `Approve at ${re(e.draft.approvedAt)}`,
|
|
1150
1161
|
// actionAt: props.draft.approvedAt,
|
|
1151
1162
|
actionBy: e.draft.approvedBy,
|
|
1152
1163
|
remark: e.draft.approveRemark
|
|
1153
|
-
} : (t = e.draft.rejectionHistory) == null ? void 0 : t.computeFirst((
|
|
1154
|
-
action: `Reject at ${
|
|
1164
|
+
} : (t = e.draft.rejectionHistory) == null ? void 0 : t.computeFirst((i) => ({
|
|
1165
|
+
action: `Reject at ${re(i.rejectedAt)}`,
|
|
1155
1166
|
// actionAt: e.rejectedAt,
|
|
1156
|
-
actionBy:
|
|
1157
|
-
remark:
|
|
1167
|
+
actionBy: i.rejectedBy,
|
|
1168
|
+
remark: i.rejectRemark
|
|
1158
1169
|
}));
|
|
1159
1170
|
return [
|
|
1160
1171
|
{
|
|
1161
1172
|
label: "Created at",
|
|
1162
|
-
value:
|
|
1173
|
+
value: re(e.draft.createdAt)
|
|
1163
1174
|
},
|
|
1164
1175
|
{
|
|
1165
1176
|
label: "Created by",
|
|
@@ -1167,7 +1178,7 @@ const Lt = qe(
|
|
|
1167
1178
|
},
|
|
1168
1179
|
{
|
|
1169
1180
|
label: "Updated at",
|
|
1170
|
-
value:
|
|
1181
|
+
value: re(e.draft.updatedAt)
|
|
1171
1182
|
},
|
|
1172
1183
|
{
|
|
1173
1184
|
label: "Updated by",
|
|
@@ -1175,11 +1186,11 @@ const Lt = qe(
|
|
|
1175
1186
|
},
|
|
1176
1187
|
{
|
|
1177
1188
|
label: "Effective at",
|
|
1178
|
-
value:
|
|
1189
|
+
value: re(e.draft.effectiveAt ?? Ie((b = e.draft) == null ? void 0 : b._id))
|
|
1179
1190
|
},
|
|
1180
1191
|
{
|
|
1181
1192
|
label: "Using template",
|
|
1182
|
-
value: ((
|
|
1193
|
+
value: ((g = e.draft.usingTemplates.find((i) => i)) == null ? void 0 : g.name) ?? "None"
|
|
1183
1194
|
},
|
|
1184
1195
|
e.draft.remark ? {
|
|
1185
1196
|
label: "Remark",
|
|
@@ -1191,13 +1202,13 @@ const Lt = qe(
|
|
|
1191
1202
|
} : null,
|
|
1192
1203
|
r && r.actionBy ? {
|
|
1193
1204
|
label: "Last action by",
|
|
1194
|
-
value: (
|
|
1205
|
+
value: (u = r.actionBy) == null ? void 0 : u.name
|
|
1195
1206
|
} : null,
|
|
1196
1207
|
r && r.remark ? {
|
|
1197
1208
|
label: "Action remark",
|
|
1198
1209
|
value: r.remark
|
|
1199
1210
|
} : null
|
|
1200
|
-
].filter((
|
|
1211
|
+
].filter((i) => i).map((i) => i);
|
|
1201
1212
|
}), ne = [
|
|
1202
1213
|
{
|
|
1203
1214
|
label: "Overview",
|
|
@@ -1208,21 +1219,21 @@ const Lt = qe(
|
|
|
1208
1219
|
value: "history"
|
|
1209
1220
|
}
|
|
1210
1221
|
], oe = E(ne[0]), ee = P(() => {
|
|
1211
|
-
var g,
|
|
1212
|
-
const r = ((g = e.draft) == null ? void 0 : g.activityLogs) ?? [], t = ((
|
|
1222
|
+
var g, u, i;
|
|
1223
|
+
const r = ((g = e.draft) == null ? void 0 : g.activityLogs) ?? [], t = ((u = e.draft) == null ? void 0 : u.rejectionHistory) ?? [];
|
|
1213
1224
|
for (const A of t)
|
|
1214
1225
|
r.find(
|
|
1215
|
-
(
|
|
1226
|
+
(x) => `${x.action}_${x.performedAt}` == `${L.enum.rejectDraft}_${A.rejectedAt}`
|
|
1216
1227
|
) || r.push({
|
|
1217
1228
|
action: L.enum.rejectDraft,
|
|
1218
1229
|
performedAt: A.rejectedAt,
|
|
1219
1230
|
performedBy: A.rejectedBy,
|
|
1220
1231
|
remark: A.rejectRemark
|
|
1221
1232
|
});
|
|
1222
|
-
return (
|
|
1233
|
+
return (i = e.draft) != null && i.approvedAt && (r.find(
|
|
1223
1234
|
(j) => {
|
|
1224
|
-
var
|
|
1225
|
-
return `${j.action}_${j.performedAt}` == `${L.enum.approveDraft}_${(
|
|
1235
|
+
var x;
|
|
1236
|
+
return `${j.action}_${j.performedAt}` == `${L.enum.approveDraft}_${(x = e.draft) == null ? void 0 : x.approvedAt}`;
|
|
1226
1237
|
}
|
|
1227
1238
|
) || r.push({
|
|
1228
1239
|
action: L.enum.approveDraft,
|
|
@@ -1231,8 +1242,8 @@ const Lt = qe(
|
|
|
1231
1242
|
remark: e.draft.approveRemark
|
|
1232
1243
|
})), r.sort((A, j) => new Date(j.performedAt).getTime() - new Date(A.performedAt).getTime()).map(
|
|
1233
1244
|
(A) => ({
|
|
1234
|
-
header:
|
|
1235
|
-
date:
|
|
1245
|
+
header: Re(A.action),
|
|
1246
|
+
date: re(A.performedAt),
|
|
1236
1247
|
info: [
|
|
1237
1248
|
{
|
|
1238
1249
|
label: "Performed by",
|
|
@@ -1246,30 +1257,30 @@ const Lt = qe(
|
|
|
1246
1257
|
})
|
|
1247
1258
|
);
|
|
1248
1259
|
}), pe = P(() => {
|
|
1249
|
-
var
|
|
1250
|
-
if ((
|
|
1251
|
-
if (((
|
|
1252
|
-
const r = fe.value.some((
|
|
1260
|
+
var u, i, A, j;
|
|
1261
|
+
if ((u = e == null ? void 0 : e.draft) != null && u.approvedAt) return "Draft is already approved.";
|
|
1262
|
+
if (((i = e.draft) == null ? void 0 : i.status) !== se.enum.DRAFT) return "Status is not draft.";
|
|
1263
|
+
const r = fe.value.some((x) => x.physicalBalance < 0), t = ((j = (A = c.stockBalance.skus) == null ? void 0 : A.filter((x) => x.balance.amount < 0)) == null ? void 0 : j.map((x) => x.id)) ?? [], b = new Set($.value.map((x) => x._id)), g = t.filter((x) => !b.has(x)).length;
|
|
1253
1264
|
return [
|
|
1254
1265
|
r ? "Negative total exist." : null,
|
|
1255
1266
|
g ? "Negative stock is not included in this draft. Reopen draft in POS and apply changes." : null
|
|
1256
|
-
].filter((
|
|
1267
|
+
].filter((x) => x).join(" ");
|
|
1257
1268
|
});
|
|
1258
1269
|
return (r, t) => {
|
|
1259
|
-
const b = T("FmButtonGroup"), g = T("FmMenuDivider"),
|
|
1260
|
-
return
|
|
1270
|
+
const b = T("FmButtonGroup"), g = T("FmMenuDivider"), u = T("FmCard"), i = T("FmButton"), A = T("FmCircularProgress"), j = T("FmChip"), x = T("FmTextField"), te = T("FmIcon"), ke = T("FmTable"), _e = T("FmSpacer"), he = T("FmTooltip"), xe = T("FmSideSheet");
|
|
1271
|
+
return w(), Z(xe, {
|
|
1261
1272
|
"dismiss-away": "",
|
|
1262
1273
|
"max-width": 9999,
|
|
1263
|
-
"model-value": S(
|
|
1264
|
-
"onUpdate:modelValue": t[10] || (t[10] = (
|
|
1274
|
+
"model-value": S(h),
|
|
1275
|
+
"onUpdate:modelValue": t[10] || (t[10] = (_) => Ve(h) ? h.value = _ : null),
|
|
1265
1276
|
header: "Closing details"
|
|
1266
1277
|
}, {
|
|
1267
1278
|
"side-sheet-footer": Y(() => {
|
|
1268
|
-
var
|
|
1279
|
+
var _, U, z, ae;
|
|
1269
1280
|
return [
|
|
1270
|
-
n("div",
|
|
1271
|
-
((
|
|
1272
|
-
pe.value ? (
|
|
1281
|
+
n("div", Da, [
|
|
1282
|
+
((_ = e.draft) == null ? void 0 : _.status) === S(se).enum.DRAFT ? (w(), R(q, { key: 0 }, [
|
|
1283
|
+
pe.value ? (w(), Z(he, {
|
|
1273
1284
|
key: 0,
|
|
1274
1285
|
"z-index": 51
|
|
1275
1286
|
}, {
|
|
@@ -1277,90 +1288,90 @@ const Lt = qe(
|
|
|
1277
1288
|
G(K(pe.value), 1)
|
|
1278
1289
|
]),
|
|
1279
1290
|
default: Y(() => [
|
|
1280
|
-
D(
|
|
1291
|
+
D(i, {
|
|
1281
1292
|
disabled: "",
|
|
1282
1293
|
key: "approve key",
|
|
1283
1294
|
label: "Approve",
|
|
1284
|
-
onClick: t[5] || (t[5] = () => e.draft && S(
|
|
1295
|
+
onClick: t[5] || (t[5] = () => e.draft && S(f).approveDraft(e.draft, () => m("submitted")))
|
|
1285
1296
|
})
|
|
1286
1297
|
]),
|
|
1287
1298
|
_: 1
|
|
1288
|
-
})) : (
|
|
1299
|
+
})) : (w(), Z(i, {
|
|
1289
1300
|
key: "approve key",
|
|
1290
1301
|
label: "Approve",
|
|
1291
|
-
onClick: t[6] || (t[6] = () => e.draft && S(
|
|
1302
|
+
onClick: t[6] || (t[6] = () => e.draft && S(f).approveDraft(e.draft, () => m("submitted")))
|
|
1292
1303
|
}))
|
|
1293
1304
|
], 64)) : Q("", !0),
|
|
1294
|
-
((U = e.draft) == null ? void 0 : U.status) === S(se).enum.DRAFT ? (
|
|
1305
|
+
((U = e.draft) == null ? void 0 : U.status) === S(se).enum.DRAFT ? (w(), Z(i, {
|
|
1295
1306
|
key: 1,
|
|
1296
1307
|
label: "Reject",
|
|
1297
1308
|
variant: "destructive",
|
|
1298
|
-
onClick: t[7] || (t[7] = () => e.draft && S(
|
|
1309
|
+
onClick: t[7] || (t[7] = () => e.draft && S(f).rejectDraft(e.draft, () => m("submitted")))
|
|
1299
1310
|
})) : Q("", !0),
|
|
1300
|
-
(
|
|
1311
|
+
(z = e.draft) != null && z.approvedAt && ((ae = e.draft) == null ? void 0 : ae.status) !== S(se).enum.COMPLETED ? (w(), Z(i, {
|
|
1301
1312
|
key: 2,
|
|
1302
1313
|
label: "Sync",
|
|
1303
|
-
loading:
|
|
1314
|
+
loading: d.value,
|
|
1304
1315
|
onClick: t[8] || (t[8] = () => {
|
|
1305
|
-
e.draft && (
|
|
1306
|
-
|
|
1316
|
+
e.draft && (d.value = !0, S(f).syncDraft(e.draft, () => {
|
|
1317
|
+
d.value = !1, m("submitted");
|
|
1307
1318
|
}));
|
|
1308
1319
|
})
|
|
1309
1320
|
}, null, 8, ["loading"])) : Q("", !0),
|
|
1310
|
-
D(
|
|
1321
|
+
D(i, {
|
|
1311
1322
|
label: "Close",
|
|
1312
1323
|
variant: "tertiary",
|
|
1313
|
-
onClick: t[9] || (t[9] = (
|
|
1324
|
+
onClick: t[9] || (t[9] = (Ee) => h.value = !1)
|
|
1314
1325
|
})
|
|
1315
1326
|
])
|
|
1316
1327
|
];
|
|
1317
1328
|
}),
|
|
1318
1329
|
default: Y(() => [
|
|
1319
|
-
n("div",
|
|
1330
|
+
n("div", Ht, [
|
|
1320
1331
|
n("div", null, [
|
|
1321
1332
|
D(b, {
|
|
1322
1333
|
items: ne,
|
|
1323
1334
|
modelValue: oe.value,
|
|
1324
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
1335
|
+
"onUpdate:modelValue": t[0] || (t[0] = (_) => oe.value = _)
|
|
1325
1336
|
}, null, 8, ["modelValue"])
|
|
1326
1337
|
]),
|
|
1327
|
-
oe.value.value === "overview" ? (
|
|
1328
|
-
D(
|
|
1338
|
+
oe.value.value === "overview" ? (w(), R(q, { key: 0 }, [
|
|
1339
|
+
D(u, {
|
|
1329
1340
|
variant: "outlined",
|
|
1330
1341
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
1331
1342
|
}, {
|
|
1332
1343
|
default: Y(() => {
|
|
1333
|
-
var
|
|
1344
|
+
var _, U;
|
|
1334
1345
|
return [
|
|
1335
|
-
n("div",
|
|
1346
|
+
n("div", Vt, [
|
|
1336
1347
|
t[11] || (t[11] = n("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
|
|
1337
|
-
n("div",
|
|
1348
|
+
n("div", zt, [
|
|
1338
1349
|
n("div", {
|
|
1339
|
-
class: me(["fm-status-badge", S(Se)(((
|
|
1340
|
-
}, K(S(
|
|
1350
|
+
class: me(["fm-status-badge", S(Se)(((_ = r.draft) == null ? void 0 : _.status) ?? "DRAFT")])
|
|
1351
|
+
}, K(S(Re)(((U = r.draft) == null ? void 0 : U.status) ?? "")), 3)
|
|
1341
1352
|
])
|
|
1342
1353
|
]),
|
|
1343
1354
|
D(g),
|
|
1344
1355
|
n("div", Nt, [
|
|
1345
|
-
(
|
|
1356
|
+
(w(!0), R(q, null, ve(De.value, (z, ae) => (w(), R("div", {
|
|
1346
1357
|
class: "flex flex-col gap-4",
|
|
1347
1358
|
key: ae
|
|
1348
1359
|
}, [
|
|
1349
|
-
n("div",
|
|
1350
|
-
n("div",
|
|
1360
|
+
n("div", Ot, [
|
|
1361
|
+
n("div", Yt, K(z.label), 1)
|
|
1351
1362
|
]),
|
|
1352
|
-
n("div",
|
|
1363
|
+
n("div", Kt, K(z.value), 1)
|
|
1353
1364
|
]))), 128))
|
|
1354
1365
|
])
|
|
1355
1366
|
];
|
|
1356
1367
|
}),
|
|
1357
1368
|
_: 1
|
|
1358
1369
|
}),
|
|
1359
|
-
n("div",
|
|
1360
|
-
n("div",
|
|
1370
|
+
n("div", Gt, [
|
|
1371
|
+
n("div", qt, [
|
|
1361
1372
|
t[12] || (t[12] = n("div", { class: "flex-1 fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Closing items ", -1)),
|
|
1362
|
-
|
|
1363
|
-
r.draft && r.draft.status !== S(se).enum.COMPLETED ? (
|
|
1373
|
+
v.value ? Q("", !0) : (w(), R("div", Wt, [
|
|
1374
|
+
r.draft && r.draft.status !== S(se).enum.COMPLETED ? (w(), Z(i, {
|
|
1364
1375
|
key: 0,
|
|
1365
1376
|
label: "Refresh balance",
|
|
1366
1377
|
"prepend-icon": "refresh",
|
|
@@ -1369,58 +1380,58 @@ const Lt = qe(
|
|
|
1369
1380
|
"bg-color": "transparent",
|
|
1370
1381
|
"border-color": "primary",
|
|
1371
1382
|
loading: M.value,
|
|
1372
|
-
onClick:
|
|
1383
|
+
onClick: le
|
|
1373
1384
|
}, null, 8, ["loading"])) : Q("", !0),
|
|
1374
|
-
D(
|
|
1385
|
+
D(i, {
|
|
1375
1386
|
label: "Export data",
|
|
1376
1387
|
"prepend-icon": "download",
|
|
1377
1388
|
variant: "secondary",
|
|
1378
1389
|
"text-color": "primary",
|
|
1379
1390
|
"bg-color": "transparent",
|
|
1380
1391
|
"border-color": "primary",
|
|
1381
|
-
onClick: t[1] || (t[1] = (
|
|
1392
|
+
onClick: t[1] || (t[1] = (_) => r.draft ? S(f).exportDraft(r.draft, y.value) : null)
|
|
1382
1393
|
})
|
|
1383
1394
|
]))
|
|
1384
1395
|
]),
|
|
1385
|
-
|
|
1396
|
+
v.value ? (w(), R("div", Zt, [
|
|
1386
1397
|
t[14] || (t[14] = n("div", { class: "h-80" }, null, -1)),
|
|
1387
|
-
n("div",
|
|
1398
|
+
n("div", Jt, [
|
|
1388
1399
|
n("div", null, [
|
|
1389
1400
|
D(A, { size: "md" })
|
|
1390
1401
|
]),
|
|
1391
1402
|
t[13] || (t[13] = n("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fetching info... ", -1))
|
|
1392
1403
|
]),
|
|
1393
1404
|
t[15] || (t[15] = n("div", { class: "h-80" }, null, -1))
|
|
1394
|
-
])) : (
|
|
1395
|
-
n("div",
|
|
1396
|
-
n("div",
|
|
1405
|
+
])) : (w(), R(q, { key: 1 }, [
|
|
1406
|
+
n("div", Qt, [
|
|
1407
|
+
n("div", Xt, [
|
|
1397
1408
|
D(j, {
|
|
1398
1409
|
label: "Template Item(s)",
|
|
1399
|
-
selected:
|
|
1400
|
-
onClick: t[2] || (t[2] = (
|
|
1410
|
+
selected: p.value.templateItem,
|
|
1411
|
+
onClick: t[2] || (t[2] = (_) => p.value.templateItem = !p.value.templateItem)
|
|
1401
1412
|
}, null, 8, ["selected"]),
|
|
1402
1413
|
D(j, {
|
|
1403
1414
|
label: "Non-template Item(s)",
|
|
1404
|
-
selected:
|
|
1405
|
-
onClick: t[3] || (t[3] = (
|
|
1415
|
+
selected: p.value.nonTemplateItem,
|
|
1416
|
+
onClick: t[3] || (t[3] = (_) => p.value.nonTemplateItem = !p.value.nonTemplateItem)
|
|
1406
1417
|
}, null, 8, ["selected"])
|
|
1407
1418
|
]),
|
|
1408
|
-
D(
|
|
1419
|
+
D(x, {
|
|
1409
1420
|
modelValue: ue.value,
|
|
1410
|
-
"onUpdate:modelValue": t[4] || (t[4] = (
|
|
1421
|
+
"onUpdate:modelValue": t[4] || (t[4] = (_) => ue.value = _),
|
|
1411
1422
|
placeholder: "Filter items"
|
|
1412
1423
|
}, null, 8, ["modelValue"])
|
|
1413
1424
|
]),
|
|
1414
|
-
S(s).skuTags.size ? (
|
|
1415
|
-
(
|
|
1416
|
-
key: `${
|
|
1417
|
-
label: `${
|
|
1425
|
+
S(s).skuTags.size ? (w(), R("div", ea, [
|
|
1426
|
+
(w(!0), R(q, null, ve(S(s).skuTags.keys(), (_) => (w(), Z(j, {
|
|
1427
|
+
key: `${_}`,
|
|
1428
|
+
label: `${_}`,
|
|
1418
1429
|
selectable: "",
|
|
1419
|
-
selected:
|
|
1420
|
-
onClick: (U) =>
|
|
1430
|
+
selected: k[`${_}`],
|
|
1431
|
+
onClick: (U) => k[`${_}`] = !k[`${_}`]
|
|
1421
1432
|
}, {
|
|
1422
1433
|
default: Y(() => [
|
|
1423
|
-
|
|
1434
|
+
k[`${_}`] ? (w(), Z(te, {
|
|
1424
1435
|
key: 0,
|
|
1425
1436
|
name: "check",
|
|
1426
1437
|
class: "text-white",
|
|
@@ -1430,21 +1441,21 @@ const Lt = qe(
|
|
|
1430
1441
|
class: me([
|
|
1431
1442
|
"",
|
|
1432
1443
|
{
|
|
1433
|
-
"text-white fm-typo-en-body-md-600":
|
|
1434
|
-
"text-fm-color-typo-primary fm-typo-en-body-md-400": !
|
|
1444
|
+
"text-white fm-typo-en-body-md-600": k[`${_}`],
|
|
1445
|
+
"text-fm-color-typo-primary fm-typo-en-body-md-400": !k[`${_}`]
|
|
1435
1446
|
}
|
|
1436
1447
|
])
|
|
1437
|
-
}, K(
|
|
1448
|
+
}, K(_), 3)
|
|
1438
1449
|
]),
|
|
1439
1450
|
_: 2
|
|
1440
1451
|
}, 1032, ["label", "selected", "onClick"]))), 128))
|
|
1441
1452
|
])) : Q("", !0),
|
|
1442
|
-
n("div",
|
|
1453
|
+
n("div", ta, [
|
|
1443
1454
|
n("div", {
|
|
1444
|
-
style:
|
|
1455
|
+
style: ze({ minWidth: `${Ae.value}px` })
|
|
1445
1456
|
}, [
|
|
1446
1457
|
D(ke, {
|
|
1447
|
-
"column-defs":
|
|
1458
|
+
"column-defs": ce.value,
|
|
1448
1459
|
"row-data": fe.value,
|
|
1449
1460
|
"search-value": ue.value
|
|
1450
1461
|
}, null, 8, ["column-defs", "row-data", "search-value"])
|
|
@@ -1453,12 +1464,12 @@ const Lt = qe(
|
|
|
1453
1464
|
], 64))
|
|
1454
1465
|
])
|
|
1455
1466
|
], 64)) : Q("", !0),
|
|
1456
|
-
oe.value.value === "history" ? (
|
|
1457
|
-
ee.value.length ? (
|
|
1458
|
-
(
|
|
1459
|
-
n("div",
|
|
1460
|
-
n("div",
|
|
1461
|
-
n("div",
|
|
1467
|
+
oe.value.value === "history" ? (w(), R("div", aa, [
|
|
1468
|
+
ee.value.length ? (w(), R("div", sa, [
|
|
1469
|
+
(w(!0), R(q, null, ve(ee.value, (_, U) => (w(), R(q, { key: U }, [
|
|
1470
|
+
n("div", ra, [
|
|
1471
|
+
n("div", la, [
|
|
1472
|
+
n("div", ca, [
|
|
1462
1473
|
n("div", {
|
|
1463
1474
|
class: me([
|
|
1464
1475
|
{
|
|
@@ -1470,7 +1481,7 @@ const Lt = qe(
|
|
|
1470
1481
|
}, null, 2)
|
|
1471
1482
|
]),
|
|
1472
1483
|
t[18] || (t[18] = n("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
1473
|
-
n("div",
|
|
1484
|
+
n("div", ia, [
|
|
1474
1485
|
n("div", {
|
|
1475
1486
|
class: me([
|
|
1476
1487
|
{
|
|
@@ -1482,14 +1493,14 @@ const Lt = qe(
|
|
|
1482
1493
|
}, null, 2)
|
|
1483
1494
|
])
|
|
1484
1495
|
]),
|
|
1485
|
-
n("div",
|
|
1486
|
-
n("div",
|
|
1487
|
-
n("div",
|
|
1496
|
+
n("div", ua, [
|
|
1497
|
+
n("div", da, K(_.header), 1),
|
|
1498
|
+
n("div", ma, K(_.date), 1)
|
|
1488
1499
|
])
|
|
1489
1500
|
]),
|
|
1490
|
-
n("div",
|
|
1491
|
-
n("div",
|
|
1492
|
-
n("div",
|
|
1501
|
+
n("div", fa, [
|
|
1502
|
+
n("div", pa, [
|
|
1503
|
+
n("div", va, [
|
|
1493
1504
|
n("div", {
|
|
1494
1505
|
class: me([
|
|
1495
1506
|
{
|
|
@@ -1501,23 +1512,23 @@ const Lt = qe(
|
|
|
1501
1512
|
}, null, 2)
|
|
1502
1513
|
])
|
|
1503
1514
|
]),
|
|
1504
|
-
n("div",
|
|
1505
|
-
D(
|
|
1515
|
+
n("div", ya, [
|
|
1516
|
+
D(u, {
|
|
1506
1517
|
variant: "outlined",
|
|
1507
1518
|
class: "py-12 px-16"
|
|
1508
1519
|
}, {
|
|
1509
1520
|
default: Y(() => [
|
|
1510
|
-
n("div",
|
|
1511
|
-
(
|
|
1521
|
+
n("div", ga, [
|
|
1522
|
+
(w(!0), R(q, null, ve(_.info, (z, ae) => (w(), R("div", {
|
|
1512
1523
|
key: ae,
|
|
1513
1524
|
class: "flex flex-col gap-4"
|
|
1514
1525
|
}, [
|
|
1515
|
-
n("div",
|
|
1516
|
-
n("div",
|
|
1517
|
-
(
|
|
1518
|
-
key:
|
|
1526
|
+
n("div", ba, K(z == null ? void 0 : z.label), 1),
|
|
1527
|
+
n("div", Aa, [
|
|
1528
|
+
(w(!0), R(q, null, ve(z == null ? void 0 : z.values, (Ee, Xe) => (w(), R("div", {
|
|
1529
|
+
key: Xe,
|
|
1519
1530
|
class: "fm-typo-en-body-lg-600"
|
|
1520
|
-
}, K(
|
|
1531
|
+
}, K(Ee), 1))), 128))
|
|
1521
1532
|
])
|
|
1522
1533
|
]))), 128))
|
|
1523
1534
|
])
|
|
@@ -1527,13 +1538,13 @@ const Lt = qe(
|
|
|
1527
1538
|
])
|
|
1528
1539
|
])
|
|
1529
1540
|
], 64))), 128))
|
|
1530
|
-
])) : (
|
|
1541
|
+
])) : (w(), R("div", na, [
|
|
1531
1542
|
D(_e),
|
|
1532
1543
|
n("div", null, [
|
|
1533
1544
|
n("img", {
|
|
1534
|
-
src: S(
|
|
1545
|
+
src: S(ht),
|
|
1535
1546
|
alt: "List is empty"
|
|
1536
|
-
}, null, 8,
|
|
1547
|
+
}, null, 8, oa)
|
|
1537
1548
|
]),
|
|
1538
1549
|
t[16] || (t[16] = n("div", { class: "fm-typo-en-body-lg-600" }, K("No records found"), -1)),
|
|
1539
1550
|
t[17] || (t[17] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, K("You can track approval and rejection history here"), -1)),
|
|
@@ -1547,22 +1558,22 @@ const Lt = qe(
|
|
|
1547
1558
|
}, 8, ["model-value"]);
|
|
1548
1559
|
};
|
|
1549
1560
|
}
|
|
1550
|
-
}),
|
|
1561
|
+
}), _a = { class: "flex-1 flex flex-col gap-8" }, ha = { class: "flex flex-col" }, xa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wa = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Ca = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Sa = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Pa = /* @__PURE__ */ je({
|
|
1551
1562
|
__name: "ClosingDraftView",
|
|
1552
1563
|
setup(l) {
|
|
1553
|
-
const { t: o } =
|
|
1554
|
-
|
|
1555
|
-
const y = P(() =>
|
|
1564
|
+
const { t: o } = qe(), { viewDraft: e } = Fe(), { viewClosingDraftProps: c, viewClosingDraftShow: f } = _t(Fe()), h = $e(), v = Et(), M = pt(), { breakpoints: d } = kt();
|
|
1565
|
+
h.watchLocation(v.fetchDrafts);
|
|
1566
|
+
const y = P(() => v.loading), B = E(""), H = P(() => d.value.xs || d.value.sm), O = P(() => H.value ? 10 : 20);
|
|
1556
1567
|
function s(V) {
|
|
1557
1568
|
switch (V) {
|
|
1558
1569
|
case "refresh":
|
|
1559
|
-
return
|
|
1570
|
+
return v.fetchDrafts();
|
|
1560
1571
|
}
|
|
1561
1572
|
}
|
|
1562
1573
|
function a(V) {
|
|
1563
1574
|
return V;
|
|
1564
1575
|
}
|
|
1565
|
-
const
|
|
1576
|
+
const k = P(() => H.value ? [
|
|
1566
1577
|
{
|
|
1567
1578
|
label: o("inventory.common.refresh"),
|
|
1568
1579
|
value: "refresh",
|
|
@@ -1575,12 +1586,12 @@ const Lt = qe(
|
|
|
1575
1586
|
isPrimary: !1
|
|
1576
1587
|
}
|
|
1577
1588
|
]);
|
|
1578
|
-
return (V,
|
|
1579
|
-
const
|
|
1580
|
-
return
|
|
1581
|
-
D(
|
|
1589
|
+
return (V, m) => {
|
|
1590
|
+
const p = T("FmTable");
|
|
1591
|
+
return w(), R(q, null, [
|
|
1592
|
+
D(vt, {
|
|
1582
1593
|
title: S(o)("inventory.closing.draft.title"),
|
|
1583
|
-
actions:
|
|
1594
|
+
actions: k.value,
|
|
1584
1595
|
"onClick:action": s
|
|
1585
1596
|
}, {
|
|
1586
1597
|
default: Y(() => [
|
|
@@ -1593,48 +1604,48 @@ const Lt = qe(
|
|
|
1593
1604
|
}
|
|
1594
1605
|
])
|
|
1595
1606
|
}, [
|
|
1596
|
-
D(
|
|
1607
|
+
D(yt, {
|
|
1597
1608
|
"change-location": "",
|
|
1598
1609
|
searchable: "",
|
|
1599
1610
|
search: B.value,
|
|
1600
|
-
"onUpdate:search":
|
|
1611
|
+
"onUpdate:search": m[0] || (m[0] = (C) => B.value = C)
|
|
1601
1612
|
}, null, 8, ["search"]),
|
|
1602
|
-
D(
|
|
1603
|
-
style:
|
|
1604
|
-
"column-defs": S(
|
|
1605
|
-
"row-data": S(
|
|
1613
|
+
D(p, {
|
|
1614
|
+
style: ze(S(M).tableHeight),
|
|
1615
|
+
"column-defs": S(v).columnDefs,
|
|
1616
|
+
"row-data": S(v).drafts,
|
|
1606
1617
|
"search-value": B.value,
|
|
1607
1618
|
loading: y.value,
|
|
1608
|
-
onRowClick:
|
|
1619
|
+
onRowClick: m[1] || (m[1] = (C) => S(e)(C.original)),
|
|
1609
1620
|
"page-size": O.value
|
|
1610
1621
|
}, {
|
|
1611
1622
|
"list-row": Y((C) => [
|
|
1612
|
-
D(
|
|
1623
|
+
D(gt, {
|
|
1613
1624
|
row: C,
|
|
1614
1625
|
onRowClick: ($) => S(e)($)
|
|
1615
1626
|
}, {
|
|
1616
1627
|
default: Y(($) => {
|
|
1617
|
-
var F, X, J, W,
|
|
1628
|
+
var F, X, J, W, le, ge, be, ie, ce, Ae, ue, fe, De, ne, oe, ee, pe, r, t, b;
|
|
1618
1629
|
return [
|
|
1619
|
-
n("div",
|
|
1620
|
-
n("div",
|
|
1621
|
-
n("div",
|
|
1630
|
+
n("div", _a, [
|
|
1631
|
+
n("div", ha, [
|
|
1632
|
+
n("div", xa, [
|
|
1622
1633
|
D(S(Ce), {
|
|
1623
1634
|
render: (J = (X = (F = $._id) == null ? void 0 : F.column) == null ? void 0 : X.columnDef) == null ? void 0 : J.cell,
|
|
1624
|
-
props: (
|
|
1635
|
+
props: (le = (W = $._id) == null ? void 0 : W.getContext) == null ? void 0 : le.call(W)
|
|
1625
1636
|
}, null, 8, ["render", "props"])
|
|
1626
1637
|
]),
|
|
1627
|
-
n("div",
|
|
1638
|
+
n("div", wa, [
|
|
1628
1639
|
D(S(Ce), {
|
|
1629
1640
|
render: (ie = (be = (ge = $.name) == null ? void 0 : ge.column) == null ? void 0 : be.columnDef) == null ? void 0 : ie.cell,
|
|
1630
|
-
props: (Ae = (
|
|
1641
|
+
props: (Ae = (ce = $.name) == null ? void 0 : ce.getContext) == null ? void 0 : Ae.call(ce)
|
|
1631
1642
|
}, null, 8, ["render", "props"])
|
|
1632
1643
|
]),
|
|
1633
|
-
n("div",
|
|
1644
|
+
n("div", Ca, K([
|
|
1634
1645
|
...C.original.items.slice(0, 3).map((g) => g.sku.name),
|
|
1635
1646
|
...C.original.items.length >= 3 ? [`and ${C.original.items.length - 3} more items`] : []
|
|
1636
1647
|
].join(", ")), 1),
|
|
1637
|
-
n("div",
|
|
1648
|
+
n("div", Sa, [
|
|
1638
1649
|
D(S(Ce), {
|
|
1639
1650
|
render: (De = (fe = (ue = $.ref) == null ? void 0 : ue.column) == null ? void 0 : fe.columnDef) == null ? void 0 : De.cell,
|
|
1640
1651
|
props: (oe = (ne = $.ref) == null ? void 0 : ne.getContext) == null ? void 0 : oe.call(ne)
|
|
@@ -1659,12 +1670,12 @@ const Lt = qe(
|
|
|
1659
1670
|
]),
|
|
1660
1671
|
_: 1
|
|
1661
1672
|
}, 8, ["title", "actions"]),
|
|
1662
|
-
(
|
|
1663
|
-
D(
|
|
1664
|
-
show: S(
|
|
1665
|
-
"onUpdate:show":
|
|
1666
|
-
onSubmitted:
|
|
1667
|
-
onRefresh:
|
|
1673
|
+
(w(), Z(at, { to: "body" }, [
|
|
1674
|
+
D(ka, nt(S(c), {
|
|
1675
|
+
show: S(f),
|
|
1676
|
+
"onUpdate:show": m[2] || (m[2] = (C) => Ve(f) ? f.value = C : null),
|
|
1677
|
+
onSubmitted: m[3] || (m[3] = () => (f.value = !1, S(v).fetchDrafts())),
|
|
1678
|
+
onRefresh: m[4] || (m[4] = (C) => S(v).updateDraftRef(C))
|
|
1668
1679
|
}), null, 16, ["show"])
|
|
1669
1680
|
]))
|
|
1670
1681
|
], 64);
|
|
@@ -1672,5 +1683,5 @@ const Lt = qe(
|
|
|
1672
1683
|
}
|
|
1673
1684
|
});
|
|
1674
1685
|
export {
|
|
1675
|
-
|
|
1686
|
+
Pa as default
|
|
1676
1687
|
};
|