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