@feedmepos/mf-inventory-portal 1.2.25-dev.3 → 1.2.25-dev.4
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-B4obttsk.js → App-DfVozmjY.js} +1 -1
- package/dist/{ApprovalView-DC3UGAul.js → ApprovalView-CnfqSv9x.js} +2 -2
- package/dist/{BindingsDialog-CquzVplj.js → BindingsDialog-kpsjxfQy.js} +2 -2
- package/dist/{BindingsPicker-DTuGeemT.js → BindingsPicker-C-lqbpS5.js} +1 -1
- package/dist/{BindingsTable-Ctgb9M_M.js → BindingsTable-C9gXT_I9.js} +1 -1
- package/dist/{ClosingDraftView-BxmKgtbn.js → ClosingDraftView-CIzPb1jY.js} +567 -569
- package/dist/{ClosingHistoryView-s_xtCr9L.js → ClosingHistoryView-tWDtp2Rs.js} +2 -2
- package/dist/{ClosingTemplateView-BFAk8t0U.js → ClosingTemplateView-DqS84ptv.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-Cxx6M-8k.js → DeliveryOrderPrintPreview-BWi8-vGu.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DEl4CWhG.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DbbA0bsv.js} +3 -3
- package/dist/{FmMultiselectDialog-BKe18tGi.js → FmMultiselectDialog-Yhn-TS1x.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-B3EGJJOd.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DayErKOZ.js} +1 -1
- package/dist/{ImportView-C_Wi1VKC.js → ImportView-DPgX-G_F.js} +2 -2
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-C10WT08O.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-D7LbFPED.js} +1 -1
- package/dist/{IngredientGroupView-D_upb784.js → IngredientGroupView-BfUAKH7v.js} +2 -2
- package/dist/{IngredientsView-Cl34PHha.js → IngredientsView-BC7nWfsQ.js} +7 -7
- package/dist/{IntegrationView-DVN96hm3.js → IntegrationView-BDxifTYa.js} +3 -3
- package/dist/{InventoryBindingForm-HrndE5uF.js → InventoryBindingForm-CotArtis.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CNTipGf7.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-D2z8Sh-E.js} +3 -3
- package/dist/{InventoryBindingSummary-DXD2CcUd.js → InventoryBindingSummary-B-aThygZ.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-COb9i6pD.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CZhZ5fCR.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-QLsihie5.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Csk9pFuQ.js} +1 -1
- package/dist/{PublishView-BjggzffG.js → PublishView-7DQ09qeB.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-CEr-__xV.js → PurchaseOrderPrintPreview-BbcvYJ8n.js} +1 -1
- package/dist/{ReceiveRequestView-C5TJmTy3.js → ReceiveRequestView-FDyALvGT.js} +8 -8
- package/dist/{RecipeView-C-JSaZdS.js → RecipeView-CEEoNYEk.js} +3 -3
- package/dist/{StockView-DnXqehqn.js → StockView-BCRLEQFi.js} +8 -8
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-B1KFnqFv.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-C0_t8krY.js} +1 -1
- package/dist/{SupplierView-D-RzNxE-.js → SupplierView-BQdQ5IKV.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CObSzTDZ.js → TransferDetails.vue_vue_type_script_setup_true_lang-BkGXaWid.js} +5 -5
- package/dist/{TransferTemplateView-SE1sCscG.js → TransferTemplateView-DKQCZoDi.js} +7 -7
- package/dist/{UnitView-C_JVyM2z.js → UnitView-BwFWozmk.js} +3 -3
- package/dist/{WarehouseView-BbzM9qBo.js → WarehouseView-Bp3VfyqG.js} +1 -1
- package/dist/{app-zasR2ukI.js → app-DTwVjf2G.js} +26 -26
- package/dist/app.js +1 -1
- package/dist/{decimal-DWqIA11a.js → decimal-B0CqnvKJ.js} +1 -1
- package/dist/{format-unit-display-DIwCjuP3.js → format-unit-display-C9SRbqfx.js} +3 -3
- package/dist/{import-export.helper-DwC0iQdw.js → import-export.helper-ChSfbVTS.js} +1 -1
- package/dist/{index-CrjhdjiE.js → index-DCJZYjJp.js} +1 -1
- package/dist/{index-PGim0FYX.js → index-DHWgyDzu.js} +1 -1
- package/dist/{purchase-order-template-Bhq1FrLB.js → purchase-order-template-hnS0QDeq.js} +1 -1
- package/dist/{stock-BF1TE1sy.js → stock-0CVWUWpZ.js} +1 -1
- package/dist/{stock-lhgtE1at.js → stock-CP4PfKN1.js} +2 -2
- package/dist/{supplier-qYXdR1q-.js → supplier-CR1HA06A.js} +1 -1
- package/dist/{use-ingredient-select-dialog-DUX6jbhh.js → use-ingredient-select-dialog-CRROeO60.js} +1 -1
- package/dist/{use-inventory-binding-dialog-Cs9yC_C8.js → use-inventory-binding-dialog-jkt1y1SA.js} +1 -1
- package/package.json +3 -3
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { defineComponent as He, ref as H, computed as V, onMounted as Ye, resolveComponent as U, openBlock as
|
|
2
|
-
import { aa as Ct, u as ze, ax as z, am as ct, ay as it, r as jt, Z as Qe, n as N, t as Bt, a0 as Be, W as Ft, Y as Tt, X as $t, az as ut, aA as dt, ah as mt, aB as pe, an as Mt, ac as Ke, ab as ve, a6 as Ue, D as st, j as Re, i as Rt, f as It, a as Pt, $ as Ie, a9 as Vt, h as Ut, G as Lt, I as Et, J as Ht, K as zt, L as Pe } from "./app-
|
|
1
|
+
import { defineComponent as He, ref as H, computed as V, onMounted as Ye, resolveComponent as U, openBlock as j, createElementBlock as L, Fragment as ee, createTextVNode as X, createBlock as se, withCtx as Y, createElementVNode as r, toDisplayString as J, unref as F, createVNode as h, createCommentVNode as de, h as T, reactive as _t, watch as Dt, isRef as rt, normalizeClass as De, renderList as je, normalizeStyle as lt, Teleport as wt, mergeProps as St } from "vue";
|
|
2
|
+
import { aa as Ct, u as ze, ax as z, am as ct, ay as it, r as jt, Z as Qe, n as N, t as Bt, a0 as Be, W as Ft, Y as Tt, X as $t, az as ut, aA as dt, ah as mt, aB as pe, an as Mt, ac as Ke, ab as ve, a6 as Ue, D as st, j as Re, i as Rt, f as It, a as Pt, $ as Ie, a9 as Vt, h as Ut, G as Lt, I as Et, J as Ht, K as zt, L as Pe } from "./app-DTwVjf2G.js";
|
|
3
3
|
import { useCoreStore as Nt, useI18n as ft } from "@feedmepos/mf-common";
|
|
4
4
|
import { useSnackbar as Ge, useDialog as Ot, useProxiedModel as Kt, components as Ve, useBreakpoints as Yt } from "@feedmepos/ui-library";
|
|
5
5
|
import { defineStore as pt, storeToRefs as Qt } from "pinia";
|
|
6
|
-
import { u as vt } from "./stock-
|
|
7
|
-
import { u as We } from "./stock-
|
|
6
|
+
import { u as vt } from "./stock-CP4PfKN1.js";
|
|
7
|
+
import { u as We } from "./stock-0CVWUWpZ.js";
|
|
8
8
|
import { E as Gt } from "./empty-placeholder-wf6-BWE8.js";
|
|
9
|
-
const Ne = Ct((
|
|
9
|
+
const Ne = Ct((s, l) => {
|
|
10
10
|
function e() {
|
|
11
11
|
return ze().currentLocation.dbName;
|
|
12
12
|
}
|
|
13
13
|
return {
|
|
14
14
|
async getDraft(m) {
|
|
15
|
-
const
|
|
16
|
-
return l.get(
|
|
15
|
+
const p = e(), _ = `${s.inventoryBackendUrl}/${p}/closing-draft/${m}`;
|
|
16
|
+
return l.get(_);
|
|
17
17
|
},
|
|
18
18
|
async readDrafts() {
|
|
19
|
-
const m = e(),
|
|
20
|
-
return l.get(
|
|
19
|
+
const m = e(), p = `${s.inventoryBackendUrl}/${m}/closing-draft`;
|
|
20
|
+
return l.get(p);
|
|
21
21
|
},
|
|
22
22
|
async runOperation(m) {
|
|
23
|
-
const
|
|
24
|
-
return l.post(
|
|
23
|
+
const p = e(), _ = `${s.inventoryBackendUrl}/${p}/closing-draft/run-operation`;
|
|
24
|
+
return l.post(_, m);
|
|
25
25
|
},
|
|
26
26
|
async sync(m) {
|
|
27
|
-
const
|
|
28
|
-
return l.post(
|
|
27
|
+
const p = e(), _ = `${s.inventoryBackendUrl}/${p}/closing-draft/sync`;
|
|
28
|
+
return l.post(_, m);
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}), Wt = { class: "fm-typo-en-body-lg-400" }, qt = { class: "fm-typo-en-body-lg-600" }, Zt = {
|
|
@@ -39,8 +39,8 @@ const Ne = Ct((o, l) => {
|
|
|
39
39
|
onCancel: { type: Function },
|
|
40
40
|
onFinished: { type: Function }
|
|
41
41
|
},
|
|
42
|
-
setup(
|
|
43
|
-
const l =
|
|
42
|
+
setup(s) {
|
|
43
|
+
const l = s, e = H(), m = Ne(), p = Ge(), _ = H(!1), v = H(null), R = H(!1), S = V(() => {
|
|
44
44
|
switch (l.action) {
|
|
45
45
|
case z.enum.approveDraft:
|
|
46
46
|
return "Approve";
|
|
@@ -50,7 +50,7 @@ const Ne = Ct((o, l) => {
|
|
|
50
50
|
return "Mark as Failed";
|
|
51
51
|
}
|
|
52
52
|
throw new Error(`Unknown action: ${l.action}`);
|
|
53
|
-
}),
|
|
53
|
+
}), k = V(() => {
|
|
54
54
|
switch (l.action) {
|
|
55
55
|
case z.enum.approveDraft:
|
|
56
56
|
return "primary";
|
|
@@ -63,185 +63,185 @@ const Ne = Ct((o, l) => {
|
|
|
63
63
|
});
|
|
64
64
|
Ye(() => {
|
|
65
65
|
if (l.draft.effectiveAt)
|
|
66
|
-
|
|
66
|
+
v.value = new Date(l.draft.effectiveAt);
|
|
67
67
|
else {
|
|
68
|
-
const
|
|
69
|
-
|
|
68
|
+
const n = new Date(l.draft.createdAt);
|
|
69
|
+
n.setHours(23, 59, 59, 999), v.value = n;
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
R.value = !0;
|
|
72
72
|
});
|
|
73
|
-
const
|
|
73
|
+
const $ = V({
|
|
74
74
|
get() {
|
|
75
|
-
return
|
|
75
|
+
return v.value === null ? "" : ct(v.value);
|
|
76
76
|
},
|
|
77
|
-
set(
|
|
78
|
-
if (
|
|
79
|
-
const a = /* @__PURE__ */ new Date(`${
|
|
80
|
-
a.setSeconds(59, 999),
|
|
77
|
+
set(n) {
|
|
78
|
+
if (n) {
|
|
79
|
+
const a = /* @__PURE__ */ new Date(`${n} ${P.value}`);
|
|
80
|
+
a.setSeconds(59, 999), v.value = a;
|
|
81
81
|
} else
|
|
82
|
-
|
|
82
|
+
v.value = null;
|
|
83
83
|
}
|
|
84
84
|
}), P = V({
|
|
85
85
|
get() {
|
|
86
|
-
return
|
|
86
|
+
return v.value === null ? "" : it(v.value);
|
|
87
87
|
},
|
|
88
|
-
set(
|
|
89
|
-
if (
|
|
90
|
-
const a = /* @__PURE__ */ new Date(`${
|
|
91
|
-
a.setSeconds(59, 999),
|
|
88
|
+
set(n) {
|
|
89
|
+
if (n) {
|
|
90
|
+
const a = /* @__PURE__ */ new Date(`${$.value} ${n}`);
|
|
91
|
+
a.setSeconds(59, 999), v.value = a;
|
|
92
92
|
} else
|
|
93
|
-
|
|
93
|
+
v.value = null;
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
|
-
async function
|
|
97
|
-
|
|
96
|
+
async function I() {
|
|
97
|
+
_.value = !0;
|
|
98
98
|
try {
|
|
99
99
|
await m.runOperation({
|
|
100
100
|
_id: l.draft._id,
|
|
101
101
|
_rev: l.draft._rev ?? "",
|
|
102
102
|
action: l.action,
|
|
103
103
|
data: {
|
|
104
|
-
effectiveAt:
|
|
104
|
+
effectiveAt: v.value ? v.value.toISOString() : null,
|
|
105
105
|
remark: e.value
|
|
106
106
|
}
|
|
107
|
-
}).delayed(500),
|
|
107
|
+
}).delayed(500), p.open({
|
|
108
108
|
title: "Success",
|
|
109
109
|
message: "Action submitted",
|
|
110
110
|
type: "success"
|
|
111
111
|
}), l.onFinished();
|
|
112
|
-
} catch (
|
|
113
|
-
|
|
112
|
+
} catch (n) {
|
|
113
|
+
p.open({
|
|
114
114
|
title: "Something went wrong",
|
|
115
|
-
message: "Unable to submit action. Please try again",
|
|
115
|
+
message: (n == null ? void 0 : n.message) ?? "Unable to submit action. Please try again",
|
|
116
116
|
type: "error"
|
|
117
|
-
}), console.error("error on submit closing draft action",
|
|
117
|
+
}), console.error("error on submit closing draft action", n);
|
|
118
118
|
} finally {
|
|
119
|
-
|
|
119
|
+
_.value = !1;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
return (
|
|
123
|
-
const
|
|
124
|
-
return
|
|
122
|
+
return (n, a) => {
|
|
123
|
+
const D = U("FmLabel"), O = U("FmDatePicker"), f = U("FmTimePicker"), y = U("FmTextField"), A = U("FmButton"), w = U("FmForm");
|
|
124
|
+
return R.value ? (j(), se(w, {
|
|
125
125
|
key: 1,
|
|
126
|
-
onValidationSuccess:
|
|
126
|
+
onValidationSuccess: I,
|
|
127
127
|
class: "flex flex-col gap-32",
|
|
128
|
-
disabled:
|
|
128
|
+
disabled: _.value
|
|
129
129
|
}, {
|
|
130
130
|
default: Y(() => [
|
|
131
131
|
r("div", Wt, [
|
|
132
132
|
a[4] || (a[4] = X(" You are about to ")),
|
|
133
|
-
r("span", qt, J(
|
|
133
|
+
r("span", qt, J(S.value), 1),
|
|
134
134
|
a[5] || (a[5] = X(" this draft. Please provide a remark to justify this action. "))
|
|
135
135
|
]),
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
n.action === F(z).enum.approveDraft ? (j(), L("div", Zt, [
|
|
137
|
+
h(D, { class: "fm-typo-en-body-lg-600" }, {
|
|
138
138
|
default: Y(() => a[6] || (a[6] = [
|
|
139
139
|
X("Closing Date")
|
|
140
140
|
])),
|
|
141
141
|
_: 1
|
|
142
142
|
}),
|
|
143
|
-
|
|
144
|
-
modelValue:
|
|
145
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
143
|
+
h(O, {
|
|
144
|
+
modelValue: $.value,
|
|
145
|
+
"onUpdate:modelValue": a[0] || (a[0] = (M) => $.value = M)
|
|
146
146
|
}, null, 8, ["modelValue"]),
|
|
147
|
-
|
|
147
|
+
h(D, { class: "fm-typo-en-body-lg-600" }, {
|
|
148
148
|
default: Y(() => a[7] || (a[7] = [
|
|
149
149
|
X("Closing Time")
|
|
150
150
|
])),
|
|
151
151
|
_: 1
|
|
152
152
|
}),
|
|
153
|
-
|
|
153
|
+
h(f, {
|
|
154
154
|
modelValue: P.value,
|
|
155
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
155
|
+
"onUpdate:modelValue": a[1] || (a[1] = (M) => P.value = M)
|
|
156
156
|
}, null, 8, ["modelValue"])
|
|
157
157
|
])) : de("", !0),
|
|
158
|
-
|
|
158
|
+
h(y, {
|
|
159
159
|
modelValue: e.value,
|
|
160
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
160
|
+
"onUpdate:modelValue": a[2] || (a[2] = (M) => e.value = M),
|
|
161
161
|
label: "Remark",
|
|
162
162
|
"label-mark": "required",
|
|
163
|
-
rules: [
|
|
163
|
+
rules: [F(jt)()]
|
|
164
164
|
}, null, 8, ["modelValue", "rules"]),
|
|
165
165
|
r("div", Jt, [
|
|
166
|
-
|
|
166
|
+
h(A, {
|
|
167
167
|
label: "Cancel",
|
|
168
168
|
variant: "tertiary",
|
|
169
|
-
onClick: a[3] || (a[3] = (
|
|
169
|
+
onClick: a[3] || (a[3] = (M) => n.onCancel())
|
|
170
170
|
}),
|
|
171
|
-
|
|
172
|
-
label:
|
|
171
|
+
h(A, {
|
|
172
|
+
label: S.value,
|
|
173
173
|
type: "submit",
|
|
174
|
-
variant:
|
|
175
|
-
loading:
|
|
174
|
+
variant: k.value,
|
|
175
|
+
loading: _.value
|
|
176
176
|
}, null, 8, ["label", "variant", "loading"])
|
|
177
177
|
])
|
|
178
178
|
]),
|
|
179
179
|
_: 1
|
|
180
|
-
}, 8, ["disabled"])) : (
|
|
180
|
+
}, 8, ["disabled"])) : (j(), L(ee, { key: 0 }, [
|
|
181
181
|
X("Loading")
|
|
182
182
|
], 64));
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
185
|
}), Xt = Be(0);
|
|
186
|
-
function yt(
|
|
187
|
-
const l =
|
|
188
|
-
var
|
|
189
|
-
const
|
|
190
|
-
return m + +N(
|
|
191
|
-
}, +N(
|
|
192
|
-
return Bt(e,
|
|
186
|
+
function yt(s) {
|
|
187
|
+
const l = s.measurementsAmounts.groupBy((m) => m.measurement.id), e = s.sku.unit.measurements.reduce((m, p) => {
|
|
188
|
+
var R, S;
|
|
189
|
+
const _ = ((S = (R = l.get(p.id)) == null ? void 0 : R[0]) == null ? void 0 : S.amount) ?? Xt, v = Qe(p.conversion, _);
|
|
190
|
+
return m + +N(v);
|
|
191
|
+
}, +N(s.baseAmount));
|
|
192
|
+
return Bt(e, s.baseAmount.precision);
|
|
193
193
|
}
|
|
194
194
|
const ea = Be(0), ta = Be(100), gt = "N/A";
|
|
195
|
-
function aa(
|
|
196
|
-
var
|
|
197
|
-
const
|
|
195
|
+
function aa(s, l, e, m, p, _) {
|
|
196
|
+
var w;
|
|
197
|
+
const v = yt(s), R = m ?? v, S = ut(R, l), k = l.amount === 0 ? null : dt(S, {
|
|
198
198
|
...l,
|
|
199
199
|
amount: Math.abs(l.amount)
|
|
200
|
-
}),
|
|
200
|
+
}), $ = k ? Qe(k, ta) : null, P = (w = s.sku.defaultCost) != null && w.costPerUnit ? s.sku.defaultCost.costPerUnit.amount / Math.pow(10, s.sku.defaultCost.costPerUnit.precision) : 0, I = p ? +N(p) : 0, n = +N(l), a = +N(R), D = n - a, O = D * P, f = a * P, y = n * P;
|
|
201
201
|
return {
|
|
202
|
-
code:
|
|
203
|
-
name:
|
|
204
|
-
baseUnit:
|
|
205
|
-
baseUnitAmount: +N(
|
|
206
|
-
...
|
|
207
|
-
(
|
|
202
|
+
code: s.sku.code,
|
|
203
|
+
name: s.sku.name,
|
|
204
|
+
baseUnit: s.sku.unit.abbrev,
|
|
205
|
+
baseUnitAmount: +N(s.baseAmount),
|
|
206
|
+
...s.measurementsAmounts.filter(
|
|
207
|
+
(M) => na(M.measurement) && e.includes(M.measurement.id)
|
|
208
208
|
).reduce(
|
|
209
|
-
(
|
|
209
|
+
(M, Z, W) => (M[`measurementAbbrev${W}`] = `(${Z.measurement.abbrev}) × ${N(Z.measurement.conversion)}`, M[`measurementAmount${W}`] = +N(Z.amount), M),
|
|
210
210
|
{}
|
|
211
211
|
),
|
|
212
|
-
systemBalance:
|
|
212
|
+
systemBalance: n,
|
|
213
213
|
physicalBalance: a,
|
|
214
|
-
adjustedAmount: +N(
|
|
215
|
-
adjustedDiffPercentage:
|
|
214
|
+
adjustedAmount: +N(S),
|
|
215
|
+
adjustedDiffPercentage: $ ? +N(mt($, 2)) : null,
|
|
216
216
|
costPerUnit: P,
|
|
217
|
-
opening:
|
|
218
|
-
adjustmentTypes:
|
|
219
|
-
varianceQty:
|
|
217
|
+
opening: I,
|
|
218
|
+
adjustmentTypes: _ ?? gt,
|
|
219
|
+
varianceQty: D,
|
|
220
220
|
varianceRM: O,
|
|
221
221
|
stockTakeValue: f,
|
|
222
|
-
systemValue:
|
|
222
|
+
systemValue: y
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
function na(
|
|
226
|
-
return !
|
|
225
|
+
function na(s) {
|
|
226
|
+
return !s.abbrev.toLocaleLowerCase().includes("inactive");
|
|
227
227
|
}
|
|
228
|
-
function oa(
|
|
229
|
-
const l = bt(
|
|
230
|
-
return
|
|
228
|
+
function oa(s) {
|
|
229
|
+
const l = bt(s);
|
|
230
|
+
return s.reduce(
|
|
231
231
|
(e, m) => {
|
|
232
|
-
var
|
|
233
|
-
return Math.max(e, ((
|
|
232
|
+
var p;
|
|
233
|
+
return Math.max(e, ((p = l == null ? void 0 : l.get(m.sku._id)) == null ? void 0 : p[0].length) ?? 0);
|
|
234
234
|
},
|
|
235
235
|
0
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
function bt(
|
|
239
|
-
return
|
|
238
|
+
function bt(s) {
|
|
239
|
+
return s.groupBy(
|
|
240
240
|
(l) => l.sku._id,
|
|
241
241
|
(l) => l.measurementsAmounts.filter((e) => !e.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((e) => e.measurement.id)
|
|
242
242
|
);
|
|
243
243
|
}
|
|
244
|
-
function sa(
|
|
244
|
+
function sa(s) {
|
|
245
245
|
return [
|
|
246
246
|
{
|
|
247
247
|
id: "code",
|
|
@@ -303,7 +303,7 @@ function sa(o) {
|
|
|
303
303
|
id: "baseUnitAmount",
|
|
304
304
|
name: "Base unit amount"
|
|
305
305
|
},
|
|
306
|
-
...Array.from({ length:
|
|
306
|
+
...Array.from({ length: s }).flatMap((e, m) => [
|
|
307
307
|
{
|
|
308
308
|
id: `measurementAmount${m}`,
|
|
309
309
|
name: `UOM amount ${m + 1}`
|
|
@@ -315,60 +315,60 @@ function sa(o) {
|
|
|
315
315
|
])
|
|
316
316
|
];
|
|
317
317
|
}
|
|
318
|
-
function ra(
|
|
319
|
-
var
|
|
318
|
+
function ra(s, l, e) {
|
|
319
|
+
var y, A, w, M, Z, W, re;
|
|
320
320
|
const m = l.groupBy(
|
|
321
|
-
(
|
|
322
|
-
(
|
|
323
|
-
),
|
|
324
|
-
(
|
|
325
|
-
(
|
|
326
|
-
),
|
|
327
|
-
if (
|
|
328
|
-
for (const
|
|
329
|
-
|
|
330
|
-
const
|
|
331
|
-
if (
|
|
332
|
-
for (const
|
|
333
|
-
const te = Object.keys(
|
|
334
|
-
|
|
321
|
+
(B) => B.id,
|
|
322
|
+
(B) => B.balance
|
|
323
|
+
), p = e.groupBy(
|
|
324
|
+
(B) => B.id,
|
|
325
|
+
(B) => B.balance
|
|
326
|
+
), _ = /* @__PURE__ */ new Map();
|
|
327
|
+
if (s.opening)
|
|
328
|
+
for (const B of s.opening)
|
|
329
|
+
_.set(B.skuId, B.balance);
|
|
330
|
+
const v = /* @__PURE__ */ new Map();
|
|
331
|
+
if (s.adjustmentSnapshot)
|
|
332
|
+
for (const B of s.adjustmentSnapshot) {
|
|
333
|
+
const te = Object.keys(B.adjustmentsByType).join(", ");
|
|
334
|
+
v.set(B.skuId, te || gt);
|
|
335
335
|
}
|
|
336
|
-
const
|
|
336
|
+
const R = [...s.items, ...s.negativeStockItems ?? []], S = bt(R), k = R.map((B) => {
|
|
337
337
|
var ye, ge, Q;
|
|
338
|
-
const te = ((ye = m.get(
|
|
338
|
+
const te = ((ye = m.get(B.sku._id)) == null ? void 0 : ye[0]) ?? ea, be = ((ge = S == null ? void 0 : S.get(B.sku._id)) == null ? void 0 : ge[0]) ?? [], he = _.get(B.sku._id), fe = v.get(B.sku._id);
|
|
339
339
|
return aa(
|
|
340
|
-
|
|
340
|
+
B,
|
|
341
341
|
te,
|
|
342
342
|
be,
|
|
343
|
-
(Q =
|
|
344
|
-
|
|
343
|
+
(Q = p.get(B.sku._id)) == null ? void 0 : Q[0],
|
|
344
|
+
he,
|
|
345
345
|
fe
|
|
346
346
|
);
|
|
347
|
-
}),
|
|
348
|
-
["Business name:",
|
|
349
|
-
["Business ID:",
|
|
350
|
-
["Menu version",
|
|
351
|
-
["Created at", new Date(
|
|
352
|
-
["Created by", (
|
|
353
|
-
["Updated at", new Date(
|
|
354
|
-
["Updated by", (A =
|
|
355
|
-
["Recent action",
|
|
347
|
+
}), $ = oa(R), I = Nt().currentBusiness.value, n = sa($), a = [
|
|
348
|
+
["Business name:", I == null ? void 0 : I.name],
|
|
349
|
+
["Business ID:", I == null ? void 0 : I._id],
|
|
350
|
+
["Menu version", I == null ? void 0 : I.menuVersion],
|
|
351
|
+
["Created at", new Date(s.createdAt)],
|
|
352
|
+
["Created by", (y = s.createdBy) == null ? void 0 : y.name],
|
|
353
|
+
["Updated at", new Date(s.updatedAt)],
|
|
354
|
+
["Updated by", (A = s.updatedBy) == null ? void 0 : A.name],
|
|
355
|
+
["Recent action", s.approvedAt ? "Approve" : s.rejectionHistory ? "Reject" : ""],
|
|
356
356
|
[
|
|
357
357
|
"Action by",
|
|
358
|
-
|
|
358
|
+
s.approvedAt ? (w = s.approvedBy) == null ? void 0 : w.name : s.rejectionHistory ? (Z = (M = s.rejectionHistory[0]) == null ? void 0 : M.rejectedBy) == null ? void 0 : Z.name : ""
|
|
359
359
|
],
|
|
360
360
|
[
|
|
361
361
|
"Action at",
|
|
362
|
-
|
|
362
|
+
s.approvedAt ? new Date(s.approvedAt) : s.rejectionHistory ? new Date((W = s.rejectionHistory[0]) == null ? void 0 : W.rejectedAt) : ""
|
|
363
363
|
],
|
|
364
364
|
[
|
|
365
365
|
"Action remark",
|
|
366
|
-
|
|
366
|
+
s.approvedAt ? s.approveRemark : s.rejectionHistory ? new Date((re = s.rejectionHistory[0]) == null ? void 0 : re.rejectRemark) : ""
|
|
367
367
|
],
|
|
368
368
|
[],
|
|
369
|
-
|
|
370
|
-
...
|
|
371
|
-
],
|
|
369
|
+
n.map((B) => B.name),
|
|
370
|
+
...k.map((B) => n.map((te) => B[te.id]))
|
|
371
|
+
], D = n.map((B) => `system:${B.id}`), O = Ft(a, D), f = `[${I == null ? void 0 : I.name}] closing draft (${Tt(new Date(s.updatedAt))}).xlsx`;
|
|
372
372
|
return $t(O, f), f;
|
|
373
373
|
}
|
|
374
374
|
const la = { class: "flex flex-col" }, ca = { class: "flex gap-12 py-8 justify-end w-full" }, ia = /* @__PURE__ */ He({
|
|
@@ -378,55 +378,55 @@ const la = { class: "flex flex-col" }, ca = { class: "flex gap-12 py-8 justify-e
|
|
|
378
378
|
onCancel: { type: Function },
|
|
379
379
|
onFinished: { type: Function }
|
|
380
380
|
},
|
|
381
|
-
setup(
|
|
382
|
-
const l =
|
|
381
|
+
setup(s) {
|
|
382
|
+
const l = s;
|
|
383
383
|
We();
|
|
384
|
-
const e = H(!1), m = H(null),
|
|
384
|
+
const e = H(!1), m = H(null), p = H(!1);
|
|
385
385
|
Ye(() => {
|
|
386
386
|
if (l.draft.effectiveAt)
|
|
387
387
|
m.value = new Date(l.draft.effectiveAt);
|
|
388
388
|
else {
|
|
389
|
-
const
|
|
390
|
-
|
|
389
|
+
const S = new Date(l.draft.createdAt);
|
|
390
|
+
S.setHours(23, 59, 59, 999), m.value = S;
|
|
391
391
|
}
|
|
392
|
-
|
|
392
|
+
p.value = !0;
|
|
393
393
|
});
|
|
394
|
-
const
|
|
394
|
+
const _ = V({
|
|
395
395
|
get() {
|
|
396
396
|
return m.value === null ? "" : ct(m.value);
|
|
397
397
|
},
|
|
398
|
-
set(
|
|
399
|
-
if (
|
|
400
|
-
const
|
|
401
|
-
|
|
398
|
+
set(S) {
|
|
399
|
+
if (S) {
|
|
400
|
+
const k = /* @__PURE__ */ new Date(`${S} ${v.value}`);
|
|
401
|
+
k.setSeconds(59, 999), m.value = k;
|
|
402
402
|
} else
|
|
403
403
|
m.value = null;
|
|
404
404
|
}
|
|
405
|
-
}),
|
|
405
|
+
}), v = V({
|
|
406
406
|
get() {
|
|
407
407
|
return m.value === null ? "" : it(m.value);
|
|
408
408
|
},
|
|
409
|
-
set(
|
|
410
|
-
if (
|
|
411
|
-
const
|
|
412
|
-
|
|
409
|
+
set(S) {
|
|
410
|
+
if (S) {
|
|
411
|
+
const k = /* @__PURE__ */ new Date(`${_.value} ${S}`);
|
|
412
|
+
k.setSeconds(59, 999), m.value = k;
|
|
413
413
|
} else
|
|
414
414
|
m.value = null;
|
|
415
415
|
}
|
|
416
416
|
});
|
|
417
|
-
async function
|
|
417
|
+
async function R() {
|
|
418
418
|
e.value = !0, l.onFinished(m.value.toISOString());
|
|
419
419
|
}
|
|
420
|
-
return (
|
|
421
|
-
const
|
|
422
|
-
return
|
|
420
|
+
return (S, k) => {
|
|
421
|
+
const $ = U("FmLabel"), P = U("FmDatePicker"), I = U("FmTimePicker"), n = U("FmButton"), a = U("FmForm");
|
|
422
|
+
return p.value ? (j(), se(a, {
|
|
423
423
|
key: 1,
|
|
424
|
-
onValidationSuccess:
|
|
424
|
+
onValidationSuccess: R,
|
|
425
425
|
class: "flex flex-col gap-32",
|
|
426
426
|
disabled: e.value
|
|
427
427
|
}, {
|
|
428
428
|
default: Y(() => [
|
|
429
|
-
|
|
429
|
+
k[5] || (k[5] = r("div", { class: "fm-typo-en-body-lg-400" }, [
|
|
430
430
|
r("p", null, [
|
|
431
431
|
X(" Performing "),
|
|
432
432
|
r("span", { class: "fm-typo-en-body-lg-600" }, '"Refresh Balance"'),
|
|
@@ -439,34 +439,34 @@ const la = { class: "flex flex-col" }, ca = { class: "flex gap-12 py-8 justify-e
|
|
|
439
439
|
])
|
|
440
440
|
], -1)),
|
|
441
441
|
r("div", la, [
|
|
442
|
-
|
|
443
|
-
default: Y(() =>
|
|
442
|
+
h($, { class: "fm-typo-en-body-lg-600" }, {
|
|
443
|
+
default: Y(() => k[3] || (k[3] = [
|
|
444
444
|
X("Closing Date")
|
|
445
445
|
])),
|
|
446
446
|
_: 1
|
|
447
447
|
}),
|
|
448
|
-
|
|
449
|
-
modelValue:
|
|
450
|
-
"onUpdate:modelValue":
|
|
448
|
+
h(P, {
|
|
449
|
+
modelValue: _.value,
|
|
450
|
+
"onUpdate:modelValue": k[0] || (k[0] = (D) => _.value = D)
|
|
451
451
|
}, null, 8, ["modelValue"]),
|
|
452
|
-
|
|
453
|
-
default: Y(() =>
|
|
452
|
+
h($, { class: "fm-typo-en-body-lg-600" }, {
|
|
453
|
+
default: Y(() => k[4] || (k[4] = [
|
|
454
454
|
X("Closing Time")
|
|
455
455
|
])),
|
|
456
456
|
_: 1
|
|
457
457
|
}),
|
|
458
|
-
|
|
459
|
-
modelValue:
|
|
460
|
-
"onUpdate:modelValue":
|
|
458
|
+
h(I, {
|
|
459
|
+
modelValue: v.value,
|
|
460
|
+
"onUpdate:modelValue": k[1] || (k[1] = (D) => v.value = D)
|
|
461
461
|
}, null, 8, ["modelValue"])
|
|
462
462
|
]),
|
|
463
463
|
r("div", ca, [
|
|
464
|
-
|
|
464
|
+
h(n, {
|
|
465
465
|
label: "Cancel",
|
|
466
466
|
variant: "tertiary",
|
|
467
|
-
onClick:
|
|
467
|
+
onClick: k[2] || (k[2] = (D) => S.onCancel())
|
|
468
468
|
}),
|
|
469
|
-
|
|
469
|
+
h(n, {
|
|
470
470
|
label: "Refresh balance",
|
|
471
471
|
type: "submit",
|
|
472
472
|
variant: "primary",
|
|
@@ -475,7 +475,7 @@ const la = { class: "flex flex-col" }, ca = { class: "flex gap-12 py-8 justify-e
|
|
|
475
475
|
])
|
|
476
476
|
]),
|
|
477
477
|
_: 1
|
|
478
|
-
}, 8, ["disabled"])) : (
|
|
478
|
+
}, 8, ["disabled"])) : (j(), L(ee, { key: 0 }, [
|
|
479
479
|
X("Loading")
|
|
480
480
|
], 64));
|
|
481
481
|
};
|
|
@@ -483,18 +483,18 @@ const la = { class: "flex flex-col" }, ca = { class: "flex gap-12 py-8 justify-e
|
|
|
483
483
|
}), Ee = pt(
|
|
484
484
|
"closingDraftActions",
|
|
485
485
|
function() {
|
|
486
|
-
const l = Ot(), e = Ge(), m = We(),
|
|
487
|
-
function
|
|
488
|
-
const
|
|
486
|
+
const l = Ot(), e = Ge(), m = We(), p = Ne(), _ = vt(), v = H(!1), R = H();
|
|
487
|
+
function S(f) {
|
|
488
|
+
const y = {
|
|
489
489
|
draft: f
|
|
490
490
|
};
|
|
491
|
-
|
|
491
|
+
R.value = y, v.value = !0;
|
|
492
492
|
}
|
|
493
|
-
async function
|
|
493
|
+
async function k(f) {
|
|
494
494
|
var A;
|
|
495
495
|
if (f.status === pe.enum.COMPLETED) {
|
|
496
|
-
const
|
|
497
|
-
if (!
|
|
496
|
+
const w = f.closingAdjustmentId;
|
|
497
|
+
if (!w)
|
|
498
498
|
return e.open({
|
|
499
499
|
title: "Something went wrong",
|
|
500
500
|
message: "Closing draft is completed but closing document cannot be found.",
|
|
@@ -502,22 +502,22 @@ const la = { class: "flex flex-col" }, ca = { class: "flex gap-12 py-8 justify-e
|
|
|
502
502
|
}), console.error("Closing draft is completed but closing document cannot be found.", {
|
|
503
503
|
draftId: f._id
|
|
504
504
|
}), [];
|
|
505
|
-
const
|
|
506
|
-
return ((
|
|
507
|
-
id:
|
|
508
|
-
balance:
|
|
509
|
-
costs:
|
|
505
|
+
const M = await m.readAdjustmentById(w);
|
|
506
|
+
return ((M == null ? void 0 : M.skus) ?? []).map((W) => ({
|
|
507
|
+
id: W.sku._id,
|
|
508
|
+
balance: W.fromBalance,
|
|
509
|
+
costs: W.fromCostBalances
|
|
510
510
|
}));
|
|
511
511
|
} else
|
|
512
|
-
return await
|
|
512
|
+
return await _.readStockBalance(), ((A = _.stockBalance) == null ? void 0 : A.skus) ?? [];
|
|
513
513
|
}
|
|
514
|
-
async function
|
|
515
|
-
|
|
514
|
+
async function $(f, y, A) {
|
|
515
|
+
y || (e.open({
|
|
516
516
|
title: "Exporting",
|
|
517
517
|
message: "Fetching data..."
|
|
518
|
-
}),
|
|
518
|
+
}), y = await k(f)), ra(f, y, A ?? []);
|
|
519
519
|
}
|
|
520
|
-
function P(f,
|
|
520
|
+
function P(f, y) {
|
|
521
521
|
l.open({
|
|
522
522
|
title: "Approve draft",
|
|
523
523
|
contentComponent: Oe,
|
|
@@ -525,13 +525,13 @@ const la = { class: "flex flex-col" }, ca = { class: "flex gap-12 py-8 justify-e
|
|
|
525
525
|
draft: f,
|
|
526
526
|
action: z.enum.approveDraft,
|
|
527
527
|
onFinished: () => {
|
|
528
|
-
l.close(),
|
|
528
|
+
l.close(), y == null || y();
|
|
529
529
|
},
|
|
530
530
|
onCancel: () => l.close()
|
|
531
531
|
}
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
|
-
function
|
|
534
|
+
function I(f, y) {
|
|
535
535
|
l.open({
|
|
536
536
|
title: "Reject draft",
|
|
537
537
|
contentComponent: Oe,
|
|
@@ -539,13 +539,13 @@ const la = { class: "flex flex-col" }, ca = { class: "flex gap-12 py-8 justify-e
|
|
|
539
539
|
draft: f,
|
|
540
540
|
action: z.enum.rejectDraft,
|
|
541
541
|
onFinished: () => {
|
|
542
|
-
l.close(),
|
|
542
|
+
l.close(), y == null || y();
|
|
543
543
|
},
|
|
544
544
|
onCancel: () => l.close()
|
|
545
545
|
}
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function n(f, y) {
|
|
549
549
|
l.open({
|
|
550
550
|
title: "Mark draft as failed",
|
|
551
551
|
contentComponent: Oe,
|
|
@@ -553,14 +553,14 @@ const la = { class: "flex flex-col" }, ca = { class: "flex gap-12 py-8 justify-e
|
|
|
553
553
|
draft: f,
|
|
554
554
|
action: z.enum.markAsFailed,
|
|
555
555
|
onFinished: () => {
|
|
556
|
-
l.close(),
|
|
556
|
+
l.close(), y == null || y();
|
|
557
557
|
},
|
|
558
558
|
onCancel: () => l.close()
|
|
559
559
|
}
|
|
560
560
|
});
|
|
561
561
|
}
|
|
562
|
-
async function a(f,
|
|
563
|
-
await
|
|
562
|
+
async function a(f, y) {
|
|
563
|
+
await p.sync({
|
|
564
564
|
_id: f._id,
|
|
565
565
|
_rev: f._rev ?? "",
|
|
566
566
|
action: z.enum.approveDraft,
|
|
@@ -571,42 +571,42 @@ const la = { class: "flex flex-col" }, ca = { class: "flex gap-12 py-8 justify-e
|
|
|
571
571
|
title: "Success",
|
|
572
572
|
message: "Sync requested",
|
|
573
573
|
type: "success"
|
|
574
|
-
}),
|
|
574
|
+
}), y == null || y();
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
|
|
576
|
+
function D() {
|
|
577
|
+
v.value = !1;
|
|
578
578
|
}
|
|
579
|
-
async function O(f,
|
|
579
|
+
async function O(f, y, A) {
|
|
580
580
|
await l.open({
|
|
581
581
|
title: "Refresh balance",
|
|
582
582
|
contentComponent: ia,
|
|
583
583
|
contentComponentProps: {
|
|
584
584
|
draft: f,
|
|
585
|
-
onFinished: (
|
|
586
|
-
l.close(), A == null || A(
|
|
585
|
+
onFinished: (w) => {
|
|
586
|
+
l.close(), A == null || A(w);
|
|
587
587
|
},
|
|
588
588
|
onCancel: async () => {
|
|
589
|
-
l.close(),
|
|
589
|
+
l.close(), y == null || y();
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
592
|
});
|
|
593
593
|
}
|
|
594
594
|
return {
|
|
595
|
-
viewDraft:
|
|
596
|
-
closeDraftDialog:
|
|
595
|
+
viewDraft: S,
|
|
596
|
+
closeDraftDialog: D,
|
|
597
597
|
approveDraft: P,
|
|
598
|
-
rejectDraft:
|
|
599
|
-
markAsFailed:
|
|
598
|
+
rejectDraft: I,
|
|
599
|
+
markAsFailed: n,
|
|
600
600
|
syncDraft: a,
|
|
601
|
-
exportDraft:
|
|
601
|
+
exportDraft: $,
|
|
602
602
|
refreshBalance: O,
|
|
603
|
-
viewClosingDraftShow:
|
|
604
|
-
viewClosingDraftProps:
|
|
603
|
+
viewClosingDraftShow: v,
|
|
604
|
+
viewClosingDraftProps: R
|
|
605
605
|
};
|
|
606
606
|
}
|
|
607
607
|
);
|
|
608
|
-
function Le(
|
|
609
|
-
switch (
|
|
608
|
+
function Le(s) {
|
|
609
|
+
switch (s) {
|
|
610
610
|
case "DRAFT":
|
|
611
611
|
return "fm-status-badge-draft";
|
|
612
612
|
case "PROCESSING":
|
|
@@ -620,57 +620,57 @@ function Le(o) {
|
|
|
620
620
|
const ua = pt(
|
|
621
621
|
"closingDraftTable",
|
|
622
622
|
function() {
|
|
623
|
-
const { t: l } = ft(), e = Ee(), m = H(new Array()),
|
|
624
|
-
async function
|
|
625
|
-
if (m.value = [], !!
|
|
626
|
-
|
|
623
|
+
const { t: l } = ft(), e = Ee(), m = H(new Array()), p = H(!1), _ = ze(), v = Ne();
|
|
624
|
+
async function R() {
|
|
625
|
+
if (m.value = [], !!_._currentLocation) {
|
|
626
|
+
p.value = !0;
|
|
627
627
|
try {
|
|
628
|
-
const [
|
|
629
|
-
m.value =
|
|
630
|
-
} catch (
|
|
631
|
-
console.log("Something went wrong when fetching drafts:",
|
|
628
|
+
const [n] = await Promise.all([v.readDrafts()]).delayed(1e3);
|
|
629
|
+
m.value = n.reverse();
|
|
630
|
+
} catch (n) {
|
|
631
|
+
console.log("Something went wrong when fetching drafts:", n);
|
|
632
632
|
} finally {
|
|
633
|
-
|
|
633
|
+
p.value = !1;
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
|
-
async function
|
|
638
|
-
if (!m.value.find((a) => a._id) &&
|
|
639
|
-
|
|
637
|
+
async function S(n) {
|
|
638
|
+
if (!m.value.find((a) => a._id) && _._currentLocation) {
|
|
639
|
+
p.value = !0;
|
|
640
640
|
try {
|
|
641
641
|
const [a] = await Promise.all([
|
|
642
|
-
|
|
643
|
-
new Promise((
|
|
642
|
+
v.getDraft(n),
|
|
643
|
+
new Promise((D) => setTimeout(D, 1e3))
|
|
644
644
|
]);
|
|
645
645
|
m.value = [a];
|
|
646
646
|
} catch (a) {
|
|
647
647
|
console.log("Something went wrong when fetching drafts:", a);
|
|
648
648
|
} finally {
|
|
649
|
-
|
|
649
|
+
p.value = !1;
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
function
|
|
654
|
-
m.value = m.value.map((a) => a._id ===
|
|
655
|
-
...
|
|
653
|
+
function k(n) {
|
|
654
|
+
m.value = m.value.map((a) => a._id === n._id ? {
|
|
655
|
+
...n,
|
|
656
656
|
_rev: a._rev
|
|
657
657
|
} : a);
|
|
658
658
|
}
|
|
659
|
-
function
|
|
660
|
-
e.closeDraftDialog(),
|
|
659
|
+
function $() {
|
|
660
|
+
e.closeDraftDialog(), R();
|
|
661
661
|
}
|
|
662
|
-
function P(
|
|
663
|
-
switch (a = It(a),
|
|
662
|
+
function P(n, a) {
|
|
663
|
+
switch (a = It(a), n) {
|
|
664
664
|
case Re.Details:
|
|
665
665
|
return e.viewDraft(a);
|
|
666
666
|
case Re.Export:
|
|
667
667
|
return e.exportDraft(a);
|
|
668
668
|
case z.enum.approveDraft:
|
|
669
|
-
return e.approveDraft(a,
|
|
669
|
+
return e.approveDraft(a, $);
|
|
670
670
|
case z.enum.rejectDraft:
|
|
671
|
-
return e.rejectDraft(a,
|
|
671
|
+
return e.rejectDraft(a, $);
|
|
672
672
|
case z.enum.markAsFailed:
|
|
673
|
-
return e.markAsFailed(a,
|
|
673
|
+
return e.markAsFailed(a, $);
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
676
|
return {
|
|
@@ -679,25 +679,25 @@ const ua = pt(
|
|
|
679
679
|
id: "_id",
|
|
680
680
|
accessorKey: "_id",
|
|
681
681
|
header: () => l("inventory.closing.table.createdAt"),
|
|
682
|
-
cell(
|
|
683
|
-
return Mt(`${
|
|
682
|
+
cell(n) {
|
|
683
|
+
return Mt(`${n.getValue()}`);
|
|
684
684
|
},
|
|
685
685
|
enableSorting: !0
|
|
686
686
|
},
|
|
687
687
|
{
|
|
688
688
|
accessorKey: "effectiveAt",
|
|
689
689
|
header: () => "Effective at",
|
|
690
|
-
cell(
|
|
691
|
-
const a =
|
|
692
|
-
let
|
|
693
|
-
return
|
|
690
|
+
cell(n) {
|
|
691
|
+
const a = n.row.original;
|
|
692
|
+
let D = n.getValue();
|
|
693
|
+
return D || (D = Ke(a._id)), ve(D);
|
|
694
694
|
},
|
|
695
695
|
enableSorting: !0,
|
|
696
696
|
size: 200
|
|
697
697
|
},
|
|
698
698
|
{
|
|
699
699
|
id: "updatedAt",
|
|
700
|
-
accessorFn: (
|
|
700
|
+
accessorFn: (n) => ve(n.updatedAt),
|
|
701
701
|
header: () => "Updated at",
|
|
702
702
|
enableSorting: !0,
|
|
703
703
|
size: 200
|
|
@@ -711,9 +711,9 @@ const ua = pt(
|
|
|
711
711
|
},
|
|
712
712
|
{
|
|
713
713
|
id: "noOfItems",
|
|
714
|
-
accessorFn: (
|
|
714
|
+
accessorFn: (n) => {
|
|
715
715
|
var a;
|
|
716
|
-
return
|
|
716
|
+
return n.items.length + (((a = n.negativeStockItems) == null ? void 0 : a.length) ?? 0);
|
|
717
717
|
},
|
|
718
718
|
header: () => l("inventory.closing.table.noOfItems"),
|
|
719
719
|
enableSorting: !1,
|
|
@@ -724,63 +724,63 @@ const ua = pt(
|
|
|
724
724
|
},
|
|
725
725
|
{
|
|
726
726
|
id: "recentRemark",
|
|
727
|
-
accessorFn: (
|
|
727
|
+
accessorFn: (n) => {
|
|
728
728
|
var a;
|
|
729
|
-
return (
|
|
729
|
+
return (n == null ? void 0 : n.approveRemark) ?? ((a = n == null ? void 0 : n.rejectionHistory) == null ? void 0 : a.computeFirst((D) => D.rejectRemark)) ?? n.remark;
|
|
730
730
|
},
|
|
731
731
|
header: () => "Recent remark"
|
|
732
732
|
},
|
|
733
733
|
{
|
|
734
734
|
id: "status",
|
|
735
|
-
accessorFn: (
|
|
735
|
+
accessorFn: (n) => n.status,
|
|
736
736
|
header: () => l("inventory.closing.table.status"),
|
|
737
737
|
enableSorting: !1,
|
|
738
|
-
cell(
|
|
738
|
+
cell(n) {
|
|
739
739
|
var A;
|
|
740
|
-
const a =
|
|
741
|
-
return
|
|
740
|
+
const a = n.row.original, D = a.status, O = new Date(a.updatedAt), f = (A = a == null ? void 0 : a.rejectionHistory) == null ? void 0 : A.computeFirst((w) => w.rejectedAt), y = f ? new Date(f) : null;
|
|
741
|
+
return D === "DRAFT" && y ? y.getTime() > O.getTime() ? T(
|
|
742
742
|
"div",
|
|
743
743
|
{
|
|
744
744
|
class: "flex"
|
|
745
745
|
},
|
|
746
|
-
|
|
746
|
+
T(
|
|
747
747
|
"div",
|
|
748
748
|
{
|
|
749
749
|
class: ["fm-status-badge", Le("FAILED")]
|
|
750
750
|
},
|
|
751
751
|
"Rejected"
|
|
752
752
|
)
|
|
753
|
-
) :
|
|
753
|
+
) : T(
|
|
754
754
|
"div",
|
|
755
755
|
{
|
|
756
756
|
class: "flex"
|
|
757
757
|
},
|
|
758
|
-
|
|
758
|
+
T(
|
|
759
759
|
"div",
|
|
760
760
|
{
|
|
761
761
|
class: ["fm-status-badge", Le("PROCESSING")]
|
|
762
762
|
},
|
|
763
763
|
"Updated"
|
|
764
764
|
)
|
|
765
|
-
) :
|
|
765
|
+
) : T(
|
|
766
766
|
"div",
|
|
767
767
|
{
|
|
768
768
|
class: "flex"
|
|
769
769
|
},
|
|
770
|
-
|
|
770
|
+
T(
|
|
771
771
|
"div",
|
|
772
772
|
{
|
|
773
|
-
class: ["fm-status-badge", Le(
|
|
773
|
+
class: ["fm-status-badge", Le(D)]
|
|
774
774
|
},
|
|
775
|
-
Ue(
|
|
775
|
+
Ue(D)
|
|
776
776
|
)
|
|
777
777
|
);
|
|
778
778
|
}
|
|
779
779
|
},
|
|
780
780
|
{
|
|
781
781
|
id: "action",
|
|
782
|
-
cell(
|
|
783
|
-
const a =
|
|
782
|
+
cell(n) {
|
|
783
|
+
const a = n.row.original, D = [
|
|
784
784
|
st[Re.Details],
|
|
785
785
|
st[Re.Export]
|
|
786
786
|
], O = [
|
|
@@ -802,7 +802,7 @@ const ua = pt(
|
|
|
802
802
|
];
|
|
803
803
|
return Rt(
|
|
804
804
|
[
|
|
805
|
-
...
|
|
805
|
+
...D,
|
|
806
806
|
...a.status === pe.enum.DRAFT ? O : []
|
|
807
807
|
],
|
|
808
808
|
(f) => P(f, a)
|
|
@@ -817,13 +817,13 @@ const ua = pt(
|
|
|
817
817
|
}
|
|
818
818
|
],
|
|
819
819
|
drafts: m,
|
|
820
|
-
loading:
|
|
821
|
-
fetchDrafts:
|
|
822
|
-
loadDraft:
|
|
823
|
-
updateDraftRef:
|
|
820
|
+
loading: p,
|
|
821
|
+
fetchDrafts: R,
|
|
822
|
+
loadDraft: S,
|
|
823
|
+
updateDraftRef: k
|
|
824
824
|
};
|
|
825
825
|
}
|
|
826
|
-
), da = { class: "w-full flex flex-col gap-32" }, ma = { class: "flex justify-between" }, fa = { class: "flex" }, pa = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, va = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ya = { class: "flex gap-1" }, ga = { class: "fm-typo-en-body-lg-600" }, ba = { class: "flex flex-col gap-16" },
|
|
826
|
+
), da = { class: "w-full flex flex-col gap-32" }, ma = { class: "flex justify-between" }, fa = { class: "flex" }, pa = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, va = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ya = { class: "flex gap-1" }, ga = { class: "fm-typo-en-body-lg-600" }, ba = { class: "flex flex-col gap-16" }, ha = { class: "flex items-center" }, ka = {
|
|
827
827
|
key: 0,
|
|
828
828
|
class: "flex gap-8"
|
|
829
829
|
}, Aa = {
|
|
@@ -860,44 +860,44 @@ const ua = pt(
|
|
|
860
860
|
draft: {}
|
|
861
861
|
},
|
|
862
862
|
emits: ["submitted", "refresh"],
|
|
863
|
-
setup(
|
|
864
|
-
const e =
|
|
865
|
-
|
|
863
|
+
setup(s, { emit: l }) {
|
|
864
|
+
const e = s, m = vt(), p = Ee(), _ = Kt(e, "show"), v = H(!1), R = H(!1), S = H(!1), k = H(new Array()), $ = H(new Array()), P = H([]), I = We(), n = Ne(), a = Ge(), D = Pt(), O = ze(), f = _t({}), y = V(() => new Set(
|
|
865
|
+
D.skus.filter((c) => {
|
|
866
866
|
var t;
|
|
867
867
|
return f[(t = c.customAttributes) == null ? void 0 : t.tag];
|
|
868
868
|
}).map((c) => c._id)
|
|
869
|
-
)), A = l,
|
|
869
|
+
)), A = l, w = H({
|
|
870
870
|
templateItem: !0,
|
|
871
871
|
nonTemplateItem: !0
|
|
872
|
-
}),
|
|
872
|
+
}), M = V(() => {
|
|
873
873
|
var t, d;
|
|
874
874
|
const c = [...((t = e.draft) == null ? void 0 : t.items) ?? [], ...((d = e.draft) == null ? void 0 : d.negativeStockItems) ?? []];
|
|
875
|
-
return
|
|
875
|
+
return y.value.size ? c.filter((i) => y.value.has(i.sku._id)) : c;
|
|
876
876
|
}), Z = V(() => {
|
|
877
|
-
const c =
|
|
877
|
+
const c = M.value.map((t) => t.sku);
|
|
878
878
|
return c.sort((t, d) => t.code.localeCompare(d.code)), c;
|
|
879
|
-
}),
|
|
879
|
+
}), W = V(() => M.value.groupBy(
|
|
880
880
|
(t) => t.sku._id,
|
|
881
881
|
(t) => t.measurementsAmounts.filter((d) => !d.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((d) => d.measurement.id)
|
|
882
882
|
));
|
|
883
883
|
Ye(te), Dt(
|
|
884
884
|
() => e.show,
|
|
885
885
|
(c) => {
|
|
886
|
-
c && (le.value = xe[0], te(),
|
|
886
|
+
c && (le.value = xe[0], te(), w.value = {
|
|
887
887
|
templateItem: !0,
|
|
888
888
|
nonTemplateItem: !0
|
|
889
889
|
});
|
|
890
890
|
}
|
|
891
891
|
);
|
|
892
|
-
const re = Be(0),
|
|
892
|
+
const re = Be(0), B = Be(100);
|
|
893
893
|
async function te() {
|
|
894
|
-
var t, d, i,
|
|
894
|
+
var t, d, i, o;
|
|
895
895
|
if (!O._currentLocation) return;
|
|
896
|
-
|
|
896
|
+
v.value = !0;
|
|
897
897
|
const c = ((t = e.draft) == null ? void 0 : t.status) === pe.enum.COMPLETED;
|
|
898
|
-
|
|
898
|
+
$.value = [];
|
|
899
899
|
try {
|
|
900
|
-
if (await
|
|
900
|
+
if (await D.init(), c) {
|
|
901
901
|
const E = e.draft.closingAdjustmentId;
|
|
902
902
|
if (!E) {
|
|
903
903
|
a.open({
|
|
@@ -909,31 +909,31 @@ const ua = pt(
|
|
|
909
909
|
});
|
|
910
910
|
return;
|
|
911
911
|
}
|
|
912
|
-
const ae = await
|
|
912
|
+
const ae = await I.readAdjustmentById(E), ce = (ae == null ? void 0 : ae.skus) ?? [];
|
|
913
913
|
for (const ne of ce) {
|
|
914
|
-
const
|
|
914
|
+
const Ce = {
|
|
915
915
|
id: ne.sku._id,
|
|
916
916
|
balance: ne.fromBalance,
|
|
917
917
|
costs: ne.fromCostBalances
|
|
918
|
-
},
|
|
918
|
+
}, C = {
|
|
919
919
|
id: ne.sku._id,
|
|
920
920
|
balance: ne.toBalance,
|
|
921
921
|
costs: ne.toCostBalances
|
|
922
922
|
};
|
|
923
|
-
|
|
923
|
+
k.value.push(Ce), $.value.push(C);
|
|
924
924
|
}
|
|
925
925
|
} else
|
|
926
|
-
|
|
926
|
+
k.value = ((i = e.draft) == null ? void 0 : i.stockSnapshot) ?? [];
|
|
927
927
|
const u = /* @__PURE__ */ new Set();
|
|
928
|
-
if ((
|
|
928
|
+
if ((o = e.draft) != null && o.adjustmentSnapshot)
|
|
929
929
|
for (const E of e.draft.adjustmentSnapshot)
|
|
930
930
|
E.adjustmentsByType && Object.keys(E.adjustmentsByType).forEach((ae) => u.add(ae));
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
u.has(E) && (
|
|
931
|
+
const g = ["receive", "sales", "wastage"], x = [];
|
|
932
|
+
g.forEach((E) => {
|
|
933
|
+
u.has(E) && (x.push(E), u.delete(E));
|
|
934
934
|
});
|
|
935
|
-
const
|
|
936
|
-
P.value = [...
|
|
935
|
+
const b = Array.from(u).sort();
|
|
936
|
+
P.value = [...x, ...b];
|
|
937
937
|
} catch (u) {
|
|
938
938
|
a.open({
|
|
939
939
|
title: "Something went wrong",
|
|
@@ -941,7 +941,7 @@ const ua = pt(
|
|
|
941
941
|
type: "error"
|
|
942
942
|
}), console.error("error on fetch stock balances", u);
|
|
943
943
|
} finally {
|
|
944
|
-
|
|
944
|
+
v.value = !1;
|
|
945
945
|
}
|
|
946
946
|
}
|
|
947
947
|
async function be() {
|
|
@@ -954,20 +954,20 @@ const ua = pt(
|
|
|
954
954
|
});
|
|
955
955
|
return;
|
|
956
956
|
}
|
|
957
|
-
await
|
|
957
|
+
await p.refreshBalance(
|
|
958
958
|
e.draft,
|
|
959
959
|
() => {
|
|
960
960
|
},
|
|
961
961
|
async (i) => {
|
|
962
|
-
var
|
|
963
|
-
|
|
964
|
-
const
|
|
962
|
+
var x;
|
|
963
|
+
R.value = !0;
|
|
964
|
+
const o = (x = e.draft) == null ? void 0 : x._rev, u = 30, g = 2e3;
|
|
965
965
|
try {
|
|
966
|
-
await
|
|
967
|
-
let
|
|
968
|
-
for (let E = 0; E < u && (
|
|
966
|
+
await I.recalculation.scheduleCalculateStockSnapshotAtDate(i, e.draft._id);
|
|
967
|
+
let b = null;
|
|
968
|
+
for (let E = 0; E < u && (b = await n.getDraft(e.draft._id).delayed(g), b._rev === o); E++)
|
|
969
969
|
;
|
|
970
|
-
if (!
|
|
970
|
+
if (!b || b._rev === o) {
|
|
971
971
|
a.open({
|
|
972
972
|
title: "Refresh failed",
|
|
973
973
|
message: "Failed to refresh stock balance. Please try again.",
|
|
@@ -975,29 +975,29 @@ const ua = pt(
|
|
|
975
975
|
}), console.error("error refreshing stock balances: there is no change in _rev");
|
|
976
976
|
return;
|
|
977
977
|
}
|
|
978
|
-
A("refresh",
|
|
978
|
+
A("refresh", b), k.value = b.stockSnapshot ?? [], a.open({
|
|
979
979
|
title: "Balance refreshed",
|
|
980
980
|
message: "Stock balance has been recalculated.",
|
|
981
981
|
type: "success"
|
|
982
|
-
});
|
|
983
|
-
} catch (
|
|
982
|
+
}), _.value = !1;
|
|
983
|
+
} catch (b) {
|
|
984
984
|
a.open({
|
|
985
985
|
title: "Refresh failed",
|
|
986
986
|
message: "Failed to refresh stock balance. Please try again.",
|
|
987
987
|
type: "error"
|
|
988
|
-
}), console.error("error refreshing stock balances",
|
|
988
|
+
}), console.error("error refreshing stock balances", b);
|
|
989
989
|
} finally {
|
|
990
|
-
|
|
990
|
+
R.value = !1;
|
|
991
991
|
}
|
|
992
992
|
}
|
|
993
993
|
);
|
|
994
994
|
}
|
|
995
|
-
const
|
|
996
|
-
() =>
|
|
995
|
+
const he = V(
|
|
996
|
+
() => k.value.groupBy(
|
|
997
997
|
(c) => c.id,
|
|
998
998
|
(c) => c.balance
|
|
999
999
|
)
|
|
1000
|
-
), fe = V(() =>
|
|
1000
|
+
), fe = V(() => M.value.groupBy((c) => c.sku._id)), ye = V(() => {
|
|
1001
1001
|
var c;
|
|
1002
1002
|
return (c = e.draft) != null && c.adjustmentSnapshot ? new Map(e.draft.adjustmentSnapshot.map((t) => [t.skuId, t.adjustmentsByType])) : /* @__PURE__ */ new Map();
|
|
1003
1003
|
}), ge = V(() => {
|
|
@@ -1005,7 +1005,7 @@ const ua = pt(
|
|
|
1005
1005
|
return (c = e.draft) != null && c.opening ? new Map(e.draft.opening.map((t) => [t.skuId, t.balance])) : /* @__PURE__ */ new Map();
|
|
1006
1006
|
});
|
|
1007
1007
|
function Q(c, t) {
|
|
1008
|
-
return
|
|
1008
|
+
return T(
|
|
1009
1009
|
Ve.FmTooltip,
|
|
1010
1010
|
{ zIndex: 51, placement: "left", class: "w-full flex justify-end" },
|
|
1011
1011
|
{
|
|
@@ -1018,10 +1018,10 @@ const ua = pt(
|
|
|
1018
1018
|
}
|
|
1019
1019
|
);
|
|
1020
1020
|
}
|
|
1021
|
-
const
|
|
1021
|
+
const we = V(() => {
|
|
1022
1022
|
const c = Z.value.reduce((d, i) => {
|
|
1023
|
-
var
|
|
1024
|
-
return Math.max(d, ((u = (
|
|
1023
|
+
var o, u;
|
|
1024
|
+
return Math.max(d, ((u = (o = W.value) == null ? void 0 : o.get(i._id)) == null ? void 0 : u[0].length) ?? 0);
|
|
1025
1025
|
}, 0);
|
|
1026
1026
|
return [
|
|
1027
1027
|
{
|
|
@@ -1030,8 +1030,8 @@ const ua = pt(
|
|
|
1030
1030
|
header: () => "Name",
|
|
1031
1031
|
size: 350,
|
|
1032
1032
|
cell(d) {
|
|
1033
|
-
const i = d.row.original,
|
|
1034
|
-
|
|
1033
|
+
const i = d.row.original, o = i.adjustedDiffPercentage, u = typeof o == "number" && Math.abs(o) > 10, g = T("div", { class: "flex flex-col gap-4" }, [
|
|
1034
|
+
T(
|
|
1035
1035
|
"div",
|
|
1036
1036
|
{
|
|
1037
1037
|
class: [
|
|
@@ -1041,7 +1041,7 @@ const ua = pt(
|
|
|
1041
1041
|
},
|
|
1042
1042
|
i.name
|
|
1043
1043
|
),
|
|
1044
|
-
|
|
1044
|
+
T(
|
|
1045
1045
|
"div",
|
|
1046
1046
|
{
|
|
1047
1047
|
class: [
|
|
@@ -1052,7 +1052,7 @@ const ua = pt(
|
|
|
1052
1052
|
i.code
|
|
1053
1053
|
)
|
|
1054
1054
|
]);
|
|
1055
|
-
return
|
|
1055
|
+
return T(
|
|
1056
1056
|
Ve.FmTooltip,
|
|
1057
1057
|
{
|
|
1058
1058
|
zIndex: 51
|
|
@@ -1062,8 +1062,8 @@ const ua = pt(
|
|
|
1062
1062
|
return u ? "Adjustment difference is more than 10%." : `${i.code} - ${i.name}`;
|
|
1063
1063
|
},
|
|
1064
1064
|
default() {
|
|
1065
|
-
return
|
|
1066
|
-
|
|
1065
|
+
return T("div", { class: "flex items-center gap-4 justify-start w-full" }, [
|
|
1066
|
+
g
|
|
1067
1067
|
]);
|
|
1068
1068
|
}
|
|
1069
1069
|
}
|
|
@@ -1077,7 +1077,7 @@ const ua = pt(
|
|
|
1077
1077
|
size: 160,
|
|
1078
1078
|
cell(d) {
|
|
1079
1079
|
const i = d.row.original.costPerUnit;
|
|
1080
|
-
return
|
|
1080
|
+
return T("div", { class: "text-right" }, i.toFixed(2));
|
|
1081
1081
|
},
|
|
1082
1082
|
meta: {
|
|
1083
1083
|
textAlign: "right"
|
|
@@ -1088,8 +1088,8 @@ const ua = pt(
|
|
|
1088
1088
|
header: () => "UOM",
|
|
1089
1089
|
size: 80,
|
|
1090
1090
|
cell(d) {
|
|
1091
|
-
const i = d.row.original.costUnit,
|
|
1092
|
-
return i ??
|
|
1091
|
+
const i = d.row.original.costUnit, o = d.row.original.baseUnit;
|
|
1092
|
+
return i ?? o;
|
|
1093
1093
|
}
|
|
1094
1094
|
},
|
|
1095
1095
|
{
|
|
@@ -1099,7 +1099,7 @@ const ua = pt(
|
|
|
1099
1099
|
size: 150,
|
|
1100
1100
|
cell(d) {
|
|
1101
1101
|
const i = d.row.original.opening;
|
|
1102
|
-
return
|
|
1102
|
+
return T("div", { class: "text-right" }, i.toFixed(2));
|
|
1103
1103
|
},
|
|
1104
1104
|
meta: {
|
|
1105
1105
|
textAlign: "right"
|
|
@@ -1113,8 +1113,8 @@ const ua = pt(
|
|
|
1113
1113
|
header: () => Q(Ue(d)),
|
|
1114
1114
|
size: 150,
|
|
1115
1115
|
cell(i) {
|
|
1116
|
-
const
|
|
1117
|
-
return
|
|
1116
|
+
const o = i.row.original.adjustmentAmounts[d] ?? { amount: 0, precision: 0 };
|
|
1117
|
+
return T("div", { class: "text-right" }, N(o));
|
|
1118
1118
|
},
|
|
1119
1119
|
meta: {
|
|
1120
1120
|
textAlign: "right"
|
|
@@ -1133,26 +1133,26 @@ const ua = pt(
|
|
|
1133
1133
|
{
|
|
1134
1134
|
id: "physicalBalance",
|
|
1135
1135
|
accessorFn: (d) => {
|
|
1136
|
-
var
|
|
1137
|
-
const i = (
|
|
1136
|
+
var o;
|
|
1137
|
+
const i = (o = $.value.find((u) => u.id === d.id)) == null ? void 0 : o.balance;
|
|
1138
1138
|
return i ? Ie.toFormatString({ value: i }) : d.physicalBalance;
|
|
1139
1139
|
},
|
|
1140
1140
|
header: () => Q("Stock Take balance", "The physical balance recorded during stock take."),
|
|
1141
1141
|
cell(d) {
|
|
1142
|
-
var
|
|
1143
|
-
const i = d.row.original,
|
|
1144
|
-
let u = !0,
|
|
1145
|
-
const
|
|
1146
|
-
return
|
|
1147
|
-
a:
|
|
1148
|
-
b:
|
|
1149
|
-
}) || (u = !1,
|
|
1150
|
-
|
|
1142
|
+
var b;
|
|
1143
|
+
const i = d.row.original, o = Ie.fromNumber(i.physicalBalance);
|
|
1144
|
+
let u = !0, g = i.physicalBalance;
|
|
1145
|
+
const x = (b = $.value.find((E) => E.id === i.id)) == null ? void 0 : b.balance;
|
|
1146
|
+
return x && (Ie.equals({
|
|
1147
|
+
a: o,
|
|
1148
|
+
b: x
|
|
1149
|
+
}) || (u = !1, g = Number(Ie.toFormatString({ value: x })))), T("div", { class: "flex flex-col" }, [
|
|
1150
|
+
T(
|
|
1151
1151
|
"span",
|
|
1152
1152
|
{ class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-primary" },
|
|
1153
|
-
|
|
1153
|
+
g
|
|
1154
1154
|
),
|
|
1155
|
-
u ? null :
|
|
1155
|
+
u ? null : T(
|
|
1156
1156
|
"span",
|
|
1157
1157
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1158
1158
|
`Draft: ${i.physicalBalance.toString()}`
|
|
@@ -1180,7 +1180,7 @@ const ua = pt(
|
|
|
1180
1180
|
size: 150,
|
|
1181
1181
|
cell(d) {
|
|
1182
1182
|
const i = d.row.original.varianceRM;
|
|
1183
|
-
return
|
|
1183
|
+
return T("div", { class: "text-right" }, i.toFixed(2));
|
|
1184
1184
|
},
|
|
1185
1185
|
meta: {
|
|
1186
1186
|
textAlign: "right"
|
|
@@ -1197,17 +1197,17 @@ const ua = pt(
|
|
|
1197
1197
|
cell(d) {
|
|
1198
1198
|
const i = d.row.original.adjustedDiffPercentage;
|
|
1199
1199
|
if (!i) return Ya;
|
|
1200
|
-
const
|
|
1201
|
-
if (
|
|
1202
|
-
return
|
|
1200
|
+
const o = i.toFixed(2);
|
|
1201
|
+
if (o === "0.00")
|
|
1202
|
+
return T("div", { class: "flex items-center gap-4 justify-end" }, ["0.00"]);
|
|
1203
1203
|
const u = i > 0;
|
|
1204
|
-
return
|
|
1205
|
-
|
|
1204
|
+
return T("div", { class: "flex items-center gap-4 justify-end" }, [
|
|
1205
|
+
T(Ve.FmIcon, {
|
|
1206
1206
|
name: u ? "arrow_drop_up" : "arrow_drop_down",
|
|
1207
1207
|
color: u ? "system-success-300" : "system-error-300",
|
|
1208
1208
|
size: "md"
|
|
1209
1209
|
}),
|
|
1210
|
-
|
|
1210
|
+
o
|
|
1211
1211
|
]);
|
|
1212
1212
|
},
|
|
1213
1213
|
meta: {
|
|
@@ -1221,7 +1221,7 @@ const ua = pt(
|
|
|
1221
1221
|
size: 180,
|
|
1222
1222
|
cell(d) {
|
|
1223
1223
|
const i = d.row.original.stockTakeValue;
|
|
1224
|
-
return
|
|
1224
|
+
return T("div", { class: "text-right" }, i.toFixed(2));
|
|
1225
1225
|
},
|
|
1226
1226
|
meta: {
|
|
1227
1227
|
textAlign: "right"
|
|
@@ -1234,7 +1234,7 @@ const ua = pt(
|
|
|
1234
1234
|
size: 180,
|
|
1235
1235
|
cell(d) {
|
|
1236
1236
|
const i = d.row.original.systemValue;
|
|
1237
|
-
return
|
|
1237
|
+
return T("div", { class: "text-right" }, i.toFixed(2));
|
|
1238
1238
|
},
|
|
1239
1239
|
meta: {
|
|
1240
1240
|
textAlign: "right"
|
|
@@ -1245,41 +1245,41 @@ const ua = pt(
|
|
|
1245
1245
|
header: () => "Amounts",
|
|
1246
1246
|
enableSorting: !1,
|
|
1247
1247
|
cell(d) {
|
|
1248
|
-
const i = d.row.original,
|
|
1248
|
+
const i = d.row.original, o = (g, x) => T(
|
|
1249
1249
|
Ve.FmTooltip,
|
|
1250
1250
|
{ zIndex: 50 },
|
|
1251
1251
|
{
|
|
1252
1252
|
default() {
|
|
1253
|
-
return
|
|
1253
|
+
return T(
|
|
1254
1254
|
"div",
|
|
1255
1255
|
{
|
|
1256
1256
|
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"
|
|
1257
1257
|
},
|
|
1258
1258
|
[
|
|
1259
|
-
|
|
1260
|
-
|
|
1259
|
+
T("span", { class: "text-fm-color-typo-primary" }, `${g} `),
|
|
1260
|
+
T(
|
|
1261
1261
|
"span",
|
|
1262
1262
|
{
|
|
1263
1263
|
class: "text-fm-color-typo-secondary",
|
|
1264
1264
|
style: { maxWidth: "80px" }
|
|
1265
1265
|
},
|
|
1266
|
-
|
|
1266
|
+
x
|
|
1267
1267
|
)
|
|
1268
1268
|
]
|
|
1269
1269
|
);
|
|
1270
1270
|
},
|
|
1271
1271
|
content() {
|
|
1272
|
-
return `${
|
|
1272
|
+
return `${g} ${x}`;
|
|
1273
1273
|
}
|
|
1274
1274
|
}
|
|
1275
1275
|
);
|
|
1276
|
-
let u = Array.from({ length: c }).map((
|
|
1277
|
-
if (!i[`measurementAmount${
|
|
1276
|
+
let u = Array.from({ length: c }).map((g, x) => {
|
|
1277
|
+
if (!i[`measurementAmount${x}`])
|
|
1278
1278
|
return null;
|
|
1279
|
-
const
|
|
1280
|
-
return
|
|
1281
|
-
}).filter((
|
|
1282
|
-
return (i.baseUnitAmount || !u.length) && (u = [
|
|
1279
|
+
const b = i[`measurementAmount${x}`], E = i[`measurementAbbrev${x}`];
|
|
1280
|
+
return o(b, E);
|
|
1281
|
+
}).filter((g) => g);
|
|
1282
|
+
return (i.baseUnitAmount || !u.length) && (u = [o(i.baseUnitAmount, i.baseUnit), ...u]), T(
|
|
1283
1283
|
"div",
|
|
1284
1284
|
{
|
|
1285
1285
|
class: "flex gap-8 flex-nowrap",
|
|
@@ -1292,33 +1292,33 @@ const ua = pt(
|
|
|
1292
1292
|
}
|
|
1293
1293
|
}
|
|
1294
1294
|
];
|
|
1295
|
-
}),
|
|
1295
|
+
}), ke = V(() => we.value.map((c) => c.size ?? 0).reduce((c, t) => c + t)), Ae = H(""), Se = V(() => {
|
|
1296
1296
|
var d, i;
|
|
1297
1297
|
const c = ((i = (d = e.draft) == null ? void 0 : d.negativeStockItems) == null ? void 0 : i.reduce(
|
|
1298
|
-
(
|
|
1298
|
+
(o, u) => (o[u.sku._id] = u, o),
|
|
1299
1299
|
{}
|
|
1300
1300
|
)) ?? {};
|
|
1301
|
-
return Z.value.map((
|
|
1301
|
+
return Z.value.map((o) => {
|
|
1302
1302
|
var qe, Ze, Je, Xe, et, tt, at, nt, ot;
|
|
1303
|
-
const u = (qe = fe.value.get(
|
|
1304
|
-
if (P.value.forEach((
|
|
1305
|
-
const oe = ce[
|
|
1306
|
-
ue && (ce[
|
|
1303
|
+
const u = (qe = fe.value.get(o._id)) == null ? void 0 : qe[0], g = ((Ze = he.value.get(o._id)) == null ? void 0 : Ze[0]) ?? re, x = (Je = o.defaultCost) != null && Je.costPerUnit ? o.defaultCost.costPerUnit.amount / Math.pow(10, o.defaultCost.costPerUnit.precision) : 0, b = ge.value.get(o._id), E = b ? +N(b) : 0, ae = ye.value.get(o._id), ce = {};
|
|
1304
|
+
if (P.value.forEach((G) => {
|
|
1305
|
+
const oe = ce[G] ?? { amount: 0, precision: 0 }, ue = ae == null ? void 0 : ae[G];
|
|
1306
|
+
ue && (ce[G] = Vt(oe, ue));
|
|
1307
1307
|
}), !u) {
|
|
1308
|
-
const
|
|
1308
|
+
const G = +N(g), oe = G - 0, ue = oe * x, Me = 0, xt = G * x;
|
|
1309
1309
|
return {
|
|
1310
|
-
id:
|
|
1311
|
-
code:
|
|
1312
|
-
name:
|
|
1313
|
-
costUnit: ((et = (Xe =
|
|
1314
|
-
baseUnit:
|
|
1310
|
+
id: o._id,
|
|
1311
|
+
code: o.code,
|
|
1312
|
+
name: o.name,
|
|
1313
|
+
costUnit: ((et = (Xe = o.defaultCost) == null ? void 0 : Xe.measurement) == null ? void 0 : et.abbrev) ?? null,
|
|
1314
|
+
baseUnit: o.unit.abbrev,
|
|
1315
1315
|
baseUnitAmount: 0,
|
|
1316
|
-
systemBalance:
|
|
1316
|
+
systemBalance: G,
|
|
1317
1317
|
physicalBalance: 0,
|
|
1318
|
-
adjustedAmount: -
|
|
1318
|
+
adjustedAmount: -G,
|
|
1319
1319
|
adjustedDiffPercentage: -100,
|
|
1320
|
-
isTemplateItem: !c[
|
|
1321
|
-
costPerUnit:
|
|
1320
|
+
isTemplateItem: !c[o._id],
|
|
1321
|
+
costPerUnit: x,
|
|
1322
1322
|
opening: E,
|
|
1323
1323
|
varianceQty: oe,
|
|
1324
1324
|
varianceRM: ue,
|
|
@@ -1327,42 +1327,42 @@ const ua = pt(
|
|
|
1327
1327
|
adjustmentAmounts: ce
|
|
1328
1328
|
};
|
|
1329
1329
|
}
|
|
1330
|
-
const ne = yt(u),
|
|
1331
|
-
(
|
|
1332
|
-
)) == null ? void 0 : at.balance,
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
), K =
|
|
1336
|
-
...
|
|
1337
|
-
amount: Math.abs(
|
|
1338
|
-
}),
|
|
1330
|
+
const ne = yt(u), Ce = (at = (tt = $.value) == null ? void 0 : tt.find(
|
|
1331
|
+
(G) => G.id === o._id
|
|
1332
|
+
)) == null ? void 0 : at.balance, C = ut(
|
|
1333
|
+
Ce ?? ne,
|
|
1334
|
+
g
|
|
1335
|
+
), K = g.amount === 0 ? null : dt(C, {
|
|
1336
|
+
...g,
|
|
1337
|
+
amount: Math.abs(g.amount)
|
|
1338
|
+
}), q = K ? Qe(K, B) : null, ie = +N(g), _e = +N(ne), $e = ie - _e, ht = $e * x, kt = _e * x, At = ie * x;
|
|
1339
1339
|
return {
|
|
1340
|
-
id:
|
|
1341
|
-
code:
|
|
1342
|
-
name:
|
|
1343
|
-
costUnit: ((ot = (nt =
|
|
1344
|
-
baseUnit:
|
|
1340
|
+
id: o._id,
|
|
1341
|
+
code: o.code,
|
|
1342
|
+
name: o.name,
|
|
1343
|
+
costUnit: ((ot = (nt = o.defaultCost) == null ? void 0 : nt.measurement) == null ? void 0 : ot.abbrev) ?? null,
|
|
1344
|
+
baseUnit: o.unit.abbrev,
|
|
1345
1345
|
baseUnitAmount: +N(u.baseAmount),
|
|
1346
|
-
...u.measurementsAmounts.filter((
|
|
1346
|
+
...u.measurementsAmounts.filter((G) => {
|
|
1347
1347
|
var oe, ue, Me;
|
|
1348
|
-
return (Me = (ue = (oe =
|
|
1349
|
-
}).reduce((
|
|
1348
|
+
return (Me = (ue = (oe = W.value) == null ? void 0 : oe.get(o._id)) == null ? void 0 : ue[0]) == null ? void 0 : Me.includes(G.measurement.id);
|
|
1349
|
+
}).reduce((G, oe, ue) => (G[`measurementAbbrev${ue}`] = `(${oe.measurement.abbrev}) × ${N(oe.measurement.conversion)}`, G[`measurementAmount${ue}`] = +N(oe.amount), G), {}),
|
|
1350
1350
|
systemBalance: ie,
|
|
1351
|
-
physicalBalance:
|
|
1352
|
-
adjustedAmount: +N(
|
|
1353
|
-
adjustedDiffPercentage:
|
|
1354
|
-
isTemplateItem: !c[
|
|
1355
|
-
costPerUnit:
|
|
1351
|
+
physicalBalance: _e,
|
|
1352
|
+
adjustedAmount: +N(C),
|
|
1353
|
+
adjustedDiffPercentage: q ? +N(mt(q, 2)) : null,
|
|
1354
|
+
isTemplateItem: !c[o._id],
|
|
1355
|
+
costPerUnit: x,
|
|
1356
1356
|
opening: E,
|
|
1357
1357
|
varianceQty: $e,
|
|
1358
|
-
varianceRM:
|
|
1359
|
-
stockTakeValue:
|
|
1358
|
+
varianceRM: ht,
|
|
1359
|
+
stockTakeValue: kt,
|
|
1360
1360
|
systemValue: At,
|
|
1361
1361
|
adjustmentAmounts: ce
|
|
1362
1362
|
};
|
|
1363
|
-
}).filter((
|
|
1363
|
+
}).filter((o) => !!(o.isTemplateItem && w.value.templateItem || !o.isTemplateItem && w.value.nonTemplateItem));
|
|
1364
1364
|
}), Fe = V(() => {
|
|
1365
|
-
var t, d, i,
|
|
1365
|
+
var t, d, i, o;
|
|
1366
1366
|
if (!e.draft) return [];
|
|
1367
1367
|
const c = e.draft.approvedAt ? {
|
|
1368
1368
|
action: `Approve at ${ve(e.draft.approvedAt)}`,
|
|
@@ -1410,7 +1410,7 @@ const ua = pt(
|
|
|
1410
1410
|
} : null,
|
|
1411
1411
|
c && c.actionBy ? {
|
|
1412
1412
|
label: "Last action by",
|
|
1413
|
-
value: (
|
|
1413
|
+
value: (o = c.actionBy) == null ? void 0 : o.name
|
|
1414
1414
|
} : null,
|
|
1415
1415
|
c && c.remark ? {
|
|
1416
1416
|
label: "Action remark",
|
|
@@ -1427,116 +1427,114 @@ const ua = pt(
|
|
|
1427
1427
|
value: "history"
|
|
1428
1428
|
}
|
|
1429
1429
|
], le = H(xe[0]), me = V(() => {
|
|
1430
|
-
var i,
|
|
1431
|
-
const c = ((i = e.draft) == null ? void 0 : i.activityLogs) ?? [], t = ((
|
|
1432
|
-
for (const
|
|
1430
|
+
var i, o, u;
|
|
1431
|
+
const c = ((i = e.draft) == null ? void 0 : i.activityLogs) ?? [], t = ((o = e.draft) == null ? void 0 : o.rejectionHistory) ?? [];
|
|
1432
|
+
for (const g of t)
|
|
1433
1433
|
c.find(
|
|
1434
|
-
(
|
|
1434
|
+
(b) => `${b.action}_${b.performedAt}` == `${z.enum.rejectDraft}_${g.rejectedAt}`
|
|
1435
1435
|
) || c.push({
|
|
1436
1436
|
action: z.enum.rejectDraft,
|
|
1437
|
-
performedAt:
|
|
1438
|
-
performedBy:
|
|
1439
|
-
remark:
|
|
1437
|
+
performedAt: g.rejectedAt,
|
|
1438
|
+
performedBy: g.rejectedBy,
|
|
1439
|
+
remark: g.rejectRemark
|
|
1440
1440
|
});
|
|
1441
1441
|
return (u = e.draft) != null && u.approvedAt && (c.find(
|
|
1442
|
-
(
|
|
1443
|
-
var
|
|
1444
|
-
return `${
|
|
1442
|
+
(x) => {
|
|
1443
|
+
var b;
|
|
1444
|
+
return `${x.action}_${x.performedAt}` == `${z.enum.approveDraft}_${(b = e.draft) == null ? void 0 : b.approvedAt}`;
|
|
1445
1445
|
}
|
|
1446
1446
|
) || c.push({
|
|
1447
1447
|
action: z.enum.approveDraft,
|
|
1448
1448
|
performedAt: e.draft.approvedAt,
|
|
1449
1449
|
performedBy: e.draft.approvedBy ?? { name: "Unknown", id: "unknown" },
|
|
1450
1450
|
remark: e.draft.approveRemark
|
|
1451
|
-
})), c.sort((
|
|
1452
|
-
(
|
|
1453
|
-
header: Ue(
|
|
1454
|
-
date: ve(
|
|
1451
|
+
})), c.sort((g, x) => new Date(x.performedAt).getTime() - new Date(g.performedAt).getTime()).map(
|
|
1452
|
+
(g) => ({
|
|
1453
|
+
header: Ue(g.action),
|
|
1454
|
+
date: ve(g.performedAt),
|
|
1455
1455
|
info: [
|
|
1456
1456
|
{
|
|
1457
1457
|
label: "Performed by",
|
|
1458
|
-
values: [
|
|
1458
|
+
values: [g.performedBy.name]
|
|
1459
1459
|
},
|
|
1460
1460
|
{
|
|
1461
1461
|
label: "Remark",
|
|
1462
|
-
values: [
|
|
1462
|
+
values: [g.remark ?? ""]
|
|
1463
1463
|
}
|
|
1464
1464
|
]
|
|
1465
1465
|
})
|
|
1466
1466
|
);
|
|
1467
1467
|
}), Te = V(() => {
|
|
1468
|
-
var
|
|
1469
|
-
if (((
|
|
1470
|
-
|
|
1468
|
+
var o, u, g, x;
|
|
1469
|
+
if (!((o = e.draft) != null && o.stockSnapshot)) return "Stock snapshot is not available.";
|
|
1470
|
+
if (((u = e.draft) == null ? void 0 : u.status) !== pe.enum.DRAFT) return "Status is not draft.";
|
|
1471
|
+
const c = Se.value.some((b) => b.physicalBalance < 0), t = ((x = (g = m.stockBalance.skus) == null ? void 0 : g.filter((b) => b.balance.amount < 0)) == null ? void 0 : x.map((b) => b.id)) ?? [], d = new Set(Z.value.map((b) => b._id)), i = t.filter((b) => !d.has(b)).length;
|
|
1471
1472
|
return [
|
|
1472
1473
|
c ? "Negative total exist." : null,
|
|
1473
|
-
i ? "Negative stock is not included in this draft.
|
|
1474
|
-
].filter((
|
|
1474
|
+
i ? "Negative stock is not included in this draft. Please commit the draft to include these stocks." : null
|
|
1475
|
+
].filter((b) => b).join(" ");
|
|
1475
1476
|
});
|
|
1476
1477
|
return (c, t) => {
|
|
1477
|
-
const d = U("FmButtonGroup"), i = U("FmMenuDivider"),
|
|
1478
|
-
return
|
|
1478
|
+
const d = U("FmButtonGroup"), i = U("FmMenuDivider"), o = U("FmCard"), u = U("FmButton"), g = U("FmCircularProgress"), x = U("FmChip"), b = U("FmTextField"), E = U("FmIcon"), ae = U("FmTable"), ce = U("FmSpacer"), ne = U("FmTooltip"), Ce = U("FmSideSheet");
|
|
1479
|
+
return j(), se(Ce, {
|
|
1479
1480
|
"dismiss-away": "",
|
|
1480
1481
|
"max-width": 9999,
|
|
1481
|
-
"model-value":
|
|
1482
|
-
"onUpdate:modelValue": t[10] || (t[10] = (
|
|
1482
|
+
"model-value": F(_),
|
|
1483
|
+
"onUpdate:modelValue": t[10] || (t[10] = (C) => rt(_) ? _.value = C : null),
|
|
1483
1484
|
header: "Closing details"
|
|
1484
1485
|
}, {
|
|
1485
1486
|
"side-sheet-footer": Y(() => {
|
|
1486
|
-
var
|
|
1487
|
+
var C, K, q, ie;
|
|
1487
1488
|
return [
|
|
1488
1489
|
r("div", Ka, [
|
|
1489
|
-
((
|
|
1490
|
-
Te.value ? (
|
|
1490
|
+
((C = e.draft) == null ? void 0 : C.status) === F(pe).enum.DRAFT ? (j(), L(ee, { key: 0 }, [
|
|
1491
|
+
Te.value ? (j(), se(ne, {
|
|
1491
1492
|
key: 0,
|
|
1492
|
-
"z-index": 51
|
|
1493
|
+
"z-index": 51,
|
|
1494
|
+
placement: "right"
|
|
1493
1495
|
}, {
|
|
1494
1496
|
content: Y(() => [
|
|
1495
1497
|
X(J(Te.value), 1)
|
|
1496
1498
|
]),
|
|
1497
1499
|
default: Y(() => [
|
|
1498
|
-
|
|
1500
|
+
h(u, {
|
|
1499
1501
|
disabled: "",
|
|
1500
1502
|
key: "approve key",
|
|
1501
1503
|
label: "Approve",
|
|
1502
|
-
onClick: t[5] || (t[5] = () => e.draft &&
|
|
1504
|
+
onClick: t[5] || (t[5] = () => e.draft && F(p).approveDraft(e.draft, () => A("submitted")))
|
|
1503
1505
|
})
|
|
1504
1506
|
]),
|
|
1505
1507
|
_: 1
|
|
1506
|
-
})) : (
|
|
1508
|
+
})) : (j(), se(u, {
|
|
1507
1509
|
key: "approve key",
|
|
1508
1510
|
label: "Approve",
|
|
1509
|
-
onClick: t[6] || (t[6] = () => e.draft &&
|
|
1511
|
+
onClick: t[6] || (t[6] = () => e.draft && F(p).approveDraft(e.draft, () => A("submitted")))
|
|
1510
1512
|
}))
|
|
1511
1513
|
], 64)) : de("", !0),
|
|
1512
|
-
((K = e.draft) == null ? void 0 : K.status) ===
|
|
1514
|
+
((K = e.draft) == null ? void 0 : K.status) === F(pe).enum.DRAFT ? (j(), se(u, {
|
|
1513
1515
|
key: 1,
|
|
1514
1516
|
label: "Reject",
|
|
1515
1517
|
variant: "destructive",
|
|
1516
|
-
onClick: t[7] || (t[7] = () => e.draft &&
|
|
1518
|
+
onClick: t[7] || (t[7] = () => e.draft && F(p).rejectDraft(e.draft, () => A("submitted")))
|
|
1517
1519
|
})) : de("", !0),
|
|
1518
|
-
|
|
1519
|
-
default: Y(() =>
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
})
|
|
1531
|
-
}, null, 8, ["loading"])) : de("", !0)
|
|
1532
|
-
];
|
|
1533
|
-
}),
|
|
1520
|
+
(q = e.draft) != null && q.approvedAt && ((ie = e.draft) == null ? void 0 : ie.status) !== F(pe).enum.COMPLETED ? (j(), se(Ut, { key: 2 }, {
|
|
1521
|
+
default: Y(() => [
|
|
1522
|
+
h(u, {
|
|
1523
|
+
label: "Sync",
|
|
1524
|
+
loading: S.value,
|
|
1525
|
+
onClick: t[8] || (t[8] = () => {
|
|
1526
|
+
e.draft && (S.value = !0, F(p).syncDraft(e.draft, () => {
|
|
1527
|
+
S.value = !1, A("submitted");
|
|
1528
|
+
}));
|
|
1529
|
+
})
|
|
1530
|
+
}, null, 8, ["loading"])
|
|
1531
|
+
]),
|
|
1534
1532
|
_: 1
|
|
1535
|
-
}),
|
|
1536
|
-
|
|
1533
|
+
})) : de("", !0),
|
|
1534
|
+
h(u, {
|
|
1537
1535
|
label: "Close",
|
|
1538
1536
|
variant: "tertiary",
|
|
1539
|
-
onClick: t[9] || (t[9] = (
|
|
1537
|
+
onClick: t[9] || (t[9] = (_e) => _.value = !1)
|
|
1540
1538
|
})
|
|
1541
1539
|
])
|
|
1542
1540
|
];
|
|
@@ -1544,38 +1542,38 @@ const ua = pt(
|
|
|
1544
1542
|
default: Y(() => [
|
|
1545
1543
|
r("div", da, [
|
|
1546
1544
|
r("div", null, [
|
|
1547
|
-
|
|
1545
|
+
h(d, {
|
|
1548
1546
|
items: xe,
|
|
1549
1547
|
modelValue: le.value,
|
|
1550
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
1548
|
+
"onUpdate:modelValue": t[0] || (t[0] = (C) => le.value = C)
|
|
1551
1549
|
}, null, 8, ["modelValue"])
|
|
1552
1550
|
]),
|
|
1553
|
-
le.value.value === "overview" ? (
|
|
1554
|
-
|
|
1551
|
+
le.value.value === "overview" ? (j(), L(ee, { key: 0 }, [
|
|
1552
|
+
h(o, {
|
|
1555
1553
|
variant: "outlined",
|
|
1556
1554
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
1557
1555
|
}, {
|
|
1558
1556
|
default: Y(() => {
|
|
1559
|
-
var
|
|
1557
|
+
var C, K;
|
|
1560
1558
|
return [
|
|
1561
1559
|
r("div", ma, [
|
|
1562
1560
|
t[11] || (t[11] = r("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
|
|
1563
1561
|
r("div", fa, [
|
|
1564
1562
|
r("div", {
|
|
1565
|
-
class:
|
|
1566
|
-
}, J(
|
|
1563
|
+
class: De(["fm-status-badge", F(Le)(((C = c.draft) == null ? void 0 : C.status) ?? "DRAFT")])
|
|
1564
|
+
}, J(F(Ue)(((K = c.draft) == null ? void 0 : K.status) ?? "")), 3)
|
|
1567
1565
|
])
|
|
1568
1566
|
]),
|
|
1569
|
-
|
|
1567
|
+
h(i),
|
|
1570
1568
|
r("div", pa, [
|
|
1571
|
-
(
|
|
1569
|
+
(j(!0), L(ee, null, je(Fe.value, (q, ie) => (j(), L("div", {
|
|
1572
1570
|
class: "flex flex-col gap-4",
|
|
1573
1571
|
key: ie
|
|
1574
1572
|
}, [
|
|
1575
1573
|
r("div", va, [
|
|
1576
|
-
r("div", ya, J(
|
|
1574
|
+
r("div", ya, J(q.label), 1)
|
|
1577
1575
|
]),
|
|
1578
|
-
r("div", ga, J(
|
|
1576
|
+
r("div", ga, J(q.value), 1)
|
|
1579
1577
|
]))), 128))
|
|
1580
1578
|
])
|
|
1581
1579
|
];
|
|
@@ -1583,10 +1581,10 @@ const ua = pt(
|
|
|
1583
1581
|
_: 1
|
|
1584
1582
|
}),
|
|
1585
1583
|
r("div", ba, [
|
|
1586
|
-
r("div",
|
|
1584
|
+
r("div", ha, [
|
|
1587
1585
|
t[12] || (t[12] = r("div", { class: "flex-1 fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Closing items ", -1)),
|
|
1588
|
-
|
|
1589
|
-
c.draft && c.draft.status !==
|
|
1586
|
+
v.value ? de("", !0) : (j(), L("div", ka, [
|
|
1587
|
+
c.draft && c.draft.status !== F(pe).enum.COMPLETED ? (j(), se(u, {
|
|
1590
1588
|
key: 0,
|
|
1591
1589
|
label: "Refresh balance",
|
|
1592
1590
|
"prepend-icon": "refresh",
|
|
@@ -1594,88 +1592,88 @@ const ua = pt(
|
|
|
1594
1592
|
"text-color": "primary",
|
|
1595
1593
|
"bg-color": "transparent",
|
|
1596
1594
|
"border-color": "primary",
|
|
1597
|
-
loading:
|
|
1595
|
+
loading: R.value,
|
|
1598
1596
|
onClick: be
|
|
1599
1597
|
}, null, 8, ["loading"])) : de("", !0),
|
|
1600
|
-
|
|
1598
|
+
h(u, {
|
|
1601
1599
|
label: "Export data",
|
|
1602
1600
|
"prepend-icon": "download",
|
|
1603
1601
|
variant: "secondary",
|
|
1604
1602
|
"text-color": "primary",
|
|
1605
1603
|
"bg-color": "transparent",
|
|
1606
1604
|
"border-color": "primary",
|
|
1607
|
-
onClick: t[1] || (t[1] = (
|
|
1605
|
+
onClick: t[1] || (t[1] = (C) => c.draft ? F(p).exportDraft(
|
|
1608
1606
|
c.draft,
|
|
1609
|
-
|
|
1610
|
-
|
|
1607
|
+
k.value,
|
|
1608
|
+
$.value
|
|
1611
1609
|
) : null)
|
|
1612
1610
|
})
|
|
1613
1611
|
]))
|
|
1614
1612
|
]),
|
|
1615
|
-
|
|
1613
|
+
v.value ? (j(), L("div", Aa, [
|
|
1616
1614
|
t[14] || (t[14] = r("div", { class: "h-80" }, null, -1)),
|
|
1617
1615
|
r("div", xa, [
|
|
1618
1616
|
r("div", null, [
|
|
1619
|
-
|
|
1617
|
+
h(g, { size: "md" })
|
|
1620
1618
|
]),
|
|
1621
1619
|
t[13] || (t[13] = r("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fetching info... ", -1))
|
|
1622
1620
|
]),
|
|
1623
1621
|
t[15] || (t[15] = r("div", { class: "h-80" }, null, -1))
|
|
1624
|
-
])) : (
|
|
1622
|
+
])) : (j(), L(ee, { key: 1 }, [
|
|
1625
1623
|
r("div", _a, [
|
|
1626
1624
|
r("div", Da, [
|
|
1627
|
-
|
|
1625
|
+
h(x, {
|
|
1628
1626
|
label: "Template Item(s)",
|
|
1629
|
-
selected:
|
|
1630
|
-
onClick: t[2] || (t[2] = (
|
|
1627
|
+
selected: w.value.templateItem,
|
|
1628
|
+
onClick: t[2] || (t[2] = (C) => w.value.templateItem = !w.value.templateItem)
|
|
1631
1629
|
}, null, 8, ["selected"]),
|
|
1632
|
-
|
|
1630
|
+
h(x, {
|
|
1633
1631
|
label: "Non-template Item(s)",
|
|
1634
|
-
selected:
|
|
1635
|
-
onClick: t[3] || (t[3] = (
|
|
1632
|
+
selected: w.value.nonTemplateItem,
|
|
1633
|
+
onClick: t[3] || (t[3] = (C) => w.value.nonTemplateItem = !w.value.nonTemplateItem)
|
|
1636
1634
|
}, null, 8, ["selected"])
|
|
1637
1635
|
]),
|
|
1638
|
-
|
|
1636
|
+
h(b, {
|
|
1639
1637
|
modelValue: Ae.value,
|
|
1640
|
-
"onUpdate:modelValue": t[4] || (t[4] = (
|
|
1638
|
+
"onUpdate:modelValue": t[4] || (t[4] = (C) => Ae.value = C),
|
|
1641
1639
|
placeholder: "Filter items"
|
|
1642
1640
|
}, null, 8, ["modelValue"])
|
|
1643
1641
|
]),
|
|
1644
|
-
|
|
1645
|
-
(
|
|
1646
|
-
key: `${
|
|
1647
|
-
label: `${
|
|
1642
|
+
F(D).skuTags.size ? (j(), L("div", wa, [
|
|
1643
|
+
(j(!0), L(ee, null, je(F(D).skuTags.keys(), (C) => (j(), se(x, {
|
|
1644
|
+
key: `${C}`,
|
|
1645
|
+
label: `${C}`,
|
|
1648
1646
|
selectable: "",
|
|
1649
|
-
selected: f[`${
|
|
1650
|
-
onClick: (K) => f[`${
|
|
1647
|
+
selected: f[`${C}`],
|
|
1648
|
+
onClick: (K) => f[`${C}`] = !f[`${C}`]
|
|
1651
1649
|
}, {
|
|
1652
1650
|
default: Y(() => [
|
|
1653
|
-
f[`${
|
|
1651
|
+
f[`${C}`] ? (j(), se(E, {
|
|
1654
1652
|
key: 0,
|
|
1655
1653
|
name: "check",
|
|
1656
1654
|
class: "text-white",
|
|
1657
1655
|
size: "sm"
|
|
1658
1656
|
})) : de("", !0),
|
|
1659
1657
|
r("span", {
|
|
1660
|
-
class:
|
|
1658
|
+
class: De([
|
|
1661
1659
|
"",
|
|
1662
1660
|
{
|
|
1663
|
-
"text-white fm-typo-en-body-md-600": f[`${
|
|
1664
|
-
"text-fm-color-typo-primary fm-typo-en-body-md-400": !f[`${
|
|
1661
|
+
"text-white fm-typo-en-body-md-600": f[`${C}`],
|
|
1662
|
+
"text-fm-color-typo-primary fm-typo-en-body-md-400": !f[`${C}`]
|
|
1665
1663
|
}
|
|
1666
1664
|
])
|
|
1667
|
-
}, J(
|
|
1665
|
+
}, J(C), 3)
|
|
1668
1666
|
]),
|
|
1669
1667
|
_: 2
|
|
1670
1668
|
}, 1032, ["label", "selected", "onClick"]))), 128))
|
|
1671
1669
|
])) : de("", !0),
|
|
1672
1670
|
r("div", Sa, [
|
|
1673
1671
|
r("div", {
|
|
1674
|
-
style: lt({ minWidth: `${
|
|
1672
|
+
style: lt({ minWidth: `${ke.value}px` })
|
|
1675
1673
|
}, [
|
|
1676
|
-
|
|
1677
|
-
"column-defs":
|
|
1678
|
-
"row-data":
|
|
1674
|
+
h(ae, {
|
|
1675
|
+
"column-defs": we.value,
|
|
1676
|
+
"row-data": Se.value,
|
|
1679
1677
|
"search-value": Ae.value
|
|
1680
1678
|
}, null, 8, ["column-defs", "row-data", "search-value"])
|
|
1681
1679
|
], 4)
|
|
@@ -1683,14 +1681,14 @@ const ua = pt(
|
|
|
1683
1681
|
], 64))
|
|
1684
1682
|
])
|
|
1685
1683
|
], 64)) : de("", !0),
|
|
1686
|
-
le.value.value === "history" ? (
|
|
1687
|
-
me.value.length ? (
|
|
1688
|
-
(
|
|
1684
|
+
le.value.value === "history" ? (j(), L("div", Ca, [
|
|
1685
|
+
me.value.length ? (j(), L("div", Fa, [
|
|
1686
|
+
(j(!0), L(ee, null, je(me.value, (C, K) => (j(), L(ee, { key: K }, [
|
|
1689
1687
|
r("div", Ta, [
|
|
1690
1688
|
r("div", $a, [
|
|
1691
1689
|
r("div", Ma, [
|
|
1692
1690
|
r("div", {
|
|
1693
|
-
class:
|
|
1691
|
+
class: De([
|
|
1694
1692
|
{
|
|
1695
1693
|
"bg-fm-color-primary": K !== 0,
|
|
1696
1694
|
"bg-white": K === 0
|
|
@@ -1702,7 +1700,7 @@ const ua = pt(
|
|
|
1702
1700
|
t[18] || (t[18] = r("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
1703
1701
|
r("div", Ra, [
|
|
1704
1702
|
r("div", {
|
|
1705
|
-
class:
|
|
1703
|
+
class: De([
|
|
1706
1704
|
{
|
|
1707
1705
|
"bg-fm-color-primary": K < me.value.length - 1,
|
|
1708
1706
|
"bg-white": K >= me.value.length - 1
|
|
@@ -1713,15 +1711,15 @@ const ua = pt(
|
|
|
1713
1711
|
])
|
|
1714
1712
|
]),
|
|
1715
1713
|
r("div", Ia, [
|
|
1716
|
-
r("div", Pa, J(
|
|
1717
|
-
r("div", Va, J(
|
|
1714
|
+
r("div", Pa, J(C.header), 1),
|
|
1715
|
+
r("div", Va, J(C.date), 1)
|
|
1718
1716
|
])
|
|
1719
1717
|
]),
|
|
1720
1718
|
r("div", Ua, [
|
|
1721
1719
|
r("div", La, [
|
|
1722
1720
|
r("div", Ea, [
|
|
1723
1721
|
r("div", {
|
|
1724
|
-
class:
|
|
1722
|
+
class: De([
|
|
1725
1723
|
{
|
|
1726
1724
|
"bg-fm-color-primary": K < me.value.length - 1,
|
|
1727
1725
|
"bg-white": K >= me.value.length - 1
|
|
@@ -1732,22 +1730,22 @@ const ua = pt(
|
|
|
1732
1730
|
])
|
|
1733
1731
|
]),
|
|
1734
1732
|
r("div", Ha, [
|
|
1735
|
-
|
|
1733
|
+
h(o, {
|
|
1736
1734
|
variant: "outlined",
|
|
1737
1735
|
class: "py-12 px-16"
|
|
1738
1736
|
}, {
|
|
1739
1737
|
default: Y(() => [
|
|
1740
1738
|
r("div", za, [
|
|
1741
|
-
(
|
|
1739
|
+
(j(!0), L(ee, null, je(C.info, (q, ie) => (j(), L("div", {
|
|
1742
1740
|
key: ie,
|
|
1743
1741
|
class: "flex flex-col gap-4"
|
|
1744
1742
|
}, [
|
|
1745
|
-
r("div", Na, J(
|
|
1743
|
+
r("div", Na, J(q == null ? void 0 : q.label), 1),
|
|
1746
1744
|
r("div", Oa, [
|
|
1747
|
-
(
|
|
1745
|
+
(j(!0), L(ee, null, je(q == null ? void 0 : q.values, (_e, $e) => (j(), L("div", {
|
|
1748
1746
|
key: $e,
|
|
1749
1747
|
class: "fm-typo-en-body-lg-600"
|
|
1750
|
-
}, J(
|
|
1748
|
+
}, J(_e), 1))), 128))
|
|
1751
1749
|
])
|
|
1752
1750
|
]))), 128))
|
|
1753
1751
|
])
|
|
@@ -1757,18 +1755,18 @@ const ua = pt(
|
|
|
1757
1755
|
])
|
|
1758
1756
|
])
|
|
1759
1757
|
], 64))), 128))
|
|
1760
|
-
])) : (
|
|
1761
|
-
|
|
1758
|
+
])) : (j(), L("div", ja, [
|
|
1759
|
+
h(ce),
|
|
1762
1760
|
r("div", null, [
|
|
1763
1761
|
r("img", {
|
|
1764
|
-
src:
|
|
1762
|
+
src: F(Gt),
|
|
1765
1763
|
alt: "List is empty"
|
|
1766
1764
|
}, null, 8, Ba)
|
|
1767
1765
|
]),
|
|
1768
1766
|
t[16] || (t[16] = r("div", { class: "fm-typo-en-body-lg-600" }, J("No records found"), -1)),
|
|
1769
1767
|
t[17] || (t[17] = r("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, J("You can track approval and rejection history here"), -1)),
|
|
1770
|
-
|
|
1771
|
-
|
|
1768
|
+
h(ce),
|
|
1769
|
+
h(ce)
|
|
1772
1770
|
]))
|
|
1773
1771
|
])) : de("", !0)
|
|
1774
1772
|
])
|
|
@@ -1779,20 +1777,20 @@ const ua = pt(
|
|
|
1779
1777
|
}
|
|
1780
1778
|
}), Ga = { class: "flex-1 flex flex-col gap-8" }, Wa = { class: "flex flex-col" }, qa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Za = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Ja = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Xa = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, dn = /* @__PURE__ */ He({
|
|
1781
1779
|
__name: "ClosingDraftView",
|
|
1782
|
-
setup(
|
|
1783
|
-
const { t: l } = ft(), { viewDraft: e } = Ee(), { viewClosingDraftProps: m, viewClosingDraftShow:
|
|
1784
|
-
|
|
1785
|
-
const
|
|
1786
|
-
function
|
|
1780
|
+
setup(s) {
|
|
1781
|
+
const { t: l } = ft(), { viewDraft: e } = Ee(), { viewClosingDraftProps: m, viewClosingDraftShow: p } = Qt(Ee()), _ = ze(), v = ua(), R = Lt(), { breakpoints: S } = Yt();
|
|
1782
|
+
_.watchLocation(v.fetchDrafts);
|
|
1783
|
+
const k = V(() => v.loading), $ = H(""), P = V(() => S.value.xs || S.value.sm), I = V(() => P.value ? 10 : 20);
|
|
1784
|
+
function n(O) {
|
|
1787
1785
|
switch (O) {
|
|
1788
1786
|
case "refresh":
|
|
1789
|
-
return
|
|
1787
|
+
return v.fetchDrafts();
|
|
1790
1788
|
}
|
|
1791
1789
|
}
|
|
1792
1790
|
function a(O) {
|
|
1793
1791
|
return O;
|
|
1794
1792
|
}
|
|
1795
|
-
const
|
|
1793
|
+
const D = V(() => P.value ? [
|
|
1796
1794
|
{
|
|
1797
1795
|
label: l("inventory.common.refresh"),
|
|
1798
1796
|
value: "refresh",
|
|
@@ -1806,16 +1804,16 @@ const ua = pt(
|
|
|
1806
1804
|
}
|
|
1807
1805
|
]);
|
|
1808
1806
|
return (O, f) => {
|
|
1809
|
-
const
|
|
1810
|
-
return
|
|
1811
|
-
|
|
1812
|
-
title:
|
|
1813
|
-
actions:
|
|
1814
|
-
"onClick:action":
|
|
1807
|
+
const y = U("FmTable");
|
|
1808
|
+
return j(), L(ee, null, [
|
|
1809
|
+
h(Et, {
|
|
1810
|
+
title: F(l)("inventory.closing.draft.title"),
|
|
1811
|
+
actions: D.value,
|
|
1812
|
+
"onClick:action": n
|
|
1815
1813
|
}, {
|
|
1816
1814
|
default: Y(() => [
|
|
1817
1815
|
r("div", {
|
|
1818
|
-
class:
|
|
1816
|
+
class: De([
|
|
1819
1817
|
"flex flex-col gap-8 max-h-full",
|
|
1820
1818
|
{
|
|
1821
1819
|
"p-0": P.value,
|
|
@@ -1823,41 +1821,41 @@ const ua = pt(
|
|
|
1823
1821
|
}
|
|
1824
1822
|
])
|
|
1825
1823
|
}, [
|
|
1826
|
-
|
|
1824
|
+
h(Ht, {
|
|
1827
1825
|
"change-location": "",
|
|
1828
1826
|
searchable: "",
|
|
1829
|
-
search:
|
|
1830
|
-
"onUpdate:search": f[0] || (f[0] = (A) =>
|
|
1827
|
+
search: $.value,
|
|
1828
|
+
"onUpdate:search": f[0] || (f[0] = (A) => $.value = A)
|
|
1831
1829
|
}, null, 8, ["search"]),
|
|
1832
|
-
|
|
1833
|
-
style: lt(
|
|
1834
|
-
"column-defs":
|
|
1835
|
-
"row-data":
|
|
1836
|
-
"search-value":
|
|
1837
|
-
loading:
|
|
1838
|
-
onRowClick: f[1] || (f[1] = (A) =>
|
|
1839
|
-
"page-size":
|
|
1830
|
+
h(y, {
|
|
1831
|
+
style: lt(F(R).tableHeight),
|
|
1832
|
+
"column-defs": F(v).columnDefs,
|
|
1833
|
+
"row-data": F(v).drafts,
|
|
1834
|
+
"search-value": $.value,
|
|
1835
|
+
loading: k.value,
|
|
1836
|
+
onRowClick: f[1] || (f[1] = (A) => F(e)(A.original)),
|
|
1837
|
+
"page-size": I.value
|
|
1840
1838
|
}, {
|
|
1841
1839
|
"list-row": Y((A) => [
|
|
1842
|
-
|
|
1840
|
+
h(zt, {
|
|
1843
1841
|
row: A,
|
|
1844
|
-
onRowClick: (
|
|
1842
|
+
onRowClick: (w) => F(e)(w)
|
|
1845
1843
|
}, {
|
|
1846
|
-
default: Y((
|
|
1847
|
-
var
|
|
1844
|
+
default: Y((w) => {
|
|
1845
|
+
var M, Z, W, re, B, te, be, he, fe, ye, ge, Q, we, ke, Ae, Se, Fe, xe, le, me;
|
|
1848
1846
|
return [
|
|
1849
1847
|
r("div", Ga, [
|
|
1850
1848
|
r("div", Wa, [
|
|
1851
1849
|
r("div", qa, [
|
|
1852
|
-
|
|
1853
|
-
render: (
|
|
1854
|
-
props: (
|
|
1850
|
+
h(F(Pe), {
|
|
1851
|
+
render: (W = (Z = (M = w._id) == null ? void 0 : M.column) == null ? void 0 : Z.columnDef) == null ? void 0 : W.cell,
|
|
1852
|
+
props: (B = (re = w._id) == null ? void 0 : re.getContext) == null ? void 0 : B.call(re)
|
|
1855
1853
|
}, null, 8, ["render", "props"])
|
|
1856
1854
|
]),
|
|
1857
1855
|
r("div", Za, [
|
|
1858
|
-
|
|
1859
|
-
render: (
|
|
1860
|
-
props: (ye = (fe =
|
|
1856
|
+
h(F(Pe), {
|
|
1857
|
+
render: (he = (be = (te = w.name) == null ? void 0 : te.column) == null ? void 0 : be.columnDef) == null ? void 0 : he.cell,
|
|
1858
|
+
props: (ye = (fe = w.name) == null ? void 0 : fe.getContext) == null ? void 0 : ye.call(fe)
|
|
1861
1859
|
}, null, 8, ["render", "props"])
|
|
1862
1860
|
]),
|
|
1863
1861
|
r("div", Ja, J([
|
|
@@ -1865,16 +1863,16 @@ const ua = pt(
|
|
|
1865
1863
|
...A.original.items.length >= 3 ? [`and ${A.original.items.length - 3} more items`] : []
|
|
1866
1864
|
].join(", ")), 1),
|
|
1867
1865
|
r("div", Xa, [
|
|
1868
|
-
|
|
1869
|
-
render: (
|
|
1870
|
-
props: (Ae = (
|
|
1866
|
+
h(F(Pe), {
|
|
1867
|
+
render: (we = (Q = (ge = w.ref) == null ? void 0 : ge.column) == null ? void 0 : Q.columnDef) == null ? void 0 : we.cell,
|
|
1868
|
+
props: (Ae = (ke = w.ref) == null ? void 0 : ke.getContext) == null ? void 0 : Ae.call(ke)
|
|
1871
1869
|
}, null, 8, ["render", "props"])
|
|
1872
1870
|
])
|
|
1873
1871
|
]),
|
|
1874
1872
|
r("div", null, [
|
|
1875
|
-
|
|
1876
|
-
render: (xe = (Fe = (
|
|
1877
|
-
props: (me = (le =
|
|
1873
|
+
h(F(Pe), {
|
|
1874
|
+
render: (xe = (Fe = (Se = w.status) == null ? void 0 : Se.column) == null ? void 0 : Fe.columnDef) == null ? void 0 : xe.cell,
|
|
1875
|
+
props: (me = (le = w.status) == null ? void 0 : le.getContext) == null ? void 0 : me.call(le)
|
|
1878
1876
|
}, null, 8, ["render", "props"])
|
|
1879
1877
|
])
|
|
1880
1878
|
])
|
|
@@ -1889,12 +1887,12 @@ const ua = pt(
|
|
|
1889
1887
|
]),
|
|
1890
1888
|
_: 1
|
|
1891
1889
|
}, 8, ["title", "actions"]),
|
|
1892
|
-
(
|
|
1893
|
-
|
|
1894
|
-
show:
|
|
1895
|
-
"onUpdate:show": f[2] || (f[2] = (A) => rt(
|
|
1896
|
-
onSubmitted: f[3] || (f[3] = () => (
|
|
1897
|
-
onRefresh: f[4] || (f[4] = (A) =>
|
|
1890
|
+
(j(), se(wt, { to: "body" }, [
|
|
1891
|
+
h(Qa, St(F(m), {
|
|
1892
|
+
show: F(p),
|
|
1893
|
+
"onUpdate:show": f[2] || (f[2] = (A) => rt(p) ? p.value = A : null),
|
|
1894
|
+
onSubmitted: f[3] || (f[3] = () => (p.value = !1, F(v).fetchDrafts())),
|
|
1895
|
+
onRefresh: f[4] || (f[4] = (A) => F(v).updateDraftRef(A))
|
|
1898
1896
|
}), null, 16, ["show"])
|
|
1899
1897
|
]))
|
|
1900
1898
|
], 64);
|