@feedmepos/mf-inventory-portal 1.0.37-dev.2 → 1.0.37-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-_SMozUEj.js → App-Dmd2G8R5.js} +1 -1
- package/dist/{ApprovalView-D55iBGg5.js → ApprovalView-Dp3k5vDw.js} +2 -2
- package/dist/{BindingsDialog-Di_xTPkA.js → BindingsDialog-D80Yhk4v.js} +2 -2
- package/dist/{BindingsPicker-BwIKt9Il.js → BindingsPicker-BYRH73Mx.js} +1 -1
- package/dist/{BindingsTable-CMFvNSAH.js → BindingsTable-CvblcQnI.js} +1 -1
- package/dist/{ClosingDraftView-DXoi5cw9.js → ClosingDraftView-DiUIrHnf.js} +2 -2
- package/dist/{ClosingTemplateView-DaPOj50P.js → ClosingTemplateView-BGyaxOv_.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-CkIPZo14.js → DeliveryOrderPrintPreview-7DmbPXg9.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BSzt53-l.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C_QmBqHi.js} +3 -3
- package/dist/{FmMultiselectDialog-EpV0X6CI.js → FmMultiselectDialog-m2Wih5ZC.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Cn3qOqJr.js → FmUnitInput.vue_vue_type_script_setup_true_lang-C0Ky06__.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BUQQL5kL.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DLfxc861.js} +1 -1
- package/dist/{IngredientGroupView-DvxOGAuo.js → IngredientGroupView-Um-bP1SR.js} +2 -2
- package/dist/{IngredientsView-BhFDYfnd.js → IngredientsView-BOYvD0VL.js} +259 -252
- package/dist/{IntegrationView-B_EmS2-x.js → IntegrationView-DfBOpvo1.js} +12 -11
- package/dist/{InventoryBindingForm-B79lRAe6.js → InventoryBindingForm-sbgSzNep.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DBsD7abQ.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CYpXwzuu.js} +3 -3
- package/dist/{InventoryBindingSummary-CmnSXYAW.js → InventoryBindingSummary-BWdagbGS.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CDRN_Nrk.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BvdA5Qfu.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BknocD4_.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CBH7oYpv.js} +1 -1
- package/dist/{PublishView-DNkUYpMh.js → PublishView-CjX1ZmFe.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-D0UhIY8z.js → PurchaseOrderPrintPreview-M20PXH1Z.js} +1 -1
- package/dist/{ReceiveRequestView-DsBpjA9P.js → ReceiveRequestView-CF9p1j-M.js} +9 -9
- package/dist/{RecipeView-lpMLqWM8.js → RecipeView-kVgJAZ9d.js} +3 -3
- package/dist/{StockView-CIgg_FTJ.js → StockView-B9bSTjY4.js} +6 -6
- package/dist/{SupplierView-fwzviqqM.js → SupplierView-uaW913cH.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-TYNgMCEs.js → TransferDetails.vue_vue_type_script_setup_true_lang-Bwiv5v2m.js} +5 -5
- package/dist/{TransferTemplateView-CSy8pydr.js → TransferTemplateView-BuHT8mNT.js} +6 -6
- package/dist/{UnitView-CMOz7RLY.js → UnitView-Db_ETZrB.js} +3 -3
- package/dist/{WarehouseView-B-1c6rRg.js → WarehouseView-2SJNm6XK.js} +1 -1
- package/dist/{app-CFm28RQ_.js → app-CoEB-VoH.js} +11 -11
- package/dist/app.js +1 -1
- package/dist/{decimal-UyI93Y1E.js → decimal-B7itxUWP.js} +1 -1
- package/dist/{format-unit-display-CNki_g8Q.js → format-unit-display-DswmXjqB.js} +2 -2
- package/dist/{index-DliBh-3z.js → index-DfWaG7Tl.js} +1 -1
- package/dist/{index-BWYshfa3.js → index-YGLKr3WK.js} +1 -1
- package/dist/{stock-A60nU_aj.js → stock-CCQ352Hu.js} +1 -1
- package/dist/{supplier-lcKFLaW5.js → supplier-BCwA2FHM.js} +1 -1
- package/dist/{use-ingredient-select-dialog-B17VDJ0o.js → use-ingredient-select-dialog-DOONV-IL.js} +1 -1
- package/dist/{use-inventory-binding-dialog-sj5lERBj.js → use-inventory-binding-dialog-BPM-7FrW.js} +1 -1
- package/dist/{vue-i18n-CZSieSF0.js → vue-i18n-DZAYeut-.js} +247 -247
- package/package.json +4 -4
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { ref as L, h as X, defineComponent as le, computed as S, resolveComponent as w, openBlock as _, createBlock as A, withCtx as V, createVNode as v, unref as
|
|
2
|
-
import { a as te, e as H, f as Qe, S as pt, h as vt, D as Le, i as _e, A as ke, b as Ue, j as Xe, k as Ve, t as et, l as ge, m as we, U as ft, n as yt, M as gt, o as Oe, p as He, c as tt, q as je, r as nt, s as bt, v as ot, w as ht, x as _t, I as xt, y as kt, z as Vt, N as St, H as Ct, u as wt, B as Ft, _ as Mt, C as It, E as $t, G as Ye, J as Et } from "./app-
|
|
1
|
+
import { ref as L, h as X, defineComponent as le, computed as S, resolveComponent as w, openBlock as _, createBlock as A, withCtx as V, createVNode as v, unref as d, createElementBlock as D, Fragment as ee, createElementVNode as c, createCommentVNode as O, renderSlot as ve, createTextVNode as Ee, toDisplayString as T, normalizeClass as Q, onMounted as ut, watch as Je, renderList as ye, isRef as Ne, createSlots as Ze, normalizeStyle as dt, Teleport as ze, normalizeProps as mt, guardReactiveProps as ct } from "vue";
|
|
2
|
+
import { a as te, e as H, f as Qe, S as pt, h as vt, D as Le, i as _e, A as ke, b as Ue, j as Xe, k as Ve, t as et, l as ge, m as we, U as ft, n as yt, M as gt, o as Oe, p as He, c as tt, q as je, r as nt, s as bt, v as ot, w as ht, x as _t, I as xt, y as kt, z as Vt, N as St, H as Ct, u as wt, B as Ft, _ as Mt, C as It, E as $t, G as Ye, J as Et } from "./app-CoEB-VoH.js";
|
|
3
3
|
import { useDialog as lt, useSnackbar as Se, components as qe, useProxiedModel as Ge, useDialogChild as Ut, useBreakpoints as Rt } from "@feedmepos/ui-library";
|
|
4
4
|
import { i as At, _ as Tt } from "./is-linked-ingredient-error-fJ2TJb3z.js";
|
|
5
5
|
import { useI18n as ae, useCoreStore as be } from "@feedmepos/mf-common";
|
|
6
6
|
import { defineStore as Dt, storeToRefs as Bt } from "pinia";
|
|
7
7
|
import { g as Pt, _ as Fe, S as Me } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
|
|
8
|
-
import { _ as Nt } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-
|
|
9
|
-
import { _ as Ie } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-
|
|
8
|
+
import { _ as Nt } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CYpXwzuu.js";
|
|
9
|
+
import { _ as Ie } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-DLfxc861.js";
|
|
10
10
|
import { _ as xe } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
11
11
|
import { _ as zt } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
|
|
12
12
|
import { r as Lt } from "./random-CSbEbElR.js";
|
|
13
13
|
import "./array-Ca8T3f_G.js";
|
|
14
|
-
import { u as Ot } from "./FmMultiselectDialog-
|
|
14
|
+
import { u as Ot } from "./FmMultiselectDialog-m2Wih5ZC.js";
|
|
15
15
|
const $e = Dt("ingredientForm", function() {
|
|
16
|
-
const o = lt(), y = Se(), l = te(), n = L(!1), { t: a } = ae(),
|
|
16
|
+
const o = lt(), y = Se(), l = te(), n = L(!1), { t: a } = ae(), r = L();
|
|
17
17
|
function m() {
|
|
18
18
|
const b = {
|
|
19
19
|
unit: {},
|
|
20
20
|
mode: H.CREATE,
|
|
21
21
|
show: !0,
|
|
22
|
-
"onUpdate:show"(
|
|
23
|
-
|
|
22
|
+
"onUpdate:show"(s) {
|
|
23
|
+
r.value.show = s;
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
r.value = b;
|
|
27
27
|
}
|
|
28
28
|
async function p(b) {
|
|
29
|
-
const
|
|
29
|
+
const s = {
|
|
30
30
|
unit: Qe(b),
|
|
31
31
|
mode: H.UPDATE,
|
|
32
32
|
show: !0,
|
|
33
33
|
"onUpdate:show"(x) {
|
|
34
|
-
|
|
34
|
+
r.value.show = x;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
r.value = s;
|
|
38
38
|
}
|
|
39
39
|
async function g(b) {
|
|
40
40
|
n.value = !0;
|
|
@@ -44,23 +44,23 @@ const $e = Dt("ingredientForm", function() {
|
|
|
44
44
|
message: `Deleted ${b.name}`,
|
|
45
45
|
type: "success"
|
|
46
46
|
});
|
|
47
|
-
} catch (
|
|
48
|
-
|
|
47
|
+
} catch (s) {
|
|
48
|
+
s instanceof pt && At(s) ? o.open({
|
|
49
49
|
title: "Cannot delete ingredient",
|
|
50
50
|
contentComponent: Tt,
|
|
51
51
|
contentComponentProps: {
|
|
52
52
|
subject: (b == null ? void 0 : b.name) ?? "",
|
|
53
|
-
items:
|
|
53
|
+
items: s.errorResponse.message
|
|
54
54
|
},
|
|
55
55
|
secondaryActions: {
|
|
56
56
|
text: "Close",
|
|
57
57
|
close: !0
|
|
58
58
|
}
|
|
59
|
-
}) : console.log("unable to delete ingredient",
|
|
59
|
+
}) : console.log("unable to delete ingredient", s), y.open({
|
|
60
60
|
title: `Cannot delete ${b.name}`,
|
|
61
61
|
message: "Please try again.",
|
|
62
62
|
type: "error"
|
|
63
|
-
}), console.error("failed to delete ingredient",
|
|
63
|
+
}), console.error("failed to delete ingredient", s);
|
|
64
64
|
} finally {
|
|
65
65
|
n.value = !1;
|
|
66
66
|
}
|
|
@@ -85,19 +85,19 @@ const $e = Dt("ingredientForm", function() {
|
|
|
85
85
|
createIngredient: m,
|
|
86
86
|
updateIngredient: p,
|
|
87
87
|
deleteIngredient: i,
|
|
88
|
-
ingredientDialogProps:
|
|
88
|
+
ingredientDialogProps: r,
|
|
89
89
|
ingredientViewLoading: n
|
|
90
90
|
};
|
|
91
91
|
});
|
|
92
92
|
function Ht() {
|
|
93
|
-
const { updateIngredient:
|
|
94
|
-
async function n(
|
|
93
|
+
const { updateIngredient: u, deleteIngredient: o } = $e(), y = te(), { t: l } = ae();
|
|
94
|
+
async function n(r, m) {
|
|
95
95
|
const p = Qe(m);
|
|
96
|
-
if (
|
|
97
|
-
await
|
|
96
|
+
if (r === _e.Edit) {
|
|
97
|
+
await u(p);
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
if (
|
|
100
|
+
if (r === _e.Delete) {
|
|
101
101
|
await o(p);
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
@@ -114,8 +114,8 @@ function Ht() {
|
|
|
114
114
|
header: () => l("inventory.ingredient.name"),
|
|
115
115
|
enableSorting: !0,
|
|
116
116
|
size: 300,
|
|
117
|
-
cell(
|
|
118
|
-
const m =
|
|
117
|
+
cell(r) {
|
|
118
|
+
const m = r.row.original, p = y.skuBindingFlattenCache[m._id], g = p == null ? void 0 : p.inventoryBindings.some(
|
|
119
119
|
(i) => "error" in i && i.reason === "circularDependency"
|
|
120
120
|
);
|
|
121
121
|
return X("div", { class: "flex items-center w-full gap-4" }, [
|
|
@@ -142,9 +142,9 @@ function Ht() {
|
|
|
142
142
|
{
|
|
143
143
|
id: "unit",
|
|
144
144
|
header: () => l("inventory.ingredient.unit"),
|
|
145
|
-
cell(
|
|
145
|
+
cell(r) {
|
|
146
146
|
var p;
|
|
147
|
-
const m =
|
|
147
|
+
const m = r.row.original;
|
|
148
148
|
if (m.trackingMeasurement) {
|
|
149
149
|
const g = (p = m.unit.measurements) == null ? void 0 : p.find(
|
|
150
150
|
(i) => i.id === m.trackingMeasurement
|
|
@@ -160,8 +160,8 @@ function Ht() {
|
|
|
160
160
|
{
|
|
161
161
|
accessorKey: "isInactive",
|
|
162
162
|
header: () => l("inventory.ingredient.isInactive.title"),
|
|
163
|
-
cell(
|
|
164
|
-
const m =
|
|
163
|
+
cell(r) {
|
|
164
|
+
const m = r.row.original.isInactive;
|
|
165
165
|
return X(
|
|
166
166
|
"span",
|
|
167
167
|
{
|
|
@@ -179,11 +179,11 @@ function Ht() {
|
|
|
179
179
|
{
|
|
180
180
|
id: "action",
|
|
181
181
|
header: "",
|
|
182
|
-
cell(
|
|
182
|
+
cell(r) {
|
|
183
183
|
return vt(
|
|
184
184
|
[Le[_e.Edit], Le[_e.Delete]],
|
|
185
185
|
(m) => {
|
|
186
|
-
n(m,
|
|
186
|
+
n(m, r.row.original);
|
|
187
187
|
}
|
|
188
188
|
);
|
|
189
189
|
},
|
|
@@ -205,38 +205,38 @@ const jt = /* @__PURE__ */ le({
|
|
|
205
205
|
readonly: { type: Boolean }
|
|
206
206
|
},
|
|
207
207
|
emits: ["update:modelValue"],
|
|
208
|
-
setup(
|
|
209
|
-
const y =
|
|
210
|
-
var
|
|
211
|
-
return (
|
|
208
|
+
setup(u, { emit: o }) {
|
|
209
|
+
const y = u, l = S(() => {
|
|
210
|
+
var s;
|
|
211
|
+
return (s = y.rootValue) == null ? void 0 : s.unit;
|
|
212
212
|
}), n = S(() => {
|
|
213
|
-
var
|
|
214
|
-
return (
|
|
215
|
-
}), a = o, { t:
|
|
213
|
+
var s;
|
|
214
|
+
return (s = y.rootValue) == null ? void 0 : s._id;
|
|
215
|
+
}), a = o, { t: r } = ae(), m = S({
|
|
216
216
|
get() {
|
|
217
217
|
return !!y.modelValue;
|
|
218
218
|
},
|
|
219
|
-
set(
|
|
220
|
-
|
|
219
|
+
set(s) {
|
|
220
|
+
s ? a("update:modelValue", {
|
|
221
221
|
measurement: null,
|
|
222
222
|
inventoryBindings: []
|
|
223
223
|
}) : a("update:modelValue", null);
|
|
224
224
|
}
|
|
225
225
|
}), p = S(() => Pt(l.value));
|
|
226
|
-
function g(
|
|
226
|
+
function g(s) {
|
|
227
227
|
const x = y.modelValue ?? {};
|
|
228
|
-
x.measurement =
|
|
228
|
+
x.measurement = s ? `${s}` : null, a("update:modelValue", x);
|
|
229
229
|
}
|
|
230
|
-
function i(
|
|
230
|
+
function i(s) {
|
|
231
231
|
const x = y.modelValue ?? {};
|
|
232
|
-
x.inventoryBindings =
|
|
232
|
+
x.inventoryBindings = s, a("update:modelValue", x);
|
|
233
233
|
}
|
|
234
234
|
const b = S(() => {
|
|
235
235
|
if (!y.modelValue) return null;
|
|
236
|
-
const
|
|
237
|
-
return
|
|
236
|
+
const s = y.modelValue;
|
|
237
|
+
return s.measurement ? p.value.find((x) => x.value === s.measurement) ?? null : p.value.find((x) => x.value === null) ?? null;
|
|
238
238
|
});
|
|
239
|
-
return (
|
|
239
|
+
return (s, x) => {
|
|
240
240
|
const P = w("FmSwitch"), E = w("FmSelect"), N = w("FmCard");
|
|
241
241
|
return _(), A(N, {
|
|
242
242
|
variant: "outlined",
|
|
@@ -249,28 +249,28 @@ const jt = /* @__PURE__ */ le({
|
|
|
249
249
|
value: "",
|
|
250
250
|
"model-value": m.value,
|
|
251
251
|
"onUpdate:modelValue": x[0] || (x[0] = (M) => m.value = M),
|
|
252
|
-
label:
|
|
253
|
-
sublabel:
|
|
252
|
+
label: d(r)("inventory.ingredient.convertible.title"),
|
|
253
|
+
sublabel: d(r)("inventory.ingredient.convertible.subtitle"),
|
|
254
254
|
labelPlacement: "right",
|
|
255
|
-
disabled:
|
|
255
|
+
disabled: s.readonly
|
|
256
256
|
}, null, 8, ["model-value", "label", "sublabel", "disabled"]),
|
|
257
257
|
m.value ? (_(), D(ee, { key: 0 }, [
|
|
258
258
|
c("div", null, [
|
|
259
259
|
v(E, {
|
|
260
|
-
label:
|
|
260
|
+
label: d(r)("inventory.ingredient.convertible.convertTo"),
|
|
261
261
|
modelValue: (k = b.value) == null ? void 0 : k.value,
|
|
262
262
|
"onUpdate:modelValue": g,
|
|
263
263
|
items: p.value,
|
|
264
|
-
disabled:
|
|
264
|
+
disabled: s.readonly
|
|
265
265
|
}, null, 8, ["label", "modelValue", "items", "disabled"])
|
|
266
266
|
]),
|
|
267
267
|
v(Nt, {
|
|
268
268
|
id: n.value,
|
|
269
|
-
"model-value": ((I =
|
|
269
|
+
"model-value": ((I = s.modelValue) == null ? void 0 : I.inventoryBindings) ?? [],
|
|
270
270
|
"onUpdate:modelValue": i,
|
|
271
271
|
"exclude-binding-id": n.value,
|
|
272
|
-
rules: [
|
|
273
|
-
readonly:
|
|
272
|
+
rules: [d(ke)(1)],
|
|
273
|
+
readonly: s.readonly
|
|
274
274
|
}, null, 8, ["id", "model-value", "exclude-binding-id", "rules", "readonly"])
|
|
275
275
|
], 64)) : O("", !0)
|
|
276
276
|
];
|
|
@@ -301,9 +301,9 @@ const Yt = {
|
|
|
301
301
|
tooltipPlacement: {},
|
|
302
302
|
tooltipZIndex: {}
|
|
303
303
|
},
|
|
304
|
-
setup(
|
|
304
|
+
setup(u) {
|
|
305
305
|
return (o, y) => {
|
|
306
|
-
const l = w("FmLabel"), n = w("FmIcon"), a = w("FmTooltip"),
|
|
306
|
+
const l = w("FmLabel"), n = w("FmIcon"), a = w("FmTooltip"), r = w("FmField");
|
|
307
307
|
return o.locked ? (_(), D("div", Yt, [
|
|
308
308
|
ve(o.$slots, "label", {}, () => [
|
|
309
309
|
v(l, {
|
|
@@ -312,7 +312,7 @@ const Yt = {
|
|
|
312
312
|
}, null, 8, ["label", "disabled"])
|
|
313
313
|
]),
|
|
314
314
|
ve(o.$slots, "field", {}, () => [
|
|
315
|
-
v(
|
|
315
|
+
v(r, { disabled: o.disabled }, {
|
|
316
316
|
prepend: V(() => [
|
|
317
317
|
o.tooltipMessage ? (_(), A(a, {
|
|
318
318
|
key: 0,
|
|
@@ -365,7 +365,7 @@ const Yt = {
|
|
|
365
365
|
}, Qt = { class: "flex flex-col" }, Xt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, en = {
|
|
366
366
|
key: 4,
|
|
367
367
|
class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
|
|
368
|
-
}, tn = { class: "flex flex-col gap-12" }, nn = { class: "flex flex-col gap-4" }, on = { class: "fm-typo-en-title-sm-600" }, ln = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, an = { class: "flex flex-col gap-4" },
|
|
368
|
+
}, tn = { class: "flex flex-col gap-12" }, nn = { class: "flex flex-col gap-4" }, on = { class: "fm-typo-en-title-sm-600" }, ln = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, an = { class: "flex flex-col gap-4" }, sn = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, rn = { class: "flex-1 p-12 flex flex-col gap-8" }, un = { class: "mx-auto" }, dn = { class: "flex flex-col" }, mn = { class: "fm-typo-en-body-sm-600 translate-y-4" }, cn = { class: "flex-1 p-12 flex flex-col gap-8" }, pn = { class: "mx-auto" }, vn = { class: "flex flex-col" }, fn = { class: "fm-typo-en-body-sm-600 translate-y-4" }, yn = { class: "flex-1 p-12 flex flex-col gap-8" }, gn = { class: "mx-auto" }, bn = { class: "flex flex-col" }, hn = { class: "fm-typo-en-body-sm-600 translate-y-4" }, _n = /* @__PURE__ */ le({
|
|
369
369
|
__name: "IngredientForm",
|
|
370
370
|
props: {
|
|
371
371
|
mode: {},
|
|
@@ -373,22 +373,22 @@ const Yt = {
|
|
|
373
373
|
disabled: { type: Boolean }
|
|
374
374
|
},
|
|
375
375
|
emits: ["update:modelValue", "click:submit"],
|
|
376
|
-
setup(
|
|
376
|
+
setup(u, { expose: o, emit: y }) {
|
|
377
377
|
var B;
|
|
378
|
-
const { t: l } = ae(), n =
|
|
378
|
+
const { t: l } = ae(), n = u, a = y, r = te(), m = be(), p = tt(), g = Ue(), i = S(() => g.isEnabled);
|
|
379
379
|
function b(t) {
|
|
380
380
|
if (t.length === 0) return;
|
|
381
381
|
const e = t[0], f = n.modelValue ?? {
|
|
382
|
-
unit:
|
|
382
|
+
unit: r.units.find((h) => h)
|
|
383
383
|
};
|
|
384
384
|
f.unit || (f.unit = e, a("update:modelValue", f));
|
|
385
385
|
}
|
|
386
|
-
|
|
387
|
-
b(
|
|
388
|
-
}), Je([() =>
|
|
386
|
+
ut(() => {
|
|
387
|
+
b(r.units);
|
|
388
|
+
}), Je([() => r.units], ([t]) => {
|
|
389
389
|
b(t);
|
|
390
390
|
});
|
|
391
|
-
function
|
|
391
|
+
function s() {
|
|
392
392
|
a("click:submit");
|
|
393
393
|
}
|
|
394
394
|
const x = S({
|
|
@@ -454,7 +454,7 @@ const Yt = {
|
|
|
454
454
|
}
|
|
455
455
|
}), k = S(() => {
|
|
456
456
|
var e, f, h;
|
|
457
|
-
const t = ((e = n.modelValue) == null ? void 0 : e.unit) ??
|
|
457
|
+
const t = ((e = n.modelValue) == null ? void 0 : e.unit) ?? r.units.find((R) => R);
|
|
458
458
|
return t ? {
|
|
459
459
|
_id: t._id,
|
|
460
460
|
measurement: (f = n.modelValue) == null ? void 0 : f.trackingMeasurement,
|
|
@@ -464,7 +464,7 @@ const Yt = {
|
|
|
464
464
|
})) == null ? void 0 : h.name) ?? t.name
|
|
465
465
|
} : null;
|
|
466
466
|
}), I = S(
|
|
467
|
-
() =>
|
|
467
|
+
() => r.units.flatMap(({ name: t, _id: e, abbrev: f, measurements: h }) => [
|
|
468
468
|
{
|
|
469
469
|
label: `${t}`,
|
|
470
470
|
value: null,
|
|
@@ -489,7 +489,7 @@ const Yt = {
|
|
|
489
489
|
function ne(t) {
|
|
490
490
|
var j, Y;
|
|
491
491
|
if (!t) return;
|
|
492
|
-
const { _id: e, measurement: f } = t, h = f || void 0, R =
|
|
492
|
+
const { _id: e, measurement: f } = t, h = f || void 0, R = r.units.find((G) => G._id === e);
|
|
493
493
|
if (!R)
|
|
494
494
|
return;
|
|
495
495
|
const $ = n.modelValue ?? {};
|
|
@@ -520,7 +520,7 @@ const Yt = {
|
|
|
520
520
|
).map((t) => ({
|
|
521
521
|
label: l(`inventory.ingredient.valuationMethod.${t}`),
|
|
522
522
|
value: t
|
|
523
|
-
}))),
|
|
523
|
+
}))), ue = S({
|
|
524
524
|
get() {
|
|
525
525
|
var t;
|
|
526
526
|
return ((t = n.modelValue) == null ? void 0 : t.valuation) ?? "WAVG";
|
|
@@ -531,7 +531,7 @@ const Yt = {
|
|
|
531
531
|
} : {};
|
|
532
532
|
e.valuation = t, a("update:modelValue", e);
|
|
533
533
|
}
|
|
534
|
-
}),
|
|
534
|
+
}), se = S({
|
|
535
535
|
get() {
|
|
536
536
|
var t;
|
|
537
537
|
return ((t = n.modelValue) == null ? void 0 : t.customAttributes) ?? {};
|
|
@@ -542,42 +542,42 @@ const Yt = {
|
|
|
542
542
|
} : {};
|
|
543
543
|
e.customAttributes = t, a("update:modelValue", e);
|
|
544
544
|
}
|
|
545
|
-
}),
|
|
545
|
+
}), re = L();
|
|
546
546
|
o({
|
|
547
547
|
validateInputs: () => {
|
|
548
548
|
var t, e;
|
|
549
|
-
(e = (t =
|
|
549
|
+
(e = (t = re.value) == null ? void 0 : t.validateInputs) == null || e.call(t);
|
|
550
550
|
},
|
|
551
551
|
resetInputsValidation: () => {
|
|
552
552
|
var t, e;
|
|
553
|
-
(e = (t =
|
|
553
|
+
(e = (t = re.value) == null ? void 0 : t.resetInputsValidation) == null || e.call(t);
|
|
554
554
|
},
|
|
555
555
|
resetInputs: () => {
|
|
556
556
|
var t, e;
|
|
557
|
-
(e = (t =
|
|
557
|
+
(e = (t = re.value) == null ? void 0 : t.resetInputs) == null || e.call(t);
|
|
558
558
|
}
|
|
559
559
|
});
|
|
560
560
|
const oe = L(!1), he = S(
|
|
561
561
|
() => {
|
|
562
562
|
var t, e, f;
|
|
563
|
-
return (t = n.modelValue) != null && t._id ? ((f =
|
|
563
|
+
return (t = n.modelValue) != null && t._id ? ((f = r.menu.bindedBySkuId[(e = n.modelValue) == null ? void 0 : e._id]) == null ? void 0 : f.filter(
|
|
564
564
|
(h) => h.from === "INGREDIENT"
|
|
565
565
|
)) ?? [] : [];
|
|
566
566
|
}
|
|
567
|
-
),
|
|
567
|
+
), de = S(
|
|
568
568
|
() => {
|
|
569
569
|
var t, e, f;
|
|
570
|
-
return (t = n.modelValue) != null && t._id ? ((f =
|
|
570
|
+
return (t = n.modelValue) != null && t._id ? ((f = r.menu.bindedBySkuId[(e = n.modelValue) == null ? void 0 : e._id]) == null ? void 0 : f.filter(
|
|
571
571
|
(h) => h.from === "RECIPE"
|
|
572
572
|
)) ?? [] : [];
|
|
573
573
|
}
|
|
574
574
|
), me = S(
|
|
575
575
|
() => {
|
|
576
576
|
var t, e, f;
|
|
577
|
-
return (t = n.modelValue) != null && t._id ? ((f =
|
|
577
|
+
return (t = n.modelValue) != null && t._id ? ((f = r.menu.bindedBySkuId[(e = n.modelValue) == null ? void 0 : e._id]) == null ? void 0 : f.filter((h) => h.from === "MENU")) ?? [] : [];
|
|
578
578
|
}
|
|
579
579
|
), Ce = S(
|
|
580
|
-
() =>
|
|
580
|
+
() => r.skus.map((t) => ({ label: t.name, value: t.code }))
|
|
581
581
|
), U = L((B = n.modelValue) == null ? void 0 : B.code);
|
|
582
582
|
function C(t) {
|
|
583
583
|
var f;
|
|
@@ -629,13 +629,13 @@ const Yt = {
|
|
|
629
629
|
};
|
|
630
630
|
}
|
|
631
631
|
return (t, e) => {
|
|
632
|
-
const f = w("FmTextField"), h = w("FmLabel"), R = w("FmField"), $ = w("FmMenuHeader"), j = w("FmMenuDivider"), Y = w("FmMenuItem"), G = w("FmMenu"), pe = w("FmFormGroup"),
|
|
632
|
+
const f = w("FmTextField"), h = w("FmLabel"), R = w("FmField"), $ = w("FmMenuHeader"), j = w("FmMenuDivider"), Y = w("FmMenuItem"), G = w("FmMenu"), pe = w("FmFormGroup"), rt = w("FmSelect"), Re = w("FmSwitch"), Ae = w("FmStepperField"), it = w("FmForm");
|
|
633
633
|
return _(), A(it, {
|
|
634
634
|
disabled: t.disabled,
|
|
635
635
|
ref_key: "formRef",
|
|
636
|
-
ref:
|
|
636
|
+
ref: re,
|
|
637
637
|
class: "flex flex-col gap-32",
|
|
638
|
-
onValidationSuccess:
|
|
638
|
+
onValidationSuccess: s
|
|
639
639
|
}, {
|
|
640
640
|
default: V(() => {
|
|
641
641
|
var Te, De, Be, Pe;
|
|
@@ -645,7 +645,7 @@ const Yt = {
|
|
|
645
645
|
v(fe, {
|
|
646
646
|
"tooltip-message": "This field is managed by NetSuite",
|
|
647
647
|
"tooltip-z-index": 50,
|
|
648
|
-
label:
|
|
648
|
+
label: d(l)("inventory.ingredient.code"),
|
|
649
649
|
"model-value": x.value,
|
|
650
650
|
"onUpdate:modelValue": e[1] || (e[1] = (F) => x.value = F),
|
|
651
651
|
locked: i.value,
|
|
@@ -653,10 +653,10 @@ const Yt = {
|
|
|
653
653
|
}, {
|
|
654
654
|
default: V(() => [
|
|
655
655
|
v(f, {
|
|
656
|
-
label:
|
|
656
|
+
label: d(l)("inventory.ingredient.code"),
|
|
657
657
|
"model-value": x.value,
|
|
658
658
|
"onUpdate:modelValue": e[0] || (e[0] = (F) => x.value = F),
|
|
659
|
-
rules: [
|
|
659
|
+
rules: [d(we)(), d(ft)(Ce.value, U.value)],
|
|
660
660
|
"label-mark": "required"
|
|
661
661
|
}, null, 8, ["label", "model-value", "rules"])
|
|
662
662
|
]),
|
|
@@ -667,7 +667,7 @@ const Yt = {
|
|
|
667
667
|
v(fe, {
|
|
668
668
|
"tooltip-message": "This field is managed by NetSuite",
|
|
669
669
|
"tooltip-z-index": 50,
|
|
670
|
-
label:
|
|
670
|
+
label: d(l)("inventory.ingredient.name"),
|
|
671
671
|
"model-value": E.value,
|
|
672
672
|
"onUpdate:modelValue": e[3] || (e[3] = (F) => E.value = F),
|
|
673
673
|
locked: i.value,
|
|
@@ -675,10 +675,10 @@ const Yt = {
|
|
|
675
675
|
}, {
|
|
676
676
|
default: V(() => [
|
|
677
677
|
v(f, {
|
|
678
|
-
label:
|
|
678
|
+
label: d(l)("inventory.ingredient.name"),
|
|
679
679
|
"model-value": E.value,
|
|
680
680
|
"onUpdate:modelValue": e[2] || (e[2] = (F) => E.value = F),
|
|
681
|
-
rules: [
|
|
681
|
+
rules: [d(we)()],
|
|
682
682
|
"label-mark": "required"
|
|
683
683
|
}, null, 8, ["label", "model-value", "rules"])
|
|
684
684
|
]),
|
|
@@ -689,7 +689,7 @@ const Yt = {
|
|
|
689
689
|
v(fe, {
|
|
690
690
|
"tooltip-message": "This field is managed by NetSuite",
|
|
691
691
|
"tooltip-z-index": 50,
|
|
692
|
-
label:
|
|
692
|
+
label: d(l)("inventory.ingredient.unit"),
|
|
693
693
|
"helper-text": (Te = t.modelValue) != null && Te.trackingMeasurement ? `Base unit: ${(Be = (De = t.modelValue) == null ? void 0 : De.unit) == null ? void 0 : Be.name}` : void 0,
|
|
694
694
|
"model-value": (Pe = k.value) == null ? void 0 : Pe.name,
|
|
695
695
|
locked: i.value,
|
|
@@ -698,12 +698,12 @@ const Yt = {
|
|
|
698
698
|
default: V(() => [
|
|
699
699
|
v(pe, {
|
|
700
700
|
"model-value": k.value,
|
|
701
|
-
rules: [
|
|
701
|
+
rules: [d(we)()],
|
|
702
702
|
"label-mark": "required"
|
|
703
703
|
}, {
|
|
704
704
|
label: V(() => [
|
|
705
705
|
v(h, {
|
|
706
|
-
label:
|
|
706
|
+
label: d(l)("inventory.ingredient.unit")
|
|
707
707
|
}, null, 8, ["label"])
|
|
708
708
|
]),
|
|
709
709
|
default: V(({ invalid: F }) => [
|
|
@@ -760,12 +760,12 @@ const Yt = {
|
|
|
760
760
|
]),
|
|
761
761
|
_: 1
|
|
762
762
|
}, 8, ["label", "helper-text", "model-value", "locked", "disabled"]),
|
|
763
|
-
|
|
763
|
+
d(p).enableTotalCost ? (_(), A(fe, {
|
|
764
764
|
key: 0,
|
|
765
765
|
"tooltip-message": "This field is managed by NetSuite",
|
|
766
766
|
"tooltip-z-index": 50,
|
|
767
|
-
label:
|
|
768
|
-
"model-value":
|
|
767
|
+
label: d(l)("inventory.ingredient.valuationMethod.title"),
|
|
768
|
+
"model-value": d(l)("inventory.ingredient.valuationMethod." + ue.value),
|
|
769
769
|
locked: i.value,
|
|
770
770
|
disabled: t.disabled
|
|
771
771
|
}, {
|
|
@@ -773,28 +773,28 @@ const Yt = {
|
|
|
773
773
|
v(xe, { "z-index": 50 }, {
|
|
774
774
|
default: V(() => [
|
|
775
775
|
v(h, {
|
|
776
|
-
label:
|
|
776
|
+
label: d(l)("inventory.ingredient.valuationMethod.title")
|
|
777
777
|
}, null, 8, ["label"])
|
|
778
778
|
]),
|
|
779
779
|
_: 1
|
|
780
780
|
})
|
|
781
781
|
]),
|
|
782
782
|
default: V(() => [
|
|
783
|
-
v(
|
|
783
|
+
v(rt, {
|
|
784
784
|
class: "col-span-2",
|
|
785
|
-
label:
|
|
786
|
-
"model-value":
|
|
787
|
-
"onUpdate:modelValue": e[4] || (e[4] = (F) =>
|
|
785
|
+
label: d(l)("inventory.ingredient.valuationMethod.title"),
|
|
786
|
+
"model-value": ue.value,
|
|
787
|
+
"onUpdate:modelValue": e[4] || (e[4] = (F) => ue.value = F),
|
|
788
788
|
items: K.value
|
|
789
789
|
}, null, 8, ["label", "model-value", "items"])
|
|
790
790
|
]),
|
|
791
791
|
_: 1
|
|
792
792
|
}, 8, ["label", "model-value", "locked", "disabled"])) : O("", !0),
|
|
793
|
-
|
|
793
|
+
d(p).enableTotalCost ? (_(), A(fe, {
|
|
794
794
|
key: 1,
|
|
795
795
|
"tooltip-message": "This field is managed by NetSuite",
|
|
796
796
|
"tooltip-z-index": 50,
|
|
797
|
-
"model-value": `${
|
|
797
|
+
"model-value": `${d(yt)()} ${N.value}`,
|
|
798
798
|
locked: i.value,
|
|
799
799
|
disabled: t.disabled
|
|
800
800
|
}, {
|
|
@@ -802,7 +802,7 @@ const Yt = {
|
|
|
802
802
|
v(xe, { "z-index": 50 }, {
|
|
803
803
|
default: V(() => [
|
|
804
804
|
v(h, {
|
|
805
|
-
label:
|
|
805
|
+
label: d(l)("inventory.ingredient.pricePerUnit")
|
|
806
806
|
}, null, 8, ["label"])
|
|
807
807
|
]),
|
|
808
808
|
_: 1
|
|
@@ -812,13 +812,13 @@ const Yt = {
|
|
|
812
812
|
v(f, {
|
|
813
813
|
"model-value": N.value,
|
|
814
814
|
"onUpdate:modelValue": e[5] || (e[5] = (F) => N.value = F),
|
|
815
|
-
rules: [
|
|
815
|
+
rules: [d(ke)(0), d(gt)(4)]
|
|
816
816
|
}, {
|
|
817
817
|
label: V(() => [
|
|
818
818
|
v(xe, { "z-index": 50 }, {
|
|
819
819
|
default: V(() => [
|
|
820
820
|
v(h, {
|
|
821
|
-
label:
|
|
821
|
+
label: d(l)("inventory.ingredient.pricePerUnit")
|
|
822
822
|
}, null, 8, ["label"])
|
|
823
823
|
]),
|
|
824
824
|
_: 1
|
|
@@ -827,7 +827,7 @@ const Yt = {
|
|
|
827
827
|
prepend: V(() => {
|
|
828
828
|
var F, q;
|
|
829
829
|
return [
|
|
830
|
-
c("div", Kt, T(
|
|
830
|
+
c("div", Kt, T(d(Oe)(((F = d(m).currentCountry) == null ? void 0 : F.value) ?? d(He)) === "MYR" ? "RM" : d(Oe)(((q = d(m).currentCountry) == null ? void 0 : q.value) ?? d(He))), 1)
|
|
831
831
|
];
|
|
832
832
|
}),
|
|
833
833
|
append: V(() => [
|
|
@@ -845,22 +845,22 @@ const Yt = {
|
|
|
845
845
|
"root-value": t.modelValue,
|
|
846
846
|
readonly: i.value
|
|
847
847
|
}, null, 8, ["model-value", "root-value", "readonly"])) : O("", !0),
|
|
848
|
-
t.mode !==
|
|
848
|
+
t.mode !== d(H).CREATE ? (_(), D("div", Zt, [
|
|
849
849
|
v(Re, {
|
|
850
|
-
label:
|
|
850
|
+
label: d(l)("inventory.ingredient.isInactive.title"),
|
|
851
851
|
"model-value": P.value,
|
|
852
852
|
"onUpdate:modelValue": e[7] || (e[7] = (F) => P.value = F),
|
|
853
853
|
"label-placement": "right",
|
|
854
854
|
disabled: i.value
|
|
855
855
|
}, null, 8, ["label", "model-value", "disabled"]),
|
|
856
856
|
c("div", Qt, [
|
|
857
|
-
c("div", Xt, T(
|
|
857
|
+
c("div", Xt, T(d(l)("inventory.ingredient.isInactive.preventFromOrder")), 1)
|
|
858
858
|
])
|
|
859
859
|
])) : O("", !0),
|
|
860
|
-
t.mode !==
|
|
860
|
+
t.mode !== d(H).CREATE ? (_(), D("div", en, [
|
|
861
861
|
c("div", null, [
|
|
862
862
|
v(Re, {
|
|
863
|
-
label:
|
|
863
|
+
label: d(l)("inventory.ingredient.bindedItems.title"),
|
|
864
864
|
modelValue: oe.value,
|
|
865
865
|
"onUpdate:modelValue": e[8] || (e[8] = (F) => oe.value = F),
|
|
866
866
|
"label-placement": "right"
|
|
@@ -868,17 +868,17 @@ const Yt = {
|
|
|
868
868
|
]),
|
|
869
869
|
oe.value && he.value.length ? (_(), A(Ie, {
|
|
870
870
|
key: 0,
|
|
871
|
-
name:
|
|
871
|
+
name: d(l)("inventory.ingredient.bindedItems.ingredient"),
|
|
872
872
|
bindings: he.value
|
|
873
873
|
}, null, 8, ["name", "bindings"])) : O("", !0),
|
|
874
|
-
oe.value &&
|
|
874
|
+
oe.value && de.value.length ? (_(), A(Ie, {
|
|
875
875
|
key: 1,
|
|
876
|
-
name:
|
|
877
|
-
bindings:
|
|
876
|
+
name: d(l)("inventory.ingredient.bindedItems.recipe"),
|
|
877
|
+
bindings: de.value
|
|
878
878
|
}, null, 8, ["name", "bindings"])) : O("", !0),
|
|
879
879
|
oe.value && me.value.length ? (_(), A(Ie, {
|
|
880
880
|
key: 2,
|
|
881
|
-
name:
|
|
881
|
+
name: d(l)("inventory.ingredient.bindedItems.menu"),
|
|
882
882
|
bindings: me.value
|
|
883
883
|
}, null, 8, ["name", "bindings"])) : O("", !0)
|
|
884
884
|
])) : O("", !0),
|
|
@@ -886,31 +886,31 @@ const Yt = {
|
|
|
886
886
|
c("div", nn, [
|
|
887
887
|
v(xe, null, {
|
|
888
888
|
default: V(() => [
|
|
889
|
-
c("div", on, T(
|
|
889
|
+
c("div", on, T(d(l)("inventory.ingredient.threshold.title")), 1)
|
|
890
890
|
]),
|
|
891
891
|
_: 1
|
|
892
892
|
}),
|
|
893
|
-
c("div", ln, T(
|
|
893
|
+
c("div", ln, T(d(l)("inventory.ingredient.threshold.subtitle")), 1)
|
|
894
894
|
]),
|
|
895
895
|
c("div", an, [
|
|
896
896
|
v(pe, {
|
|
897
897
|
"model-value": { low: J.value, mid: Z.value },
|
|
898
898
|
rules: [z()]
|
|
899
899
|
}, null, 8, ["model-value", "rules"]),
|
|
900
|
-
c("div",
|
|
901
|
-
c("div",
|
|
902
|
-
c("div",
|
|
900
|
+
c("div", sn, [
|
|
901
|
+
c("div", rn, [
|
|
902
|
+
c("div", un, [
|
|
903
903
|
v(Fe, {
|
|
904
904
|
days: J.value,
|
|
905
|
-
level:
|
|
905
|
+
level: d(Me).low
|
|
906
906
|
}, null, 8, ["days", "level"])
|
|
907
907
|
]),
|
|
908
|
-
c("div",
|
|
909
|
-
c("div", mn, T(
|
|
908
|
+
c("div", dn, [
|
|
909
|
+
c("div", mn, T(d(l)("inventory.ingredient.threshold.whenRemaining")), 1),
|
|
910
910
|
v(Ae, {
|
|
911
911
|
modelValue: J.value,
|
|
912
912
|
"onUpdate:modelValue": e[9] || (e[9] = (F) => J.value = F),
|
|
913
|
-
rules: [
|
|
913
|
+
rules: [d(ke)(0)]
|
|
914
914
|
}, {
|
|
915
915
|
append: V(() => e[12] || (e[12] = [
|
|
916
916
|
c("div", {
|
|
@@ -935,15 +935,15 @@ const Yt = {
|
|
|
935
935
|
c("div", pn, [
|
|
936
936
|
v(Fe, {
|
|
937
937
|
days: Z.value,
|
|
938
|
-
level:
|
|
938
|
+
level: d(Me).mid
|
|
939
939
|
}, null, 8, ["days", "level"])
|
|
940
940
|
]),
|
|
941
941
|
c("div", vn, [
|
|
942
|
-
c("div", fn, T(
|
|
942
|
+
c("div", fn, T(d(l)("inventory.ingredient.threshold.whenRemaining")), 1),
|
|
943
943
|
v(Ae, {
|
|
944
944
|
modelValue: Z.value,
|
|
945
945
|
"onUpdate:modelValue": e[10] || (e[10] = (F) => Z.value = F),
|
|
946
|
-
rules: [
|
|
946
|
+
rules: [d(ke)(0)]
|
|
947
947
|
}, {
|
|
948
948
|
append: V(() => e[13] || (e[13] = [
|
|
949
949
|
c("div", {
|
|
@@ -968,11 +968,11 @@ const Yt = {
|
|
|
968
968
|
c("div", gn, [
|
|
969
969
|
v(Fe, {
|
|
970
970
|
days: Z.value + 1,
|
|
971
|
-
level:
|
|
971
|
+
level: d(Me).high
|
|
972
972
|
}, null, 8, ["days", "level"])
|
|
973
973
|
]),
|
|
974
974
|
c("div", bn, [
|
|
975
|
-
c("div", hn, T(
|
|
975
|
+
c("div", hn, T(d(l)("inventory.ingredient.threshold.stockIsStaple")), 1)
|
|
976
976
|
])
|
|
977
977
|
])
|
|
978
978
|
])
|
|
@@ -981,8 +981,8 @@ const Yt = {
|
|
|
981
981
|
c("div", null, [
|
|
982
982
|
v(zt, {
|
|
983
983
|
entity: "inventorySku",
|
|
984
|
-
modelValue:
|
|
985
|
-
"onUpdate:modelValue": e[11] || (e[11] = (F) =>
|
|
984
|
+
modelValue: se.value,
|
|
985
|
+
"onUpdate:modelValue": e[11] || (e[11] = (F) => se.value = F)
|
|
986
986
|
}, null, 8, ["modelValue"])
|
|
987
987
|
])
|
|
988
988
|
];
|
|
@@ -999,8 +999,8 @@ const Yt = {
|
|
|
999
999
|
mode: { default: H.READ }
|
|
1000
1000
|
},
|
|
1001
1001
|
emits: ["update:show"],
|
|
1002
|
-
setup(
|
|
1003
|
-
const o =
|
|
1002
|
+
setup(u) {
|
|
1003
|
+
const o = u, y = te(), l = Ue(), n = Se(), { t: a } = ae(), r = Ge(o, "show"), m = Ge(o, "unit"), p = S(
|
|
1004
1004
|
() => {
|
|
1005
1005
|
var k;
|
|
1006
1006
|
return l.isEnabled && l.netSuiteItemBySkuId.has((k = o.unit) == null ? void 0 : k._id);
|
|
@@ -1025,11 +1025,11 @@ const Yt = {
|
|
|
1025
1025
|
return a("common.add");
|
|
1026
1026
|
}
|
|
1027
1027
|
return "";
|
|
1028
|
-
}), b = L(),
|
|
1028
|
+
}), b = L(), s = L(!1);
|
|
1029
1029
|
async function x() {
|
|
1030
|
-
|
|
1030
|
+
s.value = !0;
|
|
1031
1031
|
try {
|
|
1032
|
-
await y.createSku(m.value),
|
|
1032
|
+
await y.createSku(m.value), r.value = !1, n.open({
|
|
1033
1033
|
title: a("inventory.common.success"),
|
|
1034
1034
|
message: a("inventory.ingredient.create.success", { name: m.value.name }),
|
|
1035
1035
|
type: "success"
|
|
@@ -1041,13 +1041,13 @@ const Yt = {
|
|
|
1041
1041
|
type: "error"
|
|
1042
1042
|
});
|
|
1043
1043
|
} finally {
|
|
1044
|
-
|
|
1044
|
+
s.value = !1;
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
1047
|
async function P() {
|
|
1048
|
-
|
|
1048
|
+
s.value = !0;
|
|
1049
1049
|
try {
|
|
1050
|
-
await y.updateSku(m.value),
|
|
1050
|
+
await y.updateSku(m.value), s.value = !1, r.value = !1, n.open({
|
|
1051
1051
|
title: a("inventory.common.success"),
|
|
1052
1052
|
message: a("inventory.ingredient.update.success", { name: m.value.name }),
|
|
1053
1053
|
type: "success"
|
|
@@ -1059,7 +1059,7 @@ const Yt = {
|
|
|
1059
1059
|
type: "error"
|
|
1060
1060
|
});
|
|
1061
1061
|
} finally {
|
|
1062
|
-
|
|
1062
|
+
s.value = !1;
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
1065
|
function E() {
|
|
@@ -1079,8 +1079,8 @@ const Yt = {
|
|
|
1079
1079
|
return (k, I) => {
|
|
1080
1080
|
const M = w("FmChip"), ne = w("FmButton"), W = w("FmSideSheet");
|
|
1081
1081
|
return _(), A(W, {
|
|
1082
|
-
"model-value":
|
|
1083
|
-
"onUpdate:modelValue": I[3] || (I[3] = (K) => Ne(
|
|
1082
|
+
"model-value": d(r),
|
|
1083
|
+
"onUpdate:modelValue": I[3] || (I[3] = (K) => Ne(r) ? r.value = K : null),
|
|
1084
1084
|
header: g.value,
|
|
1085
1085
|
"close-button": "",
|
|
1086
1086
|
"dismiss-away": "",
|
|
@@ -1089,15 +1089,15 @@ const Yt = {
|
|
|
1089
1089
|
"side-sheet-footer": V(() => [
|
|
1090
1090
|
c("div", kn, [
|
|
1091
1091
|
v(ne, {
|
|
1092
|
-
loading:
|
|
1092
|
+
loading: s.value,
|
|
1093
1093
|
label: i.value,
|
|
1094
1094
|
onClick: E
|
|
1095
1095
|
}, null, 8, ["loading", "label"]),
|
|
1096
1096
|
v(ne, {
|
|
1097
|
-
disabled:
|
|
1098
|
-
label:
|
|
1097
|
+
disabled: s.value,
|
|
1098
|
+
label: d(a)("common.close"),
|
|
1099
1099
|
variant: "tertiary",
|
|
1100
|
-
onClick: I[2] || (I[2] = (K) =>
|
|
1100
|
+
onClick: I[2] || (I[2] = (K) => r.value = !1)
|
|
1101
1101
|
}, null, 8, ["disabled", "label"])
|
|
1102
1102
|
])
|
|
1103
1103
|
]),
|
|
@@ -1114,10 +1114,10 @@ const Yt = {
|
|
|
1114
1114
|
class: "w-full",
|
|
1115
1115
|
ref_key: "hasValidationExpose",
|
|
1116
1116
|
ref: b,
|
|
1117
|
-
modelValue:
|
|
1117
|
+
modelValue: d(m),
|
|
1118
1118
|
"onUpdate:modelValue": I[0] || (I[0] = (K) => Ne(m) ? m.value = K : null),
|
|
1119
1119
|
mode: k.mode,
|
|
1120
|
-
disabled:
|
|
1120
|
+
disabled: s.value,
|
|
1121
1121
|
"onClick:submit": I[1] || (I[1] = (K) => N())
|
|
1122
1122
|
}, null, 8, ["modelValue", "mode", "disabled"])
|
|
1123
1123
|
])
|
|
@@ -1137,39 +1137,39 @@ const Cn = {
|
|
|
1137
1137
|
precision: 0,
|
|
1138
1138
|
measurements: []
|
|
1139
1139
|
};
|
|
1140
|
-
function wn(
|
|
1141
|
-
return !
|
|
1140
|
+
function wn(u) {
|
|
1141
|
+
return !u || Object.keys(u).length === 0 ? "" : Object.entries(u).map(([o, y]) => `${o}: ${y}`).join(", ");
|
|
1142
1142
|
}
|
|
1143
|
-
function at(
|
|
1144
|
-
if (!
|
|
1143
|
+
function at(u) {
|
|
1144
|
+
if (!u || u.trim() === "")
|
|
1145
1145
|
return;
|
|
1146
|
-
const o = {}, y =
|
|
1146
|
+
const o = {}, y = u.split(",").map((l) => l.trim());
|
|
1147
1147
|
for (const l of y) {
|
|
1148
1148
|
const n = l.indexOf(":");
|
|
1149
1149
|
if (n > 0) {
|
|
1150
|
-
const a = l.substring(0, n).trim(),
|
|
1151
|
-
a &&
|
|
1150
|
+
const a = l.substring(0, n).trim(), r = l.substring(n + 1).trim();
|
|
1151
|
+
a && r && (o[a] = r);
|
|
1152
1152
|
}
|
|
1153
1153
|
}
|
|
1154
1154
|
return Object.keys(o).length > 0 ? o : void 0;
|
|
1155
1155
|
}
|
|
1156
|
-
function Fn(
|
|
1157
|
-
var y, l, n, a,
|
|
1156
|
+
function Fn(u) {
|
|
1157
|
+
var y, l, n, a, r;
|
|
1158
1158
|
return {
|
|
1159
|
-
code:
|
|
1160
|
-
name:
|
|
1161
|
-
unit: ((y =
|
|
1162
|
-
baseUnit:
|
|
1163
|
-
valuationMethod:
|
|
1164
|
-
pricePerUnit: (l =
|
|
1165
|
-
thresholdLow: ((a =
|
|
1166
|
-
thresholdMid: ((
|
|
1167
|
-
customAttributes: wn(
|
|
1159
|
+
code: u.code,
|
|
1160
|
+
name: u.name,
|
|
1161
|
+
unit: ((y = u.unit.measurements.find((m) => m.id === u.trackingMeasurement)) == null ? void 0 : y.abbrev) ?? u.unit.abbrev,
|
|
1162
|
+
baseUnit: u.unit.abbrev,
|
|
1163
|
+
valuationMethod: u.valuation ?? "WAVG",
|
|
1164
|
+
pricePerUnit: (l = u.defaultCost) != null && l.costPerUnit ? +Xe((n = u.defaultCost) == null ? void 0 : n.costPerUnit) : 0,
|
|
1165
|
+
thresholdLow: ((a = u.thresholds) == null ? void 0 : a.low) ?? ie().low,
|
|
1166
|
+
thresholdMid: ((r = u.thresholds) == null ? void 0 : r.mid) ?? ie().mid,
|
|
1167
|
+
customAttributes: wn(u.customAttributes)
|
|
1168
1168
|
};
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1170
|
+
function st() {
|
|
1171
1171
|
var n;
|
|
1172
|
-
const
|
|
1172
|
+
const u = [
|
|
1173
1173
|
{
|
|
1174
1174
|
id: "code",
|
|
1175
1175
|
name: "Code"
|
|
@@ -1187,7 +1187,7 @@ function rt() {
|
|
|
1187
1187
|
name: "Base unit"
|
|
1188
1188
|
}
|
|
1189
1189
|
], o = tt(), y = be(), l = Ve(y.currentCountry.value);
|
|
1190
|
-
return o.enableTotalCost &&
|
|
1190
|
+
return o.enableTotalCost && u.push(
|
|
1191
1191
|
{
|
|
1192
1192
|
id: "valuationMethod",
|
|
1193
1193
|
name: "Valuation method"
|
|
@@ -1196,7 +1196,7 @@ function rt() {
|
|
|
1196
1196
|
id: "pricePerUnit",
|
|
1197
1197
|
name: `Price per unit (${l == null ? void 0 : l.currency})`
|
|
1198
1198
|
}
|
|
1199
|
-
), ((n = y.currentBusiness.value) == null ? void 0 : n.menuVersion) === "v4" &&
|
|
1199
|
+
), ((n = y.currentBusiness.value) == null ? void 0 : n.menuVersion) === "v4" && u.push(
|
|
1200
1200
|
{
|
|
1201
1201
|
id: "thresholdLow",
|
|
1202
1202
|
name: "Show RED when remaining"
|
|
@@ -1205,54 +1205,54 @@ function rt() {
|
|
|
1205
1205
|
id: "thresholdMid",
|
|
1206
1206
|
name: "Show YELLOW when remaining"
|
|
1207
1207
|
}
|
|
1208
|
-
),
|
|
1208
|
+
), u.push({
|
|
1209
1209
|
id: "customAttributes",
|
|
1210
1210
|
name: "Custom Attributes"
|
|
1211
|
-
}),
|
|
1211
|
+
}), u;
|
|
1212
1212
|
}
|
|
1213
1213
|
function Mn() {
|
|
1214
|
-
const o = te().skus.map(Fn), l = be().currentBusiness.value, n =
|
|
1214
|
+
const o = te().skus.map(Fn), l = be().currentBusiness.value, n = st(), a = [
|
|
1215
1215
|
["Business name:", l == null ? void 0 : l.name],
|
|
1216
1216
|
["Business ID:", l == null ? void 0 : l._id],
|
|
1217
1217
|
["Menu version", l == null ? void 0 : l.menuVersion],
|
|
1218
1218
|
[],
|
|
1219
1219
|
n.map((g) => g.name),
|
|
1220
1220
|
...o.map((g) => n.map((i) => g[i.id]))
|
|
1221
|
-
],
|
|
1221
|
+
], r = n.map((g) => `system:${g.id}`), m = nt(a, r), p = `${l == null ? void 0 : l.name} ingredients (${bt(/* @__PURE__ */ new Date())}).xlsx`;
|
|
1222
1222
|
return ot(m, p), p;
|
|
1223
1223
|
}
|
|
1224
1224
|
function In() {
|
|
1225
|
-
const o = be().currentBusiness.value, y =
|
|
1225
|
+
const o = be().currentBusiness.value, y = st(), l = [
|
|
1226
1226
|
["Business name:", o == null ? void 0 : o.name],
|
|
1227
1227
|
["Business ID:", o == null ? void 0 : o._id],
|
|
1228
1228
|
["Menu version", o == null ? void 0 : o.menuVersion],
|
|
1229
1229
|
[],
|
|
1230
1230
|
y.map((m) => m.name)
|
|
1231
|
-
], n = y.map((m) => `system:${m.id}`), a = nt(l, n),
|
|
1232
|
-
return ot(a,
|
|
1231
|
+
], n = y.map((m) => `system:${m.id}`), a = nt(l, n), r = "FeedMe ingredients template.xlsx";
|
|
1232
|
+
return ot(a, r), r;
|
|
1233
1233
|
}
|
|
1234
|
-
function $n(
|
|
1234
|
+
function $n(u) {
|
|
1235
1235
|
const [
|
|
1236
1236
|
o,
|
|
1237
1237
|
y,
|
|
1238
1238
|
l,
|
|
1239
1239
|
n,
|
|
1240
1240
|
a,
|
|
1241
|
-
|
|
1241
|
+
r,
|
|
1242
1242
|
...m
|
|
1243
|
-
] = _t(
|
|
1244
|
-
if (!o || !o.length || o.some((
|
|
1243
|
+
] = _t(u);
|
|
1244
|
+
if (!o || !o.length || o.some((s) => s.length && !s.startsWith("system:")))
|
|
1245
1245
|
throw new Error("Missing meta header. Excel file does not come from the template.");
|
|
1246
|
-
const p = o.map((
|
|
1246
|
+
const p = o.map((s) => s.split(":")[1]), i = ["code", "name", "unit", "baseUnit"].filter((s) => !p.includes(s));
|
|
1247
1247
|
if (i.length)
|
|
1248
1248
|
throw new Error(
|
|
1249
1249
|
`Missing meta headers (${i.join()}). Excel file does not come from the template.`
|
|
1250
1250
|
);
|
|
1251
|
-
return m.map((
|
|
1251
|
+
return m.map((s, x) => {
|
|
1252
1252
|
const P = {};
|
|
1253
1253
|
for (const E in p) {
|
|
1254
1254
|
const N = p[E];
|
|
1255
|
-
Object.assign(P, { [N]:
|
|
1255
|
+
Object.assign(P, { [N]: s[E] });
|
|
1256
1256
|
}
|
|
1257
1257
|
return {
|
|
1258
1258
|
index: x,
|
|
@@ -1260,41 +1260,41 @@ function $n(d) {
|
|
|
1260
1260
|
};
|
|
1261
1261
|
});
|
|
1262
1262
|
}
|
|
1263
|
-
function We(
|
|
1263
|
+
function We(u, o, y) {
|
|
1264
1264
|
var I;
|
|
1265
|
-
const n = te().units, a = new Array(),
|
|
1266
|
-
|
|
1267
|
-
`Code ${
|
|
1265
|
+
const n = te().units, a = new Array(), r = y.filter((M) => M.data.code === u.code);
|
|
1266
|
+
r.length > 1 && a.push(
|
|
1267
|
+
`Code ${u.code} is already used in row ${r.map((M) => M.index + 6).join()}.`
|
|
1268
1268
|
);
|
|
1269
|
-
const m = n.find((M) => M.abbrev ===
|
|
1269
|
+
const m = n.find((M) => M.abbrev === u.baseUnit), p = m == null ? void 0 : m.measurements.find((M) => M.abbrev === u.unit);
|
|
1270
1270
|
if (!m)
|
|
1271
|
-
a.push(`Cannot find base unit of symbol ${
|
|
1272
|
-
else if (
|
|
1273
|
-
const M = `Cannot find unit conversion for ${
|
|
1271
|
+
a.push(`Cannot find base unit of symbol ${u.baseUnit}.`);
|
|
1272
|
+
else if (u.baseUnit !== u.unit && !p) {
|
|
1273
|
+
const M = `Cannot find unit conversion for ${u.baseUnit} with symbol ${u.unit || "[empty]"}.`;
|
|
1274
1274
|
a.push(M);
|
|
1275
1275
|
}
|
|
1276
1276
|
const g = ge.options.find(
|
|
1277
|
-
(M) => M ===
|
|
1277
|
+
(M) => M === u.valuationMethod
|
|
1278
1278
|
);
|
|
1279
|
-
|
|
1280
|
-
`Expected valuation method to be one of ${ge.options.join()} but got ${
|
|
1279
|
+
u.valuationMethod && !g && a.push(
|
|
1280
|
+
`Expected valuation method to be one of ${ge.options.join()} but got ${u.valuationMethod} instead.`
|
|
1281
1281
|
);
|
|
1282
|
-
const b = be().currentCountry.value,
|
|
1282
|
+
const b = be().currentCountry.value, s = (M) => `${M}`.length && xt()(M) === !0, x = s(`${u.pricePerUnit}`) === !0 ? {
|
|
1283
1283
|
costPerUnit: {
|
|
1284
|
-
...et(Number(
|
|
1284
|
+
...et(Number(u.pricePerUnit) || 0),
|
|
1285
1285
|
currency: ((I = Ve(b)) == null ? void 0 : I.currency) ?? "MYR"
|
|
1286
1286
|
},
|
|
1287
1287
|
measurement: p
|
|
1288
|
-
} : void 0, P =
|
|
1289
|
-
low: Number(
|
|
1290
|
-
mid: Number(
|
|
1291
|
-
} : void 0, E = "customAttributes" in
|
|
1288
|
+
} : void 0, P = s(`${u.thresholdLow}`) && s(`${u.thresholdMid}`) ? {
|
|
1289
|
+
low: Number(u.thresholdLow) || 0,
|
|
1290
|
+
mid: Number(u.thresholdMid) || 0
|
|
1291
|
+
} : void 0, E = "customAttributes" in u ? at(u.customAttributes) : null;
|
|
1292
1292
|
return {
|
|
1293
1293
|
type: "create",
|
|
1294
1294
|
sku: {
|
|
1295
1295
|
_id: Sn(),
|
|
1296
|
-
code:
|
|
1297
|
-
name:
|
|
1296
|
+
code: u.code,
|
|
1297
|
+
name: u.name,
|
|
1298
1298
|
unit: m ?? n.find((M) => M) ?? Cn,
|
|
1299
1299
|
trackingMeasurement: p == null ? void 0 : p.id,
|
|
1300
1300
|
valuation: g,
|
|
@@ -1306,14 +1306,14 @@ function We(d, o, y) {
|
|
|
1306
1306
|
excelRowNumber: o + 6
|
|
1307
1307
|
};
|
|
1308
1308
|
}
|
|
1309
|
-
function En(
|
|
1309
|
+
function En(u) {
|
|
1310
1310
|
try {
|
|
1311
|
-
const o = $n(
|
|
1311
|
+
const o = $n(u).filter((g) => g.data.code), l = te().skus, n = ht(l, "code"), a = o.filter((g) => !n[g.data.code]), r = o.filter((g) => n[g.data.code]), m = a.map(
|
|
1312
1312
|
(g) => We(g.data, g.index, o)
|
|
1313
|
-
), p =
|
|
1313
|
+
), p = r.map((g) => {
|
|
1314
1314
|
const i = We(g.data, g.index, o), b = n[g.data.code];
|
|
1315
|
-
let
|
|
1316
|
-
return "customAttributes" in g.data && (
|
|
1315
|
+
let s = b.customAttributes;
|
|
1316
|
+
return "customAttributes" in g.data && (s = at(g.data.customAttributes)), {
|
|
1317
1317
|
...i,
|
|
1318
1318
|
type: "update",
|
|
1319
1319
|
original: b,
|
|
@@ -1327,7 +1327,7 @@ function En(d) {
|
|
|
1327
1327
|
valuation: i.sku.valuation || b.valuation,
|
|
1328
1328
|
defaultCost: i.sku.defaultCost || b.defaultCost,
|
|
1329
1329
|
thresholds: i.sku.thresholds || b.thresholds,
|
|
1330
|
-
customAttributes:
|
|
1330
|
+
customAttributes: s
|
|
1331
1331
|
}
|
|
1332
1332
|
};
|
|
1333
1333
|
});
|
|
@@ -1356,7 +1356,7 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1356
1356
|
name: {},
|
|
1357
1357
|
errors: {}
|
|
1358
1358
|
},
|
|
1359
|
-
setup(
|
|
1359
|
+
setup(u) {
|
|
1360
1360
|
return (o, y) => {
|
|
1361
1361
|
const l = w("FmIcon"), n = w("FmTooltip");
|
|
1362
1362
|
return _(), D("div", Un, [
|
|
@@ -1375,7 +1375,7 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1375
1375
|
v(n, { "z-index": 50 }, {
|
|
1376
1376
|
content: V(() => [
|
|
1377
1377
|
c("ol", null, [
|
|
1378
|
-
(_(!0), D(ee, null, ye(o.errors, (a,
|
|
1378
|
+
(_(!0), D(ee, null, ye(o.errors, (a, r) => (_(), D("li", { key: r }, T(a), 1))), 128))
|
|
1379
1379
|
])
|
|
1380
1380
|
]),
|
|
1381
1381
|
default: V(() => [
|
|
@@ -1413,18 +1413,18 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1413
1413
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
1414
1414
|
}, Yn = { class: "fm-typo-en-body-lg-600" }, qn = /* @__PURE__ */ le({
|
|
1415
1415
|
__name: "ImportIngredients",
|
|
1416
|
-
setup(
|
|
1417
|
-
const o = L(null), y = Ut(), l = Se(), n = L(!1), a = L(new Array()),
|
|
1418
|
-
() => !!a.value.length ||
|
|
1416
|
+
setup(u) {
|
|
1417
|
+
const o = L(null), y = Ut(), l = Se(), n = L(!1), a = L(new Array()), r = L([]), m = L([]), p = S(
|
|
1418
|
+
() => !!a.value.length || r.value.some((s) => s.errors.length) || m.value.some((s) => s.errors.length)
|
|
1419
1419
|
), g = S(
|
|
1420
|
-
() => !!
|
|
1420
|
+
() => !!r.value.length || !!m.value.length
|
|
1421
1421
|
), { t: i } = ae();
|
|
1422
|
-
async function b(
|
|
1423
|
-
a.value = [],
|
|
1422
|
+
async function b(s) {
|
|
1423
|
+
a.value = [], r.value = [], m.value = [];
|
|
1424
1424
|
try {
|
|
1425
1425
|
n.value = !0;
|
|
1426
1426
|
const [x] = await Promise.all([
|
|
1427
|
-
Vt(
|
|
1427
|
+
Vt(s),
|
|
1428
1428
|
// fake buffer
|
|
1429
1429
|
new Promise((N) => setTimeout(N, 1e3))
|
|
1430
1430
|
]), P = x.SheetNames.find((N) => N);
|
|
@@ -1437,7 +1437,7 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1437
1437
|
a.value.push(E.invalidExcelMessage ?? i("inventory.ingredient.import.fileError.invalidExcel"));
|
|
1438
1438
|
return;
|
|
1439
1439
|
}
|
|
1440
|
-
if (
|
|
1440
|
+
if (r.value = E.importCreateResult, m.value = E.importUpdateResult, !r.value.length && !m.value.length) {
|
|
1441
1441
|
a.value.push(i("inventory.ingredient.import.fileError.noData"));
|
|
1442
1442
|
return;
|
|
1443
1443
|
}
|
|
@@ -1455,12 +1455,12 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1455
1455
|
}), n.value = !1;
|
|
1456
1456
|
}
|
|
1457
1457
|
}
|
|
1458
|
-
return Je(o, (
|
|
1459
|
-
|
|
1460
|
-
}), (
|
|
1458
|
+
return Je(o, (s) => {
|
|
1459
|
+
s && b(s);
|
|
1460
|
+
}), (s, x) => {
|
|
1461
1461
|
const P = w("FmCircularProgress"), E = w("FmIcon"), N = w("FmButton");
|
|
1462
1462
|
return _(), D("div", Bn, [
|
|
1463
|
-
c("div", Pn, T(
|
|
1463
|
+
c("div", Pn, T(d(i)("inventory.ingredient.import.uploadDescription")), 1),
|
|
1464
1464
|
v(kt, {
|
|
1465
1465
|
class: Q({
|
|
1466
1466
|
"w-full": !0,
|
|
@@ -1468,8 +1468,8 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1468
1468
|
}),
|
|
1469
1469
|
accept: ".xlsx",
|
|
1470
1470
|
onFileUpload: x[0] || (x[0] = (k) => o.value = k),
|
|
1471
|
-
label:
|
|
1472
|
-
"button-label":
|
|
1471
|
+
label: d(i)("inventory.ingredient.import.uploadTemplate"),
|
|
1472
|
+
"button-label": d(i)("inventory.ingredient.import.selectFile")
|
|
1473
1473
|
}, Ze({ _: 2 }, [
|
|
1474
1474
|
o.value ? {
|
|
1475
1475
|
name: "default",
|
|
@@ -1508,7 +1508,7 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1508
1508
|
], 2),
|
|
1509
1509
|
n.value ? O("", !0) : (_(), D("div", Ln, [
|
|
1510
1510
|
v(N, {
|
|
1511
|
-
label:
|
|
1511
|
+
label: d(i)("inventory.ingredient.import.replaceFile"),
|
|
1512
1512
|
variant: p.value ? "destructive" : "secondary",
|
|
1513
1513
|
"prepend-icon": p.value ? void 0 : "autorenew",
|
|
1514
1514
|
onClick: k
|
|
@@ -1534,8 +1534,8 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1534
1534
|
} : void 0
|
|
1535
1535
|
]), 1032, ["class", "label", "button-label"]),
|
|
1536
1536
|
g.value ? (_(), D("div", jn, [
|
|
1537
|
-
c("div", Yn, T(
|
|
1538
|
-
(_(!0), D(ee, null, ye(
|
|
1537
|
+
c("div", Yn, T(d(i)("inventory.ingredient.import.summary")), 1),
|
|
1538
|
+
(_(!0), D(ee, null, ye(r.value, (k) => (_(), A(Ke, {
|
|
1539
1539
|
key: k.sku._id,
|
|
1540
1540
|
code: k.sku.code,
|
|
1541
1541
|
name: k.sku.name,
|
|
@@ -1555,7 +1555,7 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1555
1555
|
}
|
|
1556
1556
|
}), Gn = { class: "flex flex-col py-8" }, Wn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Kn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, co = /* @__PURE__ */ le({
|
|
1557
1557
|
__name: "IngredientsView",
|
|
1558
|
-
setup(
|
|
1558
|
+
setup(u) {
|
|
1559
1559
|
const o = te(), y = S(() => [
|
|
1560
1560
|
{
|
|
1561
1561
|
type: "string",
|
|
@@ -1568,6 +1568,12 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1568
1568
|
key: "skuUnitAbbrev",
|
|
1569
1569
|
entity: "sku",
|
|
1570
1570
|
values: o.units.map((C) => C.abbrev)
|
|
1571
|
+
},
|
|
1572
|
+
{
|
|
1573
|
+
type: "string",
|
|
1574
|
+
key: "skuInactive",
|
|
1575
|
+
entity: "sku",
|
|
1576
|
+
values: ["Yes", "No"]
|
|
1571
1577
|
}
|
|
1572
1578
|
]), l = L(null), n = S(() => {
|
|
1573
1579
|
if (!l.value)
|
|
@@ -1576,11 +1582,12 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1576
1582
|
return o.skus.filter((C) => Ct(
|
|
1577
1583
|
{
|
|
1578
1584
|
skuCode: C.code,
|
|
1579
|
-
skuUnitAbbrev: C.unit.abbrev
|
|
1585
|
+
skuUnitAbbrev: C.unit.abbrev,
|
|
1586
|
+
skuInactive: C.isInactive ? "Yes" : "No"
|
|
1580
1587
|
},
|
|
1581
1588
|
U
|
|
1582
1589
|
));
|
|
1583
|
-
}), a = wt(),
|
|
1590
|
+
}), a = wt(), r = lt(), m = Ot(), p = Se(), g = Ue(), { t: i } = ae(), { createIngredient: b, updateIngredient: s } = $e(), { ingredientDialogProps: x, ingredientViewLoading: P } = Bt($e()), { columnDefs: E } = Ht();
|
|
1584
1591
|
function N(U) {
|
|
1585
1592
|
switch (U) {
|
|
1586
1593
|
case "add":
|
|
@@ -1588,10 +1595,10 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1588
1595
|
case "import":
|
|
1589
1596
|
return me();
|
|
1590
1597
|
case "export":
|
|
1591
|
-
return
|
|
1598
|
+
return de();
|
|
1592
1599
|
}
|
|
1593
1600
|
}
|
|
1594
|
-
const k = L(""), I = L(!1), M = S(() => I.value || P.value), { breakpoints: ne } = Rt(), W = S(() => ne.value.xs || ne.value.sm), K = S(() => W.value ? 10 : 20),
|
|
1601
|
+
const k = L(""), I = L(!1), M = S(() => I.value || P.value), { breakpoints: ne } = Rt(), W = S(() => ne.value.xs || ne.value.sm), K = S(() => W.value ? 10 : 20), ue = Ft(), se = L(!1), re = [
|
|
1595
1602
|
{
|
|
1596
1603
|
value: "import",
|
|
1597
1604
|
label: i("common.import")
|
|
@@ -1602,11 +1609,11 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1602
1609
|
}
|
|
1603
1610
|
];
|
|
1604
1611
|
function oe(U) {
|
|
1605
|
-
switch (
|
|
1612
|
+
switch (se.value = !1, U) {
|
|
1606
1613
|
case "import":
|
|
1607
1614
|
return me();
|
|
1608
1615
|
case "export":
|
|
1609
|
-
return
|
|
1616
|
+
return de();
|
|
1610
1617
|
}
|
|
1611
1618
|
}
|
|
1612
1619
|
const he = S(() => [
|
|
@@ -1621,7 +1628,7 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1621
1628
|
{ label: i("common.import"), value: "import" },
|
|
1622
1629
|
{ label: i("common.export"), value: "export" }
|
|
1623
1630
|
]);
|
|
1624
|
-
function
|
|
1631
|
+
function de() {
|
|
1625
1632
|
const U = Mn();
|
|
1626
1633
|
p.open({
|
|
1627
1634
|
title: i("inventory.ingredient.export.success"),
|
|
@@ -1630,7 +1637,7 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1630
1637
|
});
|
|
1631
1638
|
}
|
|
1632
1639
|
function me() {
|
|
1633
|
-
|
|
1640
|
+
r.open({
|
|
1634
1641
|
title: i("inventory.ingredient.import.title"),
|
|
1635
1642
|
contentComponent: qn,
|
|
1636
1643
|
overlay: !0,
|
|
@@ -1672,7 +1679,7 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1672
1679
|
});
|
|
1673
1680
|
return;
|
|
1674
1681
|
}
|
|
1675
|
-
|
|
1682
|
+
r.close(), Ce(U);
|
|
1676
1683
|
}).onTertiary(In);
|
|
1677
1684
|
}
|
|
1678
1685
|
async function Ce(U) {
|
|
@@ -1749,7 +1756,7 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1749
1756
|
return (U, C) => {
|
|
1750
1757
|
const ce = w("FmTable"), J = w("FmCollapsibleTabs"), Z = w("FmBottomSheet");
|
|
1751
1758
|
return _(), A(Mt, {
|
|
1752
|
-
title:
|
|
1759
|
+
title: d(i)("inventory.ingredient.title"),
|
|
1753
1760
|
actions: he.value,
|
|
1754
1761
|
"onClick:action": N
|
|
1755
1762
|
}, {
|
|
@@ -1774,32 +1781,32 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1774
1781
|
}, null, 8, ["search", "filter-attributes", "filter"]),
|
|
1775
1782
|
(_(), A(ce, {
|
|
1776
1783
|
key: JSON.stringify(l.value),
|
|
1777
|
-
style:
|
|
1778
|
-
"column-defs":
|
|
1784
|
+
style: dt(d(ue).tableHeight),
|
|
1785
|
+
"column-defs": d(E),
|
|
1779
1786
|
"row-data": n.value,
|
|
1780
1787
|
"search-value": k.value,
|
|
1781
|
-
loading: !
|
|
1788
|
+
loading: !d(a)._currentLocation || M.value,
|
|
1782
1789
|
"loading-text": "Loading",
|
|
1783
|
-
onRowClick: C[2] || (C[2] = (z) =>
|
|
1790
|
+
onRowClick: C[2] || (C[2] = (z) => d(s)(z.original)),
|
|
1784
1791
|
"page-size": K.value
|
|
1785
1792
|
}, {
|
|
1786
1793
|
"list-row": V((z) => [
|
|
1787
1794
|
v($t, {
|
|
1788
1795
|
row: z,
|
|
1789
|
-
onRowClick:
|
|
1796
|
+
onRowClick: d(s)
|
|
1790
1797
|
}, Ze({
|
|
1791
1798
|
default: V((B) => {
|
|
1792
1799
|
var t, e, f, h, R, $, j, Y, G, pe;
|
|
1793
1800
|
return [
|
|
1794
1801
|
c("div", Gn, [
|
|
1795
1802
|
c("div", Wn, [
|
|
1796
|
-
v(
|
|
1803
|
+
v(d(Ye), {
|
|
1797
1804
|
render: (f = (e = (t = B.code) == null ? void 0 : t.column) == null ? void 0 : e.columnDef) == null ? void 0 : f.cell,
|
|
1798
1805
|
props: (R = (h = B.code) == null ? void 0 : h.getContext) == null ? void 0 : R.call(h)
|
|
1799
1806
|
}, null, 8, ["render", "props"])
|
|
1800
1807
|
]),
|
|
1801
1808
|
c("div", Kn, [
|
|
1802
|
-
v(
|
|
1809
|
+
v(d(Ye), {
|
|
1803
1810
|
render: (Y = (j = ($ = B.name) == null ? void 0 : $.column) == null ? void 0 : j.columnDef) == null ? void 0 : Y.cell,
|
|
1804
1811
|
props: (pe = (G = B.name) == null ? void 0 : G.getContext) == null ? void 0 : pe.call(G)
|
|
1805
1812
|
}, null, 8, ["render", "props"])
|
|
@@ -1812,7 +1819,7 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1812
1819
|
I.value ? {
|
|
1813
1820
|
name: "loading-text",
|
|
1814
1821
|
fn: V(() => [
|
|
1815
|
-
c("div", null, T(
|
|
1822
|
+
c("div", null, T(d(i)("inventory.ingredient.table.importing")), 1)
|
|
1816
1823
|
]),
|
|
1817
1824
|
key: "0"
|
|
1818
1825
|
} : void 0
|
|
@@ -1822,18 +1829,18 @@ const Un = { class: "flex items-center gap-12 pl-8" }, Rn = { class: "flex flex-
|
|
|
1822
1829
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
1823
1830
|
], 2),
|
|
1824
1831
|
(_(), A(ze, { to: "body" }, [
|
|
1825
|
-
v(Vn, mt(ct(
|
|
1832
|
+
v(Vn, mt(ct(d(x))), null, 16)
|
|
1826
1833
|
])),
|
|
1827
1834
|
(_(), A(ze, { to: "body" }, [
|
|
1828
1835
|
v(Z, {
|
|
1829
1836
|
"dismiss-away": "",
|
|
1830
|
-
modelValue:
|
|
1831
|
-
"onUpdate:modelValue": C[4] || (C[4] = (z) =>
|
|
1837
|
+
modelValue: se.value,
|
|
1838
|
+
"onUpdate:modelValue": C[4] || (C[4] = (z) => se.value = z)
|
|
1832
1839
|
}, {
|
|
1833
1840
|
default: V(() => [
|
|
1834
1841
|
v(J, {
|
|
1835
1842
|
class: "pb-8",
|
|
1836
|
-
items:
|
|
1843
|
+
items: re,
|
|
1837
1844
|
"onUpdate:modelValue": C[3] || (C[3] = (z) => oe(z))
|
|
1838
1845
|
})
|
|
1839
1846
|
]),
|