@feedmepos/mf-inventory-portal 0.0.22-dev.21 → 0.0.22-dev.23
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/{ApprovalView-CCYykhrK.js → ApprovalView-C5jr9Rv7.js} +4 -4
- package/dist/{BindingsDialog-33VV_AST.js → BindingsDialog-DwQ2FG0q.js} +1 -1
- package/dist/{BindingsPicker-BKu4vN8J.js → BindingsPicker-DHzbaxZA.js} +1 -1
- package/dist/{BindingsTable-Dd0h5gDf.js → BindingsTable-Cdl38M5V.js} +1 -1
- package/dist/{ClosingTemplateView-BhevjTLl.js → ClosingTemplateView-CNI2s4p9.js} +5 -5
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-3gp56NNJ.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BKvEBn1i.js} +1 -1
- package/dist/{IngredientsView-DckIH9eR.js → IngredientsView-DS_l9O8H.js} +3 -3
- package/dist/{IntegrationView-BqQ4jRIp.js → IntegrationView-PxEi1K-z.js} +2 -2
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Vi0q_bDz.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DIOR3LyW.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BIL8LWRz.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CGUFCqIs.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-Ct7daTTa.js → PurchaseOrderPrintPreview-Bkt9dkCI.js} +1 -1
- package/dist/{ReceiveRequestView-B4wHTogG.js → ReceiveRequestView-BpKYdSAx.js} +6 -6
- package/dist/{RecipeView-DuE4cXLz.js → RecipeView-DwMVz69Y.js} +3 -3
- package/dist/{StockView-Bn9v2Ix8.js → StockView-DyLe5KUJ.js} +6 -6
- package/dist/{SupplierView-C8rqHSOV.js → SupplierView-CtlZH86C.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CStnY5Zh.js → TransferDetails.vue_vue_type_script_setup_true_lang-Cbq-C-lN.js} +4 -4
- package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-DRKiv_t8.js → TransferDialog.vue_vue_type_script_setup_true_lang-BI6GT9hU.js} +268 -277
- package/dist/{TransferTemplateView-RM6Y-WL4.js → TransferTemplateView-Bn-h0lIx.js} +8 -8
- package/dist/{UnitView-BXISVrop.js → UnitView-BZKRc5bQ.js} +4 -4
- package/dist/{WarehouseView-B055eB90.js → WarehouseView-heXatxJN.js} +2 -2
- package/dist/{app-9algzyce.js → app-BcRtBju3.js} +10 -12
- package/dist/app.js +1 -1
- package/dist/{decimal-CMuMGm4y.js → decimal-BW4-dJkS.js} +1 -1
- package/dist/{defineDeepModel-CjPowyho.js → defineDeepModel-uuiMt6SI.js} +1 -1
- package/dist/{format-time-from-id-DNKcbBFm.js → format-time-from-id-CFFnB2Xm.js} +1 -1
- package/dist/{id-to-date-C6W4aVdr.js → id-to-date-Eq_Y7TFp.js} +1 -1
- package/dist/{purchase-order-transaction-type-CscRvNAR.js → purchase-order-transaction-type-BeETndfM.js} +3 -3
- package/dist/{supplier-BiCX3dpL.js → supplier-BWqPgsDR.js} +1 -1
- package/dist/{use-template-enabled-locations-2-Dtg2qOTm.js → use-template-enabled-locations-2-L61HiXQo.js} +1 -1
- package/dist/{xlsx-fKJqx2Qc.js → xlsx-DnAptFFG.js} +1 -1
- package/dist/{xlsx.util-LOnzE3KS.js → xlsx.util-CwrbPSsY.js} +2 -2
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { reactive as Ge, onMounted as
|
|
2
|
-
import { useBreakpoints as
|
|
3
|
-
import { F as
|
|
4
|
-
import { P as
|
|
5
|
-
import { a as Z, t as lt, ab as
|
|
6
|
-
import { _ as
|
|
7
|
-
import { useI18n as
|
|
1
|
+
import { reactive as Ge, onMounted as qe, computed as P, h as M, defineComponent as ie, openBlock as F, createElementBlock as $, Fragment as re, renderList as $e, createElementVNode as r, toDisplayString as D, unref as e, resolveComponent as I, createVNode as k, withCtx as O, createCommentVNode as z, ref as q, createBlock as j, watch as De, normalizeClass as Y, normalizeStyle as et, isRef as me } from "vue";
|
|
2
|
+
import { useBreakpoints as Ne, components as pe, FmButtonVariant as tt, useSnackbar as Re, useDialog as st, useProxiedModel as ot } from "@feedmepos/ui-library";
|
|
3
|
+
import { F as ke } from "./row-action.enum-PMKMRrZR.js";
|
|
4
|
+
import { P as V, d as He, c as nt } from "./purchase-order-transaction-type-BeETndfM.js";
|
|
5
|
+
import { a as Z, t as lt, ab as Ae, E as at, b as ze, R as Ve, a5 as rt, a7 as it, s as ut, a8 as Ee, a6 as dt, H as je, m as ct, A as Pe, M as pt, ac as Qe, P as Oe, Q as We, ad as mt, j as Ue, ae as ft, u as Be, af as yt, ag as vt, ah as bt, G as _t, ai as gt, aj as kt, z as Ct } from "./app-BcRtBju3.js";
|
|
6
|
+
import { _ as Ye, u as ht } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-CGUFCqIs.js";
|
|
7
|
+
import { useI18n as ye } from "@feedmepos/mf-common";
|
|
8
8
|
import "vue-router";
|
|
9
|
-
import { u as
|
|
10
|
-
import { d as wt } from "./defineDeepModel-
|
|
11
|
-
import { F as
|
|
9
|
+
import { u as Ie } from "./supplier-BWqPgsDR.js";
|
|
10
|
+
import { d as wt } from "./defineDeepModel-uuiMt6SI.js";
|
|
11
|
+
import { F as fe, _ as St } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
12
12
|
import { _ as xt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
13
|
-
function
|
|
13
|
+
function ae(n, v, u, i) {
|
|
14
14
|
var c, p, g;
|
|
15
15
|
if (i != null && i.manualTotalCost)
|
|
16
16
|
return i == null ? void 0 : i.manualTotalCost;
|
|
@@ -19,32 +19,32 @@ function le(n, v, u, i) {
|
|
|
19
19
|
)) == null ? void 0 : g.defaultCost, t = n.defaultCost, l = d ?? t, w = l == null ? void 0 : l.costPerUnit, m = w ? l != null && l.measurement ? +Z(w) / +Z(l == null ? void 0 : l.measurement.conversion) : +Z(w) : void 0, s = m ? u ? m * +Z(u.conversion) : m : void 0, a = s ? +Z(v) * s : void 0;
|
|
20
20
|
return a ? {
|
|
21
21
|
...lt(a ?? 0, 2),
|
|
22
|
-
currency:
|
|
22
|
+
currency: Ae()
|
|
23
23
|
} : {
|
|
24
24
|
amount: 0,
|
|
25
25
|
precision: 0,
|
|
26
|
-
currency:
|
|
26
|
+
currency: Ae()
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
var B = /* @__PURE__ */ ((n) => (n.Code = "Code", n.Name = "Name", n.Amount = "Amount", n.Cost = "Cost", n.Delete = "Delete", n))(B || {});
|
|
30
30
|
const Ft = () => {
|
|
31
|
-
const { t: n } =
|
|
31
|
+
const { t: n } = ye();
|
|
32
32
|
return M(
|
|
33
|
-
|
|
33
|
+
Ye,
|
|
34
34
|
{
|
|
35
35
|
zIndex: 50,
|
|
36
36
|
class: "whitespace-nowrap"
|
|
37
37
|
},
|
|
38
|
-
n("inventory.transfer.form.items.table.Cost", [
|
|
38
|
+
n("inventory.transfer.form.items.table.Cost", [Qe()])
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
41
|
function Pt(n) {
|
|
42
|
-
const { t: v } =
|
|
43
|
-
|
|
42
|
+
const { t: v } = ye(), u = Ge({}), { breakpoints: i } = Ne(), d = ze();
|
|
43
|
+
qe(() => {
|
|
44
44
|
for (const m of n.items) {
|
|
45
45
|
if (!m.totalCost)
|
|
46
46
|
continue;
|
|
47
|
-
const s =
|
|
47
|
+
const s = ae(m.sku, m.quantity, m.measurement, {
|
|
48
48
|
supplier: n.supplier
|
|
49
49
|
}), a = m.totalCost ?? at.reset();
|
|
50
50
|
s ? u[m.sku._id] = s.amount !== a.amount || s.precision !== a.precision : u[m.sku._id] = !0;
|
|
@@ -62,7 +62,7 @@ function Pt(n) {
|
|
|
62
62
|
size: 96,
|
|
63
63
|
cell(m) {
|
|
64
64
|
const s = m.row.original;
|
|
65
|
-
return M(
|
|
65
|
+
return M(pe.FmTextField, {
|
|
66
66
|
modelValue: s.code,
|
|
67
67
|
"onUpdate:modelValue": (a) => {
|
|
68
68
|
n.updateItem({
|
|
@@ -71,7 +71,7 @@ function Pt(n) {
|
|
|
71
71
|
});
|
|
72
72
|
},
|
|
73
73
|
key: s.sku._id,
|
|
74
|
-
rules: [
|
|
74
|
+
rules: [Ve()],
|
|
75
75
|
labelMark: "required"
|
|
76
76
|
});
|
|
77
77
|
},
|
|
@@ -83,7 +83,7 @@ function Pt(n) {
|
|
|
83
83
|
minSize: 300,
|
|
84
84
|
cell(m) {
|
|
85
85
|
const s = m.row.original;
|
|
86
|
-
return M(
|
|
86
|
+
return M(pe.FmTextField, {
|
|
87
87
|
modelValue: s.name,
|
|
88
88
|
"onUpdate:modelValue": (a) => {
|
|
89
89
|
n.updateItem({
|
|
@@ -92,7 +92,7 @@ function Pt(n) {
|
|
|
92
92
|
});
|
|
93
93
|
},
|
|
94
94
|
key: s.sku._id,
|
|
95
|
-
rules: [
|
|
95
|
+
rules: [Ve()],
|
|
96
96
|
labelMark: "required"
|
|
97
97
|
});
|
|
98
98
|
},
|
|
@@ -123,7 +123,7 @@ function Pt(n) {
|
|
|
123
123
|
quantity: g.amount,
|
|
124
124
|
measurement: g.measurement
|
|
125
125
|
};
|
|
126
|
-
d.enableTotalCost && (y.totalCost =
|
|
126
|
+
d.enableTotalCost && (y.totalCost = ae(s.sku, s.quantity, s.measurement, {
|
|
127
127
|
supplier: n.supplier,
|
|
128
128
|
// NOTE: set undefined here if `manualTotalCost[row.sku._id] = false`, so that the function
|
|
129
129
|
// will return the auto calculated default cost instead of the manual total cost
|
|
@@ -142,9 +142,9 @@ function Pt(n) {
|
|
|
142
142
|
}
|
|
143
143
|
)
|
|
144
144
|
),
|
|
145
|
-
a != null && a.maximumQuantity ?
|
|
145
|
+
a != null && a.maximumQuantity ? Ee(
|
|
146
146
|
+Z(a == null ? void 0 : a.maximumQuantity)
|
|
147
|
-
) :
|
|
147
|
+
) : Ee(1 / 0),
|
|
148
148
|
...a != null && a.quantityStep ? [dt(a.quantityStep)] : []
|
|
149
149
|
],
|
|
150
150
|
applyDefaultRules: !0
|
|
@@ -168,14 +168,14 @@ function Pt(n) {
|
|
|
168
168
|
key: s.sku._id
|
|
169
169
|
},
|
|
170
170
|
[
|
|
171
|
-
M(
|
|
171
|
+
M(pe.FmButton, {
|
|
172
172
|
prependIcon: "edit",
|
|
173
173
|
variant: tt.Tertiary,
|
|
174
174
|
disabled: n.disabled,
|
|
175
175
|
onClick() {
|
|
176
176
|
n.updateItem({
|
|
177
177
|
...s,
|
|
178
|
-
totalCost:
|
|
178
|
+
totalCost: ae(s.sku, s.quantity, s.measurement, {
|
|
179
179
|
supplier: n.supplier
|
|
180
180
|
})
|
|
181
181
|
}), u[s.sku._id] = !0;
|
|
@@ -189,12 +189,12 @@ function Pt(n) {
|
|
|
189
189
|
[
|
|
190
190
|
M(
|
|
191
191
|
"span",
|
|
192
|
-
b ?
|
|
193
|
-
|
|
192
|
+
b ? je(
|
|
193
|
+
ae(s.sku, s.quantity, s.measurement, {
|
|
194
194
|
supplier: n.supplier
|
|
195
195
|
})
|
|
196
196
|
) : Z(
|
|
197
|
-
|
|
197
|
+
ae(s.sku, s.quantity, s.measurement, {
|
|
198
198
|
supplier: n.supplier
|
|
199
199
|
})
|
|
200
200
|
)
|
|
@@ -213,7 +213,7 @@ function Pt(n) {
|
|
|
213
213
|
)
|
|
214
214
|
]
|
|
215
215
|
) : M(
|
|
216
|
-
|
|
216
|
+
pe.FmTextField,
|
|
217
217
|
{
|
|
218
218
|
modelValue: Z(s.totalCost ?? { amount: 0, precision: 0 }),
|
|
219
219
|
key: s.sku._id,
|
|
@@ -222,11 +222,11 @@ function Pt(n) {
|
|
|
222
222
|
...s,
|
|
223
223
|
totalCost: {
|
|
224
224
|
...ct(+c),
|
|
225
|
-
currency:
|
|
225
|
+
currency: Ae()
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
228
|
},
|
|
229
|
-
rules: [
|
|
229
|
+
rules: [Pe(0), pt(2)]
|
|
230
230
|
},
|
|
231
231
|
{
|
|
232
232
|
prepend() {
|
|
@@ -238,11 +238,11 @@ function Pt(n) {
|
|
|
238
238
|
n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
239
239
|
]
|
|
240
240
|
},
|
|
241
|
-
|
|
241
|
+
Qe()
|
|
242
242
|
) : null;
|
|
243
243
|
},
|
|
244
244
|
append() {
|
|
245
|
-
return a ? M(
|
|
245
|
+
return a ? M(pe.FmButton, {
|
|
246
246
|
prependIcon: "close",
|
|
247
247
|
variant: "tertiary",
|
|
248
248
|
disabled: n.disabled,
|
|
@@ -251,7 +251,7 @@ function Pt(n) {
|
|
|
251
251
|
...s,
|
|
252
252
|
// NOTE: different from PO template, if a default cost is reenabled,
|
|
253
253
|
// the total cost will automatically assigned
|
|
254
|
-
totalCost:
|
|
254
|
+
totalCost: ae(s.sku, s.quantity, s.measurement, {
|
|
255
255
|
supplier: n.supplier
|
|
256
256
|
})
|
|
257
257
|
}), u[s.sku._id] = !1;
|
|
@@ -268,7 +268,7 @@ function Pt(n) {
|
|
|
268
268
|
header: "",
|
|
269
269
|
cell(m) {
|
|
270
270
|
const s = m.row.original;
|
|
271
|
-
return M(
|
|
271
|
+
return M(pe.FmButton, {
|
|
272
272
|
key: s.sku._id,
|
|
273
273
|
class: "delete-button",
|
|
274
274
|
type: "button",
|
|
@@ -290,47 +290,47 @@ function Pt(n) {
|
|
|
290
290
|
}
|
|
291
291
|
];
|
|
292
292
|
return {
|
|
293
|
-
columnDefs: P(() => d.enableTotalCost && n.transferType ===
|
|
293
|
+
columnDefs: P(() => d.enableTotalCost && n.transferType === V.PURCHASE ? l : l.filter(
|
|
294
294
|
(m) => m.id !== "Cost"
|
|
295
295
|
/* Cost */
|
|
296
296
|
))
|
|
297
297
|
};
|
|
298
298
|
}
|
|
299
|
-
const
|
|
299
|
+
const It = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, Tt = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, $t = { class: "w-[450px] xs:w-full flex" }, At = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, Vt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ze = /* @__PURE__ */ ie({
|
|
300
300
|
__name: "SupplierPriceHistory",
|
|
301
301
|
props: {
|
|
302
302
|
prices: {}
|
|
303
303
|
},
|
|
304
304
|
setup(n) {
|
|
305
|
-
const v =
|
|
305
|
+
const v = Ie();
|
|
306
306
|
function u(i) {
|
|
307
307
|
return v.suppliers.find((d) => d._id === i);
|
|
308
308
|
}
|
|
309
|
-
return (i, d) => (F(),
|
|
310
|
-
(F(!0),
|
|
309
|
+
return (i, d) => (F(), $("div", It, [
|
|
310
|
+
(F(!0), $(re, null, $e(Object.keys(i.prices), (t) => {
|
|
311
311
|
var l;
|
|
312
|
-
return F(),
|
|
312
|
+
return F(), $("div", {
|
|
313
313
|
key: t,
|
|
314
314
|
class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
|
|
315
315
|
}, [
|
|
316
|
-
r("div",
|
|
316
|
+
r("div", Tt, D((l = u(t)) == null ? void 0 : l.name), 1),
|
|
317
317
|
r("div", $t, [
|
|
318
|
-
(F(!0),
|
|
318
|
+
(F(!0), $(re, null, $e(i.prices[t].slice(0, 3), (w) => {
|
|
319
319
|
var m;
|
|
320
|
-
return F(),
|
|
320
|
+
return F(), $("div", {
|
|
321
321
|
key: w.date,
|
|
322
322
|
class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
|
|
323
323
|
}, [
|
|
324
324
|
r("div", At, [
|
|
325
|
-
r("span", null,
|
|
325
|
+
r("span", null, D(w.totalCost ? e(je)(w.totalCost) : "No data"), 1),
|
|
326
326
|
d[0] || (d[0] = r("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
|
|
327
|
-
r("span", null,
|
|
328
|
-
r("span", null,
|
|
327
|
+
r("span", null, D(e(Z)(w.totalUnit, !1)), 1),
|
|
328
|
+
r("span", null, D(((m = w.measurement) == null ? void 0 : m.abbrev) ?? w.unit.abbrev), 1)
|
|
329
329
|
]),
|
|
330
330
|
r("div", Vt, [
|
|
331
|
-
r("span", null, "(#" +
|
|
332
|
-
d[1] || (d[1] = r("span", null,
|
|
333
|
-
r("span", null,
|
|
331
|
+
r("span", null, "(#" + D(w.seqNumber) + ")", 1),
|
|
332
|
+
d[1] || (d[1] = r("span", null, D(" "), -1)),
|
|
333
|
+
r("span", null, D(e(Oe)(new Date(w.date))), 1)
|
|
334
334
|
])
|
|
335
335
|
]);
|
|
336
336
|
}), 128))
|
|
@@ -342,7 +342,7 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
342
342
|
}), Dt = { class: "flex flex-col gap-8 py-16" }, Rt = { class: "flex items-center" }, Ot = { class: "flex-1 flex gap-1 items-center" }, Ut = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Bt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Mt = { class: "flex gap-8 w-full" }, Et = { class: "flex-1 flex flex-col gap-4" }, Lt = { class: "flex-1 flex flex-col gap-4" }, qt = { class: "flex gap-8 w-full" }, Nt = { class: "flex-1 flex flex-col gap-4" }, Ht = {
|
|
343
343
|
key: 0,
|
|
344
344
|
class: "flex-1 flex flex-col gap-4"
|
|
345
|
-
}, zt = /* @__PURE__ */
|
|
345
|
+
}, zt = /* @__PURE__ */ ie({
|
|
346
346
|
__name: "TransferItem",
|
|
347
347
|
props: {
|
|
348
348
|
cellByColId: {},
|
|
@@ -351,18 +351,18 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
351
351
|
row: {}
|
|
352
352
|
},
|
|
353
353
|
setup(n) {
|
|
354
|
-
const { t: v } =
|
|
354
|
+
const { t: v } = ye();
|
|
355
355
|
return (u, i) => {
|
|
356
|
-
var l, w, m, s, a, b, c, p, g, y, S, x, E,
|
|
357
|
-
const d =
|
|
358
|
-
return F(),
|
|
356
|
+
var l, w, m, s, a, b, c, p, g, y, S, x, E, A, U, L, G, ee, K, J, Q, _, C, R, te, W, se;
|
|
357
|
+
const d = I("FmLabel"), t = I("FmSpacer");
|
|
358
|
+
return F(), $("div", Dt, [
|
|
359
359
|
r("div", Rt, [
|
|
360
360
|
r("div", Ot, [
|
|
361
|
-
r("span", Ut, " (" +
|
|
362
|
-
r("span", Bt,
|
|
361
|
+
r("span", Ut, " (" + D(u.row.original.sku.code) + ") ", 1),
|
|
362
|
+
r("span", Bt, D(u.row.original.sku.name), 1)
|
|
363
363
|
]),
|
|
364
364
|
r("div", null, [
|
|
365
|
-
k(e(
|
|
365
|
+
k(e(fe), {
|
|
366
366
|
render: (m = (w = (l = u.cellByColId.Delete) == null ? void 0 : l.column) == null ? void 0 : w.columnDef) == null ? void 0 : m.cell,
|
|
367
367
|
props: (a = (s = u.cellByColId.Delete) == null ? void 0 : s.getContext) == null ? void 0 : a.call(s)
|
|
368
368
|
}, null, 8, ["render", "props"])
|
|
@@ -373,7 +373,7 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
373
373
|
k(d, {
|
|
374
374
|
label: e(v)(`inventory.transfer.form.items.table.${e(B).Code}`)
|
|
375
375
|
}, null, 8, ["label"]),
|
|
376
|
-
k(e(
|
|
376
|
+
k(e(fe), {
|
|
377
377
|
render: (p = (c = (b = u.cellByColId[e(B).Code]) == null ? void 0 : b.column) == null ? void 0 : c.columnDef) == null ? void 0 : p.cell,
|
|
378
378
|
props: (y = (g = u.cellByColId[e(B).Code]) == null ? void 0 : g.getContext) == null ? void 0 : y.call(g)
|
|
379
379
|
}, null, 8, ["render", "props"]),
|
|
@@ -383,9 +383,9 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
383
383
|
k(d, {
|
|
384
384
|
label: e(v)(`inventory.transfer.form.items.table.${e(B).Name}`)
|
|
385
385
|
}, null, 8, ["label"]),
|
|
386
|
-
k(e(
|
|
386
|
+
k(e(fe), {
|
|
387
387
|
render: (E = (x = (S = u.cellByColId[e(B).Name]) == null ? void 0 : S.column) == null ? void 0 : x.columnDef) == null ? void 0 : E.cell,
|
|
388
|
-
props: (U = (
|
|
388
|
+
props: (U = (A = u.cellByColId[e(B).Name]) == null ? void 0 : A.getContext) == null ? void 0 : U.call(A)
|
|
389
389
|
}, null, 8, ["render", "props"]),
|
|
390
390
|
i[1] || (i[1] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
391
391
|
])
|
|
@@ -395,14 +395,14 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
395
395
|
k(d, {
|
|
396
396
|
label: e(v)(`inventory.transfer.form.items.table.${e(B).Amount}`)
|
|
397
397
|
}, null, 8, ["label"]),
|
|
398
|
-
k(e(
|
|
398
|
+
k(e(fe), {
|
|
399
399
|
render: (ee = (G = (L = u.cellByColId[e(B).Amount]) == null ? void 0 : L.column) == null ? void 0 : G.columnDef) == null ? void 0 : ee.cell,
|
|
400
400
|
props: (J = (K = u.cellByColId[e(B).Amount]) == null ? void 0 : K.getContext) == null ? void 0 : J.call(K)
|
|
401
401
|
}, null, 8, ["render", "props"]),
|
|
402
402
|
i[2] || (i[2] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
403
403
|
]),
|
|
404
|
-
u.cellByColId[e(B).Cost] ? (F(),
|
|
405
|
-
k(
|
|
404
|
+
u.cellByColId[e(B).Cost] ? (F(), $("div", Ht, [
|
|
405
|
+
k(Ye, { "z-index": 50 }, {
|
|
406
406
|
default: O(() => [
|
|
407
407
|
k(d, {
|
|
408
408
|
label: e(v)(`inventory.transfer.form.items.table.${e(B).Cost}2`)
|
|
@@ -410,27 +410,27 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
410
410
|
]),
|
|
411
411
|
_: 1
|
|
412
412
|
}),
|
|
413
|
-
k(e(
|
|
414
|
-
render: (C = (_ = (
|
|
415
|
-
props: (te = (
|
|
413
|
+
k(e(fe), {
|
|
414
|
+
render: (C = (_ = (Q = u.cellByColId[e(B).Cost]) == null ? void 0 : Q.column) == null ? void 0 : _.columnDef) == null ? void 0 : C.cell,
|
|
415
|
+
props: (te = (R = u.cellByColId[e(B).Cost]) == null ? void 0 : R.getContext) == null ? void 0 : te.call(R)
|
|
416
416
|
}, null, 8, ["render", "props"]),
|
|
417
417
|
i[3] || (i[3] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
418
|
-
])) :
|
|
418
|
+
])) : z("", !0)
|
|
419
419
|
]),
|
|
420
|
-
u.showComparePrice && Object.keys(u.comparePriceBySku[(
|
|
420
|
+
u.showComparePrice && Object.keys(u.comparePriceBySku[(W = u.row.original.sku) == null ? void 0 : W._id] ?? {}).length > 0 ? (F(), $(re, { key: 0 }, [
|
|
421
421
|
k(t, { class: "h-8" }),
|
|
422
|
-
k(
|
|
422
|
+
k(Ze, {
|
|
423
423
|
prices: u.comparePriceBySku[(se = u.row.original.sku) == null ? void 0 : se._id]
|
|
424
424
|
}, null, 8, ["prices"])
|
|
425
|
-
], 64)) :
|
|
425
|
+
], 64)) : z("", !0)
|
|
426
426
|
]);
|
|
427
427
|
};
|
|
428
428
|
}
|
|
429
429
|
});
|
|
430
|
-
function
|
|
430
|
+
function Ce(n) {
|
|
431
431
|
return mt.parse(n);
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function Fe(n) {
|
|
434
434
|
return {
|
|
435
435
|
_id: n.doc._id,
|
|
436
436
|
internal: n.type,
|
|
@@ -443,7 +443,7 @@ function we(n) {
|
|
|
443
443
|
};
|
|
444
444
|
}
|
|
445
445
|
function jt(n, v, u = !1) {
|
|
446
|
-
const i =
|
|
446
|
+
const i = Ie(), d = Ue();
|
|
447
447
|
d.watchLocation(async () => {
|
|
448
448
|
var S;
|
|
449
449
|
await i.readSuppliers();
|
|
@@ -452,13 +452,13 @@ function jt(n, v, u = !1) {
|
|
|
452
452
|
const p = d.businessLevel ? i.businessSuppliers[0] : i.suppliers[0], y = (u ? d.locations.filter((x) => x.doc._id !== d.currentLocation.doc._id) : d.locations)[0];
|
|
453
453
|
v({
|
|
454
454
|
...c,
|
|
455
|
-
supplier: p ?
|
|
455
|
+
supplier: p ? Ce(p) : y ? Fe(y) : c.supplier
|
|
456
456
|
});
|
|
457
457
|
});
|
|
458
458
|
const t = P(
|
|
459
459
|
() => {
|
|
460
460
|
var c, p;
|
|
461
|
-
return typeof ((p = (c = n()) == null ? void 0 : c.supplier) == null ? void 0 : p.internal) == "string" ?
|
|
461
|
+
return typeof ((p = (c = n()) == null ? void 0 : c.supplier) == null ? void 0 : p.internal) == "string" ? V.TRANSFER : V.PURCHASE;
|
|
462
462
|
}
|
|
463
463
|
), l = P({
|
|
464
464
|
get() {
|
|
@@ -467,26 +467,26 @@ function jt(n, v, u = !1) {
|
|
|
467
467
|
},
|
|
468
468
|
set(c) {
|
|
469
469
|
const p = n() ?? {};
|
|
470
|
-
if (t.value ===
|
|
471
|
-
const E = (d.businessLevel ? i.businessSuppliers : i.suppliers).find((
|
|
470
|
+
if (t.value === V.PURCHASE) {
|
|
471
|
+
const E = (d.businessLevel ? i.businessSuppliers : i.suppliers).find((A) => A._id === c);
|
|
472
472
|
v({
|
|
473
473
|
...p,
|
|
474
|
-
supplier: E ?
|
|
474
|
+
supplier: E ? Ce(E) : p.supplier
|
|
475
475
|
});
|
|
476
476
|
return;
|
|
477
477
|
}
|
|
478
478
|
const S = (u ? d.locations.filter((x) => x.doc._id !== d.currentLocation.doc._id) : d.locations).find((x) => x.doc._id === c);
|
|
479
479
|
v({
|
|
480
480
|
...p,
|
|
481
|
-
supplier: S ?
|
|
481
|
+
supplier: S ? Fe(S) : p.supplier
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
|
-
}), w = P(() => i.locationSuppliers.map(
|
|
484
|
+
}), w = P(() => i.locationSuppliers.map(Ce)), m = P(() => i.businessSuppliers.map(Ce)), s = P(() => {
|
|
485
485
|
var g;
|
|
486
|
-
const c = ((g = d._currentLocation) == null ? void 0 : g.type) ===
|
|
487
|
-
return (u ? d.locations.filter((y) => y.doc._id !== d.currentLocation.doc._id) : d.locations).filter((y) => c || y.acceptRequest).map(
|
|
486
|
+
const c = ((g = d._currentLocation) == null ? void 0 : g.type) === We.warehouse;
|
|
487
|
+
return (u ? d.locations.filter((y) => y.doc._id !== d.currentLocation.doc._id) : d.locations).filter((y) => c || y.acceptRequest).map(Fe);
|
|
488
488
|
}), a = P(() => {
|
|
489
|
-
if (t.value ===
|
|
489
|
+
if (t.value === V.PURCHASE) {
|
|
490
490
|
const p = w.value.map((y) => ({
|
|
491
491
|
label: y.name,
|
|
492
492
|
value: y._id
|
|
@@ -505,12 +505,12 @@ function jt(n, v, u = !1) {
|
|
|
505
505
|
}), b = P(() => {
|
|
506
506
|
var y, S;
|
|
507
507
|
const c = (S = (y = n()) == null ? void 0 : y.supplier) == null ? void 0 : S._id;
|
|
508
|
-
if (t.value ===
|
|
508
|
+
if (t.value === V.PURCHASE) {
|
|
509
509
|
const x = i.suppliers.find((E) => E._id === c);
|
|
510
|
-
return x ?
|
|
510
|
+
return x ? Ce(x) : null;
|
|
511
511
|
}
|
|
512
512
|
const g = d.locations.find((x) => x.doc._id);
|
|
513
|
-
return g ?
|
|
513
|
+
return g ? Fe(g) : null;
|
|
514
514
|
});
|
|
515
515
|
return {
|
|
516
516
|
transferLocationModel: l,
|
|
@@ -538,7 +538,7 @@ function Qt(n) {
|
|
|
538
538
|
}
|
|
539
539
|
}), i = P({
|
|
540
540
|
get() {
|
|
541
|
-
return v.value === null ? "" :
|
|
541
|
+
return v.value === null ? "" : Oe(v.value);
|
|
542
542
|
},
|
|
543
543
|
set(t) {
|
|
544
544
|
t ? v.value = /* @__PURE__ */ new Date(`${t} ${d.value}`) : v.value = null;
|
|
@@ -564,7 +564,7 @@ const Wt = {
|
|
|
564
564
|
viewBox: "0 0 24 24",
|
|
565
565
|
fill: "none",
|
|
566
566
|
xmlns: "http://www.w3.org/2000/svg"
|
|
567
|
-
}, Yt = ["fill"], Zt = ["fill"], Kt = ["stroke"], Jt = ["stroke"], Xt = /* @__PURE__ */
|
|
567
|
+
}, Yt = ["fill"], Zt = ["fill"], Kt = ["stroke"], Jt = ["stroke"], Xt = /* @__PURE__ */ ie({
|
|
568
568
|
__name: "SparkIcon",
|
|
569
569
|
props: {
|
|
570
570
|
size: {
|
|
@@ -577,7 +577,7 @@ const Wt = {
|
|
|
577
577
|
}
|
|
578
578
|
},
|
|
579
579
|
setup(n) {
|
|
580
|
-
return (v, u) => (F(),
|
|
580
|
+
return (v, u) => (F(), $("svg", Wt, [
|
|
581
581
|
r("path", {
|
|
582
582
|
d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
|
|
583
583
|
fill: n.color
|
|
@@ -602,14 +602,14 @@ const Wt = {
|
|
|
602
602
|
}, null, 8, Jt)
|
|
603
603
|
]));
|
|
604
604
|
}
|
|
605
|
-
}), Gt = { class: "flex gap-8 items-center" }, es = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, ts = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, ss = { class: "flex items-center w-full" }, os = { class: "flex-1" }, ns = { class: "fm-typo-en-title-sm-800" }, ls = { class: "flex items-start gap-8" }, as = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, rs = { class: "flex gap-1" },
|
|
605
|
+
}), Gt = { class: "flex gap-8 items-center" }, es = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, ts = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, ss = { class: "flex items-center w-full" }, os = { class: "flex-1" }, ns = { class: "fm-typo-en-title-sm-800" }, ls = { class: "flex items-start gap-8" }, as = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, rs = { class: "flex gap-1" }, Le = /* @__PURE__ */ ie({
|
|
606
606
|
__name: "ForecastStock",
|
|
607
607
|
props: {
|
|
608
608
|
disabled: { type: Boolean }
|
|
609
609
|
},
|
|
610
610
|
emits: ["update:poItems"],
|
|
611
611
|
setup(n, { emit: v }) {
|
|
612
|
-
const u = v, i =
|
|
612
|
+
const u = v, i = q(!1), d = q(7), t = ht(), l = Re(), w = Be(), { t: m } = ye();
|
|
613
613
|
async function s() {
|
|
614
614
|
if (d.value < 1)
|
|
615
615
|
return;
|
|
@@ -640,8 +640,8 @@ const Wt = {
|
|
|
640
640
|
u("update:poItems", b);
|
|
641
641
|
}
|
|
642
642
|
return (a, b) => {
|
|
643
|
-
const c =
|
|
644
|
-
return F(),
|
|
643
|
+
const c = I("FmButton"), p = I("FmIcon"), g = I("FmStepperField"), y = I("FmPopover");
|
|
644
|
+
return F(), j(y, {
|
|
645
645
|
disabled: a.disabled,
|
|
646
646
|
class: "flex",
|
|
647
647
|
"show-popover": i.value,
|
|
@@ -662,7 +662,7 @@ const Wt = {
|
|
|
662
662
|
size: 24,
|
|
663
663
|
color: a.disabled ? "#c7c7cc" : "#ff7823"
|
|
664
664
|
}, null, 8, ["color"]),
|
|
665
|
-
r("div", es,
|
|
665
|
+
r("div", es, D(e(m)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
666
666
|
])
|
|
667
667
|
]),
|
|
668
668
|
_: 1
|
|
@@ -674,7 +674,7 @@ const Wt = {
|
|
|
674
674
|
r("div", os, [
|
|
675
675
|
k(xt, { "z-index": 99 }, {
|
|
676
676
|
default: O(() => [
|
|
677
|
-
r("p", ns,
|
|
677
|
+
r("p", ns, D(e(m)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
678
678
|
]),
|
|
679
679
|
_: 1
|
|
680
680
|
})
|
|
@@ -690,7 +690,7 @@ const Wt = {
|
|
|
690
690
|
modelValue: d.value,
|
|
691
691
|
"onUpdate:modelValue": b[1] || (b[1] = (S) => d.value = S),
|
|
692
692
|
label: e(m)("inventory.transfer.form.items.forecastStock.days"),
|
|
693
|
-
rules: [e(
|
|
693
|
+
rules: [e(Pe)(1)]
|
|
694
694
|
}, {
|
|
695
695
|
"helper-text": O(() => [
|
|
696
696
|
r("div", ls, [
|
|
@@ -699,7 +699,7 @@ const Wt = {
|
|
|
699
699
|
size: "sm",
|
|
700
700
|
class: "text-fm-color-system-warning-300"
|
|
701
701
|
}),
|
|
702
|
-
r("div", as,
|
|
702
|
+
r("div", as, D(e(m)("inventory.transfer.form.items.forecastStock.replace")), 1)
|
|
703
703
|
])
|
|
704
704
|
]),
|
|
705
705
|
_: 1
|
|
@@ -724,8 +724,8 @@ const Wt = {
|
|
|
724
724
|
}
|
|
725
725
|
});
|
|
726
726
|
function is() {
|
|
727
|
-
const n =
|
|
728
|
-
|
|
727
|
+
const n = Re(), v = He(), u = q(!1);
|
|
728
|
+
De(u, (l) => {
|
|
729
729
|
l && (d.value = !0, i().finally(() => {
|
|
730
730
|
d.value = !1;
|
|
731
731
|
}));
|
|
@@ -761,14 +761,14 @@ function is() {
|
|
|
761
761
|
}), u.value = !1;
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
const d =
|
|
764
|
+
const d = q(!1), t = q({});
|
|
765
765
|
return {
|
|
766
766
|
comparePricesToggle: u,
|
|
767
767
|
comparePriceFetching: d,
|
|
768
768
|
comparePriceBySku: t
|
|
769
769
|
};
|
|
770
770
|
}
|
|
771
|
-
const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }, cs = ["colspan"], ps = /* @__PURE__ */
|
|
771
|
+
const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }, cs = ["colspan"], ps = /* @__PURE__ */ ie({
|
|
772
772
|
__name: "TransferItemTable",
|
|
773
773
|
props: {
|
|
774
774
|
row: {},
|
|
@@ -781,15 +781,15 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
781
781
|
}
|
|
782
782
|
return (u, i) => {
|
|
783
783
|
var d, t;
|
|
784
|
-
return F(),
|
|
784
|
+
return F(), $(re, null, [
|
|
785
785
|
r("tr", {
|
|
786
786
|
class: Y(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
|
|
787
787
|
"bg-fm-color-neutral-gray-100": u.row.getIsSelected()
|
|
788
788
|
}])
|
|
789
789
|
}, [
|
|
790
|
-
(F(!0),
|
|
790
|
+
(F(!0), $(re, null, $e(u.row.getVisibleCells(), (l) => {
|
|
791
791
|
var w, m, s, a;
|
|
792
|
-
return F(),
|
|
792
|
+
return F(), $("td", {
|
|
793
793
|
key: l.id,
|
|
794
794
|
class: Y([
|
|
795
795
|
"h-[52px] px-16 text-fm-color-typo-primary",
|
|
@@ -802,7 +802,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
802
802
|
})
|
|
803
803
|
}, [
|
|
804
804
|
r("span", us, [
|
|
805
|
-
k(e(
|
|
805
|
+
k(e(fe), {
|
|
806
806
|
render: l.column.columnDef.cell,
|
|
807
807
|
props: l.getContext()
|
|
808
808
|
}, null, 8, ["render", "props"])
|
|
@@ -810,15 +810,15 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
810
810
|
], 6);
|
|
811
811
|
}), 128))
|
|
812
812
|
], 2),
|
|
813
|
-
u.showComparePrice && Object.keys(u.comparePriceBySku[(d = u.row.original.sku) == null ? void 0 : d._id] ?? {}).length > 0 ? (F(),
|
|
813
|
+
u.showComparePrice && Object.keys(u.comparePriceBySku[(d = u.row.original.sku) == null ? void 0 : d._id] ?? {}).length > 0 ? (F(), $("tr", ds, [
|
|
814
814
|
r("td", {
|
|
815
815
|
colspan: u.row.getVisibleCells().length
|
|
816
816
|
}, [
|
|
817
|
-
k(
|
|
817
|
+
k(Ze, {
|
|
818
818
|
prices: u.comparePriceBySku[(t = u.row.original.sku) == null ? void 0 : t._id]
|
|
819
819
|
}, null, 8, ["prices"])
|
|
820
820
|
], 8, cs)
|
|
821
|
-
])) :
|
|
821
|
+
])) : z("", !0)
|
|
822
822
|
], 64);
|
|
823
823
|
};
|
|
824
824
|
}
|
|
@@ -831,7 +831,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
831
831
|
}, ws = { class: "flex-1" }, Ss = { class: "flex-1" }, xs = {
|
|
832
832
|
key: 1,
|
|
833
833
|
class: "flex items-center gap-4"
|
|
834
|
-
}, Fs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, Ps = { class: "flex flex-col gap-16" },
|
|
834
|
+
}, Fs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, Ps = { class: "flex flex-col gap-16" }, Is = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, Ts = { class: "flex gap-8" }, $s = { key: 0 }, As = /* @__PURE__ */ ie({
|
|
835
835
|
__name: "TransferForm2",
|
|
836
836
|
props: {
|
|
837
837
|
modelValue: {},
|
|
@@ -843,13 +843,13 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
843
843
|
},
|
|
844
844
|
emits: ["validation-success", "form:ready"],
|
|
845
845
|
setup(n, { expose: v, emit: u }) {
|
|
846
|
-
const i = n, d = u, t = wt(), { t: l } =
|
|
846
|
+
const i = n, d = u, t = wt(), { t: l } = ye(), w = Ue(), m = Be(), s = kt(), a = Ie(), b = ze(), c = nt(), { breakpoints: p } = Ne(), g = P(() => p.value.xs || p.value.sm), y = P(
|
|
847
847
|
() => c.templates.value.find((o) => o._id === t.template)
|
|
848
848
|
), S = P(() => t.status === "DRAFT" || !t._rev);
|
|
849
|
-
|
|
849
|
+
De(y, (o) => {
|
|
850
850
|
var f;
|
|
851
851
|
o && ((f = t.supplier) != null && f._id || (t.supplier = (o == null ? void 0 : o.purchaseOrder.supplier) ?? t.supplier));
|
|
852
|
-
}),
|
|
852
|
+
}), qe(async () => {
|
|
853
853
|
var o;
|
|
854
854
|
try {
|
|
855
855
|
if (!t.template) return;
|
|
@@ -859,12 +859,12 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
859
859
|
}
|
|
860
860
|
});
|
|
861
861
|
const x = P(
|
|
862
|
-
() => w.currentLocation.type ===
|
|
862
|
+
() => w.currentLocation.type === We.restaurant
|
|
863
863
|
);
|
|
864
864
|
w.watchLocation(async () => {
|
|
865
865
|
location && (t.supplier || (t.supplier = a.suppliers.find((o) => o) ?? t.supplier));
|
|
866
866
|
});
|
|
867
|
-
const E = st(),
|
|
867
|
+
const E = st(), A = jt(
|
|
868
868
|
() => t,
|
|
869
869
|
(o) => {
|
|
870
870
|
Object.assign(t, o);
|
|
@@ -873,19 +873,19 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
873
873
|
), U = P({
|
|
874
874
|
get() {
|
|
875
875
|
var o;
|
|
876
|
-
return typeof ((o = t == null ? void 0 : t.supplier) == null ? void 0 : o.internal) == "string" ?
|
|
876
|
+
return typeof ((o = t == null ? void 0 : t.supplier) == null ? void 0 : o.internal) == "string" ? V.TRANSFER : V.PURCHASE;
|
|
877
877
|
},
|
|
878
878
|
set(o) {
|
|
879
|
-
var
|
|
880
|
-
const f = typeof ((
|
|
881
|
-
o !== f && (t.supplier = o ===
|
|
879
|
+
var N;
|
|
880
|
+
const f = typeof ((N = t == null ? void 0 : t.supplier) == null ? void 0 : N.internal) == "string" ? V.TRANSFER : V.PURCHASE;
|
|
881
|
+
o !== f && (t.supplier = o === V.PURCHASE ? A.locationOptionsTypePurchase.value[0] : A.locationOptionsTypeTransfer.value[0]);
|
|
882
882
|
}
|
|
883
|
-
}), L = P(() =>
|
|
883
|
+
}), L = P(() => A.transferLocationOptions.value), G = P({
|
|
884
884
|
get() {
|
|
885
885
|
return t.supplier._id;
|
|
886
886
|
},
|
|
887
887
|
set(o) {
|
|
888
|
-
|
|
888
|
+
A.transferLocationModel.value = o;
|
|
889
889
|
}
|
|
890
890
|
}), ee = P({
|
|
891
891
|
get() {
|
|
@@ -897,32 +897,25 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
897
897
|
}), K = P({
|
|
898
898
|
get() {
|
|
899
899
|
var o;
|
|
900
|
-
return ((o = t.netSuite) == null ? void 0 : o.subsidiary)
|
|
901
|
-
subsidiary: {
|
|
902
|
-
id: "",
|
|
903
|
-
name: ""
|
|
904
|
-
}
|
|
905
|
-
};
|
|
900
|
+
return ((o = t.netSuite) == null ? void 0 : o.subsidiary) ?? null;
|
|
906
901
|
},
|
|
907
902
|
set(o) {
|
|
903
|
+
var oe;
|
|
908
904
|
t.netSuite = {
|
|
909
905
|
...t.netSuite,
|
|
910
906
|
subsidiary: o
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
return !s.getAvailableItems((q = t.netSuite) == null ? void 0 : q.subsidiary.id).includes(f.sku._id);
|
|
915
|
-
}
|
|
916
|
-
);
|
|
907
|
+
};
|
|
908
|
+
const f = s.getAvailableItems((oe = t.netSuite) == null ? void 0 : oe.subsidiary.id), N = t.items.map((H) => H.sku._id).filter((H) => f.includes(H));
|
|
909
|
+
t.items = t.items.filter((H) => N.includes(H.sku._id));
|
|
917
910
|
}
|
|
918
|
-
}), { backdatePo: J, backdateSwitch:
|
|
911
|
+
}), { backdatePo: J, backdateSwitch: Q, backdateModel: _, backdateTimeModel: C } = Qt({
|
|
919
912
|
getEffectiveAt() {
|
|
920
913
|
return t.effectiveAt;
|
|
921
914
|
},
|
|
922
915
|
setEffectiveAt(o) {
|
|
923
916
|
t.effectiveAt = o;
|
|
924
917
|
}
|
|
925
|
-
}), { comparePricesToggle:
|
|
918
|
+
}), { comparePricesToggle: R, comparePriceFetching: te, comparePriceBySku: W } = is(), se = q();
|
|
926
919
|
v({
|
|
927
920
|
validateInputs: () => {
|
|
928
921
|
var o, f;
|
|
@@ -937,7 +930,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
937
930
|
(f = (o = se.value) == null ? void 0 : o.resetInputs) == null || f.call(o);
|
|
938
931
|
}
|
|
939
932
|
});
|
|
940
|
-
const
|
|
933
|
+
const Ke = Pt({
|
|
941
934
|
updateItem: (o) => {
|
|
942
935
|
t.items = t.items.map((f) => f.sku._id !== o.sku._id ? f : o);
|
|
943
936
|
},
|
|
@@ -959,29 +952,27 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
959
952
|
get disabled() {
|
|
960
953
|
return i.disabled;
|
|
961
954
|
}
|
|
962
|
-
}),
|
|
963
|
-
function
|
|
964
|
-
var
|
|
965
|
-
const o = new Set((
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
sublabel: R.code,
|
|
972
|
-
value: R
|
|
955
|
+
}), Je = P(() => Ke.columnDefs.value);
|
|
956
|
+
function Xe() {
|
|
957
|
+
var he, we, be, Se;
|
|
958
|
+
const o = new Set((be = (we = (he = y.value) == null ? void 0 : he.purchaseOrder) == null ? void 0 : we.items) == null ? void 0 : be.map((T) => T.sku._id)), f = s.getAvailableItems((Se = t.netSuite) == null ? void 0 : Se.subsidiary.id), N = o.size ? m.skus.filter((T) => o.has(T._id)) : m.skus, oe = N.map((T) => T._id).filter((T) => f.includes(T)), H = N.map(
|
|
959
|
+
(T) => ({
|
|
960
|
+
label: T.name,
|
|
961
|
+
sublabel: T.code,
|
|
962
|
+
value: T,
|
|
963
|
+
disabled: !oe.includes(T._id)
|
|
973
964
|
})
|
|
974
|
-
),
|
|
975
|
-
var
|
|
976
|
-
return (
|
|
977
|
-
}).map((
|
|
965
|
+
), ve = H.filter((T) => {
|
|
966
|
+
var ne;
|
|
967
|
+
return (ne = t.items) == null ? void 0 : ne.find((ue) => ue.sku._id === T.value._id);
|
|
968
|
+
}).map((T) => T.value);
|
|
978
969
|
E.open({
|
|
979
970
|
title: l("inventory.transfer.form.items.selectItem"),
|
|
980
971
|
closeButton: !0,
|
|
981
972
|
contentComponent: Ct,
|
|
982
973
|
contentComponentProps: {
|
|
983
|
-
modelValue:
|
|
984
|
-
items:
|
|
974
|
+
modelValue: ve,
|
|
975
|
+
items: H,
|
|
985
976
|
virtualScroll: !0
|
|
986
977
|
},
|
|
987
978
|
primaryActions: {
|
|
@@ -993,14 +984,14 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
993
984
|
close: !0,
|
|
994
985
|
variant: "tertiary"
|
|
995
986
|
}
|
|
996
|
-
}).onPrimary((
|
|
997
|
-
const
|
|
998
|
-
var
|
|
999
|
-
const
|
|
1000
|
-
if (
|
|
1001
|
-
return
|
|
1002
|
-
const
|
|
1003
|
-
(
|
|
987
|
+
}).onPrimary((T) => {
|
|
988
|
+
const ne = t.items ?? [], ue = T.map((X) => {
|
|
989
|
+
var xe, _e;
|
|
990
|
+
const de = ne.find((ce) => ce.sku._id === X._id);
|
|
991
|
+
if (de)
|
|
992
|
+
return de;
|
|
993
|
+
const le = ((_e = (xe = y.value) == null ? void 0 : xe.purchaseOrder.items) == null ? void 0 : _e.find(
|
|
994
|
+
(ce) => ce.sku._id === X._id
|
|
1004
995
|
)) ?? {
|
|
1005
996
|
sku: X,
|
|
1006
997
|
code: X.code,
|
|
@@ -1010,69 +1001,69 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1010
1001
|
precision: 0
|
|
1011
1002
|
}
|
|
1012
1003
|
};
|
|
1013
|
-
return U.value ==
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1004
|
+
return U.value == V.PURCHASE && (le.totalCost = ae(
|
|
1005
|
+
le.sku,
|
|
1006
|
+
le.quantity,
|
|
1007
|
+
le.measurement,
|
|
1017
1008
|
{
|
|
1018
1009
|
supplier: t.supplier
|
|
1019
1010
|
}
|
|
1020
|
-
)),
|
|
1011
|
+
)), le;
|
|
1021
1012
|
});
|
|
1022
|
-
ue.sort((X,
|
|
1013
|
+
ue.sort((X, de) => X.sku.code.localeCompare(de.sku.code)), t.items = ue;
|
|
1023
1014
|
});
|
|
1024
1015
|
}
|
|
1025
1016
|
function Os(o) {
|
|
1026
1017
|
return o;
|
|
1027
1018
|
}
|
|
1028
1019
|
return (o, f) => {
|
|
1029
|
-
var
|
|
1030
|
-
const
|
|
1031
|
-
return F(),
|
|
1020
|
+
var _e, ce;
|
|
1021
|
+
const N = I("FmChip"), oe = I("FmLabel"), H = I("FmField"), ve = I("FmSelect"), he = I("FmTextField"), we = I("FmTextarea"), be = I("FmSwitch"), Se = I("FmDatePicker"), T = I("FmTimePicker"), ne = I("FmFormGroup"), ue = I("FmIcon"), X = I("FmButton"), de = I("FmTooltip"), le = I("FmTable"), xe = I("FmForm");
|
|
1022
|
+
return F(), $("div", ms, [
|
|
1032
1023
|
r("div", fs, [
|
|
1033
|
-
(
|
|
1024
|
+
(_e = i.modelValue) != null && _e.template ? (F(), j(N, {
|
|
1034
1025
|
key: 0,
|
|
1035
1026
|
variant: o.disabled ? "warning" : void 0,
|
|
1036
|
-
label: `${e(l)("inventory.transfer.template.title")}: ${((
|
|
1027
|
+
label: `${e(l)("inventory.transfer.template.title")}: ${((ce = y.value) == null ? void 0 : ce.name) ?? e(l)("inventory.transfer.form.loading")}`,
|
|
1037
1028
|
icon: "summarize",
|
|
1038
1029
|
compact: ""
|
|
1039
|
-
}, null, 8, ["variant", "label"])) :
|
|
1040
|
-
k(
|
|
1030
|
+
}, null, 8, ["variant", "label"])) : z("", !0),
|
|
1031
|
+
k(N, {
|
|
1041
1032
|
label: e(w).currentLocation.name,
|
|
1042
1033
|
icon: "storefront",
|
|
1043
1034
|
compact: ""
|
|
1044
1035
|
}, null, 8, ["label"]),
|
|
1045
|
-
o.lastClosingDate ? (F(),
|
|
1036
|
+
o.lastClosingDate ? (F(), j(N, {
|
|
1046
1037
|
key: 1,
|
|
1047
|
-
label: `${e(l)("inventory.transfer.form.lastClosing")}: ${e(
|
|
1038
|
+
label: `${e(l)("inventory.transfer.form.lastClosing")}: ${e(Oe)(o.lastClosingDate)} ${e(_t)(o.lastClosingDate)}`,
|
|
1048
1039
|
icon: "calendar_month",
|
|
1049
1040
|
compact: ""
|
|
1050
|
-
}, null, 8, ["label"])) :
|
|
1041
|
+
}, null, 8, ["label"])) : z("", !0)
|
|
1051
1042
|
]),
|
|
1052
|
-
k(
|
|
1043
|
+
k(xe, {
|
|
1053
1044
|
ref_key: "formRef",
|
|
1054
1045
|
ref: se,
|
|
1055
1046
|
class: "flex flex-col gap-32",
|
|
1056
1047
|
disabled: o.disabled,
|
|
1057
1048
|
onValidationFailed: console.log,
|
|
1058
|
-
onValidationSuccess: f[13] || (f[13] = (
|
|
1049
|
+
onValidationSuccess: f[13] || (f[13] = (Te) => d("validation-success"))
|
|
1059
1050
|
}, {
|
|
1060
1051
|
default: O(() => {
|
|
1061
|
-
var
|
|
1052
|
+
var Te, Me;
|
|
1062
1053
|
return [
|
|
1063
1054
|
r("div", ys, [
|
|
1064
1055
|
r("div", vs, [
|
|
1065
|
-
(
|
|
1056
|
+
(Te = i.modelValue) != null && Te.template ? (F(), $(re, { key: 0 }, [
|
|
1066
1057
|
r("div", bs, [
|
|
1067
|
-
k(
|
|
1058
|
+
k(oe, {
|
|
1068
1059
|
label: e(l)("inventory.transfer.form.type.title")
|
|
1069
1060
|
}, null, 8, ["label"]),
|
|
1070
1061
|
r("div", _s, [
|
|
1071
|
-
k(
|
|
1062
|
+
k(H, null, {
|
|
1072
1063
|
default: O(() => [
|
|
1073
1064
|
r("span", {
|
|
1074
1065
|
class: Y({ "text-fm-color-typo-disabled": o.disabled })
|
|
1075
|
-
},
|
|
1066
|
+
}, D(e(l)(`inventory.transfer.form.type.${U.value.toLocaleLowerCase("en-us")}`)), 3)
|
|
1076
1067
|
]),
|
|
1077
1068
|
_: 1
|
|
1078
1069
|
}),
|
|
@@ -1085,17 +1076,17 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1085
1076
|
])
|
|
1086
1077
|
]),
|
|
1087
1078
|
r("div", gs, [
|
|
1088
|
-
k(
|
|
1089
|
-
label: U.value === e(
|
|
1079
|
+
k(oe, {
|
|
1080
|
+
label: U.value === e(V).PURCHASE ? e(l)("inventory.transfer.form.purchaseFrom") : e(l)("inventory.transfer.form.transferFrom")
|
|
1090
1081
|
}, null, 8, ["label"]),
|
|
1091
1082
|
r("div", ks, [
|
|
1092
|
-
k(
|
|
1083
|
+
k(H, null, {
|
|
1093
1084
|
default: O(() => {
|
|
1094
1085
|
var h;
|
|
1095
1086
|
return [
|
|
1096
1087
|
r("span", {
|
|
1097
1088
|
class: Y({ "text-fm-color-typo-disabled": o.disabled })
|
|
1098
|
-
},
|
|
1089
|
+
}, D((h = L.value.find((ge) => ge.value === G.value)) == null ? void 0 : h.label), 3)
|
|
1099
1090
|
];
|
|
1100
1091
|
}),
|
|
1101
1092
|
_: 1
|
|
@@ -1108,41 +1099,41 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1108
1099
|
}, " This field is locked from template. ", 2)
|
|
1109
1100
|
])
|
|
1110
1101
|
])
|
|
1111
|
-
], 64)) : (F(),
|
|
1112
|
-
k(
|
|
1102
|
+
], 64)) : (F(), $(re, { key: 1 }, [
|
|
1103
|
+
k(ve, {
|
|
1113
1104
|
label: e(l)("inventory.transfer.form.type.title"),
|
|
1114
1105
|
"model-value": U.value,
|
|
1115
1106
|
"onUpdate:modelValue": f[0] || (f[0] = (h) => U.value = h),
|
|
1116
1107
|
items: [
|
|
1117
1108
|
{
|
|
1118
1109
|
label: e(l)("inventory.transfer.form.type.purchase"),
|
|
1119
|
-
value: e(
|
|
1120
|
-
disabled: !e(
|
|
1121
|
-
sublabel: e(
|
|
1110
|
+
value: e(V).PURCHASE,
|
|
1111
|
+
disabled: !e(A).locationOptionsTypePurchase.value.length,
|
|
1112
|
+
sublabel: e(A).locationOptionsTypePurchase.value.length ? void 0 : e(l)("inventory.transfer.form.noSupplierAvailable")
|
|
1122
1113
|
},
|
|
1123
1114
|
{
|
|
1124
1115
|
label: e(l)("inventory.transfer.form.type.transfer"),
|
|
1125
|
-
value: e(
|
|
1126
|
-
disabled: !e(
|
|
1127
|
-
sublabel: e(
|
|
1116
|
+
value: e(V).TRANSFER,
|
|
1117
|
+
disabled: !e(A).locationOptionsTypeTransfer.value.length,
|
|
1118
|
+
sublabel: e(A).locationOptionsTypeTransfer.value.length ? void 0 : e(l)("inventory.transfer.form.noLocationAvailable")
|
|
1128
1119
|
}
|
|
1129
1120
|
],
|
|
1130
|
-
rules: [e(
|
|
1121
|
+
rules: [e(Pe)(1)(L.value)]
|
|
1131
1122
|
}, null, 8, ["label", "model-value", "items", "rules"]),
|
|
1132
|
-
k(
|
|
1133
|
-
label: U.value === e(
|
|
1123
|
+
k(ve, {
|
|
1124
|
+
label: U.value === e(V).PURCHASE ? e(l)("inventory.transfer.form.purchaseFrom") : e(l)("inventory.transfer.form.transferFrom"),
|
|
1134
1125
|
modelValue: G.value,
|
|
1135
1126
|
"onUpdate:modelValue": f[1] || (f[1] = (h) => G.value = h),
|
|
1136
1127
|
items: L.value
|
|
1137
1128
|
}, null, 8, ["label", "modelValue", "items"])
|
|
1138
1129
|
], 64)),
|
|
1139
|
-
k(
|
|
1130
|
+
k(he, {
|
|
1140
1131
|
label: e(l)("inventory.transfer.form.reference"),
|
|
1141
1132
|
"label-mark": "optional",
|
|
1142
1133
|
modelValue: e(t).ref,
|
|
1143
1134
|
"onUpdate:modelValue": f[2] || (f[2] = (h) => e(t).ref = h)
|
|
1144
1135
|
}, null, 8, ["label", "modelValue"]),
|
|
1145
|
-
k(
|
|
1136
|
+
k(we, {
|
|
1146
1137
|
label: e(l)("inventory.transfer.form.remark"),
|
|
1147
1138
|
"label-mark": "optional",
|
|
1148
1139
|
"max-length": 240,
|
|
@@ -1150,16 +1141,16 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1150
1141
|
"onUpdate:modelValue": f[3] || (f[3] = (h) => ee.value = h),
|
|
1151
1142
|
class: Y([o.disabled ? "text-fm-color-typo-disabled " : ""])
|
|
1152
1143
|
}, null, 8, ["label", "modelValue", "class"]),
|
|
1153
|
-
e(s).isEnabled ? (F(),
|
|
1144
|
+
e(s).isEnabled ? (F(), j(ve, {
|
|
1154
1145
|
key: 2,
|
|
1155
1146
|
modelValue: K.value,
|
|
1156
1147
|
"onUpdate:modelValue": f[4] || (f[4] = (h) => K.value = h),
|
|
1157
1148
|
label: `NetSuite ${e(l)("inventory.transfer.form.netsuite.subsidiary")}`,
|
|
1158
1149
|
items: e(s).subsidiaryOptions,
|
|
1159
1150
|
"label-mark": "required",
|
|
1160
|
-
rules: [e(
|
|
1161
|
-
}, null, 8, ["modelValue", "label", "items", "rules"])) :
|
|
1162
|
-
e(b).enableBackdatePo ? (F(),
|
|
1151
|
+
rules: [e(Ve)()]
|
|
1152
|
+
}, null, 8, ["modelValue", "label", "items", "rules"])) : z("", !0),
|
|
1153
|
+
e(b).enableBackdatePo ? (F(), $("div", Cs, [
|
|
1163
1154
|
r("div", {
|
|
1164
1155
|
class: Y([
|
|
1165
1156
|
"flex",
|
|
@@ -1168,9 +1159,9 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1168
1159
|
}
|
|
1169
1160
|
])
|
|
1170
1161
|
}, [
|
|
1171
|
-
k(
|
|
1172
|
-
modelValue: e(
|
|
1173
|
-
"onUpdate:modelValue": f[5] || (f[5] = (h) =>
|
|
1162
|
+
k(be, {
|
|
1163
|
+
modelValue: e(Q),
|
|
1164
|
+
"onUpdate:modelValue": f[5] || (f[5] = (h) => me(Q) ? Q.value = h : null),
|
|
1174
1165
|
label: e(l)("inventory.transfer.form.backdate.title"),
|
|
1175
1166
|
sublabel: e(l)("inventory.transfer.form.backdate.subtitle"),
|
|
1176
1167
|
"label-placement": "right",
|
|
@@ -1179,42 +1170,42 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1179
1170
|
r("div", {
|
|
1180
1171
|
class: Y({ hidden: g.value, "w-16": !g.value })
|
|
1181
1172
|
}, null, 2),
|
|
1182
|
-
e(
|
|
1173
|
+
e(Q) ? (F(), $("div", hs, [
|
|
1183
1174
|
r("div", ws, [
|
|
1184
|
-
k(
|
|
1175
|
+
k(Se, {
|
|
1185
1176
|
modelValue: e(_),
|
|
1186
|
-
"onUpdate:modelValue": f[6] || (f[6] = (h) =>
|
|
1177
|
+
"onUpdate:modelValue": f[6] || (f[6] = (h) => me(_) ? _.value = h : null)
|
|
1187
1178
|
}, null, 8, ["modelValue"])
|
|
1188
1179
|
]),
|
|
1189
1180
|
r("div", Ss, [
|
|
1190
|
-
k(
|
|
1181
|
+
k(T, {
|
|
1191
1182
|
modelValue: e(C),
|
|
1192
|
-
"onUpdate:modelValue": f[7] || (f[7] = (h) =>
|
|
1183
|
+
"onUpdate:modelValue": f[7] || (f[7] = (h) => me(C) ? C.value = h : null)
|
|
1193
1184
|
}, null, 8, ["modelValue"])
|
|
1194
1185
|
])
|
|
1195
|
-
])) :
|
|
1186
|
+
])) : z("", !0)
|
|
1196
1187
|
], 2),
|
|
1197
|
-
e(J) ? (F(),
|
|
1188
|
+
e(J) ? (F(), j(ne, {
|
|
1198
1189
|
key: 0,
|
|
1199
1190
|
modelValue: e(J),
|
|
1200
|
-
"onUpdate:modelValue": f[8] || (f[8] = (h) =>
|
|
1191
|
+
"onUpdate:modelValue": f[8] || (f[8] = (h) => me(J) ? J.value = h : null),
|
|
1201
1192
|
rules: [e(gt)(new Date(o.lastClosingDate), /* @__PURE__ */ new Date())]
|
|
1202
|
-
}, null, 8, ["modelValue", "rules"])) :
|
|
1203
|
-
x.value && !o.lastClosingDate ? (F(),
|
|
1204
|
-
k(
|
|
1193
|
+
}, null, 8, ["modelValue", "rules"])) : z("", !0),
|
|
1194
|
+
x.value && !o.lastClosingDate ? (F(), $("div", xs, [
|
|
1195
|
+
k(ue, {
|
|
1205
1196
|
name: "error",
|
|
1206
1197
|
size: "sm",
|
|
1207
1198
|
class: "text-fm-color-typo-warning"
|
|
1208
1199
|
}),
|
|
1209
|
-
r("span", Fs,
|
|
1210
|
-
])) :
|
|
1211
|
-
])) :
|
|
1200
|
+
r("span", Fs, D(e(l)("inventory.transfer.form.backdate.error")), 1)
|
|
1201
|
+
])) : z("", !0)
|
|
1202
|
+
])) : z("", !0)
|
|
1212
1203
|
])
|
|
1213
1204
|
]),
|
|
1214
1205
|
r("div", Ps, [
|
|
1215
|
-
k(
|
|
1206
|
+
k(ne, {
|
|
1216
1207
|
"model-value": e(t).items,
|
|
1217
|
-
rules: [e(
|
|
1208
|
+
rules: [e(Pe)(1)]
|
|
1218
1209
|
}, null, 8, ["model-value", "rules"]),
|
|
1219
1210
|
r("div", {
|
|
1220
1211
|
class: Y([
|
|
@@ -1225,9 +1216,9 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1225
1216
|
}
|
|
1226
1217
|
])
|
|
1227
1218
|
}, [
|
|
1228
|
-
r("div",
|
|
1229
|
-
r("div",
|
|
1230
|
-
k(
|
|
1219
|
+
r("div", Is, D(e(l)("inventory.transfer.form.items.title")), 1),
|
|
1220
|
+
r("div", Ts, [
|
|
1221
|
+
k(X, {
|
|
1231
1222
|
disabled: o.disabled,
|
|
1232
1223
|
label: e(l)("inventory.transfer.form.items.addItem"),
|
|
1233
1224
|
"prepend-icon": "add",
|
|
@@ -1235,42 +1226,42 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1235
1226
|
"text-color": "primary",
|
|
1236
1227
|
"bg-color": "transparent",
|
|
1237
1228
|
"border-color": "primary",
|
|
1238
|
-
onClick: f[9] || (f[9] = (h) =>
|
|
1229
|
+
onClick: f[9] || (f[9] = (h) => Xe()),
|
|
1239
1230
|
size: "md"
|
|
1240
1231
|
}, null, 8, ["disabled", "label"]),
|
|
1241
|
-
e(t).template ? (F(),
|
|
1232
|
+
e(t).template ? (F(), j(de, {
|
|
1242
1233
|
key: 0,
|
|
1243
1234
|
"z-index": 50
|
|
1244
1235
|
}, {
|
|
1245
1236
|
content: O(() => [
|
|
1246
|
-
r("div", null,
|
|
1237
|
+
r("div", null, D(e(l)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
|
|
1247
1238
|
]),
|
|
1248
1239
|
default: O(() => [
|
|
1249
|
-
k(
|
|
1240
|
+
k(Le, {
|
|
1250
1241
|
"onUpdate:poItems": f[10] || (f[10] = (h) => e(t).items = h),
|
|
1251
1242
|
disabled: ""
|
|
1252
1243
|
})
|
|
1253
1244
|
]),
|
|
1254
1245
|
_: 1
|
|
1255
|
-
})) : (F(),
|
|
1246
|
+
})) : (F(), j(Le, {
|
|
1256
1247
|
key: 1,
|
|
1257
1248
|
"onUpdate:poItems": f[11] || (f[11] = (h) => e(t).items = h),
|
|
1258
1249
|
disabled: o.disabled || !!e(t).template
|
|
1259
1250
|
}, null, 8, ["disabled"]))
|
|
1260
1251
|
])
|
|
1261
1252
|
], 2),
|
|
1262
|
-
U.value === e(
|
|
1263
|
-
k(
|
|
1253
|
+
U.value === e(V).PURCHASE && S.value && e(b).enableTotalCost && ((Me = o.modelValue) != null && Me.items.length) ? (F(), $("div", $s, [
|
|
1254
|
+
k(be, {
|
|
1264
1255
|
label: e(te) ? e(l)("inventory.transfer.form.items.fetchingData") : e(l)("inventory.transfer.form.items.comparePriceHistory"),
|
|
1265
1256
|
"prepend-icon": "compare_arrows",
|
|
1266
1257
|
"label-placement": "right",
|
|
1267
|
-
"model-value": e(
|
|
1268
|
-
"onUpdate:modelValue": f[12] || (f[12] = (h) =>
|
|
1258
|
+
"model-value": e(R),
|
|
1259
|
+
"onUpdate:modelValue": f[12] || (f[12] = (h) => me(R) ? R.value = h : null),
|
|
1269
1260
|
disabled: e(te) || o.disabled
|
|
1270
1261
|
}, null, 8, ["label", "model-value", "disabled"])
|
|
1271
|
-
])) :
|
|
1272
|
-
(F(),
|
|
1273
|
-
"column-defs":
|
|
1262
|
+
])) : z("", !0),
|
|
1263
|
+
(F(), j(le, {
|
|
1264
|
+
"column-defs": Je.value,
|
|
1274
1265
|
"row-data": e(t).items,
|
|
1275
1266
|
key: e(t).items.map((h) => h.sku._id).join("."),
|
|
1276
1267
|
"hide-footer": "",
|
|
@@ -1278,22 +1269,22 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1278
1269
|
}, {
|
|
1279
1270
|
"table-row": O((h) => [
|
|
1280
1271
|
k(ps, {
|
|
1281
|
-
"compare-price-by-sku": e(
|
|
1282
|
-
"show-compare-price": U.value === e(
|
|
1272
|
+
"compare-price-by-sku": e(W),
|
|
1273
|
+
"show-compare-price": U.value === e(V).PURCHASE && e(R),
|
|
1283
1274
|
row: h
|
|
1284
1275
|
}, null, 8, ["compare-price-by-sku", "show-compare-price", "row"])
|
|
1285
1276
|
]),
|
|
1286
1277
|
"list-row": O((h) => [
|
|
1287
|
-
(F(),
|
|
1278
|
+
(F(), j(St, {
|
|
1288
1279
|
row: h,
|
|
1289
|
-
key: e(t).items.map((
|
|
1280
|
+
key: e(t).items.map((ge) => ge.sku._id).join(".")
|
|
1290
1281
|
}, {
|
|
1291
|
-
default: O((
|
|
1282
|
+
default: O((ge) => [
|
|
1292
1283
|
k(zt, {
|
|
1293
|
-
"compare-price-by-sku": e(
|
|
1294
|
-
"show-compare-price": U.value === e(
|
|
1284
|
+
"compare-price-by-sku": e(W),
|
|
1285
|
+
"show-compare-price": U.value === e(V).PURCHASE && e(R),
|
|
1295
1286
|
row: h,
|
|
1296
|
-
"cell-by-col-id":
|
|
1287
|
+
"cell-by-col-id": ge
|
|
1297
1288
|
}, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "cell-by-col-id"])
|
|
1298
1289
|
]),
|
|
1299
1290
|
_: 2
|
|
@@ -1309,7 +1300,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1309
1300
|
]);
|
|
1310
1301
|
};
|
|
1311
1302
|
}
|
|
1312
|
-
}), Vs = { class: "flex items-center" }, Ds = { class: "fm-typo-en-title-md-800" }, Rs = { class: "flex gap-4" }, Ys = /* @__PURE__ */
|
|
1303
|
+
}), Vs = { class: "flex items-center" }, Ds = { class: "fm-typo-en-title-md-800" }, Rs = { class: "flex gap-4" }, Ys = /* @__PURE__ */ ie({
|
|
1313
1304
|
__name: "TransferDialog",
|
|
1314
1305
|
props: {
|
|
1315
1306
|
mode: {},
|
|
@@ -1320,8 +1311,8 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1320
1311
|
},
|
|
1321
1312
|
emits: ["update:show", "submitted"],
|
|
1322
1313
|
setup(n, { expose: v, emit: u }) {
|
|
1323
|
-
var
|
|
1324
|
-
const i = n, d = u, t =
|
|
1314
|
+
var Q;
|
|
1315
|
+
const i = n, d = u, t = He(), l = Re(), w = Ie(), m = Be(), s = Ue(), { t: a } = ye(), b = q(!1), c = q(!1), p = q(!1);
|
|
1325
1316
|
async function g(_) {
|
|
1326
1317
|
if (_) {
|
|
1327
1318
|
c.value = !1;
|
|
@@ -1370,25 +1361,25 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1370
1361
|
template: i.templateId
|
|
1371
1362
|
};
|
|
1372
1363
|
}
|
|
1373
|
-
const S = ot(i, "show"), x =
|
|
1374
|
-
|
|
1364
|
+
const S = ot(i, "show"), x = q(i.modelValue ?? y()), E = q(((Q = i.modelValue) == null ? void 0 : Q._id) ?? `${Math.random()}`);
|
|
1365
|
+
De(
|
|
1375
1366
|
() => i.show,
|
|
1376
1367
|
(_) => {
|
|
1377
1368
|
var C;
|
|
1378
1369
|
_ && (p.value = !1, x.value = i.modelValue ?? y(), E.value = ((C = i.modelValue) == null ? void 0 : C._id) ?? `${Math.random()}`);
|
|
1379
1370
|
}
|
|
1380
1371
|
);
|
|
1381
|
-
const
|
|
1372
|
+
const A = P(() => !c.value || !p.value), U = P(() => {
|
|
1382
1373
|
switch (i.mode) {
|
|
1383
|
-
case
|
|
1374
|
+
case ke.READ:
|
|
1384
1375
|
return "View transfer";
|
|
1385
|
-
case
|
|
1376
|
+
case ke.CREATE:
|
|
1386
1377
|
return a("inventory.transfer.receiveRequest.create.title");
|
|
1387
|
-
case
|
|
1378
|
+
case ke.UPDATE:
|
|
1388
1379
|
return a("inventory.transfer.receiveRequest.update.title");
|
|
1389
1380
|
}
|
|
1390
1381
|
return "";
|
|
1391
|
-
}), L =
|
|
1382
|
+
}), L = q();
|
|
1392
1383
|
v({
|
|
1393
1384
|
validateInputs: () => {
|
|
1394
1385
|
var _, C;
|
|
@@ -1405,7 +1396,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1405
1396
|
});
|
|
1406
1397
|
async function G() {
|
|
1407
1398
|
const _ = x.value;
|
|
1408
|
-
b.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: C, ...
|
|
1399
|
+
b.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: C, ...R }) => R));
|
|
1409
1400
|
try {
|
|
1410
1401
|
await t.createPurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)), l.open({
|
|
1411
1402
|
title: a("inventory.transfer.receiveRequest.create.success"),
|
|
@@ -1424,7 +1415,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1424
1415
|
}
|
|
1425
1416
|
async function ee() {
|
|
1426
1417
|
const _ = x.value;
|
|
1427
|
-
b.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: C, ...
|
|
1418
|
+
b.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: C, ...R }) => R));
|
|
1428
1419
|
try {
|
|
1429
1420
|
await t.updatePurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)), l.open({
|
|
1430
1421
|
title: a("inventory.transfer.receiveRequest.update.success"),
|
|
@@ -1443,9 +1434,9 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1443
1434
|
}
|
|
1444
1435
|
function K() {
|
|
1445
1436
|
switch (i.mode) {
|
|
1446
|
-
case
|
|
1437
|
+
case ke.CREATE:
|
|
1447
1438
|
return G();
|
|
1448
|
-
case
|
|
1439
|
+
case ke.UPDATE:
|
|
1449
1440
|
return ee();
|
|
1450
1441
|
}
|
|
1451
1442
|
}
|
|
@@ -1454,29 +1445,29 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1454
1445
|
(C = (_ = L.value) == null ? void 0 : _.validateInputs) == null || C.call(_);
|
|
1455
1446
|
}
|
|
1456
1447
|
return (_, C) => {
|
|
1457
|
-
const
|
|
1458
|
-
return F(),
|
|
1448
|
+
const R = I("FmButton"), te = I("FmSideSheet");
|
|
1449
|
+
return F(), j(te, {
|
|
1459
1450
|
modelValue: e(S),
|
|
1460
|
-
"onUpdate:modelValue": C[3] || (C[3] = (
|
|
1451
|
+
"onUpdate:modelValue": C[3] || (C[3] = (W) => me(S) ? S.value = W : null),
|
|
1461
1452
|
"dismiss-away": "",
|
|
1462
1453
|
"close-button": "",
|
|
1463
1454
|
"max-width": 900
|
|
1464
1455
|
}, {
|
|
1465
1456
|
"side-sheet-header": O(() => [
|
|
1466
1457
|
r("div", Vs, [
|
|
1467
|
-
r("div", Ds,
|
|
1458
|
+
r("div", Ds, D(U.value), 1)
|
|
1468
1459
|
])
|
|
1469
1460
|
]),
|
|
1470
1461
|
default: O(() => [
|
|
1471
|
-
(F(),
|
|
1462
|
+
(F(), j(As, {
|
|
1472
1463
|
class: "w-full",
|
|
1473
1464
|
ref_key: "formRef",
|
|
1474
1465
|
ref: L,
|
|
1475
1466
|
"onForm:ready": C[0] || (C[0] = () => p.value = !0),
|
|
1476
1467
|
onValidationSuccess: K,
|
|
1477
1468
|
modelValue: x.value,
|
|
1478
|
-
"onUpdate:modelValue": C[1] || (C[1] = (
|
|
1479
|
-
disabled: b.value ||
|
|
1469
|
+
"onUpdate:modelValue": C[1] || (C[1] = (W) => x.value = W),
|
|
1470
|
+
disabled: b.value || A.value,
|
|
1480
1471
|
suppliers: e(w).suppliers,
|
|
1481
1472
|
skus: e(m).skus,
|
|
1482
1473
|
key: E.value,
|
|
@@ -1485,17 +1476,17 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1485
1476
|
]),
|
|
1486
1477
|
"side-sheet-footer": O(() => [
|
|
1487
1478
|
r("div", Rs, [
|
|
1488
|
-
k(
|
|
1479
|
+
k(R, {
|
|
1489
1480
|
loading: b.value,
|
|
1490
|
-
disabled:
|
|
1481
|
+
disabled: A.value,
|
|
1491
1482
|
label: e(a)("common.save"),
|
|
1492
1483
|
onClick: J
|
|
1493
1484
|
}, null, 8, ["loading", "disabled", "label"]),
|
|
1494
|
-
k(
|
|
1495
|
-
disabled:
|
|
1485
|
+
k(R, {
|
|
1486
|
+
disabled: A.value,
|
|
1496
1487
|
variant: "tertiary",
|
|
1497
1488
|
label: e(a)("common.close"),
|
|
1498
|
-
onClick: C[2] || (C[2] = (
|
|
1489
|
+
onClick: C[2] || (C[2] = (W) => d("update:show", !1))
|
|
1499
1490
|
}, null, 8, ["disabled", "label"])
|
|
1500
1491
|
])
|
|
1501
1492
|
]),
|
|
@@ -1506,6 +1497,6 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1506
1497
|
});
|
|
1507
1498
|
export {
|
|
1508
1499
|
Ys as _,
|
|
1509
|
-
|
|
1500
|
+
ae as c,
|
|
1510
1501
|
jt as u
|
|
1511
1502
|
};
|