@feedmepos/mf-inventory-portal 1.2.29 → 1.2.30
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-BcetoQcK.js → App-CZJre5y8.js} +56 -54
- package/dist/{ApprovalView-CyRCctkZ.js → ApprovalView-CnxHxojY.js} +34 -28
- package/dist/{BindingsDialog-DLN2RPYo.js → BindingsDialog-C6lCOPNs.js} +2 -2
- package/dist/{BindingsPicker-CDtYeSVh.js → BindingsPicker-DZtFKLQ5.js} +6 -5
- package/dist/{BindingsTable-C19Bm8d6.js → BindingsTable-BmQGLuJ4.js} +28 -24
- package/dist/{ClosingDraftView-DBFIR6Xv.js → ClosingDraftView-KLtlh31f.js} +184 -176
- package/dist/{ClosingHistoryView-BEZOwsPz.js → ClosingHistoryView-Rf1yMhMj.js} +43 -41
- package/dist/{ClosingTemplateView-COifu0I6.js → ClosingTemplateView-C_IiKnGx.js} +116 -98
- package/dist/{DeliveryOrderPrintPreview-lBFtH_Rm.js → DeliveryOrderPrintPreview-UF7V005U.js} +15 -14
- package/dist/FmDroppableField-J0xUsOTV.js +154 -0
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BhhmWaOl.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BcMvEdc0.js} +74 -72
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CqAeF0wL.js +279 -0
- package/dist/{FmMultiselectDialog-CBYvYJnE.js → FmMultiselectDialog-B0aKuf2o.js} +1 -1
- package/dist/FmMultiselectDialog-BasrjBFA.js +597 -0
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CLuceimk.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CaYJJkXz.js} +51 -49
- package/dist/{ImportView-DYNjmjys.js → ImportView-DRSoz0uM.js} +81 -74
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BXefPowE.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DA8SlWPy.js} +5 -5
- package/dist/{IngredientGroupView-CNzK_dDv.js → IngredientGroupView-D5Laak2-.js} +73 -65
- package/dist/{IngredientsView-BnrA0ijB.js → IngredientsView-TG3fPQhR.js} +358 -345
- package/dist/{IntegrationView-DwcP5MgB.js → IntegrationView-CElpjyo7.js} +219 -209
- package/dist/{InventoryBindingForm-DeqdcXzm.js → InventoryBindingForm-CBgxRYBd.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-FuPTxo7z.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Ys5GBHoQ.js} +41 -40
- package/dist/{InventoryBindingSummary-Dp0bshzL.js → InventoryBindingSummary-OK3vNWhi.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DLvWaFvA.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-9QRntUlk.js} +5 -5
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-tLW9bojI.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Bc01NoOn.js} +22 -21
- package/dist/{PublishView-CxIU1aI4.js → PublishView-CLMfiLjP.js} +26 -23
- package/dist/{PurchaseOrderPrintPreview-DWxp3cFM.js → PurchaseOrderPrintPreview-Dy77yWDC.js} +10 -9
- package/dist/{ReceiveRequestView-CF9ingct.js → ReceiveRequestView-BhD-NaHE.js} +324 -308
- package/dist/{RecipeView-B87vakmu.js → RecipeView-RWaO94w_.js} +73 -64
- package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-DY7TaxPK.js +251 -0
- package/dist/{StockView-XJY3690u.js → StockView-D5t8OxaG.js} +292 -282
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DY1iRl1F.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-3Asf1TGd.js} +1 -1
- package/dist/{SupplierView-Y2NqnJ6-.js → SupplierView-DiospFKq.js} +92 -80
- package/dist/SystemTrailDialog.vue_vue_type_script_setup_true_lang-DfCHteOF.js +177 -0
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +135 -0
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CNtvx-LA.js +123 -0
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-l0qRNa0W.js → TransferDetails.vue_vue_type_script_setup_true_lang-p959Op4k.js} +318 -305
- package/dist/{TransferTemplateView-DBlasHGY.js → TransferTemplateView-ePZFdZ0p.js} +228 -216
- package/dist/{UnitView-C8z90hHr.js → UnitView-Banlxw7y.js} +70 -63
- package/dist/{WarehouseView-egtnCnzo.js → WarehouseView-BL-p5hbi.js} +123 -114
- package/dist/WastageTemplateView-B1pmSuW0.js +2288 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-EpEEb8EO.js +64040 -0
- package/dist/app-rgirz_52.js +8024 -0
- package/dist/app.js +6 -6
- package/dist/closing-template-zIjwO1_E.js +117 -0
- package/dist/date2-Dnc8Y81g.js +116 -0
- package/dist/dayjs.min-TdUgzmww.js +282 -0
- package/dist/{decimal-CLM3HUsc.js → decimal-C6s3GvGb.js} +4 -3
- package/dist/defineDeepModel-BSaaXVBF.js +19 -0
- package/dist/duplicate-template-Bw0H416G.js +34 -0
- package/dist/feature-C95Hao53.js +20162 -0
- package/dist/form-mode.enum-BKiNVH6A.js +4 -0
- package/dist/format-time-from-id-DlbHo6kY.js +15 -0
- package/dist/{format-unit-display-BWoznxQp.js → format-unit-display-QBS54q0R.js} +308 -297
- package/dist/{import-export.helper-DgKnsYRB.js → import-export.helper-CUKCKtP7.js} +56 -52
- package/dist/index-CFn_9RMm.js +45 -0
- package/dist/{index-CK61uHgW.js → index-S9Ak__QC.js} +1 -1
- package/dist/{index-tMZSFG5r.js → index-goD-WGVb.js} +16 -14
- package/dist/lodash-gq8IrP4j.js +3678 -0
- package/dist/netsuite-CnhAKyAO.js +4316 -0
- package/dist/{purchase-order-template-D7dkJMqf.js → purchase-order-template-CBIpWdEW.js} +1 -1
- package/dist/router/shared.spec.d.ts +1 -0
- package/dist/row-action.enum-BcW_L_nE.js +67 -0
- package/dist/rules-DKklsaS1.js +201 -0
- package/dist/{stock-B3EEUmkF.js → stock-3K93Mif9.js} +1 -1
- package/dist/{stock-DYBHa0KN.js → stock-BW8fen3H.js} +11 -10
- package/dist/style.css +1 -1
- package/dist/{supplier-CY7Hj_a2.js → supplier-CObCSfot.js} +27 -26
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-Dlv7Eowu.js → use-ingredient-select-dialog-DwvQiaVW.js} +4 -3
- package/dist/{use-inventory-binding-dialog-DOSfDQte.js → use-inventory-binding-dialog-CuLEHLDM.js} +4 -3
- package/dist/use-template-enabled-locations-2-DkUJeppb.js +111 -0
- package/dist/views/adjustment-template/wastage-template/table.d.ts +1 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +1 -1
- package/dist/vue-i18n-CUznvVzc.js +2365 -0
- package/dist/xlsx-bT1p3YVR.js +24004 -0
- package/dist/xlsx.util-Cr9DpDFb.js +78 -0
- package/package.json +6 -6
- package/dist/app-B5p73NM9.js +0 -130949
|
@@ -1,19 +1,32 @@
|
|
|
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
|
|
2
|
-
import { a as Ce,
|
|
3
|
-
import { useDialog as Re, useSnackbar as
|
|
4
|
-
import { i as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { _ 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 l, createVNode as a, withModifiers as Bt, createCommentVNode as L, withCtx as y, createElementVNode as o, 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, c as Tt, S as jt, d as ct, e as mt, f as Wt, h as pt, i as vt, j as ft, k as yt, u as Ht, l as qt } from "./app-EpEEb8EO.js";
|
|
3
|
+
import { useDialog as Re, useSnackbar as Fe, components as Oe, useProxiedModel as gt, useDialogChild as Yt, useBreakpoints as Gt } from "@feedmepos/ui-library";
|
|
4
|
+
import { i as Kt, _ as Zt } from "./is-linked-ingredient-error-fJ2TJb3z.js";
|
|
5
|
+
import { F as H } from "./form-mode.enum-BKiNVH6A.js";
|
|
6
|
+
import { useI18n as ve, useCoreStore as wt } from "@feedmepos/mf-common";
|
|
7
|
+
import { defineStore as Jt, storeToRefs as Qt } from "pinia";
|
|
8
|
+
import { D as bt, R as Me } from "./row-action.enum-BcW_L_nE.js";
|
|
9
|
+
import { c as Xt, _ as en, F as ht } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
10
|
+
import { u as Ae, _ as tn } from "./netsuite-CnhAKyAO.js";
|
|
11
|
+
import { F as He, u as nn, _ as on } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DY7TaxPK.js";
|
|
12
|
+
import { A as Pe, a as ln, t as an, R as Ne, U as sn, M as rn, g as dn } from "./rules-DKklsaS1.js";
|
|
13
|
+
import { g as un, _ as ze, S as Le, a as cn } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-3Asf1TGd.js";
|
|
14
|
+
import { _ as mn } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-Ys5GBHoQ.js";
|
|
15
|
+
import { _ as je } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-DA8SlWPy.js";
|
|
16
|
+
import { u as Vt } from "./feature-C95Hao53.js";
|
|
10
17
|
import { _ as he } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
11
|
-
import { d as Ue, g as
|
|
12
|
-
import { _ as
|
|
13
|
-
import {
|
|
14
|
-
import { u as
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
import { d as Ue, g as pn, e as vn, a as fn } from "./import-export.helper-CUKCKtP7.js";
|
|
19
|
+
import { _ as yn } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
|
|
20
|
+
import { F as gn, a as We } from "./FmMultiselectDialog-BasrjBFA.js";
|
|
21
|
+
import { u as It } from "./purchase-order-template-CBIpWdEW.js";
|
|
22
|
+
import { u as St, a as Ct } from "./closing-template-zIjwO1_E.js";
|
|
23
|
+
import { r as bn } from "./xlsx.util-Cr9DpDFb.js";
|
|
24
|
+
import { F as hn } from "./FmDroppableField-J0xUsOTV.js";
|
|
25
|
+
import { _ as _n } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CqAeF0wL.js";
|
|
26
|
+
import { u as xn } from "./FmMultiselectDialog-B0aKuf2o.js";
|
|
27
|
+
import { N as kn, H as Tn } from "./app-rgirz_52.js";
|
|
28
|
+
const qe = Jt("ingredientForm", function() {
|
|
29
|
+
const s = Re(), T = Fe(), r = Ce(), b = B(!1), { t: S } = ve(), U = B();
|
|
17
30
|
function k() {
|
|
18
31
|
const i = {
|
|
19
32
|
sku: {},
|
|
@@ -45,9 +58,9 @@ const qe = vn("ingredientForm", function() {
|
|
|
45
58
|
type: "success"
|
|
46
59
|
});
|
|
47
60
|
} catch (d) {
|
|
48
|
-
d instanceof jt &&
|
|
61
|
+
d instanceof jt && Kt(d) ? s.open({
|
|
49
62
|
title: "Cannot delete ingredient",
|
|
50
|
-
contentComponent:
|
|
63
|
+
contentComponent: Zt,
|
|
51
64
|
contentComponentProps: {
|
|
52
65
|
subject: (i == null ? void 0 : i.name) ?? "",
|
|
53
66
|
items: d.errorResponse.message
|
|
@@ -97,7 +110,7 @@ const qe = vn("ingredientForm", function() {
|
|
|
97
110
|
}, An = {
|
|
98
111
|
key: 1,
|
|
99
112
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
100
|
-
}, 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" },
|
|
113
|
+
}, 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({
|
|
101
114
|
__name: "ItemSubsidiaryTreeDialog",
|
|
102
115
|
props: {
|
|
103
116
|
skuId: {},
|
|
@@ -105,7 +118,7 @@ const qe = vn("ingredientForm", function() {
|
|
|
105
118
|
itemCode: {}
|
|
106
119
|
},
|
|
107
120
|
setup(W) {
|
|
108
|
-
const s = W, { t: T } = ve(), r =
|
|
121
|
+
const s = W, { t: T } = ve(), r = wt(), b = Ae(), S = B(!1), U = g(() => {
|
|
109
122
|
var m;
|
|
110
123
|
return ((m = r.sessionUser.value) == null ? void 0 : m.role.isAdmin) ?? !1;
|
|
111
124
|
}), k = g(() => b.getSkuSubsidiaries(s.skuId)), n = g(() => {
|
|
@@ -124,22 +137,22 @@ const qe = vn("ingredientForm", function() {
|
|
|
124
137
|
function c(m, v = [], V = !1) {
|
|
125
138
|
const E = [];
|
|
126
139
|
return m.forEach((p, N) => {
|
|
127
|
-
const
|
|
140
|
+
const D = N === m.length - 1, fe = [...v, D];
|
|
128
141
|
let ne = "";
|
|
129
142
|
for (let ee = 0; ee < v.length; ee++)
|
|
130
143
|
ne += v[ee] ? " " : "│ ";
|
|
131
|
-
ne +=
|
|
132
|
-
const ce = n.value.has(p.id),
|
|
144
|
+
ne += D ? "└── " : "├── ";
|
|
145
|
+
const ce = n.value.has(p.id), oe = p.isAssigned === !0, le = V && !oe;
|
|
133
146
|
if (E.push({
|
|
134
147
|
id: p.id,
|
|
135
148
|
name: p.name,
|
|
136
149
|
prefix: v.length === 0 ? "" : ne,
|
|
137
150
|
isHighlighted: ce,
|
|
138
|
-
isDirectlyBound:
|
|
139
|
-
isParentIncludedChild:
|
|
151
|
+
isDirectlyBound: oe,
|
|
152
|
+
isParentIncludedChild: le,
|
|
140
153
|
isRoot: v.length === 0
|
|
141
154
|
}), p.children && p.children.length > 0) {
|
|
142
|
-
const ee = V ||
|
|
155
|
+
const ee = V || oe && k.value.includeChildren;
|
|
143
156
|
E.push(...c(p.children, fe, ee));
|
|
144
157
|
}
|
|
145
158
|
}), E;
|
|
@@ -148,7 +161,7 @@ const qe = vn("ingredientForm", function() {
|
|
|
148
161
|
const V = /* @__PURE__ */ new Set();
|
|
149
162
|
for (const E of m) {
|
|
150
163
|
const p = [...v, E.id];
|
|
151
|
-
E.isAssigned === !0 && p.forEach((N) => V.add(N)), E.children && E.children.length > 0 && _(E.children, p).forEach((
|
|
164
|
+
E.isAssigned === !0 && p.forEach((N) => V.add(N)), E.children && E.children.length > 0 && _(E.children, p).forEach((D) => V.add(D));
|
|
152
165
|
}
|
|
153
166
|
return V;
|
|
154
167
|
}
|
|
@@ -170,7 +183,7 @@ const qe = vn("ingredientForm", function() {
|
|
|
170
183
|
return (m, v) => {
|
|
171
184
|
const V = F("FmButton"), E = F("FmDialog");
|
|
172
185
|
return u(), w(X, null, [
|
|
173
|
-
|
|
186
|
+
l(b).isEnabled ? (u(), w("div", wn, [
|
|
174
187
|
a(V, {
|
|
175
188
|
"prepend-icon": "info",
|
|
176
189
|
variant: "tertiary",
|
|
@@ -184,30 +197,30 @@ const qe = vn("ingredientForm", function() {
|
|
|
184
197
|
dismissAway: ""
|
|
185
198
|
}, {
|
|
186
199
|
"dialog-header": y(() => [
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
200
|
+
o("div", Vn, [
|
|
201
|
+
o("div", In, A(l(T)("inventory.integration.netsuite.subsidiaryHierarchy.title")), 1),
|
|
202
|
+
o("p", Sn, " Name: " + A(s.itemName), 1),
|
|
203
|
+
o("p", Cn, " Code: " + A(s.itemCode), 1),
|
|
191
204
|
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. ")),
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
v[2] || (v[2] =
|
|
195
|
-
|
|
205
|
+
o("div", En, [
|
|
206
|
+
o("div", $n, [
|
|
207
|
+
v[2] || (v[2] = o("span", { class: "font-semibold" }, "Include Children Subsidiaries:", -1)),
|
|
208
|
+
o("span", {
|
|
196
209
|
class: te(
|
|
197
210
|
k.value.includeChildren ? "text-green-600 font-semibold" : "text-red-600 font-semibold"
|
|
198
211
|
)
|
|
199
212
|
}, A(k.value.includeChildren ? "Yes" : "No"), 3)
|
|
200
213
|
]),
|
|
201
|
-
|
|
202
|
-
v[4] || (v[4] =
|
|
203
|
-
|
|
204
|
-
|
|
214
|
+
o("div", Mn, [
|
|
215
|
+
v[4] || (v[4] = o("div", { class: "flex items-center gap-2 px-2 py-1 bg-fm-color-bg-brand-secondary rounded-md" }, [
|
|
216
|
+
o("span", { class: "w-3 h-3 rounded-sm bg-green-400" }),
|
|
217
|
+
o("span", { class: "fm-typo-en-body-sm-400" }, "Directly Bound")
|
|
205
218
|
], -1)),
|
|
206
219
|
a(He, null, {
|
|
207
220
|
default: y(() => v[3] || (v[3] = [
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
221
|
+
o("div", { class: "flex items-center gap-2 px-2 py-1 rounded-md" }, [
|
|
222
|
+
o("span", { class: "w-3 h-3 rounded-sm bg-blue-400" }),
|
|
223
|
+
o("span", { class: "fm-typo-en-body-sm-400" }, "Included as Child")
|
|
211
224
|
], -1)
|
|
212
225
|
])),
|
|
213
226
|
_: 1
|
|
@@ -217,20 +230,20 @@ const qe = vn("ingredientForm", function() {
|
|
|
217
230
|
])
|
|
218
231
|
]),
|
|
219
232
|
default: y(() => [
|
|
220
|
-
|
|
221
|
-
|
|
233
|
+
o("div", Un, [
|
|
234
|
+
o("div", Pn, [
|
|
222
235
|
(u(!0), w(X, null, ue(d.value, (p) => (u(), w("div", {
|
|
223
236
|
key: p.id,
|
|
224
237
|
class: "flex items-stretch"
|
|
225
238
|
}, [
|
|
226
|
-
|
|
227
|
-
p.isParentIncludedChild ? (u(),
|
|
239
|
+
o("span", Rn, A(p.prefix), 1),
|
|
240
|
+
p.isParentIncludedChild ? (u(), O(He, {
|
|
228
241
|
key: 0,
|
|
229
242
|
class: "flex-1"
|
|
230
243
|
}, {
|
|
231
244
|
default: y(() => [
|
|
232
|
-
|
|
233
|
-
|
|
245
|
+
o("div", Bn, [
|
|
246
|
+
o("span", Dn, A(p.name), 1)
|
|
234
247
|
])
|
|
235
248
|
]),
|
|
236
249
|
_: 2
|
|
@@ -241,7 +254,7 @@ const qe = vn("ingredientForm", function() {
|
|
|
241
254
|
p.isDirectlyBound ? "border-2 bg-green-200 border-green-400" : "bg-fm-color-bg-primary border border-fm-color-border-secondary"
|
|
242
255
|
])
|
|
243
256
|
}, [
|
|
244
|
-
|
|
257
|
+
o("span", {
|
|
245
258
|
class: te([
|
|
246
259
|
p.isHighlighted ? "fm-typo-en-body-md-600 text-fm-color-typo-primary" : "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
247
260
|
])
|
|
@@ -258,7 +271,7 @@ const qe = vn("ingredientForm", function() {
|
|
|
258
271
|
}
|
|
259
272
|
});
|
|
260
273
|
function Nn() {
|
|
261
|
-
const { updateIngredient: W, deleteIngredient: s } = qe(), T = Ce(), r =
|
|
274
|
+
const { updateIngredient: W, deleteIngredient: s } = qe(), T = Ce(), r = Ae();
|
|
262
275
|
Re();
|
|
263
276
|
const { t: b } = ve();
|
|
264
277
|
async function S(k, n) {
|
|
@@ -290,11 +303,11 @@ function Nn() {
|
|
|
290
303
|
);
|
|
291
304
|
return Q("div", { class: "flex items-center w-full gap-4" }, [
|
|
292
305
|
_ ? Q(
|
|
293
|
-
|
|
306
|
+
Oe.FmTooltip,
|
|
294
307
|
{ class: "text-left" },
|
|
295
308
|
{
|
|
296
309
|
default() {
|
|
297
|
-
return Q(
|
|
310
|
+
return Q(Oe.FmIcon, {
|
|
298
311
|
name: "info",
|
|
299
312
|
color: "system-error-300",
|
|
300
313
|
size: "sm"
|
|
@@ -316,7 +329,7 @@ function Nn() {
|
|
|
316
329
|
cell(k) {
|
|
317
330
|
const n = k.row.original, c = _t(n);
|
|
318
331
|
return Q(
|
|
319
|
-
|
|
332
|
+
Oe.FmTooltip,
|
|
320
333
|
{ zIndex: 51, content: c },
|
|
321
334
|
Q(
|
|
322
335
|
"span",
|
|
@@ -362,7 +375,7 @@ function Nn() {
|
|
|
362
375
|
},
|
|
363
376
|
c.join(", ")
|
|
364
377
|
),
|
|
365
|
-
Q(
|
|
378
|
+
Q(On, { skuId: n._id, itemName: n.name, itemCode: n.code })
|
|
366
379
|
]);
|
|
367
380
|
},
|
|
368
381
|
enableSorting: !1,
|
|
@@ -372,8 +385,8 @@ function Nn() {
|
|
|
372
385
|
id: "action",
|
|
373
386
|
header: "",
|
|
374
387
|
cell(k) {
|
|
375
|
-
return
|
|
376
|
-
[
|
|
388
|
+
return Xt(
|
|
389
|
+
[bt[Me.Edit], bt[Me.Delete]],
|
|
377
390
|
(n) => {
|
|
378
391
|
S(n, k.row.original);
|
|
379
392
|
}
|
|
@@ -423,7 +436,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
423
436
|
inventoryBindings: []
|
|
424
437
|
}) : S("update:modelValue", null);
|
|
425
438
|
}
|
|
426
|
-
}), n = g(() =>
|
|
439
|
+
}), n = g(() => un(r.value));
|
|
427
440
|
function c(d) {
|
|
428
441
|
const m = T.modelValue ?? {};
|
|
429
442
|
m.measurement = d ? `${d}` : null, S("update:modelValue", m);
|
|
@@ -439,7 +452,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
439
452
|
});
|
|
440
453
|
return (d, m) => {
|
|
441
454
|
const v = F("FmSwitch"), V = F("FmSelect"), E = F("FmCard");
|
|
442
|
-
return u(),
|
|
455
|
+
return u(), O(E, {
|
|
443
456
|
variant: "outlined",
|
|
444
457
|
class: "p-16 flex flex-col gap-16"
|
|
445
458
|
}, {
|
|
@@ -449,28 +462,28 @@ const zn = /* @__PURE__ */ pe({
|
|
|
449
462
|
a(v, {
|
|
450
463
|
value: "",
|
|
451
464
|
"model-value": k.value,
|
|
452
|
-
"onUpdate:modelValue": m[0] || (m[0] = (
|
|
453
|
-
label:
|
|
454
|
-
sublabel:
|
|
465
|
+
"onUpdate:modelValue": m[0] || (m[0] = (D) => k.value = D),
|
|
466
|
+
label: l(U)("inventory.ingredient.convertible.title"),
|
|
467
|
+
sublabel: l(U)("inventory.ingredient.convertible.subtitle"),
|
|
455
468
|
labelPlacement: "right",
|
|
456
469
|
disabled: d.readonly
|
|
457
470
|
}, null, 8, ["model-value", "label", "sublabel", "disabled"]),
|
|
458
471
|
k.value ? (u(), w(X, { key: 0 }, [
|
|
459
|
-
|
|
472
|
+
o("div", null, [
|
|
460
473
|
a(V, {
|
|
461
|
-
label:
|
|
474
|
+
label: l(U)("inventory.ingredient.convertible.convertTo"),
|
|
462
475
|
modelValue: (p = i.value) == null ? void 0 : p.value,
|
|
463
476
|
"onUpdate:modelValue": c,
|
|
464
477
|
items: n.value,
|
|
465
478
|
disabled: d.readonly
|
|
466
479
|
}, null, 8, ["label", "modelValue", "items", "disabled"])
|
|
467
480
|
]),
|
|
468
|
-
a(
|
|
481
|
+
a(mn, {
|
|
469
482
|
id: b.value,
|
|
470
483
|
"model-value": ((N = d.modelValue) == null ? void 0 : N.inventoryBindings) ?? [],
|
|
471
484
|
"onUpdate:modelValue": _,
|
|
472
485
|
"exclude-binding-id": b.value,
|
|
473
|
-
rules: [
|
|
486
|
+
rules: [l(Pe)(1)],
|
|
474
487
|
readonly: d.readonly
|
|
475
488
|
}, null, 8, ["id", "model-value", "exclude-binding-id", "rules", "readonly"])
|
|
476
489
|
], 64)) : L("", !0)
|
|
@@ -509,7 +522,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
509
522
|
xe(s.$slots, "field", {}, () => [
|
|
510
523
|
a(U, { disabled: s.disabled }, Ye({
|
|
511
524
|
prepend: y(() => [
|
|
512
|
-
s.tooltipMessage ? (u(),
|
|
525
|
+
s.tooltipMessage ? (u(), O(S, {
|
|
513
526
|
key: 0,
|
|
514
527
|
placement: s.tooltipPlacement,
|
|
515
528
|
"z-index": s.tooltipZIndex
|
|
@@ -524,7 +537,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
524
537
|
})
|
|
525
538
|
]),
|
|
526
539
|
_: 1
|
|
527
|
-
}, 8, ["placement", "z-index"])) : (u(),
|
|
540
|
+
}, 8, ["placement", "z-index"])) : (u(), O(b, {
|
|
528
541
|
key: 1,
|
|
529
542
|
name: "lock",
|
|
530
543
|
color: "neutral-gray-400"
|
|
@@ -532,7 +545,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
532
545
|
]),
|
|
533
546
|
default: y(() => [
|
|
534
547
|
xe(s.$slots, "modelValue", {}, () => [
|
|
535
|
-
|
|
548
|
+
o("div", {
|
|
536
549
|
class: te([
|
|
537
550
|
s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary",
|
|
538
551
|
"line-clamp-1 text-ellipsis break-all"
|
|
@@ -546,7 +559,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
546
559
|
name: "append",
|
|
547
560
|
fn: y(() => [
|
|
548
561
|
xe(s.$slots, "fieldAppend", {}, () => [
|
|
549
|
-
|
|
562
|
+
o("div", jn, A(s.appendText), 1)
|
|
550
563
|
])
|
|
551
564
|
]),
|
|
552
565
|
key: "0"
|
|
@@ -554,7 +567,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
554
567
|
]), 1032, ["disabled"])
|
|
555
568
|
]),
|
|
556
569
|
xe(s.$slots, "helper-text", {}, () => [
|
|
557
|
-
|
|
570
|
+
o("div", {
|
|
558
571
|
class: te([
|
|
559
572
|
"fm-typo-en-body-sm-400 line-clamp-1",
|
|
560
573
|
s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
|
|
@@ -564,31 +577,31 @@ const zn = /* @__PURE__ */ pe({
|
|
|
564
577
|
])) : xe(s.$slots, "default", { key: 1 });
|
|
565
578
|
};
|
|
566
579
|
}
|
|
567
|
-
}), 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" },
|
|
580
|
+
}), 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" }, Zn = {
|
|
568
581
|
key: 3,
|
|
569
582
|
class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
|
|
570
|
-
},
|
|
583
|
+
}, Jn = { class: "flex flex-col" }, Qn = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Xn = {
|
|
571
584
|
key: 4,
|
|
572
585
|
class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
|
|
573
|
-
},
|
|
586
|
+
}, eo = { class: "flex flex-col gap-12" }, to = { class: "flex flex-col gap-4" }, no = { class: "fm-typo-en-title-sm-600" }, oo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, lo = { class: "flex flex-col gap-4" }, ao = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, so = { class: "flex-1 p-12 flex flex-col gap-8" }, ro = { class: "mx-auto" }, io = { class: "flex flex-col" }, uo = { class: "fm-typo-en-body-sm-600 translate-y-4" }, co = { class: "flex-1 p-12 flex flex-col gap-8" }, mo = { class: "mx-auto" }, po = { class: "flex flex-col" }, vo = { class: "fm-typo-en-body-sm-600 translate-y-4" }, fo = { class: "flex-1 p-12 flex flex-col gap-8" }, yo = { class: "mx-auto" }, go = { class: "flex flex-col" }, bo = { class: "fm-typo-en-body-sm-600 translate-y-4" }, ho = {
|
|
574
587
|
key: 5,
|
|
575
588
|
class: "flex flex-col gap-12"
|
|
576
|
-
},
|
|
589
|
+
}, _o = { class: "flex flex-col" }, xo = { class: "flex items-center justify-between" }, ko = { class: "fm-typo-en-title-sm-600" }, To = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, wo = {
|
|
577
590
|
key: 0,
|
|
578
591
|
class: "flex flex-col gap-8"
|
|
579
|
-
},
|
|
592
|
+
}, Vo = { class: "flex flex-wrap gap-8" }, Io = {
|
|
580
593
|
key: 6,
|
|
581
594
|
class: "flex flex-col gap-12"
|
|
582
|
-
},
|
|
595
|
+
}, So = { class: "flex flex-col" }, Co = { class: "flex items-center justify-between" }, Fo = { class: "fm-typo-en-title-sm-600" }, Ao = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Eo = {
|
|
583
596
|
key: 0,
|
|
584
597
|
class: "flex flex-col gap-8"
|
|
585
|
-
},
|
|
598
|
+
}, $o = { class: "flex flex-wrap gap-8" }, Mo = {
|
|
586
599
|
key: 7,
|
|
587
600
|
class: "flex flex-col gap-12"
|
|
588
|
-
},
|
|
601
|
+
}, Uo = { class: "flex flex-col" }, Po = { class: "flex items-center justify-between" }, Ro = { class: "fm-typo-en-title-sm-600" }, Bo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Do = {
|
|
589
602
|
key: 0,
|
|
590
603
|
class: "flex flex-col gap-8"
|
|
591
|
-
},
|
|
604
|
+
}, Oo = { class: "flex flex-wrap gap-8" }, No = /* @__PURE__ */ pe({
|
|
592
605
|
__name: "IngredientForm",
|
|
593
606
|
props: /* @__PURE__ */ it({
|
|
594
607
|
mode: {},
|
|
@@ -605,21 +618,21 @@ const zn = /* @__PURE__ */ pe({
|
|
|
605
618
|
setup(W, { expose: s, emit: T }) {
|
|
606
619
|
var et;
|
|
607
620
|
const { t: r } = ve(), b = Re();
|
|
608
|
-
|
|
609
|
-
const S =
|
|
621
|
+
Fe();
|
|
622
|
+
const S = It(), U = St(), k = Ct(), n = W, c = T, _ = Ce(), i = wt(), d = Vt(), m = Ae(), v = g(() => m.isEnabled);
|
|
610
623
|
B(void 0);
|
|
611
624
|
const V = B([]), E = B([]), p = B([]), N = B(!1);
|
|
612
|
-
function
|
|
625
|
+
function D(e) {
|
|
613
626
|
if (e.length === 0) return;
|
|
614
627
|
const t = e[0], x = n.modelValue ?? {
|
|
615
628
|
unit: _.units.find((C) => C)
|
|
616
629
|
};
|
|
617
630
|
x.unit || (x.unit = t, c("update:modelValue", x));
|
|
618
631
|
}
|
|
619
|
-
|
|
620
|
-
|
|
632
|
+
Dt(() => {
|
|
633
|
+
D(_.units), n.mode === H.CREATE && (d.mustUsePoTemplate && ne(), d.enableWastageTemplate && ce(), d.enableClosingTemplate && oe());
|
|
621
634
|
}), kt([() => _.units], ([e]) => {
|
|
622
|
-
|
|
635
|
+
D(e);
|
|
623
636
|
});
|
|
624
637
|
function fe() {
|
|
625
638
|
c("click:submit");
|
|
@@ -648,7 +661,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
648
661
|
N.value = !1;
|
|
649
662
|
}
|
|
650
663
|
}
|
|
651
|
-
async function
|
|
664
|
+
async function oe() {
|
|
652
665
|
p.value = [], N.value = !0;
|
|
653
666
|
try {
|
|
654
667
|
const [e] = await Promise.all([k.readTemplates()]).delayed(
|
|
@@ -661,7 +674,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
661
674
|
N.value = !1;
|
|
662
675
|
}
|
|
663
676
|
}
|
|
664
|
-
const
|
|
677
|
+
const le = g({
|
|
665
678
|
get() {
|
|
666
679
|
var e;
|
|
667
680
|
return ((e = n.modelValue) == null ? void 0 : e.code) ?? "";
|
|
@@ -698,7 +711,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
698
711
|
get() {
|
|
699
712
|
var t, x;
|
|
700
713
|
const e = (x = (t = n.modelValue) == null ? void 0 : t.defaultCost) == null ? void 0 : x.costPerUnit;
|
|
701
|
-
return e ? +
|
|
714
|
+
return e ? +ln(e) : 0;
|
|
702
715
|
},
|
|
703
716
|
set(e) {
|
|
704
717
|
var x, C, Y, z;
|
|
@@ -709,7 +722,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
709
722
|
costPerUnit: {
|
|
710
723
|
amount: 0,
|
|
711
724
|
precision: 2,
|
|
712
|
-
currency: ((x =
|
|
725
|
+
currency: ((x = ct(i.currentCountry.value)) == null ? void 0 : x.currency) ?? "MYR"
|
|
713
726
|
},
|
|
714
727
|
measurement: (z = (Y = (C = n.modelValue) == null ? void 0 : C.unit) == null ? void 0 : Y.measurements) == null ? void 0 : z.find(
|
|
715
728
|
(re) => {
|
|
@@ -719,7 +732,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
719
732
|
)
|
|
720
733
|
}), t.defaultCost.costPerUnit = {
|
|
721
734
|
...t.defaultCost.costPerUnit,
|
|
722
|
-
...
|
|
735
|
+
...an(+e, 4)
|
|
723
736
|
}, c("update:modelValue", t);
|
|
724
737
|
}
|
|
725
738
|
}), ge = g(() => {
|
|
@@ -751,8 +764,8 @@ const zn = /* @__PURE__ */ pe({
|
|
|
751
764
|
displayAsSection: !1
|
|
752
765
|
}))
|
|
753
766
|
])
|
|
754
|
-
), h =
|
|
755
|
-
() => new
|
|
767
|
+
), h = Ot(W, "search"), P = g(
|
|
768
|
+
() => new gn(ke.value, ["label", "value"], {
|
|
756
769
|
caseSensitive: !1,
|
|
757
770
|
sort: !0
|
|
758
771
|
})
|
|
@@ -774,7 +787,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
774
787
|
...((re = z.defaultCost) == null ? void 0 : re.costPerUnit) ?? {
|
|
775
788
|
amount: 0,
|
|
776
789
|
precision: 2,
|
|
777
|
-
currency: ((ie =
|
|
790
|
+
currency: ((ie = ct(i.currentCountry.value)) == null ? void 0 : ie.currency) ?? "MYR"
|
|
778
791
|
}
|
|
779
792
|
}
|
|
780
793
|
}), c("update:modelValue", z);
|
|
@@ -790,10 +803,10 @@ const zn = /* @__PURE__ */ pe({
|
|
|
790
803
|
} : {};
|
|
791
804
|
e ? t.convert = e : t.convert = null, c("update:modelValue", t);
|
|
792
805
|
}
|
|
793
|
-
}), K = g(() =>
|
|
806
|
+
}), K = g(() => mt.options.filter(
|
|
794
807
|
(e) => (
|
|
795
808
|
// e === F_INVENTORY_VALUATION_METHODS.enum.FIFO ||
|
|
796
|
-
e ===
|
|
809
|
+
e === mt.enum.WAVG
|
|
797
810
|
)
|
|
798
811
|
).map((e) => ({
|
|
799
812
|
label: r(`inventory.ingredient.valuationMethod.${e}`),
|
|
@@ -809,7 +822,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
809
822
|
} : {};
|
|
810
823
|
t.valuation = e, c("update:modelValue", t);
|
|
811
824
|
}
|
|
812
|
-
}),
|
|
825
|
+
}), Z = g({
|
|
813
826
|
get() {
|
|
814
827
|
var e;
|
|
815
828
|
return ((e = n.modelValue) == null ? void 0 : e.customAttributes) ?? {};
|
|
@@ -905,10 +918,10 @@ const zn = /* @__PURE__ */ pe({
|
|
|
905
918
|
value: e._id || "template_" + e.name
|
|
906
919
|
})) : []), Ke = g(() => Ve.value.filter(
|
|
907
920
|
(e) => (n.purchaseOrderTemplateIds ?? []).includes(e.value)
|
|
908
|
-
)),
|
|
921
|
+
)), Ze = g(() => d.enableWastageTemplate && n.mode === H.CREATE && E.value.length > 0 ? E.value.map((e) => ({
|
|
909
922
|
label: e.name || "Template",
|
|
910
923
|
value: e._id || "template_" + e.name
|
|
911
|
-
})) : []),
|
|
924
|
+
})) : []), Je = g(() => Ze.value.filter(
|
|
912
925
|
(e) => (n.wastageTemplateIds ?? []).includes(e.value)
|
|
913
926
|
)), Qe = g(() => d.enableClosingTemplate && n.mode === H.CREATE && p.value.length > 0 ? p.value.map((e) => ({
|
|
914
927
|
label: e.name || "Template",
|
|
@@ -920,7 +933,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
920
933
|
b.open({
|
|
921
934
|
title: r("inventory.ingredient.purchaseOrderTemplates.selectTitle"),
|
|
922
935
|
closeButton: !0,
|
|
923
|
-
contentComponent:
|
|
936
|
+
contentComponent: We,
|
|
924
937
|
contentComponentProps: {
|
|
925
938
|
modelValue: n.purchaseOrderTemplateIds ?? [],
|
|
926
939
|
items: Ve.value
|
|
@@ -942,10 +955,10 @@ const zn = /* @__PURE__ */ pe({
|
|
|
942
955
|
b.open({
|
|
943
956
|
title: r("inventory.ingredient.wastageTemplates.selectTitle"),
|
|
944
957
|
closeButton: !0,
|
|
945
|
-
contentComponent:
|
|
958
|
+
contentComponent: We,
|
|
946
959
|
contentComponentProps: {
|
|
947
960
|
modelValue: n.wastageTemplateIds ?? [],
|
|
948
|
-
items:
|
|
961
|
+
items: Ze.value
|
|
949
962
|
},
|
|
950
963
|
primaryActions: {
|
|
951
964
|
text: r("common.confirm"),
|
|
@@ -964,7 +977,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
964
977
|
b.open({
|
|
965
978
|
title: r("inventory.ingredient.closingTemplates.selectTitle"),
|
|
966
979
|
closeButton: !0,
|
|
967
|
-
contentComponent:
|
|
980
|
+
contentComponent: We,
|
|
968
981
|
contentComponentProps: {
|
|
969
982
|
modelValue: n.closingTemplateIds ?? [],
|
|
970
983
|
items: Qe.value
|
|
@@ -988,8 +1001,8 @@ const zn = /* @__PURE__ */ pe({
|
|
|
988
1001
|
};
|
|
989
1002
|
}
|
|
990
1003
|
return (e, t) => {
|
|
991
|
-
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"),
|
|
992
|
-
return u(),
|
|
1004
|
+
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"), ot = F("FmStepperField"), Be = F("FmButton"), De = F("FmChip"), Pt = F("FmForm");
|
|
1005
|
+
return u(), O(Pt, {
|
|
993
1006
|
disabled: e.disabled,
|
|
994
1007
|
ref_key: "formRef",
|
|
995
1008
|
ref: M,
|
|
@@ -997,36 +1010,36 @@ const zn = /* @__PURE__ */ pe({
|
|
|
997
1010
|
onValidationSuccess: fe
|
|
998
1011
|
}, {
|
|
999
1012
|
default: y(() => {
|
|
1000
|
-
var
|
|
1013
|
+
var lt, at, st, rt;
|
|
1001
1014
|
return [
|
|
1002
|
-
|
|
1003
|
-
|
|
1015
|
+
o("div", Wn, [
|
|
1016
|
+
o("div", Hn, [
|
|
1004
1017
|
a(Se, {
|
|
1005
1018
|
"tooltip-message": "This field is managed by NetSuite",
|
|
1006
1019
|
"tooltip-z-index": 50,
|
|
1007
|
-
label:
|
|
1008
|
-
"model-value":
|
|
1009
|
-
"onUpdate:modelValue": t[1] || (t[1] = (I) =>
|
|
1020
|
+
label: l(r)("inventory.ingredient.code"),
|
|
1021
|
+
"model-value": le.value,
|
|
1022
|
+
"onUpdate:modelValue": t[1] || (t[1] = (I) => le.value = I),
|
|
1010
1023
|
locked: v.value,
|
|
1011
1024
|
disabled: e.disabled
|
|
1012
1025
|
}, {
|
|
1013
1026
|
default: y(() => [
|
|
1014
1027
|
a(x, {
|
|
1015
|
-
label:
|
|
1016
|
-
"model-value":
|
|
1017
|
-
"onUpdate:modelValue": t[0] || (t[0] = (I) =>
|
|
1018
|
-
rules: [
|
|
1028
|
+
label: l(r)("inventory.ingredient.code"),
|
|
1029
|
+
"model-value": le.value,
|
|
1030
|
+
"onUpdate:modelValue": t[0] || (t[0] = (I) => le.value = I),
|
|
1031
|
+
rules: [l(Ne)(), l(sn)(_e.value, Ee.value)],
|
|
1019
1032
|
"label-mark": "required"
|
|
1020
1033
|
}, null, 8, ["label", "model-value", "rules"])
|
|
1021
1034
|
]),
|
|
1022
1035
|
_: 1
|
|
1023
1036
|
}, 8, ["label", "model-value", "locked", "disabled"])
|
|
1024
1037
|
]),
|
|
1025
|
-
|
|
1038
|
+
o("div", qn, [
|
|
1026
1039
|
a(Se, {
|
|
1027
1040
|
"tooltip-message": "This field is managed by NetSuite",
|
|
1028
1041
|
"tooltip-z-index": 50,
|
|
1029
|
-
label:
|
|
1042
|
+
label: l(r)("inventory.ingredient.name"),
|
|
1030
1043
|
"model-value": ae.value,
|
|
1031
1044
|
"onUpdate:modelValue": t[3] || (t[3] = (I) => ae.value = I),
|
|
1032
1045
|
locked: v.value,
|
|
@@ -1034,10 +1047,10 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1034
1047
|
}, {
|
|
1035
1048
|
default: y(() => [
|
|
1036
1049
|
a(x, {
|
|
1037
|
-
label:
|
|
1050
|
+
label: l(r)("inventory.ingredient.name"),
|
|
1038
1051
|
"model-value": ae.value,
|
|
1039
1052
|
"onUpdate:modelValue": t[2] || (t[2] = (I) => ae.value = I),
|
|
1040
|
-
rules: [
|
|
1053
|
+
rules: [l(Ne)()],
|
|
1041
1054
|
"label-mark": "required"
|
|
1042
1055
|
}, null, 8, ["label", "model-value", "rules"])
|
|
1043
1056
|
]),
|
|
@@ -1048,8 +1061,8 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1048
1061
|
a(Se, {
|
|
1049
1062
|
"tooltip-message": "This field is managed by NetSuite",
|
|
1050
1063
|
"tooltip-z-index": 50,
|
|
1051
|
-
label:
|
|
1052
|
-
"helper-text": (
|
|
1064
|
+
label: l(r)("inventory.ingredient.unit"),
|
|
1065
|
+
"helper-text": (lt = e.modelValue) != null && lt.trackingMeasurement ? `Base unit: ${(st = (at = e.modelValue) == null ? void 0 : at.unit) == null ? void 0 : st.name}` : void 0,
|
|
1053
1066
|
"model-value": (rt = ge.value) == null ? void 0 : rt.name,
|
|
1054
1067
|
locked: v.value,
|
|
1055
1068
|
disabled: e.disabled
|
|
@@ -1057,12 +1070,12 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1057
1070
|
default: y(() => [
|
|
1058
1071
|
a(tt, {
|
|
1059
1072
|
"model-value": ge.value,
|
|
1060
|
-
rules: [
|
|
1073
|
+
rules: [l(Ne)()],
|
|
1061
1074
|
"label-mark": "required"
|
|
1062
1075
|
}, {
|
|
1063
1076
|
label: y(() => [
|
|
1064
1077
|
a(C, {
|
|
1065
|
-
label:
|
|
1078
|
+
label: l(r)("inventory.ingredient.unit")
|
|
1066
1079
|
}, null, 8, ["label"])
|
|
1067
1080
|
]),
|
|
1068
1081
|
default: y(({ invalid: I }) => [
|
|
@@ -1080,19 +1093,19 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1080
1093
|
"append-icon": "expand_more"
|
|
1081
1094
|
}, {
|
|
1082
1095
|
default: y(() => {
|
|
1083
|
-
var
|
|
1096
|
+
var J;
|
|
1084
1097
|
return [
|
|
1085
|
-
Ge(A((
|
|
1098
|
+
Ge(A((J = ge.value) == null ? void 0 : J.name), 1)
|
|
1086
1099
|
];
|
|
1087
1100
|
}),
|
|
1088
1101
|
_: 2
|
|
1089
1102
|
}, 1032, ["class", "invalid"])
|
|
1090
1103
|
]),
|
|
1091
1104
|
default: y(() => [
|
|
1092
|
-
|
|
1105
|
+
o("div", Yn, [
|
|
1093
1106
|
a(x, {
|
|
1094
1107
|
modelValue: h.value,
|
|
1095
|
-
"onUpdate:modelValue": t[4] || (t[4] = (
|
|
1108
|
+
"onUpdate:modelValue": t[4] || (t[4] = (J) => h.value = J),
|
|
1096
1109
|
placeholder: "Filter options"
|
|
1097
1110
|
}, {
|
|
1098
1111
|
prepend: y(() => [
|
|
@@ -1100,22 +1113,22 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1100
1113
|
]),
|
|
1101
1114
|
_: 1
|
|
1102
1115
|
}, 8, ["modelValue"]),
|
|
1103
|
-
|
|
1116
|
+
o("div", {
|
|
1104
1117
|
class: "overflow-x-hidden overflow-y-auto max-h-[300px]",
|
|
1105
1118
|
onVnodeMounted: $e
|
|
1106
1119
|
}, [
|
|
1107
|
-
(u(!0), w(X, null, ue(G.value, (
|
|
1108
|
-
|
|
1120
|
+
(u(!0), w(X, null, ue(G.value, (J, Rt) => (u(), w(X, { key: Rt }, [
|
|
1121
|
+
J.displayAsSection ? (u(), w(X, { key: 0 }, [
|
|
1109
1122
|
a(re, {
|
|
1110
|
-
label:
|
|
1123
|
+
label: J.label
|
|
1111
1124
|
}, null, 8, ["label"]),
|
|
1112
1125
|
a(ie)
|
|
1113
|
-
], 64)) : (u(),
|
|
1126
|
+
], 64)) : (u(), O(Ie, {
|
|
1114
1127
|
key: 1,
|
|
1115
|
-
label:
|
|
1116
|
-
"model-value": $(
|
|
1117
|
-
onClick: (
|
|
1118
|
-
"x-should-scroll-into": `${$(
|
|
1128
|
+
label: J.label,
|
|
1129
|
+
"model-value": $(J),
|
|
1130
|
+
onClick: (cl) => f(J.value),
|
|
1131
|
+
"x-should-scroll-into": `${$(J)}`
|
|
1119
1132
|
}, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
|
|
1120
1133
|
], 64))), 128))
|
|
1121
1134
|
], 512)
|
|
@@ -1129,12 +1142,12 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1129
1142
|
]),
|
|
1130
1143
|
_: 1
|
|
1131
1144
|
}, 8, ["label", "helper-text", "model-value", "locked", "disabled"]),
|
|
1132
|
-
|
|
1145
|
+
l(d).enableTotalCost ? (u(), O(Se, {
|
|
1133
1146
|
key: 0,
|
|
1134
1147
|
"tooltip-message": "This field is managed by NetSuite",
|
|
1135
1148
|
"tooltip-z-index": 50,
|
|
1136
|
-
label:
|
|
1137
|
-
"model-value":
|
|
1149
|
+
label: l(r)("inventory.ingredient.valuationMethod.title"),
|
|
1150
|
+
"model-value": l(r)("inventory.ingredient.valuationMethod." + me.value),
|
|
1138
1151
|
locked: v.value,
|
|
1139
1152
|
disabled: e.disabled
|
|
1140
1153
|
}, {
|
|
@@ -1142,7 +1155,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1142
1155
|
a(he, { "z-index": 50 }, {
|
|
1143
1156
|
default: y(() => [
|
|
1144
1157
|
a(C, {
|
|
1145
|
-
label:
|
|
1158
|
+
label: l(r)("inventory.ingredient.valuationMethod.title")
|
|
1146
1159
|
}, null, 8, ["label"])
|
|
1147
1160
|
]),
|
|
1148
1161
|
_: 1
|
|
@@ -1151,7 +1164,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1151
1164
|
default: y(() => [
|
|
1152
1165
|
a(Ut, {
|
|
1153
1166
|
class: "col-span-2",
|
|
1154
|
-
label:
|
|
1167
|
+
label: l(r)("inventory.ingredient.valuationMethod.title"),
|
|
1155
1168
|
"model-value": me.value,
|
|
1156
1169
|
"onUpdate:modelValue": t[5] || (t[5] = (I) => me.value = I),
|
|
1157
1170
|
items: K.value
|
|
@@ -1159,11 +1172,11 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1159
1172
|
]),
|
|
1160
1173
|
_: 1
|
|
1161
1174
|
}, 8, ["label", "model-value", "locked", "disabled"])) : L("", !0),
|
|
1162
|
-
|
|
1175
|
+
l(d).enableTotalCost ? (u(), O(Se, {
|
|
1163
1176
|
key: 1,
|
|
1164
1177
|
"tooltip-message": "This field is managed by NetSuite",
|
|
1165
1178
|
"tooltip-z-index": 50,
|
|
1166
|
-
"model-value": `${
|
|
1179
|
+
"model-value": `${l(Wt)()} ${ye.value}`,
|
|
1167
1180
|
locked: v.value,
|
|
1168
1181
|
"append-text": `/ ${we.value}`,
|
|
1169
1182
|
disabled: e.disabled
|
|
@@ -1172,7 +1185,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1172
1185
|
a(he, { "z-index": 50 }, {
|
|
1173
1186
|
default: y(() => [
|
|
1174
1187
|
a(C, {
|
|
1175
|
-
label:
|
|
1188
|
+
label: l(r)("inventory.ingredient.pricePerUnit")
|
|
1176
1189
|
}, null, 8, ["label"])
|
|
1177
1190
|
]),
|
|
1178
1191
|
_: 1
|
|
@@ -1182,108 +1195,108 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1182
1195
|
a(x, {
|
|
1183
1196
|
"model-value": ye.value,
|
|
1184
1197
|
"onUpdate:modelValue": t[6] || (t[6] = (I) => ye.value = I),
|
|
1185
|
-
rules: [
|
|
1198
|
+
rules: [l(Pe)(0), l(rn)(4)]
|
|
1186
1199
|
}, {
|
|
1187
1200
|
label: y(() => [
|
|
1188
1201
|
a(he, { "z-index": 50 }, {
|
|
1189
1202
|
default: y(() => [
|
|
1190
1203
|
a(C, {
|
|
1191
|
-
label:
|
|
1204
|
+
label: l(r)("inventory.ingredient.pricePerUnit")
|
|
1192
1205
|
}, null, 8, ["label"])
|
|
1193
1206
|
]),
|
|
1194
1207
|
_: 1
|
|
1195
1208
|
})
|
|
1196
1209
|
]),
|
|
1197
1210
|
prepend: y(() => {
|
|
1198
|
-
var I,
|
|
1211
|
+
var I, J;
|
|
1199
1212
|
return [
|
|
1200
|
-
|
|
1213
|
+
o("div", Gn, A(l(pt)(((I = l(i).currentCountry) == null ? void 0 : I.value) ?? l(vt)) === "MYR" ? "RM" : l(pt)(((J = l(i).currentCountry) == null ? void 0 : J.value) ?? l(vt))), 1)
|
|
1201
1214
|
];
|
|
1202
1215
|
}),
|
|
1203
1216
|
append: y(() => [
|
|
1204
|
-
|
|
1217
|
+
o("div", Kn, " / " + A(we.value), 1)
|
|
1205
1218
|
]),
|
|
1206
1219
|
_: 1
|
|
1207
1220
|
}, 8, ["model-value", "rules"])
|
|
1208
1221
|
]),
|
|
1209
1222
|
_: 1
|
|
1210
1223
|
}, 8, ["model-value", "locked", "append-text", "disabled"])) : L("", !0),
|
|
1211
|
-
!v.value || j.value ? (u(),
|
|
1224
|
+
!v.value || j.value ? (u(), O(zn, {
|
|
1212
1225
|
key: 2,
|
|
1213
1226
|
"model-value": j.value,
|
|
1214
1227
|
"onUpdate:modelValue": t[7] || (t[7] = (I) => j.value = I),
|
|
1215
1228
|
"root-value": e.modelValue,
|
|
1216
1229
|
readonly: v.value
|
|
1217
1230
|
}, null, 8, ["model-value", "root-value", "readonly"])) : L("", !0),
|
|
1218
|
-
e.mode !==
|
|
1231
|
+
e.mode !== l(H).CREATE ? (u(), w("div", Zn, [
|
|
1219
1232
|
a(nt, {
|
|
1220
|
-
label:
|
|
1233
|
+
label: l(r)("inventory.ingredient.status.inactive"),
|
|
1221
1234
|
"model-value": ee.value,
|
|
1222
1235
|
"onUpdate:modelValue": t[8] || (t[8] = (I) => ee.value = I),
|
|
1223
1236
|
"label-placement": "right",
|
|
1224
1237
|
disabled: v.value
|
|
1225
1238
|
}, null, 8, ["label", "model-value", "disabled"]),
|
|
1226
|
-
|
|
1227
|
-
|
|
1239
|
+
o("div", Jn, [
|
|
1240
|
+
o("div", Qn, A(l(r)("inventory.ingredient.status.preventFromOrder")), 1)
|
|
1228
1241
|
])
|
|
1229
1242
|
])) : L("", !0),
|
|
1230
|
-
e.mode !==
|
|
1231
|
-
|
|
1243
|
+
e.mode !== l(H).CREATE ? (u(), w("div", Xn, [
|
|
1244
|
+
o("div", null, [
|
|
1232
1245
|
a(nt, {
|
|
1233
|
-
label:
|
|
1246
|
+
label: l(r)("inventory.ingredient.bindedItems.title"),
|
|
1234
1247
|
modelValue: R.value,
|
|
1235
1248
|
"onUpdate:modelValue": t[9] || (t[9] = (I) => R.value = I),
|
|
1236
1249
|
"label-placement": "right"
|
|
1237
1250
|
}, null, 8, ["label", "modelValue"])
|
|
1238
1251
|
]),
|
|
1239
|
-
R.value && q.value.length ? (u(),
|
|
1252
|
+
R.value && q.value.length ? (u(), O(je, {
|
|
1240
1253
|
key: 0,
|
|
1241
|
-
name:
|
|
1254
|
+
name: l(r)("inventory.ingredient.bindedItems.ingredient"),
|
|
1242
1255
|
bindings: q.value
|
|
1243
1256
|
}, null, 8, ["name", "bindings"])) : L("", !0),
|
|
1244
|
-
R.value && de.value.length ? (u(),
|
|
1257
|
+
R.value && de.value.length ? (u(), O(je, {
|
|
1245
1258
|
key: 1,
|
|
1246
|
-
name:
|
|
1259
|
+
name: l(r)("inventory.ingredient.bindedItems.recipe"),
|
|
1247
1260
|
bindings: de.value
|
|
1248
1261
|
}, null, 8, ["name", "bindings"])) : L("", !0),
|
|
1249
|
-
R.value && Te.value.length ? (u(),
|
|
1262
|
+
R.value && Te.value.length ? (u(), O(je, {
|
|
1250
1263
|
key: 2,
|
|
1251
|
-
name:
|
|
1264
|
+
name: l(r)("inventory.ingredient.bindedItems.menu"),
|
|
1252
1265
|
bindings: Te.value
|
|
1253
1266
|
}, null, 8, ["name", "bindings"])) : L("", !0)
|
|
1254
1267
|
])) : L("", !0),
|
|
1255
|
-
|
|
1256
|
-
|
|
1268
|
+
o("div", eo, [
|
|
1269
|
+
o("div", to, [
|
|
1257
1270
|
a(he, null, {
|
|
1258
1271
|
default: y(() => [
|
|
1259
|
-
|
|
1272
|
+
o("div", no, A(l(r)("inventory.ingredient.threshold.title")), 1)
|
|
1260
1273
|
]),
|
|
1261
1274
|
_: 1
|
|
1262
1275
|
}),
|
|
1263
|
-
|
|
1276
|
+
o("div", oo, A(l(r)("inventory.ingredient.threshold.subtitle")), 1)
|
|
1264
1277
|
]),
|
|
1265
|
-
|
|
1278
|
+
o("div", lo, [
|
|
1266
1279
|
a(tt, {
|
|
1267
1280
|
"model-value": { low: be.value, mid: se.value },
|
|
1268
1281
|
rules: [$t()]
|
|
1269
1282
|
}, null, 8, ["model-value", "rules"]),
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
a(
|
|
1283
|
+
o("div", ao, [
|
|
1284
|
+
o("div", so, [
|
|
1285
|
+
o("div", ro, [
|
|
1286
|
+
a(ze, {
|
|
1274
1287
|
days: be.value,
|
|
1275
|
-
level:
|
|
1288
|
+
level: l(Le).low
|
|
1276
1289
|
}, null, 8, ["days", "level"])
|
|
1277
1290
|
]),
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
a(
|
|
1291
|
+
o("div", io, [
|
|
1292
|
+
o("div", uo, A(l(r)("inventory.ingredient.threshold.whenRemaining")), 1),
|
|
1293
|
+
a(ot, {
|
|
1281
1294
|
modelValue: be.value,
|
|
1282
1295
|
"onUpdate:modelValue": t[10] || (t[10] = (I) => be.value = I),
|
|
1283
|
-
rules: [
|
|
1296
|
+
rules: [l(Pe)(0)]
|
|
1284
1297
|
}, {
|
|
1285
1298
|
append: y(() => t[13] || (t[13] = [
|
|
1286
|
-
|
|
1299
|
+
o("div", {
|
|
1287
1300
|
class: "text-fm-color-typo-secondary",
|
|
1288
1301
|
style: { "padding-right": "32px" }
|
|
1289
1302
|
}, "days", -1)
|
|
@@ -1292,31 +1305,31 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1292
1305
|
}, 8, ["modelValue", "rules"])
|
|
1293
1306
|
])
|
|
1294
1307
|
]),
|
|
1295
|
-
t[15] || (t[15] =
|
|
1308
|
+
t[15] || (t[15] = o("div", {
|
|
1296
1309
|
class: "h-full bg-fm-color-neutral-gray-200 relative",
|
|
1297
1310
|
style: { width: "1px" }
|
|
1298
1311
|
}, [
|
|
1299
|
-
|
|
1312
|
+
o("div", {
|
|
1300
1313
|
class: "absolute bg-white",
|
|
1301
1314
|
style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
|
|
1302
1315
|
}, " < ")
|
|
1303
1316
|
], -1)),
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
a(
|
|
1317
|
+
o("div", co, [
|
|
1318
|
+
o("div", mo, [
|
|
1319
|
+
a(ze, {
|
|
1307
1320
|
days: se.value,
|
|
1308
|
-
level:
|
|
1321
|
+
level: l(Le).mid
|
|
1309
1322
|
}, null, 8, ["days", "level"])
|
|
1310
1323
|
]),
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
a(
|
|
1324
|
+
o("div", po, [
|
|
1325
|
+
o("div", vo, A(l(r)("inventory.ingredient.threshold.whenRemaining")), 1),
|
|
1326
|
+
a(ot, {
|
|
1314
1327
|
modelValue: se.value,
|
|
1315
1328
|
"onUpdate:modelValue": t[11] || (t[11] = (I) => se.value = I),
|
|
1316
|
-
rules: [
|
|
1329
|
+
rules: [l(Pe)(0)]
|
|
1317
1330
|
}, {
|
|
1318
1331
|
append: y(() => t[14] || (t[14] = [
|
|
1319
|
-
|
|
1332
|
+
o("div", {
|
|
1320
1333
|
class: "text-fm-color-typo-secondary",
|
|
1321
1334
|
style: { "padding-right": "32px" }
|
|
1322
1335
|
}, "days", -1)
|
|
@@ -1325,35 +1338,35 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1325
1338
|
}, 8, ["modelValue", "rules"])
|
|
1326
1339
|
])
|
|
1327
1340
|
]),
|
|
1328
|
-
t[16] || (t[16] =
|
|
1341
|
+
t[16] || (t[16] = o("div", {
|
|
1329
1342
|
class: "h-full bg-fm-color-neutral-gray-200 relative",
|
|
1330
1343
|
style: { width: "1px" }
|
|
1331
1344
|
}, [
|
|
1332
|
-
|
|
1345
|
+
o("div", {
|
|
1333
1346
|
class: "absolute bg-white",
|
|
1334
1347
|
style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
|
|
1335
1348
|
}, " < ")
|
|
1336
1349
|
], -1)),
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
a(
|
|
1350
|
+
o("div", fo, [
|
|
1351
|
+
o("div", yo, [
|
|
1352
|
+
a(ze, {
|
|
1340
1353
|
days: se.value + 1,
|
|
1341
|
-
level:
|
|
1354
|
+
level: l(Le).high
|
|
1342
1355
|
}, null, 8, ["days", "level"])
|
|
1343
1356
|
]),
|
|
1344
|
-
|
|
1345
|
-
|
|
1357
|
+
o("div", go, [
|
|
1358
|
+
o("div", bo, A(l(r)("inventory.ingredient.threshold.stockIsStaple")), 1)
|
|
1346
1359
|
])
|
|
1347
1360
|
])
|
|
1348
1361
|
])
|
|
1349
1362
|
])
|
|
1350
1363
|
]),
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1364
|
+
l(d).mustUsePoTemplate && e.mode === l(H).CREATE ? (u(), w("div", ho, [
|
|
1365
|
+
o("div", _o, [
|
|
1366
|
+
o("div", xo, [
|
|
1354
1367
|
a(he, null, {
|
|
1355
1368
|
default: y(() => [
|
|
1356
|
-
|
|
1369
|
+
o("div", ko, A(l(r)("inventory.ingredient.purchaseOrderTemplates.title")), 1)
|
|
1357
1370
|
]),
|
|
1358
1371
|
_: 1
|
|
1359
1372
|
}),
|
|
@@ -1365,11 +1378,11 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1365
1378
|
onClick: Ft
|
|
1366
1379
|
})
|
|
1367
1380
|
]),
|
|
1368
|
-
|
|
1381
|
+
o("div", To, A(l(r)("inventory.ingredient.purchaseOrderTemplates.description")), 1)
|
|
1369
1382
|
]),
|
|
1370
|
-
Ke.value.length > 0 ? (u(), w("div",
|
|
1371
|
-
|
|
1372
|
-
(u(!0), w(X, null, ue(Ke.value, (I) => (u(),
|
|
1383
|
+
Ke.value.length > 0 ? (u(), w("div", wo, [
|
|
1384
|
+
o("div", Vo, [
|
|
1385
|
+
(u(!0), w(X, null, ue(Ke.value, (I) => (u(), O(De, {
|
|
1373
1386
|
key: I.value,
|
|
1374
1387
|
label: I.label,
|
|
1375
1388
|
variant: "info",
|
|
@@ -1378,12 +1391,12 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1378
1391
|
])
|
|
1379
1392
|
])) : L("", !0)
|
|
1380
1393
|
])) : L("", !0),
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1394
|
+
l(d).enableWastageTemplate && e.mode === l(H).CREATE ? (u(), w("div", Io, [
|
|
1395
|
+
o("div", So, [
|
|
1396
|
+
o("div", Co, [
|
|
1384
1397
|
a(he, null, {
|
|
1385
1398
|
default: y(() => [
|
|
1386
|
-
|
|
1399
|
+
o("div", Fo, A(l(r)("inventory.ingredient.wastageTemplates.title")), 1)
|
|
1387
1400
|
]),
|
|
1388
1401
|
_: 1
|
|
1389
1402
|
}),
|
|
@@ -1395,11 +1408,11 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1395
1408
|
onClick: At
|
|
1396
1409
|
})
|
|
1397
1410
|
]),
|
|
1398
|
-
|
|
1411
|
+
o("div", Ao, A(l(r)("inventory.ingredient.wastageTemplates.description")), 1)
|
|
1399
1412
|
]),
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
(u(!0), w(X, null, ue(
|
|
1413
|
+
Je.value.length > 0 ? (u(), w("div", Eo, [
|
|
1414
|
+
o("div", $o, [
|
|
1415
|
+
(u(!0), w(X, null, ue(Je.value, (I) => (u(), O(De, {
|
|
1403
1416
|
key: I.value,
|
|
1404
1417
|
label: I.label,
|
|
1405
1418
|
variant: "info",
|
|
@@ -1408,12 +1421,12 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1408
1421
|
])
|
|
1409
1422
|
])) : L("", !0)
|
|
1410
1423
|
])) : L("", !0),
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1424
|
+
l(d).enableClosingTemplate && e.mode === l(H).CREATE ? (u(), w("div", Mo, [
|
|
1425
|
+
o("div", Uo, [
|
|
1426
|
+
o("div", Po, [
|
|
1414
1427
|
a(he, null, {
|
|
1415
1428
|
default: y(() => [
|
|
1416
|
-
|
|
1429
|
+
o("div", Ro, A(l(r)("inventory.ingredient.closingTemplates.title")), 1)
|
|
1417
1430
|
]),
|
|
1418
1431
|
_: 1
|
|
1419
1432
|
}),
|
|
@@ -1425,11 +1438,11 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1425
1438
|
onClick: Et
|
|
1426
1439
|
})
|
|
1427
1440
|
]),
|
|
1428
|
-
|
|
1441
|
+
o("div", Bo, A(l(r)("inventory.ingredient.closingTemplates.description")), 1)
|
|
1429
1442
|
]),
|
|
1430
|
-
Xe.value.length > 0 ? (u(), w("div",
|
|
1431
|
-
|
|
1432
|
-
(u(!0), w(X, null, ue(Xe.value, (I) => (u(),
|
|
1443
|
+
Xe.value.length > 0 ? (u(), w("div", Do, [
|
|
1444
|
+
o("div", Oo, [
|
|
1445
|
+
(u(!0), w(X, null, ue(Xe.value, (I) => (u(), O(De, {
|
|
1433
1446
|
key: I.value,
|
|
1434
1447
|
label: I.label,
|
|
1435
1448
|
variant: "info",
|
|
@@ -1438,11 +1451,11 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1438
1451
|
])
|
|
1439
1452
|
])) : L("", !0)
|
|
1440
1453
|
])) : L("", !0),
|
|
1441
|
-
|
|
1442
|
-
a(
|
|
1454
|
+
o("div", null, [
|
|
1455
|
+
a(yn, {
|
|
1443
1456
|
entity: "inventorySku",
|
|
1444
|
-
modelValue:
|
|
1445
|
-
"onUpdate:modelValue": t[12] || (t[12] = (I) =>
|
|
1457
|
+
modelValue: Z.value,
|
|
1458
|
+
"onUpdate:modelValue": t[12] || (t[12] = (I) => Z.value = I)
|
|
1446
1459
|
}, null, 8, ["modelValue"])
|
|
1447
1460
|
])
|
|
1448
1461
|
];
|
|
@@ -1451,10 +1464,10 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1451
1464
|
}, 8, ["disabled"]);
|
|
1452
1465
|
};
|
|
1453
1466
|
}
|
|
1454
|
-
}),
|
|
1467
|
+
}), zo = { class: "flex flex-col gap-32" }, Lo = {
|
|
1455
1468
|
key: 0,
|
|
1456
1469
|
class: "flex justify-between items-center"
|
|
1457
|
-
},
|
|
1470
|
+
}, jo = { class: "flex gap-4" }, Wo = /* @__PURE__ */ pe({
|
|
1458
1471
|
__name: "IngredientDialog",
|
|
1459
1472
|
props: {
|
|
1460
1473
|
show: { type: Boolean },
|
|
@@ -1463,7 +1476,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1463
1476
|
},
|
|
1464
1477
|
emits: ["update:show"],
|
|
1465
1478
|
setup(W) {
|
|
1466
|
-
const s = W, T = Ce(), r =
|
|
1479
|
+
const s = W, T = Ce(), r = Vt(), b = Ae(), S = It(), U = St(), k = Ct(), n = Fe(), { t: c } = ve(), _ = gt(s, "show"), i = gt(s, "sku"), d = B([]), m = B([]), v = B([]), V = g(
|
|
1467
1480
|
() => {
|
|
1468
1481
|
var h;
|
|
1469
1482
|
return b.isEnabled && b.netSuiteItemBySkuId.has((h = s.sku) == null ? void 0 : h._id);
|
|
@@ -1488,43 +1501,43 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1488
1501
|
return c("common.add");
|
|
1489
1502
|
}
|
|
1490
1503
|
return "";
|
|
1491
|
-
}), N = B(),
|
|
1504
|
+
}), N = B(), D = B(!1);
|
|
1492
1505
|
async function fe() {
|
|
1493
|
-
|
|
1506
|
+
D.value = !0;
|
|
1494
1507
|
try {
|
|
1495
1508
|
await T.createSku(i.value);
|
|
1496
1509
|
const h = T.skuByCode[i.value.code];
|
|
1497
|
-
r.enablePoTemplate && d.value.length > 0 && await ce(h), r.enableWastageTemplate && m.value.length > 0 && await
|
|
1510
|
+
r.enablePoTemplate && d.value.length > 0 && await ce(h), r.enableWastageTemplate && m.value.length > 0 && await oe(h), r.enableClosingTemplate && v.value.length > 0 && await le(h), _.value = !1, n.open({
|
|
1498
1511
|
title: c("inventory.common.success"),
|
|
1499
1512
|
message: c("inventory.ingredient.create.success", { name: i.value.name }),
|
|
1500
1513
|
type: "success"
|
|
1501
1514
|
});
|
|
1502
1515
|
} catch (h) {
|
|
1503
|
-
h instanceof
|
|
1516
|
+
h instanceof ft || n.open({
|
|
1504
1517
|
title: c("inventory.ingredient.create.error.title"),
|
|
1505
1518
|
message: c("inventory.ingredient.create.error.message"),
|
|
1506
1519
|
type: "error"
|
|
1507
1520
|
});
|
|
1508
1521
|
} finally {
|
|
1509
|
-
|
|
1522
|
+
D.value = !1;
|
|
1510
1523
|
}
|
|
1511
1524
|
}
|
|
1512
1525
|
async function ne() {
|
|
1513
|
-
|
|
1526
|
+
D.value = !0;
|
|
1514
1527
|
try {
|
|
1515
|
-
await T.updateSku(i.value),
|
|
1528
|
+
await T.updateSku(i.value), D.value = !1, _.value = !1, n.open({
|
|
1516
1529
|
title: c("inventory.common.success"),
|
|
1517
1530
|
message: c("inventory.ingredient.update.success", { name: i.value.name }),
|
|
1518
1531
|
type: "success"
|
|
1519
1532
|
});
|
|
1520
1533
|
} catch (h) {
|
|
1521
|
-
h instanceof
|
|
1534
|
+
h instanceof ft || n.open({
|
|
1522
1535
|
title: c("inventory.ingredient.update.error.title"),
|
|
1523
1536
|
message: c("inventory.ingredient.update.error.message"),
|
|
1524
1537
|
type: "error"
|
|
1525
1538
|
});
|
|
1526
1539
|
} finally {
|
|
1527
|
-
|
|
1540
|
+
D.value = !1;
|
|
1528
1541
|
}
|
|
1529
1542
|
}
|
|
1530
1543
|
async function ce(h) {
|
|
@@ -1537,15 +1550,15 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1537
1550
|
continue;
|
|
1538
1551
|
}
|
|
1539
1552
|
if (!K.purchaseOrder.items.find(
|
|
1540
|
-
(
|
|
1553
|
+
(Z) => Z.sku._id === h._id
|
|
1541
1554
|
)) {
|
|
1542
|
-
const
|
|
1555
|
+
const Z = { amount: 1, precision: dn(h.unit) }, M = {
|
|
1543
1556
|
sku: h,
|
|
1544
1557
|
name: h.name,
|
|
1545
1558
|
code: h.code,
|
|
1546
|
-
quantity:
|
|
1547
|
-
minimumQuantity:
|
|
1548
|
-
quantityStep:
|
|
1559
|
+
quantity: Z,
|
|
1560
|
+
minimumQuantity: Z,
|
|
1561
|
+
quantityStep: Z,
|
|
1549
1562
|
measurement: ((G = (P = h.unit) == null ? void 0 : P.measurements) == null ? void 0 : G[0]) || null
|
|
1550
1563
|
}, R = {
|
|
1551
1564
|
...K,
|
|
@@ -1554,7 +1567,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1554
1567
|
items: [...K.purchaseOrder.items, M]
|
|
1555
1568
|
}
|
|
1556
1569
|
};
|
|
1557
|
-
((($ = R.purchaseOrder.supplier) == null ? void 0 : $.internal) ===
|
|
1570
|
+
((($ = R.purchaseOrder.supplier) == null ? void 0 : $.internal) === yt.enum.warehouse || ((f = R.purchaseOrder.supplier) == null ? void 0 : f.internal) === yt.enum.restaurant) && (R.purchaseOrder.items = R.purchaseOrder.items.map(
|
|
1558
1571
|
({ totalCost: q, ...de }) => de
|
|
1559
1572
|
)), await S.updateTemplate(R), await new Promise((q) => setTimeout(q, 1e3));
|
|
1560
1573
|
}
|
|
@@ -1567,7 +1580,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1567
1580
|
}), console.error("Error in updating transfer template", j);
|
|
1568
1581
|
}
|
|
1569
1582
|
}
|
|
1570
|
-
async function
|
|
1583
|
+
async function oe(h) {
|
|
1571
1584
|
try {
|
|
1572
1585
|
for (const P of m.value) {
|
|
1573
1586
|
const G = await U.getTemplate(P);
|
|
@@ -1597,7 +1610,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1597
1610
|
}), console.error("Error in updating wastage template", P);
|
|
1598
1611
|
}
|
|
1599
1612
|
}
|
|
1600
|
-
async function
|
|
1613
|
+
async function le(h) {
|
|
1601
1614
|
try {
|
|
1602
1615
|
for (const P of v.value) {
|
|
1603
1616
|
const G = await k.getTemplate(P);
|
|
@@ -1648,8 +1661,8 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1648
1661
|
}
|
|
1649
1662
|
return (h, P) => {
|
|
1650
1663
|
const G = F("FmChip"), $ = F("FmButton"), f = F("FmSideSheet");
|
|
1651
|
-
return u(),
|
|
1652
|
-
"model-value":
|
|
1664
|
+
return u(), O(f, {
|
|
1665
|
+
"model-value": l(_),
|
|
1653
1666
|
"onUpdate:modelValue": P[3] || (P[3] = (j) => dt(_) ? _.value = j : null),
|
|
1654
1667
|
header: E.value,
|
|
1655
1668
|
"close-button": "",
|
|
@@ -1657,41 +1670,41 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1657
1670
|
"max-width": 500
|
|
1658
1671
|
}, {
|
|
1659
1672
|
"side-sheet-footer": y(() => [
|
|
1660
|
-
|
|
1673
|
+
o("div", jo, [
|
|
1661
1674
|
a($, {
|
|
1662
|
-
loading:
|
|
1675
|
+
loading: D.value,
|
|
1663
1676
|
label: p.value,
|
|
1664
1677
|
onClick: ee
|
|
1665
1678
|
}, null, 8, ["loading", "label"]),
|
|
1666
1679
|
a($, {
|
|
1667
|
-
disabled:
|
|
1668
|
-
label:
|
|
1680
|
+
disabled: D.value,
|
|
1681
|
+
label: l(c)("common.close"),
|
|
1669
1682
|
variant: "tertiary",
|
|
1670
1683
|
onClick: P[2] || (P[2] = (j) => _.value = !1)
|
|
1671
1684
|
}, null, 8, ["disabled", "label"])
|
|
1672
1685
|
])
|
|
1673
1686
|
]),
|
|
1674
1687
|
default: y(() => [
|
|
1675
|
-
|
|
1676
|
-
V.value ? (u(), w("div",
|
|
1688
|
+
o("div", zo, [
|
|
1689
|
+
V.value ? (u(), w("div", Lo, [
|
|
1677
1690
|
a(G, {
|
|
1678
1691
|
label: "Managed by Netsuite",
|
|
1679
1692
|
compact: ""
|
|
1680
1693
|
}),
|
|
1681
|
-
a(
|
|
1694
|
+
a(tn, {
|
|
1682
1695
|
readonly: "",
|
|
1683
1696
|
sku: h.sku,
|
|
1684
|
-
settingOptions:
|
|
1697
|
+
settingOptions: l(b).skuSettingOptions
|
|
1685
1698
|
}, null, 8, ["sku", "settingOptions"])
|
|
1686
1699
|
])) : L("", !0),
|
|
1687
|
-
a(
|
|
1700
|
+
a(No, {
|
|
1688
1701
|
class: "w-full",
|
|
1689
1702
|
ref_key: "hasValidationExpose",
|
|
1690
1703
|
ref: N,
|
|
1691
|
-
modelValue:
|
|
1704
|
+
modelValue: l(i),
|
|
1692
1705
|
"onUpdate:modelValue": P[0] || (P[0] = (j) => dt(i) ? i.value = j : null),
|
|
1693
1706
|
mode: h.mode,
|
|
1694
|
-
disabled:
|
|
1707
|
+
disabled: D.value,
|
|
1695
1708
|
purchaseOrderTemplateIds: d.value,
|
|
1696
1709
|
wastageTemplateIds: m.value,
|
|
1697
1710
|
closingTemplateIds: v.value,
|
|
@@ -1706,10 +1719,10 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1706
1719
|
}, 8, ["model-value", "header"]);
|
|
1707
1720
|
};
|
|
1708
1721
|
}
|
|
1709
|
-
}),
|
|
1722
|
+
}), Ho = { class: "flex items-center gap-12 pl-8" }, qo = { class: "flex flex-col" }, Yo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, Go = {
|
|
1710
1723
|
key: 0,
|
|
1711
1724
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
1712
|
-
},
|
|
1725
|
+
}, Ko = { key: 0 }, xt = /* @__PURE__ */ pe({
|
|
1713
1726
|
__name: "ImportIngredientItem",
|
|
1714
1727
|
props: {
|
|
1715
1728
|
type: {},
|
|
@@ -1720,22 +1733,22 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1720
1733
|
setup(W) {
|
|
1721
1734
|
return (s, T) => {
|
|
1722
1735
|
const r = F("FmIcon"), b = F("FmTooltip");
|
|
1723
|
-
return u(), w("div",
|
|
1724
|
-
T[0] || (T[0] =
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1736
|
+
return u(), w("div", Ho, [
|
|
1737
|
+
T[0] || (T[0] = o("div", null, "•", -1)),
|
|
1738
|
+
o("div", qo, [
|
|
1739
|
+
o("div", Yo, [
|
|
1740
|
+
o("div", {
|
|
1728
1741
|
class: te({
|
|
1729
1742
|
"text-fm-color-system-error-300": s.errors.length
|
|
1730
1743
|
})
|
|
1731
1744
|
}, [
|
|
1732
1745
|
Ge(A(s.name) + " ", 1),
|
|
1733
|
-
s.type === "create" ? (u(), w("span",
|
|
1746
|
+
s.type === "create" ? (u(), w("span", Go, "(new)")) : L("", !0)
|
|
1734
1747
|
], 2),
|
|
1735
|
-
s.errors.length ? (u(), w("div",
|
|
1748
|
+
s.errors.length ? (u(), w("div", Ko, [
|
|
1736
1749
|
a(b, { "z-index": 50 }, {
|
|
1737
1750
|
content: y(() => [
|
|
1738
|
-
|
|
1751
|
+
o("ol", null, [
|
|
1739
1752
|
(u(!0), w(X, null, ue(s.errors, (S, U) => (u(), w("li", { key: U }, A(S), 1))), 128))
|
|
1740
1753
|
])
|
|
1741
1754
|
]),
|
|
@@ -1750,7 +1763,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1750
1763
|
})
|
|
1751
1764
|
])) : L("", !0)
|
|
1752
1765
|
]),
|
|
1753
|
-
|
|
1766
|
+
o("div", {
|
|
1754
1767
|
class: te([
|
|
1755
1768
|
"fm-typo-en-body-sm-400",
|
|
1756
1769
|
{
|
|
@@ -1763,19 +1776,19 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1763
1776
|
]);
|
|
1764
1777
|
};
|
|
1765
1778
|
}
|
|
1766
|
-
}),
|
|
1779
|
+
}), Zo = { class: "flex flex-col gap-24" }, Jo = { class: "fm-typo-en-body-md-400" }, Qo = { class: "flex flex-col gap-8" }, Xo = { class: "line-clamp-2 text-ellipsis break-all" }, el = {
|
|
1767
1780
|
key: 2,
|
|
1768
1781
|
class: "shrink-0"
|
|
1769
|
-
},
|
|
1782
|
+
}, tl = {
|
|
1770
1783
|
key: 0,
|
|
1771
1784
|
class: "flex flex-col"
|
|
1772
|
-
},
|
|
1785
|
+
}, nl = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, ol = {
|
|
1773
1786
|
key: 0,
|
|
1774
1787
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
1775
|
-
},
|
|
1788
|
+
}, ll = { class: "fm-typo-en-body-lg-600" }, al = /* @__PURE__ */ pe({
|
|
1776
1789
|
__name: "ImportIngredients",
|
|
1777
1790
|
setup(W) {
|
|
1778
|
-
const s = B(null), T =
|
|
1791
|
+
const s = B(null), T = Yt(), r = Fe(), b = B(!1), S = B(new Array()), U = B([]), k = B([]), n = g(
|
|
1779
1792
|
() => !!S.value.length || U.value.some((d) => d.errors.length) || k.value.some((d) => d.errors.length)
|
|
1780
1793
|
), c = g(
|
|
1781
1794
|
() => !!U.value.length || !!k.value.length
|
|
@@ -1785,7 +1798,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1785
1798
|
try {
|
|
1786
1799
|
b.value = !0;
|
|
1787
1800
|
const [m] = await Promise.all([
|
|
1788
|
-
|
|
1801
|
+
bn(d),
|
|
1789
1802
|
// fake buffer
|
|
1790
1803
|
new Promise((E) => setTimeout(E, 1e3))
|
|
1791
1804
|
]), v = m.SheetNames.find((E) => E);
|
|
@@ -1793,7 +1806,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1793
1806
|
S.value.push(_("inventory.ingredient.import.fileError.noSheet"));
|
|
1794
1807
|
return;
|
|
1795
1808
|
}
|
|
1796
|
-
const V =
|
|
1809
|
+
const V = pn(m.Sheets[v]);
|
|
1797
1810
|
if (V.invalidExcel) {
|
|
1798
1811
|
S.value.push(V.invalidExcelMessage ?? _("inventory.ingredient.import.fileError.invalidExcel"));
|
|
1799
1812
|
return;
|
|
@@ -1820,23 +1833,23 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1820
1833
|
d && i(d);
|
|
1821
1834
|
}), (d, m) => {
|
|
1822
1835
|
const v = F("FmCircularProgress"), V = F("FmIcon"), E = F("FmButton");
|
|
1823
|
-
return u(), w("div",
|
|
1824
|
-
|
|
1825
|
-
a(
|
|
1836
|
+
return u(), w("div", Zo, [
|
|
1837
|
+
o("div", Jo, A(l(_)("inventory.ingredient.import.uploadDescription")), 1),
|
|
1838
|
+
a(hn, {
|
|
1826
1839
|
class: te({
|
|
1827
1840
|
"w-full": !0,
|
|
1828
1841
|
"h-[200px]": !s.value
|
|
1829
1842
|
}),
|
|
1830
1843
|
accept: ".xlsx",
|
|
1831
1844
|
onFileUpload: m[0] || (m[0] = (p) => s.value = p),
|
|
1832
|
-
label:
|
|
1833
|
-
"button-label":
|
|
1845
|
+
label: l(_)("inventory.ingredient.import.uploadTemplate"),
|
|
1846
|
+
"button-label": l(_)("inventory.ingredient.import.selectFile")
|
|
1834
1847
|
}, Ye({ _: 2 }, [
|
|
1835
1848
|
s.value ? {
|
|
1836
1849
|
name: "default",
|
|
1837
1850
|
fn: y(({ openFileDialog: p }) => [
|
|
1838
|
-
|
|
1839
|
-
|
|
1851
|
+
o("div", Qo, [
|
|
1852
|
+
o("div", {
|
|
1840
1853
|
class: te([
|
|
1841
1854
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
1842
1855
|
{
|
|
@@ -1846,17 +1859,17 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1846
1859
|
}
|
|
1847
1860
|
])
|
|
1848
1861
|
}, [
|
|
1849
|
-
b.value ? (u(),
|
|
1862
|
+
b.value ? (u(), O(v, {
|
|
1850
1863
|
key: 0,
|
|
1851
1864
|
size: "md",
|
|
1852
1865
|
color: "neutral-gray-200"
|
|
1853
|
-
})) : (u(),
|
|
1866
|
+
})) : (u(), O(V, {
|
|
1854
1867
|
key: 1,
|
|
1855
1868
|
name: n.value ? "error" : "attach_file",
|
|
1856
1869
|
outline: "",
|
|
1857
1870
|
color: n.value ? "system-error-300" : void 0
|
|
1858
1871
|
}, null, 8, ["name", "color"])),
|
|
1859
|
-
|
|
1872
|
+
o("div", {
|
|
1860
1873
|
class: te([
|
|
1861
1874
|
"fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
|
|
1862
1875
|
{
|
|
@@ -1865,20 +1878,20 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1865
1878
|
}
|
|
1866
1879
|
])
|
|
1867
1880
|
}, [
|
|
1868
|
-
|
|
1881
|
+
o("div", Xo, A(s.value.name), 1)
|
|
1869
1882
|
], 2),
|
|
1870
|
-
b.value ? L("", !0) : (u(), w("div",
|
|
1883
|
+
b.value ? L("", !0) : (u(), w("div", el, [
|
|
1871
1884
|
a(E, {
|
|
1872
|
-
label:
|
|
1885
|
+
label: l(_)("inventory.ingredient.import.replaceFile"),
|
|
1873
1886
|
variant: n.value ? "destructive" : "secondary",
|
|
1874
1887
|
"prepend-icon": n.value ? void 0 : "autorenew",
|
|
1875
1888
|
onClick: p
|
|
1876
1889
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
1877
1890
|
]))
|
|
1878
1891
|
], 2),
|
|
1879
|
-
S.value.length ? (u(), w("div",
|
|
1880
|
-
(u(!0), w(X, null, ue(S.value, (N,
|
|
1881
|
-
key:
|
|
1892
|
+
S.value.length ? (u(), w("div", tl, [
|
|
1893
|
+
(u(!0), w(X, null, ue(S.value, (N, D) => (u(), w("div", {
|
|
1894
|
+
key: D,
|
|
1882
1895
|
class: "flex gap-8 items-center"
|
|
1883
1896
|
}, [
|
|
1884
1897
|
a(V, {
|
|
@@ -1886,7 +1899,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1886
1899
|
size: "sm",
|
|
1887
1900
|
color: "system-error-300"
|
|
1888
1901
|
}),
|
|
1889
|
-
|
|
1902
|
+
o("div", nl, A(N), 1)
|
|
1890
1903
|
]))), 128))
|
|
1891
1904
|
])) : L("", !0)
|
|
1892
1905
|
])
|
|
@@ -1894,16 +1907,16 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1894
1907
|
key: "0"
|
|
1895
1908
|
} : void 0
|
|
1896
1909
|
]), 1032, ["class", "label", "button-label"]),
|
|
1897
|
-
c.value ? (u(), w("div",
|
|
1898
|
-
|
|
1899
|
-
(u(!0), w(X, null, ue(U.value, (p) => (u(),
|
|
1910
|
+
c.value ? (u(), w("div", ol, [
|
|
1911
|
+
o("div", ll, A(l(_)("inventory.ingredient.import.summary")), 1),
|
|
1912
|
+
(u(!0), w(X, null, ue(U.value, (p) => (u(), O(xt, {
|
|
1900
1913
|
key: p.sku._id,
|
|
1901
1914
|
code: p.sku.code,
|
|
1902
1915
|
name: p.sku.name,
|
|
1903
1916
|
errors: p.errors,
|
|
1904
1917
|
type: "create"
|
|
1905
1918
|
}, null, 8, ["code", "name", "errors"]))), 128)),
|
|
1906
|
-
(u(!0), w(X, null, ue(k.value, (p) => (u(),
|
|
1919
|
+
(u(!0), w(X, null, ue(k.value, (p) => (u(), O(xt, {
|
|
1907
1920
|
key: p.sku._id,
|
|
1908
1921
|
code: p.sku.code,
|
|
1909
1922
|
name: p.sku.name,
|
|
@@ -1914,13 +1927,13 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1914
1927
|
]);
|
|
1915
1928
|
};
|
|
1916
1929
|
}
|
|
1917
|
-
}),
|
|
1930
|
+
}), sl = {
|
|
1918
1931
|
key: 0,
|
|
1919
1932
|
class: "flex items-center gap-1"
|
|
1920
|
-
},
|
|
1933
|
+
}, rl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, il = { class: "flex flex-col py-8" }, dl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ul = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Ol = /* @__PURE__ */ pe({
|
|
1921
1934
|
__name: "IngredientsView",
|
|
1922
1935
|
setup(W) {
|
|
1923
|
-
const s = Ce(), T =
|
|
1936
|
+
const s = Ce(), T = Ae(), r = g(() => [
|
|
1924
1937
|
{
|
|
1925
1938
|
type: "string",
|
|
1926
1939
|
key: "skuCode",
|
|
@@ -1954,8 +1967,8 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1954
1967
|
), U = g(() => {
|
|
1955
1968
|
if (!b.value)
|
|
1956
1969
|
return s.skus;
|
|
1957
|
-
const $ =
|
|
1958
|
-
return s.skus.filter((f) => T.isEnabled && ne.value && S.value && !S.value.has(f._id) ? !1 :
|
|
1970
|
+
const $ = kn.build(b.value);
|
|
1971
|
+
return s.skus.filter((f) => T.isEnabled && ne.value && S.value && !S.value.has(f._id) ? !1 : Tn(
|
|
1959
1972
|
{
|
|
1960
1973
|
skuCode: f.code,
|
|
1961
1974
|
skuUnitAbbrev: f.unit.abbrev,
|
|
@@ -1963,7 +1976,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1963
1976
|
},
|
|
1964
1977
|
$
|
|
1965
1978
|
));
|
|
1966
|
-
}), k =
|
|
1979
|
+
}), k = Ht(), n = Re(), c = xn(), _ = Fe(), { t: i } = ve(), { createIngredient: d, updateIngredient: m } = qe(), { ingredientDialogProps: v, ingredientViewLoading: V } = Qt(qe()), { columnDefs: E } = Nn();
|
|
1967
1980
|
function p($) {
|
|
1968
1981
|
switch ($) {
|
|
1969
1982
|
case "add":
|
|
@@ -1974,7 +1987,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
1974
1987
|
return h();
|
|
1975
1988
|
}
|
|
1976
1989
|
}
|
|
1977
|
-
const N = B(""),
|
|
1990
|
+
const N = B(""), D = B(!1), fe = g(() => D.value || V.value), ne = B(!0), { breakpoints: ce } = Gt(), oe = g(() => ce.value.xs || ce.value.sm), le = g(() => oe.value ? 10 : 20), ee = nn(), ae = B(!1), ye = [
|
|
1978
1991
|
{
|
|
1979
1992
|
value: "import",
|
|
1980
1993
|
label: i("common.import")
|
|
@@ -2005,7 +2018,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2005
2018
|
{ label: i("common.export"), value: "export" }
|
|
2006
2019
|
]);
|
|
2007
2020
|
function h() {
|
|
2008
|
-
const $ =
|
|
2021
|
+
const $ = vn();
|
|
2009
2022
|
_.open({
|
|
2010
2023
|
title: i("inventory.ingredient.export.success"),
|
|
2011
2024
|
message: i("inventory.ingredient.export.filename", [$]),
|
|
@@ -2015,7 +2028,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2015
2028
|
function P() {
|
|
2016
2029
|
n.open({
|
|
2017
2030
|
title: i("inventory.ingredient.import.title"),
|
|
2018
|
-
contentComponent:
|
|
2031
|
+
contentComponent: al,
|
|
2019
2032
|
overlay: !0,
|
|
2020
2033
|
closeButton: !0,
|
|
2021
2034
|
primaryActions: {
|
|
@@ -2056,10 +2069,10 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2056
2069
|
return;
|
|
2057
2070
|
}
|
|
2058
2071
|
n.close(), G($);
|
|
2059
|
-
}).onTertiary(
|
|
2072
|
+
}).onTertiary(fn);
|
|
2060
2073
|
}
|
|
2061
2074
|
async function G($) {
|
|
2062
|
-
|
|
2075
|
+
D.value = !0;
|
|
2063
2076
|
try {
|
|
2064
2077
|
const f = [
|
|
2065
2078
|
...$.importCreateResult.map(({ sku: M }) => ({ type: "create", sku: M })),
|
|
@@ -2073,7 +2086,7 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2073
2086
|
f.length
|
|
2074
2087
|
])
|
|
2075
2088
|
});
|
|
2076
|
-
},
|
|
2089
|
+
}, Z = new Array();
|
|
2077
2090
|
for (const M of f.chunk(100)) {
|
|
2078
2091
|
me();
|
|
2079
2092
|
try {
|
|
@@ -2081,12 +2094,12 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2081
2094
|
create: M.filter((q) => q.type === "create").map((q) => q.sku),
|
|
2082
2095
|
update: M.filter((q) => q.type === "update").map((q) => q.sku)
|
|
2083
2096
|
});
|
|
2084
|
-
|
|
2097
|
+
Z.push(...R.errors);
|
|
2085
2098
|
} catch (R) {
|
|
2086
|
-
|
|
2099
|
+
Z.push(
|
|
2087
2100
|
...M.map((q) => {
|
|
2088
2101
|
const de = {
|
|
2089
|
-
module:
|
|
2102
|
+
module: qt.enum.sku,
|
|
2090
2103
|
_id: q.sku._id,
|
|
2091
2104
|
name: q.sku.name,
|
|
2092
2105
|
message: (R == null ? void 0 : R.stack) ?? R
|
|
@@ -2102,12 +2115,12 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2102
2115
|
_.open({
|
|
2103
2116
|
title: i("inventory.ingredient.import.success"),
|
|
2104
2117
|
type: "success"
|
|
2105
|
-
}),
|
|
2118
|
+
}), Z.length && c.alert(
|
|
2106
2119
|
"Some operation failed",
|
|
2107
2120
|
Q(
|
|
2108
2121
|
"div",
|
|
2109
2122
|
{ class: "flex flex-col gap-8" },
|
|
2110
|
-
|
|
2123
|
+
Z.map(
|
|
2111
2124
|
(M) => Q("div", { class: "flex flex-col" }, [
|
|
2112
2125
|
Q("div", { class: "fm-typo-en-body-lg-600" }, `(${M.data.code}) ${M.data.name}`),
|
|
2113
2126
|
Q(
|
|
@@ -2126,27 +2139,27 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2126
2139
|
type: "error"
|
|
2127
2140
|
}), console.error("Error in importing skus", $, f);
|
|
2128
2141
|
} finally {
|
|
2129
|
-
|
|
2142
|
+
D.value = !1;
|
|
2130
2143
|
}
|
|
2131
2144
|
}
|
|
2132
2145
|
return ($, f) => {
|
|
2133
|
-
const j = F("FmSwitch"), K = F("FmTable"), me = F("FmCollapsibleTabs"),
|
|
2134
|
-
return u(),
|
|
2135
|
-
title:
|
|
2146
|
+
const j = F("FmSwitch"), K = F("FmTable"), me = F("FmCollapsibleTabs"), Z = F("FmBottomSheet");
|
|
2147
|
+
return u(), O(on, {
|
|
2148
|
+
title: l(i)("inventory.ingredient.title"),
|
|
2136
2149
|
actions: ke.value,
|
|
2137
2150
|
"onClick:action": p
|
|
2138
2151
|
}, {
|
|
2139
2152
|
default: y(() => [
|
|
2140
|
-
|
|
2153
|
+
o("div", {
|
|
2141
2154
|
class: te([
|
|
2142
2155
|
"flex flex-col gap-8 max-h-full",
|
|
2143
2156
|
{
|
|
2144
|
-
"p-0":
|
|
2145
|
-
"px-24 ": !
|
|
2157
|
+
"p-0": oe.value,
|
|
2158
|
+
"px-24 ": !oe.value
|
|
2146
2159
|
}
|
|
2147
2160
|
])
|
|
2148
2161
|
}, [
|
|
2149
|
-
a(
|
|
2162
|
+
a(_n, {
|
|
2150
2163
|
searchable: "",
|
|
2151
2164
|
search: N.value,
|
|
2152
2165
|
"onUpdate:search": f[1] || (f[1] = (M) => N.value = M),
|
|
@@ -2156,9 +2169,9 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2156
2169
|
"onUpdate:filter": f[2] || (f[2] = (M) => b.value = M)
|
|
2157
2170
|
}, {
|
|
2158
2171
|
default: y(() => [
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
a(
|
|
2172
|
+
l(T).isEnabled ? (u(), w("div", sl, [
|
|
2173
|
+
o("span", rl, A(l(i)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
|
|
2174
|
+
a(cn),
|
|
2162
2175
|
a(He, null, {
|
|
2163
2176
|
default: y(() => [
|
|
2164
2177
|
a(j, {
|
|
@@ -2172,37 +2185,37 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2172
2185
|
]),
|
|
2173
2186
|
_: 1
|
|
2174
2187
|
}, 8, ["search", "filter-attributes", "filter"]),
|
|
2175
|
-
(u(),
|
|
2188
|
+
(u(), O(K, {
|
|
2176
2189
|
key: JSON.stringify(b.value),
|
|
2177
|
-
style: Nt(
|
|
2178
|
-
"column-defs":
|
|
2190
|
+
style: Nt(l(ee).tableHeight),
|
|
2191
|
+
"column-defs": l(E),
|
|
2179
2192
|
"row-data": U.value,
|
|
2180
2193
|
"search-value": N.value,
|
|
2181
2194
|
columnVisibility: {
|
|
2182
|
-
netsuiteSubsidiary:
|
|
2195
|
+
netsuiteSubsidiary: l(T).isEnabled
|
|
2183
2196
|
},
|
|
2184
|
-
loading: (!
|
|
2197
|
+
loading: (!l(k)._currentLocation || fe.value) && l(T).isReady,
|
|
2185
2198
|
"loading-text": "Loading",
|
|
2186
|
-
onRowClick: f[3] || (f[3] = (M) =>
|
|
2187
|
-
"page-size":
|
|
2199
|
+
onRowClick: f[3] || (f[3] = (M) => l(m)(M.original)),
|
|
2200
|
+
"page-size": le.value
|
|
2188
2201
|
}, {
|
|
2189
2202
|
"list-row": y((M) => [
|
|
2190
|
-
a(
|
|
2203
|
+
a(en, {
|
|
2191
2204
|
row: M,
|
|
2192
|
-
onRowClick:
|
|
2205
|
+
onRowClick: l(m)
|
|
2193
2206
|
}, Ye({
|
|
2194
2207
|
default: y((R) => {
|
|
2195
2208
|
var q, de, Te, _e, Ee, $e, we, be, se, Ve;
|
|
2196
2209
|
return [
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
a(
|
|
2210
|
+
o("div", il, [
|
|
2211
|
+
o("div", dl, [
|
|
2212
|
+
a(l(ht), {
|
|
2200
2213
|
render: (Te = (de = (q = R.code) == null ? void 0 : q.column) == null ? void 0 : de.columnDef) == null ? void 0 : Te.cell,
|
|
2201
2214
|
props: (Ee = (_e = R.code) == null ? void 0 : _e.getContext) == null ? void 0 : Ee.call(_e)
|
|
2202
2215
|
}, null, 8, ["render", "props"])
|
|
2203
2216
|
]),
|
|
2204
|
-
|
|
2205
|
-
a(
|
|
2217
|
+
o("div", ul, [
|
|
2218
|
+
a(l(ht), {
|
|
2206
2219
|
render: (be = (we = ($e = R.name) == null ? void 0 : $e.column) == null ? void 0 : we.columnDef) == null ? void 0 : be.cell,
|
|
2207
2220
|
props: (Ve = (se = R.name) == null ? void 0 : se.getContext) == null ? void 0 : Ve.call(se)
|
|
2208
2221
|
}, null, 8, ["render", "props"])
|
|
@@ -2212,10 +2225,10 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2212
2225
|
}),
|
|
2213
2226
|
_: 2
|
|
2214
2227
|
}, [
|
|
2215
|
-
|
|
2228
|
+
D.value ? {
|
|
2216
2229
|
name: "loading-text",
|
|
2217
2230
|
fn: y(() => [
|
|
2218
|
-
|
|
2231
|
+
o("div", null, A(l(i)("inventory.ingredient.table.importing")), 1)
|
|
2219
2232
|
]),
|
|
2220
2233
|
key: "0"
|
|
2221
2234
|
} : void 0
|
|
@@ -2224,11 +2237,11 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2224
2237
|
_: 1
|
|
2225
2238
|
}, 8, ["style", "column-defs", "row-data", "search-value", "columnVisibility", "loading", "page-size"]))
|
|
2226
2239
|
], 2),
|
|
2227
|
-
(u(),
|
|
2228
|
-
a(
|
|
2240
|
+
(u(), O(ut, { to: "body" }, [
|
|
2241
|
+
a(Wo, zt(Lt(l(v))), null, 16)
|
|
2229
2242
|
])),
|
|
2230
|
-
(u(),
|
|
2231
|
-
a(
|
|
2243
|
+
(u(), O(ut, { to: "body" }, [
|
|
2244
|
+
a(Z, {
|
|
2232
2245
|
"dismiss-away": "",
|
|
2233
2246
|
modelValue: ae.value,
|
|
2234
2247
|
"onUpdate:modelValue": f[5] || (f[5] = (M) => ae.value = M)
|
|
@@ -2250,5 +2263,5 @@ const zn = /* @__PURE__ */ pe({
|
|
|
2250
2263
|
}
|
|
2251
2264
|
});
|
|
2252
2265
|
export {
|
|
2253
|
-
|
|
2266
|
+
Ol as default
|
|
2254
2267
|
};
|