@feedmepos/mf-inventory-portal 0.0.25-dev.16 → 0.0.25-dev.17
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-Crqni2j1.js → App-7ReqlqA4.js} +2 -2
- package/dist/{ApprovalView-BRuPqlFf.js → ApprovalView-qAV_1bug.js} +2 -2
- package/dist/{BindingsDialog-CTnuKRLu.js → BindingsDialog-D8KPqrv8.js} +2 -2
- package/dist/{BindingsPicker-2Q_4Hswl.js → BindingsPicker-BnnpoQfF.js} +1 -1
- package/dist/{BindingsTable-Ckg2d48O.js → BindingsTable-Dnc5yg5v.js} +1 -1
- package/dist/{ClosingDraftView-uMe2IeCv.js → ClosingDraftView-DV-dP-0G.js} +330 -319
- package/dist/{ClosingTemplateView-byUMxqLf.js → ClosingTemplateView-Bo5uzKK2.js} +2 -2
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-gU_anG_Q.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BPNKuOjZ.js} +3 -3
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-xOyEnkhr.js → FmUnitInput.vue_vue_type_script_setup_true_lang-Bycca0S5.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-6wK8UjSj.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-sVM6cQes.js} +1 -1
- package/dist/{IngredientGroupView-Dcg4XagR.js → IngredientGroupView-CmkSvOxJ.js} +1 -1
- package/dist/{IngredientsView--u4I1b25.js → IngredientsView-DIn-3Jee.js} +4 -4
- package/dist/{IntegrationView-C2A22fho.js → IntegrationView-CtawckJy.js} +1 -1
- package/dist/{InventoryBindingForm-1UGFYiaO.js → InventoryBindingForm-Dmd68jKK.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-D66mpBo_.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DBAwheaI.js} +3 -3
- package/dist/{InventoryBindingSummary-BLx8Fn5W.js → InventoryBindingSummary-Dho1qrPY.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BB_aU2oG.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Dja0BjOa.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-B11hYBMZ.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CjvQTt0Y.js} +1 -1
- package/dist/{PublishView-sXQx9Pgx.js → PublishView-DG9ppOMN.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-BHL_I4iP.js → PurchaseOrderPrintPreview-BfogmnuA.js} +1 -1
- package/dist/{ReceiveRequestView-DyLwzNZo.js → ReceiveRequestView-DcshoUs1.js} +9 -9
- package/dist/{RecipeView-D3uBc5vl.js → RecipeView-B3t6mU2N.js} +3 -3
- package/dist/{StockView-BOeSTZHg.js → StockView-DfylYVkd.js} +7 -7
- package/dist/{SupplierView-BP2gogrQ.js → SupplierView-BQHWrUpw.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-B2FB-o52.js → TransferDetails.vue_vue_type_script_setup_true_lang-aQkAoXb3.js} +4 -4
- package/dist/{TransferTemplateView-DvwHL1c1.js → TransferTemplateView-BxO2UFyf.js} +7 -7
- package/dist/{UnitView-RePSry1v.js → UnitView-Cl299OpQ.js} +3 -3
- package/dist/{WarehouseView-Q1xF1sMN.js → WarehouseView-C9oa2Jis.js} +1 -1
- package/dist/{app-Czi6WGIq.js → app-DZ9U0oko.js} +10 -10
- package/dist/app.js +1 -1
- package/dist/{decimal-BIOPhE0t.js → decimal-Q0qpn1nX.js} +1 -1
- package/dist/{feature-Dd_JZy3Y.js → feature-CwrW1toS.js} +1 -1
- package/dist/{format-unit-display-vj8ZBTdS.js → format-unit-display-Cijlq5k5.js} +2 -2
- package/dist/{index-Bi93q5cv.js → index-CG9f2hcH.js} +2 -2
- package/dist/{stock-ksGPw_1H.js → stock-B8OABZwR.js} +1 -1
- package/dist/{supplier-Cb1acd5I.js → supplier-OhriR4IQ.js} +1 -1
- package/dist/{use-ingredient-select-dialog-NNTeFo0N.js → use-ingredient-select-dialog-P6o_ZU_Z.js} +1 -1
- package/dist/{use-inventory-binding-dialog-D__Gm3Pv.js → use-inventory-binding-dialog-8a_D3hzG.js} +1 -1
- package/dist/{vue-i18n-BoWWKkCm.js → vue-i18n-BmOal3Ap.js} +2 -2
- package/package.json +1 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { defineComponent as ke, ref as V, resolveComponent as
|
|
2
|
-
import { W as
|
|
1
|
+
import { defineComponent as ke, ref as V, resolveComponent as P, openBlock as _, createBlock as q, withCtx as O, createElementVNode as n, createTextVNode as Ae, toDisplayString as z, unref as x, createVNode as k, h as w, reactive as Oe, computed as I, onMounted as Ye, watch as Ke, isRef as Te, createElementBlock as B, Fragment as K, createCommentVNode as X, normalizeClass as ue, renderList as fe, normalizeStyle as Re, Teleport as Ge, mergeProps as We } from "vue";
|
|
2
|
+
import { W as qe, u as we, aj as G, l as Ze, J as Ce, i as $, t as Je, K as pe, p as Qe, q as Xe, r as et, ak as Pe, al as Ie, a6 as Me, am as Ue, an as oe, ac as tt, ai as ee, T as Ee, D as Be, h as xe, f as at, e as nt, a as ot, y as st, _ as rt, z as lt, B as ct, E as he } from "./app-DZ9U0oko.js";
|
|
3
3
|
import { useCoreStore as it, useI18n as He } from "@feedmepos/mf-common";
|
|
4
4
|
import { useSnackbar as je, useDialog as ut, useProxiedModel as dt, components as ie, useBreakpoints as mt } from "@feedmepos/ui-library";
|
|
5
5
|
import { defineStore as ze, storeToRefs as ft } from "pinia";
|
|
6
|
-
import { u as Le } from "./stock-
|
|
6
|
+
import { u as Le } from "./stock-B8OABZwR.js";
|
|
7
7
|
import { E as pt } from "./empty-placeholder-wf6-BWE8.js";
|
|
8
|
-
const Se =
|
|
8
|
+
const Se = qe((o, p) => {
|
|
9
9
|
function e() {
|
|
10
10
|
return we().currentLocation.dbName;
|
|
11
11
|
}
|
|
12
12
|
return {
|
|
13
13
|
async getDraft(v) {
|
|
14
|
-
const u = e(),
|
|
15
|
-
return p.get(
|
|
14
|
+
const u = e(), h = `${o.inventoryBackendUrl}/${u}/closing-draft/${v}`;
|
|
15
|
+
return p.get(h);
|
|
16
16
|
},
|
|
17
17
|
async readDrafts() {
|
|
18
18
|
const v = e(), u = `${o.inventoryBackendUrl}/${v}/closing-draft`;
|
|
19
19
|
return p.get(u);
|
|
20
20
|
},
|
|
21
21
|
async runOperation(v) {
|
|
22
|
-
const u = e(),
|
|
23
|
-
return p.post(
|
|
22
|
+
const u = e(), h = `${o.inventoryBackendUrl}/${u}/closing-draft/run-operation`;
|
|
23
|
+
return p.post(h, v);
|
|
24
24
|
},
|
|
25
25
|
async sync(v) {
|
|
26
|
-
const u = e(),
|
|
27
|
-
return p.post(
|
|
26
|
+
const u = e(), h = `${o.inventoryBackendUrl}/${u}/closing-draft/sync`;
|
|
27
|
+
return p.post(h, v);
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
}), vt = { class: "fm-typo-en-body-lg-400" }, yt = { class: "fm-typo-en-body-lg-600" }, gt = { class: "flex gap-12 py-8 justify-end w-full" }, $e = /* @__PURE__ */ ke({
|
|
@@ -36,9 +36,9 @@ const Se = We((o, p) => {
|
|
|
36
36
|
onFinished: { type: Function }
|
|
37
37
|
},
|
|
38
38
|
setup(o) {
|
|
39
|
-
const p = o, e = V(), v = Se(), u = je(),
|
|
39
|
+
const p = o, e = V(), v = Se(), u = je(), h = V(!1);
|
|
40
40
|
async function m() {
|
|
41
|
-
|
|
41
|
+
h.value = !0;
|
|
42
42
|
try {
|
|
43
43
|
await v.runOperation({
|
|
44
44
|
_id: p.draft._id,
|
|
@@ -59,40 +59,40 @@ const Se = We((o, p) => {
|
|
|
59
59
|
type: "error"
|
|
60
60
|
}), console.error("error on submit closing draft aciont", y);
|
|
61
61
|
} finally {
|
|
62
|
-
|
|
62
|
+
h.value = !1;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
return (y, D) => {
|
|
66
|
-
const
|
|
67
|
-
return
|
|
66
|
+
const M = P("FmTextField"), U = P("FmButton"), T = P("FmForm");
|
|
67
|
+
return _(), q(T, {
|
|
68
68
|
onValidationSuccess: m,
|
|
69
69
|
class: "flex flex-col gap-32",
|
|
70
|
-
disabled:
|
|
70
|
+
disabled: h.value
|
|
71
71
|
}, {
|
|
72
72
|
default: O(() => [
|
|
73
73
|
n("div", vt, [
|
|
74
|
-
D[2] || (D[2] =
|
|
75
|
-
n("span", yt, z(y.action ==
|
|
76
|
-
D[3] || (D[3] =
|
|
74
|
+
D[2] || (D[2] = Ae(" You are about to ")),
|
|
75
|
+
n("span", yt, z(y.action == x(G).enum.approveDraft ? "approve" : "reject"), 1),
|
|
76
|
+
D[3] || (D[3] = Ae(" this draft. Please provider a remark to justify this action. "))
|
|
77
77
|
]),
|
|
78
|
-
k(
|
|
78
|
+
k(M, {
|
|
79
79
|
modelValue: e.value,
|
|
80
80
|
"onUpdate:modelValue": D[0] || (D[0] = (s) => e.value = s),
|
|
81
81
|
label: "Remark",
|
|
82
82
|
"label-mark": "required",
|
|
83
|
-
rules: [
|
|
83
|
+
rules: [x(Ze)()]
|
|
84
84
|
}, null, 8, ["modelValue", "rules"]),
|
|
85
85
|
n("div", gt, [
|
|
86
|
-
k(
|
|
86
|
+
k(U, {
|
|
87
87
|
label: "Cancel",
|
|
88
88
|
variant: "tertiary",
|
|
89
89
|
onClick: D[1] || (D[1] = (s) => y.onCancel())
|
|
90
90
|
}),
|
|
91
|
-
k(
|
|
92
|
-
label: y.action ==
|
|
91
|
+
k(U, {
|
|
92
|
+
label: y.action == x(G).enum.approveDraft ? "Approve" : "Reject",
|
|
93
93
|
type: "submit",
|
|
94
|
-
variant: y.action ==
|
|
95
|
-
loading:
|
|
94
|
+
variant: y.action == x(G).enum.approveDraft ? "primary" : "destructive",
|
|
95
|
+
loading: h.value
|
|
96
96
|
}, null, 8, ["label", "variant", "loading"])
|
|
97
97
|
])
|
|
98
98
|
]),
|
|
@@ -104,36 +104,36 @@ const Se = We((o, p) => {
|
|
|
104
104
|
function Ne(o) {
|
|
105
105
|
const p = o.measurementsAmounts.groupBy((v) => v.measurement.id), e = o.sku.unit.measurements.reduce((v, u) => {
|
|
106
106
|
var y, D;
|
|
107
|
-
const
|
|
108
|
-
return v +
|
|
109
|
-
},
|
|
107
|
+
const h = ((D = (y = p.get(u.id)) == null ? void 0 : y[0]) == null ? void 0 : D.amount) ?? bt, m = Ce(u.conversion, h);
|
|
108
|
+
return v + +$(m);
|
|
109
|
+
}, +$(o.baseAmount));
|
|
110
110
|
return Je(e, o.baseAmount.precision);
|
|
111
111
|
}
|
|
112
|
-
const
|
|
112
|
+
const xt = pe(0), ht = pe(100);
|
|
113
113
|
function Dt(o, p) {
|
|
114
114
|
const e = Ne(o), v = Pe(e, p), u = p.amount === 0 ? null : Ie(v, {
|
|
115
115
|
...p,
|
|
116
116
|
amount: Math.abs(p.amount)
|
|
117
|
-
}),
|
|
117
|
+
}), h = u ? Ce(u, ht) : null;
|
|
118
118
|
return {
|
|
119
119
|
code: o.sku.code,
|
|
120
120
|
name: o.sku.name,
|
|
121
121
|
baseUnit: o.sku.unit.abbrev,
|
|
122
|
-
baseUnitAmount:
|
|
123
|
-
...o.measurementsAmounts.filter((y) =>
|
|
124
|
-
(y, D,
|
|
122
|
+
baseUnitAmount: +$(o.baseAmount),
|
|
123
|
+
...o.measurementsAmounts.filter((y) => _t(y.measurement)).reduce(
|
|
124
|
+
(y, D, M) => (y[`measurementAbbrev${M}`] = `(${D.measurement.abbrev}) × ${$(D.measurement.conversion)}`, y[`measurementAmount${M}`] = +$(D.amount), y),
|
|
125
125
|
{}
|
|
126
126
|
),
|
|
127
|
-
systemBalance:
|
|
128
|
-
physicalBalance:
|
|
129
|
-
adjustedAmount:
|
|
130
|
-
adjustedDiffPercentage:
|
|
127
|
+
systemBalance: +$(p),
|
|
128
|
+
physicalBalance: +$(e),
|
|
129
|
+
adjustedAmount: +$(v),
|
|
130
|
+
adjustedDiffPercentage: h ? +$(Me(h, 2)) : null
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function _t(o) {
|
|
134
134
|
return !o.abbrev.toLocaleLowerCase().includes("inactive");
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function At() {
|
|
137
137
|
return [
|
|
138
138
|
{
|
|
139
139
|
id: "code",
|
|
@@ -166,15 +166,15 @@ function _t() {
|
|
|
166
166
|
];
|
|
167
167
|
}
|
|
168
168
|
function kt(o, p) {
|
|
169
|
-
var s, d,
|
|
169
|
+
var s, d, C, g, f, j, L;
|
|
170
170
|
const e = p.groupBy(
|
|
171
171
|
(b) => b.id,
|
|
172
172
|
(b) => b.balance
|
|
173
173
|
), u = [...o.items, ...o.negativeStockItems ?? []].map((b) => {
|
|
174
174
|
var te;
|
|
175
|
-
const
|
|
176
|
-
return Dt(b,
|
|
177
|
-
}), m = it().currentBusiness.value, y =
|
|
175
|
+
const R = ((te = e.get(b.sku._id)) == null ? void 0 : te[0]) ?? xt;
|
|
176
|
+
return Dt(b, R);
|
|
177
|
+
}), m = it().currentBusiness.value, y = At(), D = [
|
|
178
178
|
["Business name:", m == null ? void 0 : m.name],
|
|
179
179
|
["Business ID:", m == null ? void 0 : m._id],
|
|
180
180
|
["Menu version", m == null ? void 0 : m.menuVersion],
|
|
@@ -185,7 +185,7 @@ function kt(o, p) {
|
|
|
185
185
|
["Recent action", o.approvedAt ? "Approve" : o.rejectionHistory ? "Reject" : ""],
|
|
186
186
|
[
|
|
187
187
|
"Action by",
|
|
188
|
-
o.approvedAt ? (
|
|
188
|
+
o.approvedAt ? (C = o.approvedBy) == null ? void 0 : C.name : o.rejectionHistory ? (f = (g = o.rejectionHistory[0]) == null ? void 0 : g.rejectedBy) == null ? void 0 : f.name : ""
|
|
189
189
|
],
|
|
190
190
|
[
|
|
191
191
|
"Action at",
|
|
@@ -197,21 +197,21 @@ function kt(o, p) {
|
|
|
197
197
|
],
|
|
198
198
|
[],
|
|
199
199
|
y.map((b) => b.name),
|
|
200
|
-
...u.map((b) => y.map((
|
|
201
|
-
],
|
|
202
|
-
return et(
|
|
200
|
+
...u.map((b) => y.map((R) => b[R.id]))
|
|
201
|
+
], M = y.map((b) => `system:${b.id}`), U = Qe(D, M), T = `[${m == null ? void 0 : m.name}] closing draft (${Xe(new Date(o.updatedAt))}).xlsx`;
|
|
202
|
+
return et(U, T), T;
|
|
203
203
|
}
|
|
204
|
-
const
|
|
204
|
+
const _e = ze(
|
|
205
205
|
"closingDraftActions",
|
|
206
206
|
function() {
|
|
207
|
-
const p = ut(), e = je(), v = Ue(), u = Se(),
|
|
207
|
+
const p = ut(), e = je(), v = Ue(), u = Se(), h = Le(), m = V(!1), y = V();
|
|
208
208
|
function D(g) {
|
|
209
209
|
const f = {
|
|
210
210
|
draft: g
|
|
211
211
|
};
|
|
212
212
|
y.value = f, m.value = !0;
|
|
213
213
|
}
|
|
214
|
-
async function
|
|
214
|
+
async function M(g) {
|
|
215
215
|
var j;
|
|
216
216
|
if (g.status === oe.enum.COMPLETED) {
|
|
217
217
|
const L = g.closingId;
|
|
@@ -226,15 +226,15 @@ const Ae = ze(
|
|
|
226
226
|
const b = await v.getClosingById(L);
|
|
227
227
|
return (b == null ? void 0 : b.skus) ?? [];
|
|
228
228
|
} else
|
|
229
|
-
return await
|
|
229
|
+
return await h.readStockBalance(), ((j = h.stockBalance) == null ? void 0 : j.skus) ?? [];
|
|
230
230
|
}
|
|
231
|
-
async function
|
|
231
|
+
async function U(g, f) {
|
|
232
232
|
f || (e.open({
|
|
233
233
|
title: "Exporting",
|
|
234
234
|
message: "Fetching data..."
|
|
235
|
-
}), f = await
|
|
235
|
+
}), f = await M(g)), kt(g, f);
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function T(g, f) {
|
|
238
238
|
p.open({
|
|
239
239
|
title: "Approve draft",
|
|
240
240
|
contentComponent: $e,
|
|
@@ -276,16 +276,16 @@ const Ae = ze(
|
|
|
276
276
|
type: "success"
|
|
277
277
|
}), f == null || f();
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function C() {
|
|
280
280
|
m.value = !1;
|
|
281
281
|
}
|
|
282
282
|
return {
|
|
283
283
|
viewDraft: D,
|
|
284
|
-
closeDraftDialog:
|
|
285
|
-
approveDraft:
|
|
284
|
+
closeDraftDialog: C,
|
|
285
|
+
approveDraft: T,
|
|
286
286
|
rejectDraft: s,
|
|
287
287
|
syncDraft: d,
|
|
288
|
-
exportDraft:
|
|
288
|
+
exportDraft: U,
|
|
289
289
|
viewClosingDraftShow: m,
|
|
290
290
|
viewClosingDraftProps: y
|
|
291
291
|
};
|
|
@@ -306,9 +306,9 @@ function De(o) {
|
|
|
306
306
|
const wt = ze(
|
|
307
307
|
"closingDraftTable",
|
|
308
308
|
function() {
|
|
309
|
-
const { t: p } = He(), e =
|
|
309
|
+
const { t: p } = He(), e = _e(), v = V(new Array()), u = V(!1), h = we(), m = Se();
|
|
310
310
|
async function y() {
|
|
311
|
-
if (v.value = [], !!
|
|
311
|
+
if (v.value = [], !!h._currentLocation) {
|
|
312
312
|
u.value = !0;
|
|
313
313
|
try {
|
|
314
314
|
const [s] = await Promise.all([m.readDrafts()]).delayed(1e3);
|
|
@@ -321,12 +321,12 @@ const wt = ze(
|
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
async function D(s) {
|
|
324
|
-
if (!v.value.find((d) => d._id) &&
|
|
324
|
+
if (!v.value.find((d) => d._id) && h._currentLocation) {
|
|
325
325
|
u.value = !0;
|
|
326
326
|
try {
|
|
327
327
|
const [d] = await Promise.all([
|
|
328
328
|
m.getDraft(s),
|
|
329
|
-
new Promise((
|
|
329
|
+
new Promise((C) => setTimeout(C, 1e3))
|
|
330
330
|
]);
|
|
331
331
|
v.value = [d];
|
|
332
332
|
} catch (d) {
|
|
@@ -336,19 +336,19 @@ const wt = ze(
|
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function M() {
|
|
340
340
|
e.closeDraftDialog(), y();
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function U(s, d) {
|
|
343
343
|
switch (d = nt(d), s) {
|
|
344
|
-
case
|
|
344
|
+
case xe.Details:
|
|
345
345
|
return e.viewDraft(d);
|
|
346
|
-
case
|
|
346
|
+
case xe.Export:
|
|
347
347
|
return e.exportDraft(d);
|
|
348
348
|
case G.enum.approveDraft:
|
|
349
|
-
return e.approveDraft(d,
|
|
349
|
+
return e.approveDraft(d, M);
|
|
350
350
|
case G.enum.rejectDraft:
|
|
351
|
-
return e.rejectDraft(d,
|
|
351
|
+
return e.rejectDraft(d, M);
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
return {
|
|
@@ -393,7 +393,7 @@ const wt = ze(
|
|
|
393
393
|
id: "recentRemark",
|
|
394
394
|
accessorFn: (s) => {
|
|
395
395
|
var d;
|
|
396
|
-
return (s == null ? void 0 : s.approveRemark) ?? ((d = s == null ? void 0 : s.rejectionHistory) == null ? void 0 : d.computeFirst((
|
|
396
|
+
return (s == null ? void 0 : s.approveRemark) ?? ((d = s == null ? void 0 : s.rejectionHistory) == null ? void 0 : d.computeFirst((C) => C.rejectRemark)) ?? s.remark;
|
|
397
397
|
},
|
|
398
398
|
header: () => "Recent remark"
|
|
399
399
|
},
|
|
@@ -404,42 +404,42 @@ const wt = ze(
|
|
|
404
404
|
enableSorting: !1,
|
|
405
405
|
cell(s) {
|
|
406
406
|
var L;
|
|
407
|
-
const d = s.row.original,
|
|
408
|
-
return
|
|
407
|
+
const d = s.row.original, C = d.status, g = new Date(d.updatedAt), f = (L = d == null ? void 0 : d.rejectionHistory) == null ? void 0 : L.computeFirst((b) => b.rejectedAt), j = f ? new Date(f) : null;
|
|
408
|
+
return C === "DRAFT" && j ? j.getTime() > g.getTime() ? w(
|
|
409
409
|
"div",
|
|
410
410
|
{
|
|
411
411
|
class: "flex"
|
|
412
412
|
},
|
|
413
|
-
|
|
413
|
+
w(
|
|
414
414
|
"div",
|
|
415
415
|
{
|
|
416
416
|
class: ["fm-status-badge", De("FAILED")]
|
|
417
417
|
},
|
|
418
418
|
"Rejected"
|
|
419
419
|
)
|
|
420
|
-
) :
|
|
420
|
+
) : w(
|
|
421
421
|
"div",
|
|
422
422
|
{
|
|
423
423
|
class: "flex"
|
|
424
424
|
},
|
|
425
|
-
|
|
425
|
+
w(
|
|
426
426
|
"div",
|
|
427
427
|
{
|
|
428
428
|
class: ["fm-status-badge", De("PROCESSING")]
|
|
429
429
|
},
|
|
430
430
|
"Updated"
|
|
431
431
|
)
|
|
432
|
-
) :
|
|
432
|
+
) : w(
|
|
433
433
|
"div",
|
|
434
434
|
{
|
|
435
435
|
class: "flex"
|
|
436
436
|
},
|
|
437
|
-
|
|
437
|
+
w(
|
|
438
438
|
"div",
|
|
439
439
|
{
|
|
440
|
-
class: ["fm-status-badge", De(
|
|
440
|
+
class: ["fm-status-badge", De(C)]
|
|
441
441
|
},
|
|
442
|
-
Ee(
|
|
442
|
+
Ee(C)
|
|
443
443
|
)
|
|
444
444
|
);
|
|
445
445
|
}
|
|
@@ -447,9 +447,9 @@ const wt = ze(
|
|
|
447
447
|
{
|
|
448
448
|
id: "action",
|
|
449
449
|
cell(s) {
|
|
450
|
-
const d = s.row.original,
|
|
451
|
-
Be[
|
|
452
|
-
Be[
|
|
450
|
+
const d = s.row.original, C = [
|
|
451
|
+
Be[xe.Details],
|
|
452
|
+
Be[xe.Export]
|
|
453
453
|
], g = [
|
|
454
454
|
{
|
|
455
455
|
translationKey: "inventory.closing.draft.approveDraft",
|
|
@@ -464,10 +464,10 @@ const wt = ze(
|
|
|
464
464
|
];
|
|
465
465
|
return at(
|
|
466
466
|
[
|
|
467
|
-
...
|
|
467
|
+
...C,
|
|
468
468
|
...d.status === oe.enum.DRAFT ? g : []
|
|
469
469
|
],
|
|
470
|
-
(f) =>
|
|
470
|
+
(f) => U(f, d)
|
|
471
471
|
);
|
|
472
472
|
},
|
|
473
473
|
enableSorting: !1,
|
|
@@ -484,34 +484,34 @@ const wt = ze(
|
|
|
484
484
|
loadDraft: D
|
|
485
485
|
};
|
|
486
486
|
}
|
|
487
|
-
), Ct = { class: "w-full flex flex-col gap-32" }, jt = { class: "flex justify-between" }, St = { class: "flex" }, Ft = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
487
|
+
), Ct = { class: "w-full flex flex-col gap-32" }, jt = { class: "flex justify-between" }, St = { class: "flex" }, Ft = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, Bt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $t = { class: "flex gap-1" }, Tt = { class: "fm-typo-en-body-lg-600" }, Rt = { class: "flex flex-col gap-16" }, Pt = { class: "flex items-center" }, It = { key: 0 }, Mt = {
|
|
488
488
|
key: 0,
|
|
489
489
|
class: "w-full flex flex-col items-center"
|
|
490
|
-
},
|
|
490
|
+
}, Ut = { class: "flex items-center gap-8" }, Et = {
|
|
491
491
|
key: 0,
|
|
492
492
|
class: "flex gap-8"
|
|
493
|
-
},
|
|
493
|
+
}, Ht = { class: "overflow-x-auto" }, zt = {
|
|
494
494
|
key: 1,
|
|
495
495
|
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
496
|
-
},
|
|
496
|
+
}, Lt = {
|
|
497
497
|
key: 0,
|
|
498
498
|
class: "flex flex-col items-center gap-8 h-full"
|
|
499
|
-
},
|
|
499
|
+
}, Nt = ["src"], Vt = {
|
|
500
500
|
key: 1,
|
|
501
501
|
class: "px-4 flex flex-col"
|
|
502
|
-
},
|
|
502
|
+
}, Ot = { class: "flex gap-12 content-stretch" }, Yt = {
|
|
503
503
|
class: "flex flex-col w-24",
|
|
504
504
|
name: "circles"
|
|
505
|
-
},
|
|
505
|
+
}, Kt = { class: "flex-1 flex flex-col items-center" }, Gt = { class: "flex-1 flex flex-col items-center" }, Wt = {
|
|
506
506
|
class: "py-12 flex flex-col gap-4",
|
|
507
507
|
name: "received-at header"
|
|
508
|
-
}, qt = { class: "fm-typo-en-body-lg-400" },
|
|
508
|
+
}, qt = { class: "fm-typo-en-body-lg-400" }, Zt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Jt = { class: "flex gap-12 content-stretch" }, Qt = {
|
|
509
509
|
class: "flex flex-col w-24",
|
|
510
510
|
name: "circles"
|
|
511
|
-
},
|
|
511
|
+
}, Xt = { class: "flex-1 flex flex-col items-center" }, ea = {
|
|
512
512
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
513
513
|
name: "delivery details"
|
|
514
|
-
},
|
|
514
|
+
}, ta = { class: "flex flex-col gap-8" }, aa = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, na = { class: "flex flex-col gap-4" }, oa = { class: "flex gap-8" }, sa = /* @__PURE__ */ ke({
|
|
515
515
|
__name: "ClosingDraftDialog",
|
|
516
516
|
props: {
|
|
517
517
|
show: { type: Boolean },
|
|
@@ -519,38 +519,38 @@ const wt = ze(
|
|
|
519
519
|
},
|
|
520
520
|
emits: ["submitted"],
|
|
521
521
|
setup(o, { emit: p }) {
|
|
522
|
-
const e = o, v = Le(), u =
|
|
523
|
-
|
|
522
|
+
const e = o, v = Le(), u = _e(), h = dt(e, "show"), m = V(!1), y = V(!1), D = V(new Array()), M = Ue(), U = je(), T = ot(), s = Oe({}), d = I(() => new Set(
|
|
523
|
+
T.skus.filter((a) => {
|
|
524
524
|
var t;
|
|
525
525
|
return s[(t = a.customAttributes) == null ? void 0 : t.tag];
|
|
526
526
|
}).map((a) => a._id)
|
|
527
|
-
)),
|
|
527
|
+
)), C = p, g = I(() => {
|
|
528
528
|
var t, r;
|
|
529
529
|
const a = [...((t = e.draft) == null ? void 0 : t.items) ?? [], ...((r = e.draft) == null ? void 0 : r.negativeStockItems) ?? []];
|
|
530
|
-
return d.value.size ? a.filter((
|
|
531
|
-
}), f =
|
|
530
|
+
return d.value.size ? a.filter((c) => d.value.has(c.sku._id)) : a;
|
|
531
|
+
}), f = I(() => {
|
|
532
532
|
const a = g.value.map((t) => t.sku);
|
|
533
533
|
return a.sort((t, r) => t.code.localeCompare(r.code)), a;
|
|
534
|
-
}), j =
|
|
534
|
+
}), j = I(() => g.value.groupBy(
|
|
535
535
|
(t) => t.sku._id,
|
|
536
536
|
(t) => t.measurementsAmounts.filter((r) => !r.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((r) => r.measurement.id)
|
|
537
537
|
));
|
|
538
|
-
Ye(
|
|
538
|
+
Ye(R), Ke(
|
|
539
539
|
() => e.show,
|
|
540
540
|
(a) => {
|
|
541
|
-
a && (J.value = Z[0],
|
|
541
|
+
a && (J.value = Z[0], R());
|
|
542
542
|
}
|
|
543
543
|
);
|
|
544
544
|
const L = pe(0), b = pe(100);
|
|
545
|
-
async function
|
|
546
|
-
var t, r,
|
|
545
|
+
async function R() {
|
|
546
|
+
var t, r, c;
|
|
547
547
|
m.value = !0;
|
|
548
548
|
const a = ((t = e.draft) == null ? void 0 : t.status) === oe.enum.COMPLETED;
|
|
549
549
|
try {
|
|
550
|
-
if (await
|
|
551
|
-
const
|
|
552
|
-
if (!
|
|
553
|
-
|
|
550
|
+
if (await T.init(), a) {
|
|
551
|
+
const l = e.draft.closingId;
|
|
552
|
+
if (!l) {
|
|
553
|
+
U.open({
|
|
554
554
|
title: "Something went wrong",
|
|
555
555
|
message: "Closing draft is completed but closing document cannot be found.",
|
|
556
556
|
type: "error"
|
|
@@ -559,28 +559,28 @@ const wt = ze(
|
|
|
559
559
|
});
|
|
560
560
|
return;
|
|
561
561
|
}
|
|
562
|
-
const i = await
|
|
562
|
+
const i = await M.getClosingById(l);
|
|
563
563
|
D.value = (i == null ? void 0 : i.skus) ?? [];
|
|
564
564
|
} else
|
|
565
|
-
await v.readStockBalance(), D.value = ((
|
|
566
|
-
} catch (
|
|
567
|
-
|
|
565
|
+
await v.readStockBalance(), D.value = ((c = v.stockBalance) == null ? void 0 : c.skus) ?? [];
|
|
566
|
+
} catch (l) {
|
|
567
|
+
U.open({
|
|
568
568
|
title: "Something went wrong",
|
|
569
569
|
message: "Something went wrong when fetching info. Please try again.",
|
|
570
570
|
type: "error"
|
|
571
|
-
}), console.error("error on fetch stock balances",
|
|
571
|
+
}), console.error("error on fetch stock balances", l);
|
|
572
572
|
} finally {
|
|
573
573
|
m.value = !1;
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
const te =
|
|
576
|
+
const te = I(
|
|
577
577
|
() => D.value.groupBy(
|
|
578
578
|
(a) => a.id,
|
|
579
579
|
(a) => a.balance
|
|
580
580
|
)
|
|
581
|
-
), ve =
|
|
581
|
+
), ve = I(() => g.value.groupBy((a) => a.sku._id));
|
|
582
582
|
function se(a) {
|
|
583
|
-
return
|
|
583
|
+
return w(
|
|
584
584
|
ie.FmTooltip,
|
|
585
585
|
{ zIndex: 51, placement: "left", class: "w-full flex justify-end" },
|
|
586
586
|
{
|
|
@@ -593,15 +593,10 @@ const wt = ze(
|
|
|
593
593
|
}
|
|
594
594
|
);
|
|
595
595
|
}
|
|
596
|
-
const ae =
|
|
597
|
-
const a = f.value.reduce((r,
|
|
598
|
-
var
|
|
599
|
-
return
|
|
600
|
-
"Measurement counts",
|
|
601
|
-
l.unit.name,
|
|
602
|
-
l.unit.abbrev,
|
|
603
|
-
(i = (c = j.value) == null ? void 0 : c.get(l._id)) == null ? void 0 : i[0].length
|
|
604
|
-
), Math.max(r, (($ = (w = j.value) == null ? void 0 : w.get(l._id)) == null ? void 0 : $[0].length) ?? 0);
|
|
596
|
+
const ae = I(() => {
|
|
597
|
+
const a = f.value.reduce((r, c) => {
|
|
598
|
+
var l, i;
|
|
599
|
+
return Math.max(r, ((i = (l = j.value) == null ? void 0 : l.get(c._id)) == null ? void 0 : i[0].length) ?? 0);
|
|
605
600
|
}, 0);
|
|
606
601
|
return [
|
|
607
602
|
{
|
|
@@ -610,8 +605,8 @@ const wt = ze(
|
|
|
610
605
|
header: () => "Name",
|
|
611
606
|
size: 350,
|
|
612
607
|
cell(r) {
|
|
613
|
-
const
|
|
614
|
-
|
|
608
|
+
const c = r.row.original, l = c.adjustedDiffPercentage, i = typeof l == "number" && Math.abs(l) > 10, S = w("div", { class: "flex flex-col gap-4" }, [
|
|
609
|
+
w(
|
|
615
610
|
"div",
|
|
616
611
|
{
|
|
617
612
|
class: [
|
|
@@ -619,9 +614,9 @@ const wt = ze(
|
|
|
619
614
|
i ? " text-fm-color-system-error-300" : "text-fm-color-typo-primary"
|
|
620
615
|
]
|
|
621
616
|
},
|
|
622
|
-
|
|
617
|
+
c.name
|
|
623
618
|
),
|
|
624
|
-
|
|
619
|
+
w(
|
|
625
620
|
"div",
|
|
626
621
|
{
|
|
627
622
|
class: [
|
|
@@ -629,67 +624,81 @@ const wt = ze(
|
|
|
629
624
|
i ? " text-fm-color-system-error-300" : "text-fm-color-typo-secondary"
|
|
630
625
|
]
|
|
631
626
|
},
|
|
632
|
-
|
|
627
|
+
c.code
|
|
633
628
|
)
|
|
634
629
|
]);
|
|
635
|
-
return
|
|
630
|
+
return w(
|
|
636
631
|
ie.FmTooltip,
|
|
637
632
|
{
|
|
638
633
|
zIndex: 51
|
|
639
634
|
},
|
|
640
635
|
{
|
|
641
636
|
content() {
|
|
642
|
-
return i ? "Adjustment difference is more than 10%." : `${
|
|
637
|
+
return i ? "Adjustment difference is more than 10%." : `${c.code} - ${c.name}`;
|
|
643
638
|
},
|
|
644
639
|
default() {
|
|
645
|
-
return
|
|
646
|
-
|
|
640
|
+
return w("div", { class: "flex items-center gap-4 justify-start w-full" }, [
|
|
641
|
+
S
|
|
647
642
|
]);
|
|
648
643
|
}
|
|
649
644
|
}
|
|
650
645
|
);
|
|
651
646
|
}
|
|
652
647
|
},
|
|
648
|
+
{
|
|
649
|
+
id: "baseUnit",
|
|
650
|
+
header: () => "Base unit",
|
|
651
|
+
accessorKey: "baseUnit"
|
|
652
|
+
},
|
|
653
653
|
{
|
|
654
654
|
id: "physicalBalances",
|
|
655
655
|
header: () => "Amounts",
|
|
656
656
|
enableSorting: !1,
|
|
657
657
|
cell(r) {
|
|
658
|
-
const
|
|
658
|
+
const c = r.row.original, l = (S, E) => w(
|
|
659
659
|
ie.FmTooltip,
|
|
660
660
|
{ zIndex: 50 },
|
|
661
661
|
{
|
|
662
662
|
default() {
|
|
663
|
-
return
|
|
663
|
+
return w(
|
|
664
664
|
"div",
|
|
665
665
|
{
|
|
666
666
|
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"
|
|
667
667
|
},
|
|
668
668
|
[
|
|
669
|
-
|
|
670
|
-
|
|
669
|
+
w("span", { class: "text-fm-color-typo-primary" }, `${S} `),
|
|
670
|
+
w(
|
|
671
671
|
"span",
|
|
672
672
|
{
|
|
673
673
|
class: "text-fm-color-typo-secondary",
|
|
674
674
|
style: { maxWidth: "80px" }
|
|
675
675
|
},
|
|
676
|
-
|
|
676
|
+
E
|
|
677
677
|
)
|
|
678
678
|
]
|
|
679
679
|
);
|
|
680
680
|
},
|
|
681
681
|
content() {
|
|
682
|
-
return `${
|
|
682
|
+
return `${S} ${E}`;
|
|
683
683
|
}
|
|
684
684
|
}
|
|
685
685
|
);
|
|
686
|
-
let i = Array.from({ length: a }).map((
|
|
687
|
-
if (!
|
|
686
|
+
let i = Array.from({ length: a }).map((S, E) => {
|
|
687
|
+
if (!c[`measurementAmount${E}`])
|
|
688
688
|
return null;
|
|
689
|
-
const F =
|
|
690
|
-
return
|
|
691
|
-
}).filter((
|
|
692
|
-
return (
|
|
689
|
+
const F = c[`measurementAmount${E}`], le = c[`measurementAbbrev${E}`];
|
|
690
|
+
return l(F, le);
|
|
691
|
+
}).filter((S) => S);
|
|
692
|
+
return (c.baseUnitAmount || !i.length) && (i = [l(c.baseUnitAmount, c.baseUnit), ...i]), w(
|
|
693
|
+
"div",
|
|
694
|
+
{
|
|
695
|
+
class: "flex gap-8 flex-nowrap",
|
|
696
|
+
style: {
|
|
697
|
+
minWidth: `${120 * i.length}px`
|
|
698
|
+
}
|
|
699
|
+
},
|
|
700
|
+
i
|
|
701
|
+
);
|
|
693
702
|
}
|
|
694
703
|
},
|
|
695
704
|
{
|
|
@@ -722,14 +731,14 @@ const wt = ze(
|
|
|
722
731
|
{
|
|
723
732
|
id: "adjustedDiffPercentage",
|
|
724
733
|
accessorKey: "adjustedDiffPercentage",
|
|
725
|
-
header: () =>
|
|
734
|
+
header: () => w(
|
|
726
735
|
ie.FmTooltip,
|
|
727
736
|
{ zIndex: 51, placement: "left", class: "w-full flex justify-end" },
|
|
728
737
|
{
|
|
729
738
|
default() {
|
|
730
|
-
return
|
|
739
|
+
return w("div", { class: "flex items-center gap-4" }, [
|
|
731
740
|
"Diff (%)",
|
|
732
|
-
|
|
741
|
+
w(ie.FmIcon, { name: "info", color: "neutral-gray-400", size: "sm" })
|
|
733
742
|
]);
|
|
734
743
|
},
|
|
735
744
|
content() {
|
|
@@ -739,19 +748,19 @@ const wt = ze(
|
|
|
739
748
|
),
|
|
740
749
|
size: 200,
|
|
741
750
|
cell(r) {
|
|
742
|
-
const
|
|
743
|
-
if (!
|
|
744
|
-
const
|
|
745
|
-
if (
|
|
746
|
-
return
|
|
747
|
-
const i =
|
|
748
|
-
return
|
|
749
|
-
|
|
751
|
+
const c = r.row.original.adjustedDiffPercentage;
|
|
752
|
+
if (!c) return "N/A";
|
|
753
|
+
const l = c.toFixed(2);
|
|
754
|
+
if (l === "0.00")
|
|
755
|
+
return w("div", { class: "flex items-center gap-4 justify-end" }, ["0.00"]);
|
|
756
|
+
const i = c > 0;
|
|
757
|
+
return w("div", { class: "flex items-center gap-4 justify-end" }, [
|
|
758
|
+
w(ie.FmIcon, {
|
|
750
759
|
name: i ? "arrow_drop_up" : "arrow_drop_down",
|
|
751
760
|
color: i ? "system-success-300" : "system-error-300",
|
|
752
761
|
size: "md"
|
|
753
762
|
}),
|
|
754
|
-
|
|
763
|
+
l
|
|
755
764
|
]);
|
|
756
765
|
},
|
|
757
766
|
meta: {
|
|
@@ -759,7 +768,7 @@ const wt = ze(
|
|
|
759
768
|
}
|
|
760
769
|
}
|
|
761
770
|
];
|
|
762
|
-
}), ye =
|
|
771
|
+
}), ye = I(() => ae.value.map((a) => a.size ?? 0).reduce((a, t) => a + t)), re = V(""), de = I(() => f.value.map((a) => {
|
|
763
772
|
var F, le;
|
|
764
773
|
const t = (F = ve.value.get(a._id)) == null ? void 0 : F[0], r = ((le = te.value.get(a._id)) == null ? void 0 : le[0]) ?? L;
|
|
765
774
|
if (!t)
|
|
@@ -768,48 +777,44 @@ const wt = ze(
|
|
|
768
777
|
name: a.name,
|
|
769
778
|
baseUnit: a.unit.abbrev,
|
|
770
779
|
baseUnitAmount: 0,
|
|
771
|
-
systemBalance:
|
|
780
|
+
systemBalance: +$(r),
|
|
772
781
|
physicalBalance: 0,
|
|
773
|
-
adjustedAmount:
|
|
782
|
+
adjustedAmount: -+$(r),
|
|
774
783
|
adjustedDiffPercentage: -100
|
|
775
784
|
};
|
|
776
|
-
const
|
|
785
|
+
const c = Ne(t), l = Pe(c, r), i = r.amount === 0 ? null : Ie(l, {
|
|
777
786
|
...r,
|
|
778
787
|
amount: Math.abs(r.amount)
|
|
779
|
-
}),
|
|
788
|
+
}), S = i ? Ce(i, b) : null;
|
|
780
789
|
return {
|
|
781
790
|
code: a.code,
|
|
782
791
|
name: a.name,
|
|
783
792
|
baseUnit: a.unit.abbrev,
|
|
784
|
-
baseUnitAmount:
|
|
793
|
+
baseUnitAmount: +$(t.baseAmount),
|
|
785
794
|
...t.measurementsAmounts.filter((Q) => {
|
|
786
795
|
var Y, ne, be;
|
|
787
796
|
return (be = (ne = (Y = j.value) == null ? void 0 : Y.get(a._id)) == null ? void 0 : ne[0]) == null ? void 0 : be.includes(Q.measurement.id);
|
|
788
|
-
}).reduce((Q, Y, ne) => (Q[`measurementAbbrev${ne}`] = `(${Y.measurement.abbrev}) × ${
|
|
789
|
-
systemBalance:
|
|
790
|
-
physicalBalance:
|
|
791
|
-
adjustedAmount:
|
|
792
|
-
adjustedDiffPercentage:
|
|
797
|
+
}).reduce((Q, Y, ne) => (Q[`measurementAbbrev${ne}`] = `(${Y.measurement.abbrev}) × ${$(Y.measurement.conversion)}`, Q[`measurementAmount${ne}`] = +$(Y.amount), Q), {}),
|
|
798
|
+
systemBalance: +$(r),
|
|
799
|
+
physicalBalance: +$(c),
|
|
800
|
+
adjustedAmount: +$(l),
|
|
801
|
+
adjustedDiffPercentage: S ? +$(Me(S, 2)) : null
|
|
793
802
|
};
|
|
794
|
-
})), ge =
|
|
795
|
-
var t, r,
|
|
803
|
+
})), ge = I(() => {
|
|
804
|
+
var t, r, c;
|
|
796
805
|
if (!e.draft) return [];
|
|
797
806
|
const a = e.draft.approvedAt ? {
|
|
798
807
|
action: `Approve at ${ee(e.draft.approvedAt)}`,
|
|
799
808
|
// actionAt: props.draft.approvedAt,
|
|
800
809
|
actionBy: e.draft.approvedBy,
|
|
801
810
|
remark: e.draft.approveRemark
|
|
802
|
-
} : (t = e.draft.rejectionHistory) == null ? void 0 : t.computeFirst((
|
|
803
|
-
action: `Reject at ${ee(
|
|
811
|
+
} : (t = e.draft.rejectionHistory) == null ? void 0 : t.computeFirst((l) => ({
|
|
812
|
+
action: `Reject at ${ee(l.rejectedAt)}`,
|
|
804
813
|
// actionAt: e.rejectedAt,
|
|
805
|
-
actionBy:
|
|
806
|
-
remark:
|
|
814
|
+
actionBy: l.rejectedBy,
|
|
815
|
+
remark: l.rejectRemark
|
|
807
816
|
}));
|
|
808
817
|
return [
|
|
809
|
-
{
|
|
810
|
-
label: "Using template",
|
|
811
|
-
value: ((r = e.draft.usingTemplates.find((c) => c)) == null ? void 0 : r.name) ?? "None"
|
|
812
|
-
},
|
|
813
818
|
{
|
|
814
819
|
label: "Created at",
|
|
815
820
|
value: ee(e.draft.createdAt)
|
|
@@ -830,6 +835,10 @@ const wt = ze(
|
|
|
830
835
|
label: "Effective at",
|
|
831
836
|
value: ee(e.draft.effectiveAt ?? e.draft.updatedAt)
|
|
832
837
|
},
|
|
838
|
+
{
|
|
839
|
+
label: "Using template",
|
|
840
|
+
value: ((r = e.draft.usingTemplates.find((l) => l)) == null ? void 0 : r.name) ?? "None"
|
|
841
|
+
},
|
|
833
842
|
e.draft.remark ? {
|
|
834
843
|
label: "Remark",
|
|
835
844
|
value: e.draft.remark
|
|
@@ -840,13 +849,13 @@ const wt = ze(
|
|
|
840
849
|
} : null,
|
|
841
850
|
a && a.actionBy ? {
|
|
842
851
|
label: "Last action by",
|
|
843
|
-
value: (
|
|
852
|
+
value: (c = a.actionBy) == null ? void 0 : c.name
|
|
844
853
|
} : null,
|
|
845
854
|
a && a.remark ? {
|
|
846
855
|
label: "Action remark",
|
|
847
856
|
value: a.remark
|
|
848
857
|
} : null
|
|
849
|
-
].filter((
|
|
858
|
+
].filter((l) => l).map((l) => l);
|
|
850
859
|
}), Z = [
|
|
851
860
|
{
|
|
852
861
|
label: "Overview",
|
|
@@ -856,8 +865,8 @@ const wt = ze(
|
|
|
856
865
|
label: "Action history",
|
|
857
866
|
value: "history"
|
|
858
867
|
}
|
|
859
|
-
], J = V(Z[0]),
|
|
860
|
-
var t, r,
|
|
868
|
+
], J = V(Z[0]), W = I(() => {
|
|
869
|
+
var t, r, c, l;
|
|
861
870
|
return [
|
|
862
871
|
...(((t = e.draft) == null ? void 0 : t.rejectionHistory) ?? []).map(
|
|
863
872
|
(i) => ({
|
|
@@ -882,82 +891,82 @@ const wt = ze(
|
|
|
882
891
|
info: [
|
|
883
892
|
{
|
|
884
893
|
label: "Approved by",
|
|
885
|
-
values: [(
|
|
894
|
+
values: [(c = e.draft) == null ? void 0 : c.approvedBy.name]
|
|
886
895
|
},
|
|
887
896
|
{
|
|
888
897
|
label: "Approval remark",
|
|
889
|
-
values: [((
|
|
898
|
+
values: [((l = e.draft) == null ? void 0 : l.approveRemark) ?? ""]
|
|
890
899
|
}
|
|
891
900
|
]
|
|
892
901
|
}
|
|
893
902
|
] : []
|
|
894
903
|
];
|
|
895
|
-
}), me =
|
|
896
|
-
var
|
|
897
|
-
if ((
|
|
904
|
+
}), me = I(() => {
|
|
905
|
+
var l, i, S, E;
|
|
906
|
+
if ((l = e == null ? void 0 : e.draft) != null && l.approvedAt) return "Draft is already approved.";
|
|
898
907
|
if (((i = e.draft) == null ? void 0 : i.status) !== oe.enum.DRAFT) return "Status is not draft.";
|
|
899
|
-
const a = de.value.some((F) => F.physicalBalance < 0), t = ((
|
|
908
|
+
const a = de.value.some((F) => F.physicalBalance < 0), t = ((E = (S = v.stockBalance.skus) == null ? void 0 : S.filter((F) => F.balance.amount < 0)) == null ? void 0 : E.map((F) => F.id)) ?? [], r = new Set(f.value.map((F) => F._id)), c = t.filter((F) => !r.has(F)).length;
|
|
900
909
|
return [
|
|
901
910
|
a ? "Negative total exist." : null,
|
|
902
|
-
|
|
911
|
+
c ? "Negative stock is not included in this draft. Reopen draft in POS and apply changes." : null
|
|
903
912
|
].filter((F) => F).join(" ");
|
|
904
913
|
});
|
|
905
914
|
return (a, t) => {
|
|
906
|
-
const r =
|
|
907
|
-
return
|
|
915
|
+
const r = P("FmButtonGroup"), c = P("FmMenuDivider"), l = P("FmCard"), i = P("FmButton"), S = P("FmCircularProgress"), E = P("FmTextField"), F = P("FmIcon"), le = P("FmChip"), Q = P("FmTable"), Y = P("FmSpacer"), ne = P("FmTooltip"), be = P("FmSideSheet");
|
|
916
|
+
return _(), q(be, {
|
|
908
917
|
"dismiss-away": "",
|
|
909
|
-
"max-width":
|
|
910
|
-
"model-value": h
|
|
911
|
-
"onUpdate:modelValue": t[8] || (t[8] = (
|
|
918
|
+
"max-width": 9999,
|
|
919
|
+
"model-value": x(h),
|
|
920
|
+
"onUpdate:modelValue": t[8] || (t[8] = (A) => Te(h) ? h.value = A : null),
|
|
912
921
|
header: "Closing details"
|
|
913
922
|
}, {
|
|
914
923
|
"side-sheet-footer": O(() => {
|
|
915
|
-
var
|
|
924
|
+
var A, H, N, ce;
|
|
916
925
|
return [
|
|
917
|
-
n("div",
|
|
918
|
-
((
|
|
919
|
-
me.value ? (
|
|
926
|
+
n("div", oa, [
|
|
927
|
+
((A = e.draft) == null ? void 0 : A.status) === x(oe).enum.DRAFT ? (_(), B(K, { key: 0 }, [
|
|
928
|
+
me.value ? (_(), q(ne, {
|
|
920
929
|
key: 0,
|
|
921
930
|
"z-index": 51
|
|
922
931
|
}, {
|
|
923
932
|
content: O(() => [
|
|
924
|
-
|
|
933
|
+
Ae(z(me.value), 1)
|
|
925
934
|
]),
|
|
926
935
|
default: O(() => [
|
|
927
936
|
k(i, {
|
|
928
937
|
disabled: "",
|
|
929
938
|
key: "approve key",
|
|
930
939
|
label: "Approve",
|
|
931
|
-
onClick: t[3] || (t[3] = () => e.draft &&
|
|
940
|
+
onClick: t[3] || (t[3] = () => e.draft && x(u).approveDraft(e.draft, () => C("submitted")))
|
|
932
941
|
})
|
|
933
942
|
]),
|
|
934
943
|
_: 1
|
|
935
|
-
})) : (
|
|
944
|
+
})) : (_(), q(i, {
|
|
936
945
|
key: "approve key",
|
|
937
946
|
label: "Approve",
|
|
938
|
-
onClick: t[4] || (t[4] = () => e.draft &&
|
|
947
|
+
onClick: t[4] || (t[4] = () => e.draft && x(u).approveDraft(e.draft, () => C("submitted")))
|
|
939
948
|
}))
|
|
940
949
|
], 64)) : X("", !0),
|
|
941
|
-
((H = e.draft) == null ? void 0 : H.status) ===
|
|
950
|
+
((H = e.draft) == null ? void 0 : H.status) === x(oe).enum.DRAFT ? (_(), q(i, {
|
|
942
951
|
key: 1,
|
|
943
952
|
label: "Reject",
|
|
944
953
|
variant: "destructive",
|
|
945
|
-
onClick: t[5] || (t[5] = () => e.draft &&
|
|
954
|
+
onClick: t[5] || (t[5] = () => e.draft && x(u).rejectDraft(e.draft, () => C("submitted")))
|
|
946
955
|
})) : X("", !0),
|
|
947
|
-
(N = e.draft) != null && N.approvedAt && ((ce = e.draft) == null ? void 0 : ce.status) !==
|
|
956
|
+
(N = e.draft) != null && N.approvedAt && ((ce = e.draft) == null ? void 0 : ce.status) !== x(oe).enum.COMPLETED ? (_(), q(i, {
|
|
948
957
|
key: 2,
|
|
949
958
|
label: "Sync",
|
|
950
959
|
loading: y.value,
|
|
951
960
|
onClick: t[6] || (t[6] = () => {
|
|
952
|
-
e.draft && (y.value = !0,
|
|
953
|
-
y.value = !1,
|
|
961
|
+
e.draft && (y.value = !0, x(u).syncDraft(e.draft, () => {
|
|
962
|
+
y.value = !1, C("submitted");
|
|
954
963
|
}));
|
|
955
964
|
})
|
|
956
965
|
}, null, 8, ["loading"])) : X("", !0),
|
|
957
966
|
k(i, {
|
|
958
967
|
label: "Close",
|
|
959
968
|
variant: "tertiary",
|
|
960
|
-
onClick: t[7] || (t[7] = (Fe) =>
|
|
969
|
+
onClick: t[7] || (t[7] = (Fe) => h.value = !1)
|
|
961
970
|
})
|
|
962
971
|
])
|
|
963
972
|
];
|
|
@@ -968,43 +977,45 @@ const wt = ze(
|
|
|
968
977
|
k(r, {
|
|
969
978
|
items: Z,
|
|
970
979
|
modelValue: J.value,
|
|
971
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
980
|
+
"onUpdate:modelValue": t[0] || (t[0] = (A) => J.value = A)
|
|
972
981
|
}, null, 8, ["modelValue"])
|
|
973
982
|
]),
|
|
974
|
-
J.value.value === "overview" ? (
|
|
975
|
-
k(
|
|
983
|
+
J.value.value === "overview" ? (_(), B(K, { key: 0 }, [
|
|
984
|
+
k(l, {
|
|
976
985
|
variant: "outlined",
|
|
977
986
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
978
987
|
}, {
|
|
979
988
|
default: O(() => {
|
|
980
|
-
var
|
|
989
|
+
var A, H;
|
|
981
990
|
return [
|
|
982
991
|
n("div", jt, [
|
|
983
992
|
t[9] || (t[9] = n("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
|
|
984
993
|
n("div", St, [
|
|
985
994
|
n("div", {
|
|
986
|
-
class: ue(["fm-status-badge",
|
|
987
|
-
}, z(
|
|
995
|
+
class: ue(["fm-status-badge", x(De)(((A = a.draft) == null ? void 0 : A.status) ?? "DRAFT")])
|
|
996
|
+
}, z(x(Ee)(((H = a.draft) == null ? void 0 : H.status) ?? "")), 3)
|
|
988
997
|
])
|
|
989
998
|
]),
|
|
990
|
-
k(
|
|
991
|
-
(
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
n("div", Bt,
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
999
|
+
k(c),
|
|
1000
|
+
n("div", Ft, [
|
|
1001
|
+
(_(!0), B(K, null, fe(ge.value, (N, ce) => (_(), B("div", {
|
|
1002
|
+
class: "flex flex-col gap-4",
|
|
1003
|
+
key: ce
|
|
1004
|
+
}, [
|
|
1005
|
+
n("div", Bt, [
|
|
1006
|
+
n("div", $t, z(N.label), 1)
|
|
1007
|
+
]),
|
|
1008
|
+
n("div", Tt, z(N.value), 1)
|
|
1009
|
+
]))), 128))
|
|
1010
|
+
])
|
|
1000
1011
|
];
|
|
1001
1012
|
}),
|
|
1002
1013
|
_: 1
|
|
1003
1014
|
}),
|
|
1004
|
-
n("div",
|
|
1005
|
-
n("div",
|
|
1015
|
+
n("div", Rt, [
|
|
1016
|
+
n("div", Pt, [
|
|
1006
1017
|
t[10] || (t[10] = n("div", { class: "flex-1 fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Closing items ", -1)),
|
|
1007
|
-
m.value ? X("", !0) : (
|
|
1018
|
+
m.value ? X("", !0) : (_(), B("div", It, [
|
|
1008
1019
|
k(i, {
|
|
1009
1020
|
label: "Export data",
|
|
1010
1021
|
"prepend-icon": "download",
|
|
@@ -1012,37 +1023,37 @@ const wt = ze(
|
|
|
1012
1023
|
"text-color": "primary",
|
|
1013
1024
|
"bg-color": "transparent",
|
|
1014
1025
|
"border-color": "primary",
|
|
1015
|
-
onClick: t[1] || (t[1] = (
|
|
1026
|
+
onClick: t[1] || (t[1] = (A) => a.draft ? x(u).exportDraft(a.draft, D.value) : null)
|
|
1016
1027
|
})
|
|
1017
1028
|
]))
|
|
1018
1029
|
]),
|
|
1019
|
-
m.value ? (
|
|
1030
|
+
m.value ? (_(), B("div", Mt, [
|
|
1020
1031
|
t[12] || (t[12] = n("div", { class: "h-80" }, null, -1)),
|
|
1021
|
-
n("div",
|
|
1032
|
+
n("div", Ut, [
|
|
1022
1033
|
n("div", null, [
|
|
1023
|
-
k(
|
|
1034
|
+
k(S, { size: "md" })
|
|
1024
1035
|
]),
|
|
1025
1036
|
t[11] || (t[11] = n("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fetching info... ", -1))
|
|
1026
1037
|
]),
|
|
1027
1038
|
t[13] || (t[13] = n("div", { class: "h-80" }, null, -1))
|
|
1028
|
-
])) : (
|
|
1039
|
+
])) : (_(), B(K, { key: 1 }, [
|
|
1029
1040
|
n("div", null, [
|
|
1030
|
-
k(
|
|
1041
|
+
k(E, {
|
|
1031
1042
|
modelValue: re.value,
|
|
1032
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
1043
|
+
"onUpdate:modelValue": t[2] || (t[2] = (A) => re.value = A),
|
|
1033
1044
|
placeholder: "Filter items"
|
|
1034
1045
|
}, null, 8, ["modelValue"])
|
|
1035
1046
|
]),
|
|
1036
|
-
|
|
1037
|
-
(
|
|
1038
|
-
key: `${
|
|
1039
|
-
label: `${
|
|
1047
|
+
x(T).skuTags.size ? (_(), B("div", Et, [
|
|
1048
|
+
(_(!0), B(K, null, fe(x(T).skuTags.keys(), (A) => (_(), q(le, {
|
|
1049
|
+
key: `${A}`,
|
|
1050
|
+
label: `${A}`,
|
|
1040
1051
|
selectable: "",
|
|
1041
|
-
selected: s[`${
|
|
1042
|
-
onClick: (H) => s[`${
|
|
1052
|
+
selected: s[`${A}`],
|
|
1053
|
+
onClick: (H) => s[`${A}`] = !s[`${A}`]
|
|
1043
1054
|
}, {
|
|
1044
1055
|
default: O(() => [
|
|
1045
|
-
s[`${
|
|
1056
|
+
s[`${A}`] ? (_(), q(F, {
|
|
1046
1057
|
key: 0,
|
|
1047
1058
|
name: "check",
|
|
1048
1059
|
class: "text-white",
|
|
@@ -1052,18 +1063,18 @@ const wt = ze(
|
|
|
1052
1063
|
class: ue([
|
|
1053
1064
|
"",
|
|
1054
1065
|
{
|
|
1055
|
-
"text-white fm-typo-en-body-md-600": s[`${
|
|
1056
|
-
"text-fm-color-typo-primary fm-typo-en-body-md-400": !s[`${
|
|
1066
|
+
"text-white fm-typo-en-body-md-600": s[`${A}`],
|
|
1067
|
+
"text-fm-color-typo-primary fm-typo-en-body-md-400": !s[`${A}`]
|
|
1057
1068
|
}
|
|
1058
1069
|
])
|
|
1059
|
-
}, z(
|
|
1070
|
+
}, z(A), 3)
|
|
1060
1071
|
]),
|
|
1061
1072
|
_: 2
|
|
1062
1073
|
}, 1032, ["label", "selected", "onClick"]))), 128))
|
|
1063
1074
|
])) : X("", !0),
|
|
1064
|
-
n("div",
|
|
1075
|
+
n("div", Ht, [
|
|
1065
1076
|
n("div", {
|
|
1066
|
-
style: Re({
|
|
1077
|
+
style: Re({ minWidth: `${ye.value}px` })
|
|
1067
1078
|
}, [
|
|
1068
1079
|
k(Q, {
|
|
1069
1080
|
"column-defs": ae.value,
|
|
@@ -1075,12 +1086,12 @@ const wt = ze(
|
|
|
1075
1086
|
], 64))
|
|
1076
1087
|
])
|
|
1077
1088
|
], 64)) : X("", !0),
|
|
1078
|
-
J.value.value === "history" ? (
|
|
1079
|
-
|
|
1080
|
-
(
|
|
1081
|
-
n("div",
|
|
1082
|
-
n("div",
|
|
1083
|
-
n("div",
|
|
1089
|
+
J.value.value === "history" ? (_(), B("div", zt, [
|
|
1090
|
+
W.value.length ? (_(), B("div", Vt, [
|
|
1091
|
+
(_(!0), B(K, null, fe(W.value, (A, H) => (_(), B(K, { key: H }, [
|
|
1092
|
+
n("div", Ot, [
|
|
1093
|
+
n("div", Yt, [
|
|
1094
|
+
n("div", Kt, [
|
|
1084
1095
|
n("div", {
|
|
1085
1096
|
class: ue([
|
|
1086
1097
|
{
|
|
@@ -1092,51 +1103,51 @@ const wt = ze(
|
|
|
1092
1103
|
}, null, 2)
|
|
1093
1104
|
]),
|
|
1094
1105
|
t[16] || (t[16] = n("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
1095
|
-
n("div",
|
|
1106
|
+
n("div", Gt, [
|
|
1096
1107
|
n("div", {
|
|
1097
1108
|
class: ue([
|
|
1098
1109
|
{
|
|
1099
|
-
"bg-fm-color-primary": H <
|
|
1100
|
-
"bg-white": H >=
|
|
1110
|
+
"bg-fm-color-primary": H < W.value.length - 1,
|
|
1111
|
+
"bg-white": H >= W.value.length - 1
|
|
1101
1112
|
},
|
|
1102
1113
|
"w-[2px] h-full"
|
|
1103
1114
|
])
|
|
1104
1115
|
}, null, 2)
|
|
1105
1116
|
])
|
|
1106
1117
|
]),
|
|
1107
|
-
n("div",
|
|
1108
|
-
n("div", qt, z(
|
|
1109
|
-
n("div",
|
|
1118
|
+
n("div", Wt, [
|
|
1119
|
+
n("div", qt, z(A.header), 1),
|
|
1120
|
+
n("div", Zt, z(A.date), 1)
|
|
1110
1121
|
])
|
|
1111
1122
|
]),
|
|
1112
|
-
n("div",
|
|
1113
|
-
n("div",
|
|
1114
|
-
n("div",
|
|
1123
|
+
n("div", Jt, [
|
|
1124
|
+
n("div", Qt, [
|
|
1125
|
+
n("div", Xt, [
|
|
1115
1126
|
n("div", {
|
|
1116
1127
|
class: ue([
|
|
1117
1128
|
{
|
|
1118
|
-
"bg-fm-color-primary": H <
|
|
1119
|
-
"bg-white": H >=
|
|
1129
|
+
"bg-fm-color-primary": H < W.value.length - 1,
|
|
1130
|
+
"bg-white": H >= W.value.length - 1
|
|
1120
1131
|
},
|
|
1121
1132
|
"w-[2px] h-full"
|
|
1122
1133
|
])
|
|
1123
1134
|
}, null, 2)
|
|
1124
1135
|
])
|
|
1125
1136
|
]),
|
|
1126
|
-
n("div",
|
|
1127
|
-
k(
|
|
1137
|
+
n("div", ea, [
|
|
1138
|
+
k(l, {
|
|
1128
1139
|
variant: "outlined",
|
|
1129
1140
|
class: "py-12 px-16"
|
|
1130
1141
|
}, {
|
|
1131
1142
|
default: O(() => [
|
|
1132
|
-
n("div",
|
|
1133
|
-
(
|
|
1143
|
+
n("div", ta, [
|
|
1144
|
+
(_(!0), B(K, null, fe(A.info, (N, ce) => (_(), B("div", {
|
|
1134
1145
|
key: ce,
|
|
1135
1146
|
class: "flex flex-col gap-4"
|
|
1136
1147
|
}, [
|
|
1137
|
-
n("div",
|
|
1138
|
-
n("div",
|
|
1139
|
-
(
|
|
1148
|
+
n("div", aa, z(N == null ? void 0 : N.label), 1),
|
|
1149
|
+
n("div", na, [
|
|
1150
|
+
(_(!0), B(K, null, fe(N == null ? void 0 : N.values, (Fe, Ve) => (_(), B("div", {
|
|
1140
1151
|
key: Ve,
|
|
1141
1152
|
class: "fm-typo-en-body-lg-600"
|
|
1142
1153
|
}, z(Fe), 1))), 128))
|
|
@@ -1149,13 +1160,13 @@ const wt = ze(
|
|
|
1149
1160
|
])
|
|
1150
1161
|
])
|
|
1151
1162
|
], 64))), 128))
|
|
1152
|
-
])) : (
|
|
1163
|
+
])) : (_(), B("div", Lt, [
|
|
1153
1164
|
k(Y),
|
|
1154
1165
|
n("div", null, [
|
|
1155
1166
|
n("img", {
|
|
1156
|
-
src:
|
|
1167
|
+
src: x(pt),
|
|
1157
1168
|
alt: "List is empty"
|
|
1158
|
-
}, null, 8,
|
|
1169
|
+
}, null, 8, Nt)
|
|
1159
1170
|
]),
|
|
1160
1171
|
t[14] || (t[14] = n("div", { class: "fm-typo-en-body-lg-600" }, z("No records found"), -1)),
|
|
1161
1172
|
t[15] || (t[15] = n("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)),
|
|
@@ -1169,22 +1180,22 @@ const wt = ze(
|
|
|
1169
1180
|
}, 8, ["model-value"]);
|
|
1170
1181
|
};
|
|
1171
1182
|
}
|
|
1172
|
-
}),
|
|
1183
|
+
}), ra = { class: "flex-1 flex flex-col gap-8" }, la = { class: "flex flex-col" }, ca = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ia = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, ua = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, da = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, xa = /* @__PURE__ */ ke({
|
|
1173
1184
|
__name: "ClosingDraftView",
|
|
1174
1185
|
setup(o) {
|
|
1175
|
-
const { t: p } = He(), { viewDraft: e } =
|
|
1176
|
-
|
|
1177
|
-
const
|
|
1186
|
+
const { t: p } = He(), { viewDraft: e } = _e(), { viewClosingDraftProps: v, viewClosingDraftShow: u } = ft(_e()), h = we(), m = wt(), y = st(), { breakpoints: D } = mt();
|
|
1187
|
+
h.watchLocation(m.fetchDrafts);
|
|
1188
|
+
const M = I(() => m.loading), U = V(""), T = I(() => D.value.xs || D.value.sm), s = I(() => T.value ? 10 : 20);
|
|
1178
1189
|
function d(f) {
|
|
1179
1190
|
switch (f) {
|
|
1180
1191
|
case "refresh":
|
|
1181
1192
|
return m.fetchDrafts();
|
|
1182
1193
|
}
|
|
1183
1194
|
}
|
|
1184
|
-
function
|
|
1195
|
+
function C(f) {
|
|
1185
1196
|
return f;
|
|
1186
1197
|
}
|
|
1187
|
-
const g =
|
|
1198
|
+
const g = I(() => T.value ? [
|
|
1188
1199
|
{
|
|
1189
1200
|
label: "Refresh",
|
|
1190
1201
|
value: "refresh",
|
|
@@ -1198,10 +1209,10 @@ const wt = ze(
|
|
|
1198
1209
|
}
|
|
1199
1210
|
]);
|
|
1200
1211
|
return (f, j) => {
|
|
1201
|
-
const L =
|
|
1202
|
-
return
|
|
1212
|
+
const L = P("FmTable");
|
|
1213
|
+
return _(), B(K, null, [
|
|
1203
1214
|
k(rt, {
|
|
1204
|
-
title:
|
|
1215
|
+
title: x(p)("inventory.closing.draft.title"),
|
|
1205
1216
|
actions: g.value,
|
|
1206
1217
|
"onClick:action": d
|
|
1207
1218
|
}, {
|
|
@@ -1210,63 +1221,63 @@ const wt = ze(
|
|
|
1210
1221
|
class: ue([
|
|
1211
1222
|
"flex flex-col gap-8 max-h-full",
|
|
1212
1223
|
{
|
|
1213
|
-
"p-0":
|
|
1214
|
-
"px-24 ": !
|
|
1224
|
+
"p-0": T.value,
|
|
1225
|
+
"px-24 ": !T.value
|
|
1215
1226
|
}
|
|
1216
1227
|
])
|
|
1217
1228
|
}, [
|
|
1218
1229
|
k(lt, {
|
|
1219
1230
|
"change-location": "",
|
|
1220
1231
|
searchable: "",
|
|
1221
|
-
search:
|
|
1222
|
-
"onUpdate:search": j[0] || (j[0] = (b) =>
|
|
1232
|
+
search: U.value,
|
|
1233
|
+
"onUpdate:search": j[0] || (j[0] = (b) => U.value = b)
|
|
1223
1234
|
}, null, 8, ["search"]),
|
|
1224
1235
|
k(L, {
|
|
1225
|
-
style: Re(
|
|
1226
|
-
"column-defs":
|
|
1227
|
-
"row-data":
|
|
1228
|
-
"search-value":
|
|
1229
|
-
loading:
|
|
1230
|
-
onRowClick: j[1] || (j[1] = (b) =>
|
|
1236
|
+
style: Re(x(y).tableHeight),
|
|
1237
|
+
"column-defs": x(m).columnDefs,
|
|
1238
|
+
"row-data": x(m).drafts,
|
|
1239
|
+
"search-value": U.value,
|
|
1240
|
+
loading: M.value,
|
|
1241
|
+
onRowClick: j[1] || (j[1] = (b) => x(e)(b.original)),
|
|
1231
1242
|
"page-size": s.value
|
|
1232
1243
|
}, {
|
|
1233
1244
|
"list-row": O((b) => [
|
|
1234
1245
|
k(ct, {
|
|
1235
1246
|
row: b,
|
|
1236
|
-
onRowClick: (
|
|
1247
|
+
onRowClick: (R) => x(e)(R)
|
|
1237
1248
|
}, {
|
|
1238
|
-
default: O((
|
|
1239
|
-
var te, ve, se, ae, ye, re, de, ge, Z, J,
|
|
1249
|
+
default: O((R) => {
|
|
1250
|
+
var te, ve, se, ae, ye, re, de, ge, Z, J, W, me, a, t, r, c, l, i, S, E;
|
|
1240
1251
|
return [
|
|
1241
|
-
n("div",
|
|
1242
|
-
n("div",
|
|
1243
|
-
n("div",
|
|
1244
|
-
k(
|
|
1245
|
-
render: (se = (ve = (te =
|
|
1246
|
-
props: (ye = (ae =
|
|
1252
|
+
n("div", ra, [
|
|
1253
|
+
n("div", la, [
|
|
1254
|
+
n("div", ca, [
|
|
1255
|
+
k(x(he), {
|
|
1256
|
+
render: (se = (ve = (te = R._id) == null ? void 0 : te.column) == null ? void 0 : ve.columnDef) == null ? void 0 : se.cell,
|
|
1257
|
+
props: (ye = (ae = R._id) == null ? void 0 : ae.getContext) == null ? void 0 : ye.call(ae)
|
|
1247
1258
|
}, null, 8, ["render", "props"])
|
|
1248
1259
|
]),
|
|
1249
|
-
n("div",
|
|
1250
|
-
k(
|
|
1251
|
-
render: (ge = (de = (re =
|
|
1252
|
-
props: (J = (Z =
|
|
1260
|
+
n("div", ia, [
|
|
1261
|
+
k(x(he), {
|
|
1262
|
+
render: (ge = (de = (re = R.name) == null ? void 0 : re.column) == null ? void 0 : de.columnDef) == null ? void 0 : ge.cell,
|
|
1263
|
+
props: (J = (Z = R.name) == null ? void 0 : Z.getContext) == null ? void 0 : J.call(Z)
|
|
1253
1264
|
}, null, 8, ["render", "props"])
|
|
1254
1265
|
]),
|
|
1255
|
-
n("div",
|
|
1266
|
+
n("div", ua, z([
|
|
1256
1267
|
...b.original.items.slice(0, 3).map((F) => F.sku.name),
|
|
1257
1268
|
...b.original.items.length >= 3 ? [`and ${b.original.items.length - 3} more items`] : []
|
|
1258
1269
|
].join(", ")), 1),
|
|
1259
|
-
n("div",
|
|
1260
|
-
k(
|
|
1261
|
-
render: (a = (me = (
|
|
1262
|
-
props: (r = (t =
|
|
1270
|
+
n("div", da, [
|
|
1271
|
+
k(x(he), {
|
|
1272
|
+
render: (a = (me = (W = R.ref) == null ? void 0 : W.column) == null ? void 0 : me.columnDef) == null ? void 0 : a.cell,
|
|
1273
|
+
props: (r = (t = R.ref) == null ? void 0 : t.getContext) == null ? void 0 : r.call(t)
|
|
1263
1274
|
}, null, 8, ["render", "props"])
|
|
1264
1275
|
])
|
|
1265
1276
|
]),
|
|
1266
1277
|
n("div", null, [
|
|
1267
|
-
k(
|
|
1268
|
-
render: (i = (
|
|
1269
|
-
props: (
|
|
1278
|
+
k(x(he), {
|
|
1279
|
+
render: (i = (l = (c = R.status) == null ? void 0 : c.column) == null ? void 0 : l.columnDef) == null ? void 0 : i.cell,
|
|
1280
|
+
props: (E = (S = R.status) == null ? void 0 : S.getContext) == null ? void 0 : E.call(S)
|
|
1270
1281
|
}, null, 8, ["render", "props"])
|
|
1271
1282
|
])
|
|
1272
1283
|
])
|
|
@@ -1281,11 +1292,11 @@ const wt = ze(
|
|
|
1281
1292
|
]),
|
|
1282
1293
|
_: 1
|
|
1283
1294
|
}, 8, ["title", "actions"]),
|
|
1284
|
-
(
|
|
1285
|
-
k(
|
|
1286
|
-
show:
|
|
1295
|
+
(_(), q(Ge, { to: "body" }, [
|
|
1296
|
+
k(sa, We(x(v), {
|
|
1297
|
+
show: x(u),
|
|
1287
1298
|
"onUpdate:show": j[2] || (j[2] = (b) => Te(u) ? u.value = b : null),
|
|
1288
|
-
onSubmitted: j[3] || (j[3] = () => (u.value = !1,
|
|
1299
|
+
onSubmitted: j[3] || (j[3] = () => (u.value = !1, x(m).fetchDrafts()))
|
|
1289
1300
|
}), null, 16, ["show"])
|
|
1290
1301
|
]))
|
|
1291
1302
|
], 64);
|
|
@@ -1293,5 +1304,5 @@ const wt = ze(
|
|
|
1293
1304
|
}
|
|
1294
1305
|
});
|
|
1295
1306
|
export {
|
|
1296
|
-
|
|
1307
|
+
xa as default
|
|
1297
1308
|
};
|