@feedmepos/mf-inventory-portal 0.0.22-dev.12 → 0.0.22-dev.15
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-Cjeqabxg.js → ApprovalView-BOP6b_Yd.js} +4 -4
- package/dist/{BindingsDialog-DYf9izzO.js → BindingsDialog-BLyRf9wO.js} +1 -1
- package/dist/{BindingsPicker--GhOF5Zy.js → BindingsPicker-CNbfKeSB.js} +8 -8
- package/dist/{BindingsTable-DFGX1bO_.js → BindingsTable-CH73rDTZ.js} +1 -1
- package/dist/{ClosingTemplateView-D0ZehXOT.js → ClosingTemplateView-c572PM5W.js} +5 -5
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CzXWOCCv.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CpmzTuAj.js} +1 -1
- package/dist/{IngredientsView-D-M4VjtX.js → IngredientsView-CdE3WOqJ.js} +3 -3
- package/dist/{IntegrationView-D29NyKuw.js → IntegrationView-B29NSwpf.js} +2 -2
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DMzUk8cN.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CZsQjzBa.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CrYQR5oS.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BwKpNPDY.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-BmzWBQYf.js → PurchaseOrderPrintPreview-mHevDWzN.js} +1 -1
- package/dist/{ReceiveRequestView-D5uhgByr.js → ReceiveRequestView-Bl4SuM6j.js} +6 -6
- package/dist/{RecipeView-CREeE1nK.js → RecipeView-BHBJlY-_.js} +3 -3
- package/dist/Standalone.vue.d.ts +2 -0
- package/dist/{StockView-jAGaTT7q.js → StockView-C4z9Qi7T.js} +6 -6
- package/dist/{SupplierView-BjkhByNr.js → SupplierView-CXyWhB9D.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CInXmMf_.js → TransferDetails.vue_vue_type_script_setup_true_lang-C_cTUji8.js} +178 -177
- package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-CLiLhIMS.js → TransferDialog.vue_vue_type_script_setup_true_lang-DV59BWff.js} +440 -437
- package/dist/TransferTemplateView-Dpxk9Zwt.js +1209 -0
- package/dist/{UnitView-BrlpQn3T.js → UnitView-BQlwparN.js} +4 -4
- package/dist/{WarehouseView-CbTTIdv9.js → WarehouseView-Cu7pKilf.js} +2 -2
- package/dist/{app-BDzV3RNp.js → app-CFkNddzq.js} +3414 -3396
- package/dist/app.js +1 -1
- package/dist/components/FmMinMaxInputRules.d.ts +2 -0
- package/dist/components/FmUnitInputRules.d.ts +2 -0
- package/dist/{decimal-CRTw2PGO.js → decimal-D0W3dojG.js} +1 -1
- package/dist/{defineDeepModel-BoSSw2c6.js → defineDeepModel-DWffbsZh.js} +1 -1
- package/dist/{format-time-from-id-CxoHtJa5.js → format-time-from-id-BZAepMJZ.js} +1 -1
- package/dist/helper/rules.d.ts +7 -1
- package/dist/helper/rules.spec.d.ts +1 -0
- package/dist/{id-to-date-CJbxtIFh.js → id-to-date-BJEGh6zQ.js} +1 -1
- package/dist/{purchase-order-transaction-type-0nZnCUE7.js → purchase-order-transaction-type-CAJDFGQP.js} +28 -27
- package/dist/{supplier-BA6jJGNv.js → supplier-ChSqlZUK.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-template-enabled-locations-2-Di0NHn-g.js → use-template-enabled-locations-2-B4M8z0b7.js} +1 -1
- package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +1 -0
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +522 -0
- package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +1 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +21 -0
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +21 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +1 -1
- package/dist/{xlsx-BEDKASqP.js → xlsx-BH3xrhEk.js} +1 -1
- package/dist/{xlsx.util-MTUBPx67.js → xlsx.util-DlY5MITI.js} +2 -2
- package/package.json +1 -1
- package/dist/TransferTemplateView-CUqEsRJ6.js +0 -1262
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { reactive as Ge, onMounted as Ee, computed as P, h as M, defineComponent as re, openBlock as F, createElementBlock as I, Fragment as ae, renderList as Pe, createElementVNode as r, toDisplayString as V, unref as e, resolveComponent as T, createVNode as k, withCtx as O, createCommentVNode as H, ref as N, createBlock as z, watch as Le, normalizeClass as Y, normalizeStyle as et, isRef as ce } from "vue";
|
|
2
2
|
import { useBreakpoints as qe, components as de, FmButtonVariant as tt, useSnackbar as $e, useDialog as st, useProxiedModel as ot } from "@feedmepos/ui-library";
|
|
3
3
|
import { F as be } from "./row-action.enum-PMKMRrZR.js";
|
|
4
|
-
import { P as A, d as Ne, c as nt } from "./purchase-order-transaction-type-
|
|
5
|
-
import { a as Z, t as lt,
|
|
6
|
-
import { _ as We, u as
|
|
4
|
+
import { P as A, d as Ne, c as nt } from "./purchase-order-transaction-type-CAJDFGQP.js";
|
|
5
|
+
import { a as Z, t as lt, ab as Te, E as at, b as He, R as Ie, a5 as rt, a7 as it, s as ut, a8 as Be, a6 as dt, H as ze, l as ct, A as Se, M as pt, ac as je, P as Ae, Q as Qe, ad as mt, j as Ve, ae as ft, u as De, af as yt, ag as vt, ah as bt, G as _t, ai as gt, aj as kt, z as Ct } from "./app-CFkNddzq.js";
|
|
6
|
+
import { _ as We, u as ht } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BwKpNPDY.js";
|
|
7
7
|
import { useI18n as me } from "@feedmepos/mf-common";
|
|
8
8
|
import "vue-router";
|
|
9
|
-
import { u as xe } from "./supplier-
|
|
10
|
-
import { d as
|
|
11
|
-
import { F as pe, _ as
|
|
12
|
-
import { _ as
|
|
13
|
-
function le(o,
|
|
14
|
-
var
|
|
15
|
-
if (
|
|
16
|
-
return
|
|
17
|
-
const
|
|
18
|
-
(
|
|
19
|
-
)) == null ? void 0 : g.defaultCost, t = o.defaultCost, n =
|
|
20
|
-
return
|
|
21
|
-
...lt(
|
|
9
|
+
import { u as xe } from "./supplier-ChSqlZUK.js";
|
|
10
|
+
import { d as wt } from "./defineDeepModel-DWffbsZh.js";
|
|
11
|
+
import { F as pe, _ as St } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
12
|
+
import { _ as xt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
13
|
+
function le(o, v, u, i) {
|
|
14
|
+
var c, p, g;
|
|
15
|
+
if (i != null && i.manualTotalCost)
|
|
16
|
+
return i == null ? void 0 : i.manualTotalCost;
|
|
17
|
+
const d = (g = (p = (c = i == null ? void 0 : i.supplier) == null ? void 0 : c.supplyItems) == null ? void 0 : p.find(
|
|
18
|
+
(f) => f.skuId === o._id
|
|
19
|
+
)) == null ? void 0 : g.defaultCost, t = o.defaultCost, n = d ?? t, w = n == null ? void 0 : n.costPerUnit, m = w ? n != null && n.measurement ? +Z(w) / +Z(n == null ? void 0 : n.measurement.conversion) : +Z(w) : void 0, s = m ? u ? m * +Z(u.conversion) : m : void 0, a = s ? +Z(v) * s : void 0;
|
|
20
|
+
return a ? {
|
|
21
|
+
...lt(a ?? 0, 2),
|
|
22
22
|
currency: Te()
|
|
23
23
|
} : {
|
|
24
24
|
amount: 0,
|
|
@@ -27,7 +27,7 @@ function le(o, y, u, l) {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
var B = /* @__PURE__ */ ((o) => (o.Code = "Code", o.Name = "Name", o.Amount = "Amount", o.Cost = "Cost", o.Delete = "Delete", o))(B || {});
|
|
30
|
-
const
|
|
30
|
+
const Ft = () => {
|
|
31
31
|
const { t: o } = me();
|
|
32
32
|
return M(
|
|
33
33
|
We,
|
|
@@ -38,36 +38,36 @@ const xt = () => {
|
|
|
38
38
|
o("inventory.transfer.form.items.table.Cost", [je()])
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
|
-
function
|
|
42
|
-
const { t:
|
|
41
|
+
function Pt(o) {
|
|
42
|
+
const { t: v } = me(), u = Ge({}), { breakpoints: i } = qe(), d = He();
|
|
43
43
|
Ee(() => {
|
|
44
|
-
for (const
|
|
45
|
-
if (!
|
|
44
|
+
for (const m of o.items) {
|
|
45
|
+
if (!m.totalCost)
|
|
46
46
|
continue;
|
|
47
|
-
const s = le(
|
|
47
|
+
const s = le(m.sku, m.quantity, m.measurement, {
|
|
48
48
|
supplier: o.supplier
|
|
49
|
-
}),
|
|
50
|
-
s ? u[
|
|
49
|
+
}), a = m.totalCost ?? at.reset();
|
|
50
|
+
s ? u[m.sku._id] = s.amount !== a.amount || s.precision !== a.precision : u[m.sku._id] = !0;
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
|
-
function t(
|
|
54
|
-
var
|
|
55
|
-
return !!(((
|
|
53
|
+
function t(m) {
|
|
54
|
+
var a, b, c, p, g, f, S;
|
|
55
|
+
return !!(((b = (a = m.defaultCost) == null ? void 0 : a.costPerUnit) == null ? void 0 : b.amount) ?? ((S = (f = (g = (p = (c = o.supplier) == null ? void 0 : c.supplyItems) == null ? void 0 : p.find((x) => x.skuId === m._id)) == null ? void 0 : g.defaultCost) == null ? void 0 : f.costPerUnit) == null ? void 0 : S.amount));
|
|
56
56
|
}
|
|
57
57
|
const n = [
|
|
58
58
|
{
|
|
59
59
|
id: "Code",
|
|
60
|
-
header: () =>
|
|
60
|
+
header: () => v("inventory.transfer.form.items.table.Code"),
|
|
61
61
|
accessorKey: "code",
|
|
62
62
|
size: 96,
|
|
63
|
-
cell(
|
|
64
|
-
const s =
|
|
63
|
+
cell(m) {
|
|
64
|
+
const s = m.row.original;
|
|
65
65
|
return M(de.FmTextField, {
|
|
66
66
|
modelValue: s.code,
|
|
67
|
-
"onUpdate:modelValue": (
|
|
67
|
+
"onUpdate:modelValue": (a) => {
|
|
68
68
|
o.updateItem({
|
|
69
69
|
...s,
|
|
70
|
-
code:
|
|
70
|
+
code: a
|
|
71
71
|
});
|
|
72
72
|
},
|
|
73
73
|
key: s.sku._id,
|
|
@@ -79,16 +79,16 @@ function Ft(o) {
|
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
id: "Name",
|
|
82
|
-
header: () =>
|
|
82
|
+
header: () => v("inventory.transfer.form.items.table.Name"),
|
|
83
83
|
minSize: 300,
|
|
84
|
-
cell(
|
|
85
|
-
const s =
|
|
84
|
+
cell(m) {
|
|
85
|
+
const s = m.row.original;
|
|
86
86
|
return M(de.FmTextField, {
|
|
87
87
|
modelValue: s.name,
|
|
88
|
-
"onUpdate:modelValue": (
|
|
88
|
+
"onUpdate:modelValue": (a) => {
|
|
89
89
|
o.updateItem({
|
|
90
90
|
...s,
|
|
91
|
-
name:
|
|
91
|
+
name: a
|
|
92
92
|
});
|
|
93
93
|
},
|
|
94
94
|
key: s.sku._id,
|
|
@@ -100,11 +100,11 @@ function Ft(o) {
|
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
id: "Amount",
|
|
103
|
-
header: () =>
|
|
103
|
+
header: () => v("inventory.transfer.form.items.table.Amount"),
|
|
104
104
|
minSize: 200,
|
|
105
|
-
cell(
|
|
106
|
-
var
|
|
107
|
-
const s =
|
|
105
|
+
cell(m) {
|
|
106
|
+
var b, c, p;
|
|
107
|
+
const s = m.row.original, a = (p = (c = (b = o.template) == null ? void 0 : b.purchaseOrder) == null ? void 0 : c.items) == null ? void 0 : p.find(
|
|
108
108
|
(g) => g.sku._id === s.sku._id
|
|
109
109
|
);
|
|
110
110
|
return M(rt, {
|
|
@@ -118,33 +118,34 @@ function Ft(o) {
|
|
|
118
118
|
key: s.sku._id,
|
|
119
119
|
unit: s.sku.unit,
|
|
120
120
|
"onUpdate:modelValue": (g) => {
|
|
121
|
-
const
|
|
121
|
+
const f = {
|
|
122
122
|
...s,
|
|
123
123
|
quantity: g.amount,
|
|
124
124
|
measurement: g.measurement
|
|
125
125
|
};
|
|
126
|
-
|
|
126
|
+
d.enableTotalCost && (f.totalCost = le(s.sku, s.quantity, s.measurement, {
|
|
127
127
|
supplier: o.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
|
|
130
|
-
manualTotalCost: u[s.sku._id] ?
|
|
131
|
-
})), o.updateItem(
|
|
130
|
+
manualTotalCost: u[s.sku._id] ? f.totalCost : void 0
|
|
131
|
+
})), o.updateItem(f);
|
|
132
132
|
},
|
|
133
|
-
stepper:
|
|
134
|
-
disableUnit: !!
|
|
133
|
+
stepper: a == null ? void 0 : a.quantityStep,
|
|
134
|
+
disableUnit: !!a,
|
|
135
135
|
disabled: o.disabled,
|
|
136
136
|
rules: [
|
|
137
137
|
it(
|
|
138
138
|
+Z(
|
|
139
|
-
(
|
|
139
|
+
(a == null ? void 0 : a.minimumQuantity) ?? {
|
|
140
140
|
amount: 1,
|
|
141
141
|
precision: ut(s.sku.unit, s.measurement)
|
|
142
142
|
}
|
|
143
143
|
)
|
|
144
144
|
),
|
|
145
|
-
|
|
146
|
-
+Z(
|
|
147
|
-
) : Be(1 / 0)
|
|
145
|
+
a != null && a.maximumQuantity ? Be(
|
|
146
|
+
+Z(a == null ? void 0 : a.maximumQuantity)
|
|
147
|
+
) : Be(1 / 0),
|
|
148
|
+
...a != null && a.quantityStep ? [dt(a.quantityStep)] : []
|
|
148
149
|
],
|
|
149
150
|
applyDefaultRules: !0
|
|
150
151
|
});
|
|
@@ -153,11 +154,11 @@ function Ft(o) {
|
|
|
153
154
|
},
|
|
154
155
|
{
|
|
155
156
|
id: "Cost",
|
|
156
|
-
header:
|
|
157
|
+
header: Ft,
|
|
157
158
|
size: 180,
|
|
158
|
-
cell(
|
|
159
|
-
const s =
|
|
160
|
-
return !u[s.sku._id] &&
|
|
159
|
+
cell(m) {
|
|
160
|
+
const s = m.row.original, a = t(s.sku), b = i.value.xs || i.value.sm;
|
|
161
|
+
return !u[s.sku._id] && a ? M(
|
|
161
162
|
"div",
|
|
162
163
|
{
|
|
163
164
|
class: [
|
|
@@ -188,7 +189,7 @@ function Ft(o) {
|
|
|
188
189
|
[
|
|
189
190
|
M(
|
|
190
191
|
"span",
|
|
191
|
-
|
|
192
|
+
b ? ze(
|
|
192
193
|
le(s.sku, s.quantity, s.measurement, {
|
|
193
194
|
supplier: o.supplier
|
|
194
195
|
})
|
|
@@ -206,7 +207,7 @@ function Ft(o) {
|
|
|
206
207
|
o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
|
|
207
208
|
]
|
|
208
209
|
},
|
|
209
|
-
|
|
210
|
+
v("inventory.transfer.form.items.autoCalculated")
|
|
210
211
|
)
|
|
211
212
|
]
|
|
212
213
|
)
|
|
@@ -216,20 +217,20 @@ function Ft(o) {
|
|
|
216
217
|
{
|
|
217
218
|
modelValue: Z(s.totalCost ?? { amount: 0, precision: 0 }),
|
|
218
219
|
key: s.sku._id,
|
|
219
|
-
"onUpdate:modelValue": (
|
|
220
|
+
"onUpdate:modelValue": (c) => {
|
|
220
221
|
o.updateItem({
|
|
221
222
|
...s,
|
|
222
223
|
totalCost: {
|
|
223
|
-
...
|
|
224
|
+
...ct(+c),
|
|
224
225
|
currency: Te()
|
|
225
226
|
}
|
|
226
227
|
});
|
|
227
228
|
},
|
|
228
|
-
rules: [Se(0),
|
|
229
|
+
rules: [Se(0), pt(2)]
|
|
229
230
|
},
|
|
230
231
|
{
|
|
231
232
|
prepend() {
|
|
232
|
-
return
|
|
233
|
+
return b ? M(
|
|
233
234
|
"div",
|
|
234
235
|
{
|
|
235
236
|
class: [
|
|
@@ -241,7 +242,7 @@ function Ft(o) {
|
|
|
241
242
|
) : null;
|
|
242
243
|
},
|
|
243
244
|
append() {
|
|
244
|
-
return
|
|
245
|
+
return a ? M(de.FmButton, {
|
|
245
246
|
prependIcon: "close",
|
|
246
247
|
variant: "tertiary",
|
|
247
248
|
disabled: o.disabled,
|
|
@@ -265,8 +266,8 @@ function Ft(o) {
|
|
|
265
266
|
{
|
|
266
267
|
id: "Delete",
|
|
267
268
|
header: "",
|
|
268
|
-
cell(
|
|
269
|
-
const s =
|
|
269
|
+
cell(m) {
|
|
270
|
+
const s = m.row.original;
|
|
270
271
|
return M(de.FmButton, {
|
|
271
272
|
key: s.sku._id,
|
|
272
273
|
class: "delete-button",
|
|
@@ -289,46 +290,46 @@ function Ft(o) {
|
|
|
289
290
|
}
|
|
290
291
|
];
|
|
291
292
|
return {
|
|
292
|
-
columnDefs: P(() =>
|
|
293
|
-
(
|
|
293
|
+
columnDefs: P(() => d.enableTotalCost && o.transferType === A.PURCHASE ? n : n.filter(
|
|
294
|
+
(m) => m.id !== "Cost"
|
|
294
295
|
/* Cost */
|
|
295
296
|
))
|
|
296
297
|
};
|
|
297
298
|
}
|
|
298
|
-
const
|
|
299
|
+
const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, It = { 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" }, Ye = /* @__PURE__ */ re({
|
|
299
300
|
__name: "SupplierPriceHistory",
|
|
300
301
|
props: {
|
|
301
302
|
prices: {}
|
|
302
303
|
},
|
|
303
304
|
setup(o) {
|
|
304
|
-
const
|
|
305
|
-
function u(
|
|
306
|
-
return
|
|
305
|
+
const v = xe();
|
|
306
|
+
function u(i) {
|
|
307
|
+
return v.suppliers.find((d) => d._id === i);
|
|
307
308
|
}
|
|
308
|
-
return (
|
|
309
|
-
(F(!0), I(ae, null, Pe(Object.keys(
|
|
309
|
+
return (i, d) => (F(), I("div", Tt, [
|
|
310
|
+
(F(!0), I(ae, null, Pe(Object.keys(i.prices), (t) => {
|
|
310
311
|
var n;
|
|
311
312
|
return F(), I("div", {
|
|
312
313
|
key: t,
|
|
313
314
|
class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
|
|
314
315
|
}, [
|
|
315
|
-
r("div",
|
|
316
|
-
r("div",
|
|
317
|
-
(F(!0), I(ae, null, Pe(
|
|
318
|
-
var
|
|
316
|
+
r("div", It, V((n = u(t)) == null ? void 0 : n.name), 1),
|
|
317
|
+
r("div", $t, [
|
|
318
|
+
(F(!0), I(ae, null, Pe(i.prices[t].slice(0, 3), (w) => {
|
|
319
|
+
var m;
|
|
319
320
|
return F(), I("div", {
|
|
320
321
|
key: w.date,
|
|
321
322
|
class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
|
|
322
323
|
}, [
|
|
323
|
-
r("div",
|
|
324
|
+
r("div", At, [
|
|
324
325
|
r("span", null, V(w.totalCost ? e(ze)(w.totalCost) : "No data"), 1),
|
|
325
|
-
|
|
326
|
+
d[0] || (d[0] = r("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
|
|
326
327
|
r("span", null, V(e(Z)(w.totalUnit, !1)), 1),
|
|
327
|
-
r("span", null, V(((
|
|
328
|
+
r("span", null, V(((m = w.measurement) == null ? void 0 : m.abbrev) ?? w.unit.abbrev), 1)
|
|
328
329
|
]),
|
|
329
|
-
r("div",
|
|
330
|
+
r("div", Vt, [
|
|
330
331
|
r("span", null, "(#" + V(w.seqNumber) + ")", 1),
|
|
331
|
-
|
|
332
|
+
d[1] || (d[1] = r("span", null, V(" "), -1)),
|
|
332
333
|
r("span", null, V(e(Ae)(new Date(w.date))), 1)
|
|
333
334
|
])
|
|
334
335
|
]);
|
|
@@ -338,10 +339,10 @@ const Pt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
338
339
|
}), 128))
|
|
339
340
|
]));
|
|
340
341
|
}
|
|
341
|
-
}),
|
|
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 = {
|
|
342
343
|
key: 0,
|
|
343
344
|
class: "flex-1 flex flex-col gap-4"
|
|
344
|
-
},
|
|
345
|
+
}, zt = /* @__PURE__ */ re({
|
|
345
346
|
__name: "TransferItem",
|
|
346
347
|
props: {
|
|
347
348
|
cellByColId: {},
|
|
@@ -350,70 +351,70 @@ const Pt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
350
351
|
row: {}
|
|
351
352
|
},
|
|
352
353
|
setup(o) {
|
|
353
|
-
const { t:
|
|
354
|
-
return (u,
|
|
355
|
-
var n, w,
|
|
356
|
-
const
|
|
357
|
-
return F(), I("div",
|
|
358
|
-
r("div",
|
|
359
|
-
r("div",
|
|
360
|
-
r("span",
|
|
361
|
-
r("span",
|
|
354
|
+
const { t: v } = me();
|
|
355
|
+
return (u, i) => {
|
|
356
|
+
var n, w, m, s, a, b, c, p, g, f, S, x, E, $, U, L, G, ee, K, J, j, _, C, D, te, Q, se;
|
|
357
|
+
const d = T("FmLabel"), t = T("FmSpacer");
|
|
358
|
+
return F(), I("div", Dt, [
|
|
359
|
+
r("div", Rt, [
|
|
360
|
+
r("div", Ot, [
|
|
361
|
+
r("span", Ut, " (" + V(u.row.original.sku.code) + ") ", 1),
|
|
362
|
+
r("span", Bt, V(u.row.original.sku.name), 1)
|
|
362
363
|
]),
|
|
363
364
|
r("div", null, [
|
|
364
365
|
k(e(pe), {
|
|
365
|
-
render: (
|
|
366
|
-
props: (
|
|
366
|
+
render: (m = (w = (n = u.cellByColId.Delete) == null ? void 0 : n.column) == null ? void 0 : w.columnDef) == null ? void 0 : m.cell,
|
|
367
|
+
props: (a = (s = u.cellByColId.Delete) == null ? void 0 : s.getContext) == null ? void 0 : a.call(s)
|
|
367
368
|
}, null, 8, ["render", "props"])
|
|
368
369
|
])
|
|
369
370
|
]),
|
|
370
|
-
r("div",
|
|
371
|
-
r("div",
|
|
372
|
-
k(
|
|
373
|
-
label: e(
|
|
371
|
+
r("div", Mt, [
|
|
372
|
+
r("div", Et, [
|
|
373
|
+
k(d, {
|
|
374
|
+
label: e(v)(`inventory.transfer.form.items.table.${e(B).Code}`)
|
|
374
375
|
}, null, 8, ["label"]),
|
|
375
376
|
k(e(pe), {
|
|
376
|
-
render: (
|
|
377
|
-
props: (
|
|
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
|
+
props: (f = (g = u.cellByColId[e(B).Code]) == null ? void 0 : g.getContext) == null ? void 0 : f.call(g)
|
|
378
379
|
}, null, 8, ["render", "props"]),
|
|
379
|
-
|
|
380
|
+
i[0] || (i[0] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
380
381
|
]),
|
|
381
|
-
r("div",
|
|
382
|
-
k(
|
|
383
|
-
label: e(
|
|
382
|
+
r("div", Lt, [
|
|
383
|
+
k(d, {
|
|
384
|
+
label: e(v)(`inventory.transfer.form.items.table.${e(B).Name}`)
|
|
384
385
|
}, null, 8, ["label"]),
|
|
385
386
|
k(e(pe), {
|
|
386
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,
|
|
387
388
|
props: (U = ($ = u.cellByColId[e(B).Name]) == null ? void 0 : $.getContext) == null ? void 0 : U.call($)
|
|
388
389
|
}, null, 8, ["render", "props"]),
|
|
389
|
-
|
|
390
|
+
i[1] || (i[1] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
390
391
|
])
|
|
391
392
|
]),
|
|
392
|
-
r("div",
|
|
393
|
-
r("div",
|
|
394
|
-
k(
|
|
395
|
-
label: e(
|
|
393
|
+
r("div", qt, [
|
|
394
|
+
r("div", Nt, [
|
|
395
|
+
k(d, {
|
|
396
|
+
label: e(v)(`inventory.transfer.form.items.table.${e(B).Amount}`)
|
|
396
397
|
}, null, 8, ["label"]),
|
|
397
398
|
k(e(pe), {
|
|
398
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,
|
|
399
400
|
props: (J = (K = u.cellByColId[e(B).Amount]) == null ? void 0 : K.getContext) == null ? void 0 : J.call(K)
|
|
400
401
|
}, null, 8, ["render", "props"]),
|
|
401
|
-
|
|
402
|
+
i[2] || (i[2] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
402
403
|
]),
|
|
403
|
-
u.cellByColId[e(B).Cost] ? (F(), I("div",
|
|
404
|
+
u.cellByColId[e(B).Cost] ? (F(), I("div", Ht, [
|
|
404
405
|
k(We, { "z-index": 50 }, {
|
|
405
406
|
default: O(() => [
|
|
406
|
-
k(
|
|
407
|
-
label: e(
|
|
407
|
+
k(d, {
|
|
408
|
+
label: e(v)(`inventory.transfer.form.items.table.${e(B).Cost}2`)
|
|
408
409
|
}, null, 8, ["label"])
|
|
409
410
|
]),
|
|
410
411
|
_: 1
|
|
411
412
|
}),
|
|
412
413
|
k(e(pe), {
|
|
413
|
-
render: (C = (
|
|
414
|
+
render: (C = (_ = (j = u.cellByColId[e(B).Cost]) == null ? void 0 : j.column) == null ? void 0 : _.columnDef) == null ? void 0 : C.cell,
|
|
414
415
|
props: (te = (D = u.cellByColId[e(B).Cost]) == null ? void 0 : D.getContext) == null ? void 0 : te.call(D)
|
|
415
416
|
}, null, 8, ["render", "props"]),
|
|
416
|
-
|
|
417
|
+
i[3] || (i[3] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
417
418
|
])) : H("", !0)
|
|
418
419
|
]),
|
|
419
420
|
u.showComparePrice && Object.keys(u.comparePriceBySku[(Q = u.row.original.sku) == null ? void 0 : Q._id] ?? {}).length > 0 ? (F(), I(ae, { key: 0 }, [
|
|
@@ -427,7 +428,7 @@ const Pt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
427
428
|
}
|
|
428
429
|
});
|
|
429
430
|
function _e(o) {
|
|
430
|
-
return
|
|
431
|
+
return mt.parse(o);
|
|
431
432
|
}
|
|
432
433
|
function we(o) {
|
|
433
434
|
return {
|
|
@@ -441,86 +442,86 @@ function we(o) {
|
|
|
441
442
|
address: o.doc.profile.address
|
|
442
443
|
};
|
|
443
444
|
}
|
|
444
|
-
function
|
|
445
|
-
const
|
|
446
|
-
|
|
445
|
+
function jt(o, v, u = !1) {
|
|
446
|
+
const i = xe(), d = Ve();
|
|
447
|
+
d.watchLocation(async () => {
|
|
447
448
|
var S;
|
|
448
|
-
await
|
|
449
|
-
const
|
|
450
|
-
if ((S =
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
...
|
|
454
|
-
supplier:
|
|
449
|
+
await i.readSuppliers();
|
|
450
|
+
const c = o();
|
|
451
|
+
if ((S = c.supplier) != null && S._id) return;
|
|
452
|
+
const p = d.businessLevel ? i.businessSuppliers[0] : i.suppliers[0], f = (u ? d.locations.filter((x) => x.doc._id !== d.currentLocation.doc._id) : d.locations)[0];
|
|
453
|
+
v({
|
|
454
|
+
...c,
|
|
455
|
+
supplier: p ? _e(p) : f ? we(f) : c.supplier
|
|
455
456
|
});
|
|
456
457
|
});
|
|
457
458
|
const t = P(
|
|
458
459
|
() => {
|
|
459
|
-
var
|
|
460
|
-
return typeof ((
|
|
460
|
+
var c, p;
|
|
461
|
+
return typeof ((p = (c = o()) == null ? void 0 : c.supplier) == null ? void 0 : p.internal) == "string" ? A.TRANSFER : A.PURCHASE;
|
|
461
462
|
}
|
|
462
463
|
), n = P({
|
|
463
464
|
get() {
|
|
464
|
-
var
|
|
465
|
-
return (
|
|
465
|
+
var c, p;
|
|
466
|
+
return (p = (c = o()) == null ? void 0 : c.supplier) == null ? void 0 : p._id;
|
|
466
467
|
},
|
|
467
|
-
set(
|
|
468
|
-
const
|
|
468
|
+
set(c) {
|
|
469
|
+
const p = o() ?? {};
|
|
469
470
|
if (t.value === A.PURCHASE) {
|
|
470
|
-
const E = (
|
|
471
|
-
|
|
472
|
-
...
|
|
473
|
-
supplier: E ? _e(E) :
|
|
471
|
+
const E = (d.businessLevel ? i.businessSuppliers : i.suppliers).find(($) => $._id === c);
|
|
472
|
+
v({
|
|
473
|
+
...p,
|
|
474
|
+
supplier: E ? _e(E) : p.supplier
|
|
474
475
|
});
|
|
475
476
|
return;
|
|
476
477
|
}
|
|
477
|
-
const S = (
|
|
478
|
-
|
|
479
|
-
...
|
|
480
|
-
supplier: S ? we(S) :
|
|
478
|
+
const S = (u ? d.locations.filter((x) => x.doc._id !== d.currentLocation.doc._id) : d.locations).find((x) => x.doc._id === c);
|
|
479
|
+
v({
|
|
480
|
+
...p,
|
|
481
|
+
supplier: S ? we(S) : p.supplier
|
|
481
482
|
});
|
|
482
483
|
}
|
|
483
|
-
}), w = P(() =>
|
|
484
|
+
}), w = P(() => i.locationSuppliers.map(_e)), m = P(() => i.businessSuppliers.map(_e)), s = P(() => {
|
|
484
485
|
var g;
|
|
485
|
-
const
|
|
486
|
-
return (
|
|
487
|
-
}),
|
|
486
|
+
const c = ((g = d._currentLocation) == null ? void 0 : g.type) === Qe.warehouse;
|
|
487
|
+
return (u ? d.locations.filter((f) => f.doc._id !== d.currentLocation.doc._id) : d.locations).filter((f) => c || f.acceptRequest).map(we);
|
|
488
|
+
}), a = P(() => {
|
|
488
489
|
if (t.value === A.PURCHASE) {
|
|
489
|
-
const
|
|
490
|
-
label:
|
|
491
|
-
value:
|
|
492
|
-
})), g =
|
|
493
|
-
label:
|
|
490
|
+
const p = w.value.map((f) => ({
|
|
491
|
+
label: f.name,
|
|
492
|
+
value: f._id
|
|
493
|
+
})), g = m.value.map((f) => ({
|
|
494
|
+
label: f.name,
|
|
494
495
|
sublabel: "Business supplier",
|
|
495
|
-
value:
|
|
496
|
+
value: f._id
|
|
496
497
|
}));
|
|
497
|
-
return
|
|
498
|
+
return d.businessLevel ? g : [...p, ...g];
|
|
498
499
|
}
|
|
499
|
-
return s.value.map((
|
|
500
|
-
label:
|
|
501
|
-
sublabel:
|
|
502
|
-
value:
|
|
500
|
+
return s.value.map((p) => ({
|
|
501
|
+
label: p.name,
|
|
502
|
+
sublabel: p.internal ? `${p.internal}` : void 0,
|
|
503
|
+
value: p._id
|
|
503
504
|
}));
|
|
504
|
-
}),
|
|
505
|
-
var
|
|
506
|
-
const
|
|
505
|
+
}), b = P(() => {
|
|
506
|
+
var f, S;
|
|
507
|
+
const c = (S = (f = o()) == null ? void 0 : f.supplier) == null ? void 0 : S._id;
|
|
507
508
|
if (t.value === A.PURCHASE) {
|
|
508
|
-
const x =
|
|
509
|
+
const x = i.suppliers.find((E) => E._id === c);
|
|
509
510
|
return x ? _e(x) : null;
|
|
510
511
|
}
|
|
511
|
-
const g =
|
|
512
|
+
const g = d.locations.find((x) => x.doc._id);
|
|
512
513
|
return g ? we(g) : null;
|
|
513
514
|
});
|
|
514
515
|
return {
|
|
515
516
|
transferLocationModel: n,
|
|
516
|
-
transferLocationOptions:
|
|
517
|
+
transferLocationOptions: a,
|
|
517
518
|
locationOptionsTypePurchase: w,
|
|
518
519
|
locationOptionsTypeTransfer: s,
|
|
519
|
-
selectedLocation:
|
|
520
|
+
selectedLocation: b
|
|
520
521
|
};
|
|
521
522
|
}
|
|
522
|
-
function
|
|
523
|
-
const
|
|
523
|
+
function Qt(o) {
|
|
524
|
+
const v = P({
|
|
524
525
|
get() {
|
|
525
526
|
const t = o.getEffectiveAt();
|
|
526
527
|
return t ? new Date(t) : null;
|
|
@@ -530,40 +531,40 @@ function jt(o) {
|
|
|
530
531
|
}
|
|
531
532
|
}), u = P({
|
|
532
533
|
get() {
|
|
533
|
-
return !!
|
|
534
|
+
return !!v.value;
|
|
534
535
|
},
|
|
535
536
|
set(t) {
|
|
536
|
-
t ?
|
|
537
|
+
t ? v.value = /* @__PURE__ */ new Date() : v.value = null;
|
|
537
538
|
}
|
|
538
|
-
}),
|
|
539
|
+
}), i = P({
|
|
539
540
|
get() {
|
|
540
|
-
return
|
|
541
|
+
return v.value === null ? "" : Ae(v.value);
|
|
541
542
|
},
|
|
542
543
|
set(t) {
|
|
543
|
-
t ?
|
|
544
|
+
t ? v.value = /* @__PURE__ */ new Date(`${t} ${d.value}`) : v.value = null;
|
|
544
545
|
}
|
|
545
|
-
}),
|
|
546
|
+
}), d = P({
|
|
546
547
|
get() {
|
|
547
|
-
return
|
|
548
|
+
return v.value === null ? "" : ft(v.value);
|
|
548
549
|
},
|
|
549
550
|
set(t) {
|
|
550
|
-
t ?
|
|
551
|
+
t ? v.value = /* @__PURE__ */ new Date(`${i.value} ${t}`) : v.value = null;
|
|
551
552
|
}
|
|
552
553
|
});
|
|
553
554
|
return {
|
|
554
|
-
backdatePo:
|
|
555
|
+
backdatePo: v,
|
|
555
556
|
backdateSwitch: u,
|
|
556
|
-
backdateModel:
|
|
557
|
-
backdateTimeModel:
|
|
557
|
+
backdateModel: i,
|
|
558
|
+
backdateTimeModel: d
|
|
558
559
|
};
|
|
559
560
|
}
|
|
560
|
-
const
|
|
561
|
+
const Wt = {
|
|
561
562
|
width: "24",
|
|
562
563
|
height: "24",
|
|
563
564
|
viewBox: "0 0 24 24",
|
|
564
565
|
fill: "none",
|
|
565
566
|
xmlns: "http://www.w3.org/2000/svg"
|
|
566
|
-
},
|
|
567
|
+
}, Yt = ["fill"], Zt = ["fill"], Kt = ["stroke"], Jt = ["stroke"], Xt = /* @__PURE__ */ re({
|
|
567
568
|
__name: "SparkIcon",
|
|
568
569
|
props: {
|
|
569
570
|
size: {
|
|
@@ -576,142 +577,142 @@ const Qt = {
|
|
|
576
577
|
}
|
|
577
578
|
},
|
|
578
579
|
setup(o) {
|
|
579
|
-
return (
|
|
580
|
+
return (v, u) => (F(), I("svg", Wt, [
|
|
580
581
|
r("path", {
|
|
581
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",
|
|
582
583
|
fill: o.color
|
|
583
|
-
}, null, 8,
|
|
584
|
+
}, null, 8, Yt),
|
|
584
585
|
r("path", {
|
|
585
586
|
d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
|
|
586
587
|
fill: o.color
|
|
587
|
-
}, null, 8,
|
|
588
|
+
}, null, 8, Zt),
|
|
588
589
|
r("path", {
|
|
589
590
|
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",
|
|
590
591
|
stroke: o.color,
|
|
591
592
|
"stroke-width": "1.5",
|
|
592
593
|
"stroke-linecap": "round",
|
|
593
594
|
"stroke-linejoin": "round"
|
|
594
|
-
}, null, 8,
|
|
595
|
+
}, null, 8, Kt),
|
|
595
596
|
r("path", {
|
|
596
597
|
d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
|
|
597
598
|
stroke: o.color,
|
|
598
599
|
"stroke-width": "1.5",
|
|
599
600
|
"stroke-linecap": "round",
|
|
600
601
|
"stroke-linejoin": "round"
|
|
601
|
-
}, null, 8,
|
|
602
|
+
}, null, 8, Jt)
|
|
602
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" }, Me = /* @__PURE__ */ re({
|
|
605
606
|
__name: "ForecastStock",
|
|
606
607
|
props: {
|
|
607
608
|
disabled: { type: Boolean }
|
|
608
609
|
},
|
|
609
610
|
emits: ["update:poItems"],
|
|
610
|
-
setup(o, { emit:
|
|
611
|
-
const u =
|
|
611
|
+
setup(o, { emit: v }) {
|
|
612
|
+
const u = v, i = N(!1), d = N(7), t = ht(), n = $e(), w = De(), { t: m } = me();
|
|
612
613
|
async function s() {
|
|
613
|
-
if (
|
|
614
|
+
if (d.value < 1)
|
|
614
615
|
return;
|
|
615
|
-
|
|
616
|
-
const
|
|
616
|
+
i.value = !1, await t.readPurchaseOrder(d.value);
|
|
617
|
+
const a = [];
|
|
617
618
|
if (t.purchaseOrderForecast.skus.length <= 0) {
|
|
618
619
|
n.open({
|
|
619
|
-
message:
|
|
620
|
+
message: m("inventory.transfer.form.items.forecastStock.notAvailable"),
|
|
620
621
|
type: "info"
|
|
621
622
|
});
|
|
622
623
|
return;
|
|
623
624
|
}
|
|
624
|
-
const
|
|
625
|
-
const g = w.skus.find((x) => x._id ===
|
|
626
|
-
if (
|
|
627
|
-
return
|
|
625
|
+
const b = t.purchaseOrderForecast.skus.reduce((c, p) => {
|
|
626
|
+
const g = w.skus.find((x) => x._id === p.id);
|
|
627
|
+
if (c.find((x) => x.sku._id === p.id) || !g)
|
|
628
|
+
return c;
|
|
628
629
|
const S = {
|
|
629
630
|
sku: g,
|
|
630
631
|
code: g.code,
|
|
631
632
|
name: g.name,
|
|
632
633
|
quantity: {
|
|
633
|
-
amount:
|
|
634
|
+
amount: p.amount,
|
|
634
635
|
precision: 0
|
|
635
636
|
}
|
|
636
637
|
};
|
|
637
|
-
return
|
|
638
|
-
},
|
|
639
|
-
u("update:poItems",
|
|
638
|
+
return c.push(S), c;
|
|
639
|
+
}, a);
|
|
640
|
+
u("update:poItems", b);
|
|
640
641
|
}
|
|
641
|
-
return (
|
|
642
|
-
const
|
|
643
|
-
return F(), z(
|
|
644
|
-
disabled:
|
|
642
|
+
return (a, b) => {
|
|
643
|
+
const c = T("FmButton"), p = T("FmIcon"), g = T("FmStepperField"), f = T("FmPopover");
|
|
644
|
+
return F(), z(f, {
|
|
645
|
+
disabled: a.disabled,
|
|
645
646
|
class: "flex",
|
|
646
|
-
"show-popover":
|
|
647
|
-
onPopoverChanged:
|
|
647
|
+
"show-popover": i.value,
|
|
648
|
+
onPopoverChanged: b[3] || (b[3] = (S) => i.value = S)
|
|
648
649
|
}, {
|
|
649
650
|
"popover-button": O(() => [
|
|
650
|
-
k(
|
|
651
|
+
k(c, {
|
|
651
652
|
label: "unused",
|
|
652
653
|
variant: "secondary",
|
|
653
|
-
"text-color":
|
|
654
|
+
"text-color": a.disabled ? "disabled" : "primary",
|
|
654
655
|
"bg-color": "transparent",
|
|
655
|
-
"border-color":
|
|
656
|
-
disabled:
|
|
656
|
+
"border-color": a.disabled ? "disabled" : "primary",
|
|
657
|
+
disabled: a.disabled
|
|
657
658
|
}, {
|
|
658
659
|
default: O(() => [
|
|
659
|
-
r("div",
|
|
660
|
-
k(
|
|
660
|
+
r("div", Gt, [
|
|
661
|
+
k(Xt, {
|
|
661
662
|
size: 24,
|
|
662
|
-
color:
|
|
663
|
+
color: a.disabled ? "#c7c7cc" : "#ff7823"
|
|
663
664
|
}, null, 8, ["color"]),
|
|
664
|
-
r("div",
|
|
665
|
+
r("div", es, V(e(m)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
665
666
|
])
|
|
666
667
|
]),
|
|
667
668
|
_: 1
|
|
668
669
|
}, 8, ["text-color", "border-color", "disabled"])
|
|
669
670
|
]),
|
|
670
671
|
default: O(() => [
|
|
671
|
-
r("div",
|
|
672
|
-
r("div",
|
|
673
|
-
r("div",
|
|
674
|
-
k(
|
|
672
|
+
r("div", ts, [
|
|
673
|
+
r("div", ss, [
|
|
674
|
+
r("div", os, [
|
|
675
|
+
k(xt, { "z-index": 99 }, {
|
|
675
676
|
default: O(() => [
|
|
676
|
-
r("p",
|
|
677
|
+
r("p", ns, V(e(m)("inventory.transfer.form.items.forecastStock.title")), 1)
|
|
677
678
|
]),
|
|
678
679
|
_: 1
|
|
679
680
|
})
|
|
680
681
|
]),
|
|
681
|
-
k(
|
|
682
|
+
k(c, {
|
|
682
683
|
icon: "close",
|
|
683
684
|
size: "md",
|
|
684
685
|
variant: "tertiary",
|
|
685
|
-
onClick:
|
|
686
|
+
onClick: b[0] || (b[0] = (S) => i.value = !1)
|
|
686
687
|
})
|
|
687
688
|
]),
|
|
688
689
|
k(g, {
|
|
689
|
-
modelValue:
|
|
690
|
-
"onUpdate:modelValue":
|
|
691
|
-
label: e(
|
|
690
|
+
modelValue: d.value,
|
|
691
|
+
"onUpdate:modelValue": b[1] || (b[1] = (S) => d.value = S),
|
|
692
|
+
label: e(m)("inventory.transfer.form.items.forecastStock.days"),
|
|
692
693
|
rules: [e(Se)(1)]
|
|
693
694
|
}, {
|
|
694
695
|
"helper-text": O(() => [
|
|
695
|
-
r("div",
|
|
696
|
-
k(
|
|
696
|
+
r("div", ls, [
|
|
697
|
+
k(p, {
|
|
697
698
|
name: "warning",
|
|
698
699
|
size: "sm",
|
|
699
700
|
class: "text-fm-color-system-warning-300"
|
|
700
701
|
}),
|
|
701
|
-
r("div",
|
|
702
|
+
r("div", as, V(e(m)("inventory.transfer.form.items.forecastStock.replace")), 1)
|
|
702
703
|
])
|
|
703
704
|
]),
|
|
704
705
|
_: 1
|
|
705
706
|
}, 8, ["modelValue", "label", "rules"]),
|
|
706
|
-
r("div",
|
|
707
|
-
|
|
708
|
-
k(
|
|
709
|
-
label: e(
|
|
707
|
+
r("div", rs, [
|
|
708
|
+
b[4] || (b[4] = r("div", { class: "grow" }, null, -1)),
|
|
709
|
+
k(c, {
|
|
710
|
+
label: e(m)("common.cancel"),
|
|
710
711
|
variant: "tertiary",
|
|
711
|
-
onClick:
|
|
712
|
+
onClick: b[2] || (b[2] = (S) => i.value = !1)
|
|
712
713
|
}, null, 8, ["label"]),
|
|
713
|
-
k(
|
|
714
|
-
label: e(
|
|
714
|
+
k(c, {
|
|
715
|
+
label: e(m)("inventory.transfer.form.items.forecastStock.generate"),
|
|
715
716
|
onClick: s
|
|
716
717
|
}, null, 8, ["label"])
|
|
717
718
|
])
|
|
@@ -722,37 +723,37 @@ const Qt = {
|
|
|
722
723
|
};
|
|
723
724
|
}
|
|
724
725
|
});
|
|
725
|
-
function
|
|
726
|
-
const o = $e(),
|
|
726
|
+
function is() {
|
|
727
|
+
const o = $e(), v = Ne(), u = N(!1);
|
|
727
728
|
Le(u, (n) => {
|
|
728
|
-
n && (
|
|
729
|
-
|
|
729
|
+
n && (d.value = !0, i().finally(() => {
|
|
730
|
+
d.value = !1;
|
|
730
731
|
}));
|
|
731
732
|
});
|
|
732
|
-
async function
|
|
733
|
+
async function i() {
|
|
733
734
|
try {
|
|
734
|
-
const { startDate: n, endDate: w } =
|
|
735
|
-
(
|
|
736
|
-
var
|
|
737
|
-
return
|
|
735
|
+
const { startDate: n, endDate: w } = yt(6), a = (await v.getPurchaseOrders({ start: n, end: w })).filter(
|
|
736
|
+
(b) => {
|
|
737
|
+
var c, p;
|
|
738
|
+
return b.status === vt.enum.COMPLETE && ((c = b.supplier) == null ? void 0 : c.internal) !== "warehouse" && ((p = b.supplier) == null ? void 0 : p.internal) !== "restaurant";
|
|
738
739
|
}
|
|
739
|
-
).reduce((
|
|
740
|
-
const
|
|
741
|
-
for (const
|
|
742
|
-
if (!
|
|
743
|
-
const S =
|
|
740
|
+
).reduce((b, c) => {
|
|
741
|
+
const p = new Date(bt(c._id)), g = c.supplier._id;
|
|
742
|
+
for (const f of c.items) {
|
|
743
|
+
if (!f.totalCost) continue;
|
|
744
|
+
const S = b[f.sku._id] ?? {}, x = S[g] ?? [];
|
|
744
745
|
x.push({
|
|
745
|
-
date:
|
|
746
|
-
totalUnit:
|
|
747
|
-
totalCost:
|
|
748
|
-
unit:
|
|
749
|
-
measurement:
|
|
750
|
-
seqNumber:
|
|
751
|
-
}), S[g] = x,
|
|
746
|
+
date: p.toISOString(),
|
|
747
|
+
totalUnit: f.quantity,
|
|
748
|
+
totalCost: f.totalCost,
|
|
749
|
+
unit: f.sku.unit,
|
|
750
|
+
measurement: f.measurement,
|
|
751
|
+
seqNumber: c.seqNumber
|
|
752
|
+
}), S[g] = x, b[f.sku._id] = S;
|
|
752
753
|
}
|
|
753
|
-
return
|
|
754
|
+
return b;
|
|
754
755
|
}, {});
|
|
755
|
-
t.value =
|
|
756
|
+
t.value = a;
|
|
756
757
|
} catch {
|
|
757
758
|
o.open({
|
|
758
759
|
title: "Something went wrong",
|
|
@@ -760,14 +761,14 @@ function rs() {
|
|
|
760
761
|
}), u.value = !1;
|
|
761
762
|
}
|
|
762
763
|
}
|
|
763
|
-
const
|
|
764
|
+
const d = N(!1), t = N({});
|
|
764
765
|
return {
|
|
765
766
|
comparePricesToggle: u,
|
|
766
|
-
comparePriceFetching:
|
|
767
|
+
comparePriceFetching: d,
|
|
767
768
|
comparePriceBySku: t
|
|
768
769
|
};
|
|
769
770
|
}
|
|
770
|
-
const
|
|
771
|
+
const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }, cs = ["colspan"], ps = /* @__PURE__ */ re({
|
|
771
772
|
__name: "TransferItemTable",
|
|
772
773
|
props: {
|
|
773
774
|
row: {},
|
|
@@ -775,11 +776,11 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
775
776
|
showComparePrice: { type: Boolean }
|
|
776
777
|
},
|
|
777
778
|
setup(o) {
|
|
778
|
-
function
|
|
779
|
+
function v(u) {
|
|
779
780
|
return u.column.columnDef.meta;
|
|
780
781
|
}
|
|
781
|
-
return (u,
|
|
782
|
-
var
|
|
782
|
+
return (u, i) => {
|
|
783
|
+
var d, t;
|
|
783
784
|
return F(), I(ae, null, [
|
|
784
785
|
r("tr", {
|
|
785
786
|
class: Y(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
|
|
@@ -787,20 +788,20 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
787
788
|
}])
|
|
788
789
|
}, [
|
|
789
790
|
(F(!0), I(ae, null, Pe(u.row.getVisibleCells(), (n) => {
|
|
790
|
-
var w,
|
|
791
|
+
var w, m, s, a;
|
|
791
792
|
return F(), I("td", {
|
|
792
793
|
key: n.id,
|
|
793
794
|
class: Y([
|
|
794
795
|
"h-[52px] px-16 text-fm-color-typo-primary",
|
|
795
|
-
((w =
|
|
796
|
+
((w = v(n)) == null ? void 0 : w.cellClass) ?? "px-16"
|
|
796
797
|
]),
|
|
797
798
|
style: et({
|
|
798
|
-
width: (
|
|
799
|
-
maxWidth: (s =
|
|
800
|
-
textAlign: ((
|
|
799
|
+
width: (m = v(n)) == null ? void 0 : m.width,
|
|
800
|
+
maxWidth: (s = v(n)) == null ? void 0 : s.maxWidth,
|
|
801
|
+
textAlign: ((a = v(n)) == null ? void 0 : a.textAlign) ?? "left"
|
|
801
802
|
})
|
|
802
803
|
}, [
|
|
803
|
-
r("span",
|
|
804
|
+
r("span", us, [
|
|
804
805
|
k(e(pe), {
|
|
805
806
|
render: n.column.columnDef.cell,
|
|
806
807
|
props: n.getContext()
|
|
@@ -809,134 +810,136 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
809
810
|
], 6);
|
|
810
811
|
}), 128))
|
|
811
812
|
], 2),
|
|
812
|
-
u.showComparePrice && Object.keys(u.comparePriceBySku[(
|
|
813
|
+
u.showComparePrice && Object.keys(u.comparePriceBySku[(d = u.row.original.sku) == null ? void 0 : d._id] ?? {}).length > 0 ? (F(), I("tr", ds, [
|
|
813
814
|
r("td", {
|
|
814
815
|
colspan: u.row.getVisibleCells().length
|
|
815
816
|
}, [
|
|
816
817
|
k(Ye, {
|
|
817
818
|
prices: u.comparePriceBySku[(t = u.row.original.sku) == null ? void 0 : t._id]
|
|
818
819
|
}, null, 8, ["prices"])
|
|
819
|
-
], 8,
|
|
820
|
+
], 8, cs)
|
|
820
821
|
])) : H("", !0)
|
|
821
822
|
], 64);
|
|
822
823
|
};
|
|
823
824
|
}
|
|
824
|
-
}),
|
|
825
|
+
}), ms = { class: "flex flex-col gap-4" }, fs = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, ys = { class: "flex flex-col gap-16" }, vs = { class: "flex flex-col gap-24" }, bs = { class: "flex flex-col gap-8" }, _s = { class: "flex flex-col gap-4" }, gs = { class: "flex flex-col gap-8" }, ks = { class: "flex flex-col gap-4" }, Cs = {
|
|
825
826
|
key: 3,
|
|
826
827
|
class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col"
|
|
827
|
-
},
|
|
828
|
+
}, hs = {
|
|
828
829
|
key: 0,
|
|
829
830
|
class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
|
|
830
|
-
},
|
|
831
|
+
}, ws = { class: "flex-1" }, Ss = { class: "flex-1" }, xs = {
|
|
831
832
|
key: 1,
|
|
832
833
|
class: "flex items-center gap-4"
|
|
833
|
-
},
|
|
834
|
+
}, Fs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, Ps = { class: "flex flex-col gap-16" }, Ts = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, Is = { class: "flex gap-8" }, $s = { key: 0 }, As = /* @__PURE__ */ re({
|
|
834
835
|
__name: "TransferForm2",
|
|
835
836
|
props: {
|
|
836
837
|
modelValue: {},
|
|
838
|
+
request: {},
|
|
837
839
|
disabled: { type: Boolean },
|
|
838
840
|
suppliers: {},
|
|
839
841
|
skus: {},
|
|
840
842
|
lastClosingDate: {}
|
|
841
843
|
},
|
|
842
844
|
emits: ["validation-success", "form:ready"],
|
|
843
|
-
setup(o, { expose:
|
|
844
|
-
const
|
|
845
|
-
() =>
|
|
845
|
+
setup(o, { expose: v, emit: u }) {
|
|
846
|
+
const i = o, d = u, t = wt(), { t: n } = me(), w = Ve(), m = De(), s = kt(), a = xe(), b = He(), c = nt(), { breakpoints: p } = qe(), g = P(() => p.value.xs || p.value.sm), f = P(
|
|
847
|
+
() => c.templates.value.find((l) => l._id === t.template)
|
|
846
848
|
), S = P(() => t.status === "DRAFT" || !t._rev);
|
|
847
849
|
Ee(async () => {
|
|
848
|
-
var
|
|
850
|
+
var l;
|
|
849
851
|
try {
|
|
850
852
|
if (!t.template) return;
|
|
851
|
-
await
|
|
853
|
+
await c.loadTemplate(t.template), t.items.length || (t.items = ((l = f.value) == null ? void 0 : l.purchaseOrder.items) ?? []);
|
|
852
854
|
} finally {
|
|
853
|
-
|
|
855
|
+
d("form:ready");
|
|
854
856
|
}
|
|
855
857
|
});
|
|
856
858
|
const x = P(
|
|
857
859
|
() => w.currentLocation.type === Qe.restaurant
|
|
858
860
|
);
|
|
859
861
|
w.watchLocation(async () => {
|
|
860
|
-
location && (t.supplier || (t.supplier =
|
|
862
|
+
location && (t.supplier || (t.supplier = a.suppliers.find((l) => l) ?? t.supplier));
|
|
861
863
|
});
|
|
862
|
-
const E = st(), $ =
|
|
864
|
+
const E = st(), $ = jt(
|
|
863
865
|
() => t,
|
|
864
|
-
(
|
|
865
|
-
Object.assign(t,
|
|
866
|
-
}
|
|
866
|
+
(l) => {
|
|
867
|
+
Object.assign(t, l);
|
|
868
|
+
},
|
|
869
|
+
!0
|
|
867
870
|
), U = P({
|
|
868
871
|
get() {
|
|
869
|
-
var
|
|
870
|
-
return typeof ((
|
|
872
|
+
var l;
|
|
873
|
+
return typeof ((l = t == null ? void 0 : t.supplier) == null ? void 0 : l.internal) == "string" ? A.TRANSFER : A.PURCHASE;
|
|
871
874
|
},
|
|
872
|
-
set(
|
|
875
|
+
set(l) {
|
|
873
876
|
var q;
|
|
874
|
-
const
|
|
875
|
-
|
|
877
|
+
const y = typeof ((q = t == null ? void 0 : t.supplier) == null ? void 0 : q.internal) == "string" ? A.TRANSFER : A.PURCHASE;
|
|
878
|
+
l !== y && (t.supplier = l === A.PURCHASE ? $.locationOptionsTypePurchase.value[0] : $.locationOptionsTypeTransfer.value[0]);
|
|
876
879
|
}
|
|
877
880
|
}), L = P(() => $.transferLocationOptions.value), G = P({
|
|
878
881
|
get() {
|
|
879
882
|
return t.supplier._id;
|
|
880
883
|
},
|
|
881
|
-
set(
|
|
882
|
-
$.transferLocationModel.value =
|
|
884
|
+
set(l) {
|
|
885
|
+
$.transferLocationModel.value = l;
|
|
883
886
|
}
|
|
884
887
|
}), ee = P({
|
|
885
888
|
get() {
|
|
886
889
|
return t.remark ?? void 0;
|
|
887
890
|
},
|
|
888
|
-
set(
|
|
889
|
-
t.remark =
|
|
891
|
+
set(l) {
|
|
892
|
+
t.remark = l;
|
|
890
893
|
}
|
|
891
894
|
}), K = P({
|
|
892
895
|
get() {
|
|
893
|
-
var
|
|
894
|
-
return ((
|
|
896
|
+
var l;
|
|
897
|
+
return ((l = t.netSuite) == null ? void 0 : l.subsidiary) || {
|
|
895
898
|
subsidiary: {
|
|
896
899
|
id: "",
|
|
897
900
|
name: ""
|
|
898
901
|
}
|
|
899
902
|
};
|
|
900
903
|
},
|
|
901
|
-
set(
|
|
904
|
+
set(l) {
|
|
902
905
|
t.netSuite = {
|
|
903
906
|
...t.netSuite,
|
|
904
|
-
subsidiary:
|
|
907
|
+
subsidiary: l
|
|
905
908
|
}, t.items = t.items.filter(
|
|
906
|
-
(
|
|
909
|
+
(y) => {
|
|
907
910
|
var q;
|
|
908
|
-
return !s.getAvailableItems((q = t.netSuite) == null ? void 0 : q.subsidiary.id).includes(
|
|
911
|
+
return !s.getAvailableItems((q = t.netSuite) == null ? void 0 : q.subsidiary.id).includes(y.sku._id);
|
|
909
912
|
}
|
|
910
913
|
);
|
|
911
914
|
}
|
|
912
|
-
}), { backdatePo: J, backdateSwitch: j, backdateModel:
|
|
915
|
+
}), { backdatePo: J, backdateSwitch: j, backdateModel: _, backdateTimeModel: C } = Qt({
|
|
913
916
|
getEffectiveAt() {
|
|
914
917
|
return t.effectiveAt;
|
|
915
918
|
},
|
|
916
|
-
setEffectiveAt(
|
|
917
|
-
t.effectiveAt =
|
|
919
|
+
setEffectiveAt(l) {
|
|
920
|
+
t.effectiveAt = l;
|
|
918
921
|
}
|
|
919
|
-
}), { comparePricesToggle: D, comparePriceFetching: te, comparePriceBySku: Q } =
|
|
920
|
-
|
|
922
|
+
}), { comparePricesToggle: D, comparePriceFetching: te, comparePriceBySku: Q } = is(), se = N();
|
|
923
|
+
v({
|
|
921
924
|
validateInputs: () => {
|
|
922
|
-
var
|
|
923
|
-
(
|
|
925
|
+
var l, y;
|
|
926
|
+
(y = (l = se.value) == null ? void 0 : l.validateInputs) == null || y.call(l);
|
|
924
927
|
},
|
|
925
928
|
resetInputsValidation: () => {
|
|
926
|
-
var
|
|
927
|
-
(
|
|
929
|
+
var l, y;
|
|
930
|
+
(y = (l = se.value) == null ? void 0 : l.resetInputsValidation) == null || y.call(l);
|
|
928
931
|
},
|
|
929
932
|
resetInputs: () => {
|
|
930
|
-
var
|
|
931
|
-
(
|
|
933
|
+
var l, y;
|
|
934
|
+
(y = (l = se.value) == null ? void 0 : l.resetInputs) == null || y.call(l);
|
|
932
935
|
}
|
|
933
936
|
});
|
|
934
|
-
const Ze =
|
|
935
|
-
updateItem: (
|
|
936
|
-
t.items = t.items.map((
|
|
937
|
+
const Ze = Pt({
|
|
938
|
+
updateItem: (l) => {
|
|
939
|
+
t.items = t.items.map((y) => y.sku._id !== l.sku._id ? y : l);
|
|
937
940
|
},
|
|
938
|
-
deleteItem: (
|
|
939
|
-
t.items = t.items.filter((
|
|
941
|
+
deleteItem: (l) => {
|
|
942
|
+
t.items = t.items.filter((y) => y.sku._id !== l.sku._id);
|
|
940
943
|
},
|
|
941
944
|
get supplier() {
|
|
942
945
|
return t.supplier;
|
|
@@ -948,15 +951,15 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
948
951
|
return U.value;
|
|
949
952
|
},
|
|
950
953
|
get template() {
|
|
951
|
-
return
|
|
954
|
+
return f.value;
|
|
952
955
|
},
|
|
953
956
|
get disabled() {
|
|
954
|
-
return
|
|
957
|
+
return i.disabled;
|
|
955
958
|
}
|
|
956
959
|
}), Ke = P(() => Ze.columnDefs.value);
|
|
957
960
|
function Je() {
|
|
958
961
|
var fe, ie, ke;
|
|
959
|
-
const
|
|
962
|
+
const l = new Set((ke = (ie = (fe = f.value) == null ? void 0 : fe.purchaseOrder) == null ? void 0 : ie.items) == null ? void 0 : ke.map((R) => R.sku._id)), q = (l.size ? m.skus.filter((R) => l.has(R._id)) : m.skus).filter((R) => {
|
|
960
963
|
var W;
|
|
961
964
|
return !s.getAvailableItems((W = t.netSuite) == null ? void 0 : W.subsidiary.id).includes(R._id);
|
|
962
965
|
}).map(
|
|
@@ -972,7 +975,7 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
972
975
|
E.open({
|
|
973
976
|
title: n("inventory.transfer.form.items.selectItem"),
|
|
974
977
|
closeButton: !0,
|
|
975
|
-
contentComponent:
|
|
978
|
+
contentComponent: Ct,
|
|
976
979
|
contentComponentProps: {
|
|
977
980
|
modelValue: ge,
|
|
978
981
|
items: q,
|
|
@@ -993,7 +996,7 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
993
996
|
const oe = W.find((ye) => ye.sku._id === X._id);
|
|
994
997
|
if (oe)
|
|
995
998
|
return oe;
|
|
996
|
-
const ne = ((he = (Ce =
|
|
999
|
+
const ne = ((he = (Ce = f.value) == null ? void 0 : Ce.purchaseOrder.items) == null ? void 0 : he.find(
|
|
997
1000
|
(ye) => ye.sku._id === X._id
|
|
998
1001
|
)) ?? {
|
|
999
1002
|
sku: X,
|
|
@@ -1016,18 +1019,18 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1016
1019
|
ue.sort((X, oe) => X.sku.code.localeCompare(oe.sku.code)), t.items = ue;
|
|
1017
1020
|
});
|
|
1018
1021
|
}
|
|
1019
|
-
function
|
|
1020
|
-
return
|
|
1022
|
+
function Os(l) {
|
|
1023
|
+
return l;
|
|
1021
1024
|
}
|
|
1022
|
-
return (
|
|
1025
|
+
return (l, y) => {
|
|
1023
1026
|
var Re, Oe;
|
|
1024
1027
|
const q = T("FmChip"), ge = T("FmLabel"), fe = T("FmField"), ie = T("FmSelect"), ke = T("FmTextField"), R = T("FmTextarea"), W = T("FmSwitch"), ue = T("FmDatePicker"), X = T("FmTimePicker"), oe = T("FmFormGroup"), ne = T("FmIcon"), Ce = T("FmButton"), he = T("FmTooltip"), ye = T("FmTable"), Xe = T("FmForm");
|
|
1025
|
-
return F(), I("div",
|
|
1026
|
-
r("div",
|
|
1027
|
-
(Re =
|
|
1028
|
+
return F(), I("div", ms, [
|
|
1029
|
+
r("div", fs, [
|
|
1030
|
+
(Re = i.modelValue) != null && Re.template ? (F(), z(q, {
|
|
1028
1031
|
key: 0,
|
|
1029
|
-
variant:
|
|
1030
|
-
label: `${e(n)("inventory.transfer.template.title")}: ${((Oe =
|
|
1032
|
+
variant: l.disabled ? "warning" : void 0,
|
|
1033
|
+
label: `${e(n)("inventory.transfer.template.title")}: ${((Oe = f.value) == null ? void 0 : Oe.name) ?? e(n)("inventory.transfer.form.loading")}`,
|
|
1031
1034
|
icon: "summarize",
|
|
1032
1035
|
compact: ""
|
|
1033
1036
|
}, null, 8, ["variant", "label"])) : H("", !0),
|
|
@@ -1036,9 +1039,9 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1036
1039
|
icon: "storefront",
|
|
1037
1040
|
compact: ""
|
|
1038
1041
|
}, null, 8, ["label"]),
|
|
1039
|
-
|
|
1042
|
+
l.lastClosingDate ? (F(), z(q, {
|
|
1040
1043
|
key: 1,
|
|
1041
|
-
label: `${e(n)("inventory.transfer.form.lastClosing")}: ${e(Ae)(
|
|
1044
|
+
label: `${e(n)("inventory.transfer.form.lastClosing")}: ${e(Ae)(l.lastClosingDate)} ${e(_t)(l.lastClosingDate)}`,
|
|
1042
1045
|
icon: "calendar_month",
|
|
1043
1046
|
compact: ""
|
|
1044
1047
|
}, null, 8, ["label"])) : H("", !0)
|
|
@@ -1047,25 +1050,25 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1047
1050
|
ref_key: "formRef",
|
|
1048
1051
|
ref: se,
|
|
1049
1052
|
class: "flex flex-col gap-32",
|
|
1050
|
-
disabled:
|
|
1053
|
+
disabled: l.disabled,
|
|
1051
1054
|
onValidationFailed: console.log,
|
|
1052
|
-
onValidationSuccess:
|
|
1055
|
+
onValidationSuccess: y[13] || (y[13] = (Fe) => d("validation-success"))
|
|
1053
1056
|
}, {
|
|
1054
1057
|
default: O(() => {
|
|
1055
1058
|
var Fe, Ue;
|
|
1056
1059
|
return [
|
|
1057
|
-
r("div",
|
|
1058
|
-
r("div",
|
|
1059
|
-
(Fe =
|
|
1060
|
-
r("div",
|
|
1060
|
+
r("div", ys, [
|
|
1061
|
+
r("div", vs, [
|
|
1062
|
+
(Fe = i.modelValue) != null && Fe.template ? (F(), I(ae, { key: 0 }, [
|
|
1063
|
+
r("div", bs, [
|
|
1061
1064
|
k(ge, {
|
|
1062
1065
|
label: e(n)("inventory.transfer.form.type.title")
|
|
1063
1066
|
}, null, 8, ["label"]),
|
|
1064
|
-
r("div",
|
|
1067
|
+
r("div", _s, [
|
|
1065
1068
|
k(fe, null, {
|
|
1066
1069
|
default: O(() => [
|
|
1067
1070
|
r("span", {
|
|
1068
|
-
class: Y({ "text-fm-color-typo-disabled":
|
|
1071
|
+
class: Y({ "text-fm-color-typo-disabled": l.disabled })
|
|
1069
1072
|
}, V(e(n)(`inventory.transfer.form.type.${U.value.toLocaleLowerCase("en-us")}`)), 3)
|
|
1070
1073
|
]),
|
|
1071
1074
|
_: 1
|
|
@@ -1073,22 +1076,22 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1073
1076
|
r("div", {
|
|
1074
1077
|
class: Y([
|
|
1075
1078
|
"fm-typo-en-body-sm-400",
|
|
1076
|
-
|
|
1079
|
+
l.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
|
|
1077
1080
|
])
|
|
1078
1081
|
}, " This field is locked from template. ", 2)
|
|
1079
1082
|
])
|
|
1080
1083
|
]),
|
|
1081
|
-
r("div",
|
|
1084
|
+
r("div", gs, [
|
|
1082
1085
|
k(ge, {
|
|
1083
1086
|
label: U.value === e(A).PURCHASE ? e(n)("inventory.transfer.form.purchaseFrom") : e(n)("inventory.transfer.form.transferFrom")
|
|
1084
1087
|
}, null, 8, ["label"]),
|
|
1085
|
-
r("div",
|
|
1088
|
+
r("div", ks, [
|
|
1086
1089
|
k(fe, null, {
|
|
1087
1090
|
default: O(() => {
|
|
1088
1091
|
var h;
|
|
1089
1092
|
return [
|
|
1090
1093
|
r("span", {
|
|
1091
|
-
class: Y({ "text-fm-color-typo-disabled":
|
|
1094
|
+
class: Y({ "text-fm-color-typo-disabled": l.disabled })
|
|
1092
1095
|
}, V((h = L.value.find((ve) => ve.value === G.value)) == null ? void 0 : h.label), 3)
|
|
1093
1096
|
];
|
|
1094
1097
|
}),
|
|
@@ -1097,7 +1100,7 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1097
1100
|
r("div", {
|
|
1098
1101
|
class: Y([
|
|
1099
1102
|
"fm-typo-en-body-sm-400",
|
|
1100
|
-
|
|
1103
|
+
l.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
|
|
1101
1104
|
])
|
|
1102
1105
|
}, " This field is locked from template. ", 2)
|
|
1103
1106
|
])
|
|
@@ -1106,7 +1109,7 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1106
1109
|
k(ie, {
|
|
1107
1110
|
label: e(n)("inventory.transfer.form.type.title"),
|
|
1108
1111
|
"model-value": U.value,
|
|
1109
|
-
"onUpdate:modelValue":
|
|
1112
|
+
"onUpdate:modelValue": y[0] || (y[0] = (h) => U.value = h),
|
|
1110
1113
|
items: [
|
|
1111
1114
|
{
|
|
1112
1115
|
label: e(n)("inventory.transfer.form.type.purchase"),
|
|
@@ -1126,7 +1129,7 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1126
1129
|
k(ie, {
|
|
1127
1130
|
label: U.value === e(A).PURCHASE ? e(n)("inventory.transfer.form.purchaseFrom") : e(n)("inventory.transfer.form.transferFrom"),
|
|
1128
1131
|
modelValue: G.value,
|
|
1129
|
-
"onUpdate:modelValue":
|
|
1132
|
+
"onUpdate:modelValue": y[1] || (y[1] = (h) => G.value = h),
|
|
1130
1133
|
items: L.value
|
|
1131
1134
|
}, null, 8, ["label", "modelValue", "items"])
|
|
1132
1135
|
], 64)),
|
|
@@ -1134,26 +1137,26 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1134
1137
|
label: e(n)("inventory.transfer.form.reference"),
|
|
1135
1138
|
"label-mark": "optional",
|
|
1136
1139
|
modelValue: e(t).ref,
|
|
1137
|
-
"onUpdate:modelValue":
|
|
1140
|
+
"onUpdate:modelValue": y[2] || (y[2] = (h) => e(t).ref = h)
|
|
1138
1141
|
}, null, 8, ["label", "modelValue"]),
|
|
1139
1142
|
k(R, {
|
|
1140
1143
|
label: e(n)("inventory.transfer.form.remark"),
|
|
1141
1144
|
"label-mark": "optional",
|
|
1142
1145
|
"max-length": 240,
|
|
1143
1146
|
modelValue: ee.value,
|
|
1144
|
-
"onUpdate:modelValue":
|
|
1145
|
-
class: Y([
|
|
1147
|
+
"onUpdate:modelValue": y[3] || (y[3] = (h) => ee.value = h),
|
|
1148
|
+
class: Y([l.disabled ? "text-fm-color-typo-disabled " : ""])
|
|
1146
1149
|
}, null, 8, ["label", "modelValue", "class"]),
|
|
1147
1150
|
e(s).isEnabled ? (F(), z(ie, {
|
|
1148
1151
|
key: 2,
|
|
1149
1152
|
modelValue: K.value,
|
|
1150
|
-
"onUpdate:modelValue":
|
|
1153
|
+
"onUpdate:modelValue": y[4] || (y[4] = (h) => K.value = h),
|
|
1151
1154
|
label: `NetSuite ${e(n)("inventory.transfer.form.netsuite.subsidiary")}`,
|
|
1152
1155
|
items: e(s).subsidiaryOptions,
|
|
1153
1156
|
"label-mark": "required",
|
|
1154
1157
|
rules: [e(Ie)()]
|
|
1155
1158
|
}, null, 8, ["modelValue", "label", "items", "rules"])) : H("", !0),
|
|
1156
|
-
e(
|
|
1159
|
+
e(b).enableBackdatePo ? (F(), I("div", Cs, [
|
|
1157
1160
|
r("div", {
|
|
1158
1161
|
class: Y([
|
|
1159
1162
|
"flex",
|
|
@@ -1164,26 +1167,26 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1164
1167
|
}, [
|
|
1165
1168
|
k(W, {
|
|
1166
1169
|
modelValue: e(j),
|
|
1167
|
-
"onUpdate:modelValue":
|
|
1170
|
+
"onUpdate:modelValue": y[5] || (y[5] = (h) => ce(j) ? j.value = h : null),
|
|
1168
1171
|
label: e(n)("inventory.transfer.form.backdate.title"),
|
|
1169
1172
|
sublabel: e(n)("inventory.transfer.form.backdate.subtitle"),
|
|
1170
1173
|
"label-placement": "right",
|
|
1171
|
-
disabled: x.value && !
|
|
1174
|
+
disabled: x.value && !l.lastClosingDate || l.disabled
|
|
1172
1175
|
}, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
|
|
1173
1176
|
r("div", {
|
|
1174
1177
|
class: Y({ hidden: g.value, "w-16": !g.value })
|
|
1175
1178
|
}, null, 2),
|
|
1176
|
-
e(j) ? (F(), I("div",
|
|
1177
|
-
r("div",
|
|
1179
|
+
e(j) ? (F(), I("div", hs, [
|
|
1180
|
+
r("div", ws, [
|
|
1178
1181
|
k(ue, {
|
|
1179
|
-
modelValue: e(
|
|
1180
|
-
"onUpdate:modelValue":
|
|
1182
|
+
modelValue: e(_),
|
|
1183
|
+
"onUpdate:modelValue": y[6] || (y[6] = (h) => ce(_) ? _.value = h : null)
|
|
1181
1184
|
}, null, 8, ["modelValue"])
|
|
1182
1185
|
]),
|
|
1183
|
-
r("div",
|
|
1186
|
+
r("div", Ss, [
|
|
1184
1187
|
k(X, {
|
|
1185
1188
|
modelValue: e(C),
|
|
1186
|
-
"onUpdate:modelValue":
|
|
1189
|
+
"onUpdate:modelValue": y[7] || (y[7] = (h) => ce(C) ? C.value = h : null)
|
|
1187
1190
|
}, null, 8, ["modelValue"])
|
|
1188
1191
|
])
|
|
1189
1192
|
])) : H("", !0)
|
|
@@ -1191,21 +1194,21 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1191
1194
|
e(J) ? (F(), z(oe, {
|
|
1192
1195
|
key: 0,
|
|
1193
1196
|
modelValue: e(J),
|
|
1194
|
-
"onUpdate:modelValue":
|
|
1195
|
-
rules: [e(
|
|
1197
|
+
"onUpdate:modelValue": y[8] || (y[8] = (h) => ce(J) ? J.value = h : null),
|
|
1198
|
+
rules: [e(gt)(new Date(l.lastClosingDate), /* @__PURE__ */ new Date())]
|
|
1196
1199
|
}, null, 8, ["modelValue", "rules"])) : H("", !0),
|
|
1197
|
-
x.value && !
|
|
1200
|
+
x.value && !l.lastClosingDate ? (F(), I("div", xs, [
|
|
1198
1201
|
k(ne, {
|
|
1199
1202
|
name: "error",
|
|
1200
1203
|
size: "sm",
|
|
1201
1204
|
class: "text-fm-color-typo-warning"
|
|
1202
1205
|
}),
|
|
1203
|
-
r("span",
|
|
1206
|
+
r("span", Fs, V(e(n)("inventory.transfer.form.backdate.error")), 1)
|
|
1204
1207
|
])) : H("", !0)
|
|
1205
1208
|
])) : H("", !0)
|
|
1206
1209
|
])
|
|
1207
1210
|
]),
|
|
1208
|
-
r("div",
|
|
1211
|
+
r("div", Ps, [
|
|
1209
1212
|
k(oe, {
|
|
1210
1213
|
"model-value": e(t).items,
|
|
1211
1214
|
rules: [e(Se)(1)]
|
|
@@ -1219,17 +1222,17 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1219
1222
|
}
|
|
1220
1223
|
])
|
|
1221
1224
|
}, [
|
|
1222
|
-
r("div",
|
|
1223
|
-
r("div",
|
|
1225
|
+
r("div", Ts, V(e(n)("inventory.transfer.form.items.title")), 1),
|
|
1226
|
+
r("div", Is, [
|
|
1224
1227
|
k(Ce, {
|
|
1225
|
-
disabled:
|
|
1228
|
+
disabled: l.disabled,
|
|
1226
1229
|
label: e(n)("inventory.transfer.form.items.addItem"),
|
|
1227
1230
|
"prepend-icon": "add",
|
|
1228
1231
|
variant: "secondary",
|
|
1229
1232
|
"text-color": "primary",
|
|
1230
1233
|
"bg-color": "transparent",
|
|
1231
1234
|
"border-color": "primary",
|
|
1232
|
-
onClick:
|
|
1235
|
+
onClick: y[9] || (y[9] = (h) => Je()),
|
|
1233
1236
|
size: "md"
|
|
1234
1237
|
}, null, 8, ["disabled", "label"]),
|
|
1235
1238
|
e(t).template ? (F(), z(he, {
|
|
@@ -1241,26 +1244,26 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1241
1244
|
]),
|
|
1242
1245
|
default: O(() => [
|
|
1243
1246
|
k(Me, {
|
|
1244
|
-
"onUpdate:poItems":
|
|
1247
|
+
"onUpdate:poItems": y[10] || (y[10] = (h) => e(t).items = h),
|
|
1245
1248
|
disabled: ""
|
|
1246
1249
|
})
|
|
1247
1250
|
]),
|
|
1248
1251
|
_: 1
|
|
1249
1252
|
})) : (F(), z(Me, {
|
|
1250
1253
|
key: 1,
|
|
1251
|
-
"onUpdate:poItems":
|
|
1252
|
-
disabled:
|
|
1254
|
+
"onUpdate:poItems": y[11] || (y[11] = (h) => e(t).items = h),
|
|
1255
|
+
disabled: l.disabled || !!e(t).template
|
|
1253
1256
|
}, null, 8, ["disabled"]))
|
|
1254
1257
|
])
|
|
1255
1258
|
], 2),
|
|
1256
|
-
U.value === e(A).PURCHASE && S.value && e(
|
|
1259
|
+
U.value === e(A).PURCHASE && S.value && e(b).enableTotalCost && ((Ue = l.modelValue) != null && Ue.items.length) ? (F(), I("div", $s, [
|
|
1257
1260
|
k(W, {
|
|
1258
1261
|
label: e(te) ? e(n)("inventory.transfer.form.items.fetchingData") : e(n)("inventory.transfer.form.items.comparePriceHistory"),
|
|
1259
1262
|
"prepend-icon": "compare_arrows",
|
|
1260
1263
|
"label-placement": "right",
|
|
1261
1264
|
"model-value": e(D),
|
|
1262
|
-
"onUpdate:modelValue":
|
|
1263
|
-
disabled: e(te) ||
|
|
1265
|
+
"onUpdate:modelValue": y[12] || (y[12] = (h) => ce(D) ? D.value = h : null),
|
|
1266
|
+
disabled: e(te) || l.disabled
|
|
1264
1267
|
}, null, 8, ["label", "model-value", "disabled"])
|
|
1265
1268
|
])) : H("", !0),
|
|
1266
1269
|
(F(), z(ye, {
|
|
@@ -1271,19 +1274,19 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1271
1274
|
"page-size": e(t).items.length
|
|
1272
1275
|
}, {
|
|
1273
1276
|
"table-row": O((h) => [
|
|
1274
|
-
k(
|
|
1277
|
+
k(ps, {
|
|
1275
1278
|
"compare-price-by-sku": e(Q),
|
|
1276
1279
|
"show-compare-price": U.value === e(A).PURCHASE && e(D),
|
|
1277
1280
|
row: h
|
|
1278
1281
|
}, null, 8, ["compare-price-by-sku", "show-compare-price", "row"])
|
|
1279
1282
|
]),
|
|
1280
1283
|
"list-row": O((h) => [
|
|
1281
|
-
(F(), z(
|
|
1284
|
+
(F(), z(St, {
|
|
1282
1285
|
row: h,
|
|
1283
1286
|
key: e(t).items.map((ve) => ve.sku._id).join(".")
|
|
1284
1287
|
}, {
|
|
1285
1288
|
default: O((ve) => [
|
|
1286
|
-
k(
|
|
1289
|
+
k(zt, {
|
|
1287
1290
|
"compare-price-by-sku": e(Q),
|
|
1288
1291
|
"show-compare-price": U.value === e(A).PURCHASE && e(D),
|
|
1289
1292
|
row: h,
|
|
@@ -1303,7 +1306,7 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1303
1306
|
]);
|
|
1304
1307
|
};
|
|
1305
1308
|
}
|
|
1306
|
-
}),
|
|
1309
|
+
}), Vs = { class: "flex items-center" }, Ds = { class: "fm-typo-en-title-md-800" }, Rs = { class: "flex gap-4" }, Ys = /* @__PURE__ */ re({
|
|
1307
1310
|
__name: "TransferDialog",
|
|
1308
1311
|
props: {
|
|
1309
1312
|
mode: {},
|
|
@@ -1313,25 +1316,25 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1313
1316
|
lastClosingDate: {}
|
|
1314
1317
|
},
|
|
1315
1318
|
emits: ["update:show", "submitted"],
|
|
1316
|
-
setup(o, { expose:
|
|
1319
|
+
setup(o, { expose: v, emit: u }) {
|
|
1317
1320
|
var j;
|
|
1318
|
-
const
|
|
1319
|
-
async function g(
|
|
1320
|
-
if (
|
|
1321
|
-
|
|
1321
|
+
const i = o, d = u, t = Ne(), n = $e(), w = xe(), m = De(), s = Ve(), { t: a } = me(), b = N(!1), c = N(!1), p = N(!1);
|
|
1322
|
+
async function g(_) {
|
|
1323
|
+
if (_) {
|
|
1324
|
+
c.value = !1;
|
|
1322
1325
|
try {
|
|
1323
|
-
await w.readSuppliers(),
|
|
1326
|
+
await w.readSuppliers(), c.value = !0;
|
|
1324
1327
|
} catch {
|
|
1325
1328
|
n.open({
|
|
1326
|
-
title:
|
|
1327
|
-
message:
|
|
1329
|
+
title: a("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
|
|
1330
|
+
message: a("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
|
|
1328
1331
|
type: "error"
|
|
1329
1332
|
});
|
|
1330
1333
|
}
|
|
1331
1334
|
}
|
|
1332
1335
|
}
|
|
1333
1336
|
s.watchLocation(g);
|
|
1334
|
-
function
|
|
1337
|
+
function f() {
|
|
1335
1338
|
return {
|
|
1336
1339
|
remark: void 0,
|
|
1337
1340
|
ref: void 0,
|
|
@@ -1361,82 +1364,82 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1361
1364
|
_id: "",
|
|
1362
1365
|
seqNumber: 0,
|
|
1363
1366
|
deliveryOrder: [],
|
|
1364
|
-
template:
|
|
1367
|
+
template: i.templateId
|
|
1365
1368
|
};
|
|
1366
1369
|
}
|
|
1367
|
-
const S = ot(
|
|
1370
|
+
const S = ot(i, "show"), x = N(i.modelValue ?? f()), E = N(((j = i.modelValue) == null ? void 0 : j._id) ?? `${Math.random()}`);
|
|
1368
1371
|
Le(
|
|
1369
|
-
() =>
|
|
1370
|
-
(
|
|
1372
|
+
() => i.show,
|
|
1373
|
+
(_) => {
|
|
1371
1374
|
var C;
|
|
1372
|
-
|
|
1375
|
+
_ && (p.value = !1, x.value = i.modelValue ?? f(), E.value = ((C = i.modelValue) == null ? void 0 : C._id) ?? `${Math.random()}`);
|
|
1373
1376
|
}
|
|
1374
1377
|
);
|
|
1375
|
-
const $ = P(() => !
|
|
1376
|
-
switch (
|
|
1378
|
+
const $ = P(() => !c.value || !p.value), U = P(() => {
|
|
1379
|
+
switch (i.mode) {
|
|
1377
1380
|
case be.READ:
|
|
1378
1381
|
return "View transfer";
|
|
1379
1382
|
case be.CREATE:
|
|
1380
|
-
return
|
|
1383
|
+
return a("inventory.transfer.receiveRequest.create.title");
|
|
1381
1384
|
case be.UPDATE:
|
|
1382
|
-
return
|
|
1385
|
+
return a("inventory.transfer.receiveRequest.update.title");
|
|
1383
1386
|
}
|
|
1384
1387
|
return "";
|
|
1385
1388
|
}), L = N();
|
|
1386
|
-
|
|
1389
|
+
v({
|
|
1387
1390
|
validateInputs: () => {
|
|
1388
|
-
var
|
|
1389
|
-
(C = (
|
|
1391
|
+
var _, C;
|
|
1392
|
+
(C = (_ = L.value) == null ? void 0 : _.validateInputs) == null || C.call(_);
|
|
1390
1393
|
},
|
|
1391
1394
|
resetInputsValidation: () => {
|
|
1392
|
-
var
|
|
1393
|
-
(C = (
|
|
1395
|
+
var _, C;
|
|
1396
|
+
(C = (_ = L.value) == null ? void 0 : _.resetInputsValidation) == null || C.call(_);
|
|
1394
1397
|
},
|
|
1395
1398
|
resetInputs: () => {
|
|
1396
|
-
var
|
|
1397
|
-
(C = (
|
|
1399
|
+
var _, C;
|
|
1400
|
+
(C = (_ = L.value) == null ? void 0 : _.resetInputs) == null || C.call(_);
|
|
1398
1401
|
}
|
|
1399
1402
|
});
|
|
1400
1403
|
async function G() {
|
|
1401
|
-
const
|
|
1402
|
-
|
|
1404
|
+
const _ = x.value;
|
|
1405
|
+
b.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: C, ...D }) => D));
|
|
1403
1406
|
try {
|
|
1404
|
-
await t.createPurchaseOrder(
|
|
1405
|
-
title:
|
|
1406
|
-
message:
|
|
1407
|
+
await t.createPurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)), n.open({
|
|
1408
|
+
title: a("inventory.transfer.receiveRequest.create.success"),
|
|
1409
|
+
message: a("inventory.transfer.receiveRequest.create.successMessage"),
|
|
1407
1410
|
type: "success"
|
|
1408
|
-
}),
|
|
1411
|
+
}), d("update:show", !1), d("submitted");
|
|
1409
1412
|
} catch (C) {
|
|
1410
1413
|
n.open({
|
|
1411
|
-
title:
|
|
1412
|
-
message:
|
|
1414
|
+
title: a("inventory.transfer.receiveRequest.create.error.title"),
|
|
1415
|
+
message: a("inventory.transfer.receiveRequest.create.error.message"),
|
|
1413
1416
|
type: "error"
|
|
1414
1417
|
}), console.error("Error in creating purchase order", C);
|
|
1415
1418
|
} finally {
|
|
1416
|
-
|
|
1419
|
+
b.value = !1;
|
|
1417
1420
|
}
|
|
1418
1421
|
}
|
|
1419
1422
|
async function ee() {
|
|
1420
|
-
const
|
|
1421
|
-
|
|
1423
|
+
const _ = x.value;
|
|
1424
|
+
b.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: C, ...D }) => D));
|
|
1422
1425
|
try {
|
|
1423
|
-
await t.updatePurchaseOrder(
|
|
1424
|
-
title:
|
|
1425
|
-
message:
|
|
1426
|
+
await t.updatePurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)), n.open({
|
|
1427
|
+
title: a("inventory.transfer.receiveRequest.update.success"),
|
|
1428
|
+
message: a("inventory.transfer.receiveRequest.update.successMessage"),
|
|
1426
1429
|
type: "success"
|
|
1427
|
-
}),
|
|
1430
|
+
}), d("update:show", !1), d("submitted");
|
|
1428
1431
|
} catch (C) {
|
|
1429
1432
|
n.open({
|
|
1430
|
-
title:
|
|
1431
|
-
message:
|
|
1433
|
+
title: a("inventory.transfer.receiveRequest.update.error.title"),
|
|
1434
|
+
message: a("inventory.transfer.receiveRequest.update.error.message"),
|
|
1432
1435
|
type: "error"
|
|
1433
1436
|
}), console.error("Error in updating purchase order", C);
|
|
1434
1437
|
} finally {
|
|
1435
|
-
|
|
1438
|
+
b.value = !1;
|
|
1436
1439
|
}
|
|
1437
1440
|
}
|
|
1438
1441
|
function K() {
|
|
1439
|
-
switch (
|
|
1442
|
+
switch (i.mode) {
|
|
1440
1443
|
case be.CREATE:
|
|
1441
1444
|
return G();
|
|
1442
1445
|
case be.UPDATE:
|
|
@@ -1444,10 +1447,10 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1444
1447
|
}
|
|
1445
1448
|
}
|
|
1446
1449
|
function J() {
|
|
1447
|
-
var
|
|
1448
|
-
(C = (
|
|
1450
|
+
var _, C;
|
|
1451
|
+
(C = (_ = L.value) == null ? void 0 : _.validateInputs) == null || C.call(_);
|
|
1449
1452
|
}
|
|
1450
|
-
return (
|
|
1453
|
+
return (_, C) => {
|
|
1451
1454
|
const D = T("FmButton"), te = T("FmSideSheet");
|
|
1452
1455
|
return F(), z(te, {
|
|
1453
1456
|
modelValue: e(S),
|
|
@@ -1457,39 +1460,39 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1457
1460
|
"max-width": 900
|
|
1458
1461
|
}, {
|
|
1459
1462
|
"side-sheet-header": O(() => [
|
|
1460
|
-
r("div",
|
|
1461
|
-
r("div",
|
|
1463
|
+
r("div", Vs, [
|
|
1464
|
+
r("div", Ds, V(U.value), 1)
|
|
1462
1465
|
])
|
|
1463
1466
|
]),
|
|
1464
1467
|
default: O(() => [
|
|
1465
|
-
(F(), z(
|
|
1468
|
+
(F(), z(As, {
|
|
1466
1469
|
class: "w-full",
|
|
1467
1470
|
ref_key: "formRef",
|
|
1468
1471
|
ref: L,
|
|
1469
|
-
"onForm:ready": C[0] || (C[0] = () =>
|
|
1472
|
+
"onForm:ready": C[0] || (C[0] = () => p.value = !0),
|
|
1470
1473
|
onValidationSuccess: K,
|
|
1471
1474
|
modelValue: x.value,
|
|
1472
1475
|
"onUpdate:modelValue": C[1] || (C[1] = (Q) => x.value = Q),
|
|
1473
|
-
disabled:
|
|
1476
|
+
disabled: b.value || $.value,
|
|
1474
1477
|
suppliers: e(w).suppliers,
|
|
1475
|
-
skus: e(
|
|
1478
|
+
skus: e(m).skus,
|
|
1476
1479
|
key: E.value,
|
|
1477
|
-
"last-closing-date":
|
|
1480
|
+
"last-closing-date": _.lastClosingDate
|
|
1478
1481
|
}, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
|
|
1479
1482
|
]),
|
|
1480
1483
|
"side-sheet-footer": O(() => [
|
|
1481
|
-
r("div",
|
|
1484
|
+
r("div", Rs, [
|
|
1482
1485
|
k(D, {
|
|
1483
|
-
loading:
|
|
1486
|
+
loading: b.value,
|
|
1484
1487
|
disabled: $.value,
|
|
1485
|
-
label: e(
|
|
1488
|
+
label: e(a)("common.save"),
|
|
1486
1489
|
onClick: J
|
|
1487
1490
|
}, null, 8, ["loading", "disabled", "label"]),
|
|
1488
1491
|
k(D, {
|
|
1489
1492
|
disabled: $.value,
|
|
1490
1493
|
variant: "tertiary",
|
|
1491
|
-
label: e(
|
|
1492
|
-
onClick: C[2] || (C[2] = (Q) =>
|
|
1494
|
+
label: e(a)("common.close"),
|
|
1495
|
+
onClick: C[2] || (C[2] = (Q) => d("update:show", !1))
|
|
1493
1496
|
}, null, 8, ["disabled", "label"])
|
|
1494
1497
|
])
|
|
1495
1498
|
]),
|
|
@@ -1499,7 +1502,7 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
|
|
|
1499
1502
|
}
|
|
1500
1503
|
});
|
|
1501
1504
|
export {
|
|
1502
|
-
|
|
1505
|
+
Ys as _,
|
|
1503
1506
|
le as c,
|
|
1504
|
-
|
|
1507
|
+
jt as u
|
|
1505
1508
|
};
|