@feedmepos/mf-inventory-portal 1.2.8-dev.1 → 1.2.8
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-BL2MW6zc.js → App-D1IJlQS8.js} +1 -1
- package/dist/{ApprovalView-C18JNyKG.js → ApprovalView-GnDYWZHY.js} +2 -2
- package/dist/{BindingsDialog-DxXGq2TK.js → BindingsDialog-Bs00N9mp.js} +2 -2
- package/dist/{BindingsPicker-BsuXkTQv.js → BindingsPicker-LO15pMdZ.js} +1 -1
- package/dist/{BindingsTable-BeGm5MK6.js → BindingsTable-g27KG9q4.js} +1 -1
- package/dist/{ClosingDraftView-yzzV-yhQ.js → ClosingDraftView-Ddsgcrmg.js} +2 -2
- package/dist/{ClosingTemplateView-DgI8ANjn.js → ClosingTemplateView-G8Ya81UZ.js} +3 -3
- package/dist/{DeliveryOrderPrintPreview-B3xmuRAQ.js → DeliveryOrderPrintPreview-qq1rhFKV.js} +1 -1
- package/dist/{FmAdminBadge-9bTzCMaP.js → FmAdminBadge-B2NpMmJi.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B1pioWnC.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C1i9CHE1.js} +3 -3
- package/dist/{FmMultiselectDialog-D4QIUWaf.js → FmMultiselectDialog-u2dbuZUp.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CwuM-hJU.js → FmUnitInput.vue_vue_type_script_setup_true_lang-vpiiv6C1.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BFeK6K0l.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-3T-d1pIb.js} +1 -1
- package/dist/{IngredientGroupView-Ku7t3MgL.js → IngredientGroupView-CqB73-e4.js} +2 -2
- package/dist/{IngredientsView-CAn1-40w.js → IngredientsView-Cq42ytcN.js} +673 -688
- package/dist/{IntegrationView-DEtbdogx.js → IntegrationView-OHnUGZst.js} +4 -4
- package/dist/{InventoryBindingForm-BqBGbblS.js → InventoryBindingForm-DorgxR-Y.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CpVc2nGE.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CZy77tY7.js} +3 -3
- package/dist/{InventoryBindingSummary-dEM8P354.js → InventoryBindingSummary-B_YavyPb.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-0AaD13Wg.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-XuEDo134.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BqVwcG4Z.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Blq1oE5l.js} +1 -1
- package/dist/{PublishView-CE2Ul9NM.js → PublishView-Ds_ztGcV.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-C6Lg4V4I.js → PurchaseOrderPrintPreview-DnyqN_xE.js} +1 -1
- package/dist/{ReceiveRequestView-CDTT3m48.js → ReceiveRequestView-ChpKsDaF.js} +8 -8
- package/dist/{RecipeView-CROKnpq9.js → RecipeView-Dyp9Xcme.js} +3 -3
- package/dist/StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js +59 -0
- package/dist/{StockView-Wv700Rt6.js → StockView-D-iP52Zw.js} +679 -694
- package/dist/{SupplierView-BNWtlH7a.js → SupplierView-BaEK3C8q.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BvzSua6d.js → TransferDetails.vue_vue_type_script_setup_true_lang-B_ravTwn.js} +6 -6
- package/dist/{TransferTemplateView-DlxBMSPW.js → TransferTemplateView-3zS7hNZz.js} +7 -7
- package/dist/{UnitView-B56YIwiR.js → UnitView-BP5eztAG.js} +3 -3
- package/dist/{WarehouseView-C0d-uE4n.js → WarehouseView-DMY7Lgwq.js} +1 -1
- package/dist/{app-Bo3plhvb.js → app-P6XaUzjP.js} +14 -14
- package/dist/app.js +1 -1
- package/dist/{closing-template-ByR3kWir.js → closing-template-BGYZPBty.js} +1 -1
- package/dist/{decimal-YpqAHWnk.js → decimal-wz5HXhQ8.js} +1 -1
- package/dist/{format-unit-display-CpusApo9.js → format-unit-display-DOOJqLop.js} +3 -3
- package/dist/{index-CJTjmcUN.js → index-CHTB43Wl.js} +1 -1
- package/dist/{index-BHD7bEuA.js → index-oR0svfBM.js} +1 -1
- package/dist/{purchase-order-template-CNhjKd6p.js → purchase-order-template-BGunGekw.js} +1 -1
- package/dist/{stock-BhgeS5mL.js → stock-TJayQnag.js} +1 -1
- package/dist/{supplier-DG8JyhMj.js → supplier-C_vqpE92.js} +1 -1
- package/dist/{use-ingredient-select-dialog-LIEBAng-.js → use-ingredient-select-dialog-CIahwuTX.js} +1 -1
- package/dist/{use-inventory-binding-dialog-Df7DfQ1b.js → use-inventory-binding-dialog-BiKRXVhY.js} +1 -1
- package/package.json +2 -2
- package/dist/SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BdtRkUS6.js +0 -158
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import { ref as B, h as
|
|
2
|
-
import { a as
|
|
3
|
-
import { useDialog as
|
|
1
|
+
import { ref as B, h as J, defineComponent as ye, computed as k, resolveComponent as S, openBlock as f, createBlock as D, withCtx as w, createVNode as p, unref as a, createElementBlock as E, Fragment as X, createElementVNode as d, createCommentVNode as H, renderSlot as Ve, createTextVNode as qe, toDisplayString as $, normalizeClass as ae, mergeModels as dt, onMounted as jt, watch as wt, useModel as Ht, renderList as ue, isRef as ct, createSlots as Tt, normalizeStyle as Wt, Teleport as mt, normalizeProps as Yt, guardReactiveProps as qt } from "vue";
|
|
2
|
+
import { a as de, e as W, f as Vt, S as Gt, b as Be, h as Kt, D as pt, i as $e, A as Pe, j as It, k as Ct, l as Oe, t as St, m as Jt, n as Ce, o as ze, U as Qt, p as Zt, M as Xt, q as vt, r as ft, c as Ge, s as Le, v as yt, w as en, x as gt, y as Ft, z as tn, B as Mt, C as nn, E as on, I as ln, G as an, H as sn, N as rn, J as un, u as dn, K as cn, _ as mn, L as pn, O as vn, P as bt, Q as fn } from "./app-P6XaUzjP.js";
|
|
3
|
+
import { useDialog as Ke, useSnackbar as Se, components as Re, useProxiedModel as ht, useDialogChild as yn, useBreakpoints as gn } from "@feedmepos/ui-library";
|
|
4
4
|
import { i as bn, _ as hn } from "./is-linked-ingredient-error-fJ2TJb3z.js";
|
|
5
|
-
import { useI18n as ge, useCoreStore as
|
|
5
|
+
import { useI18n as ge, useCoreStore as Fe } from "@feedmepos/mf-common";
|
|
6
6
|
import { defineStore as _n, storeToRefs as xn } from "pinia";
|
|
7
|
-
import { g as kn, _ as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { _ as
|
|
7
|
+
import { g as kn, _ as je, S as He } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
|
|
8
|
+
import { _ as wn } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CZy77tY7.js";
|
|
9
|
+
import { _ as We } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-3T-d1pIb.js";
|
|
10
10
|
import { _ as fe } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
11
|
-
import { _ as
|
|
12
|
-
import { u as Et } from "./purchase-order-template-
|
|
13
|
-
import { u as At } from "./closing-template-
|
|
14
|
-
import { r as
|
|
11
|
+
import { _ as Tn } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
|
|
12
|
+
import { u as Et } from "./purchase-order-template-BGunGekw.js";
|
|
13
|
+
import { u as At } from "./closing-template-BGYZPBty.js";
|
|
14
|
+
import { r as Vn } from "./random-CSbEbElR.js";
|
|
15
15
|
import "./array-Ca8T3f_G.js";
|
|
16
|
-
import { u as
|
|
17
|
-
const
|
|
18
|
-
const o =
|
|
16
|
+
import { u as In } from "./FmMultiselectDialog-u2dbuZUp.js";
|
|
17
|
+
const Ye = _n("ingredientForm", function() {
|
|
18
|
+
const o = Ke(), v = Se(), l = de(), c = B(!1), { t: g } = ge(), h = B();
|
|
19
19
|
function y() {
|
|
20
|
-
const
|
|
20
|
+
const i = {
|
|
21
21
|
unit: {},
|
|
22
|
-
mode:
|
|
22
|
+
mode: W.CREATE,
|
|
23
23
|
show: !0,
|
|
24
|
-
"onUpdate:show"(
|
|
25
|
-
h.value.show =
|
|
24
|
+
"onUpdate:show"(r) {
|
|
25
|
+
h.value.show = r;
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
h.value =
|
|
28
|
+
h.value = i;
|
|
29
29
|
}
|
|
30
|
-
async function n(
|
|
31
|
-
const
|
|
32
|
-
unit: Vt(
|
|
33
|
-
mode:
|
|
30
|
+
async function n(i) {
|
|
31
|
+
const r = {
|
|
32
|
+
unit: Vt(i),
|
|
33
|
+
mode: W.UPDATE,
|
|
34
34
|
show: !0,
|
|
35
35
|
"onUpdate:show"(T) {
|
|
36
36
|
h.value.show = T;
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
h.value =
|
|
39
|
+
h.value = r;
|
|
40
40
|
}
|
|
41
|
-
async function s(
|
|
41
|
+
async function s(i) {
|
|
42
42
|
c.value = !0;
|
|
43
43
|
try {
|
|
44
|
-
await l.deleteSku(
|
|
44
|
+
await l.deleteSku(i), v.open({
|
|
45
45
|
title: "Success",
|
|
46
|
-
message: `Deleted ${
|
|
46
|
+
message: `Deleted ${i.name}`,
|
|
47
47
|
type: "success"
|
|
48
48
|
});
|
|
49
|
-
} catch (
|
|
50
|
-
|
|
49
|
+
} catch (r) {
|
|
50
|
+
r instanceof Gt && bn(r) ? o.open({
|
|
51
51
|
title: "Cannot delete ingredient",
|
|
52
52
|
contentComponent: hn,
|
|
53
53
|
contentComponentProps: {
|
|
54
|
-
subject: (
|
|
55
|
-
items:
|
|
54
|
+
subject: (i == null ? void 0 : i.name) ?? "",
|
|
55
|
+
items: r.errorResponse.message
|
|
56
56
|
},
|
|
57
57
|
secondaryActions: {
|
|
58
58
|
text: "Close",
|
|
59
59
|
close: !0
|
|
60
60
|
}
|
|
61
|
-
}) : console.log("unable to delete ingredient",
|
|
62
|
-
title: `Cannot delete ${
|
|
61
|
+
}) : console.log("unable to delete ingredient", r), v.open({
|
|
62
|
+
title: `Cannot delete ${i.name}`,
|
|
63
63
|
message: "Please try again.",
|
|
64
64
|
type: "error"
|
|
65
|
-
}), console.error("failed to delete ingredient",
|
|
65
|
+
}), console.error("failed to delete ingredient", r);
|
|
66
66
|
} finally {
|
|
67
67
|
c.value = !1;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
function m(
|
|
70
|
+
function m(i) {
|
|
71
71
|
o.open({
|
|
72
|
-
title: g("inventory.ingredient.delete.title", [(
|
|
72
|
+
title: g("inventory.ingredient.delete.title", [(i == null ? void 0 : i.name) ?? ""]),
|
|
73
73
|
closeButton: !1,
|
|
74
74
|
message: g("inventory.ingredient.delete.message"),
|
|
75
75
|
primaryActions: {
|
|
@@ -81,7 +81,7 @@ const qe = _n("ingredientForm", function() {
|
|
|
81
81
|
text: g("common.cancel"),
|
|
82
82
|
close: !0
|
|
83
83
|
}
|
|
84
|
-
}).onPrimary(() => s(
|
|
84
|
+
}).onPrimary(() => s(i));
|
|
85
85
|
}
|
|
86
86
|
return {
|
|
87
87
|
createIngredient: y,
|
|
@@ -92,14 +92,14 @@ const qe = _n("ingredientForm", function() {
|
|
|
92
92
|
};
|
|
93
93
|
});
|
|
94
94
|
function Cn() {
|
|
95
|
-
const { updateIngredient:
|
|
95
|
+
const { updateIngredient: u, deleteIngredient: o } = Ye(), v = de(), l = Be(), { t: c } = ge();
|
|
96
96
|
async function g(y, n) {
|
|
97
97
|
const s = Vt(n);
|
|
98
|
-
if (y ===
|
|
99
|
-
await
|
|
98
|
+
if (y === $e.Edit) {
|
|
99
|
+
await u(s);
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
|
-
if (y ===
|
|
102
|
+
if (y === $e.Delete) {
|
|
103
103
|
await o(s);
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
@@ -118,15 +118,15 @@ function Cn() {
|
|
|
118
118
|
size: 300,
|
|
119
119
|
cell(y) {
|
|
120
120
|
const n = y.row.original, s = v.skuBindingFlattenCache[n._id], m = s == null ? void 0 : s.inventoryBindings.some(
|
|
121
|
-
(
|
|
121
|
+
(i) => "error" in i && i.reason === "circularDependency"
|
|
122
122
|
);
|
|
123
|
-
return
|
|
124
|
-
m ?
|
|
125
|
-
|
|
123
|
+
return J("div", { class: "flex items-center w-full gap-4" }, [
|
|
124
|
+
m ? J(
|
|
125
|
+
Re.FmTooltip,
|
|
126
126
|
{ class: "text-left" },
|
|
127
127
|
{
|
|
128
128
|
default() {
|
|
129
|
-
return
|
|
129
|
+
return J(Re.FmIcon, {
|
|
130
130
|
name: "info",
|
|
131
131
|
color: "system-error-300",
|
|
132
132
|
size: "sm"
|
|
@@ -147,10 +147,10 @@ function Cn() {
|
|
|
147
147
|
accessorFn: (y) => _t(y),
|
|
148
148
|
cell(y) {
|
|
149
149
|
const n = y.row.original, s = _t(n);
|
|
150
|
-
return
|
|
151
|
-
|
|
150
|
+
return J(
|
|
151
|
+
Re.FmTooltip,
|
|
152
152
|
{ zIndex: 51, content: s },
|
|
153
|
-
|
|
153
|
+
J(
|
|
154
154
|
"span",
|
|
155
155
|
{
|
|
156
156
|
class: "flex-auto line-clamp-2 text-ellipsis break-all"
|
|
@@ -167,7 +167,7 @@ function Cn() {
|
|
|
167
167
|
header: () => c("inventory.ingredient.status.title"),
|
|
168
168
|
cell(y) {
|
|
169
169
|
const n = y.row.original.isInactive;
|
|
170
|
-
return
|
|
170
|
+
return J(
|
|
171
171
|
"span",
|
|
172
172
|
{
|
|
173
173
|
class: [
|
|
@@ -185,32 +185,32 @@ function Cn() {
|
|
|
185
185
|
header: () => "NetSuite Subsidiary",
|
|
186
186
|
cell(y) {
|
|
187
187
|
const n = y.row.original, { includeChildren: s, subsidiaryNames: m } = l.getSkuSubsidiaries(n._id);
|
|
188
|
-
return
|
|
189
|
-
|
|
188
|
+
return J(
|
|
189
|
+
Re.FmTooltip,
|
|
190
190
|
{ zIndex: 51, variant: "rich" },
|
|
191
191
|
{
|
|
192
|
-
default: () =>
|
|
192
|
+
default: () => J(
|
|
193
193
|
"span",
|
|
194
194
|
{
|
|
195
195
|
class: "flex-auto line-clamp-2 text-ellipsis break-all whitespace-pre-wrap"
|
|
196
196
|
},
|
|
197
197
|
m.join(", ")
|
|
198
198
|
),
|
|
199
|
-
content: () =>
|
|
200
|
-
|
|
201
|
-
s ?
|
|
199
|
+
content: () => J("div", { class: "flex flex-col" }, [
|
|
200
|
+
J("div", { class: "font-semibold" }, [
|
|
201
|
+
s ? J("span", { class: "text-green-500" }, "Include ") : J("span", { class: "text-red-500" }, "Not Include "),
|
|
202
202
|
"Children Subsidiaries"
|
|
203
203
|
]),
|
|
204
|
-
|
|
204
|
+
J(
|
|
205
205
|
"ul",
|
|
206
206
|
{ class: "text-left pb-2" },
|
|
207
207
|
m.map(
|
|
208
|
-
(
|
|
208
|
+
(i) => J(
|
|
209
209
|
"li",
|
|
210
210
|
{
|
|
211
211
|
class: "my-1 p-1 rounded bg-fm-color-system-info-100 text-fm-color-neutral-black"
|
|
212
212
|
},
|
|
213
|
-
|
|
213
|
+
i
|
|
214
214
|
)
|
|
215
215
|
)
|
|
216
216
|
)
|
|
@@ -226,7 +226,7 @@ function Cn() {
|
|
|
226
226
|
header: "",
|
|
227
227
|
cell(y) {
|
|
228
228
|
return Kt(
|
|
229
|
-
[pt[
|
|
229
|
+
[pt[$e.Edit], pt[$e.Delete]],
|
|
230
230
|
(n) => {
|
|
231
231
|
g(n, y.row.original);
|
|
232
232
|
}
|
|
@@ -241,16 +241,16 @@ function Cn() {
|
|
|
241
241
|
}
|
|
242
242
|
] };
|
|
243
243
|
}
|
|
244
|
-
function _t(
|
|
244
|
+
function _t(u) {
|
|
245
245
|
var o;
|
|
246
|
-
if (
|
|
247
|
-
const v = (o =
|
|
246
|
+
if (u.trackingMeasurement) {
|
|
247
|
+
const v = (o = u.unit.measurements) == null ? void 0 : o.find((l) => l.id === u.trackingMeasurement);
|
|
248
248
|
if (v)
|
|
249
249
|
return `${v.name} (${v.abbrev})`;
|
|
250
250
|
}
|
|
251
|
-
return `${
|
|
251
|
+
return `${u.unit.name} (${u.unit.abbrev})`;
|
|
252
252
|
}
|
|
253
|
-
const
|
|
253
|
+
const Sn = /* @__PURE__ */ ye({
|
|
254
254
|
__name: "ConvertForm",
|
|
255
255
|
props: {
|
|
256
256
|
modelValue: {},
|
|
@@ -259,74 +259,74 @@ const Fn = /* @__PURE__ */ ye({
|
|
|
259
259
|
readonly: { type: Boolean }
|
|
260
260
|
},
|
|
261
261
|
emits: ["update:modelValue"],
|
|
262
|
-
setup(
|
|
263
|
-
const v =
|
|
264
|
-
var
|
|
265
|
-
return (
|
|
262
|
+
setup(u, { emit: o }) {
|
|
263
|
+
const v = u, l = k(() => {
|
|
264
|
+
var r;
|
|
265
|
+
return (r = v.rootValue) == null ? void 0 : r.unit;
|
|
266
266
|
}), c = k(() => {
|
|
267
|
-
var
|
|
268
|
-
return (
|
|
267
|
+
var r;
|
|
268
|
+
return (r = v.rootValue) == null ? void 0 : r._id;
|
|
269
269
|
}), g = o, { t: h } = ge(), y = k({
|
|
270
270
|
get() {
|
|
271
271
|
return !!v.modelValue;
|
|
272
272
|
},
|
|
273
|
-
set(
|
|
274
|
-
|
|
273
|
+
set(r) {
|
|
274
|
+
r ? g("update:modelValue", {
|
|
275
275
|
measurement: null,
|
|
276
276
|
inventoryBindings: []
|
|
277
277
|
}) : g("update:modelValue", null);
|
|
278
278
|
}
|
|
279
279
|
}), n = k(() => kn(l.value));
|
|
280
|
-
function s(
|
|
280
|
+
function s(r) {
|
|
281
281
|
const T = v.modelValue ?? {};
|
|
282
|
-
T.measurement =
|
|
282
|
+
T.measurement = r ? `${r}` : null, g("update:modelValue", T);
|
|
283
283
|
}
|
|
284
|
-
function m(
|
|
284
|
+
function m(r) {
|
|
285
285
|
const T = v.modelValue ?? {};
|
|
286
|
-
T.inventoryBindings =
|
|
286
|
+
T.inventoryBindings = r, g("update:modelValue", T);
|
|
287
287
|
}
|
|
288
|
-
const
|
|
288
|
+
const i = k(() => {
|
|
289
289
|
if (!v.modelValue) return null;
|
|
290
|
-
const
|
|
291
|
-
return
|
|
290
|
+
const r = v.modelValue;
|
|
291
|
+
return r.measurement ? n.value.find((T) => T.value === r.measurement) ?? null : n.value.find((T) => T.value === null) ?? null;
|
|
292
292
|
});
|
|
293
|
-
return (
|
|
294
|
-
const
|
|
295
|
-
return f(), D(
|
|
293
|
+
return (r, T) => {
|
|
294
|
+
const A = S("FmSwitch"), R = S("FmSelect"), G = S("FmCard");
|
|
295
|
+
return f(), D(G, {
|
|
296
296
|
variant: "outlined",
|
|
297
297
|
class: "p-16 flex flex-col gap-16"
|
|
298
298
|
}, {
|
|
299
299
|
default: w(() => {
|
|
300
|
-
var
|
|
300
|
+
var U, j;
|
|
301
301
|
return [
|
|
302
|
-
p(
|
|
302
|
+
p(A, {
|
|
303
303
|
value: "",
|
|
304
304
|
"model-value": y.value,
|
|
305
305
|
"onUpdate:modelValue": T[0] || (T[0] = (V) => y.value = V),
|
|
306
306
|
label: a(h)("inventory.ingredient.convertible.title"),
|
|
307
307
|
sublabel: a(h)("inventory.ingredient.convertible.subtitle"),
|
|
308
308
|
labelPlacement: "right",
|
|
309
|
-
disabled:
|
|
309
|
+
disabled: r.readonly
|
|
310
310
|
}, null, 8, ["model-value", "label", "sublabel", "disabled"]),
|
|
311
311
|
y.value ? (f(), E(X, { key: 0 }, [
|
|
312
|
-
|
|
313
|
-
p(
|
|
312
|
+
d("div", null, [
|
|
313
|
+
p(R, {
|
|
314
314
|
label: a(h)("inventory.ingredient.convertible.convertTo"),
|
|
315
|
-
modelValue: (
|
|
315
|
+
modelValue: (U = i.value) == null ? void 0 : U.value,
|
|
316
316
|
"onUpdate:modelValue": s,
|
|
317
317
|
items: n.value,
|
|
318
|
-
disabled:
|
|
318
|
+
disabled: r.readonly
|
|
319
319
|
}, null, 8, ["label", "modelValue", "items", "disabled"])
|
|
320
320
|
]),
|
|
321
|
-
p(
|
|
321
|
+
p(wn, {
|
|
322
322
|
id: c.value,
|
|
323
|
-
"model-value": ((j =
|
|
323
|
+
"model-value": ((j = r.modelValue) == null ? void 0 : j.inventoryBindings) ?? [],
|
|
324
324
|
"onUpdate:modelValue": m,
|
|
325
325
|
"exclude-binding-id": c.value,
|
|
326
|
-
rules: [a(
|
|
327
|
-
readonly:
|
|
326
|
+
rules: [a(Pe)(1)],
|
|
327
|
+
readonly: r.readonly
|
|
328
328
|
}, null, 8, ["id", "model-value", "exclude-binding-id", "rules", "readonly"])
|
|
329
|
-
], 64)) :
|
|
329
|
+
], 64)) : H("", !0)
|
|
330
330
|
];
|
|
331
331
|
}),
|
|
332
332
|
_: 1
|
|
@@ -334,16 +334,16 @@ const Fn = /* @__PURE__ */ ye({
|
|
|
334
334
|
};
|
|
335
335
|
}
|
|
336
336
|
});
|
|
337
|
-
function
|
|
337
|
+
function _e() {
|
|
338
338
|
return {
|
|
339
339
|
low: 6,
|
|
340
340
|
mid: 14
|
|
341
341
|
};
|
|
342
342
|
}
|
|
343
|
-
const
|
|
343
|
+
const Fn = {
|
|
344
344
|
key: 0,
|
|
345
345
|
class: "flex flex-col gap-4"
|
|
346
|
-
},
|
|
346
|
+
}, Ie = /* @__PURE__ */ ye({
|
|
347
347
|
__name: "FmLockableField",
|
|
348
348
|
props: {
|
|
349
349
|
locked: { type: Boolean },
|
|
@@ -355,17 +355,17 @@ const Mn = {
|
|
|
355
355
|
tooltipPlacement: {},
|
|
356
356
|
tooltipZIndex: {}
|
|
357
357
|
},
|
|
358
|
-
setup(
|
|
358
|
+
setup(u) {
|
|
359
359
|
return (o, v) => {
|
|
360
|
-
const l =
|
|
361
|
-
return o.locked ? (f(), E("div",
|
|
362
|
-
|
|
360
|
+
const l = S("FmLabel"), c = S("FmIcon"), g = S("FmTooltip"), h = S("FmField");
|
|
361
|
+
return o.locked ? (f(), E("div", Fn, [
|
|
362
|
+
Ve(o.$slots, "label", {}, () => [
|
|
363
363
|
p(l, {
|
|
364
364
|
label: o.label,
|
|
365
365
|
disabled: o.disabled
|
|
366
366
|
}, null, 8, ["label", "disabled"])
|
|
367
367
|
]),
|
|
368
|
-
|
|
368
|
+
Ve(o.$slots, "field", {}, () => [
|
|
369
369
|
p(h, { disabled: o.disabled }, {
|
|
370
370
|
prepend: w(() => [
|
|
371
371
|
o.tooltipMessage ? (f(), D(g, {
|
|
@@ -374,7 +374,7 @@ const Mn = {
|
|
|
374
374
|
"z-index": o.tooltipZIndex
|
|
375
375
|
}, {
|
|
376
376
|
content: w(() => [
|
|
377
|
-
|
|
377
|
+
qe($(o.tooltipMessage), 1)
|
|
378
378
|
]),
|
|
379
379
|
default: w(() => [
|
|
380
380
|
p(c, {
|
|
@@ -390,54 +390,54 @@ const Mn = {
|
|
|
390
390
|
}))
|
|
391
391
|
]),
|
|
392
392
|
default: w(() => [
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
Ve(o.$slots, "modelValue", {}, () => [
|
|
394
|
+
d("div", {
|
|
395
395
|
class: ae([
|
|
396
396
|
o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary",
|
|
397
397
|
"line-clamp-1 text-ellipsis break-all"
|
|
398
398
|
])
|
|
399
|
-
},
|
|
399
|
+
}, $(o.modelValue), 3)
|
|
400
400
|
])
|
|
401
401
|
]),
|
|
402
402
|
_: 3
|
|
403
403
|
}, 8, ["disabled"])
|
|
404
404
|
]),
|
|
405
|
-
|
|
406
|
-
|
|
405
|
+
Ve(o.$slots, "helper-text", {}, () => [
|
|
406
|
+
d("div", {
|
|
407
407
|
class: ae([
|
|
408
408
|
"fm-typo-en-body-sm-400 line-clamp-1",
|
|
409
409
|
o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
|
|
410
410
|
])
|
|
411
|
-
},
|
|
411
|
+
}, $(o.helperText), 3)
|
|
412
412
|
])
|
|
413
|
-
])) :
|
|
413
|
+
])) : Ve(o.$slots, "default", { key: 1 });
|
|
414
414
|
};
|
|
415
415
|
}
|
|
416
|
-
}),
|
|
416
|
+
}), Mn = { class: "flex gap-8" }, En = { class: "flex-1" }, An = { class: "flex-1" }, Un = { class: "flex flex-col gap-5" }, $n = { class: "text-fm-color-typo-secondary" }, Rn = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Pn = {
|
|
417
417
|
key: 3,
|
|
418
418
|
class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
|
|
419
|
-
},
|
|
419
|
+
}, On = { class: "flex flex-col" }, Bn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Dn = {
|
|
420
420
|
key: 4,
|
|
421
421
|
class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
|
|
422
|
-
},
|
|
422
|
+
}, Nn = { class: "flex flex-col gap-12" }, zn = { class: "flex flex-col gap-4" }, Ln = { class: "fm-typo-en-title-sm-600" }, jn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Hn = { class: "flex flex-col gap-4" }, Wn = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, Yn = { class: "flex-1 p-12 flex flex-col gap-8" }, qn = { class: "mx-auto" }, Gn = { class: "flex flex-col" }, Kn = { class: "fm-typo-en-body-sm-600 translate-y-4" }, Jn = { class: "flex-1 p-12 flex flex-col gap-8" }, Qn = { class: "mx-auto" }, Zn = { class: "flex flex-col" }, Xn = { class: "fm-typo-en-body-sm-600 translate-y-4" }, eo = { class: "flex-1 p-12 flex flex-col gap-8" }, to = { class: "mx-auto" }, no = { class: "flex flex-col" }, oo = { class: "fm-typo-en-body-sm-600 translate-y-4" }, lo = {
|
|
423
423
|
key: 5,
|
|
424
424
|
class: "flex flex-col gap-12"
|
|
425
|
-
},
|
|
425
|
+
}, ao = { class: "flex flex-col" }, so = { class: "flex items-center justify-between" }, ro = { class: "fm-typo-en-title-sm-600" }, io = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, uo = {
|
|
426
426
|
key: 0,
|
|
427
427
|
class: "flex flex-col gap-8"
|
|
428
|
-
},
|
|
428
|
+
}, co = { class: "flex flex-wrap gap-8" }, mo = {
|
|
429
429
|
key: 6,
|
|
430
430
|
class: "flex flex-col gap-12"
|
|
431
|
-
},
|
|
431
|
+
}, po = { class: "flex flex-col" }, vo = { class: "flex items-center justify-between" }, fo = { class: "fm-typo-en-title-sm-600" }, yo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, go = {
|
|
432
432
|
key: 0,
|
|
433
433
|
class: "flex flex-col gap-8"
|
|
434
|
-
},
|
|
434
|
+
}, bo = { class: "flex flex-wrap gap-8" }, ho = {
|
|
435
435
|
key: 7,
|
|
436
436
|
class: "flex flex-col gap-12"
|
|
437
|
-
},
|
|
437
|
+
}, _o = { class: "flex flex-col" }, xo = { class: "flex items-center justify-between" }, ko = { class: "fm-typo-en-title-sm-600" }, wo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, To = {
|
|
438
438
|
key: 0,
|
|
439
439
|
class: "flex flex-col gap-8"
|
|
440
|
-
},
|
|
440
|
+
}, Vo = { class: "flex flex-wrap gap-8" }, Io = /* @__PURE__ */ ye({
|
|
441
441
|
__name: "IngredientForm",
|
|
442
442
|
props: /* @__PURE__ */ dt({
|
|
443
443
|
mode: {},
|
|
@@ -451,35 +451,35 @@ const Mn = {
|
|
|
451
451
|
searchModifiers: {}
|
|
452
452
|
}),
|
|
453
453
|
emits: /* @__PURE__ */ dt(["update:modelValue", "click:submit", "update:purchaseOrderTemplateIds", "update:wastageTemplateIds", "update:closingTemplateIds"], ["update:search"]),
|
|
454
|
-
setup(
|
|
454
|
+
setup(u, { expose: o, emit: v }) {
|
|
455
455
|
var nt;
|
|
456
|
-
const { t: l } = ge(), c =
|
|
457
|
-
|
|
458
|
-
const g = Et(), h = It(), y = At(), n =
|
|
456
|
+
const { t: l } = ge(), c = Ke();
|
|
457
|
+
Se();
|
|
458
|
+
const g = Et(), h = It(), y = At(), n = u, s = v, m = de(), i = Fe(), r = Ge(), T = Be(), A = k(() => T.isEnabled);
|
|
459
459
|
B(void 0);
|
|
460
|
-
const
|
|
460
|
+
const R = B([]), G = B([]), U = B([]), j = B(!1);
|
|
461
461
|
function V(e) {
|
|
462
462
|
if (e.length === 0) return;
|
|
463
463
|
const t = e[0], x = n.modelValue ?? {
|
|
464
|
-
unit: m.units.find((
|
|
464
|
+
unit: m.units.find((C) => C)
|
|
465
465
|
};
|
|
466
466
|
x.unit || (x.unit = t, s("update:modelValue", x));
|
|
467
467
|
}
|
|
468
468
|
jt(() => {
|
|
469
|
-
V(m.units), n.mode ===
|
|
469
|
+
V(m.units), n.mode === W.CREATE && (r.mustUsePoTemplate && ke(), r.enableWastageTemplate && be(), r.enableClosingTemplate && ce());
|
|
470
470
|
}), wt([() => m.units], ([e]) => {
|
|
471
471
|
V(e);
|
|
472
472
|
});
|
|
473
|
-
function
|
|
473
|
+
function xe() {
|
|
474
474
|
s("click:submit");
|
|
475
475
|
}
|
|
476
|
-
async function
|
|
477
|
-
|
|
476
|
+
async function ke() {
|
|
477
|
+
R.value = [], j.value = !0;
|
|
478
478
|
try {
|
|
479
479
|
const [e] = await Promise.all([g.readTemplates()]).delayed(
|
|
480
480
|
1e3
|
|
481
481
|
);
|
|
482
|
-
|
|
482
|
+
R.value = e;
|
|
483
483
|
} catch (e) {
|
|
484
484
|
console.log("Something went wrong when fetching templates:", e);
|
|
485
485
|
} finally {
|
|
@@ -487,12 +487,12 @@ const Mn = {
|
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
async function be() {
|
|
490
|
-
|
|
490
|
+
G.value = [], j.value = !0;
|
|
491
491
|
try {
|
|
492
492
|
const [e] = await Promise.all([h.readTemplates()]).delayed(
|
|
493
493
|
1e3
|
|
494
494
|
);
|
|
495
|
-
|
|
495
|
+
G.value = e;
|
|
496
496
|
} catch (e) {
|
|
497
497
|
console.log("Something went wrong when fetching wastage templates:", e);
|
|
498
498
|
} finally {
|
|
@@ -500,12 +500,12 @@ const Mn = {
|
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
async function ce() {
|
|
503
|
-
|
|
503
|
+
U.value = [], j.value = !0;
|
|
504
504
|
try {
|
|
505
505
|
const [e] = await Promise.all([y.readTemplates()]).delayed(
|
|
506
506
|
1e3
|
|
507
507
|
);
|
|
508
|
-
|
|
508
|
+
U.value = e;
|
|
509
509
|
} catch (e) {
|
|
510
510
|
console.log("Something went wrong when fetching closing templates:", e);
|
|
511
511
|
} finally {
|
|
@@ -549,10 +549,10 @@ const Mn = {
|
|
|
549
549
|
get() {
|
|
550
550
|
var t, x;
|
|
551
551
|
const e = (x = (t = n.modelValue) == null ? void 0 : t.defaultCost) == null ? void 0 : x.costPerUnit;
|
|
552
|
-
return e ? +
|
|
552
|
+
return e ? +Ct(e) : 0;
|
|
553
553
|
},
|
|
554
554
|
set(e) {
|
|
555
|
-
var x,
|
|
555
|
+
var x, C, q, z;
|
|
556
556
|
const t = n.modelValue ? {
|
|
557
557
|
...n.modelValue
|
|
558
558
|
} : {};
|
|
@@ -560,32 +560,32 @@ const Mn = {
|
|
|
560
560
|
costPerUnit: {
|
|
561
561
|
amount: 0,
|
|
562
562
|
precision: 2,
|
|
563
|
-
currency: ((x =
|
|
563
|
+
currency: ((x = Oe(i.currentCountry.value)) == null ? void 0 : x.currency) ?? "MYR"
|
|
564
564
|
},
|
|
565
|
-
measurement: (
|
|
566
|
-
(
|
|
567
|
-
var
|
|
568
|
-
return
|
|
565
|
+
measurement: (z = (q = (C = n.modelValue) == null ? void 0 : C.unit) == null ? void 0 : q.measurements) == null ? void 0 : z.find(
|
|
566
|
+
(te) => {
|
|
567
|
+
var ne;
|
|
568
|
+
return te.id === ((ne = n.modelValue) == null ? void 0 : ne.trackingMeasurement);
|
|
569
569
|
}
|
|
570
570
|
)
|
|
571
571
|
}), t.defaultCost.costPerUnit = {
|
|
572
572
|
...t.defaultCost.costPerUnit,
|
|
573
|
-
...
|
|
573
|
+
...St(+e, 4)
|
|
574
574
|
}, s("update:modelValue", t);
|
|
575
575
|
}
|
|
576
576
|
}), pe = k(() => {
|
|
577
|
-
var t, x,
|
|
578
|
-
const e = ((t = n.modelValue) == null ? void 0 : t.unit) ?? m.units.find((
|
|
577
|
+
var t, x, C;
|
|
578
|
+
const e = ((t = n.modelValue) == null ? void 0 : t.unit) ?? m.units.find((q) => q);
|
|
579
579
|
return e ? {
|
|
580
580
|
_id: e._id,
|
|
581
581
|
measurement: (x = n.modelValue) == null ? void 0 : x.trackingMeasurement,
|
|
582
|
-
name: ((
|
|
583
|
-
var
|
|
584
|
-
return
|
|
585
|
-
})) == null ? void 0 :
|
|
582
|
+
name: ((C = e.measurements.find((q) => {
|
|
583
|
+
var z;
|
|
584
|
+
return q.id === ((z = n.modelValue) == null ? void 0 : z.trackingMeasurement);
|
|
585
|
+
})) == null ? void 0 : C.name) ?? e.name
|
|
586
586
|
} : null;
|
|
587
587
|
}), we = k(
|
|
588
|
-
() => m.units.flatMap(({ name: e, _id: t, abbrev: x, measurements:
|
|
588
|
+
() => m.units.flatMap(({ name: e, _id: t, abbrev: x, measurements: C }) => [
|
|
589
589
|
{
|
|
590
590
|
label: `${e}`,
|
|
591
591
|
value: null,
|
|
@@ -596,41 +596,41 @@ const Mn = {
|
|
|
596
596
|
value: { _id: t },
|
|
597
597
|
displayAsSection: !1
|
|
598
598
|
},
|
|
599
|
-
...
|
|
600
|
-
label: `${
|
|
601
|
-
value: { _id: t, measurement:
|
|
599
|
+
...C.map(({ id: q, name: z, abbrev: te }) => ({
|
|
600
|
+
label: `${z} (${te})`,
|
|
601
|
+
value: { _id: t, measurement: q },
|
|
602
602
|
displayAsSection: !1
|
|
603
603
|
}))
|
|
604
604
|
])
|
|
605
|
-
), _ = Ht(
|
|
605
|
+
), _ = Ht(u, "search"), M = k(
|
|
606
606
|
() => new Jt(we.value, ["label", "value"], {
|
|
607
607
|
caseSensitive: !1,
|
|
608
608
|
sort: !0
|
|
609
609
|
})
|
|
610
|
-
),
|
|
610
|
+
), K = k(() => M.value.search(_.value));
|
|
611
611
|
function F(e) {
|
|
612
|
-
var t, x,
|
|
613
|
-
return ((x = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : x._id) === ((
|
|
612
|
+
var t, x, C, q, z;
|
|
613
|
+
return ((x = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : x._id) === ((C = e.value) == null ? void 0 : C._id) && ((q = n.modelValue) == null ? void 0 : q.trackingMeasurement) === ((z = e.value) == null ? void 0 : z.measurement);
|
|
614
614
|
}
|
|
615
615
|
function b(e) {
|
|
616
|
-
var
|
|
616
|
+
var te, ne;
|
|
617
617
|
if (!e) return;
|
|
618
|
-
const { _id: t, measurement: x } = e,
|
|
619
|
-
if (!
|
|
618
|
+
const { _id: t, measurement: x } = e, C = x || void 0, q = m.units.find((Te) => Te._id === t);
|
|
619
|
+
if (!q)
|
|
620
620
|
return;
|
|
621
|
-
const
|
|
622
|
-
|
|
623
|
-
measurement:
|
|
621
|
+
const z = n.modelValue ?? {};
|
|
622
|
+
z.unit = q, z.trackingMeasurement = C, z.convert && (z.convert.measurement = C || null), r.enableTotalCost && (z.defaultCost = {
|
|
623
|
+
measurement: q.measurements.find((Te) => Te.id === C),
|
|
624
624
|
costPerUnit: {
|
|
625
|
-
...((
|
|
625
|
+
...((te = z.defaultCost) == null ? void 0 : te.costPerUnit) ?? {
|
|
626
626
|
amount: 0,
|
|
627
627
|
precision: 2,
|
|
628
|
-
currency: ((
|
|
628
|
+
currency: ((ne = Oe(i.currentCountry.value)) == null ? void 0 : ne.currency) ?? "MYR"
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
|
-
}), s("update:modelValue",
|
|
631
|
+
}), s("update:modelValue", z);
|
|
632
632
|
}
|
|
633
|
-
const
|
|
633
|
+
const L = k({
|
|
634
634
|
get() {
|
|
635
635
|
var e;
|
|
636
636
|
return ((e = n.modelValue) == null ? void 0 : e.convert) ?? null;
|
|
@@ -641,8 +641,8 @@ const Mn = {
|
|
|
641
641
|
} : {};
|
|
642
642
|
e ? t.convert = e : t.convert = null, s("update:modelValue", t);
|
|
643
643
|
}
|
|
644
|
-
}),
|
|
645
|
-
(e) => e ===
|
|
644
|
+
}), Q = k(() => Ce.options.filter(
|
|
645
|
+
(e) => e === Ce.enum.FIFO || e === Ce.enum.WAVG
|
|
646
646
|
).map((e) => ({
|
|
647
647
|
label: l(`inventory.ingredient.valuationMethod.${e}`),
|
|
648
648
|
value: e
|
|
@@ -657,7 +657,7 @@ const Mn = {
|
|
|
657
657
|
} : {};
|
|
658
658
|
t.valuation = e, s("update:modelValue", t);
|
|
659
659
|
}
|
|
660
|
-
}),
|
|
660
|
+
}), P = k({
|
|
661
661
|
get() {
|
|
662
662
|
var e;
|
|
663
663
|
return ((e = n.modelValue) == null ? void 0 : e.customAttributes) ?? {};
|
|
@@ -668,97 +668,97 @@ const Mn = {
|
|
|
668
668
|
} : {};
|
|
669
669
|
t.customAttributes = e, s("update:modelValue", t);
|
|
670
670
|
}
|
|
671
|
-
}),
|
|
671
|
+
}), N = B();
|
|
672
672
|
o({
|
|
673
673
|
validateInputs: () => {
|
|
674
674
|
var e, t;
|
|
675
|
-
(t = (e =
|
|
675
|
+
(t = (e = N.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
|
|
676
676
|
},
|
|
677
677
|
resetInputsValidation: () => {
|
|
678
678
|
var e, t;
|
|
679
|
-
(t = (e =
|
|
679
|
+
(t = (e = N.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
|
|
680
680
|
},
|
|
681
681
|
resetInputs: () => {
|
|
682
682
|
var e, t;
|
|
683
|
-
(t = (e =
|
|
683
|
+
(t = (e = N.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
|
|
684
684
|
}
|
|
685
685
|
});
|
|
686
|
-
const
|
|
686
|
+
const O = B(!1), Y = k(
|
|
687
687
|
() => {
|
|
688
688
|
var e, t, x;
|
|
689
689
|
return (e = n.modelValue) != null && e._id ? ((x = m.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : x.filter(
|
|
690
|
-
(
|
|
690
|
+
(C) => C.from === "INGREDIENT"
|
|
691
691
|
)) ?? [] : [];
|
|
692
692
|
}
|
|
693
|
-
),
|
|
693
|
+
), oe = k(
|
|
694
694
|
() => {
|
|
695
695
|
var e, t, x;
|
|
696
696
|
return (e = n.modelValue) != null && e._id ? ((x = m.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : x.filter(
|
|
697
|
-
(
|
|
697
|
+
(C) => C.from === "RECIPE"
|
|
698
698
|
)) ?? [] : [];
|
|
699
699
|
}
|
|
700
|
-
),
|
|
700
|
+
), ve = k(
|
|
701
701
|
() => {
|
|
702
702
|
var e, t, x;
|
|
703
|
-
return (e = n.modelValue) != null && e._id ? ((x = m.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : x.filter((
|
|
703
|
+
return (e = n.modelValue) != null && e._id ? ((x = m.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : x.filter((C) => C.from === "MENU")) ?? [] : [];
|
|
704
704
|
}
|
|
705
|
-
),
|
|
705
|
+
), Me = k(
|
|
706
706
|
() => m.skus.map((e) => ({ label: e.name, value: e.code }))
|
|
707
|
-
),
|
|
708
|
-
function
|
|
707
|
+
), Ee = B((nt = n.modelValue) == null ? void 0 : nt.code);
|
|
708
|
+
function Ae(e) {
|
|
709
709
|
var x;
|
|
710
710
|
const t = e.el;
|
|
711
711
|
t && ((x = t.querySelector("[x-should-scroll-into=true]")) == null || x.scrollIntoView());
|
|
712
712
|
}
|
|
713
|
-
const
|
|
713
|
+
const Ue = k(
|
|
714
714
|
() => {
|
|
715
|
-
var e, t, x,
|
|
716
|
-
return ((
|
|
717
|
-
(
|
|
718
|
-
var
|
|
719
|
-
return
|
|
715
|
+
var e, t, x, C, q, z;
|
|
716
|
+
return ((C = (x = (t = (e = n.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : x.find(
|
|
717
|
+
(te) => {
|
|
718
|
+
var ne;
|
|
719
|
+
return te.id === ((ne = n.modelValue) == null ? void 0 : ne.trackingMeasurement);
|
|
720
720
|
}
|
|
721
|
-
)) == null ? void 0 :
|
|
721
|
+
)) == null ? void 0 : C.abbrev) ?? ((z = (q = n.modelValue) == null ? void 0 : q.unit) == null ? void 0 : z.abbrev);
|
|
722
722
|
}
|
|
723
|
-
),
|
|
723
|
+
), le = k({
|
|
724
724
|
get() {
|
|
725
725
|
var e, t;
|
|
726
|
-
return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.low) ??
|
|
726
|
+
return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.low) ?? _e().low;
|
|
727
727
|
},
|
|
728
728
|
set(e) {
|
|
729
|
-
var
|
|
730
|
-
const t = ((
|
|
729
|
+
var C;
|
|
730
|
+
const t = ((C = n.modelValue) == null ? void 0 : C.thresholds) ?? _e();
|
|
731
731
|
t.low = e;
|
|
732
732
|
const x = n.modelValue ? {
|
|
733
733
|
...n.modelValue
|
|
734
734
|
} : {};
|
|
735
735
|
x.thresholds = t, s("update:modelValue", x);
|
|
736
736
|
}
|
|
737
|
-
}),
|
|
737
|
+
}), ie = k({
|
|
738
738
|
get() {
|
|
739
739
|
var e, t;
|
|
740
|
-
return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.mid) ??
|
|
740
|
+
return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.mid) ?? _e().mid;
|
|
741
741
|
},
|
|
742
742
|
set(e) {
|
|
743
|
-
var
|
|
744
|
-
const t = ((
|
|
743
|
+
var C;
|
|
744
|
+
const t = ((C = n.modelValue) == null ? void 0 : C.thresholds) ?? _e();
|
|
745
745
|
t.mid = e;
|
|
746
746
|
const x = n.modelValue ? {
|
|
747
747
|
...n.modelValue
|
|
748
748
|
} : {};
|
|
749
749
|
x.thresholds = t, s("update:modelValue", x);
|
|
750
750
|
}
|
|
751
|
-
}),
|
|
751
|
+
}), Je = k(() => r.mustUsePoTemplate && n.mode === W.CREATE && R.value.length > 0 ? R.value.map((e) => ({
|
|
752
752
|
label: e.name || "Template",
|
|
753
753
|
value: e._id || "template_" + e.name
|
|
754
|
-
})) : []), Qe = k(() =>
|
|
754
|
+
})) : []), Qe = k(() => Je.value.filter(
|
|
755
755
|
(e) => (n.purchaseOrderTemplateIds ?? []).includes(e.value)
|
|
756
|
-
)), Ze = k(() =>
|
|
756
|
+
)), Ze = k(() => r.enableWastageTemplate && n.mode === W.CREATE && G.value.length > 0 ? G.value.map((e) => ({
|
|
757
757
|
label: e.name || "Template",
|
|
758
758
|
value: e._id || "template_" + e.name
|
|
759
759
|
})) : []), Xe = k(() => Ze.value.filter(
|
|
760
760
|
(e) => (n.wastageTemplateIds ?? []).includes(e.value)
|
|
761
|
-
)), et = k(() =>
|
|
761
|
+
)), et = k(() => r.enableClosingTemplate && n.mode === W.CREATE && U.value.length > 0 ? U.value.map((e) => ({
|
|
762
762
|
label: e.name || "Template",
|
|
763
763
|
value: e._id || "template_" + e.name
|
|
764
764
|
})) : []), tt = k(() => et.value.filter(
|
|
@@ -768,10 +768,10 @@ const Mn = {
|
|
|
768
768
|
c.open({
|
|
769
769
|
title: l("inventory.ingredient.purchaseOrderTemplates.selectTitle"),
|
|
770
770
|
closeButton: !0,
|
|
771
|
-
contentComponent:
|
|
771
|
+
contentComponent: Le,
|
|
772
772
|
contentComponentProps: {
|
|
773
773
|
modelValue: n.purchaseOrderTemplateIds ?? [],
|
|
774
|
-
items:
|
|
774
|
+
items: Je.value
|
|
775
775
|
},
|
|
776
776
|
primaryActions: {
|
|
777
777
|
text: l("common.confirm"),
|
|
@@ -790,7 +790,7 @@ const Mn = {
|
|
|
790
790
|
c.open({
|
|
791
791
|
title: l("inventory.ingredient.wastageTemplates.selectTitle"),
|
|
792
792
|
closeButton: !0,
|
|
793
|
-
contentComponent:
|
|
793
|
+
contentComponent: Le,
|
|
794
794
|
contentComponentProps: {
|
|
795
795
|
modelValue: n.wastageTemplateIds ?? [],
|
|
796
796
|
items: Ze.value
|
|
@@ -812,7 +812,7 @@ const Mn = {
|
|
|
812
812
|
c.open({
|
|
813
813
|
title: l("inventory.ingredient.closingTemplates.selectTitle"),
|
|
814
814
|
closeButton: !0,
|
|
815
|
-
contentComponent:
|
|
815
|
+
contentComponent: Le,
|
|
816
816
|
contentComponentProps: {
|
|
817
817
|
modelValue: n.closingTemplateIds ?? [],
|
|
818
818
|
items: et.value
|
|
@@ -836,26 +836,26 @@ const Mn = {
|
|
|
836
836
|
};
|
|
837
837
|
}
|
|
838
838
|
return (e, t) => {
|
|
839
|
-
const x =
|
|
839
|
+
const x = S("FmTextField"), C = S("FmLabel"), q = S("FmField"), z = S("FmIcon"), te = S("FmMenuHeader"), ne = S("FmMenuDivider"), Te = S("FmMenuItem"), Dt = S("FmMenu"), ot = S("FmFormGroup"), Nt = S("FmSelect"), lt = S("FmSwitch"), at = S("FmStepperField"), De = S("FmButton"), Ne = S("FmChip"), zt = S("FmForm");
|
|
840
840
|
return f(), D(zt, {
|
|
841
841
|
disabled: e.disabled,
|
|
842
842
|
ref_key: "formRef",
|
|
843
|
-
ref:
|
|
843
|
+
ref: N,
|
|
844
844
|
class: "flex flex-col gap-32",
|
|
845
|
-
onValidationSuccess:
|
|
845
|
+
onValidationSuccess: xe
|
|
846
846
|
}, {
|
|
847
847
|
default: w(() => {
|
|
848
848
|
var st, rt, it, ut;
|
|
849
849
|
return [
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
p(
|
|
850
|
+
d("div", Mn, [
|
|
851
|
+
d("div", En, [
|
|
852
|
+
p(Ie, {
|
|
853
853
|
"tooltip-message": "This field is managed by NetSuite",
|
|
854
854
|
"tooltip-z-index": 50,
|
|
855
855
|
label: a(l)("inventory.ingredient.code"),
|
|
856
856
|
"model-value": se.value,
|
|
857
857
|
"onUpdate:modelValue": t[1] || (t[1] = (I) => se.value = I),
|
|
858
|
-
locked:
|
|
858
|
+
locked: A.value,
|
|
859
859
|
disabled: e.disabled
|
|
860
860
|
}, {
|
|
861
861
|
default: w(() => [
|
|
@@ -863,21 +863,21 @@ const Mn = {
|
|
|
863
863
|
label: a(l)("inventory.ingredient.code"),
|
|
864
864
|
"model-value": se.value,
|
|
865
865
|
"onUpdate:modelValue": t[0] || (t[0] = (I) => se.value = I),
|
|
866
|
-
rules: [a(
|
|
866
|
+
rules: [a(ze)(), a(Qt)(Me.value, Ee.value)],
|
|
867
867
|
"label-mark": "required"
|
|
868
868
|
}, null, 8, ["label", "model-value", "rules"])
|
|
869
869
|
]),
|
|
870
870
|
_: 1
|
|
871
871
|
}, 8, ["label", "model-value", "locked", "disabled"])
|
|
872
872
|
]),
|
|
873
|
-
|
|
874
|
-
p(
|
|
873
|
+
d("div", An, [
|
|
874
|
+
p(Ie, {
|
|
875
875
|
"tooltip-message": "This field is managed by NetSuite",
|
|
876
876
|
"tooltip-z-index": 50,
|
|
877
877
|
label: a(l)("inventory.ingredient.name"),
|
|
878
878
|
"model-value": ee.value,
|
|
879
879
|
"onUpdate:modelValue": t[3] || (t[3] = (I) => ee.value = I),
|
|
880
|
-
locked:
|
|
880
|
+
locked: A.value,
|
|
881
881
|
disabled: e.disabled
|
|
882
882
|
}, {
|
|
883
883
|
default: w(() => [
|
|
@@ -885,7 +885,7 @@ const Mn = {
|
|
|
885
885
|
label: a(l)("inventory.ingredient.name"),
|
|
886
886
|
"model-value": ee.value,
|
|
887
887
|
"onUpdate:modelValue": t[2] || (t[2] = (I) => ee.value = I),
|
|
888
|
-
rules: [a(
|
|
888
|
+
rules: [a(ze)()],
|
|
889
889
|
"label-mark": "required"
|
|
890
890
|
}, null, 8, ["label", "model-value", "rules"])
|
|
891
891
|
]),
|
|
@@ -893,30 +893,30 @@ const Mn = {
|
|
|
893
893
|
}, 8, ["label", "model-value", "locked", "disabled"])
|
|
894
894
|
])
|
|
895
895
|
]),
|
|
896
|
-
p(
|
|
896
|
+
p(Ie, {
|
|
897
897
|
"tooltip-message": "This field is managed by NetSuite",
|
|
898
898
|
"tooltip-z-index": 50,
|
|
899
899
|
label: a(l)("inventory.ingredient.unit"),
|
|
900
900
|
"helper-text": (st = e.modelValue) != null && st.trackingMeasurement ? `Base unit: ${(it = (rt = e.modelValue) == null ? void 0 : rt.unit) == null ? void 0 : it.name}` : void 0,
|
|
901
901
|
"model-value": (ut = pe.value) == null ? void 0 : ut.name,
|
|
902
|
-
locked:
|
|
902
|
+
locked: A.value,
|
|
903
903
|
disabled: e.disabled
|
|
904
904
|
}, {
|
|
905
905
|
default: w(() => [
|
|
906
906
|
p(ot, {
|
|
907
907
|
"model-value": pe.value,
|
|
908
|
-
rules: [a(
|
|
908
|
+
rules: [a(ze)()],
|
|
909
909
|
"label-mark": "required"
|
|
910
910
|
}, {
|
|
911
911
|
label: w(() => [
|
|
912
|
-
p(
|
|
912
|
+
p(C, {
|
|
913
913
|
label: a(l)("inventory.ingredient.unit")
|
|
914
914
|
}, null, 8, ["label"])
|
|
915
915
|
]),
|
|
916
916
|
default: w(({ invalid: I }) => [
|
|
917
917
|
p(Dt, null, {
|
|
918
918
|
"menu-button": w(() => [
|
|
919
|
-
p(
|
|
919
|
+
p(q, {
|
|
920
920
|
class: ae([
|
|
921
921
|
"fm-typo-en-body-lg-400",
|
|
922
922
|
{
|
|
@@ -930,39 +930,39 @@ const Mn = {
|
|
|
930
930
|
default: w(() => {
|
|
931
931
|
var Z;
|
|
932
932
|
return [
|
|
933
|
-
|
|
933
|
+
qe($((Z = pe.value) == null ? void 0 : Z.name), 1)
|
|
934
934
|
];
|
|
935
935
|
}),
|
|
936
936
|
_: 2
|
|
937
937
|
}, 1032, ["class", "invalid"])
|
|
938
938
|
]),
|
|
939
939
|
default: w(() => [
|
|
940
|
-
|
|
940
|
+
d("div", Un, [
|
|
941
941
|
p(x, {
|
|
942
942
|
modelValue: _.value,
|
|
943
943
|
"onUpdate:modelValue": t[4] || (t[4] = (Z) => _.value = Z),
|
|
944
944
|
placeholder: "Filter options"
|
|
945
945
|
}, {
|
|
946
946
|
prepend: w(() => [
|
|
947
|
-
p(
|
|
947
|
+
p(z, { name: "search" })
|
|
948
948
|
]),
|
|
949
949
|
_: 1
|
|
950
950
|
}, 8, ["modelValue"]),
|
|
951
|
-
|
|
951
|
+
d("div", {
|
|
952
952
|
class: "overflow-x-hidden overflow-y-auto max-h-[300px]",
|
|
953
|
-
onVnodeMounted:
|
|
953
|
+
onVnodeMounted: Ae
|
|
954
954
|
}, [
|
|
955
|
-
(f(!0), E(X, null,
|
|
955
|
+
(f(!0), E(X, null, ue(K.value, (Z, Lt) => (f(), E(X, { key: Lt }, [
|
|
956
956
|
Z.displayAsSection ? (f(), E(X, { key: 0 }, [
|
|
957
|
-
p(
|
|
957
|
+
p(te, {
|
|
958
958
|
label: Z.label
|
|
959
959
|
}, null, 8, ["label"]),
|
|
960
|
-
p(
|
|
961
|
-
], 64)) : (f(), D(
|
|
960
|
+
p(ne)
|
|
961
|
+
], 64)) : (f(), D(Te, {
|
|
962
962
|
key: 1,
|
|
963
963
|
label: Z.label,
|
|
964
964
|
"model-value": F(Z),
|
|
965
|
-
onClick: (
|
|
965
|
+
onClick: (nl) => b(Z.value),
|
|
966
966
|
"x-should-scroll-into": `${F(Z)}`
|
|
967
967
|
}, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
|
|
968
968
|
], 64))), 128))
|
|
@@ -977,19 +977,19 @@ const Mn = {
|
|
|
977
977
|
]),
|
|
978
978
|
_: 1
|
|
979
979
|
}, 8, ["label", "helper-text", "model-value", "locked", "disabled"]),
|
|
980
|
-
a(
|
|
980
|
+
a(r).enableTotalCost ? (f(), D(Ie, {
|
|
981
981
|
key: 0,
|
|
982
982
|
"tooltip-message": "This field is managed by NetSuite",
|
|
983
983
|
"tooltip-z-index": 50,
|
|
984
984
|
label: a(l)("inventory.ingredient.valuationMethod.title"),
|
|
985
985
|
"model-value": a(l)("inventory.ingredient.valuationMethod." + re.value),
|
|
986
|
-
locked:
|
|
986
|
+
locked: A.value,
|
|
987
987
|
disabled: e.disabled
|
|
988
988
|
}, {
|
|
989
989
|
label: w(() => [
|
|
990
990
|
p(fe, { "z-index": 50 }, {
|
|
991
991
|
default: w(() => [
|
|
992
|
-
p(
|
|
992
|
+
p(C, {
|
|
993
993
|
label: a(l)("inventory.ingredient.valuationMethod.title")
|
|
994
994
|
}, null, 8, ["label"])
|
|
995
995
|
]),
|
|
@@ -1002,23 +1002,23 @@ const Mn = {
|
|
|
1002
1002
|
label: a(l)("inventory.ingredient.valuationMethod.title"),
|
|
1003
1003
|
"model-value": re.value,
|
|
1004
1004
|
"onUpdate:modelValue": t[5] || (t[5] = (I) => re.value = I),
|
|
1005
|
-
items:
|
|
1005
|
+
items: Q.value
|
|
1006
1006
|
}, null, 8, ["label", "model-value", "items"])
|
|
1007
1007
|
]),
|
|
1008
1008
|
_: 1
|
|
1009
|
-
}, 8, ["label", "model-value", "locked", "disabled"])) :
|
|
1010
|
-
a(
|
|
1009
|
+
}, 8, ["label", "model-value", "locked", "disabled"])) : H("", !0),
|
|
1010
|
+
a(r).enableTotalCost ? (f(), D(Ie, {
|
|
1011
1011
|
key: 1,
|
|
1012
1012
|
"tooltip-message": "This field is managed by NetSuite",
|
|
1013
1013
|
"tooltip-z-index": 50,
|
|
1014
1014
|
"model-value": `${a(Zt)()} ${me.value}`,
|
|
1015
|
-
locked:
|
|
1015
|
+
locked: A.value,
|
|
1016
1016
|
disabled: e.disabled
|
|
1017
1017
|
}, {
|
|
1018
1018
|
label: w(() => [
|
|
1019
1019
|
p(fe, { "z-index": 50 }, {
|
|
1020
1020
|
default: w(() => [
|
|
1021
|
-
p(
|
|
1021
|
+
p(C, {
|
|
1022
1022
|
label: a(l)("inventory.ingredient.pricePerUnit")
|
|
1023
1023
|
}, null, 8, ["label"])
|
|
1024
1024
|
]),
|
|
@@ -1029,12 +1029,12 @@ const Mn = {
|
|
|
1029
1029
|
p(x, {
|
|
1030
1030
|
"model-value": me.value,
|
|
1031
1031
|
"onUpdate:modelValue": t[6] || (t[6] = (I) => me.value = I),
|
|
1032
|
-
rules: [a(
|
|
1032
|
+
rules: [a(Pe)(0), a(Xt)(4)]
|
|
1033
1033
|
}, {
|
|
1034
1034
|
label: w(() => [
|
|
1035
1035
|
p(fe, { "z-index": 50 }, {
|
|
1036
1036
|
default: w(() => [
|
|
1037
|
-
p(
|
|
1037
|
+
p(C, {
|
|
1038
1038
|
label: a(l)("inventory.ingredient.pricePerUnit")
|
|
1039
1039
|
}, null, 8, ["label"])
|
|
1040
1040
|
]),
|
|
@@ -1044,93 +1044,93 @@ const Mn = {
|
|
|
1044
1044
|
prepend: w(() => {
|
|
1045
1045
|
var I, Z;
|
|
1046
1046
|
return [
|
|
1047
|
-
|
|
1047
|
+
d("div", $n, $(a(vt)(((I = a(i).currentCountry) == null ? void 0 : I.value) ?? a(ft)) === "MYR" ? "RM" : a(vt)(((Z = a(i).currentCountry) == null ? void 0 : Z.value) ?? a(ft))), 1)
|
|
1048
1048
|
];
|
|
1049
1049
|
}),
|
|
1050
1050
|
append: w(() => [
|
|
1051
|
-
|
|
1051
|
+
d("div", Rn, " / " + $(Ue.value), 1)
|
|
1052
1052
|
]),
|
|
1053
1053
|
_: 1
|
|
1054
1054
|
}, 8, ["model-value", "rules"])
|
|
1055
1055
|
]),
|
|
1056
1056
|
_: 1
|
|
1057
|
-
}, 8, ["model-value", "locked", "disabled"])) :
|
|
1058
|
-
!
|
|
1057
|
+
}, 8, ["model-value", "locked", "disabled"])) : H("", !0),
|
|
1058
|
+
!A.value || L.value ? (f(), D(Sn, {
|
|
1059
1059
|
key: 2,
|
|
1060
|
-
"model-value":
|
|
1061
|
-
"onUpdate:modelValue": t[7] || (t[7] = (I) =>
|
|
1060
|
+
"model-value": L.value,
|
|
1061
|
+
"onUpdate:modelValue": t[7] || (t[7] = (I) => L.value = I),
|
|
1062
1062
|
"root-value": e.modelValue,
|
|
1063
|
-
readonly:
|
|
1064
|
-
}, null, 8, ["model-value", "root-value", "readonly"])) :
|
|
1065
|
-
e.mode !== a(
|
|
1063
|
+
readonly: A.value
|
|
1064
|
+
}, null, 8, ["model-value", "root-value", "readonly"])) : H("", !0),
|
|
1065
|
+
e.mode !== a(W).CREATE ? (f(), E("div", Pn, [
|
|
1066
1066
|
p(lt, {
|
|
1067
1067
|
label: a(l)("inventory.ingredient.status.inactive"),
|
|
1068
1068
|
"model-value": he.value,
|
|
1069
1069
|
"onUpdate:modelValue": t[8] || (t[8] = (I) => he.value = I),
|
|
1070
1070
|
"label-placement": "right",
|
|
1071
|
-
disabled:
|
|
1071
|
+
disabled: A.value
|
|
1072
1072
|
}, null, 8, ["label", "model-value", "disabled"]),
|
|
1073
|
-
|
|
1074
|
-
|
|
1073
|
+
d("div", On, [
|
|
1074
|
+
d("div", Bn, $(a(l)("inventory.ingredient.status.preventFromOrder")), 1)
|
|
1075
1075
|
])
|
|
1076
|
-
])) :
|
|
1077
|
-
e.mode !== a(
|
|
1078
|
-
|
|
1076
|
+
])) : H("", !0),
|
|
1077
|
+
e.mode !== a(W).CREATE ? (f(), E("div", Dn, [
|
|
1078
|
+
d("div", null, [
|
|
1079
1079
|
p(lt, {
|
|
1080
1080
|
label: a(l)("inventory.ingredient.bindedItems.title"),
|
|
1081
|
-
modelValue:
|
|
1082
|
-
"onUpdate:modelValue": t[9] || (t[9] = (I) =>
|
|
1081
|
+
modelValue: O.value,
|
|
1082
|
+
"onUpdate:modelValue": t[9] || (t[9] = (I) => O.value = I),
|
|
1083
1083
|
"label-placement": "right"
|
|
1084
1084
|
}, null, 8, ["label", "modelValue"])
|
|
1085
1085
|
]),
|
|
1086
|
-
|
|
1086
|
+
O.value && Y.value.length ? (f(), D(We, {
|
|
1087
1087
|
key: 0,
|
|
1088
1088
|
name: a(l)("inventory.ingredient.bindedItems.ingredient"),
|
|
1089
|
-
bindings:
|
|
1090
|
-
}, null, 8, ["name", "bindings"])) :
|
|
1091
|
-
|
|
1089
|
+
bindings: Y.value
|
|
1090
|
+
}, null, 8, ["name", "bindings"])) : H("", !0),
|
|
1091
|
+
O.value && oe.value.length ? (f(), D(We, {
|
|
1092
1092
|
key: 1,
|
|
1093
1093
|
name: a(l)("inventory.ingredient.bindedItems.recipe"),
|
|
1094
|
-
bindings:
|
|
1095
|
-
}, null, 8, ["name", "bindings"])) :
|
|
1096
|
-
|
|
1094
|
+
bindings: oe.value
|
|
1095
|
+
}, null, 8, ["name", "bindings"])) : H("", !0),
|
|
1096
|
+
O.value && ve.value.length ? (f(), D(We, {
|
|
1097
1097
|
key: 2,
|
|
1098
1098
|
name: a(l)("inventory.ingredient.bindedItems.menu"),
|
|
1099
|
-
bindings:
|
|
1100
|
-
}, null, 8, ["name", "bindings"])) :
|
|
1101
|
-
])) :
|
|
1102
|
-
|
|
1103
|
-
|
|
1099
|
+
bindings: ve.value
|
|
1100
|
+
}, null, 8, ["name", "bindings"])) : H("", !0)
|
|
1101
|
+
])) : H("", !0),
|
|
1102
|
+
d("div", Nn, [
|
|
1103
|
+
d("div", zn, [
|
|
1104
1104
|
p(fe, null, {
|
|
1105
1105
|
default: w(() => [
|
|
1106
|
-
|
|
1106
|
+
d("div", Ln, $(a(l)("inventory.ingredient.threshold.title")), 1)
|
|
1107
1107
|
]),
|
|
1108
1108
|
_: 1
|
|
1109
1109
|
}),
|
|
1110
|
-
|
|
1110
|
+
d("div", jn, $(a(l)("inventory.ingredient.threshold.subtitle")), 1)
|
|
1111
1111
|
]),
|
|
1112
|
-
|
|
1112
|
+
d("div", Hn, [
|
|
1113
1113
|
p(ot, {
|
|
1114
|
-
"model-value": { low:
|
|
1114
|
+
"model-value": { low: le.value, mid: ie.value },
|
|
1115
1115
|
rules: [Bt()]
|
|
1116
1116
|
}, null, 8, ["model-value", "rules"]),
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
p(
|
|
1121
|
-
days:
|
|
1122
|
-
level: a(
|
|
1117
|
+
d("div", Wn, [
|
|
1118
|
+
d("div", Yn, [
|
|
1119
|
+
d("div", qn, [
|
|
1120
|
+
p(je, {
|
|
1121
|
+
days: le.value,
|
|
1122
|
+
level: a(He).low
|
|
1123
1123
|
}, null, 8, ["days", "level"])
|
|
1124
1124
|
]),
|
|
1125
|
-
|
|
1126
|
-
|
|
1125
|
+
d("div", Gn, [
|
|
1126
|
+
d("div", Kn, $(a(l)("inventory.ingredient.threshold.whenRemaining")), 1),
|
|
1127
1127
|
p(at, {
|
|
1128
|
-
modelValue:
|
|
1129
|
-
"onUpdate:modelValue": t[10] || (t[10] = (I) =>
|
|
1130
|
-
rules: [a(
|
|
1128
|
+
modelValue: le.value,
|
|
1129
|
+
"onUpdate:modelValue": t[10] || (t[10] = (I) => le.value = I),
|
|
1130
|
+
rules: [a(Pe)(0)]
|
|
1131
1131
|
}, {
|
|
1132
1132
|
append: w(() => t[13] || (t[13] = [
|
|
1133
|
-
|
|
1133
|
+
d("div", {
|
|
1134
1134
|
class: "text-fm-color-typo-secondary",
|
|
1135
1135
|
style: { "padding-right": "32px" }
|
|
1136
1136
|
}, "days", -1)
|
|
@@ -1139,31 +1139,31 @@ const Mn = {
|
|
|
1139
1139
|
}, 8, ["modelValue", "rules"])
|
|
1140
1140
|
])
|
|
1141
1141
|
]),
|
|
1142
|
-
t[15] || (t[15] =
|
|
1142
|
+
t[15] || (t[15] = d("div", {
|
|
1143
1143
|
class: "h-full bg-fm-color-neutral-gray-200 relative",
|
|
1144
1144
|
style: { width: "1px" }
|
|
1145
1145
|
}, [
|
|
1146
|
-
|
|
1146
|
+
d("div", {
|
|
1147
1147
|
class: "absolute bg-white",
|
|
1148
1148
|
style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
|
|
1149
1149
|
}, " < ")
|
|
1150
1150
|
], -1)),
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
p(
|
|
1154
|
-
days:
|
|
1155
|
-
level: a(
|
|
1151
|
+
d("div", Jn, [
|
|
1152
|
+
d("div", Qn, [
|
|
1153
|
+
p(je, {
|
|
1154
|
+
days: ie.value,
|
|
1155
|
+
level: a(He).mid
|
|
1156
1156
|
}, null, 8, ["days", "level"])
|
|
1157
1157
|
]),
|
|
1158
|
-
|
|
1159
|
-
|
|
1158
|
+
d("div", Zn, [
|
|
1159
|
+
d("div", Xn, $(a(l)("inventory.ingredient.threshold.whenRemaining")), 1),
|
|
1160
1160
|
p(at, {
|
|
1161
|
-
modelValue:
|
|
1162
|
-
"onUpdate:modelValue": t[11] || (t[11] = (I) =>
|
|
1163
|
-
rules: [a(
|
|
1161
|
+
modelValue: ie.value,
|
|
1162
|
+
"onUpdate:modelValue": t[11] || (t[11] = (I) => ie.value = I),
|
|
1163
|
+
rules: [a(Pe)(0)]
|
|
1164
1164
|
}, {
|
|
1165
1165
|
append: w(() => t[14] || (t[14] = [
|
|
1166
|
-
|
|
1166
|
+
d("div", {
|
|
1167
1167
|
class: "text-fm-color-typo-secondary",
|
|
1168
1168
|
style: { "padding-right": "32px" }
|
|
1169
1169
|
}, "days", -1)
|
|
@@ -1172,39 +1172,39 @@ const Mn = {
|
|
|
1172
1172
|
}, 8, ["modelValue", "rules"])
|
|
1173
1173
|
])
|
|
1174
1174
|
]),
|
|
1175
|
-
t[16] || (t[16] =
|
|
1175
|
+
t[16] || (t[16] = d("div", {
|
|
1176
1176
|
class: "h-full bg-fm-color-neutral-gray-200 relative",
|
|
1177
1177
|
style: { width: "1px" }
|
|
1178
1178
|
}, [
|
|
1179
|
-
|
|
1179
|
+
d("div", {
|
|
1180
1180
|
class: "absolute bg-white",
|
|
1181
1181
|
style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
|
|
1182
1182
|
}, " < ")
|
|
1183
1183
|
], -1)),
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
p(
|
|
1187
|
-
days:
|
|
1188
|
-
level: a(
|
|
1184
|
+
d("div", eo, [
|
|
1185
|
+
d("div", to, [
|
|
1186
|
+
p(je, {
|
|
1187
|
+
days: ie.value + 1,
|
|
1188
|
+
level: a(He).high
|
|
1189
1189
|
}, null, 8, ["days", "level"])
|
|
1190
1190
|
]),
|
|
1191
|
-
|
|
1192
|
-
|
|
1191
|
+
d("div", no, [
|
|
1192
|
+
d("div", oo, $(a(l)("inventory.ingredient.threshold.stockIsStaple")), 1)
|
|
1193
1193
|
])
|
|
1194
1194
|
])
|
|
1195
1195
|
])
|
|
1196
1196
|
])
|
|
1197
1197
|
]),
|
|
1198
|
-
a(
|
|
1199
|
-
|
|
1200
|
-
|
|
1198
|
+
a(r).mustUsePoTemplate && e.mode === a(W).CREATE ? (f(), E("div", lo, [
|
|
1199
|
+
d("div", ao, [
|
|
1200
|
+
d("div", so, [
|
|
1201
1201
|
p(fe, null, {
|
|
1202
1202
|
default: w(() => [
|
|
1203
|
-
|
|
1203
|
+
d("div", ro, $(a(l)("inventory.ingredient.purchaseOrderTemplates.title")), 1)
|
|
1204
1204
|
]),
|
|
1205
1205
|
_: 1
|
|
1206
1206
|
}),
|
|
1207
|
-
p(
|
|
1207
|
+
p(De, {
|
|
1208
1208
|
variant: "secondary",
|
|
1209
1209
|
"text-color": "primary",
|
|
1210
1210
|
"border-color": "primary",
|
|
@@ -1212,29 +1212,29 @@ const Mn = {
|
|
|
1212
1212
|
onClick: Rt
|
|
1213
1213
|
})
|
|
1214
1214
|
]),
|
|
1215
|
-
|
|
1215
|
+
d("div", io, $(a(l)("inventory.ingredient.purchaseOrderTemplates.description")), 1)
|
|
1216
1216
|
]),
|
|
1217
|
-
Qe.value.length > 0 ? (f(), E("div",
|
|
1218
|
-
|
|
1219
|
-
(f(!0), E(X, null,
|
|
1217
|
+
Qe.value.length > 0 ? (f(), E("div", uo, [
|
|
1218
|
+
d("div", co, [
|
|
1219
|
+
(f(!0), E(X, null, ue(Qe.value, (I) => (f(), D(Ne, {
|
|
1220
1220
|
key: I.value,
|
|
1221
1221
|
label: I.label,
|
|
1222
1222
|
variant: "info",
|
|
1223
1223
|
compact: ""
|
|
1224
1224
|
}, null, 8, ["label"]))), 128))
|
|
1225
1225
|
])
|
|
1226
|
-
])) :
|
|
1227
|
-
])) :
|
|
1228
|
-
a(
|
|
1229
|
-
|
|
1230
|
-
|
|
1226
|
+
])) : H("", !0)
|
|
1227
|
+
])) : H("", !0),
|
|
1228
|
+
a(r).enableWastageTemplate && e.mode === a(W).CREATE ? (f(), E("div", mo, [
|
|
1229
|
+
d("div", po, [
|
|
1230
|
+
d("div", vo, [
|
|
1231
1231
|
p(fe, null, {
|
|
1232
1232
|
default: w(() => [
|
|
1233
|
-
|
|
1233
|
+
d("div", fo, $(a(l)("inventory.ingredient.wastageTemplates.title")), 1)
|
|
1234
1234
|
]),
|
|
1235
1235
|
_: 1
|
|
1236
1236
|
}),
|
|
1237
|
-
p(
|
|
1237
|
+
p(De, {
|
|
1238
1238
|
variant: "secondary",
|
|
1239
1239
|
"text-color": "primary",
|
|
1240
1240
|
"border-color": "primary",
|
|
@@ -1242,29 +1242,29 @@ const Mn = {
|
|
|
1242
1242
|
onClick: Pt
|
|
1243
1243
|
})
|
|
1244
1244
|
]),
|
|
1245
|
-
|
|
1245
|
+
d("div", yo, $(a(l)("inventory.ingredient.wastageTemplates.description")), 1)
|
|
1246
1246
|
]),
|
|
1247
|
-
Xe.value.length > 0 ? (f(), E("div",
|
|
1248
|
-
|
|
1249
|
-
(f(!0), E(X, null,
|
|
1247
|
+
Xe.value.length > 0 ? (f(), E("div", go, [
|
|
1248
|
+
d("div", bo, [
|
|
1249
|
+
(f(!0), E(X, null, ue(Xe.value, (I) => (f(), D(Ne, {
|
|
1250
1250
|
key: I.value,
|
|
1251
1251
|
label: I.label,
|
|
1252
1252
|
variant: "info",
|
|
1253
1253
|
compact: ""
|
|
1254
1254
|
}, null, 8, ["label"]))), 128))
|
|
1255
1255
|
])
|
|
1256
|
-
])) :
|
|
1257
|
-
])) :
|
|
1258
|
-
a(
|
|
1259
|
-
|
|
1260
|
-
|
|
1256
|
+
])) : H("", !0)
|
|
1257
|
+
])) : H("", !0),
|
|
1258
|
+
a(r).enableClosingTemplate && e.mode === a(W).CREATE ? (f(), E("div", ho, [
|
|
1259
|
+
d("div", _o, [
|
|
1260
|
+
d("div", xo, [
|
|
1261
1261
|
p(fe, null, {
|
|
1262
1262
|
default: w(() => [
|
|
1263
|
-
|
|
1263
|
+
d("div", ko, $(a(l)("inventory.ingredient.closingTemplates.title")), 1)
|
|
1264
1264
|
]),
|
|
1265
1265
|
_: 1
|
|
1266
1266
|
}),
|
|
1267
|
-
p(
|
|
1267
|
+
p(De, {
|
|
1268
1268
|
variant: "secondary",
|
|
1269
1269
|
"text-color": "primary",
|
|
1270
1270
|
"border-color": "primary",
|
|
@@ -1272,24 +1272,24 @@ const Mn = {
|
|
|
1272
1272
|
onClick: Ot
|
|
1273
1273
|
})
|
|
1274
1274
|
]),
|
|
1275
|
-
|
|
1275
|
+
d("div", wo, $(a(l)("inventory.ingredient.closingTemplates.description")), 1)
|
|
1276
1276
|
]),
|
|
1277
|
-
tt.value.length > 0 ? (f(), E("div",
|
|
1278
|
-
|
|
1279
|
-
(f(!0), E(X, null,
|
|
1277
|
+
tt.value.length > 0 ? (f(), E("div", To, [
|
|
1278
|
+
d("div", Vo, [
|
|
1279
|
+
(f(!0), E(X, null, ue(tt.value, (I) => (f(), D(Ne, {
|
|
1280
1280
|
key: I.value,
|
|
1281
1281
|
label: I.label,
|
|
1282
1282
|
variant: "info",
|
|
1283
1283
|
compact: ""
|
|
1284
1284
|
}, null, 8, ["label"]))), 128))
|
|
1285
1285
|
])
|
|
1286
|
-
])) :
|
|
1287
|
-
])) :
|
|
1288
|
-
|
|
1289
|
-
p(
|
|
1286
|
+
])) : H("", !0)
|
|
1287
|
+
])) : H("", !0),
|
|
1288
|
+
d("div", null, [
|
|
1289
|
+
p(Tn, {
|
|
1290
1290
|
entity: "inventorySku",
|
|
1291
|
-
modelValue:
|
|
1292
|
-
"onUpdate:modelValue": t[12] || (t[12] = (I) =>
|
|
1291
|
+
modelValue: P.value,
|
|
1292
|
+
"onUpdate:modelValue": t[12] || (t[12] = (I) => P.value = I)
|
|
1293
1293
|
}, null, 8, ["modelValue"])
|
|
1294
1294
|
])
|
|
1295
1295
|
];
|
|
@@ -1298,49 +1298,49 @@ const Mn = {
|
|
|
1298
1298
|
}, 8, ["disabled"]);
|
|
1299
1299
|
};
|
|
1300
1300
|
}
|
|
1301
|
-
}), Co = { class: "flex flex-col gap-32" },
|
|
1301
|
+
}), Co = { class: "flex flex-col gap-32" }, So = { class: "flex gap-4" }, Fo = /* @__PURE__ */ ye({
|
|
1302
1302
|
__name: "IngredientDialog",
|
|
1303
1303
|
props: {
|
|
1304
1304
|
show: { type: Boolean },
|
|
1305
1305
|
unit: {},
|
|
1306
|
-
mode: { default:
|
|
1306
|
+
mode: { default: W.READ }
|
|
1307
1307
|
},
|
|
1308
1308
|
emits: ["update:show"],
|
|
1309
|
-
setup(
|
|
1310
|
-
const o =
|
|
1309
|
+
setup(u) {
|
|
1310
|
+
const o = u, v = de(), l = Ge(), c = Be(), g = Et(), h = It(), y = At(), n = Se(), { t: s } = ge(), m = ht(o, "show"), i = ht(o, "unit"), r = B([]), T = B([]), A = B([]), R = k(
|
|
1311
1311
|
() => {
|
|
1312
1312
|
var _;
|
|
1313
1313
|
return c.isEnabled && c.netSuiteItemBySkuId.has((_ = o.unit) == null ? void 0 : _._id);
|
|
1314
1314
|
}
|
|
1315
|
-
),
|
|
1315
|
+
), G = k(() => {
|
|
1316
1316
|
switch (o.mode) {
|
|
1317
|
-
case
|
|
1317
|
+
case W.READ:
|
|
1318
1318
|
return "";
|
|
1319
|
-
case
|
|
1319
|
+
case W.UPDATE:
|
|
1320
1320
|
return s("inventory.ingredient.update.title");
|
|
1321
|
-
case
|
|
1321
|
+
case W.CREATE:
|
|
1322
1322
|
return s("inventory.ingredient.create.title");
|
|
1323
1323
|
}
|
|
1324
1324
|
return "";
|
|
1325
|
-
}),
|
|
1325
|
+
}), U = k(() => {
|
|
1326
1326
|
switch (o.mode) {
|
|
1327
|
-
case
|
|
1327
|
+
case W.READ:
|
|
1328
1328
|
return "";
|
|
1329
|
-
case
|
|
1329
|
+
case W.UPDATE:
|
|
1330
1330
|
return s("common.save");
|
|
1331
|
-
case
|
|
1331
|
+
case W.CREATE:
|
|
1332
1332
|
return s("common.add");
|
|
1333
1333
|
}
|
|
1334
1334
|
return "";
|
|
1335
1335
|
}), j = B(), V = B(!1);
|
|
1336
|
-
async function
|
|
1336
|
+
async function xe() {
|
|
1337
1337
|
V.value = !0;
|
|
1338
1338
|
try {
|
|
1339
|
-
await v.createSku(
|
|
1340
|
-
const _ = v.skuByCode[
|
|
1341
|
-
l.enablePoTemplate &&
|
|
1339
|
+
await v.createSku(i.value);
|
|
1340
|
+
const _ = v.skuByCode[i.value.code];
|
|
1341
|
+
l.enablePoTemplate && r.value.length > 0 && await be(_), l.enableWastageTemplate && T.value.length > 0 && await ce(_), l.enableClosingTemplate && A.value.length > 0 && await se(_), m.value = !1, n.open({
|
|
1342
1342
|
title: s("inventory.common.success"),
|
|
1343
|
-
message: s("inventory.ingredient.create.success", { name:
|
|
1343
|
+
message: s("inventory.ingredient.create.success", { name: i.value.name }),
|
|
1344
1344
|
type: "success"
|
|
1345
1345
|
});
|
|
1346
1346
|
} catch (_) {
|
|
@@ -1353,12 +1353,12 @@ const Mn = {
|
|
|
1353
1353
|
V.value = !1;
|
|
1354
1354
|
}
|
|
1355
1355
|
}
|
|
1356
|
-
async function
|
|
1356
|
+
async function ke() {
|
|
1357
1357
|
V.value = !0;
|
|
1358
1358
|
try {
|
|
1359
|
-
await v.updateSku(
|
|
1359
|
+
await v.updateSku(i.value), V.value = !1, m.value = !1, n.open({
|
|
1360
1360
|
title: s("inventory.common.success"),
|
|
1361
|
-
message: s("inventory.ingredient.update.success", { name:
|
|
1361
|
+
message: s("inventory.ingredient.update.success", { name: i.value.name }),
|
|
1362
1362
|
type: "success"
|
|
1363
1363
|
});
|
|
1364
1364
|
} catch (_) {
|
|
@@ -1372,168 +1372,168 @@ const Mn = {
|
|
|
1372
1372
|
}
|
|
1373
1373
|
}
|
|
1374
1374
|
async function be(_) {
|
|
1375
|
-
var
|
|
1375
|
+
var M, K, F, b;
|
|
1376
1376
|
try {
|
|
1377
|
-
for (const
|
|
1378
|
-
const
|
|
1379
|
-
if (!
|
|
1380
|
-
console.warn(`Template with ID ${
|
|
1377
|
+
for (const L of r.value) {
|
|
1378
|
+
const Q = await g.getTemplate(L);
|
|
1379
|
+
if (!Q) {
|
|
1380
|
+
console.warn(`Template with ID ${L} not found`);
|
|
1381
1381
|
continue;
|
|
1382
1382
|
}
|
|
1383
|
-
if (!
|
|
1384
|
-
const
|
|
1383
|
+
if (!Q.purchaseOrder.items.find((P) => P.sku._id === _._id)) {
|
|
1384
|
+
const P = { amount: 1, precision: en(_.unit) }, N = {
|
|
1385
1385
|
sku: _,
|
|
1386
1386
|
name: _.name,
|
|
1387
1387
|
code: _.code,
|
|
1388
|
-
quantity:
|
|
1389
|
-
minimumQuantity:
|
|
1390
|
-
quantityStep:
|
|
1391
|
-
measurement: ((
|
|
1392
|
-
},
|
|
1393
|
-
...
|
|
1388
|
+
quantity: P,
|
|
1389
|
+
minimumQuantity: P,
|
|
1390
|
+
quantityStep: P,
|
|
1391
|
+
measurement: ((K = (M = _.unit) == null ? void 0 : M.measurements) == null ? void 0 : K[0]) || null
|
|
1392
|
+
}, O = {
|
|
1393
|
+
...Q,
|
|
1394
1394
|
purchaseOrder: {
|
|
1395
|
-
...
|
|
1396
|
-
items: [...
|
|
1395
|
+
...Q.purchaseOrder,
|
|
1396
|
+
items: [...Q.purchaseOrder.items, N]
|
|
1397
1397
|
}
|
|
1398
1398
|
};
|
|
1399
|
-
(((F =
|
|
1400
|
-
({ totalCost:
|
|
1401
|
-
)), await g.updateTemplate(
|
|
1399
|
+
(((F = O.purchaseOrder.supplier) == null ? void 0 : F.internal) === gt.enum.warehouse || ((b = O.purchaseOrder.supplier) == null ? void 0 : b.internal) === gt.enum.restaurant) && (O.purchaseOrder.items = O.purchaseOrder.items.map(
|
|
1400
|
+
({ totalCost: Y, ...oe }) => oe
|
|
1401
|
+
)), await g.updateTemplate(O), await new Promise((Y) => setTimeout(Y, 1e3));
|
|
1402
1402
|
}
|
|
1403
1403
|
}
|
|
1404
|
-
} catch (
|
|
1404
|
+
} catch (L) {
|
|
1405
1405
|
n.open({
|
|
1406
1406
|
title: s("inventory.transfer.template.update.error"),
|
|
1407
1407
|
message: s("inventory.transfer.template.update.errorMessage"),
|
|
1408
1408
|
type: "error"
|
|
1409
|
-
}), console.error("Error in updating transfer template",
|
|
1409
|
+
}), console.error("Error in updating transfer template", L);
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
1412
1412
|
async function ce(_) {
|
|
1413
1413
|
try {
|
|
1414
|
-
for (const
|
|
1415
|
-
const
|
|
1416
|
-
if (!
|
|
1417
|
-
console.warn(`Wastage Template with ID ${
|
|
1414
|
+
for (const M of T.value) {
|
|
1415
|
+
const K = await h.getTemplate(M);
|
|
1416
|
+
if (!K) {
|
|
1417
|
+
console.warn(`Wastage Template with ID ${M} not found`);
|
|
1418
1418
|
continue;
|
|
1419
1419
|
}
|
|
1420
|
-
if (!
|
|
1420
|
+
if (!K.items.find((b) => b.id === _._id)) {
|
|
1421
1421
|
const b = {
|
|
1422
1422
|
id: _._id,
|
|
1423
1423
|
name: _.name,
|
|
1424
1424
|
code: _.code,
|
|
1425
1425
|
type: "sku",
|
|
1426
1426
|
disabledMeasurements: []
|
|
1427
|
-
},
|
|
1428
|
-
...
|
|
1429
|
-
items: [...
|
|
1427
|
+
}, L = {
|
|
1428
|
+
...K,
|
|
1429
|
+
items: [...K.items, b]
|
|
1430
1430
|
};
|
|
1431
|
-
await h.updateTemplate(
|
|
1431
|
+
await h.updateTemplate(L), await new Promise((Q) => setTimeout(Q, 1e3));
|
|
1432
1432
|
}
|
|
1433
1433
|
}
|
|
1434
|
-
} catch (
|
|
1434
|
+
} catch (M) {
|
|
1435
1435
|
n.open({
|
|
1436
1436
|
title: s("inventory.wastage.template.update.error"),
|
|
1437
1437
|
message: s("inventory.wastage.template.update.errorMessage"),
|
|
1438
1438
|
type: "error"
|
|
1439
|
-
}), console.error("Error in updating wastage template",
|
|
1439
|
+
}), console.error("Error in updating wastage template", M);
|
|
1440
1440
|
}
|
|
1441
1441
|
}
|
|
1442
1442
|
async function se(_) {
|
|
1443
1443
|
try {
|
|
1444
|
-
for (const
|
|
1445
|
-
const
|
|
1446
|
-
if (!
|
|
1447
|
-
console.warn(`Closing Template with ID ${
|
|
1444
|
+
for (const M of A.value) {
|
|
1445
|
+
const K = await y.getTemplate(M);
|
|
1446
|
+
if (!K) {
|
|
1447
|
+
console.warn(`Closing Template with ID ${M} not found`);
|
|
1448
1448
|
continue;
|
|
1449
1449
|
}
|
|
1450
|
-
if (!
|
|
1450
|
+
if (!K.items.find((b) => b.sku._id === _._id)) {
|
|
1451
1451
|
const b = {
|
|
1452
1452
|
sku: _
|
|
1453
|
-
},
|
|
1454
|
-
...
|
|
1455
|
-
items: [...
|
|
1453
|
+
}, L = {
|
|
1454
|
+
...K,
|
|
1455
|
+
items: [...K.items, b]
|
|
1456
1456
|
};
|
|
1457
|
-
await y.updateTemplate(
|
|
1457
|
+
await y.updateTemplate(L), await new Promise((Q) => setTimeout(Q, 1e3));
|
|
1458
1458
|
}
|
|
1459
1459
|
}
|
|
1460
|
-
} catch (
|
|
1460
|
+
} catch (M) {
|
|
1461
1461
|
n.open({
|
|
1462
1462
|
title: s("inventory.closing.template.update.error"),
|
|
1463
1463
|
message: s("inventory.closing.template.update.errorMessage"),
|
|
1464
1464
|
type: "error"
|
|
1465
|
-
}), console.error("Error in updating closing template",
|
|
1465
|
+
}), console.error("Error in updating closing template", M);
|
|
1466
1466
|
}
|
|
1467
1467
|
}
|
|
1468
1468
|
function he() {
|
|
1469
|
-
var _,
|
|
1470
|
-
(
|
|
1469
|
+
var _, M;
|
|
1470
|
+
(M = (_ = j.value) == null ? void 0 : _.validateInputs) == null || M.call(_);
|
|
1471
1471
|
}
|
|
1472
1472
|
function ee() {
|
|
1473
1473
|
switch (o.mode) {
|
|
1474
|
-
case
|
|
1474
|
+
case W.READ:
|
|
1475
1475
|
return;
|
|
1476
|
-
case
|
|
1477
|
-
return de();
|
|
1478
|
-
case H.CREATE:
|
|
1476
|
+
case W.UPDATE:
|
|
1479
1477
|
return ke();
|
|
1478
|
+
case W.CREATE:
|
|
1479
|
+
return xe();
|
|
1480
1480
|
}
|
|
1481
1481
|
}
|
|
1482
1482
|
function me(_) {
|
|
1483
|
-
|
|
1483
|
+
r.value = _;
|
|
1484
1484
|
}
|
|
1485
1485
|
function pe(_) {
|
|
1486
1486
|
T.value = _;
|
|
1487
1487
|
}
|
|
1488
1488
|
function we(_) {
|
|
1489
|
-
|
|
1489
|
+
A.value = _;
|
|
1490
1490
|
}
|
|
1491
|
-
return (_,
|
|
1492
|
-
const
|
|
1491
|
+
return (_, M) => {
|
|
1492
|
+
const K = S("FmChip"), F = S("FmButton"), b = S("FmSideSheet");
|
|
1493
1493
|
return f(), D(b, {
|
|
1494
1494
|
"model-value": a(m),
|
|
1495
|
-
"onUpdate:modelValue":
|
|
1496
|
-
header:
|
|
1495
|
+
"onUpdate:modelValue": M[3] || (M[3] = (L) => ct(m) ? m.value = L : null),
|
|
1496
|
+
header: G.value,
|
|
1497
1497
|
"close-button": "",
|
|
1498
1498
|
"dismiss-away": "",
|
|
1499
1499
|
"max-width": 500
|
|
1500
1500
|
}, {
|
|
1501
1501
|
"side-sheet-footer": w(() => [
|
|
1502
|
-
|
|
1502
|
+
d("div", So, [
|
|
1503
1503
|
p(F, {
|
|
1504
1504
|
loading: V.value,
|
|
1505
|
-
label:
|
|
1505
|
+
label: U.value,
|
|
1506
1506
|
onClick: he
|
|
1507
1507
|
}, null, 8, ["loading", "label"]),
|
|
1508
1508
|
p(F, {
|
|
1509
1509
|
disabled: V.value,
|
|
1510
1510
|
label: a(s)("common.close"),
|
|
1511
1511
|
variant: "tertiary",
|
|
1512
|
-
onClick:
|
|
1512
|
+
onClick: M[2] || (M[2] = (L) => m.value = !1)
|
|
1513
1513
|
}, null, 8, ["disabled", "label"])
|
|
1514
1514
|
])
|
|
1515
1515
|
]),
|
|
1516
1516
|
default: w(() => [
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1517
|
+
d("div", Co, [
|
|
1518
|
+
d("div", null, [
|
|
1519
|
+
R.value ? (f(), D(K, {
|
|
1520
1520
|
key: 0,
|
|
1521
1521
|
label: "Managed by Netsuite",
|
|
1522
1522
|
compact: ""
|
|
1523
|
-
})) :
|
|
1523
|
+
})) : H("", !0)
|
|
1524
1524
|
]),
|
|
1525
|
-
p(
|
|
1525
|
+
p(Io, {
|
|
1526
1526
|
class: "w-full",
|
|
1527
1527
|
ref_key: "hasValidationExpose",
|
|
1528
1528
|
ref: j,
|
|
1529
|
-
modelValue: a(
|
|
1530
|
-
"onUpdate:modelValue":
|
|
1529
|
+
modelValue: a(i),
|
|
1530
|
+
"onUpdate:modelValue": M[0] || (M[0] = (L) => ct(i) ? i.value = L : null),
|
|
1531
1531
|
mode: _.mode,
|
|
1532
1532
|
disabled: V.value,
|
|
1533
|
-
purchaseOrderTemplateIds:
|
|
1533
|
+
purchaseOrderTemplateIds: r.value,
|
|
1534
1534
|
wastageTemplateIds: T.value,
|
|
1535
|
-
closingTemplateIds:
|
|
1536
|
-
"onClick:submit":
|
|
1535
|
+
closingTemplateIds: A.value,
|
|
1536
|
+
"onClick:submit": M[1] || (M[1] = (L) => ee()),
|
|
1537
1537
|
"onUpdate:purchaseOrderTemplateIds": me,
|
|
1538
1538
|
"onUpdate:wastageTemplateIds": pe,
|
|
1539
1539
|
"onUpdate:closingTemplateIds": we
|
|
@@ -1545,23 +1545,23 @@ const Mn = {
|
|
|
1545
1545
|
};
|
|
1546
1546
|
}
|
|
1547
1547
|
});
|
|
1548
|
-
function
|
|
1549
|
-
return `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${
|
|
1548
|
+
function Mo() {
|
|
1549
|
+
return `sku_${(/* @__PURE__ */ new Date()).toISOString()}_${Vn()}`;
|
|
1550
1550
|
}
|
|
1551
|
-
const
|
|
1551
|
+
const Eo = {
|
|
1552
1552
|
_id: "",
|
|
1553
1553
|
name: "",
|
|
1554
1554
|
abbrev: "",
|
|
1555
1555
|
precision: 0,
|
|
1556
1556
|
measurements: []
|
|
1557
1557
|
};
|
|
1558
|
-
function
|
|
1559
|
-
return !
|
|
1558
|
+
function Ao(u) {
|
|
1559
|
+
return !u || Object.keys(u).length === 0 ? "" : Object.entries(u).map(([o, v]) => `${o}: ${v}`).join(", ");
|
|
1560
1560
|
}
|
|
1561
|
-
function Ut(
|
|
1562
|
-
if (!
|
|
1561
|
+
function Ut(u) {
|
|
1562
|
+
if (!u || u.trim() === "")
|
|
1563
1563
|
return;
|
|
1564
|
-
const o = {}, v =
|
|
1564
|
+
const o = {}, v = u.split(",").map((l) => l.trim());
|
|
1565
1565
|
for (const l of v) {
|
|
1566
1566
|
const c = l.indexOf(":");
|
|
1567
1567
|
if (c > 0) {
|
|
@@ -1571,23 +1571,23 @@ function Ut(d) {
|
|
|
1571
1571
|
}
|
|
1572
1572
|
return Object.keys(o).length > 0 ? o : void 0;
|
|
1573
1573
|
}
|
|
1574
|
-
function
|
|
1574
|
+
function Uo(u) {
|
|
1575
1575
|
var v, l, c, g, h;
|
|
1576
1576
|
return {
|
|
1577
|
-
code:
|
|
1578
|
-
name:
|
|
1579
|
-
unit: ((v =
|
|
1580
|
-
baseUnit:
|
|
1581
|
-
valuationMethod:
|
|
1582
|
-
pricePerUnit: (l =
|
|
1583
|
-
thresholdLow: ((g =
|
|
1584
|
-
thresholdMid: ((h =
|
|
1585
|
-
customAttributes:
|
|
1577
|
+
code: u.code,
|
|
1578
|
+
name: u.name,
|
|
1579
|
+
unit: ((v = u.unit.measurements.find((y) => y.id === u.trackingMeasurement)) == null ? void 0 : v.abbrev) ?? u.unit.abbrev,
|
|
1580
|
+
baseUnit: u.unit.abbrev,
|
|
1581
|
+
valuationMethod: u.valuation ?? "WAVG",
|
|
1582
|
+
pricePerUnit: (l = u.defaultCost) != null && l.costPerUnit ? +Ct((c = u.defaultCost) == null ? void 0 : c.costPerUnit) : 0,
|
|
1583
|
+
thresholdLow: ((g = u.thresholds) == null ? void 0 : g.low) ?? _e().low,
|
|
1584
|
+
thresholdMid: ((h = u.thresholds) == null ? void 0 : h.mid) ?? _e().mid,
|
|
1585
|
+
customAttributes: Ao(u.customAttributes)
|
|
1586
1586
|
};
|
|
1587
1587
|
}
|
|
1588
1588
|
function $t() {
|
|
1589
1589
|
var c;
|
|
1590
|
-
const
|
|
1590
|
+
const u = [
|
|
1591
1591
|
{
|
|
1592
1592
|
id: "code",
|
|
1593
1593
|
name: "Code"
|
|
@@ -1604,8 +1604,8 @@ function $t() {
|
|
|
1604
1604
|
id: "baseUnit",
|
|
1605
1605
|
name: "Base unit"
|
|
1606
1606
|
}
|
|
1607
|
-
], o =
|
|
1608
|
-
return o.enableTotalCost &&
|
|
1607
|
+
], o = Ge(), v = Fe(), l = Oe(v.currentCountry.value);
|
|
1608
|
+
return o.enableTotalCost && u.push(
|
|
1609
1609
|
{
|
|
1610
1610
|
id: "valuationMethod",
|
|
1611
1611
|
name: "Valuation method"
|
|
@@ -1614,7 +1614,7 @@ function $t() {
|
|
|
1614
1614
|
id: "pricePerUnit",
|
|
1615
1615
|
name: `Price per unit (${l == null ? void 0 : l.currency})`
|
|
1616
1616
|
}
|
|
1617
|
-
), ((c = v.currentBusiness.value) == null ? void 0 : c.menuVersion) === "v4" &&
|
|
1617
|
+
), ((c = v.currentBusiness.value) == null ? void 0 : c.menuVersion) === "v4" && u.push(
|
|
1618
1618
|
{
|
|
1619
1619
|
id: "thresholdLow",
|
|
1620
1620
|
name: "Show RED when remaining"
|
|
@@ -1623,13 +1623,13 @@ function $t() {
|
|
|
1623
1623
|
id: "thresholdMid",
|
|
1624
1624
|
name: "Show YELLOW when remaining"
|
|
1625
1625
|
}
|
|
1626
|
-
),
|
|
1626
|
+
), u.push({
|
|
1627
1627
|
id: "customAttributes",
|
|
1628
1628
|
name: "Custom Attributes"
|
|
1629
|
-
}),
|
|
1629
|
+
}), u;
|
|
1630
1630
|
}
|
|
1631
|
-
function
|
|
1632
|
-
const o =
|
|
1631
|
+
function $o() {
|
|
1632
|
+
const o = de().skus.map(Uo), l = Fe().currentBusiness.value, c = $t(), g = [
|
|
1633
1633
|
["Business name:", l == null ? void 0 : l.name],
|
|
1634
1634
|
["Business ID:", l == null ? void 0 : l._id],
|
|
1635
1635
|
["Menu version", l == null ? void 0 : l.menuVersion],
|
|
@@ -1639,8 +1639,8 @@ function Ro() {
|
|
|
1639
1639
|
], h = c.map((s) => `system:${s.id}`), y = Ft(g, h), n = `${l == null ? void 0 : l.name} ingredients (${tn(/* @__PURE__ */ new Date())}).xlsx`;
|
|
1640
1640
|
return Mt(y, n), n;
|
|
1641
1641
|
}
|
|
1642
|
-
function
|
|
1643
|
-
const o =
|
|
1642
|
+
function Ro() {
|
|
1643
|
+
const o = Fe().currentBusiness.value, v = $t(), l = [
|
|
1644
1644
|
["Business name:", o == null ? void 0 : o.name],
|
|
1645
1645
|
["Business ID:", o == null ? void 0 : o._id],
|
|
1646
1646
|
["Menu version", o == null ? void 0 : o.menuVersion],
|
|
@@ -1649,7 +1649,7 @@ function Po() {
|
|
|
1649
1649
|
], c = v.map((y) => `system:${y.id}`), g = Ft(l, c), h = "FeedMe ingredients template.xlsx";
|
|
1650
1650
|
return Mt(g, h), h;
|
|
1651
1651
|
}
|
|
1652
|
-
function
|
|
1652
|
+
function Po(u) {
|
|
1653
1653
|
const [
|
|
1654
1654
|
o,
|
|
1655
1655
|
v,
|
|
@@ -1658,94 +1658,94 @@ function Oo(d) {
|
|
|
1658
1658
|
g,
|
|
1659
1659
|
h,
|
|
1660
1660
|
...y
|
|
1661
|
-
] = on(
|
|
1662
|
-
if (!o || !o.length || o.some((
|
|
1661
|
+
] = on(u);
|
|
1662
|
+
if (!o || !o.length || o.some((r) => r.length && !r.startsWith("system:")))
|
|
1663
1663
|
throw new Error("Missing meta header. Excel file does not come from the template.");
|
|
1664
|
-
const n = o.map((
|
|
1664
|
+
const n = o.map((r) => r.split(":")[1]), m = ["code", "name", "unit", "baseUnit"].filter((r) => !n.includes(r));
|
|
1665
1665
|
if (m.length)
|
|
1666
1666
|
throw new Error(
|
|
1667
1667
|
`Missing meta headers (${m.join()}). Excel file does not come from the template.`
|
|
1668
1668
|
);
|
|
1669
|
-
return y.map((
|
|
1670
|
-
const
|
|
1671
|
-
for (const
|
|
1672
|
-
const
|
|
1673
|
-
Object.assign(
|
|
1669
|
+
return y.map((r, T) => {
|
|
1670
|
+
const A = {};
|
|
1671
|
+
for (const R in n) {
|
|
1672
|
+
const G = n[R];
|
|
1673
|
+
Object.assign(A, { [G]: r[R] });
|
|
1674
1674
|
}
|
|
1675
1675
|
return {
|
|
1676
1676
|
index: T,
|
|
1677
|
-
data:
|
|
1677
|
+
data: A
|
|
1678
1678
|
};
|
|
1679
1679
|
});
|
|
1680
1680
|
}
|
|
1681
|
-
function xt(
|
|
1681
|
+
function xt(u, o, v) {
|
|
1682
1682
|
var j;
|
|
1683
|
-
const c =
|
|
1683
|
+
const c = de().units, g = new Array(), h = v.filter((V) => V.data.code === u.code);
|
|
1684
1684
|
h.length > 1 && g.push(
|
|
1685
|
-
`Code ${
|
|
1685
|
+
`Code ${u.code} is already used in row ${h.map((V) => V.index + 6).join()}.`
|
|
1686
1686
|
);
|
|
1687
|
-
const y = c.find((V) => V.abbrev ===
|
|
1687
|
+
const y = c.find((V) => V.abbrev === u.baseUnit), n = y == null ? void 0 : y.measurements.find((V) => V.abbrev === u.unit);
|
|
1688
1688
|
if (!y)
|
|
1689
|
-
g.push(`Cannot find base unit of symbol ${
|
|
1690
|
-
else if (
|
|
1691
|
-
const V = `Cannot find unit conversion for ${
|
|
1689
|
+
g.push(`Cannot find base unit of symbol ${u.baseUnit}.`);
|
|
1690
|
+
else if (u.baseUnit !== u.unit && !n) {
|
|
1691
|
+
const V = `Cannot find unit conversion for ${u.baseUnit} with symbol ${u.unit || "[empty]"}.`;
|
|
1692
1692
|
g.push(V);
|
|
1693
1693
|
}
|
|
1694
|
-
const s =
|
|
1695
|
-
(V) => V ===
|
|
1694
|
+
const s = Ce.options.find(
|
|
1695
|
+
(V) => V === u.valuationMethod
|
|
1696
1696
|
);
|
|
1697
|
-
|
|
1698
|
-
`Expected valuation method to be one of ${
|
|
1697
|
+
u.valuationMethod && !s && g.push(
|
|
1698
|
+
`Expected valuation method to be one of ${Ce.options.join()} but got ${u.valuationMethod} instead.`
|
|
1699
1699
|
);
|
|
1700
|
-
const
|
|
1700
|
+
const i = Fe().currentCountry.value, r = (V) => `${V}`.length && ln()(V) === !0, T = r(`${u.pricePerUnit}`) === !0 ? {
|
|
1701
1701
|
costPerUnit: {
|
|
1702
|
-
...
|
|
1703
|
-
currency: ((j =
|
|
1702
|
+
...St(Number(u.pricePerUnit) || 0),
|
|
1703
|
+
currency: ((j = Oe(i)) == null ? void 0 : j.currency) ?? "MYR"
|
|
1704
1704
|
},
|
|
1705
1705
|
measurement: n
|
|
1706
|
-
} : void 0,
|
|
1707
|
-
low: Number(
|
|
1708
|
-
mid: Number(
|
|
1709
|
-
} : void 0,
|
|
1706
|
+
} : void 0, A = r(`${u.thresholdLow}`) && r(`${u.thresholdMid}`) ? {
|
|
1707
|
+
low: Number(u.thresholdLow) || 0,
|
|
1708
|
+
mid: Number(u.thresholdMid) || 0
|
|
1709
|
+
} : void 0, R = "customAttributes" in u ? Ut(u.customAttributes) : null;
|
|
1710
1710
|
return {
|
|
1711
1711
|
type: "create",
|
|
1712
1712
|
sku: {
|
|
1713
|
-
_id:
|
|
1714
|
-
code:
|
|
1715
|
-
name:
|
|
1716
|
-
unit: y ?? c.find((V) => V) ??
|
|
1713
|
+
_id: Mo(),
|
|
1714
|
+
code: u.code,
|
|
1715
|
+
name: u.name,
|
|
1716
|
+
unit: y ?? c.find((V) => V) ?? Eo,
|
|
1717
1717
|
trackingMeasurement: n == null ? void 0 : n.id,
|
|
1718
1718
|
valuation: s,
|
|
1719
1719
|
defaultCost: T,
|
|
1720
|
-
thresholds:
|
|
1721
|
-
...
|
|
1720
|
+
thresholds: A,
|
|
1721
|
+
...R !== null && { customAttributes: R }
|
|
1722
1722
|
},
|
|
1723
1723
|
errors: g,
|
|
1724
1724
|
excelRowNumber: o + 6
|
|
1725
1725
|
};
|
|
1726
1726
|
}
|
|
1727
|
-
function
|
|
1727
|
+
function Oo(u) {
|
|
1728
1728
|
try {
|
|
1729
|
-
const o =
|
|
1729
|
+
const o = Po(u).filter((s) => s.data.code), l = de().skus, c = nn(l, "code"), g = o.filter((s) => !c[s.data.code]), h = o.filter((s) => c[s.data.code]), y = g.map(
|
|
1730
1730
|
(s) => xt(s.data, s.index, o)
|
|
1731
1731
|
), n = h.map((s) => {
|
|
1732
|
-
const m = xt(s.data, s.index, o),
|
|
1733
|
-
let
|
|
1734
|
-
return "customAttributes" in s.data && (
|
|
1732
|
+
const m = xt(s.data, s.index, o), i = c[s.data.code];
|
|
1733
|
+
let r = i.customAttributes;
|
|
1734
|
+
return "customAttributes" in s.data && (r = Ut(s.data.customAttributes)), {
|
|
1735
1735
|
...m,
|
|
1736
1736
|
type: "update",
|
|
1737
|
-
original:
|
|
1737
|
+
original: i,
|
|
1738
1738
|
sku: {
|
|
1739
1739
|
// to maintain original props not in the import excel, e.g. inventory binding, etc...
|
|
1740
|
-
...
|
|
1741
|
-
code: m.sku.code ||
|
|
1742
|
-
name: m.sku.name ||
|
|
1743
|
-
unit: m.sku.unit ||
|
|
1744
|
-
trackingMeasurement: m.sku.trackingMeasurement ||
|
|
1745
|
-
valuation: m.sku.valuation ||
|
|
1746
|
-
defaultCost: m.sku.defaultCost ||
|
|
1747
|
-
thresholds: m.sku.thresholds ||
|
|
1748
|
-
customAttributes:
|
|
1740
|
+
...i,
|
|
1741
|
+
code: m.sku.code || i.code,
|
|
1742
|
+
name: m.sku.name || i.name,
|
|
1743
|
+
unit: m.sku.unit || i.unit,
|
|
1744
|
+
trackingMeasurement: m.sku.trackingMeasurement || i.trackingMeasurement,
|
|
1745
|
+
valuation: m.sku.valuation || i.valuation,
|
|
1746
|
+
defaultCost: m.sku.defaultCost || i.defaultCost,
|
|
1747
|
+
thresholds: m.sku.thresholds || i.thresholds,
|
|
1748
|
+
customAttributes: r
|
|
1749
1749
|
}
|
|
1750
1750
|
};
|
|
1751
1751
|
});
|
|
@@ -1763,10 +1763,10 @@ function Bo(d) {
|
|
|
1763
1763
|
};
|
|
1764
1764
|
}
|
|
1765
1765
|
}
|
|
1766
|
-
const
|
|
1766
|
+
const Bo = { class: "flex items-center gap-12 pl-8" }, Do = { class: "flex flex-col" }, No = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, zo = {
|
|
1767
1767
|
key: 0,
|
|
1768
1768
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
1769
|
-
},
|
|
1769
|
+
}, Lo = { key: 0 }, kt = /* @__PURE__ */ ye({
|
|
1770
1770
|
__name: "ImportIngredientItem",
|
|
1771
1771
|
props: {
|
|
1772
1772
|
type: {},
|
|
@@ -1774,26 +1774,26 @@ const Do = { class: "flex items-center gap-12 pl-8" }, No = { class: "flex flex-
|
|
|
1774
1774
|
name: {},
|
|
1775
1775
|
errors: {}
|
|
1776
1776
|
},
|
|
1777
|
-
setup(
|
|
1777
|
+
setup(u) {
|
|
1778
1778
|
return (o, v) => {
|
|
1779
|
-
const l =
|
|
1780
|
-
return f(), E("div",
|
|
1781
|
-
v[0] || (v[0] =
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1779
|
+
const l = S("FmIcon"), c = S("FmTooltip");
|
|
1780
|
+
return f(), E("div", Bo, [
|
|
1781
|
+
v[0] || (v[0] = d("div", null, "•", -1)),
|
|
1782
|
+
d("div", Do, [
|
|
1783
|
+
d("div", No, [
|
|
1784
|
+
d("div", {
|
|
1785
1785
|
class: ae({
|
|
1786
1786
|
"text-fm-color-system-error-300": o.errors.length
|
|
1787
1787
|
})
|
|
1788
1788
|
}, [
|
|
1789
|
-
|
|
1790
|
-
o.type === "create" ? (f(), E("span",
|
|
1789
|
+
qe($(o.name) + " ", 1),
|
|
1790
|
+
o.type === "create" ? (f(), E("span", zo, "(new)")) : H("", !0)
|
|
1791
1791
|
], 2),
|
|
1792
|
-
o.errors.length ? (f(), E("div",
|
|
1792
|
+
o.errors.length ? (f(), E("div", Lo, [
|
|
1793
1793
|
p(c, { "z-index": 50 }, {
|
|
1794
1794
|
content: w(() => [
|
|
1795
|
-
|
|
1796
|
-
(f(!0), E(X, null,
|
|
1795
|
+
d("ol", null, [
|
|
1796
|
+
(f(!0), E(X, null, ue(o.errors, (g, h) => (f(), E("li", { key: h }, $(g), 1))), 128))
|
|
1797
1797
|
])
|
|
1798
1798
|
]),
|
|
1799
1799
|
default: w(() => [
|
|
@@ -1805,9 +1805,9 @@ const Do = { class: "flex items-center gap-12 pl-8" }, No = { class: "flex flex-
|
|
|
1805
1805
|
]),
|
|
1806
1806
|
_: 1
|
|
1807
1807
|
})
|
|
1808
|
-
])) :
|
|
1808
|
+
])) : H("", !0)
|
|
1809
1809
|
]),
|
|
1810
|
-
|
|
1810
|
+
d("div", {
|
|
1811
1811
|
class: ae([
|
|
1812
1812
|
"fm-typo-en-body-sm-400",
|
|
1813
1813
|
{
|
|
@@ -1815,51 +1815,51 @@ const Do = { class: "flex items-center gap-12 pl-8" }, No = { class: "flex flex-
|
|
|
1815
1815
|
"text-fm-color-typo-secondary": !o.errors.length
|
|
1816
1816
|
}
|
|
1817
1817
|
])
|
|
1818
|
-
},
|
|
1818
|
+
}, $(o.code), 3)
|
|
1819
1819
|
])
|
|
1820
1820
|
]);
|
|
1821
1821
|
};
|
|
1822
1822
|
}
|
|
1823
|
-
}),
|
|
1823
|
+
}), jo = { class: "flex flex-col gap-24" }, Ho = { class: "fm-typo-en-body-md-400" }, Wo = { class: "flex flex-col gap-8" }, Yo = { class: "line-clamp-2 text-ellipsis break-all" }, qo = {
|
|
1824
1824
|
key: 2,
|
|
1825
1825
|
class: "shrink-0"
|
|
1826
|
-
},
|
|
1826
|
+
}, Go = {
|
|
1827
1827
|
key: 0,
|
|
1828
1828
|
class: "flex flex-col"
|
|
1829
|
-
},
|
|
1829
|
+
}, Ko = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Jo = {
|
|
1830
1830
|
key: 0,
|
|
1831
1831
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
1832
|
-
},
|
|
1832
|
+
}, Qo = { class: "fm-typo-en-body-lg-600" }, Zo = /* @__PURE__ */ ye({
|
|
1833
1833
|
__name: "ImportIngredients",
|
|
1834
|
-
setup(
|
|
1835
|
-
const o = B(null), v = yn(), l =
|
|
1836
|
-
() => !!g.value.length || h.value.some((
|
|
1834
|
+
setup(u) {
|
|
1835
|
+
const o = B(null), v = yn(), l = Se(), c = B(!1), g = B(new Array()), h = B([]), y = B([]), n = k(
|
|
1836
|
+
() => !!g.value.length || h.value.some((r) => r.errors.length) || y.value.some((r) => r.errors.length)
|
|
1837
1837
|
), s = k(
|
|
1838
1838
|
() => !!h.value.length || !!y.value.length
|
|
1839
1839
|
), { t: m } = ge();
|
|
1840
|
-
async function r
|
|
1840
|
+
async function i(r) {
|
|
1841
1841
|
g.value = [], h.value = [], y.value = [];
|
|
1842
1842
|
try {
|
|
1843
1843
|
c.value = !0;
|
|
1844
1844
|
const [T] = await Promise.all([
|
|
1845
|
-
sn(
|
|
1845
|
+
sn(r),
|
|
1846
1846
|
// fake buffer
|
|
1847
|
-
new Promise((
|
|
1848
|
-
]),
|
|
1849
|
-
if (!
|
|
1847
|
+
new Promise((G) => setTimeout(G, 1e3))
|
|
1848
|
+
]), A = T.SheetNames.find((G) => G);
|
|
1849
|
+
if (!A) {
|
|
1850
1850
|
g.value.push(m("inventory.ingredient.import.fileError.noSheet"));
|
|
1851
1851
|
return;
|
|
1852
1852
|
}
|
|
1853
|
-
const
|
|
1854
|
-
if (
|
|
1855
|
-
g.value.push(
|
|
1853
|
+
const R = Oo(T.Sheets[A]);
|
|
1854
|
+
if (R.invalidExcel) {
|
|
1855
|
+
g.value.push(R.invalidExcelMessage ?? m("inventory.ingredient.import.fileError.invalidExcel"));
|
|
1856
1856
|
return;
|
|
1857
1857
|
}
|
|
1858
|
-
if (h.value =
|
|
1858
|
+
if (h.value = R.importCreateResult, y.value = R.importUpdateResult, !h.value.length && !y.value.length) {
|
|
1859
1859
|
g.value.push(m("inventory.ingredient.import.fileError.noData"));
|
|
1860
1860
|
return;
|
|
1861
1861
|
}
|
|
1862
|
-
v.emitData(
|
|
1862
|
+
v.emitData(R);
|
|
1863
1863
|
} catch (T) {
|
|
1864
1864
|
l.open({
|
|
1865
1865
|
title: m("inventory.ingredient.import.fileError.unableToRead"),
|
|
@@ -1873,27 +1873,27 @@ const Do = { class: "flex items-center gap-12 pl-8" }, No = { class: "flex flex-
|
|
|
1873
1873
|
}), c.value = !1;
|
|
1874
1874
|
}
|
|
1875
1875
|
}
|
|
1876
|
-
return wt(o, (
|
|
1877
|
-
|
|
1878
|
-
}), (
|
|
1879
|
-
const
|
|
1880
|
-
return f(), E("div",
|
|
1881
|
-
|
|
1876
|
+
return wt(o, (r) => {
|
|
1877
|
+
r && i(r);
|
|
1878
|
+
}), (r, T) => {
|
|
1879
|
+
const A = S("FmCircularProgress"), R = S("FmIcon"), G = S("FmButton");
|
|
1880
|
+
return f(), E("div", jo, [
|
|
1881
|
+
d("div", Ho, $(a(m)("inventory.ingredient.import.uploadDescription")), 1),
|
|
1882
1882
|
p(an, {
|
|
1883
1883
|
class: ae({
|
|
1884
1884
|
"w-full": !0,
|
|
1885
1885
|
"h-[200px]": !o.value
|
|
1886
1886
|
}),
|
|
1887
1887
|
accept: ".xlsx",
|
|
1888
|
-
onFileUpload: T[0] || (T[0] = (
|
|
1888
|
+
onFileUpload: T[0] || (T[0] = (U) => o.value = U),
|
|
1889
1889
|
label: a(m)("inventory.ingredient.import.uploadTemplate"),
|
|
1890
1890
|
"button-label": a(m)("inventory.ingredient.import.selectFile")
|
|
1891
1891
|
}, Tt({ _: 2 }, [
|
|
1892
1892
|
o.value ? {
|
|
1893
1893
|
name: "default",
|
|
1894
|
-
fn: w(({ openFileDialog:
|
|
1895
|
-
|
|
1896
|
-
|
|
1894
|
+
fn: w(({ openFileDialog: U }) => [
|
|
1895
|
+
d("div", Wo, [
|
|
1896
|
+
d("div", {
|
|
1897
1897
|
class: ae([
|
|
1898
1898
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
1899
1899
|
{
|
|
@@ -1903,17 +1903,17 @@ const Do = { class: "flex items-center gap-12 pl-8" }, No = { class: "flex flex-
|
|
|
1903
1903
|
}
|
|
1904
1904
|
])
|
|
1905
1905
|
}, [
|
|
1906
|
-
c.value ? (f(), D(
|
|
1906
|
+
c.value ? (f(), D(A, {
|
|
1907
1907
|
key: 0,
|
|
1908
1908
|
size: "md",
|
|
1909
1909
|
color: "neutral-gray-200"
|
|
1910
|
-
})) : (f(), D(
|
|
1910
|
+
})) : (f(), D(R, {
|
|
1911
1911
|
key: 1,
|
|
1912
1912
|
name: n.value ? "error" : "attach_file",
|
|
1913
1913
|
outline: "",
|
|
1914
1914
|
color: n.value ? "system-error-300" : void 0
|
|
1915
1915
|
}, null, 8, ["name", "color"])),
|
|
1916
|
-
|
|
1916
|
+
d("div", {
|
|
1917
1917
|
class: ae([
|
|
1918
1918
|
"fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
|
|
1919
1919
|
{
|
|
@@ -1922,62 +1922,59 @@ const Do = { class: "flex items-center gap-12 pl-8" }, No = { class: "flex flex-
|
|
|
1922
1922
|
}
|
|
1923
1923
|
])
|
|
1924
1924
|
}, [
|
|
1925
|
-
|
|
1925
|
+
d("div", Yo, $(o.value.name), 1)
|
|
1926
1926
|
], 2),
|
|
1927
|
-
c.value ?
|
|
1928
|
-
p(
|
|
1927
|
+
c.value ? H("", !0) : (f(), E("div", qo, [
|
|
1928
|
+
p(G, {
|
|
1929
1929
|
label: a(m)("inventory.ingredient.import.replaceFile"),
|
|
1930
1930
|
variant: n.value ? "destructive" : "secondary",
|
|
1931
1931
|
"prepend-icon": n.value ? void 0 : "autorenew",
|
|
1932
|
-
onClick:
|
|
1932
|
+
onClick: U
|
|
1933
1933
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
1934
1934
|
]))
|
|
1935
1935
|
], 2),
|
|
1936
|
-
g.value.length ? (f(), E("div",
|
|
1937
|
-
(f(!0), E(X, null,
|
|
1936
|
+
g.value.length ? (f(), E("div", Go, [
|
|
1937
|
+
(f(!0), E(X, null, ue(g.value, (j, V) => (f(), E("div", {
|
|
1938
1938
|
key: V,
|
|
1939
1939
|
class: "flex gap-8 items-center"
|
|
1940
1940
|
}, [
|
|
1941
|
-
p(
|
|
1941
|
+
p(R, {
|
|
1942
1942
|
name: "error",
|
|
1943
1943
|
size: "sm",
|
|
1944
1944
|
color: "system-error-300"
|
|
1945
1945
|
}),
|
|
1946
|
-
|
|
1946
|
+
d("div", Ko, $(j), 1)
|
|
1947
1947
|
]))), 128))
|
|
1948
|
-
])) :
|
|
1948
|
+
])) : H("", !0)
|
|
1949
1949
|
])
|
|
1950
1950
|
]),
|
|
1951
1951
|
key: "0"
|
|
1952
1952
|
} : void 0
|
|
1953
1953
|
]), 1032, ["class", "label", "button-label"]),
|
|
1954
|
-
s.value ? (f(), E("div",
|
|
1955
|
-
|
|
1956
|
-
(f(!0), E(X, null,
|
|
1957
|
-
key:
|
|
1958
|
-
code:
|
|
1959
|
-
name:
|
|
1960
|
-
errors:
|
|
1954
|
+
s.value ? (f(), E("div", Jo, [
|
|
1955
|
+
d("div", Qo, $(a(m)("inventory.ingredient.import.summary")), 1),
|
|
1956
|
+
(f(!0), E(X, null, ue(h.value, (U) => (f(), D(kt, {
|
|
1957
|
+
key: U.sku._id,
|
|
1958
|
+
code: U.sku.code,
|
|
1959
|
+
name: U.sku.name,
|
|
1960
|
+
errors: U.errors,
|
|
1961
1961
|
type: "create"
|
|
1962
1962
|
}, null, 8, ["code", "name", "errors"]))), 128)),
|
|
1963
|
-
(f(!0), E(X, null,
|
|
1964
|
-
key:
|
|
1965
|
-
code:
|
|
1966
|
-
name:
|
|
1967
|
-
errors:
|
|
1963
|
+
(f(!0), E(X, null, ue(y.value, (U) => (f(), D(kt, {
|
|
1964
|
+
key: U.sku._id,
|
|
1965
|
+
code: U.sku.code,
|
|
1966
|
+
name: U.sku.name,
|
|
1967
|
+
errors: U.errors,
|
|
1968
1968
|
type: "update"
|
|
1969
1969
|
}, null, 8, ["code", "name", "errors"]))), 128))
|
|
1970
|
-
])) :
|
|
1970
|
+
])) : H("", !0)
|
|
1971
1971
|
]);
|
|
1972
1972
|
};
|
|
1973
1973
|
}
|
|
1974
|
-
}), el = {
|
|
1975
|
-
key: 0,
|
|
1976
|
-
class: "flex items-center gap-1"
|
|
1977
|
-
}, tl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, nl = { class: "flex flex-col py-8" }, ol = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ll = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, kl = /* @__PURE__ */ ye({
|
|
1974
|
+
}), Xo = { class: "flex flex-col py-8" }, el = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, tl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, hl = /* @__PURE__ */ ye({
|
|
1978
1975
|
__name: "IngredientsView",
|
|
1979
|
-
setup(
|
|
1980
|
-
const o =
|
|
1976
|
+
setup(u) {
|
|
1977
|
+
const o = de(), v = Be(), l = k(() => [
|
|
1981
1978
|
{
|
|
1982
1979
|
type: "string",
|
|
1983
1980
|
key: "skuCode",
|
|
@@ -2012,7 +2009,7 @@ const Do = { class: "flex items-center gap-12 pl-8" }, No = { class: "flex flex-
|
|
|
2012
2009
|
if (!c.value)
|
|
2013
2010
|
return o.skus;
|
|
2014
2011
|
const F = rn.build(c.value);
|
|
2015
|
-
return o.skus.filter((b) => v.isEnabled &&
|
|
2012
|
+
return o.skus.filter((b) => v.isEnabled && ke.value && g.value && !g.value.has(b._id) ? !1 : un(
|
|
2016
2013
|
{
|
|
2017
2014
|
skuCode: b.code,
|
|
2018
2015
|
skuUnitAbbrev: b.unit.abbrev,
|
|
@@ -2020,31 +2017,31 @@ const Do = { class: "flex items-center gap-12 pl-8" }, No = { class: "flex flex-
|
|
|
2020
2017
|
},
|
|
2021
2018
|
F
|
|
2022
2019
|
));
|
|
2023
|
-
}), y = dn(), n =
|
|
2024
|
-
function
|
|
2020
|
+
}), y = dn(), n = Ke(), s = In(), m = Se(), { t: i } = ge(), { createIngredient: r, updateIngredient: T } = Ye(), { ingredientDialogProps: A, ingredientViewLoading: R } = xn(Ye()), { columnDefs: G } = Cn();
|
|
2021
|
+
function U(F) {
|
|
2025
2022
|
switch (F) {
|
|
2026
2023
|
case "add":
|
|
2027
|
-
return v.isEnabled ? void 0 :
|
|
2024
|
+
return v.isEnabled ? void 0 : r();
|
|
2028
2025
|
case "import":
|
|
2029
|
-
return
|
|
2026
|
+
return M();
|
|
2030
2027
|
case "export":
|
|
2031
2028
|
return _();
|
|
2032
2029
|
}
|
|
2033
2030
|
}
|
|
2034
|
-
const j = B(""), V = B(!1),
|
|
2031
|
+
const j = B(""), V = B(!1), xe = k(() => V.value || R.value), ke = B(!1), { breakpoints: be } = gn(), ce = k(() => be.value.xs || be.value.sm), se = k(() => ce.value ? 10 : 20), he = cn(), ee = B(!1), me = [
|
|
2035
2032
|
{
|
|
2036
2033
|
value: "import",
|
|
2037
|
-
label:
|
|
2034
|
+
label: i("common.import")
|
|
2038
2035
|
},
|
|
2039
2036
|
{
|
|
2040
2037
|
value: "export",
|
|
2041
|
-
label:
|
|
2038
|
+
label: i("common.export")
|
|
2042
2039
|
}
|
|
2043
2040
|
];
|
|
2044
2041
|
function pe(F) {
|
|
2045
2042
|
switch (ee.value = !1, F) {
|
|
2046
2043
|
case "import":
|
|
2047
|
-
return
|
|
2044
|
+
return M();
|
|
2048
2045
|
case "export":
|
|
2049
2046
|
return _();
|
|
2050
2047
|
}
|
|
@@ -2052,125 +2049,125 @@ const Do = { class: "flex items-center gap-12 pl-8" }, No = { class: "flex flex-
|
|
|
2052
2049
|
const we = k(() => [
|
|
2053
2050
|
...v.isEnabled ? [] : [
|
|
2054
2051
|
{
|
|
2055
|
-
label:
|
|
2052
|
+
label: i("inventory.ingredient.create.title"),
|
|
2056
2053
|
value: "add",
|
|
2057
2054
|
isPrimary: !0,
|
|
2058
2055
|
prependIcon: "add"
|
|
2059
2056
|
}
|
|
2060
2057
|
],
|
|
2061
|
-
{ label:
|
|
2062
|
-
{ label:
|
|
2058
|
+
{ label: i("common.import"), value: "import" },
|
|
2059
|
+
{ label: i("common.export"), value: "export" }
|
|
2063
2060
|
]);
|
|
2064
2061
|
function _() {
|
|
2065
|
-
const F =
|
|
2062
|
+
const F = $o();
|
|
2066
2063
|
m.open({
|
|
2067
|
-
title:
|
|
2068
|
-
message:
|
|
2064
|
+
title: i("inventory.ingredient.export.success"),
|
|
2065
|
+
message: i("inventory.ingredient.export.filename", [F]),
|
|
2069
2066
|
type: "success"
|
|
2070
2067
|
});
|
|
2071
2068
|
}
|
|
2072
|
-
function
|
|
2069
|
+
function M() {
|
|
2073
2070
|
n.open({
|
|
2074
|
-
title:
|
|
2075
|
-
contentComponent:
|
|
2071
|
+
title: i("inventory.ingredient.import.title"),
|
|
2072
|
+
contentComponent: Zo,
|
|
2076
2073
|
overlay: !0,
|
|
2077
2074
|
closeButton: !0,
|
|
2078
2075
|
primaryActions: {
|
|
2079
|
-
text:
|
|
2076
|
+
text: i("common.import"),
|
|
2080
2077
|
close: !1
|
|
2081
2078
|
},
|
|
2082
2079
|
secondaryActions: {
|
|
2083
|
-
text:
|
|
2080
|
+
text: i("common.close"),
|
|
2084
2081
|
close: !0
|
|
2085
2082
|
},
|
|
2086
2083
|
tertiaryActions: {
|
|
2087
|
-
text:
|
|
2084
|
+
text: i("inventory.ingredient.import.actions.downloadTemplate"),
|
|
2088
2085
|
close: !1,
|
|
2089
2086
|
variant: "plain"
|
|
2090
2087
|
}
|
|
2091
2088
|
}).onPrimary((F) => {
|
|
2092
2089
|
if (!F) {
|
|
2093
2090
|
m.open({
|
|
2094
|
-
title:
|
|
2091
|
+
title: i("inventory.ingredient.import.error.noData"),
|
|
2095
2092
|
type: "error"
|
|
2096
2093
|
});
|
|
2097
2094
|
return;
|
|
2098
2095
|
}
|
|
2099
2096
|
if (!F.importCreateResult.length && !F.importUpdateResult.length) {
|
|
2100
2097
|
m.open({
|
|
2101
|
-
title:
|
|
2102
|
-
message:
|
|
2098
|
+
title: i("inventory.ingredient.import.error.invalidContent"),
|
|
2099
|
+
message: i("inventory.ingredient.import.error.noImportData"),
|
|
2103
2100
|
type: "error"
|
|
2104
2101
|
});
|
|
2105
2102
|
return;
|
|
2106
2103
|
}
|
|
2107
2104
|
if (F.importCreateResult.some((b) => b.errors.length) || F.importUpdateResult.some((b) => b.errors.length)) {
|
|
2108
2105
|
m.open({
|
|
2109
|
-
title:
|
|
2110
|
-
message:
|
|
2106
|
+
title: i("inventory.ingredient.import.error.invalidContent"),
|
|
2107
|
+
message: i("inventory.ingredient.import.error.hasErrors"),
|
|
2111
2108
|
type: "error"
|
|
2112
2109
|
});
|
|
2113
2110
|
return;
|
|
2114
2111
|
}
|
|
2115
|
-
n.close(),
|
|
2116
|
-
}).onTertiary(
|
|
2112
|
+
n.close(), K(F);
|
|
2113
|
+
}).onTertiary(Ro);
|
|
2117
2114
|
}
|
|
2118
|
-
async function
|
|
2115
|
+
async function K(F) {
|
|
2119
2116
|
V.value = !0;
|
|
2120
2117
|
try {
|
|
2121
2118
|
const b = [
|
|
2122
|
-
...F.importCreateResult.map(({ sku:
|
|
2123
|
-
...F.importUpdateResult.map(({ sku:
|
|
2124
|
-
],
|
|
2125
|
-
let
|
|
2119
|
+
...F.importCreateResult.map(({ sku: N }) => ({ type: "create", sku: N })),
|
|
2120
|
+
...F.importUpdateResult.map(({ sku: N }) => ({ type: "update", sku: N }))
|
|
2121
|
+
], L = 100;
|
|
2122
|
+
let Q = 0;
|
|
2126
2123
|
const re = () => {
|
|
2127
|
-
|
|
2128
|
-
title:
|
|
2129
|
-
Math.min(
|
|
2124
|
+
Q += L, m.open({
|
|
2125
|
+
title: i("inventory.ingredient.import.progress", [
|
|
2126
|
+
Math.min(Q, b.length),
|
|
2130
2127
|
b.length
|
|
2131
2128
|
])
|
|
2132
2129
|
});
|
|
2133
|
-
},
|
|
2134
|
-
for (const
|
|
2130
|
+
}, P = new Array();
|
|
2131
|
+
for (const N of b.chunk(100)) {
|
|
2135
2132
|
re();
|
|
2136
2133
|
try {
|
|
2137
|
-
const
|
|
2138
|
-
create:
|
|
2139
|
-
update:
|
|
2134
|
+
const O = await o.importSkus({
|
|
2135
|
+
create: N.filter((Y) => Y.type === "create").map((Y) => Y.sku),
|
|
2136
|
+
update: N.filter((Y) => Y.type === "update").map((Y) => Y.sku)
|
|
2140
2137
|
});
|
|
2141
|
-
|
|
2142
|
-
} catch (
|
|
2143
|
-
|
|
2144
|
-
...
|
|
2145
|
-
const
|
|
2138
|
+
P.push(...O.errors);
|
|
2139
|
+
} catch (O) {
|
|
2140
|
+
P.push(
|
|
2141
|
+
...N.map((Y) => {
|
|
2142
|
+
const oe = {
|
|
2146
2143
|
module: fn.enum.sku,
|
|
2147
|
-
_id:
|
|
2148
|
-
name:
|
|
2149
|
-
message: (
|
|
2144
|
+
_id: Y.sku._id,
|
|
2145
|
+
name: Y.sku.name,
|
|
2146
|
+
message: (O == null ? void 0 : O.stack) ?? O
|
|
2150
2147
|
};
|
|
2151
2148
|
return {
|
|
2152
|
-
data:
|
|
2153
|
-
error: [
|
|
2149
|
+
data: Y.sku,
|
|
2150
|
+
error: [oe]
|
|
2154
2151
|
};
|
|
2155
2152
|
})
|
|
2156
2153
|
);
|
|
2157
2154
|
}
|
|
2158
2155
|
}
|
|
2159
2156
|
m.open({
|
|
2160
|
-
title:
|
|
2157
|
+
title: i("inventory.ingredient.import.success"),
|
|
2161
2158
|
type: "success"
|
|
2162
|
-
}),
|
|
2159
|
+
}), P.length && s.alert(
|
|
2163
2160
|
"Some operation failed",
|
|
2164
|
-
|
|
2161
|
+
J(
|
|
2165
2162
|
"div",
|
|
2166
2163
|
{ class: "flex flex-col gap-8" },
|
|
2167
|
-
|
|
2168
|
-
(
|
|
2169
|
-
|
|
2170
|
-
|
|
2164
|
+
P.map(
|
|
2165
|
+
(N) => J("div", { class: "flex flex-col" }, [
|
|
2166
|
+
J("div", { class: "fm-typo-en-body-lg-600" }, `(${N.data.code}) ${N.data.name}`),
|
|
2167
|
+
J(
|
|
2171
2168
|
"div",
|
|
2172
2169
|
{ class: "fm-typo-en-body-lg-400" },
|
|
2173
|
-
`${
|
|
2170
|
+
`${N.error.map((O) => (O == null ? void 0 : O.message) ?? "Unknown error").join(", ")}`
|
|
2174
2171
|
)
|
|
2175
2172
|
])
|
|
2176
2173
|
)
|
|
@@ -2178,8 +2175,8 @@ const Do = { class: "flex items-center gap-12 pl-8" }, No = { class: "flex flex-
|
|
|
2178
2175
|
);
|
|
2179
2176
|
} catch (b) {
|
|
2180
2177
|
m.open({
|
|
2181
|
-
title:
|
|
2182
|
-
message:
|
|
2178
|
+
title: i("inventory.ingredient.import.error.failed"),
|
|
2179
|
+
message: i("inventory.ingredient.import.error.systemMessage", [b == null ? void 0 : b.message]),
|
|
2183
2180
|
type: "error"
|
|
2184
2181
|
}), console.error("Error in importing skus", F, b);
|
|
2185
2182
|
} finally {
|
|
@@ -2187,14 +2184,14 @@ const Do = { class: "flex items-center gap-12 pl-8" }, No = { class: "flex flex-
|
|
|
2187
2184
|
}
|
|
2188
2185
|
}
|
|
2189
2186
|
return (F, b) => {
|
|
2190
|
-
const
|
|
2187
|
+
const L = S("FmTable"), Q = S("FmCollapsibleTabs"), re = S("FmBottomSheet");
|
|
2191
2188
|
return f(), D(mn, {
|
|
2192
|
-
title: a(
|
|
2189
|
+
title: a(i)("inventory.ingredient.title"),
|
|
2193
2190
|
actions: we.value,
|
|
2194
|
-
"onClick:action":
|
|
2191
|
+
"onClick:action": U
|
|
2195
2192
|
}, {
|
|
2196
2193
|
default: w(() => [
|
|
2197
|
-
|
|
2194
|
+
d("div", {
|
|
2198
2195
|
class: ae([
|
|
2199
2196
|
"flex flex-col gap-8 max-h-full",
|
|
2200
2197
|
{
|
|
@@ -2206,57 +2203,45 @@ const Do = { class: "flex items-center gap-12 pl-8" }, No = { class: "flex flex-
|
|
|
2206
2203
|
p(pn, {
|
|
2207
2204
|
searchable: "",
|
|
2208
2205
|
search: j.value,
|
|
2209
|
-
"onUpdate:search": b[
|
|
2206
|
+
"onUpdate:search": b[0] || (b[0] = (P) => j.value = P),
|
|
2210
2207
|
filterable: "",
|
|
2211
2208
|
"filter-attributes": l.value,
|
|
2212
2209
|
filter: c.value,
|
|
2213
|
-
"onUpdate:filter": b[
|
|
2214
|
-
},
|
|
2215
|
-
|
|
2216
|
-
a(v).isEnabled ? (f(), E("div", el, [
|
|
2217
|
-
u("span", tl, R(a(r)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
|
|
2218
|
-
p(wn),
|
|
2219
|
-
p(z, {
|
|
2220
|
-
modelValue: de.value,
|
|
2221
|
-
"onUpdate:modelValue": b[0] || (b[0] = (M) => de.value = M)
|
|
2222
|
-
}, null, 8, ["modelValue"])
|
|
2223
|
-
])) : L("", !0)
|
|
2224
|
-
]),
|
|
2225
|
-
_: 1
|
|
2226
|
-
}, 8, ["search", "filter-attributes", "filter"]),
|
|
2227
|
-
(f(), D(J, {
|
|
2210
|
+
"onUpdate:filter": b[1] || (b[1] = (P) => c.value = P)
|
|
2211
|
+
}, null, 8, ["search", "filter-attributes", "filter"]),
|
|
2212
|
+
(f(), D(L, {
|
|
2228
2213
|
key: JSON.stringify(c.value),
|
|
2229
2214
|
style: Wt(a(he).tableHeight),
|
|
2230
|
-
"column-defs": a(
|
|
2215
|
+
"column-defs": a(G),
|
|
2231
2216
|
"row-data": h.value,
|
|
2232
2217
|
"search-value": j.value,
|
|
2233
2218
|
columnVisibility: {
|
|
2234
2219
|
netsuiteSubsidiary: a(v).isEnabled
|
|
2235
2220
|
},
|
|
2236
|
-
loading: (!a(y)._currentLocation ||
|
|
2221
|
+
loading: (!a(y)._currentLocation || xe.value) && a(v).isReady,
|
|
2237
2222
|
"loading-text": "Loading",
|
|
2238
|
-
onRowClick: b[
|
|
2223
|
+
onRowClick: b[2] || (b[2] = (P) => a(T)(P.original)),
|
|
2239
2224
|
"page-size": se.value
|
|
2240
2225
|
}, {
|
|
2241
|
-
"list-row": w((
|
|
2226
|
+
"list-row": w((P) => [
|
|
2242
2227
|
p(vn, {
|
|
2243
|
-
row:
|
|
2228
|
+
row: P,
|
|
2244
2229
|
onRowClick: a(T)
|
|
2245
2230
|
}, Tt({
|
|
2246
|
-
default: w((
|
|
2247
|
-
var
|
|
2231
|
+
default: w((N) => {
|
|
2232
|
+
var O, Y, oe, ve, Me, Ee, Ae, Ue, le, ie;
|
|
2248
2233
|
return [
|
|
2249
|
-
|
|
2250
|
-
|
|
2234
|
+
d("div", Xo, [
|
|
2235
|
+
d("div", el, [
|
|
2251
2236
|
p(a(bt), {
|
|
2252
|
-
render: (
|
|
2253
|
-
props: (
|
|
2237
|
+
render: (oe = (Y = (O = N.code) == null ? void 0 : O.column) == null ? void 0 : Y.columnDef) == null ? void 0 : oe.cell,
|
|
2238
|
+
props: (Me = (ve = N.code) == null ? void 0 : ve.getContext) == null ? void 0 : Me.call(ve)
|
|
2254
2239
|
}, null, 8, ["render", "props"])
|
|
2255
2240
|
]),
|
|
2256
|
-
|
|
2241
|
+
d("div", tl, [
|
|
2257
2242
|
p(a(bt), {
|
|
2258
|
-
render: (
|
|
2259
|
-
props: (
|
|
2243
|
+
render: (Ue = (Ae = (Ee = N.name) == null ? void 0 : Ee.column) == null ? void 0 : Ae.columnDef) == null ? void 0 : Ue.cell,
|
|
2244
|
+
props: (ie = (le = N.name) == null ? void 0 : le.getContext) == null ? void 0 : ie.call(le)
|
|
2260
2245
|
}, null, 8, ["render", "props"])
|
|
2261
2246
|
])
|
|
2262
2247
|
])
|
|
@@ -2267,7 +2252,7 @@ const Do = { class: "flex items-center gap-12 pl-8" }, No = { class: "flex flex-
|
|
|
2267
2252
|
V.value ? {
|
|
2268
2253
|
name: "loading-text",
|
|
2269
2254
|
fn: w(() => [
|
|
2270
|
-
|
|
2255
|
+
d("div", null, $(a(i)("inventory.ingredient.table.importing")), 1)
|
|
2271
2256
|
]),
|
|
2272
2257
|
key: "0"
|
|
2273
2258
|
} : void 0
|
|
@@ -2277,19 +2262,19 @@ const Do = { class: "flex items-center gap-12 pl-8" }, No = { class: "flex flex-
|
|
|
2277
2262
|
}, 8, ["style", "column-defs", "row-data", "search-value", "columnVisibility", "loading", "page-size"]))
|
|
2278
2263
|
], 2),
|
|
2279
2264
|
(f(), D(mt, { to: "body" }, [
|
|
2280
|
-
p(
|
|
2265
|
+
p(Fo, Yt(qt(a(A))), null, 16)
|
|
2281
2266
|
])),
|
|
2282
2267
|
(f(), D(mt, { to: "body" }, [
|
|
2283
|
-
p(
|
|
2268
|
+
p(re, {
|
|
2284
2269
|
"dismiss-away": "",
|
|
2285
2270
|
modelValue: ee.value,
|
|
2286
|
-
"onUpdate:modelValue": b[
|
|
2271
|
+
"onUpdate:modelValue": b[4] || (b[4] = (P) => ee.value = P)
|
|
2287
2272
|
}, {
|
|
2288
2273
|
default: w(() => [
|
|
2289
|
-
p(
|
|
2274
|
+
p(Q, {
|
|
2290
2275
|
class: "pb-8",
|
|
2291
2276
|
items: me,
|
|
2292
|
-
"onUpdate:modelValue": b[
|
|
2277
|
+
"onUpdate:modelValue": b[3] || (b[3] = (P) => pe(P))
|
|
2293
2278
|
})
|
|
2294
2279
|
]),
|
|
2295
2280
|
_: 1
|
|
@@ -2302,5 +2287,5 @@ const Do = { class: "flex items-center gap-12 pl-8" }, No = { class: "flex flex-
|
|
|
2302
2287
|
}
|
|
2303
2288
|
});
|
|
2304
2289
|
export {
|
|
2305
|
-
|
|
2290
|
+
hl as default
|
|
2306
2291
|
};
|