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