@feedmepos/mf-inventory-portal 0.0.22-dev.17 → 0.0.22-dev.19
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-CejADKvT.js → ApprovalView-DD_lqQyg.js} +4 -4
- package/dist/{BindingsDialog-CCS9ek6i.js → BindingsDialog-CZk3Vdnx.js} +1 -1
- package/dist/{BindingsPicker-aN6Bt5S-.js → BindingsPicker-C1AH5FdB.js} +1 -1
- package/dist/{BindingsTable-BWy16dDq.js → BindingsTable-CBX6Q6AL.js} +1 -1
- package/dist/{ClosingTemplateView-CcpTmujq.js → ClosingTemplateView-DIwPDy2t.js} +5 -5
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CnqvCwZ1.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-W06VyJ31.js} +1 -1
- package/dist/{IngredientsView-e1fUwLV5.js → IngredientsView-BC8YIErg.js} +3 -3
- package/dist/{IntegrationView-wClaTngm.js → IntegrationView-DENEIkTh.js} +2 -2
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BLcWv-4F.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CgnLlcQZ.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-5oJQidum.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DNPwbLEZ.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-B8L_w8dN.js → PurchaseOrderPrintPreview-CpBmXdD0.js} +1 -1
- package/dist/{ReceiveRequestView-DjkgdIE_.js → ReceiveRequestView-C81Zf3zY.js} +6 -6
- package/dist/{RecipeView-DCBx5IFe.js → RecipeView-TFZgTDUh.js} +3 -3
- package/dist/{StockView-Cn1b4T7N.js → StockView-bgZTOV6i.js} +6 -6
- package/dist/{SupplierView-DYtpWPFD.js → SupplierView-BYyQxw0t.js} +3 -3
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CY6OZxCv.js +776 -0
- package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-B7DXQ57v.js → TransferDialog.vue_vue_type_script_setup_true_lang-uSVIE5_5.js} +235 -232
- package/dist/{TransferTemplateView-CxZIwfiT.js → TransferTemplateView-BFhNAi7K.js} +8 -8
- package/dist/{UnitView-EQl6iujM.js → UnitView-DX5CnVUR.js} +4 -4
- package/dist/{WarehouseView-BMBM2emY.js → WarehouseView-THb6FBXI.js} +2 -2
- package/dist/{app-Ai2ZyFFs.js → app-BWF5tQwd.js} +313 -308
- package/dist/app.js +1 -1
- package/dist/{decimal-CHqei97s.js → decimal-BFC0XDk1.js} +1 -1
- package/dist/{defineDeepModel-CkReIsWC.js → defineDeepModel-KSKvsqlu.js} +1 -1
- package/dist/{format-time-from-id-Cb2zp48Q.js → format-time-from-id-DtUlqmuq.js} +1 -1
- package/dist/{id-to-date-CnOKmysf.js → id-to-date-D1NcrKrG.js} +1 -1
- package/dist/{purchase-order-transaction-type-CHRCkOeZ.js → purchase-order-transaction-type-C-dx5pQr.js} +3 -3
- package/dist/{supplier-rHVJDY4i.js → supplier-CUzOSQb7.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-template-enabled-locations-2-EztCYYTj.js → use-template-enabled-locations-2-CTYd9dEQ.js} +1 -1
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +50 -32
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +75 -48
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +75 -48
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +96 -48
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +32 -16
- package/dist/views/transfer-template/helpers/remove-deleted-skus.helper.d.ts +8 -4
- package/dist/{xlsx-_U0K6u2_.js → xlsx-Do087aDY.js} +1 -1
- package/dist/{xlsx.util-BCiEge44.js → xlsx.util-DD3Ate6Q.js} +2 -2
- package/package.json +1 -1
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DVlkmZxl.js +0 -763
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { reactive as Ge, onMounted as
|
|
2
|
-
import { useBreakpoints as qe, components as de, FmButtonVariant as tt, useSnackbar as
|
|
1
|
+
import { reactive as Ge, onMounted as Le, computed as P, h as M, defineComponent as re, openBlock as F, createElementBlock as I, Fragment as ae, renderList as Pe, createElementVNode as r, toDisplayString as V, unref as e, resolveComponent as T, createVNode as k, withCtx as O, createCommentVNode as H, ref as N, createBlock as z, watch as $e, normalizeClass as Y, normalizeStyle as et, isRef as ce } from "vue";
|
|
2
|
+
import { useBreakpoints as qe, components as de, FmButtonVariant as tt, useSnackbar as Ae, useDialog as st, useProxiedModel as ot } from "@feedmepos/ui-library";
|
|
3
3
|
import { F as be } from "./row-action.enum-PMKMRrZR.js";
|
|
4
|
-
import { P as A, d as Ne, c as nt } from "./purchase-order-transaction-type-
|
|
5
|
-
import { a as Z, t as lt, ab as Te, E as at, b as He, R as Ie, a5 as rt, a7 as it, s as ut, a8 as
|
|
6
|
-
import { _ as We, u as ht } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { P as A, d as Ne, c as nt } from "./purchase-order-transaction-type-C-dx5pQr.js";
|
|
5
|
+
import { a as Z, t as lt, ab as Te, E as at, b as He, R as Ie, a5 as rt, a7 as it, s as ut, a8 as Me, a6 as dt, H as ze, m as ct, A as Se, M as pt, ac as je, P as Ve, Q as Qe, ad as mt, j as De, ae as ft, u as Re, af as yt, ag as vt, ah as bt, G as _t, ai as gt, aj as kt, z as Ct } from "./app-BWF5tQwd.js";
|
|
6
|
+
import { _ as We, u as ht } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DNPwbLEZ.js";
|
|
7
7
|
import { useI18n as me } from "@feedmepos/mf-common";
|
|
8
8
|
import "vue-router";
|
|
9
|
-
import { u as xe } from "./supplier-
|
|
10
|
-
import { d as wt } from "./defineDeepModel-
|
|
9
|
+
import { u as xe } from "./supplier-CUzOSQb7.js";
|
|
10
|
+
import { d as wt } from "./defineDeepModel-KSKvsqlu.js";
|
|
11
11
|
import { F as pe, _ as St } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
12
12
|
import { _ as xt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
13
|
-
function le(
|
|
13
|
+
function le(n, v, u, i) {
|
|
14
14
|
var c, p, g;
|
|
15
15
|
if (i != null && i.manualTotalCost)
|
|
16
16
|
return i == null ? void 0 : i.manualTotalCost;
|
|
17
17
|
const d = (g = (p = (c = i == null ? void 0 : i.supplier) == null ? void 0 : c.supplyItems) == null ? void 0 : p.find(
|
|
18
|
-
(
|
|
19
|
-
)) == null ? void 0 : g.defaultCost, t =
|
|
18
|
+
(y) => y.skuId === n._id
|
|
19
|
+
)) == null ? void 0 : g.defaultCost, t = n.defaultCost, l = d ?? t, w = l == null ? void 0 : l.costPerUnit, m = w ? l != null && l.measurement ? +Z(w) / +Z(l == null ? void 0 : l.measurement.conversion) : +Z(w) : void 0, s = m ? u ? m * +Z(u.conversion) : m : void 0, a = s ? +Z(v) * s : void 0;
|
|
20
20
|
return a ? {
|
|
21
21
|
...lt(a ?? 0, 2),
|
|
22
22
|
currency: Te()
|
|
@@ -26,35 +26,35 @@ function le(o, v, u, i) {
|
|
|
26
26
|
currency: Te()
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
var B = /* @__PURE__ */ ((
|
|
29
|
+
var B = /* @__PURE__ */ ((n) => (n.Code = "Code", n.Name = "Name", n.Amount = "Amount", n.Cost = "Cost", n.Delete = "Delete", n))(B || {});
|
|
30
30
|
const Ft = () => {
|
|
31
|
-
const { t:
|
|
31
|
+
const { t: n } = me();
|
|
32
32
|
return M(
|
|
33
33
|
We,
|
|
34
34
|
{
|
|
35
35
|
zIndex: 50,
|
|
36
36
|
class: "whitespace-nowrap"
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
n("inventory.transfer.form.items.table.Cost", [je()])
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
|
-
function Pt(
|
|
41
|
+
function Pt(n) {
|
|
42
42
|
const { t: v } = me(), u = Ge({}), { breakpoints: i } = qe(), d = He();
|
|
43
|
-
|
|
44
|
-
for (const m of
|
|
43
|
+
Le(() => {
|
|
44
|
+
for (const m of n.items) {
|
|
45
45
|
if (!m.totalCost)
|
|
46
46
|
continue;
|
|
47
47
|
const s = le(m.sku, m.quantity, m.measurement, {
|
|
48
|
-
supplier:
|
|
48
|
+
supplier: n.supplier
|
|
49
49
|
}), a = m.totalCost ?? at.reset();
|
|
50
50
|
s ? u[m.sku._id] = s.amount !== a.amount || s.precision !== a.precision : u[m.sku._id] = !0;
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
function t(m) {
|
|
54
|
-
var a, b, c, p, g,
|
|
55
|
-
return !!(((b = (a = m.defaultCost) == null ? void 0 : a.costPerUnit) == null ? void 0 : b.amount) ?? ((S = (
|
|
54
|
+
var a, b, c, p, g, y, S;
|
|
55
|
+
return !!(((b = (a = m.defaultCost) == null ? void 0 : a.costPerUnit) == null ? void 0 : b.amount) ?? ((S = (y = (g = (p = (c = n.supplier) == null ? void 0 : c.supplyItems) == null ? void 0 : p.find((x) => x.skuId === m._id)) == null ? void 0 : g.defaultCost) == null ? void 0 : y.costPerUnit) == null ? void 0 : S.amount));
|
|
56
56
|
}
|
|
57
|
-
const
|
|
57
|
+
const l = [
|
|
58
58
|
{
|
|
59
59
|
id: "Code",
|
|
60
60
|
header: () => v("inventory.transfer.form.items.table.Code"),
|
|
@@ -65,7 +65,7 @@ function Pt(o) {
|
|
|
65
65
|
return M(de.FmTextField, {
|
|
66
66
|
modelValue: s.code,
|
|
67
67
|
"onUpdate:modelValue": (a) => {
|
|
68
|
-
|
|
68
|
+
n.updateItem({
|
|
69
69
|
...s,
|
|
70
70
|
code: a
|
|
71
71
|
});
|
|
@@ -86,7 +86,7 @@ function Pt(o) {
|
|
|
86
86
|
return M(de.FmTextField, {
|
|
87
87
|
modelValue: s.name,
|
|
88
88
|
"onUpdate:modelValue": (a) => {
|
|
89
|
-
|
|
89
|
+
n.updateItem({
|
|
90
90
|
...s,
|
|
91
91
|
name: a
|
|
92
92
|
});
|
|
@@ -104,7 +104,7 @@ function Pt(o) {
|
|
|
104
104
|
minSize: 200,
|
|
105
105
|
cell(m) {
|
|
106
106
|
var b, c, p;
|
|
107
|
-
const s = m.row.original, a = (p = (c = (b =
|
|
107
|
+
const s = m.row.original, a = (p = (c = (b = n.template) == null ? void 0 : b.purchaseOrder) == null ? void 0 : c.items) == null ? void 0 : p.find(
|
|
108
108
|
(g) => g.sku._id === s.sku._id
|
|
109
109
|
);
|
|
110
110
|
return M(rt, {
|
|
@@ -118,21 +118,21 @@ function Pt(o) {
|
|
|
118
118
|
key: s.sku._id,
|
|
119
119
|
unit: s.sku.unit,
|
|
120
120
|
"onUpdate:modelValue": (g) => {
|
|
121
|
-
const
|
|
121
|
+
const y = {
|
|
122
122
|
...s,
|
|
123
123
|
quantity: g.amount,
|
|
124
124
|
measurement: g.measurement
|
|
125
125
|
};
|
|
126
|
-
d.enableTotalCost && (
|
|
127
|
-
supplier:
|
|
126
|
+
d.enableTotalCost && (y.totalCost = le(s.sku, s.quantity, s.measurement, {
|
|
127
|
+
supplier: n.supplier,
|
|
128
128
|
// NOTE: set undefined here if `manualTotalCost[row.sku._id] = false`, so that the function
|
|
129
129
|
// will return the auto calculated default cost instead of the manual total cost
|
|
130
|
-
manualTotalCost: u[s.sku._id] ?
|
|
131
|
-
})),
|
|
130
|
+
manualTotalCost: u[s.sku._id] ? y.totalCost : void 0
|
|
131
|
+
})), n.updateItem(y);
|
|
132
132
|
},
|
|
133
133
|
stepper: a == null ? void 0 : a.quantityStep,
|
|
134
134
|
disableUnit: !!a,
|
|
135
|
-
disabled:
|
|
135
|
+
disabled: n.disabled,
|
|
136
136
|
rules: [
|
|
137
137
|
it(
|
|
138
138
|
+Z(
|
|
@@ -142,9 +142,9 @@ function Pt(o) {
|
|
|
142
142
|
}
|
|
143
143
|
)
|
|
144
144
|
),
|
|
145
|
-
a != null && a.maximumQuantity ?
|
|
145
|
+
a != null && a.maximumQuantity ? Me(
|
|
146
146
|
+Z(a == null ? void 0 : a.maximumQuantity)
|
|
147
|
-
) :
|
|
147
|
+
) : Me(1 / 0),
|
|
148
148
|
...a != null && a.quantityStep ? [dt(a.quantityStep)] : []
|
|
149
149
|
],
|
|
150
150
|
applyDefaultRules: !0
|
|
@@ -163,7 +163,7 @@ function Pt(o) {
|
|
|
163
163
|
{
|
|
164
164
|
class: [
|
|
165
165
|
"flex gap-4 fm-typo-en-body-md-400 items-center",
|
|
166
|
-
|
|
166
|
+
n.disabled ? "text-fm-color-typo-disabled" : ""
|
|
167
167
|
],
|
|
168
168
|
key: s.sku._id
|
|
169
169
|
},
|
|
@@ -171,12 +171,12 @@ function Pt(o) {
|
|
|
171
171
|
M(de.FmButton, {
|
|
172
172
|
prependIcon: "edit",
|
|
173
173
|
variant: tt.Tertiary,
|
|
174
|
-
disabled:
|
|
174
|
+
disabled: n.disabled,
|
|
175
175
|
onClick() {
|
|
176
|
-
|
|
176
|
+
n.updateItem({
|
|
177
177
|
...s,
|
|
178
178
|
totalCost: le(s.sku, s.quantity, s.measurement, {
|
|
179
|
-
supplier:
|
|
179
|
+
supplier: n.supplier
|
|
180
180
|
})
|
|
181
181
|
}), u[s.sku._id] = !0;
|
|
182
182
|
}
|
|
@@ -191,11 +191,11 @@ function Pt(o) {
|
|
|
191
191
|
"span",
|
|
192
192
|
b ? ze(
|
|
193
193
|
le(s.sku, s.quantity, s.measurement, {
|
|
194
|
-
supplier:
|
|
194
|
+
supplier: n.supplier
|
|
195
195
|
})
|
|
196
196
|
) : Z(
|
|
197
197
|
le(s.sku, s.quantity, s.measurement, {
|
|
198
|
-
supplier:
|
|
198
|
+
supplier: n.supplier
|
|
199
199
|
})
|
|
200
200
|
)
|
|
201
201
|
),
|
|
@@ -204,7 +204,7 @@ function Pt(o) {
|
|
|
204
204
|
{
|
|
205
205
|
class: [
|
|
206
206
|
"fm-typo-en-body-sm-400",
|
|
207
|
-
|
|
207
|
+
n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
|
|
208
208
|
]
|
|
209
209
|
},
|
|
210
210
|
v("inventory.transfer.form.items.autoCalculated")
|
|
@@ -218,7 +218,7 @@ function Pt(o) {
|
|
|
218
218
|
modelValue: Z(s.totalCost ?? { amount: 0, precision: 0 }),
|
|
219
219
|
key: s.sku._id,
|
|
220
220
|
"onUpdate:modelValue": (c) => {
|
|
221
|
-
|
|
221
|
+
n.updateItem({
|
|
222
222
|
...s,
|
|
223
223
|
totalCost: {
|
|
224
224
|
...ct(+c),
|
|
@@ -235,7 +235,7 @@ function Pt(o) {
|
|
|
235
235
|
{
|
|
236
236
|
class: [
|
|
237
237
|
"text-fm-typo-en-body-lg-400",
|
|
238
|
-
|
|
238
|
+
n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
|
|
239
239
|
]
|
|
240
240
|
},
|
|
241
241
|
je()
|
|
@@ -245,14 +245,14 @@ function Pt(o) {
|
|
|
245
245
|
return a ? M(de.FmButton, {
|
|
246
246
|
prependIcon: "close",
|
|
247
247
|
variant: "tertiary",
|
|
248
|
-
disabled:
|
|
248
|
+
disabled: n.disabled,
|
|
249
249
|
onClick() {
|
|
250
|
-
|
|
250
|
+
n.updateItem({
|
|
251
251
|
...s,
|
|
252
252
|
// NOTE: different from PO template, if a default cost is reenabled,
|
|
253
253
|
// the total cost will automatically assigned
|
|
254
254
|
totalCost: le(s.sku, s.quantity, s.measurement, {
|
|
255
|
-
supplier:
|
|
255
|
+
supplier: n.supplier
|
|
256
256
|
})
|
|
257
257
|
}), u[s.sku._id] = !1;
|
|
258
258
|
}
|
|
@@ -275,9 +275,9 @@ function Pt(o) {
|
|
|
275
275
|
icon: "delete",
|
|
276
276
|
variant: "tertiary",
|
|
277
277
|
size: "md",
|
|
278
|
-
disabled:
|
|
278
|
+
disabled: n.disabled,
|
|
279
279
|
onClick: () => {
|
|
280
|
-
|
|
280
|
+
n.deleteItem(s);
|
|
281
281
|
}
|
|
282
282
|
});
|
|
283
283
|
},
|
|
@@ -290,7 +290,7 @@ function Pt(o) {
|
|
|
290
290
|
}
|
|
291
291
|
];
|
|
292
292
|
return {
|
|
293
|
-
columnDefs: P(() => d.enableTotalCost &&
|
|
293
|
+
columnDefs: P(() => d.enableTotalCost && n.transferType === A.PURCHASE ? l : l.filter(
|
|
294
294
|
(m) => m.id !== "Cost"
|
|
295
295
|
/* Cost */
|
|
296
296
|
))
|
|
@@ -301,19 +301,19 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
301
301
|
props: {
|
|
302
302
|
prices: {}
|
|
303
303
|
},
|
|
304
|
-
setup(
|
|
304
|
+
setup(n) {
|
|
305
305
|
const v = xe();
|
|
306
306
|
function u(i) {
|
|
307
307
|
return v.suppliers.find((d) => d._id === i);
|
|
308
308
|
}
|
|
309
309
|
return (i, d) => (F(), I("div", Tt, [
|
|
310
310
|
(F(!0), I(ae, null, Pe(Object.keys(i.prices), (t) => {
|
|
311
|
-
var
|
|
311
|
+
var l;
|
|
312
312
|
return F(), I("div", {
|
|
313
313
|
key: t,
|
|
314
314
|
class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
|
|
315
315
|
}, [
|
|
316
|
-
r("div", It, V((
|
|
316
|
+
r("div", It, V((l = u(t)) == null ? void 0 : l.name), 1),
|
|
317
317
|
r("div", $t, [
|
|
318
318
|
(F(!0), I(ae, null, Pe(i.prices[t].slice(0, 3), (w) => {
|
|
319
319
|
var m;
|
|
@@ -330,7 +330,7 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
330
330
|
r("div", Vt, [
|
|
331
331
|
r("span", null, "(#" + V(w.seqNumber) + ")", 1),
|
|
332
332
|
d[1] || (d[1] = r("span", null, V(" "), -1)),
|
|
333
|
-
r("span", null, V(e(
|
|
333
|
+
r("span", null, V(e(Ve)(new Date(w.date))), 1)
|
|
334
334
|
])
|
|
335
335
|
]);
|
|
336
336
|
}), 128))
|
|
@@ -350,10 +350,10 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
350
350
|
showComparePrice: { type: Boolean },
|
|
351
351
|
row: {}
|
|
352
352
|
},
|
|
353
|
-
setup(
|
|
353
|
+
setup(n) {
|
|
354
354
|
const { t: v } = me();
|
|
355
355
|
return (u, i) => {
|
|
356
|
-
var
|
|
356
|
+
var l, w, m, s, a, b, c, p, g, y, S, x, E, $, U, L, G, ee, K, J, j, _, C, D, te, Q, se;
|
|
357
357
|
const d = T("FmLabel"), t = T("FmSpacer");
|
|
358
358
|
return F(), I("div", Dt, [
|
|
359
359
|
r("div", Rt, [
|
|
@@ -363,7 +363,7 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
363
363
|
]),
|
|
364
364
|
r("div", null, [
|
|
365
365
|
k(e(pe), {
|
|
366
|
-
render: (m = (w = (
|
|
366
|
+
render: (m = (w = (l = u.cellByColId.Delete) == null ? void 0 : l.column) == null ? void 0 : w.columnDef) == null ? void 0 : m.cell,
|
|
367
367
|
props: (a = (s = u.cellByColId.Delete) == null ? void 0 : s.getContext) == null ? void 0 : a.call(s)
|
|
368
368
|
}, null, 8, ["render", "props"])
|
|
369
369
|
])
|
|
@@ -375,7 +375,7 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
375
375
|
}, null, 8, ["label"]),
|
|
376
376
|
k(e(pe), {
|
|
377
377
|
render: (p = (c = (b = u.cellByColId[e(B).Code]) == null ? void 0 : b.column) == null ? void 0 : c.columnDef) == null ? void 0 : p.cell,
|
|
378
|
-
props: (
|
|
378
|
+
props: (y = (g = u.cellByColId[e(B).Code]) == null ? void 0 : g.getContext) == null ? void 0 : y.call(g)
|
|
379
379
|
}, null, 8, ["render", "props"]),
|
|
380
380
|
i[0] || (i[0] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
381
381
|
]),
|
|
@@ -427,46 +427,46 @@ const Tt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
|
|
|
427
427
|
};
|
|
428
428
|
}
|
|
429
429
|
});
|
|
430
|
-
function _e(
|
|
431
|
-
return mt.parse(
|
|
430
|
+
function _e(n) {
|
|
431
|
+
return mt.parse(n);
|
|
432
432
|
}
|
|
433
|
-
function we(
|
|
433
|
+
function we(n) {
|
|
434
434
|
return {
|
|
435
|
-
_id:
|
|
436
|
-
internal:
|
|
437
|
-
contactName:
|
|
438
|
-
name:
|
|
439
|
-
email:
|
|
440
|
-
phoneNumber:
|
|
441
|
-
registrationNumber:
|
|
442
|
-
address:
|
|
435
|
+
_id: n.doc._id,
|
|
436
|
+
internal: n.type,
|
|
437
|
+
contactName: n.doc.profile.name,
|
|
438
|
+
name: n.doc.profile.name,
|
|
439
|
+
email: n.doc.profile.email,
|
|
440
|
+
phoneNumber: n.doc.profile.phoneNo,
|
|
441
|
+
registrationNumber: n.doc.profile.regNo,
|
|
442
|
+
address: n.doc.profile.address
|
|
443
443
|
};
|
|
444
444
|
}
|
|
445
|
-
function jt(
|
|
446
|
-
const i = xe(), d =
|
|
445
|
+
function jt(n, v, u = !1) {
|
|
446
|
+
const i = xe(), d = De();
|
|
447
447
|
d.watchLocation(async () => {
|
|
448
448
|
var S;
|
|
449
449
|
await i.readSuppliers();
|
|
450
|
-
const c =
|
|
450
|
+
const c = n();
|
|
451
451
|
if ((S = c.supplier) != null && S._id) return;
|
|
452
|
-
const p = d.businessLevel ? i.businessSuppliers[0] : i.suppliers[0],
|
|
452
|
+
const p = d.businessLevel ? i.businessSuppliers[0] : i.suppliers[0], y = (u ? d.locations.filter((x) => x.doc._id !== d.currentLocation.doc._id) : d.locations)[0];
|
|
453
453
|
v({
|
|
454
454
|
...c,
|
|
455
|
-
supplier: p ? _e(p) :
|
|
455
|
+
supplier: p ? _e(p) : y ? we(y) : c.supplier
|
|
456
456
|
});
|
|
457
457
|
});
|
|
458
458
|
const t = P(
|
|
459
459
|
() => {
|
|
460
460
|
var c, p;
|
|
461
|
-
return typeof ((p = (c =
|
|
461
|
+
return typeof ((p = (c = n()) == null ? void 0 : c.supplier) == null ? void 0 : p.internal) == "string" ? A.TRANSFER : A.PURCHASE;
|
|
462
462
|
}
|
|
463
|
-
),
|
|
463
|
+
), l = P({
|
|
464
464
|
get() {
|
|
465
465
|
var c, p;
|
|
466
|
-
return (p = (c =
|
|
466
|
+
return (p = (c = n()) == null ? void 0 : c.supplier) == null ? void 0 : p._id;
|
|
467
467
|
},
|
|
468
468
|
set(c) {
|
|
469
|
-
const p =
|
|
469
|
+
const p = n() ?? {};
|
|
470
470
|
if (t.value === A.PURCHASE) {
|
|
471
471
|
const E = (d.businessLevel ? i.businessSuppliers : i.suppliers).find(($) => $._id === c);
|
|
472
472
|
v({
|
|
@@ -484,16 +484,16 @@ function jt(o, v, u = !1) {
|
|
|
484
484
|
}), w = P(() => i.locationSuppliers.map(_e)), m = P(() => i.businessSuppliers.map(_e)), s = P(() => {
|
|
485
485
|
var g;
|
|
486
486
|
const c = ((g = d._currentLocation) == null ? void 0 : g.type) === Qe.warehouse;
|
|
487
|
-
return (u ? d.locations.filter((
|
|
487
|
+
return (u ? d.locations.filter((y) => y.doc._id !== d.currentLocation.doc._id) : d.locations).filter((y) => c || y.acceptRequest).map(we);
|
|
488
488
|
}), a = P(() => {
|
|
489
489
|
if (t.value === A.PURCHASE) {
|
|
490
|
-
const p = w.value.map((
|
|
491
|
-
label:
|
|
492
|
-
value:
|
|
493
|
-
})), g = m.value.map((
|
|
494
|
-
label:
|
|
490
|
+
const p = w.value.map((y) => ({
|
|
491
|
+
label: y.name,
|
|
492
|
+
value: y._id
|
|
493
|
+
})), g = m.value.map((y) => ({
|
|
494
|
+
label: y.name,
|
|
495
495
|
sublabel: "Business supplier",
|
|
496
|
-
value:
|
|
496
|
+
value: y._id
|
|
497
497
|
}));
|
|
498
498
|
return d.businessLevel ? g : [...p, ...g];
|
|
499
499
|
}
|
|
@@ -503,8 +503,8 @@ function jt(o, v, u = !1) {
|
|
|
503
503
|
value: p._id
|
|
504
504
|
}));
|
|
505
505
|
}), b = P(() => {
|
|
506
|
-
var
|
|
507
|
-
const c = (S = (
|
|
506
|
+
var y, S;
|
|
507
|
+
const c = (S = (y = n()) == null ? void 0 : y.supplier) == null ? void 0 : S._id;
|
|
508
508
|
if (t.value === A.PURCHASE) {
|
|
509
509
|
const x = i.suppliers.find((E) => E._id === c);
|
|
510
510
|
return x ? _e(x) : null;
|
|
@@ -513,21 +513,21 @@ function jt(o, v, u = !1) {
|
|
|
513
513
|
return g ? we(g) : null;
|
|
514
514
|
});
|
|
515
515
|
return {
|
|
516
|
-
transferLocationModel:
|
|
516
|
+
transferLocationModel: l,
|
|
517
517
|
transferLocationOptions: a,
|
|
518
518
|
locationOptionsTypePurchase: w,
|
|
519
519
|
locationOptionsTypeTransfer: s,
|
|
520
520
|
selectedLocation: b
|
|
521
521
|
};
|
|
522
522
|
}
|
|
523
|
-
function Qt(
|
|
523
|
+
function Qt(n) {
|
|
524
524
|
const v = P({
|
|
525
525
|
get() {
|
|
526
|
-
const t =
|
|
526
|
+
const t = n.getEffectiveAt();
|
|
527
527
|
return t ? new Date(t) : null;
|
|
528
528
|
},
|
|
529
529
|
set(t) {
|
|
530
|
-
|
|
530
|
+
n.setEffectiveAt((t == null ? void 0 : t.toISOString()) ?? null);
|
|
531
531
|
}
|
|
532
532
|
}), u = P({
|
|
533
533
|
get() {
|
|
@@ -538,7 +538,7 @@ function Qt(o) {
|
|
|
538
538
|
}
|
|
539
539
|
}), i = P({
|
|
540
540
|
get() {
|
|
541
|
-
return v.value === null ? "" :
|
|
541
|
+
return v.value === null ? "" : Ve(v.value);
|
|
542
542
|
},
|
|
543
543
|
set(t) {
|
|
544
544
|
t ? v.value = /* @__PURE__ */ new Date(`${t} ${d.value}`) : v.value = null;
|
|
@@ -576,47 +576,47 @@ const Wt = {
|
|
|
576
576
|
default: "#c7c7cc"
|
|
577
577
|
}
|
|
578
578
|
},
|
|
579
|
-
setup(
|
|
579
|
+
setup(n) {
|
|
580
580
|
return (v, u) => (F(), I("svg", Wt, [
|
|
581
581
|
r("path", {
|
|
582
582
|
d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
|
|
583
|
-
fill:
|
|
583
|
+
fill: n.color
|
|
584
584
|
}, null, 8, Yt),
|
|
585
585
|
r("path", {
|
|
586
586
|
d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
|
|
587
|
-
fill:
|
|
587
|
+
fill: n.color
|
|
588
588
|
}, null, 8, Zt),
|
|
589
589
|
r("path", {
|
|
590
590
|
d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
|
|
591
|
-
stroke:
|
|
591
|
+
stroke: n.color,
|
|
592
592
|
"stroke-width": "1.5",
|
|
593
593
|
"stroke-linecap": "round",
|
|
594
594
|
"stroke-linejoin": "round"
|
|
595
595
|
}, null, 8, Kt),
|
|
596
596
|
r("path", {
|
|
597
597
|
d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
|
|
598
|
-
stroke:
|
|
598
|
+
stroke: n.color,
|
|
599
599
|
"stroke-width": "1.5",
|
|
600
600
|
"stroke-linecap": "round",
|
|
601
601
|
"stroke-linejoin": "round"
|
|
602
602
|
}, null, 8, Jt)
|
|
603
603
|
]));
|
|
604
604
|
}
|
|
605
|
-
}), Gt = { class: "flex gap-8 items-center" }, es = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, ts = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, ss = { class: "flex items-center w-full" }, os = { class: "flex-1" }, ns = { class: "fm-typo-en-title-sm-800" }, ls = { class: "flex items-start gap-8" }, as = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, rs = { class: "flex gap-1" },
|
|
605
|
+
}), Gt = { class: "flex gap-8 items-center" }, es = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, ts = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, ss = { class: "flex items-center w-full" }, os = { class: "flex-1" }, ns = { class: "fm-typo-en-title-sm-800" }, ls = { class: "flex items-start gap-8" }, as = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, rs = { class: "flex gap-1" }, Ee = /* @__PURE__ */ re({
|
|
606
606
|
__name: "ForecastStock",
|
|
607
607
|
props: {
|
|
608
608
|
disabled: { type: Boolean }
|
|
609
609
|
},
|
|
610
610
|
emits: ["update:poItems"],
|
|
611
|
-
setup(
|
|
612
|
-
const u = v, i = N(!1), d = N(7), t = ht(),
|
|
611
|
+
setup(n, { emit: v }) {
|
|
612
|
+
const u = v, i = N(!1), d = N(7), t = ht(), l = Ae(), w = Re(), { t: m } = me();
|
|
613
613
|
async function s() {
|
|
614
614
|
if (d.value < 1)
|
|
615
615
|
return;
|
|
616
616
|
i.value = !1, await t.readPurchaseOrder(d.value);
|
|
617
617
|
const a = [];
|
|
618
618
|
if (t.purchaseOrderForecast.skus.length <= 0) {
|
|
619
|
-
|
|
619
|
+
l.open({
|
|
620
620
|
message: m("inventory.transfer.form.items.forecastStock.notAvailable"),
|
|
621
621
|
type: "info"
|
|
622
622
|
});
|
|
@@ -640,8 +640,8 @@ const Wt = {
|
|
|
640
640
|
u("update:poItems", b);
|
|
641
641
|
}
|
|
642
642
|
return (a, b) => {
|
|
643
|
-
const c = T("FmButton"), p = T("FmIcon"), g = T("FmStepperField"),
|
|
644
|
-
return F(), z(
|
|
643
|
+
const c = T("FmButton"), p = T("FmIcon"), g = T("FmStepperField"), y = T("FmPopover");
|
|
644
|
+
return F(), z(y, {
|
|
645
645
|
disabled: a.disabled,
|
|
646
646
|
class: "flex",
|
|
647
647
|
"show-popover": i.value,
|
|
@@ -724,38 +724,38 @@ const Wt = {
|
|
|
724
724
|
}
|
|
725
725
|
});
|
|
726
726
|
function is() {
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
|
|
727
|
+
const n = Ae(), v = Ne(), u = N(!1);
|
|
728
|
+
$e(u, (l) => {
|
|
729
|
+
l && (d.value = !0, i().finally(() => {
|
|
730
730
|
d.value = !1;
|
|
731
731
|
}));
|
|
732
732
|
});
|
|
733
733
|
async function i() {
|
|
734
734
|
try {
|
|
735
|
-
const { startDate:
|
|
735
|
+
const { startDate: l, endDate: w } = yt(6), a = (await v.getPurchaseOrders({ start: l, end: w })).filter(
|
|
736
736
|
(b) => {
|
|
737
737
|
var c, p;
|
|
738
738
|
return b.status === vt.enum.COMPLETE && ((c = b.supplier) == null ? void 0 : c.internal) !== "warehouse" && ((p = b.supplier) == null ? void 0 : p.internal) !== "restaurant";
|
|
739
739
|
}
|
|
740
740
|
).reduce((b, c) => {
|
|
741
741
|
const p = new Date(bt(c._id)), g = c.supplier._id;
|
|
742
|
-
for (const
|
|
743
|
-
if (!
|
|
744
|
-
const S = b[
|
|
742
|
+
for (const y of c.items) {
|
|
743
|
+
if (!y.totalCost) continue;
|
|
744
|
+
const S = b[y.sku._id] ?? {}, x = S[g] ?? [];
|
|
745
745
|
x.push({
|
|
746
746
|
date: p.toISOString(),
|
|
747
|
-
totalUnit:
|
|
748
|
-
totalCost:
|
|
749
|
-
unit:
|
|
750
|
-
measurement:
|
|
747
|
+
totalUnit: y.quantity,
|
|
748
|
+
totalCost: y.totalCost,
|
|
749
|
+
unit: y.sku.unit,
|
|
750
|
+
measurement: y.measurement,
|
|
751
751
|
seqNumber: c.seqNumber
|
|
752
|
-
}), S[g] = x, b[
|
|
752
|
+
}), S[g] = x, b[y.sku._id] = S;
|
|
753
753
|
}
|
|
754
754
|
return b;
|
|
755
755
|
}, {});
|
|
756
756
|
t.value = a;
|
|
757
757
|
} catch {
|
|
758
|
-
|
|
758
|
+
n.open({
|
|
759
759
|
title: "Something went wrong",
|
|
760
760
|
message: "Cannot retrieve supplier purchase history. Please try again."
|
|
761
761
|
}), u.value = !1;
|
|
@@ -775,7 +775,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
775
775
|
comparePriceBySku: {},
|
|
776
776
|
showComparePrice: { type: Boolean }
|
|
777
777
|
},
|
|
778
|
-
setup(
|
|
778
|
+
setup(n) {
|
|
779
779
|
function v(u) {
|
|
780
780
|
return u.column.columnDef.meta;
|
|
781
781
|
}
|
|
@@ -787,24 +787,24 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
787
787
|
"bg-fm-color-neutral-gray-100": u.row.getIsSelected()
|
|
788
788
|
}])
|
|
789
789
|
}, [
|
|
790
|
-
(F(!0), I(ae, null, Pe(u.row.getVisibleCells(), (
|
|
790
|
+
(F(!0), I(ae, null, Pe(u.row.getVisibleCells(), (l) => {
|
|
791
791
|
var w, m, s, a;
|
|
792
792
|
return F(), I("td", {
|
|
793
|
-
key:
|
|
793
|
+
key: l.id,
|
|
794
794
|
class: Y([
|
|
795
795
|
"h-[52px] px-16 text-fm-color-typo-primary",
|
|
796
|
-
((w = v(
|
|
796
|
+
((w = v(l)) == null ? void 0 : w.cellClass) ?? "px-16"
|
|
797
797
|
]),
|
|
798
798
|
style: et({
|
|
799
|
-
width: (m = v(
|
|
800
|
-
maxWidth: (s = v(
|
|
801
|
-
textAlign: ((a = v(
|
|
799
|
+
width: (m = v(l)) == null ? void 0 : m.width,
|
|
800
|
+
maxWidth: (s = v(l)) == null ? void 0 : s.maxWidth,
|
|
801
|
+
textAlign: ((a = v(l)) == null ? void 0 : a.textAlign) ?? "left"
|
|
802
802
|
})
|
|
803
803
|
}, [
|
|
804
804
|
r("span", us, [
|
|
805
805
|
k(e(pe), {
|
|
806
|
-
render:
|
|
807
|
-
props:
|
|
806
|
+
render: l.column.columnDef.cell,
|
|
807
|
+
props: l.getContext()
|
|
808
808
|
}, null, 8, ["render", "props"])
|
|
809
809
|
])
|
|
810
810
|
], 6);
|
|
@@ -842,15 +842,18 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
842
842
|
lastClosingDate: {}
|
|
843
843
|
},
|
|
844
844
|
emits: ["validation-success", "form:ready"],
|
|
845
|
-
setup(
|
|
846
|
-
const i =
|
|
847
|
-
() => c.templates.value.find((
|
|
845
|
+
setup(n, { expose: v, emit: u }) {
|
|
846
|
+
const i = n, d = u, t = wt(), { t: l } = me(), w = De(), m = Re(), s = kt(), a = xe(), b = He(), c = nt(), { breakpoints: p } = qe(), g = P(() => p.value.xs || p.value.sm), y = P(
|
|
847
|
+
() => c.templates.value.find((o) => o._id === t.template)
|
|
848
848
|
), S = P(() => t.status === "DRAFT" || !t._rev);
|
|
849
|
-
|
|
850
|
-
var
|
|
849
|
+
$e(y, (o) => {
|
|
850
|
+
var f;
|
|
851
|
+
o && ((f = t.supplier) != null && f._id || (t.supplier = (o == null ? void 0 : o.purchaseOrder.supplier) ?? t.supplier));
|
|
852
|
+
}), Le(async () => {
|
|
853
|
+
var o;
|
|
851
854
|
try {
|
|
852
855
|
if (!t.template) return;
|
|
853
|
-
await c.loadTemplate(t.template), t.items.length || (t.items = ((
|
|
856
|
+
await c.loadTemplate(t.template), t.items.length || (t.items = ((o = y.value) == null ? void 0 : o.purchaseOrder.items) ?? []);
|
|
854
857
|
} finally {
|
|
855
858
|
d("form:ready");
|
|
856
859
|
}
|
|
@@ -859,56 +862,56 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
859
862
|
() => w.currentLocation.type === Qe.restaurant
|
|
860
863
|
);
|
|
861
864
|
w.watchLocation(async () => {
|
|
862
|
-
location && (t.supplier || (t.supplier = a.suppliers.find((
|
|
865
|
+
location && (t.supplier || (t.supplier = a.suppliers.find((o) => o) ?? t.supplier));
|
|
863
866
|
});
|
|
864
867
|
const E = st(), $ = jt(
|
|
865
868
|
() => t,
|
|
866
|
-
(
|
|
867
|
-
Object.assign(t,
|
|
869
|
+
(o) => {
|
|
870
|
+
Object.assign(t, o);
|
|
868
871
|
},
|
|
869
872
|
!0
|
|
870
873
|
), U = P({
|
|
871
874
|
get() {
|
|
872
|
-
var
|
|
873
|
-
return typeof ((
|
|
875
|
+
var o;
|
|
876
|
+
return typeof ((o = t == null ? void 0 : t.supplier) == null ? void 0 : o.internal) == "string" ? A.TRANSFER : A.PURCHASE;
|
|
874
877
|
},
|
|
875
|
-
set(
|
|
878
|
+
set(o) {
|
|
876
879
|
var q;
|
|
877
|
-
const
|
|
878
|
-
|
|
880
|
+
const f = typeof ((q = t == null ? void 0 : t.supplier) == null ? void 0 : q.internal) == "string" ? A.TRANSFER : A.PURCHASE;
|
|
881
|
+
o !== f && (t.supplier = o === A.PURCHASE ? $.locationOptionsTypePurchase.value[0] : $.locationOptionsTypeTransfer.value[0]);
|
|
879
882
|
}
|
|
880
883
|
}), L = P(() => $.transferLocationOptions.value), G = P({
|
|
881
884
|
get() {
|
|
882
885
|
return t.supplier._id;
|
|
883
886
|
},
|
|
884
|
-
set(
|
|
885
|
-
$.transferLocationModel.value =
|
|
887
|
+
set(o) {
|
|
888
|
+
$.transferLocationModel.value = o;
|
|
886
889
|
}
|
|
887
890
|
}), ee = P({
|
|
888
891
|
get() {
|
|
889
892
|
return t.remark ?? void 0;
|
|
890
893
|
},
|
|
891
|
-
set(
|
|
892
|
-
t.remark =
|
|
894
|
+
set(o) {
|
|
895
|
+
t.remark = o;
|
|
893
896
|
}
|
|
894
897
|
}), K = P({
|
|
895
898
|
get() {
|
|
896
|
-
var
|
|
897
|
-
return ((
|
|
899
|
+
var o;
|
|
900
|
+
return ((o = t.netSuite) == null ? void 0 : o.subsidiary) || {
|
|
898
901
|
subsidiary: {
|
|
899
902
|
id: "",
|
|
900
903
|
name: ""
|
|
901
904
|
}
|
|
902
905
|
};
|
|
903
906
|
},
|
|
904
|
-
set(
|
|
907
|
+
set(o) {
|
|
905
908
|
t.netSuite = {
|
|
906
909
|
...t.netSuite,
|
|
907
|
-
subsidiary:
|
|
910
|
+
subsidiary: o
|
|
908
911
|
}, t.items = t.items.filter(
|
|
909
|
-
(
|
|
912
|
+
(f) => {
|
|
910
913
|
var q;
|
|
911
|
-
return !s.getAvailableItems((q = t.netSuite) == null ? void 0 : q.subsidiary.id).includes(
|
|
914
|
+
return !s.getAvailableItems((q = t.netSuite) == null ? void 0 : q.subsidiary.id).includes(f.sku._id);
|
|
912
915
|
}
|
|
913
916
|
);
|
|
914
917
|
}
|
|
@@ -916,30 +919,30 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
916
919
|
getEffectiveAt() {
|
|
917
920
|
return t.effectiveAt;
|
|
918
921
|
},
|
|
919
|
-
setEffectiveAt(
|
|
920
|
-
t.effectiveAt =
|
|
922
|
+
setEffectiveAt(o) {
|
|
923
|
+
t.effectiveAt = o;
|
|
921
924
|
}
|
|
922
925
|
}), { comparePricesToggle: D, comparePriceFetching: te, comparePriceBySku: Q } = is(), se = N();
|
|
923
926
|
v({
|
|
924
927
|
validateInputs: () => {
|
|
925
|
-
var
|
|
926
|
-
(
|
|
928
|
+
var o, f;
|
|
929
|
+
(f = (o = se.value) == null ? void 0 : o.validateInputs) == null || f.call(o);
|
|
927
930
|
},
|
|
928
931
|
resetInputsValidation: () => {
|
|
929
|
-
var
|
|
930
|
-
(
|
|
932
|
+
var o, f;
|
|
933
|
+
(f = (o = se.value) == null ? void 0 : o.resetInputsValidation) == null || f.call(o);
|
|
931
934
|
},
|
|
932
935
|
resetInputs: () => {
|
|
933
|
-
var
|
|
934
|
-
(
|
|
936
|
+
var o, f;
|
|
937
|
+
(f = (o = se.value) == null ? void 0 : o.resetInputs) == null || f.call(o);
|
|
935
938
|
}
|
|
936
939
|
});
|
|
937
940
|
const Ze = Pt({
|
|
938
|
-
updateItem: (
|
|
939
|
-
t.items = t.items.map((
|
|
941
|
+
updateItem: (o) => {
|
|
942
|
+
t.items = t.items.map((f) => f.sku._id !== o.sku._id ? f : o);
|
|
940
943
|
},
|
|
941
|
-
deleteItem: (
|
|
942
|
-
t.items = t.items.filter((
|
|
944
|
+
deleteItem: (o) => {
|
|
945
|
+
t.items = t.items.filter((f) => f.sku._id !== o.sku._id);
|
|
943
946
|
},
|
|
944
947
|
get supplier() {
|
|
945
948
|
return t.supplier;
|
|
@@ -951,7 +954,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
951
954
|
return U.value;
|
|
952
955
|
},
|
|
953
956
|
get template() {
|
|
954
|
-
return
|
|
957
|
+
return y.value;
|
|
955
958
|
},
|
|
956
959
|
get disabled() {
|
|
957
960
|
return i.disabled;
|
|
@@ -959,7 +962,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
959
962
|
}), Ke = P(() => Ze.columnDefs.value);
|
|
960
963
|
function Je() {
|
|
961
964
|
var fe, ie, ke;
|
|
962
|
-
const
|
|
965
|
+
const o = new Set((ke = (ie = (fe = y.value) == null ? void 0 : fe.purchaseOrder) == null ? void 0 : ie.items) == null ? void 0 : ke.map((R) => R.sku._id)), q = (o.size ? m.skus.filter((R) => o.has(R._id)) : m.skus).filter((R) => {
|
|
963
966
|
var W;
|
|
964
967
|
return !s.getAvailableItems((W = t.netSuite) == null ? void 0 : W.subsidiary.id).includes(R._id);
|
|
965
968
|
}).map(
|
|
@@ -973,7 +976,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
973
976
|
return (W = t.items) == null ? void 0 : W.find((ue) => ue.sku._id === R.value._id);
|
|
974
977
|
}).map((R) => R.value);
|
|
975
978
|
E.open({
|
|
976
|
-
title:
|
|
979
|
+
title: l("inventory.transfer.form.items.selectItem"),
|
|
977
980
|
closeButton: !0,
|
|
978
981
|
contentComponent: Ct,
|
|
979
982
|
contentComponentProps: {
|
|
@@ -982,11 +985,11 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
982
985
|
virtualScroll: !0
|
|
983
986
|
},
|
|
984
987
|
primaryActions: {
|
|
985
|
-
text:
|
|
988
|
+
text: l("common.confirm"),
|
|
986
989
|
close: !0
|
|
987
990
|
},
|
|
988
991
|
secondaryActions: {
|
|
989
|
-
text:
|
|
992
|
+
text: l("common.close"),
|
|
990
993
|
close: !0,
|
|
991
994
|
variant: "tertiary"
|
|
992
995
|
}
|
|
@@ -996,7 +999,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
996
999
|
const oe = W.find((ye) => ye.sku._id === X._id);
|
|
997
1000
|
if (oe)
|
|
998
1001
|
return oe;
|
|
999
|
-
const ne = ((he = (Ce =
|
|
1002
|
+
const ne = ((he = (Ce = y.value) == null ? void 0 : Ce.purchaseOrder.items) == null ? void 0 : he.find(
|
|
1000
1003
|
(ye) => ye.sku._id === X._id
|
|
1001
1004
|
)) ?? {
|
|
1002
1005
|
sku: X,
|
|
@@ -1019,18 +1022,18 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1019
1022
|
ue.sort((X, oe) => X.sku.code.localeCompare(oe.sku.code)), t.items = ue;
|
|
1020
1023
|
});
|
|
1021
1024
|
}
|
|
1022
|
-
function Os(
|
|
1023
|
-
return
|
|
1025
|
+
function Os(o) {
|
|
1026
|
+
return o;
|
|
1024
1027
|
}
|
|
1025
|
-
return (
|
|
1026
|
-
var
|
|
1028
|
+
return (o, f) => {
|
|
1029
|
+
var Oe, Ue;
|
|
1027
1030
|
const q = T("FmChip"), ge = T("FmLabel"), fe = T("FmField"), ie = T("FmSelect"), ke = T("FmTextField"), R = T("FmTextarea"), W = T("FmSwitch"), ue = T("FmDatePicker"), X = T("FmTimePicker"), oe = T("FmFormGroup"), ne = T("FmIcon"), Ce = T("FmButton"), he = T("FmTooltip"), ye = T("FmTable"), Xe = T("FmForm");
|
|
1028
1031
|
return F(), I("div", ms, [
|
|
1029
1032
|
r("div", fs, [
|
|
1030
|
-
(
|
|
1033
|
+
(Oe = i.modelValue) != null && Oe.template ? (F(), z(q, {
|
|
1031
1034
|
key: 0,
|
|
1032
|
-
variant:
|
|
1033
|
-
label: `${e(
|
|
1035
|
+
variant: o.disabled ? "warning" : void 0,
|
|
1036
|
+
label: `${e(l)("inventory.transfer.template.title")}: ${((Ue = y.value) == null ? void 0 : Ue.name) ?? e(l)("inventory.transfer.form.loading")}`,
|
|
1034
1037
|
icon: "summarize",
|
|
1035
1038
|
compact: ""
|
|
1036
1039
|
}, null, 8, ["variant", "label"])) : H("", !0),
|
|
@@ -1039,9 +1042,9 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1039
1042
|
icon: "storefront",
|
|
1040
1043
|
compact: ""
|
|
1041
1044
|
}, null, 8, ["label"]),
|
|
1042
|
-
|
|
1045
|
+
o.lastClosingDate ? (F(), z(q, {
|
|
1043
1046
|
key: 1,
|
|
1044
|
-
label: `${e(
|
|
1047
|
+
label: `${e(l)("inventory.transfer.form.lastClosing")}: ${e(Ve)(o.lastClosingDate)} ${e(_t)(o.lastClosingDate)}`,
|
|
1045
1048
|
icon: "calendar_month",
|
|
1046
1049
|
compact: ""
|
|
1047
1050
|
}, null, 8, ["label"])) : H("", !0)
|
|
@@ -1050,40 +1053,40 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1050
1053
|
ref_key: "formRef",
|
|
1051
1054
|
ref: se,
|
|
1052
1055
|
class: "flex flex-col gap-32",
|
|
1053
|
-
disabled:
|
|
1056
|
+
disabled: o.disabled,
|
|
1054
1057
|
onValidationFailed: console.log,
|
|
1055
|
-
onValidationSuccess:
|
|
1058
|
+
onValidationSuccess: f[13] || (f[13] = (Fe) => d("validation-success"))
|
|
1056
1059
|
}, {
|
|
1057
1060
|
default: O(() => {
|
|
1058
|
-
var Fe,
|
|
1061
|
+
var Fe, Be;
|
|
1059
1062
|
return [
|
|
1060
1063
|
r("div", ys, [
|
|
1061
1064
|
r("div", vs, [
|
|
1062
1065
|
(Fe = i.modelValue) != null && Fe.template ? (F(), I(ae, { key: 0 }, [
|
|
1063
1066
|
r("div", bs, [
|
|
1064
1067
|
k(ge, {
|
|
1065
|
-
label: e(
|
|
1068
|
+
label: e(l)("inventory.transfer.form.type.title")
|
|
1066
1069
|
}, null, 8, ["label"]),
|
|
1067
1070
|
r("div", _s, [
|
|
1068
1071
|
k(fe, null, {
|
|
1069
1072
|
default: O(() => [
|
|
1070
1073
|
r("span", {
|
|
1071
|
-
class: Y({ "text-fm-color-typo-disabled":
|
|
1072
|
-
}, V(e(
|
|
1074
|
+
class: Y({ "text-fm-color-typo-disabled": o.disabled })
|
|
1075
|
+
}, V(e(l)(`inventory.transfer.form.type.${U.value.toLocaleLowerCase("en-us")}`)), 3)
|
|
1073
1076
|
]),
|
|
1074
1077
|
_: 1
|
|
1075
1078
|
}),
|
|
1076
1079
|
r("div", {
|
|
1077
1080
|
class: Y([
|
|
1078
1081
|
"fm-typo-en-body-sm-400",
|
|
1079
|
-
|
|
1082
|
+
o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
|
|
1080
1083
|
])
|
|
1081
1084
|
}, " This field is locked from template. ", 2)
|
|
1082
1085
|
])
|
|
1083
1086
|
]),
|
|
1084
1087
|
r("div", gs, [
|
|
1085
1088
|
k(ge, {
|
|
1086
|
-
label: U.value === e(A).PURCHASE ? e(
|
|
1089
|
+
label: U.value === e(A).PURCHASE ? e(l)("inventory.transfer.form.purchaseFrom") : e(l)("inventory.transfer.form.transferFrom")
|
|
1087
1090
|
}, null, 8, ["label"]),
|
|
1088
1091
|
r("div", ks, [
|
|
1089
1092
|
k(fe, null, {
|
|
@@ -1091,7 +1094,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1091
1094
|
var h;
|
|
1092
1095
|
return [
|
|
1093
1096
|
r("span", {
|
|
1094
|
-
class: Y({ "text-fm-color-typo-disabled":
|
|
1097
|
+
class: Y({ "text-fm-color-typo-disabled": o.disabled })
|
|
1095
1098
|
}, V((h = L.value.find((ve) => ve.value === G.value)) == null ? void 0 : h.label), 3)
|
|
1096
1099
|
];
|
|
1097
1100
|
}),
|
|
@@ -1100,58 +1103,58 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1100
1103
|
r("div", {
|
|
1101
1104
|
class: Y([
|
|
1102
1105
|
"fm-typo-en-body-sm-400",
|
|
1103
|
-
|
|
1106
|
+
o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
|
|
1104
1107
|
])
|
|
1105
1108
|
}, " This field is locked from template. ", 2)
|
|
1106
1109
|
])
|
|
1107
1110
|
])
|
|
1108
1111
|
], 64)) : (F(), I(ae, { key: 1 }, [
|
|
1109
1112
|
k(ie, {
|
|
1110
|
-
label: e(
|
|
1113
|
+
label: e(l)("inventory.transfer.form.type.title"),
|
|
1111
1114
|
"model-value": U.value,
|
|
1112
|
-
"onUpdate:modelValue":
|
|
1115
|
+
"onUpdate:modelValue": f[0] || (f[0] = (h) => U.value = h),
|
|
1113
1116
|
items: [
|
|
1114
1117
|
{
|
|
1115
|
-
label: e(
|
|
1118
|
+
label: e(l)("inventory.transfer.form.type.purchase"),
|
|
1116
1119
|
value: e(A).PURCHASE,
|
|
1117
1120
|
disabled: !e($).locationOptionsTypePurchase.value.length,
|
|
1118
|
-
sublabel: e($).locationOptionsTypePurchase.value.length ? void 0 : e(
|
|
1121
|
+
sublabel: e($).locationOptionsTypePurchase.value.length ? void 0 : e(l)("inventory.transfer.form.noSupplierAvailable")
|
|
1119
1122
|
},
|
|
1120
1123
|
{
|
|
1121
|
-
label: e(
|
|
1124
|
+
label: e(l)("inventory.transfer.form.type.transfer"),
|
|
1122
1125
|
value: e(A).TRANSFER,
|
|
1123
1126
|
disabled: !e($).locationOptionsTypeTransfer.value.length,
|
|
1124
|
-
sublabel: e($).locationOptionsTypeTransfer.value.length ? void 0 : e(
|
|
1127
|
+
sublabel: e($).locationOptionsTypeTransfer.value.length ? void 0 : e(l)("inventory.transfer.form.noLocationAvailable")
|
|
1125
1128
|
}
|
|
1126
1129
|
],
|
|
1127
1130
|
rules: [e(Se)(1)(L.value)]
|
|
1128
1131
|
}, null, 8, ["label", "model-value", "items", "rules"]),
|
|
1129
1132
|
k(ie, {
|
|
1130
|
-
label: U.value === e(A).PURCHASE ? e(
|
|
1133
|
+
label: U.value === e(A).PURCHASE ? e(l)("inventory.transfer.form.purchaseFrom") : e(l)("inventory.transfer.form.transferFrom"),
|
|
1131
1134
|
modelValue: G.value,
|
|
1132
|
-
"onUpdate:modelValue":
|
|
1135
|
+
"onUpdate:modelValue": f[1] || (f[1] = (h) => G.value = h),
|
|
1133
1136
|
items: L.value
|
|
1134
1137
|
}, null, 8, ["label", "modelValue", "items"])
|
|
1135
1138
|
], 64)),
|
|
1136
1139
|
k(ke, {
|
|
1137
|
-
label: e(
|
|
1140
|
+
label: e(l)("inventory.transfer.form.reference"),
|
|
1138
1141
|
"label-mark": "optional",
|
|
1139
1142
|
modelValue: e(t).ref,
|
|
1140
|
-
"onUpdate:modelValue":
|
|
1143
|
+
"onUpdate:modelValue": f[2] || (f[2] = (h) => e(t).ref = h)
|
|
1141
1144
|
}, null, 8, ["label", "modelValue"]),
|
|
1142
1145
|
k(R, {
|
|
1143
|
-
label: e(
|
|
1146
|
+
label: e(l)("inventory.transfer.form.remark"),
|
|
1144
1147
|
"label-mark": "optional",
|
|
1145
1148
|
"max-length": 240,
|
|
1146
1149
|
modelValue: ee.value,
|
|
1147
|
-
"onUpdate:modelValue":
|
|
1148
|
-
class: Y([
|
|
1150
|
+
"onUpdate:modelValue": f[3] || (f[3] = (h) => ee.value = h),
|
|
1151
|
+
class: Y([o.disabled ? "text-fm-color-typo-disabled " : ""])
|
|
1149
1152
|
}, null, 8, ["label", "modelValue", "class"]),
|
|
1150
1153
|
e(s).isEnabled ? (F(), z(ie, {
|
|
1151
1154
|
key: 2,
|
|
1152
1155
|
modelValue: K.value,
|
|
1153
|
-
"onUpdate:modelValue":
|
|
1154
|
-
label: `NetSuite ${e(
|
|
1156
|
+
"onUpdate:modelValue": f[4] || (f[4] = (h) => K.value = h),
|
|
1157
|
+
label: `NetSuite ${e(l)("inventory.transfer.form.netsuite.subsidiary")}`,
|
|
1155
1158
|
items: e(s).subsidiaryOptions,
|
|
1156
1159
|
"label-mark": "required",
|
|
1157
1160
|
rules: [e(Ie)()]
|
|
@@ -1167,11 +1170,11 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1167
1170
|
}, [
|
|
1168
1171
|
k(W, {
|
|
1169
1172
|
modelValue: e(j),
|
|
1170
|
-
"onUpdate:modelValue":
|
|
1171
|
-
label: e(
|
|
1172
|
-
sublabel: e(
|
|
1173
|
+
"onUpdate:modelValue": f[5] || (f[5] = (h) => ce(j) ? j.value = h : null),
|
|
1174
|
+
label: e(l)("inventory.transfer.form.backdate.title"),
|
|
1175
|
+
sublabel: e(l)("inventory.transfer.form.backdate.subtitle"),
|
|
1173
1176
|
"label-placement": "right",
|
|
1174
|
-
disabled: x.value && !
|
|
1177
|
+
disabled: x.value && !o.lastClosingDate || o.disabled
|
|
1175
1178
|
}, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
|
|
1176
1179
|
r("div", {
|
|
1177
1180
|
class: Y({ hidden: g.value, "w-16": !g.value })
|
|
@@ -1180,13 +1183,13 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1180
1183
|
r("div", ws, [
|
|
1181
1184
|
k(ue, {
|
|
1182
1185
|
modelValue: e(_),
|
|
1183
|
-
"onUpdate:modelValue":
|
|
1186
|
+
"onUpdate:modelValue": f[6] || (f[6] = (h) => ce(_) ? _.value = h : null)
|
|
1184
1187
|
}, null, 8, ["modelValue"])
|
|
1185
1188
|
]),
|
|
1186
1189
|
r("div", Ss, [
|
|
1187
1190
|
k(X, {
|
|
1188
1191
|
modelValue: e(C),
|
|
1189
|
-
"onUpdate:modelValue":
|
|
1192
|
+
"onUpdate:modelValue": f[7] || (f[7] = (h) => ce(C) ? C.value = h : null)
|
|
1190
1193
|
}, null, 8, ["modelValue"])
|
|
1191
1194
|
])
|
|
1192
1195
|
])) : H("", !0)
|
|
@@ -1194,16 +1197,16 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1194
1197
|
e(J) ? (F(), z(oe, {
|
|
1195
1198
|
key: 0,
|
|
1196
1199
|
modelValue: e(J),
|
|
1197
|
-
"onUpdate:modelValue":
|
|
1198
|
-
rules: [e(gt)(new Date(
|
|
1200
|
+
"onUpdate:modelValue": f[8] || (f[8] = (h) => ce(J) ? J.value = h : null),
|
|
1201
|
+
rules: [e(gt)(new Date(o.lastClosingDate), /* @__PURE__ */ new Date())]
|
|
1199
1202
|
}, null, 8, ["modelValue", "rules"])) : H("", !0),
|
|
1200
|
-
x.value && !
|
|
1203
|
+
x.value && !o.lastClosingDate ? (F(), I("div", xs, [
|
|
1201
1204
|
k(ne, {
|
|
1202
1205
|
name: "error",
|
|
1203
1206
|
size: "sm",
|
|
1204
1207
|
class: "text-fm-color-typo-warning"
|
|
1205
1208
|
}),
|
|
1206
|
-
r("span", Fs, V(e(
|
|
1209
|
+
r("span", Fs, V(e(l)("inventory.transfer.form.backdate.error")), 1)
|
|
1207
1210
|
])) : H("", !0)
|
|
1208
1211
|
])) : H("", !0)
|
|
1209
1212
|
])
|
|
@@ -1222,17 +1225,17 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1222
1225
|
}
|
|
1223
1226
|
])
|
|
1224
1227
|
}, [
|
|
1225
|
-
r("div", Ts, V(e(
|
|
1228
|
+
r("div", Ts, V(e(l)("inventory.transfer.form.items.title")), 1),
|
|
1226
1229
|
r("div", Is, [
|
|
1227
1230
|
k(Ce, {
|
|
1228
|
-
disabled:
|
|
1229
|
-
label: e(
|
|
1231
|
+
disabled: o.disabled,
|
|
1232
|
+
label: e(l)("inventory.transfer.form.items.addItem"),
|
|
1230
1233
|
"prepend-icon": "add",
|
|
1231
1234
|
variant: "secondary",
|
|
1232
1235
|
"text-color": "primary",
|
|
1233
1236
|
"bg-color": "transparent",
|
|
1234
1237
|
"border-color": "primary",
|
|
1235
|
-
onClick:
|
|
1238
|
+
onClick: f[9] || (f[9] = (h) => Je()),
|
|
1236
1239
|
size: "md"
|
|
1237
1240
|
}, null, 8, ["disabled", "label"]),
|
|
1238
1241
|
e(t).template ? (F(), z(he, {
|
|
@@ -1240,30 +1243,30 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1240
1243
|
"z-index": 50
|
|
1241
1244
|
}, {
|
|
1242
1245
|
content: O(() => [
|
|
1243
|
-
r("div", null, V(e(
|
|
1246
|
+
r("div", null, V(e(l)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
|
|
1244
1247
|
]),
|
|
1245
1248
|
default: O(() => [
|
|
1246
|
-
k(
|
|
1247
|
-
"onUpdate:poItems":
|
|
1249
|
+
k(Ee, {
|
|
1250
|
+
"onUpdate:poItems": f[10] || (f[10] = (h) => e(t).items = h),
|
|
1248
1251
|
disabled: ""
|
|
1249
1252
|
})
|
|
1250
1253
|
]),
|
|
1251
1254
|
_: 1
|
|
1252
|
-
})) : (F(), z(
|
|
1255
|
+
})) : (F(), z(Ee, {
|
|
1253
1256
|
key: 1,
|
|
1254
|
-
"onUpdate:poItems":
|
|
1255
|
-
disabled:
|
|
1257
|
+
"onUpdate:poItems": f[11] || (f[11] = (h) => e(t).items = h),
|
|
1258
|
+
disabled: o.disabled || !!e(t).template
|
|
1256
1259
|
}, null, 8, ["disabled"]))
|
|
1257
1260
|
])
|
|
1258
1261
|
], 2),
|
|
1259
|
-
U.value === e(A).PURCHASE && S.value && e(b).enableTotalCost && ((
|
|
1262
|
+
U.value === e(A).PURCHASE && S.value && e(b).enableTotalCost && ((Be = o.modelValue) != null && Be.items.length) ? (F(), I("div", $s, [
|
|
1260
1263
|
k(W, {
|
|
1261
|
-
label: e(te) ? e(
|
|
1264
|
+
label: e(te) ? e(l)("inventory.transfer.form.items.fetchingData") : e(l)("inventory.transfer.form.items.comparePriceHistory"),
|
|
1262
1265
|
"prepend-icon": "compare_arrows",
|
|
1263
1266
|
"label-placement": "right",
|
|
1264
1267
|
"model-value": e(D),
|
|
1265
|
-
"onUpdate:modelValue":
|
|
1266
|
-
disabled: e(te) ||
|
|
1268
|
+
"onUpdate:modelValue": f[12] || (f[12] = (h) => ce(D) ? D.value = h : null),
|
|
1269
|
+
disabled: e(te) || o.disabled
|
|
1267
1270
|
}, null, 8, ["label", "model-value", "disabled"])
|
|
1268
1271
|
])) : H("", !0),
|
|
1269
1272
|
(F(), z(ye, {
|
|
@@ -1316,16 +1319,16 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1316
1319
|
lastClosingDate: {}
|
|
1317
1320
|
},
|
|
1318
1321
|
emits: ["update:show", "submitted"],
|
|
1319
|
-
setup(
|
|
1322
|
+
setup(n, { expose: v, emit: u }) {
|
|
1320
1323
|
var j;
|
|
1321
|
-
const i =
|
|
1324
|
+
const i = n, d = u, t = Ne(), l = Ae(), w = xe(), m = Re(), s = De(), { t: a } = me(), b = N(!1), c = N(!1), p = N(!1);
|
|
1322
1325
|
async function g(_) {
|
|
1323
1326
|
if (_) {
|
|
1324
1327
|
c.value = !1;
|
|
1325
1328
|
try {
|
|
1326
1329
|
await w.readSuppliers(), c.value = !0;
|
|
1327
1330
|
} catch {
|
|
1328
|
-
|
|
1331
|
+
l.open({
|
|
1329
1332
|
title: a("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
|
|
1330
1333
|
message: a("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
|
|
1331
1334
|
type: "error"
|
|
@@ -1334,7 +1337,7 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1334
1337
|
}
|
|
1335
1338
|
}
|
|
1336
1339
|
s.watchLocation(g);
|
|
1337
|
-
function
|
|
1340
|
+
function y() {
|
|
1338
1341
|
return {
|
|
1339
1342
|
remark: void 0,
|
|
1340
1343
|
ref: void 0,
|
|
@@ -1367,12 +1370,12 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1367
1370
|
template: i.templateId
|
|
1368
1371
|
};
|
|
1369
1372
|
}
|
|
1370
|
-
const S = ot(i, "show"), x = N(i.modelValue ??
|
|
1371
|
-
|
|
1373
|
+
const S = ot(i, "show"), x = N(i.modelValue ?? y()), E = N(((j = i.modelValue) == null ? void 0 : j._id) ?? `${Math.random()}`);
|
|
1374
|
+
$e(
|
|
1372
1375
|
() => i.show,
|
|
1373
1376
|
(_) => {
|
|
1374
1377
|
var C;
|
|
1375
|
-
_ && (p.value = !1, x.value = i.modelValue ??
|
|
1378
|
+
_ && (p.value = !1, x.value = i.modelValue ?? y(), E.value = ((C = i.modelValue) == null ? void 0 : C._id) ?? `${Math.random()}`);
|
|
1376
1379
|
}
|
|
1377
1380
|
);
|
|
1378
1381
|
const $ = P(() => !c.value || !p.value), U = P(() => {
|
|
@@ -1404,13 +1407,13 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1404
1407
|
const _ = x.value;
|
|
1405
1408
|
b.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: C, ...D }) => D));
|
|
1406
1409
|
try {
|
|
1407
|
-
await t.createPurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)),
|
|
1410
|
+
await t.createPurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)), l.open({
|
|
1408
1411
|
title: a("inventory.transfer.receiveRequest.create.success"),
|
|
1409
1412
|
message: a("inventory.transfer.receiveRequest.create.successMessage"),
|
|
1410
1413
|
type: "success"
|
|
1411
1414
|
}), d("update:show", !1), d("submitted");
|
|
1412
1415
|
} catch (C) {
|
|
1413
|
-
|
|
1416
|
+
l.open({
|
|
1414
1417
|
title: a("inventory.transfer.receiveRequest.create.error.title"),
|
|
1415
1418
|
message: a("inventory.transfer.receiveRequest.create.error.message"),
|
|
1416
1419
|
type: "error"
|
|
@@ -1423,13 +1426,13 @@ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }
|
|
|
1423
1426
|
const _ = x.value;
|
|
1424
1427
|
b.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: C, ...D }) => D));
|
|
1425
1428
|
try {
|
|
1426
|
-
await t.updatePurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)),
|
|
1429
|
+
await t.updatePurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)), l.open({
|
|
1427
1430
|
title: a("inventory.transfer.receiveRequest.update.success"),
|
|
1428
1431
|
message: a("inventory.transfer.receiveRequest.update.successMessage"),
|
|
1429
1432
|
type: "success"
|
|
1430
1433
|
}), d("update:show", !1), d("submitted");
|
|
1431
1434
|
} catch (C) {
|
|
1432
|
-
|
|
1435
|
+
l.open({
|
|
1433
1436
|
title: a("inventory.transfer.receiveRequest.update.error.title"),
|
|
1434
1437
|
message: a("inventory.transfer.receiveRequest.update.error.message"),
|
|
1435
1438
|
type: "error"
|