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