@feedmepos/mf-inventory-portal 1.7.9-dev.2 → 1.7.9-dev.3
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-DownW83F.js +1434 -0
- package/dist/{ApprovalView-pmI_SFo7.js → ApprovalView-B5amT80y.js} +9 -9
- package/dist/{BindingsDialog-D902flPr.js → BindingsDialog-CEUoxncy.js} +2 -2
- package/dist/{BindingsPicker-JEKsY59b.js → BindingsPicker-Dw5JyYmq.js} +2 -2
- package/dist/{BindingsTable-DqlzOIxF.js → BindingsTable-dmxUVOtK.js} +4 -4
- package/dist/{BulkReceiveRequestView-Chw7ma2k.js → BulkReceiveRequestView-CY7UPaI2.js} +19 -19
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Cct8Ko19.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-imaNFowE.js} +1 -1
- package/dist/{ClosingDraftView-D1ymRsd2.js → ClosingDraftView-DYxcWU3G.js} +19 -19
- package/dist/{ClosingHistoryView-5yr_itIV.js → ClosingHistoryView-DAb7Pchk.js} +5 -5
- package/dist/{ClosingTemplateView-MDl5Zq-g.js → ClosingTemplateView-BQT2KXP8.js} +16 -16
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BcG0gWV4.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-UsXIW4vc.js} +1 -1
- package/dist/{DefaultView-dOfbL3iF.js → DefaultView-B9cjZltR.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-BfVgQOx8.js → DeliveryOrderPrintPreview-B6RRZ_xx.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-DHspOJQW.js → EmailDialog.vue_vue_type_script_setup_true_lang-6SAcd-Lu.js} +23 -23
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B7NLu0us.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BKIR8ZLY.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C0nunKjx.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CTivpMb5.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CMst9tkA.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-rVm8WLNZ.js} +2 -2
- package/dist/{FmMultiselectDialog-Dt54hvqw.js → FmMultiselectDialog-Bf4g4osy.js} +2 -2
- package/dist/{FmMultiselectDialog-BjBx94pY.js → FmMultiselectDialog-DBZYeMI9.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DtG9Ieo_.js → FmUnitInput.vue_vue_type_script_setup_true_lang-gf1UDVVJ.js} +6 -6
- package/dist/{ImportView-CdZN8k_Y.js → ImportView-CvTEgn9i.js} +499 -496
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-iCpYEneM.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-C_Ro5Q3e.js} +1 -1
- package/dist/{IngredientGroupView-BBVS1mKn.js → IngredientGroupView-BfQj9xKV.js} +5 -5
- package/dist/{IngredientsView-BGOaAUzR.js → IngredientsView-uISbT62R.js} +15 -15
- package/dist/{IntegrationExplorerView-UUBCmqdR.js → IntegrationExplorerView-0GXFfKHM.js} +4 -4
- package/dist/{IntegrationView-B2YowH-i.js → IntegrationView-6qKc8DLs.js} +14 -14
- package/dist/{InventoryBindingForm-kDx6Mvhn.js → InventoryBindingForm-Cg4xgKgC.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-C8bktmYH.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-B78sgTc8.js} +5 -5
- package/dist/{InventoryBindingSummary-DJrBTa8_.js → InventoryBindingSummary-CygEJTQk.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DHk9uEAP.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B9i4xUkA.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Dx1VktdW.js → PremiumBadge.vue_vue_type_script_setup_true_lang-IYfWAX3U.js} +1 -1
- package/dist/{ProductionView-CxUcsRBP.js → ProductionView-B9tfb0__.js} +7 -7
- package/dist/{PublishView-DtP-Ms7q.js → PublishView-DSz5DFu7.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-C_qC2KF5.js → PurchaseOrderPrintPreview-CVGcA1NI.js} +2 -2
- package/dist/{ReceiveRequestView-Dy3BpqsP.js → ReceiveRequestView-DweKCvrP.js} +14 -14
- package/dist/{RecipeView-DeR7pqj8.js → RecipeView-M1iR-IGf.js} +17 -17
- package/dist/{SettingsView-C7ZXmatO.js → SettingsView-wWaJ1hSv.js} +4 -4
- package/dist/{StockView-wFLnNSRr.js → StockView-RffrZC0S.js} +21 -21
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Fxh3-Nqi.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BC1aoZ4v.js} +1 -1
- package/dist/{SupplierView-CeTDNDDK.js → SupplierView-CEuRDvnA.js} +12 -12
- package/dist/{SurchargeView-BQJnCdPA.js → SurchargeView-CnZsFwuM.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-D1zxuH66.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DTz--8q9.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BFkh3Ubb.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-C5T6eC6g.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CZVDhXNz.js → TransferDetails.vue_vue_type_script_setup_true_lang-BWzeUGhD.js} +20 -20
- package/dist/{TransferTemplateView-XaI2T5fa.js → TransferTemplateView-BuUv4UwP.js} +20 -20
- package/dist/{UnitCostHistoryView-DTNW7-mk.js → UnitCostHistoryView-JpsZaM24.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-vRsEjVJc.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-Bt_Ydj8q.js} +4 -4
- package/dist/{UnitView-DXnyzkj3.js → UnitView-CDfmfOJd.js} +7 -7
- package/dist/{WarehouseView-iEHFgIqh.js → WarehouseView-CZJKpVYV.js} +5 -5
- package/dist/{WastageTemplateView-CGDUCPbr.js → WastageTemplateView-q0-8E264.js} +14 -14
- package/dist/api/changelog.d.ts +1 -1
- package/dist/{app-BIXJtvvD.js → app-806v4udw.js} +19 -15
- package/dist/app.d.ts +4 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-CLY-r6Cf.js → closing-template-1foridZ5.js} +1 -1
- package/dist/{date2-DbYQycSa.js → date2-D9lNDN0F.js} +1 -1
- package/dist/{dayjs.min-Dv7-fEed.js → dayjs.min-DU83C2ko.js} +1 -1
- package/dist/{decimal-B8YR17QC.js → decimal-C7jB4XJl.js} +2 -2
- package/dist/{defineDeepModel-C5ncgNxj.js → defineDeepModel-DBtE8i8j.js} +1 -1
- package/dist/{duplicate-template-CAlG1nzV.js → duplicate-template-C19hkOiT.js} +1 -1
- package/dist/{feature-BLSNLI5y.js → feature-DZXUs6TN.js} +2 -2
- package/dist/{format-time-from-id-D5DcWpHS.js → format-time-from-id-Yeedyd8O.js} +1 -1
- package/dist/{format-unit-display-Ch97dVXx.js → format-unit-display-D9AGU7Yr.js} +12 -12
- package/dist/{import-export.helper-CvUFSOa1.js → import-export.helper-DY1Vc5tk.js} +6 -6
- package/dist/{index-rRPErzP4.js → index-DBwfoE2e.js} +1 -1
- package/dist/{index-Bk8DOv4n.js → index-DXIyCaXQ.js} +1 -1
- package/dist/{index-CXzVUrJS.js → index-vAc_wEUQ.js} +3 -3
- package/dist/{inventory-core-dart.default-Cj7CxnpK.js → inventory-core-dart.default-C7P3Kz0T.js} +1 -1
- package/dist/{lz-string-DWkGPESZ.js → lz-string-CUIRjCEm.js} +1 -1
- package/dist/{netsuite-Cn0y1rH3.js → netsuite-Dd2pky4L.js} +2 -2
- package/dist/{number-CxbQxQwj.js → number-DTLt_eRR.js} +3 -3
- package/dist/{predefined-templates-CrSoG3R9.js → predefined-templates-V6hy-60C.js} +1 -1
- package/dist/{purchase-order-template-BmQQnrEl.js → purchase-order-template-FF9OAmuC.js} +1 -1
- package/dist/{recalculationUtils-CSnowXma.js → recalculationUtils-Cvf1yOQH.js} +1 -1
- package/dist/{rules-CurdOAcA.js → rules-DhlafJxm.js} +2 -2
- package/dist/{stock-BiqEgcgU.js → stock-BmFPsc4d.js} +3 -3
- package/dist/{stock-BdDR_L8p.js → stock-DBxX_D-9.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-CsjbmP_P.js → supplier-DH-sc9h0.js} +2 -2
- package/dist/{surcharge--kBjIIst.js → surcharge-BJ1QU6ll.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-D8UPS06O.js → uom-rules-B3-B6cp2.js} +1 -1
- package/dist/{use-ingredient-select-dialog-BZdrpLOE.js → use-ingredient-select-dialog-CK0RFvcL.js} +2 -2
- package/dist/{use-inventory-binding-dialog-CkNxixT2.js → use-inventory-binding-dialog-Cp5MGmpQ.js} +2 -2
- package/dist/{use-template-enabled-locations-Dkl1_1F-.js → use-template-enabled-locations-Cco8sx4I.js} +2 -2
- package/dist/{use-transfer-locations-Bmj4zTJj.js → use-transfer-locations-B3xCMiEX.js} +2 -2
- package/dist/{useHrmPermission-DcBe_-Q6.js → useHrmPermission-CqJ0E15x.js} +1 -1
- package/dist/{useNavigationMenu-CsRbtAc7.js → useNavigationMenu-BItQaHE7.js} +2 -2
- package/dist/{useSseClient-hl2SQF5b.js → useSseClient-CwVHj0zJ.js} +1 -1
- package/dist/views/changelog/composables/use-changelog.d.ts +2 -0
- package/dist/views/changelog/composables/use-changelog.spec.d.ts +1 -0
- package/dist/views/import/helper/submit-rows.d.ts +13 -0
- package/dist/views/import/helper/submit-rows.spec.d.ts +1 -0
- package/dist/{vue-i18n-yL99yI4f.js → vue-i18n-H3LGoV9N.js} +269 -269
- package/dist/{xlsx.util-B8azJxkS.js → xlsx.util-_HpAAREu.js} +2 -2
- package/package.json +3 -3
- package/dist/App-BYCW0L94.js +0 -1403
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useCoreStore as Re, useI18n as
|
|
4
|
-
import { useDialogChild as
|
|
5
|
-
import { u as
|
|
6
|
-
import { a as ie } from "./app-
|
|
7
|
-
import "./dayjs.min-
|
|
1
|
+
import { defineComponent as Te, ref as F, computed as L, watch as Be, resolveComponent as Q, createElementBlock as D, openBlock as T, createVNode as A, createCommentVNode as Y, unref as i, normalizeClass as ce, createSlots as Pe, withCtx as q, createElementVNode as n, createBlock as se, toDisplayString as a, Fragment as Me, renderList as $e, shallowRef as Ue, h as Ie, createTextVNode as C } from "vue";
|
|
2
|
+
import { u as je, _ as ke } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DwrLsWX_.js";
|
|
3
|
+
import { useCoreStore as Re, useI18n as Fe } from "@feedmepos/mf-common";
|
|
4
|
+
import { useDialogChild as Oe, useSnackbar as Ae, useDialog as He, useBreakpoints as ze } from "@feedmepos/ui-library";
|
|
5
|
+
import { u as Ke } from "./feature-DZXUs6TN.js";
|
|
6
|
+
import { a as ie } from "./app-806v4udw.js";
|
|
7
|
+
import "./dayjs.min-DU83C2ko.js";
|
|
8
8
|
import "./app-C39bYJmq.js";
|
|
9
9
|
import "./FmAdminBadge-DlplQOHb.js";
|
|
10
|
-
import { s as
|
|
11
|
-
import { s as
|
|
12
|
-
import { r as
|
|
13
|
-
import { c as
|
|
14
|
-
import { F as
|
|
10
|
+
import { s as De, a as Ve, d as We, t as Ce, r as Le } from "./xlsx.util-_HpAAREu.js";
|
|
11
|
+
import { s as Je, g as Xe, b as qe, d as Ge } from "./import-export.helper-DY1Vc5tk.js";
|
|
12
|
+
import { r as Qe } from "./random-CSbEbElR.js";
|
|
13
|
+
import { c as Ne, a as pe } from "./number-DTLt_eRR.js";
|
|
14
|
+
import { F as Ye } from "./FmDroppableField-J0tG_U3w.js";
|
|
15
15
|
function Ee() {
|
|
16
|
-
return `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${
|
|
16
|
+
return `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${Qe()}`;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Ze(U) {
|
|
19
19
|
const [
|
|
20
20
|
e,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
S,
|
|
22
|
+
y,
|
|
23
|
+
b,
|
|
24
|
+
k,
|
|
23
25
|
h,
|
|
24
|
-
E,
|
|
25
|
-
x,
|
|
26
26
|
...r
|
|
27
|
-
] =
|
|
28
|
-
if (!e || !e.length || e.some((
|
|
27
|
+
] = De(U);
|
|
28
|
+
if (!e || !e.length || e.some((c) => c.length && !c.startsWith("system:")))
|
|
29
29
|
throw new Error("Missing meta header. Excel file does not come from the template.");
|
|
30
|
-
const l = e.map((
|
|
30
|
+
const l = e.map((c) => c.split(":")[1]), u = ["name", "symbol", "precision"].filter((c) => !l.includes(c));
|
|
31
31
|
if (u.length)
|
|
32
32
|
throw new Error(
|
|
33
33
|
`Missing meta headers (${u.join()}). Excel file does not come from the template.`
|
|
34
34
|
);
|
|
35
|
-
return r.map((
|
|
36
|
-
const
|
|
35
|
+
return r.map((c, f) => {
|
|
36
|
+
const g = {};
|
|
37
37
|
for (const d in l) {
|
|
38
38
|
const o = l[d];
|
|
39
|
-
Object.assign(
|
|
39
|
+
Object.assign(g, { [o]: c[d] });
|
|
40
40
|
}
|
|
41
41
|
return {
|
|
42
|
-
index:
|
|
43
|
-
data:
|
|
42
|
+
index: f,
|
|
43
|
+
data: g
|
|
44
44
|
};
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function et(U) {
|
|
48
48
|
try {
|
|
49
|
-
const e =
|
|
50
|
-
const { name: l, symbol: s, precision: u, measurement_name:
|
|
51
|
-
return l || s || u ||
|
|
52
|
-
}),
|
|
49
|
+
const e = Ze(U).filter((r) => {
|
|
50
|
+
const { name: l, symbol: s, precision: u, measurement_name: p, measurement_symbol: c, measurement_conversion: f } = r.data;
|
|
51
|
+
return l || s || u || p || c || f;
|
|
52
|
+
}), y = ie().units, b = [], k = [], h = {};
|
|
53
53
|
for (const r of e)
|
|
54
54
|
if (r.data.name && r.data.symbol)
|
|
55
|
-
|
|
55
|
+
h[r.data.name] = {
|
|
56
56
|
unit: {
|
|
57
57
|
name: r.data.name,
|
|
58
58
|
abbrev: r.data.symbol,
|
|
@@ -60,33 +60,33 @@ function st(U) {
|
|
|
60
60
|
measurements: []
|
|
61
61
|
},
|
|
62
62
|
rowNumber: r.index
|
|
63
|
-
}, r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion &&
|
|
63
|
+
}, r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && h[r.data.name].unit.measurements.push({
|
|
64
64
|
id: Ee(),
|
|
65
65
|
name: r.data.measurement_name,
|
|
66
66
|
abbrev: r.data.measurement_symbol,
|
|
67
67
|
conversion: {
|
|
68
|
-
amount: Math.round(r.data.measurement_conversion * Math.pow(10,
|
|
69
|
-
precision:
|
|
68
|
+
amount: Math.round(r.data.measurement_conversion * Math.pow(10, h[r.data.name].unit.precision)),
|
|
69
|
+
precision: h[r.data.name].unit.precision
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
else {
|
|
73
|
-
const l = Object.keys(
|
|
74
|
-
l &&
|
|
73
|
+
const l = Object.keys(h)[Object.keys(h).length - 1];
|
|
74
|
+
l && h[l] && r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && h[l].unit.measurements.push({
|
|
75
75
|
id: Ee(),
|
|
76
76
|
name: r.data.measurement_name,
|
|
77
77
|
abbrev: r.data.measurement_symbol,
|
|
78
78
|
conversion: {
|
|
79
|
-
amount: Math.round(r.data.measurement_conversion * Math.pow(10,
|
|
80
|
-
precision:
|
|
79
|
+
amount: Math.round(r.data.measurement_conversion * Math.pow(10, h[l].unit.precision)),
|
|
80
|
+
precision: h[l].unit.precision
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
for (const [r, { unit: l, rowNumber: s }] of Object.entries(
|
|
85
|
-
const u =
|
|
86
|
-
var
|
|
87
|
-
return
|
|
84
|
+
for (const [r, { unit: l, rowNumber: s }] of Object.entries(h)) {
|
|
85
|
+
const u = y.find((p) => {
|
|
86
|
+
var c, f;
|
|
87
|
+
return p.abbrev === l.abbrev && ((c = p.name) == null ? void 0 : c.trim()) === ((f = l.name) == null ? void 0 : f.trim());
|
|
88
88
|
});
|
|
89
|
-
u ?
|
|
89
|
+
u ? k.push({
|
|
90
90
|
type: "update",
|
|
91
91
|
original: u,
|
|
92
92
|
unit: {
|
|
@@ -94,18 +94,18 @@ function st(U) {
|
|
|
94
94
|
name: l.name || u.name,
|
|
95
95
|
abbrev: l.abbrev || u.abbrev,
|
|
96
96
|
precision: l.precision !== void 0 ? l.precision : u.precision,
|
|
97
|
-
measurements: l.measurements.map((
|
|
98
|
-
const
|
|
99
|
-
return
|
|
97
|
+
measurements: l.measurements.map((p) => {
|
|
98
|
+
const c = u.measurements.find((f) => f.name === p.name && f.abbrev === p.abbrev);
|
|
99
|
+
return c ? { ...c, ...p, id: c.id } : { ...p, id: Ee() };
|
|
100
100
|
})
|
|
101
101
|
},
|
|
102
102
|
errors: [],
|
|
103
103
|
excelRowNumber: s
|
|
104
|
-
}) :
|
|
104
|
+
}) : b.push({
|
|
105
105
|
type: "create",
|
|
106
106
|
unit: {
|
|
107
107
|
...l,
|
|
108
|
-
measurements: l.measurements.map((
|
|
108
|
+
measurements: l.measurements.map((p) => ({ ...p, id: Ee() }))
|
|
109
109
|
},
|
|
110
110
|
errors: [],
|
|
111
111
|
excelRowNumber: s
|
|
@@ -113,8 +113,8 @@ function st(U) {
|
|
|
113
113
|
}
|
|
114
114
|
return {
|
|
115
115
|
invalidExcel: !1,
|
|
116
|
-
importCreateResult:
|
|
117
|
-
importUpdateResult:
|
|
116
|
+
importCreateResult: b,
|
|
117
|
+
importUpdateResult: k
|
|
118
118
|
};
|
|
119
119
|
} catch (e) {
|
|
120
120
|
return {
|
|
@@ -125,130 +125,130 @@ function st(U) {
|
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
var
|
|
128
|
+
function tt(U, { ignoreErrors: e = !1 } = {}) {
|
|
129
|
+
var S;
|
|
130
130
|
try {
|
|
131
|
-
const
|
|
131
|
+
const y = ie(), b = y.skuByCode, k = y.recipeByName, h = y.skuGroupById, r = y.skuGroups, l = y.units, s = [], u = {};
|
|
132
132
|
for (const o of U) {
|
|
133
|
-
const
|
|
134
|
-
let
|
|
133
|
+
const v = [];
|
|
134
|
+
let w = "";
|
|
135
135
|
if (o.data.type === "INGREDIENT") {
|
|
136
|
-
const
|
|
137
|
-
|
|
136
|
+
const I = b[o.data.code];
|
|
137
|
+
I ? w = I._id : v.push(`Ingredient with code '${o.data.code}' not found`);
|
|
138
138
|
} else if (o.data.type === "RECIPE") {
|
|
139
|
-
const
|
|
140
|
-
|
|
139
|
+
const I = k[o.data.name];
|
|
140
|
+
I ? w = I._id : v.push(`Recipe with name '${o.data.name}' not found`);
|
|
141
141
|
} else if (o.data.type === "SKU_GROUP") {
|
|
142
|
-
const
|
|
143
|
-
|
|
142
|
+
const I = r.find((E) => E.ref === o.data.code || E.name === o.data.name);
|
|
143
|
+
I ? w = I._id : v.push(`SKU Group with ref '${o.data.code}' or name '${o.data.name}' not found`);
|
|
144
144
|
} else
|
|
145
|
-
|
|
146
|
-
o.data.amount ||
|
|
147
|
-
let
|
|
148
|
-
if ((o.data.unit || o.data.baseUnit) && o.data.type !== "RECIPE" && o.data.type !== "SKU_GROUP" && (
|
|
149
|
-
var
|
|
150
|
-
return
|
|
151
|
-
}),
|
|
152
|
-
let
|
|
153
|
-
if (o.data.type === "RECIPE" || o.data.type === "SKU_GROUP" ?
|
|
145
|
+
v.push(`Invalid type '${o.data.type}'. Must be 'INGREDIENT', 'RECIPE', or 'SKU_GROUP'`);
|
|
146
|
+
o.data.amount || v.push(`Invalid amount '${o.data.amount}'. Must be a valid number`);
|
|
147
|
+
let N;
|
|
148
|
+
if ((o.data.unit || o.data.baseUnit) && o.data.type !== "RECIPE" && o.data.type !== "SKU_GROUP" && (N = l.find((I) => {
|
|
149
|
+
var E, Z;
|
|
150
|
+
return I.abbrev === o.data.baseUnit && ((E = I.name) == null ? void 0 : E.trim()) === ((Z = o.data.unit) == null ? void 0 : Z.trim());
|
|
151
|
+
}), N || (o.data.baseUnit && o.data.unit ? v.push(`Cannot find unit with symbol '${o.data.baseUnit}' and name '${o.data.unit}'`) : o.data.baseUnit ? v.push(`Cannot find unit with symbol '${o.data.baseUnit}'`) : o.data.unit && v.push(`Cannot find unit with name '${o.data.unit}'`))), v.length > 0 && s.push(`Row ${o.index + 6}: ${v.join(", ")}`), e || v.length === 0) {
|
|
152
|
+
let I;
|
|
153
|
+
if (o.data.type === "RECIPE" || o.data.type === "SKU_GROUP" ? I = void 0 : I = (S = N == null ? void 0 : N.measurements) == null ? void 0 : S.find((E) => E.abbrev === o.data.measurementName), o.data.recipeName)
|
|
154
154
|
u[o.data.recipeName] = {
|
|
155
155
|
name: o.data.recipeName,
|
|
156
|
-
customAttributes: o.data.customAttributes ?
|
|
156
|
+
customAttributes: o.data.customAttributes ? Je(o.data.customAttributes) : {},
|
|
157
157
|
contains: [{
|
|
158
158
|
type: o.data.type === "INGREDIENT" ? "SKU" : o.data.type,
|
|
159
|
-
id:
|
|
160
|
-
amount:
|
|
161
|
-
measurement:
|
|
159
|
+
id: w,
|
|
160
|
+
amount: Ne(+o.data.amount),
|
|
161
|
+
measurement: I || void 0
|
|
162
162
|
}]
|
|
163
|
-
}, s[o.data.recipeName] =
|
|
163
|
+
}, s[o.data.recipeName] = v.length > 0 ? `Row ${o.index + 6}: ${v.join(", ")}` : [];
|
|
164
164
|
else {
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
...u[
|
|
165
|
+
const E = Object.keys(u)[Object.keys(u).length - 1];
|
|
166
|
+
E && u[E] && (u[E] = {
|
|
167
|
+
...u[E],
|
|
168
168
|
contains: [
|
|
169
|
-
...u[
|
|
169
|
+
...u[E].contains,
|
|
170
170
|
{
|
|
171
171
|
type: o.data.type === "INGREDIENT" ? "SKU" : o.data.type,
|
|
172
|
-
id:
|
|
173
|
-
amount:
|
|
174
|
-
measurement:
|
|
172
|
+
id: w,
|
|
173
|
+
amount: Ne(+o.data.amount),
|
|
174
|
+
measurement: I || void 0
|
|
175
175
|
}
|
|
176
176
|
]
|
|
177
|
-
}, s[
|
|
177
|
+
}, s[E] = v.length > 0 ? s[E] ? `${s[E]}, Row ${o.index + 6}: ${v.join(", ")}` : `Row ${o.index + 6}: ${v.join(", ")}` : []);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
const
|
|
181
|
+
const p = Object.values(u), c = p.filter((o) => !k[o.name]), f = p.filter((o) => k[o.name]), g = c.map((o, v) => ({
|
|
182
182
|
type: "create",
|
|
183
183
|
recipe: o,
|
|
184
184
|
// Type assertion - _id will be assigned by backend
|
|
185
185
|
errors: s[o.name],
|
|
186
|
-
excelRowNumber:
|
|
186
|
+
excelRowNumber: v + 6
|
|
187
187
|
// Assuming header rows
|
|
188
|
-
})), d =
|
|
189
|
-
const
|
|
188
|
+
})), d = f.map((o, v) => {
|
|
189
|
+
const w = k[o.name];
|
|
190
190
|
return {
|
|
191
191
|
type: "update",
|
|
192
|
-
original:
|
|
192
|
+
original: w,
|
|
193
193
|
recipe: {
|
|
194
|
-
...
|
|
195
|
-
name: o.name ||
|
|
196
|
-
contains: o.contains.length > 0 ? o.contains :
|
|
197
|
-
customAttributes: o.customAttributes ||
|
|
194
|
+
...w,
|
|
195
|
+
name: o.name || w.name,
|
|
196
|
+
contains: o.contains.length > 0 ? o.contains : w.contains,
|
|
197
|
+
customAttributes: o.customAttributes || w.customAttributes
|
|
198
198
|
},
|
|
199
199
|
errors: s[o.name],
|
|
200
|
-
excelRowNumber:
|
|
200
|
+
excelRowNumber: v + 6
|
|
201
201
|
};
|
|
202
202
|
});
|
|
203
203
|
return {
|
|
204
204
|
invalidExcel: s.length > 0,
|
|
205
205
|
invalidExcelMessage: s.length > 0 ? `Import completed with ${s.length} error(s): ${s.join("; ")}` : void 0,
|
|
206
|
-
importCreateResult:
|
|
206
|
+
importCreateResult: g,
|
|
207
207
|
importUpdateResult: d
|
|
208
208
|
};
|
|
209
|
-
} catch (
|
|
209
|
+
} catch (y) {
|
|
210
210
|
return {
|
|
211
211
|
invalidExcel: !0,
|
|
212
|
-
invalidExcelMessage:
|
|
212
|
+
invalidExcelMessage: y instanceof Error ? y.message : "Unknown error occurred",
|
|
213
213
|
importCreateResult: [],
|
|
214
214
|
importUpdateResult: []
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function nt(U) {
|
|
219
219
|
const [
|
|
220
220
|
e,
|
|
221
|
-
|
|
222
|
-
|
|
221
|
+
S,
|
|
222
|
+
y,
|
|
223
|
+
b,
|
|
224
|
+
k,
|
|
223
225
|
h,
|
|
224
|
-
E,
|
|
225
|
-
x,
|
|
226
226
|
...r
|
|
227
|
-
] =
|
|
228
|
-
if (!e || !e.length || e.some((
|
|
227
|
+
] = De(U);
|
|
228
|
+
if (!e || !e.length || e.some((c) => c.length && !c.startsWith("system:")))
|
|
229
229
|
throw new Error("Missing meta header. Excel file does not come from the template.");
|
|
230
|
-
const l = e.map((
|
|
230
|
+
const l = e.map((c) => c.split(":")[1]), u = ["code", "recipeName", "unit", "baseUnit", "type", "amount"].filter((c) => !l.includes(c));
|
|
231
231
|
if (u.length)
|
|
232
232
|
throw new Error(
|
|
233
233
|
`Missing meta headers (${u.join()}). Excel file does not come from the template.`
|
|
234
234
|
);
|
|
235
|
-
return r.map((
|
|
236
|
-
const
|
|
235
|
+
return r.map((c, f) => {
|
|
236
|
+
const g = {};
|
|
237
237
|
for (const d in l) {
|
|
238
238
|
const o = l[d];
|
|
239
|
-
Object.assign(
|
|
239
|
+
Object.assign(g, { [o]: c[d] });
|
|
240
240
|
}
|
|
241
241
|
return {
|
|
242
|
-
index:
|
|
243
|
-
data:
|
|
242
|
+
index: f,
|
|
243
|
+
data: g
|
|
244
244
|
};
|
|
245
|
-
}).filter((
|
|
246
|
-
const { recipeName:
|
|
247
|
-
return
|
|
245
|
+
}).filter((c) => {
|
|
246
|
+
const { recipeName: f, type: g, code: d, name: o, amount: v, unit: w, baseUnit: N, measurementName: I, customAttributes: E } = c.data;
|
|
247
|
+
return f || g || d || o || v || w || N || I || E;
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
const e = Re().currentBusiness.value,
|
|
250
|
+
function ot() {
|
|
251
|
+
const e = Re().currentBusiness.value, S = ie(), y = [
|
|
252
252
|
{ id: "name", name: "Unit Name" },
|
|
253
253
|
{ id: "symbol", name: "Symbol" },
|
|
254
254
|
{ id: "precision", name: "Precision" },
|
|
@@ -256,10 +256,10 @@ function lt() {
|
|
|
256
256
|
{ id: "measurement_symbol", name: "Measurement Symbol" },
|
|
257
257
|
{ id: "measurement_conversion", name: "Measurement Conversion" }
|
|
258
258
|
];
|
|
259
|
-
let
|
|
260
|
-
|
|
259
|
+
let b = [];
|
|
260
|
+
S.units.length > 0 ? S.units.forEach((r) => {
|
|
261
261
|
if (r.measurements.length === 0)
|
|
262
|
-
|
|
262
|
+
b.push([
|
|
263
263
|
r.name,
|
|
264
264
|
r.abbrev,
|
|
265
265
|
r.precision,
|
|
@@ -268,7 +268,7 @@ function lt() {
|
|
|
268
268
|
""
|
|
269
269
|
]);
|
|
270
270
|
else {
|
|
271
|
-
|
|
271
|
+
b.push([
|
|
272
272
|
r.name,
|
|
273
273
|
r.abbrev,
|
|
274
274
|
r.precision,
|
|
@@ -277,7 +277,7 @@ function lt() {
|
|
|
277
277
|
+pe(r.measurements[0].conversion)
|
|
278
278
|
]);
|
|
279
279
|
for (let l = 1; l < r.measurements.length; l++)
|
|
280
|
-
|
|
280
|
+
b.push([
|
|
281
281
|
"",
|
|
282
282
|
"",
|
|
283
283
|
"",
|
|
@@ -286,7 +286,7 @@ function lt() {
|
|
|
286
286
|
+pe(r.measurements[l].conversion)
|
|
287
287
|
]);
|
|
288
288
|
}
|
|
289
|
-
}) :
|
|
289
|
+
}) : b = [
|
|
290
290
|
["Length", "m", 2, "Meter", "m", 1],
|
|
291
291
|
["", "", "", "Centimeter", "cm", 0.01],
|
|
292
292
|
["", "", "", "Millimeter", "mm", 1e-3],
|
|
@@ -294,48 +294,48 @@ function lt() {
|
|
|
294
294
|
["", "", "", "Gram", "g", 1e-3],
|
|
295
295
|
["", "", "", "Pound", "lb", 0.453592]
|
|
296
296
|
];
|
|
297
|
-
const
|
|
297
|
+
const k = [
|
|
298
298
|
["Business name:", e == null ? void 0 : e.name],
|
|
299
299
|
["Business ID:", e == null ? void 0 : e._id],
|
|
300
300
|
["Menu version", e == null ? void 0 : e.menuVersion],
|
|
301
301
|
[],
|
|
302
|
-
|
|
303
|
-
...
|
|
304
|
-
],
|
|
305
|
-
return Ce(
|
|
302
|
+
y.map((r) => r.name),
|
|
303
|
+
...b
|
|
304
|
+
], h = y.map((r) => `system:${r.id}`);
|
|
305
|
+
return Ce(k, h);
|
|
306
306
|
}
|
|
307
|
-
function
|
|
308
|
-
const e = Re().currentBusiness.value,
|
|
309
|
-
let
|
|
310
|
-
|
|
311
|
-
var l, s, u,
|
|
307
|
+
function rt() {
|
|
308
|
+
const e = Re().currentBusiness.value, S = ie(), y = qe();
|
|
309
|
+
let b = [];
|
|
310
|
+
S.skus.length > 0 ? b = S.skus.map((r) => {
|
|
311
|
+
var l, s, u, p, c, f, g, d;
|
|
312
312
|
return [
|
|
313
313
|
r.code,
|
|
314
314
|
r.name,
|
|
315
315
|
((l = r.unit) == null ? void 0 : l.name) || "",
|
|
316
316
|
((s = r.unit) == null ? void 0 : s.abbrev) || "",
|
|
317
|
-
((
|
|
317
|
+
((p = (u = r.unit) == null ? void 0 : u.measurements.find((o) => o.id === r.trackingMeasurement)) == null ? void 0 : p.abbrev) ?? r.unit.abbrev,
|
|
318
318
|
r.valuation || "WAVG",
|
|
319
|
-
(
|
|
320
|
-
((
|
|
321
|
-
((d = r.thresholds) == null ? void 0 : d.mid) ??
|
|
322
|
-
r.customAttributes ? Object.entries(r.customAttributes).map(([o,
|
|
319
|
+
(c = r.defaultCost) != null && c.costPerUnit ? +pe((f = r.defaultCost) == null ? void 0 : f.costPerUnit) : 0,
|
|
320
|
+
((g = r.thresholds) == null ? void 0 : g.low) ?? Ge().low,
|
|
321
|
+
((d = r.thresholds) == null ? void 0 : d.mid) ?? Ge().mid,
|
|
322
|
+
r.customAttributes ? Object.entries(r.customAttributes).map(([o, v]) => `${o}:${v}`).join("|") : ""
|
|
323
323
|
];
|
|
324
|
-
}) :
|
|
324
|
+
}) : b = [
|
|
325
325
|
["EXAMPLE_CODE", "Example Ingredient", "kg", "kg", "Unit Name", "WAVG", 10.5, 5, 10, ""]
|
|
326
326
|
];
|
|
327
|
-
const
|
|
327
|
+
const k = [
|
|
328
328
|
["Business name:", e == null ? void 0 : e.name],
|
|
329
329
|
["Business ID:", e == null ? void 0 : e._id],
|
|
330
330
|
["Menu version", e == null ? void 0 : e.menuVersion],
|
|
331
331
|
[],
|
|
332
|
-
|
|
333
|
-
...
|
|
334
|
-
],
|
|
335
|
-
return Ce(
|
|
332
|
+
y.map((r) => r.name),
|
|
333
|
+
...b
|
|
334
|
+
], h = y.map((r) => `system:${r.id}`);
|
|
335
|
+
return Ce(k, h);
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
const e = Re().currentBusiness.value,
|
|
337
|
+
function st() {
|
|
338
|
+
const e = Re().currentBusiness.value, S = ie(), y = [
|
|
339
339
|
{ id: "recipeName", name: "Recipe Name" },
|
|
340
340
|
{ id: "type", name: "Type" },
|
|
341
341
|
{ id: "code", name: "Code" },
|
|
@@ -346,58 +346,58 @@ function ut() {
|
|
|
346
346
|
{ id: "measurementName", name: "Measurement Symbol" },
|
|
347
347
|
{ id: "customAttributes", name: "Custom Attributes" }
|
|
348
348
|
];
|
|
349
|
-
let
|
|
350
|
-
if (
|
|
351
|
-
const r =
|
|
352
|
-
|
|
353
|
-
var
|
|
354
|
-
const
|
|
355
|
-
if ((
|
|
356
|
-
const
|
|
349
|
+
let b = [];
|
|
350
|
+
if (S.recipes.length > 0) {
|
|
351
|
+
const r = S.recipeById, l = S.skuById, s = S.skuGroupById;
|
|
352
|
+
b = S.recipes.flatMap((u) => {
|
|
353
|
+
var c;
|
|
354
|
+
const p = u.customAttributes ? Object.entries(u.customAttributes).map(([f, g]) => `${f}:${g}`).join("|") : "";
|
|
355
|
+
if ((c = u.contains) != null && c.length) {
|
|
356
|
+
const f = u.contains.filter((o) => o.type === "RECIPE"), g = u.contains.filter((o) => o.type === "SKU"), d = u.contains.filter((o) => o.type === "SKU_GROUP");
|
|
357
357
|
return [
|
|
358
|
-
...
|
|
359
|
-
var
|
|
358
|
+
...f.map((o, v) => {
|
|
359
|
+
var w;
|
|
360
360
|
return [
|
|
361
|
-
|
|
361
|
+
v === 0 ? u.name : "",
|
|
362
362
|
"RECIPE",
|
|
363
363
|
"",
|
|
364
|
-
((
|
|
364
|
+
((w = r[o.id]) == null ? void 0 : w.name) || "",
|
|
365
365
|
o.amount.amount,
|
|
366
366
|
"",
|
|
367
367
|
"unit",
|
|
368
368
|
"Unit",
|
|
369
|
-
|
|
369
|
+
v === 0 ? p : ""
|
|
370
370
|
];
|
|
371
371
|
}),
|
|
372
|
-
...
|
|
373
|
-
var
|
|
372
|
+
...g.map((o, v) => {
|
|
373
|
+
var w, N, I, E, Z, ve, ye, ge, fe, ae, be, le, he, xe, _e, we;
|
|
374
374
|
return [
|
|
375
|
-
!
|
|
375
|
+
!f.length && v === 0 ? u.name : "",
|
|
376
376
|
"INGREDIENT",
|
|
377
|
-
((
|
|
378
|
-
((
|
|
377
|
+
((w = l[o.id]) == null ? void 0 : w.code) || "",
|
|
378
|
+
((N = l[o.id]) == null ? void 0 : N.name) || "",
|
|
379
379
|
+pe(o.amount),
|
|
380
|
-
o.measurement ? ((
|
|
380
|
+
o.measurement ? ((E = (I = l[o.id]) == null ? void 0 : I.unit) == null ? void 0 : E.name) || "" : ((ve = (Z = l[o.id]) == null ? void 0 : Z.unit) == null ? void 0 : ve.name) || "",
|
|
381
381
|
o.measurement ? ((ge = (ye = l[o.id]) == null ? void 0 : ye.unit) == null ? void 0 : ge.abbrev) || "" : ((ae = (fe = l[o.id]) == null ? void 0 : fe.unit) == null ? void 0 : ae.abbrev) || "",
|
|
382
382
|
o.measurement ? o.measurement.abbrev : ((xe = (he = (le = (be = l[o.id]) == null ? void 0 : be.unit) == null ? void 0 : le.measurements) == null ? void 0 : he.find((Se) => {
|
|
383
383
|
var m;
|
|
384
384
|
return Se.id === ((m = l[o.id]) == null ? void 0 : m.trackingMeasurement);
|
|
385
385
|
})) == null ? void 0 : xe.abbrev) || ((we = (_e = l[o.id]) == null ? void 0 : _e.unit) == null ? void 0 : we.abbrev) || "",
|
|
386
|
-
!
|
|
386
|
+
!f.length && v === 0 ? p : ""
|
|
387
387
|
];
|
|
388
388
|
}),
|
|
389
|
-
...d.map((o,
|
|
390
|
-
var
|
|
389
|
+
...d.map((o, v) => {
|
|
390
|
+
var w, N;
|
|
391
391
|
return [
|
|
392
|
-
|
|
392
|
+
f.length === 0 && g.length === 0 && v === 0 ? u.name : "",
|
|
393
393
|
"SKU_GROUP",
|
|
394
|
-
((
|
|
395
|
-
((
|
|
394
|
+
((w = s[o.id]) == null ? void 0 : w.ref) || "",
|
|
395
|
+
((N = s[o.id]) == null ? void 0 : N.name) || "",
|
|
396
396
|
+pe(o.amount),
|
|
397
397
|
"",
|
|
398
398
|
"unit",
|
|
399
399
|
"Unit",
|
|
400
|
-
|
|
400
|
+
f.length === 0 && g.length === 0 && v === 0 ? p : ""
|
|
401
401
|
];
|
|
402
402
|
})
|
|
403
403
|
];
|
|
@@ -405,153 +405,156 @@ function ut() {
|
|
|
405
405
|
return [];
|
|
406
406
|
});
|
|
407
407
|
} else
|
|
408
|
-
|
|
408
|
+
b = [
|
|
409
409
|
["Pizza Dough", "INGREDIENT", "FLOUR001", "Flour", "500", "Weight", "g", "Gram", "difficulty:easy, category:italian"],
|
|
410
410
|
["", "INGREDIENT", "WATER001", "Water", "300", "Volume", "ml", "Milliliter", ""],
|
|
411
411
|
["", "INGREDIENT", "SALT001", "Salt", "10", "Weight", "g", "Gram", ""]
|
|
412
412
|
];
|
|
413
|
-
const
|
|
413
|
+
const k = [
|
|
414
414
|
["Business name:", e == null ? void 0 : e.name],
|
|
415
415
|
["Business ID:", e == null ? void 0 : e._id],
|
|
416
416
|
["Menu version", e == null ? void 0 : e.menuVersion],
|
|
417
417
|
[],
|
|
418
|
-
|
|
419
|
-
...
|
|
420
|
-
],
|
|
421
|
-
return Ce(
|
|
418
|
+
y.map((r) => r.name),
|
|
419
|
+
...b
|
|
420
|
+
], h = y.map((r) => `system:${r.id}`);
|
|
421
|
+
return Ce(k, h);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
424
|
-
const U =
|
|
425
|
-
unit:
|
|
426
|
-
ingredient:
|
|
427
|
-
recipe:
|
|
423
|
+
function it() {
|
|
424
|
+
const U = Ve({
|
|
425
|
+
unit: ot(),
|
|
426
|
+
ingredient: rt(),
|
|
427
|
+
recipe: st()
|
|
428
428
|
}), e = "FeedMe comprehensive template.xlsx";
|
|
429
|
-
return
|
|
429
|
+
return We(U, e), e;
|
|
430
430
|
}
|
|
431
|
-
async function
|
|
431
|
+
async function at(U) {
|
|
432
432
|
if (!U) return null;
|
|
433
433
|
try {
|
|
434
|
-
return
|
|
434
|
+
return et(U);
|
|
435
435
|
} catch (e) {
|
|
436
436
|
throw console.error("Error in processUnitsSheet:", e), e;
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
|
-
async function
|
|
439
|
+
async function lt(U) {
|
|
440
440
|
if (!U) return null;
|
|
441
441
|
try {
|
|
442
|
-
return
|
|
442
|
+
return Xe(U);
|
|
443
443
|
} catch (e) {
|
|
444
444
|
throw console.error("Error in processIngredientsSheet:", e), e;
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
|
-
async function
|
|
447
|
+
async function mt(U) {
|
|
448
448
|
if (!U) return null;
|
|
449
449
|
try {
|
|
450
|
-
const e =
|
|
451
|
-
return
|
|
450
|
+
const e = nt(U);
|
|
451
|
+
return tt(e, { ignoreErrors: !0 });
|
|
452
452
|
} catch (e) {
|
|
453
453
|
throw console.error("Error in processRecipesSheet:", e), e;
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
|
|
456
|
+
function re(U) {
|
|
457
|
+
return (U ?? []).filter((e) => !e.errors || e.errors.length === 0).map(({ errors: e, ...S }) => S);
|
|
458
|
+
}
|
|
459
|
+
const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8" }, ct = { class: "flex flex-col flex-1 gap-4" }, pt = { class: "fm-typo-en-body-md-600" }, vt = {
|
|
457
460
|
key: 2,
|
|
458
461
|
class: "shrink-0"
|
|
459
|
-
},
|
|
462
|
+
}, yt = {
|
|
460
463
|
key: 0,
|
|
461
464
|
class: "flex flex-col"
|
|
462
|
-
},
|
|
465
|
+
}, gt = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, ft = {
|
|
463
466
|
key: 0,
|
|
464
467
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
465
|
-
},
|
|
468
|
+
}, bt = { class: "fm-typo-en-body-lg-600" }, ht = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, xt = /* @__PURE__ */ Te({
|
|
466
469
|
__name: "ImportDialog",
|
|
467
470
|
setup(U) {
|
|
468
|
-
const e = F(null),
|
|
469
|
-
|
|
470
|
-
const
|
|
471
|
-
async function
|
|
472
|
-
|
|
471
|
+
const e = F(null), S = Oe();
|
|
472
|
+
Ae();
|
|
473
|
+
const y = F(!1), b = F(new Array()), k = F(null), h = F([]), r = F([]), l = L(() => !!b.value.length), s = L(() => !!k.value && h.value.length > 0), { t: u } = Fe();
|
|
474
|
+
async function p(g) {
|
|
475
|
+
b.value = [], k.value = null, h.value = [], r.value = [];
|
|
473
476
|
try {
|
|
474
|
-
|
|
477
|
+
y.value = !0;
|
|
475
478
|
const [d] = await Promise.all([
|
|
476
|
-
|
|
479
|
+
Le(g),
|
|
477
480
|
// fake buffer for UX
|
|
478
481
|
new Promise((o) => setTimeout(o, 1e3))
|
|
479
482
|
]);
|
|
480
|
-
|
|
483
|
+
k.value = d, c();
|
|
481
484
|
} catch (d) {
|
|
482
|
-
console.error("Error parsing Excel file:", d),
|
|
485
|
+
console.error("Error parsing Excel file:", d), b.value.push((d == null ? void 0 : d.message) || "Unknown error occurred");
|
|
483
486
|
} finally {
|
|
484
|
-
|
|
487
|
+
y.value = !1;
|
|
485
488
|
}
|
|
486
489
|
}
|
|
487
|
-
function
|
|
488
|
-
if (
|
|
489
|
-
const d = ["unit", "ingredient", "recipe"].filter((o) =>
|
|
490
|
+
function c() {
|
|
491
|
+
if (b.value = [], !k.value) return;
|
|
492
|
+
const d = ["unit", "ingredient", "recipe"].filter((o) => k.value.Sheets[o]);
|
|
490
493
|
if (d.length === 0) {
|
|
491
|
-
|
|
494
|
+
b.value.push("No valid sheets found. Expected sheets: unit, ingredient, or recipe");
|
|
492
495
|
return;
|
|
493
496
|
}
|
|
494
|
-
|
|
497
|
+
h.value = d, S.emitData({ availableSheets: d, workbook: k.value });
|
|
495
498
|
}
|
|
496
|
-
|
|
497
|
-
|
|
499
|
+
Be(e, (g) => {
|
|
500
|
+
g && p(g);
|
|
498
501
|
});
|
|
499
|
-
function
|
|
500
|
-
if (!
|
|
501
|
-
const
|
|
502
|
-
return
|
|
502
|
+
function f() {
|
|
503
|
+
if (!k.value || h.value.length === 0) return "";
|
|
504
|
+
const g = [];
|
|
505
|
+
return h.value.forEach((d) => {
|
|
503
506
|
switch (d) {
|
|
504
507
|
case "unit":
|
|
505
|
-
|
|
508
|
+
g.push("Units sheet found");
|
|
506
509
|
break;
|
|
507
510
|
case "ingredient":
|
|
508
|
-
|
|
511
|
+
g.push("Ingredients sheet found");
|
|
509
512
|
break;
|
|
510
513
|
case "recipe":
|
|
511
|
-
|
|
514
|
+
g.push("Recipes sheet found");
|
|
512
515
|
break;
|
|
513
516
|
}
|
|
514
|
-
}),
|
|
517
|
+
}), g.length > 0 ? `Ready to process: ${g.join(", ")}. Processing will follow dependency order.` : "No valid sheets found";
|
|
515
518
|
}
|
|
516
|
-
return (
|
|
517
|
-
const o =
|
|
518
|
-
return
|
|
519
|
-
A(
|
|
519
|
+
return (g, d) => {
|
|
520
|
+
const o = Q("FmCircularProgress"), v = Q("FmIcon"), w = Q("FmButton");
|
|
521
|
+
return T(), D("div", ut, [
|
|
522
|
+
A(Ye, {
|
|
520
523
|
class: ce({
|
|
521
524
|
"w-full": !0,
|
|
522
525
|
"h-[200px]": !e.value
|
|
523
526
|
}),
|
|
524
527
|
accept: ".xlsx,.xls",
|
|
525
|
-
onFileUpload: d[0] || (d[0] = (
|
|
528
|
+
onFileUpload: d[0] || (d[0] = (N) => e.value = N),
|
|
526
529
|
label: i(u)("inventory.ingredient.import.uploadTemplate"),
|
|
527
530
|
"button-label": i(u)("inventory.ingredient.import.selectFile")
|
|
528
|
-
},
|
|
531
|
+
}, Pe({ _: 2 }, [
|
|
529
532
|
e.value ? {
|
|
530
533
|
name: "default",
|
|
531
|
-
fn:
|
|
532
|
-
n("div",
|
|
534
|
+
fn: q(({ openFileDialog: N }) => [
|
|
535
|
+
n("div", dt, [
|
|
533
536
|
n("div", {
|
|
534
537
|
class: ce([
|
|
535
538
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
536
539
|
{
|
|
537
|
-
"border border-fm-color-neutral-gray-100":
|
|
538
|
-
"border border-fm-color-neutral-gray-200": !
|
|
540
|
+
"border border-fm-color-neutral-gray-100": y.value,
|
|
541
|
+
"border border-fm-color-neutral-gray-200": !y.value && !l.value,
|
|
539
542
|
"border border-fm-color-system-error-200": l.value
|
|
540
543
|
}
|
|
541
544
|
])
|
|
542
545
|
}, [
|
|
543
|
-
|
|
546
|
+
y.value ? (T(), se(o, {
|
|
544
547
|
key: 0,
|
|
545
548
|
size: "md",
|
|
546
549
|
color: "neutral-gray-200"
|
|
547
|
-
})) : (
|
|
550
|
+
})) : (T(), se(v, {
|
|
548
551
|
key: 1,
|
|
549
552
|
name: l.value ? "error" : "check_circle",
|
|
550
553
|
color: l.value ? "system-error-300" : "system-success-400",
|
|
551
554
|
size: "lg"
|
|
552
555
|
}, null, 8, ["name", "color"])),
|
|
553
|
-
n("div",
|
|
554
|
-
n("div",
|
|
556
|
+
n("div", ct, [
|
|
557
|
+
n("div", pt, a(e.value.name), 1),
|
|
555
558
|
n("div", {
|
|
556
559
|
class: ce([
|
|
557
560
|
"fm-typo-en-body-sm-400",
|
|
@@ -562,105 +565,105 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
|
|
|
562
565
|
])
|
|
563
566
|
}, a(l.value ? i(u)("inventory.ingredient.import.error.invalidContent") : "File valid"), 3)
|
|
564
567
|
]),
|
|
565
|
-
|
|
566
|
-
A(
|
|
568
|
+
y.value ? Y("", !0) : (T(), D("div", vt, [
|
|
569
|
+
A(w, {
|
|
567
570
|
label: i(u)("inventory.ingredient.import.replaceFile"),
|
|
568
571
|
variant: l.value ? "destructive" : "secondary",
|
|
569
572
|
"prepend-icon": l.value ? void 0 : "autorenew",
|
|
570
|
-
onClick:
|
|
573
|
+
onClick: N
|
|
571
574
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
572
575
|
]))
|
|
573
576
|
], 2),
|
|
574
|
-
|
|
575
|
-
(
|
|
576
|
-
key:
|
|
577
|
+
b.value.length ? (T(), D("div", yt, [
|
|
578
|
+
(T(!0), D(Me, null, $e(b.value, (I, E) => (T(), D("div", {
|
|
579
|
+
key: E,
|
|
577
580
|
class: "flex gap-8 items-center"
|
|
578
581
|
}, [
|
|
579
|
-
A(
|
|
582
|
+
A(v, {
|
|
580
583
|
name: "error",
|
|
581
584
|
size: "sm",
|
|
582
585
|
color: "system-error-300"
|
|
583
586
|
}),
|
|
584
|
-
n("div",
|
|
587
|
+
n("div", gt, a(I), 1)
|
|
585
588
|
]))), 128))
|
|
586
|
-
])) :
|
|
589
|
+
])) : Y("", !0)
|
|
587
590
|
])
|
|
588
591
|
]),
|
|
589
592
|
key: "0"
|
|
590
593
|
} : void 0
|
|
591
594
|
]), 1032, ["class", "label", "button-label"]),
|
|
592
|
-
s.value ? (
|
|
593
|
-
n("div",
|
|
594
|
-
n("div",
|
|
595
|
-
])) :
|
|
595
|
+
s.value ? (T(), D("div", ft, [
|
|
596
|
+
n("div", bt, a(i(u)("inventory.ingredient.import.summary")), 1),
|
|
597
|
+
n("div", ht, a(f()), 1)
|
|
598
|
+
])) : Y("", !0)
|
|
596
599
|
]);
|
|
597
600
|
};
|
|
598
601
|
}
|
|
599
|
-
}),
|
|
602
|
+
}), _t = {
|
|
600
603
|
key: 0,
|
|
601
604
|
class: "bg-blue-50 border border-blue-200 rounded-lg p-16"
|
|
602
|
-
},
|
|
605
|
+
}, wt = { class: "flex items-start gap-12" }, It = { class: "flex flex-col gap-8" }, Et = { class: "fm-typo-en-body-md-400 text-blue-800" }, St = { class: "fm-typo-en-body-sm-400 text-blue-700" }, kt = { class: "mb-8" }, Rt = ["innerHTML"], Ct = ["innerHTML"], Ut = { class: "mb-8" }, Gt = { class: "mb-12" }, Nt = { class: "mb-12" }, Tt = { class: "mb-8" }, Mt = { class: "text-orange-600" }, $t = {
|
|
603
606
|
key: 1,
|
|
604
607
|
class: "bg-white rounded-lg shadow"
|
|
605
|
-
},
|
|
608
|
+
}, Ft = { class: "flex items-center justify-between p-16 border-b" }, At = { class: "fm-typo-en-title-md-600" }, Dt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, Bt = {
|
|
606
609
|
key: 0,
|
|
607
610
|
class: "text-red-600"
|
|
608
|
-
},
|
|
611
|
+
}, Pt = {
|
|
609
612
|
key: 1,
|
|
610
613
|
class: "text-orange-600"
|
|
611
|
-
},
|
|
614
|
+
}, jt = {
|
|
612
615
|
key: 2,
|
|
613
616
|
class: "text-green-600"
|
|
614
|
-
},
|
|
617
|
+
}, Ot = { class: "flex gap-8" }, Ht = { class: "p-16" }, zt = {
|
|
615
618
|
key: 2,
|
|
616
619
|
class: "bg-white rounded-lg shadow"
|
|
617
|
-
},
|
|
620
|
+
}, Kt = { class: "flex items-center justify-between p-16 border-b" }, Vt = { class: "fm-typo-en-title-md-600 text-red-800" }, Wt = { class: "fm-typo-en-body-sm-400 text-gray-600 mt-4" }, Lt = { class: "flex gap-8" }, Jt = { class: "p-16" }, Xt = {
|
|
618
621
|
key: 0,
|
|
619
622
|
class: "flex flex-col gap-16 p-16"
|
|
620
|
-
},
|
|
623
|
+
}, qt = { class: "fm-typo-en-title-sm-600 mb-12" }, Qt = { class: "grid grid-cols-2 gap-12" }, Yt = { class: "fm-typo-en-body-sm-400 text-gray-600" }, Zt = { class: "fm-typo-en-body-md-600" }, en = { key: 0 }, tn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, nn = { class: "fm-typo-en-body-md-600" }, on = { class: "fm-typo-en-body-sm-400 text-gray-600" }, rn = { class: "fm-typo-en-body-md-600" }, sn = { class: "fm-typo-en-body-sm-400 text-gray-600" }, an = { class: "fm-typo-en-body-md-600" }, ln = { class: "fm-typo-en-body-sm-400 text-gray-600" }, mn = { class: "fm-typo-en-title-sm-600 mb-12 text-red-800" }, un = { class: "space-y-8" }, dn = { class: "fm-typo-en-body-md-400 text-red-800" }, cn = { class: "fm-typo-en-title-sm-600 mb-12" }, pn = { class: "bg-gray-50 p-12 rounded border overflow-auto" }, vn = { class: "text-sm" }, yn = { class: "flex gap-8" }, gn = { class: "flex flex-col items-center justify-center h-64 gap-16" }, fn = { class: "text-center" }, bn = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, hn = { class: "flex flex-col items-center justify-center h-64 gap-16" }, xn = { class: "text-center" }, _n = { class: "fm-typo-en-title-md-600 text-gray-600 mb-8" }, wn = { class: "fm-typo-en-body-md-400 text-gray-500" }, Dn = /* @__PURE__ */ Te({
|
|
621
624
|
__name: "ImportView",
|
|
622
625
|
setup(U) {
|
|
623
|
-
const { t: e } =
|
|
624
|
-
|
|
625
|
-
const
|
|
626
|
+
const { t: e } = Fe(), S = He(), y = Ae();
|
|
627
|
+
je();
|
|
628
|
+
const b = Ke(), { breakpoints: k } = ze(), h = ie(), r = F("");
|
|
626
629
|
F(!1);
|
|
627
|
-
const l = F(!1), s = F(null), u = F(!1),
|
|
630
|
+
const l = F(!1), s = F(null), u = F(!1), p = F(null), c = F(!1), f = F([]), g = F(null), d = F([]), o = F(!1), v = L(() => k.value.xs || k.value.sm), w = L(() => v.value ? 10 : 20), N = L(() => {
|
|
628
631
|
const m = s.value;
|
|
629
632
|
if (!m) return [];
|
|
630
|
-
const t = [], { units:
|
|
633
|
+
const t = [], { units: G, skus: B, recipes: V, _invalidExcel: z, _invalidExcelMessage: J } = m, X = ($) => {
|
|
631
634
|
var j;
|
|
632
|
-
return ((j =
|
|
633
|
-
}, H = (
|
|
634
|
-
if (
|
|
635
|
+
return ((j = $.errors) == null ? void 0 : j.length) > 0 ? Array.isArray($.errors) ? $.errors.join(", ") : $.errors || e("inventory.common.validationFailed") : z ? J || e("inventory.common.invalidExcelFormat") : e("inventory.common.readyToImport");
|
|
636
|
+
}, H = ($, O) => {
|
|
637
|
+
if ($)
|
|
635
638
|
for (const j of ["create", "update"]) {
|
|
636
|
-
const K =
|
|
639
|
+
const K = $[j];
|
|
637
640
|
if (K)
|
|
638
641
|
for (const P of K)
|
|
639
642
|
t.push({
|
|
640
643
|
name: P.name || P.abbrev || P.code || e("inventory.common.unknown"),
|
|
641
644
|
type: O,
|
|
642
645
|
operation: e(j === "create" ? "inventory.common.create" : "inventory.common.update"),
|
|
643
|
-
status:
|
|
646
|
+
status: X(P),
|
|
644
647
|
errors: P.errors || [],
|
|
645
648
|
details: P
|
|
646
649
|
});
|
|
647
650
|
}
|
|
648
651
|
};
|
|
649
|
-
return H(
|
|
650
|
-
}),
|
|
652
|
+
return H(G, e("inventory.common.unit")), H(B, e("inventory.common.ingredient")), H(V, e("inventory.common.recipe")), t;
|
|
653
|
+
}), I = L(() => N.value.some(
|
|
651
654
|
(m) => m.errors && m.errors.length > 0
|
|
652
|
-
)),
|
|
655
|
+
)), E = L(() => N.value.some(
|
|
653
656
|
(m) => m.status && m.status.includes("Invalid Excel")
|
|
654
|
-
)),
|
|
655
|
-
const m =
|
|
657
|
+
)), Z = L(() => {
|
|
658
|
+
const m = N.value.find(
|
|
656
659
|
(t) => t.status && t.status.includes("Invalid Excel")
|
|
657
660
|
);
|
|
658
661
|
return (m == null ? void 0 : m.status) || e("inventory.common.invalidExcelFormatDetected");
|
|
659
|
-
}), ve =
|
|
660
|
-
var
|
|
662
|
+
}), ve = L(() => !d.value || d.value.length === 0 ? [] : d.value.map((m, t) => {
|
|
663
|
+
var G, B;
|
|
661
664
|
return {
|
|
662
665
|
id: t + 1,
|
|
663
|
-
name: ((
|
|
666
|
+
name: ((G = m.error.data) == null ? void 0 : G.name) || e("inventory.common.unknown"),
|
|
664
667
|
type: m.type || e("inventory.common.general"),
|
|
665
668
|
message: ((B = m.error) == null ? void 0 : B.message) || JSON.stringify(m.error)
|
|
666
669
|
};
|
|
@@ -672,9 +675,9 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
|
|
|
672
675
|
}
|
|
673
676
|
}
|
|
674
677
|
function ge() {
|
|
675
|
-
|
|
678
|
+
S.open({
|
|
676
679
|
title: e("inventory.common.import"),
|
|
677
|
-
contentComponent:
|
|
680
|
+
contentComponent: xt,
|
|
678
681
|
overlay: !0,
|
|
679
682
|
closeButton: !0,
|
|
680
683
|
primaryActions: {
|
|
@@ -691,17 +694,17 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
|
|
|
691
694
|
variant: "plain"
|
|
692
695
|
}
|
|
693
696
|
}).onPrimary(async (m) => {
|
|
694
|
-
m && m.workbook && m.availableSheets && (await fe(m),
|
|
697
|
+
m && m.workbook && m.availableSheets && (await fe(m), S.close()), f.value.length === 0 && S.close();
|
|
695
698
|
}).onTertiary(() => {
|
|
696
699
|
try {
|
|
697
|
-
const m =
|
|
698
|
-
|
|
700
|
+
const m = it();
|
|
701
|
+
y.open({
|
|
699
702
|
title: e("inventory.common.export") + " " + e("inventory.ingredient.import.actions.downloadTemplate"),
|
|
700
703
|
message: e("inventory.common.templateDownloaded", [m]),
|
|
701
704
|
type: "success"
|
|
702
705
|
});
|
|
703
706
|
} catch (m) {
|
|
704
|
-
|
|
707
|
+
y.open({
|
|
705
708
|
title: e("inventory.common.downloadFailed"),
|
|
706
709
|
message: e("inventory.common.failedDownloadTemplate"),
|
|
707
710
|
type: "error"
|
|
@@ -710,78 +713,78 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
|
|
|
710
713
|
});
|
|
711
714
|
}
|
|
712
715
|
async function fe(m) {
|
|
713
|
-
|
|
716
|
+
g.value = m.workbook, f.value = [...m.availableSheets], s.value = {}, d.value = [], await ae();
|
|
714
717
|
}
|
|
715
718
|
async function ae() {
|
|
716
|
-
var t,
|
|
717
|
-
if (!
|
|
719
|
+
var t, G, B, V, z, J, X, H, $, O, j, K, P, me, ue;
|
|
720
|
+
if (!g.value || f.value.length === 0) {
|
|
718
721
|
u.value = !0;
|
|
719
722
|
return;
|
|
720
723
|
}
|
|
721
|
-
const m =
|
|
724
|
+
const m = f.value[0];
|
|
722
725
|
try {
|
|
723
726
|
switch (m) {
|
|
724
727
|
case "unit": {
|
|
725
|
-
const
|
|
726
|
-
|
|
728
|
+
const W = g.value.Sheets.unit, R = await at(W);
|
|
729
|
+
R && (s.value = {
|
|
727
730
|
...s.value,
|
|
728
|
-
_invalidExcel:
|
|
729
|
-
_invalidExcelMessage:
|
|
730
|
-
units:
|
|
731
|
-
create: ((B =
|
|
732
|
-
|
|
733
|
-
errors:
|
|
731
|
+
_invalidExcel: R.invalidExcel || ((t = s.value) == null ? void 0 : t._invalidExcel),
|
|
732
|
+
_invalidExcelMessage: R.invalidExcelMessage || ((G = s.value) == null ? void 0 : G._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Units sheet",
|
|
733
|
+
units: R.importCreateResult || R.importUpdateResult ? {
|
|
734
|
+
create: ((B = R.importCreateResult) == null ? void 0 : B.map((x) => ({
|
|
735
|
+
...x.unit,
|
|
736
|
+
errors: x.errors
|
|
734
737
|
}))) || [],
|
|
735
|
-
update: ((
|
|
736
|
-
|
|
737
|
-
errors:
|
|
738
|
+
update: ((V = R.importUpdateResult) == null ? void 0 : V.map((x) => ({
|
|
739
|
+
...x.unit,
|
|
740
|
+
errors: x.errors
|
|
738
741
|
}))) || []
|
|
739
742
|
} : (z = s.value) == null ? void 0 : z.units
|
|
740
743
|
});
|
|
741
744
|
break;
|
|
742
745
|
}
|
|
743
746
|
case "ingredient": {
|
|
744
|
-
const
|
|
745
|
-
|
|
747
|
+
const W = g.value.Sheets.ingredient, R = await lt(W);
|
|
748
|
+
R && (s.value = {
|
|
746
749
|
...s.value,
|
|
747
|
-
_invalidExcel:
|
|
748
|
-
_invalidExcelMessage:
|
|
749
|
-
skus:
|
|
750
|
-
create: ((H =
|
|
751
|
-
|
|
752
|
-
errors:
|
|
750
|
+
_invalidExcel: R.invalidExcel || ((J = s.value) == null ? void 0 : J._invalidExcel),
|
|
751
|
+
_invalidExcelMessage: R.invalidExcelMessage || ((X = s.value) == null ? void 0 : X._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Ingredients sheet",
|
|
752
|
+
skus: R.importCreateResult || R.importUpdateResult ? {
|
|
753
|
+
create: ((H = R.importCreateResult) == null ? void 0 : H.map((x) => ({
|
|
754
|
+
...x.sku,
|
|
755
|
+
errors: x.errors
|
|
753
756
|
}))) || [],
|
|
754
|
-
update: ((
|
|
755
|
-
|
|
756
|
-
errors:
|
|
757
|
+
update: (($ = R.importUpdateResult) == null ? void 0 : $.map((x) => ({
|
|
758
|
+
...x.sku,
|
|
759
|
+
errors: x.errors
|
|
757
760
|
}))) || []
|
|
758
761
|
} : (O = s.value) == null ? void 0 : O.skus
|
|
759
762
|
});
|
|
760
763
|
break;
|
|
761
764
|
}
|
|
762
765
|
case "recipe": {
|
|
763
|
-
const
|
|
764
|
-
|
|
766
|
+
const W = g.value.Sheets.recipe, R = await mt(W);
|
|
767
|
+
R && (s.value = {
|
|
765
768
|
...s.value,
|
|
766
|
-
_invalidExcel:
|
|
767
|
-
_invalidExcelMessage:
|
|
768
|
-
recipes:
|
|
769
|
-
create: ((P =
|
|
770
|
-
|
|
771
|
-
errors:
|
|
769
|
+
_invalidExcel: R.invalidExcel || ((j = s.value) == null ? void 0 : j._invalidExcel),
|
|
770
|
+
_invalidExcelMessage: R.invalidExcelMessage || ((K = s.value) == null ? void 0 : K._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Recipes sheet",
|
|
771
|
+
recipes: R.importCreateResult || R.importUpdateResult ? {
|
|
772
|
+
create: ((P = R.importCreateResult) == null ? void 0 : P.map((x) => ({
|
|
773
|
+
...x.recipe,
|
|
774
|
+
errors: x.errors
|
|
772
775
|
}))) || [],
|
|
773
|
-
update: ((me =
|
|
774
|
-
|
|
775
|
-
errors:
|
|
776
|
+
update: ((me = R.importUpdateResult) == null ? void 0 : me.map((x) => ({
|
|
777
|
+
...x.recipe,
|
|
778
|
+
errors: x.errors
|
|
776
779
|
}))) || []
|
|
777
780
|
} : (ue = s.value) == null ? void 0 : ue.recipes
|
|
778
781
|
});
|
|
779
782
|
break;
|
|
780
783
|
}
|
|
781
784
|
}
|
|
782
|
-
|
|
783
|
-
} catch (
|
|
784
|
-
console.error(`Error processing ${m} sheet:`,
|
|
785
|
+
f.value.shift(), u.value = !0;
|
|
786
|
+
} catch (W) {
|
|
787
|
+
console.error(`Error processing ${m} sheet:`, W), y.open({
|
|
785
788
|
title: e("inventory.common.processingError"),
|
|
786
789
|
message: e("inventory.common.failedToProcessSheet", [m]),
|
|
787
790
|
type: "error"
|
|
@@ -789,18 +792,18 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
|
|
|
789
792
|
}
|
|
790
793
|
}
|
|
791
794
|
async function be() {
|
|
792
|
-
var m, t,
|
|
795
|
+
var m, t, G, B, V, z, J, X, H, $, O, j, K, P, me, ue, W, R;
|
|
793
796
|
if (s.value) {
|
|
794
|
-
if (
|
|
795
|
-
|
|
797
|
+
if (E.value) {
|
|
798
|
+
y.open({
|
|
796
799
|
title: e("inventory.common.invalidExcelFormatTitle"),
|
|
797
|
-
message:
|
|
800
|
+
message: Z.value,
|
|
798
801
|
type: "error"
|
|
799
802
|
});
|
|
800
803
|
return;
|
|
801
804
|
}
|
|
802
|
-
if (
|
|
803
|
-
|
|
805
|
+
if (I.value) {
|
|
806
|
+
y.open({
|
|
804
807
|
title: e("inventory.ingredient.import.error.invalidContent"),
|
|
805
808
|
message: e("inventory.ingredient.import.error.hasErrors"),
|
|
806
809
|
type: "error"
|
|
@@ -809,115 +812,115 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
|
|
|
809
812
|
}
|
|
810
813
|
l.value = !0;
|
|
811
814
|
try {
|
|
812
|
-
let
|
|
815
|
+
let x = 0, ne = "";
|
|
813
816
|
if (s.value.units && ((m = s.value.units.create) != null && m.length || (t = s.value.units.update) != null && t.length)) {
|
|
814
|
-
const
|
|
815
|
-
create: (
|
|
816
|
-
update: (
|
|
817
|
+
const M = {
|
|
818
|
+
create: re(s.value.units.create),
|
|
819
|
+
update: re(s.value.units.update)
|
|
817
820
|
};
|
|
818
|
-
if (
|
|
819
|
-
const
|
|
820
|
-
((
|
|
821
|
+
if (M.create.length || M.update.length) {
|
|
822
|
+
const _ = await h.importUnits(M);
|
|
823
|
+
((G = _ == null ? void 0 : _.errors) == null ? void 0 : G.length) > 0 && d.value.push(..._.errors.map((oe) => ({
|
|
821
824
|
type: "units",
|
|
822
|
-
error:
|
|
825
|
+
error: oe
|
|
823
826
|
})));
|
|
824
|
-
const
|
|
825
|
-
|
|
827
|
+
const ee = M.create.length + M.update.length, te = ((B = _ == null ? void 0 : _.errors) == null ? void 0 : B.length) || 0;
|
|
828
|
+
x = ee - te, ne = "units", s.value = {
|
|
826
829
|
...s.value,
|
|
827
830
|
units: null
|
|
828
831
|
};
|
|
829
832
|
}
|
|
830
|
-
} else if (s.value.skus && ((
|
|
831
|
-
const
|
|
832
|
-
create: (
|
|
833
|
-
update: (
|
|
833
|
+
} else if (s.value.skus && ((V = s.value.skus.create) != null && V.length || (z = s.value.skus.update) != null && z.length)) {
|
|
834
|
+
const M = {
|
|
835
|
+
create: re(s.value.skus.create),
|
|
836
|
+
update: re(s.value.skus.update)
|
|
834
837
|
};
|
|
835
|
-
if (
|
|
836
|
-
const
|
|
837
|
-
((
|
|
838
|
+
if (M.create.length || M.update.length) {
|
|
839
|
+
const _ = await h.importSkus(M);
|
|
840
|
+
((J = _ == null ? void 0 : _.errors) == null ? void 0 : J.length) > 0 && d.value.push(..._.errors.map((oe) => ({
|
|
838
841
|
type: "ingredients",
|
|
839
|
-
error:
|
|
842
|
+
error: oe
|
|
840
843
|
})));
|
|
841
|
-
const
|
|
842
|
-
|
|
844
|
+
const ee = M.create.length + M.update.length, te = ((X = _ == null ? void 0 : _.errors) == null ? void 0 : X.length) || 0;
|
|
845
|
+
x = ee - te, ne = "ingredients", s.value = {
|
|
843
846
|
...s.value,
|
|
844
847
|
skus: null
|
|
845
848
|
};
|
|
846
849
|
}
|
|
847
|
-
} else if (s.value.recipes && ((
|
|
848
|
-
const
|
|
849
|
-
create: (
|
|
850
|
-
update: (
|
|
850
|
+
} else if (s.value.recipes && ((H = s.value.recipes.create) != null && H.length || ($ = s.value.recipes.update) != null && $.length)) {
|
|
851
|
+
const M = {
|
|
852
|
+
create: re(s.value.recipes.create),
|
|
853
|
+
update: re(s.value.recipes.update)
|
|
851
854
|
};
|
|
852
|
-
if (
|
|
853
|
-
const
|
|
854
|
-
((
|
|
855
|
+
if (M.create.length || M.update.length) {
|
|
856
|
+
const _ = await h.importRecipes(M);
|
|
857
|
+
((O = _ == null ? void 0 : _.errors) == null ? void 0 : O.length) > 0 && d.value.push(..._.errors.map((oe) => ({
|
|
855
858
|
type: "recipes",
|
|
856
|
-
error:
|
|
859
|
+
error: oe
|
|
857
860
|
})));
|
|
858
|
-
const
|
|
859
|
-
|
|
861
|
+
const ee = M.create.length + M.update.length, te = ((j = _ == null ? void 0 : _.errors) == null ? void 0 : j.length) || 0;
|
|
862
|
+
x = ee - te, ne = "recipes", s.value = {
|
|
860
863
|
...s.value,
|
|
861
864
|
recipes: null
|
|
862
865
|
};
|
|
863
866
|
}
|
|
864
867
|
}
|
|
865
|
-
if (
|
|
866
|
-
const
|
|
867
|
-
|
|
868
|
+
if (x > 0) {
|
|
869
|
+
const M = d.value.filter((_) => _.type === ne);
|
|
870
|
+
M.length > 0 ? y.open({
|
|
868
871
|
title: e("inventory.common.importCompletedWithIssues"),
|
|
869
|
-
message: e("inventory.common.successfullyImported", [
|
|
872
|
+
message: e("inventory.common.successfullyImported", [x, ne, M.length, ne]),
|
|
870
873
|
type: "warning"
|
|
871
|
-
}) :
|
|
874
|
+
}) : y.open({
|
|
872
875
|
title: e("inventory.ingredient.import.success"),
|
|
873
|
-
message: e("inventory.common.successfullyImported", [
|
|
876
|
+
message: e("inventory.common.successfullyImported", [x, ne, "0", ""]),
|
|
874
877
|
type: "success"
|
|
875
878
|
});
|
|
876
879
|
}
|
|
877
|
-
if (
|
|
880
|
+
if (f.value.length > 0)
|
|
878
881
|
await ae();
|
|
879
|
-
else if (!(s.value.units && (((
|
|
882
|
+
else if (!(s.value.units && (((K = s.value.units.create) == null ? void 0 : K.length) || ((P = s.value.units.update) == null ? void 0 : P.length)) || s.value.skus && (((me = s.value.skus.create) == null ? void 0 : me.length) || ((ue = s.value.skus.update) == null ? void 0 : ue.length)) || s.value.recipes && (((W = s.value.recipes.create) == null ? void 0 : W.length) || ((R = s.value.recipes.update) == null ? void 0 : R.length))))
|
|
880
883
|
if (le(), d.value.length > 0) {
|
|
881
|
-
const
|
|
882
|
-
o.value = !0,
|
|
884
|
+
const _ = d.value.filter((de) => de.type === "units").length, ee = d.value.filter((de) => de.type === "ingredients").length, te = d.value.filter((de) => de.type === "recipes").length, oe = _ + ee + te;
|
|
885
|
+
o.value = !0, y.open({
|
|
883
886
|
title: e("inventory.common.importCompletedWithIssues"),
|
|
884
|
-
message: e("inventory.common.importFinishedWithFailedItems", [
|
|
887
|
+
message: e("inventory.common.importFinishedWithFailedItems", [oe, _, ee, te]),
|
|
885
888
|
type: "warning"
|
|
886
889
|
}), console.error("Import errors:", d.value);
|
|
887
890
|
} else
|
|
888
|
-
|
|
891
|
+
y.open({
|
|
889
892
|
title: e("inventory.common.importComplete"),
|
|
890
893
|
message: e("inventory.common.allDataSuccessfullyImported"),
|
|
891
894
|
type: "success"
|
|
892
895
|
});
|
|
893
|
-
} catch (
|
|
894
|
-
|
|
896
|
+
} catch (x) {
|
|
897
|
+
y.open({
|
|
895
898
|
title: e("inventory.ingredient.import.error.failed"),
|
|
896
|
-
message: (
|
|
899
|
+
message: (x == null ? void 0 : x.message) || e("inventory.common.unknownErrorOccurred"),
|
|
897
900
|
type: "error"
|
|
898
|
-
}), console.error("Error during import:",
|
|
901
|
+
}), console.error("Error during import:", x);
|
|
899
902
|
} finally {
|
|
900
903
|
l.value = !1;
|
|
901
904
|
}
|
|
902
905
|
}
|
|
903
906
|
}
|
|
904
907
|
function le() {
|
|
905
|
-
u.value = !1, o.value = !1, s.value = null,
|
|
908
|
+
u.value = !1, o.value = !1, s.value = null, f.value = [], g.value = null;
|
|
906
909
|
}
|
|
907
910
|
function he() {
|
|
908
911
|
o.value = !1, d.value = [];
|
|
909
912
|
}
|
|
910
913
|
function xe() {
|
|
911
|
-
|
|
914
|
+
c.value = !1, p.value = null;
|
|
912
915
|
}
|
|
913
|
-
const _e =
|
|
916
|
+
const _e = L(() => [
|
|
914
917
|
{
|
|
915
918
|
label: e("inventory.common.import"),
|
|
916
919
|
value: "import",
|
|
917
920
|
isPrimary: !1,
|
|
918
921
|
prependIcon: "upload"
|
|
919
922
|
}
|
|
920
|
-
]), we =
|
|
923
|
+
]), we = Ue([
|
|
921
924
|
{
|
|
922
925
|
id: "name",
|
|
923
926
|
accessorKey: "name",
|
|
@@ -943,11 +946,11 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
|
|
|
943
946
|
size: 120,
|
|
944
947
|
cell: (m) => {
|
|
945
948
|
const t = m.row.original.status;
|
|
946
|
-
let
|
|
947
|
-
return t === e("inventory.common.readyToImport") ?
|
|
949
|
+
let G = "px-8 py-4 rounded";
|
|
950
|
+
return t === e("inventory.common.readyToImport") ? G += " bg-blue-100 text-blue-800 border border-blue-200" : t === "Imported" || t === "Successfully Imported" ? G += " bg-green-100 text-green-800 border border-green-200" : t === "Failed" ? G += " bg-red-100 text-red-800 border border-red-200" : t === e("inventory.common.validationFailed") ? G += " bg-orange-100 text-orange-800 border border-orange-200" : (t.includes("Invalid Excel"), G += " bg-red-100 text-red-800 border border-red-200"), Ie("div", { class: G, title: t }, t);
|
|
948
951
|
}
|
|
949
952
|
}
|
|
950
|
-
]), Se =
|
|
953
|
+
]), Se = Ue([
|
|
951
954
|
{
|
|
952
955
|
id: "name",
|
|
953
956
|
accessorKey: "name",
|
|
@@ -959,8 +962,8 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
|
|
|
959
962
|
accessorKey: "type",
|
|
960
963
|
header: () => e("inventory.common.errorType"),
|
|
961
964
|
cell: (m) => {
|
|
962
|
-
const t = m.row.original.type,
|
|
963
|
-
return Ie("div", { class: "text-gray-800 text-sm py-2" },
|
|
965
|
+
const t = m.row.original.type, G = e(t === "units" ? "inventory.common.unit" : t === "ingredients" ? "inventory.common.ingredient" : t === "recipes" ? "inventory.common.recipe" : "inventory.common.unknown");
|
|
966
|
+
return Ie("div", { class: "text-gray-800 text-sm py-2" }, G);
|
|
964
967
|
}
|
|
965
968
|
},
|
|
966
969
|
{
|
|
@@ -975,140 +978,140 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
|
|
|
975
978
|
}
|
|
976
979
|
]);
|
|
977
980
|
return (m, t) => {
|
|
978
|
-
const
|
|
979
|
-
return i(
|
|
981
|
+
const G = Q("FmIcon"), B = Q("FmButton"), V = Q("FmTable"), z = Q("FmCard"), J = Q("FmSideSheet"), X = Q("FmSpinner");
|
|
982
|
+
return i(b).isLoaded && i(b).enableBulkImport ? (T(), se(ke, {
|
|
980
983
|
key: 0,
|
|
981
984
|
title: i(e)("inventory.common.import"),
|
|
982
985
|
actions: _e.value,
|
|
983
986
|
"onClick:action": ye
|
|
984
987
|
}, {
|
|
985
|
-
default:
|
|
988
|
+
default: q(() => {
|
|
986
989
|
var H;
|
|
987
990
|
return [
|
|
988
991
|
n("div", {
|
|
989
992
|
class: ce([
|
|
990
993
|
"flex flex-col gap-8 max-h-full",
|
|
991
994
|
{
|
|
992
|
-
"p-0":
|
|
993
|
-
"px-24": !
|
|
995
|
+
"p-0": v.value,
|
|
996
|
+
"px-24": !v.value
|
|
994
997
|
}
|
|
995
998
|
])
|
|
996
999
|
}, [
|
|
997
|
-
u.value ?
|
|
998
|
-
n("div",
|
|
999
|
-
A(
|
|
1000
|
+
u.value ? Y("", !0) : (T(), D("div", _t, [
|
|
1001
|
+
n("div", wt, [
|
|
1002
|
+
A(G, {
|
|
1000
1003
|
name: "info",
|
|
1001
1004
|
class: "text-blue-600 mt-2"
|
|
1002
1005
|
}),
|
|
1003
|
-
n("div",
|
|
1004
|
-
n("div",
|
|
1005
|
-
n("div",
|
|
1006
|
-
n("div",
|
|
1006
|
+
n("div", It, [
|
|
1007
|
+
n("div", Et, a(i(e)("inventory.ingredient.import.multiUploadTemplateInstruction")), 1),
|
|
1008
|
+
n("div", St, [
|
|
1009
|
+
n("div", kt, [
|
|
1007
1010
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
|
|
1008
1011
|
]),
|
|
1009
|
-
t[39] || (t[39] =
|
|
1012
|
+
t[39] || (t[39] = C(" 1. ")),
|
|
1010
1013
|
n("span", {
|
|
1011
1014
|
innerHTML: i(e)("inventory.ingredient.import.importInstructions.step1")
|
|
1012
|
-
}, null, 8,
|
|
1015
|
+
}, null, 8, Rt),
|
|
1013
1016
|
t[40] || (t[40] = n("br", null, null, -1)),
|
|
1014
|
-
t[41] || (t[41] =
|
|
1017
|
+
t[41] || (t[41] = C(" 2. ")),
|
|
1015
1018
|
n("span", {
|
|
1016
1019
|
innerHTML: i(e)("inventory.ingredient.import.importInstructions.step2")
|
|
1017
|
-
}, null, 8,
|
|
1020
|
+
}, null, 8, Ct),
|
|
1018
1021
|
t[42] || (t[42] = n("br", null, null, -1)),
|
|
1019
|
-
|
|
1022
|
+
C(" 3. " + a(i(e)("inventory.ingredient.import.importInstructions.step3")), 1),
|
|
1020
1023
|
t[43] || (t[43] = n("br", null, null, -1)),
|
|
1021
|
-
|
|
1024
|
+
C(" 4. " + a(i(e)("inventory.ingredient.import.importInstructions.step4")), 1),
|
|
1022
1025
|
t[44] || (t[44] = n("br", null, null, -1)),
|
|
1023
1026
|
t[45] || (t[45] = n("br", null, null, -1)),
|
|
1024
|
-
n("div",
|
|
1027
|
+
n("div", Ut, [
|
|
1025
1028
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
|
|
1026
1029
|
]),
|
|
1027
|
-
n("div",
|
|
1030
|
+
n("div", Gt, [
|
|
1028
1031
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.title")), 1),
|
|
1029
|
-
|
|
1032
|
+
C(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.description")), 1),
|
|
1030
1033
|
t[1] || (t[1] = n("br", null, null, -1)),
|
|
1031
|
-
t[2] || (t[2] =
|
|
1034
|
+
t[2] || (t[2] = C(" • ")),
|
|
1032
1035
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col1")), 1),
|
|
1033
1036
|
t[3] || (t[3] = n("br", null, null, -1)),
|
|
1034
|
-
t[4] || (t[4] =
|
|
1037
|
+
t[4] || (t[4] = C(" • ")),
|
|
1035
1038
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col2")), 1),
|
|
1036
1039
|
t[5] || (t[5] = n("br", null, null, -1)),
|
|
1037
|
-
t[6] || (t[6] =
|
|
1040
|
+
t[6] || (t[6] = C(" • ")),
|
|
1038
1041
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col3")), 1),
|
|
1039
1042
|
t[7] || (t[7] = n("br", null, null, -1)),
|
|
1040
|
-
t[8] || (t[8] =
|
|
1043
|
+
t[8] || (t[8] = C(" • ")),
|
|
1041
1044
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col4")), 1),
|
|
1042
1045
|
t[9] || (t[9] = n("br", null, null, -1)),
|
|
1043
|
-
t[10] || (t[10] =
|
|
1046
|
+
t[10] || (t[10] = C(" • ")),
|
|
1044
1047
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col5")), 1),
|
|
1045
1048
|
t[11] || (t[11] = n("br", null, null, -1)),
|
|
1046
|
-
t[12] || (t[12] =
|
|
1049
|
+
t[12] || (t[12] = C(" • ")),
|
|
1047
1050
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col6")), 1)
|
|
1048
1051
|
]),
|
|
1049
|
-
n("div",
|
|
1052
|
+
n("div", Nt, [
|
|
1050
1053
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.title")), 1),
|
|
1051
|
-
|
|
1054
|
+
C(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.description")), 1),
|
|
1052
1055
|
t[13] || (t[13] = n("br", null, null, -1)),
|
|
1053
|
-
t[14] || (t[14] =
|
|
1056
|
+
t[14] || (t[14] = C(" • ")),
|
|
1054
1057
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col1")), 1),
|
|
1055
1058
|
t[15] || (t[15] = n("br", null, null, -1)),
|
|
1056
|
-
t[16] || (t[16] =
|
|
1059
|
+
t[16] || (t[16] = C(" • ")),
|
|
1057
1060
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col2")), 1),
|
|
1058
1061
|
t[17] || (t[17] = n("br", null, null, -1)),
|
|
1059
|
-
t[18] || (t[18] =
|
|
1062
|
+
t[18] || (t[18] = C(" • ")),
|
|
1060
1063
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col3")), 1),
|
|
1061
1064
|
t[19] || (t[19] = n("br", null, null, -1)),
|
|
1062
|
-
t[20] || (t[20] =
|
|
1065
|
+
t[20] || (t[20] = C(" • ")),
|
|
1063
1066
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col4")), 1),
|
|
1064
1067
|
t[21] || (t[21] = n("br", null, null, -1)),
|
|
1065
|
-
t[22] || (t[22] =
|
|
1068
|
+
t[22] || (t[22] = C(" • ")),
|
|
1066
1069
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col5")), 1)
|
|
1067
1070
|
]),
|
|
1068
|
-
n("div",
|
|
1071
|
+
n("div", Tt, [
|
|
1069
1072
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.title")), 1),
|
|
1070
|
-
|
|
1073
|
+
C(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.description")), 1),
|
|
1071
1074
|
t[23] || (t[23] = n("br", null, null, -1)),
|
|
1072
|
-
t[24] || (t[24] =
|
|
1075
|
+
t[24] || (t[24] = C(" • ")),
|
|
1073
1076
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col1")), 1),
|
|
1074
1077
|
t[25] || (t[25] = n("br", null, null, -1)),
|
|
1075
|
-
t[26] || (t[26] =
|
|
1078
|
+
t[26] || (t[26] = C(" • ")),
|
|
1076
1079
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col2")), 1),
|
|
1077
1080
|
t[27] || (t[27] = n("br", null, null, -1)),
|
|
1078
|
-
t[28] || (t[28] =
|
|
1081
|
+
t[28] || (t[28] = C(" • ")),
|
|
1079
1082
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col3")), 1),
|
|
1080
1083
|
t[29] || (t[29] = n("br", null, null, -1)),
|
|
1081
|
-
t[30] || (t[30] =
|
|
1084
|
+
t[30] || (t[30] = C(" • ")),
|
|
1082
1085
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col4")), 1),
|
|
1083
1086
|
t[31] || (t[31] = n("br", null, null, -1)),
|
|
1084
|
-
t[32] || (t[32] =
|
|
1087
|
+
t[32] || (t[32] = C(" • ")),
|
|
1085
1088
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col5")), 1),
|
|
1086
1089
|
t[33] || (t[33] = n("br", null, null, -1)),
|
|
1087
|
-
t[34] || (t[34] =
|
|
1090
|
+
t[34] || (t[34] = C(" • ")),
|
|
1088
1091
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col6")), 1),
|
|
1089
1092
|
t[35] || (t[35] = n("br", null, null, -1)),
|
|
1090
|
-
t[36] || (t[36] =
|
|
1093
|
+
t[36] || (t[36] = C(" • ")),
|
|
1091
1094
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col7")), 1),
|
|
1092
1095
|
t[37] || (t[37] = n("br", null, null, -1)),
|
|
1093
|
-
t[38] || (t[38] =
|
|
1096
|
+
t[38] || (t[38] = C(" • ")),
|
|
1094
1097
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col8")), 1)
|
|
1095
1098
|
]),
|
|
1096
|
-
n("div",
|
|
1099
|
+
n("div", Mt, [
|
|
1097
1100
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.warning")), 1)
|
|
1098
1101
|
])
|
|
1099
1102
|
])
|
|
1100
1103
|
])
|
|
1101
1104
|
])
|
|
1102
1105
|
])),
|
|
1103
|
-
u.value ? (
|
|
1104
|
-
n("div",
|
|
1106
|
+
u.value ? (T(), D("div", $t, [
|
|
1107
|
+
n("div", Ft, [
|
|
1105
1108
|
n("div", null, [
|
|
1106
|
-
n("div",
|
|
1107
|
-
n("div",
|
|
1108
|
-
|
|
1109
|
+
n("div", At, a(i(e)("inventory.common.importPreview")), 1),
|
|
1110
|
+
n("div", Dt, [
|
|
1111
|
+
E.value ? (T(), D("span", Bt, a(i(e)("inventory.common.errorExist")) + ": " + a(Z.value), 1)) : I.value ? (T(), D("span", Pt, a(i(e)("inventory.common.someItemsValidationErrors")), 1)) : (T(), D("span", jt, a(i(e)("inventory.common.allItemsValidReadyImport")), 1))
|
|
1109
1112
|
])
|
|
1110
1113
|
]),
|
|
1111
|
-
n("div",
|
|
1114
|
+
n("div", Ot, [
|
|
1112
1115
|
A(B, {
|
|
1113
1116
|
variant: "secondary",
|
|
1114
1117
|
onClick: le,
|
|
@@ -1118,29 +1121,29 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
|
|
|
1118
1121
|
variant: "primary",
|
|
1119
1122
|
onClick: be,
|
|
1120
1123
|
loading: l.value,
|
|
1121
|
-
disabled: l.value ||
|
|
1124
|
+
disabled: l.value || I.value || E.value,
|
|
1122
1125
|
label: i(e)("inventory.common.import")
|
|
1123
1126
|
}, null, 8, ["loading", "disabled", "label"])
|
|
1124
1127
|
])
|
|
1125
1128
|
]),
|
|
1126
|
-
n("div",
|
|
1127
|
-
A(
|
|
1129
|
+
n("div", Ht, [
|
|
1130
|
+
A(V, {
|
|
1128
1131
|
"column-defs": we.value,
|
|
1129
|
-
"row-data":
|
|
1130
|
-
"page-size":
|
|
1132
|
+
"row-data": N.value,
|
|
1133
|
+
"page-size": w.value,
|
|
1131
1134
|
"search-value": r.value,
|
|
1132
1135
|
loading: !1,
|
|
1133
1136
|
"row-hover": ""
|
|
1134
1137
|
}, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
|
|
1135
1138
|
])
|
|
1136
|
-
])) :
|
|
1137
|
-
o.value && d.value.length > 0 ? (
|
|
1138
|
-
n("div",
|
|
1139
|
+
])) : Y("", !0),
|
|
1140
|
+
o.value && d.value.length > 0 ? (T(), D("div", zt, [
|
|
1141
|
+
n("div", Kt, [
|
|
1139
1142
|
n("div", null, [
|
|
1140
|
-
n("div",
|
|
1141
|
-
n("div",
|
|
1143
|
+
n("div", Vt, a(i(e)("inventory.common.importErrors")), 1),
|
|
1144
|
+
n("div", Wt, a(d.value.length) + " " + a(i(e)("inventory.common.itemsFailedImport")), 1)
|
|
1142
1145
|
]),
|
|
1143
|
-
n("div",
|
|
1146
|
+
n("div", Lt, [
|
|
1144
1147
|
A(B, {
|
|
1145
1148
|
variant: "secondary",
|
|
1146
1149
|
onClick: he,
|
|
@@ -1148,27 +1151,27 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
|
|
|
1148
1151
|
}, null, 8, ["label"])
|
|
1149
1152
|
])
|
|
1150
1153
|
]),
|
|
1151
|
-
n("div",
|
|
1152
|
-
A(
|
|
1154
|
+
n("div", Jt, [
|
|
1155
|
+
A(V, {
|
|
1153
1156
|
"column-defs": Se.value,
|
|
1154
1157
|
"row-data": ve.value,
|
|
1155
|
-
"page-size":
|
|
1158
|
+
"page-size": w.value,
|
|
1156
1159
|
"search-value": r.value,
|
|
1157
1160
|
loading: !1,
|
|
1158
1161
|
"row-hover": ""
|
|
1159
1162
|
}, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
|
|
1160
1163
|
])
|
|
1161
|
-
])) :
|
|
1164
|
+
])) : Y("", !0)
|
|
1162
1165
|
], 2),
|
|
1163
|
-
A(
|
|
1164
|
-
"model-value":
|
|
1165
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
1166
|
-
header: `${(H =
|
|
1166
|
+
A(J, {
|
|
1167
|
+
"model-value": c.value,
|
|
1168
|
+
"onUpdate:modelValue": t[0] || (t[0] = ($) => c.value = $),
|
|
1169
|
+
header: `${(H = p.value) == null ? void 0 : H.type} Details`,
|
|
1167
1170
|
"max-width": 600,
|
|
1168
1171
|
"dismiss-away": ""
|
|
1169
1172
|
}, {
|
|
1170
|
-
"side-sheet-footer":
|
|
1171
|
-
n("div",
|
|
1173
|
+
"side-sheet-footer": q(() => [
|
|
1174
|
+
n("div", yn, [
|
|
1172
1175
|
A(B, {
|
|
1173
1176
|
label: i(e)("inventory.common.close"),
|
|
1174
1177
|
variant: "tertiary",
|
|
@@ -1176,116 +1179,116 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
|
|
|
1176
1179
|
}, null, 8, ["label"])
|
|
1177
1180
|
])
|
|
1178
1181
|
]),
|
|
1179
|
-
default:
|
|
1180
|
-
|
|
1182
|
+
default: q(() => [
|
|
1183
|
+
p.value != null ? (T(), D("div", Xt, [
|
|
1181
1184
|
A(z, {
|
|
1182
1185
|
variant: "outlined",
|
|
1183
1186
|
class: "p-16"
|
|
1184
1187
|
}, {
|
|
1185
|
-
default:
|
|
1186
|
-
var
|
|
1188
|
+
default: q(() => {
|
|
1189
|
+
var $, O, j, K, P;
|
|
1187
1190
|
return [
|
|
1188
|
-
n("div",
|
|
1189
|
-
n("div",
|
|
1191
|
+
n("div", qt, a(i(e)("inventory.common.basicInformation")), 1),
|
|
1192
|
+
n("div", Qt, [
|
|
1190
1193
|
n("div", null, [
|
|
1191
|
-
n("div",
|
|
1192
|
-
n("div",
|
|
1194
|
+
n("div", Yt, a(i(e)("inventory.common.name")), 1),
|
|
1195
|
+
n("div", Zt, a(((O = ($ = p.value) == null ? void 0 : $.details) == null ? void 0 : O.name) || ((j = p.value) == null ? void 0 : j.name)), 1)
|
|
1193
1196
|
]),
|
|
1194
|
-
(P = (K =
|
|
1195
|
-
n("div",
|
|
1196
|
-
n("div",
|
|
1197
|
-
])) :
|
|
1197
|
+
(P = (K = p.value) == null ? void 0 : K.details) != null && P.code ? (T(), D("div", en, [
|
|
1198
|
+
n("div", tn, a(i(e)("inventory.common.code")), 1),
|
|
1199
|
+
n("div", nn, a(p.value.details.code), 1)
|
|
1200
|
+
])) : Y("", !0),
|
|
1198
1201
|
n("div", null, [
|
|
1199
|
-
n("div",
|
|
1200
|
-
n("div",
|
|
1202
|
+
n("div", on, a(i(e)("inventory.common.type")), 1),
|
|
1203
|
+
n("div", rn, a(p.value.type), 1)
|
|
1201
1204
|
]),
|
|
1202
1205
|
n("div", null, [
|
|
1203
|
-
n("div",
|
|
1204
|
-
n("div",
|
|
1206
|
+
n("div", sn, a(i(e)("inventory.common.operation")), 1),
|
|
1207
|
+
n("div", an, a(p.value.operation), 1)
|
|
1205
1208
|
]),
|
|
1206
1209
|
n("div", null, [
|
|
1207
|
-
n("div",
|
|
1210
|
+
n("div", ln, a(i(e)("inventory.common.status")), 1),
|
|
1208
1211
|
n("div", {
|
|
1209
1212
|
class: ce([
|
|
1210
1213
|
"inline-block px-8 py-4 rounded text-sm",
|
|
1211
|
-
|
|
1214
|
+
p.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"
|
|
1212
1215
|
])
|
|
1213
|
-
}, a(
|
|
1216
|
+
}, a(p.value.status), 3)
|
|
1214
1217
|
])
|
|
1215
1218
|
])
|
|
1216
1219
|
];
|
|
1217
1220
|
}),
|
|
1218
1221
|
_: 1
|
|
1219
1222
|
}),
|
|
1220
|
-
|
|
1223
|
+
p.value.errors && p.value.errors.length > 0 ? (T(), se(z, {
|
|
1221
1224
|
key: 0,
|
|
1222
1225
|
variant: "outlined",
|
|
1223
1226
|
class: "p-16"
|
|
1224
1227
|
}, {
|
|
1225
|
-
default:
|
|
1226
|
-
n("div",
|
|
1227
|
-
n("div",
|
|
1228
|
-
(
|
|
1228
|
+
default: q(() => [
|
|
1229
|
+
n("div", mn, a(i(e)("inventory.common.validationErrors")), 1),
|
|
1230
|
+
n("div", un, [
|
|
1231
|
+
(T(!0), D(Me, null, $e(p.value.errors, ($, O) => (T(), D("div", {
|
|
1229
1232
|
key: O,
|
|
1230
1233
|
class: "flex items-start gap-8 p-12 bg-red-50 border border-red-200 rounded"
|
|
1231
1234
|
}, [
|
|
1232
|
-
A(
|
|
1235
|
+
A(G, {
|
|
1233
1236
|
name: "error",
|
|
1234
1237
|
class: "text-red-600 mt-2",
|
|
1235
1238
|
size: "sm"
|
|
1236
1239
|
}),
|
|
1237
|
-
n("div",
|
|
1240
|
+
n("div", dn, a($), 1)
|
|
1238
1241
|
]))), 128))
|
|
1239
1242
|
])
|
|
1240
1243
|
]),
|
|
1241
1244
|
_: 1
|
|
1242
|
-
})) :
|
|
1245
|
+
})) : Y("", !0),
|
|
1243
1246
|
A(z, {
|
|
1244
1247
|
variant: "outlined",
|
|
1245
1248
|
class: "p-16"
|
|
1246
1249
|
}, {
|
|
1247
|
-
default:
|
|
1248
|
-
n("div",
|
|
1249
|
-
n("div",
|
|
1250
|
-
n("pre",
|
|
1250
|
+
default: q(() => [
|
|
1251
|
+
n("div", cn, a(i(e)("inventory.common.rawData")), 1),
|
|
1252
|
+
n("div", pn, [
|
|
1253
|
+
n("pre", vn, a(JSON.stringify(p.value.details, null, 2)), 1)
|
|
1251
1254
|
])
|
|
1252
1255
|
]),
|
|
1253
1256
|
_: 1
|
|
1254
1257
|
})
|
|
1255
|
-
])) :
|
|
1258
|
+
])) : Y("", !0)
|
|
1256
1259
|
]),
|
|
1257
1260
|
_: 1
|
|
1258
1261
|
}, 8, ["model-value", "header"])
|
|
1259
1262
|
];
|
|
1260
1263
|
}),
|
|
1261
1264
|
_: 1
|
|
1262
|
-
}, 8, ["title", "actions"])) : i(
|
|
1265
|
+
}, 8, ["title", "actions"])) : i(b).isLoaded ? (T(), se(ke, {
|
|
1263
1266
|
key: 2,
|
|
1264
1267
|
title: i(e)("inventory.common.import")
|
|
1265
1268
|
}, {
|
|
1266
|
-
default:
|
|
1267
|
-
n("div",
|
|
1268
|
-
A(
|
|
1269
|
+
default: q(() => [
|
|
1270
|
+
n("div", hn, [
|
|
1271
|
+
A(G, {
|
|
1269
1272
|
name: "block",
|
|
1270
1273
|
class: "text-gray-400",
|
|
1271
1274
|
size: "xl"
|
|
1272
1275
|
}),
|
|
1273
|
-
n("div",
|
|
1274
|
-
n("div",
|
|
1275
|
-
n("div",
|
|
1276
|
+
n("div", xn, [
|
|
1277
|
+
n("div", _n, a(i(e)("inventory.common.featureNotAvailable")), 1),
|
|
1278
|
+
n("div", wn, a(i(e)("inventory.common.bulkImportNotEnabled")), 1)
|
|
1276
1279
|
])
|
|
1277
1280
|
])
|
|
1278
1281
|
]),
|
|
1279
1282
|
_: 1
|
|
1280
|
-
}, 8, ["title"])) : (
|
|
1283
|
+
}, 8, ["title"])) : (T(), se(ke, {
|
|
1281
1284
|
key: 1,
|
|
1282
1285
|
title: i(e)("inventory.common.import")
|
|
1283
1286
|
}, {
|
|
1284
|
-
default:
|
|
1285
|
-
n("div",
|
|
1286
|
-
A(
|
|
1287
|
-
n("div",
|
|
1288
|
-
n("div",
|
|
1287
|
+
default: q(() => [
|
|
1288
|
+
n("div", gn, [
|
|
1289
|
+
A(X, { size: "lg" }),
|
|
1290
|
+
n("div", fn, [
|
|
1291
|
+
n("div", bn, a(i(e)("inventory.common.loading")), 1)
|
|
1289
1292
|
])
|
|
1290
1293
|
])
|
|
1291
1294
|
]),
|
|
@@ -1295,5 +1298,5 @@ const yt = { class: "flex flex-col gap-24" }, gt = { class: "flex flex-col gap-8
|
|
|
1295
1298
|
}
|
|
1296
1299
|
});
|
|
1297
1300
|
export {
|
|
1298
|
-
|
|
1301
|
+
Dn as default
|
|
1299
1302
|
};
|