@feedmepos/mf-inventory-portal 1.8.0-dev.6 → 1.8.0-dev.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App-C8i7vBxz.js +1466 -0
- package/dist/{ApprovalView-DwHtlnLK.js → ApprovalView-GHgTeCBV.js} +9 -9
- package/dist/{BindingsDialog-COSQ6XVU.js → BindingsDialog-C4-S2CWk.js} +2 -2
- package/dist/{BindingsPicker-vn2GwOb7.js → BindingsPicker-C7YUArBj.js} +2 -2
- package/dist/{BindingsTable-B3-YXiPU.js → BindingsTable-1Zoqi4ZS.js} +4 -4
- package/dist/{BulkReceiveRequestView-LUAuL39I.js → BulkReceiveRequestView-Lakk8011.js} +19 -19
- package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Bq2bBCHH.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DFSg0-gv.js} +1 -1
- package/dist/{ClosingDraftView-BKgjXfss.js → ClosingDraftView-CnWFyWSE.js} +20 -20
- package/dist/ClosingHistoryView-Bkm0voU6.js +769 -0
- package/dist/{ClosingTemplateView-CNNgkrX0.js → ClosingTemplateView-Bz81JTsg.js} +18 -18
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DGxUjcQc.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-6s-24euf.js} +1 -1
- package/dist/{DefaultView-D9ldG5wf.js → DefaultView-1RRzbPB3.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-CnvuZat5.js → DeliveryOrderPrintPreview-KcLqjOj1.js} +2 -2
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-s0eDfL8g.js → EmailDialog.vue_vue_type_script_setup_true_lang-r0Q0qhoK.js} +663 -661
- package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-Cwmk3NLS.js +47 -0
- package/dist/FeatureCapabilityGate-C6t1VwKD.js +74 -0
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Bo4aCSFL.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-pzIzIWpX.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BhhKFtnX.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B6cFB4vX.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Dx8b6nGn.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D_o6pX9i.js} +2 -2
- package/dist/{FmMultiselectDialog-Coxul96n.js → FmMultiselectDialog-CC_Na_p1.js} +2 -2
- package/dist/{FmMultiselectDialog-zaOH0oB9.js → FmMultiselectDialog-D0GhmOQ9.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-B0xT-sP9.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DQlSMRoB.js} +6 -6
- package/dist/{ImportView-CuRogJ1u.js → ImportView-DCcdEvy4.js} +6 -6
- package/dist/{IngredientsView-BnEJ1QAk.js → IngredientsView-B2I2OPSb.js} +518 -523
- package/dist/{IntegrationExplorerView-DB-7hXUE.js → IntegrationExplorerView-WK1EmwLA.js} +4 -4
- package/dist/{IntegrationView-CBGPi1xL.js → IntegrationView-CeaL92Yj.js} +15 -15
- package/dist/{InventoryBindingForm-eggGypKW.js → InventoryBindingForm-DgtaDM0I.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CvQ82oaY.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CqDN355J.js} +5 -5
- package/dist/{InventoryBindingSummary-DegINJdx.js → InventoryBindingSummary-C_W456aj.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DYq61C5M.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BMDjCk9T.js} +1 -1
- package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-2t_ajTtF.js → PlanTierBadge.vue_vue_type_script_setup_true_lang-BSR_nyHY.js} +78 -101
- package/dist/PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-D6-lo7iI.js +79 -0
- package/dist/{ProductionRunDetailView-6uJmjwAg.js → ProductionRunDetailView-C9rxLBbL.js} +4 -4
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-Dcd3sV5C.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-DwBY6gIb.js} +7 -7
- package/dist/{ProductionRunView-CiypqoQT.js → ProductionRunView-DvMdVGz1.js} +3 -3
- package/dist/{PublishView-DEyODScT.js → PublishView-Dv-W6ntx.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-DjsD8HaB.js → PurchaseOrderPrintPreview-D1TAnJd_.js} +2 -2
- package/dist/{ReceiveRequestView-DGWA-SOC.js → ReceiveRequestView-Rc_uw_Ad.js} +13 -13
- package/dist/{RecipeView-CO5kxazA.js → RecipeView-ByUaGc4w.js} +16 -16
- package/dist/SettingsView-K5wAt8oo.js +1032 -0
- package/dist/StockView-B3EjdjVx.js +2615 -0
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-C8q3IBMg.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CsRLy0xI.js} +1 -1
- package/dist/{SupplierView-D62RB87K.js → SupplierView-CLVupRN0.js} +298 -296
- package/dist/{SurchargeView-DY4xuPN0.js → SurchargeView-CToB_z5v.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-C27rA7Z_.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CvqIw9q6.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BhhvJtAf.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BGPuaJlU.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-cvgA7DlK.js → TransferDetails.vue_vue_type_script_setup_true_lang-8ydaQEw-.js} +785 -769
- package/dist/{TransferTemplateView-DZk-6Z-1.js → TransferTemplateView-BnfALwmw.js} +20 -20
- package/dist/{UnitCostHistoryView-C-aNhP72.js → UnitCostHistoryView-BMB2MeTh.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-D655ehgk.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-Dn8Y8zfp.js} +4 -4
- package/dist/{UnitView-h2n8XNZr.js → UnitView-Bl8jws6R.js} +8 -8
- package/dist/{WarehouseView-gPPmrhxB.js → WarehouseView-BurSM1jg.js} +8 -8
- package/dist/{WastageTemplateView-7bp-1vTP.js → WastageTemplateView-DRfJ9LGR.js} +15 -15
- package/dist/api/license.d.ts +1 -0
- package/dist/{app-_FoXoYBy.js → app-Duum3eHx.js} +16 -16
- package/dist/app.js +1 -1
- package/dist/{closing-template-D8bk-LUW.js → closing-template-BE41yfue.js} +1 -1
- package/dist/components/FeatureCapabilityGate.spec.d.ts +1 -0
- package/dist/components/FeatureCapabilityGate.vue.d.ts +2 -0
- package/dist/{date2-DE0h0f1Z.js → date2-DrhO3BxU.js} +1 -1
- package/dist/{dayjs.min-DxnjPhAT.js → dayjs.min-CQp6EpOp.js} +1 -1
- package/dist/{decimal-D9ZB4atK.js → decimal-Cq0qUT4r.js} +2 -2
- package/dist/{defineDeepModel-pn4B1f06.js → defineDeepModel-DRC39nJs.js} +1 -1
- package/dist/{duplicate-template-DS-mr3MQ.js → duplicate-template-j2ymeDNH.js} +1 -1
- package/dist/{feature-D0aaeyga.js → feature-C0hQza5A.js} +125 -103
- package/dist/feature-flags/portal-feature-catalog.d.ts +1 -1
- package/dist/feature-flags/portal-feature-catalog.spec.d.ts +1 -0
- package/dist/feature-flags/vue.spec.d.ts +1 -0
- package/dist/{format-time-from-id-CbFUj3BY.js → format-time-from-id-BmJoI3jT.js} +1 -1
- package/dist/{format-unit-display-DulZiawi.js → format-unit-display-CRgIMXsD.js} +13 -13
- package/dist/{id-to-date-CLCvDHvP.js → id-to-date-CuFZDvIr.js} +1 -1
- package/dist/{import-export.helper-Ce1hr39u.js → import-export.helper-B43zbsbj.js} +6 -6
- package/dist/{index-DDw8ryXI.js → index-BYDjs08n.js} +1 -1
- package/dist/{index-DrkUq9y6.js → index-Cwvg7EHd.js} +3 -3
- package/dist/{index-DpxJ3TzB.js → index-DXNYZeq3.js} +1 -1
- package/dist/{lz-string-BakfyAq0.js → lz-string-6DgW1cPF.js} +1 -1
- package/dist/{netsuite-Cn2W-lOV.js → netsuite-BSpmyaE1.js} +2 -2
- package/dist/{number-B2-Gbof3.js → number-5ZeFx-wN.js} +3 -3
- package/dist/{predefined-templates-DmITBHzs.js → predefined-templates-C0jtb4T7.js} +1 -1
- package/dist/{purchase-order-template-BfP6Sy0k.js → purchase-order-template-B5Pjddfi.js} +1 -1
- package/dist/{recalculationUtils-BRe2QPvC.js → recalculationUtils-DtJWwWSj.js} +1 -1
- package/dist/{row-action.enum-CxzHcy4A.js → row-action.enum-BDDJNSi0.js} +1 -1
- package/dist/{rules-CjqBvFGt.js → rules-CinZKpvV.js} +2 -2
- package/dist/{stock-BT50AgTx.js → stock-1n-4iyqz.js} +3 -3
- package/dist/{stock-CjFjkezq.js → stock-BKMDvf5S.js} +1 -1
- package/dist/stores/feature.d.ts +5 -0
- package/dist/style.css +1 -1
- package/dist/{supplier-wmjWWKaf.js → supplier-Cv8HRNou.js} +2 -2
- package/dist/{surcharge-CQC6Fa7Q.js → surcharge-ktE1pRyy.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-CUQleOt4.js → uom-rules-DCnXmEkb.js} +1 -1
- package/dist/{use-ingredient-select-dialog-7VVHmM7s.js → use-ingredient-select-dialog-CYUUVrCI.js} +2 -2
- package/dist/{use-inventory-binding-dialog-C8m7iwRG.js → use-inventory-binding-dialog-Dugj9i-6.js} +2 -2
- package/dist/{use-template-enabled-locations-CRgTVDMh.js → use-template-enabled-locations-BlZ7WAqX.js} +2 -2
- package/dist/{use-transfer-locations-Bs0PotVA.js → use-transfer-locations-CUDFnsVH.js} +2 -2
- package/dist/{useHrmPermission-DcAzZ0CT.js → useHrmPermission-BOwmXi9H.js} +1 -1
- package/dist/{useNavigationMenu-CtihCeyC.js → useNavigationMenu-CbNKFBwx.js} +70 -69
- package/dist/{useSseClient-CizgYCQI.js → useSseClient-CdyQh47h.js} +1 -1
- package/dist/views/settings/PlanLicenseDisplay.spec.d.ts +1 -0
- package/dist/views/settings/PlanLicenseDisplay.vue.d.ts +15 -0
- package/dist/{vue-i18n-DpTQ6ev1.js → vue-i18n-dSKy66Jh.js} +295 -295
- package/dist/{xlsx.util-CPC0Dkyo.js → xlsx.util-pjzuMquw.js} +2 -2
- package/package.json +4 -4
- package/dist/App-B8DzC8Td.js +0 -1537
- package/dist/ClosingHistoryView-BI_zufKI.js +0 -761
- package/dist/SettingsView-9uq0QYht.js +0 -978
- package/dist/StockView-YKfyjTE1.js +0 -2616
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import { ref as P, defineComponent as
|
|
2
|
-
import { a as Fe, c as wt, S as Lt, g as dt, e as ut, f as jt, h as
|
|
1
|
+
import { ref as P, defineComponent as xe, computed as g, resolveComponent as S, createElementBlock as V, openBlock as p, Fragment as ee, createCommentVNode as L, createVNode as s, unref as o, withModifiers as Rt, withCtx as x, createElementVNode as n, renderList as de, createBlock as Y, toDisplayString as $, normalizeClass as ie, h as Z, mergeModels as st, onMounted as Ot, watch as _t, useModel as Bt, createTextVNode as xt, isRef as rt, createSlots as kt, normalizeStyle as Dt, Teleport as it, normalizeProps as Nt, guardReactiveProps as zt } from "vue";
|
|
2
|
+
import { a as Fe, c as wt, S as Lt, g as dt, e as ut, f as jt, h as ct, i as mt, j as pt, k as vt, u as Wt, l as qt } from "./app-Duum3eHx.js";
|
|
3
3
|
import { useDialog as Ke, useSnackbar as Ae, components as ze, useProxiedModel as ft, useDialogChild as Ht, useBreakpoints as Yt } from "@feedmepos/ui-library";
|
|
4
4
|
import { i as Kt, _ as Gt, m as Jt } from "./menu-usage-module-BdjYEk3s.js";
|
|
5
|
-
import { F as
|
|
5
|
+
import { F as j } from "./form-mode.enum-BKiNVH6A.js";
|
|
6
6
|
import { useI18n as pe, useCoreStore as Ge } from "@feedmepos/mf-common";
|
|
7
7
|
import { defineStore as Qt, storeToRefs as Xt } from "pinia";
|
|
8
|
-
import { D as yt, R as Pe } from "./row-action.enum-
|
|
8
|
+
import { D as yt, R as Pe } from "./row-action.enum-BDDJNSi0.js";
|
|
9
9
|
import { c as Zt } from "./component-BmLAdDiY.js";
|
|
10
|
-
import { u as Ee, _ as en } from "./netsuite-
|
|
10
|
+
import { u as Ee, _ as en } from "./netsuite-BSpmyaE1.js";
|
|
11
11
|
import { F as Be } from "./FmAdminBadge-DlplQOHb.js";
|
|
12
12
|
import { u as tn, _ as nn } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
|
|
13
|
-
import { A as Oe, R as Le, U as on, M as ln } from "./rules-
|
|
14
|
-
import { g as an, _ as je, S as We, a as sn } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-
|
|
15
|
-
import { _ as rn } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-
|
|
16
|
-
import { _ as qe, u as dn } from "./FmMultiselectDialog-
|
|
17
|
-
import { u as Tt } from "./feature-
|
|
18
|
-
import { t as un, a as
|
|
19
|
-
import {
|
|
20
|
-
import { d as Re, g as pn, e as vn, a as fn } from "./import-export.helper-
|
|
13
|
+
import { A as Oe, R as Le, U as on, M as ln } from "./rules-CinZKpvV.js";
|
|
14
|
+
import { g as an, _ as je, S as We, a as sn } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CsRLy0xI.js";
|
|
15
|
+
import { _ as rn } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CqDN355J.js";
|
|
16
|
+
import { _ as qe, u as dn } from "./FmMultiselectDialog-CC_Na_p1.js";
|
|
17
|
+
import { u as Tt } from "./feature-C0hQza5A.js";
|
|
18
|
+
import { t as un, a as cn, g as mn } from "./number-5ZeFx-wN.js";
|
|
19
|
+
import { _ as ke } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-Cwmk3NLS.js";
|
|
20
|
+
import { d as Re, g as pn, e as vn, a as fn } from "./import-export.helper-B43zbsbj.js";
|
|
21
21
|
import { _ as yn } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-CG1m-B2p.js";
|
|
22
22
|
import { _ as Ce } from "./FmLockableField.vue_vue_type_script_setup_true_lang-FCg4K7y8.js";
|
|
23
|
-
import { F as gn, a as He } from "./FmMultiselectDialog-
|
|
24
|
-
import { u as Vt } from "./purchase-order-template-
|
|
25
|
-
import { u as It, a as St } from "./closing-template-
|
|
23
|
+
import { F as gn, a as He } from "./FmMultiselectDialog-D0GhmOQ9.js";
|
|
24
|
+
import { u as Vt } from "./purchase-order-template-B5Pjddfi.js";
|
|
25
|
+
import { u as It, a as St } from "./closing-template-BE41yfue.js";
|
|
26
26
|
import { _ as bn, F as gt } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js";
|
|
27
|
-
import { r as hn } from "./xlsx.util-
|
|
27
|
+
import { r as hn } from "./xlsx.util-pjzuMquw.js";
|
|
28
28
|
import { F as _n } from "./FmDroppableField-J0tG_U3w.js";
|
|
29
|
-
import { _ as xn } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
29
|
+
import { _ as xn } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D_o6pX9i.js";
|
|
30
30
|
import { P as kn, J as wn } from "./app-C39bYJmq.js";
|
|
31
31
|
const Ye = Qt("ingredientForm", function() {
|
|
32
|
-
const h = Ke(), k = Ae(),
|
|
32
|
+
const h = Ke(), k = Ae(), d = Fe(), _ = P(!1), { t: C } = pe(), A = P();
|
|
33
33
|
function U() {
|
|
34
34
|
const a = {
|
|
35
35
|
sku: {},
|
|
36
|
-
mode:
|
|
36
|
+
mode: j.CREATE,
|
|
37
37
|
show: !0,
|
|
38
|
-
"onUpdate:show"(
|
|
39
|
-
A.value.show =
|
|
38
|
+
"onUpdate:show"(c) {
|
|
39
|
+
A.value.show = c;
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
A.value = a;
|
|
43
43
|
}
|
|
44
44
|
async function l(a) {
|
|
45
|
-
const
|
|
45
|
+
const c = {
|
|
46
46
|
sku: wt(a),
|
|
47
|
-
mode:
|
|
47
|
+
mode: j.UPDATE,
|
|
48
48
|
show: !0,
|
|
49
49
|
"onUpdate:show"(r) {
|
|
50
50
|
A.value.show = r;
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
-
A.value =
|
|
53
|
+
A.value = c;
|
|
54
54
|
}
|
|
55
55
|
async function i(a) {
|
|
56
56
|
_.value = !0;
|
|
57
57
|
try {
|
|
58
|
-
await
|
|
58
|
+
await d.deleteSku(a), k.open({
|
|
59
59
|
title: "Success",
|
|
60
60
|
message: `Deleted ${a.name}`,
|
|
61
61
|
type: "success"
|
|
62
62
|
});
|
|
63
|
-
} catch (
|
|
64
|
-
if (
|
|
63
|
+
} catch (c) {
|
|
64
|
+
if (c instanceof Lt && Kt(c)) {
|
|
65
65
|
h.open({
|
|
66
66
|
title: "Cannot delete ingredient",
|
|
67
67
|
contentComponent: Gt,
|
|
68
68
|
contentComponentProps: {
|
|
69
69
|
subject: (a == null ? void 0 : a.name) ?? "",
|
|
70
|
-
items:
|
|
70
|
+
items: c.errorResponse.errors.map((r) => {
|
|
71
71
|
var f;
|
|
72
72
|
return {
|
|
73
73
|
chain: [
|
|
@@ -90,12 +90,12 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
90
90
|
title: `Cannot delete ${a.name}`,
|
|
91
91
|
message: "Please try again.",
|
|
92
92
|
type: "error"
|
|
93
|
-
}), console.error("failed to delete ingredient",
|
|
93
|
+
}), console.error("failed to delete ingredient", c);
|
|
94
94
|
} finally {
|
|
95
95
|
_.value = !1;
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function u(a) {
|
|
99
99
|
h.open({
|
|
100
100
|
title: C("inventory.ingredient.delete.title", [(a == null ? void 0 : a.name) ?? ""]),
|
|
101
101
|
closeButton: !1,
|
|
@@ -114,7 +114,7 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
114
114
|
return {
|
|
115
115
|
createIngredient: U,
|
|
116
116
|
updateIngredient: l,
|
|
117
|
-
deleteIngredient:
|
|
117
|
+
deleteIngredient: u,
|
|
118
118
|
ingredientDialogProps: A,
|
|
119
119
|
ingredientViewLoading: _
|
|
120
120
|
};
|
|
@@ -127,58 +127,58 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
127
127
|
}, An = {
|
|
128
128
|
key: 1,
|
|
129
129
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
130
|
-
}, 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" }, On = { class: "px-2 py-1 rounded-md bg-blue-200 border-2 border-blue-400" }, Bn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, Dn = /* @__PURE__ */
|
|
130
|
+
}, 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" }, On = { class: "px-2 py-1 rounded-md bg-blue-200 border-2 border-blue-400" }, Bn = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, Dn = /* @__PURE__ */ xe({
|
|
131
131
|
__name: "ItemSubsidiaryTreeDialog",
|
|
132
132
|
props: {
|
|
133
133
|
skuId: {},
|
|
134
134
|
itemName: {},
|
|
135
135
|
itemCode: {}
|
|
136
136
|
},
|
|
137
|
-
setup(
|
|
138
|
-
const h =
|
|
137
|
+
setup(W) {
|
|
138
|
+
const h = W, { t: k } = pe(), d = Ge(), _ = Ee(), C = P(!1), A = g(() => {
|
|
139
139
|
var r;
|
|
140
|
-
return ((r =
|
|
140
|
+
return ((r = d.sessionUser.value) == null ? void 0 : r.role.isAdmin) ?? !1;
|
|
141
141
|
}), U = g(() => _.getSkuSubsidiaries(h.skuId)), l = g(() => {
|
|
142
142
|
const r = /* @__PURE__ */ new Set();
|
|
143
143
|
function f(F) {
|
|
144
|
-
for (const
|
|
145
|
-
|
|
144
|
+
for (const m of F)
|
|
145
|
+
m.isAssigned && (r.add(m.id), U.value.includeChildren && w(m)), m.children && m.children.length > 0 && f(m.children);
|
|
146
146
|
}
|
|
147
147
|
function w(F) {
|
|
148
148
|
if (F.children)
|
|
149
|
-
for (const
|
|
150
|
-
r.add(
|
|
149
|
+
for (const m of F.children)
|
|
150
|
+
r.add(m.id), w(m);
|
|
151
151
|
}
|
|
152
152
|
return f(U.value.subsidiaryTree), r;
|
|
153
153
|
});
|
|
154
154
|
function i(r, f = [], w = !1) {
|
|
155
155
|
const F = [];
|
|
156
|
-
return r.forEach((
|
|
156
|
+
return r.forEach((m, B) => {
|
|
157
157
|
const R = B === r.length - 1, ve = [...f, R];
|
|
158
158
|
let ne = "";
|
|
159
159
|
for (let te = 0; te < f.length; te++)
|
|
160
160
|
ne += f[te] ? " " : "│ ";
|
|
161
161
|
ne += R ? "└── " : "├── ";
|
|
162
|
-
const ue = l.value.has(
|
|
162
|
+
const ue = l.value.has(m.id), oe = m.isAssigned === !0, le = w && !oe;
|
|
163
163
|
if (F.push({
|
|
164
|
-
id:
|
|
165
|
-
name:
|
|
164
|
+
id: m.id,
|
|
165
|
+
name: m.name,
|
|
166
166
|
prefix: f.length === 0 ? "" : ne,
|
|
167
167
|
isHighlighted: ue,
|
|
168
168
|
isDirectlyBound: oe,
|
|
169
169
|
isParentIncludedChild: le,
|
|
170
170
|
isRoot: f.length === 0
|
|
171
|
-
}),
|
|
171
|
+
}), m.children && m.children.length > 0) {
|
|
172
172
|
const te = w || oe && U.value.includeChildren;
|
|
173
|
-
F.push(...i(
|
|
173
|
+
F.push(...i(m.children, ve, te));
|
|
174
174
|
}
|
|
175
175
|
}), F;
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function u(r, f = []) {
|
|
178
178
|
const w = /* @__PURE__ */ new Set();
|
|
179
179
|
for (const F of r) {
|
|
180
|
-
const
|
|
181
|
-
F.isAssigned === !0 &&
|
|
180
|
+
const m = [...f, F.id];
|
|
181
|
+
F.isAssigned === !0 && m.forEach((B) => w.add(B)), F.children && F.children.length > 0 && u(F.children, m).forEach((R) => w.add(R));
|
|
182
182
|
}
|
|
183
183
|
return w;
|
|
184
184
|
}
|
|
@@ -189,27 +189,27 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
189
189
|
children: w.children ? a(w.children, f) : []
|
|
190
190
|
} : null).filter(Boolean);
|
|
191
191
|
}
|
|
192
|
-
const
|
|
192
|
+
const c = g(() => {
|
|
193
193
|
let r = U.value.subsidiaryTree;
|
|
194
194
|
if ((!r || r.length === 0) && (r = _.getBusinessSubsidiaryTree()), !A.value) {
|
|
195
|
-
const f =
|
|
195
|
+
const f = u(r);
|
|
196
196
|
r = a(r, f);
|
|
197
197
|
}
|
|
198
198
|
return i(r, []);
|
|
199
199
|
});
|
|
200
200
|
return (r, f) => {
|
|
201
201
|
const w = S("FmButton"), F = S("FmDialog");
|
|
202
|
-
return
|
|
203
|
-
o(_).isEnabled ? (
|
|
202
|
+
return p(), V(ee, null, [
|
|
203
|
+
o(_).isEnabled ? (p(), V("div", Tn, [
|
|
204
204
|
s(w, {
|
|
205
205
|
"prepend-icon": "info",
|
|
206
206
|
variant: "tertiary",
|
|
207
|
-
onClick: f[0] || (f[0] = Rt((
|
|
207
|
+
onClick: f[0] || (f[0] = Rt((m) => C.value = !0, ["stop"]))
|
|
208
208
|
})
|
|
209
|
-
])) :
|
|
209
|
+
])) : L("", !0),
|
|
210
210
|
s(F, {
|
|
211
211
|
modelValue: C.value,
|
|
212
|
-
"onUpdate:modelValue": f[1] || (f[1] = (
|
|
212
|
+
"onUpdate:modelValue": f[1] || (f[1] = (m) => C.value = m),
|
|
213
213
|
"close-button": "",
|
|
214
214
|
dismissAway: ""
|
|
215
215
|
}, {
|
|
@@ -218,7 +218,7 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
218
218
|
n("div", In, $(o(k)("inventory.integration.netsuite.subsidiaryHierarchy.title")), 1),
|
|
219
219
|
n("p", Sn, " Name: " + $(h.itemName), 1),
|
|
220
220
|
n("p", Cn, " Code: " + $(h.itemCode), 1),
|
|
221
|
-
A.value ? (
|
|
221
|
+
A.value ? (p(), V("p", Fn, " All subsidiaries are shown since you are an admin. ")) : (p(), V("p", An, " Only showing subsidiaries in your business path and bound subsidiaries. ")),
|
|
222
222
|
n("div", En, [
|
|
223
223
|
n("div", $n, [
|
|
224
224
|
f[2] || (f[2] = n("span", { class: "font-semibold" }, "Include Children Subsidiaries:", -1)),
|
|
@@ -249,33 +249,33 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
249
249
|
default: x(() => [
|
|
250
250
|
n("div", Un, [
|
|
251
251
|
n("div", Pn, [
|
|
252
|
-
(
|
|
253
|
-
key:
|
|
252
|
+
(p(!0), V(ee, null, de(c.value, (m) => (p(), V("div", {
|
|
253
|
+
key: m.id,
|
|
254
254
|
class: "flex items-stretch"
|
|
255
255
|
}, [
|
|
256
|
-
n("span", Rn, $(
|
|
257
|
-
|
|
256
|
+
n("span", Rn, $(m.prefix), 1),
|
|
257
|
+
m.isParentIncludedChild ? (p(), Y(Be, {
|
|
258
258
|
key: 0,
|
|
259
259
|
class: "flex-1"
|
|
260
260
|
}, {
|
|
261
261
|
default: x(() => [
|
|
262
262
|
n("div", On, [
|
|
263
|
-
n("span", Bn, $(
|
|
263
|
+
n("span", Bn, $(m.name), 1)
|
|
264
264
|
])
|
|
265
265
|
]),
|
|
266
266
|
_: 2
|
|
267
|
-
}, 1024)) : (
|
|
267
|
+
}, 1024)) : (p(), V("div", {
|
|
268
268
|
key: 1,
|
|
269
269
|
class: ie([
|
|
270
270
|
"px-2 py-1 rounded-md flex-1",
|
|
271
|
-
|
|
271
|
+
m.isDirectlyBound ? "border-2 bg-green-200 border-green-400" : "bg-fm-color-bg-primary border border-fm-color-border-secondary"
|
|
272
272
|
])
|
|
273
273
|
}, [
|
|
274
274
|
n("span", {
|
|
275
275
|
class: ie([
|
|
276
|
-
|
|
276
|
+
m.isHighlighted ? "fm-typo-en-body-md-600 text-fm-color-typo-primary" : "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
277
277
|
])
|
|
278
|
-
}, $(
|
|
278
|
+
}, $(m.name), 3)
|
|
279
279
|
], 2))
|
|
280
280
|
]))), 128))
|
|
281
281
|
])
|
|
@@ -289,11 +289,11 @@ const Ye = Qt("ingredientForm", function() {
|
|
|
289
289
|
});
|
|
290
290
|
function Nn() {
|
|
291
291
|
var l;
|
|
292
|
-
const { updateIngredient:
|
|
293
|
-
async function A(i,
|
|
294
|
-
const a = wt(
|
|
292
|
+
const { updateIngredient: W, deleteIngredient: h } = Ye(), k = Fe(), d = Ee(), { t: _ } = pe(), C = Ge();
|
|
293
|
+
async function A(i, u) {
|
|
294
|
+
const a = wt(u);
|
|
295
295
|
if (i === Pe.Edit) {
|
|
296
|
-
await
|
|
296
|
+
await W(a);
|
|
297
297
|
return;
|
|
298
298
|
}
|
|
299
299
|
if (i === Pe.Delete) {
|
|
@@ -321,11 +321,11 @@ function Nn() {
|
|
|
321
321
|
enableSorting: !0,
|
|
322
322
|
size: 300,
|
|
323
323
|
cell(i) {
|
|
324
|
-
const
|
|
324
|
+
const u = i.row.original, a = k.skuBindingFlattenCache[u._id], c = a == null ? void 0 : a.inventoryBindings.some(
|
|
325
325
|
(r) => "error" in r && r.reason === "circularDependency"
|
|
326
326
|
);
|
|
327
327
|
return Z("div", { class: "flex items-center w-full gap-4" }, [
|
|
328
|
-
|
|
328
|
+
c ? Z(
|
|
329
329
|
ze.FmTooltip,
|
|
330
330
|
{ class: "text-left" },
|
|
331
331
|
{
|
|
@@ -341,7 +341,7 @@ function Nn() {
|
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
) : null,
|
|
344
|
-
|
|
344
|
+
u.name
|
|
345
345
|
]);
|
|
346
346
|
}
|
|
347
347
|
},
|
|
@@ -350,7 +350,7 @@ function Nn() {
|
|
|
350
350
|
header: () => _("inventory.ingredient.unit"),
|
|
351
351
|
accessorFn: (i) => bt(i),
|
|
352
352
|
cell(i) {
|
|
353
|
-
const
|
|
353
|
+
const u = i.row.original, a = bt(u);
|
|
354
354
|
return Z(
|
|
355
355
|
ze.FmTooltip,
|
|
356
356
|
{ zIndex: 51, content: a },
|
|
@@ -370,26 +370,26 @@ function Nn() {
|
|
|
370
370
|
accessorKey: "isInactive",
|
|
371
371
|
header: () => _("inventory.ingredient.status.title"),
|
|
372
372
|
cell(i) {
|
|
373
|
-
const
|
|
373
|
+
const u = i.row.original.isInactive;
|
|
374
374
|
return Z(
|
|
375
375
|
"span",
|
|
376
376
|
{
|
|
377
377
|
class: [
|
|
378
378
|
"inline-block px-3 py-1 rounded-full text-xs font-semibold",
|
|
379
|
-
|
|
379
|
+
u ? "bg-red-100 text-red-700" : "bg-green-100 text-green-700"
|
|
380
380
|
].join(" ")
|
|
381
381
|
},
|
|
382
|
-
_(
|
|
382
|
+
_(u ? "inventory.ingredient.status.inactive" : "inventory.ingredient.status.active")
|
|
383
383
|
);
|
|
384
384
|
},
|
|
385
385
|
enableSorting: !0
|
|
386
386
|
},
|
|
387
387
|
{
|
|
388
388
|
id: "netsuiteSubsidiary",
|
|
389
|
-
accessorFn: (i) =>
|
|
389
|
+
accessorFn: (i) => d.getSkuSubsidiaries(i._id),
|
|
390
390
|
header: () => "NetSuite Subsidiary",
|
|
391
391
|
cell(i) {
|
|
392
|
-
const
|
|
392
|
+
const u = i.row.original, { flattenedSubsidiaryNames: a } = d.getSkuSubsidiaries(u._id);
|
|
393
393
|
return Z("div", { class: "flex gap-2 items-start" }, [
|
|
394
394
|
Z(
|
|
395
395
|
"span",
|
|
@@ -398,7 +398,7 @@ function Nn() {
|
|
|
398
398
|
},
|
|
399
399
|
a.join(", ")
|
|
400
400
|
),
|
|
401
|
-
Z(Dn, { skuId:
|
|
401
|
+
Z(Dn, { skuId: u._id, itemName: u.name, itemCode: u.code })
|
|
402
402
|
]);
|
|
403
403
|
},
|
|
404
404
|
enableSorting: !1,
|
|
@@ -410,8 +410,8 @@ function Nn() {
|
|
|
410
410
|
cell(i) {
|
|
411
411
|
return Zt(
|
|
412
412
|
[yt[Pe.Edit], yt[Pe.Delete]],
|
|
413
|
-
(
|
|
414
|
-
A(
|
|
413
|
+
(u) => {
|
|
414
|
+
A(u, i.row.original);
|
|
415
415
|
}
|
|
416
416
|
);
|
|
417
417
|
},
|
|
@@ -424,16 +424,16 @@ function Nn() {
|
|
|
424
424
|
}
|
|
425
425
|
] };
|
|
426
426
|
}
|
|
427
|
-
function bt(
|
|
427
|
+
function bt(W) {
|
|
428
428
|
var h;
|
|
429
|
-
if (
|
|
430
|
-
const k = (h =
|
|
429
|
+
if (W.trackingMeasurement) {
|
|
430
|
+
const k = (h = W.unit.measurements) == null ? void 0 : h.find((d) => d.id === W.trackingMeasurement);
|
|
431
431
|
if (k)
|
|
432
432
|
return `${k.name} (${k.abbrev})`;
|
|
433
433
|
}
|
|
434
|
-
return `${
|
|
434
|
+
return `${W.unit.name} (${W.unit.abbrev})`;
|
|
435
435
|
}
|
|
436
|
-
const zn = /* @__PURE__ */
|
|
436
|
+
const zn = /* @__PURE__ */ xe({
|
|
437
437
|
__name: "ConvertForm",
|
|
438
438
|
props: {
|
|
439
439
|
modelValue: {},
|
|
@@ -442,45 +442,45 @@ const zn = /* @__PURE__ */ ke({
|
|
|
442
442
|
readonly: { type: Boolean }
|
|
443
443
|
},
|
|
444
444
|
emits: ["update:modelValue"],
|
|
445
|
-
setup(
|
|
446
|
-
const k =
|
|
447
|
-
var
|
|
448
|
-
return (
|
|
445
|
+
setup(W, { emit: h }) {
|
|
446
|
+
const k = W, d = g(() => {
|
|
447
|
+
var c;
|
|
448
|
+
return (c = k.rootValue) == null ? void 0 : c.unit;
|
|
449
449
|
}), _ = g(() => {
|
|
450
|
-
var
|
|
451
|
-
return (
|
|
450
|
+
var c;
|
|
451
|
+
return (c = k.rootValue) == null ? void 0 : c._id;
|
|
452
452
|
}), C = h, { t: A } = pe(), U = g({
|
|
453
453
|
get() {
|
|
454
454
|
return !!k.modelValue;
|
|
455
455
|
},
|
|
456
|
-
set(
|
|
457
|
-
|
|
456
|
+
set(c) {
|
|
457
|
+
c ? C("update:modelValue", {
|
|
458
458
|
measurement: null,
|
|
459
459
|
inventoryBindings: []
|
|
460
460
|
}) : C("update:modelValue", null);
|
|
461
461
|
}
|
|
462
|
-
}), l = g(() => an(
|
|
463
|
-
function i(
|
|
462
|
+
}), l = g(() => an(d.value));
|
|
463
|
+
function i(c) {
|
|
464
464
|
const r = k.modelValue ?? {};
|
|
465
|
-
r.measurement =
|
|
465
|
+
r.measurement = c ? `${c}` : null, C("update:modelValue", r);
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function u(c) {
|
|
468
468
|
const r = k.modelValue ?? {};
|
|
469
|
-
r.inventoryBindings =
|
|
469
|
+
r.inventoryBindings = c, C("update:modelValue", r);
|
|
470
470
|
}
|
|
471
471
|
const a = g(() => {
|
|
472
472
|
if (!k.modelValue) return null;
|
|
473
|
-
const
|
|
474
|
-
return
|
|
473
|
+
const c = k.modelValue;
|
|
474
|
+
return c.measurement ? l.value.find((r) => r.value === c.measurement) ?? null : l.value.find((r) => r.value === null) ?? null;
|
|
475
475
|
});
|
|
476
|
-
return (
|
|
476
|
+
return (c, r) => {
|
|
477
477
|
const f = S("FmSwitch"), w = S("FmSelect"), F = S("FmCard");
|
|
478
|
-
return
|
|
478
|
+
return p(), Y(F, {
|
|
479
479
|
variant: "outlined",
|
|
480
480
|
class: "p-16 flex flex-col gap-16"
|
|
481
481
|
}, {
|
|
482
482
|
default: x(() => {
|
|
483
|
-
var
|
|
483
|
+
var m, B;
|
|
484
484
|
return [
|
|
485
485
|
s(f, {
|
|
486
486
|
value: "",
|
|
@@ -489,59 +489,59 @@ const zn = /* @__PURE__ */ ke({
|
|
|
489
489
|
label: o(A)("inventory.ingredient.convertible.title"),
|
|
490
490
|
sublabel: o(A)("inventory.ingredient.convertible.subtitle"),
|
|
491
491
|
labelPlacement: "right",
|
|
492
|
-
disabled:
|
|
492
|
+
disabled: c.readonly
|
|
493
493
|
}, null, 8, ["model-value", "label", "sublabel", "disabled"]),
|
|
494
|
-
U.value ? (
|
|
494
|
+
U.value ? (p(), V(ee, { key: 0 }, [
|
|
495
495
|
n("div", null, [
|
|
496
496
|
s(w, {
|
|
497
497
|
label: o(A)("inventory.ingredient.convertible.convertTo"),
|
|
498
|
-
modelValue: (
|
|
498
|
+
modelValue: (m = a.value) == null ? void 0 : m.value,
|
|
499
499
|
"onUpdate:modelValue": i,
|
|
500
500
|
items: l.value,
|
|
501
|
-
disabled:
|
|
501
|
+
disabled: c.readonly
|
|
502
502
|
}, null, 8, ["label", "modelValue", "items", "disabled"])
|
|
503
503
|
]),
|
|
504
504
|
s(rn, {
|
|
505
505
|
id: _.value,
|
|
506
|
-
"model-value": ((B =
|
|
507
|
-
"onUpdate:modelValue":
|
|
506
|
+
"model-value": ((B = c.modelValue) == null ? void 0 : B.inventoryBindings) ?? [],
|
|
507
|
+
"onUpdate:modelValue": u,
|
|
508
508
|
"exclude-binding-id": _.value,
|
|
509
509
|
rules: [o(Oe)(1)],
|
|
510
|
-
readonly:
|
|
510
|
+
readonly: c.readonly,
|
|
511
511
|
"allow-recipe-decimal": ""
|
|
512
512
|
}, null, 8, ["id", "model-value", "exclude-binding-id", "rules", "readonly"])
|
|
513
|
-
], 64)) :
|
|
513
|
+
], 64)) : L("", !0)
|
|
514
514
|
];
|
|
515
515
|
}),
|
|
516
516
|
_: 1
|
|
517
517
|
});
|
|
518
518
|
};
|
|
519
519
|
}
|
|
520
|
-
}), Ln = { class: "flex gap-8" }, jn = { class: "flex-1" }, Wn = { class: "flex-1" }, qn = { class: "flex flex-col gap-5" }, Hn = { class: "flex
|
|
521
|
-
key:
|
|
520
|
+
}), Ln = { class: "flex gap-8" }, jn = { class: "flex-1" }, Wn = { class: "flex-1" }, qn = { class: "flex flex-col gap-5" }, Hn = { class: "flex flex-col gap-32" }, Yn = { class: "flex items-center gap-8" }, Kn = { class: "flex items-center gap-8" }, Gn = { class: "flex items-center gap-8" }, Jn = { class: "text-fm-color-typo-secondary" }, Qn = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, Xn = {
|
|
521
|
+
key: 1,
|
|
522
522
|
class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
|
|
523
|
-
},
|
|
524
|
-
key:
|
|
523
|
+
}, Zn = { class: "flex flex-col" }, eo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, to = {
|
|
524
|
+
key: 2,
|
|
525
525
|
class: "border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
|
|
526
|
-
},
|
|
527
|
-
key:
|
|
526
|
+
}, no = { class: "flex flex-col gap-12" }, oo = { class: "flex flex-col gap-4" }, lo = { class: "flex items-center gap-8" }, ao = { class: "fm-typo-en-title-sm-600" }, so = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ro = { class: "flex flex-col gap-4" }, io = { class: "flex fm-corner-radius-md border-1 border-fm-color-neutral-gray-200" }, uo = { class: "flex-1 p-12 flex flex-col gap-8" }, co = { class: "mx-auto" }, mo = { class: "flex flex-col" }, po = { class: "fm-typo-en-body-sm-600 translate-y-4" }, vo = { class: "flex-1 p-12 flex flex-col gap-8" }, fo = { class: "mx-auto" }, yo = { class: "flex flex-col" }, go = { class: "fm-typo-en-body-sm-600 translate-y-4" }, bo = { class: "flex-1 p-12 flex flex-col gap-8" }, ho = { class: "mx-auto" }, _o = { class: "flex flex-col" }, xo = { class: "fm-typo-en-body-sm-600 translate-y-4" }, ko = {
|
|
527
|
+
key: 3,
|
|
528
528
|
class: "flex flex-col gap-12"
|
|
529
|
-
},
|
|
529
|
+
}, wo = { class: "flex flex-col" }, To = { class: "flex items-center justify-between" }, Vo = { class: "flex items-center gap-8" }, Io = { class: "fm-typo-en-title-sm-600" }, So = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Co = {
|
|
530
530
|
key: 0,
|
|
531
531
|
class: "flex flex-col gap-8"
|
|
532
|
-
},
|
|
533
|
-
key:
|
|
532
|
+
}, Fo = { class: "flex flex-wrap gap-8" }, Ao = {
|
|
533
|
+
key: 4,
|
|
534
534
|
class: "flex flex-col gap-12"
|
|
535
|
-
},
|
|
535
|
+
}, Eo = { class: "flex flex-col" }, $o = { class: "flex items-center justify-between" }, Mo = { class: "flex items-center gap-8" }, Uo = { class: "fm-typo-en-title-sm-600" }, Po = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ro = {
|
|
536
536
|
key: 0,
|
|
537
537
|
class: "flex flex-col gap-8"
|
|
538
|
-
},
|
|
539
|
-
key:
|
|
538
|
+
}, Oo = { class: "flex flex-wrap gap-8" }, Bo = {
|
|
539
|
+
key: 5,
|
|
540
540
|
class: "flex flex-col gap-12"
|
|
541
|
-
},
|
|
541
|
+
}, Do = { class: "flex flex-col" }, No = { class: "flex items-center justify-between" }, zo = { class: "flex items-center gap-8" }, Lo = { class: "fm-typo-en-title-sm-600" }, jo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Wo = {
|
|
542
542
|
key: 0,
|
|
543
543
|
class: "flex flex-col gap-8"
|
|
544
|
-
},
|
|
544
|
+
}, qo = { class: "flex flex-wrap gap-8" }, Ho = /* @__PURE__ */ xe({
|
|
545
545
|
__name: "IngredientForm",
|
|
546
546
|
props: /* @__PURE__ */ st({
|
|
547
547
|
mode: {},
|
|
@@ -555,23 +555,23 @@ const zn = /* @__PURE__ */ ke({
|
|
|
555
555
|
searchModifiers: {}
|
|
556
556
|
}),
|
|
557
557
|
emits: /* @__PURE__ */ st(["update:modelValue", "click:submit", "update:purchaseOrderTemplateIds", "update:wastageTemplateIds", "update:closingTemplateIds"], ["update:search"]),
|
|
558
|
-
setup(
|
|
558
|
+
setup(W, { expose: h, emit: k }) {
|
|
559
559
|
var Xe;
|
|
560
|
-
const { t:
|
|
560
|
+
const { t: d } = pe(), _ = Ke();
|
|
561
561
|
Ae();
|
|
562
|
-
const C = Vt(), A = It(), U = St(), l =
|
|
562
|
+
const C = Vt(), A = It(), U = St(), l = W, i = k, u = Fe(), a = Ge(), c = Tt(), r = Ee(), f = g(() => r.isEnabled);
|
|
563
563
|
P(void 0);
|
|
564
|
-
const w = P([]), F = P([]),
|
|
564
|
+
const w = P([]), F = P([]), m = P([]), B = P(!1);
|
|
565
565
|
function R(e) {
|
|
566
566
|
if (e.length === 0) return;
|
|
567
567
|
const t = e[0], b = l.modelValue ?? {
|
|
568
|
-
unit:
|
|
568
|
+
unit: u.units.find((I) => I)
|
|
569
569
|
};
|
|
570
570
|
b.unit || (b.unit = t, i("update:modelValue", b));
|
|
571
571
|
}
|
|
572
572
|
Ot(() => {
|
|
573
|
-
R(
|
|
574
|
-
}), _t([() =>
|
|
573
|
+
R(u.units), l.mode === j.CREATE && (c.mustUsePoTemplate && ne(), c.enableWastageTemplate && ue(), c.enableClosingTemplate && oe());
|
|
574
|
+
}), _t([() => u.units], ([e]) => {
|
|
575
575
|
R(e);
|
|
576
576
|
});
|
|
577
577
|
function ve() {
|
|
@@ -602,12 +602,12 @@ const zn = /* @__PURE__ */ ke({
|
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
604
|
async function oe() {
|
|
605
|
-
|
|
605
|
+
m.value = [], B.value = !0;
|
|
606
606
|
try {
|
|
607
607
|
const [e] = await Promise.all([U.listTemplates()]).delayed(
|
|
608
608
|
1e3
|
|
609
609
|
);
|
|
610
|
-
|
|
610
|
+
m.value = e;
|
|
611
611
|
} catch (e) {
|
|
612
612
|
console.log("Something went wrong when fetching closing templates:", e);
|
|
613
613
|
} finally {
|
|
@@ -651,10 +651,10 @@ const zn = /* @__PURE__ */ ke({
|
|
|
651
651
|
get() {
|
|
652
652
|
var t, b;
|
|
653
653
|
const e = (b = (t = l.modelValue) == null ? void 0 : t.defaultCost) == null ? void 0 : b.costPerUnit;
|
|
654
|
-
return e ? +
|
|
654
|
+
return e ? +cn(e) : 0;
|
|
655
655
|
},
|
|
656
656
|
set(e) {
|
|
657
|
-
var b, I,
|
|
657
|
+
var b, I, H, D;
|
|
658
658
|
const t = l.modelValue ? {
|
|
659
659
|
...l.modelValue
|
|
660
660
|
} : {};
|
|
@@ -664,7 +664,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
664
664
|
precision: 2,
|
|
665
665
|
currency: ((b = dt(a.currentCountry.value)) == null ? void 0 : b.currency) ?? "MYR"
|
|
666
666
|
},
|
|
667
|
-
measurement: (D = (
|
|
667
|
+
measurement: (D = (H = (I = l.modelValue) == null ? void 0 : I.unit) == null ? void 0 : H.measurements) == null ? void 0 : D.find(
|
|
668
668
|
(se) => {
|
|
669
669
|
var re;
|
|
670
670
|
return se.id === ((re = l.modelValue) == null ? void 0 : re.trackingMeasurement);
|
|
@@ -677,17 +677,17 @@ const zn = /* @__PURE__ */ ke({
|
|
|
677
677
|
}
|
|
678
678
|
}), ye = g(() => {
|
|
679
679
|
var t, b, I;
|
|
680
|
-
const e = ((t = l.modelValue) == null ? void 0 : t.unit) ??
|
|
680
|
+
const e = ((t = l.modelValue) == null ? void 0 : t.unit) ?? u.units.find((H) => H);
|
|
681
681
|
return e ? {
|
|
682
682
|
_id: e._id,
|
|
683
683
|
measurement: (b = l.modelValue) == null ? void 0 : b.trackingMeasurement,
|
|
684
|
-
name: ((I = e.measurements.find((
|
|
684
|
+
name: ((I = e.measurements.find((H) => {
|
|
685
685
|
var D;
|
|
686
|
-
return
|
|
686
|
+
return H.id === ((D = l.modelValue) == null ? void 0 : D.trackingMeasurement);
|
|
687
687
|
})) == null ? void 0 : I.name) ?? e.name
|
|
688
688
|
} : null;
|
|
689
689
|
}), we = g(
|
|
690
|
-
() =>
|
|
690
|
+
() => u.units.flatMap(({ name: e, _id: t, abbrev: b, measurements: I }) => [
|
|
691
691
|
{
|
|
692
692
|
label: `${e}`,
|
|
693
693
|
value: null,
|
|
@@ -698,31 +698,31 @@ const zn = /* @__PURE__ */ ke({
|
|
|
698
698
|
value: { _id: t },
|
|
699
699
|
displayAsSection: !1
|
|
700
700
|
},
|
|
701
|
-
...I.map(({ id:
|
|
701
|
+
...I.map(({ id: H, name: D, abbrev: se }) => ({
|
|
702
702
|
label: `${D} (${se})`,
|
|
703
|
-
value: { _id: t, measurement:
|
|
703
|
+
value: { _id: t, measurement: H },
|
|
704
704
|
displayAsSection: !1
|
|
705
705
|
}))
|
|
706
706
|
])
|
|
707
|
-
), y = Bt(
|
|
707
|
+
), y = Bt(W, "search"), M = g(
|
|
708
708
|
() => new gn(we.value, ["label", "value"], {
|
|
709
709
|
caseSensitive: !1,
|
|
710
710
|
sort: !0
|
|
711
711
|
})
|
|
712
712
|
), G = g(() => M.value.search(y.value));
|
|
713
713
|
function E(e) {
|
|
714
|
-
var t, b, I,
|
|
715
|
-
return ((b = (t = l.modelValue) == null ? void 0 : t.unit) == null ? void 0 : b._id) === ((I = e.value) == null ? void 0 : I._id) && ((
|
|
714
|
+
var t, b, I, H, D;
|
|
715
|
+
return ((b = (t = l.modelValue) == null ? void 0 : t.unit) == null ? void 0 : b._id) === ((I = e.value) == null ? void 0 : I._id) && ((H = l.modelValue) == null ? void 0 : H.trackingMeasurement) === ((D = e.value) == null ? void 0 : D.measurement);
|
|
716
716
|
}
|
|
717
717
|
function v(e) {
|
|
718
718
|
var se, re;
|
|
719
719
|
if (!e) return;
|
|
720
|
-
const { _id: t, measurement: b } = e, I = b || void 0,
|
|
721
|
-
if (!
|
|
720
|
+
const { _id: t, measurement: b } = e, I = b || void 0, H = u.units.find((Se) => Se._id === t);
|
|
721
|
+
if (!H)
|
|
722
722
|
return;
|
|
723
723
|
const D = l.modelValue ?? {};
|
|
724
|
-
D.unit =
|
|
725
|
-
measurement:
|
|
724
|
+
D.unit = H, D.trackingMeasurement = I, D.convert && (D.convert.measurement = I || null), D.defaultCost = {
|
|
725
|
+
measurement: H.measurements.find((Se) => Se.id === I),
|
|
726
726
|
costPerUnit: {
|
|
727
727
|
...((se = D.defaultCost) == null ? void 0 : se.costPerUnit) ?? {
|
|
728
728
|
amount: 0,
|
|
@@ -730,9 +730,9 @@ const zn = /* @__PURE__ */ ke({
|
|
|
730
730
|
currency: ((re = dt(a.currentCountry.value)) == null ? void 0 : re.currency) ?? "MYR"
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
|
-
}
|
|
733
|
+
}, i("update:modelValue", D);
|
|
734
734
|
}
|
|
735
|
-
const
|
|
735
|
+
const N = g({
|
|
736
736
|
get() {
|
|
737
737
|
var e;
|
|
738
738
|
return ((e = l.modelValue) == null ? void 0 : e.convert) ?? null;
|
|
@@ -749,9 +749,9 @@ const zn = /* @__PURE__ */ ke({
|
|
|
749
749
|
e === ut.enum.WAVG
|
|
750
750
|
)
|
|
751
751
|
).map((e) => ({
|
|
752
|
-
label:
|
|
752
|
+
label: d(`inventory.ingredient.valuationMethod.${e}`),
|
|
753
753
|
value: e
|
|
754
|
-
}))),
|
|
754
|
+
}))), ce = g({
|
|
755
755
|
get() {
|
|
756
756
|
var e;
|
|
757
757
|
return ((e = l.modelValue) == null ? void 0 : e.valuation) ?? "WAVG";
|
|
@@ -773,42 +773,42 @@ const zn = /* @__PURE__ */ ke({
|
|
|
773
773
|
} : {};
|
|
774
774
|
t.customAttributes = e, i("update:modelValue", t);
|
|
775
775
|
}
|
|
776
|
-
}),
|
|
776
|
+
}), q = P();
|
|
777
777
|
h({
|
|
778
778
|
validateInputs: () => {
|
|
779
779
|
var e, t;
|
|
780
|
-
(t = (e =
|
|
780
|
+
(t = (e = q.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
|
|
781
781
|
},
|
|
782
782
|
resetInputsValidation: () => {
|
|
783
783
|
var e, t;
|
|
784
|
-
(t = (e =
|
|
784
|
+
(t = (e = q.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
|
|
785
785
|
},
|
|
786
786
|
resetInputs: () => {
|
|
787
787
|
var e, t;
|
|
788
|
-
(t = (e =
|
|
788
|
+
(t = (e = q.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
|
|
789
789
|
}
|
|
790
790
|
});
|
|
791
791
|
const O = P(!1), K = g(
|
|
792
792
|
() => {
|
|
793
793
|
var e, t, b;
|
|
794
|
-
return (e = l.modelValue) != null && e._id ? ((b =
|
|
794
|
+
return (e = l.modelValue) != null && e._id ? ((b = u.menu.bindedBySkuId[(t = l.modelValue) == null ? void 0 : t._id]) == null ? void 0 : b.filter(
|
|
795
795
|
(I) => I.from === "INGREDIENT"
|
|
796
796
|
)) ?? [] : [];
|
|
797
797
|
}
|
|
798
|
-
),
|
|
798
|
+
), z = g(
|
|
799
799
|
() => {
|
|
800
800
|
var e, t, b;
|
|
801
|
-
return (e = l.modelValue) != null && e._id ? ((b =
|
|
801
|
+
return (e = l.modelValue) != null && e._id ? ((b = u.menu.bindedBySkuId[(t = l.modelValue) == null ? void 0 : t._id]) == null ? void 0 : b.filter(
|
|
802
802
|
(I) => I.from === "RECIPE"
|
|
803
803
|
)) ?? [] : [];
|
|
804
804
|
}
|
|
805
805
|
), ge = g(
|
|
806
806
|
() => {
|
|
807
807
|
var e, t, b;
|
|
808
|
-
return (e = l.modelValue) != null && e._id ? ((b =
|
|
808
|
+
return (e = l.modelValue) != null && e._id ? ((b = u.menu.bindedBySkuId[(t = l.modelValue) == null ? void 0 : t._id]) == null ? void 0 : b.filter((I) => I.from === "MENU")) ?? [] : [];
|
|
809
809
|
}
|
|
810
810
|
), $e = g(
|
|
811
|
-
() =>
|
|
811
|
+
() => u.skus.map((e) => ({ label: e.name, value: e.code }))
|
|
812
812
|
), Me = P((Xe = l.modelValue) == null ? void 0 : Xe.code);
|
|
813
813
|
function Ue(e) {
|
|
814
814
|
var b;
|
|
@@ -817,13 +817,13 @@ const zn = /* @__PURE__ */ ke({
|
|
|
817
817
|
}
|
|
818
818
|
const be = g(
|
|
819
819
|
() => {
|
|
820
|
-
var e, t, b, I,
|
|
820
|
+
var e, t, b, I, H, D;
|
|
821
821
|
return ((I = (b = (t = (e = l.modelValue) == null ? void 0 : e.unit) == null ? void 0 : t.measurements) == null ? void 0 : b.find(
|
|
822
822
|
(se) => {
|
|
823
823
|
var re;
|
|
824
824
|
return se.id === ((re = l.modelValue) == null ? void 0 : re.trackingMeasurement);
|
|
825
825
|
}
|
|
826
|
-
)) == null ? void 0 : I.abbrev) ?? ((D = (
|
|
826
|
+
)) == null ? void 0 : I.abbrev) ?? ((D = (H = l.modelValue) == null ? void 0 : H.unit) == null ? void 0 : D.abbrev);
|
|
827
827
|
}
|
|
828
828
|
), he = g({
|
|
829
829
|
get() {
|
|
@@ -839,7 +839,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
839
839
|
} : {};
|
|
840
840
|
b.thresholds = t, i("update:modelValue", b);
|
|
841
841
|
}
|
|
842
|
-
}),
|
|
842
|
+
}), me = g({
|
|
843
843
|
get() {
|
|
844
844
|
var e, t;
|
|
845
845
|
return ((t = (e = l.modelValue) == null ? void 0 : e.thresholds) == null ? void 0 : t.mid) ?? Re().mid;
|
|
@@ -853,17 +853,17 @@ const zn = /* @__PURE__ */ ke({
|
|
|
853
853
|
} : {};
|
|
854
854
|
b.thresholds = t, i("update:modelValue", b);
|
|
855
855
|
}
|
|
856
|
-
}), Te = g(() =>
|
|
856
|
+
}), Te = g(() => c.mustUsePoTemplate && l.mode === j.CREATE && w.value.length > 0 ? w.value.map((e) => ({
|
|
857
857
|
label: e.name || "Template",
|
|
858
858
|
value: e._id || "template_" + e.name
|
|
859
859
|
})) : []), Ve = g(() => Te.value.filter(
|
|
860
860
|
(e) => (l.purchaseOrderTemplateIds ?? []).includes(e.value)
|
|
861
|
-
)), _e = g(() =>
|
|
861
|
+
)), _e = g(() => c.enableWastageTemplate && l.mode === j.CREATE && F.value.length > 0 ? F.value.map((e) => ({
|
|
862
862
|
label: e.name || "Template",
|
|
863
863
|
value: e._id || "template_" + e.name
|
|
864
864
|
})) : []), Ie = g(() => _e.value.filter(
|
|
865
865
|
(e) => (l.wastageTemplateIds ?? []).includes(e.value)
|
|
866
|
-
)), Je = g(() =>
|
|
866
|
+
)), Je = g(() => c.enableClosingTemplate && l.mode === j.CREATE && m.value.length > 0 ? m.value.map((e) => ({
|
|
867
867
|
label: e.name || "Template",
|
|
868
868
|
value: e._id || "template_" + e.name
|
|
869
869
|
})) : []), Qe = g(() => Je.value.filter(
|
|
@@ -871,7 +871,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
871
871
|
));
|
|
872
872
|
function Ct() {
|
|
873
873
|
_.open({
|
|
874
|
-
title:
|
|
874
|
+
title: d("inventory.ingredient.purchaseOrderTemplates.selectTitle"),
|
|
875
875
|
closeButton: !0,
|
|
876
876
|
contentComponent: He,
|
|
877
877
|
contentComponentProps: {
|
|
@@ -879,11 +879,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
879
879
|
items: Te.value
|
|
880
880
|
},
|
|
881
881
|
primaryActions: {
|
|
882
|
-
text:
|
|
882
|
+
text: d("common.confirm"),
|
|
883
883
|
close: !0
|
|
884
884
|
},
|
|
885
885
|
secondaryActions: {
|
|
886
|
-
text:
|
|
886
|
+
text: d("common.cancel"),
|
|
887
887
|
close: !0,
|
|
888
888
|
variant: "tertiary"
|
|
889
889
|
}
|
|
@@ -893,7 +893,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
893
893
|
}
|
|
894
894
|
function Ft() {
|
|
895
895
|
_.open({
|
|
896
|
-
title:
|
|
896
|
+
title: d("inventory.ingredient.wastageTemplates.selectTitle"),
|
|
897
897
|
closeButton: !0,
|
|
898
898
|
contentComponent: He,
|
|
899
899
|
contentComponentProps: {
|
|
@@ -901,11 +901,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
901
901
|
items: _e.value
|
|
902
902
|
},
|
|
903
903
|
primaryActions: {
|
|
904
|
-
text:
|
|
904
|
+
text: d("common.confirm"),
|
|
905
905
|
close: !0
|
|
906
906
|
},
|
|
907
907
|
secondaryActions: {
|
|
908
|
-
text:
|
|
908
|
+
text: d("common.cancel"),
|
|
909
909
|
close: !0,
|
|
910
910
|
variant: "tertiary"
|
|
911
911
|
}
|
|
@@ -915,7 +915,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
915
915
|
}
|
|
916
916
|
function At() {
|
|
917
917
|
_.open({
|
|
918
|
-
title:
|
|
918
|
+
title: d("inventory.ingredient.closingTemplates.selectTitle"),
|
|
919
919
|
closeButton: !0,
|
|
920
920
|
contentComponent: He,
|
|
921
921
|
contentComponentProps: {
|
|
@@ -923,11 +923,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
923
923
|
items: Je.value
|
|
924
924
|
},
|
|
925
925
|
primaryActions: {
|
|
926
|
-
text:
|
|
926
|
+
text: d("common.confirm"),
|
|
927
927
|
close: !0
|
|
928
928
|
},
|
|
929
929
|
secondaryActions: {
|
|
930
|
-
text:
|
|
930
|
+
text: d("common.cancel"),
|
|
931
931
|
close: !0,
|
|
932
932
|
variant: "tertiary"
|
|
933
933
|
}
|
|
@@ -941,11 +941,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
941
941
|
};
|
|
942
942
|
}
|
|
943
943
|
return (e, t) => {
|
|
944
|
-
const b = S("FmTextField"), I = S("FmLabel"),
|
|
945
|
-
return
|
|
944
|
+
const b = S("FmTextField"), I = S("FmLabel"), H = S("FmField"), D = S("FmIcon"), se = S("FmMenuHeader"), re = S("FmMenuDivider"), Se = S("FmMenuItem"), $t = S("FmMenu"), Ze = S("FmFormGroup"), Mt = S("FmSelect"), et = S("FmSwitch"), tt = S("FmStepperField"), De = S("FmButton"), Ne = S("FmChip"), Ut = S("FmForm");
|
|
945
|
+
return p(), Y(Ut, {
|
|
946
946
|
disabled: e.disabled,
|
|
947
947
|
ref_key: "formRef",
|
|
948
|
-
ref:
|
|
948
|
+
ref: q,
|
|
949
949
|
class: "flex flex-col gap-32",
|
|
950
950
|
onValidationSuccess: ve
|
|
951
951
|
}, {
|
|
@@ -957,7 +957,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
957
957
|
s(Ce, {
|
|
958
958
|
"tooltip-message": "This field is managed by NetSuite",
|
|
959
959
|
"tooltip-z-index": 50,
|
|
960
|
-
label: o(
|
|
960
|
+
label: o(d)("inventory.ingredient.code"),
|
|
961
961
|
"model-value": le.value,
|
|
962
962
|
"onUpdate:modelValue": t[1] || (t[1] = (T) => le.value = T),
|
|
963
963
|
locked: f.value,
|
|
@@ -965,7 +965,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
965
965
|
}, {
|
|
966
966
|
default: x(() => [
|
|
967
967
|
s(b, {
|
|
968
|
-
label: o(
|
|
968
|
+
label: o(d)("inventory.ingredient.code"),
|
|
969
969
|
"model-value": le.value,
|
|
970
970
|
"onUpdate:modelValue": t[0] || (t[0] = (T) => le.value = T),
|
|
971
971
|
rules: [o(Le)(), o(on)($e.value, Me.value)],
|
|
@@ -979,7 +979,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
979
979
|
s(Ce, {
|
|
980
980
|
"tooltip-message": "This field is managed by NetSuite",
|
|
981
981
|
"tooltip-z-index": 50,
|
|
982
|
-
label: o(
|
|
982
|
+
label: o(d)("inventory.ingredient.name"),
|
|
983
983
|
"model-value": ae.value,
|
|
984
984
|
"onUpdate:modelValue": t[3] || (t[3] = (T) => ae.value = T),
|
|
985
985
|
locked: f.value,
|
|
@@ -987,7 +987,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
987
987
|
}, {
|
|
988
988
|
default: x(() => [
|
|
989
989
|
s(b, {
|
|
990
|
-
label: o(
|
|
990
|
+
label: o(d)("inventory.ingredient.name"),
|
|
991
991
|
"model-value": ae.value,
|
|
992
992
|
"onUpdate:modelValue": t[2] || (t[2] = (T) => ae.value = T),
|
|
993
993
|
rules: [o(Le)()],
|
|
@@ -1001,7 +1001,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1001
1001
|
s(Ce, {
|
|
1002
1002
|
"tooltip-message": "This field is managed by NetSuite",
|
|
1003
1003
|
"tooltip-z-index": 50,
|
|
1004
|
-
label: o(
|
|
1004
|
+
label: o(d)("inventory.ingredient.unit"),
|
|
1005
1005
|
"helper-text": (nt = e.modelValue) != null && nt.trackingMeasurement ? `Base unit: ${(lt = (ot = e.modelValue) == null ? void 0 : ot.unit) == null ? void 0 : lt.name}` : void 0,
|
|
1006
1006
|
"model-value": (at = ye.value) == null ? void 0 : at.name,
|
|
1007
1007
|
locked: f.value,
|
|
@@ -1015,13 +1015,13 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1015
1015
|
}, {
|
|
1016
1016
|
label: x(() => [
|
|
1017
1017
|
s(I, {
|
|
1018
|
-
label: o(
|
|
1018
|
+
label: o(d)("inventory.ingredient.unit")
|
|
1019
1019
|
}, null, 8, ["label"])
|
|
1020
1020
|
]),
|
|
1021
1021
|
default: x(({ invalid: T }) => [
|
|
1022
1022
|
s($t, null, {
|
|
1023
1023
|
"menu-button": x(() => [
|
|
1024
|
-
s(
|
|
1024
|
+
s(H, {
|
|
1025
1025
|
class: ie([
|
|
1026
1026
|
"fm-typo-en-body-lg-400",
|
|
1027
1027
|
{
|
|
@@ -1057,17 +1057,17 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1057
1057
|
class: "overflow-x-hidden overflow-y-auto max-h-[300px]",
|
|
1058
1058
|
onVnodeMounted: Ue
|
|
1059
1059
|
}, [
|
|
1060
|
-
(
|
|
1061
|
-
X.displayAsSection ? (
|
|
1060
|
+
(p(!0), V(ee, null, de(G.value, (X, Pt) => (p(), V(ee, { key: Pt }, [
|
|
1061
|
+
X.displayAsSection ? (p(), V(ee, { key: 0 }, [
|
|
1062
1062
|
s(se, {
|
|
1063
1063
|
label: X.label
|
|
1064
1064
|
}, null, 8, ["label"]),
|
|
1065
1065
|
s(re)
|
|
1066
|
-
], 64)) : (
|
|
1066
|
+
], 64)) : (p(), Y(Se, {
|
|
1067
1067
|
key: 1,
|
|
1068
1068
|
label: X.label,
|
|
1069
1069
|
"model-value": E(X),
|
|
1070
|
-
onClick: (
|
|
1070
|
+
onClick: (gl) => v(X.value),
|
|
1071
1071
|
"x-should-scroll-into": `${E(X)}`
|
|
1072
1072
|
}, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
|
|
1073
1073
|
], 64))), 128))
|
|
@@ -1082,161 +1082,156 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1082
1082
|
]),
|
|
1083
1083
|
_: 1
|
|
1084
1084
|
}, 8, ["label", "helper-text", "model-value", "locked", "disabled"]),
|
|
1085
|
-
|
|
1085
|
+
n("div", Hn, [
|
|
1086
|
+
s(Ce, {
|
|
1087
|
+
"tooltip-message": "This field is managed by NetSuite",
|
|
1088
|
+
"tooltip-z-index": 50,
|
|
1089
|
+
label: o(d)("inventory.ingredient.valuationMethod.title"),
|
|
1090
|
+
"model-value": o(d)("inventory.ingredient.valuationMethod." + ce.value),
|
|
1091
|
+
locked: f.value,
|
|
1092
|
+
disabled: e.disabled
|
|
1093
|
+
}, {
|
|
1094
|
+
label: x(() => [
|
|
1095
|
+
n("div", Yn, [
|
|
1096
|
+
s(I, {
|
|
1097
|
+
label: o(d)("inventory.ingredient.valuationMethod.title")
|
|
1098
|
+
}, null, 8, ["label"]),
|
|
1099
|
+
s(ke, {
|
|
1100
|
+
tier: "premium",
|
|
1101
|
+
category: "premium",
|
|
1102
|
+
"feature-key": "total-cost"
|
|
1103
|
+
})
|
|
1104
|
+
])
|
|
1105
|
+
]),
|
|
1106
|
+
default: x(() => [
|
|
1107
|
+
s(Mt, {
|
|
1108
|
+
class: "col-span-2",
|
|
1109
|
+
label: o(d)("inventory.ingredient.valuationMethod.title"),
|
|
1110
|
+
"model-value": ce.value,
|
|
1111
|
+
"onUpdate:modelValue": t[5] || (t[5] = (T) => ce.value = T),
|
|
1112
|
+
items: J.value
|
|
1113
|
+
}, null, 8, ["label", "model-value", "items"])
|
|
1114
|
+
]),
|
|
1115
|
+
_: 1
|
|
1116
|
+
}, 8, ["label", "model-value", "locked", "disabled"]),
|
|
1117
|
+
s(Ce, {
|
|
1118
|
+
"tooltip-message": "This field is managed by NetSuite",
|
|
1119
|
+
"tooltip-z-index": 50,
|
|
1120
|
+
"model-value": `${o(jt)()} ${fe.value}`,
|
|
1121
|
+
locked: f.value,
|
|
1122
|
+
"append-text": `/ ${be.value}`,
|
|
1123
|
+
disabled: e.disabled
|
|
1124
|
+
}, {
|
|
1125
|
+
label: x(() => [
|
|
1126
|
+
n("div", Kn, [
|
|
1127
|
+
s(I, {
|
|
1128
|
+
label: o(d)("inventory.ingredient.pricePerUnit")
|
|
1129
|
+
}, null, 8, ["label"]),
|
|
1130
|
+
s(ke, {
|
|
1131
|
+
tier: "premium",
|
|
1132
|
+
category: "premium",
|
|
1133
|
+
"feature-key": "total-cost"
|
|
1134
|
+
})
|
|
1135
|
+
])
|
|
1136
|
+
]),
|
|
1137
|
+
default: x(() => [
|
|
1138
|
+
s(b, {
|
|
1139
|
+
"model-value": fe.value,
|
|
1140
|
+
"onUpdate:modelValue": t[6] || (t[6] = (T) => fe.value = T),
|
|
1141
|
+
rules: [o(Oe)(0), o(ln)(4)]
|
|
1142
|
+
}, {
|
|
1143
|
+
label: x(() => [
|
|
1144
|
+
n("div", Gn, [
|
|
1145
|
+
s(I, {
|
|
1146
|
+
label: o(d)("inventory.ingredient.pricePerUnit")
|
|
1147
|
+
}, null, 8, ["label"])
|
|
1148
|
+
])
|
|
1149
|
+
]),
|
|
1150
|
+
prepend: x(() => {
|
|
1151
|
+
var T, X;
|
|
1152
|
+
return [
|
|
1153
|
+
n("div", Jn, $(o(ct)(((T = o(a).currentCountry) == null ? void 0 : T.value) ?? o(mt)) === "MYR" ? "RM" : o(ct)(((X = o(a).currentCountry) == null ? void 0 : X.value) ?? o(mt))), 1)
|
|
1154
|
+
];
|
|
1155
|
+
}),
|
|
1156
|
+
append: x(() => [
|
|
1157
|
+
n("div", Qn, " / " + $(be.value), 1)
|
|
1158
|
+
]),
|
|
1159
|
+
_: 1
|
|
1160
|
+
}, 8, ["model-value", "rules"])
|
|
1161
|
+
]),
|
|
1162
|
+
_: 1
|
|
1163
|
+
}, 8, ["model-value", "locked", "append-text", "disabled"])
|
|
1164
|
+
]),
|
|
1165
|
+
!f.value || N.value ? (p(), Y(zn, {
|
|
1086
1166
|
key: 0,
|
|
1087
|
-
"
|
|
1088
|
-
"
|
|
1089
|
-
label: o(u)("inventory.ingredient.valuationMethod.title"),
|
|
1090
|
-
"model-value": o(u)("inventory.ingredient.valuationMethod." + me.value),
|
|
1091
|
-
locked: f.value,
|
|
1092
|
-
disabled: e.disabled
|
|
1093
|
-
}, {
|
|
1094
|
-
label: x(() => [
|
|
1095
|
-
n("div", Hn, [
|
|
1096
|
-
s(I, {
|
|
1097
|
-
label: o(u)("inventory.ingredient.valuationMethod.title")
|
|
1098
|
-
}, null, 8, ["label"]),
|
|
1099
|
-
s(xe, {
|
|
1100
|
-
tier: "premium",
|
|
1101
|
-
category: "premium",
|
|
1102
|
-
"feature-key": "total-cost"
|
|
1103
|
-
})
|
|
1104
|
-
])
|
|
1105
|
-
]),
|
|
1106
|
-
default: x(() => [
|
|
1107
|
-
s(Mt, {
|
|
1108
|
-
class: "col-span-2",
|
|
1109
|
-
label: o(u)("inventory.ingredient.valuationMethod.title"),
|
|
1110
|
-
"model-value": me.value,
|
|
1111
|
-
"onUpdate:modelValue": t[5] || (t[5] = (T) => me.value = T),
|
|
1112
|
-
items: J.value
|
|
1113
|
-
}, null, 8, ["label", "model-value", "items"])
|
|
1114
|
-
]),
|
|
1115
|
-
_: 1
|
|
1116
|
-
}, 8, ["label", "model-value", "locked", "disabled"])) : N("", !0),
|
|
1117
|
-
o(d).enableTotalCost ? (c(), j(Ce, {
|
|
1118
|
-
key: 1,
|
|
1119
|
-
"tooltip-message": "This field is managed by NetSuite",
|
|
1120
|
-
"tooltip-z-index": 50,
|
|
1121
|
-
"model-value": `${o(jt)()} ${fe.value}`,
|
|
1122
|
-
locked: f.value,
|
|
1123
|
-
"append-text": `/ ${be.value}`,
|
|
1124
|
-
disabled: e.disabled
|
|
1125
|
-
}, {
|
|
1126
|
-
label: x(() => [
|
|
1127
|
-
n("div", Yn, [
|
|
1128
|
-
s(I, {
|
|
1129
|
-
label: o(u)("inventory.ingredient.pricePerUnit")
|
|
1130
|
-
}, null, 8, ["label"]),
|
|
1131
|
-
s(xe, {
|
|
1132
|
-
tier: "premium",
|
|
1133
|
-
category: "premium",
|
|
1134
|
-
"feature-key": "total-cost"
|
|
1135
|
-
})
|
|
1136
|
-
])
|
|
1137
|
-
]),
|
|
1138
|
-
default: x(() => [
|
|
1139
|
-
s(b, {
|
|
1140
|
-
"model-value": fe.value,
|
|
1141
|
-
"onUpdate:modelValue": t[6] || (t[6] = (T) => fe.value = T),
|
|
1142
|
-
rules: [o(Oe)(0), o(ln)(4)]
|
|
1143
|
-
}, {
|
|
1144
|
-
label: x(() => [
|
|
1145
|
-
n("div", Kn, [
|
|
1146
|
-
s(I, {
|
|
1147
|
-
label: o(u)("inventory.ingredient.pricePerUnit")
|
|
1148
|
-
}, null, 8, ["label"]),
|
|
1149
|
-
s(xe, {
|
|
1150
|
-
tier: "premium",
|
|
1151
|
-
category: "premium",
|
|
1152
|
-
"feature-key": "total-cost"
|
|
1153
|
-
})
|
|
1154
|
-
])
|
|
1155
|
-
]),
|
|
1156
|
-
prepend: x(() => {
|
|
1157
|
-
var T, X;
|
|
1158
|
-
return [
|
|
1159
|
-
n("div", Gn, $(o(mt)(((T = o(a).currentCountry) == null ? void 0 : T.value) ?? o(ct)) === "MYR" ? "RM" : o(mt)(((X = o(a).currentCountry) == null ? void 0 : X.value) ?? o(ct))), 1)
|
|
1160
|
-
];
|
|
1161
|
-
}),
|
|
1162
|
-
append: x(() => [
|
|
1163
|
-
n("div", Jn, " / " + $(be.value), 1)
|
|
1164
|
-
]),
|
|
1165
|
-
_: 1
|
|
1166
|
-
}, 8, ["model-value", "rules"])
|
|
1167
|
-
]),
|
|
1168
|
-
_: 1
|
|
1169
|
-
}, 8, ["model-value", "locked", "append-text", "disabled"])) : N("", !0),
|
|
1170
|
-
!f.value || z.value ? (c(), j(zn, {
|
|
1171
|
-
key: 2,
|
|
1172
|
-
"model-value": z.value,
|
|
1173
|
-
"onUpdate:modelValue": t[7] || (t[7] = (T) => z.value = T),
|
|
1167
|
+
"model-value": N.value,
|
|
1168
|
+
"onUpdate:modelValue": t[7] || (t[7] = (T) => N.value = T),
|
|
1174
1169
|
"root-value": e.modelValue,
|
|
1175
1170
|
readonly: f.value
|
|
1176
|
-
}, null, 8, ["model-value", "root-value", "readonly"])) :
|
|
1177
|
-
e.mode !== o(
|
|
1171
|
+
}, null, 8, ["model-value", "root-value", "readonly"])) : L("", !0),
|
|
1172
|
+
e.mode !== o(j).CREATE ? (p(), V("div", Xn, [
|
|
1178
1173
|
s(et, {
|
|
1179
|
-
label: o(
|
|
1174
|
+
label: o(d)("inventory.ingredient.status.inactive"),
|
|
1180
1175
|
"model-value": te.value,
|
|
1181
1176
|
"onUpdate:modelValue": t[8] || (t[8] = (T) => te.value = T),
|
|
1182
1177
|
"label-placement": "right",
|
|
1183
1178
|
disabled: f.value
|
|
1184
1179
|
}, null, 8, ["label", "model-value", "disabled"]),
|
|
1185
|
-
n("div",
|
|
1186
|
-
n("div",
|
|
1180
|
+
n("div", Zn, [
|
|
1181
|
+
n("div", eo, $(o(d)("inventory.ingredient.status.preventFromOrder")), 1)
|
|
1187
1182
|
])
|
|
1188
|
-
])) :
|
|
1189
|
-
e.mode !== o(
|
|
1183
|
+
])) : L("", !0),
|
|
1184
|
+
e.mode !== o(j).CREATE ? (p(), V("div", to, [
|
|
1190
1185
|
n("div", null, [
|
|
1191
1186
|
s(et, {
|
|
1192
|
-
label: o(
|
|
1187
|
+
label: o(d)("inventory.ingredient.bindedItems.title"),
|
|
1193
1188
|
modelValue: O.value,
|
|
1194
1189
|
"onUpdate:modelValue": t[9] || (t[9] = (T) => O.value = T),
|
|
1195
1190
|
"label-placement": "right"
|
|
1196
1191
|
}, null, 8, ["label", "modelValue"])
|
|
1197
1192
|
]),
|
|
1198
|
-
O.value && K.value.length ? (
|
|
1193
|
+
O.value && K.value.length ? (p(), Y(qe, {
|
|
1199
1194
|
key: 0,
|
|
1200
|
-
name: o(
|
|
1195
|
+
name: o(d)("inventory.ingredient.bindedItems.ingredient"),
|
|
1201
1196
|
bindings: K.value
|
|
1202
|
-
}, null, 8, ["name", "bindings"])) :
|
|
1203
|
-
O.value &&
|
|
1197
|
+
}, null, 8, ["name", "bindings"])) : L("", !0),
|
|
1198
|
+
O.value && z.value.length ? (p(), Y(qe, {
|
|
1204
1199
|
key: 1,
|
|
1205
|
-
name: o(
|
|
1206
|
-
bindings:
|
|
1207
|
-
}, null, 8, ["name", "bindings"])) :
|
|
1208
|
-
O.value && ge.value.length ? (
|
|
1200
|
+
name: o(d)("inventory.ingredient.bindedItems.recipe"),
|
|
1201
|
+
bindings: z.value
|
|
1202
|
+
}, null, 8, ["name", "bindings"])) : L("", !0),
|
|
1203
|
+
O.value && ge.value.length ? (p(), Y(qe, {
|
|
1209
1204
|
key: 2,
|
|
1210
|
-
name: o(
|
|
1205
|
+
name: o(d)("inventory.ingredient.bindedItems.menu"),
|
|
1211
1206
|
bindings: ge.value
|
|
1212
|
-
}, null, 8, ["name", "bindings"])) :
|
|
1213
|
-
])) :
|
|
1214
|
-
n("div",
|
|
1215
|
-
n("div",
|
|
1216
|
-
n("div",
|
|
1217
|
-
n("div",
|
|
1218
|
-
s(
|
|
1207
|
+
}, null, 8, ["name", "bindings"])) : L("", !0)
|
|
1208
|
+
])) : L("", !0),
|
|
1209
|
+
n("div", no, [
|
|
1210
|
+
n("div", oo, [
|
|
1211
|
+
n("div", lo, [
|
|
1212
|
+
n("div", ao, $(o(d)("inventory.ingredient.threshold.title")), 1),
|
|
1213
|
+
s(ke, {
|
|
1219
1214
|
tier: "standard",
|
|
1220
1215
|
category: "beta"
|
|
1221
1216
|
})
|
|
1222
1217
|
]),
|
|
1223
|
-
n("div",
|
|
1218
|
+
n("div", so, $(o(d)("inventory.ingredient.threshold.subtitle")), 1)
|
|
1224
1219
|
]),
|
|
1225
|
-
n("div",
|
|
1220
|
+
n("div", ro, [
|
|
1226
1221
|
s(Ze, {
|
|
1227
|
-
"model-value": { low: he.value, mid:
|
|
1222
|
+
"model-value": { low: he.value, mid: me.value },
|
|
1228
1223
|
rules: [Et()]
|
|
1229
1224
|
}, null, 8, ["model-value", "rules"]),
|
|
1230
|
-
n("div",
|
|
1231
|
-
n("div",
|
|
1232
|
-
n("div",
|
|
1225
|
+
n("div", io, [
|
|
1226
|
+
n("div", uo, [
|
|
1227
|
+
n("div", co, [
|
|
1233
1228
|
s(je, {
|
|
1234
1229
|
days: he.value,
|
|
1235
1230
|
level: o(We).low
|
|
1236
1231
|
}, null, 8, ["days", "level"])
|
|
1237
1232
|
]),
|
|
1238
1233
|
n("div", mo, [
|
|
1239
|
-
n("div",
|
|
1234
|
+
n("div", po, $(o(d)("inventory.ingredient.threshold.whenRemaining")), 1),
|
|
1240
1235
|
s(tt, {
|
|
1241
1236
|
modelValue: he.value,
|
|
1242
1237
|
"onUpdate:modelValue": t[10] || (t[10] = (T) => he.value = T),
|
|
@@ -1261,18 +1256,18 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1261
1256
|
style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
|
|
1262
1257
|
}, " < ")
|
|
1263
1258
|
], -1)),
|
|
1264
|
-
n("div",
|
|
1265
|
-
n("div",
|
|
1259
|
+
n("div", vo, [
|
|
1260
|
+
n("div", fo, [
|
|
1266
1261
|
s(je, {
|
|
1267
|
-
days:
|
|
1262
|
+
days: me.value,
|
|
1268
1263
|
level: o(We).mid
|
|
1269
1264
|
}, null, 8, ["days", "level"])
|
|
1270
1265
|
]),
|
|
1271
|
-
n("div",
|
|
1272
|
-
n("div",
|
|
1266
|
+
n("div", yo, [
|
|
1267
|
+
n("div", go, $(o(d)("inventory.ingredient.threshold.whenRemaining")), 1),
|
|
1273
1268
|
s(tt, {
|
|
1274
|
-
modelValue:
|
|
1275
|
-
"onUpdate:modelValue": t[11] || (t[11] = (T) =>
|
|
1269
|
+
modelValue: me.value,
|
|
1270
|
+
"onUpdate:modelValue": t[11] || (t[11] = (T) => me.value = T),
|
|
1276
1271
|
rules: [o(Oe)(0)]
|
|
1277
1272
|
}, {
|
|
1278
1273
|
append: x(() => t[14] || (t[14] = [
|
|
@@ -1294,26 +1289,26 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1294
1289
|
style: { transform: "translate(-50%, -50%)", left: "50%", top: "24px" }
|
|
1295
1290
|
}, " < ")
|
|
1296
1291
|
], -1)),
|
|
1297
|
-
n("div",
|
|
1298
|
-
n("div",
|
|
1292
|
+
n("div", bo, [
|
|
1293
|
+
n("div", ho, [
|
|
1299
1294
|
s(je, {
|
|
1300
|
-
days:
|
|
1295
|
+
days: me.value + 1,
|
|
1301
1296
|
level: o(We).high
|
|
1302
1297
|
}, null, 8, ["days", "level"])
|
|
1303
1298
|
]),
|
|
1304
|
-
n("div",
|
|
1305
|
-
n("div",
|
|
1299
|
+
n("div", _o, [
|
|
1300
|
+
n("div", xo, $(o(d)("inventory.ingredient.threshold.stockIsStaple")), 1)
|
|
1306
1301
|
])
|
|
1307
1302
|
])
|
|
1308
1303
|
])
|
|
1309
1304
|
])
|
|
1310
1305
|
]),
|
|
1311
|
-
o(
|
|
1312
|
-
n("div",
|
|
1313
|
-
n("div",
|
|
1314
|
-
n("div",
|
|
1315
|
-
n("div",
|
|
1316
|
-
s(
|
|
1306
|
+
o(c).mustUsePoTemplate && e.mode === o(j).CREATE ? (p(), V("div", ko, [
|
|
1307
|
+
n("div", wo, [
|
|
1308
|
+
n("div", To, [
|
|
1309
|
+
n("div", Vo, [
|
|
1310
|
+
n("div", Io, $(o(d)("inventory.ingredient.purchaseOrderTemplates.title")), 1),
|
|
1311
|
+
s(ke, {
|
|
1317
1312
|
tier: "premium",
|
|
1318
1313
|
category: "premium",
|
|
1319
1314
|
"feature-key": "purchase-order-template"
|
|
@@ -1327,25 +1322,25 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1327
1322
|
onClick: Ct
|
|
1328
1323
|
})
|
|
1329
1324
|
]),
|
|
1330
|
-
n("div",
|
|
1325
|
+
n("div", So, $(o(d)("inventory.ingredient.purchaseOrderTemplates.description")), 1)
|
|
1331
1326
|
]),
|
|
1332
|
-
Ve.value.length > 0 ? (
|
|
1333
|
-
n("div",
|
|
1334
|
-
(
|
|
1327
|
+
Ve.value.length > 0 ? (p(), V("div", Co, [
|
|
1328
|
+
n("div", Fo, [
|
|
1329
|
+
(p(!0), V(ee, null, de(Ve.value, (T) => (p(), Y(Ne, {
|
|
1335
1330
|
key: T.value,
|
|
1336
1331
|
label: T.label,
|
|
1337
1332
|
variant: "info",
|
|
1338
1333
|
compact: ""
|
|
1339
1334
|
}, null, 8, ["label"]))), 128))
|
|
1340
1335
|
])
|
|
1341
|
-
])) :
|
|
1342
|
-
])) :
|
|
1343
|
-
o(
|
|
1344
|
-
n("div",
|
|
1345
|
-
n("div",
|
|
1346
|
-
n("div",
|
|
1347
|
-
n("div",
|
|
1348
|
-
s(
|
|
1336
|
+
])) : L("", !0)
|
|
1337
|
+
])) : L("", !0),
|
|
1338
|
+
o(c).enableWastageTemplate && e.mode === o(j).CREATE ? (p(), V("div", Ao, [
|
|
1339
|
+
n("div", Eo, [
|
|
1340
|
+
n("div", $o, [
|
|
1341
|
+
n("div", Mo, [
|
|
1342
|
+
n("div", Uo, $(o(d)("inventory.ingredient.wastageTemplates.title")), 1),
|
|
1343
|
+
s(ke, {
|
|
1349
1344
|
tier: "premium",
|
|
1350
1345
|
category: "premium",
|
|
1351
1346
|
"feature-key": "wastage-template"
|
|
@@ -1359,25 +1354,25 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1359
1354
|
onClick: Ft
|
|
1360
1355
|
})
|
|
1361
1356
|
]),
|
|
1362
|
-
n("div",
|
|
1357
|
+
n("div", Po, $(o(d)("inventory.ingredient.wastageTemplates.description")), 1)
|
|
1363
1358
|
]),
|
|
1364
|
-
Ie.value.length > 0 ? (
|
|
1365
|
-
n("div",
|
|
1366
|
-
(
|
|
1359
|
+
Ie.value.length > 0 ? (p(), V("div", Ro, [
|
|
1360
|
+
n("div", Oo, [
|
|
1361
|
+
(p(!0), V(ee, null, de(Ie.value, (T) => (p(), Y(Ne, {
|
|
1367
1362
|
key: T.value,
|
|
1368
1363
|
label: T.label,
|
|
1369
1364
|
variant: "info",
|
|
1370
1365
|
compact: ""
|
|
1371
1366
|
}, null, 8, ["label"]))), 128))
|
|
1372
1367
|
])
|
|
1373
|
-
])) :
|
|
1374
|
-
])) :
|
|
1375
|
-
o(
|
|
1376
|
-
n("div",
|
|
1377
|
-
n("div",
|
|
1378
|
-
n("div",
|
|
1379
|
-
n("div",
|
|
1380
|
-
s(
|
|
1368
|
+
])) : L("", !0)
|
|
1369
|
+
])) : L("", !0),
|
|
1370
|
+
o(c).enableClosingTemplate && e.mode === o(j).CREATE ? (p(), V("div", Bo, [
|
|
1371
|
+
n("div", Do, [
|
|
1372
|
+
n("div", No, [
|
|
1373
|
+
n("div", zo, [
|
|
1374
|
+
n("div", Lo, $(o(d)("inventory.ingredient.closingTemplates.title")), 1),
|
|
1375
|
+
s(ke, {
|
|
1381
1376
|
tier: "premium",
|
|
1382
1377
|
category: "premium",
|
|
1383
1378
|
"feature-key": "closing-template"
|
|
@@ -1391,19 +1386,19 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1391
1386
|
onClick: At
|
|
1392
1387
|
})
|
|
1393
1388
|
]),
|
|
1394
|
-
n("div",
|
|
1389
|
+
n("div", jo, $(o(d)("inventory.ingredient.closingTemplates.description")), 1)
|
|
1395
1390
|
]),
|
|
1396
|
-
Qe.value.length > 0 ? (
|
|
1397
|
-
n("div",
|
|
1398
|
-
(
|
|
1391
|
+
Qe.value.length > 0 ? (p(), V("div", Wo, [
|
|
1392
|
+
n("div", qo, [
|
|
1393
|
+
(p(!0), V(ee, null, de(Qe.value, (T) => (p(), Y(Ne, {
|
|
1399
1394
|
key: T.value,
|
|
1400
1395
|
label: T.label,
|
|
1401
1396
|
variant: "info",
|
|
1402
1397
|
compact: ""
|
|
1403
1398
|
}, null, 8, ["label"]))), 128))
|
|
1404
1399
|
])
|
|
1405
|
-
])) :
|
|
1406
|
-
])) :
|
|
1400
|
+
])) : L("", !0)
|
|
1401
|
+
])) : L("", !0),
|
|
1407
1402
|
n("div", null, [
|
|
1408
1403
|
s(yn, {
|
|
1409
1404
|
entity: "inventorySku",
|
|
@@ -1417,40 +1412,40 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1417
1412
|
}, 8, ["disabled"]);
|
|
1418
1413
|
};
|
|
1419
1414
|
}
|
|
1420
|
-
}),
|
|
1415
|
+
}), Yo = { class: "flex flex-col gap-32" }, Ko = {
|
|
1421
1416
|
key: 0,
|
|
1422
1417
|
class: "flex justify-between items-center"
|
|
1423
|
-
},
|
|
1418
|
+
}, Go = { class: "flex gap-4" }, Jo = /* @__PURE__ */ xe({
|
|
1424
1419
|
__name: "IngredientDialog",
|
|
1425
1420
|
props: {
|
|
1426
1421
|
show: { type: Boolean },
|
|
1427
1422
|
sku: {},
|
|
1428
|
-
mode: { default:
|
|
1423
|
+
mode: { default: j.READ }
|
|
1429
1424
|
},
|
|
1430
1425
|
emits: ["update:show"],
|
|
1431
|
-
setup(
|
|
1432
|
-
const h =
|
|
1426
|
+
setup(W) {
|
|
1427
|
+
const h = W, k = Fe(), d = Tt(), _ = Ee(), C = Vt(), A = It(), U = St(), l = Ae(), { t: i } = pe(), u = ft(h, "show"), a = ft(h, "sku"), c = P([]), r = P([]), f = P([]), w = g(
|
|
1433
1428
|
() => {
|
|
1434
1429
|
var y;
|
|
1435
1430
|
return _.isEnabled && _.netSuiteItemBySkuId.has((y = h.sku) == null ? void 0 : y._id);
|
|
1436
1431
|
}
|
|
1437
1432
|
), F = g(() => {
|
|
1438
1433
|
switch (h.mode) {
|
|
1439
|
-
case
|
|
1434
|
+
case j.READ:
|
|
1440
1435
|
return "";
|
|
1441
|
-
case
|
|
1436
|
+
case j.UPDATE:
|
|
1442
1437
|
return i("inventory.ingredient.update.title");
|
|
1443
|
-
case
|
|
1438
|
+
case j.CREATE:
|
|
1444
1439
|
return i("inventory.ingredient.create.title");
|
|
1445
1440
|
}
|
|
1446
1441
|
return "";
|
|
1447
|
-
}),
|
|
1442
|
+
}), m = g(() => {
|
|
1448
1443
|
switch (h.mode) {
|
|
1449
|
-
case
|
|
1444
|
+
case j.READ:
|
|
1450
1445
|
return "";
|
|
1451
|
-
case
|
|
1446
|
+
case j.UPDATE:
|
|
1452
1447
|
return i("common.save");
|
|
1453
|
-
case
|
|
1448
|
+
case j.CREATE:
|
|
1454
1449
|
return i("common.add");
|
|
1455
1450
|
}
|
|
1456
1451
|
return "";
|
|
@@ -1460,7 +1455,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1460
1455
|
try {
|
|
1461
1456
|
await k.createSku(a.value);
|
|
1462
1457
|
const y = k.skuByCode[a.value.code];
|
|
1463
|
-
|
|
1458
|
+
d.enablePoTemplate && c.value.length > 0 && await ue(y), d.enableWastageTemplate && r.value.length > 0 && await oe(y), d.enableClosingTemplate && f.value.length > 0 && await le(y), u.value = !1, l.open({
|
|
1464
1459
|
title: i("inventory.common.success"),
|
|
1465
1460
|
message: i("inventory.ingredient.create.success", { name: a.value.name }),
|
|
1466
1461
|
type: "success"
|
|
@@ -1478,7 +1473,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1478
1473
|
async function ne() {
|
|
1479
1474
|
R.value = !0;
|
|
1480
1475
|
try {
|
|
1481
|
-
await k.updateSku(a.value), R.value = !1,
|
|
1476
|
+
await k.updateSku(a.value), R.value = !1, u.value = !1, l.open({
|
|
1482
1477
|
title: i("inventory.common.success"),
|
|
1483
1478
|
message: i("inventory.ingredient.update.success", { name: a.value.name }),
|
|
1484
1479
|
type: "success"
|
|
@@ -1496,16 +1491,16 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1496
1491
|
async function ue(y) {
|
|
1497
1492
|
var M, G, E, v;
|
|
1498
1493
|
try {
|
|
1499
|
-
for (const
|
|
1500
|
-
const J = await C.getTemplate(
|
|
1494
|
+
for (const N of c.value) {
|
|
1495
|
+
const J = await C.getTemplate(N);
|
|
1501
1496
|
if (!J) {
|
|
1502
|
-
console.warn(`Template with ID ${
|
|
1497
|
+
console.warn(`Template with ID ${N} not found`);
|
|
1503
1498
|
continue;
|
|
1504
1499
|
}
|
|
1505
1500
|
if (!J.purchaseOrder.items.find(
|
|
1506
1501
|
(Q) => Q.sku._id === y._id
|
|
1507
1502
|
)) {
|
|
1508
|
-
const Q = { amount: 1, precision:
|
|
1503
|
+
const Q = { amount: 1, precision: mn(y.unit) }, q = {
|
|
1509
1504
|
sku: y,
|
|
1510
1505
|
name: y.name,
|
|
1511
1506
|
code: y.code,
|
|
@@ -1517,20 +1512,20 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1517
1512
|
...J,
|
|
1518
1513
|
purchaseOrder: {
|
|
1519
1514
|
...J.purchaseOrder,
|
|
1520
|
-
items: [...J.purchaseOrder.items,
|
|
1515
|
+
items: [...J.purchaseOrder.items, q]
|
|
1521
1516
|
}
|
|
1522
1517
|
};
|
|
1523
1518
|
(((E = O.purchaseOrder.supplier) == null ? void 0 : E.internal) === vt.enum.warehouse || ((v = O.purchaseOrder.supplier) == null ? void 0 : v.internal) === vt.enum.restaurant) && (O.purchaseOrder.items = O.purchaseOrder.items.map(
|
|
1524
|
-
({ totalCost: K, ...
|
|
1519
|
+
({ totalCost: K, ...z }) => z
|
|
1525
1520
|
)), await C.updateTemplate(O), await new Promise((K) => setTimeout(K, 1e3));
|
|
1526
1521
|
}
|
|
1527
1522
|
}
|
|
1528
|
-
} catch (
|
|
1523
|
+
} catch (N) {
|
|
1529
1524
|
l.open({
|
|
1530
1525
|
title: i("inventory.transfer.template.update.error"),
|
|
1531
1526
|
message: i("inventory.transfer.template.update.errorMessage"),
|
|
1532
1527
|
type: "error"
|
|
1533
|
-
}), console.error("Error in updating transfer template",
|
|
1528
|
+
}), console.error("Error in updating transfer template", N);
|
|
1534
1529
|
}
|
|
1535
1530
|
}
|
|
1536
1531
|
async function oe(y) {
|
|
@@ -1548,11 +1543,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1548
1543
|
code: y.code,
|
|
1549
1544
|
type: "sku",
|
|
1550
1545
|
disabledMeasurements: []
|
|
1551
|
-
},
|
|
1546
|
+
}, N = {
|
|
1552
1547
|
...G,
|
|
1553
1548
|
items: [...G.items, v]
|
|
1554
1549
|
};
|
|
1555
|
-
await A.updateTemplate(
|
|
1550
|
+
await A.updateTemplate(N), await new Promise((J) => setTimeout(J, 1e3));
|
|
1556
1551
|
}
|
|
1557
1552
|
}
|
|
1558
1553
|
} catch (M) {
|
|
@@ -1574,11 +1569,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1574
1569
|
if (!G.items.find((v) => v.sku._id === y._id)) {
|
|
1575
1570
|
const v = {
|
|
1576
1571
|
sku: y
|
|
1577
|
-
},
|
|
1572
|
+
}, N = {
|
|
1578
1573
|
...G,
|
|
1579
1574
|
items: [...G.items, v]
|
|
1580
1575
|
};
|
|
1581
|
-
await U.updateTemplate(
|
|
1576
|
+
await U.updateTemplate(N), await new Promise((J) => setTimeout(J, 1e3));
|
|
1582
1577
|
}
|
|
1583
1578
|
}
|
|
1584
1579
|
} catch (M) {
|
|
@@ -1595,16 +1590,16 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1595
1590
|
}
|
|
1596
1591
|
function ae() {
|
|
1597
1592
|
switch (h.mode) {
|
|
1598
|
-
case
|
|
1593
|
+
case j.READ:
|
|
1599
1594
|
return;
|
|
1600
|
-
case
|
|
1595
|
+
case j.UPDATE:
|
|
1601
1596
|
return ne();
|
|
1602
|
-
case
|
|
1597
|
+
case j.CREATE:
|
|
1603
1598
|
return ve();
|
|
1604
1599
|
}
|
|
1605
1600
|
}
|
|
1606
1601
|
function fe(y) {
|
|
1607
|
-
|
|
1602
|
+
c.value = y;
|
|
1608
1603
|
}
|
|
1609
1604
|
function ye(y) {
|
|
1610
1605
|
r.value = y;
|
|
@@ -1614,32 +1609,32 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1614
1609
|
}
|
|
1615
1610
|
return (y, M) => {
|
|
1616
1611
|
const G = S("FmChip"), E = S("FmButton"), v = S("FmSideSheet");
|
|
1617
|
-
return
|
|
1618
|
-
"model-value": o(
|
|
1619
|
-
"onUpdate:modelValue": M[3] || (M[3] = (
|
|
1612
|
+
return p(), Y(v, {
|
|
1613
|
+
"model-value": o(u),
|
|
1614
|
+
"onUpdate:modelValue": M[3] || (M[3] = (N) => rt(u) ? u.value = N : null),
|
|
1620
1615
|
header: F.value,
|
|
1621
1616
|
"close-button": "",
|
|
1622
1617
|
"dismiss-away": "",
|
|
1623
1618
|
"max-width": 500
|
|
1624
1619
|
}, {
|
|
1625
1620
|
"side-sheet-footer": x(() => [
|
|
1626
|
-
n("div",
|
|
1621
|
+
n("div", Go, [
|
|
1627
1622
|
s(E, {
|
|
1628
1623
|
loading: R.value,
|
|
1629
|
-
label:
|
|
1624
|
+
label: m.value,
|
|
1630
1625
|
onClick: te
|
|
1631
1626
|
}, null, 8, ["loading", "label"]),
|
|
1632
1627
|
s(E, {
|
|
1633
1628
|
disabled: R.value,
|
|
1634
1629
|
label: o(i)("common.close"),
|
|
1635
1630
|
variant: "tertiary",
|
|
1636
|
-
onClick: M[2] || (M[2] = (
|
|
1631
|
+
onClick: M[2] || (M[2] = (N) => u.value = !1)
|
|
1637
1632
|
}, null, 8, ["disabled", "label"])
|
|
1638
1633
|
])
|
|
1639
1634
|
]),
|
|
1640
1635
|
default: x(() => [
|
|
1641
|
-
n("div",
|
|
1642
|
-
w.value ? (
|
|
1636
|
+
n("div", Yo, [
|
|
1637
|
+
w.value ? (p(), V("div", Ko, [
|
|
1643
1638
|
s(G, {
|
|
1644
1639
|
label: "Managed by Netsuite",
|
|
1645
1640
|
compact: ""
|
|
@@ -1649,19 +1644,19 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1649
1644
|
sku: y.sku,
|
|
1650
1645
|
settingOptions: o(_).skuSettingOptions
|
|
1651
1646
|
}, null, 8, ["sku", "settingOptions"])
|
|
1652
|
-
])) :
|
|
1653
|
-
s(
|
|
1647
|
+
])) : L("", !0),
|
|
1648
|
+
s(Ho, {
|
|
1654
1649
|
class: "w-full",
|
|
1655
1650
|
ref_key: "hasValidationExpose",
|
|
1656
1651
|
ref: B,
|
|
1657
1652
|
modelValue: o(a),
|
|
1658
|
-
"onUpdate:modelValue": M[0] || (M[0] = (
|
|
1653
|
+
"onUpdate:modelValue": M[0] || (M[0] = (N) => rt(a) ? a.value = N : null),
|
|
1659
1654
|
mode: y.mode,
|
|
1660
1655
|
disabled: R.value,
|
|
1661
|
-
purchaseOrderTemplateIds:
|
|
1656
|
+
purchaseOrderTemplateIds: c.value,
|
|
1662
1657
|
wastageTemplateIds: r.value,
|
|
1663
1658
|
closingTemplateIds: f.value,
|
|
1664
|
-
"onClick:submit": M[1] || (M[1] = (
|
|
1659
|
+
"onClick:submit": M[1] || (M[1] = (N) => ae()),
|
|
1665
1660
|
"onUpdate:purchaseOrderTemplateIds": fe,
|
|
1666
1661
|
"onUpdate:wastageTemplateIds": ye,
|
|
1667
1662
|
"onUpdate:closingTemplateIds": we
|
|
@@ -1672,10 +1667,10 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1672
1667
|
}, 8, ["model-value", "header"]);
|
|
1673
1668
|
};
|
|
1674
1669
|
}
|
|
1675
|
-
}),
|
|
1670
|
+
}), Qo = { class: "flex items-center gap-12 pl-8" }, Xo = { class: "flex flex-col" }, Zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, el = {
|
|
1676
1671
|
key: 0,
|
|
1677
1672
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
1678
|
-
},
|
|
1673
|
+
}, tl = { key: 0 }, ht = /* @__PURE__ */ xe({
|
|
1679
1674
|
__name: "ImportIngredientItem",
|
|
1680
1675
|
props: {
|
|
1681
1676
|
type: {},
|
|
@@ -1683,30 +1678,30 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1683
1678
|
name: {},
|
|
1684
1679
|
errors: {}
|
|
1685
1680
|
},
|
|
1686
|
-
setup(
|
|
1681
|
+
setup(W) {
|
|
1687
1682
|
return (h, k) => {
|
|
1688
|
-
const
|
|
1689
|
-
return
|
|
1683
|
+
const d = S("FmIcon"), _ = S("FmTooltip");
|
|
1684
|
+
return p(), V("div", Qo, [
|
|
1690
1685
|
k[0] || (k[0] = n("div", null, "•", -1)),
|
|
1691
|
-
n("div",
|
|
1692
|
-
n("div",
|
|
1686
|
+
n("div", Xo, [
|
|
1687
|
+
n("div", Zo, [
|
|
1693
1688
|
n("div", {
|
|
1694
1689
|
class: ie({
|
|
1695
1690
|
"text-fm-color-system-error-300": h.errors.length
|
|
1696
1691
|
})
|
|
1697
1692
|
}, [
|
|
1698
1693
|
xt($(h.name) + " ", 1),
|
|
1699
|
-
h.type === "create" ? (
|
|
1694
|
+
h.type === "create" ? (p(), V("span", el, "(new)")) : L("", !0)
|
|
1700
1695
|
], 2),
|
|
1701
|
-
h.errors.length ? (
|
|
1696
|
+
h.errors.length ? (p(), V("div", tl, [
|
|
1702
1697
|
s(_, { "z-index": 50 }, {
|
|
1703
1698
|
content: x(() => [
|
|
1704
1699
|
n("ol", null, [
|
|
1705
|
-
(
|
|
1700
|
+
(p(!0), V(ee, null, de(h.errors, (C, A) => (p(), V("li", { key: A }, $(C), 1))), 128))
|
|
1706
1701
|
])
|
|
1707
1702
|
]),
|
|
1708
1703
|
default: x(() => [
|
|
1709
|
-
s(
|
|
1704
|
+
s(d, {
|
|
1710
1705
|
name: "error",
|
|
1711
1706
|
size: "sm",
|
|
1712
1707
|
color: "system-error-300"
|
|
@@ -1714,7 +1709,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1714
1709
|
]),
|
|
1715
1710
|
_: 1
|
|
1716
1711
|
})
|
|
1717
|
-
])) :
|
|
1712
|
+
])) : L("", !0)
|
|
1718
1713
|
]),
|
|
1719
1714
|
n("div", {
|
|
1720
1715
|
class: ie([
|
|
@@ -1729,79 +1724,79 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1729
1724
|
]);
|
|
1730
1725
|
};
|
|
1731
1726
|
}
|
|
1732
|
-
}),
|
|
1727
|
+
}), nl = { class: "flex flex-col gap-24" }, ol = { class: "fm-typo-en-body-md-400" }, ll = { class: "flex flex-col gap-8" }, al = { class: "line-clamp-2 text-ellipsis break-all" }, sl = {
|
|
1733
1728
|
key: 2,
|
|
1734
1729
|
class: "shrink-0"
|
|
1735
|
-
},
|
|
1730
|
+
}, rl = {
|
|
1736
1731
|
key: 0,
|
|
1737
1732
|
class: "flex flex-col"
|
|
1738
|
-
},
|
|
1733
|
+
}, il = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, dl = {
|
|
1739
1734
|
key: 0,
|
|
1740
1735
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
1741
|
-
},
|
|
1736
|
+
}, ul = { class: "fm-typo-en-body-lg-600" }, cl = /* @__PURE__ */ xe({
|
|
1742
1737
|
__name: "ImportIngredients",
|
|
1743
|
-
setup(
|
|
1744
|
-
const h = P(null), k = Ht(),
|
|
1745
|
-
() => !!C.value.length || A.value.some((
|
|
1738
|
+
setup(W) {
|
|
1739
|
+
const h = P(null), k = Ht(), d = Ae(), _ = P(!1), C = P(new Array()), A = P([]), U = P([]), l = g(
|
|
1740
|
+
() => !!C.value.length || A.value.some((c) => c.errors.length) || U.value.some((c) => c.errors.length)
|
|
1746
1741
|
), i = g(
|
|
1747
1742
|
() => !!A.value.length || !!U.value.length
|
|
1748
|
-
), { t:
|
|
1749
|
-
async function a(
|
|
1743
|
+
), { t: u } = pe();
|
|
1744
|
+
async function a(c) {
|
|
1750
1745
|
C.value = [], A.value = [], U.value = [];
|
|
1751
1746
|
try {
|
|
1752
1747
|
_.value = !0;
|
|
1753
1748
|
const [r] = await Promise.all([
|
|
1754
|
-
hn(
|
|
1749
|
+
hn(c),
|
|
1755
1750
|
// fake buffer
|
|
1756
1751
|
new Promise((F) => setTimeout(F, 1e3))
|
|
1757
1752
|
]), f = r.SheetNames.find((F) => F);
|
|
1758
1753
|
if (!f) {
|
|
1759
|
-
C.value.push(
|
|
1754
|
+
C.value.push(u("inventory.ingredient.import.fileError.noSheet"));
|
|
1760
1755
|
return;
|
|
1761
1756
|
}
|
|
1762
1757
|
const w = pn(r.Sheets[f]);
|
|
1763
1758
|
if (w.invalidExcel) {
|
|
1764
|
-
C.value.push(w.invalidExcelMessage ??
|
|
1759
|
+
C.value.push(w.invalidExcelMessage ?? u("inventory.ingredient.import.fileError.invalidExcel"));
|
|
1765
1760
|
return;
|
|
1766
1761
|
}
|
|
1767
1762
|
if (A.value = w.importCreateResult, U.value = w.importUpdateResult, !A.value.length && !U.value.length) {
|
|
1768
|
-
C.value.push(
|
|
1763
|
+
C.value.push(u("inventory.ingredient.import.fileError.noData"));
|
|
1769
1764
|
return;
|
|
1770
1765
|
}
|
|
1771
1766
|
k.emitData(w);
|
|
1772
1767
|
} catch (r) {
|
|
1773
|
-
|
|
1774
|
-
title:
|
|
1768
|
+
d.open({
|
|
1769
|
+
title: u("inventory.ingredient.import.fileError.unableToRead"),
|
|
1775
1770
|
message: r == null ? void 0 : r.message,
|
|
1776
1771
|
type: "error"
|
|
1777
1772
|
}), console.error("Error in reading file", r);
|
|
1778
1773
|
} finally {
|
|
1779
|
-
C.value.length &&
|
|
1780
|
-
title:
|
|
1774
|
+
C.value.length && d.open({
|
|
1775
|
+
title: u("inventory.ingredient.import.fileError.invalidExcel"),
|
|
1781
1776
|
type: "error"
|
|
1782
1777
|
}), _.value = !1;
|
|
1783
1778
|
}
|
|
1784
1779
|
}
|
|
1785
|
-
return _t(h, (
|
|
1786
|
-
|
|
1787
|
-
}), (
|
|
1780
|
+
return _t(h, (c) => {
|
|
1781
|
+
c && a(c);
|
|
1782
|
+
}), (c, r) => {
|
|
1788
1783
|
const f = S("FmCircularProgress"), w = S("FmIcon"), F = S("FmButton");
|
|
1789
|
-
return
|
|
1790
|
-
n("div",
|
|
1784
|
+
return p(), V("div", nl, [
|
|
1785
|
+
n("div", ol, $(o(u)("inventory.ingredient.import.uploadDescription")), 1),
|
|
1791
1786
|
s(_n, {
|
|
1792
1787
|
class: ie({
|
|
1793
1788
|
"w-full": !0,
|
|
1794
1789
|
"h-[200px]": !h.value
|
|
1795
1790
|
}),
|
|
1796
1791
|
accept: ".xlsx",
|
|
1797
|
-
onFileUpload: r[0] || (r[0] = (
|
|
1798
|
-
label: o(
|
|
1799
|
-
"button-label": o(
|
|
1792
|
+
onFileUpload: r[0] || (r[0] = (m) => h.value = m),
|
|
1793
|
+
label: o(u)("inventory.ingredient.import.uploadTemplate"),
|
|
1794
|
+
"button-label": o(u)("inventory.ingredient.import.selectFile")
|
|
1800
1795
|
}, kt({ _: 2 }, [
|
|
1801
1796
|
h.value ? {
|
|
1802
1797
|
name: "default",
|
|
1803
|
-
fn: x(({ openFileDialog:
|
|
1804
|
-
n("div",
|
|
1798
|
+
fn: x(({ openFileDialog: m }) => [
|
|
1799
|
+
n("div", ll, [
|
|
1805
1800
|
n("div", {
|
|
1806
1801
|
class: ie([
|
|
1807
1802
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
@@ -1812,11 +1807,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1812
1807
|
}
|
|
1813
1808
|
])
|
|
1814
1809
|
}, [
|
|
1815
|
-
_.value ? (
|
|
1810
|
+
_.value ? (p(), Y(f, {
|
|
1816
1811
|
key: 0,
|
|
1817
1812
|
size: "md",
|
|
1818
1813
|
color: "neutral-gray-200"
|
|
1819
|
-
})) : (
|
|
1814
|
+
})) : (p(), Y(w, {
|
|
1820
1815
|
key: 1,
|
|
1821
1816
|
name: l.value ? "error" : "attach_file",
|
|
1822
1817
|
outline: "",
|
|
@@ -1831,19 +1826,19 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1831
1826
|
}
|
|
1832
1827
|
])
|
|
1833
1828
|
}, [
|
|
1834
|
-
n("div",
|
|
1829
|
+
n("div", al, $(h.value.name), 1)
|
|
1835
1830
|
], 2),
|
|
1836
|
-
_.value ?
|
|
1831
|
+
_.value ? L("", !0) : (p(), V("div", sl, [
|
|
1837
1832
|
s(F, {
|
|
1838
|
-
label: o(
|
|
1833
|
+
label: o(u)("inventory.ingredient.import.replaceFile"),
|
|
1839
1834
|
variant: l.value ? "destructive" : "secondary",
|
|
1840
1835
|
"prepend-icon": l.value ? void 0 : "autorenew",
|
|
1841
|
-
onClick:
|
|
1836
|
+
onClick: m
|
|
1842
1837
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
1843
1838
|
]))
|
|
1844
1839
|
], 2),
|
|
1845
|
-
C.value.length ? (
|
|
1846
|
-
(
|
|
1840
|
+
C.value.length ? (p(), V("div", rl, [
|
|
1841
|
+
(p(!0), V(ee, null, de(C.value, (B, R) => (p(), V("div", {
|
|
1847
1842
|
key: R,
|
|
1848
1843
|
class: "flex gap-8 items-center"
|
|
1849
1844
|
}, [
|
|
@@ -1852,41 +1847,41 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1852
1847
|
size: "sm",
|
|
1853
1848
|
color: "system-error-300"
|
|
1854
1849
|
}),
|
|
1855
|
-
n("div",
|
|
1850
|
+
n("div", il, $(B), 1)
|
|
1856
1851
|
]))), 128))
|
|
1857
|
-
])) :
|
|
1852
|
+
])) : L("", !0)
|
|
1858
1853
|
])
|
|
1859
1854
|
]),
|
|
1860
1855
|
key: "0"
|
|
1861
1856
|
} : void 0
|
|
1862
1857
|
]), 1032, ["class", "label", "button-label"]),
|
|
1863
|
-
i.value ? (
|
|
1864
|
-
n("div",
|
|
1865
|
-
(
|
|
1866
|
-
key:
|
|
1867
|
-
code:
|
|
1868
|
-
name:
|
|
1869
|
-
errors:
|
|
1858
|
+
i.value ? (p(), V("div", dl, [
|
|
1859
|
+
n("div", ul, $(o(u)("inventory.ingredient.import.summary")), 1),
|
|
1860
|
+
(p(!0), V(ee, null, de(A.value, (m) => (p(), Y(ht, {
|
|
1861
|
+
key: m.sku._id,
|
|
1862
|
+
code: m.sku.code,
|
|
1863
|
+
name: m.sku.name,
|
|
1864
|
+
errors: m.errors,
|
|
1870
1865
|
type: "create"
|
|
1871
1866
|
}, null, 8, ["code", "name", "errors"]))), 128)),
|
|
1872
|
-
(
|
|
1873
|
-
key:
|
|
1874
|
-
code:
|
|
1875
|
-
name:
|
|
1876
|
-
errors:
|
|
1867
|
+
(p(!0), V(ee, null, de(U.value, (m) => (p(), Y(ht, {
|
|
1868
|
+
key: m.sku._id,
|
|
1869
|
+
code: m.sku.code,
|
|
1870
|
+
name: m.sku.name,
|
|
1871
|
+
errors: m.errors,
|
|
1877
1872
|
type: "update"
|
|
1878
1873
|
}, null, 8, ["code", "name", "errors"]))), 128))
|
|
1879
|
-
])) :
|
|
1874
|
+
])) : L("", !0)
|
|
1880
1875
|
]);
|
|
1881
1876
|
};
|
|
1882
1877
|
}
|
|
1883
1878
|
}), ml = {
|
|
1884
1879
|
key: 0,
|
|
1885
1880
|
class: "flex items-center gap-1"
|
|
1886
|
-
},
|
|
1881
|
+
}, pl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vl = { class: "flex flex-col py-8" }, fl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, yl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Kl = /* @__PURE__ */ xe({
|
|
1887
1882
|
__name: "IngredientsView",
|
|
1888
|
-
setup(
|
|
1889
|
-
const h = Fe(), k = Ee(),
|
|
1883
|
+
setup(W) {
|
|
1884
|
+
const h = Fe(), k = Ee(), d = g(() => [
|
|
1890
1885
|
{
|
|
1891
1886
|
type: "string",
|
|
1892
1887
|
key: "skuCode",
|
|
@@ -1929,11 +1924,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1929
1924
|
},
|
|
1930
1925
|
E
|
|
1931
1926
|
));
|
|
1932
|
-
}), U = Wt(), l = Ke(), i = dn(),
|
|
1933
|
-
function
|
|
1927
|
+
}), U = Wt(), l = Ke(), i = dn(), u = Ae(), { t: a } = pe(), { createIngredient: c, updateIngredient: r } = Ye(), { ingredientDialogProps: f, ingredientViewLoading: w } = Xt(Ye()), { columnDefs: F } = Nn();
|
|
1928
|
+
function m(E) {
|
|
1934
1929
|
switch (E) {
|
|
1935
1930
|
case "add":
|
|
1936
|
-
return k.isEnabled ? void 0 :
|
|
1931
|
+
return k.isEnabled ? void 0 : c();
|
|
1937
1932
|
case "import":
|
|
1938
1933
|
return M();
|
|
1939
1934
|
case "export-all":
|
|
@@ -1981,7 +1976,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1981
1976
|
]);
|
|
1982
1977
|
function y(E) {
|
|
1983
1978
|
const v = vn(E);
|
|
1984
|
-
|
|
1979
|
+
u.open({
|
|
1985
1980
|
title: a("inventory.ingredient.export.success"),
|
|
1986
1981
|
message: a("inventory.ingredient.export.filename", [v]),
|
|
1987
1982
|
type: "success"
|
|
@@ -1990,7 +1985,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
1990
1985
|
function M() {
|
|
1991
1986
|
l.open({
|
|
1992
1987
|
title: a("inventory.ingredient.import.title"),
|
|
1993
|
-
contentComponent:
|
|
1988
|
+
contentComponent: cl,
|
|
1994
1989
|
overlay: !0,
|
|
1995
1990
|
closeButton: !0,
|
|
1996
1991
|
primaryActions: {
|
|
@@ -2008,14 +2003,14 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2008
2003
|
}
|
|
2009
2004
|
}).onPrimary((E) => {
|
|
2010
2005
|
if (!E) {
|
|
2011
|
-
|
|
2006
|
+
u.open({
|
|
2012
2007
|
title: a("inventory.ingredient.import.error.noData"),
|
|
2013
2008
|
type: "error"
|
|
2014
2009
|
});
|
|
2015
2010
|
return;
|
|
2016
2011
|
}
|
|
2017
2012
|
if (!E.importCreateResult.length && !E.importUpdateResult.length) {
|
|
2018
|
-
|
|
2013
|
+
u.open({
|
|
2019
2014
|
title: a("inventory.ingredient.import.error.invalidContent"),
|
|
2020
2015
|
message: a("inventory.ingredient.import.error.noImportData"),
|
|
2021
2016
|
type: "error"
|
|
@@ -2023,7 +2018,7 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2023
2018
|
return;
|
|
2024
2019
|
}
|
|
2025
2020
|
if (E.importCreateResult.some((v) => v.errors.length) || E.importUpdateResult.some((v) => v.errors.length)) {
|
|
2026
|
-
|
|
2021
|
+
u.open({
|
|
2027
2022
|
title: a("inventory.ingredient.import.error.invalidContent"),
|
|
2028
2023
|
message: a("inventory.ingredient.import.error.hasErrors"),
|
|
2029
2024
|
type: "error"
|
|
@@ -2037,30 +2032,30 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2037
2032
|
R.value = !0;
|
|
2038
2033
|
try {
|
|
2039
2034
|
const v = [
|
|
2040
|
-
...E.importCreateResult.map(({ sku:
|
|
2041
|
-
...E.importUpdateResult.map(({ sku:
|
|
2042
|
-
],
|
|
2035
|
+
...E.importCreateResult.map(({ sku: q }) => ({ type: "create", sku: q })),
|
|
2036
|
+
...E.importUpdateResult.map(({ sku: q }) => ({ type: "update", sku: q }))
|
|
2037
|
+
], N = 100;
|
|
2043
2038
|
let J = 0;
|
|
2044
|
-
const
|
|
2045
|
-
J +=
|
|
2039
|
+
const ce = () => {
|
|
2040
|
+
J += N, u.open({
|
|
2046
2041
|
title: a("inventory.ingredient.import.progress", [
|
|
2047
2042
|
Math.min(J, v.length),
|
|
2048
2043
|
v.length
|
|
2049
2044
|
])
|
|
2050
2045
|
});
|
|
2051
2046
|
}, Q = new Array();
|
|
2052
|
-
for (const
|
|
2053
|
-
|
|
2047
|
+
for (const q of v.chunk(100)) {
|
|
2048
|
+
ce();
|
|
2054
2049
|
try {
|
|
2055
2050
|
const O = await h.importSkus({
|
|
2056
|
-
create:
|
|
2057
|
-
update:
|
|
2051
|
+
create: q.filter((K) => K.type === "create").map((K) => K.sku),
|
|
2052
|
+
update: q.filter((K) => K.type === "update").map((K) => K.sku)
|
|
2058
2053
|
});
|
|
2059
2054
|
Q.push(...O.errors);
|
|
2060
2055
|
} catch (O) {
|
|
2061
2056
|
Q.push(
|
|
2062
|
-
...
|
|
2063
|
-
const
|
|
2057
|
+
...q.map((K) => {
|
|
2058
|
+
const z = {
|
|
2064
2059
|
module: qt.enum.sku,
|
|
2065
2060
|
_id: K.sku._id,
|
|
2066
2061
|
name: K.sku.name,
|
|
@@ -2068,13 +2063,13 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2068
2063
|
};
|
|
2069
2064
|
return {
|
|
2070
2065
|
data: K.sku,
|
|
2071
|
-
error: [
|
|
2066
|
+
error: [z]
|
|
2072
2067
|
};
|
|
2073
2068
|
})
|
|
2074
2069
|
);
|
|
2075
2070
|
}
|
|
2076
2071
|
}
|
|
2077
|
-
|
|
2072
|
+
u.open({
|
|
2078
2073
|
title: a("inventory.ingredient.import.success"),
|
|
2079
2074
|
type: "success"
|
|
2080
2075
|
}), Q.length && i.alert(
|
|
@@ -2083,19 +2078,19 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2083
2078
|
"div",
|
|
2084
2079
|
{ class: "flex flex-col gap-8" },
|
|
2085
2080
|
Q.map(
|
|
2086
|
-
(
|
|
2087
|
-
Z("div", { class: "fm-typo-en-body-lg-600" }, `(${
|
|
2081
|
+
(q) => Z("div", { class: "flex flex-col" }, [
|
|
2082
|
+
Z("div", { class: "fm-typo-en-body-lg-600" }, `(${q.data.code}) ${q.data.name}`),
|
|
2088
2083
|
Z(
|
|
2089
2084
|
"div",
|
|
2090
2085
|
{ class: "fm-typo-en-body-lg-400" },
|
|
2091
|
-
`${
|
|
2086
|
+
`${q.error.map((O) => (O == null ? void 0 : O.message) ?? "Unknown error").join(", ")}`
|
|
2092
2087
|
)
|
|
2093
2088
|
])
|
|
2094
2089
|
)
|
|
2095
2090
|
)
|
|
2096
2091
|
);
|
|
2097
2092
|
} catch (v) {
|
|
2098
|
-
|
|
2093
|
+
u.open({
|
|
2099
2094
|
title: a("inventory.ingredient.import.error.failed"),
|
|
2100
2095
|
message: a("inventory.ingredient.import.error.systemMessage", [v == null ? void 0 : v.message]),
|
|
2101
2096
|
type: "error"
|
|
@@ -2105,16 +2100,16 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2105
2100
|
}
|
|
2106
2101
|
}
|
|
2107
2102
|
return (E, v) => {
|
|
2108
|
-
const
|
|
2109
|
-
return
|
|
2103
|
+
const N = S("FmButton"), J = S("FmMenuItem"), ce = S("FmMenu"), Q = S("FmSwitch"), q = S("FmTable"), O = S("FmCollapsibleTabs"), K = S("FmBottomSheet");
|
|
2104
|
+
return p(), Y(nn, {
|
|
2110
2105
|
title: o(a)("inventory.ingredient.title"),
|
|
2111
2106
|
actions: we.value,
|
|
2112
|
-
"onClick:action":
|
|
2107
|
+
"onClick:action": m
|
|
2113
2108
|
}, {
|
|
2114
2109
|
"header-end": x(() => [
|
|
2115
|
-
s(
|
|
2110
|
+
s(ce, { "close-on-click": !0 }, {
|
|
2116
2111
|
"menu-button": x(() => [
|
|
2117
|
-
s(
|
|
2112
|
+
s(N, {
|
|
2118
2113
|
label: o(a)("common.export"),
|
|
2119
2114
|
"bg-color": "neutral-gray-100",
|
|
2120
2115
|
"text-color": "neutral-gray-400"
|
|
@@ -2123,11 +2118,11 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2123
2118
|
default: x(() => [
|
|
2124
2119
|
s(J, {
|
|
2125
2120
|
label: o(a)("inventory.ingredient.export.exportAll"),
|
|
2126
|
-
onClick: v[0] || (v[0] = (
|
|
2121
|
+
onClick: v[0] || (v[0] = (z) => y())
|
|
2127
2122
|
}, null, 8, ["label"]),
|
|
2128
2123
|
s(J, {
|
|
2129
2124
|
label: o(a)("inventory.ingredient.export.exportFiltered"),
|
|
2130
|
-
onClick: v[1] || (v[1] = (
|
|
2125
|
+
onClick: v[1] || (v[1] = (z) => y(A.value))
|
|
2131
2126
|
}, null, 8, ["label"])
|
|
2132
2127
|
]),
|
|
2133
2128
|
_: 1
|
|
@@ -2146,30 +2141,30 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2146
2141
|
s(xn, {
|
|
2147
2142
|
searchable: "",
|
|
2148
2143
|
search: B.value,
|
|
2149
|
-
"onUpdate:search": v[3] || (v[3] = (
|
|
2144
|
+
"onUpdate:search": v[3] || (v[3] = (z) => B.value = z),
|
|
2150
2145
|
filterable: "",
|
|
2151
|
-
"filter-attributes":
|
|
2146
|
+
"filter-attributes": d.value,
|
|
2152
2147
|
filter: _.value,
|
|
2153
|
-
"onUpdate:filter": v[4] || (v[4] = (
|
|
2148
|
+
"onUpdate:filter": v[4] || (v[4] = (z) => _.value = z)
|
|
2154
2149
|
}, {
|
|
2155
2150
|
default: x(() => [
|
|
2156
|
-
o(k).isEnabled ? (
|
|
2157
|
-
n("span",
|
|
2151
|
+
o(k).isEnabled ? (p(), V("div", ml, [
|
|
2152
|
+
n("span", pl, $(o(a)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
|
|
2158
2153
|
s(sn),
|
|
2159
2154
|
s(Be, null, {
|
|
2160
2155
|
default: x(() => [
|
|
2161
2156
|
s(Q, {
|
|
2162
2157
|
modelValue: ne.value,
|
|
2163
|
-
"onUpdate:modelValue": v[2] || (v[2] = (
|
|
2158
|
+
"onUpdate:modelValue": v[2] || (v[2] = (z) => ne.value = z)
|
|
2164
2159
|
}, null, 8, ["modelValue"])
|
|
2165
2160
|
]),
|
|
2166
2161
|
_: 1
|
|
2167
2162
|
})
|
|
2168
|
-
])) :
|
|
2163
|
+
])) : L("", !0)
|
|
2169
2164
|
]),
|
|
2170
2165
|
_: 1
|
|
2171
2166
|
}, 8, ["search", "filter-attributes", "filter"]),
|
|
2172
|
-
(
|
|
2167
|
+
(p(), Y(q, {
|
|
2173
2168
|
key: JSON.stringify(_.value),
|
|
2174
2169
|
style: Dt(o(te).tableHeight),
|
|
2175
2170
|
"column-defs": o(F),
|
|
@@ -2180,27 +2175,27 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2180
2175
|
},
|
|
2181
2176
|
loading: (!o(U)._currentLocation || ve.value) && o(k).isReady,
|
|
2182
2177
|
"loading-text": o(a)("inventory.common.loading"),
|
|
2183
|
-
onRowClick: v[5] || (v[5] = (
|
|
2178
|
+
onRowClick: v[5] || (v[5] = (z) => o(r)(z.original)),
|
|
2184
2179
|
"page-size": le.value
|
|
2185
2180
|
}, {
|
|
2186
|
-
"list-row": x((
|
|
2181
|
+
"list-row": x((z) => [
|
|
2187
2182
|
s(bn, {
|
|
2188
|
-
row:
|
|
2183
|
+
row: z,
|
|
2189
2184
|
onRowClick: o(r)
|
|
2190
2185
|
}, kt({
|
|
2191
2186
|
default: x((ge) => {
|
|
2192
|
-
var $e, Me, Ue, be, he,
|
|
2187
|
+
var $e, Me, Ue, be, he, me, Te, Ve, _e, Ie;
|
|
2193
2188
|
return [
|
|
2194
|
-
n("div",
|
|
2195
|
-
n("div",
|
|
2189
|
+
n("div", vl, [
|
|
2190
|
+
n("div", fl, [
|
|
2196
2191
|
s(o(gt), {
|
|
2197
2192
|
render: (Ue = (Me = ($e = ge.code) == null ? void 0 : $e.column) == null ? void 0 : Me.columnDef) == null ? void 0 : Ue.cell,
|
|
2198
2193
|
props: (he = (be = ge.code) == null ? void 0 : be.getContext) == null ? void 0 : he.call(be)
|
|
2199
2194
|
}, null, 8, ["render", "props"])
|
|
2200
2195
|
]),
|
|
2201
|
-
n("div",
|
|
2196
|
+
n("div", yl, [
|
|
2202
2197
|
s(o(gt), {
|
|
2203
|
-
render: (Ve = (Te = (
|
|
2198
|
+
render: (Ve = (Te = (me = ge.name) == null ? void 0 : me.column) == null ? void 0 : Te.columnDef) == null ? void 0 : Ve.cell,
|
|
2204
2199
|
props: (Ie = (_e = ge.name) == null ? void 0 : _e.getContext) == null ? void 0 : Ie.call(_e)
|
|
2205
2200
|
}, null, 8, ["render", "props"])
|
|
2206
2201
|
])
|
|
@@ -2221,20 +2216,20 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2221
2216
|
_: 1
|
|
2222
2217
|
}, 8, ["style", "column-defs", "row-data", "search-value", "columnVisibility", "loading", "loading-text", "page-size"]))
|
|
2223
2218
|
], 2),
|
|
2224
|
-
(
|
|
2225
|
-
s(
|
|
2219
|
+
(p(), Y(it, { to: "body" }, [
|
|
2220
|
+
s(Jo, Nt(zt(o(f))), null, 16)
|
|
2226
2221
|
])),
|
|
2227
|
-
(
|
|
2222
|
+
(p(), Y(it, { to: "body" }, [
|
|
2228
2223
|
s(K, {
|
|
2229
2224
|
"dismiss-away": "",
|
|
2230
2225
|
modelValue: ae.value,
|
|
2231
|
-
"onUpdate:modelValue": v[7] || (v[7] = (
|
|
2226
|
+
"onUpdate:modelValue": v[7] || (v[7] = (z) => ae.value = z)
|
|
2232
2227
|
}, {
|
|
2233
2228
|
default: x(() => [
|
|
2234
2229
|
s(O, {
|
|
2235
2230
|
class: "pb-8",
|
|
2236
2231
|
items: fe,
|
|
2237
|
-
"onUpdate:modelValue": v[6] || (v[6] = (
|
|
2232
|
+
"onUpdate:modelValue": v[6] || (v[6] = (z) => ye(z))
|
|
2238
2233
|
})
|
|
2239
2234
|
]),
|
|
2240
2235
|
_: 1
|
|
@@ -2247,5 +2242,5 @@ const zn = /* @__PURE__ */ ke({
|
|
|
2247
2242
|
}
|
|
2248
2243
|
});
|
|
2249
2244
|
export {
|
|
2250
|
-
|
|
2245
|
+
Kl as default
|
|
2251
2246
|
};
|