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