@feedmepos/mf-inventory-portal 1.7.12-dev.4 → 1.7.12
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-CnYmvN66.js +311 -0
- package/dist/{ApprovalView-ByzE83J4.js → ApprovalView-DA9aRu-i.js} +9 -9
- package/dist/{BindingsDialog-CRz7DUI8.js → BindingsDialog-BEOtRW53.js} +2 -2
- package/dist/{BindingsPicker-BGEocwgg.js → BindingsPicker-CSyMNRwK.js} +2 -2
- package/dist/{BindingsTable-hnXgqHv-.js → BindingsTable-Dngf7YVT.js} +4 -4
- package/dist/BulkReceiveRequestView-ueRj_k7-.js +2595 -0
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CR4Rfawi.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BF6iXbf2.js} +1 -1
- package/dist/{ClosingDraftView-CtARNdZD.js → ClosingDraftView-CxwnjpoD.js} +19 -19
- package/dist/{ClosingHistoryView-1GPfRzPI.js → ClosingHistoryView-CpzjcP-S.js} +5 -5
- package/dist/{ClosingTemplateView-CRDYkUnC.js → ClosingTemplateView-Cbz3WgzS.js} +16 -16
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang--Pl8ahzv.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-vZ1jrY-5.js} +1 -1
- package/dist/{DefaultView-Dkm69C-h.js → DefaultView-CD-wDNOZ.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-D3C7Mfti.js → DeliveryOrderPrintPreview-B_a61I3p.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BLJK4TLU.js → EmailDialog.vue_vue_type_script_setup_true_lang-Bw3cyaZa.js} +4106 -4111
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-COsbqYTt.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-YbLaL8WJ.js} +6 -6
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CqJZdU1b.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DOdZdn5i.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-IVoazKhD.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-wJ_p-Ld5.js} +2 -2
- package/dist/{FmMultiselectDialog-DyNULdDc.js → FmMultiselectDialog-DIzL6c9U.js} +1 -1
- package/dist/{FmMultiselectDialog-CcDje3Qo.js → FmMultiselectDialog-b0WH0SJC.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-B4iKp8As.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CCT3ROmh.js} +6 -6
- package/dist/{ImportView-Bo5_flTQ.js → ImportView-DRwh58Ys.js} +496 -499
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-ojpfy2Ii.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-9RWiSk12.js} +1 -1
- package/dist/{IngredientGroupView-DwI_dzmA.js → IngredientGroupView-0G8ru_Mg.js} +5 -5
- package/dist/{IngredientsView-CZ1dUF0O.js → IngredientsView-CveyeIDT.js} +17 -18
- package/dist/{IntegrationExplorerView-C5vZlZBh.js → IntegrationExplorerView-Cs7BOfbi.js} +4 -4
- package/dist/{IntegrationView-D4HIODSv.js → IntegrationView-EM8QVxrX.js} +3507 -3460
- package/dist/{InventoryBindingForm-DN1cW0S7.js → InventoryBindingForm-CLoDLMUq.js} +1 -1
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CzKnqty8.js +441 -0
- package/dist/{InventoryBindingSummary-NKawlUi9.js → InventoryBindingSummary-C3_h9jB6.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CSUy694_.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-sVLNX_Ju.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BXsQFkO3.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DdtF7Ghs.js} +1 -1
- package/dist/{ProductionView-7k5Oox5D.js → ProductionView-BfPM2Uwr.js} +7 -7
- package/dist/{PublishView-BmHkV9UU.js → PublishView-CacyxkTH.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-B-TxDilP.js → PurchaseOrderPrintPreview-CO8Ft7Jt.js} +2 -2
- package/dist/{ReceiveRequestView-CSJHwpJk.js → ReceiveRequestView-DNygshBP.js} +14 -14
- package/dist/RecipeView-Da5pXK-k.js +3584 -0
- package/dist/{SettingsView-D7qk5anS.js → SettingsView-8JTt0Ri0.js} +4 -4
- package/dist/{StockView-CrSYJS-y.js → StockView-Dkcp8EeQ.js} +21 -21
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CIcAv3iV.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DEv0WzZE.js} +1 -1
- package/dist/{SupplierView-mspLWCeX.js → SupplierView-BFhZxnxG.js} +12 -12
- package/dist/{SurchargeView-JnM8h5T5.js → SurchargeView-EkT2b_46.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CsTY_Ixm.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-Bvt_VW9G.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-nlr6Nrx1.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DxCESF-e.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DVoH2PXF.js → TransferDetails.vue_vue_type_script_setup_true_lang-D1bdw7Bp.js} +1575 -1639
- package/dist/{TransferTemplateView-CfVvqBEw.js → TransferTemplateView-DmiaoBw3.js} +20 -20
- package/dist/{UnitCostHistoryView-D8hbU8E9.js → UnitCostHistoryView-DklfNkXP.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-CVwO5FhL.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DpPiPLhD.js} +4 -4
- package/dist/{UnitView-BU7iOhKk.js → UnitView-De_D6GEz.js} +8 -8
- package/dist/WarehouseView-DkfQ6t0t.js +1079 -0
- package/dist/{WastageTemplateView-CofGUoCL.js → WastageTemplateView-CRdzM2as.js} +14 -14
- package/dist/api/purchase-order.d.ts +0 -2
- package/dist/{app-CaVwxRtv.js → app-DX9D1w8l.js} +9137 -10054
- package/dist/app.d.ts +9 -908
- package/dist/app.js +1 -1
- package/dist/{closing-template-zk-8riyF.js → closing-template-qpRg_Az9.js} +1 -1
- package/dist/{date2-Da1yrXy2.js → date2-CZ7adCWH.js} +5 -5
- package/dist/{dayjs.min-DZDLiUUR.js → dayjs.min-3MdjqoXO.js} +1 -1
- package/dist/{decimal-BXr5jFCt.js → decimal-C1LKdLkQ.js} +2 -2
- package/dist/{defineDeepModel-B58ZSZ2-.js → defineDeepModel-DoDzh2b2.js} +1 -1
- package/dist/{duplicate-template-DB7BeIdr.js → duplicate-template-C9Le1Znd.js} +1 -1
- package/dist/{feature-CoiZLX8h.js → feature-BZyCqcEn.js} +2 -2
- package/dist/{format-time-from-id-Dk2sMpaD.js → format-time-from-id-AU__62uQ.js} +1 -1
- package/dist/{format-unit-display-IvpQg1Zz.js → format-unit-display-Dw-0qEj4.js} +27 -27
- package/dist/{import-export.helper-BkEbqxoN.js → import-export.helper-OGX7xcXn.js} +6 -6
- package/dist/{index-9BgqIon0.js → index-BMsjGqmL.js} +3 -3
- package/dist/{index-D8SmmnoO.js → index-D8dszMaZ.js} +3232 -3306
- package/dist/{index-Lsgo5RyK.js → index-DU65mxS4.js} +1 -1
- package/dist/{inventory-core-dart.default-I4pnD6mk.js → inventory-core-dart.default-C8gA6YiZ.js} +1 -1
- package/dist/{lz-string-DpMUoHOE.js → lz-string-BzBGfdiF.js} +1 -1
- package/dist/{netsuite-PtHEjkyJ.js → netsuite-CvV6-vXA.js} +1387 -1397
- package/dist/{number-BrslsQSR.js → number-BxmfHF3Y.js} +3 -3
- package/dist/{predefined-templates-BhmpuXal.js → predefined-templates-5u9eGHKJ.js} +1 -1
- package/dist/{purchase-order-template-DxbJKpHo.js → purchase-order-template-Qr5AMiU6.js} +1 -1
- package/dist/{recalculationUtils-5Kc541X6.js → recalculationUtils-2gL9pc0H.js} +1 -1
- package/dist/{rules-LmD1GbEX.js → rules-BPasrLXm.js} +2 -2
- package/dist/{stock-Bn5ZJ4l-.js → stock-CzIzVIbM.js} +1 -1
- package/dist/{stock-BhSrDwve.js → stock-yRjAx4ZH.js} +3 -3
- package/dist/stores/bulk-job.d.ts +0 -13
- package/dist/style.css +1 -1
- package/dist/{supplier-CN9kcBaa.js → supplier-DMTqpJg3.js} +2 -2
- package/dist/{surcharge-KXfzn-DG.js → surcharge-BeUZBYR1.js} +8 -8
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-BLkhY22f.js → uom-rules-LihPxQ9x.js} +1 -1
- package/dist/{use-ingredient-select-dialog-BI10BAsU.js → use-ingredient-select-dialog-CxE1cAK-.js} +2 -2
- package/dist/{use-inventory-binding-dialog-U7gMV5AO.js → use-inventory-binding-dialog-BOx62zVs.js} +2 -2
- package/dist/{use-template-enabled-locations-ByqGD0Zl.js → use-template-enabled-locations-C8eeA9Sb.js} +2 -2
- package/dist/{use-transfer-locations-CjmdtOJn.js → use-transfer-locations-Dnxc410A.js} +2 -2
- package/dist/{useHrmPermission-BLPoqAqK.js → useHrmPermission-BdejOjVT.js} +1 -1
- package/dist/{useNavigationMenu-KC6IkTar.js → useNavigationMenu-9-UDO0Au.js} +2 -2
- package/dist/{useSseClient-Mg1vIf5l.js → useSseClient-CnNQR4iL.js} +1 -1
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +0 -2
- package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +0 -2
- package/dist/views/ingredients/components/inventory-binding/v2/components/InventoryRecipeBindingV2Field.vue.d.ts +0 -4
- package/dist/views/receive-request/components/email-dialog/EmailDialogProps.d.ts +9 -23
- package/dist/views/recipe/composables/use-recipe-table.d.ts +0 -11
- package/dist/{vue-i18n-9MAnRv0c.js → vue-i18n-X-U3UMbs.js} +332 -332
- package/dist/{xlsx.util-Dlw4yUlp.js → xlsx.util-CE04FVCJ.js} +2 -2
- package/package.json +4 -4
- package/dist/App-BA0j7vXh.js +0 -1465
- package/dist/BulkReceiveRequestView-BePjklka.js +0 -2657
- package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-78aK3g9R.js +0 -563
- package/dist/RecipeView-FQRnQku1.js +0 -3625
- package/dist/WarehouseView-7RlAD3Dp.js +0 -1082
- package/dist/api/changelog.d.ts +0 -132
- package/dist/views/changelog/components/ChangelogDialog.vue.d.ts +0 -19
- package/dist/views/changelog/components/ChangelogFloatingButton.vue.d.ts +0 -2
- package/dist/views/changelog/components/ChangelogPanel.spec.d.ts +0 -1
- package/dist/views/changelog/components/ChangelogPanel.vue.d.ts +0 -20
- package/dist/views/changelog/composables/change-path.d.ts +0 -10
- package/dist/views/changelog/composables/commit-message.d.ts +0 -9
- package/dist/views/changelog/composables/commit-message.spec.d.ts +0 -1
- package/dist/views/changelog/composables/json-line-diff.d.ts +0 -10
- package/dist/views/changelog/composables/json-line-diff.spec.d.ts +0 -1
- package/dist/views/changelog/composables/use-changelog.d.ts +0 -90
- package/dist/views/changelog/composables/use-changelog.spec.d.ts +0 -1
- package/dist/views/changelog/composables/use-inventory-record-commits.d.ts +0 -97
- package/dist/views/changelog/composables/use-inventory-record-commits.spec.d.ts +0 -1
- package/dist/views/changelog/composables/use-snapshot-diff.d.ts +0 -29
- package/dist/views/changelog/composables/use-snapshot-diff.spec.d.ts +0 -1
- package/dist/views/changelog/composables/value-tree.d.ts +0 -14
- package/dist/views/changelog/composables/value-tree.spec.d.ts +0 -1
- package/dist/views/import/helper/submit-rows.d.ts +0 -13
- package/dist/views/import/helper/submit-rows.spec.d.ts +0 -1
- package/dist/views/ingredients/components/inventory-binding/RecipeBindingBreakdown.vue.d.ts +0 -25
- package/dist/views/ingredients/components/inventory-binding/composables/recipe-breakdown.d.ts +0 -34
- package/dist/views/ingredients/components/inventory-binding/composables/recipe-breakdown.spec.d.ts +0 -1
- package/dist/views/receive-request/components/email-dialog/EmailDialog.spec.d.ts +0 -1
|
@@ -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 De, ref as F, computed as J, watch as ze, resolveComponent as Y, createElementBlock as D, openBlock as N, createVNode as A, createCommentVNode as Z, unref as i, normalizeClass as ce, createSlots as Ke, withCtx as Q, createElementVNode as n, createBlock as se, toDisplayString as a, Fragment as Be, renderList as Pe, shallowRef as $e, h as Ie, createTextVNode as k } from "vue";
|
|
2
|
+
import { u as Ve, _ as ke } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
|
|
3
|
+
import { useCoreStore as Re, useI18n as je } from "@feedmepos/mf-common";
|
|
4
|
+
import { useDialogChild as We, useSnackbar as Oe, useDialog as Le, useBreakpoints as Je } from "@feedmepos/ui-library";
|
|
5
|
+
import { u as Xe } from "./feature-BZyCqcEn.js";
|
|
6
|
+
import { a as ie } from "./app-DX9D1w8l.js";
|
|
7
|
+
import "./dayjs.min-3MdjqoXO.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 He, a as qe, d as Qe, t as Ce, r as Ye } from "./xlsx.util-CE04FVCJ.js";
|
|
11
|
+
import { s as Ze, g as et, b as tt, d as Fe } from "./import-export.helper-OGX7xcXn.js";
|
|
12
|
+
import { r as nt } from "./random-CSbEbElR.js";
|
|
13
|
+
import { c as Ae, a as pe } from "./number-BxmfHF3Y.js";
|
|
14
|
+
import { F as ot } from "./FmDroppableField-J0tG_U3w.js";
|
|
15
15
|
function Ee() {
|
|
16
|
-
return `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${
|
|
16
|
+
return `measurement_${(/* @__PURE__ */ new Date()).toISOString()}_${nt()}`;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function rt(U) {
|
|
19
19
|
const [
|
|
20
20
|
e,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
b,
|
|
24
|
-
k,
|
|
21
|
+
R,
|
|
22
|
+
g,
|
|
25
23
|
h,
|
|
24
|
+
E,
|
|
25
|
+
x,
|
|
26
26
|
...r
|
|
27
|
-
] =
|
|
28
|
-
if (!e || !e.length || e.some((
|
|
27
|
+
] = He(U);
|
|
28
|
+
if (!e || !e.length || e.some((p) => p.length && !p.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((p) => p.split(":")[1]), u = ["name", "symbol", "precision"].filter((p) => !l.includes(p));
|
|
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((p, b) => {
|
|
36
|
+
const f = {};
|
|
37
37
|
for (const d in l) {
|
|
38
38
|
const o = l[d];
|
|
39
|
-
Object.assign(
|
|
39
|
+
Object.assign(f, { [o]: p[d] });
|
|
40
40
|
}
|
|
41
41
|
return {
|
|
42
|
-
index:
|
|
43
|
-
data:
|
|
42
|
+
index: b,
|
|
43
|
+
data: f
|
|
44
44
|
};
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function st(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 = rt(U).filter((r) => {
|
|
50
|
+
const { name: l, symbol: s, precision: u, measurement_name: v, measurement_symbol: p, measurement_conversion: b } = r.data;
|
|
51
|
+
return l || s || u || v || p || b;
|
|
52
|
+
}), g = ie().units, h = [], E = [], x = {};
|
|
53
53
|
for (const r of e)
|
|
54
54
|
if (r.data.name && r.data.symbol)
|
|
55
|
-
|
|
55
|
+
x[r.data.name] = {
|
|
56
56
|
unit: {
|
|
57
57
|
name: r.data.name,
|
|
58
58
|
abbrev: r.data.symbol,
|
|
@@ -60,33 +60,33 @@ function et(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 && x[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, x[r.data.name].unit.precision)),
|
|
69
|
+
precision: x[r.data.name].unit.precision
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
else {
|
|
73
|
-
const l = Object.keys(
|
|
74
|
-
l &&
|
|
73
|
+
const l = Object.keys(x)[Object.keys(x).length - 1];
|
|
74
|
+
l && x[l] && r.data.measurement_name && r.data.measurement_symbol && r.data.measurement_conversion && x[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, x[l].unit.precision)),
|
|
80
|
+
precision: x[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(x)) {
|
|
85
|
+
const u = g.find((v) => {
|
|
86
|
+
var p, b;
|
|
87
|
+
return v.abbrev === l.abbrev && ((p = v.name) == null ? void 0 : p.trim()) === ((b = l.name) == null ? void 0 : b.trim());
|
|
88
88
|
});
|
|
89
|
-
u ?
|
|
89
|
+
u ? E.push({
|
|
90
90
|
type: "update",
|
|
91
91
|
original: u,
|
|
92
92
|
unit: {
|
|
@@ -94,18 +94,18 @@ function et(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((v) => {
|
|
98
|
+
const p = u.measurements.find((b) => b.name === v.name && b.abbrev === v.abbrev);
|
|
99
|
+
return p ? { ...p, ...v, id: p.id } : { ...v, id: Ee() };
|
|
100
100
|
})
|
|
101
101
|
},
|
|
102
102
|
errors: [],
|
|
103
103
|
excelRowNumber: s
|
|
104
|
-
}) :
|
|
104
|
+
}) : h.push({
|
|
105
105
|
type: "create",
|
|
106
106
|
unit: {
|
|
107
107
|
...l,
|
|
108
|
-
measurements: l.measurements.map((
|
|
108
|
+
measurements: l.measurements.map((v) => ({ ...v, id: Ee() }))
|
|
109
109
|
},
|
|
110
110
|
errors: [],
|
|
111
111
|
excelRowNumber: s
|
|
@@ -113,8 +113,8 @@ function et(U) {
|
|
|
113
113
|
}
|
|
114
114
|
return {
|
|
115
115
|
invalidExcel: !1,
|
|
116
|
-
importCreateResult:
|
|
117
|
-
importUpdateResult:
|
|
116
|
+
importCreateResult: h,
|
|
117
|
+
importUpdateResult: E
|
|
118
118
|
};
|
|
119
119
|
} catch (e) {
|
|
120
120
|
return {
|
|
@@ -125,130 +125,130 @@ function et(U) {
|
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
var
|
|
128
|
+
function it(U, { ignoreErrors: e = !1 } = {}) {
|
|
129
|
+
var R;
|
|
130
130
|
try {
|
|
131
|
-
const
|
|
131
|
+
const g = ie(), h = g.skuByCode, E = g.recipeByName, x = g.skuGroupById, r = g.skuGroups, l = g.units, s = [], u = {};
|
|
132
132
|
for (const o of U) {
|
|
133
|
-
const
|
|
134
|
-
let
|
|
133
|
+
const y = [];
|
|
134
|
+
let _ = "";
|
|
135
135
|
if (o.data.type === "INGREDIENT") {
|
|
136
|
-
const
|
|
137
|
-
|
|
136
|
+
const w = h[o.data.code];
|
|
137
|
+
w ? _ = w._id : y.push(`Ingredient with code '${o.data.code}' not found`);
|
|
138
138
|
} else if (o.data.type === "RECIPE") {
|
|
139
|
-
const
|
|
140
|
-
|
|
139
|
+
const w = E[o.data.name];
|
|
140
|
+
w ? _ = w._id : y.push(`Recipe with name '${o.data.name}' not found`);
|
|
141
141
|
} else if (o.data.type === "SKU_GROUP") {
|
|
142
|
-
const
|
|
143
|
-
|
|
142
|
+
const w = r.find((I) => I.ref === o.data.code || I.name === o.data.name);
|
|
143
|
+
w ? _ = w._id : y.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
|
+
y.push(`Invalid type '${o.data.type}'. Must be 'INGREDIENT', 'RECIPE', or 'SKU_GROUP'`);
|
|
146
|
+
o.data.amount || y.push(`Invalid amount '${o.data.amount}'. Must be a valid number`);
|
|
147
|
+
let G;
|
|
148
|
+
if ((o.data.unit || o.data.baseUnit) && o.data.type !== "RECIPE" && o.data.type !== "SKU_GROUP" && (G = l.find((w) => {
|
|
149
|
+
var I, ee;
|
|
150
|
+
return w.abbrev === o.data.baseUnit && ((I = w.name) == null ? void 0 : I.trim()) === ((ee = o.data.unit) == null ? void 0 : ee.trim());
|
|
151
|
+
}), G || (o.data.baseUnit && o.data.unit ? y.push(`Cannot find unit with symbol '${o.data.baseUnit}' and name '${o.data.unit}'`) : o.data.baseUnit ? y.push(`Cannot find unit with symbol '${o.data.baseUnit}'`) : o.data.unit && y.push(`Cannot find unit with name '${o.data.unit}'`))), y.length > 0 && s.push(`Row ${o.index + 6}: ${y.join(", ")}`), e || y.length === 0) {
|
|
152
|
+
let w;
|
|
153
|
+
if (o.data.type === "RECIPE" || o.data.type === "SKU_GROUP" ? w = void 0 : w = (R = G == null ? void 0 : G.measurements) == null ? void 0 : R.find((I) => I.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 ? Ze(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: _,
|
|
160
|
+
amount: Ae(+o.data.amount),
|
|
161
|
+
measurement: w || void 0
|
|
162
162
|
}]
|
|
163
|
-
}, s[o.data.recipeName] =
|
|
163
|
+
}, s[o.data.recipeName] = y.length > 0 ? `Row ${o.index + 6}: ${y.join(", ")}` : [];
|
|
164
164
|
else {
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
...u[
|
|
165
|
+
const I = Object.keys(u)[Object.keys(u).length - 1];
|
|
166
|
+
I && u[I] && (u[I] = {
|
|
167
|
+
...u[I],
|
|
168
168
|
contains: [
|
|
169
|
-
...u[
|
|
169
|
+
...u[I].contains,
|
|
170
170
|
{
|
|
171
171
|
type: o.data.type === "INGREDIENT" ? "SKU" : o.data.type,
|
|
172
|
-
id:
|
|
173
|
-
amount:
|
|
174
|
-
measurement:
|
|
172
|
+
id: _,
|
|
173
|
+
amount: Ae(+o.data.amount),
|
|
174
|
+
measurement: w || void 0
|
|
175
175
|
}
|
|
176
176
|
]
|
|
177
|
-
}, s[
|
|
177
|
+
}, s[I] = y.length > 0 ? s[I] ? `${s[I]}, Row ${o.index + 6}: ${y.join(", ")}` : `Row ${o.index + 6}: ${y.join(", ")}` : []);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
const
|
|
181
|
+
const v = Object.values(u), p = v.filter((o) => !E[o.name]), b = v.filter((o) => E[o.name]), f = p.map((o, y) => ({
|
|
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: y + 6
|
|
187
187
|
// Assuming header rows
|
|
188
|
-
})), d =
|
|
189
|
-
const
|
|
188
|
+
})), d = b.map((o, y) => {
|
|
189
|
+
const _ = E[o.name];
|
|
190
190
|
return {
|
|
191
191
|
type: "update",
|
|
192
|
-
original:
|
|
192
|
+
original: _,
|
|
193
193
|
recipe: {
|
|
194
|
-
...
|
|
195
|
-
name: o.name ||
|
|
196
|
-
contains: o.contains.length > 0 ? o.contains :
|
|
197
|
-
customAttributes: o.customAttributes ||
|
|
194
|
+
..._,
|
|
195
|
+
name: o.name || _.name,
|
|
196
|
+
contains: o.contains.length > 0 ? o.contains : _.contains,
|
|
197
|
+
customAttributes: o.customAttributes || _.customAttributes
|
|
198
198
|
},
|
|
199
199
|
errors: s[o.name],
|
|
200
|
-
excelRowNumber:
|
|
200
|
+
excelRowNumber: y + 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: f,
|
|
207
207
|
importUpdateResult: d
|
|
208
208
|
};
|
|
209
|
-
} catch (
|
|
209
|
+
} catch (g) {
|
|
210
210
|
return {
|
|
211
211
|
invalidExcel: !0,
|
|
212
|
-
invalidExcelMessage:
|
|
212
|
+
invalidExcelMessage: g instanceof Error ? g.message : "Unknown error occurred",
|
|
213
213
|
importCreateResult: [],
|
|
214
214
|
importUpdateResult: []
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function at(U) {
|
|
219
219
|
const [
|
|
220
220
|
e,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
b,
|
|
224
|
-
k,
|
|
221
|
+
R,
|
|
222
|
+
g,
|
|
225
223
|
h,
|
|
224
|
+
E,
|
|
225
|
+
x,
|
|
226
226
|
...r
|
|
227
|
-
] =
|
|
228
|
-
if (!e || !e.length || e.some((
|
|
227
|
+
] = He(U);
|
|
228
|
+
if (!e || !e.length || e.some((p) => p.length && !p.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((p) => p.split(":")[1]), u = ["code", "recipeName", "unit", "baseUnit", "type", "amount"].filter((p) => !l.includes(p));
|
|
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((p, b) => {
|
|
236
|
+
const f = {};
|
|
237
237
|
for (const d in l) {
|
|
238
238
|
const o = l[d];
|
|
239
|
-
Object.assign(
|
|
239
|
+
Object.assign(f, { [o]: p[d] });
|
|
240
240
|
}
|
|
241
241
|
return {
|
|
242
|
-
index:
|
|
243
|
-
data:
|
|
242
|
+
index: b,
|
|
243
|
+
data: f
|
|
244
244
|
};
|
|
245
|
-
}).filter((
|
|
246
|
-
const { recipeName:
|
|
247
|
-
return
|
|
245
|
+
}).filter((p) => {
|
|
246
|
+
const { recipeName: b, type: f, code: d, name: o, amount: y, unit: _, baseUnit: G, measurementName: w, customAttributes: I } = p.data;
|
|
247
|
+
return b || f || d || o || y || _ || G || w || I;
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
const e = Re().currentBusiness.value,
|
|
250
|
+
function lt() {
|
|
251
|
+
const e = Re().currentBusiness.value, R = ie(), g = [
|
|
252
252
|
{ id: "name", name: "Unit Name" },
|
|
253
253
|
{ id: "symbol", name: "Symbol" },
|
|
254
254
|
{ id: "precision", name: "Precision" },
|
|
@@ -256,10 +256,10 @@ function ot() {
|
|
|
256
256
|
{ id: "measurement_symbol", name: "Measurement Symbol" },
|
|
257
257
|
{ id: "measurement_conversion", name: "Measurement Conversion" }
|
|
258
258
|
];
|
|
259
|
-
let
|
|
260
|
-
|
|
259
|
+
let h = [];
|
|
260
|
+
R.units.length > 0 ? R.units.forEach((r) => {
|
|
261
261
|
if (r.measurements.length === 0)
|
|
262
|
-
|
|
262
|
+
h.push([
|
|
263
263
|
r.name,
|
|
264
264
|
r.abbrev,
|
|
265
265
|
r.precision,
|
|
@@ -268,7 +268,7 @@ function ot() {
|
|
|
268
268
|
""
|
|
269
269
|
]);
|
|
270
270
|
else {
|
|
271
|
-
|
|
271
|
+
h.push([
|
|
272
272
|
r.name,
|
|
273
273
|
r.abbrev,
|
|
274
274
|
r.precision,
|
|
@@ -277,7 +277,7 @@ function ot() {
|
|
|
277
277
|
+pe(r.measurements[0].conversion)
|
|
278
278
|
]);
|
|
279
279
|
for (let l = 1; l < r.measurements.length; l++)
|
|
280
|
-
|
|
280
|
+
h.push([
|
|
281
281
|
"",
|
|
282
282
|
"",
|
|
283
283
|
"",
|
|
@@ -286,7 +286,7 @@ function ot() {
|
|
|
286
286
|
+pe(r.measurements[l].conversion)
|
|
287
287
|
]);
|
|
288
288
|
}
|
|
289
|
-
}) :
|
|
289
|
+
}) : h = [
|
|
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 ot() {
|
|
|
294
294
|
["", "", "", "Gram", "g", 1e-3],
|
|
295
295
|
["", "", "", "Pound", "lb", 0.453592]
|
|
296
296
|
];
|
|
297
|
-
const
|
|
297
|
+
const E = [
|
|
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
|
+
g.map((r) => r.name),
|
|
303
|
+
...h
|
|
304
|
+
], x = g.map((r) => `system:${r.id}`);
|
|
305
|
+
return Ce(E, x);
|
|
306
306
|
}
|
|
307
|
-
function
|
|
308
|
-
const e = Re().currentBusiness.value,
|
|
309
|
-
let
|
|
310
|
-
|
|
311
|
-
var l, s, u, p,
|
|
307
|
+
function mt() {
|
|
308
|
+
const e = Re().currentBusiness.value, R = ie(), g = tt();
|
|
309
|
+
let h = [];
|
|
310
|
+
R.skus.length > 0 ? h = R.skus.map((r) => {
|
|
311
|
+
var l, s, u, v, p, b, f, 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
|
+
((v = (u = r.unit) == null ? void 0 : u.measurements.find((o) => o.id === r.trackingMeasurement)) == null ? void 0 : v.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
|
+
(p = r.defaultCost) != null && p.costPerUnit ? +pe((b = r.defaultCost) == null ? void 0 : b.costPerUnit) : 0,
|
|
320
|
+
((f = r.thresholds) == null ? void 0 : f.low) ?? Fe().low,
|
|
321
|
+
((d = r.thresholds) == null ? void 0 : d.mid) ?? Fe().mid,
|
|
322
|
+
r.customAttributes ? Object.entries(r.customAttributes).map(([o, y]) => `${o}:${y}`).join("|") : ""
|
|
323
323
|
];
|
|
324
|
-
}) :
|
|
324
|
+
}) : h = [
|
|
325
325
|
["EXAMPLE_CODE", "Example Ingredient", "kg", "kg", "Unit Name", "WAVG", 10.5, 5, 10, ""]
|
|
326
326
|
];
|
|
327
|
-
const
|
|
327
|
+
const E = [
|
|
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
|
+
g.map((r) => r.name),
|
|
333
|
+
...h
|
|
334
|
+
], x = g.map((r) => `system:${r.id}`);
|
|
335
|
+
return Ce(E, x);
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
const e = Re().currentBusiness.value,
|
|
337
|
+
function ut() {
|
|
338
|
+
const e = Re().currentBusiness.value, R = ie(), g = [
|
|
339
339
|
{ id: "recipeName", name: "Recipe Name" },
|
|
340
340
|
{ id: "type", name: "Type" },
|
|
341
341
|
{ id: "code", name: "Code" },
|
|
@@ -346,58 +346,58 @@ function st() {
|
|
|
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 h = [];
|
|
350
|
+
if (R.recipes.length > 0) {
|
|
351
|
+
const r = R.recipeById, l = R.skuById, s = R.skuGroupById;
|
|
352
|
+
h = R.recipes.flatMap((u) => {
|
|
353
|
+
var p;
|
|
354
|
+
const v = u.customAttributes ? Object.entries(u.customAttributes).map(([b, f]) => `${b}:${f}`).join("|") : "";
|
|
355
|
+
if ((p = u.contains) != null && p.length) {
|
|
356
|
+
const b = u.contains.filter((o) => o.type === "RECIPE"), f = u.contains.filter((o) => o.type === "SKU"), d = u.contains.filter((o) => o.type === "SKU_GROUP");
|
|
357
357
|
return [
|
|
358
|
-
...
|
|
359
|
-
var
|
|
358
|
+
...b.map((o, y) => {
|
|
359
|
+
var _;
|
|
360
360
|
return [
|
|
361
|
-
|
|
361
|
+
y === 0 ? u.name : "",
|
|
362
362
|
"RECIPE",
|
|
363
363
|
"",
|
|
364
|
-
((
|
|
364
|
+
((_ = r[o.id]) == null ? void 0 : _.name) || "",
|
|
365
365
|
o.amount.amount,
|
|
366
366
|
"",
|
|
367
367
|
"unit",
|
|
368
368
|
"Unit",
|
|
369
|
-
|
|
369
|
+
y === 0 ? v : ""
|
|
370
370
|
];
|
|
371
371
|
}),
|
|
372
|
-
...
|
|
373
|
-
var
|
|
372
|
+
...f.map((o, y) => {
|
|
373
|
+
var _, G, w, I, ee, ve, ye, ge, fe, ae, be, le, he, xe, _e, we;
|
|
374
374
|
return [
|
|
375
|
-
!
|
|
375
|
+
!b.length && y === 0 ? u.name : "",
|
|
376
376
|
"INGREDIENT",
|
|
377
|
-
((
|
|
378
|
-
((
|
|
377
|
+
((_ = l[o.id]) == null ? void 0 : _.code) || "",
|
|
378
|
+
((G = l[o.id]) == null ? void 0 : G.name) || "",
|
|
379
379
|
+pe(o.amount),
|
|
380
|
-
o.measurement ? ((
|
|
380
|
+
o.measurement ? ((I = (w = l[o.id]) == null ? void 0 : w.unit) == null ? void 0 : I.name) || "" : ((ve = (ee = l[o.id]) == null ? void 0 : ee.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
|
+
!b.length && y === 0 ? v : ""
|
|
387
387
|
];
|
|
388
388
|
}),
|
|
389
|
-
...d.map((o,
|
|
390
|
-
var
|
|
389
|
+
...d.map((o, y) => {
|
|
390
|
+
var _, G;
|
|
391
391
|
return [
|
|
392
|
-
|
|
392
|
+
b.length === 0 && f.length === 0 && y === 0 ? u.name : "",
|
|
393
393
|
"SKU_GROUP",
|
|
394
|
-
((
|
|
395
|
-
((
|
|
394
|
+
((_ = s[o.id]) == null ? void 0 : _.ref) || "",
|
|
395
|
+
((G = s[o.id]) == null ? void 0 : G.name) || "",
|
|
396
396
|
+pe(o.amount),
|
|
397
397
|
"",
|
|
398
398
|
"unit",
|
|
399
399
|
"Unit",
|
|
400
|
-
|
|
400
|
+
b.length === 0 && f.length === 0 && y === 0 ? v : ""
|
|
401
401
|
];
|
|
402
402
|
})
|
|
403
403
|
];
|
|
@@ -405,156 +405,153 @@ function st() {
|
|
|
405
405
|
return [];
|
|
406
406
|
});
|
|
407
407
|
} else
|
|
408
|
-
|
|
408
|
+
h = [
|
|
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 E = [
|
|
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
|
+
g.map((r) => r.name),
|
|
419
|
+
...h
|
|
420
|
+
], x = g.map((r) => `system:${r.id}`);
|
|
421
|
+
return Ce(E, x);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
424
|
-
const U =
|
|
425
|
-
unit:
|
|
426
|
-
ingredient:
|
|
427
|
-
recipe:
|
|
423
|
+
function dt() {
|
|
424
|
+
const U = qe({
|
|
425
|
+
unit: lt(),
|
|
426
|
+
ingredient: mt(),
|
|
427
|
+
recipe: ut()
|
|
428
428
|
}), e = "FeedMe comprehensive template.xlsx";
|
|
429
|
-
return
|
|
429
|
+
return Qe(U, e), e;
|
|
430
430
|
}
|
|
431
|
-
async function
|
|
431
|
+
async function ct(U) {
|
|
432
432
|
if (!U) return null;
|
|
433
433
|
try {
|
|
434
|
-
return
|
|
434
|
+
return st(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 pt(U) {
|
|
440
440
|
if (!U) return null;
|
|
441
441
|
try {
|
|
442
|
-
return
|
|
442
|
+
return et(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 vt(U) {
|
|
448
448
|
if (!U) return null;
|
|
449
449
|
try {
|
|
450
|
-
const e =
|
|
451
|
-
return
|
|
450
|
+
const e = at(U);
|
|
451
|
+
return it(e, { ignoreErrors: !0 });
|
|
452
452
|
} catch (e) {
|
|
453
453
|
throw console.error("Error in processRecipesSheet:", e), e;
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
|
|
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 = {
|
|
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 = {
|
|
460
457
|
key: 2,
|
|
461
458
|
class: "shrink-0"
|
|
462
|
-
},
|
|
459
|
+
}, xt = {
|
|
463
460
|
key: 0,
|
|
464
461
|
class: "flex flex-col"
|
|
465
|
-
},
|
|
462
|
+
}, _t = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, wt = {
|
|
466
463
|
key: 0,
|
|
467
464
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
468
|
-
},
|
|
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({
|
|
469
466
|
__name: "ImportDialog",
|
|
470
467
|
setup(U) {
|
|
471
|
-
const e = F(null),
|
|
472
|
-
|
|
473
|
-
const
|
|
474
|
-
async function
|
|
475
|
-
|
|
468
|
+
const e = F(null), R = We();
|
|
469
|
+
Oe();
|
|
470
|
+
const g = F(!1), h = F(new Array()), E = F(null), x = F([]), r = F([]), l = J(() => !!h.value.length), s = J(() => !!E.value && x.value.length > 0), { t: u } = je();
|
|
471
|
+
async function v(f) {
|
|
472
|
+
h.value = [], E.value = null, x.value = [], r.value = [];
|
|
476
473
|
try {
|
|
477
|
-
|
|
474
|
+
g.value = !0;
|
|
478
475
|
const [d] = await Promise.all([
|
|
479
|
-
|
|
476
|
+
Ye(f),
|
|
480
477
|
// fake buffer for UX
|
|
481
478
|
new Promise((o) => setTimeout(o, 1e3))
|
|
482
479
|
]);
|
|
483
|
-
|
|
480
|
+
E.value = d, p();
|
|
484
481
|
} catch (d) {
|
|
485
|
-
console.error("Error parsing Excel file:", d),
|
|
482
|
+
console.error("Error parsing Excel file:", d), h.value.push((d == null ? void 0 : d.message) || "Unknown error occurred");
|
|
486
483
|
} finally {
|
|
487
|
-
|
|
484
|
+
g.value = !1;
|
|
488
485
|
}
|
|
489
486
|
}
|
|
490
|
-
function
|
|
491
|
-
if (
|
|
492
|
-
const d = ["unit", "ingredient", "recipe"].filter((o) =>
|
|
487
|
+
function p() {
|
|
488
|
+
if (h.value = [], !E.value) return;
|
|
489
|
+
const d = ["unit", "ingredient", "recipe"].filter((o) => E.value.Sheets[o]);
|
|
493
490
|
if (d.length === 0) {
|
|
494
|
-
|
|
491
|
+
h.value.push("No valid sheets found. Expected sheets: unit, ingredient, or recipe");
|
|
495
492
|
return;
|
|
496
493
|
}
|
|
497
|
-
|
|
494
|
+
x.value = d, R.emitData({ availableSheets: d, workbook: E.value });
|
|
498
495
|
}
|
|
499
|
-
|
|
500
|
-
|
|
496
|
+
ze(e, (f) => {
|
|
497
|
+
f && v(f);
|
|
501
498
|
});
|
|
502
|
-
function
|
|
503
|
-
if (!
|
|
504
|
-
const
|
|
505
|
-
return
|
|
499
|
+
function b() {
|
|
500
|
+
if (!E.value || x.value.length === 0) return "";
|
|
501
|
+
const f = [];
|
|
502
|
+
return x.value.forEach((d) => {
|
|
506
503
|
switch (d) {
|
|
507
504
|
case "unit":
|
|
508
|
-
|
|
505
|
+
f.push("Units sheet found");
|
|
509
506
|
break;
|
|
510
507
|
case "ingredient":
|
|
511
|
-
|
|
508
|
+
f.push("Ingredients sheet found");
|
|
512
509
|
break;
|
|
513
510
|
case "recipe":
|
|
514
|
-
|
|
511
|
+
f.push("Recipes sheet found");
|
|
515
512
|
break;
|
|
516
513
|
}
|
|
517
|
-
}),
|
|
514
|
+
}), f.length > 0 ? `Ready to process: ${f.join(", ")}. Processing will follow dependency order.` : "No valid sheets found";
|
|
518
515
|
}
|
|
519
|
-
return (
|
|
520
|
-
const o =
|
|
521
|
-
return
|
|
522
|
-
A(
|
|
516
|
+
return (f, d) => {
|
|
517
|
+
const o = Y("FmCircularProgress"), y = Y("FmIcon"), _ = Y("FmButton");
|
|
518
|
+
return N(), D("div", yt, [
|
|
519
|
+
A(ot, {
|
|
523
520
|
class: ce({
|
|
524
521
|
"w-full": !0,
|
|
525
522
|
"h-[200px]": !e.value
|
|
526
523
|
}),
|
|
527
524
|
accept: ".xlsx,.xls",
|
|
528
|
-
onFileUpload: d[0] || (d[0] = (
|
|
525
|
+
onFileUpload: d[0] || (d[0] = (G) => e.value = G),
|
|
529
526
|
label: i(u)("inventory.ingredient.import.uploadTemplate"),
|
|
530
527
|
"button-label": i(u)("inventory.ingredient.import.selectFile")
|
|
531
|
-
},
|
|
528
|
+
}, Ke({ _: 2 }, [
|
|
532
529
|
e.value ? {
|
|
533
530
|
name: "default",
|
|
534
|
-
fn:
|
|
535
|
-
n("div",
|
|
531
|
+
fn: Q(({ openFileDialog: G }) => [
|
|
532
|
+
n("div", gt, [
|
|
536
533
|
n("div", {
|
|
537
534
|
class: ce([
|
|
538
535
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
539
536
|
{
|
|
540
|
-
"border border-fm-color-neutral-gray-100":
|
|
541
|
-
"border border-fm-color-neutral-gray-200": !
|
|
537
|
+
"border border-fm-color-neutral-gray-100": g.value,
|
|
538
|
+
"border border-fm-color-neutral-gray-200": !g.value && !l.value,
|
|
542
539
|
"border border-fm-color-system-error-200": l.value
|
|
543
540
|
}
|
|
544
541
|
])
|
|
545
542
|
}, [
|
|
546
|
-
|
|
543
|
+
g.value ? (N(), se(o, {
|
|
547
544
|
key: 0,
|
|
548
545
|
size: "md",
|
|
549
546
|
color: "neutral-gray-200"
|
|
550
|
-
})) : (
|
|
547
|
+
})) : (N(), se(y, {
|
|
551
548
|
key: 1,
|
|
552
549
|
name: l.value ? "error" : "check_circle",
|
|
553
550
|
color: l.value ? "system-error-300" : "system-success-400",
|
|
554
551
|
size: "lg"
|
|
555
552
|
}, null, 8, ["name", "color"])),
|
|
556
|
-
n("div",
|
|
557
|
-
n("div",
|
|
553
|
+
n("div", ft, [
|
|
554
|
+
n("div", bt, a(e.value.name), 1),
|
|
558
555
|
n("div", {
|
|
559
556
|
class: ce([
|
|
560
557
|
"fm-typo-en-body-sm-400",
|
|
@@ -565,105 +562,105 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
|
|
|
565
562
|
])
|
|
566
563
|
}, a(l.value ? i(u)("inventory.ingredient.import.error.invalidContent") : "File valid"), 3)
|
|
567
564
|
]),
|
|
568
|
-
|
|
569
|
-
A(
|
|
565
|
+
g.value ? Z("", !0) : (N(), D("div", ht, [
|
|
566
|
+
A(_, {
|
|
570
567
|
label: i(u)("inventory.ingredient.import.replaceFile"),
|
|
571
568
|
variant: l.value ? "destructive" : "secondary",
|
|
572
569
|
"prepend-icon": l.value ? void 0 : "autorenew",
|
|
573
|
-
onClick:
|
|
570
|
+
onClick: G
|
|
574
571
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
575
572
|
]))
|
|
576
573
|
], 2),
|
|
577
|
-
|
|
578
|
-
(
|
|
579
|
-
key:
|
|
574
|
+
h.value.length ? (N(), D("div", xt, [
|
|
575
|
+
(N(!0), D(Be, null, Pe(h.value, (w, I) => (N(), D("div", {
|
|
576
|
+
key: I,
|
|
580
577
|
class: "flex gap-8 items-center"
|
|
581
578
|
}, [
|
|
582
|
-
A(
|
|
579
|
+
A(y, {
|
|
583
580
|
name: "error",
|
|
584
581
|
size: "sm",
|
|
585
582
|
color: "system-error-300"
|
|
586
583
|
}),
|
|
587
|
-
n("div",
|
|
584
|
+
n("div", _t, a(w), 1)
|
|
588
585
|
]))), 128))
|
|
589
|
-
])) :
|
|
586
|
+
])) : Z("", !0)
|
|
590
587
|
])
|
|
591
588
|
]),
|
|
592
589
|
key: "0"
|
|
593
590
|
} : void 0
|
|
594
591
|
]), 1032, ["class", "label", "button-label"]),
|
|
595
|
-
s.value ? (
|
|
596
|
-
n("div",
|
|
597
|
-
n("div",
|
|
598
|
-
])) :
|
|
592
|
+
s.value ? (N(), D("div", wt, [
|
|
593
|
+
n("div", It, a(i(u)("inventory.ingredient.import.summary")), 1),
|
|
594
|
+
n("div", Et, a(b()), 1)
|
|
595
|
+
])) : Z("", !0)
|
|
599
596
|
]);
|
|
600
597
|
};
|
|
601
598
|
}
|
|
602
|
-
}),
|
|
599
|
+
}), kt = {
|
|
603
600
|
key: 0,
|
|
604
601
|
class: "bg-blue-50 border border-blue-200 rounded-lg p-16"
|
|
605
|
-
},
|
|
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" }, Gt = { class: "fm-typo-en-body-sm-400 text-blue-700" }, Nt = { class: "mb-8" }, Tt = ["innerHTML"], Mt = ["innerHTML"], $t = { class: "mb-8" }, Ft = { class: "mb-12" }, At = { class: "mb-12" }, Dt = { class: "mb-8" }, Bt = { class: "text-orange-600" }, Pt = {
|
|
606
603
|
key: 1,
|
|
607
604
|
class: "bg-white rounded-lg shadow"
|
|
608
|
-
},
|
|
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 = {
|
|
609
606
|
key: 0,
|
|
610
607
|
class: "text-red-600"
|
|
611
|
-
},
|
|
608
|
+
}, Kt = {
|
|
612
609
|
key: 1,
|
|
613
610
|
class: "text-orange-600"
|
|
614
|
-
},
|
|
611
|
+
}, Vt = {
|
|
615
612
|
key: 2,
|
|
616
613
|
class: "text-green-600"
|
|
617
|
-
},
|
|
614
|
+
}, Wt = { class: "flex gap-8" }, Lt = { class: "p-16" }, Jt = {
|
|
618
615
|
key: 2,
|
|
619
616
|
class: "bg-white rounded-lg shadow"
|
|
620
|
-
},
|
|
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 = {
|
|
621
618
|
key: 0,
|
|
622
619
|
class: "flex flex-col gap-16 p-16"
|
|
623
|
-
},
|
|
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" }, Hn = /* @__PURE__ */ De({
|
|
624
621
|
__name: "ImportView",
|
|
625
622
|
setup(U) {
|
|
626
|
-
const { t: e } =
|
|
627
|
-
|
|
628
|
-
const
|
|
623
|
+
const { t: e } = je(), R = Le(), g = Oe();
|
|
624
|
+
Ve();
|
|
625
|
+
const h = Xe(), { breakpoints: E } = Je(), x = ie(), r = F("");
|
|
629
626
|
F(!1);
|
|
630
|
-
const l = F(!1), s = F(null), u = F(!1),
|
|
627
|
+
const l = F(!1), s = F(null), u = F(!1), v = F(null), p = F(!1), b = F([]), f = F(null), d = F([]), o = F(!1), y = J(() => E.value.xs || E.value.sm), _ = J(() => y.value ? 10 : 20), G = J(() => {
|
|
631
628
|
const m = s.value;
|
|
632
629
|
if (!m) return [];
|
|
633
|
-
const t = [], { units:
|
|
630
|
+
const t = [], { units: C, skus: B, recipes: W, _invalidExcel: z, _invalidExcelMessage: X } = m, q = (M) => {
|
|
634
631
|
var j;
|
|
635
|
-
return ((j =
|
|
636
|
-
}, H = (
|
|
637
|
-
if (
|
|
632
|
+
return ((j = M.errors) == null ? void 0 : j.length) > 0 ? Array.isArray(M.errors) ? M.errors.join(", ") : M.errors || e("inventory.common.validationFailed") : z ? X || e("inventory.common.invalidExcelFormat") : e("inventory.common.readyToImport");
|
|
633
|
+
}, H = (M, O) => {
|
|
634
|
+
if (M)
|
|
638
635
|
for (const j of ["create", "update"]) {
|
|
639
|
-
const K =
|
|
636
|
+
const K = M[j];
|
|
640
637
|
if (K)
|
|
641
638
|
for (const P of K)
|
|
642
639
|
t.push({
|
|
643
640
|
name: P.name || P.abbrev || P.code || e("inventory.common.unknown"),
|
|
644
641
|
type: O,
|
|
645
642
|
operation: e(j === "create" ? "inventory.common.create" : "inventory.common.update"),
|
|
646
|
-
status:
|
|
643
|
+
status: q(P),
|
|
647
644
|
errors: P.errors || [],
|
|
648
645
|
details: P
|
|
649
646
|
});
|
|
650
647
|
}
|
|
651
648
|
};
|
|
652
|
-
return H(
|
|
653
|
-
}),
|
|
649
|
+
return H(C, e("inventory.common.unit")), H(B, e("inventory.common.ingredient")), H(W, e("inventory.common.recipe")), t;
|
|
650
|
+
}), w = J(() => G.value.some(
|
|
654
651
|
(m) => m.errors && m.errors.length > 0
|
|
655
|
-
)),
|
|
652
|
+
)), I = J(() => G.value.some(
|
|
656
653
|
(m) => m.status && m.status.includes("Invalid Excel")
|
|
657
|
-
)),
|
|
658
|
-
const m =
|
|
654
|
+
)), ee = J(() => {
|
|
655
|
+
const m = G.value.find(
|
|
659
656
|
(t) => t.status && t.status.includes("Invalid Excel")
|
|
660
657
|
);
|
|
661
658
|
return (m == null ? void 0 : m.status) || e("inventory.common.invalidExcelFormatDetected");
|
|
662
|
-
}), ve =
|
|
663
|
-
var
|
|
659
|
+
}), ve = J(() => !d.value || d.value.length === 0 ? [] : d.value.map((m, t) => {
|
|
660
|
+
var C, B;
|
|
664
661
|
return {
|
|
665
662
|
id: t + 1,
|
|
666
|
-
name: ((
|
|
663
|
+
name: ((C = m.error.data) == null ? void 0 : C.name) || e("inventory.common.unknown"),
|
|
667
664
|
type: m.type || e("inventory.common.general"),
|
|
668
665
|
message: ((B = m.error) == null ? void 0 : B.message) || JSON.stringify(m.error)
|
|
669
666
|
};
|
|
@@ -675,9 +672,9 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
|
|
|
675
672
|
}
|
|
676
673
|
}
|
|
677
674
|
function ge() {
|
|
678
|
-
|
|
675
|
+
R.open({
|
|
679
676
|
title: e("inventory.common.import"),
|
|
680
|
-
contentComponent:
|
|
677
|
+
contentComponent: St,
|
|
681
678
|
overlay: !0,
|
|
682
679
|
closeButton: !0,
|
|
683
680
|
primaryActions: {
|
|
@@ -694,17 +691,17 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
|
|
|
694
691
|
variant: "plain"
|
|
695
692
|
}
|
|
696
693
|
}).onPrimary(async (m) => {
|
|
697
|
-
m && m.workbook && m.availableSheets && (await fe(m),
|
|
694
|
+
m && m.workbook && m.availableSheets && (await fe(m), R.close()), b.value.length === 0 && R.close();
|
|
698
695
|
}).onTertiary(() => {
|
|
699
696
|
try {
|
|
700
|
-
const m =
|
|
701
|
-
|
|
697
|
+
const m = dt();
|
|
698
|
+
g.open({
|
|
702
699
|
title: e("inventory.common.export") + " " + e("inventory.ingredient.import.actions.downloadTemplate"),
|
|
703
700
|
message: e("inventory.common.templateDownloaded", [m]),
|
|
704
701
|
type: "success"
|
|
705
702
|
});
|
|
706
703
|
} catch (m) {
|
|
707
|
-
|
|
704
|
+
g.open({
|
|
708
705
|
title: e("inventory.common.downloadFailed"),
|
|
709
706
|
message: e("inventory.common.failedDownloadTemplate"),
|
|
710
707
|
type: "error"
|
|
@@ -713,78 +710,78 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
|
|
|
713
710
|
});
|
|
714
711
|
}
|
|
715
712
|
async function fe(m) {
|
|
716
|
-
|
|
713
|
+
f.value = m.workbook, b.value = [...m.availableSheets], s.value = {}, d.value = [], await ae();
|
|
717
714
|
}
|
|
718
715
|
async function ae() {
|
|
719
|
-
var t,
|
|
720
|
-
if (!
|
|
716
|
+
var t, C, B, W, z, X, q, H, M, O, j, K, P, me, ue;
|
|
717
|
+
if (!f.value || b.value.length === 0) {
|
|
721
718
|
u.value = !0;
|
|
722
719
|
return;
|
|
723
720
|
}
|
|
724
|
-
const m =
|
|
721
|
+
const m = b.value[0];
|
|
725
722
|
try {
|
|
726
723
|
switch (m) {
|
|
727
724
|
case "unit": {
|
|
728
|
-
const
|
|
729
|
-
|
|
725
|
+
const L = f.value.Sheets.unit, S = await ct(L);
|
|
726
|
+
S && (s.value = {
|
|
730
727
|
...s.value,
|
|
731
|
-
_invalidExcel:
|
|
732
|
-
_invalidExcelMessage:
|
|
733
|
-
units:
|
|
734
|
-
create: ((B =
|
|
735
|
-
|
|
736
|
-
errors:
|
|
728
|
+
_invalidExcel: S.invalidExcel || ((t = s.value) == null ? void 0 : t._invalidExcel),
|
|
729
|
+
_invalidExcelMessage: S.invalidExcelMessage || ((C = s.value) == null ? void 0 : C._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Units sheet",
|
|
730
|
+
units: S.importCreateResult || S.importUpdateResult ? {
|
|
731
|
+
create: ((B = S.importCreateResult) == null ? void 0 : B.map(($) => ({
|
|
732
|
+
...$.unit,
|
|
733
|
+
errors: $.errors
|
|
737
734
|
}))) || [],
|
|
738
|
-
update: ((
|
|
739
|
-
|
|
740
|
-
errors:
|
|
735
|
+
update: ((W = S.importUpdateResult) == null ? void 0 : W.map(($) => ({
|
|
736
|
+
...$.unit,
|
|
737
|
+
errors: $.errors
|
|
741
738
|
}))) || []
|
|
742
739
|
} : (z = s.value) == null ? void 0 : z.units
|
|
743
740
|
});
|
|
744
741
|
break;
|
|
745
742
|
}
|
|
746
743
|
case "ingredient": {
|
|
747
|
-
const
|
|
748
|
-
|
|
744
|
+
const L = f.value.Sheets.ingredient, S = await pt(L);
|
|
745
|
+
S && (s.value = {
|
|
749
746
|
...s.value,
|
|
750
|
-
_invalidExcel:
|
|
751
|
-
_invalidExcelMessage:
|
|
752
|
-
skus:
|
|
753
|
-
create: ((H =
|
|
754
|
-
|
|
755
|
-
errors:
|
|
747
|
+
_invalidExcel: S.invalidExcel || ((X = s.value) == null ? void 0 : X._invalidExcel),
|
|
748
|
+
_invalidExcelMessage: S.invalidExcelMessage || ((q = s.value) == null ? void 0 : q._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Ingredients sheet",
|
|
749
|
+
skus: S.importCreateResult || S.importUpdateResult ? {
|
|
750
|
+
create: ((H = S.importCreateResult) == null ? void 0 : H.map(($) => ({
|
|
751
|
+
...$.sku,
|
|
752
|
+
errors: $.errors
|
|
756
753
|
}))) || [],
|
|
757
|
-
update: ((
|
|
758
|
-
|
|
759
|
-
errors:
|
|
754
|
+
update: ((M = S.importUpdateResult) == null ? void 0 : M.map(($) => ({
|
|
755
|
+
...$.sku,
|
|
756
|
+
errors: $.errors
|
|
760
757
|
}))) || []
|
|
761
758
|
} : (O = s.value) == null ? void 0 : O.skus
|
|
762
759
|
});
|
|
763
760
|
break;
|
|
764
761
|
}
|
|
765
762
|
case "recipe": {
|
|
766
|
-
const
|
|
767
|
-
|
|
763
|
+
const L = f.value.Sheets.recipe, S = await vt(L);
|
|
764
|
+
S && (s.value = {
|
|
768
765
|
...s.value,
|
|
769
|
-
_invalidExcel:
|
|
770
|
-
_invalidExcelMessage:
|
|
771
|
-
recipes:
|
|
772
|
-
create: ((P =
|
|
773
|
-
|
|
774
|
-
errors:
|
|
766
|
+
_invalidExcel: S.invalidExcel || ((j = s.value) == null ? void 0 : j._invalidExcel),
|
|
767
|
+
_invalidExcelMessage: S.invalidExcelMessage || ((K = s.value) == null ? void 0 : K._invalidExcelMessage) || e("inventory.common.invalidExcelFormat") + " for Recipes sheet",
|
|
768
|
+
recipes: S.importCreateResult || S.importUpdateResult ? {
|
|
769
|
+
create: ((P = S.importCreateResult) == null ? void 0 : P.map(($) => ({
|
|
770
|
+
...$.recipe,
|
|
771
|
+
errors: $.errors
|
|
775
772
|
}))) || [],
|
|
776
|
-
update: ((me =
|
|
777
|
-
|
|
778
|
-
errors:
|
|
773
|
+
update: ((me = S.importUpdateResult) == null ? void 0 : me.map(($) => ({
|
|
774
|
+
...$.recipe,
|
|
775
|
+
errors: $.errors
|
|
779
776
|
}))) || []
|
|
780
777
|
} : (ue = s.value) == null ? void 0 : ue.recipes
|
|
781
778
|
});
|
|
782
779
|
break;
|
|
783
780
|
}
|
|
784
781
|
}
|
|
785
|
-
|
|
786
|
-
} catch (
|
|
787
|
-
console.error(`Error processing ${m} sheet:`,
|
|
782
|
+
b.value.shift(), u.value = !0;
|
|
783
|
+
} catch (L) {
|
|
784
|
+
console.error(`Error processing ${m} sheet:`, L), g.open({
|
|
788
785
|
title: e("inventory.common.processingError"),
|
|
789
786
|
message: e("inventory.common.failedToProcessSheet", [m]),
|
|
790
787
|
type: "error"
|
|
@@ -792,18 +789,18 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
|
|
|
792
789
|
}
|
|
793
790
|
}
|
|
794
791
|
async function be() {
|
|
795
|
-
var m, t,
|
|
792
|
+
var m, t, C, B, W, z, X, q, H, M, O, j, K, P, me, ue, L, S, $, Ue, Ge, Ne, Te, Me;
|
|
796
793
|
if (s.value) {
|
|
797
|
-
if (
|
|
798
|
-
|
|
794
|
+
if (I.value) {
|
|
795
|
+
g.open({
|
|
799
796
|
title: e("inventory.common.invalidExcelFormatTitle"),
|
|
800
|
-
message:
|
|
797
|
+
message: ee.value,
|
|
801
798
|
type: "error"
|
|
802
799
|
});
|
|
803
800
|
return;
|
|
804
801
|
}
|
|
805
|
-
if (
|
|
806
|
-
|
|
802
|
+
if (w.value) {
|
|
803
|
+
g.open({
|
|
807
804
|
title: e("inventory.ingredient.import.error.invalidContent"),
|
|
808
805
|
message: e("inventory.ingredient.import.error.hasErrors"),
|
|
809
806
|
type: "error"
|
|
@@ -812,115 +809,115 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
|
|
|
812
809
|
}
|
|
813
810
|
l.value = !0;
|
|
814
811
|
try {
|
|
815
|
-
let
|
|
812
|
+
let V = 0, oe = "";
|
|
816
813
|
if (s.value.units && ((m = s.value.units.create) != null && m.length || (t = s.value.units.update) != null && t.length)) {
|
|
817
|
-
const
|
|
818
|
-
create:
|
|
819
|
-
update:
|
|
814
|
+
const T = {
|
|
815
|
+
create: ((C = s.value.units.create) == null ? void 0 : C.filter((c) => !c.errors || c.errors.length === 0)) || [],
|
|
816
|
+
update: ((B = s.value.units.update) == null ? void 0 : B.filter((c) => !c.errors || c.errors.length === 0)) || []
|
|
820
817
|
};
|
|
821
|
-
if (
|
|
822
|
-
const
|
|
823
|
-
((
|
|
818
|
+
if (T.create.length || T.update.length) {
|
|
819
|
+
const c = await x.importUnits(T);
|
|
820
|
+
((W = c == null ? void 0 : c.errors) == null ? void 0 : W.length) > 0 && d.value.push(...c.errors.map((re) => ({
|
|
824
821
|
type: "units",
|
|
825
|
-
error:
|
|
822
|
+
error: re
|
|
826
823
|
})));
|
|
827
|
-
const
|
|
828
|
-
|
|
824
|
+
const te = T.create.length + T.update.length, ne = ((z = c == null ? void 0 : c.errors) == null ? void 0 : z.length) || 0;
|
|
825
|
+
V = te - ne, oe = "units", s.value = {
|
|
829
826
|
...s.value,
|
|
830
827
|
units: null
|
|
831
828
|
};
|
|
832
829
|
}
|
|
833
|
-
} else if (s.value.skus && ((
|
|
834
|
-
const
|
|
835
|
-
create:
|
|
836
|
-
update:
|
|
830
|
+
} else if (s.value.skus && ((X = s.value.skus.create) != null && X.length || (q = s.value.skus.update) != null && q.length)) {
|
|
831
|
+
const T = {
|
|
832
|
+
create: ((H = s.value.skus.create) == null ? void 0 : H.filter((c) => !c.errors || c.errors.length === 0)) || [],
|
|
833
|
+
update: ((M = s.value.skus.update) == null ? void 0 : M.filter((c) => !c.errors || c.errors.length === 0)) || []
|
|
837
834
|
};
|
|
838
|
-
if (
|
|
839
|
-
const
|
|
840
|
-
((
|
|
835
|
+
if (T.create.length || T.update.length) {
|
|
836
|
+
const c = await x.importSkus(T);
|
|
837
|
+
((O = c == null ? void 0 : c.errors) == null ? void 0 : O.length) > 0 && d.value.push(...c.errors.map((re) => ({
|
|
841
838
|
type: "ingredients",
|
|
842
|
-
error:
|
|
839
|
+
error: re
|
|
843
840
|
})));
|
|
844
|
-
const
|
|
845
|
-
|
|
841
|
+
const te = T.create.length + T.update.length, ne = ((j = c == null ? void 0 : c.errors) == null ? void 0 : j.length) || 0;
|
|
842
|
+
V = te - ne, oe = "ingredients", s.value = {
|
|
846
843
|
...s.value,
|
|
847
844
|
skus: null
|
|
848
845
|
};
|
|
849
846
|
}
|
|
850
|
-
} else if (s.value.recipes && ((
|
|
851
|
-
const
|
|
852
|
-
create:
|
|
853
|
-
update:
|
|
847
|
+
} else if (s.value.recipes && ((K = s.value.recipes.create) != null && K.length || (P = s.value.recipes.update) != null && P.length)) {
|
|
848
|
+
const T = {
|
|
849
|
+
create: ((me = s.value.recipes.create) == null ? void 0 : me.filter((c) => !c.errors || c.errors.length === 0)) || [],
|
|
850
|
+
update: ((ue = s.value.recipes.update) == null ? void 0 : ue.filter((c) => !c.errors || c.errors.length === 0)) || []
|
|
854
851
|
};
|
|
855
|
-
if (
|
|
856
|
-
const
|
|
857
|
-
((
|
|
852
|
+
if (T.create.length || T.update.length) {
|
|
853
|
+
const c = await x.importRecipes(T);
|
|
854
|
+
((L = c == null ? void 0 : c.errors) == null ? void 0 : L.length) > 0 && d.value.push(...c.errors.map((re) => ({
|
|
858
855
|
type: "recipes",
|
|
859
|
-
error:
|
|
856
|
+
error: re
|
|
860
857
|
})));
|
|
861
|
-
const
|
|
862
|
-
|
|
858
|
+
const te = T.create.length + T.update.length, ne = ((S = c == null ? void 0 : c.errors) == null ? void 0 : S.length) || 0;
|
|
859
|
+
V = te - ne, oe = "recipes", s.value = {
|
|
863
860
|
...s.value,
|
|
864
861
|
recipes: null
|
|
865
862
|
};
|
|
866
863
|
}
|
|
867
864
|
}
|
|
868
|
-
if (
|
|
869
|
-
const
|
|
870
|
-
|
|
865
|
+
if (V > 0) {
|
|
866
|
+
const T = d.value.filter((c) => c.type === oe);
|
|
867
|
+
T.length > 0 ? g.open({
|
|
871
868
|
title: e("inventory.common.importCompletedWithIssues"),
|
|
872
|
-
message: e("inventory.common.successfullyImported", [
|
|
869
|
+
message: e("inventory.common.successfullyImported", [V, oe, T.length, oe]),
|
|
873
870
|
type: "warning"
|
|
874
|
-
}) :
|
|
871
|
+
}) : g.open({
|
|
875
872
|
title: e("inventory.ingredient.import.success"),
|
|
876
|
-
message: e("inventory.common.successfullyImported", [
|
|
873
|
+
message: e("inventory.common.successfullyImported", [V, oe, "0", ""]),
|
|
877
874
|
type: "success"
|
|
878
875
|
});
|
|
879
876
|
}
|
|
880
|
-
if (
|
|
877
|
+
if (b.value.length > 0)
|
|
881
878
|
await ae();
|
|
882
|
-
else if (!(s.value.units && (((
|
|
879
|
+
else if (!(s.value.units && ((($ = s.value.units.create) == null ? void 0 : $.length) || ((Ue = s.value.units.update) == null ? void 0 : Ue.length)) || s.value.skus && (((Ge = s.value.skus.create) == null ? void 0 : Ge.length) || ((Ne = s.value.skus.update) == null ? void 0 : Ne.length)) || s.value.recipes && (((Te = s.value.recipes.create) == null ? void 0 : Te.length) || ((Me = s.value.recipes.update) == null ? void 0 : Me.length))))
|
|
883
880
|
if (le(), d.value.length > 0) {
|
|
884
|
-
const
|
|
885
|
-
o.value = !0,
|
|
881
|
+
const c = d.value.filter((de) => de.type === "units").length, te = d.value.filter((de) => de.type === "ingredients").length, ne = d.value.filter((de) => de.type === "recipes").length, re = c + te + ne;
|
|
882
|
+
o.value = !0, g.open({
|
|
886
883
|
title: e("inventory.common.importCompletedWithIssues"),
|
|
887
|
-
message: e("inventory.common.importFinishedWithFailedItems", [
|
|
884
|
+
message: e("inventory.common.importFinishedWithFailedItems", [re, c, te, ne]),
|
|
888
885
|
type: "warning"
|
|
889
886
|
}), console.error("Import errors:", d.value);
|
|
890
887
|
} else
|
|
891
|
-
|
|
888
|
+
g.open({
|
|
892
889
|
title: e("inventory.common.importComplete"),
|
|
893
890
|
message: e("inventory.common.allDataSuccessfullyImported"),
|
|
894
891
|
type: "success"
|
|
895
892
|
});
|
|
896
|
-
} catch (
|
|
897
|
-
|
|
893
|
+
} catch (V) {
|
|
894
|
+
g.open({
|
|
898
895
|
title: e("inventory.ingredient.import.error.failed"),
|
|
899
|
-
message: (
|
|
896
|
+
message: (V == null ? void 0 : V.message) || e("inventory.common.unknownErrorOccurred"),
|
|
900
897
|
type: "error"
|
|
901
|
-
}), console.error("Error during import:",
|
|
898
|
+
}), console.error("Error during import:", V);
|
|
902
899
|
} finally {
|
|
903
900
|
l.value = !1;
|
|
904
901
|
}
|
|
905
902
|
}
|
|
906
903
|
}
|
|
907
904
|
function le() {
|
|
908
|
-
u.value = !1, o.value = !1, s.value = null,
|
|
905
|
+
u.value = !1, o.value = !1, s.value = null, b.value = [], f.value = null;
|
|
909
906
|
}
|
|
910
907
|
function he() {
|
|
911
908
|
o.value = !1, d.value = [];
|
|
912
909
|
}
|
|
913
910
|
function xe() {
|
|
914
|
-
|
|
911
|
+
p.value = !1, v.value = null;
|
|
915
912
|
}
|
|
916
|
-
const _e =
|
|
913
|
+
const _e = J(() => [
|
|
917
914
|
{
|
|
918
915
|
label: e("inventory.common.import"),
|
|
919
916
|
value: "import",
|
|
920
917
|
isPrimary: !1,
|
|
921
918
|
prependIcon: "upload"
|
|
922
919
|
}
|
|
923
|
-
]), we =
|
|
920
|
+
]), we = $e([
|
|
924
921
|
{
|
|
925
922
|
id: "name",
|
|
926
923
|
accessorKey: "name",
|
|
@@ -946,11 +943,11 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
|
|
|
946
943
|
size: 120,
|
|
947
944
|
cell: (m) => {
|
|
948
945
|
const t = m.row.original.status;
|
|
949
|
-
let
|
|
950
|
-
return t === e("inventory.common.readyToImport") ?
|
|
946
|
+
let C = "px-8 py-4 rounded";
|
|
947
|
+
return t === e("inventory.common.readyToImport") ? C += " bg-blue-100 text-blue-800 border border-blue-200" : t === "Imported" || t === "Successfully Imported" ? C += " bg-green-100 text-green-800 border border-green-200" : t === "Failed" ? C += " bg-red-100 text-red-800 border border-red-200" : t === e("inventory.common.validationFailed") ? C += " bg-orange-100 text-orange-800 border border-orange-200" : (t.includes("Invalid Excel"), C += " bg-red-100 text-red-800 border border-red-200"), Ie("div", { class: C, title: t }, t);
|
|
951
948
|
}
|
|
952
949
|
}
|
|
953
|
-
]), Se =
|
|
950
|
+
]), Se = $e([
|
|
954
951
|
{
|
|
955
952
|
id: "name",
|
|
956
953
|
accessorKey: "name",
|
|
@@ -962,8 +959,8 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
|
|
|
962
959
|
accessorKey: "type",
|
|
963
960
|
header: () => e("inventory.common.errorType"),
|
|
964
961
|
cell: (m) => {
|
|
965
|
-
const t = m.row.original.type,
|
|
966
|
-
return Ie("div", { class: "text-gray-800 text-sm py-2" },
|
|
962
|
+
const t = m.row.original.type, C = e(t === "units" ? "inventory.common.unit" : t === "ingredients" ? "inventory.common.ingredient" : t === "recipes" ? "inventory.common.recipe" : "inventory.common.unknown");
|
|
963
|
+
return Ie("div", { class: "text-gray-800 text-sm py-2" }, C);
|
|
967
964
|
}
|
|
968
965
|
},
|
|
969
966
|
{
|
|
@@ -978,140 +975,140 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
|
|
|
978
975
|
}
|
|
979
976
|
]);
|
|
980
977
|
return (m, t) => {
|
|
981
|
-
const
|
|
982
|
-
return i(
|
|
978
|
+
const C = Y("FmIcon"), B = Y("FmButton"), W = Y("FmTable"), z = Y("FmCard"), X = Y("FmSideSheet"), q = Y("FmSpinner");
|
|
979
|
+
return i(h).isLoaded && i(h).enableBulkImport ? (N(), se(ke, {
|
|
983
980
|
key: 0,
|
|
984
981
|
title: i(e)("inventory.common.import"),
|
|
985
982
|
actions: _e.value,
|
|
986
983
|
"onClick:action": ye
|
|
987
984
|
}, {
|
|
988
|
-
default:
|
|
985
|
+
default: Q(() => {
|
|
989
986
|
var H;
|
|
990
987
|
return [
|
|
991
988
|
n("div", {
|
|
992
989
|
class: ce([
|
|
993
990
|
"flex flex-col gap-8 max-h-full",
|
|
994
991
|
{
|
|
995
|
-
"p-0":
|
|
996
|
-
"px-24": !
|
|
992
|
+
"p-0": y.value,
|
|
993
|
+
"px-24": !y.value
|
|
997
994
|
}
|
|
998
995
|
])
|
|
999
996
|
}, [
|
|
1000
|
-
u.value ?
|
|
1001
|
-
n("div",
|
|
1002
|
-
A(
|
|
997
|
+
u.value ? Z("", !0) : (N(), D("div", kt, [
|
|
998
|
+
n("div", Rt, [
|
|
999
|
+
A(C, {
|
|
1003
1000
|
name: "info",
|
|
1004
1001
|
class: "text-blue-600 mt-2"
|
|
1005
1002
|
}),
|
|
1006
|
-
n("div",
|
|
1007
|
-
n("div",
|
|
1008
|
-
n("div",
|
|
1009
|
-
n("div",
|
|
1003
|
+
n("div", Ct, [
|
|
1004
|
+
n("div", Ut, a(i(e)("inventory.ingredient.import.multiUploadTemplateInstruction")), 1),
|
|
1005
|
+
n("div", Gt, [
|
|
1006
|
+
n("div", Nt, [
|
|
1010
1007
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
|
|
1011
1008
|
]),
|
|
1012
|
-
t[39] || (t[39] =
|
|
1009
|
+
t[39] || (t[39] = k(" 1. ")),
|
|
1013
1010
|
n("span", {
|
|
1014
1011
|
innerHTML: i(e)("inventory.ingredient.import.importInstructions.step1")
|
|
1015
|
-
}, null, 8,
|
|
1012
|
+
}, null, 8, Tt),
|
|
1016
1013
|
t[40] || (t[40] = n("br", null, null, -1)),
|
|
1017
|
-
t[41] || (t[41] =
|
|
1014
|
+
t[41] || (t[41] = k(" 2. ")),
|
|
1018
1015
|
n("span", {
|
|
1019
1016
|
innerHTML: i(e)("inventory.ingredient.import.importInstructions.step2")
|
|
1020
|
-
}, null, 8,
|
|
1017
|
+
}, null, 8, Mt),
|
|
1021
1018
|
t[42] || (t[42] = n("br", null, null, -1)),
|
|
1022
|
-
|
|
1019
|
+
k(" 3. " + a(i(e)("inventory.ingredient.import.importInstructions.step3")), 1),
|
|
1023
1020
|
t[43] || (t[43] = n("br", null, null, -1)),
|
|
1024
|
-
|
|
1021
|
+
k(" 4. " + a(i(e)("inventory.ingredient.import.importInstructions.step4")), 1),
|
|
1025
1022
|
t[44] || (t[44] = n("br", null, null, -1)),
|
|
1026
1023
|
t[45] || (t[45] = n("br", null, null, -1)),
|
|
1027
|
-
n("div",
|
|
1024
|
+
n("div", $t, [
|
|
1028
1025
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.title")), 1)
|
|
1029
1026
|
]),
|
|
1030
|
-
n("div",
|
|
1027
|
+
n("div", Ft, [
|
|
1031
1028
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.title")), 1),
|
|
1032
|
-
|
|
1029
|
+
k(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.description")), 1),
|
|
1033
1030
|
t[1] || (t[1] = n("br", null, null, -1)),
|
|
1034
|
-
t[2] || (t[2] =
|
|
1031
|
+
t[2] || (t[2] = k(" • ")),
|
|
1035
1032
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col1")), 1),
|
|
1036
1033
|
t[3] || (t[3] = n("br", null, null, -1)),
|
|
1037
|
-
t[4] || (t[4] =
|
|
1034
|
+
t[4] || (t[4] = k(" • ")),
|
|
1038
1035
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col2")), 1),
|
|
1039
1036
|
t[5] || (t[5] = n("br", null, null, -1)),
|
|
1040
|
-
t[6] || (t[6] =
|
|
1037
|
+
t[6] || (t[6] = k(" • ")),
|
|
1041
1038
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col3")), 1),
|
|
1042
1039
|
t[7] || (t[7] = n("br", null, null, -1)),
|
|
1043
|
-
t[8] || (t[8] =
|
|
1040
|
+
t[8] || (t[8] = k(" • ")),
|
|
1044
1041
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col4")), 1),
|
|
1045
1042
|
t[9] || (t[9] = n("br", null, null, -1)),
|
|
1046
|
-
t[10] || (t[10] =
|
|
1043
|
+
t[10] || (t[10] = k(" • ")),
|
|
1047
1044
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col5")), 1),
|
|
1048
1045
|
t[11] || (t[11] = n("br", null, null, -1)),
|
|
1049
|
-
t[12] || (t[12] =
|
|
1046
|
+
t[12] || (t[12] = k(" • ")),
|
|
1050
1047
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.unitsSheet.col6")), 1)
|
|
1051
1048
|
]),
|
|
1052
|
-
n("div",
|
|
1049
|
+
n("div", At, [
|
|
1053
1050
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.title")), 1),
|
|
1054
|
-
|
|
1051
|
+
k(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.description")), 1),
|
|
1055
1052
|
t[13] || (t[13] = n("br", null, null, -1)),
|
|
1056
|
-
t[14] || (t[14] =
|
|
1053
|
+
t[14] || (t[14] = k(" • ")),
|
|
1057
1054
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col1")), 1),
|
|
1058
1055
|
t[15] || (t[15] = n("br", null, null, -1)),
|
|
1059
|
-
t[16] || (t[16] =
|
|
1056
|
+
t[16] || (t[16] = k(" • ")),
|
|
1060
1057
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col2")), 1),
|
|
1061
1058
|
t[17] || (t[17] = n("br", null, null, -1)),
|
|
1062
|
-
t[18] || (t[18] =
|
|
1059
|
+
t[18] || (t[18] = k(" • ")),
|
|
1063
1060
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col3")), 1),
|
|
1064
1061
|
t[19] || (t[19] = n("br", null, null, -1)),
|
|
1065
|
-
t[20] || (t[20] =
|
|
1062
|
+
t[20] || (t[20] = k(" • ")),
|
|
1066
1063
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col4")), 1),
|
|
1067
1064
|
t[21] || (t[21] = n("br", null, null, -1)),
|
|
1068
|
-
t[22] || (t[22] =
|
|
1065
|
+
t[22] || (t[22] = k(" • ")),
|
|
1069
1066
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.ingredientsSheet.col5")), 1)
|
|
1070
1067
|
]),
|
|
1071
|
-
n("div",
|
|
1068
|
+
n("div", Dt, [
|
|
1072
1069
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.title")), 1),
|
|
1073
|
-
|
|
1070
|
+
k(" " + a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.description")), 1),
|
|
1074
1071
|
t[23] || (t[23] = n("br", null, null, -1)),
|
|
1075
|
-
t[24] || (t[24] =
|
|
1072
|
+
t[24] || (t[24] = k(" • ")),
|
|
1076
1073
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col1")), 1),
|
|
1077
1074
|
t[25] || (t[25] = n("br", null, null, -1)),
|
|
1078
|
-
t[26] || (t[26] =
|
|
1075
|
+
t[26] || (t[26] = k(" • ")),
|
|
1079
1076
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col2")), 1),
|
|
1080
1077
|
t[27] || (t[27] = n("br", null, null, -1)),
|
|
1081
|
-
t[28] || (t[28] =
|
|
1078
|
+
t[28] || (t[28] = k(" • ")),
|
|
1082
1079
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col3")), 1),
|
|
1083
1080
|
t[29] || (t[29] = n("br", null, null, -1)),
|
|
1084
|
-
t[30] || (t[30] =
|
|
1081
|
+
t[30] || (t[30] = k(" • ")),
|
|
1085
1082
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col4")), 1),
|
|
1086
1083
|
t[31] || (t[31] = n("br", null, null, -1)),
|
|
1087
|
-
t[32] || (t[32] =
|
|
1084
|
+
t[32] || (t[32] = k(" • ")),
|
|
1088
1085
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col5")), 1),
|
|
1089
1086
|
t[33] || (t[33] = n("br", null, null, -1)),
|
|
1090
|
-
t[34] || (t[34] =
|
|
1087
|
+
t[34] || (t[34] = k(" • ")),
|
|
1091
1088
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col6")), 1),
|
|
1092
1089
|
t[35] || (t[35] = n("br", null, null, -1)),
|
|
1093
|
-
t[36] || (t[36] =
|
|
1090
|
+
t[36] || (t[36] = k(" • ")),
|
|
1094
1091
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col7")), 1),
|
|
1095
1092
|
t[37] || (t[37] = n("br", null, null, -1)),
|
|
1096
|
-
t[38] || (t[38] =
|
|
1093
|
+
t[38] || (t[38] = k(" • ")),
|
|
1097
1094
|
n("em", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.recipesSheet.col8")), 1)
|
|
1098
1095
|
]),
|
|
1099
|
-
n("div",
|
|
1096
|
+
n("div", Bt, [
|
|
1100
1097
|
n("strong", null, a(i(e)("inventory.ingredient.import.importInstructions.detailedGuide.warning")), 1)
|
|
1101
1098
|
])
|
|
1102
1099
|
])
|
|
1103
1100
|
])
|
|
1104
1101
|
])
|
|
1105
1102
|
])),
|
|
1106
|
-
u.value ? (
|
|
1107
|
-
n("div",
|
|
1103
|
+
u.value ? (N(), D("div", Pt, [
|
|
1104
|
+
n("div", jt, [
|
|
1108
1105
|
n("div", null, [
|
|
1109
|
-
n("div",
|
|
1110
|
-
n("div",
|
|
1111
|
-
|
|
1106
|
+
n("div", Ot, a(i(e)("inventory.common.importPreview")), 1),
|
|
1107
|
+
n("div", Ht, [
|
|
1108
|
+
I.value ? (N(), D("span", zt, a(i(e)("inventory.common.errorExist")) + ": " + a(ee.value), 1)) : w.value ? (N(), D("span", Kt, a(i(e)("inventory.common.someItemsValidationErrors")), 1)) : (N(), D("span", Vt, a(i(e)("inventory.common.allItemsValidReadyImport")), 1))
|
|
1112
1109
|
])
|
|
1113
1110
|
]),
|
|
1114
|
-
n("div",
|
|
1111
|
+
n("div", Wt, [
|
|
1115
1112
|
A(B, {
|
|
1116
1113
|
variant: "secondary",
|
|
1117
1114
|
onClick: le,
|
|
@@ -1121,29 +1118,29 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
|
|
|
1121
1118
|
variant: "primary",
|
|
1122
1119
|
onClick: be,
|
|
1123
1120
|
loading: l.value,
|
|
1124
|
-
disabled: l.value ||
|
|
1121
|
+
disabled: l.value || w.value || I.value,
|
|
1125
1122
|
label: i(e)("inventory.common.import")
|
|
1126
1123
|
}, null, 8, ["loading", "disabled", "label"])
|
|
1127
1124
|
])
|
|
1128
1125
|
]),
|
|
1129
|
-
n("div",
|
|
1130
|
-
A(
|
|
1126
|
+
n("div", Lt, [
|
|
1127
|
+
A(W, {
|
|
1131
1128
|
"column-defs": we.value,
|
|
1132
|
-
"row-data":
|
|
1133
|
-
"page-size":
|
|
1129
|
+
"row-data": G.value,
|
|
1130
|
+
"page-size": _.value,
|
|
1134
1131
|
"search-value": r.value,
|
|
1135
1132
|
loading: !1,
|
|
1136
1133
|
"row-hover": ""
|
|
1137
1134
|
}, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
|
|
1138
1135
|
])
|
|
1139
|
-
])) :
|
|
1140
|
-
o.value && d.value.length > 0 ? (
|
|
1141
|
-
n("div",
|
|
1136
|
+
])) : Z("", !0),
|
|
1137
|
+
o.value && d.value.length > 0 ? (N(), D("div", Jt, [
|
|
1138
|
+
n("div", Xt, [
|
|
1142
1139
|
n("div", null, [
|
|
1143
|
-
n("div",
|
|
1144
|
-
n("div",
|
|
1140
|
+
n("div", qt, a(i(e)("inventory.common.importErrors")), 1),
|
|
1141
|
+
n("div", Qt, a(d.value.length) + " " + a(i(e)("inventory.common.itemsFailedImport")), 1)
|
|
1145
1142
|
]),
|
|
1146
|
-
n("div",
|
|
1143
|
+
n("div", Yt, [
|
|
1147
1144
|
A(B, {
|
|
1148
1145
|
variant: "secondary",
|
|
1149
1146
|
onClick: he,
|
|
@@ -1151,27 +1148,27 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
|
|
|
1151
1148
|
}, null, 8, ["label"])
|
|
1152
1149
|
])
|
|
1153
1150
|
]),
|
|
1154
|
-
n("div",
|
|
1155
|
-
A(
|
|
1151
|
+
n("div", Zt, [
|
|
1152
|
+
A(W, {
|
|
1156
1153
|
"column-defs": Se.value,
|
|
1157
1154
|
"row-data": ve.value,
|
|
1158
|
-
"page-size":
|
|
1155
|
+
"page-size": _.value,
|
|
1159
1156
|
"search-value": r.value,
|
|
1160
1157
|
loading: !1,
|
|
1161
1158
|
"row-hover": ""
|
|
1162
1159
|
}, null, 8, ["column-defs", "row-data", "page-size", "search-value"])
|
|
1163
1160
|
])
|
|
1164
|
-
])) :
|
|
1161
|
+
])) : Z("", !0)
|
|
1165
1162
|
], 2),
|
|
1166
|
-
A(
|
|
1167
|
-
"model-value":
|
|
1168
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
1169
|
-
header: `${(H =
|
|
1163
|
+
A(X, {
|
|
1164
|
+
"model-value": p.value,
|
|
1165
|
+
"onUpdate:modelValue": t[0] || (t[0] = (M) => p.value = M),
|
|
1166
|
+
header: `${(H = v.value) == null ? void 0 : H.type} Details`,
|
|
1170
1167
|
"max-width": 600,
|
|
1171
1168
|
"dismiss-away": ""
|
|
1172
1169
|
}, {
|
|
1173
|
-
"side-sheet-footer":
|
|
1174
|
-
n("div",
|
|
1170
|
+
"side-sheet-footer": Q(() => [
|
|
1171
|
+
n("div", xn, [
|
|
1175
1172
|
A(B, {
|
|
1176
1173
|
label: i(e)("inventory.common.close"),
|
|
1177
1174
|
variant: "tertiary",
|
|
@@ -1179,116 +1176,116 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
|
|
|
1179
1176
|
}, null, 8, ["label"])
|
|
1180
1177
|
])
|
|
1181
1178
|
]),
|
|
1182
|
-
default:
|
|
1183
|
-
|
|
1179
|
+
default: Q(() => [
|
|
1180
|
+
v.value != null ? (N(), D("div", en, [
|
|
1184
1181
|
A(z, {
|
|
1185
1182
|
variant: "outlined",
|
|
1186
1183
|
class: "p-16"
|
|
1187
1184
|
}, {
|
|
1188
|
-
default:
|
|
1189
|
-
var
|
|
1185
|
+
default: Q(() => {
|
|
1186
|
+
var M, O, j, K, P;
|
|
1190
1187
|
return [
|
|
1191
|
-
n("div",
|
|
1192
|
-
n("div",
|
|
1188
|
+
n("div", tn, a(i(e)("inventory.common.basicInformation")), 1),
|
|
1189
|
+
n("div", nn, [
|
|
1193
1190
|
n("div", null, [
|
|
1194
|
-
n("div",
|
|
1195
|
-
n("div",
|
|
1191
|
+
n("div", on, a(i(e)("inventory.common.name")), 1),
|
|
1192
|
+
n("div", rn, a(((O = (M = v.value) == null ? void 0 : M.details) == null ? void 0 : O.name) || ((j = v.value) == null ? void 0 : j.name)), 1)
|
|
1196
1193
|
]),
|
|
1197
|
-
(P = (K =
|
|
1198
|
-
n("div",
|
|
1199
|
-
n("div",
|
|
1200
|
-
])) :
|
|
1194
|
+
(P = (K = v.value) == null ? void 0 : K.details) != null && P.code ? (N(), D("div", sn, [
|
|
1195
|
+
n("div", an, a(i(e)("inventory.common.code")), 1),
|
|
1196
|
+
n("div", ln, a(v.value.details.code), 1)
|
|
1197
|
+
])) : Z("", !0),
|
|
1201
1198
|
n("div", null, [
|
|
1202
|
-
n("div",
|
|
1203
|
-
n("div",
|
|
1199
|
+
n("div", mn, a(i(e)("inventory.common.type")), 1),
|
|
1200
|
+
n("div", un, a(v.value.type), 1)
|
|
1204
1201
|
]),
|
|
1205
1202
|
n("div", null, [
|
|
1206
|
-
n("div",
|
|
1207
|
-
n("div",
|
|
1203
|
+
n("div", dn, a(i(e)("inventory.common.operation")), 1),
|
|
1204
|
+
n("div", cn, a(v.value.operation), 1)
|
|
1208
1205
|
]),
|
|
1209
1206
|
n("div", null, [
|
|
1210
|
-
n("div",
|
|
1207
|
+
n("div", pn, a(i(e)("inventory.common.status")), 1),
|
|
1211
1208
|
n("div", {
|
|
1212
1209
|
class: ce([
|
|
1213
1210
|
"inline-block px-8 py-4 rounded text-sm",
|
|
1214
|
-
|
|
1211
|
+
v.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"
|
|
1215
1212
|
])
|
|
1216
|
-
}, a(
|
|
1213
|
+
}, a(v.value.status), 3)
|
|
1217
1214
|
])
|
|
1218
1215
|
])
|
|
1219
1216
|
];
|
|
1220
1217
|
}),
|
|
1221
1218
|
_: 1
|
|
1222
1219
|
}),
|
|
1223
|
-
|
|
1220
|
+
v.value.errors && v.value.errors.length > 0 ? (N(), se(z, {
|
|
1224
1221
|
key: 0,
|
|
1225
1222
|
variant: "outlined",
|
|
1226
1223
|
class: "p-16"
|
|
1227
1224
|
}, {
|
|
1228
|
-
default:
|
|
1229
|
-
n("div",
|
|
1230
|
-
n("div",
|
|
1231
|
-
(
|
|
1225
|
+
default: Q(() => [
|
|
1226
|
+
n("div", vn, a(i(e)("inventory.common.validationErrors")), 1),
|
|
1227
|
+
n("div", yn, [
|
|
1228
|
+
(N(!0), D(Be, null, Pe(v.value.errors, (M, O) => (N(), D("div", {
|
|
1232
1229
|
key: O,
|
|
1233
1230
|
class: "flex items-start gap-8 p-12 bg-red-50 border border-red-200 rounded"
|
|
1234
1231
|
}, [
|
|
1235
|
-
A(
|
|
1232
|
+
A(C, {
|
|
1236
1233
|
name: "error",
|
|
1237
1234
|
class: "text-red-600 mt-2",
|
|
1238
1235
|
size: "sm"
|
|
1239
1236
|
}),
|
|
1240
|
-
n("div",
|
|
1237
|
+
n("div", gn, a(M), 1)
|
|
1241
1238
|
]))), 128))
|
|
1242
1239
|
])
|
|
1243
1240
|
]),
|
|
1244
1241
|
_: 1
|
|
1245
|
-
})) :
|
|
1242
|
+
})) : Z("", !0),
|
|
1246
1243
|
A(z, {
|
|
1247
1244
|
variant: "outlined",
|
|
1248
1245
|
class: "p-16"
|
|
1249
1246
|
}, {
|
|
1250
|
-
default:
|
|
1251
|
-
n("div",
|
|
1252
|
-
n("div",
|
|
1253
|
-
n("pre",
|
|
1247
|
+
default: Q(() => [
|
|
1248
|
+
n("div", fn, a(i(e)("inventory.common.rawData")), 1),
|
|
1249
|
+
n("div", bn, [
|
|
1250
|
+
n("pre", hn, a(JSON.stringify(v.value.details, null, 2)), 1)
|
|
1254
1251
|
])
|
|
1255
1252
|
]),
|
|
1256
1253
|
_: 1
|
|
1257
1254
|
})
|
|
1258
|
-
])) :
|
|
1255
|
+
])) : Z("", !0)
|
|
1259
1256
|
]),
|
|
1260
1257
|
_: 1
|
|
1261
1258
|
}, 8, ["model-value", "header"])
|
|
1262
1259
|
];
|
|
1263
1260
|
}),
|
|
1264
1261
|
_: 1
|
|
1265
|
-
}, 8, ["title", "actions"])) : i(
|
|
1262
|
+
}, 8, ["title", "actions"])) : i(h).isLoaded ? (N(), se(ke, {
|
|
1266
1263
|
key: 2,
|
|
1267
1264
|
title: i(e)("inventory.common.import")
|
|
1268
1265
|
}, {
|
|
1269
|
-
default:
|
|
1270
|
-
n("div",
|
|
1271
|
-
A(
|
|
1266
|
+
default: Q(() => [
|
|
1267
|
+
n("div", En, [
|
|
1268
|
+
A(C, {
|
|
1272
1269
|
name: "block",
|
|
1273
1270
|
class: "text-gray-400",
|
|
1274
1271
|
size: "xl"
|
|
1275
1272
|
}),
|
|
1276
|
-
n("div",
|
|
1277
|
-
n("div",
|
|
1278
|
-
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)
|
|
1279
1276
|
])
|
|
1280
1277
|
])
|
|
1281
1278
|
]),
|
|
1282
1279
|
_: 1
|
|
1283
|
-
}, 8, ["title"])) : (
|
|
1280
|
+
}, 8, ["title"])) : (N(), se(ke, {
|
|
1284
1281
|
key: 1,
|
|
1285
1282
|
title: i(e)("inventory.common.import")
|
|
1286
1283
|
}, {
|
|
1287
|
-
default:
|
|
1288
|
-
n("div",
|
|
1289
|
-
A(
|
|
1290
|
-
n("div",
|
|
1291
|
-
n("div",
|
|
1284
|
+
default: Q(() => [
|
|
1285
|
+
n("div", _n, [
|
|
1286
|
+
A(q, { size: "lg" }),
|
|
1287
|
+
n("div", wn, [
|
|
1288
|
+
n("div", In, a(i(e)("inventory.common.loading")), 1)
|
|
1292
1289
|
])
|
|
1293
1290
|
])
|
|
1294
1291
|
]),
|
|
@@ -1298,5 +1295,5 @@ const ut = { class: "flex flex-col gap-24" }, dt = { class: "flex flex-col gap-8
|
|
|
1298
1295
|
}
|
|
1299
1296
|
});
|
|
1300
1297
|
export {
|
|
1301
|
-
|
|
1298
|
+
Hn as default
|
|
1302
1299
|
};
|