@feedmepos/mf-inventory-portal 0.0.25-dev.7 → 0.0.25-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-qJehfAde.js → App-CKLQeRNl.js} +1 -1
- package/dist/{ApprovalView-BuqKIEPL.js → ApprovalView-BWO2tkbO.js} +6 -6
- package/dist/{BindingsDialog-BrF-YAJ2.js → BindingsDialog-C0kTZLOn.js} +9 -9
- package/dist/{BindingsPicker-DK41dcoG.js → BindingsPicker-DjcS3uTL.js} +10 -10
- package/dist/{BindingsTable-DxlRhKzN.js → BindingsTable-Ctpv958D.js} +10 -10
- package/dist/{ClosingDraftView-CpGQMN37.js → ClosingDraftView-CsAPSZPc.js} +2 -2
- package/dist/{ClosingTemplateView-4l891KsC.js → ClosingTemplateView-D0HWVhk3.js} +477 -492
- package/dist/{FmCustomAttribute.vue_vue_type_script_setup_true_lang-CyHyOhG6.js → FmCustomAttribute.vue_vue_type_script_setup_true_lang-BF0lKP9Y.js} +1 -1
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DJfBmiRt.js +211 -0
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-3LU_3Y8h.js → FmUnitInput.vue_vue_type_script_setup_true_lang-qZ7Kx-KR.js} +1 -1
- package/dist/{IngredientGroupView-Bjv9Kih7.js → IngredientGroupView-Dc3glXN3.js} +1 -1
- package/dist/{IngredientsView-ChJbe-U_.js → IngredientsView-btzrUQ1-.js} +392 -382
- package/dist/{IntegrationView-Cmh47qP7.js → IntegrationView-DO1SF1Ca.js} +660 -623
- package/dist/{InventoryBindingForm-GmcCTBqN.js → InventoryBindingForm-_2p-YetL.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CQrjMOFh.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-B7ump1tl.js} +5 -5
- package/dist/{InventoryBindingSummary-w1pFGR3C.js → InventoryBindingSummary-CEdLu3d9.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cxr2xhRR.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-kLdZ5acK.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CzxVUAC8.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Da0gmGST.js} +1 -1
- package/dist/{PublishView-pWAEdGLi.js → PublishView-CXTiPWIx.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-CZczBXL2.js → PurchaseOrderPrintPreview-DBviMTyA.js} +1 -1
- package/dist/{ReceiveRequestView-tWyQCrIN.js → ReceiveRequestView-Ct1AQDGK.js} +8 -8
- package/dist/{RecipeView-Dy1BBW3o.js → RecipeView-C0HiPNvf.js} +3 -3
- package/dist/{StockView-B0c0FiPr.js → StockView-BG8jsV_X.js} +7 -7
- package/dist/{SupplierView-BUs8xZPq.js → SupplierView-th75_ohq.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BA0HIuSW.js → TransferDetails.vue_vue_type_script_setup_true_lang-n7fH8GRs.js} +19 -19
- package/dist/{TransferTemplateView-MSbvSo96.js → TransferTemplateView-Dcz6xGR_.js} +443 -460
- package/dist/{UnitView-GBK0ovxt.js → UnitView-lnoMsoBN.js} +3 -3
- package/dist/{WarehouseView-CXoj99HO.js → WarehouseView-ChXcNnmp.js} +1 -1
- package/dist/{app-Du-JrqLm.js → app-B4RHEuan.js} +6283 -6208
- package/dist/app.js +1 -1
- package/dist/components/FmLockableField.vue.d.ts +3 -0
- package/dist/components/FmMultiselectDialog.vue.d.ts +9 -1
- package/dist/components/FmMultiselectDialogProps.d.ts +2 -0
- package/dist/{decimal-BXePRNLM.js → decimal-BocxWSo6.js} +1 -1
- package/dist/{format-unit-display-BdC0fMRb.js → format-unit-display-E_NtfEtV.js} +2 -2
- package/dist/helper/fuzzy.d.ts +10 -0
- package/dist/{index-irnhqIWw.js → index-B-MhJgPv.js} +3 -3
- package/dist/{index-cY9fiIBU.js → index-ro6xANOo.js} +1 -1
- package/dist/{stock-CE5Qq59r.js → stock-DpmweZQd.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-Cy-jlD0j.js → supplier--P-eubcS.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/use-ingredient-select-dialog-C7WZf5D4.js +52 -0
- package/dist/{use-inventory-binding-dialog-nHDQBRL3.js → use-inventory-binding-dialog-DW_kAtLh.js} +1 -1
- package/dist/views/ingredients/composables/use-ingredient-select-dialog.d.ts +16 -0
- package/dist/{vue-i18n-DIA7c33f.js → vue-i18n-SeWrkOlu.js} +134 -134
- package/package.json +3 -3
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DRqpc9k0.js +0 -286
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { defineComponent as X, onMounted as ce, computed as R, ref as U, watch as pe, inject as
|
|
2
|
-
import { H as Ne, ay as ue, t as
|
|
1
|
+
import { defineComponent as X, onMounted as ce, computed as R, ref as U, watch as pe, inject as Ze, resolveComponent as O, openBlock as D, createElementBlock as G, createElementVNode as t, createVNode as c, withCtx as B, renderSlot as Oe, withDirectives as Ve, normalizeClass as J, vModelText as De, reactive as Je, h as Z, toDisplayString as $, unref as e, createBlock as W, mergeProps as Ee, isRef as Ue, createCommentVNode as ee, Fragment as qe, renderList as Xe, normalizeStyle as Ye, Teleport as et, normalizeProps as tt, guardReactiveProps as ot } from "vue";
|
|
2
|
+
import { H as Ne, ay as ue, t as Re, I as st, az as lt, aA as nt, j as K, aB as at, b as ze, $ as Ae, m as de, a as He, P as ie, L as rt, A as me, M as it, c as je, G as Q, u as Qe, ac as ut, V as dt, E as Ke, K as mt, e as te, aC as ae, a9 as ct, a1 as pt, z as ft, i as Pe, _ as yt, B as vt } from "./app-B4RHEuan.js";
|
|
3
3
|
import { useI18n as Y } from "@feedmepos/mf-common";
|
|
4
|
-
import { P as H, a as
|
|
5
|
-
import { components as re, useDialog as
|
|
4
|
+
import { P as H, a as bt, f as xt, t as _t, b as Le, u as ht } from "./format-unit-display-E_NtfEtV.js";
|
|
5
|
+
import { components as re, useDialog as gt, useSnackbar as Tt, useProxiedModel as Ge, useBreakpoints as kt } from "@feedmepos/ui-library";
|
|
6
6
|
import { storeToRefs as Be } from "pinia";
|
|
7
|
-
import { _ as
|
|
8
|
-
import { c as
|
|
9
|
-
import { u as
|
|
10
|
-
|
|
7
|
+
import { _ as Ft, b as wt, F as St, a as Ct } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-qZ7Kx-KR.js";
|
|
8
|
+
import { c as $t, u as Mt, _ as It } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DJfBmiRt.js";
|
|
9
|
+
import { u as Ot } from "./supplier--P-eubcS.js";
|
|
10
|
+
import { u as Vt } from "./use-ingredient-select-dialog-C7WZf5D4.js";
|
|
11
|
+
const Dt = { class: "flex flex-col" }, Rt = { class: "flex flex-col" }, At = { class: "flex-1" }, Pt = { class: "flex items-center" }, Lt = { class: "flex-1" }, Bt = { class: "flex-1" }, Et = /* @__PURE__ */ X({
|
|
11
12
|
__name: "FmMinMaxInput",
|
|
12
13
|
props: {
|
|
13
14
|
rules: {},
|
|
@@ -45,76 +46,76 @@ const Dt = { class: "flex flex-col" }, At = { class: "flex flex-col" }, Rt = { c
|
|
|
45
46
|
helperState: {}
|
|
46
47
|
},
|
|
47
48
|
setup(y) {
|
|
48
|
-
const
|
|
49
|
+
const g = y, u = Ne("modelValue"), o = st();
|
|
49
50
|
ce(() => {
|
|
50
|
-
const { min:
|
|
51
|
-
if (!(!
|
|
52
|
-
const
|
|
51
|
+
const { min: m, max: r } = u ?? {};
|
|
52
|
+
if (!(!m || !r) && m.precision !== r.precision) {
|
|
53
|
+
const T = Math.max(m.precision, r.precision), a = ue(m, T), f = ue(r, T);
|
|
53
54
|
u.min = a, u.max = f;
|
|
54
55
|
}
|
|
55
56
|
});
|
|
56
|
-
const
|
|
57
|
-
const { min:
|
|
58
|
-
return Math.max((
|
|
59
|
-
}),
|
|
60
|
-
if (!
|
|
61
|
-
const r = lt(
|
|
57
|
+
const p = R(() => {
|
|
58
|
+
const { min: m, max: r } = u ?? {};
|
|
59
|
+
return Math.max((m == null ? void 0 : m.precision) ?? 0, (r == null ? void 0 : r.precision) ?? 0, g.precision ?? 0);
|
|
60
|
+
}), S = (m) => {
|
|
61
|
+
if (!m) return "";
|
|
62
|
+
const r = lt(m), T = p.value, a = ue(r, T);
|
|
62
63
|
return nt(
|
|
63
64
|
+K(a),
|
|
64
65
|
a.precision
|
|
65
66
|
);
|
|
66
|
-
}, i = U(
|
|
67
|
-
pe([i, l], ([
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
70
|
-
const
|
|
71
|
-
|
|
67
|
+
}, i = U(S(u.min)), l = U(S(u.max));
|
|
68
|
+
pe([i, l], ([m, r]) => {
|
|
69
|
+
const T = u ?? {}, a = o(m), f = o(r), w = p.value;
|
|
70
|
+
if (m !== "" && a === !0) {
|
|
71
|
+
const s = Re(+m, w);
|
|
72
|
+
T.min = s;
|
|
72
73
|
} else
|
|
73
|
-
|
|
74
|
+
T.min = null;
|
|
74
75
|
if (r !== "" && f === !0) {
|
|
75
|
-
const
|
|
76
|
-
|
|
76
|
+
const s = Re(+r, w);
|
|
77
|
+
T.max = s;
|
|
77
78
|
} else
|
|
78
|
-
|
|
79
|
-
u.min =
|
|
79
|
+
T.max = null;
|
|
80
|
+
u.min = T.min, u.max = T.max;
|
|
80
81
|
});
|
|
81
|
-
const
|
|
82
|
+
const d = Symbol.for("fm:form-state"), x = Ze(d, null), C = R(() => g.disabled ?? (x == null ? void 0 : x.getDisabled()) ?? !1), V = U(), k = U(), v = U(!1), F = U(!1), M = R(() => v.value || F.value), E = R(() => [...[
|
|
82
83
|
function() {
|
|
83
|
-
return typeof
|
|
84
|
+
return typeof o(i.value) == "string" || typeof o(l.value) == "string" ? "Must be a number" : !0;
|
|
84
85
|
},
|
|
85
|
-
function(
|
|
86
|
-
return !
|
|
86
|
+
function(T) {
|
|
87
|
+
return !T || !T.min || !T.max ? !0 : +K(T.min) > +K(T.max) ? "Min must be less than or equal to max" : !0;
|
|
87
88
|
}
|
|
88
|
-
], ...
|
|
89
|
-
return (
|
|
90
|
-
const
|
|
91
|
-
return
|
|
92
|
-
t("div",
|
|
93
|
-
t("div",
|
|
94
|
-
c(
|
|
95
|
-
label:
|
|
96
|
-
disabled:
|
|
97
|
-
required:
|
|
98
|
-
optional:
|
|
89
|
+
], ...g.rules ?? []]);
|
|
90
|
+
return (m, r) => {
|
|
91
|
+
const T = O("FmLabel"), a = O("FmField"), f = O("FmFormGroup");
|
|
92
|
+
return D(), G("div", Dt, [
|
|
93
|
+
t("div", Rt, [
|
|
94
|
+
t("div", At, [
|
|
95
|
+
c(T, {
|
|
96
|
+
label: m.label,
|
|
97
|
+
disabled: m.disabled,
|
|
98
|
+
required: m.labelMark === "required",
|
|
99
|
+
optional: m.labelMark === "optional"
|
|
99
100
|
}, null, 8, ["label", "disabled", "required", "optional"])
|
|
100
101
|
]),
|
|
101
|
-
c(a, { focused:
|
|
102
|
+
c(a, { focused: M.value }, {
|
|
102
103
|
default: B(() => [
|
|
103
104
|
t("div", Pt, [
|
|
104
|
-
Oe(
|
|
105
|
+
Oe(m.$slots, "prepend"),
|
|
105
106
|
r[6] || (r[6] = t("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Min.", -1)),
|
|
106
107
|
t("div", Lt, [
|
|
107
108
|
Ve(t("input", {
|
|
108
109
|
type: "text",
|
|
109
110
|
ref_key: "minInputRef",
|
|
110
|
-
ref:
|
|
111
|
+
ref: V,
|
|
111
112
|
onFocus: r[0] || (r[0] = () => v.value = !0),
|
|
112
113
|
onBlur: r[1] || (r[1] = () => v.value = !1),
|
|
113
114
|
"onUpdate:modelValue": r[2] || (r[2] = (w) => i.value = w),
|
|
114
|
-
class:
|
|
115
|
+
class: J({
|
|
115
116
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
116
|
-
"text-fm-color-typo-primary": !
|
|
117
|
-
"text-fm-color-typo-disabled":
|
|
117
|
+
"text-fm-color-typo-primary": !C.value,
|
|
118
|
+
"text-fm-color-typo-disabled": C.value
|
|
118
119
|
})
|
|
119
120
|
}, null, 34), [
|
|
120
121
|
[De, i.value]
|
|
@@ -126,20 +127,20 @@ const Dt = { class: "flex flex-col" }, At = { class: "flex flex-col" }, Rt = { c
|
|
|
126
127
|
Ve(t("input", {
|
|
127
128
|
type: "text",
|
|
128
129
|
ref_key: "maxInputRef",
|
|
129
|
-
ref:
|
|
130
|
+
ref: k,
|
|
130
131
|
onFocus: r[3] || (r[3] = () => F.value = !0),
|
|
131
132
|
onBlur: r[4] || (r[4] = () => F.value = !1),
|
|
132
133
|
"onUpdate:modelValue": r[5] || (r[5] = (w) => l.value = w),
|
|
133
|
-
class:
|
|
134
|
+
class: J({
|
|
134
135
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
135
|
-
"text-fm-color-typo-primary": !
|
|
136
|
-
"text-fm-color-typo-disabled":
|
|
136
|
+
"text-fm-color-typo-primary": !C.value,
|
|
137
|
+
"text-fm-color-typo-disabled": C.value
|
|
137
138
|
})
|
|
138
139
|
}, null, 34), [
|
|
139
140
|
[De, l.value]
|
|
140
141
|
])
|
|
141
142
|
]),
|
|
142
|
-
Oe(
|
|
143
|
+
Oe(m.$slots, "append")
|
|
143
144
|
])
|
|
144
145
|
]),
|
|
145
146
|
_: 3
|
|
@@ -147,60 +148,60 @@ const Dt = { class: "flex flex-col" }, At = { class: "flex flex-col" }, Rt = { c
|
|
|
147
148
|
]),
|
|
148
149
|
c(f, {
|
|
149
150
|
class: "flex-1",
|
|
150
|
-
"model-value":
|
|
151
|
-
info:
|
|
151
|
+
"model-value": m.modelValue,
|
|
152
|
+
info: m.labelInfo,
|
|
152
153
|
rules: E.value,
|
|
153
|
-
"helper-text":
|
|
154
|
-
"helper-state":
|
|
154
|
+
"helper-text": m.helperText,
|
|
155
|
+
"helper-state": m.helperState
|
|
155
156
|
}, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
|
|
156
157
|
]);
|
|
157
158
|
};
|
|
158
159
|
}
|
|
159
160
|
});
|
|
160
|
-
function Ut({ min: y, max:
|
|
161
|
-
return function(
|
|
162
|
-
return !
|
|
161
|
+
function Ut({ min: y, max: g } = { min: !0, max: !0 }) {
|
|
162
|
+
return function(o) {
|
|
163
|
+
return !o || !o.min && y != !1 || !o.max && g != !1 ? "Required" : !0;
|
|
163
164
|
};
|
|
164
165
|
}
|
|
165
|
-
function qt(y,
|
|
166
|
-
return function(
|
|
167
|
-
return !
|
|
166
|
+
function qt(y, g) {
|
|
167
|
+
return function(o) {
|
|
168
|
+
return !o || !o.min || !o.max ? !0 : +K(o.min) < y ? `Must be between ${y} and ${g}` : +K(o.max) > g ? `Must be between ${y} and ${g}` : !0;
|
|
168
169
|
};
|
|
169
170
|
}
|
|
170
171
|
function Nt(y) {
|
|
171
|
-
const
|
|
172
|
-
return function(
|
|
173
|
-
const
|
|
174
|
-
return !
|
|
172
|
+
const g = at(y), u = K(y);
|
|
173
|
+
return function(p) {
|
|
174
|
+
const S = !(p != null && p.min) || g(p.min) === !0, i = !(p != null && p.max) || g(p.max) === !0;
|
|
175
|
+
return !S && !i ? `Min & max must be a multiple of ${u}` : S ? i ? !0 : `Max must be a multiple of ${u}` : `Min must be a multiple of ${u}`;
|
|
175
176
|
};
|
|
176
177
|
}
|
|
177
178
|
var L = /* @__PURE__ */ ((y) => (y.Code = "Code", y.Name = "Name", y.DefaultAmount = "DefaultAmount", y.Limit = "Limit", y.Step = "Step", y.Cost = "Cost", y.Delete = "Delete", y))(L || {});
|
|
178
179
|
function zt(y) {
|
|
179
|
-
const { t:
|
|
180
|
+
const { t: g } = Y(), u = ze(), o = Je({});
|
|
180
181
|
ce(() => {
|
|
181
182
|
for (const i of y.items) {
|
|
182
183
|
if (!i.totalCost)
|
|
183
184
|
continue;
|
|
184
|
-
const l =
|
|
185
|
+
const l = $t(i.sku, i.quantity, i.measurement, {
|
|
185
186
|
supplier: y.supplier
|
|
186
|
-
}),
|
|
187
|
-
l ?
|
|
187
|
+
}), d = i.totalCost ?? Ae.reset();
|
|
188
|
+
l ? o[i.sku._id] = l.amount !== d.amount || l.precision !== d.precision : o[i.sku._id] = !0;
|
|
188
189
|
}
|
|
189
190
|
});
|
|
190
|
-
const
|
|
191
|
+
const p = [
|
|
191
192
|
{
|
|
192
193
|
id: "Code",
|
|
193
|
-
header: () =>
|
|
194
|
+
header: () => g("inventory.transfer.form.items.table.Code"),
|
|
194
195
|
accessorKey: "code",
|
|
195
196
|
size: 180,
|
|
196
197
|
cell(i) {
|
|
197
198
|
const l = i.row.original;
|
|
198
|
-
return
|
|
199
|
+
return Z(re.FmTextField, {
|
|
199
200
|
modelValue: l.code,
|
|
200
|
-
"onUpdate:modelValue": (
|
|
201
|
+
"onUpdate:modelValue": (d) => {
|
|
201
202
|
y.updateItem({
|
|
202
203
|
...l,
|
|
203
|
-
code:
|
|
204
|
+
code: d
|
|
204
205
|
});
|
|
205
206
|
},
|
|
206
207
|
key: l.sku._id,
|
|
@@ -212,16 +213,16 @@ function zt(y) {
|
|
|
212
213
|
},
|
|
213
214
|
{
|
|
214
215
|
id: "Name",
|
|
215
|
-
header: () =>
|
|
216
|
+
header: () => g("inventory.transfer.form.items.table.Name"),
|
|
216
217
|
minSize: 300,
|
|
217
218
|
cell(i) {
|
|
218
219
|
const l = i.row.original;
|
|
219
|
-
return
|
|
220
|
+
return Z(re.FmTextField, {
|
|
220
221
|
modelValue: l.name,
|
|
221
|
-
"onUpdate:modelValue": (
|
|
222
|
+
"onUpdate:modelValue": (d) => {
|
|
222
223
|
y.updateItem({
|
|
223
224
|
...l,
|
|
224
|
-
name:
|
|
225
|
+
name: d
|
|
225
226
|
});
|
|
226
227
|
},
|
|
227
228
|
key: l.sku._id,
|
|
@@ -233,43 +234,43 @@ function zt(y) {
|
|
|
233
234
|
},
|
|
234
235
|
{
|
|
235
236
|
id: "DefaultAmount",
|
|
236
|
-
header: () =>
|
|
237
|
+
header: () => g("inventory.transfer.form.items.table.DefaultAmount"),
|
|
237
238
|
minSize: 200,
|
|
238
239
|
cell(i) {
|
|
239
240
|
var v;
|
|
240
|
-
const l = i.row.original,
|
|
241
|
-
var
|
|
242
|
-
return ((
|
|
243
|
-
}),
|
|
244
|
-
return
|
|
241
|
+
const l = i.row.original, d = He(), x = d.skuById[l.sku._id], C = d.unitById[(v = x.unit) == null ? void 0 : v._id], V = C.measurements.find((F) => {
|
|
242
|
+
var M;
|
|
243
|
+
return ((M = l.measurement) == null ? void 0 : M.id) === F.id;
|
|
244
|
+
}), k = l.sku.unit._id !== x.unit._id || !C || l.measurement && !V;
|
|
245
|
+
return Z(Ft, {
|
|
245
246
|
style: {
|
|
246
247
|
flex: "1 1 0%"
|
|
247
248
|
},
|
|
248
249
|
modelValue: {
|
|
249
250
|
amount: l.quantity ?? { amount: 1, precision: 0 },
|
|
250
251
|
// NOTE: leave this reading from row.sku.unit and row.measurement instead,
|
|
251
|
-
measurement: l.measurement ?? (l.sku.unit._id !==
|
|
252
|
+
measurement: l.measurement ?? (l.sku.unit._id !== x.unit._id ? { ...l.sku.unit, id: "", conversion: { amount: 1, precision: 0 } } : null)
|
|
252
253
|
},
|
|
253
254
|
disabled: y.disabled,
|
|
254
255
|
key: l.sku._id,
|
|
255
|
-
unit:
|
|
256
|
+
unit: C,
|
|
256
257
|
"onUpdate:modelValue": (F) => {
|
|
257
258
|
var E;
|
|
258
|
-
let
|
|
259
|
+
let M = l.code;
|
|
259
260
|
if (u.isEnabled) {
|
|
260
|
-
const
|
|
261
|
-
|
|
261
|
+
const m = u.getItemPKTCode(x, (E = F.measurement) == null ? void 0 : E.id);
|
|
262
|
+
m && (M = m);
|
|
262
263
|
}
|
|
263
264
|
y.updateItem({
|
|
264
265
|
...l,
|
|
265
|
-
code:
|
|
266
|
-
sku:
|
|
266
|
+
code: M,
|
|
267
|
+
sku: x,
|
|
267
268
|
quantity: F.amount,
|
|
268
269
|
measurement: F.measurement
|
|
269
270
|
});
|
|
270
271
|
},
|
|
271
272
|
rules: [
|
|
272
|
-
|
|
273
|
+
wt(l.quantityStep),
|
|
273
274
|
...+K(l.quantity) ? [
|
|
274
275
|
St(
|
|
275
276
|
+K(
|
|
@@ -281,11 +282,11 @@ function zt(y) {
|
|
|
281
282
|
)
|
|
282
283
|
)
|
|
283
284
|
] : [],
|
|
284
|
-
|
|
285
|
+
Ct(
|
|
285
286
|
l.maximumQuantity ? +K(l.maximumQuantity) : 1 / 0
|
|
286
287
|
),
|
|
287
|
-
function(
|
|
288
|
-
return
|
|
288
|
+
function(M) {
|
|
289
|
+
return k ? "This item is no longer valid due to change in unit. Please reapply unit." : !0;
|
|
289
290
|
}
|
|
290
291
|
],
|
|
291
292
|
applyDefaultRules: !0
|
|
@@ -300,7 +301,7 @@ function zt(y) {
|
|
|
300
301
|
minSize: 280,
|
|
301
302
|
cell(i) {
|
|
302
303
|
const l = i.row.original;
|
|
303
|
-
return
|
|
304
|
+
return Z(Et, {
|
|
304
305
|
style: {
|
|
305
306
|
flex: "1 1 0%"
|
|
306
307
|
},
|
|
@@ -311,9 +312,9 @@ function zt(y) {
|
|
|
311
312
|
disabled: y.disabled,
|
|
312
313
|
key: l.sku._id,
|
|
313
314
|
unit: l.sku.unit,
|
|
314
|
-
"onUpdate:modelValue": (
|
|
315
|
-
const
|
|
316
|
-
|
|
315
|
+
"onUpdate:modelValue": (d) => {
|
|
316
|
+
const x = { ...l };
|
|
317
|
+
d != null && d.min ? x.minimumQuantity = d.min : x.minimumQuantity = null, d != null && d.max ? x.maximumQuantity = d.max : x.maximumQuantity = null, y.updateItem(x);
|
|
317
318
|
},
|
|
318
319
|
rules: [
|
|
319
320
|
Ut({ max: !1 }),
|
|
@@ -333,17 +334,17 @@ function zt(y) {
|
|
|
333
334
|
},
|
|
334
335
|
{
|
|
335
336
|
id: "Step",
|
|
336
|
-
header: () =>
|
|
337
|
+
header: () => g("inventory.transfer.form.items.table.Step"),
|
|
337
338
|
minSize: 100,
|
|
338
339
|
cell(i) {
|
|
339
340
|
const l = i.row.original;
|
|
340
|
-
return
|
|
341
|
-
modelValue: K(l.quantityStep ??
|
|
341
|
+
return Z(re.FmTextField, {
|
|
342
|
+
modelValue: K(l.quantityStep ?? Ae.reset(), !1),
|
|
342
343
|
key: l.sku._id,
|
|
343
|
-
"onUpdate:modelValue": (
|
|
344
|
+
"onUpdate:modelValue": (d) => {
|
|
344
345
|
y.updateItem({
|
|
345
346
|
...l,
|
|
346
|
-
quantityStep: rt(+
|
|
347
|
+
quantityStep: rt(+d)
|
|
347
348
|
});
|
|
348
349
|
},
|
|
349
350
|
rules: [
|
|
@@ -362,7 +363,7 @@ function zt(y) {
|
|
|
362
363
|
header: "",
|
|
363
364
|
cell(i) {
|
|
364
365
|
const l = i.row.original;
|
|
365
|
-
return
|
|
366
|
+
return Z(re.FmButton, {
|
|
366
367
|
class: "delete-button",
|
|
367
368
|
key: l.sku._id,
|
|
368
369
|
type: "button",
|
|
@@ -384,87 +385,87 @@ function zt(y) {
|
|
|
384
385
|
}
|
|
385
386
|
];
|
|
386
387
|
return {
|
|
387
|
-
columnDefs: R(() => je().enableTotalCost && y.transferType === H.PURCHASE ?
|
|
388
|
+
columnDefs: R(() => je().enableTotalCost && y.transferType === H.PURCHASE ? p : p.filter((l) => l.id !== "Cost"))
|
|
388
389
|
};
|
|
389
390
|
}
|
|
390
|
-
const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-center" }, Qt = { class: "flex-1 flex gap-1 items-center" }, Kt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Gt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Wt = { class: "flex gap-8 w-full" },
|
|
391
|
+
const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-center" }, Qt = { class: "flex-1 flex gap-1 items-center" }, Kt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Gt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Wt = { class: "flex gap-8 w-full" }, Zt = { class: "flex-1 flex flex-col gap-4" }, Jt = { class: "flex-1 flex flex-col gap-4" }, Xt = { class: "flex gap-8 w-full" }, Yt = { class: "flex-1 flex flex-col gap-4" }, eo = { class: "flex-1 flex flex-col gap-4" }, to = { class: "flex gap-8 w-full" }, oo = { class: "flex-1 flex flex-col gap-4" }, so = /* @__PURE__ */ X({
|
|
391
392
|
__name: "TransferTemplateItem",
|
|
392
393
|
props: {
|
|
393
394
|
cellByColId: {},
|
|
394
395
|
row: {}
|
|
395
396
|
},
|
|
396
397
|
setup(y) {
|
|
397
|
-
const { t:
|
|
398
|
-
return (u,
|
|
399
|
-
var
|
|
400
|
-
const
|
|
401
|
-
return
|
|
398
|
+
const { t: g } = Y();
|
|
399
|
+
return (u, o) => {
|
|
400
|
+
var S, i, l, d, x, C, V, k, v, F, M, E, m, r, T, a, f, w, s, n, A, I, _, b, P, q, z, j, h, N;
|
|
401
|
+
const p = O("FmLabel");
|
|
402
|
+
return D(), G("div", Ht, [
|
|
402
403
|
t("div", jt, [
|
|
403
404
|
t("div", Qt, [
|
|
404
|
-
t("span", Kt, " (" +
|
|
405
|
-
t("span", Gt,
|
|
405
|
+
t("span", Kt, " (" + $(u.row.original.sku.code) + ") ", 1),
|
|
406
|
+
t("span", Gt, $(u.row.original.sku.name), 1)
|
|
406
407
|
]),
|
|
407
408
|
t("div", null, [
|
|
408
409
|
c(e(Q), {
|
|
409
|
-
render: (l = (i = (
|
|
410
|
-
props: (
|
|
410
|
+
render: (l = (i = (S = u.cellByColId.Delete) == null ? void 0 : S.column) == null ? void 0 : i.columnDef) == null ? void 0 : l.cell,
|
|
411
|
+
props: (x = (d = u.cellByColId.Delete) == null ? void 0 : d.getContext) == null ? void 0 : x.call(d)
|
|
411
412
|
}, null, 8, ["render", "props"])
|
|
412
413
|
])
|
|
413
414
|
]),
|
|
414
415
|
t("div", Wt, [
|
|
415
|
-
t("div",
|
|
416
|
-
c(
|
|
417
|
-
label: e(
|
|
416
|
+
t("div", Zt, [
|
|
417
|
+
c(p, {
|
|
418
|
+
label: e(g)(`inventory.transfer.form.items.table.${e(L).Code}`)
|
|
418
419
|
}, null, 8, ["label"]),
|
|
419
420
|
c(e(Q), {
|
|
420
|
-
render: (
|
|
421
|
+
render: (k = (V = (C = u.cellByColId[e(L).Code]) == null ? void 0 : C.column) == null ? void 0 : V.columnDef) == null ? void 0 : k.cell,
|
|
421
422
|
props: (F = (v = u.cellByColId[e(L).Code]) == null ? void 0 : v.getContext) == null ? void 0 : F.call(v)
|
|
422
423
|
}, null, 8, ["render", "props"]),
|
|
423
|
-
|
|
424
|
+
o[0] || (o[0] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
424
425
|
]),
|
|
425
|
-
t("div",
|
|
426
|
-
c(
|
|
427
|
-
label: e(
|
|
426
|
+
t("div", Jt, [
|
|
427
|
+
c(p, {
|
|
428
|
+
label: e(g)(`inventory.transfer.form.items.table.${e(L).Name}`)
|
|
428
429
|
}, null, 8, ["label"]),
|
|
429
430
|
c(e(Q), {
|
|
430
|
-
render: (
|
|
431
|
-
props: (
|
|
431
|
+
render: (m = (E = (M = u.cellByColId[e(L).Name]) == null ? void 0 : M.column) == null ? void 0 : E.columnDef) == null ? void 0 : m.cell,
|
|
432
|
+
props: (T = (r = u.cellByColId[e(L).Name]) == null ? void 0 : r.getContext) == null ? void 0 : T.call(r)
|
|
432
433
|
}, null, 8, ["render", "props"]),
|
|
433
|
-
|
|
434
|
+
o[1] || (o[1] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
434
435
|
])
|
|
435
436
|
]),
|
|
436
437
|
t("div", Xt, [
|
|
437
438
|
t("div", Yt, [
|
|
438
|
-
c(
|
|
439
|
-
label: e(
|
|
439
|
+
c(p, {
|
|
440
|
+
label: e(g)(`inventory.transfer.form.items.table.${e(L).DefaultAmount}`)
|
|
440
441
|
}, null, 8, ["label"]),
|
|
441
442
|
c(e(Q), {
|
|
442
443
|
render: (w = (f = (a = u.cellByColId[e(L).DefaultAmount]) == null ? void 0 : a.column) == null ? void 0 : f.columnDef) == null ? void 0 : w.cell,
|
|
443
|
-
props: (n = (
|
|
444
|
+
props: (n = (s = u.cellByColId[e(L).DefaultAmount]) == null ? void 0 : s.getContext) == null ? void 0 : n.call(s)
|
|
444
445
|
}, null, 8, ["render", "props"]),
|
|
445
|
-
|
|
446
|
+
o[2] || (o[2] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
446
447
|
]),
|
|
447
448
|
t("div", eo, [
|
|
448
|
-
c(
|
|
449
|
-
label: e(
|
|
449
|
+
c(p, {
|
|
450
|
+
label: e(g)(`inventory.transfer.form.items.table.${e(L).Step}`)
|
|
450
451
|
}, null, 8, ["label"]),
|
|
451
452
|
c(e(Q), {
|
|
452
|
-
render: (
|
|
453
|
-
props: (P = (
|
|
453
|
+
render: (_ = (I = (A = u.cellByColId[e(L).Step]) == null ? void 0 : A.column) == null ? void 0 : I.columnDef) == null ? void 0 : _.cell,
|
|
454
|
+
props: (P = (b = u.cellByColId[e(L).Step]) == null ? void 0 : b.getContext) == null ? void 0 : P.call(b)
|
|
454
455
|
}, null, 8, ["render", "props"]),
|
|
455
|
-
|
|
456
|
+
o[3] || (o[3] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
456
457
|
])
|
|
457
458
|
]),
|
|
458
459
|
t("div", to, [
|
|
459
460
|
t("div", oo, [
|
|
460
|
-
c(
|
|
461
|
-
label: e(
|
|
461
|
+
c(p, {
|
|
462
|
+
label: e(g)(`inventory.transfer.form.items.table.${e(L).Limit}`)
|
|
462
463
|
}, null, 8, ["label"]),
|
|
463
464
|
c(e(Q), {
|
|
464
465
|
render: (j = (z = (q = u.cellByColId[e(L).Limit]) == null ? void 0 : q.column) == null ? void 0 : z.columnDef) == null ? void 0 : j.cell,
|
|
465
|
-
props: (N = (
|
|
466
|
+
props: (N = (h = u.cellByColId[e(L).Limit]) == null ? void 0 : h.getContext) == null ? void 0 : N.call(h)
|
|
466
467
|
}, null, 8, ["render", "props"]),
|
|
467
|
-
|
|
468
|
+
o[4] || (o[4] = t("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
468
469
|
])
|
|
469
470
|
])
|
|
470
471
|
]);
|
|
@@ -476,97 +477,97 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
476
477
|
modelValue: {},
|
|
477
478
|
disabled: { type: Boolean }
|
|
478
479
|
},
|
|
479
|
-
setup(y, { expose:
|
|
480
|
-
const u = y,
|
|
480
|
+
setup(y, { expose: g }) {
|
|
481
|
+
const u = y, o = Ne(), { t: p } = Y(), S = Qe(), i = He(), l = Ot(), d = ze();
|
|
481
482
|
pe(
|
|
482
483
|
() => u.modelValue,
|
|
483
|
-
(
|
|
484
|
-
console.log("TransferTemplateForm.model",
|
|
484
|
+
(s) => {
|
|
485
|
+
console.log("TransferTemplateForm.model", s);
|
|
485
486
|
}
|
|
486
|
-
),
|
|
487
|
-
location && (
|
|
488
|
-
});
|
|
489
|
-
const
|
|
490
|
-
() =>
|
|
491
|
-
(
|
|
492
|
-
|
|
493
|
-
...
|
|
494
|
-
supplier:
|
|
487
|
+
), S.watchLocation(async () => {
|
|
488
|
+
location && (o.purchaseOrder.supplier || (o.purchaseOrder.supplier = l.suppliers.find((s) => s) ?? o.purchaseOrder.supplier));
|
|
489
|
+
}), gt();
|
|
490
|
+
const x = Mt(
|
|
491
|
+
() => o.purchaseOrder,
|
|
492
|
+
(s) => {
|
|
493
|
+
o.purchaseOrder = {
|
|
494
|
+
...o.purchaseOrder,
|
|
495
|
+
supplier: s.supplier ?? (o == null ? void 0 : o.purchaseOrder.supplier)
|
|
495
496
|
};
|
|
496
497
|
}
|
|
497
|
-
),
|
|
498
|
+
), C = R({
|
|
498
499
|
get() {
|
|
499
|
-
var
|
|
500
|
-
return typeof ((n = (
|
|
500
|
+
var s, n;
|
|
501
|
+
return typeof ((n = (s = o.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : n.internal) == "string" ? H.TRANSFER : H.PURCHASE;
|
|
501
502
|
},
|
|
502
|
-
set(
|
|
503
|
-
var
|
|
504
|
-
const n = typeof ((
|
|
505
|
-
|
|
503
|
+
set(s) {
|
|
504
|
+
var A, I;
|
|
505
|
+
const n = typeof ((I = (A = o.purchaseOrder) == null ? void 0 : A.supplier) == null ? void 0 : I.internal) == "string" ? H.TRANSFER : H.PURCHASE;
|
|
506
|
+
s !== n && (o.purchaseOrder.supplier = s === H.PURCHASE ? x.locationOptionsTypePurchase.value[0] : x.locationOptionsTypeTransfer.value[0]);
|
|
506
507
|
}
|
|
507
|
-
}),
|
|
508
|
+
}), V = R(() => x.transferLocationOptions.value), k = R({
|
|
508
509
|
get() {
|
|
509
|
-
var
|
|
510
|
-
return (
|
|
510
|
+
var s;
|
|
511
|
+
return (s = o.purchaseOrder.supplier) == null ? void 0 : s._id;
|
|
511
512
|
},
|
|
512
|
-
set(
|
|
513
|
-
|
|
513
|
+
set(s) {
|
|
514
|
+
x.transferLocationModel.value = s;
|
|
514
515
|
}
|
|
515
516
|
}), {
|
|
516
|
-
promptSelectLocations:
|
|
517
|
-
columnDefs:
|
|
518
|
-
rowData:
|
|
517
|
+
promptSelectLocations: v,
|
|
518
|
+
columnDefs: F,
|
|
519
|
+
rowData: M
|
|
519
520
|
} = ut({
|
|
520
521
|
getLocations() {
|
|
521
|
-
return
|
|
522
|
+
return o.locations;
|
|
522
523
|
},
|
|
523
|
-
setLocations(
|
|
524
|
-
|
|
524
|
+
setLocations(s) {
|
|
525
|
+
o.locations = s;
|
|
525
526
|
}
|
|
526
527
|
});
|
|
527
|
-
function
|
|
528
|
-
var
|
|
529
|
-
return (
|
|
530
|
-
var
|
|
531
|
-
return ((
|
|
532
|
-
}) ? `Location ${(n =
|
|
528
|
+
function E() {
|
|
529
|
+
var s, n;
|
|
530
|
+
return (s = o.locations) != null && s.find((A) => {
|
|
531
|
+
var I, _;
|
|
532
|
+
return ((I = A.doc) == null ? void 0 : I._id) === ((_ = o.purchaseOrder.supplier) == null ? void 0 : _._id);
|
|
533
|
+
}) ? `Location ${(n = o.purchaseOrder.supplier) == null ? void 0 : n.name} must be removed because template cannot be used to transfer to itself.` : !0;
|
|
533
534
|
}
|
|
534
|
-
const
|
|
535
|
+
const m = R({
|
|
535
536
|
get() {
|
|
536
|
-
return
|
|
537
|
+
return o.purchaseOrder.remark ?? void 0;
|
|
537
538
|
},
|
|
538
|
-
set(
|
|
539
|
-
|
|
539
|
+
set(s) {
|
|
540
|
+
o.purchaseOrder.remark = s;
|
|
540
541
|
}
|
|
541
|
-
}),
|
|
542
|
-
|
|
542
|
+
}), r = U();
|
|
543
|
+
g({
|
|
543
544
|
validateInputs: () => {
|
|
544
|
-
var
|
|
545
|
-
(n = (
|
|
545
|
+
var s, n;
|
|
546
|
+
(n = (s = r.value) == null ? void 0 : s.validateInputs) == null || n.call(s);
|
|
546
547
|
},
|
|
547
548
|
resetInputsValidation: () => {
|
|
548
|
-
var
|
|
549
|
-
(n = (
|
|
549
|
+
var s, n;
|
|
550
|
+
(n = (s = r.value) == null ? void 0 : s.resetInputsValidation) == null || n.call(s);
|
|
550
551
|
},
|
|
551
552
|
resetInputs: () => {
|
|
552
|
-
var
|
|
553
|
-
(n = (
|
|
553
|
+
var s, n;
|
|
554
|
+
(n = (s = r.value) == null ? void 0 : s.resetInputs) == null || n.call(s);
|
|
554
555
|
}
|
|
555
556
|
});
|
|
556
|
-
const
|
|
557
|
-
updateItem: (
|
|
558
|
-
|
|
557
|
+
const T = zt({
|
|
558
|
+
updateItem: (s) => {
|
|
559
|
+
o.purchaseOrder.items = o.purchaseOrder.items.map((n) => n.sku._id !== s.sku._id ? n : s);
|
|
559
560
|
},
|
|
560
|
-
deleteItem: (
|
|
561
|
-
|
|
562
|
-
(n) => n.sku._id !==
|
|
561
|
+
deleteItem: (s) => {
|
|
562
|
+
o.purchaseOrder.items = o.purchaseOrder.items.filter(
|
|
563
|
+
(n) => n.sku._id !== s.sku._id
|
|
563
564
|
);
|
|
564
565
|
},
|
|
565
566
|
get supplier() {
|
|
566
|
-
return
|
|
567
|
+
return o.purchaseOrder.supplier;
|
|
567
568
|
},
|
|
568
569
|
get items() {
|
|
569
|
-
return
|
|
570
|
+
return o.purchaseOrder.items;
|
|
570
571
|
},
|
|
571
572
|
get transferType() {
|
|
572
573
|
return H.PURCHASE;
|
|
@@ -574,172 +575,154 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
574
575
|
get disabled() {
|
|
575
576
|
return u.disabled;
|
|
576
577
|
}
|
|
577
|
-
}),
|
|
578
|
-
function w() {
|
|
579
|
-
const
|
|
580
|
-
label:
|
|
581
|
-
sublabel:
|
|
582
|
-
value:
|
|
583
|
-
}))
|
|
584
|
-
var
|
|
585
|
-
return (
|
|
586
|
-
}).map((
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
contentComponent: mt,
|
|
591
|
-
contentComponentProps: {
|
|
592
|
-
modelValue: n,
|
|
593
|
-
items: o,
|
|
594
|
-
virtualScroll: !0
|
|
595
|
-
},
|
|
596
|
-
primaryActions: {
|
|
597
|
-
text: d("common.confirm"),
|
|
598
|
-
close: !0
|
|
599
|
-
},
|
|
600
|
-
secondaryActions: {
|
|
601
|
-
text: d("common.close"),
|
|
602
|
-
close: !0,
|
|
603
|
-
variant: "tertiary"
|
|
604
|
-
}
|
|
605
|
-
}).onPrimary((S) => {
|
|
606
|
-
const M = s.purchaseOrder.items ?? [], $ = S.map((h) => {
|
|
607
|
-
const P = M.find((x) => x.sku._id === h._id);
|
|
578
|
+
}), a = R(() => T.columnDefs.value), { promptSelectIngredients: f } = Vt();
|
|
579
|
+
async function w() {
|
|
580
|
+
const n = i.skus.map((_) => ({
|
|
581
|
+
label: _.name,
|
|
582
|
+
sublabel: _.code,
|
|
583
|
+
value: _
|
|
584
|
+
})).filter((_) => {
|
|
585
|
+
var b;
|
|
586
|
+
return (b = o.purchaseOrder.items) == null ? void 0 : b.find((P) => P.sku._id === _.value._id);
|
|
587
|
+
}).map((_) => _.value), A = o.purchaseOrder.items ?? [], I = await f(
|
|
588
|
+
n.map((_) => _._id),
|
|
589
|
+
(_) => {
|
|
590
|
+
const b = i.skuById[_], P = A.find((h) => h.sku._id === b._id);
|
|
608
591
|
if (P)
|
|
609
592
|
return P;
|
|
610
|
-
let q =
|
|
611
|
-
if (
|
|
612
|
-
const
|
|
613
|
-
|
|
593
|
+
let q = b.code;
|
|
594
|
+
if (d.isEnabled) {
|
|
595
|
+
const h = d.getItemPKTCode(b);
|
|
596
|
+
h && (q = h);
|
|
614
597
|
}
|
|
615
|
-
const z = { amount: 1, precision: ie(
|
|
598
|
+
const z = { amount: 1, precision: ie(b.unit) };
|
|
616
599
|
return {
|
|
617
|
-
sku:
|
|
600
|
+
sku: b,
|
|
618
601
|
code: q,
|
|
619
|
-
name:
|
|
602
|
+
name: b.name,
|
|
620
603
|
quantity: z,
|
|
621
604
|
minimumQuantity: z,
|
|
622
|
-
maximumQuantity:
|
|
605
|
+
maximumQuantity: mt(z, {
|
|
623
606
|
amount: 100,
|
|
624
607
|
precision: 0
|
|
625
608
|
}),
|
|
626
609
|
quantityStep: z
|
|
627
610
|
};
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
|
|
611
|
+
}
|
|
612
|
+
);
|
|
613
|
+
I && (I.sort((_, b) => _.sku.code.localeCompare(b.sku.code)), o.purchaseOrder.items = I);
|
|
631
614
|
}
|
|
632
|
-
return (
|
|
633
|
-
const
|
|
634
|
-
return
|
|
615
|
+
return (s, n) => {
|
|
616
|
+
const A = O("FmTextField"), I = O("FmSelect"), _ = O("FmTextarea"), b = O("FmButton"), P = O("FmTable"), q = O("FmFormGroup"), z = O("FmForm");
|
|
617
|
+
return D(), W(z, {
|
|
635
618
|
ref_key: "formRef",
|
|
636
|
-
ref:
|
|
619
|
+
ref: r,
|
|
637
620
|
class: "flex flex-col gap-32",
|
|
638
|
-
disabled:
|
|
621
|
+
disabled: s.disabled
|
|
639
622
|
}, {
|
|
640
623
|
default: B(() => {
|
|
641
624
|
var j;
|
|
642
625
|
return [
|
|
643
626
|
t("div", lo, [
|
|
644
627
|
t("div", no, [
|
|
645
|
-
c(
|
|
646
|
-
label: e(
|
|
628
|
+
c(A, {
|
|
629
|
+
label: e(p)("inventory.transfer.form.name"),
|
|
647
630
|
"label-mark": "required",
|
|
648
|
-
modelValue: e(
|
|
649
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
631
|
+
modelValue: e(o).name,
|
|
632
|
+
"onUpdate:modelValue": n[0] || (n[0] = (h) => e(o).name = h),
|
|
650
633
|
rules: [e(de)()]
|
|
651
634
|
}, null, 8, ["label", "modelValue", "rules"]),
|
|
652
|
-
c(
|
|
653
|
-
label: e(
|
|
654
|
-
"model-value":
|
|
655
|
-
"onUpdate:modelValue": n[1] || (n[1] = (
|
|
635
|
+
c(I, {
|
|
636
|
+
label: e(p)("inventory.transfer.form.type.title"),
|
|
637
|
+
"model-value": C.value,
|
|
638
|
+
"onUpdate:modelValue": n[1] || (n[1] = (h) => C.value = h),
|
|
656
639
|
items: [
|
|
657
640
|
{
|
|
658
|
-
label: e(
|
|
641
|
+
label: e(p)("inventory.transfer.form.type.purchase"),
|
|
659
642
|
value: e(H).PURCHASE,
|
|
660
|
-
disabled: !e(
|
|
661
|
-
sublabel: e(
|
|
643
|
+
disabled: !e(x).locationOptionsTypePurchase.value.length,
|
|
644
|
+
sublabel: e(x).locationOptionsTypePurchase.value.length ? void 0 : e(p)("inventory.transfer.form.noSupplierAvailable")
|
|
662
645
|
},
|
|
663
646
|
{
|
|
664
|
-
label: e(
|
|
647
|
+
label: e(p)("inventory.transfer.form.type.transfer"),
|
|
665
648
|
value: e(H).TRANSFER,
|
|
666
|
-
disabled: !e(
|
|
667
|
-
sublabel: e(
|
|
649
|
+
disabled: !e(x).locationOptionsTypeTransfer.value.length,
|
|
650
|
+
sublabel: e(x).locationOptionsTypeTransfer.value.length ? void 0 : e(p)("inventory.transfer.form.noLocationAvailable")
|
|
668
651
|
}
|
|
669
652
|
],
|
|
670
|
-
rules: [e(me)(1)(
|
|
653
|
+
rules: [e(me)(1)(V.value)]
|
|
671
654
|
}, {
|
|
672
655
|
default: B(() => [
|
|
673
656
|
t("span", {
|
|
674
|
-
class:
|
|
657
|
+
class: J([
|
|
675
658
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
676
|
-
|
|
659
|
+
s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
677
660
|
])
|
|
678
|
-
},
|
|
661
|
+
}, $(e(dt)(C.value)), 3)
|
|
679
662
|
]),
|
|
680
663
|
_: 1
|
|
681
664
|
}, 8, ["label", "model-value", "items", "rules"]),
|
|
682
|
-
c(
|
|
683
|
-
label:
|
|
684
|
-
modelValue:
|
|
685
|
-
"onUpdate:modelValue": n[2] || (n[2] = (
|
|
686
|
-
items:
|
|
665
|
+
c(I, {
|
|
666
|
+
label: C.value === e(H).PURCHASE ? e(p)("inventory.transfer.form.purchaseFrom") : e(p)("inventory.transfer.form.transferFrom"),
|
|
667
|
+
modelValue: k.value,
|
|
668
|
+
"onUpdate:modelValue": n[2] || (n[2] = (h) => k.value = h),
|
|
669
|
+
items: V.value
|
|
687
670
|
}, {
|
|
688
|
-
"menu-wrapper": B((
|
|
671
|
+
"menu-wrapper": B((h) => {
|
|
689
672
|
var N;
|
|
690
673
|
return [
|
|
691
|
-
c(
|
|
692
|
-
items:
|
|
693
|
-
"model-value": (N =
|
|
674
|
+
c(It, Ee(h, {
|
|
675
|
+
items: V.value,
|
|
676
|
+
"model-value": (N = s.modelValue.purchaseOrder.supplier) == null ? void 0 : N._id
|
|
694
677
|
}), null, 16, ["items", "model-value"])
|
|
695
678
|
];
|
|
696
679
|
}),
|
|
697
680
|
default: B(() => {
|
|
698
|
-
var
|
|
681
|
+
var h;
|
|
699
682
|
return [
|
|
700
683
|
t("span", {
|
|
701
|
-
class:
|
|
684
|
+
class: J([
|
|
702
685
|
"line-clamp-1 fm-typo-en-body-lg-400",
|
|
703
|
-
|
|
686
|
+
s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
704
687
|
])
|
|
705
|
-
},
|
|
688
|
+
}, $((h = V.value.find((N) => N.value === k.value)) == null ? void 0 : h.label), 3)
|
|
706
689
|
];
|
|
707
690
|
}),
|
|
708
691
|
_: 1
|
|
709
692
|
}, 8, ["label", "modelValue", "items"]),
|
|
710
|
-
c(
|
|
711
|
-
label: e(
|
|
693
|
+
c(A, {
|
|
694
|
+
label: e(p)("inventory.transfer.form.reference"),
|
|
712
695
|
"label-mark": "optional",
|
|
713
|
-
modelValue: e(
|
|
714
|
-
"onUpdate:modelValue": n[3] || (n[3] = (
|
|
696
|
+
modelValue: e(o).purchaseOrder.ref,
|
|
697
|
+
"onUpdate:modelValue": n[3] || (n[3] = (h) => e(o).purchaseOrder.ref = h)
|
|
715
698
|
}, null, 8, ["label", "modelValue"]),
|
|
716
|
-
c(
|
|
717
|
-
label: e(
|
|
699
|
+
c(_, {
|
|
700
|
+
label: e(p)("inventory.transfer.form.remark"),
|
|
718
701
|
"label-mark": "optional",
|
|
719
702
|
"max-length": 240,
|
|
720
|
-
modelValue:
|
|
721
|
-
"onUpdate:modelValue": n[4] || (n[4] = (
|
|
722
|
-
class:
|
|
703
|
+
modelValue: m.value,
|
|
704
|
+
"onUpdate:modelValue": n[4] || (n[4] = (h) => m.value = h),
|
|
705
|
+
class: J({ "text-fm-color-typo-disabled": s.disabled })
|
|
723
706
|
}, null, 8, ["label", "modelValue", "class"])
|
|
724
707
|
])
|
|
725
708
|
]),
|
|
726
709
|
t("div", ao, [
|
|
727
710
|
t("div", ro, [
|
|
728
711
|
n[6] || (n[6] = t("div", { class: "flex-1 fm-typo-en-title-sm-600" }, "Locations", -1)),
|
|
729
|
-
c(
|
|
730
|
-
disabled:
|
|
712
|
+
c(b, {
|
|
713
|
+
disabled: s.disabled,
|
|
731
714
|
label: "Select location",
|
|
732
715
|
"prepend-icon": "add",
|
|
733
716
|
variant: "plain",
|
|
734
717
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
735
|
-
onClick: e(
|
|
718
|
+
onClick: e(v)
|
|
736
719
|
}, null, 8, ["disabled", "onClick"])
|
|
737
720
|
]),
|
|
738
721
|
c(P, {
|
|
739
|
-
"column-defs": e(
|
|
740
|
-
"row-data": e(
|
|
722
|
+
"column-defs": e(F),
|
|
723
|
+
"row-data": e(M),
|
|
741
724
|
"shrink-at": 9999,
|
|
742
|
-
onRowClick: e(
|
|
725
|
+
onRowClick: e(v),
|
|
743
726
|
"hide-footer": ""
|
|
744
727
|
}, null, 8, ["column-defs", "row-data", "onRowClick"]),
|
|
745
728
|
t("div", io, [
|
|
@@ -748,38 +731,38 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
748
731
|
(j = u.modelValue.purchaseOrder.supplier) == null ? void 0 : j._id,
|
|
749
732
|
...u.modelValue.locations ?? []
|
|
750
733
|
].join(","),
|
|
751
|
-
rules: [
|
|
734
|
+
rules: [E]
|
|
752
735
|
}, null, 8, ["model-value", "rules"])
|
|
753
736
|
])
|
|
754
737
|
]),
|
|
755
738
|
t("div", uo, [
|
|
756
739
|
t("div", mo, [
|
|
757
|
-
t("div", co,
|
|
758
|
-
c(
|
|
759
|
-
disabled:
|
|
760
|
-
label: e(
|
|
740
|
+
t("div", co, $(e(p)("inventory.transfer.form.items.title")), 1),
|
|
741
|
+
c(b, {
|
|
742
|
+
disabled: s.disabled,
|
|
743
|
+
label: e(p)("inventory.transfer.form.items.addItem"),
|
|
761
744
|
"prepend-icon": "add",
|
|
762
745
|
variant: "plain",
|
|
763
746
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
764
|
-
onClick: n[5] || (n[5] = (
|
|
747
|
+
onClick: n[5] || (n[5] = (h) => w()),
|
|
765
748
|
size: "md"
|
|
766
749
|
}, null, 8, ["disabled", "label"])
|
|
767
750
|
]),
|
|
768
|
-
(
|
|
769
|
-
"column-defs":
|
|
770
|
-
"row-data": e(
|
|
771
|
-
key: e(
|
|
751
|
+
(D(), W(P, {
|
|
752
|
+
"column-defs": a.value,
|
|
753
|
+
"row-data": e(o).purchaseOrder.items,
|
|
754
|
+
key: e(o).purchaseOrder.items.map((h) => h.sku._id).join("."),
|
|
772
755
|
"hide-footer": "",
|
|
773
|
-
"page-size": e(
|
|
756
|
+
"page-size": e(o).purchaseOrder.items.length
|
|
774
757
|
}, {
|
|
775
|
-
"list-row": B((
|
|
776
|
-
(
|
|
777
|
-
row:
|
|
778
|
-
key: e(
|
|
758
|
+
"list-row": B((h) => [
|
|
759
|
+
(D(), W(Ke, {
|
|
760
|
+
row: h,
|
|
761
|
+
key: e(o).purchaseOrder.items.map((N) => N.sku._id).join(".")
|
|
779
762
|
}, {
|
|
780
763
|
default: B((N) => [
|
|
781
764
|
c(so, {
|
|
782
|
-
row:
|
|
765
|
+
row: h,
|
|
783
766
|
"cell-by-col-id": N
|
|
784
767
|
}, null, 8, ["row", "cell-by-col-id"])
|
|
785
768
|
]),
|
|
@@ -789,7 +772,7 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
789
772
|
_: 1
|
|
790
773
|
}, 8, ["column-defs", "row-data", "page-size"])),
|
|
791
774
|
c(q, {
|
|
792
|
-
"model-value": e(
|
|
775
|
+
"model-value": e(o).purchaseOrder.items.length,
|
|
793
776
|
rules: [e(me)(1)]
|
|
794
777
|
}, null, 8, ["model-value", "rules"])
|
|
795
778
|
])
|
|
@@ -807,10 +790,10 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
807
790
|
show: { type: Boolean }
|
|
808
791
|
},
|
|
809
792
|
emits: ["update:show", "submitted"],
|
|
810
|
-
setup(y, { expose:
|
|
811
|
-
var
|
|
812
|
-
const
|
|
813
|
-
function
|
|
793
|
+
setup(y, { expose: g, emit: u }) {
|
|
794
|
+
var T;
|
|
795
|
+
const o = y, p = u, S = bt(), i = Tt(), { t: l } = Y(), d = Ge(o, "show");
|
|
796
|
+
function x() {
|
|
814
797
|
return {
|
|
815
798
|
_id: "",
|
|
816
799
|
name: "",
|
|
@@ -840,16 +823,16 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
840
823
|
}
|
|
841
824
|
};
|
|
842
825
|
}
|
|
843
|
-
const
|
|
826
|
+
const C = U(o.modelValue ?? x()), V = U(((T = o.modelValue) == null ? void 0 : T._id) ?? `${Math.random()}`);
|
|
844
827
|
pe(
|
|
845
|
-
() =>
|
|
828
|
+
() => o.show,
|
|
846
829
|
(a) => {
|
|
847
830
|
var f;
|
|
848
|
-
a && (
|
|
831
|
+
a && (C.value = o.modelValue ?? x(), V.value = ((f = o.modelValue) == null ? void 0 : f._id) ?? `${Math.random()}`);
|
|
849
832
|
}
|
|
850
833
|
);
|
|
851
|
-
const
|
|
852
|
-
switch (
|
|
834
|
+
const k = U(!1), v = R(() => {
|
|
835
|
+
switch (o.mode) {
|
|
853
836
|
case te.READ:
|
|
854
837
|
return "";
|
|
855
838
|
case te.CREATE:
|
|
@@ -859,7 +842,7 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
859
842
|
}
|
|
860
843
|
return "";
|
|
861
844
|
}), F = U();
|
|
862
|
-
|
|
845
|
+
g({
|
|
863
846
|
validateInputs: () => {
|
|
864
847
|
var a, f;
|
|
865
848
|
(f = (a = F.value) == null ? void 0 : a.validateInputs) == null || f.call(a);
|
|
@@ -873,58 +856,58 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
873
856
|
(f = (a = F.value) == null ? void 0 : a.resetInputs) == null || f.call(a);
|
|
874
857
|
}
|
|
875
858
|
});
|
|
876
|
-
async function
|
|
859
|
+
async function M() {
|
|
877
860
|
var f, w;
|
|
878
|
-
const a =
|
|
861
|
+
const a = C.value;
|
|
879
862
|
if (a) {
|
|
880
|
-
|
|
881
|
-
({ totalCost:
|
|
863
|
+
k.value = !0, (((f = a.purchaseOrder.supplier) == null ? void 0 : f.internal) === ae.enum.warehouse || ((w = a.purchaseOrder.supplier) == null ? void 0 : w.internal) === ae.enum.restaurant) && (a.purchaseOrder.items = a.purchaseOrder.items.map(
|
|
864
|
+
({ totalCost: s, ...n }) => n
|
|
882
865
|
));
|
|
883
866
|
try {
|
|
884
|
-
await
|
|
867
|
+
await S.createTemplate(a), await new Promise((s) => setTimeout(s, 1e3)), i.open({
|
|
885
868
|
title: l("inventory.transfer.template.create.success"),
|
|
886
869
|
message: l("inventory.transfer.template.create.successMessage"),
|
|
887
870
|
type: "success"
|
|
888
|
-
}),
|
|
889
|
-
} catch (
|
|
871
|
+
}), p("update:show", !1), p("submitted");
|
|
872
|
+
} catch (s) {
|
|
890
873
|
i.open({
|
|
891
874
|
title: l("inventory.transfer.template.create.error"),
|
|
892
875
|
message: l("inventory.transfer.template.create.errorMessage"),
|
|
893
876
|
type: "error"
|
|
894
|
-
}), console.error("Error in creating transfer template",
|
|
877
|
+
}), console.error("Error in creating transfer template", s);
|
|
895
878
|
} finally {
|
|
896
|
-
|
|
879
|
+
k.value = !1;
|
|
897
880
|
}
|
|
898
881
|
}
|
|
899
882
|
}
|
|
900
883
|
async function E() {
|
|
901
884
|
var f, w;
|
|
902
|
-
const a =
|
|
885
|
+
const a = C.value;
|
|
903
886
|
if (a) {
|
|
904
|
-
|
|
905
|
-
({ totalCost:
|
|
887
|
+
k.value = !0, (((f = a.purchaseOrder.supplier) == null ? void 0 : f.internal) === ae.enum.warehouse || ((w = a.purchaseOrder.supplier) == null ? void 0 : w.internal) === ae.enum.restaurant) && (a.purchaseOrder.items = a.purchaseOrder.items.map(
|
|
888
|
+
({ totalCost: s, ...n }) => n
|
|
906
889
|
));
|
|
907
890
|
try {
|
|
908
|
-
await
|
|
891
|
+
await S.updateTemplate(a), await new Promise((s) => setTimeout(s, 1e3)), i.open({
|
|
909
892
|
title: l("inventory.transfer.template.update.success"),
|
|
910
893
|
message: l("inventory.transfer.template.update.successMessage"),
|
|
911
894
|
type: "success"
|
|
912
|
-
}),
|
|
913
|
-
} catch (
|
|
895
|
+
}), p("update:show", !1), p("submitted");
|
|
896
|
+
} catch (s) {
|
|
914
897
|
i.open({
|
|
915
898
|
title: l("inventory.transfer.template.update.error"),
|
|
916
899
|
message: l("inventory.transfer.template.update.errorMessage"),
|
|
917
900
|
type: "error"
|
|
918
|
-
}), console.error("Error in updating transfer template",
|
|
901
|
+
}), console.error("Error in updating transfer template", s);
|
|
919
902
|
} finally {
|
|
920
|
-
|
|
903
|
+
k.value = !1;
|
|
921
904
|
}
|
|
922
905
|
}
|
|
923
906
|
}
|
|
924
|
-
function
|
|
925
|
-
switch (
|
|
907
|
+
function m() {
|
|
908
|
+
switch (o.mode) {
|
|
926
909
|
case te.CREATE:
|
|
927
|
-
return
|
|
910
|
+
return M();
|
|
928
911
|
case te.UPDATE:
|
|
929
912
|
return E();
|
|
930
913
|
}
|
|
@@ -934,43 +917,43 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
934
917
|
(f = (a = F.value) == null ? void 0 : a.validateInputs) == null || f.call(a);
|
|
935
918
|
}
|
|
936
919
|
return (a, f) => {
|
|
937
|
-
const w =
|
|
938
|
-
return
|
|
939
|
-
modelValue: e(
|
|
940
|
-
"onUpdate:modelValue": f[2] || (f[2] = (n) => Ue(
|
|
920
|
+
const w = O("FmButton"), s = O("FmSideSheet");
|
|
921
|
+
return D(), W(s, {
|
|
922
|
+
modelValue: e(d),
|
|
923
|
+
"onUpdate:modelValue": f[2] || (f[2] = (n) => Ue(d) ? d.value = n : null),
|
|
941
924
|
"dismiss-away": "",
|
|
942
925
|
"close-button": "",
|
|
943
926
|
"max-width": 1200
|
|
944
927
|
}, {
|
|
945
928
|
"side-sheet-header": B(() => [
|
|
946
929
|
t("div", fo, [
|
|
947
|
-
t("div", yo,
|
|
930
|
+
t("div", yo, $(v.value), 1)
|
|
948
931
|
])
|
|
949
932
|
]),
|
|
950
933
|
default: B(() => [
|
|
951
|
-
(
|
|
934
|
+
(D(), W(po, {
|
|
952
935
|
class: "w-full",
|
|
953
936
|
ref_key: "formRef",
|
|
954
937
|
ref: F,
|
|
955
|
-
onValidationSuccess:
|
|
956
|
-
"model-value":
|
|
957
|
-
"onUpdate:modelValue": f[0] || (f[0] = (n) =>
|
|
958
|
-
disabled:
|
|
959
|
-
key:
|
|
938
|
+
onValidationSuccess: m,
|
|
939
|
+
"model-value": C.value,
|
|
940
|
+
"onUpdate:modelValue": f[0] || (f[0] = (n) => C.value = n),
|
|
941
|
+
disabled: k.value,
|
|
942
|
+
key: V.value
|
|
960
943
|
}, null, 8, ["model-value", "disabled"]))
|
|
961
944
|
]),
|
|
962
945
|
"side-sheet-footer": B(() => [
|
|
963
946
|
t("div", vo, [
|
|
964
947
|
c(w, {
|
|
965
|
-
loading:
|
|
948
|
+
loading: k.value,
|
|
966
949
|
label: e(l)("common.save"),
|
|
967
950
|
onClick: r
|
|
968
951
|
}, null, 8, ["loading", "label"]),
|
|
969
952
|
c(w, {
|
|
970
|
-
disabled:
|
|
953
|
+
disabled: k.value,
|
|
971
954
|
variant: "tertiary",
|
|
972
955
|
label: e(l)("common.close"),
|
|
973
|
-
onClick: f[1] || (f[1] = (n) =>
|
|
956
|
+
onClick: f[1] || (f[1] = (n) => p("update:show", !1))
|
|
974
957
|
}, null, 8, ["disabled", "label"])
|
|
975
958
|
])
|
|
976
959
|
]),
|
|
@@ -978,7 +961,7 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
978
961
|
}, 8, ["modelValue"]);
|
|
979
962
|
};
|
|
980
963
|
}
|
|
981
|
-
}), xo = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, _o = { class: "flex justify-between" }, ho = { class: "fm-typo-en-body-lg-600" }, go = { class: "fm-status-badge fm-status-badge-info-secondary" }, To = { class: "flex flex-col gap-8" },
|
|
964
|
+
}), xo = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, _o = { class: "flex justify-between" }, ho = { class: "fm-typo-en-body-lg-600" }, go = { class: "fm-status-badge fm-status-badge-info-secondary" }, To = { class: "flex flex-col gap-8" }, ko = { class: "flex flex-col gap-4" }, Fo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wo = { class: "flex gap-1" }, So = { class: "fm-typo-en-body-lg-600" }, Co = {
|
|
982
965
|
key: 0,
|
|
983
966
|
class: "flex flex-col gap-4"
|
|
984
967
|
}, $o = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mo = { class: "fm-typo-en-body-lg-600" }, Io = {
|
|
@@ -987,7 +970,7 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
987
970
|
}, Oo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Vo = { class: "fm-typo-en-body-lg-600" }, Do = {
|
|
988
971
|
key: 2,
|
|
989
972
|
class: "flex flex-col gap-4"
|
|
990
|
-
},
|
|
973
|
+
}, Ro = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ao = { class: "fm-typo-en-body-lg-600" }, Po = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Lo = { class: "flex flex-col gap-8" }, Bo = { class: "fm-typo-en-body-lg-600" }, Eo = { class: "flex w-full gap-4" }, Uo = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, qo = { class: "fm-typo-en-body-lg-600 shrink-0" }, No = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, zo = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Ho = {
|
|
991
974
|
key: 0,
|
|
992
975
|
class: "shrink-0 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
993
976
|
}, jo = {
|
|
@@ -1000,67 +983,67 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1000
983
|
show: { type: Boolean }
|
|
1001
984
|
},
|
|
1002
985
|
emits: ["update:show", "action:edit"],
|
|
1003
|
-
setup(y, { emit:
|
|
1004
|
-
const u = y,
|
|
1005
|
-
var
|
|
1006
|
-
return (
|
|
986
|
+
setup(y, { emit: g }) {
|
|
987
|
+
const u = y, o = g, p = je(), { t: S } = Y(), i = R(() => {
|
|
988
|
+
var k;
|
|
989
|
+
return (k = u.template) == null ? void 0 : k.purchaseOrder;
|
|
1007
990
|
}), l = [
|
|
1008
991
|
{ accessorKey: "name", header: () => "Name" },
|
|
1009
992
|
{ accessorKey: "type", header: () => "Type" }
|
|
1010
|
-
],
|
|
993
|
+
], d = U(""), x = R(
|
|
1011
994
|
() => {
|
|
1012
|
-
var
|
|
1013
|
-
return ((v = (
|
|
995
|
+
var k, v, F, M;
|
|
996
|
+
return ((v = (k = i.value) == null ? void 0 : k.supplier) == null ? void 0 : v.internal) === "restaurant" || ((M = (F = i.value) == null ? void 0 : F.supplier) == null ? void 0 : M.internal) === "warehouse" ? H.TRANSFER : H.PURCHASE;
|
|
1014
997
|
}
|
|
1015
|
-
),
|
|
1016
|
-
return (
|
|
998
|
+
), C = U(!0), V = Ge(u, "show");
|
|
999
|
+
return (k, v) => {
|
|
1017
1000
|
var f;
|
|
1018
|
-
const F =
|
|
1019
|
-
return
|
|
1020
|
-
header: e(
|
|
1021
|
-
modelValue: e(
|
|
1022
|
-
"onUpdate:modelValue": v[2] || (v[2] = (w) => Ue(
|
|
1023
|
-
"dismiss-away":
|
|
1001
|
+
const F = O("FmMenuDivider"), M = O("FmCard"), E = O("FmIcon"), m = O("FmTextField"), r = O("FmTable"), T = O("FmButton"), a = O("FmSideSheet");
|
|
1002
|
+
return D(), W(a, {
|
|
1003
|
+
header: e(S)("inventory.transfer.template.details.view", { template: (f = k.template) == null ? void 0 : f.name }),
|
|
1004
|
+
modelValue: e(V),
|
|
1005
|
+
"onUpdate:modelValue": v[2] || (v[2] = (w) => Ue(V) ? V.value = w : null),
|
|
1006
|
+
"dismiss-away": C.value,
|
|
1024
1007
|
"close-button": "",
|
|
1025
1008
|
"max-width": 500
|
|
1026
1009
|
}, {
|
|
1027
1010
|
default: B(() => {
|
|
1028
|
-
var w,
|
|
1011
|
+
var w, s;
|
|
1029
1012
|
return [
|
|
1030
1013
|
t("div", xo, [
|
|
1031
1014
|
t("div", null, [
|
|
1032
|
-
c(
|
|
1015
|
+
c(M, {
|
|
1033
1016
|
variant: "outlined",
|
|
1034
1017
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
1035
1018
|
}, {
|
|
1036
1019
|
default: B(() => {
|
|
1037
|
-
var n,
|
|
1020
|
+
var n, A, I, _, b, P, q;
|
|
1038
1021
|
return [
|
|
1039
1022
|
t("div", _o, [
|
|
1040
|
-
t("div", ho,
|
|
1041
|
-
t("div", go,
|
|
1042
|
-
`inventory.transfer.receiveRequest.details.type.${
|
|
1023
|
+
t("div", ho, $(e(S)("inventory.transfer.template.details.templateSummary")), 1),
|
|
1024
|
+
t("div", go, $(e(S)(
|
|
1025
|
+
`inventory.transfer.receiveRequest.details.type.${x.value.toLocaleLowerCase("en-US")}`
|
|
1043
1026
|
)), 1)
|
|
1044
1027
|
]),
|
|
1045
1028
|
c(F),
|
|
1046
1029
|
t("div", To, [
|
|
1047
|
-
t("div",
|
|
1048
|
-
t("div",
|
|
1049
|
-
t("div",
|
|
1030
|
+
t("div", ko, [
|
|
1031
|
+
t("div", Fo, [
|
|
1032
|
+
t("div", wo, $(e(S)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1050
1033
|
]),
|
|
1051
|
-
t("div",
|
|
1034
|
+
t("div", So, $(e(ct)(((n = k.template) == null ? void 0 : n._id) ?? "")), 1)
|
|
1052
1035
|
]),
|
|
1053
|
-
(
|
|
1054
|
-
t("div", $o,
|
|
1055
|
-
t("div", Mo,
|
|
1036
|
+
(I = (A = i.value) == null ? void 0 : A.supplier) != null && I.name ? (D(), G("div", Co, [
|
|
1037
|
+
t("div", $o, $(e(S)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1038
|
+
t("div", Mo, $((b = (_ = i.value) == null ? void 0 : _.supplier) == null ? void 0 : b.name), 1)
|
|
1056
1039
|
])) : ee("", !0),
|
|
1057
|
-
(P = i.value) != null && P.ref ? (
|
|
1058
|
-
t("div", Oo,
|
|
1059
|
-
t("div", Vo,
|
|
1040
|
+
(P = i.value) != null && P.ref ? (D(), G("div", Io, [
|
|
1041
|
+
t("div", Oo, $(e(S)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1042
|
+
t("div", Vo, $(i.value.ref), 1)
|
|
1060
1043
|
])) : ee("", !0),
|
|
1061
|
-
(q = i.value) != null && q.remark ? (
|
|
1062
|
-
t("div",
|
|
1063
|
-
t("div",
|
|
1044
|
+
(q = i.value) != null && q.remark ? (D(), G("div", Do, [
|
|
1045
|
+
t("div", Ro, $(e(S)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1046
|
+
t("div", Ao, $(i.value.remark), 1)
|
|
1064
1047
|
])) : ee("", !0)
|
|
1065
1048
|
])
|
|
1066
1049
|
];
|
|
@@ -1070,21 +1053,21 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1070
1053
|
]),
|
|
1071
1054
|
t("div", Po, [
|
|
1072
1055
|
t("div", Lo, [
|
|
1073
|
-
t("div", Bo,
|
|
1074
|
-
(
|
|
1056
|
+
t("div", Bo, $(e(S)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
|
|
1057
|
+
(D(!0), G(qe, null, Xe(((w = i.value) == null ? void 0 : w.items) ?? [], (n) => (D(), G("div", {
|
|
1075
1058
|
key: n.code,
|
|
1076
1059
|
class: "flex flex-col"
|
|
1077
1060
|
}, [
|
|
1078
1061
|
t("div", Eo, [
|
|
1079
|
-
t("div", Uo,
|
|
1062
|
+
t("div", Uo, $(n.name), 1),
|
|
1080
1063
|
v[3] || (v[3] = t("div", { class: "flex-1 min-w-32" }, null, -1)),
|
|
1081
|
-
t("div", qo,
|
|
1064
|
+
t("div", qo, $(e(xt)(n.quantity, n.sku.unit, n.measurement)), 1)
|
|
1082
1065
|
]),
|
|
1083
1066
|
t("div", No, [
|
|
1084
|
-
t("div", zo,
|
|
1085
|
-
n.totalCost && e(
|
|
1067
|
+
t("div", zo, $(n.code), 1),
|
|
1068
|
+
n.totalCost && e(p).enableTotalCost ? (D(), G("div", Ho, " (" + $(e(pt)(n.totalCost)) + ") ", 1)) : ee("", !0)
|
|
1086
1069
|
]),
|
|
1087
|
-
e(
|
|
1070
|
+
e(_t)(n) ? (D(), G("div", jo, [
|
|
1088
1071
|
c(E, {
|
|
1089
1072
|
name: "error",
|
|
1090
1073
|
color: "system-error-300",
|
|
@@ -1103,9 +1086,9 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1103
1086
|
t("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " This template is only usable for the following locations. ")
|
|
1104
1087
|
], -1)),
|
|
1105
1088
|
t("div", Ko, [
|
|
1106
|
-
c(
|
|
1107
|
-
modelValue:
|
|
1108
|
-
"onUpdate:modelValue": v[0] || (v[0] = (n) =>
|
|
1089
|
+
c(m, {
|
|
1090
|
+
modelValue: d.value,
|
|
1091
|
+
"onUpdate:modelValue": v[0] || (v[0] = (n) => d.value = n),
|
|
1109
1092
|
placeholder: "Filter locations",
|
|
1110
1093
|
"prepend-icon": "search"
|
|
1111
1094
|
}, null, 8, ["modelValue"]),
|
|
@@ -1113,8 +1096,8 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1113
1096
|
"hide-footer": "",
|
|
1114
1097
|
style: { height: "500px" },
|
|
1115
1098
|
"column-defs": l,
|
|
1116
|
-
"search-value":
|
|
1117
|
-
"row-data": ((
|
|
1099
|
+
"search-value": d.value,
|
|
1100
|
+
"row-data": ((s = u.template) == null ? void 0 : s.locations) ?? [{ name: "All locations" }]
|
|
1118
1101
|
}, null, 8, ["search-value", "row-data"])
|
|
1119
1102
|
])
|
|
1120
1103
|
])
|
|
@@ -1123,9 +1106,9 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1123
1106
|
}),
|
|
1124
1107
|
"side-sheet-footer": B(() => [
|
|
1125
1108
|
t("div", Go, [
|
|
1126
|
-
c(
|
|
1127
|
-
label: e(
|
|
1128
|
-
onClick: v[1] || (v[1] = (w) =>
|
|
1109
|
+
c(T, {
|
|
1110
|
+
label: e(S)("common.edit"),
|
|
1111
|
+
onClick: v[1] || (v[1] = (w) => o("action:edit")),
|
|
1129
1112
|
variant: "tertiary"
|
|
1130
1113
|
}, null, 8, ["label"])
|
|
1131
1114
|
])
|
|
@@ -1134,32 +1117,32 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1134
1117
|
}, 8, ["header", "modelValue", "dismiss-away"]);
|
|
1135
1118
|
};
|
|
1136
1119
|
}
|
|
1137
|
-
}),
|
|
1120
|
+
}), Zo = { class: "flex-1 flex flex-col gap-8" }, Jo = { class: "flex flex-col" }, Xo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, es = { class: "fm-typo-en-body-lg-400" }, ts = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, os = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, ps = /* @__PURE__ */ X({
|
|
1138
1121
|
__name: "TransferTemplateView",
|
|
1139
1122
|
setup(y) {
|
|
1140
|
-
const { t:
|
|
1141
|
-
ce(
|
|
1142
|
-
const
|
|
1143
|
-
() =>
|
|
1144
|
-
), E = R(() =>
|
|
1145
|
-
function a(
|
|
1146
|
-
switch (
|
|
1123
|
+
const { t: g } = Y(), { createTemplate: u, viewTemplate: o, importTemplates: p, exportTemplates: S } = Le(), { templateDialogProps: i, templateDetailsProps: l } = Be(Le()), d = ht(), { loading: x, templates: C } = Be(d), V = U(!1), k = ft(), v = Qe(), { breakpoints: F } = kt();
|
|
1124
|
+
ce(d.fetchTemplates);
|
|
1125
|
+
const M = R(
|
|
1126
|
+
() => V.value || x.value || !v._currentLocation
|
|
1127
|
+
), E = R(() => C.value), m = U(""), r = R(() => F.value.xs || F.value.sm), T = R(() => r.value ? 10 : 20);
|
|
1128
|
+
function a(s) {
|
|
1129
|
+
switch (s) {
|
|
1147
1130
|
case Pe.Add:
|
|
1148
1131
|
return u();
|
|
1149
1132
|
case "refresh":
|
|
1150
|
-
return
|
|
1133
|
+
return d.fetchTemplates();
|
|
1151
1134
|
case "import":
|
|
1152
|
-
return
|
|
1135
|
+
return p();
|
|
1153
1136
|
case "export":
|
|
1154
|
-
return
|
|
1137
|
+
return S();
|
|
1155
1138
|
}
|
|
1156
1139
|
}
|
|
1157
|
-
function f(
|
|
1158
|
-
return
|
|
1140
|
+
function f(s) {
|
|
1141
|
+
return s;
|
|
1159
1142
|
}
|
|
1160
1143
|
const w = R(() => [
|
|
1161
1144
|
{
|
|
1162
|
-
label:
|
|
1145
|
+
label: g("inventory.closing.template.create.title"),
|
|
1163
1146
|
value: Pe.Add,
|
|
1164
1147
|
isPrimary: !0,
|
|
1165
1148
|
prependIcon: "add"
|
|
@@ -1180,19 +1163,19 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1180
1163
|
isPrimary: !1
|
|
1181
1164
|
}
|
|
1182
1165
|
]);
|
|
1183
|
-
return (
|
|
1184
|
-
const
|
|
1185
|
-
return
|
|
1186
|
-
c(
|
|
1187
|
-
title: e(
|
|
1166
|
+
return (s, n) => {
|
|
1167
|
+
const A = O("FmTable");
|
|
1168
|
+
return D(), G(qe, null, [
|
|
1169
|
+
c(yt, {
|
|
1170
|
+
title: e(g)("inventory.transfer.template.title2"),
|
|
1188
1171
|
actions: w.value,
|
|
1189
1172
|
"onClick:action": a
|
|
1190
1173
|
}, {
|
|
1191
1174
|
default: B(() => {
|
|
1192
|
-
var
|
|
1175
|
+
var I;
|
|
1193
1176
|
return [
|
|
1194
1177
|
t("div", {
|
|
1195
|
-
class:
|
|
1178
|
+
class: J([
|
|
1196
1179
|
"flex flex-col gap-8 max-h-full",
|
|
1197
1180
|
{
|
|
1198
1181
|
"p-0": r.value,
|
|
@@ -1200,62 +1183,62 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1200
1183
|
}
|
|
1201
1184
|
])
|
|
1202
1185
|
}, [
|
|
1203
|
-
c(
|
|
1186
|
+
c(vt, {
|
|
1204
1187
|
searchable: "",
|
|
1205
|
-
search:
|
|
1206
|
-
"onUpdate:search": n[0] || (n[0] = (
|
|
1188
|
+
search: m.value,
|
|
1189
|
+
"onUpdate:search": n[0] || (n[0] = (_) => m.value = _)
|
|
1207
1190
|
}, null, 8, ["search"]),
|
|
1208
|
-
(
|
|
1209
|
-
style: Ye(e(
|
|
1210
|
-
"column-defs": e(
|
|
1191
|
+
(D(), W(A, {
|
|
1192
|
+
style: Ye(e(k).tableHeight),
|
|
1193
|
+
"column-defs": e(d).columnDefs,
|
|
1211
1194
|
"row-data": E.value,
|
|
1212
|
-
"search-value":
|
|
1213
|
-
loading:
|
|
1214
|
-
key: (
|
|
1215
|
-
onRowClick: n[1] || (n[1] = (
|
|
1216
|
-
"page-size":
|
|
1195
|
+
"search-value": m.value,
|
|
1196
|
+
loading: M.value,
|
|
1197
|
+
key: (I = e(v)._currentLocation) == null ? void 0 : I.dbName,
|
|
1198
|
+
onRowClick: n[1] || (n[1] = (_) => e(o)(_.original)),
|
|
1199
|
+
"page-size": T.value
|
|
1217
1200
|
}, {
|
|
1218
|
-
"list-row": B((
|
|
1201
|
+
"list-row": B((_) => [
|
|
1219
1202
|
c(Ke, {
|
|
1220
|
-
row:
|
|
1221
|
-
onRowClick: (
|
|
1203
|
+
row: _,
|
|
1204
|
+
onRowClick: (b) => e(o)(b)
|
|
1222
1205
|
}, {
|
|
1223
|
-
default: B((
|
|
1224
|
-
var P, q, z, j,
|
|
1206
|
+
default: B((b) => {
|
|
1207
|
+
var P, q, z, j, h, N, fe, ye, oe, ve, be, xe, _e, se, he, ge, Te, ke, Fe, we, le, Se, Ce, $e, Me, ne, Ie;
|
|
1225
1208
|
return [
|
|
1226
|
-
t("div",
|
|
1227
|
-
t("div",
|
|
1209
|
+
t("div", Zo, [
|
|
1210
|
+
t("div", Jo, [
|
|
1228
1211
|
t("div", Xo, [
|
|
1229
1212
|
c(e(Q), {
|
|
1230
|
-
render: (z = (q = (P =
|
|
1231
|
-
props: (
|
|
1213
|
+
render: (z = (q = (P = b._id) == null ? void 0 : P.column) == null ? void 0 : q.columnDef) == null ? void 0 : z.cell,
|
|
1214
|
+
props: (h = (j = b._id) == null ? void 0 : j.getContext) == null ? void 0 : h.call(j)
|
|
1232
1215
|
}, null, 8, ["render", "props"])
|
|
1233
1216
|
]),
|
|
1234
1217
|
t("div", Yo, [
|
|
1235
1218
|
c(e(Q), {
|
|
1236
|
-
render: (ye = (fe = (N =
|
|
1237
|
-
props: (ve = (oe =
|
|
1219
|
+
render: (ye = (fe = (N = b.name) == null ? void 0 : N.column) == null ? void 0 : fe.columnDef) == null ? void 0 : ye.cell,
|
|
1220
|
+
props: (ve = (oe = b.name) == null ? void 0 : oe.getContext) == null ? void 0 : ve.call(oe)
|
|
1238
1221
|
}, null, 8, ["render", "props"])
|
|
1239
1222
|
]),
|
|
1240
1223
|
t("div", es, [
|
|
1241
1224
|
c(e(Q), {
|
|
1242
|
-
render: (_e = (xe = (be =
|
|
1243
|
-
props: (he = (se =
|
|
1225
|
+
render: (_e = (xe = (be = b.supplier) == null ? void 0 : be.column) == null ? void 0 : xe.columnDef) == null ? void 0 : _e.cell,
|
|
1226
|
+
props: (he = (se = b.supplier) == null ? void 0 : se.getContext) == null ? void 0 : he.call(se)
|
|
1244
1227
|
}, null, 8, ["render", "props"])
|
|
1245
1228
|
]),
|
|
1246
|
-
t("div", null,
|
|
1247
|
-
t("div", ts,
|
|
1229
|
+
t("div", null, $((ge = _.original.locations) != null && ge.length ? `Enabled for ${(Te = _.original.locations) == null ? void 0 : Te.length} outlets` : "Enabled for all outlets"), 1),
|
|
1230
|
+
t("div", ts, $(_.original.purchaseOrder.items.length ? _.original.purchaseOrder.items.map((We) => We.name).join(", ") : "No items"), 1),
|
|
1248
1231
|
t("div", os, [
|
|
1249
1232
|
c(e(Q), {
|
|
1250
|
-
render: (
|
|
1251
|
-
props: (
|
|
1233
|
+
render: (we = (Fe = (ke = b.ref) == null ? void 0 : ke.column) == null ? void 0 : Fe.columnDef) == null ? void 0 : we.cell,
|
|
1234
|
+
props: (Se = (le = b.ref) == null ? void 0 : le.getContext) == null ? void 0 : Se.call(le)
|
|
1252
1235
|
}, null, 8, ["render", "props"])
|
|
1253
1236
|
])
|
|
1254
1237
|
]),
|
|
1255
1238
|
t("div", null, [
|
|
1256
1239
|
c(e(Q), {
|
|
1257
|
-
render: (Me = ($e = (
|
|
1258
|
-
props: (Ie = (ne =
|
|
1240
|
+
render: (Me = ($e = (Ce = b.type) == null ? void 0 : Ce.column) == null ? void 0 : $e.columnDef) == null ? void 0 : Me.cell,
|
|
1241
|
+
props: (Ie = (ne = b.type) == null ? void 0 : ne.getContext) == null ? void 0 : Ie.call(ne)
|
|
1259
1242
|
}, null, 8, ["render", "props"])
|
|
1260
1243
|
])
|
|
1261
1244
|
])
|
|
@@ -1271,10 +1254,10 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1271
1254
|
}),
|
|
1272
1255
|
_: 1
|
|
1273
1256
|
}, 8, ["title", "actions"]),
|
|
1274
|
-
(
|
|
1257
|
+
(D(), W(et, { to: "body" }, [
|
|
1275
1258
|
c(Wo, tt(ot(e(l))), null, 16),
|
|
1276
1259
|
c(bo, Ee(e(i), {
|
|
1277
|
-
onSubmitted: n[2] || (n[2] = (
|
|
1260
|
+
onSubmitted: n[2] || (n[2] = (I) => e(d).fetchTemplates())
|
|
1278
1261
|
}), null, 16)
|
|
1279
1262
|
]))
|
|
1280
1263
|
], 64);
|
|
@@ -1282,5 +1265,5 @@ const Ht = { class: "flex flex-col gap-8 py-16" }, jt = { class: "flex items-cen
|
|
|
1282
1265
|
}
|
|
1283
1266
|
});
|
|
1284
1267
|
export {
|
|
1285
|
-
|
|
1268
|
+
ps as default
|
|
1286
1269
|
};
|