@feedmepos/mf-inventory-portal 1.2.17-dev.1 → 1.2.18
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-CvQI16_m.js → App-C7bnTGbg.js} +1 -1
- package/dist/{ApprovalView-Bpmp0EiN.js → ApprovalView-WhdGpygb.js} +2 -2
- package/dist/{BindingsDialog-Dj3Ul3Hv.js → BindingsDialog-CHKnpitE.js} +2 -2
- package/dist/{BindingsPicker-DFaOJ9Mr.js → BindingsPicker-BXUv8H0c.js} +1 -1
- package/dist/{BindingsTable-D_gYSqc3.js → BindingsTable-4Ndm5r7H.js} +1 -1
- package/dist/{ClosingDraftView-Ds7yRxye.js → ClosingDraftView-C0XTMbHo.js} +2 -2
- package/dist/{ClosingTemplateView-BEknM3gR.js → ClosingTemplateView-C17StrHT.js} +296 -296
- package/dist/{DeliveryOrderPrintPreview-pKBREKAn.js → DeliveryOrderPrintPreview-C7t3WZV1.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D4Fy0CRH.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DRSUXz--.js} +3 -3
- package/dist/{FmMultiselectDialog-KFA3Oe14.js → FmMultiselectDialog-BnAHRAAM.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CHViCIO9.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DbaD9qUk.js} +1 -1
- package/dist/{ImportView-BMIp5iNg.js → ImportView-BJyqR26k.js} +275 -279
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BbR7BY5t.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DYskeNa8.js} +1 -1
- package/dist/{IngredientGroupView-DyPWmsHp.js → IngredientGroupView-CmTrE28Q.js} +2 -2
- package/dist/{IngredientsView-BBrYRXgE.js → IngredientsView-CZSd4iI2.js} +8 -8
- package/dist/{IntegrationView-ClHFof33.js → IntegrationView-BcdRocma.js} +3 -3
- package/dist/{InventoryBindingForm-BBA5xLdJ.js → InventoryBindingForm-hsjpKGlq.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CmPAkzJn.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-5yGfFt02.js} +3 -3
- package/dist/{InventoryBindingSummary-BjXlLwGS.js → InventoryBindingSummary-AE1tIBZX.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-mFE4CC3D.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-qhWKUytO.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-AWY6QeLj.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BN07OE3j.js} +1 -1
- package/dist/{PublishView-D3xxqwhK.js → PublishView-CPWKoKv4.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-mwyZgu5h.js → PurchaseOrderPrintPreview-CkiHTmgC.js} +1 -1
- package/dist/{ReceiveRequestView-NyKfbtAl.js → ReceiveRequestView-B-Q5LDit.js} +185 -193
- package/dist/{RecipeView-Cg7_T6-B.js → RecipeView-DEd2uP8R.js} +3 -3
- package/dist/{StockView-C9K7xKpF.js → StockView-DGL_EghN.js} +7 -7
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DZhRVJwr.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-D6-lImIW.js} +1 -1
- package/dist/{SupplierView-CaEzwVVw.js → SupplierView-uY0HvMr-.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BVSyv6NL.js → TransferDetails.vue_vue_type_script_setup_true_lang-C0LNY9CK.js} +5 -5
- package/dist/{TransferTemplateView-B4_J_O_U.js → TransferTemplateView-DjI7px12.js} +7 -7
- package/dist/{UnitView-DuiQRfl9.js → UnitView-CANjtjhH.js} +3 -3
- package/dist/{WarehouseView-Bb2VB3uH.js → WarehouseView-BzGxfJI-.js} +1 -1
- package/dist/{app-C_ybIeQL.js → app-ZxL49u29.js} +2468 -2480
- package/dist/app.js +1 -1
- package/dist/{closing-template-BjPPidb4.js → closing-template-BA7jw5Ib.js} +1 -1
- package/dist/{decimal-DIKbgzfe.js → decimal-YUVJ1ppE.js} +1 -1
- package/dist/{format-unit-display-SiJQnJk-.js → format-unit-display-B8-ONx5f.js} +3 -3
- package/dist/{import-export.helper-DdPmfMT_.js → import-export.helper-B0RkcNAy.js} +62 -67
- package/dist/{index-CowO4VHt.js → index-BOLpjtRD.js} +1 -1
- package/dist/{index-bIhW74tJ.js → index-By0SWtFG.js} +1 -1
- package/dist/{purchase-order-template-C8y1AzcV.js → purchase-order-template-CppyMHCz.js} +1 -1
- package/dist/{stock-BQVrprBx.js → stock-8M_JUjPp.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-B6kYUhIp.js → supplier-BkEYL5KY.js} +1 -1
- package/dist/{use-ingredient-select-dialog-BA8NYDBZ.js → use-ingredient-select-dialog-BNr7wDV-.js} +1 -1
- package/dist/{use-inventory-binding-dialog-DM-6mqUf.js → use-inventory-binding-dialog-C3r06vdY.js} +1 -1
- package/package.json +3 -3
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a as le, ar as
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { useDialogChild as
|
|
5
|
-
import { s as
|
|
6
|
-
import { r as
|
|
7
|
-
function
|
|
8
|
-
return `
|
|
1
|
+
import { defineComponent as De, ref as D, computed as q, watch as He, resolveComponent as ee, openBlock as N, createElementBlock as P, createVNode as B, normalizeClass as ve, unref as i, createSlots as ze, withCtx as Z, createElementVNode as n, createBlock as ae, toDisplayString as a, createCommentVNode as te, Fragment as Ae, renderList as Be, shallowRef as Me, h as we, createTextVNode as E } from "vue";
|
|
2
|
+
import { a as le, ar as Pe, b5 as Fe, ap as Ke, W as We, ao as ke, l as Ve, B as Le, C as Je, E as Xe, G as Se, c as qe } from "./app-ZxL49u29.js";
|
|
3
|
+
import { useCoreStore as Re, useI18n as je } from "@feedmepos/mf-common";
|
|
4
|
+
import { useDialogChild as Qe, useSnackbar as Oe, useDialog as Ye, useBreakpoints as Ze } from "@feedmepos/ui-library";
|
|
5
|
+
import { s as et, g as tt, b as nt, d as $e } from "./import-export.helper-B0RkcNAy.js";
|
|
6
|
+
import { r as ot } from "./random-CSbEbElR.js";
|
|
7
|
+
function Ie() {
|
|
8
|
+
return `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${ot()}`;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${Re()}`;
|
|
12
|
-
}
|
|
13
|
-
function st(R) {
|
|
10
|
+
function rt(R) {
|
|
14
11
|
const [
|
|
15
12
|
e,
|
|
16
13
|
S,
|
|
@@ -19,19 +16,19 @@ function st(R) {
|
|
|
19
16
|
w,
|
|
20
17
|
_,
|
|
21
18
|
...o
|
|
22
|
-
] =
|
|
23
|
-
if (!e || !e.length || e.some((
|
|
19
|
+
] = Pe(R);
|
|
20
|
+
if (!e || !e.length || e.some((c) => c.length && !c.startsWith("system:")))
|
|
24
21
|
throw new Error("Missing meta header. Excel file does not come from the template.");
|
|
25
|
-
const l = e.map((
|
|
22
|
+
const l = e.map((c) => c.split(":")[1]), y = ["name", "symbol", "precision"].filter((c) => !l.includes(c));
|
|
26
23
|
if (y.length)
|
|
27
24
|
throw new Error(
|
|
28
25
|
`Missing meta headers (${y.join()}). Excel file does not come from the template.`
|
|
29
26
|
);
|
|
30
|
-
return o.map((
|
|
27
|
+
return o.map((c, f) => {
|
|
31
28
|
const g = {};
|
|
32
29
|
for (const p in l) {
|
|
33
|
-
const
|
|
34
|
-
Object.assign(g, { [
|
|
30
|
+
const d = l[p];
|
|
31
|
+
Object.assign(g, { [d]: c[p] });
|
|
35
32
|
}
|
|
36
33
|
return {
|
|
37
34
|
index: f,
|
|
@@ -39,18 +36,17 @@ function st(R) {
|
|
|
39
36
|
};
|
|
40
37
|
});
|
|
41
38
|
}
|
|
42
|
-
function
|
|
39
|
+
function st(R) {
|
|
43
40
|
try {
|
|
44
|
-
const e =
|
|
45
|
-
const { name: l, symbol: s, precision: y, measurement_name:
|
|
46
|
-
return l || s || y ||
|
|
41
|
+
const e = rt(R).filter((o) => {
|
|
42
|
+
const { name: l, symbol: s, precision: y, measurement_name: u, measurement_symbol: c, measurement_conversion: f } = o.data;
|
|
43
|
+
return l || s || y || u || c || f;
|
|
47
44
|
}), h = le().units, x = [], w = [];
|
|
48
45
|
let _ = {};
|
|
49
46
|
for (const o of e)
|
|
50
47
|
if (o.data.name && o.data.symbol)
|
|
51
48
|
_[o.data.name] = {
|
|
52
49
|
unit: {
|
|
53
|
-
_id: rt(),
|
|
54
50
|
name: o.data.name,
|
|
55
51
|
abbrev: o.data.symbol,
|
|
56
52
|
precision: Math.max(0, Math.min(10, Math.floor(o.data.precision || 2))),
|
|
@@ -58,7 +54,7 @@ function it(R) {
|
|
|
58
54
|
},
|
|
59
55
|
rowNumber: o.index
|
|
60
56
|
}, o.data.measurement_name && o.data.measurement_symbol && o.data.measurement_conversion && _[o.data.name].unit.measurements.push({
|
|
61
|
-
id:
|
|
57
|
+
id: Ie(),
|
|
62
58
|
name: o.data.measurement_name,
|
|
63
59
|
abbrev: o.data.measurement_symbol,
|
|
64
60
|
conversion: {
|
|
@@ -69,7 +65,7 @@ function it(R) {
|
|
|
69
65
|
else {
|
|
70
66
|
const l = Object.keys(_)[Object.keys(_).length - 1];
|
|
71
67
|
l && _[l] && o.data.measurement_name && o.data.measurement_symbol && o.data.measurement_conversion && _[l].unit.measurements.push({
|
|
72
|
-
id:
|
|
68
|
+
id: Ie(),
|
|
73
69
|
name: o.data.measurement_name,
|
|
74
70
|
abbrev: o.data.measurement_symbol,
|
|
75
71
|
conversion: {
|
|
@@ -79,9 +75,9 @@ function it(R) {
|
|
|
79
75
|
});
|
|
80
76
|
}
|
|
81
77
|
for (const [o, { unit: l, rowNumber: s }] of Object.entries(_)) {
|
|
82
|
-
const y = h.find((
|
|
83
|
-
var
|
|
84
|
-
return
|
|
78
|
+
const y = h.find((u) => {
|
|
79
|
+
var c, f;
|
|
80
|
+
return u.abbrev === l.abbrev && ((c = u.name) == null ? void 0 : c.trim()) === ((f = l.name) == null ? void 0 : f.trim());
|
|
85
81
|
});
|
|
86
82
|
y ? w.push({
|
|
87
83
|
type: "update",
|
|
@@ -91,16 +87,19 @@ function it(R) {
|
|
|
91
87
|
name: l.name || y.name,
|
|
92
88
|
abbrev: l.abbrev || y.abbrev,
|
|
93
89
|
precision: l.precision !== void 0 ? l.precision : y.precision,
|
|
94
|
-
measurements: l.measurements.map((
|
|
95
|
-
const
|
|
96
|
-
return
|
|
90
|
+
measurements: l.measurements.map((u) => {
|
|
91
|
+
const c = y.measurements.find((f) => f.name === u.name && f.abbrev === u.abbrev);
|
|
92
|
+
return c ? { ...c, ...u, id: c.id } : { ...u, id: Ie() };
|
|
97
93
|
})
|
|
98
94
|
},
|
|
99
95
|
errors: [],
|
|
100
96
|
excelRowNumber: s
|
|
101
97
|
}) : x.push({
|
|
102
98
|
type: "create",
|
|
103
|
-
unit:
|
|
99
|
+
unit: {
|
|
100
|
+
...l,
|
|
101
|
+
measurements: l.measurements.map((u) => ({ ...u, id: Ie() }))
|
|
102
|
+
},
|
|
104
103
|
errors: [],
|
|
105
104
|
excelRowNumber: s
|
|
106
105
|
});
|
|
@@ -119,14 +118,11 @@ function it(R) {
|
|
|
119
118
|
};
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
|
-
function
|
|
123
|
-
return `recipe_${(/* @__PURE__ */ new Date()).toISOString()}_${Re()}`;
|
|
124
|
-
}
|
|
125
|
-
function lt(R, { ignoreErrors: e = !1 } = {}) {
|
|
121
|
+
function it(R, { ignoreErrors: e = !1 } = {}) {
|
|
126
122
|
var S, h, x;
|
|
127
123
|
try {
|
|
128
|
-
const w = le(), _ = w.skuByCode, o = w.recipeByName, l = w.skuGroupById, s = w.skuGroups, y = w.units,
|
|
129
|
-
let
|
|
124
|
+
const w = le(), _ = w.skuByCode, o = w.recipeByName, l = w.skuGroupById, s = w.skuGroups, y = w.units, u = [];
|
|
125
|
+
let c = {};
|
|
130
126
|
for (const r of R) {
|
|
131
127
|
const b = [];
|
|
132
128
|
let C = "";
|
|
@@ -146,47 +142,47 @@ function lt(R, { ignoreErrors: e = !1 } = {}) {
|
|
|
146
142
|
if ((r.data.unit || r.data.baseUnit) && r.data.type !== "RECIPE" && r.data.type !== "SKU_GROUP" && (A = y.find((U) => {
|
|
147
143
|
var T, re;
|
|
148
144
|
return U.abbrev === r.data.baseUnit && ((T = U.name) == null ? void 0 : T.trim()) === ((re = r.data.unit) == null ? void 0 : re.trim());
|
|
149
|
-
}), A || (r.data.baseUnit && r.data.unit ? b.push(`Cannot find unit with symbol '${r.data.baseUnit}' and name '${r.data.unit}'`) : r.data.baseUnit ? b.push(`Cannot find unit with symbol '${r.data.baseUnit}'`) : r.data.unit && b.push(`Cannot find unit with name '${r.data.unit}'`))), b.length > 0 &&
|
|
145
|
+
}), A || (r.data.baseUnit && r.data.unit ? b.push(`Cannot find unit with symbol '${r.data.baseUnit}' and name '${r.data.unit}'`) : r.data.baseUnit ? b.push(`Cannot find unit with symbol '${r.data.baseUnit}'`) : r.data.unit && b.push(`Cannot find unit with name '${r.data.unit}'`))), b.length > 0 && u.push(`Row ${r.index + 6}: ${b.join(", ")}`), e || b.length === 0) {
|
|
150
146
|
let U;
|
|
151
147
|
if (r.data.type === "RECIPE" || r.data.type === "SKU_GROUP" ? U = void 0 : U = (S = A == null ? void 0 : A.measurements) == null ? void 0 : S.find((T) => T.abbrev === r.data.measurementName), r.data.recipeName)
|
|
152
|
-
|
|
153
|
-
_id: at(),
|
|
148
|
+
c[r.data.recipeName] = {
|
|
154
149
|
name: r.data.recipeName,
|
|
155
|
-
customAttributes: r.data.customAttributes ?
|
|
150
|
+
customAttributes: r.data.customAttributes ? et(r.data.customAttributes) : {},
|
|
156
151
|
contains: [{
|
|
157
152
|
type: r.data.type === "INGREDIENT" ? "SKU" : r.data.type,
|
|
158
153
|
id: C,
|
|
159
154
|
amount: {
|
|
160
155
|
amount: parseFloat(r.data.amount) || 0,
|
|
161
|
-
precision:
|
|
156
|
+
precision: Fe(r.data.amount) === !0 && ((h = r.data.amount.split(".")[1]) == null ? void 0 : h.length) || 0
|
|
162
157
|
},
|
|
163
158
|
measurement: U || void 0
|
|
164
159
|
}]
|
|
165
|
-
},
|
|
160
|
+
}, u[r.data.recipeName] = b.length > 0 ? `Row ${r.index + 6}: ${b.join(", ")}` : [];
|
|
166
161
|
else {
|
|
167
|
-
const T = Object.keys(
|
|
168
|
-
T &&
|
|
169
|
-
...
|
|
162
|
+
const T = Object.keys(c)[Object.keys(c).length - 1];
|
|
163
|
+
T && c[T] && (c[T] = {
|
|
164
|
+
...c[T],
|
|
170
165
|
contains: [
|
|
171
|
-
...
|
|
166
|
+
...c[T].contains,
|
|
172
167
|
{
|
|
173
168
|
type: r.data.type === "INGREDIENT" ? "SKU" : r.data.type,
|
|
174
169
|
id: C,
|
|
175
170
|
amount: {
|
|
176
171
|
amount: parseFloat(r.data.amount) || 0,
|
|
177
|
-
precision:
|
|
172
|
+
precision: Fe(r.data.amount) === !0 && ((x = r.data.amount.split(".")[1]) == null ? void 0 : x.length) || 0
|
|
178
173
|
},
|
|
179
174
|
measurement: U || void 0
|
|
180
175
|
}
|
|
181
176
|
]
|
|
182
|
-
},
|
|
177
|
+
}, u[T] = b.length > 0 ? u[T] ? `${u[T]}, Row ${r.index + 6}: ${b.join(", ")}` : `Row ${r.index + 6}: ${b.join(", ")}` : []);
|
|
183
178
|
}
|
|
184
179
|
}
|
|
185
180
|
}
|
|
186
|
-
const f = Object.values(
|
|
181
|
+
const f = Object.values(c), g = f.filter((r) => !o[r.name]), p = f.filter((r) => o[r.name]), d = g.map((r, b) => ({
|
|
187
182
|
type: "create",
|
|
188
183
|
recipe: r,
|
|
189
|
-
|
|
184
|
+
// Type assertion - _id will be assigned by backend
|
|
185
|
+
errors: u[r.name],
|
|
190
186
|
excelRowNumber: b + 6
|
|
191
187
|
// Assuming header rows
|
|
192
188
|
})), G = p.map((r, b) => {
|
|
@@ -200,14 +196,14 @@ function lt(R, { ignoreErrors: e = !1 } = {}) {
|
|
|
200
196
|
contains: r.contains.length > 0 ? r.contains : C.contains,
|
|
201
197
|
customAttributes: r.customAttributes || C.customAttributes
|
|
202
198
|
},
|
|
203
|
-
errors:
|
|
199
|
+
errors: u[r.name],
|
|
204
200
|
excelRowNumber: b + 6
|
|
205
201
|
};
|
|
206
202
|
});
|
|
207
203
|
return {
|
|
208
|
-
invalidExcel:
|
|
209
|
-
invalidExcelMessage:
|
|
210
|
-
importCreateResult:
|
|
204
|
+
invalidExcel: u.length > 0,
|
|
205
|
+
invalidExcelMessage: u.length > 0 ? `Import completed with ${u.length} error(s): ${u.join("; ")}` : void 0,
|
|
206
|
+
importCreateResult: d,
|
|
211
207
|
importUpdateResult: G
|
|
212
208
|
};
|
|
213
209
|
} catch (w) {
|
|
@@ -219,7 +215,7 @@ function lt(R, { ignoreErrors: e = !1 } = {}) {
|
|
|
219
215
|
};
|
|
220
216
|
}
|
|
221
217
|
}
|
|
222
|
-
function
|
|
218
|
+
function at(R) {
|
|
223
219
|
const [
|
|
224
220
|
e,
|
|
225
221
|
S,
|
|
@@ -228,31 +224,31 @@ function mt(R) {
|
|
|
228
224
|
w,
|
|
229
225
|
_,
|
|
230
226
|
...o
|
|
231
|
-
] =
|
|
232
|
-
if (!e || !e.length || e.some((
|
|
227
|
+
] = Pe(R);
|
|
228
|
+
if (!e || !e.length || e.some((c) => c.length && !c.startsWith("system:")))
|
|
233
229
|
throw new Error("Missing meta header. Excel file does not come from the template.");
|
|
234
|
-
const l = e.map((
|
|
230
|
+
const l = e.map((c) => c.split(":")[1]), y = ["code", "recipeName", "unit", "baseUnit", "type", "amount"].filter((c) => !l.includes(c));
|
|
235
231
|
if (y.length)
|
|
236
232
|
throw new Error(
|
|
237
233
|
`Missing meta headers (${y.join()}). Excel file does not come from the template.`
|
|
238
234
|
);
|
|
239
|
-
return o.map((
|
|
235
|
+
return o.map((c, f) => {
|
|
240
236
|
const g = {};
|
|
241
237
|
for (const p in l) {
|
|
242
|
-
const
|
|
243
|
-
Object.assign(g, { [
|
|
238
|
+
const d = l[p];
|
|
239
|
+
Object.assign(g, { [d]: c[p] });
|
|
244
240
|
}
|
|
245
241
|
return {
|
|
246
242
|
index: f,
|
|
247
243
|
data: g
|
|
248
244
|
};
|
|
249
|
-
}).filter((
|
|
250
|
-
const { recipeName: f, type: g, code: p, name:
|
|
251
|
-
return f || g || p ||
|
|
245
|
+
}).filter((c) => {
|
|
246
|
+
const { recipeName: f, type: g, code: p, name: d, amount: G, unit: r, baseUnit: b, measurementName: C, customAttributes: A } = c.data;
|
|
247
|
+
return f || g || p || d || G || r || b || C || A;
|
|
252
248
|
});
|
|
253
249
|
}
|
|
254
|
-
function
|
|
255
|
-
const e =
|
|
250
|
+
function lt() {
|
|
251
|
+
const e = Re().currentBusiness.value, S = le(), h = [
|
|
256
252
|
{ id: "name", name: "Unit Name" },
|
|
257
253
|
{ id: "symbol", name: "Symbol" },
|
|
258
254
|
{ id: "precision", name: "Precision" },
|
|
@@ -306,24 +302,24 @@ function ut() {
|
|
|
306
302
|
h.map((o) => o.name),
|
|
307
303
|
...x
|
|
308
304
|
], _ = h.map((o) => `system:${o.id}`);
|
|
309
|
-
return
|
|
305
|
+
return ke(w, _);
|
|
310
306
|
}
|
|
311
|
-
function
|
|
312
|
-
const e =
|
|
307
|
+
function mt() {
|
|
308
|
+
const e = Re().currentBusiness.value, S = le(), h = nt();
|
|
313
309
|
let x = [];
|
|
314
310
|
S.skus.length > 0 ? x = S.skus.map((o) => {
|
|
315
|
-
var l, s, y,
|
|
311
|
+
var l, s, y, u, c, f, g, p;
|
|
316
312
|
return [
|
|
317
313
|
o.code,
|
|
318
314
|
o.name,
|
|
319
315
|
((l = o.unit) == null ? void 0 : l.name) || "",
|
|
320
316
|
((s = o.unit) == null ? void 0 : s.abbrev) || "",
|
|
321
|
-
((
|
|
317
|
+
((u = (y = o.unit) == null ? void 0 : y.measurements.find((d) => d.id === o.trackingMeasurement)) == null ? void 0 : u.abbrev) ?? o.unit.abbrev,
|
|
322
318
|
o.valuation || "WAVG",
|
|
323
|
-
(
|
|
324
|
-
((g = o.thresholds) == null ? void 0 : g.low) ??
|
|
325
|
-
((p = o.thresholds) == null ? void 0 : p.mid) ??
|
|
326
|
-
o.customAttributes ? Object.entries(o.customAttributes).map(([
|
|
319
|
+
(c = o.defaultCost) != null && c.costPerUnit ? +Ve((f = o.defaultCost) == null ? void 0 : f.costPerUnit) : 0,
|
|
320
|
+
((g = o.thresholds) == null ? void 0 : g.low) ?? $e().low,
|
|
321
|
+
((p = o.thresholds) == null ? void 0 : p.mid) ?? $e().mid,
|
|
322
|
+
o.customAttributes ? Object.entries(o.customAttributes).map(([d, G]) => `${d}:${G}`).join("|") : ""
|
|
327
323
|
];
|
|
328
324
|
}) : x = [
|
|
329
325
|
["EXAMPLE_CODE", "Example Ingredient", "kg", "kg", "Unit Name", "WAVG", 10.5, 5, 10, ""]
|
|
@@ -336,10 +332,10 @@ function dt() {
|
|
|
336
332
|
h.map((o) => o.name),
|
|
337
333
|
...x
|
|
338
334
|
], _ = h.map((o) => `system:${o.id}`);
|
|
339
|
-
return
|
|
335
|
+
return ke(w, _);
|
|
340
336
|
}
|
|
341
|
-
function
|
|
342
|
-
const e =
|
|
337
|
+
function ut() {
|
|
338
|
+
const e = Re().currentBusiness.value, S = le(), h = [
|
|
343
339
|
{ id: "recipeName", name: "Recipe Name" },
|
|
344
340
|
{ id: "type", name: "Type" },
|
|
345
341
|
{ id: "code", name: "Code" },
|
|
@@ -354,54 +350,54 @@ function ct() {
|
|
|
354
350
|
if (S.recipes.length > 0) {
|
|
355
351
|
const o = S.recipeById, l = S.skuById, s = S.skuGroupById;
|
|
356
352
|
x = S.recipes.flatMap((y) => {
|
|
357
|
-
var
|
|
358
|
-
const
|
|
359
|
-
if ((
|
|
360
|
-
const f = y.contains.filter((
|
|
353
|
+
var c;
|
|
354
|
+
const u = y.customAttributes ? Object.entries(y.customAttributes).map(([f, g]) => `${f}:${g}`).join("|") : "";
|
|
355
|
+
if ((c = y.contains) != null && c.length) {
|
|
356
|
+
const f = y.contains.filter((d) => d.type === "RECIPE"), g = y.contains.filter((d) => d.type === "SKU"), p = y.contains.filter((d) => d.type === "SKU_GROUP");
|
|
361
357
|
return [
|
|
362
|
-
...f.map((
|
|
358
|
+
...f.map((d, G) => {
|
|
363
359
|
var r;
|
|
364
360
|
return [
|
|
365
361
|
G === 0 ? y.name : "",
|
|
366
362
|
"RECIPE",
|
|
367
363
|
"",
|
|
368
|
-
((r = o[
|
|
369
|
-
|
|
364
|
+
((r = o[d.id]) == null ? void 0 : r.name) || "",
|
|
365
|
+
d.amount.amount,
|
|
370
366
|
"",
|
|
371
367
|
"unit",
|
|
372
368
|
"Unit",
|
|
373
|
-
G === 0 ?
|
|
369
|
+
G === 0 ? u : ""
|
|
374
370
|
];
|
|
375
371
|
}),
|
|
376
|
-
...g.map((
|
|
372
|
+
...g.map((d, G) => {
|
|
377
373
|
var r, b, C, A, U, T, re, ye, ge, me, fe, ue, be, he, xe, _e;
|
|
378
374
|
return [
|
|
379
375
|
!f.length && G === 0 ? y.name : "",
|
|
380
376
|
"INGREDIENT",
|
|
381
|
-
((r = l[
|
|
382
|
-
((b = l[
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
377
|
+
((r = l[d.id]) == null ? void 0 : r.code) || "",
|
|
378
|
+
((b = l[d.id]) == null ? void 0 : b.name) || "",
|
|
379
|
+
d.amount.amount,
|
|
380
|
+
d.measurement ? ((A = (C = l[d.id]) == null ? void 0 : C.unit) == null ? void 0 : A.name) || "" : ((T = (U = l[d.id]) == null ? void 0 : U.unit) == null ? void 0 : T.name) || "",
|
|
381
|
+
d.measurement ? ((ye = (re = l[d.id]) == null ? void 0 : re.unit) == null ? void 0 : ye.abbrev) || "" : ((me = (ge = l[d.id]) == null ? void 0 : ge.unit) == null ? void 0 : me.abbrev) || "",
|
|
382
|
+
d.measurement ? d.measurement.abbrev : ((he = (be = (ue = (fe = l[d.id]) == null ? void 0 : fe.unit) == null ? void 0 : ue.measurements) == null ? void 0 : be.find((Ee) => {
|
|
387
383
|
var m;
|
|
388
|
-
return
|
|
389
|
-
})) == null ? void 0 : he.abbrev) || ((_e = (xe = l[
|
|
390
|
-
!f.length && G === 0 ?
|
|
384
|
+
return Ee.id === ((m = l[d.id]) == null ? void 0 : m.trackingMeasurement);
|
|
385
|
+
})) == null ? void 0 : he.abbrev) || ((_e = (xe = l[d.id]) == null ? void 0 : xe.unit) == null ? void 0 : _e.abbrev) || "",
|
|
386
|
+
!f.length && G === 0 ? u : ""
|
|
391
387
|
];
|
|
392
388
|
}),
|
|
393
|
-
...p.map((
|
|
389
|
+
...p.map((d, G) => {
|
|
394
390
|
var r, b;
|
|
395
391
|
return [
|
|
396
392
|
f.length === 0 && g.length === 0 && G === 0 ? y.name : "",
|
|
397
393
|
"SKU_GROUP",
|
|
398
|
-
((r = s[
|
|
399
|
-
((b = s[
|
|
400
|
-
|
|
394
|
+
((r = s[d.id]) == null ? void 0 : r.ref) || "",
|
|
395
|
+
((b = s[d.id]) == null ? void 0 : b.name) || "",
|
|
396
|
+
d.amount.amount,
|
|
401
397
|
"",
|
|
402
398
|
"unit",
|
|
403
399
|
"Unit",
|
|
404
|
-
f.length === 0 && g.length === 0 && G === 0 ?
|
|
400
|
+
f.length === 0 && g.length === 0 && G === 0 ? u : ""
|
|
405
401
|
];
|
|
406
402
|
})
|
|
407
403
|
];
|
|
@@ -422,83 +418,83 @@ function ct() {
|
|
|
422
418
|
h.map((o) => o.name),
|
|
423
419
|
...x
|
|
424
420
|
], _ = h.map((o) => `system:${o.id}`);
|
|
425
|
-
return
|
|
421
|
+
return ke(w, _);
|
|
426
422
|
}
|
|
427
|
-
function
|
|
428
|
-
const R =
|
|
429
|
-
unit:
|
|
430
|
-
ingredient:
|
|
431
|
-
recipe:
|
|
423
|
+
function dt() {
|
|
424
|
+
const R = Ke({
|
|
425
|
+
unit: lt(),
|
|
426
|
+
ingredient: mt(),
|
|
427
|
+
recipe: ut()
|
|
432
428
|
}), e = "FeedMe comprehensive template.xlsx";
|
|
433
|
-
return
|
|
429
|
+
return We(R, e), e;
|
|
434
430
|
}
|
|
435
|
-
async function
|
|
431
|
+
async function ct(R) {
|
|
436
432
|
if (!R) return null;
|
|
437
433
|
try {
|
|
438
|
-
return
|
|
434
|
+
return st(R);
|
|
439
435
|
} catch (e) {
|
|
440
436
|
throw console.error("Error in processUnitsSheet:", e), e;
|
|
441
437
|
}
|
|
442
438
|
}
|
|
443
|
-
async function
|
|
439
|
+
async function pt(R) {
|
|
444
440
|
if (!R) return null;
|
|
445
441
|
try {
|
|
446
|
-
return
|
|
442
|
+
return tt(R);
|
|
447
443
|
} catch (e) {
|
|
448
444
|
throw console.error("Error in processIngredientsSheet:", e), e;
|
|
449
445
|
}
|
|
450
446
|
}
|
|
451
|
-
async function
|
|
447
|
+
async function vt(R) {
|
|
452
448
|
if (!R) return null;
|
|
453
449
|
try {
|
|
454
|
-
const e =
|
|
455
|
-
return
|
|
450
|
+
const e = at(R);
|
|
451
|
+
return it(e, { ignoreErrors: !0 });
|
|
456
452
|
} catch (e) {
|
|
457
453
|
throw console.error("Error in processRecipesSheet:", e), e;
|
|
458
454
|
}
|
|
459
455
|
}
|
|
460
|
-
const
|
|
456
|
+
const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8" }, ft = { class: "flex flex-col flex-1 gap-4" }, bt = { class: "fm-typo-en-body-md-600" }, ht = {
|
|
461
457
|
key: 2,
|
|
462
458
|
class: "shrink-0"
|
|
463
|
-
},
|
|
459
|
+
}, xt = {
|
|
464
460
|
key: 0,
|
|
465
461
|
class: "flex flex-col"
|
|
466
|
-
},
|
|
462
|
+
}, _t = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, wt = {
|
|
467
463
|
key: 0,
|
|
468
464
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
469
|
-
},
|
|
465
|
+
}, It = { class: "fm-typo-en-body-lg-600" }, Et = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, St = /* @__PURE__ */ De({
|
|
470
466
|
__name: "ImportDialog",
|
|
471
467
|
setup(R) {
|
|
472
|
-
const e = D(null), S =
|
|
473
|
-
|
|
474
|
-
const h = D(!1), x = D(new Array()), w = D(null), _ = D([]), o = D([]), l = q(() => !!x.value.length), s = q(() => !!w.value && _.value.length > 0), { t: y } =
|
|
475
|
-
async function
|
|
468
|
+
const e = D(null), S = Qe();
|
|
469
|
+
Oe();
|
|
470
|
+
const h = D(!1), x = D(new Array()), w = D(null), _ = D([]), o = D([]), l = q(() => !!x.value.length), s = q(() => !!w.value && _.value.length > 0), { t: y } = je();
|
|
471
|
+
async function u(g) {
|
|
476
472
|
x.value = [], w.value = null, _.value = [], o.value = [];
|
|
477
473
|
try {
|
|
478
474
|
h.value = !0;
|
|
479
475
|
const [p] = await Promise.all([
|
|
480
|
-
|
|
476
|
+
Je(g),
|
|
481
477
|
// fake buffer for UX
|
|
482
|
-
new Promise((
|
|
478
|
+
new Promise((d) => setTimeout(d, 1e3))
|
|
483
479
|
]);
|
|
484
|
-
w.value = p,
|
|
480
|
+
w.value = p, c();
|
|
485
481
|
} catch (p) {
|
|
486
482
|
console.error("Error parsing Excel file:", p), x.value.push((p == null ? void 0 : p.message) || "Unknown error occurred");
|
|
487
483
|
} finally {
|
|
488
484
|
h.value = !1;
|
|
489
485
|
}
|
|
490
486
|
}
|
|
491
|
-
function
|
|
487
|
+
function c() {
|
|
492
488
|
if (x.value = [], !w.value) return;
|
|
493
|
-
const p = ["unit", "ingredient", "recipe"].filter((
|
|
489
|
+
const p = ["unit", "ingredient", "recipe"].filter((d) => w.value.Sheets[d]);
|
|
494
490
|
if (p.length === 0) {
|
|
495
491
|
x.value.push("No valid sheets found. Expected sheets: unit, ingredient, or recipe");
|
|
496
492
|
return;
|
|
497
493
|
}
|
|
498
494
|
_.value = p, S.emitData({ availableSheets: p, workbook: w.value });
|
|
499
495
|
}
|
|
500
|
-
|
|
501
|
-
g &&
|
|
496
|
+
He(e, (g) => {
|
|
497
|
+
g && u(g);
|
|
502
498
|
});
|
|
503
499
|
function f() {
|
|
504
500
|
if (!w.value || _.value.length === 0) return "";
|
|
@@ -518,9 +514,9 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
518
514
|
}), g.length > 0 ? `Ready to process: ${g.join(", ")}. Processing will follow dependency order.` : "No valid sheets found";
|
|
519
515
|
}
|
|
520
516
|
return (g, p) => {
|
|
521
|
-
const
|
|
522
|
-
return N(), P("div",
|
|
523
|
-
B(
|
|
517
|
+
const d = ee("FmCircularProgress"), G = ee("FmIcon"), r = ee("FmButton");
|
|
518
|
+
return N(), P("div", yt, [
|
|
519
|
+
B(Le, {
|
|
524
520
|
class: ve({
|
|
525
521
|
"w-full": !0,
|
|
526
522
|
"h-[200px]": !e.value
|
|
@@ -529,11 +525,11 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
529
525
|
onFileUpload: p[0] || (p[0] = (b) => e.value = b),
|
|
530
526
|
label: i(y)("inventory.ingredient.import.uploadTemplate"),
|
|
531
527
|
"button-label": i(y)("inventory.ingredient.import.selectFile")
|
|
532
|
-
},
|
|
528
|
+
}, ze({ _: 2 }, [
|
|
533
529
|
e.value ? {
|
|
534
530
|
name: "default",
|
|
535
531
|
fn: Z(({ openFileDialog: b }) => [
|
|
536
|
-
n("div",
|
|
532
|
+
n("div", gt, [
|
|
537
533
|
n("div", {
|
|
538
534
|
class: ve([
|
|
539
535
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
@@ -544,7 +540,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
544
540
|
}
|
|
545
541
|
])
|
|
546
542
|
}, [
|
|
547
|
-
h.value ? (N(), ae(
|
|
543
|
+
h.value ? (N(), ae(d, {
|
|
548
544
|
key: 0,
|
|
549
545
|
size: "md",
|
|
550
546
|
color: "neutral-gray-200"
|
|
@@ -554,8 +550,8 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
554
550
|
color: l.value ? "system-error-300" : "system-success-400",
|
|
555
551
|
size: "lg"
|
|
556
552
|
}, null, 8, ["name", "color"])),
|
|
557
|
-
n("div",
|
|
558
|
-
n("div",
|
|
553
|
+
n("div", ft, [
|
|
554
|
+
n("div", bt, a(e.value.name), 1),
|
|
559
555
|
n("div", {
|
|
560
556
|
class: ve([
|
|
561
557
|
"fm-typo-en-body-sm-400",
|
|
@@ -566,7 +562,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
566
562
|
])
|
|
567
563
|
}, a(l.value ? i(y)("inventory.ingredient.import.error.invalidContent") : "File valid"), 3)
|
|
568
564
|
]),
|
|
569
|
-
h.value ? te("", !0) : (N(), P("div",
|
|
565
|
+
h.value ? te("", !0) : (N(), P("div", ht, [
|
|
570
566
|
B(r, {
|
|
571
567
|
label: i(y)("inventory.ingredient.import.replaceFile"),
|
|
572
568
|
variant: l.value ? "destructive" : "secondary",
|
|
@@ -575,8 +571,8 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
575
571
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
576
572
|
]))
|
|
577
573
|
], 2),
|
|
578
|
-
x.value.length ? (N(), P("div",
|
|
579
|
-
(N(!0), P(
|
|
574
|
+
x.value.length ? (N(), P("div", xt, [
|
|
575
|
+
(N(!0), P(Ae, null, Be(x.value, (C, A) => (N(), P("div", {
|
|
580
576
|
key: A,
|
|
581
577
|
class: "flex gap-8 items-center"
|
|
582
578
|
}, [
|
|
@@ -585,7 +581,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
585
581
|
size: "sm",
|
|
586
582
|
color: "system-error-300"
|
|
587
583
|
}),
|
|
588
|
-
n("div",
|
|
584
|
+
n("div", _t, a(C), 1)
|
|
589
585
|
]))), 128))
|
|
590
586
|
])) : te("", !0)
|
|
591
587
|
])
|
|
@@ -593,51 +589,51 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
593
589
|
key: "0"
|
|
594
590
|
} : void 0
|
|
595
591
|
]), 1032, ["class", "label", "button-label"]),
|
|
596
|
-
s.value ? (N(), P("div",
|
|
597
|
-
n("div",
|
|
598
|
-
n("div",
|
|
592
|
+
s.value ? (N(), P("div", wt, [
|
|
593
|
+
n("div", It, a(i(y)("inventory.ingredient.import.summary")), 1),
|
|
594
|
+
n("div", Et, a(f()), 1)
|
|
599
595
|
])) : te("", !0)
|
|
600
596
|
]);
|
|
601
597
|
};
|
|
602
598
|
}
|
|
603
|
-
}),
|
|
599
|
+
}), kt = {
|
|
604
600
|
key: 0,
|
|
605
601
|
class: "bg-blue-50 border border-blue-200 rounded-lg p-16"
|
|
606
|
-
},
|
|
602
|
+
}, Rt = { class: "flex items-start gap-12" }, Ct = { class: "flex flex-col gap-8" }, Ut = { class: "fm-typo-en-body-md-400 text-blue-800" }, Nt = { class: "fm-typo-en-body-sm-400 text-blue-700" }, Gt = { class: "mb-8" }, Tt = ["innerHTML"], Mt = ["innerHTML"], Ft = { class: "mb-8" }, $t = { class: "mb-12" }, Dt = { class: "mb-12" }, At = { class: "mb-8" }, Bt = { class: "text-orange-600" }, Pt = {
|
|
607
603
|
key: 1,
|
|
608
604
|
class: "bg-white rounded-lg shadow"
|
|
609
|
-
},
|
|
605
|
+
}, jt = { class: "flex items-center justify-between p-16 border-b" }, Ot = { class: "fm-typo-en-title-md-600" }, Ht = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, zt = {
|
|
610
606
|
key: 0,
|
|
611
607
|
class: "text-red-600"
|
|
612
|
-
},
|
|
608
|
+
}, Kt = {
|
|
613
609
|
key: 1,
|
|
614
610
|
class: "text-orange-600"
|
|
615
|
-
},
|
|
611
|
+
}, Wt = {
|
|
616
612
|
key: 2,
|
|
617
613
|
class: "text-green-600"
|
|
618
|
-
},
|
|
614
|
+
}, Vt = { class: "flex gap-8" }, Lt = { class: "p-16" }, Jt = {
|
|
619
615
|
key: 2,
|
|
620
616
|
class: "bg-white rounded-lg shadow"
|
|
621
|
-
},
|
|
617
|
+
}, Xt = { class: "flex items-center justify-between p-16 border-b" }, qt = { class: "fm-typo-en-title-md-600 text-red-800" }, Qt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, Yt = { class: "flex gap-8" }, Zt = { class: "p-16" }, en = {
|
|
622
618
|
key: 0,
|
|
623
619
|
class: "flex flex-col gap-16 p-16"
|
|
624
|
-
},
|
|
620
|
+
}, tn = { class: "fm-typo-en-title-sm-600 mb-12" }, nn = { class: "grid grid-cols-2 gap-12" }, on = { class: "fm-typo-en-body-sm-400 text-gray-600" }, rn = { class: "fm-typo-en-body-md-600" }, sn = { key: 0 }, an = { class: "fm-typo-en-body-sm-400 text-gray-600" }, ln = { class: "fm-typo-en-body-md-600" }, mn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, un = { class: "fm-typo-en-body-md-600" }, dn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, cn = { class: "fm-typo-en-body-md-600" }, pn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, vn = { class: "fm-typo-en-title-sm-600 mb-12 text-red-800" }, yn = { class: "space-y-8" }, gn = { class: "fm-typo-en-body-md-400 text-red-800" }, fn = { class: "fm-typo-en-title-sm-600 mb-12" }, bn = { class: "bg-gray-50 p-12 rounded border overflow-auto" }, hn = { class: "text-sm" }, xn = { class: "flex gap-8" }, _n = { class: "flex flex-col items-center justify-center h-64 gap-16" }, wn = { class: "text-center" }, In = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, En = { class: "flex flex-col items-center justify-center h-64 gap-16" }, Sn = { class: "text-center" }, kn = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, Rn = { class: "fm-typo-en-body-md-400 text-gray-500" }, Fn = /* @__PURE__ */ De({
|
|
625
621
|
__name: "ImportView",
|
|
626
622
|
setup(R) {
|
|
627
|
-
const { t: e } =
|
|
628
|
-
|
|
629
|
-
const x =
|
|
623
|
+
const { t: e } = je(), S = Ye(), h = Oe();
|
|
624
|
+
Xe();
|
|
625
|
+
const x = qe(), { breakpoints: w } = Ze(), _ = le(), o = D("");
|
|
630
626
|
D(!1);
|
|
631
|
-
const l = D(!1), s = D(null), y = D(!1),
|
|
627
|
+
const l = D(!1), s = D(null), y = D(!1), u = D(null), c = D(!1), f = D([]), g = D(null), p = D([]), d = D(!1), G = q(() => w.value.xs || w.value.sm), r = q(() => G.value ? 10 : 20), b = q(() => {
|
|
632
628
|
const m = s.value;
|
|
633
629
|
if (!m) return [];
|
|
634
|
-
const t = [], { units: k, skus: j, recipes: J, _invalidExcel: W, _invalidExcelMessage: Q } = m, Y = (
|
|
630
|
+
const t = [], { units: k, skus: j, recipes: J, _invalidExcel: W, _invalidExcelMessage: Q } = m, Y = (F) => {
|
|
635
631
|
var H;
|
|
636
|
-
return ((H =
|
|
637
|
-
}, K = (
|
|
638
|
-
if (
|
|
632
|
+
return ((H = F.errors) == null ? void 0 : H.length) > 0 ? Array.isArray(F.errors) ? F.errors.join(", ") : F.errors || e("inventory.common.validationFailed") : W ? Q || e("inventory.common.invalidExcelFormat") : e("inventory.common.readyToImport");
|
|
633
|
+
}, K = (F, z) => {
|
|
634
|
+
if (F)
|
|
639
635
|
for (const H of ["create", "update"]) {
|
|
640
|
-
const V =
|
|
636
|
+
const V = F[H];
|
|
641
637
|
if (V)
|
|
642
638
|
for (const O of V)
|
|
643
639
|
t.push({
|
|
@@ -678,7 +674,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
678
674
|
function ye() {
|
|
679
675
|
S.open({
|
|
680
676
|
title: e("inventory.common.import"),
|
|
681
|
-
contentComponent:
|
|
677
|
+
contentComponent: St,
|
|
682
678
|
overlay: !0,
|
|
683
679
|
closeButton: !0,
|
|
684
680
|
primaryActions: {
|
|
@@ -698,7 +694,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
698
694
|
m && m.workbook && m.availableSheets && (await ge(m), S.close()), f.value.length === 0 && S.close();
|
|
699
695
|
}).onTertiary(() => {
|
|
700
696
|
try {
|
|
701
|
-
const m =
|
|
697
|
+
const m = dt();
|
|
702
698
|
h.open({
|
|
703
699
|
title: e("inventory.common.export") + " " + e("inventory.ingredient.import.actions.downloadTemplate"),
|
|
704
700
|
message: e("inventory.common.templateDownloaded", [m]),
|
|
@@ -714,10 +710,10 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
714
710
|
});
|
|
715
711
|
}
|
|
716
712
|
async function ge(m) {
|
|
717
|
-
g.value = m.workbook, f.value = [...m.availableSheets], s.value = {}, await me();
|
|
713
|
+
g.value = m.workbook, f.value = [...m.availableSheets], s.value = {}, p.value = [], await me();
|
|
718
714
|
}
|
|
719
715
|
async function me() {
|
|
720
|
-
var t, k, j, J, W, Q, Y, K,
|
|
716
|
+
var t, k, j, J, W, Q, Y, K, F, z, H, V, O, de, ce;
|
|
721
717
|
if (!g.value || f.value.length === 0) {
|
|
722
718
|
y.value = !0;
|
|
723
719
|
return;
|
|
@@ -726,57 +722,57 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
726
722
|
try {
|
|
727
723
|
switch (m) {
|
|
728
724
|
case "unit": {
|
|
729
|
-
const X = g.value.Sheets.unit, I = await
|
|
725
|
+
const X = g.value.Sheets.unit, I = await ct(X);
|
|
730
726
|
I && (s.value = {
|
|
731
727
|
...s.value,
|
|
732
728
|
_invalidExcel: I.invalidExcel || ((t = s.value) == null ? void 0 : t._invalidExcel),
|
|
733
729
|
_invalidExcelMessage: I.invalidExcelMessage || ((k = s.value) == null ? void 0 : k._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Units sheet",
|
|
734
730
|
units: I.importCreateResult || I.importUpdateResult ? {
|
|
735
|
-
create: ((j = I.importCreateResult) == null ? void 0 : j.map((
|
|
736
|
-
|
|
737
|
-
errors:
|
|
731
|
+
create: ((j = I.importCreateResult) == null ? void 0 : j.map(($) => ({
|
|
732
|
+
...$.unit,
|
|
733
|
+
errors: $.errors
|
|
738
734
|
}))) || [],
|
|
739
|
-
update: ((J = I.importUpdateResult) == null ? void 0 : J.map((
|
|
740
|
-
|
|
741
|
-
errors:
|
|
735
|
+
update: ((J = I.importUpdateResult) == null ? void 0 : J.map(($) => ({
|
|
736
|
+
...$.unit,
|
|
737
|
+
errors: $.errors
|
|
742
738
|
}))) || []
|
|
743
739
|
} : (W = s.value) == null ? void 0 : W.units
|
|
744
740
|
});
|
|
745
741
|
break;
|
|
746
742
|
}
|
|
747
743
|
case "ingredient": {
|
|
748
|
-
const X = g.value.Sheets.ingredient, I = await
|
|
744
|
+
const X = g.value.Sheets.ingredient, I = await pt(X);
|
|
749
745
|
I && (s.value = {
|
|
750
746
|
...s.value,
|
|
751
747
|
_invalidExcel: I.invalidExcel || ((Q = s.value) == null ? void 0 : Q._invalidExcel),
|
|
752
748
|
_invalidExcelMessage: I.invalidExcelMessage || ((Y = s.value) == null ? void 0 : Y._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Ingredients sheet",
|
|
753
749
|
skus: I.importCreateResult || I.importUpdateResult ? {
|
|
754
|
-
create: ((K = I.importCreateResult) == null ? void 0 : K.map((
|
|
755
|
-
|
|
756
|
-
errors:
|
|
750
|
+
create: ((K = I.importCreateResult) == null ? void 0 : K.map(($) => ({
|
|
751
|
+
...$.sku,
|
|
752
|
+
errors: $.errors
|
|
757
753
|
}))) || [],
|
|
758
|
-
update: ((
|
|
759
|
-
|
|
760
|
-
errors:
|
|
754
|
+
update: ((F = I.importUpdateResult) == null ? void 0 : F.map(($) => ({
|
|
755
|
+
...$.sku,
|
|
756
|
+
errors: $.errors
|
|
761
757
|
}))) || []
|
|
762
758
|
} : (z = s.value) == null ? void 0 : z.skus
|
|
763
759
|
});
|
|
764
760
|
break;
|
|
765
761
|
}
|
|
766
762
|
case "recipe": {
|
|
767
|
-
const X = g.value.Sheets.recipe, I = await
|
|
763
|
+
const X = g.value.Sheets.recipe, I = await vt(X);
|
|
768
764
|
I && (s.value = {
|
|
769
765
|
...s.value,
|
|
770
766
|
_invalidExcel: I.invalidExcel || ((H = s.value) == null ? void 0 : H._invalidExcel),
|
|
771
767
|
_invalidExcelMessage: I.invalidExcelMessage || ((V = s.value) == null ? void 0 : V._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Recipes sheet",
|
|
772
768
|
recipes: I.importCreateResult || I.importUpdateResult ? {
|
|
773
|
-
create: ((O = I.importCreateResult) == null ? void 0 : O.map((
|
|
774
|
-
|
|
775
|
-
errors:
|
|
769
|
+
create: ((O = I.importCreateResult) == null ? void 0 : O.map(($) => ({
|
|
770
|
+
...$.recipe,
|
|
771
|
+
errors: $.errors
|
|
776
772
|
}))) || [],
|
|
777
|
-
update: ((de = I.importUpdateResult) == null ? void 0 : de.map((
|
|
778
|
-
|
|
779
|
-
errors:
|
|
773
|
+
update: ((de = I.importUpdateResult) == null ? void 0 : de.map(($) => ({
|
|
774
|
+
...$.recipe,
|
|
775
|
+
errors: $.errors
|
|
780
776
|
}))) || []
|
|
781
777
|
} : (ce = s.value) == null ? void 0 : ce.recipes
|
|
782
778
|
});
|
|
@@ -793,7 +789,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
793
789
|
}
|
|
794
790
|
}
|
|
795
791
|
async function fe() {
|
|
796
|
-
var m, t, k, j, J, W, Q, Y, K,
|
|
792
|
+
var m, t, k, j, J, W, Q, Y, K, F, z, H, V, O, de, ce, X, I, $, Ce, Ue, Ne, Ge, Te;
|
|
797
793
|
if (s.value) {
|
|
798
794
|
if (A.value) {
|
|
799
795
|
h.open({
|
|
@@ -815,51 +811,51 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
815
811
|
try {
|
|
816
812
|
let L = 0, se = "";
|
|
817
813
|
if (s.value.units && ((m = s.value.units.create) != null && m.length || (t = s.value.units.update) != null && t.length)) {
|
|
818
|
-
const
|
|
814
|
+
const M = {
|
|
819
815
|
create: ((k = s.value.units.create) == null ? void 0 : k.filter((v) => !v.errors || v.errors.length === 0)) || [],
|
|
820
816
|
update: ((j = s.value.units.update) == null ? void 0 : j.filter((v) => !v.errors || v.errors.length === 0)) || []
|
|
821
817
|
};
|
|
822
|
-
if (
|
|
823
|
-
const v = await _.importUnits(
|
|
818
|
+
if (M.create.length || M.update.length) {
|
|
819
|
+
const v = await _.importUnits(M);
|
|
824
820
|
((J = v == null ? void 0 : v.errors) == null ? void 0 : J.length) > 0 && p.value.push(...v.errors.map((ie) => ({
|
|
825
821
|
type: "units",
|
|
826
822
|
error: ie
|
|
827
823
|
})));
|
|
828
|
-
const ne =
|
|
824
|
+
const ne = M.create.length + M.update.length, oe = ((W = v == null ? void 0 : v.errors) == null ? void 0 : W.length) || 0;
|
|
829
825
|
L = ne - oe, se = "units", s.value = {
|
|
830
826
|
...s.value,
|
|
831
827
|
units: null
|
|
832
828
|
};
|
|
833
829
|
}
|
|
834
830
|
} else if (s.value.skus && ((Q = s.value.skus.create) != null && Q.length || (Y = s.value.skus.update) != null && Y.length)) {
|
|
835
|
-
const
|
|
831
|
+
const M = {
|
|
836
832
|
create: ((K = s.value.skus.create) == null ? void 0 : K.filter((v) => !v.errors || v.errors.length === 0)) || [],
|
|
837
|
-
update: ((
|
|
833
|
+
update: ((F = s.value.skus.update) == null ? void 0 : F.filter((v) => !v.errors || v.errors.length === 0)) || []
|
|
838
834
|
};
|
|
839
|
-
if (
|
|
840
|
-
const v = await _.importSkus(
|
|
835
|
+
if (M.create.length || M.update.length) {
|
|
836
|
+
const v = await _.importSkus(M);
|
|
841
837
|
((z = v == null ? void 0 : v.errors) == null ? void 0 : z.length) > 0 && p.value.push(...v.errors.map((ie) => ({
|
|
842
838
|
type: "ingredients",
|
|
843
839
|
error: ie
|
|
844
840
|
})));
|
|
845
|
-
const ne =
|
|
841
|
+
const ne = M.create.length + M.update.length, oe = ((H = v == null ? void 0 : v.errors) == null ? void 0 : H.length) || 0;
|
|
846
842
|
L = ne - oe, se = "ingredients", s.value = {
|
|
847
843
|
...s.value,
|
|
848
844
|
skus: null
|
|
849
845
|
};
|
|
850
846
|
}
|
|
851
847
|
} else if (s.value.recipes && ((V = s.value.recipes.create) != null && V.length || (O = s.value.recipes.update) != null && O.length)) {
|
|
852
|
-
const
|
|
848
|
+
const M = {
|
|
853
849
|
create: ((de = s.value.recipes.create) == null ? void 0 : de.filter((v) => !v.errors || v.errors.length === 0)) || [],
|
|
854
850
|
update: ((ce = s.value.recipes.update) == null ? void 0 : ce.filter((v) => !v.errors || v.errors.length === 0)) || []
|
|
855
851
|
};
|
|
856
|
-
if (
|
|
857
|
-
const v = await _.importRecipes(
|
|
852
|
+
if (M.create.length || M.update.length) {
|
|
853
|
+
const v = await _.importRecipes(M);
|
|
858
854
|
((X = v == null ? void 0 : v.errors) == null ? void 0 : X.length) > 0 && p.value.push(...v.errors.map((ie) => ({
|
|
859
855
|
type: "recipes",
|
|
860
856
|
error: ie
|
|
861
857
|
})));
|
|
862
|
-
const ne =
|
|
858
|
+
const ne = M.create.length + M.update.length, oe = ((I = v == null ? void 0 : v.errors) == null ? void 0 : I.length) || 0;
|
|
863
859
|
L = ne - oe, se = "recipes", s.value = {
|
|
864
860
|
...s.value,
|
|
865
861
|
recipes: null
|
|
@@ -867,10 +863,10 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
867
863
|
}
|
|
868
864
|
}
|
|
869
865
|
if (L > 0) {
|
|
870
|
-
const
|
|
871
|
-
|
|
866
|
+
const M = p.value.filter((v) => v.type === se);
|
|
867
|
+
M.length > 0 ? h.open({
|
|
872
868
|
title: e("inventory.common.importCompletedWithIssues"),
|
|
873
|
-
message: e("inventory.common.successfullyImported", [L, se,
|
|
869
|
+
message: e("inventory.common.successfullyImported", [L, se, M.length, se]),
|
|
874
870
|
type: "warning"
|
|
875
871
|
}) : h.open({
|
|
876
872
|
title: e("inventory.ingredient.import.success"),
|
|
@@ -880,10 +876,10 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
880
876
|
}
|
|
881
877
|
if (f.value.length > 0)
|
|
882
878
|
await me();
|
|
883
|
-
else if (!(s.value.units && (((
|
|
879
|
+
else if (!(s.value.units && ((($ = s.value.units.create) == null ? void 0 : $.length) || ((Ce = s.value.units.update) == null ? void 0 : Ce.length)) || s.value.skus && (((Ue = s.value.skus.create) == null ? void 0 : Ue.length) || ((Ne = s.value.skus.update) == null ? void 0 : Ne.length)) || s.value.recipes && (((Ge = s.value.recipes.create) == null ? void 0 : Ge.length) || ((Te = s.value.recipes.update) == null ? void 0 : Te.length))))
|
|
884
880
|
if (ue(), p.value.length > 0) {
|
|
885
881
|
const v = p.value.filter((pe) => pe.type === "units").length, ne = p.value.filter((pe) => pe.type === "ingredients").length, oe = p.value.filter((pe) => pe.type === "recipes").length, ie = v + ne + oe;
|
|
886
|
-
|
|
882
|
+
d.value = !0, h.open({
|
|
887
883
|
title: e("inventory.common.importCompletedWithIssues"),
|
|
888
884
|
message: e("inventory.common.importFinishedWithFailedItems", [ie, v, ne, oe]),
|
|
889
885
|
type: "warning"
|
|
@@ -906,13 +902,13 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
906
902
|
}
|
|
907
903
|
}
|
|
908
904
|
function ue() {
|
|
909
|
-
y.value = !1,
|
|
905
|
+
y.value = !1, d.value = !1, s.value = null, f.value = [], g.value = null;
|
|
910
906
|
}
|
|
911
907
|
function be() {
|
|
912
|
-
|
|
908
|
+
d.value = !1, p.value = [];
|
|
913
909
|
}
|
|
914
910
|
function he() {
|
|
915
|
-
|
|
911
|
+
c.value = !1, u.value = null;
|
|
916
912
|
}
|
|
917
913
|
const xe = q(() => [
|
|
918
914
|
{
|
|
@@ -921,7 +917,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
921
917
|
isPrimary: !1,
|
|
922
918
|
prependIcon: "upload"
|
|
923
919
|
}
|
|
924
|
-
]), _e =
|
|
920
|
+
]), _e = Me([
|
|
925
921
|
{
|
|
926
922
|
id: "name",
|
|
927
923
|
accessorKey: "name",
|
|
@@ -951,7 +947,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
951
947
|
return t === e("inventory.common.readyToImport") ? k += " bg-blue-100 text-blue-800 border border-blue-200" : t === "Imported" || t === "Successfully Imported" ? k += " bg-green-100 text-green-800 border border-green-200" : t === "Failed" ? k += " bg-red-100 text-red-800 border border-red-200" : t === e("inventory.common.validationFailed") ? k += " bg-orange-100 text-orange-800 border border-orange-200" : (t.includes("Invalid Excel"), k += " bg-red-100 text-red-800 border border-red-200"), we("div", { class: k, title: t }, t);
|
|
952
948
|
}
|
|
953
949
|
}
|
|
954
|
-
]),
|
|
950
|
+
]), Ee = Me([
|
|
955
951
|
{
|
|
956
952
|
id: "name",
|
|
957
953
|
accessorKey: "name",
|
|
@@ -980,7 +976,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
980
976
|
]);
|
|
981
977
|
return (m, t) => {
|
|
982
978
|
const k = ee("FmIcon"), j = ee("FmButton"), J = ee("FmTable"), W = ee("FmCard"), Q = ee("FmSideSheet"), Y = ee("FmSpinner");
|
|
983
|
-
return i(x).isLoaded && i(x).enableBulkImport ? (N(), ae(
|
|
979
|
+
return i(x).isLoaded && i(x).enableBulkImport ? (N(), ae(Se, {
|
|
984
980
|
key: 0,
|
|
985
981
|
title: i(e)("inventory.common.import"),
|
|
986
982
|
actions: xe.value,
|
|
@@ -998,37 +994,37 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
998
994
|
}
|
|
999
995
|
])
|
|
1000
996
|
}, [
|
|
1001
|
-
y.value ? te("", !0) : (N(), P("div",
|
|
1002
|
-
n("div",
|
|
997
|
+
y.value ? te("", !0) : (N(), P("div", kt, [
|
|
998
|
+
n("div", Rt, [
|
|
1003
999
|
B(k, {
|
|
1004
1000
|
name: "info",
|
|
1005
1001
|
class: "text-blue-600 mt-2"
|
|
1006
1002
|
}),
|
|
1007
|
-
n("div",
|
|
1008
|
-
n("div",
|
|
1009
|
-
n("div",
|
|
1010
|
-
n("div",
|
|
1003
|
+
n("div", Ct, [
|
|
1004
|
+
n("div", Ut, a(i(e)("inventory.ingredient.import.multiUploadTemplateInstruction")), 1),
|
|
1005
|
+
n("div", Nt, [
|
|
1006
|
+
n("div", Gt, [
|
|
1011
1007
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
|
|
1012
1008
|
]),
|
|
1013
1009
|
t[39] || (t[39] = E(" 1. ")),
|
|
1014
1010
|
n("span", {
|
|
1015
1011
|
innerHTML: i(e)("inventory.ingredient.import.importInstructions.step1")
|
|
1016
|
-
}, null, 8,
|
|
1012
|
+
}, null, 8, Tt),
|
|
1017
1013
|
t[40] || (t[40] = n("br", null, null, -1)),
|
|
1018
1014
|
t[41] || (t[41] = E(" 2. ")),
|
|
1019
1015
|
n("span", {
|
|
1020
1016
|
innerHTML: i(e)("inventory.ingredient.import.importInstructions.step2")
|
|
1021
|
-
}, null, 8,
|
|
1017
|
+
}, null, 8, Mt),
|
|
1022
1018
|
t[42] || (t[42] = n("br", null, null, -1)),
|
|
1023
1019
|
E(" 3. " + a(i(e)("inventory.ingredient.import.importInstructions.step3")), 1),
|
|
1024
1020
|
t[43] || (t[43] = n("br", null, null, -1)),
|
|
1025
1021
|
E(" 4. " + a(i(e)("inventory.ingredient.import.importInstructions.step4")), 1),
|
|
1026
1022
|
t[44] || (t[44] = n("br", null, null, -1)),
|
|
1027
1023
|
t[45] || (t[45] = n("br", null, null, -1)),
|
|
1028
|
-
n("div",
|
|
1024
|
+
n("div", Ft, [
|
|
1029
1025
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
|
|
1030
1026
|
]),
|
|
1031
|
-
n("div",
|
|
1027
|
+
n("div", $t, [
|
|
1032
1028
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.title")), 1),
|
|
1033
1029
|
E(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.description")), 1),
|
|
1034
1030
|
t[1] || (t[1] = n("br", null, null, -1)),
|
|
@@ -1050,7 +1046,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
1050
1046
|
t[12] || (t[12] = E(" • ")),
|
|
1051
1047
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col6")), 1)
|
|
1052
1048
|
]),
|
|
1053
|
-
n("div",
|
|
1049
|
+
n("div", Dt, [
|
|
1054
1050
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.title")), 1),
|
|
1055
1051
|
E(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.description")), 1),
|
|
1056
1052
|
t[13] || (t[13] = n("br", null, null, -1)),
|
|
@@ -1069,7 +1065,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
1069
1065
|
t[22] || (t[22] = E(" • ")),
|
|
1070
1066
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col5")), 1)
|
|
1071
1067
|
]),
|
|
1072
|
-
n("div",
|
|
1068
|
+
n("div", At, [
|
|
1073
1069
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.title")), 1),
|
|
1074
1070
|
E(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.description")), 1),
|
|
1075
1071
|
t[23] || (t[23] = n("br", null, null, -1)),
|
|
@@ -1097,22 +1093,22 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
1097
1093
|
t[38] || (t[38] = E(" • ")),
|
|
1098
1094
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col8")), 1)
|
|
1099
1095
|
]),
|
|
1100
|
-
n("div",
|
|
1096
|
+
n("div", Bt, [
|
|
1101
1097
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.warning")), 1)
|
|
1102
1098
|
])
|
|
1103
1099
|
])
|
|
1104
1100
|
])
|
|
1105
1101
|
])
|
|
1106
1102
|
])),
|
|
1107
|
-
y.value ? (N(), P("div",
|
|
1108
|
-
n("div",
|
|
1103
|
+
y.value ? (N(), P("div", Pt, [
|
|
1104
|
+
n("div", jt, [
|
|
1109
1105
|
n("div", null, [
|
|
1110
|
-
n("div",
|
|
1111
|
-
n("div",
|
|
1112
|
-
A.value ? (N(), P("span",
|
|
1106
|
+
n("div", Ot, a(i(e)("inventory.common.importPreview")), 1),
|
|
1107
|
+
n("div", Ht, [
|
|
1108
|
+
A.value ? (N(), P("span", zt, a(i(e)("inventory.common.errorExist")) + ": " + a(U.value), 1)) : C.value ? (N(), P("span", Kt, a(i(e)("inventory.common.someItemsValidationErrors")), 1)) : (N(), P("span", Wt, a(i(e)("inventory.common.allItemsValidReadyImport")), 1))
|
|
1113
1109
|
])
|
|
1114
1110
|
]),
|
|
1115
|
-
n("div",
|
|
1111
|
+
n("div", Vt, [
|
|
1116
1112
|
B(j, {
|
|
1117
1113
|
variant: "secondary",
|
|
1118
1114
|
onClick: ue,
|
|
@@ -1127,7 +1123,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
1127
1123
|
}, null, 8, ["loading", "disabled", "label"])
|
|
1128
1124
|
])
|
|
1129
1125
|
]),
|
|
1130
|
-
n("div",
|
|
1126
|
+
n("div", Lt, [
|
|
1131
1127
|
B(J, {
|
|
1132
1128
|
"column-defs": _e.value,
|
|
1133
1129
|
"row-data": b.value,
|
|
@@ -1138,13 +1134,13 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
1138
1134
|
}, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
|
|
1139
1135
|
])
|
|
1140
1136
|
])) : te("", !0),
|
|
1141
|
-
|
|
1142
|
-
n("div",
|
|
1137
|
+
d.value && p.value.length > 0 ? (N(), P("div", Jt, [
|
|
1138
|
+
n("div", Xt, [
|
|
1143
1139
|
n("div", null, [
|
|
1144
|
-
n("div",
|
|
1145
|
-
n("div",
|
|
1140
|
+
n("div", qt, a(i(e)("inventory.common.importErrors")), 1),
|
|
1141
|
+
n("div", Qt, a(p.value.length) + " " + a(i(e)("inventory.common.itemsFailedImport")), 1)
|
|
1146
1142
|
]),
|
|
1147
|
-
n("div",
|
|
1143
|
+
n("div", Yt, [
|
|
1148
1144
|
B(j, {
|
|
1149
1145
|
variant: "secondary",
|
|
1150
1146
|
onClick: be,
|
|
@@ -1152,9 +1148,9 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
1152
1148
|
}, null, 8, ["label"])
|
|
1153
1149
|
])
|
|
1154
1150
|
]),
|
|
1155
|
-
n("div",
|
|
1151
|
+
n("div", Zt, [
|
|
1156
1152
|
B(J, {
|
|
1157
|
-
"column-defs":
|
|
1153
|
+
"column-defs": Ee.value,
|
|
1158
1154
|
"row-data": T.value,
|
|
1159
1155
|
"page-size": r.value,
|
|
1160
1156
|
"search-value": o.value,
|
|
@@ -1165,14 +1161,14 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
1165
1161
|
])) : te("", !0)
|
|
1166
1162
|
], 2),
|
|
1167
1163
|
B(Q, {
|
|
1168
|
-
"model-value":
|
|
1169
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
1170
|
-
header: `${(K =
|
|
1164
|
+
"model-value": c.value,
|
|
1165
|
+
"onUpdate:modelValue": t[0] || (t[0] = (F) => c.value = F),
|
|
1166
|
+
header: `${(K = u.value) == null ? void 0 : K.type} Details`,
|
|
1171
1167
|
"max-width": 600,
|
|
1172
1168
|
"dismiss-away": ""
|
|
1173
1169
|
}, {
|
|
1174
1170
|
"side-sheet-footer": Z(() => [
|
|
1175
|
-
n("div",
|
|
1171
|
+
n("div", xn, [
|
|
1176
1172
|
B(j, {
|
|
1177
1173
|
label: i(e)("inventory.common.close"),
|
|
1178
1174
|
variant: "tertiary",
|
|
@@ -1181,55 +1177,55 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
1181
1177
|
])
|
|
1182
1178
|
]),
|
|
1183
1179
|
default: Z(() => [
|
|
1184
|
-
|
|
1180
|
+
u.value != null ? (N(), P("div", en, [
|
|
1185
1181
|
B(W, {
|
|
1186
1182
|
variant: "outlined",
|
|
1187
1183
|
class: "p-16"
|
|
1188
1184
|
}, {
|
|
1189
1185
|
default: Z(() => {
|
|
1190
|
-
var
|
|
1186
|
+
var F, z, H, V, O;
|
|
1191
1187
|
return [
|
|
1192
|
-
n("div",
|
|
1193
|
-
n("div",
|
|
1188
|
+
n("div", tn, a(i(e)("inventory.common.basicInformation")), 1),
|
|
1189
|
+
n("div", nn, [
|
|
1194
1190
|
n("div", null, [
|
|
1195
|
-
n("div",
|
|
1196
|
-
n("div",
|
|
1191
|
+
n("div", on, a(i(e)("inventory.common.name")), 1),
|
|
1192
|
+
n("div", rn, a(((z = (F = u.value) == null ? void 0 : F.details) == null ? void 0 : z.name) || ((H = u.value) == null ? void 0 : H.name)), 1)
|
|
1197
1193
|
]),
|
|
1198
|
-
(O = (V =
|
|
1199
|
-
n("div",
|
|
1200
|
-
n("div",
|
|
1194
|
+
(O = (V = u.value) == null ? void 0 : V.details) != null && O.code ? (N(), P("div", sn, [
|
|
1195
|
+
n("div", an, a(i(e)("inventory.common.code")), 1),
|
|
1196
|
+
n("div", ln, a(u.value.details.code), 1)
|
|
1201
1197
|
])) : te("", !0),
|
|
1202
1198
|
n("div", null, [
|
|
1203
|
-
n("div",
|
|
1204
|
-
n("div",
|
|
1199
|
+
n("div", mn, a(i(e)("inventory.common.type")), 1),
|
|
1200
|
+
n("div", un, a(u.value.type), 1)
|
|
1205
1201
|
]),
|
|
1206
1202
|
n("div", null, [
|
|
1207
|
-
n("div",
|
|
1208
|
-
n("div",
|
|
1203
|
+
n("div", dn, a(i(e)("inventory.common.operation")), 1),
|
|
1204
|
+
n("div", cn, a(u.value.operation), 1)
|
|
1209
1205
|
]),
|
|
1210
1206
|
n("div", null, [
|
|
1211
|
-
n("div",
|
|
1207
|
+
n("div", pn, a(i(e)("inventory.common.status")), 1),
|
|
1212
1208
|
n("div", {
|
|
1213
1209
|
class: ve([
|
|
1214
1210
|
"inline-block px-8 py-4 rounded text-sm",
|
|
1215
|
-
|
|
1211
|
+
u.value.status !== i(e)("inventory.common.readyToImport") ? "bg-red-100 text-red-800 border border-red-200" : "bg-green-100 text-green-800 border border-green-200"
|
|
1216
1212
|
])
|
|
1217
|
-
}, a(
|
|
1213
|
+
}, a(u.value.status), 3)
|
|
1218
1214
|
])
|
|
1219
1215
|
])
|
|
1220
1216
|
];
|
|
1221
1217
|
}),
|
|
1222
1218
|
_: 1
|
|
1223
1219
|
}),
|
|
1224
|
-
|
|
1220
|
+
u.value.errors && u.value.errors.length > 0 ? (N(), ae(W, {
|
|
1225
1221
|
key: 0,
|
|
1226
1222
|
variant: "outlined",
|
|
1227
1223
|
class: "p-16"
|
|
1228
1224
|
}, {
|
|
1229
1225
|
default: Z(() => [
|
|
1230
|
-
n("div",
|
|
1231
|
-
n("div",
|
|
1232
|
-
(N(!0), P(
|
|
1226
|
+
n("div", vn, a(i(e)("inventory.common.validationErrors")), 1),
|
|
1227
|
+
n("div", yn, [
|
|
1228
|
+
(N(!0), P(Ae, null, Be(u.value.errors, (F, z) => (N(), P("div", {
|
|
1233
1229
|
key: z,
|
|
1234
1230
|
class: "flex items-start gap-8 p-12 bg-red-50 border border-red-200 rounded"
|
|
1235
1231
|
}, [
|
|
@@ -1238,7 +1234,7 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
1238
1234
|
class: "text-red-600 mt-2",
|
|
1239
1235
|
size: "sm"
|
|
1240
1236
|
}),
|
|
1241
|
-
n("div",
|
|
1237
|
+
n("div", gn, a(F), 1)
|
|
1242
1238
|
]))), 128))
|
|
1243
1239
|
])
|
|
1244
1240
|
]),
|
|
@@ -1249,9 +1245,9 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
1249
1245
|
class: "p-16"
|
|
1250
1246
|
}, {
|
|
1251
1247
|
default: Z(() => [
|
|
1252
|
-
n("div",
|
|
1253
|
-
n("div",
|
|
1254
|
-
n("pre",
|
|
1248
|
+
n("div", fn, a(i(e)("inventory.common.rawData")), 1),
|
|
1249
|
+
n("div", bn, [
|
|
1250
|
+
n("pre", hn, a(JSON.stringify(u.value.details, null, 2)), 1)
|
|
1255
1251
|
])
|
|
1256
1252
|
]),
|
|
1257
1253
|
_: 1
|
|
@@ -1263,33 +1259,33 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
1263
1259
|
];
|
|
1264
1260
|
}),
|
|
1265
1261
|
_: 1
|
|
1266
|
-
}, 8, ["title", "actions"])) : i(x).isLoaded ? (N(), ae(
|
|
1262
|
+
}, 8, ["title", "actions"])) : i(x).isLoaded ? (N(), ae(Se, {
|
|
1267
1263
|
key: 2,
|
|
1268
1264
|
title: i(e)("inventory.common.import")
|
|
1269
1265
|
}, {
|
|
1270
1266
|
default: Z(() => [
|
|
1271
|
-
n("div",
|
|
1267
|
+
n("div", En, [
|
|
1272
1268
|
B(k, {
|
|
1273
1269
|
name: "block",
|
|
1274
1270
|
class: "text-gray-400",
|
|
1275
1271
|
size: "xl"
|
|
1276
1272
|
}),
|
|
1277
|
-
n("div",
|
|
1278
|
-
n("div",
|
|
1279
|
-
n("div",
|
|
1273
|
+
n("div", Sn, [
|
|
1274
|
+
n("div", kn, a(i(e)("inventory.common.featureNotAvailable")), 1),
|
|
1275
|
+
n("div", Rn, a(i(e)("inventory.common.bulkImportNotEnabled")), 1)
|
|
1280
1276
|
])
|
|
1281
1277
|
])
|
|
1282
1278
|
]),
|
|
1283
1279
|
_: 1
|
|
1284
|
-
}, 8, ["title"])) : (N(), ae(
|
|
1280
|
+
}, 8, ["title"])) : (N(), ae(Se, {
|
|
1285
1281
|
key: 1,
|
|
1286
1282
|
title: i(e)("inventory.common.import")
|
|
1287
1283
|
}, {
|
|
1288
1284
|
default: Z(() => [
|
|
1289
|
-
n("div",
|
|
1285
|
+
n("div", _n, [
|
|
1290
1286
|
B(Y, { size: "lg" }),
|
|
1291
|
-
n("div",
|
|
1292
|
-
n("div",
|
|
1287
|
+
n("div", wn, [
|
|
1288
|
+
n("div", In, a(i(e)("inventory.common.loading")), 1)
|
|
1293
1289
|
])
|
|
1294
1290
|
])
|
|
1295
1291
|
]),
|
|
@@ -1299,5 +1295,5 @@ const ft = { class: "flex flex-col gap-24" }, bt = { class: "flex flex-col gap-8
|
|
|
1299
1295
|
}
|
|
1300
1296
|
});
|
|
1301
1297
|
export {
|
|
1302
|
-
|
|
1298
|
+
Fn as default
|
|
1303
1299
|
};
|