@feedmepos/mf-inventory-portal 1.2.19-dev.2 → 1.2.20-dev.1
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-Bq3VbOg4.js → App-B5BIloxc.js} +1 -1
- package/dist/{ApprovalView-0rdBk4Ga.js → ApprovalView-BUP9Ol7x.js} +2 -2
- package/dist/{BindingsDialog-D9dfQy9F.js → BindingsDialog-D8IeB1YM.js} +2 -2
- package/dist/{BindingsPicker-C5qh7Kjp.js → BindingsPicker-_-Ixxe9G.js} +1 -1
- package/dist/{BindingsTable-CMEWGAmH.js → BindingsTable-BTCusvjz.js} +1 -1
- package/dist/{ClosingDraftView-D5dgVQLQ.js → ClosingDraftView-tCM9Zdx1.js} +2 -2
- package/dist/{ClosingTemplateView-BCrbXt1O.js → ClosingTemplateView-CYuMwKNs.js} +770 -758
- package/dist/{DeliveryOrderPrintPreview-DzP9MsW6.js → DeliveryOrderPrintPreview-BReapKV9.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-lL_Je_aP.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-wvVXg89M.js} +3 -3
- package/dist/{FmMultiselectDialog-B39wWYKL.js → FmMultiselectDialog-CJuzOMdl.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DTLkc1KI.js → FmUnitInput.vue_vue_type_script_setup_true_lang-C3eLdkK3.js} +1 -1
- package/dist/{ImportView-DSlXRo6h.js → ImportView-Bjz1VcEa.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-EUSjFuu0.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DkOE4lzJ.js} +1 -1
- package/dist/{IngredientGroupView-N1SA4h33.js → IngredientGroupView-J7YDHuhH.js} +2 -2
- package/dist/{IngredientsView-CXk0pFuq.js → IngredientsView-BxwlvkQA.js} +474 -462
- package/dist/{IntegrationView-D0-VCjXw.js → IntegrationView-DCLqYJkS.js} +3 -3
- package/dist/{InventoryBindingForm-DqQKgRFD.js → InventoryBindingForm-Dla3xBG0.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CxsiIFB7.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BSYpdGuC.js} +3 -3
- package/dist/{InventoryBindingSummary-4kCjgPon.js → InventoryBindingSummary-Bi4SppDe.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CapjT1PG.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-ClYvUONw.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BTr8giUF.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CU0SmCbP.js} +1 -1
- package/dist/{PublishView-cxD30ANP.js → PublishView-C2K7WaAd.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-C25EwRvq.js → PurchaseOrderPrintPreview-DMNrCh0s.js} +1 -1
- package/dist/{ReceiveRequestView-DG79qu-Q.js → ReceiveRequestView-CEeEUMVX.js} +8 -8
- package/dist/{RecipeView-Dd3Gzx_7.js → RecipeView-BxhzCnzy.js} +3 -3
- package/dist/StockView-9YUD3m_c.js +2384 -0
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-yBT7sh32.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CEavqW1k.js} +1 -1
- package/dist/{SupplierView-CftbqjSM.js → SupplierView-BlBEKe2O.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CsG99iyc.js → TransferDetails.vue_vue_type_script_setup_true_lang-DdqM3dGO.js} +5 -5
- package/dist/{TransferTemplateView-Bg3WZG4x.js → TransferTemplateView-D8EePaDw.js} +7 -7
- package/dist/{UnitView-DDOjic5i.js → UnitView-Dy3MiRGl.js} +3 -3
- package/dist/{WarehouseView-xXj5gNkv.js → WarehouseView-DijZkykP.js} +1 -1
- package/dist/{app-C5xhmSdT.js → app-C64sJzLv.js} +22609 -22551
- package/dist/app.d.ts +21 -0
- package/dist/app.js +1 -1
- package/dist/{closing-template-CTnmZmwR.js → closing-template-BEjIJ2tY.js} +1 -1
- package/dist/components/FmLockableField.vue.d.ts +3 -0
- package/dist/{decimal-ByvJmvuR.js → decimal-CkfdNVrr.js} +1 -1
- package/dist/{format-unit-display-Y9dmvD9H.js → format-unit-display-CldjWHO8.js} +3 -3
- package/dist/{import-export.helper-BNdJmogm.js → import-export.helper-DNdTJYLZ.js} +1 -1
- package/dist/{index-BN9dlUFp.js → index-Cid-zsPr.js} +1 -1
- package/dist/{index-B-8jCooy.js → index-vSxmfAnk.js} +1 -1
- package/dist/layout/SingleColumnLayout.vue.d.ts +6 -3
- package/dist/{purchase-order-template-B8d4uElQ.js → purchase-order-template-wK371TAH.js} +1 -1
- package/dist/{stock-nuJyCyEZ.js → stock-DtGy2YeN.js} +1 -1
- package/dist/{supplier-1Y0Es3Q1.js → supplier-CfWMxJX1.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-D4xzg9Cj.js → use-ingredient-select-dialog-wVvSnlm8.js} +1 -1
- package/dist/{use-inventory-binding-dialog-BCEJrcXb.js → use-inventory-binding-dialog-B6f3xRuV.js} +1 -1
- package/dist/views/closing-template/helpers/import-export.helper.d.ts +1 -1
- package/dist/views/stock/components/dialog/StockAdjustmentSideSheet.vue.d.ts +20 -0
- package/package.json +1 -1
- package/dist/StockView-DUPQoRbk.js +0 -2160
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import { ref as B, defineComponent as pe, computed as
|
|
2
|
-
import { a as
|
|
3
|
-
import { useDialog as Re, useSnackbar as
|
|
1
|
+
import { ref as B, defineComponent as pe, computed as g, resolveComponent as F, openBlock as u, createElementBlock as w, Fragment as X, unref as o, createVNode as a, withModifiers as Bt, createCommentVNode as L, withCtx as y, createElementVNode as l, toDisplayString as A, normalizeClass as te, renderList as ue, createBlock as O, h as Q, renderSlot as xe, createSlots as Ye, createTextVNode as Ge, mergeModels as it, onMounted as Dt, watch as kt, useModel as Ot, isRef as dt, normalizeStyle as Nt, Teleport as ut, normalizeProps as zt, guardReactiveProps as Lt } from "vue";
|
|
2
|
+
import { a as Ce, e as H, f as Tt, S as jt, b as Fe, h as He, i as Wt, D as ct, j as Me, A as Pe, k as wt, l as Ht, n as mt, t as qt, o as Yt, p as pt, q as Oe, U as Gt, r as Kt, M as Jt, s as vt, v as ft, c as Vt, w as Ne, _ as Zt, x as yt, y as Qt, z as gt, B as Xt, C as en, N as tn, H as nn, u as ln, E as on, G as an, I as sn, J as rn, K as bt, L as dn } from "./app-C64sJzLv.js";
|
|
3
|
+
import { useDialog as Re, useSnackbar as Ae, components as ze, useProxiedModel as ht, useDialogChild as un, useBreakpoints as cn } from "@feedmepos/ui-library";
|
|
4
4
|
import { i as mn, _ as pn } from "./is-linked-ingredient-error-fJ2TJb3z.js";
|
|
5
5
|
import { useI18n as ve, useCoreStore as It } from "@feedmepos/mf-common";
|
|
6
6
|
import { defineStore as vn, storeToRefs as fn } from "pinia";
|
|
7
|
-
import { g as yn, _ as Le, S as je, a as gn } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-
|
|
8
|
-
import { _ as bn } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-
|
|
9
|
-
import { _ as We } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-
|
|
7
|
+
import { g as yn, _ as Le, S as je, a as gn } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CEavqW1k.js";
|
|
8
|
+
import { _ as bn } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-BSYpdGuC.js";
|
|
9
|
+
import { _ as We } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-DkOE4lzJ.js";
|
|
10
10
|
import { _ as he } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
11
|
-
import { d as Ue, g as hn, e as _n, a as xn } from "./import-export.helper-
|
|
11
|
+
import { d as Ue, g as hn, e as _n, a as xn } from "./import-export.helper-DNdTJYLZ.js";
|
|
12
12
|
import { _ as kn } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
|
|
13
|
-
import { u as St } from "./purchase-order-template-
|
|
14
|
-
import { u as Ct } from "./closing-template-
|
|
15
|
-
import { u as Tn } from "./FmMultiselectDialog-
|
|
13
|
+
import { u as St } from "./purchase-order-template-wK371TAH.js";
|
|
14
|
+
import { u as Ct } from "./closing-template-BEjIJ2tY.js";
|
|
15
|
+
import { u as Tn } from "./FmMultiselectDialog-CJuzOMdl.js";
|
|
16
16
|
const qe = vn("ingredientForm", function() {
|
|
17
|
-
const
|
|
17
|
+
const s = Re(), T = Ae(), r = Ce(), b = B(!1), { t: S } = ve(), U = B();
|
|
18
18
|
function k() {
|
|
19
|
-
const
|
|
19
|
+
const i = {
|
|
20
20
|
sku: {},
|
|
21
21
|
mode: H.CREATE,
|
|
22
22
|
show: !0,
|
|
23
|
-
"onUpdate:show"(
|
|
24
|
-
U.value.show =
|
|
23
|
+
"onUpdate:show"(d) {
|
|
24
|
+
U.value.show = d;
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
U.value =
|
|
27
|
+
U.value = i;
|
|
28
28
|
}
|
|
29
|
-
async function n(
|
|
30
|
-
const
|
|
31
|
-
sku: Tt(
|
|
29
|
+
async function n(i) {
|
|
30
|
+
const d = {
|
|
31
|
+
sku: Tt(i),
|
|
32
32
|
mode: H.UPDATE,
|
|
33
33
|
show: !0,
|
|
34
34
|
"onUpdate:show"(m) {
|
|
35
35
|
U.value.show = m;
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
U.value =
|
|
38
|
+
U.value = d;
|
|
39
39
|
}
|
|
40
|
-
async function c(
|
|
40
|
+
async function c(i) {
|
|
41
41
|
b.value = !0;
|
|
42
42
|
try {
|
|
43
|
-
await
|
|
43
|
+
await r.deleteSku(i), T.open({
|
|
44
44
|
title: "Success",
|
|
45
|
-
message: `Deleted ${
|
|
45
|
+
message: `Deleted ${i.name}`,
|
|
46
46
|
type: "success"
|
|
47
47
|
});
|
|
48
|
-
} catch (
|
|
49
|
-
|
|
48
|
+
} catch (d) {
|
|
49
|
+
d instanceof jt && mn(d) ? s.open({
|
|
50
50
|
title: "Cannot delete ingredient",
|
|
51
51
|
contentComponent: pn,
|
|
52
52
|
contentComponentProps: {
|
|
53
|
-
subject: (
|
|
54
|
-
items:
|
|
53
|
+
subject: (i == null ? void 0 : i.name) ?? "",
|
|
54
|
+
items: d.errorResponse.message
|
|
55
55
|
},
|
|
56
56
|
secondaryActions: {
|
|
57
57
|
text: "Close",
|
|
58
58
|
close: !0
|
|
59
59
|
}
|
|
60
|
-
}) : console.log("unable to delete ingredient",
|
|
61
|
-
title: `Cannot delete ${
|
|
60
|
+
}) : console.log("unable to delete ingredient", d), T.open({
|
|
61
|
+
title: `Cannot delete ${i.name}`,
|
|
62
62
|
message: "Please try again.",
|
|
63
63
|
type: "error"
|
|
64
|
-
}), console.error("failed to delete ingredient",
|
|
64
|
+
}), console.error("failed to delete ingredient", d);
|
|
65
65
|
} finally {
|
|
66
66
|
b.value = !1;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
function _(
|
|
70
|
-
|
|
71
|
-
title: S("inventory.ingredient.delete.title", [(
|
|
69
|
+
function _(i) {
|
|
70
|
+
s.open({
|
|
71
|
+
title: S("inventory.ingredient.delete.title", [(i == null ? void 0 : i.name) ?? ""]),
|
|
72
72
|
closeButton: !1,
|
|
73
73
|
message: S("inventory.ingredient.delete.message"),
|
|
74
74
|
primaryActions: {
|
|
@@ -80,7 +80,7 @@ const qe = vn("ingredientForm", function() {
|
|
|
80
80
|
text: S("common.cancel"),
|
|
81
81
|
close: !0
|
|
82
82
|
}
|
|
83
|
-
}).onPrimary(() => c(
|
|
83
|
+
}).onPrimary(() => c(i));
|
|
84
84
|
}
|
|
85
85
|
return {
|
|
86
86
|
createIngredient: k,
|
|
@@ -95,10 +95,10 @@ const qe = vn("ingredientForm", function() {
|
|
|
95
95
|
}, Vn = { class: "flex flex-col gap-1" }, In = { class: "fm-typo-en-heading-lg-600" }, Sn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Cn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fn = {
|
|
96
96
|
key: 0,
|
|
97
97
|
class: "fm-typo-en-body-md-400 text-fm-color-system-warning-300"
|
|
98
|
-
},
|
|
98
|
+
}, An = {
|
|
99
99
|
key: 1,
|
|
100
100
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
101
|
-
},
|
|
101
|
+
}, En = { class: "flex flex-col gap-2 mt-4" }, $n = { class: "flex items-center gap-2 fm-typo-en-body-md-400" }, Mn = { class: "flex flex-wrap gap-2" }, Un = { class: "flex flex-col" }, Pn = { class: "flex flex-col bg-fm-color-bg-secondary font-mono p-4 rounded-md" }, Rn = { class: "text-fm-color-typo-tertiary flex-shrink-0 fm-typo-en-body-md-400 whitespace-pre flex items-center" }, Bn = { class: "px-2 py-1 rounded-md bg-blue-200 border-2 border-blue-400" }, Dn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, On = /* @__PURE__ */ pe({
|
|
102
102
|
__name: "ItemSubsidiaryTreeDialog",
|
|
103
103
|
props: {
|
|
104
104
|
skuId: {},
|
|
@@ -106,10 +106,10 @@ const qe = vn("ingredientForm", function() {
|
|
|
106
106
|
itemCode: {}
|
|
107
107
|
},
|
|
108
108
|
setup(W) {
|
|
109
|
-
const
|
|
109
|
+
const s = W, { t: T } = ve(), r = It(), b = Fe(), S = B(!1), U = g(() => {
|
|
110
110
|
var m;
|
|
111
|
-
return ((m =
|
|
112
|
-
}), k =
|
|
111
|
+
return ((m = r.sessionUser.value) == null ? void 0 : m.role.isAdmin) ?? !1;
|
|
112
|
+
}), k = g(() => b.getSkuSubsidiaries(s.skuId)), n = g(() => {
|
|
113
113
|
const m = /* @__PURE__ */ new Set();
|
|
114
114
|
function v(E) {
|
|
115
115
|
for (const p of E)
|
|
@@ -153,25 +153,25 @@ const qe = vn("ingredientForm", function() {
|
|
|
153
153
|
}
|
|
154
154
|
return V;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function i(m, v) {
|
|
157
157
|
return m.map((V) => v.has(V.id) || V.isAssigned === !0 ? {
|
|
158
158
|
...V,
|
|
159
159
|
// Recursively filter children
|
|
160
|
-
children: V.children ?
|
|
160
|
+
children: V.children ? i(V.children, v) : []
|
|
161
161
|
} : null).filter(Boolean);
|
|
162
162
|
}
|
|
163
|
-
const
|
|
163
|
+
const d = g(() => {
|
|
164
164
|
let m = k.value.subsidiaryTree;
|
|
165
165
|
if ((!m || m.length === 0) && (m = b.getBusinessSubsidiaryTree()), !U.value) {
|
|
166
166
|
const v = _(m);
|
|
167
|
-
m =
|
|
167
|
+
m = i(m, v);
|
|
168
168
|
}
|
|
169
169
|
return c(m, []);
|
|
170
170
|
});
|
|
171
171
|
return (m, v) => {
|
|
172
172
|
const V = F("FmButton"), E = F("FmDialog");
|
|
173
|
-
return
|
|
174
|
-
o(b).isEnabled ? (
|
|
173
|
+
return u(), w(X, null, [
|
|
174
|
+
o(b).isEnabled ? (u(), w("div", wn, [
|
|
175
175
|
a(V, {
|
|
176
176
|
"prepend-icon": "info",
|
|
177
177
|
variant: "tertiary",
|
|
@@ -184,13 +184,13 @@ const qe = vn("ingredientForm", function() {
|
|
|
184
184
|
"close-button": "",
|
|
185
185
|
dismissAway: ""
|
|
186
186
|
}, {
|
|
187
|
-
"dialog-header":
|
|
187
|
+
"dialog-header": y(() => [
|
|
188
188
|
l("div", Vn, [
|
|
189
189
|
l("div", In, A(o(T)("inventory.integration.netsuite.subsidiaryHierarchy.title")), 1),
|
|
190
|
-
l("p", Sn, " Name: " + A(
|
|
191
|
-
l("p", Cn, " Code: " + A(
|
|
192
|
-
U.value ? (
|
|
193
|
-
l("div",
|
|
190
|
+
l("p", Sn, " Name: " + A(s.itemName), 1),
|
|
191
|
+
l("p", Cn, " Code: " + A(s.itemCode), 1),
|
|
192
|
+
U.value ? (u(), w("p", Fn, " All subsidiaries are shown since you are an admin. ")) : (u(), w("p", An, " Only showing subsidiaries in your business path and bound subsidiaries. ")),
|
|
193
|
+
l("div", En, [
|
|
194
194
|
l("div", $n, [
|
|
195
195
|
v[2] || (v[2] = l("span", { class: "font-semibold" }, "Include Children Subsidiaries:", -1)),
|
|
196
196
|
l("span", {
|
|
@@ -205,7 +205,7 @@ const qe = vn("ingredientForm", function() {
|
|
|
205
205
|
l("span", { class: "fm-typo-en-body-sm-400" }, "Directly Bound")
|
|
206
206
|
], -1)),
|
|
207
207
|
a(He, null, {
|
|
208
|
-
default:
|
|
208
|
+
default: y(() => v[3] || (v[3] = [
|
|
209
209
|
l("div", { class: "flex items-center gap-2 px-2 py-1 rounded-md" }, [
|
|
210
210
|
l("span", { class: "w-3 h-3 rounded-sm bg-blue-400" }),
|
|
211
211
|
l("span", { class: "fm-typo-en-body-sm-400" }, "Included as Child")
|
|
@@ -217,25 +217,25 @@ const qe = vn("ingredientForm", function() {
|
|
|
217
217
|
])
|
|
218
218
|
])
|
|
219
219
|
]),
|
|
220
|
-
default:
|
|
220
|
+
default: y(() => [
|
|
221
221
|
l("div", Un, [
|
|
222
222
|
l("div", Pn, [
|
|
223
|
-
(
|
|
223
|
+
(u(!0), w(X, null, ue(d.value, (p) => (u(), w("div", {
|
|
224
224
|
key: p.id,
|
|
225
225
|
class: "flex items-stretch"
|
|
226
226
|
}, [
|
|
227
227
|
l("span", Rn, A(p.prefix), 1),
|
|
228
|
-
p.isParentIncludedChild ? (
|
|
228
|
+
p.isParentIncludedChild ? (u(), O(He, {
|
|
229
229
|
key: 0,
|
|
230
230
|
class: "flex-1"
|
|
231
231
|
}, {
|
|
232
|
-
default:
|
|
232
|
+
default: y(() => [
|
|
233
233
|
l("div", Bn, [
|
|
234
234
|
l("span", Dn, A(p.name), 1)
|
|
235
235
|
])
|
|
236
236
|
]),
|
|
237
237
|
_: 2
|
|
238
|
-
}, 1024)) : (
|
|
238
|
+
}, 1024)) : (u(), w("div", {
|
|
239
239
|
key: 1,
|
|
240
240
|
class: te([
|
|
241
241
|
"px-2 py-1 rounded-md flex-1",
|
|
@@ -259,7 +259,7 @@ const qe = vn("ingredientForm", function() {
|
|
|
259
259
|
}
|
|
260
260
|
});
|
|
261
261
|
function Nn() {
|
|
262
|
-
const { updateIngredient: W, deleteIngredient:
|
|
262
|
+
const { updateIngredient: W, deleteIngredient: s } = qe(), T = Ce(), r = Fe();
|
|
263
263
|
Re();
|
|
264
264
|
const { t: b } = ve();
|
|
265
265
|
async function S(k, n) {
|
|
@@ -269,7 +269,7 @@ function Nn() {
|
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
271
|
if (k === Me.Delete) {
|
|
272
|
-
await
|
|
272
|
+
await s(c);
|
|
273
273
|
return;
|
|
274
274
|
}
|
|
275
275
|
}
|
|
@@ -287,7 +287,7 @@ function Nn() {
|
|
|
287
287
|
size: 300,
|
|
288
288
|
cell(k) {
|
|
289
289
|
const n = k.row.original, c = T.skuBindingFlattenCache[n._id], _ = c == null ? void 0 : c.inventoryBindings.some(
|
|
290
|
-
(
|
|
290
|
+
(i) => "error" in i && i.reason === "circularDependency"
|
|
291
291
|
);
|
|
292
292
|
return Q("div", { class: "flex items-center w-full gap-4" }, [
|
|
293
293
|
_ ? Q(
|
|
@@ -313,9 +313,9 @@ function Nn() {
|
|
|
313
313
|
{
|
|
314
314
|
id: "unit",
|
|
315
315
|
header: () => b("inventory.ingredient.unit"),
|
|
316
|
-
accessorFn: (k) =>
|
|
316
|
+
accessorFn: (k) => _t(k),
|
|
317
317
|
cell(k) {
|
|
318
|
-
const n = k.row.original, c =
|
|
318
|
+
const n = k.row.original, c = _t(n);
|
|
319
319
|
return Q(
|
|
320
320
|
ze.FmTooltip,
|
|
321
321
|
{ zIndex: 51, content: c },
|
|
@@ -351,10 +351,10 @@ function Nn() {
|
|
|
351
351
|
},
|
|
352
352
|
{
|
|
353
353
|
id: "netsuiteSubsidiary",
|
|
354
|
-
accessorFn: (k) =>
|
|
354
|
+
accessorFn: (k) => r.getSkuSubsidiaries(k._id),
|
|
355
355
|
header: () => "NetSuite Subsidiary",
|
|
356
356
|
cell(k) {
|
|
357
|
-
const n = k.row.original, { flattenedSubsidiaryNames: c } =
|
|
357
|
+
const n = k.row.original, { flattenedSubsidiaryNames: c } = r.getSkuSubsidiaries(n._id);
|
|
358
358
|
return Q("div", { class: "flex gap-2 items-start" }, [
|
|
359
359
|
Q(
|
|
360
360
|
"span",
|
|
@@ -374,7 +374,7 @@ function Nn() {
|
|
|
374
374
|
header: "",
|
|
375
375
|
cell(k) {
|
|
376
376
|
return Wt(
|
|
377
|
-
[
|
|
377
|
+
[ct[Me.Edit], ct[Me.Delete]],
|
|
378
378
|
(n) => {
|
|
379
379
|
S(n, k.row.original);
|
|
380
380
|
}
|
|
@@ -389,10 +389,10 @@ function Nn() {
|
|
|
389
389
|
}
|
|
390
390
|
] };
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
var
|
|
392
|
+
function _t(W) {
|
|
393
|
+
var s;
|
|
394
394
|
if (W.trackingMeasurement) {
|
|
395
|
-
const T = (
|
|
395
|
+
const T = (s = W.unit.measurements) == null ? void 0 : s.find((r) => r.id === W.trackingMeasurement);
|
|
396
396
|
if (T)
|
|
397
397
|
return `${T.name} (${T.abbrev})`;
|
|
398
398
|
}
|
|
@@ -407,44 +407,44 @@ const zn = /* @__PURE__ */ pe({
|
|
|
407
407
|
readonly: { type: Boolean }
|
|
408
408
|
},
|
|
409
409
|
emits: ["update:modelValue"],
|
|
410
|
-
setup(W, { emit:
|
|
411
|
-
const T = W,
|
|
412
|
-
var
|
|
413
|
-
return (
|
|
414
|
-
}), b =
|
|
415
|
-
var
|
|
416
|
-
return (
|
|
417
|
-
}), S =
|
|
410
|
+
setup(W, { emit: s }) {
|
|
411
|
+
const T = W, r = g(() => {
|
|
412
|
+
var d;
|
|
413
|
+
return (d = T.rootValue) == null ? void 0 : d.unit;
|
|
414
|
+
}), b = g(() => {
|
|
415
|
+
var d;
|
|
416
|
+
return (d = T.rootValue) == null ? void 0 : d._id;
|
|
417
|
+
}), S = s, { t: U } = ve(), k = g({
|
|
418
418
|
get() {
|
|
419
419
|
return !!T.modelValue;
|
|
420
420
|
},
|
|
421
|
-
set(
|
|
422
|
-
|
|
421
|
+
set(d) {
|
|
422
|
+
d ? S("update:modelValue", {
|
|
423
423
|
measurement: null,
|
|
424
424
|
inventoryBindings: []
|
|
425
425
|
}) : S("update:modelValue", null);
|
|
426
426
|
}
|
|
427
|
-
}), n =
|
|
428
|
-
function c(
|
|
427
|
+
}), n = g(() => yn(r.value));
|
|
428
|
+
function c(d) {
|
|
429
429
|
const m = T.modelValue ?? {};
|
|
430
|
-
m.measurement =
|
|
430
|
+
m.measurement = d ? `${d}` : null, S("update:modelValue", m);
|
|
431
431
|
}
|
|
432
|
-
function _(
|
|
432
|
+
function _(d) {
|
|
433
433
|
const m = T.modelValue ?? {};
|
|
434
|
-
m.inventoryBindings =
|
|
434
|
+
m.inventoryBindings = d, S("update:modelValue", m);
|
|
435
435
|
}
|
|
436
|
-
const
|
|
436
|
+
const i = g(() => {
|
|
437
437
|
if (!T.modelValue) return null;
|
|
438
|
-
const
|
|
439
|
-
return
|
|
438
|
+
const d = T.modelValue;
|
|
439
|
+
return d.measurement ? n.value.find((m) => m.value === d.measurement) ?? null : n.value.find((m) => m.value === null) ?? null;
|
|
440
440
|
});
|
|
441
|
-
return (
|
|
441
|
+
return (d, m) => {
|
|
442
442
|
const v = F("FmSwitch"), V = F("FmSelect"), E = F("FmCard");
|
|
443
|
-
return
|
|
443
|
+
return u(), O(E, {
|
|
444
444
|
variant: "outlined",
|
|
445
445
|
class: "p-16 flex flex-col gap-16"
|
|
446
446
|
}, {
|
|
447
|
-
default:
|
|
447
|
+
default: y(() => {
|
|
448
448
|
var p, N;
|
|
449
449
|
return [
|
|
450
450
|
a(v, {
|
|
@@ -454,25 +454,25 @@ const zn = /* @__PURE__ */ pe({
|
|
|
454
454
|
label: o(U)("inventory.ingredient.convertible.title"),
|
|
455
455
|
sublabel: o(U)("inventory.ingredient.convertible.subtitle"),
|
|
456
456
|
labelPlacement: "right",
|
|
457
|
-
disabled:
|
|
457
|
+
disabled: d.readonly
|
|
458
458
|
}, null, 8, ["model-value", "label", "sublabel", "disabled"]),
|
|
459
|
-
k.value ? (
|
|
459
|
+
k.value ? (u(), w(X, { key: 0 }, [
|
|
460
460
|
l("div", null, [
|
|
461
461
|
a(V, {
|
|
462
462
|
label: o(U)("inventory.ingredient.convertible.convertTo"),
|
|
463
|
-
modelValue: (p =
|
|
463
|
+
modelValue: (p = i.value) == null ? void 0 : p.value,
|
|
464
464
|
"onUpdate:modelValue": c,
|
|
465
465
|
items: n.value,
|
|
466
|
-
disabled:
|
|
466
|
+
disabled: d.readonly
|
|
467
467
|
}, null, 8, ["label", "modelValue", "items", "disabled"])
|
|
468
468
|
]),
|
|
469
469
|
a(bn, {
|
|
470
470
|
id: b.value,
|
|
471
|
-
"model-value": ((N =
|
|
471
|
+
"model-value": ((N = d.modelValue) == null ? void 0 : N.inventoryBindings) ?? [],
|
|
472
472
|
"onUpdate:modelValue": _,
|
|
473
473
|
"exclude-binding-id": b.value,
|
|
474
474
|
rules: [o(Pe)(1)],
|
|
475
|
-
readonly:
|
|
475
|
+
readonly: d.readonly
|
|
476
476
|
}, null, 8, ["id", "model-value", "exclude-binding-id", "rules", "readonly"])
|
|
477
477
|
], 64)) : L("", !0)
|
|
478
478
|
];
|
|
@@ -484,7 +484,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
484
484
|
}), Ln = {
|
|
485
485
|
key: 0,
|
|
486
486
|
class: "flex flex-col gap-4"
|
|
487
|
-
},
|
|
487
|
+
}, jn = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Se = /* @__PURE__ */ pe({
|
|
488
488
|
__name: "FmLockableField",
|
|
489
489
|
props: {
|
|
490
490
|
locked: { type: Boolean },
|
|
@@ -494,93 +494,104 @@ const zn = /* @__PURE__ */ pe({
|
|
|
494
494
|
modelValue: {},
|
|
495
495
|
tooltipMessage: {},
|
|
496
496
|
tooltipPlacement: {},
|
|
497
|
-
tooltipZIndex: {}
|
|
497
|
+
tooltipZIndex: {},
|
|
498
|
+
appendText: {}
|
|
498
499
|
},
|
|
499
500
|
setup(W) {
|
|
500
|
-
return (
|
|
501
|
-
const
|
|
502
|
-
return
|
|
503
|
-
|
|
504
|
-
a(
|
|
505
|
-
label:
|
|
506
|
-
disabled:
|
|
501
|
+
return (s, T) => {
|
|
502
|
+
const r = F("FmLabel"), b = F("FmIcon"), S = F("FmTooltip"), U = F("FmField");
|
|
503
|
+
return s.locked ? (u(), w("div", Ln, [
|
|
504
|
+
xe(s.$slots, "label", {}, () => [
|
|
505
|
+
a(r, {
|
|
506
|
+
label: s.label,
|
|
507
|
+
disabled: s.disabled
|
|
507
508
|
}, null, 8, ["label", "disabled"])
|
|
508
509
|
]),
|
|
509
|
-
|
|
510
|
-
a(U, { disabled:
|
|
511
|
-
prepend:
|
|
512
|
-
|
|
510
|
+
xe(s.$slots, "field", {}, () => [
|
|
511
|
+
a(U, { disabled: s.disabled }, Ye({
|
|
512
|
+
prepend: y(() => [
|
|
513
|
+
s.tooltipMessage ? (u(), O(S, {
|
|
513
514
|
key: 0,
|
|
514
|
-
placement:
|
|
515
|
-
"z-index":
|
|
515
|
+
placement: s.tooltipPlacement,
|
|
516
|
+
"z-index": s.tooltipZIndex
|
|
516
517
|
}, {
|
|
517
|
-
content:
|
|
518
|
-
|
|
518
|
+
content: y(() => [
|
|
519
|
+
Ge(A(s.tooltipMessage), 1)
|
|
519
520
|
]),
|
|
520
|
-
default:
|
|
521
|
+
default: y(() => [
|
|
521
522
|
a(b, {
|
|
522
523
|
name: "lock",
|
|
523
524
|
color: "neutral-gray-400"
|
|
524
525
|
})
|
|
525
526
|
]),
|
|
526
527
|
_: 1
|
|
527
|
-
}, 8, ["placement", "z-index"])) : (
|
|
528
|
+
}, 8, ["placement", "z-index"])) : (u(), O(b, {
|
|
528
529
|
key: 1,
|
|
529
530
|
name: "lock",
|
|
530
531
|
color: "neutral-gray-400"
|
|
531
532
|
}))
|
|
532
533
|
]),
|
|
533
|
-
default:
|
|
534
|
-
|
|
534
|
+
default: y(() => [
|
|
535
|
+
xe(s.$slots, "modelValue", {}, () => [
|
|
535
536
|
l("div", {
|
|
536
537
|
class: te([
|
|
537
|
-
|
|
538
|
+
s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary",
|
|
538
539
|
"line-clamp-1 text-ellipsis break-all"
|
|
539
540
|
])
|
|
540
|
-
}, A(
|
|
541
|
+
}, A(s.modelValue), 3)
|
|
541
542
|
])
|
|
542
543
|
]),
|
|
543
|
-
_:
|
|
544
|
-
},
|
|
544
|
+
_: 2
|
|
545
|
+
}, [
|
|
546
|
+
s.appendText || s.$slots.fieldAppend ? {
|
|
547
|
+
name: "append",
|
|
548
|
+
fn: y(() => [
|
|
549
|
+
xe(s.$slots, "fieldAppend", {}, () => [
|
|
550
|
+
l("div", jn, A(s.appendText), 1)
|
|
551
|
+
])
|
|
552
|
+
]),
|
|
553
|
+
key: "0"
|
|
554
|
+
} : void 0
|
|
555
|
+
]), 1032, ["disabled"])
|
|
545
556
|
]),
|
|
546
|
-
|
|
557
|
+
xe(s.$slots, "helper-text", {}, () => [
|
|
547
558
|
l("div", {
|
|
548
559
|
class: te([
|
|
549
560
|
"fm-typo-en-body-sm-400 line-clamp-1",
|
|
550
|
-
|
|
561
|
+
s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
|
|
551
562
|
])
|
|
552
|
-
}, A(
|
|
563
|
+
}, A(s.helperText), 3)
|
|
553
564
|
])
|
|
554
|
-
])) :
|
|
565
|
+
])) : xe(s.$slots, "default", { key: 1 });
|
|
555
566
|
};
|
|
556
567
|
}
|
|
557
|
-
}),
|
|
568
|
+
}), Wn = { class: "flex gap-8" }, Hn = { class: "flex-1" }, qn = { class: "flex-1" }, Yn = { class: "flex flex-col gap-5" }, Gn = { class: "text-fm-color-typo-secondary" }, Kn = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Jn = {
|
|
558
569
|
key: 3,
|
|
559
570
|
class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
|
|
560
|
-
},
|
|
571
|
+
}, Zn = { class: "flex flex-col" }, Qn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Xn = {
|
|
561
572
|
key: 4,
|
|
562
573
|
class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
|
|
563
|
-
},
|
|
574
|
+
}, el = { class: "flex flex-col gap-12" }, tl = { class: "flex flex-col gap-4" }, nl = { class: "fm-typo-en-title-sm-600" }, ll = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ol = { class: "flex flex-col gap-4" }, al = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, sl = { class: "flex-1 p-12 flex flex-col gap-8" }, rl = { class: "mx-auto" }, il = { class: "flex flex-col" }, dl = { class: "fm-typo-en-body-sm-600 translate-y-4" }, ul = { class: "flex-1 p-12 flex flex-col gap-8" }, cl = { class: "mx-auto" }, ml = { class: "flex flex-col" }, pl = { class: "fm-typo-en-body-sm-600 translate-y-4" }, vl = { class: "flex-1 p-12 flex flex-col gap-8" }, fl = { class: "mx-auto" }, yl = { class: "flex flex-col" }, gl = { class: "fm-typo-en-body-sm-600 translate-y-4" }, bl = {
|
|
564
575
|
key: 5,
|
|
565
576
|
class: "flex flex-col gap-12"
|
|
566
|
-
},
|
|
577
|
+
}, hl = { class: "flex flex-col" }, _l = { class: "flex items-center justify-between" }, xl = { class: "fm-typo-en-title-sm-600" }, kl = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Tl = {
|
|
567
578
|
key: 0,
|
|
568
579
|
class: "flex flex-col gap-8"
|
|
569
|
-
},
|
|
580
|
+
}, wl = { class: "flex flex-wrap gap-8" }, Vl = {
|
|
570
581
|
key: 6,
|
|
571
582
|
class: "flex flex-col gap-12"
|
|
572
|
-
},
|
|
583
|
+
}, Il = { class: "flex flex-col" }, Sl = { class: "flex items-center justify-between" }, Cl = { class: "fm-typo-en-title-sm-600" }, Fl = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Al = {
|
|
573
584
|
key: 0,
|
|
574
585
|
class: "flex flex-col gap-8"
|
|
575
|
-
}, El = { class: "flex flex-wrap gap-8" },
|
|
586
|
+
}, El = { class: "flex flex-wrap gap-8" }, $l = {
|
|
576
587
|
key: 7,
|
|
577
588
|
class: "flex flex-col gap-12"
|
|
578
|
-
},
|
|
589
|
+
}, Ml = { class: "flex flex-col" }, Ul = { class: "flex items-center justify-between" }, Pl = { class: "fm-typo-en-title-sm-600" }, Rl = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Bl = {
|
|
579
590
|
key: 0,
|
|
580
591
|
class: "flex flex-col gap-8"
|
|
581
|
-
},
|
|
592
|
+
}, Dl = { class: "flex flex-wrap gap-8" }, Ol = /* @__PURE__ */ pe({
|
|
582
593
|
__name: "IngredientForm",
|
|
583
|
-
props: /* @__PURE__ */
|
|
594
|
+
props: /* @__PURE__ */ it({
|
|
584
595
|
mode: {},
|
|
585
596
|
modelValue: {},
|
|
586
597
|
disabled: { type: Boolean },
|
|
@@ -591,12 +602,12 @@ const zn = /* @__PURE__ */ pe({
|
|
|
591
602
|
search: {},
|
|
592
603
|
searchModifiers: {}
|
|
593
604
|
}),
|
|
594
|
-
emits: /* @__PURE__ */
|
|
595
|
-
setup(W, { expose:
|
|
596
|
-
var
|
|
597
|
-
const { t:
|
|
598
|
-
|
|
599
|
-
const S = St(), U = wt(), k = Ct(), n = W, c = T, _ =
|
|
605
|
+
emits: /* @__PURE__ */ it(["update:modelValue", "click:submit", "update:purchaseOrderTemplateIds", "update:wastageTemplateIds", "update:closingTemplateIds"], ["update:search"]),
|
|
606
|
+
setup(W, { expose: s, emit: T }) {
|
|
607
|
+
var et;
|
|
608
|
+
const { t: r } = ve(), b = Re();
|
|
609
|
+
Ae();
|
|
610
|
+
const S = St(), U = wt(), k = Ct(), n = W, c = T, _ = Ce(), i = It(), d = Vt(), m = Fe(), v = g(() => m.isEnabled);
|
|
600
611
|
B(void 0);
|
|
601
612
|
const V = B([]), E = B([]), p = B([]), N = B(!1);
|
|
602
613
|
function D(e) {
|
|
@@ -607,8 +618,8 @@ const zn = /* @__PURE__ */ pe({
|
|
|
607
618
|
x.unit || (x.unit = t, c("update:modelValue", x));
|
|
608
619
|
}
|
|
609
620
|
Dt(() => {
|
|
610
|
-
D(_.units), n.mode === H.CREATE && (
|
|
611
|
-
}),
|
|
621
|
+
D(_.units), n.mode === H.CREATE && (d.mustUsePoTemplate && ne(), d.enableWastageTemplate && ce(), d.enableClosingTemplate && le());
|
|
622
|
+
}), kt([() => _.units], ([e]) => {
|
|
612
623
|
D(e);
|
|
613
624
|
});
|
|
614
625
|
function fe() {
|
|
@@ -651,7 +662,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
651
662
|
N.value = !1;
|
|
652
663
|
}
|
|
653
664
|
}
|
|
654
|
-
const oe =
|
|
665
|
+
const oe = g({
|
|
655
666
|
get() {
|
|
656
667
|
var e;
|
|
657
668
|
return ((e = n.modelValue) == null ? void 0 : e.code) ?? "";
|
|
@@ -662,7 +673,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
662
673
|
} : {};
|
|
663
674
|
t.code = e, c("update:modelValue", t);
|
|
664
675
|
}
|
|
665
|
-
}), ee =
|
|
676
|
+
}), ee = g({
|
|
666
677
|
get() {
|
|
667
678
|
var e;
|
|
668
679
|
return ((e = n.modelValue) == null ? void 0 : e.isInactive) ?? !1;
|
|
@@ -673,7 +684,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
673
684
|
} : {};
|
|
674
685
|
t.isInactive = e, c("update:modelValue", t);
|
|
675
686
|
}
|
|
676
|
-
}), ae =
|
|
687
|
+
}), ae = g({
|
|
677
688
|
get() {
|
|
678
689
|
var e;
|
|
679
690
|
return ((e = n.modelValue) == null ? void 0 : e.name) ?? "";
|
|
@@ -684,7 +695,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
684
695
|
} : {};
|
|
685
696
|
t.name = e, c("update:modelValue", t);
|
|
686
697
|
}
|
|
687
|
-
}), ye =
|
|
698
|
+
}), ye = g({
|
|
688
699
|
get() {
|
|
689
700
|
var t, x;
|
|
690
701
|
const e = (x = (t = n.modelValue) == null ? void 0 : t.defaultCost) == null ? void 0 : x.costPerUnit;
|
|
@@ -699,7 +710,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
699
710
|
costPerUnit: {
|
|
700
711
|
amount: 0,
|
|
701
712
|
precision: 2,
|
|
702
|
-
currency: ((x =
|
|
713
|
+
currency: ((x = mt(i.currentCountry.value)) == null ? void 0 : x.currency) ?? "MYR"
|
|
703
714
|
},
|
|
704
715
|
measurement: (z = (Y = (C = n.modelValue) == null ? void 0 : C.unit) == null ? void 0 : Y.measurements) == null ? void 0 : z.find(
|
|
705
716
|
(re) => {
|
|
@@ -712,7 +723,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
712
723
|
...qt(+e, 4)
|
|
713
724
|
}, c("update:modelValue", t);
|
|
714
725
|
}
|
|
715
|
-
}), ge =
|
|
726
|
+
}), ge = g(() => {
|
|
716
727
|
var t, x, C;
|
|
717
728
|
const e = ((t = n.modelValue) == null ? void 0 : t.unit) ?? _.units.find((Y) => Y);
|
|
718
729
|
return e ? {
|
|
@@ -723,7 +734,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
723
734
|
return Y.id === ((z = n.modelValue) == null ? void 0 : z.trackingMeasurement);
|
|
724
735
|
})) == null ? void 0 : C.name) ?? e.name
|
|
725
736
|
} : null;
|
|
726
|
-
}),
|
|
737
|
+
}), ke = g(
|
|
727
738
|
() => _.units.flatMap(({ name: e, _id: t, abbrev: x, measurements: C }) => [
|
|
728
739
|
{
|
|
729
740
|
label: `${e}`,
|
|
@@ -741,12 +752,12 @@ const zn = /* @__PURE__ */ pe({
|
|
|
741
752
|
displayAsSection: !1
|
|
742
753
|
}))
|
|
743
754
|
])
|
|
744
|
-
), h = Ot(W, "search"), P =
|
|
745
|
-
() => new Yt(
|
|
755
|
+
), h = Ot(W, "search"), P = g(
|
|
756
|
+
() => new Yt(ke.value, ["label", "value"], {
|
|
746
757
|
caseSensitive: !1,
|
|
747
758
|
sort: !0
|
|
748
759
|
})
|
|
749
|
-
), G =
|
|
760
|
+
), G = g(() => P.value.search(h.value));
|
|
750
761
|
function $(e) {
|
|
751
762
|
var t, x, C, Y, z;
|
|
752
763
|
return ((x = (t = n.modelValue) == null ? void 0 : t.unit) == null ? void 0 : x._id) === ((C = e.value) == null ? void 0 : C._id) && ((Y = n.modelValue) == null ? void 0 : Y.trackingMeasurement) === ((z = e.value) == null ? void 0 : z.measurement);
|
|
@@ -754,22 +765,22 @@ const zn = /* @__PURE__ */ pe({
|
|
|
754
765
|
function f(e) {
|
|
755
766
|
var re, ie;
|
|
756
767
|
if (!e) return;
|
|
757
|
-
const { _id: t, measurement: x } = e, C = x || void 0, Y = _.units.find((
|
|
768
|
+
const { _id: t, measurement: x } = e, C = x || void 0, Y = _.units.find((Ie) => Ie._id === t);
|
|
758
769
|
if (!Y)
|
|
759
770
|
return;
|
|
760
771
|
const z = n.modelValue ?? {};
|
|
761
|
-
z.unit = Y, z.trackingMeasurement = C, z.convert && (z.convert.measurement = C || null),
|
|
762
|
-
measurement: Y.measurements.find((
|
|
772
|
+
z.unit = Y, z.trackingMeasurement = C, z.convert && (z.convert.measurement = C || null), d.enableTotalCost && (z.defaultCost = {
|
|
773
|
+
measurement: Y.measurements.find((Ie) => Ie.id === C),
|
|
763
774
|
costPerUnit: {
|
|
764
775
|
...((re = z.defaultCost) == null ? void 0 : re.costPerUnit) ?? {
|
|
765
776
|
amount: 0,
|
|
766
777
|
precision: 2,
|
|
767
|
-
currency: ((ie =
|
|
778
|
+
currency: ((ie = mt(i.currentCountry.value)) == null ? void 0 : ie.currency) ?? "MYR"
|
|
768
779
|
}
|
|
769
780
|
}
|
|
770
781
|
}), c("update:modelValue", z);
|
|
771
782
|
}
|
|
772
|
-
const j =
|
|
783
|
+
const j = g({
|
|
773
784
|
get() {
|
|
774
785
|
var e;
|
|
775
786
|
return ((e = n.modelValue) == null ? void 0 : e.convert) ?? null;
|
|
@@ -780,15 +791,15 @@ const zn = /* @__PURE__ */ pe({
|
|
|
780
791
|
} : {};
|
|
781
792
|
e ? t.convert = e : t.convert = null, c("update:modelValue", t);
|
|
782
793
|
}
|
|
783
|
-
}), K =
|
|
794
|
+
}), K = g(() => pt.options.filter(
|
|
784
795
|
(e) => (
|
|
785
796
|
// e === F_INVENTORY_VALUATION_METHODS.enum.FIFO ||
|
|
786
|
-
e ===
|
|
797
|
+
e === pt.enum.WAVG
|
|
787
798
|
)
|
|
788
799
|
).map((e) => ({
|
|
789
|
-
label:
|
|
800
|
+
label: r(`inventory.ingredient.valuationMethod.${e}`),
|
|
790
801
|
value: e
|
|
791
|
-
}))), me =
|
|
802
|
+
}))), me = g({
|
|
792
803
|
get() {
|
|
793
804
|
var e;
|
|
794
805
|
return ((e = n.modelValue) == null ? void 0 : e.valuation) ?? "WAVG";
|
|
@@ -799,7 +810,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
799
810
|
} : {};
|
|
800
811
|
t.valuation = e, c("update:modelValue", t);
|
|
801
812
|
}
|
|
802
|
-
}), J =
|
|
813
|
+
}), J = g({
|
|
803
814
|
get() {
|
|
804
815
|
var e;
|
|
805
816
|
return ((e = n.modelValue) == null ? void 0 : e.customAttributes) ?? {};
|
|
@@ -811,7 +822,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
811
822
|
t.customAttributes = e, c("update:modelValue", t);
|
|
812
823
|
}
|
|
813
824
|
}), M = B();
|
|
814
|
-
|
|
825
|
+
s({
|
|
815
826
|
validateInputs: () => {
|
|
816
827
|
var e, t;
|
|
817
828
|
(t = (e = M.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
|
|
@@ -825,34 +836,34 @@ const zn = /* @__PURE__ */ pe({
|
|
|
825
836
|
(t = (e = M.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
|
|
826
837
|
}
|
|
827
838
|
});
|
|
828
|
-
const R = B(!1), q =
|
|
839
|
+
const R = B(!1), q = g(
|
|
829
840
|
() => {
|
|
830
841
|
var e, t, x;
|
|
831
842
|
return (e = n.modelValue) != null && e._id ? ((x = _.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : x.filter(
|
|
832
843
|
(C) => C.from === "INGREDIENT"
|
|
833
844
|
)) ?? [] : [];
|
|
834
845
|
}
|
|
835
|
-
), de =
|
|
846
|
+
), de = g(
|
|
836
847
|
() => {
|
|
837
848
|
var e, t, x;
|
|
838
849
|
return (e = n.modelValue) != null && e._id ? ((x = _.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : x.filter(
|
|
839
850
|
(C) => C.from === "RECIPE"
|
|
840
851
|
)) ?? [] : [];
|
|
841
852
|
}
|
|
842
|
-
),
|
|
853
|
+
), Te = g(
|
|
843
854
|
() => {
|
|
844
855
|
var e, t, x;
|
|
845
856
|
return (e = n.modelValue) != null && e._id ? ((x = _.menu.bindedBySkuId[(t = n.modelValue) == null ? void 0 : t._id]) == null ? void 0 : x.filter((C) => C.from === "MENU")) ?? [] : [];
|
|
846
857
|
}
|
|
847
|
-
), _e =
|
|
858
|
+
), _e = g(
|
|
848
859
|
() => _.skus.map((e) => ({ label: e.name, value: e.code }))
|
|
849
|
-
), Ee = B((
|
|
850
|
-
function
|
|
860
|
+
), Ee = B((et = n.modelValue) == null ? void 0 : et.code);
|
|
861
|
+
function $e(e) {
|
|
851
862
|
var x;
|
|
852
863
|
const t = e.el;
|
|
853
864
|
t && ((x = t.querySelector("[x-should-scroll-into=true]")) == null || x.scrollIntoView());
|
|
854
865
|
}
|
|
855
|
-
const
|
|
866
|
+
const we = g(
|
|
856
867
|
() => {
|
|
857
868
|
var e, t, x, C, Y, z;
|
|
858
869
|
return ((C = (x = (t = (e = n.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : x.find(
|
|
@@ -862,7 +873,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
862
873
|
}
|
|
863
874
|
)) == null ? void 0 : C.abbrev) ?? ((z = (Y = n.modelValue) == null ? void 0 : Y.unit) == null ? void 0 : z.abbrev);
|
|
864
875
|
}
|
|
865
|
-
), be =
|
|
876
|
+
), be = g({
|
|
866
877
|
get() {
|
|
867
878
|
var e, t;
|
|
868
879
|
return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.low) ?? Ue().low;
|
|
@@ -876,7 +887,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
876
887
|
} : {};
|
|
877
888
|
x.thresholds = t, c("update:modelValue", x);
|
|
878
889
|
}
|
|
879
|
-
}), se =
|
|
890
|
+
}), se = g({
|
|
880
891
|
get() {
|
|
881
892
|
var e, t;
|
|
882
893
|
return ((t = (e = n.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.mid) ?? Ue().mid;
|
|
@@ -890,37 +901,37 @@ const zn = /* @__PURE__ */ pe({
|
|
|
890
901
|
} : {};
|
|
891
902
|
x.thresholds = t, c("update:modelValue", x);
|
|
892
903
|
}
|
|
893
|
-
}),
|
|
904
|
+
}), Ve = g(() => d.mustUsePoTemplate && n.mode === H.CREATE && V.value.length > 0 ? V.value.map((e) => ({
|
|
894
905
|
label: e.name || "Template",
|
|
895
906
|
value: e._id || "template_" + e.name
|
|
896
|
-
})) : []),
|
|
907
|
+
})) : []), Ke = g(() => Ve.value.filter(
|
|
897
908
|
(e) => (n.purchaseOrderTemplateIds ?? []).includes(e.value)
|
|
898
|
-
)),
|
|
909
|
+
)), Je = g(() => d.enableWastageTemplate && n.mode === H.CREATE && E.value.length > 0 ? E.value.map((e) => ({
|
|
899
910
|
label: e.name || "Template",
|
|
900
911
|
value: e._id || "template_" + e.name
|
|
901
|
-
})) : []),
|
|
912
|
+
})) : []), Ze = g(() => Je.value.filter(
|
|
902
913
|
(e) => (n.wastageTemplateIds ?? []).includes(e.value)
|
|
903
|
-
)),
|
|
914
|
+
)), Qe = g(() => d.enableClosingTemplate && n.mode === H.CREATE && p.value.length > 0 ? p.value.map((e) => ({
|
|
904
915
|
label: e.name || "Template",
|
|
905
916
|
value: e._id || "template_" + e.name
|
|
906
|
-
})) : []),
|
|
917
|
+
})) : []), Xe = g(() => Qe.value.filter(
|
|
907
918
|
(e) => (n.closingTemplateIds ?? []).includes(e.value)
|
|
908
919
|
));
|
|
909
920
|
function Ft() {
|
|
910
921
|
b.open({
|
|
911
|
-
title:
|
|
922
|
+
title: r("inventory.ingredient.purchaseOrderTemplates.selectTitle"),
|
|
912
923
|
closeButton: !0,
|
|
913
924
|
contentComponent: Ne,
|
|
914
925
|
contentComponentProps: {
|
|
915
926
|
modelValue: n.purchaseOrderTemplateIds ?? [],
|
|
916
|
-
items:
|
|
927
|
+
items: Ve.value
|
|
917
928
|
},
|
|
918
929
|
primaryActions: {
|
|
919
|
-
text:
|
|
930
|
+
text: r("common.confirm"),
|
|
920
931
|
close: !0
|
|
921
932
|
},
|
|
922
933
|
secondaryActions: {
|
|
923
|
-
text:
|
|
934
|
+
text: r("common.cancel"),
|
|
924
935
|
close: !0,
|
|
925
936
|
variant: "tertiary"
|
|
926
937
|
}
|
|
@@ -928,21 +939,21 @@ const zn = /* @__PURE__ */ pe({
|
|
|
928
939
|
c("update:purchaseOrderTemplateIds", e);
|
|
929
940
|
});
|
|
930
941
|
}
|
|
931
|
-
function
|
|
942
|
+
function At() {
|
|
932
943
|
b.open({
|
|
933
|
-
title:
|
|
944
|
+
title: r("inventory.ingredient.wastageTemplates.selectTitle"),
|
|
934
945
|
closeButton: !0,
|
|
935
946
|
contentComponent: Ne,
|
|
936
947
|
contentComponentProps: {
|
|
937
948
|
modelValue: n.wastageTemplateIds ?? [],
|
|
938
|
-
items:
|
|
949
|
+
items: Je.value
|
|
939
950
|
},
|
|
940
951
|
primaryActions: {
|
|
941
|
-
text:
|
|
952
|
+
text: r("common.confirm"),
|
|
942
953
|
close: !0
|
|
943
954
|
},
|
|
944
955
|
secondaryActions: {
|
|
945
|
-
text:
|
|
956
|
+
text: r("common.cancel"),
|
|
946
957
|
close: !0,
|
|
947
958
|
variant: "tertiary"
|
|
948
959
|
}
|
|
@@ -950,21 +961,21 @@ const zn = /* @__PURE__ */ pe({
|
|
|
950
961
|
c("update:wastageTemplateIds", e);
|
|
951
962
|
});
|
|
952
963
|
}
|
|
953
|
-
function
|
|
964
|
+
function Et() {
|
|
954
965
|
b.open({
|
|
955
|
-
title:
|
|
966
|
+
title: r("inventory.ingredient.closingTemplates.selectTitle"),
|
|
956
967
|
closeButton: !0,
|
|
957
968
|
contentComponent: Ne,
|
|
958
969
|
contentComponentProps: {
|
|
959
970
|
modelValue: n.closingTemplateIds ?? [],
|
|
960
|
-
items:
|
|
971
|
+
items: Qe.value
|
|
961
972
|
},
|
|
962
973
|
primaryActions: {
|
|
963
|
-
text:
|
|
974
|
+
text: r("common.confirm"),
|
|
964
975
|
close: !0
|
|
965
976
|
},
|
|
966
977
|
secondaryActions: {
|
|
967
|
-
text:
|
|
978
|
+
text: r("common.cancel"),
|
|
968
979
|
close: !0,
|
|
969
980
|
variant: "tertiary"
|
|
970
981
|
}
|
|
@@ -978,31 +989,31 @@ const zn = /* @__PURE__ */ pe({
|
|
|
978
989
|
};
|
|
979
990
|
}
|
|
980
991
|
return (e, t) => {
|
|
981
|
-
const x = F("FmTextField"), C = F("FmLabel"), Y = F("FmField"), z = F("FmIcon"), re = F("FmMenuHeader"), ie = F("FmMenuDivider"),
|
|
982
|
-
return
|
|
992
|
+
const x = F("FmTextField"), C = F("FmLabel"), Y = F("FmField"), z = F("FmIcon"), re = F("FmMenuHeader"), ie = F("FmMenuDivider"), Ie = F("FmMenuItem"), Mt = F("FmMenu"), tt = F("FmFormGroup"), Ut = F("FmSelect"), nt = F("FmSwitch"), lt = F("FmStepperField"), Be = F("FmButton"), De = F("FmChip"), Pt = F("FmForm");
|
|
993
|
+
return u(), O(Pt, {
|
|
983
994
|
disabled: e.disabled,
|
|
984
995
|
ref_key: "formRef",
|
|
985
996
|
ref: M,
|
|
986
997
|
class: "flex flex-col gap-32",
|
|
987
998
|
onValidationSuccess: fe
|
|
988
999
|
}, {
|
|
989
|
-
default:
|
|
990
|
-
var
|
|
1000
|
+
default: y(() => {
|
|
1001
|
+
var ot, at, st, rt;
|
|
991
1002
|
return [
|
|
992
|
-
l("div",
|
|
993
|
-
l("div",
|
|
994
|
-
a(
|
|
1003
|
+
l("div", Wn, [
|
|
1004
|
+
l("div", Hn, [
|
|
1005
|
+
a(Se, {
|
|
995
1006
|
"tooltip-message": "This field is managed by NetSuite",
|
|
996
1007
|
"tooltip-z-index": 50,
|
|
997
|
-
label: o(
|
|
1008
|
+
label: o(r)("inventory.ingredient.code"),
|
|
998
1009
|
"model-value": oe.value,
|
|
999
1010
|
"onUpdate:modelValue": t[1] || (t[1] = (I) => oe.value = I),
|
|
1000
1011
|
locked: v.value,
|
|
1001
1012
|
disabled: e.disabled
|
|
1002
1013
|
}, {
|
|
1003
|
-
default:
|
|
1014
|
+
default: y(() => [
|
|
1004
1015
|
a(x, {
|
|
1005
|
-
label: o(
|
|
1016
|
+
label: o(r)("inventory.ingredient.code"),
|
|
1006
1017
|
"model-value": oe.value,
|
|
1007
1018
|
"onUpdate:modelValue": t[0] || (t[0] = (I) => oe.value = I),
|
|
1008
1019
|
rules: [o(Oe)(), o(Gt)(_e.value, Ee.value)],
|
|
@@ -1012,19 +1023,19 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1012
1023
|
_: 1
|
|
1013
1024
|
}, 8, ["label", "model-value", "locked", "disabled"])
|
|
1014
1025
|
]),
|
|
1015
|
-
l("div",
|
|
1016
|
-
a(
|
|
1026
|
+
l("div", qn, [
|
|
1027
|
+
a(Se, {
|
|
1017
1028
|
"tooltip-message": "This field is managed by NetSuite",
|
|
1018
1029
|
"tooltip-z-index": 50,
|
|
1019
|
-
label: o(
|
|
1030
|
+
label: o(r)("inventory.ingredient.name"),
|
|
1020
1031
|
"model-value": ae.value,
|
|
1021
1032
|
"onUpdate:modelValue": t[3] || (t[3] = (I) => ae.value = I),
|
|
1022
1033
|
locked: v.value,
|
|
1023
1034
|
disabled: e.disabled
|
|
1024
1035
|
}, {
|
|
1025
|
-
default:
|
|
1036
|
+
default: y(() => [
|
|
1026
1037
|
a(x, {
|
|
1027
|
-
label: o(
|
|
1038
|
+
label: o(r)("inventory.ingredient.name"),
|
|
1028
1039
|
"model-value": ae.value,
|
|
1029
1040
|
"onUpdate:modelValue": t[2] || (t[2] = (I) => ae.value = I),
|
|
1030
1041
|
rules: [o(Oe)()],
|
|
@@ -1035,29 +1046,29 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1035
1046
|
}, 8, ["label", "model-value", "locked", "disabled"])
|
|
1036
1047
|
])
|
|
1037
1048
|
]),
|
|
1038
|
-
a(
|
|
1049
|
+
a(Se, {
|
|
1039
1050
|
"tooltip-message": "This field is managed by NetSuite",
|
|
1040
1051
|
"tooltip-z-index": 50,
|
|
1041
|
-
label: o(
|
|
1042
|
-
"helper-text": (
|
|
1043
|
-
"model-value": (
|
|
1052
|
+
label: o(r)("inventory.ingredient.unit"),
|
|
1053
|
+
"helper-text": (ot = e.modelValue) != null && ot.trackingMeasurement ? `Base unit: ${(st = (at = e.modelValue) == null ? void 0 : at.unit) == null ? void 0 : st.name}` : void 0,
|
|
1054
|
+
"model-value": (rt = ge.value) == null ? void 0 : rt.name,
|
|
1044
1055
|
locked: v.value,
|
|
1045
1056
|
disabled: e.disabled
|
|
1046
1057
|
}, {
|
|
1047
|
-
default:
|
|
1048
|
-
a(
|
|
1058
|
+
default: y(() => [
|
|
1059
|
+
a(tt, {
|
|
1049
1060
|
"model-value": ge.value,
|
|
1050
1061
|
rules: [o(Oe)()],
|
|
1051
1062
|
"label-mark": "required"
|
|
1052
1063
|
}, {
|
|
1053
|
-
label:
|
|
1064
|
+
label: y(() => [
|
|
1054
1065
|
a(C, {
|
|
1055
|
-
label: o(
|
|
1066
|
+
label: o(r)("inventory.ingredient.unit")
|
|
1056
1067
|
}, null, 8, ["label"])
|
|
1057
1068
|
]),
|
|
1058
|
-
default:
|
|
1069
|
+
default: y(({ invalid: I }) => [
|
|
1059
1070
|
a(Mt, null, {
|
|
1060
|
-
"menu-button":
|
|
1071
|
+
"menu-button": y(() => [
|
|
1061
1072
|
a(Y, {
|
|
1062
1073
|
class: te([
|
|
1063
1074
|
"fm-typo-en-body-lg-400",
|
|
@@ -1069,42 +1080,42 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1069
1080
|
invalid: I,
|
|
1070
1081
|
"append-icon": "expand_more"
|
|
1071
1082
|
}, {
|
|
1072
|
-
default:
|
|
1083
|
+
default: y(() => {
|
|
1073
1084
|
var Z;
|
|
1074
1085
|
return [
|
|
1075
|
-
|
|
1086
|
+
Ge(A((Z = ge.value) == null ? void 0 : Z.name), 1)
|
|
1076
1087
|
];
|
|
1077
1088
|
}),
|
|
1078
1089
|
_: 2
|
|
1079
1090
|
}, 1032, ["class", "invalid"])
|
|
1080
1091
|
]),
|
|
1081
|
-
default:
|
|
1082
|
-
l("div",
|
|
1092
|
+
default: y(() => [
|
|
1093
|
+
l("div", Yn, [
|
|
1083
1094
|
a(x, {
|
|
1084
1095
|
modelValue: h.value,
|
|
1085
1096
|
"onUpdate:modelValue": t[4] || (t[4] = (Z) => h.value = Z),
|
|
1086
1097
|
placeholder: "Filter options"
|
|
1087
1098
|
}, {
|
|
1088
|
-
prepend:
|
|
1099
|
+
prepend: y(() => [
|
|
1089
1100
|
a(z, { name: "search" })
|
|
1090
1101
|
]),
|
|
1091
1102
|
_: 1
|
|
1092
1103
|
}, 8, ["modelValue"]),
|
|
1093
1104
|
l("div", {
|
|
1094
1105
|
class: "overflow-x-hidden overflow-y-auto max-h-[300px]",
|
|
1095
|
-
onVnodeMounted:
|
|
1106
|
+
onVnodeMounted: $e
|
|
1096
1107
|
}, [
|
|
1097
|
-
(
|
|
1098
|
-
Z.displayAsSection ? (
|
|
1108
|
+
(u(!0), w(X, null, ue(G.value, (Z, Rt) => (u(), w(X, { key: Rt }, [
|
|
1109
|
+
Z.displayAsSection ? (u(), w(X, { key: 0 }, [
|
|
1099
1110
|
a(re, {
|
|
1100
1111
|
label: Z.label
|
|
1101
1112
|
}, null, 8, ["label"]),
|
|
1102
1113
|
a(ie)
|
|
1103
|
-
], 64)) : (
|
|
1114
|
+
], 64)) : (u(), O(Ie, {
|
|
1104
1115
|
key: 1,
|
|
1105
1116
|
label: Z.label,
|
|
1106
1117
|
"model-value": $(Z),
|
|
1107
|
-
onClick: (
|
|
1118
|
+
onClick: (co) => f(Z.value),
|
|
1108
1119
|
"x-should-scroll-into": `${$(Z)}`
|
|
1109
1120
|
}, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
|
|
1110
1121
|
], 64))), 128))
|
|
@@ -1119,29 +1130,29 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1119
1130
|
]),
|
|
1120
1131
|
_: 1
|
|
1121
1132
|
}, 8, ["label", "helper-text", "model-value", "locked", "disabled"]),
|
|
1122
|
-
o(
|
|
1133
|
+
o(d).enableTotalCost ? (u(), O(Se, {
|
|
1123
1134
|
key: 0,
|
|
1124
1135
|
"tooltip-message": "This field is managed by NetSuite",
|
|
1125
1136
|
"tooltip-z-index": 50,
|
|
1126
|
-
label: o(
|
|
1127
|
-
"model-value": o(
|
|
1137
|
+
label: o(r)("inventory.ingredient.valuationMethod.title"),
|
|
1138
|
+
"model-value": o(r)("inventory.ingredient.valuationMethod." + me.value),
|
|
1128
1139
|
locked: v.value,
|
|
1129
1140
|
disabled: e.disabled
|
|
1130
1141
|
}, {
|
|
1131
|
-
label:
|
|
1142
|
+
label: y(() => [
|
|
1132
1143
|
a(he, { "z-index": 50 }, {
|
|
1133
|
-
default:
|
|
1144
|
+
default: y(() => [
|
|
1134
1145
|
a(C, {
|
|
1135
|
-
label: o(
|
|
1146
|
+
label: o(r)("inventory.ingredient.valuationMethod.title")
|
|
1136
1147
|
}, null, 8, ["label"])
|
|
1137
1148
|
]),
|
|
1138
1149
|
_: 1
|
|
1139
1150
|
})
|
|
1140
1151
|
]),
|
|
1141
|
-
default:
|
|
1152
|
+
default: y(() => [
|
|
1142
1153
|
a(Ut, {
|
|
1143
1154
|
class: "col-span-2",
|
|
1144
|
-
label: o(
|
|
1155
|
+
label: o(r)("inventory.ingredient.valuationMethod.title"),
|
|
1145
1156
|
"model-value": me.value,
|
|
1146
1157
|
"onUpdate:modelValue": t[5] || (t[5] = (I) => me.value = I),
|
|
1147
1158
|
items: K.value
|
|
@@ -1149,129 +1160,130 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1149
1160
|
]),
|
|
1150
1161
|
_: 1
|
|
1151
1162
|
}, 8, ["label", "model-value", "locked", "disabled"])) : L("", !0),
|
|
1152
|
-
o(
|
|
1163
|
+
o(d).enableTotalCost ? (u(), O(Se, {
|
|
1153
1164
|
key: 1,
|
|
1154
1165
|
"tooltip-message": "This field is managed by NetSuite",
|
|
1155
1166
|
"tooltip-z-index": 50,
|
|
1156
1167
|
"model-value": `${o(Kt)()} ${ye.value}`,
|
|
1157
1168
|
locked: v.value,
|
|
1169
|
+
"append-text": `/ ${we.value}`,
|
|
1158
1170
|
disabled: e.disabled
|
|
1159
1171
|
}, {
|
|
1160
|
-
label:
|
|
1172
|
+
label: y(() => [
|
|
1161
1173
|
a(he, { "z-index": 50 }, {
|
|
1162
|
-
default:
|
|
1174
|
+
default: y(() => [
|
|
1163
1175
|
a(C, {
|
|
1164
|
-
label: o(
|
|
1176
|
+
label: o(r)("inventory.ingredient.pricePerUnit")
|
|
1165
1177
|
}, null, 8, ["label"])
|
|
1166
1178
|
]),
|
|
1167
1179
|
_: 1
|
|
1168
1180
|
})
|
|
1169
1181
|
]),
|
|
1170
|
-
default:
|
|
1182
|
+
default: y(() => [
|
|
1171
1183
|
a(x, {
|
|
1172
1184
|
"model-value": ye.value,
|
|
1173
1185
|
"onUpdate:modelValue": t[6] || (t[6] = (I) => ye.value = I),
|
|
1174
1186
|
rules: [o(Pe)(0), o(Jt)(4)]
|
|
1175
1187
|
}, {
|
|
1176
|
-
label:
|
|
1188
|
+
label: y(() => [
|
|
1177
1189
|
a(he, { "z-index": 50 }, {
|
|
1178
|
-
default:
|
|
1190
|
+
default: y(() => [
|
|
1179
1191
|
a(C, {
|
|
1180
|
-
label: o(
|
|
1192
|
+
label: o(r)("inventory.ingredient.pricePerUnit")
|
|
1181
1193
|
}, null, 8, ["label"])
|
|
1182
1194
|
]),
|
|
1183
1195
|
_: 1
|
|
1184
1196
|
})
|
|
1185
1197
|
]),
|
|
1186
|
-
prepend:
|
|
1198
|
+
prepend: y(() => {
|
|
1187
1199
|
var I, Z;
|
|
1188
1200
|
return [
|
|
1189
|
-
l("div",
|
|
1201
|
+
l("div", Gn, A(o(vt)(((I = o(i).currentCountry) == null ? void 0 : I.value) ?? o(ft)) === "MYR" ? "RM" : o(vt)(((Z = o(i).currentCountry) == null ? void 0 : Z.value) ?? o(ft))), 1)
|
|
1190
1202
|
];
|
|
1191
1203
|
}),
|
|
1192
|
-
append:
|
|
1193
|
-
l("div",
|
|
1204
|
+
append: y(() => [
|
|
1205
|
+
l("div", Kn, " / " + A(we.value), 1)
|
|
1194
1206
|
]),
|
|
1195
1207
|
_: 1
|
|
1196
1208
|
}, 8, ["model-value", "rules"])
|
|
1197
1209
|
]),
|
|
1198
1210
|
_: 1
|
|
1199
|
-
}, 8, ["model-value", "locked", "disabled"])) : L("", !0),
|
|
1200
|
-
!v.value || j.value ? (
|
|
1211
|
+
}, 8, ["model-value", "locked", "append-text", "disabled"])) : L("", !0),
|
|
1212
|
+
!v.value || j.value ? (u(), O(zn, {
|
|
1201
1213
|
key: 2,
|
|
1202
1214
|
"model-value": j.value,
|
|
1203
1215
|
"onUpdate:modelValue": t[7] || (t[7] = (I) => j.value = I),
|
|
1204
1216
|
"root-value": e.modelValue,
|
|
1205
1217
|
readonly: v.value
|
|
1206
1218
|
}, null, 8, ["model-value", "root-value", "readonly"])) : L("", !0),
|
|
1207
|
-
e.mode !== o(H).CREATE ? (
|
|
1208
|
-
a(
|
|
1209
|
-
label: o(
|
|
1219
|
+
e.mode !== o(H).CREATE ? (u(), w("div", Jn, [
|
|
1220
|
+
a(nt, {
|
|
1221
|
+
label: o(r)("inventory.ingredient.status.inactive"),
|
|
1210
1222
|
"model-value": ee.value,
|
|
1211
1223
|
"onUpdate:modelValue": t[8] || (t[8] = (I) => ee.value = I),
|
|
1212
1224
|
"label-placement": "right",
|
|
1213
1225
|
disabled: v.value
|
|
1214
1226
|
}, null, 8, ["label", "model-value", "disabled"]),
|
|
1215
|
-
l("div",
|
|
1216
|
-
l("div",
|
|
1227
|
+
l("div", Zn, [
|
|
1228
|
+
l("div", Qn, A(o(r)("inventory.ingredient.status.preventFromOrder")), 1)
|
|
1217
1229
|
])
|
|
1218
1230
|
])) : L("", !0),
|
|
1219
|
-
e.mode !== o(H).CREATE ? (
|
|
1231
|
+
e.mode !== o(H).CREATE ? (u(), w("div", Xn, [
|
|
1220
1232
|
l("div", null, [
|
|
1221
|
-
a(
|
|
1222
|
-
label: o(
|
|
1233
|
+
a(nt, {
|
|
1234
|
+
label: o(r)("inventory.ingredient.bindedItems.title"),
|
|
1223
1235
|
modelValue: R.value,
|
|
1224
1236
|
"onUpdate:modelValue": t[9] || (t[9] = (I) => R.value = I),
|
|
1225
1237
|
"label-placement": "right"
|
|
1226
1238
|
}, null, 8, ["label", "modelValue"])
|
|
1227
1239
|
]),
|
|
1228
|
-
R.value && q.value.length ? (
|
|
1240
|
+
R.value && q.value.length ? (u(), O(We, {
|
|
1229
1241
|
key: 0,
|
|
1230
|
-
name: o(
|
|
1242
|
+
name: o(r)("inventory.ingredient.bindedItems.ingredient"),
|
|
1231
1243
|
bindings: q.value
|
|
1232
1244
|
}, null, 8, ["name", "bindings"])) : L("", !0),
|
|
1233
|
-
R.value && de.value.length ? (
|
|
1245
|
+
R.value && de.value.length ? (u(), O(We, {
|
|
1234
1246
|
key: 1,
|
|
1235
|
-
name: o(
|
|
1247
|
+
name: o(r)("inventory.ingredient.bindedItems.recipe"),
|
|
1236
1248
|
bindings: de.value
|
|
1237
1249
|
}, null, 8, ["name", "bindings"])) : L("", !0),
|
|
1238
|
-
R.value &&
|
|
1250
|
+
R.value && Te.value.length ? (u(), O(We, {
|
|
1239
1251
|
key: 2,
|
|
1240
|
-
name: o(
|
|
1241
|
-
bindings:
|
|
1252
|
+
name: o(r)("inventory.ingredient.bindedItems.menu"),
|
|
1253
|
+
bindings: Te.value
|
|
1242
1254
|
}, null, 8, ["name", "bindings"])) : L("", !0)
|
|
1243
1255
|
])) : L("", !0),
|
|
1244
|
-
l("div",
|
|
1245
|
-
l("div",
|
|
1256
|
+
l("div", el, [
|
|
1257
|
+
l("div", tl, [
|
|
1246
1258
|
a(he, null, {
|
|
1247
|
-
default:
|
|
1248
|
-
l("div",
|
|
1259
|
+
default: y(() => [
|
|
1260
|
+
l("div", nl, A(o(r)("inventory.ingredient.threshold.title")), 1)
|
|
1249
1261
|
]),
|
|
1250
1262
|
_: 1
|
|
1251
1263
|
}),
|
|
1252
|
-
l("div",
|
|
1264
|
+
l("div", ll, A(o(r)("inventory.ingredient.threshold.subtitle")), 1)
|
|
1253
1265
|
]),
|
|
1254
|
-
l("div",
|
|
1255
|
-
a(
|
|
1266
|
+
l("div", ol, [
|
|
1267
|
+
a(tt, {
|
|
1256
1268
|
"model-value": { low: be.value, mid: se.value },
|
|
1257
1269
|
rules: [$t()]
|
|
1258
1270
|
}, null, 8, ["model-value", "rules"]),
|
|
1259
|
-
l("div",
|
|
1260
|
-
l("div",
|
|
1261
|
-
l("div",
|
|
1271
|
+
l("div", al, [
|
|
1272
|
+
l("div", sl, [
|
|
1273
|
+
l("div", rl, [
|
|
1262
1274
|
a(Le, {
|
|
1263
1275
|
days: be.value,
|
|
1264
1276
|
level: o(je).low
|
|
1265
1277
|
}, null, 8, ["days", "level"])
|
|
1266
1278
|
]),
|
|
1267
|
-
l("div",
|
|
1268
|
-
l("div",
|
|
1269
|
-
a(
|
|
1279
|
+
l("div", il, [
|
|
1280
|
+
l("div", dl, A(o(r)("inventory.ingredient.threshold.whenRemaining")), 1),
|
|
1281
|
+
a(lt, {
|
|
1270
1282
|
modelValue: be.value,
|
|
1271
1283
|
"onUpdate:modelValue": t[10] || (t[10] = (I) => be.value = I),
|
|
1272
1284
|
rules: [o(Pe)(0)]
|
|
1273
1285
|
}, {
|
|
1274
|
-
append:
|
|
1286
|
+
append: y(() => t[13] || (t[13] = [
|
|
1275
1287
|
l("div", {
|
|
1276
1288
|
class: "text-fm-color-typo-secondary",
|
|
1277
1289
|
style: { "padding-right": "32px" }
|
|
@@ -1290,21 +1302,21 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1290
1302
|
style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
|
|
1291
1303
|
}, " < ")
|
|
1292
1304
|
], -1)),
|
|
1293
|
-
l("div",
|
|
1294
|
-
l("div",
|
|
1305
|
+
l("div", ul, [
|
|
1306
|
+
l("div", cl, [
|
|
1295
1307
|
a(Le, {
|
|
1296
1308
|
days: se.value,
|
|
1297
1309
|
level: o(je).mid
|
|
1298
1310
|
}, null, 8, ["days", "level"])
|
|
1299
1311
|
]),
|
|
1300
|
-
l("div",
|
|
1301
|
-
l("div",
|
|
1302
|
-
a(
|
|
1312
|
+
l("div", ml, [
|
|
1313
|
+
l("div", pl, A(o(r)("inventory.ingredient.threshold.whenRemaining")), 1),
|
|
1314
|
+
a(lt, {
|
|
1303
1315
|
modelValue: se.value,
|
|
1304
1316
|
"onUpdate:modelValue": t[11] || (t[11] = (I) => se.value = I),
|
|
1305
1317
|
rules: [o(Pe)(0)]
|
|
1306
1318
|
}, {
|
|
1307
|
-
append:
|
|
1319
|
+
append: y(() => t[14] || (t[14] = [
|
|
1308
1320
|
l("div", {
|
|
1309
1321
|
class: "text-fm-color-typo-secondary",
|
|
1310
1322
|
style: { "padding-right": "32px" }
|
|
@@ -1323,26 +1335,26 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1323
1335
|
style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
|
|
1324
1336
|
}, " < ")
|
|
1325
1337
|
], -1)),
|
|
1326
|
-
l("div",
|
|
1327
|
-
l("div",
|
|
1338
|
+
l("div", vl, [
|
|
1339
|
+
l("div", fl, [
|
|
1328
1340
|
a(Le, {
|
|
1329
1341
|
days: se.value + 1,
|
|
1330
1342
|
level: o(je).high
|
|
1331
1343
|
}, null, 8, ["days", "level"])
|
|
1332
1344
|
]),
|
|
1333
|
-
l("div",
|
|
1334
|
-
l("div",
|
|
1345
|
+
l("div", yl, [
|
|
1346
|
+
l("div", gl, A(o(r)("inventory.ingredient.threshold.stockIsStaple")), 1)
|
|
1335
1347
|
])
|
|
1336
1348
|
])
|
|
1337
1349
|
])
|
|
1338
1350
|
])
|
|
1339
1351
|
]),
|
|
1340
|
-
o(
|
|
1341
|
-
l("div",
|
|
1342
|
-
l("div",
|
|
1352
|
+
o(d).mustUsePoTemplate && e.mode === o(H).CREATE ? (u(), w("div", bl, [
|
|
1353
|
+
l("div", hl, [
|
|
1354
|
+
l("div", _l, [
|
|
1343
1355
|
a(he, null, {
|
|
1344
|
-
default:
|
|
1345
|
-
l("div",
|
|
1356
|
+
default: y(() => [
|
|
1357
|
+
l("div", xl, A(o(r)("inventory.ingredient.purchaseOrderTemplates.title")), 1)
|
|
1346
1358
|
]),
|
|
1347
1359
|
_: 1
|
|
1348
1360
|
}),
|
|
@@ -1354,11 +1366,11 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1354
1366
|
onClick: Ft
|
|
1355
1367
|
})
|
|
1356
1368
|
]),
|
|
1357
|
-
l("div",
|
|
1369
|
+
l("div", kl, A(o(r)("inventory.ingredient.purchaseOrderTemplates.description")), 1)
|
|
1358
1370
|
]),
|
|
1359
|
-
|
|
1360
|
-
l("div",
|
|
1361
|
-
(
|
|
1371
|
+
Ke.value.length > 0 ? (u(), w("div", Tl, [
|
|
1372
|
+
l("div", wl, [
|
|
1373
|
+
(u(!0), w(X, null, ue(Ke.value, (I) => (u(), O(De, {
|
|
1362
1374
|
key: I.value,
|
|
1363
1375
|
label: I.label,
|
|
1364
1376
|
variant: "info",
|
|
@@ -1367,12 +1379,12 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1367
1379
|
])
|
|
1368
1380
|
])) : L("", !0)
|
|
1369
1381
|
])) : L("", !0),
|
|
1370
|
-
o(
|
|
1371
|
-
l("div",
|
|
1372
|
-
l("div",
|
|
1382
|
+
o(d).enableWastageTemplate && e.mode === o(H).CREATE ? (u(), w("div", Vl, [
|
|
1383
|
+
l("div", Il, [
|
|
1384
|
+
l("div", Sl, [
|
|
1373
1385
|
a(he, null, {
|
|
1374
|
-
default:
|
|
1375
|
-
l("div",
|
|
1386
|
+
default: y(() => [
|
|
1387
|
+
l("div", Cl, A(o(r)("inventory.ingredient.wastageTemplates.title")), 1)
|
|
1376
1388
|
]),
|
|
1377
1389
|
_: 1
|
|
1378
1390
|
}),
|
|
@@ -1381,14 +1393,14 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1381
1393
|
"text-color": "primary",
|
|
1382
1394
|
"border-color": "primary",
|
|
1383
1395
|
"prepend-icon": "add",
|
|
1384
|
-
onClick:
|
|
1396
|
+
onClick: At
|
|
1385
1397
|
})
|
|
1386
1398
|
]),
|
|
1387
|
-
l("div",
|
|
1399
|
+
l("div", Fl, A(o(r)("inventory.ingredient.wastageTemplates.description")), 1)
|
|
1388
1400
|
]),
|
|
1389
|
-
|
|
1401
|
+
Ze.value.length > 0 ? (u(), w("div", Al, [
|
|
1390
1402
|
l("div", El, [
|
|
1391
|
-
(
|
|
1403
|
+
(u(!0), w(X, null, ue(Ze.value, (I) => (u(), O(De, {
|
|
1392
1404
|
key: I.value,
|
|
1393
1405
|
label: I.label,
|
|
1394
1406
|
variant: "info",
|
|
@@ -1397,12 +1409,12 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1397
1409
|
])
|
|
1398
1410
|
])) : L("", !0)
|
|
1399
1411
|
])) : L("", !0),
|
|
1400
|
-
o(
|
|
1401
|
-
l("div",
|
|
1402
|
-
l("div",
|
|
1412
|
+
o(d).enableClosingTemplate && e.mode === o(H).CREATE ? (u(), w("div", $l, [
|
|
1413
|
+
l("div", Ml, [
|
|
1414
|
+
l("div", Ul, [
|
|
1403
1415
|
a(he, null, {
|
|
1404
|
-
default:
|
|
1405
|
-
l("div",
|
|
1416
|
+
default: y(() => [
|
|
1417
|
+
l("div", Pl, A(o(r)("inventory.ingredient.closingTemplates.title")), 1)
|
|
1406
1418
|
]),
|
|
1407
1419
|
_: 1
|
|
1408
1420
|
}),
|
|
@@ -1411,14 +1423,14 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1411
1423
|
"text-color": "primary",
|
|
1412
1424
|
"border-color": "primary",
|
|
1413
1425
|
"prepend-icon": "add",
|
|
1414
|
-
onClick:
|
|
1426
|
+
onClick: Et
|
|
1415
1427
|
})
|
|
1416
1428
|
]),
|
|
1417
|
-
l("div",
|
|
1429
|
+
l("div", Rl, A(o(r)("inventory.ingredient.closingTemplates.description")), 1)
|
|
1418
1430
|
]),
|
|
1419
|
-
|
|
1420
|
-
l("div",
|
|
1421
|
-
(
|
|
1431
|
+
Xe.value.length > 0 ? (u(), w("div", Bl, [
|
|
1432
|
+
l("div", Dl, [
|
|
1433
|
+
(u(!0), w(X, null, ue(Xe.value, (I) => (u(), O(De, {
|
|
1422
1434
|
key: I.value,
|
|
1423
1435
|
label: I.label,
|
|
1424
1436
|
variant: "info",
|
|
@@ -1440,10 +1452,10 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1440
1452
|
}, 8, ["disabled"]);
|
|
1441
1453
|
};
|
|
1442
1454
|
}
|
|
1443
|
-
}),
|
|
1455
|
+
}), Nl = { class: "flex flex-col gap-32" }, zl = {
|
|
1444
1456
|
key: 0,
|
|
1445
1457
|
class: "flex justify-between items-center"
|
|
1446
|
-
},
|
|
1458
|
+
}, Ll = { class: "flex gap-4" }, jl = /* @__PURE__ */ pe({
|
|
1447
1459
|
__name: "IngredientDialog",
|
|
1448
1460
|
props: {
|
|
1449
1461
|
show: { type: Boolean },
|
|
@@ -1452,13 +1464,13 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1452
1464
|
},
|
|
1453
1465
|
emits: ["update:show"],
|
|
1454
1466
|
setup(W) {
|
|
1455
|
-
const
|
|
1467
|
+
const s = W, T = Ce(), r = Vt(), b = Fe(), S = St(), U = wt(), k = Ct(), n = Ae(), { t: c } = ve(), _ = ht(s, "show"), i = ht(s, "sku"), d = B([]), m = B([]), v = B([]), V = g(
|
|
1456
1468
|
() => {
|
|
1457
1469
|
var h;
|
|
1458
|
-
return b.isEnabled && b.netSuiteItemBySkuId.has((h =
|
|
1470
|
+
return b.isEnabled && b.netSuiteItemBySkuId.has((h = s.sku) == null ? void 0 : h._id);
|
|
1459
1471
|
}
|
|
1460
|
-
), E =
|
|
1461
|
-
switch (
|
|
1472
|
+
), E = g(() => {
|
|
1473
|
+
switch (s.mode) {
|
|
1462
1474
|
case H.READ:
|
|
1463
1475
|
return "";
|
|
1464
1476
|
case H.UPDATE:
|
|
@@ -1467,8 +1479,8 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1467
1479
|
return c("inventory.ingredient.create.title");
|
|
1468
1480
|
}
|
|
1469
1481
|
return "";
|
|
1470
|
-
}), p =
|
|
1471
|
-
switch (
|
|
1482
|
+
}), p = g(() => {
|
|
1483
|
+
switch (s.mode) {
|
|
1472
1484
|
case H.READ:
|
|
1473
1485
|
return "";
|
|
1474
1486
|
case H.UPDATE:
|
|
@@ -1481,15 +1493,15 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1481
1493
|
async function fe() {
|
|
1482
1494
|
D.value = !0;
|
|
1483
1495
|
try {
|
|
1484
|
-
await T.createSku(
|
|
1485
|
-
const h = T.skuByCode[
|
|
1486
|
-
|
|
1496
|
+
await T.createSku(i.value);
|
|
1497
|
+
const h = T.skuByCode[i.value.code];
|
|
1498
|
+
r.enablePoTemplate && d.value.length > 0 && await ce(h), r.enableWastageTemplate && m.value.length > 0 && await le(h), r.enableClosingTemplate && v.value.length > 0 && await oe(h), _.value = !1, n.open({
|
|
1487
1499
|
title: c("inventory.common.success"),
|
|
1488
|
-
message: c("inventory.ingredient.create.success", { name:
|
|
1500
|
+
message: c("inventory.ingredient.create.success", { name: i.value.name }),
|
|
1489
1501
|
type: "success"
|
|
1490
1502
|
});
|
|
1491
1503
|
} catch (h) {
|
|
1492
|
-
h instanceof
|
|
1504
|
+
h instanceof yt || n.open({
|
|
1493
1505
|
title: c("inventory.ingredient.create.error.title"),
|
|
1494
1506
|
message: c("inventory.ingredient.create.error.message"),
|
|
1495
1507
|
type: "error"
|
|
@@ -1501,13 +1513,13 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1501
1513
|
async function ne() {
|
|
1502
1514
|
D.value = !0;
|
|
1503
1515
|
try {
|
|
1504
|
-
await T.updateSku(
|
|
1516
|
+
await T.updateSku(i.value), D.value = !1, _.value = !1, n.open({
|
|
1505
1517
|
title: c("inventory.common.success"),
|
|
1506
|
-
message: c("inventory.ingredient.update.success", { name:
|
|
1518
|
+
message: c("inventory.ingredient.update.success", { name: i.value.name }),
|
|
1507
1519
|
type: "success"
|
|
1508
1520
|
});
|
|
1509
1521
|
} catch (h) {
|
|
1510
|
-
h instanceof
|
|
1522
|
+
h instanceof yt || n.open({
|
|
1511
1523
|
title: c("inventory.ingredient.update.error.title"),
|
|
1512
1524
|
message: c("inventory.ingredient.update.error.message"),
|
|
1513
1525
|
type: "error"
|
|
@@ -1519,7 +1531,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1519
1531
|
async function ce(h) {
|
|
1520
1532
|
var P, G, $, f;
|
|
1521
1533
|
try {
|
|
1522
|
-
for (const j of
|
|
1534
|
+
for (const j of d.value) {
|
|
1523
1535
|
const K = await S.getTemplate(j);
|
|
1524
1536
|
if (!K) {
|
|
1525
1537
|
console.warn(`Template with ID ${j} not found`);
|
|
@@ -1543,7 +1555,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1543
1555
|
items: [...K.purchaseOrder.items, M]
|
|
1544
1556
|
}
|
|
1545
1557
|
};
|
|
1546
|
-
((($ = R.purchaseOrder.supplier) == null ? void 0 : $.internal) ===
|
|
1558
|
+
((($ = R.purchaseOrder.supplier) == null ? void 0 : $.internal) === gt.enum.warehouse || ((f = R.purchaseOrder.supplier) == null ? void 0 : f.internal) === gt.enum.restaurant) && (R.purchaseOrder.items = R.purchaseOrder.items.map(
|
|
1547
1559
|
({ totalCost: q, ...de }) => de
|
|
1548
1560
|
)), await S.updateTemplate(R), await new Promise((q) => setTimeout(q, 1e3));
|
|
1549
1561
|
}
|
|
@@ -1617,7 +1629,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1617
1629
|
(P = (h = N.value) == null ? void 0 : h.validateInputs) == null || P.call(h);
|
|
1618
1630
|
}
|
|
1619
1631
|
function ae() {
|
|
1620
|
-
switch (
|
|
1632
|
+
switch (s.mode) {
|
|
1621
1633
|
case H.READ:
|
|
1622
1634
|
return;
|
|
1623
1635
|
case H.UPDATE:
|
|
@@ -1627,26 +1639,26 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1627
1639
|
}
|
|
1628
1640
|
}
|
|
1629
1641
|
function ye(h) {
|
|
1630
|
-
|
|
1642
|
+
d.value = h;
|
|
1631
1643
|
}
|
|
1632
1644
|
function ge(h) {
|
|
1633
1645
|
m.value = h;
|
|
1634
1646
|
}
|
|
1635
|
-
function
|
|
1647
|
+
function ke(h) {
|
|
1636
1648
|
v.value = h;
|
|
1637
1649
|
}
|
|
1638
1650
|
return (h, P) => {
|
|
1639
1651
|
const G = F("FmChip"), $ = F("FmButton"), f = F("FmSideSheet");
|
|
1640
|
-
return
|
|
1652
|
+
return u(), O(f, {
|
|
1641
1653
|
"model-value": o(_),
|
|
1642
|
-
"onUpdate:modelValue": P[3] || (P[3] = (j) =>
|
|
1654
|
+
"onUpdate:modelValue": P[3] || (P[3] = (j) => dt(_) ? _.value = j : null),
|
|
1643
1655
|
header: E.value,
|
|
1644
1656
|
"close-button": "",
|
|
1645
1657
|
"dismiss-away": "",
|
|
1646
1658
|
"max-width": 500
|
|
1647
1659
|
}, {
|
|
1648
|
-
"side-sheet-footer":
|
|
1649
|
-
l("div",
|
|
1660
|
+
"side-sheet-footer": y(() => [
|
|
1661
|
+
l("div", Ll, [
|
|
1650
1662
|
a($, {
|
|
1651
1663
|
loading: D.value,
|
|
1652
1664
|
label: p.value,
|
|
@@ -1660,9 +1672,9 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1660
1672
|
}, null, 8, ["disabled", "label"])
|
|
1661
1673
|
])
|
|
1662
1674
|
]),
|
|
1663
|
-
default:
|
|
1664
|
-
l("div",
|
|
1665
|
-
V.value ? (
|
|
1675
|
+
default: y(() => [
|
|
1676
|
+
l("div", Nl, [
|
|
1677
|
+
V.value ? (u(), w("div", zl, [
|
|
1666
1678
|
a(G, {
|
|
1667
1679
|
label: "Managed by Netsuite",
|
|
1668
1680
|
compact: ""
|
|
@@ -1673,21 +1685,21 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1673
1685
|
settingOptions: o(b).skuSettingOptions
|
|
1674
1686
|
}, null, 8, ["sku", "settingOptions"])
|
|
1675
1687
|
])) : L("", !0),
|
|
1676
|
-
a(
|
|
1688
|
+
a(Ol, {
|
|
1677
1689
|
class: "w-full",
|
|
1678
1690
|
ref_key: "hasValidationExpose",
|
|
1679
1691
|
ref: N,
|
|
1680
|
-
modelValue: o(
|
|
1681
|
-
"onUpdate:modelValue": P[0] || (P[0] = (j) =>
|
|
1692
|
+
modelValue: o(i),
|
|
1693
|
+
"onUpdate:modelValue": P[0] || (P[0] = (j) => dt(i) ? i.value = j : null),
|
|
1682
1694
|
mode: h.mode,
|
|
1683
1695
|
disabled: D.value,
|
|
1684
|
-
purchaseOrderTemplateIds:
|
|
1696
|
+
purchaseOrderTemplateIds: d.value,
|
|
1685
1697
|
wastageTemplateIds: m.value,
|
|
1686
1698
|
closingTemplateIds: v.value,
|
|
1687
1699
|
"onClick:submit": P[1] || (P[1] = (j) => ae()),
|
|
1688
1700
|
"onUpdate:purchaseOrderTemplateIds": ye,
|
|
1689
1701
|
"onUpdate:wastageTemplateIds": ge,
|
|
1690
|
-
"onUpdate:closingTemplateIds":
|
|
1702
|
+
"onUpdate:closingTemplateIds": ke
|
|
1691
1703
|
}, null, 8, ["modelValue", "mode", "disabled", "purchaseOrderTemplateIds", "wastageTemplateIds", "closingTemplateIds"])
|
|
1692
1704
|
])
|
|
1693
1705
|
]),
|
|
@@ -1695,10 +1707,10 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1695
1707
|
}, 8, ["model-value", "header"]);
|
|
1696
1708
|
};
|
|
1697
1709
|
}
|
|
1698
|
-
}),
|
|
1710
|
+
}), Wl = { class: "flex items-center gap-12 pl-8" }, Hl = { class: "flex flex-col" }, ql = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, Yl = {
|
|
1699
1711
|
key: 0,
|
|
1700
1712
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
1701
|
-
},
|
|
1713
|
+
}, Gl = { key: 0 }, xt = /* @__PURE__ */ pe({
|
|
1702
1714
|
__name: "ImportIngredientItem",
|
|
1703
1715
|
props: {
|
|
1704
1716
|
type: {},
|
|
@@ -1707,29 +1719,29 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1707
1719
|
errors: {}
|
|
1708
1720
|
},
|
|
1709
1721
|
setup(W) {
|
|
1710
|
-
return (
|
|
1711
|
-
const
|
|
1712
|
-
return
|
|
1722
|
+
return (s, T) => {
|
|
1723
|
+
const r = F("FmIcon"), b = F("FmTooltip");
|
|
1724
|
+
return u(), w("div", Wl, [
|
|
1713
1725
|
T[0] || (T[0] = l("div", null, "•", -1)),
|
|
1714
|
-
l("div",
|
|
1715
|
-
l("div",
|
|
1726
|
+
l("div", Hl, [
|
|
1727
|
+
l("div", ql, [
|
|
1716
1728
|
l("div", {
|
|
1717
1729
|
class: te({
|
|
1718
|
-
"text-fm-color-system-error-300":
|
|
1730
|
+
"text-fm-color-system-error-300": s.errors.length
|
|
1719
1731
|
})
|
|
1720
1732
|
}, [
|
|
1721
|
-
|
|
1722
|
-
|
|
1733
|
+
Ge(A(s.name) + " ", 1),
|
|
1734
|
+
s.type === "create" ? (u(), w("span", Yl, "(new)")) : L("", !0)
|
|
1723
1735
|
], 2),
|
|
1724
|
-
|
|
1736
|
+
s.errors.length ? (u(), w("div", Gl, [
|
|
1725
1737
|
a(b, { "z-index": 50 }, {
|
|
1726
|
-
content:
|
|
1738
|
+
content: y(() => [
|
|
1727
1739
|
l("ol", null, [
|
|
1728
|
-
(
|
|
1740
|
+
(u(!0), w(X, null, ue(s.errors, (S, U) => (u(), w("li", { key: U }, A(S), 1))), 128))
|
|
1729
1741
|
])
|
|
1730
1742
|
]),
|
|
1731
|
-
default:
|
|
1732
|
-
a(
|
|
1743
|
+
default: y(() => [
|
|
1744
|
+
a(r, {
|
|
1733
1745
|
name: "error",
|
|
1734
1746
|
size: "sm",
|
|
1735
1747
|
color: "system-error-300"
|
|
@@ -1743,38 +1755,38 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1743
1755
|
class: te([
|
|
1744
1756
|
"fm-typo-en-body-sm-400",
|
|
1745
1757
|
{
|
|
1746
|
-
"text-fm-color-system-error-200":
|
|
1747
|
-
"text-fm-color-typo-secondary": !
|
|
1758
|
+
"text-fm-color-system-error-200": s.errors.length,
|
|
1759
|
+
"text-fm-color-typo-secondary": !s.errors.length
|
|
1748
1760
|
}
|
|
1749
1761
|
])
|
|
1750
|
-
}, A(
|
|
1762
|
+
}, A(s.code), 3)
|
|
1751
1763
|
])
|
|
1752
1764
|
]);
|
|
1753
1765
|
};
|
|
1754
1766
|
}
|
|
1755
|
-
}),
|
|
1767
|
+
}), Kl = { class: "flex flex-col gap-24" }, Jl = { class: "fm-typo-en-body-md-400" }, Zl = { class: "flex flex-col gap-8" }, Ql = { class: "line-clamp-2 text-ellipsis break-all" }, Xl = {
|
|
1756
1768
|
key: 2,
|
|
1757
1769
|
class: "shrink-0"
|
|
1758
|
-
},
|
|
1770
|
+
}, eo = {
|
|
1759
1771
|
key: 0,
|
|
1760
1772
|
class: "flex flex-col"
|
|
1761
|
-
},
|
|
1773
|
+
}, to = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, no = {
|
|
1762
1774
|
key: 0,
|
|
1763
1775
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
1764
|
-
},
|
|
1776
|
+
}, lo = { class: "fm-typo-en-body-lg-600" }, oo = /* @__PURE__ */ pe({
|
|
1765
1777
|
__name: "ImportIngredients",
|
|
1766
1778
|
setup(W) {
|
|
1767
|
-
const
|
|
1768
|
-
() => !!S.value.length || U.value.some((
|
|
1769
|
-
), c =
|
|
1779
|
+
const s = B(null), T = un(), r = Ae(), b = B(!1), S = B(new Array()), U = B([]), k = B([]), n = g(
|
|
1780
|
+
() => !!S.value.length || U.value.some((d) => d.errors.length) || k.value.some((d) => d.errors.length)
|
|
1781
|
+
), c = g(
|
|
1770
1782
|
() => !!U.value.length || !!k.value.length
|
|
1771
1783
|
), { t: _ } = ve();
|
|
1772
|
-
async function
|
|
1784
|
+
async function i(d) {
|
|
1773
1785
|
S.value = [], U.value = [], k.value = [];
|
|
1774
1786
|
try {
|
|
1775
1787
|
b.value = !0;
|
|
1776
1788
|
const [m] = await Promise.all([
|
|
1777
|
-
en(
|
|
1789
|
+
en(d),
|
|
1778
1790
|
// fake buffer
|
|
1779
1791
|
new Promise((E) => setTimeout(E, 1e3))
|
|
1780
1792
|
]), v = m.SheetNames.find((E) => E);
|
|
@@ -1793,38 +1805,38 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1793
1805
|
}
|
|
1794
1806
|
T.emitData(V);
|
|
1795
1807
|
} catch (m) {
|
|
1796
|
-
|
|
1808
|
+
r.open({
|
|
1797
1809
|
title: _("inventory.ingredient.import.fileError.unableToRead"),
|
|
1798
1810
|
message: m == null ? void 0 : m.message,
|
|
1799
1811
|
type: "error"
|
|
1800
1812
|
}), console.error("Error in reading file", m);
|
|
1801
1813
|
} finally {
|
|
1802
|
-
S.value.length &&
|
|
1814
|
+
S.value.length && r.open({
|
|
1803
1815
|
title: _("inventory.ingredient.import.fileError.invalidExcel"),
|
|
1804
1816
|
type: "error"
|
|
1805
1817
|
}), b.value = !1;
|
|
1806
1818
|
}
|
|
1807
1819
|
}
|
|
1808
|
-
return
|
|
1809
|
-
|
|
1810
|
-
}), (
|
|
1820
|
+
return kt(s, (d) => {
|
|
1821
|
+
d && i(d);
|
|
1822
|
+
}), (d, m) => {
|
|
1811
1823
|
const v = F("FmCircularProgress"), V = F("FmIcon"), E = F("FmButton");
|
|
1812
|
-
return
|
|
1813
|
-
l("div",
|
|
1824
|
+
return u(), w("div", Kl, [
|
|
1825
|
+
l("div", Jl, A(o(_)("inventory.ingredient.import.uploadDescription")), 1),
|
|
1814
1826
|
a(Xt, {
|
|
1815
1827
|
class: te({
|
|
1816
1828
|
"w-full": !0,
|
|
1817
|
-
"h-[200px]": !
|
|
1829
|
+
"h-[200px]": !s.value
|
|
1818
1830
|
}),
|
|
1819
1831
|
accept: ".xlsx",
|
|
1820
|
-
onFileUpload: m[0] || (m[0] = (p) =>
|
|
1832
|
+
onFileUpload: m[0] || (m[0] = (p) => s.value = p),
|
|
1821
1833
|
label: o(_)("inventory.ingredient.import.uploadTemplate"),
|
|
1822
1834
|
"button-label": o(_)("inventory.ingredient.import.selectFile")
|
|
1823
|
-
},
|
|
1824
|
-
|
|
1835
|
+
}, Ye({ _: 2 }, [
|
|
1836
|
+
s.value ? {
|
|
1825
1837
|
name: "default",
|
|
1826
|
-
fn:
|
|
1827
|
-
l("div",
|
|
1838
|
+
fn: y(({ openFileDialog: p }) => [
|
|
1839
|
+
l("div", Zl, [
|
|
1828
1840
|
l("div", {
|
|
1829
1841
|
class: te([
|
|
1830
1842
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
@@ -1835,11 +1847,11 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1835
1847
|
}
|
|
1836
1848
|
])
|
|
1837
1849
|
}, [
|
|
1838
|
-
b.value ? (
|
|
1850
|
+
b.value ? (u(), O(v, {
|
|
1839
1851
|
key: 0,
|
|
1840
1852
|
size: "md",
|
|
1841
1853
|
color: "neutral-gray-200"
|
|
1842
|
-
})) : (
|
|
1854
|
+
})) : (u(), O(V, {
|
|
1843
1855
|
key: 1,
|
|
1844
1856
|
name: n.value ? "error" : "attach_file",
|
|
1845
1857
|
outline: "",
|
|
@@ -1854,9 +1866,9 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1854
1866
|
}
|
|
1855
1867
|
])
|
|
1856
1868
|
}, [
|
|
1857
|
-
l("div",
|
|
1869
|
+
l("div", Ql, A(s.value.name), 1)
|
|
1858
1870
|
], 2),
|
|
1859
|
-
b.value ? L("", !0) : (
|
|
1871
|
+
b.value ? L("", !0) : (u(), w("div", Xl, [
|
|
1860
1872
|
a(E, {
|
|
1861
1873
|
label: o(_)("inventory.ingredient.import.replaceFile"),
|
|
1862
1874
|
variant: n.value ? "destructive" : "secondary",
|
|
@@ -1865,8 +1877,8 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1865
1877
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
1866
1878
|
]))
|
|
1867
1879
|
], 2),
|
|
1868
|
-
S.value.length ? (
|
|
1869
|
-
(
|
|
1880
|
+
S.value.length ? (u(), w("div", eo, [
|
|
1881
|
+
(u(!0), w(X, null, ue(S.value, (N, D) => (u(), w("div", {
|
|
1870
1882
|
key: D,
|
|
1871
1883
|
class: "flex gap-8 items-center"
|
|
1872
1884
|
}, [
|
|
@@ -1875,7 +1887,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1875
1887
|
size: "sm",
|
|
1876
1888
|
color: "system-error-300"
|
|
1877
1889
|
}),
|
|
1878
|
-
l("div",
|
|
1890
|
+
l("div", to, A(N), 1)
|
|
1879
1891
|
]))), 128))
|
|
1880
1892
|
])) : L("", !0)
|
|
1881
1893
|
])
|
|
@@ -1883,16 +1895,16 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1883
1895
|
key: "0"
|
|
1884
1896
|
} : void 0
|
|
1885
1897
|
]), 1032, ["class", "label", "button-label"]),
|
|
1886
|
-
c.value ? (
|
|
1887
|
-
l("div",
|
|
1888
|
-
(
|
|
1898
|
+
c.value ? (u(), w("div", no, [
|
|
1899
|
+
l("div", lo, A(o(_)("inventory.ingredient.import.summary")), 1),
|
|
1900
|
+
(u(!0), w(X, null, ue(U.value, (p) => (u(), O(xt, {
|
|
1889
1901
|
key: p.sku._id,
|
|
1890
1902
|
code: p.sku.code,
|
|
1891
1903
|
name: p.sku.name,
|
|
1892
1904
|
errors: p.errors,
|
|
1893
1905
|
type: "create"
|
|
1894
1906
|
}, null, 8, ["code", "name", "errors"]))), 128)),
|
|
1895
|
-
(
|
|
1907
|
+
(u(!0), w(X, null, ue(k.value, (p) => (u(), O(xt, {
|
|
1896
1908
|
key: p.sku._id,
|
|
1897
1909
|
code: p.sku.code,
|
|
1898
1910
|
name: p.sku.name,
|
|
@@ -1903,24 +1915,24 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1903
1915
|
]);
|
|
1904
1916
|
};
|
|
1905
1917
|
}
|
|
1906
|
-
}),
|
|
1918
|
+
}), ao = {
|
|
1907
1919
|
key: 0,
|
|
1908
1920
|
class: "flex items-center gap-1"
|
|
1909
|
-
},
|
|
1921
|
+
}, so = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ro = { class: "flex flex-col py-8" }, io = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, uo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, So = /* @__PURE__ */ pe({
|
|
1910
1922
|
__name: "IngredientsView",
|
|
1911
1923
|
setup(W) {
|
|
1912
|
-
const
|
|
1924
|
+
const s = Ce(), T = Fe(), r = g(() => [
|
|
1913
1925
|
{
|
|
1914
1926
|
type: "string",
|
|
1915
1927
|
key: "skuCode",
|
|
1916
1928
|
entity: "sku",
|
|
1917
|
-
values:
|
|
1929
|
+
values: s.skus.map((f) => f.code)
|
|
1918
1930
|
},
|
|
1919
1931
|
{
|
|
1920
1932
|
type: "string",
|
|
1921
1933
|
key: "skuUnitAbbrev",
|
|
1922
1934
|
entity: "sku",
|
|
1923
|
-
values:
|
|
1935
|
+
values: s.units.map((f) => f.abbrev)
|
|
1924
1936
|
},
|
|
1925
1937
|
{
|
|
1926
1938
|
type: "string",
|
|
@@ -1938,13 +1950,13 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1938
1950
|
type: "string"
|
|
1939
1951
|
}
|
|
1940
1952
|
]
|
|
1941
|
-
}), S =
|
|
1953
|
+
}), S = g(
|
|
1942
1954
|
() => new Set(T.getAvailableItems(T.businessSubsidiaryId))
|
|
1943
|
-
), U =
|
|
1955
|
+
), U = g(() => {
|
|
1944
1956
|
if (!b.value)
|
|
1945
|
-
return
|
|
1957
|
+
return s.skus;
|
|
1946
1958
|
const $ = tn.build(b.value);
|
|
1947
|
-
return
|
|
1959
|
+
return s.skus.filter((f) => T.isEnabled && ne.value && S.value && !S.value.has(f._id) ? !1 : nn(
|
|
1948
1960
|
{
|
|
1949
1961
|
skuCode: f.code,
|
|
1950
1962
|
skuUnitAbbrev: f.unit.abbrev,
|
|
@@ -1952,25 +1964,25 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1952
1964
|
},
|
|
1953
1965
|
$
|
|
1954
1966
|
));
|
|
1955
|
-
}), k = ln(), n = Re(), c = Tn(), _ =
|
|
1967
|
+
}), k = ln(), n = Re(), c = Tn(), _ = Ae(), { t: i } = ve(), { createIngredient: d, updateIngredient: m } = qe(), { ingredientDialogProps: v, ingredientViewLoading: V } = fn(qe()), { columnDefs: E } = Nn();
|
|
1956
1968
|
function p($) {
|
|
1957
1969
|
switch ($) {
|
|
1958
1970
|
case "add":
|
|
1959
|
-
return T.isEnabled ? void 0 :
|
|
1971
|
+
return T.isEnabled ? void 0 : d();
|
|
1960
1972
|
case "import":
|
|
1961
1973
|
return P();
|
|
1962
1974
|
case "export":
|
|
1963
1975
|
return h();
|
|
1964
1976
|
}
|
|
1965
1977
|
}
|
|
1966
|
-
const N = B(""), D = B(!1), fe =
|
|
1978
|
+
const N = B(""), D = B(!1), fe = g(() => D.value || V.value), ne = B(!0), { breakpoints: ce } = cn(), le = g(() => ce.value.xs || ce.value.sm), oe = g(() => le.value ? 10 : 20), ee = on(), ae = B(!1), ye = [
|
|
1967
1979
|
{
|
|
1968
1980
|
value: "import",
|
|
1969
|
-
label:
|
|
1981
|
+
label: i("common.import")
|
|
1970
1982
|
},
|
|
1971
1983
|
{
|
|
1972
1984
|
value: "export",
|
|
1973
|
-
label:
|
|
1985
|
+
label: i("common.export")
|
|
1974
1986
|
}
|
|
1975
1987
|
];
|
|
1976
1988
|
function ge($) {
|
|
@@ -1981,65 +1993,65 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1981
1993
|
return h();
|
|
1982
1994
|
}
|
|
1983
1995
|
}
|
|
1984
|
-
const
|
|
1996
|
+
const ke = g(() => [
|
|
1985
1997
|
...T.isEnabled ? [] : [
|
|
1986
1998
|
{
|
|
1987
|
-
label:
|
|
1999
|
+
label: i("inventory.ingredient.create.title"),
|
|
1988
2000
|
value: "add",
|
|
1989
2001
|
isPrimary: !0,
|
|
1990
2002
|
prependIcon: "add"
|
|
1991
2003
|
}
|
|
1992
2004
|
],
|
|
1993
|
-
{ label:
|
|
1994
|
-
{ label:
|
|
2005
|
+
{ label: i("common.import"), value: "import" },
|
|
2006
|
+
{ label: i("common.export"), value: "export" }
|
|
1995
2007
|
]);
|
|
1996
2008
|
function h() {
|
|
1997
2009
|
const $ = _n();
|
|
1998
2010
|
_.open({
|
|
1999
|
-
title:
|
|
2000
|
-
message:
|
|
2011
|
+
title: i("inventory.ingredient.export.success"),
|
|
2012
|
+
message: i("inventory.ingredient.export.filename", [$]),
|
|
2001
2013
|
type: "success"
|
|
2002
2014
|
});
|
|
2003
2015
|
}
|
|
2004
2016
|
function P() {
|
|
2005
2017
|
n.open({
|
|
2006
|
-
title:
|
|
2007
|
-
contentComponent:
|
|
2018
|
+
title: i("inventory.ingredient.import.title"),
|
|
2019
|
+
contentComponent: oo,
|
|
2008
2020
|
overlay: !0,
|
|
2009
2021
|
closeButton: !0,
|
|
2010
2022
|
primaryActions: {
|
|
2011
|
-
text:
|
|
2023
|
+
text: i("common.import"),
|
|
2012
2024
|
close: !1
|
|
2013
2025
|
},
|
|
2014
2026
|
secondaryActions: {
|
|
2015
|
-
text:
|
|
2027
|
+
text: i("common.close"),
|
|
2016
2028
|
close: !0
|
|
2017
2029
|
},
|
|
2018
2030
|
tertiaryActions: {
|
|
2019
|
-
text:
|
|
2031
|
+
text: i("inventory.ingredient.import.actions.downloadTemplate"),
|
|
2020
2032
|
close: !1,
|
|
2021
2033
|
variant: "plain"
|
|
2022
2034
|
}
|
|
2023
2035
|
}).onPrimary(($) => {
|
|
2024
2036
|
if (!$) {
|
|
2025
2037
|
_.open({
|
|
2026
|
-
title:
|
|
2038
|
+
title: i("inventory.ingredient.import.error.noData"),
|
|
2027
2039
|
type: "error"
|
|
2028
2040
|
});
|
|
2029
2041
|
return;
|
|
2030
2042
|
}
|
|
2031
2043
|
if (!$.importCreateResult.length && !$.importUpdateResult.length) {
|
|
2032
2044
|
_.open({
|
|
2033
|
-
title:
|
|
2034
|
-
message:
|
|
2045
|
+
title: i("inventory.ingredient.import.error.invalidContent"),
|
|
2046
|
+
message: i("inventory.ingredient.import.error.noImportData"),
|
|
2035
2047
|
type: "error"
|
|
2036
2048
|
});
|
|
2037
2049
|
return;
|
|
2038
2050
|
}
|
|
2039
2051
|
if ($.importCreateResult.some((f) => f.errors.length) || $.importUpdateResult.some((f) => f.errors.length)) {
|
|
2040
2052
|
_.open({
|
|
2041
|
-
title:
|
|
2042
|
-
message:
|
|
2053
|
+
title: i("inventory.ingredient.import.error.invalidContent"),
|
|
2054
|
+
message: i("inventory.ingredient.import.error.hasErrors"),
|
|
2043
2055
|
type: "error"
|
|
2044
2056
|
});
|
|
2045
2057
|
return;
|
|
@@ -2057,7 +2069,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2057
2069
|
let K = 0;
|
|
2058
2070
|
const me = () => {
|
|
2059
2071
|
K += j, _.open({
|
|
2060
|
-
title:
|
|
2072
|
+
title: i("inventory.ingredient.import.progress", [
|
|
2061
2073
|
Math.min(K, f.length),
|
|
2062
2074
|
f.length
|
|
2063
2075
|
])
|
|
@@ -2066,7 +2078,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2066
2078
|
for (const M of f.chunk(100)) {
|
|
2067
2079
|
me();
|
|
2068
2080
|
try {
|
|
2069
|
-
const R = await
|
|
2081
|
+
const R = await s.importSkus({
|
|
2070
2082
|
create: M.filter((q) => q.type === "create").map((q) => q.sku),
|
|
2071
2083
|
update: M.filter((q) => q.type === "update").map((q) => q.sku)
|
|
2072
2084
|
});
|
|
@@ -2089,7 +2101,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2089
2101
|
}
|
|
2090
2102
|
}
|
|
2091
2103
|
_.open({
|
|
2092
|
-
title:
|
|
2104
|
+
title: i("inventory.ingredient.import.success"),
|
|
2093
2105
|
type: "success"
|
|
2094
2106
|
}), J.length && c.alert(
|
|
2095
2107
|
"Some operation failed",
|
|
@@ -2110,8 +2122,8 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2110
2122
|
);
|
|
2111
2123
|
} catch (f) {
|
|
2112
2124
|
_.open({
|
|
2113
|
-
title:
|
|
2114
|
-
message:
|
|
2125
|
+
title: i("inventory.ingredient.import.error.failed"),
|
|
2126
|
+
message: i("inventory.ingredient.import.error.systemMessage", [f == null ? void 0 : f.message]),
|
|
2115
2127
|
type: "error"
|
|
2116
2128
|
}), console.error("Error in importing skus", $, f);
|
|
2117
2129
|
} finally {
|
|
@@ -2120,12 +2132,12 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2120
2132
|
}
|
|
2121
2133
|
return ($, f) => {
|
|
2122
2134
|
const j = F("FmSwitch"), K = F("FmTable"), me = F("FmCollapsibleTabs"), J = F("FmBottomSheet");
|
|
2123
|
-
return
|
|
2124
|
-
title: o(
|
|
2125
|
-
actions:
|
|
2135
|
+
return u(), O(an, {
|
|
2136
|
+
title: o(i)("inventory.ingredient.title"),
|
|
2137
|
+
actions: ke.value,
|
|
2126
2138
|
"onClick:action": p
|
|
2127
2139
|
}, {
|
|
2128
|
-
default:
|
|
2140
|
+
default: y(() => [
|
|
2129
2141
|
l("div", {
|
|
2130
2142
|
class: te([
|
|
2131
2143
|
"flex flex-col gap-8 max-h-full",
|
|
@@ -2140,16 +2152,16 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2140
2152
|
search: N.value,
|
|
2141
2153
|
"onUpdate:search": f[1] || (f[1] = (M) => N.value = M),
|
|
2142
2154
|
filterable: "",
|
|
2143
|
-
"filter-attributes":
|
|
2155
|
+
"filter-attributes": r.value,
|
|
2144
2156
|
filter: b.value,
|
|
2145
2157
|
"onUpdate:filter": f[2] || (f[2] = (M) => b.value = M)
|
|
2146
2158
|
}, {
|
|
2147
|
-
default:
|
|
2148
|
-
o(T).isEnabled ? (
|
|
2149
|
-
l("span",
|
|
2159
|
+
default: y(() => [
|
|
2160
|
+
o(T).isEnabled ? (u(), w("div", ao, [
|
|
2161
|
+
l("span", so, A(o(i)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
|
|
2150
2162
|
a(gn),
|
|
2151
2163
|
a(He, null, {
|
|
2152
|
-
default:
|
|
2164
|
+
default: y(() => [
|
|
2153
2165
|
a(j, {
|
|
2154
2166
|
modelValue: ne.value,
|
|
2155
2167
|
"onUpdate:modelValue": f[0] || (f[0] = (M) => ne.value = M)
|
|
@@ -2161,7 +2173,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2161
2173
|
]),
|
|
2162
2174
|
_: 1
|
|
2163
2175
|
}, 8, ["search", "filter-attributes", "filter"]),
|
|
2164
|
-
(
|
|
2176
|
+
(u(), O(K, {
|
|
2165
2177
|
key: JSON.stringify(b.value),
|
|
2166
2178
|
style: Nt(o(ee).tableHeight),
|
|
2167
2179
|
"column-defs": o(E),
|
|
@@ -2175,25 +2187,25 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2175
2187
|
onRowClick: f[3] || (f[3] = (M) => o(m)(M.original)),
|
|
2176
2188
|
"page-size": oe.value
|
|
2177
2189
|
}, {
|
|
2178
|
-
"list-row":
|
|
2190
|
+
"list-row": y((M) => [
|
|
2179
2191
|
a(rn, {
|
|
2180
2192
|
row: M,
|
|
2181
2193
|
onRowClick: o(m)
|
|
2182
|
-
},
|
|
2183
|
-
default:
|
|
2184
|
-
var q, de,
|
|
2194
|
+
}, Ye({
|
|
2195
|
+
default: y((R) => {
|
|
2196
|
+
var q, de, Te, _e, Ee, $e, we, be, se, Ve;
|
|
2185
2197
|
return [
|
|
2186
|
-
l("div",
|
|
2187
|
-
l("div",
|
|
2188
|
-
a(o(
|
|
2189
|
-
render: (
|
|
2198
|
+
l("div", ro, [
|
|
2199
|
+
l("div", io, [
|
|
2200
|
+
a(o(bt), {
|
|
2201
|
+
render: (Te = (de = (q = R.code) == null ? void 0 : q.column) == null ? void 0 : de.columnDef) == null ? void 0 : Te.cell,
|
|
2190
2202
|
props: (Ee = (_e = R.code) == null ? void 0 : _e.getContext) == null ? void 0 : Ee.call(_e)
|
|
2191
2203
|
}, null, 8, ["render", "props"])
|
|
2192
2204
|
]),
|
|
2193
|
-
l("div",
|
|
2194
|
-
a(o(
|
|
2195
|
-
render: (be = (
|
|
2196
|
-
props: (
|
|
2205
|
+
l("div", uo, [
|
|
2206
|
+
a(o(bt), {
|
|
2207
|
+
render: (be = (we = ($e = R.name) == null ? void 0 : $e.column) == null ? void 0 : we.columnDef) == null ? void 0 : be.cell,
|
|
2208
|
+
props: (Ve = (se = R.name) == null ? void 0 : se.getContext) == null ? void 0 : Ve.call(se)
|
|
2197
2209
|
}, null, 8, ["render", "props"])
|
|
2198
2210
|
])
|
|
2199
2211
|
])
|
|
@@ -2203,8 +2215,8 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2203
2215
|
}, [
|
|
2204
2216
|
D.value ? {
|
|
2205
2217
|
name: "loading-text",
|
|
2206
|
-
fn:
|
|
2207
|
-
l("div", null, A(o(
|
|
2218
|
+
fn: y(() => [
|
|
2219
|
+
l("div", null, A(o(i)("inventory.ingredient.table.importing")), 1)
|
|
2208
2220
|
]),
|
|
2209
2221
|
key: "0"
|
|
2210
2222
|
} : void 0
|
|
@@ -2213,16 +2225,16 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2213
2225
|
_: 1
|
|
2214
2226
|
}, 8, ["style", "column-defs", "row-data", "search-value", "columnVisibility", "loading", "page-size"]))
|
|
2215
2227
|
], 2),
|
|
2216
|
-
(
|
|
2217
|
-
a(
|
|
2228
|
+
(u(), O(ut, { to: "body" }, [
|
|
2229
|
+
a(jl, zt(Lt(o(v))), null, 16)
|
|
2218
2230
|
])),
|
|
2219
|
-
(
|
|
2231
|
+
(u(), O(ut, { to: "body" }, [
|
|
2220
2232
|
a(J, {
|
|
2221
2233
|
"dismiss-away": "",
|
|
2222
2234
|
modelValue: ae.value,
|
|
2223
2235
|
"onUpdate:modelValue": f[5] || (f[5] = (M) => ae.value = M)
|
|
2224
2236
|
}, {
|
|
2225
|
-
default:
|
|
2237
|
+
default: y(() => [
|
|
2226
2238
|
a(me, {
|
|
2227
2239
|
class: "pb-8",
|
|
2228
2240
|
items: ye,
|
|
@@ -2239,5 +2251,5 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2239
2251
|
}
|
|
2240
2252
|
});
|
|
2241
2253
|
export {
|
|
2242
|
-
|
|
2254
|
+
So as default
|
|
2243
2255
|
};
|