@feedmepos/mf-inventory-portal 1.0.7 → 1.0.8-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-DF14rGlK.js → App-VjopKXRf.js} +50 -49
- package/dist/{ApprovalView-C_xhq-_c.js → ApprovalView-Bc8OqfVg.js} +24 -24
- package/dist/{BindingsDialog-CCY1fDj8.js → BindingsDialog-zWAOfSXc.js} +4 -4
- package/dist/{BindingsPicker-CnXbK5O3.js → BindingsPicker-Bf5LuJiL.js} +6 -6
- package/dist/{BindingsTable-cQIUUuVv.js → BindingsTable-D2N-3mnJ.js} +8 -8
- package/dist/{ClosingDraftView-DUZ31x3s.js → ClosingDraftView-BwbzajJY.js} +464 -463
- package/dist/{ClosingTemplateView-6ysEDEcV.js → ClosingTemplateView-CsAIbfui.js} +10 -10
- package/dist/{DeliveryOrderPrintPreview-BGjFS8h7.js → DeliveryOrderPrintPreview-CjylpaJj.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CanJ2fzb.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C_xdzdLD.js} +32 -32
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BcKtJQMt.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DhgHX4S_.js} +86 -86
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Bb9xMoX-.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DPa8Pto8.js} +1 -1
- package/dist/{IngredientGroupView-i08KHlW7.js → IngredientGroupView-D6YzbWdd.js} +11 -11
- package/dist/{IngredientsView-D0tBukwK.js → IngredientsView-g-73afqm.js} +15 -14
- package/dist/{IntegrationView-BqCrKL13.js → IntegrationView-CEML0dP4.js} +86 -85
- package/dist/{InventoryBindingForm-BJwIFQVS.js → InventoryBindingForm-E0wJOA8L.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DU9j1Q8M.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DFXmypAs.js} +27 -27
- package/dist/{InventoryBindingSummary-B2M3Th8T.js → InventoryBindingSummary-sBQvAPBw.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BH4A_Lc5.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DOeDgymo.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CdxCyEBi.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DIqYY1-C.js} +10 -10
- package/dist/{PublishView-B9x92vDM.js → PublishView-D_psCmiQ.js} +7 -7
- package/dist/{PurchaseOrderPrintPreview-MbGDNmgh.js → PurchaseOrderPrintPreview-5QqjPwWN.js} +4 -4
- package/dist/{ReceiveRequestView-CTNycYUr.js → ReceiveRequestView-CBGxqac6.js} +53 -52
- package/dist/{RecipeView-sHTcJgzP.js → RecipeView-BAjHNWST.js} +32 -32
- package/dist/{StockView-CUv4dcGJ.js → StockView-Bc62jbCV.js} +73 -72
- package/dist/{SupplierView-hu6OhDss.js → SupplierView-Cyucz_US.js} +159 -159
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CljJoB4v.js +1895 -0
- package/dist/{TransferTemplateView-DMSkUc0D.js → TransferTemplateView-BWURlmou.js} +291 -290
- package/dist/{UnitView-B5q7IVbT.js → UnitView-cjLpKfoN.js} +23 -23
- package/dist/{WarehouseView-Ds6z4Vz6.js → WarehouseView-CUtg5Aiw.js} +26 -26
- package/dist/api/bill.d.ts +2 -2
- package/dist/api/food-market-hub.d.ts +1 -1
- package/dist/api/inventory.d.ts +44 -44
- package/dist/api/netsuite.d.ts +3 -3
- package/dist/api/purchase-order.d.ts +5 -1
- package/dist/{app-BmsY87Mv.js → app-Dgg5mqsW.js} +17155 -17625
- package/dist/app.d.ts +7 -7
- package/dist/app.js +1 -1
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +8 -8
- package/dist/components/shell/inventory/binding-dialog.vue.d.ts +2 -2
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +5 -5
- package/dist/composable/usePromise.d.ts +41 -0
- package/dist/{decimal-Baw9w4_A.js → decimal-DcqP_fAm.js} +1 -1
- package/dist/feature-C4mZ_d2m.js +17352 -0
- package/dist/{format-unit-display-D0_KiU3j.js → format-unit-display-D2Uk9Ze_.js} +60 -60
- package/dist/{index-CDydl7WA.js → index-YuTB_T1B.js} +1 -1
- package/dist/{index-C_GU5Tc8.js → index-peSGn9vg.js} +7 -6
- package/dist/{stock-C-hm8Kdq.js → stock-CDP8ZqBZ.js} +1 -1
- package/dist/stores/feature.d.ts +3 -20
- package/dist/stores/integration/foodmarkethub.d.ts +1 -1
- package/dist/stores/integration/netsuite.d.ts +7 -7
- package/dist/stores/inventory.d.ts +44 -44
- package/dist/stores/location.d.ts +137 -137
- package/dist/{supplier-RX_yr24c.js → supplier-C5GbDMxT.js} +4 -4
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-BZhczMUl.js → use-ingredient-select-dialog-nH01sayt.js} +1 -1
- package/dist/{use-inventory-binding-dialog-dV-92pLe.js → use-inventory-binding-dialog-CJe6QdGb.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +228 -228
- package/dist/views/adjustment-template/wastage-template/form/WastageTemplateItemTable.vue.d.ts +2 -2
- package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +1 -1
- package/dist/views/adjustment-template/wastage-template/table.d.ts +234 -234
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +68 -68
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +408 -408
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +4 -4
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +252 -252
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +252 -252
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +12 -12
- package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +2 -2
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +8 -8
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +3 -3
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +4 -4
- package/dist/views/integration/components/ApplyProduct.vue.d.ts +2 -2
- package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +2 -2
- package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +2 -2
- package/dist/views/integration/components/netsuite/AddLocationDialog.vue.d.ts +204 -204
- package/dist/views/integration/components/netsuite/LocationConfigurationDialog.vue.d.ts +2 -2
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +665 -637
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +22 -22
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +44 -44
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +11 -11
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +614 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +1190 -1142
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +1192 -1144
- package/dist/views/receive-request/constants/po-action-to-ui-style.d.ts +6 -0
- package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +2 -2
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -1
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +14 -14
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +22 -22
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +17 -17
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +11 -11
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +805 -805
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +805 -805
- package/dist/views/transfer-template/composables/useTransferTemplateHelper.d.ts +33 -33
- package/dist/{vue-i18n-sbHu6D5a.js → vue-i18n-NNRWZURD.js} +284 -284
- package/package.json +5 -3
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CCKlQGMf.js +0 -1746
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { useSnackbar as
|
|
5
|
-
import { defineStore as
|
|
6
|
-
import { a as
|
|
7
|
-
import { E as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as Se, ref as O, resolveComponent as E, openBlock as b, createBlock as Z, withCtx as K, createElementVNode as o, createTextVNode as je, toDisplayString as N, unref as y, createVNode as _, h as w, reactive as qe, computed as H, onMounted as We, watch as Ze, isRef as Me, createElementBlock as $, Fragment as W, createCommentVNode as Q, normalizeClass as fe, renderList as ge, normalizeStyle as Ie, Teleport as Je, mergeProps as Xe } from "vue";
|
|
2
|
+
import { X as Qe, u as Ce, af as J, l as et, J as Be, i as R, t as tt, K as be, q as at, r as nt, s as ot, ag as Ue, ah as Ee, a3 as He, ai as oe, a9 as st, ae as ne, V as Le, D as Re, h as _e, f as rt, e as lt, a as ct, z as it, _ as ut, B as dt, C as mt, E as De } from "./app-Dgg5mqsW.js";
|
|
3
|
+
import { useCoreStore as ft, useI18n as ze } from "@feedmepos/mf-common";
|
|
4
|
+
import { useSnackbar as Fe, useDialog as pt, useProxiedModel as vt, components as me, useBreakpoints as yt } from "@feedmepos/ui-library";
|
|
5
|
+
import { defineStore as Ne, storeToRefs as gt } from "pinia";
|
|
6
|
+
import { a as Oe, u as Ve } from "./stock-CDP8ZqBZ.js";
|
|
7
|
+
import { E as bt } from "./empty-placeholder-wf6-BWE8.js";
|
|
8
|
+
const $e = Qe((n, r) => {
|
|
9
9
|
function e() {
|
|
10
|
-
return
|
|
10
|
+
return Ce().currentLocation.dbName;
|
|
11
11
|
}
|
|
12
12
|
return {
|
|
13
|
-
async getDraft(
|
|
14
|
-
const
|
|
13
|
+
async getDraft(m) {
|
|
14
|
+
const c = e(), g = `${n.inventoryBackendUrl}/${c}/closing-draft/${m}`;
|
|
15
15
|
return r.get(g);
|
|
16
16
|
},
|
|
17
17
|
async readDrafts() {
|
|
18
|
-
const
|
|
19
|
-
return r.get(
|
|
18
|
+
const m = e(), c = `${n.inventoryBackendUrl}/${m}/closing-draft`;
|
|
19
|
+
return r.get(c);
|
|
20
20
|
},
|
|
21
|
-
async runOperation(
|
|
22
|
-
const
|
|
23
|
-
return r.post(g,
|
|
21
|
+
async runOperation(m) {
|
|
22
|
+
const c = e(), g = `${n.inventoryBackendUrl}/${c}/closing-draft/run-operation`;
|
|
23
|
+
return r.post(g, m);
|
|
24
24
|
},
|
|
25
|
-
async sync(
|
|
26
|
-
const
|
|
27
|
-
return r.post(g,
|
|
25
|
+
async sync(m) {
|
|
26
|
+
const c = e(), g = `${n.inventoryBackendUrl}/${c}/closing-draft/sync`;
|
|
27
|
+
return r.post(g, m);
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
}),
|
|
30
|
+
}), ht = { class: "fm-typo-en-body-lg-400" }, xt = { class: "fm-typo-en-body-lg-600" }, At = { class: "flex gap-12 py-8 justify-end w-full" }, Pe = /* @__PURE__ */ Se({
|
|
31
31
|
__name: "ClosingDraftAction",
|
|
32
32
|
props: {
|
|
33
33
|
draft: {},
|
|
@@ -36,24 +36,24 @@ const Fe = Qe((n, r) => {
|
|
|
36
36
|
onFinished: { type: Function }
|
|
37
37
|
},
|
|
38
38
|
setup(n) {
|
|
39
|
-
const r = n, e = O(),
|
|
39
|
+
const r = n, e = O(), m = $e(), c = Fe(), g = O(!1);
|
|
40
40
|
async function x() {
|
|
41
41
|
g.value = !0;
|
|
42
42
|
try {
|
|
43
|
-
await
|
|
43
|
+
await m.runOperation({
|
|
44
44
|
_id: r.draft._id,
|
|
45
45
|
_rev: r.draft._rev ?? "",
|
|
46
46
|
action: r.action,
|
|
47
47
|
data: {
|
|
48
48
|
remark: e.value
|
|
49
49
|
}
|
|
50
|
-
}).delayed(500),
|
|
50
|
+
}).delayed(500), c.open({
|
|
51
51
|
title: "Success",
|
|
52
52
|
message: "Action submitted",
|
|
53
53
|
type: "success"
|
|
54
54
|
}), r.onFinished();
|
|
55
55
|
} catch (D) {
|
|
56
|
-
|
|
56
|
+
c.open({
|
|
57
57
|
title: "Something went wrong",
|
|
58
58
|
message: "Unable to submit actino. Please try again",
|
|
59
59
|
type: "error"
|
|
@@ -62,36 +62,36 @@ const Fe = Qe((n, r) => {
|
|
|
62
62
|
g.value = !1;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
return (D,
|
|
66
|
-
const C = E("FmTextField"), T = E("FmButton"),
|
|
67
|
-
return
|
|
65
|
+
return (D, i) => {
|
|
66
|
+
const C = E("FmTextField"), T = E("FmButton"), P = E("FmForm");
|
|
67
|
+
return b(), Z(P, {
|
|
68
68
|
onValidationSuccess: x,
|
|
69
69
|
class: "flex flex-col gap-32",
|
|
70
70
|
disabled: g.value
|
|
71
71
|
}, {
|
|
72
|
-
default:
|
|
73
|
-
o("div",
|
|
74
|
-
|
|
75
|
-
o("span",
|
|
76
|
-
|
|
72
|
+
default: K(() => [
|
|
73
|
+
o("div", ht, [
|
|
74
|
+
i[2] || (i[2] = je(" You are about to ")),
|
|
75
|
+
o("span", xt, N(D.action == y(J).enum.approveDraft ? "approve" : "reject"), 1),
|
|
76
|
+
i[3] || (i[3] = je(" this draft. Please provider a remark to justify this action. "))
|
|
77
77
|
]),
|
|
78
78
|
_(C, {
|
|
79
79
|
modelValue: e.value,
|
|
80
|
-
"onUpdate:modelValue":
|
|
80
|
+
"onUpdate:modelValue": i[0] || (i[0] = (u) => e.value = u),
|
|
81
81
|
label: "Remark",
|
|
82
82
|
"label-mark": "required",
|
|
83
|
-
rules: [y(
|
|
83
|
+
rules: [y(et)()]
|
|
84
84
|
}, null, 8, ["modelValue", "rules"]),
|
|
85
|
-
o("div",
|
|
85
|
+
o("div", At, [
|
|
86
86
|
_(T, {
|
|
87
87
|
label: "Cancel",
|
|
88
88
|
variant: "tertiary",
|
|
89
|
-
onClick:
|
|
89
|
+
onClick: i[1] || (i[1] = (u) => D.onCancel())
|
|
90
90
|
}),
|
|
91
91
|
_(T, {
|
|
92
|
-
label: D.action == y(
|
|
92
|
+
label: D.action == y(J).enum.approveDraft ? "Approve" : "Reject",
|
|
93
93
|
type: "submit",
|
|
94
|
-
variant: D.action == y(
|
|
94
|
+
variant: D.action == y(J).enum.approveDraft ? "primary" : "destructive",
|
|
95
95
|
loading: g.value
|
|
96
96
|
}, null, 8, ["label", "variant", "loading"])
|
|
97
97
|
])
|
|
@@ -100,58 +100,58 @@ const Fe = Qe((n, r) => {
|
|
|
100
100
|
}, 8, ["disabled"]);
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
}),
|
|
104
|
-
function
|
|
105
|
-
const r = n.measurementsAmounts.groupBy((
|
|
106
|
-
var D,
|
|
107
|
-
const g = ((
|
|
108
|
-
return
|
|
109
|
-
}, +
|
|
110
|
-
return
|
|
103
|
+
}), _t = be(0);
|
|
104
|
+
function Ye(n) {
|
|
105
|
+
const r = n.measurementsAmounts.groupBy((m) => m.measurement.id), e = n.sku.unit.measurements.reduce((m, c) => {
|
|
106
|
+
var D, i;
|
|
107
|
+
const g = ((i = (D = r.get(c.id)) == null ? void 0 : D[0]) == null ? void 0 : i.amount) ?? _t, x = Be(c.conversion, g);
|
|
108
|
+
return m + +R(x);
|
|
109
|
+
}, +R(n.baseAmount));
|
|
110
|
+
return tt(e, n.baseAmount.precision);
|
|
111
111
|
}
|
|
112
|
-
const
|
|
113
|
-
function
|
|
114
|
-
const
|
|
112
|
+
const Dt = be(0), kt = be(100);
|
|
113
|
+
function wt(n, r, e) {
|
|
114
|
+
const m = Ye(n), c = Ue(m, r), g = r.amount === 0 ? null : Ee(c, {
|
|
115
115
|
...r,
|
|
116
116
|
amount: Math.abs(r.amount)
|
|
117
|
-
}), x = g ?
|
|
117
|
+
}), x = g ? Be(g, kt) : null;
|
|
118
118
|
return {
|
|
119
119
|
code: n.sku.code,
|
|
120
120
|
name: n.sku.name,
|
|
121
121
|
baseUnit: n.sku.unit.abbrev,
|
|
122
|
-
baseUnitAmount: +
|
|
122
|
+
baseUnitAmount: +R(n.baseAmount),
|
|
123
123
|
...n.measurementsAmounts.filter(
|
|
124
|
-
(
|
|
124
|
+
(i) => Ct(i.measurement) && e.includes(i.measurement.id)
|
|
125
125
|
).reduce(
|
|
126
|
-
(
|
|
126
|
+
(i, C, T) => (i[`measurementAbbrev${T}`] = `(${C.measurement.abbrev}) × ${R(C.measurement.conversion)}`, i[`measurementAmount${T}`] = +R(C.amount), i),
|
|
127
127
|
{}
|
|
128
128
|
),
|
|
129
|
-
systemBalance: +
|
|
130
|
-
physicalBalance: +
|
|
131
|
-
adjustedAmount: +
|
|
132
|
-
adjustedDiffPercentage: x ? +
|
|
129
|
+
systemBalance: +R(r),
|
|
130
|
+
physicalBalance: +R(m),
|
|
131
|
+
adjustedAmount: +R(c),
|
|
132
|
+
adjustedDiffPercentage: x ? +R(He(x, 2)) : null
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function Ct(n) {
|
|
136
136
|
return !n.abbrev.toLocaleLowerCase().includes("inactive");
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
const r =
|
|
138
|
+
function jt(n) {
|
|
139
|
+
const r = Ke(n);
|
|
140
140
|
return n.reduce(
|
|
141
|
-
(e,
|
|
142
|
-
var
|
|
143
|
-
return Math.max(e, ((
|
|
141
|
+
(e, m) => {
|
|
142
|
+
var c;
|
|
143
|
+
return Math.max(e, ((c = r == null ? void 0 : r.get(m.sku._id)) == null ? void 0 : c[0].length) ?? 0);
|
|
144
144
|
},
|
|
145
145
|
0
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function Ke(n) {
|
|
149
149
|
return n.groupBy(
|
|
150
150
|
(r) => r.sku._id,
|
|
151
151
|
(r) => r.measurementsAmounts.filter((e) => !e.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((e) => e.measurement.id)
|
|
152
152
|
);
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function St(n) {
|
|
155
155
|
return [
|
|
156
156
|
{
|
|
157
157
|
id: "code",
|
|
@@ -185,98 +185,98 @@ function jt(n) {
|
|
|
185
185
|
id: "baseUnit",
|
|
186
186
|
name: "Base unit"
|
|
187
187
|
},
|
|
188
|
-
...Array.from({ length: n }).flatMap((e,
|
|
188
|
+
...Array.from({ length: n }).flatMap((e, m) => [
|
|
189
189
|
{
|
|
190
|
-
id: `measurementAmount${
|
|
191
|
-
name: `UOM amount ${
|
|
190
|
+
id: `measurementAmount${m}`,
|
|
191
|
+
name: `UOM amount ${m + 1}`
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
|
-
id: `measurementAbbrev${
|
|
195
|
-
name: `UOM ${
|
|
194
|
+
id: `measurementAbbrev${m}`,
|
|
195
|
+
name: `UOM ${m + 1}`
|
|
196
196
|
}
|
|
197
197
|
])
|
|
198
198
|
];
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
var
|
|
200
|
+
function Bt(n, r) {
|
|
201
|
+
var k, h, v, B, L, j, I;
|
|
202
202
|
const e = r.groupBy(
|
|
203
|
-
(
|
|
204
|
-
(
|
|
205
|
-
),
|
|
206
|
-
var
|
|
207
|
-
const
|
|
208
|
-
return
|
|
209
|
-
}), x =
|
|
210
|
-
["Business name:",
|
|
211
|
-
["Business ID:",
|
|
212
|
-
["Menu version",
|
|
203
|
+
(S) => S.id,
|
|
204
|
+
(S) => S.balance
|
|
205
|
+
), m = [...n.items, ...n.negativeStockItems ?? []], c = Ke(m), g = m.map((S) => {
|
|
206
|
+
var X, se;
|
|
207
|
+
const G = ((X = e.get(S.sku._id)) == null ? void 0 : X[0]) ?? Dt, le = ((se = c == null ? void 0 : c.get(S.sku._id)) == null ? void 0 : se[0]) ?? [];
|
|
208
|
+
return wt(S, G, le);
|
|
209
|
+
}), x = jt(m), i = ft().currentBusiness.value, C = St(x), T = [
|
|
210
|
+
["Business name:", i == null ? void 0 : i.name],
|
|
211
|
+
["Business ID:", i == null ? void 0 : i._id],
|
|
212
|
+
["Menu version", i == null ? void 0 : i.menuVersion],
|
|
213
213
|
["Created at", new Date(n.createdAt)],
|
|
214
|
-
["Created by", (
|
|
214
|
+
["Created by", (k = n.createdBy) == null ? void 0 : k.name],
|
|
215
215
|
["Updated at", new Date(n.updatedAt)],
|
|
216
|
-
["Updated by", (
|
|
216
|
+
["Updated by", (h = n.updatedBy) == null ? void 0 : h.name],
|
|
217
217
|
["Recent action", n.approvedAt ? "Approve" : n.rejectionHistory ? "Reject" : ""],
|
|
218
218
|
[
|
|
219
219
|
"Action by",
|
|
220
|
-
n.approvedAt ? (v = n.approvedBy) == null ? void 0 : v.name : n.rejectionHistory ? (
|
|
220
|
+
n.approvedAt ? (v = n.approvedBy) == null ? void 0 : v.name : n.rejectionHistory ? (L = (B = n.rejectionHistory[0]) == null ? void 0 : B.rejectedBy) == null ? void 0 : L.name : ""
|
|
221
221
|
],
|
|
222
222
|
[
|
|
223
223
|
"Action at",
|
|
224
|
-
n.approvedAt ? new Date(n.approvedAt) : n.rejectionHistory ? new Date((
|
|
224
|
+
n.approvedAt ? new Date(n.approvedAt) : n.rejectionHistory ? new Date((j = n.rejectionHistory[0]) == null ? void 0 : j.rejectedAt) : ""
|
|
225
225
|
],
|
|
226
226
|
[
|
|
227
227
|
"Action remark",
|
|
228
228
|
n.approvedAt ? n.approveRemark : n.rejectionHistory ? new Date((I = n.rejectionHistory[0]) == null ? void 0 : I.rejectRemark) : ""
|
|
229
229
|
],
|
|
230
230
|
[],
|
|
231
|
-
C.map((
|
|
232
|
-
...g.map((
|
|
233
|
-
],
|
|
234
|
-
return
|
|
231
|
+
C.map((S) => S.name),
|
|
232
|
+
...g.map((S) => C.map((G) => S[G.id]))
|
|
233
|
+
], P = C.map((S) => `system:${S.id}`), u = at(T, P), p = `[${i == null ? void 0 : i.name}] closing draft (${nt(new Date(n.updatedAt))}).xlsx`;
|
|
234
|
+
return ot(u, p), p;
|
|
235
235
|
}
|
|
236
|
-
const
|
|
236
|
+
const we = Ne(
|
|
237
237
|
"closingDraftActions",
|
|
238
238
|
function() {
|
|
239
|
-
const r =
|
|
240
|
-
function
|
|
239
|
+
const r = pt(), e = Fe(), m = Oe(), c = $e(), g = Ve(), x = O(!1), D = O();
|
|
240
|
+
function i(h) {
|
|
241
241
|
const v = {
|
|
242
|
-
draft:
|
|
242
|
+
draft: h
|
|
243
243
|
};
|
|
244
244
|
D.value = v, x.value = !0;
|
|
245
245
|
}
|
|
246
|
-
async function C(
|
|
247
|
-
var
|
|
248
|
-
if (
|
|
249
|
-
const
|
|
250
|
-
if (!
|
|
246
|
+
async function C(h) {
|
|
247
|
+
var B;
|
|
248
|
+
if (h.status === oe.enum.COMPLETED) {
|
|
249
|
+
const L = h.closingAdjustmentId;
|
|
250
|
+
if (!L)
|
|
251
251
|
return e.open({
|
|
252
252
|
title: "Something went wrong",
|
|
253
253
|
message: "Closing draft is completed but closing document cannot be found.",
|
|
254
254
|
type: "error"
|
|
255
255
|
}), console.error("Closing draft is completed but closing document cannot be found.", {
|
|
256
|
-
draftId:
|
|
256
|
+
draftId: h._id
|
|
257
257
|
}), [];
|
|
258
|
-
const
|
|
259
|
-
return ((
|
|
260
|
-
id:
|
|
261
|
-
balance:
|
|
262
|
-
costs:
|
|
258
|
+
const j = await m.readAdjustmentById(L);
|
|
259
|
+
return ((j == null ? void 0 : j.skus) ?? []).map((S) => ({
|
|
260
|
+
id: S.sku._id,
|
|
261
|
+
balance: S.fromBalance,
|
|
262
|
+
costs: S.fromCostBalances
|
|
263
263
|
}));
|
|
264
264
|
} else
|
|
265
|
-
return await g.readStockBalance(), ((
|
|
265
|
+
return await g.readStockBalance(), ((B = g.stockBalance) == null ? void 0 : B.skus) ?? [];
|
|
266
266
|
}
|
|
267
|
-
async function T(
|
|
267
|
+
async function T(h, v) {
|
|
268
268
|
v || (e.open({
|
|
269
269
|
title: "Exporting",
|
|
270
270
|
message: "Fetching data..."
|
|
271
|
-
}), v = await C(
|
|
271
|
+
}), v = await C(h)), Bt(h, v);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function P(h, v) {
|
|
274
274
|
r.open({
|
|
275
275
|
title: "Approve draft",
|
|
276
|
-
contentComponent:
|
|
276
|
+
contentComponent: Pe,
|
|
277
277
|
contentComponentProps: {
|
|
278
|
-
draft:
|
|
279
|
-
action:
|
|
278
|
+
draft: h,
|
|
279
|
+
action: J.enum.approveDraft,
|
|
280
280
|
onFinished: () => {
|
|
281
281
|
r.close(), v == null || v();
|
|
282
282
|
},
|
|
@@ -284,13 +284,13 @@ const ke = ze(
|
|
|
284
284
|
}
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function u(h, v) {
|
|
288
288
|
r.open({
|
|
289
289
|
title: "Reject draft",
|
|
290
|
-
contentComponent:
|
|
290
|
+
contentComponent: Pe,
|
|
291
291
|
contentComponentProps: {
|
|
292
|
-
draft:
|
|
293
|
-
action:
|
|
292
|
+
draft: h,
|
|
293
|
+
action: J.enum.rejectDraft,
|
|
294
294
|
onFinished: () => {
|
|
295
295
|
r.close(), v == null || v();
|
|
296
296
|
},
|
|
@@ -298,13 +298,13 @@ const ke = ze(
|
|
|
298
298
|
}
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
async function
|
|
302
|
-
await
|
|
303
|
-
_id:
|
|
304
|
-
_rev:
|
|
305
|
-
action:
|
|
301
|
+
async function p(h, v) {
|
|
302
|
+
await c.sync({
|
|
303
|
+
_id: h._id,
|
|
304
|
+
_rev: h._rev ?? "",
|
|
305
|
+
action: J.enum.approveDraft,
|
|
306
306
|
data: {
|
|
307
|
-
remark:
|
|
307
|
+
remark: h.remark ?? ""
|
|
308
308
|
}
|
|
309
309
|
}).delayed(500), e.open({
|
|
310
310
|
title: "Success",
|
|
@@ -312,22 +312,22 @@ const ke = ze(
|
|
|
312
312
|
type: "success"
|
|
313
313
|
}), v == null || v();
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function k() {
|
|
316
316
|
x.value = !1;
|
|
317
317
|
}
|
|
318
318
|
return {
|
|
319
|
-
viewDraft:
|
|
320
|
-
closeDraftDialog:
|
|
321
|
-
approveDraft:
|
|
322
|
-
rejectDraft:
|
|
323
|
-
syncDraft:
|
|
319
|
+
viewDraft: i,
|
|
320
|
+
closeDraftDialog: k,
|
|
321
|
+
approveDraft: P,
|
|
322
|
+
rejectDraft: u,
|
|
323
|
+
syncDraft: p,
|
|
324
324
|
exportDraft: T,
|
|
325
325
|
viewClosingDraftShow: x,
|
|
326
326
|
viewClosingDraftProps: D
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
329
|
);
|
|
330
|
-
function
|
|
330
|
+
function ke(n) {
|
|
331
331
|
switch (n) {
|
|
332
332
|
case "DRAFT":
|
|
333
333
|
return "fm-status-badge-draft";
|
|
@@ -339,52 +339,52 @@ function De(n) {
|
|
|
339
339
|
return "fm-status-badge-complete";
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
const
|
|
342
|
+
const Ft = Ne(
|
|
343
343
|
"closingDraftTable",
|
|
344
344
|
function() {
|
|
345
|
-
const { t: r } =
|
|
345
|
+
const { t: r } = ze(), e = we(), m = O(new Array()), c = O(!1), g = Ce(), x = $e();
|
|
346
346
|
async function D() {
|
|
347
|
-
if (
|
|
348
|
-
|
|
347
|
+
if (m.value = [], !!g._currentLocation) {
|
|
348
|
+
c.value = !0;
|
|
349
349
|
try {
|
|
350
|
-
const [
|
|
351
|
-
|
|
352
|
-
} catch (
|
|
353
|
-
console.log("Something went wrong when fetching drafts:",
|
|
350
|
+
const [u] = await Promise.all([x.readDrafts()]).delayed(1e3);
|
|
351
|
+
m.value = u.reverse();
|
|
352
|
+
} catch (u) {
|
|
353
|
+
console.log("Something went wrong when fetching drafts:", u);
|
|
354
354
|
} finally {
|
|
355
|
-
|
|
355
|
+
c.value = !1;
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
async function u
|
|
360
|
-
if (!
|
|
361
|
-
|
|
359
|
+
async function i(u) {
|
|
360
|
+
if (!m.value.find((p) => p._id) && g._currentLocation) {
|
|
361
|
+
c.value = !0;
|
|
362
362
|
try {
|
|
363
|
-
const [
|
|
364
|
-
x.getDraft(
|
|
365
|
-
new Promise((
|
|
363
|
+
const [p] = await Promise.all([
|
|
364
|
+
x.getDraft(u),
|
|
365
|
+
new Promise((k) => setTimeout(k, 1e3))
|
|
366
366
|
]);
|
|
367
|
-
|
|
368
|
-
} catch (
|
|
369
|
-
console.log("Something went wrong when fetching drafts:",
|
|
367
|
+
m.value = [p];
|
|
368
|
+
} catch (p) {
|
|
369
|
+
console.log("Something went wrong when fetching drafts:", p);
|
|
370
370
|
} finally {
|
|
371
|
-
|
|
371
|
+
c.value = !1;
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
function C() {
|
|
376
376
|
e.closeDraftDialog(), D();
|
|
377
377
|
}
|
|
378
|
-
function T(
|
|
379
|
-
switch (
|
|
380
|
-
case
|
|
381
|
-
return e.viewDraft(
|
|
382
|
-
case
|
|
383
|
-
return e.exportDraft(
|
|
384
|
-
case
|
|
385
|
-
return e.approveDraft(
|
|
386
|
-
case
|
|
387
|
-
return e.rejectDraft(
|
|
378
|
+
function T(u, p) {
|
|
379
|
+
switch (p = lt(p), u) {
|
|
380
|
+
case _e.Details:
|
|
381
|
+
return e.viewDraft(p);
|
|
382
|
+
case _e.Export:
|
|
383
|
+
return e.exportDraft(p);
|
|
384
|
+
case J.enum.approveDraft:
|
|
385
|
+
return e.approveDraft(p, C);
|
|
386
|
+
case J.enum.rejectDraft:
|
|
387
|
+
return e.rejectDraft(p, C);
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
390
|
return {
|
|
@@ -393,14 +393,14 @@ const Bt = ze(
|
|
|
393
393
|
id: "_id",
|
|
394
394
|
accessorKey: "_id",
|
|
395
395
|
header: () => r("inventory.closing.table.createdAt"),
|
|
396
|
-
cell(
|
|
397
|
-
return
|
|
396
|
+
cell(u) {
|
|
397
|
+
return st(`${u.getValue()}`);
|
|
398
398
|
},
|
|
399
399
|
enableSorting: !0
|
|
400
400
|
},
|
|
401
401
|
{
|
|
402
402
|
id: "updatedAt",
|
|
403
|
-
accessorFn: (
|
|
403
|
+
accessorFn: (u) => ne(u.updatedAt),
|
|
404
404
|
header: () => "Updated at",
|
|
405
405
|
enableSorting: !0,
|
|
406
406
|
size: 200
|
|
@@ -414,9 +414,9 @@ const Bt = ze(
|
|
|
414
414
|
},
|
|
415
415
|
{
|
|
416
416
|
id: "noOfItems",
|
|
417
|
-
accessorFn: (
|
|
418
|
-
var
|
|
419
|
-
return
|
|
417
|
+
accessorFn: (u) => {
|
|
418
|
+
var p;
|
|
419
|
+
return u.items.length + (((p = u.negativeStockItems) == null ? void 0 : p.length) ?? 0);
|
|
420
420
|
},
|
|
421
421
|
header: () => r("inventory.closing.table.noOfItems"),
|
|
422
422
|
enableSorting: !1,
|
|
@@ -427,21 +427,21 @@ const Bt = ze(
|
|
|
427
427
|
},
|
|
428
428
|
{
|
|
429
429
|
id: "recentRemark",
|
|
430
|
-
accessorFn: (
|
|
431
|
-
var
|
|
432
|
-
return (
|
|
430
|
+
accessorFn: (u) => {
|
|
431
|
+
var p;
|
|
432
|
+
return (u == null ? void 0 : u.approveRemark) ?? ((p = u == null ? void 0 : u.rejectionHistory) == null ? void 0 : p.computeFirst((k) => k.rejectRemark)) ?? u.remark;
|
|
433
433
|
},
|
|
434
434
|
header: () => "Recent remark"
|
|
435
435
|
},
|
|
436
436
|
{
|
|
437
437
|
id: "status",
|
|
438
|
-
accessorFn: (
|
|
438
|
+
accessorFn: (u) => u.status,
|
|
439
439
|
header: () => r("inventory.closing.table.status"),
|
|
440
440
|
enableSorting: !1,
|
|
441
|
-
cell(
|
|
442
|
-
var
|
|
443
|
-
const
|
|
444
|
-
return
|
|
441
|
+
cell(u) {
|
|
442
|
+
var L;
|
|
443
|
+
const p = u.row.original, k = p.status, h = new Date(p.updatedAt), v = (L = p == null ? void 0 : p.rejectionHistory) == null ? void 0 : L.computeFirst((j) => j.rejectedAt), B = v ? new Date(v) : null;
|
|
444
|
+
return k === "DRAFT" && B ? B.getTime() > h.getTime() ? w(
|
|
445
445
|
"div",
|
|
446
446
|
{
|
|
447
447
|
class: "flex"
|
|
@@ -449,7 +449,7 @@ const Bt = ze(
|
|
|
449
449
|
w(
|
|
450
450
|
"div",
|
|
451
451
|
{
|
|
452
|
-
class: ["fm-status-badge",
|
|
452
|
+
class: ["fm-status-badge", ke("FAILED")]
|
|
453
453
|
},
|
|
454
454
|
"Rejected"
|
|
455
455
|
)
|
|
@@ -461,7 +461,7 @@ const Bt = ze(
|
|
|
461
461
|
w(
|
|
462
462
|
"div",
|
|
463
463
|
{
|
|
464
|
-
class: ["fm-status-badge",
|
|
464
|
+
class: ["fm-status-badge", ke("PROCESSING")]
|
|
465
465
|
},
|
|
466
466
|
"Updated"
|
|
467
467
|
)
|
|
@@ -473,37 +473,37 @@ const Bt = ze(
|
|
|
473
473
|
w(
|
|
474
474
|
"div",
|
|
475
475
|
{
|
|
476
|
-
class: ["fm-status-badge",
|
|
476
|
+
class: ["fm-status-badge", ke(k)]
|
|
477
477
|
},
|
|
478
|
-
|
|
478
|
+
Le(k)
|
|
479
479
|
)
|
|
480
480
|
);
|
|
481
481
|
}
|
|
482
482
|
},
|
|
483
483
|
{
|
|
484
484
|
id: "action",
|
|
485
|
-
cell(
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
],
|
|
485
|
+
cell(u) {
|
|
486
|
+
const p = u.row.original, k = [
|
|
487
|
+
Re[_e.Details],
|
|
488
|
+
Re[_e.Export]
|
|
489
|
+
], h = [
|
|
490
490
|
{
|
|
491
491
|
translationKey: "inventory.closing.draft.approveDraft",
|
|
492
492
|
color: "text-fm-color-typo-primary",
|
|
493
|
-
value:
|
|
493
|
+
value: J.enum.approveDraft
|
|
494
494
|
},
|
|
495
495
|
{
|
|
496
496
|
translationKey: "inventory.closing.draft.rejectDraft",
|
|
497
497
|
color: "text-fm-color-typo-error",
|
|
498
|
-
value:
|
|
498
|
+
value: J.enum.rejectDraft
|
|
499
499
|
}
|
|
500
500
|
];
|
|
501
|
-
return
|
|
501
|
+
return rt(
|
|
502
502
|
[
|
|
503
|
-
...
|
|
504
|
-
...
|
|
503
|
+
...k,
|
|
504
|
+
...p.status === oe.enum.DRAFT ? h : []
|
|
505
505
|
],
|
|
506
|
-
(v) => T(v,
|
|
506
|
+
(v) => T(v, p)
|
|
507
507
|
);
|
|
508
508
|
},
|
|
509
509
|
enableSorting: !1,
|
|
@@ -514,43 +514,43 @@ const Bt = ze(
|
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
516
|
],
|
|
517
|
-
drafts:
|
|
518
|
-
loading:
|
|
517
|
+
drafts: m,
|
|
518
|
+
loading: c,
|
|
519
519
|
fetchDrafts: D,
|
|
520
|
-
loadDraft:
|
|
520
|
+
loadDraft: i
|
|
521
521
|
};
|
|
522
522
|
}
|
|
523
|
-
),
|
|
523
|
+
), $t = { class: "w-full flex flex-col gap-32" }, Tt = { class: "flex justify-between" }, Rt = { class: "flex" }, Pt = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, Mt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, It = { class: "flex gap-1" }, Ut = { class: "fm-typo-en-body-lg-600" }, Et = { class: "flex flex-col gap-16" }, Ht = { class: "flex items-center" }, Lt = {
|
|
524
524
|
key: 0,
|
|
525
525
|
class: "flex gap-8"
|
|
526
|
-
},
|
|
526
|
+
}, zt = {
|
|
527
527
|
key: 0,
|
|
528
528
|
class: "w-full flex flex-col items-center"
|
|
529
|
-
},
|
|
529
|
+
}, Nt = { class: "flex items-center gap-8" }, Ot = {
|
|
530
530
|
key: 0,
|
|
531
531
|
class: "flex gap-8"
|
|
532
|
-
},
|
|
532
|
+
}, Vt = { class: "overflow-x-auto" }, Yt = {
|
|
533
533
|
key: 1,
|
|
534
534
|
class: "flex-1 xs:w-screen xs:max-w-full"
|
|
535
|
-
},
|
|
535
|
+
}, Kt = {
|
|
536
536
|
key: 0,
|
|
537
537
|
class: "flex flex-col items-center gap-8 h-full"
|
|
538
|
-
},
|
|
538
|
+
}, Gt = ["src"], qt = {
|
|
539
539
|
key: 1,
|
|
540
540
|
class: "px-4 flex flex-col"
|
|
541
|
-
}, Wt = { class: "flex gap-12 content-stretch" },
|
|
541
|
+
}, Wt = { class: "flex gap-12 content-stretch" }, Zt = {
|
|
542
542
|
class: "flex flex-col w-24",
|
|
543
543
|
name: "circles"
|
|
544
|
-
},
|
|
544
|
+
}, Jt = { class: "flex-1 flex flex-col items-center" }, Xt = { class: "flex-1 flex flex-col items-center" }, Qt = {
|
|
545
545
|
class: "py-12 flex flex-col gap-4",
|
|
546
546
|
name: "received-at header"
|
|
547
|
-
},
|
|
547
|
+
}, ea = { class: "fm-typo-en-body-lg-400" }, ta = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, aa = { class: "flex gap-12 content-stretch" }, na = {
|
|
548
548
|
class: "flex flex-col w-24",
|
|
549
549
|
name: "circles"
|
|
550
|
-
},
|
|
550
|
+
}, oa = { class: "flex-1 flex flex-col items-center" }, sa = {
|
|
551
551
|
class: "py-12 flex flex-col gap-4 flex-1",
|
|
552
552
|
name: "delivery details"
|
|
553
|
-
},
|
|
553
|
+
}, ra = { class: "flex flex-col gap-8" }, la = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ca = { class: "flex flex-col gap-4" }, ia = { class: "flex gap-8" }, ua = /* @__PURE__ */ Se({
|
|
554
554
|
__name: "ClosingDraftDialog",
|
|
555
555
|
props: {
|
|
556
556
|
show: { type: Boolean },
|
|
@@ -558,38 +558,39 @@ const Bt = ze(
|
|
|
558
558
|
},
|
|
559
559
|
emits: ["submitted"],
|
|
560
560
|
setup(n, { emit: r }) {
|
|
561
|
-
const e = n,
|
|
562
|
-
|
|
561
|
+
const e = n, m = Ve(), c = we(), g = vt(e, "show"), x = O(!1), D = O(!1), i = O(!1), C = O(new Array()), T = Oe(), P = Fe(), u = ct(), p = Ce(), k = qe({}), h = H(() => new Set(
|
|
562
|
+
u.skus.filter((a) => {
|
|
563
563
|
var t;
|
|
564
|
-
return
|
|
564
|
+
return k[(t = a.customAttributes) == null ? void 0 : t.tag];
|
|
565
565
|
}).map((a) => a._id)
|
|
566
|
-
)),
|
|
566
|
+
)), v = r, B = H(() => {
|
|
567
567
|
var t, s;
|
|
568
568
|
const a = [...((t = e.draft) == null ? void 0 : t.items) ?? [], ...((s = e.draft) == null ? void 0 : s.negativeStockItems) ?? []];
|
|
569
|
-
return
|
|
570
|
-
}),
|
|
571
|
-
const a =
|
|
569
|
+
return h.value.size ? a.filter((l) => h.value.has(l.sku._id)) : a;
|
|
570
|
+
}), L = H(() => {
|
|
571
|
+
const a = B.value.map((t) => t.sku);
|
|
572
572
|
return a.sort((t, s) => t.code.localeCompare(s.code)), a;
|
|
573
|
-
}),
|
|
573
|
+
}), j = H(() => B.value.groupBy(
|
|
574
574
|
(t) => t.sku._id,
|
|
575
575
|
(t) => t.measurementsAmounts.filter((s) => !s.measurement.abbrev.toLocaleLowerCase().includes("inactive")).map((s) => s.measurement.id)
|
|
576
576
|
));
|
|
577
|
-
We(
|
|
577
|
+
We(G), Ze(
|
|
578
578
|
() => e.show,
|
|
579
579
|
(a) => {
|
|
580
|
-
a && (te.value =
|
|
580
|
+
a && (te.value = ie[0], G());
|
|
581
581
|
}
|
|
582
582
|
);
|
|
583
|
-
const
|
|
584
|
-
async function
|
|
583
|
+
const I = be(0), S = be(100);
|
|
584
|
+
async function G() {
|
|
585
585
|
var t, s, l;
|
|
586
|
+
if (!p._currentLocation) return;
|
|
586
587
|
x.value = !0;
|
|
587
588
|
const a = ((t = e.draft) == null ? void 0 : t.status) === oe.enum.COMPLETED;
|
|
588
589
|
try {
|
|
589
|
-
if (await
|
|
590
|
-
const
|
|
591
|
-
if (!
|
|
592
|
-
|
|
590
|
+
if (await u.init(), a) {
|
|
591
|
+
const d = e.draft.closingAdjustmentId;
|
|
592
|
+
if (!d) {
|
|
593
|
+
P.open({
|
|
593
594
|
title: "Something went wrong",
|
|
594
595
|
message: "Closing draft is completed but closing document cannot be found.",
|
|
595
596
|
type: "error"
|
|
@@ -598,29 +599,29 @@ const Bt = ze(
|
|
|
598
599
|
});
|
|
599
600
|
return;
|
|
600
601
|
}
|
|
601
|
-
const
|
|
602
|
-
C.value =
|
|
602
|
+
const f = await T.readAdjustmentById(d), M = (f == null ? void 0 : f.skus) ?? [];
|
|
603
|
+
C.value = M.map((U) => ({
|
|
603
604
|
id: U.sku._id,
|
|
604
605
|
balance: U.fromBalance,
|
|
605
606
|
costs: U.fromCostBalances
|
|
606
607
|
}));
|
|
607
608
|
} else
|
|
608
609
|
C.value = ((l = e.draft) == null ? void 0 : l.stockSnapshot) ?? [];
|
|
609
|
-
} catch (
|
|
610
|
-
|
|
610
|
+
} catch (d) {
|
|
611
|
+
P.open({
|
|
611
612
|
title: "Something went wrong",
|
|
612
613
|
message: "Something went wrong when fetching info. Please try again.",
|
|
613
614
|
type: "error"
|
|
614
|
-
}), console.error("error on fetch stock balances",
|
|
615
|
+
}), console.error("error on fetch stock balances", d);
|
|
615
616
|
} finally {
|
|
616
617
|
x.value = !1;
|
|
617
618
|
}
|
|
618
619
|
}
|
|
619
|
-
async function
|
|
620
|
+
async function le() {
|
|
620
621
|
var t, s;
|
|
621
622
|
const a = ((t = e.draft) == null ? void 0 : t.effectiveAt) ?? ((s = e.draft) == null ? void 0 : s.updatedAt);
|
|
622
623
|
if (!a) {
|
|
623
|
-
|
|
624
|
+
P.open({
|
|
624
625
|
title: "Cannot refresh",
|
|
625
626
|
message: "Effective date is not available for this draft.",
|
|
626
627
|
type: "error"
|
|
@@ -633,13 +634,13 @@ const Bt = ze(
|
|
|
633
634
|
a,
|
|
634
635
|
e.draft._id
|
|
635
636
|
);
|
|
636
|
-
C.value = l,
|
|
637
|
+
C.value = l, P.open({
|
|
637
638
|
title: "Balance refreshed",
|
|
638
639
|
message: "Stock balance has been recalculated.",
|
|
639
640
|
type: "success"
|
|
640
641
|
});
|
|
641
642
|
} catch (l) {
|
|
642
|
-
|
|
643
|
+
P.open({
|
|
643
644
|
title: "Refresh failed",
|
|
644
645
|
message: "Failed to refresh stock balance. Please try again.",
|
|
645
646
|
type: "error"
|
|
@@ -648,15 +649,15 @@ const Bt = ze(
|
|
|
648
649
|
D.value = !1;
|
|
649
650
|
}
|
|
650
651
|
}
|
|
651
|
-
const
|
|
652
|
+
const X = H(
|
|
652
653
|
() => C.value.groupBy(
|
|
653
654
|
(a) => a.id,
|
|
654
655
|
(a) => a.balance
|
|
655
656
|
)
|
|
656
|
-
),
|
|
657
|
-
function
|
|
657
|
+
), se = H(() => B.value.groupBy((a) => a.sku._id));
|
|
658
|
+
function ce(a) {
|
|
658
659
|
return w(
|
|
659
|
-
|
|
660
|
+
me.FmTooltip,
|
|
660
661
|
{ zIndex: 51, placement: "left", class: "w-full flex justify-end" },
|
|
661
662
|
{
|
|
662
663
|
default() {
|
|
@@ -668,10 +669,10 @@ const Bt = ze(
|
|
|
668
669
|
}
|
|
669
670
|
);
|
|
670
671
|
}
|
|
671
|
-
const
|
|
672
|
-
const a =
|
|
673
|
-
var
|
|
674
|
-
return Math.max(s, ((
|
|
672
|
+
const pe = H(() => {
|
|
673
|
+
const a = L.value.reduce((s, l) => {
|
|
674
|
+
var d, f;
|
|
675
|
+
return Math.max(s, ((f = (d = j.value) == null ? void 0 : d.get(l._id)) == null ? void 0 : f[0].length) ?? 0);
|
|
675
676
|
}, 0);
|
|
676
677
|
return [
|
|
677
678
|
{
|
|
@@ -680,13 +681,13 @@ const Bt = ze(
|
|
|
680
681
|
header: () => "Name",
|
|
681
682
|
size: 350,
|
|
682
683
|
cell(s) {
|
|
683
|
-
const l = s.row.original,
|
|
684
|
+
const l = s.row.original, d = l.adjustedDiffPercentage, f = typeof d == "number" && Math.abs(d) > 10, M = w("div", { class: "flex flex-col gap-4" }, [
|
|
684
685
|
w(
|
|
685
686
|
"div",
|
|
686
687
|
{
|
|
687
688
|
class: [
|
|
688
689
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
689
|
-
|
|
690
|
+
f ? " text-fm-color-system-error-300" : "text-fm-color-typo-primary"
|
|
690
691
|
]
|
|
691
692
|
},
|
|
692
693
|
l.name
|
|
@@ -696,24 +697,24 @@ const Bt = ze(
|
|
|
696
697
|
{
|
|
697
698
|
class: [
|
|
698
699
|
"line-clamp-1 fm-typo-en-body-md-400",
|
|
699
|
-
|
|
700
|
+
f ? " text-fm-color-system-error-300" : "text-fm-color-typo-secondary"
|
|
700
701
|
]
|
|
701
702
|
},
|
|
702
703
|
l.code
|
|
703
704
|
)
|
|
704
705
|
]);
|
|
705
706
|
return w(
|
|
706
|
-
|
|
707
|
+
me.FmTooltip,
|
|
707
708
|
{
|
|
708
709
|
zIndex: 51
|
|
709
710
|
},
|
|
710
711
|
{
|
|
711
712
|
content() {
|
|
712
|
-
return
|
|
713
|
+
return f ? "Adjustment difference is more than 10%." : `${l.code} - ${l.name}`;
|
|
713
714
|
},
|
|
714
715
|
default() {
|
|
715
716
|
return w("div", { class: "flex items-center gap-4 justify-start w-full" }, [
|
|
716
|
-
|
|
717
|
+
M
|
|
717
718
|
]);
|
|
718
719
|
}
|
|
719
720
|
}
|
|
@@ -728,7 +729,7 @@ const Bt = ze(
|
|
|
728
729
|
{
|
|
729
730
|
id: "physicalBalance",
|
|
730
731
|
accessorKey: "physicalBalance",
|
|
731
|
-
header: () =>
|
|
732
|
+
header: () => ce("Actual balance"),
|
|
732
733
|
size: 200,
|
|
733
734
|
meta: {
|
|
734
735
|
textAlign: "right"
|
|
@@ -737,7 +738,7 @@ const Bt = ze(
|
|
|
737
738
|
{
|
|
738
739
|
id: "systemBalance",
|
|
739
740
|
accessorKey: "systemBalance",
|
|
740
|
-
header: () =>
|
|
741
|
+
header: () => ce("Balance"),
|
|
741
742
|
size: 200,
|
|
742
743
|
meta: {
|
|
743
744
|
textAlign: "right"
|
|
@@ -746,7 +747,7 @@ const Bt = ze(
|
|
|
746
747
|
{
|
|
747
748
|
id: "adjustedAmount",
|
|
748
749
|
accessorKey: "adjustedAmount",
|
|
749
|
-
header: () =>
|
|
750
|
+
header: () => ce("Adjusted balance"),
|
|
750
751
|
size: 200,
|
|
751
752
|
meta: {
|
|
752
753
|
textAlign: "right"
|
|
@@ -756,13 +757,13 @@ const Bt = ze(
|
|
|
756
757
|
id: "adjustedDiffPercentage",
|
|
757
758
|
accessorKey: "adjustedDiffPercentage",
|
|
758
759
|
header: () => w(
|
|
759
|
-
|
|
760
|
+
me.FmTooltip,
|
|
760
761
|
{ zIndex: 51, placement: "left", class: "w-full flex justify-end" },
|
|
761
762
|
{
|
|
762
763
|
default() {
|
|
763
764
|
return w("div", { class: "flex items-center gap-4" }, [
|
|
764
765
|
"Diff (%)",
|
|
765
|
-
w(
|
|
766
|
+
w(me.FmIcon, { name: "info", color: "neutral-gray-400", size: "sm" })
|
|
766
767
|
]);
|
|
767
768
|
},
|
|
768
769
|
content() {
|
|
@@ -774,17 +775,17 @@ const Bt = ze(
|
|
|
774
775
|
cell(s) {
|
|
775
776
|
const l = s.row.original.adjustedDiffPercentage;
|
|
776
777
|
if (!l) return "N/A";
|
|
777
|
-
const
|
|
778
|
-
if (
|
|
778
|
+
const d = l.toFixed(2);
|
|
779
|
+
if (d === "0.00")
|
|
779
780
|
return w("div", { class: "flex items-center gap-4 justify-end" }, ["0.00"]);
|
|
780
|
-
const
|
|
781
|
+
const f = l > 0;
|
|
781
782
|
return w("div", { class: "flex items-center gap-4 justify-end" }, [
|
|
782
|
-
w(
|
|
783
|
-
name:
|
|
784
|
-
color:
|
|
783
|
+
w(me.FmIcon, {
|
|
784
|
+
name: f ? "arrow_drop_up" : "arrow_drop_down",
|
|
785
|
+
color: f ? "system-success-300" : "system-error-300",
|
|
785
786
|
size: "md"
|
|
786
787
|
}),
|
|
787
|
-
|
|
788
|
+
d
|
|
788
789
|
]);
|
|
789
790
|
},
|
|
790
791
|
meta: {
|
|
@@ -796,8 +797,8 @@ const Bt = ze(
|
|
|
796
797
|
header: () => "Amounts",
|
|
797
798
|
enableSorting: !1,
|
|
798
799
|
cell(s) {
|
|
799
|
-
const l = s.row.original,
|
|
800
|
-
|
|
800
|
+
const l = s.row.original, d = (M, U) => w(
|
|
801
|
+
me.FmTooltip,
|
|
801
802
|
{ zIndex: 50 },
|
|
802
803
|
{
|
|
803
804
|
default() {
|
|
@@ -807,7 +808,7 @@ const Bt = ze(
|
|
|
807
808
|
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"
|
|
808
809
|
},
|
|
809
810
|
[
|
|
810
|
-
w("span", { class: "text-fm-color-typo-primary" }, `${
|
|
811
|
+
w("span", { class: "text-fm-color-typo-primary" }, `${M} `),
|
|
811
812
|
w(
|
|
812
813
|
"span",
|
|
813
814
|
{
|
|
@@ -820,62 +821,62 @@ const Bt = ze(
|
|
|
820
821
|
);
|
|
821
822
|
},
|
|
822
823
|
content() {
|
|
823
|
-
return `${
|
|
824
|
+
return `${M} ${U}`;
|
|
824
825
|
}
|
|
825
826
|
}
|
|
826
827
|
);
|
|
827
|
-
let
|
|
828
|
+
let f = Array.from({ length: a }).map((M, U) => {
|
|
828
829
|
if (!l[`measurementAmount${U}`])
|
|
829
830
|
return null;
|
|
830
|
-
const F = l[`measurementAmount${U}`],
|
|
831
|
-
return
|
|
832
|
-
}).filter((
|
|
833
|
-
return (l.baseUnitAmount || !
|
|
831
|
+
const F = l[`measurementAmount${U}`], ue = l[`measurementAbbrev${U}`];
|
|
832
|
+
return d(F, ue);
|
|
833
|
+
}).filter((M) => M);
|
|
834
|
+
return (l.baseUnitAmount || !f.length) && (f = [d(l.baseUnitAmount, l.baseUnit), ...f]), w(
|
|
834
835
|
"div",
|
|
835
836
|
{
|
|
836
837
|
class: "flex gap-8 flex-nowrap",
|
|
837
838
|
style: {
|
|
838
|
-
minWidth: `${120 *
|
|
839
|
+
minWidth: `${120 * f.length}px`
|
|
839
840
|
}
|
|
840
841
|
},
|
|
841
|
-
|
|
842
|
+
f
|
|
842
843
|
);
|
|
843
844
|
}
|
|
844
845
|
}
|
|
845
846
|
];
|
|
846
|
-
}),
|
|
847
|
-
var F,
|
|
848
|
-
const t = (F =
|
|
847
|
+
}), he = H(() => pe.value.map((a) => a.size ?? 0).reduce((a, t) => a + t)), ee = O(""), ve = H(() => L.value.map((a) => {
|
|
848
|
+
var F, ue;
|
|
849
|
+
const t = (F = se.value.get(a._id)) == null ? void 0 : F[0], s = ((ue = X.value.get(a._id)) == null ? void 0 : ue[0]) ?? I;
|
|
849
850
|
if (!t)
|
|
850
851
|
return {
|
|
851
852
|
code: a.code,
|
|
852
853
|
name: a.name,
|
|
853
854
|
baseUnit: a.unit.abbrev,
|
|
854
855
|
baseUnitAmount: 0,
|
|
855
|
-
systemBalance: +
|
|
856
|
+
systemBalance: +R(s),
|
|
856
857
|
physicalBalance: 0,
|
|
857
|
-
adjustedAmount: -+
|
|
858
|
+
adjustedAmount: -+R(s),
|
|
858
859
|
adjustedDiffPercentage: -100
|
|
859
860
|
};
|
|
860
|
-
const l =
|
|
861
|
+
const l = Ye(t), d = Ue(l, s), f = s.amount === 0 ? null : Ee(d, {
|
|
861
862
|
...s,
|
|
862
863
|
amount: Math.abs(s.amount)
|
|
863
|
-
}),
|
|
864
|
+
}), M = f ? Be(f, S) : null;
|
|
864
865
|
return {
|
|
865
866
|
code: a.code,
|
|
866
867
|
name: a.name,
|
|
867
868
|
baseUnit: a.unit.abbrev,
|
|
868
|
-
baseUnitAmount: +
|
|
869
|
+
baseUnitAmount: +R(t.baseAmount),
|
|
869
870
|
...t.measurementsAmounts.filter((ae) => {
|
|
870
|
-
var
|
|
871
|
-
return (
|
|
872
|
-
}).reduce((ae,
|
|
873
|
-
systemBalance: +
|
|
874
|
-
physicalBalance: +
|
|
875
|
-
adjustedAmount: +
|
|
876
|
-
adjustedDiffPercentage:
|
|
871
|
+
var q, re, Ae;
|
|
872
|
+
return (Ae = (re = (q = j.value) == null ? void 0 : q.get(a._id)) == null ? void 0 : re[0]) == null ? void 0 : Ae.includes(ae.measurement.id);
|
|
873
|
+
}).reduce((ae, q, re) => (ae[`measurementAbbrev${re}`] = `(${q.measurement.abbrev}) × ${R(q.measurement.conversion)}`, ae[`measurementAmount${re}`] = +R(q.amount), ae), {}),
|
|
874
|
+
systemBalance: +R(s),
|
|
875
|
+
physicalBalance: +R(l),
|
|
876
|
+
adjustedAmount: +R(d),
|
|
877
|
+
adjustedDiffPercentage: M ? +R(He(M, 2)) : null
|
|
877
878
|
};
|
|
878
|
-
})),
|
|
879
|
+
})), xe = H(() => {
|
|
879
880
|
var t, s, l;
|
|
880
881
|
if (!e.draft) return [];
|
|
881
882
|
const a = e.draft.approvedAt ? {
|
|
@@ -883,11 +884,11 @@ const Bt = ze(
|
|
|
883
884
|
// actionAt: props.draft.approvedAt,
|
|
884
885
|
actionBy: e.draft.approvedBy,
|
|
885
886
|
remark: e.draft.approveRemark
|
|
886
|
-
} : (t = e.draft.rejectionHistory) == null ? void 0 : t.computeFirst((
|
|
887
|
-
action: `Reject at ${ne(
|
|
887
|
+
} : (t = e.draft.rejectionHistory) == null ? void 0 : t.computeFirst((d) => ({
|
|
888
|
+
action: `Reject at ${ne(d.rejectedAt)}`,
|
|
888
889
|
// actionAt: e.rejectedAt,
|
|
889
|
-
actionBy:
|
|
890
|
-
remark:
|
|
890
|
+
actionBy: d.rejectedBy,
|
|
891
|
+
remark: d.rejectRemark
|
|
891
892
|
}));
|
|
892
893
|
return [
|
|
893
894
|
{
|
|
@@ -912,7 +913,7 @@ const Bt = ze(
|
|
|
912
913
|
},
|
|
913
914
|
{
|
|
914
915
|
label: "Using template",
|
|
915
|
-
value: ((s = e.draft.usingTemplates.find((
|
|
916
|
+
value: ((s = e.draft.usingTemplates.find((d) => d)) == null ? void 0 : s.name) ?? "None"
|
|
916
917
|
},
|
|
917
918
|
e.draft.remark ? {
|
|
918
919
|
label: "Remark",
|
|
@@ -930,8 +931,8 @@ const Bt = ze(
|
|
|
930
931
|
label: "Action remark",
|
|
931
932
|
value: a.remark
|
|
932
933
|
} : null
|
|
933
|
-
].filter((
|
|
934
|
-
}),
|
|
934
|
+
].filter((d) => d).map((d) => d);
|
|
935
|
+
}), ie = [
|
|
935
936
|
{
|
|
936
937
|
label: "Overview",
|
|
937
938
|
value: "overview"
|
|
@@ -940,21 +941,21 @@ const Bt = ze(
|
|
|
940
941
|
label: "Action history",
|
|
941
942
|
value: "history"
|
|
942
943
|
}
|
|
943
|
-
], te = O(
|
|
944
|
-
var t, s, l,
|
|
944
|
+
], te = O(ie[0]), Y = H(() => {
|
|
945
|
+
var t, s, l, d;
|
|
945
946
|
return [
|
|
946
947
|
...(((t = e.draft) == null ? void 0 : t.rejectionHistory) ?? []).map(
|
|
947
|
-
(
|
|
948
|
+
(f) => ({
|
|
948
949
|
header: "Reject",
|
|
949
|
-
date: ne(
|
|
950
|
+
date: ne(f.rejectedAt),
|
|
950
951
|
info: [
|
|
951
952
|
{
|
|
952
953
|
label: "Rejected by",
|
|
953
|
-
values: [
|
|
954
|
+
values: [f.rejectedBy.name]
|
|
954
955
|
},
|
|
955
956
|
{
|
|
956
957
|
label: "Rejection remark",
|
|
957
|
-
values: [
|
|
958
|
+
values: [f.rejectRemark]
|
|
958
959
|
}
|
|
959
960
|
]
|
|
960
961
|
})
|
|
@@ -970,128 +971,128 @@ const Bt = ze(
|
|
|
970
971
|
},
|
|
971
972
|
{
|
|
972
973
|
label: "Approval remark",
|
|
973
|
-
values: [((
|
|
974
|
+
values: [((d = e.draft) == null ? void 0 : d.approveRemark) ?? ""]
|
|
974
975
|
}
|
|
975
976
|
]
|
|
976
977
|
}
|
|
977
978
|
] : []
|
|
978
979
|
];
|
|
979
|
-
}),
|
|
980
|
-
var
|
|
981
|
-
if ((
|
|
982
|
-
if (((
|
|
983
|
-
const a =
|
|
980
|
+
}), ye = H(() => {
|
|
981
|
+
var d, f, M, U;
|
|
982
|
+
if ((d = e == null ? void 0 : e.draft) != null && d.approvedAt) return "Draft is already approved.";
|
|
983
|
+
if (((f = e.draft) == null ? void 0 : f.status) !== oe.enum.DRAFT) return "Status is not draft.";
|
|
984
|
+
const a = ve.value.some((F) => F.physicalBalance < 0), t = ((U = (M = m.stockBalance.skus) == null ? void 0 : M.filter((F) => F.balance.amount < 0)) == null ? void 0 : U.map((F) => F.id)) ?? [], s = new Set(L.value.map((F) => F._id)), l = t.filter((F) => !s.has(F)).length;
|
|
984
985
|
return [
|
|
985
986
|
a ? "Negative total exist." : null,
|
|
986
987
|
l ? "Negative stock is not included in this draft. Reopen draft in POS and apply changes." : null
|
|
987
988
|
].filter((F) => F).join(" ");
|
|
988
989
|
});
|
|
989
990
|
return (a, t) => {
|
|
990
|
-
const s = E("FmButtonGroup"), l = E("FmMenuDivider"),
|
|
991
|
-
return
|
|
991
|
+
const s = E("FmButtonGroup"), l = E("FmMenuDivider"), d = E("FmCard"), f = E("FmButton"), M = E("FmCircularProgress"), U = E("FmTextField"), F = E("FmIcon"), ue = E("FmChip"), ae = E("FmTable"), q = E("FmSpacer"), re = E("FmTooltip"), Ae = E("FmSideSheet");
|
|
992
|
+
return b(), Z(Ae, {
|
|
992
993
|
"dismiss-away": "",
|
|
993
994
|
"max-width": 9999,
|
|
994
995
|
"model-value": y(g),
|
|
995
|
-
"onUpdate:modelValue": t[8] || (t[8] = (A) =>
|
|
996
|
+
"onUpdate:modelValue": t[8] || (t[8] = (A) => Me(g) ? g.value = A : null),
|
|
996
997
|
header: "Closing details"
|
|
997
998
|
}, {
|
|
998
|
-
"side-sheet-footer":
|
|
999
|
-
var A,
|
|
999
|
+
"side-sheet-footer": K(() => {
|
|
1000
|
+
var A, z, V, de;
|
|
1000
1001
|
return [
|
|
1001
|
-
o("div",
|
|
1002
|
-
((A = e.draft) == null ? void 0 : A.status) === y(oe).enum.DRAFT ? (
|
|
1003
|
-
|
|
1002
|
+
o("div", ia, [
|
|
1003
|
+
((A = e.draft) == null ? void 0 : A.status) === y(oe).enum.DRAFT ? (b(), $(W, { key: 0 }, [
|
|
1004
|
+
ye.value ? (b(), Z(re, {
|
|
1004
1005
|
key: 0,
|
|
1005
1006
|
"z-index": 51
|
|
1006
1007
|
}, {
|
|
1007
|
-
content:
|
|
1008
|
-
|
|
1008
|
+
content: K(() => [
|
|
1009
|
+
je(N(ye.value), 1)
|
|
1009
1010
|
]),
|
|
1010
|
-
default:
|
|
1011
|
-
_(
|
|
1011
|
+
default: K(() => [
|
|
1012
|
+
_(f, {
|
|
1012
1013
|
disabled: "",
|
|
1013
1014
|
key: "approve key",
|
|
1014
1015
|
label: "Approve",
|
|
1015
|
-
onClick: t[3] || (t[3] = () => e.draft && y(
|
|
1016
|
+
onClick: t[3] || (t[3] = () => e.draft && y(c).approveDraft(e.draft, () => v("submitted")))
|
|
1016
1017
|
})
|
|
1017
1018
|
]),
|
|
1018
1019
|
_: 1
|
|
1019
|
-
})) : (
|
|
1020
|
+
})) : (b(), Z(f, {
|
|
1020
1021
|
key: "approve key",
|
|
1021
1022
|
label: "Approve",
|
|
1022
|
-
onClick: t[4] || (t[4] = () => e.draft && y(
|
|
1023
|
+
onClick: t[4] || (t[4] = () => e.draft && y(c).approveDraft(e.draft, () => v("submitted")))
|
|
1023
1024
|
}))
|
|
1024
|
-
], 64)) :
|
|
1025
|
-
((
|
|
1025
|
+
], 64)) : Q("", !0),
|
|
1026
|
+
((z = e.draft) == null ? void 0 : z.status) === y(oe).enum.DRAFT ? (b(), Z(f, {
|
|
1026
1027
|
key: 1,
|
|
1027
1028
|
label: "Reject",
|
|
1028
1029
|
variant: "destructive",
|
|
1029
|
-
onClick: t[5] || (t[5] = () => e.draft && y(
|
|
1030
|
-
})) :
|
|
1031
|
-
(V = e.draft) != null && V.approvedAt && ((
|
|
1030
|
+
onClick: t[5] || (t[5] = () => e.draft && y(c).rejectDraft(e.draft, () => v("submitted")))
|
|
1031
|
+
})) : Q("", !0),
|
|
1032
|
+
(V = e.draft) != null && V.approvedAt && ((de = e.draft) == null ? void 0 : de.status) !== y(oe).enum.COMPLETED ? (b(), Z(f, {
|
|
1032
1033
|
key: 2,
|
|
1033
1034
|
label: "Sync",
|
|
1034
|
-
loading:
|
|
1035
|
+
loading: i.value,
|
|
1035
1036
|
onClick: t[6] || (t[6] = () => {
|
|
1036
|
-
e.draft && (
|
|
1037
|
-
|
|
1037
|
+
e.draft && (i.value = !0, y(c).syncDraft(e.draft, () => {
|
|
1038
|
+
i.value = !1, v("submitted");
|
|
1038
1039
|
}));
|
|
1039
1040
|
})
|
|
1040
|
-
}, null, 8, ["loading"])) :
|
|
1041
|
-
_(
|
|
1041
|
+
}, null, 8, ["loading"])) : Q("", !0),
|
|
1042
|
+
_(f, {
|
|
1042
1043
|
label: "Close",
|
|
1043
1044
|
variant: "tertiary",
|
|
1044
|
-
onClick: t[7] || (t[7] = (
|
|
1045
|
+
onClick: t[7] || (t[7] = (Te) => g.value = !1)
|
|
1045
1046
|
})
|
|
1046
1047
|
])
|
|
1047
1048
|
];
|
|
1048
1049
|
}),
|
|
1049
|
-
default:
|
|
1050
|
-
o("div",
|
|
1050
|
+
default: K(() => [
|
|
1051
|
+
o("div", $t, [
|
|
1051
1052
|
o("div", null, [
|
|
1052
1053
|
_(s, {
|
|
1053
|
-
items:
|
|
1054
|
+
items: ie,
|
|
1054
1055
|
modelValue: te.value,
|
|
1055
1056
|
"onUpdate:modelValue": t[0] || (t[0] = (A) => te.value = A)
|
|
1056
1057
|
}, null, 8, ["modelValue"])
|
|
1057
1058
|
]),
|
|
1058
|
-
te.value.value === "overview" ? (
|
|
1059
|
-
_(
|
|
1059
|
+
te.value.value === "overview" ? (b(), $(W, { key: 0 }, [
|
|
1060
|
+
_(d, {
|
|
1060
1061
|
variant: "outlined",
|
|
1061
1062
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
1062
1063
|
}, {
|
|
1063
|
-
default:
|
|
1064
|
-
var A,
|
|
1064
|
+
default: K(() => {
|
|
1065
|
+
var A, z;
|
|
1065
1066
|
return [
|
|
1066
|
-
o("div",
|
|
1067
|
+
o("div", Tt, [
|
|
1067
1068
|
t[9] || (t[9] = o("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
|
|
1068
|
-
o("div",
|
|
1069
|
+
o("div", Rt, [
|
|
1069
1070
|
o("div", {
|
|
1070
|
-
class:
|
|
1071
|
-
}, N(y(
|
|
1071
|
+
class: fe(["fm-status-badge", y(ke)(((A = a.draft) == null ? void 0 : A.status) ?? "DRAFT")])
|
|
1072
|
+
}, N(y(Le)(((z = a.draft) == null ? void 0 : z.status) ?? "")), 3)
|
|
1072
1073
|
])
|
|
1073
1074
|
]),
|
|
1074
1075
|
_(l),
|
|
1075
|
-
o("div",
|
|
1076
|
-
(
|
|
1076
|
+
o("div", Pt, [
|
|
1077
|
+
(b(!0), $(W, null, ge(xe.value, (V, de) => (b(), $("div", {
|
|
1077
1078
|
class: "flex flex-col gap-4",
|
|
1078
|
-
key:
|
|
1079
|
+
key: de
|
|
1079
1080
|
}, [
|
|
1080
|
-
o("div",
|
|
1081
|
-
o("div",
|
|
1081
|
+
o("div", Mt, [
|
|
1082
|
+
o("div", It, N(V.label), 1)
|
|
1082
1083
|
]),
|
|
1083
|
-
o("div",
|
|
1084
|
+
o("div", Ut, N(V.value), 1)
|
|
1084
1085
|
]))), 128))
|
|
1085
1086
|
])
|
|
1086
1087
|
];
|
|
1087
1088
|
}),
|
|
1088
1089
|
_: 1
|
|
1089
1090
|
}),
|
|
1090
|
-
o("div",
|
|
1091
|
-
o("div",
|
|
1091
|
+
o("div", Et, [
|
|
1092
|
+
o("div", Ht, [
|
|
1092
1093
|
t[10] || (t[10] = o("div", { class: "flex-1 fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Closing items ", -1)),
|
|
1093
|
-
x.value ?
|
|
1094
|
-
a.draft && a.draft.status !== y(oe).enum.COMPLETED ? (
|
|
1094
|
+
x.value ? Q("", !0) : (b(), $("div", Lt, [
|
|
1095
|
+
a.draft && a.draft.status !== y(oe).enum.COMPLETED ? (b(), Z(f, {
|
|
1095
1096
|
key: 0,
|
|
1096
1097
|
label: "Refresh balance",
|
|
1097
1098
|
"prepend-icon": "refresh",
|
|
@@ -1100,101 +1101,101 @@ const Bt = ze(
|
|
|
1100
1101
|
"bg-color": "transparent",
|
|
1101
1102
|
"border-color": "primary",
|
|
1102
1103
|
loading: D.value,
|
|
1103
|
-
onClick:
|
|
1104
|
-
}, null, 8, ["loading"])) :
|
|
1105
|
-
_(
|
|
1104
|
+
onClick: le
|
|
1105
|
+
}, null, 8, ["loading"])) : Q("", !0),
|
|
1106
|
+
_(f, {
|
|
1106
1107
|
label: "Export data",
|
|
1107
1108
|
"prepend-icon": "download",
|
|
1108
1109
|
variant: "secondary",
|
|
1109
1110
|
"text-color": "primary",
|
|
1110
1111
|
"bg-color": "transparent",
|
|
1111
1112
|
"border-color": "primary",
|
|
1112
|
-
onClick: t[1] || (t[1] = (A) => a.draft ? y(
|
|
1113
|
+
onClick: t[1] || (t[1] = (A) => a.draft ? y(c).exportDraft(a.draft, C.value) : null)
|
|
1113
1114
|
})
|
|
1114
1115
|
]))
|
|
1115
1116
|
]),
|
|
1116
|
-
x.value ? (
|
|
1117
|
+
x.value ? (b(), $("div", zt, [
|
|
1117
1118
|
t[12] || (t[12] = o("div", { class: "h-80" }, null, -1)),
|
|
1118
|
-
o("div",
|
|
1119
|
+
o("div", Nt, [
|
|
1119
1120
|
o("div", null, [
|
|
1120
|
-
_(
|
|
1121
|
+
_(M, { size: "md" })
|
|
1121
1122
|
]),
|
|
1122
1123
|
t[11] || (t[11] = o("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fetching info... ", -1))
|
|
1123
1124
|
]),
|
|
1124
1125
|
t[13] || (t[13] = o("div", { class: "h-80" }, null, -1))
|
|
1125
|
-
])) : (
|
|
1126
|
+
])) : (b(), $(W, { key: 1 }, [
|
|
1126
1127
|
o("div", null, [
|
|
1127
1128
|
_(U, {
|
|
1128
|
-
modelValue:
|
|
1129
|
-
"onUpdate:modelValue": t[2] || (t[2] = (A) =>
|
|
1129
|
+
modelValue: ee.value,
|
|
1130
|
+
"onUpdate:modelValue": t[2] || (t[2] = (A) => ee.value = A),
|
|
1130
1131
|
placeholder: "Filter items"
|
|
1131
1132
|
}, null, 8, ["modelValue"])
|
|
1132
1133
|
]),
|
|
1133
|
-
y(
|
|
1134
|
-
(
|
|
1134
|
+
y(u).skuTags.size ? (b(), $("div", Ot, [
|
|
1135
|
+
(b(!0), $(W, null, ge(y(u).skuTags.keys(), (A) => (b(), Z(ue, {
|
|
1135
1136
|
key: `${A}`,
|
|
1136
1137
|
label: `${A}`,
|
|
1137
1138
|
selectable: "",
|
|
1138
|
-
selected:
|
|
1139
|
-
onClick: (
|
|
1139
|
+
selected: k[`${A}`],
|
|
1140
|
+
onClick: (z) => k[`${A}`] = !k[`${A}`]
|
|
1140
1141
|
}, {
|
|
1141
|
-
default:
|
|
1142
|
-
|
|
1142
|
+
default: K(() => [
|
|
1143
|
+
k[`${A}`] ? (b(), Z(F, {
|
|
1143
1144
|
key: 0,
|
|
1144
1145
|
name: "check",
|
|
1145
1146
|
class: "text-white",
|
|
1146
1147
|
size: "sm"
|
|
1147
|
-
})) :
|
|
1148
|
+
})) : Q("", !0),
|
|
1148
1149
|
o("span", {
|
|
1149
|
-
class:
|
|
1150
|
+
class: fe([
|
|
1150
1151
|
"",
|
|
1151
1152
|
{
|
|
1152
|
-
"text-white fm-typo-en-body-md-600":
|
|
1153
|
-
"text-fm-color-typo-primary fm-typo-en-body-md-400": !
|
|
1153
|
+
"text-white fm-typo-en-body-md-600": k[`${A}`],
|
|
1154
|
+
"text-fm-color-typo-primary fm-typo-en-body-md-400": !k[`${A}`]
|
|
1154
1155
|
}
|
|
1155
1156
|
])
|
|
1156
1157
|
}, N(A), 3)
|
|
1157
1158
|
]),
|
|
1158
1159
|
_: 2
|
|
1159
1160
|
}, 1032, ["label", "selected", "onClick"]))), 128))
|
|
1160
|
-
])) :
|
|
1161
|
-
o("div",
|
|
1161
|
+
])) : Q("", !0),
|
|
1162
|
+
o("div", Vt, [
|
|
1162
1163
|
o("div", {
|
|
1163
|
-
style:
|
|
1164
|
+
style: Ie({ minWidth: `${he.value}px` })
|
|
1164
1165
|
}, [
|
|
1165
1166
|
_(ae, {
|
|
1166
|
-
"column-defs":
|
|
1167
|
-
"row-data":
|
|
1168
|
-
"search-value":
|
|
1167
|
+
"column-defs": pe.value,
|
|
1168
|
+
"row-data": ve.value,
|
|
1169
|
+
"search-value": ee.value
|
|
1169
1170
|
}, null, 8, ["column-defs", "row-data", "search-value"])
|
|
1170
1171
|
], 4)
|
|
1171
1172
|
])
|
|
1172
1173
|
], 64))
|
|
1173
1174
|
])
|
|
1174
|
-
], 64)) :
|
|
1175
|
-
te.value.value === "history" ? (
|
|
1176
|
-
|
|
1177
|
-
(
|
|
1175
|
+
], 64)) : Q("", !0),
|
|
1176
|
+
te.value.value === "history" ? (b(), $("div", Yt, [
|
|
1177
|
+
Y.value.length ? (b(), $("div", qt, [
|
|
1178
|
+
(b(!0), $(W, null, ge(Y.value, (A, z) => (b(), $(W, { key: z }, [
|
|
1178
1179
|
o("div", Wt, [
|
|
1179
|
-
o("div",
|
|
1180
|
-
o("div",
|
|
1180
|
+
o("div", Zt, [
|
|
1181
|
+
o("div", Jt, [
|
|
1181
1182
|
o("div", {
|
|
1182
|
-
class:
|
|
1183
|
+
class: fe([
|
|
1183
1184
|
{
|
|
1184
|
-
"bg-fm-color-primary":
|
|
1185
|
-
"bg-white":
|
|
1185
|
+
"bg-fm-color-primary": z !== 0,
|
|
1186
|
+
"bg-white": z === 0
|
|
1186
1187
|
},
|
|
1187
1188
|
"w-[2px] h-full"
|
|
1188
1189
|
])
|
|
1189
1190
|
}, null, 2)
|
|
1190
1191
|
]),
|
|
1191
1192
|
t[16] || (t[16] = o("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
|
|
1192
|
-
o("div",
|
|
1193
|
+
o("div", Xt, [
|
|
1193
1194
|
o("div", {
|
|
1194
|
-
class:
|
|
1195
|
+
class: fe([
|
|
1195
1196
|
{
|
|
1196
|
-
"bg-fm-color-primary":
|
|
1197
|
-
"bg-white":
|
|
1197
|
+
"bg-fm-color-primary": z < Y.value.length - 1,
|
|
1198
|
+
"bg-white": z >= Y.value.length - 1
|
|
1198
1199
|
},
|
|
1199
1200
|
"w-[2px] h-full"
|
|
1200
1201
|
])
|
|
@@ -1202,41 +1203,41 @@ const Bt = ze(
|
|
|
1202
1203
|
])
|
|
1203
1204
|
]),
|
|
1204
1205
|
o("div", Qt, [
|
|
1205
|
-
o("div",
|
|
1206
|
-
o("div",
|
|
1206
|
+
o("div", ea, N(A.header), 1),
|
|
1207
|
+
o("div", ta, N(A.date), 1)
|
|
1207
1208
|
])
|
|
1208
1209
|
]),
|
|
1209
|
-
o("div",
|
|
1210
|
-
o("div",
|
|
1211
|
-
o("div",
|
|
1210
|
+
o("div", aa, [
|
|
1211
|
+
o("div", na, [
|
|
1212
|
+
o("div", oa, [
|
|
1212
1213
|
o("div", {
|
|
1213
|
-
class:
|
|
1214
|
+
class: fe([
|
|
1214
1215
|
{
|
|
1215
|
-
"bg-fm-color-primary":
|
|
1216
|
-
"bg-white":
|
|
1216
|
+
"bg-fm-color-primary": z < Y.value.length - 1,
|
|
1217
|
+
"bg-white": z >= Y.value.length - 1
|
|
1217
1218
|
},
|
|
1218
1219
|
"w-[2px] h-full"
|
|
1219
1220
|
])
|
|
1220
1221
|
}, null, 2)
|
|
1221
1222
|
])
|
|
1222
1223
|
]),
|
|
1223
|
-
o("div",
|
|
1224
|
-
_(
|
|
1224
|
+
o("div", sa, [
|
|
1225
|
+
_(d, {
|
|
1225
1226
|
variant: "outlined",
|
|
1226
1227
|
class: "py-12 px-16"
|
|
1227
1228
|
}, {
|
|
1228
|
-
default:
|
|
1229
|
-
o("div",
|
|
1230
|
-
(
|
|
1231
|
-
key:
|
|
1229
|
+
default: K(() => [
|
|
1230
|
+
o("div", ra, [
|
|
1231
|
+
(b(!0), $(W, null, ge(A.info, (V, de) => (b(), $("div", {
|
|
1232
|
+
key: de,
|
|
1232
1233
|
class: "flex flex-col gap-4"
|
|
1233
1234
|
}, [
|
|
1234
|
-
o("div",
|
|
1235
|
-
o("div",
|
|
1236
|
-
(
|
|
1237
|
-
key:
|
|
1235
|
+
o("div", la, N(V == null ? void 0 : V.label), 1),
|
|
1236
|
+
o("div", ca, [
|
|
1237
|
+
(b(!0), $(W, null, ge(V == null ? void 0 : V.values, (Te, Ge) => (b(), $("div", {
|
|
1238
|
+
key: Ge,
|
|
1238
1239
|
class: "fm-typo-en-body-lg-600"
|
|
1239
|
-
}, N(
|
|
1240
|
+
}, N(Te), 1))), 128))
|
|
1240
1241
|
])
|
|
1241
1242
|
]))), 128))
|
|
1242
1243
|
])
|
|
@@ -1246,42 +1247,42 @@ const Bt = ze(
|
|
|
1246
1247
|
])
|
|
1247
1248
|
])
|
|
1248
1249
|
], 64))), 128))
|
|
1249
|
-
])) : (
|
|
1250
|
-
_(
|
|
1250
|
+
])) : (b(), $("div", Kt, [
|
|
1251
|
+
_(q),
|
|
1251
1252
|
o("div", null, [
|
|
1252
1253
|
o("img", {
|
|
1253
|
-
src: y(
|
|
1254
|
+
src: y(bt),
|
|
1254
1255
|
alt: "List is empty"
|
|
1255
|
-
}, null, 8,
|
|
1256
|
+
}, null, 8, Gt)
|
|
1256
1257
|
]),
|
|
1257
1258
|
t[14] || (t[14] = o("div", { class: "fm-typo-en-body-lg-600" }, N("No records found"), -1)),
|
|
1258
1259
|
t[15] || (t[15] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, N("You can track approval and rejection history here"), -1)),
|
|
1259
|
-
_(
|
|
1260
|
-
_(
|
|
1260
|
+
_(q),
|
|
1261
|
+
_(q)
|
|
1261
1262
|
]))
|
|
1262
|
-
])) :
|
|
1263
|
+
])) : Q("", !0)
|
|
1263
1264
|
])
|
|
1264
1265
|
]),
|
|
1265
1266
|
_: 1
|
|
1266
1267
|
}, 8, ["model-value"]);
|
|
1267
1268
|
};
|
|
1268
1269
|
}
|
|
1269
|
-
}),
|
|
1270
|
+
}), da = { class: "flex-1 flex flex-col gap-8" }, ma = { class: "flex flex-col" }, fa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pa = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, va = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, ya = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, ka = /* @__PURE__ */ Se({
|
|
1270
1271
|
__name: "ClosingDraftView",
|
|
1271
1272
|
setup(n) {
|
|
1272
|
-
const { t: r } =
|
|
1273
|
+
const { t: r } = ze(), { viewDraft: e } = we(), { viewClosingDraftProps: m, viewClosingDraftShow: c } = gt(we()), g = Ce(), x = Ft(), D = it(), { breakpoints: i } = yt();
|
|
1273
1274
|
g.watchLocation(x.fetchDrafts);
|
|
1274
|
-
const C = H(() => x.loading), T = O(""),
|
|
1275
|
-
function
|
|
1275
|
+
const C = H(() => x.loading), T = O(""), P = H(() => i.value.xs || i.value.sm), u = H(() => P.value ? 10 : 20);
|
|
1276
|
+
function p(v) {
|
|
1276
1277
|
switch (v) {
|
|
1277
1278
|
case "refresh":
|
|
1278
1279
|
return x.fetchDrafts();
|
|
1279
1280
|
}
|
|
1280
1281
|
}
|
|
1281
|
-
function
|
|
1282
|
+
function k(v) {
|
|
1282
1283
|
return v;
|
|
1283
1284
|
}
|
|
1284
|
-
const
|
|
1285
|
+
const h = H(() => P.value ? [
|
|
1285
1286
|
{
|
|
1286
1287
|
label: r("inventory.common.refresh"),
|
|
1287
1288
|
value: "refresh",
|
|
@@ -1294,76 +1295,76 @@ const Bt = ze(
|
|
|
1294
1295
|
isPrimary: !1
|
|
1295
1296
|
}
|
|
1296
1297
|
]);
|
|
1297
|
-
return (v,
|
|
1298
|
-
const
|
|
1299
|
-
return
|
|
1300
|
-
_(
|
|
1298
|
+
return (v, B) => {
|
|
1299
|
+
const L = E("FmTable");
|
|
1300
|
+
return b(), $(W, null, [
|
|
1301
|
+
_(ut, {
|
|
1301
1302
|
title: y(r)("inventory.closing.draft.title"),
|
|
1302
|
-
actions:
|
|
1303
|
-
"onClick:action":
|
|
1303
|
+
actions: h.value,
|
|
1304
|
+
"onClick:action": p
|
|
1304
1305
|
}, {
|
|
1305
|
-
default:
|
|
1306
|
+
default: K(() => [
|
|
1306
1307
|
o("div", {
|
|
1307
|
-
class:
|
|
1308
|
+
class: fe([
|
|
1308
1309
|
"flex flex-col gap-8 max-h-full",
|
|
1309
1310
|
{
|
|
1310
|
-
"p-0":
|
|
1311
|
-
"px-24 ": !
|
|
1311
|
+
"p-0": P.value,
|
|
1312
|
+
"px-24 ": !P.value
|
|
1312
1313
|
}
|
|
1313
1314
|
])
|
|
1314
1315
|
}, [
|
|
1315
|
-
_(
|
|
1316
|
+
_(dt, {
|
|
1316
1317
|
"change-location": "",
|
|
1317
1318
|
searchable: "",
|
|
1318
1319
|
search: T.value,
|
|
1319
|
-
"onUpdate:search":
|
|
1320
|
+
"onUpdate:search": B[0] || (B[0] = (j) => T.value = j)
|
|
1320
1321
|
}, null, 8, ["search"]),
|
|
1321
|
-
_(
|
|
1322
|
-
style:
|
|
1322
|
+
_(L, {
|
|
1323
|
+
style: Ie(y(D).tableHeight),
|
|
1323
1324
|
"column-defs": y(x).columnDefs,
|
|
1324
1325
|
"row-data": y(x).drafts,
|
|
1325
1326
|
"search-value": T.value,
|
|
1326
1327
|
loading: C.value,
|
|
1327
|
-
onRowClick:
|
|
1328
|
-
"page-size":
|
|
1328
|
+
onRowClick: B[1] || (B[1] = (j) => y(e)(j.original)),
|
|
1329
|
+
"page-size": u.value
|
|
1329
1330
|
}, {
|
|
1330
|
-
"list-row":
|
|
1331
|
-
_(
|
|
1332
|
-
row:
|
|
1331
|
+
"list-row": K((j) => [
|
|
1332
|
+
_(mt, {
|
|
1333
|
+
row: j,
|
|
1333
1334
|
onRowClick: (I) => y(e)(I)
|
|
1334
1335
|
}, {
|
|
1335
|
-
default:
|
|
1336
|
-
var
|
|
1336
|
+
default: K((I) => {
|
|
1337
|
+
var S, G, le, X, se, ce, pe, he, ee, ve, xe, ie, te, Y, ye, a, t, s, l, d;
|
|
1337
1338
|
return [
|
|
1338
|
-
o("div",
|
|
1339
|
-
o("div",
|
|
1340
|
-
o("div",
|
|
1341
|
-
_(y(
|
|
1342
|
-
render: (
|
|
1343
|
-
props: (
|
|
1339
|
+
o("div", da, [
|
|
1340
|
+
o("div", ma, [
|
|
1341
|
+
o("div", fa, [
|
|
1342
|
+
_(y(De), {
|
|
1343
|
+
render: (le = (G = (S = I._id) == null ? void 0 : S.column) == null ? void 0 : G.columnDef) == null ? void 0 : le.cell,
|
|
1344
|
+
props: (se = (X = I._id) == null ? void 0 : X.getContext) == null ? void 0 : se.call(X)
|
|
1344
1345
|
}, null, 8, ["render", "props"])
|
|
1345
1346
|
]),
|
|
1346
|
-
o("div",
|
|
1347
|
-
_(y(
|
|
1348
|
-
render: (
|
|
1349
|
-
props: (
|
|
1347
|
+
o("div", pa, [
|
|
1348
|
+
_(y(De), {
|
|
1349
|
+
render: (he = (pe = (ce = I.name) == null ? void 0 : ce.column) == null ? void 0 : pe.columnDef) == null ? void 0 : he.cell,
|
|
1350
|
+
props: (ve = (ee = I.name) == null ? void 0 : ee.getContext) == null ? void 0 : ve.call(ee)
|
|
1350
1351
|
}, null, 8, ["render", "props"])
|
|
1351
1352
|
]),
|
|
1352
|
-
o("div",
|
|
1353
|
-
...
|
|
1354
|
-
...
|
|
1353
|
+
o("div", va, N([
|
|
1354
|
+
...j.original.items.slice(0, 3).map((f) => f.sku.name),
|
|
1355
|
+
...j.original.items.length >= 3 ? [`and ${j.original.items.length - 3} more items`] : []
|
|
1355
1356
|
].join(", ")), 1),
|
|
1356
|
-
o("div",
|
|
1357
|
-
_(y(
|
|
1358
|
-
render: (
|
|
1359
|
-
props: (
|
|
1357
|
+
o("div", ya, [
|
|
1358
|
+
_(y(De), {
|
|
1359
|
+
render: (te = (ie = (xe = I.ref) == null ? void 0 : xe.column) == null ? void 0 : ie.columnDef) == null ? void 0 : te.cell,
|
|
1360
|
+
props: (ye = (Y = I.ref) == null ? void 0 : Y.getContext) == null ? void 0 : ye.call(Y)
|
|
1360
1361
|
}, null, 8, ["render", "props"])
|
|
1361
1362
|
])
|
|
1362
1363
|
]),
|
|
1363
1364
|
o("div", null, [
|
|
1364
|
-
_(y(
|
|
1365
|
-
render: (
|
|
1366
|
-
props: (
|
|
1365
|
+
_(y(De), {
|
|
1366
|
+
render: (s = (t = (a = I.status) == null ? void 0 : a.column) == null ? void 0 : t.columnDef) == null ? void 0 : s.cell,
|
|
1367
|
+
props: (d = (l = I.status) == null ? void 0 : l.getContext) == null ? void 0 : d.call(l)
|
|
1367
1368
|
}, null, 8, ["render", "props"])
|
|
1368
1369
|
])
|
|
1369
1370
|
])
|
|
@@ -1378,11 +1379,11 @@ const Bt = ze(
|
|
|
1378
1379
|
]),
|
|
1379
1380
|
_: 1
|
|
1380
1381
|
}, 8, ["title", "actions"]),
|
|
1381
|
-
(
|
|
1382
|
-
_(
|
|
1383
|
-
show: y(
|
|
1384
|
-
"onUpdate:show":
|
|
1385
|
-
onSubmitted:
|
|
1382
|
+
(b(), Z(Je, { to: "body" }, [
|
|
1383
|
+
_(ua, Xe(y(m), {
|
|
1384
|
+
show: y(c),
|
|
1385
|
+
"onUpdate:show": B[2] || (B[2] = (j) => Me(c) ? c.value = j : null),
|
|
1386
|
+
onSubmitted: B[3] || (B[3] = () => (c.value = !1, y(x).fetchDrafts()))
|
|
1386
1387
|
}), null, 16, ["show"])
|
|
1387
1388
|
]))
|
|
1388
1389
|
], 64);
|
|
@@ -1390,5 +1391,5 @@ const Bt = ze(
|
|
|
1390
1391
|
}
|
|
1391
1392
|
});
|
|
1392
1393
|
export {
|
|
1393
|
-
|
|
1394
|
+
ka as default
|
|
1394
1395
|
};
|