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