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